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

Open
github-bot wants to merge 1 commit from github-bot/gh-1262 into main AGit
Owner

@⁠Rj45n on GitHub · 2026-11-24 13:58 UTC · original
Rj45n:docs/wave64-spin-default → main · +9 −4 · 1 files · 1 commits · open

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
**@⁠Rj45n** on GitHub · 2026-11-24 13:58 UTC · [original](https://github.com/xcl-dev/xcl/pull/1262) `Rj45n:docs/wave64-spin-default` → `main` · +9 −4 · 1 files · 1 commits · open 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
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)

Co-Authored-By: Claude Opus 5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:48:46 +00:00
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 14:05 UTC · original

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.

**@⁠DavidM1911** on GitHub · 2026-11-24 14:05 UTC · [original](https://github.com/xcl-dev/xcl/pull/1262#issuecomment-7133828248) 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.
Author
Owner

@⁠Rj45n on GitHub · 2026-11-24 15:18 UTC · original

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.

**@⁠Rj45n** on GitHub · 2026-11-24 15:18 UTC · [original](https://github.com/xcl-dev/xcl/pull/1262#issuecomment-7135808820) 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.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1262/head:github-bot/gh-1262'
git switch 'github-bot/gh-1262'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1262'
git switch 'github-bot/gh-1262'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1262'
git switch 'github-bot/gh-1262'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1262'
git switch 'main'
git merge --squash 'github-bot/gh-1262'
git switch 'main'
git merge --ff-only 'github-bot/gh-1262'
git switch 'main'
git merge 'github-bot/gh-1262'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.