Add a synthetic D3D12 wave64 regression for independently looping waves #3180

Open
github-bot wants to merge 3 commits from github-bot/gh-3180 into main AGit
Owner

@⁠carlosmegino on GitHub · 2026-11-26 11:20 UTC · original
carlosmegino:codex/wave64-2688-regression → main · +453 −19 · 3 files · 3 commits · open

Refs #2688.

Summary

Add an opt-in, synthetic D3D12 readback test for a 128-thread group with two logical wave64s. The waves use different EXEC masks and loop counts, keep their LDS regions separate, elect lanes in opposite halves, and read the other wave's counter after a group barrier. A 64-thread group serves as the control. The CPU oracle checks seven UAVs at every logical lane and also checks their canaries.

The LDS loop is adapted from PiloteCode's GPL-3.0 fixture in fxceless/victory-fork#854. The PR adds the test and a resource-state adjustment in the test host.

Validation

On an RTX 5070 Ti, the main emitter requests a physical wave64 PSO for the 64-thread case. The 128-thread case runs but returns 0 instead of 40 in UAV 2, lane 0. The only upstream change between the tested 842b0cb and this PR's base 63bcca4 is a README update. This draft records the expected failures so a later backend patch can demonstrate both cases turning green.

With the paired backend and the separate selection fix, both group sizes matched all seven CPU outputs per lane. Canaries stayed intact and D3D12 GPU-based validation reported zero warnings or errors.

Run on a wave32 GPU with Windows Graphics Tools and the DXIL validator:

