A single moderately complex shader. Compiled to multiple targets by the harness (same source, varying -target) to isolate generateOutput cost. ``n`` scales the amount of straight-line math the backend must emit. Scaling null: n scales op count and the emitted output is O(n); ideal codegen cost is O(n).
bucket: codegen · mode: target · flags: -target spirv -emit-spirv-directly
compileInner split into phase buckets (named leaves + (self) residuals) stacked across the sweep sizes — the top edge is compileInner, so you can see which phase drives the scaling.
floor-subtracted power-law fit (t − floor) = a·Nk; floor = the minimal workload (fixed per-compile cost), k the global exponent, top-2× the local high-end doubling ratio.
| N range | floor (ms) | k (work) | fit R² | t(Nmin) | t(Nmax) | top-2× |
|---|---|---|---|---|---|---|
| 100–800 | 10 | 1.89 | 0.997 | 85 | 3768 | 4.24× |
compileInner grows by 3683 ms across the sweep; the mutually-exclusive phase buckets below partition that growth exactly (no nested-timer double counting). × lin is the same metric as the top-level panels, per bucket: the end point vs a linear expectation anchored to the bucket's share of the minimal floor and fitted on the low-N half — 1.0 = grew exactly linearly, >1 bends up. The super-linearity lives where × lin (and k) are red.
| bucket | t@N=100 | t@N=800 | Δ ms | share | × lin | ∝Nk |
|---|---|---|---|---|---|---|
| generateOutput (self) | 16 | 923 | +906 | 25% | 4.95× | 2.01 |
| legalizeExistentialTypeLayout | 11 | 861 | +850 | 23% | 5.45× | 2.11 |
| legalizeResourceTypes | 11 | 854 | +843 | 23% | 5.46× | 2.10 |
| linkAndOptimizeIR (self) | 9 | 556 | +547 | 15% | 5.23× | 2.01 |
| simplifyIR | 8 | 348 | +340 | 9% | 3.89× | 1.82 |
Also growing (below top-5): specializeModule (+106 ms, 3%).
Near-constant (≤2% of growth each): SemanticChecking (15→61 ms), generateIR (6→47 ms), linkIR (1→3 ms), parseTranslationUnit (0→2 ms), performForceInlining (0→1 ms), performMandatoryEarlyInlining (0→1 ms), frontEndExecute (self) (0→0 ms), compileInner (self) (0→0 ms), unrollLoopsInModule (0→0 ms).
| N | compileInner | generateOutput |
|---|---|---|
| 100 | 85 | 62 |
| 200 | 242 | 207 |
| 400 | 888 | 835 |
| 800 | 3768 | 3658 |