GPU test: assert the descriptor heap range a capped host can make #3191

Open
github-bot wants to merge 1 commit from github-bot/gh-3191 into main AGit
Owner

@⁠zzm1234560621-prog on GitHub · 2026-11-26 11:33 UTC · original
zzm1234560621-prog:test/heap-range → main · +13 −3 · 1 files · 1 commits · open

What

descriptor::host::tests::dynamic_slots_are_held_until_released asserted

assert!(heap.heap.GetDesc().NumDescriptors >= victory_shader::emit::HEAP_VIEWS);

with HEAP_VIEWS = 1 << 21 (2,097,152) in crates/victory-shader/src/shader.rs
and PORTABLE_VIEWS = 1_000_000 in descriptor/host.rs. HostHeap::new
first tries make((count + DYNAMIC).max(HEAP_VIEWS)); a host that caps
shader-visible view heaps below that — the NVIDIA ones the shortcut comment
in new names — falls back to count + MIN_DYNAMIC. On such a host the
assertion cannot hold, and the test fails on every run of the suite.

It now asserts the range both paths guarantee: the title's slots plus the
dynamic range the heap settled on.

let total = heap.heap.GetDesc().NumDescriptors;
assert!(total >= heap.count + heap.dynamic, …);

The sampler half (>= HEAP_SAMPLERS, 2048) is unchanged: that one is below
the cap on every device.

Why CI is green today

HostHeap::new starts with let host = host()? and returns None without a
D3D12 device, and the test returns early on None. windows-latest has no
GPU, so CI passes the test by never reaching the assertion — which is why
this has been failing only for people running the suite on real hardware.

Measured

Intel Arc iGPU (Xe-LPG, driver 32.0.101.6127), Windows 11, Rust 1.98.1,
main 63bcca4:

before after
dynamic_slots_are_held_until_released FAILED (NumDescriptors >= HEAP_VIEWS) ok
cargo test -p victory-gpu 229 passed, 2 failed, 1 ignored 230 passed, 1 failed, 1 ignored

cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.

Not in this PR

The other failure in that run, memory::tests::lists_share_a_table_and_copies_keep_their_views
(assert!(pairs.0 >= 1 << 18 && pairs.1 >= 1 << 18, "past the dynamic slots")),
is a different expectation: on this machine pair_of returns (2, 4), so the
pair slots are allotted low now and the 1 << 18 is stale in a way that is not
about the heap cap. I have not changed it — what those indices are supposed to
be is a call on the dynamic-slot layout — and reported it with these numbers in
#3178.

Test-only change; no behaviour is affected. Found while running the suite for
#967. Tested with AI assistance (Claude).

