Shader test: skip 64-bit image atomics where the format has none #3203

Open
github-bot wants to merge 2 commits from github-bot/gh-3203 into main AGit
Owner

@⁠zzm1234560621-prog on GitHub · 2026-11-26 12:30 UTC · original
zzm1234560621-prog:test/uav-atomic-gate → main · +35 −3 · 2 files · 2 commits · open

What

image_atomics_of_64_bits builds a pipeline over an R32G32_UINT typed UAV and, on an adapter without atomics for that format, the device refuses it with E_INVALIDARG:

thread 'emit::valu_tests::image_atomics_of_64_bits' panicked at valu_tests.rs:1979:
hardware: 参数错误。

That reads as a bad module. It is a capability the device does not have, and because it panics the test also never reaches its WARP half — which has the same gap:

hardware: no 64-bit typed UAV atomics (Support2 0x3c0); skipped
warp:     no 64-bit typed UAV atomics (Support2 0x3c0); skipped

Host::uav_atomic_support(format) now returns the format's D3D12_FORMAT_SUPPORT2 (or None if the query itself fails), and the test skips when the three atomics it needs — exchange, compare-swap, unsigned min/max — are absent, printing the mask so the reason is in the log rather than inferred.

0x3c0 is the typed load/store cluster with no atomic bits (0x1–0x20), so on this adapter the test genuinely cannot run. On an adapter that does offer them the test runs exactly as before — that is the RX 6700 XT / 7900 XTX path, untouched.

Measured

Intel Arc (Xe-LPG, driver 32.0.101.6127), Windows 11, Rust 1.98.1, main 63bcca4:

before after
cargo test -p victory-shader --lib 295 passed, 7 failed, 3 ignored 296 passed, 6 failed, 3 ignored
cargo clippy --workspace --all-targets --locked -- -D warnings — clean

Not in this PR

  • The other E_INVALIDARG in the same run, stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros (dispatch failed: 参数错误). That one is a dispatch rather than a pipeline, so it is a different query and a different question; it stays failing and is part of #3196.
  • The value differences in #3196 (the BVH reassociation, the signed zero, the dot product) are untouched.

Test-only change; no lowering or runtime behaviour is affected. Found by running the suite on this adapter; reported in #3196. AI-assisted (Claude).

