warm: scope warm-bad.txt by fingerprint, honor VICTORY_WARM_BAD=0 and --again (#280) #294

Manually merged
github merged 1 commit from github-bot/gh-294 into a-publier 2026-11-27 00:57:57 +00:00 AGit
Owner

@⁠BlueCatsz on GitHub · 2026-11-26 19:21 UTC · original
BlueCatsz:fix/warm-bad-fingerprint-and-retry → a-publier · +353 −28 · 5 files · 2 commits · merged 2026-11-26 22:30 UTC

Fixes #280.

Summary

Treats warm-bad.txt consistently across victory warm (apps/victory/src/warm.rs) and runtime pipeline building (crates/victory-gpu/src/pipeline/make.rs), matching warm-done.txt while staying backwards- and forwards-compatible with older binaries:

  1. Fingerprint-scoped entries with column-1 key compatibility (known::format_bad_entry, known::parse_bad_keys, known::fingerprint()):
    • victory warm (apps/victory/src/warm.rs) and the runtime compiler-crash guard (pipeline::make::lost) record new entries as <32-hex-key> fp=<16-hex-fingerprint> <reason> (keeping the pipeline key in column 1 so older unmodified binaries reading the same warm-bad.txt still quarantine crashed pipelines safely).
    • known::parse_bad_keys matches <key> fp=<16-hex-fingerprint> ... (and <16-hex-fingerprint> <32-hex-key> ... for compatibility) against the current known::fingerprint(), so pipelines that previously crashed or hung are retried automatically after a driver or translator update.
    • Legacy bare-key lines and manual skip keys (<key> ...) continue to apply regardless of fingerprint.
  2. Skip # comments and blank lines in warm.rs: Both warm.rs and pipeline::make share known::WARM_BAD_FILE and known::parse_bad_keys, ignoring blank lines and # comment lines instead of counting # or empty tokens as bad keys.
  3. Honor VICTORY_WARM_BAD=0 in warm.rs: Shared via known::bad_list_disabled(). Setting VICTORY_WARM_BAD=0 lets victory warm ignore warm-bad.txt while still skipping pipelines already recorded in warm-done.txt for the current fingerprint.
  4. Let victory warm --again retry bad pipelines and document in --help: Extracted select_pipelines in apps/victory/src/warm.rs so --again retries both done and bad pipelines, and updated victory warm --help (apps/victory/src/main.rs) to document warm-bad.txt fingerprint scoping, VICTORY_WARM_BAD=0, and --again.

Verification

  • Local offline (x86_64-unknown-linux-gnu):
    • cargo --offline test -p xtask: 9 passed, 0 failed (including policy::tests::repository_passes_policy and switches::documented_switches_are_read).
    • git diff --check: clean.
  • Fork windows-latest CI on e7585d5 (Scoped Run 45899040982):
    (Scoped workflow used to bypass untouched a-publier blockers noted below.)
    • Clippy (victory & xtask): Strict cargo clippy -p victory -p xtask --no-deps --all-targets --locked -- -D warnings (Default) and --all-features (Diagnostics) both passed (0 warnings).
    • Clippy (victory-gpu): cargo clippy -p victory-gpu --no-deps --all-targets --locked (Default) and --all-features (Diagnostics) both passed when allowing the three untouched pre-existing a-publier lints (crates/victory-gpu/src/host/panel.rs:386 clippy::missing_transmute_annotations, crates/victory-gpu/src/watch.rs:3626 clippy::unnecessary_mut_passed, and --all-features crates/victory-gpu/src/texture.rs:46 dead_code).
    • Default tests:
      • victory: 23 unit tests (including warm::tests::select_pipelines_skips_current_bad_and_retries_on_again_or_new_fingerprint), 2 census, 2 translate_host_wave, and 1 end-to-end CLI test (apps/victory/tests/warm_bad.rs::warm_bad_fingerprint_override_again_and_help) — all passed, 0 failed.
      • victory-gpu: pipeline::known::tests (5 passed, 0 failed) and pipeline::make::tests (7 passed, 0 failed).
      • xtask: 9 passed, 0 failed.
    • Diagnostics tests (--all-features -- --test-threads=1):
      • victory: 24 unit tests, 2 census, 2 translate_host_wave, and 1 warm_bad_fingerprint_override_again_and_help — all passed, 0 failed.
      • victory-gpu: pipeline::known::tests (5 passed, 0 failed) and pipeline::make::tests (7 passed, 0 failed).
  • Earlier full-workspace fork windows-latest CI on 90e3770 (Run 45881758143):
    • victory-gpu lib suite: 387 passed, 1 failed, 34 ignored (Default) and 436 passed, 1 failed, 34 ignored (--all-features), with all new tests passing; the 1 failure was untouched pipeline::host::tests::depth_bounds_pipeline_loads_and_filters_draws (crates/victory-gpu/src/pipeline/host.rs:1464) on WARP, and workspace Clippy stopped early on untouched crates/victory-loader/src/descriptor_sites.rs:277 (#246).
  • Test scope / limitations: Synthetic unit and CLI/subprocess tests only; zero game files/assets; not tested against a live title.

AI Use

Prepared with AI assistance (Antigravity) and verified against the unit, CLI, and CI checks above.

**@⁠BlueCatsz** on GitHub · 2026-11-26 19:21 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/294) `BlueCatsz:fix/warm-bad-fingerprint-and-retry` → `a-publier` · +353 −28 · 5 files · 2 commits · merged 2026-11-26 22:30 UTC Fixes #280. ## Summary Treats `warm-bad.txt` consistently across `victory warm` (`apps/victory/src/warm.rs`) and runtime pipeline building (`crates/victory-gpu/src/pipeline/make.rs`), matching `warm-done.txt` while staying backwards- and forwards-compatible with older binaries: 1. **Fingerprint-scoped entries with column-1 key compatibility (`known::format_bad_entry`, `known::parse_bad_keys`, `known::fingerprint()`):** - `victory warm` (`apps/victory/src/warm.rs`) and the runtime compiler-crash guard (`pipeline::make::lost`) record new entries as `<32-hex-key> fp=<16-hex-fingerprint> <reason>` (keeping the pipeline key in column 1 so older unmodified binaries reading the same `warm-bad.txt` still quarantine crashed pipelines safely). - `known::parse_bad_keys` matches `<key> fp=<16-hex-fingerprint> ...` (and `<16-hex-fingerprint> <32-hex-key> ...` for compatibility) against the current `known::fingerprint()`, so pipelines that previously crashed or hung are retried automatically after a driver or translator update. - Legacy bare-key lines and manual skip keys (`<key> ...`) continue to apply regardless of fingerprint. 2. **Skip `#` comments and blank lines in `warm.rs`:** Both `warm.rs` and `pipeline::make` share `known::WARM_BAD_FILE` and `known::parse_bad_keys`, ignoring blank lines and `#` comment lines instead of counting `#` or empty tokens as bad keys. 3. **Honor `VICTORY_WARM_BAD=0` in `warm.rs`:** Shared via `known::bad_list_disabled()`. Setting `VICTORY_WARM_BAD=0` lets `victory warm` ignore `warm-bad.txt` while still skipping pipelines already recorded in `warm-done.txt` for the current fingerprint. 4. **Let `victory warm --again` retry bad pipelines and document in `--help`:** Extracted `select_pipelines` in `apps/victory/src/warm.rs` so `--again` retries both `done` and `bad` pipelines, and updated `victory warm --help` (`apps/victory/src/main.rs`) to document `warm-bad.txt` fingerprint scoping, `VICTORY_WARM_BAD=0`, and `--again`. ## Verification - **Local offline (`x86_64-unknown-linux-gnu`):** - `cargo --offline test -p xtask`: **9 passed, 0 failed** (including `policy::tests::repository_passes_policy` and `switches::documented_switches_are_read`). - `git diff --check`: clean. - **Fork `windows-latest` CI on `e7585d5` ([Scoped Run 45899040982](https://github.com/BlueCatsz/VIctory-Belobug-AMD/actions/runs/45899040982)):** *(Scoped workflow used to bypass untouched `a-publier` blockers noted below.)* - **Clippy (`victory` & `xtask`):** Strict `cargo clippy -p victory -p xtask --no-deps --all-targets --locked -- -D warnings` (Default) and `--all-features` (Diagnostics) both **passed (0 warnings)**. - **Clippy (`victory-gpu`):** `cargo clippy -p victory-gpu --no-deps --all-targets --locked` (Default) and `--all-features` (Diagnostics) both **passed** when allowing the three untouched pre-existing `a-publier` lints (`crates/victory-gpu/src/host/panel.rs:386` `clippy::missing_transmute_annotations`, `crates/victory-gpu/src/watch.rs:3626` `clippy::unnecessary_mut_passed`, and `--all-features` `crates/victory-gpu/src/texture.rs:46` `dead_code`). - **Default tests:** - `victory`: **23** unit tests (including `warm::tests::select_pipelines_skips_current_bad_and_retries_on_again_or_new_fingerprint`), **2** `census`, **2** `translate_host_wave`, and **1** end-to-end CLI test (`apps/victory/tests/warm_bad.rs::warm_bad_fingerprint_override_again_and_help`) — **all passed, 0 failed**. - `victory-gpu`: `pipeline::known::tests` (**5 passed, 0 failed**) and `pipeline::make::tests` (**7 passed, 0 failed**). - `xtask`: **9 passed, 0 failed**. - **Diagnostics tests (`--all-features -- --test-threads=1`):** - `victory`: **24** unit tests, **2** `census`, **2** `translate_host_wave`, and **1** `warm_bad_fingerprint_override_again_and_help` — **all passed, 0 failed**. - `victory-gpu`: `pipeline::known::tests` (**5 passed, 0 failed**) and `pipeline::make::tests` (**7 passed, 0 failed**). - **Earlier full-workspace fork `windows-latest` CI on `90e3770` ([Run 45881758143](https://github.com/BlueCatsz/VIctory-Belobug-AMD/actions/runs/45881758143)):** - `victory-gpu` lib suite: **387 passed, 1 failed, 34 ignored** (Default) and **436 passed, 1 failed, 34 ignored** (`--all-features`), with all new tests passing; the 1 failure was untouched `pipeline::host::tests::depth_bounds_pipeline_loads_and_filters_draws` (`crates/victory-gpu/src/pipeline/host.rs:1464`) on WARP, and workspace Clippy stopped early on untouched `crates/victory-loader/src/descriptor_sites.rs:277` (`#246`). - **Test scope / limitations:** Synthetic unit and CLI/subprocess tests only; zero game files/assets; not tested against a live title. ## AI Use Prepared with AI assistance (Antigravity) and verified against the unit, CLI, and CI checks above.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 19:22:37 +00:00
Author
Owner

@⁠battledogegames-design on GitHub · 2026-11-26 20:38 UTC · original

Thanks, BlueCatsz. I independently validated the explicit retry behavior on Windows using synthetic pipeline records and real worker subprocesses. All five focused unit tests and nine subprocess selection checks passed.

One mixed-version compatibility issue reproduced: after this PR records a worker failure, its next default run correctly schedules zero pipelines. However, the unmodified base binary reading that same warm-bad.txt reports 1 bad; 1 to make and retries the quarantined pipeline.

The older reader interprets the first field as the pipeline key, while this PR writes the fingerprint first.

If rollback or shared caches across versions are supported, would preserving the pipeline key in column one and storing the fingerprint in a tagged field be preferable? Otherwise, documenting the compatibility boundary would help.

I'd also suggest updating warm --help to explain that --again now retries crash-listed pipelines, not just previously completed ones.

I support this PR rather than opening a competing implementation. The Windows subprocess tests add independent confirmation of the intended retry behavior.

AI-assisted investigation: Astra 6.2 (OpenAI).

**@⁠battledogegames-design** on GitHub · 2026-11-26 20:38 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/294#issuecomment-7202930793) Thanks, BlueCatsz. I independently validated the explicit retry behavior on Windows using synthetic pipeline records and real worker subprocesses. All five focused unit tests and nine subprocess selection checks passed. One mixed-version compatibility issue reproduced: after this PR records a worker failure, its next default run correctly schedules zero pipelines. However, the unmodified base binary reading that same `warm-bad.txt` reports `1 bad; 1 to make` and retries the quarantined pipeline. The older reader interprets the first field as the pipeline key, while this PR writes the fingerprint first. If rollback or shared caches across versions are supported, would preserving the pipeline key in column one and storing the fingerprint in a tagged field be preferable? Otherwise, documenting the compatibility boundary would help. I'd also suggest updating `warm --help` to explain that `--again` now retries crash-listed pipelines, not just previously completed ones. I support this PR rather than opening a competing implementation. The Windows subprocess tests add independent confirmation of the intended retry behavior. **AI-assisted investigation: Astra 6.2 (OpenAI).**
Author
Owner

@⁠MamaLeVrai on GitHub · 2026-11-26 20:45 UTC · original

Tested on an RX 6950 XT 16 GB (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release, at 90e3770: cargo test --release -p victory-gpu --lib 387 passed, 1 failed, 34 ignored. The one failure is views_are_made_beside_the_heap_and_copied_in, which fails the same way on cd8dfc0 on this card (fixed by #288).

AI-assisted (Claude Code); no game data.

**@⁠MamaLeVrai** on GitHub · 2026-11-26 20:45 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/294#issuecomment-7203046328) Tested on an RX 6950 XT 16 GB (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release, at `90e3770`: `cargo test --release -p victory-gpu --lib` 387 passed, 1 failed, 34 ignored. The one failure is `views_are_made_beside_the_heap_and_copied_in`, which fails the same way on `cd8dfc0` on this card (fixed by #288). AI-assisted (Claude Code); no game data.
github manually merged commit 70a2d5d8a3 into a-publier 2026-11-27 00:57:57 +00:00
Author
Owner

@⁠BlueCatsz on GitHub · 2026-11-26 21:44 UTC · original

Thanks @⁠battledogegames-design and @⁠MamaLeVrai for the Windows subprocess and RX 6950 XT validation and feedback!

Pushed follow-up commit e7585d5 addressing both points:

  1. Column-1 key compatibility (crates/victory-gpu/src/pipeline/known.rs, make.rs, apps/victory/src/warm.rs):
    • known::format_bad_entry now records <32-hex-key> fp=<16-hex-fingerprint> <reason>, keeping the pipeline key in column 1 so an unmodified base binary reading a shared warm-bad.txt continues to quarantine crashed pipelines on rollback.
    • known::parse_bad_keys accepts <key> fp=<16-hex> ..., legacy bare <key> ..., and <16-hex> <32-hex> ....
  2. victory warm --help (apps/victory/src/main.rs): Documented warm-bad.txt fingerprint scoping, VICTORY_WARM_BAD=0, and that --again also retries warm-bad.txt entries.
  3. Windows CLI integration test (apps/victory/tests/warm_bad.rs): Added warm_bad_fingerprint_override_again_and_help invoking the victory binary end-to-end across --help, # comments/blank lines, column-1 entry formatting, default skipping, VICTORY_WARM_BAD=0, --again --used, and automatic expiration on a fingerprint change (VICTORY_WAVE_WIDE=0).

Verification on e7585d5

  • Local offline: cargo --offline test -p xtask (9 passed, 0 failed) and git diff --check.
  • Fork windows-latest CI (Scoped Run 45899040982):
    • Strict cargo clippy -p victory -p xtask --no-deps --all-targets --locked -- -D warnings (Default & --all-features): passed (0 warnings).
    • cargo clippy -p victory-gpu --no-deps --all-targets --locked (Default & --all-features): passed when allowing the three untouched pre-existing a-publier lints (host/panel.rs:386, watch.rs:3626, and texture.rs:46).
    • Default tests: victory (23 unit + 2 census + 2 translate_host_wave + 1 warm_bad), victory-gpu (known: 5 passed, make: 7 passed), and xtask (9 passed) all passed.
    • Diagnostics tests (--all-features -- --test-threads=1): victory (24 unit + 2 census + 2 translate_host_wave + 1 warm_bad) and victory-gpu (known: 5 passed, make: 7 passed) all passed.

AI-assisted follow-up (Antigravity).

**@⁠BlueCatsz** on GitHub · 2026-11-26 21:44 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/294#issuecomment-7204013646) Thanks @⁠battledogegames-design and @⁠MamaLeVrai for the Windows subprocess and RX 6950 XT validation and feedback! Pushed follow-up commit [`e7585d5`](https://git.gtahub.st/github/Belobug--VIctory-Belobug-AMD/pulls/294/commits/e7585d506a7ac15e8f9a3903f7fee37b77653f57) addressing both points: 1. **Column-1 key compatibility (`crates/victory-gpu/src/pipeline/known.rs`, `make.rs`, `apps/victory/src/warm.rs`):** - `known::format_bad_entry` now records `<32-hex-key> fp=<16-hex-fingerprint> <reason>`, keeping the pipeline key in column 1 so an unmodified base binary reading a shared `warm-bad.txt` continues to quarantine crashed pipelines on rollback. - `known::parse_bad_keys` accepts `<key> fp=<16-hex> ...`, legacy bare `<key> ...`, and `<16-hex> <32-hex> ...`. 2. **`victory warm --help` (`apps/victory/src/main.rs`):** Documented `warm-bad.txt` fingerprint scoping, `VICTORY_WARM_BAD=0`, and that `--again` also retries `warm-bad.txt` entries. 3. **Windows CLI integration test (`apps/victory/tests/warm_bad.rs`):** Added `warm_bad_fingerprint_override_again_and_help` invoking the `victory` binary end-to-end across `--help`, `#` comments/blank lines, column-1 entry formatting, default skipping, `VICTORY_WARM_BAD=0`, `--again --used`, and automatic expiration on a fingerprint change (`VICTORY_WAVE_WIDE=0`). ### Verification on `e7585d5` - Local offline: `cargo --offline test -p xtask` (`9 passed, 0 failed`) and `git diff --check`. - Fork `windows-latest` CI ([Scoped Run `45899040982`](https://github.com/BlueCatsz/VIctory-Belobug-AMD/actions/runs/45899040982)): - Strict `cargo clippy -p victory -p xtask --no-deps --all-targets --locked -- -D warnings` (Default & `--all-features`): **passed (0 warnings)**. - `cargo clippy -p victory-gpu --no-deps --all-targets --locked` (Default & `--all-features`): **passed** when allowing the three untouched pre-existing `a-publier` lints (`host/panel.rs:386`, `watch.rs:3626`, and `texture.rs:46`). - `Default tests`: `victory` (`23` unit + `2` `census` + `2` `translate_host_wave` + `1` `warm_bad`), `victory-gpu` (`known`: `5 passed`, `make`: `7 passed`), and `xtask` (`9 passed`) all passed. - `Diagnostics tests` (`--all-features -- --test-threads=1`): `victory` (`24` unit + `2` `census` + `2` `translate_host_wave` + `1` `warm_bad`) and `victory-gpu` (`known`: `5 passed`, `make`: `7 passed`) all passed. AI-assisted follow-up (Antigravity).
Author
Owner

@⁠adrianmjim on GitHub · 2026-11-26 22:44 UTC · original

Checked by reading the code on a-publier 4eb6cfd, which includes this PR (merge 70a2d5d); I did not build or run it. The cited files are unchanged since e7585d5.

What the fingerprint filter in bad_keys now means for the title on a-publier:

  • Before this PR (cd8dfc0) the runtime honoured every warm-bad.txt key in every run (cd8dfc0 make.rs:112-127). On a-publier bad_keys uses the same filter as warm (make.rs:114-126). So a tagged entry stops applying in the title as soon as the fingerprint changes. That happens on a TRANSLATOR_VERSION bump, on a driver update, or on a run with different values for the switches in shader_cache.rs:112-126 (for example VICTORY_WAVE_WIDE=0 in the game when warm ran without it). Until victory warm runs again, the title compiles those pipelines itself.
  • A crash the runtime guard catches recovers. lost records the key again with the new fingerprint (make.rs:306). Each such key costs one stuck worker thread and one of the 128 guard slots (make.rs:143, :323).
  • Two kinds of expired entries are not covered in the title:
    • hung for 180 s. The runtime has no compile timeout. If the compile does not end, the worker stays in HostPipeline::new (make.rs:90). Every frame that draws with that pipeline waits in wait (make.rs:470) for whatever budget the frame has left. That is up to 500 ms, or up to 10 s for a pass over the screen (make.rs:367, :378). In the runtime only lost writes to the file, so this repeats on every launch until victory warm runs again and records it (warm.rs:115).
    • Crashes the guard does not take. The guard only handles an access violation below 0x10000 inside a compile (make.rs:238). Any other compiler crash still ends the title process. warm workers compile with no guard (known.rs:354-355), so every warm crash is written as exit code: ..., and the file does not say which kind it was.
  • Possible fix: in the runtime, keep honouring an entry with an old fingerprint unless warm-done.txt has the key under the current fingerprint. warm writes that line on success (warm.rs:111). Today no runtime code reads warm-done.txt.
  • Every warm-bad.txt written before this PR has bare keys only (cd8dfc0 warm.rs:96, make.rs:301). Those keep applying in warm and in the title, and nothing removes a line. Existing caches therefore still need the file deleted once.
  • With the same switches, warm and a run compute the same fingerprint. In both, fingerprint() creates the host through translation() before the host settings are hashed (known.rs:255, shader_cache.rs:89, descriptor/host.rs:1560, shader_cache.rs:146).

Not checked: how often hang entries occur in practice, and whether they are endless hangs or slow compiles; no in-game run.

**@⁠adrianmjim** on GitHub · 2026-11-26 22:44 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/294#issuecomment-7204950693) Checked by reading the code on a-publier 4eb6cfd, which includes this PR (merge 70a2d5d); I did not build or run it. The cited files are unchanged since e7585d5. What the fingerprint filter in `bad_keys` now means for the title on a-publier: - Before this PR (cd8dfc0) the runtime honoured every `warm-bad.txt` key in every run (cd8dfc0 `make.rs:112-127`). On a-publier `bad_keys` uses the same filter as warm (`make.rs:114-126`). So a tagged entry stops applying in the title as soon as the fingerprint changes. That happens on a `TRANSLATOR_VERSION` bump, on a driver update, or on a run with different values for the switches in `shader_cache.rs:112-126` (for example `VICTORY_WAVE_WIDE=0` in the game when warm ran without it). Until `victory warm` runs again, the title compiles those pipelines itself. - A crash the runtime guard catches recovers. `lost` records the key again with the new fingerprint (`make.rs:306`). Each such key costs one stuck worker thread and one of the 128 guard slots (`make.rs:143`, `:323`). - Two kinds of expired entries are not covered in the title: - `hung for 180 s`. The runtime has no compile timeout. If the compile does not end, the worker stays in `HostPipeline::new` (`make.rs:90`). Every frame that draws with that pipeline waits in `wait` (`make.rs:470`) for whatever budget the frame has left. That is up to 500 ms, or up to 10 s for a pass over the screen (`make.rs:367`, `:378`). In the runtime only `lost` writes to the file, so this repeats on every launch until `victory warm` runs again and records it (`warm.rs:115`). - Crashes the guard does not take. The guard only handles an access violation below 0x10000 inside a compile (`make.rs:238`). Any other compiler crash still ends the title process. warm workers compile with no guard (`known.rs:354-355`), so every warm crash is written as `exit code: ...`, and the file does not say which kind it was. - Possible fix: in the runtime, keep honouring an entry with an old fingerprint unless `warm-done.txt` has the key under the current fingerprint. warm writes that line on success (`warm.rs:111`). Today no runtime code reads `warm-done.txt`. - Every `warm-bad.txt` written before this PR has bare keys only (cd8dfc0 `warm.rs:96`, `make.rs:301`). Those keep applying in warm and in the title, and nothing removes a line. Existing caches therefore still need the file deleted once. - With the same switches, warm and a run compute the same fingerprint. In both, `fingerprint()` creates the host through `translation()` before the host settings are hashed (`known.rs:255`, `shader_cache.rs:89`, `descriptor/host.rs:1560`, `shader_cache.rs:146`). Not checked: how often hang entries occur in practice, and whether they are endless hangs or slow compiles; no in-game run.
This discussion has been locked. Commenting is limited to contributors.
No description provided.