fix(os): consume a timer holder's period in WaitAny #2141

Open
dazemc wants to merge 5 commits from dazemc/Longshot:fix/os-timer-holder-period into main
Contributor

Summary

A periodic TimerEvent linked into a multi-wait is reported ready forever. wait_any asks holder_ready, which answers "due" whenever due_ns has passed, but nothing on that path advances due_ns — while both single-timer paths do (WaitTimerEvent, TryWaitTimerEvent: while (t->due_ns <= now) t->due_ns += t->period_ns). So the first expiry makes WaitAny/TimedWaitAny/TryWaitAny return that holder on every call, the period is ignored, and a guest wait-any loop spins.

What changed:

  • timer_consumed_locked (new): advances a periodic timer's due_ns by whole periods, skipping any that passed meanwhile, as a hardware timer would. holder_ready checks readiness, consumes a ready timer and reads its next deadline under the timer lock; wait_any's scan takes the next deadline from there. WaitTimerEvent uses the helper; TryWaitTimerEvent uses the same calculation under one lock acquisition.
  • One-shot timers (period 0) are left as they are, with a comment: there is no SDK evidence here of a consume rule.
  • Synchronization: timer consumption and TryWaitTimerEvent's check-and-consume are under the timer's t->lk, so WaitAny's scan and a single-timer wait cannot both consume the same periodic expiry.

Five commits. refactor(os): keep the timer fix without the multi-wait holder-array change removes the multi-wait holder-array fixes that had been in this branch, as the review asked. They are split into open, ready #2445; its current rebased head is recorded there. This PR remains only the timer-period topic. The last, test(os): run the multi-wait test on a tree without the extracted helper, extracts timer_consumed_locked only when the tree has it, so the same committed test runs against main and fails there (below).

This head is c11cd1356: host/nn_os_sync.c +29/−11, tests/test_multiwait_wake.py +118/−6, the same content these files carry at 10bea861/7da472869. The last commit is tests/ only (+12/−5 over 91add521).

Read host/nn_os_sync.c's timer_consumed_locked, holder_ready, wait_any, WaitTimerEvent and TryWaitTimerEvent first; the test is tests/test_multiwait_wake.py.

Rebase status (2026-11-25, current): 66e327e62 → c11cd1356 onto main @ 8f7300756701b7c9a278e576bb075ac20e622a32. Stable patch-id 723a5721c725645fe6bec09bb0fbc558a1bd1a4f is unchanged and main's old-base→new-main file intersection with this PR is empty. The evidence already named below (suite, platform, in-game and measurement, as applicable) therefore still stands at the historical heads that produced it. Earlier rebase notes are history; where they say "this head", they mean the evidence commit named beside that run, not c11cd1356.

Testing

Rebase (2026-11-25). Rebased onto origin/main be663a08a30fa953420104d3cef6877bed6674a2. Old head 7da4728698bc2b3350540247cfe7cc5550337450 → new head 66e327e62865b5a44e9c6a6c887f7f2051168e63. git diff -U0 8aa5ab87..7da472869 and git diff -U0 be663a08a3..66e327e6 hold the identical changed-line set (154 added/removed lines, 0 differing), so the rebase changed nothing this PR writes. Main's new commits since 8aa5ab87 touch neither host/nn_os_sync.c nor tests/test_multiwait_wake.py — the intersection is empty — so the suite, windowed run and Windows whole-pack run below still describe this PR's code; they were taken at 10bea861/7da472869, message-only apart, and this rebase is the only change since. No suite re-run is owed.

Tested: Linux on this PC, kernel 7.3.5-zen1, RTX 4070 Ti (NVIDIA 620.73.04). python -I -B tests/run_all.py --strict test_multiwait_wake through the PC's job queue at 91add521: 1 check, 0 skipped, 1 passed, 0 failed, exit 0 (queue row pr2141-mw-91add521, whose cwd is a worktree whose HEAD is 91add521; evidence log /home/daze/.local/share/longshot-dev/suite-evidence/pr2141-mw-91add521.log, sha256 42ec61511e346bc1e6544d8ebf665f13483e70e3e7938fd6b220c6f463873f00, read 2026-11-24T00:54:44-08:00). It is superseded at this head by the full suite below. An earlier row, w3-a-final, prints the same output but ran in /home/daze/GitHub/Longshot-2141-12ed3a32, i.e. at 12ed3a32, and is not evidence for this head.

Suite at this head. mise run test -- --jobs 5 at 10bea861c685648d39e85764322f82f7644a9af0, in a scope capped at 12 GiB (systemd-run --user --scope -p MemoryMax=12G -p MemorySwapMax=0), wrote prrefresh-logs/suite-2141-10bea861.log (sha256 5dcaeb9da1673119f0dbfe68a6672eb93a6efb2359a0b1d98675f64406f81234): 961 checks, 18 skipped, 5 at once (linux), 942 passed, 19 failed, 18 skipped in 406 s (linux, 5 at once); JUnit tests="979" failures="19" skipped="18" time="406.032"; peak 8,084,963,328 B, no guard fired. The 19 failing ids are exactly the CORE set of SUITE-COMPARISON-RULE.md Amendment 1 with the same exception classes; no id outside CORE∪FLAKY failed and no FLAKY id failed, so the head passes under Amendment 1. tests/test_multiwait_wake.py is a pass row (0.7 s).

Tested in the game: Windowed run at 10bea861c685648d39e85764322f82f7644a9af0 (version v3.2.0-17-g10bea861c, queue job 2141-windowed-10bea861-b, mode shared): Kokiri Forest (child), 948x512 logical window on workspace 2 of HDMI-A-2 (Hyprland, output 3840x2160), ~17.0 s of measured play after the 10 s warm-up ((play-end present 3201 − play-start present 1583 − 600)/60 = 16.97 s), 60.1 fps at the end, age child, life 12/12, no crash, clean quit (state: finished, exit_code: 0, stop_method: quit). hyprctl clients -j during play shows the game window class dev.magicbean.Longshot, pid 266854, mapped, 948x512; two external grim shots were taken during play (3840x2160 each); the log has no vk: no window. Linux/Hyprland (Wayland), RTX 4070 Ti, driver 620.73.04. Run folder ~/.local/share/longshot-dev/runs/control/2141-10bea861-windowed-20261124.

On main, the same committed test fails for the bug's reason. tests/test_multiwait_wake.py at 10bea861 extracts timer_consumed_locked only when the tree has it (maybe_block), so python -I -B tests/test_multiwait_wake.py --source /home/daze/GitHub/Longshot-main-8aa5ab87/host/nn_os_sync.c compiles against main 8aa5ab87 and exits 1 with FAIL: TryWaitAny left the timer holder due at 9999999 (want 10999999: the next period on), FAIL: TryWaitAny reported the periodic timer holder again without a period passing, FAIL: a timer 3.5 periods overdue moved on to 6500000 (want 10500000: four periods on) and FAIL: TryWaitAny reported the long-overdue timer holder again. No assertion changed: the only difference on main is that the helper it does not have is not extracted. At 10bea861 the same file passes (targeted: ok, all: ok, PASS, exit 0).

A game smoke and a host build exist at earlier trees (a3dae742/805361a2, before the final timer synchronization commit and before the split): Kokiri Forest (child), 20 s measured after warm-up, the game boots and plays, 1862 frames, 93.1 fps, median 10.66 ms, p99 14.48 ms (base: 1805 frames, 90.3 fps, median 11.08 ms); Linux pack over a2dc5385 compiles host/nn_os_sync.c and links (37 s); Windows compiles host/nn_os_sync.c as an x86-64 COFF object with llvm-mingw 20261104's clang 23.1.5 — a compile, not a link. They are not runs of this head.

Tested on Windows (llvm-mingw). At 10bea861 on a Windows 11 x86-64 box (Acer Nitro AN515-57, i5-11400H, llvm-mingw 20261104 UCRT), nx2\build.py --standalone with RX_VK_ONLY=1 compiled 268 renderer objects of this head and linked them: compiled in 149 s, 0 failed, link 1 s, 6 jobs, lifted code … (0 files) in the log, so no game data was read. Result: C:\Users\daze\longshot-2141\work\sa\build\longshot_vk.dll, 17,704,960 bytes, sha256 aabd61c392275b57e6b2074dc2bbd3c753a5fc44f79fd0a3df882614bac39a9d, PE32+ (0x20B) IMAGE_FILE_MACHINE_AMD64 / IMAGE_SUBSYSTEM_WINDOWS_GUI, exporting mkwvk_init, mkwvk_close_asked, mkwvk_crash_close and mkwvk_crash_page; llvm-strings finds 10bea861 (source 3f45af4d) in it. The checkout's git rev-parse HEAD was 10bea861c685648d39e85764322f82f7644a9af0 (.head beside the log); build log build-10bea861-clean.log, sha256 feaf8b63863ec67262bf43fda9c03bf70fa1da404b0f64164773c638cdc18632. The file this PR changes compiles as well: host/nn_os_sync.c → host_nn_os_sync.obj, 136,205 bytes, sha256 8cc7d3a5dda6fefecec33e9409e2160b4a312f1ce97ec03b560695ced718b6c8, COFF machine 0x8664, with nx2/build.py's own host flags and the generated headers the tree writes itself (a64_suyu.h there is byte-identical to the one the build wrote: sha256 a5b462d01483576cf34f8925d21c3365ae661a5077054a33fa6080a321583bed). This is a link, not the single-object compile the earlier tree had; it is the renderer DLL alone, so that build could not start longshot.exe — the whole pack was built and started separately at this head (next paragraph).

Tested on Windows, the whole pack — a whole-pack start, not the DLL-only build above. The same box then built the pack at 10bea861c685648d39e85764322f82f7644a9af0 and started it. python -I nx2\lift.py --standalone --write wrote 88 code files into work\sa\gen from the game copy on that box (244 s, EXITCODE=0); python -I nx2\build.py --standalone --jobs 4 reported compiled in 1326s, 0 failed, linked …\work\sa\build\longshot.exe: 539 MB (4s) and EXITCODE=0, and left the longshot_vk.dll beside it as the last link left it (the DLL above, not relinked). C:\Users\daze\longshot-2141\work\sa\build\longshot.exe is 566,189,568 bytes, sha256 DFF74F4061100FBF4FFBD6317E71D370F7CB66DB9345F2A0BCE26D292305AC21, and the run's own replies read version: 10bea861 (source 3f45af4d). Started windowed at the kokiri-start save, it reached play at frame 2776 on KokiriForest_Child and was still on that map at the last play sample (frame 4664): 1,888 frames in play over 64.5 s, 30.3 fps at the end, age child, life 12/12, no crash, clean quit (control: quit asked by a client, control: exiting). The GPU is the box's own NVIDIA GeForce GTX 1650 and the log says vk: driver: NVIDIA 610.62 (Turing, driver id 4, VRAM 3,935 MB, RAM 7,971 MB; the low-memory notice that box shows was dismissed before play). The window is real: C:\Users\daze\smoke.log records window[in-play], window[mid-play] and window[end-play] for handle=1311358 title='Longshot' … visible=True; C:\Users\daze\runs\win1\log.txt has no vk: no window and ends by writing frame 4689's present to C:\Users\daze\runs\shots\bridge.png (2,765,798 bytes), the game's own picture of the run. The evidence stays on that box: run log C:\Users\daze\runs\win1\log.txt (686,918 bytes), C:\Users\daze\smoke.log (24,979 bytes), build log C:\Users\daze\build-full.log (30,712 bytes, sha256 c63b5839ffe21cf2ee020dd183488f722284620556967faea8447928f095e1f7). The head has since moved to 7da472869 by a message-only rewrite; git diff 10bea861..7da472869 is empty and the tree is unchanged (4d9cc08e), so this run describes the current tree.

Still to test:

  • Done — this head in the game, by hand: windowed run at 10bea861 (job 2141-windowed-10bea861-b), Kokiri Forest (child), ~17.0 s measured play after warm-up, exit 0, no crash.
  • Done — the whole-pack start on Windows, by hand: at 10bea861 the same box lifted the pack, built longshot.exe (compiled in 1326s, 0 failed) and played KokiriForest_Child windowed — 1,888 frames in play over 64.5 s, 30.3 fps at the end, visible window, clean quit (Tested).
  • Done — a gate-compliant mise run test at this head, by hand: 942 passed, 19 failed, 18 skipped in 406 s (linux, 5 at once), all 19 CORE, 0 outside (above).

Measurements

Nothing to measure for frame time: the fix is latent on the shipped game — no path we can observe links a periodic timer into WaitAny. This head has now been run in the game windowed (10bea861, job 2141-windowed-10bea861-b, Kokiri Forest (child), ~17.0 s measured play after warm-up, exit 0, no crash); the earlier game smoke at a3dae742/805361a2 is not a run of this head.

Risks

Could break: a guest that links a periodic timer into a multi-wait now sees the period honoured instead of an always-ready holder (the intended behaviour); one-shot timers are unchanged on purpose. The consume and the check happen under the timer lock, so a long-overdue timer is advanced in one step rather than in a catch-up loop while mw_lock is held. No switch; a revert is enough. Nothing changes for saves, longshot_options.ini or the caches.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit. — Rebased head c11cd1356 is directly on main @ 8f7300756701b7c9a278e576bb075ac20e622a32; the preserved diff is the single topic described in Summary.
  • Tested on my own PC, in the game for a change the game runs. Windowed run at 10bea861 (job 2141-windowed-10bea861-b, Kokiri Forest (child), ~17.0 s measured play, exit 0, no crash, hyprctl window and external grim shots during play); details in Tested.
  • mise run test passes (any failure that also fails on main is named). Suite at 10bea861 (prrefresh-logs/suite-2141-10bea861.log, sha256 5dcaeb9d…): 961 checks, 18 skipped, 5 at once (linux), 942 passed, 19 failed, 18 skipped in 406 s (linux, 5 at once); the 19 failing ids are exactly Amendment 1's CORE set with the same exception classes, no id outside CORE∪FLAKY (details in Tested).
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test that fails on main and passes here. tests/test_multiwait_wake.py at 10bea861 extracts timer_consumed_locked only when the tree has it (maybe_block), so the committed file runs against main 8aa5ab87 and exits 1: FAIL: TryWaitAny left the timer holder due at 9999999 (want 10999999: the next period on), FAIL: TryWaitAny reported the periodic timer holder again without a period passing, FAIL: a timer 3.5 periods overdue moved on to 6500000 (want 10500000: four periods on), FAIL: TryWaitAny reported the long-overdue timer holder again (python -I -B tests/test_multiwait_wake.py --source /home/daze/GitHub/Longshot-main-8aa5ab87/host/nn_os_sync.c). The same file passes at 10bea861 (targeted: ok, all: ok, PASS, exit 0), including the two-thread case. No assertion was removed: the last commit is tests/test_multiwait_wake.py +12/−5.
  • A check under tests/ that reads changed source is updated, not weakened. tests/test_multiwait_wake.py gains the periodic-timer and concurrent-waiter cases; the allocation-failure and self-move cases moved to fix/os-multiwait-holder-alloc with their fix, and no timer assertion was removed.
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. Windows: linked at this head, not a single-object compile. On a Windows 11 x86-64 box (i5-11400H, llvm-mingw 20261104 UCRT) nx2\build.py --standalone with RX_VK_ONLY=1 compiled 268 renderer objects of 10bea861 and linked longshot_vk.dll (compiled in 149 s, 0 failed, link 1 s) from a checkout whose git rev-parse HEAD is 10bea861c685…: C:\Users\daze\longshot-2141\work\sa\build\longshot_vk.dll, 17,704,960 bytes, sha256 aabd61c392275b57e6b2074dc2bbd3c753a5fc44f79fd0a3df882614bac39a9d, PE32+ IMAGE_FILE_MACHINE_AMD64 / IMAGE_SUBSYSTEM_WINDOWS_GUI, exports mkwvk_init, mkwvk_close_asked, mkwvk_crash_close, mkwvk_crash_page, and the DLL carries 10bea861 (source 3f45af4d). The changed file compiles too: host/nn_os_sync.c → 136,205-byte COFF object host_nn_os_sync.obj (machine 0x8664, sha256 8cc7d3a5…). Linux: the pack over a2dc5385 compiled host/nn_os_sync.c and linked (37 s, earlier tree). Run as well at this head: longshot.exe with the whole pack — built over the game-derived work/sa/gen on that box — started and played (KokiriForest_Child windowed, 1,888 frames in play over 64.5 s, 30.3 fps at the end, clean quit; Tested).
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers. All five commits carry one — assisted by DeepSeek V4.1 Flash throughout; the earlier commits gained the trailer in this rewrite, so it states the author's mapping rather than a per-commit log:
    • 022f2f576 (was 601a1ecbd) Assisted-by: DeepSeek V4.1 Flash 1017 (opencode-go)
    • 4159dc5f7 (was d08b30823) Assisted-by: DeepSeek V4.1 Flash 1017 (opencode-go)
    • 39555b33c (was 31ff8d8a4) Assisted-by: DeepSeek V4.1 Flash 1017 (opencode-go)
    • e93cc8eaa (was bdabdbff2) Assisted-by: opencode (DeepSeek V4.1 Flash)
    • 66e327e62 (was 7da472869) Assisted-by: opencode (DeepSeek V4.1 Flash)
      Message-only: git diff --stat 10bea861..7da472869 and git diff 10bea861..7da472869 are both empty and the tree is the same object, so the tests, suite and windowed run quoted above at 10bea861 describe this head's tree.

Ready to merge

  • Everything in Still to test has run, its results in Tested. Windows' whole-pack start ran at 10bea861c685: longshot.exe, 566,189,568 bytes, sha256 DFF74F4061100FBF4FFBD6317E71D370F7CB66DB9345F2A0BCE26D292305AC21 — a whole-pack start, not the DLL-only build — on NVIDIA GeForce GTX 1650, vk: driver: NVIDIA 610.62, KokiriForest_Child at the first and last play sample, 30.3 fps at the end, 1,888 frames in play over 64.5 s, visible=True on handle=1311358 with no vk: no window (C:\Users\daze\runs\win1\log.txt, C:\Users\daze\smoke.log, C:\Users\daze\runs\shots\bridge.png); the in-game item ran at this head too (windowed at 10bea861).
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). One Tier 1 machine ran an earlier tree: Linux on this PC, RTX 4070 Ti, NVIDIA 620.70.06. Tier 1's Windows half has not.
  • Approved in review, every comment answered. No review yet; the Beanstalk approval is waiting for a BigBeans member.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold. Every build and test job on this head is still Blocked by required conditions; the description check is the only one that has passed.
