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
github-bot wants to merge 1 commit from github-bot/gh-299 into main AGit
Owner

@⁠compaccount1-coder on GitHub · 2026-11-26 15:02 UTC · original
compaccount1-coder:fix/descriptor-test-opaque-handles → main · +24 −3 · 1 files · 1 commits · closed without merging

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

**@⁠compaccount1-coder** on GitHub · 2026-11-26 15:02 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/299) `compaccount1-coder:fix/descriptor-test-opaque-handles` → `main` · +24 −3 · 1 files · 1 commits · closed without merging ### 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)
views_are_made_beside_the_heap_and_copied_in failed on every run on an
RX 6700 XT and on Ryzen 7000 graphics (AMD driver 32.0.21045, Windows 11):
the slot's bytes were not the staged view's. On that driver what a CPU
descriptor handle points at is the driver's own, tied to the slot (slots made
as the same view differ by the 32-byte step, and the buffer's address is
nowhere in them), and CopyDescriptorsSimple into the shader-visible heap makes
it anew. D3D12 leaves descriptor bytes opaque, so the runtime is right; only
the test assumed byte copies.

The test now makes one copy by hand first. Where it reads as the staged bytes
(WARP: the strict checks still run and pass) everything is compared as
before; elsewhere the byte checks are left out and it says so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 15:03:23 +00:00
github-bot closed this pull request 2026-11-26 15:48:49 +00:00
Author
Owner

@⁠compaccount1-coder on GitHub · 2026-11-26 15:44 UTC · original

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.

**@⁠compaccount1-coder** on GitHub · 2026-11-26 15:44 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/299#issuecomment-7196696928) 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

This discussion has been locked. Commenting is limited to contributors.
No description provided.