Pipeline workers: opt-in low-memory mode keeps the slow-build limit at first use (#56) #164

Open
github-bot wants to merge 1 commit from github-bot/gh-164 into main AGit
Owner

@⁠JoeY54 on GitHub · 2026-11-26 08:46 UTC · original
avatarmanz:claude/brave-shannon-7bfuao → main · +296 −28 · 2 files · 1 commits · open

Adds VICTORY_PIPELINE_LOW_MEMORY=1 (off by default). When on, pipelines known to be slow count against the slow-build limit at first use and for screen passes, not only when started early. Screen and first-use jobs get the next free slow slot ahead of speculative work. Quick jobs, including cache hits, keep running while a slow miss waits. The slow limit is now a quarter of the configured worker count (VICTORY_PIPELINE_WORKERS included).

Tests: 7 deterministic queue tests from the issue's acceptance list. Existing scheduler tests are unchanged. Merges cleanly with #125, #144 and #128.

Not yet done: hardware cold/warm comparison (results to follow). Known-slow library hits are also limited in this mode.


Generated by Claude Code

**@⁠JoeY54** on GitHub · 2026-11-26 08:46 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/164) `avatarmanz:claude/brave-shannon-7bfuao` → `main` · +296 −28 · 2 files · 1 commits · open Adds `VICTORY_PIPELINE_LOW_MEMORY=1` (off by default). When on, pipelines known to be slow count against the slow-build limit at first use and for screen passes, not only when started early. Screen and first-use jobs get the next free slow slot ahead of speculative work. Quick jobs, including cache hits, keep running while a slow miss waits. The slow limit is now a quarter of the configured worker count (`VICTORY_PIPELINE_WORKERS` included). **Tests:** 7 deterministic queue tests from the issue's acceptance list. Existing scheduler tests are unchanged. Merges cleanly with #125, #144 and #128. **Not yet done:** hardware cold/warm comparison (results to follow). Known-slow library hits are also limited in this mode. --- _Generated by [Claude Code](https://claude.ai/code)_
With VICTORY_PIPELINE_LOW_MEMORY=1 (off by default), pipelines known to take
long count against the slow-build limit when a draw or a pass over the screen
requests them, not only when they were started early. Requested ones get the
next free slow slot ahead of early ones (screen passes first), and quick ones,
cache hits included, keep going while a long one waits, also when it heads its
queue. A long one promoted from the early list is made once.

The slow limit is now a quarter of the configured worker count
(VICTORY_PIPELINE_WORKERS included) instead of the processor default.

Queue tests cover a held slot with first-use and screen misses waiting while
quick jobs proceed, the release order, screen-only workers, cache hit/miss,
no pipeline library, worker-count overrides and the mode off. The existing
scheduler tests are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YScU9PQ8SkVkHX9jpbC2E2
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:48:02 +00:00
Author
Owner

@⁠JoeY54 on GitHub · 2026-11-26 08:57 UTC · original

CI is red on this PR for the same reasons it is red on main at 722c0e1 (run 45784658299). This PR does not touch either file:

  • Clippy: clippy::missing_transmute_annotations at crates/victory-loader/src/descriptor_sites.rs:277 (two transmute calls without type annotations). Clippy stops there, so it never reaches victory-gpu in either run.
  • Default tests / Diagnostics tests: pipeline::host::tests::depth_bounds_pipeline_loads_and_filters_draws fails at crates/victory-gpu/src/pipeline/host.rs:1464 ("depth 0.5 outside [0.6, 1.0] must be rejected", left 255, right 0).
  • check: fails because the three jobs above fail.

Apart from that one test, everything else passes: 371 passed here vs 364 on main (Default), 423 vs 416 (Diagnostics). The 7 extra are the new low_memory_tests. The existing scheduler tests pass.


Generated by Claude Code

**@⁠JoeY54** on GitHub · 2026-11-26 08:57 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/164#issuecomment-7187227910) CI is red on this PR for the same reasons it is red on `main` at `722c0e1` ([run 45784658299](https://github.com/avatarmanz/VIctory-7900XTX/actions/runs/45784658299)). This PR does not touch either file: - **Clippy:** `clippy::missing_transmute_annotations` at `crates/victory-loader/src/descriptor_sites.rs:277` (two `transmute` calls without type annotations). Clippy stops there, so it never reaches `victory-gpu` in either run. - **Default tests / Diagnostics tests:** `pipeline::host::tests::depth_bounds_pipeline_loads_and_filters_draws` fails at `crates/victory-gpu/src/pipeline/host.rs:1464` ("depth 0.5 outside [0.6, 1.0] must be rejected", left 255, right 0). - **check:** fails because the three jobs above fail. Apart from that one test, everything else passes: 371 passed here vs 364 on `main` (Default), 423 vs 416 (Diagnostics). The 7 extra are the new `low_memory_tests`. The existing scheduler tests pass. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠JoeY54 on GitHub · 2026-11-26 10:11 UTC · original

