Repository navigation
d3d12 shader: find the wave sections after an unmatched saveexec (D3D12-SHADER-WAVE-SECTIONS-PAST-UNMATCHED-SAVEEXEC) - #2710
Conversation
wave::sections() looks in a block for whole-wave sections: a saveexec of
every lane, the code under it, and the EXEC restore that ends it. When a
saveexec's restore was not in the block (it lies in a later one), the scan
stopped there (`let Some(end) = end else { break; }`), so every whole-wave
section later in the same block was missed and its reduction translated
the general way instead of as the section's shape. Such a saveexec is no
section; the scan now goes on past it.
Test: an_unmatched_saveexec_leaves_the_later_sections_of_its_block puts an
unmatched s_or_saveexec_b64 before the wave64 OR reduction the other tests
use and expects that section and its shape at index 1. On main it fails
("the section after an unmatched saveexec", left None).
Port of shh's fix and test in the sibling VIctory tree (TaynanGT/Vice-Tay
17e3e2c, GPL-3.0). The shader cache key covers leonida-shader/src, so
cached translations are made again.
Co-Authored-By: shh <marek8788@proton.me>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Verified by OreoFR on macOS 27.2.1, Apple M5, Rust 1.98.1,
Not covered: the effect on real shaders (how many translations change, DXIL validation, the image); this is the unit test only. AI-assisted: Claude Code |
|
Independent Linux and Wine verification of
CPU-only synthetic tests. AI-assisted with OpenAI Codex. |
|
@Kal0s-design could you merge current OreoFR's and merzleckeier's results are on AI-assisted: yes |
|
Done: merged AI-assisted: yes |
|
@OreoFR @merzleckeier could one of you run your red/green again on the new head AI-assisted: yes |
|
Independent red/green and native RTX 4090 check of the updated head
The test inputs were synthetic. The barrier count is for this case, and runtime timing remains unmeasured. AI-assisted with OpenAI Codex (GPT-6.2 Sol). |
|
RUN - in-game gate (Verified by OreoFR), PROVISIONAL - RTX 4070 Laptop 8 GB, NVIDIA 621.40, Windows 11.
Result: PASS - 0 device loss, 0 panics, every run alive at the end (cold run included).
This run was AI-assisted (Claude Code, oreofr-agent). |
|
Merging. Head AI-assisted (Claude Code). |
Claimed in the coordination issue as: D3D12-SHADER-WAVE-SECTIONS-PAST-UNMATCHED-SAVEEXEC (#2570 (comment))
What and why
emit::wave::sections()finds a block's whole-wave sections: a saveexec of every lane, the code under it, and the EXEC restore that ends it. Their reductions are then lowered from the recognised shape (Shape::Activeand friends). When a saveexec's restore is not in the block (the restore lies in a later block), the scan stopped right there:Every whole-wave section later in that block was then missed, and its reduction was translated the general way instead of from its shape. Such a saveexec is no section, so the scan now skips it (
i += 1; continue;) and keeps looking.This is a port of shh's fix and test from the sibling VIctory tree (TaynanGT/Vice-Tay
17e3e2c, GPL-3.0), credited as co-author. That tree took it from an earlier Leonida commit that never reached this repository. The test is unchanged: it puts an unmatcheds_or_saveexec_b64in front ofWAVE_OR_V7_TO_S7.No translator version bump is needed:
leonida-gpu/build.rsfingerprintsleonida-shader/src, so cached translations are made again.Tested
emit::wave::tests::an_unmatched_saveexec_leaves_the_later_sections_of_its_blockexpects the OR section and its shape at index 1 after an unmatched saveexec, and no section at index 0. Onmain(012b79a) it fails withthe section after an unmatched saveexec(leftNone); with the change it passes.cargo test -p leonida-shader --lib: 386 passed, 0 failed, 4 ignored.cargo clippy -p leonida-shader --all-targets: no warning inwave.rs.GPUs tested: n/a (CPU unit tests)
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: this fixes the section scan, not an instruction's semantics)🤖 Generated with Claude Code