**@⁠zzm1234560621-prog** on GitHub · 2026-11-26 11:33 UTC · [original](https://github.com/Marvisak/VIctory/pull/3191) `zzm1234560621-prog:test/heap-range` → `main` · +13 −3 · 1 files · 1 commits · open ## What `descriptor::host::tests::dynamic_slots_are_held_until_released` asserted ```rust assert!(heap.heap.GetDesc().NumDescriptors >= victory_shader::emit::HEAP_VIEWS); ``` with `HEAP_VIEWS = 1 << 21` (2,097,152) in `crates/victory-shader/src/shader.rs` and `PORTABLE_VIEWS = 1_000_000` in `descriptor/host.rs`. `HostHeap::new` first tries `make((count + DYNAMIC).max(HEAP_VIEWS))`; a host that caps shader-visible view heaps below that — the NVIDIA ones the `shortcut` comment in `new` names — falls back to `count + MIN_DYNAMIC`. On such a host the assertion cannot hold, and the test fails on every run of the suite. It now asserts the range both paths guarantee: the title's slots plus the dynamic range the heap settled on. ```rust let total = heap.heap.GetDesc().NumDescriptors; assert!(total >= heap.count + heap.dynamic, …); ``` The sampler half (`>= HEAP_SAMPLERS`, 2048) is unchanged: that one is below the cap on every device. ## Why CI is green today `HostHeap::new` starts with `let host = host()?` and returns `None` without a D3D12 device, and the test returns early on `None`. `windows-latest` has no GPU, so CI passes the test by never reaching the assertion — which is why this has been failing only for people running the suite on real hardware. ## Measured Intel Arc iGPU (Xe-LPG, driver 32.0.101.6127), Windows 11, Rust 1.98.1, `main` `63bcca4`: | | before | after | |---|---|---| | `dynamic_slots_are_held_until_released` | FAILED (`NumDescriptors >= HEAP_VIEWS`) | ok | | `cargo test -p victory-gpu` | 229 passed, 2 failed, 1 ignored | 230 passed, 1 failed, 1 ignored | `cargo clippy -p victory-gpu --all-targets -- -D warnings`: clean. ## Not in this PR The other failure in that run, `memory::tests::lists_share_a_table_and_copies_keep_their_views` (`assert!(pairs.0 >= 1 << 18 && pairs.1 >= 1 << 18, "past the dynamic slots")`), is a different expectation: on this machine `pair_of` returns `(2, 4)`, so the pair slots are allotted low now and the `1 << 18` is stale in a way that is not about the heap cap. I have not changed it — what those indices are supposed to be is a call on the dynamic-slot layout — and reported it with these numbers in #3178. _Test-only change; no behaviour is affected. Found while running the suite for #967. Tested with AI assistance (Claude)._
`dynamic_slots_are_held_until_released` asserted
`GetDesc().NumDescriptors >= HEAP_VIEWS`, and `HEAP_VIEWS` is 2^21 while
`PORTABLE_VIEWS` is 10^6: a host that caps shader-visible view heaps — the
NVIDIA ones `new` names, and the Intel Arc iGPU this was found on — takes
the shorter `MIN_DYNAMIC` range instead, so the assertion fails on every
such host and would pass only on tier-3 hardware. CI does not see it
because `HostHeap::new` returns `None` without a D3D12 device and the test
returns early there.

It now asserts what `new` guarantees on both paths: the title's slots plus
the dynamic range the heap settled on.

Found while running the suite for #967. The other failure in that run,
`memory`'s `lists_share_a_table_and_copies_keep_their_views` (`>= 1 << 18`),
is a separate, older expectation about the pair slots; it is left alone and
reported in #3178.

cargo test -p victory-gpu on an Intel Arc iGPU (driver 32.0.101.6127):
230 passed, 1 failed, 1 ignored — the failure is the memory test above,
which fails on `main` too.
cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 11:39:50 +00:00
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-26 11:47 UTC · original · approved these changes

Verified on RTX 5090 (1M view-heap cap) & WARP against origin/main (63bcca4):

  • cargo test -p victory-gpu --lib descriptor::host:: -- --test-threads=1: 15/15 passed on RTX 5090 and WARP (including dynamic_slots_are_held_until_released).
  • cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.
  • cargo xtask policy: 191 files ok.

Cleanly asserts the descriptor heap range a capped host can actually allocate.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

**@⁠Dukestar69** on GitHub · 2026-11-26 11:47 UTC · [original](https://github.com/Marvisak/VIctory/pull/3191#pullrequestreview-6073603381) · **approved these changes** Verified on RTX 5090 (1M view-heap cap) & WARP against `origin/main` (`63bcca4`): - `cargo test -p victory-gpu --lib descriptor::host:: -- --test-threads=1`: **15/15 passed** on RTX 5090 and WARP (including `dynamic_slots_are_held_until_released`). - `cargo clippy -p victory-gpu --all-targets -- -D warnings`: clean. - `cargo xtask policy`: 191 files ok. Cleanly asserts the descriptor heap range a capped host can actually allocate. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/3191/head:github-bot/gh-3191'
git switch 'github-bot/gh-3191'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3191'
git switch 'github-bot/gh-3191'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3191'
git switch 'github-bot/gh-3191'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3191'
git switch 'main'
git merge --squash 'github-bot/gh-3191'
git switch 'main'
git merge --ff-only 'github-bot/gh-3191'
git switch 'main'
git merge 'github-bot/gh-3191'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!3191
No description provided.