## Summary A periodic `TimerEvent` linked into a multi-wait is reported ready forever. `wait_any` asks `holder_ready`, which answers "due" whenever `due_ns` has passed, but nothing on that path advances `due_ns` — while both single-timer paths do (`WaitTimerEvent`, `TryWaitTimerEvent`: `while (t->due_ns <= now) t->due_ns += t->period_ns`). So the first expiry makes `WaitAny`/`TimedWaitAny`/`TryWaitAny` return that holder on every call, the period is ignored, and a guest wait-any loop spins. What changed: - **`timer_consumed_locked`** (new): advances a periodic timer's `due_ns` by whole periods, skipping any that passed meanwhile, as a hardware timer would. `holder_ready` checks readiness, consumes a ready timer and reads its next deadline under the timer lock; `wait_any`'s scan takes the next deadline from there. `WaitTimerEvent` uses the helper; `TryWaitTimerEvent` uses the same calculation under one lock acquisition. - **One-shot timers (period 0)** are left as they are, with a comment: there is no SDK evidence here of a consume rule. - **Synchronization**: timer consumption and `TryWaitTimerEvent`'s check-and-consume are under the timer's `t->lk`, so `WaitAny`'s scan and a single-timer wait cannot both consume the same periodic expiry. **Five commits.** `refactor(os): keep the timer fix without the multi-wait holder-array change` removes the multi-wait holder-array fixes that had been in this branch, as the review asked. They are split into open, ready #2445; its current rebased head is recorded there. This PR remains only the timer-period topic. The last, `test(os): run the multi-wait test on a tree without the extracted helper`, extracts `timer_consumed_locked` only when the tree has it, so the same committed test runs against `main` and fails there (below). This head is `c11cd1356`: `host/nn_os_sync.c` +29/−11, `tests/test_multiwait_wake.py` +118/−6, the same content these files carry at `10bea861`/`7da472869`. The last commit is `tests/` only (+12/−5 over `91add521`). Read `host/nn_os_sync.c`'s `timer_consumed_locked`, `holder_ready`, `wait_any`, `WaitTimerEvent` and `TryWaitTimerEvent` first; the test is `tests/test_multiwait_wake.py`. **Rebase status (2026-11-25, current):** `66e327e62` → `c11cd1356` onto `main @ 8f7300756701b7c9a278e576bb075ac20e622a32`. Stable patch-id `723a5721c725645fe6bec09bb0fbc558a1bd1a4f` is unchanged and main's old-base→new-main file intersection with this PR is **empty**. The evidence already named below (suite, platform, in-game and measurement, as applicable) therefore still stands at the historical heads that produced it. Earlier rebase notes are history; where they say "this head", they mean the evidence commit named beside that run, not `c11cd1356`. ## Testing **Rebase (2026-11-25).** Rebased onto `origin/main` `be663a08a30fa953420104d3cef6877bed6674a2`. Old head `7da4728698bc2b3350540247cfe7cc5550337450` → new head `66e327e62865b5a44e9c6a6c887f7f2051168e63`. `git diff -U0 8aa5ab87..7da472869` and `git diff -U0 be663a08a3..66e327e6` hold the identical changed-line set (154 added/removed lines, 0 differing), so the rebase changed nothing this PR writes. Main's new commits since `8aa5ab87` touch neither `host/nn_os_sync.c` nor `tests/test_multiwait_wake.py` — the intersection is empty — so the suite, windowed run and Windows whole-pack run below still describe this PR's code; they were taken at `10bea861`/`7da472869`, message-only apart, and this rebase is the only change since. No suite re-run is owed. **Tested:** Linux on this PC, kernel 7.3.5-zen1, RTX 4070 Ti (NVIDIA 620.73.04). `python -I -B tests/run_all.py --strict test_multiwait_wake` through the PC's job queue at `91add521`: 1 check, 0 skipped, 1 passed, 0 failed, exit 0 (queue row `pr2141-mw-91add521`, whose `cwd` is a worktree whose `HEAD` is `91add521`; evidence log `/home/daze/.local/share/longshot-dev/suite-evidence/pr2141-mw-91add521.log`, sha256 `42ec61511e346bc1e6544d8ebf665f13483e70e3e7938fd6b220c6f463873f00`, read 2026-11-24T00:54:44-08:00). It is superseded at this head by the full suite below. An earlier row, `w3-a-final`, prints the same output but ran in `/home/daze/GitHub/Longshot-2141-12ed3a32`, i.e. at `12ed3a32`, and is not evidence for this head. **Suite at this head.** `mise run test -- --jobs 5` at `10bea861c685648d39e85764322f82f7644a9af0`, in a scope capped at 12 GiB (`systemd-run --user --scope -p MemoryMax=12G -p MemorySwapMax=0`), wrote `prrefresh-logs/suite-2141-10bea861.log` (sha256 `5dcaeb9da1673119f0dbfe68a6672eb93a6efb2359a0b1d98675f64406f81234`): `961 checks, 18 skipped, 5 at once (linux)`, `942 passed, 19 failed, 18 skipped in 406 s (linux, 5 at once)`; JUnit `tests="979" failures="19" skipped="18" time="406.032"`; peak 8,084,963,328 B, no guard fired. The 19 failing ids are exactly the CORE set of `SUITE-COMPARISON-RULE.md` Amendment 1 with the same exception classes; no id outside CORE∪FLAKY failed and no FLAKY id failed, so the head passes under Amendment 1. `tests/test_multiwait_wake.py` is a `pass` row (0.7 s). **Tested in the game:** Windowed run at `10bea861c685648d39e85764322f82f7644a9af0` (version `v3.2.0-17-g10bea861c`, queue job `2141-windowed-10bea861-b`, mode `shared`): Kokiri Forest (child), 948x512 logical window on workspace 2 of HDMI-A-2 (Hyprland, output 3840x2160), ~17.0 s of measured play after the 10 s warm-up ((play-end present 3201 − play-start present 1583 − 600)/60 = 16.97 s), 60.1 fps at the end, age child, life 12/12, no crash, clean quit (`state: finished`, `exit_code: 0`, `stop_method: quit`). `hyprctl clients -j` during play shows the game window class `dev.magicbean.Longshot`, pid 266854, mapped, 948x512; two external `grim` shots were taken during play (3840x2160 each); the log has no `vk: no window`. Linux/Hyprland (Wayland), RTX 4070 Ti, driver 620.73.04. Run folder `~/.local/share/longshot-dev/runs/control/2141-10bea861-windowed-20261124`. On `main`, the same committed test fails for the bug's reason. `tests/test_multiwait_wake.py` at `10bea861` extracts `timer_consumed_locked` only when the tree has it (`maybe_block`), so `python -I -B tests/test_multiwait_wake.py --source /home/daze/GitHub/Longshot-main-8aa5ab87/host/nn_os_sync.c` compiles against `main` `8aa5ab87` and exits 1 with `FAIL: TryWaitAny left the timer holder due at 9999999 (want 10999999: the next period on)`, `FAIL: TryWaitAny reported the periodic timer holder again without a period passing`, `FAIL: a timer 3.5 periods overdue moved on to 6500000 (want 10500000: four periods on)` and `FAIL: TryWaitAny reported the long-overdue timer holder again`. No assertion changed: the only difference on `main` is that the helper it does not have is not extracted. At `10bea861` the same file passes (`targeted: ok`, `all: ok`, `PASS`, exit 0). A game smoke and a host build exist at earlier trees (`a3dae742`/`805361a2`, before the final timer synchronization commit and before the split): Kokiri Forest (child), 20 s measured after warm-up, the game boots and plays, 1862 frames, 93.1 fps, median 10.66 ms, p99 14.48 ms (base: 1805 frames, 90.3 fps, median 11.08 ms); Linux pack over `a2dc5385` compiles `host/nn_os_sync.c` and links (37 s); Windows compiles `host/nn_os_sync.c` as an x86-64 COFF object with llvm-mingw 20261104's clang 23.1.5 — a compile, not a link. They are not runs of this head. **Tested on Windows (llvm-mingw).** At `10bea861` on a Windows 11 x86-64 box (Acer Nitro AN515-57, i5-11400H, llvm-mingw 20261104 UCRT), `nx2\build.py --standalone` with `RX_VK_ONLY=1` compiled 268 renderer objects of this head and linked them: `compiled in 149 s, 0 failed`, link 1 s, 6 jobs, `lifted code … (0 files)` in the log, so no game data was read. Result: `C:\Users\daze\longshot-2141\work\sa\build\longshot_vk.dll`, 17,704,960 bytes, sha256 `aabd61c392275b57e6b2074dc2bbd3c753a5fc44f79fd0a3df882614bac39a9d`, PE32+ (`0x20B`) `IMAGE_FILE_MACHINE_AMD64` / `IMAGE_SUBSYSTEM_WINDOWS_GUI`, exporting `mkwvk_init`, `mkwvk_close_asked`, `mkwvk_crash_close` and `mkwvk_crash_page`; `llvm-strings` finds `10bea861 (source 3f45af4d)` in it. The checkout's `git rev-parse HEAD` was `10bea861c685648d39e85764322f82f7644a9af0` (`.head` beside the log); build log `build-10bea861-clean.log`, sha256 `feaf8b63863ec67262bf43fda9c03bf70fa1da404b0f64164773c638cdc18632`. The file this PR changes compiles as well: `host/nn_os_sync.c` → `host_nn_os_sync.obj`, 136,205 bytes, sha256 `8cc7d3a5dda6fefecec33e9409e2160b4a312f1ce97ec03b560695ced718b6c8`, COFF machine `0x8664`, with `nx2/build.py`'s own host flags and the generated headers the tree writes itself (`a64_suyu.h` there is byte-identical to the one the build wrote: sha256 `a5b462d01483576cf34f8925d21c3365ae661a5077054a33fa6080a321583bed`). This is a **link**, not the single-object compile the earlier tree had; it is the renderer DLL alone, so that build could not start `longshot.exe` — the whole pack was built and started separately at this head (next paragraph). **Tested on Windows, the whole pack — a whole-pack start, not the DLL-only build above.** The same box then built the pack at `10bea861c685648d39e85764322f82f7644a9af0` and started it. `python -I nx2\lift.py --standalone --write` wrote 88 code files into `work\sa\gen` from the game copy on that box (244 s, `EXITCODE=0`); `python -I nx2\build.py --standalone --jobs 4` reported `compiled in 1326s, 0 failed`, `linked …\work\sa\build\longshot.exe: 539 MB (4s)` and `EXITCODE=0`, and left the `longshot_vk.dll` beside it as the last link left it (the DLL above, not relinked). `C:\Users\daze\longshot-2141\work\sa\build\longshot.exe` is 566,189,568 bytes, sha256 `DFF74F4061100FBF4FFBD6317E71D370F7CB66DB9345F2A0BCE26D292305AC21`, and the run's own replies read `version: 10bea861 (source 3f45af4d)`. Started windowed at the `kokiri-start` save, it reached `play` at frame 2776 on `KokiriForest_Child` and was still on that map at the last play sample (frame 4664): 1,888 frames in play over 64.5 s, 30.3 fps at the end, age child, life 12/12, no crash, clean quit (`control: quit asked by a client`, `control: exiting`). The GPU is the box's own `NVIDIA GeForce GTX 1650` and the log says `vk: driver: NVIDIA 610.62` (Turing, driver id 4, VRAM 3,935 MB, RAM 7,971 MB; the low-memory notice that box shows was dismissed before play). The window is real: `C:\Users\daze\smoke.log` records `window[in-play]`, `window[mid-play]` and `window[end-play]` for `handle=1311358 title='Longshot' … visible=True`; `C:\Users\daze\runs\win1\log.txt` has no `vk: no window` and ends by writing frame 4689's present to `C:\Users\daze\runs\shots\bridge.png` (2,765,798 bytes), the game's own picture of the run. The evidence stays on that box: run log `C:\Users\daze\runs\win1\log.txt` (686,918 bytes), `C:\Users\daze\smoke.log` (24,979 bytes), build log `C:\Users\daze\build-full.log` (30,712 bytes, sha256 `c63b5839ffe21cf2ee020dd183488f722284620556967faea8447928f095e1f7`). The head has since moved to 7da472869 by a message-only rewrite; `git diff 10bea861..7da472869` is empty and the tree is unchanged (4d9cc08e), so this run describes the current tree. **Still to test:** - **Done** — this head in the game, by hand: windowed run at `10bea861` (job `2141-windowed-10bea861-b`), Kokiri Forest (child), ~17.0 s measured play after warm-up, exit 0, no crash. - **Done** — the whole-pack start on Windows, by hand: at `10bea861` the same box lifted the pack, built `longshot.exe` (`compiled in 1326s, 0 failed`) and played `KokiriForest_Child` windowed — 1,888 frames in play over 64.5 s, 30.3 fps at the end, visible window, clean quit (Tested). - **Done** — a gate-compliant `mise run test` at this head, by hand: `942 passed, 19 failed, 18 skipped in 406 s (linux, 5 at once)`, all 19 CORE, 0 outside (above). ## Measurements Nothing to measure for frame time: the fix is latent on the shipped game — no path we can observe links a periodic timer into `WaitAny`. This head has now been run in the game windowed (`10bea861`, job `2141-windowed-10bea861-b`, Kokiri Forest (child), ~17.0 s measured play after warm-up, exit 0, no crash); the earlier game smoke at `a3dae742`/`805361a2` is not a run of this head. ## Risks Could break: a guest that links a periodic timer into a multi-wait now sees the period honoured instead of an always-ready holder (the intended behaviour); one-shot timers are unchanged on purpose. The consume and the check happen under the timer lock, so a long-overdue timer is advanced in one step rather than in a catch-up loop while `mw_lock` is held. No switch; a revert is enough. Nothing changes for saves, `longshot_options.ini` or the caches. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. — Rebased head `c11cd1356` is directly on `main @ 8f7300756701b7c9a278e576bb075ac20e622a32`; the preserved diff is the single topic described in Summary. - [x] Tested on my own PC, in the game for a change the game runs. Windowed run at `10bea861` (job `2141-windowed-10bea861-b`, Kokiri Forest (child), ~17.0 s measured play, exit 0, no crash, `hyprctl` window and external `grim` shots during play); details in Tested. - [x] `mise run test` passes (any failure that also fails on `main` is named). Suite at `10bea861` (`prrefresh-logs/suite-2141-10bea861.log`, sha256 `5dcaeb9d…`): `961 checks, 18 skipped, 5 at once (linux)`, `942 passed, 19 failed, 18 skipped in 406 s (linux, 5 at once)`; the 19 failing ids are exactly Amendment 1's CORE set with the same exception classes, no id outside CORE∪FLAKY (details in Tested). - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A fix: a game-free test that fails on `main` and passes here. `tests/test_multiwait_wake.py` at `10bea861` extracts `timer_consumed_locked` only when the tree has it (`maybe_block`), so the committed file runs against `main` `8aa5ab87` and exits 1: `FAIL: TryWaitAny left the timer holder due at 9999999 (want 10999999: the next period on)`, `FAIL: TryWaitAny reported the periodic timer holder again without a period passing`, `FAIL: a timer 3.5 periods overdue moved on to 6500000 (want 10500000: four periods on)`, `FAIL: TryWaitAny reported the long-overdue timer holder again` (`python -I -B tests/test_multiwait_wake.py --source /home/daze/GitHub/Longshot-main-8aa5ab87/host/nn_os_sync.c`). The same file passes at `10bea861` (`targeted: ok`, `all: ok`, `PASS`, exit 0), including the two-thread case. No assertion was removed: the last commit is `tests/test_multiwait_wake.py` +12/−5. - [x] A check under `tests/` that reads changed source is updated, not weakened. `tests/test_multiwait_wake.py` gains the periodic-timer and concurrent-waiter cases; the allocation-failure and self-move cases moved to `fix/os-multiwait-holder-alloc` with their fix, and no timer assertion was removed. - [x] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. **Windows: linked at this head, not a single-object compile.** On a Windows 11 x86-64 box (i5-11400H, llvm-mingw 20261104 UCRT) `nx2\build.py --standalone` with `RX_VK_ONLY=1` compiled 268 renderer objects of `10bea861` and **linked** `longshot_vk.dll` (`compiled in 149 s, 0 failed`, link 1 s) from a checkout whose `git rev-parse HEAD` is `10bea861c685…`: `C:\Users\daze\longshot-2141\work\sa\build\longshot_vk.dll`, 17,704,960 bytes, sha256 `aabd61c392275b57e6b2074dc2bbd3c753a5fc44f79fd0a3df882614bac39a9d`, PE32+ `IMAGE_FILE_MACHINE_AMD64` / `IMAGE_SUBSYSTEM_WINDOWS_GUI`, exports `mkwvk_init`, `mkwvk_close_asked`, `mkwvk_crash_close`, `mkwvk_crash_page`, and the DLL carries `10bea861 (source 3f45af4d)`. The changed file compiles too: `host/nn_os_sync.c` → 136,205-byte COFF object `host_nn_os_sync.obj` (machine `0x8664`, sha256 `8cc7d3a5…`). Linux: the pack over `a2dc5385` compiled `host/nn_os_sync.c` and linked (37 s, earlier tree). Run as well at this head: `longshot.exe` with the whole pack — built over the game-derived `work/sa/gen` on that box — started and played (`KokiriForest_Child` windowed, 1,888 frames in play over 64.5 s, 30.3 fps at the end, clean quit; Tested). - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. All five commits carry one — assisted by DeepSeek V4.1 Flash throughout; the earlier commits gained the trailer in this rewrite, so it states the author's mapping rather than a per-commit log: - `022f2f576` (was `601a1ecbd`) `Assisted-by: DeepSeek V4.1 Flash 1017 (opencode-go)` - `4159dc5f7` (was `d08b30823`) `Assisted-by: DeepSeek V4.1 Flash 1017 (opencode-go)` - `39555b33c` (was `31ff8d8a4`) `Assisted-by: DeepSeek V4.1 Flash 1017 (opencode-go)` - `e93cc8eaa` (was `bdabdbff2`) `Assisted-by: opencode (DeepSeek V4.1 Flash)` - `66e327e62` (was `7da472869`) `Assisted-by: opencode (DeepSeek V4.1 Flash)` Message-only: `git diff --stat 10bea861..7da472869` and `git diff 10bea861..7da472869` are both empty and the tree is the same object, so the tests, suite and windowed run quoted above at `10bea861` describe this head's tree. ### Ready to merge - [x] Everything in Still to test has run, its results in Tested. Windows' whole-pack start ran at `10bea861c685`: `longshot.exe`, 566,189,568 bytes, sha256 `DFF74F4061100FBF4FFBD6317E71D370F7CB66DB9345F2A0BCE26D292305AC21` — a whole-pack start, not the DLL-only build — on `NVIDIA GeForce GTX 1650`, `vk: driver: NVIDIA 610.62`, `KokiriForest_Child` at the first and last play sample, 30.3 fps at the end, 1,888 frames in play over 64.5 s, `visible=True` on `handle=1311358` with no `vk: no window` (`C:\Users\daze\runs\win1\log.txt`, `C:\Users\daze\smoke.log`, `C:\Users\daze\runs\shots\bridge.png`); the in-game item ran at this head too (windowed at `10bea861`). - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). One Tier 1 machine ran an earlier tree: Linux on this PC, RTX 4070 Ti, NVIDIA 620.70.06. Tier 1's Windows half has not. - [ ] Approved in review, every comment answered. No review yet; the Beanstalk approval is waiting for a `BigBeans` member. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold. Every build and test job on this head is still `Blocked by required conditions`; the description check is the only one that has passed.
fix(os): consume a timer holder's period in WaitAny, and refuse a link that cannot allocate
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 5s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
a3dae742ab
holder_ready reports an H_TIMER holder ready while its due time has passed, but WaitAny never
moved due_ns on, so a periodic TimerEvent linked as a MultiWaitHolder (InitializeMultiWaitHolder)
was reported ready on every WaitAny, TimedWaitAny and TryWaitAny forever, ignoring its period and
spinning a guest wait-any loop.

