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 <noreply@anthropic.com>
This commit is contained in:
Malte Ubl
2026-10-27 15:26:28 -07:00
co-authored by Claude Opus 5.5
parent 6e5f21c580
commit 54aba6a606
+8 -1
View File
@@ -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",