GPU test: the pair region is not where a capped heap puts it #3286

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

@⁠zzm1234560621-prog on GitHub · 2026-11-26 15:59 UTC · original
zzm1234560621-prog:test/memory-dynamic-slots → main · +28 −1 · 2 files · 1 commits · open

What

memory::tests::lists_share_a_table_and_copies_keep_their_views asserted that the two copies' view slots lie at >= 1 << 18, i.e. past a dynamic region of DYNAMIC. On a host that caps shader-visible heaps at 1,000,000 the heap takes MIN_DYNAMIC (1 << 16) — and its pair region ends below where it starts, so HostHeap::pair never uses it and hands out dynamic slots instead:

pairs (2, 4)   count 0   dynamic 65536   first pair slot 65536

The test then failed on an index assertion while the reads above it — the point of the test, one table shared and each list's own views kept — were all correct.

The layout the test described is not one a capped heap is required to have, so it now asserts what the design does guarantee:

  • the two copies get distinct slots (a pair per copy);
  • and, only where the pair region exists, that the slots come from it — via a #[cfg(test)] has_pair_region() next to first_pair_slot(), both of which name the boundary instead of spelling 1 << 18 out.

The read assertions are untouched.

Measured

Intel Arc (Xe-LPG, driver 32.0.101.6127), 1M cap, main 63bcca4:

before after
lists_share_a_table_and_copies_keep_their_views failed (past the dynamic slots) passes
cargo test -p victory-gpu --lib 229 passed, 2 failed 230 passed, 1 failed

The one remaining failure is descriptor::host::tests::dynamic_slots_are_held_until_released, which #3191 fixes — the two together make the suite green on a capped host.

cargo clippy -p victory-gpu --all-targets --locked -- -D warnings: clean. cargo xtask policy: 191 files ok.

Not in this PR

  • HEAP_VIEWS itself and whether a capped host should offer the larger dynamic range: that is #3178, and it is a design question, not a test one. This PR only stops a test from encoding one particular answer to it.
  • #3191's test, which asks a different thing (how much room the test should request, not where the region sits). They touch adjacent lines but different questions; if you would rather land one patch, say so and I will fold this in.

No game files. AI-assisted (Claude).

