[pr-fix][shaders] Pipelines in warm-bad.txt are refused in play too #365

Open
jensmonne wants to merge 1 commit from jensmonne/Darner:pr/warm-bad-in-play into main
Contributor

Contributor role (optional)

  • Fluxer ID: 1577631603876691968

What it changes

  • The problem on main: read from the code; warms here list such pipelines (numbers below), but I have not caught a run hanging on one. darner warm writes a pipeline whose compile crashed or hung a child process to warm-bad.txt, and warm and preload then skip it. A run does not read that file, so it compiles the pipeline again, and this time inside the game. When the driver's compiler hangs on it, a pipeline worker never comes back, and every draw that waits for that pipeline spends its frame's wait budget. When the compiler crashes, the game ends.

A run now refuses those pipelines at once. It reads the keys warm-bad.txt lists under the run's own warm fingerprint (translator and its settings, driver, program path, card), so after an update of the driver or the translator they are compiled again, as in the warm. The refusal happens in Pending::make, the one place a run builds a host pipeline, so a refused one completes and wakes its waiters like any other refusal, and what it would have drawn is missing, as with the other refusals. The fingerprint, program() and the warm-bad.txt reader move from apps/darner/src/warm.rs to crates/darner-gpu/src/pipeline/known.rs (the fingerprint renamed warm_fingerprint, all three made public, their bodies unchanged), so the warm and the game use the same code. Their test moves with them. DARNER_WARM_BAD=0 makes the game compile them, as it already makes the warm retry them. The README row for DARNER_WARM_BAD says so.

How it was tested

  • Tested revision: 7615611 (this branch, on main f3840d7).

  • Commands and results (cross-built on Linux with cargo xwin, target x86_64-pc-windows-msvc; tests run under Proton Experimental 11.0-20261123b's Wine with its vkd3d-proton and DXVK DLLs and Microsoft's d3dcompiler_47):

    • cargo xwin clippy --workspace --all-targets --locked --target x86_64-pc-windows-msvc -- -D warnings: clean.
    • cargo xwin clippy --workspace --all-targets --all-features --locked --target x86_64-pc-windows-msvc -- -D warnings: clean.
    • darner-gpu lib tests filtered to pipeline::known and pipeline::make, under Wine: 63 passed, 2 failed. On main f3840d7: 62 passed, the same 2 failed (a_waiting_draw_raises_the_worker_making_its_pipeline, a_dispatch_waiting_on_a_worker_raises_it; they assert a raised thread priority, 2 of 2 runs each). The moved the_quarantine_follows_the_fingerprint_and_keeps_older_lines passes.
    • darner bin tests filtered to warm::, under Wine: 22 passed.
    • No test covers warm_bad itself: it reads the cache folder once per process.
  • Changes a default: yes, for every setup with a warm-bad.txt. It only matters where a warm has listed pipelines, which so far means the driver's compiler crashed or hung on them.

  • A/B result: same save, scripted walk (menus, a 150-second walk, then standing), about 6 minutes in the world each, after a warm of this build that listed 2 pipelines under its fingerprint (both "hung for 180 s"). A = DARNER_WARM_BAD=0, B = not set. One run each:

    A (off) B (on)
    median fps 25.4 26.6
    10th percentile fps 23.3 25.6
    seconds below 5 fps 14 of 365 12 of 364
    "are refused" line absent pipelines=2

    The log line in B shows the game's fingerprint matches the warm's, so the run found both listed pipelines. Neither log names those two keys, so I cannot tell whether this walk asked for them; the frame-rate difference is within what I see between identical runs here (about 5 %), and I would not read it as an effect. Neither run hung, crashed or panicked.

  • Gates run on that revision: 1 and 2 (the two clippy commands above). Gate 3 (cargo test --workspace) was not run: only the filtered tests above, under Wine.

  • Gameplay: the A/B above, on this revision plus my local Linux patches that are not part of this PR (64 MB pipeline worker stacks, a guard for driver compiler crashes, two input helpers for scripted runs). RTX 5080, NVIDIA 620.73, Proton Experimental 11.0-20261123b, Series X profile, 2560x1440, DLSS Super Resolution at the quality scale, frame generation off, uncapped.

  • Shader wave sizes tested: not applicable (no translator change).

  • Hardware dependence: likely general (any card whose driver crashes or hangs on a pipeline in the warm). Under Wine on NVIDIA a warm of this build listed 2 (both "hung for 180 s"); earlier builds here listed 2 to 3 each, and once one with "exit code: 1".

  • Coverage gaps: not run on Windows. No Windows setup with a listed pipeline was tested. Gate 3 was not run in full. The A/B does not show a run that would have hung without this change: one run each, and the walk may not reach the listed pipelines.

