nix: use Microsoft's Linux DXC release so the DXC helper builds #650

Merged
gtb-sbe merged 1 commit from upstream-pr/650 into main 2026-12-02 21:11:08 +00:00
gtb-sbe commented 2026-12-02 11:49:20 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by gtb-sbe on 2026-12-02T11:49:20Z.


What changes

The flake's dev shell provided nixpkgs' directx-shader-compiler, which tracks the 1.10 preview (1.10.2605.37) and ships only bin/ and lib/. That has two effects on Nix hosts:

  • Shader preparation never uses the DXC helper (project_tuxbox/persistent_dxc.py). It needs a whole release with include/dxc/dxcapi.h and lib/libdxcompiler.so beside bin/dxc, and is checked only with 1.9.2609, so every prep prints "Not using the DXC helper, so shaders compile more slowly" and runs the dxc command line once per program, with the full pass list.
  • It is the release docs/PROJECTSCARLETT.md and examples/lanes/README.md advise against.

The flake now fetches Microsoft's Linux release 1.9.2609 (linux_dxc_2026_09_28.x86_x64.tar.gz, pinned by hash), patches it with autoPatchelfHook (it needs only zlib and libstdc++), and puts it in the shell in place of nixpkgs' package. It is also exported as packages.dxc. The release keeps its own layout, so find_dxc resolves bin/dxc, the helper finds include/ and lib/ next to it, and dxv comes from the same release. The Lanes README's Nix note says so.

Effect

In the new shell:

  • dxc --version: libdxcompiler.so: 1.9(5512-01b62ad4)(1.9.2609.5)
  • build_helper() builds build/dxc-helper/<key>/dxc-worker; a ProjectScarlett prep runs a pool of dxc-worker processes instead of one dxc per request, and no longer prints the "Not using the DXC helper" line.
  • I haven't timed a whole prep against the command line on the same translator, so I'm not claiming a speed-up here. The point is that Nix hosts get the helper at all, and with it the helper's own pass list changes such as #638.

Switching compilers changes the DXIL store's toolchain key, so the first prep after updating reuses no stored DXIL.

There's one more effect of moving from 1.10 back to 1.9. A linked-pipeline request (.link) keeps the pixel program's DXIL from the run that recorded it. If that was compiled by the 1.10 preview, 1.9's dxv refuses it with Validator version in metadata (1.10) is not supported; maximum: (1.9), so the request fails in every prep. On my machine, 342 of 50,497 requests failed this way in the first prep after the switch. The same requests compile with 1.10's tools, and the release fails the same way without the helper, so it's the validator version, not the helper. New link requests recorded under 1.9 carry 1.9 DXIL and compile normally. A fresh setup never sees this.

Checks

  • nix build .#dxc, nix develop on NixOS (x86_64).
  • python tuxbox.py check --no-gpu: 12 passed, 1 failed. The failure is GuestWatch (tests/test_stage_baseline.py), which fails the same way on unchanged main on NixOS: the test links realpath(sys.executable), which in the dev shell is the python3.withPackages wrapper, so the guest's comm is the real interpreter's name.
  • tests.test_repository_hygiene, tests.test_check: pass.
  • Full check in this shell on an RX 9060 XT (RADV, Mesa 26.3.1, GE-Proton11-15): 14 of 17 groups pass, D3D12 regression controls included. Three fail:
    • Python tests: GuestWatch only, as above.
    • Lanes: texture-publication only. That's #625, fixed on main by #647 after this branch's base.
    • Translator on the GPU: alu, 23 of 362 instructions wrong, all of them NaN payloads through multiply-add (v_mad_f32, v_fma_mix_f32 and similar give 0x7fc00001 where the console gives 0x7f800001). It isn't this change: alu alone with nixpkgs' 1.10 on the same commit fails with the same 23 results, value for value, and the DXIL for those shaders is identical under both compilers.
  • NVIDIA not run; the change only touches the Nix shell.

AI use

I made this branch with an AI coding agent (Claude Code, following AGENTS.md). The agent traced why the helper was never used here (missing headers, version gate), wrote the flake change and the README sentence, built the package, checked the helper builds and is used by a prep, and ran the checks listed above on my machine.

