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

Open
zzm1234560621-prog wants to merge 1 commit from upstream-pr/3191 into main
zzm1234560621-prog commented 2026-11-26 11:33:47 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by zzm1234560621-prog on 2026-11-26T11:33:47Z.


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

<!-- greyfinch-sync:Marvisak/VIctory:issue:5509276452 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3191). Originally posted by [zzm1234560621-prog](https://github.com/zzm1234560621-prog) on 2026-11-26T11:33:47Z. --- ## 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)._
Dukestar69 commented 2026-11-26 11:47:21 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T11:47:21Z.

Review: APPROVED


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

<!-- greyfinch-sync:Marvisak/VIctory:review:6073603381 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3191#pullrequestreview-6073603381). Originally posted by [Dukestar69](https://github.com/Dukestar69) on 2026-11-26T11:47:21Z. **Review:** APPROVED --- 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).
Jackster commented 2026-11-26 23:02:21 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Jackster on 2026-11-26T23:02:21Z.


Windows 11, 63bcca4 + this PR, Radeon RX 7900 XTX:

  • cargo test -p victory-gpu --lib: 231 passed / 0 failed / 1 ignored — the same count as unpatched 63bcca4 (this strengthens an existing test rather than adding one).
  • cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.

Caveat: this host does not cap the view heap, so the capped-heap branch it asserts is the one a capped driver (NVIDIA's 1M limit, or WARP) would exercise; here the uncapped branch is what runs. Synthetic only. AI-assisted.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7205200189 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3191#issuecomment-7205200189). Originally posted by [Jackster](https://github.com/Jackster) on 2026-11-26T23:02:21Z. --- Windows 11, `63bcca4` + this PR, Radeon RX 7900 XTX: - `cargo test -p victory-gpu --lib`: 231 passed / 0 failed / 1 ignored — the same count as unpatched `63bcca4` (this strengthens an existing test rather than adding one). - `cargo clippy -p victory-gpu --all-targets -- -D warnings`: clean. Caveat: this host does not cap the view heap, so the capped-heap branch it asserts is the one a capped driver (NVIDIA's 1M limit, or WARP) would exercise; here the uncapped branch is what runs. Synthetic only. AI-assisted.
andrewpozdnakov7-jpg commented 2026-11-26 23:48:31 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-26T23:48:31Z.


I tested the two assertion changes together in 67577b5, using exact #3191 78524a7 and #3286 b83c07d. Both Windows WARP runs per configuration used the same synthetic data. In the forced-cap fixture I rejected descriptor allocation requests above 1,000,000 and let D3D12 create the smaller heap through the existing fallback.

Configuration Heap slots in the descriptor test Memory pair slots main Combined
Default 2,097,152 262,146 and 262,148 2/2 2/2
Forced cap 65,540 2 and 4 0/2 2/2

On capped main, the first memory readback succeeded before the old pair-index assertion fired. The combined tests also completed the second submission and retained its readback and view checks. The fork commit contains just the two PRs' test changes. Strict GPU Clippy in both configurations and the asset policy passed.

@zzm1234560621-prog, both exact heads are compatible as proposed. The combined branch is available if the maintainers prefer to take the two test fixes together.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7205878929 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3191#issuecomment-7205878929). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-26T23:48:31Z. --- I tested the two assertion changes together in [`67577b5`](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/67577b5550198c9bc6a0dc5dfadad995bb2b56a2), using exact #3191 `78524a7` and #3286 `b83c07d`. Both Windows WARP runs per configuration used the same synthetic data. In the forced-cap fixture I rejected descriptor allocation requests above 1,000,000 and let D3D12 create the smaller heap through the existing fallback. | Configuration | Heap slots in the descriptor test | Memory pair slots | `main` | Combined | | --- | ---: | --- | --- | --- | | Default | 2,097,152 | 262,146 and 262,148 | 2/2 | 2/2 | | Forced cap | 65,540 | 2 and 4 | 0/2 | 2/2 | On capped `main`, the first memory readback succeeded before the old pair-index assertion fired. The combined tests also completed the second submission and retained its readback and view checks. The fork commit contains just the two PRs' test changes. Strict GPU Clippy in both configurations and the asset policy passed. @zzm1234560621-prog, both exact heads are compatible as proposed. The combined branch is available if the maintainers prefer to take the two test fixes together.
fuzeofficlal commented 2026-11-27 01:39:38 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-27T01:39:38Z.

Review: APPROVED


Looks good. Updating the capacity assertion in dynamic_slots_are_held_until_released (crates/victory-gpu/src/descriptor/host.rs:2232) from HEAP_VIEWS to heap.count + heap.dynamic matches how capped shader-visible view heaps (such as 1M-descriptor NVIDIA adapters) are sized while keeping the bound tight on 2M adapters.

Verified on commit 78524a786676cd452f6d49f8a83b4283678560e3:

  • cargo xtask policy passed (191 files ok).
  • cargo clippy -p victory-gpu (--lib, --tests, and --features diagnostics --tests, -D warnings) passed cleanly.
  • descriptor::host::tests passed 15/15 on both an NVIDIA RTX 5090 (1M capped heap) and WARP (2M heap) with VICTORY_D3D12_DEBUG=1 and zero debug-layer errors.
<!-- greyfinch-sync:Marvisak/VIctory:review:6082346935 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3191#pullrequestreview-6082346935). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-27T01:39:38Z. **Review:** APPROVED --- Looks good. Updating the capacity assertion in `dynamic_slots_are_held_until_released` (`crates/victory-gpu/src/descriptor/host.rs:2232`) from `HEAP_VIEWS` to `heap.count + heap.dynamic` matches how capped shader-visible view heaps (such as 1M-descriptor NVIDIA adapters) are sized while keeping the bound tight on 2M adapters. Verified on commit `78524a786676cd452f6d49f8a83b4283678560e3`: - `cargo xtask policy` passed (`191 files ok`). - `cargo clippy -p victory-gpu` (`--lib`, `--tests`, and `--features diagnostics --tests`, `-D warnings`) passed cleanly. - `descriptor::host::tests` passed 15/15 on both an NVIDIA RTX 5090 (1M capped heap) and WARP (2M heap) with `VICTORY_D3D12_DEBUG=1` and zero debug-layer errors.
kalberts0089-hash commented 2026-11-27 08:14:50 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kalberts0089-hash on 2026-11-27T08:14:50Z.


NVIDIA test report: RTX 4070 Ti (desktop, driver 621.01), Windows 11 Pro, rustc 1.98.1. Head 78524a7 (base main 63bcca4).

  • cargo test -p victory-gpu --lib -- --test-threads=1: 230 passed, 1 failed, 1 ignored (main: 229 / 2 / 1). dynamic_slots_are_held_until_released fails on main here (NumDescriptors >= HEAP_VIEWS, capped 1M heap) and passes with this PR. The remaining failure is the other known capped-heap one, lists_share_a_table_and_copies_keep_their_views (memory.rs:1030, "past the dynamic slots"), which this PR doesn't touch (#3286).
  • cargo test -p victory-shader --lib --no-fail-fast, skipping heap_direct_texture_reads_mark_their_heap_index (#2571): 298 passed, 3 failed, 3 ignored, same as main. The 3 are the known NVIDIA failures (a_heap_buffer_read_by_element_takes_the_views_stride, a_heap_buffer_read_where_no_buffer_view_is_reads_zeros, gathers_at_a_level_match_the_hardware), unrelated to this PR.
  • Not tested: nothing game-side; this is a test-only change.

Synthetic tests only, no game files. AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7213314153 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3191#issuecomment-7213314153). Originally posted by [kalberts0089-hash](https://github.com/kalberts0089-hash) on 2026-11-27T08:14:50Z. --- NVIDIA test report: RTX 4070 Ti (desktop, driver 621.01), Windows 11 Pro, rustc 1.98.1. Head `78524a7` (base main `63bcca4`). - `cargo test -p victory-gpu --lib -- --test-threads=1`: 230 passed, 1 failed, 1 ignored (main: 229 / 2 / 1). `dynamic_slots_are_held_until_released` fails on main here (`NumDescriptors >= HEAP_VIEWS`, capped 1M heap) and passes with this PR. The remaining failure is the other known capped-heap one, `lists_share_a_table_and_copies_keep_their_views` (`memory.rs:1030`, "past the dynamic slots"), which this PR doesn't touch (#3286). - `cargo test -p victory-shader --lib --no-fail-fast`, skipping `heap_direct_texture_reads_mark_their_heap_index` (#2571): 298 passed, 3 failed, 3 ignored, same as main. The 3 are the known NVIDIA failures (`a_heap_buffer_read_by_element_takes_the_views_stride`, `a_heap_buffer_read_where_no_buffer_view_is_reads_zeros`, `gathers_at_a_level_match_the_hardware`), unrelated to this PR. - Not tested: nothing game-side; this is a test-only change. Synthetic tests only, no game files. AI-assisted (Claude Code).
artor410 commented 2026-11-28 08:19:19 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by artor410 on 2026-11-28T08:19:19Z.


NVIDIA Ampere check of 78524a7, merged cleanly onto main 63bcca4 (tree 78524a7). RTX 3070 Ti 8 GB (Ampere, view heap capped at 1,000,000), driver 610.88, Windows 11, rustc 1.98.1, hardware adapter. Synthetic tests only.

Command: cargo test -p victory-gpu --lib, then the two #3178 tests with --nocapture --test-threads=1.

  • main: 229 pass / 2 fail (dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views).
  • this PR: 230 pass / 1 fail. lists_share_a_table_and_copies_keep_their_views still panics at memory.rs:1030 (past the dynamic slots).

This PR changes only the first test, so it fixes half of #3178 on NVIDIA.

Side by side with #1770, #2251, #2937, #3191 and #3244 in #3178.

(Claude Code, Claude Opus 5.5.)

<!-- greyfinch-sync:Marvisak/VIctory:comment:7236506986 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3191#issuecomment-7236506986). Originally posted by [artor410](https://github.com/artor410) on 2026-11-28T08:19:19Z. --- NVIDIA Ampere check of `78524a7`, merged cleanly onto `main` `63bcca4` (tree `78524a7`). RTX 3070 Ti 8 GB (Ampere, view heap capped at 1,000,000), driver 610.88, Windows 11, rustc 1.98.1, hardware adapter. Synthetic tests only. Command: `cargo test -p victory-gpu --lib`, then the two #3178 tests with `--nocapture --test-threads=1`. - `main`: 229 pass / 2 fail (`dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views`). - this PR: 230 pass / **1 fail**. `lists_share_a_table_and_copies_keep_their_views` still panics at `memory.rs:1030` (`past the dynamic slots`). This PR changes only the first test, so it fixes half of #3178 on NVIDIA. Side by side with #1770, #2251, #2937, #3191 and #3244 in #3178. (Claude Code, Claude Opus 5.5.)
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3191:upstream-pr/3191'
git switch 'upstream-pr/3191'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3191'
git switch 'upstream-pr/3191'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3191'
git switch 'upstream-pr/3191'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3191'
git switch 'main'
git merge --squash 'upstream-pr/3191'
git switch 'main'
git merge --ff-only 'upstream-pr/3191'
git switch 'main'
git merge 'upstream-pr/3191'
git push origin 'main'
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
Marvisak/VIctory!3189
No description provided.