Docs: the split-wave64 exchange spins by default, since PR #798 #1252

Closed
Rj45n wants to merge 1 commit from upstream-pr/1262 into main
Rj45n commented 2026-11-24 13:58:03 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Rj45n on 2026-11-24T13:58:03Z.


PR #798 (066ae5b, "Recompiler: default split-wave64 exchange to bounded spin") made the counter variant the default for every group and made XCL_WAVE64_SPIN=0 the way back to group barriers. The note still described the state before it, in three places and in the opposite direction:

  • the "one console wave per group" bullet presented GroupMemoryBarrierWithGroupSync as what those groups use;
  • the counter bullet said "XCL_WAVE64_SPIN=1 forces this variant everywhere", so a reader takes the bounded wait to be opt-in;
  • hazard 5 said "only the multi-wave variant spins".

emit.rs, x64_spin, reads the variable as
map_or(true, |v| v.trim() != "0"): unset means spin. Its own doc comment says so, and tests.rs reads it the same way.

This matters beyond tidiness. As written, the note tells a reader on a wave32 GPU that the bounded wait (2^20 polls, then xcl_x_dead and half-local values) is off for their one-wave groups, when it is on for every group. That is the first thing one would want to rule out when reading a load-sensitive failure in this family, such as #847.

The old sentence "the test suite passes with it too" is dropped rather than carried over to the other direction: on an RTX 5070 Ti, cargo test -p xcl --lib gpu::recomp -- --test-threads=4 is not stable in either mode (four runs each: 0, 6, 5, 0 failures with the default and 1, 7, 1, 7 with XCL_WAVE64_SPIN=0). The failures are the family of #343 plus DXGI_ERROR_DEVICE_REMOVED collateral, and they do not separate by the variable, so the note should not claim an outcome either way.

Documentation only; the emitter is unchanged.

Assisted-by: Claude Code (Claude Opus 5)

What is in it

Tested

  • hardware (GPU + driver, CPU), Rust version, debug / release:
  • cargo test --workspace -- --test-threads=4: N passed, N failed, N ignored (SKIPPED GPU tests: …)

Regression run

main:

PR:

Not tested

AI use

  • none / tool and model, and what it did
