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

Open
zzm1234560621-prog wants to merge 2 commits from upstream-pr/3203 into main
zzm1234560621-prog commented 2026-11-26 12:30:56 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by zzm1234560621-prog on 2026-11-26T12:30:56Z.


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).

<!-- greyfinch-sync:Marvisak/VIctory:issue:6626689738 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3203). Originally posted by [zzm1234560621-prog](https://github.com/zzm1234560621-prog) on 2026-11-26T12:30:56Z. --- ## 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)._
Dukestar69 commented 2026-11-26 13:04:21 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T12:49:09Z.

Review: APPROVED


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).

<!-- greyfinch-sync:Marvisak/VIctory:review:6074399330 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3203#pullrequestreview-6074399330). Originally posted by [Dukestar69](https://github.com/Dukestar69) on 2026-11-26T12:49:09Z. **Review:** APPROVED --- 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).
oni-swr commented 2026-11-26 14:01:48 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by oni-swr on 2026-11-26T13:06:52Z.


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).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7192893465 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3203#issuecomment-7192893465). Originally posted by [oni-swr](https://github.com/oni-swr) on 2026-11-26T13:06:52Z. --- **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).
zzm1234560621-prog commented 2026-11-26 14:01:55 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by zzm1234560621-prog on 2026-11-26T13:39:13Z.


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).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7193648105 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3203#issuecomment-7193648105). Originally posted by [zzm1234560621-prog](https://github.com/zzm1234560621-prog) on 2026-11-26T13:39:13Z. --- 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 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/3203:upstream-pr/3203'
git switch 'upstream-pr/3203'

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/3203'
git switch 'upstream-pr/3203'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3203'
git switch 'upstream-pr/3203'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3203'
git switch 'main'
git merge --squash 'upstream-pr/3203'
git switch 'main'
git merge --ff-only 'upstream-pr/3203'
git switch 'main'
git merge 'upstream-pr/3203'
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!3201
No description provided.