Shaders, GPU: unknown-stride buffers are read through a raw view of the same bytes (stacked on #193) #704

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

@⁠r4tedx on GitHub · 2026-11-24 07:07 UTC · original
r4tedx:shader/unknown-stride-view-kinds → main · +1921 −77 · 12 files · 13 commits · closed without merging

Current head 1f3c184, integrated with main at ffe310e. 1f3c184 makes the three unknown-stride GPU tests take the shared one-at-a-time lock. Without it, VICTORY_WARP=1 cargo test -p victory-shader --lib crashed with an access violation in 2 of 4 local runs, as CI did on 505d5b1. With it, 6 of 6 runs passed. 505d5b1 is the same tree as 7f77cca, re-authored with the GitHub no-reply address. When a waterfall descriptor load selects a different raw alias per lane, the generated heap handle now carries the nonuniform flag. The stride table on this branch still uses register space 2. Downstream stacks that also use space 2 for root addresses need the remapping described in the comments. Local Windows verification: cargo test --workspace --locked (348 passed, 6 ignored) and all-target, all-feature Clippy with warnings denied. No title run for this update. AI-assisted (Codex).

Stacked on #193 (its head 4322b61, merged with main d2a4bae). Five commits on top are the change: fc07d59, 5708fa1, 30a93f9, and 4e03086 and fb8ea43 by MichaelSmithAI (a release-order fix and its test, below). If #193 is merged first this rebases to those five; its author is welcome to take them into #193 instead.

Merged with main 7374bfb (head d5b23e1, 2026-11-24). #336 landed and conflicted with #193 and this branch in HostHeap::new: main now tries the heap with DYNAMIC dynamic slots, then MIN_DYNAMIC, then capped. The merge keeps that and asks for the alias (raw-view) slots on top in each attempt; the capped count leaves room for them. It is a merge commit so #193's commits keep their ids. At d5b23e1: cargo test -p victory-gpu 50 passed, 1 ignored; cargo test -p victory-shader 82 passed, 1 ignored (RTX 5070). Not exercised: the MIN_DYNAMIC and capped paths, which need a title-sized heap.

What

#193 lets a program whose structured buffer has no stride known at translation read it through a raw (ByteAddressBuffer) handle, at a byte offset computed from a run-time stride table. Four reviewers showed that this returns wrong data on NVIDIA whenever the heap slot holds a structured or typed view, which is what a title's structured buffer is: the raw handle resolves to the view the title made, not to a raw view.

This PR makes the read go through a raw view of the same bytes, so the handle's kind always matches the view it resolves to.

  • The table entry is two dwords (StrideEntry): the stride, then the heap slot that holds a raw view of the same bytes (plus one; 0 means the slot itself is raw), with a 4-bit byte bias on top.
  • Shader side. The program reads the entry by the heap slot it computes at run time, the same value the handle used to be made from, then makes a raw handle of the named slot and accesses index * stride + offset + bias. Loads, stores and atomics share the path.
  • GPU side. Whenever HostHeap makes a structured or typed buffer view (SRV or UAV), it also makes a raw view of the same bytes in a pool of 65,536 slots after the dynamic ones, and writes the entry. Raw views keep their own slot. Remaking a slot reuses its pool slot; a null, raw or constant view, or a released dynamic slot, returns it. The entry is written wherever the slot's descriptor is written, so it is as current as the descriptor.
  • The bias exists because a host raw view must start on 16 bytes and the console's can start on any dword: the raw view starts up to 12 bytes early.
  • A read past the view's element count reads zero: the raw view ends where the title's view does.
  • Release order (4e03086, from r4tedx/VIctory#7): when a list gives its dynamic slots back, their table entries and raw views are cleared before the slots are marked free. 30a93f9 did it the other way round, in two separate lock scopes, so another list could lease a slot, write its entry, and have it wiped by the retiring list. fb8ea43 (from r4tedx/VIctory#8) tests it without a scheduler race: it leases the whole dynamic pool, then asks the allocator for a slot at the start of the last slot's cleanup, which must fail until the cleanup is done. With the old order restored the test fails here (the slot is leased during cleanup); with the fix it passes.

Why not pick the handle kind in the shader

That was the first design tried, and it does not hold. Probed here with dxil.dll validating, on a buffer whose dword i holds 100 + i:

  • A structured handle whose declared stride differs from the view's: the RTX 5070 addresses by the view's stride; the Radeon integrated GPU and WARP address by the declared stride. No single lowering is right on all three.
  • A raw handle over a structured SRV (what #193 does): the Radeon and WARP read the byte asked for. The RTX 5070 reads byte B x 3 for a stride of 12 and B x 4 for a stride of 16 or an RGBA32F view, but byte B for a stride of 20. With #193's own 12-dword test buffer the wrong byte is past the end, which is the 0 the reviewers reported.

Values loaded: [index 2, offset 4]

View in the slot (table stride) Expected RTX 5070 before → after Radeon iGPU before → after WARP before → after
raw (12) 107 107 → 107 107 → 107 107 → 107
structured, 12 107 121 → 107 107 → 107 107 → 107
structured, 16 109 136 → 109 109 → 109 109 → 109
structured, 20 111 111 → 111 111 → 111 111 → 111
typed RGBA32F (16) 109 136 → 109 109 → 109 109 → 109

"Before" is #193's lowering with only the view changed. Stores and atomics through a UAV of each kind were already right on all three adapters and still are; they are now asserted. The Radeon column comes from a local patch that runs the tests on every adapter; this base has no adapter switch, so it is not in the commits.

Measured on the title's shaders (by a tester)

iurysf ran victory translate --list --validate over the title's shaders.rpf and executable (26,096 programs, dxil.dll 1.9.2602.17), main c2e7254 against this branch, program by program (comment): translation failures 3,734 to 3,663. All 71 a structured buffer of unknown stride programs translate; 70 validate, and one compute module is rejected with incompatible with the shader stage, the implicit-derivative case #306 fixes. No program that emitted or validated on main gets worse. This counts translation only: it says nothing about what the programs read when they run.

elamriz ran an in-game A/B on an RTX 4070 Ti (driver 621.14), comparing #439 c153b21 + #322 with and without this PR's delta at 7f77cca, under D3D12 Debug and DRED (comment). With the baseline, all seven compute producers from their #638 report stopped on the unknown-stride refusal. With this PR, all seven logged shader translated. Both runs ended in DEVICE_HUNG inside DispatchMesh, as the baseline did. This verifies translation only. What the programs read is still unverified.

On h0useadv's #293 stack (ffe310e + #180 + the lane-mask branch + #305 + #160), this PR adds 116 validated programs (113 compute) and loses none. a structured buffer of unknown stride goes from 174 to 0. This was an offline census of the title's shaders.rpf with local title data. The merged branch is testers/293-stack-with-704 (comment).

Cecerw ran cargo test --workspace on an RTX 3060 Ti at 1f3c184: 348 passed, 0 failed, 6 ignored, against 342 / 0 / 6 on main (comment). bittertea0323's offline count on ffe310e found a structured buffer of unknown stride 148 → 0 and +39 programs emitting DXIL, 36 of them compute.

NuraadGit ran 12-minute title runs on an RTX 2080 (JMAN730's fork + #493 + #189 + #206 + #667; three runs without this PR, one with it) (comment). Title memory copied per frame was 203 MB with this PR against 215–238 MB without it. Draws and dispatches dropped for lack of a host pipeline fell from 845–891 to 704 per frame, and programs refused from 383–390 to 343. Frame time was 7–11% higher in the one run with it. The four instance-culling programs stay refused in that stack (by #189), so this doesn't measure their bindings.

justlovett0 checked it on an RTX 3080 (Windows 10, driver 621.24) with and without the raw-alias slots (comment, details on #193). Without them, #193's ByteAddressBuffer reads return 0 against structured host views. With them, the unknown-stride class is gone at runtime.

Slots reached only by a run-time index (below) have a follow-up branch that is not part of this PR: gpu/run-time-indexed-views.

Not verified, and what this does not fix

  • CPU cost per frame. In neonbyte1's 7-minute run (RTX 5090, Wine + vkd3d-proton) frame time rose from 367 to 517 ms with this PR, outside preparation, GPU and copy-back time (comment). NuraadGit's RTX 2080 run shows +7–11%. A likely candidate, not yet measured: every per-draw dynamic slot holding a structured or typed buffer view now does a second shadow lookup, takes the alias lock and creates one more view, even when the alias is unchanged. Reusing make's shadow and skipping unchanged aliases would remove most of it (details).
  • Running is not yet running safely. likecrank-dotcom ported this PR (at d5b23e1) onto the tester tree at update 5 plus fork PR #10 and ran it in the title on an RTX 5060 Ti (comment). All four runtime-identified instance-culling programs translated and got host pipelines, and the device then hung on a compute dispatch after 111 s. The same tree without this PR has run 10+ minutes on other cards. That is one run, on another card and heap layout, and from before #193's zero-element guard, so it does not show that this PR causes a hang. A run with VICTORY_SKIP_PIPELINES set to those four hashes would separate it. Until then, translating these programs should not be read as their running correctly. notquiteog later skipped producers one at a time on the tester tree's update 9 (RTX 5060 Ti) (comment). The DEVICE_HUNG moved to the next of the seven producers each time, always a ~5 s single-list compute submission with the same root layout. So the hang follows what that family shares, such as a buffer it reads or a slot reached only by a run-time index, not one program's code.
  • Slots reached only by a run-time index still read zeros, for another reason. HostHeap::mirror makes buffer views only for draws, that is, for slots a dispatch names through its tables. A buffer view the title writes into a slot that a shader reaches only through an index it loads at run time stays a null view with a zero entry, and its data is not refreshed (shadow.rs says so in a shortcut:). That is the state of main, not something this PR changes, and it matters: testers report that the instance-culling compute programs behind the world's geometry pick their structured buffer exactly that way. This PR is necessary for them, not sufficient.
  • The title was not used in these tests, and there are no translation counts on the title's shaders for this branch. A tester measured #193 itself: a structured buffer of unknown stride 117 → 0, 71 programs translating (EduAzevedo); the lowering here refuses nothing #193 accepted, as far as the tests show.
  • The D3D12 debug layer was not installed here. Ctrl-Alt-Haze ran the tests with it on an RTX 5070 Ti and on WARP at 1f3c184: victory-shader 124 passed and victory-gpu 55 passed, including raw_view_tests, with no debug-layer errors or warnings (comment). Not exercised: GPU-based validation; views on buffer resource objects (the GPU test uses placed views); pool exhaustion; a view that starts off a dword of its host copy; a heap capped at 1,000,000 views (the pool takes 65,536 more slots there); stages other than compute; the cost of one more table read per access and one more view per structured or typed buffer view.
  • draw.rs still logs and continues when the table cannot be bound, as in #193.

shortcut: comments added: an access whose offset plus width passes the element's end reaches the next element, where the console reads zeros; the pool size is a guess, and views beyond it read zeros with a one-time warning; a view starting off a dword gets a null raw view; the raw view starts up to 12 bytes early and ends on the dword holding the last byte.

Tested

Windows 11, NVIDIA RTX 5070 and WARP, hand-assembled programs only:

  • structured_buffer_unknown_stride_uses_runtime_stride_table (#193's test, rewritten): raw, structured 12 / 16 / 20 and typed views in the slot each load the expected value, on the hardware adapter and WARP; stores and atomics through UAVs of each kind. With the raw views switched off it fails on the RTX 5070 with 121 for 107.
  • unknown_stride_views_chosen_by_a_loaded_heap_index: the heap slot is loaded from a buffer per thread group, with a 12-byte structured view in one slot and a 16-byte one in the other; each group's lanes read the bytes of the view their group chose, and a lane past the chosen view's elements reads zero.
  • unknown_stride_descriptor_chosen_by_control_flow, and unit tests of the entry and window arithmetic.
  • victory-gpu: unknown_stride_reads_reach_the_bytes_of_the_view_in_the_slot makes placed structured, typed and raw views in a real HostHeap, runs the translated run-time-index program on it, and rebinds slots.
  • cargo test -p victory-shader: 73 passed. cargo test -p victory-gpu: 44 passed, 1 ignored. In full-workspace runs frame::tests::waits_end_on_ticks_and_count_frames, a frame-clock timing test this PR does not touch, fails intermittently here; it also fails on plain main in full runs and passes alone.
  • cargo clippy -p victory-shader -p victory-gpu --all-targets: one warning, in victory-gpu/src/host.rs, which is on main. cargo xtask policy: ok.

AI-assisted.

🤖 Generated with Claude Code

**@⁠r4tedx** on GitHub · 2026-11-24 07:07 UTC · [original](https://github.com/Marvisak/VIctory/pull/704) `r4tedx:shader/unknown-stride-view-kinds` → `main` · +1921 −77 · 12 files · 13 commits · closed without merging **Current head `1f3c184`, integrated with `main` at `ffe310e`.** `1f3c184` makes the three unknown-stride GPU tests take the shared one-at-a-time lock. Without it, `VICTORY_WARP=1 cargo test -p victory-shader --lib` crashed with an access violation in 2 of 4 local runs, as CI did on `505d5b1`. With it, 6 of 6 runs passed. `505d5b1` is the same tree as `7f77cca`, re-authored with the GitHub no-reply address. When a waterfall descriptor load selects a different raw alias per lane, the generated heap handle now carries the nonuniform flag. The stride table on this branch still uses register space 2. Downstream stacks that also use space 2 for root addresses need the remapping described in the comments. Local Windows verification: `cargo test --workspace --locked` (348 passed, 6 ignored) and all-target, all-feature Clippy with warnings denied. No title run for this update. AI-assisted (Codex). Stacked on #193 (its head `4322b61`, merged with `main` `d2a4bae`). Five commits on top are the change: `fc07d59`, `5708fa1`, `30a93f9`, and `4e03086` and `fb8ea43` by MichaelSmithAI (a release-order fix and its test, below). If #193 is merged first this rebases to those five; its author is welcome to take them into #193 instead. **Merged with `main` `7374bfb` (head `d5b23e1`, 2026-11-24).** #336 landed and conflicted with #193 and this branch in `HostHeap::new`: `main` now tries the heap with `DYNAMIC` dynamic slots, then `MIN_DYNAMIC`, then capped. The merge keeps that and asks for the alias (raw-view) slots on top in each attempt; the capped count leaves room for them. It is a merge commit so #193's commits keep their ids. At `d5b23e1`: `cargo test -p victory-gpu` 50 passed, 1 ignored; `cargo test -p victory-shader` 82 passed, 1 ignored (RTX 5070). Not exercised: the `MIN_DYNAMIC` and capped paths, which need a title-sized heap. ## What #193 lets a program whose structured buffer has no stride known at translation read it through a raw (`ByteAddressBuffer`) handle, at a byte offset computed from a run-time stride table. Four reviewers showed that this returns wrong data on NVIDIA whenever the heap slot holds a structured or typed view, which is what a title's structured buffer is: the raw handle resolves to the view the title made, not to a raw view. This PR makes the read go through a raw view of the same bytes, so the handle's kind always matches the view it resolves to. - **The table entry is two dwords** (`StrideEntry`): the stride, then the heap slot that holds a raw view of the same bytes (plus one; 0 means the slot itself is raw), with a 4-bit byte bias on top. - **Shader side.** The program reads the entry by the heap slot it computes at run time, the same value the handle used to be made from, then makes a raw handle of the named slot and accesses `index * stride + offset + bias`. Loads, stores and atomics share the path. - **GPU side.** Whenever `HostHeap` makes a structured or typed buffer view (SRV or UAV), it also makes a raw view of the same bytes in a pool of 65,536 slots after the dynamic ones, and writes the entry. Raw views keep their own slot. Remaking a slot reuses its pool slot; a null, raw or constant view, or a released dynamic slot, returns it. The entry is written wherever the slot's descriptor is written, so it is as current as the descriptor. - **The bias** exists because a host raw view must start on 16 bytes and the console's can start on any dword: the raw view starts up to 12 bytes early. - A read past the view's element count reads zero: the raw view ends where the title's view does. - **Release order** (`4e03086`, from r4tedx/VIctory#7): when a list gives its dynamic slots back, their table entries and raw views are cleared before the slots are marked free. `30a93f9` did it the other way round, in two separate lock scopes, so another list could lease a slot, write its entry, and have it wiped by the retiring list. `fb8ea43` (from r4tedx/VIctory#8) tests it without a scheduler race: it leases the whole dynamic pool, then asks the allocator for a slot at the start of the last slot's cleanup, which must fail until the cleanup is done. With the old order restored the test fails here (the slot is leased during cleanup); with the fix it passes. ## Why not pick the handle kind in the shader That was the first design tried, and it does not hold. Probed here with `dxil.dll` validating, on a buffer whose dword i holds 100 + i: - **A structured handle whose declared stride differs from the view's:** the RTX 5070 addresses by the view's stride; the Radeon integrated GPU and WARP address by the declared stride. No single lowering is right on all three. - **A raw handle over a structured SRV (what #193 does):** the Radeon and WARP read the byte asked for. The RTX 5070 reads byte B x 3 for a stride of 12 and B x 4 for a stride of 16 or an RGBA32F view, but byte B for a stride of 20. With #193's own 12-dword test buffer the wrong byte is past the end, which is the `0` the reviewers reported. ## Values loaded: `[index 2, offset 4]` | View in the slot (table stride) | Expected | RTX 5070 before → after | Radeon iGPU before → after | WARP before → after | |---|---|---|---|---| | raw (12) | 107 | 107 → 107 | 107 → 107 | 107 → 107 | | structured, 12 | 107 | **121** → 107 | 107 → 107 | 107 → 107 | | structured, 16 | 109 | **136** → 109 | 109 → 109 | 109 → 109 | | structured, 20 | 111 | 111 → 111 | 111 → 111 | 111 → 111 | | typed RGBA32F (16) | 109 | **136** → 109 | 109 → 109 | 109 → 109 | "Before" is #193's lowering with only the view changed. Stores and atomics through a UAV of each kind were already right on all three adapters and still are; they are now asserted. The Radeon column comes from a local patch that runs the tests on every adapter; this base has no adapter switch, so it is not in the commits. ## Measured on the title's shaders (by a tester) iurysf ran `victory translate --list --validate` over the title's `shaders.rpf` and executable (26,096 programs, dxil.dll 1.9.2602.17), `main` `c2e7254` against this branch, program by program ([comment](https://git.gtahub.st/github/Marvisak--VIctory/pulls/704)): translation failures 3,734 to 3,663. All 71 `a structured buffer of unknown stride` programs translate; 70 validate, and one compute module is rejected with `incompatible with the shader stage`, the implicit-derivative case #306 fixes. No program that emitted or validated on `main` gets worse. This counts translation only: it says nothing about what the programs read when they run. elamriz ran an in-game A/B on an RTX 4070 Ti (driver 621.14), comparing #439 `c153b21` + #322 with and without this PR's delta at `7f77cca`, under D3D12 Debug and DRED ([comment](https://git.gtahub.st/github/Marvisak--VIctory/pulls/704)). With the baseline, all seven compute producers from their [#638 report](https://git.gtahub.st/github/Marvisak--VIctory/pulls/638) stopped on the unknown-stride refusal. With this PR, all seven logged `shader translated`. Both runs ended in `DEVICE_HUNG` inside `DispatchMesh`, as the baseline did. This verifies translation only. What the programs read is still unverified. On h0useadv's #293 stack (`ffe310e` + #180 + the lane-mask branch + #305 + #160), this PR adds 116 validated programs (113 compute) and loses none. `a structured buffer of unknown stride` goes from 174 to 0. This was an offline census of the title's `shaders.rpf` with local title data. The merged branch is [`testers/293-stack-with-704`](https://github.com/r4tedx/VIctory/tree/testers/293-stack-with-704) ([comment](https://git.gtahub.st/github/Marvisak--VIctory/issues/293)). Cecerw ran `cargo test --workspace` on an RTX 3060 Ti at `1f3c184`: 348 passed, 0 failed, 6 ignored, against 342 / 0 / 6 on `main` ([comment](https://git.gtahub.st/github/Marvisak--VIctory/pulls/704)). bittertea0323's offline count on `ffe310e` found `a structured buffer of unknown stride` 148 → 0 and +39 programs emitting DXIL, 36 of them compute. NuraadGit ran 12-minute title runs on an RTX 2080 (JMAN730's fork + #493 + #189 + #206 + #667; three runs without this PR, one with it) ([comment](https://git.gtahub.st/github/Marvisak--VIctory/pulls/704)). Title memory copied per frame was 203 MB with this PR against 215–238 MB without it. Draws and dispatches dropped for lack of a host pipeline fell from 845–891 to 704 per frame, and programs refused from 383–390 to 343. Frame time was 7–11% higher in the one run with it. The four instance-culling programs stay refused in that stack (by #189), so this doesn't measure their bindings. justlovett0 checked it on an RTX 3080 (Windows 10, driver 621.24) with and without the raw-alias slots ([comment](https://git.gtahub.st/github/Marvisak--VIctory/pulls/704), details on #193). Without them, #193's `ByteAddressBuffer` reads return 0 against structured host views. With them, the unknown-stride class is gone at runtime. Slots reached only by a run-time index (below) have a follow-up branch that is not part of this PR: [`gpu/run-time-indexed-views`](https://github.com/r4tedx/VIctory/tree/gpu/run-time-indexed-views). ## Not verified, and what this does not fix - **CPU cost per frame.** In neonbyte1's 7-minute run (RTX 5090, Wine + vkd3d-proton) frame time rose from 367 to 517 ms with this PR, outside preparation, GPU and copy-back time ([comment](https://git.gtahub.st/github/Marvisak--VIctory/pulls/704)). NuraadGit's RTX 2080 run shows +7–11%. A likely candidate, not yet measured: every per-draw dynamic slot holding a structured or typed buffer view now does a second shadow lookup, takes the alias lock and creates one more view, even when the alias is unchanged. Reusing `make`'s shadow and skipping unchanged aliases would remove most of it ([details](https://git.gtahub.st/github/Marvisak--VIctory/pulls/704)). - **Running is not yet running safely.** likecrank-dotcom ported this PR (at `d5b23e1`) onto the tester tree at update 5 plus fork PR #10 and ran it in the title on an RTX 5060 Ti ([comment](https://git.gtahub.st/github/Marvisak--VIctory/pulls/704)). All four runtime-identified instance-culling programs translated and got host pipelines, and the device then hung on a compute dispatch after 111 s. The same tree without this PR has run 10+ minutes on other cards. That is one run, on another card and heap layout, and from before #193's zero-element guard, so it does not show that this PR causes a hang. A run with `VICTORY_SKIP_PIPELINES` set to those four hashes would separate it. Until then, translating these programs should not be read as their running correctly. notquiteog later skipped producers one at a time on the tester tree's update 9 (RTX 5060 Ti) ([comment](https://git.gtahub.st/github/Marvisak--VIctory/issues/293)). The `DEVICE_HUNG` moved to the next of the seven producers each time, always a ~5 s single-list compute submission with the same root layout. So the hang follows what that family shares, such as a buffer it reads or a slot reached only by a run-time index, not one program's code. - **Slots reached only by a run-time index still read zeros, for another reason.** `HostHeap::mirror` makes buffer views only for draws, that is, for slots a dispatch names through its tables. A buffer view the title writes into a slot that a shader reaches only through an index it loads at run time stays a null view with a zero entry, and its data is not refreshed (`shadow.rs` says so in a `shortcut:`). That is the state of `main`, not something this PR changes, and it matters: testers report that the instance-culling compute programs behind the world's geometry pick their structured buffer exactly that way. This PR is necessary for them, not sufficient. - **The title was not used in these tests**, and there are no translation counts on the title's shaders for this branch. A tester measured #193 itself: `a structured buffer of unknown stride` 117 → 0, 71 programs translating ([EduAzevedo](https://git.gtahub.st/github/Marvisak--VIctory/pulls/193)); the lowering here refuses nothing #193 accepted, as far as the tests show. - The D3D12 debug layer was not installed here. Ctrl-Alt-Haze ran the tests with it on an RTX 5070 Ti and on WARP at `1f3c184`: victory-shader 124 passed and victory-gpu 55 passed, including `raw_view_tests`, with no debug-layer errors or warnings ([comment](https://git.gtahub.st/github/Marvisak--VIctory/pulls/704)). Not exercised: GPU-based validation; views on buffer resource objects (the GPU test uses placed views); pool exhaustion; a view that starts off a dword of its host copy; a heap capped at 1,000,000 views (the pool takes 65,536 more slots there); stages other than compute; the cost of one more table read per access and one more view per structured or typed buffer view. - `draw.rs` still logs and continues when the table cannot be bound, as in #193. `shortcut:` comments added: an access whose offset plus width passes the element's end reaches the next element, where the console reads zeros; the pool size is a guess, and views beyond it read zeros with a one-time warning; a view starting off a dword gets a null raw view; the raw view starts up to 12 bytes early and ends on the dword holding the last byte. ## Tested Windows 11, NVIDIA RTX 5070 and WARP, hand-assembled programs only: - `structured_buffer_unknown_stride_uses_runtime_stride_table` (#193's test, rewritten): raw, structured 12 / 16 / 20 and typed views in the slot each load the expected value, on the hardware adapter and WARP; stores and atomics through UAVs of each kind. With the raw views switched off it fails on the RTX 5070 with 121 for 107. - `unknown_stride_views_chosen_by_a_loaded_heap_index`: the heap slot is loaded from a buffer per thread group, with a 12-byte structured view in one slot and a 16-byte one in the other; each group's lanes read the bytes of the view their group chose, and a lane past the chosen view's elements reads zero. - `unknown_stride_descriptor_chosen_by_control_flow`, and unit tests of the entry and window arithmetic. - `victory-gpu`: `unknown_stride_reads_reach_the_bytes_of_the_view_in_the_slot` makes placed structured, typed and raw views in a real `HostHeap`, runs the translated run-time-index program on it, and rebinds slots. - `cargo test -p victory-shader`: 73 passed. `cargo test -p victory-gpu`: 44 passed, 1 ignored. In full-workspace runs `frame::tests::waits_end_on_ticks_and_count_frames`, a frame-clock timing test this PR does not touch, fails intermittently here; it also fails on plain `main` in full runs and passes alone. - `cargo clippy -p victory-shader -p victory-gpu --all-targets`: one warning, in `victory-gpu/src/host.rs`, which is on `main`. `cargo xtask policy`: ok. AI-assisted. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A buffer read whose element stride is not known at translation takes a
raw handle and a byte offset from the runtime stride table. The handle
was of the slot the title's view is in, and a raw handle over a
structured or typed view is undefined in D3D12: for the load of
[index 2, offset 4] an RTX 5070 reads dword 21 of a structured view of
12 bytes (dword 7 asked for) and dword 36 of one of 16 bytes or a typed
RGBA32F one (dword 9 asked for), where a Radeon and WARP read the bytes
asked for. No handle of another kind is right everywhere either: with a
structured handle whose declared stride differs from the view's, the RTX
5070 addresses by the view's stride and the Radeon and WARP by the
declared one.

The table's entry per slot is now a StrideEntry of two dwords: the
stride, and the heap slot holding a raw view of the bytes the slot's
view reads (none: the slot's own view is raw), with the bytes from that
raw view's start to the view's first byte (raw views start on 16 bytes
on the host). The shader reads, stores and runs atomics through a raw
handle of the slot named, so the handle's kind always matches the view.
RawWindow gives the host the raw view for a byte range.

The GPU side writes the new entries without raw slots yet, which reads
as before.

The test binds raw, structured (12, 16, 20 bytes) and typed (RGBA32F,
R32_UINT) views, as shader views for the load and as unordered access
views for the store and the atomics, with their raw views beside them,
on the hardware adapter and WARP; a second one takes the descriptor
from a join of two loads.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The programs that read a buffer without a known stride pick its heap
slot at run time, so the runtime stride table has to be looked up by the
slot the shader computes, and the view in it can differ from one thread
group to the next.

A new test loads the heap slot from a buffer per thread group (a scalar
load whose offset is the loaded value), with a structured view of 12
bytes in one slot and one of 16 bytes in the other: the four lanes of
each group read the bytes of the view their group chose, in one dispatch
and again with the choice swapped. A lane reading past the three
elements of the first view reads zero, not the buffer's next bytes.

The test host's raw views now cover a window of the buffer (as
RawWindow gives the host for a view's elements) rather than all of it,
which is what ends the read there; the view kinds test takes its raw
views and entries from the same function, with views starting 4 and 12
bytes into their raw views.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
A shader that reads a buffer without knowing its stride takes a raw
handle of the slot the runtime stride table names. The host heap now
makes that slot: when it makes a structured or typed buffer view (for a
shader or for unordered access), it also makes a raw view of the same
bytes of the same host copy in a pool of 65,536 slots after the dynamic
ones, and writes the slot, the stride and the bytes from the raw view's
start to the view's first byte (raw views start on 16 bytes) into the
slot's entry. A raw view keeps its own slot. The raw view ends with the
view's last element, so reads past it give zeros.

The entry and the raw view are written wherever the slot's descriptor
is (tables made for a draw, title slots a draw reads through a table,
slots made null), so they are as current as the descriptor; a slot made
again reuses its raw view slot, and one made null, raw or constant, or
a dynamic slot given back, returns it to the pool. Views the host
cannot make raw (starting off a dword of the copy, or with the pool
full) point at a null raw view and are logged once.

The test makes placed structured, typed and raw views in a host heap
and runs the translated program of victory-shader's run-time slot test
on it: each thread group reads the bytes of the view in the slot it
chose, zeros past the view's end, and the new view's bytes after the
slots are made again.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
main moved under #193 and this branch. One conflict, in
HostHeap::new (descriptor/host.rs): #336 tries the heap with DYNAMIC
dynamic slots, then with MIN_DYNAMIC, then capped, and records the range it
got in `dynamic`; this branch puts ALIASES raw-view slots after the dynamic
ones. Both kept: each attempt asks for the alias slots too, the capped
count leaves room for them, the lease bitmap has `extra` entries as on
main, and `alias_base` stays `count + extra`. A merge rather than a rebase
so #193's commits keep their ids.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
main now has CI (clippy with -D warnings, then the workspace's tests). No
conflict; both of CI's clippy commands are clean on the result.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
#193 moved: buffer views are clamped to what is left of the host copy, a
shader that reads the stride table without a host view heap is not run,
and a known stride that is no multiple of four is refused. Conflicts were
with main, not with this branch's change: `bind` already returns whether
the draw may run (#336), with its doc comment and the dropped counter, and
main already renamed the second test module in host.rs. main's side kept
in all three; #193's `return false` in the stride-table branch is in.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The three tests in emit/mod.rs that dispatch through `hosts()` ran
without `valu_tests::ONE_AT_A_TIME`, so with WARP they could dispatch
at the same time as another module's GPU test. Two GPU tests at once on
WARP can end the test process with an access violation; that is how
the shader test process died with 0xc0000005 on CI for 505d5b1.

Locally, `VICTORY_WARP=1 cargo test -p victory-shader --lib` at the
default thread count crashed 2 of 4 runs without this change, and
passed 6 of 6 with it.

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

@⁠iurysf on GitHub · 2026-11-24 08:16 UTC · original

Measured offline against main c2e7254 with victory translate --list --validate over the title's shaders.rpf + executable (26,096 programs), dxil.dll 1.9.2602.17, comparing outcomes program by program (this branch carries #193):

  • Translation failures 3,734 -> 3,663 (−71). All 71 "a structured buffer of unknown stride" refusals are fixed: 70 now validate, and 1 compute module is rejected with "incompatible with the shader stage". That last one is the implicit-derivative dx.valver case that #306 fixes.
  • No regressions: no program that emitted or validated on main changes for the worse.

AI-assisted.

**@⁠iurysf** on GitHub · 2026-11-24 08:16 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7125939424) Measured offline against main `c2e7254` with `victory translate --list --validate` over the title's `shaders.rpf` + executable (26,096 programs), dxil.dll 1.9.2602.17, comparing outcomes program by program (this branch carries #193): - Translation failures 3,734 -> 3,663 (−71). All 71 "a structured buffer of unknown stride" refusals are fixed: 70 now validate, and 1 compute module is rejected with "incompatible with the shader stage". That last one is the implicit-derivative `dx.valver` case that #306 fixes. - No regressions: no program that emitted or validated on main changes for the worse. AI-assisted.
Author
Owner

@⁠LAKSHYA-cmd-tech on GitHub · 2026-11-24 08:24 UTC · original

Re:

Slots reached only by a run-time index still read zeros, for another reason. \HostHeap::mirror\ makes buffer views only for draws, that is, for slots a dispatch names through its tables. A buffer view the title writes into a slot that a shader reaches only through an index it loads at run time stays a null view with a zero entry, and its data is not refreshed (\shadow.rs\ says so in a \shortcut:). That is the state of \main, not something this PR changes, and it matters: testers report that the instance-culling compute programs behind the world's geometry pick their structured buffer exactly that way. This PR is necessary for them, not sufficient.

We investigated the resulting GPU hangs in #619 and #625 (where pixel shaders \633c1f8872ed8c6d\ and \ef9b757c9c1e4b26\ hit [heap 330192: null]\ via dynamically indexed root constants \u8 = 0xa13a00).

We have solved this in branch \ ix/mirror-buffer-views-for-dynamic-indexing:
In \crates/victory-gpu/src/descriptor/host.rs, removing the artificial \let later = !for_draw && view.is_buffer();\ deferral allows \mirror()\ to immediately mirror buffer views upon creation whenever their host shadow buffer is available (falling back to
ull_for\ and setting \made[index] = 0\ only when unbacked for subsequent draw-time retry).

Combined with your raw-view aliasing for unknown strides in this PR, dynamically indexed structured buffer loads will resolve to valid descriptors rather than null slots!

**@⁠LAKSHYA-cmd-tech** on GitHub · 2026-11-24 08:24 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7126096474) Re: > **Slots reached only by a run-time index still read zeros, for another reason.** \HostHeap::mirror\ makes buffer views only for draws, that is, for slots a dispatch names through its tables. A buffer view the title writes into a slot that a shader reaches only through an index it loads at run time stays a null view with a zero entry, and its data is not refreshed (\shadow.rs\ says so in a \shortcut:\). That is the state of \main\, not something this PR changes, and it matters: testers report that the instance-culling compute programs behind the world's geometry pick their structured buffer exactly that way. This PR is necessary for them, not sufficient. We investigated the resulting GPU hangs in #619 and #625 (where pixel shaders \633c1f8872ed8c6d\ and \ef9b757c9c1e4b26\ hit \[heap 330192: null]\ via dynamically indexed root constants \u8 = 0xa13a00\). We have solved this in branch \ ix/mirror-buffer-views-for-dynamic-indexing\: In \crates/victory-gpu/src/descriptor/host.rs\, removing the artificial \let later = !for_draw && view.is_buffer();\ deferral allows \mirror()\ to immediately mirror buffer views upon creation whenever their host shadow buffer is available (falling back to \ ull_for\ and setting \made[index] = 0\ only when unbacked for subsequent draw-time retry). Combined with your raw-view aliasing for unknown strides in this PR, dynamically indexed structured buffer loads will resolve to valid descriptors rather than null slots!
Author
Owner

@⁠r4tedx on GitHub · 2026-11-24 08:30 UTC · original

@⁠iurysf thank you, that is the first count of this branch over the title's shaders: all 71 a structured buffer of unknown stride programs translate, 70 validate, the one that does not is #306's dx.valver case, and nothing that emitted or validated on main gets worse. I have put it in the description with your name.

@⁠LAKSHYA-cmd-tech thank you for following the null slot down to mirror. On fix/mirror-buffer-views-for-dynamic-indexing (c6020d4), from reading it; I have not built or run it:

  • What it fixes: the slot no longer holds a null view, which is the [heap 330192: null] you saw.

  • What it leaves, as far as I can read main:

    1. The data. The host copy behind a buffer view is brought up to date only for ranges a draw is known to read. shadow.rs says so at its top: "buffers read through directly indexed heaps keep what their first use copied". So the view is valid, but once the title rewrites the buffer the shader reads the old bytes.
    2. Writes. What a shader writes through an unordered access view in such a slot is not copied back to title memory; only ranges a table names are declared written.
    3. On this PR's branch, a view made at write time also needs its stride-table entry and raw view, or the unknown-stride read through that slot still goes through entry 0.

    Your test covers the null fallback (a view of a null resource); it does not yet show a buffer read through such a slot.

There is a branch for this gap on top of this PR: gpu/run-time-indexed-views, head 1d946e8, two commits on d5b23e1. It is not part of this PR; new upstream PRs are closed for now and I would rather not grow this one with something unmeasured in the title.

  • What it does: the translator marks programs that pick a buffer view's heap slot at run time. When a draw or dispatch binds one, every buffer view the title wrote into the heap is made, with its stride entry and raw view. At submission the title memory behind them is brought up to date in whole 64 KiB pages (unchanged pages are not copied again), and unordered access ranges are copied back.
  • Tested, on an RTX 5070 and WARP, with hand-assembled compute programs: a structured and a typed view in slots no table names are read correctly; again after the title rewrites a slot to another buffer, changes a buffer's bytes, or nulls a slot; writes through a picked unordered access view land in title memory; a released buffer's view reads nothing. With the new path switched off, the same three tests fail reading zeros ([0, 0, 0, 0, 0, 0, 0, 0] where [110, 113, 116, 0, 209, 213, 217, 221] is expected). cargo test -p victory-gpu: 53 passed, 1 ignored; -p victory-shader: 82 passed, 1 ignored.
  • Not tested: graphics and mesh stages, which is your pixel-shader case: the code handles them but no test does. Nothing in the title. Constant buffers and placed textures in such slots stay null. No debug layer on this machine.
  • The open question is cost. Every buffer with a view gets a host copy the first time a marked shader binds, and each submission that runs one asks the write watch once per host copy. #185's thread shows this kind of work can cost a great deal per frame in the title.

If you can run the title with diagnostics, the useful numbers would be, for main + this PR against the same with that branch: frame time, and the heap lines for 633c1f8872ed8c6d and ef9b757c9c1e4b26 (null or not). If your simpler change measures as correct for those two shaders and cheaper, that is worth knowing too; the three points above are from reading, not from a run.

The title was not used in these tests. AI-assisted.

**@⁠r4tedx** on GitHub · 2026-11-24 08:30 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7126219470) @⁠iurysf thank you, that is the first count of this branch over the title's shaders: all 71 `a structured buffer of unknown stride` programs translate, 70 validate, the one that does not is #306's `dx.valver` case, and nothing that emitted or validated on `main` gets worse. I have put it in the description with your name. @⁠LAKSHYA-cmd-tech thank you for following the null slot down to `mirror`. On `fix/mirror-buffer-views-for-dynamic-indexing` (`c6020d4`), from reading it; I have not built or run it: - **What it fixes:** the slot no longer holds a null view, which is the `[heap 330192: null]` you saw. - **What it leaves, as far as I can read `main`:** 1. *The data.* The host copy behind a buffer view is brought up to date only for ranges a draw is known to read. `shadow.rs` says so at its top: "buffers read through directly indexed heaps keep what their first use copied". So the view is valid, but once the title rewrites the buffer the shader reads the old bytes. 2. *Writes.* What a shader writes through an unordered access view in such a slot is not copied back to title memory; only ranges a table names are declared written. 3. *On this PR's branch,* a view made at write time also needs its stride-table entry and raw view, or the unknown-stride read through that slot still goes through entry 0. Your test covers the null fallback (a view of a null resource); it does not yet show a buffer read through such a slot. There is a branch for this gap on top of this PR: [`gpu/run-time-indexed-views`](https://github.com/r4tedx/VIctory/tree/gpu/run-time-indexed-views), head `1d946e8`, two commits on `d5b23e1`. It is not part of this PR; new upstream PRs are closed for now and I would rather not grow this one with something unmeasured in the title. - **What it does:** the translator marks programs that pick a buffer view's heap slot at run time. When a draw or dispatch binds one, every buffer view the title wrote into the heap is made, with its stride entry and raw view. At submission the title memory behind them is brought up to date in whole 64 KiB pages (unchanged pages are not copied again), and unordered access ranges are copied back. - **Tested, on an RTX 5070 and WARP,** with hand-assembled compute programs: a structured and a typed view in slots no table names are read correctly; again after the title rewrites a slot to another buffer, changes a buffer's bytes, or nulls a slot; writes through a picked unordered access view land in title memory; a released buffer's view reads nothing. With the new path switched off, the same three tests fail reading zeros (`[0, 0, 0, 0, 0, 0, 0, 0]` where `[110, 113, 116, 0, 209, 213, 217, 221]` is expected). `cargo test -p victory-gpu`: 53 passed, 1 ignored; `-p victory-shader`: 82 passed, 1 ignored. - **Not tested:** graphics and mesh stages, which is your pixel-shader case: the code handles them but no test does. Nothing in the title. Constant buffers and placed textures in such slots stay null. No debug layer on this machine. - **The open question is cost.** Every buffer with a view gets a host copy the first time a marked shader binds, and each submission that runs one asks the write watch once per host copy. #185's thread shows this kind of work can cost a great deal per frame in the title. If you can run the title with diagnostics, the useful numbers would be, for `main` + this PR against the same with that branch: frame time, and the heap lines for `633c1f8872ed8c6d` and `ef9b757c9c1e4b26` (null or not). If your simpler change measures as correct for those two shaders and cheaper, that is worth knowing too; the three points above are from reading, not from a run. The title was not used in these tests. AI-assisted.
Author
Owner

@⁠walterwallaceson on GitHub · 2026-11-24 09:12 UTC · original

Tested this branch (d5b23e1) in the title on Windows 10, RTX 3070, merged into a local stack that also carries #439, #483 and #688. Two things came up, one of them a crash this branch exposes.

A buffer view of zero elements removes the device. About a minute in, still in the loading screens, the device was removed with DXGI_ERROR_INVALID_CALL (0x887A0001). With the debug layer and DRED on, the only error before the removal was CreateUnorderedAccessView refusing a structured buffer view with NumElements 0 (stride 16). That run lasted about 100 ms past the error. It never happened in my earlier runs without this branch, so I think it comes from programs that were refused before (the 71 unknown-stride ones) and now run, so their views get made.

A guard in buffer_uav and buffer_srv (descriptor/host.rs) fixed it here: a view of no elements becomes a null view, which reads zeros:

if buffer.NumElements == 0 {
    once!("unordered buffer view of no elements made null");
    return None;
}

(same in buffer_srv; returning None makes the caller use null_for). With it, the debug layer reported no errors, and the warning fired once per run.

Results with the guard:

  • Without VICTORY_SHADER_LOOP_LIMIT, the next failure was a TDR (DXGI_ERROR_DEVICE_HUNG) after an 11.7 s submission at the switch from loading to the world, which looks like a never-ending loop in one of the newly running programs.
  • With VICTORY_SHADER_LOOP_LIMIT=4096, it ran 20 minutes with no crash and reached player control. It ran at about 1 fps, the longest submission was 681 ms, and no descriptor slots ran out. The world is still blank: near-white now, where it was flat grey before this branch. That fits your note that this is necessary but not sufficient.

A merge note with #483: #483's guard slot and this branch's alias pool both start at count + dynamic. I put the alias pool after the guard (alias_base: count + extra + guard, heap size count + extra + guard + aliases), and the raw-view retirement test then needs its capacity taken from guard_slot() - count(). All of victory-gpu's tests pass with that, including the raw-view tests, on the RTX 3070.

I haven't tried gpu/run-time-indexed-views yet.

I'm testing with Claude's help, and Claude drafted this comment.

**@⁠walterwallaceson** on GitHub · 2026-11-24 09:12 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7127110413) Tested this branch (`d5b23e1`) in the title on Windows 10, RTX 3070, merged into a local stack that also carries #439, #483 and #688. Two things came up, one of them a crash this branch exposes. **A buffer view of zero elements removes the device.** About a minute in, still in the loading screens, the device was removed with `DXGI_ERROR_INVALID_CALL` (0x887A0001). With the debug layer and DRED on, the only error before the removal was `CreateUnorderedAccessView` refusing a structured buffer view with `NumElements` 0 (stride 16). That run lasted about 100 ms past the error. It never happened in my earlier runs without this branch, so I think it comes from programs that were refused before (the 71 unknown-stride ones) and now run, so their views get made. A guard in `buffer_uav` and `buffer_srv` (`descriptor/host.rs`) fixed it here: a view of no elements becomes a null view, which reads zeros: ```rust if buffer.NumElements == 0 { once!("unordered buffer view of no elements made null"); return None; } ``` (same in `buffer_srv`; returning `None` makes the caller use `null_for`). With it, the debug layer reported no errors, and the warning fired once per run. **Results with the guard:** - Without `VICTORY_SHADER_LOOP_LIMIT`, the next failure was a TDR (`DXGI_ERROR_DEVICE_HUNG`) after an 11.7 s submission at the switch from loading to the world, which looks like a never-ending loop in one of the newly running programs. - With `VICTORY_SHADER_LOOP_LIMIT=4096`, it ran 20 minutes with no crash and reached player control. It ran at about 1 fps, the longest submission was 681 ms, and no descriptor slots ran out. The world is still blank: near-white now, where it was flat grey before this branch. That fits your note that this is necessary but not sufficient. **A merge note with #483:** #483's guard slot and this branch's alias pool both start at `count + dynamic`. I put the alias pool after the guard (`alias_base: count + extra + guard`, heap size `count + extra + guard + aliases`), and the raw-view retirement test then needs its capacity taken from `guard_slot() - count()`. All of victory-gpu's tests pass with that, including the raw-view tests, on the RTX 3070. I haven't tried `gpu/run-time-indexed-views` yet. I'm testing with Claude's help, and Claude drafted this comment.
Author
Owner

@⁠slint6614-dev on GitHub · 2026-11-24 09:30 UTC · original

Measured on the full retail shader pack (26,503 containers) with victory translate --validate --pipelines (pipelines on an AMD RX 9070, Windows 11, dxil.dll from SDK 10.0.26100). Counts are emitted / validated / pipelines. Merged locally with current main c7a5f49 first (main: VS/PS 12224 / 12148, CS 1440 / 1417, MS 8163 / 8101).

  • CS 1476 / 1453 (+36 validated), VS/PS +2, MS +1.
  • All 148 "a structured buffer of unknown stride" refusals are gone; part of them move on to "a descriptor read only as data" (388 → 470) and the lane-mask reasons (+6, +18, +2).
**@⁠slint6614-dev** on GitHub · 2026-11-24 09:30 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7127512130) Measured on the full retail shader pack (26,503 containers) with `victory translate --validate --pipelines` (pipelines on an AMD RX 9070, Windows 11, dxil.dll from SDK 10.0.26100). Counts are emitted / validated / pipelines. Merged locally with current main c7a5f49 first (main: VS/PS 12224 / 12148, CS 1440 / 1417, MS 8163 / 8101). - CS 1476 / **1453** (+36 validated), VS/PS +2, MS +1. - All 148 "a structured buffer of unknown stride" refusals are gone; part of them move on to "a descriptor read only as data" (388 → 470) and the lane-mask reasons (+6, +18, +2).
Author
Owner

@⁠SkillIssueXO on GitHub · 2026-11-24 09:32 UTC · original

Native Windows title run on RTX 5070 Ti (621.24), Windows 11 26300.9974, Series S mode, diagnostics build, cold cache and default loop limit.

The comparison held main 8e79c80, #439 60a126a, #493 c48b240, #206 05981dd and both #431 commits through 23ced70 fixed. Before #704, the four culling shaders discussed in #71 all bound in the first scene and failed translation with a structured buffer of unknown stride.

Adding #704 42538cd (includes #193 f99b792) gave all four a first bind, shader translated, and D3D12 host pipeline line during the live run: fdd56d97a806bcca, 17af15c4015cb4b6, 55679a0547649d0b, 89d08e561897d4e5. None logged a translation failure or host refusal. Frame 1400 was visually dark and its presented capture matched the control byte for byte. The memory guard stopped the run after 67.6 s of world FPS samples at 0.7–1.5 fps.

The local merge kept #206’s misaligned raw fallback and applied #193’s nonempty view clamp after resolving the host stride and first element. I also updated the raw-view fixture to pass Target::ANY to #439’s emitter API. The GPU test suite passed 59 tests with one ignored, including raw-view reads, slot retirement, and the merged bounds check.

One run per build. This confirms D3D12 pipeline creation for the four live bindings. Their output data was not checked. AI-assisted (Codex, with Claude checking current heads and test overlap).

**@⁠SkillIssueXO** on GitHub · 2026-11-24 09:32 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7127545630) Native Windows title run on RTX 5070 Ti (621.24), Windows 11 26300.9974, Series S mode, diagnostics build, cold cache and default loop limit. The comparison held `main` `8e79c80`, #439 `60a126a`, #493 `c48b240`, #206 `05981dd` and both #431 commits through `23ced70` fixed. Before #704, the four culling shaders discussed in #71 all bound in the first scene and failed translation with `a structured buffer of unknown stride`. Adding #704 `42538cd` (includes #193 `f99b792`) gave all four a `first bind`, `shader translated`, and D3D12 `host pipeline` line during the live run: `fdd56d97a806bcca`, `17af15c4015cb4b6`, `55679a0547649d0b`, `89d08e561897d4e5`. None logged a translation failure or host refusal. Frame 1400 was visually dark and its presented capture matched the control byte for byte. The memory guard stopped the run after 67.6 s of world FPS samples at 0.7–1.5 fps. The local merge kept #206’s misaligned raw fallback and applied #193’s nonempty view clamp after resolving the host stride and first element. I also updated the raw-view fixture to pass `Target::ANY` to #439’s emitter API. The GPU test suite passed 59 tests with one ignored, including raw-view reads, slot retirement, and the merged bounds check. One run per build. This confirms D3D12 pipeline creation for the four live bindings. Their output data was not checked. AI-assisted (Codex, with Claude checking current heads and test overlap).
Author
Owner

@⁠Exorion1er on GitHub · 2026-11-24 09:34 UTC · original

A Linux data point to go with the two above: RX 9070 XT (RDNA4), Mesa 26.2.7 RADV, GE-Proton11-12's Wine, vkd3d-proton 3.2.0. Diagnostics build of this PR at d5b23e1 (before 42538cd) on main 58fed37 + #190, #454, #493, #579, #591 and #638, compared with the same stack without it, in short runs into the first mission:

without with
"a structured buffer of unknown stride" refusals 43 0
first world frame, 1280×720 f26 target 0% non-background 74%
presented frame black black

As on the 5070 Ti, the four culling programs from #71 translate. Here, though, one f26 target that was empty gets written.

Merge note: with #190 this conflicts in emit/shader.rs, where both add a root view kind (root_uavs and stride_table) to the same struct, constructor and handle helpers. Keeping both sides works: the stride table goes into the SRV list in STRIDE_SPACE and the root UAVs into the UAV list, and the result builds and runs.

Counts only. AI-assisted (Claude Code).

**@⁠Exorion1er** on GitHub · 2026-11-24 09:34 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7127605698) A Linux data point to go with the two above: RX 9070 XT (RDNA4), Mesa 26.2.7 RADV, GE-Proton11-12's Wine, vkd3d-proton 3.2.0. Diagnostics build of this PR at `d5b23e1` (before `42538cd`) on `main` `58fed37` + #190, #454, #493, #579, #591 and #638, compared with the same stack without it, in short runs into the first mission: | | without | with | |---|---|---| | "a structured buffer of unknown stride" refusals | 43 | 0 | | first world frame, 1280×720 `f26` target | 0% non-background | 74% | | presented frame | black | black | As on the 5070 Ti, the four culling programs from #71 translate. Here, though, one `f26` target that was empty gets written. Merge note: with #190 this conflicts in `emit/shader.rs`, where both add a root view kind (`root_uavs` and `stride_table`) to the same struct, constructor and handle helpers. Keeping both sides works: the stride table goes into the SRV list in `STRIDE_SPACE` and the root UAVs into the UAV list, and the result builds and runs. Counts only. AI-assisted (Claude Code).
Author
Owner

@⁠walterwallaceson on GitHub · 2026-11-24 09:40 UTC · original

A correction and a follow-up to my comment above.

Correction: I tested d5b23e1. The new head 42538cd brings in #193's f99b792, which already clamps NumElements to what is left of the buffer and returns None at zero in buffer_srv and buffer_uav. That covers the zero-element crash I reported, so my local guard isn't needed on top of it. Sorry for the noise.

gpu/run-time-indexed-views (1d946e8) in the title. Same machine and stack as above (Windows 10, RTX 3070, with #439, #483 and #688), diagnostics build, VICTORY_SHADER_LOOP_LIMIT=4096, no debug layer. I compared it with a run of d5b23e1 alone under the same settings.

#704 (d5b23e1) + run-time-indexed-views
ran 20 min, no crash 15 min, no crash (ended by a script)
frame rate after loading about 1.0 fps (950 ms/frame) about 0.1 fps (8.5 to 9 s/frame)
buffer copies per frame 331 ms, 202 MB about 7.5 s, about 10.8 GB
on the GPU per frame about 176 ms about 420 to 500 ms
longest submission 681 ms 1,022 ms
world blank (near-white) blank (white), no geometry yet

Nearly all of the extra time is in the copies. Keeping the run-time-picked views current seems to re-upload whole buffers every frame, about 50 times the data of d5b23e1 alone. Draws per frame stay about the same (about 2,000).

Once-warnings that appeared only with the branch:

  • no free dynamic descriptor slots: a table is not made (n=4), once, about a minute in. Our heap is capped at 1,000,000 views, and the alias pool comes out of the same cap.
  • unordered access views picked at run time too big to copy back to title memory (views=16).
  • a buffer view off the dwords of its host copy has no raw view, once.

No device removal and no debug-layer run this time. I'm happy to run it again with the debug layer or DRED, or on a newer head of the branch.

I'm testing with Claude's help, and Claude drafted this comment.

**@⁠walterwallaceson** on GitHub · 2026-11-24 09:40 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7127729283) A correction and a follow-up to my comment above. **Correction:** I tested `d5b23e1`. The new head `42538cd` brings in #193's `f99b792`, which already clamps `NumElements` to what is left of the buffer and returns `None` at zero in `buffer_srv` and `buffer_uav`. That covers the zero-element crash I reported, so my local guard isn't needed on top of it. Sorry for the noise. **`gpu/run-time-indexed-views` (`1d946e8`) in the title.** Same machine and stack as above (Windows 10, RTX 3070, with #439, #483 and #688), diagnostics build, `VICTORY_SHADER_LOOP_LIMIT=4096`, no debug layer. I compared it with a run of `d5b23e1` alone under the same settings. | | #704 (`d5b23e1`) | + run-time-indexed-views | |---|---|---| | ran | 20 min, no crash | 15 min, no crash (ended by a script) | | frame rate after loading | about 1.0 fps (950 ms/frame) | about 0.1 fps (8.5 to 9 s/frame) | | buffer copies per frame | 331 ms, 202 MB | about 7.5 s, about 10.8 GB | | on the GPU per frame | about 176 ms | about 420 to 500 ms | | longest submission | 681 ms | 1,022 ms | | world | blank (near-white) | blank (white), no geometry yet | Nearly all of the extra time is in the copies. Keeping the run-time-picked views current seems to re-upload whole buffers every frame, about 50 times the data of `d5b23e1` alone. Draws per frame stay about the same (about 2,000). Once-warnings that appeared only with the branch: - `no free dynamic descriptor slots: a table is not made` (n=4), once, about a minute in. Our heap is capped at 1,000,000 views, and the alias pool comes out of the same cap. - `unordered access views picked at run time too big to copy back to title memory` (views=16). - `a buffer view off the dwords of its host copy has no raw view`, once. No device removal and no debug-layer run this time. I'm happy to run it again with the debug layer or DRED, or on a newer head of the branch. I'm testing with Claude's help, and Claude drafted this comment.
Author
Owner

@⁠dcastell1 on GitHub · 2026-11-24 09:58 UTC · original

Verified on native Windows, no Wine: NVIDIA GeForce RTX 5090 (driver 621.24), Windows 11 10.0.26300, Rust 1.98.1, MSVC 14.44.35207, debug build. main@8e79c80 baseline on this box: 311 passed, 0 failed, 6 ignored.
With this PR at 42538cde applied clean (patch -p1, no fuzz):

cargo test --workspace
317 passed; 0 failed; 6 ignored   (exit 0)

Six more passing tests than the baseline; nothing else in the workspace changes verdict.

Tree restored afterwards (full diff against a clean checkout); no game data, the tests are synthetic. AI-assisted (opencode): applied the patch to a built tree, ran cargo test --workspace, reverted it.

**@⁠dcastell1** on GitHub · 2026-11-24 09:58 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7128135761) Verified on native Windows, no Wine: NVIDIA GeForce RTX 5090 (driver 621.24), Windows 11 10.0.26300, Rust 1.98.1, MSVC 14.44.35207, debug build. `main@8e79c80` baseline on this box: **311 passed, 0 failed, 6 ignored**. With this PR at `42538cde` applied clean (`patch -p1`, no fuzz): ``` cargo test --workspace 317 passed; 0 failed; 6 ignored (exit 0) ``` Six more passing tests than the baseline; nothing else in the workspace changes verdict. Tree restored afterwards (full diff against a clean checkout); no game data, the tests are synthetic. AI-assisted (opencode): applied the patch to a built tree, ran `cargo test --workspace`, reverted it.
Author
Owner

@⁠MartinIndra02 on GitHub · 2026-11-24 10:37 UTC · original

Second Ampere A/B data point for d5b23e1 in the title (opening world load, no VICTORY_SHADER_LOOP_LIMIT), confirming @⁠walterwallaceson's RTX 3070 observation:

  • Setup: Windows 11 Pro 26200, NVIDIA GeForce RTX 3080 (10 GB, driver 621.24), Ryzen 7 5800X3D, 32 GB RAM, Rust 1.98.1, diag build, VICTORY_D3D12_DRED=1.
  • Synthetic tests on d5b23e1 alone: victory-shader 82 passed, 0 failed (1 ignored); victory-gpu 50 passed, 0 failed (1 ignored), including unknown_stride_reads_reach_the_bytes_of_the_view_in_the_slot and retiring_slot_is_unavailable_until_its_alias_is_cleared.
  • In-game A/B on local stack (#439 + #55 + #688 + #635 + #89):
Metric Stack without #704 Stack + #704 (d5b23e1)
host pipeline refused 0 0
no dynamic slots 0 0
slow host submission 24 11
Late world FPS 0.3–0.4 fps 0.5–1.0 fps
Result (~1.5 min in world) 0x887A0006 (DEVICE_HUNG, 30 lists, no page fault) 0x887A0006 (DEVICE_HUNG, 5 lists, no page fault)

Note: #635 was in the stack, so zero-element buffer views were already guarded (0 DXGI_ERROR_INVALID_CALL removals).

No game data. AI-assisted; all builds and runs executed on my machine.

**@⁠MartinIndra02** on GitHub · 2026-11-24 10:37 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7129032067) Second Ampere A/B data point for `d5b23e1` in the title (opening world load, no `VICTORY_SHADER_LOOP_LIMIT`), confirming @⁠walterwallaceson's RTX 3070 observation: - **Setup:** Windows 11 Pro 26200, NVIDIA GeForce RTX 3080 (10 GB, driver `621.24`), Ryzen 7 5800X3D, 32 GB RAM, Rust 1.98.1, diag build, `VICTORY_D3D12_DRED=1`. - **Synthetic tests on `d5b23e1` alone:** `victory-shader` **82 passed, 0 failed** (1 ignored); `victory-gpu` **50 passed, 0 failed** (1 ignored), including `unknown_stride_reads_reach_the_bytes_of_the_view_in_the_slot` and `retiring_slot_is_unavailable_until_its_alias_is_cleared`. - **In-game A/B on local stack (`#439` + `#55` + `#688` + `#635` + `#89`):** | Metric | Stack without `#704` | Stack + `#704` (`d5b23e1`) | |---|---|---| | `host pipeline refused` | 0 | 0 | | `no dynamic slots` | 0 | 0 | | `slow host submission` | 24 | **11** | | Late world FPS | 0.3–0.4 fps | **0.5–1.0 fps** | | Result (~1.5 min in world) | `0x887A0006` (`DEVICE_HUNG`, 30 lists, no page fault) | `0x887A0006` (`DEVICE_HUNG`, 5 lists, no page fault) | Note: `#635` was in the stack, so zero-element buffer views were already guarded (`0` `DXGI_ERROR_INVALID_CALL` removals). *No game data. AI-assisted; all builds and runs executed on my machine.*
Author
Owner

@⁠LAKSHYA-cmd-tech on GitHub · 2026-11-24 10:54 UTC · original

Verified and merged downstream in https://github.com/LAKSHYA-cmd-tech/VIctory/pull/6.

Key integration notes:

  • Assigned \STRIDE_SPACE = 3\ (register space 3) for the runtime stride table SRV \ 0\ so it cleanly coexists with 64-bit root-constant address pair SRVs at \ROOT_ADDRESS_SPACE = 2\ (PR #710 / #489 / #302).
  • Validated on Windows D3D12 runtime: all 114 \ ictory-shader\ tests and 76 \ ictory-gpu\ tests (including all \descriptor::raw_view_tests) pass cleanly.
**@⁠LAKSHYA-cmd-tech** on GitHub · 2026-11-24 10:54 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7129406848) Verified and merged downstream in https://github.com/LAKSHYA-cmd-tech/VIctory/pull/6. Key integration notes: - Assigned \STRIDE_SPACE = 3\ (register space 3) for the runtime stride table SRV \ 0\ so it cleanly coexists with 64-bit root-constant address pair SRVs at \ROOT_ADDRESS_SPACE = 2\ (PR #710 / #489 / #302). - Validated on Windows D3D12 runtime: all 114 \ ictory-shader\ tests and 76 \ ictory-gpu\ tests (including all \descriptor::raw_view_tests\) pass cleanly.
Author
Owner

@⁠r4tedx on GitHub · 2026-11-24 11:10 UTC · original

@⁠MartinIndra02, both sides of your A/B still hit DEVICE_HUNG, even with fewer slow submissions on the patched stack. I’m treating those as separate outcomes. @⁠LAKSHYA-cmd-tech, thanks for flagging the register-space collision when stacking the root-address work. I’ve recorded your downstream remapping in the description. The updated upstream PR head is 7f77cca. Its verified change is in descriptor translation and integration with main. The latest workspace run here was synthetic.

AI-assisted (Codex).

**@⁠r4tedx** on GitHub · 2026-11-24 11:10 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7129763361) @⁠MartinIndra02, both sides of your A/B still hit `DEVICE_HUNG`, even with fewer slow submissions on the patched stack. I’m treating those as separate outcomes. @⁠LAKSHYA-cmd-tech, thanks for flagging the register-space collision when stacking the root-address work. I’ve recorded your downstream remapping in the description. The updated upstream PR head is `7f77cca`. Its verified change is in descriptor translation and integration with `main`. The latest workspace run here was synthetic. AI-assisted (Codex).
Author
Owner

@⁠dcastell1 on GitHub · 2026-11-24 11:38 UTC · original

Re-verified on the new head 7f77ccad (based on ffe310e); this supersedes my note on 42538cde, which was measured on 8e79c80:

clean main@ffe310e            : 342 passed; 0 failed; 6 ignored
this PR at 7f77ccad on it     : 348 passed; 0 failed; 6 ignored   (exit 0)

Six more passing tests than main, nothing else changes verdict.

Environment: Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.98.1, MSVC 14.44.35207, debug. AI-assisted (opencode).

**@⁠dcastell1** on GitHub · 2026-11-24 11:38 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7130350906) Re-verified on the new head `7f77ccad` (based on `ffe310e`); this supersedes my note on `42538cde`, which was measured on `8e79c80`: ``` clean main@ffe310e : 342 passed; 0 failed; 6 ignored this PR at 7f77ccad on it : 348 passed; 0 failed; 6 ignored (exit 0) ``` Six more passing tests than main, nothing else changes verdict. Environment: Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.98.1, MSVC 14.44.35207, debug. AI-assisted (opencode).
Author
Owner

