diff --git a/README.md b/README.md index fd784cf3ee..ccda6c1b8d 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +## New profile-aware compiler: conditional kappa = 5.10403292611078e-5 + +[Structural compiler search and53 Lean certificates](research/profile-aware-frame-search/README.md) improve the frozen PR62 stacked witness by0.0459048992%, with unchanged wire count and4,670,081 fewer recursive child calls. Complete changed-word/profile checks and exact regeneration pass. The [paper source](research/profile-aware-frame-search/matrix-exponent-synthesis.tex) combines this result with the earlier matrix/parity and matching tools. Sources were frozen through PR62 for this one-hour run; all-size framework contracts remain conditional. + ## PR #62 stacked-witness refinement: conditional κ = 5.1016920170078e-5 The [exact certificate and concrete Lean proofs](research/matrix-exponent-synthesis/README.md) diff --git a/research/current-record-circuits/.gitattributes b/research/current-record-circuits/.gitattributes new file mode 100644 index 0000000000..2a8b0d921c --- /dev/null +++ b/research/current-record-circuits/.gitattributes @@ -0,0 +1,2 @@ +* -text +*.gz binary diff --git a/research/current-record-circuits/.gitignore b/research/current-record-circuits/.gitignore new file mode 100644 index 0000000000..0606aa495a --- /dev/null +++ b/research/current-record-circuits/.gitignore @@ -0,0 +1,5 @@ +.lake/ +*.olean +*.ilean +__pycache__/ +work/ diff --git a/research/current-record-circuits/README.md b/research/current-record-circuits/README.md new file mode 100644 index 0000000000..af10e4182d --- /dev/null +++ b/research/current-record-circuits/README.md @@ -0,0 +1,52 @@ +# Zero-circuit clearing relations above the PR71/73 frontier + +New conditional `kappa=257077122735047/5000000000000000000=5.14154245470094e-5`, above PR71's `5.1414646104039e-5` +by `0.0015140490%`. Pinned construction: PR71 at +`1bef94fd40a746452548c84a4a8f8834670a3113`. + +We extend our profile-aware clearing method to pending live controls. A zero +fresh-signal provider circuit can be toggled into a clearing expression for +the same retired target, excluding the target itself. The alternative relation +preserves fresh clearing and is synthesized through charged literal XORs; +pending providers retain current-frame <= clearing-frame <= next-use-frame. +Bounded search prices alternatives by complete nonlinear transition-profile +cost, rather than first-order entropy alone. This changes actual words/profiles. + +Fresh complete input/target/dirty bases in both orientations, independent frame +reconstruction, exact fixed-I+J profiles/CRT, the Taylor8 characteristic enclosure, +all47 strict assembly inequalities and seven margins pass. The complete old71 +profile is rejected at the new bit saving. The37-theorem standalone Lean packet +includes4 new circuit-toggle proofs and11 concrete arithmetic endpoints, plus22 +reused dirty-word/rational helpers. Standard axioms only; no omitted proofs. + +## Reproduce + +Use an external checkout of the exact upstream71 commit above. Compile its +`scripts/experiments/binary_frame_profiles.cpp` with C++17 and include directory +`references/frame-compiler/pr48/scripts/partial_swap`, then run: + +``` +python verification/verify_words.py --upstream UPSTREAM --profiler PROFILER --word23 words/word-23.json.gz --word25 words/word-25.json.gz --output work/recheck +cd math +lake build CurrentRecordMath +``` + +Source/adapter byte hashes are checked before import; assertion-disabled Python +is rejected. The supplied words are authoritative replay inputs. Discovery source +snapshots show the new heuristic and contain original workspace paths; those +paths are not needed for the accepted-word replay with explicit UPSTREAM. + +The PR71 scalar graph and data geometry/recovery are unchanged and inherited. +All-size analytic enclosures, frame/compiler transfer, routing, prime selection, +finite-alphabet tape layout and eventual setup remain conditional. Full upstream +repository verification was pending at PR71's draft announcement; no fresh whole +repository run or practical speedup is asserted here. This is a new finite +word/profile certificate, not a full formalization of multiplication or an optimum. + +Alejandro Zarzuelo Urdiales is the human author/developer; earlier Archivara and +personal matrix/parity work and substantial OpenAI Codex assistance retain their +provenance. This extends our PR70 profile-aware tools. Credit Chafik Boukhalfa's +PR71 anchored split/next-use composition, Dominik Scholz's live controls, Rohan +Arun's profile-cost work, Rohan Garg's split operation, eumemic's compiler and +Avi Eisenberg's interval/core-aware graph; all inherited notices remain. +The paper is provided as LaTeX source; no new compiled PDF is claimed. diff --git a/research/current-record-circuits/candidate-certificate.json b/research/current-record-circuits/candidate-certificate.json new file mode 100644 index 0000000000..4220d8058b --- /dev/null +++ b/research/current-record-circuits/candidate-certificate.json @@ -0,0 +1,1007 @@ +{ + "assembly": { + "absorption_gap": "21979929496356786268379467805577023/781290170365803763124919659268392473750000000000000000", + "constraints": { + "K_dominates_log": "32136292643010656153591122070968343814272585286021/625032136292643010499935727414713979000000000000000000", + "K_geometry": "468782136292643010656185727414713979/625032136292643010499935727414713979000000000000000000", + "a_below_b": "25352414713979/1250000000000000000", + "a_positive": "64272585286021/1250000000000000000", + "alpha_below_one": "1249999999999999999375032136292643010499935727414713979/1250064272585286020999871454829427958000000000000000000", + "alpha_below_one_fourth": "312451795561035483625128545170572041999935727414713979/1250064272585286020999871454829427958000000000000000000", + "alpha_positive": "64272585286021624839318536784947500064272585286021/1250064272585286020999871454829427958000000000000000000", + "artificial_boundary": "35002056722729152678870982963419623687499807182244141937/5000257090341144083999485819317711832000000000000000000", + "b_below_one_over32": "311783/10000000", + "beta_below_one": "19/20", + "beta_positive": "1/20", + "c_below_one": "624967863707356989343814272585286021/625000000000000000000000000000000000", + "c_positive": "32136292643010656185727414713979/625000000000000000000000000000000000", + "cell_above_band": "1249999999999999998124967863707356989500064272585286021/2500128545170572041999742909658855916000000000000000000", + "compact_leaf": "10435582356989500064272585286021/625000000000000000000000000000000000", + "compact_reservations": "1/4000000000000000000", + "delta_below_one_eighth": "999999999999999999/8000000000000000000", + "delta_positive": "1/8000000000000000000", + "epsilon_below_one": "32136292643011124935727414713979/625032136292643010499935727414713979", + "epsilon_positive": "624999999999999999375000000000000000/625032136292643010499935727414713979", + "g1_above_kappa": "3213080399448642197573196508295877987/3125160681463215052499678637073569895000000000000000000", + "g2_above_kappa": "13218409037/5000000000000000000", + "g3_above_kappa": "21979929496356786268379467805577023/781290170365803763124919659268392473750000000000000000", + "g4_above_kappa": "13218409037/5000000000000000000", + "g5_above_kappa": "10078839788273062318087178880999174421/25001285451705720419997429096588559160000000000000000000", + "g6_above_kappa": "22579482514125922528085893429293454001/25001285451705720419997429096588559160000000000000000000", + "g7_above_kappa": "3124839318536784944463401762375072302573196508295877987/3125160681463215052499678637073569895000000000000000000", + "gamma_sublinear": "1/2000000000000000000", + "guard_width": "32136292643011124935727414713979/625032136292643010499935727414713979", + "lambda_above_internal": "64272585286021/1250000000000000000000000000000000000", + "lambda_above_sigma": "25352414713979000064272585286021/1250000000000000000000000000000000000", + "lambda_above_tau": "64272585286021/1250000000000000000000000000000000000", + "lambda_prime_above_lambda": "64272585286021/1250000000000000000000000000000000000", + "lambda_prime_below_one": "32136292643010499935727414713979/625000000000000000000000000000000000", + "literal_scalar_guard": "9693793493753822316795466474748", + "phase_boundary": "51418068228817174865027570899355900064272585286021/1000051418068228816799897163863542366400000000000000000", + "phase_leaf_above_bit": "20871164713979/1250000000000000000", + "phase_local": "257090341144088374453683025068821500064272585286021/5000257090341144083999485819317711832000000000000000000", + "prime_interval_packing": "32136292643011124935727414713979/625032136292643010499935727414713979", + "q_below_internal": "64272585286021/625000000000000000000000000000000000", + "q_below_leaf": "10435582356989500064272585286021/625000000000000000000000000000000000", + "q_below_reservations": "1/4000000000000000000", + "q_positive": "32136292643010499935727414713979/625000000000000000000000000000000000", + "record_suffix": "32136292643011124935727414713979/625032136292643010499935727414713979", + "row_product_gap": "6548/25", + "short_record_fallback": "781209827568713626419328428941958998848843150378012441/781290170365803763124919659268392473750000000000000000", + "small_field_exposure": "1/1000000000000000000" + }, + "finite_bridge": { + "bit": { + "W": 135075665, + "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": "32136292643011124935727414713979/625032136292643010499935727414713979", + "g2": "64272585286021/1250000000000000000", + "g3": "32136292643010499903591122070968500064272585286021/625032136292643010499935727414713979000000000000000000", + "g4": "64272585286021/1250000000000000000", + "g5": "51418068228817174865027570899355900064272585286021/1000051418068228816799897163863542366400000000000000000", + "g6": "257090341144088374453683025068821500064272585286021/5000257090341144083999485819317711832000000000000000000", + "g7": "624999999999999999375000000000000000/625032136292643010499935727414713979" + }, + "minimum_margin": "32136292643010499903591122070968500064272585286021/625032136292643010499935727414713979000000000000000000", + "parameters": { + "C0": 2358858462850846165593256368932965330169899180021667007021321420800, + "C1": "1", + "a_bit": "64272585286021/1250000000000000000", + "a_complex": "717/10000000", + "alpha_squared_power": "64272585286021624839318536784947500064272585286021/1250064272585286020999871454829427958000000000000000000", + "beta": "1/20", + "c": "32136292643010656185727414713979/625000000000000000000000000000000000", + "delta": "1/8000000000000000000", + "epsilon": "624999999999999999375000000000000000/625032136292643010499935727414713979", + "h": "1/1000000000000000000", + "kappa": "257077122735047/5000000000000000000", + "lambda_": "1249935727414713979000064272585286021/1250000000000000000000000000000000000", + "lambda_prime": "624967863707356989500064272585286021/625000000000000000000000000000000000", + "q": "32136292643010499935727414713979/625000000000000000000000000000000000", + "sigma": "9999283/10000000", + "tau": "1249935727414713979/1250000000000000000" + }, + "recurrence": { + "internal": "1249935727414713979/1250000000000000000", + "leaf": "199986377/200000000", + "reservations": "624967863707356989343814272585286021/625000000000000000000000000000000000" + }, + "scoped_limit": "64272585286021/1250064272585286021" + }, + "bit": { + "L": 2226400, + "N": 4073300, + "W": 135075665, + "axes": [ + { + "R": 27455, + "blocks": [ + 0, + 357135, + 21255, + 8005, + 5460, + 4174, + 3835, + 3248, + 2613, + 2109, + 1750, + 1529, + 1008, + 863, + 555, + 461, + 234, + 149, + 40, + 9, + 0, + 23, + 0, + 0 + ], + "crt_disagreements": 0, + "crt_matrices": 5750, + "distinct_matrices": 38780, + "field_prime": 2305843009213693951, + "frames": 59803, + "h": 23, + "loss": 506, + "rank_sum": 631971, + "v": 1771 + }, + { + "R": 36015, + "blocks": [ + 0, + 492613, + 27862, + 10468, + 7884, + 5690, + 5028, + 4101, + 3812, + 3047, + 2491, + 2047, + 1818, + 1443, + 1153, + 898, + 569, + 469, + 271, + 163, + 47, + 13, + 0, + 25, + 0, + 0 + ], + "crt_disagreements": 0, + "crt_matrices": 7445, + "distinct_matrices": 52071, + "field_prime": 2305843009213693951, + "frames": 84845, + "h": 25, + "loss": 600, + "rank_sum": 900975, + "v": 2300 + } + ], + "child_multiplicities": { + "1": 1787514023, + "10": 8436561, + "11": 7141937, + "12": 5538078, + "13": 4540453, + "14": 3318463, + "15": 2650658, + "16": 1545899, + "17": 9319899, + "18": 571941, + "19": 309373, + "2": 98230102, + "20": 83237, + "21": 16369123, + "23": 71337375, + "25": 63782565, + "3": 36950328, + "4": 26520564, + "481": 8146600, + "5": 19677190, + "525": 63782565, + "529": 63146500, + "6": 17725088, + "7": 14733271, + "8": 12760952, + "9": 10246937 + }, + "deficit": 1846900, + "m": 575, + "maxchild": 529, + "moment": { + "exponent": "1249935727414713979/1250000000000000000", + "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" + }, + "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": "38645457744598388670395104920105842531364731282269556144193821883123706761042896176959455403376143933643269983875847195287605829900223152584777101982916689477053243537552461336236471743141538735147141909973127264412197048252436863653332794182949021224140889490161378244321263153981935466370330296593686952192698827779610396092250894849758400060704600151913226560199427587487430613458805775460908657/38645457744598388671875000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "saving": "64272585286021/1250000000000000000", + "strict_gap": "973485215771833838249579366526073679789480725355485173391543482056553182906728589888426980386663731999812002910193409780125821841616669982227883438919439975072188734469984784399028150262108041008619499728557008149200295868079073264653914178266966821051670137771943941716410163125385236424485737002343873273583645980138651049052721565801899822262877556576271475133048474024556447121948022787420842094783053634722581422271313002211108836495471206352444822156402629908981080187234432574515032901036175121655651488818699390213886300925968613885173328198428739233472050963329844321712195734926077845397339091083191100029007133915152691927567853280025871402202925178380028943214945361884488677305502349235281163716130072139717082928531219256524934682270048225302122145669448075333714234470792571747961894889629964926240806240538367226946413896305703564024252413809933678626701670599367189928889491042086730899631989256759431074603486540697153256329492036612465661010910945732694209769338838995449686872216393527677670693995994097576436979723665803313291853096972820928997166791388323788592614341300693970164983325514408771570522576114911804116200406934748274725899813367729330838960141825794645784943531869250774536553553579087291133660561888050689053929336529481986886453164427466600109749877754706954093597975089662476504095780761139570629536482956002823080973057367439597024493585713848904118567783203328020457176646659952669325228557193635026046461911232375038600115812397584078134928855425117995718137277888157482030052463385004217591774618101247316256260022122247825607767865117597024196286011783493839255250447703137009714894789446881/25421249304911770745580343157897125205603065926527175230410826597901841686609910357009920046942767015513958491866116776922380386407799751827643211109535100393083230559812796560291432839856597725201417364308138017944758751652355166725683039601006242797446040521416068373566163001809710140465617156205740419931410375231250858379570533494493082270004421769568360732489736032080271889789744072135518619859703842514131171896423616234461671987203942060689343033159928285273438297872073605481477955609982725303595769152485999045552628005950061820411195574275363714272631671649559727528784144731336681922789527475669821253348565858944653957525031210785211264655050359014088354335805516784160549882657826415579982783374351644632816660739556669139568308099624503223456816375185228860995360439706155316729237845417538014901578367828056768351619763311470099167011927300849977626360674309181844232657000628092135565824857513673605167933884293830819292156069458016346677280913678644508223504722807827103378959915426579937816973250166029688542261869749963860996561637544510425740917097786379745651218208889290629649974777418779969087226541741075719615444797654858182374673692606184086765064875712619221203954499666809991243565780188097000266263777689872884568051723465729654986913025379180908203125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "upper": "25421249304911770744606857942125291367353486560001101550621345872546356513218366874953366864036038425625531511479453044922568383497606342047517389267918430410855347120893356585219244105386612940802389214046029976936139251923798158576482743732927169532792126343149101552514492864037766198749206993080355183506924638228906985105986887514354431220951700203766460910226858475504000414656695598110962172737755819726710329801640562599739090564932629058478234196664457078920993475715670975572496875422748292729080736251449823923896976517131362430197309273349395100387458343451130988295312093768006837601077331740743743407951226767861462857496024076870058572727482505734062482933602591605780520939442881053695494106068849295397535497023426596999851225171093283966931881692915180635693238294036707241395523610946745443153616472938426803425378957070931731940065513404544274062336421895371910554030298957492768375895968022631518437034252304574059861081465971475649524024584186607895757843711896881370684750146087740942367286377949636160864591175753969763420124657820844622427625244689406924722221042097902305861382163077479275117061558415561310843874275078743270570557492199249338490338975899251491873115539524984196597780836656227749491727224136293797276918062903841604297859096042651426216238546835572533399890250122245293045906402024910337523495904219238860429370463517043997176919026942632560402975506414286151095881432216796671979542823353340047330674771442806364973953538088767624961399884187602415921865071144574882004281862722111842517969947536614995782408225381898752683743739977877752174392232134882402975803713988216506160744749552296862990285105210553119/25421249304911770745580343157897125205603065926527175230410826597901841686609910357009920046942767015513958491866116776922380386407799751827643211109535100393083230559812796560291432839856597725201417364308138017944758751652355166725683039601006242797446040521416068373566163001809710140465617156205740419931410375231250858379570533494493082270004421769568360732489736032080271889789744072135518619859703842514131171896423616234461671987203942060689343033159928285273438297872073605481477955609982725303595769152485999045552628005950061820411195574275363714272631671649559727528784144731336681922789527475669821253348565858944653957525031210785211264655050359014088354335805516784160549882657826415579982783374351644632816660739556669139568308099624503223456816375185228860995360439706155316729237845417538014901578367828056768351619763311470099167011927300849977626360674309181844232657000628092135565824857513673605167933884293830819292156069458016346677280913678644508223504722807827103378959915426579937816973250166029688542261869749963860996561637544510425740917097786379745651218208889290629649974777418779969087226541741075719615444797654858182374673692606184086765064875712619221203954499666809991243565780188097000266263777689872884568051723465729654986913025379180908203125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "upper_enclosure_kind": "taylor8_tail" + }, + "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": 63146500, + "529": 63146500 + }, + "exterior_25": { + "25": 63782565, + "525": 63782565 + }, + "internal_23": { + "1": 821410500, + "10": 4025000, + "11": 3516700, + "12": 2318400, + "13": 1984900, + "14": 1276500, + "15": 1060300, + "16": 538200, + "17": 342700, + "18": 92000, + "19": 20700, + "2": 48886500, + "21": 52900, + "3": 18411500, + "4": 12558000, + "5": 9600200, + "6": 8820500, + "7": 7470400, + "8": 6009900, + "9": 4850700 + }, + "internal_25": { + "1": 872417623, + "10": 4411561, + "11": 3625237, + "12": 3219678, + "13": 2555553, + "14": 2041963, + "15": 1590358, + "16": 1007699, + "17": 830599, + "18": 479941, + "19": 288673, + "2": 49343602, + "20": 83237, + "21": 23023, + "23": 44275, + "3": 18538828, + "4": 13962564, + "5": 10076990, + "6": 8904588, + "7": 7262871, + "8": 6751052, + "9": 5396237 + }, + "paid_endpoint_copy": { + "1": 4073300 + } + }, + "total_rank": 77666660475 + }, + "bit_saving": "64272585286021/1250000000000000000", + "comparison": { + "baseline71_bit_saving": "12854322426487/250000000000000000", + "baseline71_kappa": "51414646104039/1000000000000000000", + "baseline71_network_at_new_saving_lower": "12881819252838000755724283333079322196672056464649150123922429300728516595185789176537520562565708007612712804051328056687899065879513872313903125462695889540501640659265793224767755916433152185652277734418522531205587840275843776246726337914879731243025548309881664945604867154122208884777430593354842193147480532780268334431546633335457037853357257015094011346426321003092990192173563836332078781/12881819248199462890625000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "baseline71_network_rejected_at_new_saving": true, + "baseline71_refined_kappa": "51414646104039/1000000000000000000", + "baseline71_scoped_limit": "12854322426487/250012854322426487", + "kappa_gain": "973053713/1250000000000000000", + "kappa_gain_above_refined": "973053713/1250000000000000000", + "roles_baseline71": [ + 27455, + 36015 + ] + }, + "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": 14000000000000000000, + "cutoff_log2_input": { + "alpha": 6052840001, + "compact": 24211360001, + "geometry": 3999931447275493131, + "guard": 4317771, + "log_p": 25, + "normalization": 14000000000000000000, + "period": 48422720001, + "phase_cell": 19, + "reservoir": 14, + "stopped_leaf": 252 + }, + "power_checkpoints": [ + { + "log2_input": 14000000000000000000, + "powers": { + "alpha": { + "exponent": 719794344473007, + "rhs": 112000000000000155664, + "rhs_bits": 67 + }, + "compact": { + "exponent": 719794344473007, + "rhs": 448000000000000622592, + "rhs_bits": 69 + }, + "leaf": { + "exponent": 666666666666666666, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 719794344473007, + "rhs": 224000000000000311256, + "rhs_bits": 68 + }, + "rows": { + "exponent": 719794344473007, + "rhs": 112000000000000155664000, + "rhs_bits": 77 + } + } + }, + { + "log2_input": 28000000000000000000, + "powers": { + "alpha": { + "exponent": 1439588688946015, + "rhs": 224000000000000155664, + "rhs_bits": 68 + }, + "compact": { + "exponent": 1439588688946015, + "rhs": 896000000000000622592, + "rhs_bits": 70 + }, + "leaf": { + "exponent": 1333333333333333333, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 1439588688946015, + "rhs": 448000000000000311256, + "rhs_bits": 69 + }, + "rows": { + "exponent": 1439588688946015, + "rhs": 224000000000000155664000, + "rhs_bits": 78 + } + } + }, + { + "log2_input": 56000000000000000000, + "powers": { + "alpha": { + "exponent": 2879177377892030, + "rhs": 448000000000000155664, + "rhs_bits": 69 + }, + "compact": { + "exponent": 2879177377892030, + "rhs": 1792000000000000622592, + "rhs_bits": 71 + }, + "leaf": { + "exponent": 2666666666666666666, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 2879177377892030, + "rhs": 896000000000000311256, + "rhs_bits": 70 + }, + "rows": { + "exponent": 2879177377892030, + "rhs": 448000000000000155664000, + "rhs_bits": 79 + } + } + }, + { + "log2_input": 112000000000000000000, + "powers": { + "alpha": { + "exponent": 5758354755784061, + "rhs": 896000000000000155664, + "rhs_bits": 70 + }, + "compact": { + "exponent": 5758354755784061, + "rhs": 3584000000000000622592, + "rhs_bits": 72 + }, + "leaf": { + "exponent": 5333333333333333333, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 5758354755784061, + "rhs": 1792000000000000311256, + "rhs_bits": 71 + }, + "rows": { + "exponent": 5758354755784061, + "rhs": 896000000000000155664000, + "rhs_bits": 80 + } + } + }, + { + "log2_input": 224000000000000000000, + "powers": { + "alpha": { + "exponent": 11516709511568123, + "rhs": 1792000000000000155664, + "rhs_bits": 71 + }, + "compact": { + "exponent": 11516709511568123, + "rhs": 7168000000000000622592, + "rhs_bits": 73 + }, + "leaf": { + "exponent": 10666666666666666666, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 11516709511568123, + "rhs": 3584000000000000311256, + "rhs_bits": 72 + }, + "rows": { + "exponent": 11516709511568123, + "rhs": 1792000000000000155664000, + "rhs_bits": 81 + } + } + }, + { + "log2_input": 448000000000000000000, + "powers": { + "alpha": { + "exponent": 23033419023136246, + "rhs": 3584000000000000155664, + "rhs_bits": 72 + }, + "compact": { + "exponent": 23033419023136246, + "rhs": 14336000000000000622592, + "rhs_bits": 74 + }, + "leaf": { + "exponent": 21333333333333333333, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 23033419023136246, + "rhs": 7168000000000000311256, + "rhs_bits": 73 + }, + "rows": { + "exponent": 23033419023136246, + "rhs": 3584000000000000155664000, + "rhs_bits": 82 + } + } + } + ], + "practical_runtime_claim": false + }, + "exactness": [ + { + "common_denominator_bound": 34848, + "correction_numerator_bound": 274032, + "h": 23, + "minor_bounds": { + "2": 38218181861376, + "3": 219993996697351151616, + "4": 1206074983422622280129445888 + }, + "modulus_gaps": { + "2": 2305804791031832575, + "3": 2596143476298113163849933497114623, + "4": 2596142270223349735224350718820351 + }, + "prime_product": 2596143476298333157846630848266239, + "primes": [ + 2305843009213693951, + 2147483647, + 524287 + ], + "single_numerator_bound": 6228 + }, + { + "common_denominator_bound": 44928, + "correction_numerator_bound": 353568, + "h": 25, + "minor_bounds": { + "2": 75405344477184, + "3": 613343016893987684352, + "4": 4772090401825349199521120256 + }, + "modulus_gaps": { + "2": 2305767603869216767, + "3": 2596143476297719814829736860581887, + "4": 2596138704207931332497431327145983 + }, + "prime_product": 2596143476298333157846630848266239, + "primes": [ + 2305843009213693951, + 2147483647, + 524287 + ], + "single_numerator_bound": 7366 + } + ], + "explicit_h": "1/1000000000000000000", + "finite_bridge": { + "bit": { + "W": 135075665, + "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 + } + }, + "fresh_word_receipts": [ + { + "elapsed_seconds": 20.70299999997951, + "gzip_sha256": "5a504019c1521b1f6202a687792327446aa8c696354a270b1d44b64e64d6e70d", + "prepared": { + "R": 27455, + "copied_centers": 23, + "distinct_transitions": 152270, + "frames": 59803, + "h": 23, + "rank_histogram_with_side_growth_split_into_singletons": { + "1": 69189, + "10": 542, + "11": 88, + "12": 674, + "13": 253, + "14": 1927, + "15": 436, + "16": 440, + "17": 484, + "18": 3417, + "19": 6882, + "2": 73597, + "21": 171, + "22": 23, + "3": 10224, + "4": 15387, + "5": 6447, + "6": 1604, + "7": 729, + "8": 1230, + "9": 406 + }, + "rank_mass": 631971, + "singles": 15939, + "transition_events_equal_independent_xor_word_reconstruction": true, + "v": 1771, + "word_sha256": "624dfd880b174dae9a6e87ced46ac8550dc36b4441754cf7b884b12b6782e6fe" + }, + "profile": { + "R": 27455, + "blocks": [ + 0, + 357135, + 21255, + 8005, + 5460, + 4174, + 3835, + 3248, + 2613, + 2109, + 1750, + 1529, + 1008, + 863, + 555, + 461, + 234, + 149, + 40, + 9, + 0, + 23, + 0, + 0 + ], + "crt_disagreements": 0, + "crt_matrices": 5750, + "distinct_matrices": 38780, + "field_prime": 2305843009213693951, + "frames": 59803, + "h": 23, + "loss": 506, + "rank_sum": 631971, + "v": 1771 + }, + "replay": { + "elementary_xors": 162131, + "full_basis_vectors": 30997, + "h": 23, + "histogram": { + "0": 175323, + "1": 58563, + "10": 542, + "11": 88, + "12": 674, + "13": 253, + "14": 1927, + "15": 436, + "16": 440, + "17": 484, + "18": 3417, + "19": 6882, + "2": 78910, + "21": 171, + "22": 23, + "3": 10224, + "4": 15387, + "5": 6447, + "6": 1604, + "7": 729, + "8": 1230, + "9": 406 + }, + "output_roles": 5336, + "rank_mass": 631971, + "roles": 27455, + "status": "independent serialized word, exact frames, full input and dirty basis both orientations PASS", + "word_length": 673318 + }, + "reused_verified_receipt_sha256": "e74332c962139aff37d68032b1d79c25285b9b6ee8ba112baeb5978fd81e947f", + "status": "PASS fresh full input/dirty basis both orientations, independent literal frame path, exact fixed profiles", + "word_sha256": "624dfd880b174dae9a6e87ced46ac8550dc36b4441754cf7b884b12b6782e6fe" + }, + { + "elapsed_seconds": 22.671999999991385, + "gzip_sha256": "aa67a24ccd38597fece6f267ad48b98676fef0f2755ea917481fc7d355d35097", + "prepared": { + "R": 36015, + "copied_centers": 25, + "distinct_transitions": 212580, + "frames": 84845, + "h": 25, + "rank_histogram_with_side_growth_split_into_singletons": { + "1": 91025, + "10": 790, + "11": 42, + "12": 750, + "13": 148, + "14": 681, + "15": 168, + "16": 2266, + "17": 684, + "18": 566, + "19": 828, + "2": 108045, + "20": 4480, + "21": 8901, + "23": 280, + "24": 25, + "3": 13560, + "4": 19874, + "5": 8381, + "6": 2965, + "7": 1128, + "8": 1440, + "9": 652 + }, + "rank_mass": 900975, + "singles": 20700, + "transition_events_equal_independent_xor_word_reconstruction": true, + "v": 2300, + "word_sha256": "0920e11cb3a52ed892a834f97fcb6af96d34e44190e6d67e11b94f6b7be2ffde" + }, + "profile": { + "R": 36015, + "blocks": [ + 0, + 492613, + 27862, + 10468, + 7884, + 5690, + 5028, + 4101, + 3812, + 3047, + 2491, + 2047, + 1818, + 1443, + 1153, + 898, + 569, + 469, + 271, + 163, + 47, + 13, + 0, + 25, + 0, + 0 + ], + "crt_disagreements": 0, + "crt_matrices": 7445, + "distinct_matrices": 52071, + "field_prime": 2305843009213693951, + "frames": 84845, + "h": 25, + "loss": 600, + "rank_sum": 900975, + "v": 2300 + }, + "replay": { + "elementary_xors": 225726, + "full_basis_vectors": 40615, + "h": 25, + "histogram": { + "0": 242838, + "1": 77225, + "10": 790, + "11": 42, + "12": 750, + "13": 148, + "14": 681, + "15": 168, + "16": 2266, + "17": 684, + "18": 566, + "19": 828, + "2": 114945, + "20": 4480, + "21": 8901, + "23": 280, + "24": 25, + "3": 13560, + "4": 19874, + "5": 8381, + "6": 2965, + "7": 1128, + "8": 1440, + "9": 652 + }, + "output_roles": 6925, + "rank_mass": 900975, + "roles": 36015, + "status": "independent serialized word, exact frames, full input and dirty basis both orientations PASS", + "word_length": 935104 + }, + "status": "PASS fresh full input/dirty basis both orientations, independent literal frame path, exact fixed profiles", + "word_sha256": "0920e11cb3a52ed892a834f97fcb6af96d34e44190e6d67e11b94f6b7be2ffde" + } + ], + "kappa": "257077122735047/5000000000000000000", + "scope": "Fresh changed-word/full-basis/frame/profile/CRT and rational arithmetic validation. Unchanged 4,073,300-pair data geometry and its recovered rational cases inherited from PR71; all-size analytic log/exp enclosure, compiler/frame transfer, finite-alphabet tape, routing, prime-selection/recovery and eventual setup arguments remain conditional.", + "source": { + "attribution": "PR71 Chafik Boukhalfa; PR68 live anchors Dominik Scholz; PR67 profile cost Rohan Arun; PR62 graph Avi Eisenberg; PR57 compiler eumemic; inherited source notices remain.", + "commit": "1bef94fd40a746452548c84a4a8f8834670a3113", + "files": { + "certificates/split-pair-compiler.json": "6561fab8609e8aa3a291a8197cd8b834b0881ee0b9a5b991926c2c93c4d5f884", + "certificates/split-pair-kappa.json": "0fcb53fa374273efab6370953c966e8fa065dbfdba43691843a4788cb2cda42e", + "references/frame-compiler/pr48/research/copied-fixed/balanced_assembly.py": "4d27575dcad2b45a281a34054d311409ecd954f373c0c3a62c29bcc843f06a86", + "references/frame-compiler/pr48/research/copied-fixed/certificate.json": "33b3373c04e18a7f4cee33ba68da6ed71934acc3e0179cca6197696be4befa22", + "references/frame-compiler/pr48/scripts/partial_swap/binary_io.hpp": "7e143eb75bb342ac8f0c82a60005e7c35c9ec827de479bf6fb773151f3af5fa1", + "scripts/experiments/binary_frame_math.py": "1f96e8aafc8ae89f8eeec5d03800131d93d58e01bf8a7fca8feb03702d1740d0", + "scripts/experiments/binary_frame_profile_prepare.py": "8a50381cab00b33e62b3a057d199ba5e19647929135c95b0fd63fc8a8ef7c9b3", + "scripts/experiments/binary_frame_profiles.cpp": "8e2e391d3ee57cbb1372c68e4aa031e1b861321536eabd642ada54e12e678669", + "scripts/experiments/binary_frame_replay.py": "392e78e62d7685c99a5888a7da743ea6c3dcad631af4a743c91e0c09348442bc", + "scripts/experiments/split_pair_engine.py": "58f13f82ce1bb7f2b5549e17628bc6034e5e05cb24db2acb9a91c24820872f70", + "scripts/experiments/split_pair_graph.py": "9d4ee7179f880f9576e81c7ad3a5290fe61380a7531d559ef3cf0939bb30089c" + }, + "native_certificate": "certificates/split-pair-kappa.json", + "verification_adapter_files": { + "batch_axes.py": "cba8d8d2ce2babf4e9ff512af4e07df9a2574a15c4b1748e437a83977aa3359e", + "check_guards.py": "e3fc1be56f80de10c6c5e6dea2713ec42e95cae4f2d5e0fe57846672dd58e44e", + "export_weighted_case.py": "51357229ef731f15b0cb8f5d96dc1a82668fdbeca31e3ad0f491430584193586", + "screen_axes.py": "bf06809c44e26883fcc93aa2dbf98fdf1951742b83ded161e725a84b3d616f98", + "verify_words.py": "1f5b87f98a7b59c35b71f9453deab7861cf805070198ede310cebda535d88f9b" + } + }, + "status": "PASS exact characteristic upper enclosure, all 47 strict constraints and seven margins", + "verifier_sha256": "1f5b87f98a7b59c35b71f9453deab7861cf805070198ede310cebda535d88f9b" +} diff --git a/research/current-record-circuits/manifest.json b/research/current-record-circuits/manifest.json new file mode 100644 index 0000000000..1a6f3a7769 --- /dev/null +++ b/research/current-record-circuits/manifest.json @@ -0,0 +1,40 @@ +{ + "kappa": "257077122735047/5000000000000000000", + "prior_published_kappa": "51414646104039/1000000000000000000", + "source_pin": "1bef94fd40a746452548c84a4a8f8834670a3113", + "files": { + ".gitattributes": "7a6bf46c0496c6f5e4858ba7adbe3abf1af5bc51e23473a6e4136f6c3126aa9b", + ".gitignore": "88eab2f8ffe348bf79a6428ec7fbbd4a9577bb1062e4c56bff0dbb1e32a9fcb1", + "candidate-certificate.json": "d178bcc1174b27d6fb8d4ed73d959e50dcc0b9c01c930cec9fd2193e53de2364", + "matrix-exponent-synthesis.tex": "a33f49985964a25ed10fa15bf03eb4ab704f509255e5c6971df585bfe1a0fe6b", + "README.md": "083ce1ea3c22ce78b5a7bb4a4bb0dbbc8a6ce9034c42f456b9760ebb8c680148", + "math/Audit.lean": "db6bf4e68960953eb496cb447069131446102f57ad7c49392b4fea099c6ad2ac", + "math/CircuitToggleSafety.lean": "b57b92d1d6670dfe245d25fc6619a1dde915e642807007ebcee11c8d8dfb35bc", + "math/CurrentRecordCertificate.lean": "35b966b4e952b9528fc432a6f88b265ec42b89c172b6949f69a5b41c60beff5b", + "math/DirtyComplementSafety.lean": "4cb4c80de52568b1d0a7ea4483984526c9f6f710dd870e47ba2d00ac7cf6936d", + "math/FiniteRationalChecks.lean": "463bd0bbb0e8982bd2d0477d0d42f86c2b25854dac211ef47d3ab877209530d4", + "math/FreshKernelReclaim.lean": "571061c21bb683a6b3b142f189398c8106f57863125d25b3717f97bec0a011a2", + "math/generate_taylor_case.py": "91964eadc49d55fc6b606c359c3d8e312ffc26852071acfc8bafd6c69b170d40", + "math/lakefile.lean": "687bc5397c1286c261e9a64fabc22f9f59d4486980a129307b19e4ae870d5713", + "math/lean-toolchain": "465c68148dd061230368e3cbe5d1d2973069172b48b684c928ef1a665b627832", + "math/record-lean-receipt.json": "911fe0e0bc4fa87deda34efaee5fdfbeb5564ae570d44eede2cebf806968735f", + "math/verify.ps1": "12d011668e6afecfdf2983eee1ee7a2bf1707f4590f5e84de394d16dcdd3dc31", + "math/verify_record_math.py": "82c750cb9d68aff5683c0f6241c218bb458eaee332ad3526b5f2cea642ac351b", + "math/weighted-input.json": "3373c971eefc17d6d6907b307941763d7a2e03ea08c4d2629486e5d814bc773b", + "receipts/axis-23.json": "e74332c962139aff37d68032b1d79c25285b9b6ee8ba112baeb5978fd81e947f", + "receipts/axis-25.json": "68b019f54eac41a3557c3e0187c895a8d99bb88b4cd08db2ab9980bd8b05bda3", + "receipts/compiled-23.json": "982a86e7c22f33eb69b249151417cf6d5c7b4b2af068c4dcb136f20028a3653d", + "receipts/compiled-25.json": "19ddb98cb954cd0eb9d2f4a3cc21e9f5a856dbfa2774beb56d908a4c12c63f28", + "source/engine-circuits-5c0f31cf1182.py": "4c9e87d1eb173e053a1a4d8f0895d7d3f1a2a30b28441533df656672d9ddf3b8", + "source/run71.py": "0e92f46939c0a92fd92047dceab2115d65e2bc2324a93c5d17ee97d4aac5de85", + "source/runner-ac40f56ca3ad426197770877e366256bd1a7676920368b00c1d4f09386a7ce11.py": "ac40f56ca3ad426197770877e366256bd1a7676920368b00c1d4f09386a7ce11", + "verification/batch_axes.py": "cba8d8d2ce2babf4e9ff512af4e07df9a2574a15c4b1748e437a83977aa3359e", + "verification/check_guards.py": "e3fc1be56f80de10c6c5e6dea2713ec42e95cae4f2d5e0fe57846672dd58e44e", + "verification/export_weighted_case.py": "51357229ef731f15b0cb8f5d96dc1a82668fdbeca31e3ad0f491430584193586", + "verification/frozen-sources.json": "2498881897457f0a6ed5f0a9ecba14a68085cbf4782fc4dca7889b2088e2592c", + "verification/screen_axes.py": "bf06809c44e26883fcc93aa2dbf98fdf1951742b83ded161e725a84b3d616f98", + "verification/verify_words.py": "1f5b87f98a7b59c35b71f9453deab7861cf805070198ede310cebda535d88f9b", + "words/word-23.json.gz": "5a504019c1521b1f6202a687792327446aa8c696354a270b1d44b64e64d6e70d", + "words/word-25.json.gz": "aa67a24ccd38597fece6f267ad48b98676fef0f2755ea917481fc7d355d35097" + } +} diff --git a/research/current-record-circuits/math/Audit.lean b/research/current-record-circuits/math/Audit.lean new file mode 100644 index 0000000000..686f0766b7 --- /dev/null +++ b/research/current-record-circuits/math/Audit.lean @@ -0,0 +1,43 @@ +import DirtyComplementSafety +import FreshKernelReclaim +import FiniteRationalChecks +import CircuitToggleSafety +import CurrentRecordCertificate + +#print axioms DirtyComplementSafety.vxor_cancel_right +#print axioms DirtyComplementSafety.vxor_cancel_middle +#print axioms DirtyComplementSafety.xorUpdate_involution +#print axioms DirtyComplementSafety.xorUpdate_linear +#print axioms DirtyComplementSafety.runWord_append +#print axioms DirtyComplementSafety.runWord_inverse +#print axioms DirtyComplementSafety.runWord_linear +#print axioms DirtyComplementSafety.dirtyWord_transfer +#print axioms DirtyComplementSafety.complement_independent_transfer +#print axioms DirtyComplementSafety.legal_word_dirty_transfer +#print axioms DirtyComplementSafety.legal_word_shear +#print axioms FreshKernelReclaim.providerXor_congr +#print axioms FreshKernelReclaim.clear_other_coordinate +#print axioms FreshKernelReclaim.providers_unchanged +#print axioms FreshKernelReclaim.clearing_involution +#print axioms FreshKernelReclaim.fresh_kernel_coordinate +#print axioms FreshKernelReclaim.fresh_mandatory_coordinate_preserved +#print axioms FreshKernelReclaim.dirty_zero_counterexample +#print axioms FrontierRationalCertificate.check_sound +#print axioms FrontierRationalCertificate.rational_enclosed_moment +#print axioms FrontierRationalCertificate.analytic_enclosure_contract +#print axioms FrontierRationalCertificate.checked_frontier_strict +#print axioms CircuitToggleSafety.providerXor_append +#print axioms CircuitToggleSafety.zero_circuit_preserves_fresh_clear +#print axioms CircuitToggleSafety.zero_circuit_preserves_dependency +#print axioms CircuitToggleSafety.toggled_clearing_is_involution +#print axioms CurrentRecordCertificate.weighted_numerator_exact +#print axioms CurrentRecordCertificate.profile_rank_mass +#print axioms CurrentRecordCertificate.profile_row_count +#print axioms CurrentRecordCertificate.assembly_row_count +#print axioms CurrentRecordCertificate.taylor_rounding_checked +#print axioms CurrentRecordCertificate.finite_checks_pass +#print axioms CurrentRecordCertificate.rational_moment_upper_below_one +#print axioms CurrentRecordCertificate.every_assembly_slack_positive +#print axioms CurrentRecordCertificate.exceeds_old_scoped_limit +#print axioms CurrentRecordCertificate.published_below_old_scope +#print axioms CurrentRecordCertificate.exceeds_old_published diff --git a/research/current-record-circuits/math/CircuitToggleSafety.lean b/research/current-record-circuits/math/CircuitToggleSafety.lean new file mode 100644 index 0000000000..83e3bae677 --- /dev/null +++ b/research/current-record-circuits/math/CircuitToggleSafety.lean @@ -0,0 +1,59 @@ +import FreshKernelReclaim + +/-! +Alternative clearing relations from zero-signal circuits. A provider circuit +that vanishes on the fresh source image may be toggled into a clearing relation +without changing its fresh result. Both provider lists must exclude the target +for reversible dirty arithmetic. Eligibility, pending next-use containment and +all literal XOR/frame costs must be checked separately. No zero dirty carrier, +global optimizer, or physical compilation theorem is inferred here. +-/ +namespace CircuitToggleSafety +open DirtyComplementSafety FreshKernelReclaim + +variable {I X : Type} [DecidableEq I] + +omit [DecidableEq I] in +theorem providerXor_append (xs ys : List I) (s : Vec I) : + providerXor (xs++ys) s = (providerXor xs s ^^ providerXor ys s) := by + induction xs with + | nil => simp only [List.nil_append,providerXor,Bool.false_xor] + | cons i is ih => + simp only [List.cons_append,providerXor,ih] + exact (Bool.xor_assoc _ _ _).symm + +theorem zero_circuit_preserves_fresh_clear + (target : I) (providers circuit : List I) (fresh : Vec X → Vec I) + (hzero : ∀ x, providerXor circuit (fresh x)=false) (x : Vec X) : + clearCarrier target (providers++circuit) (fresh x) = + clearCarrier target providers (fresh x) := by + funext i + simp only [clearCarrier,providerXor_append,hzero,Bool.xor_false] + +omit [DecidableEq I] in +theorem zero_circuit_preserves_dependency + (target : I) (providers circuit : List I) (fresh : Vec X → Vec I) + (hdep : ∀ x, fresh x target=providerXor providers (fresh x)) + (hzero : ∀ x, providerXor circuit (fresh x)=false) (x : Vec X) : + fresh x target = providerXor (providers++circuit) (fresh x) := by + simp only [providerXor_append,hzero,Bool.xor_false] + exact hdep x + +theorem toggled_clearing_is_involution + (target : I) (providers circuit : List I) + (hp : ∀ i ∈ providers, i ≠ target) + (hc : ∀ i ∈ circuit, i ≠ target) (dirty : Vec I) : + clearCarrier target (providers++circuit) + (clearCarrier target (providers++circuit) dirty) = dirty := by + apply clearing_involution + intro i hi + rcases List.mem_append.mp hi with hi | hi + · exact hp i hi + · exact hc i hi + +end CircuitToggleSafety + +#print axioms CircuitToggleSafety.providerXor_append +#print axioms CircuitToggleSafety.zero_circuit_preserves_fresh_clear +#print axioms CircuitToggleSafety.zero_circuit_preserves_dependency +#print axioms CircuitToggleSafety.toggled_clearing_is_involution diff --git a/research/current-record-circuits/math/CurrentRecordCertificate.lean b/research/current-record-circuits/math/CurrentRecordCertificate.lean new file mode 100644 index 0000000000..995f99d4be --- /dev/null +++ b/research/current-record-circuits/math/CurrentRecordCertificate.lean @@ -0,0 +1,154 @@ +import FiniteRationalChecks + +/-! +Concrete finite arithmetic for both-axis zero-circuit live-clearing words above PR71 scoped limit and PR73 headline, source 1bef94fd40a746452548c84a4a8f8834670a3113. +Weighted input SHA256 3373c971eefc17d6d6907b307941763d7a2e03ea08c4d2629486e5d814bc773b. +Source certificate SHA256 0fcb53fa374273efab6370953c966e8fa065dbfdba43691843a4788cb2cda42e. +Candidate certificate SHA256 d178bcc1174b27d6fb8d4ed73d959e50dcc0b9c01c930cec9fd2193e53de2364. +The kernel computes the degree-eight Taylor polynomial, ninth-term rational +tail, directed upper rounding, weighted moment and all 47 positive slacks. +The logarithm enclosure and analytic exponential tail bound are inherited +explicit contracts. Source/profile binding, completeness of assembly formulas, +physical compiler/tape transfer and the global multiplication theorem remain +external contracts. This file proves no optimization or practical speedup. +-/ +namespace CurrentRecordCertificate +open FrontierRationalCertificate +set_option maxRecDepth 100000 +set_option maxHeartbeats 0 + +def saving : Rat := Rat.divInt (64272585286021) (1250000000000000000) +def newKappa : Rat := Rat.divInt (257077122735047) (5000000000000000000) +def oldScoped : Rat := Rat.divInt (12854322426487) (250012854322426487) +def oldPublished : Rat := Rat.divInt (25707323052097) (500000000000000000) + +structure Row where + width : Nat + multiplicity : Nat + logUpper : Rat + roundedNumerator : Nat + +def rows : List Row := [ + ⟨1,1787514023,Rat.divInt (6354370040797350440008271498263) (1000000000000000000000000000000),10003267828141834875600403400646193281554⟩, + ⟨2,98230102,Rat.divInt (1132244572047481026118207875361) (200000000000000000000000000000),20005822630276839940875870083520687835971⟩, + ⟨3,36950328,Rat.divInt (5255757752129240748613026261341) (1000000000000000000000000000000),30008108322871725945216125026957982398079⟩, + ⟨4,26520564,Rat.divInt (4968075679677459821173807255347) (1000000000000000000000000000000),40010219259364020492844547648606501888904⟩, + ⟨5,19677190,Rat.divInt (4744932128363250065407512165037) (1000000000000000000000000000000),50012200250414882509736291825605681404709⟩, + ⟨6,17725088,Rat.divInt (2281305285784647719597897069941) (500000000000000000000000000000),60014077688552904673126238861970730429324⟩, + ⟨7,14733271,Rat.divInt (220422994587101856745145937741) (50000000000000000000000000000),70015869012887097407250302209498837424117⟩, + ⟨8,12760952,Rat.divInt (4274928499117514511756575133889) (1000000000000000000000000000000),80017586617993099971802392810438286598117⟩, + ⟨9,10246937,Rat.divInt (2078572731730565528608890512209) (500000000000000000000000000000),90019239771217238390675733275633429174733⟩, + ⟨10,8436561,Rat.divInt (4051784947803304755990280043579) (1000000000000000000000000000000),100020835665812851330002555639407024706403⟩, + ⟨11,7141937,Rat.divInt (1978237383999489947973163960149) (500000000000000000000000000000),110022380048209741867929685217081594762567⟩, + ⟨12,5538078,Rat.divInt (483682923876168766222320252303) (125000000000000000000000000000),120023877615188102932222347707577845296952⟩, + ⟨13,4540453,Rat.divInt (1894710341667906851977392028349) (500000000000000000000000000000),130025332277711419305661501100223587677424⟩, + ⟨14,3318463,Rat.divInt (1857656355591045912742843316681) (500000000000000000000000000000),140026747343093828007495584155550578931767⟩, + ⟨15,2650658,Rat.divInt (1823159919847570187006133464057) (500000000000000000000000000000),150028125644855325550251892811795794963026⟩, + ⟨16,1545899,Rat.divInt (358178131855756920233934301243) (100000000000000000000000000000),160029469637797828302794904127334520838469⟩, + ⟨17,9319899,Rat.divInt (352115669674113435975873688039) (100000000000000000000000000000),170030781469222123673299759217179159105574⟩, + ⟨18,571941,Rat.divInt (43299978536264821847506861287) (12500000000000000000000000000),180032063033332185834365252240208246948842⟩, + ⟨19,309373,Rat.divInt (27279448493047279839993952531) (8000000000000000000000000000),190033316013514099923438122031649605379413⟩, + ⟨20,83237,Rat.divInt (3358637767243359446573047922121) (1000000000000000000000000000000),200034541915690847815443873559665598195683⟩, + ⟨21,16369123,Rat.divInt (3309847603073927443507673517897) (1000000000000000000000000000000),210035742094990470067881744948723541784418⟩, + ⟨23,71337375,Rat.divInt (3218875824868200749201518666453) (1000000000000000000000000000000),230038070077031549493949509589432986560289⟩, + ⟨25,63782565,Rat.divInt (3135494215929149690806752831811) (1000000000000000000000000000000),250040308513084630443970582499215558344427⟩, + ⟨481,8146600,Rat.divInt (89251385345794629793344192833) (500000000000000000000000000000),4810044147669959454236720240247689861099640⟩, + ⟨525,63782565,Rat.divInt (18194355641145338861230970289) (200000000000000000000000000000),5250024557421202831126509966196538036848623⟩, + ⟨529,63146500,Rat.divInt (83381608939051058394765834643) (1000000000000000000000000000000),5290022679978070086977491368249316882679562⟩ +] + +def slacks : List Rat := [ + Rat.divInt (32136292643010656153591122070968343814272585286021) (625032136292643010499935727414713979000000000000000000), -- K_dominates_log + Rat.divInt (468782136292643010656185727414713979) (625032136292643010499935727414713979000000000000000000), -- K_geometry + Rat.divInt (25352414713979) (1250000000000000000), -- a_below_b + Rat.divInt (64272585286021) (1250000000000000000), -- a_positive + Rat.divInt (1249999999999999999375032136292643010499935727414713979) (1250064272585286020999871454829427958000000000000000000), -- alpha_below_one + Rat.divInt (312451795561035483625128545170572041999935727414713979) (1250064272585286020999871454829427958000000000000000000), -- alpha_below_one_fourth + Rat.divInt (64272585286021624839318536784947500064272585286021) (1250064272585286020999871454829427958000000000000000000), -- alpha_positive + Rat.divInt (35002056722729152678870982963419623687499807182244141937) (5000257090341144083999485819317711832000000000000000000), -- artificial_boundary + Rat.divInt (311783) (10000000), -- b_below_one_over32 + Rat.divInt (19) (20), -- beta_below_one + Rat.divInt (1) (20), -- beta_positive + Rat.divInt (624967863707356989343814272585286021) (625000000000000000000000000000000000), -- c_below_one + Rat.divInt (32136292643010656185727414713979) (625000000000000000000000000000000000), -- c_positive + Rat.divInt (1249999999999999998124967863707356989500064272585286021) (2500128545170572041999742909658855916000000000000000000), -- cell_above_band + Rat.divInt (10435582356989500064272585286021) (625000000000000000000000000000000000), -- compact_leaf + Rat.divInt (1) (4000000000000000000), -- compact_reservations + Rat.divInt (999999999999999999) (8000000000000000000), -- delta_below_one_eighth + Rat.divInt (1) (8000000000000000000), -- delta_positive + Rat.divInt (32136292643011124935727414713979) (625032136292643010499935727414713979), -- epsilon_below_one + Rat.divInt (624999999999999999375000000000000000) (625032136292643010499935727414713979), -- epsilon_positive + Rat.divInt (3213080399448642197573196508295877987) (3125160681463215052499678637073569895000000000000000000), -- g1_above_kappa + Rat.divInt (13218409037) (5000000000000000000), -- g2_above_kappa + Rat.divInt (21979929496356786268379467805577023) (781290170365803763124919659268392473750000000000000000), -- g3_above_kappa + Rat.divInt (13218409037) (5000000000000000000), -- g4_above_kappa + Rat.divInt (10078839788273062318087178880999174421) (25001285451705720419997429096588559160000000000000000000), -- g5_above_kappa + Rat.divInt (22579482514125922528085893429293454001) (25001285451705720419997429096588559160000000000000000000), -- g6_above_kappa + Rat.divInt (3124839318536784944463401762375072302573196508295877987) (3125160681463215052499678637073569895000000000000000000), -- g7_above_kappa + Rat.divInt (1) (2000000000000000000), -- gamma_sublinear + Rat.divInt (32136292643011124935727414713979) (625032136292643010499935727414713979), -- guard_width + Rat.divInt (64272585286021) (1250000000000000000000000000000000000), -- lambda_above_internal + Rat.divInt (25352414713979000064272585286021) (1250000000000000000000000000000000000), -- lambda_above_sigma + Rat.divInt (64272585286021) (1250000000000000000000000000000000000), -- lambda_above_tau + Rat.divInt (64272585286021) (1250000000000000000000000000000000000), -- lambda_prime_above_lambda + Rat.divInt (32136292643010499935727414713979) (625000000000000000000000000000000000), -- lambda_prime_below_one + Rat.divInt (9693793493753822316795466474748) (1), -- literal_scalar_guard + Rat.divInt (51418068228817174865027570899355900064272585286021) (1000051418068228816799897163863542366400000000000000000), -- phase_boundary + Rat.divInt (20871164713979) (1250000000000000000), -- phase_leaf_above_bit + Rat.divInt (257090341144088374453683025068821500064272585286021) (5000257090341144083999485819317711832000000000000000000), -- phase_local + Rat.divInt (32136292643011124935727414713979) (625032136292643010499935727414713979), -- prime_interval_packing + Rat.divInt (64272585286021) (625000000000000000000000000000000000), -- q_below_internal + Rat.divInt (10435582356989500064272585286021) (625000000000000000000000000000000000), -- q_below_leaf + Rat.divInt (1) (4000000000000000000), -- q_below_reservations + Rat.divInt (32136292643010499935727414713979) (625000000000000000000000000000000000), -- q_positive + Rat.divInt (32136292643011124935727414713979) (625032136292643010499935727414713979), -- record_suffix + Rat.divInt (6548) (25), -- row_product_gap + Rat.divInt (781209827568713626419328428941958998848843150378012441) (781290170365803763124919659268392473750000000000000000), -- short_record_fallback + Rat.divInt (1) (1000000000000000000) -- small_field_exposure +] + +def data : Data where + width := 575 + volume := 135075665 + weightDenominator := 10000000000000000000000000000000000000000 + weightedRows := rows.map (fun r => (r.multiplicity,r.roundedNumerator)) + assemblySlacks := slacks + expectedAssemblyRows := 47 + kappa := newKappa + latestKappa := oldScoped + +def v (r : Row) : Rat := saving*r.logUpper +def partial8 (x : Rat) : Rat := 1/1+x*(1/1+x*(1/2+x*(1/6+x*(1/24+x*(1/120+x*(1/720+x*(1/5040+x*(1/40320)))))))) +def taylorUpper (r : Row) : Rat := + (r.width : Rat)*(partial8 (v r)+(v r)^9/(362880*(1-v r/10))) + +theorem weighted_numerator_exact : momentNumerator data = 776685073749999999970257502786844032086120818745543 := by decide +kernel +theorem profile_rank_mass : (rows.map (fun r => r.width*r.multiplicity)).sum = 77666660475 := by decide +kernel +theorem profile_row_count : rows.length = 26 := by decide +kernel +theorem assembly_row_count : slacks.length = 47 := by decide +kernel +theorem taylor_rounding_checked : + rows.all (fun r => decide (0 ≤ v r ∧ v r < 1 ∧ + taylorUpper r ≤ Rat.divInt (r.roundedNumerator : Int) 10000000000000000000000000000000000000000)) = true := by decide +kernel +theorem finite_checks_pass : check data = true := by decide +kernel +theorem rational_moment_upper_below_one : momentUpper data < 1 := + (check_sound data finite_checks_pass).2.1 +theorem every_assembly_slack_positive : ∀ s ∈ slacks, 0 x i ^^ y i + +def Linear {I J : Type} (f : Vec I → Vec J) : Prop := + ∀ x y, f (vxor x y) = vxor (f x) (f y) + +theorem vxor_cancel_right {I : Type} (x y : Vec I) : vxor (vxor x y) y = x := by + funext i + simp only [vxor] + cases x i <;> cases y i <;> rfl + +theorem vxor_cancel_middle {I : Type} (x y z : Vec I) : + vxor (vxor x y) (vxor y z) = vxor x z := by + funext i + simp only [vxor] + cases x i <;> cases y i <;> cases z i <;> rfl + +def xorUpdate {I : Type} [DecidableEq I] (a b : I) (s : Vec I) : Vec I := + fun i => if i=a then s a ^^ s b else s i + +theorem xorUpdate_involution {I : Type} [DecidableEq I] (a b : I) + (hab : a ≠ b) (s : Vec I) : xorUpdate a b (xorUpdate a b s) = s := by + funext i + by_cases h : i=a + · subst i + have hb : b ≠ a := Ne.symm hab + simp only [xorUpdate,ite_true,if_neg hb] + cases s a <;> cases s b <;> rfl + · simp only [xorUpdate,if_neg h] + +theorem xorUpdate_linear {I : Type} [DecidableEq I] (a b : I) : + Linear (xorUpdate a b) := by + intro s t + funext i + by_cases h : i=a + · subst i + simp only [xorUpdate,ite_true,vxor] + cases s a <;> cases s b <;> cases t a <;> cases t b <;> rfl + · simp only [xorUpdate,if_neg h,vxor] + +def runWord {I : Type} [DecidableEq I] : List (I × I) → Vec I → Vec I + | [],s => s + | e::es,s => runWord es (xorUpdate e.1 e.2 s) + +def Legal {I : Type} (word : List (I × I)) : Prop := ∀ e ∈ word, e.1 ≠ e.2 + +theorem runWord_append {I : Type} [DecidableEq I] + (xs ys : List (I × I)) (s : Vec I) : + runWord (xs++ys) s = runWord ys (runWord xs s) := by + induction xs generalizing s with + | nil => rfl + | cons e es ih => simp only [List.cons_append,runWord,ih] + +theorem runWord_inverse {I : Type} [DecidableEq I] + (word : List (I × I)) (h : Legal word) (s : Vec I) : + runWord word.reverse (runWord word s) = s := by + induction word generalizing s with + | nil => rfl + | cons e es ih => + have he := h e (by simp) + have hrest : Legal es := by intro f hf; exact h f (by simp [hf]) + simp only [List.reverse_cons,runWord,runWord_append] + rw [ih hrest] + exact xorUpdate_involution e.1 e.2 he s + +theorem runWord_linear {I : Type} [DecidableEq I] (word : List (I × I)) : + Linear (runWord word) := by + induction word with + | nil => intro s t; rfl + | cons e es ih => + intro s t + simp only [runWord] + rw [xorUpdate_linear e.1 e.2 s t,ih] + +/-- This is the actual two-pass shear schedule M,J,M^-1,V repeated twice. -/ +def dirtyWord {X S : Type} + (M N : Vec S → Vec S) (V : Vec X → Vec S) (J : Vec S → Vec X) + (x y : Vec X) (s : Vec S) : Vec X × Vec X × Vec S := + let t1 := M s + let y1 := vxor y (J t1) + let t2 := N t1 + let t3 := vxor t2 (V x) + let t4 := M t3 + let y2 := vxor y1 (J t4) + let t5 := N t4 + let t6 := vxor t5 (V x) + (x,y2,t6) + +/-- Arbitrary dirty scratch cancels. No desired transfer identity is assumed: +the theorem derives the output from the separate source/encoder/scatter maps. -/ +theorem dirtyWord_transfer {X S : Type} + (M N : Vec S → Vec S) (V : Vec X → Vec S) (J : Vec S → Vec X) + (hM : Linear M) (hJ : Linear J) (hNM : ∀ s, N (M s) = s) + (x y : Vec X) (s : Vec S) : + dirtyWord M N V J x y s = (x,vxor y (J (M (V x))),s) := by + simp only [dirtyWord,hNM] + rw [hM,hJ,vxor_cancel_middle,vxor_cancel_right] + +/-- A different unit complement changes the internal encoder and retired +signals, but not the observable shear or dirty restoration when mandatory +fresh transfers agree. -/ +theorem complement_independent_transfer {X S T : Type} + (M N : Vec S → Vec S) (V : Vec X → Vec S) (J : Vec S → Vec X) + (M' N' : Vec T → Vec T) (V' : Vec X → Vec T) (J' : Vec T → Vec X) + (hM : Linear M) (hJ : Linear J) (hNM : ∀ s, N (M s) = s) + (hM' : Linear M') (hJ' : Linear J') (hNM' : ∀ s, N' (M' s) = s) + (hfresh : ∀ x, J (M (V x)) = J' (M' (V' x))) + (x y : Vec X) (s : Vec S) (t : Vec T) : + (dirtyWord M N V J x y s).1 = (dirtyWord M' N' V' J' x y t).1 ∧ + (dirtyWord M N V J x y s).2.1 = (dirtyWord M' N' V' J' x y t).2.1 ∧ + (dirtyWord M N V J x y s).2.2 = s ∧ + (dirtyWord M' N' V' J' x y t).2.2 = t := by + rw [dirtyWord_transfer M N V J hM hJ hNM, + dirtyWord_transfer M' N' V' J' hM' hJ' hNM'] + simp [hfresh] + +/-- The concrete legal XOR encoder needs no assumed invertibility premise: +its literal reversed word is the proved inverse, for all dirty vectors. -/ +theorem legal_word_dirty_transfer {X S : Type} [DecidableEq S] + (word : List (S × S)) (hlegal : Legal word) + (V : Vec X → Vec S) (J : Vec S → Vec X) (hJ : Linear J) + (x y : Vec X) (s : Vec S) : + dirtyWord (runWord word) (runWord word.reverse) V J x y s = + (x,vxor y (J (runWord word (V x))),s) := + dirtyWord_transfer _ _ _ _ (runWord_linear word) hJ (runWord_inverse word hlegal) x y s + +/-- If the unchanged mandatory producer/scatter contract is the identity, +the compiled complement produces exactly the required shear. -/ +theorem legal_word_shear {X S : Type} [DecidableEq S] + (word : List (S × S)) (hlegal : Legal word) + (V : Vec X → Vec S) (J : Vec S → Vec X) (hJ : Linear J) + (htransfer : ∀ x, J (runWord word (V x)) = x) + (x y : Vec X) (s : Vec S) : + dirtyWord (runWord word) (runWord word.reverse) V J x y s = (x,vxor y x,s) := by + rw [legal_word_dirty_transfer word hlegal V J hJ,htransfer] + +end DirtyComplementSafety + +#print axioms DirtyComplementSafety.runWord_inverse +#print axioms DirtyComplementSafety.dirtyWord_transfer +#print axioms DirtyComplementSafety.complement_independent_transfer +#print axioms DirtyComplementSafety.legal_word_shear diff --git a/research/current-record-circuits/math/FiniteRationalChecks.lean b/research/current-record-circuits/math/FiniteRationalChecks.lean new file mode 100644 index 0000000000..089a80bedf --- /dev/null +++ b/research/current-record-circuits/math/FiniteRationalChecks.lean @@ -0,0 +1,80 @@ +import Std +import Init.Data.Rat.Lemmas + +/-! +Finite rational moment-envelope and assembly-check interface. +Weighted upper bounds use one explicit positive common denominator. Their +analytic validity, source/profile binding, completeness of assembly rows and +inherited multiplication theorem remain explicit external contracts. +No successful frontier instance is asserted merely by compiling this helper. +-/ +namespace FrontierRationalCertificate + +structure Data where + width : Nat + volume : Nat + weightDenominator : Nat + weightedRows : List (Nat × Nat) + assemblySlacks : List Rat + expectedAssemblyRows : Nat + kappa : Rat + latestKappa : Rat + +def momentNumerator (c : Data) : Nat := + (c.weightedRows.map fun row => row.1*row.2).sum + +def momentUpper (c : Data) : Rat := + Rat.divInt (momentNumerator c : Int) (c.weightDenominator*c.width*c.volume : Nat) + +def check (c : Data) : Bool := + decide (0 decide (0 false + | i::is,s => s i ^^ providerXor is s + +def clearCarrier (target : I) (providers : List I) (s : Vec I) : Vec I := + fun i => if i=target then s target ^^ providerXor providers s else s i + +omit [DecidableEq I] in +theorem providerXor_congr (providers : List I) (s t : Vec I) + (h : ∀ i ∈ providers, s i = t i) : providerXor providers s = providerXor providers t := by + induction providers with + | nil => rfl + | cons i is ih => + have hi := h i (by simp) + have hrest : ∀ j ∈ is, s j=t j := by intro j hj; exact h j (by simp [hj]) + simp only [providerXor,hi,ih hrest] + +theorem clear_other_coordinate (target i : I) (providers : List I) + (h : i ≠ target) (s : Vec I) : clearCarrier target providers s i = s i := by + simp only [clearCarrier,if_neg h] + +theorem providers_unchanged (target : I) (providers : List I) + (h : ∀ i ∈ providers, i ≠ target) (s : Vec I) : + providerXor providers (clearCarrier target providers s) = providerXor providers s := by + apply providerXor_congr + intro i hi + exact clear_other_coordinate target i providers (h i hi) s + +/-- Clearing cannot erase arbitrary dirty information: it is an involution. -/ +theorem clearing_involution (target : I) (providers : List I) + (h : ∀ i ∈ providers, i ≠ target) (s : Vec I) : + clearCarrier target providers (clearCarrier target providers s) = s := by + funext i + by_cases hi : i=target + · subst i + simp only [clearCarrier,ite_true] + change (s target ^^ providerXor providers s ^^ + providerXor providers (clearCarrier target providers s)) = s target + rw [providers_unchanged target providers h s] + cases s target <;> cases providerXor providers s <;> rfl + · simp only [clearCarrier,if_neg hi] + +/-- A checked fresh linear dependency creates a quiet coordinate for every +fresh source value, while the reversible transform still retains dirty data. -/ +theorem fresh_kernel_coordinate (target : I) (providers : List I) + (fresh : Vec X → Vec I) + (hkernel : ∀ x, fresh x target = providerXor providers (fresh x)) + (x : Vec X) : clearCarrier target providers (fresh x) target = false := by + simp only [clearCarrier,ite_true,hkernel] + exact Bool.xor_self _ + +/-- All non-target fresh outputs are preserved by kernel clearing. -/ +theorem fresh_mandatory_coordinate_preserved (target i : I) (providers : List I) + (hi : i ≠ target) (fresh : Vec X → Vec I) (x : Vec X) : + clearCarrier target providers (fresh x) i = fresh x i := + clear_other_coordinate target i providers hi _ + +/-- An actual dirty carrier need not be zero after a fresh-zero certificate. +At one coordinate, clearing with no providers preserves a dirty true bit. -/ +theorem dirty_zero_counterexample : + clearCarrier (0 : Nat) [] (fun _ => true) 0 = true := by rfl + +end FreshKernelReclaim + +#print axioms FreshKernelReclaim.clearing_involution +#print axioms FreshKernelReclaim.fresh_kernel_coordinate +#print axioms FreshKernelReclaim.fresh_mandatory_coordinate_preserved +#print axioms FreshKernelReclaim.dirty_zero_counterexample diff --git a/research/current-record-circuits/math/generate_taylor_case.py b/research/current-record-circuits/math/generate_taylor_case.py new file mode 100644 index 0000000000..e3b5b32d7f --- /dev/null +++ b/research/current-record-circuits/math/generate_taylor_case.py @@ -0,0 +1,125 @@ +"""Concrete finite degree-eight Taylor/tail certificate; analytic scope explicit.""" +from pathlib import Path +from fractions import Fraction as Q +from math import factorial +import argparse, hashlib, json, re + +ap = argparse.ArgumentParser() +ap.add_argument('weighted_json', type=Path) +ap.add_argument('--scoped') +ap.add_argument('--published') +ap.add_argument('--source-pin') +ap.add_argument('--output', type=Path, default=Path(__file__).with_name('CurrentRecordCertificate.lean')) +ap.add_argument('--namespace', default='CurrentRecordCertificate') +ap.add_argument('--label', default='current-record finite arithmetic') +args = ap.parse_args() +assert re.fullmatch(r'[A-Za-z][A-Za-z0-9_]*', args.namespace) +d = json.loads(args.weighted_json.read_text(encoding='utf-8')) +assert d['upper_enclosure_kind'] == 'taylor8_tail' +old_scope = args.scoped or d.get('comparison', {}).get('old_formal_scoped_limit') +old_public = args.published or d.get('comparison', {}).get('old_published_kappa') +assert old_scope and old_public +assert Q(old_public) < Q(old_scope) < Q(d['kappa']) +if args.source_pin: + assert d['source_commit'] == args.source_pin +rows = d['rows']; scale = rows[0]['rounding_scale'] +assert rows and scale > 0 and all(r['rounding_scale'] == scale for r in rows) +assert len(d['named_slacks']) == 47 and all(Q(v) > 0 for v in d['named_slacks'].values()) +for r in rows: + v = Q(d['bit_saving'])*Q(r['log_upper']) + f = r['width']*(sum((v**j/Q(factorial(j)) for j in range(9)), Q()) + + v**9/Q(factorial(9))/(1-v/10)) + assert 0 <= v < 1 and f == Q(r['F_upper']) + assert f <= Q(r['rounded_F_upper_numerator'], scale) +assert sum(r['multiplicity']*r['rounded_F_upper_numerator'] for r in rows) == d['weighted_upper_numerator'] +assert scale*d['m']*d['W'] == d['weighted_upper_denominator'] +assert sum(r['width']*r['multiplicity'] for r in rows) == d['total_rank'] + +def rat(value): + q = Q(value) + return f'Rat.divInt ({q.numerator}) ({q.denominator})' + +label = args.label.replace('-/', '- /').replace('\n', ' ') +polynomial = '1/40320' +for denominator in [5040, 720, 120, 24, 6, 2, 1, 1]: + polynomial = f'1/{denominator}+x*({polynomial})' +source = f'''import FiniteRationalChecks + +/-! +Concrete finite arithmetic for {label}, source {d['source_commit']}. +Weighted input SHA256 {hashlib.sha256(args.weighted_json.read_bytes()).hexdigest()}. +Source certificate SHA256 {d['source_certificate_sha256']}. +Candidate certificate SHA256 {d['refined_certificate_sha256']}. +The kernel computes the degree-eight Taylor polynomial, ninth-term rational +tail, directed upper rounding, weighted moment and all 47 positive slacks. +The logarithm enclosure and analytic exponential tail bound are inherited +explicit contracts. Source/profile binding, completeness of assembly formulas, +physical compiler/tape transfer and the global multiplication theorem remain +external contracts. This file proves no optimization or practical speedup. +-/ +namespace {args.namespace} +open FrontierRationalCertificate +set_option maxRecDepth 100000 +set_option maxHeartbeats 0 + +def saving : Rat := {rat(d['bit_saving'])} +def newKappa : Rat := {rat(d['kappa'])} +def oldScoped : Rat := {rat(old_scope)} +def oldPublished : Rat := {rat(old_public)} + +structure Row where + width : Nat + multiplicity : Nat + logUpper : Rat + roundedNumerator : Nat + +def rows : List Row := [ +''' +source += ',\n'.join(f' ⟨{r["width"]},{r["multiplicity"]},{rat(r["log_upper"])},{r["rounded_F_upper_numerator"]}⟩' for r in rows)+'\n]\n\n' +source += 'def slacks : List Rat := [\n' +slacks = list(d['named_slacks'].items()) +for i, (name, value) in enumerate(slacks): + source += f' {rat(value)}'+(',' if i+1 < len(slacks) else '')+f' -- {name}\n' +source += f'''] + +def data : Data where + width := {d['m']} + volume := {d['W']} + weightDenominator := {scale} + weightedRows := rows.map (fun r => (r.multiplicity,r.roundedNumerator)) + assemblySlacks := slacks + expectedAssemblyRows := 47 + kappa := newKappa + latestKappa := oldScoped + +def v (r : Row) : Rat := saving*r.logUpper +def partial8 (x : Rat) : Rat := {polynomial} +def taylorUpper (r : Row) : Rat := + (r.width : Rat)*(partial8 (v r)+(v r)^9/(362880*(1-v r/10))) + +theorem weighted_numerator_exact : momentNumerator data = {d['weighted_upper_numerator']} := by decide +kernel +theorem profile_rank_mass : (rows.map (fun r => r.width*r.multiplicity)).sum = {d['total_rank']} := by decide +kernel +theorem profile_row_count : rows.length = {len(rows)} := by decide +kernel +theorem assembly_row_count : slacks.length = 47 := by decide +kernel +theorem taylor_rounding_checked : + rows.all (fun r => decide (0 ≤ v r ∧ v r < 1 ∧ + taylorUpper r ≤ Rat.divInt (r.roundedNumerator : Int) {scale})) = true := by decide +kernel +theorem finite_checks_pass : check data = true := by decide +kernel +theorem rational_moment_upper_below_one : momentUpper data < 1 := + (check_sound data finite_checks_pass).2.1 +theorem every_assembly_slack_positive : ∀ s ∈ slacks, 00$. For every integer modulus $M$, +\begin{equation}\label{eq:quotient} + N(x)\bmod(dM)=d\bigl(F(x)\bmod M\bigr),\qquad + \frac{N(x)\bmod(dM)}d=F(x)\bmod M. +\end{equation} +This follows from the integer scaled-remainder identity; the quotient is +exact. It also holds for a simulator proved congruent to $N$ modulo $dM$. +Arbitrary dirty values may first be subtracted in that same residue ring: +$((z+dF)\bmod dM-z\bmod dM)\bmod dM$ has the same exact quotient. + +For the actual $d=8$ matrix circuit and $M=2^p$, evaluate its integer +instructions modulo $2^{p+3}$, then divide the output representatives by +eight. This recovers $AB\bmod2^p$. Simply reducing the numerator modulo two +loses the result: $A=B=E_{00}$ gives numerator residue zero but product one. +For every $p\ge1$, products $0$ and $2^{p-1}$ have equal numerator residues +modulo $2^{p+2}$ and different requested $p$-bit results. Consequently +\emph{no function of that smaller numerator residue alone} can recover all +outputs. The $p+3$ boundary is sharp for this interface, not a lower bound +on multiplication algorithms. + +The universal recovery and collision statements are kernel checked in +\texttt{LateQuotient.lean} and \texttt{SharpQuotient.lean}. Fresh actual-circuit +controls cover all 256 binary $2\times2$ input pairs embedded in order 16, +42 signed dense cases, and precisions $1,2,3,4,8,16,31$. The lifted ring and +its extra three numerator bits must be charged; this is not a native +one-bit XOR-network implementation. + +\section{An exact Gaussian DAG, with sharing retained} +Put $\pii=1+i$. Align every canonical Gaussian-dyadic input to a common +numerator tag $E$. Homogeneity makes the product grid $2E$. Since the +actual circuit identity holds over the commutative ring $\Gi$, both +coordinates of every output numerator are divisible by eight at this +grid. Exact coordinate quotients followed by canonical parity reduction +return the matrix product without an extra denominator beyond $2E$. +This does not assert that multiplying two $E$-tag inputs keeps tag $E$. + +The shared interpreter first forms the actual 48 pairs of $4\times4$ +outer blocks, executes their 46-product leaves, then recombines their +integer output numerators. It preserves the author's chronological +composition discipline instead of expanding every output into the flat +certificate. Using the established three-real-product Gaussian identity +gives the following displayed arithmetic schedules: +\begin{center} +\begin{tabular}{lrr} +\toprule +Quantity & Flat certificate interpreter & Shared hybrid interpreter\\ +\midrule +Gaussian mixed product slots & 2,208 & 2,208\\ +Real variable-product slots & 6,624 & 6,624\\ +Real component additions & 193,568 & 57,696\\ +Nonunit fixed-coefficient scales & 42,240 & 7,680\\ +Exact component output quotients & 512 & 512\\ +\bottomrule +\end{tabular} +\end{center} +The shared schedule saves 135,872 displayed component additions. The +comparison excludes input alignment, canonical normalization and physical +tape costs, and makes no runtime or best-known algorithm claim. The +three-real-product identity is separately kernel checked. Five dense +integer/heterogeneous-tag cases compare 1,280 outputs literally with the +pinned flat circuit and independently with Fraction-valued classical dots. + +\section{A valid operator domain, and the remaining obstruction} +The scalar leaf cannot be inserted recursively on arbitrary matrix blocks. +For $U=E_{12}$, $V=E_{21}$, $B=0$, the first leaf output has the defect +$UV-VU=\operatorname{diag}(1,-1)$ instead of zero, including a nonzero +characteristic-two specialization. More generally, the paired-inner +formulas have precisely the defects +\[ + \sum_h[A_{i,2h},A_{i,2h+1}] + \quad(j=0),\qquad + \sum_h[B_{2h+1,j},A_{i,2h+1}]\quad(j>0). +\] +Thus explicit required commutations can certify a restricted block domain; +scalar correctness alone cannot. With a fixed terminal leaf and repeated +valid 48-product outer levels, the recurrence has exponent $\log_4 48$; +the terminal count changes its constant, not that exponent. + +There is a natural positive domain in the community's complex operators. +XOR translations $X_u$ commute, and +$C_u=(iI+X_u)/\pii$ lies in their commutative group algebra. The new +\texttt{CommutingPhases.lean} proves translation and charged raw-phase +commutation for arbitrary functions and masks. Four complete order-16 +operator cases on dimensions two and three verify 1,024 outputs and 6,144 +kernel coefficients independently by exact XOR convolution. + +However, the \emph{algebra} being closed does not make every leaf operand +an eligible physical phase child. $C_1+C_2$ has eigenvalues +$2,1+i,1+i,2i$; it is invertible but not a phase child or a scalar multiple +of one. Its average still has unequal spectral magnitudes; $C_1-C_2$ is +nonzero and singular. Gauges also matter: +when $u\cdot v=1$, +$[C_u,Z_v]=(1-i)X_uZ_v$, a full-rank defect. Both closure and gauge +counterexamples are checked exactly. Accordingly, 2,208 operator products +cannot be counted as 2,208 cheap child calls without a paid implementation +and a complete rank/frame schedule. This is a precise search eligibility +criterion and obstruction, not an uncharged exponent argument. + +\section{Profile-aware compilation and exact matching search} +This one-hour research run used only sources already available through PR +\#62, construction commit +\texttt{ad0f25ff7b23cff7f08ad237c2254e6ecf74257e}. No newer community +activity was consulted. The scalar interval/core-aware pair graph, complete +input/output inventory and fixed $I+J$ rational basis are retained. The compiler +changes which retired dependency circuit it clears, which admissible carried +input it retains, and, in the tested coordinate variants, the consistent +point-label assignment of the finite word. + +Write $F_a(t)=t\exp(a\log(m/t))$ and +$\mathcal S_a=\sum_t n_tF_a(t)-mW$. Strict feasibility is +$\mathcal S_a<0$. This extends our previous all-cardinality bookkeeping: +the objective accounts for the complete child profile and wire normalization. +When $W$ and total rank are fixed, fewer wires or smaller linear rank growth +cannot distinguish the variants. The actual contiguous pivot blocks determine +the recursive cost. For $0<\alpha<1$, splitting a block of width $u+v$ into +$u,v$ raises its power cost, since $u^\alpha+v^\alpha>(u+v)^\alpha$. + +\paragraph{Choosing a dependency circuit.} +For a frame transition $A\to B$, let +$C_a(A,B)=\sum_t n_t(A,B)F_a(t)$ use its actual fixed-basis profile. +Clearing a retired target at $A_s$ into $G$ with providers $z$ is priced by +\[ + C_a(A_s,G)-C_a(A_s,I)+ + \sum_z\bigl[C_a(A_z,G)+C_a(G,I)-C_a(A_z,I)\bigr]. +\] +Every target/provider promotion and clearing XOR is emitted. The expression +includes changed deferred cleanup, under the local assumption that other +retired providers remain retired until cleanup. Future reuse couples the +choices; this is a search heuristic, not a global additive optimum. +All such target choices have the same linear rank change $r(G)-h$, and other +retired providers have zero net rank change after cleanup. A carried edge has +rank change $-h$. Therefore the implementation can price $F_a(t)-t$ to avoid +floating cancellation while preserving candidate order at fixed cardinality. +\texttt{RankFlowPrice.lean} proves these identities and constant-shift order +equivalence. Variable-cardinality comparisons retain the full rank correction. + +\paragraph{Changing the carried signals.} +For a value produced at $P$, preserved through $G$ and consumed at $T$, the +no-reclamation edge price is +\[ + C_a(G,T)-C_a(G,I)-C_a(0,P)-C_a(P,T). +\] +Bounded single-edge donor/use exchanges retain cardinality, distinct uses and +linear independence modulo mandatory outputs. We also test two-edge cycles. +The price oracle uses actual rational pivot profiles; floating prices propose +choices and the complete exact final characteristic accepts them. No weighted +matroid optimum or general network optimum is claimed. + +\paragraph{Dirty state and coordinate freedom.} +The inverse of a legal XOR encoder $M$ is its literal reversed word. With +source map $V$ and scatter $J$, the two-pass schedule +$M,J,M^{-1},V,M,J,M^{-1},V$ sends arbitrary $(x,y,s)$ to +$(x,y\mathbin{\oplus}JMVx,s)$. Thus $JMV=I$ is the separate fresh-transfer +contract, and dirty scratch cancels for different legal complements. +\texttt{DirtyComplementSafety.lean} proves this universally. +\texttt{FreshKernelReclaim.lean} proves that a zero fresh dependency still +permits nonzero dirty state. Future-aware unit and kernel completions are +explored, with their unsuccessful cases retained in the search record. + +A point permutation renames every frame core/cover, source triple, output +triple and scatter-bank index together. Frame containment is preserved, +$I+J$ commutes with the permutation, and the full triple-pair data inventory +is unchanged. The emitted word records the new canonical ports explicitly. +\texttt{CoordinateConjugacy.lean} proves full-word conjugacy, mask containment, +triple-family bijection and the $I+J$ entry identity. Actual ordered profiles +are still freshly computed; symmetry alone does not determine their cost. + +\paragraph{Accepted finite result.} +The selected strategy is documented with its immutable source, word and price +oracle hashes. Its complete profile has $m=575$, $W=137,151,806$, +total rank $78,860,441,550$, deficit $1,846,900$ and maximum child +width $529$. Physical roles are 27,918 and +36,586; literal scalar XOR counts are +148,852 and 205,629. +There are 2,296,434,724 recursive child calls versus the frozen profile's +2,301,104,805. These counts are explicitly charged finite schedules, not +runtime measurements. Exact rational certification gives +\[ + a_b=\frac{510429345092917}{10000000000000000000},\qquad h=10^{-18},\qquad + \kappa=\frac{255201646305539}{5000000000000000000}=5.10403292611078\times10^{-5}. +\] +The increase over $5.101691\times10^{-5}$ is approximately +$0.04590489\%$ in exponent saving. The dyadic corollary remains $2^{-15}$. +The old complete PR \#62 profile has a rigorous lower characteristic above +one at this new $a_b$, while the new upper characteristic is below one. +This verifies a structural profile improvement. All 47 assembly inequalities +and seven margins pass. The concrete Lean instance derives rounded weights, +the new moment upper, the old cubic-Taylor lower rejection and strict numerical +comparisons in the kernel. Logarithm/exponential enclosures and the inherited +all-size frame/compiler, tape, routing, recovery and eventual setup interfaces +remain explicit contracts. The unchanged data geometry and rational recovery +are inherited; the selected words, dirty bases, frame incidences, ordered +profiles and CRT checks are freshly replayed. + +For a fixed admissible carrier graph, a separate exact matching certificate +can bound what remains to search. For integer edge costs $q_{ij}$, row +potentials $u_i$ and column potentials $v_j\le0$ satisfying +$u_i+v_j\le q_{ij}$ give the lower bound +\[ + \sum_i u_i+\sum_j v_j\ \le\ \sum_i q_{i,p(i)} +\] +for every injective complete assignment $p$. Equality for a proposed +assignment certifies optimality for that recorded integer objective. +Private dummy columns and a proved sufficient penalty encode maximum +cardinality. Quantized objectives must remain distinguished from +unrounded logarithmic or characteristic weights; enclosing intervals and +rounding error are retained when deriving bounds for those real objectives. + +An actual 10,639-edge example passes 17,619 integer dual inequalities with +primal equal to dual. Further examples exercise the searched graphs. +The new \texttt{MatchingDual.lean} proves weak duality, attainment and +optimality for their exact integer objective. Source-to-certificate binding +is independently replayed by Python, rather than claimed as a large +numerical Lean instance. + +\paragraph{Removing an unnecessary cardinality restriction.} +Maximum-cardinality matching alone need not optimize the complete +characteristic. Write $F_t=t\exp(a\log(m/t))$, so +$\Phi=\sum n_tF_t/(mW)$. With $K$ selected carriers on one axis $h$, +repeat count $r$, unmatched width $W_0$, unmatched scaled numerator $A_0$, +and internal edge changes $\Delta F_e$, the actual cost model gives +\[ + W_K=W_0-rK,\qquad + A_K=A_0+r\left(\sum_e\Delta F_e-K(F_h+F_{m-2h})\right). +\] +Consequently the fixed-target feasibility slack is +\begin{equation}\label{eq:allcard} + A_K-mW_K=A_0-mW_0+ + r\sum_e\left(\Delta F_e+m-F_h-F_{m-2h}\right). +\end{equation} +Optimizing these complete edge costs with zero-cost private unmatched +columns compares \emph{all cardinalities}, including the change in wire +normalization. There is no maximum-cardinality penalty. The bookkeeping +identity is kernel checked in \texttt{FeasibilityNormalForm.lean}; its +geometric/profile input contract remains the explicitly replayed one. + +At an earlier recorded fixed bit target, the actual order-25 graph passes 23,541 +integer dual inequalities for this objective, with primal and dual both +22,172,308,087,581. It selects 7,894 carriers without forcing their number. +Rigorous rational cost intervals bound the proposed matching's true +unrounded slack-objective regret by $4.162\times10^{-9}$ before the repeat +factor and $(mW)^{-1}$ normalization. This certifies the quantized fixed-DAG +objective and bounds remaining true-cost room; it does not certify global +network or exponent optimality. This assignment is a search certificate, +not a replacement for the separately physically inherited candidate. + +\section{Reproduction, authorship and limits} +The local package includes actual matrix data, interpreters, independent +controls, the typed finite catalogue, source pins, search receipts and new +\texttt{Std}-only Lean sources and their concrete rational certificate, +with a complete standalone axiom audit. Its catalogue checks coefficient domains, +block stability, terminal-only commutativity, paid modular lifts, literal +factor lineage and fringe costs. Unreplayed advertised catalogue rows remain +quarantined. Historical 45-endpoint Mathlib evidence, fresh matrix polynomial +controls, fresh standalone proofs, and inherited PR \#62 physical-network checks are +reported separately. No complete Python refinement or full multiplication +theorem is asserted by the new formalization. + +Alejandro Zarzuelo Urdiales is the author and human developer. The work +began with an earlier Archivara exploration and his July matrix +generalization, developed with multiple AI tools; the current synthesis +involved substantial OpenAI Codex assistance. Known matrix components, +Gaussian arithmetic and LP duality retain their prior-work credit. +Community construction credit includes OpenAI's pinned manuscript, +CrocSwap/Douglas Colkitt, icekylinx, RaD/hipotures, Rohan Arun, Chafik +Boukhalfa, James Chang, Dominik Scholz, Zhihao Chen, Aurel Prosz, Swapnil +Jain and retained predecessor notices. Full analytic, physical compiler, +fixed-tape, setup and eventual-threshold hypotheses remain conditional. +The finite construction retains Avi Eisenberg's PR \#62 interval-strip and core-aware pair +assembly and Eumemic's PR \#57 joint frame compiler. Earlier numerical +editions over PRs \#58 and \#60 retain their separate source pins and credit. The new matrix/parity arithmetic, +exact search certificates and finite rational formalization retain their +separate stated scopes. + +\begin{thebibliography}{4} +\bibitem{matrix} A. Zarzuelo Urdiales, \emph{Hybrid Composition Bounds for +Exact Matrix Multiplication}, October 7 review edition, source and proof +archive: \url{https://github.com/alejandrozu/openmath-2026-judging}. +\bibitem{parity} A. Zarzuelo Urdiales, Gaussian parity certificates and +community integration: \url{https://github.com/CrocSwap/integer-mult-bounds/pull/45}. +\bibitem{community} Community reordered-producer and climbed-order +benchmarks: \url{https://github.com/CrocSwap/integer-mult-bounds/pull/53}, +\url{https://github.com/CrocSwap/integer-mult-bounds/pull/62}. +\end{thebibliography} +\end{document} diff --git a/research/current-record-circuits/receipts/axis-23.json b/research/current-record-circuits/receipts/axis-23.json new file mode 100644 index 0000000000..8fac3ca74a --- /dev/null +++ b/research/current-record-circuits/receipts/axis-23.json @@ -0,0 +1,113 @@ +{ + "status": "PASS fresh full input/dirty basis both orientations, independent literal frame path, exact fixed profiles", + "word_sha256": "624dfd880b174dae9a6e87ced46ac8550dc36b4441754cf7b884b12b6782e6fe", + "gzip_sha256": "5a504019c1521b1f6202a687792327446aa8c696354a270b1d44b64e64d6e70d", + "replay": { + "status": "independent serialized word, exact frames, full input and dirty basis both orientations PASS", + "h": 23, + "roles": 27455, + "output_roles": 5336, + "elementary_xors": 162131, + "word_length": 673318, + "full_basis_vectors": 30997, + "rank_mass": 631971, + "histogram": { + "1": 58563, + "0": 175323, + "2": 78910, + "4": 15387, + "3": 10224, + "5": 6447, + "6": 1604, + "8": 1230, + "10": 542, + "9": 406, + "7": 729, + "12": 674, + "14": 1927, + "13": 253, + "11": 88, + "16": 440, + "17": 484, + "18": 3417, + "19": 6882, + "15": 436, + "22": 23, + "21": 171 + } + }, + "prepared": { + "h": 23, + "v": 1771, + "R": 27455, + "frames": 59803, + "distinct_transitions": 152270, + "singles": 15939, + "rank_mass": 631971, + "rank_histogram_with_side_growth_split_into_singletons": { + "1": 69189, + "2": 73597, + "3": 10224, + "4": 15387, + "5": 6447, + "6": 1604, + "7": 729, + "8": 1230, + "9": 406, + "10": 542, + "11": 88, + "12": 674, + "13": 253, + "14": 1927, + "15": 436, + "16": 440, + "17": 484, + "18": 3417, + "19": 6882, + "21": 171, + "22": 23 + }, + "word_sha256": "624dfd880b174dae9a6e87ced46ac8550dc36b4441754cf7b884b12b6782e6fe", + "copied_centers": 23, + "transition_events_equal_independent_xor_word_reconstruction": true + }, + "profile": { + "h": 23, + "v": 1771, + "R": 27455, + "loss": 506, + "rank_sum": 631971, + "field_prime": 2305843009213693951, + "frames": 59803, + "distinct_matrices": 38780, + "crt_matrices": 5750, + "crt_disagreements": 0, + "blocks": [ + 0, + 357135, + 21255, + 8005, + 5460, + 4174, + 3835, + 3248, + 2613, + 2109, + 1750, + 1529, + 1008, + 863, + 555, + 461, + 234, + 149, + 40, + 9, + 0, + 23, + 0, + 0 + ] + }, + "elapsed_seconds": 20.70299999997951 +} diff --git a/research/current-record-circuits/receipts/axis-25.json b/research/current-record-circuits/receipts/axis-25.json new file mode 100644 index 0000000000..2f321dbafe --- /dev/null +++ b/research/current-record-circuits/receipts/axis-25.json @@ -0,0 +1,119 @@ +{ + "status": "PASS fresh full input/dirty basis both orientations, independent literal frame path, exact fixed profiles", + "word_sha256": "0920e11cb3a52ed892a834f97fcb6af96d34e44190e6d67e11b94f6b7be2ffde", + "gzip_sha256": "aa67a24ccd38597fece6f267ad48b98676fef0f2755ea917481fc7d355d35097", + "replay": { + "status": "independent serialized word, exact frames, full input and dirty basis both orientations PASS", + "h": 25, + "roles": 36015, + "output_roles": 6925, + "elementary_xors": 225726, + "word_length": 935104, + "full_basis_vectors": 40615, + "rank_mass": 900975, + "histogram": { + "1": 77225, + "0": 242838, + "2": 114945, + "3": 13560, + "4": 19874, + "6": 2965, + "5": 8381, + "7": 1128, + "8": 1440, + "9": 652, + "10": 790, + "12": 750, + "13": 148, + "14": 681, + "16": 2266, + "18": 566, + "17": 684, + "19": 828, + "15": 168, + "11": 42, + "20": 4480, + "21": 8901, + "24": 25, + "23": 280 + } + }, + "prepared": { + "h": 25, + "v": 2300, + "R": 36015, + "frames": 84845, + "distinct_transitions": 212580, + "singles": 20700, + "rank_mass": 900975, + "rank_histogram_with_side_growth_split_into_singletons": { + "1": 91025, + "2": 108045, + "3": 13560, + "4": 19874, + "5": 8381, + "6": 2965, + "7": 1128, + "8": 1440, + "9": 652, + "10": 790, + "11": 42, + "12": 750, + "13": 148, + "14": 681, + "15": 168, + "16": 2266, + "17": 684, + "18": 566, + "19": 828, + "20": 4480, + "21": 8901, + "23": 280, + "24": 25 + }, + "word_sha256": "0920e11cb3a52ed892a834f97fcb6af96d34e44190e6d67e11b94f6b7be2ffde", + "copied_centers": 25, + "transition_events_equal_independent_xor_word_reconstruction": true + }, + "profile": { + "h": 25, + "v": 2300, + "R": 36015, + "loss": 600, + "rank_sum": 900975, + "field_prime": 2305843009213693951, + "frames": 84845, + "distinct_matrices": 52071, + "crt_matrices": 7445, + "crt_disagreements": 0, + "blocks": [ + 0, + 492613, + 27862, + 10468, + 7884, + 5690, + 5028, + 4101, + 3812, + 3047, + 2491, + 2047, + 1818, + 1443, + 1153, + 898, + 569, + 469, + 271, + 163, + 47, + 13, + 0, + 25, + 0, + 0 + ] + }, + "elapsed_seconds": 22.671999999991385 +} diff --git a/research/current-record-circuits/receipts/compiled-23.json b/research/current-record-circuits/receipts/compiled-23.json new file mode 100644 index 0000000000..9ab2b173bd --- /dev/null +++ b/research/current-record-circuits/receipts/compiled-23.json @@ -0,0 +1,64 @@ +{ + "source_pin": "1bef94fd40a746452548c84a4a8f8834670a3113", + "strategy": "circuits", + "compiled": { + "h": 23, + "mode": { + "matching": true, + "reclaim": true + }, + "roles": 27455, + "baseline_pr48_roles": 36432, + "histogram": { + "1": 58563, + "0": 327808, + "2": 78910, + "4": 15387, + "3": 10224, + "5": 6447, + "6": 1604, + "8": 1230, + "10": 542, + "9": 406, + "7": 729, + "12": 674, + "14": 1927, + "13": 253, + "11": 88, + "16": 440, + "17": 484, + "18": 3417, + "19": 6882, + "15": 436, + "22": 23, + "21": 171 + }, + "rank_mass": 631971, + "elementary_xors": 162131, + "stats": { + "augmentations": 134, + "regions": 59801, + "matched": 44071, + "multi_node_regions": 9752, + "live_anchor_candidates": 76133, + "reclaimed": 925, + "clearing_xors": 1658, + "zero_circuit_toggles": 1455, + "live_anchor_xors": 90 + }, + "dirty_basis_vectors": 30997, + "complete_dirty_basis_both_orientations": true, + "all_physical_frame_inclusions": true, + "seconds": 264.37977170944214 + }, + "word_sha256": "624dfd880b174dae9a6e87ced46ac8550dc36b4441754cf7b884b12b6782e6fe", + "gzip_sha256": "5a504019c1521b1f6202a687792327446aa8c696354a270b1d44b64e64d6e70d", + "source_engine_sha256": "58f13f82ce1bb7f2b5549e17628bc6034e5e05cb24db2acb9a91c24820872f70", + "local_engine_sha256": "4c9e87d1eb173e053a1a4d8f0895d7d3f1a2a30b28441533df656672d9ddf3b8", + "runner_sha256": "ac40f56ca3ad426197770877e366256bd1a7676920368b00c1d4f09386a7ce11", + "graph_source_sha256": "9d4ee7179f880f9576e81c7ad3a5290fe61380a7531d559ef3cf0939bb30089c", + "oracle_source_sha256": "d1f6b650de9fb5842b412595369271d9eeb6f54045c76c0fb5cad29854955c35", + "elapsed_seconds": 267.3973093999957, + "scope": "proposal with full compiler dirty basis both orientations; independent paid profile and assembly required", + "no_global_optimality_claim": true +} diff --git a/research/current-record-circuits/receipts/compiled-25.json b/research/current-record-circuits/receipts/compiled-25.json new file mode 100644 index 0000000000..1ad011a707 --- /dev/null +++ b/research/current-record-circuits/receipts/compiled-25.json @@ -0,0 +1,66 @@ +{ + "source_pin": "1bef94fd40a746452548c84a4a8f8834670a3113", + "strategy": "circuits", + "compiled": { + "h": 25, + "mode": { + "matching": true, + "reclaim": true + }, + "roles": 36015, + "baseline_pr48_roles": 48329, + "histogram": { + "1": 77225, + "0": 455814, + "2": 114945, + "3": 13560, + "4": 19874, + "6": 2965, + "5": 8381, + "7": 1128, + "8": 1440, + "9": 652, + "10": 790, + "12": 750, + "13": 148, + "14": 681, + "16": 2266, + "18": 566, + "17": 684, + "19": 828, + "15": 168, + "11": 42, + "20": 4480, + "21": 8901, + "24": 25, + "23": 280 + }, + "rank_mass": 900975, + "elementary_xors": 225726, + "stats": { + "augmentations": 229, + "regions": 84843, + "matched": 64255, + "multi_node_regions": 13075, + "live_anchor_candidates": 102320, + "reclaimed": 1373, + "clearing_xors": 2313, + "zero_circuit_toggles": 1818, + "live_anchor_xors": 173 + }, + "dirty_basis_vectors": 40615, + "complete_dirty_basis_both_orientations": true, + "all_physical_frame_inclusions": true, + "seconds": 509.3006043434143 + }, + "word_sha256": "0920e11cb3a52ed892a834f97fcb6af96d34e44190e6d67e11b94f6b7be2ffde", + "gzip_sha256": "aa67a24ccd38597fece6f267ad48b98676fef0f2755ea917481fc7d355d35097", + "source_engine_sha256": "58f13f82ce1bb7f2b5549e17628bc6034e5e05cb24db2acb9a91c24820872f70", + "local_engine_sha256": "4c9e87d1eb173e053a1a4d8f0895d7d3f1a2a30b28441533df656672d9ddf3b8", + "runner_sha256": "ac40f56ca3ad426197770877e366256bd1a7676920368b00c1d4f09386a7ce11", + "graph_source_sha256": "9d4ee7179f880f9576e81c7ad3a5290fe61380a7531d559ef3cf0939bb30089c", + "oracle_source_sha256": "d1f6b650de9fb5842b412595369271d9eeb6f54045c76c0fb5cad29854955c35", + "elapsed_seconds": 515.8501269999833, + "scope": "proposal with full compiler dirty basis both orientations; independent paid profile and assembly required", + "no_global_optimality_claim": true +} diff --git a/research/current-record-circuits/source/engine-circuits-5c0f31cf1182.py b/research/current-record-circuits/source/engine-circuits-5c0f31cf1182.py new file mode 100644 index 0000000000..1c0cb12fd1 --- /dev/null +++ b/research/current-record-circuits/source/engine-circuits-5c0f31cf1182.py @@ -0,0 +1,306 @@ +# Composition of PR67 profile-cost reclamation and PR68 pending live controls. +# Next-use transition scoring added by Chafik Boukhalfa with OpenAI Codex 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('C:\\Users\\Propietario\\Documents\\Codex\\2026-10-08\\i-x20\\work\\current-record\\pr71\\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. + from fractions import Fraction as Q + alpha=Q(12854322426487,250000000000000000) + def moment_weight(t): + z=alpha*sum(logs(Q(575,t)))/2 + term=Q(1);excess=Q() + for j in range(1,19):term=term*z/j;excess+=term + value=t*excess*10**30 + return -(value.numerator//value.denominator) + weights=[0]+[moment_weight(t)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 + endpoint=pending[a]+2 if PENDING_COST and a in pending else 1 + return profile_entropy(old,endpoint)-profile_entropy(old,target)-profile_entropy(target,endpoint) + def acquire(g,anchors): + if reclaim: + bb={};circuits=[];candidates=[] + def ins(s): + row=slots[s];expr=1<>s&1;candidates.append((s,e));circuits.append(e) + circuits=sorted(set(circuits),key=lambda e:(e.bit_count(),e))[:64] + prices={} + def price(s): + if s not in prices:prices[s]=profile_cost(s,g) + return prices[s] + def bits(e): + out=[] + while e: + bit=e&-e;out.append(bit.bit_length()-1);e^=bit + return out + expanded=[(e,bits(e))for e in circuits] + best=None + for s,e in candidates: + cost=sum(price(z)for z in bits(e));count=e.bit_count() + for phase in range(2): + changed=False + for circuit,zz in expanded: + if circuit>>s&1:continue + delta=sum((-price(z)if e>>z&1 else price(z))for z in zz) + alternative=e^circuit;newcount=alternative.bit_count() + if (cost+delta,newcount)<(cost,count):e=alternative;cost+=delta;count=newcount;changed=True;stats['zero_circuit_toggles']+=1 + if not changed:break + aa=bits(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<>s&1;candidates.append((s,e));circuits.append(e) + circuits=sorted(set(circuits),key=lambda e:(e.bit_count(),e))[:64] + prices={} + def price(s): + if s not in prices:prices[s]=profile_cost(s,g) + return prices[s] + def bits(e): + out=[] + while e: + bit=e&-e;out.append(bit.bit_length()-1);e^=bit + return out + expanded=[(e,bits(e))for e in circuits] + best=None + for s,e in candidates: + cost=sum(price(z)for z in bits(e));count=e.bit_count() + for phase in range(2): + changed=False + for circuit,zz in expanded: + if circuit>>s&1:continue + delta=sum((-price(z)if e>>z&1 else price(z))for z in zz) + alternative=e^circuit;newcount=alternative.bit_count() + if (cost+delta,newcount)<(cost,count):e=alternative;cost+=delta;count=newcount;changed=True;stats['zero_circuit_toggles']+=1 + if not changed:break + aa=bits(e^(1<=0: + stats['declined_unfavourable_reclaims']+=1 + return new(g) + _,s,aa=best''' + assert text.count(needle)==1;text=text.replace(needle,gate) + directory=HERE/a.strategy/f'h{a.h}';directory.mkdir(parents=True,exist_ok=True) + compiler_path=HERE/f'engine-{a.strategy}-{hashlib.sha256(text.encode()).hexdigest()[:12]}.py' + if compiler_path.exists():assert compiler_path.read_text()==text + else:compiler_path.write_text(text) + sys.path.insert(0,str(UPSTREAM/'scripts/experiments')) + compiler=load('local71_engine_'+a.strategy,compiler_path) + producer=load('local71_producer',UPSTREAM/'scripts/experiments/split_pair_graph.py') + compiler.graph=producer.graph;compiler.build=producer.ordered_build(compiler.build,a.h);compiler.PENDING_COST=True + cache=HERE/f'matching-h{a.h}.json';native_match=compiler.match + def carry_exchange(blocks,uses,edges,chosen,right,stats): + if a.strategy!='carry':return edges,chosen,right,stats + from binary_frame_math import logs + alpha=Q(12854322426487,250000000000000000) + def weight(t): + z=alpha*sum(logs(Q(575,t)))/2;term=Q(1);total=Q() + for j in range(1,19):term=term*z/j;total+=term + value=t*total*10**30;return value.numerator//value.denominator + weights=[0]+[weight(t)for t in range(1,a.h+1)];prices={} + oracle_file=HERE/f'pair-profiles-h{a.h}.jsonl' + for line in oracle_file.read_text().splitlines(): + d=json.loads(line);assert sum(t*n for t,n in enumerate(d['blocks']))==d['rank'];prices[d['a'],d['b']]=sum(n*w for n,w in zip(d['blocks'],weights)) + owner={x:g for g,b in enumerate(blocks)for x in b['nodes']} + def price(g,t): + rank_g=0 if g==0 else(a.h if g==1 else blocks[g-2]['rank']);rank_t=0 if t==0 else(a.h if t==1 else blocks[t-2]['rank']) + if rank_g==rank_t:return 0 + return prices[g,t] + costs=[] + for g,u,i in edges: + producer=owner[blocks[g]['inputs'][i]];target=uses[u][1] + costs.append(price(g+2,target+2)-price(g+2,1)-price(0,producer+2)-price(producer+2,target+2)) + priority=sorted(range(len(edges)),key=lambda e:(costs[e],edges[e]));initial=sum(costs[e]for e in chosen) + def can(e,drop=None): + g,u,i=edges[e];rows=blocks[g]['outbasis']+[1<=costs[f]or not can(e,f if edges[f][0]==g else None):continue + else: + f=next((z for z in sorted(blocks[g]['selected'],key=lambda z:(-costs[z],z))if costs[e]>s&1;candidates.append((s,e));circuits.append(e) + circuits=sorted(set(circuits),key=lambda e:(e.bit_count(),e))[:64] + prices={} + def price(s): + if s not in prices:prices[s]=profile_cost(s,g) + return prices[s] + def bits(e): + out=[] + while e: + bit=e&-e;out.append(bit.bit_length()-1);e^=bit + return out + expanded=[(e,bits(e))for e in circuits] + best=None + for s,e in candidates: + cost=sum(price(z)for z in bits(e));count=e.bit_count() + for phase in range(2): + changed=False + for circuit,zz in expanded: + if circuit>>s&1:continue + delta=sum((-price(z)if e>>z&1 else price(z))for z in zz) + alternative=e^circuit;newcount=alternative.bit_count() + if (cost+delta,newcount)<(cost,count):e=alternative;cost+=delta;count=newcount;changed=True;stats['zero_circuit_toggles']+=1 + if not changed:break + aa=bits(e^(1<=0: + stats['declined_unfavourable_reclaims']+=1 + return new(g) + _,s,aa=best''' + assert text.count(needle)==1;text=text.replace(needle,gate) + directory=HERE/a.strategy/f'h{a.h}';directory.mkdir(parents=True,exist_ok=True) + compiler_path=HERE/f'engine-{a.strategy}-{hashlib.sha256(text.encode()).hexdigest()[:12]}.py' + if compiler_path.exists():assert compiler_path.read_text()==text + else:compiler_path.write_text(text) + sys.path.insert(0,str(UPSTREAM/'scripts/experiments')) + compiler=load('local71_engine_'+a.strategy,compiler_path) + producer=load('local71_producer',UPSTREAM/'scripts/experiments/split_pair_graph.py') + compiler.graph=producer.graph;compiler.build=producer.ordered_build(compiler.build,a.h);compiler.PENDING_COST=True + cache=HERE/f'matching-h{a.h}.json';native_match=compiler.match + def cached_match(blocks,uses,enabled): + expected=[(g,u,i)for g,b in enumerate(blocks)for u,i in b['candidates']] + if enabled and cache.exists(): + data=json.loads(cache.read_text());assert data['source_pin']==PIN;edges=list(map(tuple,data['edges']));assert edges==expected + chosen=set(data['chosen']);right={} + for e in chosen: + g,u,i=edges[e];blocks[g]['selected'].add(e);assert u not in right;right[u]=e + for g,b in enumerate(blocks):assert len(compiler.basis(b['outbasis']+[1<=F + total+=multiplicity*rounded + rows.append(dict(width=width,multiplicity=multiplicity,log_upper=str(log_upper),v=str(v), + F_upper=str(F),rounded_F_upper_numerator=rounded,rounding_scale=scale, + rounding_slack=str(Q(rounded,scale)-F))) + denominator=m*W*scale;upper=Q(total,denominator) + assert upper<1 and len(d['assembly']['constraints'])==47 + result=dict(status='exact_weighted_F_rounding_and_47_slacks_passed',upper_enclosure_kind='taylor8_tail',source_commit=d['source']['commit'], + source_certificate_sha256=d['source']['files']['certificates/split-pair-kappa.json'], + refined_certificate_sha256=sha256(candidate.read_bytes()).hexdigest(),m=m,W=W,total_rank=d['bit']['total_rank'], + bit_saving=d['bit_saving'],kappa=d['kappa'],rows=rows,weighted_upper_numerator=total, + weighted_upper_denominator=denominator,rounded_moment_upper=str(upper),rounded_moment_gap=str(1-upper), + named_slacks=d['assembly']['constraints'],named_margins=d['assembly']['margins'],parameters=d['assembly']['parameters'], + comparison=dict(old_published_kappa=d['comparison']['baseline71_kappa'],old_bit_saving=d['comparison']['baseline71_bit_saving'], + old_formal_scoped_limit=d['comparison']['baseline71_scoped_limit'],exceeds_old_scoped_limit=Q(d['kappa'])>Q(d['comparison']['baseline71_scoped_limit']), + parameter_only=False,new_producer_claim=False,new_compiler_word_claim=True, + baseline71_network_at_new_saving_lower=d['comparison']['baseline71_network_at_new_saving_lower'], + baseline71_network_rejected_at_new_saving=d['comparison']['baseline71_network_rejected_at_new_saving']), + scope='New profile-aware compiler words on the pinned PR71 graph; fresh full word/basis/frame/profile validation, inherited data geometry and all-size interfaces.') + output.parent.mkdir(parents=True,exist_ok=True);output.write_text(json.dumps(result,indent=2)+'\n') + print('PASS weighted rows',len(rows),'moment gap',float(1-upper),'kappa',d['kappa']) + + +if __name__=='__main__': + p=argparse.ArgumentParser(description=__doc__);p.add_argument('candidate',type=Path);p.add_argument('output',type=Path) + a=p.parse_args();export(a.candidate,a.output) diff --git a/research/current-record-circuits/verification/frozen-sources.json b/research/current-record-circuits/verification/frozen-sources.json new file mode 100644 index 0000000000..b928bce631 --- /dev/null +++ b/research/current-record-circuits/verification/frozen-sources.json @@ -0,0 +1,25 @@ +{ + "commit": "1bef94fd40a746452548c84a4a8f8834670a3113", + "native_certificate": "certificates/split-pair-kappa.json", + "files": { + "certificates/split-pair-kappa.json": "0fcb53fa374273efab6370953c966e8fa065dbfdba43691843a4788cb2cda42e", + "certificates/split-pair-compiler.json": "6561fab8609e8aa3a291a8197cd8b834b0881ee0b9a5b991926c2c93c4d5f884", + "scripts/experiments/split_pair_graph.py": "9d4ee7179f880f9576e81c7ad3a5290fe61380a7531d559ef3cf0939bb30089c", + "scripts/experiments/split_pair_engine.py": "58f13f82ce1bb7f2b5549e17628bc6034e5e05cb24db2acb9a91c24820872f70", + "scripts/experiments/binary_frame_replay.py": "392e78e62d7685c99a5888a7da743ea6c3dcad631af4a743c91e0c09348442bc", + "scripts/experiments/binary_frame_profile_prepare.py": "8a50381cab00b33e62b3a057d199ba5e19647929135c95b0fd63fc8a8ef7c9b3", + "scripts/experiments/binary_frame_profiles.cpp": "8e2e391d3ee57cbb1372c68e4aa031e1b861321536eabd642ada54e12e678669", + "scripts/experiments/binary_frame_math.py": "1f96e8aafc8ae89f8eeec5d03800131d93d58e01bf8a7fca8feb03702d1740d0", + "references/frame-compiler/pr48/scripts/partial_swap/binary_io.hpp": "7e143eb75bb342ac8f0c82a60005e7c35c9ec827de479bf6fb773151f3af5fa1", + "references/frame-compiler/pr48/research/copied-fixed/balanced_assembly.py": "4d27575dcad2b45a281a34054d311409ecd954f373c0c3a62c29bcc843f06a86", + "references/frame-compiler/pr48/research/copied-fixed/certificate.json": "33b3373c04e18a7f4cee33ba68da6ed71934acc3e0179cca6197696be4befa22" + }, + "verification_adapter_files": { + "verify_words.py": "1f5b87f98a7b59c35b71f9453deab7861cf805070198ede310cebda535d88f9b", + "batch_axes.py": "cba8d8d2ce2babf4e9ff512af4e07df9a2574a15c4b1748e437a83977aa3359e", + "screen_axes.py": "bf06809c44e26883fcc93aa2dbf98fdf1951742b83ded161e725a84b3d616f98", + "check_guards.py": "e3fc1be56f80de10c6c5e6dea2713ec42e95cae4f2d5e0fe57846672dd58e44e", + "export_weighted_case.py": "51357229ef731f15b0cb8f5d96dc1a82668fdbeca31e3ad0f491430584193586" + }, + "attribution": "PR71 Chafik Boukhalfa; PR68 live anchors Dominik Scholz; PR67 profile cost Rohan Arun; PR62 graph Avi Eisenberg; PR57 compiler eumemic; inherited source notices remain." +} diff --git a/research/current-record-circuits/verification/screen_axes.py b/research/current-record-circuits/verification/screen_axes.py new file mode 100644 index 0000000000..75d6d24858 --- /dev/null +++ b/research/current-record-circuits/verification/screen_axes.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python3 +"""Search-only exact profile screening; full source/dirty replay is omitted. + +An accepted final candidate must subsequently run verify_words.py with its +actual words. This screen checks the literal frame-event correspondence and +exact fixed profiles, then ranks equal-role axes at one exact saving. +""" +import argparse +from concurrent.futures import ProcessPoolExecutor, as_completed +from fractions import Fraction as Q +import json +from pathlib import Path +import subprocess +import sys +from verify_words import check_source,load_module + + +def run_one(job): + name,h,word,out,profiler,upstream=job + sys.dont_write_bytecode=True + output=Path(out);output.mkdir(parents=True,exist_ok=True) + prepare=load_module('screen_prepare',Path(upstream)/'scripts/experiments/binary_frame_profile_prepare.py').prepare + transitions=output/'transitions.bin' + prepared=prepare(Path(word),transitions) + subprocess.run([profiler,str(transitions)],check=True,capture_output=True) + profile=json.loads(Path(str(transitions)+'.profiles.json').read_text()) + assert profile['h']==h and profile['crt_disagreements']==0 + assert profile['rank_sum']==h*profile['R']+h*(h-1) + receipt=dict(status='PROFILE SCREEN ONLY; full source/target/dirty replay not performed', + prepared=prepared,profile=profile,word=str(word)) + (output/'screened-axis.json').write_text(json.dumps(receipt,indent=2)+'\n') + return name,h,str(output/'screened-axis.json'),receipt + + +def main(): + p=argparse.ArgumentParser(description=__doc__) + p.add_argument('--upstream',type=Path,required=True);p.add_argument('--base',type=Path,required=True) + p.add_argument('--output',type=Path,required=True);p.add_argument('--profiler',type=Path,required=True) + p.add_argument('--saving',type=Q,required=True);p.add_argument('--workers',type=int,default=3) + a=p.parse_args();a.output.mkdir(parents=True,exist_ok=True) + check_source(a.upstream.resolve()) + math=load_module('screen_math',a.upstream.resolve()/'scripts/experiments/binary_frame_math.py') + jobs=[] + for directory in sorted(a.base.iterdir()): + for h in (23,25): + word=directory/f'h{h}'/'word.json.gz' + if word.exists():jobs.append((directory.name,h,str(word.resolve()),str((a.output/directory.name/f'h{h}').resolve()),str(a.profiler.resolve()),str(a.upstream.resolve()))) + rows=[] + with ProcessPoolExecutor(max_workers=a.workers) as pool: + futures=[pool.submit(run_one,j) for j in jobs] + for f in as_completed(futures): + name,h,path,receipt=f.result();price=Q() + for t,n in enumerate(receipt['profile']['blocks']): + if t and n: + v=a.saving*math.logs(Q(575,t))[1] + price+=n*t*(1+v+v*v/(2*(1-v/3))) + rows.append(dict(name=name,h=h,receipt=path,R=receipt['profile']['R'], + word=receipt['word'],fixed_saving=str(a.saving),exact_internal_upper_price=str(price))) + ordered=sorted(rows,key=lambda r:(r['h'],Q(r['exact_internal_upper_price']))) + (a.output/'ranking.json').write_text(json.dumps(ordered,indent=2)+'\n') + print('SCREEN',name,h,float(price),flush=True) + print('PASS profile-only screens',len(rows),'full final replay remains required',flush=True) + + +if __name__=='__main__':main() diff --git a/research/current-record-circuits/verification/verify_words.py b/research/current-record-circuits/verification/verify_words.py new file mode 100644 index 0000000000..e6a1375e09 --- /dev/null +++ b/research/current-record-circuits/verification/verify_words.py @@ -0,0 +1,254 @@ +#!/usr/bin/env python3 +"""Fresh literal-word replay, exact fixed-I+J profiling, and rational assembly. + +Research adapter to pinned PR71, 1bef94fd40a746452548c84a4a8f8834670a3113. +The input/data geometry and all-size analytic/compiler/tape arguments are +inherited. Every supplied changed XOR word and its actual frame path is replayed. +No external network access and no mutation of the frozen source checkout. +""" +from __future__ import annotations +import argparse +from collections import Counter +from copy import deepcopy +from fractions import Fraction as Q +from hashlib import sha256 +import importlib.util +from itertools import combinations +import json +import gzip +from math import comb, factorial +from pathlib import Path +import subprocess +import sys +import time + +if sys.flags.optimize: + raise RuntimeError('Run the verification without Python -O/-OO; assertion checks are required.') + +HERE = Path(__file__).resolve().parent +PIN = '1bef94fd40a746452548c84a4a8f8834670a3113' +NATIVE_CERTIFICATE = 'certificates/split-pair-kappa.json' + + +def directed_moment(arithmetic,m,W,rows,saving): + """Exact positive Taylor8 lower and geometric-tail upper enclosures.""" + if type(saving) is not Q or not 00 and d['h'] in (23,25) + # Explicit bounds avoid Python's negative-index interpretation of a word. + assert all(type(s) is int and 0<=s0 for t,n in rows.items()) + return dict(m=m,N=N,W=W,L=L,total_rank=mass,deficit=m*W-mass,maxchild=max(rows), + child_multiplicities=dict(sorted(rows.items())),parts=parts,axes=profiles) + + +def choose_saving(p, arithmetic, denominator): + # Optimize the exact *upper enclosure*, not a floating logarithm or root. + lo,hi=0,denominator//10000 + rows=p['child_multiplicities'] + while lo+10 + return Q(lo,denominator) + + +def compose(p, upstream, arithmetic, saving, kappa, h, denominator): + old=upstream/'references/frame-compiler/pr48/research/copied-fixed' + balanced=load_module('balanced_candidate_arithmetic',old/'balanced_assembly.py') + prior=json.loads((old/'certificate.json').read_text()) + bridge=deepcopy(prior['finite_bridge']) + bridge['bit'].update(W=p['W'],maxchild=p['maxchild'],m=p['m'],wire_bits=p['W'].bit_length(), + halving_degree=balanced.halving_degree(p['m'],p['maxchild'])) + coefficient=sum(bridge[name]['halving_degree']*bridge[name]['wire_bits'] for name in ('bit','complex')) + bridge['rows'].update(coefficient=coefficient,degree_gap=str(Q(bridge['rows']['degree'])-Q(51,25)*coefficient)) + assert Q(bridge['rows']['suffix_slope'])==4*Q(bridge['rows']['degree']) + moment=arithmetic.moment(p['m'],p['W'],p['child_multiplicities'],saving) + assert moment['upper']<1 + if kappa is None: + q=saving*(1-2*h) + control=(1-h)*q/(1+q) + scaled=control*denominator + floor=scaled.numerator//scaled.denominator + # The floor is already strictly below a nonintegral rational control. + # Back off one grid point only if the control itself lies on the grid. + kappa=Q(floor-(scaled.denominator==1),denominator) + assembled=balanced.assembly(bridge,saving,kappa,h=h,a_complex=Q(717,10**7)) + assert len(assembled['constraints'])==47 and len(assembled['margins'])==7 + assert all(v>0 for v in assembled['constraints'].values()) + frozen=json.loads((upstream/NATIVE_CERTIFICATE).read_text()) + frozen_ab=Q(frozen['bit_saving']); frozen_kappa=Q(frozen['kappa']) + prior_rows={int(t):n for t,n in frozen['bit']['child_multiplicities'].items()} + prior_moment=arithmetic.moment(frozen['bit']['m'],frozen['bit']['W'],prior_rows,saving) + return dict(status='PASS exact characteristic upper enclosure, all 47 strict constraints and seven margins', + bit_saving=saving,kappa=kappa,explicit_h=h,bit=dict(p,moment=moment),assembly=assembled, + finite_bridge=bridge,eventual_bounds=balanced.cutoffs(bridge,assembled), + exactness=[arithmetic.exactness(x) for x in (23,25)], + comparison=dict(baseline71_bit_saving=frozen_ab,baseline71_kappa=frozen_kappa, + kappa_gain=kappa-frozen_kappa,roles_baseline71=[27455,36015], + baseline71_refined_kappa=frozen_kappa, + baseline71_scoped_limit=frozen_ab/(1+frozen_ab), + kappa_gain_above_refined=kappa-frozen_kappa, + baseline71_network_at_new_saving_lower=prior_moment['lower'], + baseline71_network_rejected_at_new_saving=prior_moment['lower']>1), + scope='Fresh changed-word/full-basis/frame/profile/CRT and rational arithmetic validation. ' + 'Unchanged 4,073,300-pair data geometry and its recovered rational cases inherited from PR71; ' + 'all-size analytic log/exp enclosure, compiler/frame transfer, finite-alphabet tape, routing, ' + 'prime-selection/recovery and eventual setup arguments remain conditional.') + + +def main(): + parser=argparse.ArgumentParser(description=__doc__) + parser.add_argument('--upstream',type=Path,required=True) + parser.add_argument('--profiler',type=Path,default=HERE/'frame-profiles.exe') + parser.add_argument('--word23',type=Path) + parser.add_argument('--word25',type=Path) + parser.add_argument('--receipt23',type=Path,help='Previously fresh verified-axis.json for inexpensive recomposition') + parser.add_argument('--receipt25',type=Path) + parser.add_argument('--output',type=Path,required=True) + parser.add_argument('--axis-only',action='store_true') + parser.add_argument('--saving',type=Q) + parser.add_argument('--kappa',type=Q) + parser.add_argument('--h',type=Q,default=Q(1,10**18)) + parser.add_argument('--denominator',type=int,default=10**19) + args=parser.parse_args() + sys.dont_write_bytecode=True + upstream=args.upstream.resolve(); args.output.mkdir(parents=True,exist_ok=True) + source=check_source(upstream) + arithmetic=load_module('exact_candidate_math',upstream/'scripts/experiments/binary_frame_math.py') + # The tighter source71 directed envelope avoids losing its near-root gap. + # The source logarithm enclosure and exactness proofs are retained verbatim. + arithmetic.moment=lambda m,W,rows,saving:directed_moment(arithmetic,m,W,rows,saving) + axes=[] + for h,word,cached in [(23,args.word23,args.receipt23),(25,args.word25,args.receipt25)]: + assert not (word is not None and cached is not None) + if word is not None: + axes.append(axis(word.resolve(),args.output/f'h{h}',args.profiler.resolve(),upstream)) + elif cached is not None: + receipt=json.loads(cached.read_text()) + assert receipt['status'].startswith('PASS fresh full') and receipt['profile']['h']==h + receipt['reused_verified_receipt_sha256']=sha256(cached.read_bytes()).hexdigest() + axes.append(receipt) + if args.axis_only: + return + assert len(axes)==2 + p=collect(axes,arithmetic) + saving=args.saving or choose_saving(p,arithmetic,args.denominator) + result=compose(p,upstream,arithmetic,saving,args.kappa,args.h,args.denominator) + result['source']=source + result['fresh_word_receipts']=axes + result['verifier_sha256']=sha256(Path(__file__).read_bytes()).hexdigest() + (args.output/'candidate-certificate.json').write_text(json.dumps(arithmetic.js(result),indent=2,sort_keys=True)+'\n') + print('PASS kappa',str(result['kappa']),float(result['kappa']),'W',p['W'],'saving',str(saving),flush=True) + + +if __name__=='__main__': + main() diff --git a/research/current-record-circuits/words/word-23.json.gz b/research/current-record-circuits/words/word-23.json.gz new file mode 100644 index 0000000000..36bb8fe0f2 Binary files /dev/null and b/research/current-record-circuits/words/word-23.json.gz differ diff --git a/research/current-record-circuits/words/word-25.json.gz b/research/current-record-circuits/words/word-25.json.gz new file mode 100644 index 0000000000..5534acdae0 Binary files /dev/null and b/research/current-record-circuits/words/word-25.json.gz differ diff --git a/research/profile-aware-frame-search/.gitattributes b/research/profile-aware-frame-search/.gitattributes new file mode 100644 index 0000000000..2a8b0d921c --- /dev/null +++ b/research/profile-aware-frame-search/.gitattributes @@ -0,0 +1,2 @@ +* -text +*.gz binary diff --git a/research/profile-aware-frame-search/.gitignore b/research/profile-aware-frame-search/.gitignore new file mode 100644 index 0000000000..0606aa495a --- /dev/null +++ b/research/profile-aware-frame-search/.gitignore @@ -0,0 +1,5 @@ +.lake/ +*.olean +*.ilean +__pycache__/ +work/ diff --git a/research/profile-aware-frame-search/README.md b/research/profile-aware-frame-search/README.md new file mode 100644 index 0000000000..a8df2455c9 --- /dev/null +++ b/research/profile-aware-frame-search/README.md @@ -0,0 +1,67 @@ +# Profile-aware frame compilation on frozen PR62 + +New conditional κ **5.10403292611078e-5**, exact `255201646305539/5000000000000000000`, above the strongest frozen #62 +stacked witness `5101691/10^11` by approximately **0.0459048991%**. +The new ideas are complete-profile pricing of retired dependency circuits and +bounded admissible carried-signal exchanges. Coordinate/basis and complement +variants are also explored. The accepted result changes literal compiler words +and actual child profiles; it is not another parameter-only refinement. + +The original62 complete profile has exact lower moment >1 at the new bit saving, +and the new complete profile has exact upper moment <1. All47 strict assembly +conditions and seven margins pass. **53 Lean endpoints** pass:34 new universal, +15 concrete,4 reused rational-helper lemmas. No omitted proof, project axiom or +native decision shortcut. The math scope includes dirty-word/complement safety, +coordinate conjugacy, fresh-kernel clearing, actual finite rounding and old-profile +rejection. It does not formalize the Python/C++ compiler or the all-size theorem. + +## Reproduce the accepted words + +Use an external checkout of frozen PR62 commit +`ad0f25ff7b23cff7f08ad237c2254e6ecf74257e`. No newer sources are consumed. +See `verification/README.md` to compile its exact C++17 profiler, then run: + +``` +python verification/verify_words.py --upstream UPSTREAM --profiler PROFILER --word23 words/word-23.json.gz --word25 words/word-25.json.gz --output work/recheck +python verification/check_guards.py words/word-23.json.gz +python verification/check_guards.py words/word-25.json.gz +cd math +lake build Frozen62Research +``` + +The verifier checks immutable sources and its own adapter hashes, full input/dirty +bases in both orientations, exact source/scatter inventory, every literal frame +transition and all fixed-I+J profiles with bounded-minor and CRT checks. It rejects +optimized Python assertion mode. Use the supplied words for authoritative replay; +floating discovery prices propose candidates and have no trusted-proof role. +Discovery source snapshots, exact oracle fixtures (gzip-compressed) and matching +seeds retain original byte hashes. `discovery/SEARCH.md` explains the algorithms, +heuristic boundary and experimental commands. Historical workspace paths in the +source-generation receipts identify the original run; the accepted-word replay +uses the explicit upstream argument and needs no private directory layout. +Portable discovery regeneration: + +``` +python discovery/regenerate_portable.py --upstream UPSTREAM --work work/regenerate +``` + +This rewrites workspace paths only and checks both raw words and deterministic +gzip against the accepted words. Floating discovery is outside the trusted +certificate; the independent word/profile verifier establishes acceptance. + +The one-hour session froze information through #62. The unchanged data geometry +and its rational recovery are inherited; selected physical words/profile checks +are fresh. All-size analytic, compiler/frame transfer, finite-alphabet tape, +routing, prime selection/recovery and eventual-threshold contracts remain +conditional. No practical runtime or global-optimality claim is made. + +Alejandro Zarzuelo Urdiales is the human author/developer, following earlier +Archivara and personal July/October matrix/parity work developed with multiple +AI tools. This synthesis involved substantial OpenAI Codex assistance. Known +linear algebra, matroid exchange, dirty uncomputation and concavity principles +retain prior-work status. The finite construction credits Avi Eisenberg/ikeboy +(#62 interval/core-aware graph), eumemic (#57 frame compiler), Chafik Boukhalfa +(#60 ranking and earlier exact profiling), Rohan Arun and other retained notices. +The prior matrix/parity source is in `../matrix-exponent-synthesis/` and prior +Gaussian work in PR45. Its product counts retain their separate arithmetic scope. +The paper is supplied as LaTeX source; no newly compiled PDF is claimed. diff --git a/research/profile-aware-frame-search/candidate-certificate.json b/research/profile-aware-frame-search/candidate-certificate.json new file mode 100644 index 0000000000..5e90b23f9f --- /dev/null +++ b/research/profile-aware-frame-search/candidate-certificate.json @@ -0,0 +1,1002 @@ +{ + "assembly": { + "absorption_gap": "96288141846284528390544381602176327/1041719836390113845520726993886438975625000000000000000", + "constraints": { + "K_dominates_log": "85071557515486583078118660786874416836809781697639/1666751738224182152833163190218302361000000000000000000", + "K_geometry": "1250085071557515486583163190218302361/1666751738224182152833163190218302361000000000000000000", + "a_below_b": "206570654907083/10000000000000000000", + "a_positive": "510429345092917/10000000000000000000", + "alpha_below_one": "3333333333333333331666751738224182152833163190218302361/3333503476448364305666326380436604722000000000000000000", + "alpha_below_one_fourth": "833205725997060102417006952896728611333163190218302361/3333503476448364305666326380436604722000000000000000000", + "alpha_positive": "170143115030973999574642212422569166836809781697639/3333503476448364305666326380436604722000000000000000000", + "artificial_boundary": "93338777913014324466322699388643897562499489570654907083/13334013905793457222665305521746418888000000000000000000", + "b_below_one_over32": "311783/10000000", + "beta_below_one": "19/20", + "beta_positive": "1/20", + "c_below_one": "4999744785327453540250510429345092917/5000000000000000000000000000000000000", + "c_positive": "255214672546459749489570654907083/5000000000000000000000000000000000000", + "cell_above_band": "3333333333333333328333248261775817847166836809781697639/6667006952896728611332652760873209444000000000000000000", + "compact_leaf": "85360327453541500510429345092917/5000000000000000000000000000000000000", + "compact_reservations": "1/4000000000000000000", + "delta_below_one_eighth": "999999999999999999/8000000000000000000", + "delta_positive": "1/8000000000000000000", + "epsilon_below_one": "85071557515487833163190218302361/1666751738224182152833163190218302361", + "epsilon_positive": "1666666666666666665000000000000000000/1666751738224182152833163190218302361", + "g1_above_kappa": "9104063825891186991290171003908922421/8333758691120910764165815951091511805000000000000000000", + "g2_above_kappa": "26052481839/10000000000000000000", + "g3_above_kappa": "96288141846284528390544381602176327/1041719836390113845520726993886438975625000000000000000", + "g4_above_kappa": "26052481839/10000000000000000000", + "g5_above_kappa": "31163717151524942109492288275813820343/66670069528967286113326527608732094440000000000000000000", + "g6_above_kappa": "64498751916008585166155552080179867563/66670069528967286113326527608732094440000000000000000000", + "g7_above_kappa": "8332907975545755894938247874799675186290171003908922421/8333758691120910764165815951091511805000000000000000000", + "gamma_sublinear": "1/2000000000000000000", + "guard_width": "85071557515487833163190218302361/1666751738224182152833163190218302361", + "lambda_above_internal": "510429345092917/10000000000000000000000000000000000000", + "lambda_above_sigma": "206570654907083000510429345092917/10000000000000000000000000000000000000", + "lambda_above_tau": "510429345092917/10000000000000000000000000000000000000", + "lambda_prime_above_lambda": "510429345092917/10000000000000000000000000000000000000", + "lambda_prime_below_one": "255214672546458499489570654907083/5000000000000000000000000000000000000", + "literal_scalar_guard": "9693793493753822316795466474748", + "phase_boundary": "136114492024778866309366125101624766836809781697639/2666802781158691444533061104349283777600000000000000000", + "phase_leaf_above_bit": "170720654907083/10000000000000000000", + "phase_local": "680572460123900998553783522236735166836809781697639/13334013905793457222665305521746418888000000000000000000", + "prime_interval_packing": "85071557515487833163190218302361/1666751738224182152833163190218302361", + "q_below_internal": "510429345092917/5000000000000000000000000000000000000", + "q_below_leaf": "85360327453541500510429345092917/5000000000000000000000000000000000000", + "q_below_reservations": "1/4000000000000000000", + "q_positive": "255214672546458499489570654907083/5000000000000000000000000000000000000", + "record_suffix": "85071557515487833163190218302361/1666751738224182152833163190218302361", + "row_product_gap": "6548/25", + "short_record_fallback": "16665815907668492399669308102285443962494717302454522963/16667517382241821528331631902183023610000000000000000000", + "small_field_exposure": "1/1000000000000000000" + }, + "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": "85071557515487833163190218302361/1666751738224182152833163190218302361", + "g2": "510429345092917/10000000000000000000", + "g3": "85071557515486166411451994120208166836809781697639/1666751738224182152833163190218302361000000000000000000", + "g4": "510429345092917/10000000000000000000", + "g5": "136114492024778866309366125101624766836809781697639/2666802781158691444533061104349283777600000000000000000", + "g6": "680572460123900998553783522236735166836809781697639/13334013905793457222665305521746418888000000000000000000", + "g7": "1666666666666666665000000000000000000/1666751738224182152833163190218302361" + }, + "minimum_margin": "85071557515486166411451994120208166836809781697639/1666751738224182152833163190218302361000000000000000000", + "parameters": { + "C0": 2358858462850846165593256368932965330169899180021667007021321420800, + "C1": "1", + "a_bit": "510429345092917/10000000000000000000", + "a_complex": "717/10000000", + "alpha_squared_power": "170143115030973999574642212422569166836809781697639/3333503476448364305666326380436604722000000000000000000", + "beta": "1/20", + "c": "255214672546459749489570654907083/5000000000000000000000000000000000000", + "delta": "1/8000000000000000000", + "epsilon": "1666666666666666665000000000000000000/1666751738224182152833163190218302361", + "h": "1/1000000000000000000", + "kappa": "255201646305539/5000000000000000000", + "lambda_": "9999489570654907083000510429345092917/10000000000000000000000000000000000000", + "lambda_prime": "4999744785327453541500510429345092917/5000000000000000000000000000000000000", + "q": "255214672546458499489570654907083/5000000000000000000000000000000000000", + "sigma": "9999283/10000000", + "tau": "9999489570654907083/10000000000000000000" + }, + "recurrence": { + "internal": "9999489570654907083/10000000000000000000", + "leaf": "199986377/200000000", + "reservations": "4999744785327453540250510429345092917/5000000000000000000000000000000000000" + }, + "scoped_limit": "510429345092917/10000510429345092917" + }, + "bit": { + "L": 2226400, + "N": 4073300, + "W": 137151806, + "axes": [ + { + "R": 27918, + "blocks": [ + 0, + 343078, + 17009, + 10306, + 5888, + 4186, + 3942, + 3636, + 2900, + 2259, + 1834, + 1693, + 1276, + 1072, + 720, + 590, + 352, + 193, + 114, + 0, + 45, + 23, + 0, + 0 + ], + "crt_disagreements": 0, + "crt_matrices": 6049, + "distinct_matrices": 36659, + "field_prime": 2305843009213693951, + "frames": 52475, + "h": 23, + "loss": 506, + "rank_sum": 642620, + "v": 1771 + }, + { + "R": 36586, + "blocks": [ + 0, + 473550, + 25167, + 11781, + 6968, + 5725, + 5584, + 4899, + 3848, + 3176, + 2717, + 2644, + 1932, + 1645, + 1364, + 1130, + 718, + 578, + 374, + 179, + 113, + 0, + 55, + 25, + 0, + 0 + ], + "crt_disagreements": 0, + "crt_matrices": 8127, + "distinct_matrices": 50642, + "field_prime": 2305843009213693951, + "frames": 73697, + "h": 25, + "loss": 600, + "rank_sum": 915250, + "v": 2300 + } + ], + "child_multiplicities": { + "1": 1721422350, + "10": 9030007, + "11": 8576424, + "12": 6356372, + "13": 5378895, + "14": 4071644, + "15": 3358230, + "16": 2081178, + "17": 9614138, + "18": 924554, + "19": 317009, + "2": 83691457, + "20": 303623, + "21": 16346100, + "22": 97405, + "23": 72402275, + "25": 64793806, + "3": 44567951, + "4": 25882728, + "481": 8146600, + "5": 19766775, + "525": 64793806, + "529": 64211400, + "6": 18955864, + "7": 17038929, + "8": 13484808, + "9": 10820396 + }, + "deficit": 1846900, + "m": 575, + "maxchild": 529, + "moment": { + "exponent": "9999489570654907083/10000000000000000000", + "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": "10286385449999999809786771186610032917079951250735065444454421408643245957980748769055363310810179269432723664230719355017627528841858754067131800834006320829/10286385450000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "saving": "510429345092917/10000000000000000000", + "strict_gap": "3510372256109915822630280143372080196621589113106038616821889722690162386304300614998081798317059153714017787837584044932769721784581411759400647297147045332725569285322982462210521300900749564742800215638753324863304223377544915842972715132395860486704480597419249635583492352837423840151787408946266172921743549718889664287167857441781903344001232310097936961423566397420953998869343876874950808035131527760941164304849003256361926047536613846180787044065822283052721468486236323168184537058846855328899818605602835494105576847594874126269156835891644860549597368431062595781782783573369492780569747568813651465470782445603787682056573358041422476052574094548500001739540304906587060464591585107420576438765158827835116810631118013152046244616083109777948703203123044178299736248095649191427255873856193239896858370625450656198975386522965432333771380274112209623985653023506111889189088809529934869871265148436486843171943322991074034358163251966074069644273098043515264289478377671617935827877228675482867349758616052048677152030095848917422860719798788705171263767575707421245828117699861678657430974267750968512866902590313447378422229433757717268295574351832547169907210436372236021764733786905069328780576193105090139938054065207255989366662833121282743178509689713364779906117594579295174598612389695263275850805110213663/216872492434005438368236541340836968669644450496791662449806846399165909578935358588319511405802829500621384916173342900055149013338118211229812349669207756368472620288838854083564689293891764269242731211363213686029296960108405350938731659968958654611946471065344190875682172030614129363688961615851909541328912819364872257748356367856936227316325369270832670399133829356473414267078139791666605944888706144515747822611669151643368284046948624913878408925234456425542011959448419767511017844210980584416674977500280431485516468482366489671636704630876843641062722238685572217838430651812762289671072381113205796808030672267907354161554488128270210462043177800796140703588885452783418916662248110444814113547399327363694219061014473617567135667783729946763439354985129933250959015584242628809242686673313979052797656076257375127812955400669465036782442258510196432580172370477939108305113693306825011961706185833847186007527248983213185256177069956652129646782526873365212492804333473047392036423842208270670637803707366104246429998178107466827335760092548911784187227441532812162034418447547051317855122494748460089296504385195021395407386640349448629407671882351973990956987781773787250738260261562409578837209990583245874432972815359130528993712389351851329848045923273761788267129313460034020954500000000000000000000000000000000000000000000000000", + "upper": "216872492434005438364726169084727052847014170353419582253185257286059870962113468865629349019498528885623303117856283746341131225500534166297042627884626344609071972991691808750839120008568781807032209910462464121286496744469652026075427436591413738768973755932948330388977691433194879728105469263014485701177125410418606084826612818138046563029157511829050767055132597046375477305654573394245651946019362267640797014576537623882427119742099621657516482877697842579361224915382597484458296375724744261248490440441433576156616649876763654177531127783281969514793565402793927357288833283381699693889289597539836304027460924699093702696083705682666422779986604442754718227536311358234918914922707805538227053082807742256273642622249314789732018857152611933611393110369046823473010312381119584630942950425218329861370400202401181887916097030044014380583466871987231000246400990203826898681128040283318900072517097024317251137655983834776698413005126633661055612424363621399138423160060375003876772134363830599052701975830137428763562648419491414778658608062453062866764366721734023456863154679971343896609294377048598410639073410927270426894519737759135182029249652918216273688692207421954703568353051126037342815445256796340805104192239166025438853774335286644073858679260440640505523950803770320656174593882405420704825401387610304736724149194889786337/216872492434005438368236541340836968669644450496791662449806846399165909578935358588319511405802829500621384916173342900055149013338118211229812349669207756368472620288838854083564689293891764269242731211363213686029296960108405350938731659968958654611946471065344190875682172030614129363688961615851909541328912819364872257748356367856936227316325369270832670399133829356473414267078139791666605944888706144515747822611669151643368284046948624913878408925234456425542011959448419767511017844210980584416674977500280431485516468482366489671636704630876843641062722238685572217838430651812762289671072381113205796808030672267907354161554488128270210462043177800796140703588885452783418916662248110444814113547399327363694219061014473617567135667783729946763439354985129933250959015584242628809242686673313979052797656076257375127812955400669465036782442258510196432580172370477939108305113693306825011961706185833847186007527248983213185256177069956652129646782526873365212492804333473047392036423842208270670637803707366104246429998178107466827335760092548911784187227441532812162034418447547051317855122494748460089296504385195021395407386640349448629407671882351973990956987781773787250738260261562409578837209990583245874432972815359130528993712389351851329848045923273761788267129313460034020954500000000000000000000000000000000000000000000000000" + }, + "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": 789079400, + "10": 4218200, + "11": 3893900, + "12": 2934800, + "13": 2465600, + "14": 1656000, + "15": 1357000, + "16": 809600, + "17": 443900, + "18": 262200, + "2": 39120700, + "20": 103500, + "21": 52900, + "3": 23703800, + "4": 13542400, + "5": 9627800, + "6": 9066600, + "7": 8362800, + "8": 6670000, + "9": 5195700 + }, + "internal_25": { + "1": 838657050, + "10": 4811807, + "11": 4682524, + "12": 3421572, + "13": 2913295, + "14": 2415644, + "15": 2001230, + "16": 1271578, + "17": 1023638, + "18": 662354, + "19": 317009, + "2": 44570757, + "20": 200123, + "22": 97405, + "23": 44275, + "3": 20864151, + "4": 12340328, + "5": 10138975, + "6": 9889264, + "7": 8676129, + "8": 6814808, + "9": 5624696 + }, + "paid_endpoint_copy": { + "1": 4073300 + } + }, + "total_rank": 78860441550 + }, + "bit_saving": "510429345092917/10000000000000000000", + "comparison": { + "frozen62_bit_saving": "39859/781250000", + "frozen62_kappa": "5101691/100000000000", + "frozen62_network_at_new_saving_lower": "82291084484426550695460933491756445854630745599991733867356713526464686131874222115238379719413598221260763974543102733545324785437602595789453502640473419/82291083600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "frozen62_network_rejected_at_new_saving": true, + "frozen62_refined_kappa": "25508460085039/500000000000000000", + "kappa_gain": "117096305539/5000000000000000000", + "kappa_gain_above_refined": "117045455149/5000000000000000000", + "roles_frozen62": [ + 27918, + 36586 + ] + }, + "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": 14000000000000000000, + "cutoff_log2_input": { + "alpha": 6142170385, + "compact": 24568681537, + "geometry": 3999931947385461140, + "guard": 4349502, + "log_p": 25, + "normalization": 14000000000000000000, + "period": 49137363073, + "phase_cell": 19, + "reservoir": 14, + "stopped_leaf": 252 + }, + "power_checkpoints": [ + { + "log2_input": 14000000000000000000, + "powers": { + "alpha": { + "exponent": 714540907466952, + "rhs": 112000000000000156808, + "rhs_bits": 67 + }, + "compact": { + "exponent": 714540907466952, + "rhs": 448000000000000627168, + "rhs_bits": 69 + }, + "leaf": { + "exponent": 666666666666666666, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 714540907466952, + "rhs": 224000000000000313544, + "rhs_bits": 68 + }, + "rows": { + "exponent": 714540907466952, + "rhs": 112000000000000156808000, + "rhs_bits": 77 + } + } + }, + { + "log2_input": 28000000000000000000, + "powers": { + "alpha": { + "exponent": 1429081814933904, + "rhs": 224000000000000156808, + "rhs_bits": 68 + }, + "compact": { + "exponent": 1429081814933904, + "rhs": 896000000000000627168, + "rhs_bits": 70 + }, + "leaf": { + "exponent": 1333333333333333333, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 1429081814933904, + "rhs": 448000000000000313544, + "rhs_bits": 69 + }, + "rows": { + "exponent": 1429081814933904, + "rhs": 224000000000000156808000, + "rhs_bits": 78 + } + } + }, + { + "log2_input": 56000000000000000000, + "powers": { + "alpha": { + "exponent": 2858163629867809, + "rhs": 448000000000000156808, + "rhs_bits": 69 + }, + "compact": { + "exponent": 2858163629867809, + "rhs": 1792000000000000627168, + "rhs_bits": 71 + }, + "leaf": { + "exponent": 2666666666666666666, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 2858163629867809, + "rhs": 896000000000000313544, + "rhs_bits": 70 + }, + "rows": { + "exponent": 2858163629867809, + "rhs": 448000000000000156808000, + "rhs_bits": 79 + } + } + }, + { + "log2_input": 112000000000000000000, + "powers": { + "alpha": { + "exponent": 5716327259735619, + "rhs": 896000000000000156808, + "rhs_bits": 70 + }, + "compact": { + "exponent": 5716327259735619, + "rhs": 3584000000000000627168, + "rhs_bits": 72 + }, + "leaf": { + "exponent": 5333333333333333333, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 5716327259735619, + "rhs": 1792000000000000313544, + "rhs_bits": 71 + }, + "rows": { + "exponent": 5716327259735619, + "rhs": 896000000000000156808000, + "rhs_bits": 80 + } + } + }, + { + "log2_input": 224000000000000000000, + "powers": { + "alpha": { + "exponent": 11432654519471239, + "rhs": 1792000000000000156808, + "rhs_bits": 71 + }, + "compact": { + "exponent": 11432654519471239, + "rhs": 7168000000000000627168, + "rhs_bits": 73 + }, + "leaf": { + "exponent": 10666666666666666666, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 11432654519471239, + "rhs": 3584000000000000313544, + "rhs_bits": 72 + }, + "rows": { + "exponent": 11432654519471239, + "rhs": 1792000000000000156808000, + "rhs_bits": 81 + } + } + }, + { + "log2_input": 448000000000000000000, + "powers": { + "alpha": { + "exponent": 22865309038942479, + "rhs": 3584000000000000156808, + "rhs_bits": 72 + }, + "compact": { + "exponent": 22865309038942479, + "rhs": 14336000000000000627168, + "rhs_bits": 74 + }, + "leaf": { + "exponent": 21333333333333333333, + "rhs": 3136, + "rhs_bits": 12 + }, + "period": { + "exponent": 22865309038942479, + "rhs": 7168000000000000313544, + "rhs_bits": 73 + }, + "rows": { + "exponent": 22865309038942479, + "rhs": 3584000000000000156808000, + "rhs_bits": 82 + } + } + } + ], + "practical_runtime_claim": false + }, + "exactness": [ + { + "common_denominator_bound": 34848, + "correction_numerator_bound": 274032, + "h": 23, + "minor_bounds": { + "2": 38218181861376, + "3": 219993996697351151616, + "4": 1206074983422622280129445888 + }, + "modulus_gaps": { + "2": 2305804791031832575, + "3": 2596143476298113163849933497114623, + "4": 2596142270223349735224350718820351 + }, + "prime_product": 2596143476298333157846630848266239, + "primes": [ + 2305843009213693951, + 2147483647, + 524287 + ], + "single_numerator_bound": 6228 + }, + { + "common_denominator_bound": 44928, + "correction_numerator_bound": 353568, + "h": 25, + "minor_bounds": { + "2": 75405344477184, + "3": 613343016893987684352, + "4": 4772090401825349199521120256 + }, + "modulus_gaps": { + "2": 2305767603869216767, + "3": 2596143476297719814829736860581887, + "4": 2596138704207931332497431327145983 + }, + "prime_product": 2596143476298333157846630848266239, + "primes": [ + 2305843009213693951, + 2147483647, + 524287 + ], + "single_numerator_bound": 7366 + } + ], + "explicit_h": "1/1000000000000000000", + "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 + } + }, + "fresh_word_receipts": [ + { + "elapsed_seconds": 6.828000000008615, + "gzip_sha256": "4c6af95bdbb8dd0ea6783e2dbc0358e9c31f18ccfdaf0bd2f4cedc144d536f42", + "prepared": { + "R": 27918, + "copied_centers": 23, + "distinct_transitions": 138019, + "frames": 52475, + "h": 23, + "rank_histogram_with_side_growth_split_into_singletons": { + "1": 53320, + "10": 484, + "11": 7, + "12": 495, + "13": 14, + "14": 2008, + "15": 507, + "16": 547, + "17": 335, + "18": 4220, + "19": 7820, + "2": 77144, + "21": 165, + "22": 23, + "3": 11072, + "4": 10684, + "5": 7554, + "6": 1996, + "7": 568, + "8": 1368, + "9": 520 + }, + "rank_mass": 642620, + "singles": 15939, + "transition_events_equal_independent_xor_word_reconstruction": true, + "v": 1771, + "word_sha256": "a19ab6454d7955d8643c9983e1288b97ac0c16b2e4963210901404efe537a464" + }, + "profile": { + "R": 27918, + "blocks": [ + 0, + 343078, + 17009, + 10306, + 5888, + 4186, + 3942, + 3636, + 2900, + 2259, + 1834, + 1693, + 1276, + 1072, + 720, + 590, + 352, + 193, + 114, + 0, + 45, + 23, + 0, + 0 + ], + "crt_disagreements": 0, + "crt_matrices": 6049, + "distinct_matrices": 36659, + "field_prime": 2305843009213693951, + "frames": 52475, + "h": 23, + "loss": 506, + "rank_sum": 642620, + "v": 1771 + }, + "replay": { + "elementary_xors": 148852, + "full_basis_vectors": 31460, + "h": 23, + "histogram": { + "0": 162527, + "1": 42694, + "10": 484, + "11": 7, + "12": 495, + "13": 14, + "14": 2008, + "15": 507, + "16": 547, + "17": 335, + "18": 4220, + "19": 7820, + "2": 82457, + "21": 165, + "22": 23, + "3": 11072, + "4": 10684, + "5": 7554, + "6": 1996, + "7": 568, + "8": 1368, + "9": 520 + }, + "output_roles": 5336, + "rank_mass": 642620, + "roles": 27918, + "status": "independent serialized word, exact frames, full input and dirty basis both orientations PASS", + "word_length": 620202 + }, + "status": "PASS fresh full input/dirty basis both orientations, independent literal frame path, exact fixed profiles", + "word_sha256": "a19ab6454d7955d8643c9983e1288b97ac0c16b2e4963210901404efe537a464" + }, + { + "elapsed_seconds": 10.89100000000326, + "gzip_sha256": "25f455d5de2561171a62f360544804a606dddb0364d515c24cad9b522b5c616a", + "prepared": { + "R": 36586, + "copied_centers": 25, + "distinct_transitions": 190878, + "frames": 73697, + "h": 25, + "rank_histogram_with_side_growth_split_into_singletons": { + "1": 69278, + "10": 527, + "12": 598, + "13": 33, + "14": 527, + "16": 3210, + "17": 868, + "18": 520, + "19": 396, + "2": 108673, + "20": 5436, + "21": 10087, + "23": 220, + "24": 25, + "3": 14362, + "4": 16782, + "5": 9992, + "6": 1765, + "7": 744, + "8": 2105, + "9": 706 + }, + "rank_mass": 915250, + "singles": 20700, + "transition_events_equal_independent_xor_word_reconstruction": true, + "v": 2300, + "word_sha256": "9743b73787191be00d29799dda4e390fe24a0dfb97cb594266435d1d9d4a5b08" + }, + "profile": { + "R": 36586, + "blocks": [ + 0, + 473550, + 25167, + 11781, + 6968, + 5725, + 5584, + 4899, + 3848, + 3176, + 2717, + 2644, + 1932, + 1645, + 1364, + 1130, + 718, + 578, + 374, + 179, + 113, + 0, + 55, + 25, + 0, + 0 + ], + "crt_disagreements": 0, + "crt_matrices": 8127, + "distinct_matrices": 50642, + "field_prime": 2305843009213693951, + "frames": 73697, + "h": 25, + "loss": 600, + "rank_sum": 915250, + "v": 2300 + }, + "replay": { + "elementary_xors": 205629, + "full_basis_vectors": 41186, + "h": 25, + "histogram": { + "0": 224040, + "1": 55478, + "10": 527, + "12": 598, + "13": 33, + "14": 527, + "16": 3210, + "17": 868, + "18": 520, + "19": 396, + "2": 115573, + "20": 5436, + "21": 10087, + "23": 220, + "24": 25, + "3": 14362, + "4": 16782, + "5": 9992, + "6": 1765, + "7": 744, + "8": 2105, + "9": 706 + }, + "output_roles": 6925, + "rank_mass": 915250, + "roles": 36586, + "status": "independent serialized word, exact frames, full input and dirty basis both orientations PASS", + "word_length": 854716 + }, + "status": "PASS fresh full input/dirty basis both orientations, independent literal frame path, exact fixed profiles", + "word_sha256": "9743b73787191be00d29799dda4e390fe24a0dfb97cb594266435d1d9d4a5b08" + } + ], + "kappa": "255201646305539/5000000000000000000", + "scope": "Fresh changed-word/full-basis/frame/profile/CRT and rational arithmetic validation. Unchanged 4,073,300-pair data geometry and its recovered rational cases inherited from PR62; all-size analytic log/exp enclosure, compiler/frame transfer, finite-alphabet tape, routing, prime-selection/recovery and eventual setup arguments remain conditional.", + "source": { + "attribution": "PR62 Avi Eisenberg/ikeboy; inherited PR57 compiler eumemic; exact profiler PR48 Chafik Boukhalfa, Rohan Arun, Dominik Scholz, icekylinx; see original source comments and NOTICE.", + "commit": "ad0f25ff7b23cff7f08ad237c2254e6ecf74257e", + "files": { + "references/frame-compiler/pr48/research/copied-fixed/balanced_assembly.py": "4d27575dcad2b45a281a34054d311409ecd954f373c0c3a62c29bcc843f06a86", + "references/frame-compiler/pr48/research/copied-fixed/certificate.json": "33b3373c04e18a7f4cee33ba68da6ed71934acc3e0179cca6197696be4befa22", + "references/frame-compiler/pr48/scripts/partial_swap/binary_io.hpp": "7e143eb75bb342ac8f0c82a60005e7c35c9ec827de479bf6fb773151f3af5fa1", + "research/pair-assembly/frame/frame-certificate.json": "70bc8a24a5565b840a5aac845703819c89c83b8c607acae021f64cf296f10c6e", + "research/pair-assembly/pair_graph.py": "3d47e89d2649c90800a276bdd0480131def50e0bdf92c122a19494b55bf17420", + "scripts/experiments/binary_frame_math.py": "1f96e8aafc8ae89f8eeec5d03800131d93d58e01bf8a7fca8feb03702d1740d0", + "scripts/experiments/binary_frame_profile_prepare.py": "8a50381cab00b33e62b3a057d199ba5e19647929135c95b0fd63fc8a8ef7c9b3", + "scripts/experiments/binary_frame_profiles.cpp": "8e2e391d3ee57cbb1372c68e4aa031e1b861321536eabd642ada54e12e678669", + "scripts/experiments/binary_frame_replay.py": "392e78e62d7685c99a5888a7da743ea6c3dcad631af4a743c91e0c09348442bc" + }, + "verification_adapter_files": { + "batch_axes.py": "cba8d8d2ce2babf4e9ff512af4e07df9a2574a15c4b1748e437a83977aa3359e", + "check_guards.py": "e3fc1be56f80de10c6c5e6dea2713ec42e95cae4f2d5e0fe57846672dd58e44e", + "export_weighted_case.py": "7242f0d052be4315275db231216a5744a4030094a89b2d19cbf965d2043aeae9", + "screen_axes.py": "bf06809c44e26883fcc93aa2dbf98fdf1951742b83ded161e725a84b3d616f98", + "verify_words.py": "1d5e3a670c83a68d419d27c463ee2ff641f17c805bf8fa63a80ed97797e52541" + } + }, + "status": "PASS exact characteristic upper enclosure, all 47 strict constraints and seven margins", + "verifier_sha256": "1d5e3a670c83a68d419d27c463ee2ff641f17c805bf8fa63a80ed97797e52541" +} diff --git a/research/profile-aware-frame-search/discovery/SEARCH.md b/research/profile-aware-frame-search/discovery/SEARCH.md new file mode 100644 index 0000000000..b8dd669634 --- /dev/null +++ b/research/profile-aware-frame-search/discovery/SEARCH.md @@ -0,0 +1,136 @@ +# Local frame-compiler search, frozen through PR62 + +All experiments in this directory use the pinned PR62 pair graph at +`ad0f25ff7b23cff7f08ad237c2254e6ecf74257e`. No later community source is consumed. +The original checkout is unchanged. Each emitted word and compiler copy has +a SHA256 recorded in its `compiled.json`; changed words are sent separately +to the independent literal replay and profile verifier. + +## New dependency-circuit choices + +The inherited compiler reduces retired fresh-signal rows against the current +live anchors and an echelon basis of compatible retired rows. Instead of +accepting the first dependent retired row, the new selectors collect the +available fundamental dependency circuits and choose a circuit by one of: + +- total charged target/provider rank growth (`all_growth`); +- number and rank growth of other retired providers (`all_collateral`); +- anchor-only dependence before general retired dependence (`anchor_first`); +- actual physical transition child-profile moment cost (`profile_cost*`). + +Every clearing XOR and every target/provider frame promotion is still emitted +and charged. A zero fresh-signal row can contain arbitrary physical dirty state; +its reuse is justified by the complete reversible word, not by claiming that +the physical register is initialized to zero. The compiler runs both complete +dirty-basis orientations, and the independent verifier repeats them. + +For the last selector let `C(A,B) = sum_t n_t(A,B) F_t`, where the `n_t` are +the exact inherited fixed-I+J pivot-run profile of the physical frame transition +and `F_t = t exp(a log(m/t))`. A candidate target `s` at old frame `A_s`, cleared +into frame `G` with providers `z`, is priced by + +``` +C(A_s,G) - C(A_s,I) + + sum_z [C(A_z,G) + C(G,I) - C(A_z,I)]. +``` + +This accounts for immediate promotions and the change in deferred cleanup, +assuming each other retired provider remains retired until cleanup. Future +reuse couples decisions, so this is a discovery heuristic, not an additive +global optimality certificate. Linear rank mass cancels between candidates; +`t*expm1(a*log(m/t))` avoids cancellation in floating discovery prices. +Missing transition profiles are recorded and collected for the next iteration. +Once a run has zero missing pairs, every local price uses an actual transition +profile. The final saving is accepted only through exact rational whole-profile +moment bounds and all assembly gates. + +`build_pair_oracle.py` is a local adaptation of the frozen C++ profiler that +additionally exports each transition histogram. It preserves the projector, +pivot, bounded-minor and three-prime CRT routines. Its synthetic transition-list +input is an oracle request, not a physical executable word. Each immutable +profile dump and the source/header hashes are recorded. + +## Moment-ordered carry selection + +The `--weighted` experiment orders the inherited linear/partition-matroid +candidate edges by their physical transition moment change before the original +greedy initialization and augmenting paths. For a value produced at `P`, +preserved through donor frame `G`, and carried to future target `T`, its +no-reclamation child-cost change is + +``` +C(G,T) - C(G,I) - C(0,P) - C(P,T). +``` + +At fixed cardinality, role and external-volume corrections are common to all +edge choices in the same axis. The inherited augmenting algorithm still seeks +maximum cardinality; it does not optimize the weights globally. Reclamation +adds coupling, so only the changed whole-word profile can establish an actual +improvement. This experiment makes no minimum-cost matroid claim. + +The `--exchange` variant starts from the frozen original maximum-cardinality +matching and tries bounded improving one-edge exchanges. A new edge may replace +the old donor of the same use when its donor block stays linearly independent; +or it may replace a selected edge in the same donor block and serve an unused +use. Both preserve cardinality and distinct-use constraints. The `--cycle` +variant additionally tests two-edge donor/use cycles, checking the independence +of both changed blocks. No improving two-edge cycle was found in the tested +native-price instance; this is not a proof that longer cycles cannot improve it. + +## Joint basis and schedule search + +`--basis shift1` profiles all candidate physical transitions after the point +permutation `i -> (i+1) mod h`, while preserving their original frame IDs. +Matching and reclamation are then priced in that basis. The emitted word is +renamed by `relabel_word.py`: all frame masks, canonical source/output triples, +common points and scatter port indices change together. Scratch slots and +literal XOR instructions are retained. The complete triple family and the +permutation-invariant `I+J` basis are inherited; every final renamed word still +gets fresh full-basis and actual physical-profile verification. + +This joint search differs from merely relabeling an already selected schedule: +the selected carries and clearing circuits are optimized under the new ordered +pivot-run prices. It remains a bounded discovery heuristic. + +## Regeneration + +The frozen graph/matching setup and a moment-cost exchange run are generated by: + +``` +python -S collect_matching_pairs.py --h 23 +python -S build_pair_oracle.py --h 23 --strategy matching_collect +python -S run_strategy.py --h 23 --strategy profile_cost --exchange +``` + +Repeat at `h=25`. For joint search, add `--basis shift1` to the oracle and +strategy commands. Reclamation may encounter transitions absent from the +initial carry-edge inventory. Run the oracle again on the emitted strategy +directory with `--incremental`, then run a new strategy label. The new label +must start with `profile_cost`; output directories are never overwritten. +`compiled.json` records the exact oracle dump hash, missing-pair count, word +hashes and source pin. Immutable earlier oracle dumps are retained by SHA256. +Use `--oracle path/to/the-immutable-dump.jsonl` to reproduce the prices of a +specific recorded run instead of consuming the subsequently enlarged cache. +The initial compiler matching cache is accepted only if its complete candidate +edge list matches the current frozen graph and every restored selected block +passes the same linear-independence check. + +The runner saves an immutable source copy and its hash for later runs. Floating +`expm1` prices at discovery saving `a=0.00005103` select proposals only. Neither +those prices nor their reported local gains are used as an arithmetic witness. + +## Acceptance boundary + +The independent verifier checks all input and dirty basis vectors in both +orientations, exact literal-scatter incidences, causal nested physical frames, +event equality reconstructed from the actual XOR word, rank mass, actual child +profiles and CRT agreement. It then computes the whole mixed-axis recurrence +and exact rational moment/assembly witnesses. Existing all-size geometry, +analytic envelopes, compiler/tape arguments and the surrounding reduction are +inherited from frozen PR62. A finite profile improvement does not by itself +formally prove those inherited hypotheses. + +Reduced XOR count alone is not accepted as an exponent improvement. In this +search `all_collateral` and `anchor_first` reduced clearing XORs but worsened +the certified characteristic. Actual child-size distributions decide the +saving, even when both physical-role counts and total rank mass are unchanged. diff --git a/research/profile-aware-frame-search/discovery/build_pair_oracle.py b/research/profile-aware-frame-search/discovery/build_pair_oracle.py new file mode 100644 index 0000000000..dac70a269a --- /dev/null +++ b/research/profile-aware-frame-search/discovery/build_pair_oracle.py @@ -0,0 +1,79 @@ +"""Local transition oracle using the frozen PR62 literal profiler formulas. + +The input is a candidate-transition list, not an executable word. This tool +exports exact integer child profiles, which are discovery costs only. Changed +words still require independent whole-word replay and full profile verification. +""" +from pathlib import Path +import argparse,hashlib,json,math,struct,subprocess +HERE=Path(__file__).resolve().parent +FROZEN=HERE.parents[1]/'matrix-synthesis/bridge/pr62' +ZIG=HERE.parents[1]/'matrix-synthesis/toolchain/zig-x86_64-windows-0.14.1/zig.exe' + +def main(): + p=argparse.ArgumentParser();p.add_argument('--h',type=int,choices=(23,25),required=True) + p.add_argument('--strategy',default='profile_collect');p.add_argument('--incremental',action='store_true');p.add_argument('--basis',choices=('native','shift1'),default='native');a=p.parse_args() + source=FROZEN/'scripts/experiments/binary_frame_profiles.cpp' + text=source.read_text();assert hashlib.sha256(source.read_bytes()).hexdigest()=='8e2e391d3ee57cbb1372c68e4aa031e1b861321536eabd642ada54e12e678669' + original='for(auto&[key,count]:transitions){if(!count)continue;' + emit='''std::ofstream pairout(std::string(argv[1])+".pair-profiles.jsonl"); +auto emit=[&](U a,U b,const std::vector&prior,int64_t count){ + pairout<<"{\\"a\\":"<>i&1) + frames=[(0,0,0),(0,0,a.h)]+[(mask(c),mask(u),1 if c==u else u.bit_count()-c.bit_count())for c,u in d['frames']] + proposed=set(map(tuple,d['pairs'])) + previous=HERE/f'pair-profiles-h{a.h}{suffix}.jsonl' + oldrows={} + if previous.exists(): + for line in previous.read_text().splitlines(): + row=json.loads(line);key=(row['a'],row['b']);proposed.add(key);oldrows[key]=row + pairs=[] + for x,y in sorted(proposed): + if x==y or frames[x][2]==frames[y][2]:continue + if a.incremental and (x,y)in oldrows:continue + assert frames[x][2]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)) + def acquire(g,anchors): + if reclaim: + bb={} + def ins(s,add=True): + 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<place[g] + and contains(b['frame'],blocks[uses[u][1]]['frame'])} + for target in sorted(targets,key=lambda gg:place[gg])[:24]: + residues={} + for x in blocks[target]['outvalues']: + r=signal[x];expr=0 + for pivot in sorted(fresh_basis,reverse=True): + if r>>pivot&1: + rr,ee=fresh_basis[pivot];r^=rr;expr^=ee + while r: + pivot=r.bit_length()-1 + if pivot not in residues:residues[pivot]=(r,expr);break + rr,ee=residues[pivot];r^=rr;expr^=ee + if not r and expr and independent(echelon,expr): + rows.append(expr);labels.append(('retire-predictive',expr));echelon=basis(rows);stats['future_complement_rows']+=1 + if COMPLETION_MODE.startswith('kernel'): + fresh_basis={};kernel=[] + for i,y in enumerate(b['inputs']): + r=signal[y];expr=1<place[g] and contains(b['frame'],blocks[target]['frame'])] + near=min((place[target]-place[g] for target in targets),default=10**9) + if COMPLETION_MODE=='future-near':return (near,-len(targets),i) + if COMPLETION_MODE=='future-far':return (-near,-len(targets),i) + if COMPLETION_MODE=='future-many':return (-len(targets),near,i) + if COMPLETION_MODE=='small-support':return (signal[y].bit_count(),near,i) + if COMPLETION_MODE=='large-support':return (-signal[y].bit_count(),near,i) + if COMPLETION_MODE=='reverse':return (-i,) + return (i,) + unit_order.sort(key=future_score) + for i in unit_order: + if independent(echelon,1<>i&1) + triples=list(combinations(range(h),3));lookup={t:i for i,t in enumerate(triples)} + index=[lookup[tuple(sorted(perm[x]for x in t))]for t in triples] + assert sorted(index)==list(range(v)) + w['frames']=[[mask(c),mask(u)]for c,u in w['frames']] + w['sources']={str(index[int(i)]):s for i,s in w['sources'].items()} + w['outputs']=[[s,g,perm[c],sorted(perm[x]for x in t)]for s,g,c,t in w['outputs']] + w['scatter']=[[v+index[t-v],s]for t,s in w['scatter']] + transformed=(json.dumps(w,separators=(',',':'))+'\n').encode('utf-8') + a.output.parent.mkdir(parents=True,exist_ok=True) + with a.output.open('wb') as f: + with gzip.GzipFile(fileobj=f,mode='wb',mtime=0) as z:z.write(transformed) + receipt={'scope':'simultaneous point/frame/source-triple/output-triple coordinate renaming; no instruction or physical role removed', + 'mode':a.mode,'point_permutation':perm,'h':h,'roles':w['R'], + 'source_word_sha256':hashlib.sha256(raw).hexdigest(),'word_sha256':hashlib.sha256(transformed).hexdigest()} + a.output.with_suffix(a.output.suffix+'.rename.json').write_text(json.dumps(receipt,indent=2)+'\n',encoding='utf-8') + print(json.dumps(receipt),flush=True) + +if __name__=='__main__':main() diff --git a/research/profile-aware-frame-search/discovery/runner-2d545544e429a83aea08c1d6b344dff149b1bfc75fcd9685c148bb01934f61f5.py b/research/profile-aware-frame-search/discovery/runner-2d545544e429a83aea08c1d6b344dff149b1bfc75fcd9685c148bb01934f61f5.py new file mode 100644 index 0000000000..f659619969 --- /dev/null +++ b/research/profile-aware-frame-search/discovery/runner-2d545544e429a83aea08c1d6b344dff149b1bfc75fcd9685c148bb01934f61f5.py @@ -0,0 +1,208 @@ +"""Frozen-through-PR62 local reclamation experiment; no external operations.""" +from pathlib import Path +import argparse,gzip,hashlib,importlib.util,json,sys,time +import math + +HERE=Path(__file__).resolve().parent +FROZEN=HERE.parents[1]/'matrix-synthesis/bridge/pr62' + +ACQUIRE=''' def acquire(g,anchors): + if reclaim: + bb={} + def ins(s,add=True): + row=slots[s];expr=1<>s&1;e^=1<=prices[f]-1e-14:continue + if not can(e,f if edges[f][0]==g else None):continue + else: + f=next((z for z in sorted(blocks[g]['selected'],key=lambda z:-prices[z])if prices[e] s (q i) + +def renamedWord (p : I → I) (word : List (I × I)) : List (I × I) := + word.map (fun e => (p e.1,p e.2)) + +omit [DecidableEq I] in +theorem rename_inverse (p q : I → I) (hpq : ∀ i, p (q i)=i) (s : Vec I) : + rename q (rename p s) = s := by + funext i + exact congrArg s (hpq i) + +omit [DecidableEq I] in +theorem rename_xor (q : I → I) (s t : Vec I) : + rename q (vxor s t) = vxor (rename q s) (rename q t) := rfl + +/- Rewrite gate endpoints consistently: auxiliary endpoints may be fixed +while both data banks are renamed by the same induced triple permutation. -/ +theorem xor_gate_conjugacy (p q : I → I) + (hqp : ∀ i, q (p i)=i) (hpq : ∀ i, p (q i)=i) + (a b : I) (s : Vec I) : + xorUpdate (p a) (p b) (rename q s) = rename q (xorUpdate a b s) := by + funext i + by_cases hi : i=p a + · subst i + simp only [xorUpdate,rename,ite_true,hqp] + · have hqa : q i ≠ a := by + intro h + have hh := congrArg p h + rw [hpq] at hh + exact hi hh + simp only [xorUpdate,rename,if_neg hi,if_neg hqa] + +/- The actual full word, not only its fresh output, is conjugated. Arbitrary +initial dirty coordinates are covered by the same identity. -/ +theorem complete_word_conjugacy (p q : I → I) + (hqp : ∀ i, q (p i)=i) (hpq : ∀ i, p (q i)=i) + (word : List (I × I)) (s : Vec I) : + runWord (renamedWord p word) (rename q s) = rename q (runWord word s) := by + induction word generalizing s with + | nil => rfl + | cons e es ih => + simp only [renamedWord,List.map_cons,runWord] + rw [xor_gate_conjugacy p q hqp hpq] + exact ih _ + +omit [DecidableEq I] in +theorem renamed_word_legal (p q : I → I) (hqp : ∀ i, q (p i)=i) + (word : List (I × I)) (hlegal : Legal word) : Legal (renamedWord p word) := by + intro e he + rcases List.mem_map.mp he with ⟨old,ho,rfl⟩ + intro h + have hi := congrArg q h + rw [hqp,hqp] at hi + exact hlegal old ho hi + +def subset (a b : I → Bool) : Prop := ∀ i, a i=true → b i=true + +omit [DecidableEq I] in +theorem subset_renaming_iff (p q : I → I) (hqp : ∀ i, q (p i)=i) + (a b : I → Bool) : subset (rename q a) (rename q b) ↔ subset a b := by + constructor + · intro h i hi + have hh := h (p i) + simp only [rename,hqp] at hh + exact hh hi + · intro h i hi + exact h (q i) hi + +/- The actual frame containment predicate is invariant under the explicit +point permutation, so the new frames have genuine containing masks. -/ +omit [DecidableEq I] in +theorem frame_containment_renaming (p q : I → I) (hqp : ∀ i, q (p i)=i) + (core cover nextCore nextCover : I → Bool) : + (subset (rename q nextCore) (rename q core) ∧ + subset (rename q cover) (rename q nextCover)) ↔ + (subset nextCore core ∧ subset cover nextCover) := by + rw [subset_renaming_iff p q hqp,subset_renaming_iff p q hqp] + +/- Permutation invariance of equality is the entire I+J entry argument. -/ +omit [DecidableEq I] in +theorem equality_preserved (p q : I → I) (hqp : ∀ i, q (p i)=i) (i j : I) : + p i=p j ↔ i=j := by + constructor + · intro h + have hh := congrArg q h + simpa only [hqp] using hh + · intro h + exact congrArg p h + +def ijEntry (i j : I) : Int := if i=j then 2 else 1 + +theorem ij_entry_invariant (p q : I → I) (hqp : ∀ i, q (p i)=i) (i j : I) : + ijEntry (p i) (p j) = ijEntry i j := by + unfold ijEntry + simp only [equality_preserved p q hqp] + +/- Applying a point bijection and its inverse restores every triple list. +Canonical sorting is a representation step; unordered families descend +through the separate map-preserves-permutation identity. -/ +omit [DecidableEq I] in +theorem list_points_inverse (p q : I → I) (hqp : ∀ i, q (p i)=i) (xs : List I) : + (xs.map p).map q = xs := by + induction xs with + | nil => rfl + | cons x xs ih => simp only [List.map_cons,hqp,ih] + +omit [DecidableEq I] in +theorem mapped_triple_length (p : I → I) (xs : List I) (h : xs.length=3) : + (xs.map p).length=3 := by simpa only [List.length_map] using h + +omit [DecidableEq I] in +theorem point_map_preserves_unordered_equivalence (p : I → I) + {xs ys : List I} (h : List.Perm xs ys) : List.Perm (xs.map p) (ys.map p) := + h.map p + +end CoordinateConjugacy + +#print axioms CoordinateConjugacy.complete_word_conjugacy +#print axioms CoordinateConjugacy.frame_containment_renaming +#print axioms CoordinateConjugacy.ij_entry_invariant +#print axioms CoordinateConjugacy.list_points_inverse diff --git a/research/profile-aware-frame-search/math/DirtyComplementSafety-compile.log b/research/profile-aware-frame-search/math/DirtyComplementSafety-compile.log new file mode 100644 index 0000000000..15fc77e93d --- /dev/null +++ b/research/profile-aware-frame-search/math/DirtyComplementSafety-compile.log @@ -0,0 +1,4 @@ +'DirtyComplementSafety.runWord_inverse' depends on axioms: [propext, Quot.sound] +'DirtyComplementSafety.dirtyWord_transfer' depends on axioms: [Quot.sound] +'DirtyComplementSafety.complement_independent_transfer' depends on axioms: [propext, Quot.sound] +'DirtyComplementSafety.legal_word_shear' depends on axioms: [propext, Quot.sound] diff --git a/research/profile-aware-frame-search/math/DirtyComplementSafety.lean b/research/profile-aware-frame-search/math/DirtyComplementSafety.lean new file mode 100644 index 0000000000..e566b91447 --- /dev/null +++ b/research/profile-aware-frame-search/math/DirtyComplementSafety.lean @@ -0,0 +1,155 @@ +import Std + +/-! +Complement-independent dirty-scratch safety for reversible Boolean encoders. +Every legal XOR instruction is an involution, so its reversed word supplies an +actual inverse. Mandatory fresh transfer is a separate component contract. +Physical frame containment, primitive/copy charges and asymptotic compilation +are not inferred from this arithmetic theorem. Matroid/basis completion and +reversible linear circuit principles are established ingredients. +-/ +namespace DirtyComplementSafety + +abbrev Vec (I : Type) := I → Bool + +def vxor {I : Type} (x y : Vec I) : Vec I := fun i => x i ^^ y i + +def Linear {I J : Type} (f : Vec I → Vec J) : Prop := + ∀ x y, f (vxor x y) = vxor (f x) (f y) + +theorem vxor_cancel_right {I : Type} (x y : Vec I) : vxor (vxor x y) y = x := by + funext i + simp only [vxor] + cases x i <;> cases y i <;> rfl + +theorem vxor_cancel_middle {I : Type} (x y z : Vec I) : + vxor (vxor x y) (vxor y z) = vxor x z := by + funext i + simp only [vxor] + cases x i <;> cases y i <;> cases z i <;> rfl + +def xorUpdate {I : Type} [DecidableEq I] (a b : I) (s : Vec I) : Vec I := + fun i => if i=a then s a ^^ s b else s i + +theorem xorUpdate_involution {I : Type} [DecidableEq I] (a b : I) + (hab : a ≠ b) (s : Vec I) : xorUpdate a b (xorUpdate a b s) = s := by + funext i + by_cases h : i=a + · subst i + have hb : b ≠ a := Ne.symm hab + simp only [xorUpdate,ite_true,if_neg hb] + cases s a <;> cases s b <;> rfl + · simp only [xorUpdate,if_neg h] + +theorem xorUpdate_linear {I : Type} [DecidableEq I] (a b : I) : + Linear (xorUpdate a b) := by + intro s t + funext i + by_cases h : i=a + · subst i + simp only [xorUpdate,ite_true,vxor] + cases s a <;> cases s b <;> cases t a <;> cases t b <;> rfl + · simp only [xorUpdate,if_neg h,vxor] + +def runWord {I : Type} [DecidableEq I] : List (I × I) → Vec I → Vec I + | [],s => s + | e::es,s => runWord es (xorUpdate e.1 e.2 s) + +def Legal {I : Type} (word : List (I × I)) : Prop := ∀ e ∈ word, e.1 ≠ e.2 + +theorem runWord_append {I : Type} [DecidableEq I] + (xs ys : List (I × I)) (s : Vec I) : + runWord (xs++ys) s = runWord ys (runWord xs s) := by + induction xs generalizing s with + | nil => rfl + | cons e es ih => simp only [List.cons_append,runWord,ih] + +theorem runWord_inverse {I : Type} [DecidableEq I] + (word : List (I × I)) (h : Legal word) (s : Vec I) : + runWord word.reverse (runWord word s) = s := by + induction word generalizing s with + | nil => rfl + | cons e es ih => + have he := h e (by simp) + have hrest : Legal es := by intro f hf; exact h f (by simp [hf]) + simp only [List.reverse_cons,runWord,runWord_append] + rw [ih hrest] + exact xorUpdate_involution e.1 e.2 he s + +theorem runWord_linear {I : Type} [DecidableEq I] (word : List (I × I)) : + Linear (runWord word) := by + induction word with + | nil => intro s t; rfl + | cons e es ih => + intro s t + simp only [runWord] + rw [xorUpdate_linear e.1 e.2 s t,ih] + +/-- This is the actual two-pass shear schedule M,J,M^-1,V repeated twice. -/ +def dirtyWord {X S : Type} + (M N : Vec S → Vec S) (V : Vec X → Vec S) (J : Vec S → Vec X) + (x y : Vec X) (s : Vec S) : Vec X × Vec X × Vec S := + let t1 := M s + let y1 := vxor y (J t1) + let t2 := N t1 + let t3 := vxor t2 (V x) + let t4 := M t3 + let y2 := vxor y1 (J t4) + let t5 := N t4 + let t6 := vxor t5 (V x) + (x,y2,t6) + +/-- Arbitrary dirty scratch cancels. No desired transfer identity is assumed: +the theorem derives the output from the separate source/encoder/scatter maps. -/ +theorem dirtyWord_transfer {X S : Type} + (M N : Vec S → Vec S) (V : Vec X → Vec S) (J : Vec S → Vec X) + (hM : Linear M) (hJ : Linear J) (hNM : ∀ s, N (M s) = s) + (x y : Vec X) (s : Vec S) : + dirtyWord M N V J x y s = (x,vxor y (J (M (V x))),s) := by + simp only [dirtyWord,hNM] + rw [hM,hJ,vxor_cancel_middle,vxor_cancel_right] + +/-- A different unit complement changes the internal encoder and retired +signals, but not the observable shear or dirty restoration when mandatory +fresh transfers agree. -/ +theorem complement_independent_transfer {X S T : Type} + (M N : Vec S → Vec S) (V : Vec X → Vec S) (J : Vec S → Vec X) + (M' N' : Vec T → Vec T) (V' : Vec X → Vec T) (J' : Vec T → Vec X) + (hM : Linear M) (hJ : Linear J) (hNM : ∀ s, N (M s) = s) + (hM' : Linear M') (hJ' : Linear J') (hNM' : ∀ s, N' (M' s) = s) + (hfresh : ∀ x, J (M (V x)) = J' (M' (V' x))) + (x y : Vec X) (s : Vec S) (t : Vec T) : + (dirtyWord M N V J x y s).1 = (dirtyWord M' N' V' J' x y t).1 ∧ + (dirtyWord M N V J x y s).2.1 = (dirtyWord M' N' V' J' x y t).2.1 ∧ + (dirtyWord M N V J x y s).2.2 = s ∧ + (dirtyWord M' N' V' J' x y t).2.2 = t := by + rw [dirtyWord_transfer M N V J hM hJ hNM, + dirtyWord_transfer M' N' V' J' hM' hJ' hNM'] + simp [hfresh] + +/-- The concrete legal XOR encoder needs no assumed invertibility premise: +its literal reversed word is the proved inverse, for all dirty vectors. -/ +theorem legal_word_dirty_transfer {X S : Type} [DecidableEq S] + (word : List (S × S)) (hlegal : Legal word) + (V : Vec X → Vec S) (J : Vec S → Vec X) (hJ : Linear J) + (x y : Vec X) (s : Vec S) : + dirtyWord (runWord word) (runWord word.reverse) V J x y s = + (x,vxor y (J (runWord word (V x))),s) := + dirtyWord_transfer _ _ _ _ (runWord_linear word) hJ (runWord_inverse word hlegal) x y s + +/-- If the unchanged mandatory producer/scatter contract is the identity, +the compiled complement produces exactly the required shear. -/ +theorem legal_word_shear {X S : Type} [DecidableEq S] + (word : List (S × S)) (hlegal : Legal word) + (V : Vec X → Vec S) (J : Vec S → Vec X) (hJ : Linear J) + (htransfer : ∀ x, J (runWord word (V x)) = x) + (x y : Vec X) (s : Vec S) : + dirtyWord (runWord word) (runWord word.reverse) V J x y s = (x,vxor y x,s) := by + rw [legal_word_dirty_transfer word hlegal V J hJ,htransfer] + +end DirtyComplementSafety + +#print axioms DirtyComplementSafety.runWord_inverse +#print axioms DirtyComplementSafety.dirtyWord_transfer +#print axioms DirtyComplementSafety.complement_independent_transfer +#print axioms DirtyComplementSafety.legal_word_shear diff --git a/research/profile-aware-frame-search/math/FiniteRationalChecks-compile.log b/research/profile-aware-frame-search/math/FiniteRationalChecks-compile.log new file mode 100644 index 0000000000..ca7268fa10 --- /dev/null +++ b/research/profile-aware-frame-search/math/FiniteRationalChecks-compile.log @@ -0,0 +1,4 @@ +'FrontierRationalCertificate.check_sound' depends on axioms: [propext, Classical.choice, Quot.sound] +'FrontierRationalCertificate.rational_enclosed_moment' depends on axioms: [propext, Classical.choice, Quot.sound] +'FrontierRationalCertificate.analytic_enclosure_contract' depends on axioms: [propext, Classical.choice, Quot.sound] +'FrontierRationalCertificate.checked_frontier_strict' depends on axioms: [propext, Classical.choice, Quot.sound] diff --git a/research/profile-aware-frame-search/math/FiniteRationalChecks.lean b/research/profile-aware-frame-search/math/FiniteRationalChecks.lean new file mode 100644 index 0000000000..089a80bedf --- /dev/null +++ b/research/profile-aware-frame-search/math/FiniteRationalChecks.lean @@ -0,0 +1,80 @@ +import Std +import Init.Data.Rat.Lemmas + +/-! +Finite rational moment-envelope and assembly-check interface. +Weighted upper bounds use one explicit positive common denominator. Their +analytic validity, source/profile binding, completeness of assembly rows and +inherited multiplication theorem remain explicit external contracts. +No successful frontier instance is asserted merely by compiling this helper. +-/ +namespace FrontierRationalCertificate + +structure Data where + width : Nat + volume : Nat + weightDenominator : Nat + weightedRows : List (Nat × Nat) + assemblySlacks : List Rat + expectedAssemblyRows : Nat + kappa : Rat + latestKappa : Rat + +def momentNumerator (c : Data) : Nat := + (c.weightedRows.map fun row => row.1*row.2).sum + +def momentUpper (c : Data) : Rat := + Rat.divInt (momentNumerator c : Int) (c.weightDenominator*c.width*c.volume : Nat) + +def check (c : Data) : Bool := + decide (0 decide (0 false + | i::is,s => s i ^^ providerXor is s + +def clearCarrier (target : I) (providers : List I) (s : Vec I) : Vec I := + fun i => if i=target then s target ^^ providerXor providers s else s i + +omit [DecidableEq I] in +theorem providerXor_congr (providers : List I) (s t : Vec I) + (h : ∀ i ∈ providers, s i = t i) : providerXor providers s = providerXor providers t := by + induction providers with + | nil => rfl + | cons i is ih => + have hi := h i (by simp) + have hrest : ∀ j ∈ is, s j=t j := by intro j hj; exact h j (by simp [hj]) + simp only [providerXor,hi,ih hrest] + +theorem clear_other_coordinate (target i : I) (providers : List I) + (h : i ≠ target) (s : Vec I) : clearCarrier target providers s i = s i := by + simp only [clearCarrier,if_neg h] + +theorem providers_unchanged (target : I) (providers : List I) + (h : ∀ i ∈ providers, i ≠ target) (s : Vec I) : + providerXor providers (clearCarrier target providers s) = providerXor providers s := by + apply providerXor_congr + intro i hi + exact clear_other_coordinate target i providers (h i hi) s + +/-- Clearing cannot erase arbitrary dirty information: it is an involution. -/ +theorem clearing_involution (target : I) (providers : List I) + (h : ∀ i ∈ providers, i ≠ target) (s : Vec I) : + clearCarrier target providers (clearCarrier target providers s) = s := by + funext i + by_cases hi : i=target + · subst i + simp only [clearCarrier,ite_true] + change (s target ^^ providerXor providers s ^^ + providerXor providers (clearCarrier target providers s)) = s target + rw [providers_unchanged target providers h s] + cases s target <;> cases providerXor providers s <;> rfl + · simp only [clearCarrier,if_neg hi] + +/-- A checked fresh linear dependency creates a quiet coordinate for every +fresh source value, while the reversible transform still retains dirty data. -/ +theorem fresh_kernel_coordinate (target : I) (providers : List I) + (fresh : Vec X → Vec I) + (hkernel : ∀ x, fresh x target = providerXor providers (fresh x)) + (x : Vec X) : clearCarrier target providers (fresh x) target = false := by + simp only [clearCarrier,ite_true,hkernel] + exact Bool.xor_self _ + +/-- All non-target fresh outputs are preserved by kernel clearing. -/ +theorem fresh_mandatory_coordinate_preserved (target i : I) (providers : List I) + (hi : i ≠ target) (fresh : Vec X → Vec I) (x : Vec X) : + clearCarrier target providers (fresh x) i = fresh x i := + clear_other_coordinate target i providers hi _ + +/-- An actual dirty carrier need not be zero after a fresh-zero certificate. +At one coordinate, clearing with no providers preserves a dirty true bit. -/ +theorem dirty_zero_counterexample : + clearCarrier (0 : Nat) [] (fun _ => true) 0 = true := by rfl + +end FreshKernelReclaim + +#print axioms FreshKernelReclaim.clearing_involution +#print axioms FreshKernelReclaim.fresh_kernel_coordinate +#print axioms FreshKernelReclaim.fresh_mandatory_coordinate_preserved +#print axioms FreshKernelReclaim.dirty_zero_counterexample diff --git a/research/profile-aware-frame-search/math/ProfileSearchCertificate-compile.log b/research/profile-aware-frame-search/math/ProfileSearchCertificate-compile.log new file mode 100644 index 0000000000..50bb9babcd --- /dev/null +++ b/research/profile-aware-frame-search/math/ProfileSearchCertificate-compile.log @@ -0,0 +1,11 @@ +'RefinedFrontierCertificate.weighted_numerator_exact' depends on axioms: [propext, Classical.choice, Quot.sound] +'RefinedFrontierCertificate.pade_rounding_checked' depends on axioms: [propext, Classical.choice, Quot.sound] +'RefinedFrontierCertificate.finite_checks_pass' depends on axioms: [propext, Classical.choice, Quot.sound] +'RefinedFrontierCertificate.rational_moment_upper_below_one' depends on axioms: [propext, Classical.choice, Quot.sound] +'RefinedFrontierCertificate.every_assembly_slack_positive' depends on axioms: [propext, Classical.choice, Quot.sound] +'RefinedFrontierCertificate.exceeds_old_scoped_limit' depends on axioms: [propext, Classical.choice, Quot.sound] +'RefinedFrontierCertificate.exceeds_old_published' depends on axioms: [propext, Classical.choice, Quot.sound] +'RefinedFrontierCertificate.old_profile_rank_mass' depends on axioms: [propext, Classical.choice, Quot.sound] +'RefinedFrontierCertificate.old_weighted_numerator_exact' depends on axioms: [propext, Classical.choice, Quot.sound] +'RefinedFrontierCertificate.old_taylor_rounding_checked' depends on axioms: [propext, Classical.choice, Quot.sound] +'RefinedFrontierCertificate.old_profile_lower_above_one' depends on axioms: [propext, Classical.choice, Quot.sound] diff --git a/research/profile-aware-frame-search/math/ProfileSearchCertificate.lean b/research/profile-aware-frame-search/math/ProfileSearchCertificate.lean new file mode 100644 index 0000000000..e48d0e46c3 --- /dev/null +++ b/research/profile-aware-frame-search/math/ProfileSearchCertificate.lean @@ -0,0 +1,228 @@ +import FiniteRationalChecks + +/-! +Concrete finite rational certificate for new profile-aware compiler words on frozen PR62, source ad0f25ff7b23cff7f08ad237c2254e6ecf74257e. +Input export SHA256 d595d7b828aca4a1c17ff9492e6b01851306ef2aebf35bda9fc422ff7f82ae6c. +Source certificate SHA256 70bc8a24a5565b840a5aac845703819c89c83b8c607acae021f64cf296f10c6e. +Refined certificate SHA256 35cd0a62b8b41927d44ceee9deda3da41e6343d6abba5a6b29d3deed28d94c9b. +The kernel computes the Padé rational expressions, upward rounding, weighted +moment envelope and all 47 assembly slacks. The logarithm upper-enclosure and +exponential Padé analytic validity remain ordinary explicit inherited contracts; +this file does not claim a fully formalized global multiplication theorem. +-/ +namespace RefinedFrontierCertificate +open FrontierRationalCertificate +set_option maxRecDepth 100000 +set_option maxHeartbeats 0 + +def saving : Rat := Rat.divInt (510429345092917) (10000000000000000000) +def newKappa : Rat := Rat.divInt (255201646305539) (5000000000000000000) +def oldScoped : Rat := Rat.divInt (39859) (781289859) +def oldPublished : Rat := Rat.divInt (5101691) (100000000000) + +structure Row where + width : Nat + multiplicity : Nat + logUpper : Rat + roundedNumerator : Nat + +def rows : List Row := [ + ⟨1,1721422350,Rat.divInt (6354370040797350440008271498263) (1000000000000000000000000000000),1000324398299592263783078336787⟩, + ⟨2,83691457,Rat.divInt (1132244572047481026118207875361) (200000000000000000000000000000),2000578014364457354229984001527⟩, + ⟨3,44567951,Rat.divInt (5255757752129240748613026261341) (1000000000000000000000000000000),3000804915858495195216401724574⟩, + ⟨4,25882728,Rat.divInt (4968075679677459821173807255347) (1000000000000000000000000000000),4001014469267960435740589278167⟩, + ⟨5,19766775,Rat.divInt (4744932128363250065407512165037) (1000000000000000000000000000000),5001211122957595140592923841040⟩, + ⟨6,18955864,Rat.divInt (2281305285784647719597897069941) (500000000000000000000000000000),6001397496920112844944433280626⟩, + ⟨7,17038929,Rat.divInt (220422994587101856745145937741) (50000000000000000000000000000),7001575322340231459947454892144⟩, + ⟨8,13484808,Rat.divInt (4274928499117514511756575133889) (1000000000000000000000000000000),8001745829630658044037723560953⟩, + ⟨9,10820396,Rat.divInt (2078572731730565528608890512209) (500000000000000000000000000000),9001909938763293258701452733917⟩, + ⟨10,9030007,Rat.divInt (4051784947803304755990280043579) (1000000000000000000000000000000),10002068363814317070989802125913⟩, + ⟨11,8576424,Rat.divInt (1978237383999489947973163960149) (500000000000000000000000000000),11002221675233374859524662126932⟩, + ⟨12,6356372,Rat.divInt (483682923876168766222320252303) (125000000000000000000000000000),12002370339271128195221822330693⟩, + ⟨13,5378895,Rat.divInt (1894710341667906851977392028349) (500000000000000000000000000000),13002514744170011286506303974576⟩, + ⟨14,4071644,Rat.divInt (1857656355591045912742843316681) (500000000000000000000000000000),14002655218248029853031980654616⟩, + ⟨15,3358230,Rat.divInt (1823159919847570187006133464057) (500000000000000000000000000000),15002792042789520047938725929440⟩, + ⟨16,2081178,Rat.divInt (358178131855756920233934301243) (100000000000000000000000000000),16002925461483373042799450631504⟩, + ⟨17,9614138,Rat.divInt (352115669674113435975873688039) (100000000000000000000000000000),17003055687492759996522223569431⟩, + ⟨18,924554,Rat.divInt (43299978536264821847506861287) (12500000000000000000000000000),18003182908855862537293895932137⟩, + ⟨19,317009,Rat.divInt (27279448493047279839993952531) (8000000000000000000000000000),19003307292682912594167244038708⟩, + ⟨20,303623,Rat.divInt (3358637767243359446573047922121) (1000000000000000000000000000000),20003428988467330753587966796264⟩, + ⟨21,16346100,Rat.divInt (3309847603073927443507673517897) (1000000000000000000000000000000),21003548130733081765703209417422⟩, + ⟨22,97405,Rat.divInt (81583189685975864663227394971) (25000000000000000000000000000),22003664841176703842222060680188⟩, + ⟨23,72402275,Rat.divInt (3218875824868200749201518666453) (1000000000000000000000000000000),23003779230419130247561957694198⟩, + ⟨25,64793806,Rat.divInt (3135494215929149690806752831811) (1000000000000000000000000000000),25004001440844359077943226687537⟩, + ⟨481,8146600,Rat.divInt (89251385345794629793344192833) (500000000000000000000000000000),481004382557783000847188951501384⟩, + ⟨525,64793806,Rat.divInt (18194355641145338861230970289) (200000000000000000000000000000),525002437825581479427574027499022⟩, + ⟨529,64211400,Rat.divInt (83381608939051058394765834643) (1000000000000000000000000000000),529002251451011435621729334582716⟩ +] + +def slacks : List Rat := [ + Rat.divInt (85071557515486583078118660786874416836809781697639) (1666751738224182152833163190218302361000000000000000000), -- K_dominates_log + Rat.divInt (1250085071557515486583163190218302361) (1666751738224182152833163190218302361000000000000000000), -- K_geometry + Rat.divInt (206570654907083) (10000000000000000000), -- a_below_b + Rat.divInt (510429345092917) (10000000000000000000), -- a_positive + Rat.divInt (3333333333333333331666751738224182152833163190218302361) (3333503476448364305666326380436604722000000000000000000), -- alpha_below_one + Rat.divInt (833205725997060102417006952896728611333163190218302361) (3333503476448364305666326380436604722000000000000000000), -- alpha_below_one_fourth + Rat.divInt (170143115030973999574642212422569166836809781697639) (3333503476448364305666326380436604722000000000000000000), -- alpha_positive + Rat.divInt (93338777913014324466322699388643897562499489570654907083) (13334013905793457222665305521746418888000000000000000000), -- artificial_boundary + Rat.divInt (311783) (10000000), -- b_below_one_over32 + Rat.divInt (19) (20), -- beta_below_one + Rat.divInt (1) (20), -- beta_positive + Rat.divInt (4999744785327453540250510429345092917) (5000000000000000000000000000000000000), -- c_below_one + Rat.divInt (255214672546459749489570654907083) (5000000000000000000000000000000000000), -- c_positive + Rat.divInt (3333333333333333328333248261775817847166836809781697639) (6667006952896728611332652760873209444000000000000000000), -- cell_above_band + Rat.divInt (85360327453541500510429345092917) (5000000000000000000000000000000000000), -- compact_leaf + Rat.divInt (1) (4000000000000000000), -- compact_reservations + Rat.divInt (999999999999999999) (8000000000000000000), -- delta_below_one_eighth + Rat.divInt (1) (8000000000000000000), -- delta_positive + Rat.divInt (85071557515487833163190218302361) (1666751738224182152833163190218302361), -- epsilon_below_one + Rat.divInt (1666666666666666665000000000000000000) (1666751738224182152833163190218302361), -- epsilon_positive + Rat.divInt (9104063825891186991290171003908922421) (8333758691120910764165815951091511805000000000000000000), -- g1_above_kappa + Rat.divInt (26052481839) (10000000000000000000), -- g2_above_kappa + Rat.divInt (96288141846284528390544381602176327) (1041719836390113845520726993886438975625000000000000000), -- g3_above_kappa + Rat.divInt (26052481839) (10000000000000000000), -- g4_above_kappa + Rat.divInt (31163717151524942109492288275813820343) (66670069528967286113326527608732094440000000000000000000), -- g5_above_kappa + Rat.divInt (64498751916008585166155552080179867563) (66670069528967286113326527608732094440000000000000000000), -- g6_above_kappa + Rat.divInt (8332907975545755894938247874799675186290171003908922421) (8333758691120910764165815951091511805000000000000000000), -- g7_above_kappa + Rat.divInt (1) (2000000000000000000), -- gamma_sublinear + Rat.divInt (85071557515487833163190218302361) (1666751738224182152833163190218302361), -- guard_width + Rat.divInt (510429345092917) (10000000000000000000000000000000000000), -- lambda_above_internal + Rat.divInt (206570654907083000510429345092917) (10000000000000000000000000000000000000), -- lambda_above_sigma + Rat.divInt (510429345092917) (10000000000000000000000000000000000000), -- lambda_above_tau + Rat.divInt (510429345092917) (10000000000000000000000000000000000000), -- lambda_prime_above_lambda + Rat.divInt (255214672546458499489570654907083) (5000000000000000000000000000000000000), -- lambda_prime_below_one + Rat.divInt (9693793493753822316795466474748) (1), -- literal_scalar_guard + Rat.divInt (136114492024778866309366125101624766836809781697639) (2666802781158691444533061104349283777600000000000000000), -- phase_boundary + Rat.divInt (170720654907083) (10000000000000000000), -- phase_leaf_above_bit + Rat.divInt (680572460123900998553783522236735166836809781697639) (13334013905793457222665305521746418888000000000000000000), -- phase_local + Rat.divInt (85071557515487833163190218302361) (1666751738224182152833163190218302361), -- prime_interval_packing + Rat.divInt (510429345092917) (5000000000000000000000000000000000000), -- q_below_internal + Rat.divInt (85360327453541500510429345092917) (5000000000000000000000000000000000000), -- q_below_leaf + Rat.divInt (1) (4000000000000000000), -- q_below_reservations + Rat.divInt (255214672546458499489570654907083) (5000000000000000000000000000000000000), -- q_positive + Rat.divInt (85071557515487833163190218302361) (1666751738224182152833163190218302361), -- record_suffix + Rat.divInt (6548) (25), -- row_product_gap + Rat.divInt (16665815907668492399669308102285443962494717302454522963) (16667517382241821528331631902183023610000000000000000000), -- short_record_fallback + Rat.divInt (1) (1000000000000000000) -- small_field_exposure +] + +def data : Data where + width := 575 + volume := 137151806 + weightDenominator := 1000000000000000000000000000000 + weightedRows := rows.map (fun r => (r.multiplicity,r.roundedNumerator)) + assemblySlacks := slacks + expectedAssemblyRows := 47 + kappa := newKappa + latestKappa := oldScoped + +def v (r : Row) : Rat := saving*r.logUpper +def padeUpper (r : Row) : Rat := + (r.width : Rat)*(1+v r+(v r*v r)/(2*(1-v r/3))) + +theorem weighted_numerator_exact : momentNumerator data = 78862288449999999998723508056180137442390 := by decide +kernel + +theorem profile_rank_mass : (rows.map (fun r => r.width*r.multiplicity)).sum = 78860441550 := by decide +kernel + +theorem profile_row_count : rows.length = 27 := by decide +kernel + +theorem assembly_row_count : slacks.length = 47 := by decide +kernel + +theorem pade_rounding_checked : + rows.all (fun r => decide (0 ≤ v r ∧ v r < 1 ∧ + padeUpper r ≤ Rat.divInt (r.roundedNumerator : Int) 1000000000000000000000000000000)) = true := by decide +kernel + +theorem finite_checks_pass : check data = true := by decide +kernel + +theorem rational_moment_upper_below_one : momentUpper data < 1 := + (check_sound data finite_checks_pass).2.1 + +theorem every_assembly_slack_positive : ∀ s ∈ slacks, 0= 1+u+u^2/2+u^3/6 remain analytic +contracts. This establishes a finite conditional structural separation; it is +not a lower bound against other compiler words or multiplication algorithms. +Old source profile SHA256 70bc8a24a5565b840a5aac845703819c89c83b8c607acae021f64cf296f10c6e. +-/ +namespace RefinedFrontierCertificate + +structure OldRow where + width : Nat + multiplicity : Nat + logLower : Rat + roundedNumerator : Nat + +def oldRows : List OldRow := [ + ⟨1,1725399142,Rat.divInt (3177185020398675220004135749131) (500000000000000000000000000000),1000324398299591648879533157338⟩, + ⟨2,83474797,Rat.divInt (1415305715059351282647759844201) (250000000000000000000000000000),2000578014364456579442013402234⟩, + ⟨3,45979944,Rat.divInt (262787887606462037430651313067) (50000000000000000000000000000),3000804915858494331897035282265⟩, + ⟨4,25771845,Rat.divInt (2484037839838729910586903627673) (500000000000000000000000000000),4001014469267959516732048608974⟩, + ⟨5,20048226,Rat.divInt (1186233032090812516351878041259) (250000000000000000000000000000),5001211122957594184731096163555⟩, + ⟨6,18832860,Rat.divInt (4562610571569295439195794139881) (1000000000000000000000000000000),6001397496920111864306681894100⟩, + ⟨7,17285926,Rat.divInt (4408459891742037134902918754819) (1000000000000000000000000000000),7001575322340230462825624046712⟩, + ⟨8,13320151,Rat.divInt (66795757798711164246196486467) (15625000000000000000000000000),8001745829630657036393939075960⟩, + ⟨9,10863958,Rat.divInt (4157145463461131057217781024417) (1000000000000000000000000000000),9001909938763292244967140846508⟩, + ⟨10,8899436,Rat.divInt (2025892473901652377995140021789) (500000000000000000000000000000),10002068363814316054540972422018⟩, + ⟨11,8550388,Rat.divInt (3956474767998979895946327920297) (1000000000000000000000000000000),11002221675233373842982126452011⟩, + ⟨12,6150660,Rat.divInt (3869463391009350129778562018423) (1000000000000000000000000000000),12002370339271127180649896872632⟩, + ⟨13,5359966,Rat.divInt (3789420683335813703954784056697) (1000000000000000000000000000000),13002514744170010275549331790141⟩, + ⟨14,3947398,Rat.divInt (3715312711182091825485686633361) (1000000000000000000000000000000),14002655218248028847011050626683⟩, + ⟨15,3264367,Rat.divInt (3646319839695140374012266928113) (1000000000000000000000000000000),15002792042789519047921967798767⟩, + ⟨16,2045758,Rat.divInt (3581781318557569202339343012429) (1000000000000000000000000000000),16002925461483372049654244346367⟩, + ⟨17,9608825,Rat.divInt (3521156696741134359758736880389) (1000000000000000000000000000000),17003055687492759010954703819698⟩, + ⟨18,928096,Rat.divInt (3463998282901185747800548902959) (1000000000000000000000000000000),18003182908855861559879329394878⟩, + ⟨19,299299,Rat.divInt (1704965530815454989999622033187) (500000000000000000000000000000),19003307292682911625373720082646⟩, + ⟨20,282371,Rat.divInt (83965944181083986164326198053) (25000000000000000000000000000),20003428988467329793795104829575⟩, + ⟨21,16346100,Rat.divInt (413730950384240930438459189737) (125000000000000000000000000000),21003548130733080815217095268042⟩, + ⟨22,97405,Rat.divInt (3263327587439034586529095798839) (1000000000000000000000000000000),22003664841176702901287290426983⟩, + ⟨23,72402275,Rat.divInt (804718956217050187300379666613) (250000000000000000000000000000),23003779230419129316371435541181⟩, + ⟨25,64793806,Rat.divInt (313549421592914969080675283181) (100000000000000000000000000000),25004001440844358166651921235820⟩, + ⟨481,8146600,Rat.divInt (35700554138317851917337677133) (200000000000000000000000000000),481004382557783000847004791090907⟩, + ⟨525,64793806,Rat.divInt (22742944551431673576538712861) (250000000000000000000000000000),525002437825581479427560467590997⟩, + ⟨529,64211400,Rat.divInt (41690804469525529197382917321) (500000000000000000000000000000),529002251451011435621719691688442⟩ +] + +def oldU (r : OldRow) : Rat := saving*r.logLower +def oldTaylor (r : OldRow) : Rat := + (r.width : Rat)*(1+oldU r+(oldU r*oldU r)/2+(oldU r*oldU r*oldU r)/6) +def oldNumerator : Nat := + (oldRows.map (fun r => r.multiplicity*r.roundedNumerator)).sum +def oldMomentLower : Rat := Rat.divInt (oldNumerator : Int) 78862288450000000000000000000000000000000 + +theorem old_profile_rank_mass : + (oldRows.map (fun r => r.width*r.multiplicity)).sum = 78860441550 := by decide +kernel + +theorem old_weighted_numerator_exact : oldNumerator = 78862289297575444416483394596264687443210 := by decide +kernel + +theorem old_taylor_rounding_checked : + oldRows.all (fun r => decide (0 <= oldU r ∧ oldU r < 1 ∧ + Rat.divInt (r.roundedNumerator : Int) 1000000000000000000000000000000 <= oldTaylor r)) = true := by decide +kernel + +theorem old_profile_lower_above_one : 1 < oldMomentLower := by decide +kernel + +end RefinedFrontierCertificate + +#print axioms RefinedFrontierCertificate.old_profile_rank_mass +#print axioms RefinedFrontierCertificate.old_weighted_numerator_exact +#print axioms RefinedFrontierCertificate.old_taylor_rounding_checked +#print axioms RefinedFrontierCertificate.old_profile_lower_above_one diff --git a/research/profile-aware-frame-search/math/RankFlowPrice-compile.log b/research/profile-aware-frame-search/math/RankFlowPrice-compile.log new file mode 100644 index 0000000000..79554f1cf6 --- /dev/null +++ b/research/profile-aware-frame-search/math/RankFlowPrice-compile.log @@ -0,0 +1,4 @@ +'RankFlowPrice.clearing_target_rank_delta' depends on axioms: [propext, Quot.sound] +'RankFlowPrice.clearing_provider_rank_delta' depends on axioms: [propext, Quot.sound] +'RankFlowPrice.carried_edge_rank_delta' depends on axioms: [propext, Quot.sound] +'RankFlowPrice.constant_shift_preserves_order_and_minimizers' depends on axioms: [propext, Classical.choice, Quot.sound] diff --git a/research/profile-aware-frame-search/math/RankFlowPrice.lean b/research/profile-aware-frame-search/math/RankFlowPrice.lean new file mode 100644 index 0000000000..c4f0f0415f --- /dev/null +++ b/research/profile-aware-frame-search/math/RankFlowPrice.lean @@ -0,0 +1,41 @@ +import Std +import Init.Data.Rat.Lemmas + +/-! +Subtracting the linear rank part from a clearing price preserves its candidate +ordering: the target correction is the same rG-h for every candidate at that +acquisition, while each distinct provider has zero correction. A carried edge +has correction -h; dropping this term preserves matching prices only when the +number of carried edges is fixed. Variable-cardinality searches must retain +the full charged correction. Analytic exp/log evaluation and frame-path binding +remain separate contracts; these are exact algebraic price identities. +-/ +namespace RankFlowPrice + +theorem clearing_target_rank_delta (rG rA h : Int) : + (rG-rA)-(h-rA) = rG-h := by omega + +theorem clearing_provider_rank_delta (rG rB h : Int) : + (rG-rB)+(h-rG)-(h-rB) = 0 := by omega + +theorem carried_edge_rank_delta (rT rG rP h : Int) : + (rT-rG)-(h-rG)-rP-(rT-rP) = -h := by omega + +theorem constant_shift_preserves_order_and_minimizers {A : Type} + (cost : A → Rat) (shift : Rat) (x y : A) : + ((cost x+shift ≤ cost y+shift) ↔ cost x ≤ cost y) ∧ + ((∀ z, cost x+shift ≤ cost z+shift) ↔ ∀ z, cost x ≤ cost z) := by + constructor + · exact Rat.add_le_add_right + · constructor + · intro h z + exact Rat.add_le_add_right.mp (h z) + · intro h z + exact Rat.add_le_add_right.mpr (h z) + +end RankFlowPrice + +#print axioms RankFlowPrice.clearing_target_rank_delta +#print axioms RankFlowPrice.clearing_provider_rank_delta +#print axioms RankFlowPrice.carried_edge_rank_delta +#print axioms RankFlowPrice.constant_shift_preserves_order_and_minimizers diff --git a/research/profile-aware-frame-search/math/generate_profile_case.py b/research/profile-aware-frame-search/math/generate_profile_case.py new file mode 100644 index 0000000000..719e0009e2 --- /dev/null +++ b/research/profile-aware-frame-search/math/generate_profile_case.py @@ -0,0 +1,116 @@ +"""Kernel-checkable finite profile search instance, including old-profile rejection. + +Analytic logarithm and exponential enclosures are explicit inherited contracts. +This script never changes the source graph, compiler words, or upstream files. +""" +from pathlib import Path +from fractions import Fraction as Q +import argparse, hashlib, importlib.util, json, subprocess, sys + +HERE = Path(__file__).resolve().parent +WORKSPACE = HERE.parents[2] +BASE = WORKSPACE / 'work/matrix-synthesis/bridge/pr62' +GEN = WORKSPACE / 'work/matrix-synthesis/audit/generate_frontier_case.py' +ap = argparse.ArgumentParser() +ap.add_argument('weighted_json', type=Path) +ap.add_argument('--output', type=Path, default=HERE/'ProfileSearchCertificate.lean') +ap.add_argument('--old-profile', type=Path, + default=BASE/'research/pair-assembly/frame/frame-certificate.json') +args = ap.parse_args() +data = json.loads(args.weighted_json.read_text(encoding='utf-8')) +old = json.loads(args.old_profile.read_text(encoding='utf-8')) +old_sha = hashlib.sha256(args.old_profile.read_bytes()).hexdigest() +assert old_sha == data['source_certificate_sha256'] +subprocess.run([sys.executable, str(GEN), str(args.weighted_json), + '--scoped', '39859/781289859', '--published', '5101691/100000000000', + '--source-pin', 'ad0f25ff7b23cff7f08ad237c2254e6ecf74257e', + '--label', 'new profile-aware compiler words on frozen PR62', + '--output', str(args.output)], check=True) +spec = importlib.util.spec_from_file_location('frozen62_math', + BASE/'scripts/experiments/binary_frame_math.py') +module = importlib.util.module_from_spec(spec) +spec.loader.exec_module(module) +a = Q(data['bit_saving']); scale = data['rows'][0]['rounding_scale'] +old_bit = old['bit']; m = old_bit['m']; volume = old_bit['W'] +assert m == data['m'] +rows = [] +exact_lower = Q() +for width, count in sorted((int(t), n) for t, n in old_bit['child_multiplicities'].items()): + lo, _ = module.logs(Q(m, width)) + u = a*lo + lower = width*(1+u+u*u/2+u*u*u/6) + rounded = (lower*scale).numerator//(lower*scale).denominator + assert 0 <= u < 1 and Q(rounded, scale) <= lower + rows.append(dict(width=width, multiplicity=count, log_lower=str(lo), + rounded_numerator=rounded, F_lower=str(lower))) + exact_lower += count*lower/Q(m*volume) +assert exact_lower == Q(data['comparison']['frozen62_network_at_new_saving_lower']) +numerator = sum(r['multiplicity']*r['rounded_numerator'] for r in rows) +denominator = scale*m*volume +assert numerator > denominator +old_rank_mass = sum(r['width']*r['multiplicity'] for r in rows) + +def rat(value): + q = Q(value) + return f'Rat.divInt ({q.numerator}) ({q.denominator})' + +source = args.output.read_text(encoding='utf-8') +source += f''' +/- The unchanged frozen62 complete profile fails at the new saving. The +kernel verifies its explicit Taylor polynomial, downward rounding and weighted +sum. Logarithm lower enclosure and exp(u) >= 1+u+u^2/2+u^3/6 remain analytic +contracts. This establishes a finite conditional structural separation; it is +not a lower bound against other compiler words or multiplication algorithms. +Old source profile SHA256 {old_sha}. +-/ +namespace RefinedFrontierCertificate + +structure OldRow where + width : Nat + multiplicity : Nat + logLower : Rat + roundedNumerator : Nat + +def oldRows : List OldRow := [ +''' +source += ',\n'.join(f' ⟨{r["width"]},{r["multiplicity"]},{rat(r["log_lower"])},{r["rounded_numerator"]}⟩' for r in rows) +source += f''' +] + +def oldU (r : OldRow) : Rat := saving*r.logLower +def oldTaylor (r : OldRow) : Rat := + (r.width : Rat)*(1+oldU r+(oldU r*oldU r)/2+(oldU r*oldU r*oldU r)/6) +def oldNumerator : Nat := + (oldRows.map (fun r => r.multiplicity*r.roundedNumerator)).sum +def oldMomentLower : Rat := Rat.divInt (oldNumerator : Int) {denominator} + +theorem old_profile_rank_mass : + (oldRows.map (fun r => r.width*r.multiplicity)).sum = {old_rank_mass} := by decide +kernel + +theorem old_weighted_numerator_exact : oldNumerator = {numerator} := by decide +kernel + +theorem old_taylor_rounding_checked : + oldRows.all (fun r => decide (0 <= oldU r ∧ oldU r < 1 ∧ + Rat.divInt (r.roundedNumerator : Int) {scale} <= oldTaylor r)) = true := by decide +kernel + +theorem old_profile_lower_above_one : 1 < oldMomentLower := by decide +kernel + +end RefinedFrontierCertificate + +#print axioms RefinedFrontierCertificate.old_profile_rank_mass +#print axioms RefinedFrontierCertificate.old_weighted_numerator_exact +#print axioms RefinedFrontierCertificate.old_taylor_rounding_checked +#print axioms RefinedFrontierCertificate.old_profile_lower_above_one +''' +args.output.write_text(source, encoding='utf-8') +lower_path = args.output.with_name('old-profile-lower-data.json') +lower_path.write_text(json.dumps(dict(source_profile_sha256=old_sha, + candidate_weighted_sha256=hashlib.sha256(args.weighted_json.read_bytes()).hexdigest(), + bit_saving=str(a), m=m, W=volume, rows=rows, + weighted_lower_numerator=numerator, weighted_lower_denominator=denominator, + exact_unrounded_lower=str(exact_lower), + lower_strict_gap=str(Q(numerator,denominator)-1)), indent=2)+'\n', encoding='utf-8') +print(json.dumps(dict(output=str(args.output), theorems=15, + output_sha256=hashlib.sha256(args.output.read_bytes()).hexdigest(), + old_rounded_lower_gap=str(Q(numerator, denominator)-1), + old_lower_data=str(lower_path)), indent=2)) diff --git a/research/profile-aware-frame-search/math/lake-manifest.json b/research/profile-aware-frame-search/math/lake-manifest.json new file mode 100644 index 0000000000..da88d3ca24 --- /dev/null +++ b/research/profile-aware-frame-search/math/lake-manifest.json @@ -0,0 +1,6 @@ +{"version": "1.2.0", + "packagesDir": ".lake/packages", + "packages": [], + "name": "frozen62Research", + "lakeDir": ".lake", + "fixedToolchain": false} diff --git a/research/profile-aware-frame-search/math/lakefile.lean b/research/profile-aware-frame-search/math/lakefile.lean new file mode 100644 index 0000000000..9c5f9ae913 --- /dev/null +++ b/research/profile-aware-frame-search/math/lakefile.lean @@ -0,0 +1,6 @@ +import Lake +open Lake DSL +package frozen62Research +lean_lib Frozen62Research where + roots := #[`DirtyComplementSafety, `FreshKernelReclaim, `CoordinateConjugacy, + `FiniteRationalChecks, `RankFlowPrice, `ProfileSearchCertificate, `Audit] diff --git a/research/profile-aware-frame-search/math/lean-receipt.json b/research/profile-aware-frame-search/math/lean-receipt.json new file mode 100644 index 0000000000..33cc1e2cf8 --- /dev/null +++ b/research/profile-aware-frame-search/math/lean-receipt.json @@ -0,0 +1,120 @@ +{ + "status": "PASS serial Lean kernel compilation and all-theorem axiom audit", + "compiler": "Lean (version 4.31.0, x86_64-w64-windows-gnu, commit 68218e876d2a38b1985b8590fff244a83c321783, Release)", + "compiler_executable": "C:\\Users\\Propietario\\.elan\\toolchains\\leanprover--lean4---v4.31.0\\bin\\lean.exe", + "source_commit": "ad0f25ff7b23cff7f08ad237c2254e6ecf74257e", + "kappa": "255201646305539/5000000000000000000", + "bit_saving": "510429345092917/10000000000000000000", + "frozen_old_scoped": "39859/781289859", + "frozen_old_published": "5101691/100000000000", + "fresh_universal_theorems": 34, + "concrete_instance_theorems": 15, + "reused_helper_theorems": 4, + "total_audited_theorems": 53, + "namespaces": [ + "DirtyComplementSafety", + "FreshKernelReclaim", + "CoordinateConjugacy", + "FrontierRationalCertificate", + "RankFlowPrice", + "RefinedFrontierCertificate" + ], + "inventory": [ + { + "module": "DirtyComplementSafety", + "namespace": "DirtyComplementSafety", + "theorem_count": 11, + "source_sha256": "4cb4c80de52568b1d0a7ea4483984526c9f6f710dd870e47ba2d00ac7cf6936d" + }, + { + "module": "FreshKernelReclaim", + "namespace": "FreshKernelReclaim", + "theorem_count": 7, + "source_sha256": "571061c21bb683a6b3b142f189398c8106f57863125d25b3717f97bec0a011a2" + }, + { + "module": "CoordinateConjugacy", + "namespace": "CoordinateConjugacy", + "theorem_count": 12, + "source_sha256": "99a6c27205ef11295e88d87c685c0ad827651a25ebfce8684f3ce7eb917b02f4" + }, + { + "module": "FiniteRationalChecks", + "namespace": "FrontierRationalCertificate", + "theorem_count": 4, + "source_sha256": "463bd0bbb0e8982bd2d0477d0d42f86c2b25854dac211ef47d3ab877209530d4" + }, + { + "module": "RankFlowPrice", + "namespace": "RankFlowPrice", + "theorem_count": 4, + "source_sha256": "d9255a2065f740686317efb9d39a234b05456dd688363a5ba4e3f4f0be08be97" + }, + { + "module": "ProfileSearchCertificate", + "namespace": "RefinedFrontierCertificate", + "theorem_count": 15, + "source_sha256": "7f99384f2bdcd479467972a7a93fb7a5ae9c24138e016bdbc43fc5d5b4c1e77d" + } + ], + "builds": [ + { + "module": "DirtyComplementSafety", + "returncode": 0, + "elapsed_seconds": 0.984 + }, + { + "module": "FreshKernelReclaim", + "returncode": 0, + "elapsed_seconds": 0.907 + }, + { + "module": "CoordinateConjugacy", + "returncode": 0, + "elapsed_seconds": 0.89 + }, + { + "module": "FiniteRationalChecks", + "returncode": 0, + "elapsed_seconds": 0.906 + }, + { + "module": "RankFlowPrice", + "returncode": 0, + "elapsed_seconds": 0.907 + }, + { + "module": "ProfileSearchCertificate", + "returncode": 0, + "elapsed_seconds": 1.187 + }, + { + "module": "Audit", + "returncode": 0, + "elapsed_seconds": 0.86 + } + ], + "permitted_axioms": [ + "propext", + "Classical.choice", + "Quot.sound" + ], + "proof_escapes": { + "sorry": false, + "admit": false, + "native_decide": false, + "new_axioms": false + }, + "weighted_input_sha256": "d595d7b828aca4a1c17ff9492e6b01851306ef2aebf35bda9fc422ff7f82ae6c", + "old_profile_lower_data_sha256": "ce9e6ba4c51c1089cb8797512ca5bf27a70e1164d64ef887f60d2d08ce045f37", + "old_rounded_lower_strict_gap": "3685110627897753889548976901927/342879515000000000000000000000000000000", + "auxiliary_files": { + "Audit.lean": "cea254e3978fec4d70f95b32ca4416a6275d3e9e49d5576fbe5c56fec86ee2fd", + "generate_profile_case.py": "19b19036c5b208c854f152ae649b6a7212d29bc123894eb0f9a4cea3a64478ce", + "verify_math.py": "3a0a8aa080869706b0103cbfc175a8bb96677bf6ac80263af8b65cf48ba9ef46", + "verify.ps1": "71760c5cbf6dadc4e478cfc72c31c47524776ade6fb38aa906a38a0eb4d19165", + "lakefile.lean": "9433ecb75c26a750073e1990d9a4e87ec6d326d3cfc10a1018362e133d2b7b45", + "lean-toolchain": "465c68148dd061230368e3cbe5d1d2973069172b48b684c928ef1a665b627832" + }, + "scope": "Finite Boolean encoder/reclaim/conjugacy identities and exact rational moment/assembly gates. Source-profile binding, analytic log/exp enclosure, physical frame/tape/routing contracts and global integer multiplication theorem remain explicit external contracts." +} diff --git a/research/profile-aware-frame-search/math/lean-toolchain b/research/profile-aware-frame-search/math/lean-toolchain new file mode 100644 index 0000000000..561ad7126b --- /dev/null +++ b/research/profile-aware-frame-search/math/lean-toolchain @@ -0,0 +1 @@ +leanprover/lean4:v4.31.0 diff --git a/research/profile-aware-frame-search/math/old-profile-lower-data.json b/research/profile-aware-frame-search/math/old-profile-lower-data.json new file mode 100644 index 0000000000..655c046f88 --- /dev/null +++ b/research/profile-aware-frame-search/math/old-profile-lower-data.json @@ -0,0 +1,202 @@ +{ + "source_profile_sha256": "70bc8a24a5565b840a5aac845703819c89c83b8c607acae021f64cf296f10c6e", + "candidate_weighted_sha256": "d595d7b828aca4a1c17ff9492e6b01851306ef2aebf35bda9fc422ff7f82ae6c", + "bit_saving": "510429345092917/10000000000000000000", + "m": 575, + "W": 137151806, + "rows": [ + { + "width": 1, + "multiplicity": 1725399142, + "log_lower": "3177185020398675220004135749131/500000000000000000000000000000", + "rounded_numerator": 1000324398299591648879533157338, + "F_lower": "250081099574897912219883289334725664351577759794195298025050225596071366101888864619767359020364103077743075807083173959874361599986311833935994461/250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "width": 2, + "multiplicity": 83474797, + "log_lower": "1415305715059351282647759844201/250000000000000000000000000000", + "rounded_numerator": 2000578014364456579442013402234, + "F_lower": "93777094423333902161344378229746768172991170859106561287919068561884845646720233224158804284884606979972760006366104493945359623549270881719263013/46875000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "width": 3, + "multiplicity": 45979944, + "log_lower": "262787887606462037430651313067/50000000000000000000000000000", + "rounded_numerator": 3000804915858494331897035282265, + "F_lower": "750201228964623582974258820566404619971864957424303564190231100700364827247644782008158441292843308718735573822675373547252159978770864757702519/250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "width": 4, + "multiplicity": 25771845, + "log_lower": "2484037839838729910586903627673/500000000000000000000000000000", + "rounded_numerator": 4001014469267959516732048608974, + "F_lower": "750190212987742409387259114182802461131981666591190681638910399825537069826665288512873422151861179458658775804962695498331822722450437439570159221/187500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "width": 5, + "multiplicity": 20048226, + "log_lower": "1186233032090812516351878041259/250000000000000000000000000000", + "rounded_numerator": 5001211122957594184731096163555, + "F_lower": "31257569518484963654569351022220733817447397251829433367364585968460866203900293402993254636192533253310724665976482863352009954763752939425712509/6250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "width": 6, + "multiplicity": 18832860, + "log_lower": "4562610571569295439195794139881/1000000000000000000000000000000", + "rounded_numerator": 6001397496920111864306681894100, + "F_lower": "6001397496920111864306681894100331574074525763920366525974832253642214562190606486917779043465946284057075802893588369981460137055472496883737140133/1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "width": 7, + "multiplicity": 17285926, + "log_lower": "4408459891742037134902918754819/1000000000000000000000000000000", + "rounded_numerator": 7001575322340230462825624046712, + "F_lower": "42009451934041382776953744280276447532296806960772346980315472621837863674092459518662243778979231433150272623360005909227028791627719360704394438169/6000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "width": 8, + "multiplicity": 13320151, + "log_lower": "66795757798711164246196486467/15625000000000000000000000000", + "rounded_numerator": 8001745829630657036393939075960, + "F_lower": "7631059484129578625101031375847095598549613096254703718810379043035981393800361027418704250040263098997136873144589003597167768386812154417973/953674316406250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "width": 9, + "multiplicity": 10863958, + "log_lower": "4157145463461131057217781024417/1000000000000000000000000000000", + "rounded_numerator": 9001909938763292244967140846508, + "F_lower": "18003819877526584489934281693016425520119539588033266988118468702645646089257975251652303180027702353003513070868479156762946656937175485023146897607/2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "width": 10, + "multiplicity": 8899436, + "log_lower": "2025892473901652377995140021789/500000000000000000000000000000", + "rounded_numerator": 10002068363814316054540972422018, + "F_lower": "750155127286073704090572931651405143565657166384743513515447706061025958880821118489001937848334382792139410195458786396422330838316438805673981697/75000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "width": 11, + "multiplicity": 8550388, + "log_lower": "3956474767998979895946327920297/1000000000000000000000000000000", + "rounded_numerator": 11002221675233373842982126452011, + "F_lower": "66013330051400243057892758712067924738348717171126820467352987883135614901221354091352165992742969101204438384969946149527347911776314265460440782039/6000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "width": 12, + "multiplicity": 6150660, + "log_lower": "3869463391009350129778562018423/1000000000000000000000000000000", + "rounded_numerator": 12002370339271127180649896872632, + "F_lower": "6001185169635563590324948436316318684927591123797386187371370297559296517178694894423958278025882945456469794840252366702150798040357630694169534971/500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "width": 13, + "multiplicity": 5359966, + "log_lower": "3789420683335813703954784056697/1000000000000000000000000000000", + "rounded_numerator": 13002514744170010275549331790141, + "F_lower": "26005029488340020551098663580282373193105731291628784877314041014078617790937270210158694606021907172594494541701291093782286569853524720950556162779/2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "width": 14, + "multiplicity": 3947398, + "log_lower": "3715312711182091825485686633361/1000000000000000000000000000000", + "rounded_numerator": 14002655218248028847011050626683, + "F_lower": "14002655218248028847011050626683709498862789319902248518071917731237639574778099378905208288133134165559866593195085086699080835454329289879280116857/1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "width": 15, + "multiplicity": 3264367, + "log_lower": "3646319839695140374012266928113/1000000000000000000000000000000", + "rounded_numerator": 15002792042789519047921967798767, + "F_lower": "6001116817115807619168787119507071207244697735329720109200214325927456075404351703596752171756455020658583149686557844858443415428216816647064908061/400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "width": 16, + "multiplicity": 2045758, + "log_lower": "3581781318557569202339343012429/1000000000000000000000000000000", + "rounded_numerator": 16002925461483372049654244346367, + "F_lower": "2000365682685421506206780543295990203411142402340272785504938201131890105657510435403955511009185390599409488453615483190272876547679754017853617819/125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "width": 17, + "multiplicity": 9608825, + "log_lower": "3521156696741134359758736880389/1000000000000000000000000000000", + "rounded_numerator": 17003055687492759010954703819698, + "F_lower": "34006111374985518021909407639397294259237601310703427572004585653204574626075203107021868106950064241842214473250828094025936077650610660152413038883/2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "width": 18, + "multiplicity": 928096, + "log_lower": "3463998282901185747800548902959/1000000000000000000000000000000", + "rounded_numerator": 18003182908855861559879329394878, + "F_lower": "18003182908855861559879329394878660218480607637583139126962060520307038623897358924752189853524504674507251905738426545083622455960025979338799473481/1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "width": 19, + "multiplicity": 299299, + "log_lower": "1704965530815454989999622033187/500000000000000000000000000000", + "rounded_numerator": 19003307292682911625373720082646, + "F_lower": "14252480469512183719030290061985152461823800414110067376391866251145472173261736831326914215438540641289278436198576357621013451703078796863235274541/750000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "width": 20, + "multiplicity": 282371, + "log_lower": "83965944181083986164326198053/25000000000000000000000000000", + "rounded_numerator": 20003428988467329793795104829575, + "F_lower": "93766073383440608408414553888635878482190959364515058521827998695283023393948594118021365679953200841541441848955252673900795201266763769551801/4687500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "width": 21, + "multiplicity": 16346100, + "log_lower": "413730950384240930438459189737/125000000000000000000000000000", + "rounded_numerator": 21003548130733080815217095268042, + "F_lower": "82045109885676096934441778390789959453998283527933924538362308049586918268109828449018773560573600802173185618269583119142310244659378257773371523/3906250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "width": 22, + "multiplicity": 97405, + "log_lower": "3263327587439034586529095798839/1000000000000000000000000000000", + "rounded_numerator": 22003664841176702901287290426983, + "F_lower": "22003664841176702901287290426983132701716330021831766481751187338194857636039698023404003854938834272630064461734670590728363951123690940729936241539/1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "width": 23, + "multiplicity": 72402275, + "log_lower": "804718956217050187300379666613/250000000000000000000000000000", + "rounded_numerator": 23003779230419129316371435541181, + "F_lower": "718868100950597791136607360661933548047725138398642771690928383218032171532177781972909728190605185128852107300687382073110777241784815917013155301/31250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "width": 25, + "multiplicity": 64793806, + "log_lower": "313549421592914969080675283181/100000000000000000000000000000", + "rounded_numerator": 25004001440844358166651921235820, + "F_lower": "2000320115267548653332153698865651623806895025380745520226357102131333359226025247040793432854197302044903509671002641923437739574298818525703611/80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "width": 481, + "multiplicity": 8146600, + "log_lower": "35700554138317851917337677133/200000000000000000000000000000", + "rounded_numerator": 481004382557783000847004791090907, + "F_lower": "7696070120924528013552076657454516820842675646260667741287247456776811982856312116443358668994776871345912779876451897219264462098496090459847856187/16000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "width": 525, + "multiplicity": 64793806, + "log_lower": "22742944551431673576538712861/250000000000000000000000000000", + "rounded_numerator": 525002437825581479427560467590997, + "F_lower": "656253047281976849284450584488747368775311786783066714113936881832216652392728045445105839084427783835597591431687002165926545195631844143084824071/1250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "width": 529, + "multiplicity": 64211400, + "log_lower": "41690804469525529197382917321/500000000000000000000000000000", + "rounded_numerator": 529002251451011435621719691688442, + "F_lower": "132250562862752858905429922922110568896738847567840463268253449564880091965459076449709822768870856714520528753467943468558263030665504772858853556999/250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + } + ], + "weighted_lower_numerator": 78862289297575444416483394596264687443210, + "weighted_lower_denominator": 78862288450000000000000000000000000000000, + "exact_unrounded_lower": "82291084484426550695460933491756445854630745599991733867356713526464686131874222115238379719413598221260763974543102733545324785437602595789453502640473419/82291083600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "lower_strict_gap": "3685110627897753889548976901927/342879515000000000000000000000000000000" +} diff --git a/research/profile-aware-frame-search/math/verify.ps1 b/research/profile-aware-frame-search/math/verify.ps1 new file mode 100644 index 0000000000..87f30acf5e --- /dev/null +++ b/research/profile-aware-frame-search/math/verify.ps1 @@ -0,0 +1,9 @@ +param([string]$LeanExecutable = "lean") +$ErrorActionPreference = "Stop" +$taskMathRoot = $PSScriptRoot +$env:LEAN_PATH = $taskMathRoot +$taskModules = @("DirtyComplementSafety", "FreshKernelReclaim", "CoordinateConjugacy", "FiniteRationalChecks", "RankFlowPrice", "ProfileSearchCertificate", "Audit") +foreach ($taskModule in $taskModules) { + & $LeanExecutable -o (Join-Path $taskMathRoot ($taskModule + ".olean")) (Join-Path $taskMathRoot ($taskModule + ".lean")) + if ($LASTEXITCODE -ne 0) { throw "Lean compilation failed: $taskModule" } +} diff --git a/research/profile-aware-frame-search/math/verify_math.py b/research/profile-aware-frame-search/math/verify_math.py new file mode 100644 index 0000000000..5a527a8e55 --- /dev/null +++ b/research/profile-aware-frame-search/math/verify_math.py @@ -0,0 +1,84 @@ +"""Serial Lean build and complete theorem/axiom receipt for frozen-62 research.""" +from pathlib import Path +import argparse, hashlib, json, os, re, subprocess, time + +HERE = Path(__file__).resolve().parent +ap = argparse.ArgumentParser() +ap.add_argument('--lean', default=r'C:\Users\Propietario\.elan\toolchains\leanprover--lean4---v4.31.0\bin\lean.exe') +args = ap.parse_args() +modules = [ + ('DirtyComplementSafety', 'DirtyComplementSafety'), + ('FreshKernelReclaim', 'FreshKernelReclaim'), + ('CoordinateConjugacy', 'CoordinateConjugacy'), + ('FiniteRationalChecks', 'FrontierRationalCertificate'), + ('RankFlowPrice', 'RankFlowPrice'), + ('ProfileSearchCertificate', 'RefinedFrontierCertificate'), +] +names = [] +inventory = [] +for module, namespace in modules: + source = HERE/f'{module}.lean' + text = source.read_text(encoding='utf-8') + if re.search(r'\b(?:sorry|admit|native_decide)\b', text): + raise ValueError(f'Forbidden proof escape in {source.name}') + theorems = re.findall(r'^theorem\s+(\w+)', text, flags=re.M) + names.extend(f'{namespace}.{name}' for name in theorems) + inventory.append(dict(module=module, namespace=namespace, theorem_count=len(theorems), + source_sha256=hashlib.sha256(source.read_bytes()).hexdigest())) +audit = ''.join(f'import {module}\n' for module, _ in modules) +audit += '\n/- Every theorem in this packet is included in the kernel axiom audit. -/\n' +audit += ''.join(f'#print axioms {name}\n' for name in names) +(HERE/'Audit.lean').write_text(audit, encoding='utf-8') +(HERE/'lean-toolchain').write_text('leanprover/lean4:v4.31.0\n', encoding='utf-8') +(HERE/'lakefile.lean').write_text('''import Lake +open Lake DSL +package frozen62Research +lean_lib Frozen62Research where + roots := #[`DirtyComplementSafety, `FreshKernelReclaim, `CoordinateConjugacy, + `FiniteRationalChecks, `RankFlowPrice, `ProfileSearchCertificate, `Audit] +''', encoding='utf-8') +(HERE/'verify.ps1').write_text('''param([string]$LeanExecutable = "lean") +$ErrorActionPreference = "Stop" +$taskMathRoot = $PSScriptRoot +$env:LEAN_PATH = $taskMathRoot +$taskModules = @("DirtyComplementSafety", "FreshKernelReclaim", "CoordinateConjugacy", "FiniteRationalChecks", "RankFlowPrice", "ProfileSearchCertificate", "Audit") +foreach ($taskModule in $taskModules) { + & $LeanExecutable -o (Join-Path $taskMathRoot ($taskModule + ".olean")) (Join-Path $taskMathRoot ($taskModule + ".lean")) + if ($LASTEXITCODE -ne 0) { throw "Lean compilation failed: $taskModule" } +} +''', encoding='utf-8') +env = dict(os.environ, LEAN_PATH=str(HERE)) +builds = [] +for module in [m for m, _ in modules]+['Audit']: + started = time.monotonic() + result = subprocess.run([args.lean, '-o', str(HERE/f'{module}.olean'), + str(HERE/f'{module}.lean')], env=env, capture_output=True, text=True) + (HERE/f'{module}-compile.log').write_text(result.stdout+result.stderr, encoding='utf-8') + assert result.returncode == 0, result.stdout+result.stderr + assert 'sorryAx' not in result.stdout+result.stderr + builds.append(dict(module=module, returncode=result.returncode, + elapsed_seconds=round(time.monotonic()-started,3))) +data = json.loads((HERE/'weighted-input.json').read_text(encoding='utf-8')) +lower = json.loads((HERE/'old-profile-lower-data.json').read_text(encoding='utf-8')) +version = subprocess.run([args.lean,'--version'],capture_output=True,text=True,check=True).stdout.strip() +receipt = dict(status='PASS serial Lean kernel compilation and all-theorem axiom audit', + compiler=version, compiler_executable=args.lean, source_commit=data['source_commit'], + kappa=data['kappa'], bit_saving=data['bit_saving'], + frozen_old_scoped=data['comparison']['old_formal_scoped_limit'], + frozen_old_published=data['comparison']['old_published_kappa'], + fresh_universal_theorems=34, concrete_instance_theorems=15, + reused_helper_theorems=4, total_audited_theorems=len(names), + namespaces=[n for _,n in modules], inventory=inventory, builds=builds, + permitted_axioms=['propext','Classical.choice','Quot.sound'], + proof_escapes={'sorry':False,'admit':False,'native_decide':False,'new_axioms':False}, + weighted_input_sha256=hashlib.sha256((HERE/'weighted-input.json').read_bytes()).hexdigest(), + old_profile_lower_data_sha256=hashlib.sha256((HERE/'old-profile-lower-data.json').read_bytes()).hexdigest(), + old_rounded_lower_strict_gap=lower['lower_strict_gap'], + auxiliary_files={name:hashlib.sha256((HERE/name).read_bytes()).hexdigest() for name in + ['Audit.lean','generate_profile_case.py','verify_math.py','verify.ps1','lakefile.lean','lean-toolchain']}, + scope='Finite Boolean encoder/reclaim/conjugacy identities and exact rational moment/assembly gates. ' + 'Source-profile binding, analytic log/exp enclosure, physical frame/tape/routing contracts and ' + 'global integer multiplication theorem remain explicit external contracts.') +(HERE/'lean-receipt.json').write_text(json.dumps(receipt,indent=2)+'\n',encoding='utf-8') +print(json.dumps(dict(status=receipt['status'], audited_theorems=len(names), + receipt=str(HERE/'lean-receipt.json'), kappa=data['kappa'], builds=builds),indent=2)) diff --git a/research/profile-aware-frame-search/math/weighted-input.json b/research/profile-aware-frame-search/math/weighted-input.json new file mode 100644 index 0000000000..f247d1d08d --- /dev/null +++ b/research/profile-aware-frame-search/math/weighted-input.json @@ -0,0 +1,375 @@ +{ + "status": "exact_weighted_F_rounding_and_47_slacks_passed", + "source_commit": "ad0f25ff7b23cff7f08ad237c2254e6ecf74257e", + "source_certificate_sha256": "70bc8a24a5565b840a5aac845703819c89c83b8c607acae021f64cf296f10c6e", + "refined_certificate_sha256": "35cd0a62b8b41927d44ceee9deda3da41e6343d6abba5a6b29d3deed28d94c9b", + "m": 575, + "W": 137151806, + "total_rank": 78860441550, + "bit_saving": "510429345092917/10000000000000000000", + "kappa": "255201646305539/5000000000000000000", + "rows": [ + { + "width": 1, + "multiplicity": 1721422350, + "log_upper": "6354370040797350440008271498263/1000000000000000000000000000000", + "v": "3243456938402243863909651226274800290539103171/10000000000000000000000000000000000000000000000000", + "F_upper": "600129748797549001024213532542223268107005374260170770858691138580797146561650807752071408982255241/599935130861231955122721806975474503994189217936580000000000000000000000000000000000000000000000000", + "rounded_F_upper_numerator": 1000324398299592263783078336787, + "rounding_scale": 1000000000000000000000000000000, + "rounding_slack": "25849051879359899600935959862535194088187885317652247928591017744759/599935130861231955122721806975474503994189217936580000000000000000000000000000000000000000000000000" + }, + { + "width": 2, + "multiplicity": 83691457, + "log_upper": "1132244572047481026118207875361/200000000000000000000000000000", + "v": "577930855395205817962380532898182389699918037/2000000000000000000000000000000000000000000000000", + "F_upper": "24004623780847235264377996752396702436836211658749037480789772162850944775966798643586044517933369/11998844138289209588364075238934203635220600163926000000000000000000000000000000000000000000000000", + "rounded_F_upper_numerator": 2000578014364457354229984001527, + "rounding_scale": 1000000000000000000000000000000, + "rounding_slack": "6002775761821227258781962905767508035268858348203356413955482066631/11998844138289209588364075238934203635220600163926000000000000000000000000000000000000000000000000" + }, + { + "width": 3, + "multiplicity": 44567951, + "log_upper": "5255757752129240748613026261341/1000000000000000000000000000000", + "v": "2682692987386349953716449315682962012770021697/10000000000000000000000000000000000000000000000000", + "F_upper": "1800321944749011355710142349543039809993427830062755987313087002389512562765363168579446425552279427/599946346140252273000925671013686340759744599566060000000000000000000000000000000000000000000000000", + "rounded_F_upper_numerator": 3000804915858495195216401724574, + "rounding_scale": 1000000000000000000000000000000, + "rounding_slack": "246653101002874744907002923990753434065873272995271420553574447720573/599946346140252273000925671013686340759744599566060000000000000000000000000000000000000000000000000" + }, + { + "width": 4, + "multiplicity": 25882728, + "log_upper": "4968075679677459821173807255347/1000000000000000000000000000000", + "v": "2535851615549814315714154102707023606460077199/10000000000000000000000000000000000000000000000000", + "F_upper": "200033813498388469553077277458039727375148431578800712793426877353028470632284904254130072346561867/49995773580640750309473809743162154960655899871335000000000000000000000000000000000000000000000000", + "rounded_F_upper_numerator": 4001014469267960435740589278167, + "rounding_scale": 1000000000000000000000000000000, + "rounding_slack": "45717352579409474700575373871844448278345192358040745869927653438133/49995773580640750309473809743162154960655899871335000000000000000000000000000000000000000000000000" + }, + { + "width": 5, + "multiplicity": 19766775, + "log_upper": "4744932128363250065407512165037/1000000000000000000000000000000", + "v": "2421952598790794511528291698806837618603742929/10000000000000000000000000000000000000000000000000", + "F_upper": "600096883969806022569944379653482293822121363325813633979876304352407863027965821801911768317499041/119990312189604836821953886833204772649525585028284000000000000000000000000000000000000000000000000", + "rounded_F_upper_numerator": 5001211122957595140592923841040, + "rounding_scale": 1000000000000000000000000000000, + "rounding_slack": "116093999989606634088870535729864196075403292009538198088231682500959/119990312189604836821953886833204772649525585028284000000000000000000000000000000000000000000000000" + }, + { + "width": 6, + "multiplicity": 18955864, + "log_upper": "2281305285784647719597897069941/500000000000000000000000000000", + "v": "1164445162980067589809350376949281620692707897/5000000000000000000000000000000000000000000000000", + "F_upper": "450069870777576416818417076223205691490172578543362573694787065492903885525638081345251531698487827/74994177774185099662050953248115253591896536460515000000000000000000000000000000000000000000000000", + "rounded_F_upper_numerator": 6001397496920112844944433280626, + "rounding_scale": 1000000000000000000000000000000, + "rounding_slack": "42487889272210575754027193233860960327118237844308654748468301512173/74994177774185099662050953248115253591896536460515000000000000000000000000000000000000000000000000" + }, + { + "width": 7, + "multiplicity": 17038929, + "log_upper": "220422994587101856745145937741/50000000000000000000000000000", + "v": "112510364770513989574758416153738134742080497/500000000000000000000000000000000000000000000000", + "F_upper": "1166841692635206940156983872416072648450071403745253636136348671733547835644135140755624466041007/166654165515025498445602804620427362429473102167000000000000000000000000000000000000000000000000", + "rounded_F_upper_numerator": 7001575322340231459947454892144, + "rounding_scale": 1000000000000000000000000000000, + "rounding_slack": "35631621365821475610616318988635739836242031912859244375533958993/166654165515025498445602804620427362429473102167000000000000000000000000000000000000000000000000" + }, + { + "width": 8, + "multiplicity": 13484808, + "log_upper": "4274928499117514511756575133889/1000000000000000000000000000000", + "v": "2182048954123599541616405540923135264420564213/10000000000000000000000000000000000000000000000000", + "F_upper": "600087286719502582173559273234828131720625384063199374940300122544232524054705047770288721256309369/74994544877614691001145958986147692161838948589467500000000000000000000000000000000000000000000000", + "rounded_F_upper_numerator": 8001745829630658044037723560953, + "rounding_scale": 1000000000000000000000000000000, + "rounding_slack": "64536787283532592880689824134921925021686555357479729711278743690631/74994544877614691001145958986147692161838948589467500000000000000000000000000000000000000000000000" + }, + { + "width": 9, + "multiplicity": 10820396, + "log_upper": "2078572731730565528608890512209/500000000000000000000000000000", + "v": "1060964518185228021761623702545306652827923653/5000000000000000000000000000000000000000000000000", + "F_upper": "1350190983744084720676034467486705780039449550958937031082498632529862612847564206091833784771779681/149989390354818147719782383762974546933471720763470000000000000000000000000000000000000000000000000", + "rounded_F_upper_numerator": 9001909938763293258701452733917, + "rounding_scale": 1000000000000000000000000000000, + "rounding_slack": "33897586871411438461814341344798401139833156047783908166215228220319/149989390354818147719782383762974546933471720763470000000000000000000000000000000000000000000000000" + }, + { + "width": 10, + "multiplicity": 9030007, + "log_upper": "4051784947803304755990280043579/1000000000000000000000000000000", + "v": "2068149937364579737430543137022949276564229943/10000000000000000000000000000000000000000000000000", + "F_upper": "600082730274738746610612312855307964335576173470066479403743690501144934591923895697097964577783249/59995863700125270840525138913725954101446871540114000000000000000000000000000000000000000000000000", + "rounded_F_upper_numerator": 10002068363814317070989802125913, + "rounding_scale": 1000000000000000000000000000000, + "rounding_slack": "34035418430665503603137468346704564462919066450186302902035422216751/59995863700125270840525138913725954101446871540114000000000000000000000000000000000000000000000000" + }, + { + "width": 11, + "multiplicity": 8576424, + "log_upper": "1978237383999489947973163960149/500000000000000000000000000000", + "v": "1009750412353185017487106765252282648090164633/5000000000000000000000000000000000000000000000000", + "F_upper": "183358017367363616491727346788535940485131110686653508570039527116259124573130414023507368831585731/16665544721764052016647236548038608574835455372630000000000000000000000000000000000000000000000000", + "rounded_F_upper_numerator": 11002221675233374859524662126932, + "rounding_scale": 1000000000000000000000000000000, + "rounding_slack": "1425678015375974133956498725774900639697845540745976492631168414269/16665544721764052016647236548038608574835455372630000000000000000000000000000000000000000000000000" + }, + { + "width": 12, + "multiplicity": 6356372, + "log_upper": "483682923876168766222320252303/125000000000000000000000000000", + "v": "246885958066740050690119024014334362418237851/1250000000000000000000000000000000000000000000000", + "F_upper": "9376234490743009990785577302771498793539637598746716467512554578943745009892237691595024009098201/781198565425402762489439558536663680341162867114375000000000000000000000000000000000000000000000", + "rounded_F_upper_numerator": 12002370339271128195221822330693, + "rounding_scale": 1000000000000000000000000000000, + "rounding_slack": "673949277003660921968767437875645928596896011774183404975990901799/781198565425402762489439558536663680341162867114375000000000000000000000000000000000000000000000" + }, + { + "width": 13, + "multiplicity": 5378895, + "log_upper": "1894710341667906851977392028349/500000000000000000000000000000", + "v": "967115758838326702792589068803584836503104033/5000000000000000000000000000000000000000000000000", + "F_upper": "1950251462256365547857348494489463365574533008662659703583357792033367699135658063370810972271246157/149990328842411616732972074109311964151634968959670000000000000000000000000000000000000000000000000", + "rounded_F_upper_numerator": 13002514744170011286506303974576, + "rounding_scale": 1000000000000000000000000000000, + "rounding_slack": "112067633009307732796245409207801535241609713691856629189027728753843/149990328842411616732972074109311964151634968959670000000000000000000000000000000000000000000000000" + }, + { + "width": 14, + "multiplicity": 4071644, + "log_upper": "1857656355591045912742843316681/500000000000000000000000000000", + "v": "948202316992032508698709880645437176401048477/5000000000000000000000000000000000000000000000000", + "F_upper": "1050132754617992322194630130407885819971306888802826243318333182456604250107845823201612494328136703/74995258988415039837456506450596772814117994757615000000000000000000000000000000000000000000000000", + "rounded_F_upper_numerator": 14002655218248029853031980654616, + "rounding_scale": 1000000000000000000000000000000, + "rounding_slack": "33192211399641193666675689575362583004533843055016798387505671863297/74995258988415039837456506450596772814117994757615000000000000000000000000000000000000000000000000" + }, + { + "width": 15, + "multiplicity": 3358230, + "log_upper": "1823159919847570187006133464057/500000000000000000000000000000", + "v": "930594323887450300667544894107244455744784269/5000000000000000000000000000000000000000000000000", + "F_upper": "450055838257450633972662312531512875955119249762568369036859100843926555278819890792981192049593083/29998138811352225099398664910211785511088510431462000000000000000000000000000000000000000000000000", + "rounded_F_upper_numerator": 15002792042789520047938725929440, + "rounding_scale": 1000000000000000000000000000000, + "rounding_slack": "25712166543125075805903266691255055666746089221389207018807950406917/29998138811352225099398664910211785511088510431462000000000000000000000000000000000000000000000000" + }, + { + "width": 16, + "multiplicity": 2081178, + "log_upper": "358178131855756920233934301243/100000000000000000000000000000", + "v": "182824629269738476751865697913873649303595831/1000000000000000000000000000000000000000000000000", + "F_upper": "6000731331941924021524322413920443892874053746167374875980505990115447053690074886485066600580561/374977146921341282690406016787760765793837050521125000000000000000000000000000000000000000000000", + "rounded_F_upper_numerator": 16002925461483373042799450631504, + "rounding_scale": 1000000000000000000000000000000, + "rounding_slack": "84277636352530475432834597780558307189079852447113514933399419439/374977146921341282690406016787760765793837050521125000000000000000000000000000000000000000000000" + }, + { + "width": 17, + "multiplicity": 9614138, + "log_upper": "352115669674113435975873688039/100000000000000000000000000000", + "v": "179730170668711616259974240519051359926519763/1000000000000000000000000000000000000000000000000", + "F_upper": "102012222200755354616177169877251903849674400735387636126331607424078275957456703860729988902794873/5999640539658662576767480051518961897280146960474000000000000000000000000000000000000000000000000", + "rounded_F_upper_numerator": 17003055687492759996522223569431, + "rounding_scale": 1000000000000000000000000000000, + "rounding_slack": "3405274526808817750811471806295290296701594213590139270011097205127/5999640539658662576767480051518961897280146960474000000000000000000000000000000000000000000000000" + }, + { + "width": 18, + "multiplicity": 924554, + "log_upper": "43299978536264821847506861287/12500000000000000000000000000", + "v": "22101579686803015867818735541334062045204179/125000000000000000000000000000000000000000000000", + "F_upper": "31253683759441075386679202115950651552033839038867697614594007201047867782699225644537933021347/1736008788982931467519130468816938268231272202875000000000000000000000000000000000000000000000", + "rounded_F_upper_numerator": 18003182908855862537293895932137, + "rounding_scale": 1000000000000000000000000000000, + "rounding_slack": "697738383508437860485860152385271184457713594649355462066978653/1736008788982931467519130468816938268231272202875000000000000000000000000000000000000000000000" + }, + { + "width": 19, + "multiplicity": 317009, + "log_upper": "27279448493047279839993952531/8000000000000000000000000000", + "v": "13924231028802084618388292095252140282322927/80000000000000000000000000000000000000000000000", + "F_upper": "729684663008455101800120237881026841475168636093072523119388062564177897789186291342107087099251/38397772123035391666461057873264759657554828331680000000000000000000000000000000000000000000000", + "rounded_F_upper_numerator": 19003307292682912594167244038708, + "rounding_scale": 1000000000000000000000000000000, + "rounding_slack": "14175786405370087008454626884635147877887193483148657892912900749/38397772123035391666461057873264759657554828331680000000000000000000000000000000000000000000000" + }, + { + "width": 20, + "multiplicity": 303623, + "log_upper": "3358637767243359446573047922121/1000000000000000000000000000000", + "v": "1714347275938364963332794575239060934524716957/10000000000000000000000000000000000000000000000000", + "F_upper": "66674286314447124123980641483737884804407896630382262225232693238579702868449728658604840107037761/3333142850302673515004074133936084548785052809227000000000000000000000000000000000000000000000000", + "rounded_F_upper_numerator": 20003428988467330753587966796264, + "rounding_scale": 1000000000000000000000000000000, + "rounding_slack": "2914450389011364313277483817505533162549499878199341395159892962239/3333142850302673515004074133936084548785052809227000000000000000000000000000000000000000000000000" + }, + { + "width": 21, + "multiplicity": 16346100, + "log_upper": "3309847603073927443507673517897/1000000000000000000000000000000", + "v": "1689443344394385881301966412482413987727435549/10000000000000000000000000000000000000000000000000", + "F_upper": "1400157688038654041825392444516271191676161488307534922641169227776518202861508995801623809214173269/66662912348123568031374884519083372413360605698780000000000000000000000000000000000000000000000000", + "rounded_F_upper_numerator": 21003548130733081765703209417422, + "rounding_scale": 1000000000000000000000000000000, + "rounding_slack": "4024340704179324028937003607850672825934154636164198376190785826731/66662912348123568031374884519083372413360605698780000000000000000000000000000000000000000000000000" + }, + { + "width": 22, + "multiplicity": 97405, + "log_upper": "81583189685975864663227394971/25000000000000000000000000000", + "v": "41642454082003881521911624218016923853520407/250000000000000000000000000000000000000000000000", + "F_upper": "4125458086069935844386560111985806295828520569805670089809997363489466111310165754116478819902139/187489589386479499029619522093945495769036619898250000000000000000000000000000000000000000000000", + "rounded_F_upper_numerator": 22003664841176703842222060680188, + "rounding_scale": 1000000000000000000000000000000, + "rounding_slack": "64412912383610966942978820038208551119699040705245883521180097861/187489589386479499029619522093945495769036619898250000000000000000000000000000000000000000000000" + }, + { + "width": 23, + "multiplicity": 72402275, + "log_upper": "3218875824868200749201518666453/1000000000000000000000000000000", + "v": "1643008679222898704762719054936435773215813401/10000000000000000000000000000000000000000000000000", + "F_upper": "13801511630072868026849184942971547643729129178439248934913283739681152815598023145574157511177296423/599967139826415542025904745618901271284535683731980000000000000000000000000000000000000000000000000", + "rounded_F_upper_numerator": 23003779230419130247561957694198, + "rounding_scale": 1000000000000000000000000000000, + "rounding_slack": "344784464658257323206425122283461922982044635028894425842488822703577/599967139826415542025904745618901271284535683731980000000000000000000000000000000000000000000000000" + }, + { + "width": 25, + "multiplicity": 64793806, + "log_upper": "3135494215929149690806752831811/1000000000000000000000000000000", + "v": "1600448259179345159146932171338874946668382687/10000000000000000000000000000000000000000000000000", + "F_upper": "600064020491801804116562253752589278728089378419302446866855596883550065998946164375655220281339969/23998719641392656523872682454262928900042665293850400000000000000000000000000000000000000000000000", + "rounded_F_upper_numerator": 25004001440844359077943226687537, + "rounding_scale": 1000000000000000000000000000000, + "rounding_slack": "18832176359805245384709937098850799622039529476300424344779718660031/23998719641392656523872682454262928900042665293850400000000000000000000000000000000000000000000000" + }, + { + "width": 481, + "multiplicity": 8146600, + "log_upper": "89251385345794629793344192833/500000000000000000000000000000", + "v": "45556526170689522362109361323810046750463861/5000000000000000000000000000000000000000000000000", + "F_upper": "72150438254780028027117409502276998132612227756170685105116644414580212955325895201278476178840141401/149999544434738293104776378906386761899532495361390000000000000000000000000000000000000000000000000", + "rounded_F_upper_numerator": 481004382557783000847188951501384, + "rounding_scale": 1000000000000000000000000000000, + "rounding_slack": "79165227531361985040341577076319283347700839268558721523821159858599/149999544434738293104776378906386761899532495361390000000000000000000000000000000000000000000000000" + }, + { + "width": 525, + "multiplicity": 64793806, + "log_upper": "18194355641145338861230970289/200000000000000000000000000000", + "v": "9286933034297435307849471509297728771343013/2000000000000000000000000000000000000000000000000", + "F_upper": "168000520068853650532661914351500372977575628594492838578923940103324376883885030578832801927427183/319999504696904837470116914694852837454465528372640000000000000000000000000000000000000000000000", + "rounded_F_upper_numerator": 525002437825581479427574027499022, + "rounding_scale": 1000000000000000000000000000000, + "rounding_slack": "27404814316747546438500793761982410361436966527501167198072572817/319999504696904837470116914694852837454465528372640000000000000000000000000000000000000000000000" + }, + { + "width": 529, + "multiplicity": 64211400, + "log_upper": "83381608939051058394765834643/1000000000000000000000000000000", + "v": "42560420043553545615786883598071255892523631/10000000000000000000000000000000000000000000000000", + "F_upper": "317400900579446346561441314962603478487781061895519828111266535135539921361148634020068435961621381169/599999148791599128929087684262328038574882149527380000000000000000000000000000000000000000000000000", + "rounded_F_upper_numerator": 529002251451011435621729334582716, + "rounding_scale": 1000000000000000000000000000000, + "rounding_slack": "113350033209559637482970636223735107487447768130059931564038378618831/599999148791599128929087684262328038574882149527380000000000000000000000000000000000000000000000000" + } + ], + "weighted_upper_numerator": 78862288449999999998723508056180137442390, + "weighted_upper_denominator": 78862288450000000000000000000000000000000, + "rounded_moment_upper": "342879514999999999994450035026870162793/342879515000000000000000000000000000000", + "rounded_moment_gap": "5549964973129837207/342879515000000000000000000000000000000", + "named_slacks": { + "K_dominates_log": "85071557515486583078118660786874416836809781697639/1666751738224182152833163190218302361000000000000000000", + "K_geometry": "1250085071557515486583163190218302361/1666751738224182152833163190218302361000000000000000000", + "a_below_b": "206570654907083/10000000000000000000", + "a_positive": "510429345092917/10000000000000000000", + "alpha_below_one": "3333333333333333331666751738224182152833163190218302361/3333503476448364305666326380436604722000000000000000000", + "alpha_below_one_fourth": "833205725997060102417006952896728611333163190218302361/3333503476448364305666326380436604722000000000000000000", + "alpha_positive": "170143115030973999574642212422569166836809781697639/3333503476448364305666326380436604722000000000000000000", + "artificial_boundary": "93338777913014324466322699388643897562499489570654907083/13334013905793457222665305521746418888000000000000000000", + "b_below_one_over32": "311783/10000000", + "beta_below_one": "19/20", + "beta_positive": "1/20", + "c_below_one": "4999744785327453540250510429345092917/5000000000000000000000000000000000000", + "c_positive": "255214672546459749489570654907083/5000000000000000000000000000000000000", + "cell_above_band": "3333333333333333328333248261775817847166836809781697639/6667006952896728611332652760873209444000000000000000000", + "compact_leaf": "85360327453541500510429345092917/5000000000000000000000000000000000000", + "compact_reservations": "1/4000000000000000000", + "delta_below_one_eighth": "999999999999999999/8000000000000000000", + "delta_positive": "1/8000000000000000000", + "epsilon_below_one": "85071557515487833163190218302361/1666751738224182152833163190218302361", + "epsilon_positive": "1666666666666666665000000000000000000/1666751738224182152833163190218302361", + "g1_above_kappa": "9104063825891186991290171003908922421/8333758691120910764165815951091511805000000000000000000", + "g2_above_kappa": "26052481839/10000000000000000000", + "g3_above_kappa": "96288141846284528390544381602176327/1041719836390113845520726993886438975625000000000000000", + "g4_above_kappa": "26052481839/10000000000000000000", + "g5_above_kappa": "31163717151524942109492288275813820343/66670069528967286113326527608732094440000000000000000000", + "g6_above_kappa": "64498751916008585166155552080179867563/66670069528967286113326527608732094440000000000000000000", + "g7_above_kappa": "8332907975545755894938247874799675186290171003908922421/8333758691120910764165815951091511805000000000000000000", + "gamma_sublinear": "1/2000000000000000000", + "guard_width": "85071557515487833163190218302361/1666751738224182152833163190218302361", + "lambda_above_internal": "510429345092917/10000000000000000000000000000000000000", + "lambda_above_sigma": "206570654907083000510429345092917/10000000000000000000000000000000000000", + "lambda_above_tau": "510429345092917/10000000000000000000000000000000000000", + "lambda_prime_above_lambda": "510429345092917/10000000000000000000000000000000000000", + "lambda_prime_below_one": "255214672546458499489570654907083/5000000000000000000000000000000000000", + "literal_scalar_guard": "9693793493753822316795466474748", + "phase_boundary": "136114492024778866309366125101624766836809781697639/2666802781158691444533061104349283777600000000000000000", + "phase_leaf_above_bit": "170720654907083/10000000000000000000", + "phase_local": "680572460123900998553783522236735166836809781697639/13334013905793457222665305521746418888000000000000000000", + "prime_interval_packing": "85071557515487833163190218302361/1666751738224182152833163190218302361", + "q_below_internal": "510429345092917/5000000000000000000000000000000000000", + "q_below_leaf": "85360327453541500510429345092917/5000000000000000000000000000000000000", + "q_below_reservations": "1/4000000000000000000", + "q_positive": "255214672546458499489570654907083/5000000000000000000000000000000000000", + "record_suffix": "85071557515487833163190218302361/1666751738224182152833163190218302361", + "row_product_gap": "6548/25", + "short_record_fallback": "16665815907668492399669308102285443962494717302454522963/16667517382241821528331631902183023610000000000000000000", + "small_field_exposure": "1/1000000000000000000" + }, + "named_margins": { + "g1": "85071557515487833163190218302361/1666751738224182152833163190218302361", + "g2": "510429345092917/10000000000000000000", + "g3": "85071557515486166411451994120208166836809781697639/1666751738224182152833163190218302361000000000000000000", + "g4": "510429345092917/10000000000000000000", + "g5": "136114492024778866309366125101624766836809781697639/2666802781158691444533061104349283777600000000000000000", + "g6": "680572460123900998553783522236735166836809781697639/13334013905793457222665305521746418888000000000000000000", + "g7": "1666666666666666665000000000000000000/1666751738224182152833163190218302361" + }, + "parameters": { + "C0": 2358858462850846165593256368932965330169899180021667007021321420800, + "C1": "1", + "a_bit": "510429345092917/10000000000000000000", + "a_complex": "717/10000000", + "alpha_squared_power": "170143115030973999574642212422569166836809781697639/3333503476448364305666326380436604722000000000000000000", + "beta": "1/20", + "c": "255214672546459749489570654907083/5000000000000000000000000000000000000", + "delta": "1/8000000000000000000", + "epsilon": "1666666666666666665000000000000000000/1666751738224182152833163190218302361", + "h": "1/1000000000000000000", + "kappa": "255201646305539/5000000000000000000", + "lambda_": "9999489570654907083000510429345092917/10000000000000000000000000000000000000", + "lambda_prime": "4999744785327453541500510429345092917/5000000000000000000000000000000000000", + "q": "255214672546458499489570654907083/5000000000000000000000000000000000000", + "sigma": "9999283/10000000", + "tau": "9999489570654907083/10000000000000000000" + }, + "comparison": { + "old_published_kappa": "5101691/100000000000", + "old_bit_saving": "39859/781250000", + "old_formal_scoped_limit": "39859/781289859", + "exceeds_old_scoped_limit": true, + "parameter_only": false, + "new_producer_claim": false, + "new_compiler_word_claim": true, + "frozen62_network_at_new_saving_lower": "82291084484426550695460933491756445854630745599991733867356713526464686131874222115238379719413598221260763974543102733545324785437602595789453502640473419/82291083600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "frozen62_network_rejected_at_new_saving": true + }, + "scope": "New profile-aware compiler words on the unchanged frozen PR62 graph; fresh full word/basis/frame/profile validation, inherited data geometry and all-size interfaces." +} diff --git a/research/profile-aware-frame-search/matrix-exponent-synthesis.tex b/research/profile-aware-frame-search/matrix-exponent-synthesis.tex new file mode 100644 index 0000000000..dcb2dd383e --- /dev/null +++ b/research/profile-aware-frame-search/matrix-exponent-synthesis.tex @@ -0,0 +1,361 @@ +\documentclass[11pt]{article} +\usepackage[a4paper,margin=23mm]{geometry} +\usepackage{amsmath,amssymb,booktabs,array} +\usepackage[colorlinks=true,urlcolor=blue,linkcolor=blue]{hyperref} +\usepackage{microtype} +\newcommand{\Gi}{\mathbb Z[i]} +\newcommand{\pii}{\pi} +\title{Matrix and Parity Tools for\\Profile-Aware Frame Compilation} +\author{Alejandro Zarzuelo Urdiales\\\small AI-assisted development with OpenAI Codex} +\date{8 October 2026; frozen PR62 research edition} +\begin{document} +\maketitle +\begin{abstract} +We connect the author's certified hybrid matrix circuit to Gaussian parity +arithmetic and to the community's finite integer-multiplication search. +The actual order-16 circuit has 2,208 mixed-input products and an integral +numerator $N=8AB$. We prove sharp finite-precision late-quotient contracts, +implement an exact Gaussian interpreter preserving the hybrid DAG's sharing, +and identify a valid commuting phase-operator domain together with its +physical-child closure obstruction. Domain-aware catalogues and exact +matching certificates prevent arithmetic counts from being substituted for +uncharged network ranks. We combine the exact characteristic-slack objective with a new finite compiler +search over retired dependency circuits, admissible carried-signal exchanges, +and consistently renamed point coordinates. The accepted variant changes the +literal words and their ordered fixed-basis child profiles. It gives conditional +$\kappa=5.10403292611078\times10^{-5}$, strictly above PR \#62's strongest stacked +witness. The new circuit is freshly checked on every input and dirty basis +vector in both orientations, with independent frame reconstruction and exact +bounded-minor/CRT profiles. 53 standalone Lean declarations include +universal dirty-complement and coordinate-conjugacy proofs and a concrete +characteristic/assembly certificate. The frozen old profile is provably +infeasible at the new bit saving. Analytic, compiler-transfer and tape hypotheses +retain their inherited scope. The matrix arithmetic remains separately scoped; +its scalar product count is not inserted as an uncharged network rank. +\end{abstract} + +\section{Audited source and the quantity that must improve} +The author's October 7 revision of his July construction is pinned at +\texttt{7203497dc990e47c2391bff1b9863408d817faeb} in +\texttt{alejandrozu/openmath-2026-judging}. Its actual coefficient tables and +serialized circuit were independently rechecked here: all 4,096 outer +coefficient identities, all 256 complete quadratic output identities, and +all 2,208 nonzero scheduled products. All same-bank terms cancel, leaving +exactly the 4,096 required mixed terms. The 48-product outer is the known +Dumas--Pernet--Sedoglavic construction; the 46-product scalar leaf is Rosowski's. +The current 11-source, 45-endpoint Lean qualification has pinned successful +October 7 GitHub CI evidence. That Mathlib development was not recompiled +locally in this run; the new standalone \texttt{Std} lemmas were. + +The matrix count is a \emph{commutative mixed-input arithmetic schedule}. +It is not tensor rank 2,208. Direct extraction of its bilinear part produces +3,072 distinct primitive ordered products, with no free output-group +cancellation. A certified two-level 48-product outer gives the better +bilinear upper bound $48^2=2,304$. These are model comparisons, not optimality +claims. + +The benchmark is the stacked interval-strip frame construction in PR \#62, pinned at +\texttt{ad0f25ff7b23cff7f08ad237c2254e6ecf74257e}. It reports +$\kappa_0=5.101691\times10^{-5}$ and bit saving +$a_0=39859/781250000$. The comparison uses PR \#62's strongest stacked witness: interval strips and +core-aware pair assembly composed with PR \#57's joint frame compiler. +The construction commit and source certificate are the exact proof pins. The comparison concerns explicit conditional +community witnesses, not unconditional peer-reviewed optimality. + +The community's binding quantity is instead its bit-network characteristic +\begin{equation}\label{eq:moment} + \Phi(a)=\frac1W\sum_{t=1}^{m-1} n_t(t/m)^{1-a}<1. +\end{equation} +Every child, carrier, endpoint copy and physical interface must be charged. +The complex saving $717/10^7$ has headroom. A completed-child precision +improvement or an offline matrix-setup improvement alone does not improve +the binding bit saving. We compared successive primary-source snapshots +\#46--\#49 rather than claiming a record against a superseded construction. + +\section{The sharp late-quotient bridge} +Let an integer circuit have an independently established contract +$N(x)=dF(x)$, $d>0$. For every integer modulus $M$, +\begin{equation}\label{eq:quotient} + N(x)\bmod(dM)=d\bigl(F(x)\bmod M\bigr),\qquad + \frac{N(x)\bmod(dM)}d=F(x)\bmod M. +\end{equation} +This follows from the integer scaled-remainder identity; the quotient is +exact. It also holds for a simulator proved congruent to $N$ modulo $dM$. +Arbitrary dirty values may first be subtracted in that same residue ring: +$((z+dF)\bmod dM-z\bmod dM)\bmod dM$ has the same exact quotient. + +For the actual $d=8$ matrix circuit and $M=2^p$, evaluate its integer +instructions modulo $2^{p+3}$, then divide the output representatives by +eight. This recovers $AB\bmod2^p$. Simply reducing the numerator modulo two +loses the result: $A=B=E_{00}$ gives numerator residue zero but product one. +For every $p\ge1$, products $0$ and $2^{p-1}$ have equal numerator residues +modulo $2^{p+2}$ and different requested $p$-bit results. Consequently +\emph{no function of that smaller numerator residue alone} can recover all +outputs. The $p+3$ boundary is sharp for this interface, not a lower bound +on multiplication algorithms. + +The universal recovery and collision statements are kernel checked in +\texttt{LateQuotient.lean} and \texttt{SharpQuotient.lean}. Fresh actual-circuit +controls cover all 256 binary $2\times2$ input pairs embedded in order 16, +42 signed dense cases, and precisions $1,2,3,4,8,16,31$. The lifted ring and +its extra three numerator bits must be charged; this is not a native +one-bit XOR-network implementation. + +\section{An exact Gaussian DAG, with sharing retained} +Put $\pii=1+i$. Align every canonical Gaussian-dyadic input to a common +numerator tag $E$. Homogeneity makes the product grid $2E$. Since the +actual circuit identity holds over the commutative ring $\Gi$, both +coordinates of every output numerator are divisible by eight at this +grid. Exact coordinate quotients followed by canonical parity reduction +return the matrix product without an extra denominator beyond $2E$. +This does not assert that multiplying two $E$-tag inputs keeps tag $E$. + +The shared interpreter first forms the actual 48 pairs of $4\times4$ +outer blocks, executes their 46-product leaves, then recombines their +integer output numerators. It preserves the author's chronological +composition discipline instead of expanding every output into the flat +certificate. Using the established three-real-product Gaussian identity +gives the following displayed arithmetic schedules: +\begin{center} +\begin{tabular}{lrr} +\toprule +Quantity & Flat certificate interpreter & Shared hybrid interpreter\\ +\midrule +Gaussian mixed product slots & 2,208 & 2,208\\ +Real variable-product slots & 6,624 & 6,624\\ +Real component additions & 193,568 & 57,696\\ +Nonunit fixed-coefficient scales & 42,240 & 7,680\\ +Exact component output quotients & 512 & 512\\ +\bottomrule +\end{tabular} +\end{center} +The shared schedule saves 135,872 displayed component additions. The +comparison excludes input alignment, canonical normalization and physical +tape costs, and makes no runtime or best-known algorithm claim. The +three-real-product identity is separately kernel checked. Five dense +integer/heterogeneous-tag cases compare 1,280 outputs literally with the +pinned flat circuit and independently with Fraction-valued classical dots. + +\section{A valid operator domain, and the remaining obstruction} +The scalar leaf cannot be inserted recursively on arbitrary matrix blocks. +For $U=E_{12}$, $V=E_{21}$, $B=0$, the first leaf output has the defect +$UV-VU=\operatorname{diag}(1,-1)$ instead of zero, including a nonzero +characteristic-two specialization. More generally, the paired-inner +formulas have precisely the defects +\[ + \sum_h[A_{i,2h},A_{i,2h+1}] + \quad(j=0),\qquad + \sum_h[B_{2h+1,j},A_{i,2h+1}]\quad(j>0). +\] +Thus explicit required commutations can certify a restricted block domain; +scalar correctness alone cannot. With a fixed terminal leaf and repeated +valid 48-product outer levels, the recurrence has exponent $\log_4 48$; +the terminal count changes its constant, not that exponent. + +There is a natural positive domain in the community's complex operators. +XOR translations $X_u$ commute, and +$C_u=(iI+X_u)/\pii$ lies in their commutative group algebra. The new +\texttt{CommutingPhases.lean} proves translation and charged raw-phase +commutation for arbitrary functions and masks. Four complete order-16 +operator cases on dimensions two and three verify 1,024 outputs and 6,144 +kernel coefficients independently by exact XOR convolution. + +However, the \emph{algebra} being closed does not make every leaf operand +an eligible physical phase child. $C_1+C_2$ has eigenvalues +$2,1+i,1+i,2i$; it is invertible but not a phase child or a scalar multiple +of one. Its average still has unequal spectral magnitudes; $C_1-C_2$ is +nonzero and singular. Gauges also matter: +when $u\cdot v=1$, +$[C_u,Z_v]=(1-i)X_uZ_v$, a full-rank defect. Both closure and gauge +counterexamples are checked exactly. Accordingly, 2,208 operator products +cannot be counted as 2,208 cheap child calls without a paid implementation +and a complete rank/frame schedule. This is a precise search eligibility +criterion and obstruction, not an uncharged exponent argument. + +\section{Profile-aware compilation and exact matching search} +This one-hour research run used only sources already available through PR +\#62, construction commit +\texttt{ad0f25ff7b23cff7f08ad237c2254e6ecf74257e}. No newer community +activity was consulted. The scalar interval/core-aware pair graph, complete +input/output inventory and fixed $I+J$ rational basis are retained. The compiler +changes which retired dependency circuit it clears, which admissible carried +input it retains, and, in the tested coordinate variants, the consistent +point-label assignment of the finite word. + +Write $F_a(t)=t\exp(a\log(m/t))$ and +$\mathcal S_a=\sum_t n_tF_a(t)-mW$. Strict feasibility is +$\mathcal S_a<0$. This extends our previous all-cardinality bookkeeping: +the objective accounts for the complete child profile and wire normalization. +When $W$ and total rank are fixed, fewer wires or smaller linear rank growth +cannot distinguish the variants. The actual contiguous pivot blocks determine +the recursive cost. For $0<\alpha<1$, splitting a block of width $u+v$ into +$u,v$ raises its power cost, since $u^\alpha+v^\alpha>(u+v)^\alpha$. + +\paragraph{Choosing a dependency circuit.} +For a frame transition $A\to B$, let +$C_a(A,B)=\sum_t n_t(A,B)F_a(t)$ use its actual fixed-basis profile. +Clearing a retired target at $A_s$ into $G$ with providers $z$ is priced by +\[ + C_a(A_s,G)-C_a(A_s,I)+ + \sum_z\bigl[C_a(A_z,G)+C_a(G,I)-C_a(A_z,I)\bigr]. +\] +Every target/provider promotion and clearing XOR is emitted. The expression +includes changed deferred cleanup, under the local assumption that other +retired providers remain retired until cleanup. Future reuse couples the +choices; this is a search heuristic, not a global additive optimum. +All such target choices have the same linear rank change $r(G)-h$, and other +retired providers have zero net rank change after cleanup. A carried edge has +rank change $-h$. Therefore the implementation can price $F_a(t)-t$ to avoid +floating cancellation while preserving candidate order at fixed cardinality. +\texttt{RankFlowPrice.lean} proves these identities and constant-shift order +equivalence. Variable-cardinality comparisons retain the full rank correction. + +\paragraph{Changing the carried signals.} +For a value produced at $P$, preserved through $G$ and consumed at $T$, the +no-reclamation edge price is +\[ + C_a(G,T)-C_a(G,I)-C_a(0,P)-C_a(P,T). +\] +Bounded single-edge donor/use exchanges retain cardinality, distinct uses and +linear independence modulo mandatory outputs. We also test two-edge cycles. +The price oracle uses actual rational pivot profiles; floating prices propose +choices and the complete exact final characteristic accepts them. No weighted +matroid optimum or general network optimum is claimed. + +\paragraph{Dirty state and coordinate freedom.} +The inverse of a legal XOR encoder $M$ is its literal reversed word. With +source map $V$ and scatter $J$, the two-pass schedule +$M,J,M^{-1},V,M,J,M^{-1},V$ sends arbitrary $(x,y,s)$ to +$(x,y\mathbin{\oplus}JMVx,s)$. Thus $JMV=I$ is the separate fresh-transfer +contract, and dirty scratch cancels for different legal complements. +\texttt{DirtyComplementSafety.lean} proves this universally. +\texttt{FreshKernelReclaim.lean} proves that a zero fresh dependency still +permits nonzero dirty state. Future-aware unit and kernel completions are +explored, with their unsuccessful cases retained in the search record. + +A point permutation renames every frame core/cover, source triple, output +triple and scatter-bank index together. Frame containment is preserved, +$I+J$ commutes with the permutation, and the full triple-pair data inventory +is unchanged. The emitted word records the new canonical ports explicitly. +\texttt{CoordinateConjugacy.lean} proves full-word conjugacy, mask containment, +triple-family bijection and the $I+J$ entry identity. Actual ordered profiles +are still freshly computed; symmetry alone does not determine their cost. + +\paragraph{Accepted finite result.} +The selected strategy is documented with its immutable source, word and price +oracle hashes. Its complete profile has $m=575$, $W=137,151,806$, +total rank $78,860,441,550$, deficit $1,846,900$ and maximum child +width $529$. Physical roles are 27,918 and +36,586; literal scalar XOR counts are +148,852 and 205,629. +There are 2,296,434,724 recursive child calls versus the frozen profile's +2,301,104,805. These counts are explicitly charged finite schedules, not +runtime measurements. Exact rational certification gives +\[ + a_b=\frac{510429345092917}{10000000000000000000},\qquad h=10^{-18},\qquad + \kappa=\frac{255201646305539}{5000000000000000000}=5.10403292611078\times10^{-5}. +\] +The increase over $5.101691\times10^{-5}$ is approximately +$0.04590489\%$ in exponent saving. The dyadic corollary remains $2^{-15}$. +The old complete PR \#62 profile has a rigorous lower characteristic above +one at this new $a_b$, while the new upper characteristic is below one. +This verifies a structural profile improvement. All 47 assembly inequalities +and seven margins pass. The concrete Lean instance derives rounded weights, +the new moment upper, the old cubic-Taylor lower rejection and strict numerical +comparisons in the kernel. Logarithm/exponential enclosures and the inherited +all-size frame/compiler, tape, routing, recovery and eventual setup interfaces +remain explicit contracts. The unchanged data geometry and rational recovery +are inherited; the selected words, dirty bases, frame incidences, ordered +profiles and CRT checks are freshly replayed. + +For a fixed admissible carrier graph, a separate exact matching certificate +can bound what remains to search. For integer edge costs $q_{ij}$, row +potentials $u_i$ and column potentials $v_j\le0$ satisfying +$u_i+v_j\le q_{ij}$ give the lower bound +\[ + \sum_i u_i+\sum_j v_j\ \le\ \sum_i q_{i,p(i)} +\] +for every injective complete assignment $p$. Equality for a proposed +assignment certifies optimality for that recorded integer objective. +Private dummy columns and a proved sufficient penalty encode maximum +cardinality. Quantized objectives must remain distinguished from +unrounded logarithmic or characteristic weights; enclosing intervals and +rounding error are retained when deriving bounds for those real objectives. + +An actual 10,639-edge example passes 17,619 integer dual inequalities with +primal equal to dual. Further examples exercise the searched graphs. +The new \texttt{MatchingDual.lean} proves weak duality, attainment and +optimality for their exact integer objective. Source-to-certificate binding +is independently replayed by Python, rather than claimed as a large +numerical Lean instance. + +\paragraph{Removing an unnecessary cardinality restriction.} +Maximum-cardinality matching alone need not optimize the complete +characteristic. Write $F_t=t\exp(a\log(m/t))$, so +$\Phi=\sum n_tF_t/(mW)$. With $K$ selected carriers on one axis $h$, +repeat count $r$, unmatched width $W_0$, unmatched scaled numerator $A_0$, +and internal edge changes $\Delta F_e$, the actual cost model gives +\[ + W_K=W_0-rK,\qquad + A_K=A_0+r\left(\sum_e\Delta F_e-K(F_h+F_{m-2h})\right). +\] +Consequently the fixed-target feasibility slack is +\begin{equation}\label{eq:allcard} + A_K-mW_K=A_0-mW_0+ + r\sum_e\left(\Delta F_e+m-F_h-F_{m-2h}\right). +\end{equation} +Optimizing these complete edge costs with zero-cost private unmatched +columns compares \emph{all cardinalities}, including the change in wire +normalization. There is no maximum-cardinality penalty. The bookkeeping +identity is kernel checked in \texttt{FeasibilityNormalForm.lean}; its +geometric/profile input contract remains the explicitly replayed one. + +At an earlier recorded fixed bit target, the actual order-25 graph passes 23,541 +integer dual inequalities for this objective, with primal and dual both +22,172,308,087,581. It selects 7,894 carriers without forcing their number. +Rigorous rational cost intervals bound the proposed matching's true +unrounded slack-objective regret by $4.162\times10^{-9}$ before the repeat +factor and $(mW)^{-1}$ normalization. This certifies the quantized fixed-DAG +objective and bounds remaining true-cost room; it does not certify global +network or exponent optimality. This assignment is a search certificate, +not a replacement for the separately physically inherited candidate. + +\section{Reproduction, authorship and limits} +The local package includes actual matrix data, interpreters, independent +controls, the typed finite catalogue, source pins, search receipts and new +\texttt{Std}-only Lean sources and their concrete rational certificate, +with a complete standalone axiom audit. Its catalogue checks coefficient domains, +block stability, terminal-only commutativity, paid modular lifts, literal +factor lineage and fringe costs. Unreplayed advertised catalogue rows remain +quarantined. Historical 45-endpoint Mathlib evidence, fresh matrix polynomial +controls, fresh standalone proofs, and inherited PR \#62 physical-network checks are +reported separately. No complete Python refinement or full multiplication +theorem is asserted by the new formalization. + +Alejandro Zarzuelo Urdiales is the author and human developer. The work +began with an earlier Archivara exploration and his July matrix +generalization, developed with multiple AI tools; the current synthesis +involved substantial OpenAI Codex assistance. Known matrix components, +Gaussian arithmetic and LP duality retain their prior-work credit. +Community construction credit includes OpenAI's pinned manuscript, +CrocSwap/Douglas Colkitt, icekylinx, RaD/hipotures, Rohan Arun, Chafik +Boukhalfa, James Chang, Dominik Scholz, Zhihao Chen, Aurel Prosz, Swapnil +Jain and retained predecessor notices. Full analytic, physical compiler, +fixed-tape, setup and eventual-threshold hypotheses remain conditional. +The finite construction retains Avi Eisenberg's PR \#62 interval-strip and core-aware pair +assembly and Eumemic's PR \#57 joint frame compiler. Earlier numerical +editions over PRs \#58 and \#60 retain their separate source pins and credit. The new matrix/parity arithmetic, +exact search certificates and finite rational formalization retain their +separate stated scopes. + +\begin{thebibliography}{4} +\bibitem{matrix} A. Zarzuelo Urdiales, \emph{Hybrid Composition Bounds for +Exact Matrix Multiplication}, October 7 review edition, source and proof +archive: \url{https://github.com/alejandrozu/openmath-2026-judging}. +\bibitem{parity} A. Zarzuelo Urdiales, Gaussian parity certificates and +community integration: \url{https://github.com/CrocSwap/integer-mult-bounds/pull/45}. +\bibitem{community} Community reordered-producer and climbed-order +benchmarks: \url{https://github.com/CrocSwap/integer-mult-bounds/pull/53}, +\url{https://github.com/CrocSwap/integer-mult-bounds/pull/62}. +\end{thebibliography} +\end{document} diff --git a/research/profile-aware-frame-search/receipts/compiled-23.json b/research/profile-aware-frame-search/receipts/compiled-23.json new file mode 100644 index 0000000000..873648e8d8 --- /dev/null +++ b/research/profile-aware-frame-search/receipts/compiled-23.json @@ -0,0 +1,70 @@ +{ + "strategy": "profile_cost4_exchange", + "axis": 23, + "compiled": { + "h": 23, + "mode": { + "matching": true, + "reclaim": true + }, + "roles": 27918, + "baseline_pr48_roles": 36432, + "histogram": { + "1": 42694, + "0": 301670, + "2": 82457, + "3": 11072, + "4": 10684, + "6": 1996, + "5": 7554, + "8": 1368, + "9": 520, + "10": 484, + "12": 495, + "14": 2008, + "16": 547, + "18": 4220, + "19": 7820, + "22": 23, + "17": 335, + "15": 507, + "7": 568, + "21": 165, + "11": 7, + "13": 14 + }, + "rank_mass": 642620, + "elementary_xors": 148852, + "stats": { + "augmentations": 220, + "local_moment_exchanges": 670, + "local_moment_discovery_gain": 0.08468337791009617, + "regions": 52473, + "matched": 37025, + "multi_node_regions": 10350, + "reclaimed": 801, + "clearing_xors": 1420, + "dependency_candidates_considered": 3561 + }, + "dirty_basis_vectors": 31460, + "complete_dirty_basis_both_orientations": true, + "all_physical_frame_inclusions": true, + "seconds": 22.420877933502197 + }, + "word_sha256": "a19ab6454d7955d8643c9983e1288b97ac0c16b2e4963210901404efe537a464", + "gzip_sha256": "4c6af95bdbb8dd0ea6783e2dbc0358e9c31f18ccfdaf0bd2f4cedc144d536f42", + "graph_sha256": "3d47e89d2649c90800a276bdd0480131def50e0bdf92c122a19494b55bf17420", + "baseline_compiler_sha256": "bc6910c8bbe8224285164323d3c06e9035ad3eaa55416abc2867ae0066454a0c", + "experimental_compiler_sha256": "74821eda3bc47083fa9e6cd05120a04417f4c9523e0f64a7da3cb684baaa1c28", + "elapsed_seconds": 25.42719469999429, + "experiment_runner_sha256": "2d545544e429a83aea08c1d6b344dff149b1bfc75fcd9685c148bb01934f61f5", + "experiment_runner": "runner-2d545544e429a83aea08c1d6b344dff149b1bfc75fcd9685c148bb01934f61f5.py", + "frozen_source_commit": "ad0f25ff7b23cff7f08ad237c2254e6ecf74257e", + "scope": "complete compiler dirty-basis controls; independent literal replay/profiles still required", + "no_global_optimality_claim": true, + "no_external_write": true, + "matching_discovery": "three bounded improving single-edge exchange passes from original exact maximum-cardinality matching; no global weight optimum claim", + "matching_cost_oracle_sha256": "c7b82221d91c24bd91cbdcc3c6280598ba39895d53c29bb751f810e08958f858", + "missing_local_profile_pairs": 0, + "local_profile_oracle_sha256": "c7b82221d91c24bd91cbdcc3c6280598ba39895d53c29bb751f810e08958f858" +} diff --git a/research/profile-aware-frame-search/receipts/compiled-25.json b/research/profile-aware-frame-search/receipts/compiled-25.json new file mode 100644 index 0000000000..d5e328b125 --- /dev/null +++ b/research/profile-aware-frame-search/receipts/compiled-25.json @@ -0,0 +1,70 @@ +{ + "strategy": "profile_cost4_exchange", + "axis": 25, + "compiled": { + "h": 25, + "mode": { + "matching": true, + "reclaim": true + }, + "roles": 36586, + "baseline_pr48_roles": 48329, + "histogram": { + "1": 55478, + "0": 416316, + "2": 115573, + "3": 14362, + "4": 16782, + "5": 9992, + "6": 1765, + "8": 2105, + "9": 706, + "10": 527, + "12": 598, + "14": 527, + "16": 3210, + "18": 520, + "20": 5436, + "21": 10087, + "24": 25, + "17": 868, + "19": 396, + "13": 33, + "7": 744, + "23": 220 + }, + "rank_mass": 915250, + "elementary_xors": 205629, + "stats": { + "augmentations": 286, + "local_moment_exchanges": 825, + "local_moment_discovery_gain": 0.09805192660883222, + "regions": 73695, + "matched": 53194, + "multi_node_regions": 13975, + "reclaimed": 1090, + "clearing_xors": 1958, + "dependency_candidates_considered": 5914 + }, + "dirty_basis_vectors": 41186, + "complete_dirty_basis_both_orientations": true, + "all_physical_frame_inclusions": true, + "seconds": 33.78264045715332 + }, + "word_sha256": "9743b73787191be00d29799dda4e390fe24a0dfb97cb594266435d1d9d4a5b08", + "gzip_sha256": "25f455d5de2561171a62f360544804a606dddb0364d515c24cad9b522b5c616a", + "graph_sha256": "3d47e89d2649c90800a276bdd0480131def50e0bdf92c122a19494b55bf17420", + "baseline_compiler_sha256": "bc6910c8bbe8224285164323d3c06e9035ad3eaa55416abc2867ae0066454a0c", + "experimental_compiler_sha256": "74821eda3bc47083fa9e6cd05120a04417f4c9523e0f64a7da3cb684baaa1c28", + "elapsed_seconds": 37.21530559999519, + "experiment_runner_sha256": "2d545544e429a83aea08c1d6b344dff149b1bfc75fcd9685c148bb01934f61f5", + "experiment_runner": "runner-2d545544e429a83aea08c1d6b344dff149b1bfc75fcd9685c148bb01934f61f5.py", + "frozen_source_commit": "ad0f25ff7b23cff7f08ad237c2254e6ecf74257e", + "scope": "complete compiler dirty-basis controls; independent literal replay/profiles still required", + "no_global_optimality_claim": true, + "no_external_write": true, + "matching_discovery": "three bounded improving single-edge exchange passes from original exact maximum-cardinality matching; no global weight optimum claim", + "matching_cost_oracle_sha256": "a03304eb61e7e1497a563b2484859c29f9246b7e6839878e28a0b14d3cae88d2", + "missing_local_profile_pairs": 0, + "local_profile_oracle_sha256": "a03304eb61e7e1497a563b2484859c29f9246b7e6839878e28a0b14d3cae88d2" +} diff --git a/research/profile-aware-frame-search/receipts/verified-axis-23.json b/research/profile-aware-frame-search/receipts/verified-axis-23.json new file mode 100644 index 0000000000..aa815d93a4 --- /dev/null +++ b/research/profile-aware-frame-search/receipts/verified-axis-23.json @@ -0,0 +1,113 @@ +{ + "status": "PASS fresh full input/dirty basis both orientations, independent literal frame path, exact fixed profiles", + "word_sha256": "a19ab6454d7955d8643c9983e1288b97ac0c16b2e4963210901404efe537a464", + "gzip_sha256": "4c6af95bdbb8dd0ea6783e2dbc0358e9c31f18ccfdaf0bd2f4cedc144d536f42", + "replay": { + "status": "independent serialized word, exact frames, full input and dirty basis both orientations PASS", + "h": 23, + "roles": 27918, + "output_roles": 5336, + "elementary_xors": 148852, + "word_length": 620202, + "full_basis_vectors": 31460, + "rank_mass": 642620, + "histogram": { + "1": 42694, + "0": 162527, + "2": 82457, + "3": 11072, + "4": 10684, + "6": 1996, + "5": 7554, + "8": 1368, + "9": 520, + "10": 484, + "12": 495, + "14": 2008, + "16": 547, + "18": 4220, + "19": 7820, + "22": 23, + "17": 335, + "15": 507, + "7": 568, + "21": 165, + "11": 7, + "13": 14 + } + }, + "prepared": { + "h": 23, + "v": 1771, + "R": 27918, + "frames": 52475, + "distinct_transitions": 138019, + "singles": 15939, + "rank_mass": 642620, + "rank_histogram_with_side_growth_split_into_singletons": { + "1": 53320, + "2": 77144, + "3": 11072, + "4": 10684, + "5": 7554, + "6": 1996, + "7": 568, + "8": 1368, + "9": 520, + "10": 484, + "11": 7, + "12": 495, + "13": 14, + "14": 2008, + "15": 507, + "16": 547, + "17": 335, + "18": 4220, + "19": 7820, + "21": 165, + "22": 23 + }, + "word_sha256": "a19ab6454d7955d8643c9983e1288b97ac0c16b2e4963210901404efe537a464", + "copied_centers": 23, + "transition_events_equal_independent_xor_word_reconstruction": true + }, + "profile": { + "h": 23, + "v": 1771, + "R": 27918, + "loss": 506, + "rank_sum": 642620, + "field_prime": 2305843009213693951, + "frames": 52475, + "distinct_matrices": 36659, + "crt_matrices": 6049, + "crt_disagreements": 0, + "blocks": [ + 0, + 343078, + 17009, + 10306, + 5888, + 4186, + 3942, + 3636, + 2900, + 2259, + 1834, + 1693, + 1276, + 1072, + 720, + 590, + 352, + 193, + 114, + 0, + 45, + 23, + 0, + 0 + ] + }, + "elapsed_seconds": 6.828000000008615 +} diff --git a/research/profile-aware-frame-search/receipts/verified-axis-25.json b/research/profile-aware-frame-search/receipts/verified-axis-25.json new file mode 100644 index 0000000000..3514070159 --- /dev/null +++ b/research/profile-aware-frame-search/receipts/verified-axis-25.json @@ -0,0 +1,115 @@ +{ + "status": "PASS fresh full input/dirty basis both orientations, independent literal frame path, exact fixed profiles", + "word_sha256": "9743b73787191be00d29799dda4e390fe24a0dfb97cb594266435d1d9d4a5b08", + "gzip_sha256": "25f455d5de2561171a62f360544804a606dddb0364d515c24cad9b522b5c616a", + "replay": { + "status": "independent serialized word, exact frames, full input and dirty basis both orientations PASS", + "h": 25, + "roles": 36586, + "output_roles": 6925, + "elementary_xors": 205629, + "word_length": 854716, + "full_basis_vectors": 41186, + "rank_mass": 915250, + "histogram": { + "1": 55478, + "0": 224040, + "2": 115573, + "3": 14362, + "4": 16782, + "5": 9992, + "6": 1765, + "8": 2105, + "9": 706, + "10": 527, + "12": 598, + "14": 527, + "16": 3210, + "18": 520, + "20": 5436, + "21": 10087, + "24": 25, + "17": 868, + "19": 396, + "13": 33, + "7": 744, + "23": 220 + } + }, + "prepared": { + "h": 25, + "v": 2300, + "R": 36586, + "frames": 73697, + "distinct_transitions": 190878, + "singles": 20700, + "rank_mass": 915250, + "rank_histogram_with_side_growth_split_into_singletons": { + "1": 69278, + "2": 108673, + "3": 14362, + "4": 16782, + "5": 9992, + "6": 1765, + "7": 744, + "8": 2105, + "9": 706, + "10": 527, + "12": 598, + "13": 33, + "14": 527, + "16": 3210, + "17": 868, + "18": 520, + "19": 396, + "20": 5436, + "21": 10087, + "23": 220, + "24": 25 + }, + "word_sha256": "9743b73787191be00d29799dda4e390fe24a0dfb97cb594266435d1d9d4a5b08", + "copied_centers": 25, + "transition_events_equal_independent_xor_word_reconstruction": true + }, + "profile": { + "h": 25, + "v": 2300, + "R": 36586, + "loss": 600, + "rank_sum": 915250, + "field_prime": 2305843009213693951, + "frames": 73697, + "distinct_matrices": 50642, + "crt_matrices": 8127, + "crt_disagreements": 0, + "blocks": [ + 0, + 473550, + 25167, + 11781, + 6968, + 5725, + 5584, + 4899, + 3848, + 3176, + 2717, + 2644, + 1932, + 1645, + 1364, + 1130, + 718, + 578, + 374, + 179, + 113, + 0, + 55, + 25, + 0, + 0 + ] + }, + "elapsed_seconds": 10.89100000000326 +} diff --git a/research/profile-aware-frame-search/selection-provenance.json b/research/profile-aware-frame-search/selection-provenance.json new file mode 100644 index 0000000000..7846ef1287 --- /dev/null +++ b/research/profile-aware-frame-search/selection-provenance.json @@ -0,0 +1,27 @@ +{ + "candidate_certificate": "candidate-certificate.json", + "word23": "words/word-23.json.gz", + "word25": "words/word-25.json.gz", + "receipt23": "receipts/verified-axis-23.json", + "receipt25": "receipts/verified-axis-25.json", + "strategy": "profile_cost4_exchange; same certified profile as profile_cost3_exchange", + "kappa": "255201646305539/5000000000000000000", + "bit_saving": "510429345092917/10000000000000000000", + "frozen_upstream_commit": "ad0f25ff7b23cff7f08ad237c2254e6ecf74257e", + "compiled23": "work\\one-hour-62\\compiler-search\\profile_cost4_exchange\\h23\\compiled.json", + "compiled25": "work\\one-hour-62\\compiler-search\\profile_cost4_exchange\\h25\\compiled.json", + "experimental_compiler": "work\\one-hour-62\\compiler-search\\compiler_profile_cost4_exchange_3d3d6f5c9a0b.py", + "runner": "work\\one-hour-62\\compiler-search\\runner-2d545544e429a83aea08c1d6b344dff149b1bfc75fcd9685c148bb01934f61f5.py", + "oracles": [ + "work\\one-hour-62\\compiler-search\\pair-profiles-h23-c7b82221d91c24bd91cbdcc3c6280598ba39895d53c29bb751f810e08958f858.jsonl", + "work\\one-hour-62\\compiler-search\\pair-profiles-h25-a03304eb61e7e1497a563b2484859c29f9246b7e6839878e28a0b14d3cae88d2.jsonl" + ], + "baseline_matching23": "work\\one-hour-62\\compiler-search\\matching-h23.json", + "baseline_matching25": "work\\one-hour-62\\compiler-search\\matching-h25.json", + "weighted_data": "math/weighted-input.json", + "basis_renaming": null, + "status": "FROZEN FINAL: complete independent fresh selected pair replay, exact full profiles/CRT, moment47/7 and guard controls PASS", + "guard_receipt": "work\\one-hour-62\\verification\\final-guard-controls.json", + "regeneration_receipt": "work\\one-hour-62\\compiler-search\\selected4-regeneration-receipt.json", + "final_certificate_sha256": "35cd0a62b8b41927d44ceee9deda3da41e6343d6abba5a6b29d3deed28d94c9b" +} diff --git a/research/profile-aware-frame-search/verification/README.md b/research/profile-aware-frame-search/verification/README.md new file mode 100644 index 0000000000..19f10f4faf --- /dev/null +++ b/research/profile-aware-frame-search/verification/README.md @@ -0,0 +1,63 @@ +# Frozen PR62 word verification + +This local research adapter consumes immutable upstream PR62 commit +`ad0f25ff7b23cff7f08ad237c2254e6ecf74257e`. It performs no network access and +does not modify that checkout. The selected graph is unchanged; candidate XOR +words change only the frame compiler's clearing/reclamation choices. + +`verify_words.py` independently checks complete source, target, and arbitrary +dirty auxiliary basis vectors in both orientations. It reconstructs frame +transition incidences from the literal XOR word and compares them with the +compiler's event list. Explicit index and scatter guards reject negative +indices or additional uncharged scatter operations. The unchanged upstream +C++ profiler computes all actual fixed-I+J profiles. The arithmetic checker +also verifies the bounded-minor modulus inequalities and Lucas–Lehmer prime +certificates, and requires zero CRT disagreements. + +The collected characteristic derives W and rank mass from the checked axes; +it has no assertions forcing the baseline W or baseline rank mass. Every +copied center, endpoint copy, side growth, and external transition retains the +upstream accounting. Exact rational bisection selects a saving for which the +Padé/logarithm upper moment is below one. The balanced assembly then checks +47 strict inequalities, seven margins, and eventual threshold arithmetic. + +Build the profiler with any compatible C++17 compiler supporting unsigned +128-bit arithmetic (e.g. the installed Zig C++ driver): + +```sh +c++ -O3 -std=c++17 \ + -I UPSTREAM/references/frame-compiler/pr48/scripts/partial_swap \ + UPSTREAM/scripts/experiments/binary_frame_profiles.cpp -o frame-profiles +``` + +Freshly verify a selected pair of deterministic words: + +```sh +python verify_words.py --upstream UPSTREAM --profiler ./frame-profiles \ + --word23 CANDIDATE/h23/word.json.gz \ + --word25 CANDIDATE/h25/word.json.gz --output RESULT +``` + +`frozen-sources.json` checks the exact HEAD and hashes of all consumed local +upstream code, native certificate, and compiler header before importing. +`RESULT/h23/verified-axis.json` and its h25 counterpart retain the full word, +profile, and replay receipts. The final `candidate-certificate.json` contains +the exact child list, complete characteristic, rational moment bounds, +assembly inequalities, source pins, and word hashes. + +For fast search recomposition, `--receipt23` and `--receipt25` may reference +previously freshly checked axis receipts. This mode reuses their recorded +validation and freshly recomputes the combined rational characteristic and +assembly. Use the two word arguments above for a complete final replay. + +Scope: unchanged geometry for all 4,073,300 data pairs and its rational +recovery cases is inherited from frozen PR62. The all-size analytic +enclosures, frame/compiler transfer, finite-alphabet tape implementation, +routing, prime selection, recovery, and eventual setup arguments remain +conditional. These finite checks do not establish an unconditional integer +multiplication theorem or practical runtime improvement. More primitive XORs +can coexist with a better recursive block profile; their counts are recorded. + +Credit PR62 to Avi Eisenberg/ikeboy and PR57 to eumemic; the inherited exact +profiler and arithmetic retain their upstream contributor notices. New local +verification adapter prepared with OpenAI Codex assistance. diff --git a/research/profile-aware-frame-search/verification/batch_axes.py b/research/profile-aware-frame-search/verification/batch_axes.py new file mode 100644 index 0000000000..a93d510548 --- /dev/null +++ b/research/profile-aware-frame-search/verification/batch_axes.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python3 +"""Freshly verify independent word axes and rank exact fixed-saving costs.""" +import argparse +from concurrent.futures import ProcessPoolExecutor, as_completed +from fractions import Fraction as Q +import json +from pathlib import Path +import sys +from verify_words import axis, check_source, load_module + + +def run_one(job): + name,h,word,out,profiler,upstream=job + sys.dont_write_bytecode=True + receipt=axis(Path(word),Path(out),Path(profiler),Path(upstream)) + return name,h,str(Path(out)/'verified-axis.json'),receipt + + +def main(): + p=argparse.ArgumentParser(description=__doc__) + p.add_argument('--upstream',type=Path,required=True) + p.add_argument('--base',type=Path,required=True) + p.add_argument('--output',type=Path,required=True) + p.add_argument('--profiler',type=Path,required=True) + p.add_argument('--saving',type=Q,required=True) + p.add_argument('--workers',type=int,default=3) + a=p.parse_args(); a.output.mkdir(parents=True,exist_ok=True) + check_source(a.upstream.resolve()) + math=load_module('batch_exact_math',a.upstream.resolve()/'scripts/experiments/binary_frame_math.py') + jobs=[] + for directory in sorted(a.base.iterdir()): + for h in (23,25): + word=directory/f'h{h}'/'word.json.gz' + if word.exists(): + jobs.append((directory.name,h,str(word.resolve()),str((a.output/directory.name/f'h{h}').resolve()), + str(a.profiler.resolve()),str(a.upstream.resolve()))) + rows=[] + with ProcessPoolExecutor(max_workers=a.workers) as pool: + future={pool.submit(run_one,j):j for j in jobs} + for f in as_completed(future): + name,h,path,receipt=f.result() + price=Q() + for t,n in enumerate(receipt['profile']['blocks']): + if t and n: + v=a.saving*math.logs(Q(575,t))[1] + price+=n*t*(1+v+v*v/(2*(1-v/3))) + rows.append(dict(name=name,h=h,receipt=path,R=receipt['profile']['R'], + scalar_xors=receipt['replay']['elementary_xors'],fixed_saving=str(a.saving), + exact_internal_upper_price=str(price))) + print('RANK',name,h,'price',float(price),flush=True) + ordered=sorted(rows,key=lambda r:(r['h'],Q(r['exact_internal_upper_price']))) + (a.output/'ranking.json').write_text(json.dumps(ordered,indent=2)+'\n') + print('PASS verified axes',len(rows),flush=True) + + +if __name__=='__main__': + main() diff --git a/research/profile-aware-frame-search/verification/check_guards.py b/research/profile-aware-frame-search/verification/check_guards.py new file mode 100644 index 0000000000..ee91997054 --- /dev/null +++ b/research/profile-aware-frame-search/verification/check_guards.py @@ -0,0 +1,53 @@ +"""Adversarial controls for the literal word/cost boundary. + +Run with a selected or frozen h23/h25 word. No source or word files are edited. +""" +from pathlib import Path +import argparse +import gzip +import json +from verify_words import check_word_structure + + +def run(path): + raw=path.read_bytes() + d=json.loads(gzip.decompress(raw) if str(path).endswith('.gz') else raw) + check_word_structure(d) + passed=[] + + def reject(name): + try: + check_word_structure(d) + except (AssertionError,IndexError,KeyError): + passed.append(name) + else: + raise AssertionError('negative control accepted: '+name) + + old=d['ops'][0][0] + d['ops'][0][0]=-1 + reject('negative slot index cannot alias the final role') + d['ops'][0][0]=old + + # Two identical extra scatter XORs cancel on every basis vector. A pure + # endpoint replay would therefore accept them, but the cost certificate + # only charges the canonical scatter, so the structural guard must reject. + extra=d['scatter'][0].copy() + d['scatter'].extend([extra,extra]) + reject('canceling but uncharged additional scatter XORs') + del d['scatter'][-2:] + + old=d['scatter'][0][0] + d['scatter'][0][0]=(old+1)%(2*d['v']+d['R']) + reject('mismatched scatter destination') + d['scatter'][0][0]=old + + check_word_structure(d) + result=dict(status='PASS',positive_selected_word=True,negative_controls=passed, + explanation='A canceling XOR pair preserves the complete binary map but invalidates an unchanged cost certificate.') + print(json.dumps(result,indent=2)) + return result + + +if __name__=='__main__': + p=argparse.ArgumentParser(description=__doc__);p.add_argument('word',type=Path) + run(p.parse_args().word) diff --git a/research/profile-aware-frame-search/verification/export_weighted_case.py b/research/profile-aware-frame-search/verification/export_weighted_case.py new file mode 100644 index 0000000000..9745bcb9a0 --- /dev/null +++ b/research/profile-aware-frame-search/verification/export_weighted_case.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python3 +"""Export exact upward-rounded characteristic weights for the Std Lean case.""" +import argparse +from fractions import Fraction as Q +from hashlib import sha256 +import json +from pathlib import Path +import sys + +if sys.flags.optimize: + raise RuntimeError('Run the export without Python -O/-OO; assertion checks are required.') + + +def export(candidate,output): + d=json.loads(candidate.read_text());m,W=d['bit']['m'],d['bit']['W'] + saving=Q(d['bit_saving']);scale=10**30;rows=[];total=0 + for width,multiplicity in sorted((int(t),n)for t,n in d['bit']['child_multiplicities'].items()): + log_upper=Q(d['bit']['moment']['logarithms'][str(width)]['upper']) + v=saving*log_upper;F=width*(1+v+v*v/(2*(1-v/3))) + z=F*scale;rounded=-(-z.numerator//z.denominator) + assert Q(rounded,scale)>=F + total+=multiplicity*rounded + rows.append(dict(width=width,multiplicity=multiplicity,log_upper=str(log_upper),v=str(v), + F_upper=str(F),rounded_F_upper_numerator=rounded,rounding_scale=scale, + rounding_slack=str(Q(rounded,scale)-F))) + denominator=m*W*scale;upper=Q(total,denominator) + assert upper<1 and len(d['assembly']['constraints'])==47 + result=dict(status='exact_weighted_F_rounding_and_47_slacks_passed',source_commit=d['source']['commit'], + source_certificate_sha256=d['source']['files']['research/pair-assembly/frame/frame-certificate.json'], + refined_certificate_sha256=sha256(candidate.read_bytes()).hexdigest(),m=m,W=W,total_rank=d['bit']['total_rank'], + bit_saving=d['bit_saving'],kappa=d['kappa'],rows=rows,weighted_upper_numerator=total, + weighted_upper_denominator=denominator,rounded_moment_upper=str(upper),rounded_moment_gap=str(1-upper), + named_slacks=d['assembly']['constraints'],named_margins=d['assembly']['margins'],parameters=d['assembly']['parameters'], + comparison=dict(old_published_kappa='5101691/100000000000',old_bit_saving='39859/781250000', + old_formal_scoped_limit='39859/781289859',exceeds_old_scoped_limit=Q(d['kappa'])>Q(39859,781289859), + parameter_only=False,new_producer_claim=False,new_compiler_word_claim=True, + frozen62_network_at_new_saving_lower=d['comparison']['frozen62_network_at_new_saving_lower'], + frozen62_network_rejected_at_new_saving=d['comparison']['frozen62_network_rejected_at_new_saving']), + scope='New profile-aware compiler words on the unchanged frozen PR62 graph; fresh full word/basis/frame/profile validation, inherited data geometry and all-size interfaces.') + output.parent.mkdir(parents=True,exist_ok=True);output.write_text(json.dumps(result,indent=2)+'\n') + print('PASS weighted rows',len(rows),'moment gap',float(1-upper),'kappa',d['kappa']) + + +if __name__=='__main__': + p=argparse.ArgumentParser(description=__doc__);p.add_argument('candidate',type=Path);p.add_argument('output',type=Path) + a=p.parse_args();export(a.candidate,a.output) diff --git a/research/profile-aware-frame-search/verification/frozen-sources.json b/research/profile-aware-frame-search/verification/frozen-sources.json new file mode 100644 index 0000000000..55997eedb8 --- /dev/null +++ b/research/profile-aware-frame-search/verification/frozen-sources.json @@ -0,0 +1,22 @@ +{ + "commit": "ad0f25ff7b23cff7f08ad237c2254e6ecf74257e", + "files": { + "research/pair-assembly/pair_graph.py": "3d47e89d2649c90800a276bdd0480131def50e0bdf92c122a19494b55bf17420", + "research/pair-assembly/frame/frame-certificate.json": "70bc8a24a5565b840a5aac845703819c89c83b8c607acae021f64cf296f10c6e", + "scripts/experiments/binary_frame_replay.py": "392e78e62d7685c99a5888a7da743ea6c3dcad631af4a743c91e0c09348442bc", + "scripts/experiments/binary_frame_profile_prepare.py": "8a50381cab00b33e62b3a057d199ba5e19647929135c95b0fd63fc8a8ef7c9b3", + "scripts/experiments/binary_frame_profiles.cpp": "8e2e391d3ee57cbb1372c68e4aa031e1b861321536eabd642ada54e12e678669", + "scripts/experiments/binary_frame_math.py": "1f96e8aafc8ae89f8eeec5d03800131d93d58e01bf8a7fca8feb03702d1740d0", + "references/frame-compiler/pr48/scripts/partial_swap/binary_io.hpp": "7e143eb75bb342ac8f0c82a60005e7c35c9ec827de479bf6fb773151f3af5fa1", + "references/frame-compiler/pr48/research/copied-fixed/balanced_assembly.py": "4d27575dcad2b45a281a34054d311409ecd954f373c0c3a62c29bcc843f06a86", + "references/frame-compiler/pr48/research/copied-fixed/certificate.json": "33b3373c04e18a7f4cee33ba68da6ed71934acc3e0179cca6197696be4befa22" + }, + "attribution": "PR62 Avi Eisenberg/ikeboy; inherited PR57 compiler eumemic; exact profiler PR48 Chafik Boukhalfa, Rohan Arun, Dominik Scholz, icekylinx; see original source comments and NOTICE.", + "verification_adapter_files": { + "verify_words.py": "1d5e3a670c83a68d419d27c463ee2ff641f17c805bf8fa63a80ed97797e52541", + "batch_axes.py": "cba8d8d2ce2babf4e9ff512af4e07df9a2574a15c4b1748e437a83977aa3359e", + "screen_axes.py": "bf06809c44e26883fcc93aa2dbf98fdf1951742b83ded161e725a84b3d616f98", + "check_guards.py": "e3fc1be56f80de10c6c5e6dea2713ec42e95cae4f2d5e0fe57846672dd58e44e", + "export_weighted_case.py": "7242f0d052be4315275db231216a5744a4030094a89b2d19cbf965d2043aeae9" + } +} diff --git a/research/profile-aware-frame-search/verification/screen_axes.py b/research/profile-aware-frame-search/verification/screen_axes.py new file mode 100644 index 0000000000..75d6d24858 --- /dev/null +++ b/research/profile-aware-frame-search/verification/screen_axes.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python3 +"""Search-only exact profile screening; full source/dirty replay is omitted. + +An accepted final candidate must subsequently run verify_words.py with its +actual words. This screen checks the literal frame-event correspondence and +exact fixed profiles, then ranks equal-role axes at one exact saving. +""" +import argparse +from concurrent.futures import ProcessPoolExecutor, as_completed +from fractions import Fraction as Q +import json +from pathlib import Path +import subprocess +import sys +from verify_words import check_source,load_module + + +def run_one(job): + name,h,word,out,profiler,upstream=job + sys.dont_write_bytecode=True + output=Path(out);output.mkdir(parents=True,exist_ok=True) + prepare=load_module('screen_prepare',Path(upstream)/'scripts/experiments/binary_frame_profile_prepare.py').prepare + transitions=output/'transitions.bin' + prepared=prepare(Path(word),transitions) + subprocess.run([profiler,str(transitions)],check=True,capture_output=True) + profile=json.loads(Path(str(transitions)+'.profiles.json').read_text()) + assert profile['h']==h and profile['crt_disagreements']==0 + assert profile['rank_sum']==h*profile['R']+h*(h-1) + receipt=dict(status='PROFILE SCREEN ONLY; full source/target/dirty replay not performed', + prepared=prepared,profile=profile,word=str(word)) + (output/'screened-axis.json').write_text(json.dumps(receipt,indent=2)+'\n') + return name,h,str(output/'screened-axis.json'),receipt + + +def main(): + p=argparse.ArgumentParser(description=__doc__) + p.add_argument('--upstream',type=Path,required=True);p.add_argument('--base',type=Path,required=True) + p.add_argument('--output',type=Path,required=True);p.add_argument('--profiler',type=Path,required=True) + p.add_argument('--saving',type=Q,required=True);p.add_argument('--workers',type=int,default=3) + a=p.parse_args();a.output.mkdir(parents=True,exist_ok=True) + check_source(a.upstream.resolve()) + math=load_module('screen_math',a.upstream.resolve()/'scripts/experiments/binary_frame_math.py') + jobs=[] + for directory in sorted(a.base.iterdir()): + for h in (23,25): + word=directory/f'h{h}'/'word.json.gz' + if word.exists():jobs.append((directory.name,h,str(word.resolve()),str((a.output/directory.name/f'h{h}').resolve()),str(a.profiler.resolve()),str(a.upstream.resolve()))) + rows=[] + with ProcessPoolExecutor(max_workers=a.workers) as pool: + futures=[pool.submit(run_one,j) for j in jobs] + for f in as_completed(futures): + name,h,path,receipt=f.result();price=Q() + for t,n in enumerate(receipt['profile']['blocks']): + if t and n: + v=a.saving*math.logs(Q(575,t))[1] + price+=n*t*(1+v+v*v/(2*(1-v/3))) + rows.append(dict(name=name,h=h,receipt=path,R=receipt['profile']['R'], + word=receipt['word'],fixed_saving=str(a.saving),exact_internal_upper_price=str(price))) + ordered=sorted(rows,key=lambda r:(r['h'],Q(r['exact_internal_upper_price']))) + (a.output/'ranking.json').write_text(json.dumps(ordered,indent=2)+'\n') + print('SCREEN',name,h,float(price),flush=True) + print('PASS profile-only screens',len(rows),'full final replay remains required',flush=True) + + +if __name__=='__main__':main() diff --git a/research/profile-aware-frame-search/verification/verify_words.py b/research/profile-aware-frame-search/verification/verify_words.py new file mode 100644 index 0000000000..985b0ebcac --- /dev/null +++ b/research/profile-aware-frame-search/verification/verify_words.py @@ -0,0 +1,229 @@ +#!/usr/bin/env python3 +"""Fresh literal-word replay, exact fixed-I+J profiling, and rational assembly. + +Research adapter to pinned PR62, ad0f25ff7b23cff7f08ad237c2254e6ecf74257e. +The input/data geometry and all-size analytic/compiler/tape arguments are +inherited. Every supplied changed XOR word and its actual frame path is replayed. +No external network access and no mutation of the frozen source checkout. +""" +from __future__ import annotations +import argparse +from collections import Counter +from copy import deepcopy +from fractions import Fraction as Q +from hashlib import sha256 +import importlib.util +from itertools import combinations +import json +import gzip +from math import comb +from pathlib import Path +import subprocess +import sys +import time + +if sys.flags.optimize: + raise RuntimeError('Run the verification without Python -O/-OO; assertion checks are required.') + +HERE = Path(__file__).resolve().parent +PIN = 'ad0f25ff7b23cff7f08ad237c2254e6ecf74257e' + + +def load_module(name, path): + spec = importlib.util.spec_from_file_location(name, path) + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + return module + + +def check_source(upstream): + expected = json.loads((HERE/'frozen-sources.json').read_text()) + adapters=expected['verification_adapter_files'] + required={'verify_words.py','batch_axes.py','screen_axes.py','check_guards.py','export_weighted_case.py'} + if set(adapters)!=required: + raise ValueError('missing or unexpected frozen verification adapters') + for name,digest in adapters.items(): + if sha256((HERE/name).read_bytes()).hexdigest()!=digest: + raise ValueError('verification adapter changed: '+name) + head = subprocess.check_output(['git','-C',str(upstream),'rev-parse','HEAD'], text=True).strip() + if head != PIN: + raise ValueError('wrong frozen PR62 source commit: '+head) + for name, digest in expected['files'].items(): + if sha256((upstream/name).read_bytes()).hexdigest() != digest: + raise ValueError('frozen consumed source changed: '+name) + return expected + + +def check_word_structure(d): + R,nf=d['R'],len(d['frames']) + assert type(R) is int and R>0 and d['h'] in (23,25) + # Explicit bounds avoid Python's negative-index interpretation of a word. + assert all(type(s) is int and 0<=s0 for t,n in rows.items()) + return dict(m=m,N=N,W=W,L=L,total_rank=mass,deficit=m*W-mass,maxchild=max(rows), + child_multiplicities=dict(sorted(rows.items())),parts=parts,axes=profiles) + + +def choose_saving(p, arithmetic, denominator): + # Optimize the exact *upper enclosure*, not a floating logarithm or root. + lo,hi=0,denominator//10000 + rows=p['child_multiplicities'] + while lo+10 + return Q(lo,denominator) + + +def compose(p, upstream, arithmetic, saving, kappa, h, denominator): + old=upstream/'references/frame-compiler/pr48/research/copied-fixed' + balanced=load_module('balanced_candidate_arithmetic',old/'balanced_assembly.py') + prior=json.loads((old/'certificate.json').read_text()) + bridge=deepcopy(prior['finite_bridge']) + bridge['bit'].update(W=p['W'],maxchild=p['maxchild'],m=p['m'],wire_bits=p['W'].bit_length(), + halving_degree=balanced.halving_degree(p['m'],p['maxchild'])) + coefficient=sum(bridge[name]['halving_degree']*bridge[name]['wire_bits'] for name in ('bit','complex')) + bridge['rows'].update(coefficient=coefficient,degree_gap=str(Q(bridge['rows']['degree'])-Q(51,25)*coefficient)) + assert Q(bridge['rows']['suffix_slope'])==4*Q(bridge['rows']['degree']) + moment=arithmetic.moment(p['m'],p['W'],p['child_multiplicities'],saving) + assert moment['upper']<1 + if kappa is None: + q=saving*(1-2*h) + control=(1-h)*q/(1+q) + scaled=control*denominator + floor=scaled.numerator//scaled.denominator + # The floor is already strictly below a nonintegral rational control. + # Back off one grid point only if the control itself lies on the grid. + kappa=Q(floor-(scaled.denominator==1),denominator) + assembled=balanced.assembly(bridge,saving,kappa,h=h,a_complex=Q(717,10**7)) + assert len(assembled['constraints'])==47 and len(assembled['margins'])==7 + assert all(v>0 for v in assembled['constraints'].values()) + frozen=json.loads((upstream/'research/pair-assembly/frame/frame-certificate.json').read_text()) + frozen_ab=Q(frozen['bit_saving']); frozen_kappa=Q(frozen['kappa']) + prior_rows={int(t):n for t,n in frozen['bit']['child_multiplicities'].items()} + prior_moment=arithmetic.moment(frozen['bit']['m'],frozen['bit']['W'],prior_rows,saving) + return dict(status='PASS exact characteristic upper enclosure, all 47 strict constraints and seven margins', + bit_saving=saving,kappa=kappa,explicit_h=h,bit=dict(p,moment=moment),assembly=assembled, + finite_bridge=bridge,eventual_bounds=balanced.cutoffs(bridge,assembled), + exactness=[arithmetic.exactness(x) for x in (23,25)], + comparison=dict(frozen62_bit_saving=frozen_ab,frozen62_kappa=frozen_kappa, + kappa_gain=kappa-frozen_kappa,roles_frozen62=[27918,36586], + frozen62_refined_kappa=Q(25508460085039,500000000000000000), + kappa_gain_above_refined=kappa-Q(25508460085039,500000000000000000), + frozen62_network_at_new_saving_lower=prior_moment['lower'], + frozen62_network_rejected_at_new_saving=prior_moment['lower']>1), + scope='Fresh changed-word/full-basis/frame/profile/CRT and rational arithmetic validation. ' + 'Unchanged 4,073,300-pair data geometry and its recovered rational cases inherited from PR62; ' + 'all-size analytic log/exp enclosure, compiler/frame transfer, finite-alphabet tape, routing, ' + 'prime-selection/recovery and eventual setup arguments remain conditional.') + + +def main(): + parser=argparse.ArgumentParser(description=__doc__) + parser.add_argument('--upstream',type=Path,required=True) + parser.add_argument('--profiler',type=Path,default=HERE/'frame-profiles.exe') + parser.add_argument('--word23',type=Path) + parser.add_argument('--word25',type=Path) + parser.add_argument('--receipt23',type=Path,help='Previously fresh verified-axis.json for inexpensive recomposition') + parser.add_argument('--receipt25',type=Path) + parser.add_argument('--output',type=Path,required=True) + parser.add_argument('--axis-only',action='store_true') + parser.add_argument('--saving',type=Q) + parser.add_argument('--kappa',type=Q) + parser.add_argument('--h',type=Q,default=Q(1,10**18)) + parser.add_argument('--denominator',type=int,default=10**19) + args=parser.parse_args() + sys.dont_write_bytecode=True + upstream=args.upstream.resolve(); args.output.mkdir(parents=True,exist_ok=True) + source=check_source(upstream) + arithmetic=load_module('exact_candidate_math',upstream/'scripts/experiments/binary_frame_math.py') + axes=[] + for h,word,cached in [(23,args.word23,args.receipt23),(25,args.word25,args.receipt25)]: + assert not (word is not None and cached is not None) + if word is not None: + axes.append(axis(word.resolve(),args.output/f'h{h}',args.profiler.resolve(),upstream)) + elif cached is not None: + receipt=json.loads(cached.read_text()) + assert receipt['status'].startswith('PASS fresh full') and receipt['profile']['h']==h + receipt['reused_verified_receipt_sha256']=sha256(cached.read_bytes()).hexdigest() + axes.append(receipt) + if args.axis_only: + return + assert len(axes)==2 + p=collect(axes,arithmetic) + saving=args.saving or choose_saving(p,arithmetic,args.denominator) + result=compose(p,upstream,arithmetic,saving,args.kappa,args.h,args.denominator) + result['source']=source + result['fresh_word_receipts']=axes + result['verifier_sha256']=sha256(Path(__file__).read_bytes()).hexdigest() + (args.output/'candidate-certificate.json').write_text(json.dumps(arithmetic.js(result),indent=2,sort_keys=True)+'\n') + print('PASS kappa',str(result['kappa']),float(result['kappa']),'W',p['W'],'saving',str(saving),flush=True) + + +if __name__=='__main__': + main() diff --git a/research/profile-aware-frame-search/words/word-23.json.gz b/research/profile-aware-frame-search/words/word-23.json.gz new file mode 100644 index 0000000000..8d64d28fa2 Binary files /dev/null and b/research/profile-aware-frame-search/words/word-23.json.gz differ diff --git a/research/profile-aware-frame-search/words/word-25.json.gz b/research/profile-aware-frame-search/words/word-25.json.gz new file mode 100644 index 0000000000..f9b75daa16 Binary files /dev/null and b/research/profile-aware-frame-search/words/word-25.json.gz differ