From 54aba6a60658d518594e2817076dfd4d6d75b746 Mon Sep 17 00:00:00 2001 From: Malte Ubl Date: Tue, 27 Oct 2026 13:27:37 -0700 Subject: [PATCH] Build the scr_map semantics test at -O0 The scr_map unit test compiles 23 runtime translation units with ASan/UBSan, and that build is essentially the whole test: 90s of clang against a 2.1s binary run. scr_hash.c alone takes 29s at -O1 because the sanitizer instruments its unrolled digest rounds; scr_json.c and scr_lib.c add 28s more. The test then normally ran within 20s of its 120s timeout, and whenever a lane shared the box it repeatedly timed out in both the plain and sanitized lanes. The link set cannot shrink: scr_map.c's dyn ops need scr_dyn_* from scr_json.c, scr_lib.c supplies the remaining date/math/number/perf symbols, and scr_lib.c needs scr_hash.c. The test asserts Map semantics under sanitizers, not codegen, and its cost checks are relative bounds, so build it at -O0: every assertion and sanitizer check still runs and the build drops to about 15s. Eight concurrent copies now take 20-22s each instead of 90s, with the timeout unchanged. Co-Authored-By: Claude Opus 5.5 --- packages/runtime/src/scr_map.test.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/runtime/src/scr_map.test.ts b/packages/runtime/src/scr_map.test.ts index b567884fca..035b3a0eba 100644 --- a/packages/runtime/src/scr_map.test.ts +++ b/packages/runtime/src/scr_map.test.ts @@ -14,7 +14,14 @@ test("number-key maps keep Map semantics across linear, direct and hashed indexe try { await exec("clang", [ "-std=c11", - "-O1", + // The runtime link set includes scr_json.c, scr_lib.c and scr_hash.c. + // With ASan/UBSan their optimized builds dominate the test's cost: -O1 + // takes about 90s (scr_hash.c alone 29s, its unrolled digest rounds + // instrumented) and regularly starved past this test's timeout when the + // lane shared the box. The test checks Map semantics under sanitizers, + // not codegen, so -O0 keeps every assertion and sanitizer check and + // builds in about 15s. + "-O0", "-Wall", "-Wextra", "-fsanitize=address,undefined",