cargo test -p victory-shader --locked --lib wave64_2688_group -- --ignored --nocapture --test-threads=1
**@⁠carlosmegino** on GitHub · 2026-11-26 11:20 UTC · [original](https://github.com/Marvisak/VIctory/pull/3180) `carlosmegino:codex/wave64-2688-regression` → `main` · +453 −19 · 3 files · 3 commits · open Refs #2688. ## Summary Add an opt-in, synthetic D3D12 readback test for a 128-thread group with two logical wave64s. The waves use different EXEC masks and loop counts, keep their LDS regions separate, elect lanes in opposite halves, and read the other wave's counter after a group barrier. A 64-thread group serves as the control. The CPU oracle checks seven UAVs at every logical lane and also checks their canaries. The LDS loop is adapted from PiloteCode's GPL-3.0 fixture in fxceless/victory-fork#854. The PR adds the test and a resource-state adjustment in the test host. ## Validation On an RTX 5070 Ti, the main emitter requests a physical wave64 PSO for the 64-thread case. The 128-thread case runs but returns 0 instead of 40 in UAV 2, lane 0. The only upstream change between the tested `842b0cb` and this PR's base `63bcca4` is a README update. This draft records the expected failures so a later backend patch can demonstrate both cases turning green. With the paired backend and the separate selection fix, both group sizes matched all seven CPU outputs per lane. Canaries stayed intact and D3D12 GPU-based validation reported zero warnings or errors. Run on a wave32 GPU with Windows Graphics Tools and the DXIL validator: ```powershell cargo test -p victory-shader --locked --lib wave64_2688_group -- --ignored --nocapture --test-threads=1 ```
(cherry picked from commit 1d717d57fabf1ce0234ad50658b99ff62a908108)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 11:32:59 +00:00
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-26 12:11 UTC · original · reviewed

Checked against origin/main (63bcca4) on Windows 11 + RTX 5090:

  • cargo clippy -p victory-shader --all-targets -- -D warnings: clean.
  • cargo xtask policy: 192 files ok.
  • cargo test -p victory-shader --lib wave64_group_tests::: compiles cleanly (2 ignored by default). Running with --ignored requires Windows Graphics Tools (D3D12GetDebugInterface returned 0x887A002D DXGI_ERROR_SDK_COMPONENT_MISSING on this host), so I am leaving a comment rather than an approval since the ignored GPU assertions could not be executed here.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

**@⁠Dukestar69** on GitHub · 2026-11-26 12:11 UTC · [original](https://github.com/Marvisak/VIctory/pull/3180#pullrequestreview-6073907867) · **reviewed** Checked against `origin/main` (`63bcca4`) on Windows 11 + RTX 5090: - `cargo clippy -p victory-shader --all-targets -- -D warnings`: clean. - `cargo xtask policy`: 192 files ok. - `cargo test -p victory-shader --lib wave64_group_tests::`: compiles cleanly (2 ignored by default). Running with `--ignored` requires Windows Graphics Tools (`D3D12GetDebugInterface` returned `0x887A002D` `DXGI_ERROR_SDK_COMPONENT_MISSING` on this host), so I am leaving a comment rather than an approval since the ignored GPU assertions could not be executed here. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Author
Owner

@⁠carlosmegino on GitHub · 2026-11-26 12:14 UTC · original

Thanks for the independent verification!

The ignored tests require Windows Graphics Tools because they enable the D3D12 debug layer and GPU-based validation.

Installing Graphics Tools under Windows Optional Features should resolve DXGI_ERROR_SDK_COMPONENT_MISSING.

I appreciate you checking the compilation, Clippy and asset policy on a separate NVIDIA system.

If you have the opportunity to run the GPU assertions on your RTX 5090, that would provide a valuable independent hardware result.

**@⁠carlosmegino** on GitHub · 2026-11-26 12:14 UTC · [original](https://github.com/Marvisak/VIctory/pull/3180#issuecomment-7191741665) Thanks for the independent verification! The ignored tests require Windows Graphics Tools because they enable the D3D12 debug layer and GPU-based validation. Installing Graphics Tools under Windows Optional Features should resolve DXGI_ERROR_SDK_COMPONENT_MISSING. I appreciate you checking the compilation, Clippy and asset policy on a separate NVIDIA system. If you have the opportunity to run the GPU assertions on your RTX 5090, that would provide a valuable independent hardware result.
Author
Owner

@⁠upipibi on GitHub · 2026-11-26 20:05 UTC · original · edited 2026-11-26 20:13 UTC

Independent hardware run of the ignored tests on 827057a (main 63bcca4 only for the shared tests: the two ignored tests are added by this PR, so they do not exist on main and ran on the PR head only): RTX 3070 8 GB (Ampere, wave32 only), driver 616.56, Windows 11, rustc 1.98.1, Windows Graphics Tools and dxil.dll present.

cargo test -p victory-shader --locked --lib wave64_2688_group -- --ignored --nocapture --test-threads=1, one run:

test result on the PR head
wave64_2688_group_128 fails: UAV 2, lane 0 reads 0 instead of 40
wave64_2688_group_64 fails at pipeline creation; the debug layer reports "Shader wants wave lane count of 64 but maximum wave lane count for device is 32"

Both are the expected failures your description records on the RTX 5070 Ti: the 64-thread case's main emitter asks for a physical wave64 PSO, which a 32-lane-only driver refuses, and the 128-thread case returns 0 instead of 40. So Ampere shows the same two failures. The debug layer logged that one error and no warnings; GPU-based validation logged nothing. The non-ignored wave64 tests pass on both trees (5 each). No driver resets.

AI-assisted (Claude Code, Claude Sonnet 5.5 ran the tests; Claude Opus 5.5 checked and posted).

**@⁠upipibi** on GitHub · 2026-11-26 20:05 UTC · [original](https://github.com/Marvisak/VIctory/pull/3180#issuecomment-7202281143) · edited 2026-11-26 20:13 UTC Independent hardware run of the ignored tests on `827057a` (`main` `63bcca4` only for the shared tests: the two ignored tests are added by this PR, so they do not exist on `main` and ran on the PR head only): RTX 3070 8 GB (Ampere, wave32 only), driver 616.56, Windows 11, rustc 1.98.1, Windows Graphics Tools and `dxil.dll` present. `cargo test -p victory-shader --locked --lib wave64_2688_group -- --ignored --nocapture --test-threads=1`, one run: | test | result on the PR head | |---|---| | `wave64_2688_group_128` | fails: UAV 2, lane 0 reads 0 instead of 40 | | `wave64_2688_group_64` | fails at pipeline creation; the debug layer reports "Shader wants wave lane count of 64 but maximum wave lane count for device is 32" | Both are the expected failures your description records on the RTX 5070 Ti: the 64-thread case's main emitter asks for a physical wave64 PSO, which a 32-lane-only driver refuses, and the 128-thread case returns 0 instead of 40. So Ampere shows the same two failures. The debug layer logged that one error and no warnings; GPU-based validation logged nothing. The non-ignored `wave64` tests pass on both trees (5 each). No driver resets. AI-assisted (Claude Code, Claude Sonnet 5.5 ran the tests; Claude Opus 5.5 checked and posted).
Author
Owner

@⁠kilolimaVI on GitHub · 2026-11-26 21:31 UTC · original

Ran the two ignored tests on AMD: Windows 11, Radeon 780M (RDNA3), Graphics Tools installed, toolchain 1.98.1.

Both panic at wave64_group_tests.rs:216, assert_eq!((caps.WaveLaneCountMin, caps.WaveLaneCountMax), (32, 32)): this adapter reports (32, 64), as RDNA does. So they need a 32-lane-only host (NVIDIA, Intel), which matches the ignore reason, but on an AMD card they read as failures rather than "not this host". Returning early with a note when WaveLaneCountMax != 32 would make --ignored runs on mixed hardware clean. Before that point (debug layer, device creation) everything worked here.

AI-assisted (Claude).

**@⁠kilolimaVI** on GitHub · 2026-11-26 21:31 UTC · [original](https://github.com/Marvisak/VIctory/pull/3180#issuecomment-7203801561) Ran the two ignored tests on AMD: Windows 11, Radeon 780M (RDNA3), Graphics Tools installed, toolchain 1.98.1. Both panic at `wave64_group_tests.rs:216`, `assert_eq!((caps.WaveLaneCountMin, caps.WaveLaneCountMax), (32, 32))`: this adapter reports (32, 64), as RDNA does. So they need a 32-lane-only host (NVIDIA, Intel), which matches the ignore reason, but on an AMD card they read as failures rather than "not this host". Returning early with a note when `WaveLaneCountMax != 32` would make `--ignored` runs on mixed hardware clean. Before that point (debug layer, device creation) everything worked here. AI-assisted (Claude).
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 22:08 UTC · original · requested changes

Verified on 827057a6:

  • cargo xtask policy: 192 files ok.
  • cargo clippy --locked -p victory-shader --all-targets -- -D warnings (default and --all-features): clean.
  • Default emit::wave64_group_tests:: emit::tests:: under VICTORY_WARP=0 and VICTORY_WARP=1: 17 passed, 0 failed, 2 ignored.
  • Running the ignored tests on an RTX 5090 (Wave32 (32, 32), D3D12 Graphics Tools, and dxil.dll present) with -- --ignored --test-threads=1 emit::wave64_group_tests::: 0 passed, 2 failed:
    • wave64_2688_group_64 (wave64_group_tests.rs:226): ID3D12Device::CreateComputeShader: Shader wants wave lane count of 64 but maximum wave lane count for device is 32.
    • wave64_2688_group_128 (wave64_group_tests.rs:251): UAV 2, thread 0 got 0, expected 40.

The #[cfg(test)] change in crates/victory-shader/src/emit/host.rs:1706 (D3D12_RESOURCE_STATE_COMMON with implicit state promotion) looks good, and the synthetic Wave64 math/oracle is clear, but several items need attention before landing:

  1. Both ignored tests fail on 63bcca43 even on a Wave32 RTX 5090: If these are intended as a known-red regression for #2688 prior to a compiler fix, the #[ignore] reason should state that explicitly rather than implying they only need a Wave32 GPU + Graphics Tools + DXIL validator.
  2. Module ordering (crates/victory-shader/src/emit/mod.rs:222): rustfmt --edition 2024 --check fails because mod wave64_group_tests; needs to be ordered alphabetically after mod wave;.
  3. Guest LDS wait order (crates/victory-shader/src/emit/wave64_group_tests.rs:97, 100): The 128-thread guest issues s_barrier without a preceding s_waitcnt lgkmcnt(0) before reading the peer wave's LDS counter, and the 64-thread path copies v5 to v7 before the first explicit s_waitcnt.
  4. Test harness isolation & adapter gating (wave64_group_tests.rs:190-220, 264): Enabling SetEnableGPUBasedValidation(true) via Once can trigger device removal if another test created a device first (--include-ignored), Host::new(false) respects VICTORY_WARP=1 and hard-panics on non-(32, 32) adapters instead of skipping, and running both tests without ONE_AT_A_TIME risks concurrent hardware dispatches.
**@⁠fuzeofficlal** on GitHub · 2026-11-26 22:08 UTC · [original](https://github.com/Marvisak/VIctory/pull/3180#pullrequestreview-6080999487) · **requested changes** Verified on `827057a6`: - `cargo xtask policy`: `192 files ok`. - `cargo clippy --locked -p victory-shader --all-targets -- -D warnings` (default and `--all-features`): clean. - Default `emit::wave64_group_tests:: emit::tests::` under `VICTORY_WARP=0` and `VICTORY_WARP=1`: **17 passed, 0 failed, 2 ignored**. - Running the ignored tests on an RTX 5090 (Wave32 `(32, 32)`, D3D12 Graphics Tools, and `dxil.dll` present) with `-- --ignored --test-threads=1 emit::wave64_group_tests::`: **0 passed, 2 failed**: - `wave64_2688_group_64` (`wave64_group_tests.rs:226`): `ID3D12Device::CreateComputeShader: Shader wants wave lane count of 64 but maximum wave lane count for device is 32.` - `wave64_2688_group_128` (`wave64_group_tests.rs:251`): `UAV 2, thread 0` got `0`, expected `40`. The `#[cfg(test)]` change in `crates/victory-shader/src/emit/host.rs:1706` (`D3D12_RESOURCE_STATE_COMMON` with implicit state promotion) looks good, and the synthetic Wave64 math/oracle is clear, but several items need attention before landing: 1. **Both ignored tests fail on `63bcca43` even on a Wave32 RTX 5090**: If these are intended as a known-red regression for `#2688` prior to a compiler fix, the `#[ignore]` reason should state that explicitly rather than implying they only need a Wave32 GPU + Graphics Tools + DXIL validator. 2. **Module ordering (`crates/victory-shader/src/emit/mod.rs:222`)**: `rustfmt --edition 2024 --check` fails because `mod wave64_group_tests;` needs to be ordered alphabetically after `mod wave;`. 3. **Guest LDS wait order (`crates/victory-shader/src/emit/wave64_group_tests.rs:97, 100`)**: The 128-thread guest issues `s_barrier` without a preceding `s_waitcnt lgkmcnt(0)` before reading the peer wave's LDS counter, and the 64-thread path copies `v5` to `v7` before the first explicit `s_waitcnt`. 4. **Test harness isolation & adapter gating (`wave64_group_tests.rs:190-220, 264`)**: Enabling `SetEnableGPUBasedValidation(true)` via `Once` can trigger device removal if another test created a device first (`--include-ignored`), `Host::new(false)` respects `VICTORY_WARP=1` and hard-panics on non-`(32, 32)` adapters instead of skipping, and running both tests without `ONE_AT_A_TIME` risks concurrent hardware dispatches.
Author
Owner

@⁠carlosmegino on GitHub · 2026-11-26 22:27 UTC · original

@⁠fuzeofficlal — response to observation 1 (known-red regressions), addressed in 1625d1c.

Both ignore reasons now explicitly say known regression: fails until #2688 is fixed, followed by the hardware/tool requirements.

Rechecked the original head 827057a6 before editing; upstream main remains 63bcca43c6a00a758510398fa43096ce7e4f7df0. With that main emitter and the revised synthetic fixture:

  • 64 threads: PSO creation fails with D3D12's “Shader wants wave lane count of 64 but maximum wave lane count for device is 32.”
  • 128 threads: all seven UAVs are checked. UAV 2/thread 0 is 0 instead of 40; UAV 3/thread 0 is 0 instead of 20. Each has 128 mismatches. The other five UAVs match, all 56 canaries remain intact, and D3D12 reports zero warnings/errors.

The separate local paired-backend control is a9ef792f6d516ee6200f4fedeb061a25153d48fd, including the masked-first-lane selection correction. I copied this PR's revised fixture into that checkout; its only API adaptation is emit_with(..., Options { wave32_only: host::wave32_only(&host.device), ..Default::default() }) instead of main's emit(...). Guest instructions and CPU oracle are identical between controls. Both tests pass there: 448 and 896 lane values checked, respectively, 56 canaries each, zero D3D12 warnings/errors. This backend remains outside the PR.

Hardware: Windows, RTX 5070 Ti, driver 621.01, rustc 1.98.1, wave lanes (32,32), Graphics Tools and DXIL validator available. Reproduction:

$env:VICTORY_WARP='0'
cargo test -p victory-shader --locked --lib wave64_2688_group -- --ignored --nocapture

Only synthetic resources were used.

**@⁠carlosmegino** on GitHub · 2026-11-26 22:27 UTC · [original](https://github.com/Marvisak/VIctory/pull/3180#issuecomment-7204700203) @⁠fuzeofficlal — response to observation 1 (known-red regressions), addressed in [1625d1c](https://github.com/carlosmegino/VIctory/commit/1625d1c686adc74e986d578b47aa6364b672b8d6). Both ignore reasons now explicitly say `known regression: fails until #2688 is fixed`, followed by the hardware/tool requirements. Rechecked the original head `827057a6` before editing; upstream main remains `63bcca43c6a00a758510398fa43096ce7e4f7df0`. With that main emitter and the revised synthetic fixture: - 64 threads: PSO creation fails with D3D12's “Shader wants wave lane count of 64 but maximum wave lane count for device is 32.” - 128 threads: all seven UAVs are checked. UAV 2/thread 0 is 0 instead of 40; UAV 3/thread 0 is 0 instead of 20. Each has 128 mismatches. The other five UAVs match, all 56 canaries remain intact, and D3D12 reports zero warnings/errors. The separate local paired-backend control is `a9ef792f6d516ee6200f4fedeb061a25153d48fd`, including the masked-first-lane selection correction. I copied this PR's revised fixture into that checkout; its only API adaptation is `emit_with(..., Options { wave32_only: host::wave32_only(&host.device), ..Default::default() })` instead of main's `emit(...)`. Guest instructions and CPU oracle are identical between controls. Both tests pass there: 448 and 896 lane values checked, respectively, 56 canaries each, zero D3D12 warnings/errors. This backend remains outside the PR. Hardware: Windows, RTX 5070 Ti, driver 621.01, rustc 1.98.1, wave lanes (32,32), Graphics Tools and DXIL validator available. Reproduction: ```powershell $env:VICTORY_WARP='0' cargo test -p victory-shader --locked --lib wave64_2688_group -- --ignored --nocapture ``` Only synthetic resources were used.
Author
Owner

@⁠carlosmegino on GitHub · 2026-11-26 22:27 UTC · original

@⁠fuzeofficlal — response to observation 2 (module ordering / formatting), addressed in 1625d1c.

wave64_group_tests now follows wave; rustfmt also orders bvh_tests before census_tests. Formatting was restricted to the PR's three existing files, with child traversal disabled:

rustfmt --edition 2024 --config skip_children=true --check crates/victory-shader/src/emit/mod.rs crates/victory-shader/src/emit/host.rs crates/victory-shader/src/emit/wave64_group_tests.rs
cargo clippy --workspace --all-targets --locked -- -D warnings
cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
cargo xtask policy

All exit 0; policy reports 192 files ok. The changes to host.rs in this follow-up are formatting only. No compiler changes or optimizations are included.

**@⁠carlosmegino** on GitHub · 2026-11-26 22:27 UTC · [original](https://github.com/Marvisak/VIctory/pull/3180#issuecomment-7204700444) @⁠fuzeofficlal — response to observation 2 (module ordering / formatting), addressed in [1625d1c](https://github.com/carlosmegino/VIctory/commit/1625d1c686adc74e986d578b47aa6364b672b8d6). `wave64_group_tests` now follows `wave`; rustfmt also orders `bvh_tests` before `census_tests`. Formatting was restricted to the PR's three existing files, with child traversal disabled: ```powershell rustfmt --edition 2024 --config skip_children=true --check crates/victory-shader/src/emit/mod.rs crates/victory-shader/src/emit/host.rs crates/victory-shader/src/emit/wave64_group_tests.rs cargo clippy --workspace --all-targets --locked -- -D warnings cargo clippy --workspace --all-targets --all-features --locked -- -D warnings cargo xtask policy ``` All exit 0; policy reports `192 files ok`. The changes to host.rs in this follow-up are formatting only. No compiler changes or optimizations are included.
Author
Owner

@⁠carlosmegino on GitHub · 2026-11-26 22:27 UTC · original

@⁠fuzeofficlal — response to observation 3 (guest LDS ordering), addressed in 1625d1c.

The guest now waits with s_waitcnt lgkmcnt(0) after counter initialization, after each atomic iteration before narrowing EXEC, after reading its own counter, between the per-lane LDS write and opposite-half read, immediately before the group barrier, and after the peer-counter read. Descriptor loads retain their waits before buffer stores. Thus the 64-thread copy consumes a completed v5, and the 128-thread peer read follows completed LDS work plus the barrier.

The loop branch displacement is calculated from its label instead of hard-coded. The new CPU-only decode audit checks LDS/SMEM completion waits, barrier ordering, complete instruction boundaries, and the loop target for both group sizes:

cargo test -p victory-shader --locked --lib guest_lds_dependencies_and_branches -- --nocapture

Result: 1 passed. Both branches are at byte 92 and target byte 64: -32 bytes from the following PC, i.e. -8 dwords (0xBF89FFF8).

The CPU oracle is unchanged. The revised programs still reproduce both main defects and both pass the separate paired-backend control described above.

**@⁠carlosmegino** on GitHub · 2026-11-26 22:27 UTC · [original](https://github.com/Marvisak/VIctory/pull/3180#issuecomment-7204700661) @⁠fuzeofficlal — response to observation 3 (guest LDS ordering), addressed in [1625d1c](https://github.com/carlosmegino/VIctory/commit/1625d1c686adc74e986d578b47aa6364b672b8d6). The guest now waits with `s_waitcnt lgkmcnt(0)` after counter initialization, after each atomic iteration before narrowing EXEC, after reading its own counter, between the per-lane LDS write and opposite-half read, immediately before the group barrier, and after the peer-counter read. Descriptor loads retain their waits before buffer stores. Thus the 64-thread copy consumes a completed v5, and the 128-thread peer read follows completed LDS work plus the barrier. The loop branch displacement is calculated from its label instead of hard-coded. The new CPU-only decode audit checks LDS/SMEM completion waits, barrier ordering, complete instruction boundaries, and the loop target for both group sizes: ```powershell cargo test -p victory-shader --locked --lib guest_lds_dependencies_and_branches -- --nocapture ``` Result: 1 passed. Both branches are at byte 92 and target byte 64: -32 bytes from the following PC, i.e. -8 dwords (`0xBF89FFF8`). The CPU oracle is unchanged. The revised programs still reproduce both main defects and both pass the separate paired-backend control described above.
Author
Owner

@⁠carlosmegino on GitHub · 2026-11-26 22:27 UTC · original

@⁠fuzeofficlal — response to observation 4 (GBV isolation, adapter gating, serialization), addressed in 1625d1c.

Each ignored test launches a fresh copy of its test executable with --exact <its-own-name> --ignored --nocapture --test-threads=1. Only that test runs in the child, which enables the debug layer and GPU-based validation before its first Host/device. The parent holds the existing valu_tests::ONE_AT_A_TIME mutex for the child's entire lifetime. Child launch errors, nonzero exit codes, and crashes fail the parent test.

The child inherits VICTORY_WARP; device creation and feature-query errors remain failures. Only unsupported wave capabilities produce an explicit SKIP. Translation, validator loading/validation, PSO creation, dispatch/readback, canary mismatches, and D3D12 warnings/errors remain failures. A negative control with VICTORY_DXIL pointing to a nonexistent DLL exits 101 in both child and parent, without a skip.

Concurrent relevant-suite command (also checked with --all-features):

cargo test -p victory-shader --locked --lib -- emit::tests:: emit::wave64_group_tests:: --include-ignored --nocapture

With WARP=0: main yields 18 passed / the 2 expected regression failures; paired control yields 20 passed. With WARP=1: both yield 20 harness passes, including 2 explicitly reported capability skips. Without --include-ignored, both configurations yield 18 passed / 2 ignored.

For completeness, the full shader suite is not clean on this host: a heap-direct texture test exits with 0xC0000005, and four other synthetic tests fail under WARP. I reproduced that individual crash and all four failures on the unmodified original PR head 827057a6. They are outside these regressions; I have kept their results separate and made no unrelated fixes.

**@⁠carlosmegino** on GitHub · 2026-11-26 22:27 UTC · [original](https://github.com/Marvisak/VIctory/pull/3180#issuecomment-7204700878) @⁠fuzeofficlal — response to observation 4 (GBV isolation, adapter gating, serialization), addressed in [1625d1c](https://github.com/carlosmegino/VIctory/commit/1625d1c686adc74e986d578b47aa6364b672b8d6). Each ignored test launches a fresh copy of its test executable with `--exact <its-own-name> --ignored --nocapture --test-threads=1`. Only that test runs in the child, which enables the debug layer and GPU-based validation before its first Host/device. The parent holds the existing `valu_tests::ONE_AT_A_TIME` mutex for the child's entire lifetime. Child launch errors, nonzero exit codes, and crashes fail the parent test. The child inherits `VICTORY_WARP`; device creation and feature-query errors remain failures. Only unsupported wave capabilities produce an explicit `SKIP`. Translation, validator loading/validation, PSO creation, dispatch/readback, canary mismatches, and D3D12 warnings/errors remain failures. A negative control with `VICTORY_DXIL` pointing to a nonexistent DLL exits 101 in both child and parent, without a skip. Concurrent relevant-suite command (also checked with `--all-features`): ```powershell cargo test -p victory-shader --locked --lib -- emit::tests:: emit::wave64_group_tests:: --include-ignored --nocapture ``` With WARP=0: main yields 18 passed / the 2 expected regression failures; paired control yields 20 passed. With WARP=1: both yield 20 harness passes, including 2 explicitly reported capability skips. Without `--include-ignored`, both configurations yield 18 passed / 2 ignored. For completeness, the full shader suite is not clean on this host: a heap-direct texture test exits with 0xC0000005, and four other synthetic tests fail under WARP. I reproduced that individual crash and all four failures on the unmodified original PR head `827057a6`. They are outside these regressions; I have kept their results separate and made no unrelated fixes.
Author
Owner

@⁠carlosmegino on GitHub · 2026-11-26 22:27 UTC · original

@⁠kilolimaVI — addressed your adapter-capability observation in 1625d1c.

The hard assertion is replaced by an explicit capability gate: execution requires WaveOps and exactly (WaveLaneCountMin, WaveLaneCountMax) == (32,32). A device reporting (32,64), like your Radeon 780M, returns with a SKIP message containing the actual capabilities and VICTORY_WARP value. It does not attempt translation or dispatch.

I verified the unsupported-device path locally with VICTORY_WARP=1: both tests explicitly print SKIP ... WaveOps=true, lanes=(4, 4), VICTORY_WARP=Some("1"), including under --include-ignored. I do not have a (32,64) AMD adapter here, so that exact hardware case is covered by the predicate rather than a claimed AMD run.

With VICTORY_WARP=0, the RTX 5070 Ti reports (32,32) and both tests execute: they retain the expected main failures and both pass the paired backend. Initialization, translation, validation and execution errors are not turned into skips.

**@⁠carlosmegino** on GitHub · 2026-11-26 22:27 UTC · [original](https://github.com/Marvisak/VIctory/pull/3180#issuecomment-7204701095) @⁠kilolimaVI — addressed your adapter-capability observation in [1625d1c](https://github.com/carlosmegino/VIctory/commit/1625d1c686adc74e986d578b47aa6364b672b8d6). The hard assertion is replaced by an explicit capability gate: execution requires WaveOps and exactly `(WaveLaneCountMin, WaveLaneCountMax) == (32,32)`. A device reporting (32,64), like your Radeon 780M, returns with a `SKIP` message containing the actual capabilities and VICTORY_WARP value. It does not attempt translation or dispatch. I verified the unsupported-device path locally with `VICTORY_WARP=1`: both tests explicitly print `SKIP ... WaveOps=true, lanes=(4, 4), VICTORY_WARP=Some("1")`, including under `--include-ignored`. I do not have a (32,64) AMD adapter here, so that exact hardware case is covered by the predicate rather than a claimed AMD run. With `VICTORY_WARP=0`, the RTX 5070 Ti reports (32,32) and both tests execute: they retain the expected main failures and both pass the paired backend. Initialization, translation, validation and execution errors are not turned into skips.
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 22:47 UTC · original · approved these changes

1625d1c6 resolves all blockers from the previous review:

  • crates/victory-shader/src/emit/mod.rs now orders bvh_tests, census_tests, and wave64_group_tests alphabetically, and rustfmt --edition 2024 --check passes cleanly on the modified host.rs and wave64_group_tests.rs files.
  • crates/victory-shader/src/emit/wave64_group_tests.rs places WAIT_LGKM (s_waitcnt lgkmcnt(0)) after DS/SMEM producers and right before s_barrier, covered by the new guest_lds_dependencies_and_branches unit test.
  • ONE_AT_A_TIME + child-process isolation (VICTORY_WAVE64_2688_CHILD) enables GPU-based validation before first device creation and cleanly skips non-exclusively-Wave32 devices (SKIP ... lanes=(4, 4) under VICTORY_WARP=1, passing 2/2).
  • Default cargo test passes 18/18 (2 ignored) on both VICTORY_WARP=0 and VICTORY_WARP=1, and --ignored on RTX 5090 (exclusively wave32) cleanly reproduces the tracked #2688 failures (128: UAV 2/3 zeroed with D3D12 warnings/errors: []; 64: rejected at PSO creation for wanting Wave64 on max wave 32).

Approving. (Non-blocking follow-up idea: host::dispatch currently lacks a fence timeout and u64::MAX device-removed diagnostic check compared to the draw path.)

**@⁠fuzeofficlal** on GitHub · 2026-11-26 22:47 UTC · [original](https://github.com/Marvisak/VIctory/pull/3180#pullrequestreview-6081236830) · **approved these changes** `1625d1c6` resolves all blockers from the previous review: - `crates/victory-shader/src/emit/mod.rs` now orders `bvh_tests`, `census_tests`, and `wave64_group_tests` alphabetically, and `rustfmt --edition 2024 --check` passes cleanly on the modified `host.rs` and `wave64_group_tests.rs` files. - `crates/victory-shader/src/emit/wave64_group_tests.rs` places `WAIT_LGKM` (`s_waitcnt lgkmcnt(0)`) after DS/SMEM producers and right before `s_barrier`, covered by the new `guest_lds_dependencies_and_branches` unit test. - `ONE_AT_A_TIME` + child-process isolation (`VICTORY_WAVE64_2688_CHILD`) enables GPU-based validation before first device creation and cleanly skips non-exclusively-Wave32 devices (`SKIP ... lanes=(4, 4)` under `VICTORY_WARP=1`, passing 2/2). - Default `cargo test` passes 18/18 (2 ignored) on both `VICTORY_WARP=0` and `VICTORY_WARP=1`, and `--ignored` on RTX 5090 (`exclusively wave32`) cleanly reproduces the tracked `#2688` failures (`128`: `UAV 2/3` zeroed with `D3D12 warnings/errors: []`; `64`: rejected at PSO creation for wanting Wave64 on max wave 32). Approving. (Non-blocking follow-up idea: `host::dispatch` currently lacks a fence timeout and `u64::MAX` device-removed diagnostic check compared to the draw path.)
Author
Owner

@⁠upipibi on GitHub · 2026-11-26 23:48 UTC · original

Independent re-run on the new head 1625d1c6 (earlier run was at 827057a; main 63bcca43 as control). RTX 3070 8 GB (Ampere, wave32 only, reports lanes (32,32)), driver 616.56, Windows 11, rustc 1.98.1, Graphics Tools and dxil.dll present.

Gating: on this (32,32) card the new gate does not skip. Both ignored tests execute (each in its own child process, "exclusively wave32, GPU-based validation enabled before first device"), and fail as the description says. No SKIP line appeared.

Ignored tests, head, one run: cargo test -p victory-shader --locked --lib wave64_2688_group -- --ignored --nocapture --test-threads=1

  • wave64_2688_group_128: UAV 2 thread 0 got 0, expected 40 (128 mismatches); UAV 3 thread 0 got 0, expected 20 (128 mismatches); UAVs 0, 1, 4, 5, 6: 0 mismatches; all 8 canaries per UAV intact; D3D12 warnings/errors: []. Child exits 101, parent panics at wave64_group_tests.rs:274.
  • wave64_2688_group_64: compute PSO "The parameter is incorrect."; debug layer: "CreateComputeShader: Shader wants wave lane count of 64 but maximum wave lane count for device is 32".
  • Result: test result: FAILED. 0 passed; 2 failed; 0 ignored.

Non-ignored, head, 3 runs of cargo test -p victory-shader --locked --lib wave64 -- --test-threads=1 --nocapture: each test result: ok. 6 passed; 0 failed; 2 ignored; 0 measured; 300 filtered out. This includes guest_lds_dependencies_and_branches (both sizes: "branch 92 -> 64 (-32 bytes from next PC), all LDS/SMEM producers waited, barrier audited"). The ignore reason now reads "known regression: fails until #2688 is fixed; requires exclusively wave32, Graphics Tools, and DXIL validator". The two existing wave64_permutes_* tests print "no pipeline for a wave of 64; skipped" and pass, as before.

Control on main 63bcca43: the same ignored command runs 0 tests (they are added by the PR). Negative control: I copied the PR's wave64_group_tests.rs and its mod line into main (without the host.rs/mod.rs changes). It compiled with 0 errors (so there is no compile-error code to report). The two ignored tests on that tree fail identically to the head: UAV 2 thread 0 0 vs 40, UAV 3 thread 0 0 vs 20 (128 mismatches each, canaries intact, no D3D12 messages), and the 64-thread PSO rejection with the same debug-layer message. So on this card the failures come from the main emitter, not from the PR's host changes.

Lib suites, cargo test -p victory-shader --locked --lib -- --test-threads=1: on both trees the process aborts at emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index with 0xC0000005 STATUS_ACCESS_VIOLATION (the crash you mention; it is in main too). Re-run with --skip heap_direct_texture_reads_mark_their_heap_index, once each:

  • head: test result: FAILED. 299 passed; 3 failed; 5 ignored; 0 measured; 1 filtered out; finished in 289.69s
  • main: test result: FAILED. 298 passed; 3 failed; 3 ignored; 0 measured; 1 filtered out; finished in 356.55s
  • The same 3 fail on both trees: stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride, stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros, synthetic_tests::gathers_at_a_level_match_the_hardware. The difference (+1 passed, +2 ignored) is exactly the PR's new tests.

Changed since 827057a: the 128-thread case now also reports UAV 3 (0 vs 20) mismatches, where the earlier run listed only UAV 2 (the first mismatch); the 64-thread case is unchanged; the debug layer and GPU-based validation again reported no warnings or errors beyond the PSO one; the ignored tests now run in isolated child processes; one more non-ignored test passes (6 vs 5 in the wave64 filter). No driver resets.

Not run: a (32,64) AMD adapter, so the SKIP path for it is untested here. No game files used.

AI-assisted (Claude Code, Claude Sonnet 5.5 ran the tests; Claude Opus 5.5 checked and posted).

**@⁠upipibi** on GitHub · 2026-11-26 23:48 UTC · [original](https://github.com/Marvisak/VIctory/pull/3180#issuecomment-7205878661) Independent re-run on the new head `1625d1c6` (earlier run was at `827057a`; `main` `63bcca43` as control). RTX 3070 8 GB (Ampere, wave32 only, reports lanes (32,32)), driver 616.56, Windows 11, rustc 1.98.1, Graphics Tools and `dxil.dll` present. Gating: on this (32,32) card the new gate does not skip. Both ignored tests execute (each in its own child process, "exclusively wave32, GPU-based validation enabled before first device"), and fail as the description says. No `SKIP` line appeared. Ignored tests, head, one run: `cargo test -p victory-shader --locked --lib wave64_2688_group -- --ignored --nocapture --test-threads=1` - `wave64_2688_group_128`: UAV 2 thread 0 got 0, expected 40 (128 mismatches); UAV 3 thread 0 got 0, expected 20 (128 mismatches); UAVs 0, 1, 4, 5, 6: 0 mismatches; all 8 canaries per UAV intact; `D3D12 warnings/errors: []`. Child exits 101, parent panics at `wave64_group_tests.rs:274`. - `wave64_2688_group_64`: compute PSO "The parameter is incorrect."; debug layer: "CreateComputeShader: Shader wants wave lane count of 64 but maximum wave lane count for device is 32". - Result: `test result: FAILED. 0 passed; 2 failed; 0 ignored`. Non-ignored, head, 3 runs of `cargo test -p victory-shader --locked --lib wave64 -- --test-threads=1 --nocapture`: each `test result: ok. 6 passed; 0 failed; 2 ignored; 0 measured; 300 filtered out`. This includes `guest_lds_dependencies_and_branches` (both sizes: "branch 92 -> 64 (-32 bytes from next PC), all LDS/SMEM producers waited, barrier audited"). The ignore reason now reads "known regression: fails until #2688 is fixed; requires exclusively wave32, Graphics Tools, and DXIL validator". The two existing `wave64_permutes_*` tests print "no pipeline for a wave of 64; skipped" and pass, as before. Control on `main` `63bcca43`: the same ignored command runs 0 tests (they are added by the PR). Negative control: I copied the PR's `wave64_group_tests.rs` and its `mod` line into `main` (without the host.rs/mod.rs changes). It compiled with 0 errors (so there is no compile-error code to report). The two ignored tests on that tree fail identically to the head: UAV 2 thread 0 0 vs 40, UAV 3 thread 0 0 vs 20 (128 mismatches each, canaries intact, no D3D12 messages), and the 64-thread PSO rejection with the same debug-layer message. So on this card the failures come from the main emitter, not from the PR's host changes. Lib suites, `cargo test -p victory-shader --locked --lib -- --test-threads=1`: on both trees the process aborts at `emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index` with 0xC0000005 STATUS_ACCESS_VIOLATION (the crash you mention; it is in `main` too). Re-run with `--skip heap_direct_texture_reads_mark_their_heap_index`, once each: - head: `test result: FAILED. 299 passed; 3 failed; 5 ignored; 0 measured; 1 filtered out; finished in 289.69s` - main: `test result: FAILED. 298 passed; 3 failed; 3 ignored; 0 measured; 1 filtered out; finished in 356.55s` - The same 3 fail on both trees: `stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride`, `stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros`, `synthetic_tests::gathers_at_a_level_match_the_hardware`. The difference (+1 passed, +2 ignored) is exactly the PR's new tests. Changed since `827057a`: the 128-thread case now also reports UAV 3 (0 vs 20) mismatches, where the earlier run listed only UAV 2 (the first mismatch); the 64-thread case is unchanged; the debug layer and GPU-based validation again reported no warnings or errors beyond the PSO one; the ignored tests now run in isolated child processes; one more non-ignored test passes (6 vs 5 in the `wave64` filter). No driver resets. Not run: a (32,64) AMD adapter, so the SKIP path for it is untested here. No game files used. AI-assisted (Claude Code, Claude Sonnet 5.5 ran the tests; Claude Opus 5.5 checked and posted).
Author
Owner

@⁠Dathinel on GitHub · 2026-11-27 02:21 UTC · original

The independent-wave fixture also exposed a useful boundary on our RTX 3050 Laptop (4 GB): try 96 threads, where the second guest wave has only its lower 32 lanes. Its second election can have empty EXEC. Seeding the expected lane-0 result with 11 makes it distinguishable from cleared memory. In an instrumented control, substituting 7 for the unwritten upper slot returned 7 instead of 11 at thread 64. The same injection passed after the translator supplied zero for the missing half.

On our fork we also extended the CPU/readback comparison to 256 threads, alternating the elected half across four guest waves and keeping each wave's LDS counter separate. Both cases passed there. This was a synthetic follow-up on a different translator revision, not a rerun of this PR head. 96-thread fixture · Four-wave fixture

Thanks for documenting the explicit guest LDS waits and the isolated validation process in the updated fixture. AI-assisted hardware investigation.

**@⁠Dathinel** on GitHub · 2026-11-27 02:21 UTC · [original](https://github.com/Marvisak/VIctory/pull/3180#issuecomment-7208053720) The independent-wave fixture also exposed a useful boundary on our RTX 3050 Laptop (4 GB): try **96 threads**, where the second guest wave has only its lower 32 lanes. Its second election can have empty EXEC. Seeding the expected lane-0 result with 11 makes it distinguishable from cleared memory. In an instrumented control, substituting 7 for the unwritten upper slot returned 7 instead of 11 at thread 64. The same injection passed after the translator supplied zero for the missing half. On our fork we also extended the CPU/readback comparison to **256 threads**, alternating the elected half across four guest waves and keeping each wave's LDS counter separate. Both cases passed there. This was a synthetic follow-up on a different translator revision, not a rerun of this PR head. [96-thread fixture](https://github.com/Dathinel/victory-4gb/commit/561503d) · [Four-wave fixture](https://github.com/Dathinel/victory-4gb/commit/6622a0c) Thanks for documenting the explicit guest LDS waits and the isolated validation process in the updated fixture. AI-assisted hardware investigation.
This pull request can be merged automatically.
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/3180/head:github-bot/gh-3180'
git switch 'github-bot/gh-3180'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3180'
git switch 'github-bot/gh-3180'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3180'
git switch 'github-bot/gh-3180'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3180'
git switch 'main'
git merge --squash 'github-bot/gh-3180'
git switch 'main'
git merge --ff-only 'github-bot/gh-3180'
git switch 'main'
git merge 'github-bot/gh-3180'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!3180
No description provided.