fix(os): consume a timer holder's period in WaitAny, and refuse a link that cannot allocate #2141

Open
dazemc wants to merge 2 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.

The same file has two allocation defects on the multi-wait holder array: LinkMultiWaitHolder and MoveAllMultiWaitHolder store realloc's result unchecked and then write mw->links[mw->nlinks++], so a failed allocation dereferences NULL — and MoveAllMultiWaitHolder(to == from) appends to the list it iterates, doubling nlinks until the realloc fails and the NULL write crashes.

What changed:

  • timer_consumed (new): advances a periodic timer's due_ns by whole periods, skipping any that passed meanwhile, as a hardware timer would; wait_any calls it when it selects a timer holder as ready. The two single-timer paths use the same helper.
  • One-shot timers (period 0) are left as they are, with a comment: there is no SDK evidence here of a consume rule.
  • LinkMultiWaitHolder: grow into a temporary, publish on success; a failed allocation refuses the link.
  • MoveAllMultiWaitHolder: to == from is a no-op; the destination is grown once for the whole move, and a failure refuses the move whole, leaving the holders with their source.

Read host/nn_os_sync.c's timer_consumed, wait_any, LinkMultiWaitHolder and MoveAllMultiWaitHolder first; the test is tests/test_multiwait_wake.py.

Testing

Tested: Arch Linux, Hyprland (Wayland), RTX 4070 Ti (NVIDIA 620.70.06), built as a pack over 8aa74983, from this branch at a3dae742 and played: 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, 0 cold frames (base: 1805 frames, 90.3 fps, median 11.08 ms). The fix is latent on the shipped game, so no gameplay change is expected. run_all --strict test_multiwait_wake passes; the new cases fail on main (TryWaitAny left the timer holder due at 1, reported the periodic timer holder again, then SIGSEGV at mw->links[mw->nlinks++] = h; with only the Link fix, SIGSEGV at the self-move), and all 13 checks that read host/nn_os_sync.c pass.

Game run at a3dae742; the head 805361a2 is that change rebased onto a2dc5385 — this branch's own diff is identical (git diff 8aa74983 a3dae742 and git diff a2dc5385 805361a2 produce the same diff) and host/nn_os_sync.c is byte-identical, so the run covers this change's game code.

Still to test:

  • Windows (llvm-mingw): build and a start, expecting the same behaviour (by hand; the host code path is shared).

Measurements

Nothing to measure: the fix is latent on the shipped game — no path we can observe links a periodic timer into WaitAny — and the in-game smoke above shows no attributable difference (93.1 against 90.3 fps, one run a side).

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. A failed Link or MoveAll is now refused instead of crashing — the SDK returns void, so a refusal is silent, as a failed watch registration is. 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.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named). Rebased onto a2dc5385; tests/run_all.py --strict --jobs 3 inside systemd-run --user --scope -p MemoryMax=8G -p MemorySwapMax=0 with the pinned headers. main at 9e10f6f7 was 911/22/18; at a2dc5385 it is 911 passed / 23 failed / 18 skipped in 635 s — the 23rd is tests/test_sim_turf_pools.py; this head 805361a2: 911 / 23 / 18 in 629 s. Failing names identical (23, compared name by name): nx2/test_import_windows.py, tests/test_close_waits_for_save.py, tests/test_compile_zero_byte.py, tests/test_cpm_discovery.py, tests/test_damaged_rom_files.py, tests/test_dev_packs.py, tests/test_draw_stream_visibility.py, tests/test_fs_save_commit.py, tests/test_fsr_uniform_ownership.py, tests/test_guest_copies.py, tests/test_hold_toggle.py, tests/test_lower_atomg_cas.py, tests/test_menu_i18n.py, tests/test_menu_keys.py, tests/test_menu_slider_ends.py, tests/test_mise_build.py, tests/test_pads_after_menu.py, tests/test_recording_admission.py, tests/test_sim_turf_pools.py, tests/test_sim_turf_settings.py, tests/test_switch_table.py, tests/test_tls_objects.py, tests/test_vibration_menu.py. The 23rd, tests/test_sim_turf_pools.py, is new on a2dc5385 since 9e10f6f7 and is #2174's stale check (it asserts the old zero turf floor, while #2174 made the floor the game's size); it fails identically here. test_multiwait_wake (0.3 s) and the 13 checks that cut host/nn_os_sync.c pass.
  • 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.
  • A check under tests/ that reads changed source is updated, not weakened (tests/test_multiwait_wake.py gains the timer and allocation cases; no existing assertion removed).

Ready to merge

  • Everything in Still to test has run, its results in Tested. Windows has not: the @Beanstalk request was posted on 2026-11-22 00:02, BeanBot answered that only a member of BigBeans can start it, and no approval has come yet. The by-hand item has not run either. Ticks when that result is in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). One Tier 1 machine has run: Arch Linux, RTX 4070 Ti, NVIDIA 620.70.06 (the in-game smoke above). Tier 1's Windows half has not, which is the same pending Windows item.
  • Approved in review, every comment answered. No review yet (pr status: Reviews: none); the Beanstalk approval is waiting for a BigBean.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold. On head 805361a2 after the rebase: the description check passed, 11 checks still running, every build and test job Blocked by required conditions. The suite re-run and the re-confirmed in-game evidence are in the comment and box above; re-confirm CI when it reports.
