diff --git a/research/coded-active-feedback/PROOF.md b/research/coded-active-feedback/PROOF.md new file mode 100644 index 0000000000..9716baebb4 --- /dev/null +++ b/research/coded-active-feedback/PROOF.md @@ -0,0 +1,161 @@ +# Active coefficient recovery and the remaining coupling + +Cinna Davis, with substantial OpenAI Codex assistance. Apache-2.0. + +This is a conditional component construction on the inherited physical ABI. +It supplies neither four autonomous Gaussian jobs nor a profitable caller. + +## Source and conventions + +Use Dugongue's PR4948 backward involutive producer, Dillon's signed PR4933 +normalizers and the mixed p2 chronology retained in the passive saved-query +package. There are four independent 112-owner main banks and two disjoint +408-owner helper inventories. Original helpers are never scratch. Rightmost +operators act first. On each main pair the inherited FULL is + + B_s = diag(D_s,D_s) [[I,-Q C_s],[0,I]]. + +Here Q is the central Gaussian, D1 and D3 are the two fresh eight-axis +Gaussians, C1 and C3 are the actual normalized F-transpose codes, and + + C_s^2=I, [C_s,D_s Q]=0, [C_s,D_t]=0 (s != t). + +Q commutes with D1,D3, which commute with each other. C_s need not commute +with Q or its own D_s. Q^4=I, and P=Q^2 is the physical monomial Pauli. +The source's all-width phase, chart and helper-autonomy results are premises; +this package does not independently replay their native words. + +The original thin inputs are X at query0, C1 X at query2, and C3 X at +query4. Their paid response is Q^-1 times that input; query0's response is +subsequently multiplied by C1 before addition. Retain the two FULLs, paid +IDLE, all bridges, signed swaps, scalar boundaries and all three queries. + +## The changed inputs + +Save h, the first FULL's Y output, before the subsequent IDLE and bridge. +At query2 replace its argument C1 X by C1 X+h, obtaining response r2. +At query4 replace its argument C3 X by C3 X+C1 Q^2 r2. +Both additions use owned query copies before the destination is updated. +No extra Gaussian query is introduced. + +Let x0,y0,x1,y1 denote the four original independent input banks, before +the scalar right boundary. After query4, before the last scalar operations, +the second pair's Y bank is exactly + + D1 Q^-1 x0 + + Q^-1 C1 Q (I-Q) D1 y0 + + [(Q^-1 C1 Q C1-Q^-1)D1 + Q^-1 C3 D1 D3] x1. + +Its y1 coefficient is zero. `verify.py` checks this complete four-block +row against chronological multiplication. No selected-column substitution +is used in that equality. + +For a short independent derivation of the x0 coefficient, restrict the +input to x0 only. After FULL1, X vanishes and h=Q^-1 C1 D1 x0. +Query2's response is Q^-1 h. Bridge-minus sends this response to the +second pair's Y input. FULL3 produces + + X=-D3 Q C3 Q^-1 h, Y=D3 Q^-1 h. + +The old part of query4's response is -Q^-1 D3 h, cancelling this Y. +Its new part is Q^-1 C1 Q h=D1 Q^-1 x0. Thus the previously absent +rank-nine coefficient has appeared through active use of two paid responses. +The finite passive trace's missing-grade invariant does not apply to this +changed trace. This observation is not independent-job credit. + +## The output is coupled at every positive width + +The y0 coefficient is an invertible left factor times (I-Q) times an +invertible right factor. It is nonzero whenever Q != I. At every positive +digit-column width, Q has an eigenvector of eigenvalue i (one column has +odd central frequency and the other columns have even central frequency). +Consequently an arbitrary y0 input changes this output. The old autonomous +job has not been recovered. + +There is also an exact size for the contamination. At column count f, in +the common 17-axis ambient address space, define + + b0(f) = sum_{0<=k<=f, k=0 mod 4} binomial(f,k). + +Q has eigenvalue i^k on a central Walsh frequency of Hamming weight k. +Hence, including the sixteen spectator axes and all 112 owners, + + rank(Q^-1 C1 Q (I-Q)D1) + = 112 * 2^(16f) * (2^f-b0(f)). + +The fraction of the full owner-bank dimension is 1-b0(f)/2^f, tending +to 3/4: the root-of-unity filter gives +`b0(f)=(2^f+(1+i)^f+(1-i)^f)/4` for f>=1, and both extra terms have +magnitude 2^(f/2). For example the rank fraction is 1/2,3/4,7/8 at +f=1,2,3. This is ordinary +complex linear rank, not a lower bound on recursive calls or free circuit +cost. It does not price a correction or exclude a changed caller. +The checker independently compares binomial sums, a four-residue recurrence +through f=64, and central frequency enumeration through f=12. + +## Inventory and ordinary work + +The attempted complete caller still invokes exactly two source FULLs, +one IDLE on two 112-owner banks, and three 112-query banks. Its recursive +paid histogram is the inherited + + {1:4754,2:824,3:1020,4:254,5:80,8:224}. + +All 816 original helper jobs remain autonomous once; no owned copy earns +a productive target. The old proposed main rewards cannot be retained. + +For the explicit component, one extra owned 112-field bank can first hold h, +then be reset and reused for r2. One extra eight-field mode workspace +implements C1. The additional field-level upper ledger is: + +| Added operation | Count | +| --- | ---: | +| Two feedback additions | 224 scalar ADDs | +| One inherited F-transpose recoding | 896 ADDs, 224 monomial passes, 16 mode CLEARs | +| Q^2 on the saved response | 112 monomial passes | +| Captures of h and r2 | 224 COPYs | +| Initial, intermediate and final reset of the saved bank | 336 owned resets | +| Extra owned capacity | 112 saved fields plus 8 modes | +| Gaussian children | 0 | + +Query buffers already required by the three thins stay charged. Read h +before changing its source; save r2 before releasing its query buffer. +The native helpers and original inputs are never cleared. These are +field-level counts under inherited owned-reset and monomial implementation +contracts. A fixed-tape implementation, precise rounding budget, completion, +compiler and outer bill are not supplied. + +## Bounded synthesis and its limits + +The search uses the semidirect-product algebra of the inherited gauge engine, +adding C1^2=C3^2=I and Q^4=I. Its fresh D exponents are formal integers. +In particular D^4=I and other additional physical source relations are not +imposed. This is a sufficient algebra for a positive identity; a failure in +it is not a faithful physical impossibility proof. + +For each feedback, allow it to be absent, or use a reduced C1/C3 word of +length at most seven with coefficient in {-2,-1,-1/2,1/2,1,2}. There are +91 choices per edge and 8,281 policies. The second word is followed on the +right by Q^2. Keep both original thin-input coefficients equal to one. +The passive left decoder may use the thirty words W and W Q^2, for reduced +C1/C3 words W of length at most seven, and arbitrary rational scalar sums +across all 39 recorded bank observations. This is a restricted whole-bank +decoder grammar; arbitrary port-dependent controls are not included. + +After query4 only scalar operations occur. Thus the span of all observations +equals that of the thirty preceding observations and response4, with the +same thirty left controls. This justifies caching the pre-query basis. +All 8,281 policies attain only the positive first-pair job in this formal +span. `SEARCH.json.gz` retains every policy, exact rank and attainment mask; +the full registered replay recomputes all of them. + +The smaller 49-policy pilot uses code-word length one, coefficients +/-1 +and decoder length three with the same Pauli placements. For all 196 target +questions it checks either a constructive recipe or a rational separating +functional directly against every declared generator. These checks do not +trust the elimination pivots. Deleted recipes and false dual pairings reject. + +The finite span result excludes the specified recipes only in the declared +formal algebra. Different feedback sources, earlier active changes, input +weights, additional Pauli placements, port-dependent controls, native prefix +observations and further physical relations remain outside it. diff --git a/research/coded-active-feedback/README.md b/research/coded-active-feedback/README.md new file mode 100644 index 0000000000..bdd22ccce3 --- /dev/null +++ b/research/coded-active-feedback/README.md @@ -0,0 +1,97 @@ +# Active query feedback restores a missing coefficient, with high-rank coupling + +Two changed inputs to already-paid queries recover the first original input's +missing rank-nine Gaussian coefficient in the PR4948 physical p2 caller. +The complete output remains coupled to two other arbitrary input banks. +**No autonomous new job, profitable complete caller or higher kappa is supplied.** + +Save the first FULL's Y output h. Add h to the second query's old input; +then add C1 Q^2 times that query response to the final query's old input. +All FULLs, the IDLE, three paid queries and 816 independent helper jobs stay +charged. The new response path gives exactly D1 Q^-1 on the first original +input. It escapes the unchanged-input premise of the passive grade result. + +The same output has second-input coefficient +`Q^-1 C1 Q (I-Q) D1`, which is nonzero at every positive width. At digit +width f its ordinary complex rank on the 112-owner, 17-axis ambient bank is +`112 * 2^(16f) * (2^f - sum_{k=0 mod 4} binomial(f,k))`. +The fraction of the bank dimension tends to 3/4. This measures coupling; +it is not a recursive-call lower bound. The [proof](PROOF.md) gives the +complete four-input row, all-width argument, exact recipe and ordinary bill. + +The exact bounded synthesis tests 8,281 feedback policies in a declared +universal operator algebra, retaining only one of the four required jobs +in every case. This rejects that finite formal synthesis domain. It is +**not** a physical impossibility result: additional source relations, other +feedback inputs and larger decoder grammars are untested. + +## Reproduce + +Python 3.12, standard library only, from the repository root: + +```sh +python3.12 -B scripts/research_package.py --package research/coded-active-feedback +python3.12 -I -O -W error -B research/coded-active-feedback/verify.py +``` + +The registered normal command replays every full-search policy and rank +(about three minutes on the author's machine). The optimized command checks +the complete component row, rank counts through width 64, positive/negative +controls and 196 direct span certificates on a smaller 49-policy pilot. +Both authenticate four inherited source inputs. All guards remain active +under optimization; no scientific module is loaded from a bytecode cache. +Default verification writes only private temporary outputs. `--write` is +the explicit RESULT.json authoring option. + +`SEARCH.json.gz` is a compressed mathematical receipt. Replay compares its +parsed JSON with the regenerated receipt, including every case. Compression +container bytes are not a cross-platform mathematical equality condition. +[RESULT.json](RESULT.json) records the canonical payload digest. + +## Scope, sources and credit + +Base: canonical main `ec2780e8aeb1c88acaf5e9e470ef8c68e7fbbb6c`, priority +revision 7, selected conditional kappa 0.00302015. [SOURCES.json](SOURCES.json) +pins the gauge engine, exact original chronology and mixed derivation, and +the involutive physical ABI proof. Their all-width native implementation +and helper-autonomy claims remain inherited premises. No new phase audit, +native-word emission, precision/tape implementation, full multiplier replay, +independent human review or formal proof-kernel acceptance is claimed. + +The [canonical investigation](https://github.com/CrocSwap/integer-mult-bounds/discussions/4930#discussioncomment-19145683) +and its [scope refinement](https://github.com/CrocSwap/integer-mult-bounds/discussions/4930#discussioncomment-19145848) +precede the published package. [TASK.json](TASK.json) records the exact +bounded scope, overlap coverage and remaining questions. + +Credit Dugongue/mdumitrean PR4948/4935/4929; Dillon PR4933; the passive +saved-query authors and Chris R/Clear1nsight's packaging; Cao Yifan PR4610; +Cinna Davis PR4694/4698/4470; Rohan Arun PR1931 and Ali Romman PR1862 for +the involutive repair lineage; zxv, Jacob Alan Sussman and all retained +native, Clifford, compiler and precision contributors. The inherited +gauge engine is used unchanged except for its explicitly supplied word +reducer. The new active recipe, complete row, coupling rank and bounded +synthesis are by Cinna Davis with substantial OpenAI Codex assistance. +No subagents. Apache-2.0. + +The submission refresh also found [PR5200](https://github.com/CrocSwap/integer-mult-bounds/pull/5200), +head `40bb94aebbf591a99e2f48533f16efe8914fb1e2`. Its two-FULL ceiling has +dirty identity workspace and excludes additional paid operations and owned +COPY/CLEAR resources. This package retains three separately paid query banks +and owned captures; its output is coupled. It is neither a counterexample +to that ceiling nor a replay of its proof. Standalone active repair bounds +and the passive unchanged-input result also remain outside the new recipe's +declared source-sharing premise. + +## Open next questions + +- Can a changed query input or boundary remove the explicit y0 coupling + while preserving every original main and helper job? Start with the + complete row in PROOF.md and declare the extra work before expanding. + Another selected-column identity does not supply the missing caller. +- Can a physical source relation or port-dependent control absent from + the formal algebra yield a complete identity? First give one explicit + relation and an exact all-input check. The finite search is not a + reason to repeat the same unaltered grammar. +- If a complete caller survives, price its scalar work, owned storage, + rounding, completion, compiler, BIT and outer transfer before assigning + a new kappa. The preserved paid histogram alone admits no new targets. diff --git a/research/coded-active-feedback/RESULT.json b/research/coded-active-feedback/RESULT.json new file mode 100644 index 0000000000..f8dadc8214 --- /dev/null +++ b/research/coded-active-feedback/RESULT.json @@ -0,0 +1,412 @@ +{ + "autonomous_Gaussian_job": false, + "complete_active_output_row": [ + [ + [ + [ + -1 + ], + [ + 1, + 0 + ], + "1" + ] + ], + [ + [ + [ + -1, + 2, + 1 + ], + [ + 1, + 0 + ], + "1" + ], + [ + [ + -1, + 2, + 1, + 1 + ], + [ + 1, + 0 + ], + "-1" + ] + ], + [ + [ + [ + -1 + ], + [ + 1, + 0 + ], + "-1" + ], + [ + [ + -1, + 2, + 1, + 2 + ], + [ + 1, + 0 + ], + "1" + ], + [ + [ + -1, + 3 + ], + [ + 1, + 1 + ], + "1" + ] + ], + [] + ], + "coupling_ranks": [ + { + "central_eigenvalue_one": 1, + "complex_rank": "7340032", + "width": 1 + }, + { + "central_eigenvalue_one": 1, + "complex_rank": "1443109011456", + "width": 2 + }, + { + "central_eigenvalue_one": 1, + "complex_rank": "220676381741154304", + "width": 3 + }, + { + "central_eigenvalue_one": 2, + "complex_rank": "28924494707576576933888", + "width": 4 + }, + { + "central_eigenvalue_one": 6, + "complex_rank": "3520391986717800156744384512", + "width": 5 + }, + { + "central_eigenvalue_one": 16, + "complex_rank": "425930601676685078902892277006336", + "width": 6 + }, + { + "central_eigenvalue_one": 36, + "complex_rank": "53501426830342863884378234176283869184", + "width": 7 + }, + { + "central_eigenvalue_one": 72, + "complex_rank": "7012539017506699855053223909953879301685248", + "width": 8 + }, + { + "central_eigenvalue_one": 136, + "complex_rank": "939128981800521601736352167897767799739847278592", + "width": 9 + }, + { + "central_eigenvalue_one": 256, + "complex_rank": "125712524836654945412208154570923800218724693616623616", + "width": 10 + }, + { + "central_eigenvalue_one": 496, + "complex_rank": "16649031555967016557205082102960958970833981823402654040064", + "width": 11 + }, + { + "central_eigenvalue_one": 992, + "complex_rank": "2182221864103708794185984521399298814225151665557032670339268608", + "width": 12 + }, + { + "central_eigenvalue_one": 2016, + "complex_rank": "284553812088441518457774510801277508125654547772283698609148261302272", + "width": 13 + }, + { + "central_eigenvalue_one": 4096, + "complex_rank": "37103788360346070921249247515601288832377161834387998120553730227145015296", + "width": 14 + }, + { + "central_eigenvalue_one": 8256, + "complex_rank": "4850602988206948748915528293879566889915887951384099252965402855081485946322944", + "width": 15 + }, + { + "central_eigenvalue_one": 16512, + "complex_rank": "635778234870261186417856124535382591395055265563816657284681283021240525956440915968", + "width": 16 + }, + { + "central_eigenvalue_one": 32896, + "complex_rank": "83441514258879515054132727821883784078104658550967496716807846623105416858134115413655552", + "width": 17 + }, + { + "central_eigenvalue_one": 65536, + "complex_rank": "10951105408774197199779164020888816993812694084348073283419891055729153867527698132441944293376", + "width": 18 + }, + { + "central_eigenvalue_one": 130816, + "complex_rank": "1436317782467066973530502408542388200063156122252201696991263791159953876854619479856065568334413824", + "width": 19 + }, + { + "central_eigenvalue_one": 261632, + "complex_rank": "188261044383523402354590011692467906158677999255840580828038927634917474547088684463694226172728288739328", + "width": 20 + }, + { + "central_eigenvalue_one": 523776, + "complex_rank": "24667724364281214143130184139421596091737454740999447626359636762026048993769698353197084547975956821738258432", + "width": 21 + }, + { + "central_eigenvalue_one": 1048576, + "complex_rank": "3232195820797984622882265008214905819947947362030368671980133443317031864068130557967576528721028236159918702329856", + "width": 22 + }, + { + "central_eigenvalue_one": 2098176, + "complex_rank": "423581417112789750151802750836568884308058467092321168042111141168992570474037888375356215806576564367581452552795848704", + "width": 23 + }, + { + "central_eigenvalue_one": 4196352, + "complex_rank": "55519663503807578131897090157650756804025839398724720137615591495302194197173094105134689918199603444787636149000057481330688", + "width": 24 + }, + { + "central_eigenvalue_one": 8390656, + "complex_rank": "7277665640919102943648676317259597358668961072265582513850029853792815065400819525514073446490812407610428487047709955122016550912", + "width": 25 + }, + { + "central_eigenvalue_one": 16777216, + "complex_rank": "953975825637984043845987497853005951339154285902104954119455886424589065648834774365625754061814679798500809608224358537764164637556736", + "width": 26 + }, + { + "central_eigenvalue_one": 33550336, + "complex_rank": "125044607289091913843215118585244412085666106051285511772767292376838002487740865331114582173745170055508023454620426985507359329585236803584", + "width": 27 + }, + { + "central_eigenvalue_one": 67100672, + "complex_rank": "16389846766595855331257892023205155580892427852354094599080154546416910662073170700679850514677126929515547650244008605844420602047396158319362048", + "width": 28 + }, + { + "central_eigenvalue_one": 134209536, + "complex_rank": "2148206290911547526087395080904329047970451823089758577694521988510522559094911153360827682374317492017865624035746996292519360879896799227241134292992", + "width": 29 + }, + { + "central_eigenvalue_one": 268435456, + "complex_rank": "281563966528794539091054524962322768677066682232440260932194790318157044631544486512839360261504971981490669021916207067928831539050877968875106629127766016", + "width": 30 + }, + { + "central_eigenvalue_one": 536887296, + "complex_rank": "36904776802240119435023910623161620172348914751327433293890059296861055944552956876895530175715631014261969649148571871198143902377757942632439475950862376894464", + "width": 31 + }, + { + "central_eigenvalue_one": 1073774592, + "complex_rank": "4837182905023216934587454013199039879230116954285989336696757852158172324764445163768450931191399188301344885853201612301683117572457489056719106991831433464311185408", + "width": 32 + }, + { + "central_eigenvalue_one": 2147516416, + "complex_rank": "634022462548611018613413971012026864362246327231067593153360051819670411116703181827963845141482873678000281941859583835383833902142256583956303872937011291183647054364672", + "width": 33 + }, + { + "central_eigenvalue_one": 4294967296, + "complex_rank": "83103014894963123444328847062601455851804133298007178211125186847213467635794707369226310756577663116504817599141422818022058651527068406549095508114236104419979875441962909696", + "width": 34 + }, + { + "central_eigenvalue_one": 8589869056, + "complex_rank": "10892506069317571503802885418471652221892955294347496198214670865500246034448095815868354078923066319227558287293864285411393278925839752539338562804718526090570408893887443153977344", + "width": 35 + }, + { + "central_eigenvalue_one": 17179738112, + "complex_rank": "1427702555517592732146451797569916400027953436340715021692393339682848248227180814777496905832604148593794519832181379617442139855367668044836184103940066651743244634539614949078118432768", + "width": 36 + }, + { + "central_eigenvalue_one": 34359607296, + "complex_rank": "187131591406981132676239517075567546878518869150333457612963786467936371810838226092711327296490076141765855641024067950784921279855207717559925067406681928746156889901967076349405013005565952", + "width": 37 + }, + { + "central_eigenvalue_one": 68719476736, + "complex_rank": "24527680760336921495414938552244766162625996454968258186793738976226503298913849629855787273642188645209981056267643533702262476582114354678606307254826623476042723369360784371645531657517741899776", + "width": 38 + }, + { + "central_eigenvalue_one": 137439215616, + "complex_rank": "3214890128645484279503568874674946636737201055179228289704580055613712221519961189196988594881889479922575536175357884279128472142031177520238062687312363956699915500575242615761625488286527339808948224", + "width": 39 + }, + { + "central_eigenvalue_one": 274878431232, + "complex_rank": "421382078941820915483091779541394605570418416704451810388158717049400488299064352990427689108359017912411820677576508608233927100600310499932643352551406168532571324491398200133107776000691711483438461616128", + "width": 40 + }, + { + "central_eigenvalue_one": 549756338176, + "complex_rank": "55231409408660136430115099749145512364802225321964616607964344421660354211227155753677418348862755966849481666420589711142570665778406919205006742298731329123215518595292606584429585936874026269452912592087416832", + "width": 41 + }, + { + "central_eigenvalue_one": 1099511627776, + "complex_rank": "7239293595321358329581455772253074356735648455674209963177666082533761039744283263918866252551248771531842672786128409196849271750908961169452833844998274931035976308732548648928866396770846445580920965460879533408256", + "width": 42 + }, + { + "central_eigenvalue_one": 2199022206976, + "complex_rank": "948868840944577648169865770594416884025104013041472874839663948304575179788051023974274969097444207133237756387479105894591286014628300835672546201332318995891475216654365715107167895708931651374483422387408515971210543104", + "width": 43 + }, + { + "central_eigenvalue_one": 4398044413952, + "complex_rank": "124370136720287681500920646283351409822938433197371932650984433032177277965179423814356168749540207117367739205219661367815869040509360647133271975701029715429487439597321023010526710426361089408956291139162409005378508305727488", + "width": 44 + }, + { + "central_eigenvalue_one": 8796090925056, + "complex_rank": "16301441264679495404376477789253856409254744747885624186694939002833537590329477372334757521520261022883872742713213861733581588670424234925608620393508884411210277465559492568156771244067892190837990241863159097518673366306690957312", + "width": 45 + }, + { + "central_eigenvalue_one": 17592186044416, + "complex_rank": "2136662339637404476252393914873449916687620922372956411259787201645580779940342308074189395420877687158226442298310822286432874065193277995111549027999075789916966387478550807612985900942201149281437154218347452417228785839645472520667136", + "width": 46 + }, + { + "central_eigenvalue_one": 35184376283136, + "complex_rank": "280056595052504193899872128062407854180861533455909172044161519449364555417607318147950631216868845727465102295828142461691796927635127577160271396325243674440810212522055343337997165023994621631318878170222059062671363411174085126075380137984", + "width": 47 + }, + { + "central_eigenvalue_one": 70368752566272, + "complex_rank": "36707578026721829702844039569395922263193882913132926998172338677267111007696626404288185134857433347190305888118786288738867206898991441793551092459142338896305876175690837961997964414025023046460227999527345725462460945029409685644952225445838848", + "width": 48 + }, + { + "central_eigenvalue_one": 140737496743936, + "complex_rank": "4811335762711138572576764827648617594661300401057414316225304162547506763450050057416434379327285535377530085458148754705039737574926466772219546582893777010031383342920328573267909901801778127577400862868490730251886006996413350182117727163762335547392", + "width": 49 + }, + { + "central_eigenvalue_one": 281474976710656, + "complex_rank": "630631413619594819317577246422777576350187805858158297080943548824061051260015463467582456680747835991278537611515258860011346015969388433987962716157752033443337061497635816496276781390688214634878300505103820596963748479753507838018227566528126203950268416", + "width": 50 + }, + { + "central_eigenvalue_one": 562949936644096, + "complex_rank": "82658121467082185308107572496221675433696785295414229859470382155612575975415573989101435818806970828772605262127123857626567118978246472446478105887388661191224702203963253898179959686634011437748048076302755089305832176368132612357105121019541701721000576548864", + "width": 51 + }, + { + "central_eigenvalue_one": 1125899873288192, + "complex_rank": "10834165296933396192704275742224767442445505042240533936140501929900451558249670113899503395642667280468882916917526378266829405418716721636504778294871806599656204167277871614942243676046493147168512157457154715065494035020923877766870482422273369927974987569412702208", + "width": 52 + }, + { + "central_eigenvalue_one": 2251799780130816, + "complex_rank": "1420055706746161143982612085970240678269439424640822957778883127409805718357688591718134646449849103423251097714044589670512807033492628431234701537386909508679940699601385427279630041310500111668100181779747928621707167104589366230328429367969004596001708638075590721667072", + "width": 53 + }, + { + "central_eigenvalue_one": 4503599627370496, + "complex_rank": "186129540670117403976674750215696762578227902858539126158781105551926814319899629619410840299244423880492289063895061219093479455449837564609095109719933790811552927788476093726136771479369714702814955183442712910934822099473687898226374851151238797564822120753151310499304964096", + "width": 54 + }, + { + "central_eigenvalue_one": 9007199321849856, + "complex_rank": "24396371094124585187143537086614660812148031115040878215453051937090593609686707717049756976300598883620257746918436451122346965261062432364199315325021347467294251154622086542394303818200466946253366134314960042885124226527286151357236291786197108148622485595724847803765124700831744", + "width": 55 + }, + { + "central_eigenvalue_one": 18014398643699712, + "complex_rank": "3197681152049097629649277693016756821969866734310637989455862423498338285608856153889145746397672096873874423404093302521508261430697975134840332658281198055233192087338626127284706190059171603579321205956930442741039002619384450430695675237000427359256246432002847251335102424787418349568", + "width": 56 + }, + { + "central_eigenvalue_one": 36028797153181696, + "complex_rank": "419126464481835242480614197758414224521699568645505013134746860242294346531903223808699642012644587155107191130850870674666671409903549832814509079913023894881363072295688197912071965623375983866352997011770505514776467173451670734259401575519104643954465061389692981835944914510054369999716352", + "width": 57 + }, + { + "central_eigenvalue_one": 72057594037927936, + "complex_rank": "54935744020780306982219057691064545951634524037637221084762593153753349789120260186418862195140656788768281570480019734689770632323092272743084992448405779024078594548659387376426407887282664545760995562796380853187309757474456571958612407926664629200682403816264010136930914664234646514546220466176", + "width": 58 + }, + { + "central_eigenvalue_one": 144115187807420416, + "complex_rank": "7200537844762398690131188707793487044175158722652276665397427502814464886618925380940772612999782009320940172446084227596248805666350611466983285930253187096402051926198695929613394050001197903377358301695990750296745454276752987219229995202874822079915462945821307168069502380149446617270572791181082624", + "width": 59 + }, + { + "central_eigenvalue_one": 288230375614840832, + "complex_rank": "943788896388697121112875166307907933854126404095479207086971617648897541618915787530668947931107427525714270282853151879495523456299907346200433253450145739099609750070715472886286784921757011591477107319896899622895020182962567540798913931231208679658679559234690373133205815970948267018888516885686861692928", + "width": 60 + }, + { + "central_eigenvalue_one": 576460751766552576, + "complex_rank": "123704298189056440576950953015518554947817591147081902179777219377692284655881148430902129713069882843895881279221135245784132468249434168641970652073648776287544357063967327557181337621515403638774549238142938638535577519080111975205238063862287674557482253702186168411286985582049150738056749882816203221454815232", + "width": 61 + }, + { + "central_eigenvalue_one": 1152921504606846976, + "complex_rank": "16214169767202465001687630772007993499911078052699983541469301294616840861999138964581176978035658319087709942438709450299018796863943721825436711878797564347655738486510824541678638696990804836906567082397184930571755055053400217708512002825288202984455151316679131166835791423491823399261142264105095411413047266246656", + "width": 62 + }, + { + "central_eigenvalue_one": 2305843010287435776, + "complex_rank": "2125223659396883364299458281627578038066406152684806572729967849346016179098862420401083317508864689645027909716282947139117945960100091011011035681770399376173052820877747687749126966886081988196974167946014460378161476310095116128186207107108492992431203286567121586389199519499231160712878651583679748217019842995897237504", + "width": 63 + }, + { + "central_eigenvalue_one": 4611686020574871552, + "complex_rank": "278557315484468296325458595889489908605439987244702967100862345949481032626846095166810792592521912601153098182332638447418467412882239128995238468881009787033754379338088144928653569803692538356953798141020007350686381022916787061153622537942924393503942677176925760571205159419803226696958430620376071958301224861158242714124288", + "width": 64 + } + ], + "direct_span_certificates": 196, + "full_search_canonical_sha256": "52af1535ddff248377da4cf92141aca2b1fc8f733ffed71fb95c719cbdc05f10", + "full_search_policies": 8281, + "new_kappa": null, + "normal_form_fixtures": 1555, + "physical_impossibility_claim": false, + "pilot_canonical_sha256": "e736bb9605bf510c3d9cebf3fc78d1a8fc5fc5e8a4a645010f5b9326ad239e5b", + "pilot_policies": 49, + "status": "PASS_ACTIVE_FEEDBACK_COMPONENT_AND_CERTIFIED_PILOT" +} diff --git a/research/coded-active-feedback/SEARCH.json.gz b/research/coded-active-feedback/SEARCH.json.gz new file mode 100644 index 0000000000..f3c308dca0 Binary files /dev/null and b/research/coded-active-feedback/SEARCH.json.gz differ diff --git a/research/coded-active-feedback/SOURCES.json b/research/coded-active-feedback/SOURCES.json new file mode 100644 index 0000000000..d31da7727d --- /dev/null +++ b/research/coded-active-feedback/SOURCES.json @@ -0,0 +1,42 @@ +{ + "base_commit": "ec2780e8aeb1c88acaf5e9e470ef8c68e7fbbb6c", + "files": [ + { + "git_blob": "c35482cd9035843b15a634cc8276a7e1e40e8395", + "path": "certificates/selected-result.json", + "sha256": "6fe0a099b89aa2aed796a13c3a21dafc63f3388ebf397464e44e0451893b9375", + "usage": "provenance" + }, + { + "git_blob": "f126dd2e2dad2b669e75d1d0d0bd05c600725602", + "path": "docs/research/agent-task-catalog.json", + "sha256": "f7a48bfa2659b88378282a8eee7d9fe52cdf505594124c4d1686b58510fffd72", + "usage": "provenance" + }, + { + "git_blob": "44ae72b314cccf677b44d75c374be6dcac1c8167", + "path": "research/coded-native-caller/gauge.py", + "sha256": "390391d291353741c89daea999d483660ca185987ed96a15b82576280c487cad", + "usage": "input" + }, + { + "git_blob": "bee0ff7c400dd91dc7d05f893c7a211a28f7028f", + "path": "research/passive-saved-query-ceiling/evidence/frozen/pr4948-mixed-thin-gate/check.py", + "sha256": "fe7db972d7ae238b21f8a453c21243360d131d728a76b91a469dacf447629582", + "usage": "input" + }, + { + "git_blob": "513be55ff4c630dda408244223a0bfed6b76ad49", + "path": "research/passive-saved-query-ceiling/evidence/frozen/pr4948-saved-query-macro-gate/bank_span.py", + "sha256": "55c5d1761812d847188fa893988decc491a40151ad45f3fb806e7f8c3337229d", + "usage": "input" + }, + { + "git_blob": "9db00720d92638b5b7f212412f139b354d3cf42e", + "path": "research/native-involutive-dual/PROOF.md", + "sha256": "9dcfdec3a4e4d97d30eecc173976f1561ff7b1742b2c73d25b9e197ca9ece9de", + "usage": "input" + } + ], + "schema_version": 1 +} diff --git a/research/coded-active-feedback/TASK.json b/research/coded-active-feedback/TASK.json new file mode 100644 index 0000000000..6c629f059d --- /dev/null +++ b/research/coded-active-feedback/TASK.json @@ -0,0 +1,114 @@ +{ + "actual_scope": "Two active feedback edges in the PR4948 p2 caller: recover one missing original-input coefficient, calculate its remaining full-input coupling, and search an explicit finite formal decoder domain.", + "ai_assistance": "Substantial OpenAI Codex assistance; no subagents or independent human review.", + "author": "Cinna Davis, with substantial OpenAI Codex assistance", + "base_commit": "ec2780e8aeb1c88acaf5e9e470ef8c68e7fbbb6c", + "bottleneck_link": "Avoid adding the standalone 112-call code repair by sharing already-paid query responses. The component escapes the passive invariant but remains nonautonomous.", + "budget_minutes": 60, + "coordination": { + "claim": "https://github.com/CrocSwap/integer-mult-bounds/discussions/4930#discussioncomment-19145683", + "overlap": { + "discussions": 4395, + "fetched_utc": "2026-10-23T12:25:56Z", + "limits": "Titles, bodies and indexed local notes; not arbitrary diffs or unpublished work.", + "open_prs": 315, + "tracked_local_notes": 6996 + }, + "scope_update": "https://github.com/CrocSwap/integer-mult-bounds/discussions/4930#discussioncomment-19145848" + }, + "evidence": "PROOF.md, RESULT.json, SEARCH.json.gz, verify.py and search.py", + "open_questions": [ + { + "blocked_by": "No such full caller is supplied; the current coupling is nonzero at all positive widths.", + "first_step": "Give an exact all-four-input replacement for the row in PROOF.md and charge every new query and boundary.", + "question": "Can the explicit second-input coupling be removed at a favorable complete bill?", + "why_it_matters": "Only autonomous main jobs can enter the productive inventory." + }, + { + "blocked_by": "No additional physical relation or broader control family has been constructed.", + "first_step": "State one additional source-bound relation or port-dependent control and test a complete all-input identity.", + "question": "Does an additional physical source relation evade the declared formal search?", + "why_it_matters": "The universal formal algebra is not asserted faithful to all physical identities." + } + ], + "original_card": { + "acceptance_gate": "Name the changed premise of the fixed F0/B1 observation obstruction. Show exactly which query is recovered, legal native reads and restoration, and a full favorable budget including cover maps, helpers and endpoints. Local inverse identities alone do not close the global controller. A scoped local result may be retained without a complete supplier. Expanding it into further construction rounds requires the family-level budget and obligation gate in research-family-status.md; an optimistic passing relaxation alone is not acceptance.", + "allowed_variations": [ + "One paid query, one changed first pair, or one precisely specified affine helper state.", + "A counterexample or lower bound for that exact proposed repair.", + "One unresolved obligation of a newer local decoder, with exact source heads and a distinct claim/domain." + ], + "bottleneck_link": "The native local words exist; retained query information and its physical access are the missing link to a composed recursive interface.", + "existing_checks": [ + { + "evidence": "research/qq16-caller-install/README.md", + "remaining": "Complete matched physical protocol bill, or changed source-compatible demand/circuit; no affordable supplier yet.", + "scope": "PR #4166: author-checked installed producer/service/return/bridge connection; native-component comparison loses.", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129", + "source_commit": "0b082d22a0e9a442d264ab0633e35ef26c790630", + "status": "author-checked" + } + ], + "first_experiment": "At the actual installed cut, compare matched complete parent park/restore and external input/return protocols at the same bank/packet geometry, including every later root call and service cost. Alternatively pin both bridge observations and derive a genuinely smaller source-compatible demand. Stop if the complete necessary inequality fails or an essential cost is unknown; no larger decoder scan from a local tape-action saving.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read #4166 COST.md and ADMISSION.json. An actual caller connection is now proposed. Its native-component profile loses; parent park/restore versus external-call costs remain unresolved. Retain the producer and recovery lineage rather than rebuild it.", + "scope": "Source-binding orientation only; no scientific replay, theorem acceptance or supplier admission. Budget any heavy replay separately." + }, + "id": "joint-query-controller", + "methods": [ + "Derive the matched whole-caller physical bill for installed and baseline protocols.", + "Change the actual demanded observations and prove a cheaper legal producer/consumer contract." + ], + "overlap_terms": [ + "QQ16", + "joint-query", + "changing-chart controller", + "selected observation", + "1969", + "2540", + "early record", + "output-bank retention", + "complete native decoder", + "2965", + "producer defect", + "dirty-helper range", + "F17 consumer", + "4166", + "qq16-caller-install" + ], + "question": "Can the installed QQ16 caller win a complete matched protocol bill, or can a changed demand eliminate actual paid work?", + "scope_change_triggers": [ + "Retaining the fixed first pair and ordinary schedule while allowing only homogeneous selected-only control, already excluded by the witness.", + "Treating cover-map counts as zero-cost physical address operations.", + "Recreating the pending complete local decoder or early-record/output-bank coalescing already under investigation without a distinct audit or changed premise.", + "Treating a completed-output defect inequality as a producer-interior, dirty-range or physical-cost certificate.", + "Recreating completed-output recovery or caller wiring already supplied by #4166 without new independent coverage.", + "Dropping retained later root calls or claiming native-profile dominance from the isolated publication saving." + ], + "starting_points": [ + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "research/qq16-caller-install/README.md" + ] + }, + "outcome": "partial", + "priority_revision": 7, + "related_open_work": [ + { + "head": "40bb94aebbf591a99e2f48533f16efe8914fb1e2", + "pr": 5200, + "scope_difference": "Two FULLs with dirty identity workspace; this experiment retains three added paid query banks and owned captures, and recovers no autonomous new job." + } + ], + "schema_version": 1, + "scope_change_reason": "The card predates the involutive coded producer. Standalone eight-mode extraction and unchanged-input passive recovery are already covered; this changes two actual paid query inputs.", + "scope_status": "changed", + "stop_rule": "Stop this grammar after the exact full-row obstruction and the declared 8281-policy search; another construction round must change a feedback source, physical relation, control alphabet or endpoint and give a complete budget.", + "task_id": "joint-query-controller" +} diff --git a/research/coded-active-feedback/VALIDATION.md b/research/coded-active-feedback/VALIDATION.md new file mode 100644 index 0000000000..f5fdd9139d --- /dev/null +++ b/research/coded-active-feedback/VALIDATION.md @@ -0,0 +1,40 @@ +# Executed validation and remaining obligations + +Local verification on 2026-10-23 used CPython 3.12.15, standard library only. + +Passed: + +```sh +python3.12 -B scripts/research_package.py --package research/coded-active-feedback --check-only +python3.12 -B scripts/research_package.py --package research/coded-active-feedback +``` + +The registered replay executed the normal isolated, warning-strict verifier +with `--full-search`, followed by its optimized component/pilot verifier. +Every one of the 8,281 regenerated policy records and exact basis dimensions +matched the decompressed receipt. Both modes passed the component identity, +four-input contamination formula, binomial/recurrence coupling-rank checks, +196 directly verified pilot certificates, normal-form fixtures, source hashes, +and positive/corruption controls. No package source or receipt changed. + +The initial full search and the registered replay are separate completed runs; +the optimized replay does not repeat the full 8,281-case synthesis. Gzip +payloads are compared as parsed JSON, including all proof-relevant fields. + +Canonical main was refreshed before submission and remained +`ec2780e8aeb1c88acaf5e9e470ef8c68e7fbbb6c`. Priority revision 7 and the +selected conditional kappa 0.00302015 were unchanged. The submission overlap +refresh completed at 12:49:20 UTC: 334 open PRs, 4,438 Discussion records, +and complete coverage of the 6,996 tracked local notes, plus this untracked +package's two indexed notes. Coverage is titles/bodies and indexed notes, +not arbitrary diffs or unpublished work. Related PR5200 is scoped in README. + +This validates the stated component and bounded formal experiment. It does +not independently validate the source native ABI, physical phase conventions, +all-width helper contracts, a complete changed caller, scalar tape tariff, +rounding, compiler, BIT, outer transfer or a multiplication theorem. There is +no autonomous new job or new kappa. Human and proof-kernel review are absent. + +Committed-byte/source-history preflight and portable-export replay are +reported separately in the PR after the commit exists. Hosted status is +likewise reported there only after observing the exact published head. diff --git a/research/coded-active-feedback/VERIFY.json b/research/coded-active-feedback/VERIFY.json new file mode 100644 index 0000000000..23463e4024 --- /dev/null +++ b/research/coded-active-feedback/VERIFY.json @@ -0,0 +1,40 @@ +{ + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-W", + "error", + "-B", + "{package}/verify.py", + "--full-search" + ], + "checks": "Four source hashes, complete active output row, retained nonzero coupling, rank counts through width64, uncoded positive and corruption controls, 196 direct pilot certificates, all8281 full-search policies/ranks.", + "timeout_seconds": 600 + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-W", + "error", + "-B", + "{package}/verify.py" + ], + "checks": "Same complete component and 49-policy certified pilot under optimization; full receipt domain/digest is checked without repeating the8281-policy synthesis.", + "timeout_seconds": 120 + } + ], + "inputs": [ + "research/coded-native-caller/gauge.py", + "research/passive-saved-query-ceiling/evidence/frozen/pr4948-mixed-thin-gate/check.py", + "research/passive-saved-query-ceiling/evidence/frozen/pr4948-saved-query-macro-gate/bank_span.py", + "research/native-involutive-dual/PROOF.md" + ], + "python": "3.12", + "requirements": [], + "schema_version": 1, + "status": "ready" +} diff --git a/research/coded-active-feedback/search.py b/research/coded-active-feedback/search.py new file mode 100644 index 0000000000..60de5a87d3 --- /dev/null +++ b/research/coded-active-feedback/search.py @@ -0,0 +1,335 @@ +#!/usr/bin/env python3 +"""Bounded active-query synthesis in a declared universal operator algebra. + +Prepared by Cinna Davis with substantial OpenAI Codex assistance. Apache-2.0. +The symbolic algebra is a sufficient identity model, not a faithful model of +every additional relation in the physical source. +""" +from collections import Counter +from fractions import Fraction as F +from hashlib import sha256 +import argparse +import json +from pathlib import Path +import sys +import types + +sys.dont_write_bytecode = True +HERE = Path(__file__).resolve().parent +ROOT = HERE.parent.parent + + +def need(ok, message): + if not ok: + raise ValueError(message) + + +def reduce_word(word): + """Normal form in C4(Q) * C2(C1) * C2(C3).""" + out = [] + for letter in word: + if abs(letter) in (2, 3): + letter = abs(letter) + if out and out[-1] == letter: + out.pop() + else: + out.append(letter) + else: + need(abs(letter) == 1, 'Unknown formal generator') + exponent = letter + while out and abs(out[-1]) == 1: + exponent += out.pop() + exponent %= 4 + out.extend((1,) * exponent if exponent <= 2 else (-1,)) + return tuple(out) + + +def algebra(): + path = ROOT / 'research/coded-native-caller/gauge.py' + raw = path.read_bytes() + need(sha256(raw).hexdigest() == + '390391d291353741c89daea999d483660ca185987ed96a15b82576280c487cad', + 'Changed inherited group-algebra engine') + module = types.ModuleType('feedback_inherited_gauge') + module.__file__ = str(path) + exec(compile(raw, str(path), 'exec'), module.__dict__) + module.reduce_word = reduce_word + return module.Algebra(2) + + +def words(length): + return [()] + [tuple(2 + ((j + start) % 2) for j in range(n)) + for n in range(1, length + 1) for start in range(2)] + + +def scaled(a, scalar, row): + return [a.mul(a.term((), (0, 0), scalar), entry) for entry in row] + + +def replay(a, feedback1, feedback2, coefficient1=1, coefficient2=1, + codes=True): + q, qi = a.gen(1), a.inv(a.gen(1)) + c1, c3 = (a.gen(2), a.gen(3)) if codes else (a.one, a.one) + d1, d3 = a.D(0), a.D(1) + rows = [[a.one if i == j else {} for j in range(4)] for i in range(4)] + observed = [] + responses = [] + + def snap(label): + observed.extend((label + ':' + str(i), list(row)) + for i, row in enumerate(rows)) + + def plus(dst, src, op): + rows[dst] = [a.add(x, a.mul(op, y)) + for x, y in zip(rows[dst], rows[src])] + + def left(index, op): + rows[index] = [a.mul(op, entry) for entry in rows[index]] + + def query(pair, argument, label, after=None): + response = [a.mul(qi, entry) for entry in argument] + observed.append((label, response)) + responses.append(response) + rows[2 * pair + 1] = [a.add(x, a.mul(after or a.one, y)) + for x, y in zip(rows[2 * pair + 1], response)] + return response + + def full(pair, code, stage): + plus(2 * pair, 2 * pair + 1, a.neg(a.mul(q, code))) + left(2 * pair, stage) + left(2 * pair + 1, stage) + + def bridge(dst, src, sign): + plus(2 * dst, 2 * src, scaled(a, sign, [a.one])[0]) + plus(2 * src + 1, 2 * dst + 1, scaled(a, -sign, [a.one])[0]) + + rows[0][2], rows[3][1] = a.neg(a.one), a.one + snap('right') + query(0, rows[0], 'response0', c1) + snap('query0') + full(0, c1, d1) + snap('FULL1') + late_y = list(rows[1]) + left(2, d1) + left(3, d1) + snap('IDLE') + bridge(0, 1, 1) + argument = [a.add(a.mul(c1, x), a.mul(feedback1, y)) + for x, y in zip(rows[0], scaled(a, coefficient1, late_y))] + response2 = query(0, argument, 'response2') + snap('bridge_query2') + bridge(0, 1, -1) + snap('bridge_minus') + full(1, c3, d3) + snap('FULL3') + argument = [a.add(a.mul(c3, x), a.mul(feedback2, y)) + for x, y in zip(rows[2], scaled(a, coefficient2, response2))] + query(1, argument, 'response4') + snap('query4') + bridge(1, 0, 1) + for x, y in ((0, 1), (2, 3)): + rows[x], rows[y] = rows[y], [a.neg(entry) for entry in rows[x]] + plus(0, 2, a.one) + plus(3, 1, a.neg(a.one)) + snap('left') + targets = [a.mul(d1, qi), a.mul(d1, q), + a.mul(d3, d1, qi), a.mul(d3, d1, q)] + targets = [[target if i == j else {} for j in range(4)] + for i, target in enumerate(targets)] + return observed, targets, rows + + +def vector(row): + return {(source, word, powers): value + for source, entry in enumerate(row) + for (word, powers), value in entry.items() if value} + + +def axpy(x, scalar, y): + out = dict(x) + for key, value in y.items(): + out[key] = out.get(key, F(0)) + scalar * value + if not out[key]: + del out[key] + return out + + +class Span: + def __init__(self, a, controls): + self.a, self.controls = a, controls + self.basis, self.generators = {}, [] + + def clone(self): + out = Span(self.a, self.controls) + out.basis, out.generators = dict(self.basis), list(self.generators) + return out + + def add(self, label, row): + a, basis, generators = self.a, self.basis, self.generators + for word in self.controls: + op = a.term(word, (0, 0)) + value = vector([a.mul(op, entry) for entry in row]) + index = len(generators) + generators.append((label, word)) + recipe = {index: F(1)} + while value: + pivot = min(value) + if pivot not in basis: + factor = 1 / value[pivot] + basis[pivot] = ({key: v * factor for key, v in value.items()}, + {key: v * factor for key, v in recipe.items()}) + break + base, base_recipe = basis[pivot] + factor = value[pivot] + value = axpy(value, -factor, base) + recipe = axpy(recipe, -factor, base_recipe) + + def test(self, targets, certificate=False): + basis, generators = self.basis, self.generators + results = [] + for row in targets: + value, recipe = vector(row), {} + while value: + pivot = min(value) + if pivot not in basis: + break + base, base_recipe = basis[pivot] + factor = value[pivot] + value = axpy(value, -factor, base) + recipe = axpy(recipe, factor, base_recipe) + answer = {'attained': not value, + 'recipe': [{'observation': generators[i][0], + 'word': list(generators[i][1]), + 'coefficient': str(v)} + for i, v in sorted(recipe.items())] if not value else None, + 'residual_terms': len(value)} + if value and certificate: + functional = {min(value): F(1)} + for pivot, (base, _) in sorted(basis.items(), reverse=True): + v = -sum(coefficient * functional.get(key, 0) + for key, coefficient in base.items() if key != pivot) + if v: + functional[pivot] = v + else: + functional.pop(pivot, None) + need(all(sum(v * functional.get(key, 0) for key, v in base.items()) == 0 + for base, _ in basis.values()), 'Dual annihilates basis') + pairing = sum(v * functional.get(key, 0) for key, v in vector(row).items()) + need(pairing != 0, 'Dual separates failed target') + answer['dual'] = [[i, list(w), list(d), str(v)] + for (i, w, d), v in sorted(functional.items())] + answer['target_pairing'] = str(pairing) + results.append(answer) + return {'dimension': len(basis), 'results': results} + + +def span(a, observations, targets, controls): + out = Span(a, controls) + for label, row in observations: + out.add(label, row) + return out.test(targets) + + +def verify_answer(a, observations, target, controls, answer): + """Direct dot products/recipe replay, independent of elimination pivots.""" + if answer['attained']: + rows = dict(observations) + value = {} + for term in answer['recipe']: + op = a.term(term['word'], (0, 0), F(term['coefficient'])) + value = axpy(value, 1, vector([a.mul(op, entry) + for entry in rows[term['observation']]])) + need(value == vector(target), 'Positive recipe directly reproduces target') + else: + dual = {(i, tuple(w), tuple(d)): F(v) for i, w, d, v in answer['dual']} + for _, row in observations: + for word in controls: + op = a.term(word, (0, 0)) + value = vector([a.mul(op, entry) for entry in row]) + need(sum(v * dual.get(key, 0) for key, v in value.items()) == 0, + 'Dual directly annihilates every declared generator') + pairing = sum(v * dual.get(key, 0) for key, v in vector(target).items()) + need(pairing == F(answer['target_pairing']) != 0, + 'Dual directly separates target') + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--length', type=int, default=3) + parser.add_argument('--decoder-length', type=int, default=7) + parser.add_argument('--coefficients', default='1') + parser.add_argument('--certificates', action='store_true') + parser.add_argument('--output', type=Path) + args = parser.parse_args() + need(0 <= args.length <= 7 and 0 <= args.decoder_length <= 7, + 'Declared bounded word lengths are zero through seven') + a = algebra() + c1, c3, q = a.gen(2), a.gen(3), a.gen(1) + need(a.mul(c1, c1) == a.one and a.mul(c3, c3) == a.one, + 'Code involutions') + need(a.mul(q, q, q, q) == a.one, 'Actual Gaussian fourth power') + need(a.mul(c1, a.D(0), q) == a.mul(a.D(0), q, c1), + 'Own full-Gaussian commutator') + need(a.mul(c1, a.D(0)) != a.mul(a.D(0), c1), + 'Own partial-Gaussian noncommutation') + controls = words(args.decoder_length) + # The Q^2 factor is a physically free Pauli, required to turn Q^-1 + # response2 into Q response2 before the second transverse query. + controls += [reduce_word(w + (1, 1)) for w in words(args.decoder_length)] + controls = list(dict.fromkeys(controls)) + coefficients = [F(value) for value in args.coefficients.split(',')] + need(len(coefficients) == len(set(coefficients)) and all(coefficients), + 'Distinct nonzero feedback coefficients') + choices = [(None, F(0))] + [(word, coefficient) + for word in words(args.length) for coefficient in coefficients] + cases, best, histogram = [], 0, Counter() + for v1, coefficient1 in choices: + op1 = {} if v1 is None else a.term(v1, (0, 0)) + fixed, targets, _ = replay(a, op1, {}, coefficient1, 0) + third_index = next(i for i, (label, _) in enumerate(fixed) if label == 'response4') + before_third = fixed[:third_index] + base = Span(a, controls) + for label, row in before_third: + base.add(label, row) + for v2, coefficient2 in choices: + op2 = {} if v2 is None else a.term(v2 + (1, 1), (0, 0)) + observed, targets, _ = replay(a, op1, op2, coefficient1, coefficient2) + response4 = observed[third_index] + need(response4[0] == 'response4', 'Last paid response index') + bounded = before_third + [response4] + candidate = base.clone() + candidate.add(*response4) + result = candidate.test(targets, args.certificates) + if args.certificates: + for target, answer in zip(targets, result['results']): + verify_answer(a, bounded, target, controls, answer) + score = sum(entry['attained'] for entry in result['results']) + histogram[str(score)] += 1 + row = {'feedback1': v1, 'feedback2_before_Pauli': v2, + 'coefficient1': str(coefficient1), 'coefficient2': str(coefficient2), + 'attained': [entry['attained'] for entry in result['results']], + 'basis_dimension': result['dimension']} + if score > best: + best = score + print(json.dumps({'new_best': row}), flush=True) + if score >= 2 or args.certificates: + row['recipes'] = result['results'] + cases.append(row) + receipt = {'status': 'FINITE_FORMAL_FEEDBACK_SEARCH', + 'feedback_length': args.length, 'decoder_length': args.decoder_length, + 'decoder_controls': [list(word) for word in controls], + 'feedback1_source': 'saved_FULL1_Y', + 'feedback2_source': 'modified_response2', + 'feedback2_Pauli': 'Q^2 before the code word', + 'original_query_input_coefficients': ['1', '1'], + 'coefficients': [str(v) for v in coefficients], 'cases': cases, + 'attainment_histogram': dict(sorted(histogram.items())), + 'maximum_attained_jobs': best, + 'physical_emission': False, 'new_kappa': None} + if args.output: + args.output.write_text(json.dumps(receipt, indent=2, sort_keys=True) + '\n') + print(json.dumps({key: value for key, value in receipt.items() if key != 'cases'})) + + +if __name__ == '__main__': + main() diff --git a/research/coded-active-feedback/verify.py b/research/coded-active-feedback/verify.py new file mode 100644 index 0000000000..b7822d6045 --- /dev/null +++ b/research/coded-active-feedback/verify.py @@ -0,0 +1,161 @@ +#!/usr/bin/env python3 +"""Exact active coefficient, retained coupling, and bounded search replay. + +Cinna Davis, with substantial OpenAI Codex assistance. Apache-2.0. +""" +import argparse +import gzip +from hashlib import sha256 +import itertools +import json +import math +from pathlib import Path +import subprocess +import sys +import tempfile +import types + +sys.dont_write_bytecode = True +HERE = Path(__file__).resolve().parent +ROOT = HERE.parent.parent +m = types.ModuleType('active_feedback_search') +m.__file__ = str(HERE / 'search.py') +exec(compile((HERE / 'search.py').read_bytes(), m.__file__, 'exec'), m.__dict__) + + +def canonical(value): + return json.dumps(value, separators=(',', ':'), sort_keys=True).encode() + + +def serialized(row): + return [[[list(w), list(d), str(v)] for (w, d), v in sorted(entry.items())] + for entry in row] + + +def rejected(action): + try: + action() + except ValueError: + return + raise ValueError('Corrupt certificate accepted') + + +def run_search(directory, full=False): + out = Path(directory) / ('full.json' if full else 'pilot.json') + flags = ['-O'] if sys.flags.optimize else [] + command = [sys.executable, '-I', *flags, '-B', str(HERE / 'search.py'), + '--length', '7' if full else '1', + '--decoder-length', '7' if full else '3', + '--coefficients=-2,-1,-1/2,1/2,1,2' if full else '--coefficients=-1,1', + '--output', str(out)] + if not full: + command.append('--certificates') + subprocess.run(command, capture_output=True, text=True, check=True, timeout=540) + return json.loads(out.read_text()) + + +def run(full=False): + sources = json.loads((HERE / 'SOURCES.json').read_text()) + inputs = [entry for entry in sources['files'] if entry['usage'] == 'input'] + m.need(len(inputs) == 4, 'Four source inputs') + for entry in inputs: + m.need(sha256((ROOT / entry['path']).read_bytes()).hexdigest() == entry['sha256'], + 'Changed inherited source: ' + entry['path']) + a = m.algebra() + q, c, e = a.gen(1), a.gen(2), a.gen(3) + qi, d, f = a.inv(q), a.D(0), a.D(1) + m.need(a.mul(q, q, q, q) == a.one and a.mul(q, q) != a.one, 'Q has order four') + m.need(a.mul(c, c) == a.one and a.mul(e, e) == a.one, 'Source involutions') + m.need(a.mul(c, d, q) == a.mul(d, q, c), 'Own DQ commutation') + m.need(a.mul(c, f) == a.mul(f, c), 'Other-stage D commutation') + m.need(a.mul(c, d) != a.mul(d, c) and a.mul(c, q) != a.mul(q, c), + 'Forbidden commutations remain absent') + fixtures = 0 + for n in range(5): + for word in itertools.product((-3, -2, -1, 1, 2, 3), repeat=n): + reduced = m.reduce_word(word) + m.need(m.reduce_word(reduced) == reduced, 'Reduction idempotence') + for k in range(n + 1): + m.need(m.reduce_word(m.reduce_word(word[:k]) + m.reduce_word(word[k:])) == reduced, + 'Concatenation normal form') + fixtures += 1 + observed, targets, _ = m.replay(a, a.one, a.mul(c, q, q)) + row = dict(observed)['query4:3'] + coupling = a.mul(qi, c, q, a.add(a.one, a.neg(q)), d) + expected = [a.mul(d, qi), coupling, + a.add(a.mul(a.add(a.mul(qi, c, q, c), a.neg(qi)), d), + a.mul(qi, e, d, f)), {}] + m.need(row == expected, 'All four original-input coefficients') + m.need(row[0] == targets[0][0] and coupling and row != targets[0], + 'Recovered coefficient is not an autonomous output') + for first, second in (({}, {}), (a.one, c), (a.one, a.mul(e, q, q))): + variant, _, _ = m.replay(a, first, second) + m.need(dict(variant)['query4:3'][0] != targets[0][0], + 'Unchanged input / omitted Pauli / wrong stage code must fail') + _, plain_targets, plain_rows = m.replay(a, {}, {}, codes=False) + m.need(plain_rows == plain_targets, 'Full uncoded four-job positive control') + residues = [1, 0, 0, 0] + coupling_ranks = [] + for width in range(1, 65): + residues = [residues[k] + residues[(k - 1) % 4] for k in range(4)] + b0 = sum(math.comb(width, k) for k in range(0, width + 1, 4)) + m.need(b0 == residues[0], 'Independent central eigenvalue count') + if width <= 12: + m.need(sum(x.bit_count() % 4 == 0 for x in range(1 << width)) == b0, + 'Direct central frequency enumeration') + rank = 112 * (1 << (16 * width)) * ((1 << width) - b0) + m.need(rank > 0, 'Coupling at every checked positive width') + coupling_ranks.append({'width': width, 'central_eigenvalue_one': b0, + 'complex_rank': str(rank)}) + retained = json.loads(gzip.decompress((HERE / 'SEARCH.json.gz').read_bytes())) + choices = [(None, '0')] + [(list(w), z) for w in m.words(7) + for z in ('-2', '-1', '-1/2', '1/2', '1', '2')] + policies = {(json.dumps(w1), z1, json.dumps(w2), z2) + for (w1, z1), (w2, z2) in itertools.product(choices, repeat=2)} + actual = {(json.dumps(x['feedback1']), x['coefficient1'], + json.dumps(x['feedback2_before_Pauli']), x['coefficient2']) + for x in retained['cases']} + m.need(len(actual) == len(retained['cases']) == 8281 and actual == policies, + 'Exact full search policy domain') + m.need(all(x['attained'] == [False, True, False, False] for x in retained['cases']) + and retained['attainment_histogram'] == {'1': 8281}, 'Retained search outcome') + with tempfile.TemporaryDirectory(prefix='active-feedback-') as tmp: + pilot = run_search(tmp) + m.need(len(pilot['cases']) == 49 and pilot['attainment_histogram'] == {'1': 49}, + 'Forty-nine exact certified pilot policies') + baseline = pilot['cases'][0]['recipes'] + obs, t, _ = m.replay(a, {}, {}) + controls = [tuple(w) for w in pilot['decoder_controls']] + rejected(lambda: m.verify_answer(a, obs, t[0], controls, + dict(baseline[0], target_pairing='0'))) + rejected(lambda: m.verify_answer(a, obs, t[1], controls, + dict(baseline[1], recipe=[]))) + if full: + m.need(run_search(tmp, full=True) == retained, 'Every full-search policy and rank') + print('PASS_FULL_ACTIVE_FEEDBACK_SEARCH 8281 policies') + return {'status': 'PASS_ACTIVE_FEEDBACK_COMPONENT_AND_CERTIFIED_PILOT', + 'normal_form_fixtures': fixtures, 'complete_active_output_row': serialized(row), + 'coupling_ranks': coupling_ranks, + 'pilot_policies': 49, 'direct_span_certificates': 196, + 'pilot_canonical_sha256': sha256(canonical(pilot)).hexdigest(), + 'full_search_policies': 8281, + 'full_search_canonical_sha256': sha256(canonical(retained)).hexdigest(), + 'autonomous_Gaussian_job': False, 'physical_impossibility_claim': False, + 'new_kappa': None} + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--write', action='store_true') + parser.add_argument('--full-search', action='store_true') + args = parser.parse_args() + result = run(args.full_search) + if args.write: + (HERE / 'RESULT.json').write_text(json.dumps(result, indent=2, sort_keys=True) + '\n') + else: + m.need(json.loads((HERE / 'RESULT.json').read_text()) == result, 'Changed result receipt') + print(result['status']) + + +if __name__ == '__main__': + main()