← all workloads

generic_nesting

One generic struct instantiated with itself n levels deep: a chain of `typealias T_i = Pair<Leaf, T_{i-1}>` where `Pair` is constrained to an interface that extends another. Every other generic workload in the suite scales BREADTH (many shallow instantiations); this one scales DEPTH, the axis on which the front-end's substitution / inheritance-witness work is known to multiply per level. The shape arises in real code that composes generic "model"/"module" types recursively (e.g. chained ML evaluator stacks), where each wrapper layer adds one level of nesting. Scaling null: each level adds O(1) declarations, so ideal front-end cost is O(n). Measured behavior when this was added (2026-07): substitution work grows ~3-4x PER LEVEL (exponential), with the wall-clock knee near depth 18 — v2025.14 through tip-of-tree all take ~17-20 s at depth 24. The sweep ladder deliberately stays at or below the knee; the finding to watch is the top rung's multiple of the linear expectation moving.

bucket: sema  ·  mode: module  ·  flags: (none)

Phase composition vs N (stacked sub-counters)

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.

generic_nesting — phase composition vs N (v2026.12, median ms) generic_nesting 450.6× over N 8→20 0.0 844 1689 8 12 16 20 N generic_nesting — parseTranslationUnit generic_nesting — SemanticChecking generic_nesting — generateIR generic_nesting — frontEndExecute (self) generic_nesting — generateOutput (self) generic_nesting — compileInner (self) phase buckets parseTranslationUnit SemanticChecking generateIR frontEndExecute (self) specializeModule simplifyIR linkIR unrollLoopsInModule legalizeResourceTypes legalizeExistentialTypeLayout performMandatoryEarlyInlining performForceInlining linkAndOptimizeIR (self) emitEntryPointsSourceFromIR generateOutput (self) compileInner (self)

Scaling analysis

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 rangefloor (ms)k (work)fit R²t(Nmin)t(Nmax)top-2×
8–201412.941.0003156415.64×

Growth attribution (N=8 → N=20)

compileInner grows by 1560 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.

buckett@N=8t@N=20Δ msshare× lin∝Nk
generateIR21561+1560100%182.30×8.85

Near-constant (≤2% of growth each): generateOutput (self) (1→1 ms), SemanticChecking (1→1 ms), parseTranslationUnit (0→0 ms), frontEndExecute (self) (0→0 ms), compileInner (self) (0→0 ms).

Sweep numbers (median ms)

NcompileInnerSemanticCheckingfrontEndExecute
8313
12918
16100199
20156411563