victory-gpu: the capped-heap (NVIDIA) path leaves shader indices and NULL_BUFFER_VIEW past the heap — 5 failing tests on an RTX 3060 #3344
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory#3344
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@BudgetGLaDOS on GitHub · 2026-11-26 19:21 UTC · original
Summary
cargo test --workspaceis green everywhere exceptvictory-gpu: 5 of 232tests fail, deterministically, on an NVIDIA RTX 3060. Tracing them, four are
consistent with one structural gap:
HostHeap::newfalls back to a heap ofcount + MIN_DYNAMICslots on hosts that refuseHEAP_VIEWS, but theshader-side clamp, the null buffer view, and the pair band all still assume the
full
HEAP_VIEWSheap.Environment
main@63bcca4("update readme"), 26 Nov 2026Result
Re-ran serially (
--test-threads=1): identical five, 226 pass, 61.5 s. Notflaky, not parallel-test contention.
The numbers on this host
HEAP_VIEWSNULL_BUFFER_VIEWHEAP_VIEWS - 2= 2,097,150PORTABLE_VIEWSDYNAMIC/MIN_DYNAMICHostHeap::newladder for a view heap:make((count + DYNAMIC).max(HEAP_VIEWS))=make(2_097_152)→ fails(the device will not give a shader-visible heap that large)
make(count + MIN_DYNAMIC)=make(65_540)→ succeedsPORTABLE_VIEWSrung is not reached)So on this card:
NumDescriptors = 65_540,count = 4,dynamic = 65_536,address_slots() = 65_540.Finding A — shader indices clamp to the constant, not the heap
crates/victory-shader/src/emit/lower.rs:545and:5552clamp a heap index toHEAP_VIEWS - 1(2,097,151).buffer_guardthen substitutesNULL_BUFFER_VIEW(2,097,150) when the stride table says the slot holds nobuffer view. Neither index exists in a 65,540-slot heap.
HostHeap::address_slots()(count + dynamic) is the accessor that would givethe real ceiling, and it is referenced nowhere outside its own definition —
so nothing on the GPU side clamps to the heap it actually has.
Failing test 1 (
descriptor/host.rs:2226) asserts exactly this requirement:That assertion failing is the bug report, not a stale assumption.
Finding B — the pair band collapses into the dynamic range
crates/victory-gpu/src/descriptor/host.rs:201:Here
null < totalis2_097_150 < 65_540→ false, sopairs_end = total = 65_540.The cursor starts at
count + extra = 65_540too, sopair()'spairs.0 + 2 <= self.pairs_endis false on the first call and it falls throughto
self.dynamic(2).Consequence: on a capped host, host-copy views (
crate::memory) live indynamic slots, which are recycled per list, rather than in the persistent
band above them. Failing test 2 (
memory.rs:1030, "past the dynamic slots") isdetecting precisely that.
Findings C — unresolved, possibly independent
draw.rs:2856:placed_texture(&view)returnsNonefor round 0.draw.rs:3413:HostPipeline::new(...).expect("compute host pipeline")— PSO creation fails.pipeline/depth_bounds_test.rs:88: the adapter printsvertex depth bounds on NVIDIA GeForce RTX 3060: true, then the PSO is nevermade within
made()'s 60 s budget.These may be the same heap gap surfacing in the draw path, or unrelated driver
behaviour. They are listed separately because I can't currently distinguish them.
What I tried, for the record
I first assumed tests 1 and 2 encoded the AMD layout and relaxed them to
per-path invariants (
>= address_slots()):address_slots()count + dynamic, whichconfirmed Finding B rather than a test assumption
On reading
buffer_guardand theNULL_BUFFER_VIEWconstruction, the originalassertions turned out to encode real requirements, so I reverted the change
rather than land a weaker test. Recording it here so nobody repeats the
experiment.
Suggested direction
under the device cap, or lower
HEAP_VIEWStoPORTABLE_VIEWSso that everyclamp, the null view, and the pair band are valid on every host.
address_slots()rather than the compile-time constant.
dynamic-slot-resident and update the test's invariant to match.
Evidence
Happy to attach the full
cargo test --workspacelog and the serial(
--test-threads=1) reproduction on request.@upipibi on GitHub · 2026-11-26 21:10 UTC · original
Pointers for these five, from reading the open PRs (no run):
dynamic_slots_are_held_until_releasedandlists_share_a_table_and_copies_keep_their_viewsfail on NVIDIA's 1,000,000-view heap cap (#1744, #3178). #2461 sizes the heap from the probed limit and fixes both; fyernald's review there reproduced your setup (Ampere, Windows 10 19045,63bcca4) and saw both pass.a_texture_written_in_one_format_reads_in_another_through_a_placed_view,compute_view_marks_rebind_after_depth_twin_conversionanddepth_bounds_control_a_title_draware not heap-cap failures: on Windows 10's in-box D3D12 runtime they need shader model 6.6 root-signature flags orCreateCommittedResource3. #3283 skips them there; #2878 runs them with a staged Agility runtime.AI-assisted (Claude Code, Claude Opus 5.5).