You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Declaration bundling peaks at ~9 GB on the ontology integration branch #653
The tsup declaration bundle (dts: true in packages/typegraph/tsup.config.ts) now peaks at about 9.3 GB of resident memory in the DTS worker, measured with /usr/bin/time -l node --max-old-space-size=12288 node_modules/tsup/dist/cli-default.js on the integration branch that combines the ontology and semantics program (acyclic relations, composition, typed subsumption, identity transition log, meta-edge removal). On main the same build fits under 6 GB. The largest emitted chunk grew only from 392 KB to 432 KB over the same span, so output size does not explain a ~50% jump in bundling memory.
The CI ceiling has been raised twice to keep the build running (#643 to 8 GB, #652 to 12 GB). Public runners have 16 GB, so there is one more bump left before the build stops fitting at all.
Suspects
Deeply nested conditional/mapped types on the public query surface (the polymorphic supertype default and includeNarrower, parts() / wholes() return-type generics) expanding during declaration rollup.
One dts rollup for every entrypoint re-traversing the same backend and store type graph; per-entrypoint memory is not freed between rollups inside one worker.
Options to evaluate
experimentalDts: true (TypeScript's own declaration emit plus a lighter rollup) and compare peak RSS.
Emitting declarations once and rolling entrypoints from that emit rather than from source per entrypoint.
Measuring which entrypoint's rollup drives the peak (--dts-only per entry) and whether one type family dominates.
The 12 GB ceiling is a stopgap; the fix is to bring the bundle back under the previous ceiling.
Activity
build: bring the declaration bundle back under the 8 GB ceiling (#679)
pdlug commentedon Sep 11, 2026
Fixed on the integration branch for #637 (no release carried the defect); closing now rather than waiting for the merge to main.
build: bring the declaration bundle back under the 8 GB ceiling (#679)