@⁠elamriz on GitHub · 2026-11-24 12:33 UTC · original

Tested 7f77cca on RTX 4070 Ti (Windows D3D12, driver 621.14) using this A/B: #439 c153b21 + #322 b58d198, then the same build plus the #704 delta from ffe310e to 7f77cca. Both used D3D12 Debug and DRED, fresh caches and the same scripted input in an offline AppContainer.

All seven dropped compute producers previously identified in my #638 report hit unknown structured-buffer stride with the baseline. With #704 added, all seven explicitly logged shader translated: 1c4b3c0547e3e6fa, 17af15c4015cb4b6, fdd56d97a806bcca, 55679a0547649d0b, 89d08e561897d4e5, 9209777e8face9dd, 42f717f1b4d18e94. This verifies translation, with runtime buffer contents still unverified.

The combined build showed the mission title card. Both runs still ended in DEVICE_HUNG with DRED inside DispatchMesh (532/696 baseline, 116/747 with #704). One run per configuration. AI-assisted testing. No raw logs or title files attached.

**@⁠elamriz** on GitHub · 2026-11-24 12:33 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7131617176) Tested `7f77cca` on RTX 4070 Ti (Windows D3D12, driver 621.14) using this A/B: #439 `c153b21` + #322 `b58d198`, then the same build plus the #704 delta from `ffe310e` to `7f77cca`. Both used D3D12 Debug and DRED, fresh caches and the same scripted input in an offline AppContainer. All seven dropped compute producers previously identified in [my #638 report](https://git.gtahub.st/github/Marvisak--VIctory/pulls/638) hit unknown structured-buffer stride with the baseline. With #704 added, all seven explicitly logged `shader translated`: `1c4b3c0547e3e6fa`, `17af15c4015cb4b6`, `fdd56d97a806bcca`, `55679a0547649d0b`, `89d08e561897d4e5`, `9209777e8face9dd`, `42f717f1b4d18e94`. This verifies translation, with runtime buffer contents still unverified. The combined build showed the mission title card. Both runs still ended in DEVICE_HUNG with DRED inside DispatchMesh (532/696 baseline, 116/747 with #704). One run per configuration. AI-assisted testing. No raw logs or title files attached.
Author
Owner

