From e58def02992880a3a2ee971bd507a42d59a4a9a3 Mon Sep 17 00:00:00 2001 From: Chris Tate Date: Mon, 26 Oct 2026 21:04:31 -0500 Subject: [PATCH] Update tests for the record-ops store hook and the untyped-writes benchmark - forin-keys.test.ts matches the record-ops table with its eighth field, the store hook, which is null for a record no untyped code writes. - bench/record-untyped-writes writes typed records through `unknown` and `Object.assign` views, so it links dynamic-tier symbols; DYNAMIC_WORKLOADS lists it. - The sanitized self-hosting emission test gets a 600 s timeout. It takes about half of the default 300 s on an idle 16-core host, with or without these changes, and exceeded the default on a loaded CI shard. --- packages/compiler/test/forin-keys.test.ts | 2 +- scripts/zero-cost-compare.mjs | 5 ++++- tests/harness/self-hosting-emission.test.ts | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/compiler/test/forin-keys.test.ts b/packages/compiler/test/forin-keys.test.ts index b35ff2154..4a8d24c7e 100644 --- a/packages/compiler/test/forin-keys.test.ts +++ b/packages/compiler/test/forin-keys.test.ts @@ -36,7 +36,7 @@ console.log(count(row), count(JSON.parse('{"b":1}'))); expect(llvm).not.toContain("@scr_dyn_for_in_keys("); // Fully required record shapes are marked fixed for the stable walk. expect(llvm).toMatch( - /_rops = internal global \{ i64, ptr, ptr, ptr, i8, ptr, ptr \} \{[^}]*i8 1, ptr null, ptr null \}/, + /_rops = internal global \{ i64, ptr, ptr, ptr, i8, ptr, ptr, ptr \} \{[^}]*i8 1, ptr null, ptr null, ptr null \}/, ); }); diff --git a/scripts/zero-cost-compare.mjs b/scripts/zero-cost-compare.mjs index df407bbb7..b412fa72a 100644 --- a/scripts/zero-cost-compare.mjs +++ b/scripts/zero-cost-compare.mjs @@ -401,7 +401,9 @@ export function dynamicTierSymbols(names) { * bench/dynamic-properties are untyped JavaScript. bench/regex-replacers, * also added later, passes checked-dynamic values to replace callbacks * whose parameters the lib types `any`: captures a match can leave unset - * and results the checker types `any`. Every other bench workload is fully typed and must link none. The gate and + * and results the checker types `any`. bench/record-untyped-writes, also + * added later, writes typed records through `unknown` and `Object.assign` + * views. Every other bench workload is fully typed and must link none. The gate and * tests/harness/bench-dynamic-tier.test.ts enforce that, and the test also * fails when a listed workload stops linking them, so remove a workload here * when a leak fix makes its binary clean. */ @@ -425,6 +427,7 @@ export const DYNAMIC_WORKLOADS = new Set([ "bench/json-unions", "bench/throw-chains", "bench/regex-replacers", + "bench/record-untyped-writes", ]); /** Names of the functions (text and weak symbols) in `nm` output. Mach-O diff --git a/tests/harness/self-hosting-emission.test.ts b/tests/harness/self-hosting-emission.test.ts index 3977ede29..6d27b7851 100644 --- a/tests/harness/self-hosting-emission.test.ts +++ b/tests/harness/self-hosting-emission.test.ts @@ -59,6 +59,8 @@ test("the production layout and metadata stage lowers statically", async () => { }); for (const backend of ["llvm"] as const) { + // A sanitized build of the fixture and its emission cases take about half + // the default 300 s budget on an idle 16-core host. test(`native LLVM layout and metadata emission (${backend})`, async () => { const dir = mkdtempSync( join(process.platform === "win32" ? tmpdir() : "/tmp", "scriptc-native-emission-"), @@ -268,5 +270,5 @@ for (const backend of ["llvm"] as const) { } finally { rmSync(dir, { recursive: true, force: true }); } - }); + }, 600_000); }