Shader: table reads the code computes mark their heap slots #2820
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2822"
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-25T21:29:39Z.
A texture at a slot a computed table entry names — the program walks a table at
an offset it computes (a dynamic term in the descriptor's address, or a waterfall
loop's per-lane entry) — kept no read mark: only the reads of the resource heap
itself did. Lowering marked
texture_readsfor heap-direct sources(
is_heap_direct) and left every table read to the host, which makes the slot fora fixed entry (the draw's table ranges) but nothing for a computed one — the
placed texture at that slot stays null forever. Fixes #2722 (the issue's analysis
of
handle, inemit/lower.rs, names the exact seam — found by reading the code;the issue author's analysis was assisted by Claude Code).
The gate is now
marks_its_reads: a source marks its reads when it is heap-direct,or when a loaded/fetched leaf's address comes from a
Tableroot and iscomputed —
dynamic.is_some(), or the load is a waterfall loop's per-lane read(
waterfall::loads). A table read at a fixed offset still marks nothing, for thedraw makes that slot; a computed one lowers its runtime heap index (the index
heap_indexalready produces for the handle) and marks that, which the hostalready materializes from the marks.
Tests:
table_texture_reads_at_an_offset_the_code_computes_mark_their_slot(emit) — a synthetic GFX10 compute program reads a texture through a table at a
fixed offset (marks nothing, as before) and through a table whose offset the code
adds (
s_or_b32 s20, s4, 0; s_add_u32 s6, s4, s20, thens_loadthe descriptorfrom
s[6:7]): the lowered shader now carries the read mark, DXIL-valid.cargo test -p victory-shader(minus the known #2317 machine failures — gather/stride and the device
heap_direct_texture_readsAV, reproduced on a cleantree): 260 passed, 0 failed.
cargo clippy --workspace --all-targets --locked, and with--all-features:0 warnings, both.
13f91ca(touches onlyemit/lower.rsandemit/memory_tests.rs; #2679's conflicts live inresource.rs, untouched here).Generated with Mistral Vibe.
Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-25T21:57:58Z.
Review: COMMENTED
Right fix for the null-placed-texture gap: a fixed-offset table read is named by the draw's table ranges so the host makes that slot — but a dynamic offset or waterfall per-lane entry has no host-visible name, so it must go through Read marks like a heap-direct read. marks_its_reads keeps the fixed case unmarked (marking would cost without adding info) and the s_load-a-dynamic-term test covers both sides. LGTM.
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-25T21:40:56Z.
Verified
03914d9don Windows 11 (RTX 5090 + WARP + Windows SDK10.0.26100.0dxil.dll):cargo xtask policy: 184 files ok;cargo clippy --locked -p victory-shader --all-targets -- -D warnings(default &--features host): 0 warnings.emit::memory_tests::table_texture_reads_at_an_offset_the_code_computes_mark_their_slot: passed (withdxil.dllvalidation); remainingemit::memory_tests(4/4),emit::waterfall_tests(5/5), andemit::lower::tests(27/27) all passed.marks_its_readscleanly extends read-mark emission toRootType::Tableleaves whena.dynamic.is_some()or the load is inwaterfall.loads, while keeping fixed-offset table reads unmarked.git merge-treeagainstorigin/main13f91ca, #2783, #2816, and #2668 (complementary with #2668, which guardsmark_view_readunder per-lane EXEC).Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T23:14:46Z.
Automated triage for the maintainers.
This PR no longer merges cleanly into
main: it conflicts incrates/victory-shader/src/emit/memory_tests.rs. Its content will be reviewed once it is rebased onto currentmain.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by futurepro62 on 2026-11-25T23:31:05Z.
Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head
03914d9(on its base13f91ca).Tested
dxil.dllfrom Windows SDK 10.0.26100 (the loader's default), debug.cargo build --workspace --locked, thencargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 774 passed, 0 failed, 9 ignored.table_texture_reads_at_an_offset_the_code_computes_mark_their_slot.heap_direct_texture_reads_mark_their_heap_index(#2571), so I also ran that one unskipped at this head: it still ends thevictory-shaderprocess with0xc0000005(3 of 3 runs), as on main. This PR doesn't change it.--skipleaves out tests that fail on main842b0cbon this card too, not because of this PR:heap_direct_texture_reads_mark_their_heap_indexends thevictory-shadertest process with0xc0000005(#2571), so without the skip the rest of that crate never reports;dynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_viewsand the twostride_testshit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317);gathers_at_a_level_match_the_hardwarefails on lane 0 (#1744).Not tested
AI use
upstream-sync referenced this pull request2026-11-26 03:05:09 +00:00
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.