Repository navigation
simulation: keep polling the real-time outputs while the table is paused - #657
Conversation
A game without a time fence keeps running during a pause, and so do its lamps. Nobody polled its real-time feed until the resume, so it overflowed and DOF switched off for the rest of the game. The paused loop now polls every 10 ms without moving the time fence.
|
No actionable comments were generated in the recent review. Walkthrough
Change: Bug fix Merge Risk:
|
Confidence Score: 4/5
[Medium impact] The change affects real-time output polling for games that use a simulation thread. The PR appears safe to merge, with a non-blocking request to test polling during pause. Findings
SummaryKeeps real-time outputs flowing while the table is paused.
Reviews (1) · Last reviewed commit: "simulation: keep polling the real-time o..." · Reviewed by Greptile |
| { | ||
| // A game without a time fence keeps running while the table is paused, and so do its | ||
| // lamps. Keep taking its real-time outputs, or they pile up until the resume and overflow. | ||
| _realtimeOutputs?.PollFromSimulationThread(); |
There was a problem hiding this comment.
Paused polling lacks test coverage
The new paused-loop poll has no regression test. TheSimulationThreadTakesOverThePollFromTheFrame calls the poll helper directly, so it would still pass if this line were removed. Add a test that pauses the simulation, checks that outputs keep arriving, and checks that the time fence stays fixed.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Not adding one here. Testing this line means running the real simulation thread, and its loop only starts after a fully initialized physics engine (it waits for PhysicsEngine.IsInitialized, then gives up after 5 s). No test in the suite starts the thread; the existing ones call its methods directly. A test that pauses the running thread would need that harness first, which is out of scope for this fix.
There was a problem hiding this comment.
That’s fair. A regression test for this line would require bringing up the initialized physics engine and running the simulation thread, and the existing tests don’t provide that harness. I’ll withdraw the test-coverage comment for this change; the direct helper test is not a substitute for exercising the paused loop, but adding that infrastructure is out of scope here.
A game without a time fence keeps running while the table is paused, and so do its lamps. Nobody polled its real-time output feed until the table resumed, so the feed overflowed and DOF switched off for the rest of the game.
The simulation thread's paused loop now polls the real-time outputs every 10 ms, without moving the time fence.
Summary by CodeRabbit