## 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. The same file has two allocation defects on the multi-wait holder array: `LinkMultiWaitHolder` and `MoveAllMultiWaitHolder` store `realloc`'s result unchecked and then write `mw->links[mw->nlinks++]`, so a failed allocation dereferences NULL — and `MoveAllMultiWaitHolder(to == from)` appends to the list it iterates, doubling `nlinks` until the realloc fails and the NULL write crashes. What changed: - **`timer_consumed`** (new): advances a periodic timer's `due_ns` by whole periods, skipping any that passed meanwhile, as a hardware timer would; `wait_any` calls it when it selects a timer holder as ready. The two single-timer paths use the same helper. - **One-shot timers (period 0)** are left as they are, with a comment: there is no SDK evidence here of a consume rule. - **`LinkMultiWaitHolder`**: grow into a temporary, publish on success; a failed allocation refuses the link. - **`MoveAllMultiWaitHolder`**: `to == from` is a no-op; the destination is grown once for the whole move, and a failure refuses the move whole, leaving the holders with their source. Read `host/nn_os_sync.c`'s `timer_consumed`, `wait_any`, `LinkMultiWaitHolder` and `MoveAllMultiWaitHolder` first; the test is `tests/test_multiwait_wake.py`. ## Testing **Tested:** Arch Linux, Hyprland (Wayland), RTX 4070 Ti (NVIDIA 620.70.06), built as a pack over `8aa74983`, from this branch at `a3dae742` and played: 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, 0 cold frames (base: 1805 frames, 90.3 fps, median 11.08 ms). The fix is latent on the shipped game, so no gameplay change is expected. `run_all --strict test_multiwait_wake` passes; the new cases fail on `main` (`TryWaitAny left the timer holder due at 1`, `reported the periodic timer holder again`, then `SIGSEGV` at `mw->links[mw->nlinks++] = h`; with only the `Link` fix, `SIGSEGV` at the self-move), and all 13 checks that read `host/nn_os_sync.c` pass. Game run at `a3dae742`; the head `805361a2` is that change rebased onto `a2dc5385` — this branch's own diff is identical (`git diff 8aa74983 a3dae742` and `git diff a2dc5385 805361a2` produce the same diff) and `host/nn_os_sync.c` is byte-identical, so the run covers this change's game code. **Still to test:** - Windows (llvm-mingw): build and a start, expecting the same behaviour (by hand; the host code path is shared). ## Measurements Nothing to measure: the fix is latent on the shipped game — no path we can observe links a periodic timer into `WaitAny` — and the in-game smoke above shows no attributable difference (93.1 against 90.3 fps, one run a side). ## 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. A failed `Link` or `MoveAll` is now refused instead of crashing — the SDK returns void, so a refusal is silent, as a failed watch registration is. 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. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [x] `mise run test` passes (any failure that also fails on `main` is named). Rebased onto `a2dc5385`; `tests/run_all.py --strict --jobs 3` inside `systemd-run --user --scope -p MemoryMax=8G -p MemorySwapMax=0` with the pinned headers. `main` at `9e10f6f7` was 911/22/18; at `a2dc5385` it is **911 passed / 23 failed / 18 skipped in 635 s** — the 23rd is `tests/test_sim_turf_pools.py`; this head `805361a2`: **911 / 23 / 18 in 629 s**. Failing names identical (23, compared name by name): `nx2/test_import_windows.py`, `tests/test_close_waits_for_save.py`, `tests/test_compile_zero_byte.py`, `tests/test_cpm_discovery.py`, `tests/test_damaged_rom_files.py`, `tests/test_dev_packs.py`, `tests/test_draw_stream_visibility.py`, `tests/test_fs_save_commit.py`, `tests/test_fsr_uniform_ownership.py`, `tests/test_guest_copies.py`, `tests/test_hold_toggle.py`, `tests/test_lower_atomg_cas.py`, `tests/test_menu_i18n.py`, `tests/test_menu_keys.py`, `tests/test_menu_slider_ends.py`, `tests/test_mise_build.py`, `tests/test_pads_after_menu.py`, `tests/test_recording_admission.py`, `tests/test_sim_turf_pools.py`, `tests/test_sim_turf_settings.py`, `tests/test_switch_table.py`, `tests/test_tls_objects.py`, `tests/test_vibration_menu.py`. The 23rd, `tests/test_sim_turf_pools.py`, is new on `a2dc5385` since `9e10f6f7` and is #2174's stale check (it asserts the old zero turf floor, while #2174 made the floor the game's size); it fails identically here. `test_multiwait_wake` (0.3 s) and the 13 checks that cut `host/nn_os_sync.c` pass. - [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. - [x] A check under `tests/` that reads changed source is updated, not weakened (`tests/test_multiwait_wake.py` gains the timer and allocation cases; no existing assertion removed). ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. Windows has not: the `@Beanstalk` request was posted on 2026-11-22 00:02, BeanBot answered that only a member of `BigBeans` can start it, and no approval has come yet. The by-hand item has not run either. Ticks when that result is in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). One Tier 1 machine has run: Arch Linux, RTX 4070 Ti, NVIDIA 620.70.06 (the in-game smoke above). Tier 1's Windows half has not, which is the same pending Windows item. - [ ] Approved in review, every comment answered. No review yet (`pr status`: Reviews: none); the Beanstalk approval is waiting for a BigBean. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold. On head `805361a2` after the rebase: the description check passed, 11 checks still running, every build and test job `Blocked by required conditions`. The suite re-run and the re-confirmed in-game evidence are in the comment and box above; re-confirm CI when it reports.
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 are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (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
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (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
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 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 5s
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.

@dazemc only members of `BigBeans` can start the farm. One of them can approve this request by reacting 👍 to it or to this comment.
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.
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (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
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (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
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 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 5s
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
Some workflows are waiting to be reviewed.
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
2 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.