Skip to content

GPU tests: the two view-heap tests say when a host caps the heap - #2937

Open
HoLa-Lee wants to merge 1 commit into
Marvisak:mainfrom
HoLa-Lee:tests/view-heap-cap-skip
Open

HoLa-Lee wants to merge 1 commit into
Marvisak:mainfrom
HoLa-Lee:tests/view-heap-cap-skip

Conversation

@HoLa-Lee

Copy link
Copy Markdown

What this fixes

Two tests fail on every NVIDIA host on every run of main, and have since 70564ae:

descriptor::host::tests::dynamic_slots_are_held_until_released
memory::tests::lists_share_a_table_and_copies_keep_their_views
  • dynamic_slots_are_held_until_released opens with the premise "every index a translated shader can reach exists (clamped below HEAP_VIEWS)" and asserts heap.NumDescriptors >= HEAP_VIEWS.
  • lists_share_a_table_and_copies_keep_their_views asserts the copies' view pairs sit "past the dynamic slots" (>= 1 << 18).

Both premises only hold on a host that takes a heap of HEAP_VIEWS (2,097,152). A host that caps shader-visible view heaps below it keeps the capped heap - HostHeap::new says so in its own comment, and D3D12 says so at creation. On the machine this was measured on (RTX 4080 SUPER, driver 616.87), with the debug layer on:

ID3D12Device::CreateDescriptorHeap: D3D12_DESCRIPTOR_HEAP_DESC.NumDescriptors 2097152,
  but the limit for shader visible view heaps is 1000000

and the heap the host ends up with is 65,540 descriptors. That is FIND-9 in the coordination thread, and it is why an NVIDIA runner shows two failures in a pull request that has nothing to do with them.

What changed

Both tests now read the heap they actually got and skip with one line naming the numbers:

host view heap capped at 65540 descriptors (HEAP_VIEWS is 2097152); skipped

That is the pattern the other host-capability tests here already use (no host mesh shader support; skipped, no host depth bounds support; skipped). On a host that takes the full heap both assertions run exactly as before, and the sampler heap's own assertion still runs everywhere (its cap is under every host's limit).

Measured

before after
cargo test -p victory-gpu --lib --profile diag --features diagnostics (RTX 4080 SUPER) 244 passed, 2 failed, 1 ignored 246 passed, 0 failed, 1 ignored
cargo clippy -p victory-gpu --all-features -- -D warnings clean clean

