mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-01 07:33:12 +08:00
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.
This commit is contained in:
@@ -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 \}/,
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user