One interface, n implementations, called through an existential whose concrete type is chosen at runtime (defeats static specialization, forcing witness-table dynamic dispatch). Stresses dispatch lowering / specializeModule. Scaling null: n scales implementations and switch cases; generated code is O(n), so ideal cost is O(n).
bucket: dynamic_dispatch · 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× |
|---|---|---|---|---|---|---|
| 50–400 | 9 | 1.07 | 0.982 | 60 | 485 | 2.56× |
compileInner grows by 425 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=50 | t@N=400 | Δ ms | share | × lin | ∝Nk |
|---|---|---|---|---|---|---|
| simplifyIR | 8 | 208 | +200 | 47% | 2.78× | 1.56 |
| generateOutput (self) | 10 | 62 | +52 | 12% | 1.13× | 0.99 |
| specializeModule | 4 | 54 | +50 | 12% | 1.65× | 1.27 |
| linkAndOptimizeIR (self) | 5 | 54 | +48 | 11% | 1.29× | 1.14 |
| SemanticChecking | 25 | 53 | +29 | 7% | 0.47× | 0.42 |
Also growing (below top-5): legalizeExistentialTypeLayout (+17 ms, 4%), generateIR (+12 ms, 3%), legalizeResourceTypes (+10 ms, 2%).
Near-constant (≤2% of growth each): linkIR (1→4 ms), parseTranslationUnit (1→3 ms), performForceInlining (0→1 ms), performMandatoryEarlyInlining (0→1 ms), compileInner (self) (0→1 ms), unrollLoopsInModule (0→1 ms), frontEndExecute (self) (0→0 ms).
| N | compileInner | specializeModule | linkIR | linkAndOptimizeIR |
|---|---|---|---|---|
| 50 | 60 | 4 | 1 | 21 |
| 100 | 95 | 8 | 2 | 45 |
| 200 | 189 | 20 | 2 | 114 |
| 400 | 485 | 54 | 4 | 351 |