d3d12-shader: preserve non-EXEC writelanes and full/exempt LDS in paired Wave64 form (D3D12-SHADER-PAIRED-MULTI-BARRIER-EXACTNESS) #3262
Code
Clone this repository
Checkout
From your project repository, check out a new branch and test the changes.
git fetch -u origin "github-pr/3262:github-pr/3262" git switch "github-pr/3262"
Open
leonida/mandy
zmasi wants to merge 3 commits from
github-pr/3262 into main
pull from: github-pr/3262
merge into: leonida:main
leonida:main
leonida:github-pr/3295
leonida:beta
leonida:docs/changelog-3483-3500
leonida:github-pr/3294
leonida:github-pr/2975
leonida:github-pr/2815
leonida:feat/gate-driver-start
leonida:feat/skip-pipelines-release
leonida:perf/lazy-compare
leonida:perf/mwaitx-wait
leonida:test/prio-ceiling-main
leonida:fix/ab-cpu-stdout
leonida:fix/gate-old-crashes
leonida:diag/ab-cpu
leonida:test/main-0312
leonida:github-pr/3291
leonida:diag/indirect-clamp-census
leonida:feat/barrier-enhanced
leonida:perf/texture-frame-ceiling
leonida:perf/dstorage-threads
leonida:fix/console-queue-dma-tables
leonida:fix/port-descriptors-record-parts
leonida:fix/frame-waits-fence
leonida:fix/console-sampler-words
leonida:fix/graphics-userdata-spill
leonida:fix/xg-reserved-layout-rotation
leonida:fix/barrier-console-flags
leonida:fix/switches-wait-test-child
leonida:test/list-value-waits
leonida:test/lot-gxdk-0412
leonida:fix/bvh-compacted-size
leonida:docs/i18n-quickstarts
leonida:feat/native-pipeline-slots
leonida:fix/clippy-leonida-gpu
leonida:fix/list-value-producers
leonida:fix/descriptor-page-straddle
leonida:fix/xmem-low-window
leonida:fix/ffx-jitter-never-zero
leonida:fix/run-stdout-closed
leonida:github-pr/2892
leonida:github-pr/2896
leonida:feat/warm-save-every
leonida:github-pr/2980
leonida:github-pr/2994
leonida:github-pr/3005
leonida:github-pr/3010
leonida:github-pr/3136
leonida:github-pr/3303
leonida:github-pr/3220
leonida:github-pr/3143
leonida:github-pr/3330
leonida:github-pr/3226
leonida:github-pr/3187
leonida:carry/3395
leonida:github-pr/2946
leonida:github-pr/2947
leonida:github-pr/2945
leonida:github-pr/2983
leonida:github-pr/3001
leonida:github-pr/3372
leonida:github-pr/3128
leonida:github-pr/3296
leonida:github-pr/2588
leonida:github-pr/3119
leonida:github-pr/3378
leonida:fix/crash-diagnostics
leonida:feat/dlss-mip-bias
leonida:fix/retired-out-of-order
leonida:fix/dxr-postbuild-barrier
leonida:fix/amd-relay-default
leonida:fix/removed-report-wait
leonida:feat/heap-twin
leonida:feat/vram-margin
leonida:github-pr/2472
leonida:github-pr/3123
leonida:github-pr/3088
leonida:assets/annonce-v1
leonida:github-pr/2794
leonida:github-pr/3300
leonida:github-pr/3304
leonida:github-pr/3308
leonida:github-pr/3367
leonida:github-pr/3369
leonida:fix/launcher-dlss-diagnostics
leonida:github-pr/3269
leonida:github-pr/2957
leonida:github-pr/3205
leonida:fix/crash-zero-guard
leonida:github-pr/3185
leonida:github-pr/3099
leonida:github-pr/3104
leonida:github-pr/3348
leonida:github-pr/3379
leonida:github-pr/3377
leonida:perf/darner-title-priority-ceiling
leonida:github-pr/3376
leonida:gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
leonida:gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
leonida:gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
leonida:github-pr/3373
leonida:github-pr/3368
leonida:github-pr/3198
leonida:gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
leonida:gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
leonida:gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
leonida:gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
leonida:github-pr/3346
leonida:github-pr/3375
leonida:github-pr/2958
leonida:github-pr/3151
leonida:github-pr/3307
leonida:github-pr/3278
leonida:github-pr/3374
leonida:fix/runtime-test-conservative-fixtures
leonida:github-pr/3366
leonida:ci/shard-semantic-linux
leonida:github-pr/3354
leonida:docs/fg-limit-fps-switch
leonida:github-pr/3365
leonida:fix/read-file-hard-link
leonida:github-pr/3364
leonida:fix/book-slot-heap-never-read
leonida:github-pr/3361
leonida:github-pr/3263
leonida:github-pr/3360
leonida:github-pr/3353
leonida:github-pr/3331
leonida:fix/alias-later-queued-submissions
leonida:github-pr/3352
leonida:github-pr/3228
leonida:github-pr/3349
leonida:claude/gallant-sagan-aamatr
leonida:github-pr/3200
leonida:github-pr/3132
leonida:github-pr/3323
leonida:github-pr/3332
leonida:github-pr/3340
leonida:github-pr/3311
leonida:github-pr/3334
leonida:github-pr/3297
leonida:github-pr/3256
leonida:github-pr/2567
leonida:github-pr/2851
leonida:d3d12/agility-sdk-621
leonida:github-pr/3164
leonida:github-pr/3114
leonida:github-pr/3050
leonida:github-pr/3113
leonida:github-pr/3326
leonida:github-pr/3144
leonida:github-pr/2642
leonida:github-pr/3072
leonida:github-pr/2789
leonida:github-pr/2643
leonida:github-pr/3009
leonida:github-pr/3035
leonida:github-pr/3031
leonida:github-pr/2686
leonida:github-pr/2834
leonida:github-pr/3321
leonida:github-pr/3325
leonida:github-pr/3290
leonida:github-pr/3324
leonida:github-pr/3130
leonida:claude/fervent-curie-m19lnr
leonida:github-pr/3309
leonida:github-pr/3305
leonida:github-pr/3306
leonida:github-pr/3302
leonida:github-pr/3301
leonida:github-pr/3345
leonida:github-pr/3211
leonida:github-pr/3027
leonida:github-pr/3286
leonida:github-pr/3235
leonida:github-pr/3265
leonida:github-pr/3275
leonida:codex/skip-no-hit-ray-passes
leonida:github-pr/2823
leonida:github-pr/2911
leonida:github-pr/3125
leonida:github-pr/3206
leonida:github-pr/3250
leonida:github-pr/3238
leonida:github-pr/3188
leonida:github-pr/2952
leonida:github-pr/3217
leonida:github-pr/3168
leonida:t3/preserve-fsr-sdk-restart-path
leonida:t3/propagate-host-failure-hresult
leonida:github-pr/3209
leonida:t3/launcher-custom-parameters
leonida:github-pr/3207
leonida:github-pr/3183
leonida:github-pr/3160
leonida:github-pr/3201
leonida:ci/less-to-run
leonida:github-pr/2930
leonida:github-pr/2797
leonida:github-pr/2999
leonida:perf/native-compute-shader-forms
leonida:github-pr/3191
leonida:github-pr/3011
leonida:github-pr/3019
leonida:github-pr/2996
leonida:gh-readonly-queue/main/pr-2789-45dc41f95c1cd0dcc29c2c50582e0e9af8a77259
leonida:claude/blissful-franklin-ukp7ag
leonida:github-pr/3141
leonida:github-pr/3156
leonida:github-pr/3150
leonida:github-pr/3153
leonida:github-pr/3163
leonida:github-pr/3142
leonida:github-pr/3139
leonida:github-pr/2841
leonida:github-pr/3069
leonida:github-pr/3098
leonida:github-pr/3107
leonida:github-pr/3071
leonida:github-pr/2774
leonida:github-pr/2889
leonida:github-pr/3075
leonida:github-pr/2661
leonida:github-pr/3064
leonida:github-pr/3054
leonida:github-pr/3049
leonida:github-pr/2855
leonida:github-pr/2943
leonida:github-pr/3016
leonida:github-pr/2887
leonida:github-pr/3006
leonida:github-pr/3003
leonida:github-pr/2993
leonida:notes/card-time-and-plant-flicker
leonida:github-pr/2989
leonida:feat/vulkan-rs
leonida:github-pr/2985
leonida:github-pr/2951
leonida:github-pr/2982
leonida:github-pr/752
leonida:github-pr/792
leonida:github-pr/2877
leonida:github-pr/2654
leonida:github-pr/2893
leonida:github-pr/2948
leonida:github-pr/2944
leonida:github-pr/2919
leonida:github-pr/2915
leonida:archive/ci/less-to-run/20261202T1121Z
leonida:github-pr/2800
leonida:github-pr/2822
leonida:github-pr/2833
leonida:github-pr/2840
leonida:github-pr/2831
leonida:github-pr/2832
leonida:github-pr/2801
leonida:github-pr/2890
leonida:github-pr/2891
leonida:github-pr/2664
leonida:github-pr/2807
leonida:rt-call-trace
leonida:github-pr/2755
leonida:perf/ahead-split
leonida:github-pr/2587
leonida:github-pr/2698
leonida:github-pr/2609
leonida:github-pr/3219
leonida:docs/readme-runtime-proposal
leonida:github-pr/2017
leonida:github-pr/1741
leonida:github-pr/1667
leonida:codex/coord-claim-check-20261124-7e48
No reviewers
Assignees
Clear assignees
No assignees
Labels
Clear labels
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
enhancement
New feature or request
missing claim
Needs a claim in #14
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
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
Projects
Clear projects
No items
No project
Milestone
Clear milestone
No items
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
leonida/mandy!3262
Loading…
Reference in a new issue
No description provided.
Delete branch "github-pr/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?
This branch is out-of-date with the base branch
Reviewers 0 approvals
Details
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Claimed in the coordination issue as:
D3D12-SHADER-PAIRED-MULTI-BARRIER-EXACTNESS(https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7353810595)
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.)
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).
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.
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.