Shader tests: 64-bit image atomics skip devices without typed 64-bit heap atomics #1855

Open
Ingenioeren wants to merge 1 commit from upstream-pr/1857 into main
Ingenioeren commented 2026-11-24 23:31:34 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Ingenioeren on 2026-11-24T23:31:34Z.


What

emit::valu_tests::image_atomics_of_64_bits now skips a device that can't run 64-bit atomics on typed heap resources, the same way it already skips a device without SM 6.6. The new Host::heap_atomics64 in the shader test host runs the same query as victory-gpu's heap_atomics64: OPTIONS9.AtomicInt64OnTypedResourceSupported and OPTIONS11.AtomicInt64OnDescriptorHeapResourceSupported.

Why

On the Intel UHD (Xe-LP) in #1829 the test panics with hardware: The parameter is incorrect., and the debug layer says Shader uses atomic int64 on typed resources, but the device does not support this. The device simply lacks the feature, so this isn't a translation bug. The runtime already checks for the feature before it uses these atomics, and now the test checks too.

Refs #1829. That issue lists 8 failures and this handles one of them (the 64-bit atomics feature skip). The wave-lane-count skip, the view-heap cap (#1779/#1848), the v_mad_f32 signed zeros, the BVH ULP and the FSPX dot product (#1790) are not touched here, so this PR shouldn't close the issue.

How tested

Windows 11, AMD Radeon RX 6750 XT plus WARP, Rust stable MSVC:

  • cargo test --locked -p victory-shader --lib image_atomics_of_64_bits -- --nocapture: 1 passed. No skip line was printed, so both the hardware device and WARP report the feature and still run the full check.
  • cargo test --locked -p victory-shader: 207 passed, 2 failed, 2 ignored. The two failures are emit::rect::tests::rectangles_get_their_fourth_corner and emit::tests::elements_sharing_a_row_keep_their_order (dxil.dll: "Container part 'Pipeline State Validation' does not match expected"). Unmodified main (70564ae) on this machine fails the same two in the same way, so they come from the local dxil.dll and not from this change.
  • cargo clippy --locked -p victory-shader --all-targets -- -D warnings: clean.
  • cargo fmt --check: no diffs in the lines this PR touches.
  • cargo run -p xtask -- policy --staged: 2 files ok.

Not tested: the skip path itself. Both devices here support the feature, so I couldn't watch the test skip on a device without it. That needs a device like the Intel UHD from #1829.

Outside data point (thanks @kais7654): on an RTX 5070 Laptop GPU with driver 616.87, OPTIONS9.AtomicInt64OnTypedResourceSupported reports FALSE and the unpatched test fails PSO creation with E_INVALIDARG, while an RTX 3070 on 616.56 passes. So the gate matters on NVIDIA hardware too, not only on the Intel UHD.

AI assistance: prepared with Claude Code, reviewed by Ingenioeren.

