perf: scale shadow, pipeline, and DirectStorage worker counts with CPU cores #49

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

@⁠fever308 on GitHub · 2026-11-24 20:54 UTC · original
fever308:feat/auto-cpu-worker-scaling → main · +80 −5 · 3 files · 1 commits · open

Summary

crates/
├── victory-gpu/src/
│   ├── shadow.rs         # copy_wide_max_jobs = clamp(cores / 2, 1, 8); wide_worker_count = clamp(cores / 4, 1, 8)
│   └── pipeline/make.rs  # pipeline_worker_count = clamp(cores / 2, 2, 12)
└── victory-hle/src/
    └── modules/dstorage.rs  # dstorage_worker_count = clamp(cores, 2, 16)

Evidence

  • Before: copy_wide capped at 6 threads on all hosts, wide workers clamped to 2..=6, host pipeline workers clamped to 2..=8, and DirectStorage spawned one worker per logical core with no upper cap.
    After:
    • cargo test -p victory-gpu worker_count_scales_with_cores + copy_wide_max_jobs_scales_with_cores: passed.
    • cargo test -p victory-hle dstorage_worker_count_scales_with_cores: 1 passed.
    • cargo clippy (--all-targets -- -D warnings, default and --all-features) on victory-gpu and victory-hle: clean.

Merge Danger

Door: two-way

Pure worker-count formulas evaluated once on first pool initialization.

Blast Radius: Workers

Changes background thread counts for shadow memory copies, host pipeline compilation, and DirectStorage decompression across low- and high-core hosts.

**@⁠fever308** on GitHub · 2026-11-24 20:54 UTC · [original](https://github.com/fxceless/victory-fork/pull/49) `fever308:feat/auto-cpu-worker-scaling` → `main` · +80 −5 · 3 files · 1 commits · open ## Summary ```text crates/ ├── victory-gpu/src/ │ ├── shadow.rs # copy_wide_max_jobs = clamp(cores / 2, 1, 8); wide_worker_count = clamp(cores / 4, 1, 8) │ └── pipeline/make.rs # pipeline_worker_count = clamp(cores / 2, 2, 12) └── victory-hle/src/ └── modules/dstorage.rs # dstorage_worker_count = clamp(cores, 2, 16) ``` ## Evidence - **Before:** `copy_wide` capped at 6 threads on all hosts, `wide` workers clamped to `2..=6`, host pipeline workers clamped to `2..=8`, and DirectStorage spawned one worker per logical core with no upper cap. **After:** - `cargo test -p victory-gpu worker_count_scales_with_cores` + `copy_wide_max_jobs_scales_with_cores`: passed. - `cargo test -p victory-hle dstorage_worker_count_scales_with_cores`: 1 passed. - `cargo clippy` (`--all-targets -- -D warnings`, default and `--all-features`) on `victory-gpu` and `victory-hle`: clean. ## Merge Danger **Door:** two-way Pure worker-count formulas evaluated once on first pool initialization. **Blast Radius:** Workers Changes background thread counts for shadow memory copies, host pipeline compilation, and DirectStorage decompression across low- and high-core hosts.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:35:14 +00:00
github-bot referenced this pull request from a commit 2026-11-26 03:40:07 +00:00
Author
Owner

@⁠Headache3318 on GitHub · 2026-11-25 04:14 UTC · original

Corpus count at current main (c96b4f2). Machine: Arch Linux, kernel 7.3.5-arch1-1, 3x RTX 4090 driver 620.73.04, Proton, AI-assisted. Results: 26,084/26,084 programs translated to IR (100%). 25,598/25,694 known-type programs emitted DXIL (96 not emitted). 8,015/25,598 emitted programs passed validation (31.3%). 17,873 total errors across 27 error classes. Top error: Pipeline State Validation mismatch (17,367 = 97% of all errors). By type: compute 100% pass (2,672/2,672), mesh 30.2% (2,649/8,762), vertex+pixel 19.0% (2,694/14,164). Required installing dxil.dll from Microsoft.Direct3D.DXC NuGet into Wine prefix to enable --validate.

**@⁠Headache3318** on GitHub · 2026-11-25 04:14 UTC · [original](https://github.com/fxceless/victory-fork/pull/49#issuecomment-7152657467) Corpus count at current main (c96b4f2). Machine: Arch Linux, kernel 7.3.5-arch1-1, 3x RTX 4090 driver 620.73.04, Proton, AI-assisted. Results: 26,084/26,084 programs translated to IR (100%). 25,598/25,694 known-type programs emitted DXIL (96 not emitted). 8,015/25,598 emitted programs passed validation (31.3%). 17,873 total errors across 27 error classes. Top error: Pipeline State Validation mismatch (17,367 = 97% of all errors). By type: compute 100% pass (2,672/2,672), mesh 30.2% (2,649/8,762), vertex+pixel 19.0% (2,694/14,164). Required installing dxil.dll from Microsoft.Direct3D.DXC NuGet into Wine prefix to enable --validate.
Author
Owner

@⁠fever308 on GitHub · 2026-11-25 04:17 UTC · original

Thanks for sharing the baseline numbers, @Headache3318! Just a quick heads-up that this PR is for scaling CPU worker counts (shadow / pipeline / DirectStorage), not shader translation/validation — in case you meant to post the corpus report on a shader or corpus tracking issue.

**@⁠fever308** on GitHub · 2026-11-25 04:17 UTC · [original](https://github.com/fxceless/victory-fork/pull/49#issuecomment-7152702925) Thanks for sharing the baseline numbers, `@Headache3318`! Just a quick heads-up that this PR is for scaling CPU worker counts (shadow / pipeline / DirectStorage), not shader translation/validation — in case you meant to post the corpus report on a shader or corpus tracking issue.
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/49/head:github-bot/gh-49'
git switch 'github-bot/gh-49'

Merge

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