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_source · mode: target · flags: -target glsl -entry computeMain
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.93 | 0.995 | 70 | 3318 | 4.76× |
compileInner grows by 3248 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 |
|---|---|---|---|---|---|---|
| emitEntryPointsSourceFromIR | 26 | 1623 | +1597 | 49% | 5.18× | 1.99 |
| legalizeExistentialTypeLayout | 7 | 637 | +630 | 19% | 6.17× | 2.16 |
| legalizeResourceTypes | 7 | 594 | +587 | 18% | 5.97× | 2.13 |
| simplifyIR | 6 | 264 | +259 | 8% | 4.38× | 1.86 |
| specializeModule | 3 | 75 | +71 | 2% | 2.61× | 1.49 |
Near-constant (≤2% of growth each): SemanticChecking (15→68 ms), generateIR (5→51 ms), parseTranslationUnit (0→2 ms), linkIR (1→2 ms), compileInner (self) (0→2 ms), performMandatoryEarlyInlining (0→1 ms), performForceInlining (0→0 ms), frontEndExecute (self) (0→0 ms), unrollLoopsInModule (0→0 ms).
| N | compileInner | emitEntryPointsSourceFromIR | generateOutput |
|---|---|---|---|
| 100 | 70 | 49 | 49 |
| 200 | 196 | 166 | 166 |
| 400 | 697 | 642 | 643 |
| 800 | 3318 | 3194 | 3195 |