Issue Description
Since the auto-diff refactor (the overhaul between releases 2026.5 and 2026.7), every compile
pays an inflated linkIR / linkAndOptimizeIR cost — even an empty shader that never
differentiates. The IR linker now deep-clones the differentiable-interface witness tables and their
annotations into every program, then carries that dead auto-diff IR through specialization /
simplify / DCE before eliminating it. This is a per-compile floor: it affects all targets and all
shaders, independent of auto-diff use.
Reproducer Code
An empty / minimal shader (the compile-perf minimal workload):
RWStructuredBuffer<float> outBuf;
[shader("compute")]
[numthreads(1, 1, 1)]
void computeMain()
{
outBuf[0] = 1.0;
}
Command:
slangc minimal.slang -target spirv -emit-spirv-directly -report-perf-benchmark
Expected Behavior
A non-differentiating program should not link auto-diff witness tables / annotations; linkIR and
linkAndOptimizeIR should be near the pre-refactor (release 2026.5) baseline.
Actual Behavior
linkIR rose ~10–13×, and linkAndOptimizeIR similarly: the minimal linkAndOptimizeIR is
~15 ms versus a pre-refactor baseline of ~1.9 ms.
Test Plan
tools/compile-perf per-compile-floor workloads (e.g. minimal); the linkIR /
linkAndOptimizeIR timers, compared against the pre-refactor baseline.
Fixed by #11779. Companion codegen-side half (simplifyIR): #11780. Related broad
perf-regression tracking: #11474.
Issue Description
Since the auto-diff refactor (the overhaul between releases 2026.5 and 2026.7), every compile
pays an inflated
linkIR/linkAndOptimizeIRcost — even an empty shader that neverdifferentiates. The IR linker now deep-clones the differentiable-interface witness tables and their
annotations into every program, then carries that dead auto-diff IR through specialization /
simplify / DCE before eliminating it. This is a per-compile floor: it affects all targets and all
shaders, independent of auto-diff use.
Reproducer Code
An empty / minimal shader (the compile-perf
minimalworkload):Command:
Expected Behavior
A non-differentiating program should not link auto-diff witness tables / annotations;
linkIRandlinkAndOptimizeIRshould be near the pre-refactor (release 2026.5) baseline.Actual Behavior
linkIRrose ~10–13×, andlinkAndOptimizeIRsimilarly: theminimallinkAndOptimizeIRis~15 ms versus a pre-refactor baseline of ~1.9 ms.
Test Plan
tools/compile-perfper-compile-floor workloads (e.g.minimal); thelinkIR/linkAndOptimizeIRtimers, compared against the pre-refactor baseline.Fixed by #11779. Companion codegen-side half (
simplifyIR): #11780. Related broadperf-regression tracking: #11474.