warm: distinguish compiler diagnostics from inactivity timeouts #3143
Open
github-bot
wants to merge 4 commits from
github-bot/gh-3143 into main
AGit
pull from: github-bot/gh-3143
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!3143
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3143"
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?
@merzleckeier on GitHub · 2026-12-02 13:53 UTC · original
merzleckeier:fix/warm-stack-overflow-diagnostic-refresh→main· +354 −36 · 2 files · 4 commits · openClaimed in the coordination issue as: WARM-STACK-OVERFLOW-DIAGNOSTIC
Follow-up to closed PR #2656. Addresses the diagnostic reported in #2621.
What and why
The
leonida warmsubprocess supervisor discards stderr. Under Wine, a compiler process can report a Rust stack overflow and remain alive, leaving the supervisor to record a generic inactivity timeout. This change reports the specific diagnostic and ends the child promptly.The watcher reads queued stdout and stderr until the direct child exits, so an inherited write handle cannot delay its return. Progress callbacks run in order on the caller thread while the watcher can terminate a stalled child independently. Compiler and library-store arguments, progress receipts, and ordinary exit status reporting are preserved.
Tested
main72d143c45withcargo xwin. All 55 passed under Wine 11.22 on CachyOS.git diff --checkand the repository's no-game-data check passed.GPUs tested: n/a (CPU only). Native Windows and a retail title were outside this test run.
AI-assisted: OpenAI Codex with GPT-6.2, independently reviewed read-only by GPT-6.2 Sol.
Checklist
main(72d143c45).@ecox982745 on GitHub · 2026-12-02 13:57 UTC · original
Integration check for
ff65cb2f: this PR and #3071 (c2065b54) each merge cleanly ontomain2fc7383b. A read-onlygit merge-treeof the two heads reports a content conflict ind3d12/apps/leonida/src/warm.rs. Both changechildand its process setup. Whichever follows should retain #3071’s--store --jobs Nforwarding and this PR’s piped stderr and watchdog. The normal non-store child should still get its idle priority. This is a merge-order note. AI-assisted, CPU-only.@merzleckeier on GitHub · 2026-12-02 14:09 UTC · original
I reproduced the overlap from the integration check on main
69cd4106cwith #3071c2065b540and #3143d7196402a. Both merge individually. The combined tree needs a local resolution for thechildsignature and the test imports inwarm.rs.The tested resolution retains the
jobsparameter,child_argsand idle priority from #3071, plus the piped streams and watcher from #3143. All 59 MSVC-target CLI unit tests passed under Wine 11.22, including the--store --jobsClap round trip, worker caps, inherited-pipe and independent-watchdog cases. The 20 switch-documentation tests passed as well. This was an isolated CPU-only test with synthetic inputs. Both original branches remain available for independent merge. AI-assisted with OpenAI Codex.@Kal0s-design on GitHub · 2026-12-02 15:19 UTC · original
Ran natively on Windows 11, head
d7196402amerged into currentmain(43fc605ed, merges cleanly), MSVC target, toolchain 1.98.1,--locked.cargo test -p leonida --bin leonida warm::cargo test -p leonida(all)tests/test_d3d12_switches.pymaincollect_childdoesn't exist)cargo clippy -p leonida --all-targetszombie_processeson theholdhelper spawned by theinheritedfixture (warm.rs,fixture_command("hold")...spawn()). CI does not run clippy, so nothing fails.Extra throwaway cases (not committed), added as more fixture modes and run through
collect_child, quiet limit 2 s unless noted:compiler process stack overflowat 1.87 scompiler process stack overflowat 0.05 shung for 2 spoll(true, ..), so the partial stderr line is never checked(1, Some("compiler process stack overflow"))hung for 2 smain's reader loop on the same fixture. It stops reading at the first such line, its watchdog stops too and the pipe is dropped. The fixture then died writing to the broken pipe (exit code: 101, 0.5 s). A child that ignored the write error would be waited on with no timeout, so the PR's result is the better onemadelinemadelines reported,(2, None)process::abort()exit code: 0xc0000409taskkill /F) after 0.7 sexit code: 1at 1.06 s(2, None)in 6.6 smain): 0.04 s(2, None)in 17.5 sBufReader::lines()reader (as onmain): 4.8 s. Both are debug buildsThe two edge cases I'd look at:
stderr.poll(true, &mut is_stack_overflow)after the kill would cover it at no cost. It would also catch a complete diagnostic line that arrives in the last 50 ms before the timeout. (main's loop giveshung for 2 shere too.)child(todo, Some(&listed), ..)), the library is then reported as "not written" and the fingerprint goes to the failed list, even though the child succeeded. Checkingstatus.success()before the stderr result would keep a clean exit clean.On throughput: the 50 ms poll makes a child that writes a lot to stderr wait on the pipe. That only matters if the compiler (or Wine's debug channels) writes megabytes per pipeline. That is not normal output, so I'm only noting it.
Not checked: Wine (the case the PR is for), a real compiler stack overflow, the combined resolution with #3071 (already covered above), a release build.
GPUs tested: n/a (CPU-only tests).
AI-assisted: yes (Claude Code).
@merzleckeier on GitHub · 2026-12-02 15:27 UTC · original
Thanks for testing this natively on Windows.
b6023d1dcaddresses both findings. The watcher now drains the final stderr fragment after stopping and reaping the child. A confirmed exit code 0 from the direct child takes precedence over a matching line on shared stderr. The scoped Clippy expectation documents why the fixture helper must outlive its parent.Both added regression tests failed against the published implementation at
d7196402a. On the updated PR merged locally intomainat0d6757b70, all 57 MSVC-target CLI tests and five Leonida integration tests passed under Wine 11.22. The 20 switch-documentation tests passed, and the MSVC-target Clippy run produced no warning inwarm.rs.GPU testing was not applicable to these synthetic subprocess cases. AI-assisted with OpenAI Codex, with a separate read-only review by GPT-6.2 Sol.
@fiestorra on GitHub · 2026-12-02 15:54 UTC · original
Verified on native Windows, which is the side the body says was not run:
cargo xwin+ Wine there, native here - thewarmtests pass, and a realwarmrun comes out clean.The checker first:
red does not buildis the correct answer, not a failure: the new tests use aniothe change imports, so they cannot compile on the base - the same shape as any PR whose tests need the new code. The green side builds and its 57 tests pass.Then the tests that matter here, run natively (
cargo test -p leonida --bins -- --test-threads=1 warm, 1.1 min, headb6023d1dc):returns_before_an_inherited_stderr_handle_closesis the one worth naming: inherited handles and how a child's stderr closes are exactly where Wine and Windows differ, so this is the test the Wine run could not speak for, and it passes here.And a real run,
leonida warm --limit 40 --jobs 8on this machine's own book (a copy of a cache from a real run):0 ended their processis the line this change is about - the watcher distinguishes a diagnostic from an inactivity timeout - and the new summary prints the per-pipeline spread without a crash. (The 83,563 also settles something I claimed in #3041 from the module's notes: the title really does create about 84,000 pipelines.)What it does not cover: a compiler that actually overflows - that needs an 8 GiB card and a title run - and the game, which this machine cannot start.
AI-assisted: yes - DeepSeek v4.1 (flash).
Written with an AI assistant.
@MoonEyes on GitHub · 2026-12-02 18:18 UTC · original
Verification of #3143 (third party, code review on Linux; not built: Windows-only
leonidaapp)b6023d1dcb20e13cff75c61091577cfb7beacb1e(2 files:apps/leonida/src/warm.rs+352/-35,docs/switches.md).72d143c45.git merge-tree --write-tree origin/main pr/3143againstmain45dc41f95is clean(46 commits behind). CI on the head: 6/6 success.
python -I scripts/check_no_game_data.pyon both files: exit 0.warm.rs(childsignature and the test imports), as ecox982745 andmerzleckeier reported. Whichever lands second must keep #3071's
--store --jobs Nforwarding.Review
process stays alive, was recorded as a generic inactivity timeout. With stderr piped, the child is ended on the
thread '..' has overflowed its stackline (is_stack_overflow) and the reason is reported. This fixes thediagnostic at its source.
try_wait) instead of stdout EOF. That is right when a helperinherits the pipe and outlives the child (the comment at
PipeLines). A confirmed exit 0 takes precedence overa matching stderr line, and the final stderr fragment is drained after kill and reap. Both follow the native
review on the previous head.
watch_childdrains withPeekNamedPipeand sleeps 50 ms per loop.An anonymous pipe's buffer is small (about 4 KiB by default). A child that writes progress faster than one
buffer per 50 ms blocks on its own stdout, so the supervisor would throttle the compile. A warm run with
tens of thousands of shaders and parallel children could reach that rate. A timing of a full
warmonmainagainst the PR would settle it. fiestorra's "real warm run comes out clean" shows correctness, not
throughput.
pipe_bytes_availabledeclaresPeekNamedPipeby hand through#[link(name = "kernel32")]. The app doesnot depend on
windows-sysdirectly, so this avoids a new dependency. That is acceptable.std::os::windowsimport inwarm.rsis fine:mod warmis#[cfg(windows)](
main.rs:25-26).warm_child_fixturere-executes the test binary as a fake child (hold, overflow line, helperkeeping the pipe). That is a sound way to test the supervisor without a compiler. fiestorra's
python -I scripts/red_green.py 3143and Kal0s-design's 8warm::tests ran natively.Process
Verdict: ready on review (not built here). Point 1 is worth one timing run before merge. Coordinate the
warm.rsmerge with #3071.AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.
Generated by Claude Code
@MoonEyes on GitHub · 2026-12-02 22:00 UTC · original
This pull request touches the render path, so it needs an in-game run before it can be merged: unit tests and CI do not catch rendering regressions (a device loss after an earlier merge is why this gate exists).
Could you, or anyone with a working setup, post a run report on the current head merged onto current
main:mainSHA it was merged onto;mainalone for comparison, if you can.Please do not attach logs or screenshots that show game content. If a run on this exact head is already posted, a link to it in a reply is enough.
AI-assisted (Claude Code).
@fiestorra on GitHub · 2026-12-02 23:19 UTC · original
VERIFY-3143 — Windows nativo: las pruebas de
warmpasan y el control mata dosb6023d1dc—apps/leonida/src/warm.rs, +52/−4 (and its tests in the same file)Ran at the head
Negative control (synthetic): I replaced the stack-overflow reason with a dummy string (
break String::from("no overflow")), rebuilt and ran:Two bite — the one named after the stack overflow and the one that reads the final diagnostic.
What the change is, and why it is not cosmetic: the warm-up child's exit status is now preserved when a helper shares its stderr ("the direct child's successful exit takes precedence"), a stack overflow is reported before waiting out the timeout (a child that died on overflow never closes its own handle, so the old code waited the full budget), and the last diagnostic is read when the child exits. All three are "the run looks like a timeout when it is really a crash" — the kind of failure that costs an hour of reading logs.
Note on how it was run, because the test naming lies to a script:
cargo test -p leonida --lib warmfinds nothing (the app is a binary:no library targets found), and the plaincargo test -p leonida warmprints0 passedfor the other targets before the binary's own line — the six warm tests are in--bin leonida.What I could not test
warm.rsdrives the shader/pipeline warm-up child against the title's toolchain; the tests use a fixture child. No title, no warm-up here.Written with an AI assistant.
@merzleckeier on GitHub · 2026-12-02 23:25 UTC · original
Follow-up to the pipe throughput question. I put the reader from
main(81efe4566, same warm code asef35d683e) and the watcher fromb6023d1dcin the same MSVC-target harness and ran it under Wine 11.22. The synthetic direct child flushed a realisticatline andmadeline per record, as fast as it could. Every run checked the status, callback count and pipeline ID checksum.mainmedianMedians are from three runs per row per version. The baseline includes the old 500 ms watchdog join. The largest stdout burst added about 100 ms in this Wine setup. This measures pipe handling only. Thanks for the native Windows regression check. The requested in-game run remains open. AI-assisted.
@merzleckeier on GitHub · 2026-12-03 14:52 UTC · original
I checked the warm-bad report in coordination against current
128579e9and #3143b6023d1d. The warm scheduler is byte-identical in both.With three synthetic keys and a worker stub that exits before reporting any pipeline, the scheduler puts the first key in
warm-bad.txtand continues with the remaining two. The same happens for a timeout before progress. In either case--againstill excludes the first key. Changing the driver/translation fingerprint in the fixture also leaves it excluded. A control without the saved bad entry schedules and completes all three.This confirms the bookkeeping behavior independently of the reported driver incident. #3143 improves the diagnostic from the worker. Identifying which pipeline was actually attempted and deciding when to retry recorded failures are separate scheduling questions. AI-assisted (Codex).
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.