A generic struct over a type parameter, instantiated at n distinct wrapper types. Forces specializeModule to clone the generic n ways. Scaling null: n scales instantiations of O(1) bodies; ideal specialization cost is O(n).
bucket: specialization · 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.44 | 0.995 | 47 | 661 | 2.99× |
compileInner grows by 615 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 |
|---|---|---|---|---|---|---|
| simplifyIR | 7 | 130 | +123 | 20% | 2.07× | 1.43 |
| generateOutput (self) | 7 | 124 | +116 | 19% | 2.41× | 1.50 |
| legalizeExistentialTypeLayout | 2 | 101 | +99 | 16% | 5.26× | 2.02 |
| legalizeResourceTypes | 1 | 98 | +96 | 16% | 5.90× | 2.12 |
| linkAndOptimizeIR (self) | 6 | 90 | +84 | 14% | 2.23× | 1.46 |
Also growing (below top-5): specializeModule (+36 ms, 6%), SemanticChecking (+25 ms, 4%), generateIR (+21 ms, 3%).
Near-constant (≤2% of growth each): linkIR (1→5 ms), performMandatoryEarlyInlining (0→5 ms), parseTranslationUnit (1→3 ms), performForceInlining (0→1 ms), unrollLoopsInModule (0→0 ms), frontEndExecute (self) (0→0 ms), compileInner (self) (0→0 ms).
| N | compileInner | specializeModule | linkAndOptimizeIR |
|---|---|---|---|
| 75 | 47 | 7 | 24 |
| 150 | 89 | 11 | 52 |
| 300 | 221 | 22 | 148 |
| 600 | 661 | 42 | 473 |