Warm: a process that ends before it begins a pipeline blames none #1931

Open
joeypercia wants to merge 1 commit from upstream-pr/1931 into main
joeypercia commented 2026-11-29 03:11:46 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by joeypercia on 2026-11-29T03:11:46Z.


What it changes

When a warm process ended badly, the parent noted the first pipeline of what that process had left in warm-bad.txt and started the next process at once. A process that never began a pipeline — 0xc0000142 (DLL initialization failed), which Windows returns when the PC is out of desktop heap or other session resources — was taken for one that crashed the compiler on that pipeline. With ten workers, each failed start blamed one more pipeline and started another process straight away.

On my PC, a preload of 88,562 pipelines made 3,837, then every new process failed to start: 577 pipelines were written to warm-bad.txt in a few seconds, every one of them exit code: 0xc0000142, and the PC went down shortly after. Every later preload, and the step that fills the pipeline library, leaves those 577 out (bad.contains(key)), so they were never built ahead of a run again.

This PR:

  • has child report the pipeline the process had begun (at n, which known::make already prints before each one) and not finished, and blames only that one, wherever it lies in the rest (pipelines with no entry are passed over without a line, so it isn't always the first);
  • treats a process that ended before it began any pipeline as a failed start: no pipeline is noted, and it is started again after 2, 4, 8, 16 s; after 5 failed starts in a row the worker stops (break 'chunks) and prints that the next preload goes on with what is left. Only processes that made no pipeline count: one that made some and ended between two starts the count again and the rest goes on at once (failed_in_a_row). A process that could not be spawned at all, which before this was taken as having made its whole chunk (skipped silently), is a failed start the same way.

A process that crashes or hangs on a pipeline is still noted as before.

How it was tested

  • GPU and profile: RTX 4070 Ti 12 GB, Windows 11 26200, 32 GB RAM; not a renderer change.
  • Before: the preload above, on d4b5d51: 577 0xc0000142 lines in warm-bad.txt (all of its lines), no real compiler crash among them.
  • After: after() and pause() have unit tests (warm::tests): a process that ended at a pipeline blames that one, also when it is not the first left; one that ended before it began any blames none and is tried again; the pause grows 2, 4, 8, 16 s and stops at 30; processes that made pipelines never stop a worker, and progress after empty ones starts the count again (a_process_that_made_pipelines_is_no_failed_start, @ANDREANIADS's two sequences). I did not rerun a full preload on this branch (it exhausts this PC's resources, which is how the bug showed).
  • For shader changes, the wave sizes tested: not a shader change.
  • cargo test passed for the crates it touches: yes, cargo test --locked -p victory on 1d00f27 (on main 568c5e5): 32 passed, 0 failed, and 2 passed, 0 failed.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: #779 (the warm-bad.txt quarantine follows the fingerprint, and VICTORY_WARM_BAD=0 retries it; it still blames a pipeline for a process that never started) and #1923 (child's callback reports why a pipeline has no host pipeline); both edit lines next to these and will conflict textually, but neither changes how a failed start is blamed.

Written with Claude Code (Claude Opus 5.5): it found the bug in the preload output, wrote the change, the tests and this description, and ran the tests above.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5547084660 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1931). Originally posted by [joeypercia](https://github.com/joeypercia) on 2026-11-29T03:11:46Z. --- ## What it changes When a `warm` process ended badly, the parent noted the first pipeline of what that process had left in `warm-bad.txt` and started the next process at once. A process that never began a pipeline — `0xc0000142` (DLL initialization failed), which Windows returns when the PC is out of desktop heap or other session resources — was taken for one that crashed the compiler on that pipeline. With ten workers, each failed start blamed one more pipeline and started another process straight away. On my PC, a `preload` of 88,562 pipelines made 3,837, then every new process failed to start: **577 pipelines were written to `warm-bad.txt` in a few seconds, every one of them `exit code: 0xc0000142`**, and the PC went down shortly after. Every later `preload`, and the step that fills the pipeline library, leaves those 577 out (`bad.contains(key)`), so they were never built ahead of a run again. This PR: - has `child` report the pipeline the process had begun (`at n`, which `known::make` already prints before each one) and not finished, and blames only that one, wherever it lies in the rest (pipelines with no entry are passed over without a line, so it isn't always the first); - treats a process that ended before it began any pipeline as a failed start: no pipeline is noted, and it is started again after 2, 4, 8, 16 s; after 5 failed starts in a row the worker stops (`break 'chunks`) and prints that the next preload goes on with what is left. Only processes that made no pipeline count: one that made some and ended between two starts the count again and the rest goes on at once (`failed_in_a_row`). A process that could not be spawned at all, which before this was taken as having made its whole chunk (skipped silently), is a failed start the same way. A process that crashes or hangs on a pipeline is still noted as before. ## How it was tested - GPU and profile: RTX 4070 Ti 12 GB, Windows 11 26200, 32 GB RAM; not a renderer change. - Before: the `preload` above, on `d4b5d51`: 577 `0xc0000142` lines in `warm-bad.txt` (all of its lines), no real compiler crash among them. - After: `after()` and `pause()` have unit tests (`warm::tests`): a process that ended at a pipeline blames that one, also when it is not the first left; one that ended before it began any blames none and is tried again; the pause grows 2, 4, 8, 16 s and stops at 30; processes that made pipelines never stop a worker, and progress after empty ones starts the count again (`a_process_that_made_pipelines_is_no_failed_start`, @ANDREANIADS's two sequences). I did not rerun a full preload on this branch (it exhausts this PC's resources, which is how the bug showed). - For shader changes, the wave sizes tested: not a shader change. - `cargo test` passed for the crates it touches: yes, `cargo test --locked -p victory` on `1d00f27` (on `main` `568c5e5`): 32 passed, 0 failed, and 2 passed, 0 failed. ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #779 (the `warm-bad.txt` quarantine follows the fingerprint, and `VICTORY_WARM_BAD=0` retries it; it still blames a pipeline for a process that never started) and #1923 (`child`'s callback reports why a pipeline has no host pipeline); both edit lines next to these and will conflict textually, but neither changes how a failed start is blamed. Written with Claude Code (Claude Opus 5.5): it found the bug in the `preload` output, wrote the change, the tests and this description, and ran the tests above.
ANDREANIADS commented 2026-11-29 03:24:27 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ANDREANIADS on 2026-11-29T03:24:27Z.


At 36e4c8a, try a chunk [1,2,3,4,5,6] and five synthetic abnormal exits. On attempt N the reader gets at N, then made N 0 1, then EOF before the next at. In an isolated Rust replay of the reader and worker decision, no pipeline was blamed, but failed_starts reached 5 and the worker stopped with pipeline 6 pending. Four empty attempts followed by one completed pipeline also stopped the worker. Five genuinely empty attempts stopped as intended.

Could the Again branch reset the failed-start streak when made > 0 and count only attempts with zero progress toward STARTS? A regression test for the mixed sequence would cover this distinction. Tested with synthetic CPU state transitions only, without a Windows child process or GPU.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7250028618 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1931#issuecomment-7250028618). Originally posted by [ANDREANIADS](https://github.com/ANDREANIADS) on 2026-11-29T03:24:27Z. --- At `36e4c8a`, try a chunk `[1,2,3,4,5,6]` and five synthetic abnormal exits. On attempt N the reader gets `at N`, then `made N 0 1`, then EOF before the next `at`. In an isolated Rust replay of the reader and worker decision, no pipeline was blamed, but `failed_starts` reached 5 and the worker stopped with pipeline 6 pending. Four empty attempts followed by one completed pipeline also stopped the worker. Five genuinely empty attempts stopped as intended. Could the `Again` branch reset the failed-start streak when `made > 0` and count only attempts with zero progress toward `STARTS`? A regression test for the mixed sequence would cover this distinction. Tested with synthetic CPU state transitions only, without a Windows child process or GPU.
joeypercia commented 2026-11-29 03:33:34 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by joeypercia on 2026-11-29T03:33:34Z.


@ANDREANIADS thanks, you're right: a process that made pipelines and ended between two counted toward the five. Fixed in b2cedf7 (squashed into the PR's commit): failed_in_a_row counts only processes that made no pipeline, and one that made some starts the count again and the rest goes on at once. a_process_that_made_pipelines_is_no_failed_start checks your two sequences (five attempts with one pipeline each never stop the worker; four empty ones then one with progress reset it) next to five empty ones, which still stop it. cargo test --locked -p victory: 32 passed, 0 failed, and 2 passed, 0 failed.

(Written with Claude Code, Claude Opus 5.5.)

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7250120701 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1931#issuecomment-7250120701). Originally posted by [joeypercia](https://github.com/joeypercia) on 2026-11-29T03:33:34Z. --- @ANDREANIADS thanks, you're right: a process that made pipelines and ended between two counted toward the five. Fixed in `b2cedf7` (squashed into the PR's commit): `failed_in_a_row` counts only processes that made no pipeline, and one that made some starts the count again and the rest goes on at once. `a_process_that_made_pipelines_is_no_failed_start` checks your two sequences (five attempts with one pipeline each never stop the worker; four empty ones then one with progress reset it) next to five empty ones, which still stop it. `cargo test --locked -p victory`: 32 passed, 0 failed, and 2 passed, 0 failed. (Written with Claude Code, Claude Opus 5.5.)
ANDREANIADS commented 2026-11-29 03:35:19 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ANDREANIADS on 2026-11-29T03:35:19Z.


Thanks for adding the progress regression test. A separate, pre-existing path is still reachable at b2cedf7: an Err from current_exe().and_then(...spawn...) returns (these.len(), None, None). The caller consumes the chunk before deciding whether to retry.

I injected an open error in an isolated Rust harness with three pipeline IDs. Both a transient error and a persistent error ended after one attempt, with zero callbacks and an empty remaining slice. Returning (0, Some(e.to_string()), None) for that error reused the bounded retry: a transient error completed all three on attempt two, and persistent errors stopped after five attempts with all three pending. Immediate success still completed all three on the first attempt. The final summary counts callbacks correctly but omits the skipped chunk. CPU-only logic test; no Windows process was launched.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7250138809 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1931#issuecomment-7250138809). Originally posted by [ANDREANIADS](https://github.com/ANDREANIADS) on 2026-11-29T03:35:19Z. --- Thanks for adding the progress regression test. A separate, pre-existing path is still reachable at `b2cedf7`: an `Err` from `current_exe().and_then(...spawn...)` returns `(these.len(), None, None)`. The caller consumes the chunk before deciding whether to retry. I injected an open error in an isolated Rust harness with three pipeline IDs. Both a transient error and a persistent error ended after one attempt, with zero callbacks and an empty remaining slice. Returning `(0, Some(e.to_string()), None)` for that error reused the bounded retry: a transient error completed all three on attempt two, and persistent errors stopped after five attempts with all three pending. Immediate success still completed all three on the first attempt. The final summary counts callbacks correctly but omits the skipped chunk. CPU-only logic test; no Windows process was launched.
joeypercia commented 2026-11-29 03:36:50 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by joeypercia on 2026-11-29T03:36:50Z.


@ANDREANIADS right again, and it's the same kind of failure, so it belongs here: in 1d00f27 (squashed) a spawn error now returns (0, Some("not started: …"), None) instead of the whole chunk as made, and a process without its output pipe is killed and returns (0, Some(…), None). Both go through after()'s Again (covered by a_process_that_never_began_blames_no_pipeline) and the bounded retry, so a transient error goes on and a lasting one stops the worker after five with the rest left for the next preload. cargo test --locked -p victory: 32 passed, 0 failed, and 2 passed, 0 failed. Not covered by a unit test of its own: child launches a real process.

(Written with Claude Code, Claude Opus 5.5.)

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7250154020 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1931#issuecomment-7250154020). Originally posted by [joeypercia](https://github.com/joeypercia) on 2026-11-29T03:36:50Z. --- @ANDREANIADS right again, and it's the same kind of failure, so it belongs here: in `1d00f27` (squashed) a spawn error now returns `(0, Some("not started: …"), None)` instead of the whole chunk as made, and a process without its output pipe is killed and returns `(0, Some(…), None)`. Both go through `after()`'s `Again` (covered by `a_process_that_never_began_blames_no_pipeline`) and the bounded retry, so a transient error goes on and a lasting one stops the worker after five with the rest left for the next preload. `cargo test --locked -p victory`: 32 passed, 0 failed, and 2 passed, 0 failed. Not covered by a unit test of its own: `child` launches a real process. (Written with Claude Code, Claude Opus 5.5.)
andrewpozdnakov7-jpg commented 2026-12-01 09:46:31 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by andrewpozdnakov7-jpg on 2026-12-01T09:46:31Z.


I cherry-picked 1d00f27 onto current main 5fabb46 as 781f6dc, preserving joeypercia as Git author. The rebased commit preserves the current per-fingerprint quarantine and the outer retry rounds. A worker stops for the current round after five starts with no progress. The outer loop can try its remaining pipelines when other workers made progress.

I replayed synthetic worker stdout through the exact parser and retry decision on Windows. With jobs [7, 8, 9], a failed start with no output would quarantine 7 on main. After made 7, a failure between pipelines would quarantine 8. The rebased code retries in both cases. at 9 quarantines only 9; an at outside the remaining jobs leaves the queue eligible for retry. Consecutive failed starts back off for 2, 4, 8 and 16 seconds before the fifth stops the worker. cargo check --locked -p victory --bin victory --jobs 2 and the staged policy check passed. These checks used no game data.

Git merges this rebase cleanly with #4785 at a0f1a34. It conflicts with #4778 at 5993f4f in warm.rs, where both change child. The integration needs to carry the last at marker alongside #4778's child_result and retain its watchdog wake on exit. The branch above is ready against current main if you'd like to update this PR.

Integration update. I resolved the child conflict in a separate integration branch, carrying the last at marker out with the failure status and keeping the watchdog wake on exit. The branch preserves both parents (781f6dc and 5993f4f). The 18 tests in warm::tests and the staged policy check passed on Windows. The rebase above still applies directly to main.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7307187773 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1931#issuecomment-7307187773). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-12-01T09:46:31Z. --- I cherry-picked `1d00f27` onto current `main` `5fabb46` as [`781f6dc`](https://github.com/andrewpozdnakov7-jpg/VIctory-NVIDIA/commit/781f6dc16e8656daf9199e0a66ebfd2d4ec2ffdc), preserving joeypercia as Git author. The rebased commit preserves the current per-fingerprint quarantine and the outer retry rounds. A worker stops for the current round after five starts with no progress. The outer loop can try its remaining pipelines when other workers made progress. I replayed synthetic worker stdout through the exact parser and retry decision on Windows. With jobs `[7, 8, 9]`, a failed start with no output would quarantine `7` on main. After `made 7`, a failure between pipelines would quarantine `8`. The rebased code retries in both cases. `at 9` quarantines only `9`; an `at` outside the remaining jobs leaves the queue eligible for retry. Consecutive failed starts back off for 2, 4, 8 and 16 seconds before the fifth stops the worker. `cargo check --locked -p victory --bin victory --jobs 2` and the staged policy check passed. These checks used no game data. Git merges this rebase cleanly with #4785 at `a0f1a34`. It conflicts with #4778 at `5993f4f` in `warm.rs`, where both change `child`. The integration needs to carry the last `at` marker alongside #4778's `child_result` and retain its watchdog wake on exit. The branch above is ready against current main if you'd like to update this PR. **Integration update.** I resolved the `child` conflict in a separate [integration branch](https://github.com/andrewpozdnakov7-jpg/VIctory-NVIDIA/tree/review/1931-4778-integration), carrying the last `at` marker out with the failure status and keeping the watchdog wake on exit. The branch preserves both parents (`781f6dc` and `5993f4f`). The 18 tests in `warm::tests` and the staged policy check passed on Windows. The rebase above still applies directly to main.
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/1931:upstream-pr/1931'
git switch 'upstream-pr/1931'

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/1931'
git switch 'upstream-pr/1931'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1931'
git switch 'upstream-pr/1931'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1931'
git switch 'main'
git merge --squash 'upstream-pr/1931'
git switch 'main'
git merge --ff-only 'upstream-pr/1931'
git switch 'main'
git merge 'upstream-pr/1931'
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
trustno1-coder/VIctory-NVIDIA!1931
No description provided.