@⁠r4tedx on GitHub · 2026-11-24 13:37 UTC · original

@⁠elamriz, thanks for the A/B on the RTX 4070 Ti. All seven producers from your #638 report went from the unknown-stride refusal to shader translated. Those are runtime programs, and an offline census of the shader pack can't show them, so this is coverage I didn't have. I've added it to the PR description.

On the hang: both configurations ended in DEVICE_HUNG inside DispatchMesh, and the baseline already hung there without #704. So this run doesn't point at #704 as the cause. With one run per configuration, I'm not reading anything into the different positions (532/696 vs 116/747).

What it doesn't settle is whether those seven programs now read the right data. One gap is already known. A slot that a shader reaches only through an index it loads at run time still holds a null view, because HostHeap::mirror only makes buffer views for slots a dispatch names through its tables. Instance-culling compute has been reported to pick its buffer that way. If any of the seven do too, translating them won't change their output yet. The follow-up for that is gpu/run-time-indexed-views, which isn't part of this PR.

Housekeeping: the head is now 505d5b1, a re-authored copy of 7f77cca with the same tree and parents, so your result applies to it unchanged.

The title was not used in these tests. This reply only discusses your run.

AI-assisted (Claude Code).

**@⁠r4tedx** on GitHub · 2026-11-24 13:37 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7133106870) @⁠elamriz, thanks for the A/B on the RTX 4070 Ti. All seven producers from your [#638 report](https://git.gtahub.st/github/Marvisak--VIctory/pulls/638) went from the unknown-stride refusal to `shader translated`. Those are runtime programs, and an offline census of the shader pack can't show them, so this is coverage I didn't have. I've added it to the PR description. On the hang: both configurations ended in `DEVICE_HUNG` inside `DispatchMesh`, and the baseline already hung there without #704. So this run doesn't point at #704 as the cause. With one run per configuration, I'm not reading anything into the different positions (532/696 vs 116/747). What it doesn't settle is whether those seven programs now read the right data. One gap is already known. A slot that a shader reaches only through an index it loads at run time still holds a null view, because `HostHeap::mirror` only makes buffer views for slots a dispatch names through its tables. Instance-culling compute has been reported to pick its buffer that way. If any of the seven do too, translating them won't change their output yet. The follow-up for that is [`gpu/run-time-indexed-views`](https://github.com/r4tedx/VIctory/tree/gpu/run-time-indexed-views), which isn't part of this PR. Housekeeping: the head is now `505d5b1`, a re-authored copy of `7f77cca` with the same tree and parents, so your result applies to it unchanged. The title was not used in these tests. This reply only discusses your run. AI-assisted (Claude Code).
Author
Owner

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

@⁠walterwallaceson thank you for both comments, and sorry for the late answer. Neither was noise.

The zero-element view. Your correction is right: #193's f99b792 clamps NumElements to what is left of the host copy and returns no view at zero, in buffer_srv and buffer_uav, and it is in this PR's head since 42538cd (now 505d5b1). Your debug-layer trace is still the only evidence I know of that this case is reached in the title, which is a reason for that clamp to exist. I have not run it in the title myself.

gpu/run-time-indexed-views in the title. This is the measurement I asked for, and the answer is clear: about 50 times the copied data (202 MB to about 10.8 GB per frame) and 1.0 to 0.1 fps, with the world still blank. So the branch stays out of this PR and out of the tester tree. The cost matches how it works: once a shader that picks its buffer at run time binds, it keeps current every buffer view the title has written into the heap, not only the ones a shader ends up picking. Your numbers say that is far too broad, and the next version has to narrow what it refreshes before it is worth another run. Your three once-warnings are noted with it, the no free dynamic descriptor slots on a capped heap in particular, since the alias pool comes out of the same cap.

The merge note with #483. Noted for when the two meet: the alias pool after the guard slot is the layout I would choose too. Neither PR can carry it alone while the other is open.

I have no run of my own to set beside yours: the title was not used in my tests of this PR or of that branch. AI-assisted.

**@⁠r4tedx** on GitHub · 2026-11-24 13:51 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7133436407) @⁠walterwallaceson thank you for both comments, and sorry for the late answer. Neither was noise. **The zero-element view.** Your correction is right: #193's `f99b792` clamps `NumElements` to what is left of the host copy and returns no view at zero, in `buffer_srv` and `buffer_uav`, and it is in this PR's head since `42538cd` (now `505d5b1`). Your debug-layer trace is still the only evidence I know of that this case is reached in the title, which is a reason for that clamp to exist. I have not run it in the title myself. **`gpu/run-time-indexed-views` in the title.** This is the measurement I asked for, and the answer is clear: about 50 times the copied data (202 MB to about 10.8 GB per frame) and 1.0 to 0.1 fps, with the world still blank. So the branch stays out of this PR and out of the tester tree. The cost matches how it works: once a shader that picks its buffer at run time binds, it keeps current every buffer view the title has written into the heap, not only the ones a shader ends up picking. Your numbers say that is far too broad, and the next version has to narrow what it refreshes before it is worth another run. Your three once-warnings are noted with it, the `no free dynamic descriptor slots` on a capped heap in particular, since the alias pool comes out of the same cap. **The merge note with #483.** Noted for when the two meet: the alias pool after the guard slot is the layout I would choose too. Neither PR can carry it alone while the other is open. I have no run of my own to set beside yours: the title was not used in my tests of this PR or of that branch. AI-assisted.
Author
Owner

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

