diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 6bd374e1ca..64235344e4 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -16,7 +16,7 @@ jobs: fail-fast: false matrix: python-version: ['3.11', '3.13', '3.14'] - group: [community, producers, certificates, ternary, research, tests, strips, clones, positive, joint, pair] + group: [community, producers, certificates, ternary, research, tests, strips, clones, positive, joint, pair, rank-pair, global-anchor, cost-live] steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 with: diff --git a/Makefile b/Makefile index 84fe8290f3..6fea2c6f89 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,9 @@ verify: $(MAKE) verify-positive $(MAKE) verify-joint $(MAKE) verify-pair + $(MAKE) verify-rank-pair + $(MAKE) verify-global-anchor + $(MAKE) verify-cost-live $(MAKE) verify-tests verify-community: community-audit-check community-followup-check copied-reversed-producer copied-reversed-check copied-fixed-reversed-producer copied-fixed-reversed-check @@ -428,3 +431,21 @@ pair-assembly-verify: pair-assembly-producer pair-assembly-check .PHONY: verify-pair verify-pair: pair-assembly-verify python3 scripts/audit_pair_candidate.py --check docs/research/community-pair-arithmetic.json + +.PHONY: verify-rank-pair rank-pair-verify verify-global-anchor global-anchor-verify +verify-rank-pair: rank-pair-verify +rank-pair-verify: + python3 research/rank-pair/frame_compile.py + python3 research/rank-pair/screen.py + python3 -m unittest discover -s tests -p 'test_rank_pair.py' -v + +verify-global-anchor: global-anchor-verify +global-anchor-verify: + python3 research/global-anchor-screen/verify.py + python3 research/global-anchor-screen/controls.py + +.PHONY: verify-cost-live cost-live-verify +verify-cost-live: cost-live-verify +cost-live-verify: + python3 research/cost-live-both/validate.py + python3 research/cost-live-parameters/refine.py diff --git a/NOTICE b/NOTICE index b565637758..bcb5ef522b 100644 --- a/NOTICE +++ b/NOTICE @@ -302,3 +302,41 @@ inherited PR #48 sources. The stacked witness in research/pair-assembly/frame uses eumemic's PR #57 joint frame compiler unchanged; its driver and verifier are adaptations of PR #57's skip_frame_compiler.py, skip_frame_compose.py and verify_skip_frame.py. Original notices are retained. + +Rank-first reclamation on interval-strip pair assembly, 8 October 2026 +Composition and exact profile witness: Dominik Scholz, with substantial OpenAI +GPT-6 Astra / Codex assistance. The PR #60 descending-frame-rank compiler by +Chafik Boukhalfa is reused unchanged on Avi Eisenberg's PR #62 scalar graph. +The joint frame compiler and paid reclamation are eumemic's PR #57, developed +with OpenAI Codex assistance. PR #62 records Anthropic Claude assistance. +This composition improves actual fixed-basis block profiles with unchanged +role counts; no new slot-priority rule or scalar graph is claimed. All prior +contributors, licenses, compiler arguments and conditional analytic/tape +interfaces remain credited. See research/rank-pair/PROOF.md. + +Compatible pending live anchors, 8 October 2026 +Dominik Scholz, with substantial OpenAI GPT-6 Astra / Codex assistance: +pending-carrier F <= E <= G clearing, full literal replay and the selected +finite witness. Descending h25 slot ties were also independently found by +the concurrent incremental research lane. This extends Chafik Boukhalfa's +PR #60 rank-first reclamation, eumemic's PR #57 compiler and Avi Eisenberg's +PR #62 pair graph. The capped-mass comparison format follows rfu08's +concurrent PR #64 audit, with the exact profile differences reconstructed +here. Prior notices and all conditional theorem assumptions remain in force. +See research/global-anchor-screen/PROOF.md and SOURCE.json. + +Cost-aware live controls and combined clearing relations, 8 October 2026 +Rohan Arun's PR67 supplies cost-aware retired-slot selection, the physical +profile oracle and refined rational moment/assembly arithmetic, with OpenAI +Codex assistance. Dominik Scholz's composition adds compatible pending live +controls at both axes; a separate experiment combines fundamental clearing +relations. Both were prepared with substantial OpenAI GPT-6 Astra/Codex +assistance. All PR57/60/62 graph/compiler notices, earlier community credits, +licenses and conditional theorem interfaces remain. Original PR67 sources +are retained in research/slot-cost-rank-pair; selected composition and scope +are documented in research/cost-live-both. + +The parameter-only refinement in research/cost-live-parameters follows +Alejandro Zarzuelo Urdiales's PR #61 backoff-refinement precedent and uses +Rohan Arun's PR #67 exact moment and assembly adapter unchanged. Dominik +Scholz prepared the refinement with substantial OpenAI GPT-6 Astra assistance. diff --git a/README.md b/README.md index 035c259b68..2a017723fa 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,31 @@ +# Cost-aware live controls, conditional κ = 5.103512721785e-5 + +The latest selected research witness is **κ = 1020702544357/20000000000000000**, with +bit saving **51037731934993/10^18**. It combines Rohan Arun's PR #67 +cost-aware reclamation with compatible pending live controls at both axes. +Every clearing XOR and frame transition remains paid. A parameter-only +refinement reduces assembly backoff from 10^-12 to 10^-18 with unchanged +physical words and bit saving; its larger eventual cutoff is documented in +[the refinement proof](research/cost-live-parameters/PROOF.md). Newer public +PRs #69–71 claim stronger bounds; this witness is not the current frontier. + +[Proof](research/cost-live-both/PROOF.md) · +[Exact parameter certificate](research/cost-live-parameters/certificate.json) · +[Completed focused validation](research/cost-live-both/validation-receipt.json) + +Independent complete dirty-state replay, actual fixed-basis profiles/CRT, +exact moment and all 47 constraints/seven margins pass. The candidate file +preserves its initial draft-time pending flags; the separate validation +receipt records completed checks. Full current-head CI/review remains pending. +Run `make cost-live-verify`; CI runs this target on Python 3.11, 3.13 and 3.14. + +The earlier live-anchor and combined-relation experiments remain in their +separate research directories. All inherited analytic, all-size compiler, +routing/recovery and fixed-tape hypotheses remain conditional. This is not +full formal verification or a practical speedup. Prepared by Dominik Scholz +with substantial OpenAI GPT-6 Astra/Codex assistance, retaining Rohan Arun, +Chafik Boukhalfa, eumemic, Avi Eisenberg and all predecessor credits. + # A sharper exponent for integer multiplication **Community research maintained by Douglas Colkitt — conditional on the original diff --git a/certificates/joint-dual-kappa.json b/certificates/joint-dual-kappa.json index d92f653fe4..8c54cce46a 100644 --- a/certificates/joint-dual-kappa.json +++ b/certificates/joint-dual-kappa.json @@ -842,7 +842,7 @@ "scripts/experiments/pin_joint_dual_sources.py": "4d31cc0e38b7902709ca5f8f714cba109760d2592346dd7f8dc0b900a2d9fe00", "scripts/experiments/verify_joint_dual.py": "7a31bba1e9c0ded32ae285df2ca9bc91ef20c330f6789fdba361876f3c7a1985" }, - "source_manifest_sha256": "fd1aab7d75753b4b55b2377f26119dae74f367b0b4fab66cba42d944b3042cc9", + "source_manifest_sha256": "51f6145f25f2bd0e6312002dffd450d9d9723deb77e71100d1be928cd8971152", "sources": [ { "files": { diff --git a/certificates/joint-dual-validation.json b/certificates/joint-dual-validation.json index 99adb4cf74..0cea2ef21d 100644 --- a/certificates/joint-dual-validation.json +++ b/certificates/joint-dual-validation.json @@ -226,7 +226,7 @@ } }, "bit_saving": "2382370177/50000000000000", - "certificate_sha256": "2ed658f05365b28825e24a6e7bac9fc9cc015d5a5d63d9579f4ac6e0640ae559", + "certificate_sha256": "a74fd1d5a4c816742f5548bff1947f594f57444f2ff681d47ddd1a38389d14f7", "kappa": "4764513337/100000000000000", "margins": 7, "producer_words_regenerated_and_matched": true, diff --git a/research/circuit-space-clearing/.gitignore b/research/circuit-space-clearing/.gitignore new file mode 100644 index 0000000000..3d43339293 --- /dev/null +++ b/research/circuit-space-clearing/.gitignore @@ -0,0 +1,2 @@ +build/ +__pycache__/ diff --git a/research/circuit-space-clearing/README.md b/research/circuit-space-clearing/README.md new file mode 100644 index 0000000000..869821b9c8 --- /dev/null +++ b/research/circuit-space-clearing/README.md @@ -0,0 +1,39 @@ +# Draft: combine clearing relations + +Latest candidate: **κ = 510338933/10^13 = 5.10338933e-5**. +Bit saving: **510364979/10^13**. The exact numerical gain over PR #67 is +26543157/(2*10^17). This is a preliminary conditional candidate, pending +independent serialized dirty-state replay and full validation. + +At h23, XOR pairs of PR67's fundamental zero relations to obtain alternate +clearing expressions, cancelling expensive control promotions. All candidate +roles satisfy frame containment and selected expressions are emitted as +literal paid XORs. The compiler selected 48 improved clearing witnesses. +Keep PR67's h25 word unchanged at `research/slot-cost-rank-pair/frame-word-25.json.gz`. +Roles remain27918/36586 and W=137151806. + +Passed in the research lane: internal complete dirty-basis compilation, +source/target/scatter and frame checks, literal transition reconstruction, +actual C++ fixed-basis profiles/CRT, exact moment and47constraints/seven margins. +Independent serialized replay, parent reproduction, dedicated CI and broad +checks are pending. No full formal theorem or practical speedup is claimed. +The original fully replayed PR68 result remains in `global-anchor-screen`; +the separate cost/live-anchor candidate remains in `cost-live-composition`. + +Reproduce from the repository root (C++17 and Python with assertions enabled): + +```sh +python3 research/circuit-space-clearing/run.py --h 23 --mode pairs --work-dir /tmp/circuit-space-reproduction +python3 research/circuit-space-clearing/screen.py --h 23 --work-dir /tmp/circuit-space-reproduction --independent-replay +``` + +`selected/arithmetic.json` and `draft-manifest.json` record the current +candidate and source/artifact pins. These commands have not yet been rerun +in the published checkout; the draft is being made available immediately. + +Attribution: Rohan Arun's PR67 cost-aware selection, oracle and baseline; +Dominik Scholz's new combinations of clearing relations with substantial +OpenAI GPT-6 Astra/Codex assistance; Chafik Boukhalfa's PR60 rank-first rule; +eumemic's PR57 joint compiler; Avi Eisenberg's PR62 graph (Claude assistance). +All earlier source notices, Apache-2.0 terms and conditional all-size compiler, +analytic, routing/recovery and fixed finite-alphabet tape assumptions remain. diff --git a/research/circuit-space-clearing/compiler.py b/research/circuit-space-clearing/compiler.py new file mode 100644 index 0000000000..05629a5a19 --- /dev/null +++ b/research/circuit-space-clearing/compiler.py @@ -0,0 +1,305 @@ +# All-rank profile-cost selection: Rohan Arun, with OpenAI Codex assistance. +# Derived from Dominik Scholz PR63, Chafik Boukhalfa PR60, Avi Eisenberg PR62 +# and eumemic PR57. Apache-2.0; all inherited notices remain applicable. +# Circuit-space experiment: XOR fundamental dependencies to change clearing +# expressions, not merely the choice of a retired slot. Prepared with +# substantial OpenAI GPT-6 Astra/Codex assistance at Dominik Scholz's request. +"""Exact-envelope block synthesis on the pinned PR48 scalar graph. +Experimental finite compiler; no fixed-I+J profile or multiplication claim. +""" +# Derived from eumemic's PR57 compiler; original notices remain applicable. +# Descending-rank reclamation priority: Chafik Boukhalfa, with OpenAI Codex assistance. +import sys +if sys.flags.optimize: + raise ValueError('Assertions must remain enabled') +sys.dont_write_bytecode=True +from pathlib import Path +ROOT=Path(__file__).resolve().parents[2]/'references/frame-compiler/pr48' +from hashlib import sha256 +import json +manifest=json.loads((ROOT/'SOURCE.json').read_text()) +for name,digest in manifest['files'].items(): + assert sha256((ROOT/name).read_bytes()).hexdigest()==digest, 'Changed producer source: '+name +sys.path[:0]=[str(ROOT/'scripts'),str(ROOT/'research/copied-fixed')] +from changed_graph import graph +from collections import defaultdict,Counter,deque +import argparse,json,time,struct + +def independent(rows,vec): + for row in rows: + vec=min(vec,vec^row) + return bool(vec) +def basis(rows): + out=[] + for vec in rows: + for row in out:vec=min(vec,vec^row) + if vec:out.append(vec) + return out + +def build(h): + c=graph(h);groups={};owner={};signal={};blocks=[] + for x in sorted(c.active): + key=(c.core[x],c.union[x]) + if key not in groups: + groups[key]=len(blocks);blocks.append(dict(nodes=[],frame=key,inputs=set(),uses=[])) + g=groups[key];owner[x]=g;blocks[g]['nodes'].append(x) + signal[x]=(signal[c.args[x][0]]^signal[c.args[x][1]])if c.args[x]else 1<<(x-1) + for x in sorted(c.active): + for y in c.args[x]or(): + if owner[y]!=owner[x]:blocks[owner[x]]['inputs'].add(y) + uses=[];value_uses=defaultdict(list) + for g,b in enumerate(blocks): + b['inputs']=sorted(b['inputs']);b['source']=not c.args[b['nodes'][0]] + for y in b['inputs']: + k=len(uses);uses.append((y,g,None));value_uses[y].append(k);blocks[owner[y]]['uses'].append(k) + for target,x in c.outputs.items(): + k=len(uses);uses.append((x,owner[x],target));value_uses[x].append(k);blocks[owner[x]]['uses'].append(k) + for g,b in enumerate(blocks): + b['rank']=1 if b['source']else b['frame'][1].bit_count()-b['frame'][0].bit_count() + order=sorted(range(len(blocks)),key=lambda g:(blocks[g]['rank'],min(blocks[g]['nodes']))) + place={g:i for i,g in enumerate(order)} + def contained(a,b):return not(b[0]&~a[0])and not(a[1]&~b[1]) + for g,b in enumerate(blocks): + coeff={y:1<1 for b in blocks) + def new(g): + s=len(slots);slots.append(0);frames.append(g);hist[blocks[g]['rank']]+=1;events.append((s,-1,g));return s + def raise_(s,g): + old=frames[s];assert contains(blocks[old]['frame'],blocks[g]['frame']);hist[blocks[g]['rank']-blocks[old]['rank']]+=1;frames[s]=g;events.append((s,old,g)) + def xor(a,b,g): + assert a!=b;raise_(a,g);raise_(b,g);slots[a]^=slots[b];ops.append((a,b,g)) + import subprocess,struct + from binary_frame_math import logs + # Integer midpoint enclosures give a reproducible discovery score. + # Every candidate is independently checked by the complete exact screen. + weights=[0]+[int(t*sum(logs(t))*10**30//2) for t in range(1,h+1)] + oracle_input=Path(ORACLE_INPUT) + with oracle_input.open('wb') as stream: + stream.write(struct.pack('<6I2Q',h,v,0,len(blocks)+2,0,0,h*(h-1),h*(h-1))) + stream.write(struct.pack('<2QI',0,0,0));stream.write(struct.pack('<2QI',0,0,h)) + for b in blocks:stream.write(struct.pack('<2QI',*b['frame'],b['rank'])) + oracle=subprocess.Popen([ORACLE_EXE,str(oracle_input)],stdin=subprocess.PIPE,stdout=subprocess.PIPE,text=True,bufsize=1) + oracles.append(oracle) + cache={} + def profile_entropy(a,b): + if (a,b) not in cache: + oracle.stdin.write(f'{a} {b}\n');oracle.stdin.flush() + answer=oracle.stdout.readline() + assert answer, 'profile oracle failed' + parts=list(map(int,answer.split()));assert len(parts)==h+1 + cache[a,b]=sum(n*w for n,w in zip(parts,weights)) + return cache[a,b] + def profile_cost(a,g): + old=frames[a]+2;target=g+2 + return profile_entropy(old,1)-profile_entropy(old,target)-profile_entropy(target,1) + def acquire(g,anchors): + if reclaim: + bb={} + def ins(s): + row=slots[s];expr=1<>s&1;e^=1<>target)&1 + rest=expr^(1<>i&1) + if j!=i: + # Synthesize swap as three XORs at the single common frame. + for a,z in ((i,j),(j,i),(i,j)):rr[a]^=rr[z];elim.append((a,z)) + for j in range(len(ins)): + if j!=i and rr[j]>>i&1:rr[j]^=rr[i];elim.append((j,i)) + assert rr==[1<>i&1:xor(s,value_slots[y],g) + assert slots[s]==signal[x];value_slots[x]=s + used=set() + for u in outuses: + x=uses[u][0];s=value_slots[x] + if x in used: + ss=acquire(g,list(value_slots.values()));xor(ss,s,g);s=ss + used.add(x);assert u not in assign;assign[u]=s + if step%5000==0:print('compile',h,step,len(slots),'reclaimed',stats['reclaimed'],'seconds',time.time()-t0,flush=True,file=sys.stderr) + output_slots=[];output_records=[];scatter=[0]*v;J=[] + for u,(x,g,target)in enumerate(uses): + if target is None:continue + s=assign[u];assert slots[s]==signal[x];raise_(s,g);output_slots.append(s) + common,triple=target;output_records.append((s,g,common,triple)) + targets=[i for i,t in enumerate(c.inputs)if common in t]if len(triple)==1 else[c.inputs.index(triple)] + for i in targets:scatter[i]^=slots[s];J.append((v+i,2*v+s)) + rank=blocks[g]['rank'] + if len(triple)==1:hist[rank]+=1;hist[h-rank]+=1 + else:hist[h-1-rank]+=1;hist[1]+=1 + assert len(set(output_slots))==len(output_slots) + for s in retired:hist[h-blocks[frames[s]]['rank']]+=1 + assert len(retired)+len(output_slots)==len(slots) + assert scatter==[1<, the carrier matching is read from a pinned file +// instead of Hopcroft-Karp. Every pinned edge must lie in the same admissible +// adjacency (causal order and frame inclusion); donors and uses are distinct. +// This replay-only adaptation omits the discovery edge dumper. The original +// optimizer and profiler are preserved in references/copied-fixed/pr44. +// Replay-only adaptation prepared with OpenAI Codex assistance. +// Prepared by Rohan Arun with Anthropic Claude assistance. Apache-2.0. +// Adapted at h=23,25; original PR35 by Dominik Scholz, PR32 by icekylinx. +// Dimension adaptation at 45/47; extra primes for all source-growth cases. +// Exact bounded-minor inequalities are checked by verify.py. Original credit below. +// Copyright 2026 icekylinx. Apache-2.0; AI-assisted handoff integration. +// Original round3_rankone_profiles.cpp. Requires GCC/Clang unsigned __int128. + +// Adapted input reader for complete serialized frame-compiler transitions. +// Actual-word fixed-I+J profiling, adapted from PR48 profiles.cpp. +// All projector, pivot and CRT formulas below are unchanged. +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +using U=uint32_t;using V=uint64_t; +#include "binary_io.hpp" +int main(int argc,char**argv){ +assert(argc==2);std::ifstream f(argv[1],std::ios::binary);U hdr[6];read_array(f,hdr); +U h=hdr[0],v=hdr[1],R=hdr[2],nf=hdr[3],nt=hdr[4];int64_t singles=hdr[5];assert(h==23||h==25); +V sum,loss;f.read(reinterpret_cast(&sum),8);f.read(reinterpret_cast(&loss),8); +struct Frame{V core,cover;U rank;};std::vectorframes; +for(U i=0;i(&a.core),8);f.read(reinterpret_cast(&a.cover),8);f.read(reinterpret_cast(&a.rank),4);frames.push_back(a);} +std::map,int64_t>transitions; +for(U i=0;i(&a),4);f.read(reinterpret_cast(&b),4);f.read(reinterpret_cast(&count),8);transitions[{a,b}]=count;} +assert(f);assert(sum==h*V(R)+loss); +V p=2305843009213693951ULL; +auto mul=[&](V a,V b)->V{return (__uint128_t)a*b%p;}; +auto power=[&](V a,V b)->V{V r=1;for(;b;b>>=1,a=mul(a,a))if(b&1)r=mul(r,a);return r;}; +auto sub=[&](V a,V b)->V{return (a+p-b)%p;}; +std::vector>matrix_cache(frames.size()); +auto matrix=[&](U id)->const std::vector&{auto&A=matrix_cache[id];if(!A.empty())return A;A.assign(h*h,0);if(id==0)return A;if(id==1){for(U i=0;i>i)&1);V zj=((f.core>>j)&1)?3*(h+1)-10:p-10;A[i*h+j]=mul(mul(wi,zj),factor);}return A;} + assert(c==1||c==2);V s=3-c,d=s*s+(c-1)*nn,den=3*(h+1)*d,inv=power(den,p-2); + for(U i=0;i>i)&1,oj=(out>>j)&1,wi=3+((f.core>>i)&1),zj=((f.core>>j)&1)?3*(h+1)-10:p-10; + V num=(mul(s*oi,zj)+3*(h+1)*s*wi*oj+mul(nn*wi,zj))%p;num=sub(num,3*(h+1)*(c-1)*oi*oj);A[i*h+j]=(V(i==j&&oi)+mul(num,inv))%p; + }return A;}; + +std::vectorblocks(h+1);blocks[1]=singles;V done=0,matrices=0,crt_matrices=0,crt_disagreements=0;U longest=0;std::mapcorrection_hist; +U aa,bb; +while(std::cin>>aa>>bb){ + assert(aa=frames[aa].rank); + if(rr<=2){blocks[1]=rr; for(U t=0;t<=h;t++)std::cout<1&&bb>1){ + assert(!(frames[bb].core&~frames[aa].core)); + assert(!(frames[aa].cover&~frames[bb].cover)); + U ca=popcount64(frames[aa].core),cb=popcount64(frames[bb].core); + assert(ca==3||frames[aa].core==frames[bb].core||(ca==2&&cb==1)); + } + const auto&A=matrix(aa);const auto&B=matrix(bb);std::vectorM(h*h);for(U x=0;x>pivots; + for(U i=0;i=0&&!M[i*h+j])j--;if(j<0)continue;pivots.push_back({i,U(j)});V inv=power(M[i*h+j],p-2);for(U k=i+1;k core-one use all three primes at these dimensions. +if(aa>1&&bb>1&&(popcount64(frames[aa].core)==3||(popcount64(frames[aa].core)==2&&popcount64(frames[bb].core)==1))){ + assert(h==23||h==25);crt_matrices++;matrix_cache[aa].clear();matrix_cache[bb].clear();std::vector>> all{pivots}; + for(V extra:{2147483647ULL,524287ULL}){p=extra;matrix_cache[aa].clear();matrix_cache[bb].clear();const auto&C=matrix(aa);const auto&D=matrix(bb);std::vectorY(h*h);for(U z=0;z> pp; + for(U i=0;i=0&&!Y[i*h+j])j--;if(j<0)continue;pp.push_back({i,U(j)});V inv=power(Y[i*h+j],p-2);for(U k=i+1;k corner((h+1)*(h+1));for(U i=0;i=j;best=std::max(best,rank);}corner[(i+1)*(h+1)+j]=best;} + pivots.clear();for(U i=0;i= j+1 proves persistence.", + "common_cutoff": 14000000000000, + "cutoff_log2_input": { + "alpha": 6143424401, + "compact": 24573697601, + "geometry": 3999931954323, + "guard": 4349946, + "log_p": 25, + "normalization": 14000000000000, + "period": 49147395201, + "phase_cell": 19, + "reservoir": 14, + "stopped_leaf": 252 + }, + "power_checkpoints": [ + { + "log2_input": 14000000000000, + "powers": { + "alpha": { + "exponent": 714467976, + "rhs": 112000000156824, + "rhs_bits": 47 + }, + "compact": { + "exponent": 714467976, + "rhs": 448000000627232, + "rhs_bits": 49 + }, + "leaf": { + "exponent": 666666666666, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 714467976, + "rhs": 224000000313576, + "rhs_bits": 48 + }, + "rows": { + "exponent": 714467976, + "rhs": 112000000156824000, + "rhs_bits": 57 + } + } + }, + { + "log2_input": 28000000000000, + "powers": { + "alpha": { + "exponent": 1428935953, + "rhs": 224000000156824, + "rhs_bits": 48 + }, + "compact": { + "exponent": 1428935953, + "rhs": 896000000627232, + "rhs_bits": 50 + }, + "leaf": { + "exponent": 1333333333333, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 1428935953, + "rhs": 448000000313576, + "rhs_bits": 49 + }, + "rows": { + "exponent": 1428935953, + "rhs": 224000000156824000, + "rhs_bits": 58 + } + } + }, + { + "log2_input": 56000000000000, + "powers": { + "alpha": { + "exponent": 2857871906, + "rhs": 448000000156824, + "rhs_bits": 49 + }, + "compact": { + "exponent": 2857871906, + "rhs": 1792000000627232, + "rhs_bits": 51 + }, + "leaf": { + "exponent": 2666666666666, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 2857871906, + "rhs": 896000000313576, + "rhs_bits": 50 + }, + "rows": { + "exponent": 2857871906, + "rhs": 448000000156824000, + "rhs_bits": 59 + } + } + }, + { + "log2_input": 112000000000000, + "powers": { + "alpha": { + "exponent": 5715743812, + "rhs": 896000000156824, + "rhs_bits": 50 + }, + "compact": { + "exponent": 5715743812, + "rhs": 3584000000627232, + "rhs_bits": 52 + }, + "leaf": { + "exponent": 5333333333333, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 5715743812, + "rhs": 1792000000313576, + "rhs_bits": 51 + }, + "rows": { + "exponent": 5715743812, + "rhs": 896000000156824000, + "rhs_bits": 60 + } + } + }, + { + "log2_input": 224000000000000, + "powers": { + "alpha": { + "exponent": 11431487624, + "rhs": 1792000000156824, + "rhs_bits": 51 + }, + "compact": { + "exponent": 11431487624, + "rhs": 7168000000627232, + "rhs_bits": 53 + }, + "leaf": { + "exponent": 10666666666666, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 11431487624, + "rhs": 3584000000313576, + "rhs_bits": 52 + }, + "rows": { + "exponent": 11431487624, + "rhs": 1792000000156824000, + "rhs_bits": 61 + } + } + }, + { + "log2_input": 448000000000000, + "powers": { + "alpha": { + "exponent": 22862975248, + "rhs": 3584000000156824, + "rhs_bits": 52 + }, + "compact": { + "exponent": 22862975248, + "rhs": 14336000000627232, + "rhs_bits": 54 + }, + "leaf": { + "exponent": 21333333333333, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 22862975248, + "rhs": 7168000000313576, + "rhs_bits": 53 + }, + "rows": { + "exponent": 22862975248, + "rhs": 3584000000156824000, + "rhs_bits": 62 + } + } + } + ], + "practical_runtime_claim": false + }, + "kappa": "637939/12500000000", + "next_kappa": "5103513/100000000000", + "next_kappa_rejection": "{'g1_above_kappa': '-18586437625752828145451/5000255188649999489622700000000000', 'g3_above_kappa': '-235866928144028276350737/50002551886499994896227000000000000', 'g5_above_kappa': '-347385553898545245223443/80004083018399991833963200000000000', 'g6_above_kappa': '-1536917561946726246532307/400020415091999959169816000000000000'}" + }, + "comparison": { + "difference": "683316741/500000000000000000", + "pr67_commit": "b3745601e947a94316bf25c2c6263d93c06e3364", + "pr67_kappa": "10206752116843/200000000000000000", + "pr68_kappa": "2551469/50000000000" + }, + "finite_bridge": { + "bit": { + "W": 137151806, + "halving_degree": 9, + "m": 575, + "maxchild": 529, + "wire_bits": 28 + }, + "complex": { + "W": 537696432, + "halving_degree": 20, + "m": 784, + "maxchild": 756, + "s": 421548223824, + "scalar_group_upper": 4793351472, + "scalar_terms": [ + { + "c": 78437, + "copied_center_extra_groups": 56, + "h": 28, + "invocations": 3276, + "local_group_upper": 729892, + "v": 3276 + }, + { + "c": 78437, + "copied_center_extra_groups": 56, + "h": 28, + "invocations": 3276, + "local_group_upper": 729892, + "v": 3276 + } + ], + "wire_bits": 30 + }, + "rows": { + "coefficient": 852, + "contract": "W_complex^D_complex * W_bit^D_bit; one preceding prefix and padding; all temporary copies sequential", + "degree": 2000, + "degree_gap": "6548/25", + "suffix_slope": 8000 + }, + "semantic": { + "B": 9696565176891520488614054257040, + "C0": 2358858462850846165593256368932965330169899180021667007021321420800, + "C1": 1, + "E": 9696565176891520488192506033216, + "induction_gap": 533311084729033626873772984137200, + "literal_charge": 2771683137698171397039558468, + "strict_literal_gap": 9693793493753822316795466474748 + } + }, + "kappa": "51035127217697/1000000000000000000", + "pending_full_replay_axes": [ + 23, + 25 + ], + "preferred": { + "assembly": { + "absorption_gap": "3469338390122800566294506779/5050762816827953994568364293000000000000000000", + "constraints": { + "K_dominates_log": "257766324165858014161339005431635707/5050762816827953994568364293000000000000", + "K_geometry": "3788136554202953994568364293/5050762816827953994568364293000000000000", + "a_below_b": "20662268065007/1000000000000000000", + "a_positive": "51037731934993/1000000000000000000", + "alpha_below_one": "10101010101005050762816827953994568364293/10101525633655907989136728586000000000000", + "alpha_below_one_fourth": "2524865875763119770964281514494568364293/10101525633655907989136728586000000000000", + "alpha_positive": "515532650857226319900632005431635707/10101525633655907989136728586000000000000", + "artificial_boundary": "282844779873004207940825798613983705092879/40406102534623631956546914344000000000000", + "b_below_one_over32": "311783/10000000", + "beta_below_one": "19/20", + "beta_positive": "1/20", + "c_below_one": "499974481133907554537731934993/500000000000000000000000000000", + "c_positive": "25518866092445462268065007/500000000000000000000000000000", + "cell_above_band": "10101010100994949237183172046005431635707/20203051267311815978273457172000000000000", + "compact_leaf": "8538634032554537731934993/500000000000000000000000000000", + "compact_reservations": "1/4000000000000", + "delta_below_one_eighth": "999999999999/8000000000000", + "delta_positive": "1/8000000000000", + "epsilon_below_one": "257766327953994568364293/5050762816827953994568364293", + "epsilon_positive": "5050505050500000000000000000/5050762816827953994568364293", + "g1_above_kappa": "5050766286166344117368930587506779/5050762816827953994568364293000000000000000000", + "g2_above_kappa": "162794831/62500000000000000", + "g3_above_kappa": "3469338390122800566294506779/5050762816827953994568364293000000000000000000", + "g4_above_kappa": "162794831/62500000000000000", + "g5_above_kappa": "1894039525648872870763702904381779/5050762816827953994568364293000000000000000000", + "g6_above_kappa": "4419420934062849868047885050881779/5050762816827953994568364293000000000000000000", + "g7_above_kappa": "5050247284177096771717802051117368930587506779/5050762816827953994568364293000000000000000000", + "gamma_sublinear": "1/2000000000000", + "guard_width": "257766327953994568364293/5050762816827953994568364293", + "lambda_above_internal": "51037731934993/1000000000000000000000000000000", + "lambda_above_sigma": "20662268065058037731934993/1000000000000000000000000000000", + "lambda_above_tau": "51037731934993/1000000000000000000000000000000", + "lambda_prime_above_lambda": "51037731934993/1000000000000000000000000000000", + "lambda_prime_below_one": "25518865967445462268065007/500000000000000000000000000000", + "literal_scalar_guard": "9693793493753822316795466474748", + "phase_boundary": "412426119675628492554914805431635707/8081220506924726391309382868800000000000", + "phase_leaf_above_bit": "17077268065007/1000000000000000000", + "phase_local": "2062130618581193730086390005431635707/40406102534623631956546914344000000000000", + "prime_interval_packing": "257766327953994568364293/5050762816827953994568364293", + "q_below_internal": "51037731934993/500000000000000000000000000000", + "q_below_leaf": "8538634032554537731934993/500000000000000000000000000000", + "q_below_reservations": "1/4000000000000", + "q_positive": "25518865967445462268065007/500000000000000000000000000000", + "record_suffix": "257766327953994568364293/5050762816827953994568364293", + "row_product_gap": "6548/25", + "short_record_fallback": "5050247271021287504732350425172860402181595051/5050762816827953994568364293000000000000000000", + "small_field_exposure": "1/1000000000000" + }, + "finite_bridge": { + "bit": { + "W": 137151806, + "halving_degree": 9, + "m": 575, + "maxchild": 529, + "wire_bits": 28 + }, + "complex": { + "W": 537696432, + "halving_degree": 20, + "m": 784, + "maxchild": 756, + "s": 421548223824, + "scalar_group_upper": 4793351472, + "wire_bits": 30 + }, + "rows": { + "coefficient": 852, + "degree": 2000, + "degree_gap": "6548/25", + "suffix_slope": 8000 + }, + "semantic": { + "B": 9696565176891520488614054257040, + "C0": 2358858462850846165593256368932965330169899180021667007021321420800, + "C1": 1, + "E": 9696565176891520488192506033216, + "induction_gap": 533311084729033626873772984137200, + "literal_charge": 2771683137698171397039558468, + "strict_literal_gap": 9693793493753822316795466474748 + } + }, + "margins": { + "g1": "257766327953994568364293/5050762816827953994568364293", + "g2": "51037731934993/1000000000000000000", + "g3": "257766322903231751536339005431635707/5050762816827953994568364293000000000000", + "g4": "51037731934993/1000000000000000000", + "g5": "412426119675628492554914805431635707/8081220506924726391309382868800000000000", + "g6": "2062130618581193730086390005431635707/40406102534623631956546914344000000000000", + "g7": "5050505050500000000000000000/5050762816827953994568364293" + }, + "minimum_margin": "257766322903231751536339005431635707/5050762816827953994568364293000000000000", + "parameters": { + "C0": 2358858462850846165593256368932965330169899180021667007021321420800, + "C1": "1", + "a_bit": "51037731934993/1000000000000000000", + "a_complex": "717/10000000", + "alpha_squared_power": "515532650857226319900632005431635707/10101525633655907989136728586000000000000", + "beta": "1/20", + "c": "25518866092445462268065007/500000000000000000000000000000", + "delta": "1/8000000000000", + "epsilon": "5050505050500000000000000000/5050762816827953994568364293", + "h": "1/1000000000000", + "kappa": "51035127217697/1000000000000000000", + "lambda_": "999948962268065058037731934993/1000000000000000000000000000000", + "lambda_prime": "499974481134032554537731934993/500000000000000000000000000000", + "q": "25518865967445462268065007/500000000000000000000000000000", + "sigma": "9999283/10000000", + "tau": "999948962268065007/1000000000000000000" + }, + "recurrence": { + "internal": "999948962268065007/1000000000000000000", + "leaf": "199986377/200000000", + "reservations": "499974481133907554537731934993/500000000000000000000000000000" + }, + "scoped_limit": "51037731934993/1000051037731934993" + }, + "eventual_bounds": { + "additional_eventual_conditions": [ + "BHP prime threshold and distinct-prime packing", + "Fixed rational basis, eligible common prime and native table setup", + "Catalogue/descriptor domination, logarithm absorption, exact recovery" + ], + "all_interval_argument": "For [Z,Z+k), bound RHS at Z+k and LHS at floor(Z/k). Successive intervals double LHS; the positive affine RHS grows at most linearly, so 2^j >= j+1 proves persistence.", + "common_cutoff": 14000000000000, + "cutoff_log2_input": { + "alpha": 6143424401, + "compact": 24573697601, + "geometry": 3999931954320, + "guard": 4349945, + "log_p": 25, + "normalization": 14000000000000, + "period": 49147395201, + "phase_cell": 19, + "reservoir": 14, + "stopped_leaf": 252 + }, + "power_checkpoints": [ + { + "log2_input": 14000000000000, + "powers": { + "alpha": { + "exponent": 714467976, + "rhs": 112000000156824, + "rhs_bits": 47 + }, + "compact": { + "exponent": 714467976, + "rhs": 448000000627232, + "rhs_bits": 49 + }, + "leaf": { + "exponent": 666666666666, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 714467976, + "rhs": 224000000313576, + "rhs_bits": 48 + }, + "rows": { + "exponent": 714467976, + "rhs": 112000000156824000, + "rhs_bits": 57 + } + } + }, + { + "log2_input": 28000000000000, + "powers": { + "alpha": { + "exponent": 1428935953, + "rhs": 224000000156824, + "rhs_bits": 48 + }, + "compact": { + "exponent": 1428935953, + "rhs": 896000000627232, + "rhs_bits": 50 + }, + "leaf": { + "exponent": 1333333333333, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 1428935953, + "rhs": 448000000313576, + "rhs_bits": 49 + }, + "rows": { + "exponent": 1428935953, + "rhs": 224000000156824000, + "rhs_bits": 58 + } + } + }, + { + "log2_input": 56000000000000, + "powers": { + "alpha": { + "exponent": 2857871906, + "rhs": 448000000156824, + "rhs_bits": 49 + }, + "compact": { + "exponent": 2857871906, + "rhs": 1792000000627232, + "rhs_bits": 51 + }, + "leaf": { + "exponent": 2666666666666, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 2857871906, + "rhs": 896000000313576, + "rhs_bits": 50 + }, + "rows": { + "exponent": 2857871906, + "rhs": 448000000156824000, + "rhs_bits": 59 + } + } + }, + { + "log2_input": 112000000000000, + "powers": { + "alpha": { + "exponent": 5715743812, + "rhs": 896000000156824, + "rhs_bits": 50 + }, + "compact": { + "exponent": 5715743812, + "rhs": 3584000000627232, + "rhs_bits": 52 + }, + "leaf": { + "exponent": 5333333333333, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 5715743812, + "rhs": 1792000000313576, + "rhs_bits": 51 + }, + "rows": { + "exponent": 5715743812, + "rhs": 896000000156824000, + "rhs_bits": 60 + } + } + }, + { + "log2_input": 224000000000000, + "powers": { + "alpha": { + "exponent": 11431487624, + "rhs": 1792000000156824, + "rhs_bits": 51 + }, + "compact": { + "exponent": 11431487624, + "rhs": 7168000000627232, + "rhs_bits": 53 + }, + "leaf": { + "exponent": 10666666666666, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 11431487624, + "rhs": 3584000000313576, + "rhs_bits": 52 + }, + "rows": { + "exponent": 11431487624, + "rhs": 1792000000156824000, + "rhs_bits": 61 + } + } + }, + { + "log2_input": 448000000000000, + "powers": { + "alpha": { + "exponent": 22862975248, + "rhs": 3584000000156824, + "rhs_bits": 52 + }, + "compact": { + "exponent": 22862975248, + "rhs": 14336000000627232, + "rhs_bits": 54 + }, + "leaf": { + "exponent": 21333333333333, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 22862975248, + "rhs": 7168000000313576, + "rhs_bits": 53 + }, + "rows": { + "exponent": 22862975248, + "rhs": 3584000000156824000, + "rhs_bits": 62 + } + } + } + ], + "practical_runtime_claim": false + }, + "kappa": "51035127217697/1000000000000000000", + "next_kappa": "25517563608849/500000000000000000", + "next_kappa_rejection": "{'g3_above_kappa': '-790712213352576714136928757/2525381408413976997284182146500000000000000000'}" + }, + "rejected_moment": { + "degree": 8, + "lower": "17143975750000000003096267798449313093788928248403/17143975750000000000000000000000000000000000000000", + "rounding_denominator": 10000000000000000000000000000000000000000, + "saving": "25518865967497/500000000000000000", + "strict_gap": "-6192535596898627937649933363577/34287951500000000000000000000000000000000000000000", + "terms": { + "1": { + "exp_lower": "10003243652297860942700414176592164537301/10000000000000000000000000000000000000000", + "exp_upper": "10003243652297860942700414176592165048939/10000000000000000000000000000000000000000", + "log_lower": "3177185020398675220004135749131/500000000000000000000000000000", + "log_upper": "6354370040797350440008271498263/1000000000000000000000000000000", + "weight": "14988573/685759030" + }, + "10": { + "exp_lower": "78141157445106220567219945817632668973/78125000000000000000000000000000000000", + "exp_upper": "10002068152973596232604153064656982139047/10000000000000000000000000000000000000000", + "log_lower": "2025892473901652377995140021789/500000000000000000000000000000", + "log_upper": "4051784947803304755990280043579/1000000000000000000000000000000", + "weight": "386598/342879515" + }, + "11": { + "exp_lower": "10002019498877502713882596898857800879193/10000000000000000000000000000000000000000", + "exp_upper": "1000201949887750271388259689885780138969/1000000000000000000000000000000000000000", + "log_lower": "3956474767998979895946327920297/1000000000000000000000000000000", + "log_upper": "1978237383999489947973163960149/500000000000000000000000000000", + "weight": "188299/155854325" + }, + "12": { + "exp_lower": "10001975081374469384553630244366605850671/10000000000000000000000000000000000000000", + "exp_upper": "10001975081374469384553630244366606361163/10000000000000000000000000000000000000000", + "log_lower": "3869463391009350129778562018423/1000000000000000000000000000000", + "log_upper": "483682923876168766222320252303/125000000000000000000000000000", + "weight": "1634448/1714397575" + }, + "13": { + "exp_lower": "312560444418961095495464516633010151607/312500000000000000000000000000000000000", + "exp_upper": "10001934221406755055854864532256325361911/10000000000000000000000000000000000000000", + "log_lower": "3789420683335813703954784056697/1000000000000000000000000000000", + "log_upper": "1894710341667906851977392028349/500000000000000000000000000000", + "weight": "14911/16725830" + }, + "14": { + "exp_lower": "10001896391134316521864039363302774852299/10000000000000000000000000000000000000000", + "exp_upper": "10001896391134316521864039363302775362783/10000000000000000000000000000000000000000", + "log_lower": "3715312711182091825485686633361/1000000000000000000000000000000", + "log_upper": "1857656355591045912742843316681/500000000000000000000000000000", + "weight": "29834/41814575" + }, + "15": { + "exp_lower": "5000930586060936186727579466077093196007/5000000000000000000000000000000000000000", + "exp_upper": "2000372234424374474691031786430837380499/2000000000000000000000000000000000000000", + "log_lower": "3646319839695140374012266928113/1000000000000000000000000000000", + "log_upper": "1823159919847570187006133464057/500000000000000000000000000000", + "weight": "439647/685759030" + }, + "16": { + "exp_lower": "10001828227048203914293607436064245871423/10000000000000000000000000000000000000000", + "exp_upper": "10001828227048203914293607436064246381901/10000000000000000000000000000000000000000", + "log_lower": "3581781318557569202339343012429/1000000000000000000000000000000", + "log_upper": "358178131855756920233934301243/100000000000000000000000000000", + "weight": "65416/155854325" + }, + "17": { + "exp_lower": "10001797280007315667453771631143546860931/10000000000000000000000000000000000000000", + "exp_upper": "5000898640003657833726885815571773685703/5000000000000000000000000000000000000000", + "log_lower": "3521156696741134359758736880389/1000000000000000000000000000000", + "log_upper": "352115669674113435975873688039/100000000000000000000000000000", + "weight": "3553051/1714397575" + }, + "18": { + "exp_lower": "10001768102448751083850009443160278455877/10000000000000000000000000000000000000000", + "exp_upper": "200035362048975021677000188863205579327/200000000000000000000000000000000000000", + "log_lower": "3463998282901185747800548902959/1000000000000000000000000000000", + "log_upper": "43299978536264821847506861287/12500000000000000000000000000", + "weight": "363168/1714397575" + }, + "19": { + "exp_lower": "100017405029243517457102341239194777517/100000000000000000000000000000000000000", + "exp_upper": "10001740502924351745710234123919478262171/10000000000000000000000000000000000000000", + "log_lower": "1704965530815454989999622033187/500000000000000000000000000000", + "log_upper": "27279448493047279839993952531/8000000000000000000000000000", + "weight": "25137/311708650" + }, + "2": { + "exp_lower": "250072244430196089712977946286352488027/250000000000000000000000000000000000000", + "exp_upper": "1250361222150980448564889731431762503999/1250000000000000000000000000000000000000", + "log_lower": "1415305715059351282647759844201/250000000000000000000000000000", + "log_upper": "1132244572047481026118207875361/200000000000000000000000000000", + "weight": "156864/74539025" + }, + "20": { + "exp_lower": "500085715973404161503231268632382040409/500000000000000000000000000000000000000", + "exp_upper": "10001714319468083230064625372647641318649/10000000000000000000000000000000000000000", + "log_lower": "83965944181083986164326198053/25000000000000000000000000000", + "log_upper": "3358637767243359446573047922121/1000000000000000000000000000000", + "weight": "26402/342879515" + }, + "21": { + "exp_lower": "1250211176729624841992898398137157652093/1250000000000000000000000000000000000000", + "exp_upper": "10001689413836998735943187185097261727211/10000000000000000000000000000000000000000", + "log_lower": "413730950384240930438459189737/125000000000000000000000000000", + "log_upper": "3309847603073927443507673517897/1000000000000000000000000000000", + "weight": "12978/2981561" + }, + "22": { + "exp_lower": "5000832833546589340484062642940726006177/5000000000000000000000000000000000000000", + "exp_upper": "500083283354658934048406264294072626141/500000000000000000000000000000000000000", + "log_lower": "3263327587439034586529095798839/1000000000000000000000000000000", + "log_upper": "81583189685975864663227394971/25000000000000000000000000000", + "weight": "77/2833715" + }, + "23": { + "exp_lower": "10001642976168569565971871025433195129337/10000000000000000000000000000000000000000", + "exp_upper": "10001642976168569565971871025433195639801/10000000000000000000000000000000000000000", + "log_lower": "804718956217050187300379666613/250000000000000000000000000000", + "log_upper": "3218875824868200749201518666453/1000000000000000000000000000000", + "weight": "11447/542102" + }, + "25": { + "exp_lower": "10001600413185219058786109530812447841387/10000000000000000000000000000000000000000", + "exp_upper": "10001600413185219058786109530812448351849/10000000000000000000000000000000000000000", + "log_lower": "313549421592914969080675283181/100000000000000000000000000000", + "log_upper": "3135494215929149690806752831811/1000000000000000000000000000000", + "weight": "11641/566743" + }, + "3": { + "exp_lower": "10002682779353587732932704355316579205649/10000000000000000000000000000000000000000", + "exp_upper": "5001341389676793866466352177658289858181/5000000000000000000000000000000000000000", + "log_lower": "262787887606462037430651313067/50000000000000000000000000000", + "log_upper": "5255757752129240748613026261341/1000000000000000000000000000000", + "weight": "2928216/1714397575" + }, + "4": { + "exp_lower": "10002535914636523537689449810374397115903/10000000000000000000000000000000000000000", + "exp_upper": "10002535914636523537689449810374397626531/10000000000000000000000000000000000000000", + "log_lower": "2484037839838729910586903627673/500000000000000000000000000000", + "log_upper": "4968075679677459821173807255347/1000000000000000000000000000000", + "weight": "2227878/1714397575" + }, + "481": { + "exp_lower": "5000045552090299087980899488834167643293/5000000000000000000000000000000000000000", + "exp_upper": "10000091104180598175961798977668335796969/10000000000000000000000000000000000000000", + "log_lower": "35700554138317851917337677133/200000000000000000000000000000", + "log_upper": "89251385345794629793344192833/500000000000000000000000000000", + "weight": "13468/271051" + }, + "5": { + "exp_lower": "10002421998996778269133681444150490099531/10000000000000000000000000000000000000000", + "exp_upper": "10002421998996778269133681444150490610111/10000000000000000000000000000000000000000", + "log_lower": "1186233032090812516351878041259/250000000000000000000000000000", + "log_upper": "4744932128363250065407512165037/1000000000000000000000000000000", + "weight": "871577/685759030" + }, + "525": { + "exp_lower": "10000046430040084233558774108036670669529/10000000000000000000000000000000000000000", + "exp_upper": "1000004643004008423355877410803667117991/1000000000000000000000000000000000000000", + "log_lower": "22742944551431673576538712861/250000000000000000000000000000", + "log_upper": "18194355641145338861230970289/200000000000000000000000000000", + "weight": "244461/566743" + }, + "529": { + "exp_lower": "2000008511234520906462120215790178528537/2000000000000000000000000000000000000000", + "exp_upper": "5000021278086302266155300539475446576533/5000000000000000000000000000000000000000", + "log_lower": "41690804469525529197382917321/500000000000000000000000000000", + "log_upper": "83381608939051058394765834643/1000000000000000000000000000000", + "weight": "116748/271051" + }, + "6": { + "exp_lower": "5001164462052515431580074634566098209843/5000000000000000000000000000000000000000", + "exp_upper": "10002328924105030863160149269132196930239/10000000000000000000000000000000000000000", + "log_lower": "4562610571569295439195794139881/1000000000000000000000000000000", + "log_upper": "2281305285784647719597897069941/500000000000000000000000000000", + "weight": "222567/155854325" + }, + "7": { + "exp_lower": "10002250231081030888505835800398896962693/10000000000000000000000000000000000000000", + "exp_upper": "10002250231081030888505835800398897473227/10000000000000000000000000000000000000000", + "log_lower": "4408459891742037134902918754819/1000000000000000000000000000000", + "log_upper": "220422994587101856745145937741/50000000000000000000000000000", + "weight": "5222609/3428795150" + }, + "8": { + "exp_lower": "625136379036466120521680509115587999541/625000000000000000000000000000000000000", + "exp_upper": "1250272758072932241043361018231176062897/1250000000000000000000000000000000000000", + "log_lower": "66795757798711164246196486467/15625000000000000000000000000", + "log_upper": "4274928499117514511756575133889/1000000000000000000000000000000", + "weight": "2316956/1714397575" + }, + "9": { + "exp_lower": "125026524223211999527447982891605927119/125000000000000000000000000000000000000", + "exp_upper": "1000212193785695996219583863132847468003/1000000000000000000000000000000000000000", + "log_lower": "4157145463461131057217781024417/1000000000000000000000000000000", + "log_upper": "2078572731730565528608890512209/500000000000000000000000000000", + "weight": "4272579/3428795150" + } + }, + "upper": "34287951500000000006192535596898627937649933363577/34287951500000000000000000000000000000000000000000" + }, + "scope": "Paid profile and exact arithmetic; explicitly pending dirty replay and broad tests. All inherited theorem interfaces remain conditional.", + "source_sha256": { + "research/cost-live-both/compiler.py": "58caca9b5336a2d50fcc45b56abfac60bbb795856b5c806ba4bfa5f649412642", + "research/cost-live-both/experiment.py": "1d04f6b9dfd1152b872043bf9e96350a384829ca219289ae00e75a0195382573", + "research/cost-live-both/profile_oracle.cpp": "d1f6b650de9fb5842b412595369271d9eeb6f54045c76c0fb5cad29854955c35", + "research/pair-assembly/pair_graph.py": "3d47e89d2649c90800a276bdd0480131def50e0bdf92c122a19494b55bf17420", + "research/slot-cost-rank-pair/arithmetic/refine.py": "8af4f9ed6cec841fe691b7f7950ca7b17483282e8869795922d29f10a4d49c16" + }, + "status": "Concrete exact candidate; full replay PENDING" +} diff --git a/research/cost-live-both/compiler.py b/research/cost-live-both/compiler.py new file mode 100644 index 0000000000..d10a33b5a6 --- /dev/null +++ b/research/cost-live-both/compiler.py @@ -0,0 +1,275 @@ +# Live-anchor composition of PR67 all-rank cost selection with PR68. +# Dominik Scholz with substantial OpenAI GPT-6 Astra assistance. +# All-rank profile-cost selection: Rohan Arun, with OpenAI Codex assistance. +# Derived from Dominik Scholz PR63, Chafik Boukhalfa PR60, Avi Eisenberg PR62 +# and eumemic PR57. Apache-2.0; all inherited notices remain applicable. +"""Exact-envelope block synthesis on the pinned PR48 scalar graph. +Experimental finite compiler; no fixed-I+J profile or multiplication claim. +""" +# Derived from eumemic's PR57 compiler; original notices remain applicable. +# Descending-rank reclamation priority: Chafik Boukhalfa, with OpenAI Codex assistance. +import sys +if sys.flags.optimize: + raise ValueError('Assertions must remain enabled') +sys.dont_write_bytecode=True +from pathlib import Path +ROOT=Path(__file__).resolve().parents[2]/'references/frame-compiler/pr48' +from hashlib import sha256 +import json +manifest=json.loads((ROOT/'SOURCE.json').read_text()) +for name,digest in manifest['files'].items(): + assert sha256((ROOT/name).read_bytes()).hexdigest()==digest, 'Changed producer source: '+name +sys.path[:0]=[str(ROOT/'scripts'),str(ROOT/'research/copied-fixed')] +from changed_graph import graph +from collections import defaultdict,Counter,deque +import argparse,json,time,struct + +def independent(rows,vec): + for row in rows: + vec=min(vec,vec^row) + return bool(vec) +def basis(rows): + out=[] + for vec in rows: + for row in out:vec=min(vec,vec^row) + if vec:out.append(vec) + return out + +def build(h): + c=graph(h);groups={};owner={};signal={};blocks=[] + for x in sorted(c.active): + key=(c.core[x],c.union[x]) + if key not in groups: + groups[key]=len(blocks);blocks.append(dict(nodes=[],frame=key,inputs=set(),uses=[])) + g=groups[key];owner[x]=g;blocks[g]['nodes'].append(x) + signal[x]=(signal[c.args[x][0]]^signal[c.args[x][1]])if c.args[x]else 1<<(x-1) + for x in sorted(c.active): + for y in c.args[x]or(): + if owner[y]!=owner[x]:blocks[owner[x]]['inputs'].add(y) + uses=[];value_uses=defaultdict(list) + for g,b in enumerate(blocks): + b['inputs']=sorted(b['inputs']);b['source']=not c.args[b['nodes'][0]] + for y in b['inputs']: + k=len(uses);uses.append((y,g,None));value_uses[y].append(k);blocks[owner[y]]['uses'].append(k) + for target,x in c.outputs.items(): + k=len(uses);uses.append((x,owner[x],target));value_uses[x].append(k);blocks[owner[x]]['uses'].append(k) + for g,b in enumerate(blocks): + b['rank']=1 if b['source']else b['frame'][1].bit_count()-b['frame'][0].bit_count() + order=sorted(range(len(blocks)),key=lambda g:(blocks[g]['rank'],min(blocks[g]['nodes']))) + place={g:i for i,g in enumerate(order)} + def contained(a,b):return not(b[0]&~a[0])and not(a[1]&~b[1]) + for g,b in enumerate(blocks): + coeff={y:1<1 for b in blocks) + def new(g): + s=len(slots);slots.append(0);frames.append(g);hist[blocks[g]['rank']]+=1;events.append((s,-1,g));return s + def raise_(s,g): + old=frames[s];assert contains(blocks[old]['frame'],blocks[g]['frame']);hist[blocks[g]['rank']-blocks[old]['rank']]+=1;frames[s]=g;events.append((s,old,g)) + def xor(a,b,g): + assert a!=b;raise_(a,g);raise_(b,g);slots[a]^=slots[b];ops.append((a,b,g)) + import subprocess,struct + from binary_frame_math import logs + # Integer midpoint enclosures give a reproducible discovery score. + # Every candidate is independently checked by the complete exact screen. + weights=[0]+[int(t*sum(logs(t))*10**30//2) for t in range(1,h+1)] + oracle_input=Path(ORACLE_INPUT) + with oracle_input.open('wb') as stream: + stream.write(struct.pack('<6I2Q',h,v,0,len(blocks)+2,0,0,h*(h-1),h*(h-1))) + stream.write(struct.pack('<2QI',0,0,0));stream.write(struct.pack('<2QI',0,0,h)) + for b in blocks:stream.write(struct.pack('<2QI',*b['frame'],b['rank'])) + oracle=subprocess.Popen([ORACLE_EXE,str(oracle_input)],stdin=subprocess.PIPE,stdout=subprocess.PIPE,text=True,bufsize=1) + oracles.append(oracle) + cache={} + def profile_entropy(a,b): + if (a,b) not in cache: + oracle.stdin.write(f'{a} {b}\n');oracle.stdin.flush() + answer=oracle.stdout.readline() + assert answer, 'profile oracle failed' + parts=list(map(int,answer.split()));assert len(parts)==h+1 + cache[a,b]=sum(n*w for n,w in zip(parts,weights)) + return cache[a,b] + def profile_cost(a,g): + old=frames[a]+2;target=g+2 + return profile_entropy(old,1)-profile_entropy(old,target)-profile_entropy(target,1) + def acquire(g,anchors): + if reclaim: + bb={} + def ins(s): + row=slots[s];expr=1<>s&1;e^=1<>i&1) + if j!=i: + # Synthesize swap as three XORs at the single common frame. + for a,z in ((i,j),(j,i),(i,j)):rr[a]^=rr[z];elim.append((a,z)) + for j in range(len(ins)): + if j!=i and rr[j]>>i&1:rr[j]^=rr[i];elim.append((j,i)) + assert rr==[1<>i&1:xor(s,value_slots[y],g) + assert slots[s]==signal[x];value_slots[x]=s + used=set() + for u in outuses: + x=uses[u][0];s=value_slots[x] + if x in used: + ss=acquire(g,list(value_slots.values()));xor(ss,s,g);s=ss + used.add(x);assert u not in assign;assign[u]=s;assert s not in pending;pending[s]=uses[u][1] + if step%5000==0:print('compile',h,step,len(slots),'reclaimed',stats['reclaimed'],'seconds',time.time()-t0,flush=True,file=sys.stderr) + output_slots=[];output_records=[];scatter=[0]*v;J=[] + for u,(x,g,target)in enumerate(uses): + if target is None:continue + s=assign[u];assert slots[s]==signal[x];raise_(s,g);output_slots.append(s) + common,triple=target;output_records.append((s,g,common,triple)) + targets=[i for i,t in enumerate(c.inputs)if common in t]if len(triple)==1 else[c.inputs.index(triple)] + for i in targets:scatter[i]^=slots[s];J.append((v+i,2*v+s)) + rank=blocks[g]['rank'] + if len(triple)==1:hist[rank]+=1;hist[h-rank]+=1 + else:hist[h-1-rank]+=1;hist[1]+=1 + assert len(set(output_slots))==len(output_slots) + for s in retired:hist[h-blocks[frames[s]]['rank']]+=1 + assert len(retired)+len(output_slots)==len(slots) + assert scatter==[1<1:high=mid + else:raise ArithmeticError('Fine moment enclosure inconclusive') + ab=Q(low,scale) + accepted=exact.exact_moment(575,profile['W'],rows,ab) + rejected=exact.exact_moment(575,profile['W'],rows,Q(high,scale)) + assert accepted['upper']<1, the carrier matching is read from a pinned file +// instead of Hopcroft-Karp. Every pinned edge must lie in the same admissible +// adjacency (causal order and frame inclusion); donors and uses are distinct. +// This replay-only adaptation omits the discovery edge dumper. The original +// optimizer and profiler are preserved in references/copied-fixed/pr44. +// Replay-only adaptation prepared with OpenAI Codex assistance. +// Prepared by Rohan Arun with Anthropic Claude assistance. Apache-2.0. +// Adapted at h=23,25; original PR35 by Dominik Scholz, PR32 by icekylinx. +// Dimension adaptation at 45/47; extra primes for all source-growth cases. +// Exact bounded-minor inequalities are checked by verify.py. Original credit below. +// Copyright 2026 icekylinx. Apache-2.0; AI-assisted handoff integration. +// Original round3_rankone_profiles.cpp. Requires GCC/Clang unsigned __int128. + +// Adapted input reader for complete serialized frame-compiler transitions. +// Actual-word fixed-I+J profiling, adapted from PR48 profiles.cpp. +// All projector, pivot and CRT formulas below are unchanged. +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +using U=uint32_t;using V=uint64_t; +#include "binary_io.hpp" +int main(int argc,char**argv){ +assert(argc==2);std::ifstream f(argv[1],std::ios::binary);U hdr[6];read_array(f,hdr); +U h=hdr[0],v=hdr[1],R=hdr[2],nf=hdr[3],nt=hdr[4];int64_t singles=hdr[5];assert(h==23||h==25); +V sum,loss;f.read(reinterpret_cast(&sum),8);f.read(reinterpret_cast(&loss),8); +struct Frame{V core,cover;U rank;};std::vectorframes; +for(U i=0;i(&a.core),8);f.read(reinterpret_cast(&a.cover),8);f.read(reinterpret_cast(&a.rank),4);frames.push_back(a);} +std::map,int64_t>transitions; +for(U i=0;i(&a),4);f.read(reinterpret_cast(&b),4);f.read(reinterpret_cast(&count),8);transitions[{a,b}]=count;} +assert(f);assert(sum==h*V(R)+loss); +V p=2305843009213693951ULL; +auto mul=[&](V a,V b)->V{return (__uint128_t)a*b%p;}; +auto power=[&](V a,V b)->V{V r=1;for(;b;b>>=1,a=mul(a,a))if(b&1)r=mul(r,a);return r;}; +auto sub=[&](V a,V b)->V{return (a+p-b)%p;}; +std::vector>matrix_cache(frames.size()); +auto matrix=[&](U id)->const std::vector&{auto&A=matrix_cache[id];if(!A.empty())return A;A.assign(h*h,0);if(id==0)return A;if(id==1){for(U i=0;i>i)&1);V zj=((f.core>>j)&1)?3*(h+1)-10:p-10;A[i*h+j]=mul(mul(wi,zj),factor);}return A;} + assert(c==1||c==2);V s=3-c,d=s*s+(c-1)*nn,den=3*(h+1)*d,inv=power(den,p-2); + for(U i=0;i>i)&1,oj=(out>>j)&1,wi=3+((f.core>>i)&1),zj=((f.core>>j)&1)?3*(h+1)-10:p-10; + V num=(mul(s*oi,zj)+3*(h+1)*s*wi*oj+mul(nn*wi,zj))%p;num=sub(num,3*(h+1)*(c-1)*oi*oj);A[i*h+j]=(V(i==j&&oi)+mul(num,inv))%p; + }return A;}; + +std::vectorblocks(h+1);blocks[1]=singles;V done=0,matrices=0,crt_matrices=0,crt_disagreements=0;U longest=0;std::mapcorrection_hist; +U aa,bb; +while(std::cin>>aa>>bb){ + assert(aa=frames[aa].rank); + if(rr<=2){blocks[1]=rr; for(U t=0;t<=h;t++)std::cout<1&&bb>1){ + assert(!(frames[bb].core&~frames[aa].core)); + assert(!(frames[aa].cover&~frames[bb].cover)); + U ca=popcount64(frames[aa].core),cb=popcount64(frames[bb].core); + assert(ca==3||frames[aa].core==frames[bb].core||(ca==2&&cb==1)); + } + const auto&A=matrix(aa);const auto&B=matrix(bb);std::vectorM(h*h);for(U x=0;x>pivots; + for(U i=0;i=0&&!M[i*h+j])j--;if(j<0)continue;pivots.push_back({i,U(j)});V inv=power(M[i*h+j],p-2);for(U k=i+1;k core-one use all three primes at these dimensions. +if(aa>1&&bb>1&&(popcount64(frames[aa].core)==3||(popcount64(frames[aa].core)==2&&popcount64(frames[bb].core)==1))){ + assert(h==23||h==25);crt_matrices++;matrix_cache[aa].clear();matrix_cache[bb].clear();std::vector>> all{pivots}; + for(V extra:{2147483647ULL,524287ULL}){p=extra;matrix_cache[aa].clear();matrix_cache[bb].clear();const auto&C=matrix(aa);const auto&D=matrix(bb);std::vectorY(h*h);for(U z=0;z> pp; + for(U i=0;i=0&&!Y[i*h+j])j--;if(j<0)continue;pp.push_back({i,U(j)});V inv=power(Y[i*h+j],p-2);for(U k=i+1;k corner((h+1)*(h+1));for(U i=0;i=j;best=std::max(best,rank);}corner[(i+1)*(h+1)+j]=best;} + pivots.clear();for(U i=0;i= j+1 proves persistence.", + "common_cutoff": 14000000000000, + "cutoff_log2_input": { + "alpha": 6143424401, + "compact": 24573697601, + "geometry": 3999931956123, + "guard": 4350061, + "log_p": 25, + "normalization": 14000000000000, + "period": 49147395201, + "phase_cell": 19, + "reservoir": 14, + "stopped_leaf": 252 + }, + "power_checkpoints": [ + { + "log2_input": 14000000000000, + "powers": { + "alpha": { + "exponent": 714467976, + "rhs": 112000000156824, + "rhs_bits": 47 + }, + "compact": { + "exponent": 714467976, + "rhs": 448000000627232, + "rhs_bits": 49 + }, + "leaf": { + "exponent": 666666666666, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 714467976, + "rhs": 224000000313576, + "rhs_bits": 48 + }, + "rows": { + "exponent": 714467976, + "rhs": 112000000156824000, + "rhs_bits": 57 + } + } + }, + { + "log2_input": 28000000000000, + "powers": { + "alpha": { + "exponent": 1428935953, + "rhs": 224000000156824, + "rhs_bits": 48 + }, + "compact": { + "exponent": 1428935953, + "rhs": 896000000627232, + "rhs_bits": 50 + }, + "leaf": { + "exponent": 1333333333333, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 1428935953, + "rhs": 448000000313576, + "rhs_bits": 49 + }, + "rows": { + "exponent": 1428935953, + "rhs": 224000000156824000, + "rhs_bits": 58 + } + } + }, + { + "log2_input": 56000000000000, + "powers": { + "alpha": { + "exponent": 2857871906, + "rhs": 448000000156824, + "rhs_bits": 49 + }, + "compact": { + "exponent": 2857871906, + "rhs": 1792000000627232, + "rhs_bits": 51 + }, + "leaf": { + "exponent": 2666666666666, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 2857871906, + "rhs": 896000000313576, + "rhs_bits": 50 + }, + "rows": { + "exponent": 2857871906, + "rhs": 448000000156824000, + "rhs_bits": 59 + } + } + }, + { + "log2_input": 112000000000000, + "powers": { + "alpha": { + "exponent": 5715743812, + "rhs": 896000000156824, + "rhs_bits": 50 + }, + "compact": { + "exponent": 5715743812, + "rhs": 3584000000627232, + "rhs_bits": 52 + }, + "leaf": { + "exponent": 5333333333333, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 5715743812, + "rhs": 1792000000313576, + "rhs_bits": 51 + }, + "rows": { + "exponent": 5715743812, + "rhs": 896000000156824000, + "rhs_bits": 60 + } + } + }, + { + "log2_input": 224000000000000, + "powers": { + "alpha": { + "exponent": 11431487624, + "rhs": 1792000000156824, + "rhs_bits": 51 + }, + "compact": { + "exponent": 11431487624, + "rhs": 7168000000627232, + "rhs_bits": 53 + }, + "leaf": { + "exponent": 10666666666666, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 11431487624, + "rhs": 3584000000313576, + "rhs_bits": 52 + }, + "rows": { + "exponent": 11431487624, + "rhs": 1792000000156824000, + "rhs_bits": 61 + } + } + }, + { + "log2_input": 448000000000000, + "powers": { + "alpha": { + "exponent": 22862975248, + "rhs": 3584000000156824, + "rhs_bits": 52 + }, + "compact": { + "exponent": 22862975248, + "rhs": 14336000000627232, + "rhs_bits": 54 + }, + "leaf": { + "exponent": 21333333333333, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 22862975248, + "rhs": 7168000000313576, + "rhs_bits": 53 + }, + "rows": { + "exponent": 22862975248, + "rhs": 3584000000156824000, + "rhs_bits": 62 + } + } + } + ], + "practical_runtime_claim": false + }, + "kappa": "5103377/100000000000", + "next_kappa": "2551689/50000000000", + "next_kappa_rejection": "{'g1_above_kappa': '-4474363729938551527709/1250063795474999872409050000000000', 'g3_above_kappa': '-114488550508271028002361/25001275909499997448181000000000000', 'g5_above_kappa': '-168180915267533646334869/40002041455199995917089600000000000', 'g6_above_kappa': '-740899472699668241881621/200010207275999979585448000000000000'}" + }, + "comparison": { + "difference": "3978313/250000000000000000", + "pr67_commit": "b3745601e947a94316bf25c2c6263d93c06e3364", + "pr67_kappa": "10206752116843/200000000000000000", + "pr68_kappa": "2551469/50000000000" + }, + "finite_bridge": { + "bit": { + "W": 137151806, + "halving_degree": 9, + "m": 575, + "maxchild": 529, + "wire_bits": 28 + }, + "complex": { + "W": 537696432, + "halving_degree": 20, + "m": 784, + "maxchild": 756, + "s": 421548223824, + "scalar_group_upper": 4793351472, + "scalar_terms": [ + { + "c": 78437, + "copied_center_extra_groups": 56, + "h": 28, + "invocations": 3276, + "local_group_upper": 729892, + "v": 3276 + }, + { + "c": 78437, + "copied_center_extra_groups": 56, + "h": 28, + "invocations": 3276, + "local_group_upper": 729892, + "v": 3276 + } + ], + "wire_bits": 30 + }, + "rows": { + "coefficient": 852, + "contract": "W_complex^D_complex * W_bit^D_bit; one preceding prefix and padding; all temporary copies sequential", + "degree": 2000, + "degree_gap": "6548/25", + "suffix_slope": 8000 + }, + "semantic": { + "B": 9696565176891520488614054257040, + "C0": 2358858462850846165593256368932965330169899180021667007021321420800, + "C1": 1, + "E": 9696565176891520488192506033216, + "induction_gap": 533311084729033626873772984137200, + "literal_charge": 2771683137698171397039558468, + "strict_literal_gap": 9693793493753822316795466474748 + } + }, + "kappa": "51033776497467/1000000000000000000", + "pending_full_replay_axes": [ + 23 + ], + "preferred": { + "assembly": { + "absorption_gap": "194677910315764927181798623881/250012759095269195981809461557000000000000000000", + "constraints": { + "K_dominates_log": "12759095331683222714129861018190538443/250012759095269195981809461557000000000000", + "K_geometry": "187512759095331695981809461557/250012759095269195981809461557000000000000", + "a_below_b": "10331809461557/500000000000000000", + "a_positive": "25518190538443/500000000000000000", + "alpha_below_one": "499999999999750012759095269195981809461557/500025518190538391963618923114000000000000", + "alpha_below_one_fourth": "124980861356846218786381076860481809461557/500025518190538391963618923114000000000000", + "alpha_positive": "25518190788379204523653918018190538443/500025518190538391963618923114000000000000", + "artificial_boundary": "14000816582099978581113091347235945428384671/2000102072762153567854475692456000000000000", + "b_below_one_over32": "311783/10000000", + "beta_below_one": "19/20", + "beta_positive": "1/20", + "c_below_one": "249987240904668304018190538443/250000000000000000000000000000", + "c_positive": "12759095331695981809461557/250000000000000000000000000000", + "cell_above_band": "499999999999249987240904730804018190538443/1000051036381076783927237846228000000000000", + "compact_leaf": "4269654730804018190538443/250000000000000000000000000000", + "compact_reservations": "1/4000000000000", + "delta_below_one_eighth": "999999999999/8000000000000", + "delta_positive": "1/8000000000000", + "epsilon_below_one": "12759095519195981809461557/250012759095269195981809461557", + "epsilon_positive": "249999999999750000000000000000/250012759095269195981809461557", + "g1_above_kappa": "250012953773179511746736643355623881/250012759095269195981809461557000000000000000000", + "g2_above_kappa": "2604579419/1000000000000000000", + "g3_above_kappa": "194677910315764927181798623881/250012759095269195981809461557000000000000000000", + "g4_above_kappa": "2604579419/1000000000000000000", + "g5_above_kappa": "93754979338636264258105729882498881/250012759095269195981809461557000000000000000000", + "g6_above_kappa": "218761358886270862249010460660998881/250012759095269195981809461557000000000000000000", + "g7_above_kappa": "249987240904480816971963717954746736643355623881/250012759095269195981809461557000000000000000000", + "gamma_sublinear": "1/2000000000000", + "guard_width": "12759095519195981809461557/250012759095269195981809461557", + "lambda_above_internal": "25518190538443/500000000000000000000000000000", + "lambda_above_sigma": "10331809461582518190538443/500000000000000000000000000000", + "lambda_above_tau": "25518190538443/500000000000000000000000000000", + "lambda_prime_above_lambda": "25518190538443/500000000000000000000000000000", + "lambda_prime_below_one": "12759095269195981809461557/250000000000000000000000000000", + "literal_scalar_guard": "9693793493753822316795466474748", + "phase_boundary": "20414552580700811799869295218190538443/400020414552430713570895138491200000000000", + "phase_leaf_above_bit": "8539309461557/500000000000000000", + "phase_local": "102072763903555095380423260018190538443/2000102072762153567854475692456000000000000", + "prime_interval_packing": "12759095519195981809461557/250012759095269195981809461557", + "q_below_internal": "25518190538443/250000000000000000000000000000", + "q_below_leaf": "4269654730804018190538443/250000000000000000000000000000", + "q_below_reservations": "1/4000000000000", + "q_positive": "12759095269195981809461557/250000000000000000000000000000", + "record_suffix": "12759095519195981809461557/250012759095269195981809461557", + "row_product_gap": "6548/25", + "short_record_fallback": "124993620126651365072510254917924157346260864249/125006379547634597990904730778500000000000000000", + "small_field_exposure": "1/1000000000000" + }, + "finite_bridge": { + "bit": { + "W": 137151806, + "halving_degree": 9, + "m": 575, + "maxchild": 529, + "wire_bits": 28 + }, + "complex": { + "W": 537696432, + "halving_degree": 20, + "m": 784, + "maxchild": 756, + "s": 421548223824, + "scalar_group_upper": 4793351472, + "wire_bits": 30 + }, + "rows": { + "coefficient": 852, + "degree": 2000, + "degree_gap": "6548/25", + "suffix_slope": 8000 + }, + "semantic": { + "B": 9696565176891520488614054257040, + "C0": 2358858462850846165593256368932965330169899180021667007021321420800, + "C1": 1, + "E": 9696565176891520488192506033216, + "induction_gap": 533311084729033626873772984137200, + "literal_charge": 2771683137698171397039558468, + "strict_literal_gap": 9693793493753822316795466474748 + } + }, + "margins": { + "g1": "12759095519195981809461557/250012759095269195981809461557", + "g2": "25518190538443/500000000000000000", + "g3": "12759095269183222714192361018190538443/250012759095269195981809461557000000000000", + "g4": "25518190538443/500000000000000000", + "g5": "20414552580700811799869295218190538443/400020414552430713570895138491200000000000", + "g6": "102072763903555095380423260018190538443/2000102072762153567854475692456000000000000", + "g7": "249999999999750000000000000000/250012759095269195981809461557" + }, + "minimum_margin": "12759095269183222714192361018190538443/250012759095269195981809461557000000000000", + "parameters": { + "C0": 2358858462850846165593256368932965330169899180021667007021321420800, + "C1": "1", + "a_bit": "25518190538443/500000000000000000", + "a_complex": "717/10000000", + "alpha_squared_power": "25518190788379204523653918018190538443/500025518190538391963618923114000000000000", + "beta": "1/20", + "c": "12759095331695981809461557/250000000000000000000000000000", + "delta": "1/8000000000000", + "epsilon": "249999999999750000000000000000/250012759095269195981809461557", + "h": "1/1000000000000", + "kappa": "51033776497467/1000000000000000000", + "lambda_": "499974481809461582518190538443/500000000000000000000000000000", + "lambda_prime": "249987240904730804018190538443/250000000000000000000000000000", + "q": "12759095269195981809461557/250000000000000000000000000000", + "sigma": "9999283/10000000", + "tau": "499974481809461557/500000000000000000" + }, + "recurrence": { + "internal": "499974481809461557/500000000000000000", + "leaf": "199986377/200000000", + "reservations": "249987240904668304018190538443/250000000000000000000000000000" + }, + "scoped_limit": "25518190538443/500025518190538443" + }, + "eventual_bounds": { + "additional_eventual_conditions": [ + "BHP prime threshold and distinct-prime packing", + "Fixed rational basis, eligible common prime and native table setup", + "Catalogue/descriptor domination, logarithm absorption, exact recovery" + ], + "all_interval_argument": "For [Z,Z+k), bound RHS at Z+k and LHS at floor(Z/k). Successive intervals double LHS; the positive affine RHS grows at most linearly, so 2^j >= j+1 proves persistence.", + "common_cutoff": 14000000000000, + "cutoff_log2_input": { + "alpha": 6143424401, + "compact": 24573697601, + "geometry": 3999931956121, + "guard": 4350061, + "log_p": 25, + "normalization": 14000000000000, + "period": 49147395201, + "phase_cell": 19, + "reservoir": 14, + "stopped_leaf": 252 + }, + "power_checkpoints": [ + { + "log2_input": 14000000000000, + "powers": { + "alpha": { + "exponent": 714467976, + "rhs": 112000000156824, + "rhs_bits": 47 + }, + "compact": { + "exponent": 714467976, + "rhs": 448000000627232, + "rhs_bits": 49 + }, + "leaf": { + "exponent": 666666666666, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 714467976, + "rhs": 224000000313576, + "rhs_bits": 48 + }, + "rows": { + "exponent": 714467976, + "rhs": 112000000156824000, + "rhs_bits": 57 + } + } + }, + { + "log2_input": 28000000000000, + "powers": { + "alpha": { + "exponent": 1428935953, + "rhs": 224000000156824, + "rhs_bits": 48 + }, + "compact": { + "exponent": 1428935953, + "rhs": 896000000627232, + "rhs_bits": 50 + }, + "leaf": { + "exponent": 1333333333333, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 1428935953, + "rhs": 448000000313576, + "rhs_bits": 49 + }, + "rows": { + "exponent": 1428935953, + "rhs": 224000000156824000, + "rhs_bits": 58 + } + } + }, + { + "log2_input": 56000000000000, + "powers": { + "alpha": { + "exponent": 2857871906, + "rhs": 448000000156824, + "rhs_bits": 49 + }, + "compact": { + "exponent": 2857871906, + "rhs": 1792000000627232, + "rhs_bits": 51 + }, + "leaf": { + "exponent": 2666666666666, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 2857871906, + "rhs": 896000000313576, + "rhs_bits": 50 + }, + "rows": { + "exponent": 2857871906, + "rhs": 448000000156824000, + "rhs_bits": 59 + } + } + }, + { + "log2_input": 112000000000000, + "powers": { + "alpha": { + "exponent": 5715743812, + "rhs": 896000000156824, + "rhs_bits": 50 + }, + "compact": { + "exponent": 5715743812, + "rhs": 3584000000627232, + "rhs_bits": 52 + }, + "leaf": { + "exponent": 5333333333333, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 5715743812, + "rhs": 1792000000313576, + "rhs_bits": 51 + }, + "rows": { + "exponent": 5715743812, + "rhs": 896000000156824000, + "rhs_bits": 60 + } + } + }, + { + "log2_input": 224000000000000, + "powers": { + "alpha": { + "exponent": 11431487624, + "rhs": 1792000000156824, + "rhs_bits": 51 + }, + "compact": { + "exponent": 11431487624, + "rhs": 7168000000627232, + "rhs_bits": 53 + }, + "leaf": { + "exponent": 10666666666666, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 11431487624, + "rhs": 3584000000313576, + "rhs_bits": 52 + }, + "rows": { + "exponent": 11431487624, + "rhs": 1792000000156824000, + "rhs_bits": 61 + } + } + }, + { + "log2_input": 448000000000000, + "powers": { + "alpha": { + "exponent": 22862975248, + "rhs": 3584000000156824, + "rhs_bits": 52 + }, + "compact": { + "exponent": 22862975248, + "rhs": 14336000000627232, + "rhs_bits": 54 + }, + "leaf": { + "exponent": 21333333333333, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 22862975248, + "rhs": 7168000000313576, + "rhs_bits": 53 + }, + "rows": { + "exponent": 22862975248, + "rhs": 3584000000156824000, + "rhs_bits": 62 + } + } + } + ], + "practical_runtime_claim": false + }, + "kappa": "51033776497467/1000000000000000000", + "next_kappa": "12758444124367/250000000000000000", + "next_kappa_rejection": "{'g3_above_kappa': '-13833712194876067200002709419/62503189773817298995452365389250000000000000000'}" + }, + "rejected_moment": { + "degree": 8, + "lower": "857198787500000000320084320898948581936950013239/857198787500000000000000000000000000000000000000", + "rounding_denominator": 10000000000000000000000000000000000000000, + "saving": "51036381076887/1000000000000000000", + "strict_gap": "-6401686417978972513751148409313/17143975750000000000000000000000000000000000000000", + "terms": { + "1": { + "exp_lower": "1250405445803936929269401999015099361753/1250000000000000000000000000000000000000", + "exp_upper": "625202722901968464634700999507549712853/625000000000000000000000000000000000000", + "log_lower": "3177185020398675220004135749131/500000000000000000000000000000", + "log_upper": "6354370040797350440008271498263/1000000000000000000000000000000", + "weight": "37473473/1714397575" + }, + "10": { + "exp_lower": "5001034049114205568080248742134576900489/5000000000000000000000000000000000000000", + "exp_upper": "2500517024557102784040124371067288577867/2500000000000000000000000000000000000000", + "log_lower": "2025892473901652377995140021789/500000000000000000000000000000", + "log_upper": "4051784947803304755990280043579/1000000000000000000000000000000", + "weight": "77412/68575903" + }, + "11": { + "exp_lower": "2000403889084069843075900390106860881007/2000000000000000000000000000000000000000", + "exp_upper": "10002019445420349215379501950534304915519/10000000000000000000000000000000000000000", + "log_lower": "3956474767998979895946327920297/1000000000000000000000000000000", + "log_upper": "1978237383999489947973163960149/500000000000000000000000000000", + "weight": "376059/311708650" + }, + "12": { + "exp_lower": "2500493757273296416602753572171916997673/2500000000000000000000000000000000000000", + "exp_upper": "10001975029093185666411014288687668501171/10000000000000000000000000000000000000000", + "log_lower": "3869463391009350129778562018423/1000000000000000000000000000000", + "log_upper": "483682923876168766222320252303/125000000000000000000000000000", + "weight": "1634448/1714397575" + }, + "13": { + "exp_lower": "2000386834041431491408697182551762269673/2000000000000000000000000000000000000000", + "exp_upper": "10001934170207157457043485912758811858839/10000000000000000000000000000000000000000", + "log_lower": "3789420683335813703954784056697/1000000000000000000000000000000", + "log_upper": "1894710341667906851977392028349/500000000000000000000000000000", + "weight": "1529879/1714397575" + }, + "14": { + "exp_lower": "10001896340936195966258338887348603314597/10000000000000000000000000000000000000000", + "exp_upper": "2500474085234048991564584721837150956267/2500000000000000000000000000000000000000", + "log_lower": "3715312711182091825485686633361/1000000000000000000000000000000", + "log_upper": "1857656355591045912742843316681/500000000000000000000000000000", + "weight": "1223733/1714397575" + }, + "15": { + "exp_lower": "2000372224571219566142092841584677361121/2000000000000000000000000000000000000000", + "exp_upper": "1250232640357012228838808025990423414509/1250000000000000000000000000000000000000", + "log_lower": "3646319839695140374012266928113/1000000000000000000000000000000", + "log_upper": "1823159919847570187006133464057/500000000000000000000000000000", + "weight": "3819/5963122" + }, + "16": { + "exp_lower": "1250228522331821859708104388824961832327/1250000000000000000000000000000000000000", + "exp_upper": "250045704466364371941620877764992379227/250000000000000000000000000000000000000", + "log_lower": "3581781318557569202339343012429/1000000000000000000000000000000", + "log_upper": "358178131855756920233934301243/100000000000000000000000000000", + "weight": "65304/155854325" + }, + "17": { + "exp_lower": "10001797232432936170843991573652962427969/10000000000000000000000000000000000000000", + "exp_upper": "10001797232432936170843991573652962938431/10000000000000000000000000000000000000000", + "log_lower": "3521156696741134359758736880389/1000000000000000000000000000000", + "log_upper": "352115669674113435975873688039/100000000000000000000000000000", + "weight": "3553051/1714397575" + }, + "18": { + "exp_lower": "5000884027823387978298227916542668217383/5000000000000000000000000000000000000000", + "exp_upper": "400070722225871038263858233323413477809/400000000000000000000000000000000000000", + "log_lower": "3463998282901185747800548902959/1000000000000000000000000000000", + "log_upper": "43299978536264821847506861287/12500000000000000000000000000", + "weight": "361782/1714397575" + }, + "19": { + "exp_lower": "250043511421325108164448619465097804459/250000000000000000000000000000000000000", + "exp_upper": "5000870228426502163288972389301956344409/5000000000000000000000000000000000000000", + "log_lower": "1704965530815454989999622033187/500000000000000000000000000000", + "log_upper": "27279448493047279839993952531/8000000000000000000000000000", + "weight": "11837/155854325" + }, + "2": { + "exp_lower": "2500722425177664080388754711498018099073/2500000000000000000000000000000000000000", + "exp_upper": "10002889700710656321555018845992072907191/10000000000000000000000000000000000000000", + "log_lower": "1415305715059351282647759844201/250000000000000000000000000000", + "log_upper": "1132244572047481026118207875361/200000000000000000000000000000", + "weight": "3613801/1714397575" + }, + "20": { + "exp_lower": "2000342854817974965639262370099608867043/2000000000000000000000000000000000000000", + "exp_upper": "10001714274089874828196311850498044845671/10000000000000000000000000000000000000000", + "log_lower": "83965944181083986164326198053/25000000000000000000000000000", + "log_upper": "3358637767243359446573047922121/1000000000000000000000000000000", + "weight": "26402/342879515" + }, + "21": { + "exp_lower": "10001689369118100564009404904999846110103/10000000000000000000000000000000000000000", + "exp_upper": "10001689369118100564009404904999846620557/10000000000000000000000000000000000000000", + "log_lower": "413730950384240930438459189737/125000000000000000000000000000", + "log_upper": "3309847603073927443507673517897/1000000000000000000000000000000", + "weight": "12978/2981561" + }, + "22": { + "exp_lower": "10001665623002910757462001880557291477507/10000000000000000000000000000000000000000", + "exp_upper": "250041640575072768936550047013932299699/250000000000000000000000000000000000000", + "log_lower": "3263327587439034586529095798839/1000000000000000000000000000000", + "log_upper": "81583189685975864663227394971/25000000000000000000000000000", + "weight": "77/2833715" + }, + "23": { + "exp_lower": "2500410733169745140983515301704129140621/2500000000000000000000000000000000000000", + "exp_upper": "1250205366584872570491757650852064634117/1250000000000000000000000000000000000000", + "log_lower": "804718956217050187300379666613/250000000000000000000000000000", + "log_upper": "3218875824868200749201518666453/1000000000000000000000000000000", + "weight": "11447/542102" + }, + "25": { + "exp_lower": "10001600370822362615567135752155760619513/10000000000000000000000000000000000000000", + "exp_upper": "10001600370822362615567135752155761129961/10000000000000000000000000000000000000000", + "log_lower": "313549421592914969080675283181/100000000000000000000000000000", + "log_upper": "3135494215929149690806752831811/1000000000000000000000000000000", + "weight": "11641/566743" + }, + "3": { + "exp_lower": "10002682708336711154954882086485383260527/10000000000000000000000000000000000000000", + "exp_upper": "10002682708336711154954882086485383771227/10000000000000000000000000000000000000000", + "log_lower": "262787887606462037430651313067/50000000000000000000000000000", + "log_upper": "5255757752129240748613026261341/1000000000000000000000000000000", + "weight": "127374/74539025" + }, + "4": { + "exp_lower": "2500633961876962934948511393993214372779/2500000000000000000000000000000000000000", + "exp_upper": "10002535847507851739794045575972858001729/10000000000000000000000000000000000000000", + "log_lower": "2484037839838729910586903627673/500000000000000000000000000000", + "log_upper": "4968075679677459821173807255347/1000000000000000000000000000000", + "weight": "3866/2981561" + }, + "481": { + "exp_lower": "50000455508846285295100235699697301347/50000000000000000000000000000000000000", + "exp_upper": "10000091101769257059020047139939460779769/10000000000000000000000000000000000000000", + "log_lower": "35700554138317851917337677133/200000000000000000000000000000", + "log_upper": "89251385345794629793344192833/500000000000000000000000000000", + "weight": "13468/271051" + }, + "5": { + "exp_lower": "5001210967441976893627522723784463490729/5000000000000000000000000000000000000000", + "exp_upper": "400096877395358151490201817902757099681/400000000000000000000000000000000000000", + "log_lower": "1186233032090812516351878041259/250000000000000000000000000000", + "log_upper": "4744932128363250065407512165037/1000000000000000000000000000000", + "weight": "436212/342879515" + }, + "525": { + "exp_lower": "10000046428811178886874206993853350682093/10000000000000000000000000000000000000000", + "exp_upper": "500002321440558944343710349692667559623/500000000000000000000000000000000000000", + "log_lower": "22742944551431673576538712861/250000000000000000000000000000", + "log_upper": "18194355641145338861230970289/200000000000000000000000000000", + "weight": "244461/566743" + }, + "529": { + "exp_lower": "5000021277523116257443014052124125502849/5000000000000000000000000000000000000000", + "exp_upper": "2000008511009246502977205620849650303213/2000000000000000000000000000000000000000", + "log_lower": "41690804469525529197382917321/500000000000000000000000000000", + "log_upper": "83381608939051058394765834643/1000000000000000000000000000000", + "weight": "116748/271051" + }, + "6": { + "exp_lower": "10002328862456282073487306051527417319917/10000000000000000000000000000000000000000", + "exp_upper": "1250291107807035259185913256440927228807/1250000000000000000000000000000000000000", + "log_lower": "4562610571569295439195794139881/1000000000000000000000000000000", + "log_upper": "2281305285784647719597897069941/500000000000000000000000000000", + "weight": "222609/155854325" + }, + "7": { + "exp_lower": "10002250171515592639778311688281121446203/10000000000000000000000000000000000000000", + "exp_upper": "2500562542878898159944577922070280489181/2500000000000000000000000000000000000000", + "log_lower": "4408459891742037134902918754819/1000000000000000000000000000000", + "log_upper": "220422994587101856745145937741/50000000000000000000000000000", + "weight": "2614808/1714397575" + }, + "8": { + "exp_lower": "1250272750852829857771850355691693691511/1250000000000000000000000000000000000000", + "exp_upper": "2000436401364527772434960569106710008519/2000000000000000000000000000000000000000", + "log_lower": "66795757798711164246196486467/15625000000000000000000000000", + "log_upper": "4274928499117514511756575133889/1000000000000000000000000000000", + "weight": "92592/68575903" + }, + "9": { + "exp_lower": "5001060940843953705786277762764016050479/5000000000000000000000000000000000000000", + "exp_upper": "2000424376337581482314511105105606522291/2000000000000000000000000000000000000000", + "log_lower": "4157145463461131057217781024417/1000000000000000000000000000000", + "log_upper": "2078572731730565528608890512209/500000000000000000000000000000", + "weight": "4276737/3428795150" + } + }, + "upper": "17143975750000000006401686417978972513751148409313/17143975750000000000000000000000000000000000000000" + }, + "scope": "Paid profile and exact arithmetic; explicitly pending dirty replay and broad tests. All inherited theorem interfaces remain conditional.", + "source_sha256": { + "research/cost-live-composition/compiler.py": "58caca9b5336a2d50fcc45b56abfac60bbb795856b5c806ba4bfa5f649412642", + "research/cost-live-composition/experiment.py": "1d04f6b9dfd1152b872043bf9e96350a384829ca219289ae00e75a0195382573", + "research/cost-live-composition/profile_oracle.cpp": "d1f6b650de9fb5842b412595369271d9eeb6f54045c76c0fb5cad29854955c35", + "research/pair-assembly/pair_graph.py": "3d47e89d2649c90800a276bdd0480131def50e0bdf92c122a19494b55bf17420", + "research/slot-cost-rank-pair/arithmetic/refine.py": "8af4f9ed6cec841fe691b7f7950ca7b17483282e8869795922d29f10a4d49c16" + }, + "status": "Concrete exact candidate; full replay PENDING" +} diff --git a/research/cost-live-composition/compiler.py b/research/cost-live-composition/compiler.py new file mode 100644 index 0000000000..d10a33b5a6 --- /dev/null +++ b/research/cost-live-composition/compiler.py @@ -0,0 +1,275 @@ +# Live-anchor composition of PR67 all-rank cost selection with PR68. +# Dominik Scholz with substantial OpenAI GPT-6 Astra assistance. +# All-rank profile-cost selection: Rohan Arun, with OpenAI Codex assistance. +# Derived from Dominik Scholz PR63, Chafik Boukhalfa PR60, Avi Eisenberg PR62 +# and eumemic PR57. Apache-2.0; all inherited notices remain applicable. +"""Exact-envelope block synthesis on the pinned PR48 scalar graph. +Experimental finite compiler; no fixed-I+J profile or multiplication claim. +""" +# Derived from eumemic's PR57 compiler; original notices remain applicable. +# Descending-rank reclamation priority: Chafik Boukhalfa, with OpenAI Codex assistance. +import sys +if sys.flags.optimize: + raise ValueError('Assertions must remain enabled') +sys.dont_write_bytecode=True +from pathlib import Path +ROOT=Path(__file__).resolve().parents[2]/'references/frame-compiler/pr48' +from hashlib import sha256 +import json +manifest=json.loads((ROOT/'SOURCE.json').read_text()) +for name,digest in manifest['files'].items(): + assert sha256((ROOT/name).read_bytes()).hexdigest()==digest, 'Changed producer source: '+name +sys.path[:0]=[str(ROOT/'scripts'),str(ROOT/'research/copied-fixed')] +from changed_graph import graph +from collections import defaultdict,Counter,deque +import argparse,json,time,struct + +def independent(rows,vec): + for row in rows: + vec=min(vec,vec^row) + return bool(vec) +def basis(rows): + out=[] + for vec in rows: + for row in out:vec=min(vec,vec^row) + if vec:out.append(vec) + return out + +def build(h): + c=graph(h);groups={};owner={};signal={};blocks=[] + for x in sorted(c.active): + key=(c.core[x],c.union[x]) + if key not in groups: + groups[key]=len(blocks);blocks.append(dict(nodes=[],frame=key,inputs=set(),uses=[])) + g=groups[key];owner[x]=g;blocks[g]['nodes'].append(x) + signal[x]=(signal[c.args[x][0]]^signal[c.args[x][1]])if c.args[x]else 1<<(x-1) + for x in sorted(c.active): + for y in c.args[x]or(): + if owner[y]!=owner[x]:blocks[owner[x]]['inputs'].add(y) + uses=[];value_uses=defaultdict(list) + for g,b in enumerate(blocks): + b['inputs']=sorted(b['inputs']);b['source']=not c.args[b['nodes'][0]] + for y in b['inputs']: + k=len(uses);uses.append((y,g,None));value_uses[y].append(k);blocks[owner[y]]['uses'].append(k) + for target,x in c.outputs.items(): + k=len(uses);uses.append((x,owner[x],target));value_uses[x].append(k);blocks[owner[x]]['uses'].append(k) + for g,b in enumerate(blocks): + b['rank']=1 if b['source']else b['frame'][1].bit_count()-b['frame'][0].bit_count() + order=sorted(range(len(blocks)),key=lambda g:(blocks[g]['rank'],min(blocks[g]['nodes']))) + place={g:i for i,g in enumerate(order)} + def contained(a,b):return not(b[0]&~a[0])and not(a[1]&~b[1]) + for g,b in enumerate(blocks): + coeff={y:1<1 for b in blocks) + def new(g): + s=len(slots);slots.append(0);frames.append(g);hist[blocks[g]['rank']]+=1;events.append((s,-1,g));return s + def raise_(s,g): + old=frames[s];assert contains(blocks[old]['frame'],blocks[g]['frame']);hist[blocks[g]['rank']-blocks[old]['rank']]+=1;frames[s]=g;events.append((s,old,g)) + def xor(a,b,g): + assert a!=b;raise_(a,g);raise_(b,g);slots[a]^=slots[b];ops.append((a,b,g)) + import subprocess,struct + from binary_frame_math import logs + # Integer midpoint enclosures give a reproducible discovery score. + # Every candidate is independently checked by the complete exact screen. + weights=[0]+[int(t*sum(logs(t))*10**30//2) for t in range(1,h+1)] + oracle_input=Path(ORACLE_INPUT) + with oracle_input.open('wb') as stream: + stream.write(struct.pack('<6I2Q',h,v,0,len(blocks)+2,0,0,h*(h-1),h*(h-1))) + stream.write(struct.pack('<2QI',0,0,0));stream.write(struct.pack('<2QI',0,0,h)) + for b in blocks:stream.write(struct.pack('<2QI',*b['frame'],b['rank'])) + oracle=subprocess.Popen([ORACLE_EXE,str(oracle_input)],stdin=subprocess.PIPE,stdout=subprocess.PIPE,text=True,bufsize=1) + oracles.append(oracle) + cache={} + def profile_entropy(a,b): + if (a,b) not in cache: + oracle.stdin.write(f'{a} {b}\n');oracle.stdin.flush() + answer=oracle.stdout.readline() + assert answer, 'profile oracle failed' + parts=list(map(int,answer.split()));assert len(parts)==h+1 + cache[a,b]=sum(n*w for n,w in zip(parts,weights)) + return cache[a,b] + def profile_cost(a,g): + old=frames[a]+2;target=g+2 + return profile_entropy(old,1)-profile_entropy(old,target)-profile_entropy(target,1) + def acquire(g,anchors): + if reclaim: + bb={} + def ins(s): + row=slots[s];expr=1<>s&1;e^=1<>i&1) + if j!=i: + # Synthesize swap as three XORs at the single common frame. + for a,z in ((i,j),(j,i),(i,j)):rr[a]^=rr[z];elim.append((a,z)) + for j in range(len(ins)): + if j!=i and rr[j]>>i&1:rr[j]^=rr[i];elim.append((j,i)) + assert rr==[1<>i&1:xor(s,value_slots[y],g) + assert slots[s]==signal[x];value_slots[x]=s + used=set() + for u in outuses: + x=uses[u][0];s=value_slots[x] + if x in used: + ss=acquire(g,list(value_slots.values()));xor(ss,s,g);s=ss + used.add(x);assert u not in assign;assign[u]=s;assert s not in pending;pending[s]=uses[u][1] + if step%5000==0:print('compile',h,step,len(slots),'reclaimed',stats['reclaimed'],'seconds',time.time()-t0,flush=True,file=sys.stderr) + output_slots=[];output_records=[];scatter=[0]*v;J=[] + for u,(x,g,target)in enumerate(uses): + if target is None:continue + s=assign[u];assert slots[s]==signal[x];raise_(s,g);output_slots.append(s) + common,triple=target;output_records.append((s,g,common,triple)) + targets=[i for i,t in enumerate(c.inputs)if common in t]if len(triple)==1 else[c.inputs.index(triple)] + for i in targets:scatter[i]^=slots[s];J.append((v+i,2*v+s)) + rank=blocks[g]['rank'] + if len(triple)==1:hist[rank]+=1;hist[h-rank]+=1 + else:hist[h-1-rank]+=1;hist[1]+=1 + assert len(set(output_slots))==len(output_slots) + for s in retired:hist[h-blocks[frames[s]]['rank']]+=1 + assert len(retired)+len(output_slots)==len(slots) + assert scatter==[1<1:high=mid + else:raise ArithmeticError('Fine moment enclosure inconclusive') + ab=Q(low,scale) + accepted=exact.exact_moment(575,profile['W'],rows,ab) + rejected=exact.exact_moment(575,profile['W'],rows,Q(high,scale)) + assert accepted['upper']<1, the carrier matching is read from a pinned file +// instead of Hopcroft-Karp. Every pinned edge must lie in the same admissible +// adjacency (causal order and frame inclusion); donors and uses are distinct. +// This replay-only adaptation omits the discovery edge dumper. The original +// optimizer and profiler are preserved in references/copied-fixed/pr44. +// Replay-only adaptation prepared with OpenAI Codex assistance. +// Prepared by Rohan Arun with Anthropic Claude assistance. Apache-2.0. +// Adapted at h=23,25; original PR35 by Dominik Scholz, PR32 by icekylinx. +// Dimension adaptation at 45/47; extra primes for all source-growth cases. +// Exact bounded-minor inequalities are checked by verify.py. Original credit below. +// Copyright 2026 icekylinx. Apache-2.0; AI-assisted handoff integration. +// Original round3_rankone_profiles.cpp. Requires GCC/Clang unsigned __int128. + +// Adapted input reader for complete serialized frame-compiler transitions. +// Actual-word fixed-I+J profiling, adapted from PR48 profiles.cpp. +// All projector, pivot and CRT formulas below are unchanged. +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +using U=uint32_t;using V=uint64_t; +#include "binary_io.hpp" +int main(int argc,char**argv){ +assert(argc==2);std::ifstream f(argv[1],std::ios::binary);U hdr[6];read_array(f,hdr); +U h=hdr[0],v=hdr[1],R=hdr[2],nf=hdr[3],nt=hdr[4];int64_t singles=hdr[5];assert(h==23||h==25); +V sum,loss;f.read(reinterpret_cast(&sum),8);f.read(reinterpret_cast(&loss),8); +struct Frame{V core,cover;U rank;};std::vectorframes; +for(U i=0;i(&a.core),8);f.read(reinterpret_cast(&a.cover),8);f.read(reinterpret_cast(&a.rank),4);frames.push_back(a);} +std::map,int64_t>transitions; +for(U i=0;i(&a),4);f.read(reinterpret_cast(&b),4);f.read(reinterpret_cast(&count),8);transitions[{a,b}]=count;} +assert(f);assert(sum==h*V(R)+loss); +V p=2305843009213693951ULL; +auto mul=[&](V a,V b)->V{return (__uint128_t)a*b%p;}; +auto power=[&](V a,V b)->V{V r=1;for(;b;b>>=1,a=mul(a,a))if(b&1)r=mul(r,a);return r;}; +auto sub=[&](V a,V b)->V{return (a+p-b)%p;}; +std::vector>matrix_cache(frames.size()); +auto matrix=[&](U id)->const std::vector&{auto&A=matrix_cache[id];if(!A.empty())return A;A.assign(h*h,0);if(id==0)return A;if(id==1){for(U i=0;i>i)&1);V zj=((f.core>>j)&1)?3*(h+1)-10:p-10;A[i*h+j]=mul(mul(wi,zj),factor);}return A;} + assert(c==1||c==2);V s=3-c,d=s*s+(c-1)*nn,den=3*(h+1)*d,inv=power(den,p-2); + for(U i=0;i>i)&1,oj=(out>>j)&1,wi=3+((f.core>>i)&1),zj=((f.core>>j)&1)?3*(h+1)-10:p-10; + V num=(mul(s*oi,zj)+3*(h+1)*s*wi*oj+mul(nn*wi,zj))%p;num=sub(num,3*(h+1)*(c-1)*oi*oj);A[i*h+j]=(V(i==j&&oi)+mul(num,inv))%p; + }return A;}; + +std::vectorblocks(h+1);blocks[1]=singles;V done=0,matrices=0,crt_matrices=0,crt_disagreements=0;U longest=0;std::mapcorrection_hist; +U aa,bb; +while(std::cin>>aa>>bb){ + assert(aa=frames[aa].rank); + if(rr<=2){blocks[1]=rr; for(U t=0;t<=h;t++)std::cout<1&&bb>1){ + assert(!(frames[bb].core&~frames[aa].core)); + assert(!(frames[aa].cover&~frames[bb].cover)); + U ca=popcount64(frames[aa].core),cb=popcount64(frames[bb].core); + assert(ca==3||frames[aa].core==frames[bb].core||(ca==2&&cb==1)); + } + const auto&A=matrix(aa);const auto&B=matrix(bb);std::vectorM(h*h);for(U x=0;x>pivots; + for(U i=0;i=0&&!M[i*h+j])j--;if(j<0)continue;pivots.push_back({i,U(j)});V inv=power(M[i*h+j],p-2);for(U k=i+1;k core-one use all three primes at these dimensions. +if(aa>1&&bb>1&&(popcount64(frames[aa].core)==3||(popcount64(frames[aa].core)==2&&popcount64(frames[bb].core)==1))){ + assert(h==23||h==25);crt_matrices++;matrix_cache[aa].clear();matrix_cache[bb].clear();std::vector>> all{pivots}; + for(V extra:{2147483647ULL,524287ULL}){p=extra;matrix_cache[aa].clear();matrix_cache[bb].clear();const auto&C=matrix(aa);const auto&D=matrix(bb);std::vectorY(h*h);for(U z=0;z> pp; + for(U i=0;i=0&&!Y[i*h+j])j--;if(j<0)continue;pp.push_back({i,U(j)});V inv=power(Y[i*h+j],p-2);for(U k=i+1;k corner((h+1)*(h+1));for(U i=0;i=j;best=std::max(best,rank);}corner[(i+1)*(h+1)+j]=best;} + pivots.clear();for(U i=0;i= j+1 proves persistence.", + "common_cutoff": 14000000000000000000, + "cutoff_log2_input": { + "alpha": 6143424401, + "compact": 24573697601, + "geometry": 3999931954321282821, + "guard": 4349946, + "log_p": 25, + "normalization": 14000000000000000000, + "period": 49147395201, + "phase_cell": 19, + "reservoir": 14, + "stopped_leaf": 252 + }, + "power_checkpoints": [ + { + "log2_input": 14000000000000000000, + "powers": { + "alpha": { + "exponent": 714467976524623, + "rhs": 112000000000000156824, + "rhs_bits": 67 + }, + "compact": { + "exponent": 714467976524623, + "rhs": 448000000000000627232, + "rhs_bits": 69 + }, + "leaf": { + "exponent": 666666666666666666, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 714467976524623, + "rhs": 224000000000000313576, + "rhs_bits": 68 + }, + "rows": { + "exponent": 714467976524623, + "rhs": 112000000000000156824000, + "rhs_bits": 77 + } + } + }, + { + "log2_input": 28000000000000000000, + "powers": { + "alpha": { + "exponent": 1428935953049247, + "rhs": 224000000000000156824, + "rhs_bits": 68 + }, + "compact": { + "exponent": 1428935953049247, + "rhs": 896000000000000627232, + "rhs_bits": 70 + }, + "leaf": { + "exponent": 1333333333333333333, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 1428935953049247, + "rhs": 448000000000000313576, + "rhs_bits": 69 + }, + "rows": { + "exponent": 1428935953049247, + "rhs": 224000000000000156824000, + "rhs_bits": 78 + } + } + }, + { + "log2_input": 56000000000000000000, + "powers": { + "alpha": { + "exponent": 2857871906098494, + "rhs": 448000000000000156824, + "rhs_bits": 69 + }, + "compact": { + "exponent": 2857871906098494, + "rhs": 1792000000000000627232, + "rhs_bits": 71 + }, + "leaf": { + "exponent": 2666666666666666666, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 2857871906098494, + "rhs": 896000000000000313576, + "rhs_bits": 70 + }, + "rows": { + "exponent": 2857871906098494, + "rhs": 448000000000000156824000, + "rhs_bits": 79 + } + } + }, + { + "log2_input": 112000000000000000000, + "powers": { + "alpha": { + "exponent": 5715743812196989, + "rhs": 896000000000000156824, + "rhs_bits": 70 + }, + "compact": { + "exponent": 5715743812196989, + "rhs": 3584000000000000627232, + "rhs_bits": 72 + }, + "leaf": { + "exponent": 5333333333333333333, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 5715743812196989, + "rhs": 1792000000000000313576, + "rhs_bits": 71 + }, + "rows": { + "exponent": 5715743812196989, + "rhs": 896000000000000156824000, + "rhs_bits": 80 + } + } + }, + { + "log2_input": 224000000000000000000, + "powers": { + "alpha": { + "exponent": 11431487624393978, + "rhs": 1792000000000000156824, + "rhs_bits": 71 + }, + "compact": { + "exponent": 11431487624393978, + "rhs": 7168000000000000627232, + "rhs_bits": 73 + }, + "leaf": { + "exponent": 10666666666666666666, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 11431487624393978, + "rhs": 3584000000000000313576, + "rhs_bits": 72 + }, + "rows": { + "exponent": 11431487624393978, + "rhs": 1792000000000000156824000, + "rhs_bits": 81 + } + } + }, + { + "log2_input": 448000000000000000000, + "powers": { + "alpha": { + "exponent": 22862975248787956, + "rhs": 3584000000000000156824, + "rhs_bits": 72 + }, + "compact": { + "exponent": 22862975248787956, + "rhs": 14336000000000000627232, + "rhs_bits": 74 + }, + "leaf": { + "exponent": 21333333333333333333, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 22862975248787956, + "rhs": 7168000000000000313576, + "rhs_bits": 73 + }, + "rows": { + "exponent": 22862975248787956, + "rhs": 3584000000000000156824000, + "rhs_bits": 82 + } + } + } + ], + "practical_runtime_claim": false + }, + "kappa": "1020702544357/20000000000000000", + "next_kappa": "51035127217851/1000000000000000000", + "next_kappa_rejection": "{'g3_above_kappa': '-269062559176175173704556877239659/1262690704206988627525123642091073250000000000000000'}" + }, + "scope": "Exact arithmetic only. The frozen full physical receipt is retained; all inherited all-size interfaces remain conditional.", + "source_sha256": { + "references/frame-compiler/pr48/research/copied-fixed/balanced_assembly.py": "4d27575dcad2b45a281a34054d311409ecd954f373c0c3a62c29bcc843f06a86", + "research/cost-live-both/PROOF.md": "67a05de586fce1ddc21eafb35ec69c9744cc25d7a1f503a640900116e1f01337", + "research/cost-live-both/candidate.json": "06a0f2927f419c1ea108cd9b6f1e64d3174de8ba440a71c2e433c0bfee5a4b98", + "research/cost-live-both/compiler.py": "58caca9b5336a2d50fcc45b56abfac60bbb795856b5c806ba4bfa5f649412642", + "research/cost-live-both/experiment.py": "1d04f6b9dfd1152b872043bf9e96350a384829ca219289ae00e75a0195382573", + "research/cost-live-both/focused-manifest.json": "af9fd7a954b73ea6face713cb26ec70067db3e4c5c2745bc08e7dc50d8f64b50", + "research/cost-live-both/frame-compiler.json": "179a87d20d47aa7cbb96b51c69686a95aaf457d51b14acbf91583ee8dd751600", + "research/cost-live-both/frame-profiles-23.json": "060de0d629455d101b342e16fa6d34093b89c7508752752a9223a77be98c7234", + "research/cost-live-both/frame-profiles-25.json": "196ca014af8d24a4f56e017a333ea4daecf6d5bb9d0307eb7310be1f73926b09", + "research/cost-live-both/frame-transitions-23.json": "aa2c4fb3168376a5c50b68ee1e17108cdbe1c5c21b0579dd94fd31aa65ce7023", + "research/cost-live-both/frame-transitions-25.json": "f9c3f30406c766ac8272a6ab140cb3167a607e1f320731bde368ca1f696cd5fa", + "research/cost-live-both/frame-word-23.json.gz": "b607b857aa4582744d8bf3f721e131e5168cf083492c58e48792a855c6ec1b9d", + "research/cost-live-both/frame-word-25.json.gz": "c9b14fd60c365b60f89e1b2f8a5a1ec8cb1095244bd13c41fc9e2a284ee39ec7", + "research/cost-live-both/profile_oracle.cpp": "d1f6b650de9fb5842b412595369271d9eeb6f54045c76c0fb5cad29854955c35", + "research/cost-live-both/validate.py": "fcbe3502bf2477f7624b7f9169e94ff4bf480a227f64ce9b43d4eb5c86ff0ec2", + "research/cost-live-both/validation-receipt.json": "bec439f95cf6d16400e46d9e53399ce7038c0d287368a5620a552f0315e06927", + "research/slot-cost-rank-pair/arithmetic/refine.py": "8af4f9ed6cec841fe691b7f7950ca7b17483282e8869795922d29f10a4d49c16", + "scripts/experiments/binary_frame_math.py": "1f96e8aafc8ae89f8eeec5d03800131d93d58e01bf8a7fca8feb03702d1740d0" + }, + "status": "PASS exact parameter-only refinement; frozen physical evidence unchanged" +} diff --git a/research/cost-live-parameters/refine.py b/research/cost-live-parameters/refine.py new file mode 100644 index 0000000000..9e45e41db5 --- /dev/null +++ b/research/cost-live-parameters/refine.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python3 +"""Exact backoff refinement of the physically validated cost/live profile. + +Parameter refinement follows the PR61 precedent of Alejandro Zarzuelo +Urdiales; exact moment bounds and assembly adapter are Rohan Arun's PR67. +Dominik Scholz with substantial OpenAI GPT-6 Astra assistance. Apache-2.0. +This does not modify or rerun the frozen physical construction. +""" +import sys +if sys.flags.optimize: + raise ValueError('Assertions must remain enabled') +sys.dont_write_bytecode=True +import argparse +from fractions import Fraction as Q +from hashlib import sha256 +import importlib.util +import json +from pathlib import Path + +HERE=Path(__file__).resolve().parent +ROOT=HERE.parents[1] + + +def main(): + parser=argparse.ArgumentParser(description=__doc__) + parser.add_argument('--record',action='store_true',help='Regenerate the exact certificate') + args=parser.parse_args() + manifest=json.loads((HERE/'source-manifest.json').read_text()) + for name,digest in manifest.items(): + assert sha256((ROOT/name).read_bytes()).hexdigest()==digest,name+' changed' + source=ROOT/'research/slot-cost-rank-pair/arithmetic/refine.py' + spec=importlib.util.spec_from_file_location('pr67_parameter_refinement',source) + exact=importlib.util.module_from_spec(spec);spec.loader.exec_module(exact) + old=json.loads((ROOT/'research/cost-live-both/candidate.json').read_text()) + receipt=json.loads((ROOT/'research/cost-live-both/validation-receipt.json').read_text()) + assert receipt['candidate_sha256']==sha256((ROOT/'research/cost-live-both/candidate.json').read_bytes()).hexdigest() + profile=old['bit'];rows={int(t):n for t,n in profile['child_multiplicities'].items()} + ab=Q(old['bit_saving']);old_kappa=Q(old['kappa']);backoff=Q(1,10**18) + accepted=exact.exact_moment(profile['m'],profile['W'],rows,ab) + excluded=exact.exact_moment(profile['m'],profile['W'],rows,ab+Q(1,10**18)) + assert accepted['upper']<1 E +on the live control. The carrier is only an XOR control and its clean signal +is unchanged. Its later use can still raise it from E to G. Repeated use is +subject to the same inclusion test with its then-current frame, so the entire +physical frame path remains nested. + +This introduces no free copies, source-dependent runtime choice, or uncharged +frame jump. Candidate selection happens once while constructing a fixed finite +word. Every operation in that word is still a literal two-slot XOR. + +## Dirty state and frames + +The compiler's block transformations remain invertible on all incoming dirty +coordinates. Each additional clearing operation is invertible too. Therefore +the complete mixer M is invertible. The inherited word has the form + + M, J, inverse(M), V, M, J, inverse(M), V. + +Its dirty-scratch cancellation argument only requires the mixer to be a fixed +invertible word and its clean signal map to give the required injection. The +new controls preserve those properties. This argument is supplemented by +independent serialized replay on **every** input and dirty basis vector for +both h=23 and h=25 and both orientations; see `selected-replay-*.json`. + +Frame preparation independently reconstructs every transition from the actual +XOR list, checks it against the auxiliary event log, and checks every inclusion. +All frames remain the inherited original-envelope projectors. Consequently +the same fixed-I+J formulas and bounded-minor/CRT argument apply without a new +projector formula or denominator bound. The ranked/global profiles use 6,049 +and 7,997 CRT-checked matrices and report zero modular disagreements. + +Neither W nor total rank changes. The actual fixed-basis child profiles change +because different clearing expressions promote different slots at different +points. This is the source of the finite moment improvement; counting roles +alone misses it. + +## The selected finite profile improves every concave power + +There is also an exact comparison independent of the selected parameter grid. +Let d_t be the selected child multiplicity minus PR #63's pinned multiplicity. +The integer certificate `concavity-screen.json` checks + + sum(t*d_t) = 0, + C_k = sum(min(t,k)*d_t) <= 0 for every integer 1 <= k <= 529, + +with a strict inequality for some k. Its smallest C_k is -619850. The source +profile is pinned to PR #63 commit `aa7701b68540b7863d3b66a414e4319915d6282d` +in `comparison-pr63.json`. For any f with f(0)=0 and decreasing discrete +increments, the identity + + sum(d_t*f(t)) = sum_(k=1..528) (2*f(k)-f(k-1)-f(k+1))*C_k + +holds because the linear mass term vanishes. For f(t)=t^(1-a), 01 for b in blocks) + def new(g): + s=len(slots);slots.append(0);frames.append(g);hist[blocks[g]['rank']]+=1;events.append((s,-1,g));return s + def raise_(s,g): + old=frames[s];assert contains(blocks[old]['frame'],blocks[g]['frame']);hist[blocks[g]['rank']-blocks[old]['rank']]+=1;frames[s]=g;events.append((s,old,g)) + def xor(a,b,g): + assert a!=b;raise_(a,g);raise_(b,g);slots[a]^=slots[b];ops.append((a,b,g)) + def acquire(g,anchors): + if reclaim: + bb={} + def ins(s): + row=slots[s];expr=1<>s&1;e^=1<>i&1) + if j!=i: + # Synthesize swap as three XORs at the single common frame. + for a,z in ((i,j),(j,i),(i,j)):rr[a]^=rr[z];elim.append((a,z)) + for j in range(len(ins)): + if j!=i and rr[j]>>i&1:rr[j]^=rr[i];elim.append((j,i)) + assert rr==[1<>i&1:xor(s,value_slots[y],g) + assert slots[s]==signal[x];value_slots[x]=s + used=set() + for u in outuses: + x=uses[u][0];s=value_slots[x] + if x in used: + ss=acquire(g,list(value_slots.values()));xor(ss,s,g);s=ss + used.add(x);assert u not in assign;assign[u]=s;assert s not in pending;pending[s]=uses[u][1] + if step%5000==0:print('compile',h,step,len(slots),'reclaimed',stats['reclaimed'],'seconds',time.time()-t0,flush=True,file=sys.stderr) + output_slots=[];output_records=[];scatter=[0]*v;J=[] + for u,(x,g,target)in enumerate(uses): + if target is None:continue + s=assign[u];assert slots[s]==signal[x];raise_(s,g);output_slots.append(s) + common,triple=target;output_records.append((s,g,common,triple)) + targets=[i for i,t in enumerate(c.inputs)if common in t]if len(triple)==1 else[c.inputs.index(triple)] + for i in targets:scatter[i]^=slots[s];J.append((v+i,2*v+s)) + rank=blocks[g]['rank'] + if len(triple)==1:hist[rank]+=1;hist[h-rank]+=1 + else:hist[h-1-rank]+=1;hist[1]+=1 + assert len(set(output_slots))==len(output_slots) + for s in retired:hist[h-blocks[frames[s]]['rank']]+=1 + assert len(retired)+len(output_slots)==len(slots) + assert scatter==[1< 0 and excluded['lower'] > 1 + record=dict(scope='Conditional finite changed-word result; inherited theorem and transfer assumptions retained.', + bit_saving=AB,kappa=KAPPA,exact_moment=moment, + next_bit_grid_lower=excluded['lower'],next_kappa_grid_fails=next_kappa_grid_fails,profile=p,assembly=assembled, + profile_files=[f'{prefix}profiles-{h}.json' for h in (23,25)]) + target=HERE/f'{prefix}arithmetic.json' + target.write_text(json.dumps(verify.arithmetic.js(record),indent=2)+'\n') + for h,axis in zip((23,25),axes): + (HERE/f'{prefix}profiles-{h}.json').write_text(json.dumps(axis,indent=2)+'\n') + print(json.dumps(dict(numerical_root=lo,bit_saving=str(AB),kappa=str(KAPPA), + strict_gap=float(moment['strict_gap']),next_bit_lower_excess=float(excluded['lower']-1), + constraints=len(assembled['constraints']),margins=len(assembled['margins'])),indent=2)) + +if __name__=='__main__': + p=argparse.ArgumentParser();p.add_argument('h23');p.add_argument('h25');p.add_argument('--prefix',default='') + a=p.parse_args();evaluate((a.h23,a.h25),a.prefix) diff --git a/research/global-anchor-screen/selected-arithmetic.json b/research/global-anchor-screen/selected-arithmetic.json new file mode 100644 index 0000000000..59c7406463 --- /dev/null +++ b/research/global-anchor-screen/selected-arithmetic.json @@ -0,0 +1,438 @@ +{ + "scope": "Conditional finite changed-word result; inherited theorem and transfer assumptions retained.", + "bit_saving": "5103199/100000000000", + "kappa": "2551469/50000000000", + "exact_moment": { + "saving": "5103199/100000000000", + "exponent": "99994896801/100000000000", + "lower": "1285798181249844094090940029578838260968542502877465630065290642566600041663241131137191604208390394570907581032458492388942784714467/1285798181250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "upper": "448848933013459330731491343622573432365477741215890633915140386440451549357667475224630775028439326775466293001346975757689458076880846291901272971849682282845076045363790188955422549604336181499729812330871845157069870886614266150585956820564663773597453812998603390569150343161334990045745533865844493233164613275015961366609505553067368201332049707876245663583067533705881757450466419848700522664111541839306466068011203721081247082117768901555927244661906934750967007997113519279064886399036187753233387028278078234458089655656051130440970951132725505382608400475436720674402364340582606985462202316917989609236608999071269233985926821402874831698402356133511295385563079490325569605355656634418128769583176194797421752568111421348049241717090608667346132413289374443251966894279271178912589266552318142919925941092222864011173404957483586654168998871552513713759891131219191853496888667307104284148482625273461847478670916475445969267081527310905332293360209325609787596351250548050783451036324632654070626667850970268100122194875857540061960572704618227361956918292480378996505429050168767510460363757715301879944720122072497093132401/448848933013513746373843164423674689040045441404192732954511134961437982116404738154507424410324185518263719908475086673577582361753228337853978711380035967712408620570849667354809661362367704085465744491346612130150103888071486026297090084198922463327121421111204848826587259900719158649900549007022677408410577339485121384672618295363553253617349571519924663220515480146059769390690086922439048914485353640570701265577437568052719959268024109405925965604555886515946325153290958499804725537173497706752390995691227479567527585726644097624657967226735988276801253593097020242968363714115100878334201769969729670268184914867662464019827247118724527737685435688644637066449363443502817966100752416417127810204518134876321221571826252844690813043852034665583590002393958985552714312149488314101609589066498377370168326850843590777534693107496876285527861088580983353260515402571800318562258319863309479752589686668943187242735412652487148308608671827956575691576174994147878910820665564399673156280525581600090727437636370605888554672190127977568665250901965446128469187792380396553358205076234211370500000000000000000000000000000000000000000", + "strict_gap": "54415642351820801101256674567700188302099039370748520986432758737262929876649381884858742797426907128110915888124284872382045952705739530353684867332575207059478399387111758031522585735932160474766973080233001457219875711133263634258689729667608112601458257436916739384168604155015141178184175245964064469160018063112742296185052285299863643678999637447946440178011940223667073738526250373811801264235197566233846971472877150255207849998720942648951764979317156177439220739839138137309953519003967413149245109437930070592967183687016094010482894192853117660299568565999373532493892871999453051740061031575915796393230033900425715849696039283079555133341680886283953177248360745095781998999040621341940078899469003714831496641571326761425998237457589104584542300747417870217135189020322514180234450242385758620726766361288150013289631358862217028469639500624271352608465065369652556205195604107061395481339764064496177041179041527144517051243398215965668538091314469415016348889705244200948946020100769785400337788432477314270437506704678197347218766512269499900017556852776026065443860039636242284698120055279877927502906867599/448848933013513746373843164423674689040045441404192732954511134961437982116404738154507424410324185518263719908475086673577582361753228337853978711380035967712408620570849667354809661362367704085465744491346612130150103888071486026297090084198922463327121421111204848826587259900719158649900549007022677408410577339485121384672618295363553253617349571519924663220515480146059769390690086922439048914485353640570701265577437568052719959268024109405925965604555886515946325153290958499804725537173497706752390995691227479567527585726644097624657967226735988276801253593097020242968363714115100878334201769969729670268184914867662464019827247118724527737685435688644637066449363443502817966100752416417127810204518134876321221571826252844690813043852034665583590002393958985552714312149488314101609589066498377370168326850843590777534693107496876285527861088580983353260515402571800318562258319863309479752589686668943187242735412652487148308608671827956575691576174994147878910820665564399673156280525581600090727437636370605888554672190127977568665250901965446128469187792380396553358205076234211370500000000000000000000000000000000000000000", + "logarithms": { + "1": { + "lower": "3177185020398675220004135749131/500000000000000000000000000000", + "upper": "6354370040797350440008271498263/1000000000000000000000000000000" + }, + "2": { + "lower": "1415305715059351282647759844201/250000000000000000000000000000", + "upper": "1132244572047481026118207875361/200000000000000000000000000000" + }, + "3": { + "lower": "262787887606462037430651313067/50000000000000000000000000000", + "upper": "5255757752129240748613026261341/1000000000000000000000000000000" + }, + "4": { + "lower": "2484037839838729910586903627673/500000000000000000000000000000", + "upper": "4968075679677459821173807255347/1000000000000000000000000000000" + }, + "5": { + "lower": "1186233032090812516351878041259/250000000000000000000000000000", + "upper": "4744932128363250065407512165037/1000000000000000000000000000000" + }, + "6": { + "lower": "4562610571569295439195794139881/1000000000000000000000000000000", + "upper": "2281305285784647719597897069941/500000000000000000000000000000" + }, + "7": { + "lower": "4408459891742037134902918754819/1000000000000000000000000000000", + "upper": "220422994587101856745145937741/50000000000000000000000000000" + }, + "8": { + "lower": "66795757798711164246196486467/15625000000000000000000000000", + "upper": "4274928499117514511756575133889/1000000000000000000000000000000" + }, + "9": { + "lower": "4157145463461131057217781024417/1000000000000000000000000000000", + "upper": "2078572731730565528608890512209/500000000000000000000000000000" + }, + "10": { + "lower": "2025892473901652377995140021789/500000000000000000000000000000", + "upper": "4051784947803304755990280043579/1000000000000000000000000000000" + }, + "11": { + "lower": "3956474767998979895946327920297/1000000000000000000000000000000", + "upper": "1978237383999489947973163960149/500000000000000000000000000000" + }, + "12": { + "lower": "3869463391009350129778562018423/1000000000000000000000000000000", + "upper": "483682923876168766222320252303/125000000000000000000000000000" + }, + "13": { + "lower": "3789420683335813703954784056697/1000000000000000000000000000000", + "upper": "1894710341667906851977392028349/500000000000000000000000000000" + }, + "14": { + "lower": "3715312711182091825485686633361/1000000000000000000000000000000", + "upper": "1857656355591045912742843316681/500000000000000000000000000000" + }, + "15": { + "lower": "3646319839695140374012266928113/1000000000000000000000000000000", + "upper": "1823159919847570187006133464057/500000000000000000000000000000" + }, + "16": { + "lower": "3581781318557569202339343012429/1000000000000000000000000000000", + "upper": "358178131855756920233934301243/100000000000000000000000000000" + }, + "17": { + "lower": "3521156696741134359758736880389/1000000000000000000000000000000", + "upper": "352115669674113435975873688039/100000000000000000000000000000" + }, + "18": { + "lower": "3463998282901185747800548902959/1000000000000000000000000000000", + "upper": "43299978536264821847506861287/12500000000000000000000000000" + }, + "19": { + "lower": "1704965530815454989999622033187/500000000000000000000000000000", + "upper": "27279448493047279839993952531/8000000000000000000000000000" + }, + "20": { + "lower": "83965944181083986164326198053/25000000000000000000000000000", + "upper": "3358637767243359446573047922121/1000000000000000000000000000000" + }, + "21": { + "lower": "413730950384240930438459189737/125000000000000000000000000000", + "upper": "3309847603073927443507673517897/1000000000000000000000000000000" + }, + "22": { + "lower": "3263327587439034586529095798839/1000000000000000000000000000000", + "upper": "81583189685975864663227394971/25000000000000000000000000000" + }, + "23": { + "lower": "804718956217050187300379666613/250000000000000000000000000000", + "upper": "3218875824868200749201518666453/1000000000000000000000000000000" + }, + "25": { + "lower": "313549421592914969080675283181/100000000000000000000000000000", + "upper": "3135494215929149690806752831811/1000000000000000000000000000000" + }, + "481": { + "lower": "35700554138317851917337677133/200000000000000000000000000000", + "upper": "89251385345794629793344192833/500000000000000000000000000000" + }, + "525": { + "lower": "22742944551431673576538712861/250000000000000000000000000000", + "upper": "18194355641145338861230970289/200000000000000000000000000000" + }, + "529": { + "lower": "41690804469525529197382917321/500000000000000000000000000000", + "upper": "83381608939051058394765834643/1000000000000000000000000000000" + } + } + }, + "next_bit_grid_lower": "20754748535248989246689986796061484053441134795712909290280140538588149714214098678767013825755063648876909426560234186047/20754748535156250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "next_kappa_grid_fails": true, + "profile": { + "m": 575, + "N": 4073300, + "W": 137151806, + "L": 2226400, + "total_rank": 78860441550, + "deficit": 1846900, + "maxchild": 529, + "child_multiplicities": { + "1": 1725430307, + "2": 82910952, + "3": 45677862, + "4": 25313478, + "5": 19651200, + "6": 18746265, + "7": 17074671, + "8": 13317184, + "9": 10936339, + "10": 8914616, + "11": 8652347, + "12": 6291052, + "13": 5416960, + "14": 4009682, + "15": 3352917, + "16": 2059926, + "17": 9624764, + "18": 926325, + "19": 322322, + "20": 301852, + "21": 16346100, + "22": 97405, + "23": 72402275, + "25": 64793806, + "481": 8146600, + "525": 64793806, + "529": 64211400 + }, + "parts": { + "data": { + "1": 73319400, + "21": 8146600, + "17": 8146600, + "481": 8146600 + }, + "paid_endpoint_copy": { + "1": 4073300 + }, + "internal_23": { + "1": 791020600, + "2": 38791800, + "3": 24209800, + "4": 13238800, + "5": 9556500, + "6": 8979200, + "7": 8395000, + "8": 6580300, + "9": 5253200, + "10": 4140000, + "11": 3946800, + "12": 2904900, + "13": 2477100, + "14": 1633000, + "15": 1357000, + "16": 809600, + "17": 443900, + "18": 262200, + "20": 103500, + "21": 52900 + }, + "exterior_23": { + "23": 64211400, + "529": 64211400 + }, + "data_growth_23": { + "1": 8146600, + "21": 8146600 + }, + "internal_25": { + "1": 840723807, + "2": 44119152, + "3": 21468062, + "4": 12074678, + "5": 10094700, + "6": 9767065, + "7": 8679671, + "8": 6736884, + "9": 5683139, + "10": 4774616, + "11": 4705547, + "12": 3386152, + "13": 2939860, + "14": 2376682, + "15": 1995917, + "16": 1250326, + "17": 1034264, + "18": 664125, + "19": 322322, + "20": 198352, + "22": 97405, + "23": 44275 + }, + "exterior_25": { + "25": 64793806, + "525": 64793806 + }, + "data_growth_25": { + "1": 8146600, + "23": 8146600 + } + }, + "axes": [ + { + "h": 23, + "v": 1771, + "R": 27918, + "loss": 506, + "rank_sum": 642620, + "field_prime": 2305843009213693951, + "frames": 52475, + "distinct_matrices": 36378, + "crt_matrices": 6049, + "crt_disagreements": 0, + "blocks": [ + 0, + 343922, + 16866, + 10526, + 5756, + 4155, + 3904, + 3650, + 2861, + 2284, + 1800, + 1716, + 1263, + 1077, + 710, + 590, + 352, + 193, + 114, + 0, + 45, + 23, + 0, + 0 + ] + }, + { + "h": 25, + "v": 2300, + "R": 36586, + "loss": 600, + "rank_sum": 915250, + "field_prime": 2305843009213693951, + "frames": 73697, + "distinct_matrices": 50243, + "crt_matrices": 7997, + "crt_disagreements": 0, + "blocks": [ + 0, + 474717, + 24912, + 12122, + 6818, + 5700, + 5515, + 4901, + 3804, + 3209, + 2696, + 2657, + 1912, + 1660, + 1342, + 1127, + 706, + 584, + 375, + 182, + 112, + 0, + 55, + 25, + 0, + 0 + ] + } + ] + }, + "assembly": { + "parameters": { + "a_bit": "5103199/100000000000", + "a_complex": "717/10000000", + "tau": "99994896801/100000000000", + "sigma": "9999283/10000000", + "beta": "1/20", + "h": "1/1000000000000", + "q": "2551599499994896801/50000000000000000000000", + "c": "2551599512494896801/50000000000000000000000", + "epsilon": "5555555555550000000000/5555839066611110544089", + "lambda_": "99994896801000005103199/100000000000000000000000", + "lambda_prime": "49997448400500005103199/50000000000000000000000", + "alpha_squared_power": "567022116665249111388889455911/11111678133222221088178000000000000", + "delta": "1/8000000000000", + "C0": 2358858462850846165593256368932965330169899180021667007021321420800, + "C1": "1", + "kappa": "2551469/50000000000" + }, + "constraints": { + "a_positive": "5103199/100000000000", + "a_below_b": "2066801/100000000000", + "b_below_one_over32": "311783/10000000", + "beta_positive": "1/20", + "beta_below_one": "19/20", + "phase_leaf_above_bit": "1708301/100000000000", + "q_positive": "2551599499994896801/50000000000000000000000", + "q_below_internal": "5103199/50000000000000000000000", + "q_below_leaf": "854150500005103199/50000000000000000000000", + "c_positive": "2551599512494896801/50000000000000000000000", + "c_below_one": "49997448400487505103199/50000000000000000000000", + "q_below_reservations": "1/4000000000000", + "lambda_above_tau": "5103199/100000000000000000000000", + "lambda_above_sigma": "2066801000005103199/100000000000000000000000", + "lambda_above_internal": "5103199/100000000000000000000000", + "lambda_prime_above_lambda": "5103199/100000000000000000000000", + "compact_leaf": "854150500005103199/50000000000000000000000", + "compact_reservations": "1/4000000000000", + "lambda_prime_below_one": "2551599499994896801/50000000000000000000000", + "epsilon_positive": "5555555555550000000000/5555839066611110544089", + "epsilon_below_one": "283511061110544089/5555839066611110544089", + "guard_width": "283511061110544089/5555839066611110544089", + "K_geometry": "4166950177723610544089/5555839066611110544089000000000000", + "K_dominates_log": "283511056943593911276389455911/5555839066611110544089000000000000", + "record_suffix": "283511061110544089/5555839066611110544089", + "phase_local": "2268088483328513645388889455911/44446712532888884352712000000000000", + "phase_boundary": "453617692221031475788889455911/8889342506577776870542400000000000", + "gamma_sublinear": "1/2000000000000", + "cell_above_band": "11111111111094444160933388889455911/22223356266444442176356000000000000", + "prime_interval_packing": "283511061110544089/5555839066611110544089", + "alpha_positive": "567022116665249111388889455911/11111678133222221088178000000000000", + "alpha_below_one": "11111111111105555839066611110544089/11111678133222221088178000000000000", + "alpha_below_one_fourth": "2777352511188890022933111110544089/11111678133222221088178000000000000", + "delta_positive": "1/8000000000000", + "delta_below_one_eighth": "999999999999/8000000000000", + "short_record_fallback": "555527203002631109247282515559289/555583906661111054408900000000000", + "small_field_exposure": "1/1000000000000", + "artificial_boundary": "311129255818727742338895833331632267/44446712532888884352712000000000000", + "literal_scalar_guard": "9693793493753822316795466474748", + "row_product_gap": "6548/25", + "g1_above_kappa": "1908080020841183783259/277791953330555527204450000000000", + "g2_above_kappa": "261/100000000000", + "g3_above_kappa": "32605761350212565121091/5555839066611110544089000000000000", + "g4_above_kappa": "261/100000000000", + "g5_above_kappa": "55502721600306770520199/8889342506577776870542400000000000", + "g6_above_kappa": "299736964267978294777351/44446712532888884352712000000000000", + "g7_above_kappa": "277763602226352552816391183783259/277791953330555527204450000000000" + }, + "margins": { + "g1": "283511061110544089/5555839066611110544089", + "g2": "5103199/100000000000", + "g3": "283511055554705022388889455911/5555839066611110544089000000000000", + "g4": "5103199/100000000000", + "g5": "453617692221031475788889455911/8889342506577776870542400000000000", + "g6": "2268088483328513645388889455911/44446712532888884352712000000000000", + "g7": "5555555555550000000000/5555839066611110544089" + }, + "minimum_margin": "283511055554705022388889455911/5555839066611110544089000000000000", + "absorption_gap": "32605761350212565121091/5555839066611110544089000000000000", + "scoped_limit": "5103199/100005103199", + "recurrence": { + "internal": "99994896801/100000000000", + "leaf": "199986377/200000000", + "reservations": "49997448400487505103199/50000000000000000000000" + }, + "finite_bridge": { + "bit": { + "m": 575, + "W": 137151806, + "maxchild": 529, + "halving_degree": 9, + "wire_bits": 28 + }, + "complex": { + "m": 784, + "W": 537696432, + "maxchild": 756, + "halving_degree": 20, + "wire_bits": 30, + "s": 421548223824, + "scalar_group_upper": 4793351472 + }, + "semantic": { + "E": 9696565176891520488192506033216, + "B": 9696565176891520488614054257040, + "C0": 2358858462850846165593256368932965330169899180021667007021321420800, + "C1": 1, + "literal_charge": 2771683137698171397039558468, + "strict_literal_gap": 9693793493753822316795466474748, + "induction_gap": 533311084729033626873772984137200 + }, + "rows": { + "coefficient": 852, + "degree": 2000, + "degree_gap": "6548/25", + "suffix_slope": 8000 + } + } + }, + "profile_files": [ + "selected-profiles-23.json", + "selected-profiles-25.json" + ] +} diff --git a/research/global-anchor-screen/selected-manifest.json b/research/global-anchor-screen/selected-manifest.json new file mode 100644 index 0000000000..5fe02afc1c --- /dev/null +++ b/research/global-anchor-screen/selected-manifest.json @@ -0,0 +1,42 @@ +{ + "status": "Both selected words, full dirty basis, actual fixed-I+J profiles and exact assembly PASS", + "kappa": "5102938/100000000000", + "bit_saving": "5103199/100000000000", + "roles": { + "23": 27918, + "25": 36586 + }, + "W": 137151806, + "base_commit": "ad0f25ff7b23cff7f08ad237c2254e6ecf74257e", + "compiler": "compiler-frozen.py", + "retired_order": "descending frame rank, ascending slot at h23 and descending slot at h25", + "global_anchor_policy": "pending carriers with current frame <= clearing region <= assigned next-use frame", + "graph_sha256": "3d47e89d2649c90800a276bdd0480131def50e0bdf92c122a19494b55bf17420", + "word_sha256": { + "23": "640696dd7cd893add9d6e12d0d587956fecf113b2eff8c29547b82e5a6f3c0ad", + "25": "044f893d1ca7d69e3999674981d2c4e2824404a1c41695e9a6326345798d7c40" + }, + "files": { + "compiler-frozen.py": "12d646fa9ad69e4f3c532fe69080d8fe1509cde0968a6ab52a9d60273803adc0", + "selected_compile.py": "86bdfcf599c6b131e376773fe177bca57a9f63c9b60bad5de8aa00982d779b22", + "evaluate.py": "26c786a33433db3491c429e4fa5caf664ddf067d75c563ed25f3d4ed558cf5a1", + "PROOF.md": "3023c8c039acb3afc2a1e0c2ee55dcffaa4a1a2961076222ae20b03d0f3c6a38", + "SOURCE.json": "f6249b8f91c7721a59ecc6d43a3f2ec65162578203bd430ef76732a3937399f3", + "selected-result-23.json": "45da39b2164e4f0114c92c6b2629fa45d1363b24684927b12e21b58890cbc3ae", + "selected-word-23.json.gz": "ef177e45ef6253f92fd18adf0292ead936789aa5a089e24a14fec3e1c8e3741a", + "selected-replay-23.json": "9d94faa66a7b6183e1b63831f3ba194e0312c84e13c022b2b8bdcf050cfa8b41", + "selected-profiles-23.json": "ba810de465295485090c5027bf073cc391e11b36ebf57963adba2e4bc78cfac4", + "selected-result-25.json": "9d456d3e891c452c528c197c0e7b2dde7bbc81ff730435a346af30e79cccc339", + "selected-word-25.json.gz": "06738b457fc75c09bf9700b37e4f967aaac309243f46963064ec0b283aa830b8", + "selected-replay-25.json": "bdb17292b1b31fcab07435d9c10c46ab13200119afad06937818a6edaa9e5192", + "selected-profiles-25.json": "44904f1e3e479a88408845d9fac5d19724c9aef0f675725d9f78d2629228b84f", + "selected-arithmetic.json": "0e230e094f4faec237c26d332983bf9c99ede4f06dcecb068e64fe63937f5d80", + "comparison-pr63.json": "a99b82f94b74311ccbdab98fe377ac58c47867316af5d142780098e086ef045e", + "concavity-screen.json": "91b1b62b7f29beb5ad540382d3d4bde47f313add58d91b4cf48d3298cac1965e", + "check_dominance.py": "a69331acc6f26147a01d8d8856bf6d47bf5cfbb5a02bfde5f69241bf856da697", + "selected-reproduction.json": "608c0b2cdc8e59d1a63cc9b5932b3c6f5dfc801f60de3b9cbd07dc3b00af9ab2", + "verify.py": "b6a9ba655e28338950b162fdfe5df765c2f4853039124c22afad0234f2048bd6", + "controls.py": "ecef96eafc410eee7b9a6809bb574808bc4a8bb6e08363982b87c8546dddc2a5" + }, + "scope": "Finite construction with inherited conditional theorem/transfer assumptions, no independent full-theorem acceptance." +} diff --git a/research/global-anchor-screen/selected-profiles-23.json b/research/global-anchor-screen/selected-profiles-23.json new file mode 100644 index 0000000000..1663c97520 --- /dev/null +++ b/research/global-anchor-screen/selected-profiles-23.json @@ -0,0 +1,38 @@ +{ + "h": 23, + "v": 1771, + "R": 27918, + "loss": 506, + "rank_sum": 642620, + "field_prime": 2305843009213693951, + "frames": 52475, + "distinct_matrices": 36378, + "crt_matrices": 6049, + "crt_disagreements": 0, + "blocks": [ + 0, + 343922, + 16866, + 10526, + 5756, + 4155, + 3904, + 3650, + 2861, + 2284, + 1800, + 1716, + 1263, + 1077, + 710, + 590, + 352, + 193, + 114, + 0, + 45, + 23, + 0, + 0 + ] +} diff --git a/research/global-anchor-screen/selected-profiles-25.json b/research/global-anchor-screen/selected-profiles-25.json new file mode 100644 index 0000000000..2975751665 --- /dev/null +++ b/research/global-anchor-screen/selected-profiles-25.json @@ -0,0 +1,40 @@ +{ + "h": 25, + "v": 2300, + "R": 36586, + "loss": 600, + "rank_sum": 915250, + "field_prime": 2305843009213693951, + "frames": 73697, + "distinct_matrices": 50243, + "crt_matrices": 7997, + "crt_disagreements": 0, + "blocks": [ + 0, + 474717, + 24912, + 12122, + 6818, + 5700, + 5515, + 4901, + 3804, + 3209, + 2696, + 2657, + 1912, + 1660, + 1342, + 1127, + 706, + 584, + 375, + 182, + 112, + 0, + 55, + 25, + 0, + 0 + ] +} diff --git a/research/global-anchor-screen/selected-replay-23.json b/research/global-anchor-screen/selected-replay-23.json new file mode 100644 index 0000000000..6d9b8a5583 --- /dev/null +++ b/research/global-anchor-screen/selected-replay-23.json @@ -0,0 +1,33 @@ +{ + "status": "independent serialized word, exact frames, full input and dirty basis both orientations PASS", + "h": 23, + "roles": 27918, + "output_roles": 5336, + "elementary_xors": 149172, + "word_length": 621482, + "full_basis_vectors": 31460, + "rank_mass": 642620, + "histogram": { + "1": 42694, + "0": 162950, + "2": 82741, + "3": 11086, + "4": 10683, + "6": 2005, + "5": 7757, + "8": 1362, + "9": 525, + "10": 449, + "12": 464, + "14": 2005, + "16": 547, + "18": 4220, + "19": 7820, + "22": 23, + "15": 544, + "17": 368, + "7": 275, + "21": 165, + "13": 22 + } +} diff --git a/research/global-anchor-screen/selected-replay-25.json b/research/global-anchor-screen/selected-replay-25.json new file mode 100644 index 0000000000..b466dd83c1 --- /dev/null +++ b/research/global-anchor-screen/selected-replay-25.json @@ -0,0 +1,34 @@ +{ + "status": "independent serialized word, exact frames, full input and dirty basis both orientations PASS", + "h": 25, + "roles": 36586, + "output_roles": 6925, + "elementary_xors": 206090, + "word_length": 856560, + "full_basis_vectors": 41186, + "rank_mass": 915250, + "histogram": { + "1": 55478, + "0": 224613, + "2": 116089, + "3": 14362, + "4": 16628, + "5": 10311, + "6": 1804, + "8": 2105, + "9": 654, + "10": 529, + "12": 577, + "14": 529, + "16": 3176, + "18": 519, + "20": 5436, + "21": 10153, + "24": 25, + "17": 877, + "19": 375, + "13": 49, + "7": 407, + "23": 220 + } +} diff --git a/research/global-anchor-screen/selected-reproduction.json b/research/global-anchor-screen/selected-reproduction.json new file mode 100644 index 0000000000..488945df83 --- /dev/null +++ b/research/global-anchor-screen/selected-reproduction.json @@ -0,0 +1,194 @@ +{ + "status": "PASS selected frozen compiler independently regenerated both exact words, then replayed them on every dirty/input basis in both orientations", + "axes": { + "23": { + "compiled": { + "h": 23, + "mode": { + "matching": true, + "reclaim": true, + "rank_first": true, + "reverse_ties": false + }, + "roles": 27918, + "baseline_pr48_roles": 36432, + "histogram": { + "1": 42694, + "0": 302093, + "2": 82741, + "3": 11086, + "4": 10683, + "6": 2005, + "5": 7757, + "8": 1362, + "9": 525, + "10": 449, + "12": 464, + "14": 2005, + "16": 547, + "18": 4220, + "19": 7820, + "22": 23, + "15": 544, + "17": 368, + "7": 275, + "21": 165, + "13": 22 + }, + "rank_mass": 642620, + "elementary_xors": 149172, + "stats": { + "augmentations": 220, + "regions": 52473, + "matched": 37025, + "multi_node_regions": 10350, + "live_anchor_candidates": 79041, + "live_anchor_xors": 180, + "reclaimed": 801, + "clearing_xors": 1612 + }, + "dirty_basis_vectors": 31460, + "complete_dirty_basis_both_orientations": true, + "all_physical_frame_inclusions": true + }, + "replay": { + "status": "independent serialized word, exact frames, full input and dirty basis both orientations PASS", + "h": 23, + "roles": 27918, + "output_roles": 5336, + "elementary_xors": 149172, + "word_length": 621482, + "full_basis_vectors": 31460, + "rank_mass": 642620, + "histogram": { + "1": 42694, + "0": 162950, + "2": 82741, + "3": 11086, + "4": 10683, + "6": 2005, + "5": 7757, + "8": 1362, + "9": 525, + "10": 449, + "12": 464, + "14": 2005, + "16": 547, + "18": 4220, + "19": 7820, + "22": 23, + "15": 544, + "17": 368, + "7": 275, + "21": 165, + "13": 22 + } + } + }, + "25": { + "compiled": { + "h": 25, + "mode": { + "matching": true, + "reclaim": true, + "rank_first": true, + "reverse_ties": true + }, + "roles": 36586, + "baseline_pr48_roles": 48329, + "histogram": { + "1": 55478, + "0": 416889, + "2": 116089, + "3": 14362, + "4": 16628, + "5": 10311, + "6": 1804, + "8": 2105, + "9": 654, + "10": 529, + "12": 577, + "14": 529, + "16": 3176, + "18": 519, + "20": 5436, + "21": 10153, + "24": 25, + "17": 877, + "19": 375, + "13": 49, + "7": 407, + "23": 220 + }, + "rank_mass": 915250, + "elementary_xors": 206090, + "stats": { + "augmentations": 286, + "regions": 73695, + "matched": 53194, + "multi_node_regions": 13975, + "live_anchor_candidates": 103749, + "live_anchor_xors": 218, + "reclaimed": 1090, + "clearing_xors": 2267 + }, + "dirty_basis_vectors": 41186, + "complete_dirty_basis_both_orientations": true, + "all_physical_frame_inclusions": true + }, + "replay": { + "status": "independent serialized word, exact frames, full input and dirty basis both orientations PASS", + "h": 25, + "roles": 36586, + "output_roles": 6925, + "elementary_xors": 206090, + "word_length": 856560, + "full_basis_vectors": 41186, + "rank_mass": 915250, + "histogram": { + "1": 55478, + "0": 224613, + "2": 116089, + "3": 14362, + "4": 16628, + "5": 10311, + "6": 1804, + "8": 2105, + "9": 654, + "10": 529, + "12": 577, + "14": 529, + "16": 3176, + "18": 519, + "20": 5436, + "21": 10153, + "24": 25, + "17": 877, + "19": 375, + "13": 49, + "7": 407, + "23": 220 + } + } + } + }, + "profiles": { + "exact_crt_replay": true, + "crt_matrices": { + "23": 6049, + "25": 7997 + }, + "disagreements": 0 + }, + "arithmetic": { + "bit_saving": "5103199/100000000000", + "kappa": "5102938/100000000000", + "strict_constraints": 47, + "margins": 7, + "next_bit_grid_excluded": true, + "next_kappa_grid_excluded": true + }, + "repository_validation_scope": "Focused new finite word/profile/arithmetic reproduction only; full repository make verify belongs to the parent integration/CI workflow.", + "unchanged_existing_sources": true, + "commits_or_publication": "none" +} diff --git a/research/global-anchor-screen/selected-result-23.json b/research/global-anchor-screen/selected-result-23.json new file mode 100644 index 0000000000..d7ef9072f2 --- /dev/null +++ b/research/global-anchor-screen/selected-result-23.json @@ -0,0 +1,49 @@ +{ + "h": 23, + "mode": { + "matching": true, + "reclaim": true, + "rank_first": true + }, + "roles": 27918, + "baseline_pr48_roles": 36432, + "histogram": { + "1": 42694, + "0": 302093, + "2": 82741, + "3": 11086, + "4": 10683, + "6": 2005, + "5": 7757, + "8": 1362, + "9": 525, + "10": 449, + "12": 464, + "14": 2005, + "16": 547, + "18": 4220, + "19": 7820, + "22": 23, + "15": 544, + "17": 368, + "7": 275, + "21": 165, + "13": 22 + }, + "rank_mass": 642620, + "elementary_xors": 149172, + "stats": { + "augmentations": 220, + "regions": 52473, + "matched": 37025, + "multi_node_regions": 10350, + "live_anchor_candidates": 79041, + "live_anchor_xors": 180, + "reclaimed": 801, + "clearing_xors": 1612 + }, + "dirty_basis_vectors": 31460, + "complete_dirty_basis_both_orientations": true, + "all_physical_frame_inclusions": true, + "seconds": 110.31256413459778 +} diff --git a/research/global-anchor-screen/selected-result-25.json b/research/global-anchor-screen/selected-result-25.json new file mode 100644 index 0000000000..488bbdb9bd --- /dev/null +++ b/research/global-anchor-screen/selected-result-25.json @@ -0,0 +1,51 @@ +{ + "h": 25, + "mode": { + "matching": true, + "reclaim": true, + "rank_first": true, + "reverse_ties": true + }, + "roles": 36586, + "baseline_pr48_roles": 48329, + "histogram": { + "1": 55478, + "0": 416889, + "2": 116089, + "3": 14362, + "4": 16628, + "5": 10311, + "6": 1804, + "8": 2105, + "9": 654, + "10": 529, + "12": 577, + "14": 529, + "16": 3176, + "18": 519, + "20": 5436, + "21": 10153, + "24": 25, + "17": 877, + "19": 375, + "13": 49, + "7": 407, + "23": 220 + }, + "rank_mass": 915250, + "elementary_xors": 206090, + "stats": { + "augmentations": 286, + "regions": 73695, + "matched": 53194, + "multi_node_regions": 13975, + "live_anchor_candidates": 103749, + "live_anchor_xors": 218, + "reclaimed": 1090, + "clearing_xors": 2267 + }, + "dirty_basis_vectors": 41186, + "complete_dirty_basis_both_orientations": true, + "all_physical_frame_inclusions": true, + "seconds": 292.3103697299957 +} diff --git a/research/global-anchor-screen/selected-word-23.json.gz b/research/global-anchor-screen/selected-word-23.json.gz new file mode 100644 index 0000000000..6524cf27a4 Binary files /dev/null and b/research/global-anchor-screen/selected-word-23.json.gz differ diff --git a/research/global-anchor-screen/selected-word-25.json.gz b/research/global-anchor-screen/selected-word-25.json.gz new file mode 100644 index 0000000000..42d1d94f25 Binary files /dev/null and b/research/global-anchor-screen/selected-word-25.json.gz differ diff --git a/research/global-anchor-screen/selected_compile.py b/research/global-anchor-screen/selected_compile.py new file mode 100644 index 0000000000..0e6efdefa5 --- /dev/null +++ b/research/global-anchor-screen/selected_compile.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +"""Regenerate the selected global-anchor words from frozen source. + +PR57/PR60 compiler and PR62 graph credits are retained in PROOF.md and SOURCE. +Prepared with substantial OpenAI Codex assistance. Apache-2.0. +""" +from pathlib import Path +from hashlib import sha256 +import argparse +import gzip +import importlib.util +import json +import sys +if sys.flags.optimize: + raise ValueError('Assertions must remain enabled') +sys.dont_write_bytecode=True +HERE=Path(__file__).resolve().parent +ROOT=HERE.parents[1] +sys.path[:0]=[str(ROOT/'research/pair-assembly'),str(ROOT/'scripts/experiments')] +from pair_graph import graph +from binary_frame_replay import replay + +def compile_axis(h,destination): + manifest=json.loads((HERE/'selected-manifest.json').read_text()) + frozen=HERE/'compiler-frozen.py' + assert sha256(frozen.read_bytes()).hexdigest()==manifest['files']['compiler-frozen.py'] + assert sha256((ROOT/'research/pair-assembly/pair_graph.py').read_bytes()).hexdigest()==manifest['graph_sha256'] + spec=importlib.util.spec_from_file_location('global_anchor_frozen',frozen) + compiler=importlib.util.module_from_spec(spec);spec.loader.exec_module(compiler) + compiler.graph=graph + result,word=compiler.compile_(h,matching=True,reclaim=True,dirty=True,rank_first=True,reverse_ties=h==25) + result.pop('seconds') + result['mode']['reverse_ties']=h==25 + raw=(json.dumps(word,separators=(',',':'))+'\n').encode() + assert sha256(raw).hexdigest()==manifest['word_sha256'][str(h)] + destination.mkdir(parents=True,exist_ok=True) + target=destination/f'word-{h}.json.gz' + target.write_bytes(gzip.compress(raw,mtime=0)) + receipt=replay(target) + (destination/f'receipt-{h}.json').write_text(json.dumps(dict(compiled=result,replay=receipt),indent=2)+'\n') + print(f'h={h}: identical selected word and independent dirty replay PASS',flush=True) + +if __name__=='__main__': + p=argparse.ArgumentParser();p.add_argument('--h',type=int,choices=(23,25),required=True);p.add_argument('--work-dir',type=Path,required=True) + a=p.parse_args();compile_axis(a.h,a.work_dir) diff --git a/research/global-anchor-screen/validation.json b/research/global-anchor-screen/validation.json new file mode 100644 index 0000000000..26dbaba86f --- /dev/null +++ b/research/global-anchor-screen/validation.json @@ -0,0 +1,34 @@ +{ + "scope": "Finite candidate reproduction; inherited all-size theorem assumptions retained. Expanded-main full CI remains pending.", + "completed_at": "2026-10-08T18:39:33.843874+00:00", + "tested_construction": "bd5956863a5b55125384ad667914ddd937a517f3", + "integrated_main": "fc74109a6978cb1849547e0dcb9d9df995ddaac5", + "command": "make global-anchor-verify", + "exit_code": 0, + "host_compiler_override": "CXX=c++ -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk", + "manifest_sha256": "97bd86fc20fb3aee2d1adacd6a485b12e918b7340d2d3ca70e1318889e13e3a0", + "log_sha256": "03e0d4a03fedc21c6bbde9ea43362aba366fb16ce8d7b1efe20b82e813bb75f8", + "checks": [ + "Selected raw words reproduced exactly for h23 and h25", + "Every source/target/dirty coordinate, both orientations", + "Literal transitions and all physical frame inclusions", + "Actual fixed-I+J profiles exactly equal; zero CRT disagreements", + "Exact moment and all47constraints/seven margins", + "Next bit and kappa grid rejection", + "Six failure controls", + "Exact capped-mass dominance over PR63" + ], + "integration_checks": [ + "Selected artifacts and every pinned consumed source unchanged by main integration", + "Complete inherited frame and arithmetic source closure unchanged", + "Independent current-main PR62/61 moment/data-ledger/assembly/Lean-source audit passed" + ], + "base_pr63_validation": { + "commit": "aa7701b68540b7863d3b66a414e4319915d6282d", + "local_make_verify_exit_code": 0, + "local_tracked_files_clean": true, + "fork_ci_jobs_passed": 29, + "fork_ci_run": "https://github.com/DominikScholz/integer-mult-bounds/actions/runs/37821590026" + }, + "expanded_main_full_ci": "pending" +} diff --git a/research/global-anchor-screen/verify.py b/research/global-anchor-screen/verify.py new file mode 100644 index 0000000000..1e2a13b4c7 --- /dev/null +++ b/research/global-anchor-screen/verify.py @@ -0,0 +1,97 @@ +#!/usr/bin/env python3 +"""Rebuild the selected paid live-anchor word and its exact finite certificate. + +Uses the attributed PR57/60/62 checkers and fixed-profile formulas. Prepared +with substantial OpenAI Codex assistance; inherited theorem assumptions remain. +""" +import sys + +if sys.flags.optimize: + raise ValueError('Assertions must remain enabled') +sys.dont_write_bytecode = True + +from fractions import Fraction as Q +from hashlib import sha256 +import json +import os +from pathlib import Path +import shlex +import subprocess +import tempfile + +from selected_compile import compile_axis, replay +from binary_frame_profile_prepare import prepare +from evaluate import verify as inherited + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] + + +def read(path): + return json.loads(path.read_text()) + + +def main(): + manifest = read(HERE/'selected-manifest.json') + for name, digest in manifest['files'].items(): + assert sha256((HERE/name).read_bytes()).hexdigest() == digest, name + for name, digest in read(HERE/'SOURCE.json')['unchanged_consumed_sources'].items(): + assert sha256((ROOT/name).read_bytes()).hexdigest() == digest, name + inherited.check_sources() + profiles, words = [], {'axes': {}} + with tempfile.TemporaryDirectory(prefix='global-anchor-verify-') as directory: + work = Path(directory) + profiler = work/'profiles' + subprocess.run([*shlex.split(os.environ.get('CXX', 'c++')), '-O3', '-std=c++17', + '-I', str(inherited.INHERITED/'scripts/partial_swap'), + str(ROOT/'scripts/experiments/binary_frame_profiles.cpp'), + '-o', str(profiler)], check=True) + for h in (23, 25): + compile_axis(h, work) + receipt = read(work/f'receipt-{h}.json') + expected = read(HERE/'selected-reproduction.json')['axes'][str(h)] + assert receipt == expected, f'h={h} compile/replay drift' + words['axes'][str(h)] = receipt + transitions = work/f'word-{h}.bin' + prepare(work/f'word-{h}.json.gz', transitions) + subprocess.run([str(profiler), str(transitions)], check=True) + profile = read(Path(str(transitions)+'.profiles.json')) + assert profile == read(HERE/f'selected-profiles-{h}.json'), f'h={h} profile drift' + profiles.append(profile) + profile = inherited.profile(profiles, words) + certificate = read(HERE/'selected-arithmetic.json') + assert inherited.arithmetic.js(profile) == certificate['profile'] + bit, kappa = Q(certificate['bit_saving']), Q(certificate['kappa']) + assert (bit, kappa) == (Q(5103199, 10**11), Q(5102938, 10**11)) + moment = inherited.arithmetic.moment(profile['m'], profile['W'], + profile['child_multiplicities'], bit) + assert moment['strict_gap'] > 0 + assert inherited.arithmetic.js(moment) == certificate['exact_moment'] + next_bit = inherited.arithmetic.moment(profile['m'], profile['W'], + profile['child_multiplicities'], bit+Q(1, 10**11)) + assert next_bit['lower'] > 1 + assert str(next_bit['lower']) == certificate['next_bit_grid_lower'] + bridge = read(inherited.OLD/'certificate.json')['finite_bridge'] + bridge['bit']['W'] = profile['W'] + assembly = inherited.balanced.assembly(bridge, bit, kappa) + assert len(assembly['constraints']) == 47 and len(assembly['margins']) == 7 + assert inherited.arithmetic.js(assembly) == certificate['assembly'] + try: + inherited.balanced.assembly(bridge, bit, kappa+Q(1, 10**11)) + except inherited.balanced.InvalidAssembly: + pass + else: + raise AssertionError('Next kappa grid point unexpectedly passes') + prior = read(ROOT/'research/rank-pair/screen-certificate.json')['bit'] + comparison = read(HERE/'comparison-pr63.json') + for key in ('m', 'W', 'child_multiplicities'): + assert comparison[key] == prior[key], key + assert kappa > Q(20411033624901463, 400000000000000000000) + assert kappa > Q(12757157778919, 250000000000000000) + subprocess.run([sys.executable, str(HERE/'check_dominance.py')], check=True) + print('PASS selected words, dirty replay, paid profiles, 47 constraints, seven margins, and next-grid rejection') + print(f'PASS conditional kappa={kappa}; bit saving={bit}') + + +if __name__ == '__main__': + main() diff --git a/research/joint-dual/SOURCE.json b/research/joint-dual/SOURCE.json index 80c0f29dc4..8e27684812 100644 --- a/research/joint-dual/SOURCE.json +++ b/research/joint-dual/SOURCE.json @@ -3,9 +3,9 @@ "base_pr57_commit": "cd350f76c9bc01489ec83568bded532cb69be938", "base_pr58_commit": "bc2f7ed4c20dc18898305ab17165c0c995cbb804", "files": { - "Makefile": "97620e0205736d9c0fce736e8ac6ab67f8ed0e490c381f6cac152cc6a003dca7", - "NOTICE": "1c53970fb4face631a1b331ec66d33111eccd280a129f9b64c2da6df96861c3f", - "README.md": "fd92de31aece76b1f5ff897e6e0dbc38dd3bf67c140579bbcb03a1a11a792668", + "Makefile": "50c6d1dca2bcc89f6520a32dce70854354279df01d73b0545d1b5612736de309", + "NOTICE": "d484c17e8f7b3ec304f85653aed7857e7a4ef7657bd8f4ce71e732346fdbae88", + "README.md": "4670f4ae94663cb07b57a8881d826e5349773530cc665aed6d90e970780d59a4", "certificates/joint-dual-compiler.json": "516c4d85158553dabd0a98216a064b2a7397957a9d5dd0df1d6e5aec53a4e805", "certificates/joint-dual-profiles-23.json": "159fa8fee175fc1d24f63e72d3c2f1dc9f4fcd78b938c5e7d2f735fd0fd37209", "certificates/joint-dual-profiles-25.json": "8d190ce42d097e828c5756918c52f2963df576cf4c6600b0fc7f2b7fdb6ad223", diff --git a/research/rank-pair/.gitignore b/research/rank-pair/.gitignore new file mode 100644 index 0000000000..b32ee5c816 --- /dev/null +++ b/research/rank-pair/.gitignore @@ -0,0 +1,4 @@ +profiles +*.bin +*.bin.json +*.bin.profiles.json diff --git a/research/rank-pair/PROOF.md b/research/rank-pair/PROOF.md new file mode 100644 index 0000000000..ba95aa98bf --- /dev/null +++ b/research/rank-pair/PROOF.md @@ -0,0 +1,137 @@ +# Rank-first reclamation on interval strips and pair assembly + +This finite conditional witness gives + +\[ +\kappa=\frac{5102757}{10^{11}}=0.00005102757, +\qquad a_b=\frac{5103018}{10^{11}}. +\] + +It composes Avi Eisenberg's PR #62 interval-strip and core-aware pair graph +(`ad0f25ff7b23cff7f08ad237c2254e6ecf74257e`) with Chafik Boukhalfa's PR #60 +rank-first reclamation compiler (`e7a492dd8bee4e6f574ced784a62af2ce735edc4`), +which derives from eumemic's PR #57 joint frame compiler. The graph is +unchanged, and the candidate compiler is copied byte-for-byte from PR #60. +The composition experiment and exact validation driver were prepared by +Dominik Scholz with substantial OpenAI GPT-6 Astra assistance. + +The witness exceeds PR #62's stacked κ by exactly 1066/10^11. It exceeds +PR #61 at `afb7cb67d1858641315cfbf4ac768ee64a8eff3a`, whose stated κ is +25508460085039/500000000000000000, by exactly +5324914961/500000000000000000 (approximately 0.0208751% relative). +These comparisons are against pinned research claims, not independent +acceptance of any of the full multiplication theorems. + +## Mechanism and paid quantities + +PR #57 originally visits retired physical roles in increasing slot order. +PR #60 visits them by descending current frame rank, breaking ties by slot +order. In either policy a retired role is eligible only if its current frame +is contained in the requested frame. Linear dependence is witnessed by +literal XOR operations involving eligible retired roles and the current +anchors; those XORs clear the selected role. Every operand is raised to the +requested frame and every resulting transition is charged. Only then is the +cleared role reused. + +For the PR #62 graph, this changes the physical frame paths and their actual +fixed-basis profiles without changing the roles or the total rank. The +improvement is therefore established by the complete child moment, not by a +role-count heuristic or by treating clearing as free. + +| h | roles | reclaimed roles | clearing XORs | all elementary XORs | distinct profile matrices | CRT-checked matrices | +|---|---:|---:|---:|---:|---:|---:| +| 23 | 27918 | 801 | 1612 | 149172 | 36378 | 6049 | +| 25 | 36586 | 1090 | 2092 | 205915 | 50419 | 8127 | + +Both axes have zero CRT disagreements. PR #62's original clearing counts +were 1398 and 1827, respectively: the present witness explicitly pays the +additional clearing. The unchanged global quantities are m=575, +N=4073300, L=2226400, W=137151806, total rank=78860441550, and deficit=1846900. + +## Finite validation and inherited hypotheses + +`frame_compile.py` checks every input and dirty basis vector in both +orientations, then calls the independent serialized-word replay. `screen.py` +repeats that replay, reconstructs every transition from the actual word, +regenerates all fixed-basis profiles with the inherited bounded-minor and CRT +checks, and applies PR #62's unchanged complete paid-profile constructor. +The constructor verifies the total-rank identity and copied-center counts. + +Exact rational logarithm/exponential enclosures show the moment is below 1 +at a_b=5103018/10^11 and its lower bound is above 1 at 5103019/10^11. +PR #62's original complete child network also has lower moment above 1 at +the new a_b. The inherited balanced assembly passes all 47 strict constraints +and all seven margins at κ=5102757/10^11, and rejects the next grid point. +It uses the unchanged β=1/20, backoff h=10^-12, complex saving 717/10^7, +semantic C1=1, and product row stock p^2000. Smaller rational grids and +backoff were not needed for this witness and could refine its last digits. + +The graph supports, scalar producer, original-envelope interpretation, data +geometry, paid endpoint copy, exact corner recovery, and all-size proofs +remain inherited from PR #62 and its cited predecessors. The rank-first +compiler uses precisely PR #60's mechanism. This note does not independently +prove OpenAI's base theorem, the fixed-alphabet/multitape transfer, the +analytic, semantic, routing or recovery interfaces, or their eventual +thresholds. Finite success is not formal verification of the full theorem, +and neither global optimality nor a practical speedup is claimed. + +## Reproduction + +```sh +python3 research/rank-pair/frame_compile.py +python3 research/rank-pair/screen.py +python3 -m unittest discover -s tests -p test_rank_pair.py -v +``` + +On this development machine the default MacOSX27 SDK fails to link because +the selected linker does not recognize its arm64e.x1 TBD architecture. The +successful local process-scoped override was: + +```sh +CXX='c++ -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk' python3 research/rank-pair/screen.py +``` + +The candidate compiler SHA256 is +`9984aaccf880e4840402322d76678bfddb33ce7e494af78430a43429f51b85fd`. +The graph SHA256 is +`3d47e89d2649c90800a276bdd0480131def50e0bdf92c122a19494b55bf17420`. +`frame-compiler.json` pins both sources and every serialized word; wall-clock +timing is excluded so recompilation reproduces the record deterministically. +`screen-certificate.json` records the exact moment, assembly, eventual +arithmetic cutoffs, complete child multiplicities, and pinned comparisons. +Six failure controls check omitted literal XORs, understated physical width, +omitted paid transitions, non-nested frames, exclusion of the old network, +and refusal to disable assertions with optimized Python. The independent experimental reproduction and a fresh parent reproduction +on the integrated main-based branch passed, including all six failure +controls. Repository-wide validation and PR review remain pending in CI. + +Integration preserves main d55bcd62 and its existing verification groups. +The imported pair/skip source manifests were updated for main's six added +standard-library includes in `binary_io.hpp`; its functions and binary format +are unchanged. Their arithmetic certificates were regenerated. The imported +stacked certificate's source paths use POSIX separators for Linux CI. +The new candidate and both imported producers have separate CI groups. + +## Bounded unsuccessful experiments + +At h=23, three further policies were tested: descending rank with decreasing +slot tie-break; decreasing slot without rank; and increasing rank with +increasing slot tie-break. All retained the same 27918 roles. Full independent +dirty-word replay, frame reconstruction and profile regeneration passed for +each, but disjoint exact enclosures prove each has a strictly worse internal +moment than the selected rank-first policy at a_b=5103018/10^11. No claim is +made about those policies at h=25, which was not tested in this bounded round. +The negative-result records and exploratory compiler variants remain local +research scratch; they are not used to generate this witness. + +## Attribution + +Retain PR #62's full attribution in `research/pair-assembly/PROOF.md`, PR #60's +Chafik Boukhalfa rank-first contribution, and PR #57's eumemic compiler. +The pipeline additionally depends on Avi Eisenberg, Rohan Arun, RaD / +hipotures, icekylinx, Zhihao Chen, Aurel Prosz / Paureel, Swapnil Jain, +James Chang, Douglas Colkitt, OpenAI and Harvey–van der Hoeven, with the +complete inherited notices retained in the repository. The PR #62 graph was +prepared with Claude (Anthropic) assistance; the PR #57/#60 compiler and this +composition use substantial OpenAI assistance. Apache-2.0 applies, subject +to the existing separately retained source notices and terms. diff --git a/research/rank-pair/frame-compiler.json b/research/rank-pair/frame-compiler.json new file mode 100644 index 0000000000..8c422bb9f1 --- /dev/null +++ b/research/rank-pair/frame-compiler.json @@ -0,0 +1,177 @@ +{ + "status": "Joint frame compilation of the pair-assembly graph; complete dirty basis both orientations", + "axes": { + "23": { + "compiled": { + "h": 23, + "mode": { + "matching": true, + "reclaim": true + }, + "roles": 27918, + "baseline_pr48_roles": 36432, + "histogram": { + "1": 42694, + "0": 302093, + "2": 82741, + "3": 11086, + "4": 10683, + "6": 2005, + "5": 7757, + "8": 1362, + "9": 525, + "10": 449, + "12": 464, + "14": 2005, + "16": 547, + "18": 4220, + "19": 7820, + "22": 23, + "15": 544, + "17": 368, + "7": 275, + "21": 165, + "13": 22 + }, + "rank_mass": 642620, + "elementary_xors": 149172, + "stats": { + "augmentations": 220, + "regions": 52473, + "matched": 37025, + "multi_node_regions": 10350, + "reclaimed": 801, + "clearing_xors": 1612 + }, + "dirty_basis_vectors": 31460, + "complete_dirty_basis_both_orientations": true, + "all_physical_frame_inclusions": true + }, + "replay": { + "status": "independent serialized word, exact frames, full input and dirty basis both orientations PASS", + "h": 23, + "roles": 27918, + "output_roles": 5336, + "elementary_xors": 149172, + "word_length": 621482, + "full_basis_vectors": 31460, + "rank_mass": 642620, + "histogram": { + "1": 42694, + "0": 162950, + "2": 82741, + "3": 11086, + "4": 10683, + "6": 2005, + "5": 7757, + "8": 1362, + "9": 525, + "10": 449, + "12": 464, + "14": 2005, + "16": 547, + "18": 4220, + "19": 7820, + "22": 23, + "15": 544, + "17": 368, + "7": 275, + "21": 165, + "13": 22 + } + }, + "gzip_sha256": "1a57c143380a063211653f1f35e7cc9710539523b0b34c90f354a0425c34bd59", + "word_sha256": "640696dd7cd893add9d6e12d0d587956fecf113b2eff8c29547b82e5a6f3c0ad" + }, + "25": { + "compiled": { + "h": 25, + "mode": { + "matching": true, + "reclaim": true + }, + "roles": 36586, + "baseline_pr48_roles": 48329, + "histogram": { + "1": 55478, + "0": 416643, + "2": 115797, + "3": 14362, + "4": 16835, + "5": 10237, + "6": 1767, + "8": 2116, + "9": 642, + "10": 529, + "12": 614, + "14": 529, + "16": 3146, + "18": 519, + "20": 5436, + "21": 10148, + "24": 25, + "17": 854, + "19": 396, + "13": 24, + "7": 525, + "23": 220 + }, + "rank_mass": 915250, + "elementary_xors": 205915, + "stats": { + "augmentations": 286, + "regions": 73695, + "matched": 53194, + "multi_node_regions": 13975, + "reclaimed": 1090, + "clearing_xors": 2092 + }, + "dirty_basis_vectors": 41186, + "complete_dirty_basis_both_orientations": true, + "all_physical_frame_inclusions": true + }, + "replay": { + "status": "independent serialized word, exact frames, full input and dirty basis both orientations PASS", + "h": 25, + "roles": 36586, + "output_roles": 6925, + "elementary_xors": 205915, + "word_length": 855860, + "full_basis_vectors": 41186, + "rank_mass": 915250, + "histogram": { + "1": 55478, + "0": 224367, + "2": 115797, + "3": 14362, + "4": 16835, + "5": 10237, + "6": 1767, + "8": 2116, + "9": 642, + "10": 529, + "12": 614, + "14": 529, + "16": 3146, + "18": 519, + "20": 5436, + "21": 10148, + "24": 25, + "17": 854, + "19": 396, + "13": 24, + "7": 525, + "23": 220 + } + }, + "gzip_sha256": "fff17e3f6742e0810247747c3bbf393eb6b1b2b5a6c9887c83adeecd298d1bfe", + "word_sha256": "7a827318eff45db1183d66e80d38ddbd4ce321bbc033d2effb7afa438d6b63a9" + } + }, + "source": { + "graph": "research/pair-assembly/pair_graph.py", + "graph_sha256": "3d47e89d2649c90800a276bdd0480131def50e0bdf92c122a19494b55bf17420", + "compiler": "scripts/experiments/rank_pair_compiler.py (PR #60 rank-first variant of PR #57)", + "compiler_sha256": "9984aaccf880e4840402322d76678bfddb33ce7e494af78430a43429f51b85fd" + } +} diff --git a/research/rank-pair/frame-profiles-23.json b/research/rank-pair/frame-profiles-23.json new file mode 100644 index 0000000000..1663c97520 --- /dev/null +++ b/research/rank-pair/frame-profiles-23.json @@ -0,0 +1,38 @@ +{ + "h": 23, + "v": 1771, + "R": 27918, + "loss": 506, + "rank_sum": 642620, + "field_prime": 2305843009213693951, + "frames": 52475, + "distinct_matrices": 36378, + "crt_matrices": 6049, + "crt_disagreements": 0, + "blocks": [ + 0, + 343922, + 16866, + 10526, + 5756, + 4155, + 3904, + 3650, + 2861, + 2284, + 1800, + 1716, + 1263, + 1077, + 710, + 590, + 352, + 193, + 114, + 0, + 45, + 23, + 0, + 0 + ] +} diff --git a/research/rank-pair/frame-profiles-25.json b/research/rank-pair/frame-profiles-25.json new file mode 100644 index 0000000000..e9f49b5c4d --- /dev/null +++ b/research/rank-pair/frame-profiles-25.json @@ -0,0 +1,40 @@ +{ + "h": 25, + "v": 2300, + "R": 36586, + "loss": 600, + "rank_sum": 915250, + "field_prime": 2305843009213693951, + "frames": 73697, + "distinct_matrices": 50419, + "crt_matrices": 8127, + "crt_disagreements": 0, + "blocks": [ + 0, + 474727, + 25146, + 12129, + 6776, + 5700, + 5502, + 4919, + 3780, + 3213, + 2699, + 2650, + 1907, + 1665, + 1346, + 1126, + 698, + 585, + 371, + 181, + 111, + 0, + 55, + 25, + 0, + 0 + ] +} diff --git a/research/rank-pair/frame-transitions-23.json b/research/rank-pair/frame-transitions-23.json new file mode 100644 index 0000000000..a186d47c0c --- /dev/null +++ b/research/rank-pair/frame-transitions-23.json @@ -0,0 +1,34 @@ +{ + "h": 23, + "v": 1771, + "R": 27918, + "frames": 52475, + "distinct_transitions": 138003, + "singles": 15939, + "rank_mass": 642620, + "rank_histogram_with_side_growth_split_into_singletons": { + "1": 53320, + "2": 77428, + "3": 11086, + "4": 10683, + "5": 7757, + "6": 2005, + "7": 275, + "8": 1362, + "9": 525, + "10": 449, + "12": 464, + "13": 22, + "14": 2005, + "15": 544, + "16": 547, + "17": 368, + "18": 4220, + "19": 7820, + "21": 165, + "22": 23 + }, + "word_sha256": "640696dd7cd893add9d6e12d0d587956fecf113b2eff8c29547b82e5a6f3c0ad", + "copied_centers": 23, + "transition_events_equal_independent_xor_word_reconstruction": true +} diff --git a/research/rank-pair/frame-transitions-25.json b/research/rank-pair/frame-transitions-25.json new file mode 100644 index 0000000000..9f7afe51b7 --- /dev/null +++ b/research/rank-pair/frame-transitions-25.json @@ -0,0 +1,35 @@ +{ + "h": 25, + "v": 2300, + "R": 36586, + "frames": 73697, + "distinct_transitions": 190879, + "singles": 20700, + "rank_mass": 915250, + "rank_histogram_with_side_growth_split_into_singletons": { + "1": 69278, + "2": 108897, + "3": 14362, + "4": 16835, + "5": 10237, + "6": 1767, + "7": 525, + "8": 2116, + "9": 642, + "10": 529, + "12": 614, + "13": 24, + "14": 529, + "16": 3146, + "17": 854, + "18": 519, + "19": 396, + "20": 5436, + "21": 10148, + "23": 220, + "24": 25 + }, + "word_sha256": "7a827318eff45db1183d66e80d38ddbd4ce321bbc033d2effb7afa438d6b63a9", + "copied_centers": 25, + "transition_events_equal_independent_xor_word_reconstruction": true +} diff --git a/research/rank-pair/frame-word-23.json.gz b/research/rank-pair/frame-word-23.json.gz new file mode 100644 index 0000000000..f1ab2ff5fb Binary files /dev/null and b/research/rank-pair/frame-word-23.json.gz differ diff --git a/research/rank-pair/frame-word-25.json.gz b/research/rank-pair/frame-word-25.json.gz new file mode 100644 index 0000000000..b94aa6aded Binary files /dev/null and b/research/rank-pair/frame-word-25.json.gz differ diff --git a/research/rank-pair/frame_compile.py b/research/rank-pair/frame_compile.py new file mode 100644 index 0000000000..52e79f0a00 --- /dev/null +++ b/research/rank-pair/frame_compile.py @@ -0,0 +1,74 @@ +#!/usr/bin/env python3 +"""Compile PR #62's pair graph with PR #60's rank-first joint compiler. + +PR #60's compiler (by Chafik Boukhalfa, derived from eumemic's PR #57, both +with OpenAI Codex assistance) is used unchanged; only its input graph changes. +The graph source is hash-pinned below. Every word is checked by the compiler on +the complete input and dirty basis in both orientations, and frame_verify.py +replays it independently. Adapted with assistance from Claude (Anthropic). +Rank-first composition experiment: Dominik Scholz with OpenAI GPT-6 Astra assistance. +Compiler copied unchanged from Chafik Boukhalfa PR #60 e7a492dd8bee4e6f574ced784a62af2ce735edc4. +Usage: python frame_compile.py (writes words and frame-compiler.json here) +""" +import sys +if sys.flags.optimize: + raise ValueError('Assertions must remain enabled') +sys.dont_write_bytecode = True +import gzip +from hashlib import sha256 +import importlib.util +import json +from pathlib import Path +from multiprocessing import Process + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +sys.path.insert(0, str(ROOT/'scripts/experiments')) +GRAPH = HERE.parent/'pair-assembly/pair_graph.py' +GRAPH_SHA256 = '3d47e89d2649c90800a276bdd0480131def50e0bdf92c122a19494b55bf17420' +COMPILER_SHA256 = '9984aaccf880e4840402322d76678bfddb33ce7e494af78430a43429f51b85fd' + + +def load_graph(): + assert sha256(GRAPH.read_bytes()).hexdigest() == GRAPH_SHA256, 'pair_graph.py changed' + spec = importlib.util.spec_from_file_location('pinned_pair_graph', GRAPH) + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + return module.graph + + +def compile_axis(h): + assert sha256((ROOT/'scripts/experiments/rank_pair_compiler.py').read_bytes()).hexdigest() == COMPILER_SHA256, 'rank-first compiler changed' + import rank_pair_compiler as compiler + compiler.graph = load_graph() + result, word = compiler.compile_(h, matching=True, reclaim=True, dirty=True) + result.pop('seconds') # Elapsed time is not part of the deterministic witness. + raw = (json.dumps(word, separators=(',', ':'))+'\n').encode() + path = HERE/f'frame-word-{h}.json.gz' + with path.open('wb') as stream: + with gzip.GzipFile(fileobj=stream, mode='wb', mtime=0) as archive: + archive.write(raw) + from binary_frame_replay import replay + receipt = replay(path) + (HERE/f'frame-compiled-{h}.json').write_text(json.dumps(dict( + compiled=result, replay=receipt, gzip_sha256=sha256(path.read_bytes()).hexdigest(), + word_sha256=sha256(raw).hexdigest()), indent=2)+'\n') + print(f"h={h} roles={result['roles']} replay roles={receipt['roles']}", flush=True) + + +if __name__ == '__main__': + jobs = [Process(target=compile_axis, args=(h,)) for h in (23, 25)] + for job in jobs: + job.start() + for job in jobs: + job.join() + assert job.exitcode == 0 + axes = {str(h): json.loads((HERE/f'frame-compiled-{h}.json').read_text()) for h in (23, 25)} + record = dict(status='Joint frame compilation of the pair-assembly graph; complete dirty basis both orientations', + axes=axes, source=dict(graph='research/pair-assembly/pair_graph.py', graph_sha256=GRAPH_SHA256, + compiler='scripts/experiments/rank_pair_compiler.py (PR #60 rank-first variant of PR #57)', + compiler_sha256=sha256((ROOT/'scripts/experiments/rank_pair_compiler.py').read_bytes()).hexdigest())) + (HERE/'frame-compiler.json').write_text(json.dumps(record, indent=2)+'\n') + for h in (23, 25): + (HERE/f'frame-compiled-{h}.json').unlink() + print('PASS compiled and independently replayed both axes', flush=True) diff --git a/research/rank-pair/screen-certificate.json b/research/rank-pair/screen-certificate.json new file mode 100644 index 0000000000..72ed101789 --- /dev/null +++ b/research/rank-pair/screen-certificate.json @@ -0,0 +1,710 @@ +{ + "assembly": { + "absorption_gap": "151344121301697306654639/25001275754499997448491000000000000", + "constraints": { + "K_dominates_log": "1275754506246172736493752551509/25001275754499997448491000000000000", + "K_geometry": "18751275754506247448491/25001275754499997448491000000000000", + "a_below_b": "1033491/50000000000", + "a_positive": "2551509/50000000000", + "alpha_below_one": "49999999999975001275754499997448491/50002551508999994896982000000000000", + "alpha_below_one_fourth": "12498086368225005103017999997448491/50002551508999994896982000000000000", + "alpha_positive": "2551509024993621227500002551509/50002551508999994896982000000000000", + "artificial_boundary": "1400081648288274840530687499992345473/200010206035999979587928000000000000", + "b_below_one_over32": "311783/10000000", + "beta_below_one": "19/20", + "beta_positive": "1/20", + "c_below_one": "24998724245493752551509/25000000000000000000000", + "c_positive": "1275754506247448491/25000000000000000000000", + "cell_above_band": "49999999999924998724245500002551509/100005103017999989793964000000000000", + "compact_leaf": "427120500002551509/25000000000000000000000", + "compact_reservations": "1/4000000000000", + "delta_below_one_eighth": "999999999999/8000000000000", + "delta_positive": "1/8000000000000", + "epsilon_below_one": "1275754524997448491/25001275754499997448491", + "epsilon_positive": "24999999999975000000000/25001275754499997448491", + "g1_above_kappa": "17634539705619730410313/2500127575449999744849100000000000", + "g2_above_kappa": "261/100000000000", + "g3_above_kappa": "151344121301697306654639/25001275754499997448491000000000000", + "g4_above_kappa": "261/100000000000", + "g5_above_kappa": "257151359535415689116517/40002041207199995917585600000000000", + "g6_above_kappa": "1385761900695078435376549/200010206035999979587928000000000000", + "g7_above_kappa": "2499872424562634794856519730410313/2500127575449999744849100000000000", + "gamma_sublinear": "1/2000000000000", + "guard_width": "1275754524997448491/25001275754499997448491", + "lambda_above_internal": "2551509/50000000000000000000000", + "lambda_above_sigma": "1033491000002551509/50000000000000000000000", + "lambda_above_tau": "2551509/50000000000000000000000", + "lambda_prime_above_lambda": "2551509/50000000000000000000000", + "lambda_prime_below_one": "1275754499997448491/25000000000000000000000", + "literal_scalar_guard": "9693793493753822316795466474748", + "phase_boundary": "2041207214994641831100002551509/40002041207199995917585600000000000", + "phase_leaf_above_bit": "854241/50000000000", + "phase_local": "10206036174978312173500002551509/200010206035999979587928000000000000", + "prime_interval_packing": "1275754524997448491/25001275754499997448491", + "q_below_internal": "2551509/25000000000000000000000", + "q_below_leaf": "427120500002551509/25000000000000000000000", + "q_below_reservations": "1/4000000000000", + "q_positive": "1275754499997448491/25000000000000000000000", + "record_suffix": "1275754524997448491/25001275754499997448491", + "row_product_gap": "6548/25", + "short_record_fallback": "1249936209018650911466010198177081/1250063787724999872424550000000000", + "small_field_exposure": "1/1000000000000" + }, + "finite_bridge": { + "bit": { + "W": 137151806, + "halving_degree": 9, + "m": 575, + "maxchild": 529, + "wire_bits": 28 + }, + "complex": { + "W": 537696432, + "halving_degree": 20, + "m": 784, + "maxchild": 756, + "s": 421548223824, + "scalar_group_upper": 4793351472, + "wire_bits": 30 + }, + "rows": { + "coefficient": 852, + "degree": 2000, + "degree_gap": "6548/25", + "suffix_slope": 8000 + }, + "semantic": { + "B": 9696565176891520488614054257040, + "C0": 2358858462850846165593256368932965330169899180021667007021321420800, + "C1": 1, + "E": 9696565176891520488192506033216, + "induction_gap": 533311084729033626873772984137200, + "literal_charge": 2771683137698171397039558468, + "strict_literal_gap": 9693793493753822316795466474748 + } + }, + "margins": { + "g1": "1275754524997448491/25001275754499997448491", + "g2": "2551509/50000000000", + "g3": "1275754499996172736500002551509/25001275754499997448491000000000000", + "g4": "2551509/50000000000", + "g5": "2041207214994641831100002551509/40002041207199995917585600000000000", + "g6": "10206036174978312173500002551509/200010206035999979587928000000000000", + "g7": "24999999999975000000000/25001275754499997448491" + }, + "minimum_margin": "1275754499996172736500002551509/25001275754499997448491000000000000", + "parameters": { + "C0": 2358858462850846165593256368932965330169899180021667007021321420800, + "C1": "1", + "a_bit": "2551509/50000000000", + "a_complex": "717/10000000", + "alpha_squared_power": "2551509024993621227500002551509/50002551508999994896982000000000000", + "beta": "1/20", + "c": "1275754506247448491/25000000000000000000000", + "delta": "1/8000000000000", + "epsilon": "24999999999975000000000/25001275754499997448491", + "h": "1/1000000000000", + "kappa": "5102757/100000000000", + "lambda_": "49997448491000002551509/50000000000000000000000", + "lambda_prime": "24998724245500002551509/25000000000000000000000", + "q": "1275754499997448491/25000000000000000000000", + "sigma": "9999283/10000000", + "tau": "49997448491/50000000000" + }, + "recurrence": { + "internal": "49997448491/50000000000", + "leaf": "199986377/200000000", + "reservations": "24998724245493752551509/25000000000000000000000" + }, + "scoped_limit": "2551509/50002551509" + }, + "bit": { + "L": 2226400, + "N": 4073300, + "W": 137151806, + "axes": [ + { + "R": 27918, + "blocks": [ + 0, + 343922, + 16866, + 10526, + 5756, + 4155, + 3904, + 3650, + 2861, + 2284, + 1800, + 1716, + 1263, + 1077, + 710, + 590, + 352, + 193, + 114, + 0, + 45, + 23, + 0, + 0 + ], + "crt_disagreements": 0, + "crt_matrices": 6049, + "distinct_matrices": 36378, + "field_prime": 2305843009213693951, + "frames": 52475, + "h": 23, + "loss": 506, + "rank_sum": 642620, + "v": 1771 + }, + { + "R": 36586, + "blocks": [ + 0, + 474727, + 25146, + 12129, + 6776, + 5700, + 5502, + 4919, + 3780, + 3213, + 2699, + 2650, + 1907, + 1665, + 1346, + 1126, + 698, + 585, + 371, + 181, + 111, + 0, + 55, + 25, + 0, + 0 + ], + "crt_disagreements": 0, + "crt_matrices": 8127, + "distinct_matrices": 50419, + "field_prime": 2305843009213693951, + "frames": 73697, + "h": 25, + "loss": 600, + "rank_sum": 915250, + "v": 2300 + } + ], + "child_multiplicities": { + "1": 1725448017, + "10": 8919929, + "11": 8639950, + "12": 6282197, + "13": 5425815, + "14": 4016766, + "15": 3351146, + "16": 2045758, + "17": 9626535, + "18": 919241, + "19": 320551, + "2": 83325366, + "20": 300081, + "21": 16346100, + "22": 97405, + "23": 72402275, + "25": 64793806, + "3": 45690259, + "4": 25239096, + "481": 8146600, + "5": 19651200, + "525": 64793806, + "529": 64211400, + "6": 18723242, + "7": 17106549, + "8": 13274680, + "9": 10943423 + }, + "deficit": 1846900, + "excluded_above_lower": "8131530000007428916344426560363425376545435885706917766436209786193813885001996064633204627770717193381579821657410997368932854661/8131530000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "m": 575, + "maxchild": 529, + "moment": { + "exponent": "49997448491/50000000000", + "logarithms": { + "1": { + "lower": "3177185020398675220004135749131/500000000000000000000000000000", + "upper": "6354370040797350440008271498263/1000000000000000000000000000000" + }, + "10": { + "lower": "2025892473901652377995140021789/500000000000000000000000000000", + "upper": "4051784947803304755990280043579/1000000000000000000000000000000" + }, + "11": { + "lower": "3956474767998979895946327920297/1000000000000000000000000000000", + "upper": "1978237383999489947973163960149/500000000000000000000000000000" + }, + "12": { + "lower": "3869463391009350129778562018423/1000000000000000000000000000000", + "upper": "483682923876168766222320252303/125000000000000000000000000000" + }, + "13": { + "lower": "3789420683335813703954784056697/1000000000000000000000000000000", + "upper": "1894710341667906851977392028349/500000000000000000000000000000" + }, + "14": { + "lower": "3715312711182091825485686633361/1000000000000000000000000000000", + "upper": "1857656355591045912742843316681/500000000000000000000000000000" + }, + "15": { + "lower": "3646319839695140374012266928113/1000000000000000000000000000000", + "upper": "1823159919847570187006133464057/500000000000000000000000000000" + }, + "16": { + "lower": "3581781318557569202339343012429/1000000000000000000000000000000", + "upper": "358178131855756920233934301243/100000000000000000000000000000" + }, + "17": { + "lower": "3521156696741134359758736880389/1000000000000000000000000000000", + "upper": "352115669674113435975873688039/100000000000000000000000000000" + }, + "18": { + "lower": "3463998282901185747800548902959/1000000000000000000000000000000", + "upper": "43299978536264821847506861287/12500000000000000000000000000" + }, + "19": { + "lower": "1704965530815454989999622033187/500000000000000000000000000000", + "upper": "27279448493047279839993952531/8000000000000000000000000000" + }, + "2": { + "lower": "1415305715059351282647759844201/250000000000000000000000000000", + "upper": "1132244572047481026118207875361/200000000000000000000000000000" + }, + "20": { + "lower": "83965944181083986164326198053/25000000000000000000000000000", + "upper": "3358637767243359446573047922121/1000000000000000000000000000000" + }, + "21": { + "lower": "413730950384240930438459189737/125000000000000000000000000000", + "upper": "3309847603073927443507673517897/1000000000000000000000000000000" + }, + "22": { + "lower": "3263327587439034586529095798839/1000000000000000000000000000000", + "upper": "81583189685975864663227394971/25000000000000000000000000000" + }, + "23": { + "lower": "804718956217050187300379666613/250000000000000000000000000000", + "upper": "3218875824868200749201518666453/1000000000000000000000000000000" + }, + "25": { + "lower": "313549421592914969080675283181/100000000000000000000000000000", + "upper": "3135494215929149690806752831811/1000000000000000000000000000000" + }, + "3": { + "lower": "262787887606462037430651313067/50000000000000000000000000000", + "upper": "5255757752129240748613026261341/1000000000000000000000000000000" + }, + "4": { + "lower": "2484037839838729910586903627673/500000000000000000000000000000", + "upper": "4968075679677459821173807255347/1000000000000000000000000000000" + }, + "481": { + "lower": "35700554138317851917337677133/200000000000000000000000000000", + "upper": "89251385345794629793344192833/500000000000000000000000000000" + }, + "5": { + "lower": "1186233032090812516351878041259/250000000000000000000000000000", + "upper": "4744932128363250065407512165037/1000000000000000000000000000000" + }, + "525": { + "lower": "22742944551431673576538712861/250000000000000000000000000000", + "upper": "18194355641145338861230970289/200000000000000000000000000000" + }, + "529": { + "lower": "41690804469525529197382917321/500000000000000000000000000000", + "upper": "83381608939051058394765834643/1000000000000000000000000000000" + }, + "6": { + "lower": "4562610571569295439195794139881/1000000000000000000000000000000", + "upper": "2281305285784647719597897069941/500000000000000000000000000000" + }, + "7": { + "lower": "4408459891742037134902918754819/1000000000000000000000000000000", + "upper": "220422994587101856745145937741/50000000000000000000000000000" + }, + "8": { + "lower": "66795757798711164246196486467/15625000000000000000000000000", + "upper": "4274928499117514511756575133889/1000000000000000000000000000000" + }, + "9": { + "lower": "4157145463461131057217781024417/1000000000000000000000000000000", + "upper": "2078572731730565528608890512209/500000000000000000000000000000" + } + }, + "lower": "85719878749684880083239017888220893012178651419025873070498874826515938801606425483061791512049798538759854527501661466906780443141/85719878750000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "saving": "2551509/50000000000", + "strict_gap": "1160285669228080804985696742762548864117748192029503902793446817455290237923009421731296883926293712906759747570773043023128743439780023464056477184375055071084267917722300010912264368328217675020096920394417178260460671772870600580110500858560267197697353603594763931543283156323639633672156790265885447551324898421310896830247265338272462374351509596938387909670067592270176811470604577231505879917483683000671091250013098089090852329406229278740972875468982096000153288448707646867236911230363608995750304150467247077902721093467703339409816278927142168293871385458622301430859261645304807392287790833037913095164905576935296914096180937468528030716877853593031781402413133053734165562530067293082534023869381854686817734022861691702574731869881820526546265149512568903881252684753739140988755225229557660592626069265001795066846815964874478822272279675674049309564331338710474989079155779453932990001292388784479881782701949208654880092958569615802082431363900229602753991900853201913911670246559698484755201974712628110823752694017662561262052474618618107758076844613823010409168166656980945127261559/315626025703523256436373828773119248868328570003601284401783327620485824290407942127803580393340812889698148758924133479025758364078093670255879309132950054104615765125691706041738830634604145909080130789538379493541094349130135010269852654813939583894293595610721836471960231778413843982961220577352867742682237294710328500919881069815254823466516726941215799481498258286464082481917435797759202968178203948647233925599152839019622348889931539918866575348104483522917642658072219294880111652763716469213034860437462476978595118121095767900659836027746813372903785902916560713854727223961240267958743873692493155202642125513083347474239635965998188204059078882140912548993959615358584252244602626383835895397135989159308501078347943460081273885770457814084814240605400291738759906839017728139657732973657273177614169893630466136399154192311276005157199960325317251651811708994090196174340101359915488961367796866267450125636185918627913310232479566672686868942152217035787340101388700150139476507369493294361364680633307501462853275125065501567215057815707453500598505995589250000000000000000000000000000000000000000", + "upper": "315626025702362970767145747968133552125566021139483536209753823717692377472952651889880570971609516005771855046017373731454985321054964926816099285668893576920240710054607438124016530623691881540751913114518282573146677170869674338496982054233829083035733328413024482868365467846870560826637580943680710952416351847159003602498570172985007558128244264566864289884559870376794014889647258986288598390946698068729750242598481747769609250800840687589460346069363510647448660562072066006431404005896479557982671251441712172828127871043193046807192132688336997093976643734622689328396104922530381006313439066300205364369604212417918441897304339051902007266590550851424034695400927833956171119190868460821305828104053455135439119223661125726058412194067883082214932420078854026589247337935136475454903993832668517952384612233037840067134152397244429189192325481503044971976137659684525864835629626370836333181913863876266157736851706036845211361023824686579728299326350134604423439871785946158238623305455581624114804982148552299488140647014241748873197395254445401025979887887831173155386176989590831833343019054872738441/315626025703523256436373828773119248868328570003601284401783327620485824290407942127803580393340812889698148758924133479025758364078093670255879309132950054104615765125691706041738830634604145909080130789538379493541094349130135010269852654813939583894293595610721836471960231778413843982961220577352867742682237294710328500919881069815254823466516726941215799481498258286464082481917435797759202968178203948647233925599152839019622348889931539918866575348104483522917642658072219294880111652763716469213034860437462476978595118121095767900659836027746813372903785902916560713854727223961240267958743873692493155202642125513083347474239635965998188204059078882140912548993959615358584252244602626383835895397135989159308501078347943460081273885770457814084814240605400291738759906839017728139657732973657273177614169893630466136399154192311276005157199960325317251651811708994090196174340101359915488961367796866267450125636185918627913310232479566672686868942152217035787340101388700150139476507369493294361364680633307501462853275125065501567215057815707453500598505995589250000000000000000000000000000000000000000" + }, + "parts": { + "data": { + "1": 73319400, + "17": 8146600, + "21": 8146600, + "481": 8146600 + }, + "data_growth_23": { + "1": 8146600, + "21": 8146600 + }, + "data_growth_25": { + "1": 8146600, + "23": 8146600 + }, + "exterior_23": { + "23": 64211400, + "529": 64211400 + }, + "exterior_25": { + "25": 64793806, + "525": 64793806 + }, + "internal_23": { + "1": 791020600, + "10": 4140000, + "11": 3946800, + "12": 2904900, + "13": 2477100, + "14": 1633000, + "15": 1357000, + "16": 809600, + "17": 443900, + "18": 262200, + "2": 38791800, + "20": 103500, + "21": 52900, + "3": 24209800, + "4": 13238800, + "5": 9556500, + "6": 8979200, + "7": 8395000, + "8": 6580300, + "9": 5253200 + }, + "internal_25": { + "1": 840741517, + "10": 4779929, + "11": 4693150, + "12": 3377297, + "13": 2948715, + "14": 2383766, + "15": 1994146, + "16": 1236158, + "17": 1036035, + "18": 657041, + "19": 320551, + "2": 44533566, + "20": 196581, + "22": 97405, + "23": 44275, + "3": 21480459, + "4": 12000296, + "5": 10094700, + "6": 9744042, + "7": 8711549, + "8": 6694380, + "9": 5690223 + }, + "paid_endpoint_copy": { + "1": 4073300 + } + }, + "total_rank": 78860441550 + }, + "bit_saving": "2551509/50000000000", + "comparison": { + "difference": "533/50000000000", + "difference_pr61": "5324914961/500000000000000000", + "pr61_head": "afb7cb67d1858641315cfbf4ac768ee64a8eff3a", + "pr61_kappa": "25508460085039/500000000000000000", + "pr62_kappa": "5101691/100000000000", + "pr62_network_at_new_bit_lower": "3428795166774725707029430980420227920340827739703568976514604805405819541248322714869086735630197255034188622548856339970727442809/3428795150000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "ratio": "5102757/5101691", + "ratio_pr61": "25513785000000/25508460085039" + }, + "eventual_bounds": { + "additional_eventual_conditions": [ + "BHP prime threshold and distinct-prime packing", + "Fixed rational basis, eligible common prime and native table setup", + "Catalogue/descriptor domination, logarithm absorption, exact recovery" + ], + "all_interval_argument": "For [Z,Z+k), bound RHS at Z+k and LHS at floor(Z/k). Successive intervals double LHS; the positive affine RHS grows at most linearly, so 2^j >= j+1 proves persistence.", + "common_cutoff": 14000000000000, + "cutoff_log2_input": { + "alpha": 6145305665, + "compact": 24581222657, + "geometry": 3999931964388, + "guard": 4350589, + "log_p": 25, + "normalization": 14000000000000, + "period": 49162445313, + "phase_cell": 19, + "reservoir": 14, + "stopped_leaf": 252 + }, + "power_checkpoints": [ + { + "log2_input": 14000000000000, + "powers": { + "alpha": { + "exponent": 714358608, + "rhs": 112000000156848, + "rhs_bits": 47 + }, + "compact": { + "exponent": 714358608, + "rhs": 448000000627328, + "rhs_bits": 49 + }, + "leaf": { + "exponent": 666666666666, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 714358608, + "rhs": 224000000313624, + "rhs_bits": 48 + }, + "rows": { + "exponent": 714358608, + "rhs": 112000000156848000, + "rhs_bits": 57 + } + } + }, + { + "log2_input": 28000000000000, + "powers": { + "alpha": { + "exponent": 1428717216, + "rhs": 224000000156848, + "rhs_bits": 48 + }, + "compact": { + "exponent": 1428717216, + "rhs": 896000000627328, + "rhs_bits": 50 + }, + "leaf": { + "exponent": 1333333333333, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 1428717216, + "rhs": 448000000313624, + "rhs_bits": 49 + }, + "rows": { + "exponent": 1428717216, + "rhs": 224000000156848000, + "rhs_bits": 58 + } + } + }, + { + "log2_input": 56000000000000, + "powers": { + "alpha": { + "exponent": 2857434432, + "rhs": 448000000156848, + "rhs_bits": 49 + }, + "compact": { + "exponent": 2857434432, + "rhs": 1792000000627328, + "rhs_bits": 51 + }, + "leaf": { + "exponent": 2666666666666, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 2857434432, + "rhs": 896000000313624, + "rhs_bits": 50 + }, + "rows": { + "exponent": 2857434432, + "rhs": 448000000156848000, + "rhs_bits": 59 + } + } + }, + { + "log2_input": 112000000000000, + "powers": { + "alpha": { + "exponent": 5714868864, + "rhs": 896000000156848, + "rhs_bits": 50 + }, + "compact": { + "exponent": 5714868864, + "rhs": 3584000000627328, + "rhs_bits": 52 + }, + "leaf": { + "exponent": 5333333333333, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 5714868864, + "rhs": 1792000000313624, + "rhs_bits": 51 + }, + "rows": { + "exponent": 5714868864, + "rhs": 896000000156848000, + "rhs_bits": 60 + } + } + }, + { + "log2_input": 224000000000000, + "powers": { + "alpha": { + "exponent": 11429737728, + "rhs": 1792000000156848, + "rhs_bits": 51 + }, + "compact": { + "exponent": 11429737728, + "rhs": 7168000000627328, + "rhs_bits": 53 + }, + "leaf": { + "exponent": 10666666666666, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 11429737728, + "rhs": 3584000000313624, + "rhs_bits": 52 + }, + "rows": { + "exponent": 11429737728, + "rhs": 1792000000156848000, + "rhs_bits": 61 + } + } + }, + { + "log2_input": 448000000000000, + "powers": { + "alpha": { + "exponent": 22859475456, + "rhs": 3584000000156848, + "rhs_bits": 52 + }, + "compact": { + "exponent": 22859475456, + "rhs": 14336000000627328, + "rhs_bits": 54 + }, + "leaf": { + "exponent": 21333333333333, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 22859475456, + "rhs": 7168000000313624, + "rhs_bits": 53 + }, + "rows": { + "exponent": 22859475456, + "rhs": 3584000000156848000, + "rhs_bits": 62 + } + } + } + ], + "practical_runtime_claim": false + }, + "finite_bridge": { + "bit": { + "W": 137151806, + "halving_degree": 9, + "m": 575, + "maxchild": 529, + "wire_bits": 28 + }, + "complex": { + "W": 537696432, + "halving_degree": 20, + "m": 784, + "maxchild": 756, + "s": 421548223824, + "scalar_group_upper": 4793351472, + "scalar_terms": [ + { + "c": 78437, + "copied_center_extra_groups": 56, + "h": 28, + "invocations": 3276, + "local_group_upper": 729892, + "v": 3276 + }, + { + "c": 78437, + "copied_center_extra_groups": 56, + "h": 28, + "invocations": 3276, + "local_group_upper": 729892, + "v": 3276 + } + ], + "wire_bits": 30 + }, + "rows": { + "coefficient": 852, + "contract": "W_complex^D_complex * W_bit^D_bit; one preceding prefix and padding; all temporary copies sequential", + "degree": 2000, + "degree_gap": "6548/25", + "suffix_slope": 8000 + }, + "semantic": { + "B": 9696565176891520488614054257040, + "C0": 2358858462850846165593256368932965330169899180021667007021321420800, + "C1": 1, + "E": 9696565176891520488192506033216, + "induction_gap": 533311084729033626873772984137200, + "literal_charge": 2771683137698171397039558468, + "strict_literal_gap": 9693793493753822316795466474748 + } + }, + "kappa": "5102757/100000000000", + "next_bit_saving": "5103019/100000000000", + "source": { + "compiler_sha256": "9984aaccf880e4840402322d76678bfddb33ce7e494af78430a43429f51b85fd", + "inherited_verifier_sha256": "fafe25d57166a747eeb847444a2e02dd7eed19038b93a2c495014d147d04a8fb", + "records": { + "compiler": "scripts/experiments/rank_pair_compiler.py (PR #60 rank-first variant of PR #57)", + "compiler_sha256": "9984aaccf880e4840402322d76678bfddb33ce7e494af78430a43429f51b85fd", + "graph": "research/pair-assembly/pair_graph.py", + "graph_sha256": "3d47e89d2649c90800a276bdd0480131def50e0bdf92c122a19494b55bf17420" + } + }, + "status": "Exact finite screen; retained analytic and fixed-tape hypotheses unchanged" +} diff --git a/research/rank-pair/screen.py b/research/rank-pair/screen.py new file mode 100644 index 0000000000..5d146f0edf --- /dev/null +++ b/research/rank-pair/screen.py @@ -0,0 +1,119 @@ +#!/usr/bin/env python3 +"""Regenerate paid profiles and exact screen for rank-first PR62 composition. + +Uses PR62's profile construction, eumemic's PR57 word/profile checkers and +Chafik Boukhalfa's PR60 rank-first compiler. Prepared by Dominik Scholz with +substantial OpenAI GPT-6 Astra assistance. Apache-2.0; inherited notices apply. +This is a research screen, not a claim of formal verification. +""" +import sys + +if sys.flags.optimize: + raise ValueError('Assertions must remain enabled') +sys.dont_write_bytecode = True + +from fractions import Fraction as Q +from hashlib import sha256 +import importlib.util +import json +import os +from pathlib import Path +import shlex +import subprocess + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +EXP = ROOT / 'scripts/experiments' +sys.path.insert(0, str(EXP)) +import binary_frame_math as arithmetic +from binary_frame_profile_prepare import prepare +from binary_frame_replay import replay +from frame_compile import COMPILER_SHA256, GRAPH_SHA256 + +spec = importlib.util.spec_from_file_location( + 'pair_frame_verifier', ROOT / 'research/pair-assembly/frame/frame_verify.py') +baseline = importlib.util.module_from_spec(spec) +spec.loader.exec_module(baseline) + + +def main(): + records = json.loads((HERE / 'frame-compiler.json').read_text()) + assert records['source']['compiler_sha256'] == COMPILER_SHA256 + assert records['source']['graph_sha256'] == GRAPH_SHA256 + assert sha256((EXP/'rank_pair_compiler.py').read_bytes()).hexdigest() == records['source']['compiler_sha256'] + assert sha256((ROOT/records['source']['graph']).read_bytes()).hexdigest() == records['source']['graph_sha256'] + baseline.check_sources() + profiles = [] + profiler = HERE / 'profiles' + subprocess.run([*shlex.split(os.environ.get('CXX', 'c++')), '-O3', '-std=c++17', '-I', + str(baseline.INHERITED / 'scripts/partial_swap'), + str(EXP / 'binary_frame_profiles.cpp'), '-o', str(profiler)], check=True) + for h in (23, 25): + path = HERE / f'frame-word-{h}.json.gz' + packed = path.read_bytes() + assert sha256(packed).hexdigest() == records['axes'][str(h)]['gzip_sha256'] + receipt = replay(path) + assert json.loads(json.dumps(receipt)) == records['axes'][str(h)]['replay'] + transitions = HERE / f'word{h}.bin' + prepared = prepare(path, transitions) + (HERE / f'frame-transitions-{h}.json').write_text(json.dumps(prepared, indent=2)+'\n') + subprocess.run([str(profiler), str(transitions)], check=True) + profile = json.loads(Path(str(transitions)+'.profiles.json').read_text()) + (HERE / f'frame-profiles-{h}.json').write_text(json.dumps(profile, indent=2)+'\n') + profiles.append(profile) + print(f'PASS physical replay and fixed profiles h={h}, roles={profile["R"]}', flush=True) + # The unchanged profile constructor validates the literal rank identity. + baseline.WIRES_S = 2*4073300 + sum(4073300//f['v']*f['R'] for f in profiles) + baseline.MASS_S = 575*baseline.WIRES_S - 1846900 + profile = baseline.profile(profiles, records) + rows = profile['child_multiplicities'] + low, high = 1, 7170000 + while low+1 < high: + mid = (low+high)//2 + test = arithmetic.moment(575, profile['W'], rows, Q(mid, 10**11)) + if test['strict_gap'] > 0: + low = mid + else: + high = mid + ab = Q(low, 10**11) + accepted = arithmetic.moment(575, profile['W'], rows, ab) + rejected = arithmetic.moment(575, profile['W'], rows, Q(high, 10**11)) + assert accepted['strict_gap'] > 0 and rejected['lower'] > 1 + bridge = json.loads((baseline.OLD/'certificate.json').read_text())['finite_bridge'] + bridge['bit']['W'] = profile['W'] + preliminary = baseline.balanced.assembly(bridge, ab, Q(1, 10**11)) + scaled = preliminary['minimum_margin'] * 10**11 + kappa = Q(-(-scaled.numerator//scaled.denominator)-1, 10**11) + assembled = baseline.balanced.assembly(bridge, ab, kappa) + try: + baseline.balanced.assembly(bridge, ab, kappa+Q(1, 10**11)) + except baseline.balanced.InvalidAssembly: + pass + else: + raise AssertionError('Next assembly grid point unexpectedly passed') + prior = json.loads((ROOT/'research/pair-assembly/frame/frame-certificate.json').read_text()) + old_rows = {int(t): n for t,n in prior['bit']['child_multiplicities'].items()} + old_at_new = arithmetic.moment(575, prior['bit']['W'], old_rows, ab) + result = dict( + status='Exact finite screen; retained analytic and fixed-tape hypotheses unchanged', + kappa=kappa, bit_saving=ab, next_bit_saving=Q(high, 10**11), + bit=dict(profile, moment=accepted, excluded_above_lower=rejected['lower']), + assembly=assembled, finite_bridge=bridge, + eventual_bounds=baseline.balanced.cutoffs(bridge, assembled), + comparison=dict(pr62_kappa=Q(5101691,10**11), + difference=kappa-Q(5101691,10**11), + ratio=kappa/Q(5101691,10**11), + pr61_head='afb7cb67d1858641315cfbf4ac768ee64a8eff3a', + pr61_kappa=Q(25508460085039,500000000000000000), + difference_pr61=kappa-Q(25508460085039,500000000000000000), + ratio_pr61=kappa/Q(25508460085039,500000000000000000), + pr62_network_at_new_bit_lower=old_at_new['lower']), + source=dict(records=records['source'], compiler_sha256=sha256((EXP/'rank_pair_compiler.py').read_bytes()).hexdigest(), + inherited_verifier_sha256=sha256((ROOT/'research/pair-assembly/frame/frame_verify.py').read_bytes()).hexdigest())) + (HERE/'screen-certificate.json').write_text(json.dumps(arithmetic.js(result), indent=2, sort_keys=True)+'\n') + print('EXACT SCREEN', json.dumps(arithmetic.js(dict(kappa=kappa, bit=ab, W=profile['W'], + comparison=result['comparison']))), flush=True) + + +if __name__ == '__main__': + main() diff --git a/research/slot-cost-rank-pair/README.md b/research/slot-cost-rank-pair/README.md new file mode 100644 index 0000000000..8e51520038 --- /dev/null +++ b/research/slot-cost-rank-pair/README.md @@ -0,0 +1,99 @@ +# All-rank profile-cost reclamation + +This finite conditional witness gives + +κ = 10206752116843 / 200000000000000000 = 0.000051033760584215, +with bit saving a = 51036365162009 / 10^18 and the inherited h = 10^-12. + +It exceeds the PR #65 mixed-order bound 0.000051028985071975 by +0.000000004775512240. This is a bound comparison, not a claim about formal +proof coverage or practical multiplication speed. + +## Change and paid quantities + +The PR #62 pair graph, region order, carrier matching and local linear +synthesis remain those used by PR #63. During reclamation, the compiler now +examines every eligible dependent retired role, including lower-ranked roles, +and selects a witnessed clearing operation using actual fixed-basis profile +costs. PR #60/#63 instead stop at the first dependent role in descending rank. + +The candidate uses an integer score: each transition's inherited fixed-basis +pivot/CRT profile is evaluated with t times a fixed integer midpoint of the +exact rational ln(t) enclosure at scale 10^30. The score estimates the entropy +change of growth plus final cleanup. Later uses can alter that prediction, so +it is solely a deterministic discovery heuristic. The reported bound comes +from complete physical replay and the full paid exact moment, not the score. +No floating-point arithmetic affects candidate selection. + +| Axis | Roles | Reclamations | Clearing XORs | All elementary XORs | +|---|---:|---:|---:|---:| +| 23 | 27918 | 801 | 1415 | 148975 | +| 25 | 36586 | 1090 | 1950 | 205773 | + +The complete paid width, rank mass and deficit remain 137151806, +78860441550 and 1846900. All endpoint copy, exterior and data-growth costs +are retained. Neither fewer XORs nor unchanged width alone proves improvement. +The bounded search compared rank ties, signal sparsity, containment scarcity, +rank-entropy and physical-profile scores. No global optimality is claimed. + +## Why selecting a later dependency is valid + +At an acquire call, the linear basis contains current anchors and earlier +eligible independent retired roles. Each retired role enters the basis only +after its frame is checked to be contained in the requested frame. A dependent +candidate returns a literal XOR expression containing itself and basis roles. + +Enumerating later candidates mutates only this temporary basis and stored +witnesses. It does not change any physical value, frame, operation or event. +Thus a stored dependency remains valid when another candidate is considered. +For the selected witness, the unchanged xor function checks containment and +charges the frame raises of both operands on every emitted XOR. It clears the +selected role, removes that role from the retired set, and reuses it through +the unchanged compiler. The other XOR operands keep their values. Allowing +candidates from additional ranks does not waive any eligibility check. + +This establishes that the selection rule chooses among valid literal clearing +witnesses. Independently, the serialized circuit is replayed on every input +and dirty basis vector in both orientations; every physical transition is +reconstructed from the actual word and every fixed-basis profile is rebuilt. +The unchanged inherited constructor verifies the complete paid rank identity. + +## Reproduction and controls + +From the repository root, with Python assertions enabled: + +```sh +PYTHONDONTWRITEBYTECODE=1 python3 research/slot-cost-rank-pair/verify.py +PYTHONDONTWRITEBYTECODE=1 python3 research/slot-cost-rank-pair/verify.py --rebuild +PYTHONDONTWRITEBYTECODE=1 python3 research/slot-cost-rank-pair/test_negative.py +PYTHONDONTWRITEBYTECODE=1 python3 research/slot-cost-rank-pair/arithmetic/refine.py +PYTHONDONTWRITEBYTECODE=1 python3 research/slot-cost-rank-pair/arithmetic/audit.py +PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s research/slot-cost-rank-pair/arithmetic -p test_arithmetic.py -v +``` + +The physical verifier checks source and artifact digests, complete dirty-basis +replay, exact transition reconstruction and every physical profile. --rebuild +also regenerates both words with the committed portable compiler and requires +byte equality with the decompressed committed witnesses. CXX can specify a +working C++ compiler/sysroot. All disposable outputs go into +build/slot-cost-rank-pair, or the explicit --work-dir directory. + +Seven physical controls reject an omitted XOR, understated role count, +omitted paid transition, altered word/profile digests and optimized Python +for both the compiler and verifier. Arithmetic verification has its own +independent rational bounds, adjacent-grid failures and adversarial controls. + +## Scope and attribution + +The original-envelope interpretation, analytic, semantic, routing, recovery, +fixed-tape and all-size transfer hypotheses remain inherited. This is a finite +conditional certificate, not formal verification of those hypotheses. + +Retain Avi Eisenberg's PR #62 graph attribution, Chafik Boukhalfa's PR #60 +rank-first compiler contribution, eumemic's PR #57 joint frame compiler, and +Dominik Scholz's PR #63 composition with OpenAI GPT-6 Astra assistance. The +PR #62 graph was prepared with Claude assistance; the PR #57/#60 compiler used +OpenAI Codex assistance. The inherited sources retain their full earlier +credits, including OpenAI, Harvey–van der Hoeven, icekylinx and collaborators. +This profile-cost selection experiment and packaging are by Rohan Arun with +OpenAI Codex assistance. Apache-2.0 applies with the inherited notices retained. diff --git a/research/slot-cost-rank-pair/arithmetic/README.md b/research/slot-cost-rank-pair/arithmetic/README.md new file mode 100644 index 0000000000..85c709ee1b --- /dev/null +++ b/research/slot-cost-rank-pair/arithmetic/README.md @@ -0,0 +1,174 @@ +# Exact arithmetic for the all-rank slot-cost witness + +The selected complete paid profile admits + +- bit saving `a = 51036365162009/1000000000000000000`; +- backoff `h = 1/1000000000000`, unchanged from PR63; +- `kappa = 10206752116843/200000000000000000 = 0.000051033760584215`. + +All 47 strict assembly inequalities and all seven margins pass. The next bit +saving on the 1e-18 grid has moment strictly above one; the next kappa on that +grid fails the unchanged balanced assembly. The finite sufficient arithmetic +cutoff remains `log2(input) >= 14000000000000`. This is an eventual arithmetic +threshold, not a practical runtime claim or the complete all-size threshold. + +The exact gain above PR65 is `59693903/12500000000000000`, approximately +0.0093584308 percent relative. The gain above PR63's `5102757/10^11` is +`1238116843/200000000000000000`. Construction and precision gains are separate: + +| Check | Bit saving | Kappa | Gain versus PR63 | +|---|---:|---:|---:| +| Same 1e-11 grid and same h as PR63 | 0.00005103636 | 0.00005103375 | 0.00000000618 | +| Refined 1e-18 grid; same h | 0.000051036365162009 | 0.000051033760584215 | 0.000000006190584215 | + +The first row passes even with PR63's original low-order exponential bounds, +and its next bit grid point fails with those bounds. Thus its 6.18e-9 gain does +not depend on tightening the numerical enclosure. Precision adds a further +`2116843/200000000000000000 = 1.0584215e-11`. + +## Reproduction and source linkage + +Run from any checkout location using Python 3.11 or later: + +```sh +python3 -B research/slot-cost-rank-pair/arithmetic/refine.py +python3 -B research/slot-cost-rank-pair/arithmetic/audit.py +python3 -B -m unittest discover -s research/slot-cost-rank-pair/arithmetic -p test_arithmetic.py -v +``` + +The default commands recompute and compare without writing outputs. An +intentional certificate update uses `--record` on the first two commands. +`refine.py` accepts `--profile PATH` and `--certificate PATH`; `audit.py` +accepts `--certificate PATH` and `--receipt PATH`. + +`certificate.json` pins `../paired-candidate.json`, both arithmetic scripts, +the inherited logarithm implementation and the inherited balanced assembly +by SHA256. It also pins the PR65 arithmetic certificate used for comparison. All paths are repository relative. It includes the complete exact +per-child logarithm and exponential intervals, weighted moment bounds, +assembly slacks, all seven margins, next-grid failures, comparisons and +sufficient arithmetic cutoffs. `audit-receipt.json` records an independently +computed enclosure and ten deliberate assembly failures. + +This package checks the supplied complete paid profile. The parent +`../verify.py` checks the words, physical replay, actual profile/CRT results, +paid profile assembly and its correspondence to `../paired-candidate.json`. +An arithmetic pass alone does not prove that physical linkage. + +## Rational logarithm enclosure + +For `y >= 1`, put `z = (y-1)/(y+1)`. With `0 <= z < 1`, + +`log(y) = 2 * sum(j>=0, z^(2j+1)/(2j+1))`. + +Every term is nonnegative. Truncation after indices `0,...,J-1` is therefore a +lower bound. For the tail, `2j+1 >= 2J+1` and the powers form a geometric series, +so the upper remainder is + +`2*z^(2J+1)/((2J+1)*(1-z^2))`. + +The inherited helper reduces by powers of 2 to `1 <= y <= 2`, uses `J=32`, +adds the corresponding multiple of `log(2)`, then rounds downward/upward to +the 1e-30 rational grid. These operations preserve the enclosure. + +The independent audit instead reduces by powers of 3/2 to +`1 <= y <= 3/2`, uses `J=60`, and adds the corresponding multiple of +`log(3/2)`. Its exact logarithm enclosure is checked to lie inside the recorded +inherited interval for every child. The two implementations share the +mathematical atanh-series identity but use different range reduction, term +counts and evaluation code; neither relies on machine floating-point logs. + +## Rational exponential and complete moment enclosure + +For a child of dimension `t`, multiplicity `n`, arity `m` and width `W`, the +weight is `w=t*n/(m*W) > 0`. With bit saving `a>0`, its contribution to the +characteristic moment is `w*exp(a*log(m/t))`. The complete histogram includes +all paid parts; neither rare children nor physical transitions are omitted. + +Write `u=a*log_lower` and `v=a*log_upper`. The checker verifies +`0 <= u <= v < 1`. For `S_d(x)=sum(j=0..d, x^j/j!)`, positivity gives + +`S_d(u) <= exp(a*log(m/t))`. + +At `v`, the first omitted term is `v^(d+1)/(d+1)!`; each later term divided by +its predecessor is at most `v/(d+2) < 1`. A geometric majorant therefore gives + +`exp(a*log(m/t)) <= S_d(v) + v^(d+1)/((d+1)!*(1-v/(d+2)))`. + +The primary checker uses `d=8`. It rounds the lower expression downward and +the upper expression upward to the 1e-40 rational grid, multiplies by each +positive exact weight, and sums. Directed rounding can only widen the +interval. Every arithmetic operation uses integers and exact Fractions. + +The independent audit evaluates the exponential by a recurrence through +degree 12. It checks `v<1/1000`, rounds input bounds outward, and bounds the +remaining tail by twice the first omitted term. This is valid because all +successive tail ratios are below 1/2. It independently confirms that the +accepted upper moment is below one and the successor lower moment is above +one. No empirical epsilon, decimal-log assumption or float tolerance enters +the acceptance decision. + +All weights and `log(m/t)` are strictly positive, since `0= 1 + k = 0 + while x > Q(3, 2): + x /= Q(3, 2) + k += 1 + def small(y): + z = (y-1)/(y+1) + power, total = z, Q() + for j in range(60): + total += power/Q(2*j+1) + power *= z*z + return 2*total, 2*total+2*power/(121*(1-z*z)) + lo, hi = small(x) + blo, bhi = small(Q(3, 2)) + return lo+k*blo, hi+k*bhi + + +def independent_moment(profile, saving, recorded_terms): + low, high = Q(), Q() + rows = {int(t): n for t, n in profile['child_multiplicities'].items()} + for t, n in sorted(rows.items()): + lo, hi = log_interval(Q(profile['m'], t)) + recorded = recorded_terms[str(t)] + assert Q(recorded['log_lower']) <= lo <= hi <= Q(recorded['log_upper']) + u, v = lo*saving, hi*saving + assert 0 < u <= v < Q(1, 1000) + # Directed rounding of input logs bounds rational denominator sizes. + u = Q(refine.floor_scaled(u, 10**40), 10**40) + v = Q(refine.ceiling_scaled(v, 10**40), 10**40) + tlo, thi = Q(1), Q(1) + elo, ehi = Q(1), Q(1) + for j in range(1, 13): + tlo, thi = tlo*u/j, thi*v/j + elo, ehi = elo+tlo, ehi+thi + # First omitted term is degree13; subsequent ratios <1/2. + ehi += 2*thi*v/13 + weight = Q(t*n, profile['m']*profile['W']) + low += weight*Q(refine.floor_scaled(elo, 10**40), 10**40) + high += weight*Q(refine.ceiling_scaled(ehi, 10**40), 10**40) + return low, high + + +def audit(certificate): + profile_path = ROOT/certificate['profile_path'] + assert sha256(profile_path.read_bytes()).hexdigest() == certificate['profile_sha256'] + for name, digest in certificate['source_sha256'].items(): + assert sha256((ROOT/name).read_bytes()).hexdigest() == digest, name + source = json.loads(profile_path.read_text()) + p = source['bit'] + assert sum(int(t)*n for t, n in p['child_multiplicities'].items()) == p['total_rank'] + accepted = independent_moment(p, Q(certificate['bit_saving']), certificate['accepted_moment']['terms']) + rejected = independent_moment(p, Q(certificate['next_bit_saving']), certificate['accepted_moment']['terms']) + assert accepted[1] < 1 < rejected[0] + controls = {} + for name, variant in [('preferred', certificate['preferred']), ('coarse_grid_control', certificate['coarse_grid_control'])]: + params = variant['assembly']['parameters'] + result = refine.balanced.assembly(source['finite_bridge'], Q(params['a_bit']), Q(params['kappa']), h=Q(params['h'])) + assert refine.arithmetic.js(result) == variant['assembly'] + assert len(result['constraints']) == 47 and len(result['margins']) == 7 + assert all(v > 0 for v in result['constraints'].values()) + for label, kwargs in [('next_grid', dict(kappa=Q(variant['next_kappa']))), + ('zero_backoff', dict(h=Q())), + ('original_prefix', dict(original_prefix=True)), + ('old_guard', dict(old_guard=True)), + ('old_exposures', dict(old_exposures=True))]: + call = dict(a_bit=Q(params['a_bit']), kappa=Q(params['kappa']), h=Q(params['h'])) + call.update(kwargs) + try: + refine.balanced.assembly(source['finite_bridge'], **call) + except refine.balanced.InvalidAssembly as error: + controls[name+'/'+label] = str(error) + else: + raise AssertionError('Negative control accepted: '+name+'/'+label) + next_a = Q(certificate['next_bit_saving']) + best = Q(certificate['preferred']['kappa']) + cap = next_a/(1+next_a) + assert cap > best + return dict(status='PASS', independent_log_base='3/2', independent_log_terms=60, + independent_exp_degree=12, independent_tail='twice first omitted term', + independent_accepted_gap=1-accepted[1], independent_rejected_gap=rejected[0]-1, + variants_reassembled=2, constraints_each=47, margins_each=7, controls=controls, + fixed_profile_balanced_family_kappa_strict_upper=cap, + remaining_possible_parameter_gain_upper=cap-best) + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--certificate', type=Path, default=HERE/'certificate.json') + parser.add_argument('--receipt', type=Path, default=HERE/'audit-receipt.json') + parser.add_argument('--record', action='store_true') + args = parser.parse_args() + result = refine.arithmetic.js(audit(json.loads(args.certificate.read_text()))) + if args.record: + args.receipt.write_text(json.dumps(result, indent=2, sort_keys=True)+'\n') + else: + assert result == json.loads(args.receipt.read_text()), 'Independent receipt changed' + print('PASS independent logarithm/exponential enclosures; 47 strict constraints; seven margins; ten assembly negative controls') + + +if __name__ == '__main__': + main() diff --git a/research/slot-cost-rank-pair/arithmetic/certificate.json b/research/slot-cost-rank-pair/arithmetic/certificate.json new file mode 100644 index 0000000000..6b6c69eed6 --- /dev/null +++ b/research/slot-cost-rank-pair/arithmetic/certificate.json @@ -0,0 +1,1090 @@ +{ + "accepted_moment": { + "degree": 8, + "lower": "34287951499999999989055597041432440987834394155581/34287951500000000000000000000000000000000000000000", + "rounding_denominator": 10000000000000000000000000000000000000000, + "saving": "51036365162009/1000000000000000000", + "strict_gap": "5472201479283778631071387352483/17143975750000000000000000000000000000000000000000", + "terms": { + "1": { + "exp_lower": "10003243565419877175837532941202236866327/10000000000000000000000000000000000000000", + "exp_upper": "10003243565419877175837532941202237377951/10000000000000000000000000000000000000000", + "log_lower": "3177185020398675220004135749131/500000000000000000000000000000", + "log_upper": "6354370040797350440008271498263/1000000000000000000000000000000", + "weight": "37473373/1714397575" + }, + "10": { + "exp_lower": "2500517024395860286591639859327420884483/2500000000000000000000000000000000000000", + "exp_upper": "10002068097583441146366559437309684048421/10000000000000000000000000000000000000000", + "log_lower": "2025892473901652377995140021789/500000000000000000000000000000", + "log_upper": "4051784947803304755990280043579/1000000000000000000000000000000", + "weight": "77412/68575903" + }, + "11": { + "exp_lower": "250050486119763848123221805987259969219/250000000000000000000000000000000000000", + "exp_upper": "10002019444790553924928872239490399279243/10000000000000000000000000000000000000000", + "log_lower": "3956474767998979895946327920297/1000000000000000000000000000000", + "log_upper": "1978237383999489947973163960149/500000000000000000000000000000", + "weight": "376059/311708650" + }, + "12": { + "exp_lower": "10001975028477243662179919143887815159291/10000000000000000000000000000000000000000", + "exp_upper": "10001975028477243662179919143887815669769/10000000000000000000000000000000000000000", + "log_lower": "3869463391009350129778562018423/1000000000000000000000000000000", + "log_upper": "483682923876168766222320252303/125000000000000000000000000000", + "weight": "1634448/1714397575" + }, + "13": { + "exp_lower": "10001934169603959132140479122023243757421/10000000000000000000000000000000000000000", + "exp_upper": "2000386833920791826428095824404648853579/2000000000000000000000000000000000000000", + "log_lower": "3789420683335813703954784056697/1000000000000000000000000000000", + "log_upper": "1894710341667906851977392028349/500000000000000000000000000000", + "weight": "1529879/1714397575" + }, + "14": { + "exp_lower": "125023704254309954408829461335464857777/125000000000000000000000000000000000000", + "exp_upper": "1000189634034479635270635690683718913263/1000000000000000000000000000000000000000", + "log_lower": "3715312711182091825485686633361/1000000000000000000000000000000", + "log_upper": "1857656355591045912742843316681/500000000000000000000000000000", + "weight": "1223733/1714397575" + }, + "15": { + "exp_lower": "10001861122275682474422023133960288399529/10000000000000000000000000000000000000000", + "exp_upper": "2500465280568920618605505783490072227499/2500000000000000000000000000000000000000", + "log_lower": "3646319839695140374012266928113/1000000000000000000000000000000", + "log_upper": "1823159919847570187006133464057/500000000000000000000000000000", + "weight": "3819/5963122" + }, + "16": { + "exp_lower": "5000914089042217268908935547659857583161/5000000000000000000000000000000000000000", + "exp_upper": "5000914089042217268908935547659857838393/5000000000000000000000000000000000000000", + "log_lower": "3581781318557569202339343012429/1000000000000000000000000000000", + "log_upper": "358178131855756920233934301243/100000000000000000000000000000", + "weight": "65304/155854325" + }, + "17": { + "exp_lower": "10001797231872447663672948820295888153701/10000000000000000000000000000000000000000", + "exp_upper": "10001797231872447663672948820295888664163/10000000000000000000000000000000000000000", + "log_lower": "3521156696741134359758736880389/1000000000000000000000000000000", + "log_upper": "352115669674113435975873688039/100000000000000000000000000000", + "weight": "3553051/1714397575" + }, + "18": { + "exp_lower": "2500442013773846846157871156057954244463/2500000000000000000000000000000000000000", + "exp_upper": "1250221006886923423078935578028977186039/1250000000000000000000000000000000000000", + "log_lower": "3463998282901185747800548902959/1000000000000000000000000000000", + "log_upper": "43299978536264821847506861287/12500000000000000000000000000", + "weight": "361782/1714397575" + }, + "19": { + "exp_lower": "1250217557038777938253640903826372152467/1250000000000000000000000000000000000000", + "exp_upper": "5000870228155111753014563615305488865097/5000000000000000000000000000000000000000", + "log_lower": "1704965530815454989999622033187/500000000000000000000000000000", + "log_upper": "27279448493047279839993952531/8000000000000000000000000000", + "weight": "11837/155854325" + }, + "2": { + "exp_lower": "5001444849904709627388185025591453138111/5000000000000000000000000000000000000000", + "exp_upper": "10002889699809419254776370051182906787121/10000000000000000000000000000000000000000", + "log_lower": "1415305715059351282647759844201/250000000000000000000000000000", + "log_upper": "1132244572047481026118207875361/200000000000000000000000000000", + "weight": "3613701/1714397575" + }, + "20": { + "exp_lower": "625107142097203755823830239950067137311/625000000000000000000000000000000000000", + "exp_upper": "1250214284194407511647660479900134338429/1250000000000000000000000000000000000000", + "log_lower": "83965944181083986164326198053/25000000000000000000000000000", + "log_upper": "3358637767243359446573047922121/1000000000000000000000000000000", + "weight": "26402/342879515" + }, + "21": { + "exp_lower": "5000844684295626683551604239903299855287/5000000000000000000000000000000000000000", + "exp_upper": "2500422342147813341775802119951650055257/2500000000000000000000000000000000000000", + "log_lower": "413730950384240930438459189737/125000000000000000000000000000", + "log_upper": "3309847603073927443507673517897/1000000000000000000000000000000", + "weight": "12978/2981561" + }, + "22": { + "exp_lower": "5000832811241734824148334529665518858407/5000000000000000000000000000000000000000", + "exp_upper": "10001665622483469648296669059331038227267/10000000000000000000000000000000000000000", + "log_lower": "3263327587439034586529095798839/1000000000000000000000000000000", + "log_upper": "81583189685975864663227394971/25000000000000000000000000000", + "weight": "77/2833715" + }, + "23": { + "exp_lower": "5000821466083308119633134667588448691639/5000000000000000000000000000000000000000", + "exp_upper": "312551341630206757477070916724278059179/312500000000000000000000000000000000000", + "log_lower": "804718956217050187300379666613/250000000000000000000000000000", + "log_upper": "3218875824868200749201518666453/1000000000000000000000000000000", + "weight": "11447/542102" + }, + "25": { + "exp_lower": "500080018516163633815016597831162977397/500000000000000000000000000000000000000", + "exp_upper": "2500400092580818169075082989155815014597/2500000000000000000000000000000000000000", + "log_lower": "313549421592914969080675283181/100000000000000000000000000000", + "log_upper": "3135494215929149690806752831811/1000000000000000000000000000000", + "weight": "11641/566743" + }, + "3": { + "exp_lower": "10002682707500039326312460500258358209191/10000000000000000000000000000000000000000", + "exp_upper": "10002682707500039326312460500258358719891/10000000000000000000000000000000000000000", + "log_lower": "262787887606462037430651313067/50000000000000000000000000000", + "log_upper": "5255757752129240748613026261341/1000000000000000000000000000000", + "weight": "266382/155854325" + }, + "4": { + "exp_lower": "10002535846716988056330662919372730562841/10000000000000000000000000000000000000000", + "exp_upper": "2000507169343397611266132583874546214691/2000000000000000000000000000000000000000", + "log_lower": "2484037839838729910586903627673/500000000000000000000000000000", + "log_upper": "4968075679677459821173807255347/1000000000000000000000000000000", + "weight": "88926/68575903" + }, + "481": { + "exp_lower": "10000091101740848302031456672210536965319/10000000000000000000000000000000000000000", + "exp_upper": "10000091101740848302031456672210537475689/10000000000000000000000000000000000000000", + "log_lower": "35700554138317851917337677133/200000000000000000000000000000", + "log_upper": "89251385345794629793344192833/500000000000000000000000000000", + "weight": "13468/271051" + }, + "5": { + "exp_lower": "10002421934128620735420380022825045207067/10000000000000000000000000000000000000000", + "exp_upper": "5001210967064310367710190011412522858817/5000000000000000000000000000000000000000", + "log_lower": "1186233032090812516351878041259/250000000000000000000000000000", + "log_upper": "4744932128363250065407512165037/1000000000000000000000000000000", + "weight": "436112/342879515" + }, + "525": { + "exp_lower": "10000046428796700772138492046845457326217/10000000000000000000000000000000000000000", + "exp_upper": "1250005803599587596517311505855682229573/1250000000000000000000000000000000000000", + "log_lower": "22742944551431673576538712861/250000000000000000000000000000", + "log_upper": "18194355641145338861230970289/200000000000000000000000000000", + "weight": "244461/566743" + }, + "529": { + "exp_lower": "625002659689560148567378584865005958619/625000000000000000000000000000000000000", + "exp_upper": "1000004255503296237707805735784009584827/1000000000000000000000000000000000000000", + "log_lower": "41690804469525529197382917321/500000000000000000000000000000", + "log_upper": "83381608939051058394765834643/1000000000000000000000000000000", + "weight": "116748/271051" + }, + "6": { + "exp_lower": "2000465772345995812166821851930633744827/2000000000000000000000000000000000000000", + "exp_upper": "5001164430864989530417054629826584617337/5000000000000000000000000000000000000000", + "log_lower": "4562610571569295439195794139881/1000000000000000000000000000000", + "log_upper": "2281305285784647719597897069941/500000000000000000000000000000", + "weight": "222609/155854325" + }, + "7": { + "exp_lower": "10002250170813833754091674601578554794559/10000000000000000000000000000000000000000", + "exp_upper": "10002250170813833754091674601578555305079/10000000000000000000000000000000000000000", + "log_lower": "4408459891742037134902918754819/1000000000000000000000000000000", + "log_upper": "220422994587101856745145937741/50000000000000000000000000000", + "weight": "2615158/1714397575" + }, + "8": { + "exp_lower": "625136375383883797138576298380711394747/625000000000000000000000000000000000000", + "exp_upper": "10002182006142140754217220774091382826459/10000000000000000000000000000000000000000", + "log_lower": "66795757798711164246196486467/15625000000000000000000000000", + "log_upper": "4274928499117514511756575133889/1000000000000000000000000000000", + "weight": "92592/68575903" + }, + "9": { + "exp_lower": "2500530470256540599531856421684376210541/2500000000000000000000000000000000000000", + "exp_upper": "10002121881026162398127425686737505352661/10000000000000000000000000000000000000000", + "log_lower": "4157145463461131057217781024417/1000000000000000000000000000000", + "log_upper": "2078572731730565528608890512209/500000000000000000000000000000", + "weight": "4275837/3428795150" + } + }, + "upper": "17143975749999999994527798520716221368928612647517/17143975750000000000000000000000000000000000000000" + }, + "binary_search_steps": 46, + "bit_saving": "51036365162009/1000000000000000000", + "coarse_grid_control": { + "assembly": { + "absorption_gap": "6162511075146765654969/1136421632227272611281000000000000", + "constraints": { + "K_dominates_log": "3411521407075326933138375807/66848331307486624193000000000000", + "K_geometry": "852330723136647611281/1136421632227272611281000000000000", + "a_below_b": "516591/25000000000", + "a_positive": "1275909/25000000000", + "alpha_below_one": "2272727272726136421632227272611281/2272843264454545222562000000000000", + "alpha_below_one_fourth": "568094824385227504710727272611281/2272843264454545222562000000000000", + "alpha_positive": "115991728408800929772727388719/2272843264454545222562000000000000", + "artificial_boundary": "63640075371648856386880681817833843/9091373057818180890248000000000000", + "b_below_one_over32": "311783/10000000", + "beta_below_one": "19/20", + "beta_positive": "1/20", + "c_below_one": "12499362045496876275909/12500000000000000000000", + "c_positive": "637954503123724091/12500000000000000000000", + "cell_above_band": "2272727272723863578367772727388719/4545686528909090445124000000000000", + "compact_leaf": "213483000001275909/12500000000000000000000", + "compact_reservations": "1/4000000000000", + "delta_below_one_eighth": "999999999999/8000000000000", + "delta_positive": "1/8000000000000", + "epsilon_below_one": "57995864772611281/1136421632227272611281", + "epsilon_positive": "1136363636362500000000/1136421632227272611281", + "g1_above_kappa": "5839146165899230613/909137305781818089024800000000", + "g2_above_kappa": "261/100000000000", + "g3_above_kappa": "6162511075146765654969/1136421632227272611281000000000000", + "g4_above_kappa": "261/100000000000", + "g5_above_kappa": "10541870699571188614719/1818274611563636178049600000000000", + "g6_above_kappa": "57255040026765033518719/9091373057818180890248000000000000", + "g7_above_kappa": "909044512404021057141099230613/909137305781818089024800000000", + "gamma_sublinear": "1/2000000000000", + "guard_width": "57995864772611281/1136421632227272611281", + "lambda_above_internal": "1275909/25000000000000000000000", + "lambda_above_sigma": "516591000001275909/25000000000000000000000", + "lambda_above_tau": "1275909/25000000000000000000000", + "lambda_prime_above_lambda": "1275909/25000000000000000000000", + "lambda_prime_below_one": "637954499998724091/12500000000000000000000", + "literal_scalar_guard": "9693793493753822316795466474748", + "phase_boundary": "92793382499756417372727388719/1818274611563636178049600000000000", + "phase_leaf_above_bit": "213483/12500000000", + "phase_local": "463966917044468615772727388719/9091373057818180890248000000000000", + "prime_interval_packing": "57995864772611281/1136421632227272611281", + "q_below_internal": "1275909/12500000000000000000000", + "q_below_leaf": "213483000001275909/12500000000000000000000", + "q_below_reservations": "1/4000000000000", + "q_positive": "637954499998724091/12500000000000000000000", + "record_suffix": "57995864772611281/1136421632227272611281", + "row_product_gap": "6548/25", + "short_record_fallback": "28407640938474146532829813070571/28410540805681815282025000000000", + "small_field_exposure": "1/1000000000000" + }, + "finite_bridge": { + "bit": { + "W": 137151806, + "halving_degree": 9, + "m": 575, + "maxchild": 529, + "wire_bits": 28 + }, + "complex": { + "W": 537696432, + "halving_degree": 20, + "m": 784, + "maxchild": 756, + "s": 421548223824, + "scalar_group_upper": 4793351472, + "wire_bits": 30 + }, + "rows": { + "coefficient": 852, + "degree": 2000, + "degree_gap": "6548/25", + "suffix_slope": 8000 + }, + "semantic": { + "B": 9696565176891520488614054257040, + "C0": 2358858462850846165593256368932965330169899180021667007021321420800, + "C1": 1, + "E": 9696565176891520488192506033216, + "induction_gap": 533311084729033626873772984137200, + "literal_charge": 2771683137698171397039558468, + "strict_literal_gap": 9693793493753822316795466474748 + } + }, + "margins": { + "g1": "57995864772611281/1136421632227272611281", + "g2": "1275909/25000000000", + "g3": "57995863636189648772727388719/1136421632227272611281000000000000", + "g4": "1275909/25000000000", + "g5": "92793382499756417372727388719/1818274611563636178049600000000000", + "g6": "463966917044468615772727388719/9091373057818180890248000000000000", + "g7": "1136363636362500000000/1136421632227272611281" + }, + "minimum_margin": "57995863636189648772727388719/1136421632227272611281000000000000", + "parameters": { + "C0": 2358858462850846165593256368932965330169899180021667007021321420800, + "C1": "1", + "a_bit": "1275909/25000000000", + "a_complex": "717/10000000", + "alpha_squared_power": "115991728408800929772727388719/2272843264454545222562000000000000", + "beta": "1/20", + "c": "637954503123724091/12500000000000000000000", + "delta": "1/8000000000000", + "epsilon": "1136363636362500000000/1136421632227272611281", + "h": "1/1000000000000", + "kappa": "40827/800000000", + "lambda_": "24998724091000001275909/25000000000000000000000", + "lambda_prime": "12499362045500001275909/12500000000000000000000", + "q": "637954499998724091/12500000000000000000000", + "sigma": "9999283/10000000", + "tau": "24998724091/25000000000" + }, + "recurrence": { + "internal": "24998724091/25000000000", + "leaf": "199986377/200000000", + "reservations": "12499362045496876275909/12500000000000000000000" + }, + "scoped_limit": "1275909/25001275909" + }, + "bit_saving": "1275909/25000000000", + "eventual_bounds": { + "additional_eventual_conditions": [ + "BHP prime threshold and distinct-prime packing", + "Fixed rational basis, eligible common prime and native table setup", + "Catalogue/descriptor domination, logarithm absorption, exact recovery" + ], + "all_interval_argument": "For [Z,Z+k), bound RHS at Z+k and LHS at floor(Z/k). Successive intervals double LHS; the positive affine RHS grows at most linearly, so 2^j >= j+1 proves persistence.", + "common_cutoff": 14000000000000, + "cutoff_log2_input": { + "alpha": 6143424401, + "compact": 24573697601, + "geometry": 3999931956149, + "guard": 4350062, + "log_p": 25, + "normalization": 14000000000000, + "period": 49147395201, + "phase_cell": 19, + "reservoir": 14, + "stopped_leaf": 252 + }, + "power_checkpoints": [ + { + "log2_input": 14000000000000, + "powers": { + "alpha": { + "exponent": 714467976, + "rhs": 112000000156824, + "rhs_bits": 47 + }, + "compact": { + "exponent": 714467976, + "rhs": 448000000627232, + "rhs_bits": 49 + }, + "leaf": { + "exponent": 666666666666, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 714467976, + "rhs": 224000000313576, + "rhs_bits": 48 + }, + "rows": { + "exponent": 714467976, + "rhs": 112000000156824000, + "rhs_bits": 57 + } + } + }, + { + "log2_input": 28000000000000, + "powers": { + "alpha": { + "exponent": 1428935953, + "rhs": 224000000156824, + "rhs_bits": 48 + }, + "compact": { + "exponent": 1428935953, + "rhs": 896000000627232, + "rhs_bits": 50 + }, + "leaf": { + "exponent": 1333333333333, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 1428935953, + "rhs": 448000000313576, + "rhs_bits": 49 + }, + "rows": { + "exponent": 1428935953, + "rhs": 224000000156824000, + "rhs_bits": 58 + } + } + }, + { + "log2_input": 56000000000000, + "powers": { + "alpha": { + "exponent": 2857871906, + "rhs": 448000000156824, + "rhs_bits": 49 + }, + "compact": { + "exponent": 2857871906, + "rhs": 1792000000627232, + "rhs_bits": 51 + }, + "leaf": { + "exponent": 2666666666666, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 2857871906, + "rhs": 896000000313576, + "rhs_bits": 50 + }, + "rows": { + "exponent": 2857871906, + "rhs": 448000000156824000, + "rhs_bits": 59 + } + } + }, + { + "log2_input": 112000000000000, + "powers": { + "alpha": { + "exponent": 5715743812, + "rhs": 896000000156824, + "rhs_bits": 50 + }, + "compact": { + "exponent": 5715743812, + "rhs": 3584000000627232, + "rhs_bits": 52 + }, + "leaf": { + "exponent": 5333333333333, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 5715743812, + "rhs": 1792000000313576, + "rhs_bits": 51 + }, + "rows": { + "exponent": 5715743812, + "rhs": 896000000156824000, + "rhs_bits": 60 + } + } + }, + { + "log2_input": 224000000000000, + "powers": { + "alpha": { + "exponent": 11431487624, + "rhs": 1792000000156824, + "rhs_bits": 51 + }, + "compact": { + "exponent": 11431487624, + "rhs": 7168000000627232, + "rhs_bits": 53 + }, + "leaf": { + "exponent": 10666666666666, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 11431487624, + "rhs": 3584000000313576, + "rhs_bits": 52 + }, + "rows": { + "exponent": 11431487624, + "rhs": 1792000000156824000, + "rhs_bits": 61 + } + } + }, + { + "log2_input": 448000000000000, + "powers": { + "alpha": { + "exponent": 22862975248, + "rhs": 3584000000156824, + "rhs_bits": 52 + }, + "compact": { + "exponent": 22862975248, + "rhs": 14336000000627232, + "rhs_bits": 54 + }, + "leaf": { + "exponent": 21333333333333, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 22862975248, + "rhs": 7168000000313576, + "rhs_bits": 53 + }, + "rows": { + "exponent": 22862975248, + "rhs": 3584000000156824000, + "rhs_bits": 62 + } + } + } + ], + "practical_runtime_claim": false + }, + "kappa": "40827/800000000", + "next_kappa": "318961/6250000000", + "next_kappa_rejection": "{'g1_above_kappa': '-25408022593116799041/7102635201420453820506250000000', 'g3_above_kappa': '-5201705247125960457841/1136421632227272611281000000000000', 'g5_above_kappa': '-7640875416065173165777/1818274611563636178049600000000000', 'g6_above_kappa': '-33658690551416775383761/9091373057818180890248000000000000'}", + "original_enclosure_control": { + "accepted_upper": "427922022655051425592169455669348999419009338821677321501934579031509793316011927849852932699225587520480274623290826519124585131702799274967695430254567113650998884459986946222692530282749027853246814000572815342011972280832203653626757194588235745687874105909336892415629002940540277569675953192803096179140323199169875932058482212840371519373866332987776983981442275480629595879092440778438065834410270423292532877965451564571150969903518733283745770147929604915103094966966240445718551419238205360172260389165815355293860586787487668007987689744585745259297708409486845374929838902410526770296527117452860612190765279746966315757114757646249443956020657651637850471083396567352186238660458491615294604389003317389825219053116168473153626947262543915434579501546193988862612230828605213616950127673267971569642351835151332191639228898384399684069201926146521990048728093044781289653532998958679374426311189560250341590145887508815021337226982815008224357898461730107482372032845888428476273500999760300211786400006201411895378711403441679516543048925021677151249124774565210588951830515783148269750340702961227551/427922022656065148722015624802653702889498564421131911283499341667573520226931037010841800905471906532344178836996138043716400845851217866305783744362952178488692163617667760947934446961428764096857095662125776648371730944750850740376437391609342381012534311915175448066736517476339673099556706774420618964194148648273392198066357729130169733561134843302857240883248026154958104699812690626052696940220399106081385425042375485602542555097186568052507330835744941604979041042724146442866160606543845260686788873587136675704407457814823973491248098778928607362558510538701395621352496475077156310639504247824069338077266718928997258973439362819271794470658904562860362470215133491491305622841328989108583065554731667738937158958161399293136952726957825424616696098290625805073806865420810062253320746566043770582998650738545122821954094593047815197564256009823257422725379706679933315631514838786135447434356419391187561619401952168548631044553632502869921434523792993783307013326156305798890689568359302672301544894715282222433613932715358768884516049207059704442128612279932500000000000000000000000000000000000000000", + "next_bit_lower": "374050380000830479912607937870818083834173718615907103079616878943322706260497332605534066060136407627149268792108716494485294881071/374050380000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + } + }, + "comparison": { + "additional_precision_gain": "2116843/200000000000000000", + "difference": "1238116843/200000000000000000", + "difference_pr65": "59693903/12500000000000000", + "kappa": "10206752116843/200000000000000000", + "pr63_kappa": "5102757/100000000000", + "pr65_kappa": "2041159402879/40000000000000000", + "structural_gain_on_original_grid": "309/50000000000" + }, + "grid_denominator": 1000000000000000000, + "next_bit_saving": "5103636516201/100000000000000000", + "preferred": { + "assembly": { + "absorption_gap": "12957517239351787231794417587/100005103636516190692726967598200000000000000000", + "constraints": { + "K_dominates_log": "25518182705927945452132037536365162009/500025518182580953463634837991000000000000", + "K_geometry": "375025518182705953463634837991/500025518182580953463634837991000000000000", + "a_below_b": "20663634837991/1000000000000000000", + "a_positive": "51036365162009/1000000000000000000", + "alpha_below_one": "999999999999500025518182580953463634837991/1000051036365161906927269675982000000000000", + "alpha_below_one_fourth": "249961722725628595322730323966963634837991/1000051036365161906927269675982000000000000", + "alpha_positive": "51036365661881409087095028536365162009/1000051036365161906927269675982000000000000", + "artificial_boundary": "28001633163690681098227177374284390904513973/4000204145460647627709078703928000000000000", + "b_below_one_over32": "311783/10000000", + "beta_below_one": "19/20", + "beta_positive": "1/20", + "c_below_one": "499974481817294046536365162009/500000000000000000000000000000", + "c_positive": "25518182705953463634837991/500000000000000000000000000000", + "cell_above_band": "999999999998499974481817419046536365162009/2000102072730323813854539351964000000000000", + "compact_leaf": "8539317419046536365162009/500000000000000000000000000000", + "compact_reservations": "1/4000000000000", + "delta_below_one_eighth": "999999999999/8000000000000", + "delta_positive": "1/8000000000000", + "epsilon_below_one": "25518183080953463634837991/500025518182580953463634837991", + "epsilon_positive": "499999999999500000000000000000/500025518182580953463634837991", + "g1_above_kappa": "100005116594033430044514199392617587/100005103636516190692726967598200000000000000000", + "g2_above_kappa": "1302288897/500000000000000000", + "g3_above_kappa": "12957517239351787231794417587/100005103636516190692726967598200000000000000000", + "g4_above_kappa": "1302288897/500000000000000000", + "g5_above_kappa": "37501926821210810861559844643742587/100005103636516190692726967598200000000000000000", + "g6_above_kappa": "87504478639468906207923328442842587/100005103636516190692726967598200000000000000000", + "g7_above_kappa": "99994896363383814423867065831844514199392617587/100005103636516190692726967598200000000000000000", + "gamma_sublinear": "1/2000000000000", + "guard_width": "25518183080953463634837991/500025518182580953463634837991", + "lambda_above_internal": "51036365162009/1000000000000000000000000000000", + "lambda_above_sigma": "20663634838042036365162009/1000000000000000000000000000000", + "lambda_above_tau": "51036365162009/1000000000000000000000000000000", + "lambda_prime_above_lambda": "51036365162009/1000000000000000000000000000000", + "lambda_prime_below_one": "25518182580953463634837991/500000000000000000000000000000", + "literal_scalar_guard": "9693793493753822316795466474748", + "phase_boundary": "40829092429500023633159832136365162009/800040829092129525541815740785600000000000", + "phase_leaf_above_bit": "17078634837991/1000000000000000000", + "phase_local": "204145464147602190896122974536365162009/4000204145460647627709078703928000000000000", + "prime_interval_packing": "25518183080953463634837991/500025518182580953463634837991", + "q_below_internal": "51036365162009/500000000000000000000000000000", + "q_below_leaf": "8539317419046536365162009/500000000000000000000000000000", + "q_below_reservations": "1/4000000000000", + "q_positive": "25518182580953463634837991/500000000000000000000000000000", + "record_suffix": "25518183080953463634837991/500025518182580953463634837991", + "row_product_gap": "6548/25", + "short_record_fallback": "499974480514563711027641740160491885440816916081/500025518182580953463634837991000000000000000000", + "small_field_exposure": "1/1000000000000" + }, + "finite_bridge": { + "bit": { + "W": 137151806, + "halving_degree": 9, + "m": 575, + "maxchild": 529, + "wire_bits": 28 + }, + "complex": { + "W": 537696432, + "halving_degree": 20, + "m": 784, + "maxchild": 756, + "s": 421548223824, + "scalar_group_upper": 4793351472, + "wire_bits": 30 + }, + "rows": { + "coefficient": 852, + "degree": 2000, + "degree_gap": "6548/25", + "suffix_slope": 8000 + }, + "semantic": { + "B": 9696565176891520488614054257040, + "C0": 2358858462850846165593256368932965330169899180021667007021321420800, + "C1": 1, + "E": 9696565176891520488192506033216, + "induction_gap": 533311084729033626873772984137200, + "literal_charge": 2771683137698171397039558468, + "strict_literal_gap": 9693793493753822316795466474748 + } + }, + "margins": { + "g1": "25518183080953463634837991/500025518182580953463634837991", + "g2": "51036365162009/1000000000000000000", + "g3": "25518182580927945452257037536365162009/500025518182580953463634837991000000000000", + "g4": "51036365162009/1000000000000000000", + "g5": "40829092429500023633159832136365162009/800040829092129525541815740785600000000000", + "g6": "204145464147602190896122974536365162009/4000204145460647627709078703928000000000000", + "g7": "499999999999500000000000000000/500025518182580953463634837991" + }, + "minimum_margin": "25518182580927945452257037536365162009/500025518182580953463634837991000000000000", + "parameters": { + "C0": 2358858462850846165593256368932965330169899180021667007021321420800, + "C1": "1", + "a_bit": "51036365162009/1000000000000000000", + "a_complex": "717/10000000", + "alpha_squared_power": "51036365661881409087095028536365162009/1000051036365161906927269675982000000000000", + "beta": "1/20", + "c": "25518182705953463634837991/500000000000000000000000000000", + "delta": "1/8000000000000", + "epsilon": "499999999999500000000000000000/500025518182580953463634837991", + "h": "1/1000000000000", + "kappa": "10206752116843/200000000000000000", + "lambda_": "999948963634838042036365162009/1000000000000000000000000000000", + "lambda_prime": "499974481817419046536365162009/500000000000000000000000000000", + "q": "25518182580953463634837991/500000000000000000000000000000", + "sigma": "9999283/10000000", + "tau": "999948963634837991/1000000000000000000" + }, + "recurrence": { + "internal": "999948963634837991/1000000000000000000", + "leaf": "199986377/200000000", + "reservations": "499974481817294046536365162009/500000000000000000000000000000" + }, + "scoped_limit": "51036365162009/1000051036365162009" + }, + "eventual_bounds": { + "additional_eventual_conditions": [ + "BHP prime threshold and distinct-prime packing", + "Fixed rational basis, eligible common prime and native table setup", + "Catalogue/descriptor domination, logarithm absorption, exact recovery" + ], + "all_interval_argument": "For [Z,Z+k), bound RHS at Z+k and LHS at floor(Z/k). Successive intervals double LHS; the positive affine RHS grows at most linearly, so 2^j >= j+1 proves persistence.", + "common_cutoff": 14000000000000, + "cutoff_log2_input": { + "alpha": 6143424401, + "compact": 24573697601, + "geometry": 3999931956143, + "guard": 4350062, + "log_p": 25, + "normalization": 14000000000000, + "period": 49147395201, + "phase_cell": 19, + "reservoir": 14, + "stopped_leaf": 252 + }, + "power_checkpoints": [ + { + "log2_input": 14000000000000, + "powers": { + "alpha": { + "exponent": 714467976, + "rhs": 112000000156824, + "rhs_bits": 47 + }, + "compact": { + "exponent": 714467976, + "rhs": 448000000627232, + "rhs_bits": 49 + }, + "leaf": { + "exponent": 666666666666, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 714467976, + "rhs": 224000000313576, + "rhs_bits": 48 + }, + "rows": { + "exponent": 714467976, + "rhs": 112000000156824000, + "rhs_bits": 57 + } + } + }, + { + "log2_input": 28000000000000, + "powers": { + "alpha": { + "exponent": 1428935953, + "rhs": 224000000156824, + "rhs_bits": 48 + }, + "compact": { + "exponent": 1428935953, + "rhs": 896000000627232, + "rhs_bits": 50 + }, + "leaf": { + "exponent": 1333333333333, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 1428935953, + "rhs": 448000000313576, + "rhs_bits": 49 + }, + "rows": { + "exponent": 1428935953, + "rhs": 224000000156824000, + "rhs_bits": 58 + } + } + }, + { + "log2_input": 56000000000000, + "powers": { + "alpha": { + "exponent": 2857871906, + "rhs": 448000000156824, + "rhs_bits": 49 + }, + "compact": { + "exponent": 2857871906, + "rhs": 1792000000627232, + "rhs_bits": 51 + }, + "leaf": { + "exponent": 2666666666666, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 2857871906, + "rhs": 896000000313576, + "rhs_bits": 50 + }, + "rows": { + "exponent": 2857871906, + "rhs": 448000000156824000, + "rhs_bits": 59 + } + } + }, + { + "log2_input": 112000000000000, + "powers": { + "alpha": { + "exponent": 5715743812, + "rhs": 896000000156824, + "rhs_bits": 50 + }, + "compact": { + "exponent": 5715743812, + "rhs": 3584000000627232, + "rhs_bits": 52 + }, + "leaf": { + "exponent": 5333333333333, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 5715743812, + "rhs": 1792000000313576, + "rhs_bits": 51 + }, + "rows": { + "exponent": 5715743812, + "rhs": 896000000156824000, + "rhs_bits": 60 + } + } + }, + { + "log2_input": 224000000000000, + "powers": { + "alpha": { + "exponent": 11431487624, + "rhs": 1792000000156824, + "rhs_bits": 51 + }, + "compact": { + "exponent": 11431487624, + "rhs": 7168000000627232, + "rhs_bits": 53 + }, + "leaf": { + "exponent": 10666666666666, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 11431487624, + "rhs": 3584000000313576, + "rhs_bits": 52 + }, + "rows": { + "exponent": 11431487624, + "rhs": 1792000000156824000, + "rhs_bits": 61 + } + } + }, + { + "log2_input": 448000000000000, + "powers": { + "alpha": { + "exponent": 22862975248, + "rhs": 3584000000156824, + "rhs_bits": 52 + }, + "compact": { + "exponent": 22862975248, + "rhs": 14336000000627232, + "rhs_bits": 54 + }, + "leaf": { + "exponent": 21333333333333, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 22862975248, + "rhs": 7168000000313576, + "rhs_bits": 53 + }, + "rows": { + "exponent": 22862975248, + "rhs": 3584000000156824000, + "rhs_bits": 62 + } + } + } + ], + "practical_runtime_claim": false + }, + "kappa": "10206752116843/200000000000000000", + "next_kappa": "6379220073027/125000000000000000", + "next_kappa_rejection": "{'g3_above_kappa': '-54404741498227752163082843757/62503189772822619182954354748875000000000000000'}" + }, + "profile_path": "research/slot-cost-rank-pair/paired-candidate.json", + "profile_sha256": "be0322ad60f73923953f242eaffaf114ff12438e8617dae38888b77fa03184cc", + "proof_limits": [ + "The complete physical profile is supplied; independent word and CRT replay are parent-verifier responsibilities.", + "The rational logarithm and exponential enclosure derivations are documented in README.md, not formally mechanized.", + "All-size compiler, routing, recovery, prime-selection and fixed-tape transfer remain inherited.", + "Neither global optimality nor measured practical speedup is claimed." + ], + "rejected_moment": { + "degree": 8, + "lower": "2142996968750000000299438450297169612240838554633/2142996968750000000000000000000000000000000000000", + "rounding_denominator": 10000000000000000000000000000000000000000, + "saving": "5103636516201/100000000000000000", + "strict_gap": "-598876900594339443234732710509/4285993937500000000000000000000000000000000000000", + "terms": { + "1": { + "exp_lower": "5001621782709938619700922082052587636651/5000000000000000000000000000000000000000", + "exp_upper": "5001621782709938619700922082052587892463/5000000000000000000000000000000000000000", + "log_lower": "3177185020398675220004135749131/500000000000000000000000000000", + "log_upper": "6354370040797350440008271498263/1000000000000000000000000000000", + "weight": "37473373/1714397575" + }, + "10": { + "exp_lower": "10002068097583441186892788402001906405869/10000000000000000000000000000000000000000", + "exp_upper": "10002068097583441186892788402001906916359/10000000000000000000000000000000000000000", + "log_lower": "2025892473901652377995140021789/500000000000000000000000000000", + "log_upper": "4051784947803304755990280043579/1000000000000000000000000000000", + "weight": "77412/68575903" + }, + "11": { + "exp_lower": "2500504861197638491125402450459847848797/2500000000000000000000000000000000000000", + "exp_upper": "10002019444790553964501609801839391905671/10000000000000000000000000000000000000000", + "log_lower": "3956474767998979895946327920297/1000000000000000000000000000000", + "log_upper": "1978237383999489947973163960149/500000000000000000000000000000", + "weight": "376059/311708650" + }, + "12": { + "exp_lower": "250049375711931092522054883859255295653/250000000000000000000000000000000000000", + "exp_upper": "5000987514238621850441097677185106168299/5000000000000000000000000000000000000000", + "log_lower": "3869463391009350129778562018423/1000000000000000000000000000000", + "log_upper": "483682923876168766222320252303/125000000000000000000000000000", + "weight": "1634448/1714397575" + }, + "13": { + "exp_lower": "500096708480197958502100766884185152173/500000000000000000000000000000000000000", + "exp_upper": "5000967084801979585021007668841851776967/5000000000000000000000000000000000000000", + "log_lower": "3789420683335813703954784056697/1000000000000000000000000000000", + "log_upper": "1894710341667906851977392028349/500000000000000000000000000000", + "weight": "1529879/1714397575" + }, + "14": { + "exp_lower": "10001896340344796389866529516045856266039/10000000000000000000000000000000000000000", + "exp_upper": "10001896340344796389866529516045856776509/10000000000000000000000000000000000000000", + "log_lower": "3715312711182091825485686633361/1000000000000000000000000000000", + "log_upper": "1857656355591045912742843316681/500000000000000000000000000000", + "weight": "1223733/1714397575" + }, + "15": { + "exp_lower": "5000930561137841255446003888994805890563/5000000000000000000000000000000000000000", + "exp_upper": "10001861122275682510892007777989612291593/10000000000000000000000000000000000000000", + "log_lower": "3646319839695140374012266928113/1000000000000000000000000000000", + "log_upper": "1823159919847570187006133464057/500000000000000000000000000000", + "weight": "3819/5963122" + }, + "16": { + "exp_lower": "10001828178084434573642232415005231243819/10000000000000000000000000000000000000000", + "exp_upper": "10001828178084434573642232415005231754283/10000000000000000000000000000000000000000", + "log_lower": "3581781318557569202339343012429/1000000000000000000000000000000", + "log_upper": "358178131855756920233934301243/100000000000000000000000000000", + "weight": "65304/155854325" + }, + "17": { + "exp_lower": "10001797231872447698890844122750497512437/10000000000000000000000000000000000000000", + "exp_upper": "10001797231872447698890844122750498022899/10000000000000000000000000000000000000000", + "log_lower": "3521156696741134359758736880389/1000000000000000000000000000000", + "log_upper": "352115669674113435975873688039/100000000000000000000000000000", + "weight": "3553051/1714397575" + }, + "18": { + "exp_lower": "5000884027547693709638795996529085554203/5000000000000000000000000000000000000000", + "exp_upper": "2000353611019077483855518398611634323773/2000000000000000000000000000000000000000", + "log_lower": "3463998282901185747800548902959/1000000000000000000000000000000", + "log_upper": "43299978536264821847506861287/12500000000000000000000000000", + "weight": "361782/1714397575" + }, + "19": { + "exp_lower": "5000870228155111770067186341476859867097/5000000000000000000000000000000000000000", + "exp_upper": "2500435114077555885033593170738430061163/2500000000000000000000000000000000000000", + "log_lower": "1704965530815454989999622033187/500000000000000000000000000000", + "log_upper": "27279448493047279839993952531/8000000000000000000000000000", + "weight": "11837/155854325" + }, + "2": { + "exp_lower": "10002889699809419311404957888177265700451/10000000000000000000000000000000000000000", + "exp_upper": "200057793996188386228099157763545324227/200000000000000000000000000000000000000", + "log_lower": "1415305715059351282647759844201/250000000000000000000000000000", + "log_upper": "1132244572047481026118207875361/200000000000000000000000000000", + "weight": "3613701/1714397575" + }, + "20": { + "exp_lower": "10001714273555260126773419135540751814249/10000000000000000000000000000000000000000", + "exp_upper": "2000342854711052025354683827108150464941/2000000000000000000000000000000000000000", + "log_lower": "83965944181083986164326198053/25000000000000000000000000000", + "log_upper": "3358637767243359446573047922121/1000000000000000000000000000000", + "weight": "26402/342879515" + }, + "21": { + "exp_lower": "312552792768476668756477376972760704219/312500000000000000000000000000000000000", + "exp_upper": "5000844684295626700103638031564171522731/5000000000000000000000000000000000000000", + "log_lower": "413730950384240930438459189737/125000000000000000000000000000", + "log_upper": "3309847603073927443507673517897/1000000000000000000000000000000", + "weight": "12978/2981561" + }, + "22": { + "exp_lower": "10001665622483469680935380405521948856003/10000000000000000000000000000000000000000", + "exp_upper": "2000333124496693936187076081104389873291/2000000000000000000000000000000000000000", + "log_lower": "3263327587439034586529095798839/1000000000000000000000000000000", + "log_upper": "81583189685975864663227394971/25000000000000000000000000000", + "weight": "77/2833715" + }, + "23": { + "exp_lower": "2000328586433323254292063195698384854901/2000000000000000000000000000000000000000", + "exp_upper": "2500410733041654067865078994622981196239/2500000000000000000000000000000000000000", + "log_lower": "804718956217050187300379666613/250000000000000000000000000000", + "log_upper": "3218875824868200749201518666453/1000000000000000000000000000000", + "weight": "11447/542102" + }, + "25": { + "exp_lower": "1000160037032327270766029206780672264517/1000000000000000000000000000000000000000", + "exp_upper": "10001600370323272707660292067806723155619/10000000000000000000000000000000000000000", + "log_lower": "313549421592914969080675283181/100000000000000000000000000000", + "log_upper": "3135494215929149690806752831811/1000000000000000000000000000000", + "weight": "11641/566743" + }, + "3": { + "exp_lower": "10002682707500039378884137682290792778171/10000000000000000000000000000000000000000", + "exp_upper": "10002682707500039378884137682290793288871/10000000000000000000000000000000000000000", + "log_lower": "262787887606462037430651313067/50000000000000000000000000000", + "log_upper": "5255757752129240748613026261341/1000000000000000000000000000000", + "weight": "266382/155854325" + }, + "4": { + "exp_lower": "10002535846716988106024017994549387191073/10000000000000000000000000000000000000000", + "exp_upper": "5001267923358494053012008997274693850843/5000000000000000000000000000000000000000", + "log_lower": "2484037839838729910586903627673/500000000000000000000000000000", + "log_upper": "4968075679677459821173807255347/1000000000000000000000000000000", + "weight": "88926/68575903" + }, + "481": { + "exp_lower": "10000091101740848303816500641039585810393/10000000000000000000000000000000000000000", + "exp_upper": "10000091101740848303816500641039586320763/10000000000000000000000000000000000000000", + "log_lower": "35700554138317851917337677133/200000000000000000000000000000", + "log_upper": "89251385345794629793344192833/500000000000000000000000000000", + "weight": "13468/271051" + }, + "5": { + "exp_lower": "2000484386825724156576238643903443590659/2000000000000000000000000000000000000000", + "exp_upper": "5001210967064310391440596609758609231931/5000000000000000000000000000000000000000", + "log_lower": "1186233032090812516351878041259/250000000000000000000000000000", + "log_upper": "4744932128363250065407512165037/1000000000000000000000000000000", + "weight": "436112/342879515" + }, + "525": { + "exp_lower": "5000023214398350386524107026306460045369/5000000000000000000000000000000000000000", + "exp_upper": "2000009285759340154609642810522584120221/2000000000000000000000000000000000000000", + "log_lower": "22742944551431673576538712861/250000000000000000000000000000", + "log_upper": "18194355641145338861230970289/200000000000000000000000000000", + "weight": "244461/566743" + }, + "529": { + "exp_lower": "10000042555032962377911876995537722779239/10000000000000000000000000000000000000000", + "exp_upper": "5000021277516481188955938497768861644803/5000000000000000000000000000000000000000", + "log_lower": "41690804469525529197382917321/500000000000000000000000000000", + "log_upper": "83381608939051058394765834643/1000000000000000000000000000000", + "weight": "116748/271051" + }, + "6": { + "exp_lower": "625145553858123694154427541530940552571/625000000000000000000000000000000000000", + "exp_upper": "400093154469199164258833626579801974067/400000000000000000000000000000000000000", + "log_lower": "4562610571569295439195794139881/1000000000000000000000000000000", + "log_upper": "2281305285784647719597897069941/500000000000000000000000000000", + "weight": "222609/155854325" + }, + "7": { + "exp_lower": "10002250170813833798186193306781280883941/10000000000000000000000000000000000000000", + "exp_upper": "10002250170813833798186193306781281394461/10000000000000000000000000000000000000000", + "log_lower": "4408459891742037134902918754819/1000000000000000000000000000000", + "log_upper": "220422994587101856745145937741/50000000000000000000000000000", + "weight": "2615158/1714397575" + }, + "8": { + "exp_lower": "2500545501535535199243958421377203624343/2500000000000000000000000000000000000000", + "exp_upper": "5001091003071070398487916842754407503939/5000000000000000000000000000000000000000", + "log_lower": "66795757798711164246196486467/15625000000000000000000000000", + "log_upper": "4274928499117514511756575133889/1000000000000000000000000000000", + "weight": "92592/68575903" + }, + "9": { + "exp_lower": "10002121881026162439707701289430730763687/10000000000000000000000000000000000000000", + "exp_upper": "1250265235128270304963462661178841409273/1250000000000000000000000000000000000000", + "log_lower": "4157145463461131057217781024417/1000000000000000000000000000000", + "log_upper": "2078572731730565528608890512209/500000000000000000000000000000", + "weight": "4275837/3428795150" + } + }, + "upper": "4285993937500000000598876900594339443234732710509/4285993937500000000000000000000000000000000000000" + }, + "source_sha256": { + "references/frame-compiler/pr48/research/copied-fixed/balanced_assembly.py": "4d27575dcad2b45a281a34054d311409ecd954f373c0c3a62c29bcc843f06a86", + "research/reordered-rank-pair/arithmetic/certificate.json": "6474f4c638b5a16de5a7ed6054f3ad28404eac17eaa4570aab2ef378d6e7e1a3", + "research/slot-cost-rank-pair/arithmetic/audit.py": "aa297fffcdaa133f5dee17d97fac72aa5ba2cf943da5a8a5e3f4d62f6f0a7f79", + "research/slot-cost-rank-pair/arithmetic/refine.py": "8af4f9ed6cec841fe691b7f7950ca7b17483282e8869795922d29f10a4d49c16", + "scripts/experiments/binary_frame_math.py": "1f96e8aafc8ae89f8eeec5d03800131d93d58e01bf8a7fca8feb03702d1740d0" + }, + "status": "Exact finite conditional screen; physical linkage checked by parent verifier" +} diff --git a/research/slot-cost-rank-pair/arithmetic/refine.py b/research/slot-cost-rank-pair/arithmetic/refine.py new file mode 100644 index 0000000000..1fdb23ff27 --- /dev/null +++ b/research/slot-cost-rank-pair/arithmetic/refine.py @@ -0,0 +1,165 @@ +#!/usr/bin/env python3 +"""Exact arithmetic screen of the all-rank slot-cost complete physical profile. + +Uses PR63's paid profile, inherited PR48 logarithm enclosures and balanced +assembly (PR34 and successors). New directed Taylor bounds are documented in +this file. Prepared with OpenAI assistance. Inherited licenses apply. +Physical linkage is checked by the parent verifier; no full theorem or practical speedup claim is implied. +""" +import sys +sys.dont_write_bytecode = True +if sys.flags.optimize: + raise ValueError('Assertions must remain enabled') +import argparse +from fractions import Fraction as Q +from hashlib import sha256 +import importlib.util +import json +from math import factorial +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[3] +sys.path.insert(0, str(ROOT/'scripts/experiments')) +import binary_frame_math as arithmetic +spec = importlib.util.spec_from_file_location('inherited_assembly', ROOT/'references/frame-compiler/pr48/research/copied-fixed/balanced_assembly.py') +balanced = importlib.util.module_from_spec(spec) +spec.loader.exec_module(balanced) + + +def floor_scaled(x, denominator): + return (x * denominator).numerator // (x * denominator).denominator + + +def ceiling_scaled(x, denominator): + return -floor_scaled(-x, denominator) + + +def exact_moment(m, width, rows, saving, degree=8, rounding=10**40): + """Bound sum n*t/(mW)*exp(saving*log(m/t)) entirely in Q. + + At 0 <= u <= v < 1, S_d(u) is a lower bound for exp(u). + The tail at v has first term v^(d+1)/(d+1)!; successive ratios + are at most v/(d+2). Thus S_d(v)+first/(1-v/(d+2)) is upper. + Directed rounding per exp bound preserves both inequalities. + The inherited logarithm helper encloses log(m/t) rationally. + """ + assert type(saving) is Q and 0 < saving < 1 and degree >= 1 + lo, hi = Q(), Q() + terms = {} + for t, count in sorted(rows.items()): + assert type(t) is int and type(count) is int and 0 < t < m and count > 0 + loglo, loghi = arithmetic.logs(Q(m, t)) + u, v = saving*loglo, saving*loghi + assert 0 <= u <= v < 1 + lower = sum((u**j / factorial(j) for j in range(degree+1)), Q()) + upper = sum((v**j / factorial(j) for j in range(degree+1)), Q()) + upper += v**(degree+1)/factorial(degree+1)/(1-v/Q(degree+2)) + lower = Q(floor_scaled(lower, rounding), rounding) + upper = Q(ceiling_scaled(upper, rounding), rounding) + weight = Q(t*count, m*width) + lo += weight*lower + hi += weight*upper + terms[t] = dict(weight=weight, log_lower=loglo, log_upper=loghi, + exp_lower=lower, exp_upper=upper) + return dict(saving=saving, lower=lo, upper=hi, strict_gap=1-hi, + degree=degree, rounding_denominator=rounding, terms=terms) + + +def assemble(bridge, saving, h, denominator): + preliminary = balanced.assembly(bridge, saving, Q(1, denominator), h=h) + kappa = Q(ceiling_scaled(preliminary['minimum_margin'], denominator)-1, denominator) + accepted = balanced.assembly(bridge, saving, kappa, h=h) + assert len(accepted['constraints']) == 47 and len(accepted['margins']) == 7 + assert all(v > 0 for v in accepted['constraints'].values()) + assert all(v > kappa for v in accepted['margins'].values()) + try: + balanced.assembly(bridge, saving, kappa+Q(1, denominator), h=h) + except balanced.InvalidAssembly as error: + rejected = str(error) + else: + raise AssertionError('Next kappa grid unexpectedly passes') + return dict(kappa=kappa, assembly=accepted, + next_kappa=kappa+Q(1, denominator), next_kappa_rejection=rejected, + eventual_bounds=balanced.cutoffs(bridge, accepted)) + + +def build_certificate(profile_path, denominator=10**18, h=Q(1, 10**12)): + profile_path = profile_path.resolve() + source = json.loads(profile_path.read_text()) + profile = source['bit'] + bridge = source['finite_bridge'] + m, width = profile['m'], profile['W'] + rows = {int(t): n for t, n in profile['child_multiplicities'].items()} + assert sum(t*n for t, n in rows.items()) == profile['total_rank'] + assert bridge['bit']['W'] == width + low, high = 1, floor_scaled(Q(717, 10**7), denominator) + assert exact_moment(m, width, rows, Q(low, denominator))['upper'] < 1 + assert exact_moment(m, width, rows, Q(high, denominator))['lower'] > 1 + steps = 0 + while low+1 < high: + mid = (low+high)//2 + test = exact_moment(m, width, rows, Q(mid, denominator)) + if test['upper'] < 1: + low = mid + elif test['lower'] > 1: + high = mid + else: + raise ArithmeticError('Rational bounds inconclusive: increase enclosure precision') + steps += 1 + saving = Q(low, denominator) + accepted = exact_moment(m, width, rows, saving) + rejected = exact_moment(m, width, rows, Q(high, denominator)) + assert accepted['upper'] < 1 < rejected['lower'] + preferred = assemble(bridge, saving, h, denominator) + coarse_denom = 10**11 + coarse_bit = Q(floor_scaled(saving, coarse_denom), coarse_denom) + assert exact_moment(m, width, rows, coarse_bit)['upper'] < 1 + coarse = assemble(bridge, coarse_bit, h, coarse_denom) + inherited_coarse = arithmetic.moment(m, width, rows, coarse_bit) + inherited_next = arithmetic.moment(m, width, rows, coarse_bit+Q(1, coarse_denom)) + assert inherited_coarse['upper'] < 1 < inherited_next['lower'] + coarse['original_enclosure_control'] = dict(accepted_upper=inherited_coarse['upper'], + next_bit_lower=inherited_next['lower']) + # Same coarse grid/backoff as PR63 separates the structural gain from + # the additional precision refinement suggested by the PR61 precedent. + prior = Q(source['kappa']) + pr65_path = ROOT/'research/reordered-rank-pair/arithmetic/certificate.json' + pr65 = Q(json.loads(pr65_path.read_text())['preferred']['kappa']) + paths = (Path(__file__), Path(__file__).with_name('audit.py'), + ROOT/'scripts/experiments/binary_frame_math.py', Path(balanced.__file__), pr65_path) + return dict(status='Exact finite conditional screen; physical linkage checked by parent verifier', + profile_path=str(profile_path.relative_to(ROOT)), + profile_sha256=sha256(profile_path.read_bytes()).hexdigest(), + source_sha256={str(path.relative_to(ROOT)):sha256(path.read_bytes()).hexdigest() for path in paths}, + grid_denominator=denominator, binary_search_steps=steps, bit_saving=saving, + next_bit_saving=Q(high, denominator), accepted_moment=accepted, rejected_moment=rejected, + preferred=preferred, coarse_grid_control=dict(bit_saving=coarse_bit, **coarse), + comparison=dict(pr63_kappa=prior, pr65_kappa=pr65, kappa=preferred['kappa'], + difference_pr65=preferred['kappa']-pr65, + difference=preferred['kappa']-prior, + structural_gain_on_original_grid=coarse['kappa']-prior, + additional_precision_gain=preferred['kappa']-coarse['kappa']), + proof_limits=['The complete physical profile is supplied; independent word and CRT replay are parent-verifier responsibilities.', + 'The rational logarithm and exponential enclosure derivations are documented in README.md, not formally mechanized.', + 'All-size compiler, routing, recovery, prime-selection and fixed-tape transfer remain inherited.', + 'Neither global optimality nor measured practical speedup is claimed.']) + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--profile', type=Path, default=Path(__file__).resolve().parent.parent/'paired-candidate.json') + parser.add_argument('--certificate', type=Path, default=Path(__file__).with_name('certificate.json')) + parser.add_argument('--record', action='store_true', help='Regenerate certificate instead of comparing with recorded result') + args = parser.parse_args() + result = arithmetic.js(build_certificate(args.profile)) + if args.record: + args.certificate.write_text(json.dumps(result, indent=2, sort_keys=True)+'\n') + else: + assert result == json.loads(args.certificate.read_text()), 'Arithmetic certificate changed' + print(json.dumps(dict(status='PASS exact arithmetic', bit_saving=result['bit_saving'], + kappa=result['preferred']['kappa'], constraints=47, margins=7, + next_grid_controls='PASS', comparison=result['comparison']), indent=2)) + + +if __name__ == '__main__': + main() diff --git a/research/slot-cost-rank-pair/arithmetic/test_arithmetic.py b/research/slot-cost-rank-pair/arithmetic/test_arithmetic.py new file mode 100644 index 0000000000..e23cba24ec --- /dev/null +++ b/research/slot-cost-rank-pair/arithmetic/test_arithmetic.py @@ -0,0 +1,68 @@ +"""Meaningful certificate verification and deliberate-failure controls.""" +import sys +sys.dont_write_bytecode = True +from copy import deepcopy +from fractions import Fraction as Q +import json +from pathlib import Path +import subprocess +import unittest + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) +import refine +import audit + + +class ExactArithmeticTests(unittest.TestCase): + @classmethod + def setUpClass(cls): + cls.certificate = json.loads((HERE/'certificate.json').read_text()) + cls.profile = json.loads((refine.ROOT/cls.certificate['profile_path']).read_text())['bit'] + + def test_complete_reproduction(self): + actual = refine.arithmetic.js(refine.build_certificate(refine.ROOT/self.certificate['profile_path'])) + self.assertEqual(actual, self.certificate) + + def test_independent_enclosures_and_controls(self): + actual = refine.arithmetic.js(audit.audit(self.certificate)) + self.assertEqual(actual, json.loads((HERE/'audit-receipt.json').read_text())) + self.assertEqual(len(actual['controls']), 10) + + def test_next_bit_grid_is_rejected(self): + p = self.profile + result = refine.exact_moment(p['m'], p['W'], {int(t):n for t,n in p['child_multiplicities'].items()}, Q(self.certificate['next_bit_saving'])) + self.assertGreater(result['lower'], 1) + + def test_forged_accepted_bit_is_rejected(self): + forged = deepcopy(self.certificate) + forged['bit_saving'] = forged['next_bit_saving'] + with self.assertRaises(AssertionError): + audit.audit(forged) + + def test_forged_source_digest_is_rejected(self): + forged = deepcopy(self.certificate) + forged['profile_sha256'] = '0'*64 + with self.assertRaises(AssertionError): + audit.audit(forged) + + def test_omitted_constraint_is_rejected(self): + forged = deepcopy(self.certificate) + del forged['preferred']['assembly']['constraints']['K_geometry'] + with self.assertRaises(AssertionError): + audit.audit(forged) + + def test_float_saving_refused(self): + with self.assertRaises(AssertionError): + refine.exact_moment(2, 1, {1:1}, 0.01) + + def test_python_optimization_is_rejected(self): + for script in ('refine.py', 'audit.py'): + result = subprocess.run([sys.executable, '-B', '-O', str(HERE/script)], + cwd=refine.ROOT, capture_output=True, text=True) + self.assertNotEqual(result.returncode, 0) + self.assertIn('Assertions must remain enabled', result.stderr) + + +if __name__ == '__main__': + unittest.main() diff --git a/research/slot-cost-rank-pair/compiler.py b/research/slot-cost-rank-pair/compiler.py new file mode 100644 index 0000000000..fe70b5cf01 --- /dev/null +++ b/research/slot-cost-rank-pair/compiler.py @@ -0,0 +1,266 @@ +# All-rank profile-cost selection: Rohan Arun, with OpenAI Codex assistance. +# Derived from Dominik Scholz PR63, Chafik Boukhalfa PR60, Avi Eisenberg PR62 +# and eumemic PR57. Apache-2.0; all inherited notices remain applicable. +"""Exact-envelope block synthesis on the pinned PR48 scalar graph. +Experimental finite compiler; no fixed-I+J profile or multiplication claim. +""" +# Derived from eumemic's PR57 compiler; original notices remain applicable. +# Descending-rank reclamation priority: Chafik Boukhalfa, with OpenAI Codex assistance. +import sys +if sys.flags.optimize: + raise ValueError('Assertions must remain enabled') +sys.dont_write_bytecode=True +from pathlib import Path +ROOT=Path(__file__).resolve().parents[2]/'references/frame-compiler/pr48' +from hashlib import sha256 +import json +manifest=json.loads((ROOT/'SOURCE.json').read_text()) +for name,digest in manifest['files'].items(): + assert sha256((ROOT/name).read_bytes()).hexdigest()==digest, 'Changed producer source: '+name +sys.path[:0]=[str(ROOT/'scripts'),str(ROOT/'research/copied-fixed')] +from changed_graph import graph +from collections import defaultdict,Counter,deque +import argparse,json,time,struct + +def independent(rows,vec): + for row in rows: + vec=min(vec,vec^row) + return bool(vec) +def basis(rows): + out=[] + for vec in rows: + for row in out:vec=min(vec,vec^row) + if vec:out.append(vec) + return out + +def build(h): + c=graph(h);groups={};owner={};signal={};blocks=[] + for x in sorted(c.active): + key=(c.core[x],c.union[x]) + if key not in groups: + groups[key]=len(blocks);blocks.append(dict(nodes=[],frame=key,inputs=set(),uses=[])) + g=groups[key];owner[x]=g;blocks[g]['nodes'].append(x) + signal[x]=(signal[c.args[x][0]]^signal[c.args[x][1]])if c.args[x]else 1<<(x-1) + for x in sorted(c.active): + for y in c.args[x]or(): + if owner[y]!=owner[x]:blocks[owner[x]]['inputs'].add(y) + uses=[];value_uses=defaultdict(list) + for g,b in enumerate(blocks): + b['inputs']=sorted(b['inputs']);b['source']=not c.args[b['nodes'][0]] + for y in b['inputs']: + k=len(uses);uses.append((y,g,None));value_uses[y].append(k);blocks[owner[y]]['uses'].append(k) + for target,x in c.outputs.items(): + k=len(uses);uses.append((x,owner[x],target));value_uses[x].append(k);blocks[owner[x]]['uses'].append(k) + for g,b in enumerate(blocks): + b['rank']=1 if b['source']else b['frame'][1].bit_count()-b['frame'][0].bit_count() + order=sorted(range(len(blocks)),key=lambda g:(blocks[g]['rank'],min(blocks[g]['nodes']))) + place={g:i for i,g in enumerate(order)} + def contained(a,b):return not(b[0]&~a[0])and not(a[1]&~b[1]) + for g,b in enumerate(blocks): + coeff={y:1<1 for b in blocks) + def new(g): + s=len(slots);slots.append(0);frames.append(g);hist[blocks[g]['rank']]+=1;events.append((s,-1,g));return s + def raise_(s,g): + old=frames[s];assert contains(blocks[old]['frame'],blocks[g]['frame']);hist[blocks[g]['rank']-blocks[old]['rank']]+=1;frames[s]=g;events.append((s,old,g)) + def xor(a,b,g): + assert a!=b;raise_(a,g);raise_(b,g);slots[a]^=slots[b];ops.append((a,b,g)) + import subprocess,struct + from binary_frame_math import logs + # Integer midpoint enclosures give a reproducible discovery score. + # Every candidate is independently checked by the complete exact screen. + weights=[0]+[int(t*sum(logs(t))*10**30//2) for t in range(1,h+1)] + oracle_input=Path(ORACLE_INPUT) + with oracle_input.open('wb') as stream: + stream.write(struct.pack('<6I2Q',h,v,0,len(blocks)+2,0,0,h*(h-1),h*(h-1))) + stream.write(struct.pack('<2QI',0,0,0));stream.write(struct.pack('<2QI',0,0,h)) + for b in blocks:stream.write(struct.pack('<2QI',*b['frame'],b['rank'])) + oracle=subprocess.Popen([ORACLE_EXE,str(oracle_input)],stdin=subprocess.PIPE,stdout=subprocess.PIPE,text=True,bufsize=1) + oracles.append(oracle) + cache={} + def profile_entropy(a,b): + if (a,b) not in cache: + oracle.stdin.write(f'{a} {b}\n');oracle.stdin.flush() + answer=oracle.stdout.readline() + assert answer, 'profile oracle failed' + parts=list(map(int,answer.split()));assert len(parts)==h+1 + cache[a,b]=sum(n*w for n,w in zip(parts,weights)) + return cache[a,b] + def profile_cost(a,g): + old=frames[a]+2;target=g+2 + return profile_entropy(old,1)-profile_entropy(old,target)-profile_entropy(target,1) + def acquire(g,anchors): + if reclaim: + bb={} + def ins(s): + row=slots[s];expr=1<>s&1;e^=1<>i&1) + if j!=i: + # Synthesize swap as three XORs at the single common frame. + for a,z in ((i,j),(j,i),(i,j)):rr[a]^=rr[z];elim.append((a,z)) + for j in range(len(ins)): + if j!=i and rr[j]>>i&1:rr[j]^=rr[i];elim.append((j,i)) + assert rr==[1<>i&1:xor(s,value_slots[y],g) + assert slots[s]==signal[x];value_slots[x]=s + used=set() + for u in outuses: + x=uses[u][0];s=value_slots[x] + if x in used: + ss=acquire(g,list(value_slots.values()));xor(ss,s,g);s=ss + used.add(x);assert u not in assign;assign[u]=s + if step%5000==0:print('compile',h,step,len(slots),'reclaimed',stats['reclaimed'],'seconds',time.time()-t0,flush=True,file=sys.stderr) + output_slots=[];output_records=[];scatter=[0]*v;J=[] + for u,(x,g,target)in enumerate(uses): + if target is None:continue + s=assign[u];assert slots[s]==signal[x];raise_(s,g);output_slots.append(s) + common,triple=target;output_records.append((s,g,common,triple)) + targets=[i for i,t in enumerate(c.inputs)if common in t]if len(triple)==1 else[c.inputs.index(triple)] + for i in targets:scatter[i]^=slots[s];J.append((v+i,2*v+s)) + rank=blocks[g]['rank'] + if len(triple)==1:hist[rank]+=1;hist[h-rank]+=1 + else:hist[h-1-rank]+=1;hist[1]+=1 + assert len(set(output_slots))==len(output_slots) + for s in retired:hist[h-blocks[frames[s]]['rank']]+=1 + assert len(retired)+len(output_slots)==len(slots) + assert scatter==[1<, the carrier matching is read from a pinned file +// instead of Hopcroft-Karp. Every pinned edge must lie in the same admissible +// adjacency (causal order and frame inclusion); donors and uses are distinct. +// This replay-only adaptation omits the discovery edge dumper. The original +// optimizer and profiler are preserved in references/copied-fixed/pr44. +// Replay-only adaptation prepared with OpenAI Codex assistance. +// Prepared by Rohan Arun with Anthropic Claude assistance. Apache-2.0. +// Adapted at h=23,25; original PR35 by Dominik Scholz, PR32 by icekylinx. +// Dimension adaptation at 45/47; extra primes for all source-growth cases. +// Exact bounded-minor inequalities are checked by verify.py. Original credit below. +// Copyright 2026 icekylinx. Apache-2.0; AI-assisted handoff integration. +// Original round3_rankone_profiles.cpp. Requires GCC/Clang unsigned __int128. + +// Adapted input reader for complete serialized frame-compiler transitions. +// Actual-word fixed-I+J profiling, adapted from PR48 profiles.cpp. +// All projector, pivot and CRT formulas below are unchanged. +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +using U=uint32_t;using V=uint64_t; +#include "binary_io.hpp" +int main(int argc,char**argv){ +assert(argc==2);std::ifstream f(argv[1],std::ios::binary);U hdr[6];read_array(f,hdr); +U h=hdr[0],v=hdr[1],R=hdr[2],nf=hdr[3],nt=hdr[4];int64_t singles=hdr[5];assert(h==23||h==25); +V sum,loss;f.read(reinterpret_cast(&sum),8);f.read(reinterpret_cast(&loss),8); +struct Frame{V core,cover;U rank;};std::vectorframes; +for(U i=0;i(&a.core),8);f.read(reinterpret_cast(&a.cover),8);f.read(reinterpret_cast(&a.rank),4);frames.push_back(a);} +std::map,int64_t>transitions; +for(U i=0;i(&a),4);f.read(reinterpret_cast(&b),4);f.read(reinterpret_cast(&count),8);transitions[{a,b}]=count;} +assert(f);assert(sum==h*V(R)+loss); +V p=2305843009213693951ULL; +auto mul=[&](V a,V b)->V{return (__uint128_t)a*b%p;}; +auto power=[&](V a,V b)->V{V r=1;for(;b;b>>=1,a=mul(a,a))if(b&1)r=mul(r,a);return r;}; +auto sub=[&](V a,V b)->V{return (a+p-b)%p;}; +std::vector>matrix_cache(frames.size()); +auto matrix=[&](U id)->const std::vector&{auto&A=matrix_cache[id];if(!A.empty())return A;A.assign(h*h,0);if(id==0)return A;if(id==1){for(U i=0;i>i)&1);V zj=((f.core>>j)&1)?3*(h+1)-10:p-10;A[i*h+j]=mul(mul(wi,zj),factor);}return A;} + assert(c==1||c==2);V s=3-c,d=s*s+(c-1)*nn,den=3*(h+1)*d,inv=power(den,p-2); + for(U i=0;i>i)&1,oj=(out>>j)&1,wi=3+((f.core>>i)&1),zj=((f.core>>j)&1)?3*(h+1)-10:p-10; + V num=(mul(s*oi,zj)+3*(h+1)*s*wi*oj+mul(nn*wi,zj))%p;num=sub(num,3*(h+1)*(c-1)*oi*oj);A[i*h+j]=(V(i==j&&oi)+mul(num,inv))%p; + }return A;}; + +std::vectorblocks(h+1);blocks[1]=singles;V done=0,matrices=0,crt_matrices=0,crt_disagreements=0;U longest=0;std::mapcorrection_hist; +U aa,bb; +while(std::cin>>aa>>bb){ + assert(aa=frames[aa].rank); + if(rr<=2){blocks[1]=rr; for(U t=0;t<=h;t++)std::cout<1&&bb>1){ + assert(!(frames[bb].core&~frames[aa].core)); + assert(!(frames[aa].cover&~frames[bb].cover)); + U ca=popcount64(frames[aa].core),cb=popcount64(frames[bb].core); + assert(ca==3||frames[aa].core==frames[bb].core||(ca==2&&cb==1)); + } + const auto&A=matrix(aa);const auto&B=matrix(bb);std::vectorM(h*h);for(U x=0;x>pivots; + for(U i=0;i=0&&!M[i*h+j])j--;if(j<0)continue;pivots.push_back({i,U(j)});V inv=power(M[i*h+j],p-2);for(U k=i+1;k core-one use all three primes at these dimensions. +if(aa>1&&bb>1&&(popcount64(frames[aa].core)==3||(popcount64(frames[aa].core)==2&&popcount64(frames[bb].core)==1))){ + assert(h==23||h==25);crt_matrices++;matrix_cache[aa].clear();matrix_cache[bb].clear();std::vector>> all{pivots}; + for(V extra:{2147483647ULL,524287ULL}){p=extra;matrix_cache[aa].clear();matrix_cache[bb].clear();const auto&C=matrix(aa);const auto&D=matrix(bb);std::vectorY(h*h);for(U z=0;z> pp; + for(U i=0;i=0&&!Y[i*h+j])j--;if(j<0)continue;pp.push_back({i,U(j)});V inv=power(Y[i*h+j],p-2);for(U k=i+1;k corner((h+1)*(h+1));for(U i=0;i=j;best=std::max(best,rank);}corner[(i+1)*(h+1)+j]=best;} + pivots.clear();for(U i=0;i1 for b in blocks) + def new(g): + s=len(slots);slots.append(0);frames.append(g);hist[blocks[g]['rank']]+=1;events.append((s,-1,g));return s + def raise_(s,g): + old=frames[s];assert contains(blocks[old]['frame'],blocks[g]['frame']);hist[blocks[g]['rank']-blocks[old]['rank']]+=1;frames[s]=g;events.append((s,old,g)) + def xor(a,b,g): + assert a!=b;raise_(a,g);raise_(b,g);slots[a]^=slots[b];ops.append((a,b,g)) + def acquire(g,anchors): + if reclaim: + bb={} + def ins(s): + row=slots[s];expr=1<>s&1;e^=1<>i&1) + if j!=i: + # Synthesize swap as three XORs at the single common frame. + for a,z in ((i,j),(j,i),(i,j)):rr[a]^=rr[z];elim.append((a,z)) + for j in range(len(ins)): + if j!=i and rr[j]>>i&1:rr[j]^=rr[i];elim.append((j,i)) + assert rr==[1<>i&1:xor(s,value_slots[y],g) + assert slots[s]==signal[x];value_slots[x]=s + used=set() + for u in outuses: + x=uses[u][0];s=value_slots[x] + if x in used: + ss=acquire(g,list(value_slots.values()));xor(ss,s,g);s=ss + used.add(x);assert u not in assign;assign[u]=s + if step%5000==0:print('compile',h,step,len(slots),'reclaimed',stats['reclaimed'],'seconds',time.time()-t0,flush=True,file=sys.stderr) + output_slots=[];output_records=[];scatter=[0]*v;J=[] + for u,(x,g,target)in enumerate(uses): + if target is None:continue + s=assign[u];assert slots[s]==signal[x];raise_(s,g);output_slots.append(s) + common,triple=target;output_records.append((s,g,common,triple)) + targets=[i for i,t in enumerate(c.inputs)if common in t]if len(triple)==1 else[c.inputs.index(triple)] + for i in targets:scatter[i]^=slots[s];J.append((v+i,2*v+s)) + rank=blocks[g]['rank'] + if len(triple)==1:hist[rank]+=1;hist[h-rank]+=1 + else:hist[h-1-rank]+=1;hist[1]+=1 + assert len(set(output_slots))==len(output_slots) + for s in retired:hist[h-blocks[frames[s]]['rank']]+=1 + assert len(retired)+len(output_slots)==len(slots) + assert scatter==[1<