d3d12/pipeline: offload sample-mask twin builds to pipeline workers with bounded wait (D3D12-MASKED-TWIN-WORKER-WAIT) #3200
Open
github-bot
wants to merge 7 commits from
github-bot/gh-3200 into main
AGit
pull from: github-bot/gh-3200
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!3200
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@zmasi on GitHub · 2026-12-02 18:31 UTC · original
zmasi:perf/d3d12-masked-twin-worker-wait→main· +798 −73 · 5 files · 7 commits · openClaimed in the coordination issue as:
D3D12-MASKED-TWIN-WORKER-WAIT(#2570)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).@Kal0s-design on GitHub · 2026-12-02 19:00 UTC · original
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).
@Kal0s-design on GitHub · 2026-12-02 19:38 UTC · original
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).
@lixonik on GitHub · 2026-12-02 20:17 UTC · original
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).
@icdmkg2 on GitHub · 2026-12-02 20:36 UTC · original
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).
@EdenBendheim on GitHub · 2026-12-02 21:01 UTC · original
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.)@fiestorra on GitHub · 2026-12-02 21:20 UTC · original
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.
@x2Tweek on GitHub · 2026-12-02 22:28 UTC · original
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.
@NAbobo101 on GitHub · 2026-12-02 22:52 UTC · original
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.
@zmasi on GitHub · 2026-12-02 23:06 UTC · original
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).
@zmasi on GitHub · 2026-12-03 15:09 UTC · original
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).
@MoonEyes on GitHub · 2026-12-03 16:18 UTC · original
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.