<!-- greyfinch-sync:brcly/TuxBox:issue:5605781201 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/650). Originally posted by [gtb-sbe](https://github.com/gtb-sbe) on 2026-12-02T11:49:20Z. --- ## What changes The flake's dev shell provided nixpkgs' `directx-shader-compiler`, which tracks the 1.10 preview (1.10.2605.37) and ships only `bin/` and `lib/`. That has two effects on Nix hosts: - Shader preparation never uses the DXC helper (`project_tuxbox/persistent_dxc.py`). It needs a whole release with `include/dxc/dxcapi.h` and `lib/libdxcompiler.so` beside `bin/dxc`, and is checked only with 1.9.2609, so every prep prints "Not using the DXC helper, so shaders compile more slowly" and runs the `dxc` command line once per program, with the full pass list. - It is the release `docs/PROJECTSCARLETT.md` and `examples/lanes/README.md` advise against. The flake now fetches Microsoft's Linux release 1.9.2609 (`linux_dxc_2026_09_28.x86_x64.tar.gz`, pinned by hash), patches it with `autoPatchelfHook` (it needs only zlib and libstdc++), and puts it in the shell in place of nixpkgs' package. It is also exported as `packages.dxc`. The release keeps its own layout, so `find_dxc` resolves `bin/dxc`, the helper finds `include/` and `lib/` next to it, and `dxv` comes from the same release. The Lanes README's Nix note says so. ## Effect In the new shell: - `dxc --version`: `libdxcompiler.so: 1.9(5512-01b62ad4)(1.9.2609.5)` - `build_helper()` builds `build/dxc-helper/<key>/dxc-worker`; a ProjectScarlett prep runs a pool of `dxc-worker` processes instead of one `dxc` per request, and no longer prints the "Not using the DXC helper" line. - I haven't timed a whole prep against the command line on the same translator, so I'm not claiming a speed-up here. The point is that Nix hosts get the helper at all, and with it the helper's own pass list changes such as #638. Switching compilers changes the DXIL store's toolchain key, so the first prep after updating reuses no stored DXIL. There's one more effect of moving from 1.10 back to 1.9. A linked-pipeline request (`.link`) keeps the pixel program's DXIL from the run that recorded it. If that was compiled by the 1.10 preview, 1.9's `dxv` refuses it with `Validator version in metadata (1.10) is not supported; maximum: (1.9)`, so the request fails in every prep. On my machine, 342 of 50,497 requests failed this way in the first prep after the switch. The same requests compile with 1.10's tools, and the release fails the same way without the helper, so it's the validator version, not the helper. New link requests recorded under 1.9 carry 1.9 DXIL and compile normally. A fresh setup never sees this. ## Checks - `nix build .#dxc`, `nix develop` on NixOS (x86_64). - `python tuxbox.py check --no-gpu`: 12 passed, 1 failed. The failure is `GuestWatch` (`tests/test_stage_baseline.py`), which fails the same way on unchanged `main` on NixOS: the test links `realpath(sys.executable)`, which in the dev shell is the `python3.withPackages` wrapper, so the guest's `comm` is the real interpreter's name. - `tests.test_repository_hygiene`, `tests.test_check`: pass. - Full `check` in this shell on an RX 9060 XT (RADV, Mesa 26.3.1, GE-Proton11-15): 14 of 17 groups pass, D3D12 regression controls included. Three fail: - Python tests: `GuestWatch` only, as above. - Lanes: `texture-publication` only. That's #625, fixed on `main` by #647 after this branch's base. - Translator on the GPU: `alu`, 23 of 362 instructions wrong, all of them NaN payloads through multiply-add (`v_mad_f32`, `v_fma_mix_f32` and similar give `0x7fc00001` where the console gives `0x7f800001`). It isn't this change: `alu` alone with nixpkgs' 1.10 on the same commit fails with the same 23 results, value for value, and the DXIL for those shaders is identical under both compilers. - NVIDIA not run; the change only touches the Nix shell. ## AI use I made this branch with an AI coding agent (Claude Code, following `AGENTS.md`). The agent traced why the helper was never used here (missing headers, version gate), wrote the flake change and the README sentence, built the package, checked the helper builds and is used by a prep, and ran the checks listed above on my machine.
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!650
No description provided.