Unit tests on the current head 1f3c184 (RTX 3060 Ti, Ampere): pass

Tree Passed Failed Ignored
main ffe310e 342 0 6
This PR at 1f3c184 (on ffe310e) 348 0 6
  • NVIDIA GeForce RTX 3060 Ti 8 GB, driver 32.0.16.1088; Intel Core i5-14600K, 32 GB; Windows 11 Pro 26300.9818
  • Rust 1.98.1 (rust-toolchain.toml), MSVC 14.44.35207, debug build; cargo test --workspace, clean checkout of the PR head
  • The 6 ignored are the usual benchmarks and reference-file tests

Not tested: no title run (no game files used), so this says nothing about the culling programs in the world; release / diag builds.

AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this report.

**@⁠Cecerw** on GitHub · 2026-11-24 14:11 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7133985108) **Unit tests on the current head `1f3c184` (RTX 3060 Ti, Ampere): pass** | Tree | Passed | Failed | Ignored | |---|---|---|---| | `main` `ffe310e` | 342 | 0 | 6 | | This PR at `1f3c184` (on `ffe310e`) | 348 | 0 | 6 | - NVIDIA GeForce RTX 3060 Ti 8 GB, driver 32.0.16.1088; Intel Core i5-14600K, 32 GB; Windows 11 Pro 26300.9818 - Rust 1.98.1 (rust-toolchain.toml), MSVC 14.44.35207, debug build; `cargo test --workspace`, clean checkout of the PR head - The 6 ignored are the usual benchmarks and reference-file tests **Not tested:** no title run (no game files used), so this says nothing about the culling programs in the world; release / diag builds. **AI use:** Claude Code (Claude Opus 5.5) ran the tests and wrote this report.
Author
Owner

@⁠bittertea0323 on GitHub · 2026-11-24 14:26 UTC · original

Verified offline: unknown-stride is gone, +39 programs, and it exposes the next class

Applied the branch on ffe310e + local diag changes (12 files, every one clean); same
container dump, same host, both runs.

metric before after
emit: a structured buffer of unknown stride 148 0
compute programs emitting DXIL 1443 / 2582 1479 / 2582
vertex+pixel programs emitting DXIL 12252 / 14027 12254 / 14027
mesh programs emitting DXIL 8214 / 8713 8215 / 8713
emit: a descriptor read only as data 371 453
emit: a lane mask read as data 250 268

+39 programs reach DXIL, 36 of them compute. Both rises are the next failure being exposed in
programs that used to stop here, not a regression.

For whoever picks this up next: the +82 on emit: a descriptor read only as data lands in a
class we are already working on locally (inferring the view kind from the used-resource entry).
Our current inference resolves roughly half of that class and not the other half, so after this
patch it becomes the second-largest remaining blocker at 453 — the largest unclaimed one after
a scalar memory read as data (771).

Repro: cargo build --release -p victory then victory translate <container dump>.

**@⁠bittertea0323** on GitHub · 2026-11-24 14:26 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7134366879) ## Verified offline: unknown-stride is gone, +39 programs, and it exposes the next class Applied the branch on `ffe310e` + local diag changes (12 files, every one clean); same container dump, same host, both runs. | metric | before | after | |---|---|---| | `emit: a structured buffer of unknown stride` | 148 | **0** | | compute programs emitting DXIL | 1443 / 2582 | **1479 / 2582** | | vertex+pixel programs emitting DXIL | 12252 / 14027 | 12254 / 14027 | | mesh programs emitting DXIL | 8214 / 8713 | 8215 / 8713 | | `emit: a descriptor read only as data` | 371 | 453 | | `emit: a lane mask read as data` | 250 | 268 | +39 programs reach DXIL, 36 of them compute. Both rises are the next failure being exposed in programs that used to stop here, not a regression. For whoever picks this up next: the +82 on `emit: a descriptor read only as data` lands in a class we are already working on locally (inferring the view kind from the used-resource entry). Our current inference resolves roughly half of that class and not the other half, so after this patch it becomes the second-largest remaining blocker at 453 — the largest unclaimed one after `a scalar memory read as data` (771). Repro: `cargo build --release -p victory` then `victory translate <container dump>`.
Author
Owner

@⁠r4tedx on GitHub · 2026-11-24 14:30 UTC · original

@⁠Cecerw, thanks. 348 / 0 / 6 on an RTX 3060 Ti at 1f3c184 gives an Ampere run alongside the RTX 5070 here, and on the commit that added the WARP test lock. I've noted it in the PR description.

@⁠bittertea0323, thanks. Your +39 (36 compute) and 148 → 0 match what this PR does on plain main. On h0useadv's #293 stack I measured +116, 0 lost, 174 → 0, because #180 clears blockers those programs would otherwise stop at first (#293). I agree the rise in a descriptor read only as data (371 → 453) is the next blocker showing up, not a regression. Those programs used to stop at the unknown stride. #180 is the open PR aimed at that reason: on h0useadv's census it takes a descriptor read only as data from 394 to 7 on main. Worth comparing with your view-kind inference before you post it.

The title was not used for this reply.

AI-assisted (Claude Code).

**@⁠r4tedx** on GitHub · 2026-11-24 14:30 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7134476298) @⁠Cecerw, thanks. 348 / 0 / 6 on an RTX 3060 Ti at `1f3c184` gives an Ampere run alongside the RTX 5070 here, and on the commit that added the WARP test lock. I've noted it in the PR description. @⁠bittertea0323, thanks. Your +39 (36 compute) and 148 → 0 match what this PR does on plain `main`. On h0useadv's #293 stack I measured +116, 0 lost, 174 → 0, because #180 clears blockers those programs would otherwise stop at first ([#293](https://git.gtahub.st/github/Marvisak--VIctory/issues/293)). I agree the rise in `a descriptor read only as data` (371 → 453) is the next blocker showing up, not a regression. Those programs used to stop at the unknown stride. #180 is the open PR aimed at that reason: on h0useadv's census it takes `a descriptor read only as data` from 394 to 7 on `main`. Worth comparing with your view-kind inference before you post it. The title was not used for this reply. AI-assisted (Claude Code).
Author
Owner

@⁠Proudnoob4 on GitHub · 2026-11-24 14:43 UTC · original

Corpus A/B of the follow-up branch (gpu/run-time-indexed-views, 1d946e8) — unknown stride is fully cleared, and the instance-culling producers are among the gains

Merged onto ffe310e + #175 + #579 + #206 + #493 (no skip) and built clean. Full corpus, 26,503 containers / 26,084 translated programs, 10 chunks, translate --validate --list, diag:

base + follow-up
a structured buffer of unknown stride 148 0
validated programs 21,724 21,763 (+39, 0 lost)

The 39 newly validating programs include InstanceCulling_CS_Prop_BatchCull_ValidateInstInv, InstanceCulling_CS_Simple_BatchCull_ValidateInstInv, InstanceCulling_CS_Prop_BatchNoCull, InstanceCulling_CS_Grass_BatchCull, InstanceCulling_CS_Grass_BatchCull_ImposterOnly, InstanceCulling_CS_Tree_BatchNoCull, InstanceCulling_CS_Simple_BatchCullReflect, bvh_skinning_CSComputeVSplitTree, firevbuffer_CS_EntityFireResolve_Vectorized and PS_EntityFireResolve. That matches your description of the slot-picked runtime views as the instance-culling path.

Most of the cleared programs now stop later (a descriptor read only as data +82, a lane mask read as data +18), so this is not yet a complete path, but no previously validated program was lost.

RTX 4080 / Win10 GPU run in progress: stock settings, 900 s, DRED + target dumps. I'll add the result here when it finishes.

AI-assisted (Claude Code).

**@⁠Proudnoob4** on GitHub · 2026-11-24 14:43 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7134841539) **Corpus A/B of the follow-up branch (`gpu/run-time-indexed-views`, `1d946e8`) — unknown stride is fully cleared, and the instance-culling producers are among the gains** Merged onto `ffe310e` + #175 + #579 + #206 + #493 (no skip) and built clean. Full corpus, 26,503 containers / 26,084 translated programs, 10 chunks, `translate --validate --list`, diag: | | base | + follow-up | |---|---|---| | `a structured buffer of unknown stride` | 148 | **0** | | validated programs | 21,724 | 21,763 (+39, **0 lost**) | The 39 newly validating programs include `InstanceCulling_CS_Prop_BatchCull_ValidateInstInv`, `InstanceCulling_CS_Simple_BatchCull_ValidateInstInv`, `InstanceCulling_CS_Prop_BatchNoCull`, `InstanceCulling_CS_Grass_BatchCull`, `InstanceCulling_CS_Grass_BatchCull_ImposterOnly`, `InstanceCulling_CS_Tree_BatchNoCull`, `InstanceCulling_CS_Simple_BatchCullReflect`, `bvh_skinning_CSComputeVSplitTree`, `firevbuffer_CS_EntityFireResolve_Vectorized` and `PS_EntityFireResolve`. That matches your description of the slot-picked runtime views as the instance-culling path. Most of the cleared programs now stop later (`a descriptor read only as data` +82, `a lane mask read as data` +18), so this is not yet a complete path, but no previously validated program was lost. RTX 4080 / Win10 GPU run in progress: stock settings, 900 s, DRED + target dumps. I'll add the result here when it finishes. AI-assisted (Claude Code).
Author
Owner

@⁠r4tedx on GitHub · 2026-11-24 14:52 UTC · original

@⁠Proudnoob4 thank you. Two things so your GPU run is read the right way, since gpu/run-time-indexed-views is my branch and not part of this PR.

The corpus gain is this PR's, not the follow-up's. The branch sits on top of this PR, so your A/B measures both. @⁠bittertea0323 measured this PR alone on ffe310e: unknown stride 148 to 0, +39 programs, the same numbers. The follow-up changes nothing a translate run can see. What it adds is at run time: host views and current data for buffer slots a shader picks by an index it loads, which is how those instance-culling programs choose their buffers.

Its cost in the title has been measured, and it is too high. @⁠walterwallaceson ran 1d946e8 on an RTX 3070: about 50 times the copied data per frame (202 MB to about 10.8 GB) and 1.0 to 0.1 fps, world still blank. So for your 900 s run: the frame-rate line and the buffer-copy figures per frame are the numbers that matter, next to whether any target changes. If your RTX 4080 shows the same cost, that confirms the branch has to refresh far less before it is worth more runs, and I would not ask anyone for another.

@⁠likecrank-dotcom thank you for writing the pitfall down. integration/wave64-with-180 at 24b3bcc is an old intermediate of mine from before #439's later commits, and it should not be used as a base. The maintained integration is integration/testers, whose INTEGRATION.md lists what it holds; it does not carry this PR yet.

The title was not used in my tests of this PR or of the follow-up branch; the measurements above are the testers'. AI-assisted.

**@⁠r4tedx** on GitHub · 2026-11-24 14:52 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7135084810) @⁠Proudnoob4 thank you. Two things so your GPU run is read the right way, since `gpu/run-time-indexed-views` is my branch and not part of this PR. **The corpus gain is this PR's, not the follow-up's.** The branch sits on top of this PR, so your A/B measures both. @⁠bittertea0323 [measured this PR alone](https://git.gtahub.st/github/Marvisak--VIctory/pulls/704) on `ffe310e`: unknown stride 148 to 0, +39 programs, the same numbers. The follow-up changes nothing a translate run can see. What it adds is at run time: host views and current data for buffer slots a shader picks by an index it loads, which is how those instance-culling programs choose their buffers. **Its cost in the title has been measured, and it is too high.** @⁠walterwallaceson [ran `1d946e8` on an RTX 3070](https://git.gtahub.st/github/Marvisak--VIctory/pulls/704): about 50 times the copied data per frame (202 MB to about 10.8 GB) and 1.0 to 0.1 fps, world still blank. So for your 900 s run: the frame-rate line and the buffer-copy figures per frame are the numbers that matter, next to whether any target changes. If your RTX 4080 shows the same cost, that confirms the branch has to refresh far less before it is worth more runs, and I would not ask anyone for another. @⁠likecrank-dotcom thank you for writing the pitfall down. `integration/wave64-with-180` at `24b3bcc` is an old intermediate of mine from before #439's later commits, and it should not be used as a base. The maintained integration is [`integration/testers`](https://github.com/r4tedx/VIctory/tree/integration/testers), whose `INTEGRATION.md` lists what it holds; it does not carry this PR yet. The title was not used in my tests of this PR or of the follow-up branch; the measurements above are the testers'. AI-assisted.
Author
Owner

@⁠Proudnoob4 on GitHub · 2026-11-24 14:57 UTC · original

Thanks for the correction — you're right, my A/B merged the follow-up onto ffe310e, and since the branch sits on top of #704 the +39 / unknown-stride 148→0 is #704's result, not the follow-up's. bittertea0323's PR-alone numbers match mine exactly, so I should have attributed it to #704 and described the follow-up as run-time only.

On the cost: my mainRuntimeIdx run is not a clean frame-rate measurement. I had 10 full-corpus translate chunks running concurrently on the same CPU for most of those 900 s, so its frame 1500 vs the base run's frame 3000 is confounded and I won't quote it as evidence either way. The current run of the combined stack has no census contention; I'll report presented-frame counts and any per-frame copy figures from that, but it also includes other stacks, so it still won't isolate your branch's cost. Given walterwallaceson's 10x copy / 0.1 fps figure, I agree more runs are not worth asking for until the refresh is narrowed.

AI-assisted (Claude Code).

**@⁠Proudnoob4** on GitHub · 2026-11-24 14:57 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7135214714) Thanks for the correction — you're right, my A/B merged the follow-up onto `ffe310e`, and since the branch sits on top of #704 the +39 / unknown-stride 148→0 is #704's result, not the follow-up's. bittertea0323's PR-alone numbers match mine exactly, so I should have attributed it to #704 and described the follow-up as run-time only. On the cost: my `mainRuntimeIdx` run is **not** a clean frame-rate measurement. I had 10 full-corpus translate chunks running concurrently on the same CPU for most of those 900 s, so its frame 1500 vs the base run's frame 3000 is confounded and I won't quote it as evidence either way. The current run of the combined stack has no census contention; I'll report presented-frame counts and any per-frame copy figures from that, but it also includes other stacks, so it still won't isolate your branch's cost. Given walterwallaceson's 10x copy / 0.1 fps figure, I agree more runs are not worth asking for until the refresh is narrowed. AI-assisted (Claude Code).
Author
Owner

@⁠Proudnoob4 on GitHub · 2026-11-24 15:07 UTC · original

Follow-up to my correction: the per-frame copy cost on the RTX 4080, from the final copystat block of each 900 s run

Stack (all on RTX 4080 / Win10, diag, stock settings) MB/frame ms/frame
base (#206 + #493) 4,229 11.4
+ #878 mask-dword joins 4,233 10.5
+ #876 typeless views 4,363 11.8
+ gpu/run-time-indexed-views 4,950 70.0
everything combined (typeless + #728 + #878 + follow-up) 4,772 83.5

So on this card the follow-up's run-time view refresh adds about +720 MB/frame and +60 ms/frame (copy time ~6x), rather than walterwallaceson's ~10x on the 3070, and the combined stack is in the same range. The largest single source in the combined run is 0x35900000+0xae00000: 17.5x/frame, 3,192.91 MB/frame, 56.76 ms/frame. This is copystat's own per-frame figure, so the concurrent translate chunks in that run do not explain it (they only affect how many frames were presented in 900 s).

Frame progress for context: base and the first two stacks reached frame 3000 in 900 s; the runtime-indexed run reached 1500 (with 10 translate chunks competing for CPU), and the combined run reached 2048. No device removal in any run.

AI-assisted (Claude Code).

**@⁠Proudnoob4** on GitHub · 2026-11-24 15:07 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7135509455) **Follow-up to my correction: the per-frame copy cost on the RTX 4080, from the final `copystat` block of each 900 s run** | Stack (all on RTX 4080 / Win10, diag, stock settings) | MB/frame | ms/frame | |---|---:|---:| | base (`#206` + `#493`) | 4,229 | 11.4 | | + #878 mask-dword joins | 4,233 | 10.5 | | + #876 typeless views | 4,363 | 11.8 | | + `gpu/run-time-indexed-views` | **4,950** | **70.0** | | everything combined (typeless + #728 + #878 + follow-up) | 4,772 | 83.5 | So on this card the follow-up's run-time view refresh adds about **+720 MB/frame and +60 ms/frame** (copy time ~6x), rather than walterwallaceson's ~10x on the 3070, and the combined stack is in the same range. The largest single source in the combined run is `0x35900000+0xae00000`: 17.5x/frame, 3,192.91 MB/frame, 56.76 ms/frame. This is copystat's own per-frame figure, so the concurrent translate chunks in that run do not explain it (they only affect how many frames were presented in 900 s). Frame progress for context: base and the first two stacks reached frame 3000 in 900 s; the runtime-indexed run reached 1500 (with 10 translate chunks competing for CPU), and the combined run reached 2048. No device removal in any run. AI-assisted (Claude Code).
Author
Owner

@⁠r4tedx on GitHub · 2026-11-24 15:09 UTC · original

@⁠Proudnoob4 thank you, that is the clean figure the branch was missing: +720 MB and +60 ms per frame on an RTX 4080, with no device removal, and the per-range line is the useful part. One 174 MB range refreshed 17.5 times a frame is 3.2 GB of the 4.9, so most of the cost is the same memory copied again for each submission that binds such a shader, not many different buffers. That tells me what the next version has to do first: refresh a range at most once per frame unless the title wrote to it in between. I will not ask for another run before that exists.

Your frame counts I read as you do: the copy figures stand on their own, the frames reached do not.

AI-assisted.

**@⁠r4tedx** on GitHub · 2026-11-24 15:09 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7135547461) @⁠Proudnoob4 thank you, that is the clean figure the branch was missing: +720 MB and +60 ms per frame on an RTX 4080, with no device removal, and the per-range line is the useful part. One 174 MB range refreshed 17.5 times a frame is 3.2 GB of the 4.9, so most of the cost is the same memory copied again for each submission that binds such a shader, not many different buffers. That tells me what the next version has to do first: refresh a range at most once per frame unless the title wrote to it in between. I will not ask for another run before that exists. Your frame counts I read as you do: the copy figures stand on their own, the frames reached do not. AI-assisted.
Author
Owner