**@⁠zzm1234560621-prog** on GitHub · 2026-11-26 15:59 UTC · [original](https://github.com/Marvisak/VIctory/pull/3286) `zzm1234560621-prog:test/memory-dynamic-slots` → `main` · +28 −1 · 2 files · 1 commits · open ## What `memory::tests::lists_share_a_table_and_copies_keep_their_views` asserted that the two copies' view slots lie at `>= 1 << 18`, i.e. past a dynamic region of `DYNAMIC`. On a host that caps shader-visible heaps at 1,000,000 the heap takes `MIN_DYNAMIC` (1 << 16) — and its pair region ends below where it starts, so `HostHeap::pair` never uses it and hands out dynamic slots instead: ``` pairs (2, 4) count 0 dynamic 65536 first pair slot 65536 ``` The test then failed on an index assertion while the reads above it — the point of the test, one table shared and each list's own views kept — were all correct. The layout the test described is not one a capped heap is required to have, so it now asserts what the design does guarantee: - the two copies get distinct slots (`a pair per copy`); - and, **only where the pair region exists**, that the slots come from it — via a `#[cfg(test)]` `has_pair_region()` next to `first_pair_slot()`, both of which name the boundary instead of spelling `1 << 18` out. The read assertions are untouched. ## Measured Intel Arc (Xe-LPG, driver 32.0.101.6127), 1M cap, `main` `63bcca4`: | | before | after | |---|---|---| | `lists_share_a_table_and_copies_keep_their_views` | failed (`past the dynamic slots`) | **passes** | | `cargo test -p victory-gpu --lib` | 229 passed, 2 failed | **230 passed, 1 failed** | The one remaining failure is `descriptor::host::tests::dynamic_slots_are_held_until_released`, which **#3191** fixes — the two together make the suite green on a capped host. `cargo clippy -p victory-gpu --all-targets --locked -- -D warnings`: clean. `cargo xtask policy`: 191 files ok. ## Not in this PR - `HEAP_VIEWS` itself and whether a capped host should offer the larger dynamic range: that is #3178, and it is a design question, not a test one. This PR only stops a test from encoding one particular answer to it. - #3191's test, which asks a different thing (how much room the test should request, not where the region sits). They touch adjacent lines but different questions; if you would rather land one patch, say so and I will fold this in. _No game files. AI-assisted (Claude)._
`memory::tests::lists_share_a_table_and_copies_keep_their_views` asserted
that the two copies' view slots lie at `>= 1 << 18` — past a dynamic region
of `DYNAMIC`. On a host that caps shader-visible heaps at 1,000,000 the heap
takes `MIN_DYNAMIC` (1 << 16) and, worse, its pair region ends below where it
starts, so `HostHeap::pair` falls back to dynamic slots:

  pairs (2, 4), count 0, dynamic 65536, first pair slot 65536

The test then failed at an index assertion while the reads above it — the
whole point, one table shared and each list's own views kept — were correct.

The layout the test described is not one a capped heap is required to have,
so it now asserts what the design does guarantee:

- the two copies get distinct slots (`a pair per copy`);
- and, **only where the pair region exists** (`has_pair_region`, a `#[cfg(test)]`
  helper next to `first_pair_slot`), that they come from it.

The read assertions are untouched.

Intel Arc (Xe-LPG, 1M cap): `lists_share_a_table_and_copies_keep_their_views`
goes from failing to passing; `cargo test -p victory-gpu --lib` is 231 passed,
1 failed, 1 ignored, the failure being
`descriptor::host::tests::dynamic_slots_are_held_until_released`, which #3191
fixes — the two together make the suite green on a capped host. They touch
different questions (how much room the test asks for, and where the region
sits), so I kept them apart; happy to fold this into #3191 if you would rather
land one.

cargo clippy -p victory-gpu --all-targets --locked -- -D warnings: clean.
cargo xtask policy: 191 files ok.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 16:04:21 +00:00
Author
Owner

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

Reviewed the diff and verified locally on Windows 11 x64 (RTX 5090 + WARP):

  • Checking views.has_pair_region() and asserting >= views.first_pair_slot() when present (instead of hardcoding 1 << 18) cleanly fixes lists_share_a_table_and_copies_keep_their_views on 1M-capped NVIDIA heaps while keeping the pair-region assertion intact on uncapped heaps.
  • cargo test -p victory-gpu --lib memory::tests::lists_share_a_table_and_copies_keep_their_views -- --test-threads=1 (RTX 5090): 1 passed, 0 failed.
  • VICTORY_FORCE_WARP=1 cargo test -p victory-gpu --lib memory::tests::lists_share_a_table_and_copies_keep_their_views -- --test-threads=1 (WARP): 1 passed, 0 failed.
  • cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.
  • cargo xtask policy: 191 files ok.

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

**@⁠Dukestar69** on GitHub · 2026-11-26 16:10 UTC · [original](https://github.com/Marvisak/VIctory/pull/3286#pullrequestreview-6077305554) · **approved these changes** Reviewed the diff and verified locally on Windows 11 x64 (RTX 5090 + WARP): - Checking `views.has_pair_region()` and asserting `>= views.first_pair_slot()` when present (instead of hardcoding `1 << 18`) cleanly fixes `lists_share_a_table_and_copies_keep_their_views` on 1M-capped NVIDIA heaps while keeping the pair-region assertion intact on uncapped heaps. - `cargo test -p victory-gpu --lib memory::tests::lists_share_a_table_and_copies_keep_their_views -- --test-threads=1` (RTX 5090): 1 passed, 0 failed. - `VICTORY_FORCE_WARP=1 cargo test -p victory-gpu --lib memory::tests::lists_share_a_table_and_copies_keep_their_views -- --test-threads=1` (WARP): 1 passed, 0 failed. - `cargo clippy -p victory-gpu --all-targets -- -D warnings`: clean. - `cargo xtask policy`: 191 files ok. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Author
Owner

@⁠oni-swr on GitHub · 2026-11-26 16:42 UTC · original

WARP verification report (test report only, no code changes)

  • PR head: b83c07d5
  • main: 63bcca43 (control); WARP software adapter forced with VICTORY_WARP=1 VICTORY_D3D12_WARP=1, --features diagnostics, d3d10warp.dll 10.0.26100.9818; dxil.dll 1.8.2502.11 (Windows Kit 10.0.26100.0, via VICTORY_DXIL). No physical GPU. Synthetic tests only, no game data.
  • Commands: cargo test -p victory-gpu --lib --features diagnostics --no-run -j 4, then the test binary with --exact memory::tests::lists_share_a_table_and_copies_keep_their_views --test-threads 1, then the whole lib suite (7 runs per side).
  • memory::tests::lists_share_a_table_and_copies_keep_their_views: passes on the PR (1 passed, 0.36 s).
  • Control: unmodified main (the PR changes the test itself, so the control is main's old test). It also passes on main under WARP: WARP's shader-visible heap is not capped to 1,000,000 descriptors, so the pair region exists and the old >= 1 << 18 assertion holds. This PR's capped-heap failure (Intel Arc, 1M cap) is therefore not reproducible here; WARP only shows that the changed test still passes when the pair region exists.
  • victory-gpu lib suite, 7 runs on each side: both have frame::tests::waits_end_on_ticks_and_count_frames failing every run (also alone, on the PR and on main; unrelated).
  • Flakes: PR run 1 had 2 extra failures (descriptor::host::tests::views_bound_while_another_slot_gets_its_texture_do_not_wait, pipeline::placed_uav_tests::placed_uav_dispatch_writes_its_texture), PR run 3 had 1 (views_bound_...); main run 7 had 1 (shadow::tests::partial_refresh_under_marked_range_updates_saved_bytes). Each passes alone on both sides, so these are parallel-run flakes unrelated to the PR.
  • Not tested: physical GPU, a capped-heap host.

AI use: Claude Code (Claude Sonnet 5.5)

**@⁠oni-swr** on GitHub · 2026-11-26 16:42 UTC · [original](https://github.com/Marvisak/VIctory/pull/3286#issuecomment-7197998305) WARP verification report (test report only, no code changes) - PR head: `b83c07d5` - main: `63bcca43` (control); WARP software adapter forced with `VICTORY_WARP=1 VICTORY_D3D12_WARP=1`, `--features diagnostics`, d3d10warp.dll 10.0.26100.9818; dxil.dll 1.8.2502.11 (Windows Kit 10.0.26100.0, via `VICTORY_DXIL`). No physical GPU. Synthetic tests only, no game data. - Commands: `cargo test -p victory-gpu --lib --features diagnostics --no-run -j 4`, then the test binary with `--exact memory::tests::lists_share_a_table_and_copies_keep_their_views --test-threads 1`, then the whole lib suite (7 runs per side). - `memory::tests::lists_share_a_table_and_copies_keep_their_views`: **passes on the PR** (1 passed, 0.36 s). - Control: unmodified main (the PR changes the test itself, so the control is main's old test). It **also passes on main** under WARP: WARP's shader-visible heap is not capped to 1,000,000 descriptors, so the pair region exists and the old `>= 1 << 18` assertion holds. This PR's capped-heap failure (Intel Arc, 1M cap) is therefore **not reproducible here**; WARP only shows that the changed test still passes when the pair region exists. - `victory-gpu` lib suite, 7 runs on each side: both have `frame::tests::waits_end_on_ticks_and_count_frames` failing every run (also alone, on the PR and on main; unrelated). - Flakes: PR run 1 had 2 extra failures (`descriptor::host::tests::views_bound_while_another_slot_gets_its_texture_do_not_wait`, `pipeline::placed_uav_tests::placed_uav_dispatch_writes_its_texture`), PR run 3 had 1 (`views_bound_...`); main run 7 had 1 (`shadow::tests::partial_refresh_under_marked_range_updates_saved_bytes`). Each passes alone on both sides, so these are parallel-run flakes unrelated to the PR. - Not tested: physical GPU, a capped-heap host. AI use: Claude Code (Claude Sonnet 5.5)
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/3286/head:github-bot/gh-3286'
git switch 'github-bot/gh-3286'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3286'
git switch 'github-bot/gh-3286'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3286'
git switch 'github-bot/gh-3286'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3286'
git switch 'main'
git merge --squash 'github-bot/gh-3286'
git switch 'main'
git merge --ff-only 'github-bot/gh-3286'
git switch 'main'
git merge 'github-bot/gh-3286'
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!3286
No description provided.