Shaders: bound root view accesses by the size the host binds #650

Closed
github-bot wants to merge 1 commit from gh-pr/650/head into gh-pr/650/base
Owner

@⁠wbkepler on GitHub · 2026-11-24 06:12 UTC · original
wbkepler:shader/root-view-bounds → main · +336 −6 · 4 files · 1 commits · closed without merging

What

A root SRV or CBV has no bounds on the host. Any shader access past the memory the host mapped there is a GPU page fault. The console's buffer views have record counts, so a console program never faults on these. But the offsets come from title data, and when the host has not mirrored that data (zeros, stale memory) the reads land far outside the view.

  • victory-shader: for each root view a program accesses, Lower::root_view_size reads the view's byte size from the user-data dword of the view's address. That dword is otherwise unused, because the view itself is bound as a root argument. The lowering records it as a new UserData entry with root: Descriptor. Every access through a root view checks the bytes it touches against that size: raw buffer_* loads, stores and atomics, the raw loads behind tbuffer_load_format_* and buffer_load_format_*, global_load_*, per-lane constant-buffer reads and scalar s_buffer_load_*. Past the size, reads give 0 and writes are dropped, as for a console view past its records. An out-of-range access goes to offset 0 instead, so the hardware never touches memory past the view.
  • victory-gpu: State::root_view_bytes fills that dword with what root_view binds there: up to 1 MiB for SRVs and 64 KiB for CBVs (the new root_view_len), or 0 when the title set no view.

Why

Translated programs were replayed on an RTX 5090 with synthetic data (hardware probe, not part of this PR):

  • A small mesh dispatch hangs the GPU. Several wave64 mesh programs that read their vertex streams through a root SRV with tbuffer_load_format_*, given nonzero data, removed the device as hung (DXGI_ERROR_DEVICE_HUNG) after 3.7 s, every time.
  • One dword decides it. Bisecting the root view's contents pinned the hang to a single dword: a field that becomes the byte offset of a later formatted load. A stray value makes that load read megabytes past the view.
  • The GPU stalls on the fault instead of reporting it. A single out-of-range root SRV read 1 GB past its buffer stalled the GPU for 10.7 s with no DRED page-fault report.
  • With this change the same replays finish. All those programs complete in about 35 ms with every fill value tried.

In the world, these are the mesh hangs that #578 currently avoids by refusing wave64 mesh programs on 32-lane hosts. They are not about the wave size.

Tests

  • New WARP and hardware test root_view_reads_stop_at_the_bound_size. A program builds a buffer descriptor around a root SRV address and reads at offsets inside, at and past the bound size. The test checks the reads past it give 0 even where the bound buffer holds data, and that the size is a Descriptor user-data entry. Passes on an RTX 5090 and on WARP.
  • The PC-compiler diff test fills the new user data.
  • cargo clippy --workspace --all-targets, cargo clippy -p victory --features diagnostics --all-targets, cargo test --workspace, cargo xtask policy: pass. The remaining clippy warnings are already on main.

Not covered: root UAVs, which main does not bind yet. Open PR #294 adds them, and its root UAV accesses take the same check once both land.

🤖 Generated with Claude Code