@⁠r4tedx on GitHub · 2026-11-24 15:56 UTC · original

@⁠likecrank-dotcom the last part of your comment matters for the tester tree, so I am answering that part. Your f407e83 is this PR ported onto the tree at update 5 with the 1440p fallback, and it is the first run I know of where all four culling programs were translated and had host pipelines in the title. It then hung after 111 s, on a compute dispatch, where the same tree without this PR held the prologue for 600 and 900 s on an RTX 3090 and over ten minutes on an RX 6750 XT (#841). Different card and one run, as you say, but the direction is worth pinning down before anyone concludes the programs are fine or at fault.

One run would separate it without new code: the same f407e83 build with

VICTORY_SKIP_PIPELINES=17af15c4015cb4b6,55679a0547649d0b,fdd56d97a806bcca,89d08e561897d4e5

which omits the dispatches of those four pipelines. If it then holds as long as the tree did, the newly running culling programs are involved (a loop that does not end, or what they write), and the next step is each hash on its own. If it still hangs near 111 s, it is something else on that card. Your DRED trace starting at 42f717f1b4d18e94 and fdd56d97a806bcca fits either reading.

Two things from my side so you do not duplicate work:

  • The tree is about to carry this PR itself (with #489, #294 and #346), fitted to its heap as title, dynamic, guard, then the raw aliases, where yours puts the aliases before the guard. It is built and waiting for its test run here. Because of your result, its notes will say plainly that the instance-culling programs run for the first time with it and that the head before it (da605bc) is the one to compare against if a run gets shorter.
  • A buffer view of no elements removed the device in another tester's run of this PR (the debug layer named CreateUnorderedAccessView); #193's f99b792, in this PR's head since 42538cd, guards it. Your port takes d5b23e1, which is before that, so that is a second thing your 111 s could be.

I have not run any of this in the title. AI-assisted.

**@⁠r4tedx** on GitHub · 2026-11-24 15:56 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7136879883) @⁠likecrank-dotcom the last part of your comment matters for the tester tree, so I am answering that part. Your `f407e83` is this PR ported onto the tree at update 5 with the 1440p fallback, and it is the first run I know of where all four culling programs were translated and had host pipelines in the title. It then hung after 111 s, on a compute dispatch, where the same tree without this PR held the prologue for 600 and 900 s on an RTX 3090 and over ten minutes on an RX 6750 XT ([#841](https://git.gtahub.st/github/Marvisak--VIctory/issues/841)). Different card and one run, as you say, but the direction is worth pinning down before anyone concludes the programs are fine or at fault. One run would separate it without new code: the same `f407e83` build with ``` VICTORY_SKIP_PIPELINES=17af15c4015cb4b6,55679a0547649d0b,fdd56d97a806bcca,89d08e561897d4e5 ``` which omits the dispatches of those four pipelines. If it then holds as long as the tree did, the newly running culling programs are involved (a loop that does not end, or what they write), and the next step is each hash on its own. If it still hangs near 111 s, it is something else on that card. Your DRED trace starting at `42f717f1b4d18e94` and `fdd56d97a806bcca` fits either reading. Two things from my side so you do not duplicate work: - The tree is about to carry this PR itself (with #489, #294 and #346), fitted to its heap as title, dynamic, guard, then the raw aliases, where yours puts the aliases before the guard. It is built and waiting for its test run here. Because of your result, its notes will say plainly that the instance-culling programs run for the first time with it and that the head before it (`da605bc`) is the one to compare against if a run gets shorter. - A buffer view of no elements removed the device in another tester's run of this PR (the debug layer named `CreateUnorderedAccessView`); #193's `f99b792`, in this PR's head since `42538cd`, guards it. Your port takes `d5b23e1`, which is before that, so that is a second thing your 111 s could be. I have not run any of this in the title. AI-assisted.
Author
Owner

@⁠r4tedx on GitHub · 2026-11-24 15:58 UTC · original

@⁠likecrank-dotcom one addition, on the repeat you added after I wrote: a removal with 0x887A0001 (INVALID_CALL) and an empty DRED is the signature @⁠walterwallaceson reported above for this PR at d5b23e1: with the debug layer working, the only error before it was CreateUnorderedAccessView refusing a structured view with NumElements 0, and the device was gone about 100 ms later. Their two-line guard (a view of no elements becomes no view, in buffer_srv and buffer_uav of descriptor/host.rs) removed it, and #193's f99b792, in this PR's head since 42538cd, covers the same case.

So your 57 s run and your 111 s run may be two different failures: the INVALID_CALL one has a known cause and fix that your port predates, and only the DEVICE_HUNG one is the open question the skip run would answer. Taking the guard first would keep the first from hiding the second. I have not run either in the title.

AI-assisted.

**@⁠r4tedx** on GitHub · 2026-11-24 15:58 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7136928059) @⁠likecrank-dotcom one addition, on the repeat you added after I wrote: a removal with `0x887A0001` (`INVALID_CALL`) and an empty DRED is the signature @⁠walterwallaceson reported [above](https://git.gtahub.st/github/Marvisak--VIctory/pulls/704) for this PR at `d5b23e1`: with the debug layer working, the only error before it was `CreateUnorderedAccessView` refusing a structured view with `NumElements` 0, and the device was gone about 100 ms later. Their two-line guard (a view of no elements becomes no view, in `buffer_srv` and `buffer_uav` of `descriptor/host.rs`) removed it, and #193's `f99b792`, in this PR's head since `42538cd`, covers the same case. So your 57 s run and your 111 s run may be two different failures: the `INVALID_CALL` one has a known cause and fix that your port predates, and only the `DEVICE_HUNG` one is the open question the skip run would answer. Taking the guard first would keep the first from hiding the second. I have not run either in the title. AI-assisted.
Author
Owner

@⁠PigBun-AI on GitHub · 2026-11-24 16:01 UTC · original

Thanks for the write-up and for the probe numbers in the description; we hit the same family of problems from a different direction and want to put our measurements next to yours in case they are useful. Everything below is from synthetic hand-assembled programs on the adapters named, not from running the title through #704. Please correct anything we have misread.

What we measured. A test that translates small GFX10 programs and runs them on D3D12 with the debug layer on. Each program reads an SRV, writes a UAV, and does an atomic add, at elements 0 and 2 and at byte offsets 0, 4, 12, 16, 20 and 36 inside and past the element. We vary the kind the shader declares (structured with a stride, or raw) against the kind of view that is bound (structured with that stride, or raw over the same bytes). Adapters: RTX 5090 (32-wide), an AMD Radeon integrated GPU (waves 32–64) and WARP.

  • First pass, strides 16 and 20: 96 cases (3 adapters × 2 translator variants × 16 access/kind/stride cases).
  • Second pass, 120 rows per adapter and translator variant (5090, Radeon iGPU, WARP): strides 4, 8, 12, 16, 20, 24, 32, 48, 64 and 2044, and for strides 16 and 20 three extra conditions: the buffer in a default heap, a view starting at element 4, and a view shorter than the buffer.

Results with the shader declaring one kind and the view being the other (the translator unchanged, i.e. structured declared for a known stride):

Adapter What goes wrong
RTX 5090 SRV reads, in both directions (declared raw / bound structured, and declared structured / bound raw): wrong for strides 8, 12, 16, 24, 32, 48 and 64; right for strides 4, 20 and 2044. For stride 16 it stays wrong with the buffer in a default heap, with a view starting at element 4 and with a view shorter than the buffer. UAV writes and atomic adds were right in every combination.
AMD Radeon iGPU SRV reads right in every combination. Declared structured / bound raw, UAV write and atomic add: wrong for every stride we tried — the element index is dropped and the writes land on top of element 0 (for stride 16, element 0 +0 reads back 0xa010, the sum of element 2's store and an atomic add, and element 2's dwords stay 0). The other direction (declared raw / bound structured) is right.
WARP Right in every combination, both directions.

The debug layer printed nothing in any row of either pass, including the ones that read or wrote wrong data.

How this relates to your probe. In "Why not pick the handle kind in the shader" you wrote that for a raw handle over a structured SRV, "The RTX 5070 reads byte B x 3 for a stride of 12 and B x 4 for a stride of 16 or an RGBA32F view, but byte B for a stride of 20." On the 5090 the declared-raw / bound-structured case with stride 16 shows the same thing (the byte offset is multiplied by 4: offset 4 returns dword 4 where dword 1 is expected, offset 12 returns dword 12), and stride 20 reads correctly, as on your 5070. Your 12 matches too (wrong); we additionally see 8, 24, 32, 48 and 64 wrong and 4 and 2044 right. We could not find a simple rule for which strides are affected and are not claiming one. The opposite direction (declared structured / bound raw) reads wrong on the 5090 for the same set of strides. That looks like one effect seen from both sides, but we have only looked at the values, not at why.

What we did on our side (offered as an idea and a way to test it, not as something we ask you to adopt; we are not pasting code): the translator declares every access whose stride it knows as raw and computes index * stride + offset itself; the host view layer makes a raw view for every structured SRV/UAV with a non-zero stride, and makes a null view (counted by reason) where the view would not start on 16 bytes. With that, the declared kind always matches the bound kind. In the test above, with every access declared raw, WARP and the Radeon are right in all 120 rows each; the 5090 is right in every row where the bound view is raw, and the remaining wrong rows are the ones where the test deliberately binds a structured view under a raw declaration (which the view layer change removes). We have not yet run the combined shader + view-layer change over the full test suite or in the title, so please read this as "the idea passes this probe", not as a validated fix.

How it fits with #704. As we read it, #704 covers programs whose stride is not known at translation, through the stride table and the raw alias pool; what we describe covers accesses whose stride is known. So the two seem to cover different programs, and the host-side raw views could be shared. We read #704's code and tried a trial merge against our tree (our fork has diverged: 7 files conflicted, and our stride table entry layout differs from yours, so we have not run it). One thing we noticed while reading, which we would like to check rather than assert: the paths #704 changes appear to be the unknown-stride indexed reads, writes and atomics; a raw access with no index (for example a scalar buffer load of a structured SRV) seems to keep its raw declaration. Two questions rather than claims:

  1. For the known-stride path on main, do you know of a reason structured should stay the declaration there? The AMD UAV result above makes us think the mismatch is not only an NVIDIA issue, but it only shows up when the view is raw and the declaration structured, which main may never produce.
  2. Your table says stores and atomics "were already right on all three adapters". That matches our 5090 and WARP results. On the Radeon we only see a problem for declared structured / bound raw; did your Radeon column cover that direction?

We have not run the title with #704 on the 5090, so we have no result for or against it there. Our raw data (per row: adapter, access, declaration, binding, stride, condition, expected/got values) is available if it helps; we can attach it as a gist or file.

Not tested by us: textures and typed views; strides above 2044; a wave64-only host.


Written with AI assistance (PigBun-AI account, an AI-assisted team working on running the title on an RTX 5090). Numbers are from our own probes and we have tried to say what is measured versus guessed; corrections welcome.

**@⁠PigBun-AI** on GitHub · 2026-11-24 16:01 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7136990467) Thanks for the write-up and for the probe numbers in the description; we hit the same family of problems from a different direction and want to put our measurements next to yours in case they are useful. Everything below is from synthetic hand-assembled programs on the adapters named, not from running the title through #704. Please correct anything we have misread. **What we measured.** A test that translates small GFX10 programs and runs them on D3D12 with the debug layer on. Each program reads an SRV, writes a UAV, and does an atomic add, at elements 0 and 2 and at byte offsets 0, 4, 12, 16, 20 and 36 inside and past the element. We vary the kind the shader *declares* (structured with a stride, or raw) against the kind of view that is *bound* (structured with that stride, or raw over the same bytes). Adapters: RTX 5090 (32-wide), an AMD Radeon integrated GPU (waves 32–64) and WARP. - **First pass, strides 16 and 20:** 96 cases (3 adapters × 2 translator variants × 16 access/kind/stride cases). - **Second pass, 120 rows per adapter and translator variant (5090, Radeon iGPU, WARP):** strides 4, 8, 12, 16, 20, 24, 32, 48, 64 and 2044, and for strides 16 and 20 three extra conditions: the buffer in a default heap, a view starting at element 4, and a view shorter than the buffer. **Results with the shader declaring one kind and the view being the other** (the translator unchanged, i.e. structured declared for a known stride): | Adapter | What goes wrong | |---|---| | RTX 5090 | SRV reads, in **both** directions (declared raw / bound structured, and declared structured / bound raw): wrong for strides 8, 12, 16, 24, 32, 48 and 64; right for strides 4, 20 and 2044. For stride 16 it stays wrong with the buffer in a default heap, with a view starting at element 4 and with a view shorter than the buffer. UAV writes and atomic adds were right in every combination. | | AMD Radeon iGPU | SRV reads right in every combination. **Declared structured / bound raw, UAV write and atomic add:** wrong for every stride we tried — the element index is dropped and the writes land on top of element 0 (for stride 16, element 0 +0 reads back `0xa010`, the sum of element 2's store and an atomic add, and element 2's dwords stay 0). The other direction (declared raw / bound structured) is right. | | WARP | Right in every combination, both directions. | The debug layer printed nothing in any row of either pass, including the ones that read or wrote wrong data. **How this relates to your probe.** In "Why not pick the handle kind in the shader" you wrote that for a raw handle over a structured SRV, "The RTX 5070 reads byte B x 3 for a stride of 12 and B x 4 for a stride of 16 or an RGBA32F view, but byte B for a stride of 20." On the 5090 the declared-raw / bound-structured case with stride 16 shows the same thing (the byte offset is multiplied by 4: offset 4 returns dword 4 where dword 1 is expected, offset 12 returns dword 12), and stride 20 reads correctly, as on your 5070. Your 12 matches too (wrong); we additionally see 8, 24, 32, 48 and 64 wrong and 4 and 2044 right. We could not find a simple rule for which strides are affected and are not claiming one. The opposite direction (declared structured / bound raw) reads wrong on the 5090 for the same set of strides. That looks like one effect seen from both sides, but we have only looked at the values, not at why. **What we did on our side** (offered as an idea and a way to test it, not as something we ask you to adopt; we are not pasting code): the translator declares every access whose stride it knows as raw and computes `index * stride + offset` itself; the host view layer makes a raw view for every structured SRV/UAV with a non-zero stride, and makes a null view (counted by reason) where the view would not start on 16 bytes. With that, the declared kind always matches the bound kind. In the test above, with every access declared raw, WARP and the Radeon are right in all 120 rows each; the 5090 is right in every row where the bound view is raw, and the remaining wrong rows are the ones where the test deliberately binds a structured view under a raw declaration (which the view layer change removes). We have not yet run the combined shader + view-layer change over the full test suite or in the title, so please read this as "the idea passes this probe", not as a validated fix. **How it fits with #704.** As we read it, #704 covers programs whose stride is *not* known at translation, through the stride table and the raw alias pool; what we describe covers accesses whose stride *is* known. So the two seem to cover different programs, and the host-side raw views could be shared. We read #704's code and tried a trial merge against our tree (our fork has diverged: 7 files conflicted, and our stride table entry layout differs from yours, so we have not run it). One thing we noticed while reading, which we would like to check rather than assert: the paths #704 changes appear to be the unknown-stride indexed reads, writes and atomics; a raw access with no index (for example a scalar buffer load of a structured SRV) seems to keep its raw declaration. Two questions rather than claims: 1. For the known-stride path on `main`, do you know of a reason structured should stay the declaration there? The AMD UAV result above makes us think the mismatch is not only an NVIDIA issue, but it only shows up when the view is raw and the declaration structured, which `main` may never produce. 2. Your table says stores and atomics "were already right on all three adapters". That matches our 5090 and WARP results. On the Radeon we only see a problem for declared structured / bound raw; did your Radeon column cover that direction? We have not run the title with #704 on the 5090, so we have no result for or against it there. Our raw data (per row: adapter, access, declaration, binding, stride, condition, expected/got values) is available if it helps; we can attach it as a gist or file. Not tested by us: textures and typed views; strides above 2044; a wave64-only host. --- *Written with AI assistance (PigBun-AI account, an AI-assisted team working on running the title on an RTX 5090). Numbers are from our own probes and we have tried to say what is measured versus guessed; corrections welcome.*
Author
Owner

@⁠r4tedx on GitHub · 2026-11-24 16:07 UTC · original

@⁠PigBun-AI, thank you. This is a careful probe, and it matches what I saw on the RTX 5070 where we overlap. I checked your two questions and your observation against the code at 1f3c184:

  1. The known-stride path. main and this PR declare a structured handle (kind 12) with the stride from the title's used-resource entry. The kinds therefore agree as long as the slot holds a structured view of that stride, which is what the title makes for such a buffer. I know of no reason it must stay structured. Your AMD result (declared structured, bound raw: the index is dropped and UAV writes land on element 0) only arises if a raw view sits where the entry says a stride. I haven't seen that or measured it. Declaring every access raw, over a raw view of the same bytes, would remove the question entirely, at the cost of a raw view per structured view. That cost already applies here to views reached through the stride table.
  2. My Radeon column. No. My stores and atomics covered a raw declaration over raw, structured and typed views only. The declared-structured, bound-raw direction was not covered.
  3. Your observation is right. Raw declarations without an index don't go through the raw alias, and that is true on main as well as here. In lower.rs that covers buffer loads, stores and atomics with no index (None => self.handle(site, src, false, (11 | u, 0))), and scalar loads of an SRV slot (s_buffer_load → handle(…, (11, 0))). If the title's view in the slot is structured, such a read is a raw handle over a structured view. That is the case that reads B × 3 / B × 4 on NVIDIA. This PR only reroutes indexed accesses whose stride is unknown. I'll look at sending the unindexed and scalar forms through the same raw view as a follow-up on top of this PR, with a GPU test of a structured view read that way. I'll post the result here.

Your raw rows would help with item 3, especially which strides read wrong for a raw declaration with no index. A gist is fine.

The title was not used in these checks; they're from reading the code.

AI-assisted (Claude Code).

**@⁠r4tedx** on GitHub · 2026-11-24 16:07 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7137169238) @⁠PigBun-AI, thank you. This is a careful probe, and it matches what I saw on the RTX 5070 where we overlap. I checked your two questions and your observation against the code at `1f3c184`: 1. **The known-stride path.** `main` and this PR declare a structured handle (kind 12) with the stride from the title's used-resource entry. The kinds therefore agree as long as the slot holds a structured view of that stride, which is what the title makes for such a buffer. I know of no reason it must stay structured. Your AMD result (declared structured, bound raw: the index is dropped and UAV writes land on element 0) only arises if a raw view sits where the entry says a stride. I haven't seen that or measured it. Declaring every access raw, over a raw view of the same bytes, would remove the question entirely, at the cost of a raw view per structured view. That cost already applies here to views reached through the stride table. 2. **My Radeon column.** No. My stores and atomics covered a raw declaration over raw, structured and typed views only. The declared-structured, bound-raw direction was not covered. 3. **Your observation is right.** Raw declarations without an index don't go through the raw alias, and that is true on `main` as well as here. In `lower.rs` that covers buffer loads, stores and atomics with no index (`None => self.handle(site, src, false, (11 | u, 0))`), and scalar loads of an SRV slot (`s_buffer_load` → `handle(…, (11, 0))`). If the title's view in the slot is structured, such a read is a raw handle over a structured view. That is the case that reads `B × 3` / `B × 4` on NVIDIA. This PR only reroutes indexed accesses whose stride is unknown. I'll look at sending the unindexed and scalar forms through the same raw view as a follow-up on top of this PR, with a GPU test of a structured view read that way. I'll post the result here. Your raw rows would help with item 3, especially which strides read wrong for a raw declaration with no index. A gist is fine. The title was not used in these checks; they're from reading the code. AI-assisted (Claude Code).
Author
Owner

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

A comparison for the copy-cost question, on an RTX 2080: #704 at 1f3c184 (with #193) doesn't raise the bytes copied per frame here.

12-minute runs to the world on JMAN730's fork + #493 + #189 (d0fd9bf, Wave32) + #206 + #667, 2^18 slots, loop limit 32, no DRED. Medians over the second half; three runs without it, one with:

without #704 (3 runs) with #704
title memory copied per frame 215 / 219 / 238 MB 203 MB
frame time 704 / 721 / 732 ms 782 ms
draws run per frame 2,386–2,408 2,436
dropped without a host pipeline per frame 845–891 704
programs refused 383–390 343

So here it's about 140–190 fewer dropped draws and dispatches per frame. Frame time is 7–11% higher in one run; I can't separate that from the extra work that now runs.

Limits: the four instance-culling programs are still refused in this stack (by #189), so it says nothing about what their bindings cost. It doesn't include gpu/run-time-indexed-views.

AI-assisted (Claude Code): the runs and log analysis were automated. The hardware, title copy and runs are the user's.

**@⁠NuraadGit** on GitHub · 2026-11-24 16:27 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7137697378) A comparison for the copy-cost question, on an RTX 2080: **#704 at `1f3c184` (with #193) doesn't raise the bytes copied per frame here.** 12-minute runs to the world on JMAN730's fork + #493 + #189 (`d0fd9bf`, Wave32) + #206 + #667, 2^18 slots, loop limit 32, no DRED. Medians over the second half; three runs without it, one with: | | without #704 (3 runs) | with #704 | |---|---:|---:| | title memory copied per frame | 215 / 219 / 238 MB | 203 MB | | frame time | 704 / 721 / 732 ms | 782 ms | | draws run per frame | 2,386–2,408 | 2,436 | | dropped without a host pipeline per frame | 845–891 | **704** | | programs refused | 383–390 | **343** | So here it's about 140–190 fewer dropped draws and dispatches per frame. Frame time is 7–11% higher in one run; I can't separate that from the extra work that now runs. Limits: the four instance-culling programs are still refused in this stack (by #189), so it says nothing about what their bindings cost. It doesn't include `gpu/run-time-indexed-views`. *AI-assisted (Claude Code): the runs and log analysis were automated. The hardware, title copy and runs are the user's.*
Author
Owner

@⁠r4tedx on GitHub · 2026-11-24 16:37 UTC · original

@⁠NuraadGit, thank you. Twelve-minute runs with three controls are what this needed, and the result fits what the code does: #704 adds no copy of title memory of its own (203 MB per frame, against 215–238 MB without it), and about 140–190 fewer draws and dispatches per frame are dropped for lack of a host pipeline. As you say, the four instance-culling programs are still refused by #189 in this stack, so this doesn't cover what their bindings cost. Sil3ntGam3r's RTX 3070 runs on #439 measure that case. I've added your table to the PR description.

AI-assisted (Claude Code).

**@⁠r4tedx** on GitHub · 2026-11-24 16:37 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7137955858) @⁠NuraadGit, thank you. Twelve-minute runs with three controls are what this needed, and the result fits what the code does: #704 adds no copy of title memory of its own (203 MB per frame, against 215–238 MB without it), and about 140–190 fewer draws and dispatches per frame are dropped for lack of a host pipeline. As you say, the four instance-culling programs are still refused by #189 in this stack, so this doesn't cover what their bindings cost. Sil3ntGam3r's RTX 3070 runs on #439 measure that case. I've added your table to the PR description. AI-assisted (Claude Code).
Author
Owner

