A force-unrolled loop of `n` iterations. Stresses loop unrolling (unrollLoopsInModule) and the downstream SSA simplify on the unrolled body. Scaling null: the unrolled output is O(n), so ideal cost is linear in n (linear in output size).
bucket: loop_unroll · 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× |
|---|---|---|---|---|---|---|
| 75–600 | 9 | 1.72 | 0.990 | 63 | 1917 | 4.20× |
compileInner grows by 1855 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=75 | t@N=600 | Δ ms | share | × lin | ∝Nk |
|---|---|---|---|---|---|---|
| unrollLoopsInModule | 10 | 713 | +702 | 38% | 5.21× | 2.04 |
| generateOutput (self) | 7 | 264 | +257 | 14% | 4.74× | 1.90 |
| legalizeExistentialTypeLayout | 4 | 258 | +254 | 14% | 5.27× | 2.04 |
| legalizeResourceTypes | 4 | 256 | +252 | 14% | 5.20× | 2.04 |
| specializeModule | 5 | 243 | +238 | 13% | 4.03× | 1.89 |
Also growing (below top-5): simplifyIR (+137 ms, 7%).
Near-constant (≤2% of growth each): SemanticChecking (20→20 ms), linkAndOptimizeIR (self) (3→17 ms), generateIR (2→2 ms), linkIR (1→1 ms), performForceInlining (0→1 ms), frontEndExecute (self) (0→0 ms), performMandatoryEarlyInlining (0→0 ms), parseTranslationUnit (0→0 ms), compileInner (self) (1→0 ms).
| N | compileInner | unrollLoopsInModule | simplifyIR |
|---|---|---|---|
| 75 | 63 | 10 | 6 |
| 150 | 144 | 38 | 15 |
| 300 | 456 | 155 | 44 |
| 600 | 1917 | 713 | 143 |