{"method": "Boundary/core exchange: swap 1 or 2 boundary caps (outer radius within 0.02 of max) with core caps (4 nearest centre), reorient the moved boundary piece radially (cap out or flat out), release neighbours (radial scale 1.12 + Gaussian jitter 0.05 pos / 0.1 rad), then repeated SLSQP minimising R with analytic separating-line constraints (one free normal angle per near pair, semicircle support function) and analytic containment (flat endpoints + clamped arc farthest point). Official-area continuation stage was NOT reached: no exchange produced a feasible SLSQP repair inside the time box.", "seeds": {"master": 33104, "runs": [33104, 33105, 33106, 33107, 33108, 33109]}, "official_valid": true, "official_score_full": 2.948526950912552, "official_score_8dp": "2.94852695", "score_refers_to": "inherited BEST array (re-scored after 6-dp rounding); NOT a new result", "solution": [{"x": 0.545425, "y": 0.67215, "theta": -0.570778}, {"x": 1.135484, "y": -1.23874, "theta": 2.227365}, {"x": -0.584124, "y": -0.217653, "theta": -1.671787}, {"x": 1.843118, "y": 0.631801, "theta": -0.722762}, {"x": 0.278186, "y": 1.928675, "theta": 2.264578}, {"x": -0.723715, "y": 1.809349, "theta": 3.126118}, {"x": -1.624637, "y": 1.076193, "theta": -2.992325}, {"x": -0.56981, "y": 0.785952, "theta": -1.682231}, {"x": 0.032918, "y": 1.724683, "theta": -0.877015}, {"x": 1.261991, "y": 1.484613, "theta": 0.453135}, {"x": -1.944933, "y": -0.121111, "theta": -2.464295}, {"x": -1.573106, "y": -1.149938, "theta": -1.641622}, {"x": 1.049635, "y": -2.567295, "theta": 1.95895}, {"x": -0.789401, "y": -1.781407, "theta": -0.792106}, {"x": 1.811166, "y": -0.718041, "theta": -0.914204}], "solution_json": "[{\"x\": 0.545425, \"y\": 0.67215, \"theta\": -0.570778}, {\"x\": 1.135484, \"y\": -1.23874, \"theta\": 2.227365}, {\"x\": -0.584124, \"y\": -0.217653, \"theta\": -1.671787}, {\"x\": 1.843118, \"y\": 0.631801, \"theta\": -0.722762}, {\"x\": 0.278186, \"y\": 1.928675, \"theta\": 2.264578}, {\"x\": -0.723715, \"y\": 1.809349, \"theta\": 3.126118}, {\"x\": -1.624637, \"y\": 1.076193, \"theta\": -2.992325}, {\"x\": -0.56981, \"y\": 0.785952, \"theta\": -1.682231}, {\"x\": 0.032918, \"y\": 1.724683, \"theta\": -0.877015}, {\"x\": 1.261991, \"y\": 1.484613, \"theta\": 0.453135}, {\"x\": -1.944933, \"y\": -0.121111, \"theta\": -2.464295}, {\"x\": -1.573106, \"y\": -1.149938, \"theta\": -1.641622}, {\"x\": 1.049635, \"y\": -2.567295, \"theta\": 1.95895}, {\"x\": -0.789401, \"y\": -1.781407, \"theta\": -0.792106}, {\"x\": 1.811166, \"y\": -0.718041, \"theta\": -0.914204}]", "solution_sha256_utf8": "6e094dde35234309ceeea918c22eca0facc0ca99a9e2691266afe697d0fdbfb9", "mec": [-0.0001819080616875258, 0.00013448997007248039, 2.948526950912552], "max_pair_area": 9.997822348073146e-07, "inherited_baseline": {"score": 2.948526950912552, "solution": [{"x": 0.545425, "y": 0.67215, "theta": -0.570778}, {"x": 1.135484, "y": -1.23874, "theta": 2.227365}, {"x": -0.584124, "y": -0.217653, "theta": -1.671787}, {"x": 1.843118, "y": 0.631801, "theta": -0.722762}, {"x": 0.278186, "y": 1.928675, "theta": 2.264578}, {"x": -0.723715, "y": 1.809349, "theta": 3.126118}, {"x": -1.624637, "y": 1.076193, "theta": -2.992325}, {"x": -0.56981, "y": 0.785952, "theta": -1.682231}, {"x": 0.032918, "y": 1.724683, "theta": -0.877015}, {"x": 1.261991, "y": 1.484613, "theta": 0.453135}, {"x": -1.944933, "y": -0.121111, "theta": -2.464295}, {"x": -1.573106, "y": -1.149938, "theta": -1.641622}, {"x": 1.049635, "y": -2.567295, "theta": 1.95895}, {"x": -0.789401, "y": -1.781407, "theta": -0.792106}, {"x": 1.811166, "y": -0.718041, "theta": -0.914204}]}, "alt_rescored": {"official_valid": true, "score": 2.9535295831518282, "max_pair_area": 9.999290003062e-07, "solution": [{"x": -0.601236, "y": -0.101191, "theta": -1.859253}, {"x": 0.893479, "y": -1.429912, "theta": 2.045024}, {"x": 0.684425, "y": 0.559049, "theta": -0.450825}, {"x": -0.286427, "y": 0.848423, "theta": -0.695388}, {"x": -1.587232, "y": 1.138844, "theta": 1.639909}, {"x": -0.815408, "y": 1.775215, "theta": 0.717967}, {"x": -1.331656, "y": 1.156535, "theta": -1.501679}, {"x": -1.941586, "y": 0.215682, "theta": -2.61545}, {"x": -1.756171, "y": -0.85565, "theta": -1.802945}, {"x": -1.09777, "y": -1.615915, "theta": -0.964492}, {"x": 0.569721, "y": -2.720065, "theta": 1.777263}, {"x": 1.653958, "y": -1.039559, "theta": -1.096565}, {"x": 1.933612, "y": 0.278243, "theta": -0.895678}, {"x": 1.519565, "y": 1.227677, "theta": 0.311659}, {"x": 0.242813, "y": 1.938376, "theta": 0.518648}]}, "best_new": null, "best_fresh": null, "strict_radius": null, "structure": {"note": "Not analysed further here; inherited BEST is the published-record configuration (official MEC centre ~(-1.8e-4,1.3e-4), R=2.948526950912552). Structure analysis was out of reach in this run's time budget."}, "runs": [{"id": "b1", "note": "killed by 400s timeout before final log line; init 2.948752615140773"}, {"id": "b2", "seed": 33105, "start": "best.json", "nx": 2, "init": 2.948752615140773, "attempts": 1, "valid": 0, "best": 2.948752615140773, "seconds": 358.396183013916}, {"id": "a1", "note": "killed by 400s timeout before final log line; init 2.953530204559172"}, {"id": "a2", "seed": 33107, "start": "alt.json", "nx": 2, "init": 2.953530204559172, "attempts": 2, "valid": 0, "best": 2.953530204559172, "seconds": 387.4928767681122}, {"id": "f1", "seed": 33108, "start": "fresh", "nx": 1, "init": 4.475738476637014, "attempts": 2, "valid": 0, "best": 4.475738476637014, "seconds": 391.803097486496}, {"id": "f2", "seed": 33109, "start": "fresh", "nx": 2, "init": 4.5344616919559595, "attempts": 2, "valid": 0, "best": 4.5344616919559595, "seconds": 394.48633766174316}], "scorer_checks": ["Fresh clone at 78a78626f098cd236f3a09bb2cb242f72951599d, uv sync, uv run python run.py on sample: VALID 3.500000.", "BEST rounded to 6 dp: official VALID, 2.948526950912552.", "ALT rounded to 6 dp: official VALID, 2.9535295831518282 (relaxed value given 2.95352958 agrees to 8 dp).", "Fresh-start (seed 33108) unconverged checkpoint: official INVALID (overlaps), as expected for an unrepaired start.", "Own scorer was not cross-validated against official on random/tight cases in this run (time); own 'outer' radius is measured about the origin, not the MEC, so its 2.94875 for BEST is not comparable to the official MEC score. Official validation alone decides here."], "executable_source": "# Boundary/core exchange + SLSQP repair using analytic separating-line constraints.\nimport numpy as np, json, sys, time, math\nfrom scipy.optimize import minimize\nN=15\ndef h(n,t):  # support of unit semicircle (centre origin, dir t) along unit n (vectorised)\n    u=np.cos(t)*n[0]+np.sin(t)*n[1]; v=-np.sin(t)*n[0]+np.cos(t)*n[1]\n    return np.where(u>=0,1.0,np.abs(v))\ndef outer(P):  # farthest-point radius about origin per piece\n    x,y,t=P[:,0],P[:,1],P[:,2]; r=np.hypot(x,y); a=np.arctan2(y,x)\n    d=np.angle(np.exp(1j*(a-t))); arc=np.where(np.abs(d)<=np.pi/2,r+1,0)\n    e1=np.hypot(x-np.sin(t),y+np.cos(t)); e2=np.hypot(x+np.sin(t),y-np.cos(t))\n    return np.maximum(arc,np.maximum(e1,e2))\ndef solve(P,R0,iters=300):\n    P=P.copy(); P[:,:2]-=P[:,:2].mean(0)*0\n    ij=[(i,j) for i in range(N) for j in range(i+1,N) if np.hypot(*(P[i,:2]-P[j,:2]))<2.6]\n    I=np.array([a for a,b in ij]); J=np.array([b for a,b in ij])\n    ph=np.arctan2(P[J,1]-P[I,1],P[J,0]-P[I,0])\n    z0=np.concatenate([P.ravel(),[0,0,R0],ph]); m=len(ij)\n    def unpack(z): return z[:45].reshape(N,3),z[45:47],z[47],z[48:]\n    def sep(z):\n        Q,c,R,f=unpack(z); n=np.array([np.cos(f),np.sin(f)])\n        d=(Q[J,0]-Q[I,0])*n[0]+(Q[J,1]-Q[I,1])*n[1]\n        return d-h(n,Q[I,2])-h(-n,Q[J,2])\n    def cont(z):\n        Q,c,R,f=unpack(z); x,y,t=Q[:,0]-c[0],Q[:,1]-c[1],Q[:,2]\n        e1=R**2-((x-np.sin(t))**2+(y+np.cos(t))**2); e2=R**2-((x+np.sin(t))**2+(y-np.cos(t))**2)\n        # arc: points at t+k*pi/8, k=-4..4 sampled plus centre-direction exact\n        a=np.arctan2(y,x); d=np.clip(np.angle(np.exp(1j*(a-t))),-np.pi/2,np.pi/2); b=t+d\n        e3=R**2-((x+np.cos(b))**2+(y+np.sin(b))**2)\n        return np.concatenate([e1,e2,e3])\n    r=minimize(lambda z:z[47],z0,jac=lambda z:np.eye(len(z))[47],method='SLSQP',\n       constraints=[{'type':'ineq','fun':sep},{'type':'ineq','fun':cont}],options={'maxiter':iters,'ftol':1e-12})\n    Q,c,R,f=unpack(r.x); Q=Q.copy(); Q[:,:2]-=c\n    ok=sep(r.x).min()>-1e-9 and cont(r.x).min()>-1e-8\n    return Q,outer(Q).max(),ok\ndef exact_ok(Q):  # independent full-pair check by separating-axis search over dense angles\n    for i in range(N):\n        for j in range(i+1,N):\n            if np.hypot(*(Q[i,:2]-Q[j,:2]))>=2: continue\n            f=np.linspace(0,2*np.pi,20000); n=np.array([np.cos(f),np.sin(f)])\n            g=(Q[j,0]-Q[i,0])*n[0]+(Q[j,1]-Q[i,1])*n[1]-h(n,Q[i,2])-h(-n,Q[j,2])\n            if g.max()<-1e-7: return False\n    return True\ndef polish(P,rounds=6):\n    best=None\n    for k in range(rounds):\n        R0=outer(P).max()+1e-3\n        Q,R,ok=solve(P,R0)\n        if not ok: break\n        P=Q\n        if best is None or R<best[1]-1e-10: best=(Q.copy(),R)\n        else: break\n    return best\ndef exchange(P,rng,nx):\n    Q=P.copy(); o=outer(Q); R=o.max(); r=np.hypot(Q[:,0],Q[:,1])\n    bnd=np.where(o>R-0.02)[0]; core=np.argsort(r)[:4]\n    for _ in range(nx):\n        b=rng.choice(bnd); c=rng.choice(core)\n        if b==c: continue\n        Q[[b,c],:2]=Q[[c,b],:2]\n        Q[b,2]=Q[c,2] if rng.random()<.5 else Q[b,2]+rng.uniform(-np.pi,np.pi)\n        Q[c,2]=np.arctan2(Q[c,1],Q[c,0])+rng.choice([0,np.pi])  # outward cap or flat on boundary\n    # release neighbours: expand radially and jitter\n    Q[:,:2]*=1.12; Q[:,:2]+=rng.normal(0,0.05,(N,2)); Q[:,2]+=rng.normal(0,0.1,N)\n    return Q\nif __name__=='__main__':\n    start,seed,tl,nx,out=sys.argv[1],int(sys.argv[2]),float(sys.argv[3]),int(sys.argv[4]),sys.argv[5]\n    rng=np.random.default_rng(seed)\n    if start=='fresh':\n        a=rng.uniform(0,2*np.pi,N); rr=2.6*np.sqrt(rng.uniform(0,1,N))\n        P=np.c_[rr*np.cos(a)*1.4,rr*np.sin(a)*1.4,rng.uniform(-np.pi,np.pi,N)]\n    else: P=np.array(json.load(open(start)))\n    t0=time.time(); b=polish(P,10) or (P,outer(P).max())\n    base=b; best=b; log={'seed':seed,'start':start,'nx':nx,'init':best[1],'attempts':0,'valid':0}\n    print('init',best[1],flush=True)\n    while time.time()-t0<tl:\n        log['attempts']+=1\n        Q=exchange(best[0],rng,nx); c=polish(Q,8)\n        if c and exact_ok(c[0]):\n            log['valid']+=1\n            if c[1]<best[1]-1e-9: best=c; print('improved',c[1],flush=True)\n        log['best']=best[1]; log['seconds']=time.time()-t0\n        json.dump({'log':log,'P':best[0].tolist()},open(out,'w'))\n    print(json.dumps(log))\n", "commands": ["git clone https://github.com/benedictbrady/shape-packing-challenge sp && git checkout 78a78626f098cd236f3a09bb2cb242f72951599d", "uv sync; uv pip install scipy", "uv run python run.py", "python bc.py <best.json|alt.json|fresh> <seed> 330 <1|2> <out.json>  (6 parallel runs, timeout 400s)", "official check: validate_and_score on 6-dp rounded arrays"], "notes": "Negative result. The non-smooth support function (piecewise 1 / |sin|) made dense SLSQP slow (~25-190 s per repair at ~150 vars) and every exchange repair ended infeasible (valid_count 0 in all 6 runs; 1-2 attempts per run in ~330 s). Fresh starts stalled at R~4.5. No configuration below or equal to 2.94853 was produced by this strategy; the only valid record-level array is the inherited BEST (a tie with the published value, not a new record). Expected area differences: official uses 4096-point polygons (radial error <7.4e-8), so exact circular areas and polygon areas differ by order 1e-7-1e-6 near tangency; none of that was exploited. Improvement suggestions: analytic Jacobians, sparse contact sets, smooth phi-functions, and starting exchanges from tighter radial scale (~1.03)."}