d3d12/pipeline: offload sample-mask twin builds to pipeline workers with bounded wait (D3D12-MASKED-TWIN-WORKER-WAIT) #3200
Open
zmasi wants to merge 7 commits from
upstream-pr/3200 into main
pull from: upstream-pr/3200
merge into: ProjectLeonida:main
ProjectLeonida:main
ProjectLeonida:claude/loop-total
ProjectLeonida:claude/pops-collision-seed
ProjectLeonida:claude/dstorage-hold-page-reads
ProjectLeonida:claude/host-image-copy-switch
ProjectLeonida:feat/gdk-lifecycle-window-hook
ProjectLeonida:claude/d16s8-uav-nvidia-fallback
ProjectLeonida:feat/mfplat-offline-shim
ProjectLeonida:claude/gameinput-slow-reader
ProjectLeonida:fix/rt-null-barrier-clear
ProjectLeonida:claude/depth-resolve-sample-positions
ProjectLeonida:integration/palmetto-parity
ProjectLeonida:claude/valu-literal-sext
ProjectLeonida:claude/slot74-pool-handle
ProjectLeonida:claude/rgb9e5-uint-alias-view
ProjectLeonida:claude/fssm-root-layout-tables
ProjectLeonida:feat/gdk-speech-display-lifecycle
ProjectLeonida:asset-audio-skip-current
ProjectLeonida:qemmhd/old-9940-rectangle-quad-lists
ProjectLeonida:feat/ws2-offline-shim
ProjectLeonida:qemmhd/rt-d16-unorm-uav
ProjectLeonida:feat/xs-device-stops-7-9
ProjectLeonida:qemmhd/rt-depth-same-base-shapes
ProjectLeonida:qemmhd/rt-lazy-attachment-variant
ProjectLeonida:feat/acphal-xma2-decoder
ProjectLeonida:asset-audio-skip
ProjectLeonida:codex/coord-claim-check-20261124-7e48
ProjectLeonida:feat/xs-frame-pacing-presentx
ProjectLeonida:feat/xs-device-vm-options
ProjectLeonida:old-pr/9844
ProjectLeonida:old-pr/9978
ProjectLeonida:old-pr/9815
ProjectLeonida:old-pr/10057
ProjectLeonida:old-pr/9874
ProjectLeonida:old-pr/9965
ProjectLeonida:old-pr/9863
ProjectLeonida:old-pr/10068
ProjectLeonida:old-pr/10066
ProjectLeonida:old-pr/10067
ProjectLeonida:old-pr/10007
ProjectLeonida:old-pr/10061
ProjectLeonida:old-pr/10065
ProjectLeonida:old-pr/10059
ProjectLeonida:old-pr/10063
ProjectLeonida:old-pr/10055
ProjectLeonida:old-pr/10062
ProjectLeonida:old-pr/10042
ProjectLeonida:old-pr/10041
ProjectLeonida:old-pr/10049
ProjectLeonida:old-pr/10047
ProjectLeonida:old-pr/10046
ProjectLeonida:old-pr/10045
ProjectLeonida:old-pr/10056
ProjectLeonida:old-pr/10043
ProjectLeonida:old-pr/10036
ProjectLeonida:old-pr/10034
ProjectLeonida:old-pr/9984
ProjectLeonida:old-pr/10052
ProjectLeonida:old-pr/10038
ProjectLeonida:old-pr/10033
ProjectLeonida:old-pr/10028
ProjectLeonida:old-pr/10050
ProjectLeonida:old-pr/9891
ProjectLeonida:old-pr/9889
ProjectLeonida:old-pr/10051
ProjectLeonida:old-pr/10019
ProjectLeonida:old-pr/10027
ProjectLeonida:old-pr/10029
ProjectLeonida:old-pr/10031
ProjectLeonida:old-pr/10026
ProjectLeonida:old-pr/9941
ProjectLeonida:old-pr/10030
ProjectLeonida:old-pr/10040
ProjectLeonida:old-pr/9990
ProjectLeonida:old-pr/10021
ProjectLeonida:old-pr/9962
ProjectLeonida:old-pr/10022
ProjectLeonida:old-pr/10020
ProjectLeonida:old-pr/10015
ProjectLeonida:old-pr/10025
ProjectLeonida:old-pr/9886
ProjectLeonida:old-pr/10048
ProjectLeonida:old-pr/10014
ProjectLeonida:old-pr/10011
ProjectLeonida:old-pr/9861
ProjectLeonida:old-pr/10010
ProjectLeonida:old-pr/10008
ProjectLeonida:old-pr/9860
ProjectLeonida:old-pr/10006
ProjectLeonida:old-pr/9920
ProjectLeonida:old-pr/9995
ProjectLeonida:old-pr/10000
ProjectLeonida:old-pr/10016
ProjectLeonida:old-pr/10004
ProjectLeonida:old-pr/10023
ProjectLeonida:old-pr/9982
ProjectLeonida:old-pr/9981
ProjectLeonida:old-pr/9983
ProjectLeonida:old-pr/9970
ProjectLeonida:old-pr/9969
ProjectLeonida:old-pr/9968
ProjectLeonida:old-pr/9971
ProjectLeonida:old-pr/9972
ProjectLeonida:old-pr/9942
ProjectLeonida:old-pr/9963
ProjectLeonida:old-pr/9960
ProjectLeonida:old-pr/9964
ProjectLeonida:old-pr/9985
ProjectLeonida:old-pr/9973
ProjectLeonida:old-pr/9862
ProjectLeonida:old-pr/9953
ProjectLeonida:old-pr/10017
ProjectLeonida:old-pr/9952
ProjectLeonida:old-pr/9955
ProjectLeonida:old-pr/9946
ProjectLeonida:old-pr/9954
ProjectLeonida:old-pr/9938
ProjectLeonida:old-pr/9956
ProjectLeonida:old-pr/9856
ProjectLeonida:old-pr/9947
ProjectLeonida:old-pr/9924
ProjectLeonida:old-pr/9961
ProjectLeonida:old-pr/9927
ProjectLeonida:old-pr/9979
ProjectLeonida:old-pr/10032
ProjectLeonida:old-pr/9926
ProjectLeonida:old-pr/5237
ProjectLeonida:old-pr/9951
ProjectLeonida:old-pr/9931
ProjectLeonida:old-pr/9902
ProjectLeonida:old-pr/9921
ProjectLeonida:old-pr/9994
ProjectLeonida:old-pr/9775
ProjectLeonida:old-pr/9768
ProjectLeonida:old-pr/9905
ProjectLeonida:old-pr/9936
ProjectLeonida:old-pr/9901
ProjectLeonida:old-pr/9904
ProjectLeonida:old-pr/9906
ProjectLeonida:old-pr/9988
ProjectLeonida:old-pr/9908
ProjectLeonida:old-pr/9909
ProjectLeonida:old-pr/9911
ProjectLeonida:old-pr/9912
ProjectLeonida:old-pr/9913
ProjectLeonida:old-pr/9887
ProjectLeonida:old-pr/9916
ProjectLeonida:old-pr/9919
ProjectLeonida:old-pr/9925
ProjectLeonida:old-pr/9933
ProjectLeonida:old-pr/9935
ProjectLeonida:old-pr/9918
ProjectLeonida:old-pr/9879
ProjectLeonida:old-pr/9880
ProjectLeonida:old-pr/9881
ProjectLeonida:old-pr/9996
ProjectLeonida:old-pr/9876
ProjectLeonida:old-pr/9892
ProjectLeonida:old-pr/9899
ProjectLeonida:old-pr/9915
ProjectLeonida:old-pr/9914
ProjectLeonida:old-pr/9872
ProjectLeonida:old-pr/9869
ProjectLeonida:old-pr/9866
ProjectLeonida:old-pr/9819
ProjectLeonida:old-pr/10012
ProjectLeonida:old-pr/9857
ProjectLeonida:old-pr/9893
ProjectLeonida:old-pr/9897
ProjectLeonida:old-pr/9928
ProjectLeonida:old-pr/9868
ProjectLeonida:old-pr/9917
ProjectLeonida:old-pr/9940
ProjectLeonida:old-pr/9873
ProjectLeonida:old-pr/9816
ProjectLeonida:old-pr/10009
ProjectLeonida:old-pr/9900
ProjectLeonida:old-pr/9966
ProjectLeonida:old-pr/9859
ProjectLeonida:old-pr/9843
ProjectLeonida:old-pr/9991
ProjectLeonida:old-pr/10058
ProjectLeonida:old-pr/9883
ProjectLeonida:old-pr/9838
ProjectLeonida:old-pr/9835
ProjectLeonida:old-pr/9959
ProjectLeonida:old-pr/9895
ProjectLeonida:old-pr/9837
ProjectLeonida:old-pr/9858
ProjectLeonida:old-pr/9865
ProjectLeonida:old-pr/9864
ProjectLeonida:old-pr/9840
ProjectLeonida:old-pr/9820
ProjectLeonida:old-pr/4669
ProjectLeonida:old-pr/9848
ProjectLeonida:old-pr/9850
ProjectLeonida:old-pr/9810
ProjectLeonida:old-pr/9799
ProjectLeonida:old-pr/9853
ProjectLeonida:old-pr/9875
ProjectLeonida:old-pr/9831
ProjectLeonida:old-pr/9796
ProjectLeonida:old-pr/9801
ProjectLeonida:old-pr/9813
ProjectLeonida:old-pr/9794
ProjectLeonida:old-pr/7417
ProjectLeonida:old-pr/9781
ProjectLeonida:old-pr/9806
ProjectLeonida:old-pr/9958
ProjectLeonida:old-pr/9809
ProjectLeonida:old-pr/9791
ProjectLeonida:old-pr/9792
ProjectLeonida:old-pr/10053
ProjectLeonida:old-pr/9784
ProjectLeonida:old-pr/9789
ProjectLeonida:old-pr/9849
ProjectLeonida:old-pr/9846
ProjectLeonida:old-pr/9773
ProjectLeonida:old-pr/9785
ProjectLeonida:old-pr/9803
ProjectLeonida:old-pr/9826
ProjectLeonida:old-pr/9839
ProjectLeonida:old-pr/9922
ProjectLeonida:old-pr/9948
ProjectLeonida:old-pr/7189
ProjectLeonida:old-pr/9957
ProjectLeonida:old-pr/9823
ProjectLeonida:old-pr/9807
ProjectLeonida:old-pr/9851
ProjectLeonida:old-pr/9774
ProjectLeonida:old-pr/9830
ProjectLeonida:old-pr/9836
ProjectLeonida:old-pr/9822
ProjectLeonida:old-pr/9783
ProjectLeonida:old-pr/9833
ProjectLeonida:old-pr/9890
ProjectLeonida:old-pr/9770
ProjectLeonida:old-pr/9769
ProjectLeonida:old-pr/9772
ProjectLeonida:old-pr/9787
ProjectLeonida:old-pr/9852
ProjectLeonida:old-pr/9834
ProjectLeonida:old-pr/9845
ProjectLeonida:old-pr/9871
ProjectLeonida:old-pr/9771
ProjectLeonida:old-pr/9776
ProjectLeonida:old-pr/10005
ProjectLeonida:old-pr/9949
ProjectLeonida:old-pr/9923
ProjectLeonida:old-pr/9805
ProjectLeonida:old-pr/9829
ProjectLeonida:old-pr/9790
ProjectLeonida:old-pr/9827
ProjectLeonida:old-pr/9929
ProjectLeonida:old-pr/9855
ProjectLeonida:old-pr/9934
ProjectLeonida:old-pr/9907
ProjectLeonida:old-pr/9910
ProjectLeonida:old-pr/9779
ProjectLeonida:old-pr/9780
ProjectLeonida:old-pr/9885
ProjectLeonida:old-pr/9882
ProjectLeonida:old-pr/9877
ProjectLeonida:old-pr/9998
ProjectLeonida:old-pr/4251
ProjectLeonida:old-pr/9987
ProjectLeonida:old-pr/9989
ProjectLeonida:old-pr/9950
ProjectLeonida:old-pr/9777
ProjectLeonida:old-pr/10044
ProjectLeonida:old-pr/9884
ProjectLeonida:old-pr/2906
ProjectLeonida:old-pr/5076
ProjectLeonida:old-pr/9937
ProjectLeonida:old-pr/9986
ProjectLeonida:old-pr/3014
ProjectLeonida:old-pr/9943
ProjectLeonida:old-pr/9939
ProjectLeonida:old-pr/4682
ProjectLeonida:old-pr/4765
No reviewers
Labels
Clear labels
No items
No labels
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.
Reference
ProjectLeonida/mandy!3200
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3200"
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?
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-12-02T18:31:52Z.
Claimed in the coordination issue as:
D3D12-MASKED-TWIN-WORKER-WAIT(https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7353810942)Depends on: #3132 (stacked on
#3132head8eedef9b4merged withorigin/mainat5d2dddbfe; this PR's own commitd1a91afd1touchesd3d12/crates/leonida-gpu/src/pipeline/make.rsonly)Addresses #3105 (does not close it: targets the open-world
> 0.6–2.3 slist-thread freezes on cold sample-mask twin PSO compiles confirmed by@TripyFoxin #3105; in-game validation on the reporter's RTX 3090 save remains to be run).What and why
Routes
pipeline::make::masked_forthroughreadyinstead of invokingPending::makesynchronously onleonida-list-*recording threads:#3105:65f372c08("gpu: honor coverage on the first masked draw") changedmasked_forfrommade_or_start(0 mswait) to a synchronousp.make()on the calling command-list thread so fast/cached masked twins would be ready on their first LOD-fade draw.p.make()directly onleonida-list-Nbypassedleonida-pipelines-*workers, ignoredLEONIDA_PIPELINE_WAIT_MSandLEONIDA_PIPELINE_WAIT_ONCE, left all pipeline worker threads idle when multiple list threads hit cold masked twins in the same frame, blocked second list threads hitting the same twin insideOnceLock'sWaitOnAddress, skippedWAITING/C::PipelineWaitUs(waiting for pipelines) accounting, and skipped worker-sidelibrary::save(false).#3105,@TripyFoxconfirmed that 10 of 14 open-world log silences>= 600 msand all 4 silences> 1 s(1.0–2.3 s) ended within30 msonhost mesh pipeline shaders=[..., pixel ... masked], andLEONIDA_SAMPLE_MASK=0reduced>= 1 sfreezes from5to1(1,436 ms -> 716 mslongest silence).d3d12/crates/leonida-gpu/src/pipeline/make.rs):masked_forresolves any render-target format variant (variant) as before and delegates toready(p)(start(p, REQUESTED)+wait(p, crate::frame::current())).leonida-pipelines-*withinLEONIDA_PIPELINE_WAIT_MS(withAWAITEDpromotion and#3132's live-waiterTHREAD_PRIORITY_NORMALdonation), preserving first-draw sample-mask coverage without LOD-fade flicker.Nonewhen the budget expires, leavingp.madeunset (Gone::Making, never poisoned asGone::Refused) and demoting the worker back to background priority whiledraw::State::graphics_pipeline(draw.rs:2537) falls back cleanly to the already-built unmasked pipeline until the worker publishesSome(HostPipeline).Tested
d1a91afd1onto--base 5d2dddbfe,#3132head8eedef9b4merged withorigin/main):python -I scripts/red_green.py HEAD --base 5d2dddbfe --no-fetch --no-python --mutate(pipeline::make::runner):verdict: red then green(2/2new testsred -> green,36/36existingpipeline::make::tests pass on both, code hunkmake.rs:393mutation caught).x86_64-pc-windows-msvc):cargo test --locked --target x86_64-pc-windows-msvc -p leonida-gpu --lib pipeline::—67 passed, 0 failed, 8 ignored.cargo test --locked --target x86_64-pc-windows-msvc -p leonida-gpu --features diagnostics --lib pipeline::—68 passed, 0 failed, 8 ignored.cargo clippy --locked --target x86_64-pc-windows-msvc -p leonida-gpu [--features diagnostics] --all-targets --no-deps— exit0(0warnings inpipeline/make.rs).python -I tools/d3d12_switches.py --check d3d12/docs/switches.md,python -I tests/test_d3d12_switches.py,python -I scripts/check_no_game_data.py, andpython -I tests/test_text_write_line_endings.py— all exit0.git apply --cached --3way,rc=0) against open PRs#2957(pipeline.rs,pipeline/known.rs) and#3185(pipeline/library.rs).GPUs tested: NVIDIA GeForce RTX 3090 24 GB, driver 610.88, Windows 11 Pro
10.0.26200(synthetic D3D12 compute PSO + pipeline worker scheduling and priority-donation tests; no retail title run).AI-assisted: yes — authored with Gemini Carbon and independently audited in read-only mode by Gemini 4 Neon XHigh (
opus-systems-critic).Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed (n/a: no translator rule added).Imported from ubiquitarianism/leonida. Originally posted by Kal0s-design on 2026-12-02T19:00:38Z.
Ran natively on Windows 11, head
d1a91afd1merged into currentmain(f1a559851, clean merge).The branch still carries #3132 (completion.rs, completion_tests.rs, library.rs, switches.md, most of make.rs), so the merge needs #3132 first. This PR's own change is the one
masked_forhunk (nowready(p)) plus its tests. To keep the two apart I also ran "merge with that hunk reverted" (= main + #3132 + the new tests).Suites (
leonida-gpu --lib,--test-threads=4)--features diagnosticsThe +8 are 2 from this PR and 6 from #3132.
Red check (masked_for hunk reverted, tests kept): both new tests fail,
masked_twin_dispatches_to_pipeline_worker_with_priority_donation(built on the caller thread) andmasked_twin_exceeding_wait_budget_returns_promptly_and_resolves_once_built(caller stalled 813 ms against a 40 ms budget). The otherpipeline::tests pass: 65 passed, 2 failed, 8 ignored.Clippy
--all-targets --no-deps: 0 warnings on the merge, 12 with--features diagnosticson both main and the merge, none inpipeline/. So no new warnings.Switch (read). There's no new switch and nothing that brings back the old inline build. The switches.md line is #3132's rewording of
LEONIDA_PIPELINE_LOWEST. The bound on a twin is the normal pipeline wait budget (LEONIDA_PIPELINE_WAIT_MS, per-pipeline withWAIT_ONCE, shared per frame). When it runs out,masked_forreturnsNoneandgraphics_pipelinedraws with the unmasked pipeline. It is not dropped, not built inline and not blocked. The twin stays queued and is picked up on a later draw. Twin builds have no queue limit of their own.Concurrency, measured. Throwaway tests, not part of the PR. They use empty-shader
Pendings, which are refused before any D3D12 call, so they test scheduling and not the driver. Card vs WARP doesn't change anything for them. 50 iterations on the card, 50 on WARP and 5 with the debug layer, all on the merge, all passed. The PR's own three masked tests also passed 50/50 on the card and 50/50 on WARP.Refused, no hangs, one variant per format set,waiting()back to 0, longest pair of calls 270 ms at 500 ms budget, under 10 ms at 0/1 msRefused, caller unaffected, next twin fineLEONIDA_PIPELINE_PANIC_CATCH=0, 1 workerMakingfor good, later twins never made, caller doesn't panic (before this PR the recording thread panicked). That is the same as any other pipeline under that switchThe trade-off, measured. One case changes in a way you can see. If a frame has already used up its wait budget on another pipeline (a cold plain pipeline, say), a twin asked for later in that same frame gets no wait at all, even when it would build in microseconds and workers are idle:
masked_forreturnsSo in frames that are already waiting on cold pipelines, the first masked draws go out unmasked, which is the LOD-fade case
65f372c08fixed. It lasts one frame per twin when the twin is fast. That seems a fair price for the 0.6–2.3 s stalls in #3105, but it would be good to say so in the PR. Along the same lines, the PR rewrotefirst_masked_draw_observes_the_finished_build. With the old body (twin already markedMAKING), the merge now waits the full 500 ms and returns with the twin unmade, where main returned the finished refusal at once. So the old invariant is gone, not just moved to a new test.Races (read). Build twice: no, the worker, the no-worker fallback in
startandnow()all go through the sameOnceLock(I couldn't count builds in the stress test because the refusal is logged once per process). A draw seeing the twin missing is the intended fallback. Stale twin after a library reset: n/a, I found no path that clearsmadeormasked, and the twin belongs to the title pipeline. Small thing: when a twin uses up its own budget,wait_withlogs "its draws are dropped until it is", but a masked draw isn't dropped, it uses the unmasked pipeline.Other open PRs (
git merge-treeagainst the merge, all clean): #2588, #2654, #2774, #2789, #2919, #2957, #3071, #3150, #3185.Not checked: in-game run or any retail title, a real masked draw on the GPU (the only sample-mask test in
draw.rschecks the mask word and builds no pipeline), timing under a real cold driver compile, release build, Wine.GPUs tested: one NVIDIA desktop card + WARP
AI-assisted: yes (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by Kal0s-design on 2026-12-02T19:38:43Z.
Correction to my comment above. In
leonida-gpu,LEONIDA_D3D12_WARPandLEONIDA_D3D12_DEBUGonly take effect in a build with--features diagnostics(host.rs,cfg!(feature = "diagnostics") && switch::on(..)). My WARP and debug-layer runs were built without it, so they were repeats on the card.What that changes:
The rest is unaffected: the merge, the red check, clippy, the merge-tree results and the same-frame budget finding were all measured on the card.
AI-assisted: yes (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-02T20:17:48Z.
RUN (in game) -- unit tests + 300 s render-path verification for PR #3200:
d1a91afd1mainSHA:f1a559851(git merge --no-ff, clean merge; includes stacked #3132 commits)python -I scripts/check_no_game_data.pyPASSpython -I tools/d3d12_switches.py --check d3d12/docs/switches.mdPASScargo test -p leonida-gpu --features diagnostics --lib --locked pipeline:: -- --skip depth_bounds_pipeline_loads_and_filters_draws-- 67 passed, 0 failed, 8 ignored (pre-existing Win10 test tracked in #2855 skipped)diagprofile (diagnostics,dlss,mimalloc), Series S profile, DLSS on, Frame Gen off, same restored save snapshotd1a91afd1onf1a559851)mainalone (f1a559851)Loaded cleanly into the world, stayed up past 300 s in-world with 0 device lost / 0 crashes / 0
ERRORlines, and closed cleanly. Steady-state FPS matchesmainwithin single-run variance.Verdict: PASS.
AI-assisted: yes (Antigravity).
Imported from ubiquitarianism/leonida. Originally posted by icdmkg2 on 2026-12-02T20:36:17Z.
Third-party Windows verification of #3200 (
D3D12-MASKED-TWIN-WORKER-WAIT) on headd1a91afd1(--features diagnostics, HW + WARP + D3D12 Debug Layer)Adds the
--features diagnosticsWARP + D3D12 Debug Layer run noted as missing above.d1a91afd1merged cleanly (git merge --no-ff) ontoorigin/mainb41763227(still carries stacked #3132 commits, so #3132 remains a prerequisite).621.24(32.0.16.2124), AMD Ryzen 7 H 260 w/ Radeon 780M, 32 GB RAM, Windows 1110.0.26300.9974,rustc 1.98.1.--features diagnostics(no retail title run).Results (MEASURED)
python -I scripts/check_no_game_data.py(all 5 touched files)0python -I tools/d3d12_switches.py --check d3d12/docs/switches.md0LEONIDA_ADAPTER=5060+LEONIDA_D3D12_DEBUG=1cargo test -p leonida-gpu --features diagnostics --locked --lib -- pipeline:: --skip depth_bounds_pipeline_loads_and_filters_draws67 passed, 0 failed, 8 ignored(includingfirst_masked_draw_observes_the_finished_build,masked_twin_dispatches_to_pipeline_worker_with_priority_donation, andmasked_twin_exceeding_wait_budget_returns_promptly_and_resolves_once_built)LEONIDA_D3D12_WARP=1+LEONIDA_D3D12_DEBUG=1(samepipeline::command,--features diagnostics)67 passed, 0 failed, 8 ignoredAI-assisted: Gemini 4 Neon (High) via Antigravity (test execution, diff review, and write-up).
Imported from ubiquitarianism/leonida. Originally posted by EdenBendheim on 2026-12-02T21:01:09Z.
RUN (in-game RTX 3090 300 s stress gate, 14-PR combined batch) — PASS covering exact head
d1a91afd1f011eb8b14f98b1fadfe72a5dd20904.git merge --no-ffontomainb41763227(diagnostics,dlss,mimalloc,exe_sha16 = c47eeb717f761d9d; changed-file clean-room scan exit0; workspace test targets compiled).14PRs):#3200d1a91afd1,#319880a627bb1,#319193b47ac9d,#3189c182fc392,#3176ae0075d9a,#3168337388052,#31641065952da,#3146ebc0253ff,#312464600ef0c,#3069311d33a40,#30318df1bfce7,#3029e49404808,#3054ff53fd8b9,#3010d645712a3.610.88, Series X profile,2560x1440,-NoFrameGen,scripts/game-gate.ps1(301.3 sin world) with downtown street-level teleport + 8-leg dynamic sprint/turn/strafe stress mod (GATE CONTROL moved=2.51 m,max_from_ctrl=5,053.9 m).c47eeb717f761d9d)mainb41763227baseline (cf499737bf684f6a)clean,0reasons,0warnings)clean,0reasons,0warnings)301.3 s(4,504frames)305.6 s0/0/00/0/020.10 FPS/69.76 ms19.13 FPS/74.01 ms8,048/5.222 s7,983/2.358 s35,619 MB/15,251 MB37,803 MB/16,220 MBVerdict: PASS for the 300 s in-game stability gate on
d1a91afd1. (Single combined-batch stability check, not an isolated single-PR FPS gain measurement; if the head changes, this run no longer covers it.)(AI-assisted verification:
gemini-4-neon+gpt-6.2-astra.)Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-02T21:20:09Z.
VERIFY-3200 — Windows nativo: los tests pasan, el control muerde, y el PR trae #3132 dentro
(this PR)45dc41f95(behindmainb41763227)main—merge-treeclean,git merge --no-ffclean (switches.mdauto-merged)Ran
The one failure is this machine's, unchanged all day:
descriptor::host::tests::views_are_made_beside_the_heap_and_copied_in(the iGPU artefact ofD3D12CreateDevice(None, ..)that #2995 addresses).Negative control (synthetic — the tests ship with the change): I made
Worker::boosta no-op under a test variable, rebuilt and ran →FAILED: priority_tracks_live_waiters_during_an_early_build,assertion left == right failed. The priority tests bite.The thing a merger should know: this branch carries #3132
git log 45dc41f95..refs/pull/3200is:#3132("per-pipeline waiter wakeups and live-waiter priority") is still OPEN, and its two commits are inside this branch. Merging #3200 as it stands lands #3132's work as well — so either merge #3132 first (and this becomes a clean diff against it), or a maintainer should knowingly approve both in one go. The body does say "Depends on: #3132", but the merge button does not.Correspondingly, my run above exercised both PRs together — that is the state the branch is in, and it is the state a merge would produce.
What I read and what I could not test
a_worker_with_a_waiter_restores_its_priority_even_on_unwind) — that last one is the test I would have written: a panicking build must not leave worker threads at normal priority for the rest of the run.> 0.6–2.3 slist-thread silences): needs a game run with a cold sample-mask twin; no run here, and the thresholds are timing-dependent.Written with an AI assistant.
Imported from ubiquitarianism/leonida. Originally posted by x2Tweek on 2026-12-02T22:28:37Z.
Game run on an RTX 5090 with hardware RT: a device loss about 6 minutes in, with masked twins loading from the workers just before. The same build without this PR ran clean right after.
Setup: RTX 5090 32 GB, driver 621.40, i9-14900KS, 64 GB DDR5, Windows 11 (26300). Base: upstream main
0d7a451abplus #3113, #3182 and #3204, plus two local hardware-RT CPU changes (index-buffer arena, BLAS bufferpool), diag build. Candidate: the same plus this PR at
d1a91afd1. Series X profile, 3840x2160 output, renderscale 0.6667,
-HardwareRT -SmoothMotion -PrecompileAll -Log,LEONIDA_PIPELINE_WAIT_MS=0, fullscreen.Tests:
cargo test -p leonida-gpu --lib pipelinegives 67 passed, 0 failed and 8 ignored.Run with this PR: I loaded the save at the player's house, then drove.
relay: fence 18446744073709551615 did not reach 290299; device removed ... (0x887A0006)(DXGI_ERROR_DEVICE_HUNG),and
device-removed data; none(DRED was not on).library on separate threads. For example:
were gone while it ran.
Same build without this PR, launched right after: 4+ minutes of driving, no device loss, 0 frames over 1 s,
20.8 fps median.
Context: I ran this hardware-RT setup about eight times today on this card and never lost the device until
this run. One run is not proof, and DRED was off. A repro with
LEONIDA_D3D12_DRED=1would name the command.The timing points at the worker-made masked twins being used while still in flight, or a twin and its base
pipeline disagreeing in state.
The cold masked-twin stalls themselves are real here: an earlier run without this PR had frames of 1015 ms and
1946 ms, each right after masked twins were made synchronously in
masked_for(pipeline/make.rs), withLEONIDA_PIPELINE_WAIT_MS=0not applying to them. So the PR's aim is right; it is the stability that needs a look.AI-assisted: the builds, the runs, the log reading and the write-up were done with Claude Opus 5.5 (Claude Code),
with a log analysis by GPT-6.2 Sol (Codex); the numbers are the runtime's own log lines, and the glass observation
is the player's.
Imported from ubiquitarianism/leonida. Originally posted by NAbobo101 on 2026-12-02T22:52:03Z.
One more trace of the case this PR targets, from a run where the noted masked twins had already been made ahead by the precompile (the setup is in my comment on #2957). It shows that precompiling noted twins is not enough on its own: a pipeline drawn for the first time still builds its twin on the list thread.
Rig: Ryzen 7 5700G, 32 GB, RTX 5060 8 GB, driver 621.40, Windows 11 Pro 26300,
mainat45dc41f95plus a local change that precompiles the noted twins (not this PR), diag build, Series X,LEONIDA_PIPELINE_WAIT_MS=0.The only frame over 1 s in that 9.5-minute run (UTC times from the log):
first bindof a pipeline never drawn before (mesh0d9099a35c000feb, pixel818a9a0ec6a53abb)shader translated stage="pixel" hash=818a9a0ec6a53abb masked=truehost mesh pipeline shaders=[mesh 0d9099a35c000feb, pixel 818a9a0ec6a53abb masked]9924c82dbd9d9c7e, pixel1b76b94a7050f184,masked=true)The frame-time line for that window:
40 frames: median 61.1 ms, ... longest 2127.7; 3 over 100 ms, 2 over 1 s; host pipelines 0 queued or being made, 0.6 made a second. So the cold twin build took about 2.0 s on the list thread, and the "queued or being made" count stays 0 becausemasked_fordoes not go through the queue, which fits the accounting gap described above.Neither twin had been noted by the earlier run (the scripted route varies a little), so no precompile could have made them. With this PR the draw would wait at most the frame's budget and the twin would finish on a worker. With a precompile of noted twins alone it cannot be avoided.
No device removal in any of my runs today (
mainand this local build, about two hours in the world in all).AI-assisted: summary prepared with help from Claude Code (Claude Opus 5.5). Numbers and lines taken from my own run's log; no logs or game data attached.
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-12-02T23:06:17Z.
Thanks @x2Tweek for the detailed RTX 5090 +
-HardwareRTreport! Cross-referencing your setup (LEONIDA_PIPELINE_WAIT_MS=0 -HardwareRT -SmoothMotion -PrecompileAllon driver621.40) againstpipeline.rs,make.rs,library.rs,warm.rs:167-170, and #3068 / #2821 explains both observations:1. Why
LEONIDA_PIPELINE_WAIT_MS=0showed stippled glass doors (while defaultWAIT_MSstays clean)Pipeline::masked(pipeline.rs:816-834) capturesPixelMask { position_row }on the list thread beforemasked_forruns, andPending::make_withcompletesCreateRootSignature+LoadPipeline/CreatePipelineStatebeforeOnceLockpublication (draw.rs:3178-3204rebinds bothmasked.rootandmasked.pso).mainignoredLEONIDA_PIPELINE_WAIT_MS=0while#3200honors it:host-pipelines.binand listed their"masked"keys inearly-pipelines.txt,hand_out(pipeline.rs:1052-1073) only callsmake::earlyon the unmaskedPipeline.hostatCreatePipelineState—Pipeline.maskedstays an emptyOnceLockuntil the first in-world masked draw, so zero masked twins are loaded during the loading screen.LEONIDA_PIPELINE_WAIT_MS=0,wait_withreturns immediately (if budget.is_zero() { return; }), which skips bothAWAITEDqueue promotion and#3132's live-waiterTHREAD_PRIORITY_NORMALdonation (waiters == 0). Allleonida-pipelines-*workers therefore stay pinned atTHREAD_PRIORITY_LOWESTbehind un-skipped-HardwareRTRayQueryjobs inQueue::requestedwhile uncapped recording (#3204 +WAIT_MS=0) and DXR BLAS/TLAS builds saturate the CPU.2x2sample-mask pair (0b0101/0b1010) has finished loading (7 ms) and discards half its quad pixels, any paired draw still queued falls back to unmasked (0xf), producing2x2stippling across those frames (and inside any stationary reflection/probe captured during opening frames).2. Why
0x887A0006(DXGI_ERROR_DEVICE_HUNG) hit right after the workerLoadPipelineburstpipeline library: loaded [mesh ..., pixel ... masked] in 7.0..236.5 msacross separate worker threads (25768,33456,35780) — those wereID3D12PipelineLibrary1::LoadPipelinecache hits, ending1,844.1 msbefore removal (~156 msbefore Windows's2,000 msTdrDelaytimer expired!).d3d12/apps/leonida/src/warm.rs:167-170specifically notes driver621.40removing the device "during a burst of their first loads in a new place, twice" (same family as #3068 and #2821'sLEONIDA_D3D12_BACKGROUND=0finding).early()startup prewarm, they stayed cold until 6 minutes into driving; onmain,masked_forstalledleonida-list-*for1–2 s(pausingExecuteCommandListsso the GPU went idle duringLoadPipeline), whereas with#3200+LEONIDA_PIPELINE_WAIT_MS=0, list threads waited0 msand kept submitting heavy DXR + mesh work on the GPU while fanning out ~10 concurrentLoadPipelinecalls across worker threads.Two quick isolation checks (no rebuild needed)
To keep
d1a91afd1intact while #3132 / #3200 hold @EdenBendheim's 300 s RTX 3090 gate PASS, we will prepare a follow-up PR to pre-loadearly-pipelines.txtmasked twins during loading (early()) so cached twins don't wait until mid-drive or Frame 1. If you get a chance on that same RTX 5090-HardwareRTsetup, two quick env checks ond1a91afd1would confirm both halves directly:LEONIDA_PIPELINE_WAIT_MS=50instead of0): lets7–50 mshost-pipelines.binhits finish withAWAITED+THREAD_PRIORITY_NORMALdonation before Frame 1 draws (eliminating the glass stipple while still capping multi-second cold compiles at50 ms), and did the glass stipple with=0clear after a few seconds or stay baked into a probe?LEONIDA_D3D12_DRED=light+LEONIDA_LIBRARY_LOCK=1(orLEONIDA_D3D12_BACKGROUND=0): serializes workerLoadPipelinebursts on621.40(and records the exact faulting GPU op if it still hangs).AI-assisted: Gemini 4 Carbon (High).
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-12-03T15:09:30Z.
Merged updated base
#3132(3e36b182d0, incorporatingorigin/main128579e9ef/#3333) into7681ede4e5(needs rebase);#3200's delta over#3132ind3d12/crates/leonida-gpu/src/pipeline/make.rs(+383/-16) is 100% identical tod1a91afd1f(74/74pipeline::tests pass).AI-assisted: Gemini 4 Neon (XHigh) and Gemini 4 Carbon (High).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-03T16:18:29Z.
In-game gate run on an RTX 4060 8 GB (driver 610.88, Windows 11), in a batch of #3132, #3200 and #3226 merged into main
d227aa73e; this PR tested at its current head7681ede4e. Series S 1080, DLSS FG 2x,play-nvidia.ps1 -SeriesS -Resolution 1080 -FrameGen 2 -PrecompileUsed, scripted walk, 330 s.AI-assisted (Claude Opus 5.5), run and read by MoonEyes' agent.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.