The wait that selects a timer holder now consumes its periods under t->lk: due_ns moves on by
every whole period that passed, past the clock, in one arithmetic step rather than a catch-up
loop, because wait_any does it under the global mw_lock (a long-overdue timer held every WaitAny
up there). WaitTimerEvent and TryWaitTimerEvent take the same one-step rule, shared through
timer_consumed or inline (TryWaitTimerEvent's check and consume stay under one lock acquisition).
A one-shot timer (period 0) is left due. What a wait consumes there is the unimplemented half of
TimerEvent's clear mode - InitializeTimerEvent stores t->autoclear and nothing reads it, for any
path - so Horizon's clear-mode rule is missing here generally, not one-shot specific; no SDK
evidence here says what it is, and the single-timer paths report a one-shot due again too, so it
is left for that change.

LinkMultiWaitHolder stored realloc's result unchecked and then wrote mw->links[nlinks++], so an
allocation failure wrote through NULL. It is now a refusal (the holder is not linked), as a
failed watch registration is. MoveAllMultiWaitHolder grew the destination one holder at a time
with the same unchecked realloc, and called with to == from it appended to the list it was
iterating: that doubled nlinks until growth failed, then wrote through NULL. It is now a no-op
onto itself, and grows the destination once for the whole move, refusing the move whole if that
allocation fails: by design from then keeps its holders, so the guest merges a source that is
still there rather than losing waits it had. Both refusals are void SDK calls with no error to
return, so each says so in one hos_log line per process (logged with mw_lock released).

test_multiwait_wake: the fixture's clock can be frozen, so a linked periodic timer (1 ns overdue,
1 ms periods) is reported by the first TryWaitAny with due_ns exactly the next period on and not
by the second, and one 3.5 periods overdue moves on past the clock by four periods in one step (a
one-period mutation fails the test; the old loop passes it, being the same rule). A fresh
multi-wait's first link with a failing realloc links nothing, logs one line and does not crash; a
link after it links; a self-move changes, allocates and logs nothing; a failed move leaves the
source's holders where they were and logs nothing more than the one line a process gets.
Author
Contributor

Tested in game: Kokiri Forest (child) under a pack over 8aa74983: 20 s after warm-up, 93.1 fps median 10.66 ms, 0 cold frames; game boots and plays. Arch Linux/Hyprland, RTX 4070 Ti, NVIDIA 620.70.06.

Tested in game: Kokiri Forest (child) under a pack over 8aa74983: 20 s after warm-up, 93.1 fps median 10.66 ms, 0 cold frames; game boots and plays. Arch Linux/Hyprland, RTX 4070 Ti, NVIDIA 620.70.06.
Author
Contributor

Checklist: ticked the 'tests read changed source' box (test_multiwait_wake.py extended, not weakened); left the Windows build box unticked and named in Still to test.

Checklist: ticked the 'tests read changed source' box (test_multiwait_wake.py extended, not weakened); left the Windows build box unticked and named in Still to test.
Author
Contributor

Checklist: the Windows build/start stays named in Still to test; the duplicate 'When it applies' box is removed, as the checker asks for a box it cannot tick.

Checklist: the Windows build/start stays named in Still to test; the duplicate 'When it applies' box is removed, as the checker asks for a box it cannot tick.
dazemc force-pushed fix/os-timer-holder-period from a3dae742ab
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 5s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
to c459701137
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 6s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
2026-11-21 22:32:01 +00:00
Compare
Author
Contributor

Rebased onto 1101b612. The commits since the run (input, renderer, tests) do not touch host/nn_os_sync.c, so the in-game run still holds; head is c4597011.

Rebased onto 1101b612. The commits since the run (input, renderer, tests) do not touch host/nn_os_sync.c, so the in-game run still holds; head is c4597011.
dazemc force-pushed fix/os-timer-holder-period from c459701137
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 6s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to 5b9642d7ad
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 24s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
2026-11-21 23:33:44 +00:00
Compare
Author
Contributor

Rebased onto 344deb6c (head 5b9642d7). Commits since the run touch input/renderer/tests, not host/nn_os_sync.c; the run still holds.

Rebased onto 344deb6c (head 5b9642d7). Commits since the run touch input/renderer/tests, not host/nn_os_sync.c; the run still holds.
Author
Contributor

Note for whoever is sequencing this: siantm's WIP #2090 (perf/mutex-guest-id) edits the same tests/test_multiwait_wake.py allowlist — safe_external, ~line 241 on main — that this PR rewrites (~233–265), so the two touch the same hunk. Whichever lands second resolves that hunk.

No action needed from reviewers today; this is just so it isn't a surprise at merge time.

Note for whoever is sequencing this: siantm's WIP **#2090** (`perf/mutex-guest-id`) edits the same `tests/test_multiwait_wake.py` allowlist — `safe_external`, ~line 241 on main — that this PR rewrites (~233–265), so the two touch the same hunk. Whichever lands second resolves that hunk. No action needed from reviewers today; this is just so it isn't a surprise at merge time.
Author
Contributor

@Beanstalk Windows: build and start this branch, then verify WaitAny on a periodic timer holder still behaves — the holder should come back once per period, not on every call, and the guest's wait-any loop must not spin. The fixture here is Linux-friendly and the change is in shared host code (host/nn_os_sync.c), so the Windows build and start are what's left.

Ready otherwise.

@Beanstalk Windows: build and start this branch, then verify `WaitAny` on a periodic timer holder still behaves — the holder should come back once per period, not on every call, and the guest's wait-any loop must not spin. The fixture here is Linux-friendly and the change is in shared host code (`host/nn_os_sync.c`), so the Windows build and start are what's left. Ready otherwise.
Member

@dazemc only members of BigBeans can start the farm.

One of them can approve this request by reacting 👍 to it or to this comment. This request was for 5b9642d, and the PR has changed since (805361a), so a 👍 no longer approves it. Comment @Beanstalk again to ask for the new commit.

@dazemc only members of `BigBeans` can start the farm. ~~One of them can approve this request by reacting 👍 to it or to this comment.~~ This request was for `5b9642d`, and the PR has changed since (`805361a`), so a 👍 no longer approves it. Comment `@Beanstalk` again to ask for the new commit.
dazemc changed title from fix(os): consume a timer holder's period in WaitAny, and refuse a link that cannot allocate to WIP: fix(os): consume a timer holder's period in WaitAny, and refuse a link that cannot allocate 2026-11-22 01:40:56 +00:00
Author
Contributor

Back to WIP for one box: this head's merge base is 344deb6c, and main has since moved to a2dc5385 with #2171 (9e10f6f7) fixing the game-free checks (~199 test files). The suite numbers here were measured against the old main (811/109/18 there, now 911/22/18), so 'mise run test' is unticked until a rebase onto a2dc5385 and a re-run of tests/run_all.py --strict.