<!-- greyfinch-sync:ivall/xcl:issue:5473552571 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1262). Originally posted by [Rj45n](https://github.com/Rj45n) on 2026-11-24T13:58:03Z. --- PR #798 (066ae5b, "Recompiler: default split-wave64 exchange to bounded spin") made the counter variant the default for every group and made XCL_WAVE64_SPIN=0 the way back to group barriers. The note still described the state before it, in three places and in the opposite direction: - the "one console wave per group" bullet presented GroupMemoryBarrierWithGroupSync as what those groups use; - the counter bullet said "XCL_WAVE64_SPIN=1 forces this variant everywhere", so a reader takes the bounded wait to be opt-in; - hazard 5 said "only the multi-wave variant spins". `emit.rs`, `x64_spin`, reads the variable as `map_or(true, |v| v.trim() != "0")`: unset means spin. Its own doc comment says so, and `tests.rs` reads it the same way. This matters beyond tidiness. As written, the note tells a reader on a wave32 GPU that the bounded wait (2^20 polls, then `xcl_x_dead` and half-local values) is off for their one-wave groups, when it is on for every group. That is the first thing one would want to rule out when reading a load-sensitive failure in this family, such as #847. The old sentence "the test suite passes with it too" is dropped rather than carried over to the other direction: on an RTX 5070 Ti, `cargo test -p xcl --lib gpu::recomp -- --test-threads=4` is not stable in either mode (four runs each: 0, 6, 5, 0 failures with the default and 1, 7, 1, 7 with XCL_WAVE64_SPIN=0). The failures are the family of #343 plus DXGI_ERROR_DEVICE_REMOVED collateral, and they do not separate by the variable, so the note should not claim an outcome either way. Documentation only; the emitter is unchanged. Assisted-by: Claude Code (Claude Opus 5) <!-- What changes and why, in a few sentences. "Fixes #N" / "Part of #N". Stacked: "Stacked on #N". --> **What is in it** - **Tested** - hardware (GPU + driver, CPU), Rust version, debug / release: - `cargo test --workspace -- --test-threads=4`: N passed, N failed, N ignored (SKIPPED GPU tests: …) **Regression run** <!-- Required when the PR changes crates/xcl/src outside tests: `scripts/smoke.ps1` on a real title, built from main and from this PR's head commit (no uncommitted changes); paste both blocks. Rerun the PR's after every push. Not needed for docs / tests / scripts only. --> main: PR: **Not tested** - **AI use** - none / tool and model, and what it did
DavidM1911 commented 2026-11-24 14:06:53 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T14:05:37Z.


Docs-only change; verified the claims against the tree: the split-wave64 exchange does spin by default since #798 merged (docs/wave64-on-wave32.md now matches the code). No tests applicable.

<!-- greyfinch-sync:ivall/xcl:comment:7133828248 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1262#issuecomment-7133828248). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T14:05:37Z. --- Docs-only change; verified the claims against the tree: the split-wave64 exchange does spin by default since #798 merged (`docs/wave64-on-wave32.md` now matches the code). No tests applicable.
Rj45n commented 2026-11-24 16:07:00 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Rj45n on 2026-11-24T15:18:37Z.


Thank you — both of these are useful, and the second one reproduces here.

On the vram filter run. That matches what I see: gpu_sparse_vram_descriptors_buffers_and_xmem is the one failure, it is not one of the tests this PR touches (it takes neither TEST_LOCK nor VRAM_TEST_LOCK), and it is the subject of #343. I have eight runs of gpu::recomp on an RTX 5070 Ti where it is the first failure in every failing run: 6 of 8 at --test-threads=4, and in half of those the device is then lost (DXGI_ERROR_DEVICE_REMOVED, 0x887A0005) and three to five further GPU tests fail with it. So one root cause can be reported as up to seven failures. Numbers are in #343 rather than here.

On the access violation — reproduced, on a different card, with a thread boundary. cargo test -p xcl --lib d3d12x on unmodified main (930e8b4), RTX 5070 Ti 16 GB (driver 621.01), Windows 11 Pro 10.0.26300, Rust 1.98.1 MSVC, debug profile, 24 logical CPUs:

--test-threads result
1 131 passed, 0 failed, 1 ignored (2/2 runs)
2 131 passed, 0 failed, 1 ignored (2/2 runs)
4 131 passed, 0 failed, 1 ignored (2/2 runs)
8 exit code: 0xc0000005, STATUS_ACCESS_VIOLATION (2/2 runs)
16 0xc0000005 (2/2 runs)
default (24) 0xc0000005 (3/3 runs)
The whole test binary dies; it is not a test reporting a failure. So this is not specific to your RTX 3060 Ti, and it is not specific to this branch — it is on bare main, and it is why the project's prescribed --test-threads=4 does not show it.

One observation I would not over-read: in all three default-parallelism runs the last line printed before the fault is the same family,

xcl: D3D12.X: Wait64BitValueX at 0x… >= 0x677 bridged to GPU queue.Wait
(waiter=q0/ty0, prod=qNone/tySome(2); wait-before-signal, after_write64=false)
Output is buffered, so the last line printed is not the faulting site, and I have no stack. It is a hint about where to point a debugger, nothing more.

Why it is not what this PR hardens. A 0xc0000005 takes the process down, so no mutex is left poisoned — there is nothing for a recovering guard to recover. The two are independent: this PR removes the cascade after a Rust panic under the d3d12x test locks, which is what turns the #718 flake into three reported failures. The access violation needs its own fix, and its own issue — it is a runtime bug on main, not a test-lock question. I will open one with the table above unless you would rather file it, since you saw it first; say the word either way.

Not tested: AMD, Linux / Wine, release profile, any retail title (no Xbox GDK files here, so no scripts/smoke.ps1), and I have not caught a stack for the fault.

AI use: Claude Code with Claude Opus 5 ran the thread-count matrix and drafted this; I checked each figure against the logs before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7135808820 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1262#issuecomment-7135808820). Originally posted by [Rj45n](https://github.com/Rj45n) on 2026-11-24T15:18:37Z. --- Thank you — both of these are useful, and the second one reproduces here. On the vram filter run. That matches what I see: gpu_sparse_vram_descriptors_buffers_and_xmem is the one failure, it is not one of the tests this PR touches (it takes neither TEST_LOCK nor VRAM_TEST_LOCK), and it is the subject of #343. I have eight runs of gpu::recomp on an RTX 5070 Ti where it is the first failure in every failing run: 6 of 8 at --test-threads=4, and in half of those the device is then lost (DXGI_ERROR_DEVICE_REMOVED, 0x887A0005) and three to five further GPU tests fail with it. So one root cause can be reported as up to seven failures. Numbers are in #343 rather than here. On the access violation — reproduced, on a different card, with a thread boundary. cargo test -p xcl --lib d3d12x on unmodified main (930e8b4), RTX 5070 Ti 16 GB (driver 621.01), Windows 11 Pro 10.0.26300, Rust 1.98.1 MSVC, debug profile, 24 logical CPUs: --test-threads result 1 131 passed, 0 failed, 1 ignored (2/2 runs) 2 131 passed, 0 failed, 1 ignored (2/2 runs) 4 131 passed, 0 failed, 1 ignored (2/2 runs) 8 exit code: 0xc0000005, STATUS_ACCESS_VIOLATION (2/2 runs) 16 0xc0000005 (2/2 runs) default (24) 0xc0000005 (3/3 runs) The whole test binary dies; it is not a test reporting a failure. So this is not specific to your RTX 3060 Ti, and it is not specific to this branch — it is on bare main, and it is why the project's prescribed --test-threads=4 does not show it. One observation I would not over-read: in all three default-parallelism runs the last line printed before the fault is the same family, xcl: D3D12.X: Wait64BitValueX at 0x… >= 0x677 bridged to GPU queue.Wait (waiter=q0/ty0, prod=qNone/tySome(2); wait-before-signal, after_write64=false) Output is buffered, so the last line printed is not the faulting site, and I have no stack. It is a hint about where to point a debugger, nothing more. Why it is not what this PR hardens. A 0xc0000005 takes the process down, so no mutex is left poisoned — there is nothing for a recovering guard to recover. The two are independent: this PR removes the cascade after a Rust panic under the d3d12x test locks, which is what turns the #718 flake into three reported failures. The access violation needs its own fix, and its own issue — it is a runtime bug on main, not a test-lock question. I will open one with the table above unless you would rather file it, since you saw it first; say the word either way. Not tested: AMD, Linux / Wine, release profile, any retail title (no Xbox GDK files here, so no scripts/smoke.ps1), and I have not caught a stack for the fault. AI use: Claude Code with Claude Opus 5 ran the thread-count matrix and drafted this; I checked each figure against the logs before posting.
github-actions[bot] commented 2026-11-29 07:40:52 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T07:40:52Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7252623436 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1262#issuecomment-7252623436). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-29T07:40:52Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
Foniass commented 2026-12-01 05:16:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T05:16:43Z.


Triage (#1607) – head aa9c75a

Main commit 45f9c79 already updated the Synchronisation section of docs/wave64-on-wave32.md to say the counter variant is the default for one console wave per group, with XCL_WAVE64_SPIN=0 for the group barrier; the PR now conflicts with it. Its text also no longer matches main (kernel mode still uses the group barrier there).
The one stale line left on main is hazard 5 ("only the multi-wave variant spins"); a one-line fix for that alone would still be useful.
Recommendation: close (superseded by main commit 45f9c79).

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7301602845 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1262#issuecomment-7301602845). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T05:16:43Z. --- **Triage (#1607)** – head aa9c75a Main commit 45f9c79 already updated the Synchronisation section of docs/wave64-on-wave32.md to say the counter variant is the default for one console wave per group, with `XCL_WAVE64_SPIN=0` for the group barrier; the PR now conflicts with it. Its text also no longer matches main (kernel mode still uses the group barrier there). The one stale line left on main is hazard 5 ("only the multi-wave variant spins"); a one-line fix for that alone would still be useful. Recommendation: close (superseded by main commit 45f9c79). AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
throny commented 2026-12-01 12:44:02 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-12-01T12:44:02Z.


Closing as superseded: this change is already on main (45f9c792). main docs/wave64-on-wave32.md Synchronisation section already rewritten to say counters/spin are the default for the split exchange (45f9c79 exists); doc-only PR

Two independent checks found this: Foniass's close list on #1607 and ours against current main. If something here is still missing on main, say so and reopen it, or ask and I will.

AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.

<!-- greyfinch-sync:ivall/xcl:comment:7311567511 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1262#issuecomment-7311567511). Originally posted by [throny](https://github.com/throny) on 2026-12-01T12:44:02Z. --- Closing as superseded: this change is already on `main` (45f9c792). main docs/wave64-on-wave32.md Synchronisation section already rewritten to say counters/spin are the default for the split exchange (45f9c79 exists); doc-only PR Two independent checks found this: Foniass's close list on #1607 and ours against current `main`. If something here is still missing on `main`, say so and reopen it, or ask and I will. AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.

Pull request closed

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!1252
No description provided.