🤖 Generated with Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:issue:5482124540 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1857). Originally posted by [Ingenioeren](https://github.com/Ingenioeren) on 2026-11-24T23:31:34Z. --- ## What `emit::valu_tests::image_atomics_of_64_bits` now skips a device that can't run 64-bit atomics on typed heap resources, the same way it already skips a device without SM 6.6. The new `Host::heap_atomics64` in the shader test host runs the same query as `victory-gpu`'s `heap_atomics64`: `OPTIONS9.AtomicInt64OnTypedResourceSupported` and `OPTIONS11.AtomicInt64OnDescriptorHeapResourceSupported`. ## Why On the Intel UHD (Xe-LP) in #1829 the test panics with `hardware: The parameter is incorrect.`, and the debug layer says `Shader uses atomic int64 on typed resources, but the device does not support this`. The device simply lacks the feature, so this isn't a translation bug. The runtime already checks for the feature before it uses these atomics, and now the test checks too. Refs #1829. That issue lists 8 failures and this handles one of them (the 64-bit atomics feature skip). The wave-lane-count skip, the view-heap cap (#1779/#1848), the `v_mad_f32` signed zeros, the BVH ULP and the FSPX dot product (#1790) are not touched here, so this PR shouldn't close the issue. ## How tested Windows 11, AMD Radeon RX 6750 XT plus WARP, Rust stable MSVC: - `cargo test --locked -p victory-shader --lib image_atomics_of_64_bits -- --nocapture`: 1 passed. No skip line was printed, so both the hardware device and WARP report the feature and still run the full check. - `cargo test --locked -p victory-shader`: 207 passed, 2 failed, 2 ignored. The two failures are `emit::rect::tests::rectangles_get_their_fourth_corner` and `emit::tests::elements_sharing_a_row_keep_their_order` (`dxil.dll`: "Container part 'Pipeline State Validation' does not match expected"). Unmodified `main` (70564ae) on this machine fails the same two in the same way, so they come from the local `dxil.dll` and not from this change. - `cargo clippy --locked -p victory-shader --all-targets -- -D warnings`: clean. - `cargo fmt --check`: no diffs in the lines this PR touches. - `cargo run -p xtask -- policy --staged`: 2 files ok. Not tested: the skip path itself. Both devices here support the feature, so I couldn't watch the test skip on a device without it. That needs a device like the Intel UHD from #1829. Outside data point (thanks @kais7654): on an RTX 5070 Laptop GPU with driver 616.87, `OPTIONS9.AtomicInt64OnTypedResourceSupported` reports FALSE and the unpatched test fails PSO creation with `E_INVALIDARG`, while an RTX 3070 on 616.56 passes. So the gate matters on NVIDIA hardware too, not only on the Intel UHD. AI assistance: prepared with Claude Code, reviewed by Ingenioeren. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
catminou4 commented 2026-11-24 23:52:19 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T23:52:19Z.

Review: APPROVED


Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (70564ae), cargo test -p victory-shader --locked → 118 passed, 0 failed. GPU execution tests are #[cfg(all(test, windows))] and run only on Windows.

64-bit image atomics skip devices without typed 64-bit atomics: test-harness capability gate — Windows-side, macOS compile green.

<!-- greyfinch-sync:Marvisak/VIctory:review:6049333960 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1857#pullrequestreview-6049333960). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T23:52:19Z. **Review:** APPROVED --- Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (70564ae), cargo test -p victory-shader --locked → 118 passed, 0 failed. GPU execution tests are #[cfg(all(test, windows))] and run only on Windows. 64-bit image atomics skip devices without typed 64-bit atomics: test-harness capability gate — Windows-side, macOS compile green.
kais7654 commented 2026-11-25 00:06:52 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kais7654 on 2026-11-24T23:47:54Z.


Noted on my #1858: it now covers only the permute test's wave-lane skip (with a Host::wave_lanes() query on OPTIONS1) and leaves the atomics test to this PR — yours also checks OPTIONS11's heap-resource variant, which the test-only Host here doesn't. Together the two close the "known refusal" failures of #1829.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7147805965 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1857#issuecomment-7147805965). Originally posted by [kais7654](https://github.com/kais7654) on 2026-11-24T23:47:54Z. --- Noted on my #1858: it now covers only the permute test's wave-lane skip (with a Host::wave_lanes() query on OPTIONS1) and leaves the atomics test to this PR — yours also checks OPTIONS11's heap-resource variant, which the test-only Host here doesn't. Together the two close the "known refusal" failures of #1829.
kais7654 commented 2026-11-25 01:08:18 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kais7654 on 2026-11-25T00:49:50Z.


Another data point on "fails on NVIDIA": on an RTX 5070 Laptop GPU
(driver 616.87, Windows 11), CheckFeatureSupport reports
OPTIONS9.AtomicInt64OnTypedResourceSupported = FALSE, and the test's
PSO creation fails with E_INVALIDARG — so the gate is load-bearing on
that machine, and naming the driver in the description is worth it:
the RTX 3070 here passes at 616.56 while the 5070 does not at 616.87.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148923647 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1857#issuecomment-7148923647). Originally posted by [kais7654](https://github.com/kais7654) on 2026-11-25T00:49:50Z. --- Another data point on "fails on NVIDIA": on an RTX 5070 Laptop GPU (driver 616.87, Windows 11), CheckFeatureSupport reports OPTIONS9.AtomicInt64OnTypedResourceSupported = FALSE, and the test's PSO creation fails with E_INVALIDARG — so the gate is load-bearing on that machine, and naming the driver in the description is worth it: the RTX 3070 here passes at 616.56 while the 5070 does not at 616.87.
Marvisak commented 2026-11-25 08:06:37 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T07:26:01Z.


Automated triage for the maintainers.

image_atomics_of_64_bits (crates/victory-shader/src/emit/valu_tests.rs) now skips devices without 64-bit atomics on typed heap resources, as it already skips devices without SM 6.6. The new Host::heap_atomics64 (crates/victory-shader/src/emit/host.rs) runs the same OPTIONS9/OPTIONS11 query as victory-gpu's Host::heap_atomics64, which the runtime already uses to guard these atomics. That makes this a test-environment fix, not a behaviour change. The skip path itself is untested (both of the author's devices support the feature). CI: passing.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7155854306 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1857#issuecomment-7155854306). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T07:26:01Z. --- <!-- victory-triage v1 head=6758d28b6cda83ebc572f0cc833a2a62832861ed verdict=merge-candidate at=2026-11-25T07:26:01Z --> Automated triage for the maintainers. `image_atomics_of_64_bits` (`crates/victory-shader/src/emit/valu_tests.rs`) now skips devices without 64-bit atomics on typed heap resources, as it already skips devices without SM 6.6. The new `Host::heap_atomics64` (`crates/victory-shader/src/emit/host.rs`) runs the same `OPTIONS9`/`OPTIONS11` query as `victory-gpu`'s `Host::heap_atomics64`, which the runtime already uses to guard these atomics. That makes this a test-environment fix, not a behaviour change. The skip path itself is untested (both of the author's devices support the feature). CI: passing. --- _Generated by [Claude Code](https://claude.ai/code)_
sinan-cmyk commented 2026-11-25 13:02:41 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by sinan-cmyk on 2026-11-25T12:05:48Z.


