d3d12-shader: preserve non-EXEC writelanes and full/exempt LDS in paired Wave64 form (D3D12-SHADER-PAIRED-MULTI-BARRIER-EXACTNESS) #3262
Open
github-bot
wants to merge 3 commits from
github-bot/gh-3262 into main
AGit
pull from: github-bot/gh-3262
merge into: github:main
github:main
github:perf/darner-title-priority-ceiling
github:gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
github:gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
github:gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
github:gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
github:gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
github:gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
github:gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
github:fix/runtime-test-conservative-fixtures
github:ci/shard-semantic-linux
github:docs/fg-limit-fps-switch
github:fix/runtime-test-fixture-paths
github:fix/runtime-test-fixture-readers
github:fix/read-file-hard-link
github:fix/book-slot-heap-never-read
github:fix/depth-resolve-spv-path
github:fix/indirect-unused-batched
github:gh-pr/3358/base
github:fix/xmem-refusal-diagnostics
github:gh-pr/3357/base
github:ci/shorten-ci-time
github:fix/alias-later-queued-submissions
github:claude/gallant-sagan-aamatr
github:gh-pr/3342/base
github:gh-pr/3341/base
github:d3d12/agility-sdk-621
github:gh-pr/3293/base
github:gh-pr/3319/base
github:gh-pr/3318/base
github:gh-pr/3315/base
github:gh-pr/3313/base
github:gh-pr/3314/base
github:claude/fervent-curie-m19lnr
github:gh-pr/3216/base
github:gh-pr/3272/base
github:gh-pr/3276/base
github:gh-pr/3279/base
github:gh-pr/3257/base
github:gh-pr/3258/base
github:gh-pr/3271/base
github:codex/skip-no-hit-ray-passes
github:gh-pr/3230/base
github:gh-pr/3266/base
github:gh-pr/3247/base
github:gh-pr/3246/base
github:gh-pr/3244/base
github:claude/sharp-sagan-1jqnp3
github:t3/preserve-fsr-sdk-restart-path
github:t3/propagate-host-failure-hresult
github:t3/launcher-custom-parameters
github:t3/series-x-2160-startup
github:codex/d3d12-uncapped-simulation
github:ci/less-to-run
github:perf/native-compute-shader-forms
github:claude/blissful-franklin-ukp7ag
github:codex/full-precompile-default
github:gh-pr/3166/base
github:gh-pr/3148/base
github:gh-pr/3138/base
github:gh-pr/3106/base
github:gh-pr/3057/base
github:gh-pr/2756/base
github:gh-pr/2812/base
github:gh-pr/3032/base
github:gh-pr/2992/base
github:notes/card-time-and-plant-flicker
github:gh-pr/2986/base
github:gh-pr/3000/base
github:gh-pr/2966/base
github:gh-pr/2924/base
github:gh-pr/726/base
github:gh-pr/2761/base
github:gh-pr/2663/base
github:gh-pr/2861/base
github:gh-pr/2862/base
github:gh-pr/2820/base
github:gh-pr/2811/base
github:gh-pr/2803/base
github:rt-call-trace
github:gh-pr/2802/base
github:gh-pr/2766/base
github:perf/ahead-split
github:gh-pr/2589/base
github:gh-pr/2699/base
github:gh-pr/2696/base
github:docs/readme-runtime-proposal
github:gh-pr/1346/base
github:codex/coord-claim-check-20261124-7e48
No reviewers
Labels
Clear labels
accessibility
Barrier affecting people with disabilities
area: ci
.github/ workflows and settings
area: d3d12
The D3D12 runtime in d3d12/ (Rust: leonida.exe and its crates)
area: docs
Documentation
area: launcher
The launcher (launcher/)
area: runtime (legacy)
The earlier Vulkan runtime in runtime/
area: shader translator
The shader translator (leonida-shader, tools/rdna2spirv) and its tests
area: tools
tools/ and scripts/
area: viewer
The map viewer (viewer/)
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
invalid
This doesn't seem right
missing claim
Needs a claim in #14
needs in-game run
Changes the code a frame runs through: needs the 300 s in-game gate (docs/game_gate.md)
needs rebase
Conflicts with the base branch: rebase it on main
needs-triage
Needs maintainer evaluation before the next triage state
question
Further information is requested
ready-for-agent
Fully specified and ready for an AFK agent
submodules
Pull requests that update submodules code
wontfix
This will not be worked on
No labels
accessibility
area: ci
area: d3d12
area: docs
area: launcher
area: runtime (legacy)
area: shader translator
area: tools
area: viewer
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs in-game run
needs rebase
needs-triage
question
ready-for-agent
submodules
wontfix
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!3262
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3262"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@zmasi on GitHub · 2026-12-02 23:12 UTC · original
zmasi:fix/d3d12-shader-paired-multi-barrier-exactness→main· +1847 −41 · 8 files · 3 commits · openClaimed in the coordination issue as:
D3D12-SHADER-PAIRED-MULTI-BARRIER-EXACTNESS(#2570)
What and why
@enlight3d found that naming six heavy compute programs in
LEONIDA_PAIRED_FORchanges the picture, although thepaired form is described as exact (#2570, #issuecomment-7352754262). The paired form runs console lanes
nandn + 32in host threadn. I ran it beside the split form on an RTX 3090, each form from its own entry point, againsta 64-lane model of the console's wave. The programs were hand-written ones and 300 seeded random ones: ballots as
numbers and through the 64-bit scalar operations, counts, ranks, first-lane and lane reads and writes, the compiler's
DPP reductions and prefix sums, permlanes, a DPP row mask, and EXEC counted with its SCC. They ran under lane branches,
scalar branches and loops that lanes leave apart, in groups of one to sixteen console waves, with multi-barrier LDS
rounds. Three things the paired form did not keep. Each test fails before its fix and passes now:
v_writelane_b32to a lane outside EXEC was lost. The instruction writes the lane it names whatever EXEC is(
docs/design.md, "Lane select"). The form guarded it like a lane's own write. It is now lowered for both lanes ofthe thread without the guard (
paired_cross).LEONIDA_LDS_BOUNDS_EXEMPT, by default the face programs) were held to theirheader's LDS in the paired form. That form checks every access against the group's own array: past the header a
read gave 0 and a write was dropped. That is what left the faces undrawn before the exemption. Such a program now
has the group's 32 KiB in this form. A header that gives more than 32 KiB is still refused, named or not.
With these fixes, all 300 random programs match the model in the paired form. Half of them use everything the
generator has. The other half are held to what the split form keeps; 141 of those 150 also match in the split form,
which refuses the other 9.
Recorded in
d3d12/docs/findings.mdand left as it is, since all of it is outsidepaired.rs:s_mov_b32, as a64-bit constant is loaded) is wrong in lanes 32–63 (
structure.rs'smaskshortcut). The split form refuses thesame program.
s_wqm_b64gives every lane.fi0, and ads_swizzle_b32source lane outside EXEC, are read as theyare.
The paired form is exact for every one of the split form's programs.
Not measured in the game. The six programs of the report are not named by hash there, so which of these each one hit
is open. Naming them in
LEONIDA_PAIRED_FORagain on this change, at the same shot, is the check.Tested
d3d12/crates/leonida-shader/src/emit/paired/:lane_tests.rs:barrier_tests.rs:fuzz_tests.rs: 36 seeded programs in the suite (300 in a sweep), shrunk when one goes wrong.differential_tests.rs: the shared harness. The paired form is judged first, so a split-form fault never leavesit unjudged.
main, green here: the writelane, full-32-KiB and named-LDS tests, and the fuzz test. Checked by hand (thechange's production files reverted) and with
python -I scripts/red_green.py: verdict "red then green", those 4tests red then green. The other new tests pass on
maintoo: they check behaviour this change keeps.cargo test --locked -p leonida-shader(x86_64-pc-windows-msvc): 440 passed, 0 failed, 6 ignored.cargo clippy --locked -p leonida-shader --all-targets --no-deps: no warning in the touched files.cargo xtask policy: no violation in the touched files (the three it reports are onmain).python -I scripts/check_no_game_data.py,python -I tests/test_text_write_line_endings.py,python -I tests/test_docs_design_rows.py,python -m unittest discover -s tests -p "test_docs_*.py": pass.GPUs tested: NVIDIA GeForce RTX 3090 24 GB, driver 610.88, Windows 11 Pro 10.0.26200 (Microsoft WARP has no 32-lane
waves, so it skips these tests).
AI-assisted: yes.
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (No new rule:the writelane fix applies the existing "Lane select" row.)
The paired form (one host thread runs console lanes n and n + 32) ran beside the split form on an RTX 3090 (driver 610.88), both against a 64-lane model of the console's wave: hand- written programs and seeded random ones. Three things it did not keep, each failing before and passing now: - v_writelane_b32 to a lane outside EXEC was lost: the form guarded it like a lane's own write. It now writes the lane its select names (S1[5:0]) whatever EXEC is, as the "Lane select" row of docs/design.md says. - A program named in LEONIDA_LDS_BOUNDS_EXEMPT (the face programs) was held to its header's LDS all the same, since the form bounds every access: past the header a read gave 0 and a write was dropped. It now has the group's 32 KiB; a header that gives more is refused, as before. - A group of several waves using all 32 KiB of LDS was refused for a counter dword the form no longer keeps. Tests: emit/paired/{lane,barrier,fuzz,differential}_tests.rs, each form from its own entry point, against the model; the random programs are shrunk when one goes wrong. d3d12/docs/ findings.md: what the runs showed, with what is not the paired form's, left as it is (the split form's lane writes, lane selects past 63 and per-lane scalars; in both forms a mask made of two 32-bit writes and the host's order of f32 sums). AI-assisted: GPT-6.2 Astra (author; the LaneGpu tests), GPT-6.2 Sol (LaneAudit, read-only), Claude Fable 5.2 (ControlAudit, read-only; the BarrierGpu tests), Claude Opus 5.5 (separate read-only reviewer, two passes).@merzleckeier on GitHub · 2026-12-02 23:18 UTC · original · reviewed
Independent translation check on
3643c2879with Rust 1.98.1 on Linux. I reused the PR’s synthetic two-wave fixture and called the paired emitter directly with a 32-lane host selection.lds_unbounded=trueemits byte-identical DXIL to the same shader with an explicit 32 KiB header. The ordinary 512-byte translation emits different DXIL, so the comparison exercises the allocation change.Both probes fail with only
emit/mod.rsrestored frommain(ef35d683e). The Linux shader unit suite plus the two probes passed 256, with two ignored. The checks were limited to translation and emitted bytes. The paired dispatch results, including the EXEC-disabledv_writelane_b32case, remain GPU coverage.git diff --checkpassed and the PR also merges cleanly with #3215. AI-assisted.@MoonEyes on GitHub · 2026-12-03 00:02 UTC · original
RUN (in game, batch of nine pull requests), each head merged with
git merge --no-ffonto main81efe4566, in one build: #313674bd1bcd4, #315653c3100ce, #3206d024194b3, #3248efd21d867, #3256e7aad1d4c, #32623643c2879, #2851b83b0b375, #312589bf1d328, #2642164506d01. RTX 4060 8 GB, driver 610.88, Windows 11. Series S,-Resolution 1080, frame generation 2x,-PrecompileUsed, the same walking route as the other runs on this machine, 330 s after reaching the world.For reference, the same machine and route rendered 13.3 to 17.2 fps on other batches in the last day. These fps are a check that nothing fell over, not a measurement of a gain.
Verdict: PASS for the in-game gate (300 s or more in the world, no device loss) for this batch, on the heads listed above. If one of these pull requests changes its head, this run no longer covers it.
Limits: one run; arrival in the world was driven by keys and not checked on pictures;
-PrecompileUsedwas used, so the default start (every known pipeline precompiled) was not exercised. The precompile before the world took 619 s, against 157 s for the previous batch; the shader-side changes in this batch (#3156, #3262) probably left the pipeline cache cold (not checked). Switches that are off by default (for example #2851'sLEONIDA_TITLE_MEMORY_SCALE, #3136's timeline attribution) were not turned on: this run covers their default path only. #2642 targets Wine and was run on Windows only.AI-assisted (Claude Code).
@fiestorra on GitHub · 2026-12-03 00:05 UTC · original
VERIFY-3262 — Windows nativo: las pruebas de carriles pasan; el control no lo establecí, y digo dónde me quedé
f447deddb—emit/paired/lane_tests.rs(+144),emit/paired/differential_tests.rs(19)Ran at the head
The tests are a small ISA program each —
s_mov_b64,s_bcnt1_i32_b64,s_ff1_i32_b64,s_cselect_b32,s_cbranch_scc0,v_add_nc_u32— run through the wave emulator for cases[0,0],[0x8000_0000, 0],[0, 0x8000_0001],[1,1]… i.e. "no lane, lane 31, lanes 32 and 63, lanes 0 and 32, a mix, all". That is testing the semantics ofexecon a 64-lane wave by writing programs whose answers are known, which is the right way to tests_bcnt1/s_ff1/s_cselectsteering.And the control: I do not have one. I found the tests and the emulator's neighbourhood (
emit/wave.rs,halves.rs), but not a single line I could flip that the three new tests would catch inside the time this pass allowed. I would rather say that than dress up "the tests passed" as "the change is verified" — the difference between those two sentences is the whole point of the last few hours.What I can say: the new tests are in the diff, they pass on this machine, and the
differential_tests.rschange (19 lines) suggests they are paired against the differential oracle — which, for lane semantics, is the strongest arrangement available without a card.What I could not test
v_readfirstlane/DPP behaviour on real hardware, which is what the paired form is compiled for.Written with an AI assistant.
@x2Tweek on GitHub · 2026-12-03 01:16 UTC · original
RUN (in game, RTX 5090 32 GB, hardware RT, 351 s in the world): PASS, 0 device losses, 0
ERRORlines.3643c2879merged withgit merge --no-ffontomain1a163523d(merge0ad295e06,clean). No other changes.
diagnostics,dlss,mimalloc. Shaders were translated again from the cache at startwith
-PrecompileAll.-HardwareRT -SmoothMotion -PrecompileAll -Log,LEONIDA_D3D12_DRED=1. Same save, scripted input (Enter through the menus, then walking).ERRORline in the whole log.two
main-alone runs on the same machine and save earlier tonight (12.8 and 16.6 fps median).AI-assisted: the build, the automated run, the log reading and the write-up were done with Claude Opus 5.5
(Claude Code); the numbers are the runtime's own log lines.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.