launcher: experiment with a reserved live shader worker #240

Closed
Valdi320 wants to merge 1 commit from upstream-pr/240 into main
Valdi320 commented 2026-11-26 15:28:44 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by Valdi320 on 2026-11-26T15:28:44Z.


Problem

All live compiler workers can be occupied by large cold DXC compiles, leaving a small request waiting behind them. That may increase latency while a title is running.

Experiment

Opt-in TUXBOX_RUNTIME_FAST_LANE=1 reserves one worker when there are at least two. Classify cold work using generated HLSL >=256 KiB (the existing large-pixel threshold, not a proven cost predictor). Defer large requests without a failure marker and resume them in publication order when capacity is available. Warm cache hits bypass admission; source validation, compiler flags, timeouts, worker ceiling and launch-time preparation are unchanged.

Measurements

Two live workers, three large requests (same generated 506,834-byte HLSL fixture) followed by a small 5,873-byte request. Real DXC and DXV; synthetic translator stub; separate cold caches with content reuse disabled to isolate scheduling. Three runs per mode, median:

  • Small request completion: 901.2 -> 23.5 ms (~38x faster).
  • Whole batch: 1.831 -> 2.781 s (~52% slower).
  • Peak simultaneous large DXC invocations: 2 -> 1.
  • All four DXIL outputs identical across all six runs, with four DXC and DXV invocations each.
    These are synthetic latency/throughput measurements, not retail FPS or RAM measurements. Deferring a large request retranslates it once. Small expensive shaders can still block the reserved worker. Mixed workloads and memory pressure may benefit, while large-only batches may slow down. Keep disabled by default.

Validation

  • Regression coverage for small requests completing before blocked large work, deferred shutdown, one-worker compatibility, cold admission and warm reuse without failure/cache pollution.
  • All six official code-check groups passed.
  • 8/8 Lanes gates on RTX 4080/GE-Proton11-14 with experimental option enabled and two workers, reused same-base provider/fixture with verified source equality; current translator.
  • No retail data included.

Draft pending full GPU suite, AMD and actual title profiling. Independent of #239; combined effects are not measured.

<!-- greyfinch-sync:brcly/TuxBox:issue:5512799679 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/240). Originally posted by [Valdi320](https://github.com/Valdi320) on 2026-11-26T15:28:44Z. --- ## Problem All live compiler workers can be occupied by large cold DXC compiles, leaving a small request waiting behind them. That may increase latency while a title is running. ## Experiment Opt-in TUXBOX_RUNTIME_FAST_LANE=1 reserves one worker when there are at least two. Classify cold work using generated HLSL >=256 KiB (the existing large-pixel threshold, not a proven cost predictor). Defer large requests without a failure marker and resume them in publication order when capacity is available. Warm cache hits bypass admission; source validation, compiler flags, timeouts, worker ceiling and launch-time preparation are unchanged. ## Measurements Two live workers, three large requests (same generated 506,834-byte HLSL fixture) followed by a small 5,873-byte request. Real DXC and DXV; synthetic translator stub; separate cold caches with content reuse disabled to isolate scheduling. Three runs per mode, median: - Small request completion: 901.2 -> 23.5 ms (~38x faster). - Whole batch: 1.831 -> 2.781 s (~52% slower). - Peak simultaneous large DXC invocations: 2 -> 1. - All four DXIL outputs identical across all six runs, with four DXC and DXV invocations each. These are synthetic latency/throughput measurements, not retail FPS or RAM measurements. Deferring a large request retranslates it once. Small expensive shaders can still block the reserved worker. Mixed workloads and memory pressure may benefit, while large-only batches may slow down. Keep disabled by default. ## Validation - Regression coverage for small requests completing before blocked large work, deferred shutdown, one-worker compatibility, cold admission and warm reuse without failure/cache pollution. - All six official code-check groups passed. - 8/8 Lanes gates on RTX 4080/GE-Proton11-14 with experimental option enabled and two workers, reused same-base provider/fixture with verified source equality; current translator. - No retail data included. Draft pending full GPU suite, AMD and actual title profiling. Independent of #239; combined effects are not measured.
Valdi320 commented 2026-11-26 23:21:17 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by Valdi320 on 2026-11-26T23:21:17Z.


Deferred: reserved-worker experiment improves synthetic small-request latency but slows batch throughput ~52%; Nick's #283 addresses observed request wake-up latency independently. Revisit only if contention remains measured. Closing this draft to make the review queue manageable, per the maintainer's request. The branch and history remain intact at 5cbe1b1; no branch deleted.

<!-- greyfinch-sync:brcly/TuxBox:comment:7205470359 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/240#issuecomment-7205470359). Originally posted by [Valdi320](https://github.com/Valdi320) on 2026-11-26T23:21:17Z. --- Deferred: reserved-worker experiment improves synthetic small-request latency but slows batch throughput ~52%; Nick's #283 addresses observed request wake-up latency independently. Revisit only if contention remains measured. Closing this draft to make the review queue manageable, per the maintainer's request. The branch and history remain intact at `5cbe1b1`; no branch deleted.

Pull request closed

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
brcly/TuxBox!240
No description provided.