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 | 14 | 1.85 | 0.994 | 55 | 1939 | 4.37× |
compileInner grows by 1884 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 |
|---|---|---|---|---|---|---|
| specializeModule | 11 | 525 | +514 | 27% | 4.51× | 1.91 |
| unrollLoopsInModule | 7 | 473 | +465 | 25% | 4.96× | 1.99 |
| generateOutput (self) | 7 | 257 | +250 | 13% | 4.69× | 1.90 |
| simplifyIR | 8 | 236 | +228 | 12% | 3.23× | 1.69 |
| legalizeExistentialTypeLayout | 3 | 218 | +214 | 11% | 5.27× | 2.01 |
Also growing (below top-5): legalizeResourceTypes (+212 ms, 11%).
Near-constant (≤2% of growth each): SemanticChecking (10→10 ms), generateIR (3→4 ms), linkIR (1→1 ms), performForceInlining (0→0 ms), frontEndExecute (self) (0→0 ms), compileInner (self) (0→0 ms), parseTranslationUnit (0→0 ms), performMandatoryEarlyInlining (0→0 ms).
| N | compileInner | unrollLoopsInModule | simplifyIR |
|---|---|---|---|
| 75 | 55 | 8 | 8 |
| 150 | 131 | 32 | 24 |
| 300 | 443 | 121 | 80 |
| 600 | 1939 | 601 | 300 |