Offline measurement on a retail dump

Result: no count change against main.

I merged head 6758d28b onto main 940d32f (clean merge) and ran victory translate --validate --list on shaders.rpf (1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result with main program by program (25,889 programs). Validated: 23,918 on main, 23,918 with this PR.

No program changes its failure reason. The count shows that the change rejects nothing on this data. It does not show whether the output is right.

No shader names or data are included, per the asset policy. AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7161913502 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1857#issuecomment-7161913502). Originally posted by [sinan-cmyk](https://github.com/sinan-cmyk) on 2026-11-25T12:05:48Z. --- ### Offline measurement on a retail dump **Result: no count change against `main`.** I merged head 6758d28b onto `main` 940d32f (clean merge) and ran `victory translate --validate --list` on `shaders.rpf` (1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result with `main` program by program (25,889 programs). Validated: 23,918 on `main`, 23,918 with this PR. No program changes its failure reason. The count shows that the change rejects nothing on this data. It does not show whether the output is right. No shader names or data are included, per the asset policy. AI-assisted (Claude Code).
fuzeofficlal commented 2026-11-26 19:35:48 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T19:35:48Z.

Review: APPROVED


Looks good to me — clean capability gate that matches the runtime check and lets image_atomics_of_64_bits skip adapters lacking typed descriptor-heap 64-bit atomics.

Verified locally on Windows 11 with head 6758d28b cleanly merged onto main (63bcca43):

  • Host::heap_atomics64 (crates/victory-shader/src/emit/host.rs:601-624) queries both OPTIONS9.AtomicInt64OnTypedResourceSupported and OPTIONS11.AtomicInt64OnDescriptorHeapResourceSupported, and valu_tests.rs:1977-1980 skips cleanly before pipeline creation when unsupported.
  • Formatting check (rustfmt --edition 2024 --config skip_children=true) shows no diffs on the added lines.
  • cargo run -p xtask -- policy (191 files ok) and cargo clippy --locked -p victory-shader --all-targets -- -D warnings (both default and --all-features) pass.
  • cargo test --locked -p victory-shader --lib image_atomics_of_64_bits -- --nocapture passes on both VICTORY_WARP=0 (RTX 5090, 0.30s) and VICTORY_WARP=1 (WARP, 0.03s) with no skip message printed, confirming both backends still execute the full atomic dispatch and verification.

Non-blocking note: on a system where neither the hardware adapter nor WARP reports heap_atomics64(), the test will exit green with zero dispatches (matching the existing SM 6.6 skip path right above it).

<!-- greyfinch-sync:Marvisak/VIctory:review:6079606754 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1857#pullrequestreview-6079606754). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-26T19:35:48Z. **Review:** APPROVED --- Looks good to me — clean capability gate that matches the runtime check and lets `image_atomics_of_64_bits` skip adapters lacking typed descriptor-heap 64-bit atomics. Verified locally on Windows 11 with head `6758d28b` cleanly merged onto `main` (`63bcca43`): - `Host::heap_atomics64` (`crates/victory-shader/src/emit/host.rs:601-624`) queries both `OPTIONS9.AtomicInt64OnTypedResourceSupported` and `OPTIONS11.AtomicInt64OnDescriptorHeapResourceSupported`, and `valu_tests.rs:1977-1980` skips cleanly before pipeline creation when unsupported. - Formatting check (`rustfmt --edition 2024 --config skip_children=true`) shows no diffs on the added lines. - `cargo run -p xtask -- policy` (`191 files ok`) and `cargo clippy --locked -p victory-shader --all-targets -- -D warnings` (both default and `--all-features`) pass. - `cargo test --locked -p victory-shader --lib image_atomics_of_64_bits -- --nocapture` passes on both `VICTORY_WARP=0` (RTX 5090, `0.30s`) and `VICTORY_WARP=1` (WARP, `0.03s`) with no skip message printed, confirming both backends still execute the full atomic dispatch and verification. Non-blocking note: on a system where neither the hardware adapter nor WARP reports `heap_atomics64()`, the test will exit green with zero dispatches (matching the existing SM 6.6 skip path right above it).
upipibi commented 2026-11-26 23:09:27 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-26T23:09:27Z.


Hardware run for head 6758d28b (main 63bcca4 as control): RTX 3070 8 GB (Ampere), driver 616.56, Windows 11. No game files used.

Flag values: to read the query I added one temporary eprintln! to Host::heap_atomics64, in my local worktree only (not part of this PR). The 3070 reports OPTIONS9.AtomicInt64OnTypedResourceSupported=true and OPTIONS11.AtomicInt64OnDescriptorHeapResourceSupported=true for the hardware device, and WARP reports the same. So Ampere on 616.56 reports TRUE for both, where kais7654's RTX 5070 Laptop on 616.87 reported FALSE.

cargo test --locked -p victory-shader --lib image_atomics_of_64_bits -- --nocapture --test-threads=1, 3 runs each:

  • head: 1 passed; 0 failed; 0 ignored all 3 times, with no skip line, so the full check ran on hardware and WARP.
  • main: 1 passed; 0 failed; 0 ignored all 3 times.

Not tested: the skip path, which needs a device that reports FALSE.

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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7205302647 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1857#issuecomment-7205302647). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-26T23:09:27Z. --- Hardware run for head `6758d28b` (main `63bcca4` as control): RTX 3070 8 GB (Ampere), driver 616.56, Windows 11. No game files used. **Flag values:** to read the query I added one temporary `eprintln!` to `Host::heap_atomics64`, in my local worktree only (not part of this PR). The 3070 reports `OPTIONS9.AtomicInt64OnTypedResourceSupported=true` and `OPTIONS11.AtomicInt64OnDescriptorHeapResourceSupported=true` for the hardware device, and WARP reports the same. So Ampere on 616.56 reports TRUE for both, where kais7654's RTX 5070 Laptop on 616.87 reported FALSE. `cargo test --locked -p victory-shader --lib image_atomics_of_64_bits -- --nocapture --test-threads=1`, 3 runs each: - head: `1 passed; 0 failed; 0 ignored` all 3 times, with no skip line, so the full check ran on hardware and WARP. - main: `1 passed; 0 failed; 0 ignored` all 3 times. Not tested: the skip path, which needs a device that reports FALSE. AI-assisted (Claude Code, Claude Sonnet 5.5 ran the tests; Claude Opus 5.5 checked and posted).
Dukestar69 commented 2026-11-26 23:50:19 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T23:50:19Z.

Review: APPROVED


LGTM — verified on RTX 5090 and VICTORY_WARP=1 (Windows / D3D12) against origin/main (63bcca4).

  • Checking typed 64-bit heap atomic capability before running image_atomics_of_64_bits cleanly skips unsupported adapters while continuing to run and pass on RTX 5090 and WARP.
  • cargo test -p victory-shader --lib image_atomics_of_64_bits -- --test-threads=1: passed on RTX 5090 and VICTORY_WARP=1.
  • cargo clippy -p victory-shader --all-targets -- -D warnings: clean.
  • cargo xtask policy: 191 files ok.

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

<!-- greyfinch-sync:Marvisak/VIctory:review:6081684195 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1857#pullrequestreview-6081684195). Originally posted by [Dukestar69](https://github.com/Dukestar69) on 2026-11-26T23:50:19Z. **Review:** APPROVED --- LGTM — verified on RTX 5090 and `VICTORY_WARP=1` (Windows / D3D12) against `origin/main` (`63bcca4`). - Checking typed 64-bit heap atomic capability before running `image_atomics_of_64_bits` cleanly skips unsupported adapters while continuing to run and pass on RTX 5090 and WARP. - `cargo test -p victory-shader --lib image_atomics_of_64_bits -- --test-threads=1`: passed on RTX 5090 and `VICTORY_WARP=1`. - `cargo clippy -p victory-shader --all-targets -- -D warnings`: clean. - `cargo xtask policy`: 191 files ok. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1857:upstream-pr/1857'
git switch 'upstream-pr/1857'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1857'
git switch 'upstream-pr/1857'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1857'
git switch 'upstream-pr/1857'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1857'
git switch 'main'
git merge --squash 'upstream-pr/1857'
git switch 'main'
git merge --ff-only 'upstream-pr/1857'
git switch 'main'
git merge 'upstream-pr/1857'
git push origin 'main'
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
Marvisak/VIctory!1855
No description provided.