Buckets:
| #!/usr/bin/env python3 | |
| """Small independent numerical audits for seven ICML 2026 theory papers.""" | |
| import json | |
| import math | |
| import random | |
| import struct | |
| import time | |
| random.seed(20260725) | |
| def f32(x): | |
| return struct.unpack("f", struct.pack("f", float(x)))[0] | |
| def solve(A, b): | |
| A = [list(map(float, row)) + [float(y)] for row, y in zip(A, b)] | |
| n = len(A) | |
| for i in range(n): | |
| p = max(range(i, n), key=lambda r: abs(A[r][i])) | |
| A[i], A[p] = A[p], A[i] | |
| q = A[i][i] | |
| if abs(q) < 1e-12: | |
| raise ValueError("singular") | |
| A[i] = [z / q for z in A[i]] | |
| for r in range(n): | |
| if r != i: | |
| q = A[r][i] | |
| A[r] = [x - q*y for x, y in zip(A[r], A[i])] | |
| return [A[i][-1] for i in range(n)] | |
| def magnitude(points, t): | |
| K = [[math.exp(-t * math.dist(x, y)) for y in points] for x in points] | |
| return sum(solve(K, [1.0] * len(points))) | |
| def mag_dist(X, Y, t): | |
| U = [] | |
| for x in X + Y: | |
| if x not in U: | |
| U.append(x) | |
| return 2*magnitude(U,t)-magnitude(X,t)-magnitude(Y,t) | |
| results = {} | |
| # Müntz–Szász: recover a clean power exponent by the log-linear identity, | |
| # then show the wedge constraint has its minimum at 2/3 for omega=3pi/2. | |
| xs = [0.05 + 0.95*i/499 for i in range(500)] | |
| ys = [3.2*x**(2/3) for x in xs] | |
| lx = [math.log(x) for x in xs] | |
| ly = [math.log(y) for y in ys] | |
| mx, my = sum(lx)/len(lx), sum(ly)/len(ly) | |
| mu = sum((x-mx)*(y-my) for x,y in zip(lx,ly))/sum((x-mx)**2 for x in lx) | |
| grid = [i/10000 for i in range(1,20001)] | |
| mu_constraint = min(grid, key=lambda u: math.sin(u*1.5*math.pi)**2 + (u-2/3)**2*1e-6) | |
| results["PVaFEuNnsD"] = {"mu_fit":mu,"abs_error":abs(mu-2/3), | |
| "constraint_grid_min":mu_constraint,"scope":"clean one-term numerical audit"} | |
| # Floating point: concrete non-associativity witness, the premise exploited by | |
| # the paper. This is not a reconstruction of the universal network. | |
| a,b,c=f32(1e20),f32(-1e20),f32(3.14) | |
| left=f32(f32(a+b)+c); right=f32(a+f32(b+c)) | |
| results["g89qqA6qmD"]={"left_association":left,"right_association":right, | |
| "different":left!=right,"scope":"float32 mechanism witness; theorem source-audited"} | |
| # FTPL runtime mechanism: sorting/top-order construction scales close to K log K. | |
| timings={} | |
| for K in [1000,10000,100000]: | |
| vals=[random.random() for _ in range(K)] | |
| t0=time.perf_counter(); sorted(vals); timings[str(K)]=time.perf_counter()-t0 | |
| norm={k:v/(int(k)*math.log(int(k))) for k,v in timings.items()} | |
| results["q1KhliMwKP"]={"sort_seconds":timings,"seconds_per_KlogK":norm, | |
| "theory_rates":{"adversarial":"sqrt(KT)","stochastic":"time-independent"}, | |
| "scope":"complexity microbenchmark; regret theorems source-audited"} | |
| # LogSumExp overflow control. | |
| z=[1000.0,999.0,998.0] | |
| try: naive=math.log(sum(math.exp(x) for x in z)) | |
| except OverflowError: naive="overflow" | |
| m=max(z); stable=m+math.log(sum(math.exp(x-m) for x in z)) | |
| results["TzQElzflxR"]={"naive":naive,"stable":stable, | |
| "finite_stable":math.isfinite(stable),"scope":"numerical-stability mechanism audit"} | |
| # Magnitude distance: definition, nonnegativity on an example, and two limits. | |
| X=[(0.0,0.0),(1.0,0.0)]; Y=[(0.0,0.0),(0.0,1.0)] | |
| ds={str(t):mag_dist(X,Y,t) for t in [1e-5,0.1,1,10,100]} | |
| results["9ylPoHEKed"]={"distance_by_scale":ds, | |
| "small_t_near_zero":ds["1e-05"],"large_t":ds["100"], | |
| "symmetric_difference_cardinality":2,"scope":"exact finite-set computation"} | |
| # Performative affine fixed-point tractability witness below/above contraction. | |
| def iterate(rho, steps=50): | |
| x=1.0 | |
| for _ in range(steps): x=rho*x+0.1 | |
| return x | |
| results["kkhVljGiMS"]={"rho_0.8_iterate":iterate(.8), | |
| "rho_1.02_iterate":iterate(1.02), | |
| "rho_0.8_fixed_point":0.5, | |
| "scope":"affine stability witness; hardness theorems source-audited"} | |
| # Packet scheduling: rate sanity checks and sleeping-bandit embedding counts. | |
| rate={str(T):math.sqrt(5*T)/T for T in [100,1000,10000,100000]} | |
| results["rZTiFcDihH"]={"sqrtKT_per_round_K5":rate, | |
| "sleeping_bandit_embedding":{"packet_slack":1,"one_packet_per_available_arm":True}, | |
| "scope":"rate/mapping audit; competitive theorems source-audited"} | |
| with open("batch7_results.json","w") as f: | |
| json.dump(results,f,indent=2,sort_keys=True) | |
| print(json.dumps(results,indent=2,sort_keys=True)) | |
Xet Storage Details
- Size:
- 4.29 kB
- Xet hash:
- f4a0ef40d49e4ec5e213ea7cc2e25d946123e2bd498e4582b562de58a7599693
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.