Shaders: sizes of unused descriptors, paired f16 interpolation halves, 16-bit wave sums with lanes gone (+46 programs) #203

Open
triippywhale wants to merge 1 commit from upstream-pr/203 into main
triippywhale commented 2026-11-24 22:32:56 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by triippywhale on 2026-11-24T22:32:56Z.


Summary

This PR fixes three translator gaps that were dropping world shaders. 46 programs of the retail shader pack now translate and validate, and none that translated before stop doing so. Seven of them are shaders the title actually binds in the prologue, which failed to translate in an in-game run before this change.

It is independent of fxceless/victory-fork#134 (the AMD view-heap clamp): this branch is upstream 2119b0e plus one commit. The in-game results below were taken with both applied.

Tested on Windows 11, AMD Radeon RX 7900 XT (RDNA3), Ryzen 7 7800X3D, 64 GB, Series X profile.

Changes (crates/victory-shader/src/emit/lower.rs)

1. Descriptors nothing uses as one, whose size the code still reads (36 programs)

descriptor_data rebuilt a descriptor's size dwords (width, height, levels; record count) only when it could find an instruction that uses the descriptor, either directly or through a "twin" load of the same address. Two patterns have no such use:

  • PS_PuddleDetect (34 pixel programs, 3 in game): at 0x1c5c the program does s_load_dwordx8 s[20:27], s[86:87], s12. That is an image descriptor taken from the heap at an index read from a constant buffer. The program then turns its width, height and base level into a texel size (s_lshr_b32 s12, s21, 30 / s_bfe_u32 s15, s22, 0x10000e / s_bfe_u32 s12, s23, 0x4000c / v_cvt_f32_u32), and never samples that texture there. Before this change it failed with "a descriptor read only as data".
  • ShallowWaterSim:CS_MinTimestepReduce (1 in game): it loads a 4-dword buffer descriptor only to run s_cmp_eq_u32 s2, 0 on its record count, to skip the pass when the buffer is empty. The address path filled dwords 0–1 and left dword 2 without a host value, so this failed with "a descriptor's address or format read as data".

The new unused_descriptor_kind gives such a load a kind:

  • 8 dwords: a 2D texture. This is a documented shortcut, since nothing in the program tells the dimension; for these programs the reads are texel sizes of 2D masks.
  • 4 dwords, where dword 2 is read: a raw buffer view.

The existing tail of descriptor_data then rebuilds the dwords from getDimensions on the host view, exactly as it does for used descriptors. For the buffer, the address comes from the host as the address-only path did. Lane-copied (waterfall) descriptors and samplers are checked first and keep their own handling. A first version of this change took them over and broke 283 mesh programs; the whole-pack comparison caught that.

2. f16 interpolation pairs whose first half's register is partly kept (8 programs, 2 in game)

PS_DeferredTextured_* (and mirror-reflection variants) do this:

v_interp_p1ll_f16 v10, v0, attr3.w high
v_interp_p2_f16   v10, v1, attr3.w, v10 high   ; writes the HIGH half of v10

The second half writes only the high half of its destination and keeps the low half, which is the first half's partial result. Nothing reads that low half; the console compiler just reused the register. But interp() refused any first half that belongs to a pair ("the first half of an interpolation"), so the export that eventually reads v10 had no value.

A first half that belongs to a pair now writes 0 to its register instead. Its real partial sum is never needed, because its second half interpolates the attribute directly.

3. 16-bit float wave sums where some lanes have left (2 programs, 1 in game)

compute_graph_ops:CS_TransposeVecMatMul* sums v_add_f16 products over the wave (DPP / v_permlanex16 / v_readlane tree), after threads past the matrix edge have already left through v_cmpx. half_sum reproduces the console's balanced tree bit for bit, but only when every lane is present ("a wave sum of 16-bit floats where not every lane runs").

On the console, the section runs in every lane, and a lane outside EXEC adds +0. So after step k, every lane of an aligned run of 2^k lanes holds that run's partial sum, including the lanes that left. The new half_sum_present (one host wave of 64, which is AMD) reads each partner run's sum from the first lane of that run that is still here, using a WaveActiveBallot, and uses +0 when no lane of that run is here. Lane 0's high half is handled the same way. Two host waves of 32 (NVIDIA) still refuse this case, because there the halves are exchanged through group-shared memory and that needs every lane.

