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 | 14 | 1.45 | 0.994 | 61 | 985 | 3.16× |
compileInner grows by 923 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 | 15 | 612 | +597 | 65% | 3.64× | 1.81 |
| simplifyIR | 8 | 170 | +161 | 17% | 2.25× | 1.46 |
| linkAndOptimizeIR (self) | 6 | 65 | +59 | 6% | 1.49× | 1.21 |
| generateOutput (self) | 9 | 62 | +53 | 6% | 1.18× | 1.07 |
| SemanticChecking | 14 | 34 | +21 | 2% | 0.68× | 0.64 |
Near-constant (≤2% of growth each): generateIR (5→19 ms), legalizeExistentialTypeLayout (1→8 ms), legalizeResourceTypes (1→5 ms), linkIR (1→4 ms), parseTranslationUnit (1→3 ms), performForceInlining (0→1 ms), performMandatoryEarlyInlining (0→1 ms), frontEndExecute (self) (0→1 ms), unrollLoopsInModule (0→0 ms), compileInner (self) (0→0 ms).
| N | compileInner | specializeModule | linkIR | linkAndOptimizeIR |
|---|---|---|---|---|
| 50 | 61 | 15 | 1 | 33 |
| 100 | 124 | 46 | 2 | 83 |
| 200 | 311 | 164 | 2 | 249 |
| 400 | 985 | 612 | 4 | 866 |