From 5ce521090c869211f808d132e28dcd4946f798c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20W=C3=B3jt?= <97155365+krzysztofwojt@users.noreply.github.com> Date: Sat, 17 Oct 2026 23:14:21 +0200 Subject: [PATCH] Research: complete the paid high-cube traffic composition --- research/high-cube-paid-composition/PROOF.md | 215 ++ research/high-cube-paid-composition/README.md | 92 + .../high-cube-paid-composition/RESULT.json | 2194 +++++++++++++++++ .../high-cube-paid-composition/SOURCES.json | 198 ++ research/high-cube-paid-composition/TASK.json | 116 + .../high-cube-paid-composition/VERIFY.json | 59 + research/high-cube-paid-composition/bounds.py | 144 ++ .../sources/high-add-scratch-invoice-PROOF.md | 311 +++ .../sources/high-route-setup-invoice-PROOF.md | 258 ++ research/high-cube-paid-composition/verify.py | 444 ++++ 10 files changed, 4031 insertions(+) create mode 100644 research/high-cube-paid-composition/PROOF.md create mode 100644 research/high-cube-paid-composition/README.md create mode 100644 research/high-cube-paid-composition/RESULT.json create mode 100644 research/high-cube-paid-composition/SOURCES.json create mode 100644 research/high-cube-paid-composition/TASK.json create mode 100644 research/high-cube-paid-composition/VERIFY.json create mode 100644 research/high-cube-paid-composition/bounds.py create mode 100644 research/high-cube-paid-composition/sources/high-add-scratch-invoice-PROOF.md create mode 100644 research/high-cube-paid-composition/sources/high-route-setup-invoice-PROOF.md create mode 100644 research/high-cube-paid-composition/verify.py diff --git a/research/high-cube-paid-composition/PROOF.md b/research/high-cube-paid-composition/PROOF.md new file mode 100644 index 0000000000..b998f1f80e --- /dev/null +++ b/research/high-cube-paid-composition/PROOF.md @@ -0,0 +1,215 @@ +# Complete paid high-cube composition + +This source-level composition for unchanged PR2915 closes the remaining +unit-translation and whole-swap-adapter terms in the PR2982/3265 handoff. +The predecessor inequalities below are pinned dependencies, not new results +or scientific admissions inferred from archival intake. + +## Contract and currency + +Let d>=1, N=d², Q=q^u with odd q>=3 and u>=0, F>=1 canonical, and +V=Q^N F. Use the actual compiled sequence with valid, distinct binary +indices. The active sequence has s factors for Q>1 and is empty for Q=1. +Let a,h,g,c count ADD, doubling/halving, negation and translation factors; +r counts ADDs whose control field exceeds their target, and t counts swap +factors plus 2r. Every binary call sees [B][Q][M][Q][S] of volume V. + +All borrowed heads, complete payload extents and Count encodings are +canonical. Retain the actual outer numerical width I and high-bank role +count K. The high bank enters erased and empty. Numerical and scratch +capacity suffice. Other occupied scratch roles may contain arbitrary data; +their ownership, bytes and heads must survive. This does not allow dirty +residents in the high numerical bank. Only successful execution is claimed. + +Every native B1 call preserves its complete borrowed source and spectators, +restores their heads, and returns a distinct dense V-bit owned output at +its origin. Its owned work is restored before reuse. These are inherited +all-width premises, not consequences of elementary-branch fixtures. + +Count one physical Tape read, write or unit move once. Word/Lease aliases +do not add a second charge. Include all work reached between cube entry +and successful return, including probes, numerical scans, copy-out and +internal disposal. Initial context/pool provisioning, Python/finite-control +selection, compilation and final returned-output disposal remain separate. +Write A_j for each entire actual `native.run` interval, including its own +setup and cleanup. A_j is never set to zero. + +## Credited same-source ingredients + +* Arham Tahir's PR2877 gives plain canonical sign T<2048BQS and the + countdown identity below. The verifier checks byte equality of its + retained linear_sign.py with the implementation actually loaded through + PR2915's archive chain. +* Nick Petalas's PR2951/2968 gives pooled doubling/halving T<530V. +* commdata2338's PR3233 gives complete pooled ordered ADD T<4096V, + including arithmetic, marginal counts and acquisition probes. +* Sagar Thakrar's PR3265 gives exact setup/disposal and the bound + `27I+10K+[373+s(3B_N+36)]V`, with `B_N=716+933J`, + `J=2 bit_length(N)`. This excludes whole kernels and whole swap adapters. + It already charges the three intermediate clearances of a reversed ADD. +* Nick Petalas's PR2982 bounds the complete-prefix wrapper by 265 times + packet volume, or 277 including final output disposal. + +The reached high Ring has b=bit_length(Q)+1. The two pending proof pins are +PR3233 `803f3593e8f00ed8591d5ff6fc69ce2a036a3293` and PR3265 +`ac651ec18e62edf0baf3846cc4bf0a11d335c2b4`. SOURCES.json records their source +paths, Git blob IDs and SHA-256 hashes under `external_proofs`. Exact copies +in `sources/` avoid requiring unmerged Git objects in a clean checkout; +the verifier authenticates their bytes by SHA-256. The source-commit +attribution was checked during preparation, not inferred from that hash. +The PR3265 equations reproduced in bounds.py +calibrate the composition; that previously solved component is not claimed +as new. + +## Counter and numerical bounds + +A fully drained positive Counter of value x in e digits costs, before pooling, + + D(x,e)=15x+14e-5popcount(x)+36. + +Zero costs 14e+40. Each pooled Counter adds one acquisition read. For the +separately marginal encoding e=bit_length(x)+1, `D(x,e)+1<=80x`. +Normalization occurs at construction: the encoded width is not charged +again on every decrement. + +For b>=3, the literal Word/PhysicalArena loops bound zero, copy, a fitting +literal, compare, add/subtract, shift-add, zero test and free by 100(b+1) +each. For example zero is 9b+12, copy <=27b+1, add/subtract <=35b+2. +Unsigned.divmod has b iterations of at most a shift-add, comparison, +subtraction and two frees plus linear setup/teardown: <=1000(b+1)². +These deliberately loose bounds include initialization/erasure scans and +also follow from PR3233's tighter table; they are not fitted timing ratios. + +Making and closing one marginal copy of a canonical positive x costs +<=100(bit_length(x)+1), by its copy/normalize/msb/append/clear scans, +including the probe. The source calls `x.marginal()` directly, not two +successive copies. Using the looser allowance 200 gives, for a pair B,S, + + marginal pair <=200(bit_length(B)+bit_length(S)+2) + <=800BS <=(800/3)BQS. (1) + +## Pooled sign and the missing translation tariff + +The exact successful sign acquisition count is + + 2+B(4Q-5)+[S>1]BQ <=5BQ <=5V. + +There is one output and one outer Counter. Each row makes two move_slices +block counters and one remaining Counter, 4(Q-2) suffix movement Counters, +and Q copy_bits Counters exactly when S>1. Installing the pool changes no +tape loop; each acquisition adds one read. PhysicalWord forwards each +credited logical operation to one physical operation. The pooled sign is +therefore <2053V; with (1), kernels.negated is <4096V. + +For translate_one, put P=D(Q-1,b)+D(1,b)+2 and +E=[S>1](D(S,bit_length(S)+1)+1). Its complete physical toll is at most + + 200(b+1)+3 +2(D(B,bit_length(B)+1)+1) + +2B(P+30+5QS+QE) +13V+29. (2) + +The first term prices subtract_exact(Q,1) and free; three probes acquire +left/right/output. Two outer countdowns cover split and merge. Each row +per traversal calls copy_blocks twice: P prices their countdowns, 30 their +suffix probes, 5QS the opaque copies, and QE the nontrivial suffix counters. +The last term includes source/bucket rewinds, consumption probes, the two +bucket clearances starting at their consumed ends, and the output rewind. + +Since b<=Q, P<=80Q, 30<=10Q, E<=80S, and b+1<=4Q/3, (2) is at most + + (350+160/3+800/3+13+32/3)V <1024V. + +Both S=1 and S>1 are covered. The replay checks (2) at each actually +reached translation, separately from the enclosing kernel. + +A positive carry k<=4 makes k unit translations. A negative carry makes +2k pooled signs and k unit translations. At most 3k-1<=11 intermediate +outputs are cleared inside the kernel, each at 5V+7<=12V. One marginal +pair serves the whole kernel. Hence kernels.translated costs less than + + [8*2053+4*1024+11*12+800/3]V <32768V. + +This includes all intermediate work for the compiler's nonzero carries +between -4 and +4. + +## Whole swap adapter with a paid native interval + +Adapter.swap creates width zero and three canonical extent copies, derives +u by radix_power, calls B1, copies its returned output to a fresh outer +lease, clears the native output, and closes all four counts. B1 costs A_j. + +There are u<=bit_length(Q)=3, + + (bit_length(Q)+2)³ <=8Q². (3) + +Check Q=3 directly. For bit length k>=3 use Q>=2^(k-1), base +5³<=8*4², and induction: increasing k multiplies (k+2)³ by less than four +and 2^(2k) by four. Thus radix plus width costs <=17600Q²<=17600V. + +For P=BMS, the three extent lengths plus three unit allowances total <=6P. +At 100 per digit for each copy and close, their cost is <=1200P<400V, +because V=PQ² and Q²>=9. Acquisition, output copying/rewinding and native +output disposal scan exactly V symbols. Even 2000(V+1)<=2223V covers these +paths. Suspend/re-enable installation performs no physical tape work; +the ready marker belongs to the stated outer entry contract. + +Therefore the whole adapter, conservatively, costs + + A_j+100000V. (4) + +Its exact complete-output and ownership premises are necessary. An opaque +routine returning a larger tape does not satisfy (4) merely by sharing B1's +exponent. The native all-width tariff is not proved here. + +## Complete cube and linear prefix lift + +The direct kernels are disjoint intervals. A reversed ADD contains two +whole adapters and one ordered ADD; PR3265 already charges its three +clearances. Combining the preceding bounds gives + + T_cube <= sum_j A_j +27I+10K + +[373+s(3B_N+36)+4096a+530h+4096g+32768c+100000t]V. (5) + +For Q=1, all factor/native counts vanish; the credited copy/setup bound +still applies. Final returned-cube disposal adds 5V+7<=12V, outside (5). +For C old prefixes, sum (5) once over actual cubes and add PR2982's 265CV +wrapper (277CV with output disposal). There is no second factor C on a +complete-packet charge. Distinct per-cube I,K or words can instead be +retained and summed explicitly. + +If actual fitted B1 calls additionally satisfy their inherited same-domain +tariff A_j<=C_B V u^p, then (5)'s native term is t C_B V u^p. For fixed +q,d,K and compiled word, the source relation +I=bit_length(q^(u+1))+1<=bit_length(Q)+bit_length(q)+1 absorbs I into the +linear term. This establishes the conditional local +O_q,d,K,word(V(1+u^p)) bound and its linear prefix lift. It does not prove +the native premise, enclosing recursion, stock, supplier admission or kappa. + +## Evidence and limits + +The source argument supplies the all-parameter implication. The replay +checks 14 complete reduced packets (9,654 Boolean coordinates), all six +kinds, nonidentity low rows with carries -4 and +3, both ADD orientations, +Q=1/3/5/9, fibres 1/3, repeated prefixes, occupied dirty scratch roles and +48 actual elementary B1 calls. Exact paid partitions agree with raw meters +and the separate observer. Six additional radix scans reach 268-bit words +without exponential payloads; these are not field/admission tests. + +Controls reject a wrong coefficient, missing native charges, a one-swap +reversed-ADD invoice, corrupted source hashes and changed receipt types. +A real extra adapter read preserves the endpoint and legitimately passes +the loose bound, but changes the exact receipt and is detected there. +All gates also run with assertions disabled. + +No fitted or GL64 payload, full selected cold replay, formal theorem, +interrupted-call recovery, total physical backing, finite-control cost, +root stock or inherited C0/native admission is established. The selected +record is unchanged. + +Krzysztof Wójt with substantial OpenAI Codex assistance. Luna supplied +read-only inventories and separate bounded source counts, checked and +integrated by the primary agent. This is author-checked automated evidence, +not independent human/formal review. Credit Jose Manuel/jmbarrancoml, +David Arias, Nick Petalas, commdata2338, Sagar Thakrar, Arham Tahir, ywz65, +Ross Richardson and the retained PR2157/PR589/source lineage. Apache-2.0. diff --git a/research/high-cube-paid-composition/README.md b/research/high-cube-paid-composition/README.md new file mode 100644 index 0000000000..32fc7d7237 --- /dev/null +++ b/research/high-cube-paid-composition/README.md @@ -0,0 +1,92 @@ +# Complete paid high-cube composition + +This closes the local traffic composition handed off by +[PR3265](https://github.com/CrocSwap/integer-mult-bounds/pull/3265), after +[PR3233](https://github.com/CrocSwap/integer-mult-bounds/pull/3233) and +[PR2982](https://github.com/CrocSwap/integer-mult-bounds/pull/2982). Those +packages price setup, ordered ADD and the outer wrapper. This supplies the +missing pooled unit-translation and whole-swap-adapter bounds, transfers +the sign bound to its actual pooled caller, and composes all six kinds +without dropping native B1 work. + +For one complete cube of V bits, let a,h,g,c count ADD, doubling/halving, +negation and translation factors; s counts all factors; t counts swaps +plus twice the reversed ADDs. With outer numerical width I, high-bank role +count K, N=d², and B_N=716+1866 bit_length(N), + +```text +T_cube <= sum of complete actual native B1 tolls + 27I + 10K + + [373+s(3B_N+36)+4096a+530h+4096g+32768c+100000t] V. +``` + +The constants are conservative. The 100000V adapter allowance excludes its +still-paid native interval. If the inherited same-domain B1 tariff holds, +this gives the expected local O(V(1+u^p)) bound and PR2982's linear prefix +lift. [PROOF.md](PROOF.md) states the source derivation and native premises. +This is a conditional local composition, not native or supplier admission. + +## Evidence and reproduction + +From the repository root with standard-library Python 3.12: + +```sh +python3.12 -B scripts/research_package.py --package research/high-cube-paid-composition +``` + +The manifest runs normal and optimized checks. [RESULT.json](RESULT.json) +covers 14 complete reduced packets, 9,654 Boolean coordinates and 48 actual +elementary native calls: all six kinds, both ADD orientations, extreme +carries, nonidentity low rows, complete spectators, multiple prefixes and +occupied dirty scratch roles. Exact partitions agree with a separate +observer and raw physical meters; matrix endpoints, borrowed bytes/heads, +owned output and cleanup are checked. Six radix scans reach 268-bit words +without allocating exponential payloads. + +After a checked export with `scripts/export_research_package.py`, the +Git-free direct command is `python3.12 -I -B +research/high-cube-paid-composition/verify.py` from the extracted root. + +Six controls cover an extra adapter read, a wrong coefficient, omitted +native charges, one-swap reversed-ADD accounting, source corruption and +receipt types. The loose tariff can tolerate an extra read; its exact +recorded trace detects that mutation. + +The finite checks do not execute fitted B1 or selected GL64 payloads. +All-width validity rests on the written argument and pinned component +premises. Full machine-step cost, backing, recursive stock, interrupted-call +recovery and admission remain open. No selected cold replay or new kappa. + +## Sources and credit + +Base main: `463113d675af7410ac91d53a4fed51ec6494eb9a`, priority revision 6. +[SOURCES.json](SOURCES.json) pins the activated runtime closure and records +exact, hash-checked copies of the two pending proof dependencies in +`sources/`; no unmerged Git objects are needed for replay. The checker +reuses PR2982's observer and extends its +matrix oracle to nonidentity low rows. Frozen sources remain unchanged. + +This is a declared change from the generic stock card to its released local +traffic handoff; no stage coefficient is inferred. The entry overlap scan +covered 336 open PRs, 2,630 closed PRs and 2,129 Discussion records with +complete pagination. Sparse local notes, arbitrary diffs and unpublished +work are outside coverage. See [TASK.json](TASK.json) and the +[canonical claim](https://github.com/CrocSwap/integer-mult-bounds/discussions/2319#discussioncomment-19004103). + +Credit Jose Manuel/jmbarrancoml (PR2915/2899/2809), David Arias (PR2753), +Nick Petalas (PR2951/2968/2982), commdata2338 (PR3233), Sagar Thakrar +(PR3265), Arham Tahir (PR2877), ywz65, Ross Richardson and the retained +PR2157/PR589/source lineage. Their component bounds and algorithms are reused. + +Krzysztof Wójt with substantial OpenAI Codex assistance, including Luna +support for read-only inventories and bounded source counts. Author-checked +automated work, not independent human/formal review. Apache-2.0. + +## Open next questions + +1. Discharge the fitted B1 contract at a real reached call, including + complete spectators, borrowed state, output ownership and uniform cost. + Start at pinned PR2899 and its C0 premises; elementary fixtures cannot + resolve those dependencies. +2. Join this tape bill to actual backing lifetimes and finite-control + transitions in the enclosing caller before assigning a stock coefficient. + A new local constant or cutoff comparison does not resolve that obligation. diff --git a/research/high-cube-paid-composition/RESULT.json b/research/high-cube-paid-composition/RESULT.json new file mode 100644 index 0000000000..9c0bd9e3d8 --- /dev/null +++ b/research/high-cube-paid-composition/RESULT.json @@ -0,0 +1,2194 @@ +{ + "bits": 9654, + "cases": 14, + "controls": [ + "endpoint_preserving_adapter_traffic", + "wrong_coefficient_full_payload", + "omitted_native_charge", + "reversed_swap_multiplicity", + "source_corruption_before_load", + "receipt_numeric_type" + ], + "native_calls": 48, + "radix_checks": [ + { + "exponent": 1, + "radix": "3", + "traffic": 1184, + "word_bits": 3 + }, + { + "exponent": 8, + "radix": "3", + "traffic": 78644, + "word_bits": 14 + }, + { + "exponent": 32, + "radix": "3", + "traffic": 3622151, + "word_bits": 52 + }, + { + "exponent": 7, + "radix": "5", + "traffic": 106577, + "word_bits": 18 + }, + { + "exponent": 8, + "radix": "97", + "traffic": 939489, + "word_bits": 54 + }, + { + "exponent": 3, + "radix": "618970019642690137449562111", + "traffic": 8316366, + "word_bits": 268 + } + ], + "rows": [ + { + "adapters": [], + "bits": 3, + "compiled": [], + "counts": { + "add": 0, + "native_calls": 0, + "negate": 0, + "reversed_add": 0, + "scale": 0, + "swap": 0, + "translate": 0 + }, + "kernels": [], + "native": 0, + "nonnative": 864, + "nonnative_bound": 2635, + "parameters": { + "fibre": 3, + "name": "empty", + "width": 1 + }, + "setup": 343, + "shifts": [], + "signs": [], + "total": 864, + "wrapper": 521 + }, + { + "adapters": [], + "bits": 625, + "compiled": [], + "counts": { + "add": 0, + "native_calls": 0, + "negate": 0, + "reversed_add": 0, + "scale": 0, + "swap": 0, + "translate": 0 + }, + "kernels": [], + "native": 0, + "nonnative": 75517, + "nonnative_bound": 399552, + "parameters": { + "name": "empty", + "q": 5 + }, + "setup": 23872, + "shifts": [], + "signs": [], + "total": 75517, + "wrapper": 51645 + }, + { + "adapters": [], + "bits": 81, + "compiled": [ + [ + "add", + 1, + 0, + 1 + ], + [ + "add", + 3, + 2, + 1 + ] + ], + "counts": { + "add": 2, + "native_calls": 0, + "negate": 0, + "reversed_add": 0, + "scale": 0, + "swap": 0, + "translate": 0 + }, + "kernels": [ + { + "kind": "added", + "traffic": 12050 + }, + { + "kind": "added", + "traffic": 38700 + } + ], + "native": 0, + "nonnative": 66674, + "nonnative_bound": 3790441, + "parameters": { + "name": "ordered" + }, + "setup": 8951, + "shifts": [], + "signs": [], + "total": 66674, + "wrapper": 6973 + }, + { + "adapters": [ + { + "native": 25318, + "overhead": 2725, + "traffic": 28043 + }, + { + "native": 25318, + "overhead": 2725, + "traffic": 28043 + }, + { + "native": 26310, + "overhead": 2725, + "traffic": 29035 + }, + { + "native": 26310, + "overhead": 2725, + "traffic": 29035 + } + ], + "bits": 81, + "compiled": [ + [ + "add", + 0, + 1, + -4 + ], + [ + "add", + 2, + 3, + -4 + ], + [ + "translate", + 2, + -2 + ] + ], + "counts": { + "add": 2, + "native_calls": 4, + "negate": 0, + "reversed_add": 2, + "scale": 0, + "swap": 0, + "translate": 1 + }, + "kernels": [ + { + "kind": "added", + "traffic": 14770 + }, + { + "kind": "added", + "traffic": 55708 + }, + { + "kind": "translated", + "traffic": 73304 + } + ], + "native": 103256, + "nonnative": 174911, + "nonnative_bound": 40381867, + "parameters": { + "name": "reversed" + }, + "setup": 13256, + "shifts": [ + { + "before": 9, + "majorant": 13329, + "modulus": 3, + "suffix": 3, + "traffic": 12539 + }, + { + "before": 9, + "majorant": 13329, + "modulus": 3, + "suffix": 3, + "traffic": 12539 + } + ], + "signs": [ + { + "acquisitions": 92, + "before": 9, + "modulus": 3, + "suffix": 3, + "traffic": 11481 + }, + { + "acquisitions": 92, + "before": 9, + "modulus": 3, + "suffix": 3, + "traffic": 11481 + }, + { + "acquisitions": 92, + "before": 9, + "modulus": 3, + "suffix": 3, + "traffic": 11481 + }, + { + "acquisitions": 92, + "before": 9, + "modulus": 3, + "suffix": 3, + "traffic": 11481 + } + ], + "total": 278167, + "wrapper": 6973 + }, + { + "adapters": [ + { + "native": 35750, + "overhead": 5174, + "traffic": 40924 + }, + { + "native": 48064, + "overhead": 5174, + "traffic": 53238 + } + ], + "bits": 243, + "compiled": [ + [ + "swap", + 0, + 1 + ], + [ + "swap", + 2, + 3 + ] + ], + "counts": { + "add": 0, + "native_calls": 2, + "negate": 0, + "reversed_add": 0, + "scale": 0, + "swap": 2, + "translate": 0 + }, + "kernels": [], + "native": 83814, + "nonnative": 58584, + "nonnative_bound": 57979117, + "parameters": { + "fibre": 3, + "name": "swap" + }, + "setup": 20527, + "shifts": [], + "signs": [], + "total": 142398, + "wrapper": 27709 + }, + { + "adapters": [], + "bits": 81, + "compiled": [ + [ + "double", + 0 + ], + [ + "double", + 2 + ] + ], + "counts": { + "add": 0, + "native_calls": 0, + "negate": 0, + "reversed_add": 0, + "scale": 2, + "swap": 0, + "translate": 0 + }, + "kernels": [ + { + "kind": "doubled", + "traffic": 5474 + }, + { + "kind": "doubled", + "traffic": 10508 + } + ], + "native": 0, + "nonnative": 32708, + "nonnative_bound": 3212749, + "parameters": { + "name": "scale" + }, + "setup": 9753, + "shifts": [], + "signs": [], + "total": 32708, + "wrapper": 6973 + }, + { + "adapters": [], + "bits": 81, + "compiled": [ + [ + "half", + 1 + ], + [ + "translate", + 3, + -1 + ], + [ + "half", + 3 + ] + ], + "counts": { + "add": 0, + "native_calls": 0, + "negate": 0, + "reversed_add": 0, + "scale": 2, + "swap": 0, + "translate": 1 + }, + "kernels": [ + { + "kind": "doubled", + "traffic": 7146 + }, + { + "kind": "translated", + "traffic": 53413 + }, + { + "kind": "doubled", + "traffic": 10768 + } + ], + "native": 0, + "nonnative": 90650, + "nonnative_bound": 7404175, + "parameters": { + "name": "half" + }, + "setup": 12350, + "shifts": [ + { + "before": 27, + "majorant": 15749, + "modulus": 3, + "suffix": 1, + "traffic": 15067 + } + ], + "signs": [ + { + "acquisitions": 191, + "before": 27, + "modulus": 3, + "suffix": 1, + "traffic": 18640 + }, + { + "acquisitions": 191, + "before": 27, + "modulus": 3, + "suffix": 1, + "traffic": 18640 + } + ], + "total": 90650, + "wrapper": 6973 + }, + { + "adapters": [], + "bits": 625, + "compiled": [ + [ + "double", + 0 + ], + [ + "double", + 0 + ], + [ + "negate", + 0 + ], + [ + "translate", + 0, + -4 + ], + [ + "double", + 2 + ], + [ + "double", + 2 + ], + [ + "negate", + 2 + ], + [ + "translate", + 2, + -1 + ] + ], + "counts": { + "add": 0, + "native_calls": 0, + "negate": 2, + "reversed_add": 0, + "scale": 4, + "swap": 0, + "translate": 2 + }, + "kernels": [ + { + "kind": "doubled", + "traffic": 35015 + }, + { + "kind": "doubled", + "traffic": 35015 + }, + { + "kind": "negated", + "traffic": 42309 + }, + { + "kind": "translated", + "traffic": 511724 + }, + { + "kind": "doubled", + "traffic": 62347 + }, + { + "kind": "doubled", + "traffic": 62347 + }, + { + "kind": "negated", + "traffic": 87463 + }, + { + "kind": "translated", + "traffic": 249966 + } + ], + "native": 0, + "nonnative": 1210639, + "nonnative_bound": 142694552, + "parameters": { + "low": [ + [ + 4, + 1 + ], + [ + 1, + 1 + ] + ], + "name": "negative_carry", + "q": 5 + }, + "setup": 72808, + "shifts": [ + { + "before": 1, + "majorant": 36059, + "modulus": 5, + "suffix": 125, + "traffic": 35204 + }, + { + "before": 1, + "majorant": 36059, + "modulus": 5, + "suffix": 125, + "traffic": 35204 + }, + { + "before": 1, + "majorant": 36059, + "modulus": 5, + "suffix": 125, + "traffic": 35204 + }, + { + "before": 1, + "majorant": 36059, + "modulus": 5, + "suffix": 125, + "traffic": 35204 + }, + { + "before": 25, + "majorant": 69919, + "modulus": 5, + "suffix": 5, + "traffic": 69064 + } + ], + "signs": [ + { + "acquisitions": 22, + "before": 1, + "modulus": 5, + "suffix": 125, + "traffic": 42021 + }, + { + "acquisitions": 22, + "before": 1, + "modulus": 5, + "suffix": 125, + "traffic": 42021 + }, + { + "acquisitions": 22, + "before": 1, + "modulus": 5, + "suffix": 125, + "traffic": 42021 + }, + { + "acquisitions": 22, + "before": 1, + "modulus": 5, + "suffix": 125, + "traffic": 42021 + }, + { + "acquisitions": 22, + "before": 1, + "modulus": 5, + "suffix": 125, + "traffic": 42021 + }, + { + "acquisitions": 22, + "before": 1, + "modulus": 5, + "suffix": 125, + "traffic": 42021 + }, + { + "acquisitions": 22, + "before": 1, + "modulus": 5, + "suffix": 125, + "traffic": 42021 + }, + { + "acquisitions": 22, + "before": 1, + "modulus": 5, + "suffix": 125, + "traffic": 42021 + }, + { + "acquisitions": 22, + "before": 1, + "modulus": 5, + "suffix": 125, + "traffic": 42021 + }, + { + "acquisitions": 502, + "before": 25, + "modulus": 5, + "suffix": 5, + "traffic": 87175 + }, + { + "acquisitions": 502, + "before": 25, + "modulus": 5, + "suffix": 5, + "traffic": 87175 + }, + { + "acquisitions": 502, + "before": 25, + "modulus": 5, + "suffix": 5, + "traffic": 87175 + } + ], + "total": 1210639, + "wrapper": 51645 + }, + { + "adapters": [], + "bits": 625, + "compiled": [ + [ + "double", + 0 + ], + [ + "double", + 0 + ], + [ + "translate", + 0, + 3 + ], + [ + "double", + 2 + ], + [ + "double", + 2 + ] + ], + "counts": { + "add": 0, + "native_calls": 0, + "negate": 0, + "reversed_add": 0, + "scale": 4, + "swap": 0, + "translate": 1 + }, + "kernels": [ + { + "kind": "doubled", + "traffic": 35015 + }, + { + "kind": "doubled", + "traffic": 35015 + }, + { + "kind": "translated", + "traffic": 112164 + }, + { + "kind": "doubled", + "traffic": 62347 + }, + { + "kind": "doubled", + "traffic": 62347 + } + ], + "native": 0, + "nonnative": 413250, + "nonnative_bound": 81510802, + "parameters": { + "low": [ + [ + 4, + 1 + ], + [ + 1, + 1 + ] + ], + "name": "positive_carry", + "q": 5 + }, + "setup": 54717, + "shifts": [ + { + "before": 1, + "majorant": 36059, + "modulus": 5, + "suffix": 125, + "traffic": 35204 + }, + { + "before": 1, + "majorant": 36059, + "modulus": 5, + "suffix": 125, + "traffic": 35204 + }, + { + "before": 1, + "majorant": 36059, + "modulus": 5, + "suffix": 125, + "traffic": 35204 + } + ], + "signs": [], + "total": 413250, + "wrapper": 51645 + }, + { + "adapters": [ + { + "native": 35750, + "overhead": 5174, + "traffic": 40924 + }, + { + "native": 35750, + "overhead": 5174, + "traffic": 40924 + }, + { + "native": 48064, + "overhead": 5174, + "traffic": 53238 + }, + { + "native": 48064, + "overhead": 5174, + "traffic": 53238 + }, + { + "native": 35750, + "overhead": 5174, + "traffic": 40924 + }, + { + "native": 48064, + "overhead": 5174, + "traffic": 53238 + } + ], + "bits": 243, + "compiled": [ + [ + "double", + 0 + ], + [ + "add", + 0, + 1, + 1 + ], + [ + "half", + 0 + ], + [ + "double", + 2 + ], + [ + "add", + 2, + 3, + 1 + ], + [ + "translate", + 2, + -1 + ], + [ + "half", + 2 + ], + [ + "double", + 1 + ], + [ + "negate", + 1 + ], + [ + "double", + 3 + ], + [ + "negate", + 3 + ], + [ + "translate", + 3, + -1 + ], + [ + "swap", + 0, + 1 + ], + [ + "swap", + 2, + 3 + ] + ], + "counts": { + "add": 2, + "native_calls": 6, + "negate": 2, + "reversed_add": 2, + "scale": 6, + "swap": 2, + "translate": 2 + }, + "kernels": [ + { + "kind": "doubled", + "traffic": 14276 + }, + { + "kind": "added", + "traffic": 20699 + }, + { + "kind": "doubled", + "traffic": 14276 + }, + { + "kind": "doubled", + "traffic": 20768 + }, + { + "kind": "added", + "traffic": 60597 + }, + { + "kind": "translated", + "traffic": 66833 + }, + { + "kind": "doubled", + "traffic": 20768 + }, + { + "kind": "doubled", + "traffic": 15750 + }, + { + "kind": "negated", + "traffic": 14842 + }, + { + "kind": "doubled", + "traffic": 30694 + }, + { + "kind": "negated", + "traffic": 33786 + }, + { + "kind": "translated", + "traffic": 106688 + } + ], + "native": 251442, + "nonnative": 548693, + "nonnative_bound": 231198265, + "parameters": { + "fibre": 3, + "name": "mixed" + }, + "setup": 69963, + "shifts": [ + { + "before": 9, + "majorant": 23427, + "modulus": 3, + "suffix": 9, + "traffic": 22745 + }, + { + "before": 27, + "majorant": 37943, + "modulus": 3, + "suffix": 3, + "traffic": 36937 + } + ], + "signs": [ + { + "acquisitions": 92, + "before": 9, + "modulus": 3, + "suffix": 9, + "traffic": 20678 + }, + { + "acquisitions": 92, + "before": 9, + "modulus": 3, + "suffix": 9, + "traffic": 20678 + }, + { + "acquisitions": 32, + "before": 3, + "modulus": 3, + "suffix": 27, + "traffic": 14577 + }, + { + "acquisitions": 272, + "before": 27, + "modulus": 3, + "suffix": 3, + "traffic": 33521 + }, + { + "acquisitions": 272, + "before": 27, + "modulus": 3, + "suffix": 3, + "traffic": 33521 + }, + { + "acquisitions": 272, + "before": 27, + "modulus": 3, + "suffix": 3, + "traffic": 33521 + } + ], + "total": 800135, + "wrapper": 27709 + }, + { + "adapters": [ + { + "native": 25318, + "overhead": 2725, + "traffic": 28043 + }, + { + "native": 26310, + "overhead": 2725, + "traffic": 29035 + }, + { + "native": 25318, + "overhead": 2725, + "traffic": 28043 + }, + { + "native": 25318, + "overhead": 2725, + "traffic": 28043 + }, + { + "native": 26310, + "overhead": 2725, + "traffic": 29035 + }, + { + "native": 26310, + "overhead": 2725, + "traffic": 29035 + } + ], + "bits": 81, + "compiled": [ + [ + "swap", + 0, + 1 + ], + [ + "swap", + 2, + 3 + ], + [ + "negate", + 1 + ], + [ + "translate", + 1, + -1 + ], + [ + "half", + 1 + ], + [ + "negate", + 3 + ], + [ + "half", + 3 + ], + [ + "double", + 0 + ], + [ + "add", + 0, + 1, + -1 + ], + [ + "translate", + 0, + -1 + ], + [ + "half", + 0 + ], + [ + "double", + 2 + ], + [ + "add", + 2, + 3, + -1 + ], + [ + "half", + 2 + ] + ], + "counts": { + "add": 2, + "native_calls": 6, + "negate": 2, + "reversed_add": 2, + "scale": 6, + "swap": 2, + "translate": 2 + }, + "kernels": [ + { + "kind": "negated", + "traffic": 7414 + }, + { + "kind": "translated", + "traffic": 23165 + }, + { + "kind": "doubled", + "traffic": 7146 + }, + { + "kind": "negated", + "traffic": 18882 + }, + { + "kind": "doubled", + "traffic": 10768 + }, + { + "kind": "doubled", + "traffic": 5474 + }, + { + "kind": "added", + "traffic": 14514 + }, + { + "kind": "translated", + "traffic": 16979 + }, + { + "kind": "doubled", + "traffic": 5474 + }, + { + "kind": "doubled", + "traffic": 10508 + }, + { + "kind": "added", + "traffic": 55452 + }, + { + "kind": "doubled", + "traffic": 10508 + } + ], + "native": 154884, + "nonnative": 252832, + "nonnative_bound": 77066605, + "parameters": { + "inverse": true, + "name": "mixed" + }, + "setup": 43225, + "shifts": [ + { + "before": 3, + "majorant": 8437, + "modulus": 3, + "suffix": 9, + "traffic": 7755 + }, + { + "before": 1, + "majorant": 6327, + "modulus": 3, + "suffix": 27, + "traffic": 5633 + } + ], + "signs": [ + { + "acquisitions": 32, + "before": 3, + "modulus": 3, + "suffix": 9, + "traffic": 7172 + }, + { + "acquisitions": 32, + "before": 3, + "modulus": 3, + "suffix": 9, + "traffic": 7172 + }, + { + "acquisitions": 32, + "before": 3, + "modulus": 3, + "suffix": 9, + "traffic": 7172 + }, + { + "acquisitions": 191, + "before": 27, + "modulus": 3, + "suffix": 1, + "traffic": 18640 + }, + { + "acquisitions": 12, + "before": 1, + "modulus": 3, + "suffix": 27, + "traffic": 5140 + }, + { + "acquisitions": 12, + "before": 1, + "modulus": 3, + "suffix": 27, + "traffic": 5140 + } + ], + "total": 407716, + "wrapper": 6973 + }, + { + "adapters": [ + { + "native": 870567, + "overhead": 102853, + "traffic": 973420 + }, + { + "native": 870567, + "overhead": 102853, + "traffic": 973420 + }, + { + "native": 1297131, + "overhead": 102853, + "traffic": 1399984 + }, + { + "native": 1297131, + "overhead": 102853, + "traffic": 1399984 + }, + { + "native": 870567, + "overhead": 102853, + "traffic": 973420 + }, + { + "native": 1297131, + "overhead": 102853, + "traffic": 1399984 + } + ], + "bits": 6561, + "compiled": [ + [ + "double", + 0 + ], + [ + "add", + 0, + 1, + 1 + ], + [ + "half", + 0 + ], + [ + "double", + 2 + ], + [ + "add", + 2, + 3, + 1 + ], + [ + "translate", + 2, + -1 + ], + [ + "half", + 2 + ], + [ + "double", + 1 + ], + [ + "negate", + 1 + ], + [ + "double", + 3 + ], + [ + "negate", + 3 + ], + [ + "translate", + 3, + -1 + ], + [ + "swap", + 0, + 1 + ], + [ + "swap", + 2, + 3 + ] + ], + "counts": { + "add": 2, + "native_calls": 6, + "negate": 2, + "reversed_add": 2, + "scale": 6, + "swap": 2, + "translate": 2 + }, + "kernels": [ + { + "kind": "doubled", + "traffic": 351519 + }, + { + "kind": "added", + "traffic": 389553 + }, + { + "kind": "doubled", + "traffic": 351519 + }, + { + "kind": "doubled", + "traffic": 526995 + }, + { + "kind": "added", + "traffic": 1475163 + }, + { + "kind": "translated", + "traffic": 2292758 + }, + { + "kind": "doubled", + "traffic": 526995 + }, + { + "kind": "doubled", + "traffic": 374083 + }, + { + "kind": "negated", + "traffic": 536550 + }, + { + "kind": "doubled", + "traffic": 631215 + }, + { + "kind": "negated", + "traffic": 2169817 + }, + { + "kind": "translated", + "traffic": 5116202 + } + ], + "native": 6503094, + "nonnative": 16773145, + "nonnative_bound": 6242333032, + "parameters": { + "name": "mixed", + "width": 3 + }, + "setup": 875187, + "shifts": [ + { + "before": 81, + "majorant": 552867, + "modulus": 9, + "suffix": 9, + "traffic": 551839 + }, + { + "before": 729, + "majorant": 712329, + "modulus": 9, + "suffix": 1, + "traffic": 711301 + } + ], + "signs": [ + { + "acquisitions": 3242, + "before": 81, + "modulus": 9, + "suffix": 9, + "traffic": 837469 + }, + { + "acquisitions": 3242, + "before": 81, + "modulus": 9, + "suffix": 9, + "traffic": 837469 + }, + { + "acquisitions": 362, + "before": 9, + "modulus": 9, + "suffix": 81, + "traffic": 536193 + }, + { + "acquisitions": 22601, + "before": 729, + "modulus": 9, + "suffix": 1, + "traffic": 2169460 + }, + { + "acquisitions": 22601, + "before": 729, + "modulus": 9, + "suffix": 1, + "traffic": 2169460 + }, + { + "acquisitions": 22601, + "before": 729, + "modulus": 9, + "suffix": 1, + "traffic": 2169460 + } + ], + "total": 23276239, + "wrapper": 538471 + }, + { + "adapters": [ + { + "native": 25318, + "overhead": 2725, + "traffic": 28043 + }, + { + "native": 25318, + "overhead": 2725, + "traffic": 28043 + }, + { + "native": 26310, + "overhead": 2725, + "traffic": 29035 + }, + { + "native": 26310, + "overhead": 2725, + "traffic": 29035 + }, + { + "native": 25318, + "overhead": 2725, + "traffic": 28043 + }, + { + "native": 26310, + "overhead": 2725, + "traffic": 29035 + }, + { + "native": 25318, + "overhead": 2725, + "traffic": 28043 + }, + { + "native": 25318, + "overhead": 2725, + "traffic": 28043 + }, + { + "native": 26310, + "overhead": 2725, + "traffic": 29035 + }, + { + "native": 26310, + "overhead": 2725, + "traffic": 29035 + }, + { + "native": 25318, + "overhead": 2725, + "traffic": 28043 + }, + { + "native": 26310, + "overhead": 2725, + "traffic": 29035 + }, + { + "native": 25318, + "overhead": 2725, + "traffic": 28043 + }, + { + "native": 25318, + "overhead": 2725, + "traffic": 28043 + }, + { + "native": 26310, + "overhead": 2725, + "traffic": 29035 + }, + { + "native": 26310, + "overhead": 2725, + "traffic": 29035 + }, + { + "native": 25318, + "overhead": 2725, + "traffic": 28043 + }, + { + "native": 26310, + "overhead": 2725, + "traffic": 29035 + } + ], + "bits": 243, + "compiled": [ + [ + "double", + 0 + ], + [ + "add", + 0, + 1, + 1 + ], + [ + "half", + 0 + ], + [ + "double", + 2 + ], + [ + "add", + 2, + 3, + 1 + ], + [ + "translate", + 2, + -1 + ], + [ + "half", + 2 + ], + [ + "double", + 1 + ], + [ + "negate", + 1 + ], + [ + "double", + 3 + ], + [ + "negate", + 3 + ], + [ + "translate", + 3, + -1 + ], + [ + "swap", + 0, + 1 + ], + [ + "swap", + 2, + 3 + ] + ], + "counts": { + "add": 2, + "native_calls": 6, + "negate": 2, + "reversed_add": 2, + "scale": 6, + "swap": 2, + "translate": 2 + }, + "kernels": [ + { + "kind": "doubled", + "traffic": 5474 + }, + { + "kind": "added", + "traffic": 12050 + }, + { + "kind": "doubled", + "traffic": 5474 + }, + { + "kind": "doubled", + "traffic": 10508 + }, + { + "kind": "added", + "traffic": 38700 + }, + { + "kind": "translated", + "traffic": 36567 + }, + { + "kind": "doubled", + "traffic": 10508 + }, + { + "kind": "doubled", + "traffic": 7146 + }, + { + "kind": "negated", + "traffic": 7414 + }, + { + "kind": "doubled", + "traffic": 10768 + }, + { + "kind": "negated", + "traffic": 18882 + }, + { + "kind": "translated", + "traffic": 53413 + }, + { + "kind": "doubled", + "traffic": 5474 + }, + { + "kind": "added", + "traffic": 12050 + }, + { + "kind": "doubled", + "traffic": 5474 + }, + { + "kind": "doubled", + "traffic": 10508 + }, + { + "kind": "added", + "traffic": 38700 + }, + { + "kind": "translated", + "traffic": 36567 + }, + { + "kind": "doubled", + "traffic": 10508 + }, + { + "kind": "doubled", + "traffic": 7146 + }, + { + "kind": "negated", + "traffic": 7414 + }, + { + "kind": "doubled", + "traffic": 10768 + }, + { + "kind": "negated", + "traffic": 18882 + }, + { + "kind": "translated", + "traffic": 53413 + }, + { + "kind": "doubled", + "traffic": 5474 + }, + { + "kind": "added", + "traffic": 12050 + }, + { + "kind": "doubled", + "traffic": 5474 + }, + { + "kind": "doubled", + "traffic": 10508 + }, + { + "kind": "added", + "traffic": 38700 + }, + { + "kind": "translated", + "traffic": 36567 + }, + { + "kind": "doubled", + "traffic": 10508 + }, + { + "kind": "doubled", + "traffic": 7146 + }, + { + "kind": "negated", + "traffic": 7414 + }, + { + "kind": "doubled", + "traffic": 10768 + }, + { + "kind": "negated", + "traffic": 18882 + }, + { + "kind": "translated", + "traffic": 53413 + } + ], + "native": 464652, + "nonnative": 849243, + "nonnative_bound": 231199815, + "parameters": { + "name": "mixed", + "prefixes": 3 + }, + "setup": 128667, + "shifts": [ + { + "before": 9, + "majorant": 13329, + "modulus": 3, + "suffix": 3, + "traffic": 12539 + }, + { + "before": 27, + "majorant": 15749, + "modulus": 3, + "suffix": 1, + "traffic": 15067 + }, + { + "before": 9, + "majorant": 13329, + "modulus": 3, + "suffix": 3, + "traffic": 12539 + }, + { + "before": 27, + "majorant": 15749, + "modulus": 3, + "suffix": 1, + "traffic": 15067 + }, + { + "before": 9, + "majorant": 13329, + "modulus": 3, + "suffix": 3, + "traffic": 12539 + }, + { + "before": 27, + "majorant": 15749, + "modulus": 3, + "suffix": 1, + "traffic": 15067 + } + ], + "signs": [ + { + "acquisitions": 92, + "before": 9, + "modulus": 3, + "suffix": 3, + "traffic": 11481 + }, + { + "acquisitions": 92, + "before": 9, + "modulus": 3, + "suffix": 3, + "traffic": 11481 + }, + { + "acquisitions": 32, + "before": 3, + "modulus": 3, + "suffix": 9, + "traffic": 7172 + }, + { + "acquisitions": 191, + "before": 27, + "modulus": 3, + "suffix": 1, + "traffic": 18640 + }, + { + "acquisitions": 191, + "before": 27, + "modulus": 3, + "suffix": 1, + "traffic": 18640 + }, + { + "acquisitions": 191, + "before": 27, + "modulus": 3, + "suffix": 1, + "traffic": 18640 + }, + { + "acquisitions": 92, + "before": 9, + "modulus": 3, + "suffix": 3, + "traffic": 11481 + }, + { + "acquisitions": 92, + "before": 9, + "modulus": 3, + "suffix": 3, + "traffic": 11481 + }, + { + "acquisitions": 32, + "before": 3, + "modulus": 3, + "suffix": 9, + "traffic": 7172 + }, + { + "acquisitions": 191, + "before": 27, + "modulus": 3, + "suffix": 1, + "traffic": 18640 + }, + { + "acquisitions": 191, + "before": 27, + "modulus": 3, + "suffix": 1, + "traffic": 18640 + }, + { + "acquisitions": 191, + "before": 27, + "modulus": 3, + "suffix": 1, + "traffic": 18640 + }, + { + "acquisitions": 92, + "before": 9, + "modulus": 3, + "suffix": 3, + "traffic": 11481 + }, + { + "acquisitions": 92, + "before": 9, + "modulus": 3, + "suffix": 3, + "traffic": 11481 + }, + { + "acquisitions": 32, + "before": 3, + "modulus": 3, + "suffix": 9, + "traffic": 7172 + }, + { + "acquisitions": 191, + "before": 27, + "modulus": 3, + "suffix": 1, + "traffic": 18640 + }, + { + "acquisitions": 191, + "before": 27, + "modulus": 3, + "suffix": 1, + "traffic": 18640 + }, + { + "acquisitions": 191, + "before": 27, + "modulus": 3, + "suffix": 1, + "traffic": 18640 + } + ], + "total": 1313895, + "wrapper": 20814 + }, + { + "adapters": [ + { + "native": 25318, + "overhead": 2725, + "traffic": 28043 + }, + { + "native": 25318, + "overhead": 2725, + "traffic": 28043 + }, + { + "native": 26310, + "overhead": 2725, + "traffic": 29035 + }, + { + "native": 26310, + "overhead": 2725, + "traffic": 29035 + }, + { + "native": 25318, + "overhead": 2725, + "traffic": 28043 + }, + { + "native": 26310, + "overhead": 2725, + "traffic": 29035 + } + ], + "bits": 81, + "compiled": [ + [ + "double", + 0 + ], + [ + "add", + 0, + 1, + 1 + ], + [ + "half", + 0 + ], + [ + "double", + 2 + ], + [ + "add", + 2, + 3, + 1 + ], + [ + "translate", + 2, + -1 + ], + [ + "half", + 2 + ], + [ + "double", + 1 + ], + [ + "negate", + 1 + ], + [ + "double", + 3 + ], + [ + "negate", + 3 + ], + [ + "translate", + 3, + -1 + ], + [ + "swap", + 0, + 1 + ], + [ + "swap", + 2, + 3 + ] + ], + "counts": { + "add": 2, + "native_calls": 6, + "negate": 2, + "reversed_add": 2, + "scale": 6, + "swap": 2, + "translate": 2 + }, + "kernels": [ + { + "kind": "doubled", + "traffic": 5474 + }, + { + "kind": "added", + "traffic": 12050 + }, + { + "kind": "doubled", + "traffic": 5474 + }, + { + "kind": "doubled", + "traffic": 10508 + }, + { + "kind": "added", + "traffic": 38700 + }, + { + "kind": "translated", + "traffic": 36567 + }, + { + "kind": "doubled", + "traffic": 10508 + }, + { + "kind": "doubled", + "traffic": 7146 + }, + { + "kind": "negated", + "traffic": 7414 + }, + { + "kind": "doubled", + "traffic": 10768 + }, + { + "kind": "negated", + "traffic": 18882 + }, + { + "kind": "translated", + "traffic": 53413 + } + ], + "native": 154884, + "nonnative": 283116, + "nonnative_bound": 77066605, + "parameters": { + "name": "mixed", + "occupied": 2 + }, + "setup": 42889, + "shifts": [ + { + "before": 9, + "majorant": 13329, + "modulus": 3, + "suffix": 3, + "traffic": 12539 + }, + { + "before": 27, + "majorant": 15749, + "modulus": 3, + "suffix": 1, + "traffic": 15067 + } + ], + "signs": [ + { + "acquisitions": 92, + "before": 9, + "modulus": 3, + "suffix": 3, + "traffic": 11481 + }, + { + "acquisitions": 92, + "before": 9, + "modulus": 3, + "suffix": 3, + "traffic": 11481 + }, + { + "acquisitions": 32, + "before": 3, + "modulus": 3, + "suffix": 9, + "traffic": 7172 + }, + { + "acquisitions": 191, + "before": 27, + "modulus": 3, + "suffix": 1, + "traffic": 18640 + }, + { + "acquisitions": 191, + "before": 27, + "modulus": 3, + "suffix": 1, + "traffic": 18640 + }, + { + "acquisitions": 191, + "before": 27, + "modulus": 3, + "suffix": 1, + "traffic": 18640 + } + ], + "total": 438000, + "wrapper": 6973 + } + ], + "status": "PASS_HIGH_CUBE_PAID_COMPOSITION" +} diff --git a/research/high-cube-paid-composition/SOURCES.json b/research/high-cube-paid-composition/SOURCES.json new file mode 100644 index 0000000000..75d31b8889 --- /dev/null +++ b/research/high-cube-paid-composition/SOURCES.json @@ -0,0 +1,198 @@ +{ + "schema_version": 1, + "base_commit": "463113d675af7410ac91d53a4fed51ec6494eb9a", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "input", + "git_blob": "b1fea0c94436b236cc2b7d41a7be032811b94c81", + "sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "67f085acd86acd7d4e03922d9cf4b26bca66fed5", + "sha256": "47b42433f5a85809a3aadd29c2c339da2c6ed728e4f7762df6b88bccb7874cf0" + }, + { + "path": "research/bit2234-stock-threshold/README.md", + "usage": "input", + "git_blob": "ede0d322c477af91d4c2cc33db0fd10958f45eab", + "sha256": "1e050c9f963421d751d9208092f9a15321ed77810e03912df8eb5eb56bbb06e7" + }, + { + "path": "research/community-frontier1094-audit/ASSEMBLY.json", + "usage": "input", + "git_blob": "5fd676df060f3b450782fdf5ff5f6beb63a5eeb0", + "sha256": "1122cb3a575f8c788345fc1bf4c108ac7c3250fb81a5988671f5eb04b3ab3045" + }, + { + "path": "research/community-hyperplane599-audit/pr589/bit589/v9/hosted/GLOBAL-TEMPLATE.json.gz", + "usage": "input", + "git_blob": "9eafb8776cbf78c72124f833534469ddfa5e98ec", + "sha256": "0357b7cfbd7c29b4983982baf153c8a9f1e1e412690cd7fa9fc3d23d7963b20f" + }, + { + "path": "research/community-hyperplane599-audit/pr589/bit589/v9/hosted/GLOBAL.json", + "usage": "input", + "git_blob": "1f648db9e63e7bfcaa6d5b1dd9fa6503caac47d2", + "sha256": "8de008a7978d4b7189cbec2470443619149a2b7b2f0f862540eeee4b23d3a819" + }, + { + "path": "research/community-hyperplane599-audit/pr589/bit589/v9/nine/GEOMETRY.json", + "usage": "input", + "git_blob": "44006542202ca6037533a754f0bcd00549d7e088", + "sha256": "0058c491d839142aa99ef86a5ec697ce99857632228531512ea3fa74fb24d734" + }, + { + "path": "research/e8-bit-p111-tuned/tune/EXPECTED.json", + "usage": "input", + "git_blob": "e293ddc557742637f9f679f083a1a282d87b1b13", + "sha256": "b9f0e5ca038abe837b0007c8fe006f366a6f02009244ac57705a8a200e2301f4" + }, + { + "path": "research/e8-bit-p111-tuned/tune/bitE8mut-p111-tuned.json.gz", + "usage": "input", + "git_blob": "85a4499bf9e4911a705d50567a2c2ef6cf23739a", + "sha256": "e3e301e62bc2b41dbf1ceac0acf3d35824ebeab1848c5a2142d4577b109da52f" + }, + { + "path": "research/high-route-prefix-cost/invoice.py", + "usage": "input", + "git_blob": "a0de096b0fdfcbf0df4026142189aefed9f2fc3c", + "sha256": "dedf5b1b4b526e55a2df63d750265cefc66ffdd6ca3847d9bcdd43e5605689d6" + }, + { + "path": "research/high-route-prefix-cost/runtime.py", + "usage": "input", + "git_blob": "ab4a03e422d79c114162d545fd6095e5157bf576", + "sha256": "c9ac2c2caa6df1d80dc32dfd081a72662108442c7effbddd2bc87ba3bb77357a" + }, + { + "path": "research/high-scaling-scratch-traffic/PROOF.md", + "usage": "input", + "git_blob": "b564145c83e1d01ea7c6383453bf6eec13ee3ed9", + "sha256": "528fe54729c7d4711d6566d177a778dccd8e9f0f9724654519223bb13f85c69f" + }, + { + "path": "research/high-scaling-total-traffic/traffic.py", + "usage": "input", + "git_blob": "586e46091367fad031ce46270bcbfbc63dbddd2a", + "sha256": "df1c63bb5343998bf9e3109a3c54b34b6d961a3222b52a427649886d5020ae40" + }, + { + "path": "research/idle-axis-hosting/PROOF.md", + "usage": "input", + "git_blob": "4468a00349b4f68dce103e785a8392099435e1d6", + "sha256": "cfe34bf0b64259661312dae22c3a23adc5bf6f6326951eee5c1488ccfc347542" + }, + { + "path": "research/linear-sign-total-traffic/PROOF.md", + "usage": "input", + "git_blob": "93d9abe91550acd3fadb455a941db1a53c2d419c", + "sha256": "2c917e39685cd6cb98b890638a71e5660faab680740e544732aa1703390b2b11" + }, + { + "path": "research/linear-sign-total-traffic/sources/linear_sign.py", + "usage": "input", + "git_blob": "6a6e5c02f299fad8c4f7ab724fc36e14a22ab13c", + "sha256": "73e895fc701a4145cbe89d60f5775128354e7f08d0a45eacf22f423913f54e67" + }, + { + "path": "research/pr589-five-helper-hosting/PROOF.md", + "usage": "input", + "git_blob": "bbd3f12b9a32b3ad3cba85a2d5a1b3054214fa02", + "sha256": "59cae781bfbe1a01ed9e66a8efeeb5a2b995e5ecdf908586b23ecc39f2b8d647" + }, + { + "path": "research/pr589-five-helper-hosting/verify.py", + "usage": "input", + "git_blob": "dbc71f56bb4205ebe378ada1f9f4ea88630d1d39", + "sha256": "cf90e19ae9991b0698be03d395a8cc29061ecb307eb7fea19adfb2d23c25a367" + }, + { + "path": "research/recursive-parking-boundary/README.md", + "usage": "input", + "git_blob": "251f335ebaccc11d69393ee7aeb5a2e84526d0bb", + "sha256": "491aa208391ee4c2936510b1a5c5c018dd5509d9a0e88687c72ab8406cd77b18" + }, + { + "path": "research/selected-bit-fast-primitives/compile_routes.py", + "usage": "input", + "git_blob": "37263fdc327b4a300ccfaa0b7ad650012ab3d59c", + "sha256": "1bfef464dfb3e33d9d57f53b657b2d1fe3598bc453be49000a5e782b622e8585" + }, + { + "path": "research/selected-bit-fast-primitives/high_route.py", + "usage": "input", + "git_blob": "ec7481f890147be7763f4da729fd879a88a87e8e", + "sha256": "13d9c706e7bad2fa3b7d2a97d19b58f2c4efac06d2bb76b613b40069c38b1cd2" + }, + { + "path": "research/selected-bit-fast-primitives/inputs/pr2157.tar", + "usage": "input", + "git_blob": "9504807466071f56519f8663ccb532076a42a273", + "sha256": "db202c7b91b5b8b9340f96f870d54e275854f0b73839451c7c15bd7895ac3639" + }, + { + "path": "research/selected-bit-fast-primitives/inputs/pr2899.tar", + "usage": "input", + "git_blob": "e85ce82745879141e416ac6d9e3551ff959871aa", + "sha256": "fc4a2e07423835737c8fb3872664b16ff12aa4cf83b1e26e49878debef40c531" + }, + { + "path": "research/selected-bit-fast-primitives/kernels.py", + "usage": "input", + "git_blob": "de9fb08c35e92c8354ae622276866385fd07e3d2", + "sha256": "c4b91333817f7fcea44b1d32e01095cd71aeb673ed3608d2e25f4c06d56bb420" + }, + { + "path": "research/selected-bit-fast-primitives/stage.py", + "usage": "input", + "git_blob": "765ae9e11af3acb9458d7a1444a9e79112b72d96", + "sha256": "44e334162d12868ce6bb50c501cd2eba8c527f59ce7a144614edd8cd6f533647" + }, + { + "path": "research/selected-bit-fast-primitives/stage_sources.py", + "usage": "input", + "git_blob": "27383dd1553672f9c82139f80b628b2a094628d8", + "sha256": "55c6631cce4f76e14b66b6195468c36b544e2374cc6c59702135c664bff10822" + }, + { + "path": "research/selected-bit-local-ring-sweeps/PROOF.md", + "usage": "input", + "git_blob": "4330de85dd9862ed15d84ab917887d249753df99", + "sha256": "846c59440cc99e28bae93ad2af99525bc769de29368080071b8427141215b4f7" + }, + { + "path": "research/selected-bit-recursive-closure/PROOF.md", + "usage": "input", + "git_blob": "6c410cab5713979214a45835091fbeb9ee9b8531", + "sha256": "74cc8de20f21acb5123fe2d20996fe0925ea6e51b3dec633bd5221fb719b3344" + }, + { + "path": "upstream/build/sections/02-streams.tex", + "usage": "input", + "git_blob": "088fceea1867abc76271d7efe7532b779fee9039", + "sha256": "606c80db61cad13aa0c3b6060dc4b88dbbe7ac60cdd831aa93f28d908fd09dab" + } + ], + "external_proofs": [ + { + "copy": "sources/high-add-scratch-invoice-PROOF.md", + "source_commit": "803f3593e8f00ed8591d5ff6fc69ce2a036a3293", + "source_path": "research/high-add-scratch-invoice/PROOF.md", + "git_blob": "5b1c722971f3a4c6ab125279318fbfde5251ba2f", + "sha256": "e3be196ae6051b9cf5df9414e0ff405366a93324d6684d9dca9a37e550e88b16", + "url": "https://github.com/CrocSwap/integer-mult-bounds/blob/803f3593e8f00ed8591d5ff6fc69ce2a036a3293/research/high-add-scratch-invoice/PROOF.md" + }, + { + "copy": "sources/high-route-setup-invoice-PROOF.md", + "source_commit": "ac651ec18e62edf0baf3846cc4bf0a11d335c2b4", + "source_path": "research/high-route-setup-invoice/PROOF.md", + "git_blob": "83062a3a6301d7e2d2f4f80739e89b9d1490df49", + "sha256": "ef61337a7481010a0d7fe66302d0132b9b9ec4a816ff95f1ef4337afa0930321", + "url": "https://github.com/CrocSwap/integer-mult-bounds/blob/ac651ec18e62edf0baf3846cc4bf0a11d335c2b4/research/high-route-setup-invoice/PROOF.md" + } + ] +} diff --git a/research/high-cube-paid-composition/TASK.json b/research/high-cube-paid-composition/TASK.json new file mode 100644 index 0000000000..64be6dc745 --- /dev/null +++ b/research/high-cube-paid-composition/TASK.json @@ -0,0 +1,116 @@ +{ + "schema_version": 1, + "task_id": "selected-stock-envelope", + "priority_revision": 6, + "base_commit": "463113d675af7410ac91d53a4fed51ec6494eb9a", + "original_card": { + "id": "selected-stock-envelope", + "question": "What explicit uniform stock envelope does the actual selected stopped producer supply at one bootstrap stage?", + "starting_points": [ + "research/selected-bootstrap-stock-audit/README.md", + "research/bootstrap-cutoff-time-space-split/README.md", + "certificates/selected-result.json", + "docs/research/community-efficient1000-review.md", + "research/stock-margin-chain/README.md" + ], + "methods": [ + "Derive a source-bound reserve recurrence at the actual selected atom widths, separating parent stock from completed inner borrowing.", + "Find an exact missing implication or counterexample to a proposed selected-stage stock envelope." + ], + "acceptance_gate": "Bind every coefficient and depth factor to the selected producer and state the width domain. Compare a proved envelope with the sufficient cutoff guard; a large numerical headroom or a historical m=120 coefficient is not a selected m=73 proof.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read #2972 stock-margin chain and the selected stock audit. The new source archive reports the remaining cutoff comparisons, but leaves every actual stock coefficient unresolved; it is not an independently validated reserve envelope.", + "scope": "Source-bound orientation only. Read the named package and review before relying on its local evidence; this command is not its replay or supplier admission." + }, + "first_experiment": "Choose one actual selected producer/stage and derive its parent reserve and depth coefficient from source. Check whether newer handoffs already cover that exact obligation. Stop with the missing implementation lemma if it cannot be bounded; do not rerun #2972 cutoff/headroom arithmetic as a new contribution.", + "bottleneck_link": "This reduces a concrete inherited implementation obligation without confusing unchanged kappa arithmetic with a completed theorem.", + "allowed_variations": [ + "One stage or one explicit reserve/depth implication.", + "An independently checked same-domain proof repair, retaining all remaining assumptions." + ], + "scope_change_triggers": [ + "Importing the historical 57604 or 252 allowance without a selected-producer binding.", + "Calling a conditional fit lemma a full outer-proof adoption.", + "Replacing an actual selected stock coefficient with cutoff comparisons or a conditional fit inequality." + ], + "overlap_terms": [ + "selected stock", + "stock envelope", + "bootstrap cutoff", + "1956", + "1965", + "1990", + "2972", + "stock-margin-chain", + "actual_stock_coefficient" + ], + "existing_checks": [ + { + "scope": "Retained stock audit identifies missing actual selected-stage coefficients; later cutoff-chain arithmetic does not supply them.", + "evidence": "docs/research/research-family-status.md#revision-6-handoffs-source-archives-awaiting-independent-validation", + "remaining": "Derive one actual reserve/depth coefficient from the selected producer.", + "status": "reviewed", + "source_commit": "836b19bfa309ceafbc8ee32a15e8c4b10dde7e11", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + } + ] + }, + "scope_status": "changed", + "actual_scope": "Complete the released PR2982/PR3265 high-cube physical traffic composition, retaining every native B1 interval as a charged dependency.", + "scope_change_reason": "A live handoff moved the useful obligation to same-domain local traffic. This is not the catalogue's whole-stage stock coefficient, and no such coefficient is inferred.", + "bottleneck_link": "Closes unpriced unit translation and whole-swap-adapter work in the proposed C1 routing bill, with explicit native assumptions and existing component attribution.", + "budget_minutes": 60, + "stop_rule": "Stop at the full local traffic composition; do not claim native all-width admission, total backing, machine-step costs or a new kappa.", + "outcome": "completed", + "evidence": "PROOF.md, RESULT.json; registered normal and optimized source-bound replay with complete small payloads and controls.", + "author": "Krzysztof Wójt with substantial OpenAI Codex assistance", + "ai_assistance": "Substantial OpenAI Codex assistance in derivation, implementation and verification; Luna agents supplied read-only overlap/source inventories and bounded supporting source counts. No independent human or formal review.", + "open_questions": [ + { + "question": "Does the actual fitted native B1 consumer discharge its uniform all-width endpoint, cost and capacity premises?", + "why_it_matters": "The composed invoice explicitly charges its complete toll; elementary fixtures cannot establish fitted admission.", + "first_step": "Pin one reached fitted B1 call and prove/refine its contract with complete spectators and retained source/output ownership.", + "blocked_by": "Inherited PR2753/2809/2899 native and recursive obligations." + }, + { + "question": "What complete machine-step and physical-backing invoice does the enclosing caller supply?", + "why_it_matters": "Physical tape traffic alone does not assign a stock coefficient or price fixed-control selection.", + "first_step": "Join these call intervals to actual allocation/backing lifetimes and charge fixed-control transitions at the same chronological cuts.", + "blocked_by": "A full enclosing-caller reserve and machine compilation/refinement proof." + } + ], + "coordination_url": "https://github.com/CrocSwap/integer-mult-bounds/discussions/2319#discussioncomment-19004103", + "overlap": { + "checked_at": "2026-10-17T20:52:10Z", + "main": "463113d675af7410ac91d53a4fed51ec6494eb9a", + "open_prs": 336, + "closed_prs": 2630, + "discussion_records": 2129, + "complete_pagination": true, + "limits": "Metadata and selected package notes; sparse local notes, unpublished work and arbitrary code diffs are outside coverage." + }, + "publication_overlap": { + "checked_at": "2026-10-17T21:11:38.333692+00:00", + "main": "463113d675af7410ac91d53a4fed51ec6494eb9a", + "coverage": { + "open_prs": { + "fetched_at": "2026-10-17T21:10:07.698250+00:00", + "complete_pagination": true, + "records": 344 + }, + "discussions": { + "fetched_at": "2026-10-17T21:11:38.201572+00:00", + "complete_pagination": true, + "records": 2142 + } + }, + "warnings": [], + "conclusion": "New matches are predecessors or separate work; no competing complete high-cube tariff was found. Metadata search is not a novelty certificate." + } +} diff --git a/research/high-cube-paid-composition/VERIFY.json b/research/high-cube-paid-composition/VERIFY.json new file mode 100644 index 0000000000..35b11fa75d --- /dev/null +++ b/research/high-cube-paid-composition/VERIFY.json @@ -0,0 +1,59 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "certificates/selected-result.json", + "research/bit2234-stock-threshold/README.md", + "research/community-frontier1094-audit/ASSEMBLY.json", + "research/community-hyperplane599-audit/pr589/bit589/v9/hosted/GLOBAL-TEMPLATE.json.gz", + "research/community-hyperplane599-audit/pr589/bit589/v9/hosted/GLOBAL.json", + "research/community-hyperplane599-audit/pr589/bit589/v9/nine/GEOMETRY.json", + "research/e8-bit-p111-tuned/tune/EXPECTED.json", + "research/e8-bit-p111-tuned/tune/bitE8mut-p111-tuned.json.gz", + "research/high-route-prefix-cost/invoice.py", + "research/high-route-prefix-cost/runtime.py", + "research/high-scaling-scratch-traffic/PROOF.md", + "research/high-scaling-total-traffic/traffic.py", + "research/idle-axis-hosting/PROOF.md", + "research/linear-sign-total-traffic/PROOF.md", + "research/linear-sign-total-traffic/sources/linear_sign.py", + "research/pr589-five-helper-hosting/PROOF.md", + "research/pr589-five-helper-hosting/verify.py", + "research/recursive-parking-boundary/README.md", + "research/selected-bit-fast-primitives/compile_routes.py", + "research/selected-bit-fast-primitives/high_route.py", + "research/selected-bit-fast-primitives/inputs/pr2157.tar", + "research/selected-bit-fast-primitives/inputs/pr2899.tar", + "research/selected-bit-fast-primitives/kernels.py", + "research/selected-bit-fast-primitives/stage.py", + "research/selected-bit-fast-primitives/stage_sources.py", + "research/selected-bit-local-ring-sweeps/PROOF.md", + "research/selected-bit-recursive-closure/PROOF.md", + "upstream/build/sections/02-streams.tex" + ], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "Complete paid partitions, independent physical meters, q-adic endpoints, source pins, ownership, component bounds and meaningful controls." + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "Repeat all acceptance conditions and controls with assertions disabled." + } + ] +} diff --git a/research/high-cube-paid-composition/bounds.py b/research/high-cube-paid-composition/bounds.py new file mode 100644 index 0000000000..12c7abcacf --- /dev/null +++ b/research/high-cube-paid-composition/bounds.py @@ -0,0 +1,144 @@ +"""Paid high-cube composition; exact setup equations credited to PR3265. + +The 4096 ADD, 530 scaling and 2048 plain-sign bounds are predecessor +results. New transfer bounds retain every pooled and native call boundary. +Krzysztof Wójt with substantial OpenAI Codex assistance; Apache-2.0. +""" + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def positive(value): + require(type(value) is int and value > 0, "positive integer") + return value + + +def digits(value): + require(type(value) is int and value >= 0, "nonnegative integer") + return max(1, value.bit_length()) + + +def countdown(value, width=None): + width = digits(value) if width is None else width + require(type(width) is int and width >= digits(value), "counter width") + if value == 0: + return 14 * width + 40 + return 15 * value + 14 * width - 5 * value.bit_count() + 36 + + +def close_count(value): + return 5 * digits(value) + 12 + + +def product(left, right): + """PR3265's exact, asymmetric Count.product invoice, including probes.""" + positive(left) + positive(right) + total = 19 * digits(left) + 21 * digits(right) + 151 + current = 0 + for digit in bin(right)[2:]: + bit = int(digit) + total += 3 + (1 - bit) + (11 if current == 0 else 6 * digits(current) + 9) + if bit: + total += 23 * digits(left) + 2 * digits(2 * current) + 9 * digits(2 * current + left) + 50 + current = 2 * current + bit * left + return total + + +def power(modulus, exponent): + positive(modulus) + require(type(exponent) is int and exponent >= 0, "compiled exponent") + total, result, factor = 87 + 14 * digits(modulus), 1, modulus + while exponent: + if exponent & 1: + total += product(result, factor) + close_count(result) + result *= factor + exponent >>= 1 + if exponent: + total += product(factor, factor) + close_count(factor) + factor *= factor + return total + close_count(factor) + + +def extent(modulus, fibre, fields, operation): + kind, first, *arguments = operation + if kind in ("add", "swap"): + first, second = sorted((first, arguments[0])) + exponents = (first, second - first - 1, fields - second - 1) + else: + exponents = (first, fields - first - 1) + values = tuple(modulus**exponent for exponent in exponents) + return ( + sum(power(modulus, exponent) for exponent in exponents) + + product(values[-1], fibre) + + sum(close_count(value) for value in values) + + close_count(values[-1] * fibre) + ) + + +def census(operations): + counts = dict(add=0, scale=0, negate=0, translate=0, swap=0, reversed_add=0) + for kind, target, *arguments in operations: + if kind in ("double", "half"): + counts["scale"] += 1 + else: + require(kind in counts and kind != "reversed_add", "closed factor alphabet") + counts[kind] += 1 + if kind == "add" and arguments[0] > target: + counts["reversed_add"] += 1 + counts["native_calls"] = counts["swap"] + 2 * counts["reversed_add"] + return counts + + +def exact_setup(modulus, fibre, dimension, input_width, roles, operations, copy_rows): + """PR3265 equation, excluding whole direct kernels and swap adapters.""" + require(modulus != 1 or not operations, "Q=1 has an empty active sequence") + highs = modulus ** (dimension * dimension) + volume = highs * fibre + total = copy_rows(highs, fibre) + 4 * volume + 27 * input_width + digits(modulus) + 61 + if modulus == 1: + return total + counts = census(operations) + total += 10 * roles + 65 * digits(modulus) + 159 + total += sum(extent(modulus, fibre, dimension * dimension, op) for op in operations) + total += (len(operations) + 2 * counts["reversed_add"]) * (5 * volume + 7) + return total + + +def sign_acquisitions(modulus, before, suffix): + require(modulus >= 3 and before >= 1 and suffix >= 1, "sign domain") + return 2 + before * (4 * modulus - 5) + (suffix > 1) * before * modulus + + +def translation_bound(modulus, before, suffix): + """Derived loop majorant for pooled translate_one (PROOF.md).""" + positive(before) + positive(suffix) + require(modulus >= 3, "active high modulus") + width = digits(modulus) + 1 + volume = before * modulus * suffix + # Fixed-width subtraction/free, three constructor probes, two outer + # countdowns, four complete block-copy calls per outer row, payload scans. + pair = countdown(modulus - 1, width) + countdown(1, width) + 2 + per_suffix = countdown(suffix, digits(suffix) + 1) + 1 if suffix > 1 else 0 + return ( + 200 * (width + 1) + 3 + + 2 * (countdown(before, digits(before) + 1) + 1) + + 2 * before * (pair + 30 + 5 * modulus * suffix + modulus * per_suffix) + + 13 * volume + 29 + ) + + +def nonnative_bound(modulus, fibre, dimension, input_width, roles, operations): + """Full cube bill less the complete native.run intervals; not native=0.""" + require(modulus != 1 or not operations, "Q=1 has an empty active sequence") + volume = modulus ** (dimension * dimension) * fibre + active = operations if modulus > 1 else () + counts = census(active) + dimension_term = 716 + 933 * (2 * digits(dimension * dimension)) + setup = 27 * input_width + 10 * roles + (373 + len(active) * (3 * dimension_term + 36)) * volume + kernels = 4096 * counts["add"] + 530 * counts["scale"] + 4096 * counts["negate"] + 32768 * counts["translate"] + return setup + (kernels + 100000 * counts["native_calls"]) * volume diff --git a/research/high-cube-paid-composition/sources/high-add-scratch-invoice-PROOF.md b/research/high-cube-paid-composition/sources/high-add-scratch-invoice-PROOF.md new file mode 100644 index 0000000000..5b1c722971 --- /dev/null +++ b/research/high-cube-paid-composition/sources/high-add-scratch-invoice-PROOF.md @@ -0,0 +1,311 @@ +# Ordered high-field ADD: local reserve and physical I/O + +This is a source-level cost and lifetime proof for the **unchanged** +`kernels.added` in Jose Manuel/jmbarrancoml's PR2915, including its actual +PR2809 `ScratchPool.install` specialization and retained `stream.add_pass`. +It answers the ordered-ADD part of Nick Petalas's PR2982 handoff. It does not +complete that handoff's single-cube setup, sign/translation composition or B1 +swaps, and it does not derive a whole bootstrap-stage stock coefficient. + +## Domain and boundary + +Let Q >= 3 be odd, B,M,S >= 1 be integers, and c belong to +{-4,-2,-1,1,2,4}. Here M is the middle spectator multiplicity, **not** the +modulus. Set + +``` +b = bit_length(Q)+1, +l_X = bit_length(X), +V = B Q M Q S. +``` + +The source contains one complete Boolean packet ordered as (prefix,x,middle,y, +suffix). Its action is y -> y+c*x mod Q. B,M,S arrive as canonical Count +encodings; the three marginal copies have exactly one extra high zero. +The initialized Ring has modulus Q, its one word, and the minimal b-digit +template. All borrowed heads begin at their origins. Distinct payload, +numerical and count roles obey the retained ownership contract; any already +occupied pool roles and numerical slots remain charged to the caller. +The source and contexts are read-only, and the output is a distinct owned +dense V-bit stream with its head restored. Dirty entry roles are preserved. + +Count physical Tape reads, writes and unit moves once, including operations +through PhysicalWord and Lease aliases. One acquisition costs the pool's +actual blank read. Finite-control selection, initial marker/template +provisioning, installation/compilation and permanent inventories are outside +this local I/O currency. These are not machine-step constants. Counted +initialization is the allocation and initialization **inside** `added`, not +the enclosing high-bank setup. Successful return is the boundary; arbitrary +interrupted-macro recovery is not claimed. + +For each fixed prefix, x and middle coordinate, the first traversal splits +the Q suffix blocks after Q-offset, with offset=c*x mod Q. The second +traversal writes the trailing offset blocks followed by the leading blocks. +This rotates their y address by offset, preserving each suffix block's bit +order. Both traversals use the same prefix/x/middle nesting, so no spectator +coordinate moves. Only head movements touch the borrowed input and Counts; +their rewinds restore the entry heads. + +The numerical margin suffices: residues are below Q<2^(b-1), a modular sum +is below 2Q<2^b, and Q-offset is between 1 and Q. The fixed literal is at +most four and fits b>=3 digits. Binary division keeps remainder below Q +before each shift. These inequalities discharge the arithmetic width checks; +the reserve proof below discharges the local allocation checks. + +## Scratch and numerical capacity + +The three marginal Counts persist throughout the call. `add_pass` then owns +left, right and output. Inside either traversal the maximum live chain is: + +| Roles | Count | +|---|---:| +| Marginal Counts | 3 | +| Left, right, output payloads | 3 | +| Outer, source-coordinate and middle countdowns | 3 | +| Split-block countdown | 1 | +| Suffix-bit countdown, when S > 1 | 1 | + +`copy_blocks` closes its block/bit countdowns before returning. Each middle, +source-coordinate and outer countdown closes before its next instance. +Marginal construction allocates one stream per result, with no hidden +stream temporary. Word arithmetic uses the separate numerical bank. +Consequently exactly **10+[S>1] free scratch roles** suffice, independent of +Q,B,M and the coefficient. This is a bound on every allocation prefix, so it +excludes a first scratch-capacity failure when other source conditions hold. + +The leading split has Q-offset > 0 at every x. Hence the nested block +countdown, and for S>1 its bit countdown, really occur while all earlier +listed roles remain allocated. Thus the bound is attained in every call in +this domain, not merely in the saved examples. All scratch leases except +the one output close before return. Clearing that output releases the last +new lease; entry leases survive. + +At numerical coefficient preparation, the literal, division scan, quotient, +remainder and new shifted/subtracted remainder need at most five new slots. +The old remainder is freed before the subtraction result is allocated. +After preparation only the coefficient persists. Each outer iteration adds x. +`Ring.multiply` needs at most four further slots: scan, old accumulator, +new addition total and its conditional modular-reduction output. They are +reused, not accumulated over the bit scan. The following leading-count +subtraction needs only offset and leading beside coefficient and x. +Thus **six free numerical slots above all entry residents** suffice at every +allocation prefix. This includes both pending and completed results. +Outside the coefficient callback this is Ross Richardson's PR2810 bound for +the same `stream.add_pass` source; the callback's at most five slots compose +with it by maximum, as PR2810 states. The +Q=3,c=-4,B=M=S=1 fixture attains six; one fewer rejects at the real allocator. +The input modulus and Ring.one, and any additional caller residents, are +entry resources, not part of those six. + +A useful occupied-content corollary, excluding LEFT markers and every entry +resource, is + +``` +additional occupied symbols <= 2V + 2(l_B+l_M+l_S) + 8b + 20. +``` + +Left+right together contain at most V bits and output at most V. The three +marginals occupy l_B+l_M+l_S+6 symbols, including RIGHT. The five possible +countdowns occupy at most (l_B+2)+(b+1)+(l_M+2)+(b+1)+(l_S+2). +Six new numerical words add 6(b+1). Omitting the absent suffix countdown +only improves this upper bound. A local inventory of eleven scratch and +six numerical roles adds seventeen LEFT markers. Previously retained blank +backing, permanent bank templates/markers and simultaneous caller categories +are separate: this occupied-content bound is not a backing-capacity theorem. + +## Exact non-arithmetic invoice + +Let C(n,l) be the complete pooled countdown cost, from construction on an +l-digit input through draining and disposal, where l >= max(1,bit_length(n)). +Arham Tahir's PR2877 countdown identity for this Counter, derived earlier by +ywz65's PR2473, plus the pool's one acquisition read, gives + +``` +C(n,l) = 15n + 14l - 5 popcount(n) + 37 + 4[n=0]. +``` + +PR2877 states both branches for every width d>=max(1,bit_length(n)): +15n+14d-5 popcount(n)+36 for n>0 and 14d+40 at zero. Each additional leading +zero costs six input-copy operations, two extra rewind operations and six +normalization operations. For n=0, direct constructor normalization followed +by clearing the two-symbol zero/RIGHT body gives 14l+41. As both +predecessors note, the positive formula is not valid at zero. + +An independent count makes the endpoint convention explicit. For n>0 and +t=bit_length(n), construction costs 10t+16+14(l-t), including acquisition. +Draining costs 15n-5 popcount(n)+4t+4: ordinary decrements with k trailing +zeros cost 5k+10; the t-1 nonfinal powers of two add four each; the final +one-to-zero decrement adds eight. Use sum_(a=1..n) v_2(a)=n-popcount(n). +Disposal of the canonical zero costs seventeen. At n=0 construction is +14l+24 and disposal is again seventeen. This rederives both branches from +the literal loops; PR2877 and PR2473 retain credit for them. + +For the marginal suffix, the literal `one_bit_suffix` probe costs + +``` +P(S) = 4 if S is even; 15 if S = 1 mod 4; 12 otherwise. +``` + +In particular P(1)=15, because this argument has a high-zero margin. It is +not the canonical one-digit suffix probe used in PR2982's wrapper. + +The complete lifecycle of a marginal copied from an l-digit canonical Count +costs 27l+63: construction/margin 18l+35 (including acquisition), +`positive_extent` 4l+11, and disposal 5l+17. These follow by counting literal +reads/writes/moves in `Natural`, with no decoding of runtime extents. + +Put + +``` +J(Q,b) = C(0,b)+C(Q,b)+2 sum_(n=1..Q-1) C(n,b). +``` + +The coefficient is a signed power of two and Q is odd, so multiplication by c +permutes the offsets 0,...,Q-1. The two split counts are offset and Q-offset. +Thus J accounts for every block countdown in one source-coordinate cycle, +including the zero block. This permutation argument is why the following +invoice is independent of c. Nonunit coefficients are outside this claim. + +Let N be the physical traffic inside the explicitly enumerated numerical +calls in the next section. Every other physical operation has exact total + +``` +W = sum_(X=B,M,S) (27l_X+63) + 23V+32 + + 2 C(B,l_B+1) + + 2B C(Q,b) + + 2BQ C(M,l_M+1) + + 2BM (J(Q,b) + 2Q P(S)) + + 2BMQ^2 [S>1] C(S,l_S+1). +T = W+N. +``` + +There are two traversals. Each copies V payload bits at five operations per +bit. The split-stream rewinds, source rewind, split-stream disposal, output +rewind, three extent probes and three payload acquisitions supply the +remaining 13V+32, for 23V+32 in all: PR2473's exact unpooled payload bill +23V+29 plus the three acquisitions. The counter rows then follow the actual nesting of outer, +source-coordinate, middle, split block and suffix bit. Counter costs include +reads of numerical input Words; these are **outside** N and are not counted +again as arithmetic. No retained alias meter is added to its physical tape. + +Exactly + +``` +8 + 2B + 2BQ + 4BMQ + 2BMQ^2[S>1] +``` + +leases are acquired. This includes the three marginals, three payloads and +both outer counters. Acquisition count differs from peak live inventory. + +For a uniform upper bound, C(n,l) <= 16n+16l+64, l_X <= X, and b <= Q. +The following contributions divided by V bound all terms of W: + +| Term | Upper bound / V | +|---|---:| +| Three marginal lifecycles | 30 | +| Payload, fixed probes and acquisitions | 239/9 | +| Outer countdowns | 224/9 | +| Source-coordinate countdowns | 320/9 | +| Middle countdowns | 224/3 | +| Split-block countdowns | 544/3 | +| Marginal suffix probes | 20 | +| Suffix-bit countdowns | 224 | + +For example C(X,l_X+1)<=32X+80<=112X; a split pair is at most +16Q+32b+128<=272Q/3. The table sums to **617**, so W<=617V<640V. +It permits the suffix countdown even when absent, and uses Q>=3, B,M,S>=1. + +## Numerical traffic is included + +All numerical word bodies have b digits. Heads stay between the origin and +RIGHT. A rewind costs at most 3b; `msb` at most 6b; a zero test at most 9b; +and erasure at most 10b, for b>=3. From the literal loops in the retained +`words.py`: + +| Operation | Physical I/O upper bound | +|---|---:| +| Arena.zero (copy initialized template) | 13b | +| Arena.copy | 28b | +| Literal of magnitude at most 4 | 19b | +| Unsigned.compare | 18b | +| Unsigned.add/subtract | 36b | +| Unsigned.shift_add_bit | 28b | +| Unsigned.divmod | 160b^2 | +| Ring.add/subtract | 100b | +| Ring.negate | 128b | +| Ring.multiply | 300b^2 | +| Fixed selected coefficient, including reduction/sign | 256b^2 | +| Increment in place | 10b | + +For clarity, these are deliberately rounded source bounds, not fitted timing +ratios. Arena.zero costs exactly 9b+12 on initialized roles, at most 13b. +Copy costs at most 27b+1. Add/subtract cost at most 35b+2. +In division there are b iterations, each costing at most 104b, and setup, +scan teardown and the final probes cost at most 94b+4. This is below 160b^2. +In multiplication the two modular additions per bit cost at most 200b, +their old-result frees at most 20b, and the three loop operations at most b +per iteration. Setup/teardown is at most 111b+2. Thus +221b^2+111b+2<300b^2. Zero/one shortcuts are cheaper. +The fixed coefficient costs at most 160b^2+177b<256b^2, including literal, +division, frees and optional negation. Every bound uses b>=3. + +The entire top-level arithmetic partition in `added` is: + +| Numerical call | Multiplicity | Per-call bound | +|---|---:|---:| +| fixed_coefficient | 2 | 256b^2 | +| coefficient/modulus comparison | 2 | 18b | +| allocate x=0 | 2B | 13b | +| multiply coefficient*x | 2BQ | 300b^2 | +| subtract Q-offset | 2BQ | 36b | +| free offset and leading | 2BQ | 20b | +| increment x | 2B(Q-1) | 10b | +| free x / coefficient | 2B+2 | 10b | + +Nested arithmetic calls belong to their enclosing row, not to another row. +These exhaust numerical work in this local routine. Their sum is + +``` +N <= 512b^2 + 56b + 26Bb + 600BQb^2 + 132BQb + <= 832 BQ b^2. +``` + +The second inequality follows by dividing by BQb^2 and using B>=1, Q>=3, +b>=3: the resulting upper bound is 7414/9 < 832. Also b^2<=4Q for every +odd Q>=3. For Q=3 check 9<=12. Otherwise L=bit_length(Q)>=3, and +(L+1)^2<=2^(L+1)<=4Q; the first inequality follows by induction from L=3. +Consequently N<=3328 BQ^2<=3328V, and + +``` +T <= (617+3328)V = 3945V < 4096V. +``` + +Consuming the already rewound output by clearing it adds exactly 5V+7. +Since V>=9, it adds less than 6V; the convenient disposed bound is 4102V. +No sharpness is claimed for these traffic constants. The scratch count is +sharp; the numerical upper bound is attained by a stated fixture. + +## Checking and remaining boundary + +The independently implemented invoice is compared with the complete actual +source on 109 full packets, including every Boolean basis column of the +nine-bit Q=3 packet. The other fixtures use deterministic payloads; they are +not a full GL64 Boolean-column census. Independent modular addressing checks +endpoints, and physical meters are compared both by raw method interception +and by the sum over unique physical tapes. Fifty-one zero/padded countdown +checks and thirty-six separate arithmetic checks through 82-bit words +exercise the delicate boundaries. The all-width result rests on the written +source proof, not extrapolation from those finite executions. + +Controls reject one fewer scratch role, one fewer numerical slot, a wrong +coefficient, an endpoint-preserving extra read, noncanonical borrowed-count +padding that changes only cost, omitted zero-block charges, corrupted source +pins and Boolean/integer receipt substitution. Failed-call fixtures are +explicitly cleaned by the harness; this does not prove source exception safety. + +The actual high route additionally needs encoded extent/high-bank setup, +sign and carry compositions, and its B1 swaps. In particular a reversed-field +ADD may use two swaps outside this kernel, and those charges do not disappear. +Combining local occupied-content bounds with backing capacity, fixed inventories, +native/recursive lifetimes, root stock and H2 remains open. This is not a new +supplier, a whole-stage reserve, a selected-frontier change or a formal theorem. diff --git a/research/high-cube-paid-composition/sources/high-route-setup-invoice-PROOF.md b/research/high-cube-paid-composition/sources/high-route-setup-invoice-PROOF.md new file mode 100644 index 0000000000..83062a3a63 --- /dev/null +++ b/research/high-cube-paid-composition/sources/high-route-setup-invoice-PROOF.md @@ -0,0 +1,258 @@ +# Encoded setup and ownership invoice + +This is a source-level proof for successful calls of the unchanged +`high_route.execute` and `high_route.extents` retained by +`selected-bit-fast-primitives` (PR2915), including its nested PR2899 count and +physical-word implementations. Finite executions corroborate the identities; +they do not establish the universal statements by extrapolation. All input +bytes and attribution are recorded in `SOURCES.json` and `README.md`. + +## Boundary and currency + +Count one physical Tape read, write or unit move once. Numerical Word/Lease +aliases do not introduce a second charge. Native-controller operations belong +to the native toll below. Host bookkeeping, finite-control selection, +compilation and initial provisioning of the enclosing fixed inventory are +outside this currency. The high bank's repeated marker provisioning **inside** +`execute` is included. + +Let `d>=1` be the compiled matrix dimension, `N=d²`, `Q>=1` the high-field +modulus, `H=Q^N`, `F>=1` the canonical fibre Count, and `V=HF` the number of +payload bits in a complete cube. Put `L=bit_length(Q)`. The context's `cap` +and `ring.one` are distinct Words of the same encoded width `I>=L`; the former +is a fresh quotient in `directory.Context`. I is the actual outer Word width, +not the quotient's significant bit length. The borrowed +Counts have canonical digits and all borrowed heads enter at their origins. +The source is a dense V-bit tape. + +Use the retained pooled factory: a successful acquisition returns a distinct +blank caller-owned lease and performs one physical blank read. Require valid +compiled field indices, enough fixed inventory, and an empty, erased high +bank with `K` numerical roles plus its template. K is a **role count**, not a +word width; the adapter default is `2^24`, while reduced fixtures may use 64. +The result is a distinct owned dense V-bit tape at its origin. Borrowed state +is preserved. This does not assert exception recovery or allow arbitrary dirty +numerical bank residents. + +For each reached kernel/adapter call retain its successful endpoint contract: +it preserves its borrowed dense input, restores that input head to its origin, +and returns a distinct dense V-bit owned output at its origin. The composition +below uses these shape/head/ownership facts and charges the entire call. It +does not replace their all-width native or kernel proofs with reduced tests. + +## Exact count primitives + +All following counts include the pooled acquisition reads. Write +`b(x)=max(1,bit_length(x))`. A tape at head position h, with LEFT at zero, +rewinds in `2h+1` operations. Closing a canonical n-digit Count at its origin +therefore costs + +```text +C(x) = 5b(x)+12. +``` + +Copying a positive x from an I-digit encoded operand costs +`18I-4b(x)+21`. The canonical special case is `14b(x)+21`. +Copying zero from I digits costs `18I+29`. These include normalization: +each removed high zero costs six operations, and zero additionally repairs +its sole digit and delimiter. `Count.literal(x)` costs `24b(x)+42` for +positive x and 78 for zero, including its raw temporary's disposal. + +For the source's multiplication by two, define + +```text +Dbl(x) = 11 if x=0, + 6b(x)+9 if x>0. +``` + +For `Count.add` with x>=0 and a>0, put `X=b(x)`, `A=b(a)`, `Z=b(x+a)`. +The exact invoice is + +```text +Add(x,a) = 23A+2X+9Z+50. +``` + +Indeed its copied source costs `14A+21`, the two initial rewinds cost six, +the addition loop costs `2X+2A+3Z+2`, writing and normalizing the result costs +`6Z+9`, and closing the source at its RIGHT delimiter costs `7A+12`. +The terminal loop iteration is included. + +For positive a,b, let `A=b(a)`, `B=b(b)`. Define P(a,b) by scanning b's +bits from most to least significant, initially v=0: + +```text +P(a,b) = 19A+21B+151 + + sum_bits [3+(1-bit)+Dbl(v)+bit*Add(2v,a)], +v_next = 2v+a*bit. +``` + +This is the exact `Count.product` cost, with the returned product still owned. +The initial term accounts for both operand copies, literal zero, scan.msb, +the final scan termination/move and closing factor and scan. The per-bit term +includes the source's extra ZERO read on a zero multiplier digit. The invoice +is asymmetric: for example `P(2,1)=340` and `P(1,2)=329`. + +Define W(Q,e), the complete `fixed_power` cost excluding disposal of its +returned Count, by the actual binary-exponent recurrence. Initialize +`r=1,f=Q,n=e` at cost `66+14L+21`. While n is nonzero: + +1. If its low bit is one, add `P(r,f)+C(r)` and replace r by rf. +2. Shift n right once. If it remains nonzero, add `P(f,f)+C(f)` and replace + f by f². + +Finally add C(f). In particular, the zero-exponent case is not free: +`W(Q,0)=99+19L`. Each replaced value and the final unused factor are disposed. +All returned and borrowed Count heads are at their origins. + +## Exact extent lifetimes + +These equations price `extents` **and** the returned Counts' `apply`-finally +closures, not just preparation. For a unary field i, put `t=N-i-1`: + +```text +E1(i) = W(Q,i)+W(Q,t)+P(Q^t,F) + +C(Q^t)+C(Q^i)+C(Q^t F). +``` + +For binary fields sorted as i1 the bank uses `B=L+1` bits per numerical Word. Directly counting the +retained loops gives: + +| Source interval | Physical operations | +| --- | ---: | +| Initialize all K role markers and the template marker | `5(K+1)` | +| `bank.prepare(modulus)` | `9L+16` | +| `bank.load(modulus)` | `19L+32` | +| `Ring(modulus_word)` | `22L+63` | +| `ring.close()` | `5L+13` | +| `bank.free(modulus_word)` | `5L+13` | +| `bank.erase_owned()` | `5K+5L+17` | +| **Complete bank lifecycle** | **`10K+65L+159`** | + +For example, `Arena.zero` costs `9B+12`, a B-bit Word erasure costs `5B+8`, +and comparison of distinct I-bit Words costs `9I+14`. The comparison before +the branch is charged even when Q=1. That branch skips all factors and every +bank operation, but still copies the cube and creates/closes its modulus Count. + +Use PR2877/PR2982's credited canonical countdown and row-copy invoices: + +```text +D(n) = 15n+14b(n)-5popcount(n)+36, +Pprobe(F) = 4 if F is even, + 15 if F>1 and F=1 mod 4, + 12 otherwise, +R(H,F) = D(H)+1+H*(Pprobe(F)+5F+[F>1]*(D(F)+1)). +``` + +The initial source copy costs R(H,F). Outside data calls, extents and bank +operations, `execute` costs exactly + +```text +E0 = R(H,F)+4V+27I+L+61. +``` + +To see the constants, retain rather than hide the Count costs: the skeleton +is `R+4V+Copy(Q,I)+(9I+14)+5L+26`. It includes the initial output acquisition, +initial source rewind, complete-source probe, source/current rewinds after +copying, final source rewind and modulus closure. Substituting +`Copy(Q,I)=18I-4L+21` gives E0. + +## Data calls, disposal and exact composition + +For every direct `adapter.swap` invocation let A_j be its **whole** physical +toll. It includes its width/extent preparation, the actual native B1 call, +copying the returned B1 output and its disposal. Write `A_j=B1_j+J_j` if +separating the actual B1 interval from adapter overhead. Both remain charged; +do not add B1_j again to a toll that already contains it. Let K_j be the +whole toll of each direct high-field kernel invocation, including its internal +allocation and cleanup. These quantities are not assumed uniformly bounded +by this proof, and elementary B1 fixtures do not prove a fitted all-width bill. + +Let s be the number of factors actually executed (zero when Q=1), r the +number of reversed ADD factors, and E_j the applicable E1/E2. A reversed ADD +means its control field exceeds its target, before sorting the extent indices. +Then the exact successful open-cube invoice is + +```text +T = sum_j A_j + sum_j K_j + +E0+[Q>1]*(10K+65L+159) + +sum_j E_j+(s+2r)*(5V+7). +``` + +A normal factor disposes the previous owned cube once. A reversed ADD first +swaps into B, computes into C and clears B; it then swaps C into D and clears +C. The outer loop additionally clears its retained input A. Each cleared +tape is dense, at its origin and distinct from the borrowed original source, +so each clearance costs `5V+7`. There are two direct swap calls for a reversed +ADD, one for a swap factor, and none for an ordered ADD. All their actual B1 +calls remain within the charged adapter tolls. + +At these call-return cuts an ordered ADD has two caller-owned V-bit cubes; +a reversed ADD has three. The borrowed original source is additional. This +is a bound on caller-retained payloads at those cuts, **not** a total workspace, +allocation/backing bound or a bound on opaque callee/native internals. Cleared +pooled tapes can retain longer blank backing. Consuming the final returned +owned output costs another `5V+7`; its disposal is outside the open invoice. + +## A safe uniform bound for the proved part + +Put `n=bit_length(V)` and `J=2bit_length(N)`. Every positive product occurring +in extent preparation has operands and product at most V. The recurrences +above imply + +```text +P(a,b) <= 40n²+103n+151 <= 294n², +C(a) <= 17n², +W(Q,e) <= (118+311J)n² for 0<=e<=N-1, +E1,E2 <= B_N n², B_N=716+933J. +``` + +For W, at most J products occur; the literal/copy startup costs at most +101n², each product plus replaced-value disposal at most 311n², and the +final factor closure at most 17n². Binary extents need at most three powers, +one further product and four closures. This proves the displayed bounds +without relying on measured ratios. + +For every positive integer V, `n²<=3V`: check n=1,2,3, then use +`(n+1)²<=2n²` for n>=3 and `V>=2^(n-1)`. The credited row-copy bounds give +`R<=83V`; also `L<=n<=V` and `r<=s`. Thus, excluding the explicitly charged +data-call tolls, a convenient uniform upper bound is + +```text +T - sum A_j - sum K_j + <= 27I+10K+[373+s*(3B_N+36)]V. +``` + +It covers Q=1 as well, with s=0, though its unused bank allowance is then +loose. Output disposal adds at most 12V. This is not claimed sharp. + +The actual outer Ring requires exactly one high zero above its modulus; it +does not permit arbitrary extra Ring padding. With the retained source +binding `I=bit_length(q^w)+1` and `Q=q^(w-1)`, one has +`I<=L+bit_length(q)+1`. Thus fixed q,d,K yield a linear-V bound for this proved +part. The radix must remain exposed when eliminating I: at width one, q=3 +and q=5 both give Q=1 and the same V, but their I values are three and four, +so their setup costs differ by exactly 27. This substitution does not price +finite-control transitions, native/kernel tolls, caller hosting, all-stage stock +or complete multiplication. + +The source implementation belongs to Jose Manuel/jmbarrancoml and its credited +predecessors. The countdown/copy-row bills are inherited from Arham Tahir's +PR2877 and Nick Petalas's PR2982; this note adds the encoded setup and disposal +composition. Prepared for thakrarsagar with OpenAI Codex assistance, including +separate source derivation and finite observation. No independent human review +or proof-assistant verification is claimed. Apache-2.0. diff --git a/research/high-cube-paid-composition/verify.py b/research/high-cube-paid-composition/verify.py new file mode 100644 index 0000000000..f24668ccce --- /dev/null +++ b/research/high-cube-paid-composition/verify.py @@ -0,0 +1,444 @@ +#!/usr/bin/env python3 +"""Source-bound physical composition, with actual opaque native intervals. + +Krzysztof Wójt with substantial OpenAI Codex assistance; Apache-2.0. +""" +import argparse +from collections import Counter +from contextlib import ExitStack +from fractions import Fraction +import hashlib +import json +from pathlib import Path +import sys +from types import ModuleType +from unittest.mock import patch + +PACKAGE = Path(__file__).resolve().parent +ROOT = PACKAGE.parents[1] +sys.path.insert(0, str(PACKAGE)) +from bounds import (census, exact_setup, nonnative_bound, require, + sign_acquisitions, translation_bound) + + +def canonical(value): + return json.dumps(value, sort_keys=True, separators=(",", ":"), allow_nan=False) + + +def authenticate(rows=None): + if rows is None: + manifest = json.loads((PACKAGE / "SOURCES.json").read_bytes()) + rows = manifest["files"] + for proof in manifest["external_proofs"]: + relative = Path(proof["copy"]) + require(not relative.is_absolute() and ".." not in relative.parts, "contained proof copy") + source = PACKAGE / relative + require(source.is_file() and not source.is_symlink(), "regular proof copy") + require(source.stat().st_size <= 1024 * 1024, "bounded proof copy") + require(hashlib.sha256(source.read_bytes()).hexdigest() == proof["sha256"], "proof copy hash") + data = {} + for row in rows: + if row["usage"] != "input": + continue + relative = row["path"] + require(relative not in data and not Path(relative).is_absolute(), "unique relative source") + require(".." not in Path(relative).parts, "contained source") + source = ROOT / relative + require(source.is_file() and not source.is_symlink(), "regular source: " + relative) + require(source.stat().st_size <= 32 * 1024 * 1024, "bounded source") + raw = source.read_bytes() + require(hashlib.sha256(raw).hexdigest() == row["sha256"], "source hash: " + relative) + data[relative] = raw + require(sum(map(len, data.values())) <= 64 * 1024 * 1024, "bounded source closure") + return data + + +def source_module(name, relative, data): + result = ModuleType(name) + result.__file__ = str(ROOT / relative) + sys.modules[name] = result + exec(compile(data[relative], result.__file__, "exec"), result.__dict__) + return result + + +def load(): + data = authenticate() + prefix = source_module("cube_prefix_runtime", "research/high-route-prefix-cost/runtime.py", data) + # Keep the predecessor's complete modules/observer. Replace only the + # authentication callback with this package's explicit, checked closure. + prefix.authenticate = lambda: data + invoice = source_module("cube_prefix_invoice", "research/high-route-prefix-cost/invoice.py", data) + runtime = prefix.load() + require(Path(sys.modules["linear_sign"].__file__).read_bytes() == data["research/linear-sign-total-traffic/sources/linear_sign.py"], "PR2877 sign bytes match the reached source") + return prefix, invoice, runtime + + +def count_value(value): + tape = value.tape if hasattr(value, "tape") else value + tape = getattr(tape, "physical", tape) + digits = [] + for digit in tape.cells[1:]: + if digit == 3: # RIGHT; checker observation, never production control. + break + require(digit in (0, 1), "binary observer input") + digits.append(digit) + else: + raise ValueError("missing numeric delimiter") + return sum(bit << i for i, bit in enumerate(digits)), len(digits) + + +WORDS = { + "empty": (), + "ordered": (("add", 1, 0, Fraction(1)),), + "reversed": (("add", 0, 1, Fraction(-4)),), + "swap": (("swap", 0, 1, Fraction(1)),), + "scale": (("scale", 0, 0, Fraction(2)),), + "half": (("scale", 1, 1, Fraction(1, 2)),), + "negative_carry": (("scale", 0, 0, Fraction(-4)),), + "positive_carry": (("scale", 0, 0, Fraction(4)),), + "mixed": (("add", 0, 1, Fraction(1, 2)), ("scale", 1, 1, Fraction(-2)), ("swap", 0, 1, Fraction(1))), +} + + +def prepare(prefix, runtime, name, q=3, width=2, fibre=1, prefixes=1, low=None, inverse=False, occupied=0): + state = prefix.prepare(runtime, prefixes, q, width, fibre, False, 0) + word = WORDS[name] + if inverse: + word = sys.modules["compile_routes"].inverse_word(word) + state.chart = runtime.retained.replay(word, 2) + registry = runtime.registry(2) + registry.register(state.chart, word) + state.route = runtime.routes.compile_route(low or ((1, 0), (0, 1)), state.chart, state.codes) + state.adapter.registry = registry + # One-hot payloads avoid the periodic missing-swap false negative in PR3265. + state.initial = bytes(int(i % state.bits == min(1, state.bits - 1)) for i in range(prefixes * state.bits)) + state.source.cells[1:len(state.initial) + 1] = state.initial + state.entry_owners = {} + for index in range(occupied): + owner = state.pool.acquire() + for bit in (1, 0, index % 2, 1): + owner.append(bit) + owner.rewind() + state.entry_owners[owner.slot] = (owner, bytes(owner.physical.cells)) + return state + + +def complete_endpoint(state, output): + """PR2982's independent matrix oracle extended from I to the actual low row.""" + modulus, high = state.q ** state.width, state.q ** (state.width - 1) + lifted = [[int(value.numerator * pow(value.denominator, -1, modulus)) % modulus + for value in row] for row in state.chart] + expected = bytearray(len(state.initial)) + for ordinal in range(high ** 4): + digits, remaining = [0] * 4, ordinal + for position in range(3, -1, -1): + remaining, digits[position] = divmod(remaining, high) + matrix = [[state.route.low[i][j] + state.q * digits[2 * i + j] + for j in range(2)] for i in range(2)] + target = 0 + for i in range(2): + for j in range(2): + value = sum(matrix[i][k] * lifted[k][j] for k in range(2)) % modulus + target = target * high + (value - state.route.target_low[i][j]) // state.q + for prefix_index in range(state.prefixes): + for suffix in range(state.fibre_value): + source = prefix_index * state.bits + ordinal * state.fibre_value + suffix + destination = prefix_index * state.bits + target * state.fibre_value + suffix + expected[destination] = state.initial[source] + require(bytes(output.physical.cells[1:len(expected) + 1]) == expected, "affine endpoint") + require(all(bit == state.runtime.words.BLANK for bit in output.physical.cells[len(expected) + 1:]), "complete output extent") + require(state.source.head == output.head == 1, "endpoint heads") + + +def completed_boundary(prefix, state, output, originals): + expected = {slot: row[0] for slot, row in state.entry_owners.items()} + expected[output.slot] = output + require(state.pool.live == expected, "preserved entry owners and one distinct output") + for owner, original in state.entry_owners.values(): + require(owner.head == 1 and bytes(owner.physical.cells) == original, "occupied dirty role preserved") + borrowed = prefix.borrowed_tapes(state) + require(tuple(bytes(tape.cells) for tape in borrowed) == originals, "borrowed bytes preserved") + require(all(tape.head == 1 for tape in borrowed), "borrowed heads restored") + require(not state.adapter.high_bank.live and not state.adapter.high_bank.initialized, "high bank erased") + require(state.native.closed and state.native.output.read() == state.runtime.words.BLANK, "native output consumed") + complete_endpoint(state, output) + + +def check_partition(total, wrapper, setup, adapters, kernels): + require(total == wrapper + setup + sum(row["traffic"] for row in adapters + kernels), "exact complete paid partition") + + +def check_native_count(actual, prefixes, counts): + require(actual == prefixes * counts["native_calls"], "both reversed-ADD native swaps retained") + + +def run_case(prefix, invoice, runtime, parameters, mutation=None): + state = prepare(prefix, runtime, **parameters) + high = state.q ** (state.width - 1) + operations = state.adapter.registry.compile(state.route) if high > 1 else () + counts = census(operations) + trace = prefix.Trace(runtime, state.native) + native_rows, adapter_rows, kernel_rows, sign_rows, shift_rows = [], [], [], [], [] + total_acquisitions = 0 + kernels = sys.modules["kernels"] + originals = tuple(bytes(t.cells) for t in prefix.borrowed_tapes(state)) + tapes = prefix.physical_tapes(state) + input_width = count_value(state.context.cap)[1] + original_acquire = state.pool.acquire + + def acquire(): + nonlocal total_acquisitions + total_acquisitions += 1 + return original_acquire() + + native_run = state.native.run + + def native(*args, **kwargs): + start = trace.snapshot() + output = native_run(*args, **kwargs) + native_rows.append(dict(traffic=trace.snapshot() - start, fitted=state.native.last_fitted)) + return output + + adapter_swap = state.adapter.swap + + def swap(*args, **kwargs): + start, count = trace.snapshot(), len(native_rows) + output = adapter_swap(*args, **kwargs) + if mutation == "adapter_read": + args[0].read() # Same endpoint, one extra physical operation. + toll = trace.snapshot() - start + require(len(native_rows) == count + 1, "one native call per whole swap adapter") + native_toll = native_rows[-1]["traffic"] + require(toll - native_toll <= 100000 * state.bits, "swap adapter majorant") + adapter_rows.append(dict(traffic=toll, native=native_toll, overhead=toll - native_toll)) + return output + + def kernel(name, method): + def observed(*args, **kwargs): + start = trace.snapshot() + if mutation == "coefficient" and name == "added": + args = (*args[:-1], -args[-1]) + output = method(*args, **kwargs) + toll = trace.snapshot() - start + factor = {"added": 4096, "doubled": 530, "negated": 4096, "translated": 32768}[name] + require(toll < factor * state.bits, name + " complete kernel tariff") + kernel_rows.append(dict(kind=name, traffic=toll)) + return output + return observed + + sign_method, shift_method = kernels.sign_address, kernels.translate_one + + def sign(source, ring, q, before, suffix): + modulus, _ = count_value(ring.modulus) + leading, _ = count_value(before) + trailing, _ = count_value(suffix) + start, acquisitions = trace.snapshot(), total_acquisitions + output = sign_method(source, ring, q, before, suffix) + toll, used = trace.snapshot() - start, total_acquisitions - acquisitions + require(used == sign_acquisitions(modulus, leading, trailing), "exact pooled-sign acquire count") + require(toll < 2053 * leading * modulus * trailing, "pooled sign transfer") + sign_rows.append(dict(traffic=toll, acquisitions=used, modulus=modulus, before=leading, suffix=trailing)) + return output + + def shift(source, ring, before, suffix): + modulus, _ = count_value(ring.modulus) + leading, _ = count_value(before) + trailing, _ = count_value(suffix) + start = trace.snapshot() + output = shift_method(source, ring, before, suffix) + toll = trace.snapshot() - start + majorant = translation_bound(modulus, leading, trailing) + require(toll <= majorant < 1024 * leading * modulus * trailing, "pooled unit-translation tariff") + shift_rows.append(dict(traffic=toll, majorant=majorant, modulus=modulus, before=leading, suffix=trailing)) + return output + + try: + with ExitStack() as stack: + stack.enter_context(trace.installed()) + stack.enter_context(patch.object(state.pool, "acquire", acquire)) + stack.enter_context(patch.object(state.native, "run", native)) + stack.enter_context(patch.object(state.adapter, "swap", swap)) + for name in ("added", "doubled", "negated", "translated"): + stack.enter_context(patch.object(kernels, name, kernel(name, getattr(kernels, name)))) + stack.enter_context(patch.object(kernels, "sign_address", sign)) + stack.enter_context(patch.object(kernels, "translate_one", shift)) + stack.enter_context(state.scope.install()) + start, raw = trace.snapshot(), prefix.meters(tapes, trace) + output = runtime.routes.route_packet(state.source, state.route, state.context, state.old_count, state.fibre) + total = trace.snapshot() - start + require(total == prefix.meters(tapes, trace) - raw, "raw physical meter / independent observer") + try: + completed_boundary(prefix, state, output, originals) + finally: + output.clear() + check_native_count(len(native_rows), state.prefixes, counts) + expected_kernels = {"added": counts["add"], "doubled": counts["scale"], "negated": counts["negate"], "translated": counts["translate"]} + require(Counter(row["kind"] for row in kernel_rows) == Counter({key: value * state.prefixes for key, value in expected_kernels.items() if value}), "compiled kernel census") + require(all(not row["fitted"] for row in native_rows), "elementary fixtures only") + wrapper = invoice.wrapper(state.prefixes, high**4, state.fibre_value) + setup = state.prefixes * exact_setup(high, state.fibre_value, 2, input_width, state.adapter.high_bank.capacity, operations, invoice.copy_rows) + check_partition(total, wrapper, setup, adapter_rows, kernel_rows) + native_toll = sum(row["traffic"] for row in native_rows) + limit = state.prefixes * nonnative_bound(high, state.fibre_value, 2, input_width, state.adapter.high_bank.capacity, operations) + 265 * len(state.initial) + require(total - native_toll <= limit, "complete non-native packet majorant") + for owner, _original in state.entry_owners.values(): + owner.clear() + state.pool.empty() + return dict(parameters=parameters, bits=len(state.initial), compiled=[list(op) for op in operations], counts=counts, + total=total, wrapper=wrapper, setup=setup, native=native_toll, + nonnative=total-native_toll, nonnative_bound=limit, + adapters=adapter_rows, kernels=kernel_rows, signs=sign_rows, shifts=shift_rows) + finally: + for owner, _original in state.entry_owners.values(): + owner.clear() + prefix.cleanup(state) + + +CASES = ( + dict(name="empty", width=1, fibre=3), + dict(name="empty", q=5), + dict(name="ordered"), + dict(name="reversed"), + dict(name="swap", fibre=3), + dict(name="scale"), + dict(name="half"), + dict(name="negative_carry", q=5, low=((4, 1), (1, 1))), + dict(name="positive_carry", q=5, low=((4, 1), (1, 1))), + dict(name="mixed", fibre=3), + dict(name="mixed", inverse=True), + dict(name="mixed", width=3), + dict(name="mixed", prefixes=3), + dict(name="mixed", occupied=2), +) + + +def check_receipt(actual, expected): + require(canonical(actual) == canonical(expected), "complete typed receipt") + + +def radix_checks(runtime): + """Wide numerical contexts without allocating their exponential payloads.""" + rows = [] + for q, exponent in ((3, 1), (3, 8), (3, 32), (5, 7), (97, 8), (2**89 - 1, 3)): + maximum = runtime.cardinal_counts.Count.literal(q**exponent) + width = runtime.cardinal_counts.Count.literal(0) + bank = runtime.physical_words.PhysicalArena(16) + bank.prepare(maximum) + modulus = bank.load(maximum) + ring = runtime.words.Ring(modulus) + tapes = [word.tape for word in (*bank.words, bank.template)] + [maximum.tape, width.tape] + operations = 0 + + def wrap(method): + def counted(*args, **kwargs): + nonlocal operations + operations += 1 + return method(*args, **kwargs) + return counted + + def raw_meter(): + return sum(tape.meter.reads + tape.meter.writes + tape.meter.moves for tape in tapes) + + try: + with ExitStack() as stack: + for name in ("read", "write", "step"): + stack.enter_context(patch.object(runtime.records.Tape, name, wrap(getattr(runtime.records.Tape, name)))) + initial = raw_meter() + for _ in sys.modules["cardinality"].radix_power(ring, q): + width.increment() + require(operations == raw_meter() - initial, "wide radix physical meter") + b = (q**exponent).bit_length() + 1 + require(count_value(width)[0] == exponent, "encoded native width") + require(operations <= 2200 * (b + 1) ** 3, "source-derived cubic radix envelope") + require((b + 1) ** 3 <= 8 * q ** (2 * exponent), "radix-to-payload inequality") + require(bank.live == {modulus.slot, ring.one.slot}, "radix temporaries restored") + rows.append(dict(radix=str(q), exponent=exponent, word_bits=b, traffic=operations)) + finally: + ring.close() + bank.free(modulus) + bank.erase_owned() + maximum.close() + width.close() + return rows + + +def controls(prefix, invoice, runtime, rows): + names = [] + changed = run_case(prefix, invoice, runtime, CASES[3], "adapter_read") + require(changed["total"] == rows[3]["total"] + rows[3]["counts"]["native_calls"], "extra adapter reads observed") + require(changed["native"] == rows[3]["native"], "native interval remains distinct") + try: + check_receipt(changed, rows[3]) + except ValueError: + names.append("endpoint_preserving_adapter_traffic") + else: + raise ValueError("extra adapter traffic escaped receipt") + try: + run_case(prefix, invoice, runtime, CASES[3], "coefficient") + except ValueError as exc: + require(str(exc) == "affine endpoint", "coefficient control failed at intended endpoint") + names.append("wrong_coefficient_full_payload") + else: + raise ValueError("wrong coefficient escaped endpoint") + row = rows[3] + dropped = [dict(item, traffic=item["overhead"]) for item in row["adapters"]] + try: + check_partition(row["total"], row["wrapper"], row["setup"], dropped, row["kernels"]) + except ValueError: + names.append("omitted_native_charge") + else: + raise ValueError("native toll omission accepted") + incorrect = dict(row["counts"], native_calls=row["counts"]["reversed_add"]) + try: + check_native_count(len(row["adapters"]), 1, incorrect) + except ValueError: + names.append("reversed_swap_multiplicity") + else: + raise ValueError("single-swap reversed-ADD invoice accepted") + pins = json.loads((PACKAGE / "SOURCES.json").read_bytes())["files"] + bad = [dict(row) for row in pins] + next(row for row in bad if row["usage"] == "input")["sha256"] = "0" * 64 + try: + authenticate(bad) + except ValueError as exc: + require(str(exc).startswith("source hash:"), "source control failure site") + names.append("source_corruption_before_load") + else: + raise ValueError("source corruption accepted") + altered = dict(rows[0], bits=float(rows[0]["bits"])) + try: + check_receipt(altered, rows[0]) + except ValueError: + names.append("receipt_numeric_type") + else: + raise ValueError("receipt type mutation accepted") + return names + + +def result(): + prefix, invoice, runtime = load() + rows = [run_case(prefix, invoice, runtime, parameters) for parameters in CASES] + kinds = {op[0] for row in rows for op in row["compiled"]} + require(kinds == {"add", "swap", "double", "half", "negate", "translate"}, "all six compiled kinds") + shifts = [op[-1] for row in rows for op in row["compiled"] if op[0] == "translate"] + require(min(shifts) == -4 and max(shifts) >= 3, "extreme carry controls") + return dict(status="PASS_HIGH_CUBE_PAID_COMPOSITION", cases=len(rows), bits=sum(row["bits"] for row in rows), + native_calls=sum(len(row["adapters"]) for row in rows), + controls=controls(prefix, invoice, runtime, rows), radix_checks=radix_checks(runtime), rows=rows) + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--emit", action="store_true") + args = parser.parse_args() + actual = result() + if args.emit: + print(json.dumps(actual, indent=2, sort_keys=True)) + else: + check_receipt(actual, json.loads((PACKAGE / "RESULT.json").read_bytes())) + print(actual["status"], "cases=" + str(actual["cases"]), "bits=" + str(actual["bits"]), + "native_calls=" + str(actual["native_calls"]), "controls=" + str(len(actual["controls"]))) + + +if __name__ == "__main__": + main()