Recompiler: signal Partner::Spin exit bit (0x4000_0000) in @xcl.spin.wait #3652

Merged
Kalmarv merged 1 commit from upstream-pr/3652 into main 2026-12-02 22:17:21 +00:00
Kalmarv commented 2026-12-02 03:49:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-12-02T03:49:46Z.


Prevent GPU stalls in direct-DXIL split-wave64 compute/mesh shaders when one hardware half exits early while its partner enters a Partner::Spin exchange.

When one half exits early, its partner previously polled @xcl.spin.wait for the full 1 << 20 (1,048,576) live-partner cap before timing out. This PR signals bit 30 (0x4000_0000, EXITED) on the departing half's counter so the partner bails out immediately on the first poll after exit, while keeping main's 1 << 20 live-partner poll cap and leaving barrier_arrive / safe_barrier_sync untouched.

What is in it

  • crates/xcl/src/gpu/dxil/module.rs (Module::spin_wait): in @xcl.spin.wait, check (c & 0x3FFF_FFFF) >= need before inspecting bit 30 (0x4000_0000) so a convergent partner exiting immediately after its final exchange never corrupts a valid rendezvous; bail immediately to the fail-marking cmpxchg when bit 30 is observed with (c & 0x3FFF_FFFF) < need; reject bits 30..31 in the entry bounds check. The live-partner poll cap stays 1 << 20 (1048576), and barrier_arrive is unchanged.
  • crates/xcl/src/gpu/dxil/lanes.rs, lower.rs, kernel.rs: add Lw::spin_exchange_exit() (called at program tail right after safe_barrier_exit()), reusing has_spin_exchange and spin_bases from #3655. Guarded by compute_gate's entry predicate (spin_entered) so out-of-limit lanes cannot signal exit while active lanes in the same hardware wave are still running under Independent Thread Scheduling. Updates lanes.rs comments to note this is direct DXIL only (the HLSL recomp::emit xcl_x_meet path is separate).
  • crates/xcl/src/gpu/dxil/module/split.rs: allow RmwOp::Or on xcl_xc alongside RmwOp::Add so split-wave64 compute shaders with spin_exchange_exit() keep dispatch-chain splitting.
  • crates/xcl/src/gpu/dxil/lanes.rs, core_tests.rs: add GPU test gpu_spin_exchange_early_exit_bails_immediately covering (1) divergent early-exit bailout (0.0038 ms median across 256 groups vs 31.1890 ms when spin_exchange_exit is removed — verified to fail without the exit bit — plus IR checks for COUNT_MASK, EXITED, and the 1 << 20 cap), (2) convergent translate_compute V_READLANE_B32 + immediate exit, and (3) the spin_entered ITS guard under partial IO_THREAD_LIMIT = 112 (16 active + 16 out-of-limit lanes in wave 3, 64-iteration scalar delay loop, 8 iterations). Update core_tests.rs split_lds_reads_meet_after_writes for the single atomicrmw or.

Tested

  • hardware (GPU + driver, CPU), Rust version, debug / release: NVIDIA GeForce RTX 5070 Ti (driver 610.74), AMD Ryzen 9 9950X, Windows 11 Pro 26200, rustc 1.99.0 (b940084d7 2026-09-28), DXC 1.9.2609.5, debug tests + release build (cargo build --release -p xcl: 39 warnings, 0 new vs main baseline of 39).
  • scripts/test.ps1 (workspace build, cargo bench -p xcl --bench '*' -- --test, cargo test --workspace -- --test-threads=4): 2975 passed, 0 failed, 52 ignored across 43 targets; 24 SKIPPED GPU tests (22 no wave64, 2 no heap windows).
  • cargo test -p xcl --lib gpu_spin_exchange_early_exit_bails_immediately -- --nocapture: passed (SPIN_EARLY_EXIT 256 groups median 0.0038 ms; temporarily removing lw.spin_exchange_exit() in Case 1 failed at 31.1890 ms > 2.0 ms).

Regression run

main:

xcl-smoke v1
commit: 5eaadb54c14e0fc29597b2a1689d7dbd83491303
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1698 (PresentX 1698)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 15798 MB

PR:

xcl-smoke v1
commit: 4b77d6a701e41eb56aaf9391a49755c6c21e4ffb
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1672 (PresentX 1672)
presents per 2 s (last 3): 62 60 60
device removals: 0
crashes: 0
peak commit: 16344 MB

