Iter 22: Support ResourceHeap view addresses via SLOT_VIEW_ADDRESSES (4/5 TraceShadowRays) #7

Merged
Androtim merged 1 commit from upstream-pr/7 into main 2026-11-28 21:17:09 +00:00
Androtim commented 2026-11-28 01:53:47 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-28T01:53:47Z.


Summary

Implements SLOT_VIEW_ADDRESSES (t251 in ROOT_CBV_SPACE), allowing shaders that read a buffer or ray-tracing acceleration structure descriptor from RootType::ResourceHeap dynamically solely for its 64-bit title base address (s_load_dwordx4 -> title address extraction -> SLOT_MEMORY ray traversal) to translate and execute instead of failing with a descriptor read only as data.

This unlocks 4 of the 5 remaining shadowmask:CS_TraceShadowRays_* ray-traced shadow shaders end-to-end (emit, dxil.dll validation, and D3D12 compute pipeline creation on RTX 4060 Ti) and gets the 5th past s_load_dwordx4 to an unrelated downstream error (0xae80: MASK_ELSEWHERE), eliminating all remaining "a descriptor read only as data" errors across the shader corpus:

  • Unlocked (emitted + validated + D3D12 PSO created):
    • shadowmask:CS_TraceShadowRays_Eighth_db2f6be8_Wrapped (#96ccb14ef981fd85)
    • shadowmask:CS_TraceShadowRays_Quarter_2d98e5c6_Wrapped (#0e64f14fae060d04)
    • shadowmask:CS_TraceShadowRays_Half_8988d8a5_Wrapped (#002e93a6cc2aa355)
    • shadowmask:CS_TraceShadowRays_Full_457a0336_Wrapped (#07c93bfb77fecebb)
  • Advanced to separate follow-up issue:
    • shadowmask:CS_TraceShadowRays_FullAdaptive_ae7b9cf0_Wrapped (#dbdbf36298727135) cleared s_load_dwordx4 at 0x1dc0 and reached 0xae80: emit: a lane mask holding lanes elsewhere read as data (deferred to a follow-up PR).

Changes

  • crates/victory-shader/src/emit/{shader,mod}.rs: Added and re-exported SLOT_VIEW_ADDRESSES: u8 = 251.
  • crates/victory-shader/src/emit/lower.rs: Extended Lower::view_address to handle RootType::ResourceHeap loads by emitting a clamped heap_index << 3 load of (lo, hi) from SLOT_VIEW_ADDRESSES, keeping dwords 2..3 marked Val::Missing(OTHER).
  • crates/victory-gpu/src/pipeline/host.rs: Added SLOT_VIEW_ADDRESSES to the host-owned root SRV list (ours) alongside SLOT_STRIDES, SLOT_TABLE_STRIDES, and SLOT_MEMORY.
  • crates/victory-gpu/src/descriptor/host.rs: Added a 16 MiB system-upload addresses table (SLOT_STRIDES_COUNT * 8 bytes, zero VRAM) per non-sampler HostHeap, updated via write_address across note_buffer, unmake, make_at, make_listed (ListView), make_null, raw_at, null_raw_at, raw_uav_at, null_raw_uav_at, and constant_at.
  • crates/victory-gpu/src/draw.rs: Bound SLOT_VIEW_ADDRESSES via heap_addresses without triggering a full bindless buffer/texture sweep.
  • Unit tests: Added emit::valu_tests::resource_heap_view_address_roundtrip (hardware + WARP) and descriptor::host::tests::note_buffer_populates_and_clears_view_address_table.

Rig Specs Tested On

  • CPU: Intel Core i7-13700F (13th Gen)
  • GPU & VRAM: NVIDIA GeForce RTX 4060 Ti (8 GiB VRAM)
  • System RAM: 32 GiB (33,304,932 KiB)
  • OS & GPU Driver: Windows 11 Home 10.0.26300 / NVIDIA Driver 32.0.16.2124

Run Settings & Profile

  • Build & Commit SHA: diag & release (RUSTFLAGS='-C link-self-contained=yes') @ branch feat/iter22-resource-heap-view-addresses
  • Console Profile & Internal Resolution / Scale: series-s (unattended launch smoke test via verify-live.ps1)
  • Ray Tracing: Offline pipeline verification with VICTORY_HOST_MAX_WAVE=32; live unattended smoke test uses standard preset (VICTORY_EARLY_DEPTH=1, no RT structure builder in open-world gameplay tested here)
  • Upscaling: DLSS quality (VICTORY_DLSS=1, VICTORY_DLSS_MODE=quality, Streamline loaded)
  • Frame Generation: off
  • Launcher Command / Preset & Extra VICTORY_* Overrides: Offline corpus check via victory.exe translate ... --validate --pipelines --list with VICTORY_HOST_MAX_WAVE=32 and VICTORY_TRANSLATE_ONLY=002e93a6cc2aa355,0e64f14fae060d04,dbdbf36298727135,96ccb14ef981fd85,07c93bfb77fecebb; live smoke test via verify-live.ps1 (menu/intro telemetry only — interactive RT shadow gameplay has NOT been playtested on this branch).
  • Scene / Area & Session Length: Unattended 38s smoke test (11 draws/frame, 3 active windows) + offline shader translation/pipeline verification.

Measurements & Verification

  • Base FPS (without Frame Gen): 30.0 fps (33.3 ms/frame) in unattended menu smoke test (11 draws/frame, 0 dropped)
  • Frame-Gen FPS (if enabled): N/A (off)
  • VRAM / RAM Usage: Unattended smoke test (182 MB indexed textures uploaded, 0 unmapped)
  • Crashes / DRED Resets: 0 (verify-live.ps1 7/7 [PASS], non_system_mingw_dlls=0 on both diag and release)
  • Offline Shader Translation + DXIL Validation + D3D12 Pipelines (RTX 4060 Ti):
    • 4 emitted, 4 validated (dxil.dll 10.0.22000.0), 4 pipelines created of 5 (Eighth, Quarter, Half, Full), FullAdaptive cleared s_load_dwordx4 and hit 0xae80: a lane mask holding lanes elsewhere read as data.
  • Automated Checks:
    • cargo +1.98.1-x86_64-pc-windows-gnu run -p xtask -- policy (294 files ok)
    • cargo +1.98.1-x86_64-pc-windows-gnu test -p xtask (6 passed; 0 failed)
    • cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets -- -D warnings (0 warnings)
    • cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --features diagnostics -- -D warnings (0 warnings)
    • cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-shader -- valu_tests::resource_heap_view_address_roundtrip (1 passed; 0 failed, hardware + WARP; note full local victory-shader run had 287 passed; 3 failed due to pre-existing local Windows SDK 10.0.22000.0\x64\dxil.dll PSV0 rejections in untouched barycentric_tests / rect::tests)
    • cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu -- --test-threads=1 (449 passed; 0 failed; 36 ignored, including new note_buffer_populates_and_clears_view_address_table)
<!-- greyfinch-sync:Androtim/MiniVI:issue:5535557831 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/7). Originally posted by [Androtim](https://github.com/Androtim) on 2026-11-28T01:53:47Z. --- ## Summary Implements `SLOT_VIEW_ADDRESSES` (`t251` in `ROOT_CBV_SPACE`), allowing shaders that read a buffer or ray-tracing acceleration structure descriptor from `RootType::ResourceHeap` dynamically solely for its 64-bit title base address (`s_load_dwordx4` -> title address extraction -> `SLOT_MEMORY` ray traversal) to translate and execute instead of failing with `a descriptor read only as data`. This unlocks **4 of the 5** remaining `shadowmask:CS_TraceShadowRays_*` ray-traced shadow shaders end-to-end (emit, `dxil.dll` validation, and D3D12 compute pipeline creation on RTX 4060 Ti) and gets the 5th past `s_load_dwordx4` to an unrelated downstream error (`0xae80`: `MASK_ELSEWHERE`), eliminating all remaining `"a descriptor read only as data"` errors across the shader corpus: - **Unlocked (emitted + validated + D3D12 PSO created):** - `shadowmask:CS_TraceShadowRays_Eighth_db2f6be8_Wrapped` (`#96ccb14ef981fd85`) - `shadowmask:CS_TraceShadowRays_Quarter_2d98e5c6_Wrapped` (`#0e64f14fae060d04`) - `shadowmask:CS_TraceShadowRays_Half_8988d8a5_Wrapped` (`#002e93a6cc2aa355`) - `shadowmask:CS_TraceShadowRays_Full_457a0336_Wrapped` (`#07c93bfb77fecebb`) - **Advanced to separate follow-up issue:** - `shadowmask:CS_TraceShadowRays_FullAdaptive_ae7b9cf0_Wrapped` (`#dbdbf36298727135`) cleared `s_load_dwordx4` at `0x1dc0` and reached `0xae80: emit: a lane mask holding lanes elsewhere read as data` (deferred to a follow-up PR). ### Changes - `crates/victory-shader/src/emit/{shader,mod}.rs`: Added and re-exported `SLOT_VIEW_ADDRESSES: u8 = 251`. - `crates/victory-shader/src/emit/lower.rs`: Extended `Lower::view_address` to handle `RootType::ResourceHeap` loads by emitting a clamped `heap_index << 3` load of `(lo, hi)` from `SLOT_VIEW_ADDRESSES`, keeping dwords `2..3` marked `Val::Missing(OTHER)`. - `crates/victory-gpu/src/pipeline/host.rs`: Added `SLOT_VIEW_ADDRESSES` to the host-owned root SRV list (`ours`) alongside `SLOT_STRIDES`, `SLOT_TABLE_STRIDES`, and `SLOT_MEMORY`. - `crates/victory-gpu/src/descriptor/host.rs`: Added a 16 MiB system-upload `addresses` table (`SLOT_STRIDES_COUNT * 8` bytes, zero VRAM) per non-sampler `HostHeap`, updated via `write_address` across `note_buffer`, `unmake`, `make_at`, `make_listed` (`ListView`), `make_null`, `raw_at`, `null_raw_at`, `raw_uav_at`, `null_raw_uav_at`, and `constant_at`. - `crates/victory-gpu/src/draw.rs`: Bound `SLOT_VIEW_ADDRESSES` via `heap_addresses` without triggering a full bindless buffer/texture sweep. - Unit tests: Added `emit::valu_tests::resource_heap_view_address_roundtrip` (hardware + WARP) and `descriptor::host::tests::note_buffer_populates_and_clears_view_address_table`. ## Rig Specs Tested On - **CPU:** Intel Core i7-13700F (13th Gen) - **GPU & VRAM:** NVIDIA GeForce RTX 4060 Ti (8 GiB VRAM) - **System RAM:** 32 GiB (`33,304,932` KiB) - **OS & GPU Driver:** Windows 11 Home `10.0.26300` / NVIDIA Driver `32.0.16.2124` ## Run Settings & Profile - **Build & Commit SHA:** `diag` & `release` (`RUSTFLAGS='-C link-self-contained=yes'`) @ branch `feat/iter22-resource-heap-view-addresses` - **Console Profile & Internal Resolution / Scale:** `series-s` (unattended launch smoke test via `verify-live.ps1`) - **Ray Tracing:** Offline pipeline verification with `VICTORY_HOST_MAX_WAVE=32`; live unattended smoke test uses standard preset (`VICTORY_EARLY_DEPTH=1`, no RT structure builder in open-world gameplay tested here) - **Upscaling:** `DLSS quality` (`VICTORY_DLSS=1`, `VICTORY_DLSS_MODE=quality`, `Streamline` loaded) - **Frame Generation:** `off` - **Launcher Command / Preset & Extra `VICTORY_*` Overrides:** Offline corpus check via `victory.exe translate ... --validate --pipelines --list` with `VICTORY_HOST_MAX_WAVE=32` and `VICTORY_TRANSLATE_ONLY=002e93a6cc2aa355,0e64f14fae060d04,dbdbf36298727135,96ccb14ef981fd85,07c93bfb77fecebb`; live smoke test via `verify-live.ps1` (menu/intro telemetry only — interactive RT shadow gameplay has NOT been playtested on this branch). - **Scene / Area & Session Length:** Unattended 38s smoke test (`11 draws/frame`, 3 active windows) + offline shader translation/pipeline verification. ## Measurements & Verification - **Base FPS (without Frame Gen):** `30.0 fps` (`33.3 ms/frame`) in unattended menu smoke test (`11 draws/frame`, `0 dropped`) - **Frame-Gen FPS (if enabled):** N/A (`off`) - **VRAM / RAM Usage:** Unattended smoke test (`182 MB` indexed textures uploaded, 0 unmapped) - **Crashes / DRED Resets:** `0` (`verify-live.ps1` 7/7 `[PASS]`, `non_system_mingw_dlls=0` on both `diag` and `release`) - **Offline Shader Translation + DXIL Validation + D3D12 Pipelines (RTX 4060 Ti):** - `4 emitted, 4 validated (dxil.dll 10.0.22000.0), 4 pipelines created` of 5 (`Eighth`, `Quarter`, `Half`, `Full`), `FullAdaptive` cleared `s_load_dwordx4` and hit `0xae80: a lane mask holding lanes elsewhere read as data`. - **Automated Checks:** - [x] `cargo +1.98.1-x86_64-pc-windows-gnu run -p xtask -- policy` (`294 files ok`) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu test -p xtask` (`6 passed; 0 failed`) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets -- -D warnings` (`0 warnings`) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --features diagnostics -- -D warnings` (`0 warnings`) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-shader -- valu_tests::resource_heap_view_address_roundtrip` (`1 passed; 0 failed`, hardware + WARP; note full local `victory-shader` run had `287 passed; 3 failed` due to pre-existing local Windows SDK `10.0.22000.0\x64\dxil.dll` PSV0 rejections in untouched `barycentric_tests` / `rect::tests`) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu -- --test-threads=1` (`449 passed; 0 failed; 36 ignored`, including new `note_buffer_populates_and_clears_view_address_table`)
Androtim commented 2026-11-28 01:59:14 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-28T01:59:14Z.


Verification complete for PR #7 (a0e88f):

  • GitHub Actions CI (46095385463): success (Clippy, Clippy diagnostics, Tests)
  • Standalone diag &
    elease binaries (RUSTFLAGS='-C link-self-contained=yes'):
    on_system_mingw_dlls=0 on both
  • Offline shader verification (VICTORY_HOST_MAX_WAVE=32, --validate --pipelines): 4/5 shadowmask:CS_TraceShadowRays_* (Eighth, Quarter, Half, Full) emitted, validated with dxil.dll 10.0.22000.0, and created D3D12 pipelines on RTX 4060 Ti (FullAdaptive cleared s_load_dwordx4 and reached downstream
<!-- greyfinch-sync:Androtim/MiniVI:comment:7232050431 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/7#issuecomment-7232050431). Originally posted by [Androtim](https://github.com/Androtim) on 2026-11-28T01:59:14Z. --- Verification complete for PR #7 (a0e88f): - GitHub Actions CI (46095385463): **success** (Clippy, Clippy diagnostics, Tests) - Standalone diag & elease binaries (RUSTFLAGS='-C link-self-contained=yes'): on_system_mingw_dlls=0 on both - Offline shader verification (VICTORY_HOST_MAX_WAVE=32, --validate --pipelines): **4/5** shadowmask:CS_TraceShadowRays_* (Eighth, Quarter, Half, Full) emitted, validated with dxil.dll 10.0.22000.0, and created D3D12 pipelines on RTX 4060 Ti (FullAdaptive cleared s_load_dwordx4 and reached downstream
Androtim commented 2026-11-28 02:03:46 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-28T02:03:46Z.


Automated triage for the maintainers (not an approval).

Verdict: needs-gpu-test · CI (check): passing

Review Summary

Logic, memory safety, and test coverage look solid. The implementation cleanly mirrors the existing SLOT_STRIDES / SLOT_TABLE_STRIDES pattern without triggering the full bindless heap sweep:

  • Shader lowering (crates/victory-shader/src/emit/{shader,mod,lower}.rs): Adds SLOT_VIEW_ADDRESSES (t251) and extends Lower::view_address for RootType::ResourceHeap to clamp heap_index(site, 0, false) against SLOT_STRIDES_COUNT - 1 (matching Lower::memory), shift by 3, and load (lo, hi) via rawBufferLoad.f32. Verified by valu_tests::resource_heap_view_address_roundtrip (including asserting SLOT_STRIDES is not requested).
  • Host descriptor table & binding (crates/victory-gpu/src/descriptor/host.rs, crates/victory-gpu/src/pipeline/host.rs, crates/victory-gpu/src/draw.rs):
    • Allocates a zero-initialized SLOT_STRIDES_COUNT * 8 (16 MiB) upload buffer per non-sampler HostHeap and keeps it in sync via HostHeap::write_address across note_buffer, unmake, make_at, make_listed (ListView), make_null, raw_at, null_raw_at, raw_uav_at, null_raw_uav_at, and constant_at.
    • Intentionally writes view_address(view) in make_at even when make_twinned returns None (e.g., TLAS views that fall back to null host SRVs while still providing their 64-bit title address for SLOT_MEMORY traversal), covered by note_buffer_populates_and_clears_view_address_table.
    • Registers SLOT_VIEW_ADDRESSES in HostPipeline's ours list and binds it in State::heap_addresses with list.first_use(gpu as usize | 1) + list.keep(buffer) (distinct GPU VA from strides, so no key collision with heap_buffers/heap_strides).

Verdict: needs-gpu-test

CI is passing and no code defects were found, but because this PR modifies DXIL shader lowering, D3D12 root signature/SRV binding, and per-heap upload tables for RT shadow shaders (shadowmask:CS_TraceShadowRays_*)—and the PR notes interactive RT shadow gameplay has not yet been playtested—a local real-GPU test with active RT shadows is recommended before merging. (This is an automated triage review, not formal maintainer approval.)


Generated with Antigravity CLI (agy).

<!-- greyfinch-sync:Androtim/MiniVI:comment:7232103649 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/7#issuecomment-7232103649). Originally posted by [Androtim](https://github.com/Androtim) on 2026-11-28T02:03:46Z. --- <!-- minivi-triage v1 head=aa0e88fcb55c08e371b4809a31e85920b33035ac verdict=needs-gpu-test ci=passing at=2026-11-28T02:04:13Z --> Automated triage for the maintainers (not an approval). **Verdict:** `needs-gpu-test` · **CI (`check`):** `passing` ### Review Summary Logic, memory safety, and test coverage look solid. The implementation cleanly mirrors the existing `SLOT_STRIDES` / `SLOT_TABLE_STRIDES` pattern without triggering the full bindless heap sweep: - **Shader lowering (`crates/victory-shader/src/emit/{shader,mod,lower}.rs`)**: Adds `SLOT_VIEW_ADDRESSES` (`t251`) and extends `Lower::view_address` for `RootType::ResourceHeap` to clamp `heap_index(site, 0, false)` against `SLOT_STRIDES_COUNT - 1` (matching `Lower::memory`), shift by 3, and load `(lo, hi)` via `rawBufferLoad.f32`. Verified by `valu_tests::resource_heap_view_address_roundtrip` (including asserting `SLOT_STRIDES` is not requested). - **Host descriptor table & binding (`crates/victory-gpu/src/descriptor/host.rs`, `crates/victory-gpu/src/pipeline/host.rs`, `crates/victory-gpu/src/draw.rs`)**: - Allocates a zero-initialized `SLOT_STRIDES_COUNT * 8` (16 MiB) upload buffer per non-sampler `HostHeap` and keeps it in sync via `HostHeap::write_address` across `note_buffer`, `unmake`, `make_at`, `make_listed` (`ListView`), `make_null`, `raw_at`, `null_raw_at`, `raw_uav_at`, `null_raw_uav_at`, and `constant_at`. - Intentionally writes `view_address(view)` in `make_at` even when `make_twinned` returns `None` (e.g., TLAS views that fall back to null host SRVs while still providing their 64-bit title address for `SLOT_MEMORY` traversal), covered by `note_buffer_populates_and_clears_view_address_table`. - Registers `SLOT_VIEW_ADDRESSES` in `HostPipeline`'s `ours` list and binds it in `State::heap_addresses` with `list.first_use(gpu as usize | 1)` + `list.keep(buffer)` (distinct GPU VA from `strides`, so no key collision with `heap_buffers`/`heap_strides`). ### Verdict: `needs-gpu-test` CI is passing and no code defects were found, but because this PR modifies DXIL shader lowering, D3D12 root signature/SRV binding, and per-heap upload tables for RT shadow shaders (`shadowmask:CS_TraceShadowRays_*`)—and the PR notes interactive RT shadow gameplay has not yet been playtested—a local real-GPU test with active RT shadows is recommended before merging. (This is an automated triage review, not formal maintainer approval.) --- _Generated with Antigravity CLI (`agy`)._
Androtim commented 2026-11-28 21:11:19 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-28T21:11:19Z.


Real-GPU Playtest Report (Combined Build 1 Stack — RT ON)

Tested in combined Build 1 (origin/main + Build 1 PRs including #3, #4, #7, #10) on NVIDIA GeForce RTX 4060 Ti (8 GB), Windows, Series S (quality-720p, DLSS Quality, -RayTracing):

  • Duration & Stability: 7-minute RT-ON open-world session (1c-build1-rt.log) — 0 crashes, 0 DRED resets, clean exit.
  • Performance: 7.6 fps (132.2 ms/frame, 4,022 draws/frame).
  • RT / Memory Telemetry:
    • Active RT/BVH builds (12,653 pages / 790 MB across 13 arenas, 98 build dispatches/frame).
    • 0 "a shader reads view addresses without a view heap set" warnings.
    • 1,374 DLSS upscalings (0 failed); VRAM stayed bounded (6,460 MB in use, 554 MB free across 27 texture blocks).
<!-- greyfinch-sync:Androtim/MiniVI:comment:7245835751 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/7#issuecomment-7245835751). Originally posted by [Androtim](https://github.com/Androtim) on 2026-11-28T21:11:19Z. --- ### Real-GPU Playtest Report (Combined Build 1 Stack — RT ON) Tested in combined Build 1 (`origin/main` + Build 1 PRs including `#3, #4, #7, #10`) on **NVIDIA GeForce RTX 4060 Ti (8 GB), Windows, Series S (`quality-720p`, DLSS Quality, `-RayTracing`)**: - **Duration & Stability:** **7-minute** RT-ON open-world session (`1c-build1-rt.log`) — **0 crashes, 0 DRED resets**, clean exit. - **Performance:** `7.6 fps` (`132.2 ms/frame`, `4,022` draws/frame). - **RT / Memory Telemetry:** - Active RT/BVH builds (`12,653` pages / `790 MB` across `13` arenas, `98` build dispatches/frame). - `0` `"a shader reads view addresses without a view heap set"` warnings. - `1,374` DLSS upscalings (`0` failed); VRAM stayed bounded (`6,460 MB` in use, `554 MB` free across `27` texture blocks).
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Androtim/MiniVI!7
No description provided.