Local Windows check of this PR's head 5a2f8c6, compared with main at 9576c45. Toolchain: rustc/cargo 1.98.1 from rust-toolchain.toml. CPU only, no game files.

Commit cargo test -p victory-gpu --lib --locked pipeline::make same with --all-features -- --test-threads=1
PR 5a2f8c6 13 passed, 0 failed 13 passed, 0 failed
main 9576c45 6 passed, 0 failed 6 passed, 0 failed
  • The 7 extra are the new low_memory_tests. The 6 existing scheduler tests pass unchanged.
  • cargo clippy -p victory-gpu --all-targets --locked -- -D warnings reports nothing in pipeline/make.rs. Its remaining errors are the same 45 lines as on the merge base 39031cb.
  • The branch merges cleanly with 9576c45.
  • Still to do: the hardware cold/warm-cache comparison.

Generated by Claude Code

**@⁠JoeY54** on GitHub · 2026-11-26 10:11 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/164#issuecomment-7189019623) Local Windows check of this PR's head `5a2f8c6`, compared with `main` at `9576c45`. Toolchain: rustc/cargo 1.98.1 from `rust-toolchain.toml`. CPU only, no game files. | Commit | `cargo test -p victory-gpu --lib --locked pipeline::make` | same with `--all-features -- --test-threads=1` | |---|---|---| | PR `5a2f8c6` | 13 passed, 0 failed | 13 passed, 0 failed | | `main` `9576c45` | 6 passed, 0 failed | 6 passed, 0 failed | - The 7 extra are the new `low_memory_tests`. The 6 existing scheduler tests pass unchanged. - `cargo clippy -p victory-gpu --all-targets --locked -- -D warnings` reports nothing in `pipeline/make.rs`. Its remaining errors are the same 45 lines as on the merge base `39031cb`. - The branch merges cleanly with `9576c45`. - Still to do: the hardware cold/warm-cache comparison. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠JoeY54 on GitHub · 2026-11-26 17:11 UTC · original

Hardware comparison on RTX 5090 + 9950X3D (192 GB), PR head 5a2f8c6, diag build, play.ps1 -Safe. The low-memory mode limits slow builds to slow_limit=4 (16 workers). Each run measures 200 s from the start screen. Cold cache = seeded cache without host-pipelines.bin, with the NVIDIA DXCache cleared. Warm cache = the full seed. 2 runs per group, in shuffled order; medians shown.

Group To world Longest present gap Private peak Min commit headroom VRAM peak
cold, off 34.9 s 3,002 ms 37.57 GB 197.4 GB 21.48 GB
cold, on 34.4 s 2,719 ms 36.20 GB 198.6 GB 20.39 GB
warm, off 33.2 s 2,620 ms 37.75 GB 197.0 GB 21.46 GB
warm, on 33.2 s 2,664 ms 37.12 GB 197.6 GB 21.23 GB
  • Cold, the mode lowered peak private bytes by about 1.4 GB and VRAM by about 1.1 GB. With only 2 runs per group, this is not conclusive.
  • Warm, on and off are the same. Limiting known-slow library hits costs nothing measurable here.
  • The cost: in one cold run with the mode on, 322 pipelines were queued at world entry. With 4 slow slots they drained at about 1.7/s, and the world ran at about 2 fps for about 165 s. A cold run with the mode off drained a 240-pipeline queue in about 20 s. The queue length at world entry varies with loading timing, so 2 runs cannot show how often this happens.
  • This machine has no memory pressure (headroom ≥ 196 GB), so it cannot show the benefit the mode is meant for. Dropped draws/dispatches per frame were not fully logged; most drops in these runs were not missing pipelines.
  • Next: if useful, gate first-use slow builds on low Windows commit headroom (as the issue suggests), so machines with plenty of memory are not stalled. A run on a lower-memory machine would show whether the mode pays off.

Generated by Claude Code