@⁠Ctrl-Alt-Haze on GitHub · 2026-11-24 16:51 UTC · original

Independent verification on Windows 11, RTX 5070 Ti (driver 32.0.16.2135) + WARP (VICTORY_D3D12_DEBUG=1), dxil.dll 1.8.2502.11, Rust 1.98.1, cleanly rebased on upstream/main (ffe310eb):

  • cargo xtask policy: 155 files ok; both clippy checks (--all-targets default and --all-features) pass.
  • cargo test --workspace --locked: 348 passed, 0 failed, 6 ignored.
  • victory-shader --features host (VICTORY_D3D12_DEBUG=1, RTX 5070 Ti & VICTORY_WARP=1): 124 passed, 0 failed, 1 ignored (0 D3D12 debug errors/warnings).
  • victory-gpu --features diagnostics (VICTORY_D3D12_DEBUG=1, RTX 5070 Ti & VICTORY_D3D12_WARP=1): 55 passed, 0 failed, 1 ignored (raw_view_tests pass cleanly on both adapters with debug layer enabled).

AI-assisted verification on local RTX 5070 Ti + WARP; no game data.

**@⁠Ctrl-Alt-Haze** on GitHub · 2026-11-24 16:51 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7138308381) Independent verification on **Windows 11**, **RTX 5070 Ti** (driver `32.0.16.2135`) + **WARP** (`VICTORY_D3D12_DEBUG=1`), **dxil.dll `1.8.2502.11`**, **Rust `1.98.1`**, cleanly rebased on `upstream/main` (`ffe310eb`): - `cargo xtask policy`: `155 files ok`; both `clippy` checks (`--all-targets` default and `--all-features`) pass. - `cargo test --workspace --locked`: **348 passed, 0 failed, 6 ignored**. - `victory-shader --features host` (`VICTORY_D3D12_DEBUG=1`, RTX 5070 Ti & `VICTORY_WARP=1`): **124 passed, 0 failed, 1 ignored** (0 D3D12 debug errors/warnings). - `victory-gpu --features diagnostics` (`VICTORY_D3D12_DEBUG=1`, RTX 5070 Ti & `VICTORY_D3D12_WARP=1`): **55 passed, 0 failed, 1 ignored** (`raw_view_tests` pass cleanly on both adapters with debug layer enabled). AI-assisted verification on local RTX 5070 Ti + WARP; no game data.
Author
Owner

@⁠r4tedx on GitHub · 2026-11-24 16:57 UTC · original

@⁠Ctrl-Alt-Haze, thank you. The debug-layer runs are the part I couldn't do: the D3D12 debug layer isn't installed on the machine this PR was written on. With it on, raw_view_tests and the shader tests run clean on an RTX 5070 Ti and on WARP, which covers the raw alias views and the stride table's root SRV. I've added it to the PR description, in place of the "not exercised: the D3D12 debug layer" line.

AI-assisted (Claude Code).

**@⁠r4tedx** on GitHub · 2026-11-24 16:57 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7138473231) @⁠Ctrl-Alt-Haze, thank you. The debug-layer runs are the part I couldn't do: the D3D12 debug layer isn't installed on the machine this PR was written on. With it on, `raw_view_tests` and the shader tests run clean on an RTX 5070 Ti and on WARP, which covers the raw alias views and the stride table's root SRV. I've added it to the PR description, in place of the "not exercised: the D3D12 debug layer" line. AI-assisted (Claude Code).
Author
Owner

@⁠aycow on GitHub · 2026-11-24 17:24 UTC · original

@⁠r4tedx This test-only probe on 1f3c184 emits unindexed MUBUF and scalar SMEM without a stride table entry. Explicitly binding the matching raw alias made all 24 reference checks pass across AMD, NVIDIA and WARP for raw, stride-12, stride-16, and float4-backed inputs. Production routing stays with your follow-up.

**@⁠aycow** on GitHub · 2026-11-24 17:24 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7139156046) @⁠r4tedx This [test-only probe on `1f3c184`](https://github.com/aycow/VIctory/commit/46ba0b75666feb54e23b28bdd9ee033f89bf41d2) emits unindexed MUBUF and scalar SMEM without a stride table entry. Explicitly binding the matching raw alias made all 24 reference checks pass across AMD, NVIDIA and WARP for raw, stride-12, stride-16, and float4-backed inputs. Production routing stays with your follow-up.
Author
Owner

@⁠likecrank-dotcom on GitHub · 2026-11-24 14:47 UTC · original · edited 2026-11-24 17:27 UTC

RTX 5060 Ti8GB/Windows11/Ryzen53600/32GB/NVIDIA621.14/retail1.0.2.1, Series X. No OS TDR changes. No concurrent builds/GPU tests during title runs.

Offline success is not yet a title fix. The four original instance-culling containers (17af15c4015cb4b6,55679a0547649d0b,fdd56d97a806bcca,89d08e561897d4e5) emit/validate/create pipelines4/4 on the corrected full-wave64+#704 integration; plain main ffe310e refuses all four at unknown stride. The later f407e83 integration retains the d6897fa/ec83015 baseline, full#439 files, per-lane#566 keys and the existing capped262144-slot dynamic heap. Its final checks:215 shader tests and85 GPU tests passed,0 failed,1 ignored in each suite. Four offline pipeline checks used host waves32–32 and loop limit32. Source: github.com/likecrank-dotcom/VIctory@f407e83108 .

Title run Result
Earlier corrected73af426, loop4096 115.0s, DEVICE_HUNG on compute; dynamic descriptor exhaustion also logged. Different integration, not a matched comparison.
f407e83,d6897fa baseline+#704,loop32 111.4s, removed0x887A0005/reasonHUNG0x887A0006. All four original culling hashes translated/host-created in the title. DRED49/61,op5 Dispatch,no marker; trace begins42f717f1b4d18e94/fdd56d97a806bcca.
Same f407e83,debug requested 57.1s, reasonINVALID_CALL0x887A0001,empty DRED. D3D12GetDebugInterface failed0x887A002D: debug layer unavailable, so this was not a successful debug-layer check. This port predates#193's zero-element safety changes.
New585fcec on public r4tedx update9/94e0ea5 285.1s,self-terminated with removed0x887A0005/reasonHUNG0x887A0006. DRED55/67,op5 Dispatch,no marker;13 recorded operations, again beginning42f717f1b4d18e94 and including fdd56d97a806bcca. No unique culprit assigned.

The new run source: github.com/likecrank-dotcom/VIctory@585fceca0f . Shader,descriptor and shadow-buffer sources are identical to public94e0ea56d358495843511dc10250b88c629c2c77, including update9's#704/#193 safety,#489,#294,#346. Added only the optional diagnostic input/capture/colour-depth preview and bounded preview-source recorder; root-UAV barriers retained in port conflicts. GPU110 passed/0 failed/1 ignored; shader251/0/2 in full serial checks. An unchanged frame-clock timing test failed in the initial parallel suite and first isolated repeat, then passed on the public exact source, a later same-binary isolated repeat and the full serial suite; failures retained locally, no clock edits. Debug-layer caveat above still applies.

Series X, settings-only state fixture without Player progress, new dedicated cache, loop32,NO_WATCHDOG=1,DRED=1,colour/depth preview enabled,PRESENT_1440P disabled. Startup transitions checked by captures. All seven tracked culling hashes have runtime host-pipeline creation events; that alone does not prove correct execution. The automatic archive saved15 preview-source PNG/JSON pairs. Reviewing the entire contact sheet confirms substantial corrupted street geometry in frames1760/1766/1778–1784; early sparse samples were not representative of the full run. The hardware owner separately reported those richer scenes. Intro/credits observed; character control not confirmed. Different source/cache histories prevent a timing attribution.

Skip-test refinement: six unique programs in the old failed submission refused unknown stride on the d6897fa shader baseline but host-created in f407e83:17af15c4015cb4b6,55679a0547649d0b,fdd56d97a806bcca plus42f717f1b4d18e94(Simple),1c4b3c0547e3e6fa(Slod),9209777e8face9dd(Grass). Skipping only the originally named four leaves these last three active. The new same-binary isolation run skips all six plus standalone89d08e561897d4e5; result below.

Barrier hypothesis narrowed: all11 unique compute hashes in the f407e83 failed submission matched to the local corpus by exact container BLAKE3 prefix and contain no s_barrier in native IR after SGPR spill forwarding. The fourth standalone89d08e561897d4e5 also has none. FibbS6's divergent-s_barrier rule therefore does not affect these programs; its separate mesh fixes are not ruled out. Read-only audit utility: github.com/likecrank-dotcom/VIctory@edca455/crates/victory-shader/examples/barrier_audit.rs .

Earlier91f1450/51b5753 integrations did not retain the complete055aef9 tree and are not evidence for full#439 behaviour. No game assets,shader binaries,screenshots,raw dumps or full logs uploaded. AI-assisted: OpenAI Codex performed integrations,tests,captures and analysis; the owner supplied hardware/title and explicitly identified visual observations.

Seven-hash isolation completed: exact same585fcec executable, same Series X/settings-only fixture/loop32/preview/DRED/no-watchdog flags, only SKIP_PIPELINES added. All seven distinct skip messages observed. It self-exited after841.7s with0xC0000409 and the Rust allocator message that17825808 bytes could not be allocated; stoppedByHarness=false. No logged GPU removal. Peak private28562MiB; Windows currently reports a2304MiB automatically managed pagefile. This is a host-memory stop, not the earlier title int3 or a timeout.68 preview-source PNG/JSON pairs saved locally; the last24 reviewed as a contact sheet show heavily corrupted close-up geometry. The owner recognises dialogue/music and suspects the intro-to-gameplay handoff, but character control is not confirmed. One pair with evolved caches is consistent with involvement of the newly enabled culling group; it does not identify one shader, prove those programs incorrect, or establish a timing improvement. Next is a separately tracked page-snapshot memory optimization before narrower skips. No game-derived files uploaded.

**@⁠likecrank-dotcom** on GitHub · 2026-11-24 14:47 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7134961696) · edited 2026-11-24 17:27 UTC RTX 5060 Ti8GB/Windows11/Ryzen53600/32GB/NVIDIA621.14/retail1.0.2.1, Series X. No OS TDR changes. No concurrent builds/GPU tests during title runs. **Offline success is not yet a title fix.** The four original instance-culling containers (17af15c4015cb4b6,55679a0547649d0b,fdd56d97a806bcca,89d08e561897d4e5) emit/validate/create pipelines4/4 on the corrected full-wave64+#704 integration; plain main ffe310e refuses all four at unknown stride. The later f407e83 integration retains the d6897fa/ec83015 baseline, full#439 files, per-lane#566 keys and the existing capped262144-slot dynamic heap. Its final checks:215 shader tests and85 GPU tests passed,0 failed,1 ignored in each suite. Four offline pipeline checks used host waves32–32 and loop limit32. Source: https://github.com/likecrank-dotcom/VIctory/tree/f407e83108e5f803fa6326b1478e8b0cc3d27a56 . | Title run | Result | | --- | --- | | Earlier corrected73af426, loop4096 |115.0s, DEVICE_HUNG on compute; dynamic descriptor exhaustion also logged. Different integration, not a matched comparison. | | f407e83,d6897fa baseline+#704,loop32 |111.4s, removed0x887A0005/reasonHUNG0x887A0006. All four original culling hashes translated/host-created in the title. DRED49/61,op5 Dispatch,no marker; trace begins42f717f1b4d18e94/fdd56d97a806bcca. | | Same f407e83,debug requested |57.1s, reasonINVALID_CALL0x887A0001,empty DRED. D3D12GetDebugInterface failed0x887A002D: debug layer unavailable, so this was **not** a successful debug-layer check. This port predates#193's zero-element safety changes. | | New585fcec on public r4tedx update9/94e0ea5 |285.1s,self-terminated with removed0x887A0005/reasonHUNG0x887A0006. DRED55/67,op5 Dispatch,no marker;13 recorded operations, again beginning42f717f1b4d18e94 and including fdd56d97a806bcca. No unique culprit assigned. | The new run source: https://github.com/likecrank-dotcom/VIctory/tree/585fceca0f52dc76c72c8b849a9bf0d6e77a116c . Shader,descriptor and shadow-buffer sources are identical to public94e0ea56d358495843511dc10250b88c629c2c77, including update9's#704/#193 safety,#489,#294,#346. Added only the optional diagnostic input/capture/colour-depth preview and bounded preview-source recorder; root-UAV barriers retained in port conflicts. GPU110 passed/0 failed/1 ignored; shader251/0/2 in full serial checks. An unchanged frame-clock timing test failed in the initial parallel suite and first isolated repeat, then passed on the public exact source, a later same-binary isolated repeat and the full serial suite; failures retained locally, no clock edits. Debug-layer caveat above still applies. Series X, settings-only state fixture without Player progress, new dedicated cache, loop32,NO_WATCHDOG=1,DRED=1,colour/depth preview enabled,PRESENT_1440P disabled. Startup transitions checked by captures. All seven tracked culling hashes have runtime host-pipeline creation events; that alone does not prove correct execution. The automatic archive saved15 preview-source PNG/JSON pairs. Reviewing the entire contact sheet confirms substantial corrupted street geometry in frames1760/1766/1778–1784; early sparse samples were not representative of the full run. The hardware owner separately reported those richer scenes. Intro/credits observed; character control not confirmed. Different source/cache histories prevent a timing attribution. **Skip-test refinement:** six unique programs in the old failed submission refused unknown stride on the d6897fa shader baseline but host-created in f407e83:17af15c4015cb4b6,55679a0547649d0b,fdd56d97a806bcca plus42f717f1b4d18e94(Simple),1c4b3c0547e3e6fa(Slod),9209777e8face9dd(Grass). Skipping only the originally named four leaves these last three active. The new same-binary isolation run skips all six plus standalone89d08e561897d4e5; result below. **Barrier hypothesis narrowed:** all11 unique compute hashes in the f407e83 failed submission matched to the local corpus by exact container BLAKE3 prefix and contain no s_barrier in native IR after SGPR spill forwarding. The fourth standalone89d08e561897d4e5 also has none. FibbS6's divergent-s_barrier rule therefore does not affect these programs; its separate mesh fixes are not ruled out. Read-only audit utility: https://github.com/likecrank-dotcom/VIctory/blob/edca455/crates/victory-shader/examples/barrier_audit.rs . Earlier91f1450/51b5753 integrations did not retain the complete055aef9 tree and are not evidence for full#439 behaviour. No game assets,shader binaries,screenshots,raw dumps or full logs uploaded. AI-assisted: OpenAI Codex performed integrations,tests,captures and analysis; the owner supplied hardware/title and explicitly identified visual observations. Seven-hash isolation completed: exact same585fcec executable, same Series X/settings-only fixture/loop32/preview/DRED/no-watchdog flags, only SKIP_PIPELINES added. All seven distinct skip messages observed. It self-exited after841.7s with0xC0000409 and the Rust allocator message that17825808 bytes could not be allocated; stoppedByHarness=false. No logged GPU removal. Peak private28562MiB; Windows currently reports a2304MiB automatically managed pagefile. This is a host-memory stop, not the earlier title int3 or a timeout.68 preview-source PNG/JSON pairs saved locally; the last24 reviewed as a contact sheet show heavily corrupted close-up geometry. The owner recognises dialogue/music and suspects the intro-to-gameplay handoff, but character control is not confirmed. One pair with evolved caches is consistent with involvement of the newly enabled culling group; it does not identify one shader, prove those programs incorrect, or establish a timing improvement. Next is a separately tracked page-snapshot memory optimization before narrower skips. No game-derived files uploaded.
Author
Owner

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

@⁠aycow, thanks, that's useful. It confirms the direction for the follow-up: unindexed MUBUF and scalar SMEM reads come out right on AMD, NVIDIA and WARP once they go through the slot's raw alias, for raw, stride-12, stride-16 and float4-backed views.

One thing that would make it a regression test as well as a probe: the same 24 checks with the slot's own structured or typed view bound, which is what 1f3c184 does today for these forms. On NVIDIA that should fail at strides 12 and 16 and pass at 20. If your probe already has that arm, the numbers would help. The follow-up will route these forms through the alias in the translator and needs exactly that before/after. I'll credit your probe there.

AI-assisted (Claude Code).

**@⁠r4tedx** on GitHub · 2026-11-24 17:27 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7139227813) @⁠aycow, thanks, that's useful. It confirms the direction for the follow-up: unindexed MUBUF and scalar SMEM reads come out right on AMD, NVIDIA and WARP once they go through the slot's raw alias, for raw, stride-12, stride-16 and float4-backed views. One thing that would make it a regression test as well as a probe: the same 24 checks with the slot's *own* structured or typed view bound, which is what `1f3c184` does today for these forms. On NVIDIA that should fail at strides 12 and 16 and pass at 20. If your probe already has that arm, the numbers would help. The follow-up will route these forms through the alias in the translator and needs exactly that before/after. I'll credit your probe there. AI-assisted (Claude Code).
Author
Owner

@⁠justlovett0 on GitHub · 2026-11-24 17:32 UTC · original

Verified on Win10 21H2 / RTX 3080 (driver 621.24): the raw-alias slots are what make #193's runtime stride work on NVIDIA (without them the ByteAddressBuffer reads return 0 against structured host views). The unknown-stride class is gone at runtime with this stacked. Details on #193. AI use: Qwen Code (model name not disclosed).

**@⁠justlovett0** on GitHub · 2026-11-24 17:32 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7139354561) Verified on Win10 21H2 / RTX 3080 (driver 621.24): the raw-alias slots are what make #193's runtime stride work on NVIDIA (without them the ByteAddressBuffer reads return 0 against structured host views). The unknown-stride class is gone at runtime with this stacked. Details on #193. AI use: Qwen Code (model name not disclosed).
Author
Owner

@⁠r4tedx on GitHub · 2026-11-24 17:37 UTC · original

@⁠justlovett0, thanks. An RTX 3080 run with and without the alias slots is exactly the comparison this PR rests on: without them, #193's ByteAddressBuffer reads return 0 against the title's structured views, and with them the unknown-stride class is gone at runtime. I've added it to the PR description next to the RTX 5070 table.

AI-assisted (Claude Code).

**@⁠r4tedx** on GitHub · 2026-11-24 17:37 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7139470028) @⁠justlovett0, thanks. An RTX 3080 run with and without the alias slots is exactly the comparison this PR rests on: without them, #193's `ByteAddressBuffer` reads return 0 against the title's structured views, and with them the unknown-stride class is gone at runtime. I've added it to the PR description next to the RTX 5070 table. AI-assisted (Claude Code).
Author
Owner

@⁠neonbyte1 on GitHub · 2026-11-24 18:12 UTC · original

Results on Linux (Wine 11.22 + vkd3d-proton from GE-Proton11-14), RTX 5090, driver 620.73.04. #704 is merged at 1f3c184 into a stack of ffe310e + #190 #217 #347 #322 #454 #493 #579 #177 #259 #542 #388 #514 #1129 #439 (+#223/#233/#320) #953 #747 #1228 #346 #638 #591.

Tests: under Wine on the 5090, unknown_stride_reads_reach_the_bytes_of_the_view_in_the_slot, retiring_slot_is_unavailable_until_its_alias_is_cleared and the four emit::tests unknown-stride tests run (they are not skipped) and pass. The workspace result is 409 passed, 0 failed, 6 ignored.

In game: one 7-minute run (diagnostics build, first mission). Medians are over frames with more than 1,000 draws. The comparison run used the same stack without #704.

per frame without #704 with #704
dropped without a host pipeline 892 725
draws 4,406 4,418
GPU ms 134 135
frame ms 367 517
  • All seven producers from the #638 report translate: 17af15c4015cb4b6, fdd56d97a806bcca, 9209777e8face9dd, 42f717f1b4d18e94, 1c4b3c0547e3e6fa, 89d08e561897d4e5, 55679a0547649d0b. No unknown stride refusal remains in the log.
  • Six of them get a host pipeline and run. fdd56d97a806bcca never does: its pipeline stays "being made" for the rest of the run (the summary line ends with (1 being made) for minutes), so VICTORY_PRODUCERS keeps naming it as the dropped writer of 0x66aae90+0x5265170.
  • There was no device hang or Xid in the run. The 4070 Ti run in this thread hung in DispatchMesh; this stack did not.
  • Frame time rises by about 150 ms. Preparation, GPU and copy-back times stay within about 20 ms of the run without #704, so the extra time falls outside submission. I have not checked whether creating the alias views on the title's thread causes it.
  • Visually there is no change yet. A dumped G-buffer of a busy world frame shows props, lamps and power lines with and without #704; ground and buildings are missing in both.

A note for anyone merging this into a stack that already has bounds-checked stores: the conflict in the raw-store path of lower.rs must keep exactly one of the two index branches. Keeping both pushes two handles per store, and the resulting rawBufferStore has a handle in a value slot. Wine's dxil-spirv then crashes inside CreateComputePipelineState, which is reached first by unknown_stride_reads_reach_the_bytes_of_the_view_in_the_slot.

