Skip to content

GPU: on NVIDIA, structured buffer views are made raw (port of upstream #2464, FIND-11) - #15

Merged
MagiccConch merged 1 commit into
mainfrom
raw-structured-srv
Nov 25, 2026
Merged

MagiccConch merged 1 commit into
mainfrom
raw-structured-srv

Conversation

@MagiccConch

Copy link
Copy Markdown
Owner

Port of upstream PR Marvisak#2464 (claude-GTA6, AI-assisted there; design from fxceless/victory-fork's raw_window) into the fork. This is FIND-11 / upstream Marvisak#1744 — one of the two NVIDIA root causes in the 5-test failure family.

The bug. A scalar or offset-only buffer read is translated as rawBufferLoad at a byte offset through a raw handle. When the heap slot holds the title's structured view, that combination is undefined in D3D12, and NVIDIA takes the byte offset as the element: byte b reads element b/4 at the view's own stride. GTA VI hits this in WindNew:CS_CopyLatestWindFieldForRenderingWithSmooth, which reads its loop counts that way from t71 — the counts came out as other records' data and the loops ran until Windows reset the device (an opening-credits device hang on NVIDIA wave32 cards).

The change (host side only; shaders and DXIL unchanged):

  • descriptor/host.rs buffer_srv: on an NVIDIA host, a structured SRV becomes a raw view (R32_TYPELESS + RAW) over the same bytes when they start on 16 bytes and whole dwords; otherwise it stays structured and logs once. VICTORY_RAW_STRUCTURED=0/1 overrides the vendor check.
  • host.rs host_vendor(): reads the host device's adapter vendor once, by LUID.

Reads by element keep their structured handle, which NVIDIA and WARP read right on a raw view; AMD reads element 0 there, so other vendors are untouched. Upstream's PR verified a ~9-minute game run into the prologue with no device removal on NVIDIA, with 0 pipelines refused for compiler memory (the shader-side "both ways" variant had made 569 pipelines refuse with E_OUTOFMEMORY — which is why this is host-only).

Fork relevance: directly de-risks the RTX 5080 run-10 world/credits path. No pre-build re-run needed — the shader cache and pipeline library are untouched; a rebuild of victory picks it up.

Local signal: cargo check + clippy -p victory-gpu --all-features --all-targets --target x86_64-pc-windows-gnu clean. Real test signal on CI windows-latest.

Attribution: upstream PR Marvisak#2464 by claude-GTA6 (Claude Code, their session), design from fxceless/victory-fork; root-cause numbers by kappalegoat and marquezinii in upstream Marvisak#1744.

🤖 This PR was ported by an AI agent (OpenHands) on behalf of the fork maintainer.

Port of upstream PR Marvisak#2464 (claude-GTA6, AI-assisted, design from
fxceless/victory-fork's raw_window). FIND-11 / upstream Marvisak#1744: a scalar
or offset-only buffer read is translated as a rawBufferLoad at a byte
offset; when the slot holds the title's structured view, D3D12 leaves
that read undefined and NVIDIA took the byte offset as the element,
so WindNew's loop counts came from other records' data and its loops
ran until the device was reset (opening-credits hang on NVIDIA).

buffer_srv: on an NVIDIA host a structured SRV becomes a raw view
(R32_TYPELESS + RAW) over the same bytes when they start on 16 bytes;
otherwise it stays structured and logs once. VICTORY_RAW_STRUCTURED
overrides the vendor check. host_vendor() reads the adapter vendor
once by LUID.

Shaders are unchanged: reads by element keep their structured handle,
which NVIDIA and WARP read right on a raw view (AMD reads element 0,
so other hosts are unchanged). No shader-cache or pipeline-library
rebuild is needed.

Co-authored-by: openhands <openhands@all-hands.dev>
@MagiccConch
MagiccConch marked this pull request as ready for review November 25, 2026 17:36
@MagiccConch
MagiccConch merged commit eb7e643 into main Nov 25, 2026
1 check passed
MagiccConch pushed a commit that referenced this pull request Nov 25, 2026
…tudy

Co-authored-by: openhands <openhands@all-hands.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants