Compilation Time: DXC Compile Time Issues #293
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-27T02:41:03Z.
Hey guys,
I know we're all fighting compilation times on shaders.
The number 1 suspect for that atm is DXC.
Our validator and translator layer is really fast, fantastic.
But DXC, which is what TuxBox uses to compile the DirectX shaders, is what's stalling and causing extremely long compile times.
I'm gonna push a change to help increase the compilation time, but I also want to hear people's ideas on how we can increase the speed even further.
If it means a home grown system, so be it.
Right now TuxBox compiles shaders in this order:
Raw RDNA2 (provided by the game) -> HLSL (this is fast) -> DXIL (this is the slow DXC step) -> SPIR-V (linux only for VKD3D) -> GPU Driver
What would be more ideal is either
Raw RDNA2 -> DXIL -> Driver (Windows)
Raw RDNA2 -> SPIR-V -> Driver (Linux)
or
Raw RDNA2 -> HLSL -> DXIL -> Driver (Windows)
Raw RDNA2 -> HLSL -> SPIR-V -> Driver (Linux)
If someone could throw some tokens to get some ideas on the way forward, I'd like to know.
The long times seem to affect only compute shaders going through DXC.
So I propose that we maybe have a specific pipeline for compute shaders first.
Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-27T02:59:54Z.
I'll take this on. Some context from what I measured for #229: on the host, DXC is 97.5% of CPU, and the slowest 10% of requests take 76% of that, mostly in LLVM Jump Threading. The 30-minute cold run itself looked limited by the driver stage (638 large compute pipelines through 4 slots), but that is inferred from one log on driver 595, so the first job is a per-stage baseline on 620.
I'm running these in parallel, compute first, and will post numbers here:
For 4 and 5: xshader has no IR between the decoder and the HLSL text, so I'll size both honestly before building anything past a spike.
Anything that overlaps the change you're pushing, tell me and I'll drop it.
Imported from brcly/TuxBox. Originally posted by akimfomin on 2026-11-27T02:59:55Z.
For the DXC question, Xbox2Windows already publishes a title-free compiler control. PortBridge measured 1.294 s median on its 2,048-branch sampling variant, with the compiler revision and the other variants recorded. It is a pixel-shader calibration and TuxBox's compute bottleneck remains an open question. Pinned generator · Archived method and results
When your next compute change is ready, would you nominate one generated shader or public test PR for a second timing through PortBridge? A volunteer can report DXC wall time separately from native pipeline creation and return the compiler version, revision and aggregates here.
Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-27T03:16:54Z.
Before committing to anything, I'm going to simplify the computer shaders where possible.
If I manage a break through, I'll update
Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-27T03:27:40Z.
Per-stage baseline, CPU only, at
9168b2fwith DXC 1.8.2505.1 and the dxil-spirv commit GE-Proton11-14 ships (34f0ff84, built standalone). Sample: 400 randomcs_6_6, 150cs_6_0, 100 of each other target, from the recorded ProjectScarlett requests, run through the same flag policy ascompile_dxil. The GPU driver compile is not in here.Mean CPU seconds per program (measured):
xshader is under 1% everywhere. So offline, DXC is the cost, as you suspected.
For
cs_6_6the cost is broad, not a few outliers (measured). This corrects what I said above from the earlier mixed sample: the slowest 10% take 33% of DXC time, and 40% of the programs cost over 10 s each (p50 2.1 s, p90 20 s, max 91 s). The programs with 1 to 4 MiB of HLSL carry 89% of it, and DXC's cost per byte is about nine times higher there than for small programs. DXC time tracks the block count of the output (r = 0.95) more closely than HLSL size (r = 0.85).Scaled to all 24,800 translated programs (inferred from the sample): about 47,000 core-seconds of DXC, of which
cs_6_6is 22,500 (95% interval 19,900 to 25,100),ms_6_613,200 andps_6_610,600; dxil-spirv is about 3,400.Two side findings (measured):
cs_6_6programs that fell back to-O0then took 17 s and 68 s in dxil-spirv (57k and 78k blocks), against a p99 of 2.9 s for-O1output.-O0path.One early result from the home-grown DXIL test that bears on your simplification (measured, synthetic programs): dxil-spirv time grows faster than quadratically with basic blocks. For 16,000 masked register writes, DXC
-O1output had 4,000 blocks and took 1.2 s in dxil-spirv; the same writes expressed as selects were one block and took 0.23 s. I'm now testing whether emitting pure register writes as selects in the HLSL gives the same gain through DXC.Flags, HLSL shapes and the two home-grown routes are still running.
Imported from brcly/TuxBox. Originally posted by gtb-sbe on 2026-11-27T03:28:08Z.
@NickStallman A data point from AMD, and from after the startup phase, in case it helps with 1 and 2. It's one run, so the numbers are samples, not a baseline.
Setup: RX 9060 XT (RADV GFX1200, Mesa 26.2.6), Ryzen 7 5800X (16 threads), 31 GB, GE-Proton11-14, ProjectScarlett 1.0.2.1 offline at 3840x2160, #258
d50a51con12e4b06, no preload, Linux DXC 1.10.2605.37. The translator had changed since the previous run, so every request was translated live; nothing was prepared.Startup (first ~8 min): about 9,000 requests the title had already made in earlier runs, at about 1,100 per minute. All 150 compute
CreatePipelineState ... finished inlines (5-9 s) are from these minutes.After the Account Picker (~65 min, loading at 3 draws per frame): about 5,900 requests no earlier run had reached, at 60-400 per minute, usually 100-150. The slow pipelines in this phase are all mesh + pixel (84 lines, mean 6.3 s, max 8 s); no compute.
Two 60 s samples of the live worker in that phase (
psevery 0.5 s, so durations are lower bounds). The worker had 8 slots (up to 8 concurrent requests) and was never full.ms_6_630 (mean >= 3.0 s, max >= 11 s);ps_6_6 -disable-lifetime-markers59 (mean >= 1.8 s, max >= 4.5 s)ms_6_631 (mean >= 1.0 s, max >= 3.0 s); pixel 8What I read from it:
ms_6_6goes through DXC at default optimisation. It gets neither the-disable-lifetime-markersvariant (dispatched programs and pixel programs of 256 KiB or more) nor the compute flags. Whether changing that would cost dxil-spirv or the driver more is open. Your item 2 would answer it.Not measured: driver time separately from DXC, and the time from the title's call to the finished pipeline.
Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-27T04:19:13Z.
Results on what in the emitted compute HLSL costs DXC, since that's what you're working on.
cs_6_6, DXC 1.8.2505.1,-O1 -disable-lifetime-markers, CPU time; dxil-spirv is the GE-Proton11-14 commit built standalone. The machine was shared, so repeat runs vary by up to 1.6x: read these as ratios. Rewrites were scripted on real recorded programs and all outputs pass DXV, but nothing here was run on a GPU, and driver compile time is not measured.1.
?:is a branch, not a select (measured). DXC defaults to HLSL 2021, where?:,&&and||on scalars short-circuit, and-O1doesn't fold them back.select(c, a, b)gives a real DXILselect. Turningif (m) v = e;intov = m ? e : v;is worse than theif(2.6x the blocks).-HV 2018alone gave −15 to −22% DXC time and −9 to −17% blocks on five programs, but is only safe if no emitted?:/&&/||relies on short-circuiting, which I haven't audited.2. Pure masked register writes as
select()(measured, six of the slowest programs). Only side-effect-free right-hand sides were rewritten; loads, stores, wave ops and atomics stayed under branches.select()select()+-HV 2018select()+-HV 2018select()+-HV 2018Across the six: blocks −35 to −68%, dxil-spirv −40 to −88%, DXC −38% to +15%. One program with 95 loops got slower in DXC (51 → 104 s, all in InstCombine); I don't know why yet.
[flatten]on the same ifs changes nothing.3. Small
[noinline]functions cut DXC time 6–10x (measured, three programs). Registers asstatic uintglobals, each dispatcher block or guard body as a[noinline] void f():select()select()This is the largest effect, and the least proven: the DXIL is 33–80% larger because registers become memory, and the driver then has to inline and promote them, so driver time and runtime speed could get worse. Function size matters (32,000 synthetic instructions: 3.8 s in 400 functions, 54.5 s in 8). Without
[noinline]DXC inlines everything and nothing changes.[noinline]with aninoutstruct fails validation in a compute target. Compiling as libraries and linking gave no gain.4. A scoped temporary across a guard is super-quadratic (measured on synthetic; inferred for the real programs).
{ uint r = v; if (m) r = e; v = r; }, which the paired-wave64 form emits tens of thousands of times in the 8 MB programs, costs 33.7 s in Dxil Conditional Mem2Reg at 16,000 writes against 2.2 s for writing the register directly.5. Loops that carry skip flags scale worst (measured, synthetic). 8,000 instructions and 400 flags: 6.4 s with no loops, 20.7 s with 40, 77.6 s with 100 (loop canonicalisation).
No effect: comments and text volume (the front end is 1–4%), nesting depth, scalars versus an array for registers,
[flatten].||in place of|in guards costs 30–45%, as you already found.Overall DXC time goes as instructions^1.46 on 300 random programs, and no single text feature predicts it better than size, so keeping functions and straight-line runs small is what helps.
Home-grown routes, short version (details to follow):
wave64-shaderscenario on AMD. The cost is the translator behind it, estimated at 20,000 to 28,000 lines for compute, because the lowering is tied to HLSL text.dxc -spirv: not viable. It was 4x slower than DXC + dxil-spirv on compute and segfaulted on 59 of 150 programs, including all the large ones.VKD3D_SHADER_OVERRIDEaccepts our SPIR-V with no Proton patch (shown for one compute shader on RADV), but it's a debug feature, needs vkd3d-proton's private binding layout, and loses[WaveSize]. It only removes dxil-spirv, which is 7% of the CPU.The synthetic generator has no game content; I can put it in a PR or gist if it's useful. @gtb-sbe: the per-target flag table for
ms_6_6andps_6_6, with the dxil-spirv cost, is still running.Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-27T07:03:58Z.
@gtb-sbe: the per-target flag table. Short version:
ms_6_6should get-disable-lifetime-markerstoo;ps_6_6is already covered by the existing rule.Measured, CPU seconds summed over the sample, one core per job, DXC 1.8.2505.1, dxil-spirv at the GE-Proton11-14 commit built standalone. The machine was shared, so sums carry noise; the first three rows of each table were run interleaved per program. ">15 s" counts programs over the production DXC limit, which fall back to
-O0today.ms_6_6, random 100 (none of these get the flag today)-disable-lifetime-markers-O1 -disable-lifetime-markers-O0ms_6_6, largest 40 by HLSL size (none get the flag today)-disable-lifetime-markers-O1 -disable-lifetime-markers-O0-O0compile, then about 7x the dxil-spirv time (231.9 s against about 30 s for these 40). That fallback is the expensive part, and the flag avoids it.ms_6_6, Jump Threading is 72% of default DXC time. With the flag the pass is not scheduled at all (-Odump), and Dxil Conditional Mem2Reg becomes the largest at 30%.ps_6_6-disable-lifetime-markers-O1 -disable-lifetime-markers-disable-lifetime-markers-O1 -disable-lifetime-markersps_6_6would be a small gain.-O1on top of the flag: nothing forms_6_6, about −10% DXC forps_6_6, same blocks and dxil-spirv time. An earlier, non-interleaved run showed a bigger-O1gain that did not reproduce, so I'm treating it as load noise.All outputs pass DXV in every variant. That is not proof they render the same: the flag changes the DXIL of every affected mesh shader, so it needs GPU checks on AMD and NVIDIA, which I have not run. Your run used DXC 1.10.2605.37; these numbers are from 1.8.2505.1 and I have not compared the two.
The
cs_6_6optimisation-level and pass-ablation runs are still going.Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-27T08:03:43Z.
The DXC flag and pass run for
cs_6_6finished. One flag is worth a look:-fnew-inlining-behavioron top of the current-O1 -disable-lifetime-markerscutcs_6_6DXC CPU by about a third.Measured, CPU time, DXC 1.8.2505.1, dxil-spirv at the GE-Proton11-14 commit built standalone, shared machine; ratios come from runs that interleave the variants per program.
-fnew-inlining-behavior, ratio to the flags used todaycs_6_6random 150cs_6_630 slowestps_6_6random 100 / largest 40ms_6_6random 100 / largest 40 (with the lifetime flag)Where DXC spends
cs_6_6time under today's flags (30 slowest of 206)cs_6_6, 72% onms_6_6and 89% on slowps_6_6.-disable-lifetime-markerstakes the pass out of the pipeline (-Odumpno longer lists-sroa -simplify-inst -jump-threading).-O0is not a fast path forcs_6_6: 1.15x the DXC CPU of today's flags, 3.6x the blocks, 8x the dxil-spirv CPU.-O1,-O2and-O3are within noise, with identical block counts.cs_6_6:-opt-disable gvn(same DXC, 1.16x dxil-spirv),-Gfp(1.10x DXC, 2.05x dxil-spirv),-Gis,-res-may-alias,-Gfa -all-resources-bound,-Vd.-opt-disableaccepts any name silently and only five names change the pipeline.What the optimiser is needed for (36
cs_6_6programs, stocklibdxcompiler.sodriven with edited-Odumppass lists; DXC not rebuilt)simplifycfgaccounts for the whole-O0to-O1block drop. Without the early instances, blocks go back to 3.6x and dxil-spirv to 8.3x. GVN, instcombine, SROA, SCCP, DCE and reassociate each move blocks by 5% or less.mem2regbefore inlining, the HLSL lowering passes, thengvn,loop-rotate,simplifycfg) took 0.24x the optimiser CPU with 1.05x blocks and 0.96x dxil-spirv CPU; 36 of 36 pass DXV. That is the ceiling for flag work: it needs the API, not the command line.loop-rotate, the standalone converter segfaults on 12 of 36 programs whose DXIL passes DXV. The smallest has 781 blocks, and a 4 GB stack does not help. I have not checked whether the vkd3d-proton build in the game does the same.Summary of flag changes the numbers support
ms_6_6-disable-lifetime-markers-O0fallbackcs_6_6-fnew-inlining-behaviorps_6_6vs_6_6Not done:
-fnew-inlining-behavioroncs_6_0andvs_6_6, driver compile time, and any GPU check. If you want any of these as a PR with AMD and NVIDIA runs, say which.Imported from brcly/TuxBox. Originally posted by gtb-sbe on 2026-11-27T12:15:57Z.
@NickStallman Thanks, that explains the live numbers. After the picker the slowest jobs were
ms_6_6at default optimisation, and your largest-40 table shows why: 28 programs go over the 15 s limit, then-O0and about 7x the dxil-spirv time.Two things from this side:
compile_dxilat95480b5, the-disable-lifetime-markerscandidate is not part ofVARIANTS(dxil_store.py), so extending the rule toms_6_6would not start a new runtime cache. Mesh DXIL already cached stays as it is; only new compiles take the flag.python tuxbox.py check, then ProjectScarlett from a cold cache through the post-picker loading, sampled the same way as above, against the current rule. I have DXC 1.10.2605.37 installed, so it would also show whether the flag behaves the same on that version.Is someone already opening the PR?
Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-29T21:58:26Z.
Status, since compile time and shader size are the current focus.
Landed: lifetime markers off for every profile;
-fnew-inlining-behavior; structured control flow (#489, about −25% DXC on a sample); the slow-shader retry for every profile; the loop watchdog counted inside the body (−3.6% DXC on the slowest programs); #520, which removed the local arrays that put 21 KB a lane into the BVH walks (DXIL −7% on those).Measured (DXC 1.9, recorded ProjectScarlett requests): about 2.7 CPU-hours of DXC for 34.7k requests, extrapolated from a 600-request sample. The slowest 5% of programs take half the time, and they're all large compute programs (13k–18k instructions). The HLSL is already close to one or two lines per instruction; the remaining DXC flag changes are worth 5–6% at most, and identical translations are already compiled once.
Next: fewer compiles, by recording pipelines and replaying them in preparation (#497), and driver time, which follows DXIL size.
One warning for anyone changing code generation: #523's output crashes DXC 1.9 with
-fnew-inlining-behavioron about half the programs, so check new HLSL forms with the runtime's flags, not only DXC's defaults.Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-29T23:33:46Z.
A data point on the replay of recorded pipelines (#497), since it's part of the plan here. On an RTX 5090 (620.70.10, GE-Proton11-14, Linux, 32 threads), ProjectScarlett, a build on
007b982dwith our PRs:pso_replay_guest.cppdoes that on one thread. It ran at 98% of one core; after 10 minutes the driver cache had 258 MB, and I stopped it. A warm driver cache for this game is about 3.9 GB here, so I'd guess hours, but I didn't let it finish.TUXBOX_PIPELINE_RECIPESfolder skips it.Two questions: should records be capped or aged across runs as well as within one (the cap is per run), and could the replay use more than one thread? I haven't tried either. Most people won't collect records as fast as my tests do.
Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-30T11:37:33Z.
@NickStallman, answers to both questions:
TUXBOX_REPLAY_THREADSdefaults to half the cores (2 to 8), and the overall limit is now 4 h (TUXBOX_REPLAY_TIMEOUT). @NathansDomainSolutions measured a full replay of 23,142 records at about 18 min on 8 threads.A related finding: #585 found that records made under a reflected table root kept the title's root, so about 73% of graphics records failed to replay. Its fix is waiting on a measured receipt.
Imported from brcly/TuxBox. Originally posted by gtb-sbe on 2026-11-30T19:09:04Z.
@brcly I looked into why the pipeline replay in preparation warmed nothing on my RX 9060 XT (RADV, GE-Proton11-14,
main8345699c). I used a local patch that logs each record's HRESULT. The prep's receipt wasrecords=27237 compute=2590 graphics=5244 failed=19403, and replaying the same records on their own gives the same numbers, record for record.Cannot load existing on-disk cache due to driver version mismatch) and compiled 631 programs cold, although their DXIL hadn't changed since my earlier runs. 607 of them (93 % of the ~12,100 s) had a record that the replay builds fine. The stamp fromf7afdd16wouldn't catch this: the old entries stay on disk, so the cache never shrinks. Putting the Vulkan driver's version or pipeline-cache UUID into the stamp would..csothe launch used. With a fresh Mesa cache, the replay's environment (noforce_raw_va_cbv) and the launch's (with it) hit the same driver entries, 6 of 6.dxil-spirv: Failed to remap CBV 1:n(one atSRV 1:n). The rebuilds fell back to "as recorded" because xshader refuses the pixel stage against the title's root:root table slot at 0x.. conflicts with the pixel stage physical binding, 18,483 of 18,501. @NathansDomainSolutions, it's the same signature as yours. On RADV no single one of them is slow, though: only one raster pipeline took over 5 s in that run (shorter creates aren't logged, so I don't have their total).fb8e97e0among them), and they fail onFailed to remap SRV 900:norSRV 901:0. Indevice/compute_scene.rs,SceneRoot.serializedis set tobase.bytes.clone()(still the case onbbc26254). That is the root before the scene SRVs (space 900) and the BVH bindings (space 901) are appended, butnativeis created from the newly serialized blob. None of the 2,646 recorded compute roots has a space-900/901 parameter. Storingbytesthere should fix it, but I haven't tested that with a recording run. 19 of these programs took 483 s to compile in my run.pci=0000:0000(also still onbbc26254): the guest asks the D3D12 device forIDXGIDevice, which only D3D11 devices implement, so the adapter description stays zeroed. Withdevice->GetAdapterLuid()andIDXGIFactory4::EnumAdapterByLuid, I getpci=1002:7590(AMD Radeon RX 9060 XT). So the right card was used all along.If it helps, I can produce #585's end-to-end receipt on this card: a recording run with the branch, then preparation. You're welcome to take the two small fixes (scene root bytes, adapter lookup) directly, or I can open a PR for them, whichever you prefer.
Imported from brcly/TuxBox. Originally posted by JeffreyBytes on 2026-12-01T00:15:12Z.
I had a go at the DXC time that's left, mostly the large compute programs. The DXC helper (
tools/dxc_worker.cpp) already runs DXC's optimizer through the API with the-Odumppass list, so it can replace the general optimizer (the passes after-dxil-fix-array-initthrough-alignment-from-assumptions) with a shorter list. That isn't limited by what the command line can switch off. The HLSL lowering before that range and the DXIL finalization after it stay as DXC arranges them, and-O0and the other profiles are untouched.For
cs_6_6with the runtime flags (-O1 -disable-lifetime-markers -fnew-inlining-behavior) the list is:ps_6_6,ms_6_6andcs_6_0are compiled at DXC's default level and get the same pass list from-Odump, so they share a second list: DXC's own inline threshold, an-instcombinebefore-gvn,-dxil-gvn-hoist -dxil-gvn-eliminate-region,-loop-unrolland a last-instcombine. Without those, pixel shaders came out about 2% bigger, mostly int/float bitcast pairs that stock's extra instcombines fold.Per program, DXC 1.9.2609.5, recorded ProjectScarlett programs, ratio to the current helper:
cs_6_6ps_6_6ms_6_6cs_6_0The slowest
cs_6_6program (1.39 MB of HLSL, registers kept in auint tb_v[256]array) went from 37.6 s to 7.8 s. Most of its optimizer time was InstCombine on that array before GVN, which is why the compute list runs-instcombineonly once, after-gvn. The six largestcs_6_0programs (6.8 to 8 MB of HLSL) went from 83-176 s to 46-73 s each; they're still over the 15 s limit, so they still end up in the slow-shader pass, just shorter. The lists keep a late-loop-rotate, since Nick found dxil-spirv crashing without one. All outputs pass DXV.On a whole prep it's less, because the pass waits on the big compute programs at the start. A cold
--prepare-onlyof my full cache (36,712 recorded requests) on8345699c, before #593, took the DXC pass from 3,700 s to 2,626 s with thecs_6_6,ps_6_6andms_6_6lists, and the helper's CPU time from 51,737 s to 30,543 s, with the same programs compiled and none failed. The pixel and mesh list mostly saves CPU there, not wall time, since those compiles already ran alongside the compute ones.On current main (
82109205, with #593), with all four lists, a random 4,000 of the recorded requests,TUXBOX_SCARLETT_SEED_PACK=0, no replay, default jobs (15 here), only the helper different:Both compiled 3,856, 144 unsupported, 0 failed, and no helper output was rejected. The rest of the gap after the DXC pass is the slow-shader pass, where the
cs_6_0list helps. That's recorded requests only: since82109205a default prep also compiles the 6,841 pack programs no run has recorded, so a full prep on main has more DXC work for the lists to cut. I haven't timed that one.On the GPU,
tools/execute_recorded_shaders.py(RX 6700 XT, RADV, seed 293) compared the outputs with the current helper's.cs_6_6, 300 sampled: 77 ran on both sides, 73 equivalent, 3 unstable on the baseline itself, 1 changed.cs_6_0, all 495 requests: 475 ran, 470 equivalent, 2 unstable, 3 changed, 0 lost. Three of the four changed programs use atomics and write the same values in a different order (one is an append buffer whose writes are clamped to its last slot, so the last thread to write wins). The fourth,aeb9a6c6, has 256 floats that differ by 1 or 2 ULP: its ops carryfast, and stock folds1.0 - xand power-of-two constant multiplies differently, which is allowed under fast math either way. That harness only runs programs up to 4 MB of HLSL, so the largest ones aren't in it.For pixel and mesh output I ran the game on
34be158(with #389) and both lists, GE-Proton11-15: it reached the world, no GPU faults, 0 failed pipelines, and the cutscene looks and runs the same as it does without the change (still not right, but no different).The DXV rejections in these preps (13 to 14 per run, plus some timeouts) were the FP64 programs from #592, the same on main, and #593 has fixed those since.
If this is worth having I can open a PR with the helper change and its tests on current main. The compute list could also go in on its own first.
Imported from brcly/TuxBox. Originally posted by brcly on 2026-12-01T15:13:53Z.
@JeffreyBytes yes, this is worth having, thank you. Halving DXC CPU time on
cs_6_6with the same blocks, instructions and DXIL, outputs that pass DXV, and GPU outputs checked against the current helper is the kind of evidence we need. Please open the PR, the compute list first on its own as you suggest, then the pixel/mesh list.One thing changed since your measurements: #523 (merged today as
61a64d31) rewrites a lot of the generated HLSL (selectinstead of?:, constant 64-bit shifts, power-of-two structured strides). Please re-time on current main, since the passes see different input now. The atomics andfastULP differences you describe are fine to call out in the PR as they are.Imported from brcly/TuxBox. Originally posted by 1093i3511 on 2026-12-01T17:20:36Z.
A data point for compile time, after
e40d8052, from an 8 GB RX 6600 with a 6-core/12-thread CPU, DXC 1.9.2609 (the helper path), Series S prepare of all 25,889 pack programs:717a74c4(this morning)fb17e160Almost all the extra time is at the start. Progress every 5 minutes:
The pipeline replay at the end shows the merges paying off:
717a74c4fb17e160driver_ms(summed over 6 threads)The driver time includes the ~900 extra graphics pipelines and a RADV cache that was cold for the new translation, so I would not read it as a slowdown by itself.
So the first ~4,000 programs became much more expensive to compile, and the rest compile at about this morning's rate or faster. The translator changes between the two are #522, #523, #555 and #558, plus #613-#616; I have not bisected which one makes the early programs slower.
Imported from brcly/TuxBox. Originally posted by JeffreyBytes on 2026-12-01T21:24:09Z.
@1093i3511 thanks for the numbers. I tried to reproduce the prepare slowdown and couldn't. What I measured is per-program DXC cost, not a whole prepare on your pack, so this doesn't prove your 2.65x is something else, but it points away from the translator changes.
Measured: the 4,000 largest recorded requests from my archive, translated at
717a74c4,fb17e160and9a19c767, a random sample of them compiled with the stock helper and the runtime flags, 8 jobs, both sides interleaved, same machine. DXC CPU,fb17e160against717a74c4:717a74c4fb17e160cs_6_6ps_6_6ms_6_6No compile failed and every output passed DXV. The 30 programs with the largest ratio on the first pass were mostly noise (8 jobs on a hybrid CPU): re-timed they came out around 1.0. So there is nothing to bisect between #522, #523, #555, #558 and #613-#616 per program. I also checked
9a19c767: 3,831 of the 3,840 translatable programs have byte-identical HLSL tofb17e160, so it behaves the same.Inferred, not measured on your machine: your prepare at
717a74c4probably reused DXIL that an earlier prepare had stored. Every one of the 4,000 largest requests translates to different HLSL atfb17e160(measured), so none of those can be reused. #535 also changedtools/dxc_worker.cpp, and the helper digest is part of the DXIL store identity, sofb17e160starts a new store anyway.717a74c4translates those 4,000 identically tob3873ec4, and the helper source is unchanged since 11-29, so a prepare from any recent main before that would have let717a74c4skip most of them. For scale, I estimate about 23,500 helper CPU-seconds to compile the first 4,000 from scratch. That doesn't fit in 1,694.8 s on 12 threads (about 20,300 CPU-s at best), but it does fit your 60 minutes for roughly 3,800 programs. The slow shaders going from 9 to 20 fits too, if the slow-shader marks live in that store. In my sample the number of programs over the 15 s limit is the same on both sides.Could you check the log from the
717a74c4prepare for the line "ProjectScarlett DXIL reused for N of the compiled shaders"? If N is in the thousands, that's it. If it's near 0 and the prepare still took 1,694.8 s, I'm wrong and I'd like to know.Measured, and small: #523 (
61a64d31) does add a little. On dd7c730f, acs_6_6program, DXC takes 5.1 s before and 5.4 s after (GVN 0.23 s to 0.51 s, instcombine 1.18 s to 1.38 s in-ftime-report), and 8af81503 went from 5.12 s to 5.40 s in the bisect, though not in a later re-run (5.15 s). That's a few percent on a couple of programs, not a 2.65x. I haven't isolated which of #523's HLSL forms does it. The shortercs_6_6pass list from the PR pays the same: +7% on dd7c730f, with 3.55 s going to 3.78 s, so it doesn't avoid that increase.The 12 failures I can't place. None of my compiles failed, and your comment doesn't say which programs or which stage. If you have the log lines for them, could you tell me which ones?
The
cs_6_6PR is here: https://github.com/brcly/TuxBox/pull/638Imported from brcly/TuxBox. Originally posted by 1093i3511 on 2026-12-01T22:24:19Z.
@JeffreyBytes thank you, and sorry: that was my oversight. I compared the two prepares without the DXIL reuse line, and it explains the whole difference:
717a74c4fb17e160About 2.8x the DXC work for 2.65x the time, so the cost per program didn't change, as you measured. The slow start of my rate curve was only the order: the programs that needed DXC came first, the reused ones later. Please disregard the "first ~4,000 programs became more expensive" reading in my comment.
Imported from brcly/TuxBox. Originally posted by JeffreyBytes on 2026-12-02T22:31:16Z.
The pixel/mesh list changes (already built just rebase and tests) is queued behind some other testing. Should be a PR by tonight.