GPU: structured buffer views are raw views of the same bytes on the host (NVIDIA reads 0 through raw loads of structured views) #1762

Closed
github-bot wants to merge 8 commits from gh-pr/1762/head into gh-pr/1762/base
Owner

@⁠claude-GTA6 on GitHub · 2026-11-24 22:09 UTC · original
claude-GTA6:pr-raw-views → main · +1101 −65 · 9 files · 8 commits · closed without merging

From a tester working with Claude (AI-assisted); measured on my own machine.

This is the fix from @⁠fxceless's fork fxceless/victory-gta6 (GPL-3.0, commit 578d459c, raw_window in crates/victory-gpu/src/descriptor/host.rs), ported onto current main's view code. The diagnosis is theirs as well. Their fork renders the world lit on an RTX 4070.

Why

Translated shaders read untyped buffers as raw bytes: scalar loads at a byte address, and raw loads at element * stride + offset. When the title's view is structured (format UNKNOWN, a stride), the host view is structured too. On NVIDIA, raw reads through it return zeros. On an RTX 5090, byte 20 of a 16-byte-stride view read 0 instead of 86. GTA VI hits this twice:

  • The lighting shaders' pre-exposure (t103, 16-byte structured, byte 4) reads 0, so the lit colour is multiplied by 0 and HDR is exactly 0.
  • The alpha prepass's per-draw thresholds (t13, 128-byte structured, byte 16) read 0, so every prepass pixel is discarded.

The result is a black world.

What

  • buffer_srv / buffer_uav in descriptor/host.rs: a structured view becomes a raw view of the same bytes of its host copy (DXGI_FORMAT_R32_TYPELESS + D3D12_BUFFER_SRV_FLAG_RAW / D3D12_BUFFER_UAV_FLAG_RAW, first element and count in dwords). This only happens when those bytes start on 16 bytes (the raw view alignment), are whole dwords, and are at most 2^27 dwords. Otherwise the view stays structured.
  • The conversion runs after main's own steps: the copy from shadow::for_view (including a view's own copy), the first element counted from that copy, and the in_buffer refusal of empty and overlong views. The refusal and null behaviour don't change.
  • The view-stride table still holds the title's stride, so shaders that compute element * stride are unchanged.
  • Structured reads through a raw view were correct on NVIDIA in the fork, which is why the host view is raw wherever it can be.

v2 (head 4eb5d1ed, on main 940d32f6)

v1 is commit 550cac2b above. v2 adds:

  • c43e934c (descriptor/host.rs): a structured view whose bytes do not start on 16 bytes is made raw over a host copy that does (raw_window, copy_align, view_align); views still left structured are logged.
  • 57aa0549 (emit/lower.rs, emit/host.rs): the translator reads heap and table structured buffers through raw handles at index * stride + offset (structured_raw), and a structured buffer's record count is its raw size over the stride (descriptor_data in bindless.rs).
  • f6999942: the record count is in records however the code addresses it; the test host makes raw views for translated programs, so the native reference reads structured views the same way (emit/stride_tests.rs, new). This test-host part overlaps #1887.
  • 4eb5d1ed: merge of main 940d32f6, no conflicts.
    The DXIL of about 22,000 programs changes with v2. Measured only on NVIDIA (RTX 5090; RTX 4070 SUPER and RTX 3080 by other testers, below) and WARP: AMD and Intel at this head are still untested.

Tested (RTX 5090, Windows 11)

  • New GPU test bindless::tests::raw_reads_of_structured_views_are_right. It makes title descriptors for a structured shader resource view and a structured unordered access view (16 elements of 16 bytes), then runs a compute shader that does raw loads and stores through them (ByteAddressBuffer / RWByteAddressBuffer). The test passes. With the shader resource view conversion turned off, it fails: raw loads through the structured view read 0 from dword 16 on.
  • cargo test --release -p victory-gpu, with and without --features diagnostics: everything passes except descriptor::host::tests::dynamic_slots_are_held_until_released and memory::tests::lists_share_a_table_and_copies_keep_their_views. Both fail the same way on plain main on this machine (the heap size check, and "past the dynamic slots").
  • cargo clippy --release --workspace --all-targets --locked -- -D warnings and cargo xtask policy pass.
  • In game, on my own branch (many merged PRs) with an earlier version of this change written against the older view code: the world went from black (mean level 0-2) to lit, even overexposed (mean level about 220, sky and sun visible). The run lasted 12 minutes with no device removal.

Not covered

  • In the unit test, raw loads and stores through a structured unordered access view were correct even without the conversion on this card. The UAV half is in for consistency with the fork and the in-game run, but no test here shows it is needed.
  • The in-game run used my branch, not main plus only this commit. I haven't checked that auto-exposure settles after the change; the overexposure may be a separate issue.
  • Not run on AMD.

No game data attached.

🤖 Generated with Claude Code

**@⁠claude-GTA6** on GitHub · 2026-11-24 22:09 UTC · [original](https://github.com/Marvisak/VIctory/pull/1762) `claude-GTA6:pr-raw-views` → `main` · +1101 −65 · 9 files · 8 commits · closed without merging *From a tester working with Claude (AI-assisted); measured on my own machine.* This is the fix from @⁠fxceless's fork [fxceless/victory-gta6](https://github.com/fxceless/victory-gta6) (GPL-3.0, commit `578d459c`, `raw_window` in `crates/victory-gpu/src/descriptor/host.rs`), ported onto current `main`'s view code. The diagnosis is theirs as well. Their fork renders the world lit on an RTX 4070. ### Why Translated shaders read untyped buffers as raw bytes: scalar loads at a byte address, and raw loads at `element * stride + offset`. When the title's view is structured (format `UNKNOWN`, a stride), the host view is structured too. On NVIDIA, raw reads through it return zeros. On an RTX 5090, byte 20 of a 16-byte-stride view read 0 instead of 86. GTA VI hits this twice: - The lighting shaders' pre-exposure (`t103`, 16-byte structured, byte 4) reads 0, so the lit colour is multiplied by 0 and HDR is exactly 0. - The alpha prepass's per-draw thresholds (`t13`, 128-byte structured, byte 16) read 0, so every prepass pixel is discarded. The result is a black world. ### What - `buffer_srv` / `buffer_uav` in `descriptor/host.rs`: a structured view becomes a raw view of the same bytes of its host copy (`DXGI_FORMAT_R32_TYPELESS` + `D3D12_BUFFER_SRV_FLAG_RAW` / `D3D12_BUFFER_UAV_FLAG_RAW`, first element and count in dwords). This only happens when those bytes start on 16 bytes (the raw view alignment), are whole dwords, and are at most 2^27 dwords. Otherwise the view stays structured. - The conversion runs after `main`'s own steps: the copy from `shadow::for_view` (including a view's own copy), the first element counted from that copy, and the `in_buffer` refusal of empty and overlong views. The refusal and null behaviour don't change. - The view-stride table still holds the title's stride, so shaders that compute `element * stride` are unchanged. - Structured reads through a raw view were correct on NVIDIA in the fork, which is why the host view is raw wherever it can be. ### v2 (head `4eb5d1ed`, on `main` `940d32f6`) v1 is commit `550cac2b` above. v2 adds: - `c43e934c` (`descriptor/host.rs`): a structured view whose bytes do not start on 16 bytes is made raw over a host copy that does (`raw_window`, `copy_align`, `view_align`); views still left structured are logged. - `57aa0549` (`emit/lower.rs`, `emit/host.rs`): the translator reads heap and table structured buffers through raw handles at `index * stride + offset` (`structured_raw`), and a structured buffer's record count is its raw size over the stride (`descriptor_data` in `bindless.rs`). - `f6999942`: the record count is in records however the code addresses it; the test host makes raw views for translated programs, so the native reference reads structured views the same way (`emit/stride_tests.rs`, new). This test-host part overlaps #1887. - `4eb5d1ed`: merge of `main` `940d32f6`, no conflicts. The DXIL of about 22,000 programs changes with v2. Measured only on NVIDIA (RTX 5090; RTX 4070 SUPER and RTX 3080 by other testers, below) and WARP: AMD and Intel at this head are still untested. ### Tested (RTX 5090, Windows 11) - New GPU test `bindless::tests::raw_reads_of_structured_views_are_right`. It makes title descriptors for a structured shader resource view and a structured unordered access view (16 elements of 16 bytes), then runs a compute shader that does raw loads and stores through them (`ByteAddressBuffer` / `RWByteAddressBuffer`). The test passes. With the shader resource view conversion turned off, it fails: raw loads through the structured view read 0 from dword 16 on. - `cargo test --release -p victory-gpu`, with and without `--features diagnostics`: everything passes except `descriptor::host::tests::dynamic_slots_are_held_until_released` and `memory::tests::lists_share_a_table_and_copies_keep_their_views`. Both fail the same way on plain `main` on this machine (the heap size check, and "past the dynamic slots"). - `cargo clippy --release --workspace --all-targets --locked -- -D warnings` and `cargo xtask policy` pass. - In game, on my own branch (many merged PRs) with an earlier version of this change written against the older view code: the world went from black (mean level 0-2) to lit, even overexposed (mean level about 220, sky and sun visible). The run lasted 12 minutes with no device removal. ### Not covered - In the unit test, raw loads and stores through a structured unordered access view were correct even without the conversion on this card. The UAV half is in for consistency with the fork and the in-game run, but no test here shows it is needed. - The in-game run used my branch, not `main` plus only this commit. I haven't checked that auto-exposure settles after the change; the overexposure may be a separate issue. - Not run on AMD. No game data attached. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Translated shaders read untyped buffers as raw bytes (scalar loads at a
byte address, raw loads at element * stride + offset). Through a
structured host view such reads give zeros on NVIDIA (RTX 5090: byte 20
of a 16-byte-stride view read 0 instead of 86). In Grand Theft Auto VI
that zeroes the lighting's pre-exposure (t103) and the alpha prepass's
per-draw thresholds (t13): lighting * 0, every prepass pixel discarded,
a black world.

buffer_srv and buffer_uav now make a structured view (format UNKNOWN, a
stride) a raw R32_TYPELESS view of the same bytes of its host copy, after
the existing checks (for_view's copy, the in_buffer refusal of empty and
overlong views), when those bytes start on 16 bytes and are whole dwords
(at most 2^27); otherwise it stays structured. The view-stride table
still holds the title's stride.

New GPU test bindless::raw_reads_of_structured_views_are_right: raw
loads through a structured shader resource view and raw loads and
stores through a structured unordered access view, via title
descriptors. On the RTX 5090 the read side gets zeros from dword 16 on
without the shader resource view change.

Ported from fxceless/victory-gta6 (GPL-3.0), commit 578d459c, `raw_window`
in crates/victory-gpu/src/descriptor/host.rs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The first version made a structured view raw only when its bytes already
started on 16 bytes of its buffer's copy; the rest stayed structured, and
NVIDIA reads those wrong (element 1 of the meshlet culling's 456-byte
constants, element 1 to 3 of a 12-byte-stride buffer). Reported by
marquezinii on #1762, with the fix idea used here.

