Race feed freezes when the local racer's lap goes down #14
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
Reference
mintopia/blur#14
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
race::Feed::update(src/host/race_feed.cpp) treats any drop of the local racer's lap (me->lap < prev_lap_) as race teardown and returns without publishing. But the game itself can lower a racer's lap mid-race (driving back over the start/finish line, or being reset behind it): the lap byte at racer+0xf44goes down and the HUD shows it too.Evidence, capture
work/ws-capture/runs/20261019-112144(2-player LAN,USA_LA_River_3, offsets in seconds from alpha's connect):Laps 1/3inbravo/client-r180.pngandclient-r300.png, so the drop is real in bravo's game, not a network glitch.bravo.jsonl) publishes nothing for itself after 374.4 except while its lap is back at 2 (411.7–479);race_timefreezes (finalrace_result.time161 at 573 although the race ran ~370 s).What to build
Tell real teardown apart from a game-side lap decrease. Teardown is the racer list going away or lap dropping to 0/below 1 (
me->lap < 1is already handled above); a decrease that stays ≥ 1 is a normal update. Keep therace_timeaccumulator correct across a decrease (it currently adds the lap timer at each lap change when the timer drops; make sure a decrease followed by a re-increment does not double count or lose time).Document in
docs/state-websocket.mdthat a racer'slapcan go down during a race (the game's own counter).Acceptance criteria
tests/race_feed_test.cpp: local lap 2→1→2 mid-race keeps publishinglap,standings,speeds, andrace_timekeeps increasingdocs/state-websocket.mdnotes thatlapcan decreaseBLUR_ENGINE=recompFix:
Feed::updatenow treats a local lap decrease as teardown only after the player has finished (finished_); a mid-race decrease (still >= 1) is a normal update, and therace_timeaccumulator handles decrease/re-increment (timer-drop rule unchanged). Added unit test (lap 2->1->2 keeps lap/standings/speeds, race_time keeps increasing); teardown tests still pass; documented in docs/state-websocket.md. NOT verified on BLUR_ENGINE=recomp (no game/runtime in this unattended session) - needs a live 2-player run.Completed and merged by Harmonic (task 16).