The in-game smoke stands: I checked its record (a3dae742, 1862 frames, 93.1 fps, 0 cold frames) and git diff of host/nn_os_sync.c's changed lines is identical to the head's.

The Ready to merge boxes stay unticked and now say why beside them: Windows is with the Test Farm, waiting for a BigBean's approval; no review yet; CI's build/test jobs are still pending.

Back to WIP for one box: this head's merge base is `344deb6c`, and `main` has since moved to `a2dc5385` with **#2171** (`9e10f6f7`) fixing the game-free checks (~199 test files). The suite numbers here were measured against the old `main` (811/109/18 there, now 911/22/18), so 'mise run test' is unticked until a rebase onto `a2dc5385` and a re-run of `tests/run_all.py --strict`. The in-game smoke stands: I checked its record (`a3dae742`, 1862 frames, 93.1 fps, 0 cold frames) and `git diff` of `host/nn_os_sync.c`'s changed lines is identical to the head's. The Ready to merge boxes stay unticked and now say why beside them: Windows is with the Test Farm, waiting for a BigBean's approval; no review yet; CI's build/test jobs are still pending.
dazemc force-pushed fix/os-timer-holder-period from 5b9642d7ad
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 24s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to 805361a2d7
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 24s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
2026-11-22 01:47:58 +00:00
Compare
Author
Contributor

Rebased onto a2dc5385: head is now 805361a2. The rebase was clean — both branch commits replayed with no conflicts.

Full game-free suite, run in the same shape as a clean a2dc5385 baseline (tests/run_all.py --strict --jobs 3, systemd-run --user --scope -p MemoryMax=8G -p MemorySwapMax=0, the pinned headers):

  • clean a2dc5385: 911 passed / 23 failed / 18 skipped in 635 s
  • this head 805361a2: 911 / 23 / 18 in 629 s

Failing names identical, compared name by name (23). The one name new on a2dc5385 since 9e10f6f7 is tests/test_sim_turf_pools.py: #2174 changed the simulated-turf floor while that old check still asserts a zero floor, so it is stale on main and red identically here. This branch's test_multiwait_wake and the 13 checks that cut host/nn_os_sync.c pass.

In-game evidence (Jev: 0.71, likely valid): the smoked a3dae742 record matches the branch, the changed lines in host/nn_os_sync.c are identical to this head, and no commit in 344deb6c..a2dc5385 touches that file. No new in-game run was made.

Rebased onto `a2dc5385`: head is now `805361a2`. The rebase was clean — both branch commits replayed with no conflicts. Full game-free suite, run in the same shape as a clean `a2dc5385` baseline (`tests/run_all.py --strict --jobs 3`, `systemd-run --user --scope -p MemoryMax=8G -p MemorySwapMax=0`, the pinned headers): - clean `a2dc5385`: **911 passed / 23 failed / 18 skipped in 635 s** - this head `805361a2`: **911 / 23 / 18 in 629 s** Failing names identical, compared name by name (23). The one name new on `a2dc5385` since `9e10f6f7` is `tests/test_sim_turf_pools.py`: #2174 changed the simulated-turf floor while that old check still asserts a zero floor, so it is stale on `main` and red identically here. This branch's `test_multiwait_wake` and the 13 checks that cut `host/nn_os_sync.c` pass. In-game evidence (Jev: **0.71, likely valid**): the smoked `a3dae742` record matches the branch, the changed lines in `host/nn_os_sync.c` are identical to this head, and no commit in `344deb6c..a2dc5385` touches that file. No new in-game run was made.
dazemc changed title from WIP: fix(os): consume a timer holder's period in WaitAny, and refuse a link that cannot allocate to fix(os): consume a timer holder's period in WaitAny, and refuse a link that cannot allocate 2026-11-22 02:58:09 +00:00
Author
Contributor

@Beanstalk Windows: build and start this branch, then verify WaitAny on a periodic timer holder still behaves — the holder should come back once per period, not on every call, and the guest's wait-any loop must not spin. The fixture here is Linux-friendly and the change is in shared host code (host/nn_os_sync.c), so the Windows build and start are what's left.

Head: 805361a2 (rebased onto a2dc5385).

@Beanstalk Windows: build and start this branch, then verify `WaitAny` on a periodic timer holder still behaves — the holder should come back once per period, not on every call, and the guest's wait-any loop must not spin. The fixture here is Linux-friendly and the change is in shared host code (`host/nn_os_sync.c`), so the Windows build and start are what's left. Head: `805361a2` (rebased onto `a2dc5385`).
Member

@dazemc only members of BigBeans can start the farm.

One of them can approve this request by reacting 👍 to it or to this comment. This request was for 805361a, and the PR has changed since (8cc083e), so a 👍 no longer approves it. Comment @Beanstalk again to ask for the new commit.

@dazemc only members of `BigBeans` can start the farm. ~~One of them can approve this request by reacting 👍 to it or to this comment.~~ This request was for `805361a`, and the PR has changed since (`8cc083e`), so a 👍 no longer approves it. Comment `@Beanstalk` again to ask for the new commit.
Author
Contributor

Testing now names the run commit and what separates it from the head: a3dae742 and 805361a2 are the same branch diff (git diff 8aa74983 a3dae742 and git diff a2dc5385 805361a2 produce the same diff) and host/nn_os_sync.c is byte-identical, so the in-game run covers this change's game code. No code change; stays ready.

Testing now names the run commit and what separates it from the head: `a3dae742` and `805361a2` are the same branch diff (`git diff 8aa74983 a3dae742` and `git diff a2dc5385 805361a2` produce the same diff) and `host/nn_os_sync.c` is byte-identical, so the in-game run covers this change's game code. No code change; stays ready.
dazemc left a comment

The status hint is right: this changes host/nn_os_sync.c, which is host code, so the template's "Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths" belongs under When it applies — keep it unticked with the Windows Still-to-test item, rather than deleting it. Everything else in Ready for review verifies at 805361a2 (the a3dae742 Testing run is the pre-rebase head; the body names it and the branch diff/file are identical; the suite's 23 failures are the same names on main, with test_sim_turf_pools the new #2174 stale check; Windows is honestly still to test).

The status hint is right: this changes `host/nn_os_sync.c`, which is host code, so the template's "Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths" belongs under **When it applies** — keep it unticked with the Windows Still-to-test item, rather than deleting it. Everything else in **Ready for review** verifies at `805361a2` (the `a3dae742` Testing run is the pre-rebase head; the body names it and the branch diff/file are identical; the suite's 23 failures are the same names on `main`, with `test_sim_turf_pools` the new #2174 stale check; Windows is honestly still to test).
Author
Contributor

Host-build row added and ticked with real evidence: Windows — host/nn_os_sync.c at 805361a2 as an x86-64 COFF object, llvm-mingw 20261104's clang 23.1.5, 490 symbols (runs/pr2141-win/nn_os_sync.obj), a compile only, not the full Windows link; Linux — the pack Longshot-pr2141 over a2dc5385 at 805361a2 compiles host/nn_os_sync.c and links (37 s, 618088312 bytes). Both are named in Testing as well. No code change; stays ready.

Host-build row added and ticked with real evidence: Windows — `host/nn_os_sync.c` at `805361a2` as an x86-64 COFF object, llvm-mingw 20261104's clang 23.1.5, 490 symbols (`runs/pr2141-win/nn_os_sync.obj`), a compile only, not the full Windows link; Linux — the pack `Longshot-pr2141` over `a2dc5385` at `805361a2` compiles `host/nn_os_sync.c` and links (37 s, 618088312 bytes). Both are named in Testing as well. No code change; stays ready.
Author
Contributor

Head 805361a2 is still ready and waits only on fork CI: its pull_request jobs are "Blocked by required conditions" and the PR has no ci: approved label. No earlier fork-CI ask names this head.

@HumanBean: please approve this head's fork CI runs (the Actions jobs, and the ci: approved label for the fork project) and review #2141 — WaitAny consuming a timer holder's period and refusing a link that cannot allocate.

