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 | 11 | 1.19 | 0.997 | 39 | 344 | 2.40× |
compileInner grows by 305 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 |
|---|---|---|---|---|---|---|
| legalizeExistentialTypeLayout | 1 | 88 | +87 | 29% | 5.72× | 2.06 |
| generateOutput (self) | 6 | 59 | +53 | 17% | 1.48× | 1.24 |
| specializeModule | 6 | 45 | +39 | 13% | 1.01× | 1.01 |
| linkAndOptimizeIR (self) | 5 | 37 | +32 | 11% | 1.08× | 1.07 |
| simplifyIR | 4 | 33 | +30 | 10% | 1.14× | 1.07 |
Also growing (below top-5): SemanticChecking (+25 ms, 8%), generateIR (+21 ms, 7%).
Near-constant (≤2% of growth each): performMandatoryEarlyInlining (0→5 ms), linkIR (1→5 ms), legalizeResourceTypes (0→4 ms), parseTranslationUnit (1→3 ms), performForceInlining (0→1 ms), frontEndExecute (self) (1→1 ms), unrollLoopsInModule (0→1 ms), compileInner (self) (0→0 ms).
| N | compileInner | specializeModule | linkAndOptimizeIR |
|---|---|---|---|
| 75 | 39 | 6 | 17 |
| 150 | 69 | 11 | 35 |
| 300 | 143 | 22 | 84 |
| 600 | 344 | 45 | 220 |