d3d12: add opt-in branch and NaN simplifications for native compute shaders #3197

Closed
ubiquitarianism wants to merge 1 commit from upstream-pr/3197 into main
ubiquitarianism commented 2026-12-02 18:21:31 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by ubiquitarianism on 2026-12-02T18:21:31Z.


Claimed in the coordination issue as: D3D12-NATIVE-COMPUTE-EMPTY-FORWARD-BLOCKS, D3D12-SHADER-RDNA-KNOWN-NON-NAN

What and why

Add two opt-in translation passes for named native D3D12 compute shaders on AMD RDNA adapters that support wave64. The first redirects branches past empty forward blocks with one predecessor and updates the corresponding phi input. The second folds NaN classifications when the input operation guarantees a numeric result. Both shader lists default to empty. The existing FormsFor API, wave options and launcher defaults are preserved. Forward-block claim · NaN claim

Individual shader cache keys distinguish the requested forms. The bulk pipeline warm-up ledger also accounts for the enabled lists. Upgrading follows the normal one-time shader warm-up associated with a changed translator source fingerprint.

On the original experimental build, four matched Boat drives in off/on/on/off order averaged 0.64 more rendered FPS with the forward-block pass on three programs. Isolated GPU timings for those dispatches fell by 1.09 ms/frame while driving. The NaN pass showed no repeatable gameplay gain. The rebased build was verified offscreen.

Tested

  • Built the Windows leonida executable with diagnostics. Compared the ordinary translation of 29,195 local shader inputs against unmodified main at 45dc41f95. All 28,990 translations matched in DXIL and host binding metadata digests. The same 205 inputs were rejected with the same errors.
  • Validated 14 ordinary, individually selected and combined DXIL outputs from four measured compute programs with the Windows SDK validator. For the largest program, verified the fixture bindings and exact results across ten writable views on the RX 6800 with two changing worklists. A deliberately mismatched worklist failed the comparison. Generated exceptional-value cases also passed on the physical adapter and WARP.
  • The full Rust shader run passed 433 tests with 7 ignored. An additional release test exercised the production compute and pixel stage gate. Forcing the ordinary writer and disabling the NaN fold made their two regression tests fail. Removing the compute-stage gate made the new pixel comparison fail. All three passed with the intended implementation.
  • All seven shader-cache tests, 6,792 Python semantic tests across 560 files, the switch-catalog checks and the clean-room scan passed. Independent read-only reviewers audited the diff and the final stage test. The private inputs and test artifacts stayed outside the repository.

GPUs tested: AMD Radeon RX 6800, driver 32.0.21030.2001, Windows 11 Pro build 26200. Microsoft WARP was used for synthetic output equivalence. Additional physical AMD and NVIDIA adapters were unavailable.

AI-assisted: Yes, GPT-6.2 Astra for the implementation, port and independent code reviews.

