Shaders: the null-buffer reads of the heap skip a host that caps its heaps #1943
No reviewers
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!1943
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1943"
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?
@kais7654 on GitHub · 2026-11-25 01:32 UTC · original
kais7654:shader/stride-heap-cap→main· +69 −6 · 4 files · 2 commits · opena_heap_buffer_read_where_no_buffer_view_is_reads_zeros
never ran on real hardware here: when a test's views end inView::NullBuffersthe dispatch creates the wholeHEAP_VIEWS-slot (2^21) shader-visible heap, because the null views have to sit atNULL_BUFFER_VIEWand one below — and the RTX 5070 laptop's driver refuses that heap outright (E_INVALIDARG, dispatch failed before its first draw).victory-gpuknows the limit: the same device caps shader-visible heaps at a million (PORTABLE_VIEWS`), thetier-1 ceiling, and the game path works around it with root-view tables.
The host now asks the device once (
Host::takes_the_whole_heap) and a testwhose views reach the heap's end prints so and runs where the slots exist.
On a machine without a GPU the hardware label is already skipped (0a..., on
main), WARP takes the heap and runs the check, and every device that can
hold the whole heap — discrete desktop GPUs included — keeps it unchanged.
Local: RTX 5070 Laptop GPU (driver 616.87, heap refused → skipped) and
WARP (runs, passes); clippy
-D warningson both passes.AI-assisted (Mistral Vibe).
@Marvisak on GitHub · 2026-11-25 08:19 UTC · original · edited 2026-11-25 14:52 UTC
Automated triage for the maintainers.
Needs work. Re-reviewed at
9825382.The first part is unchanged and still fine:
Host::takes_the_whole_heapincrates/victory-shader/src/emit/host.rstries a shader-visible heap ofHEAP_VIEWSslots, anda_heap_buffer_read_where_no_buffer_view_is_reads_zeros(stride_tests.rs) skips a device that refuses it. That test harness really needs the whole heap forView::NullBuffers, and WARP still runs the check.The new commit is the problem. It makes two
victory-gputests skip their assertions on a capped host:descriptor::host::tests::dynamic_slots_are_held_until_releasedno longer checks the heap sizes when the device caps its shader-visible heaps;memory::tests::lists_share_a_table_and_copies_keep_their_viewsno longer checks that the copies' views sit in the pair range (pair_base).Those two failures are a real runtime gap, not only a test-host limit. On a capped host,
HostHeap::newfalls back toMIN_DYNAMIC(your own run shows a 65,540-slot view heap: 4 title slots plus 65,536), and #1751 (open, merge candidate) fixes exactly that inHostHeap::newby tryingPORTABLE_VIEWSwith the full dynamic range, which makes both tests pass on NVIDIA. With this commit, the tests would go green on the hosts where that fix is missing, and they would conflict with #1751's own change todynamic_slots_are_held_until_released.What would change the verdict: drop the
victory-gpucommit (descriptor/host.rs,memory.rs) and keep thevictory-shaderpart, which was a merge candidate as it stood.Reply to @kais7654: thanks for extending it, and for the Arc B580 confirmation from @borosf. The stride test skip is the right shape for the test harness; for the two
victory-gputests, the fix belongs in the runtime (#1751), not in the tests.CI: passing (
check).Generated by Claude Code
@sinan-cmyk on GitHub · 2026-11-25 11:16 UTC · original
Offline measurement on a retail dump
Result: no count change against
main.I merged head
7f67667contomain940d32f(clean merge) and ranvictory translate --validate --listonshaders.rpf(1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result withmainprogram by program (25,889 programs). Validated: 23,918 onmain, 23,918 with this PR.No program changes its failure reason. The count shows that the change rejects nothing on this data. It does not show whether the output is right.
No shader names or data are included, per the asset policy. AI-assisted (Claude Code).
@borosf on GitHub · 2026-11-25 11:46 UTC · original
Verified on the branch on an Intel Arc B580 (Xe2, SM 6.7, discrete, main
940d32f+this branch):
a_heap_buffer_read_where_no_buffer_view_is_reads_zerospasses — the legthe card cannot take is skipped and the remaining run completes.
Baseline for context, on the same card on
940d32fwithout this PR: the test fails withhardware: dispatch failed: The parameter is incorrect, andvictory-gpuon the samemachine confirms the cause: shader-visible view heaps top out at 1,000,000 — the same
cap Intel UHD reports in #1829, so this driver enforces the tier limit exactly. With the
RTX 4070 Ti result above, that makes three vendors where the failure is real and this
skip is the right shape.
@kais7654 on GitHub · 2026-11-25 13:56 UTC · original
@Marvisak The two remaining victory-gpu failures of #1744 are covered too, at
9825382: dynamic_slots_are_held_until_released no longer asserts a heapof HEAP_VIEWS / HEAP_SAMPLERS slots where the device caps its
shader-visible heaps (HostHeap::new's shortcut — it says so and skips
the two size assertions, the held-until-released checks still run), and
lists_share_a_table_and_copies_keep_their_views now checks the pairs
against the pair range only where the heap kept room for one — on a
capped heap the range is empty and HostHeap::pair hands the dynamic
slots out instead. On a machine behind the shortcut (RTX 5070 laptop,
driver 616.87) both skips ran — the view heap came out 65540 slots, the
samplers' 2048 — and the whole victory-gpu suite passes; on WARP and
any host that takes the whole heap the assertions are unchanged.
AI-assisted (Mistral Vibe).
@kais7654 on GitHub · 2026-11-25 13:59 UTC · original
@borosf Thanks for checking — good to have the tier limit confirmed on a third
vendor. A data point from the machine this branch came from (RTX 5070
Laptop GPU, driver 616.87, Windows 11): there the skip runs too — the
view heap comes out 65540 slots (4 + 65536, HostHeap::new's shortcut)
and the samplers' 2048 — so the 2,097,152-slot heap is refused there
as well; that shortcut only shows the refusal, the exact cap below not.
AI-assisted (Mistral Vibe).
@kais7654 on GitHub · 2026-11-25 14:01 UTC · original
@sinan-cmyk Thanks — good to know the change rejects nothing on retail data. Note
the PR head has moved to
9825382since, but that commit only touchesvictory-gpu tests, so the translation result holds for it as well.
AI-assisted (Mistral Vibe).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.