AI-assisted (Claude); all runs on my machine, no game data shared.

**@⁠neonbyte1** on GitHub · 2026-11-24 18:12 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7140320080) Results on Linux (Wine 11.22 + vkd3d-proton from GE-Proton11-14), RTX 5090, driver 620.73.04. #704 is merged at `1f3c184` into a stack of `ffe310e` + #190 #217 #347 #322 #454 #493 #579 #177 #259 #542 #388 #514 #1129 #439 (+#223/#233/#320) #953 #747 #1228 #346 #638 #591. **Tests:** under Wine on the 5090, `unknown_stride_reads_reach_the_bytes_of_the_view_in_the_slot`, `retiring_slot_is_unavailable_until_its_alias_is_cleared` and the four `emit::tests` unknown-stride tests run (they are not skipped) and pass. The workspace result is 409 passed, 0 failed, 6 ignored. **In game:** one 7-minute run (diagnostics build, first mission). Medians are over frames with more than 1,000 draws. The comparison run used the same stack without #704. | per frame | without #704 | with #704 | |---|---:|---:| | dropped without a host pipeline | 892 | 725 | | draws | 4,406 | 4,418 | | GPU ms | 134 | 135 | | frame ms | 367 | 517 | - All seven producers from the #638 report translate: `17af15c4015cb4b6`, `fdd56d97a806bcca`, `9209777e8face9dd`, `42f717f1b4d18e94`, `1c4b3c0547e3e6fa`, `89d08e561897d4e5`, `55679a0547649d0b`. No `unknown stride` refusal remains in the log. - Six of them get a host pipeline and run. `fdd56d97a806bcca` never does: its pipeline stays "being made" for the rest of the run (the summary line ends with `(1 being made)` for minutes), so `VICTORY_PRODUCERS` keeps naming it as the dropped writer of `0x66aae90+0x5265170`. - There was no device hang or Xid in the run. The 4070 Ti run in this thread hung in `DispatchMesh`; this stack did not. - Frame time rises by about 150 ms. Preparation, GPU and copy-back times stay within about 20 ms of the run without #704, so the extra time falls outside submission. I have not checked whether creating the alias views on the title's thread causes it. - Visually there is no change yet. A dumped G-buffer of a busy world frame shows props, lamps and power lines with and without #704; ground and buildings are missing in both. **A note for anyone merging this into a stack that already has bounds-checked stores:** the conflict in the raw-store path of `lower.rs` must keep exactly one of the two `index` branches. Keeping both pushes two handles per store, and the resulting `rawBufferStore` has a handle in a value slot. Wine's dxil-spirv then crashes inside `CreateComputePipelineState`, which is reached first by `unknown_stride_reads_reach_the_bytes_of_the_view_in_the_slot`. _AI-assisted (Claude); all runs on my machine, no game data shared._
Author
Owner

@⁠r4tedx on GitHub · 2026-11-24 18:18 UTC · original

@⁠neonbyte1, thank you. The run is clear: 892 → 725 dropped per frame, all seven #638 producers translate, and there's no hang on the 5090. The merge note about the bounds-checked store path will save the next person a crash.

On the ~150 ms outside submission, I read the code path. Nothing is measured yet, so this is a candidate, not an answer. For slots mirrored from the title's tables, a slot whose view hasn't changed is skipped. Per-draw dynamic slots (make_at) are made every time, and for each structured or typed buffer view there, #704 adds the following on the calling thread:

  • a second shadow::find under the global shadow lock (the first one happens in make);
  • the alias-map lock;
  • one more CreateShaderResourceView / CreateUnorderedAccessView, made even when that slot's alias already describes the same buffer and range;
  • the stride-table write.

When a list retires, clearing its slots also takes the alias lock once per slot. If the title fills tens of thousands of dynamic buffer views per frame, that adds up. Two cheap changes would remove most of it: pass the shadow make already found instead of looking it up again, and skip re-creating an alias whose buffer, start, length and kind are unchanged. I'd rather make them against a measurement than guess. If your diagnostics build reports dynamic views made per frame, or you can profile the title thread for a few frames, that would show whether this is the cost.

Separately, fdd56d97a806bcca staying "being made" for minutes looks like its host pipeline never finishing compilation on your driver stack, not a translation refusal. I'll pass that to the people working on the culling programs.

The title was not used for this reply; it's from reading the code at 1f3c184.

AI-assisted (Claude Code).

**@⁠r4tedx** on GitHub · 2026-11-24 18:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7140458427) @⁠neonbyte1, thank you. The run is clear: 892 → 725 dropped per frame, all seven #638 producers translate, and there's no hang on the 5090. The merge note about the bounds-checked store path will save the next person a crash. On the ~150 ms outside submission, I read the code path. Nothing is measured yet, so this is a candidate, not an answer. For slots mirrored from the title's tables, a slot whose view hasn't changed is skipped. Per-draw dynamic slots (`make_at`) are made every time, and for each structured or typed buffer view there, #704 adds the following on the calling thread: - a second `shadow::find` under the global shadow lock (the first one happens in `make`); - the alias-map lock; - one more `CreateShaderResourceView` / `CreateUnorderedAccessView`, made even when that slot's alias already describes the same buffer and range; - the stride-table write. When a list retires, clearing its slots also takes the alias lock once per slot. If the title fills tens of thousands of dynamic buffer views per frame, that adds up. Two cheap changes would remove most of it: pass the shadow `make` already found instead of looking it up again, and skip re-creating an alias whose buffer, start, length and kind are unchanged. I'd rather make them against a measurement than guess. If your diagnostics build reports dynamic views made per frame, or you can profile the title thread for a few frames, that would show whether this is the cost. Separately, `fdd56d97a806bcca` staying "being made" for minutes looks like its host pipeline never finishing compilation on your driver stack, not a translation refusal. I'll pass that to the people working on the culling programs. The title was not used for this reply; it's from reading the code at `1f3c184`. AI-assisted (Claude Code).
Author
Owner

@⁠r4tedx on GitHub · 2026-11-24 18:28 UTC · original

@⁠neonbyte1, a follow-up on fdd56d97a806bcca staying "being made". It was checked here, offline, with pipeline creation only and no dispatch, on native D3D12 on an RTX 5070 under Windows, using the tester tree's update 9 code. That program's pipeline was created in about 2 s, as were its siblings: 17af15c4015cb4b6 took about 2.5 s and the meshlet cull about 1.3 s. That's one program per process and wall time; a warm driver cache can't be ruled out.

So a native NVIDIA driver builds it promptly, and the never-finishing build looks specific to the vkd3d-proton path: its DXIL-to-SPIR-V step or the Vulkan driver. Nothing in its DXIL stands out against siblings that did build under vkd3d. 17af15c4015cb4b6 is larger on every count (blocks, phis, handles, wave ops), and it built. If you can, the vkd3d log line for that pipeline, or running dxil-spirv on that one program, would narrow it down. It also means the 111 s hang reported on a native RTX 5060 Ti isn't compile time.

That check used local title data offline (pipeline creation only; the title was not run). Only timings and counts are reported here.

AI-assisted (Claude Code).

**@⁠r4tedx** on GitHub · 2026-11-24 18:28 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7140695911) @⁠neonbyte1, a follow-up on `fdd56d97a806bcca` staying "being made". It was checked here, offline, with pipeline creation only and no dispatch, on native D3D12 on an RTX 5070 under Windows, using the tester tree's update 9 code. That program's pipeline was created in about 2 s, as were its siblings: `17af15c4015cb4b6` took about 2.5 s and the meshlet cull about 1.3 s. That's one program per process and wall time; a warm driver cache can't be ruled out. So a native NVIDIA driver builds it promptly, and the never-finishing build looks specific to the vkd3d-proton path: its DXIL-to-SPIR-V step or the Vulkan driver. Nothing in its DXIL stands out against siblings that did build under vkd3d. `17af15c4015cb4b6` is larger on every count (blocks, phis, handles, wave ops), and it built. If you can, the vkd3d log line for that pipeline, or running dxil-spirv on that one program, would narrow it down. It also means the 111 s hang reported on a native RTX 5060 Ti isn't compile time. That check used local title data offline (pipeline creation only; the title was not run). Only timings and counts are reported here. AI-assisted (Claude Code).
Author
Owner

@⁠PigBun-AI on GitHub · 2026-11-24 20:13 UTC · original

Follow-up from PigBun-AI. This is an AI-assisted account; the measurements below come from our own automated runs, and we have tried to separate what we measured from what we infer. Thanks to @⁠r4tedx for #704 and @⁠n-romanovich for #193 — this is more data for the direction they take.

Two measurements on an RTX 5090 (cross-checked on a Radeon iGPU and on WARP):

1. Large buffer: shader declares a raw ByteAddressBuffer, view is a StructuredBuffer. Our earlier table used tiny buffers; we repeated the SRV read on a 524,288-byte buffer (32,768 records x 4 dwords, every dword uniquely encoded) and read records r = 0, 1, 2, 100, 625, 2048, 2503, 4096, 8190..8193, 10000, 14235, 16383, 16384, 30000, 32766, 32767:

  • raw declaration + raw view, and raw declaration + structured view with stride 4: every read is correct.
  • raw declaration + structured view with stride 16, 32 or 64 (upload heap and default heap alike): only the very first dword is right. For r < 8192 the dword returned is exactly 4x the expected dword index (record r, field k returns dword 4*(4r+k)); for r >= 8192 every read returns 0. The pattern does not depend on the stride or the heap type.
  • The Radeon iGPU and WARP read every element correctly in every combination, and the D3D12 debug layer prints nothing, so on those it is invisible.
  • UAV writes with small buffers were correct in all combinations on the 5090 (we did not repeat that with large buffers).

2. One executable, one switch. In our fork, one environment switch makes the host read structured buffers through a raw view (in the same spirit as #704, applied on our side to accesses whose stride is known), and it can be turned off. With the same executable and parameters, switch on: about 376 world frames without a hang; switch off: DXGI_ERROR_DEVICE_HUNG after about 60 world frames, at the same ExecuteIndirect dispatch where the hang had been in several earlier runs without the change. A second, nearly identical build with the switch on also ran about 352 world frames without a hang. These runs use a synchronous slow mode (roughly 0.5 frames per second), and "frames" means world frames. That is one run per setting on the same executable plus one extra run, all on one machine, so please read it as a strong hint rather than proof.

What we do not know: (a) we have not read back, from the live descriptor, which view type the title's own SRV produces for the buffer used by the hanging dispatch, so we cannot say the pattern in (1) is what hangs it. (b) In the hanging submission, the CPU-side contents of that buffer look normal and its record fields are not out-of-range descriptor indices, and submissions with 8,192 or more records ran five times before the hang without hanging, so "reads 0 past element 8192" is not by itself sufficient to explain the hang. We only report that the two measurements point the same way.

We are happy to share the small test (raw/structured 4/16/32/64 x raw/structured view, 20 records) or adapt it into a regression test on top of #704 if that helps.

Caveats: one RTX 5090 and one driver; the failing-case binding is inferred from host code, not read back; this may not be the cause of other reported hangs.

**@⁠PigBun-AI** on GitHub · 2026-11-24 20:13 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7143220669) Follow-up from PigBun-AI. This is an AI-assisted account; the measurements below come from our own automated runs, and we have tried to separate what we measured from what we infer. Thanks to @⁠r4tedx for #704 and @⁠n-romanovich for #193 — this is more data for the direction they take. Two measurements on an RTX 5090 (cross-checked on a Radeon iGPU and on WARP): **1. Large buffer: shader declares a raw ByteAddressBuffer, view is a StructuredBuffer.** Our earlier table used tiny buffers; we repeated the SRV read on a 524,288-byte buffer (32,768 records x 4 dwords, every dword uniquely encoded) and read records r = 0, 1, 2, 100, 625, 2048, 2503, 4096, 8190..8193, 10000, 14235, 16383, 16384, 30000, 32766, 32767: - raw declaration + raw view, and raw declaration + structured view with stride 4: every read is correct. - raw declaration + structured view with stride 16, 32 or 64 (upload heap and default heap alike): only the very first dword is right. For r < 8192 the dword returned is exactly 4x the expected dword index (record r, field k returns dword 4*(4r+k)); for r >= 8192 every read returns 0. The pattern does not depend on the stride or the heap type. - The Radeon iGPU and WARP read every element correctly in every combination, and the D3D12 debug layer prints nothing, so on those it is invisible. - UAV writes with small buffers were correct in all combinations on the 5090 (we did not repeat that with large buffers). **2. One executable, one switch.** In our fork, one environment switch makes the host read structured buffers through a raw view (in the same spirit as #704, applied on our side to accesses whose stride is known), and it can be turned off. With the same executable and parameters, switch on: about 376 world frames without a hang; switch off: DXGI_ERROR_DEVICE_HUNG after about 60 world frames, at the same ExecuteIndirect dispatch where the hang had been in several earlier runs without the change. A second, nearly identical build with the switch on also ran about 352 world frames without a hang. These runs use a synchronous slow mode (roughly 0.5 frames per second), and "frames" means world frames. That is one run per setting on the same executable plus one extra run, all on one machine, so please read it as a strong hint rather than proof. What we do **not** know: (a) we have not read back, from the live descriptor, which view type the title's own SRV produces for the buffer used by the hanging dispatch, so we cannot say the pattern in (1) is what hangs it. (b) In the hanging submission, the CPU-side contents of that buffer look normal and its record fields are not out-of-range descriptor indices, and submissions with 8,192 or more records ran five times before the hang without hanging, so "reads 0 past element 8192" is not by itself sufficient to explain the hang. We only report that the two measurements point the same way. We are happy to share the small test (raw/structured 4/16/32/64 x raw/structured view, 20 records) or adapt it into a regression test on top of #704 if that helps. Caveats: one RTX 5090 and one driver; the failing-case binding is inferred from host code, not read back; this may not be the cause of other reported hangs.
Author
Owner

@⁠wbkepler on GitHub · 2026-11-24 20:59 UTC · original

One more NVIDIA data point on annotation kind versus view kind. This one is from the title, not a synthetic probe.

On an RTX 5090 (current driver, Windows 11), an SM 6.6 heap handle annotated raw over a slot holding a structured view reads zeros. A structured annotation over a raw view reads zeros too. We hit the second direction in the title. A translator change annotated s_buffer_load_dword* as structured whenever the used-resource entry recorded a stride, even though no buffer_* access of that descriptor indexed records. The title's view in those slots was raw, every load returned 0, and the presented frame went black. Keeping byte-offset loads raw unless an indexed buffer_* access of the same descriptor exists fixed it. That fix kept the structured annotation for indexed accesses, and we saw no mismatch there, which fits your item 1. It also means the recorded stride on its own doesn't tell you the slot's view is structured.

Here is what that means for this PR, read at 1f3c184:

  • The indexed unknown-stride path is safe on NVIDIA. runtime_view takes its handle from the entry's raw slot. That slot is the host's own raw alias of the host copy (Viewed::Bytes), or the null raw alias (Viewed::Unknown). It is the title's slot only for Viewed::Own, which means a raw view or a non-buffer resource. host_resource is Some only for textures, so a structured or typed buffer view always gets an alias. A raw annotation never lands over a structured view here.
  • The follow-up (your item 3). The unindexed forms still use handle(.., (11 | u, 0)) over the title's slot: the None => arms of the buffer load, store and atomic, and s_buffer_load. Sending them through stride_entry with byte = off + bias would make them correct whatever view kind the title made. Picking a structured annotation from the recorded stride would not, because of the black-frame case above.
  • Other slot writers. Every path that writes a view into a host heap slot needs note_view or forget_view. Upstream that is only make_at and mirror, and both are covered. A stack that adds another writer without the call leaves the entry at 0, so the read goes to the slot itself (raw over structured, zeros on NVIDIA). Worse, it can leave an entry naming a previous buffer's alias, and then the read returns that buffer's bytes with no warning.

AI-assisted review (Claude Code); checked on Windows 11 / RTX 5090.

**@⁠wbkepler** on GitHub · 2026-11-24 20:59 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7144332986) One more NVIDIA data point on annotation kind versus view kind. This one is from the title, not a synthetic probe. On an RTX 5090 (current driver, Windows 11), an SM 6.6 heap handle annotated raw over a slot holding a structured view reads zeros. A structured annotation over a raw view reads zeros too. We hit the second direction in the title. A translator change annotated `s_buffer_load_dword*` as structured whenever the used-resource entry recorded a stride, even though no `buffer_*` access of that descriptor indexed records. The title's view in those slots was raw, every load returned 0, and the presented frame went black. Keeping byte-offset loads raw unless an indexed `buffer_*` access of the same descriptor exists fixed it. That fix kept the structured annotation for indexed accesses, and we saw no mismatch there, which fits your item 1. It also means the recorded stride on its own doesn't tell you the slot's view is structured. Here is what that means for this PR, read at `1f3c184`: - **The indexed unknown-stride path is safe on NVIDIA.** `runtime_view` takes its handle from the entry's raw slot. That slot is the host's own raw alias of the host copy (`Viewed::Bytes`), or the null raw alias (`Viewed::Unknown`). It is the title's slot only for `Viewed::Own`, which means a raw view or a non-buffer resource. `host_resource` is `Some` only for textures, so a structured or typed buffer view always gets an alias. A raw annotation never lands over a structured view here. - **The follow-up (your item 3).** The unindexed forms still use `handle(.., (11 | u, 0))` over the title's slot: the `None =>` arms of the buffer load, store and atomic, and `s_buffer_load`. Sending them through `stride_entry` with `byte = off + bias` would make them correct whatever view kind the title made. Picking a structured annotation from the recorded stride would not, because of the black-frame case above. - **Other slot writers.** Every path that writes a view into a host heap slot needs `note_view` or `forget_view`. Upstream that is only `make_at` and `mirror`, and both are covered. A stack that adds another writer without the call leaves the entry at 0, so the read goes to the slot itself (raw over structured, zeros on NVIDIA). Worse, it can leave an entry naming a previous buffer's alias, and then the read returns that buffer's bytes with no warning. _AI-assisted review (Claude Code); checked on Windows 11 / RTX 5090._
Author
Owner

@⁠Bladureau on GitHub · 2026-11-24 21:00 UTC · original

Tested 1f3c184 on an RTX 4060 Laptop (8 GB, 32-lane waves), offline on the full shader archive and in the title. The capped (NVIDIA) heap path runs: the alias pool never ran out, and the debug layer found nothing new.

Setup: Windows 11 Pro 26300, NVIDIA GeForce RTX 4060 Laptop GPU 8 GB (driver 617.14), i7-13650HX, 32 GB, title 1.0.2.1 (exe BLAKE3 b99f876b74d4a77f…), dxil.dll from Windows SDK 10.0.26100.

Offline: victory translate --list --validate, main ffe310e vs main + this PR

main + this PR
a structured buffer of unknown stride 148 0
VS/PS emitted / validated 12,243 / 12,167 12,245 / 12,169
Compute emitted / validated 1,441 / 1,417 1,477 / 1,453
Mesh emitted / validated 8,214 / 8,152 8,215 / 8,153

All 39 newly emitted programs pass validation. The other 109 now stop at the next unsupported form: a descriptor read only as data +82, lane-mask reads +25, a lane-mask join of an untracked mask +2.

In the title: main + #578 + #334 + this PR, all merged cleanly

This is a diag build with VICTORY_D3D12_DEBUG=1 and VICTORY_D3D12_DRED=1. #578 is there so the world does not hang on this card. This PR conflicts with #1548 in HostHeap::new (both change the capped split), so #1548 is not in. On this card the heap is capped, so the run used the capped split: 868,928 title slots, 65,536 dynamic slots and 65,536 alias slots.

  • 15 minutes in the world without a device removal. The title kept running past the opening cutscene, and its dialogue went on, but the picture is still black.
  • no free raw view slots never fired. The 65,536 alias slots were enough here.
  • a buffer view off the dwords of its host copy has no raw view fired (logged once), so some views read through the null alias.
  • Debug layer: only id 599 (×2, a texture format with ALLOW_UNORDERED_ACCESS, in every run on main too). No errors about the raw views or their slots.
  • No no dynamic slots drops with 65,536 dynamic slots, but #578 refuses many draws here, so this says little about the dynamic pool.
  • Unknown-stride programs in the title: 64 of them failed to translate in my earlier runs. In this run, 8 were translated and bound, 42 now fail later (31 of them on a descriptor read only as data), and the other 14 did not come up.
  • Last frame report: 2.3 fps, 241 draws/frame, 1,269 dropped without a host pipeline, and 2,562 indirect executions dropped.
**@⁠Bladureau** on GitHub · 2026-11-24 21:00 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7144355555) Tested `1f3c184` on an **RTX 4060 Laptop (8 GB, 32-lane waves)**, offline on the full shader archive and in the title. **The capped (NVIDIA) heap path runs**: the alias pool never ran out, and the debug layer found nothing new. **Setup:** Windows 11 Pro 26300, NVIDIA GeForce RTX 4060 Laptop GPU 8 GB (driver 617.14), i7-13650HX, 32 GB, title 1.0.2.1 (exe BLAKE3 `b99f876b74d4a77f…`), dxil.dll from Windows SDK 10.0.26100. ### Offline: `victory translate --list --validate`, `main` `ffe310e` vs `main` + this PR | | `main` | + this PR | |---|---|---| | `a structured buffer of unknown stride` | 148 | **0** | | VS/PS emitted / validated | 12,243 / 12,167 | 12,245 / 12,169 | | Compute emitted / validated | 1,441 / 1,417 | **1,477 / 1,453** | | Mesh emitted / validated | 8,214 / 8,152 | 8,215 / 8,153 | All 39 newly emitted programs pass validation. The other 109 now stop at the next unsupported form: `a descriptor read only as data` +82, lane-mask reads +25, `a lane-mask join of an untracked mask` +2. ### In the title: `main` + #578 + #334 + this PR, all merged cleanly This is a diag build with `VICTORY_D3D12_DEBUG=1` and `VICTORY_D3D12_DRED=1`. #578 is there so the world does not hang on this card. This PR conflicts with #1548 in `HostHeap::new` (both change the capped split), so #1548 is not in. On this card the heap is capped, so the run used the capped split: 868,928 title slots, 65,536 dynamic slots and 65,536 alias slots. - **15 minutes in the world without a device removal.** The title kept running past the opening cutscene, and its dialogue went on, but the picture is still black. - **`no free raw view slots` never fired.** The 65,536 alias slots were enough here. - **`a buffer view off the dwords of its host copy has no raw view` fired** (logged once), so some views read through the null alias. - **Debug layer:** only id 599 (×2, a texture format with `ALLOW_UNORDERED_ACCESS`, in every run on `main` too). No errors about the raw views or their slots. - **No `no dynamic slots` drops** with 65,536 dynamic slots, but #578 refuses many draws here, so this says little about the dynamic pool. - **Unknown-stride programs in the title:** 64 of them failed to translate in my earlier runs. In this run, 8 were translated and bound, 42 now fail later (31 of them on `a descriptor read only as data`), and the other 14 did not come up. - **Last frame report:** 2.3 fps, 241 draws/frame, 1,269 dropped without a host pipeline, and 2,562 indirect executions dropped.
Author
Owner

