Tests: compare descriptor bytes only where copies are byte copies (views_are_made_beside_the_heap_and_copied_in fails on RDNA 2) #299

Closed
compaccount1-coder wants to merge 1 commit from upstream-pr/299 into main
compaccount1-coder commented 2026-11-26 15:02:18 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by compaccount1-coder on 2026-11-26T15:02:18Z.


What and why

descriptor::host::tests::views_are_made_beside_the_heap_and_copied_in fails on every run on AMD RDNA 2 under Windows (RX 6700 XT, and the Ryzen 7000 integrated graphics; driver 32.0.21045, Windows 11), in both test jobs:

assertion `left == right` failed: copied as it was made
  left: Some([128, 0, 196, 42, 36, 2, 0, 0, 128, 0, 196, 34, 36, 2, 0, 0, 144, 180, 157, 13, 36, 2, 0, 0, 128, 0, 0, 0, 0, 0, 0, 0])
 right: Some([32, 148, 173, 13, 36, 2, 0, 0, 32, 148, 177, 13, 36, 2, 0, 0, 144, 180, 157, 13, 36, 2, 0, 0, 128, 0, 0, 0, 0, 0, 0, 0])

On that driver, what a CPU descriptor handle points at is not the view's bytes:

  • the buffer's GPU address (0x3019c0000 + 64 in one run) is nowhere in them;
  • the same view made in three slots of the shader-visible heap (by CreateShaderResourceView there, and by CopyDescriptorsSimple from the staged slot) gives three different byte strings, differing exactly by the slots' 32-byte step;
  • CopyDescriptorsSimple from the CPU-only staging heap into the shader-visible heap writes new bytes, not the staged ones.

D3D12 leaves descriptor contents opaque, so the runtime is right here (it copies with CopyDescriptorsSimple). Only the test assumed descriptor copies are byte copies. The runtime's two byte reads of descriptors are already safe: move_raw checks the address before it changes anything and backs off otherwise, and shown_bytes is diagnostics-only.

The change

Test only. Before comparing, the test copies the staged view into a second slot by hand. If that copy reads back as the staged bytes, the driver copies descriptors as bytes, and every check runs as before. If not, the two byte comparisons are left out and the test says so on stderr. The device-alive check runs in both cases.

Tested

On an RX 6700 XT (Windows 11, driver 32.0.21045):

Adapter Before After
RX 6700 XT (default, high performance) fails every run (3/3) passes, byte checks skipped
Ryzen 7000 graphics (VICTORY_D3D12_ADAPTER=1) fails passes, byte checks skipped
WARP (--all-features, VICTORY_D3D12_WARP=1) passes passes, strict checks run

So on WARP (the CI runners) the test is exactly as strict as before. Not run on an RX 7900 XTX: the strict branch is the one that should run there, as before.

Other results from this PC, for whoever looks next

  • With #169 and #241 merged onto c9c932c, cargo clippy --workspace --all-targets --locked -- -D warnings passes with and without --all-features, so those two are all clippy needs on today's main.
  • Default tests: 1,024 passed. Besides this test, 3 fail in victory-shader (first_half_values_render_on_hardware_and_warp, rectangles_are_drawn_whole, the_rectangle_stage_is_a_geometry_shader) with Container part 'Pipeline State Validation' does not match expected for module. They fail only because the newest Windows SDK on this PC is 10.0.22621, whose dxil.dll is older than the runners' 26100. The runtime does not use the validator, so I have left those alone.

AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:issue:6629433291 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/299). Originally posted by [compaccount1-coder](https://github.com/compaccount1-coder) on 2026-11-26T15:02:18Z. --- ### What and why `descriptor::host::tests::views_are_made_beside_the_heap_and_copied_in` fails on every run on AMD RDNA 2 under Windows (RX 6700 XT, and the Ryzen 7000 integrated graphics; driver 32.0.21045, Windows 11), in both test jobs: ``` assertion `left == right` failed: copied as it was made left: Some([128, 0, 196, 42, 36, 2, 0, 0, 128, 0, 196, 34, 36, 2, 0, 0, 144, 180, 157, 13, 36, 2, 0, 0, 128, 0, 0, 0, 0, 0, 0, 0]) right: Some([32, 148, 173, 13, 36, 2, 0, 0, 32, 148, 177, 13, 36, 2, 0, 0, 144, 180, 157, 13, 36, 2, 0, 0, 128, 0, 0, 0, 0, 0, 0, 0]) ``` On that driver, what a CPU descriptor handle points at is not the view's bytes: - the buffer's GPU address (`0x3019c0000` + 64 in one run) is nowhere in them; - the same view made in three slots of the shader-visible heap (by `CreateShaderResourceView` there, and by `CopyDescriptorsSimple` from the staged slot) gives three different byte strings, differing exactly by the slots' 32-byte step; - `CopyDescriptorsSimple` from the CPU-only staging heap into the shader-visible heap writes new bytes, not the staged ones. D3D12 leaves descriptor contents opaque, so the runtime is right here (it copies with `CopyDescriptorsSimple`). Only the test assumed descriptor copies are byte copies. The runtime's two byte reads of descriptors are already safe: `move_raw` checks the address before it changes anything and backs off otherwise, and `shown_bytes` is diagnostics-only. ### The change Test only. Before comparing, the test copies the staged view into a second slot by hand. If that copy reads back as the staged bytes, the driver copies descriptors as bytes, and **every check runs as before**. If not, the two byte comparisons are left out and the test says so on stderr. The device-alive check runs in both cases. ### Tested On an RX 6700 XT (Windows 11, driver 32.0.21045): | Adapter | Before | After | |---|---|---| | RX 6700 XT (default, high performance) | fails every run (3/3) | passes, byte checks skipped | | Ryzen 7000 graphics (`VICTORY_D3D12_ADAPTER=1`) | fails | passes, byte checks skipped | | WARP (`--all-features`, `VICTORY_D3D12_WARP=1`) | passes | passes, **strict checks run** | So on WARP (the CI runners) the test is exactly as strict as before. Not run on an RX 7900 XTX: the strict branch is the one that should run there, as before. ### Other results from this PC, for whoever looks next - With #169 and #241 merged onto `c9c932c`, `cargo clippy --workspace --all-targets --locked -- -D warnings` passes with and without `--all-features`, so those two are all clippy needs on today's main. - Default tests: 1,024 passed. Besides this test, 3 fail in `victory-shader` (`first_half_values_render_on_hardware_and_warp`, `rectangles_are_drawn_whole`, `the_rectangle_stage_is_a_geometry_shader`) with `Container part 'Pipeline State Validation' does not match expected for module`. They fail only because the newest Windows SDK on this PC is 10.0.22621, whose `dxil.dll` is older than the runners' 26100. The runtime does not use the validator, so I have left those alone. AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
compaccount1-coder commented 2026-11-26 15:44:58 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by compaccount1-coder on 2026-11-26T15:44:58Z.


Closing in favour of #298, which fixes the same RDNA 2 failure and keeps a real check on AMD (the copy against the view made in place at that slot) where this one only skipped the byte comparison. #298 passes on my RX 6700 XT too (confirmed there). Sorry for the duplicate: #298 did not show up in search when I looked.

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:comment:7196696928 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/299#issuecomment-7196696928). Originally posted by [compaccount1-coder](https://github.com/compaccount1-coder) on 2026-11-26T15:44:58Z. --- Closing in favour of #298, which fixes the same RDNA 2 failure and keeps a real check on AMD (the copy against the view made in place at that slot) where this one only skipped the byte comparison. #298 passes on my RX 6700 XT too (confirmed there). Sorry for the duplicate: #298 did not show up in search when I looked.

Pull request closed

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
avatarmanz/VIctory-7900XTX!299
No description provided.