Evidence is in the thread: the suite at 805361a2 (911/23/18, the baseline's names), the in-game record a3dae742 on the same branch diff, and the COFF host build at 805361a2.

Head `805361a2` is still ready and waits only on fork CI: its `pull_request` jobs are "Blocked by required conditions" and the PR has no `ci: approved` label. No earlier fork-CI ask names this head. @HumanBean: please approve this head's fork CI runs (the Actions jobs, and the `ci: approved` label for the fork project) and review #2141 — WaitAny consuming a timer holder's period and refusing a link that cannot allocate. Evidence is in the thread: the suite at 805361a2 (911/23/18, the baseline's names), the in-game record a3dae742 on the same branch diff, and the COFF host build at 805361a2.
dazemc changed title from fix(os): consume a timer holder's period in WaitAny, and refuse a link that cannot allocate to WIP: fix(os): consume a timer holder's period in WaitAny, and refuse a link that cannot allocate 2026-11-23 01:06:52 +00:00
Owner
@review
BeanBot requested changes 2026-11-23 15:58:02 +00:00
Dismissed
BeanBot left a comment

Recommendation: Request changes. The timer readiness check and consumption are not synchronized, so concurrent waits can report the same expiry twice and access the deadline with a data race. The pull request also combines two unrelated fixes despite the repository’s one-topic rule.

Periodic timer holders advance after WaitAny selects them, and holder-array allocation failures no longer immediately dereference a null pointer. The change adds a shared timer-consumption path, but its readiness check remains separate from the lock that protects consumption.

Blocking (2): must change before merging.

  1. L1 host/nn_os_sync.c:1519: The timer is checked without its lock and consumed only afterward under that lock. (more on the line) Do: Check readiness and advance the periodic deadline together under t->lk, and synchronize the scan’s deadline read with timer writers. Add a concurrent wait regression test.
  2. L2 host/nn_os_sync.c:1478: The holder-array allocation and self-move fixes are independent of periodic timer consumption, contrary to the repository’s one-topic rule. (more on the line) Do: Split the holder-array fixes into a separate pull request, retaining the timer fix and its relevant test here.

Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)

  • L3: The Windows build and start requested for this shared host-code change are still outstanding. When: The reported Windows result compiles only nn_os_sync.c; it does not show that the Windows build links and starts with the change. Do: Build and start the branch on Windows and exercise the periodic timer wait path if a suitable fixture is available.

@fix can do L1 and L2.

Checks: Still running: 10 checks.

More: does it help, other systems, switches, what was read

Does it help: Yes for the tested sequential case: the author reports that the game-free fixture fails on the base and passes on this head. The in-game smoke does not exercise a known periodic timer holder; its single-run FPS comparison does not establish a performance gain.

Other systems: The timer code is shared by Windows and Linux and by single-timer and multi-wait paths. Linux fixture and game smoke results are reported; a Windows build and start remain outstanding. The fixture uses stub locks and does not cover concurrent timer waits.

Switches: None added, changed, or removed.

Reviewed: 805361a2d7 against a2dc538590: Read the repository rules, pull request template, commits, both changed-file diffs, the changed test and relevant timer, holder, allocation and locking paths in host/nn_os_sync.c. Skimmed the remainder of the host file and standards; docs/review-checklist.md and the adjacent Tooling checkout were absent. No generated files or translations changed.; nothing run (a code review).

Checked and fine:

  • The sequential timer fixture checks both the next deadline and that an immediate second wait does not return the same holder.
  • Failed reallocations preserve the existing holder arrays, and the self-move returns before modifying the list.
  • No switch, renderer API, shader, third-party or generated file changes appear in the diff.
  • The reported full-suite failures match the author’s base results by name.

Testing: Read-only review; no build, test, or project script was run. CI is still pending, and the PR remains WIP and behind current main.

Overlaps and merge order: #2090 also edits the test’s allowlist hunk; whichever pull request lands second must resolve the overlap.


Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The timer readiness check and consumption are not synchronized, so concurrent waits can report the same expiry twice and access the deadline with a data race. The pull request also combines two unrelated fixes despite the repository’s one-topic rule. Periodic timer holders advance after WaitAny selects them, and holder-array allocation failures no longer immediately dereference a null pointer. The change adds a shared timer-consumption path, but its readiness check remains separate from the lock that protects consumption. **Blocking (2)**: must change before merging. 1. **L1** `host/nn_os_sync.c:1519`: The timer is checked without its lock and consumed only afterward under that lock. (more on the line) **Do:** Check readiness and advance the periodic deadline together under t->lk, and synchronize the scan’s deadline read with timer writers. Add a concurrent wait regression test. 2. **L2** `host/nn_os_sync.c:1478`: The holder-array allocation and self-move fixes are independent of periodic timer consumption, contrary to the repository’s one-topic rule. (more on the line) **Do:** Split the holder-array fixes into a separate pull request, retaining the timer fix and its relevant test here. **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L3**: The Windows build and start requested for this shared host-code change are still outstanding. *When:* The reported Windows result compiles only nn_os_sync.c; it does not show that the Windows build links and starts with the change. **Do:** Build and start the branch on Windows and exercise the periodic timer wait path if a suitable fixture is available. `@fix` can do L1 and L2. **Checks:** Still running: 10 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes for the tested sequential case: the author reports that the game-free fixture fails on the base and passes on this head. The in-game smoke does not exercise a known periodic timer holder; its single-run FPS comparison does not establish a performance gain. **Other systems:** The timer code is shared by Windows and Linux and by single-timer and multi-wait paths. Linux fixture and game smoke results are reported; a Windows build and start remain outstanding. The fixture uses stub locks and does not cover concurrent timer waits. **Switches:** None added, changed, or removed. **Reviewed:** 805361a2d748 against a2dc53859018: Read the repository rules, pull request template, commits, both changed-file diffs, the changed test and relevant timer, holder, allocation and locking paths in host/nn_os_sync.c. Skimmed the remainder of the host file and standards; docs/review-checklist.md and the adjacent Tooling checkout were absent. No generated files or translations changed.; nothing run (a code review). **Checked and fine:** - The sequential timer fixture checks both the next deadline and that an immediate second wait does not return the same holder. - Failed reallocations preserve the existing holder arrays, and the self-move returns before modifying the list. - No switch, renderer API, shader, third-party or generated file changes appear in the diff. - The reported full-suite failures match the author’s base results by name. **Testing:** Read-only review; no build, test, or project script was run. CI is still pending, and the PR remains WIP and behind current main. **Overlaps and merge order:** #2090 also edits the test’s allowlist hunk; whichever pull request lands second must resolve the overlap. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
@ -1457,3 +1477,2 @@
if (mw->nlinks == mw->caplinks) {
mw->caplinks = mw->caplinks ? mw->caplinks * 2 : 8;
mw->links = (Obj **)realloc(mw->links, mw->caplinks * sizeof *mw->links);
const int cap = mw->caplinks ? mw->caplinks * 2 : 8;
Member

L2 (blocking): The holder-array allocation and self-move fixes are independent of periodic timer consumption, contrary to the repository’s one-topic rule.

When: The allocation failure and self-move defects occur with event holders and no timer; neither change is needed to make a periodic timer advance.

Do: Split the holder-array fixes into a separate pull request, retaining the timer fix and its relevant test here.

**L2** (blocking): The holder-array allocation and self-move fixes are independent of periodic timer consumption, contrary to the repository’s one-topic rule. *When:* The allocation failure and self-move defects occur with event holders and no timer; neither change is needed to make a periodic timer advance. **Do:** Split the holder-array fixes into a separate pull request, retaining the timer fix and its relevant test here.
@ -1495,1 +1517,3 @@
else if (mw->links[i]->sem_max == H_TIMER) {
if (holder_ready(mw->links[i])) {
found = mw->links[i]->key, found_watch = holder_watch(mw->links[i]);
if (mw->links[i]->sem_max == H_TIMER) timer_consumed(obj_nockpt(mw->links[i]->event, K_TIMER));
Member

L1 (blocking): The timer is checked without its lock and consumed only afterward under that lock. The new write to due_ns also races with the unlocked reads in holder_ready and the deadline calculation.

When: A WaitAny scan sees a periodic timer due, then a concurrent TryWaitTimerEvent consumes that expiry before timer_consumed acquires t->lk. WaitAny still returns the holder even though that expiry was already consumed; the plain concurrent deadline accesses also constitute a data race.

Do: Check readiness and advance the periodic deadline together under t->lk, and synchronize the scan’s deadline read with timer writers. Add a concurrent wait regression test.

**L1** (blocking): The timer is checked without its lock and consumed only afterward under that lock. The new write to due_ns also races with the unlocked reads in holder_ready and the deadline calculation. *When:* A WaitAny scan sees a periodic timer due, then a concurrent TryWaitTimerEvent consumes that expiry before timer_consumed acquires t->lk. WaitAny still returns the holder even though that expiry was already consumed; the plain concurrent deadline accesses also constitute a data race. **Do:** Check readiness and advance the periodic deadline together under t->lk, and synchronize the scan’s deadline read with timer writers. Add a concurrent wait regression test.
Owner
@fix
BeanBot force-pushed fix/os-timer-holder-period from 805361a2d7
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 24s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to 8cc083e717
Some checks are pending
beanstalk/approval changed since the request: ask again
PR description / Description follows the template (pull_request_target) Successful in 25s
2026-11-23 16:05:03 +00:00
Compare
BeanBot left a comment

Recommendation: Request changes. The independent holder-array fixes still sit alongside the periodic-timer fix, contrary to the repository’s one-topic rule. The final synchronization change also awaits testing on Linux and Windows.

What @fix changed
I changed this pull request: the new head is 8cc083e717. I rebased it onto main (6acae6aa87). I edited its description to match the change.

Changed

  • Synchronize timer readiness and deadline reads at host/nn_os_sync.c:1444: The scan now checks and consumes a due timer under its lock and reads its deadline under the same lock. Added a concurrent wait regression in tests/test_multiwait_wake.py:290. Tests were not run, as requested.

Left for the author

  • Split holder-array fixes at host/nn_os_sync.c:1482: The author must decide how to split the allocation and self-move fixes into another pull request; removing them here would undo fixes this pull request explicitly adds.

Nothing was built or run: the checks run again on the new head.

Periodic timers selected by multi-wait advance to their next period, avoiding a spinning guest loop. The pull request also refuses failed holder-array allocations and makes self-moves a no-op, at the cost of combining independent fixes.

Blocking (1): must change before merging.

  1. L2 host/nn_os_sync.c:1478: The holder-array allocation and self-move fixes are independent of periodic timer consumption, contrary to the repository’s one-topic rule. When: The allocation failure and self-move defects occur with event holders and no timer; neither change is needed to make a periodic timer advance. Do: Split the holder-array fixes into a separate pull request, retaining the timer fix and its relevant test here. (for the author: @fix couldn't: LinkMultiWaitHolder and MoveAllMultiWaitHolder still contain the independent allocation and self-move fixes alongside periodic timer consumption; they need to be split into a separate pull request.)

Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)

  • L3: The Windows build and start requested for this shared host-code change are still outstanding. When: The reported Windows result compiles only nn_os_sync.c; it does not show that the Windows build links and starts with the change. Do: Build and start the branch on Windows and exercise the periodic timer wait path if a suitable fixture is available.

Checks: they run again on this head; a failure shows on the pull request.

Also noticed (4; not asked for, not blocking)
  • WaitTimerEvent releases the timer lock while sleeping, so a concurrent waiter can consume the same expiry before it returns.
  • The new concurrent regression and the changed head have not been run.
  • The final timer synchronization change has not been exercised in a game smoke or host builds.
  • The stated base-to-head diff includes substantial changes beyond the two files listed in the pull request.
More: does it help, other systems, switches, what was read

Does it help: Unproven for the final synchronization change: the reported game-free test and game smoke predate it. The earlier Linux run reported 93.1 fps versus 90.3 fps on the base in one run per side, which is not evidence of a performance gain.

Other systems: The timer and multi-wait code is shared by Windows and Linux. The final locking change has no reported host builds or game smoke; the Windows build and start remain outstanding. Saves, audio, input and GPU-specific paths are not directly changed by the timer fix.

Switches: None added, changed or removed by the reviewed fix.

Reviewed: 8cc083e717 against 6acae6aa87: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the fix diff, the multi-wait and timer code and its test fixture; inspected the surrounding lock and timer-start paths. The stated base-to-head diff contains many additional files, which were not read in full. Tooling’s AGENTS.md and docs/review-checklist.md were not present.; nothing run (a code review).

Checked and fine:

  • Timer readiness, consumption and the next deadline read are now protected by the timer lock in the multi-wait scan.
  • The fix retains periodic timer consumption and the holder-array protections.

Testing: No commands that build or run project code were executed. The supplied report says tests, host builds and the game smoke for the final synchronization change are pending; CI has not run on this head.

Overlaps and merge order: The author reports that #2090 edits the same test allowlist hunk; whichever pull request lands second will need to resolve it.


Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The independent holder-array fixes still sit alongside the periodic-timer fix, contrary to the repository’s one-topic rule. The final synchronization change also awaits testing on Linux and Windows. **What `@fix` changed** I changed this pull request: the new head is 8cc083e71702. I rebased it onto `main` (6acae6aa8752). I edited its description to match the change. **Changed** - **Synchronize timer readiness and deadline reads at host/nn_os_sync.c:1444**: The scan now checks and consumes a due timer under its lock and reads its deadline under the same lock. Added a concurrent wait regression in tests/test_multiwait_wake.py:290. Tests were not run, as requested. **Left for the author** - **Split holder-array fixes at host/nn_os_sync.c:1482**: The author must decide how to split the allocation and self-move fixes into another pull request; removing them here would undo fixes this pull request explicitly adds. Nothing was built or run: the checks run again on the new head. Periodic timers selected by multi-wait advance to their next period, avoiding a spinning guest loop. The pull request also refuses failed holder-array allocations and makes self-moves a no-op, at the cost of combining independent fixes. **Blocking (1)**: must change before merging. 1. **L2** `host/nn_os_sync.c:1478`: The holder-array allocation and self-move fixes are independent of periodic timer consumption, contrary to the repository’s one-topic rule. *When:* The allocation failure and self-move defects occur with event holders and no timer; neither change is needed to make a periodic timer advance. **Do:** Split the holder-array fixes into a separate pull request, retaining the timer fix and its relevant test here. *(for the author: `@fix` couldn't: LinkMultiWaitHolder and MoveAllMultiWaitHolder still contain the independent allocation and self-move fixes alongside periodic timer consumption; they need to be split into a separate pull request.)* **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L3**: The Windows build and start requested for this shared host-code change are still outstanding. *When:* The reported Windows result compiles only nn_os_sync.c; it does not show that the Windows build links and starts with the change. **Do:** Build and start the branch on Windows and exercise the periodic timer wait path if a suitable fixture is available. **Checks:** they run again on this head; a failure shows on the pull request. <details> <summary>Also noticed (4; not asked for, not blocking)</summary> - WaitTimerEvent releases the timer lock while sleeping, so a concurrent waiter can consume the same expiry before it returns. - The new concurrent regression and the changed head have not been run. - The final timer synchronization change has not been exercised in a game smoke or host builds. - The stated base-to-head diff includes substantial changes beyond the two files listed in the pull request. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven for the final synchronization change: the reported game-free test and game smoke predate it. The earlier Linux run reported 93.1 fps versus 90.3 fps on the base in one run per side, which is not evidence of a performance gain. **Other systems:** The timer and multi-wait code is shared by Windows and Linux. The final locking change has no reported host builds or game smoke; the Windows build and start remain outstanding. Saves, audio, input and GPU-specific paths are not directly changed by the timer fix. **Switches:** None added, changed or removed by the reviewed fix. **Reviewed:** 8cc083e71702 against 6acae6aa8752: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the fix diff, the multi-wait and timer code and its test fixture; inspected the surrounding lock and timer-start paths. The stated base-to-head diff contains many additional files, which were not read in full. Tooling’s AGENTS.md and docs/review-checklist.md were not present.; nothing run (a code review). **Checked and fine:** - Timer readiness, consumption and the next deadline read are now protected by the timer lock in the multi-wait scan. - The fix retains periodic timer consumption and the holder-array protections. **Testing:** No commands that build or run project code were executed. The supplied report says tests, host builds and the game smoke for the final synchronization change are pending; CI has not run on this head. **Overlaps and merge order:** The author reports that #2090 edits the same test allowlist hunk; whichever pull request lands second will need to resolve it. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.</sub>
dazemc force-pushed fix/os-timer-holder-period from 8cc083e717
Some checks are pending
beanstalk/approval changed since the request: ask again
PR description / Description follows the template (pull_request_target) Successful in 25s
to 12ed3a32ae
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 4s
beanstalk/approval waiting for a BigBean's 👍 on the request
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
2026-11-24 05:23:57 +00:00
Compare
Author
Contributor

@HumanBean — fork CI for head 12ed3a32, please.

What it is: WaitAny consumes a periodic timer holder's period instead of reporting it ready forever, and a link or self-move that cannot allocate is refused instead of writing NULL.
Asked: approve this head's fork CI runs, and a review when you have the time.
Evidence: the fail-on-main output in Testing (SIGSEGV at mw->links[mw->nlinks++]) against tests/test_multiwait_wake.py, which passes here; the in-game smoke is at a3dae742.
Still WIP — suites land one at a time, so this is not a merge request.

@HumanBean — fork CI for head `12ed3a32`, please. **What it is:** `WaitAny` consumes a periodic timer holder's period instead of reporting it ready forever, and a link or self-move that cannot allocate is refused instead of writing NULL. **Asked:** approve this head's fork CI runs, and a review when you have the time. **Evidence:** the fail-on-main output in Testing (`SIGSEGV` at `mw->links[mw->nlinks++]`) against `tests/test_multiwait_wake.py`, which passes here; the in-game smoke is at `a3dae742`. Still WIP — suites land one at a time, so this is not a merge request.
Author
Contributor

Evidence at head 12ed3a32: the changed game-free test, run through the queue at this head.

python -I scripts/dev.py queue run pr2141-mwtest --mode build --desc "PR 2141: WaitAny timer consumption and holder fixes at 12ed3a32" -- python -I -B tests/run_all.py --strict test_multiwait_wake

  • Result: 1 passed, 0 failed, 0 skipped, 1 s, exit 0.
  • Queue row pr2141-mwtest, ticket PID 759064; log /home/daze/.local/share/longshot-dev/suite-evidence/pr2141-mwtest-12ed3a32.log, sha256 846447d6d8e55b194551191f9399205936808570aa5e83444bc9692031b4e5e4, read 2026-11-24 00:15.

That test is the concurrent-wait regression the review asked for with L1 (tests/test_multiwait_wake.py, the CONCURRENT harness with two threads on real host locks), run at this head rather than reported.

Unchanged by this comment: L2 (the holder-array allocation and self-move fixes still sit in this PR beside the timer fix and need splitting into their own) and L3 (the Windows build and start). Both need a new push, which re-runs the checks, or the Test Farm — not a comment. Nothing was pushed here.

Evidence at head `12ed3a32`: the changed game-free test, run through the queue at this head. `python -I scripts/dev.py queue run pr2141-mwtest --mode build --desc "PR 2141: WaitAny timer consumption and holder fixes at 12ed3a32" -- python -I -B tests/run_all.py --strict test_multiwait_wake` - Result: 1 passed, 0 failed, 0 skipped, 1 s, exit 0. - Queue row `pr2141-mwtest`, ticket PID 759064; log `/home/daze/.local/share/longshot-dev/suite-evidence/pr2141-mwtest-12ed3a32.log`, sha256 `846447d6d8e55b194551191f9399205936808570aa5e83444bc9692031b4e5e4`, read 2026-11-24 00:15. That test is the concurrent-wait regression the review asked for with L1 (`tests/test_multiwait_wake.py`, the `CONCURRENT` harness with two threads on real host locks), run at this head rather than reported. Unchanged by this comment: **L2** (the holder-array allocation and self-move fixes still sit in this PR beside the timer fix and need splitting into their own) and **L3** (the Windows build and start). Both need a new push, which re-runs the checks, or the Test Farm — not a comment. Nothing was pushed here.
Author
Contributor

@Beanstalk Windows: build and start this branch at head 12ed3a32 — a link and a start of the whole pack, not a single-object compile. The review on this PR already said that compiling host/nn_os_sync.c alone does not show the Windows build links and starts with the change.

The earlier request was for 5b9642d/805361a and is void (the branch was force-pushed since), so this is a request for a BigBeans member's approval, not an approval.

What to look for: the periodic-timer path a WaitAny scan takes (host/nn_os_sync.c:1519 area). With a periodic TimerEvent linked into a multi-wait, the holder should come back once per period rather than on every call, and the guest's wait-any loop must not spin. New at this head: readiness, consumption and the next-deadline read all happen under the timer lock, and tests/test_multiwait_wake.py carries a two-thread regression that passes on Linux at this head (queue row pr2141-mwtest, 1 passed, exit 0). The fixture is Linux-friendly; the Windows build and start are what is left.

@Beanstalk Windows: build **and start** this branch at head `12ed3a32` — a link and a start of the whole pack, not a single-object compile. The review on this PR already said that compiling `host/nn_os_sync.c` alone does not show the Windows build links and starts with the change. The earlier request was for `5b9642d`/`805361a` and is void (the branch was force-pushed since), so this is a request for a `BigBeans` member's approval, not an approval. What to look for: the periodic-timer path a `WaitAny` scan takes (`host/nn_os_sync.c:1519` area). With a periodic `TimerEvent` linked into a multi-wait, the holder should come back once per period rather than on every call, and the guest's wait-any loop must not spin. New at this head: readiness, consumption and the next-deadline read all happen under the timer lock, and `tests/test_multiwait_wake.py` carries a two-thread regression that passes on Linux at this head (queue row `pr2141-mwtest`, 1 passed, exit 0). The fixture is Linux-friendly; the Windows build and start are what is left.
Member

@dazemc only members of BigBeans can start the farm.

One of them can approve this request by reacting 👍 to it or to this comment. This request was for 12ed3a3, and the PR has changed since (91add52), so a 👍 no longer approves it. Comment @Beanstalk again to ask for the new commit.

@dazemc only members of `BigBeans` can start the farm. ~~One of them can approve this request by reacting 👍 to it or to this comment.~~ This request was for `12ed3a3`, and the PR has changed since (`91add52`), so a 👍 no longer approves it. Comment `@Beanstalk` again to ask for the new commit.
refactor(os): keep the timer fix without the multi-wait holder-array change
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 9s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
91add5215b
The holder-array allocation and self-move fixes in this branch are independent of the periodic
timer consumption, as the review on #2141
asked, so they move to a branch of their own. This commit removes them from here and leaves the
timer change as it was:

- LinkMultiWaitHolder and MoveAllMultiWaitHolder go back to their code on main.
- The one-line-per-process refusal (mw_refused and its counter) goes with them.
- test_multiwait_wake keeps the periodic-timer holder cases (a frozen clock, the 1 ns and 3.5
  periods overdue cases) and the two-waiter concurrent harness; the fresh-link allocation-failure
  and self-move/failed-move cases go to the other branch.

Nothing else changes: timer_consumed_locked, holder_ready's consume and wake, the wait_any scan,
WaitTimerEvent and TryWaitTimerEvent keep the one-step consume rule, and their tests stay.

The branch's test_multiwait_wake passes at this head, run through the PC's queue.

Assisted-by: opencode (DeepSeek V4.1 Flash)
Author
Contributor

Split per the review: the multi-wait holder-array allocation and self-move fixes are now on branch fix/os-multiwait-holder-alloc, off main 8aa5ab87, head 0132411. That branch is not a pull request yet because host/nn_os_sync.c is game-run code and it has not been in the game. A new commit on this branch, 91add52, removes those fixes from here.

The description now covers only the timer fix at 91add52 (host/nn_os_sync.c +29/−11, tests/test_multiwait_wake.py +111/−6, four commits). The previous description's allocation paragraph, its LinkMultiWaitHolder/MoveAllMultiWaitHolder bullets, its +89/−14 figures and its holder fail-on-main SIGSEGV all described code that is no longer in this pull request.

Timer evidence at this head: test_multiwait_wake through the PC's job queue, queue row w3-a-final, 1 check, 0 skipped, 1 passed, 0 failed, exit 0. Against main the committed test cannot compile, because it extracts the new timer_consumed_locked; with only the harness adjusted to compile there, the timer assertions fail for the bug's reason (due_ns stays 9999999 and the holder is reported again). No in-game run exists at this head, so the game and Windows items remain unticked.

pr update has no title option, so the title still names the removed holder fix.

Split per the review: the multi-wait holder-array allocation and self-move fixes are now on branch `fix/os-multiwait-holder-alloc`, off `main` `8aa5ab87`, head `0132411`. That branch is not a pull request yet because `host/nn_os_sync.c` is game-run code and it has not been in the game. A new commit on this branch, `91add52`, removes those fixes from here. The description now covers only the timer fix at `91add52` (`host/nn_os_sync.c` +29/−11, `tests/test_multiwait_wake.py` +111/−6, four commits). The previous description's allocation paragraph, its `LinkMultiWaitHolder`/`MoveAllMultiWaitHolder` bullets, its `+89/−14` figures and its holder fail-on-main `SIGSEGV` all described code that is no longer in this pull request. Timer evidence at this head: `test_multiwait_wake` through the PC's job queue, queue row `w3-a-final`, 1 check, 0 skipped, 1 passed, 0 failed, exit 0. Against `main` the committed test cannot compile, because it extracts the new `timer_consumed_locked`; with only the harness adjusted to compile there, the timer assertions fail for the bug's reason (`due_ns` stays 9999999 and the holder is reported again). No in-game run exists at this head, so the game and Windows items remain unticked. `pr update` has no title option, so the title still names the removed holder fix.
Author
Contributor

@Beanstalk Windows: build and start this branch at head 91add52 — a link and a start of the whole pack, not a single-object compile. The review on this PR already said that compiling host/nn_os_sync.c alone does not show the Windows build links and starts with the change.

The earlier requests (for 5b9642d/805361a, and again at 12ed3a32) are void: the branch moved since, because the holder-array fixes were split out of this pull request into fix/os-multiwait-holder-alloc. This is a request for a BigBeans member's approval, not an approval.

What to look for: the periodic-timer path a WaitAny scan takes (host/nn_os_sync.c:1519 area). With a periodic TimerEvent linked into a multi-wait, the holder should come back once per period rather than on every call, and the guest's wait-any loop must not spin. Readiness, consumption and the next-deadline read all happen under the timer lock, and tests/test_multiwait_wake.py carries a two-thread regression that passes on Linux at this head (queue row w3-a-final, 1 passed, exit 0). The fixture is Linux-friendly; the Windows build and start are what is left.

@Beanstalk Windows: build **and start** this branch at head `91add52` — a link and a start of the whole pack, not a single-object compile. The review on this PR already said that compiling `host/nn_os_sync.c` alone does not show the Windows build links and starts with the change. The earlier requests (for `5b9642d`/`805361a`, and again at `12ed3a32`) are void: the branch moved since, because the holder-array fixes were split out of this pull request into `fix/os-multiwait-holder-alloc`. This is a request for a `BigBeans` member's approval, not an approval. What to look for: the periodic-timer path a `WaitAny` scan takes (`host/nn_os_sync.c:1519` area). With a periodic `TimerEvent` linked into a multi-wait, the holder should come back once per period rather than on every call, and the guest's wait-any loop must not spin. Readiness, consumption and the next-deadline read all happen under the timer lock, and `tests/test_multiwait_wake.py` carries a two-thread regression that passes on Linux at this head (queue row `w3-a-final`, 1 passed, exit 0). The fixture is Linux-friendly; the Windows build and start are what is left.
Member

@dazemc only members of BigBeans can start the farm.

One of them can approve this request by reacting 👍 to it or to this comment. This request was for 91add52, and the PR has changed since (10bea86), so a 👍 no longer approves it. Comment @Beanstalk again to ask for the new commit.

@dazemc only members of `BigBeans` can start the farm. ~~One of them can approve this request by reacting 👍 to it or to this comment.~~ This request was for `91add52`, and the PR has changed since (`10bea86`), so a 👍 no longer approves it. Comment `@Beanstalk` again to ask for the new commit.
dazemc changed title from WIP: fix(os): consume a timer holder's period in WaitAny, and refuse a link that cannot allocate to WIP: fix(os): consume a timer holder's period in WaitAny 2026-11-24 08:40:27 +00:00
Author
Contributor

Windows testing dropped by the human 2026-11-24: the Host-code-builds-on-Windows box stays unticked, so this PR stays WIP. No link and no Test Farm request are planned.

Windows testing dropped by the human 2026-11-24: the Host-code-builds-on-Windows box stays unticked, so this PR stays WIP. No link and no Test Farm request are planned.
test(os): run the multi-wait test on a tree without the extracted helper
Some checks failed
beanstalk/approval changed since the request: ask again
PR description / Description follows the template (pull_request_target) Successful in 4s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
10bea861c6
test_multiwait_wake extracts timer_consumed_locked, which main does not have, so on main it
raised ValueError before reaching the timer assertions it exists to prove. The two extractions
now go through maybe_block: the helper is compiled in when the source defines it and left out
when it does not, and main's holder_ready and TryWaitTimerEvent never call it. No assertion is
removed, so on main the fixture fails on "TryWaitAny left the timer holder due at 9999999 (want
10999999)" and on the 3.5 periods overdue timer staying at 6500000.

Assisted-by: opencode (DeepSeek V4.1 Flash)
dazemc force-pushed fix/os-timer-holder-period from 10bea861c6
Some checks failed
beanstalk/approval changed since the request: ask again
PR description / Description follows the template (pull_request_target) Successful in 4s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
to 7da4728698
Some checks failed
beanstalk/approval changed since the request: ask again
PR description / Description follows the template (pull_request_target) Successful in 6s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
2026-11-24 20:45:59 +00:00
Compare
dazemc changed title from WIP: fix(os): consume a timer holder's period in WaitAny to fix(os): consume a timer holder's period in WaitAny 2026-11-24 20:47:04 +00:00
Author
Contributor

Review 2448's two items, against head 7da4728698 (tree 4d9cc08e, the same tree as 10bea861, which the runs below name):

  • L2 (split the holder-array fixes out): done in this PR. git diff 8aa5ab876d7c..7da4728698 -- host/nn_os_sync.c is 29+/11− and timer-only — timer_consumed_locked at :1156, holder_ready at :1435, wait_any, and the two single-timer waits; it has no LinkMultiWaitHolder / MoveAllMultiWaitHolder / realloc hunk (0 matches), and the holder-array refusal and self-move cases are not in the test at this head (the four fail_next_realloc uses that remain are the pre-existing watched-address case, as on main). They live on fix/os-multiwait-holder-alloc = 01324116 (on forge-fork too; host/nn_os_sync.c 24+/6−, tests/test_multiwait_wake.py 30+/3−). That branch has no pull request yet because host/ is game-run code and has not been in the game; that is the one item still owed, outside this PR.
  • L3 (Windows build and start): done at this tree. On DESKTOP-CDD8SQ2 at 10bea861: the whole pack built with nx2\build.py --standalone --jobs 4 → compiled in 1326s, 0 failed, linked …\longshot.exe: 539 MB (4s), EXITCODE=0; started windowed from kokiri-start, version: 10bea861 (source 3f45af4d), KokiriForest_Child at frame 2776 and again at 4664, 1,888 frames over 64.5 s, 30.3 fps at the end, window[in-play|mid-play|end-play] … visible=True, no vk: no window, clean quit — the body's "Tested on Windows, the whole pack"; those logs stay on that box. The game-free fixture was not run on Windows: the review asked for that only if a suitable fixture is available, and the harness is Linux-shaped (-pthread).

No code was changed for this comment.

Review 2448's two items, against head `7da4728698` (tree `4d9cc08e`, the same tree as `10bea861`, which the runs below name): - **L2** (split the holder-array fixes out): done in this PR. `git diff 8aa5ab876d7c..7da4728698 -- host/nn_os_sync.c` is 29+/11− and timer-only — `timer_consumed_locked` at `:1156`, `holder_ready` at `:1435`, `wait_any`, and the two single-timer waits; it has no `LinkMultiWaitHolder` / `MoveAllMultiWaitHolder` / `realloc` hunk (0 matches), and the holder-array refusal and self-move cases are not in the test at this head (the four `fail_next_realloc` uses that remain are the pre-existing watched-address case, as on `main`). They live on `fix/os-multiwait-holder-alloc` = `01324116` (on `forge-fork` too; `host/nn_os_sync.c` 24+/6−, `tests/test_multiwait_wake.py` 30+/3−). That branch has no pull request yet because `host/` is game-run code and has not been in the game; that is the one item still owed, outside this PR. - **L3** (Windows build and start): done at this tree. On `DESKTOP-CDD8SQ2` at `10bea861`: the whole pack built with `nx2\build.py --standalone --jobs 4` → `compiled in 1326s, 0 failed`, `linked …\longshot.exe: 539 MB (4s)`, `EXITCODE=0`; started windowed from `kokiri-start`, `version: 10bea861 (source 3f45af4d)`, `KokiriForest_Child` at frame 2776 and again at 4664, 1,888 frames over 64.5 s, 30.3 fps at the end, `window[in-play|mid-play|end-play] … visible=True`, no `vk: no window`, clean quit — the body's "Tested on Windows, the whole pack"; those logs stay on that box. The game-free fixture was not run on Windows: the review asked for that only if a suitable fixture is available, and the harness is Linux-shaped (`-pthread`). No code was changed for this comment.
Author
Contributor

Correction to the L2 line above: that split branch has been a pull request since 2026-11-24T08:50:03Z — #2445, fix(os): refuse a multi-wait link or move whose holder array cannot grow, head 01324116f6ce26be10bd196fa7958e85744bc33d on fix/os-multiwait-holder-alloc, draft=false, mergeable=true (read from the API after this comment was posted; the 08:38Z comment above predates it by 12 minutes). So L2 is fully addressed: the holder-array fixes and their fail_next_realloc cases are in #2445 with their own suite, measurements and runs, and #2141 at 7da4728698 is the timer fix alone.

Correction to the L2 line above: that split branch has been a pull request since 2026-11-24T08:50:03Z — **#2445**, `fix(os): refuse a multi-wait link or move whose holder array cannot grow`, head `01324116f6ce26be10bd196fa7958e85744bc33d` on `fix/os-multiwait-holder-alloc`, `draft=false`, `mergeable=true` (read from the API after this comment was posted; the 08:38Z comment above predates it by 12 minutes). So L2 is fully addressed: the holder-array fixes and their `fail_next_realloc` cases are in #2445 with their own suite, measurements and runs, and #2141 at `7da4728698` is the timer fix alone.
dazemc force-pushed fix/os-timer-holder-period from 7da4728698
Some checks failed
beanstalk/approval changed since the request: ask again
PR description / Description follows the template (pull_request_target) Successful in 6s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
to 66e327e628
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website builds (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Website / Website preview, build (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
Website / Website preview, upload (pull_request) Blocked by required conditions
Website / Website builds (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 5s
beanstalk/approval changed since the request: ask again
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
CI / longshot-builder end to end (synthetic game) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
2026-11-25 09:03:30 +00:00
Compare
Author
Contributor

Description: Testing names the machine instead of a distribution; no other change.

Description: Testing names the machine instead of a distribution; no other change.
dazemc force-pushed fix/os-timer-holder-period from 66e327e628
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website builds (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
Website / Website builds (pull_request) Blocked by required conditions
Website / Website preview, build (pull_request) Blocked by required conditions
Website / Website preview, upload (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 5s
beanstalk/approval changed since the request: ask again
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
CI / longshot-builder end to end (synthetic game) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to c11cd13568
Some checks are pending
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / What the change needs (pull_request) Blocked by required conditions
CI / longshot-builder end to end (synthetic game) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Blocked by required conditions
CI / Lint (pre-commit, ShellCheck) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
beanstalk/approval changed since the request: ask again
PR description / Description follows the template (pull_request_target) Successful in 6s
2026-11-25 17:55:35 +00:00
Compare
Author
Contributor

Rebased 66e327e62 to c11cd1356 on main 8f7300756; patch-id unchanged and intersection empty. Existing suite, Linux and Windows evidence stands; split PR reference corrected.

Rebased 66e327e62 to c11cd1356 on main 8f7300756; patch-id unchanged and intersection empty. Existing suite, Linux and Windows evidence stands; split PR reference corrected.
Some checks are pending
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / What the change needs (pull_request) Blocked by required conditions
CI / longshot-builder end to end (synthetic game) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Blocked by required conditions
CI / Lint (pre-commit, ShellCheck) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
beanstalk/approval changed since the request: ask again
PR description / Description follows the template (pull_request_target) Successful in 6s
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
Some workflows are waiting to be reviewed.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix/os-timer-holder-period:dazemc-fix/os-timer-holder-period'
git switch 'dazemc-fix/os-timer-holder-period'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!2141
No description provided.