Warm-up: a worker's watchdog wakes when the worker is done, not at its next 500 ms tick (port of readmet3xt-lab/foxhound #98) #4779
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!4779
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-4778"
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?
@xiepeixuan on GitHub · 2026-12-01 07:39 UTC · original
xiepeixuan:port/warm-watchdog-unpark→main· +102 −11 · 1 files · 1 commits · openRefs #1060 and #1976 for workload sizes, not as fixes for either report.
What it changes
After a compiler worker closes stdout,
warm::childhas to join its watchdog before the slot can take another batch or the launcher can continue. The old watchdog could spend the remainder of a 500 ms sleep doing nothing. Port Yoshi-233's Foxhound PR #98, implementation b20c5ed, merged on Foxhound main as 152376e. At EOF the reader storesoverwith Release and unparks the watchdog. Afterpark_timeout, the watchdog checksoverwith Acquire before checking for silence. The 500 ms polling interval and 180 s silence limit do not change. Neither do output parsing, killing a hung process, exit accounting, or pipeline selection.The original one-file Foxhound hunk applies cleanly to target main. The only adaptation is exposing the wait loop, completion signal and existing exit-status decision to no-game tests. If #1923 or #1931 lands first, keep its reporting/retry behavior when rebasing; this port changes only how the watchdog stops. No other production site is changed.
How much time can it save on this target?
Use pipelines “to make”, not “known” or “in the library.” Let
Nbe what remains after quarantine, optional used-list filtering, done marks, name deduplication and the limit. On target main, a successful no-retry warm launches B = ceil(N / 40) processes: onechild()per chunk, zero if N is zero. The number running together is P = min(B, max(1, jobs)). Without an override,jobs = floor(2 × available logical processors / 3)(uses four processors if detection fails). Preload also acceptsVICTORY_PRELOAD_JOBS. A partial failure can launch another process for the rest of a chunk; unanswered work can enter another round, up to five rounds in total. In those cases count actual launched children instead.Per joined child the old sleep costs between zero and nearly 0.5 s, about 0.25 s if completion is uniformly phased against the tick. Thus worker-time saved is approximately
0.25 × Bseconds, up to0.5 × B. At full, balanced utilization the wall-time estimate is0.25 × B / P; a high-side illustration is0.5 × ceil(B / P). The latter is a balanced-wave estimate, not a guarantee for uneven batches. Real phase alignment, scheduling, retries and the last partially filled wave matter. This is avoided waiting, not faster shader compilation.For 84,000 actually to make → 2,100 child calls: summed over slots, 8 min 45 s expected, up to 17 min 30 s. Do not count that sum as elapsed time with parallel workers:
--jobs 1)#1060 reports 88,577 warmed; #1976 reports 83,844 known. These give scale, not measured savings. The library pass caps
library_workers(jobs, n)at its selected pipeline count (same two-thirds default) and callsknown::makein-process. It adds zerochild()calls, as does the optional shared-library fill. A player waiting for a pre-game warm can benefit; a fully reused cache, library-only work and in-game FPS do not.Other scoped sleeps checked
Only
warm::childhad all three properties: a scoped thread, a periodic sleep to observe completion, and a player-facing caller joining it. No second site is changed.apps/victory/src/run.rstitle watchdog/log sampling, GPUpipeline::known::book(periodic flush),pipeline::make::workers(periodic sampling),watch::ask_earlyand HLEdstorage/xasync/xmemmonitors: detached threads, not a scope-exit delay.host,descriptor::host,indirect,land::tests,pool,shadow,watch, HLExmemand pipelinecacheexercise races, mock latency or benchmark load in tests/benches. Those sleeps do not hold up a player's warm.How it was tested
--again --jobs 1, four runs per binary in balanced order. Medians: 1 pipeline 817 → 730 ms; 160 pipelines 2,348 → 2,316 ms (ranges 2,332–2,352 and 2,250–2,589 ms overlap). Their separate immediate-worker harness measured 507 → 14 ms median. None of these is a measured full target warm.cargo test --locked -p victory --bin victory warm::testson5fabb46: 12 passed. For a negative control, compile the three new tests with the same helpers, changing onlypark_timeout(tick)tosleep(tick). The wakeup timed out at its 350 ms bound; the other two passed.5993f4f: 15 passed, 0 failed. The wake test waits for thread readiness before signalling completion; it also passed 50/50 isolated repetitions. A silent worker is flagged after a 40 ms test limit (5 ms tick, 5 s test deadline). Successful exits still count the full batch; code 7 and wait errors retain partial progress and their messages; a hung failure retains the 180 s reason.cargo testfor the touched crate: Yes.cargo test --locked -p victoryon Windows x64, Rust 1.98.1 GNU: 94 unit + 3 integration tests passed.cargo xtask policy --stagedandcargo xtask policyboth passed. Thewarmmodule declaration is already guarded by#[cfg(windows)], so the exit-status test and its Windows import are excluded on other targets.Checked for overlap
child, watchdog, sleep, park/unpark andwarm.rs. Rechecked the triage map, #1138, and fully paginated the two open file lists longer than 100 (#1577 and #3617). No equivalent on the pinned target main or in an open PR.apps/victory/src/warm.rs. #1923 changes result reporting, #1931 changes attribution of early failures, and #4199 changes cache marks/library defaults. None changes the watchdog wait. Also checked #730, #1001, #2289, #3588, #3617, #3622, #4193, #4257 and #4411; none wakes the watcher on EOF.warm.rsor proposes this mechanism.Opened as a draft early so others know this is being worked on (README: 'Opening a draft pull request early works too'). Quoted README · Current contribution guide.
AI-assisted (Codex). Not run in the game.
@andrewpozdnakov7-jpg on GitHub · 2026-12-01 08:51 UTC · original
Independent Windows x64 / MSVC check (Rust 1.98.1) on the exact head
5993f4fd2113fa06b3df8af0ef68cc34450ffe70andmainat5fabb46eaf6ed8771321787f8871051abde69b9b.cargo test --offline --locked --jobs 2 -p victory --bin victory warm::testspassed 15/15 on the PR and 12/12 on main. The exact stagedwarm.rsdiff passedcargo xtask policy --staged.warm::childand a synthetic subprocess, all 24 paired runs made the same callbacks and returned the expected full success or partial failure with exit code 7. The time from the last output record tochild()returning was 62.8–498.4 ms on main and 0.18–5.56 ms on the PR. The PR was faster in all 24 pairs. This measures worker completion, with synthetic delays of 0–350 ms. In-game and full shader warm-up performance remain unmeasured here.CI / checklogs have the same five Clippy diagnostics and source locations infont.rs,menu.rsandpanel.rs. The shared lint fix is #4708. Main check · PR checkAI-assisted with OpenAI Codex.
@andrewpozdnakov7-jpg on GitHub · 2026-12-01 13:58 UTC · original
Follow-up on
5993f4fd: a worker process that fails to start leaves its batch unanswered, andwarmcan still exit successfully. Automatic preload can then write its completion marker. #4786 covers the separate case where the shader book cannot be opened.e920f356 keeps the operating-system error for a worker that cannot start. If the last warm-up round leaves batches pending because of a start error, it returns that error after saving completed work. A failed process start leaves the batch eligible for retry.
I ran the exact warm-up loop and watchdog on Windows with a synthetic pipeline book and a deliberately absent worker executable. The author head returned success with zero or two of four completion records. The patch returned Windows error 2 in both cases and kept those records. A transient start failure recovered within the next round, and the all-success run still finished with four records. All cases kept the quarantine file empty. The staged asset check passed, and
git merge-treecombined the change cleanly with #4786.Please keep the Git author on cherry-pick or rebase, or add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>if folding the change in.AI-assisted with OpenAI Codex.
@cloph-dsp on GitHub · 2026-12-01 18:47 UTC · original
Verification (independent, AI-assisted: Hy4 flash). Windows, Rust 1.100.0 (Scoop rust-msvc), MSVC, commit-scoped shallow worktree.
Base
5fabb46eaf6ed8771321787f8871051abde69b9b, head5993f4fd2113fa06b3df8af0ef68cc34450ffe70.git diff --numstat→ apps/victory/src/warm.rs 102/11.All three tests are new on the base (
git grep -F <name> 5fabb46e -- .exit 1 for each):a_finished_worker_wakes_its_watchdog_before_the_next_tick,a_silent_worker_is_flagged_after_the_silence_limit,child_result_keeps_success_status_and_partial_failures.git diff --check "5fabb46e..5993f4fd"→ no output, exit 0.Result, each:
running 1 test,test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 93 filtered out.What they pin, from reading the bodies: the first spawns the real watchdog on a scoped thread and calls
finish_watchdogafter the worker starts, assertingwatchdog_hungreturnsfalsewithout waiting a tick (thestarted.recv()is there to exclude thread creation, since an early unpark would leave a token); the second driveswatchdog_hungwith a 5 ms tick and a 40 ms silence limit against alast_linethat is never updated, and asserts both that it reports hung and that the observed silence is at least the limit; the third is a pure table overchild_result— success stays(40, None)whether or not the child hung, a non-zero status becomes(3, Some("exit code: 7")), a hung but failed child becomes(3, Some("hung for 180 s"))which takes precedence over the exit status, and a wait error is carried through.Two things worth naming. The first two are timing-based (channels with 350 ms and 5 s bounds, threads spawned in scope); they passed in 0.00 s and 0.06 s here and did not flake in this run, but they are the kind of test that can be slow on a loaded CI box. And the third uses
std::os::windows::process::ExitStatusExt, so it only compiles on Windows — fine givenci.ymlisruns-on: windows-latest, but it does tie that test to the platform.No title data, no device; GPU/driver N/A. No game data.
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.