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

Merged
lerapeurdu62280-debug merged 1 commit from upstream-pr/288 into a-publier 2026-11-26 22:30:23 +00:00
lerapeurdu62280-debug commented 2026-11-26 19:12:00 +00:00 (Migrated from github.com)

Imported from Belobug/VIctory-Belobug-AMD. Originally posted by lerapeurdu62280-debug on 2026-11-26T19:12:00Z.


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

<!-- greyfinch-sync:Belobug/VIctory-Belobug-AMD:issue:5515801107 --> Imported from [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD/pull/288). Originally posted by [lerapeurdu62280-debug](https://github.com/lerapeurdu62280-debug) on 2026-11-26T19:12:00Z. --- 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`).
WellyngtonSantos commented 2026-11-26 19:54:26 +00:00 (Migrated from github.com)

Imported from Belobug/VIctory-Belobug-AMD. Originally posted by WellyngtonSantos on 2026-11-26T19:54:26Z.


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.

<!-- greyfinch-sync:Belobug/VIctory-Belobug-AMD:comment:7202085561 --> Imported from [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD/pull/288#issuecomment-7202085561). Originally posted by [WellyngtonSantos](https://github.com/WellyngtonSantos) on 2026-11-26T19:54:26Z. --- 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.
lerapeurdu62280-debug commented 2026-11-26 20:05:47 +00:00 (Migrated from github.com)

Imported from Belobug/VIctory-Belobug-AMD. Originally posted by lerapeurdu62280-debug on 2026-11-26T20:05:47Z.


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.

<!-- greyfinch-sync:Belobug/VIctory-Belobug-AMD:comment:7202291194 --> Imported from [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD/pull/288#issuecomment-7202291194). Originally posted by [lerapeurdu62280-debug](https://github.com/lerapeurdu62280-debug) on 2026-11-26T20:05:47Z. --- 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.
MamaLeVrai commented 2026-11-26 20:45:42 +00:00 (Migrated from github.com)

Imported from Belobug/VIctory-Belobug-AMD. Originally posted by MamaLeVrai on 2026-11-26T20:45:42Z.


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.

<!-- greyfinch-sync:Belobug/VIctory-Belobug-AMD:comment:7203045534 --> Imported from [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD/pull/288#issuecomment-7203045534). Originally posted by [MamaLeVrai](https://github.com/MamaLeVrai) on 2026-11-26T20:45:42Z. --- 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.
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
Belobug/VIctory-Belobug-AMD!288
No description provided.