Shaders: a descriptor dword needed as another s_load's address stops translation (879 programs on 1.0.2.1) #798

Open
opened 2026-11-26 04:13:59 +00:00 by github-bot · 7 comments
Owner

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

A descriptor dword that the program also reads as a number is rebuilt from the host view's dimensions (descriptor_data) and stops there (a scalar memory read as data). The largest sub-case is not a dimension read at all: the dword is consumed as the address operand of another s_load_dword*, so what is needed is a memory address, and the descriptor-bit rebuild in that function has none for it.

879 programs of 25,322 on build 1.0.2.1, the largest remaining emit class on the whole pack; for comparison the 64-bit image atomic class was 653 before #539. All 879 are this shape — bucketing them by the fields of the consuming instruction gives 879 "used by an SMEM" and no other kind.

Repro, no game and no GPU:

victory translate <game>/shaders.rpf

The class is listed with an example; --list gives one line per program.

Examples (build 1.0.2.1, all mesh/vertex in the mirror-reflection family):

  • shaders.rpf@0x1000c65 MSNC_VS_MirrorReflectionPedTransformSkinD_907647ea_Wrapped at 0x5838 (offset within the program is from the same run; take it as a pointer, the programs differ per build)
  • shaders.rpf@0x1006b86 MS_VS_MirrorReflectionPedTransformDecalsD_db76baa6_Wrapped
  • shaders.rpf@0x100897b MSNC_VS_MirrorReflectionPedTransformSkinDecalsD_907647ea_Wrapped

The shape in descriptor_data: the site is an s_load_dword* from a table or heap; used_kind/the descriptor's Role::Resource entry resolves a using instruction whose Fields are Smem, i.e. the register is the base (plus a constant) or the soffset of a further scalar load, usually after s_mov/s_add copies. descriptor_data takes the Fields::Image and Fields::Buffer cases and the rest fall to the catch-all refusal.

Two ways this could go, and the reason I am filing rather than patching:

  • route the use to the address machinery instead of the bit rebuild when the consuming instruction is an smem load — but why_no_base then reports an address loaded from memory/an address in an SGPR that is no root parameter (268 programs between them today), so the two classes would trade rather than shrink;
  • or give the loaded dword the real device address of the view, which needs the address of a descriptor's target rather than its dimensions — larger, but it also feeds the 195/73 address classes above.

Per-build offsets and counts only, no assets. Written with AI assistance from my own runs.

