Recompiler: DXC gets the code without indentation and comment lines; … #1582

Closed
github-bot wants to merge 1 commit from gh-pr/1582/head into gh-pr/1582/base
Owner

@⁠gbuyssens on GitHub · 2026-11-24 17:55 UTC · original
gbuyssens:pr/dxc-strip → main · +42 −0 · 1 files · 1 commits · closed without merging

…the -O level counts code

A translated program's HLSL is 30.7 % leading indentation and 25.0 % // pc: instruction comment lines (measured over a retail pack's 2 689 compute programs in #1269), and compile_here chose -O0 above 8 MB and -O1 above 1 MB of that text: a 9.9 MB program with 4.4 MB of code was compiled at -O0, its DXIL 0.95x the source instead of 0.28x, and the driver did not finish it.

DXC now gets the text without the indentation and with the comment lines emptied (not removed: its line numbers still match the dumped HLSL), and the -O level is chosen on that text. The DXIL cache stays keyed on the full text, so nothing cached is built again. XCL_DXC_STRIP=0 turns it off, for A/B measurements. Test: dxc_gets_the_code_without_indentation_and_comment_lines.

What is in it

Tested

  • hardware (GPU + driver, CPU), Rust version, debug / release:
  • cargo test --workspace -- --test-threads=4: N passed, N failed, N ignored (SKIPPED GPU tests: …)

Regression run

main:

PR:

Not tested

AI use

  • none / tool and model, and what it did
**@⁠gbuyssens** on GitHub · 2026-11-24 17:55 UTC · [original](https://github.com/xcl-dev/xcl/pull/1582) `gbuyssens:pr/dxc-strip` → `main` · +42 −0 · 1 files · 1 commits · closed without merging …the -O level counts code A translated program's HLSL is 30.7 % leading indentation and 25.0 % `// pc: instruction` comment lines (measured over a retail pack's 2 689 compute programs in #1269), and `compile_here` chose -O0 above 8 MB and -O1 above 1 MB of that text: a 9.9 MB program with 4.4 MB of code was compiled at -O0, its DXIL 0.95x the source instead of 0.28x, and the driver did not finish it. DXC now gets the text without the indentation and with the comment lines emptied (not removed: its line numbers still match the dumped HLSL), and the -O level is chosen on that text. The DXIL cache stays keyed on the full text, so nothing cached is built again. XCL_DXC_STRIP=0 turns it off, for A/B measurements. Test: dxc_gets_the_code_without_indentation_and_comment_lines. <!-- What changes and why, in a few sentences. "Fixes #N" / "Part of #N". Stacked: "Stacked on #N". --> **What is in it** - **Tested** - hardware (GPU + driver, CPU), Rust version, debug / release: - `cargo test --workspace -- --test-threads=4`: N passed, N failed, N ignored (SKIPPED GPU tests: …) **Regression run** <!-- Required when the PR changes crates/xcl/src outside tests: `scripts/smoke.ps1` on a real title, built from main and from this PR's head commit (no uncommitted changes); paste both blocks. Rerun the PR's after every push. Not needed for docs / tests / scripts only. --> main: PR: **Not tested** - **AI use** - none / tool and model, and what it did
A translated program's HLSL is 30.7 % leading indentation and 25.0 % `// pc: instruction`
comment lines (measured over a retail pack's 2 689 compute programs in #1269), and `compile_here`
chose -O0 above 8 MB and -O1 above 1 MB of that text: a 9.9 MB program with 4.4 MB of code was
compiled at -O0, its DXIL 0.95x the source instead of 0.28x, and the driver did not finish it.

DXC now gets the text without the indentation and with the comment lines emptied (not removed:
its line numbers still match the dumped HLSL), and the -O level is chosen on that text. The DXIL
cache stays keyed on the full text, so nothing cached is built again. XCL_DXC_STRIP=0 turns it
off, for A/B measurements. Test: dxc_gets_the_code_without_indentation_and_comment_lines.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:58:17 +00:00
github-bot closed this pull request 2026-11-26 04:58:17 +00:00
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 20:02 UTC · original

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified main.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-24 20:02 UTC · [original](https://github.com/xcl-dev/xcl/pull/1582#issuecomment-7142965630) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~22 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified `main`.) Thanks!

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.