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 | 10 | 0.99 | 0.995 | 49 | 320 | 2.15× |
compileInner grows by 270 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 |
|---|---|---|---|---|---|---|
| specializeModule | 7 | 76 | +69 | 25% | 1.45× | 1.18 |
| simplifyIR | 6 | 68 | +62 | 23% | 1.34× | 1.15 |
| generateOutput (self) | 8 | 54 | +46 | 17% | 1.06× | 1.01 |
| linkAndOptimizeIR (self) | 6 | 46 | +40 | 15% | 1.08× | 1.02 |
| SemanticChecking | 13 | 34 | +21 | 8% | 0.68× | 0.66 |
Also growing (below top-5): generateIR (+14 ms, 5%), legalizeExistentialTypeLayout (+7 ms, 2%).
Near-constant (≤2% of growth each): legalizeResourceTypes (1→5 ms), linkIR (1→3 ms), parseTranslationUnit (1→3 ms), performMandatoryEarlyInlining (0→2 ms), unrollLoopsInModule (0→1 ms), performForceInlining (0→1 ms), frontEndExecute (self) (0→0 ms), compileInner (self) (0→0 ms).
| N | compileInner | specializeModule | linkIR | linkAndOptimizeIR |
|---|---|---|---|---|
| 50 | 49 | 7 | 1 | 22 |
| 100 | 80 | 13 | 1 | 42 |
| 200 | 149 | 30 | 2 | 89 |
| 400 | 320 | 76 | 3 | 210 |