Checklist

  • Based on upstream main and checked for merge conflicts.
  • Scoped to opt-in native compute shader translation.
  • Clean-room scan passed on all changed files.
  • Translation rules and their verification are documented in docs/design.md.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5612313701 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3197). Originally posted by [ubiquitarianism](https://github.com/ubiquitarianism) on 2026-12-02T18:21:31Z. --- Claimed in the coordination issue as: D3D12-NATIVE-COMPUTE-EMPTY-FORWARD-BLOCKS, D3D12-SHADER-RDNA-KNOWN-NON-NAN ### What and why Add two opt-in translation passes for named native D3D12 compute shaders on AMD RDNA adapters that support wave64. The first redirects branches past empty forward blocks with one predecessor and updates the corresponding phi input. The second folds NaN classifications when the input operation guarantees a numeric result. Both shader lists default to empty. The existing `FormsFor` API, wave options and launcher defaults are preserved. [Forward-block claim](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7330015578) · [NaN claim](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7328310489) Individual shader cache keys distinguish the requested forms. The bulk pipeline warm-up ledger also accounts for the enabled lists. Upgrading follows the normal one-time shader warm-up associated with a changed translator source fingerprint. On the original experimental build, four matched Boat drives in off/on/on/off order averaged 0.64 more rendered FPS with the forward-block pass on three programs. Isolated GPU timings for those dispatches fell by 1.09 ms/frame while driving. The NaN pass showed no repeatable gameplay gain. The rebased build was verified offscreen. ### Tested - Built the Windows `leonida` executable with `diagnostics`. Compared the ordinary translation of 29,195 local shader inputs against unmodified `main` at `45dc41f95`. All 28,990 translations matched in DXIL and host binding metadata digests. The same 205 inputs were rejected with the same errors. - Validated 14 ordinary, individually selected and combined DXIL outputs from four measured compute programs with the Windows SDK validator. For the largest program, verified the fixture bindings and exact results across ten writable views on the RX 6800 with two changing worklists. A deliberately mismatched worklist failed the comparison. Generated exceptional-value cases also passed on the physical adapter and WARP. - The full Rust shader run passed 433 tests with 7 ignored. An additional release test exercised the production compute and pixel stage gate. Forcing the ordinary writer and disabling the NaN fold made their two regression tests fail. Removing the compute-stage gate made the new pixel comparison fail. All three passed with the intended implementation. - All seven shader-cache tests, 6,792 Python semantic tests across 560 files, the switch-catalog checks and the clean-room scan passed. Independent read-only reviewers audited the diff and the final stage test. The private inputs and test artifacts stayed outside the repository. GPUs tested: AMD Radeon RX 6800, driver 32.0.21030.2001, Windows 11 Pro build 26200. Microsoft WARP was used for synthetic output equivalence. Additional physical AMD and NVIDIA adapters were unavailable. AI-assisted: Yes, GPT-6.2 Astra for the implementation, port and independent code reviews. ### Checklist - [x] Based on upstream `main` and checked for merge conflicts. - [x] Scoped to opt-in native compute shader translation. - [x] Clean-room scan passed on all changed files. - [x] Translation rules and their verification are documented in `docs/design.md`.
Kal0s-design commented 2026-12-02 19:38:32 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Kal0s-design on 2026-12-02T19:38:32Z.


Ran natively on Windows 11, head 1616b35e7 merged into current main (f1a559851, clean merge).

Since then main moved to b41763227 (#2888, docs only) and the PR now conflicts with it in d3d12/docs/findings.md. Both add a section at the end of the file, so it needs a rebase. No code changed on main in between.

Switches. LEONIDA_KNOWN_NON_NAN_FOR and LEONIDA_EMPTY_FORWARD_FOR are both empty by default, and both only take effect on an RDNA adapter with wave64 (native_rdna_wave64()). On an NVIDIA card they do nothing at runtime, so my GPU runs reach the passes only through the crate tests, which set the forms directly. The fold can't be switched on through LEONIDA_SHADER_OPT either. shader_opt() is masked with MODULE before bit 512 is added, and Shader::finish is the only non-test caller of optimise.

Switches off give the same bytes as main. I ran the same throwaway hash test in both trees.

Input main merge
random_program seeds 1..600 × {no passes, DEFAULT, ALL}, Module::write(), 3.19 MB 7e9ba333… 7e9ba333…
192 generated compute programs through translate(), all 192 translated (8 producers × 4 compares × RDNA bits on/off × NaN-exact unset/on/off) d8b88b23… d8b88b23…

These are generated inputs, not real shaders. Your 29k-shader comparison covers the real ones.

leonida-shader suite

main merge
card 428 passed, 0 failed, 6 ignored 434 passed, 0 failed, 7 ignored
WARP (LEONIDA_WARP=1) 420 passed, 8 failed, 6 ignored 426 passed, 8 failed, 7 ignored

The difference is the PR's 6 new tests plus its ignored timing test. Under WARP the same 8 tests fail on both sides, so they aren't from this PR. 7 of them fail creating the pipeline ("The parameter is incorrect") and a_lane_mask_joined_with_a_number_is_read_as_the_number_it_is fails its lane-mask assert.

cargo test -p leonida-gpu shader_cache passes 7/7 on the merge, the new selector and warm-key test included. Clippy --all-targets on leonida-shader and leonida-gpu gives the same 6 warnings on main and on the merge, all already in valu_tests.rs.

The new tests don't compile on main since the API is new. To get a real red I turned off the fold and the bypass inside the merge. known_non_nan_changes_only_proven_classifications failed, and so did 3 of the 4 forward tests. The output-word test and the backward-edge test stayed green, which is right because they only assert that nothing changes.

NaN fold, CPU differential. I taught the opt.rs test interpreter dx.op.unary.f32 (Saturate, FAbs), dx.op.binary.f32 (FMin, FMax and one other op) and SiToFp/UiToFp. FMin/FMax there return the non-NaN operand and Saturate(NaN) is 0, which is the D3D rule the PR relies on. So this checks that the pattern match sticks to that rule. It says nothing about what devices do. The random programs mix those producers with float phis, selects, NaN/inf/±0/denormal constants and both operand orders. They emit the exact (bits & 0x7fffffff) > 0x7f800000 check (mask on either side) and near misses (IUGE, SGT, threshold 0x7f7fffff, mask 0xffffffff), fed mostly with special input words.

Run Comparisons Mismatches
PR as is (KNOWN_NON_NAN, KNOWN_NON_NAN|DEAD, ALL|KNOWN_NON_NAN) 288k, 3430 checks folded 0
mutant, min/max always taken as a number 288k 14922
mutant, FAbs always taken as a number 288k 12996
mutant, IUGE accepted too 288k 4632
mutant, mask 0xffffffff accepted 288k 12578

Same on the GPU. I added a few throwaway producers to known_non_nan_preserves_every_output_word. They cover min/max with the constant as the first operand, max(|x|,|x|) with clamp and max(|x|,|y|). I also added 4 more input pairs (sNaN/sNaN, negative sNaN with a denormal, a negative denormal with 0x7fffffff, FLT_MAX with 0xffffffff). Every proven producer folded and max(|x|,|y|) was left alone. Folded and unfolded output words matched on the card and on WARP, and the run printed both device lines, so neither one was skipped.

Empty forward blocks. For random_program seeds 1..1500 × {no passes, DEFAULT, ALL}, I applied the edges forward_blocks returns to a copy (branch targets through to, phi predecessors through from) and ran both in the interpreter. 27000 runs and 29165 bypassed blocks gave 0 differences. The harness catches dropping the from[b] = from[p] update and dropping the single-predecessor check (interpreter panics), and dropping next[p].contains(&h) (542 mismatches). It does not catch dropping the live-phi check, because the generator never makes an empty single-predecessor block with a live phi. Only your empty_forward_keeps_distinct_phi_inputs_and_live_phis covers that. The harness copies the writer's layout steps (reverse postorder, latch folding), so it tests forward_blocks and not the bytes write_with_forward_blocks emits.

This PR doesn't touch x != x, ordered vs unordered float compares, select-on-compare folding, or non-NaN facts through loads or phis. known_non_nan returns false for phis, selects, loads and bitcasts, so nothing there could break.

Conflicts with other open PRs (git merge-tree against this head)

PR Result
#3156, #2800, #2822, #2698, #2661 clean
#3128 the pub use lower::{…} line in emit/mod.rs (both add a name), plus the switches.md count line
#2686 write() in bitcode.rs. It moves the layout and latch folding into helpers, so the bypass has to be wired into the new code, not just merged textually
#3126, #2958, #2834 the switches.md count line
#2580 already conflicts with main

Not checked: RDNA hardware (none here, so the runtime gate never turned on), real game shaders, the cache warm-up ledger in a live run, DXIL validator runs on bypassed output, the ignored timing test, release builds, the rest of leonida-gpu and the other crates, the Python semantic suite beyond test_minmax_f32_payload.py (both tests pass on the merge under unittest, and I didn't check whether the new one is red on main).

GPUs tested: one NVIDIA desktop card + WARP

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7356494540 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3197#issuecomment-7356494540). Originally posted by [Kal0s-design](https://github.com/Kal0s-design) on 2026-12-02T19:38:32Z. --- Ran natively on Windows 11, head `1616b35e7` merged into current `main` (`f1a559851`, clean merge). Since then `main` moved to `b41763227` (#2888, docs only) and the PR now conflicts with it in `d3d12/docs/findings.md`. Both add a section at the end of the file, so it needs a rebase. No code changed on main in between. **Switches.** `LEONIDA_KNOWN_NON_NAN_FOR` and `LEONIDA_EMPTY_FORWARD_FOR` are both empty by default, and both only take effect on an RDNA adapter with wave64 (`native_rdna_wave64()`). On an NVIDIA card they do nothing at runtime, so my GPU runs reach the passes only through the crate tests, which set the forms directly. The fold can't be switched on through `LEONIDA_SHADER_OPT` either. `shader_opt()` is masked with `MODULE` before bit 512 is added, and `Shader::finish` is the only non-test caller of `optimise`. **Switches off give the same bytes as main.** I ran the same throwaway hash test in both trees. | Input | main | merge | | --- | --- | --- | | `random_program` seeds 1..600 × {no passes, DEFAULT, ALL}, `Module::write()`, 3.19 MB | `7e9ba333…` | `7e9ba333…` | | 192 generated compute programs through `translate()`, all 192 translated (8 producers × 4 compares × RDNA bits on/off × NaN-exact unset/on/off) | `d8b88b23…` | `d8b88b23…` | These are generated inputs, not real shaders. Your 29k-shader comparison covers the real ones. **leonida-shader suite** | | main | merge | | --- | --- | --- | | card | 428 passed, 0 failed, 6 ignored | 434 passed, 0 failed, 7 ignored | | WARP (`LEONIDA_WARP=1`) | 420 passed, 8 failed, 6 ignored | 426 passed, 8 failed, 7 ignored | The difference is the PR's 6 new tests plus its ignored timing test. Under WARP the same 8 tests fail on both sides, so they aren't from this PR. 7 of them fail creating the pipeline ("The parameter is incorrect") and `a_lane_mask_joined_with_a_number_is_read_as_the_number_it_is` fails its lane-mask assert. `cargo test -p leonida-gpu shader_cache` passes 7/7 on the merge, the new selector and warm-key test included. Clippy `--all-targets` on leonida-shader and leonida-gpu gives the same 6 warnings on main and on the merge, all already in `valu_tests.rs`. The new tests don't compile on main since the API is new. To get a real red I turned off the fold and the bypass inside the merge. `known_non_nan_changes_only_proven_classifications` failed, and so did 3 of the 4 forward tests. The output-word test and the backward-edge test stayed green, which is right because they only assert that nothing changes. **NaN fold, CPU differential.** I taught the opt.rs test interpreter `dx.op.unary.f32` (Saturate, FAbs), `dx.op.binary.f32` (FMin, FMax and one other op) and SiToFp/UiToFp. FMin/FMax there return the non-NaN operand and Saturate(NaN) is 0, which is the D3D rule the PR relies on. So this checks that the pattern match sticks to that rule. It says nothing about what devices do. The random programs mix those producers with float phis, selects, NaN/inf/±0/denormal constants and both operand orders. They emit the exact `(bits & 0x7fffffff) > 0x7f800000` check (mask on either side) and near misses (IUGE, SGT, threshold `0x7f7fffff`, mask `0xffffffff`), fed mostly with special input words. | Run | Comparisons | Mismatches | | --- | --- | --- | | PR as is (`KNOWN_NON_NAN`, `KNOWN_NON_NAN\|DEAD`, `ALL\|KNOWN_NON_NAN`) | 288k, 3430 checks folded | 0 | | mutant, min/max always taken as a number | 288k | 14922 | | mutant, FAbs always taken as a number | 288k | 12996 | | mutant, IUGE accepted too | 288k | 4632 | | mutant, mask `0xffffffff` accepted | 288k | 12578 | **Same on the GPU.** I added a few throwaway producers to `known_non_nan_preserves_every_output_word`. They cover min/max with the constant as the first operand, `max(|x|,|x|)` with clamp and `max(|x|,|y|)`. I also added 4 more input pairs (sNaN/sNaN, negative sNaN with a denormal, a negative denormal with `0x7fffffff`, FLT_MAX with `0xffffffff`). Every proven producer folded and `max(|x|,|y|)` was left alone. Folded and unfolded output words matched on the card and on WARP, and the run printed both device lines, so neither one was skipped. **Empty forward blocks.** For `random_program` seeds 1..1500 × {no passes, DEFAULT, ALL}, I applied the edges `forward_blocks` returns to a copy (branch targets through `to`, phi predecessors through `from`) and ran both in the interpreter. 27000 runs and 29165 bypassed blocks gave 0 differences. The harness catches dropping the `from[b] = from[p]` update and dropping the single-predecessor check (interpreter panics), and dropping `next[p].contains(&h)` (542 mismatches). It does not catch dropping the live-phi check, because the generator never makes an empty single-predecessor block with a live phi. Only your `empty_forward_keeps_distinct_phi_inputs_and_live_phis` covers that. The harness copies the writer's layout steps (reverse postorder, latch folding), so it tests `forward_blocks` and not the bytes `write_with_forward_blocks` emits. This PR doesn't touch `x != x`, ordered vs unordered float compares, select-on-compare folding, or non-NaN facts through loads or phis. `known_non_nan` returns false for phis, selects, loads and bitcasts, so nothing there could break. **Conflicts with other open PRs** (`git merge-tree` against this head) | PR | Result | | --- | --- | | #3156, #2800, #2822, #2698, #2661 | clean | | #3128 | the `pub use lower::{…}` line in `emit/mod.rs` (both add a name), plus the `switches.md` count line | | #2686 | `write()` in `bitcode.rs`. It moves the layout and latch folding into helpers, so the bypass has to be wired into the new code, not just merged textually | | #3126, #2958, #2834 | the `switches.md` count line | | #2580 | already conflicts with main | Not checked: RDNA hardware (none here, so the runtime gate never turned on), real game shaders, the cache warm-up ledger in a live run, DXIL validator runs on bypassed output, the ignored timing test, release builds, the rest of leonida-gpu and the other crates, the Python semantic suite beyond `test_minmax_f32_payload.py` (both tests pass on the merge under `unittest`, and I didn't check whether the new one is red on main). GPUs tested: one NVIDIA desktop card + WARP AI-assisted: yes (Claude Code).
lixonik commented 2026-12-02 20:10:06 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-02T20:10:06Z.


Verified PR #3197 (1616b35e7) merged cleanly onto main (f1a559851) on native Windows 10 x64 (Rust 1.98.1):

  • Clean-room & switch-table checks:
    • python -I scripts/check_no_game_data.py PASS.
    • python -I tools/d3d12_switches.py --check d3d12/docs/switches.md PASS.
  • Shader unit tests (LEONIDA_DXIL=none): cargo test -p leonida-shader --lib --locked emit::bitcode:: -- 31 passed, 0 failed, 1 ignored (3.02 s).
  • Note: GitHub currently flags a merge conflict against the newest main head past f1a559851, so a rebase/merge onto latest main will be needed before merge.

Verdict: PASS on bitcode unit tests (needs rebase onto latest main; dxil.dll skipped on this Win10 19041 SDK host).

AI-assisted: yes (Antigravity).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7357318603 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3197#issuecomment-7357318603). Originally posted by [lixonik](https://github.com/lixonik) on 2026-12-02T20:10:06Z. --- Verified PR #3197 (`1616b35e7`) merged cleanly onto `main` (`f1a559851`) on native Windows 10 x64 (Rust 1.98.1): - **Clean-room & switch-table checks:** - `python -I scripts/check_no_game_data.py` PASS. - `python -I tools/d3d12_switches.py --check d3d12/docs/switches.md` PASS. - **Shader unit tests (`LEONIDA_DXIL=none`):** `cargo test -p leonida-shader --lib --locked emit::bitcode::` -- **31 passed, 0 failed, 1 ignored** (3.02 s). - **Note:** GitHub currently flags a merge conflict against the newest `main` head past `f1a559851`, so a rebase/merge onto latest `main` will be needed before merge. Verdict: **PASS** on bitcode unit tests (needs rebase onto latest `main`; `dxil.dll` skipped on this Win10 19041 SDK host). AI-assisted: yes (Antigravity).
fiestorra commented 2026-12-02 21:17:06 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-02T21:17:06Z.


VERIFY-3197 — Windows nativo: el código pasa; el PR está en conflicto con main y su test semántico no ejercita lo que cambia

Head 1616b35e7
Merge base 45dc41f95
Estado en GitHub mergeStateStatus: DIRTY, mergeable: CONFLICTING

The PR does not merge as it stands: d3d12/docs/findings.md conflicts because main added 19 lines there since the merge base (git merge-tree lists the three stages). It needs a rebase — the code files merge cleanly, only the doc collides.

Ran (worktree at main, the PR merged with the doc conflict resolved to the PR's side, so the code is what it claims):

cargo test -p leonida-shader              434 passed; 0 failed; 7 ignored   (9.3 min)
cargo test -p leonida-gpu --lib           703 passed; 1 failed; 59 ignored
python -I scripts/run_semantic_tests.py tests/semantic -p 'test_minmax_*.py'
                                          1 files, 2 tests, 0 files failed

The one leonida-gpu failure is this machine's, unchanged all day (views_are_made_beside_the_heap_and_copied_in, the iGPU artefact of D3D12CreateDevice(None, ..) that #2995 addresses).

What the new semantic test actually exercises — worth knowing

tests/semantic/test_minmax_f32_payload.py calls rdna2spirv.translate(...) — the Python translator, not leonida-shader. This PR touches no Python translator file: it adds the fixture and the test, which pin the Python implementation's NaN-payload behaviour rather than exercise the Rust change. That is a useful pin (the two implementations should agree), but it is not a test of this diff, and I would say so in the body rather than let it read as one.

The Rust side is covered by the crate's own tests (forward_tests.rs, known_non_nan_tests.rs, 434 passing), which is where the change lives.

The red side I could not construct, said plainly

  • Reverting emit/bitcode/opt.rs alone does not compile — the new code references KNOWN_NON_NAN from that file, so the feature is spread across the files a revert would remove.
  • My synthetic control (setting KNOWN_NON_NAN = 0) changed nothing in the semantic test — which is the finding above: that test does not run the Rust path. So I have no working red side for this PR on this machine, only the suite passing.

What I could not test

  • A real shader: no game run; the crate's tests translate fixtures.
  • The payload behaviour on a GPU: known_non_nan_tests are compile-time IR tests.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7359060162 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3197#issuecomment-7359060162). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-02T21:17:06Z. --- ## VERIFY-3197 — Windows nativo: el código pasa; **el PR está en conflicto con `main`** y su test semántico no ejercita lo que cambia | | | |---|---| | Head | `1616b35e7` | | Merge base | `45dc41f95` | | Estado en GitHub | **`mergeStateStatus: DIRTY`, `mergeable: CONFLICTING`** | **The PR does not merge as it stands**: `d3d12/docs/findings.md` conflicts because `main` added 19 lines there since the merge base (`git merge-tree` lists the three stages). **It needs a rebase** — the code files merge cleanly, only the doc collides. **Ran** (worktree at `main`, the PR merged with the doc conflict resolved to the PR's side, so the code is what it claims): ``` cargo test -p leonida-shader 434 passed; 0 failed; 7 ignored (9.3 min) cargo test -p leonida-gpu --lib 703 passed; 1 failed; 59 ignored python -I scripts/run_semantic_tests.py tests/semantic -p 'test_minmax_*.py' 1 files, 2 tests, 0 files failed ``` The one `leonida-gpu` failure is this machine's, unchanged all day (`views_are_made_beside_the_heap_and_copied_in`, the iGPU artefact of `D3D12CreateDevice(None, ..)` that #2995 addresses). ## What the new semantic test actually exercises — worth knowing `tests/semantic/test_minmax_f32_payload.py` calls `rdna2spirv.translate(...)` — **the Python translator**, not `leonida-shader`. This PR touches **no Python translator file**: it adds the fixture and the test, which **pin the Python implementation's NaN-payload behaviour** rather than exercise the Rust change. That is a useful pin (the two implementations should agree), but it is **not** a test of this diff, and I would say so in the body rather than let it read as one. **The Rust side is covered by the crate's own tests** (`forward_tests.rs`, `known_non_nan_tests.rs`, 434 passing), which is where the change lives. ## The red side I could not construct, said plainly - **Reverting `emit/bitcode/opt.rs` alone does not compile** — the new code references `KNOWN_NON_NAN` from that file, so the feature is spread across the files a revert would remove. - **My synthetic control (setting `KNOWN_NON_NAN = 0`) changed nothing in the semantic test** — which is the finding above: that test does not run the Rust path. So I have **no working red side for this PR on this machine**, only the suite passing. ## What I could not test - **A real shader**: no game run; the crate's tests translate fixtures. - **The payload behaviour on a GPU**: `known_non_nan_tests` are compile-time IR tests. Written with an AI assistant.
MoonEyes commented 2026-12-02 22:00:38 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T22:00:38Z.


This pull request touches the render path, so it needs an in-game run before it can be merged: unit tests and CI do not catch rendering regressions (a device loss after an earlier merge is why this gate exists).

Could you, or anyone with a working setup, post a run report on the current head merged onto current main:

  • the head SHA and the main SHA it was merged onto;
  • GPU, driver and OS;
  • at least 300 s in the world after loading;
  • device lost / crashes (count), and rendered fps (median) if you have them;
  • the same run on main alone for comparison, if you can.

Please do not attach logs or screenshots that show game content. If a run on this exact head is already posted, a link to it in a reply is enough.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7360095882 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3197#issuecomment-7360095882). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T22:00:38Z. --- This pull request touches the render path, so it needs an in-game run before it can be merged: unit tests and CI do not catch rendering regressions (a device loss after an earlier merge is why this gate exists). Could you, or anyone with a working setup, post a run report on the **current head** merged onto current `main`: - the head SHA and the `main` SHA it was merged onto; - GPU, driver and OS; - at least 300 s in the world after loading; - device lost / crashes (count), and rendered fps (median) if you have them; - the same run on `main` alone for comparison, if you can. Please do not attach logs or screenshots that show game content. If a run on this exact head is already posted, a link to it in a reply is enough. AI-assisted (Claude Code).
fiestorra commented 2026-12-03 10:22:41 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T10:22:41Z.


#3197 rebasada y empujada: pr-3197-rebased = b5113ac83 — las dos secciones de findings.md eran distintas y los dos crates pasan

El conflicto era un bloque, y las dos mitades son contenido distinto:

HEAD   ## Table constant buffers filled once per list (2026-12-01)
suyo   ### Two opt-in native compute translations on the RX 6800 (2026-12-01)
       → mismo título: False → se quedan las dos

Y los números del rebase, con los dos crates que toca:

rebase sobre d9b618f10           exit 0 · 0 marcadores · 15 files changed, +590/−39
cargo test -p leonida-gpu --lib  716 passed; 1 failed; 59 ignored   (el 1 es la iGPU)
cargo test -p leonida-shader     435 passed; 0 failed; 7 ignored    (619 s)

Y el shader sube a 435 desde los 429 de main — seis tests nuevos, y el árbol está a 0 commits de main, así que la comparación es entre lo mismo.

Lo que no verifiqué: las dos traducciones nativas de cómputo sobre una RX 6800 (eso es el hallazgo del documento, y aquí no hay AMD RDNA). Lo que sí: que su documentación se une sin perder ninguna de las dos entradas y que los dos crates que toca compilan y pasan sus tests.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7375144246 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3197#issuecomment-7375144246). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-03T10:22:41Z. --- ## `#3197` rebasada y empujada: `pr-3197-rebased` = `b5113ac83` — **las dos secciones de `findings.md` eran distintas y los dos crates pasan** **El conflicto era un bloque, y las dos mitades son contenido distinto**: ``` HEAD ## Table constant buffers filled once per list (2026-12-01) suyo ### Two opt-in native compute translations on the RX 6800 (2026-12-01) → mismo título: False → se quedan las dos ``` **Y los números del rebase, con los dos crates que toca**: ``` rebase sobre d9b618f10 exit 0 · 0 marcadores · 15 files changed, +590/−39 cargo test -p leonida-gpu --lib 716 passed; 1 failed; 59 ignored (el 1 es la iGPU) cargo test -p leonida-shader 435 passed; 0 failed; 7 ignored (619 s) ``` **Y el shader sube a `435` desde los `429` de `main`** — **seis tests nuevos, y el árbol está a 0 commits de `main`, así que la comparación es entre lo mismo.** **Lo que no verifiqué**: **las dos traducciones nativas de cómputo sobre una RX 6800** (**eso es el hallazgo del documento, y aquí no hay AMD RDNA**). **Lo que sí: que su documentación se une sin perder ninguna de las dos entradas y que los dos crates que toca compilan y pasan sus tests.**
MoonEyes commented 2026-12-03 18:03:10 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-03T18:03:10Z.


Thanks for the work on this. This pull request has a merge conflict with the current main and has had no new commit, comment or review for more than 5 hours, so I am closing it to keep the list of open pull requests manageable. This is not a judgement of the change. Whenever you like, merge the latest main into your branch, resolve the conflict, and reopen it (or open a new pull request that links this one). Please re-run the relevant tests on the new head; a reviewer will look at it when time allows, with no guarantee of timing or outcome.


Generated by Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7387519896 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3197#issuecomment-7387519896). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-03T18:03:10Z. --- Thanks for the work on this. This pull request has a merge conflict with the current `main` and has had no new commit, comment or review for more than 5 hours, so I am closing it to keep the list of open pull requests manageable. This is not a judgement of the change. Whenever you like, merge the latest `main` into your branch, resolve the conflict, and reopen it (or open a new pull request that links this one). Please re-run the relevant tests on the new head; a reviewer will look at it when time allows, with no guarantee of timing or outcome. --- _Generated by [Claude Code](https://claude.ai/code)_

Pull request closed

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
ProjectLeonida/mandy!3197
No description provided.