From afe372da5b2c8fffe83b454ef23313ac12edc67a Mon Sep 17 00:00:00 2001 From: Malte Ubl Date: Thu, 15 Oct 2026 06:12:23 -0700 Subject: [PATCH] Pin the localized checksum in module byte-loop emission Every write of the module-level checksum in module-byte-loops.ts is a proven uint32, so its initializer now keeps it in an i32 local instead of a double global with an integer view. The emission test now pins the local and the absence of double loads; state keeps its integer view. --- packages/compiler/test/byte-number-emission.test.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/compiler/test/byte-number-emission.test.ts b/packages/compiler/test/byte-number-emission.test.ts index ea1cf1b29..c5f302cd5 100644 --- a/packages/compiler/test/byte-number-emission.test.ts +++ b/packages/compiler/test/byte-number-emission.test.ts @@ -66,7 +66,11 @@ test("module-private numeric proofs retain global ownership and exclude shared b const mod = deserializeModule(await readFile(outPath, "utf8")); for (const pointerBits of [32, 64] as const) { const ll = emitLlvmModule(mod, { pointerBits, wasi: pointerBits === 32 }); - expect(ll).toContain("integer view checksum"); + // Every write of checksum is a proven uint32, so the initializer keeps it + // in an i32 local of its own instead of a double global with a view. + expect(ll).toMatch(/%sc_l_\w*checksum = alloca i32 ; checksum/); + expect(ll).not.toContain("integer view checksum"); + expect(ll).not.toMatch(/load double, ptr @sc_g_\w*checksum/); expect(ll).toContain("integer view state"); expect(ll).toContain("integer induction offset"); expect(ll).not.toContain("integer view sharedNumber");