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

Open
JoeY54 wants to merge 1 commit from upstream-pr/164 into main
JoeY54 commented 2026-11-26 08:46:22 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by JoeY54 on 2026-11-26T08:46:22Z.


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

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:issue:5506817934 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/164). Originally posted by [JoeY54](https://github.com/JoeY54) on 2026-11-26T08:46:22Z. --- 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)_
JoeY54 commented 2026-11-26 08:57:21 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by JoeY54 on 2026-11-26T08:57:21Z.


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

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:comment:7187227910 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/164#issuecomment-7187227910). Originally posted by [JoeY54](https://github.com/JoeY54) on 2026-11-26T08:57:21Z. --- 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)_
JoeY54 commented 2026-11-26 10:11:01 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by JoeY54 on 2026-11-26T10:11:01Z.


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

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:comment:7189019623 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/164#issuecomment-7189019623). Originally posted by [JoeY54](https://github.com/JoeY54) on 2026-11-26T10:11:01Z. --- 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)_
JoeY54 commented 2026-11-26 17:11:46 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by JoeY54 on 2026-11-26T17:11:46Z.


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

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:comment:7198635423 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/164#issuecomment-7198635423). Originally posted by [JoeY54](https://github.com/JoeY54) on 2026-11-26T17:11:46Z. --- 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)_
JoeY54 commented 2026-11-26 17:55:30 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by JoeY54 on 2026-11-26T17:55:30Z.


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

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:comment:7199851375 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/164#issuecomment-7199851375). Originally posted by [JoeY54](https://github.com/JoeY54) on 2026-11-26T17:55:30Z. --- 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)_
JoeY54 commented 2026-11-27 01:09:15 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by JoeY54 on 2026-11-27T01:09:15Z.


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

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:comment:7207056216 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/164#issuecomment-7207056216). Originally posted by [JoeY54](https://github.com/JoeY54) on 2026-11-27T01:09:15Z. --- 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)_
JoeY54 commented 2026-11-27 01:11:29 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by JoeY54 on 2026-11-27T01:11:29Z.


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

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:comment:7207087524 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/164#issuecomment-7207087524). Originally posted by [JoeY54](https://github.com/JoeY54) on 2026-11-27T01:11:29Z. --- 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 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/164:upstream-pr/164'
git switch 'upstream-pr/164'

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/164'
git switch 'upstream-pr/164'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/164'
git switch 'upstream-pr/164'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/164'
git switch 'main'
git merge --squash 'upstream-pr/164'
git switch 'main'
git merge --ff-only 'upstream-pr/164'
git switch 'main'
git merge 'upstream-pr/164'
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
avatarmanz/VIctory-7900XTX!164
No description provided.