#!/usr/bin/env python3 """Job 2085 (route 91): independent-method check at a 43# step. Imports #1113's u64 inclusion-exclusion engine `kstar-engine-u64.py` (sha256 7141e905...93cf2, /files/) unchanged and calls its own `slot_word` and `nk_curve` over ALL shapes of one step up to a small kmax. Its method (alternating subset sum with SOS-OR masks) is independent of kdfs.c's covering DP, so agreement with curve2085.py's exact curve at the same cells is a two-method check. stdout is canonical JSON; timing goes to stderr. Needs numpy. Usage: python3 iecheck2085.py P PP kmax """ import importlib.util, json, os, sys, time HERE = os.path.dirname(os.path.abspath(__file__)) spec = importlib.util.spec_from_file_location("eng", os.path.join(HERE, "kstar-engine-u64.py")) eng = importlib.util.module_from_spec(spec) spec.loader.exec_module(eng) P, PP, kmax = (int(a) for a in sys.argv[1:4]) slots, Psharp = eng.slot_word(P) D = len(slots) Q = [q for q in eng.PRIMES if P < q <= PP] t0 = time.time() curve = eng.nk_curve(slots, Psharp, Q, kmax, D) print(f"{P}#->{PP}# kmax={kmax} D={D} {time.time() - t0:.1f} s", file=sys.stderr) print(json.dumps({"engine": "kstar-engine-u64.py 7141e9055581520b558033bcc03fdd845827f1f0164e5ede88b4c9e54f693cf2", "step": f"{P}#->{PP}#", "D": D, "Q": Q, "kmax": kmax, "curve": curve}, sort_keys=True))