shader cache: schedule independent live translations concurrently #54

Manually merged
github merged 1 commit from gh-pr/54/head into gh-pr/54/base 2026-11-26 06:27:59 +00:00
Owner

@⁠Valdi320 on GitHub · 2026-11-24 13:11 UTC · original
Valdi320:work/scarlett-parallel-shader-requests → main · +1218 −69 · 13 files · 1 commits · merged 2026-11-24 19:49 UTC

Change

Schedule independent on-demand shader translations concurrently (default four, configurable 1–8), retain same-key serialization without hash-bucket collisions, and share still-published requests after a guest timeout. Publish failures before removing the source so the next generation cannot be confused with the prior failure. Bounded active jobs, ordered mixed request types, graceful drain, and no persistent refusal for transient tool errors.

Measured results

Ryzen 5 5600X / Bazzite, same xshader and DXC/DXV, synthetic compute corpus. Five repeats per configuration: 64 cold requests median 0.881 s serial, 0.300 s with four jobs, 0.229 s with eight. 170 timed batches, 6,350 responses, identical output hashes across corresponding variants; zero timeouts. Four jobs chosen to balance CPU/memory cost. Warm host-side burst median 0.074 -> 0.096 s; single cold request ~0.065 s. These are not retail game loading measurements.

Validation

  • 130 Python tests, two native Rust lock tests; focused worker controls repeated 30 times.
  • Windows D3D12 provider rebuilt; all six standalone GPU smoke suites passed.
  • Real Xbox D3D12 provider on RTX 4080 with Proton, no-op pipeline fallback disabled: 24 simultaneous pipeline creations for 16 distinct inputs at four jobs, repeated at eight jobs; all 48 succeeded, 16 translations in each run (no duplicate compilations), identical validated outputs. Reproduction tools and receipts included.
  • Separate local integration of eight earlier contributions passed 264 CPU tests, six GPU smoke suites and 113 synthetic numerical graphics controls. This does not make those changes part of this PR.

Limits

Synthetic inputs, no authorized retail shader corpus/gameplay tested. Cross-process/cross-session deduplication is not claimed; only per-game-process same-key serialization. Numerical sampler-specific validation remains outside this change. AI-assisted contribution.