**@⁠zzm1234560621-prog** on GitHub · 2026-11-26 12:30 UTC · [original](https://github.com/Marvisak/VIctory/pull/3203) `zzm1234560621-prog:test/uav-atomic-gate` → `main` · +35 −3 · 2 files · 2 commits · open ## What `image_atomics_of_64_bits` builds a pipeline over an `R32G32_UINT` typed UAV and, on an adapter without atomics for that format, the device refuses it with `E_INVALIDARG`: ``` thread 'emit::valu_tests::image_atomics_of_64_bits' panicked at valu_tests.rs:1979: hardware: 参数错误。 ``` That reads as a bad module. It is a capability the device does not have, and because it panics the test also never reaches its WARP half — which has the same gap: ``` hardware: no 64-bit typed UAV atomics (Support2 0x3c0); skipped warp: no 64-bit typed UAV atomics (Support2 0x3c0); skipped ``` `Host::uav_atomic_support(format)` now returns the format's `D3D12_FORMAT_SUPPORT2` (or `None` if the query itself fails), and the test skips when the three atomics it needs — exchange, compare-swap, unsigned min/max — are absent, printing the mask so the reason is in the log rather than inferred. `0x3c0` is the typed load/store cluster with **no** atomic bits (`0x1`–`0x20`), so on this adapter the test genuinely cannot run. On an adapter that does offer them the test runs exactly as before — that is the RX 6700 XT / 7900 XTX path, untouched. ## Measured Intel Arc (Xe-LPG, driver 32.0.101.6127), Windows 11, Rust 1.98.1, `main` `63bcca4`: | | before | after | |---|---|---| | `cargo test -p victory-shader --lib` | 295 passed, 7 failed, 3 ignored | **296 passed, 6 failed, 3 ignored** | | `cargo clippy --workspace --all-targets --locked -- -D warnings` | — | clean | ## Not in this PR - The other `E_INVALIDARG` in the same run, `stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros` (`dispatch failed: 参数错误`). That one is a dispatch rather than a pipeline, so it is a different query and a different question; it stays failing and is part of #3196. - The value differences in #3196 (the BVH reassociation, the signed zero, the dot product) are untouched. _Test-only change; no lowering or runtime behaviour is affected. Found by running the suite on this adapter; reported in #3196. AI-assisted (Claude)._
`image_atomics_of_64_bits` built a pipeline on an `R32G32_UINT` typed UAV
and panicked on the adapter's `E_INVALIDARG` — here on Intel Xe-LPG, and on
WARP as well, neither of which has atomics on that format. The panic reads
as a bad module rather than as a capability the device does not have, and
because it panics the test never reaches its WARP half.

`Host::uav_atomic_support` now asks `D3D12_FEATURE_FORMAT_SUPPORT` for the
format's `Support2`, and the test skips with the mask printed when the
atomics it needs (exchange, compare-swap, unsigned min/max) are absent. On
this Arc the mask is `0x3c0` — the typed load and store bits, no atomic
bits — so the test cannot run there at all; where an adapter does offer
them, it runs exactly as before.

Measured on Intel Arc (Xe-LPG, driver 32.0.101.6127), main `63bcca4`:

  cargo test -p victory-shader --lib
  296 passed, 6 failed, 3 ignored     (was 295 / 7 / 3)

cargo clippy --workspace --all-targets --locked -- -D warnings: clean.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 12:32:57 +00:00
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-26 12:49 UTC · original · approved these changes

Verified on RTX 5090 & WARP against origin/main (63bcca4):

  • cargo test -p victory-shader --lib image_atomics_of_64_bits -- --test-threads=1: passed on RTX 5090 and WARP.
  • cargo clippy -p victory-shader --all-targets -- -D warnings: clean.
  • cargo xtask policy: 191 files ok.

Cleanly checks format support before running the 64-bit image atomics test.

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

**@⁠Dukestar69** on GitHub · 2026-11-26 12:49 UTC · [original](https://github.com/Marvisak/VIctory/pull/3203#pullrequestreview-6074399330) · **approved these changes** Verified on RTX 5090 & WARP against `origin/main` (`63bcca4`): - `cargo test -p victory-shader --lib image_atomics_of_64_bits -- --test-threads=1`: passed on RTX 5090 and WARP. - `cargo clippy -p victory-shader --all-targets -- -D warnings`: clean. - `cargo xtask policy`: 191 files ok. Cleanly checks format support before running the 64-bit image atomics test. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Author
Owner

@⁠oni-swr on GitHub · 2026-11-26 13:06 UTC · original

WARP test report (claim: #1633)

  • Head: 163b9865271822fc24a29b3171840cfcc8c252fe, base: origin/main 63bcca43c6 (head sits directly on it, no merge needed)
  • Backend: WARP (VICTORY_D3D12_WARP=1). Windows 11, Rust per rust-toolchain.toml, cargo test --locked -p victory-shader --lib -- --test-threads=1, VICTORY_D3D12_WARP=1 and VICTORY_WARP=1 (the shader tests only honour the latter, so every device in the run was WARP; no physical GPU). Validator: Windows SDK 10.0.26100 dxil.dll. Synthetic word streams only, no game data.
  • victory-shader suite: 298 passed, 4 failed, 3 ignored. image_atomics_of_64_bits is reported ok but skipped: warp: no 64-bit typed UAV atomics (Support2 0x3c0); skipped, so it asserts nothing on WARP.
  • Control (main): suite 298 passed, 4 failed, 3 ignored, the same 4 failures as on the PR (a_mask_joined_with_data_at_a_uniform_loop_is_its_number, gathers_at_a_level_match_the_hardware, permutes_mask_high_address_bits_and_divergent_branches, permutes_read_the_lane_named_and_zero_from_lanes_left_out). On main, image_atomics_of_64_bits runs and passes on WARP, with every value asserted.
  • Review note: the capability query is a false negative on WARP. WARP reports no atomic bits for R32G32_UINT (0x3c0) yet executes the exchange, compare-swap and unsigned max atomics correctly (main passes). With this change WARP coverage of the test is lost, and any adapter that does the same would be skipped. If that matters, consider treating a software adapter as capable, or skipping only when pipeline creation returns E_INVALIDARG and the query says no. The change is otherwise fine: None from the query still runs the test, and the new code compiles cleanly. It adds one rustfmt diff in valu_tests.rs (the long eprintln! line); main already has many.

AI use: Claude Code (Claude Sonnet 5.5), coordinated by Claude Code (Claude Opus 5.5).

**@⁠oni-swr** on GitHub · 2026-11-26 13:06 UTC · [original](https://github.com/Marvisak/VIctory/pull/3203#issuecomment-7192893465) **WARP test report (claim: #1633)** - Head: `163b9865271822fc24a29b3171840cfcc8c252fe`, base: `origin/main` 63bcca43c6a0 (head sits directly on it, no merge needed) - Backend: WARP (VICTORY_D3D12_WARP=1). Windows 11, Rust per `rust-toolchain.toml`, `cargo test --locked -p victory-shader --lib -- --test-threads=1`, `VICTORY_D3D12_WARP=1` and `VICTORY_WARP=1` (the shader tests only honour the latter, so every device in the run was WARP; no physical GPU). Validator: Windows SDK 10.0.26100 `dxil.dll`. Synthetic word streams only, no game data. - `victory-shader` suite: **298 passed, 4 failed, 3 ignored**. `image_atomics_of_64_bits` is reported ok but **skipped**: `warp: no 64-bit typed UAV atomics (Support2 0x3c0); skipped`, so it asserts nothing on WARP. - Control (`main`): suite 298 passed, 4 failed, 3 ignored, the same 4 failures as on the PR (`a_mask_joined_with_data_at_a_uniform_loop_is_its_number`, `gathers_at_a_level_match_the_hardware`, `permutes_mask_high_address_bits_and_divergent_branches`, `permutes_read_the_lane_named_and_zero_from_lanes_left_out`). On main, `image_atomics_of_64_bits` **runs and passes on WARP**, with every value asserted. - Review note: the capability query is a false negative on WARP. WARP reports no atomic bits for `R32G32_UINT` (0x3c0) yet executes the exchange, compare-swap and unsigned max atomics correctly (main passes). With this change WARP coverage of the test is lost, and any adapter that does the same would be skipped. If that matters, consider treating a software adapter as capable, or skipping only when pipeline creation returns `E_INVALIDARG` and the query says no. The change is otherwise fine: `None` from the query still runs the test, and the new code compiles cleanly. It adds one rustfmt diff in `valu_tests.rs` (the long `eprintln!` line); `main` already has many. AI use: Claude Code (Claude Sonnet 5.5), coordinated by Claude Code (Claude Opus 5.5).
Review from oni-swr on #3203: WARP reports no atomic bits for `R32G32_UINT`
(`Support2 0x3c0`) and still runs these atomics, so asking the capability
question up front skipped a test that passes on WARP — CI coverage lost for
a check that had been asserting every value.

The question is now `D3D12_FEATURE_DATA_D3D12_OPTIONS9`'s
`AtomicInt64OnTypedResourceSupported`, which is the flag the debug layer's
message names ("Shader uses atomic int64 on typed resources, but the device
does not support this"), and it is consulted only after `compute_pipeline`
has already failed:

- an adapter with the flag clear that creates the pipeline runs the test as
  before — WARP, which passes;
- one that refuses it (Intel Xe-LPG here) skips with the reason and the
  driver's own message in the log.

Measured on Intel Arc (Xe-LPG, driver 32.0.101.6127), `63bcca4`:

  hardware: no 64-bit atomics on typed resources; skipped: 参数错误。
  VICTORY_WARP=1: runs, passes (no skip line)

cargo clippy -p victory-shader --all-targets --locked -- -D warnings: clean.
Author
Owner

@⁠zzm1234560621-prog on GitHub · 2026-11-26 13:39 UTC · original

Good catch, and you are right — that was a coverage regression, not a gate.

Reproduced and fixed in 40d9832:

  • the query is now D3D12_FEATURE_DATA_D3D12_OPTIONS9::AtomicInt64OnTypedResourceSupported, which is the flag the debug layer's message names (per the same finding in #1829: "Shader uses atomic int64 on typed resources, but the device does not support this"), rather than the format's Support2, which WARP leaves clear while still running the atomics;
  • and it is consulted only after compute_pipeline has failed, so a host that creates the pipeline runs the test exactly as before.

Verified here on the two paths that matter:

Intel Arc (Xe-LPG): hardware: no 64-bit atomics on typed resources; skipped: 参数错误。
VICTORY_WARP=1:     test result: ok (no skip line — it runs and asserts)

So WARP coverage is back, and the skip now only happens where creation actually failed and the device says it has none. The eprintln! line you flagged is reformatted.

Thanks for running it on WARP — the Support2 result there is the thing that made the difference between "queried capability" and "capability that matches what the driver will do".

AI-assisted (Claude).

**@⁠zzm1234560621-prog** on GitHub · 2026-11-26 13:39 UTC · [original](https://github.com/Marvisak/VIctory/pull/3203#issuecomment-7193648105) Good catch, and you are right — that was a coverage regression, not a gate. Reproduced and fixed in `40d9832`: - the query is now `D3D12_FEATURE_DATA_D3D12_OPTIONS9::AtomicInt64OnTypedResourceSupported`, which is the flag the debug layer's message names (per the same finding in #1829: *"Shader uses atomic int64 on typed resources, but the device does not support this"*), rather than the format's `Support2`, which WARP leaves clear while still running the atomics; - and it is consulted **only after `compute_pipeline` has failed**, so a host that creates the pipeline runs the test exactly as before. Verified here on the two paths that matter: ``` Intel Arc (Xe-LPG): hardware: no 64-bit atomics on typed resources; skipped: 参数错误。 VICTORY_WARP=1: test result: ok (no skip line — it runs and asserts) ``` So WARP coverage is back, and the skip now only happens where creation actually failed and the device says it has none. The `eprintln!` line you flagged is reformatted. Thanks for running it on WARP — the `Support2` result there is the thing that made the difference between "queried capability" and "capability that matches what the driver will do". _AI-assisted (Claude)._
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/3203/head:github-bot/gh-3203'
git switch 'github-bot/gh-3203'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3203'
git switch 'github-bot/gh-3203'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3203'
git switch 'github-bot/gh-3203'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3203'
git switch 'main'
git merge --squash 'github-bot/gh-3203'
git switch 'main'
git merge --ff-only 'github-bot/gh-3203'
git switch 'main'
git merge 'github-bot/gh-3203'
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!3203
No description provided.