#!/usr/bin/env python3 """Build this return's verification plan and its fingerprint. Fingerprint rule (research protocol, schema v1): sha256("solveathome-verification-v1" + "\n" + compact JSON, object keys recursively sorted, array order preserved, `cost` excluded). The rule was validated in this run against the server's own accepted value for #1399's plan, and the server independently recomputed the fingerprint of #1433's plan, so the digest printed here is reproducible by a reader with no extra convention. """ import hashlib import json import os WORK = os.path.dirname(os.path.abspath(__file__)) RUN = os.path.dirname(WORK) OUT = os.path.join(RUN, "artifacts", "job2818b") def sha(p): h = hashlib.sha256() with open(p, "rb") as f: for chunk in iter(lambda: f.read(1 << 20), b""): h.update(chunk) return h.hexdigest() def fingerprint(plan): body = {k: v for k, v in plan.items() if k != "cost"} def sort(o): if isinstance(o, dict): return {k: sort(o[k]) for k in sorted(o)} if isinstance(o, list): return [sort(x) for x in o] return o s = json.dumps(sort(body), separators=(",", ":"), ensure_ascii=False) return hashlib.sha256(("solveathome-verification-v1\n" + s).encode()).hexdigest() FILES = [ (os.path.join(WORK, "verify-2818b.py"), "verify-2818b.py", "checker"), (os.path.join(WORK, "check-2818b.json"), "check-2818b.json", "target"), (os.path.join(WORK, "ilp132.py"), "ilp132.py", "dependency"), (os.path.join(WORK, "gate132.py"), "gate132.py", "dependency"), (os.path.join(WORK, "cut-search.py"), "cut-search.py", "dependency"), (os.path.join(WORK, "analyze-reps.py"), "analyze-reps.py", "dependency"), (os.path.join(WORK, "cut-search-9-204.json"), "cut-search-9-204.json", "dependency"), (os.path.join(WORK, "cut-search-12-528.json"), "cut-search-12-528.json", "dependency"), (os.path.join(WORK, "analysis-reps.json"), "analysis-reps.json", "dependency"), (os.path.join(WORK, "logs", "gate132.out"), "gate132.out", "dependency"), (os.path.join(WORK, "logs", "reps-none.jsonl"), "reps-none.jsonl", "dependency"), (os.path.join(WORK, "logs", "reps-reflect.jsonl"), "reps-reflect.jsonl", "dependency"), (os.path.join(WORK, "logs", "n12-none-seed4.jsonl"), "n12-none-seed4.jsonl", "dependency"), (os.path.join(WORK, "logs", "n12-none-seed5.jsonl"), "n12-none-seed5.jsonl", "dependency"), (os.path.join(WORK, "logs", "n12-none-seed6.jsonl"), "n12-none-seed6.jsonl", "dependency"), (os.path.join(WORK, "logs", "n12-reflect-seed3.jsonl"), "n12-reflect-seed3.jsonl", "dependency"), (os.path.join(WORK, "logs", "n12-reflect-seed4.jsonl"), "n12-reflect-seed4.jsonl", "dependency"), (os.path.join(WORK, "logs", "sat-n13-seed0.jsonl"), "sat-n13-seed0.jsonl", "dependency"), (os.path.join(WORK, "logs", "sat-n13-seed1.jsonl"), "sat-n13-seed1.jsonl", "dependency"), (os.path.join(WORK, "logs", "sat-n14-seed0.jsonl"), "sat-n14-seed0.jsonl", "dependency"), (os.path.join(WORK, "logs", "sat-n14-seed1.jsonl"), "sat-n14-seed1.jsonl", "dependency"), (os.path.join(WORK, "r1422", "job2806_runs.jsonl"), "job2806_runs.jsonl", "dependency"), (os.path.join(OUT, "report.md"), "report.md", "input"), (os.path.join(OUT, "research.json"), "research.json", "input"), (os.path.join(OUT, "recipe.md"), "recipe.md", "input"), ] manifest = [{"path": name, "role": role, "sha256": sha(path)} for path, name, role in FILES] checker = next(m["sha256"] for m in manifest if m["role"] == "checker") TARGET = next(m["sha256"] for m in manifest if m["role"] == "target") TARGET_NAME = next(m["path"] for m in manifest if m["role"] == "target") plan = { "schema_version": 1, "claim": ( "(1) The route's 0/1 MIP decides the A144311 instance at n = 13 and n = 14 on BOTH sides: " "kInfeasible at R = a(n)+1 (n=13 in 323.9 s from seed 0 of a 4-seed portfolio; n=14 in " "664.3 s from seed 0 of a 2-seed portfolio) and kOptimal with a witness rechecked against " "r_p + i = +-1 (mod p) at R = a(n) for two seeds per size, so a(13) = 545 and a(14) = 617. " "The whole run was charged as k seeds x 900 s per level, i.e. exactly the 1.5 core-hours the " "recorded obstacle names, against an actual 1.27. (2) The UNSAT cost curve does not order the " "instrument classes at n <= 12: repetition at fixed seeds gives a between-seed spread at " "n = 11 of 21.3x (plain) and 27.3x (reflection) in time and 27.6x / 40.3x in node count, the " "same order as the whole 5-30x MIP-vs-CDCL gap, and at n = 12 the plain MIP's six seeds " "straddle the cited CDCL time (3 faster, 3 slower). The paired same-seed reflection " "comparison is a consistent 1.16-1.98x gain at n = 9 and n = 10 but changes sign at n = 11 " "(+11.4x, +9.1x, -24x by seed). (3) No rank-1 LP/cut certificate can replace branching here: " "for any real combination of the model's rows, c.xf - B = (S(n)-1) * sum(lambda) >= 0 at the " "point x_{p,r} = 1/p, so no linear combination separates it; with integer multipliers the " "rounding gain ceil(B)-B < 1 cannot beat a slack of at least S(n)-1 > 1 (n >= 5); and of " "85,644 rank-1 Chvatal-Gomory roundings of the documented space at n = 9 and n = 12, none " "separates, the closest being +1.331245 and +1.518781 above its right-hand side where " "separation needs < 0. The cut generator itself was validated against 1,500 cuts at the " "enumerated integer feasible points of n = 4 and n = 5 instances with 0 invalid, and the LP " "only becomes informative once about two thirds to three quarters of the residues are fixed " "(0/0/4/15/80/96/100% of random cubes infeasible at depths 2..8 of 9 at n = 9)." ), "command": "python3 verify-2818b.py > %s" % TARGET_NAME, "checker": checker, "inputs": [m["sha256"] for m in manifest if m["role"] != "target"], "manifest": manifest, "targets": [TARGET_NAME], "tools": ["python3", "highspy"], "environment": ( "CPython 3.12.13 (measured, Windows 11) with numpy 2.5.3 and highspy 1.15.1 (HiGHS 1.15.1). " "Every solve in the producer used threads = 1 and mip_rel_gap = 0. The checker needs numpy " "and highspy only, opens no network connection, and rebuilds the model from the definition " "of A144311 rather than importing the producer's encoder." ), "scope": ( "Six claims re-derived, each by a mechanism different from the producer's: the LP feasibility " "of x_{p,r} = 1/p at every R (rows rebuilt from the definition and evaluated by hand, then " "re-solved at R = 205 and R = 200000), the row-combination identity (coefficients keyed by " "(p, r) tuples, exact fractions), the closest rank-1 CG cut rebuilt from its description " "(lambda = 1/3 on position 0, mu = -1 on the two smallest primes) and its slack recomputed, " "the depth curve re-sampled with 25 cubes per depth and every cube fixed by ADDING equality " "rows instead of changing column bounds, the gate's budget arithmetic recomputed from its " "level records (charged = sum of k*cap, closure = at least one seed proving UNSAT, " "a_n_reached = the ladder value of the deepest closed level), and the ordering verdict " "recomputed from the raw repetition rows against the cited CDCL runs file. It does NOT " "re-run the gate or the 85,644-cut search (it re-checks their recorded outputs instead), it " "does not re-run any solve of its own beyond the small LP/row work for those checks, and it " "asserts nothing about timings: the wall clocks in the producer's tables are not reproducible " "by construction, and the node and LP-iteration counts are what the checker treats as data." ), "coverage": "decisive", "coverage_md": ( "Decisive for the three questions asked: whether the non-monotonicity reproduces (it does, as " "a seed effect, with the ordering unstable at n = 12), how far the gate gets inside its " "declared budget (n = 13 and n = 14, on both sides), and whether a valid inequality family " "cuts x_{p,r} = 1/p (no at rank 1, proved for row combinations and for integer multipliers, " "searched over 85,644 roundings, with the generator validated on enumerated integer points). " "Not covered: any n above 14, any rank-2 or instance-specific cut family, and the timings, " "which are cross-machine against a cited baseline and are not part of the comparison." ), "method": ( "The checker recomputes each claim from the served evidence under a different mechanism, so " "agreement is evidence about the claim and not about shared code. Cuts and row combinations " "are computed in exact rational arithmetic and compared against the closed forms; the gate's " "budget is recomputed arithmetically; the ordering verdict is recomputed from the raw JSONL " "rows with the cited baseline read from the cited runs file rather than hardcoded." ), "comparison": ( "One byte-exact sha256 comparison on the target %s, whose bytes were identical across two " "consecutive runs here: reproduce it and compare sha256 %s. No tolerance is needed anywhere: " "every quantity in it is an integer count, an exact rational, or a Boolean. If a different " "build cannot match the bytes, fall back to the substance, which is `\"ok\": true` with " "`\"failed_claims\": []` and exit status 0, plus these Booleans: all six cover-row activities " "at n = 9 equal S(9) = 2.497912 and both LP re-solves report kOptimal; the combination " "identity holds on all 80 random combinations with zero counterexamples; both rebuilt CG cuts " "reproduce the recorded slack to 6 decimals; the depth curve matches its recorded shape " "(0 infeasible at depth 2, at most 5 of 25 at depth 4, at least 12 at depth 6, at least 18 at " "depth 7, all 25 at depth 8); the gate charges exactly its declared 5400.0 seconds with the " "actual spend below it and levels 13 and 14 closed by a seed that proved UNSAT; and the " "ordering is stable at n = 9, 10, 11 and unstable at n = 12." ) % (TARGET_NAME, TARGET), "target_sha256": TARGET, "expected": ( "Exit 0, the process reporting ok true with failed_claims [], and the regenerated " "check-2818b.json byte-identical to sha256 " "504cb9e1a5fa62a299060bbe896f157f99067c01bc869b4dd160cb4f6720cf2d. Inside it: claim1 all " "six cover-row activities at n = 9 equal 2.497912 = S(9) with both one-rows exactly 1, and " "the LP re-solves at R = 205 and R = 200000 report kOptimal; claim2 the identity holds on all " "80 random combinations with 0 counterexamples; claim3 both rebuilt CG cuts reproduce their " "recorded slack (1.331245 at n = 9, 1.518781 at n = 12) to six decimals; claim4 the depth " "curve has 0 of 25 infeasible at depth 2, at most 5 at depth 4, at least 12 at depth 6, at " "least 18 at depth 7 and 25 of 25 at depth 8; claim5 the gate charges exactly 5400.0 seconds " "with the actual spend below it, levels 13 and 14 each closed by a seed that proved UNSAT, " "and a_n_reached 617 = the ladder value of the deepest closed level; claim6 the ordering is " "stable at n = 9, 10, 11 and unstable at n = 12, recomputed from the raw rows against the " "cited runs file rather than hardcoded. Runtime about 60 s." ), "assumptions": ( "The served bytes are unmodified and were round-trip verified by sha256 on upload. A " "kInfeasible verdict from a MIP with mip_rel_gap = 0 is a proof of infeasibility, so the " "UNSAT direction is solver-independent in the sense that matters; a kOptimal verdict is " "checked against the covering definition rather than trusted. The cited CDCL numbers are read " "from the served runs file of #1422 and are NOT re-measured here -- no CDCL solver is " "installed on this machine -- so an agreement about them is an agreement about arithmetic and " "not a re-measurement. The producer's wall clocks were taken with up to nine concurrent " "single-threaded solves on 16 cores. Passing does not establish that any timing is " "reproducible, by design." ), "availability": { "status": "complete", "network": False, "required_sources": [], "details": ( "Self-contained given the served evidence files: numpy + highspy, no network, no data " "files beyond the manifest. The served copies are flat (every manifest path in one " "directory), so the checker looks for each evidence file both beside itself and in a " "logs/ subdirectory, and the cited baseline runs file by basename; no path outside the " "served set is needed." ), }, "supports": ( "Passing establishes the three questions this return answers: that the route's MIP decides " "the instance at n = 13 and n = 14 on both sides inside a declared 1.5 core-hour budget " "(so the recorded 'the n = 13..17 gate exceeds the 1.5 h budget' clause is false for those " "levels), that the cost curve does not order the instrument classes at n <= 12 (the seed " "spread at a fixed setting is 21-27x in time and 28-40x in nodes at n = 11, and at n = 12 " "the plain MIP's six seeds straddle the cited baseline), and that no rank-1 LP or " "Chvatal-Gomory certificate can replace branching here (the row-combination identity, the " "integer-multiplier corollary, and 85,644 searched roundings with none separating). It does " "NOT establish anything at n >= 15, any rank-2 or instance-specific cut family, or any " "timing claim: the wall clocks in the report are cross-machine against a cited baseline and " "are not reproduced by the checker." ), # `cost` is the plan's own execution estimate and is EXCLUDED from the fingerprint rule, so # adding it cannot move the digest. The server requires the key to exist and be an object. "cost": { "minutes": 2, "cpu_hours": 0.02, "ram_gb": 2, "disk_gb": 1, "judgment_minutes": 30, }, } fp = fingerprint(plan) print("files:", len(manifest), "| checker sha:", checker[:16], "| target sha:", TARGET[:16]) print("plan fingerprint:", fp) with open(os.path.join(OUT, "plan-2818b.json"), "w", encoding="utf-8", newline="\n") as fh: fh.write(json.dumps(plan, indent=1, sort_keys=True, ensure_ascii=False) + "\n") plan["fingerprint"] = fp with open(os.path.join(WORK, "plan-2818b.json"), "w", encoding="utf-8", newline="\n") as fh: fh.write(json.dumps(plan, indent=1, sort_keys=True, ensure_ascii=False) + "\n") print("wrote plan-2818b.json (with and without the fingerprint key)")