diff --git a/config/scale/feature-shape-ceilings.json b/config/scale/feature-shape-ceilings.json index 8c2ed540..da9131cf 100644 --- a/config/scale/feature-shape-ceilings.json +++ b/config/scale/feature-shape-ceilings.json @@ -9,7 +9,7 @@ "axes": [ { "axis": "Typecheck of one app", - "verified": "Linear, about 115k instantiations and 37 MB of tsc memory per feature, up to 100 features", + "verified": "Linear, about 117k instantiations and 36 MB of tsc memory per feature, up to 100 features", "condition": "Reference-shaped features, tsconfig.app.json, the host recorded in the baseline", "notVerified": "200 features (one full context) and beyond; 4,000 (20 x 200) would need on the order of 150 GB by the same slope" }, @@ -21,13 +21,13 @@ }, { "axis": "Initial JavaScript", - "verified": "15-01: only each feature's declaration (route table, messages, invalidation identities) loads at boot; its runtime half loads with its routes. Measured with scripts/scale/measure-feature-shape-growth.ts measureInitialJavascriptGzipBytes: 202,361 B with no copy, +741 B for the first copy, +648 B for the second, 205,629 B with five (before 15-01: +3,922 B per copy). tests/unit/feature-shape-growth.test.ts keeps one copy at or under 1 KiB", + "verified": "15-01: only each feature's declaration (route table, messages, invalidation identities) loads at boot; its runtime half loads with its routes. Baseline: 202,509 B with no copy, about 610 B and no extra file per copy (218,010 B at 25, 263,119 B at 100; before 15-01: +3,922 B per copy). tests/unit/feature-shape-growth.test.ts keeps one copy at or under 1 KiB", "condition": "Same; the feature-declarations and feature-platform chunk groups in vite.config.ts", - "notVerified": "The initial budget (204,800 B, config/performance/budgets.json) still fits only about three more reference-shaped features: the platform itself is 98.8% of it. The committed baseline (feature-shape-growth.json) predates 15-01" + "notVerified": "The initial budget (204,800 B, config/performance/budgets.json) leaves 2,291 B over the baseline's 202,509 B, so about three more reference-shaped features fit at about 610 B each: the platform itself is 98.9% of it" }, { "axis": "Lazy JavaScript", - "verified": "About 6.8 KB gzip and six files per feature, every file far below the 120 KiB lazy-chunk budget", + "verified": "About 8.3 KB gzip and eight files per feature, every file far below the 120 KiB lazy-chunk budget", "condition": "Same", "notVerified": "Download cost of many lazy files" }, diff --git a/config/scale/feature-shape-growth.json b/config/scale/feature-shape-growth.json index 2a28b36e..8dd2fc12 100644 --- a/config/scale/feature-shape-growth.json +++ b/config/scale/feature-shape-growth.json @@ -1,17 +1,24 @@ { "schemaVersion": 1, - "measuredAt": "2026-09-27T04:03:00.821Z", + "measuredAt": "2026-11-01T13:47:49.428Z", "command": "node scripts/scale/measure-feature-shape-growth.ts --sizes=0,25,100 --repeats=2", "environment": { "node": "24.14.0", "platform": "linux", "arch": "x64", - "cpuModel": "Intel(R) Core(TM) i5-10400F CPU @ 2.90GHz", - "logicalCpus": 12, - "availableParallelism": 12, + "cpuModel": "Intel(R) Core(TM) Ultra 7 155H", + "logicalCpus": 22, + "availableParallelism": 22, "typescript": "Version 7.0.2", "vite": "vite/8.1.5 linux-x64 node-v24.14.0" }, + "source": { + "commit": "2be973a13416b834e6690928e72433c0b3061105", + "modifiedPaths": [ + "scripts/scale/measure-feature-shape-growth.ts", + "tests/unit/feature-shape-growth.test.ts" + ] + }, "sourceFeature": "src/features/reference-feature", "runs": [ { @@ -21,29 +28,29 @@ "tsc": { "passed": true, "firstError": null, - "files": 840, - "types": 284678, - "symbols": 802946, - "instantiations": 712089, - "memoryKb": 520454, - "wallMs": 3408 + "files": 843, + "types": 287932, + "symbols": 805529, + "instantiations": 720060, + "memoryKb": 523871, + "wallMs": 2025 }, "build": { - "wallMs": 1208, - "initialJavascriptFiles": 13, - "initialJavascriptGzipBytes": 200001, - "lazyJavascriptFiles": 14, - "lazyJavascriptGzipBytes": 24938 + "wallMs": 440, + "initialJavascriptFiles": 16, + "initialJavascriptGzipBytes": 202509, + "lazyJavascriptFiles": 17, + "lazyJavascriptGzipBytes": 28204 }, "loadBefore": [ - 25.05, - 16.88, - 7.75 + 28.38, + 18.41, + 14.76 ], "loadAfter": [ - 26.4, - 17.3, - 7.93 + 26.67, + 18.22, + 14.72 ] }, { @@ -53,29 +60,29 @@ "tsc": { "passed": true, "firstError": null, - "files": 840, - "types": 284678, - "symbols": 802946, - "instantiations": 712089, - "memoryKb": 520395, - "wallMs": 3930 + "files": 843, + "types": 287932, + "symbols": 805529, + "instantiations": 720060, + "memoryKb": 524012, + "wallMs": 1056 }, "build": { - "wallMs": 1526, - "initialJavascriptFiles": 13, - "initialJavascriptGzipBytes": 200001, - "lazyJavascriptFiles": 14, - "lazyJavascriptGzipBytes": 24938 + "wallMs": 425, + "initialJavascriptFiles": 16, + "initialJavascriptGzipBytes": 202509, + "lazyJavascriptFiles": 17, + "lazyJavascriptGzipBytes": 28204 }, "loadBefore": [ - 26.4, - 17.3, - 7.93 + 26.67, + 18.22, + 14.72 ], "loadAfter": [ - 27.65, - 17.71, - 8.12 + 26.67, + 18.22, + 14.72 ] }, { @@ -85,29 +92,29 @@ "tsc": { "passed": true, "firstError": null, - "files": 1366, - "types": 1055723, - "symbols": 2831441, - "instantiations": 3579093, - "memoryKb": 1422337, - "wallMs": 8121 + "files": 1394, + "types": 1061481, + "symbols": 2870282, + "instantiations": 3646451, + "memoryKb": 1431472, + "wallMs": 4271 }, "build": { - "wallMs": 1676, - "initialJavascriptFiles": 39, - "initialJavascriptGzipBytes": 274493, - "lazyJavascriptFiles": 165, - "lazyJavascriptGzipBytes": 171638 + "wallMs": 1451, + "initialJavascriptFiles": 16, + "initialJavascriptGzipBytes": 218010, + "lazyJavascriptFiles": 218, + "lazyJavascriptGzipBytes": 235404 }, "loadBefore": [ - 27.65, - 17.71, - 8.12 + 26.67, + 18.22, + 14.72 ], "loadAfter": [ - 27.17, - 17.93, - 8.29 + 28.86, + 18.82, + 14.93 ] }, { @@ -117,29 +124,29 @@ "tsc": { "passed": true, "firstError": null, - "files": 1366, - "types": 1055723, - "symbols": 2831441, - "instantiations": 3579093, - "memoryKb": 1422431, - "wallMs": 8714 + "files": 1394, + "types": 1061481, + "symbols": 2870282, + "instantiations": 3646451, + "memoryKb": 1431193, + "wallMs": 6960 }, "build": { - "wallMs": 2140, - "initialJavascriptFiles": 39, - "initialJavascriptGzipBytes": 274493, - "lazyJavascriptFiles": 165, - "lazyJavascriptGzipBytes": 171638 + "wallMs": 1722, + "initialJavascriptFiles": 16, + "initialJavascriptGzipBytes": 218010, + "lazyJavascriptFiles": 218, + "lazyJavascriptGzipBytes": 235404 }, "loadBefore": [ - 27.17, - 17.93, - 8.29 + 28.86, + 18.82, + 14.93 ], "loadAfter": [ - 27.55, - 18.46, - 8.62 + 29.79, + 19.35, + 15.15 ] }, { @@ -149,29 +156,29 @@ "tsc": { "passed": true, "firstError": null, - "files": 2941, - "types": 3349868, - "symbols": 8940533, - "instantiations": 12157304, - "memoryKb": 4195900, - "wallMs": 31315 + "files": 3044, + "types": 3366002, + "symbols": 9084067, + "instantiations": 12399171, + "memoryKb": 4224229, + "wallMs": 11353 }, "build": { - "wallMs": 6010, - "initialJavascriptFiles": 114, - "initialJavascriptGzipBytes": 490658, - "lazyJavascriptFiles": 615, - "lazyJavascriptGzipBytes": 704938 + "wallMs": 878, + "initialJavascriptFiles": 16, + "initialJavascriptGzipBytes": 263119, + "lazyJavascriptFiles": 818, + "lazyJavascriptGzipBytes": 857445 }, "loadBefore": [ - 27.43, - 18.59, - 8.71 + 29.4, + 19.44, + 15.2 ], "loadAfter": [ - 29.72, - 20.12, - 9.64 + 26.66, + 19.18, + 15.16 ] }, { @@ -181,29 +188,29 @@ "tsc": { "passed": true, "firstError": null, - "files": 2941, - "types": 3349868, - "symbols": 8940533, - "instantiations": 12157304, - "memoryKb": 4195704, - "wallMs": 43234 + "files": 3044, + "types": 3366002, + "symbols": 9084067, + "instantiations": 12399171, + "memoryKb": 4224168, + "wallMs": 13664 }, "build": { - "wallMs": 3702, - "initialJavascriptFiles": 114, - "initialJavascriptGzipBytes": 490658, - "lazyJavascriptFiles": 615, - "lazyJavascriptGzipBytes": 704938 + "wallMs": 2302, + "initialJavascriptFiles": 16, + "initialJavascriptGzipBytes": 263119, + "lazyJavascriptFiles": 818, + "lazyJavascriptGzipBytes": 857445 }, "loadBefore": [ - 29.72, - 20.12, - 9.64 + 26.66, + 19.18, + 15.16 ], "loadAfter": [ - 35.75, - 22.97, - 11.09 + 23.48, + 18.92, + 15.16 ] } ] diff --git a/scripts/scale/measure-feature-shape-growth.ts b/scripts/scale/measure-feature-shape-growth.ts index 98dc3ede..d1ec0aa7 100644 --- a/scripts/scale/measure-feature-shape-growth.ts +++ b/scripts/scale/measure-feature-shape-growth.ts @@ -216,6 +216,28 @@ async function measureOnce(root: string, features: number) { }; } +/** + * 11-05 (2026-09-29). The commit the run measured, so a later run can be + * compared with the same code and a reader can tell whether the baseline + * still describes the tree. Tracked files that differed from that commit are + * listed; an empty list means the commit alone reproduces the run. + */ +function sourceRevision(): Readonly<{ commit: string; modifiedPaths: string[] }> { + const git = (...args: string[]) => spawnSync("git", args, { encoding: "utf8" }); + const head = git("rev-parse", "HEAD"); + const status = git("status", "--porcelain", "--untracked-files=no"); + if (head.status !== 0 || status.status !== 0) { + throw new Error("feature-shape growth: cannot read the source commit (git rev-parse HEAD, git status)"); + } + return { + commit: head.stdout.trim(), + modifiedPaths: status.stdout + .split("\n") + .filter(Boolean) + .map((line) => line.slice(3)), + }; +} + function version(bin: string): string { const result = spawnSync(path.resolve("node_modules/.bin", bin), ["--version"], { encoding: "utf8" }); return (result.stdout ?? "").trim(); @@ -229,6 +251,8 @@ async function main(): Promise { if (!sizes.every((size) => Number.isSafeInteger(size) && size >= 0) || !(repeats >= 1)) { throw new TypeError("--sizes must be nonnegative integers and --repeats at least 1"); } + // Read before measuring: the run takes minutes and the tree may move. + const source = sourceRevision(); const runs = []; for (const features of sizes) { const root = await createFixture(features); @@ -266,6 +290,7 @@ async function main(): Promise { typescript: version("tsc"), vite: version("vite"), }, + source, sourceFeature: SOURCE_FEATURE, runs, }; diff --git a/tests/unit/feature-shape-growth.test.ts b/tests/unit/feature-shape-growth.test.ts index 45e0a97f..cbf0fe20 100644 --- a/tests/unit/feature-shape-growth.test.ts +++ b/tests/unit/feature-shape-growth.test.ts @@ -67,12 +67,19 @@ describe("feature-shape growth measurement (11-04)", () => { await readFile(FEATURE_SHAPE_BASELINE_PATH, "utf8"), ) as Readonly<{ environment: Readonly>; + source: unknown; runs: readonly Run[]; }>; expect(baseline.environment).toMatchObject({ cpuModel: expect.any(String), logicalCpus: expect.any(Number), }); + // 11-05 (2026-09-29). Without the commit it measured, nobody can tell + // whether the baseline still describes the code or compare a new run. + expect(baseline.source).toEqual({ + commit: expect.stringMatching(/^[0-9a-f]{40}$/u), + modifiedPaths: expect.any(Array), + }); const bySize = (size: number) => baseline.runs.filter((run) => run.addedFeatures === size);