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 | 11 | 0.96 | 0.996 | 49 | 294 | 2.06× |
compileInner grows by 244 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 | 75 | +68 | 28% | 1.43× | 1.16 |
| generateOutput (self) | 9 | 54 | +45 | 18% | 1.07× | 1.00 |
| simplifyIR | 6 | 49 | +43 | 17% | 1.01× | 0.99 |
| linkAndOptimizeIR (self) | 6 | 42 | +36 | 15% | 1.01× | 0.99 |
| SemanticChecking | 13 | 34 | +21 | 9% | 0.69× | 0.66 |
Also growing (below top-5): generateIR (+13 ms, 5%), legalizeExistentialTypeLayout (+5 ms, 2%).
Near-constant (≤2% of growth each): legalizeResourceTypes (0→4 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 | 79 | 13 | 1 | 41 |
| 200 | 142 | 29 | 2 | 82 |
| 400 | 294 | 75 | 3 | 184 |