Shader: table reads the code computes mark their heap slots #2822
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!2822
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@kais7654 on GitHub · 2026-11-25 21:29 UTC · original
kais7654:shader/table-reads-the-code-computes-mark→main· +115 −3 · 2 files · 1 commits · openA 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.
@fuzeofficlal on GitHub · 2026-11-25 21:40 UTC · original
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).@Marvisak on GitHub · 2026-11-25 23:14 UTC · original
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
@futurepro62 on GitHub · 2026-11-25 23:31 UTC · original
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
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.