(Note: the first smoke run after changing crates/xcl/src/gpu/dxil/* hit a cold shader cache due to XCL_DIRECT_DXIL_SOURCE_ID — 1316 frames, 0 removals, 0 crashes; the PR block above is the second warm run matching the warm main baseline.)

Not tested

  • AMD / Intel GPUs, native wave64 GPU tests (22 SKIPPED), heap-window GPU tests (2 SKIPPED), HLSL recomp::emit (xcl_x_meet) path (left untouched and out of scope for this direct-DXIL PR), in-world title gameplay beyond the 60 s smoke, Wine/Linux, and game-data sample tests (XCL_SAMPLE_* unset).

AI use

  • Antigravity (Gemini 4 Neon) rebased this PR onto origin/main (5eaadb54c, including #3655), ported only the bit-30 EXITED signal into @xcl.spin.wait while restoring the 1 << 20 live-partner cap and dropping the barrier cap change, allowed RmwOp::Or on xcl_xc in module/split.rs, strengthened gpu_spin_exchange_early_exit_bails_immediately (including the spin_entered test and without-exit-bit failure verification), ran the build/test/smoke suite, and updated this PR description.
<!-- greyfinch-sync:ivall/xcl:issue:5599451226 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3652). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-12-02T03:49:46Z. --- Prevent GPU stalls in direct-DXIL split-wave64 compute/mesh shaders when one hardware half exits early while its partner enters a `Partner::Spin` exchange. When one half exits early, its partner previously polled `@xcl.spin.wait` for the full `1 << 20` (1,048,576) live-partner cap before timing out. This PR signals bit 30 (`0x4000_0000`, `EXITED`) on the departing half's counter so the partner bails out immediately on the first poll after exit, while keeping `main`'s `1 << 20` live-partner poll cap and leaving `barrier_arrive` / `safe_barrier_sync` untouched. **What is in it** - `crates/xcl/src/gpu/dxil/module.rs` (`Module::spin_wait`): in `@xcl.spin.wait`, check `(c & 0x3FFF_FFFF) >= need` before inspecting bit 30 (`0x4000_0000`) so a convergent partner exiting immediately after its final exchange never corrupts a valid rendezvous; bail immediately to the fail-marking `cmpxchg` when bit 30 is observed with `(c & 0x3FFF_FFFF) < need`; reject bits 30..31 in the entry bounds check. The live-partner poll cap stays `1 << 20` (`1048576`), and `barrier_arrive` is unchanged. - `crates/xcl/src/gpu/dxil/lanes.rs`, `lower.rs`, `kernel.rs`: add `Lw::spin_exchange_exit()` (called at program `tail` right after `safe_barrier_exit()`), reusing `has_spin_exchange` and `spin_bases` from `#3655`. Guarded by `compute_gate`'s entry predicate (`spin_entered`) so out-of-limit lanes cannot signal exit while active lanes in the same hardware wave are still running under Independent Thread Scheduling. Updates `lanes.rs` comments to note this is direct DXIL only (the HLSL `recomp::emit` `xcl_x_meet` path is separate). - `crates/xcl/src/gpu/dxil/module/split.rs`: allow `RmwOp::Or` on `xcl_xc` alongside `RmwOp::Add` so split-wave64 compute shaders with `spin_exchange_exit()` keep dispatch-chain splitting. - `crates/xcl/src/gpu/dxil/lanes.rs`, `core_tests.rs`: add GPU test `gpu_spin_exchange_early_exit_bails_immediately` covering (1) divergent early-exit bailout (`0.0038 ms` median across 256 groups vs `31.1890 ms` when `spin_exchange_exit` is removed — verified to fail without the exit bit — plus IR checks for `COUNT_MASK`, `EXITED`, and the `1 << 20` cap), (2) convergent `translate_compute` `V_READLANE_B32` + immediate exit, and (3) the `spin_entered` ITS guard under partial `IO_THREAD_LIMIT = 112` (16 active + 16 out-of-limit lanes in wave 3, 64-iteration scalar delay loop, 8 iterations). Update `core_tests.rs` `split_lds_reads_meet_after_writes` for the single `atomicrmw or`. **Tested** - hardware (GPU + driver, CPU), Rust version, debug / release: NVIDIA GeForce RTX 5070 Ti (driver 610.74), AMD Ryzen 9 9950X, Windows 11 Pro 26200, `rustc 1.99.0 (b940084d7 2026-09-28)`, DXC `1.9.2609.5`, debug tests + release build (`cargo build --release -p xcl`: 39 warnings, 0 new vs `main` baseline of 39). - `scripts/test.ps1` (workspace build, `cargo bench -p xcl --bench '*' -- --test`, `cargo test --workspace -- --test-threads=4`): 2975 passed, 0 failed, 52 ignored across 43 targets; 24 SKIPPED GPU tests (22 `no wave64`, 2 `no heap windows`). - `cargo test -p xcl --lib gpu_spin_exchange_early_exit_bails_immediately -- --nocapture`: passed (`SPIN_EARLY_EXIT` 256 groups median `0.0038 ms`; temporarily removing `lw.spin_exchange_exit()` in Case 1 failed at `31.1890 ms > 2.0 ms`). **Regression run** main: ``` xcl-smoke v1 commit: 5eaadb54c14e0fc29597b2a1689d7dbd83491303 gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1698 (PresentX 1698) presents per 2 s (last 3): 60 61 60 device removals: 0 crashes: 0 peak commit: 15798 MB ``` PR: ``` xcl-smoke v1 commit: 4b77d6a701e41eb56aaf9391a49755c6c21e4ffb gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1672 (PresentX 1672) presents per 2 s (last 3): 62 60 60 device removals: 0 crashes: 0 peak commit: 16344 MB ``` (Note: the first smoke run after changing `crates/xcl/src/gpu/dxil/*` hit a cold shader cache due to `XCL_DIRECT_DXIL_SOURCE_ID` — 1316 frames, 0 removals, 0 crashes; the PR block above is the second warm run matching the warm `main` baseline.) **Not tested** - AMD / Intel GPUs, native wave64 GPU tests (`22 SKIPPED`), heap-window GPU tests (`2 SKIPPED`), HLSL `recomp::emit` (`xcl_x_meet`) path (left untouched and out of scope for this direct-DXIL PR), in-world title gameplay beyond the 60 s smoke, Wine/Linux, and game-data sample tests (`XCL_SAMPLE_*` unset). **AI use** - Antigravity (Gemini 4 Neon) rebased this PR onto `origin/main` (`5eaadb54c`, including `#3655`), ported only the bit-30 `EXITED` signal into `@xcl.spin.wait` while restoring the `1 << 20` live-partner cap and dropping the barrier cap change, allowed `RmwOp::Or` on `xcl_xc` in `module/split.rs`, strengthened `gpu_spin_exchange_early_exit_bails_immediately` (including the `spin_entered` test and without-exit-bit failure verification), ran the build/test/smoke suite, and updated this PR description.
SavageCore commented 2026-12-02 04:30:49 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SavageCore on 2026-12-02T04:30:49Z.

Review: COMMENTED


Comment (not blocking, needs CI confirm): spin-exchange EXIT bit (0x40000000) + timeout caps address GPU hangs in the right place, and arrived-before-EXITED ordering looks right. Concerns before merge: (1) caps 1<<20->1<<12 (spin) / ->1<<16 (barrier) are aggressive - premature timeout on loaded slow-partner rendezvous vs TDR tradeoff not quantified. (2) Exit signal only wired at normal tail - S_BARRIER-leave / loop-budget early-outs bypass it, leaving spin-to-timeout. spin_entered==None fallback is unguarded. (3) CI shows one success (04:05:59) and one prior failure (03:50:00) on Build and test - confirm failure was prior push/flake; get_status is pending.

<!-- greyfinch-sync:ivall/xcl:review:6144786113 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3652#pullrequestreview-6144786113). Originally posted by [SavageCore](https://github.com/SavageCore) on 2026-12-02T04:30:49Z. **Review:** COMMENTED --- Comment (not blocking, needs CI confirm): spin-exchange EXIT bit (0x40000000) + timeout caps address GPU hangs in the right place, and arrived-before-EXITED ordering looks right. Concerns before merge: (1) caps 1<<20->1<<12 (spin) / ->1<<16 (barrier) are aggressive - premature timeout on loaded slow-partner rendezvous vs TDR tradeoff not quantified. (2) Exit signal only wired at normal tail - S_BARRIER-leave / loop-budget early-outs bypass it, leaving spin-to-timeout. spin_entered==None fallback is unguarded. (3) CI shows one success (04:05:59) and one prior failure (03:50:00) on Build and test - confirm failure was prior push/flake; get_status is pending.
Kalmarv commented 2026-12-02 04:36:59 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-12-02T04:36:59Z.


Thanks for the review @SavageCore! Addressing each point directly against the current code:

  1. Timeout caps (1 << 12 spin / 1 << 16 safe-barrier):

    • With bit-30 EXITED signaling, divergent early exits no longer hit the timeout path at all (they bail on the first poll after exit; 0.0017 ms median for 256 groups in gpu_spin_exchange_early_exit_bails_immediately).
    • Both halves of a split console wave belong to the same threadgroup (co-resident on the same SM sharing LDS), so 4096 serialized LDS atomicrmw iterations for a cross-half exchange (spin_exchange) and 65536 iterations for a multi-wave workgroup barrier (safe_barrier_sync) are sized to leave room for a live co-scheduled partner while cutting worst-case runaway stall duration by 256x / 16x vs 1 << 20 (which can trip the 2 s Windows TDR across dense dispatches).
    • That said, we do not currently have a GPU-to-CPU telemetry counter quantifying slow-partner timeout rate under heavy SM load, so if you prefer a more conservative fallback cap (e.g. 1 << 14 = 16384 for spin_exchange now that bit 30 handles early exits immediately), I am happy to adjust and re-verify.
  2. Exit paths and spin_entered == None:

    • Every early-out path in translate_on_this_thread routes to the single exit -> tail block (kernel.rs:596-600, right after safe_barrier_exit()):
      • Term::End (S_ENDPGM): branches to end == exit (kernel.rs:517, 569).
      • Per-loop pass cap (VAR_LOOP_PASSES): branches to end == exit (kernel.rs:528-530).
      • Per-lane loop budget (VAR_BUDGET): branches to end == exit (kernel.rs:540-543).
      • Compact mode (compact::emit / emit_with_nest): both S_ENDPGM and VAR_BUDGET branch to exit (compact.rs:976, 992).
      • compute_gate (S_BARRIER / leave): kernel.rs:483-486 sets lw.spin_entered = Some(runs) and branches to exit. When S_BARRIER is present (leave == false), compute_gate returns group-uniform st.runs (kernel.rs:1233-1234), so either the entire group skips together (runs == false, nobody waits) or all lanes enter together (runs == true) and signal EXITED at tail. When leave == true, out-of-limit lanes have runs == false and are already excluded from the partner's xn via st.partner_lanes, so guarding spin_exchange_exit on spin_entered prevents them from setting bit 30 early under ITS while active lanes in the same warp are still executing.
    • spin_entered == None only occurs when group_runs is None — for Partner::Spin, that is strictly Entry::Mesh, which has no compute_gate (every lane in the mesh threadgroup enters h0 together).
  3. CI status:

    • Confirmed: the earlier 03:49:53Z Build and test (Windows, no GPU) failure (job 143202141589) on the same commit 032557e79 was an unrelated runner flake (xcl.exe hit 0xc0000005 inside D3D12Core.dll during gpu::dxil::compact_tests::gpu_compact_form_runs_as_the_plain_form right after eh::tests::the_process_ends_while_another_thread_holds_the_heap, before core_tests or lanes tests started).
    • Retriggering on the exact same commit 032557e79 via close/reopen passed cleanly (job 143205667464), and all 5 latest check-runs (Build and test (Windows, no GPU), PR description, triage, mirror, publish) are completed / success. (The legacy commit /status endpoint reports pending with statuses: [] because this repo uses Actions check-runs.)
<!-- greyfinch-sync:ivall/xcl:comment:7335087202 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3652#issuecomment-7335087202). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-12-02T04:36:59Z. --- Thanks for the review @SavageCore! Addressing each point directly against the current code: 1. **Timeout caps (`1 << 12` spin / `1 << 16` safe-barrier):** - With bit-30 `EXITED` signaling, divergent early exits no longer hit the timeout path at all (they bail on the first poll after exit; `0.0017 ms` median for 256 groups in `gpu_spin_exchange_early_exit_bails_immediately`). - Both halves of a split console wave belong to the same threadgroup (co-resident on the same SM sharing LDS), so `4096` serialized LDS `atomicrmw` iterations for a cross-half exchange (`spin_exchange`) and `65536` iterations for a multi-wave workgroup barrier (`safe_barrier_sync`) are sized to leave room for a live co-scheduled partner while cutting worst-case runaway stall duration by 256x / 16x vs `1 << 20` (which can trip the 2 s Windows TDR across dense dispatches). - That said, we do not currently have a GPU-to-CPU telemetry counter quantifying slow-partner timeout rate under heavy SM load, so if you prefer a more conservative fallback cap (e.g. `1 << 14` = 16384 for `spin_exchange` now that bit 30 handles early exits immediately), I am happy to adjust and re-verify. 2. **Exit paths and `spin_entered == None`:** - Every early-out path in `translate_on_this_thread` routes to the single `exit` -> `tail` block (`kernel.rs:596-600`, right after `safe_barrier_exit()`): - `Term::End` (`S_ENDPGM`): branches to `end == exit` (`kernel.rs:517, 569`). - Per-loop pass cap (`VAR_LOOP_PASSES`): branches to `end == exit` (`kernel.rs:528-530`). - Per-lane loop budget (`VAR_BUDGET`): branches to `end == exit` (`kernel.rs:540-543`). - Compact mode (`compact::emit` / `emit_with_nest`): both `S_ENDPGM` and `VAR_BUDGET` branch to `exit` (`compact.rs:976, 992`). - `compute_gate` (`S_BARRIER` / `leave`): `kernel.rs:483-486` sets `lw.spin_entered = Some(runs)` and branches to `exit`. When `S_BARRIER` is present (`leave == false`), `compute_gate` returns group-uniform `st.runs` (`kernel.rs:1233-1234`), so either the entire group skips together (`runs == false`, nobody waits) or all lanes enter together (`runs == true`) and signal `EXITED` at `tail`. When `leave == true`, out-of-limit lanes have `runs == false` and are already excluded from the partner's `xn` via `st.partner_lanes`, so guarding `spin_exchange_exit` on `spin_entered` prevents them from setting bit 30 early under ITS while active lanes in the same warp are still executing. - `spin_entered == None` only occurs when `group_runs` is `None` — for `Partner::Spin`, that is strictly `Entry::Mesh`, which has no `compute_gate` (every lane in the mesh threadgroup enters `h0` together). 3. **CI status:** - Confirmed: the earlier `03:49:53Z` `Build and test (Windows, no GPU)` failure (job `143202141589`) on the same commit `032557e79` was an unrelated runner flake (`xcl.exe` hit `0xc0000005` inside `D3D12Core.dll` during `gpu::dxil::compact_tests::gpu_compact_form_runs_as_the_plain_form` right after `eh::tests::the_process_ends_while_another_thread_holds_the_heap`, before `core_tests` or `lanes` tests started). - Retriggering on the exact same commit `032557e79` via close/reopen passed cleanly (job `143205667464`), and all 5 latest check-runs (`Build and test (Windows, no GPU)`, `PR description`, `triage`, `mirror`, `publish`) are `completed / success`. (The legacy commit `/status` endpoint reports `pending` with `statuses: []` because this repo uses Actions check-runs.)
vasanex commented 2026-12-02 08:08:40 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by vasanex on 2026-12-02T08:08:40Z.


merge-check
base: 1c8b551475
head: 032557e79b
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2910 passed, 0 failed, 51 ignored; SKIPPED: 25 (22 no wave64, 2 no heap windows, 1 cannot disable the driver cache), the same tests as on the base (2909 passed there); failing: none. gpu_spin_exchange_early_exit_bails_immediately ran and passed on this wave32 adapter.
review: whole diff read. One point that blocks for me. (1) The exit bit is sound as far as I can see: the count is compared under COUNT_MASK before bit 30 is looked at, and a half's own counter cannot carry the bit before its own exit. (2) Separately from the exit bit, the wait for a partner that has NOT exited drops from 1 << 20 to 1 << 12 polls (and safe_barrier_sync from 1 << 20 to 1 << 16). A timed-out half marks the partner's counter, and from then on both halves stop consuming exchanged values for the rest of the dispatch (they read zeros). So a partner half that is alive but late (scheduled later, or in a long stretch before its next exchange) now fails the exchange 256 times sooner, and that shows as wrong output, not as a hang. The new test covers a partner that exited and a pair that meets at once; nothing covers a live partner that arrives late, and the 60 s smoke does not reach a title's world, where split wave64 programs with long bodies run (on this card several of them take 10 to 20 ms a dispatch). The exit bit alone already removes the long spin in the case the PR describes.
performance: no cost by default in the 60 s smoke: base 1608 frames, peak commit 19911 MB; merged tree 1696 frames, 18123 MB (91 %), presents 60 60 61, 0 device removals, 0 crashes. Not measured: a title's world (the change retranslates every split program, which is a cold shader cache of well over 25 minutes here; I did not run it).
verdict: not yet: the lower poll caps for a live partner are an unmeasured correctness risk; either keep 1 << 20 for a partner that has not exited (the exit bit gives the early bail-out), or show with a late-partner test or an in-world comparison that 4096 polls are enough.
hardware / tool and model: NVIDIA GeForce RTX 3080 10 GB (driver 621.40), AMD Ryzen 9 7950X, Windows 11 Pro 26200, rustc 1.100.0 / Claude Code with Claude Fable 5.2. Run and posted without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7339058119 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3652#issuecomment-7339058119). Originally posted by [vasanex](https://github.com/vasanex) on 2026-12-02T08:08:40Z. --- merge-check base: 1c8b551475e1e7bfe48f94448492a4c3544a2e0f head: 032557e79bcc68a45846b55c8dac91f216dff8f6 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2910 passed, 0 failed, 51 ignored; SKIPPED: 25 (22 no wave64, 2 no heap windows, 1 cannot disable the driver cache), the same tests as on the base (2909 passed there); failing: none. `gpu_spin_exchange_early_exit_bails_immediately` ran and passed on this wave32 adapter. review: whole diff read. One point that blocks for me. (1) The exit bit is sound as far as I can see: the count is compared under `COUNT_MASK` before bit 30 is looked at, and a half's own counter cannot carry the bit before its own exit. (2) Separately from the exit bit, the wait for a partner that has NOT exited drops from `1 << 20` to `1 << 12` polls (and `safe_barrier_sync` from `1 << 20` to `1 << 16`). A timed-out half marks the partner's counter, and from then on both halves stop consuming exchanged values for the rest of the dispatch (they read zeros). So a partner half that is alive but late (scheduled later, or in a long stretch before its next exchange) now fails the exchange 256 times sooner, and that shows as wrong output, not as a hang. The new test covers a partner that exited and a pair that meets at once; nothing covers a live partner that arrives late, and the 60 s smoke does not reach a title's world, where split wave64 programs with long bodies run (on this card several of them take 10 to 20 ms a dispatch). The exit bit alone already removes the long spin in the case the PR describes. performance: no cost by default in the 60 s smoke: base 1608 frames, peak commit 19911 MB; merged tree 1696 frames, 18123 MB (91 %), presents 60 60 61, 0 device removals, 0 crashes. Not measured: a title's world (the change retranslates every split program, which is a cold shader cache of well over 25 minutes here; I did not run it). verdict: not yet: the lower poll caps for a live partner are an unmeasured correctness risk; either keep `1 << 20` for a partner that has not exited (the exit bit gives the early bail-out), or show with a late-partner test or an in-world comparison that 4096 polls are enough. hardware / tool and model: NVIDIA GeForce RTX 3080 10 GB (driver 621.40), AMD Ryzen 9 7950X, Windows 11 Pro 26200, rustc 1.100.0 / Claude Code with Claude Fable 5.2. Run and posted without a human check of each point.
Foniass commented 2026-12-02 09:07:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T09:07:30Z.


Review (head 032557e7, diff read, not a merge-check):

  • The 2^12 poll cap also applies to a partner that is alive but late. crates/xcl/src/gpu/dxil/lanes.rs ~547 drops the wait from 2^20 to 4096 polls for every exchange, including ones where the partner has not exited. When the cap runs out, the half marks the partner's counter FAIL. Both halves then set VAR_XDEAD and read 0 for every exchange until the dispatch ends, so the result is wrong output, not a hang. The exit bit already handles the case the description gives (a departed half), and nothing measures a slow live partner: the new test only covers a partner that exited and a pair that meets at once. Keeping 2^20 when the EXITED bit is clear would fix the early-exit case without this risk.
  • The barrier cap has nothing to do with early exits. On main, safe_barrier_exit already decrements XCL_BAR_ALIVE when a wave leaves, so a departed wave never holds safe_barrier_sync. The 2^16 cap at lanes.rs ~741 therefore only cuts the wait for waves that are still running. A wave that times out goes past the barrier and sets VAR_BAR_ALIVE to 0, so it skips every later barrier and its LDS accesses are no longer synchronised. The description does not justify this cap and nothing measures it.
  • The HLSL translator is left out. crates/xcl/src/gpu/recomp/emit.rs ~6671 (xcl_x_meet) and ~6772 (PRELUDE_SAFE_BARRIER) still poll 2^20 times and have no exit bit, yet the comments at lanes.rs ~439 and ~679 still say the DXIL code matches them. A split program that goes through the HLSL path keeps the stall this PR fixes, and the same program now times out differently depending on which translator built it.
  • The test does not show that the exit bit works. With only the new 2^12 cap and no exit bit, case 1's upper half would give up after 4096 polls (about 0.1 to 0.3 ms by #3668's numbers) and still store 0xBEEF. So the marker check and the med_ms < 2.0 check (lanes.rs ~1484) would both pass. Only the atomicrmw or string check notices if the exit bit is missing. The spin_entered guard is untested too, since case 2 runs every lane. A fixed 2 ms wall-clock limit also depends on the GPU.
  • Overlaps. #3668 changes the same two lines (lanes.rs ~547, ~741) with the opposite policy: it keeps 2^20 in programs that have a loop because there a wave can rightly wait for another wave's loop, and it covers the HLSL preludes as well. At most one of the two policies can land. #3655 replaces both loops with module::spin_wait / barrier_arrive helpers (module.rs ~540, still 2^20) and has its own has_spin_exchange, so the exit bit would have to be rewritten inside that helper. #3667 changes the dispatch loop budget, a different layer, and does not conflict.

Fine: the exit bit itself looks sound by reading. Arrival is compared under COUNT_MASK before bit 30 is checked, so a partner that exits right after its last exchange does not break the meet. A half's own counter cannot carry bit 30 before that half exits. Every exit (S_ENDPGM, the loop-pass and budget caps, the compact form, the compute gate) goes through tail, where the gate's runs dominates. The entry bounds check now refuses bits 30 and 31.

AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7340412886 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3652#issuecomment-7340412886). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-02T09:07:30Z. --- Review (head 032557e7, diff read, not a merge-check): - **The 2^12 poll cap also applies to a partner that is alive but late.** `crates/xcl/src/gpu/dxil/lanes.rs ~547` drops the wait from 2^20 to 4096 polls for every exchange, including ones where the partner has not exited. When the cap runs out, the half marks the partner's counter FAIL. Both halves then set `VAR_XDEAD` and read 0 for every exchange until the dispatch ends, so the result is wrong output, not a hang. The exit bit already handles the case the description gives (a departed half), and nothing measures a slow live partner: the new test only covers a partner that exited and a pair that meets at once. Keeping 2^20 when the EXITED bit is clear would fix the early-exit case without this risk. - **The barrier cap has nothing to do with early exits.** On main, `safe_barrier_exit` already decrements `XCL_BAR_ALIVE` when a wave leaves, so a departed wave never holds `safe_barrier_sync`. The 2^16 cap at `lanes.rs ~741` therefore only cuts the wait for waves that are still running. A wave that times out goes past the barrier and sets `VAR_BAR_ALIVE` to 0, so it skips every later barrier and its LDS accesses are no longer synchronised. The description does not justify this cap and nothing measures it. - **The HLSL translator is left out.** `crates/xcl/src/gpu/recomp/emit.rs ~6671` (`xcl_x_meet`) and `~6772` (`PRELUDE_SAFE_BARRIER`) still poll 2^20 times and have no exit bit, yet the comments at `lanes.rs ~439` and `~679` still say the DXIL code matches them. A split program that goes through the HLSL path keeps the stall this PR fixes, and the same program now times out differently depending on which translator built it. - **The test does not show that the exit bit works.** With only the new 2^12 cap and no exit bit, case 1's upper half would give up after 4096 polls (about 0.1 to 0.3 ms by #3668's numbers) and still store 0xBEEF. So the marker check and the `med_ms < 2.0` check (`lanes.rs ~1484`) would both pass. Only the `atomicrmw or` string check notices if the exit bit is missing. The `spin_entered` guard is untested too, since case 2 runs every lane. A fixed 2 ms wall-clock limit also depends on the GPU. - **Overlaps.** #3668 changes the same two lines (`lanes.rs ~547`, `~741`) with the opposite policy: it keeps 2^20 in programs that have a loop because there a wave can rightly wait for another wave's loop, and it covers the HLSL preludes as well. At most one of the two policies can land. #3655 replaces both loops with `module::spin_wait` / `barrier_arrive` helpers (`module.rs ~540`, still 2^20) and has its own `has_spin_exchange`, so the exit bit would have to be rewritten inside that helper. #3667 changes the dispatch loop budget, a different layer, and does not conflict. Fine: the exit bit itself looks sound by reading. Arrival is compared under `COUNT_MASK` before bit 30 is checked, so a partner that exits right after its last exchange does not break the meet. A half's own counter cannot carry bit 30 before that half exits. Every exit (`S_ENDPGM`, the loop-pass and budget caps, the compact form, the compute gate) goes through `tail`, where the gate's `runs` dominates. The entry bounds check now refuses bits 30 and 31. AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Foniass commented 2026-12-02 09:36:03 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T09:36:03Z.


merge-check
base: 1c8b551475
head: 032557e79b
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2910 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none
review: read by one reviewer at this same head; the review is at https://github.com/xcl-dev/xcl/pull/3652#issuecomment-7340412886 and its findings stand. Most serious: the 2^12 spin and 2^16 barrier caps also cut partners that are still running, giving silently wrong output.
performance: 60 s smoke of a retail title, main 1c8b5514 vs this merge (032557e7): 1652 -> 1586 frames shown (96 %; last presents per 2 s: 60 60 60), peak commit 18228 -> 15729 MB, 0 device removals, 0 crashes.
verdict: not yet: the 2^12 spin and 2^16 barrier caps also cut partners that are still running, giving silently wrong output (see the review)
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5

AI-written and posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7341181221 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3652#issuecomment-7341181221). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-02T09:36:03Z. --- merge-check base: 1c8b551475e1e7bfe48f94448492a4c3544a2e0f head: 032557e79bcc68a45846b55c8dac91f216dff8f6 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2910 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none review: read by one reviewer at this same head; the review is at https://github.com/xcl-dev/xcl/pull/3652#issuecomment-7340412886 and its findings stand. Most serious: the 2^12 spin and 2^16 barrier caps also cut partners that are still running, giving silently wrong output. performance: 60 s smoke of a retail title, main 1c8b5514 vs this merge (032557e7): 1652 -> 1586 frames shown (96 %; last presents per 2 s: 60 60 60), peak commit 18228 -> 15729 MB, 0 device removals, 0 crashes. verdict: not yet: the 2^12 spin and 2^16 barrier caps also cut partners that are still running, giving silently wrong output (see the review) hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5 AI-written and posted by Foniass without a human check of each point.
Kalmarv commented 2026-12-02 14:55:34 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-12-02T14:55:34Z.


Thanks @vasanex, @Foniass, and @SavageCore for the thorough reviews and merge-checks! Rebased onto origin/main (5eaadb54c, which includes merged #3655) and updated to 4b77d6a70 addressing every point:

  1. Restored 1 << 20 live-partner poll cap and dropped barrier cap change (@vasanex, @Foniass, @SavageCore):

    • Ported only the bit-30 EXITED signal (0x4000_0000) into #3655's shared @xcl.spin.wait helper (crates/xcl/src/gpu/dxil/module.rs), keeping limit = 1 << 20 unchanged for partners that have not exited.
    • Dropped the safe_barrier_sync / barrier_arrive 2^16 cap change completely (barrier_arrive and safe_barrier_sync are untouched).
    • Also allowed RmwOp::Or on xcl_xc in crates/xcl/src/gpu/dxil/module/split.rs so split-wave64 compute shaders using spin_exchange_exit() keep dispatch-chain splitting.
  2. Honest lanes.rs comments on HLSL scope (@Foniass):

    • Updated the exchange_spin / spin_exchange_exit doc comments in lanes.rs to state clearly that bit-30 exit signaling is direct DXIL only and that the HLSL recomp::emit xcl_x_meet path is separate (not claiming parity with HLSL).
  3. Strengthened GPU test + without-exit-bit failure check + spin_entered coverage (@Foniass, @SavageCore):

    • With 1 << 20 restored, verified Case 1 genuinely fails without spin_exchange_exit(): temporarily disabling lw.spin_exchange_exit() in Case 1 made the 256-group divergent dispatch stall to 31.1890 ms median (failing the < 2.0 ms assertion by >15x), vs 0.0038 ms median with bit-30 exit signaling (~8,200x faster).
    • Added IR assertions checking COUNT_MASK (0x3FFF_FFFF), EXITED (0x4000_0000), and the 1 << 20 live-partner cap (1048576) inside @xcl.spin.wait.
    • Added Case 3 exercising the spin_entered ITS guard under partial IO_THREAD_LIMIT[0] = 112 on a 128-thread group (wave 3 has 16 active + 16 out-of-limit lanes, 64-iteration scalar delay loop before V_READLANE_B32 lane 32, 8 iterations verifying 0..63 -> 0x1020, 64..111 -> 0x1060, 112..127 -> 0).
  4. Verification on 4b77d6a70 (RTX 5070 Ti, driver 610.74, rustc 1.99.0, DXC 1.9.2609.5):

    • cargo build --release -p xcl: 39 warnings (0 new vs main 5eaadb54c).
    • scripts/test.ps1: 2975 passed, 0 failed, 52 ignored across 43 targets; 24 SKIPPED (22 no wave64, 2 no heap windows).
    • Warm 60 s smoke (title: ea3b5e4d): 5eaadb54c 1698 frames (60 61 60, 15798 MB) vs 4b77d6a70 1672 frames (62 60 60, 16344 MB), 0 device removals, 0 crashes, exit: 0x0.
    • python scripts/pr_check.py --local: description ok.

Ready for re-review! (Updated and verified with Antigravity, Gemini 4 Neon.)

<!-- greyfinch-sync:ivall/xcl:comment:7349376233 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3652#issuecomment-7349376233). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-12-02T14:55:34Z. --- Thanks @vasanex, @Foniass, and @SavageCore for the thorough reviews and merge-checks! Rebased onto `origin/main` (`5eaadb54c`, which includes merged `#3655`) and updated to `4b77d6a70` addressing every point: 1. **Restored `1 << 20` live-partner poll cap and dropped barrier cap change (`@vasanex`, `@Foniass`, `@SavageCore`):** - Ported only the bit-30 `EXITED` signal (`0x4000_0000`) into `#3655`'s shared `@xcl.spin.wait` helper (`crates/xcl/src/gpu/dxil/module.rs`), keeping `limit = 1 << 20` unchanged for partners that have not exited. - Dropped the `safe_barrier_sync` / `barrier_arrive` `2^16` cap change completely (`barrier_arrive` and `safe_barrier_sync` are untouched). - Also allowed `RmwOp::Or` on `xcl_xc` in `crates/xcl/src/gpu/dxil/module/split.rs` so split-wave64 compute shaders using `spin_exchange_exit()` keep dispatch-chain splitting. 2. **Honest `lanes.rs` comments on HLSL scope (`@Foniass`):** - Updated the `exchange_spin` / `spin_exchange_exit` doc comments in `lanes.rs` to state clearly that bit-30 exit signaling is direct DXIL only and that the HLSL `recomp::emit` `xcl_x_meet` path is separate (not claiming parity with HLSL). 3. **Strengthened GPU test + without-exit-bit failure check + `spin_entered` coverage (`@Foniass`, `@SavageCore`):** - With `1 << 20` restored, verified Case 1 genuinely fails without `spin_exchange_exit()`: temporarily disabling `lw.spin_exchange_exit()` in Case 1 made the 256-group divergent dispatch stall to **`31.1890 ms` median** (failing the `< 2.0 ms` assertion by >15x), vs **`0.0038 ms` median** with bit-30 exit signaling (~8,200x faster). - Added IR assertions checking `COUNT_MASK` (`0x3FFF_FFFF`), `EXITED` (`0x4000_0000`), and the `1 << 20` live-partner cap (`1048576`) inside `@xcl.spin.wait`. - Added Case 3 exercising the `spin_entered` ITS guard under partial `IO_THREAD_LIMIT[0] = 112` on a 128-thread group (wave 3 has 16 active + 16 out-of-limit lanes, 64-iteration scalar delay loop before `V_READLANE_B32` lane 32, 8 iterations verifying `0..63 -> 0x1020`, `64..111 -> 0x1060`, `112..127 -> 0`). 4. **Verification on `4b77d6a70` (RTX 5070 Ti, driver 610.74, `rustc 1.99.0`, DXC `1.9.2609.5`):** - `cargo build --release -p xcl`: 39 warnings (0 new vs `main` `5eaadb54c`). - `scripts/test.ps1`: `2975 passed, 0 failed, 52 ignored` across 43 targets; `24 SKIPPED` (`22 no wave64`, `2 no heap windows`). - Warm 60 s smoke (`title: ea3b5e4d`): `5eaadb54c` `1698` frames (`60 61 60`, `15798 MB`) vs `4b77d6a70` `1672` frames (`62 60 60`, `16344 MB`), `0` device removals, `0` crashes, `exit: 0x0`. - `python scripts/pr_check.py --local`: `description ok`. Ready for re-review! (Updated and verified with Antigravity, Gemini 4 Neon.)
vasanex commented 2026-12-02 15:04:03 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by vasanex on 2026-12-02T15:04:03Z.


merge-check
base: 5eaadb54c1
head: 4b77d6a701
merge: clean (git diff --check clean)
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2975 passed, 0 failed, 52 ignored; SKIPPED: 25 (22 no wave64, 2 no heap windows, 1 cannot disable the driver cache), the same tests as on the base (2974 passed there); failing: none. The new GPU test gpu_spin_exchange_early_exit_bails_immediately ran on this card (wave32) and passed, and so did the edited split_lds_reads_meet_after_writes.
review: whole diff read (6 files, +182/-14). The blocker of my check of 032557e7 is gone: @xcl.spin.wait keeps 1 << 20 polls for a partner that has not exited, and the barrier waits are untouched. No finding in the new head. Checked by reading: the wait tests the arrived count under the 30-bit mask before it looks at the exit bit, so a partner that leaves right after its last exchange still gives a valid meeting; on a seen exit bit the half goes through the same compare-exchange as a timeout and polls again when the partner's counter moved meanwhile; the own-counter guard now refuses bits 30 and 31, which only stops a half that has itself left; the exit bit is set once per half (first lane) and only by lanes that passed the launch gate (spin_entered), which the test's third case covers; split.rs lets the or on xcl_xc through so such programs still split. The comments now say that the HLSL path does not signal the exit. Not covered by anything here: wave64 hardware, and a program in a title that reaches a divergent exit.
performance: one atomic or per half at program exit, and a faster bail-out where a partner has left. 60 s smoke, release, same title and settings: base 1697 frames, peak commit 17749 MB; merged tree 1685 frames, 17859 MB (101 %), presents 60 60 60, 0 device removals, 0 crashes. The smoke's title did not visibly depend on the path either way.
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 3080 10 GB (driver 621.40), AMD Ryzen 9 7950X, Windows 11 Pro 26200, rustc 1.100.0 / Claude Code with Claude Fable 5.2. Run and posted without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7349654089 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3652#issuecomment-7349654089). Originally posted by [vasanex](https://github.com/vasanex) on 2026-12-02T15:04:03Z. --- merge-check base: 5eaadb54c14e0fc29597b2a1689d7dbd83491303 head: 4b77d6a701e41eb56aaf9391a49755c6c21e4ffb merge: clean (`git diff --check` clean) build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2975 passed, 0 failed, 52 ignored; SKIPPED: 25 (22 no wave64, 2 no heap windows, 1 cannot disable the driver cache), the same tests as on the base (2974 passed there); failing: none. The new GPU test `gpu_spin_exchange_early_exit_bails_immediately` ran on this card (wave32) and passed, and so did the edited `split_lds_reads_meet_after_writes`. review: whole diff read (6 files, +182/-14). The blocker of my check of 032557e7 is gone: `@xcl.spin.wait` keeps `1 << 20` polls for a partner that has not exited, and the barrier waits are untouched. No finding in the new head. Checked by reading: the wait tests the arrived count under the 30-bit mask before it looks at the exit bit, so a partner that leaves right after its last exchange still gives a valid meeting; on a seen exit bit the half goes through the same compare-exchange as a timeout and polls again when the partner's counter moved meanwhile; the own-counter guard now refuses bits 30 and 31, which only stops a half that has itself left; the exit bit is set once per half (first lane) and only by lanes that passed the launch gate (`spin_entered`), which the test's third case covers; `split.rs` lets the `or` on `xcl_xc` through so such programs still split. The comments now say that the HLSL path does not signal the exit. Not covered by anything here: wave64 hardware, and a program in a title that reaches a divergent exit. performance: one atomic `or` per half at program exit, and a faster bail-out where a partner has left. 60 s smoke, release, same title and settings: base 1697 frames, peak commit 17749 MB; merged tree 1685 frames, 17859 MB (101 %), presents 60 60 60, 0 device removals, 0 crashes. The smoke's title did not visibly depend on the path either way. verdict: safe to merge hardware / tool and model: NVIDIA GeForce RTX 3080 10 GB (driver 621.40), AMD Ryzen 9 7950X, Windows 11 Pro 26200, rustc 1.100.0 / Claude Code with Claude Fable 5.2. Run and posted without a human check of each point.
Foniass commented 2026-12-02 18:02:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T18:02:19Z.


merge-check
base: 5eaadb54c1
head: 4b77d6a701
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2975 passed, 0 failed, 52 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none
review: follow-up on 4b77d6a7 (reworked and rebased from 032557e7, my last review's head). Rebased onto main 5eaadb54 (which has #3655): the exit bit moved into Module::spin_wait and the live-partner cap is back to 1 << 20 (module.rs ~566-630); the barrier cap is gone and barrier_arrive is untouched; spin_exchange_exit runs at the program tail right after safe_barrier_exit (kernel.rs ~642, lanes.rs ~663), guarded by the new spin_entered (compute_gate's runs, kernel.rs ~527); module/split.rs ~194 now accepts RmwOp::Or on xcl_xc; the test has three cases (lanes.rs ~1438-1547). Earlier findings: (1) the 2^12 cap cutting a live but late partner: fixed; the cap is 1 << 20 again and a partner is cut short only when bit 30 is set. (2) the unrelated barrier cap: fixed (dropped). (3) the HLSL translator: partly fixed; the comments now say the exit bit is direct DXIL only, but emit.rs xcl_x_meet has no exit bit, so a split program built through the HLSL path still waits the full 2^20 polls when one half exits early. (4) the test not proving the exit bit: mostly fixed; with the 2^20 cap, case 1 stalls without the exit bit (31.19 ms against 0.0038 ms) and case 2 checks a convergent exchange followed by an immediate exit; the 2 ms wall-clock limit (~1488) depends on the GPU, with a large margin. (5) overlaps: #3655 is merged and the exit bit sits in its helper; open #3668 targets the same limit in @xcl.spin.wait, so whichever lands second needs a rebase there, but the policies no longer contradict. New: the one-line split.rs ~194 change is untested; every translated split-wave64 compute program with a spin exchange now carries the new atomicrmw or, and without that line split_compute would silently stop building dispatch chains for them, but no test translates such a program and checks a chain is still built. Case 3 (the spin_entered guard with IO_THREAD_LIMIT = 112) isn't shown to fail without the guard. Fine: the arrival count is compared under COUNT_MASK before bit 30 is read; a peer setting bit 30 between a timeout poll and the cmpxchg goes through raced and fails correctly; the fallback own-counter pointer matches exchange_bases(self.half); runs dominates the tail; a half entirely past the thread limit gives its partner xn from partner_lanes, so it doesn't wait; geometry phases end with a partner other than Spin, so they don't signal. One logical change of about 180 lines, most of them test.
performance: 60 s smoke of a retail title, main 5eaadb54 vs this merge (4b77d6a7): 1422 -> 1440 frames shown (101 %; last presents per 2 s: 61 60 60), peak commit 17184 -> 16116 MB, 0 device removals, 0 crashes. This run is lower than most today: the PC was in use at the time (a browser and Discord running), and main's own runs on this machine today ranged from 1370 to 1652 frames, so the difference isn't clearly from this PR.
verdict: safe to merge: no blocking finding in the review (the points there are minor), the suite passes and the smoke run is clean
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5

AI-written and posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7353883040 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3652#issuecomment-7353883040). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-02T18:02:19Z. --- merge-check base: 5eaadb54c14e0fc29597b2a1689d7dbd83491303 head: 4b77d6a701e41eb56aaf9391a49755c6c21e4ffb merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2975 passed, 0 failed, 52 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none review: follow-up on 4b77d6a7 (reworked and rebased from 032557e7, my last review's head). Rebased onto main 5eaadb54 (which has #3655): the exit bit moved into `Module::spin_wait` and the live-partner cap is back to 1 << 20 (`module.rs` ~566-630); the barrier cap is gone and `barrier_arrive` is untouched; `spin_exchange_exit` runs at the program tail right after `safe_barrier_exit` (`kernel.rs` ~642, `lanes.rs` ~663), guarded by the new `spin_entered` (`compute_gate`'s `runs`, `kernel.rs` ~527); `module/split.rs` ~194 now accepts `RmwOp::Or` on `xcl_xc`; the test has three cases (`lanes.rs` ~1438-1547). Earlier findings: (1) the 2^12 cap cutting a live but late partner: fixed; the cap is 1 << 20 again and a partner is cut short only when bit 30 is set. (2) the unrelated barrier cap: fixed (dropped). (3) the HLSL translator: partly fixed; the comments now say the exit bit is direct DXIL only, but `emit.rs` `xcl_x_meet` has no exit bit, so a split program built through the HLSL path still waits the full 2^20 polls when one half exits early. (4) the test not proving the exit bit: mostly fixed; with the 2^20 cap, case 1 stalls without the exit bit (31.19 ms against 0.0038 ms) and case 2 checks a convergent exchange followed by an immediate exit; the 2 ms wall-clock limit (~1488) depends on the GPU, with a large margin. (5) overlaps: #3655 is merged and the exit bit sits in its helper; open #3668 targets the same `limit` in `@xcl.spin.wait`, so whichever lands second needs a rebase there, but the policies no longer contradict. New: the one-line `split.rs` ~194 change is untested; every translated split-wave64 compute program with a spin exchange now carries the new `atomicrmw or`, and without that line `split_compute` would silently stop building dispatch chains for them, but no test translates such a program and checks a chain is still built. Case 3 (the `spin_entered` guard with `IO_THREAD_LIMIT` = 112) isn't shown to fail without the guard. Fine: the arrival count is compared under `COUNT_MASK` before bit 30 is read; a peer setting bit 30 between a timeout poll and the cmpxchg goes through `raced` and fails correctly; the fallback own-counter pointer matches `exchange_bases(self.half)`; `runs` dominates the tail; a half entirely past the thread limit gives its partner `xn` from `partner_lanes`, so it doesn't wait; geometry phases end with a partner other than Spin, so they don't signal. One logical change of about 180 lines, most of them test. performance: 60 s smoke of a retail title, main 5eaadb54 vs this merge (4b77d6a7): 1422 -> 1440 frames shown (101 %; last presents per 2 s: 61 60 60), peak commit 17184 -> 16116 MB, 0 device removals, 0 crashes. This run is lower than most today: the PC was in use at the time (a browser and Discord running), and main's own runs on this machine today ranged from 1370 to 1652 frames, so the difference isn't clearly from this PR. verdict: safe to merge: no blocking finding in the review (the points there are minor), the suite passes and the smoke run is clean hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5 AI-written and posted by Foniass without a human check of each point.
bmjask commented 2026-12-02 18:39:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T18:39:38Z.

Code review location: crates/xcl/src/gpu/dxil/lanes.rs; line 684

@@ -649,6 +652,42 @@ impl Lw {
         out
     }
 
+    /// Publish bit 30 (`0x4000_0000`) on this half's spin counter when leaving the program
+    /// (`s_endpgm` or loop budget exhaustion) so a still-running partner half bails out of
+    /// `@xcl.spin.wait` immediately instead of burning the `1 << 20` live-partner poll cap.
+    /// Safe even if the partner has not yet polled our final exchange: `@xcl.spin.wait` checks
+    /// `(c & 0x3FFF_FFFF) >= need` before inspecting bit 30. Guarded by `compute_gate`'s entry
+    /// predicate (`spin_entered`) so out-of-limit lanes cannot signal exit while active lanes in
+    /// the same hardware wave are still running under Independent Thread Scheduling.
+    /// (Direct DXIL only; the HLSL `recomp::emit` `xcl_x_meet` path is separate.)
+    pub fn spin_exchange_exit(&mut self) {
+        if self.partner != Partner::Spin || !self.s.m.has_spin_exchange || self.s.m.const_u64(self.xn) == Some(0) {
+            return;
+        }
+        let own = match self.spin_bases {
+            Some([_, _, own, _]) => own,
+            None => {
+                let Some((xc, cbase)) = self.xc else { return };
+                let own = self.addc(self.half, cbase);
+                self.s.gs_ptr(xc, own)
+            }
+        };
+        let signal = |lw: &mut Lw| -> Result<(), String> {
+            lw.s.require(super::shader::Feature::WaveOps);
+            let first = lw.s.wave_is_first_lane();
+            lw.guarded(first, &mut |lw| {
+                let exited = lw.c(0x4000_0000);
+                lw.s.m.atomic_rmw(RmwOp::Or, own, exited);
+                Ok(())
+            })
+        };
+        if let Some(entered) = self.spin_entered {

Medium: Not certain about this one, because it depends on ITS scheduling: the spin_entered guard excludes only compute_gate's out-of-limit lanes, and the exit signal still comes from wave_is_first_lane() among whichever entered lanes reach tail first. So a hardware wave whose entered lanes haven't reconverged at tail can publish EXITED while other lanes of that half are still running. On NVIDIA ITS, the non-leader lanes of @xcl.spin.wait branch straight to exit and can run ahead, as can lanes split by per-lane guarded regions. If they OR 0x4000_0000 into this half's counter while the half still has exchanges to do, the partner's next exchange fails at once, VAR_XDEAD latches, and every later exchange returns 0 instead of the real value. Signalling only when all entered lanes are present (wave_all_bit_count against the entered-lane count taken at entry) would remove the dependence.

<!-- greyfinch-sync:ivall/xcl:review-comment:4774157207 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3652#discussion_r4774157207). Originally posted by [bmjask](https://github.com/bmjask) on 2026-12-02T18:39:38Z. **Code review location:** `crates/xcl/src/gpu/dxil/lanes.rs`; line 684 ~~~~diff @@ -649,6 +652,42 @@ impl Lw { out } + /// Publish bit 30 (`0x4000_0000`) on this half's spin counter when leaving the program + /// (`s_endpgm` or loop budget exhaustion) so a still-running partner half bails out of + /// `@xcl.spin.wait` immediately instead of burning the `1 << 20` live-partner poll cap. + /// Safe even if the partner has not yet polled our final exchange: `@xcl.spin.wait` checks + /// `(c & 0x3FFF_FFFF) >= need` before inspecting bit 30. Guarded by `compute_gate`'s entry + /// predicate (`spin_entered`) so out-of-limit lanes cannot signal exit while active lanes in + /// the same hardware wave are still running under Independent Thread Scheduling. + /// (Direct DXIL only; the HLSL `recomp::emit` `xcl_x_meet` path is separate.) + pub fn spin_exchange_exit(&mut self) { + if self.partner != Partner::Spin || !self.s.m.has_spin_exchange || self.s.m.const_u64(self.xn) == Some(0) { + return; + } + let own = match self.spin_bases { + Some([_, _, own, _]) => own, + None => { + let Some((xc, cbase)) = self.xc else { return }; + let own = self.addc(self.half, cbase); + self.s.gs_ptr(xc, own) + } + }; + let signal = |lw: &mut Lw| -> Result<(), String> { + lw.s.require(super::shader::Feature::WaveOps); + let first = lw.s.wave_is_first_lane(); + lw.guarded(first, &mut |lw| { + let exited = lw.c(0x4000_0000); + lw.s.m.atomic_rmw(RmwOp::Or, own, exited); + Ok(()) + }) + }; + if let Some(entered) = self.spin_entered { ~~~~ --- **Medium**: Not certain about this one, because it depends on ITS scheduling: the `spin_entered` guard excludes only compute_gate's out-of-limit lanes, and the exit signal still comes from `wave_is_first_lane()` among whichever entered lanes reach `tail` first. So a hardware wave whose entered lanes haven't reconverged at `tail` can publish EXITED while other lanes of that half are still running. On NVIDIA ITS, the non-leader lanes of `@xcl.spin.wait` branch straight to `exit` and can run ahead, as can lanes split by per-lane guarded regions. If they OR 0x4000_0000 into this half's counter while the half still has exchanges to do, the partner's next exchange fails at once, VAR_XDEAD latches, and every later exchange returns 0 instead of the real value. Signalling only when all entered lanes are present (`wave_all_bit_count` against the entered-lane count taken at entry) would remove the dependence.
bmjask commented 2026-12-02 18:39:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T18:39:38Z.

Review: COMMENTED


Review of 4b77d6a7: 2 finding(s) (2 medium), most severe first.

  1. Medium crates/xcl/src/gpu/dxil/lanes.rs:684: Not certain about this one, because it depends on ITS scheduling: the spin_entered guard excludes only compute_gate's out-of-limit lanes, and the exit signal still comes from wave_is_first_lane() among whichever entered lanes reach `.... (inline)
  2. Medium crates/xcl/src/gpu/dxil/module.rs:597: The entry bounds check now rejects bit 30 as well as bit 31 in old | after | need, which halves the counter's headroom: an exchange fails once epoch*partners or the own count reaches 2^30 instead of 2^31. (inline)

These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.

<!-- greyfinch-sync:ivall/xcl:review:6156671510 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3652#pullrequestreview-6156671510). Originally posted by [bmjask](https://github.com/bmjask) on 2026-12-02T18:39:38Z. **Review:** COMMENTED --- Review of `4b77d6a7`: 2 finding(s) (2 medium), most severe first. 1. **Medium** `crates/xcl/src/gpu/dxil/lanes.rs:684`: Not certain about this one, because it depends on ITS scheduling: the `spin_entered` guard excludes only compute_gate's out-of-limit lanes, and the exit signal still comes from `wave_is_first_lane()` among whichever entered lanes reach `.... (inline) 2. **Medium** `crates/xcl/src/gpu/dxil/module.rs:597`: The entry bounds check now rejects bit 30 as well as bit 31 in `old | after | need`, which halves the counter's headroom: an exchange fails once epoch*partners or the own count reaches 2^30 instead of 2^31. (inline) --- _These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it._
bmjask commented 2026-12-02 18:39:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T18:39:39Z.

Code review location: crates/xcl/src/gpu/dxil/module.rs; line 597

@@ -586,27 +589,34 @@ impl Module {
             let first = emit(bit, Op::Call(first, vec![first_op]));
             emit(void, Op::CondBr(first, entry, exit));
 
-            // Either counter reaching its high bit invalidates the exchange.
+            // Either counter reaching bits 30..31 (exited/failed/overflow) invalidates the exchange.
             let old = emit(word, Op::AtomicRmw(RmwOp::Add, own, lanes));
             let after = emit(word, Op::Bin(BinOp::Add, old, lanes, 0));
             let bounds = emit(word, Op::Bin(BinOp::Or, old, after, 0));
             let bounds = emit(word, Op::Bin(BinOp::Or, bounds, need, 0));
-            let bad = emit(bit, Op::Cmp(Pred::SLt, bounds, zero));
+            let bounds_high = emit(word, Op::Bin(BinOp::And, bounds, hi2, 0));

Medium: The entry bounds check now rejects bit 30 as well as bit 31 in old | after | need, which halves the counter's headroom: an exchange fails once epoch*partners or the own count reaches 2^30 instead of 2^31. A 32-lane half in a loop with many exchanges per iteration (VAR_XK counts every exchange the program runs) gets bit 30 set in need after about 2^25 exchanges, takes bad with no peer exit or timeout, latches VAR_XDEAD and returns 0 from every later exchange. Before this PR the limit was twice as high. Masking bit 30 out of the bounds check (it's checked separately as EXITED) would keep the old headroom.

<!-- greyfinch-sync:ivall/xcl:review-comment:4774157221 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3652#discussion_r4774157221). Originally posted by [bmjask](https://github.com/bmjask) on 2026-12-02T18:39:39Z. **Code review location:** `crates/xcl/src/gpu/dxil/module.rs`; line 597 ~~~~diff @@ -586,27 +589,34 @@ impl Module { let first = emit(bit, Op::Call(first, vec![first_op])); emit(void, Op::CondBr(first, entry, exit)); - // Either counter reaching its high bit invalidates the exchange. + // Either counter reaching bits 30..31 (exited/failed/overflow) invalidates the exchange. let old = emit(word, Op::AtomicRmw(RmwOp::Add, own, lanes)); let after = emit(word, Op::Bin(BinOp::Add, old, lanes, 0)); let bounds = emit(word, Op::Bin(BinOp::Or, old, after, 0)); let bounds = emit(word, Op::Bin(BinOp::Or, bounds, need, 0)); - let bad = emit(bit, Op::Cmp(Pred::SLt, bounds, zero)); + let bounds_high = emit(word, Op::Bin(BinOp::And, bounds, hi2, 0)); ~~~~ --- **Medium**: The entry bounds check now rejects bit 30 as well as bit 31 in `old | after | need`, which halves the counter's headroom: an exchange fails once epoch*partners or the own count reaches 2^30 instead of 2^31. A 32-lane half in a loop with many exchanges per iteration (VAR_XK counts every exchange the program runs) gets bit 30 set in `need` after about 2^25 exchanges, takes `bad` with no peer exit or timeout, latches VAR_XDEAD and returns 0 from every later exchange. Before this PR the limit was twice as high. Masking bit 30 out of the bounds check (it's checked separately as EXITED) would keep the old headroom.
bmjask commented 2026-12-02 18:39:40 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T18:39:40Z.


@Prime1997 could you take a look at this one for review and merge? My automated review notes are above, if any.

<!-- greyfinch-sync:ivall/xcl:comment:7354954059 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3652#issuecomment-7354954059). Originally posted by [bmjask](https://github.com/bmjask) on 2026-12-02T18:39:40Z. --- @Prime1997 could you take a look at this one for review and merge? My automated review notes are above, if any.
Kalmarv commented 2026-12-02 18:47:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-12-02T18:47:46Z.


Thanks for checking 4b77d6a7 @bmjask! Checked both automated findings against the implementation — both are non-issues, so 4b77d6a7 does not need changes:

  1. lanes.rs:684 (spin_entered / ITS scheduling):

    • Inside @xcl.spin.wait (module.rs:590, 633-636), non-leader lanes branch to the helper's internal exit merge block (not program tail), where dx.op.waveReadLaneFirst immediately broadcasts the leader's result (SHFL.SYNC on NVIDIA) before the trailing TGSM_FENCE; non-leader lanes cannot run ahead of the leader out of @xcl.spin.wait to program tail.
    • Inside the shader body, RDNA2 control flow (S_CBRANCH_*), VAR_LOOP_PASSES, and VAR_BUDGET are wave-uniform across the entered lanes of a 32-lane half, and per-lane guarded(...) regions reconverge locally without branching to program tail. Only compute_gate branches per-lane to program exit -> tail, which spin_entered guards (matching safe_barrier_exit() right above at lanes.rs:721).
    • Also note: checking wave_all_bit_count == entered_count at tail would drop the exit signal entirely if lanes ever arrived unsynchronized (neither subset would equal entered_count).
  2. module.rs:597 (rejecting bit 30 in old | after | need):

    • Rejecting bit 30 (0xC000_0000) is required for soundness because bit 30 is EXITED (0x4000_0000): masking bit 30 out would let own carry into bit 30 while alive (spontaneously setting EXITED and wrapping c & 0x3FFF_FFFF to 0) and let need >= 0x4000_0000 become unsatisfiable against the 30-bit arrived = c & 0x3FFF_FFFF.
    • The 30-bit counter gives 2^25 (~33.5M) exchanges for a 32-lane half, which is far beyond LOOP_BUDGET (1 << 16 = 65,536 iterations in lower.rs:45).

(Checked and drafted with Antigravity, Gemini 4 Neon; no code changed on 4b77d6a70, so both verdict: safe to merge checks from @vasanex and @Foniass remain current for @Prime1997.)

<!-- greyfinch-sync:ivall/xcl:comment:7355165891 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3652#issuecomment-7355165891). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-12-02T18:47:46Z. --- Thanks for checking `4b77d6a7` @bmjask! Checked both automated findings against the implementation — both are non-issues, so `4b77d6a7` does not need changes: 1. **`lanes.rs:684` (`spin_entered` / ITS scheduling):** - Inside `@xcl.spin.wait` (`module.rs:590, 633-636`), non-leader lanes branch to the helper's internal `exit` merge block (not program `tail`), where `dx.op.waveReadLaneFirst` immediately broadcasts the leader's result (`SHFL.SYNC` on NVIDIA) before the trailing `TGSM_FENCE`; non-leader lanes cannot run ahead of the leader out of `@xcl.spin.wait` to program `tail`. - Inside the shader body, RDNA2 control flow (`S_CBRANCH_*`), `VAR_LOOP_PASSES`, and `VAR_BUDGET` are wave-uniform across the entered lanes of a 32-lane half, and per-lane `guarded(...)` regions reconverge locally without branching to program `tail`. Only `compute_gate` branches per-lane to program `exit -> tail`, which `spin_entered` guards (matching `safe_barrier_exit()` right above at `lanes.rs:721`). - Also note: checking `wave_all_bit_count == entered_count` at `tail` would drop the exit signal entirely if lanes ever arrived unsynchronized (neither subset would equal `entered_count`). 2. **`module.rs:597` (rejecting bit 30 in `old | after | need`):** - Rejecting bit 30 (`0xC000_0000`) is required for soundness because bit 30 is `EXITED` (`0x4000_0000`): masking bit 30 out would let `own` carry into bit 30 while alive (spontaneously setting `EXITED` and wrapping `c & 0x3FFF_FFFF` to 0) and let `need >= 0x4000_0000` become unsatisfiable against the 30-bit `arrived = c & 0x3FFF_FFFF`. - The 30-bit counter gives `2^25` (~33.5M) exchanges for a 32-lane half, which is far beyond `LOOP_BUDGET` (`1 << 16` = 65,536 iterations in `lower.rs:45`). (Checked and drafted with Antigravity, Gemini 4 Neon; no code changed on `4b77d6a70`, so both `verdict: safe to merge` checks from `@vasanex` and `@Foniass` remain current for @Prime1997.)
tiagonleal commented 2026-12-02 21:42:20 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by tiagonleal on 2026-12-02T21:42:20Z.


merge-check
base: 5ad98adbc3
head: 4b77d6a701
merge: clean (merge commit 7762c81f9c2e80495e706eda18a23f600dd152e8; git diff --check clean)
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 3006 passed, 0 failed, 52 ignored; SKIPPED: 24 (22 no wave64, 2 no heap windows); failing: none
title run: Newer Retail Game, release build of this merge, Series S settings (XCL_DEVICE_TYPE=lockhart, XCL_COHERENT_MB=512, XCL_UMA_WINDOWS=16, XCL_SPARSE_LAZY=1), scripted A presses, 240 s planned: into the world at 92 s, 147 s there with no frame presented (as in main's first run), no crash, no device removal; ran to the 240 s limit.
review: none found that blocks. Nit: the GPU test asserts a median under 2.0 ms of wall-clock time, which could flake on a loaded GPU.
performance: one extra groupshared atomic per spin kernel; the wait loop can now leave early when the partner has exited. World frame rate not compared: on this 32 GB PC the runs of main and of the PRs end 30 to 150 s into the world (RAM guard or time limit).
verdict: safe to merge
hardware / tool and model: RTX 5070 Ti 16 GB (driver 617.42), Ryzen 7 9800X3D, 32 GB, Windows 11 Pro 26300 / Claude Code with Claude Opus 5.5

Same settings on main 5ad98adb, two runs: into the world at 94 s with 145 s there and no frame presented (ran to the 240 s limit); into the world at 80 s with 59 s there and 90 frames, then stopped by our RAM guard (free RAM under 1 GB). "In the world" here means the first 2 s window of the activity log with 5,000+ draws and dispatches.

AI use: Claude Code (Claude Opus 5.5) ran the build, tests and title runs and wrote this; a Claude Sonnet subagent read the diff and I checked its points.
~Tiago

<!-- greyfinch-sync:ivall/xcl:comment:7359662253 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3652#issuecomment-7359662253). Originally posted by [tiagonleal](https://github.com/tiagonleal) on 2026-12-02T21:42:20Z. --- merge-check base: 5ad98adbc360225ac8a57ad9661e16fe8df9d8dd head: 4b77d6a701e41eb56aaf9391a49755c6c21e4ffb merge: clean (merge commit 7762c81f9c2e80495e706eda18a23f600dd152e8; `git diff --check` clean) build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 3006 passed, 0 failed, 52 ignored; SKIPPED: 24 (22 no wave64, 2 no heap windows); failing: none title run: Newer Retail Game, release build of this merge, Series S settings (`XCL_DEVICE_TYPE=lockhart`, `XCL_COHERENT_MB=512`, `XCL_UMA_WINDOWS=16`, `XCL_SPARSE_LAZY=1`), scripted A presses, 240 s planned: into the world at 92 s, 147 s there with no frame presented (as in main's first run), no crash, no device removal; ran to the 240 s limit. review: none found that blocks. Nit: the GPU test asserts a median under 2.0 ms of wall-clock time, which could flake on a loaded GPU. performance: one extra groupshared atomic per spin kernel; the wait loop can now leave early when the partner has exited. World frame rate not compared: on this 32 GB PC the runs of main and of the PRs end 30 to 150 s into the world (RAM guard or time limit). verdict: safe to merge hardware / tool and model: RTX 5070 Ti 16 GB (driver 617.42), Ryzen 7 9800X3D, 32 GB, Windows 11 Pro 26300 / Claude Code with Claude Opus 5.5 Same settings on main 5ad98adb, two runs: into the world at 94 s with 145 s there and no frame presented (ran to the 240 s limit); into the world at 80 s with 59 s there and 90 frames, then stopped by our RAM guard (free RAM under 1 GB). "In the world" here means the first 2 s window of the activity log with 5,000+ draws and dispatches. AI use: Claude Code (Claude Opus 5.5) ran the build, tests and title runs and wrote this; a Claude Sonnet subagent read the diff and I checked its points. ~Tiago
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!3652
No description provided.