**@⁠Valdi320** on GitHub · 2026-11-24 13:11 UTC · [original](https://github.com/brcly/TuxBox/pull/54) `Valdi320:work/scarlett-parallel-shader-requests` → `main` · +1218 −69 · 13 files · 1 commits · merged 2026-11-24 19:49 UTC ## Change Schedule independent on-demand shader translations concurrently (default four, configurable 1–8), retain same-key serialization without hash-bucket collisions, and share still-published requests after a guest timeout. Publish failures before removing the source so the next generation cannot be confused with the prior failure. Bounded active jobs, ordered mixed request types, graceful drain, and no persistent refusal for transient tool errors. ## Measured results Ryzen 5 5600X / Bazzite, same xshader and DXC/DXV, synthetic compute corpus. Five repeats per configuration: 64 cold requests median 0.881 s serial, 0.300 s with four jobs, 0.229 s with eight. 170 timed batches, 6,350 responses, identical output hashes across corresponding variants; zero timeouts. Four jobs chosen to balance CPU/memory cost. Warm host-side burst median 0.074 -> 0.096 s; single cold request ~0.065 s. These are not retail game loading measurements. ## Validation - 130 Python tests, two native Rust lock tests; focused worker controls repeated 30 times. - Windows D3D12 provider rebuilt; all six standalone GPU smoke suites passed. - Real Xbox D3D12 provider on RTX 4080 with Proton, no-op pipeline fallback disabled: 24 simultaneous pipeline creations for 16 distinct inputs at four jobs, repeated at eight jobs; all 48 succeeded, 16 translations in each run (no duplicate compilations), identical validated outputs. Reproduction tools and receipts included. - Separate local integration of eight earlier contributions passed 264 CPU tests, six GPU smoke suites and 113 synthetic numerical graphics controls. This does not make those changes part of this PR. ## Limits Synthetic inputs, no authorized retail shader corpus/gameplay tested. Cross-process/cross-session deduplication is not claimed; only per-game-process same-key serialization. Numerical sampler-specific validation remains outside this change. AI-assisted contribution.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:27:58 +00:00
github manually merged commit ff033aa844 into gh-pr/54/base 2026-11-26 06:27:59 +00:00
Author
Owner

@⁠DrArroway on GitHub · 2026-11-24 18:07 UTC · original

Independent check of #54 (ff033aa84) on CachyOS Linux (7.3.6-1-cachyos), AMD Ryzen 9 7900X + Radeon RX 6900 XT (1002:73bf, Mesa RADV 26.3.1-arch3.4, Proton Experimental 1794497090 experimental-11.0-20261112-x86_64):

1. Unit & Build Checks

  • .venv/bin/python -m unittest tests/test_runtime_shader_workers.py tests/test_runtime_shader_links.py -v: 14 tests OK (0.078 s)
  • .venv/bin/python -m unittest discover -s tests -q: 130 tests OK (0.601 s)
  • cargo check --locked --offline --target x86_64-pc-windows-msvc -p tuxbox-d3d12: OK
  • Built d3d12_xs.dll (build.py d3d12) and xshader.

2. Host Worker Latency Benchmark (tools/benchmark_scarlett_worker.py, 3 rounds × 64 synthetic shaders)

Tools: xshader + DXC 1.9.2609.5 + dxv. Zero failures and zero timeouts; all 18 phase runs (1,152 total shader outputs) matched SHA-256 identically across jobs=1, 4, 8:

--jobs Cold median (all 3 rounds) Warm median Cold peak RSS median Timeouts
1 0.753 s (0.773, 0.753, 0.750) 0.079 s 54.6 MiB 0
4 0.276 s (0.277, 0.276, 0.270) 0.077 s 99.1 MiB 0
8 0.209 s (0.207, 0.215, 0.209) 0.074 s 123.9 MiB 0

3. Rebuilt d3d12_xs.dll GPU/Proton Checks (1002:73bf)

10/10 passed via tuxbox.py verify: d3d12-exports, d3d12-features, d3d12-draw, d3d12-mesh, d3d12-tables, d3d12-queues, d3d12-queries, d3d12-indirect, d3d12-stream, lanes-xbox-replay.

(Note: tools/check_live_shader_worker.py was not run here because xvfb-run and Windows dxcompiler.dll/dxil.dll are not installed on this host.)

Synthetic/homebrew inputs only; no game data. AI-assisted.

**@⁠DrArroway** on GitHub · 2026-11-24 18:07 UTC · [original](https://github.com/brcly/TuxBox/pull/54#issuecomment-7140189325) Independent check of `#54` (`ff033aa84`) on CachyOS Linux (`7.3.6-1-cachyos`), AMD Ryzen 9 7900X + Radeon RX 6900 XT (`1002:73bf`, Mesa RADV `26.3.1-arch3.4`, Proton Experimental `1794497090 experimental-11.0-20261112-x86_64`): ### 1. Unit & Build Checks - `.venv/bin/python -m unittest tests/test_runtime_shader_workers.py tests/test_runtime_shader_links.py -v`: **14 tests OK** (`0.078 s`) - `.venv/bin/python -m unittest discover -s tests -q`: **130 tests OK** (`0.601 s`) - `cargo check --locked --offline --target x86_64-pc-windows-msvc -p tuxbox-d3d12`: OK - Built `d3d12_xs.dll` (`build.py d3d12`) and `xshader`. ### 2. Host Worker Latency Benchmark (`tools/benchmark_scarlett_worker.py`, 3 rounds × 64 synthetic shaders) Tools: `xshader` + DXC `1.9.2609.5` + `dxv`. Zero failures and zero timeouts; all 18 phase runs (`1,152` total shader outputs) matched SHA-256 identically across `jobs=1, 4, 8`: | `--jobs` | Cold median (all 3 rounds) | Warm median | Cold peak RSS median | Timeouts | |---|---:|---:|---:|---:| | `1` | **0.753 s** (`0.773`, `0.753`, `0.750`) | 0.079 s | 54.6 MiB | 0 | | `4` | **0.276 s** (`0.277`, `0.276`, `0.270`) | 0.077 s | 99.1 MiB | 0 | | `8` | **0.209 s** (`0.207`, `0.215`, `0.209`) | 0.074 s | 123.9 MiB | 0 | ### 3. Rebuilt `d3d12_xs.dll` GPU/Proton Checks (`1002:73bf`) `10/10` passed via `tuxbox.py verify`: `d3d12-exports`, `d3d12-features`, `d3d12-draw`, `d3d12-mesh`, `d3d12-tables`, `d3d12-queues`, `d3d12-queries`, `d3d12-indirect`, `d3d12-stream`, `lanes-xbox-replay`. *(Note: `tools/check_live_shader_worker.py` was not run here because `xvfb-run` and Windows `dxcompiler.dll`/`dxil.dll` are not installed on this host.)* Synthetic/homebrew inputs only; no game data. AI-assisted.
This discussion has been locked. Commenting is limited to contributors.
No description provided.