Shader: table reads the code computes mark their heap slots #2822

Open
github-bot wants to merge 1 commit from github-bot/gh-2822 into main AGit
Owner

@⁠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 · open

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_reads for heap-direct sources
(is_heap_direct) and left every table read to the host, which makes the slot for
a 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, in emit/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 Table root and is
computed — 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 the
draw makes that slot; a computed one lowers its runtime heap index (the index
heap_index already produces for the handle) and marks that, which the host
already 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, then s_load the descriptor
from 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_reads AV, reproduced on a clean
    tree): 260 passed, 0 failed.
  • cargo clippy --workspace --all-targets --locked, and with --all-features:
    0 warnings, both.
  • Merge-tree: clean vs 13f91ca (touches only emit/lower.rs and
    emit/memory_tests.rs; #2679's conflicts live in resource.rs, untouched here).

Generated with Mistral Vibe.

**@⁠kais7654** on GitHub · 2026-11-25 21:29 UTC · [original](https://github.com/Marvisak/VIctory/pull/2822) `kais7654:shader/table-reads-the-code-computes-mark` → `main` · +115 −3 · 2 files · 1 commits · open 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_reads` for heap-direct sources (`is_heap_direct`) and left every table read to the host, which makes the slot for a **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`, in `emit/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 `Table` root and is computed — `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 the draw makes that slot; a computed one lowers its runtime heap index (the index `heap_index` already produces for the handle) and marks that, which the host already 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`, then `s_load` the descriptor from `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_reads` AV, reproduced on a clean tree): **260 passed, 0 failed**. - `cargo clippy --workspace --all-targets --locked`, and with `--all-features`: 0 warnings, both. - Merge-tree: clean vs `13f91ca` (touches only `emit/lower.rs` and `emit/memory_tests.rs`; #2679's conflicts live in `resource.rs`, untouched here). Generated with Mistral Vibe.
A texture a placed table names at an offset the program 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,
so the host never learned which slot the program reads and the placed
texture there stayed null forever. Such reads now mark their heap index
like the heap's own; a table read at a fixed offset still marks nothing,
for the draw makes that slot.

Generated by Mistral Vibe.

Co-Authored-By: Mistral Vibe <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:15:06 +00:00
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-25 21:40 UTC · original

Verified 03914d9d on Windows 11 (RTX 5090 + WARP + Windows SDK 10.0.26100.0 dxil.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 (with dxil.dll validation); remaining emit::memory_tests (4/4), emit::waterfall_tests (5/5), and emit::lower::tests (27/27) all passed.
  • Code review: marks_its_reads cleanly extends read-mark emission to RootType::Table leaves when a.dynamic.is_some() or the load is in waterfall.loads, while keeping fixed-offset table reads unmarked.
  • Clean git merge-tree against origin/main 13f91ca, #2783, #2816, and #2668 (complementary with #2668, which guards mark_view_read under per-lane EXEC).
**@⁠fuzeofficlal** on GitHub · 2026-11-25 21:40 UTC · [original](https://github.com/Marvisak/VIctory/pull/2822#issuecomment-7175401697) Verified `03914d9d` on Windows 11 (RTX 5090 + WARP + Windows SDK `10.0.26100.0` `dxil.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 (with `dxil.dll` validation); remaining `emit::memory_tests` (4/4), `emit::waterfall_tests` (5/5), and `emit::lower::tests` (27/27) all passed. - Code review: `marks_its_reads` cleanly extends read-mark emission to `RootType::Table` leaves when `a.dynamic.is_some()` or the load is in `waterfall.loads`, while keeping fixed-offset table reads unmarked. - Clean `git merge-tree` against `origin/main` `13f91ca`, #2783, #2816, and #2668 (complementary with #2668, which guards `mark_view_read` under per-lane EXEC).
Author
Owner

@⁠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 in crates/victory-shader/src/emit/memory_tests.rs. Its content will be reviewed once it is rebased onto current main.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 23:14 UTC · [original](https://github.com/Marvisak/VIctory/pull/2822#issuecomment-7177308873) <!-- victory-triage v1 head=03914d9de5c469f1a95cb65176a23ea22e5652be verdict=needs-rebase at=2026-11-25T23:13:52Z --> Automated triage for the maintainers. This PR no longer merges cleanly into `main`: it conflicts in `crates/victory-shader/src/emit/memory_tests.rs`. Its content will be reviewed once it is rebased onto current `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠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 base 13f91ca).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), dxil.dll from Windows SDK 10.0.26100 (the loader's default), debug.
  • cargo build --workspace --locked, then cargo 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.
  • The new tests ran and passed: table_texture_reads_at_an_offset_the_code_computes_mark_their_slot.
  • The new test sits next to heap_direct_texture_reads_mark_their_heap_index (#2571), so I also ran that one unskipped at this head: it still ends the victory-shader process with 0xc0000005 (3 of 3 runs), as on main. This PR doesn't change it.
  • --skip leaves out tests that fail on main 842b0cb on this card too, not because of this PR: heap_direct_texture_reads_mark_their_heap_index ends the victory-shader test process with 0xc0000005 (#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_views and the two stride_tests hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); gathers_at_a_level_match_the_hardware fails on lane 0 (#1744).

Not tested

  • AMD (the tests take the default adapter), a release build, the title (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-25 23:31 UTC · [original](https://github.com/Marvisak/VIctory/pull/2822#issuecomment-7177671677) Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head `03914d9` (on its base `13f91ca`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), `dxil.dll` from Windows SDK 10.0.26100 (the loader's default), debug. - `cargo build --workspace --locked`, then `cargo 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**. - The new tests ran and passed: `table_texture_reads_at_an_offset_the_code_computes_mark_their_slot`. - The new test sits next to `heap_direct_texture_reads_mark_their_heap_index` (#2571), so I also ran that one unskipped at this head: it still ends the `victory-shader` process with `0xc0000005` (3 of 3 runs), as on main. This PR doesn't change it. - `--skip` leaves out tests that fail on main `842b0cb` on this card too, not because of this PR: `heap_direct_texture_reads_mark_their_heap_index` ends the `victory-shader` test process with `0xc0000005` (#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_views` and the two `stride_tests` hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); `gathers_at_a_level_match_the_hardware` fails on lane 0 (#1744). **Not tested** - AMD (the tests take the default adapter), a release build, the title (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
This pull request has changes conflicting with the target branch.
  • crates/victory-shader/src/emit/memory_tests.rs
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.
git fetch -u origin '+refs/pull/2822/head:github-bot/gh-2822'
git switch 'github-bot/gh-2822'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2822'
git switch 'github-bot/gh-2822'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2822'
git switch 'github-bot/gh-2822'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2822'
git switch 'main'
git merge --squash 'github-bot/gh-2822'
git switch 'main'
git merge --ff-only 'github-bot/gh-2822'
git switch 'main'
git merge 'github-bot/gh-2822'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!2822
No description provided.