Restore Wave32 lowering for known compute kernels #1450

Merged
Nazzgy merged 1 commit from upstream-pr/1450 into main 2026-11-29 08:16:56 +00:00
Nazzgy commented 2026-11-28 20:13:42 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Nazzgy on 2026-11-28T20:13:42Z.


Problem

The stricter Wave32 LDS analysis from #43 can reject known 64-thread Wave64 compute kernels that previously translated on a 32-lane host. The affected workloads include water, vegetation and decal processing.

Change

Keep ordinary lowering first. When it cannot produce a supported Wave32 shader, retry only the identified compute containers with a scoped write-only LDS policy. The retry still rejects provable overlapping writes, divergent barriers, unknown LDS instructions and unsafe mixed reads and writes. An explicit compatibility setting keeps its existing behavior.

The thread-local guard restores the previous policy before the next translation. The synthetic LDS test also checks restoration and provable write-overlap rejection.

Validation

  • The patch applies directly to upstream main at 923e38c.
  • In the tested build based on that revision, all six saved inputs translated, validated as DXIL and created D3D12 compute pipelines. Five used the scoped retry. The collision kernel already translated through upstream's normal path.
  • The explicit strict control emitted one of the six inputs.
  • The isolated branch passed cargo check and the focused LDS policy test.
  • Validation was offline. No title execution or visual result is claimed.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5544163274 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1450). Originally posted by [Nazzgy](https://github.com/Nazzgy) on 2026-11-28T20:13:42Z. --- ## Problem The stricter Wave32 LDS analysis from #43 can reject known 64-thread Wave64 compute kernels that previously translated on a 32-lane host. The affected workloads include water, vegetation and decal processing. ## Change Keep ordinary lowering first. When it cannot produce a supported Wave32 shader, retry only the identified compute containers with a scoped write-only LDS policy. The retry still rejects provable overlapping writes, divergent barriers, unknown LDS instructions and unsafe mixed reads and writes. An explicit compatibility setting keeps its existing behavior. The thread-local guard restores the previous policy before the next translation. The synthetic LDS test also checks restoration and provable write-overlap rejection. ## Validation - The patch applies directly to upstream main at 923e38c. - In the tested build based on that revision, all six saved inputs translated, validated as DXIL and created D3D12 compute pipelines. Five used the scoped retry. The collision kernel already translated through upstream's normal path. - The explicit strict control emitted one of the six inputs. - The isolated branch passed cargo check and the focused LDS policy test. - Validation was offline. No title execution or visual result is claimed.
ArturoWolff commented 2026-11-28 20:40:14 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ArturoWolff on 2026-11-28T20:40:14Z.


Independent native Linux regression check, on Rust 1.98.1, exact clean base 923e38cc8c92cd1c42090076382138538f2bb487 and exact PR head bf252ea2df586c7deb654ed4bb54759ff32dcc55. Separate build targets, locked dependencies, offline builds, x86-64 Linux:

cargo test --locked --offline --target x86_64-unknown-linux-gnu -p victory-shader --lib emit::lds::tests -- --test-threads=1

Both revisions: 21 passed, 0 failed, 0 ignored, 230 filtered out. The candidate's added scoped-policy restoration and explicit overlap-refusal assertions passed. Both builds reported the same nine native test-build warnings.

One remaining correctness concern: rejecting provable overlap is not the same as demonstrating absence of a hazard for every admitted case. The tests exercise the analysis with a simulated 32-lane host, not the production digest-selection path or results of emitted GPU programs. A title-independent synthetic dispatch with independently calculated expected output would help distinguish successful lowering from correct synchronization and values. It would be particularly useful to retain negative controls for unproven shared writes and hazardous mixed accesses.

We have a separate observed Wave32 refusal on an RTX 4060 (#1475 observation); I cannot match that runtime identifier to the six containers in this PR. No hardware dispatch, title execution, or visual/performance claim from this test.

AI assistance: Hermes Agent, working on behalf of ArturoWolff. (GPT 6.2 Sol High).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7245454560 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1450#issuecomment-7245454560). Originally posted by [ArturoWolff](https://github.com/ArturoWolff) on 2026-11-28T20:40:14Z. --- Independent native Linux regression check, on Rust 1.98.1, exact clean base `923e38cc8c92cd1c42090076382138538f2bb487` and exact PR head `bf252ea2df586c7deb654ed4bb54759ff32dcc55`. Separate build targets, locked dependencies, offline builds, x86-64 Linux: `cargo test --locked --offline --target x86_64-unknown-linux-gnu -p victory-shader --lib emit::lds::tests -- --test-threads=1` Both revisions: **21 passed, 0 failed, 0 ignored, 230 filtered out**. The candidate's added scoped-policy restoration and explicit overlap-refusal assertions passed. Both builds reported the same nine native test-build warnings. One remaining correctness concern: rejecting *provable* overlap is not the same as demonstrating absence of a hazard for every admitted case. The tests exercise the analysis with a simulated 32-lane host, not the production digest-selection path or results of emitted GPU programs. A title-independent synthetic dispatch with independently calculated expected output would help distinguish successful lowering from correct synchronization and values. It would be particularly useful to retain negative controls for unproven shared writes and hazardous mixed accesses. We have a separate observed Wave32 refusal on an RTX 4060 ([#1475 observation](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/1475#issuecomment-7245350225)); I cannot match that runtime identifier to the six containers in this PR. No hardware dispatch, title execution, or visual/performance claim from this test. AI assistance: Hermes Agent, working on behalf of ArturoWolff. (GPT 6.2 Sol High).
CowboyBingus commented 2026-11-28 20:51:14 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by CowboyBingus on 2026-11-28T20:51:14Z.


In #1475, three builder compute programs for the ray-tracing structures are refused on a 32-lane host, in a build of 32ecacfa plus four commits that change nothing in victory-shader (a builder size-copy fix that is off by default, its tests, and a no-foreground test switch), with "no wave32 lowering for this wave64 program". With VICTORY_LDS_WRITE_ONLY_OK=1 they translate and the builder runs (pipelines=53).

Here are their container digests: DXBC bytes 4..20, the Container::digest value that known_write_only_kernel matches on. I read them from the host's known-shaders.bin.

Log hash Container size Digest (bytes 4..20)
e63d22c4def9ba6a 16184 cfde861e43de1388ac25ea24dfcedcd8
28918b7150a7aad5 11052 ba305538e28d414caf39a51a4bc2f308
caa78b8ca62bc3d6 11840 d6353bf6df15ff8ec4aaaec10dbf3974

None of the three is among the 6 digests in known_write_only_kernel in this PR. The same file holds those 6 digests, under log hashes 0e366d15868e17bd, 1f1fbd86759b3da2, 55679a0547649d0b, 5964b734c70b91eb, 89d08e561897d4e5 and caf96a3229145fa6. In the run without the switch reported in #1475, all 6 of those hashes were also logged as "no wave32 lowering for this wave64 program".

How the digests were read:

  • The log hash is the first 16 hex characters of the blake3 hash of the container (pipeline.rs, shader()).
  • A known-shaders.bin record is stage (1 byte), blake3 hash (32), container length (u32 LE), then the container (pipeline/known.rs). The file parsed into 19100 records, ending exactly at the file's length.
  • The digest is data[4..20] of the container (dxbc.rs, Container::parse).
  • The container sizes match the run's first bind ... size= lines for the same three hashes.

Are these three in scope for #1450?

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7245590404 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1450#issuecomment-7245590404). Originally posted by [CowboyBingus](https://github.com/CowboyBingus) on 2026-11-28T20:51:14Z. --- In [#1475](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/1475), three builder compute programs for the ray-tracing structures are refused on a 32-lane host, in a build of 32ecacfa plus four commits that change nothing in victory-shader (a builder size-copy fix that is off by default, its tests, and a no-foreground test switch), with "no wave32 lowering for this wave64 program". With `VICTORY_LDS_WRITE_ONLY_OK=1` they translate and the builder runs (`pipelines=53`). Here are their container digests: DXBC bytes 4..20, the `Container::digest` value that `known_write_only_kernel` matches on. I read them from the host's `known-shaders.bin`. | Log hash | Container size | Digest (bytes 4..20) | |---|---|---| | e63d22c4def9ba6a | 16184 | cfde861e43de1388ac25ea24dfcedcd8 | | 28918b7150a7aad5 | 11052 | ba305538e28d414caf39a51a4bc2f308 | | caa78b8ca62bc3d6 | 11840 | d6353bf6df15ff8ec4aaaec10dbf3974 | None of the three is among the 6 digests in `known_write_only_kernel` in this PR. The same file holds those 6 digests, under log hashes 0e366d15868e17bd, 1f1fbd86759b3da2, 55679a0547649d0b, 5964b734c70b91eb, 89d08e561897d4e5 and caf96a3229145fa6. In the run without the switch reported in [#1475](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/1475), all 6 of those hashes were also logged as "no wave32 lowering for this wave64 program". How the digests were read: - The log hash is the first 16 hex characters of the blake3 hash of the container (`pipeline.rs`, `shader()`). - A `known-shaders.bin` record is stage (1 byte), blake3 hash (32), container length (u32 LE), then the container (`pipeline/known.rs`). The file parsed into 19100 records, ending exactly at the file's length. - The digest is `data[4..20]` of the container (`dxbc.rs`, `Container::parse`). - The container sizes match the run's `first bind ... size=` lines for the same three hashes. Are these three in scope for [#1450](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1450)? 🤖 Generated with [Claude Code](https://claude.com/claude-code)
nick0451 commented 2026-11-28 20:57:04 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nick0451 on 2026-11-28T20:57:04Z.


Tested in play: it fixes a visible regression on current main, missing vegetation.

Setup: RTX 3090 24 GB (driver 610.88), i9-14900K, Windows 11. Release builds of main 923e38c and this PR merged onto it. Series S, DLSS Performance, frame generation off. The same frozen save, outdoors on a balcony by the water, standing still. One warm-up start each, then main and this PR in turn, two rounds. Each run is 40 s to settle, 60 s measured, then a screenshot.

Shaders that don't translate (no wave32 lowering for this wave64 program), distinct per run:

main this PR
count 10 5
fixed by this PR 0e366d15868e17bd, 1f1fbd86759b3da2, 55679a0547649d0b, 5964b734c70b91eb, 89d08e561897d4e5
still failing 18d957e62926ed3e, 21f7ad7863620328, 407eca669212d400, 6b82bc7d22016cb5, 7c9a6a83826cdfac

Picture: on main, the bushes and palms behind the railing (next to the flag) and the potted plant by the door are missing in both runs. With this PR they're drawn again in both, as they were on 63b902f this morning in the same spot. The mean pixel difference between the builds is about 8 against 2 between two runs of the same build. So the stricter analysis drops the vegetation's compute work on current main, and this PR brings it back.

Speed: 23.1 fps (22.0, 24.3) against 25.5 (25.1, 25.9) for main. That fits the vegetation being drawn again; it's not overhead.

No crash, device loss or ERROR line in either build.

Also, 6b82bc7d22016cb5, the program #822 fixed on 63b902f, fails again on 923e38c.

Tested with an AI assistant (Claude Code); results are from this PC.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7245663024 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1450#issuecomment-7245663024). Originally posted by [nick0451](https://github.com/nick0451) on 2026-11-28T20:57:04Z. --- Tested in play: it fixes a **visible regression on current main**, missing vegetation. **Setup:** RTX 3090 24 GB (driver 610.88), i9-14900K, Windows 11. Release builds of main `923e38c` and this PR merged onto it. Series S, DLSS Performance, frame generation off. The same frozen save, outdoors on a balcony by the water, standing still. One warm-up start each, then main and this PR in turn, two rounds. Each run is 40 s to settle, 60 s measured, then a screenshot. **Shaders that don't translate** (`no wave32 lowering for this wave64 program`), distinct per run: | | main | this PR | |---|---|---| | count | 10 | **5** | | fixed by this PR | | `0e366d15868e17bd`, `1f1fbd86759b3da2`, `55679a0547649d0b`, `5964b734c70b91eb`, `89d08e561897d4e5` | | still failing | | `18d957e62926ed3e`, `21f7ad7863620328`, `407eca669212d400`, `6b82bc7d22016cb5`, `7c9a6a83826cdfac` | **Picture:** on main, the bushes and palms behind the railing (next to the flag) and the potted plant by the door are missing in both runs. With this PR they're drawn again in both, as they were on `63b902f` this morning in the same spot. The mean pixel difference between the builds is about 8 against 2 between two runs of the same build. So the stricter analysis drops the vegetation's compute work on current main, and this PR brings it back. **Speed:** 23.1 fps (22.0, 24.3) against 25.5 (25.1, 25.9) for main. That fits the vegetation being drawn again; it's not overhead. No crash, device loss or `ERROR` line in either build. Also, `6b82bc7d22016cb5`, the program #822 fixed on `63b902f`, fails again on `923e38c`. Tested with an AI assistant (Claude Code); results are from this PC.
Nazzgy commented 2026-11-28 21:03:34 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Nazzgy on 2026-11-28T21:03:34Z.


Thanks for the RTX 3090 A/B test and for checking the #1475 digests. The vegetation recovery confirms the regression this PR targets. I’d keep the three RT builder kernels in #1475 for separate validation. Before merging, I’d add a synthetic GPU test that exercises the digest-selected retry, checks its output against an independently computed reference, and includes a case where the retry must still refuse lowering.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7245741393 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1450#issuecomment-7245741393). Originally posted by [Nazzgy](https://github.com/Nazzgy) on 2026-11-28T21:03:34Z. --- Thanks for the RTX 3090 A/B test and for checking the #1475 digests. The vegetation recovery confirms the regression this PR targets. I’d keep the three RT builder kernels in #1475 for separate validation. Before merging, I’d add a synthetic GPU test that exercises the digest-selected retry, checks its output against an independently computed reference, and includes a case where the retry must still refuse lowering.
Hailey-Ross commented 2026-11-28 22:51:26 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Hailey-Ross on 2026-11-28T22:51:26Z.


Tested on Windows: this fixes the missing foliage for me.

On d4b5d51 (main as of today) trees and bushes are missing everywhere, only appearing once I walk into them, with eight compute shaders failing with "no wave32 lowering for this wave64 program is not supported". With bf252ea applied on top, same settings and save, the foliage is back everywhere.

d4b5d51 d4b5d51 + #1450
Compute shaders with "no wave32 lowering" 8 3
Dropped draws a frame (median / 90th percentile) 354 / 523 269 / 389 (35 at the end)
Frame rate, rendered (median) 13.4 fps 13.6 fps
Run 5 min, no errors 12 min, no errors

Fixed: 0e366d15868e17bd, 1f1fbd86759b3da2, 55679a0547649d0b, 5964b734c70b91eb, 89d08e561897d4e5.
Still failing: 21f7ad7863620328, 6b82bc7d22016cb5, 7c9a6a83826cdfac.

RTX 4080 SUPER, driver 621.40, Windows 11 25H2; -Res 4k, DLSS Performance, 2x frame generation. Details in #1499.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7247030511 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1450#issuecomment-7247030511). Originally posted by [Hailey-Ross](https://github.com/Hailey-Ross) on 2026-11-28T22:51:26Z. --- Tested on Windows: this fixes the missing foliage for me. On `d4b5d51` (main as of today) trees and bushes are missing everywhere, only appearing once I walk into them, with eight compute shaders failing with "no wave32 lowering for this wave64 program is not supported". With `bf252ea` applied on top, same settings and save, the foliage is back everywhere. | | `d4b5d51` | `d4b5d51` + #1450 | |---|---|---| | Compute shaders with "no wave32 lowering" | 8 | 3 | | Dropped draws a frame (median / 90th percentile) | 354 / 523 | 269 / 389 (35 at the end) | | Frame rate, rendered (median) | 13.4 fps | 13.6 fps | | Run | 5 min, no errors | 12 min, no errors | Fixed: `0e366d15868e17bd`, `1f1fbd86759b3da2`, `55679a0547649d0b`, `5964b734c70b91eb`, `89d08e561897d4e5`. Still failing: `21f7ad7863620328`, `6b82bc7d22016cb5`, `7c9a6a83826cdfac`. RTX 4080 SUPER, driver 621.40, Windows 11 25H2; `-Res 4k`, DLSS Performance, 2x frame generation. Details in #1499.
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
trustno1-coder/VIctory-NVIDIA!1450
No description provided.