← all workloads

existential_aggregate

An interface-typed *field* inside a struct (`Scene { IMat m; ... }`), with n implementations selected at runtime through a switch. Unlike `dynamic_dispatch` (a bare local existential), boxing the existential in an aggregate forces `legalizeExistentialTypeLayout` to float the existential field out and recompute the parent layout, and feeds specializeModule a witness-table-per-case blowup. Stresses specializeModule + legalizeExistentialTypeLayout + the downstream simplifyIR. Scales by breadth (number of implementations / switch cases). Scaling null: n scales cases, each an O(1) body; ideal specialization cost is O(n).

bucket: dynamic_dispatch  ·  mode: target  ·  flags: -target spirv -emit-spirv-directly

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.

existential_aggregate — phase composition vs N (v2026.13.1, median ms) existential_aggregate 8.7× over N 50→400 0.0 252 503 50 100 200 400 N existential_aggregate — parseTranslationUnit existential_aggregate — SemanticChecking existential_aggregate — generateIR existential_aggregate — frontEndExecute (self) existential_aggregate — specializeModule existential_aggregate — simplifyIR existential_aggregate — linkIR existential_aggregate — unrollLoopsInModule existential_aggregate — legalizeResourceTypes existential_aggregate — legalizeExistentialTypeLayout existential_aggregate — performMandatoryEarlyInlining existential_aggregate — performForceInlining existential_aggregate — linkAndOptimizeIR (self) existential_aggregate — generateOutput (self) existential_aggregate — 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×
50–400111.130.992544662.46×

Growth attribution (N=50 → N=400)

compileInner grows by 412 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=50t@N=400Δ msshare× lin∝Nk
specializeModule9221+21151%2.64×1.54
generateOutput (self)958+4912%1.09×1.03
simplifyIR755+4812%1.06×1.00
linkAndOptimizeIR (self)645+399%1.04×1.01
generateIR631+256%1.01×0.90

Also growing (below top-5): SemanticChecking (+22 ms, 5%).

Near-constant (≤2% of growth each): legalizeExistentialTypeLayout (1→6 ms), legalizeResourceTypes (0→4 ms), linkIR (1→4 ms), parseTranslationUnit (1→3 ms), performMandatoryEarlyInlining (0→2 ms), unrollLoopsInModule (0→1 ms), performForceInlining (0→1 ms), frontEndExecute (self) (0→1 ms), compileInner (self) (0→0 ms).

Sweep numbers (median ms)

NcompileInnerspecializeModulelegalizeExistentialTypeLayoutsimplifyIR
5054917
1009122213
20018965326
400466221655