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

Closed
gbuyssens wants to merge 1 commit from upstream-pr/1582 into main
gbuyssens commented 2026-11-24 17:55:06 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gbuyssens on 2026-11-24T17:55:06Z.


…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
<!-- greyfinch-sync:ivall/xcl:issue:6588077468 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1582). Originally posted by [gbuyssens](https://github.com/gbuyssens) on 2026-11-24T17:55:06Z. --- …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
upstream-sync closed this pull request 2026-11-24 18:08:37 +00:00
DavidM1911 commented 2026-11-24 21:09:13 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T20:02:50Z.


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!

<!-- greyfinch-sync:ivall/xcl:comment:7142965630 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1582#issuecomment-7142965630). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T20:02:50Z. --- 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

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
xcl-dev/xcl!1572
No description provided.