From 3b7f33c22393afe56700a48feebc4a091a975840 Mon Sep 17 00:00:00 2001 From: Chris Tate Date: Wed, 21 Oct 2026 20:35:09 -0500 Subject: [PATCH] Leave SC6101 out of the native compiler's self-builds The compiler's own source has 24 likely-hot functions that use untyped values, so its self-builds now print SC6101. The native bootstrap contracts compare stderr exactly; the rebuilds of the compiler entry pass --no-dynamic-tier-warning, which changes no IR or LLVM output. --- .../self-hosting-native-driver.test.ts | 31 +++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/tests/harness/self-hosting-native-driver.test.ts b/tests/harness/self-hosting-native-driver.test.ts index 722c3fede..1cc920bd2 100644 --- a/tests/harness/self-hosting-native-driver.test.ts +++ b/tests/harness/self-hosting-native-driver.test.ts @@ -185,6 +185,10 @@ test( return result.stdout; }; const entry = join(root, "packages/compiler/src/native/cli.ts"); + // The compiler's own source has untyped functions that SC6101 reports + // (diagnostics/dynamic-tier.ts). The contracts compare stderr exactly, + // so its self-builds leave that performance note out. + const quiet = "--no-dynamic-tier-warning"; const ffi = join(directory, ".scriptc/distribution-seed/compiler.ffi.json"); const rebuilt = executable("scriptc-rebuilt"); const checkProgram = async (compiler: string, source: string, extra: string[] = []) => { @@ -541,7 +545,18 @@ test( const self = await bootstrapStep("production CLI rebuilds itself", () => invoke( seed, - ["build", entry, "-o", rebuilt, "--strip", "--keep-llvm", "--emit-ir", "--ffi", ffi], + [ + "build", + entry, + "-o", + rebuilt, + "--strip", + "--keep-llvm", + "--emit-ir", + "--ffi", + ffi, + quiet, + ], "scriptc: warning: --emit-ir is deprecated; use --emit=ir for IR as the primary output\n", ), ); @@ -554,7 +569,16 @@ test( const seedLlvm = join(directory, "cli.ll"); const rebuiltLlvm = join(directory, "rebuilt.ll"); await bootstrapStep("rebuilt compiler emits itself", () => - invoke(rebuilt, ["build", entry, "--emit=llvm", "-o", rebuiltLlvm, "--ffi", ffi]), + invoke(rebuilt, [ + "build", + entry, + "--emit=llvm", + "-o", + rebuiltLlvm, + "--ffi", + ffi, + quiet, + ]), ); // Executable output adds a runtime ABI check; textual LLVM emission // omits it. Compare all other output without changing either mode. @@ -585,7 +609,7 @@ test( const rebuildFrontend = async () => { const lowered = join(directory, "cli.ir.json"); const output = await bootstrapStep("sanitized native frontend lowers the compiler", () => - invoke(seed, ["build", entry, "--emit=ir", "-o", lowered, "--ffi", ffi]), + invoke(seed, ["build", entry, "--emit=ir", "-o", lowered, "--ffi", ffi, quiet]), ); expect(output.trim()).toBe(lowered); await compareArtifacts({ ir: true, llvm: false }); @@ -605,6 +629,7 @@ test( ffi, "--sanitize", "--optimization=dev", + quiet, ], "", { SCRIPTC_BOOTSTRAP_IR_INPUT: seedIr },