Repository navigation
Conversation
|
Independent AMD test of the 1 MiB DXC cutoff on Tested
Forcing the same optimization level on both sources produced byte-identical DXIL at each of Not tested Retail shaders, retail title runs, DXC or driver timings, and a crossing of the 8 MiB cutoff. The two integration tests were temporary probes. AI use OpenAI Codex (GPT-6 family, exact variant unavailable) wrote the probes, ran the checks, and drafted this report. |
|
@nnonno91 thank you. This covers the first point under Not tested: a program that the cap brings under the 1 MiB line.
So the gain for programs near the line is the higher level, and the cap changes nothing else in the DXIL. The 8 MiB line and timings on retail programs are still open; I'll post them here if I get them. AI use: Claude Code (Claude Opus 5.5) wrote this reply. |
Adapt the indentation cap from xcl-dev#1584 for compute and kernel shaders on adapters configured for split waves. Keep the original source when trimming it would change the optimization level. Four synthetic threshold-crossing shaders kept identical DXIL; the RTX 5070 nested shader fixture also preserved register results. Assisted-by: Codex (gpt-6.2-astra) Assisted-by: Claude Code (Claude Opus 5.5)
|
Hardware: AMD Radeon RX 7900 XTX (driver 32.0.32029.2010), Ryzen 9 7950X3D, 32 GB, Windows 11 Pro 10.0.26300, rustc 1.100.0; tests in debug, timings in release. DXC 1.8.2505.32 (Windows SDK 10.0.28000.0). Tested (AMD), commit
Not tested
AI use
|
|
@kleborgn thanks for the AMD run. AI use: Claude Code (Claude Opus 5.5) wrote this reply. |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Independent Windows release verification on NVIDIA RTX 3060 Ti ( Setup
Workspace tests (
Regression run (
Base ( PR head ( Not tested: cold-cache HLSL size/compile-time measurement on the full retail shader pack, AMD / wave64 hardware. AI use: Antigravity ( |
|
Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current |
emit_structured indented every nested if / loop one more level. A retail compute program whose loops nest ~65 deep carried 42.7 MB of leading whitespace in 53.0 MB of HLSL (~80 %, measured on xcl-dev#1345); DXC reads and keeps those bytes although they mean nothing to it. Indentation stops at 8 levels (MAX_INDENT); deeper code is written at the cap. Only whitespace changes. Measured on three retail compute programs on main alone (no xcl-dev#1345), size of the HLSL file: p16 29,598,855 -> 19,264,315 B (29.6 -> 19.3 MB) p17 29,524,131 -> 19,189,591 B (29.5 -> 19.2 MB) p18 151,193,185 -> 117,650,689 B (151.2 -> 117.7 MB) a saving of 22-35 % on main. Synthetic test program (14 nested ifs): 35346 -> 34498 bytes. dxc.rs:491-494 picks the DXC level from the raw src.len(), whitespace included. Programs of about 1.0 - 1.5 MiB move from -O1 to -O3 and programs of about 8 - 11 MiB from -O0 to -O1. None of the three measured programs crosses a line (all stay above 8 MiB, at -O0); DXC time p16 69.9 s -> 64.0 s, p17 63.1 s -> 63.2 s. emit_range (the unstructured fallback) is not capped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013qV4hiM5Sx9hBkPpgAarKX
|
Rebased onto current main (623d02e); the suite rerun and the smoke pair on the new head are updated in the description. |
|
No open or merged PR caps the structured emitter's indentation; main still writes AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
|
Closing: compute shaders now take the direct DXIL path by default, so the HLSL indent cap saves little on the default path, and the checks on the earlier head no longer count. Thanks to everyone who tested it. Closed by the author (audit by Claude Code, Claude Opus 5.5). |
The structured form limits how deep code nests (
MAX_NEST), but not how far it is indented: every nestedifand loop adds four spaces. On big compute programs most of the HLSL is leading whitespace, which DXC reads and keeps although it means nothing to it. On #1345's form, @wondercrash measured 42.7 MB of whitespace in the 53.0 MB ofActivateRays(#1345 comment 7137676632, point 1). This PR stops indentation at 8 levels and changes nothing else. Part of #1269.What is in it
crates/xcl/src/gpu/recomp/mod.rs:MAX_INDENT = 8, applied inemit_structuredandemit_block.emit_range, the unstructured fallback, is not capped.crates/xcl/src/gpu/recomp/tests.rs:structured_indentation_stops_at_the_cap(14 nested ifs; the widest line is 28 spaces). With the cap at 99 it fails (60 spaces).Tested
RTX 4090 24 GB (driver 621.40), i9-13900K, 32 GB, Windows 11 Pro build 26300, rustc 1.100.0. Suite in debug, smoke runs in release.
Rebased onto
main623d02e (head6316fa3f), RTX 4090 (driver 621.40), rustc 1.100.0, debug:cargo build --workspace && cargo test --workspace -- --test-threads=4gave 1459 passed, 0 failed, 47 ignored.SKIPPED (28): no wave64 (21), no
xgameruntime.dll(2), no heap windows (1), per-lane f16/f32 cases refused by the per-lane form (3, as onmain),pso_measurement_compiles_an_exact_synthetic_record(cannot disable the driver cache; the log shows a 'missing SDK component' error) (1).Fails without the change: with
MAX_INDENTat 99,structured_indentation_stops_at_the_capfails (rerun ondee5ada).The HLSL and DXC numbers below were measured before the rebase, at
f578e66; the patch is the same.Only whitespace changes. On the three programs below, the HLSL with the cap and with the cap lifted is byte-identical once leading spaces are stripped (sha1 compared).
HLSL size on
main(without Recompiler: one skip variable for all forward jumps of structured code #1345), three retail compute programs:ActivateRays)DXC time (one debug run each): program 1 69.9 → 64.0 s, program 2 63.1 → 63.2 s. Program 3 timed out at 280 s both ways.
Regression run
The retail title,
XCL_PRESS_AT=16:A, 60 s,XCL_PREPARE=0, fresh gamesave. Both runs on this machine (RTX 4090, driver 621.40), release builds of clean trees, one untimed warm-up each, then the measured run.main (623d02e):
This PR's head (6316fa3):
The PR's run got 100.5 % of
main's frames and 106 % of its peak commit.Not tested
dxc.rs:491-494picks the level from the raw source length, whitespace included, so a program the cap brings under a line gets compiled at a higher level. About 1.0–1.5 MiB moves from-O1to-O3, and about 8–11 MiB from-O0to-O1. None of the three programs above crosses a line (all stay at-O0), and I have not measured a program that does. If DXC: sources over 8 MB use -O1, not -O0 #1526 merges, only the 1 MiB line remains.main) falls back to the pc form above128 * program.len()bytes, a limit set on uncapped sizes; with the cap, fewer programs reach it.arguments(src.len(), ..)also keys on raw size.XCL_PRESS_AT=16:Awas set as usual.AI use
dee5ada.🤖 Generated with Claude Code