**@⁠HrHd** on GitHub · 2026-11-24 11:08 UTC · [original](https://github.com/Marvisak/VIctory/issues/798) A descriptor dword that the program also reads as a number is rebuilt from the host view's dimensions (`descriptor_data`) and stops there (`a scalar memory read as data`). The largest sub-case is not a dimension read at all: the dword is consumed as the **address operand of another `s_load_dword*`**, so what is needed is a memory address, and the descriptor-bit rebuild in that function has none for it. 879 programs of 25,322 on build 1.0.2.1, the largest remaining emit class on the whole pack; for comparison the 64-bit image atomic class was 653 before #539. All 879 are this shape — bucketing them by the fields of the consuming instruction gives 879 "used by an SMEM" and no other kind. Repro, no game and no GPU: ``` victory translate <game>/shaders.rpf ``` The class is listed with an example; `--list` gives one line per program. Examples (build 1.0.2.1, all mesh/vertex in the mirror-reflection family): - `shaders.rpf@0x1000c65 MSNC_VS_MirrorReflectionPedTransformSkinD_907647ea_Wrapped` at `0x5838` (offset within the program is from the same run; take it as a pointer, the programs differ per build) - `shaders.rpf@0x1006b86 MS_VS_MirrorReflectionPedTransformDecalsD_db76baa6_Wrapped` - `shaders.rpf@0x100897b MSNC_VS_MirrorReflectionPedTransformSkinDecalsD_907647ea_Wrapped` The shape in `descriptor_data`: the site is an `s_load_dword*` from a table or heap; `used_kind`/the descriptor's `Role::Resource` entry resolves a *using* instruction whose `Fields` are `Smem`, i.e. the register is the base (plus a constant) or the soffset of a further scalar load, usually after `s_mov`/`s_add` copies. `descriptor_data` takes the `Fields::Image` and `Fields::Buffer` cases and the rest fall to the catch-all refusal. Two ways this could go, and the reason I am filing rather than patching: - route the use to the address machinery instead of the bit rebuild when the consuming instruction is an smem load — but `why_no_base` then reports `an address loaded from memory`/`an address in an SGPR that is no root parameter` (268 programs between them today), so the two classes would trade rather than shrink; - or give the loaded dword the real device address of the view, which needs the address of a descriptor's target rather than its dimensions — larger, but it also feeds the 195/73 address classes above. Per-build offsets and counts only, no assets. Written with AI assistance from my own runs.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:13:59 +00:00
Author
Owner

@⁠MartinIndra02 on GitHub · 2026-11-24 12:54 UTC · original

Found why descriptor_data was falling through to a scalar memory read as data for Fields::Smem:

In crates/victory-shader/src/emit/lower.rs, descriptor_data matched only Fields::Image and Fields::Buffer on the using instruction ui, missing Fields::Smem for s_buffer_load* (which is a buffer load using a V# descriptor, just like Fields::Buffer).

Handling Fields::Smem { .. } if un.starts_with("s_buffer_load") as a raw buffer ((11 | u, 0), still refusing ResourceType::Cbv) resolves 100% of a scalar memory read as data and immediately unlocks +231 emitted shaders (the subset that reads V# dword 2 num_records), while accurately routing the remaining subset that reads dword 0/1 (base address / format) to a descriptor's address or format read as data:

Full-corpus A/B (victory translate on retail 1.0.2.1, 26,084 programs, release build)

Metric main (ffe310e) fix/shader-smem-descriptor-data (c42cbb0) Delta
Vertex & Pixel emitted 12,231 / 14,027 12,288 / 14,027 +57
Compute emitted 1,441 / 2,582 1,449 / 2,582 +8
Mesh emitted 8,214 / 8,713 8,380 / 8,713 +166
Total emitted 21,886 22,117 +231
a scalar memory read as data 771 0 -771
a descriptor's address or format read as data 92 589 +497

Verification (Windows 11, RTX 3080 621.24, Rust 1.98.1)

  • New unit test emit::lower::tests::s_buffer_load_descriptor_size_reads_as_data (checks both ResourceType::Srv lowering and ResourceType::Cbv refusal).
  • cargo test -p victory-shader --lib -- --test-threads=1: 121 passed, 0 failed, 1 ignored
  • cargo clippy -p victory-shader --all-targets -- -D warnings (default + --features diagnostics): 0 warnings
  • cargo xtask policy: 154 files ok

Ready to open as a PR whenever PRs reopen.

Aggregate counts only; no game data posted. AI-assisted; all builds and tests executed on my machine.

**@⁠MartinIndra02** on GitHub · 2026-11-24 12:54 UTC · [original](https://github.com/Marvisak/VIctory/issues/798#issuecomment-7132091224) Found why `descriptor_data` was falling through to `a scalar memory read as data` for `Fields::Smem`: In `crates/victory-shader/src/emit/lower.rs`, `descriptor_data` matched only `Fields::Image` and `Fields::Buffer` on the using instruction `ui`, missing `Fields::Smem` for `s_buffer_load*` (which is a buffer load using a `V#` descriptor, just like `Fields::Buffer`). Handling `Fields::Smem { .. } if un.starts_with("s_buffer_load")` as a raw buffer (`(11 | u, 0)`, still refusing `ResourceType::Cbv`) resolves **100% of `a scalar memory read as data`** and immediately unlocks **+231 emitted shaders** (the subset that reads `V#` dword 2 `num_records`), while accurately routing the remaining subset that reads `dword 0/1` (base address / format) to `a descriptor's address or format read as data`: - **Branch (based on `main` `ffe310e`):** https://github.com/MartinIndra02/VIctory/tree/fix/shader-smem-descriptor-data (commit `c42cbb0`) ### Full-corpus A/B (`victory translate` on retail 1.0.2.1, 26,084 programs, release build) | Metric | `main` (`ffe310e`) | `fix/shader-smem-descriptor-data` (`c42cbb0`) | Delta | |---|---:|---:|---:| | Vertex & Pixel emitted | `12,231 / 14,027` | **`12,288 / 14,027`** | **`+57`** | | Compute emitted | `1,441 / 2,582` | **`1,449 / 2,582`** | **`+8`** | | Mesh emitted | `8,214 / 8,713` | **`8,380 / 8,713`** | **`+166`** | | **Total emitted** | **`21,886`** | **`22,117`** | **`+231`** | | `a scalar memory read as data` | `771` | **`0`** | **`-771`** | | `a descriptor's address or format read as data` | `92` | `589` | `+497` | ### Verification (Windows 11, RTX 3080 `621.24`, Rust `1.98.1`) - New unit test `emit::lower::tests::s_buffer_load_descriptor_size_reads_as_data` (checks both `ResourceType::Srv` lowering and `ResourceType::Cbv` refusal). - `cargo test -p victory-shader --lib -- --test-threads=1`: **121 passed, 0 failed, 1 ignored** - `cargo clippy -p victory-shader --all-targets -- -D warnings` (default + `--features diagnostics`): **0 warnings** - `cargo xtask policy`: **154 files ok** Ready to open as a PR whenever PRs reopen. *Aggregate counts only; no game data posted. AI-assisted; all builds and tests executed on my machine.*
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-24 13:12 UTC · original

I ran a raw SRV readback on c42cbb0. The synthetic shader stores two dwords independently: s_buffer_load_dword from byte offset 20 and dword 2 of the same input descriptor.

With the same shader and the same payload at offset 20, the 32-byte view returned [86, 32] and the 48-byte view returned [86, 48]. Both the native Windows hardware adapter and software WARP matched. On ffe310e the same fixture stops in lowering with a scalar memory read as data.

Test-only commit on the candidate adds the two-size readback to the existing shader test harness. This exercises the raw SRV path with stride zero.

**@⁠fuzeofficlal** on GitHub · 2026-11-24 13:12 UTC · [original](https://github.com/Marvisak/VIctory/issues/798#issuecomment-7132508833) I ran a raw SRV readback on `c42cbb0`. The synthetic shader stores two dwords independently: `s_buffer_load_dword` from byte offset 20 and dword 2 of the same input descriptor. With the same shader and the same payload at offset 20, the 32-byte view returned `[86, 32]` and the 48-byte view returned `[86, 48]`. Both the native Windows hardware adapter and software WARP matched. On `ffe310e` the same fixture stops in lowering with `a scalar memory read as data`. [Test-only commit](https://github.com/fuzeofficlal/VIctory/commit/18144266347d8db2e7ab1d8d967d390871c8fe3f) on the candidate adds the two-size readback to the existing shader test harness. This exercises the raw SRV path with stride zero.
Author
Owner

@⁠HrHd on GitHub · 2026-11-24 13:57 UTC · original

Independent confirmation of c42cbb0 at corpus scale, on a different machine and card (RTX 4060 Ti, 1.0.2.1), with the branch merged into a stack that already carries the waterfall series, #704, #539, #180 and #621.

Offline translator over the whole pack (26,084 programs, no title, no GPU), before and after the arm:

class before after
a descriptor dword consumed by another s_load_dword* (the class this issue is about) 300 0
a descriptor's address or format read as data 92 1
emitted programs 23,794 24,094

So the split you predicted holds exactly: the num_records (dword 2) subset all emit, and only one program in the corpus still falls through to the address/format refusal. The Cbv refusal keeps the CBV-dword cases out of the raw-buffer path as intended — the unit test's second assertion exercises that and is the part worth keeping if the arm is ever narrowed.

Two things from the merge that may matter to you:

  • The arm has to sit after the Fields::Buffer arm and after whatever prefers image/vector-buffer uses over the s_buffer fallback. With #180 on top, the use-site lookup returns a preferred site and a fallback; the s_buffer arm only ever sees the fallback. Putting it first silently takes s_buffer for descriptors whose real use is a typed image.
  • un.starts_with("s_buffer_load") (yours) is broader than s_buffer_load_dword (what I had); the _dwordx2/x4 forms also route here and behave, so keep it broad.

The remaining 195/73 address-in-SGPR classes are untouched by this and still need the address provenance work; this issue's fix does not reach them.

**@⁠HrHd** on GitHub · 2026-11-24 13:57 UTC · [original](https://github.com/Marvisak/VIctory/issues/798#issuecomment-7133602191) Independent confirmation of `c42cbb0` at corpus scale, on a different machine and card (RTX 4060 Ti, 1.0.2.1), with the branch merged into a stack that already carries the waterfall series, #704, #539, #180 and #621. Offline translator over the whole pack (26,084 programs, no title, no GPU), before and after the arm: | class | before | after | |---|---|---| | a descriptor dword consumed by another `s_load_dword*` (the class this issue is about) | 300 | **0** | | a descriptor's address or format read as data | 92 | 1 | | emitted programs | 23,794 | 24,094 | So the split you predicted holds exactly: the `num_records` (dword 2) subset all emit, and only one program in the corpus still falls through to the address/format refusal. The `Cbv` refusal keeps the CBV-dword cases out of the raw-buffer path as intended — the unit test's second assertion exercises that and is the part worth keeping if the arm is ever narrowed. Two things from the merge that may matter to you: - The arm has to sit *after* the `Fields::Buffer` arm and after whatever prefers image/vector-buffer uses over the `s_buffer` fallback. With #180 on top, the use-site lookup returns a preferred site and a fallback; the `s_buffer` arm only ever sees the fallback. Putting it first silently takes `s_buffer` for descriptors whose real use is a typed image. - `un.starts_with("s_buffer_load")` (yours) is broader than `s_buffer_load_dword` (what I had); the `_dwordx2/x4` forms also route here and behave, so keep it broad. The remaining 195/73 address-in-SGPR classes are untouched by this and still need the address provenance work; this issue's fix does not reach them.
Author
Owner

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

Offline measurement (fork github.com/Machad3x/VIctory branch claude/gta6-shader-translation-crashes-705550, tip 9018be9) over 78 console shader containers dumped from an RTX 3080 Ti world run (victory translate --list --validate): MESH programs emitted 0 of 21 on the branch without these changes; 4 of 21 after cherry-picking MartinIndra02's c42cbb0 (PR #953: a descriptor whose only use is s_buffer_load is a raw buffer; 'a scalar memory read as data' 25 -> 0); 19 of 21 (18 validated) after one more change: when the console reuses a dead descriptor's SGPRs for loaded data, a join of that descriptor's address/format dword with a data edge no longer refuses the program (the join reads undefined on that edge, like the lane-mask join already does; commit 9018be9, assumption: the value is only read on paths from the data edge). One of the newly emitted mesh programs (mesh f841ad74ec6e7367) fails DXIL validation: "Container part 'Program Output Signature' does not match expected for module". Remaining mesh failures: structured buffer of unknown stride (2), descriptor read from the first lane of computed VGPRs (4 by group count), descriptor partly joined by control flow (1). In the game (4-minute runs, wave64 mesh allowed by a diagnostics switch) the world still shows only the background plus the loading artwork; one run ended with a title fault writing to a reserved never-committed address.

**@⁠Machad3x** on GitHub · 2026-11-24 14:48 UTC · [original](https://github.com/Marvisak/VIctory/issues/798#issuecomment-7134992233) Offline measurement (fork github.com/Machad3x/VIctory branch claude/gta6-shader-translation-crashes-705550, tip 9018be9) over 78 console shader containers dumped from an RTX 3080 Ti world run (victory translate --list --validate): MESH programs emitted 0 of 21 on the branch without these changes; 4 of 21 after cherry-picking MartinIndra02's c42cbb0 (PR #953: a descriptor whose only use is s_buffer_load is a raw buffer; 'a scalar memory read as data' 25 -> 0); 19 of 21 (18 validated) after one more change: when the console reuses a dead descriptor's SGPRs for loaded data, a join of that descriptor's address/format dword with a data edge no longer refuses the program (the join reads undefined on that edge, like the lane-mask join already does; commit 9018be9, assumption: the value is only read on paths from the data edge). One of the newly emitted mesh programs (mesh f841ad74ec6e7367) fails DXIL validation: "Container part 'Program Output Signature' does not match expected for module". Remaining mesh failures: structured buffer of unknown stride (2), descriptor read from the first lane of computed VGPRs (4 by group count), descriptor partly joined by control flow (1). In the game (4-minute runs, wave64 mesh allowed by a diagnostics switch) the world still shows only the background plus the loading artwork; one run ended with a title fault writing to a reserved never-committed address.
Author
Owner

@⁠rafaconvaitis on GitHub · 2026-11-24 17:28 UTC · original · edited 2026-11-24 17:37 UTC

I tried the descriptor-join change from @⁠Machad3x's 9018be9 on the two exact mesh-shader containers discussed in #293 and tested in #1269. The baseline is #1269 at 8c3092f plus #953 at c42cbb0. I applied the descriptor-join change locally and kept the existing SCC arm when resolving their overlap in fill_phis.

Runtime shader hash #1269 + #953 Same build + descriptor-join change
ef5409053e14aa82 descriptor address or format refusal DXIL validated, native mesh PSO created
235e56869c1ea883 descriptor address or format refusal DXIL validated, native mesh PSO created

Windows 11 build 26300, RTX 4070 explicitly selected, NVIDIA driver 32.0.16.1664, Microsoft DXIL validator 1.8.2502.8. Both PSOs use a generated pixel shader. No draw was submitted and the game was not started.

This confirms the two containers clear translation and native pipeline creation in this stack. The incoming edge rewritten as undefined still needs a correctness check before using this change in gameplay. A useful control would exercise both sides of the join and establish which edge can reach the read.

AI-assisted test harness and report.

Correctness follow-up

I added two source-only controls using a synthetic descriptor load, a join with replacement scalar data, and an LDS store. On the unguarded control, the selector for the descriptor arm reaches the store. The 9018be9 shortcut still emits a phi with an undef input on that arm; the phi feeds the value written to LDS, and Microsoft DXIL 1.8 accepts the module. The baseline without the shortcut refuses that control. The guarded control routes the descriptor arm past the store.

I also isolated the branch-threading portion of #48 on top of the same #1269 + #953 baseline, without the shortcut. On a synthetic variant with a constant flag, it proves the guarded edge and validates the emitted module, while the unguarded control remains refused. On the two real hash matches above, the pass found zero proven edges and both remained refused.

Using the dword classification from #1083 while keeping the #953 lowering, both real cases report a buffer descriptor's format or swizzle read as data (dword 3). This narrows the remaining work to that word. The runtime reachability of the descriptor edge in those two shaders is still unverified. No title or shader dispatch was run for these controls.

AI-assisted controls and analysis.

**@⁠rafaconvaitis** on GitHub · 2026-11-24 17:28 UTC · [original](https://github.com/Marvisak/VIctory/issues/798#issuecomment-7139257092) · edited 2026-11-24 17:37 UTC I tried the descriptor-join change from @⁠Machad3x's `9018be9` on the two exact mesh-shader containers discussed in #293 and tested in #1269. The baseline is #1269 at `8c3092f` plus #953 at `c42cbb0`. I applied the descriptor-join change locally and kept the existing SCC arm when resolving their overlap in `fill_phis`. | Runtime shader hash | #1269 + #953 | Same build + descriptor-join change | | --- | --- | --- | | `ef5409053e14aa82` | descriptor address or format refusal | DXIL validated, native mesh PSO created | | `235e56869c1ea883` | descriptor address or format refusal | DXIL validated, native mesh PSO created | Windows 11 build 26300, RTX 4070 explicitly selected, NVIDIA driver `32.0.16.1664`, Microsoft DXIL validator `1.8.2502.8`. Both PSOs use a generated pixel shader. No draw was submitted and the game was not started. This confirms the two containers clear translation and native pipeline creation in this stack. The incoming edge rewritten as undefined still needs a correctness check before using this change in gameplay. A useful control would exercise both sides of the join and establish which edge can reach the read. AI-assisted test harness and report. ### Correctness follow-up I added two source-only controls using a synthetic descriptor load, a join with replacement scalar data, and an LDS store. On the unguarded control, the selector for the descriptor arm reaches the store. The `9018be9` shortcut still emits a phi with an `undef` input on that arm; the phi feeds the value written to LDS, and Microsoft DXIL 1.8 accepts the module. The baseline without the shortcut refuses that control. The guarded control routes the descriptor arm past the store. I also isolated the branch-threading portion of #48 on top of the same #1269 + #953 baseline, without the shortcut. On a synthetic variant with a constant flag, it proves the guarded edge and validates the emitted module, while the unguarded control remains refused. On the two real hash matches above, the pass found zero proven edges and both remained refused. Using the dword classification from #1083 while keeping the #953 lowering, both real cases report **a buffer descriptor's format or swizzle read as data** (dword 3). This narrows the remaining work to that word. The runtime reachability of the descriptor edge in those two shaders is still unverified. No title or shader dispatch was run for these controls. AI-assisted controls and analysis.
Author
Owner

@⁠rafaconvaitis on GitHub · 2026-11-24 18:15 UTC · original · edited 2026-11-24 18:37 UTC

Follow-up on the two mesh hashes from #293. I compared #1269 8c3092f + #953 c42cbb0 with a local translator that follows the descriptor value through its SSA joins and accepts the Z selector bit only when all first reads mask out every other bit.

  • Both programs read dword 3 at root table slot 0 + 0xa40 bytes, then mask 0x100. This is the high bit of GFX10 DST_SEL_Z. The bit distinguishes a memory component from the supported constant selectors. This step translated 235e56869c1ea883.
  • ef5409053e14aa82 then reaches dword 1 from the same root table at +0x300. Its first consumer at 0x1b18 masks 0x00ff0000, the low byte of the stride field. The exact shader metadata declares stride 100 for that slot. Substituting only those masked bits from the declared stride in a separate offline probe let both exact programs pass the Microsoft DXIL validator. The stride bound by the title still needs to be observed. The raw SRV seen in the #984 discussion shows why the declaration alone is insufficient for a runtime change.
  • On victory translate --validate --list, the Z-bit change alone gained 8 mesh programs across 26,084 programs. Validated mesh programs went from 8,361 to 8,369 and total validated programs from 22,003 to 22,011. No previously validated program lost that status in the per-program comparison. The separate stride substitution was omitted from this corpus run.

I also tested the binding problem behind a #193-style metadata table with a synthetic D3D12 compute readback, on the RTX 4070 and WARP. When slot 0 switched from memory Z to force-1 after closing the command list and before submission, rewriting the descriptor and its metadata together changed the readback from (Z=7, bit=256) to (Z=1, bit=0). Changing the descriptor alone reproduced stale metadata (Z=1, bit=256). A neighboring slot stayed (Z=13, bit=256) in all runs. This was an isolated hardware test of synchronization before submission. It leaves runtime descriptor reconstruction and in-title rendering unverified.

Update from exact-hash PSO creation. On the RTX 4070 the Z-bit-only experiment creates a mesh PSO for 235e56869c1ea883 and still refuses ef5409053e14aa82. With the separate stride substitution, both exact meshes create D3D12 PSOs on the RTX 4070 and WARP using a generated pixel stage. This test stops at PSO creation. The title's pixel partner, bound descriptors and mesh output remain unverified.

Paired offline corpus update. Using one executable with the Z-bit experiment enabled, toggling the stride substitution raised validation from 22,011 to 22,085 of 26,084 programs. The 74 gains were mesh programs and zero previously validated programs lost their status. Another 45 programs reached an untracked lane-mask join and 4 vertex programs progressed to an output-signature validation failure. The stride-off control reproduced the earlier Z-bit-only outcomes for every program. This measures the compiler impact of the stride hypothesis. The actual guest descriptors at +0x300 and +0xa40 still need to be observed during the title's draws.

In-title update for ef5409053e14aa82. On RTX 4070 and Series S, an observer on 94e0ea5 recorded the guest view before the host pipeline gate on its first indirect mesh draw in the prologue. Root table slot 0 at +0x300 was a non-RAW structured buffer SRV with stride 100 and 3,000 elements. At +0xa40 it was a non-RAW structured buffer SRV with stride 256 and 600 elements. Both had DXGI format UNKNOWN, first element 0 and D3D12 component mapping 5768 (identity, so Z selects memory component 2). This confirms the stride against the actual bound guest view for this draw. The observer sees VIctory's logical D3D12 descriptor records. Native AMD descriptor bits and corrected mesh output still need validation. I have not caught 235e56869c1ea883 bound in this run so far.

AI-assisted testing on the user's machine. No title files or shader containers are attached.

**@⁠rafaconvaitis** on GitHub · 2026-11-24 18:15 UTC · [original](https://github.com/Marvisak/VIctory/issues/798#issuecomment-7140377853) · edited 2026-11-24 18:37 UTC Follow-up on the two mesh hashes from #293. I compared #1269 `8c3092f` + #953 `c42cbb0` with a local translator that follows the descriptor value through its SSA joins and accepts the Z selector bit only when all first reads mask out every other bit. - Both programs read dword 3 at root table slot 0 + `0xa40` bytes, then mask `0x100`. This is the high bit of GFX10 `DST_SEL_Z`. The bit distinguishes a memory component from the supported constant selectors. This step translated `235e56869c1ea883`. - `ef5409053e14aa82` then reaches dword 1 from the same root table at `+0x300`. Its first consumer at `0x1b18` masks `0x00ff0000`, the low byte of the stride field. The exact shader metadata declares stride 100 for that slot. Substituting only those masked bits from the declared stride in a separate offline probe let both exact programs pass the Microsoft DXIL validator. The stride bound by the title still needs to be observed. The raw SRV seen in the #984 discussion shows why the declaration alone is insufficient for a runtime change. - On `victory translate --validate --list`, the Z-bit change alone gained 8 mesh programs across 26,084 programs. Validated mesh programs went from 8,361 to 8,369 and total validated programs from 22,003 to 22,011. No previously validated program lost that status in the per-program comparison. The separate stride substitution was omitted from this corpus run. I also tested the binding problem behind a #193-style metadata table with a synthetic D3D12 compute readback, on the RTX 4070 and WARP. When slot 0 switched from memory Z to force-1 after closing the command list and before submission, rewriting the descriptor and its metadata together changed the readback from `(Z=7, bit=256)` to `(Z=1, bit=0)`. Changing the descriptor alone reproduced stale metadata `(Z=1, bit=256)`. A neighboring slot stayed `(Z=13, bit=256)` in all runs. This was an isolated hardware test of synchronization before submission. It leaves runtime descriptor reconstruction and in-title rendering unverified. Update from exact-hash PSO creation. On the RTX 4070 the Z-bit-only experiment creates a mesh PSO for `235e56869c1ea883` and still refuses `ef5409053e14aa82`. With the separate stride substitution, both exact meshes create D3D12 PSOs on the RTX 4070 and WARP using a generated pixel stage. This test stops at PSO creation. The title's pixel partner, bound descriptors and mesh output remain unverified. Paired offline corpus update. Using one executable with the Z-bit experiment enabled, toggling the stride substitution raised validation from 22,011 to 22,085 of 26,084 programs. The 74 gains were mesh programs and zero previously validated programs lost their status. Another 45 programs reached an untracked lane-mask join and 4 vertex programs progressed to an output-signature validation failure. The stride-off control reproduced the earlier Z-bit-only outcomes for every program. This measures the compiler impact of the stride hypothesis. The actual guest descriptors at `+0x300` and `+0xa40` still need to be observed during the title's draws. In-title update for `ef5409053e14aa82`. On RTX 4070 and Series S, an observer on `94e0ea5` recorded the guest view before the host pipeline gate on its first indirect mesh draw in the prologue. Root table slot 0 at `+0x300` was a non-RAW structured buffer SRV with stride 100 and 3,000 elements. At `+0xa40` it was a non-RAW structured buffer SRV with stride 256 and 600 elements. Both had DXGI format `UNKNOWN`, first element 0 and D3D12 component mapping 5768 (identity, so Z selects memory component 2). This confirms the stride against the actual bound guest view for this draw. The observer sees VIctory's logical D3D12 descriptor records. Native AMD descriptor bits and corrected mesh output still need validation. I have not caught `235e56869c1ea883` bound in this run so far. AI-assisted testing on the user's machine. No title files or shader containers are attached.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 03:53 UTC · original

Automated triage for the maintainers.

Fixed in main. Commit 75677cb ("Shaders: buffer sizes read from descriptors, and size-only waterfall loops", 2026-11-24) added a Fields::Smem arm to descriptor_data in crates/victory-shader/src/emit/lower.rs. A descriptor whose use is a scalar buffer load is now read as a raw or structured buffer, taking the stride from the used-resource entry, and constant buffers are still refused. That is the case the comments narrowed this class to (the s_buffer_load* users, dword 2). A load with no use goes to view_addresses. The remaining address/format and dword-3 cases discussed in the comments refuse with their own reasons, so they are different classes.

@⁠HrHd, if victory translate on current main still lists programs under a scalar memory read as data with a scalar-load user, please reply with the counts.

This issue will be closed in 48 hours unless the reporter replies or a maintainer removes the triage: proposed close label.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 03:53 UTC · [original](https://github.com/Marvisak/VIctory/issues/798#issuecomment-7152338210) <!-- victory-issue-triage v1 verdict=proposed-close seen=2026-11-24T18:15:10Z at=2026-11-25T03:53:39Z --> Automated triage for the maintainers. Fixed in `main`. Commit 75677cb ("Shaders: buffer sizes read from descriptors, and size-only waterfall loops", 2026-11-24) added a `Fields::Smem` arm to `descriptor_data` in `crates/victory-shader/src/emit/lower.rs`. A descriptor whose use is a scalar buffer load is now read as a raw or structured buffer, taking the stride from the used-resource entry, and constant buffers are still refused. That is the case the comments narrowed this class to (the `s_buffer_load*` users, dword 2). A load with no use goes to `view_addresses`. The remaining address/format and dword-3 cases discussed in the comments refuse with their own reasons, so they are different classes. @⁠HrHd, if `victory translate` on current `main` still lists programs under `a scalar memory read as data` with a scalar-load user, please reply with the counts. This issue will be closed in 48 hours unless the reporter replies or a maintainer removes the `triage: proposed close` label. --- _Generated by [Claude Code](https://claude.ai/code)_
This discussion has been locked. Commenting is limited to contributors.
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#798
No description provided.