Checklist

  • I ran this change in the game, or say below why it can't be (docs, tests only).
  • This PR contains one change based on main.
  • The diff follows docs/asset-policy.md.
  • I recorded this PR's dependencies below.
    • Depends on: none

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
  • Related PRs: #264 also handles warm-bad.txt (which cache files a translator change clears); the two merge without conflict, and this PR reads the file per fingerprint either way. Same files: #165, #215, #234, #266 and #270 change apps/darner/src/warm.rs; #187, #247, #350 and #352 change pipeline/make.rs. Each merges with this branch without conflict. Of the 44 other open pull requests that change README.md, the ones that merge with main also merge with this branch.
  • Replaces or overlaps: none found (searched the diffs of all 169 open pull requests for warm-bad and warm_bad, and open and closed issues and pull requests for warm-bad, WARM_BAD, quarantine, "hung for", "compiler crash" and "pipeline hang").
## Contributor role (optional) - Fluxer ID: 1577631603876691968 ## What it changes - The problem on main: read from the code; warms here list such pipelines (numbers below), but I have not caught a run hanging on one. `darner warm` writes a pipeline whose compile crashed or hung a child process to `warm-bad.txt`, and `warm` and `preload` then skip it. A run does not read that file, so it compiles the pipeline again, and this time inside the game. When the driver's compiler hangs on it, a pipeline worker never comes back, and every draw that waits for that pipeline spends its frame's wait budget. When the compiler crashes, the game ends. A run now refuses those pipelines at once. It reads the keys `warm-bad.txt` lists under the run's own warm fingerprint (translator and its settings, driver, program path, card), so after an update of the driver or the translator they are compiled again, as in the warm. The refusal happens in `Pending::make`, the one place a run builds a host pipeline, so a refused one completes and wakes its waiters like any other refusal, and what it would have drawn is missing, as with the other refusals. The fingerprint, `program()` and the `warm-bad.txt` reader move from `apps/darner/src/warm.rs` to `crates/darner-gpu/src/pipeline/known.rs` (the fingerprint renamed `warm_fingerprint`, all three made public, their bodies unchanged), so the warm and the game use the same code. Their test moves with them. `DARNER_WARM_BAD=0` makes the game compile them, as it already makes the warm retry them. The README row for `DARNER_WARM_BAD` says so. ## How it was tested - Tested revision: 7615611 (this branch, on main f3840d7). - Commands and results (cross-built on Linux with `cargo xwin`, target `x86_64-pc-windows-msvc`; tests run under Proton Experimental 11.0-20261123b's Wine with its vkd3d-proton and DXVK DLLs and Microsoft's d3dcompiler_47): - `cargo xwin clippy --workspace --all-targets --locked --target x86_64-pc-windows-msvc -- -D warnings`: clean. - `cargo xwin clippy --workspace --all-targets --all-features --locked --target x86_64-pc-windows-msvc -- -D warnings`: clean. - `darner-gpu` lib tests filtered to `pipeline::known` and `pipeline::make`, under Wine: 63 passed, 2 failed. On main f3840d7: 62 passed, the same 2 failed (`a_waiting_draw_raises_the_worker_making_its_pipeline`, `a_dispatch_waiting_on_a_worker_raises_it`; they assert a raised thread priority, 2 of 2 runs each). The moved `the_quarantine_follows_the_fingerprint_and_keeps_older_lines` passes. - `darner` bin tests filtered to `warm::`, under Wine: 22 passed. - No test covers `warm_bad` itself: it reads the cache folder once per process. - Changes a default: yes, for every setup with a `warm-bad.txt`. It only matters where a warm has listed pipelines, which so far means the driver's compiler crashed or hung on them. - A/B result: same save, scripted walk (menus, a 150-second walk, then standing), about 6 minutes in the world each, after a warm of this build that listed 2 pipelines under its fingerprint (both "hung for 180 s"). A = `DARNER_WARM_BAD=0`, B = not set. One run each: | | A (off) | B (on) | |---|---|---| | median fps | 25.4 | 26.6 | | 10th percentile fps | 23.3 | 25.6 | | seconds below 5 fps | 14 of 365 | 12 of 364 | | "are refused" line | absent | `pipelines=2` | The log line in B shows the game's fingerprint matches the warm's, so the run found both listed pipelines. Neither log names those two keys, so I cannot tell whether this walk asked for them; the frame-rate difference is within what I see between identical runs here (about 5 %), and I would not read it as an effect. Neither run hung, crashed or panicked. - Gates run on that revision: 1 and 2 (the two clippy commands above). Gate 3 (`cargo test --workspace`) was not run: only the filtered tests above, under Wine. - Gameplay: the A/B above, on this revision plus my local Linux patches that are not part of this PR (64 MB pipeline worker stacks, a guard for driver compiler crashes, two input helpers for scripted runs). RTX 5080, NVIDIA 620.73, Proton Experimental 11.0-20261123b, Series X profile, 2560x1440, DLSS Super Resolution at the quality scale, frame generation off, uncapped. - Shader wave sizes tested: not applicable (no translator change). - Hardware dependence: likely general (any card whose driver crashes or hangs on a pipeline in the warm). Under Wine on NVIDIA a warm of this build listed 2 (both "hung for 180 s"); earlier builds here listed 2 to 3 each, and once one with "exit code: 1". - Coverage gaps: not run on Windows. No Windows setup with a listed pipeline was tested. Gate 3 was not run in full. The A/B does not show a run that would have hung without this change: one run each, and the walk may not reach the listed pipelines. ## Checklist - [x] I ran this change in the game, or say below why it can't be (docs, tests only). - [x] This PR contains one change based on `main`. - [x] The diff follows `docs/asset-policy.md`. - [x] I recorded this PR's dependencies below. - Depends on: none ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: #264 also handles `warm-bad.txt` (which cache files a translator change clears); the two merge without conflict, and this PR reads the file per fingerprint either way. Same files: #165, #215, #234, #266 and #270 change `apps/darner/src/warm.rs`; #187, #247, #350 and #352 change `pipeline/make.rs`. Each merges with this branch without conflict. Of the 44 other open pull requests that change `README.md`, the ones that merge with `main` also merge with this branch. - Replaces or overlaps: none found (searched the diffs of all 169 open pull requests for warm-bad and warm_bad, and open and closed issues and pull requests for warm-bad, WARM_BAD, quarantine, "hung for", "compiler crash" and "pipeline hang").
A warm writes the pipelines whose compile crashed or hung a child process
to warm-bad.txt, but only the warm and the preload skip them; a run
compiled them again. A run now refuses those listed under its own warm
fingerprint (translator, driver, program path, card) at once. The
fingerprint and the warm-bad.txt reader move from warm.rs to
pipeline/known.rs so both use the same code. DARNER_WARM_BAD=0 makes them,
as in the warm.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'pr/warm-bad-in-play:jensmonne-pr/warm-bad-in-play'
git switch 'jensmonne-pr/warm-bad-in-play'

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 'jensmonne-pr/warm-bad-in-play'
git switch 'jensmonne-pr/warm-bad-in-play'
git rebase 'main'
git switch 'main'
git merge --ff-only 'jensmonne-pr/warm-bad-in-play'
git switch 'jensmonne-pr/warm-bad-in-play'
git rebase 'main'
git switch 'main'
git merge --no-ff 'jensmonne-pr/warm-bad-in-play'
git switch 'main'
git merge --squash 'jensmonne-pr/warm-bad-in-play'
git switch 'main'
git merge --ff-only 'jensmonne-pr/warm-bad-in-play'
git switch 'main'
git merge 'jensmonne-pr/warm-bad-in-play'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
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
TrustNo1/Darner!365
No description provided.