#!/usr/bin/env python3 # Independent check: reconstruct the first66 new starts with gcd, then enumerate # every raw phase/slot membership. Do not trust producer bins or verdict strings. import json,sys,hashlib,math,resource,signal from pathlib import Path EXPECTED_INPUT='d75d199985207885fea50bf926c18145c0d1c8c6a89d74d17ec34ec8458195fa' def placements(original,index): tag=('solveathome/986/2026-09-14/window/'+str(index)+'/weights-only/1').encode('ascii') counter=0;chosen=[];used={tuple(original)} for attempt in range(10000): result=list(original) for i in reversed(range(1,len(result))): bound=i+1;accept=((1<<64)//bound)*bound while True: assert counter<100000,'draw cap' data=tag+counter.to_bytes(8,'big');counter+=1 value=int.from_bytes(hashlib.sha256(data).digest()[0:8],'big') if valuebest:best=total;chosen=b maxima.append(best);phases.append(chosen) return {'C':sum(maxima),'per_prime':maxima,'argmax':phases} def main(): def exhausted(signum,frame):raise RuntimeError('checker CPU cap exhausted') signal.signal(signal.SIGXCPU,exhausted);resource.setrlimit(resource.RLIMIT_CPU,(19,20)) data=Path(sys.argv[1]).read_bytes();assert hashlib.sha256(data).hexdigest()==EXPECTED_INPUT,'input hash' cfg=json.loads(data);target=json.loads(Path(sys.argv[2]).read_text()) assert target['job_id']==986 and target['input_sha256']==EXPECTED_INPUT assert len(target['rows'])==16,'missing window' assert len(cfg['weights'])==66 and all(isinstance(x,int) and x>=0 for x in cfg['weights']) old=math.prod(cfg['old_primes']);S=sum(cfg['weights']);assert target['S']==S # Validate target shape and multisets before the expensive all-phase pass. for r,source in zip(target['rows'],cfg['windows']): assert r['index']==source['index'] and r['a']==source['a'] and r['scan_end_exclusive']==source['scan_end_exclusive'] if r['available']: assert len(r['slots'])==66 and len(r['controls'])==31,'missing slots/controls' used={tuple(cfg['weights'])} for c in r['controls']: assert sorted(c['weights'])==sorted(cfg['weights']),'weight multiset' assert tuple(c['weights']) not in used,'duplicate vector';used.add(tuple(c['weights'])) assert len(c['argmax'])==len(cfg['Q']) assert all(0<=b=66;is_counted=is_eligible and template['C']