diff --git a/research/staged544-internal-error-transfer/.gitattributes b/research/staged544-internal-error-transfer/.gitattributes new file mode 100644 index 0000000000..93e08bb12e --- /dev/null +++ b/research/staged544-internal-error-transfer/.gitattributes @@ -0,0 +1,6 @@ +*.gz -text +*.md text eol=lf +*.py text eol=lf +*.json text eol=lf +NOTICE-PR3945.md -text +PREDECESSOR-CREDITS.md -text diff --git a/research/staged544-internal-error-transfer/.gitignore b/research/staged544-internal-error-transfer/.gitignore new file mode 100644 index 0000000000..c18dd8d83c --- /dev/null +++ b/research/staged544-internal-error-transfer/.gitignore @@ -0,0 +1 @@ +__pycache__/ diff --git a/research/staged544-internal-error-transfer/FROZEN-SOURCES.json b/research/staged544-internal-error-transfer/FROZEN-SOURCES.json new file mode 100644 index 0000000000..ee170e0137 --- /dev/null +++ b/research/staged544-internal-error-transfer/FROZEN-SOURCES.json @@ -0,0 +1,26 @@ +{ + "repository": "CrocSwap/integer-mult-bounds", + "head": "91f81d131252db704f945891da1ea54e29d46b8b", + "files": { + "inputs/old-WORD-base.json.gz": { + "sha256": "5ca4be99851f8878cbfe0fd6c454df926b11218f17feefa1664721cf03156699", + "bytes": 72769, + "source_path": "research/staged544-terminal-gap-fill/owner/inputs/old-WORD-base.json.gz" + }, + "inputs/WORD-extra.json.gz": { + "sha256": "d83c2ec9cecc0ad092d34ea4080b28a4fd7199579356b6d5a8fc6cd53ff93299", + "bytes": 74425, + "source_path": "research/staged544-terminal-gap-fill/owner/inputs/WORD-extra.json.gz" + }, + "inputs/old-WORD-extra.json.gz": { + "sha256": "965268a9be73d3f62e7ef680d18f108cf064bfe1f44b82157baa61443232904e", + "bytes": 72766, + "source_path": "research/staged544-terminal-gap-fill/owner/inputs/old-WORD-extra.json.gz" + }, + "inputs/WORD-base.json.gz": { + "sha256": "08e6c96fbe3dfec96cb8451b3867ef8c1a214109ecd1e5af7fcc28e0f05728d0", + "bytes": 74428, + "source_path": "research/staged544-terminal-gap-fill/owner/inputs/WORD-base.json.gz" + } + } +} diff --git a/research/staged544-internal-error-transfer/LEDGER.json b/research/staged544-internal-error-transfer/LEDGER.json new file mode 100644 index 0000000000..3aa95af658 --- /dev/null +++ b/research/staged544-internal-error-transfer/LEDGER.json @@ -0,0 +1,41 @@ +{ + "scope": "Pending PR3945 finite literal words, both providers and prescribed orientations, with PR3734 controls; no selected frontier change", + "proved": { + "input_authentication": "Four immutable gzip words, exact SHA256 and size at pinned PR3945 head; two old words preserve PR3734 controls", + "abstract_registers": {"live":632,"private_buffers":91,"total":723}, + "new_literal_macro_counts": {"total":17598,"add_or_correction":16266,"scale":1164,"native_warp":168}, + "old_literal_macro_counts": {"total":17596,"add_or_correction":16266,"scale":1162,"native_warp":168}, + "ideal_dirty_state": "Exact free-operator shear on live fields, helper identity, all private buffers identity and zero buffer-to-live response", + "range": "G=302 primal,169 dual; rounded absolute-budget execution remains below1024H", + "internal_error": "Destination-local instruction faults: final amplification1335 primal,4841 dual; inverse-prefix all-cut gains22518781/4 and31719103/8", + "absolute_reserve": "13 sufficient bits for all fields/both orientations beyond requested beta, relative to initial all-state H;11 suffices primal alone", + "relative_reserve": "27 sufficient bits for stated relative completed-instruction block-error contract", + "conversion_defect_extension": "Exact inverse-prefix full-state cut sums and conservative arbitrary-register defect transfer; numeric receipts in RESULT.json", + "caller_composition": "Completed full-state norm<=2; Delta_L<=sum_j 2^(L-j) epsilon_j for unitary chart transitions", + "finite_scalar_coefficients": "At most4 numerator/denominator bits in literal scalars; this is recorded separately from magnitude and precision", + "source_unchanged": "No provider instruction, selected record, owner allocation or recursive paid profile changed" + }, + "constructive_conditional_bounds": { + "component_rounding": "d complex coordinates require ceil(log2(sqrt(2d))) further bits to convert per-real-component absolute rounding into block error", + "scalar_accumulator": "Dyadic ADD/SCALE evaluated exactly before output quantization have operand-sum range<16384H under the13-bit absolute scheme", + "native_operators": "All ordered native generators and duals must realize the stipulated isometries; this package does not independently certify their physical phases", + "fault_placement": "27-bit result is destination-local arithmetic/warp fault model. Physical frame/recursive errors on other fields require the full-state-cut extension and an authenticated aggregate completed-cut defect bound" + }, + "inherited_not_replayed_here": { + "local_recursive_profile": "PR3945 and PR3969 derive the changed frame invoice; no new frame census or repricing here", + "owners": "PR3969 retains1,321,920 roles and725,760 bins with84,240 promoted terminal slots; this package does not rerun the owner allocation", + "native_semantics": "The full credited native/phase/compiler ancestry remains an implementation dependency" + }, + "unknown_not_zero": { + "actual_native_macro_precision": "Per-coordinate primitive realization, native internal error propagation and scratch usage", + "recursive_conversion_errors": "Actual child interior bounds and aggregation into declared logical cuts, including errors in source fields", + "dirty_input_range": "Physical caller bound on helper/buffer magnitude relative to original data; H includes all of them", + "exact_borrowed_restoration_under_rounding": "Norm-small final error does not restore exact borrowed bits or prove a legal disposal lifecycle", + "physical_stock_and_tape": "Owner allocation, simultaneous component widths, temporary storage and recovery stock for this precision implementation", + "uniform_all_size": "Tensor dimension/depth, atom-width mapping, native compiler and uniform recurrence", + "selected_bootstrap_sigma": "No map from this pending staged544 producer to selected m=73 stage;27 is not sigma", + "consumer": "Actual ordered caller maps and error budget avoiding repayment of the construction saving", + "outer_analytic_and_bit_supplier": "Inherited obligations remain unchanged" + }, + "expansion_decision": "Narrow: preserve this finite conditional internal-error lemma; next useful work is one actual native/recursive macro realization or authenticated consumer budget. No further lowering/precision census is authorized by these bounds alone." +} diff --git a/research/staged544-internal-error-transfer/NOTICE-PR3945.md b/research/staged544-internal-error-transfer/NOTICE-PR3945.md new file mode 100644 index 0000000000..6dcffa5dfb --- /dev/null +++ b/research/staged544-internal-error-transfer/NOTICE-PR3945.md @@ -0,0 +1,20 @@ +# Attribution and scope + +New terminal-width/frame construction, idle-gap absorption proof, source-guarded recipe, independent finite checks and integration: Dugongue with substantial OpenAI Codex assistance, including three parallel Codex agents. Apache-2.0. AI implementation separation is not independent human review. + +Retain the following predecessor credit and all native/vendor notices: + +- dataisfire, PR3734: actual staged544 supplier and retained full source closure. zxv, PR3682: staged pair. Ross Richardson, PR3605: staged entrance, cleanup and residual checks. +- Erwan Secousses / ChaloupeMusic, PR3815, with retained PR3638 lineage: attained T360 owner clock and fill. The new allocation changes widths and offsets on that placement; it does not invent the source clock. +- hexapode, PR3802 and PR3875: previous complete endpoint combination and refinement. Dugongue, PR3857: prior general proof/evaluator work; PR3929: transported-frame compiler and concrete nonimproving example. +- Sagar Thakrar, PR3687: audit_core.py, retained byte for byte. Its header explicitly credits Arham Tahir's coupled-carrier audit, which it reimplements. roger-sato, PR3693: whole-word audit adapter in the inherited closure. Retained exact rational-price evaluator and source notices are unchanged. +- Jeremy Kothe: frame/preload machinery and PR2833 native rewrite; Lyy-iiis, PR2857; Dugongue, PR2863; philippeVV, PR2853, and all retained provider, owner, native/admission and outer contributors. +- Cinna Davis (@1337isnot1337), PR2226, with OpenAI Codex assistance: native exact Clifford/operator machinery. icekylinx, PR514/433, and retained native ancestry. +- DreamingOfClouds with Claude Opus 5.5: inherited wrapper/outer machinery; chafreaky, PR458, and its retained lineage. +- Tekalign (@tekuuu): sparse native acceleration; retain SPARSE-NOTICE, SPARSE-PROOF, Rohan Arun and all earlier authors/PRs listed by those files. The accelerator changes replay representation, not the certified word. + +The original contributor names already present in upstream sources are attribution. They are not new identification of the submitting GitHub account. All original licenses and source headers remain in place. No broad mathematical novelty, independent human approval, unconditional all-size multiplication bound or fresh Lean/kernel certification is claimed. + +Adjacent reviews were compared and credited: Chris R / Clear1nsight PR3883/3936, with substantial OpenAI Codex assistance, supplies the completed T385 execution/COPY-contract audit precedent; retain its ai-nanachi PR3647, Sagar Thakrar PR3700 and PR2809 physical-caller lineage. These are scoped comparison sources, not a new admission receipt for our changed T360 words. + +Also compare and credit Chris R / Clear1nsight PR3941 for its distinct neutral-first enumeration/middle-cut reduction, following PR3886/3734, Jeremy Kothe PR2957/2979 and Dugongue PR3863/ranked-pair/MathProof predecessors. Rohan Arun's PR3939 bit-pooling draft and its explicitly conditional PR3934 stack are acknowledged as higher draft endpoints on a different route; their data and extra assumptions are not imported into this supplier. diff --git a/research/staged544-internal-error-transfer/PREDECESSOR-CREDITS.md b/research/staged544-internal-error-transfer/PREDECESSOR-CREDITS.md new file mode 100644 index 0000000000..c054fad87e --- /dev/null +++ b/research/staged544-internal-error-transfer/PREDECESSOR-CREDITS.md @@ -0,0 +1,14 @@ +# Source credit and independence + +New work: dataisfire with substantial OpenAI Codex assistance, Apache-2.0. No independent human review, fresh third-party AI review or proof-kernel verification is claimed. + +The construction extends [PR3682](https://github.com/CrocSwap/integer-mult-bounds/pull/3682), head431e6c6023ef352c41696469de7fb614cd4ded8c. Its retimed word, actual T360 source clock and immutable native/parent framework are retained. The complete new source/receipt snapshot is bound by REPLAY-INPUTS.json. The new ordinary source stage is an explicit pinned record applied after the unchanged predecessor reconstruction. + +- [PR3605](https://github.com/CrocSwap/integer-mult-bounds/pull/3605), Ross Richardson, supplies the staged-entrance mechanism, literal cleanup and exact Gaussian residual-check pattern. staged_pair.py is retained; the new544 shear and its proof are separate. +- [PR3638](https://github.com/CrocSwap/integer-mult-bounds/pull/3638), head d62e1acd7518a231440383f0d0dddf54d6edf8c1, supplies the T360 source-window clock, chronological aggregate model and integral-network/literal construction, with its retained PR3605 and earlier credits. The new inventory, integer incumbent and literal fill are recomputed. No predecessor owner receipt is used as proof of the new fill. +- [PR3687](https://github.com/CrocSwap/integer-mult-bounds/pull/3687) and [PR3693](https://github.com/CrocSwap/integer-mult-bounds/pull/3693), Sagar Thakrar and roger-sato with their credited AI assistance, supply audit_core.py and the whole-word semantics adapter audit_verify.py. These bytes are retained and reused. They are independent of the current constructor in the stated interpreter scope, not a newly written independent audit or new reviewer approval. +- The coupled-word source lineage includes PR3133, PR2979, Marius-Paul Dumitrean, dcharb78, Jeremy Kothe and the retained native/owner/block-norm/outer authors. All notices and scientific engines inside the source snapshot remain intact. + +owner_audit.py is a standalone standard-library adaptation of the source-window/family/prefix/invoice predicates in PR3638's independent_literal.py. It imports no producer, optimizer or retained owner checker. Its source template, plan and actual native canonical words are authenticated inputs. Three controls mutate actual literal roles and must fail for the intended reason. It shares the credited contract interpretation; it is not evidence of independent human agreement. + +The rational finite-price enclosure is retained from the PR3682 sources. New script adapters bind it to the actual finite histogram. Native forward/backward scalar replay, wrapper/phase lowering and all-column warp recipes were freshly run for both new words; unchanged native and parent ancestry is explicitly reused. The separate new544 span(414,51) residual check includes global Gaussian phase. diff --git a/research/staged544-internal-error-transfer/PROOF.md b/research/staged544-internal-error-transfer/PROOF.md new file mode 100644 index 0000000000..6a5f2d5cf7 --- /dev/null +++ b/research/staged544-internal-error-transfer/PROOF.md @@ -0,0 +1,212 @@ +# A completed-word internal-error and dirty-state lemma + +Chris R / Clear 1 nsight, with substantial OpenAI Codex assistance. Apache-2.0. + +## Source and norm + +The four exact gzip words are authenticated by FROZEN-SOURCES.json at PR3945 +head 91f81d131252db704f945891da1ea54e29d46b8b. The two old words are PR3734 +controls preserved in that snapshot. The literal order is: initial corrections, +precondition, compensation, A, cut, B with its native operations at recorded +cuts, restore, then private-buffer cleanup. All 632 live registers and 91 +private buffers begin as independent inputs. Both prescribed orientations are +analyzed. Frames affect legality and the recursive invoice; they are not +silently charged as numerical operations here. + +Each register is a vector in a common complex Hilbert space. Use the maximum +over registers of its Hilbert norm. Every formal native generator denotes an +isometry with the stated inverse; the dual generators are also isometries. +Products retain their order. This is a conditional semantic premise inherited +from native realization; no coordinate-infinity norm or new native phase proof +is substituted. Scalar coefficients are exact rationals. An operator row is +a finite sum of rational multiples of words in a free group. Adjacent inverse +letters cancel, identical words combine, and different generators never commute. +The sum of coefficient absolute values is consequently a certified row norm +bound for every realization satisfying the isometry premise. Additional actual +relations may improve the bound; no optimality is claimed. + +## Exact full-state map, including dirty private buffers + +The independently implemented forward rows and reverse columns agree for every +one of the 723 by 723 blocks as free-operator polynomials. In the primal +orientation the final map is exactly + + target[t] <- target[t] + source[t], t=0,...,111, + +with all sources, helpers and private buffers unchanged. The dual map is + + source[t] <- source[t] - target[t], t=0,...,111, + +with all remaining fields unchanged. In particular every private buffer has +identity self-map, no incoming live dependence and zero outgoing dependence +into live fields. Thus this exact formal-word statement holds for arbitrary +initial dirty buffers as well as dirty helpers. It strengthens the limited +zero-buffer endpoint predicate used in a credited predecessor audit; it does +not contradict PR3969's relative old/new arbitrary-dirty program identity. +The full endpoint norm is at most two. Positive controls use full independent +inputs, and explicit mutations inject a dirty buffer into a live output and +corrupt a buffer's return map. + +## Prefix and suffix certificates + +Let M_j be instruction j and L_k=M_k...M_1, with L_0=I. Each literal instruction +is invertible. Immediately after instruction j, permit one arbitrary additive +error eta_j in its destination block, with no independence or randomness +assumption. Errors may be coherent and depend on the actual state. Let E_t +inject a block into register t. + +For a common bound ||eta_j||<=epsilon, the final error is + + sum_j (M_m...M_(j+1)) E_(t_j) eta_j. + +A backward pass computes each suffix column exactly in the same free algebra, +then sums its absolute coefficients separately for each output. This yields +final uniform gains B=1335 (primal) and B=4841 (dual), including restored +helpers and private buffers. Destination errors are charged even after literal +identity SCALEs. Each macro correction/native warp is one fault site; its +physical internal operations are a separate obligation. + +For all intermediate states the forward pass gives ||L_k||<=G, where G=302 +(primal) or 169 (dual). Bounding every intermediate error by unsigned circuit +paths is much looser. Instead transport a fault back to initial coordinates: + + L_k L_j^(-1) E_(t_j) eta_j. + +A separate chronological pass constructs columns of L_j^(-1) by right +multiplying each next inverse instruction. Put h_j equal to the certified +maximum block-row norm of its destination column and D=sum_j h_j. Then for +every k, + + ||actual_state_k - exact_state_k|| <= G D epsilon. + +This follows by the triangle inequality applied to the displayed identity, +using only j<=k and nonnegative h_j. The checked new-word constants are + +| Orientation | G | D | A=G D | B | +| --- | ---: | ---: | ---: | ---: | +| Primal |302|149131/8|22518781/4|1335| +| Dual |169|187687/8|31719103/8|4841| + +Both providers have these values. Old PR3734 words have D=149099/8 and 187679/8; +their slightly smaller values reflect changed literal identity-instruction +fault sites, not improved ideal endpoint maps. The inverse-column calculation +has an independent dense-matrix Gauss-Jordan oracle. The certificate also +retains the much larger unsigned-path envelope as a contrasting method. + +## Absolute-error precision and an explicit magnitude allowance + +Let H>0 bound every initial register, including dirty helpers and private +buffers, and let beta>=0. Uniform per-instruction block faults bounded by + + epsilon <= H 2^(-beta-13) + +imply final error at most H 2^(-beta), since both B<2^13. The primal orientation +alone needs only beta+11 by this sufficient test. Throughout either execution, + + ||actual_state_k|| <= (G + A/8192) H < 1024 H. + +The last strict inequalities are checked rationally. This is a completed +literal-word range bound, not just a bound on instruction coefficients. +If initial dirty fields are bounded only by 2^delta times the desired data +scale H0, replace H with 2^delta H0 and add delta to the requested fractional +reserve to recover an H0-relative final tolerance. + +For a binary fixed-point implementation choose H as a power-of-two upper bound. For a block with d complex coordinates, real and imaginary component rounding +errors bounded by H 2^(-p) imply a block error <=sqrt(2 d) H 2^(-p). Therefore + + p >= beta + 13 + ceil(log2(sqrt(2 d))) + +suffices for the absolute-error premise when it applies to the completed +instruction output. This conversion explicitly pays dimension; a block error +budget is not a per-coordinate error budget. Dyadic scalar ADD and SCALE can +be evaluated exactly before a single output quantization. Their operand +accumulator has magnitude <9*1024 H<16384 H under the same bounds; this counts +its extra range, but not a native macro's internal workspace. A physical native +macro must establish its own completed block-error budget before using this +lemma. Its internal operations are not assumed exact or free. + +## Relative completed-instruction error + +Alternatively assume ADD faults are bounded by +u(||destination||+|c| ||source||), SCALE faults by u|c| ||operand||, and warp +faults by u||operand||, on the actual entering operands. A correction's ordered +native word is an isometry in this defined macro contract. The exact prefix +operand-sum bounds are R=454 (primal) and R=635/2 (dual). Each local operand +bound has Lipschitz constant at most 9 in the maximum-register norm. + +Writing eta=max_j ||eta_j|| and using the all-cut bound A eta gives + + eta <= u(R H +9 A eta). + +If 18 A u<=1, then eta<=2 u R H, so final error is <=2 B R u H. +For both new providers and both orientations, exact rational inequalities give + + 18 A < 2^27, 2 B R < 2^27. + +Consequently u<=2^(-beta-27) suffices for final error <=H 2^(-beta). +This is a sufficient reserve, not minimum precision. The unsigned-path +alternative would require 94 bits primal or 100 bits dual for this same proof; +the inverse-prefix transport uses cancellation before taking absolute values. +No bound independent of all dirty-input magnitudes is asserted. + +## Composition and the missing stock implication + +The completed ideal full-state map has norm at most 2. For a sequence of L +such calls, with each call's absolute completed error epsilon_j and otherwise +norm-preserving chart changes, the running range and accumulated error obey + + H_(j+1) <= 2 H_j + epsilon_j, + Delta_L <= sum_(j=1)^L 2^(L-j) epsilon_j. + +Thus a caller can allocate a concrete error budget rather than silently price +completed calls at unit sensitivity. Sharper bounds may use its actual ordered +shears. If other consumer maps have norm C_j, those exact C_j replace 2. +The lemma does not establish that a physical owner schedule uses only these +723 abstract fields, exact restoration under rounding, native internal error +and storage, recursive depth, or the relation between d and selected-stage +widths. In particular 27 is not the selected stock coefficient sigma in an +O(w log e) envelope. No selected cutoff comparison, uniform stock/tape theorem, +supplier admission or new kappa follows without those missing source maps. + +## Extension for arbitrary-register conversion errors at cuts + +The 27-bit result above charges destination-local faults at the literal +arithmetic/warp sites. A physical frame climb or recursive child can also +perturb a source or borrowed field. Such errors cannot silently be treated as +a destination-only arithmetic fault. This extension makes their needed caller +contract explicit without pretending to implement the conversions. + +For j=0,...,m, permit an arbitrary full-state additive defect e_j at cut j, +with maximum block norm <=epsilon. A cut includes the completed aggregate +error of whatever conversions are assigned there. A conversion before the +next instruction must either be assigned to that preceding cut or transported +through that instruction when assigning the following cut; its norm is not +silently unchanged by a non-isometric scalar instruction. + +Let K_j be the sum, over all columns of L_j^(-1), of that column's maximum +block-row l1 bound. It bounds ||L_j^(-1)|| in our maximum block norm. The +independent inverse pass accumulates S=sum_(j=0)^m K_j, including K_0=723 +as a conservative bound for the identity. Then + + all-cut error <= G S epsilon, + final error <= 2 S epsilon. + +These follow from the same conjugated-fault identity and the checked endpoint +norm 2. For both new providers, S=202653291/16 primal and 109667669/8 dual; +2 S=202653291/8 and 109667669/4. Both are below 2^25, giving 25 sufficient +absolute guard bits. The relative-cut sufficient guards below are 38 primal +and 37 dual. They cover arbitrary fields and all private/borrowed state, unlike +the smaller destination-column bounds. RESULT.json records S, both gains and +the corresponding absolute guard bits for every input word/orientation. + +A sufficient normwise relative-cut contract is +||e_j||<=9 u||actual_state_(j-1)|| for j>=1, and ||e_0||<=u H. +With A_full=G S and B_full=2 S, the same maximum-error argument gives +eta<=u(9 G H+9 A_full eta). Thus + + u <= 2^(-beta-b), b=ceil(log2(36 G S)) + +suffices for final error <=H 2^(-beta). This is a conservative conditional +full-state aggregation allowance. It does not show that individual recursive +calls meet it, bound their internal scratch, or identify an affordable physical +consumer. Those implementation obligations remain in the cost ledger. diff --git a/research/staged544-internal-error-transfer/README.md b/research/staged544-internal-error-transfer/README.md new file mode 100644 index 0000000000..a02a22ed19 --- /dev/null +++ b/research/staged544-internal-error-transfer/README.md @@ -0,0 +1,128 @@ +# Staged544 internal errors: 27 sufficient relative guard bits + +**A source-bound completed-word precision lemma, with arbitrary dirty state.** +For both PR3945 literal providers, in either prescribed orientation, a uniform +relative completed-instruction error allowance + +``` +u <= 2^(-beta-27) +``` + +suffices for final maximum block-Hilbert error at most `H 2^(-beta)`, where +`H` bounds all initial data, dirty helper and private-buffer blocks. The +conditional native isometry and macro-error premises are explicit below. This +is a finite producer-interior coefficient, not a selected stock coefficient, +a physical native implementation, supplier admission or a new κ. + +The new method pairs arithmetic-circuit analysis with noncommutative operator +norms and the numerical-analysis technique of transporting perturbations into +initial coordinates. It retains cancellation in exact forward and inverse +prefixes. A direct unsigned-path proof on the same instructions needs 94/100 +sufficient guard bits; this certificate reduces that allowance to 27 for both +orientations. The result is a bound, not an optimal-precision claim. + +## Exact result + +| PR3945 orientation | Certified exact-path range bound /H | All-cut additive-fault gain | Final additive-fault gain | Relative guard bits | +| --- | ---: | ---: | ---: | ---: | +| Primal |302|22518781/4|1335|27| +| Dual |169|31719103/8|4841|27| + +The same table applies to `base` and `extra`. Each new word executes 17,598 +literal instructions:16,266 ADD/correction sites,1,164 SCALEs and 168 native +warp sites, including all wrappers and cleanup. Each field is a Hilbert block; +these are literal macro counts, not a count or tariff for internal native +arithmetic. Both PR3734 words are retained controls; they have 17,596 literal +instructions and the same final gains/range maxima. + +The exact final map is the intended shear on all 632 live fields, with every +one of 91 private buffers returned identically and with **zero private-buffer +to live-field response**. This holds for arbitrary initial buffer contents in +the free-operator model. It extends the predecessor's conservative zero-buffer +endpoint predicate. PR3969's independently established relative old/new +program identity is compatible with this stronger full-state calculation. + +An absolute-error alternative is especially simple: every instruction may +return an arbitrary block defect at most `H 2^(-beta-13)`; the final error is +at most `H 2^(-beta)` and every actual intermediate block has norm `<1024 H`. +The primal final bound alone uses 11 extra bits. + +A separate full-state-cut extension allows errors in arbitrary source, helper and private fields: 25 sufficient absolute bits, or 38 relative bits primal / 37 dual under its stated aggregate-cut contract. It provides an allowance for frame/recursive defects once the actual implementation binds them to those cuts. + +For d complex coordinates, +per-real-component rounding needs the explicit additional +`ceil(log2(sqrt(2 d)))` allowance. A completed native macro must supply its +block-defect guarantee; internal native work and scratch are not free. + +[PROOF.md](PROOF.md) proves the prefix/suffix identities, exact dirty-state +claim, sufficient precision inequalities and a repeated-call recurrence. +[RESULT.json](RESULT.json) contains all eight source/orientation receipts, +phase bounds and reproducible stream hashes. [LEDGER.json](LEDGER.json) +distinguishes proved finite bounds, conditional implementations and unresolved +physical or all-size costs. + +## Reproduce + +Python 3.12 or later, standard library only; no network, Git, third-party package, +constructor or predecessor evaluator is used by the scientific checker. + +``` +python3 -B research/staged544-internal-error-transfer/verify.py +python3 -O -B research/staged544-internal-error-transfer/test_controls.py +python3 scripts/research_package.py --package research/staged544-internal-error-transfer +``` + +The default checker authenticates all four inputs, reruns every source and both +orientations, and compares the full receipt. It writes no source or result +files. `--emit /absolute/external/result.json` explicitly generates a new +receipt outside the package. The controls use an independent dense scalar +matrix oracle, Gauss-Jordan inverse prefixes, concrete noncommuting unitary +matrices, and production mutations of compensation, cleanup, dirty-buffer +leakage and return. Exact forward and reverse free-operator maps agree on all +723 input/output blocks in each of the eight cases. [VALIDATION.json](VALIDATION.json) +records measured executions and publication checks. + +## Boundaries and source credit + +This is a changed scope of the `selected-stock-envelope` card, explicitly +assigned to the pending staged544 stream. It does **not** derive the selected +m=73 stage coefficient or substitute 27 for the stock coefficient sigma. The +selected κ remains 0.001672660197076918. The actual native/recursive macro +realization, input magnitude relative to caller data, physical owners, exact +restoration under rounding, allocation/tape, all-size depth and the selected +producer/consumer map remain obligations. + +The four immutable words come from PR3945 head +`91f81d131252db704f945891da1ea54e29d46b8b`; the two old words preserve the +PR3734 providers. [FROZEN-SOURCES.json](FROZEN-SOURCES.json) records exact +source paths, sizes and SHA 256 values. Their external head is an attribution +and byte pin, not asserted to be an ancestor of this package. [SOURCES.json](SOURCES.json) +binds the current-main task and selected-record provenance. All four words +remain byte-identical to their authenticated inputs. + +New mathematics and code: Chris R / Clear 1 nsight with substantial OpenAI Codex +assistance. No independent human or proof-kernel review is claimed. Credit +Dugongue for PR3945, dataisfire for PR3734, Jeremy Kothe's rewrites, Sagar +Thakrar/roger-sato's semantic audit and Arham Tahir's contract, and all native, +owner and outer contributors retained in [NOTICE-PR3945.md](NOTICE-PR3945.md) +and [PREDECESSOR-CREDITS.md](PREDECESSOR-CREDITS.md). Those two documents are +verbatim predecessor notices, not authorship claims for this new package. +The program adapter follows the credited literal execution contract; the +forward, reverse, inverse-prefix and error analyses are newly implemented and +import no predecessor executable. QQ16 producer-error and rounded-envelope +work supplied the contract distinction between producer interiors and completed +output errors; its different source constants are not imported. + +## Open next questions + +1. Bind one changed PR3945 native/recursive macro to a concrete rounded + implementation and prove its block-error budget plus actual scratch cost. + This converts a conditional finite-word lemma into a usable physical + component. Native interiors and exact borrowed restoration are the blockers. +2. Map one actual caller's dirty-state range, tensor dimension and ordered + calls into the composition recurrence before pricing its reservoir. This + would supply a true caller reserve coefficient; no selected-stage or uniform + all-size map is established here. +3. Compare the actual ordered caller shears with the conservative factor-two + composition bound. Exact cancellations may further reduce required precision, + but only after an authenticated consumer sequence is available. diff --git a/research/staged544-internal-error-transfer/RESULT.json b/research/staged544-internal-error-transfer/RESULT.json new file mode 100644 index 0000000000..913e413617 --- /dev/null +++ b/research/staged544-internal-error-transfer/RESULT.json @@ -0,0 +1,791 @@ +{ + "arithmetic": "exact Fraction; free group reduction; maximum block Hilbert norm", + "providers": { + "WORD-base.json.gz": [ + { + "all_cut_guard_bits": 9, + "all_cut_l1_bound": "302", + "cut_stream_sha256": "1314f4ad788e02eed470e1f935c45b20b7875c72217b809408e9b142c202dc19", + "dirty_buffer_max_row": 0, + "dirty_buffer_max_row_terms": [], + "dirty_buffer_to_live_l1_bound": "0", + "endpoint_l1_bounds": { + "all": "2", + "helpers": "1", + "live": "2", + "private_buffers": "1", + "sources": "1", + "targets": "2" + }, + "endpoint_rows_sha256": "2b92555ebf438c5a563252ded44e6950831a1576102e646f5b3dbd58978a2c26", + "exact_operand_l1_bound": "454", + "fault_stream_sha256": "fc0a1f2e27b6723208c50396f4d9089a5550f6a03723246ea150bd8803705997", + "forward_reverse_all_rows_checked": 723, + "full_state_cut_error": { + "absolute_guard_bits": 25, + "all_cut_gain": "30600646941/8", + "final_gain": "202653291/8", + "includes_initial_cut": true, + "relative_guard_bits": 38 + }, + "instruction_counts": { + "add": 16266, + "scale": 1164, + "warp": 168 + }, + "instructions": 17598, + "inverse_prefix_all_cut_fault_gain": "22518781/4", + "inverse_prefix_column_sum_bound": "3059/4", + "inverse_prefix_fault_column_sum": "149131/8", + "inverse_prefix_full_state_cut_sum": "202653291/16", + "inverse_prefix_stream_sha256": "958ae61830824e5429f26c6f5cdba432b52f5c819dad31608ca50faca212d4fd", + "live": 632, + "max_local_lipschitz": "9", + "max_scalar_coefficient_bits": 4, + "max_single_fault_gain": "4", + "orientation": "primal", + "peak_witness": [ + 8444, + "A", + 272 + ], + "phase_output_error_bounds": { + "A": "1105", + "B": "64", + "B-native": "6", + "cleanup": "10235/16", + "compensation": "228", + "correction": "4", + "cut": "4", + "precondition": "7", + "restore": "357/8" + }, + "phase_touched_register_max": { + "A": "302", + "B": "157/2", + "B-native": "6", + "cleanup": "302", + "compensation": "151/4", + "correction": "5", + "cut": "201/4", + "precondition": "5", + "restore": "157" + }, + "positive_path_all_cut_fault_gain": "191697806102182229428552139051/256", + "private_buffer_identity_checked": true, + "private_buffers": 91, + "registers": 723, + "single_fault_witness": [ + 16878, + "cleanup", + 303 + ], + "sufficient_extra_fraction_bits": { + "all": 11, + "helpers": 11, + "live": 11, + "private_buffers": 9, + "sources": 7, + "targets": 11 + }, + "uniform_instruction_fault_gains": { + "all": "1335", + "helpers": "1269", + "live": "1335", + "private_buffers": "2621/8", + "sources": "163/2", + "targets": "1335" + }, + "uniform_relative_error_guard_bits": 27, + "zero_buffer_live_shear_checked": true + }, + { + "all_cut_guard_bits": 8, + "all_cut_l1_bound": "169", + "cut_stream_sha256": "cd30f554b9854b9358e838843ceac74fb1dc278231f2a206c6f48282ebde3a8a", + "dirty_buffer_max_row": 0, + "dirty_buffer_max_row_terms": [], + "dirty_buffer_to_live_l1_bound": "0", + "endpoint_l1_bounds": { + "all": "2", + "helpers": "1", + "live": "2", + "private_buffers": "1", + "sources": "2", + "targets": "1" + }, + "endpoint_rows_sha256": "4cfd33e94d6339f31b6ee00850ad8574f26d0d29a18d59dac84f01f1e6fd4f6c", + "exact_operand_l1_bound": "635/2", + "fault_stream_sha256": "4984989996e810029b0c8342148ca06bb1191186624ef1a655d046cf6203164d", + "forward_reverse_all_rows_checked": 723, + "full_state_cut_error": { + "absolute_guard_bits": 25, + "all_cut_gain": "18533836061/8", + "final_gain": "109667669/4", + "includes_initial_cut": true, + "relative_guard_bits": 37 + }, + "instruction_counts": { + "add": 16266, + "scale": 1164, + "warp": 168 + }, + "instructions": 17598, + "inverse_prefix_all_cut_fault_gain": "31719103/8", + "inverse_prefix_column_sum_bound": "1957/2", + "inverse_prefix_fault_column_sum": "187687/8", + "inverse_prefix_full_state_cut_sum": "109667669/8", + "inverse_prefix_stream_sha256": "35787312f9ac6eefa47439b35ba29d419f432e342e3a6d588a28d03593c12a6b", + "live": 632, + "max_local_lipschitz": "9", + "max_scalar_coefficient_bits": 4, + "max_single_fault_gain": "32", + "orientation": "dual", + "peak_witness": [ + 6085, + "A", + 225 + ], + "phase_output_error_bounds": { + "A": "1960", + "B": "375", + "B-native": "5/2", + "cleanup": "2074", + "compensation": "78", + "correction": "6", + "cut": "352", + "precondition": "21/2", + "restore": "52" + }, + "phase_touched_register_max": { + "A": "169", + "B": "63", + "B-native": "23", + "cleanup": "271/4", + "compensation": "153", + "correction": "7", + "cut": "73/4", + "precondition": "4", + "restore": "271/4" + }, + "positive_path_all_cut_fault_gain": "6530777029632132084525344428609/128", + "private_buffer_identity_checked": true, + "private_buffers": 91, + "registers": 723, + "single_fault_witness": [ + 15200, + "cleanup", + 272 + ], + "sufficient_extra_fraction_bits": { + "all": 13, + "helpers": 13, + "live": 13, + "private_buffers": 10, + "sources": 10, + "targets": 3 + }, + "uniform_instruction_fault_gains": { + "all": "4841", + "helpers": "4841", + "live": "4841", + "private_buffers": "987", + "sources": "1031/2", + "targets": "6" + }, + "uniform_relative_error_guard_bits": 27, + "zero_buffer_live_shear_checked": true + } + ], + "WORD-extra.json.gz": [ + { + "all_cut_guard_bits": 9, + "all_cut_l1_bound": "302", + "cut_stream_sha256": "1314f4ad788e02eed470e1f935c45b20b7875c72217b809408e9b142c202dc19", + "dirty_buffer_max_row": 0, + "dirty_buffer_max_row_terms": [], + "dirty_buffer_to_live_l1_bound": "0", + "endpoint_l1_bounds": { + "all": "2", + "helpers": "1", + "live": "2", + "private_buffers": "1", + "sources": "1", + "targets": "2" + }, + "endpoint_rows_sha256": "2b92555ebf438c5a563252ded44e6950831a1576102e646f5b3dbd58978a2c26", + "exact_operand_l1_bound": "454", + "fault_stream_sha256": "fc0a1f2e27b6723208c50396f4d9089a5550f6a03723246ea150bd8803705997", + "forward_reverse_all_rows_checked": 723, + "full_state_cut_error": { + "absolute_guard_bits": 25, + "all_cut_gain": "30600646941/8", + "final_gain": "202653291/8", + "includes_initial_cut": true, + "relative_guard_bits": 38 + }, + "instruction_counts": { + "add": 16266, + "scale": 1164, + "warp": 168 + }, + "instructions": 17598, + "inverse_prefix_all_cut_fault_gain": "22518781/4", + "inverse_prefix_column_sum_bound": "3059/4", + "inverse_prefix_fault_column_sum": "149131/8", + "inverse_prefix_full_state_cut_sum": "202653291/16", + "inverse_prefix_stream_sha256": "958ae61830824e5429f26c6f5cdba432b52f5c819dad31608ca50faca212d4fd", + "live": 632, + "max_local_lipschitz": "9", + "max_scalar_coefficient_bits": 4, + "max_single_fault_gain": "4", + "orientation": "primal", + "peak_witness": [ + 8444, + "A", + 272 + ], + "phase_output_error_bounds": { + "A": "1105", + "B": "64", + "B-native": "6", + "cleanup": "10235/16", + "compensation": "228", + "correction": "4", + "cut": "4", + "precondition": "7", + "restore": "357/8" + }, + "phase_touched_register_max": { + "A": "302", + "B": "157/2", + "B-native": "6", + "cleanup": "302", + "compensation": "151/4", + "correction": "5", + "cut": "201/4", + "precondition": "5", + "restore": "157" + }, + "positive_path_all_cut_fault_gain": "191697806102182229428552139051/256", + "private_buffer_identity_checked": true, + "private_buffers": 91, + "registers": 723, + "single_fault_witness": [ + 16878, + "cleanup", + 303 + ], + "sufficient_extra_fraction_bits": { + "all": 11, + "helpers": 11, + "live": 11, + "private_buffers": 9, + "sources": 7, + "targets": 11 + }, + "uniform_instruction_fault_gains": { + "all": "1335", + "helpers": "1269", + "live": "1335", + "private_buffers": "2621/8", + "sources": "163/2", + "targets": "1335" + }, + "uniform_relative_error_guard_bits": 27, + "zero_buffer_live_shear_checked": true + }, + { + "all_cut_guard_bits": 8, + "all_cut_l1_bound": "169", + "cut_stream_sha256": "cd30f554b9854b9358e838843ceac74fb1dc278231f2a206c6f48282ebde3a8a", + "dirty_buffer_max_row": 0, + "dirty_buffer_max_row_terms": [], + "dirty_buffer_to_live_l1_bound": "0", + "endpoint_l1_bounds": { + "all": "2", + "helpers": "1", + "live": "2", + "private_buffers": "1", + "sources": "2", + "targets": "1" + }, + "endpoint_rows_sha256": "4cfd33e94d6339f31b6ee00850ad8574f26d0d29a18d59dac84f01f1e6fd4f6c", + "exact_operand_l1_bound": "635/2", + "fault_stream_sha256": "4984989996e810029b0c8342148ca06bb1191186624ef1a655d046cf6203164d", + "forward_reverse_all_rows_checked": 723, + "full_state_cut_error": { + "absolute_guard_bits": 25, + "all_cut_gain": "18533836061/8", + "final_gain": "109667669/4", + "includes_initial_cut": true, + "relative_guard_bits": 37 + }, + "instruction_counts": { + "add": 16266, + "scale": 1164, + "warp": 168 + }, + "instructions": 17598, + "inverse_prefix_all_cut_fault_gain": "31719103/8", + "inverse_prefix_column_sum_bound": "1957/2", + "inverse_prefix_fault_column_sum": "187687/8", + "inverse_prefix_full_state_cut_sum": "109667669/8", + "inverse_prefix_stream_sha256": "35787312f9ac6eefa47439b35ba29d419f432e342e3a6d588a28d03593c12a6b", + "live": 632, + "max_local_lipschitz": "9", + "max_scalar_coefficient_bits": 4, + "max_single_fault_gain": "32", + "orientation": "dual", + "peak_witness": [ + 6085, + "A", + 225 + ], + "phase_output_error_bounds": { + "A": "1960", + "B": "375", + "B-native": "5/2", + "cleanup": "2074", + "compensation": "78", + "correction": "6", + "cut": "352", + "precondition": "21/2", + "restore": "52" + }, + "phase_touched_register_max": { + "A": "169", + "B": "63", + "B-native": "23", + "cleanup": "271/4", + "compensation": "153", + "correction": "7", + "cut": "73/4", + "precondition": "4", + "restore": "271/4" + }, + "positive_path_all_cut_fault_gain": "6530777029632132084525344428609/128", + "private_buffer_identity_checked": true, + "private_buffers": 91, + "registers": 723, + "single_fault_witness": [ + 15200, + "cleanup", + 272 + ], + "sufficient_extra_fraction_bits": { + "all": 13, + "helpers": 13, + "live": 13, + "private_buffers": 10, + "sources": 10, + "targets": 3 + }, + "uniform_instruction_fault_gains": { + "all": "4841", + "helpers": "4841", + "live": "4841", + "private_buffers": "987", + "sources": "1031/2", + "targets": "6" + }, + "uniform_relative_error_guard_bits": 27, + "zero_buffer_live_shear_checked": true + } + ], + "old-WORD-base.json.gz": [ + { + "all_cut_guard_bits": 9, + "all_cut_l1_bound": "302", + "cut_stream_sha256": "a531578fba6849c64699259a38e8322e3c6a8477f6dea63a0cc50b1e3f12b987", + "dirty_buffer_max_row": 0, + "dirty_buffer_max_row_terms": [], + "dirty_buffer_to_live_l1_bound": "0", + "endpoint_l1_bounds": { + "all": "2", + "helpers": "1", + "live": "2", + "private_buffers": "1", + "sources": "1", + "targets": "2" + }, + "endpoint_rows_sha256": "2b92555ebf438c5a563252ded44e6950831a1576102e646f5b3dbd58978a2c26", + "exact_operand_l1_bound": "454", + "fault_stream_sha256": "97a55731f0ae20e04c43579da29bce83bc4dd24ebdc199c182cea742d69f9f2b", + "forward_reverse_all_rows_checked": 723, + "full_state_cut_error": { + "absolute_guard_bits": 25, + "all_cut_gain": "30597227093/8", + "final_gain": "202630643/8", + "includes_initial_cut": true, + "relative_guard_bits": 38 + }, + "instruction_counts": { + "add": 16266, + "scale": 1162, + "warp": 168 + }, + "instructions": 17596, + "inverse_prefix_all_cut_fault_gain": "22513949/4", + "inverse_prefix_column_sum_bound": "3059/4", + "inverse_prefix_fault_column_sum": "149099/8", + "inverse_prefix_full_state_cut_sum": "202630643/16", + "inverse_prefix_stream_sha256": "f4f83a51acb5fe32cc52c1c84ff32a444285b4f5ff4ad50a39bd0c5fd0552d93", + "live": 632, + "max_local_lipschitz": "9", + "max_scalar_coefficient_bits": 4, + "max_single_fault_gain": "4", + "orientation": "primal", + "peak_witness": [ + 8444, + "A", + 272 + ], + "phase_output_error_bounds": { + "A": "1105", + "B": "64", + "B-native": "6", + "cleanup": "10235/16", + "compensation": "228", + "correction": "4", + "cut": "4", + "precondition": "7", + "restore": "357/8" + }, + "phase_touched_register_max": { + "A": "302", + "B": "157/2", + "B-native": "6", + "cleanup": "302", + "compensation": "151/4", + "correction": "5", + "cut": "201/4", + "precondition": "5", + "restore": "157" + }, + "positive_path_all_cut_fault_gain": "191697806102182229213596114283/256", + "private_buffer_identity_checked": true, + "private_buffers": 91, + "registers": 723, + "single_fault_witness": [ + 16876, + "cleanup", + 303 + ], + "sufficient_extra_fraction_bits": { + "all": 11, + "helpers": 11, + "live": 11, + "private_buffers": 9, + "sources": 7, + "targets": 11 + }, + "uniform_instruction_fault_gains": { + "all": "1335", + "helpers": "1269", + "live": "1335", + "private_buffers": "2621/8", + "sources": "159/2", + "targets": "1335" + }, + "uniform_relative_error_guard_bits": 27, + "zero_buffer_live_shear_checked": true + }, + { + "all_cut_guard_bits": 8, + "all_cut_l1_bound": "169", + "cut_stream_sha256": "fb94de09c384df8ffd56f966289681dba333facdae035d79385f94372e30d8b1", + "dirty_buffer_max_row": 0, + "dirty_buffer_max_row_terms": [], + "dirty_buffer_to_live_l1_bound": "0", + "endpoint_l1_bounds": { + "all": "2", + "helpers": "1", + "live": "2", + "private_buffers": "1", + "sources": "2", + "targets": "1" + }, + "endpoint_rows_sha256": "4cfd33e94d6339f31b6ee00850ad8574f26d0d29a18d59dac84f01f1e6fd4f6c", + "exact_operand_l1_bound": "635/2", + "fault_stream_sha256": "1204d93f4cbb6a4ef89d4151dffc1687558946a1788bc5f7d5e409d27b165e24", + "forward_reverse_all_rows_checked": 723, + "full_state_cut_error": { + "absolute_guard_bits": 25, + "all_cut_gain": "18531429163/8", + "final_gain": "109653427/4", + "includes_initial_cut": true, + "relative_guard_bits": 37 + }, + "instruction_counts": { + "add": 16266, + "scale": 1162, + "warp": 168 + }, + "instructions": 17596, + "inverse_prefix_all_cut_fault_gain": "31717751/8", + "inverse_prefix_column_sum_bound": "1957/2", + "inverse_prefix_fault_column_sum": "187679/8", + "inverse_prefix_full_state_cut_sum": "109653427/8", + "inverse_prefix_stream_sha256": "eb4bb915d16fe755f843acf233073c4d67ebfda79879eec2a376113c15bba90b", + "live": 632, + "max_local_lipschitz": "9", + "max_scalar_coefficient_bits": 4, + "max_single_fault_gain": "32", + "orientation": "dual", + "peak_witness": [ + 6085, + "A", + 225 + ], + "phase_output_error_bounds": { + "A": "1960", + "B": "375", + "B-native": "5/2", + "cleanup": "2074", + "compensation": "78", + "correction": "6", + "cut": "352", + "precondition": "21/2", + "restore": "52" + }, + "phase_touched_register_max": { + "A": "169", + "B": "63", + "B-native": "23", + "cleanup": "271/4", + "compensation": "153", + "correction": "7", + "cut": "73/4", + "precondition": "4", + "restore": "271/4" + }, + "positive_path_all_cut_fault_gain": "6530777029632132084525154375489/128", + "private_buffer_identity_checked": true, + "private_buffers": 91, + "registers": 723, + "single_fault_witness": [ + 15198, + "cleanup", + 272 + ], + "sufficient_extra_fraction_bits": { + "all": 13, + "helpers": 13, + "live": 13, + "private_buffers": 10, + "sources": 10, + "targets": 3 + }, + "uniform_instruction_fault_gains": { + "all": "4841", + "helpers": "4841", + "live": "4841", + "private_buffers": "987", + "sources": "1031/2", + "targets": "6" + }, + "uniform_relative_error_guard_bits": 27, + "zero_buffer_live_shear_checked": true + } + ], + "old-WORD-extra.json.gz": [ + { + "all_cut_guard_bits": 9, + "all_cut_l1_bound": "302", + "cut_stream_sha256": "a531578fba6849c64699259a38e8322e3c6a8477f6dea63a0cc50b1e3f12b987", + "dirty_buffer_max_row": 0, + "dirty_buffer_max_row_terms": [], + "dirty_buffer_to_live_l1_bound": "0", + "endpoint_l1_bounds": { + "all": "2", + "helpers": "1", + "live": "2", + "private_buffers": "1", + "sources": "1", + "targets": "2" + }, + "endpoint_rows_sha256": "2b92555ebf438c5a563252ded44e6950831a1576102e646f5b3dbd58978a2c26", + "exact_operand_l1_bound": "454", + "fault_stream_sha256": "97a55731f0ae20e04c43579da29bce83bc4dd24ebdc199c182cea742d69f9f2b", + "forward_reverse_all_rows_checked": 723, + "full_state_cut_error": { + "absolute_guard_bits": 25, + "all_cut_gain": "30597227093/8", + "final_gain": "202630643/8", + "includes_initial_cut": true, + "relative_guard_bits": 38 + }, + "instruction_counts": { + "add": 16266, + "scale": 1162, + "warp": 168 + }, + "instructions": 17596, + "inverse_prefix_all_cut_fault_gain": "22513949/4", + "inverse_prefix_column_sum_bound": "3059/4", + "inverse_prefix_fault_column_sum": "149099/8", + "inverse_prefix_full_state_cut_sum": "202630643/16", + "inverse_prefix_stream_sha256": "f4f83a51acb5fe32cc52c1c84ff32a444285b4f5ff4ad50a39bd0c5fd0552d93", + "live": 632, + "max_local_lipschitz": "9", + "max_scalar_coefficient_bits": 4, + "max_single_fault_gain": "4", + "orientation": "primal", + "peak_witness": [ + 8444, + "A", + 272 + ], + "phase_output_error_bounds": { + "A": "1105", + "B": "64", + "B-native": "6", + "cleanup": "10235/16", + "compensation": "228", + "correction": "4", + "cut": "4", + "precondition": "7", + "restore": "357/8" + }, + "phase_touched_register_max": { + "A": "302", + "B": "157/2", + "B-native": "6", + "cleanup": "302", + "compensation": "151/4", + "correction": "5", + "cut": "201/4", + "precondition": "5", + "restore": "157" + }, + "positive_path_all_cut_fault_gain": "191697806102182229213596114283/256", + "private_buffer_identity_checked": true, + "private_buffers": 91, + "registers": 723, + "single_fault_witness": [ + 16876, + "cleanup", + 303 + ], + "sufficient_extra_fraction_bits": { + "all": 11, + "helpers": 11, + "live": 11, + "private_buffers": 9, + "sources": 7, + "targets": 11 + }, + "uniform_instruction_fault_gains": { + "all": "1335", + "helpers": "1269", + "live": "1335", + "private_buffers": "2621/8", + "sources": "159/2", + "targets": "1335" + }, + "uniform_relative_error_guard_bits": 27, + "zero_buffer_live_shear_checked": true + }, + { + "all_cut_guard_bits": 8, + "all_cut_l1_bound": "169", + "cut_stream_sha256": "fb94de09c384df8ffd56f966289681dba333facdae035d79385f94372e30d8b1", + "dirty_buffer_max_row": 0, + "dirty_buffer_max_row_terms": [], + "dirty_buffer_to_live_l1_bound": "0", + "endpoint_l1_bounds": { + "all": "2", + "helpers": "1", + "live": "2", + "private_buffers": "1", + "sources": "2", + "targets": "1" + }, + "endpoint_rows_sha256": "4cfd33e94d6339f31b6ee00850ad8574f26d0d29a18d59dac84f01f1e6fd4f6c", + "exact_operand_l1_bound": "635/2", + "fault_stream_sha256": "1204d93f4cbb6a4ef89d4151dffc1687558946a1788bc5f7d5e409d27b165e24", + "forward_reverse_all_rows_checked": 723, + "full_state_cut_error": { + "absolute_guard_bits": 25, + "all_cut_gain": "18531429163/8", + "final_gain": "109653427/4", + "includes_initial_cut": true, + "relative_guard_bits": 37 + }, + "instruction_counts": { + "add": 16266, + "scale": 1162, + "warp": 168 + }, + "instructions": 17596, + "inverse_prefix_all_cut_fault_gain": "31717751/8", + "inverse_prefix_column_sum_bound": "1957/2", + "inverse_prefix_fault_column_sum": "187679/8", + "inverse_prefix_full_state_cut_sum": "109653427/8", + "inverse_prefix_stream_sha256": "eb4bb915d16fe755f843acf233073c4d67ebfda79879eec2a376113c15bba90b", + "live": 632, + "max_local_lipschitz": "9", + "max_scalar_coefficient_bits": 4, + "max_single_fault_gain": "32", + "orientation": "dual", + "peak_witness": [ + 6085, + "A", + 225 + ], + "phase_output_error_bounds": { + "A": "1960", + "B": "375", + "B-native": "5/2", + "cleanup": "2074", + "compensation": "78", + "correction": "6", + "cut": "352", + "precondition": "21/2", + "restore": "52" + }, + "phase_touched_register_max": { + "A": "169", + "B": "63", + "B-native": "23", + "cleanup": "271/4", + "compensation": "153", + "correction": "7", + "cut": "73/4", + "precondition": "4", + "restore": "271/4" + }, + "positive_path_all_cut_fault_gain": "6530777029632132084525154375489/128", + "private_buffer_identity_checked": true, + "private_buffers": 91, + "registers": 723, + "single_fault_witness": [ + 15198, + "cleanup", + 272 + ], + "sufficient_extra_fraction_bits": { + "all": 13, + "helpers": 13, + "live": 13, + "private_buffers": 10, + "sources": 10, + "targets": 3 + }, + "uniform_instruction_fault_gains": { + "all": "4841", + "helpers": "4841", + "live": "4841", + "private_buffers": "987", + "sources": "1031/2", + "targets": "6" + }, + "uniform_relative_error_guard_bits": 27, + "zero_buffer_live_shear_checked": true + } + ] + }, + "rounding_model": "one arbitrary additive block error after every literal instruction; scalar and native realization obligations external", + "schema": 1 +} diff --git a/research/staged544-internal-error-transfer/SOURCES.json b/research/staged544-internal-error-transfer/SOURCES.json new file mode 100644 index 0000000000..0b2d281154 --- /dev/null +++ b/research/staged544-internal-error-transfer/SOURCES.json @@ -0,0 +1,23 @@ +{ + "schema_version": 1, + "base_commit": "20ecf2891d80b5acf18d980b2164fb44ea7faa90", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "b1fea0c94436b236cc2b7d41a7be032811b94c81", + "sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "67f085acd86acd7d4e03922d9cf4b26bca66fed5", + "sha256": "47b42433f5a85809a3aadd29c2c339da2c6ed728e4f7762df6b88bccb7874cf0" + } + ], + "external_snapshot": { + "manifest": "FROZEN-SOURCES.json", + "head": "91f81d131252db704f945891da1ea54e29d46b8b", + "relation": "Exact public predecessor bytes retained; external snapshot head is not asserted to be a reachable ancestor. Verifier authenticates all four local gzip inputs." + } +} diff --git a/research/staged544-internal-error-transfer/TASK.json b/research/staged544-internal-error-transfer/TASK.json new file mode 100644 index 0000000000..d7d4ddd571 --- /dev/null +++ b/research/staged544-internal-error-transfer/TASK.json @@ -0,0 +1,95 @@ +{ + "schema_version": 1, + "task_id": "selected-stock-envelope", + "priority_revision": 6, + "base_commit": "20ecf2891d80b5acf18d980b2164fb44ea7faa90", + "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": "Source-bound internal-error, exact dirty-state restoration and completed-call precision envelope for both pending PR3945 staged544 literal words, compared to both PR3734 originals.", + "scope_change_reason": "Explicit user-assigned staged544 stream and contrasting mathematical method. This supplies a finite pending-producer interior coefficient; it does not derive the selected m=73 bootstrap stock coefficient or satisfy that original acceptance gate. The native physical and all-size interface maps remain named obligations.", + "bottleneck_link": "A finite paid profile cannot imply affordable physical execution until the actual word supplies output-error and dirty-state magnitude bounds.", + "budget_minutes": 60, + "stop_rule": "Finish one exact finite-word theorem and bounded controls; stop before unsupported native arithmetic, owner reservoir, or all-size stock substitution.", + "outcome": "completed", + "author": "Chris R / Clear1nsight", + "ai_assistance": "Substantial OpenAI Codex assistance. Separate mathematical subtask within a coordinated multi-agent contribution batch; no independent human or proof-kernel review.", + "evidence": "RESULT.json, PROOF.md, LEDGER.json and VALIDATION.json", + "open_questions": [ + { + "question": "Can each physical native/recursive macro meet the block-Hilbert error budget with affordable workspace?", + "why_it_matters": "The finite literal-word error transfer is conditional on this premise.", + "first_step": "Bind one changed PR3945 native macro to a concrete rounded implementation, count internal defects and workspace.", + "blocked_by": "Native interior finite-grid, exact borrowed restoration and allocation contract." + }, + { + "question": "What actual selected-stage stock coefficient follows after binding tensor dimension, depth and native workspace?", + "why_it_matters": "The finite word constants cannot replace sigma in the selected envelope.", + "first_step": "Identify the producer/consumer map between this pending staged544 call and one selected bootstrap stage before deriving a reserve recurrence.", + "blocked_by": "No selected-stage admission or uniform all-size compiler map is established." + } + ], + "checkpoint": { + "utc": "2026-10-19T08:05:10Z", + "canonical_main": "20ecf2891d80b5acf18d980b2164fb44ea7faa90", + "priority_revision": 6, + "pr3945_head": "91f81d131252db704f945891da1ea54e29d46b8b", + "overlap": "685 open PR bodies at08:00:26 UTC; partial1166 discussion entry coverage; no direct overlap identified" + } +} diff --git a/research/staged544-internal-error-transfer/VALIDATION.json b/research/staged544-internal-error-transfer/VALIDATION.json new file mode 100644 index 0000000000..6971df4e11 --- /dev/null +++ b/research/staged544-internal-error-transfer/VALIDATION.json @@ -0,0 +1,91 @@ +{ + "status": "Scientific verification complete; publication byte/export checks recorded separately after public commit", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]", + "platform": "Linux-7.0.0-38-generic-x86_64-with-glibc2.39", + "initial_full_extended_generation": { + "status": "PASS", + "seconds": 96.949, + "command": "python3 -u verify.py --emit /tmp/precision-complete.json" + }, + "independent_controls": { + "status": "PASS", + "normal_and_optimized": true, + "coverage": [ + "dense scalar full fault matrix", + "Gauss-Jordan inverse prefixes", + "noncommuting 2x2 unitary oracle", + "all-cut fault envelope", + "source hash mutation", + "compensation omission", + "cleanup coefficient sign", + "dirty-buffer leakage", + "private-buffer return", + "protected emit targets" + ] + }, + "main_checkpoint": { + "utc": "2026-10-19T08:05:10Z", + "commit": "20ecf2891d80b5acf18d980b2164fb44ea7faa90", + "priority_revision": 6, + "pr3945_head": "91f81d131252db704f945891da1ea54e29d46b8b" + }, + "overlap": { + "open_pr_bodies": 690, + "pages": 7, + "utc": "2026-10-19T08:06:26Z", + "discussions": "partial live1166/3945 coverage; no novelty certificate" + }, + "bounded_root_review": "Root separately read the proof and critical forward/backward/inverse-prefix code; no actionable mathematical issue found. This is a bounded same-team review, not independent human approval.", + "failed_setup_attempts": [ + "Metadata checker was initially passed an absolute package path; corrected to repository-relative research/.", + "TASK.evidence was a list and outcome was descriptive prose; corrected to schema-compliant string and completed enum before validation." + ], + "unrun": [ + "Physical native arithmetic/phase compiler replay", + "Actual recursive frame-conversion defect implementation", + "Exact borrowed-bit restoration after rounding", + "Full owner/stock/tape and selected-stage uniform admission", + "Lean/proof-kernel verification" + ], + "registered_replay": { + "utc": "2026-10-19T08:13:48.585703+00:00", + "seconds": 97.69, + "exit_code": 0, + "science_bytes_unchanged": true, + "science_sha256": { + "FROZEN-SOURCES.json": "df79202c0c5eef8b020a592c1eee78f3aec6518590d9b6d6721051703c95c754", + "RESULT.json": "5a524cb440e59d0a02d953d4d8f04b2441cfbbb736b39f77985eccc106f4a54f", + "VERIFY.json": "fc63d4afb369338a058e18e6a989296a8ddda06fd6cba3a6228b4ecaad70f094", + "inputs/WORD-base.json.gz": "08e6c96fbe3dfec96cb8451b3867ef8c1a214109ecd1e5af7fcc28e0f05728d0", + "inputs/WORD-extra.json.gz": "d83c2ec9cecc0ad092d34ea4080b28a4fd7199579356b6d5a8fc6cd53ff93299", + "inputs/old-WORD-base.json.gz": "5ca4be99851f8878cbfe0fd6c454df926b11218f17feefa1664721cf03156699", + "inputs/old-WORD-extra.json.gz": "965268a9be73d3f62e7ef680d18f108cf064bfe1f44b82157baa61443232904e", + "test_controls.py": "e5258abc549e49072432738feec3d837f904105abe778fab9737b89ed1d4d83a", + "verify.py": "27a707b93730b73fbd90c7b6b8a9c3378a0b0344a95000b5bfe9248d24c0b05d" + }, + "log": "registered-final.log", + "command": "python3 scripts/research_package.py --package research/staged544-internal-error-transfer" + }, + "standalone_full_replay": { + "utc": "2026-10-19T08:11:29.318032+00:00", + "seconds": 83.766, + "science_exit": 0, + "controls_exit": 0, + "all_export_bytes_unchanged": true, + "files": 19, + "git_free": true, + "read_only_copy": true + }, + "standalone_updated_controls": { + "utc": "2026-10-19T08:12:37.490971+00:00", + "seconds": 25.25, + "science_reused": "unchanged verify.py and RESULT.json; standalone full replay83.766s", + "science_exit": 0, + "controls_exit": 0, + "all_export_bytes_unchanged": true, + "files": 19, + "git_free": true, + "read_only_copy": true + }, + "review_fix": "Production source-mutation control replaced a bare hash-predicate test; final97.690s registered run includes the actual source-corruption rejection and unchanged frozen scientific bytes." +} diff --git a/research/staged544-internal-error-transfer/VERIFY.json b/research/staged544-internal-error-transfer/VERIFY.json new file mode 100644 index 0000000000..4aeab155e3 --- /dev/null +++ b/research/staged544-internal-error-transfer/VERIFY.json @@ -0,0 +1,28 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [], + "commands": [ + { + "argv": [ + "{python}", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 500, + "checks": "Fresh exact eight provider/orientation internal-error certificates, complete dirty endpoint and forward/reverse equality." + }, + { + "argv": [ + "{python}", + "-O", + "-B", + "{package}/test_controls.py" + ], + "timeout_seconds": 180, + "checks": "Independent dense/noncommuting oracles, inverse-prefix and source/semantic mutations; explicit checks remain active under optimization." + } + ] +} diff --git a/research/staged544-internal-error-transfer/inputs/WORD-base.json.gz b/research/staged544-internal-error-transfer/inputs/WORD-base.json.gz new file mode 100644 index 0000000000..806784bf99 Binary files /dev/null and b/research/staged544-internal-error-transfer/inputs/WORD-base.json.gz differ diff --git a/research/staged544-internal-error-transfer/inputs/WORD-extra.json.gz b/research/staged544-internal-error-transfer/inputs/WORD-extra.json.gz new file mode 100644 index 0000000000..c531be7383 Binary files /dev/null and b/research/staged544-internal-error-transfer/inputs/WORD-extra.json.gz differ diff --git a/research/staged544-internal-error-transfer/inputs/old-WORD-base.json.gz b/research/staged544-internal-error-transfer/inputs/old-WORD-base.json.gz new file mode 100644 index 0000000000..674ea18ade Binary files /dev/null and b/research/staged544-internal-error-transfer/inputs/old-WORD-base.json.gz differ diff --git a/research/staged544-internal-error-transfer/inputs/old-WORD-extra.json.gz b/research/staged544-internal-error-transfer/inputs/old-WORD-extra.json.gz new file mode 100644 index 0000000000..b17e2be67e Binary files /dev/null and b/research/staged544-internal-error-transfer/inputs/old-WORD-extra.json.gz differ diff --git a/research/staged544-internal-error-transfer/test_controls.py b/research/staged544-internal-error-transfer/test_controls.py new file mode 100644 index 0000000000..8485a1d7b5 --- /dev/null +++ b/research/staged544-internal-error-transfer/test_controls.py @@ -0,0 +1,121 @@ +"""Independent dense oracles and discriminating mutations; Apache-2.0.""" +from fractions import Fraction as Q +import copy,gzip,json,subprocess,sys,tempfile +import verify as v + +def matmul(a,b):return [[sum((x*y for x,y in zip(row,col)),Q(0)) for col in zip(*b)] for row in a] +def eye(n):return [[Q(i==j) for j in range(n)] for i in range(n)] +def direct(seq,n,blocks=1,operators=None,inject=None): + M=eye(n*blocks) + for i,g in enumerate(seq): + G=eye(n*blocks);kind,t=g[:2] + if kind=='add': + W=eye(blocks) + for op in reversed(g[4]):W=matmul(operators[op],W) + for x in range(blocks): + for y in range(blocks):G[t*blocks+x][g[2]*blocks+y]+=g[3]*W[x][y] + elif kind=='scale': + for x in range(blocks):G[t*blocks+x][t*blocks+x]=g[2] + else: + for x in range(blocks): + for y in range(blocks):G[t*blocks+x][t*blocks+y]=operators[g[2]][x][y] + M=matmul(G,M) + return M + +def evaluate_rows(rows,n,operators): + out=[[Q(0) for _ in range(n*2)] for _ in range(n*2)] + for r,row in rows.items(): + for (s,word),q in row.items(): + W=eye(2) + for op in reversed(word):W=matmul(operators[op],W) + for x in range(2): + for y in range(2):out[2*r+x][2*s+y]+=q*W[x][y] + return out + +def main(): + seq=[('add',0,1,Q(2),(),'a'),('scale',1,Q(-1,2),'a'),('add',2,0,Q(3,4),(),'b'),('add',0,1,Q(4),(),'b'),('scale',2,Q(2),'b'),('add',1,2,Q(-1),(),'c')] + rows,fw=v.forward([0,1,2],seq);cols,fault,rw=v.backward([0,1,2],seq);M=direct(seq,3) + for r in range(3): + for s in range(3):v.need(rows[r].get((s,()),0)==M[r][s],'dense endpoint') + expected=[Q(0)]*3 + for i,g in enumerate(seq): + suffix=direct(seq[i+1:],3) + for r in range(3):expected[r]+=abs(suffix[r][g[1]]) + v.need(expected==[fault[r] for r in range(3)],'independent dense fault oracle') + def inverse(M): + n=len(M);A=[list(row)+e for row,e in zip(M,eye(n))] + for c in range(n): + pivot=next(i for i in range(c,n) if A[i][c]);A[c],A[pivot]=A[pivot],A[c];q=A[c][c];A[c]=[x/q for x in A[c]] + for r in range(n): + if r!=c: + q=A[r][c];A[r]=[x-q*y for x,y in zip(A[r],A[c])] + return [row[n:] for row in A] + peak=Q(3);column_sum=Q(0);full_sum=Q(3) + for i,g in enumerate(seq): + B=inverse(direct(seq[:i+1],3));peak=max(peak,sum(max(abs(row[c]) for row in B) for c in range(3)));column_sum+=max(abs(row[g[1]]) for row in B);full_sum+=sum(max(abs(row[c]) for row in B) for c in range(3)) + inv=v.inverse_prefix([0,1,2],seq) + v.need(Q(inv['inverse_prefix_column_sum_bound'])==peak,'dense inverse-prefix range') + v.need(Q(inv['inverse_prefix_fault_column_sum'])==column_sum,'dense inverse-prefix fault columns') + v.need(Q(inv['inverse_prefix_full_state_cut_sum'])==full_sum,'dense all-register cut transfer') + R=[[Q(0),Q(-1)],[Q(1),Q(0)]];Ri=[[Q(0),Q(1)],[Q(-1),Q(0)]];F=[[Q(1),Q(0)],[Q(0),Q(-1)]] + ops={1:R,-1:Ri,2:F,-2:F} + a=[('warp',0,1,'a'),('add',1,0,Q(-3,2),(2,1),'b'),('warp',0,-1,'c'),('add',2,1,Q(1,4),(-2,),'c')] + rows,_=v.forward([0,1,2],a);v.need(evaluate_rows(rows,3,ops)==direct(a,3,2,ops),'noncommuting dense oracle') + def inverse_capture(i,cols): + rows={r:{} for r in range(3)} + for source,col in cols.items(): + for (target,word),q in col.items():rows[target][source,word]=q + v.need(evaluate_rows(rows,3,ops)==inverse(direct(a[:i+1],3,2,ops)),'noncommuting inverse-prefix oracle') + v.inverse_prefix([0,1,2],a,capture=inverse_capture) + v.need(v.reduce_word((1,2),(-2,-1))==(),'inverse cancellation') + v.need(v.reduce_word((1,2),(-1,-2))==(1,2,-1,-2),'do not commute') + v.need(v.max_bits(Q(1335))==11 and v.max_bits(Q(4841))==13,'guard bits') + # The all-cut positive path bounds dominate every concrete prefix fault sum. + A=Q(fw['positive_path_all_cut_fault_gain']) + for stop in range(1,len(seq)+1): + sums=[Q(0)]*3 + for i,g in enumerate(seq[:stop]): + S=direct(seq[i+1:stop],3) + for r in range(3):sums[r]+=abs(S[r][g[1]]) + v.need(max(sums)<=A,'all-cut fault envelope') + # Input/source mutation rejects before expensive scientific work. + b=(v.P/'inputs/WORD-base.json.gz').read_bytes();meta=json.loads((v.P/'FROZEN-SOURCES.json').read_text())['files']['inputs/WORD-base.json.gz'] + v.need(v.hashlib.sha256(b+b' ').hexdigest()!=meta['sha256'],'source mutation predicate') + with tempfile.TemporaryDirectory() as d: + root=v.Path(d);(root/'verify.py').write_bytes((v.P/'verify.py').read_bytes());(root/'FROZEN-SOURCES.json').write_bytes((v.P/'FROZEN-SOURCES.json').read_bytes()) + first=next(iter(json.loads((v.P/'FROZEN-SOURCES.json').read_text())['files'])) + target=root/first;target.parent.mkdir(parents=True);target.write_bytes((v.P/first).read_bytes()+b' ') + r=subprocess.run([sys.executable,'-B',str(root/'verify.py')],capture_output=True,text=True) + v.need(r.returncode!=0 and 'source hash '+first in r.stderr and 'checked ' not in r.stdout,'production source mutation rejection') + # Production omission of compensation must violate actual endpoint identity. + w=json.loads(gzip.decompress(b));z=copy.deepcopy(w);z['compensation']=[] + rejected=[] + try:v.analyze(z) + except ValueError as e: + v.need(str(e)=='live-input shear contract','wrong compensation rejection');rejected.append('omit compensation') + else:raise ValueError('accepted missing compensation') + # One bad cleanup scalar must spoil the full arbitrary-dirty identity. + z=copy.deepcopy(w);g=next(g for g in z['cleanup'] if g[0]=='add');g[3]=-g[3] + try:v.analyze(z) + except ValueError as e: + v.need(str(e) in ('private buffer identity','live-input shear contract'),'wrong cleanup rejection');rejected.append('flip cleanup coefficient') + else:raise ValueError('accepted cleanup corruption') + z=copy.deepcopy(w);buf=704+min(map(int,w['helper_final']));z['cleanup'].append(['add',112,buf,1,1,[]]) + try:v.analyze(z) + except ValueError as e: + v.need(str(e)=='private buffer leakage','wrong buffer-leak rejection');rejected.append('inject dirty buffer into live target') + else:raise ValueError('accepted dirty-buffer leakage') + z=copy.deepcopy(w);z['cleanup'].append(['scale',buf,2,1,[]]) + try:v.analyze(z) + except ValueError as e: + v.need(str(e)=='private buffer identity','wrong buffer-return rejection');rejected.append('double private buffer return') + else:raise ValueError('accepted dirty-buffer self-map corruption') + protected=v.P/'RESULT.json';before=protected.read_bytes() + r=subprocess.run([sys.executable,'-B',str(v.P/'verify.py'),'--emit',str(protected)],capture_output=True,text=True) + v.need(r.returncode!=0 and 'outside frozen package' in r.stderr and protected.read_bytes()==before,'emit protects frozen package') + with tempfile.TemporaryDirectory() as d: + p=v.Path(d)/'existing.json';p.write_text('sentinel') + r=subprocess.run([sys.executable,'-B',str(v.P/'verify.py'),'--emit',str(p)],capture_output=True,text=True) + v.need(r.returncode!=0 and 'already exists' in r.stderr and p.read_text()=='sentinel','emit protects existing output') + print(json.dumps({'PASS':True,'dense_scalar_fault_oracle':True,'noncommuting_unitary_oracle':True,'all_cut_fault_envelope':True,'source_mutation':True,'production_rejections':rejected},sort_keys=True)) +if __name__=='__main__':main() diff --git a/research/staged544-internal-error-transfer/verify.py b/research/staged544-internal-error-transfer/verify.py new file mode 100644 index 0000000000..44db9dbc69 --- /dev/null +++ b/research/staged544-internal-error-transfer/verify.py @@ -0,0 +1,162 @@ +"""Source-bound completed-word internal error transfer; Apache-2.0. +Chris R/Clear1nsight with OpenAI Codex assistance. No predecessor evaluator imports. +""" +import argparse,gzip,hashlib,json,time +from pathlib import Path +from fractions import Fraction as Q +from collections import Counter,defaultdict +P=Path(__file__).resolve().parent +N=704 + +def need(x,msg): + if not x: raise ValueError(msg) +def canonical(x):return json.dumps(x,sort_keys=True,separators=(',',':')).encode() +def digest(x):return hashlib.sha256(canonical(x)).hexdigest() +def reduce_word(a,b): + z=list(a) + for x in b: + if z and z[-1]==-x:z.pop() + else:z.append(x) + return tuple(z) +def opdual(x):return (1 if x>0 else -1)*(abs(x)+1000000) +def program(w,dual=False): + seq=[] + for c in w['initial_corrections']:seq.append(('add',c['target'],c['source'],Q(c['coefficient']),tuple(c['operator_word']),'correction')) + def append(g,phase): + if g[0]=='add':seq.append(('add',g[1],g[2],Q(g[3],g[4]),(),phase)) + elif g[0]=='scale':seq.append(('scale',g[1],Q(g[2],g[3]),phase)) + else: + need(g[0]=='warp','opcode');seq.append(('warp',g[1],g[2],phase)) + for phase in ('precondition','compensation','A','cut'): + for g in w[phase]:append(g,phase) + at=defaultdict(list) + for i,g in enumerate(w['warps'],1):at[g[0]].append(('warp',g[1],i,'B-native')) + for i in range(len(w['B'])+1): + seq.extend(at[i]) + if i=0,'negative bound');b=0 + while Q(2)**bpeak:peak=bound;witness=[i,g[-1],t] + return rows,{'all_cut_l1_bound':str(peak),'all_cut_guard_bits':max_bits(peak),'peak_witness':witness,'phase_touched_register_max':{k:str(v) for k,v in phases.items()},'cut_stream_sha256':trace.hexdigest(),'positive_path_all_cut_fault_gain':str(error_peak),'exact_operand_l1_bound':str(operand_peak),'max_local_lipschitz':str(local_lipschitz)} + +def backward(regs,seq): + cols={r:{(r,()):Q(1)} for r in regs};fault={r:Q(0) for r in regs};byphase=defaultdict(lambda:defaultdict(Q));maxfault=Q(0);witness=None;trace=hashlib.sha256() + for i in range(len(seq)-1,-1,-1): + g=seq[i];kind,t=g[:2];per=defaultdict(Q) + for (out,wd),a in cols[t].items():per[out]+=abs(a) + for out,a in per.items():fault[out]+=a;byphase[g[-1]][out]+=a + m=max(per.values(),default=Q(0));trace.update(canonical([i,[[r,str(a)] for r,a in sorted(per.items())]])) + if m>maxfault:maxfault=m;witness=[i,g[-1],t] + if kind=='add':update(cols[g[2]],cols[t],g[3],g[4],True) + elif kind=='scale':cols[t]={k:g[2]*a for k,a in cols[t].items()} + else:cols[t]={(r,reduce_word(wd,(g[2],))):a for (r,wd),a in cols[t].items()} + return cols,fault,{'max_single_fault_gain':str(maxfault),'single_fault_witness':witness,'fault_stream_sha256':trace.hexdigest(),'phase_output_error_bounds':{p:str(max(v.values())) for p,v in byphase.items()}} + +def inverse_prefix(regs,seq,capture=None): + # Columns of L_k^{-1}; right multiplication by each next inverse gate. + cols={r:{(r,()):Q(1)} for r in regs};bounds={r:Q(1) for r in regs};total=Q(len(regs));peak=total;full_cut_sum=total;fault_sum=Q(0);trace=hashlib.sha256() + def column_bound(row): + per=defaultdict(Q) + for (r,wd),a in row.items():per[r]+=abs(a) + return max(per.values(),default=Q(0)) + for i,g in enumerate(seq): + kind,t=g[:2] + if kind=='add': + s=g[2];update(cols[s],cols[t],-g[3],g[4],True);new=column_bound(cols[s]);total+=new-bounds[s];bounds[s]=new + elif kind=='scale': + cols[t]={k:a/g[2] for k,a in cols[t].items()};new=bounds[t]/abs(g[2]);total+=new-bounds[t];bounds[t]=new + else:cols[t]={(r,reduce_word(wd,(-g[2],))):a for (r,wd),a in cols[t].items()} + if capture is not None:capture(i,cols) + peak=max(peak,total);full_cut_sum+=total;h=bounds[t];fault_sum+=h;trace.update(canonical([i,str(h)])) + return {'inverse_prefix_column_sum_bound':str(peak),'inverse_prefix_fault_column_sum':str(fault_sum),'inverse_prefix_full_state_cut_sum':str(full_cut_sum),'inverse_prefix_stream_sha256':trace.hexdigest()} + +def analyze(w,dual=False): + live=sorted(set(range(N))-set(w['removed']));buffers=[r+N for r in sorted(map(int,w['helper_final']))];regs=live+buffers + seq=program(w,dual);rows,fwd=forward(regs,seq);cols,fault,rev=backward(regs,seq) + for r,row in rows.items(): + other={(s,wd):a for s,col in cols.items() for (o,wd),a in col.items() if o==r} + need(row==other,'forward/reverse operator disagreement') + categories={'all':regs,'live':live,'sources':list(range(112)),'targets':list(range(112,224)),'helpers':[r for r in live if r>=224],'private_buffers':buffers} + end={k:max(norm(rows[r]) for r in v) for k,v in categories.items()} + err={k:max(fault[r] for r in v) for k,v in categories.items()} + leakage={r:{k:a for k,a in rows[r].items() if k[0]>=N} for r in live} + leakmax=max(map(norm,leakage.values()));need(leakmax==0,'private buffer leakage');leakrow=next(r for r in live if norm(leakage[r])==leakmax) + leakproof=[[s,list(wd),str(a)] for (s,wd),a in sorted(leakage[leakrow].items())] + buffer_identity=all(rows[r]=={(r,()):Q(1)} for r in buffers) + need(buffer_identity,'private buffer identity') + target_zero=[] + for r in live: + expected={(r,()):Q(1)} + if not dual and 112<=r<224:expected[(r-112,())]=Q(1) + if dual and r<112:expected[(r+112,())]=Q(-1) + if {k:a for k,a in rows[r].items() if k[0]