warm: no sync per prepared pipeline, VICTORY_WARM_JOBS sets the processes #270

Manually merged
github merged 1 commit from github-bot/gh-270 into main 2026-12-03 02:08:32 +00:00 AGit
Owner

@⁠felipebdn on GitHub · 2026-12-02 23:40 UTC · original
felipebdn:warm/jobs-and-sync → main · +27 −1 · 3 files · 1 commits · merged 2026-12-03 02:05 UTC

What

  • victory warm no longer syncs each prepared pipeline's file to the disk as it writes it. The kernel's writeback handles it. A file that a power cut leaves short fails its blake3 hash on load and is made again. VICTORY_WARM_SYNC=1 restores the old per-file sync.
  • VICTORY_WARM_JOBS=<n> (1 to 64) sets the number of warm processes. The default is unchanged: two thirds of the logical processors, at most 16, limited by memory.
  • Both options are documented in run.conf.default (empty by default) and in the README table.

Why

On btrfs over LUKS, the per-file sync_all kept the workers waiting in the filesystem's log commit, not compiling (/proc/<pid>/wchan: btrfs_sync_log, wait_log_commit).

Same machine, same 94,283 pipelines (Ryzen 7 7800X3D, 16 threads, RX 9070 XT, 30 GB RAM):

Before (10 processes, sync per file) After (32 processes, no sync)
Pipelines/s 16–32 ~114 (15,785 in 138 s)
CPU idle 57% 9.6%
I/O wait 15.7% 0.6%
I/O pressure (full, avg10) ~50% ~2%

The warm resumed from its warm-done list across the change. Each worker used about 200–280 MB resident at 32 processes.

Testing

  • ./build.sh (release) builds without warnings.
  • ./build.sh test -p victory-core passes, including the menu tests that parse run.conf.default.
  • I prepared all 94,283 pipelines on the hardware above with VICTORY_WARM_JOBS=32, over two runs (the second resumed at 90,699). The game then started and loaded the prepared pipelines from disk ("native pipelines restored"), with 0 bad.

🤖 Generated with Claude Code

**@⁠felipebdn** on GitHub · 2026-12-02 23:40 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/270) `felipebdn:warm/jobs-and-sync` → `main` · +27 −1 · 3 files · 1 commits · merged 2026-12-03 02:05 UTC ## What - `victory warm` no longer syncs each prepared pipeline's file to the disk as it writes it. The kernel's writeback handles it. A file that a power cut leaves short fails its blake3 hash on load and is made again. `VICTORY_WARM_SYNC=1` restores the old per-file sync. - `VICTORY_WARM_JOBS=<n>` (1 to 64) sets the number of warm processes. The default is unchanged: two thirds of the logical processors, at most 16, limited by memory. - Both options are documented in `run.conf.default` (empty by default) and in the README table. ## Why On btrfs over LUKS, the per-file `sync_all` kept the workers waiting in the filesystem's log commit, not compiling (`/proc/<pid>/wchan`: `btrfs_sync_log`, `wait_log_commit`). Same machine, same 94,283 pipelines (Ryzen 7 7800X3D, 16 threads, RX 9070 XT, 30 GB RAM): | | Before (10 processes, sync per file) | After (32 processes, no sync) | |---|---|---| | Pipelines/s | 16–32 | ~114 (15,785 in 138 s) | | CPU idle | 57% | 9.6% | | I/O wait | 15.7% | 0.6% | | I/O pressure (full, avg10) | ~50% | ~2% | The warm resumed from its `warm-done` list across the change. Each worker used about 200–280 MB resident at 32 processes. ## Testing - `./build.sh` (release) builds without warnings. - `./build.sh test -p victory-core` passes, including the menu tests that parse `run.conf.default`. - I prepared all 94,283 pipelines on the hardware above with `VICTORY_WARM_JOBS=32`, over two runs (the second resumed at 90,699). The game then started and loaded the prepared pipelines from disk ("native pipelines restored"), with 0 bad. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Each prepared pipeline's file was synced to the disk as it was written.
On btrfs over LUKS (Ryzen 7 7800X3D, 16 threads) the 94,283 pipelines'
syncs held the workers in the log commit: 16-32 pipelines/s, processors
57% idle, 15.7% I/O wait, I/O pressure ~50% full.

The files are now left to the kernel's writeback. A file a power cut
leaves short fails its blake3 hash on load and is made again
(VICTORY_WARM_SYNC=1 syncs each as before).

VICTORY_WARM_JOBS=<n> (1 to 64) sets the processes, in place of two
thirds of the logical processors, at most 16. With 32 and no sync the
same machine made ~114 pipelines/s (15,785 in 138 s), processors 90%
busy, 0.6% I/O wait.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-02 23:45:33 +00:00
github manually merged commit 8fd0a70277 into main 2026-12-03 02:08:31 +00:00
Author
Owner

@⁠wrz1911 on GitHub · 2026-12-03 14:13 UTC · original

Related data point: on a 24-thread CPU (Core Ultra 7 270K Plus), warm hangs above 12 jobs — workers stop making progress, unresponsive for 45 s lines accumulate and warm-done stays 0. 12 jobs works (~44 pipelines/s avg). Details and environment: #325.

**@⁠wrz1911** on GitHub · 2026-12-03 14:13 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/270#issuecomment-7381104971) Related data point: on a 24-thread CPU (Core Ultra 7 270K Plus), warm hangs above 12 jobs — workers stop making progress, `unresponsive for 45 s` lines accumulate and warm-done stays 0. 12 jobs works (~44 pipelines/s avg). Details and environment: #325.
This discussion has been locked. Commenting is limited to contributors.
No description provided.