A structured view whose stride is a whole number of dwords now asks
shadow::for_view for a copy starting on 16 bytes
(D3D12_RAW_UAV_SRV_BYTE_ALIGNMENT) instead of on an element, so a view
not on 16 bytes of its buffer's copy gets a copy of its own bytes, as
views off their elements already do, and is made raw too. view_copy asks
with the same rule (view_align), so draws find and refresh the copy the
slot shows. Views left structured (an odd stride, too many dwords for one
raw view) are logged once (rminzao's review).

Tests: structured_views_become_raw_views_of_the_same_bytes (the
conversion and where copies start); structured_views_off_their_buffers_
elements_get_their_own_copy gains the start + 456 case (own copy) beside
start + 4 * 456 (the buffer's copy), after marquezinii's branch;
structured_views_made_raw_keep_the_titles_bytes, after AlanQiang0418's
reproduction: GetDimensions through a structured handle of the raw view
gave (64, 16) and (256, 16), so the translation asks through raw handles
for the raw size (256 bytes here), which over the title's stride is its
element count (16).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The host makes the title's structured views raw views of the same bytes,
but the translation still declared indexed loads, stores and atomics of
structured buffers as structured handles (kind 12, the used-resource
entry's stride). A structured handle on a raw view is undefined in D3D12:
GPU-based validation reports "Structured buffer byte stride mismatch" and
an RTX 5090 reads zeros through it. Reported by rminzao on #1762.

Indexed accesses of heap and table views now take raw handles at byte
index * stride + offset (structured_raw); root views keep their old path.
A structured buffer's record count read as data (descriptor_data) is
asked through a raw handle, in bytes, and divided by the stride: through
a raw view a structured handle's size is its dwords or bytes, not its
elements (AlanQiang0418's measurement; marquezinii's branch had the same
fix).

The shader test host makes Stride::Structured views raw, as the runtime
does (marquezinii, welisonzika14-jpg): a_heap_buffer_read_by_element_
takes_the_views_stride and gathers_at_a_level_match_the_hardware pass on
NVIDIA. New test indexed_loads_and_atomics_of_structured_buffers_read_
raw_views: an indexed load from a 12-byte-stride SRV and an indexed atomic
add into an 8-byte-stride UAV through the raw views (zeros on an RTX 5090
with structured handles, right with raw ones).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Two findings by AlanQiang0418 on #1762, measured with hand-assembled
GFX10 programs on an RTX 5080 and WARP:

A structured buffer read at byte offsets (offen) or stored to at byte
offsets still had its record count (descriptor dword 2 read as data)
taken as the raw view's bytes: 192 instead of 16 records of 12 bytes.
The count is now classified by the used-resource entry's stride whether
or not the access is indexed, so it is the raw size over the stride for
every structured buffer.

The differential tests' native PC reference declares StructuredBuffer<S>
and was bound to the raw view translated programs read: on the RTX every
lane came out wrong. Host::dispatch_native binds a real structured view
for Stride::Structured; translated dispatches keep the raw view.

Test a_buffer_descriptors_record_count_reads_as_its_views_kind, his
regression cases in our harness: the count and the element read for
strides 4, 8, 12, 16 and 24 by index, 12-byte records at a byte offset
and by a scalar load, raw bytes, typed texels, and unordered views by
index and at a byte offset, on the hardware device and WARP.

kappalegoat's review asked for the same three things, measured on an
RTX 5070: the size query through a raw handle divided by the stride, a
conversion that leaves no dword-stride view structured, and a translated
test that reads a structured buffer descriptor's dword 2 (an HLSL
GetDimensions test keeps failing with any raw host view).

The design (raw views of structured buffers, read at index * stride +
offset, counts as raw size over stride) follows fxceless/victory-fork
(GPL-3.0), which renders the title's opening lit on NVIDIA with it.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
One conflict, in crates/victory-shader/src/emit/lower.rs, at the indexed
buffer atomic and the indexed buffer store. Upstream main added the mark
of the bytes a view write touches there (mark_view_write, byte = index *
stride + offset) while still taking a structured handle; this branch
takes a raw handle at that same byte (structured_raw).

Both are kept: structured_raw now also returns the byte the access
starts at, and the atomic and the store pass it to mark_view_write. For
heap and table views that byte is the raw handle's own coordinate, so the
mark and the write name the same bytes; root views keep their structured
handle and get the byte computed as upstream does. The indexed load takes
the handle and coordinates as before (loads mark nothing).

After the merge: all workspace tests compile; clippy -D warnings clean
with and without diagnostics; xtask policy clean; on WARP the stride
tests (8) and the bindless, descriptor and own-copy view tests (7) pass.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
astrosteveo's review of #1762 found that c43e934c gave a structured view on
an element but not on 16 bytes (element 1 or 2 of 12-byte elements) a host
copy of its own bytes. Copies meet only between submissions, so in one
list a write through the buffer's view was not seen through that view, nor
the reverse. Their test structured_views_off_16_bytes_share_the_buffers_writes
(astrosteveo/VIctory 0499a968) fails at 4eb5d1ed and is taken here, with
its programs adding the skipped bytes as translated programs do.

Their idea, as built: no view made raw gets a copy of its own. The host
makes a structured view of whole dwords raw over its buffer's copy, from
the 16 bytes at or below its first byte (`raw_window`; the copy only has to
start it on a dword), and keeps the bytes skipped (0, 4, 8 or 12) in the
top bits of the slot's view-stride entry (`VIEW_SKIP_SHIFT`, 24; the stride
stays in the bits below). Unordered views mark pages from the host view's
first byte. Translated programs add the skip to every byte they address
through a raw heap view that may be structured: scalar and vector loads,
stores and atomics through descriptors from the heap itself or whose
used-resource entry has a stride (or none); a size read as data takes it
off. Constant and raw views (no stride in their entry) start at their
first byte and read no table. A view the host leaves structured (odd
strides) keeps main's copy for views off its elements.

Tests: astrosteveo's (one list and two submissions, elements 0, 1, 2, 4);
indexed loads and atomics, scalar loads, and heap-direct reads by element
through views 4, 8 and 12 bytes early; raw_window cases; the draw test's
456-byte views now share the buffer's copy, and its copy-keeping half uses
a 458-byte (left structured) view.

Co-Authored-By: astrosteveo <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Programs that read structured buffers through tables now read the
view-stride table for the bytes a raw view starts early (9f1da58f); a test
that leaves the root SRV unbound read GPU address 0 (zeros on WARP, a
fault on hardware). The host's table holds 0 there for views on 16 bytes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
`stride_table` is called only by the test host's dispatch and draw
(cfg(test)); `cargo clippy --workspace --all-targets --locked -- -D warnings`
failed on it as dead code in the library build (nathanbzrr's report on
#1762).

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

@⁠DesertGamer on GitHub · 2026-11-24 22:14 UTC · original

VIctory V2: community PRs, merged and tested

Open PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch.

Where it stands today: launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1).

⚠️ Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk.

Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help:
https://DesertGamer/VIctory-V2

Unofficial community fork of Marvisak/VIctory, GPL-3.0.

**@⁠DesertGamer** on GitHub · 2026-11-24 22:14 UTC · [original](https://github.com/Marvisak/VIctory/pull/1762#issuecomment-7145974667) ### VIctory V2: community PRs, merged and tested Open PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch. **Where it stands today:** launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1). :warning: Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk. Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help: https://DesertGamer/VIctory-V2 *Unofficial community fork of Marvisak/VIctory, GPL-3.0.*
Author
Owner

@⁠giacbiologicbomb on GitHub · 2026-11-24 22:39 UTC · original

Windows 11 / RTX 5070 / 15 GB RAM report: on a local stack based on fxceless/victory-gta6 commit 578d459, with additional shader/wave and DXC-fallback changes, I have seen sky and previously characters in the world. This is a combined build, not an isolated A/B test of this PR, so I cannot attribute the image to this change alone.

Performance remains very limited: in a recent world-stage sample 0.3-0.9 FPS, roughly 826 pipelines still being made, and hundreds to thousands of draws reported without a host pipeline. Available physical memory was often below 1 GB; the process had over 20 GB of private committed memory and the pagefile was in use. These figures are individual samples, not a benchmark or proof of a specific bottleneck.

Given the reported NVIDIA structured-buffer issue and the fxceless-based result, this raw-view change looks worth prioritizing for review and possible merge after targeted correctness tests and a reproducible NVIDIA comparison. Further work on shader/pipeline readiness, texture streaming and memory pressure looks important; please do not treat this report as an isolated validation of the PR.

**@⁠giacbiologicbomb** on GitHub · 2026-11-24 22:39 UTC · [original](https://github.com/Marvisak/VIctory/pull/1762#issuecomment-7146485299) Windows 11 / RTX 5070 / 15 GB RAM report: on a local stack based on fxceless/victory-gta6 commit `578d459`, with additional shader/wave and DXC-fallback changes, I have seen sky and previously characters in the world. This is a combined build, not an isolated A/B test of this PR, so I cannot attribute the image to this change alone. Performance remains very limited: in a recent world-stage sample 0.3-0.9 FPS, roughly 826 pipelines still being made, and hundreds to thousands of draws reported without a host pipeline. Available physical memory was often below 1 GB; the process had over 20 GB of private committed memory and the pagefile was in use. These figures are individual samples, not a benchmark or proof of a specific bottleneck. Given the reported NVIDIA structured-buffer issue and the fxceless-based result, this raw-view change looks worth prioritizing for review and possible merge after targeted correctness tests and a reproducible NVIDIA comparison. Further work on shader/pipeline readiness, texture streaming and memory pressure looks important; please do not treat this report as an isolated validation of the PR.
Author
Owner

@⁠Vedoxdev123 on GitHub · 2026-11-24 22:46 UTC · original

Tested on Windows with AMD Ryzen 5 5600X + NVIDIA GeForce RTX 4060:

  • cargo test -p victory-gpu --lib -> 77 passed; 2 failed; 1 ignored (up from 76 passed on main; new test bindless::tests::raw_reads_of_structured_views_are_right passes; the 2 failures are the known 1,000,000 view heap cap tests from #1744)
  • cargo test -p victory-shader -> 206 passed; 3 failed; 2 ignored (same 3 failures as main)
**@⁠Vedoxdev123** on GitHub · 2026-11-24 22:46 UTC · [original](https://github.com/Marvisak/VIctory/pull/1762#issuecomment-7146628571) Tested on Windows with AMD Ryzen 5 5600X + NVIDIA GeForce RTX 4060: - `cargo test -p victory-gpu --lib` -> **77 passed; 2 failed; 1 ignored** (up from 76 passed on `main`; new test `bindless::tests::raw_reads_of_structured_views_are_right` passes; the 2 failures are the known 1,000,000 view heap cap tests from #1744) - `cargo test -p victory-shader` -> **206 passed; 3 failed; 2 ignored** (same 3 failures as `main`)
Author
Owner

@⁠marquezinii on GitHub · 2026-11-24 22:53 UTC · original

Ran this on an RTX 5070 (driver 621.40, Windows 11, Rust 1.98.1 MSVC, its own target directory), head 550cac2. Two gaps, both NVIDIA:

1. victory-shader's own test host still makes structured views. So emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride from #1744 still fails here with this PR, at the same [101, 104, 107, …, 131, 0, …]. victory-gpu gives 77 passed with the same two heap-cap failures as main. The pattern is lane l reading byte 36l + 12, that is (12l + 4) / 4 * 12: NVIDIA divides the raw byte offset by 4 and multiplies it by the view's stride. I also tried a structured read at that call site (rawBufferLoad(h, l, 4) with annotated stride 4). Lane l then read byte 12(l + 1), so the annotated stride is what is compiled in, and only the view's own stride matches. That agrees with @⁠kappalegoat's measurement above, and it means only raw views read right from a shader that learns the stride at run time.

2. Views not on 16 bytes of their copy stay structured. raw_window falls back to the structured view, and those are the views NVIDIA reads wrong. Common cases: element 1, 2 or 3 of a 12-byte-stride buffer, or element 1 of the 456-byte culling constants (start + 456 in structured_views_off_their_buffers_elements_get_their_own_copy).

A version that closes both is on marquezinii:gpu/structured-views-raw-aligned, one commit on 70564ae. Take whatever helps:

  • raw_srv/raw_uav convert before shadow::for_view is asked for the copy, and ask it to start on 16 bytes (D3D12_RAW_UAV_SRV_BYTE_ALIGNMENT) instead of on an element. A structured view not on 16 bytes then gets a copy of its own bytes, as views off their elements already do, and is made raw too.
  • view_copy uses the same rule (view_align), so draws find and refresh the copy the slot shows.
  • Stride::Structured in emit/host.rs makes a raw view, as the runtime does.
  • Tests: a unit test of the conversion, and structured_views_off_their_buffers_elements_get_their_own_copy gains the start + 456 case (own copy) next to start + 4 * 456 (the buffer's copy).

On the RTX 5070 that branch gives:

  • victory-gpu: 77 passed, with only the two heap-cap failures.
  • victory-shader: 208 passed, with only a_heap_buffer_read_where_no_buffer_view_is_reads_zeros failing, which is the heap cap again. a_heap_buffer_read_by_element_takes_the_views_stride passes, and so do the table-structured tests with strides 4 and 16, now through raw views.
  • Clippy (with and without diagnostics) and xtask policy are clean.

Not tested: the title.

**@⁠marquezinii** on GitHub · 2026-11-24 22:53 UTC · [original](https://github.com/Marvisak/VIctory/pull/1762#issuecomment-7146763622) Ran this on an RTX 5070 (driver 621.40, Windows 11, Rust 1.98.1 MSVC, its own target directory), head `550cac2`. Two gaps, both NVIDIA: **1. `victory-shader`'s own test host still makes structured views.** So `emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride` from #1744 still fails here with this PR, at the same `[101, 104, 107, …, 131, 0, …]`. `victory-gpu` gives 77 passed with the same two heap-cap failures as `main`. The pattern is lane `l` reading byte `36l + 12`, that is `(12l + 4) / 4 * 12`: NVIDIA divides the raw byte offset by 4 and multiplies it by the view's stride. I also tried a structured read at that call site (`rawBufferLoad(h, l, 4)` with annotated stride 4). Lane `l` then read byte `12(l + 1)`, so the annotated stride is what is compiled in, and only the view's own stride matches. That agrees with @⁠kappalegoat's measurement above, and it means only raw views read right from a shader that learns the stride at run time. **2. Views not on 16 bytes of their copy stay structured.** `raw_window` falls back to the structured view, and those are the views NVIDIA reads wrong. Common cases: element 1, 2 or 3 of a 12-byte-stride buffer, or element 1 of the 456-byte culling constants (`start + 456` in `structured_views_off_their_buffers_elements_get_their_own_copy`). A version that closes both is on [`marquezinii:gpu/structured-views-raw-aligned`](https://github.com/marquezinii/VIctory/commit/6f1f09b), one commit on `70564ae`. Take whatever helps: - `raw_srv`/`raw_uav` convert before `shadow::for_view` is asked for the copy, and ask it to start on 16 bytes (`D3D12_RAW_UAV_SRV_BYTE_ALIGNMENT`) instead of on an element. A structured view not on 16 bytes then gets a copy of its own bytes, as views off their elements already do, and is made raw too. - `view_copy` uses the same rule (`view_align`), so draws find and refresh the copy the slot shows. - `Stride::Structured` in `emit/host.rs` makes a raw view, as the runtime does. - Tests: a unit test of the conversion, and `structured_views_off_their_buffers_elements_get_their_own_copy` gains the `start + 456` case (own copy) next to `start + 4 * 456` (the buffer's copy). On the RTX 5070 that branch gives: - `victory-gpu`: 77 passed, with only the two heap-cap failures. - `victory-shader`: 208 passed, with only `a_heap_buffer_read_where_no_buffer_view_is_reads_zeros` failing, which is the heap cap again. `a_heap_buffer_read_by_element_takes_the_views_stride` passes, and so do the table-structured tests with strides 4 and 16, now through raw views. - Clippy (with and without `diagnostics`) and `xtask policy` are clean. Not tested: the title.
Author
Owner

@⁠AlanQiang0418 on GitHub · 2026-11-24 23:00 UTC · original

RTX 5080 comparison. The change restores raw loads through a structured SRV on this card. It also changes the element count returned to shaders that query a structured view. Could you preserve the title’s element count when converting the host view?

I tested the descriptor implementation from 70564ae and 550cac2 against the same synthetic buffers (16 elements × 16 bytes). I confirmed the D3D12 adapter through its LUID: GeForce RTX 5080, driver 621.14. The results below agreed with both the PR’s FXC cs_5_1 path and DXC cs_6_6.

Measurement Main PR
Raw loads through structured SRV, correct dwords 16/64 64/64
Raw loads/stores through structured UAV, correct dwords 64/64 64/64
Structured loads through structured SRV, correct dwords 64/64 64/64
Structured reads/writes through structured UAV, correct dwords 64/64 64/64
StructuredBuffer<uint4>.GetDimensions (count, stride) (16, 16) (64, 16)
RWStructuredBuffer<uint4>.GetDimensions (count, stride) (16, 16) (256, 16)

This matters to VIctory’s translator: descriptor_data requests structured dimensions for a known stride and uses the first field as the title buffer’s record count. A shader using that count to choose its last element can therefore select a different index. I used synthetic descriptors and did not run the game. Descriptor reconstruction on main · Record-count field

I put a minimal failing test on top of this PR. Run cargo test --locked -p victory-gpu --lib bindless::tests::structured_views_report_their_element_count -- --exact. It returns [64,16,256,16] here and passes with the descriptor implementation from main. The original raw-load test shows the opposite result. Reproduction commit

**@⁠AlanQiang0418** on GitHub · 2026-11-24 23:00 UTC · [original](https://github.com/Marvisak/VIctory/pull/1762#issuecomment-7146901112) **RTX 5080 comparison.** The change restores raw loads through a structured SRV on this card. It also changes the element count returned to shaders that query a structured view. Could you preserve the title’s element count when converting the host view? I tested the descriptor implementation from `70564ae` and `550cac2` against the same synthetic buffers (16 elements × 16 bytes). I confirmed the D3D12 adapter through its LUID: GeForce RTX 5080, driver 621.14. The results below agreed with both the PR’s FXC `cs_5_1` path and DXC `cs_6_6`. | Measurement | Main | PR | | --- | ---: | ---: | | Raw loads through structured SRV, correct dwords | 16/64 | 64/64 | | Raw loads/stores through structured UAV, correct dwords | 64/64 | 64/64 | | Structured loads through structured SRV, correct dwords | 64/64 | 64/64 | | Structured reads/writes through structured UAV, correct dwords | 64/64 | 64/64 | | `StructuredBuffer<uint4>.GetDimensions` (count, stride) | (16, 16) | (64, 16) | | `RWStructuredBuffer<uint4>.GetDimensions` (count, stride) | (16, 16) | (256, 16) | This matters to VIctory’s translator: `descriptor_data` requests structured dimensions for a known stride and uses the first field as the title buffer’s record count. A shader using that count to choose its last element can therefore select a different index. I used synthetic descriptors and did not run the game. [Descriptor reconstruction on main](https://github.com/Marvisak/VIctory/blob/70564ae08c82d43df5fad97b08d34628b07b1d9d/crates/victory-shader/src/emit/lower.rs#L4007-L4049) · [Record-count field](https://github.com/Marvisak/VIctory/blob/70564ae08c82d43df5fad97b08d34628b07b1d9d/crates/victory-shader/src/emit/lower.rs#L4087) I put a minimal failing test on top of this PR. Run `cargo test --locked -p victory-gpu --lib bindless::tests::structured_views_report_their_element_count -- --exact`. It returns `[64,16,256,16]` here and passes with the descriptor implementation from main. The original raw-load test shows the opposite result. [Reproduction commit](https://github.com/AlanQiang0418/VIctory/commit/550f855b7b39fe0d677bbccb95178da2cc6b92db)
Author
Owner

@⁠rminzao on GitHub · 2026-11-24 23:09 UTC · original

Possible mismatch: structured reads through the new raw views

The translator still declares some heap buffers as StructuredBuffer: emit/mod.rs:58-62 says indexed accesses are "structured with the used-resource entry's stride", and emit/lower.rs emits (12 | u, stride) handles for indexed loads (~4011, ~4030) and indexed atomics (~8477, 8593, 8692).

With this PR, buffer_srv/buffer_uav hand those handles a raw R32_TYPELESS view. A structured handle reading a raw view is the same kind of view/declaration mismatch this PR fixes in the other direction, and D3D12 leaves it undefined. It may happen to work on NVIDIA, but AMD, Intel and vkd3d-proton aren't covered, and GPU-based validation would likely flag it.

The new test raw_reads_of_structured_views_are_right only does raw loads and stores, so the kind-12 path (indexed load / atomic through a converted view) isn't exercised. Would it be safer to convert only views that no structured handle reads, or to add a test for that path?

Minor: when raw_window rejects a view (base not 16-byte aligned) it silently stays structured, so raw reads of it still return 0 on NVIDIA with nothing in the log.

Static review (AI-assisted), read against main at 70564ae; nothing was run on a GPU.

**@⁠rminzao** on GitHub · 2026-11-24 23:09 UTC · [original](https://github.com/Marvisak/VIctory/pull/1762#issuecomment-7147073523) **Possible mismatch: structured reads through the new raw views** The translator still declares some heap buffers as `StructuredBuffer`: `emit/mod.rs:58-62` says indexed accesses are "structured with the used-resource entry's stride", and `emit/lower.rs` emits `(12 | u, stride)` handles for indexed loads (~4011, ~4030) and indexed atomics (~8477, 8593, 8692). With this PR, `buffer_srv`/`buffer_uav` hand those handles a raw `R32_TYPELESS` view. A structured handle reading a raw view is the same kind of view/declaration mismatch this PR fixes in the other direction, and D3D12 leaves it undefined. It may happen to work on NVIDIA, but AMD, Intel and vkd3d-proton aren't covered, and GPU-based validation would likely flag it. The new test `raw_reads_of_structured_views_are_right` only does raw loads and stores, so the kind-12 path (indexed load / atomic through a converted view) isn't exercised. Would it be safer to convert only views that no structured handle reads, or to add a test for that path? Minor: when `raw_window` rejects a view (base not 16-byte aligned) it silently stays structured, so raw reads of it still return 0 on NVIDIA with nothing in the log. _Static review (AI-assisted), read against `main` at 70564ae; nothing was run on a GPU._
Author
Owner

@⁠welisonzika14-jpg on GitHub · 2026-11-24 23:17 UTC · original

RTX 5070 (driver 621.24, Windows 11, Rust 1.98.1 MSVC), on 70564ae. I ran #1751 and #1762 alone and together.

main #1751 #1762 #1751 + #1762
victory-gpu 76 ok, 2 fail 78 ok 77 ok, 2 fail 79 ok
victory-shader 206 ok, 3 fail 206 ok, 3 fail 206 ok, 3 fail 206 ok, 3 fail

They merge cleanly. #1762 does not change the 3 victory-shader failures, because the test host there still makes structured views (same as @⁠marquezinii said above).

I wrote a small test-only patch on top of both. With it, victory-shader is 209 passed, 0 failed, and clippy -D warnings is clean:

  1. In emit/host.rs, Stride::Structured(_) creates a raw view of the same bytes (R32_TYPELESS, D3D12_BUFFER_SRV_FLAG_RAW, stride 0), like this PR does in the runtime. This fixes a_heap_buffer_read_by_element_takes_the_views_stride and gathers_at_a_level_match_the_hardware.
  2. A helper Host::takes_view_heap(n) tries to create a view heap of n slots. a_heap_buffer_read_where_no_buffer_view_is_reads_zeros skips with a message when the device refuses HEAP_VIEWS slots. This skips the test on NVIDIA, it does not fix it. The real fix for that one is the heap clamp work (#1777).

About 31 lines added, 5 removed. It only makes sense after #1762, so it would be stacked on it.

Limits: these are unit tests only, no game files. The stride test only uses raw loads, so it does not cover the structured-handle path @⁠rminzao mentioned.

Happy to open it as a PR on top of #1762 if you want it. If @⁠marquezinii's branch already has the test host change, I will not duplicate it.

Written with AI help (Claude/Kiro). The numbers are from runs on my machine.

**@⁠welisonzika14-jpg** on GitHub · 2026-11-24 23:17 UTC · [original](https://github.com/Marvisak/VIctory/pull/1762#issuecomment-7147229016) RTX 5070 (driver 621.24, Windows 11, Rust 1.98.1 MSVC), on `70564ae`. I ran #1751 and #1762 alone and together. | | main | #1751 | #1762 | #1751 + #1762 | |---|---|---|---|---| | `victory-gpu` | 76 ok, 2 fail | 78 ok | 77 ok, 2 fail | 79 ok | | `victory-shader` | 206 ok, 3 fail | 206 ok, 3 fail | 206 ok, 3 fail | 206 ok, 3 fail | They merge cleanly. #1762 does not change the 3 `victory-shader` failures, because the test host there still makes structured views (same as @⁠marquezinii said above). I wrote a small test-only patch on top of both. With it, `victory-shader` is 209 passed, 0 failed, and `clippy -D warnings` is clean: 1. In `emit/host.rs`, `Stride::Structured(_)` creates a raw view of the same bytes (`R32_TYPELESS`, `D3D12_BUFFER_SRV_FLAG_RAW`, stride 0), like this PR does in the runtime. This fixes `a_heap_buffer_read_by_element_takes_the_views_stride` and `gathers_at_a_level_match_the_hardware`. 2. A helper `Host::takes_view_heap(n)` tries to create a view heap of `n` slots. `a_heap_buffer_read_where_no_buffer_view_is_reads_zeros` skips with a message when the device refuses `HEAP_VIEWS` slots. This skips the test on NVIDIA, it does not fix it. The real fix for that one is the heap clamp work (#1777). About 31 lines added, 5 removed. It only makes sense after #1762, so it would be stacked on it. Limits: these are unit tests only, no game files. The stride test only uses raw loads, so it does not cover the structured-handle path @⁠rminzao mentioned. Happy to open it as a PR on top of #1762 if you want it. If @⁠marquezinii's branch already has the test host change, I will not duplicate it. Written with AI help (Claude/Kiro). The numbers are from runs on my machine.
Author
Owner

@⁠claude-GTA6 on GitHub · 2026-11-24 23:20 UTC · original

From a tester working with Claude (AI-assisted); measured on my own machine.

Thanks, all four of these are real, and they fit together:

  • @⁠marquezinii: views not on 16 bytes stay structured and still read wrong, and the shader test host needs the same change.
  • @⁠AlanQiang0418: GetDimensions returns the dword count, while descriptor_data takes the first field as the record count. The title's element count has to be preserved.
  • @⁠rminzao: indexed loads and atomics still declare structured handles, which is undefined on a raw view. The silent fallback should also log.
  • @⁠welisonzika14-jpg: the test-host change, and the #1751 combination.

I'm reworking this into one consistent version: structured title views become raw views of 16-byte-aligned copies, the translator reads them through raw handles (indexed and atomic paths included) and derives the element count from bytes / stride, and the test host matches the runtime. I'll add your failing cases as tests, including the element-count test and the indexed/atomic path. I'll write it here rather than merge your branches, so it stays one reviewable change, and I'll credit each of you in the commits. I'll post here when it's up.

**@⁠claude-GTA6** on GitHub · 2026-11-24 23:20 UTC · [original](https://github.com/Marvisak/VIctory/pull/1762#issuecomment-7147285025) *From a tester working with Claude (AI-assisted); measured on my own machine.* Thanks, all four of these are real, and they fit together: - @⁠marquezinii: views not on 16 bytes stay structured and still read wrong, and the shader test host needs the same change. - @⁠AlanQiang0418: `GetDimensions` returns the dword count, while `descriptor_data` takes the first field as the record count. The title's element count has to be preserved. - @⁠rminzao: indexed loads and atomics still declare structured handles, which is undefined on a raw view. The silent fallback should also log. - @⁠welisonzika14-jpg: the test-host change, and the #1751 combination. I'm reworking this into one consistent version: structured title views become raw views of 16-byte-aligned copies, the translator reads them through raw handles (indexed and atomic paths included) and derives the element count from bytes / stride, and the test host matches the runtime. I'll add your failing cases as tests, including the element-count test and the indexed/atomic path. I'll write it here rather than merge your branches, so it stays one reviewable change, and I'll credit each of you in the commits. I'll post here when it's up.
Author
Owner

@⁠marquezinii on GitHub · 2026-11-24 23:22 UTC · original

On the two points above, from the RTX 5070 (driver 621.40). Both apply to my branch as well.

@⁠rminzao: structured reads through raw views. They read right on NVIDIA. With the test host's structured views made raw, the victory-shader tests that read table views with structured handles ((12 | u, stride), strides 4 and 16 in synthetic_tests, waterfall_tests and diff_tests) all pass on the hardware device. The rule I measured: NVIDIA takes the shader's byte address (element times the stride compiled into the handle, plus the offset), divides it by 4 and multiplies by the view's stride. A raw view has stride 4, so structured and raw handles both land on the right byte. Only a structured view breaks it, unless its stride happens to equal the compiled one.

@⁠AlanQiang0418: the record count. Right, and a raw view can't keep the title's element count, since its elements are dwords. The fix has to be in the translator: descriptor_data asks for the size through a structured handle and takes field 0 as the record count. I pushed f6bb5d5 on marquezinii:gpu/structured-views-raw-aligned. For a structured buffer, it asks through a raw handle, which returns bytes on a raw view for both shader and unordered views, and divides by the stride the used-resource entry already gives. Raw and typed buffers are unchanged.

How far that is checked: it compiles, clippy is clean, and victory-shader gives 208 passed with only the heap-cap failure. But the path is exercised only by diff_tests ("sizes from descriptors", "sizes for scalar loads"), and those skip here without the console compiler. If someone has it, those two cases would settle it.

**@⁠marquezinii** on GitHub · 2026-11-24 23:22 UTC · [original](https://github.com/Marvisak/VIctory/pull/1762#issuecomment-7147330930) On the two points above, from the RTX 5070 (driver 621.40). Both apply to my branch as well. **@⁠rminzao: structured reads through raw views.** They read right on NVIDIA. With the test host's structured views made raw, the `victory-shader` tests that read table views with structured handles (`(12 | u, stride)`, strides 4 and 16 in `synthetic_tests`, `waterfall_tests` and `diff_tests`) all pass on the hardware device. The rule I measured: NVIDIA takes the shader's byte address (element times the stride compiled into the handle, plus the offset), divides it by 4 and multiplies by the view's stride. A raw view has stride 4, so structured and raw handles both land on the right byte. Only a structured view breaks it, unless its stride happens to equal the compiled one. **@⁠AlanQiang0418: the record count.** Right, and a raw view can't keep the title's element count, since its elements are dwords. The fix has to be in the translator: `descriptor_data` asks for the size through a structured handle and takes field 0 as the record count. I pushed [`f6bb5d5`](https://github.com/marquezinii/VIctory/commit/f6bb5d5) on `marquezinii:gpu/structured-views-raw-aligned`. For a structured buffer, it asks through a raw handle, which returns bytes on a raw view for both shader and unordered views, and divides by the stride the used-resource entry already gives. Raw and typed buffers are unchanged. How far that is checked: it compiles, clippy is clean, and `victory-shader` gives 208 passed with only the heap-cap failure. But the path is exercised only by `diff_tests` ("sizes from descriptors", "sizes for scalar loads"), and those skip here without the console compiler. If someone has it, those two cases would settle it.
Author
Owner

@⁠AlanQiang0418 on GitHub · 2026-11-24 23:37 UTC · original

I tested the element-count candidate f6bb5d5 with hand-assembled GFX10 compute programs on an RTX 5080 (621.14) and Microsoft WARP. Each shader reads descriptor dword 2 and uses that same descriptor to load or store a known value. This also exposed a problem with the native PC reference used by the two differential cases.

Record counts. For 192 bytes holding sixteen 12-byte records, the candidate returned 16 with a scalar SRV load and an indexed UAV store. A byte-offset (offen) SRV load or UAV store returned 192 on both adapters. The data at byte 12 was correct. Classifying the count by the known structure stride even when idxen is clear returned 16 on both. The raw control still reported 192 bytes and the typed control 12 RGBA32F texels. All seven cases passed on each adapter with the count change. Count fix and runnable regression

Indexed SRV data. With buffer dwords holding 100.0, 101.0, 102.0, …, a translated buffer_load_dword idxen at element 1 gave the following results. The element counts themselves were correct in every row.

Structure stride (bytes) Expected RTX 5080 WARP
4 101 101 101
8 102 101 102
12 103 101 103
16 104 101 104
24 106 102 106

An isolated experiment issuing the load through a raw handle at index * stride + offset passed every row on both adapters for these in-bounds reads. The linked commit adds the four regression cases that fail on the RTX. Run cargo test -p victory-shader table_buffer_descriptor_word_two_counts_records -- --nocapture. Indexed-read reproducer

PC reference. I ran the exact PC HLSL and bindings for “sizes from descriptors” and “sizes for scalar loads” against independent expected output. With a raw descriptor bound to native HLSL's structured SRV, the RTX got 256/256 lanes wrong in each case. Binding a real structured SRV for the native PC dispatch fixed every output word on both adapters. WARP also passed with the original binding. This test-host change retains raw views for translated dispatches. PC reference fix

Synthetic inputs only, DXIL validation for the translated fixtures, PC DXC 1.9.2609.5. The console SDK compiler was unavailable, so the full two-compiler comparison is still open. AI-assisted.

**@⁠AlanQiang0418** on GitHub · 2026-11-24 23:37 UTC · [original](https://github.com/Marvisak/VIctory/pull/1762#issuecomment-7147607081) I tested the element-count candidate `f6bb5d5` with hand-assembled GFX10 compute programs on an RTX 5080 (621.14) and Microsoft WARP. Each shader reads descriptor dword 2 and uses that same descriptor to load or store a known value. This also exposed a problem with the native PC reference used by the two differential cases. **Record counts.** For 192 bytes holding sixteen 12-byte records, the candidate returned 16 with a scalar SRV load and an indexed UAV store. A byte-offset (`offen`) SRV load or UAV store returned 192 on **both** adapters. The data at byte 12 was correct. Classifying the count by the known structure stride even when `idxen` is clear returned 16 on both. The raw control still reported 192 bytes and the typed control 12 RGBA32F texels. All seven cases passed on each adapter with the count change. [Count fix and runnable regression](https://github.com/AlanQiang0418/VIctory/commit/b86d853adbd5c3cc336150f58bba86c98909b4db) **Indexed SRV data.** With buffer dwords holding 100.0, 101.0, 102.0, …, a translated `buffer_load_dword idxen` at element 1 gave the following results. The element counts themselves were correct in every row. | Structure stride (bytes) | Expected | RTX 5080 | WARP | |---|---:|---:|---:| | 4 | 101 | 101 | 101 | | 8 | 102 | 101 | 102 | | 12 | 103 | 101 | 103 | | 16 | 104 | 101 | 104 | | 24 | 106 | 102 | 106 | An isolated experiment issuing the load through a raw handle at `index * stride + offset` passed every row on both adapters for these in-bounds reads. The linked commit adds the four regression cases that fail on the RTX. Run `cargo test -p victory-shader table_buffer_descriptor_word_two_counts_records -- --nocapture`. [Indexed-read reproducer](https://github.com/AlanQiang0418/VIctory/commit/f050b1dc43d87aa0473d94d8c4e0e23640d8b432) **PC reference.** I ran the exact PC HLSL and bindings for “sizes from descriptors” and “sizes for scalar loads” against independent expected output. With a raw descriptor bound to native HLSL's structured SRV, the RTX got 256/256 lanes wrong in each case. Binding a real structured SRV for the native PC dispatch fixed every output word on both adapters. WARP also passed with the original binding. This test-host change retains raw views for translated dispatches. [PC reference fix](https://github.com/AlanQiang0418/VIctory/commit/9e285d340040622be4a6896811b60c00237ae65e) Synthetic inputs only, DXIL validation for the translated fixtures, PC DXC 1.9.2609.5. The console SDK compiler was unavailable, so the full two-compiler comparison is still open. AI-assisted.
Author
Owner

@⁠claude-GTA6 on GitHub · 2026-11-25 00:00 UTC · original

From a tester working with Claude (AI-assisted); measured on my own machine.

@⁠marquezinii @⁠AlanQiang0418 thanks, that settles the translator half by measurement. The rework will follow it: indexed loads and atomics go through raw handles at index * stride + offset (the stride-8/12/16/24 table shows the structured handle is wrong on the RTX even when the count is right), and the record count is bytes / stride, classified by the structure stride even when idxen is clear. I'll take your failing cases as regression tests, including the offen count cases and the indexed-read rows, and bind a real structured SRV for the native-PC reference in the two differential tests. Both of you will be credited in the commits.

**@⁠claude-GTA6** on GitHub · 2026-11-25 00:00 UTC · [original](https://github.com/Marvisak/VIctory/pull/1762#issuecomment-7148030257) *From a tester working with Claude (AI-assisted); measured on my own machine.* @⁠marquezinii @⁠AlanQiang0418 thanks, that settles the translator half by measurement. The rework will follow it: indexed loads and atomics go through raw handles at `index * stride + offset` (the stride-8/12/16/24 table shows the structured handle is wrong on the RTX even when the count is right), and the record count is bytes / stride, classified by the structure stride even when `idxen` is clear. I'll take your failing cases as regression tests, including the `offen` count cases and the indexed-read rows, and bind a real structured SRV for the native-PC reference in the two differential tests. Both of you will be credited in the commits.
Author
Owner

@⁠Mericas77 on GitHub · 2026-11-25 00:22 UTC · original

Tested 550cac2 on an NVIDIA host: RTX 4070 12 GB, driver 621.01, Windows 11 (build 26300), debug build, base 70564ae.

The bug reproduces on this card. This PR's new test, run against main's runtime (70564ae with only this PR's bindless.rs test added), fails:

---- bindless::tests::raw_reads_of_structured_views_are_right stdout ----
panicked at crates\victory-gpu\src\bindless.rs:647:17:
assertion `left == right` failed: a structured view read: dword 16
  left: 1048576
 right: 1049592

With this PR, bindless::tests::raw_reads_of_structured_views_are_right passes.

--test-threads=1 70564ae this PR this PR + #1887
-p victory-gpu 76 passed, 2 failed 77 passed, 2 failed 77 passed, 2 failed
-p victory-shader 206 passed, 3 failed 206 passed, 3 failed 208 passed, 1 failed

The remaining failures all come from the 1,000,000 view heap cap that #1779 fixes: dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views and a_heap_buffer_read_where_no_buffer_view_is_reads_zeros.

On its own, this PR doesn't change the victory-shader numbers, because the shader test host still makes structured views. #1887 is the test-side half: with both, a_heap_buffer_read_by_element_takes_the_views_stride and gathers_at_a_level_match_the_hardware pass on this card. The two merge cleanly. Together with #1779, all five NVIDIA failures from #1744/#1835 pass. No hangs, device removals or driver resets.

**@⁠Mericas77** on GitHub · 2026-11-25 00:22 UTC · [original](https://github.com/Marvisak/VIctory/pull/1762#issuecomment-7148450723) Tested `550cac2` on an NVIDIA host: RTX 4070 12 GB, driver 621.01, Windows 11 (build 26300), debug build, base `70564ae`. The bug reproduces on this card. This PR's new test, run against `main`'s runtime (`70564ae` with only this PR's `bindless.rs` test added), fails: ``` ---- bindless::tests::raw_reads_of_structured_views_are_right stdout ---- panicked at crates\victory-gpu\src\bindless.rs:647:17: assertion `left == right` failed: a structured view read: dword 16 left: 1048576 right: 1049592 ``` With this PR, `bindless::tests::raw_reads_of_structured_views_are_right` passes. | `--test-threads=1` | `70564ae` | this PR | this PR + #1887 | |---|---|---|---| | `-p victory-gpu` | 76 passed, 2 failed | 77 passed, 2 failed | 77 passed, 2 failed | | `-p victory-shader` | 206 passed, 3 failed | 206 passed, 3 failed | 208 passed, 1 failed | The remaining failures all come from the 1,000,000 view heap cap that #1779 fixes: `dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views` and `a_heap_buffer_read_where_no_buffer_view_is_reads_zeros`. On its own, this PR doesn't change the victory-shader numbers, because the shader test host still makes structured views. #1887 is the test-side half: with both, `a_heap_buffer_read_by_element_takes_the_views_stride` and `gathers_at_a_level_match_the_hardware` pass on this card. The two merge cleanly. Together with #1779, all five NVIDIA failures from #1744/#1835 pass. No hangs, device removals or driver resets.
Author
Owner

@⁠kappalegoat on GitHub · 2026-11-25 01:57 UTC · original

RTX 5070 (Blackwell, driver 621.24), the two raw-view versions against @⁠AlanQiang0418's record-count test. Both trade one NVIDIA bug for the other:

tree raw_reads_of_structured_views_are_right structured_views_report_their_element_count
main 70564ae fails passes
this PR, 550cac2 (per @⁠AlanQiang0418, RTX 5080) passes fails, [64, 16, 256, 16]
@⁠marquezinii's 6f1f09b (Alan's bindless.rs tests copied onto it) passes fails, [64, 16, 256, 16]

The rest of this PR's suite on the 5070: 472 passed, 5 failed, the same five as main (#1744). @⁠marquezinii's branch fixes the element-stride test; this PR alone does not, because victory-shader's test host still makes structured views.

The record count can be fixed on the translator side, and only there. A raw host view no longer knows the title's stride, so no host view can make HLSL's StructuredBuffer.GetDimensions give 16 again. But the translator never needs HLSL's answer: descriptor_data (lower.rs, the Fields::Buffer and Fields::Smem arms) asks getDimensions through a structured handle (12 | u, stride) and stores field 0 as the record count, and in both arms the stride is a compile-time constant. If every structured title view is raw on the host, the same query through a raw handle (11 | u, 0) returns the view's size in bytes on every vendor, and bytes / stride is the title's record count. That needs the conversion to be total: with this PR's fallback (a view not on 16 bytes stays structured) a raw query of the leftover structured views would be the mismatch again, so it fits @⁠marquezinii's version (own copy for views not on 16 bytes), not this one as it stands.

I have not written that change: whoever carries the raw-view conversion is better placed to include it. The test for it would be a translated program reading dword 2 of a structured buffer's descriptor, rather than bindless.rs's HLSL test, which checks HLSL's behaviour and will keep failing with any raw host view. I did not run the title.

AI-assisted (Claude Code).

**@⁠kappalegoat** on GitHub · 2026-11-25 01:57 UTC · [original](https://github.com/Marvisak/VIctory/pull/1762#issuecomment-7150163315) **RTX 5070 (Blackwell, driver 621.24), the two raw-view versions against @⁠AlanQiang0418's record-count test.** Both trade one NVIDIA bug for the other: | tree | `raw_reads_of_structured_views_are_right` | `structured_views_report_their_element_count` | |---|---|---| | `main` `70564ae` | fails | passes | | this PR, `550cac2` (per @⁠AlanQiang0418, RTX 5080) | passes | fails, `[64, 16, 256, 16]` | | @⁠marquezinii's `6f1f09b` (Alan's `bindless.rs` tests copied onto it) | passes | **fails, `[64, 16, 256, 16]`** | The rest of this PR's suite on the 5070: 472 passed, 5 failed, the same five as `main` (#1744). @⁠marquezinii's branch fixes the element-stride test; this PR alone does not, because `victory-shader`'s test host still makes structured views. **The record count can be fixed on the translator side, and only there.** A raw host view no longer knows the title's stride, so no host view can make HLSL's `StructuredBuffer.GetDimensions` give 16 again. But the translator never needs HLSL's answer: `descriptor_data` (`lower.rs`, the `Fields::Buffer` and `Fields::Smem` arms) asks `getDimensions` through a structured handle `(12 | u, stride)` and stores field 0 as the record count, and in both arms the stride is a compile-time constant. If every structured title view is raw on the host, the same query through a **raw** handle `(11 | u, 0)` returns the view's size in bytes on every vendor, and `bytes / stride` is the title's record count. That needs the conversion to be total: with this PR's fallback (a view not on 16 bytes stays structured) a raw query of the leftover structured views would be the mismatch again, so it fits @⁠marquezinii's version (own copy for views not on 16 bytes), not this one as it stands. I have not written that change: whoever carries the raw-view conversion is better placed to include it. The test for it would be a translated program reading dword 2 of a structured buffer's descriptor, rather than `bindless.rs`'s HLSL test, which checks HLSL's behaviour and will keep failing with any raw host view. I did not run the title. AI-assisted (Claude Code).
Author
Owner

@⁠kappalegoat on GitHub · 2026-11-25 01:59 UTC · original

RTX 5070 (Blackwell, driver 621.24), the two raw-view versions against @⁠AlanQiang0418's record-count test. Both trade one NVIDIA bug for the other:

tree raw_reads_of_structured_views_are_right structured_views_report_their_element_count
main 70564ae fails passes
this PR, 550cac2 (per @⁠AlanQiang0418, RTX 5080) passes fails, [64, 16, 256, 16]
@⁠marquezinii's 6f1f09b (Alan's bindless.rs tests copied onto it) passes fails, [64, 16, 256, 16]

The rest of this PR's suite on the 5070: 472 passed, 5 failed, the same five as main (#1744). @⁠marquezinii's branch fixes the element-stride test; this PR alone does not, because victory-shader's test host still makes structured views.

The record count can be fixed on the translator side, and only there. A raw host view no longer knows the title's stride, so no host view can make HLSL's StructuredBuffer.GetDimensions give 16 again. But the translator never needs HLSL's answer: descriptor_data (lower.rs, the Fields::Buffer and Fields::Smem arms) asks getDimensions through a structured handle (12 | u, stride) and stores field 0 as the record count, and in both arms the stride is a compile-time constant. If every structured title view is raw on the host, the same query through a raw handle (11 | u, 0) returns the view's size in bytes on every vendor, and bytes / stride is the title's record count. That needs the conversion to be total: with this PR's fallback (a view not on 16 bytes stays structured) a raw query of the leftover structured views would be the mismatch again, so it fits @⁠marquezinii's version (own copy for views not on 16 bytes), not this one as it stands.

I have not written that change: whoever carries the raw-view conversion is better placed to include it. The test for it would be a translated program reading dword 2 of a structured buffer's descriptor, rather than bindless.rs's HLSL test, which checks HLSL's behaviour and will keep failing with any raw host view. I did not run the title.

AI-assisted (Claude Code).

**@⁠kappalegoat** on GitHub · 2026-11-25 01:59 UTC · [original](https://github.com/Marvisak/VIctory/pull/1762#issuecomment-7150194784) **RTX 5070 (Blackwell, driver 621.24), the two raw-view versions against @⁠AlanQiang0418's record-count test.** Both trade one NVIDIA bug for the other: | tree | `raw_reads_of_structured_views_are_right` | `structured_views_report_their_element_count` | |---|---|---| | `main` `70564ae` | fails | passes | | this PR, `550cac2` (per @⁠AlanQiang0418, RTX 5080) | passes | fails, `[64, 16, 256, 16]` | | @⁠marquezinii's `6f1f09b` (Alan's `bindless.rs` tests copied onto it) | passes | **fails, `[64, 16, 256, 16]`** | The rest of this PR's suite on the 5070: 472 passed, 5 failed, the same five as `main` (#1744). @⁠marquezinii's branch fixes the element-stride test; this PR alone does not, because `victory-shader`'s test host still makes structured views. **The record count can be fixed on the translator side, and only there.** A raw host view no longer knows the title's stride, so no host view can make HLSL's `StructuredBuffer.GetDimensions` give 16 again. But the translator never needs HLSL's answer: `descriptor_data` (`lower.rs`, the `Fields::Buffer` and `Fields::Smem` arms) asks `getDimensions` through a structured handle `(12 | u, stride)` and stores field 0 as the record count, and in both arms the stride is a compile-time constant. If every structured title view is raw on the host, the same query through a **raw** handle `(11 | u, 0)` returns the view's size in bytes on every vendor, and `bytes / stride` is the title's record count. That needs the conversion to be total: with this PR's fallback (a view not on 16 bytes stays structured) a raw query of the leftover structured views would be the mismatch again, so it fits @⁠marquezinii's version (own copy for views not on 16 bytes), not this one as it stands. I have not written that change: whoever carries the raw-view conversion is better placed to include it. The test for it would be a translated program reading dword 2 of a structured buffer's descriptor, rather than `bindless.rs`'s HLSL test, which checks HLSL's behaviour and will keep failing with any raw host view. I did not run the title. AI-assisted (Claude Code).
Author
Owner

@⁠claude-GTA6 on GitHub · 2026-11-25 02:25 UTC · original

From a tester working with Claude (AI-assisted); measured on my own machine (RTX 5090, Windows 11, Rust 1.98.1 MSVC) and WARP.

v2 is up: three commits on top of the first one. It is our own code, built from your reports and reproducers. Thank you @⁠marquezinii, @⁠AlanQiang0418, @⁠rminzao, @⁠welisonzika14-jpg and @⁠kappalegoat; each commit message names what came from whom.

Where the design comes from. Raw views of structured buffers, read as bytes at index * stride + offset, with the record count taken as the raw size over the stride, is how fxceless/victory-fork (GPL-3.0) does it; that fork renders the title's opening lit on NVIDIA. v1 ported its raw_window. v2 follows the same design in the translator and adds what it lacks: copies that start on 16 bytes for views that do not, the record count for buffers read by index, and tests.

What changed

  1. Views not on 16 bytes (@⁠marquezinii). A structured view whose stride is a whole number of dwords now asks shadow::for_view for a copy that starts on 16 bytes (D3D12_RAW_UAV_SRV_BYTE_ALIGNMENT) instead of on an element. A view not on 16 bytes of its buffer's copy gets a copy of its own bytes, as views off their elements already do, and is made raw as well. view_copy uses the same rule (view_align), so draws find and refresh the copy the slot shows. structured_views_off_their_buffers_elements_get_their_own_copy gains the start + 456 case.
  2. Structured handles on raw views (@⁠rminzao). Indexed loads, stores and atomics of heap and table views now use raw handles at index * stride + offset. Root views keep their old path. On the RTX 5090 the new test indexed_loads_and_atomics_of_structured_buffers_read_raw_views (an indexed load from a 12-byte-stride view, an indexed atomic add into an 8-byte-stride unordered view) reads all zeros with v1's structured handles and is right with raw ones. That matches @⁠AlanQiang0418's table (element 1 read as 101/102 for strides 8 to 24) more than "structured handles land right": on this card they do not.
  3. Record counts (@⁠AlanQiang0418, @⁠marquezinii). A structured buffer's descriptor dword 2 read as data is asked through a raw handle, in bytes, and divided by the used-resource entry's stride. It is classified by the stride whether the code reads the buffer by index, at byte offsets (offen) or by scalar loads. a_buffer_descriptors_record_count_reads_as_its_views_kind runs your eleven cases (strides 4, 8, 12, 16 and 24 by index; 12-byte records at a byte offset and by a scalar load; raw; typed; unordered by index and at a byte offset) on the hardware device and WARP: all pass. structured_views_made_raw_keep_the_titles_bytes checks the host side (256 bytes for 16 records of 16).
  4. Test host (@⁠marquezinii, @⁠welisonzika14-jpg, @⁠AlanQiang0418). Stride::Structured makes a raw view for translated programs, as the runtime does, and a real structured view for the native PC reference (Host::dispatch_native), since native HLSL declares a structured buffer. a_heap_buffer_read_by_element_takes_the_views_stride now passes here.
  5. Silent fallback (@⁠rminzao). Views left structured (a stride that is not whole dwords, too many dwords for one raw view) are logged once.

@⁠kappalegoat's three points

  • Query the size through a raw handle and divide by the compile-time stride: done in v2, in both arms of descriptor_data (item 3).
  • The conversion has to be total: done for every stride that is a whole number of dwords, through the own copies of item 1. Not done: strides that are not whole dwords and views of more than 2^27 dwords stay structured. The translator does not read those by index either (it stops on such strides), and they are logged.
  • A translated test that reads dword 2: done, a_buffer_descriptors_record_count_reads_as_its_views_kind. I left the HLSL structured_views_report_their_element_count out for the reason you give: it checks HLSL's GetDimensions on a structured declaration, which cannot hold through any raw view.

Measured

  • cargo test -p victory-gpu --lib: 79 passed, 2 failed, both the known view-heap cap failures (dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views).
  • cargo test -p victory-shader: 209 passed, 1 failed (a_heap_buffer_read_where_no_buffer_view_is_reads_zeros, the heap cap again) at the second commit. At the head I re-ran the stride_tests module on the hardware device: 7 passed, the same heap-cap failure. The full suite at the head is queued behind other GPU work here; I will post it.
  • cargo clippy --workspace --all-targets -- -D warnings, with and without diagnostics: clean. xtask policy: clean.
  • The title's whole shader set, translate --validate --list, v1 against v2: the same programs emit and validate (vertex and pixel 14,217 of 14,259 emitted, all validated; compute 2,687 emitted, 1,952 validated; mesh 8,765 emitted, 8,694 validated). The DXIL of 22,116 programs changes and 3,535 are byte-identical. A build with a marker on the new path shows those 22,116 are exactly the programs that read a structured buffer through it: none changed without taking it, none took it without changing. Most programs read a structured buffer by index, so this is a wide change by nature.

Not done / not tested

  • The two-compiler differential cases ("sizes from descriptors", "sizes for scalar loads") skip here: no console compiler.
  • No in-game A/B of v2 on this branch yet. v1's behaviour in the title is what the description reports.
  • v2 was written on the PR's original base and now conflicts with current main in crates/victory-shader/src/emit/lower.rs; the merge of main follows as its own commit.
  • AMD and Intel: not measured by me. Raw handles on raw views are the matching declaration, so this should be the safe direction there.
**@⁠claude-GTA6** on GitHub · 2026-11-25 02:25 UTC · [original](https://github.com/Marvisak/VIctory/pull/1762#issuecomment-7150702666) *From a tester working with Claude (AI-assisted); measured on my own machine (RTX 5090, Windows 11, Rust 1.98.1 MSVC) and WARP.* v2 is up: three commits on top of the first one. It is our own code, built from your reports and reproducers. Thank you @⁠marquezinii, @⁠AlanQiang0418, @⁠rminzao, @⁠welisonzika14-jpg and @⁠kappalegoat; each commit message names what came from whom. **Where the design comes from.** Raw views of structured buffers, read as bytes at `index * stride + offset`, with the record count taken as the raw size over the stride, is how [fxceless/victory-fork](https://github.com/fxceless/victory-fork) (GPL-3.0) does it; that fork renders the title's opening lit on NVIDIA. v1 ported its `raw_window`. v2 follows the same design in the translator and adds what it lacks: copies that start on 16 bytes for views that do not, the record count for buffers read by index, and tests. **What changed** 1. **Views not on 16 bytes (@⁠marquezinii).** A structured view whose stride is a whole number of dwords now asks `shadow::for_view` for a copy that starts on 16 bytes (`D3D12_RAW_UAV_SRV_BYTE_ALIGNMENT`) instead of on an element. A view not on 16 bytes of its buffer's copy gets a copy of its own bytes, as views off their elements already do, and is made raw as well. `view_copy` uses the same rule (`view_align`), so draws find and refresh the copy the slot shows. `structured_views_off_their_buffers_elements_get_their_own_copy` gains the `start + 456` case. 2. **Structured handles on raw views (@⁠rminzao).** Indexed loads, stores and atomics of heap and table views now use raw handles at `index * stride + offset`. Root views keep their old path. On the RTX 5090 the new test `indexed_loads_and_atomics_of_structured_buffers_read_raw_views` (an indexed load from a 12-byte-stride view, an indexed atomic add into an 8-byte-stride unordered view) reads all zeros with v1's structured handles and is right with raw ones. That matches @⁠AlanQiang0418's table (element 1 read as 101/102 for strides 8 to 24) more than "structured handles land right": on this card they do not. 3. **Record counts (@⁠AlanQiang0418, @⁠marquezinii).** A structured buffer's descriptor dword 2 read as data is asked through a raw handle, in bytes, and divided by the used-resource entry's stride. It is classified by the stride whether the code reads the buffer by index, at byte offsets (`offen`) or by scalar loads. `a_buffer_descriptors_record_count_reads_as_its_views_kind` runs your eleven cases (strides 4, 8, 12, 16 and 24 by index; 12-byte records at a byte offset and by a scalar load; raw; typed; unordered by index and at a byte offset) on the hardware device and WARP: all pass. `structured_views_made_raw_keep_the_titles_bytes` checks the host side (256 bytes for 16 records of 16). 4. **Test host (@⁠marquezinii, @⁠welisonzika14-jpg, @⁠AlanQiang0418).** `Stride::Structured` makes a raw view for translated programs, as the runtime does, and a real structured view for the native PC reference (`Host::dispatch_native`), since native HLSL declares a structured buffer. `a_heap_buffer_read_by_element_takes_the_views_stride` now passes here. 5. **Silent fallback (@⁠rminzao).** Views left structured (a stride that is not whole dwords, too many dwords for one raw view) are logged once. **@⁠kappalegoat's three points** - *Query the size through a raw handle and divide by the compile-time stride:* done in v2, in both arms of `descriptor_data` (item 3). - *The conversion has to be total:* done for every stride that is a whole number of dwords, through the own copies of item 1. Not done: strides that are not whole dwords and views of more than 2^27 dwords stay structured. The translator does not read those by index either (it stops on such strides), and they are logged. - *A translated test that reads dword 2:* done, `a_buffer_descriptors_record_count_reads_as_its_views_kind`. I left the HLSL `structured_views_report_their_element_count` out for the reason you give: it checks HLSL's `GetDimensions` on a structured declaration, which cannot hold through any raw view. **Measured** - `cargo test -p victory-gpu --lib`: 79 passed, 2 failed, both the known view-heap cap failures (`dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views`). - `cargo test -p victory-shader`: 209 passed, 1 failed (`a_heap_buffer_read_where_no_buffer_view_is_reads_zeros`, the heap cap again) at the second commit. At the head I re-ran the `stride_tests` module on the hardware device: 7 passed, the same heap-cap failure. The full suite at the head is queued behind other GPU work here; I will post it. - `cargo clippy --workspace --all-targets -- -D warnings`, with and without `diagnostics`: clean. `xtask policy`: clean. - The title's whole shader set, `translate --validate --list`, v1 against v2: the same programs emit and validate (vertex and pixel 14,217 of 14,259 emitted, all validated; compute 2,687 emitted, 1,952 validated; mesh 8,765 emitted, 8,694 validated). The DXIL of 22,116 programs changes and 3,535 are byte-identical. A build with a marker on the new path shows those 22,116 are exactly the programs that read a structured buffer through it: none changed without taking it, none took it without changing. Most programs read a structured buffer by index, so this is a wide change by nature. **Not done / not tested** - The two-compiler differential cases ("sizes from descriptors", "sizes for scalar loads") skip here: no console compiler. - No in-game A/B of v2 on this branch yet. v1's behaviour in the title is what the description reports. - v2 was written on the PR's original base and now conflicts with current `main` in `crates/victory-shader/src/emit/lower.rs`; the merge of `main` follows as its own commit. - AMD and Intel: not measured by me. Raw handles on raw views are the matching declaration, so this should be the safe direction there.
Author
Owner

@⁠claude-GTA6 on GitHub · 2026-11-25 02:30 UTC · original

From a tester working with Claude (AI-assisted); measured on my own machine.

Merged current main (940d32f6) as 4eb5d1ed; it conflicted in crates/victory-shader/src/emit/lower.rs only, in two hunks (the indexed buffer atomic and the indexed buffer store). main added mark_view_write there at index * stride + offset while still taking a structured handle; v2 takes a raw handle at that byte. Both are kept: structured_raw now also returns the byte, and the atomic and the store pass it to mark_view_write. For heap and table views that is the raw handle's own coordinate, so the mark and the write name the same bytes; root views keep the structured handle with main's byte.

Checked at 4eb5d1ed, all without the hardware device (the card is busy):

  • every workspace test compiles (cargo test --release --workspace --no-run);
  • cargo clippy --workspace --all-targets -- -D warnings, with and without diagnostics: clean; cargo xtask policy: ok;
  • software adapter (WARP): victory-shader stride_tests 8 passed, 0 failed (both new tests included); victory-gpu bindless and structured-view tests 7 passed, 0 failed (raw_reads_of_structured_views_are_right, structured_views_made_raw_keep_the_titles_bytes, structured_views_become_raw_views_of_the_same_bytes, structured_views_off_their_buffers_elements_get_their_own_copy and three older bindless tests).

Not run at this head yet: the full suites on the hardware device (queued here; I will post the counts) and the whole-set translation comparison (the one in the comment above is v1 against v2 before the merge).

**@⁠claude-GTA6** on GitHub · 2026-11-25 02:30 UTC · [original](https://github.com/Marvisak/VIctory/pull/1762#issuecomment-7150803228) *From a tester working with Claude (AI-assisted); measured on my own machine.* Merged current `main` (`940d32f6`) as `4eb5d1ed`; it conflicted in `crates/victory-shader/src/emit/lower.rs` only, in two hunks (the indexed buffer atomic and the indexed buffer store). `main` added `mark_view_write` there at `index * stride + offset` while still taking a structured handle; v2 takes a raw handle at that byte. Both are kept: `structured_raw` now also returns the byte, and the atomic and the store pass it to `mark_view_write`. For heap and table views that is the raw handle's own coordinate, so the mark and the write name the same bytes; root views keep the structured handle with `main`'s byte. Checked at `4eb5d1ed`, all without the hardware device (the card is busy): - every workspace test compiles (`cargo test --release --workspace --no-run`); - `cargo clippy --workspace --all-targets -- -D warnings`, with and without `diagnostics`: clean; `cargo xtask policy`: ok; - software adapter (WARP): `victory-shader` `stride_tests` 8 passed, 0 failed (both new tests included); `victory-gpu` bindless and structured-view tests 7 passed, 0 failed (`raw_reads_of_structured_views_are_right`, `structured_views_made_raw_keep_the_titles_bytes`, `structured_views_become_raw_views_of_the_same_bytes`, `structured_views_off_their_buffers_elements_get_their_own_copy` and three older bindless tests). Not run at this head yet: the full suites on the hardware device (queued here; I will post the counts) and the whole-set translation comparison (the one in the comment above is v1 against v2 before the merge).
Author
Owner

@⁠welisonzika14-jpg on GitHub · 2026-11-25 02:46 UTC · original

RTX 5070 (Blackwell, driver 621.24), Ryzen 7 5700X, Windows 11, Rust 1.98.1 MSVC. cargo test -p victory-gpu -p victory-shader --lib --no-fail-fast, no game files. I tested v2 and then the new head after the merge of main.

tree victory-gpu victory-shader
main 70564ae 76 ok, 2 fail 206 ok, 3 fail
v1 550cac2 77 ok, 2 fail 206 ok, 3 fail
v2 f699994 (base 70564ae) 79 ok, 2 fail 210 ok, 1 fail
4eb5d1e (v2 + main 940d32f) 144 ok, 2 fail 248 ok, 1 fail
v2 + #1779 (before the main merge) 83 ok, 0 fail 211 ok, 0 fail
  • With v2 and with 4eb5d1e, a_heap_buffer_read_by_element_takes_the_views_stride and gathers_at_a_level_match_the_hardware pass on this card. Both failed with v1.
  • What is left is only the view heap cap: the 2 victory-gpu tests and a_heap_buffer_read_where_no_buffer_view_is_reads_zeros.
  • v2 and #1779 together gave a fully green run here. #1779 does not merge cleanly into 4eb5d1e any more, so I could not repeat that on the new head.

Limits: unit tests only, one run each. I did not read the new code and I did not run the title.

Thanks for taking the test-host change in. Written with AI help (Claude/Kiro); the numbers are from runs on my machine.

**@⁠welisonzika14-jpg** on GitHub · 2026-11-25 02:46 UTC · [original](https://github.com/Marvisak/VIctory/pull/1762#issuecomment-7151158790) RTX 5070 (Blackwell, driver 621.24), Ryzen 7 5700X, Windows 11, Rust 1.98.1 MSVC. `cargo test -p victory-gpu -p victory-shader --lib --no-fail-fast`, no game files. I tested v2 and then the new head after the merge of `main`. | tree | `victory-gpu` | `victory-shader` | |---|---|---| | `main` `70564ae` | 76 ok, 2 fail | 206 ok, 3 fail | | v1 `550cac2` | 77 ok, 2 fail | 206 ok, 3 fail | | v2 `f699994` (base `70564ae`) | 79 ok, 2 fail | 210 ok, 1 fail | | **`4eb5d1e`** (v2 + `main` `940d32f`) | 144 ok, 2 fail | **248 ok, 1 fail** | | v2 + #1779 (before the `main` merge) | 83 ok, 0 fail | 211 ok, 0 fail | - With v2 and with `4eb5d1e`, `a_heap_buffer_read_by_element_takes_the_views_stride` and `gathers_at_a_level_match_the_hardware` pass on this card. Both failed with v1. - What is left is only the view heap cap: the 2 `victory-gpu` tests and `a_heap_buffer_read_where_no_buffer_view_is_reads_zeros`. - v2 and #1779 together gave a fully green run here. #1779 does not merge cleanly into `4eb5d1e` any more, so I could not repeat that on the new head. Limits: unit tests only, one run each. I did not read the new code and I did not run the title. Thanks for taking the test-host change in. Written with AI help (Claude/Kiro); the numbers are from runs on my machine.
Author
Owner

@⁠claude-GTA6 on GitHub · 2026-11-25 03:40 UTC · original

From a tester working with Claude (AI-assisted); measured on my own machine.

The full suites at 4eb5d1ed on the hardware device (RTX 5090), as promised:

  • victory-shader: 248 passed, 1 failed: a_heap_buffer_read_where_no_buffer_view_is_reads_zeros, the view-heap cap.
  • victory-gpu: 142 passed, 4 failed: the two view-heap cap tests, plus watch::tests::writes_through_another_mapping_mark_the_tracker and shadow::tests::marked_pages_go_back_by_the_bytes_the_gpu_changed.

Those last two are in watch.rs and shadow.rs, files this PR does not touch, and neither makes a view. Both pass when run alone on the software adapter at this head. I have not run plain main through the full parallel suite on this card, so I can't say they fail there too: only that they are outside this PR's files and pass alone. That matches @⁠welisonzika14-jpg's run on a 5070 above (144 / 2 and 248 / 1), where the heap-cap tests were the only failures.

**@⁠claude-GTA6** on GitHub · 2026-11-25 03:40 UTC · [original](https://github.com/Marvisak/VIctory/pull/1762#issuecomment-7152130563) *From a tester working with Claude (AI-assisted); measured on my own machine.* The full suites at `4eb5d1ed` on the hardware device (RTX 5090), as promised: - `victory-shader`: 248 passed, 1 failed: `a_heap_buffer_read_where_no_buffer_view_is_reads_zeros`, the view-heap cap. - `victory-gpu`: 142 passed, 4 failed: the two view-heap cap tests, plus `watch::tests::writes_through_another_mapping_mark_the_tracker` and `shadow::tests::marked_pages_go_back_by_the_bytes_the_gpu_changed`. Those last two are in `watch.rs` and `shadow.rs`, files this PR does not touch, and neither makes a view. Both pass when run alone on the software adapter at this head. I have not run plain `main` through the full parallel suite on this card, so I can't say they fail there too: only that they are outside this PR's files and pass alone. That matches @⁠welisonzika14-jpg's run on a 5070 above (144 / 2 and 248 / 1), where the heap-cap tests were the only failures.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 03:41 UTC · original · edited 2026-11-25 09:18 UTC

Automated triage for the maintainers.

Needs work (close). v3 (9f1da58f) starts a raw view on the 16 bytes at or below the title's first byte (raw_window in crates/victory-gpu/src/descriptor/host.rs). It records the skipped bytes in the top bits of the view-stride entry (VIEW_SKIP_SHIFT), and emit/lower.rs adds them to byte addresses through raw heap views that may be structured. Head 19c8013 only adds #[cfg(test)] to stride_table in emit/host.rs.

Update since the last review. @⁠wbkepler ran this head in the title on an RTX 5090, merged with a few other open NVIDIA fixes (#1775, #1778, #1779, #1769, #2175): the world goes from flat grey to the intro scene, with no device removal. @⁠Mericas77's RTX 4070 run of the suites at 19c8013 also fixes two failures that main has. Together with @⁠nathanbzrr's RX 7600 run, that covers most of the open testing. Still open:

  • the PR description covers v2, not v3. It still says AMD is untested and does not describe the skip bits;
  • this PR conflicts with #1779 in five files. You and @⁠wbkepler agreed that #1779 takes the rebase; the maintainer should know which order to merge in;
  • @⁠r4tedx reports that the test host looks up root signatures by pointer, and a released pointer can be reused (their eeabda1 keeps the signatures alive). Worth taking in or answering here;
  • the test-host part still overlaps #1887.

On your reply: keeping this head fixed while #1779 rebases is fine. A short v3 section in the description would make this ready for a maintainer's look.

CI: no check runs on the head commit.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 03:41 UTC · [original](https://github.com/Marvisak/VIctory/pull/1762#issuecomment-7152146484) · edited 2026-11-25 09:18 UTC <!-- victory-triage v1 head=19c801300b882df48e9a7d586a4767142a7b0ca3 verdict=needs-work at=2026-11-25T09:18:30Z --> Automated triage for the maintainers. **Needs work (close).** v3 (`9f1da58f`) starts a raw view on the 16 bytes at or below the title's first byte (`raw_window` in `crates/victory-gpu/src/descriptor/host.rs`). It records the skipped bytes in the top bits of the view-stride entry (`VIEW_SKIP_SHIFT`), and `emit/lower.rs` adds them to byte addresses through raw heap views that may be structured. Head `19c8013` only adds `#[cfg(test)]` to `stride_table` in `emit/host.rs`. Update since the last review. @⁠wbkepler ran this head in the title on an RTX 5090, merged with a few other open NVIDIA fixes (#1775, #1778, #1779, #1769, #2175): the world goes from flat grey to the intro scene, with no device removal. @⁠Mericas77's RTX 4070 run of the suites at `19c8013` also fixes two failures that `main` has. Together with @⁠nathanbzrr's RX 7600 run, that covers most of the open testing. Still open: - the PR description covers v2, not v3. It still says AMD is untested and does not describe the skip bits; - this PR conflicts with #1779 in five files. You and @⁠wbkepler agreed that #1779 takes the rebase; the maintainer should know which order to merge in; - @⁠r4tedx reports that the test host looks up root signatures by pointer, and a released pointer can be reused (their `eeabda1` keeps the signatures alive). Worth taking in or answering here; - the test-host part still overlaps #1887. On your reply: keeping this head fixed while #1779 rebases is fine. A short v3 section in the description would make this ready for a maintainer's look. CI: no check runs on the head commit. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠moe-miau on GitHub · 2026-11-25 03:49 UTC · original

In-game on main plus this PR only (the "Not covered" point above), RTX 4070 SUPER: the black world goes, and frames are about 8 times faster

Setup: RTX 4070 SUPER 12 GB, driver 32.0.16.1742, Windows 11 26300. Title 1.0.2.1, Series X profile, diag build, a fresh shader cache per run. A save past first-boot setup, then VICTORY_KEYS pressing Enter every 6 s from 25 s to 150 s, which reaches the intro cutscene at about 90 s. Each run is 6 minutes.

main 940d32f alone removes the device at 27 s on NVIDIA (#1753), so both runs include #1775 to get past that. Both merge cleanly with this PR (head 4eb5d1e).

Tree Cutscene picture Frame time in the cutscene Device
940d32f + #1775 black for the whole run (mean level 0.1 of 255) about 8 s per frame (0.1 fps) no removal in 6 min
940d32f + #1775 + #1762 drawn: a dim dusk city scene, with building silhouettes against the sky and particles (mean level 0 → 5.6 → 6.3 at 120/150/180 s) 0.6-1.3 s per frame 0x887A0006 at 210 s

Other counts for the #1762 run: 136 pipelines refused (the wave64 compute programs NVIDIA cannot run, as before), 11 shaders not translated, 1 no host texture (the 2560x1440 format-115 target, #797).

What this shows on main itself:

  • The structured-view conversion is enough to turn the black cutscene into a drawn one, without the rest of the tester's branch.
  • It also removes most of the frame time: about 8 s per frame down to about 1 s. That fits the zero-divisor loops of #1581, where 42683eebec081520 and 8bbcbda6008eaa37 read their divisors through structured views. On this card those reads return 0 without the conversion, and the loops run about 4 billion times.

Still there:

  • The picture is dark and soft compared with fxceless/victory-fork on the same machine and route, which also draws characters and street lights at this point.
  • The device removal at 210 s is a watchdog stop (0x887A0006), not an invalid call. With frames now about 8 times faster, more of the world's work runs per second. The baseline run only survived longer because it rendered so few frames. I haven't isolated the stopping dispatch on this tree yet.

One run each, no debug layer. Counts and times only, no captures attached.

AI-assisted (Claude Code); runs done on my machine.

**@⁠moe-miau** on GitHub · 2026-11-25 03:49 UTC · [original](https://github.com/Marvisak/VIctory/pull/1762#issuecomment-7152269721) **In-game on `main` plus this PR only (the "Not covered" point above), RTX 4070 SUPER: the black world goes, and frames are about 8 times faster** **Setup:** RTX 4070 SUPER 12 GB, driver 32.0.16.1742, Windows 11 26300. Title 1.0.2.1, Series X profile, diag build, a fresh shader cache per run. A save past first-boot setup, then `VICTORY_KEYS` pressing Enter every 6 s from 25 s to 150 s, which reaches the intro cutscene at about 90 s. Each run is 6 minutes. `main` `940d32f` alone removes the device at 27 s on NVIDIA (#1753), so both runs include #1775 to get past that. Both merge cleanly with this PR (head `4eb5d1e`). | Tree | Cutscene picture | Frame time in the cutscene | Device | |---|---|---|---| | `940d32f` + #1775 | black for the whole run (mean level 0.1 of 255) | about 8 s per frame (0.1 fps) | no removal in 6 min | | `940d32f` + #1775 + **#1762** | **drawn**: a dim dusk city scene, with building silhouettes against the sky and particles (mean level 0 → 5.6 → 6.3 at 120/150/180 s) | **0.6-1.3 s per frame** | `0x887A0006` at 210 s | Other counts for the #1762 run: 136 pipelines refused (the wave64 compute programs NVIDIA cannot run, as before), 11 shaders not translated, 1 `no host texture` (the 2560x1440 format-115 target, #797). **What this shows on `main` itself:** - The structured-view conversion is enough to turn the black cutscene into a drawn one, without the rest of the tester's branch. - It also removes most of the frame time: about 8 s per frame down to about 1 s. That fits the zero-divisor loops of #1581, where `42683eebec081520` and `8bbcbda6008eaa37` read their divisors through structured views. On this card those reads return 0 without the conversion, and the loops run about 4 billion times. **Still there:** - The picture is dark and soft compared with `fxceless/victory-fork` on the same machine and route, which also draws characters and street lights at this point. - The device removal at 210 s is a watchdog stop (`0x887A0006`), not an invalid call. With frames now about 8 times faster, more of the world's work runs per second. The baseline run only survived longer because it rendered so few frames. I haven't isolated the stopping dispatch on this tree yet. One run each, no debug layer. Counts and times only, no captures attached. AI-assisted (Claude Code); runs done on my machine.
Author
Owner

@⁠BaggyALPHA on GitHub · 2026-11-25 04:01 UTC · original

Independent Windows check on RTX 3080 (driver 621.24), with v2 4eb5d1ed applied to upstream 940d32f.

  • a_heap_buffer_read_by_element_takes_the_views_stride failed on upstream hardware and passed with the PR. The PR's raw_reads_of_structured_views_are_right end-to-end descriptor test also passed.
  • I ran the complete victory-gpu library suite 9 times on each tree (one serial, eight with default threading). Upstream consistently had 141 passed, 2 failed, 2 ignored. The PR consistently had 144 passed, 2 failed, 2 ignored. Both failures in every run were the known NVIDIA descriptor-heap-cap tests.
  • Neither tree reproduced writes_through_another_mapping_mark_the_tracker or marked_pages_go_back_by_the_bytes_the_gpu_changed in this matrix. That limits the observed failures to the other setup or a condition this run did not exercise.

These are synthetic tests on Ampere. AMD/Intel and title rendering remain outside this check. No game files were used. AI-assisted (OpenAI Codex).

**@⁠BaggyALPHA** on GitHub · 2026-11-25 04:01 UTC · [original](https://github.com/Marvisak/VIctory/pull/1762#issuecomment-7152450782) Independent Windows check on RTX 3080 (driver 621.24), with v2 `4eb5d1ed` applied to upstream `940d32f`. - `a_heap_buffer_read_by_element_takes_the_views_stride` failed on upstream hardware and passed with the PR. The PR's `raw_reads_of_structured_views_are_right` end-to-end descriptor test also passed. - I ran the complete `victory-gpu` library suite 9 times on each tree (one serial, eight with default threading). Upstream consistently had 141 passed, 2 failed, 2 ignored. The PR consistently had 144 passed, 2 failed, 2 ignored. Both failures in every run were the known NVIDIA descriptor-heap-cap tests. - Neither tree reproduced `writes_through_another_mapping_mark_the_tracker` or `marked_pages_go_back_by_the_bytes_the_gpu_changed` in this matrix. That limits the observed failures to the other setup or a condition this run did not exercise. These are synthetic tests on Ampere. AMD/Intel and title rendering remain outside this check. No game files were used. AI-assisted (OpenAI Codex).
Author
Owner

@⁠claude-GTA6 on GitHub · 2026-11-25 04:18 UTC · original

From a tester working with Claude (AI-assisted); measured on my own machine.

Thank you both, these are the independent numbers this PR was missing.

  • @⁠moe-miau: main plus only this PR drawing the cutscene, at about 1 s per frame instead of about 8 s, on an RTX 4070 SUPER, separates this change from the rest of our branch. That is the result we could not give. We have not seen the 0x887A0006 at 210 s on our side. Our runs are 420 s from a later save on an RTX 5090 with the rest of our branch, so they are not a comparison. If you isolate the dispatch, I'll look at it here.
  • @⁠BaggyALPHA: thanks for the 9 runs per tree on Ampere. 141 to 144 passed, with the same two heap-cap failures on both trees, matches what we saw on the 5090.

I have updated the description to cover v2 (what each commit adds, and the overlap with #1887), as the triage note asked. AMD and Intel at this head are still untested by us. A run on either would be welcome.

**@⁠claude-GTA6** on GitHub · 2026-11-25 04:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/1762#issuecomment-7152719220) *From a tester working with Claude (AI-assisted); measured on my own machine.* Thank you both, these are the independent numbers this PR was missing. - @⁠moe-miau: `main` plus only this PR drawing the cutscene, at about 1 s per frame instead of about 8 s, on an RTX 4070 SUPER, separates this change from the rest of our branch. That is the result we could not give. We have not seen the `0x887A0006` at 210 s on our side. Our runs are 420 s from a later save on an RTX 5090 with the rest of our branch, so they are not a comparison. If you isolate the dispatch, I'll look at it here. - @⁠BaggyALPHA: thanks for the 9 runs per tree on Ampere. 141 to 144 passed, with the same two heap-cap failures on both trees, matches what we saw on the 5090. I have updated the description to cover v2 (what each commit adds, and the overlap with #1887), as the triage note asked. AMD and Intel at this head are still untested by us. A run on either would be welcome.
Author
Owner

@⁠r4tedx on GitHub · 2026-11-25 04:21 UTC · original

@⁠claude-GTA6, this is the fix I was about to redo on main after #704 was closed, so I'll put my evidence here instead of opening a second PR. On an RTX 5070 (Windows 11, native D3D12), main's a_heap_buffer_read_by_element_takes_the_views_stride fails at 940d32f with [101, 104, 107, …, 131, 0, …] for 200 + lane (byte × 3, then past the end), as BaggyALPHA saw on the RTX 3080 (#704 comment 7152593819). Making structured views raw at the source, as you do, avoids the extra alias slots #704 needed.

One gap remains, and you leave it open on purpose: typed buffer views read through a raw handle. Typed views stay typed here (your raw_stride(DXGI_FORMAT_R32G32B32A32_FLOAT, 0) == 0 test), which is right for buffer_load_format. But main still reads some typed slots with raw handles:

  • s_buffer_load from an SRV/UAV slot (the smem fallback's handle(…, (11, 0)));
  • unindexed buffer_load_dword* with no idxen.

On NVIDIA that's the same mismatch. #704's table had a typed RGBA32F view read through a raw handle giving 136 for 109 on the RTX 5070. A scalar load of an RGBA32F slot through a raw handle read 0 instead of the data on WARP too, measured on a tree-side form of this fix. In this title, the instance-culling programs read their loop counts with s_buffer_load from a slot whose used-resource stride is 1, holding a typed byte-buffer view.

Would you like that in this PR, or as a follow-up on top of it? A follow-up would be small:

  • a raw view of the same bytes only for typed buffer views (structured ones are already raw with your change);
  • the two raw-handle read paths above go through it when the slot holds a typed view;
  • tests for a scalar RGBA32F read and a stride-1 typed byte buffer.

Either way works for me. I'd rather not touch buffer_srv/buffer_uav in a separate PR while this one is in review.

Nothing was run for this comment beyond the earlier RTX 5070 check of main's test. The RTX 5070 here is out of use for today after a hard freeze, so a new before/after on NVIDIA would come from someone else.

AI-assisted (Claude Code).

**@⁠r4tedx** on GitHub · 2026-11-25 04:21 UTC · [original](https://github.com/Marvisak/VIctory/pull/1762#issuecomment-7152775291) @⁠claude-GTA6, this is the fix I was about to redo on `main` after #704 was closed, so I'll put my evidence here instead of opening a second PR. On an RTX 5070 (Windows 11, native D3D12), `main`'s `a_heap_buffer_read_by_element_takes_the_views_stride` fails at `940d32f` with `[101, 104, 107, …, 131, 0, …]` for `200 + lane` (byte × 3, then past the end), as BaggyALPHA saw on the RTX 3080 (#704 comment 7152593819). Making structured views raw at the source, as you do, avoids the extra alias slots #704 needed. One gap remains, and you leave it open on purpose: **typed buffer views read through a raw handle.** Typed views stay typed here (your `raw_stride(DXGI_FORMAT_R32G32B32A32_FLOAT, 0) == 0` test), which is right for `buffer_load_format`. But `main` still reads some typed slots with raw handles: - `s_buffer_load` from an SRV/UAV slot (the `smem` fallback's `handle(…, (11, 0))`); - unindexed `buffer_load_dword*` with no `idxen`. On NVIDIA that's the same mismatch. #704's table had a typed RGBA32F view read through a raw handle giving 136 for 109 on the RTX 5070. A scalar load of an RGBA32F slot through a raw handle read 0 instead of the data on WARP too, measured on a tree-side form of this fix. In this title, the instance-culling programs read their loop counts with `s_buffer_load` from a slot whose used-resource stride is 1, holding a typed byte-buffer view. Would you like that in this PR, or as a follow-up on top of it? A follow-up would be small: - a raw view of the same bytes only for **typed** buffer views (structured ones are already raw with your change); - the two raw-handle read paths above go through it when the slot holds a typed view; - tests for a scalar RGBA32F read and a stride-1 typed byte buffer. Either way works for me. I'd rather not touch `buffer_srv`/`buffer_uav` in a separate PR while this one is in review. Nothing was run for this comment beyond the earlier RTX 5070 check of `main`'s test. The RTX 5070 here is out of use for today after a hard freeze, so a new before/after on NVIDIA would come from someone else. AI-assisted (Claude Code).
Author
Owner

@⁠claude-GTA6 on GitHub · 2026-11-25 04:49 UTC · original

From a tester working with Claude (AI-assisted); measured on my own machine.

@⁠r4tedx thanks, and for the RTX 5070 numbers. A follow-up on top of this PR, please: it keeps this one reviewable as it stands, and the typed-view path is a separate fix with its own tests. Your outline (a raw view of the same bytes only for typed buffer views, used by the s_buffer_load SRV/UAV fallback and by unindexed buffer_load_dword* without idxen, plus the RGBA32F scalar and stride-1 byte-buffer tests) sounds right to me. I won't touch buffer_srv/buffer_uav beyond this PR's head meanwhile. Once it is up I'll run it on an RTX 5090 with the instance-culling loop counts and post the before/after here and on yours.

**@⁠claude-GTA6** on GitHub · 2026-11-25 04:49 UTC · [original](https://github.com/Marvisak/VIctory/pull/1762#issuecomment-7153194758) *From a tester working with Claude (AI-assisted); measured on my own machine.* @⁠r4tedx thanks, and for the RTX 5070 numbers. A follow-up on top of this PR, please: it keeps this one reviewable as it stands, and the typed-view path is a separate fix with its own tests. Your outline (a raw view of the same bytes only for typed buffer views, used by the `s_buffer_load` SRV/UAV fallback and by unindexed `buffer_load_dword*` without `idxen`, plus the RGBA32F scalar and stride-1 byte-buffer tests) sounds right to me. I won't touch `buffer_srv`/`buffer_uav` beyond this PR's head meanwhile. Once it is up I'll run it on an RTX 5090 with the instance-culling loop counts and post the before/after here and on yours.
Author
Owner

@⁠r4tedx on GitHub · 2026-11-25 04:56 UTC · original

@⁠claude-GTA6, thanks. I will put the typed-view follow-up on top of this PR at 4eb5d1e, leaving buffer_srv/buffer_uav's structured path as it is here. I will post it here when it is up, with WARP results. The RTX 5070 here is out of use for today, so your RTX 5090 before/after with the instance-culling loop counts would be the NVIDIA check.

AI-assisted (Claude Code).

**@⁠r4tedx** on GitHub · 2026-11-25 04:56 UTC · [original](https://github.com/Marvisak/VIctory/pull/1762#issuecomment-7153296839) @⁠claude-GTA6, thanks. I will put the typed-view follow-up on top of this PR at `4eb5d1e`, leaving `buffer_srv`/`buffer_uav`'s structured path as it is here. I will post it here when it is up, with WARP results. The RTX 5070 here is out of use for today, so your RTX 5090 before/after with the instance-culling loop counts would be the NVIDIA check. AI-assisted (Claude Code).
Author
Owner

@⁠astrosteveo on GitHub · 2026-11-25 05:13 UTC · original

Two things from Linux (Wine 11.22, vkd3d-proton, RTX 5080, driver 620.73.04), at head 4eb5d1e: a write that v2 loses, with a test, and numbers for a stack nobody has reported yet. Synthetic buffers only; I did not run the title.

A structured view on an element but not on 16 bytes no longer shares the buffer's writes. copy_align makes shadow::for_view give such a view a copy of its own bytes, and copies only meet around a submission (refreshed before it, copied back after it). So within one list:

  • a write through a view of the whole buffer is not seen through the structured view;
  • a write through the structured view is not seen through a view of the whole buffer.

structured_views_off_16_bytes_share_the_buffers_writes, one commit on your head (0499a96, branch test/1762-off-16-bytes), writes and reads a 256-byte buffer through views of 12-byte elements, with the accesses declared as draw::readable declares them:

first element 0 or 4 (on 16 bytes) 1 or 2 (off 16 bytes)
main 940d32f + the test, one list right right
4eb5d1e, one list right old data, both directions
either, two submissions right right

It should not depend on the vendor, since the two views are two host buffers. On native NVIDIA, main may fail the read direction for the reason this PR exists, so compare with your own head there. main has the same gap for views that start off an element (from reading for_view, not measured); v2 widens it to views that start on one. I don't know how often the title writes and reads through such views in one submission.

An idea only, not tried: start the raw view at the 16 bytes below, in the buffer's own copy, and have the translation add the rest (it already has a per-view entry in the stride table). Nothing then needs a copy of its own.

On vkd3d-proton the reads are already right without this PR. With main's runtime and only your tests added, raw_reads_of_structured_views_are_right passes. So do raw reads of 12-byte-stride views from elements 0 to 4, and indexed_loads_and_atomics_of_structured_buffers_read_raw_views. Of the eleven cases of a_buffer_descriptors_record_count_reads_as_its_views_kind, only the two record counts at a byte offset fail there (192 for 16), and this PR fixes them.

Full suites here (cargo test --workspace --no-fail-fast -- --test-threads=1): main 688 passed and 13 failed, 4eb5d1e 693 passed and the same 13 failed. Three of the 13 are the view-heap cap; none are new. It merges with #1779's rebase and #1906 with one conflict, two new test programs in the same place in stride_tests.rs.


Co-Authored-By: Claude Opus 5.5 <[email protected]>

**@⁠astrosteveo** on GitHub · 2026-11-25 05:13 UTC · [original](https://github.com/Marvisak/VIctory/pull/1762#issuecomment-7153570585) Two things from Linux (Wine 11.22, vkd3d-proton, RTX 5080, driver 620.73.04), at head `4eb5d1e`: a write that v2 loses, with a test, and numbers for a stack nobody has reported yet. Synthetic buffers only; I did not run the title. **A structured view on an element but not on 16 bytes no longer shares the buffer's writes.** `copy_align` makes `shadow::for_view` give such a view a copy of its own bytes, and copies only meet around a submission (refreshed before it, copied back after it). So within one list: - a write through a view of the whole buffer is not seen through the structured view; - a write through the structured view is not seen through a view of the whole buffer. `structured_views_off_16_bytes_share_the_buffers_writes`, one commit on your head ([`0499a96`](https://github.com/astrosteveo/VIctory/commit/0499a96), branch [`test/1762-off-16-bytes`](https://github.com/astrosteveo/VIctory/tree/test/1762-off-16-bytes)), writes and reads a 256-byte buffer through views of 12-byte elements, with the accesses declared as `draw::readable` declares them: | | first element 0 or 4 (on 16 bytes) | 1 or 2 (off 16 bytes) | |---|---|---| | `main` `940d32f` + the test, one list | right | right | | `4eb5d1e`, one list | right | **old data, both directions** | | either, two submissions | right | right | It should not depend on the vendor, since the two views are two host buffers. On native NVIDIA, `main` may fail the read direction for the reason this PR exists, so compare with your own head there. `main` has the same gap for views that start off an element (from reading `for_view`, not measured); v2 widens it to views that start on one. I don't know how often the title writes and reads through such views in one submission. An idea only, not tried: start the raw view at the 16 bytes below, in the buffer's own copy, and have the translation add the rest (it already has a per-view entry in the stride table). Nothing then needs a copy of its own. **On vkd3d-proton the reads are already right without this PR.** With `main`'s runtime and only your tests added, `raw_reads_of_structured_views_are_right` passes. So do raw reads of 12-byte-stride views from elements 0 to 4, and `indexed_loads_and_atomics_of_structured_buffers_read_raw_views`. Of the eleven cases of `a_buffer_descriptors_record_count_reads_as_its_views_kind`, only the two record counts at a byte offset fail there (192 for 16), and this PR fixes them. **Full suites here** (`cargo test --workspace --no-fail-fast -- --test-threads=1`): `main` 688 passed and 13 failed, `4eb5d1e` 693 passed and the same 13 failed. Three of the 13 are the view-heap cap; none are new. It merges with #1779's rebase and #1906 with one conflict, two new test programs in the same place in `stride_tests.rs`. --- <sub>Co-Authored-By: Claude Opus 5.5 &lt;[email protected]&gt;</sub>
Author
Owner

@⁠claude-GTA6 on GitHub · 2026-11-25 05:20 UTC · original

From a tester working with Claude (AI-assisted); measured on my own machine.

@⁠astrosteveo thank you, that is a real gap, and the test shows it exactly. You're right that v2 widens it: copy_align gives an on-element, off-16-bytes view a copy of its own, and within one list the copy and the buffer don't see each other's writes. I'm reworking it along your idea (the raw view starts at the 16 bytes below, in the buffer's own copy, and the translation adds the rest through the view's stride-table entry, so no view gets a copy of its own), with your test taken in and credited. I'll post the new head here with WARP and RTX 5090 counts, and compare with main on native NVIDIA as you suggest. Thanks also for the vkd3d-proton numbers: useful to know the reads are already right there and only the two byte-offset record counts differ.

@⁠r4tedx thanks, I'll run your follow-up on the 5090 with the instance-culling loop counts once it's up.

**@⁠claude-GTA6** on GitHub · 2026-11-25 05:20 UTC · [original](https://github.com/Marvisak/VIctory/pull/1762#issuecomment-7153681355) *From a tester working with Claude (AI-assisted); measured on my own machine.* @⁠astrosteveo thank you, that is a real gap, and the test shows it exactly. You're right that v2 widens it: `copy_align` gives an on-element, off-16-bytes view a copy of its own, and within one list the copy and the buffer don't see each other's writes. I'm reworking it along your idea (the raw view starts at the 16 bytes below, in the buffer's own copy, and the translation adds the rest through the view's stride-table entry, so no view gets a copy of its own), with your test taken in and credited. I'll post the new head here with WARP and RTX 5090 counts, and compare with `main` on native NVIDIA as you suggest. Thanks also for the vkd3d-proton numbers: useful to know the reads are already right there and only the two byte-offset record counts differ. @⁠r4tedx thanks, I'll run your follow-up on the 5090 with the instance-culling loop counts once it's up.
Author
Owner

@⁠claude-GTA6 on GitHub · 2026-11-25 06:09 UTC · original

From a tester working with Claude (AI-assisted); measured on my own machine.

v3 is up (head 74497650), on @⁠astrosteveo's report:

  • 9f1da58f: a structured view whose bytes are on an element but not on 16 bytes is now a raw view of its buffer's own copy, starting at the 16 bytes below. The translation adds the remaining bytes through that view's stride-table entry, so no view gets a copy of its own. copy_align's per-view copies are gone. astrosteveo's structured_views_off_16_bytes_share_the_buffers_writes (their 0499a96) is taken in and credited. It fails at 4eb5d1ed and passes here.
  • 74497650: tests only. A dispatch or draw that binds no view-stride table gets one of zeros.

RTX 5090 (Windows 11), the suites at this head against 4eb5d1ed: victory-shader 249 passed, 1 failed; victory-gpu 145 passed, 2 failed. The failures are the known descriptor-heap-cap tests, as before. WARP failures are unchanged. The DXIL of the same programs changes as in v2. Not run in the title yet at this head. AMD and Intel are still untested.

**@⁠claude-GTA6** on GitHub · 2026-11-25 06:09 UTC · [original](https://github.com/Marvisak/VIctory/pull/1762#issuecomment-7154494184) *From a tester working with Claude (AI-assisted); measured on my own machine.* v3 is up (head `74497650`), on @⁠astrosteveo's report: - `9f1da58f`: a structured view whose bytes are on an element but not on 16 bytes is now a raw view of its buffer's own copy, starting at the 16 bytes below. The translation adds the remaining bytes through that view's stride-table entry, so no view gets a copy of its own. `copy_align`'s per-view copies are gone. astrosteveo's `structured_views_off_16_bytes_share_the_buffers_writes` (their `0499a96`) is taken in and credited. It fails at `4eb5d1ed` and passes here. - `74497650`: tests only. A dispatch or draw that binds no view-stride table gets one of zeros. RTX 5090 (Windows 11), the suites at this head against `4eb5d1ed`: victory-shader 249 passed, 1 failed; victory-gpu 145 passed, 2 failed. The failures are the known descriptor-heap-cap tests, as before. WARP failures are unchanged. The DXIL of the same programs changes as in v2. Not run in the title yet at this head. AMD and Intel are still untested.
Author
Owner

@⁠nathanbzrr on GitHub · 2026-11-25 06:37 UTC · original

AMD RDNA3 + D3D12 Debug Layer + WARP test report for 74497650 (merged on main 940d32f), plus a minor CI -D warnings catch:

Environment

  • Windows 11 10.0.26340 x64, rustc 1.98.1 (x86_64-pc-windows-msvc)
  • GPU: AMD Radeon RX 7600 (RDNA3, driver 32.0.32029.2010) + D3D12 WARP
  • DXIL validator: Windows SDK dxil.dll 1.8.2502.11
  • Scope: synthetic workspace tests only (no game files / title not run)

Results on 74497650

  • cargo test -p victory-shader --locked stride_tests -- --nocapture: 9 passed, 0 failed (both hardware RX 7600 and warp executed with 0 skips, including a_buffer_descriptors_record_count_reads_as_its_views_kind, indexed_loads_and_atomics_of_structured_buffers_read_raw_views, and scalar_loads_of_structured_views_add_the_bytes_their_views_start_early)
  • cargo test -p victory-shader --locked: 250 passed, 0 failed, 3 ignored
  • cargo test -p victory-gpu --locked raw_reads_of_structured_views_are_right: 1 passed
  • cargo test -p victory-gpu --locked structured_views_off_16_bytes_share_the_buffers_writes: 1 passed
  • cargo test -p victory-gpu --locked -- --test-threads=1: 147 passed, 0 failed, 2 ignored
  • cargo test -p victory-gpu --all-features --locked -- --test-threads=1: 150 passed, 0 failed, 2 ignored
  • VICTORY_D3D12_DEBUG=1 cargo test -p victory-gpu --locked -- --test-threads=1: 147 passed, 0 failed, 2 ignored
  • VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_WARP=1 cargo test -p victory-gpu --locked -- --test-threads=1: 147 passed, 0 failed, 2 ignored
  • cargo test --workspace --locked: all passed (including xtask 6/6)

One CI -D warnings catch
cargo clippy --workspace --all-targets --locked -- -D warnings (and --all-features) fails in the non-test victory-shader library build because stride_table in crates/victory-shader/src/emit/host.rs:27 is only called from #[cfg(test)] methods (draw and dispatch_as) without #[cfg(test)] on the helper:

error: function `stride_table` is never used
  --> crates\victory-shader\src\emit\host.rs:27:4
   = note: `-D dead-code` implied by `-D warnings`

Adding #[cfg(test)] on fn stride_table will make .github/workflows/ci.yml pass cleanly.

AI-assisted review/testing; all builds and GPU runs executed locally on my own machine. No game files used.

**@⁠nathanbzrr** on GitHub · 2026-11-25 06:37 UTC · [original](https://github.com/Marvisak/VIctory/pull/1762#issuecomment-7154983157) AMD RDNA3 + D3D12 Debug Layer + WARP test report for `74497650` (merged on `main` `940d32f`), plus a minor CI `-D warnings` catch: **Environment** - Windows 11 `10.0.26340` x64, `rustc 1.98.1` (`x86_64-pc-windows-msvc`) - GPU: **AMD Radeon RX 7600** (RDNA3, driver `32.0.32029.2010`) + **D3D12 WARP** - DXIL validator: Windows SDK `dxil.dll 1.8.2502.11` - Scope: synthetic workspace tests only (no game files / title not run) **Results on `74497650`** - `cargo test -p victory-shader --locked stride_tests -- --nocapture`: **9 passed, 0 failed** (both `hardware` RX 7600 and `warp` executed with 0 skips, including `a_buffer_descriptors_record_count_reads_as_its_views_kind`, `indexed_loads_and_atomics_of_structured_buffers_read_raw_views`, and `scalar_loads_of_structured_views_add_the_bytes_their_views_start_early`) - `cargo test -p victory-shader --locked`: **250 passed, 0 failed, 3 ignored** - `cargo test -p victory-gpu --locked raw_reads_of_structured_views_are_right`: **1 passed** - `cargo test -p victory-gpu --locked structured_views_off_16_bytes_share_the_buffers_writes`: **1 passed** - `cargo test -p victory-gpu --locked -- --test-threads=1`: **147 passed, 0 failed, 2 ignored** - `cargo test -p victory-gpu --all-features --locked -- --test-threads=1`: **150 passed, 0 failed, 2 ignored** - `VICTORY_D3D12_DEBUG=1 cargo test -p victory-gpu --locked -- --test-threads=1`: **147 passed, 0 failed, 2 ignored** - `VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_WARP=1 cargo test -p victory-gpu --locked -- --test-threads=1`: **147 passed, 0 failed, 2 ignored** - `cargo test --workspace --locked`: **all passed** (including `xtask` 6/6) **One CI `-D warnings` catch** `cargo clippy --workspace --all-targets --locked -- -D warnings` (and `--all-features`) fails in the non-test `victory-shader` library build because `stride_table` in `crates/victory-shader/src/emit/host.rs:27` is only called from `#[cfg(test)]` methods (`draw` and `dispatch_as`) without `#[cfg(test)]` on the helper: ``` error: function `stride_table` is never used --> crates\victory-shader\src\emit\host.rs:27:4 = note: `-D dead-code` implied by `-D warnings` ``` Adding `#[cfg(test)]` on `fn stride_table` will make `.github/workflows/ci.yml` pass cleanly. *AI-assisted review/testing; all builds and GPU runs executed locally on my own machine. No game files used.*
Author
Owner

@⁠claude-GTA6 on GitHub · 2026-11-25 06:55 UTC · original

From a tester working with Claude (AI-assisted); measured on my own machine.

@⁠nathanbzrr thank you, that closes the AMD gap for this PR: RDNA3, WARP and the debug layer all clean at 74497650. The clippy catch is fixed in 19c80130 (stride_table is #[cfg(test)], as you suggested). cargo clippy --workspace --all-targets --locked -- -D warnings now passes with and without --all-features, and the shader tests on WARP are unchanged.

**@⁠claude-GTA6** on GitHub · 2026-11-25 06:55 UTC · [original](https://github.com/Marvisak/VIctory/pull/1762#issuecomment-7155304557) *From a tester working with Claude (AI-assisted); measured on my own machine.* @⁠nathanbzrr thank you, that closes the AMD gap for this PR: RDNA3, WARP and the debug layer all clean at `74497650`. The clippy catch is fixed in `19c80130` (`stride_table` is `#[cfg(test)]`, as you suggested). `cargo clippy --workspace --all-targets --locked -- -D warnings` now passes with and without `--all-features`, and the shader tests on WARP are unchanged.
Author
Owner

@⁠Mericas77 on GitHub · 2026-11-25 07:23 UTC · original

About the watch::tests::writes_through_another_mapping_mark_the_tracker failure mentioned above: it looks like the parallel-run flake in watch::tests, and is likely unrelated to this PR. On an RTX 4070 it fails in about 11 of 20 parallel cargo test -p victory-gpu --lib runs at 70564ae, and never with --test-threads=1.

One cause is a test in host.rs (a_copy_is_refreshed_once_per_submission_by_the_pages_written) whose Batch keeps the host copy watching its pool alive after the pool is freed, so a watch test running alongside can get the same addresses. #1913 fixes that (0 of 20 runs failing with it). If it still shows up here, re-running with --test-threads=1 should tell whether it comes from this PR.

**@⁠Mericas77** on GitHub · 2026-11-25 07:23 UTC · [original](https://github.com/Marvisak/VIctory/pull/1762#issuecomment-7155811699) About the `watch::tests::writes_through_another_mapping_mark_the_tracker` failure mentioned above: it looks like the parallel-run flake in `watch::tests`, and is likely unrelated to this PR. On an RTX 4070 it fails in about 11 of 20 parallel `cargo test -p victory-gpu --lib` runs at `70564ae`, and never with `--test-threads=1`. One cause is a test in `host.rs` (`a_copy_is_refreshed_once_per_submission_by_the_pages_written`) whose `Batch` keeps the host copy watching its pool alive after the pool is freed, so a watch test running alongside can get the same addresses. #1913 fixes that (0 of 20 runs failing with it). If it still shows up here, re-running with `--test-threads=1` should tell whether it comes from this PR.
Author
Owner

@⁠r4tedx on GitHub · 2026-11-25 07:35 UTC · original

@⁠claude-GTA6, the typed-view follow-up is on r4tedx/VIctory@gpu/typed-buffer-raw-views (1dce03d, three commits on your 19c80130). I'm not opening it as a PR yet, because of one problem on the configuration it's meant for, described below.

What it does. Typed buffer views get a raw alias of their bytes, using your skip field for the bias (4 | bias << VIEW_SKIP_SHIFT, so view_skip handles it unchanged). The alias slot is found through a parallel per-slot table (VIEW_ALIASES, root SRV t254). The s_buffer_load SRV/UAV fallback and unindexed buffer_load_dword* read through the alias when the used-resource stride is ≥ 1 or the descriptor comes from the heap.

Tested on WARP only. The hardware adapters here are held after power cuts.

WARP 19c80130 this branch
RGBA32F view, s_buffer_load_dwordx2 at byte 20 [0, 0] (want [109, 110]) [109, 110]
RGBA32F view, unindexed buffer_load_dword at byte 20 [0, 0] (want [113, 114]) [113, 114]
R8_UINT, stride 1, off 16 bytes, scalar load [103, 104] [103, 104]
  • Suites: victory-shader 252/254. The same two WARP failures (gathers_at_a_level_match_the_hardware, permutes_read_the_lane_named_and_zero_from_lanes_left_out) are on 19c80130 too. victory-gpu (diagnostics, WARP) 154/154.
  • Debug layer: it shows no new kind of message.
  • Clippy: clean, with and without --all-targets.
  • Offline census of the title's shaders.rpf: 0 lost, 0 gained against 19c80130. The alias-table read is added in 20,362 of the 20,669 programs that already read your stride table, and no program without a table gains one.

The problem. The alias pool takes 65,536 slots and never uses title or dynamic slots. That's fine on a full heap, but on NVIDIA this title wants 1,245,184 view slots and the heap is capped at 1,000,000. A heap at the cap has no room past its title and dynamic slots, so the pool is empty there. The fix then falls back to today's reads with a one-time log line, and does nothing on exactly the NVIDIA configuration it's for. Giving it room there means taking slots from the title's top range, which the title already loses above the cap. That's a trade-off for you (or the maintainer) to decide, not something to slip in. I'd value your view, or another approach for typed slots under the cap.

Two things in #1762's test harness, found while building this:

  • The test host finds root signatures by pointer. A released signature's pointer can be reused by another signature made directly on the device. Under the debug layer, that bound a root view past a signature's parameters and crashed WARP. My branch keeps listed signatures alive (eeabda1). Yours has the same lookup.
  • The zero stride table used for tests is 16K dwords. A test that uses large heap indices directly would read past it.

Still useful even with the pool empty: the heap now logs the most slots that have held a typed view at once. An RTX 5090 run of this branch, even if the reads fall back, would show how many alias slots the title needs.

Tests here are synthetic, on WARP. The census used local title data offline (counts only). The title was not run.

AI-assisted (Claude Code).

**@⁠r4tedx** on GitHub · 2026-11-25 07:35 UTC · [original](https://github.com/Marvisak/VIctory/pull/1762#issuecomment-7156030271) @⁠claude-GTA6, the typed-view follow-up is on [`r4tedx/VIctory@gpu/typed-buffer-raw-views`](https://github.com/r4tedx/VIctory/tree/gpu/typed-buffer-raw-views) (`1dce03d`, three commits on your `19c80130`). I'm not opening it as a PR yet, because of one problem on the configuration it's meant for, described below. **What it does.** Typed buffer views get a raw alias of their bytes, using your skip field for the bias (`4 | bias << VIEW_SKIP_SHIFT`, so `view_skip` handles it unchanged). The alias slot is found through a parallel per-slot table (`VIEW_ALIASES`, root SRV `t254`). The `s_buffer_load` SRV/UAV fallback and unindexed `buffer_load_dword*` read through the alias when the used-resource stride is ≥ 1 or the descriptor comes from the heap. **Tested on WARP only.** The hardware adapters here are held after power cuts. | WARP | `19c80130` | this branch | |---|---|---| | RGBA32F view, `s_buffer_load_dwordx2` at byte 20 | `[0, 0]` (want `[109, 110]`) | `[109, 110]` | | RGBA32F view, unindexed `buffer_load_dword` at byte 20 | `[0, 0]` (want `[113, 114]`) | `[113, 114]` | | R8_UINT, stride 1, off 16 bytes, scalar load | `[103, 104]` | `[103, 104]` | - **Suites:** victory-shader 252/254. The same two WARP failures (`gathers_at_a_level_match_the_hardware`, `permutes_read_the_lane_named_and_zero_from_lanes_left_out`) are on `19c80130` too. victory-gpu (diagnostics, WARP) 154/154. - **Debug layer:** it shows no new kind of message. - **Clippy:** clean, with and without `--all-targets`. - **Offline census of the title's `shaders.rpf`:** 0 lost, 0 gained against `19c80130`. The alias-table read is added in 20,362 of the 20,669 programs that already read your stride table, and no program without a table gains one. **The problem.** The alias pool takes 65,536 slots and never uses title or dynamic slots. That's fine on a full heap, but on NVIDIA this title wants 1,245,184 view slots and the heap is capped at 1,000,000. A heap at the cap has no room past its title and dynamic slots, so the pool is empty there. The fix then falls back to today's reads with a one-time log line, and does nothing on exactly the NVIDIA configuration it's for. Giving it room there means taking slots from the title's top range, which the title already loses above the cap. That's a trade-off for you (or the maintainer) to decide, not something to slip in. I'd value your view, or another approach for typed slots under the cap. **Two things in #1762's test harness, found while building this:** - The test host finds root signatures by pointer. A released signature's pointer can be reused by another signature made directly on the device. Under the debug layer, that bound a root view past a signature's parameters and crashed WARP. My branch keeps listed signatures alive (`eeabda1`). Yours has the same lookup. - The zero stride table used for tests is 16K dwords. A test that uses large heap indices directly would read past it. Still useful even with the pool empty: the heap now logs the most slots that have held a typed view at once. An RTX 5090 run of this branch, even if the reads fall back, would show how many alias slots the title needs. Tests here are synthetic, on WARP. The census used local title data offline (counts only). The title was not run. AI-assisted (Claude Code).
Author
Owner

@⁠Mericas77 on GitHub · 2026-11-25 07:38 UTC · original

Re-tested v3 19c8013 on the RTX 4070 (12 GB, driver 621.01, Windows 11 26300), against main 940d32f. cargo test --workspace --locked --no-fail-fast:

main 940d32f this PR 19c8013
workspace 696 passed, 5 failed, 10 ignored 705 passed, 3 failed, 10 ignored
-p victory-shader 244 passed, 3 failed 249 passed, 1 failed
-p victory-gpu 141 passed, 2 failed 145 passed, 2 failed

Fixed on this card: a_heap_buffer_read_by_element_takes_the_views_stride and gathers_at_a_level_match_the_hardware. The three left are the 1,000,000 view heap cap (#1779): dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views and a_heap_buffer_read_where_no_buffer_view_is_reads_zeros. Each fails 3 out of 3 when run alone. shadow::tests::marked_pages_go_back_by_the_bytes_the_gpu_changed and all watch::tests passed in this run. No hangs, device removals or driver resets.

This head conflicts with #1779's 9323a74 (descriptor/host.rs, emit/lower.rs, emit/mod.rs, emit/shader.rs, stride_tests.rs), so I couldn't test the two together. Between them they cover all five NVIDIA failures on this card.

**@⁠Mericas77** on GitHub · 2026-11-25 07:38 UTC · [original](https://github.com/Marvisak/VIctory/pull/1762#issuecomment-7156086684) Re-tested v3 `19c8013` on the RTX 4070 (12 GB, driver 621.01, Windows 11 26300), against `main` `940d32f`. `cargo test --workspace --locked --no-fail-fast`: | | `main` `940d32f` | this PR `19c8013` | |---|---|---| | workspace | 696 passed, 5 failed, 10 ignored | 705 passed, 3 failed, 10 ignored | | `-p victory-shader` | 244 passed, 3 failed | 249 passed, 1 failed | | `-p victory-gpu` | 141 passed, 2 failed | 145 passed, 2 failed | Fixed on this card: `a_heap_buffer_read_by_element_takes_the_views_stride` and `gathers_at_a_level_match_the_hardware`. The three left are the 1,000,000 view heap cap (#1779): `dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views` and `a_heap_buffer_read_where_no_buffer_view_is_reads_zeros`. Each fails 3 out of 3 when run alone. `shadow::tests::marked_pages_go_back_by_the_bytes_the_gpu_changed` and all `watch::tests` passed in this run. No hangs, device removals or driver resets. This head conflicts with #1779's `9323a74` (`descriptor/host.rs`, `emit/lower.rs`, `emit/mod.rs`, `emit/shader.rs`, `stride_tests.rs`), so I couldn't test the two together. Between them they cover all five NVIDIA failures on this card.
Author
Owner

@⁠wbkepler on GitHub · 2026-11-25 08:09 UTC · original

Live check on an RTX 5090 (Windows 11), head 19c8013 merged onto main 940d32f together with a few other open NVIDIA fixes (#1775, #1778, #1779, #1769, #2175):

  • Without this PR: every world frame comes out as one flat grey value. The colour targets and depth hold only scattered fragments of geometry, and the R10G10B10A2 lighting targets hold uniform noise.
  • With it: the intro scene renders: characters, props, buildings, street and sky. Like you, I see it strongly over-exposed, and the surfaces look mostly unlit. No device removal in the run.

One merge note: this PR conflicts with #1779 (view heaps on 1,000,000-descriptor hosts) in descriptor/host.rs, emit/lower.rs, emit/mod.rs, emit/shader.rs and stride_tests.rs. Both changes can be kept as they are: #1779's block remap of heap slots, and this PR's skip value in set_stride. Whichever lands second needs that rebase; I can do it on #1779's side.

AI-assisted check (Claude Code); Windows 11 / RTX 5090.

**@⁠wbkepler** on GitHub · 2026-11-25 08:09 UTC · [original](https://github.com/Marvisak/VIctory/pull/1762#issuecomment-7156678387) Live check on an RTX 5090 (Windows 11), head `19c8013` merged onto `main` `940d32f` together with a few other open NVIDIA fixes (#1775, #1778, #1779, #1769, #2175): - **Without this PR:** every world frame comes out as one flat grey value. The colour targets and depth hold only scattered fragments of geometry, and the R10G10B10A2 lighting targets hold uniform noise. - **With it:** the intro scene renders: characters, props, buildings, street and sky. Like you, I see it strongly over-exposed, and the surfaces look mostly unlit. No device removal in the run. One merge note: this PR conflicts with #1779 (view heaps on 1,000,000-descriptor hosts) in `descriptor/host.rs`, `emit/lower.rs`, `emit/mod.rs`, `emit/shader.rs` and `stride_tests.rs`. Both changes can be kept as they are: #1779's block remap of heap slots, and this PR's skip value in `set_stride`. Whichever lands second needs that rebase; I can do it on #1779's side. _AI-assisted check (Claude Code); Windows 11 / RTX 5090._
Author
Owner

@⁠claude-GTA6 on GitHub · 2026-11-25 08:25 UTC · original

From a tester working with Claude (AI-assisted); measured on my own machine.

@⁠wbkepler thank you, and good to see the same result on a second RTX 5090: a flat grey world without the PR, and the intro scene drawn with it. We also see the over-exposure and the mostly unlit surfaces. In our runs a large part of that lighting goes through ray-traced passes, which still miss everywhere on this tree.

On the #1779 conflict: yes please. If you rebase on #1779's side, I'll keep this branch as it is (head 19c80130, plus test-harness fixes only) so it doesn't move under you. Tell me if you'd rather I take the rebase here.

**@⁠claude-GTA6** on GitHub · 2026-11-25 08:25 UTC · [original](https://github.com/Marvisak/VIctory/pull/1762#issuecomment-7157016166) *From a tester working with Claude (AI-assisted); measured on my own machine.* @⁠wbkepler thank you, and good to see the same result on a second RTX 5090: a flat grey world without the PR, and the intro scene drawn with it. We also see the over-exposure and the mostly unlit surfaces. In our runs a large part of that lighting goes through ray-traced passes, which still miss everywhere on this tree. On the #1779 conflict: yes please. If you rebase on #1779's side, I'll keep this branch as it is (head `19c80130`, plus test-harness fixes only) so it doesn't move under you. Tell me if you'd rather I take the rebase here.

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