Test: views_are_made_beside_the_heap_and_copied_in fails on AMD (RDNA 2): descriptor bytes are the driver's own (port of avatarmanz#298) #288

Manually merged
github merged 1 commit from github-bot/gh-288 into a-publier 2026-11-27 00:57:56 +00:00 AGit
Owner

@⁠lerapeurdu62280-debug on GitHub · 2026-11-26 19:12 UTC · original
lerapeurdu62280-debug:fix/view-copy-test-amd → a-publier · +26 −3 · 1 files · 1 commits · merged 2026-11-26 22:30 UTC

Port of avatarmanz/VIctory-7900XTX#298 onto a-publier, which has the same test. It also fails on the RX 6700 XT (RDNA 2) according to the hardware run in avatarmanz/VIctory-7900XTX#280.

What and why

descriptor::host::tests::views_are_made_beside_the_heap_and_copied_in fails on main on an RX 6600 (RDNA 2), every run, on both test jobs' feature sets. It passes on the CI because the CI runs on WARP.

The test compares the 32 bytes of a slot in the shader-visible heap with the bytes staged() made beside it. Descriptor bytes are the driver's own:

  • AMD (RX 6600, Adrenalin 32.0.21045): a CopyDescriptors into the shader-visible heap changes them. They hold addresses that name the slot they are in: the same view made in place in the next slot differs by exactly the 32-byte increment. The first 32 bytes also do not change when the slot gets another view, so the old assert_ne! ("another view since") cannot hold there either.
  • WARP: they point to an object allocated at each Create*View, so a copy keeps the bytes made beside the heap, but the same view made again in place has new ones.

So no single byte comparison holds on both. The test now accepts either legitimate form: a copy must hold the bytes made beside the heap (WARP, presumably NVIDIA, which is what the test checked so far), or those of the same view made in place at that slot (AMD). This is checked for the raw view and for the null view after it. Test-only change; the runtime is untouched.

Tested

RX 6600 WARP (--features diagnostics, VICTORY_D3D12_WARP=1)
main fails (copied as it was made) passes
this PR passes 3/3 (+5/5 without diagnostics) passes 3/3
this PR, VICTORY_VIEW_COPY=0 (made in place) passes —
this PR with HostHeap::put made a no-op (sanity check that it still catches a missing copy) fails fails

Clippy -D warnings (default and --all-features) is clean once avatarmanz/VIctory-7900XTXavatarmanz/VIctory-7900XTX#241's one-line fix is applied.

Not tested on NVIDIA.

AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

Also fixes the one failure reported in #304, on an RX 580 (Polaris, AMD's legacy driver): verified there by @⁠WellyngtonSantos, 3/3 with this PR, 5/5 failing without it.

On a-publier (cd8dfc0)

Cherry-picked without conflict. On the RX 6600 the test passes with this PR and fails without it. Clippy reports the same warnings with and without it (none in descriptor/host.rs).

**@⁠lerapeurdu62280-debug** on GitHub · 2026-11-26 19:12 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/288) `lerapeurdu62280-debug:fix/view-copy-test-amd` → `a-publier` · +26 −3 · 1 files · 1 commits · merged 2026-11-26 22:30 UTC Port of avatarmanz/VIctory-7900XTX#298 onto `a-publier`, which has the same test. It also fails on the RX 6700 XT (RDNA 2) according to the hardware run in avatarmanz/VIctory-7900XTX#280. ### What and why `descriptor::host::tests::views_are_made_beside_the_heap_and_copied_in` fails on `main` on an RX 6600 (RDNA 2), every run, on both test jobs' feature sets. It passes on the CI because the CI runs on WARP. The test compares the 32 bytes of a slot in the shader-visible heap with the bytes `staged()` made beside it. Descriptor bytes are the driver's own: - **AMD (RX 6600, Adrenalin 32.0.21045):** a `CopyDescriptors` into the shader-visible heap changes them. They hold addresses that name the slot they are in: the same view made in place in the next slot differs by exactly the 32-byte increment. The first 32 bytes also do not change when the slot gets another view, so the old `assert_ne!` ("another view since") cannot hold there either. - **WARP:** they point to an object allocated at each `Create*View`, so a copy keeps the bytes made beside the heap, but the same view made again in place has new ones. So no single byte comparison holds on both. The test now accepts either legitimate form: a copy must hold the bytes made beside the heap (WARP, presumably NVIDIA, which is what the test checked so far), or those of the same view made in place at that slot (AMD). This is checked for the raw view and for the null view after it. Test-only change; the runtime is untouched. ### Tested | | RX 6600 | WARP (`--features diagnostics`, `VICTORY_D3D12_WARP=1`) | |---|---|---| | `main` | fails (`copied as it was made`) | passes | | this PR | passes 3/3 (+5/5 without diagnostics) | passes 3/3 | | this PR, `VICTORY_VIEW_COPY=0` (made in place) | passes | — | | this PR with `HostHeap::put` made a no-op (sanity check that it still catches a missing copy) | **fails** | **fails** | Clippy `-D warnings` (default and `--all-features`) is clean once avatarmanz/VIctory-7900XTXavatarmanz/VIctory-7900XTX#241's one-line fix is applied. Not tested on NVIDIA. AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Also fixes the one failure reported in #304, on an RX 580 (Polaris, AMD's legacy driver): verified there by @⁠WellyngtonSantos, 3/3 with this PR, 5/5 failing without it. ### On `a-publier` (cd8dfc0) Cherry-picked without conflict. On the RX 6600 the test passes with this PR and fails without it. Clippy reports the same warnings with and without it (none in `descriptor/host.rs`).
views_are_made_beside_the_heap_and_copied_in failed on an AMD card (RX 6600):
it took the bytes of a slot in the heap shaders see to be those made
beside it. Descriptors are the driver's own. On AMD (RX 6600) a copy
into that heap changes them (they name the slot they are in), and the
first 32 bytes of the slot do not change for another view at all. On WARP
they point to an object made anew each time, so a view made again in
place has other bytes.