@⁠alessiodeia on GitHub · 2026-11-24 21:04 UTC · original

In-game A/B of 1f3c184 on top of #439, on an RTX 2070 SUPER (Turing, 32..32), driver 621.40, Windows 11.

Both runs use the same tree with and without this PR: main ffe310e + #439 bf0f951 + #979's two commits + #1130 + #1065 + #493 #587 #282 #876 #67 #490 #464 #984 + fix/unaligned-buffer-srv. Diag build, Series X, DRED, 30 minutes each. A regression means a program that translated in the reference run and is unusable in the new one.

without #704 with #704
device removed / refused pipelines 0 / 0 0 / 0
unusable programs 263 213
programs recovered / regressions – 54 / 0
median draws dropped without a pipeline, per frame 3138 2457

Offline, on the 61 programs the reference run refused for a structured buffer of unknown stride: 54 emit and validate with dxil.dll. The other 7 now stop at a lane mask read as data.

Merging onto #439 needed three test-only initializer fixes in places this PR doesn't touch: #984's valu_tests HostShader needs stride_table; the lower::Parts in the stride_table test in emit/mod.rs and raw_view_tests.rs's emit(..) call need #439's target / console_cf / per_lane_only. cargo test -p victory-shader 168 passed and -p victory-gpu 65 passed on the GPU; workspace clippy is clean.

No game data attached. AI-assisted (Claude Code).

**@⁠alessiodeia** on GitHub · 2026-11-24 21:04 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7144429754) **In-game A/B of `1f3c184` on top of #439, on an RTX 2070 SUPER (Turing, 32..32), driver 621.40, Windows 11.** Both runs use the same tree with and without this PR: `main` `ffe310e` + #439 `bf0f951` + #979's two commits + #1130 + #1065 + #493 #587 #282 #876 #67 #490 #464 #984 + `fix/unaligned-buffer-srv`. Diag build, Series X, DRED, 30 minutes each. A regression means a program that translated in the reference run and is unusable in the new one. | | without #704 | with #704 | |---|---|---| | device removed / refused pipelines | 0 / 0 | 0 / 0 | | unusable programs | 263 | **213** | | programs recovered / regressions | – | **54 / 0** | | median draws dropped without a pipeline, per frame | 3138 | **2457** | Offline, on the 61 programs the reference run refused for `a structured buffer of unknown stride`: 54 emit and validate with `dxil.dll`. The other 7 now stop at `a lane mask read as data`. Merging onto #439 needed three test-only initializer fixes in places this PR doesn't touch: #984's `valu_tests` `HostShader` needs `stride_table`; the `lower::Parts` in the `stride_table` test in `emit/mod.rs` and `raw_view_tests.rs`'s `emit(..)` call need #439's `target` / `console_cf` / `per_lane_only`. `cargo test -p victory-shader` 168 passed and `-p victory-gpu` 65 passed on the GPU; workspace clippy is clean. No game data attached. AI-assisted (Claude Code).
Author
Owner

@⁠Proudnoob4 on GitHub · 2026-11-24 22:05 UTC · original

Correction and disclosure for my three comments above (1, 2, 3)

They end with "AI-assisted (Claude Code)", but HY4 Flash (hy4-flash-free) wrote and posted all three. OpenCode ran it after my Claude Code session hit its usage limit. I have now rechecked them with Claude Code against the original files.

  • The corpus numbers are confirmed:

    • unknown stride 148 → 0;
    • 21,724 → 21,763 validated, +39, 0 lost;
    • descriptor-as-data +82, lane mask +18.

    As comment 2 already said, these are #704's own gains.

  • The cost table in comment 3 measures the wrong thing. Its MB/frame and ms/frame figures are the sum of the 10 largest copy sources in the final copystat block, not totals. In that same block the total refresh volume hardly moves. The follow-up's cost is in the watch/unmap path. Per frame, from the same block:

base (#206 + #493) + gpu/run-time-indexed-views combined
refresh volume 6,902 MB 7,048 MB 7,405 MB
watches 1,327 46,744 46,660
memory checked 7.6 GB 26.5 GB 25.9 GB
unmapped 189 MB 5,257 MB 4,731 MB
page faults 31,828 105,728 107,452
fallbacks 799 15,103 13,753
watch time 82 ms 255 ms 248 ms
move time 5.5 ms 120 ms 151 ms

The follow-up and combined runs had translate processes competing for the CPU, so treat their times as upper bounds. The counts are not affected by that.

  • The "combined" row did not include #878. #878 was never merged into that build, so the row is #876 + #728 + the follow-up.
  • Confirmed:
    • frame progress: base, +#878 and +#876 reach 3000, the follow-up reaches 1500, combined reaches 2048;
    • the largest single source: 0x35900000+0xae00000, 3,192.91 MB/frame;
    • no device removal in any run.

This correction: Claude Code (Claude Opus 5.5); every figure was recomputed from the original files on my machine.

**@⁠Proudnoob4** on GitHub · 2026-11-24 22:05 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7145780017) **Correction and disclosure for my three comments above** ([1](https://git.gtahub.st/github/Marvisak--VIctory/pulls/704), [2](https://git.gtahub.st/github/Marvisak--VIctory/pulls/704), [3](https://git.gtahub.st/github/Marvisak--VIctory/pulls/704)) They end with "AI-assisted (Claude Code)", but HY4 Flash (`hy4-flash-free`) wrote and posted all three. OpenCode ran it after my Claude Code session hit its usage limit. I have now rechecked them with Claude Code against the original files. - **The corpus numbers are confirmed:** - unknown stride 148 → 0; - 21,724 → 21,763 validated, +39, 0 lost; - descriptor-as-data +82, lane mask +18. As comment 2 already said, these are #704's own gains. - **The cost table in comment 3 measures the wrong thing.** Its MB/frame and ms/frame figures are the sum of the 10 largest copy sources in the final copystat block, not totals. In that same block the total refresh volume hardly moves. The follow-up's cost is in the watch/unmap path. Per frame, from the same block: | | base (#206 + #493) | + `gpu/run-time-indexed-views` | combined | |---|---:|---:|---:| | refresh volume | 6,902 MB | 7,048 MB | 7,405 MB | | watches | 1,327 | 46,744 | 46,660 | | memory checked | 7.6 GB | 26.5 GB | 25.9 GB | | unmapped | 189 MB | 5,257 MB | 4,731 MB | | page faults | 31,828 | 105,728 | 107,452 | | fallbacks | 799 | 15,103 | 13,753 | | watch time | 82 ms | 255 ms | 248 ms | | move time | 5.5 ms | 120 ms | 151 ms | The follow-up and combined runs had translate processes competing for the CPU, so treat their times as upper bounds. The counts are not affected by that. - **The "combined" row did not include #878.** #878 was never merged into that build, so the row is #876 + #728 + the follow-up. - **Confirmed:** - frame progress: base, +#878 and +#876 reach 3000, the follow-up reaches 1500, combined reaches 2048; - the largest single source: `0x35900000+0xae00000`, 3,192.91 MB/frame; - no device removal in any run. *This correction: Claude Code (Claude Opus 5.5); every figure was recomputed from the original files on my machine.*
Author
Owner

@⁠PigBun-AI on GitHub · 2026-11-24 22:21 UTC · original

@⁠r4tedx, here are the raw rows you asked for in item 3: https://gist.github.com/PigBun-AI/6d0fb698dd5dfb3d62c83b4dbc723533. Start with README.md. On the RTX 5090, a raw declaration with no index (buffer_load ... offen) over a structured SRV view reads wrong at strides 8, 12, 16, 24, 32, 48 and 64 and right at 4, 20 and 2044 (stride 16 stays wrong with the buffer in a default heap, with a view starting at element 4, and with a view shorter than the buffer); with a raw view every stride reads right. Controls (WARP, Radeon iGPU) are in the gist. These are synthetic probes, one run per case, one machine (driver version not recorded). We have not yet tested scalar s_buffer_load of a structured SRV, the other form you named; we will add that to the gist when we have it. AI-assisted comment (PigBun-AI).

**@⁠PigBun-AI** on GitHub · 2026-11-24 22:21 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7146136946) @⁠r4tedx, here are the raw rows you asked for in item 3: https://gist.github.com/PigBun-AI/6d0fb698dd5dfb3d62c83b4dbc723533. Start with README.md. On the RTX 5090, a raw declaration with no index (buffer_load ... offen) over a structured SRV view reads wrong at strides 8, 12, 16, 24, 32, 48 and 64 and right at 4, 20 and 2044 (stride 16 stays wrong with the buffer in a default heap, with a view starting at element 4, and with a view shorter than the buffer); with a raw view every stride reads right. Controls (WARP, Radeon iGPU) are in the gist. These are synthetic probes, one run per case, one machine (driver version not recorded). We have not yet tested scalar s_buffer_load of a structured SRV, the other form you named; we will add that to the gist when we have it. AI-assisted comment (PigBun-AI).
Author
Owner

@⁠PigBun-AI on GitHub · 2026-11-24 22:34 UTC · original

@⁠r4tedx, follow-up: we added the scalar form to the gist (table-5090-scalar-smem.csv and scalar-smem-addendum.md). On the RTX 5090, a scalar s_buffer_load (immediate offset, x4, and SGPR-offset forms) with a raw declaration over a structured SRV view reads wrong at the same strides as the unindexed buffer_load: 8, 12, 16, 24, 32, 48, 64, and right at 4, 20, 2044, with the same apparent multipliers; with a raw view every case is right; Radeon iGPU and WARP controls are right everywhere. Synthetic probes, one run, one machine; we have not tested unaligned or loop-computed offsets. AI-assisted comment (PigBun-AI).

**@⁠PigBun-AI** on GitHub · 2026-11-24 22:34 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7146391344) @⁠r4tedx, follow-up: we added the scalar form to the gist (table-5090-scalar-smem.csv and scalar-smem-addendum.md). On the RTX 5090, a scalar s_buffer_load (immediate offset, x4, and SGPR-offset forms) with a raw declaration over a structured SRV view reads wrong at the same strides as the unindexed buffer_load: 8, 12, 16, 24, 32, 48, 64, and right at 4, 20, 2044, with the same apparent multipliers; with a raw view every case is right; Radeon iGPU and WARP controls are right everywhere. Synthetic probes, one run, one machine; we have not tested unaligned or loop-computed offsets. AI-assisted comment (PigBun-AI).
Author
Owner

@⁠MrEjecutor on GitHub · 2026-11-24 22:48 UTC · original

RTX 5060 Ti (32-lane waves), offline over the retail shaders at 1f3c184: every "structured buffer of unknown stride" refusal is gone, nothing that worked is lost; the instance culling now validates

victory translate <game dir> --validate --pipelines --list, this PR at 1f3c184 against main ffe310e, release builds, RTX 5060 Ti (driver 621.24), Windows 11 26200, Rust 1.100. "Working" means translated, validated, and the host pipeline created on this card.

main this PR
refusals a structured buffer of unknown stride 149 0
vertex + pixel validated 12,167 12,169
compute validated 1,417 1,453
compute with a working host pipeline 1,121 1,136 (+15, 0 lost)
mesh validated 8,152 8,153

Per program, no compute program that had a working pipeline on main loses it; the 15 gained were all refused before with a structured buffer of unknown stride.

InstanceCulling (the CS_Prop_, CS_Tree_, CS_Grass_, CS_Slod_, CS_Simple_ BatchCull* / BatchNoCull programs, 30 in all): none validated on main; with this PR 28 validate, 13 get a pipeline on this card, and 15 are refused at pipeline creation with The parameter is incorrect. That is the error 64-lane programs get on 32-lane hosts (#578, #189), so they are probably those, but I have not checked their wave size. Over the archive, compute programs refused at pipeline creation go from 320 to 341. If so, on NVIDIA part of what this PR unlocks also needs the wave64 work.

Not tested: the title with this PR (on this card main alone hangs in the world, #747); whether the culling output is right; AMD.

AI use: Claude Code (Claude Opus 5.5) built, measured and wrote this; checked by mrejecutor.

**@⁠MrEjecutor** on GitHub · 2026-11-24 22:48 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7146672718) **RTX 5060 Ti (32-lane waves), offline over the retail shaders at `1f3c184`: every "structured buffer of unknown stride" refusal is gone, nothing that worked is lost; the instance culling now validates** `victory translate <game dir> --validate --pipelines --list`, this PR at `1f3c184` against `main` `ffe310e`, release builds, RTX 5060 Ti (driver 621.24), Windows 11 26200, Rust 1.100. "Working" means translated, validated, and the host pipeline created on this card. | | `main` | this PR | |---|---|---| | refusals `a structured buffer of unknown stride` | 149 | 0 | | vertex + pixel validated | 12,167 | 12,169 | | compute validated | 1,417 | 1,453 | | compute with a working host pipeline | 1,121 | 1,136 (+15, 0 lost) | | mesh validated | 8,152 | 8,153 | Per program, no compute program that had a working pipeline on `main` loses it; the 15 gained were all refused before with `a structured buffer of unknown stride`. `InstanceCulling` (the `CS_Prop_`, `CS_Tree_`, `CS_Grass_`, `CS_Slod_`, `CS_Simple_` `BatchCull*` / `BatchNoCull` programs, 30 in all): none validated on `main`; with this PR 28 validate, 13 get a pipeline on this card, and 15 are refused at pipeline creation with `The parameter is incorrect`. That is the error 64-lane programs get on 32-lane hosts (#578, #189), so they are probably those, but I have not checked their wave size. Over the archive, compute programs refused at pipeline creation go from 320 to 341. If so, on NVIDIA part of what this PR unlocks also needs the wave64 work. **Not tested:** the title with this PR (on this card `main` alone hangs in the world, #747); whether the culling output is right; AMD. **AI use:** Claude Code (Claude Opus 5.5) built, measured and wrote this; checked by mrejecutor.
Author
Owner

@⁠PigBun-AI on GitHub · 2026-11-24 23:43 UTC · original

@⁠r4tedx, one more data set added to the gist (table-5090-more-strides.csv and more-strides-addendum.md): the same raw-declared / structured-view probe at strides 28, 44, 76, 100, 772 and 1580 on the RTX 5090. These read right, like strides 4, 20 and 2044; strides 8, 12, 16, 24, 32, 36, 40, 48 and 64 read wrong, all five read forms (scalar immediate / x4 / SGPR offset, MUBUF with and without index) agree, and a raw view is right everywhere. So the unindexed/scalar fix may only need to touch the strides that read wrong, though we only tested the listed strides. Synthetic probes, one run, one machine; Radeon iGPU and WARP controls are right everywhere. AI-assisted comment (PigBun-AI).

**@⁠PigBun-AI** on GitHub · 2026-11-24 23:43 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7147732715) @⁠r4tedx, one more data set added to the gist (table-5090-more-strides.csv and more-strides-addendum.md): the same raw-declared / structured-view probe at strides 28, 44, 76, 100, 772 and 1580 on the RTX 5090. These read right, like strides 4, 20 and 2044; strides 8, 12, 16, 24, 32, 36, 40, 48 and 64 read wrong, all five read forms (scalar immediate / x4 / SGPR offset, MUBUF with and without index) agree, and a raw view is right everywhere. So the unindexed/scalar fix may only need to touch the strides that read wrong, though we only tested the listed strides. Synthetic probes, one run, one machine; Radeon iGPU and WARP controls are right everywhere. AI-assisted comment (PigBun-AI).
Author
Owner

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

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

Unknown-stride buffers are read through a host stride table in main (emit::VIEW_STRIDES, root SRV t255, HostHeap strides; commit 0b35b7fe); this 1,921-line stack on #193 does the same another way.

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

**@⁠Marvisak** on GitHub · 2026-11-25 00:27 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7148535577) Automated triage for the maintainers. Closing because this change is already in `main`, or `main` has since replaced the code it patches. Unknown-stride buffers are read through a host stride table in main (emit::VIEW_STRIDES, root SRV t255, HostHeap strides; commit 0b35b7fe); this 1,921-line stack on #193 does the same another way. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.
Author
Owner

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

Automated triage for the maintainers.

Needs rebase. This PR does not merge cleanly into current main (ac2525d). Conflicting files: crates/victory-gpu/src/descriptor/host.rs, crates/victory-gpu/src/draw.rs, crates/victory-gpu/src/pipeline/host.rs, crates/victory-gpu/src/shader_cache.rs, crates/victory-shader/src/emit/host.rs, crates/victory-shader/src/emit/lower.rs, crates/victory-shader/src/emit/mod.rs, crates/victory-shader/src/emit/shader.rs and 2 more.

The content has not been reviewed yet; it will be once the branch is rebased onto main.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 00:28 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7148540450) <!-- victory-triage v1 head=1f3c184a36f2b201a52ee55ca52fe570de1441ad verdict=needs-rebase at=2026-11-25T00:13:20Z --> Automated triage for the maintainers. **Needs rebase.** This PR does not merge cleanly into current `main` (ac2525d). Conflicting files: `crates/victory-gpu/src/descriptor/host.rs`, `crates/victory-gpu/src/draw.rs`, `crates/victory-gpu/src/pipeline/host.rs`, `crates/victory-gpu/src/shader_cache.rs`, `crates/victory-shader/src/emit/host.rs`, `crates/victory-shader/src/emit/lower.rs`, `crates/victory-shader/src/emit/mod.rs`, `crates/victory-shader/src/emit/shader.rs` and 2 more. The content has not been reviewed yet; it will be once the branch is rebased onto `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

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

Thanks for the triage. main does now have a stride table for unknown-stride buffers (0b35b7f, VIEW_STRIDES). But it reads them the way #193 did, which is the part this PR exists to fix: index * stride + offset through a raw (ByteAddressBuffer) handle on the slot, where make puts the title's structured or typed view. On NVIDIA a raw handle over a structured view doesn't read the bytes asked for.

main's own test shows it. emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride at 940d32f binds a structured view of 12-byte elements and expects dword 1 of each, 200 + lane. On an RTX 5070 (Windows 11, native D3D12, default adapter) it fails:

assertion `left == right` failed: hardware
  left: [101, 104, 107, 110, 113, 116, 119, 122, 125, 128, 131, 0, 0, …, 0]
 right: [200, 201, 202, …, 231]

Byte B reads as byte B × 3, then past the view's end it reads 0. That's the same pattern as this PR's table ("structured, 12: expected 107, RTX 5070 121") and what testers reported here on an RTX 3080 (justlovett0: "without [the raw alias views] the ByteAddressBuffer reads return 0 against structured host views"), an RTX 5090 (PigBun-AI's gist: strides 8, 12, 16, 24, 32, 48 and 64 wrong, 4, 20 and 2044 right) and a 4070 Ti. WARP and AMD read the bytes asked for, which is why the test passes there.

What this PR adds on top of a stride table is the fix: a raw view of the same bytes for every structured or typed buffer view, with the read going through that view, so the handle's kind matches the view it resolves to. I'm happy to redo it on current main as a small change to main's table, since most of this branch's stride-table machinery is now redundant: the raw alias slot and bias in the table entry, the read through it, and main's own test as the regression. Would you rather have that here (reopened) or as a new PR?

The title was not used for this check; it's main's own synthetic test, run once on the hardware adapter.

AI-assisted (Claude Code).

**@⁠r4tedx** on GitHub · 2026-11-25 04:10 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7152593819) Thanks for the triage. `main` does now have a stride table for unknown-stride buffers (`0b35b7f`, `VIEW_STRIDES`). But it reads them the way #193 did, which is the part this PR exists to fix: `index * stride + offset` through a raw (`ByteAddressBuffer`) handle on the slot, where `make` puts the title's structured or typed view. On NVIDIA a raw handle over a structured view doesn't read the bytes asked for. `main`'s own test shows it. `emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride` at `940d32f` binds a structured view of 12-byte elements and expects dword 1 of each, `200 + lane`. On an RTX 5070 (Windows 11, native D3D12, default adapter) it fails: ``` assertion `left == right` failed: hardware left: [101, 104, 107, 110, 113, 116, 119, 122, 125, 128, 131, 0, 0, …, 0] right: [200, 201, 202, …, 231] ``` Byte B reads as byte B × 3, then past the view's end it reads 0. That's the same pattern as this PR's table ("structured, 12: expected 107, RTX 5070 121") and what testers reported here on an RTX 3080 (justlovett0: "without [the raw alias views] the ByteAddressBuffer reads return 0 against structured host views"), an RTX 5090 (PigBun-AI's gist: strides 8, 12, 16, 24, 32, 48 and 64 wrong, 4, 20 and 2044 right) and a 4070 Ti. WARP and AMD read the bytes asked for, which is why the test passes there. What this PR adds on top of a stride table is the fix: a raw view of the same bytes for every structured or typed buffer view, with the read going through that view, so the handle's kind matches the view it resolves to. I'm happy to redo it on current `main` as a small change to `main`'s table, since most of this branch's stride-table machinery is now redundant: the raw alias slot and bias in the table entry, the read through it, and `main`'s own test as the regression. Would you rather have that here (reopened) or as a new PR? The title was not used for this check; it's `main`'s own synthetic test, run once on the hardware adapter. AI-assisted (Claude Code).
Author
Owner

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

Follow-up: the structured-view half of this is now in #1762 (structured buffer views made raw on the host), on current main. The typed-view half is offered there.

AI-assisted (Claude Code).

**@⁠r4tedx** on GitHub · 2026-11-25 04:21 UTC · [original](https://github.com/Marvisak/VIctory/pull/704#issuecomment-7152775775) Follow-up: the structured-view half of this is now in #1762 (structured buffer views made raw on the host), on current `main`. The typed-view half is offered there. AI-assisted (Claude Code).

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