**@⁠wbkepler** on GitHub · 2026-11-24 06:12 UTC · [original](https://github.com/Marvisak/VIctory/pull/650) `wbkepler:shader/root-view-bounds` → `main` · +336 −6 · 4 files · 1 commits · closed without merging ## What A root SRV or CBV has no bounds on the host. Any shader access past the memory the host mapped there is a GPU page fault. The console's buffer views have record counts, so a console program never faults on these. But the offsets come from title data, and when the host has not mirrored that data (zeros, stale memory) the reads land far outside the view. - **victory-shader:** for each root view a program accesses, `Lower::root_view_size` reads the view's byte size from the user-data dword of the view's address. That dword is otherwise unused, because the view itself is bound as a root argument. The lowering records it as a new `UserData` entry with `root: Descriptor`. Every access through a root view checks the bytes it touches against that size: raw `buffer_*` loads, stores and atomics, the raw loads behind `tbuffer_load_format_*` and `buffer_load_format_*`, `global_load_*`, per-lane constant-buffer reads and scalar `s_buffer_load_*`. Past the size, reads give 0 and writes are dropped, as for a console view past its records. An out-of-range access goes to offset 0 instead, so the hardware never touches memory past the view. - **victory-gpu:** `State::root_view_bytes` fills that dword with what `root_view` binds there: up to 1 MiB for SRVs and 64 KiB for CBVs (the new `root_view_len`), or 0 when the title set no view. ## Why Translated programs were replayed on an RTX 5090 with synthetic data (hardware probe, not part of this PR): - **A small mesh dispatch hangs the GPU.** Several wave64 mesh programs that read their vertex streams through a root SRV with `tbuffer_load_format_*`, given nonzero data, removed the device as hung (DXGI_ERROR_DEVICE_HUNG) after 3.7 s, every time. - **One dword decides it.** Bisecting the root view's contents pinned the hang to a single dword: a field that becomes the byte offset of a later formatted load. A stray value makes that load read megabytes past the view. - **The GPU stalls on the fault instead of reporting it.** A single out-of-range root SRV read 1 GB past its buffer stalled the GPU for 10.7 s with no DRED page-fault report. - **With this change the same replays finish.** All those programs complete in about 35 ms with every fill value tried. In the world, these are the mesh hangs that #578 currently avoids by refusing wave64 mesh programs on 32-lane hosts. They are not about the wave size. ## Tests - New WARP and hardware test `root_view_reads_stop_at_the_bound_size`. A program builds a buffer descriptor around a root SRV address and reads at offsets inside, at and past the bound size. The test checks the reads past it give 0 even where the bound buffer holds data, and that the size is a `Descriptor` user-data entry. Passes on an RTX 5090 and on WARP. - The PC-compiler diff test fills the new user data. - `cargo clippy --workspace --all-targets`, `cargo clippy -p victory --features diagnostics --all-targets`, `cargo test --workspace`, `cargo xtask policy`: pass. The remaining clippy warnings are already on `main`. Not covered: root UAVs, which `main` does not bind yet. Open PR #294 adds them, and its root UAV accesses take the same check once both land. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A root SRV or CBV has no bounds on the host: a shader access past the
memory the host mapped there is a GPU page fault. The console's buffer
views of the same memory have record counts, and the offsets come from
title data the host may not have mirrored (zeros, stale memory), so such
accesses happen. Some hosts' GPUs stall on the fault until the driver
resets the device as hung: a mesh dispatch of a program that reads its
vertex streams through a root view with a formatted load hangs an
RTX 5090 and the device is removed.

The host now passes each root view's byte size in the user-data dword of
its address (which the shader never reads, the view being bound as a root
argument), and every raw, formatted and constant access through a root
view checks the bytes it touches against it: reads past it give 0, writes
are dropped, as for a console view past its records.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:11:34 +00:00
github-bot closed this pull request 2026-11-26 04:11:34 +00:00
Author
Owner

@⁠ghost on GitHub · 2026-11-24 11:27 UTC · original

In-game AMD data point (RX 9060 XT): with this PR, #294's root-UAV programs run without the device hang it otherwise causes 25–31 s into the world (2 runs each, with and without this merge in MichaelSmithAI's afa5bdc). Details: #294

AI-assisted (Claude Code, Claude Opus 5.5); no game data.

**@⁠ghost** on GitHub · 2026-11-24 11:27 UTC · [original](https://github.com/Marvisak/VIctory/pull/650#issuecomment-7130113561) In-game AMD data point (RX 9060 XT): with this PR, #294's root-UAV programs run without the device hang it otherwise causes 25–31 s into the world (2 runs each, with and without this merge in MichaelSmithAI's `afa5bdc`). Details: https://git.gtahub.st/github/Marvisak--VIctory/pulls/294 AI-assisted (Claude Code, Claude Opus 5.5); no game data.
Author
Owner

@⁠banbanzhige on GitHub · 2026-11-24 11:51 UTC · original

Great root-cause work on the root-view page-fault hangs! I merged 06657a8 locally onto current main (ffe310e) on Windows 11 (Rust 1.98.1, SDK 10.0.26100.0 dxil.dll, 32-lane SM 6.6 hardware GPU + WARP) and did a line-by-line review of the bounds logic.

Verification on ffe310e + #650

  • cargo clippy --workspace --all-targets --locked -- -D warnings: pass
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: pass
  • cargo test -p victory-shader --locked -- --test-threads=1: 121 passed, 0 failed, 1 ignored (including root_view_reads_stop_at_the_bound_size on both hardware and WARP)
  • cargo test -p victory-gpu --locked -- --test-threads=1: 50 passed, 0 failed, 1 ignored
  • cargo xtask policy: 154 files ok
  • Full retail shader corpus (victory translate --validate --pipelines, 26,599 containers / 26,148 programs) vs clean main (ffe310e): 0 regressions (VS/PS 12,243 / 12,167 / 12,243, CS 1,441 / 1,417 / 1,121, MS 8,214 / 8,152 / 8,214 — identical to ffe310e).

Technical findings in the current patch

  1. tbuffer_load_format_* hardcoding bytes = 16 silently zeroes valid tail elements (lower.rs, buffer()):

    • let bytes = if format.is_some() { 16 } else { 4 * count }; assumes every formatted load reads 16 bytes, but 13 of the 14 GFX10 families in buffer_format() are narrower (4, 8, or 12 bytes, plus sub-dword formats that format_load() reads as 4 bytes at off & !3).
    • Any valid read within the last 16 - actual_bytes bytes of a root SRV (e.g. the last element of a 32_32_32 / 16_16_16_16 / 8_8_8_8 stream) fails in_root_view(size, off, 16) and gets replaced with 0.
    • Using buffer_format(f) to compute the actual span ((off & !3, 4) when total < 32, else (off, total / 8)) matches what format_load actually loads.
  2. Load paths still unconditionally execute at offset 0 when size == 0 or 0 < size < bytes (lower.rs):

    • Stores and atomics guard execution via begin_guarded(self.narrow(guard, root_ok)), but all load paths (flat, smem, buffer CBV / formatted / raw) rewrite out-of-range offsets to 0 and still issue rawBufferLoad / cbufferLoadLegacy before zero_unless(ok, x).
    • Two cases still touch invalid memory:
      • When size == 0 (State::root_view_bytes explicitly returns 0 for an unset/unshadowed root view, and State::bind skips Set*Root*View), offset 0 still dereferences an unbound/stale root descriptor.
      • When 0 < size < bytes (e.g. an 8-byte tail with a 16-byte dwordx4 load, or < 16 bytes with cbufferLoadLegacy fetching a 16-byte row), ok is false so at = 0, and the hardware still issues a bytes-wide read past the end of the buffer.
    • Branching around the load with begin_guarded (yielding 0 from end_guarded) avoids touching the descriptor in both cases.
  3. Constant-offset s_buffer_load_dword* on root CBVs is unchecked (lower.rs, smem()):

    • The None => (dynamic offset) arm checks size, but the Some(base) => (constant offset) arm was left unchecked — so static-offset scalar reads from an unset or smaller-than-expected root CBV bypass bounds checking.
  4. 32-bit offset wraparound in multi-dword per-dword loops (lower.rs, smem() SRV/CBV dynamic & buffer() CBV):

    • Computing a = addr + 4 * k per iteration and checking in_root_view(size, a, 4) wraps on high offsets: e.g. for addr = u32::MAX - 3 (0xFFFF_FFFC) and count >= 2, k = 0 yields 0, but k = 1 wraps to a = 0, passing in_root_view(size, 0, 4) and returning dword 0 of the buffer instead of 0.
  5. Minor host-side & rebase notes against main (ffe310e):

    • In draw.rs, State::bind fills root_view_bytes before calling root_view; for an unaligned root CBV (!srv && gpu % 256 != 0), if list.scratch(len) returns None and binding is skipped, the shader still receives a non-zero size.
    • Rebase onto ffe310e: valu_tests.rs has a tail conflict, resource::track now takes 4 arguments (Some(&st) from #566), and root_view_reads_stop_at_the_bound_size should lock ONE_AT_A_TIME before creating Host::new so it doesn't race with parallel GPU tests.

AI-assisted review; all tests and corpus checks run locally on my machine, no game data included.

**@⁠banbanzhige** on GitHub · 2026-11-24 11:51 UTC · [original](https://github.com/Marvisak/VIctory/pull/650#issuecomment-7130649137) Great root-cause work on the root-view page-fault hangs! I merged `06657a8` locally onto current `main` (`ffe310e`) on Windows 11 (Rust 1.98.1, SDK `10.0.26100.0` `dxil.dll`, 32-lane SM 6.6 hardware GPU + WARP) and did a line-by-line review of the bounds logic. ### Verification on `ffe310e` + `#650` - `cargo clippy --workspace --all-targets --locked -- -D warnings`: pass - `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings`: pass - `cargo test -p victory-shader --locked -- --test-threads=1`: **121 passed, 0 failed, 1 ignored** (including `root_view_reads_stop_at_the_bound_size` on both hardware and WARP) - `cargo test -p victory-gpu --locked -- --test-threads=1`: **50 passed, 0 failed, 1 ignored** - `cargo xtask policy`: **154 files ok** - Full retail shader corpus (`victory translate --validate --pipelines`, 26,599 containers / 26,148 programs) vs clean `main` (`ffe310e`): **0 regressions** (VS/PS `12,243 / 12,167 / 12,243`, CS `1,441 / 1,417 / 1,121`, MS `8,214 / 8,152 / 8,214` — identical to `ffe310e`). ### Technical findings in the current patch 1. **`tbuffer_load_format_*` hardcoding `bytes = 16` silently zeroes valid tail elements** (`lower.rs`, `buffer()`): - `let bytes = if format.is_some() { 16 } else { 4 * count };` assumes every formatted load reads 16 bytes, but 13 of the 14 GFX10 families in `buffer_format()` are narrower (4, 8, or 12 bytes, plus sub-dword formats that `format_load()` reads as 4 bytes at `off & !3`). - Any valid read within the last `16 - actual_bytes` bytes of a root SRV (e.g. the last element of a `32_32_32` / `16_16_16_16` / `8_8_8_8` stream) fails `in_root_view(size, off, 16)` and gets replaced with `0`. - Using `buffer_format(f)` to compute the actual span (`(off & !3, 4)` when `total < 32`, else `(off, total / 8)`) matches what `format_load` actually loads. 2. **Load paths still unconditionally execute at offset `0` when `size == 0` or `0 < size < bytes`** (`lower.rs`): - Stores and atomics guard execution via `begin_guarded(self.narrow(guard, root_ok))`, but all load paths (`flat`, `smem`, `buffer` CBV / formatted / raw) rewrite out-of-range offsets to `0` and still issue `rawBufferLoad` / `cbufferLoadLegacy` before `zero_unless(ok, x)`. - Two cases still touch invalid memory: - When `size == 0` (`State::root_view_bytes` explicitly returns `0` for an unset/unshadowed root view, and `State::bind` skips `Set*Root*View`), offset `0` still dereferences an unbound/stale root descriptor. - When `0 < size < bytes` (e.g. an 8-byte tail with a 16-byte `dwordx4` load, or `< 16` bytes with `cbufferLoadLegacy` fetching a 16-byte row), `ok` is false so `at = 0`, and the hardware still issues a `bytes`-wide read past the end of the buffer. - Branching around the load with `begin_guarded` (yielding `0` from `end_guarded`) avoids touching the descriptor in both cases. 3. **Constant-offset `s_buffer_load_dword*` on root CBVs is unchecked** (`lower.rs`, `smem()`): - The `None =>` (dynamic offset) arm checks `size`, but the `Some(base) =>` (constant offset) arm was left unchecked — so static-offset scalar reads from an unset or smaller-than-expected root CBV bypass bounds checking. 4. **32-bit offset wraparound in multi-dword per-dword loops** (`lower.rs`, `smem()` SRV/CBV dynamic & `buffer()` CBV): - Computing `a = addr + 4 * k` per iteration and checking `in_root_view(size, a, 4)` wraps on high offsets: e.g. for `addr = u32::MAX - 3` (`0xFFFF_FFFC`) and `count >= 2`, `k = 0` yields `0`, but `k = 1` wraps to `a = 0`, passing `in_root_view(size, 0, 4)` and returning dword 0 of the buffer instead of `0`. 5. **Minor host-side & rebase notes against `main` (`ffe310e`)**: - In `draw.rs`, `State::bind` fills `root_view_bytes` before calling `root_view`; for an unaligned root CBV (`!srv && gpu % 256 != 0`), if `list.scratch(len)` returns `None` and binding is skipped, the shader still receives a non-zero size. - Rebase onto `ffe310e`: `valu_tests.rs` has a tail conflict, `resource::track` now takes 4 arguments (`Some(&st)` from `#566`), and `root_view_reads_stop_at_the_bound_size` should lock `ONE_AT_A_TIME` before creating `Host::new` so it doesn't race with parallel GPU tests. _AI-assisted review; all tests and corpus checks run locally on my machine, no game data included._
Author
Owner

@⁠erLCoder on GitHub · 2026-11-24 13:06 UTC · original

Independent synthetic A/B on GTX 1660 Ti (6 GB), NVIDIA 581.42, Windows 10 22H2 build 19045.6466, Ryzen 5 3600, Rust 1.98.1 and Agility SDK 1.620.2. Both test processes confirmed NVIDIA LUID 00000000:00017c52.

A: parent d2a4bae with a port of the fixture. B: PR 06657a8 with its fixture. Both use the same 256-byte backing buffer and hardware-only adapter assertion. B receives a 64-byte logical view size. The readbacks at byte offsets 0 and 60 were 0x100 and 0x10f in both; at offsets 64 and 128, A returned 0x110 and 0x120, while B returned zero. B also returned zero at the near-maximum offset; A did not attempt that offset. Each filtered test passed 1/1, 0 failed, 0 ignored, 69 filtered out. WARP excluded.

cargo test --offline --locked -p victory-shader --features host --lib root_view_reads_stop_at_the_bound_size -- --nocapture --test-threads=1

This tests synthetic compute raw-SRV loads and GPU readback. Stores, atomics, in-game host size calculation, DispatchMesh hangs and image quality remain untested. Codex prepared the worktrees and fixtures, ran the tests and drafted this report.

**@⁠erLCoder** on GitHub · 2026-11-24 13:06 UTC · [original](https://github.com/Marvisak/VIctory/pull/650#issuecomment-7132367082) Independent synthetic A/B on GTX 1660 Ti (6 GB), NVIDIA 581.42, Windows 10 22H2 build 19045.6466, Ryzen 5 3600, Rust 1.98.1 and Agility SDK 1.620.2. Both test processes confirmed NVIDIA LUID 00000000:00017c52. A: parent d2a4bae with a port of the fixture. B: PR 06657a8 with its fixture. Both use the same 256-byte backing buffer and hardware-only adapter assertion. B receives a 64-byte logical view size. The readbacks at byte offsets 0 and 60 were 0x100 and 0x10f in both; at offsets 64 and 128, A returned 0x110 and 0x120, while B returned zero. B also returned zero at the near-maximum offset; A did not attempt that offset. Each filtered test passed 1/1, 0 failed, 0 ignored, 69 filtered out. WARP excluded. `cargo test --offline --locked -p victory-shader --features host --lib root_view_reads_stop_at_the_bound_size -- --nocapture --test-threads=1` This tests synthetic compute raw-SRV loads and GPU readback. Stores, atomics, in-game host size calculation, DispatchMesh hangs and image quality remain untested. Codex prepared the worktrees and fixtures, ran the tests and drafted this report.
Author
Owner

@⁠Ilokaxt on GitHub · 2026-11-24 14:27 UTC · original

On an RTX 3070 Ti Laptop (wave lanes 32..32, NVIDIA driver 610.88, Windows 11 build 26300), this PR removes the mesh-shader hangs in the world that #587 alone did not (see my correction on #587).

Tree: main ffe310e + #439 + #431 + #579 + #587 + this PR, plus a local fix that creates the device on the high-performance adapter. Diagnostics build, VICTORY_SHADER_LOOP_LIMIT=1000, DRED on, scripted Enter presses, two runs of up to 900 s.

  • Without this PR, the world hung after 3–8 minutes in DispatchMesh of mesh 4adfa13bea1c556a (MSR_VS_CascadeShadows_drawskinned) or mesh 18bbb989c875c8fb (MS_VS_TransformSkinD_NoDeform).
  • With it, both programs were bound and ran in both runs without hanging. The world ran 13.5 min and 4 min.
  • Both runs then hung on the same compute eeed82b877b44b5f (vfx_proj_decal_hit_detection:CS_ComputeHitDetectionSkinnedResults, Dispatch(12, 1, 1)). It reads the same skinned-geometry buffers (42,991,392 and 182,452,224 bytes) through table SRVs, not root views, so it is likely the same kind of out-of-range read in a path this PR does not cover. That last part is a guess, not verified.
**@⁠Ilokaxt** on GitHub · 2026-11-24 14:27 UTC · [original](https://github.com/Marvisak/VIctory/pull/650#issuecomment-7134403838) On an **RTX 3070 Ti Laptop** (wave lanes 32..32, NVIDIA driver 610.88, Windows 11 build 26300), this PR **removes the mesh-shader hangs** in the world that #587 alone did not (see my correction on #587). Tree: `main` `ffe310e` + #439 + #431 + #579 + #587 + this PR, plus a local fix that creates the device on the high-performance adapter. Diagnostics build, `VICTORY_SHADER_LOOP_LIMIT=1000`, DRED on, scripted Enter presses, two runs of up to 900 s. - Without this PR, the world hung after 3–8 minutes in `DispatchMesh` of **mesh `4adfa13bea1c556a`** (`MSR_VS_CascadeShadows_drawskinned`) or **mesh `18bbb989c875c8fb`** (`MS_VS_TransformSkinD_NoDeform`). - With it, both programs were bound and ran in both runs without hanging. The world ran **13.5 min** and **4 min**. - Both runs then hung on the same **compute `eeed82b877b44b5f`** (`vfx_proj_decal_hit_detection:CS_ComputeHitDetectionSkinnedResults`, `Dispatch(12, 1, 1)`). It reads the same skinned-geometry buffers (42,991,392 and 182,452,224 bytes) through table SRVs, not root views, so it is likely the same kind of out-of-range read in a path this PR does not cover. That last part is a guess, not verified.
Author
Owner

@⁠contatopablow-spec on GitHub · 2026-11-24 18:54 UTC · original

Independent synthetic validation on desktop RTX 3050 6 GB (Ampere), NVIDIA driver 610.88, PCI ID 10de:2584, Windows 11 Pro build 26300, i5-8400, 24 GB RAM, Rust 1.98.1.

Tested PR head 06657a8bebe86f562cf1d55796de565b9a9d329b in a separate worktree; the sole local change was non-fatal test-only adapter logging using the D3D12 device LUID.

cargo test -p victory-shader --locked --lib root_view_reads_stop_at_the_bound_size -- --nocapture --test-threads=1
NVIDIA GeForce RTX 3050 vendor=0x10de device=0x2584 warp=false
Microsoft Basic Render Driver vendor=0x1414 device=0x008c warp=true
test result: ok. 1 passed; 0 failed; 0 ignored; 69 filtered out; finished in 0.43s

The existing fixture completed on both adapters, including expected zero reads at offsets 64, 128 and u32::MAX - 3. Exit code 0. No game data used.

Scope: synthetic raw-SRV reads only; not proof of a fix for mesh dispatch hangs, stores/atomics, table SRVs or gameplay. PR head tested as-is apart from adapter logging, not merged onto current main. AI-assisted instrumentation, test execution and reporting (ChatGPT and Codex).

**@⁠contatopablow-spec** on GitHub · 2026-11-24 18:54 UTC · [original](https://github.com/Marvisak/VIctory/pull/650#issuecomment-7141316217) Independent synthetic validation on desktop **RTX 3050 6 GB (Ampere)**, NVIDIA driver 610.88, PCI ID `10de:2584`, Windows 11 Pro build 26300, i5-8400, 24 GB RAM, Rust 1.98.1. Tested PR head `06657a8bebe86f562cf1d55796de565b9a9d329b` in a separate worktree; the sole local change was non-fatal test-only adapter logging using the D3D12 device LUID. ```text cargo test -p victory-shader --locked --lib root_view_reads_stop_at_the_bound_size -- --nocapture --test-threads=1 NVIDIA GeForce RTX 3050 vendor=0x10de device=0x2584 warp=false Microsoft Basic Render Driver vendor=0x1414 device=0x008c warp=true test result: ok. 1 passed; 0 failed; 0 ignored; 69 filtered out; finished in 0.43s ``` The existing fixture completed on both adapters, including expected zero reads at offsets 64, 128 and `u32::MAX - 3`. Exit code 0. No game data used. Scope: synthetic raw-SRV reads only; not proof of a fix for mesh dispatch hangs, stores/atomics, table SRVs or gameplay. PR head tested as-is apart from adapter logging, not merged onto current main. AI-assisted instrumentation, test execution and reporting (ChatGPT and Codex).
Author
Owner

@⁠Impre-visible on GitHub · 2026-11-25 00:11 UTC · original

Test report for this PR's idea on Linux/NVIDIA, where it seems to remove the driver-level faults (not a code review).

Setup: Arch Linux, Wine (GE-Proton11-6) + vkd3d-proton, GTX 1660 6 GB, NVIDIA 620.73.04 open modules, Series X mode. On this host a GPU fault shows as NVRM: Xid 13 in the kernel log (Graphics SM Warp Exception ...: MMU Fault, Multiple Warp Errors), after which the channel is dead and VIctory waits on its fence forever (see my note on #1581).

Tree: #1433 with #1492 merged by hand plus #1077 #1175 #523 #530 #1040 #1406 #542 #1056 #1392 #1516 #1388 #1189 #1523 #635 #988, and #1769. This branch does not merge there (8 conflicts with #542's 2 GiB guards in emit/lower.rs), so I ported it by hand, keeping both checks. Two differences from the PR as written: the size given for a root SRV is the whole host copy from its address (not the refreshed megabyte), and a root view the title never set, or one with no host copy, is bound to 256 bytes of list scratch with size 0 instead of being left unset. cargo test -p victory-shader --lib and -p victory-gpu --lib give the same results as before the port.

Runs that reached the world, same tree with and without the port:

runs ended by Xid 13 ended by Xid 109 no Xid
without 8 1 2 5
with the root-view bound 5 0 0 5

Before that tree existed, Xid 13 also ended runs during loading, before the world (about 7 of some 50 runs this evening, always a few hundredths of a second after the first bind of the same group of loading-phase pipelines, one of which is a mesh pipeline reading through a root SRV); none of the 5 runs with the bound did.

The sample is small and the 5 runs also carried a lower cap on a wave64 wait loop, so the Xid 109 column is not attributable to this PR. The Xid 13 column is the one this PR is about. The runs with the bound still end for other reasons (the title's own stop after a render iteration longer than 30 s, or a title assert while streaming).

Reads that legitimately reach past the host copy now return 0 where the console would read real memory, so this trades a fault for possibly missing geometry; I cannot judge the picture yet (the world is still dark here).

**@⁠Impre-visible** on GitHub · 2026-11-25 00:11 UTC · [original](https://github.com/Marvisak/VIctory/pull/650#issuecomment-7148240213) Test report for this PR's idea on Linux/NVIDIA, where it seems to remove the driver-level faults (not a code review). **Setup:** Arch Linux, Wine (GE-Proton11-6) + vkd3d-proton, GTX 1660 6 GB, NVIDIA 620.73.04 open modules, Series X mode. On this host a GPU fault shows as `NVRM: Xid 13` in the kernel log (`Graphics SM Warp Exception ...: MMU Fault`, `Multiple Warp Errors`), after which the channel is dead and VIctory waits on its fence forever (see my note on #1581). **Tree:** #1433 with #1492 merged by hand plus #1077 #1175 #523 #530 #1040 #1406 #542 #1056 #1392 #1516 #1388 #1189 #1523 #635 #988, and #1769. This branch does not merge there (8 conflicts with #542's 2 GiB guards in `emit/lower.rs`), so I ported it by hand, keeping both checks. Two differences from the PR as written: the size given for a root SRV is the whole host copy from its address (not the refreshed megabyte), and a root view the title never set, or one with no host copy, is bound to 256 bytes of list scratch with size 0 instead of being left unset. `cargo test -p victory-shader --lib` and `-p victory-gpu --lib` give the same results as before the port. **Runs that reached the world, same tree with and without the port:** | | runs | ended by Xid 13 | ended by Xid 109 | no Xid | |---|---|---|---|---| | without | 8 | 1 | 2 | 5 | | with the root-view bound | 5 | 0 | 0 | 5 | Before that tree existed, Xid 13 also ended runs during loading, before the world (about 7 of some 50 runs this evening, always a few hundredths of a second after the first bind of the same group of loading-phase pipelines, one of which is a mesh pipeline reading through a root SRV); none of the 5 runs with the bound did. The sample is small and the 5 runs also carried a lower cap on a wave64 wait loop, so the Xid 109 column is not attributable to this PR. The Xid 13 column is the one this PR is about. The runs with the bound still end for other reasons (the title's own stop after a render iteration longer than 30 s, or a title assert while streaming). Reads that legitimately reach past the host copy now return 0 where the console would read real memory, so this trades a fault for possibly missing geometry; I cannot judge the picture yet (the world is still dark here).
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:26 UTC · original

Automated triage for the maintainers. Closing because this change is already in main, or main has since replaced the code it patches.

Root SRV/UAV accesses are bounded in main another way (d71c3889: root views read through heap views of the host copy, offset from user data; Lower::root_view).

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

**@⁠Marvisak** on GitHub · 2026-11-25 00:26 UTC · [original](https://github.com/Marvisak/VIctory/pull/650#issuecomment-7148520525) Automated triage for the maintainers. Closing because this change is already in `main`, or `main` has since replaced the code it patches. Root SRV/UAV accesses are bounded in main another way (d71c3889: root views read through heap views of the host copy, offset from user data; Lower::root_view). If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

Pull request closed

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!650
No description provided.