A copy now passes if it holds the bytes made beside the heap (WARP,
NVIDIA) or those of the same view made in place (AMD), for the raw view
and for the null one after it. With put() made to do nothing, the test
still fails on both the RX 6600 and WARP.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit a477ca9a7e3ab1ca1e7c96c39694a610edd0ce42)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 19:22:32 +00:00
Author
Owner

@⁠WellyngtonSantos on GitHub · 2026-11-26 19:54 UTC · original

Tested on a third driver family: RX 580 (Polaris / GCN4), AMD legacy driver 31.0.21925.1001, Windows 11 26200, at head 67ff5f33. Cross-compiled with the pinned 1.98.1 toolchain (cargo xwin test -p victory-gpu --release --target x86_64-pc-windows-msvc).

  • descriptor::host::tests::views_are_made_beside_the_heap_and_copied_in: passes, 3 runs of 3. Without this PR it fails 5 runs of 5 on this card, see #304. The bytes there show the same thing you describe: the copied descriptor differs from the staged one in its first 16 bytes.
  • whole victory_gpu lib, --test-threads=1: 387 passed, 0 failed, 34 ignored.

So the "same view made in place" comparison holds on Polaris too, not only on RDNA 2.

**@⁠WellyngtonSantos** on GitHub · 2026-11-26 19:54 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/288#issuecomment-7202085561) Tested on a third driver family: **RX 580 (Polaris / GCN4), AMD legacy driver 31.0.21925.1001**, Windows 11 26200, at head `67ff5f33`. Cross-compiled with the pinned 1.98.1 toolchain (`cargo xwin test -p victory-gpu --release --target x86_64-pc-windows-msvc`). - `descriptor::host::tests::views_are_made_beside_the_heap_and_copied_in`: **passes, 3 runs of 3**. Without this PR it fails 5 runs of 5 on this card, see #304. The bytes there show the same thing you describe: the copied descriptor differs from the staged one in its first 16 bytes. - whole `victory_gpu` lib, `--test-threads=1`: **387 passed, 0 failed, 34 ignored**. So the "same view made in place" comparison holds on Polaris too, not only on RDNA 2.
Author
Owner

@⁠lerapeurdu62280-debug on GitHub · 2026-11-26 20:05 UTC · original

Thanks @⁠WellyngtonSantos. A third driver family (Polaris on the legacy branch, besides RDNA 2 here and on the RX 6700 XT) is good to have. I've linked #304 from the description, since its one failure is this test.

**@⁠lerapeurdu62280-debug** on GitHub · 2026-11-26 20:05 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/288#issuecomment-7202291194) Thanks @⁠WellyngtonSantos. A third driver family (Polaris on the legacy branch, besides RDNA 2 here and on the RX 6700 XT) is good to have. I've linked #304 from the description, since its one failure is this test.
Author
Owner

@⁠MamaLeVrai on GitHub · 2026-11-26 20:45 UTC · original

Also on an RX 6950 XT 16 GB (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release, at 67ff5f3 (on rx9070xt/a-publier cd8dfc0): cargo test --release -p victory-gpu --lib 387 passed, 0 failed, 34 ignored. Without this PR, views_are_made_beside_the_heap_and_copied_in fails every run here: 3 of 3 on cd8dfc0, and on 4 other PR branches based on it. The bytes are as you describe: a raw view made in two slots of the card's heap differs in its first 16 bytes (addresses next to the slot), and a null view made over it leaves those bytes unchanged.

AI-assisted (Claude Code); no game data.

**@⁠MamaLeVrai** on GitHub · 2026-11-26 20:45 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/288#issuecomment-7203045534) Also on an RX 6950 XT 16 GB (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release, at `67ff5f3` (on `rx9070xt`/`a-publier` `cd8dfc0`): `cargo test --release -p victory-gpu --lib` 387 passed, 0 failed, 34 ignored. Without this PR, `views_are_made_beside_the_heap_and_copied_in` fails every run here: 3 of 3 on `cd8dfc0`, and on 4 other PR branches based on it. The bytes are as you describe: a raw view made in two slots of the card's heap differs in its first 16 bytes (addresses next to the slot), and a null view made over it leaves those bytes unchanged. AI-assisted (Claude Code); no game data.
github manually merged commit b2e0d2afab into a-publier 2026-11-27 00:57:56 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.