Shaders: the null-buffer reads of the heap skip a host that caps its heaps #1941
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from Marvisak/VIctory. Originally posted by kais7654 on 2026-11-25T01:32:41Z.
a_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).
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T03:05:23Z.
Review: APPROVED
Tested locally: macOS arm64, rustc 1.98.1, PR head merged into main
940d32f69b,cargo test -p victory-shader --locked.144 passed / 0 failed / 2 ignored. Null-buffer heap reads skip hosts that cap their heap — capability-gated fallback; same gating cluster as #1775/#1787/#1801/#1832/#1843.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T08:19:59Z.
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
Imported from Marvisak/VIctory. Originally posted by sinan-cmyk on 2026-11-25T11:16:33Z.
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).
Imported from Marvisak/VIctory. Originally posted by borosf on 2026-11-25T11:46:19Z.
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.
Imported from Marvisak/VIctory. Originally posted by kais7654 on 2026-11-25T13:56:49Z.
@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).
Imported from Marvisak/VIctory. Originally posted by kais7654 on 2026-11-25T13:59:01Z.
@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).
Imported from Marvisak/VIctory. Originally posted by kais7654 on 2026-11-25T14:01:19Z.
@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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.