Testing

  • Whole retail pack (victory translate shaders.rpf --validate --list, 26,503 containers), compared per program against the build before this commit:

    before after
    vertex + pixel emitted / validated 14,156 / 14,045 14,199 / 14,088
    compute emitted / validated 2,669 / 2,669 2,671 / 2,671 (this branch alone; 2,672 with #134's v_permlanex16)
    mesh emitted / validated 8,762 / 8,657 8,762 / 8,657 (unchanged)

    46 programs went from a failure to validated: 35 "descriptor read only as data", 8 "first half of an interpolation", 2 "wave sum of 16-bit floats where not every lane runs" and 1 "descriptor's address or format read as data". No program went the other way.

  • New GPU test a_sum_of_halves_where_lanes_have_left_is_the_consoles_tree_bit_for_bit (wave64_tests.rs): 64 lanes hold distinct f16 values whose sum depends on the order of the additions. Lanes at or past s0 leave through v_cmpx + s_cbranch_execz, and the rest run the console's sum sequence. With 64, 63, 40, 33, 32, 17, 5 and 1 lanes staying, the RX 7900 XT matches the console's tree bit for bit (lanes that left count as +0). The existing full-wave tree test still passes.

  • cargo test --workspace --locked: 23 suites, 497 tests, all pass. cargo clippy --workspace --all-targets --locked -- -D warnings: clean.

In game (RX 7900 XT, this commit + #134, VICTORY_RELAY=2 VICTORY_WIDE_BACK=1 VICTORY_CARD_BUFFERS_MIN_MB=1 VICTORY_CARD_BUFFERS_MB=1024)

before after
Programs the title binds that do not translate 9 2
Now translate – 7d0f14ce44746d7e, 2fd01fca16993001, 6b6db9f1a526daeb (PuddleDetect), 78f3f2fc53a69531, 38bf0814e721a1b3 (DeferredTextured), b22a16a178976e1b (TransposeVecMatMulAligned), ceb5eb68cd99cb07 (MinTimestepReduce)
Device removed / errors / black frames 0 / 0 / 0 0 / 0 / 0
World frame rate ~5.9 fps ~5.9 fps (about 7½ minutes in the prologue)

What the screen still shows (prologue, after this PR)

From two screenshots of the opening interior scenes on the RX 7900 XT, with what the logs say about each:

  1. Walls and ceilings of the interior are missing. The room and corridor are open to the sky and haze, and ceiling slabs float. One character in the corridor is drawn as a head and forearms only, with no torso or clothing. The strongest lead is device methods 0x1c8 / 0x218 (DeserializePipelineStateX, per XCL's console device map). They return E_NOTIMPL, and the run logged them at 16,384+ calls (0x1c8) and 2,048+ (0x218), all during loading. device.rs notes that on failure "the title goes without this pipeline, silently". With thousands of pipelines missing, whole material passes (walls, clothing layers) are plausibly never drawn. This is not shown yet: the next step is to decode the serialized descriptions that are already logged (description= / first_points_at=) and build the pipelines from them. The README's known issue "The interior of the first gameplay room is sometimes not drawn" fits the same cause.
  2. Speckled, glittering surfaces on characters' clothing and skin, which look like unresolved per-pixel noise. This looks like dithered or stochastic material (hair, cloth, stochastic transparency) and noisy lighting that the console resolves with temporal accumulation or denoising. Candidates are a pass missing because of (1), or the ray-traced lighting that does not run yet. This needs a frame capture to confirm (VICTORY_CAPTURE + VICTORY_DUMP_TARGETS on the diagnostics build).
  3. Faces and the shadowed side of characters are near black. This is the known missing ray-traced bounce light and shadows ("anything the sun does not hit directly is black"). Its CS_TraceShadowRays_* programs (5) still fail with "a descriptor read only as data": they take a BVH address from a descriptor (s_lshr_b64 s[38:39], s[36:37], 8) and walk memory from it, which depends on the fork's ray-tracing work.
  4. Stray long lines from hair (strands stretching away from heads) and a long bright diagonal line across the floor. These are vertices at wrong positions: hair cards or skinned or blend-shape geometry. Not yet traced to a specific program.

Still failing in the pack

  • 5 water_shading:CS_TransmissionVolumetrics* (2 bound in the prologue): a wave-wide sum of doubles (v_add_f64 through the same DPP / permlane / readlane tree, WaveActiveSum(1.0) as a lane count), which the section simulator does not model. Fixing it needs double support in the emitter.
  • 5 shadowmask:CS_TraceShadowRays_* (ray tracing, see above), 195 GS_Voxelize* ("an address in an SGPR that is no root parameter"), 40 "a descriptor chosen by control flow", 10 "a hardware SGPR input", and 1 "an opaque lane mask".
  • One host mesh pipeline is still refused with E_INVALIDARG (mesh f5e50eb2108c425b, pixel ce3f0432a08f1d35), which predates this PR.

Notes

  • XCL (GPL-2.0-only) was read only to identify the console device slots. No code from it is in this PR.
  • Workflow for the next person: VICTORY_TRANSLATE_ONLY=<hash,...> and VICTORY_DUMP_MATCH="<dir>;#<hash>|..." with translate, then shader-info <file> --disasm. Comparing --list outcomes per #hash against a baseline build is what caught the waterfall regression.

🤖 Generated with Claude Code

<!-- greyfinch-sync:fxceless/victory-fork:issue:6592744255 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/203). Originally posted by [triippywhale](https://github.com/triippywhale) on 2026-11-24T22:32:56Z. --- ## Summary This PR fixes three translator gaps that were dropping world shaders. **46 programs of the retail shader pack now translate and validate, and none that translated before stop doing so.** Seven of them are shaders the title actually binds in the prologue, which failed to translate in an in-game run before this change. It is independent of fxceless/victory-fork#134 (the AMD view-heap clamp): this branch is upstream `2119b0e` plus one commit. The in-game results below were taken with both applied. Tested on **Windows 11, AMD Radeon RX 7900 XT (RDNA3), Ryzen 7 7800X3D, 64 GB**, Series X profile. ## Changes (`crates/victory-shader/src/emit/lower.rs`) ### 1. Descriptors nothing uses as one, whose size the code still reads (36 programs) `descriptor_data` rebuilt a descriptor's size dwords (width, height, levels; record count) only when it could find an instruction that uses the descriptor, either directly or through a "twin" load of the same address. Two patterns have no such use: - **`PS_PuddleDetect` (34 pixel programs, 3 in game):** at `0x1c5c` the program does `s_load_dwordx8 s[20:27], s[86:87], s12`. That is an image descriptor taken from the heap at an index read from a constant buffer. The program then turns its width, height and base level into a texel size (`s_lshr_b32 s12, s21, 30` / `s_bfe_u32 s15, s22, 0x10000e` / `s_bfe_u32 s12, s23, 0x4000c` / `v_cvt_f32_u32`), and never samples that texture there. Before this change it failed with *"a descriptor read only as data"*. - **`ShallowWaterSim:CS_MinTimestepReduce` (1 in game):** it loads a 4-dword buffer descriptor only to run `s_cmp_eq_u32 s2, 0` on its record count, to skip the pass when the buffer is empty. The address path filled dwords 0–1 and left dword 2 without a host value, so this failed with *"a descriptor's address or format read as data"*. The new `unused_descriptor_kind` gives such a load a kind: - **8 dwords:** a 2D texture. This is a documented shortcut, since nothing in the program tells the dimension; for these programs the reads are texel sizes of 2D masks. - **4 dwords, where dword 2 is read:** a raw buffer view. The existing tail of `descriptor_data` then rebuilds the dwords from `getDimensions` on the host view, exactly as it does for used descriptors. For the buffer, the address comes from the host as the address-only path did. Lane-copied (waterfall) descriptors and samplers are checked first and keep their own handling. A first version of this change took them over and broke 283 mesh programs; the whole-pack comparison caught that. ### 2. f16 interpolation pairs whose first half's register is partly kept (8 programs, 2 in game) `PS_DeferredTextured_*` (and mirror-reflection variants) do this: ``` v_interp_p1ll_f16 v10, v0, attr3.w high v_interp_p2_f16 v10, v1, attr3.w, v10 high ; writes the HIGH half of v10 ``` The second half writes only the high half of its destination and keeps the low half, which is the first half's partial result. Nothing reads that low half; the console compiler just reused the register. But `interp()` refused any first half that belongs to a pair (*"the first half of an interpolation"*), so the export that eventually reads `v10` had no value. A first half that belongs to a pair now writes 0 to its register instead. Its real partial sum is never needed, because its second half interpolates the attribute directly. ### 3. 16-bit float wave sums where some lanes have left (2 programs, 1 in game) `compute_graph_ops:CS_TransposeVecMatMul*` sums `v_add_f16` products over the wave (DPP / `v_permlanex16` / `v_readlane` tree), after threads past the matrix edge have already left through `v_cmpx`. `half_sum` reproduces the console's balanced tree bit for bit, but only when every lane is present (*"a wave sum of 16-bit floats where not every lane runs"*). On the console, the section runs in every lane, and a lane outside EXEC adds `+0`. So after step *k*, every lane of an aligned run of 2^k lanes holds that run's partial sum, including the lanes that left. The new `half_sum_present` (one host wave of 64, which is AMD) reads each partner run's sum from the **first lane of that run that is still here**, using a `WaveActiveBallot`, and uses `+0` when no lane of that run is here. Lane 0's high half is handled the same way. Two host waves of 32 (NVIDIA) still refuse this case, because there the halves are exchanged through group-shared memory and that needs every lane. ## Testing - **Whole retail pack** (`victory translate shaders.rpf --validate --list`, 26,503 containers), compared per program against the build before this commit: | | before | after | |---|---|---| | vertex + pixel emitted / validated | 14,156 / 14,045 | **14,199 / 14,088** | | compute emitted / validated | 2,669 / 2,669 | **2,671 / 2,671** (this branch alone; 2,672 with #134's `v_permlanex16`) | | mesh emitted / validated | 8,762 / 8,657 | 8,762 / 8,657 (unchanged) | 46 programs went from a failure to validated: 35 *"descriptor read only as data"*, 8 *"first half of an interpolation"*, 2 *"wave sum of 16-bit floats where not every lane runs"* and 1 *"descriptor's address or format read as data"*. No program went the other way. - **New GPU test** `a_sum_of_halves_where_lanes_have_left_is_the_consoles_tree_bit_for_bit` (`wave64_tests.rs`): 64 lanes hold distinct f16 values whose sum depends on the order of the additions. Lanes at or past `s0` leave through `v_cmpx` + `s_cbranch_execz`, and the rest run the console's sum sequence. With 64, 63, 40, 33, 32, 17, 5 and 1 lanes staying, the RX 7900 XT matches the console's tree bit for bit (lanes that left count as +0). The existing full-wave tree test still passes. - `cargo test --workspace --locked`: 23 suites, 497 tests, all pass. `cargo clippy --workspace --all-targets --locked -- -D warnings`: clean. ### In game (RX 7900 XT, this commit + #134, `VICTORY_RELAY=2 VICTORY_WIDE_BACK=1 VICTORY_CARD_BUFFERS_MIN_MB=1 VICTORY_CARD_BUFFERS_MB=1024`) | | before | after | |---|---|---| | Programs the title binds that do not translate | 9 | **2** | | Now translate | – | `7d0f14ce44746d7e`, `2fd01fca16993001`, `6b6db9f1a526daeb` (PuddleDetect), `78f3f2fc53a69531`, `38bf0814e721a1b3` (DeferredTextured), `b22a16a178976e1b` (TransposeVecMatMulAligned), `ceb5eb68cd99cb07` (MinTimestepReduce) | | Device removed / errors / black frames | 0 / 0 / 0 | 0 / 0 / 0 | | World frame rate | ~5.9 fps | ~5.9 fps (about 7½ minutes in the prologue) | ## What the screen still shows (prologue, after this PR) From two screenshots of the opening interior scenes on the RX 7900 XT, with what the logs say about each: 1. **Walls and ceilings of the interior are missing.** The room and corridor are open to the sky and haze, and ceiling slabs float. One character in the corridor is drawn as a **head and forearms only**, with no torso or clothing. The strongest lead is **device methods `0x1c8` / `0x218`** (`DeserializePipelineStateX`, per XCL's console device map). They return `E_NOTIMPL`, and the run logged them at **16,384+ calls (`0x1c8`) and 2,048+ (`0x218`)**, all during loading. `device.rs` notes that on failure *"the title goes without this pipeline, silently"*. With thousands of pipelines missing, whole material passes (walls, clothing layers) are plausibly never drawn. This is not shown yet: the next step is to decode the serialized descriptions that are already logged (`description=` / `first_points_at=`) and build the pipelines from them. The README's known issue *"The interior of the first gameplay room is sometimes not drawn"* fits the same cause. 2. **Speckled, glittering surfaces on characters' clothing and skin**, which look like unresolved per-pixel noise. This looks like dithered or stochastic material (hair, cloth, stochastic transparency) and noisy lighting that the console resolves with temporal accumulation or denoising. Candidates are a pass missing because of (1), or the ray-traced lighting that does not run yet. This needs a frame capture to confirm (`VICTORY_CAPTURE` + `VICTORY_DUMP_TARGETS` on the diagnostics build). 3. **Faces and the shadowed side of characters are near black.** This is the known missing ray-traced bounce light and shadows (*"anything the sun does not hit directly is black"*). Its `CS_TraceShadowRays_*` programs (5) still fail with *"a descriptor read only as data"*: they take a BVH address from a descriptor (`s_lshr_b64 s[38:39], s[36:37], 8`) and walk memory from it, which depends on the fork's ray-tracing work. 4. **Stray long lines from hair** (strands stretching away from heads) and a long bright diagonal line across the floor. These are vertices at wrong positions: hair cards or skinned or blend-shape geometry. Not yet traced to a specific program. ## Still failing in the pack - **5 `water_shading:CS_TransmissionVolumetrics*`** (2 bound in the prologue): a wave-wide sum of **doubles** (`v_add_f64` through the same DPP / permlane / readlane tree, `WaveActiveSum(1.0)` as a lane count), which the section simulator does not model. Fixing it needs double support in the emitter. - 5 `shadowmask:CS_TraceShadowRays_*` (ray tracing, see above), 195 `GS_Voxelize*` (*"an address in an SGPR that is no root parameter"*), 40 *"a descriptor chosen by control flow"*, 10 *"a hardware SGPR input"*, and 1 *"an opaque lane mask"*. - One host mesh pipeline is still refused with `E_INVALIDARG` (`mesh f5e50eb2108c425b, pixel ce3f0432a08f1d35`), which predates this PR. ## Notes - XCL (GPL-2.0-only) was read only to identify the console device slots. No code from it is in this PR. - Workflow for the next person: `VICTORY_TRANSLATE_ONLY=<hash,...>` and `VICTORY_DUMP_MATCH="<dir>;#<hash>|..."` with `translate`, then `shader-info <file> --disasm`. Comparing `--list` outcomes per `#hash` against a baseline build is what caught the waterfall regression. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Flyander commented 2026-11-24 23:09:10 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Flyander on 2026-11-24T22:43:55Z.

Review: COMMENTED


Cross-check on Windows D3D12 with an RTX 5070 Ti: cargo test --locked -p victory-shader --lib passes (211 passed, 2 ignored).

The new a_sum_of_halves_where_lanes_have_left_is_the_consoles_tree_bit_for_bit test cannot execute this wave64 program on this GPU: on_the_card reports “the hardware device does not take this program; not run”, then the test returns ok. So this run checks the rest of the shader suite on NVIDIA, while the RX 7900 XT run in the PR remains the hardware execution evidence for the new 64-lane path.

<!-- greyfinch-sync:fxceless/victory-fork:review:6048565889 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/203#pullrequestreview-6048565889). Originally posted by [Flyander](https://github.com/Flyander) on 2026-11-24T22:43:55Z. **Review:** COMMENTED --- Cross-check on Windows D3D12 with an RTX 5070 Ti: `cargo test --locked -p victory-shader --lib` passes (211 passed, 2 ignored). The new `a_sum_of_halves_where_lanes_have_left_is_the_consoles_tree_bit_for_bit` test cannot execute this wave64 program on this GPU: `on_the_card` reports “the hardware device does not take this program; not run”, then the test returns `ok`. So this run checks the rest of the shader suite on NVIDIA, while the RX 7900 XT run in the PR remains the hardware execution evidence for the new 64-lane path.
m335671 commented 2026-11-24 23:09:38 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by m335671 on 2026-11-24T22:45:58Z.


For whoever merges: part 2 here (f16 interpolation pairs, 8 programs) fixes the same 8 programs as #77, which has been open since earlier today, at a different place.

  • #77 keeps interp() as it is and fixes the consumer. The first half's VGPR stays without a value. The v_fma_mixlo_f16 / v_fma_mixhi_f16 arm that keeps the other half of that VGPR now treats a missing old value as 0, as write_half and low_half already do. That is 5 lines in lower.rs plus a test that fails without it.
  • Here, a first half that belongs to a pair writes 0 to its register. That covers any later reader of that register, not only the mixed FMA.

Same 8 hashes either way: 38bf0814e721a1b3, 78f3f2fc53a69531, 8445dcb2b63aa197, 007bb29b393d08c5, 15547db9d31b056b, 288c43f50bc7abee, 5ddcaa08d4a51215, 464ea474374b8ecd. #77 has in-game and offline confirmations on RTX 5070 Ti, RTX 5080, RTX 4080, RX 9070 and a Series S profile run (8 gained, 0 lost).

The two don't conflict in behaviour: with both, the mixed FMA reads the 0 this PR writes. Whichever lands first makes the other's part redundant for these programs. I have not tested this PR.

AI use: Claude Code (Claude Opus 5.5) compared the two changes and wrote this comment. I am the author of #77.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7146618891 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/203#issuecomment-7146618891). Originally posted by [m335671](https://github.com/m335671) on 2026-11-24T22:45:58Z. --- For whoever merges: part 2 here (f16 interpolation pairs, 8 programs) fixes the same 8 programs as #77, which has been open since earlier today, at a different place. - **#77** keeps `interp()` as it is and fixes the consumer. The first half's VGPR stays without a value. The `v_fma_mixlo_f16` / `v_fma_mixhi_f16` arm that keeps the other half of that VGPR now treats a missing old value as 0, as `write_half` and `low_half` already do. That is 5 lines in `lower.rs` plus a test that fails without it. - **Here**, a first half that belongs to a pair writes 0 to its register. That covers any later reader of that register, not only the mixed FMA. Same 8 hashes either way: `38bf0814e721a1b3`, `78f3f2fc53a69531`, `8445dcb2b63aa197`, `007bb29b393d08c5`, `15547db9d31b056b`, `288c43f50bc7abee`, `5ddcaa08d4a51215`, `464ea474374b8ecd`. #77 has in-game and offline confirmations on RTX 5070 Ti, RTX 5080, RTX 4080, RX 9070 and a Series S profile run (8 gained, 0 lost). The two don't conflict in behaviour: with both, the mixed FMA reads the 0 this PR writes. Whichever lands first makes the other's part redundant for these programs. I have not tested this PR. AI use: Claude Code (Claude Opus 5.5) compared the two changes and wrote this comment. I am the author of #77.
pablogonz12 commented 2026-11-24 23:09:39 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by pablogonz12 on 2026-11-24T22:51:14Z.


Test report from AMD on Linux, for the 16-bit wave-sum part.

Setup: RX 9070 XT (RDNA4, GFX1201, native wave64), RADV Mesa 26.3.1, Arch, GE-Proton11-14 (Wine 11.0), vkd3d-proton master.

On this machine one world program was still refused for a 16-bit wave sum with lanes gone (the only remaining refusal of that kind in my dump of 751 world programs). With this PR built on the fork's main it translates, the DXIL validates and RADV creates the pipeline. I had written my own lowering for the same case (one widened f32 sum, rounded once); yours keeps the console's tree over the present lanes, which is the better choice, so I dropped mine.

Not tested: a game run with this PR alone, the descriptor-size and interpolation parts on their own. (AI-assisted; numbers from my own runs.)

<!-- greyfinch-sync:fxceless/victory-fork:comment:7146721320 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/203#issuecomment-7146721320). Originally posted by [pablogonz12](https://github.com/pablogonz12) on 2026-11-24T22:51:14Z. --- Test report from AMD on Linux, for the 16-bit wave-sum part. **Setup:** RX 9070 XT (RDNA4, GFX1201, native wave64), RADV Mesa 26.3.1, Arch, GE-Proton11-14 (Wine 11.0), vkd3d-proton master. On this machine one world program was still refused for a 16-bit wave sum with lanes gone (the only remaining refusal of that kind in my dump of 751 world programs). With this PR built on the fork's main it translates, the DXIL validates and RADV creates the pipeline. I had written my own lowering for the same case (one widened f32 sum, rounded once); yours keeps the console's tree over the present lanes, which is the better choice, so I dropped mine. Not tested: a game run with this PR alone, the descriptor-size and interpolation parts on their own. (AI-assisted; numbers from my own runs.)
icecreammule277-dot commented 2026-11-24 23:09:41 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by icecreammule277-dot on 2026-11-24T23:02:26Z.


Tested on an RX 9070 XT (Adrenalin 32.0.32029.2010).

Two compute programs that previously failed to translate now do:

  • b22a16a178976e1b — a 16-bit wave sum where not every lane runs. It had been dropped 14 dispatches a frame, every frame.
  • ceb5eb68cd99cb07 — a descriptor's dword 2 read as data (a buffer tested for being empty by its record count).

Both error strings match this PR's items one for one ("a wave sum of 16-bit floats where not every lane runs" and "a descriptor's address or format read as data").

For anyone cherry-picking onto an older base: the descriptor_data hunk conflicts. Resolving it by wrapping the existing if let/else in the unused-kind branch works and keeps the base's shape —

let unused = if use_at.is_none() {
    self.unused_descriptor_kind(inst, site, code, count)
} else {
    None
};
let (first, src, props, image, uav, used) = if let Some(kind) = unused {
    let (first, props, image, uav, used) = kind;
    (first, Source::Loaded { load: site, first }, props, image, uav, used)
} else if let Some((at, first)) = use_at {
    ...
} else {
    ...
};

— and the wave64_tests.rs hunks apply clean. 223 shader tests pass.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7146941956 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/203#issuecomment-7146941956). Originally posted by [icecreammule277-dot](https://github.com/icecreammule277-dot) on 2026-11-24T23:02:26Z. --- Tested on an RX 9070 XT (Adrenalin 32.0.32029.2010). Two compute programs that previously failed to translate now do: - `b22a16a178976e1b` — a 16-bit wave sum where not every lane runs. It had been dropped **14 dispatches a frame**, every frame. - `ceb5eb68cd99cb07` — a descriptor's dword 2 read as data (a buffer tested for being empty by its record count). Both error strings match this PR's items one for one ("a wave sum of 16-bit floats where not every lane runs" and "a descriptor's address or format read as data"). For anyone cherry-picking onto an older base: the `descriptor_data` hunk conflicts. Resolving it by wrapping the existing `if let`/`else` in the unused-kind branch works and keeps the base's shape — ```rust let unused = if use_at.is_none() { self.unused_descriptor_kind(inst, site, code, count) } else { None }; let (first, src, props, image, uav, used) = if let Some(kind) = unused { let (first, props, image, uav, used) = kind; (first, Source::Loaded { load: site, first }, props, image, uav, used) } else if let Some((at, first)) = use_at { ... } else { ... }; ``` — and the `wave64_tests.rs` hunks apply clean. 223 shader tests pass.
arminkhaleghirod commented 2026-11-25 00:10:09 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by arminkhaleghirod on 2026-11-24T23:38:20Z.


Merged onto main 90228a7, ran victory translate --validate over the full title (26,148 programs), Windows 11 / RTX 4080. Changes against main:

  • a descriptor read only as data: 40 → 5
  • a descriptor's address or format read as data: 1 → 0
  • a wave sum of 16-bit floats where not every lane runs: 2 → 0
  • the first half of an interpolation: 8 → 0
  • DXIL emitted: 14,168 → 14,211
  • No new failure reason. The newly emitted programs land in the blanket PSV mismatch on main, so their real validator result only shows with #61.

The descriptor and interpolation parts give the same counts as #81 and #77, so those overlap with this one.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7147628212 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/203#issuecomment-7147628212). Originally posted by [arminkhaleghirod](https://github.com/arminkhaleghirod) on 2026-11-24T23:38:20Z. --- Merged onto main 90228a7, ran `victory translate --validate` over the full title (26,148 programs), Windows 11 / RTX 4080. Changes against main: - `a descriptor read only as data`: 40 → 5 - `a descriptor's address or format read as data`: 1 → 0 - `a wave sum of 16-bit floats where not every lane runs`: 2 → 0 - `the first half of an interpolation`: 8 → 0 - DXIL emitted: 14,168 → 14,211 - No new failure reason. The newly emitted programs land in the blanket PSV mismatch on main, so their real validator result only shows with #61. The descriptor and interpolation parts give the same counts as #81 and #77, so those overlap with this one.
Arvi23 commented 2026-11-25 01:12:09 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Arvi23 on 2026-11-25T01:10:37Z.


Tested in game on AMD RDNA4 (RX 9070 XT, Windows 10): all 8 programs that did not translate in the prologue translate with this PR.

Setup: RX 9070 XT, driver 32.0.32029.2010, Windows 10 IoT Enterprise LTSC 21H2 (19044) with the Agility SDK runtime (#420), release build, Series X profile, no VICTORY_* switches.

Without this PR (31714de + #420's first commit + the #120 patch + #58), the run dropped these, first bound between frames 1112 and 1561:

program reason
2fd01fca16993001, 6b6db9f1a526daeb, abc6a80d46edc294, 8660e9822ebe4b62, c8df7216c69cecbd, 7d0f14ce44746d7e (pixel) a descriptor read only as data
ceb5eb68cd99cb07 (compute) a descriptor's address or format read as data
b22a16a178976e1b (compute) a wave sum of 16-bit floats where not every lane runs

With this PR (and #51) on the same tree, and again on a803c87 + #420: 0 programs untranslated in each run, no device removal, no compiler crash.

On the overlap with main: 3bff182 already maps the first half of an f16 interpolation pair onto its pair (VICTORY_FIRST_HALF). This PR's write-0 in interp() only runs for a site that is not in that map, so on current main it is a fallback behind 3bff182's version. The cherry-pick onto 31714de and a803c87 had no conflicts.

cargo test --workspace with this PR, #420 and #411 on a803c87: 509 passed, 0 failed.

AI use: Claude Code (Claude Opus 5.5) read the logs and the overlap and wrote this; the runs are on my machine.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7149283090 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/203#issuecomment-7149283090). Originally posted by [Arvi23](https://github.com/Arvi23) on 2026-11-25T01:10:37Z. --- **Tested in game on AMD RDNA4 (RX 9070 XT, Windows 10): all 8 programs that did not translate in the prologue translate with this PR.** Setup: RX 9070 XT, driver 32.0.32029.2010, Windows 10 IoT Enterprise LTSC 21H2 (19044) with the Agility SDK runtime (#420), release build, Series X profile, no `VICTORY_*` switches. Without this PR (`31714de` + #420's first commit + the #120 patch + #58), the run dropped these, first bound between frames 1112 and 1561: | program | reason | |---|---| | `2fd01fca16993001`, `6b6db9f1a526daeb`, `abc6a80d46edc294`, `8660e9822ebe4b62`, `c8df7216c69cecbd`, `7d0f14ce44746d7e` (pixel) | a descriptor read only as data | | `ceb5eb68cd99cb07` (compute) | a descriptor's address or format read as data | | `b22a16a178976e1b` (compute) | a wave sum of 16-bit floats where not every lane runs | With this PR (and #51) on the same tree, and again on `a803c87` + #420: **0 programs untranslated** in each run, no device removal, no compiler crash. On the overlap with `main`: `3bff182` already maps the first half of an f16 interpolation pair onto its pair (`VICTORY_FIRST_HALF`). This PR's write-0 in `interp()` only runs for a site that is not in that map, so on current `main` it is a fallback behind `3bff182`'s version. The cherry-pick onto `31714de` and `a803c87` had no conflicts. `cargo test --workspace` with this PR, #420 and #411 on `a803c87`: 509 passed, 0 failed. AI use: Claude Code (Claude Opus 5.5) read the logs and the overlap and wrote this; the runs are on my machine.
ryotdev commented 2026-11-25 02:10:14 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by ryotdev on 2026-11-25T02:04:25Z.


I tested commit 0e49a91 on Windows 11 with an RTX 5070 (driver 610.88), using the Series X profile. I cherry-picked this PR onto an older local play branch based on 4e17478, with #63 and a single-wave LDS fix, and used the same prison checkpoint as the control.

  • With the translator set to wave32, 2 of 8 selected programs passed DXIL validation on the control and 8 of 8 passed with this PR. The set included the seven programs named in the PR and one checkerboard-shadow control. The matrix program already passed on this base.
  • In the game, two previously refused puddle variants reached 8 and 3 indirect draw recordings in one sampled frame. The previously refused shallow-water timestep reached 8 direct dispatch recordings in another. An indirect recording does not tell us how many pixels it drew.
  • Both deferred-material variants validated offline. They did not appear in the sampled draw commands, so I could not attribute a change in character appearance to them. The run reached interactive 3D without a device loss.

AI-assisted test. These counts apply to the local base above.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7150284697 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/203#issuecomment-7150284697). Originally posted by [ryotdev](https://github.com/ryotdev) on 2026-11-25T02:04:25Z. --- I tested commit `0e49a91` on Windows 11 with an RTX 5070 (driver 610.88), using the Series X profile. I cherry-picked this PR onto an older local play branch based on `4e17478`, with #63 and a single-wave LDS fix, and used the same prison checkpoint as the control. - With the translator set to wave32, 2 of 8 selected programs passed DXIL validation on the control and 8 of 8 passed with this PR. The set included the seven programs named in the PR and one checkerboard-shadow control. The matrix program already passed on this base. - In the game, two previously refused puddle variants reached 8 and 3 indirect draw recordings in one sampled frame. The previously refused shallow-water timestep reached 8 direct dispatch recordings in another. An indirect recording does not tell us how many pixels it drew. - Both deferred-material variants validated offline. They did not appear in the sampled draw commands, so I could not attribute a change in character appearance to them. The run reached interactive 3D without a device loss. AI-assisted test. These counts apply to the local base above.
iGoldenNinja commented 2026-11-25 06:06:41 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by iGoldenNinja on 2026-11-25T06:03:40Z.


Independent RTX 5080 check of the descriptor-data part of 0e49a91, on PR 688 head 7e7bb18 with PR 51 d82acef already applied. Windows 11 Pro 25H2 build 26200.9974, NVIDIA 617.14, Ryzen 9 5900X, Rust 1.98.1 MSVC, DXIL 1.9.2609.5, Series X profile. The comparison kept the same relay, inline staging and input sequence.

7d0f14ce44746d7e and 6b6db9f1a526daeb both went from a descriptor read only as data to validated DXIL and a created offline D3D12 test pipeline. The live run also accepted both mesh/pixel pipelines, paired with a9184e594aae6932 and 4f23fd8d99482703, respectively. The five compute controls reproduced their previous results.

The same interior view after the first retreat still showed wall and ceiling gaps. Over five minutes of the prison replay, Presented FPS was 4.565 before and 4.543 after, and P99 was 435.139 and 435.072 ms. The patched run reached player control and ended deliberately after capture with no DRED device removal logged. This isolates only the descriptor change, with one live run per build.

Test method and counts

OpenAI Codex (GPT-6) ran the local checks and drafted this report.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7154400458 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/203#issuecomment-7154400458). Originally posted by [iGoldenNinja](https://github.com/iGoldenNinja) on 2026-11-25T06:03:40Z. --- Independent RTX 5080 check of the descriptor-data part of `0e49a91`, on PR 688 head `7e7bb18` with PR 51 `d82acef` already applied. Windows 11 Pro 25H2 build 26200.9974, NVIDIA 617.14, Ryzen 9 5900X, Rust 1.98.1 MSVC, DXIL 1.9.2609.5, Series X profile. The comparison kept the same relay, inline staging and input sequence. `7d0f14ce44746d7e` and `6b6db9f1a526daeb` both went from `a descriptor read only as data` to validated DXIL and a created offline D3D12 test pipeline. The live run also accepted both mesh/pixel pipelines, paired with `a9184e594aae6932` and `4f23fd8d99482703`, respectively. The five compute controls reproduced their previous results. The same interior view after the first retreat still showed wall and ceiling gaps. Over five minutes of the prison replay, Presented FPS was 4.565 before and 4.543 after, and P99 was 435.139 and 435.072 ms. The patched run reached player control and ended deliberately after capture with no DRED device removal logged. This isolates only the descriptor change, with one live run per build. [Test method and counts](https://github.com/iGoldenNinja/victory-fork/blob/b2ab0beee1d7a6aade0d9184c6647afc5868674e/docs/ssd-pr203-descriptors-5080.md) OpenAI Codex (GPT-6) ran the local checks and drafted this report.
ArturoWolff commented 2026-11-25 07:06:14 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by ArturoWolff on 2026-11-25T06:12:14Z.


Linux offline A/B on 8dd30ab versus the same main + only 0e49a91 (clean automatic merge). Of the seven prologue hashes in the PR, 3/7 validated on main and 7/7 with #203. Both builds called emit::translate directly on the same hash-checked inputs with set_host_max_wave(32); every emitted container was checked with dxv.

  • The three PuddleDetect variants and ceb5eb68cd99cb07 (shallow-water timestep) are the four gains. The latter reproduces #599’s descriptor refusal at 0x38 on main. These are not four new wins on top of #81: the three puddle variants overlap our earlier #81 replay.
  • The two deferred-material variants and the matrix compute b22a16a178976e1b already validated and were byte-identical across the builds. The matrix disassembly declares WaveSize=32 on this base. That is not a test of the PR’s wave64 arithmetic.
  • Two extra #599 controls separate this from a black-frame fix: final-composite pixel 4f4ec7b16673362f was byte-identical; compute f133e35efed2a48a still refused at 0x1eb4 (lane mask exchanged where not every lane runs). The older local Proton run logged first binds for two of the newly translatable puddle variants at frame 2251; it did not log the shallow-water hash. No game or GPU pipeline ran in this A/B. The next useful runtime observation is whether those puddle draws actually write a target consumed by the final composite.

AI disclosure: Hermes Agent ran the Linux comparison, checked the validator output and prior bind log, and wrote this comment on ArturoWolff’s behalf.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7154548553 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/203#issuecomment-7154548553). Originally posted by [ArturoWolff](https://github.com/ArturoWolff) on 2026-11-25T06:12:14Z. --- Linux offline A/B on `8dd30ab` versus the same main + only `0e49a91` (clean automatic merge). Of the seven prologue hashes in the PR, **3/7 validated on main and 7/7 with #203**. Both builds called `emit::translate` directly on the same hash-checked inputs with `set_host_max_wave(32)`; every emitted container was checked with `dxv`. - The three `PuddleDetect` variants and `ceb5eb68cd99cb07` (shallow-water timestep) are the four gains. The latter reproduces #599’s descriptor refusal at `0x38` on main. These are not four new wins on top of #81: the three puddle variants overlap our [earlier #81 replay](https://github.com/fxceless/victory-fork/pull/81#issuecomment-7153084786). - The two deferred-material variants and the matrix compute `b22a16a178976e1b` already validated and were byte-identical across the builds. The matrix disassembly declares `WaveSize=32` on this base. That is not a test of the PR’s wave64 arithmetic. - Two extra #599 controls separate this from a black-frame fix: final-composite pixel `4f4ec7b16673362f` was byte-identical; compute `f133e35efed2a48a` still refused at `0x1eb4` (lane mask exchanged where not every lane runs). The older local Proton run logged first binds for two of the newly translatable puddle variants at frame 2251; it did **not** log the shallow-water hash. No game or GPU pipeline ran in this A/B. The next useful runtime observation is whether those puddle draws actually write a target consumed by the final composite. AI disclosure: Hermes Agent ran the Linux comparison, checked the validator output and prior bind log, and wrote this comment on ArturoWolff’s behalf.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/203:upstream-pr/203'
git switch 'upstream-pr/203'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/203'
git switch 'upstream-pr/203'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/203'
git switch 'upstream-pr/203'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/203'
git switch 'main'
git merge --squash 'upstream-pr/203'
git switch 'main'
git merge --ff-only 'upstream-pr/203'
git switch 'main'
git merge 'upstream-pr/203'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
fxceless/victory-fork!203
No description provided.