From 890508e0f4610648eefbaf9079734d174f6b8298 Mon Sep 17 00:00:00 2001 From: Dmitrii Vasilev Date: Sun, 18 Oct 2026 02:11:55 +0700 Subject: [PATCH] t27b: emit_kit test reads only bytes it wrote (Refs #9994) bytes_and_numbers_are_written_where_asked wrote its second number at out[3 .. 13] of an undefined buffer, then asked holds(out, 13, ...), which scans from out[0]: out[1] and out[2] were never written. t27b's JIT read whatever was there and passed; its interpreter refused the read (Fault "1-byte read at stack+0x1 of bytes never written"), so t27b-native-ratchet called the spec a JIT/interpreter mismatch against a ledger row that says pass. The number is now written at out[1], right after the first one, so every byte holds scans was written first. Measured on the Railway lab, t27b cross-built for aarch64 and run under qemu: `t27b test emit_kit.t27 --check` on master gives the mismatch and exit 4; with this change 4 passed, 0 mismatches, 17 runtime asserts, matching t27c test-report (5/1/2/9). ts_emit 4/4 and verilog_emit 8/8 pass the same check. Seal resaved. Co-Authored-By: Claude Opus 5.5 --- .trinity/seals/t27b_T27bEmitKit.json | 10 +++++----- specs/tri/t27b/emit_kit.t27 | 5 +++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.trinity/seals/t27b_T27bEmitKit.json b/.trinity/seals/t27b_T27bEmitKit.json index 97c18377d9..23bc0d0497 100644 --- a/.trinity/seals/t27b_T27bEmitKit.json +++ b/.trinity/seals/t27b_T27bEmitKit.json @@ -1,5 +1,5 @@ { - "built_by": "t27c-bootstrap@0.5.2+063da04", + "built_by": "t27c-bootstrap@0.5.2+82ea5bca0", "closure": [ { "spec": "specs/tri/t27b/verilog_plan.t27", @@ -7,16 +7,16 @@ } ], "config": "gen=c,rust,verilog,zig;tests=zig", - "gen_hash_c": "sha256:3eeea85101c9dff7f3899dab14da7177aece63cb40504ad0f2cf655b73d92a33", + "gen_hash_c": "sha256:30749edd19a555f420fd73d9062684a9a3be4add21b94cff4bdaaab89c6f4971", "gen_hash_rust": "sha256:5b6aa47e15d247a39085a75ce6771e40bd305a1fa7c78afd66471297d5ab9497", "gen_hash_verilog": "sha256:f44541bb247251be1dfdd84155738a64a2e414d8a5b3ddb8b45fcba5659e465a", - "gen_hash_zig": "sha256:29b2b4afd4bbb22e09013427d12b157f90a813d5686af24e345c2fad57984d21", + "gen_hash_zig": "sha256:939db96f3e79caf956a211f2efc850f315998f68ab84544a012d3ebb6fed1006", "module": "T27bEmitKit", "ring": 12, "seal_schema": 2, - "sealed_at": "2026-10-17T18:12:16Z", + "sealed_at": "2026-10-17T19:05:45Z", "sealed_by": "t27c-bootstrap@0.5.2", - "spec_hash": "sha256:7a31a1e4383104b0b59b2a339ccbe6d87eb69f56f28e5bff95befa18b0dba795", + "spec_hash": "sha256:8c7eea479142c7855d069e2cce5c0bbd03ffb1dccb861c5db334fe459db410d1", "spec_path": "specs/tri/t27b/emit_kit.t27", "tests": { "failed": 0, diff --git a/specs/tri/t27b/emit_kit.t27 b/specs/tri/t27b/emit_kit.t27 index d370f19de7..16b3fc6b90 100644 --- a/specs/tri/t27b/emit_kit.t27 +++ b/specs/tri/t27b/emit_kit.t27 @@ -260,8 +260,9 @@ test bytes_and_numbers_are_written_where_asked { var out : [64]u8 = undefined; const n0 : usize = put_dec(out[0 .. 64], 0, 0); assert n0 == 1 and out[0] == 48; - const n1 : usize = put_dec(out[0 .. 64], 3, 4294967295); - assert n1 == 13 and holds(out[0 .. 64], n1, "4294967295"); + // written right after the first number: holds scans out[0 .. n1], and a gap would read bytes never written + const n1 : usize = put_dec(out[0 .. 64], 1, 4294967295); + assert n1 == 11 and holds(out[0 .. 64], n1, "4294967295"); const n2 : usize = put_ind(out[0 .. 64], 0, 4); assert n2 == 4 and out[0] == 32 and out[3] == 32; const n3 : usize = put_bytes(out[0 .. 64], n2, "xabcx", 1, 4);