fix(hooks): stop the hang after the binoculars scene (view finish job spinning on an object the instance map lacks) #103

Manually merged
github merged 1 commit from github-bot/gh-103 into main 2026-12-05 19:01:18 +00:00 AGit
Owner

@⁠Molier on GitHub · 2026-12-05 18:29 UTC · original
Molier:fix/view-finish-hang → main · +203 −3 · 2 files · 1 commits · merged 2026-12-05 19:00 UTC

Fixes #55, fixes #66 (the hang right after the binoculars scene in chapter 1, Donny / the boat mission: stall: no frame begun for 20 s, then the title's watchdog writes to 0 at +0x2215c35).

Cause

In all four hangs we captured (full stack dumps from larp's stall reporter, plus one crash dump), every title thread waits on one job thread, and that thread is not waiting: it spins in the view finish job's lookup of an object in the frame's instance map. That lookup never stops at an empty slot (the map's other lookup does), so an object the map does not hold makes it loop for ever. The whole frame waits on it, nothing is submitted ("between submissions (of 0 lists), 0 threads of ours noted a wait"), and ~30 s later the watchdog ends the process.

Change

In the view_finished hook, before the title's job runs, larp looks up every object of the view's list the same way the job will. Objects the map does not hold are left out of a copy of the list for that call; the title's own list pointer and count are restored afterwards. Each case is logged (view finish: the frame's instance map does not hold the object ...) with the object's pool, key and whether the map holds it under the pool index's low four bits.

  • Normal frames: one lookup per listed object, the list is untouched.
  • When it fires: those objects are not drawn in that view for that one frame, instead of the process hanging.
  • The offsets live in the per-build table in crates/larp-game/src/hooks.rs, like the other hooks.

Tested

RX 9070 XT, Linux (Proton GE 11-16), on a branch with this commit on top of current main: the scene that hung 4 times out of 4 played through. The log showed the guard firing once: one frame, one view, 16 of 610 objects (pools 1 and 4) not in the map, none of them held under another pool index. So it is not a truncated pool index; a few objects simply reach the job without having been inserted for that frame, around the scene change. Nothing visibly missing.

This is a guard, not the root fix of why those objects were not inserted; the log lines make that traceable if anyone wants to dig further. Windows not tested by me; the hook path is the same.

**@⁠Molier** on GitHub · 2026-12-05 18:29 UTC · [original](https://github.com/gamingwithhomie/larp/pull/103) `Molier:fix/view-finish-hang` → `main` · +203 −3 · 2 files · 1 commits · merged 2026-12-05 19:00 UTC Fixes #55, fixes #66 (the hang right after the binoculars scene in chapter 1, Donny / the boat mission: `stall: no frame begun for 20 s`, then the title's watchdog writes to 0 at `+0x2215c35`). ## Cause In all four hangs we captured (full stack dumps from larp's stall reporter, plus one crash dump), every title thread waits on one job thread, and that thread is not waiting: it spins in the view finish job's lookup of an object in the frame's instance map. That lookup never stops at an empty slot (the map's other lookup does), so an object the map does not hold makes it loop for ever. The whole frame waits on it, nothing is submitted ("between submissions (of 0 lists), 0 threads of ours noted a wait"), and ~30 s later the watchdog ends the process. ## Change In the `view_finished` hook, before the title's job runs, larp looks up every object of the view's list the same way the job will. Objects the map does not hold are left out of a copy of the list for that call; the title's own list pointer and count are restored afterwards. Each case is logged (`view finish: the frame's instance map does not hold the object ...`) with the object's pool, key and whether the map holds it under the pool index's low four bits. - Normal frames: one lookup per listed object, the list is untouched. - When it fires: those objects are not drawn in that view for that one frame, instead of the process hanging. - The offsets live in the per-build table in `crates/larp-game/src/hooks.rs`, like the other hooks. ## Tested RX 9070 XT, Linux (Proton GE 11-16), on a branch with this commit on top of current main: the scene that hung 4 times out of 4 played through. The log showed the guard firing once: one frame, one view, 16 of 610 objects (pools 1 and 4) not in the map, none of them held under another pool index. So it is not a truncated pool index; a few objects simply reach the job without having been inserted for that frame, around the scene change. Nothing visibly missing. This is a guard, not the root fix of why those objects were not inserted; the log lines make that traceable if anyone wants to dig further. Windows not tested by me; the hook path is the same.
The title's view finish job looks up each listed object in the frame's
instance map with a probe that never stops at an empty slot. Right after the
binoculars scene in chapter 1 (Donny, the boat mission), a few objects reach
that job without having been put in the map: the job spins, no frame begins
and the title's watchdog ends the process with a write to 0 (issues #55, #66).

Before the job runs, larp now looks up every object of the view's list the way
the job will, leaves out of the list the job reads the ones the map does not
hold (the title's own list is put back when the job returns) and logs each case
with the object's pool, key and whether the map holds it under the pool
index's low four bits.

Seen on the first run past the scene: one frame, one view, 16 of 610 objects
(pools 1 and 4) not in the map, none held under another pool, so it is not a
truncated pool index. The scene played on normally; nothing visible was missing.
Normal frames cost one lookup per listed object and leave the list as it is.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-05 18:30:51 +00:00
github manually merged commit 882c13ffb0 into main 2026-12-05 19:01:17 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.