gpu: preserve dynamic descriptor budget on capped heaps #3860
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3860"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by sofiane-wattiez on 2026-11-29T21:26:51Z.
No description provided.
Imported from Marvisak/VIctory. Originally posted by AurumCarlos on 2026-11-29T21:31:21Z.
Code review location:
crates/victory-gpu/src/descriptor/host.rs; line 120[blocking] This gives the dynamic budget its room first and cuts the title's slots to fit, the opposite of
MIN_DYNAMIC's rule onmain("the title's slots keep their room first"). A title slot left out reads nothing. On a heap that fits under the cap, this drops slotsmainkeeps: 900,000 → 737,856. Give the title its slots first, and the dynamic slots what's left, up to the budget:Small heaps still get the larger budget (500,000 → 262,144 dynamic), and past the cap the split is
main's.Imported from Marvisak/VIctory. Originally posted by AurumCarlos on 2026-11-29T21:31:21Z.
Code review location:
crates/victory-gpu/src/descriptor/host.rs; line 2263[suggestion] This test pins the slot loss (
900_000→PORTABLE_VIEWS - DYNAMIC). It should pin the title-first rule instead. I ran this one against a copy of both versions ofcapped_heap_slots(not a build of the PR): it fails on this head withleft: (737856, 262144), right: (900000, 100000)and passes with the change above.Imported from Marvisak/VIctory. Originally posted by AurumCarlos on 2026-11-29T21:31:22Z.
Review: CHANGES_REQUESTED
Requesting changes: on a capped host this takes title slots to make room for dynamic ones, including on heaps that fit. Details on the lines.
host.rs:116-120:kept = count.min(PORTABLE_VIEWS - dynamic)sizes the dynamic budget first. A 900,000-slot heap, whichmainkeeps whole (900,000 +MIN_DYNAMIC), loses 162,144 title slots. The world's 1,245,184-slot heap keeps 737,856 instead ofmain's 934,464.host.rs:2249: a test that pins "title slots first", which fails on this head.MIN_DYNAMIC(65,536) run out on a capped host, and where?DYNAMIC's comment records 2^16 running out on an RX 9070 XT, but that host wasn't capped. If NVIDIA runs out too, the right trade between dynamic slots and the title's past-cap slots needs that measurement. #3518 (remapping the slots past the cap) is the other open way around it.Split per title heap size, from a port of the three versions of the logic:
mainkept / dynamicImported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-30T10:38:27Z.
Independent verification (AI-assisted: Hy4 flash) — Windows, rustc 1.100.0 (MSVC), source + synthetic inputs only, no game data.
PR #3860 (1 file, +61/-12,
gpu: preserve dynamic descriptor budget on capped heaps) is OPEN, non-draft, MERGEABLE/CLEAN, zero formal APPROVED reviews, no prior comment from me.Checked in a dedicated worktree
D:\Victory-Contrib\pr-3860-watchwith its ownCARGO_TARGET_DIR=D:\Victory-Contrib\NVIDIA-Contrib\target-3860(never shared).63bcca43c6a00a758510398fa43096ce7e4f7df0:git grep -F capped_heap_slots_preserves_dynamic_budget_and_clamps <base> -- crates/victory-gpu/src/descriptor/host.rs→ no match (test is new).git diff --check <base>..HEAD→ exit 0, clean.cargo test --locked -p victory-gpu --lib -- descriptor::host::tests::capped_heap_slots_preserves_dynamic_budget_and_clamps --exact --test-threads=1 --quiet→test result: ok. 1 passed; 0 failed; 232 filtered out, exit 0.GPU/driver: N/A — the new test exercises pure slot-accounting helpers (
capped_heap_slots), no device or title required.Imported from Marvisak/VIctory. Originally posted by sofiane-wattiez on 2026-11-30T11:27:17Z.
Code review location:
crates/victory-gpu/src/descriptor/host.rs; line 2263Thanks @AurumCarlos for the detailed review and @cloph-dsp for the independent verification.
You're right about the title-first allocation rule. The current implementation prioritizes the dynamic descriptor budget at the expense of title descriptors, which introduces an unintended regression.
The initial motivation came from my RTX 3060 investigations, where I observed:
However, I haven't conclusively demonstrated that the dynamic descriptor allocator itself exhausts its 65,536 slots on NVIDIA hardware. Increasing the dynamic budget was an experimental approach rather than a confirmed fix.
I agree with preserving title descriptors first and allocating additional dynamic slots only when sufficient capacity remains.
I'll update the implementation and regression tests accordingly. I'll also investigate dynamic allocator occupancy and exhaustion separately, and look into the remapping approach discussed in #3518.
Thanks again for the constructive feedback.
Pull request closed