d3d12: per-pipeline waiter wakeups and live-waiter priority donation (D3D12-PIPELINE-WAIT-AND-SLOW-EARLY) #3132

Open
zmasi wants to merge 4 commits from upstream-pr/3132 into main
zmasi commented 2026-12-02 13:05:15 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-12-02T13:05:15Z.


Claimed in the coordination issue as: D3D12-PIPELINE-WAIT-AND-SLOW-EARLY (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7343615179)

Addresses #3103 (does not close it: the reporter's RTX 5080 gameplay session was not run, and first-seen or unbooked variant/masked PSOs can still compile during play).

What and why

Addresses two scheduler bottlenecks in d3d12/crates/leonida-gpu/src/pipeline/make.rs while preserving upstream queue ordering, frame wait budgets (#3000, #3032), and library admission rules:

  1. Per-Pending waiter notification (pipeline/make/completion.rs, adapted from Foxhound effe3e3, GPL-3.0):
    • Previously, static DONE: (Mutex<()>, Condvar) was global across all pipelines: every background worker completion called notify_all(), waking every leonida-list-* thread waiting on any slow pipeline.
    • Each Pending now carries its own completion gate. Only the winning initializer signals that Pending after publishing either a built HostPipeline or a refusal (including LEONIDA_PIPELINE_PANIC_CATCH caught panics).
  2. Live-waiter worker priority donation (THREAD_PRIORITY_LOWEST -> THREAD_PRIORITY_NORMAL):
    • Pipeline workers run at THREAD_PRIORITY_LOWEST (-2) by default (LEONIDA_PIPELINE_LOWEST), leaving multi-second driver PSO compiles preemptable by normal-priority threads even while list-recording threads block waiting for them.
    • Rather than boosting every queued REQUESTED job (which would hold all workers at normal priority across ~1,700 cold-start requests), a worker now runs at THREAD_PRIORITY_NORMAL only while one or more callers actually block waiting on that pipeline (until_made / synchronous now).
    • If a waiter arrives after an EARLY worker has already entered the driver, the first waiter donates priority to that in-flight worker via a non-inheritable OpenThread(THREAD_SET_LIMITED_INFORMATION) handle opened and closed under the per-pipeline completion lock before worker exit or job reuse; when the last waiter departs (or on completion / unwind), the worker restores its configured background base (-2 or -1).
  3. Configured general-worker slow cap & preserved warm --used safety:
    • Sizes the background slow concurrency cap from max(1, configured_general_workers / 4) (honoring LEONIDA_PIPELINE_WORKERS overrides and low-RAM defaults instead of recomputing from logical CPUs alone), while keeping ordinary-before-slow EARLY pop order and REQUESTED promotion bypass unchanged.
    • Leaves wanted_early and warm --used draw-only admission unchanged: unrestricted leonida warm / -PrecompileAll also appends >= 1 s timings to slow-pipelines.txt for never-drawn recipes, and admitting slow-pipelines.txt into wanted_early would let runtime library misses call StorePipeline on never-drawn PSOs (bypassing warm.rs::into_library's device-removal guard).

Tested

  • Red -> Green baseline projection (a252854a2): 4 targeted regression failures on base -> green on HEAD (global completion gate contention blocking refusal waiters, missing before-claim and mid-build Win32 priority donation leaving workers at -2, and CPU-only slow cap ignoring configured pool overrides), while fast-before-slow EARLY ordering and expired-request controls pass on both sides.
  • Release synthetic benchmark (31 paired AB/BA trials, 8 distinct waiters + 64 unrelated completions, Ryzen 9 5950X 32 logical CPUs):
    • Unrelated wait_timeout wakes: 1,910 -> 0 (burst) and 13,966 -> 0 (producer rendezvous).
    • Burst p50 / p95 completion latency: 71.4 / 142.6 us -> 17.2 / 23.1 us (803k -> 3.60M publications/s; rendezvous 337.0 / 866.2 us -> 54.8 / 112.8 us, 123k -> 1.08M publications/s).
    • Native Win32 thread priority transitions verified: -2 when REQUESTED without waiters, 0 (THREAD_PRIORITY_NORMAL) with 1 -> 2 -> 1 active waiters, and -2 immediately when the last waiter leaves before compilation finishes.
  • Rust & repository suites (rustc 1.98.1, x86_64-pc-windows-msvc):
    • cargo test --locked --target x86_64-pc-windows-msvc -p leonida-gpu --lib pipeline:: — 65 passed, 0 failed, 8 ignored (4/4 diagnostics completion tests also pass; 1/2/8 configured worker quotas verified in isolated subprocesses).
    • Workspace unit/integration coverage: 1,717 passed, 75 ignored across runtime/shader/tool crates (sole workspace failure is pre-existing xtask::policy::tests::repository_passes_policy on untouched host.rs, emit/lower.rs, and amplify_dxil.rs).
    • cargo clippy --workspace --all-targets --no-deps --locked --target x86_64-pc-windows-msvc — exit 0 (0 warnings in touched files).
    • python -I tools/d3d12_switches.py --check d3d12/docs/switches.md, python -I tests/test_text_write_line_endings.py, and python -I scripts/check_no_game_data.py — all exit 0.

GPUs tested: NVIDIA GeForce RTX 3090 24 GB, driver 610.88, Windows 11 Pro 10.0.26200 (synthetic workspace GPU + WARP tests and CPU synchronization/Win32 priority benchmarks; no retail title run).

AI-assisted: yes — authored with GPT-6.2 Astra (xhigh) with live turn-by-turn design advisories from Claude Fable 5.2 (max, which identified the never-drawn StorePipeline hazard and scoped priority donation strictly to active waiters), codebase scouting by GPT-6.2 Sol (high), and independent read-only review + re-review by Claude Opus 5.5 (max).

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5606992667 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3132). Originally posted by [zmasi](https://github.com/zmasi) on 2026-12-02T13:05:15Z. --- Claimed in the coordination issue as: `D3D12-PIPELINE-WAIT-AND-SLOW-EARLY` (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7343615179) Addresses #3103 (does not close it: the reporter's RTX 5080 gameplay session was not run, and first-seen or unbooked variant/masked PSOs can still compile during play). ### What and why Addresses two scheduler bottlenecks in `d3d12/crates/leonida-gpu/src/pipeline/make.rs` while preserving upstream queue ordering, frame wait budgets (#3000, #3032), and library admission rules: 1. **Per-`Pending` waiter notification (`pipeline/make/completion.rs`, adapted from Foxhound `effe3e3`, GPL-3.0):** - Previously, `static DONE: (Mutex<()>, Condvar)` was global across all pipelines: every background worker completion called `notify_all()`, waking every `leonida-list-*` thread waiting on *any* slow pipeline. - Each `Pending` now carries its own completion gate. Only the winning initializer signals that `Pending` after publishing either a built `HostPipeline` or a refusal (including `LEONIDA_PIPELINE_PANIC_CATCH` caught panics). 2. **Live-waiter worker priority donation (`THREAD_PRIORITY_LOWEST` -> `THREAD_PRIORITY_NORMAL`):** - Pipeline workers run at `THREAD_PRIORITY_LOWEST` (`-2`) by default (`LEONIDA_PIPELINE_LOWEST`), leaving multi-second driver PSO compiles preemptable by normal-priority threads even while list-recording threads block waiting for them. - Rather than boosting every queued `REQUESTED` job (which would hold all workers at normal priority across ~1,700 cold-start requests), a worker now runs at `THREAD_PRIORITY_NORMAL` **only while one or more callers actually block waiting on that pipeline** (`until_made` / synchronous `now`). - If a waiter arrives after an `EARLY` worker has already entered the driver, the first waiter donates priority to that in-flight worker via a non-inheritable `OpenThread(THREAD_SET_LIMITED_INFORMATION)` handle opened and closed under the per-pipeline completion lock before worker exit or job reuse; when the last waiter departs (or on completion / unwind), the worker restores its configured background base (`-2` or `-1`). 3. **Configured general-worker slow cap & preserved `warm --used` safety:** - Sizes the background `slow` concurrency cap from `max(1, configured_general_workers / 4)` (honoring `LEONIDA_PIPELINE_WORKERS` overrides and low-RAM defaults instead of recomputing from logical CPUs alone), while keeping ordinary-before-slow `EARLY` pop order and `REQUESTED` promotion bypass unchanged. - Leaves `wanted_early` and `warm --used` draw-only admission unchanged: unrestricted `leonida warm` / `-PrecompileAll` also appends `>= 1 s` timings to `slow-pipelines.txt` for never-drawn recipes, and admitting `slow-pipelines.txt` into `wanted_early` would let runtime library misses call `StorePipeline` on never-drawn PSOs (bypassing `warm.rs::into_library`'s device-removal guard). ### Tested - **Red -> Green baseline projection (`a252854a2`):** 4 targeted regression failures on base -> green on HEAD (global completion gate contention blocking refusal waiters, missing before-claim and mid-build Win32 priority donation leaving workers at `-2`, and CPU-only slow cap ignoring configured pool overrides), while fast-before-slow `EARLY` ordering and expired-request controls pass on both sides. - **Release synthetic benchmark (31 paired AB/BA trials, 8 distinct waiters + 64 unrelated completions, Ryzen 9 5950X 32 logical CPUs):** - Unrelated `wait_timeout` wakes: **`1,910 -> 0`** (burst) and **`13,966 -> 0`** (producer rendezvous). - Burst p50 / p95 completion latency: **`71.4 / 142.6 us -> 17.2 / 23.1 us`** (`803k -> 3.60M` publications/s; rendezvous `337.0 / 866.2 us -> 54.8 / 112.8 us`, `123k -> 1.08M` publications/s). - Native Win32 thread priority transitions verified: `-2` when `REQUESTED` without waiters, `0` (`THREAD_PRIORITY_NORMAL`) with 1 -> 2 -> 1 active waiters, and `-2` immediately when the last waiter leaves before compilation finishes. - **Rust & repository suites (`rustc 1.98.1`, `x86_64-pc-windows-msvc`):** - `cargo test --locked --target x86_64-pc-windows-msvc -p leonida-gpu --lib pipeline::` — `65 passed, 0 failed, 8 ignored` (`4/4` diagnostics completion tests also pass; `1/2/8` configured worker quotas verified in isolated subprocesses). - Workspace unit/integration coverage: `1,717 passed, 75 ignored` across runtime/shader/tool crates (sole workspace failure is pre-existing `xtask::policy::tests::repository_passes_policy` on untouched `host.rs`, `emit/lower.rs`, and `amplify_dxil.rs`). - `cargo clippy --workspace --all-targets --no-deps --locked --target x86_64-pc-windows-msvc` — exit `0` (`0` warnings in touched files). - `python -I tools/d3d12_switches.py --check d3d12/docs/switches.md`, `python -I tests/test_text_write_line_endings.py`, and `python -I scripts/check_no_game_data.py` — all exit `0`. GPUs tested: NVIDIA GeForce RTX 3090 24 GB, driver 610.88, Windows 11 Pro `10.0.26200` (synthetic workspace GPU + WARP tests and CPU synchronization/Win32 priority benchmarks; no retail title run). AI-assisted: yes — authored with GPT-6.2 Astra (`xhigh`) with live turn-by-turn design advisories from Claude Fable 5.2 (`max`, which identified the never-drawn `StorePipeline` hazard and scoped priority donation strictly to active waiters), codebase scouting by GPT-6.2 Sol (`high`), and independent read-only review + re-review by Claude Opus 5.5 (`max`). ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed.
Kal0s-design commented 2026-12-02 15:04:07 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Kal0s-design on 2026-12-02T15:04:07Z.


Ran natively on Windows 11, head 8eedef9b4 merged into current main (69cd4106c, clean merge), --features diagnostics, debug test profile.

Suites on the merge

Check Result
leonida-gpu --lib pipeline:: 66 passed, 0 failed, 8 ignored (incl. the 4 completion_tests and slow_slots_follow_the_configured_general_pool)
leonida-gpu --lib full 783 passed, 0 failed, 59 ignored
clippy -p leonida-gpu --features diagnostics --tests no warnings in pipeline/make.rs, make/completion.rs, library.rs (11 elsewhere, untouched files)
tools/d3d12_switches.py --check, check_no_game_data.py clean

Extra throwaway tests against Completion (not pushed), 3 runs each, all passed

Case Result
Lost wakeup: publisher races the waiter's join, random 0 to 2000 spin delay, 8 pairs x 4000 32,000 waits per run, 0 ran out of budget, worst return 0.7 to 3.9 ms after start; 15 to 18 waits per run needed a 4th predicate check (OS spurious condvar wake on that pipeline's own condvar, handled by the loop)
64 waiters on one pipeline, 20 rounds worker at NORMAL inside the build, all 64 returned with the result, worker back at LOWEST, waiter count 0 and no worker record left
32 waiters with 5 to 36 ms budgets that all expire mid-build worker back at LOWEST before the build ends
Churn: 8 workers build 6000 pipelines while 24 threads wait with 0 to 3 ms budgets or demand() and drop no hang (57 to 94 ms), every worker ends at LOWEST, every Completion idle
Worker builds A for a live waiter, then B with none NORMAL in A, LOWEST in B and after
Waiter thread panics while holding a demand() guard NORMAL during, LOWEST after the unwind, waiter count 0
Worker 1 builds A for a live waiter and inside waits on B built by worker 2 worker 2 boosted while worker 1 waits; worker 1 back at LOWEST after (worker 2's priority after its build was not sampled)

I also checked whether a caller blocked in masked_for (which calls p.make() without demand()) can leave a worker at LOWEST. A forced synthetic case does (-2), but the masked twin is only ever passed to masked_for, never to ready/early, so it and its own format variants are built inline on the caller and no worker holds them. The path is not reachable today.

Wake latency vs main (same test file on both sides, until_made + make_with, 8 waiters on their own pipelines, 300 trials x 8 = 2400 samples per run, 3 runs, publish to return in us, debug build so absolute numbers are higher than a release build)

Scenario main p50 / p95 PR p50 / p95
64 unrelated completions, then the 8 targets right after 4 to 5 / 23 to 42 20 to 21 / 38 to 52
64 unrelated, 2 ms pause, then targets 14 to 15 / 88 to 98 21 to 22 / 42 to 49
no unrelated completions (PR only, control) n/a 16 to 17 / 33 to 34

0 lost waits on either side. In the first row main returns faster, most likely because its waiters are already awake from the 64 unrelated notify_all calls when their own pipeline lands; on the PR they stay parked and pay a normal wake. With both sides parked (second row) the PR has a higher median and about half the p95. So in this harness the PR shows a tighter p95 when both sides are parked, not a lower median. I did not count unrelated wakeups on main. I did not reproduce the PR's release-build numbers.

Not checked: an in-game run, a release-build benchmark, behaviour with real driver compiles, and Win32 priority effects under actual CPU contention (the tests read the priority value, they do not measure scheduling).

GPUs tested: n/a (CPU-only tests).
AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7349656301 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3132#issuecomment-7349656301). Originally posted by [Kal0s-design](https://github.com/Kal0s-design) on 2026-12-02T15:04:07Z. --- Ran natively on Windows 11, head `8eedef9b4` merged into current `main` (`69cd4106c`, clean merge), `--features diagnostics`, debug test profile. **Suites on the merge** | Check | Result | |---|---| | `leonida-gpu --lib pipeline::` | 66 passed, 0 failed, 8 ignored (incl. the 4 `completion_tests` and `slow_slots_follow_the_configured_general_pool`) | | `leonida-gpu --lib` full | 783 passed, 0 failed, 59 ignored | | `clippy -p leonida-gpu --features diagnostics --tests` | no warnings in `pipeline/make.rs`, `make/completion.rs`, `library.rs` (11 elsewhere, untouched files) | | `tools/d3d12_switches.py --check`, `check_no_game_data.py` | clean | **Extra throwaway tests against `Completion` (not pushed), 3 runs each, all passed** | Case | Result | |---|---| | Lost wakeup: publisher races the waiter's join, random 0 to 2000 spin delay, 8 pairs x 4000 | 32,000 waits per run, 0 ran out of budget, worst return 0.7 to 3.9 ms after start; 15 to 18 waits per run needed a 4th predicate check (OS spurious condvar wake on that pipeline's own condvar, handled by the loop) | | 64 waiters on one pipeline, 20 rounds | worker at `NORMAL` inside the build, all 64 returned with the result, worker back at `LOWEST`, waiter count 0 and no worker record left | | 32 waiters with 5 to 36 ms budgets that all expire mid-build | worker back at `LOWEST` before the build ends | | Churn: 8 workers build 6000 pipelines while 24 threads wait with 0 to 3 ms budgets or `demand()` and drop | no hang (57 to 94 ms), every worker ends at `LOWEST`, every `Completion` idle | | Worker builds A for a live waiter, then B with none | `NORMAL` in A, `LOWEST` in B and after | | Waiter thread panics while holding a `demand()` guard | `NORMAL` during, `LOWEST` after the unwind, waiter count 0 | | Worker 1 builds A for a live waiter and inside waits on B built by worker 2 | worker 2 boosted while worker 1 waits; worker 1 back at `LOWEST` after (worker 2's priority after its build was not sampled) | I also checked whether a caller blocked in `masked_for` (which calls `p.make()` without `demand()`) can leave a worker at `LOWEST`. A forced synthetic case does (`-2`), but the masked twin is only ever passed to `masked_for`, never to `ready`/`early`, so it and its own format variants are built inline on the caller and no worker holds them. The path is not reachable today. **Wake latency vs `main`** (same test file on both sides, `until_made` + `make_with`, 8 waiters on their own pipelines, 300 trials x 8 = 2400 samples per run, 3 runs, publish to return in us, debug build so absolute numbers are higher than a release build) | Scenario | `main` p50 / p95 | PR p50 / p95 | |---|---|---| | 64 unrelated completions, then the 8 targets right after | 4 to 5 / 23 to 42 | 20 to 21 / 38 to 52 | | 64 unrelated, 2 ms pause, then targets | 14 to 15 / 88 to 98 | 21 to 22 / 42 to 49 | | no unrelated completions (PR only, control) | n/a | 16 to 17 / 33 to 34 | 0 lost waits on either side. In the first row `main` returns faster, most likely because its waiters are already awake from the 64 unrelated `notify_all` calls when their own pipeline lands; on the PR they stay parked and pay a normal wake. With both sides parked (second row) the PR has a higher median and about half the p95. So in this harness the PR shows a tighter p95 when both sides are parked, not a lower median. I did not count unrelated wakeups on `main`. I did not reproduce the PR's release-build numbers. Not checked: an in-game run, a release-build benchmark, behaviour with real driver compiles, and Win32 priority effects under actual CPU contention (the tests read the priority value, they do not measure scheduling). GPUs tested: n/a (CPU-only tests). AI-assisted: yes (Claude Code).
merzleckeier commented 2026-12-02 15:18:38 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-02T15:18:38Z.

Review: COMMENTED


A live waiter cannot boost an already-running worker under Wine 11.22 with the submitted handle mask. I tested 8eedef9b on main 83046a71 using the MSVC-target diagnostics build. The stock pipeline::make:: suite passed 35/36. priority_tracks_live_waiters_during_an_early_build saw the worker stay at -2 after a waiter parked, where it expected 0.

Logging the two calls in a scratch build showed OpenThread(THREAD_SET_LIMITED_INFORMATION, ...) succeeded, then SetThreadPriority returned zero with Win32 error 5 (ERROR_ACCESS_DENIED). Changing only the requested mask to THREAD_SET_INFORMATION made all 36 tests pass in the same Wine prefix. This includes the in-flight boost, the return to base priority after the final waiter leaves, and the independence of refusal wakeups. Microsoft documents both access masks for SetThreadPriority. Win32 documentation

The result measures Win32 priority values using synthetic workers. Actual compile latency and scheduler throughput were outside the run. git merge-tree also merged this head cleanly with #2789 and #3150 individually. AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6153697293 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3132#pullrequestreview-6153697293). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-02T15:18:38Z. **Review:** COMMENTED --- **A live waiter cannot boost an already-running worker under Wine 11.22 with the submitted handle mask.** I tested `8eedef9b` on `main` `83046a71` using the MSVC-target diagnostics build. The stock `pipeline::make::` suite passed 35/36. `priority_tracks_live_waiters_during_an_early_build` saw the worker stay at `-2` after a waiter parked, where it expected `0`. Logging the two calls in a scratch build showed `OpenThread(THREAD_SET_LIMITED_INFORMATION, ...)` succeeded, then `SetThreadPriority` returned zero with Win32 error 5 (`ERROR_ACCESS_DENIED`). Changing only the requested mask to `THREAD_SET_INFORMATION` made all 36 tests pass in the same Wine prefix. This includes the in-flight boost, the return to base priority after the final waiter leaves, and the independence of refusal wakeups. Microsoft documents both access masks for `SetThreadPriority`. [Win32 documentation](https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-setthreadpriority) The result measures Win32 priority values using synthetic workers. Actual compile latency and scheduler throughput were outside the run. `git merge-tree` also merged this head cleanly with #2789 and #3150 individually. AI-assisted with OpenAI Codex.
lixonik commented 2026-12-02 15:35:32 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-02T15:35:32Z.


RUN (in game) -- unit tests + 300 s render-path verification for PR #3132:

  • PR head SHA: 8eedef9b4
  • Merged onto main SHA: acc350745 (git merge --no-ff, clean merge)
  • Clean-room & switch-table checks:
    • python -I scripts/check_no_game_data.py PASS
    • python -I tools/d3d12_switches.py --check d3d12/docs/switches.md PASS
  • Unit tests (Windows 10 x64, Rust 1.98.1): cargo test -p leonida-gpu --features diagnostics --lib --locked pipeline:: -- --skip depth_bounds_pipeline_loads_and_filters_draws -- 65 passed, 0 failed, 8 ignored (all new pipeline::make::completion_tests::* and pipeline::library::tests::a_slow_offline_timing_is_not_evidence_of_a_draw passed; the skipped depth_bounds_pipeline_loads_and_filters_draws test is a pre-existing Windows 10 root-signature failure on main, tracked in #2855)
  • Build: diag profile (diagnostics,dlss,mimalloc), Series S profile, DLSS on, Frame Gen off, same restored save snapshot
  • GPU / Driver / OS: NVIDIA GeForce RTX 5070 (12 GB), driver 595.79, Windows 10 x64
Run Time to world Time in world World samples Device lost / crashes / errors Median rendered FPS (ms) Slowest / fastest tenth (fps) Median draws
PR #3132 (8eedef9b4 on acc350745) 117.5 s 315 s (434.1 s total) 64 0 / 0 / 0 26.7 fps (37.5 ms) 22.8 / 27.5 4,424
main alone (acc350745) 133.9 s 315 s (451.7 s total) 65 0 / 0 / 0 26.8 fps (37.4 ms) 21.9 / 27.6 4,397

Loaded into the world cleanly, stayed up past 300 s in-world with 0 device lost / 0 crashes / 0 ERROR lines, and closed cleanly. Rendered median FPS matches main (26.7 vs 26.8 fps) with a slightly tighter slowest tenth (22.8 vs 21.9 fps).

Verdict: PASS.

AI-assisted: yes (Antigravity).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7350586743 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3132#issuecomment-7350586743). Originally posted by [lixonik](https://github.com/lixonik) on 2026-12-02T15:35:32Z. --- RUN (in game) -- unit tests + 300 s render-path verification for PR #3132: - **PR head SHA:** `8eedef9b4` - **Merged onto `main` SHA:** `acc350745` (`git merge --no-ff`, clean merge) - **Clean-room & switch-table checks:** - `python -I scripts/check_no_game_data.py` PASS - `python -I tools/d3d12_switches.py --check d3d12/docs/switches.md` PASS - **Unit tests (Windows 10 x64, Rust 1.98.1):** `cargo test -p leonida-gpu --features diagnostics --lib --locked pipeline:: -- --skip depth_bounds_pipeline_loads_and_filters_draws` -- **65 passed, 0 failed, 8 ignored** (all new `pipeline::make::completion_tests::*` and `pipeline::library::tests::a_slow_offline_timing_is_not_evidence_of_a_draw` passed; the skipped `depth_bounds_pipeline_loads_and_filters_draws` test is a pre-existing Windows 10 root-signature failure on `main`, tracked in #2855) - **Build:** `diag` profile (`diagnostics,dlss,mimalloc`), Series S profile, DLSS on, Frame Gen off, same restored save snapshot - **GPU / Driver / OS:** NVIDIA GeForce RTX 5070 (12 GB), driver 595.79, Windows 10 x64 | Run | Time to world | Time in world | World samples | Device lost / crashes / errors | Median rendered FPS (ms) | Slowest / fastest tenth (fps) | Median draws | | --- | ---: | ---: | ---: | --- | ---: | ---: | ---: | | **PR #3132 (`8eedef9b4` on `acc350745`)** | 117.5 s | 315 s (434.1 s total) | 64 | **0 / 0 / 0** | **26.7 fps** (37.5 ms) | **22.8** / 27.5 | 4,424 | | **`main` alone (`acc350745`)** | 133.9 s | 315 s (451.7 s total) | 65 | **0 / 0 / 0** | **26.8 fps** (37.4 ms) | 21.9 / 27.6 | 4,397 | Loaded into the world cleanly, stayed up past 300 s in-world with 0 device lost / 0 crashes / 0 `ERROR` lines, and closed cleanly. Rendered median FPS matches `main` (`26.7` vs `26.8` fps) with a slightly tighter slowest tenth (`22.8` vs `21.9` fps). Verdict: **PASS**. AI-assisted: yes (Antigravity).
zmasi commented 2026-12-02 15:51:34 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-12-02T15:51:34Z.


Thanks @merzleckeier for catching and verifying that under Wine 11.22 (OpenThread(THREAD_SET_INFORMATION, ...) vs THREAD_SET_LIMITED_INFORMATION for SetThreadPriority), and thanks @Kal0s-design and @lixonik for the stress suites and 315 s in-game verification on 8eedef9b4!

To keep 8eedef9b4's verified 315 s Windows in-game run intact for review (CONTRIBUTING.md single-topic / current-head gate), I am leaving 8eedef9b4 untouched and will open the 1-line THREAD_SET_INFORMATION Wine follow-up PR as soon as this lands — or happy to push THREAD_SET_INFORMATION directly onto this branch if a maintainer prefers.

AI-assisted (Gemini 4 Carbon High).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7351045062 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3132#issuecomment-7351045062). Originally posted by [zmasi](https://github.com/zmasi) on 2026-12-02T15:51:34Z. --- Thanks @merzleckeier for catching and verifying that under Wine 11.22 (`OpenThread(THREAD_SET_INFORMATION, ...)` vs `THREAD_SET_LIMITED_INFORMATION` for `SetThreadPriority`), and thanks @Kal0s-design and @lixonik for the stress suites and 315 s in-game verification on `8eedef9b4`! To keep `8eedef9b4`'s verified 315 s Windows in-game run intact for review (`CONTRIBUTING.md` single-topic / current-head gate), I am leaving `8eedef9b4` untouched and will open the 1-line `THREAD_SET_INFORMATION` Wine follow-up PR as soon as this lands — or happy to push `THREAD_SET_INFORMATION` directly onto this branch if a maintainer prefers. AI-assisted (Gemini 4 Carbon High).
MoonEyes commented 2026-12-02 18:00:09 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T18:00:09Z.


Triage of head 8eedef9b4 (merge base d0bf821fa, 87 commits behind; git merge-tree against current main 45dc41f95: no conflicts).

5 files in leonida-gpu/src/pipeline/ (+405/-44), new make/completion.rs and its tests.

CI green on the head (6 checks, including d3d12 (windows-latest)).

Existing verification: Verified on this head by @Kal0s-design (pipeline:: 66 passed, full lib 783 passed, clippy clean) and @lixonik (in game, 300+ s, main acc350745). @merzleckeier found that under Wine SetThreadPriority needs THREAD_SET_INFORMATION; the author is leaving this head untouched and will send that one-line fix separately.

This check: Not re-reviewed in depth. Note for merge order: #3185 (COMPILE_GATE, on by default) serialises every compile in library::pipeline, which would largely cancel the per-pipeline waiter wake-ups and priority donation here; the two heads merge without textual conflict (merge-tree clean) but should not both land without a measurement of the combination.

I did not build it: the crate is Windows-only (or the C++ runtime's Windows build), so no red/green was run here.

Verdict: ready (verified in game on this head; Wine priority fix to follow separately; watch interaction with #3185).

AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.


Generated by Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7353849417 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3132#issuecomment-7353849417). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T18:00:09Z. --- **Triage of head `8eedef9b4` (merge base `d0bf821fa`, 87 commits behind; `git merge-tree` against current `main` `45dc41f95`: no conflicts).** 5 files in `leonida-gpu/src/pipeline/` (+405/-44), new `make/completion.rs` and its tests. CI green on the head (6 checks, including `d3d12 (windows-latest)`). **Existing verification:** Verified on this head by @Kal0s-design (pipeline:: 66 passed, full lib 783 passed, clippy clean) and @lixonik (in game, 300+ s, `main` `acc350745`). @merzleckeier found that under Wine `SetThreadPriority` needs `THREAD_SET_INFORMATION`; the author is leaving this head untouched and will send that one-line fix separately. **This check:** Not re-reviewed in depth. Note for merge order: #3185 (`COMPILE_GATE`, on by default) serialises every compile in `library::pipeline`, which would largely cancel the per-pipeline waiter wake-ups and priority donation here; the two heads merge without textual conflict (`merge-tree` clean) but should not both land without a measurement of the combination. I did not build it: the crate is Windows-only (or the C++ runtime's Windows build), so no red/green was run here. **Verdict: ready** (verified in game on this head; Wine priority fix to follow separately; watch interaction with #3185). AI-assisted verification: Claude Opus (Claude Code), separate agent per batch. --- _Generated by [Claude Code](https://claude.ai/code)_
fiestorra commented 2026-12-02 23:17:04 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-02T23:17:04Z.


VERIFY-3132 — Windows nativo: las cuatro pruebas de completación pasan y el control mata dos

Own commits 958bdee65, 20dab512d — pipeline/make.rs, make/completion.rs (+106), make/completion_tests.rs (+133), library.rs
Head 8eedef9b4 (the branch also merges main)

Ran at the head

cargo test -p leonida-gpu --lib completion     4 passed; 0 failed
  a_worker_with_a_waiter_restores_its_priority_even_on_unwind ... ok
  priority_tracks_live_waiters_during_an_early_build ... ok
  refusal_wakes_all_its_waiters_independently_of_another_pipeline ... ok
  a_request_whose_wait_budget_expired_does_not_boost_a_later_build ... ok

Negative control (synthetic): I made the worker boost unconditionally (let boosted = set_current(THREAD_PRIORITY_NORMAL);, dropping state.waiters != 0), rebuilt and ran:

FAILED. 2 passed; 2 failed

Two of the four bite, including the one that exists for exactly this: "a request whose wait budget expired does not boost a later build" — the comment is the change: "Only live callers donate priority. Queuing a cold backlog or running out of wait budget must not leave the whole worker pool boosted."

A fact worth having in the merge order: these two commits are the ones #3200 carries — I verified #3200 earlier tonight on the same pair (20dab512d, 958bdee65). So one of the two pull requests can be merged and the other closed as contained, and whichever is kept should say so in its description.

What I could not test

  • The priority donation under the title: it is a scheduler behaviour and the effect is in the frames; the tests pin the decisions, not the win.
  • The rest of the merged tree: only completion was run.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7361796877 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3132#issuecomment-7361796877). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-02T23:17:04Z. --- ## VERIFY-3132 — Windows nativo: las cuatro pruebas de completación pasan y el control mata dos | | | |---|---| | Own commits | `958bdee65`, `20dab512d` — `pipeline/make.rs`, `make/completion.rs` (+106), `make/completion_tests.rs` (+133), `library.rs` | | Head | `8eedef9b4` (the branch also merges `main`) | **Ran at the head** ``` cargo test -p leonida-gpu --lib completion 4 passed; 0 failed a_worker_with_a_waiter_restores_its_priority_even_on_unwind ... ok priority_tracks_live_waiters_during_an_early_build ... ok refusal_wakes_all_its_waiters_independently_of_another_pipeline ... ok a_request_whose_wait_budget_expired_does_not_boost_a_later_build ... ok ``` **Negative control (synthetic)**: I made the worker boost unconditionally (`let boosted = set_current(THREAD_PRIORITY_NORMAL);`, dropping `state.waiters != 0`), rebuilt and ran: ``` FAILED. 2 passed; 2 failed ``` **Two of the four bite**, including the one that exists for exactly this: *"a request whose wait budget expired does not boost a later build"* — **the comment is the change**: *"Only live callers donate priority. Queuing a cold backlog or running out of wait budget must not leave the whole worker pool boosted."* **A fact worth having in the merge order**: **these two commits are the ones #3200 carries** — I verified #3200 earlier tonight on the same pair (`20dab512d`, `958bdee65`). **So one of the two pull requests can be merged and the other closed as contained**, and whichever is kept should say so in its description. ## What I could not test - **The priority donation under the title**: it is a scheduler behaviour and the effect is in the frames; the tests pin the decisions, not the win. - **The rest of the merged tree**: only `completion` was run. Written with an AI assistant.
zmasi commented 2026-12-03 15:09:26 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-12-03T15:09:26Z.


Merged origin/main (128579e9ef, including #3333 compiler guard) into 3e36b182d0 (needs rebase), regenerating d3d12/docs/switches.md and wiring worker_lost (pipeline/make.rs) to call if p.made.set(None).is_ok() { p.completion.notify(); } before p.release_claim(slot) so guarded driver-compiler crashes wake per-pipeline Completion waiters immediately instead of burning the wait budget (72/72 pipeline:: tests pass).

AI-assisted: Gemini 4 Neon (XHigh) and Gemini 4 Carbon (High).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7382659513 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3132#issuecomment-7382659513). Originally posted by [zmasi](https://github.com/zmasi) on 2026-12-03T15:09:26Z. --- Merged `origin/main` (`128579e9ef`, including `#3333` compiler guard) into `3e36b182d0` (`needs rebase`), regenerating `d3d12/docs/switches.md` and wiring `worker_lost` (`pipeline/make.rs`) to call `if p.made.set(None).is_ok() { p.completion.notify(); }` before `p.release_claim(slot)` so guarded driver-compiler crashes wake per-pipeline `Completion` waiters immediately instead of burning the wait budget (`72/72` `pipeline::` tests pass). AI-assisted: Gemini 4 Neon (XHigh) and Gemini 4 Carbon (High).
MoonEyes commented 2026-12-03 16:18:28 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-03T16:18:28Z.


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 head 3e36b182d. Series S 1080, DLSS FG 2x, play-nvidia.ps1 -SeriesS -Resolution 1080 -FrameGen 2 -PrecompileUsed, scripted walk, 330 s.

  • Result: PASS. No device lost, no crash, no unhandled exception; the run ended on its time limit.
  • Median over the last 240 s: 17.2 fps (main alone today: 16-17.5); 15.7 frames per 1000 over 100 ms.
  • Covered: a normal launch and walk with this PR's code in the build. It does not isolate this PR's own change from the two others in the batch.

AI-assisted (Claude Opus 5.5), run and read by MoonEyes' agent.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7384618005 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3132#issuecomment-7384618005). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-03T16:18:28Z. --- 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 head `3e36b182d`. Series S 1080, DLSS FG 2x, `play-nvidia.ps1 -SeriesS -Resolution 1080 -FrameGen 2 -PrecompileUsed`, scripted walk, 330 s. - Result: **PASS**. No device lost, no crash, no unhandled exception; the run ended on its time limit. - Median over the last 240 s: 17.2 fps (main alone today: 16-17.5); 15.7 frames per 1000 over 100 ms. - Covered: a normal launch and walk with this PR's code in the build. It does not isolate this PR's own change from the two others in the batch. AI-assisted (Claude Opus 5.5), run and read by MoonEyes' agent.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3132:upstream-pr/3132'
git switch 'upstream-pr/3132'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/3132'
git switch 'upstream-pr/3132'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3132'
git switch 'upstream-pr/3132'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3132'
git switch 'main'
git merge --squash 'upstream-pr/3132'
git switch 'main'
git merge --ff-only 'upstream-pr/3132'
git switch 'main'
git merge 'upstream-pr/3132'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
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!3132
No description provided.