**@⁠JoeY54** on GitHub · 2026-11-26 17:11 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/164#issuecomment-7198635423) Hardware comparison on RTX 5090 + 9950X3D (192 GB), PR head `5a2f8c6`, `diag` build, `play.ps1 -Safe`. The low-memory mode limits slow builds to `slow_limit=4` (16 workers). Each run measures 200 s from the start screen. Cold cache = seeded cache without `host-pipelines.bin`, with the NVIDIA DXCache cleared. Warm cache = the full seed. 2 runs per group, in shuffled order; medians shown. | Group | To world | Longest present gap | Private peak | Min commit headroom | VRAM peak | |---|---|---|---|---|---| | cold, off | 34.9 s | 3,002 ms | 37.57 GB | 197.4 GB | 21.48 GB | | cold, on | 34.4 s | 2,719 ms | 36.20 GB | 198.6 GB | 20.39 GB | | warm, off | 33.2 s | 2,620 ms | 37.75 GB | 197.0 GB | 21.46 GB | | warm, on | 33.2 s | 2,664 ms | 37.12 GB | 197.6 GB | 21.23 GB | - Cold, the mode lowered peak private bytes by about 1.4 GB and VRAM by about 1.1 GB. With only 2 runs per group, this is not conclusive. - Warm, on and off are the same. Limiting known-slow library hits costs nothing measurable here. - The cost: in one cold run with the mode on, 322 pipelines were queued at world entry. With 4 slow slots they drained at about 1.7/s, and the world ran at about 2 fps for about 165 s. A cold run with the mode off drained a 240-pipeline queue in about 20 s. The queue length at world entry varies with loading timing, so 2 runs cannot show how often this happens. - This machine has no memory pressure (headroom ≥ 196 GB), so it cannot show the benefit the mode is meant for. Dropped draws/dispatches per frame were not fully logged; most drops in these runs were not missing pipelines. - Next: if useful, gate first-use slow builds on low Windows commit headroom (as the issue suggests), so machines with plenty of memory are not stalled. A run on a lower-memory machine would show whether the mode pays off. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠JoeY54 on GitHub · 2026-11-26 17:55 UTC · original

This is ready for review. The mode is off by default, so default runs are unaffected. The point to look at is the cold-cache stall in the hardware comparison above: one run with the mode on spent about 165 s at about 2 fps while 322 pipelines drained through 4 slow slots. If you would rather have first-use slow builds limited only when commit headroom is low, I can add that here before merge, or as a follow-up.


Generated by Claude Code

**@⁠JoeY54** on GitHub · 2026-11-26 17:55 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/164#issuecomment-7199851375) This is ready for review. The mode is off by default, so default runs are unaffected. The point to look at is the cold-cache stall in the hardware comparison above: one run with the mode on spent about 165 s at about 2 fps while 322 pipelines drained through 4 slow slots. If you would rather have first-use slow builds limited only when commit headroom is low, I can add that here before merge, or as a follow-up. --- _Generated by [Claude Code](https://claude.ai/code)_
github-bot force-pushed github-bot/gh-164 from 5a2f8c60ae to 95fd5b4911 2026-11-27 01:33:03 +00:00 Compare
Author
Owner

@⁠JoeY54 on GitHub · 2026-11-27 01:09 UTC · original

Head changed from 5a2f8c6 to c12a32c to correct the commit author: it was the cloud container's default Git identity, and it is now my account. The tree, parent and commit message are byte-identical (git diff 5a2f8c6 c12a32c is empty), so the test and hardware results above still apply. The original commit is kept on claude/brave-shannon-7bfuao-backup-5a2f8c6.


Generated by Claude Code

**@⁠JoeY54** on GitHub · 2026-11-27 01:09 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/164#issuecomment-7207056216) Head changed from `5a2f8c6` to `c12a32c` to correct the commit author: it was the cloud container's default Git identity, and it is now my account. The tree, parent and commit message are byte-identical (`git diff 5a2f8c6 c12a32c` is empty), so the test and hardware results above still apply. The original commit is kept on `claude/brave-shannon-7bfuao-backup-5a2f8c6`. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠JoeY54 on GitHub · 2026-11-27 01:11 UTC · original

Head changed again, from c12a32c to 95fd5b4: I removed a private session-link trailer from the commit message. The code is unchanged (git diff c12a32c 95fd5b4 is empty).


Generated by Claude Code

**@⁠JoeY54** on GitHub · 2026-11-27 01:11 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/164#issuecomment-7207087524) Head changed again, from `c12a32c` to `95fd5b4`: I removed a private session-link trailer from the commit message. The code is unchanged (`git diff c12a32c 95fd5b4` is empty). --- _Generated by [Claude Code](https://claude.ai/code)_
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 origin '+refs/pull/164/head:github-bot/gh-164'
git switch 'github-bot/gh-164'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-164'
git switch 'github-bot/gh-164'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-164'
git switch 'github-bot/gh-164'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-164'
git switch 'main'
git merge --squash 'github-bot/gh-164'
git switch 'main'
git merge --ff-only 'github-bot/gh-164'
git switch 'main'
git merge 'github-bot/gh-164'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.