Two files, +28/-3: descriptor/host.rs (the check and the skip), memory.rs (the same, before the test's first use of the premise).

What this does not do

The limitation itself is untouched: on such a host, a shader's index past the capped heap is the documented shortcut in HostHeap::new ("a host that caps its heaps below HEAP_VIEWS (NVIDIA) faults on an index past them, as before the clamp"), not a clamp. Making that correct is a different piece of work from these two tests being red - and this PR deliberately does not hide a failure, it states a host capability the tests need and says so out loud, the way the mesh-shader and depth-bounds tests do.

Filed against FIND-9 in #1633 (claiming: FIND-9), where the same machine's numbers are recorded.

@kotekompotek

Copy link
Copy Markdown

Honest skips in the right place — both tests' premises only hold where the host actually builds a HEAP_VIEWS heap, and a capped host (NVIDIA tier-2, 1,000,000) takes the documented shortcut path instead. The query-then-skip shape with the reason printed is the right form for host-dependent assertions. Compatible with #2936's HEAP_VIEWS = 1,000,000 too: a capped heap of 999,424 still trips the < HEAP_VIEWS guard correctly.

@fuzeofficlal

Copy link
Copy Markdown
Contributor

Independent RTX 5090 (1M view-heap cap) + WARP verification at head 3446deb65d06 merged cleanly onto main (63bcca43c6a0):

  • Verified behavior on both backends (VICTORY_D3D12_DEBUG=1):
    • RTX 5090: descriptor::host::tests memory::tests 23/23 passed (prints host view heap capped at 65536 descriptors (HEAP_VIEWS is 2097152); skipped and 65540 ... skipped).
    • WARP (--features diagnostics): descriptor::host::tests memory::tests 23/23 passed (both tests run in full without skipping).
    • cargo xtask policy: 191 files ok; cargo clippy --locked -p victory-gpu --tests -- -D warnings (default + --features diagnostics): 0 warnings.
  • Code review feedback (crates/victory-gpu/src/descriptor/host.rs:2230-2240):
    • Skipping memory::tests::lists_share_a_table_and_copies_keep_their_views (memory.rs:975-982) makes sense on capped main heaps where pairs == total.
    • However, returning early at descriptor/host.rs:2230-2240 inside dynamic_slots_are_held_until_released also skips lines 2238-2294 on NVIDIA — which test the sampler heap size (samplers >= HEAP_SAMPLERS), release_retired() COM refcount release (2244-2285), and heap.dynamic non-wrapping allocation (2286-2294). All three only need MIN_DYNAMIC (65,536) and run cleanly on a 65,540-slot RTX 5090 heap.
    • Suggest skipping only the views >= HEAP_VIEWS assertion (rather than returning out of the entire test) so NVIDIA keeps regression coverage for lines 2238-2294. (Also note #2461 resolves the underlying 1M heap cap directly if merged.)

@Dukestar69 Dukestar69 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested merged onto origin/main (63bcca4) on Windows 11 x64 (NVIDIA GeForce RTX 5090 + WARP):

  • cargo test -p victory-gpu --lib descriptor::host::tests::dynamic_slots_are_held_until_released: 1 passed (prints host view heap capped at 65540 descriptors (HEAP_VIEWS is 2097152); skipped on RTX 5090 instead of failing with #1744).
  • cargo test -p victory-gpu --lib memory::tests::lists_share_a_table_and_copies_keep_their_views: 1 passed (prints host view heap capped at 65536 descriptors (HEAP_VIEWS is 2097152); skipped on RTX 5090).
  • cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.
  • cargo xtask policy: 191 files ok.

Cleanly turns the two known NVIDIA 1M view-heap cap false failures into explicit, informative skips.

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

@fyernald fyernald left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One interaction to know about: #2461 (triaged as a merge candidate) fixes the cause of these two failures. With it, a capped host gets a view heap at its cap, and shaders clamp to that cap. Both tests then run and pass on a capped card.

Checked on an RTX 3080 (617.42, 1,000,000-view cap), Windows 10, main 63bcca4:

  • #2461 alone: dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views and #2461's capped_view_heap_preserves_title_slots_and_reserves_nulls all pass. The heap is 1,000,000 views.
  • #2461 + this PR: they conflict in descriptor/host.rs, because #2461 turns that assertion into >= view_heap_limit(). The memory.rs change merges cleanly, and then skips a test that passes:
    host view heap capped at 1000000 descriptors (HEAP_VIEWS is 2097152); skipped
    

So if #2461 lands, this should be dropped, or compare against view_heap_limit() rather than HEAP_VIEWS. Otherwise, on NVIDIA it turns two now-passing tests into skips. If #2461 doesn't land, the skip is an honest stopgap.

Marvisak commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

Automated triage for the maintainers.

Merge candidate. Thanks, 95aeee6 does what was asked. In descriptor::host::tests::dynamic_slots_are_held_until_released, only the views >= HEAP_VIEWS assertion is now skipped when the host caps the view heap. The sampler-heap assertion, the make_null/release_retired check and the non-wrapping heap.dynamic checks run on every host. memory::tests::lists_share_a_table_and_copies_keep_their_views keeps its skip, since its premise cannot hold on a capped heap. The change is test-only. A small nit: the assert! in the else branch is always true and could go.

CI: not run on this head.


Generated by Claude Code

HoLa-Lee pushed a commit to HoLa-Lee/victory-wave-wide-barriers that referenced this pull request Nov 26, 2026
Marvisak#2937's review: the early return skipped the sampler-heap assertion and the
retired-slot release checks too, none of which need a full heap. Now the test
reads the heap it got, says so when it is capped, and skips only the assertion
that every shader index exists; everything after it runs on either host.
@HoLa-Lee
HoLa-Lee force-pushed the tests/view-heap-cap-skip branch from 3446deb to 95aeee6 Compare November 26, 2026 05:51
@HoLa-Lee

Copy link
Copy Markdown
Author

Fixed in 95aeee6 - and you were right, the description was wrong about the sampler assertion: the early return skipped it.

dynamic_slots_are_held_until_released now reads the heap it got, prints when it is capped, and skips only the assertion that every shader index exists:

host view heap capped at 65540 descriptors (HEAP_VIEWS is 2097152): the assertion that every shader index exists is skipped

Everything after that block runs on either host: the sampler-heap assertion, make_null / release_retired's retired-slot release, and the non-wrapping heap.dynamic checks. memory::tests::lists_share_a_table_and_copies_keep_their_views keeps its skip - as you say, its premise (none takes a per-draw dynamic slot) cannot hold on a capped host at all.

The comment now also names #2461, so a reader knows the cap is meant to go rather than being a fixture of the design.

cargo test -p victory-gpu --lib --profile diag --features diagnostics
246 passed, 0 failed, 1 ignored      (RTX 4080 SUPER; the two failures the PR existed for are gone)

@fuzeofficlal fuzeofficlal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed and verified at head 95aeee69 against origin/main (63bcca43) on Windows 11 across both an NVIDIA RTX 5090 (1,000,000 shader-visible view-heap cap) and WARP (uncapped 2,097,152 view heap) with VICTORY_D3D12_DEBUG=1:

  • Design & correctness:
    • crates/victory-gpu/src/descriptor/host.rs:2231-2242 (dynamic_slots_are_held_until_released) now skips only the views >= HEAP_VIEWS assertion on capped hosts while still executing the sampler-heap assertion, make_null/release_retired COM refcount checks, and non-wrapping heap.dynamic checks (so regressions in HostHeap::new sizing below MIN_DYNAMIC or slot lifetime remain caught on NVIDIA).
    • crates/victory-gpu/src/memory.rs:975-982 (lists_share_a_table_and_copies_keep_their_views) skips cleanly with the actual descriptor count when slots < HEAP_VIEWS, where HostHeap::new(false, 0) falls back to 65,536 slots and copy views cannot sit past 1 << 18.
    • Non-blocking notes: the else { assert!(views >= victory_shader::emit::HEAP_VIEWS); } branch (descriptor/host.rs:2238-2240) is trivially true and can be omitted; also note for maintainers that if #2461 lands (sizing capped hosts to view_heap_limit() = 1,000,000 so both tests pass), memory.rs:976 would need to compare against view_heap_limit() rather than HEAP_VIEWS (or this stopgap can be dropped in favor of #2461).
  • Verification:
    • Clean git merge-tree against origin/main (63bcca43); cargo xtask policy (191 files ok); cargo clippy -p victory-gpu --all-targets -- -D warnings clean with default features and --all-features.
    • RTX 5090 (default & --features diagnostics + VICTORY_D3D12_DEBUG=1): descriptor::host::tests 15/15 passed (dynamic_slots_are_held_until_released prints host view heap capped at 65540 descriptors (HEAP_VIEWS is 2097152): the assertion that every shader index exists is skipped and runs all remaining assertions) and memory::tests 8/8 passed (lists_share_a_table_and_copies_keep_their_views prints host view heap capped at 65536 descriptors (HEAP_VIEWS is 2097152); skipped).
    • WARP (VICTORY_D3D12_WARP=1, --features diagnostics + VICTORY_D3D12_DEBUG=1): both tests pass in full with zero skip output; descriptor::host::tests 15/15 and memory::tests 8/8 passed.

LGTM.

Marvisak#2937's review: the early return skipped the sampler-heap assertion and the
retired-slot release checks too, none of which need a full heap. The test now
reads the heap it got, says so when it is capped, and skips only the assertion
that every shader index exists; everything after it runs on either host.

Amended: the �ssert! in the else branch was always true and is gone.
@HoLa-Lee
HoLa-Lee force-pushed the tests/view-heap-cap-skip branch from 95aeee6 to 935836f Compare November 26, 2026 12:17
@HoLa-Lee

Copy link
Copy Markdown
Author

Nit taken (935836f): the �ssert! in the else branch was always true - �iews < HEAP_VIEWS is the whole condition - so it is gone, and the capped case is a plain if that prints the numbers. Nothing else changed:

nhost view heap capped at 65540 descriptors (HEAP_VIEWS is 2097152): the assertion that every shader index exists is skipped n
246 passed / 0 failed / 1 ignored on an RTX 4080 SUPER, and thanks for reading it closely enough to catch a tautology.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants