Skip to content

worker: add experimental persistent DXC - #134

Merged
brcly merged 2 commits into
brcly:mainfrom
smith-3:codex/persistent-dxc
Nov 25, 2026
Merged

brcly merged 2 commits into
brcly:mainfrom
smith-3:codex/persistent-dxc

Conversation

@smith-3

@smith-3 smith-3 commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add a Linux DXC helper for optimized cs_6_0 requests behind
TUXBOX_PERSISTENT_DXC. The worker keeps one helper per active
compiler slot. It retries a lost helper once and falls back to the CLI
if the helper or DXV validation fails. The CLI remains the default.

The opt-in backend has its own cache identity. It retains validated
DXIL reuse when a translator update emits the same HLSL.

Revalidation on e8898ce (main 5678a2f)

All five contributor checks passed locally. The merge keeps DXV validation on both paths and preserves main's CLI handling for large pixel shaders.

Four parallel jobs, the same 96 synthetic compute shaders, eight alternating pairs. Times are medians across runs, measured from request publication through the worker response. Batch time includes request cleanup.

Metric DXC CLI Persistent DXC
Cold batch 234 ms 194 ms
Cold request p95 224 ms 186 ms
Warm batch 62 ms 67 ms
Cold peak aggregate RSS (sampled) 110 MiB 137 MiB

All 96 DXIL hashes matched the CLI in every cold and warm run, with zero timeouts. In a separate traced run, one helper was killed after writing 12 bytes. The worker started a replacement, validated all 96 outputs with DXV and returned the same hashes without a CLI compilation. Traced runs are excluded from the timings.

Earlier checks

  • All checks in CONTRIBUTING.md passed locally, including four new
    tests for retry, partial output cleanup, CLI fallback, and cache identity.
  • Four jobs, 96 synthetic compute shaders, eight alternating pairs on
    a Ryzen 7 9700X with Microsoft DXC 1.9.2609. Median cold batch time
    fell from 430 ms to 340 ms. Median p95 fell from 413 ms to 324 ms.
    All returned DXIL matched the CLI by SHA-256.
  • The repository's 64-shader corpus also matched. Median cold time
    fell from 282 ms to 229 ms across five alternating pairs.
  • A controlled SIGKILL during output restarted one helper and all 96
    requests still matched the CLI. A distinct translator fingerprint
    with identical HLSL reused all 96 DXIL outputs without calling DXC.

The synthetic runs showed overlapping warm timings and about 36 MiB
more sampled peak aggregate RSS in the 96-shader cold runs. The
experimental section in docs/PROJECTSCARLETT.md has setup and
reproduction instructions.

AI-assisted contribution.

@smith-3
smith-3 marked this pull request as ready for review November 25, 2026 10:24
Copilot AI balanced review requested due to automatic review settings November 25, 2026 10:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@brcly
brcly merged commit fcd74ae into brcly:main Nov 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants