Check live page-table allocations on capped view heaps #2244

Closed
github-bot wants to merge 1 commit from gh-pr/2244/head into gh-pr/2244/base
Owner

@⁠gmankab on GitHub · 2026-11-25 08:38 UTC · original
gmankab:contrib/check-live-page-pairs → main · +12 −3 · 1 files · 1 commits · closed without merging

The page-table readback test assumes persistent view pairs start at or above slot 2^18. On a capped heap, the allocator can put those pairs in the smaller dynamic pool.

Keep the readback and pair-stability checks. While both pairs are live, reserve a draw-table allocation and assert that their two-slot ranges neither overlap each other nor the draw-table allocation. Also check that both pairs are outside the title slots.

The readback test passed on the default heap and with a locally forced 2^16-slot heap. FXC rejected the shader flags on this Wine setup, so I compiled the same HLSL with DXC for these runs. The DXC workaround and forced heap are local test changes.

Based-on: github.com/Marvisak/VIctory@6d021fe3df
Tested-on: AMD Radeon RX 6800, Fedora Linux 45 (Wine/vkd3d-proton, DXC test build)
Assisted-by: gpt-6.2 sol xhigh

**@⁠gmankab** on GitHub · 2026-11-25 08:38 UTC · [original](https://github.com/Marvisak/VIctory/pull/2244) `gmankab:contrib/check-live-page-pairs` → `main` · +12 −3 · 1 files · 1 commits · closed without merging The page-table readback test assumes persistent view pairs start at or above slot 2^18. On a capped heap, the allocator can put those pairs in the smaller dynamic pool. Keep the readback and pair-stability checks. While both pairs are live, reserve a draw-table allocation and assert that their two-slot ranges neither overlap each other nor the draw-table allocation. Also check that both pairs are outside the title slots. The readback test passed on the default heap and with a locally forced 2^16-slot heap. FXC rejected the shader flags on this Wine setup, so I compiled the same HLSL with DXC for these runs. The DXC workaround and forced heap are local test changes. Based-on: https://github.com/Marvisak/VIctory/commit/6d021fe3df542e5b5c59940a23703735e90ca603 Tested-on: AMD Radeon RX 6800, Fedora Linux 45 (Wine/vkd3d-proton, DXC test build) Assisted-by: gpt-6.2 sol xhigh
The page-table readback test assumes every persistent descriptor pair
starts at or above slot 2^18. A capped view heap can reserve only 2^16
dynamic slots, and its persistent pairs can come from that same pool.

Check the allocator's invariant by reserving a draw-table allocation
alongside the two live pairs, then check that all three spans are
disjoint and the pairs are outside the title slots. The existing
readbacks still check that the pairs remain stable across submissions.

Based-on: 6d021fe3df
Tested-on: AMD Radeon RX 6800, Fedora Linux 45 (Wine/vkd3d-proton, DXC test build)
Assisted-by: gpt-6.2 sol xhigh
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:59:45 +00:00
github-bot closed this pull request 2026-11-26 04:59:45 +00:00
Author
Owner

@⁠MamaLeVrai on GitHub · 2026-11-25 09:13 UTC · original

Test report on real hardware: AMD RX 6950 XT (RDNA2), Windows 11, Rust 1.98.1, with a GPU present, so the hardware-only shader checks run. I merged this PR's head 646363e2 into main 940d32f in a throwaway tree (no conflict). cargo clippy --workspace --all-targets --locked -- -D warnings: clean; the same with --all-features: clean. cargo test --workspace --locked: 701 passed, 0 failed, 10 ignored, two runs (main alone on the same machine: 701 passed, 0 failed, 10 ignored). The title was not run, so this says nothing about in-game effect. No game data.

AI-assisted (Claude Code); no game data.

**@⁠MamaLeVrai** on GitHub · 2026-11-25 09:13 UTC · [original](https://github.com/Marvisak/VIctory/pull/2244#issuecomment-7158041161) Test report on real hardware: AMD RX 6950 XT (RDNA2), Windows 11, Rust 1.98.1, with a GPU present, so the hardware-only shader checks run. I merged this PR's head `646363e2` into `main` `940d32f` in a throwaway tree (no conflict). `cargo clippy --workspace --all-targets --locked -- -D warnings`: clean; the same with `--all-features`: clean. `cargo test --workspace --locked`: 701 passed, 0 failed, 10 ignored, two runs (`main` alone on the same machine: 701 passed, 0 failed, 10 ignored). The title was not run, so this says nothing about in-game effect. No game data. AI-assisted (Claude Code); no game data.
Author
Owner

@⁠kotekompotek on GitHub · 2026-11-25 09:21 UTC · original

Heads-up: #2251 touches the same assertion in this test (pairs >= 1 << 18 on a capped heap), so these two will conflict at that hunk. Your version is the better fix for this test — it keeps real invariants (pairs disjoint from each other and from the draw-table allocation, outside title slots) in both layouts, where mine just skips the check when the heap has no persistent range. If this lands first I'll rebase #2251 to drop its hunk here and keep only the draw.rs / descriptor::host changes.

**@⁠kotekompotek** on GitHub · 2026-11-25 09:21 UTC · [original](https://github.com/Marvisak/VIctory/pull/2244#issuecomment-7158217950) Heads-up: #2251 touches the same assertion in this test (`pairs >= 1 << 18` on a capped heap), so these two will conflict at that hunk. Your version is the better fix for this test — it keeps real invariants (pairs disjoint from each other and from the draw-table allocation, outside title slots) in both layouts, where mine just skips the check when the heap has no persistent range. If this lands first I'll rebase #2251 to drop its hunk here and keep only the `draw.rs` / `descriptor::host` changes.
Author
Owner

@⁠Mericas77 on GitHub · 2026-11-25 10:12 UTC · original

NVIDIA test report: RTX 4070, driver 621.01, Windows 11, Rust 1.98.1 MSVC. This host has a real capped view heap (NVIDIA's 1,000,000-descriptor limit), not a forced one. I ran head 646363e against main 940d32f; the head branches from 940d32f and only changes memory.rs.

  • memory::tests::lists_share_a_table_and_copies_keep_their_views
    • main: fails: past the dynamic slots (memory.rs:673)
    • this PR: passes
  • cargo test -p victory-gpu --lib --locked
    • main: 141 passed, 2 failed
    • this PR: 142 passed, 1 failed
  • The one remaining failure, descriptor::host::tests::dynamic_slots_are_held_until_released (heap.heap.GetDesc().NumDescriptors >= victory_shader::emit::HEAP_VIEWS, host.rs:1486), fails the same way on main. It's the same heap-cap issue, and this PR doesn't touch it (#2251 / #2185 / #2177 cover that area).
  • I re-ran the targeted test with VICTORY_D3D12_DEBUG=1 and --features diagnostics and got the same result: it fails on main and passes here.

So the relaxed check holds on a real capped heap as well as the Wine run with a forced 2^16 heap. No game data; the title was not run.

AI-assisted.

**@⁠Mericas77** on GitHub · 2026-11-25 10:12 UTC · [original](https://github.com/Marvisak/VIctory/pull/2244#issuecomment-7159387525) NVIDIA test report: RTX 4070, driver 621.01, Windows 11, Rust 1.98.1 MSVC. This host has a real capped view heap (NVIDIA's 1,000,000-descriptor limit), not a forced one. I ran head `646363e` against `main` `940d32f`; the head branches from `940d32f` and only changes `memory.rs`. - `memory::tests::lists_share_a_table_and_copies_keep_their_views` - `main`: **fails**: `past the dynamic slots` (memory.rs:673) - this PR: **passes** - `cargo test -p victory-gpu --lib --locked` - `main`: 141 passed, 2 failed - this PR: 142 passed, 1 failed - The one remaining failure, `descriptor::host::tests::dynamic_slots_are_held_until_released` (`heap.heap.GetDesc().NumDescriptors >= victory_shader::emit::HEAP_VIEWS`, host.rs:1486), fails the same way on `main`. It's the same heap-cap issue, and this PR doesn't touch it (#2251 / #2185 / #2177 cover that area). - I re-ran the targeted test with `VICTORY_D3D12_DEBUG=1` and `--features diagnostics` and got the same result: it fails on `main` and passes here. So the relaxed check holds on a real capped heap as well as the Wine run with a forced 2^16 heap. No game data; the title was not run. AI-assisted.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 13:30 UTC · original

Automated triage for the maintainers.

This is a test-only fix in memory::tests::lists_share_a_table_and_copies_keep_their_views (crates/victory-gpu/src/memory.rs). The hard-coded >= 1 << 18 is replaced with checks that hold on any heap layout: pairs are disjoint from each other and from a live draw-table allocation, and lie outside the title slots. The reasoning matches main: HostHeap::pair falls back to dynamic(2) when the pair range is empty, which happens on capped heaps. CI passes, and a tester reports that the test now passes on an NVIDIA card with a real 1,000,000-descriptor cap, where it fails on main. #2251 touches the same assertion, and its author says this version should land first.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 13:30 UTC · [original](https://github.com/Marvisak/VIctory/pull/2244#issuecomment-7163887904) <!-- victory-triage v1 head=646363e2f2464543f0eff8983ae3e47d67e05e71 verdict=merge-candidate at=2026-11-25T13:41:00Z --> Automated triage for the maintainers. This is a test-only fix in `memory::tests::lists_share_a_table_and_copies_keep_their_views` (`crates/victory-gpu/src/memory.rs`). The hard-coded `>= 1 << 18` is replaced with checks that hold on any heap layout: pairs are disjoint from each other and from a live draw-table allocation, and lie outside the title slots. The reasoning matches main: `HostHeap::pair` falls back to `dynamic(2)` when the pair range is empty, which happens on capped heaps. CI passes, and a tester reports that the test now passes on an NVIDIA card with a real 1,000,000-descriptor cap, where it fails on main. #2251 touches the same assertion, and its author says this version should land first. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 22:07 UTC · original

Automated triage for the maintainers, second look (a review against current main, with builds and tests where they could change the verdict).

Closing in favour of #2251, which changes the same assertion to >= views.pair_start() where the heap has a pair range and skips it only on capped heaps, so the check keeps holding on uncapped hosts. With this version, a pair taken from the per-draw dynamic range would pass on an uncapped heap, and that is the mistake the test exists to catch.

If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.

**@⁠Marvisak** on GitHub · 2026-11-25 22:07 UTC · [original](https://github.com/Marvisak/VIctory/pull/2244#issuecomment-7175965313) Automated triage for the maintainers, second look (a review against current `main`, with builds and tests where they could change the verdict). Closing in favour of #2251, which changes the same assertion to `>= views.pair_start()` where the heap has a pair range and skips it only on capped heaps, so the check keeps holding on uncapped hosts. With this version, a pair taken from the per-draw dynamic range would pass on an uncapped heap, and that is the mistake the test exists to catch. If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.

Pull request closed

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!2244
No description provided.