GPU: bound the null sampler staging heap #83

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

@⁠FIocker on GitHub · 2026-11-24 00:19 UTC · original
FIocker:gpu/null-sampler-staging-heap → main · +28 −5 · 1 files · 1 commits · open

The heap initializer uses a CPU-only staging heap to copy null descriptors. It used the view-heap batch size (65,536 descriptors) for samplers too. A host can accept the shader-visible sampler heap and reject that temporary heap, leaving the shader-visible slots undefined.

Use the portable sampler limit to size each sampler batch. If initialization fails, report the error and stop before exposing the heap. This change is independent of the refusal-triggered sampler capacity fallback in #74 and applies to portable-sized heaps as well. Refs #65.

The new synthetic test requires successful initialization of a portable-sized sampler heap when the test has a D3D12 device. It passed on Windows WARP with VICTORY_D3D12_WARP=1 cargo test -p victory-gpu --locked --features diagnostics portable_sampler_null_fill_fits_the_host_limit. The asset policy passed.

**@⁠FIocker** on GitHub · 2026-11-24 00:19 UTC · [original](https://github.com/Marvisak/VIctory/pull/83) `FIocker:gpu/null-sampler-staging-heap` → `main` · +28 −5 · 1 files · 1 commits · open The heap initializer uses a CPU-only staging heap to copy null descriptors. It used the view-heap batch size (65,536 descriptors) for samplers too. A host can accept the shader-visible sampler heap and reject that temporary heap, leaving the shader-visible slots undefined. Use the portable sampler limit to size each sampler batch. If initialization fails, report the error and stop before exposing the heap. This change is independent of the refusal-triggered sampler capacity fallback in #74 and applies to portable-sized heaps as well. Refs #65. The new synthetic test requires successful initialization of a portable-sized sampler heap when the test has a D3D12 device. It passed on Windows WARP with `VICTORY_D3D12_WARP=1 cargo test -p victory-gpu --locked --features diagnostics portable_sampler_null_fill_fits_the_host_limit`. The asset policy passed.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:49:41 +00:00
Author
Owner

@⁠lordon1a on GitHub · 2026-11-24 00:38 UTC · original

Verified d8f063b04 on Windows 11 (x86_64-pc-windows-gnullvm, rustc 1.100.0, applied cleanly to main@35b054ec0): pass.

  • cargo xtask policy: 150 files ok
  • cargo test -p victory-gpu: 40 passed, 0 failed (including portable_sampler_null_fill_fits_the_host_limit on Intel Iris Xe).

Small edge-case note: in fill_null, if total == 0 (e.g. a zero-slot sampler heap), block_count becomes 0 and CreateDescriptorHeap(NumDescriptors: 0) will fail (E_INVALIDARG), which now causes HostHeap::new to return None due to the added return None; at line 134. Adding if total == 0 { return Ok(()); } at the top of fill_null avoids that edge case.

AI-assisted.

**@⁠lordon1a** on GitHub · 2026-11-24 00:38 UTC · [original](https://github.com/Marvisak/VIctory/pull/83#issuecomment-7118287525) Verified `d8f063b04` on Windows 11 (`x86_64-pc-windows-gnullvm`, `rustc 1.100.0`, applied cleanly to `main@35b054ec0`): **pass**. - `cargo xtask policy`: 150 files ok - `cargo test -p victory-gpu`: **40 passed, 0 failed** (including `portable_sampler_null_fill_fits_the_host_limit` on Intel Iris Xe). Small edge-case note: in `fill_null`, if `total == 0` (e.g. a zero-slot sampler heap), `block_count` becomes `0` and `CreateDescriptorHeap(NumDescriptors: 0)` will fail (`E_INVALIDARG`), which now causes `HostHeap::new` to return `None` due to the added `return None;` at line 134. Adding `if total == 0 { return Ok(()); }` at the top of `fill_null` avoids that edge case. AI-assisted.
Author
Owner

@⁠DaviTostes on GitHub · 2026-11-24 00:49 UTC · original

Tested d8f063b under Wine 11.22 + vkd3d-proton 3.1 on Arch Linux x86_64 (AMD RX 9060 XT, RADV 26.3.1), Windows build with cargo xwin ... --target x86_64-pc-windows-msvc: pass, no regression.

  • victory_gpu: 37 passed, 3 failed — this PR adds one test (36 → 37).
  • The 3 failures are the environment-only ones from main (argument_clamp_builds, a_rejected_blob_gives_an_empty_library, and #128's VirtualQuery upload skip), not this PR.
  • Note this touches the same sampler-heap area as #74, #86 and #100 (all for #65). I plan to test it merged with #86 next; if the two conflict, that will be worth knowing before review.

No game data used. AI-assisted (DeepSeek V4.1 Flash coding agent).

**@⁠DaviTostes** on GitHub · 2026-11-24 00:49 UTC · [original](https://github.com/Marvisak/VIctory/pull/83#issuecomment-7118467356) Tested `d8f063b` under **Wine 11.22 + vkd3d-proton 3.1** on Arch Linux x86_64 (AMD RX 9060 XT, RADV 26.3.1), Windows build with `cargo xwin ... --target x86_64-pc-windows-msvc`: **pass, no regression**. - `victory_gpu`: **37 passed, 3 failed** — this PR adds one test (36 → 37). - The 3 failures are the environment-only ones from `main` (`argument_clamp_builds`, `a_rejected_blob_gives_an_empty_library`, and #128's `VirtualQuery` upload skip), not this PR. - Note this touches the same sampler-heap area as #74, #86 and #100 (all for #65). I plan to test it merged with #86 next; if the two conflict, that will be worth knowing before review. No game data used. AI-assisted (DeepSeek V4.1 Flash coding agent).
Author
Owner

@⁠DaviTostes on GitHub · 2026-11-24 00:51 UTC · original

Merged with #86 (a80eb17 + d8f063b): the textual merge succeeds, but the result does not compile — the two PRs disagree on HostHeap::new's return type:

error[E0308]: mismatched types
   --> crates/victory-gpu/src/descriptor/host.rs:178:20
     |     ) -> Self {
     |          ---- expected `HostHeap` because of return type
  178|             return None;
     |                    ^^^^ expected `HostHeap`, found `Option<_>`

So at least one of #83 / #86 / #74 / #100 needs to pick up the chosen HostHeap::new signature before they can coexist; on its own #83 is 37 passed / 3 environment-only failures under Wine (see above). This is the same convergence the #65 family needs anyway.

No game data used. AI-assisted (DeepSeek V4.1 Flash coding agent).

**@⁠DaviTostes** on GitHub · 2026-11-24 00:51 UTC · [original](https://github.com/Marvisak/VIctory/pull/83#issuecomment-7118499378) Merged with **#86** (`a80eb17` + `d8f063b`): the textual merge succeeds, but the result **does not compile** — the two PRs disagree on `HostHeap::new`'s return type: ``` error[E0308]: mismatched types --> crates/victory-gpu/src/descriptor/host.rs:178:20 | ) -> Self { | ---- expected `HostHeap` because of return type 178| return None; | ^^^^ expected `HostHeap`, found `Option<_>` ``` So at least one of #83 / #86 / #74 / #100 needs to pick up the chosen `HostHeap::new` signature before they can coexist; on its own #83 is 37 passed / 3 environment-only failures under Wine (see above). This is the same convergence the #65 family needs anyway. No game data used. AI-assisted (DeepSeek V4.1 Flash coding agent).
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:16 UTC · original

Automated triage for the maintainers.

Needs rebase. This PR does not merge cleanly into current main (ac2525d). Conflicting files: crates/victory-gpu/src/descriptor/host.rs.

The content has not been reviewed yet; it will be once the branch is rebased onto main.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 00:16 UTC · [original](https://github.com/Marvisak/VIctory/pull/83#issuecomment-7148330116) <!-- victory-triage v1 head=d8f063b04566e39dfa32617387e8ab60b4cf689d verdict=needs-rebase at=2026-11-25T00:13:20Z --> Automated triage for the maintainers. **Needs rebase.** This PR does not merge cleanly into current `main` (ac2525d). Conflicting files: `crates/victory-gpu/src/descriptor/host.rs`. The content has not been reviewed yet; it will be once the branch is rebased onto `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/descriptor/host.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

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