GPU: cap oversized sampler heaps at 2,048 with dynamic slots #2449
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2451"
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 makmatvey on 2026-11-25T13:48:19Z.
Rebased onto current
mainUnchanged in content: this is the same patch, re-landed on
63bcca4. The oneconflict was not semantic —
mainand this branch each appended a test to theend of
mod testsindescriptor/host.rs; all three are kept.A test defect fixed on top
Reviewing this by the method the triage here applies — revert the fix, keep the
test, watch it fail —
large_sampler_heap_is_cappeddid not test the fix itexists to guard. It opened with:
newreturningNoneis the bug. On a host that refusesmake(4 * HEAP_SAMPLERS)— an RTX 3060 here — the tree without the cap takesthat "no host GPU" return and the test passes. Measured rather than read:
So the test was green before and after the change it was written to protect.
It now asks the host for the skip and then
expects the heap, so a missing cappanics here instead of passing quietly:
Negative control, on the rebased tree:
descriptor/host.rs:2501— "an oversized sampler heap is capped, not dropped"Verified on Windows 11, RTX 3060, Rust 1.98.1
cargo clippy -p victory-gpu --all-targets --locked -- -D warningscargo clippy --workspace --all-targets --all-features --locked -- -D warningscargo test -p victory-gpu --lib --lockedcargo xtask policyThe two failures are pre-existing on
mainand unrelated to this change: thecapped-heap assertions
descriptor::host::tests::dynamic_slots_are_held_until_releasedand
memory::tests::lists_share_a_table_and_copies_keep_their_views(issue #3178).The count is 231 rather than the previous 229 because of the two new tests.
cargo fmt --checkreports diffs elsewhere in the tree (crates/victory-formats/src/texture.rsand others) on unmodified
main; the two files this PR touches are clean, andno unrelated reflow is included.
No game data used.
make(4 * HEAP_SAMPLERS)is refused on this host, which iswhat makes the first branch of
HostHeap::newreachable here.🤖 Generated with Claude Code
Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T13:55:23Z.
Review: APPROVED
Verified against
origin/main(940d32f) on Windows 11 + NVIDIA GeForce RTX 5090 and WARP:cargo test -p victory-gpu descriptor::host::tests -- --skip dynamic_slots_are_held_until_released: 6/6 passed on RTX 5090, 6/6 passed on WARP (includinglarge_sampler_heap_is_cappedandsmall_sampler_heap_has_no_dynamic_slots).cargo clippy -p victory-gpu --all-targets -- -D warnings: 0 warnings.cargo xtask policy: 183 files ok.AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T14:11:23Z.
Review: COMMENTED
Cap oversized sampler heaps at 2,048 with dynamic slots. Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1. Same heap-capping theme as #2461 — overlaps in descriptor/host.rs; whichever merges second conflicts.
Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-25T14:23:29Z.
Mechanics verified:
State::tablesalready routes any table whose end index is>= host.count()through the fresh-table path (dynamic(n)+make_at), so a capped sampler heap works exactly like a capped view heap — before this,dynamic()unconditionally returnedNonefor samplers and the draw was dropped. Keeping the cap unconditional (not only when creation fails) makes behavior host-independent, matching the comment. The warn-once when a table exceeds the dynamic pool is a good failure signal — a 256-slot dynamic budget is small, so a pathological title table pattern will show in the log rather than silently dropping draws.Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T16:08:48Z.
Automated triage for the maintainers.
This pull request no longer merges cleanly into
main(conflicts incrates/victory-gpu/src/descriptor/host.rs). It will be reviewed once it is rebased onto the currentmain.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by kalberts0089-hash on 2026-11-27T10:57:47Z.
RTX 4070 Ti (Ada), driver 621.01, Windows 11: tests at head
cb36a9aHead
cb36a9a1f2b1ad13aae272ad2e8f6986bfcd935e, which sits directly on currentmain(63bcca4), so it was tested as is with nothing merged locally. The only hardware run at this head so far was the author's RTX 3060.Confirmed
main63bcca4cb36a9acargo test -p victory-gpu --lib -- --test-threads=1cargo test -p victory-shader --lib --no-fail-fast(one test skipped, below)mainis the two new tests, both passing:large_sampler_heap_is_cappedandsmall_sampler_heap_has_no_dynamic_slots. Each also passes 3/3 alone with--exact --nocapture.main, same assertions on both sides, unrelated to this change: victory-gpudynamic_slots_are_held_until_releasedandlists_share_a_table_and_copies_keep_their_views; victory-shadera_heap_buffer_read_by_element_takes_the_views_stride,a_heap_buffer_read_where_no_buffer_view_is_reads_zerosandgathers_at_a_level_match_the_hardware.heap_direct_texture_reads_mark_their_heap_indexwas skipped on both sides (#2571).Negative control, with the cap reverted locally
Not a change to the PR: an uncommitted local edit that put the sampler branch of
HostHeap::newback tomain's form (make(count.max(samplers)),Noneon error), with the PR's tests kept, plus one line printing the error. It was restored afterwards.large_sampler_heap_is_cappedcb36a9acb36a9awith the cap reverted locallyCreateDescriptorHeapfor 8,192 samplers returns0x80070057(the parameter is incorrect). It comes back as an ordinary error return, andsmall_sampler_heap_has_no_dynamic_slotsstill passes in the reverted tree.Not tested
State::tables.cargo xtask policy, other crates.Synthetic tests only, no game files. AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-28T04:48:28Z.
For whoever picks: #1032 (divyeshganta) is a second open PR for #65 (read from both diffs, not run).
b38a3c9: caps oversized sampler heaps at D3D12's 2,048 and logs that the higher slots are unavailable. Tables that reach past them get no slots. It touchesdescriptor/host.rsonly and needs a rebase.cb36a9a: the same cap, plus 256 dynamic sampler slots (SAMPLER_DYNAMIC), so tables past the kept title slots are made afresh. It also has the corrected test, which fails with the cap removed.So this one covers #1032 and goes further. If this lands, #1032 can be closed.
AI-assisted (Claude Code, Claude Opus 5.5 read both diffs).
Pull request closed