diff --git a/.github/workflows/p112-common-slice.yml b/.github/workflows/p112-common-slice.yml index 37f99ca573..48047f61c4 100644 --- a/.github/workflows/p112-common-slice.yml +++ b/.github/workflows/p112-common-slice.yml @@ -15,9 +15,9 @@ jobs: if: github.repository == 'CrocSwap/integer-mult-bounds' runs-on: ubuntu-24.04 timeout-minutes: 20 - env: - TMPDIR: ${{ runner.temp }}/p112-common-slice steps: + - name: Initialise P112 work directory + run: echo "TMPDIR=$RUNNER_TEMP/p112-common-slice" >> "$GITHUB_ENV" - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 with: fetch-depth: 0 diff --git a/research/p104-restored-query/COSTS.md b/research/p104-restored-query/COSTS.md new file mode 100644 index 0000000000..19f3e00c33 --- /dev/null +++ b/research/p104-restored-query/COSTS.md @@ -0,0 +1,261 @@ +# Arithmetic, ownership, and width of the restored query + +This ledger separates the explicit strict direct schedules from the source +program's native and weighted-ADD inventory. All counts are constructive +logical counts for the stated model, not minima, physical tape tariffs, or +a recursive multiplication invoice. The [proof](PROOF.md) gives the exact +common coefficient/query interface and source restoration. + +## 1. The two direct invoices + +Let \(n=2^r\), \(p=rn/2\), and +\(T=(2,9,16,27,51)\). Both schedules implement +\(q\mathrel{+}=E_r\sum_{t\in T}a_t\) and return all 52 coefficients. +The finite implementation accepts ranks 0 through 9; the source caller has +r=9. The five separate dirty D banks are unchanged and may be carried through. + +The owned-zero-bank mode performs five full-bank gathers, one Q ADD, +and five ungathers. The temporary-terminal mode performs four gathers, +one Q ADD, and four ungathers, temporarily using \(a_2\). +Both use E and its inverse once. The strict lowering below gives + +\[ +A_{\rm zero}=14p+22n,\qquad A_{\rm terminal}=14p+18n,\qquad +D=p,\qquad H_{\rm exact}=2p, +\] + +where A excludes doubling, D counts explicit real doubling, and H counts +checked exact real halving. + +| Rank-nine quantity | Owned zero bank | Temporary terminal bank | +|---|---:|---:| +| Gaussian entries per bank | 512 | 512 | +| Newton pairs per direction | 2,304 | 2,304 | +| Full Gaussian-bank ADD/SUBs | 11 | 9 | +| Strict real ADD/SUB, excluding doubling | 43,520 | 41,472 | +| Real doublings | 2,304 | 2,304 | +| Exact real halves | 4,608 | 4,608 | +| ADD/SUB when a doubling costs one ADD | 45,824 | 43,776 | +| Additional Gaussian banks | 1 | 0 | +| Separate real zero scratch words | 1 | 1 | +| Gaussian zero-bank initialization/erasure | 1 each | 0 | +| Real scratch initialization/final disposal | 1 each | 1 each | + +The real scratch has 4,608 verified zero exits, one after every multiplication +or division by \(\pi\), and is zero at the final boundary. The temporary-terminal +mode returns its initially dirty work bank; it does not assume that bank is zero. +All 52 coefficient banks remain named outputs. Their storage cannot be discarded +because the query ignores 47 of them. + +For chosen real-doubling and exact-halving tariffs \(\delta,\eta\), the arithmetic +subtotal is \(A+\delta D+\eta H_{\rm exact}\), plus the specified ownership, +zero, control, access, and storage costs. Unknown tariffs are not assigned zero. + +## 2. Strict real-register lowering + +The allowed updates are \(x\mathrel{+}=y\), \(x\mathrel{-}=y\) on distinct +registers, an explicitly counted doubling, and an exact half checked before +division. There is no unpriced assignment \(x\leftarrow y-x\). + +With \(\tau=0\), multiplication of the Gaussian word \((a,b)\) by \(\pi=1+i\) +uses the following updates in order: + +| Step | Update | +|---:|---| +| 1 | \(\tau\mathrel{+}=a\) | +| 2 | \(a\mathrel{-}=b\) | +| 3 | \(b\mathrel{+}=\tau\) | +| 4 | \(\tau\leftarrow2\tau\) | +| 5 | \(\tau\mathrel{-}=a\) | +| 6 | \(\tau\mathrel{-}=b\) | + +Writing the original components as \(a_0,b_0\), the result is +\((a_0-b_0,a_0+b_0)\). The last three scratch states are +\(2a_0,a_0+b_0,0\). This costs five ADD/SUBs and one doubling. + +Division on the true image of \(\pi\) uses: + +| Step | Update | +|---:|---| +| 1 | \(\tau\mathrel{+}=a\) | +| 2 | \(\tau\mathrel{+}=b\) | +| 3 | \(\tau\leftarrow\tau/2\), exact | +| 4 | \(b\mathrel{-}=a\) | +| 5 | \(b\leftarrow b/2\), exact | +| 6 | \(a\mathrel{+}=b\) | +| 7 | \(\tau\mathrel{-}=a\) | + +The two numerators \(a_0+b_0\) and \(b_0-a_0\) are even on this image, +including for negative inputs. The outputs are +\(((a_0+b_0)/2,(b_0-a_0)/2)\), and scratch is zero. +This costs five ADD/SUBs and two exact halves. + +One forward Newton pair \((u,v)\mapsto(u,u+\pi v)\) first multiplies the high +Gaussian word by \(\pi\), then adds the low word: seven real ADD/SUBs and one +doubling. The inverse first subtracts the low word, then divides by \(\pi\): +seven ADD/SUBs and two exact halves. Encoding visits address bits ascending; +decoding visits them descending. The Q update leaves the work bank unchanged, +so all inverse divisions are on the preceding actual image. + +The strict machine records every arithmetic update and checks its count and +width. Its Python implementation copies arrays for comparison; Python object +allocation is not the storage invoice of the logical in-place schedule. +Equal-valued distinct banks are admitted. Aliased banks, query aliasing, +duplicate terminal slots, Boolean integer fields, dirty real scratch, and +unavailable signed exact halves have explicit rejection controls. + +## 3. Finite signed widths for the direct schedules + +Let H bound all real and imaginary input coefficient components and J bound +those of Q. The sum of five terminals has component bound \(5H\). +The exact maximum real absolute row sum of E is + +\[ +g_r=\sum_{k=0}^r\binom rk +\bigl(|\operatorname{Re}\pi^k|+|\operatorname{Im}\pi^k|\bigr). +\] + +This follows from \((E_ra)_x=\sum_{s\subseteq x}\pi^{|s|}a_s\). In particular, +\(g_9=3363\). Disjoint coefficient supports in a Newton pair show that both +its complete boundary and its pre-low-ADD value are bounded by \(5g_rH\). +Decoding follows those same image values in reverse. + +Scratch sums and differences in the strict \(\pi\) programs are covered by +the conservative factor four over that payload bound. Therefore + +| Quantity | Sufficient rank-nine component bound | +|---|---| +| Stored encoded terminal sum | \(16{,}815H\) | +| Every non-query real arithmetic register | \(67{,}260H\) | +| Query register | \(J+16{,}815H\) | + +Gather and ungather partial sums are bounded by \(5H\), and unvisited +coefficients keep their H bound. A sign bit plus enough magnitude bits for +\(\max(67{,}260H,J+16{,}815H)\) suffices. No extra fractional precision is +required. These conservative bounds are checked against observed peaks after +every strict primitive; the Python model uses unbounded integers and does not +simulate fixed-width overflow. Physical signed representation is still a +caller implementation obligation. + +## 4. Exact inventory of the literal core + +The 257-event producer, 15-event first collector, and 252-event selective +return have the following source-bound inventory. Codec preparation and +decoding are additional, as in the next section. + +| Quantity | Count | +|---|---:| +| Core events | 524 | +| Native occurrences | 402 | +| Native rank mass | 722 | +| Completed native pairs | 184,832 | +| Forward / inverse native pairs | 94,208 / 90,624 | +| Monomial wrapper occurrences | 804 | +| Wrapper permutation cycles | 23,168 | +| Direct Gaussian payload SWAPs | 388,480 | +| Weighted ADDs | 120 | +| Quarter / unit ADDs | 104 / 16 | +| Private C zero / zero erase | 1 / 1 | + +Each rank unit acts on 256 pairs. A wrapper cycle of length l uses \(l-1\) +Gaussian payload SWAPs, giving \(804(512)-23168=388480\). Inversion preserves +cycle lengths. The 411,648 wrapper entries have phase histogram + +| Phase multiplier | Entries | +|---|---:| +| 1 | 142,512 | +| i | 78,336 | +| -1 | 112,464 | +| -i | 78,336 | + +The histogram does not identify the operator: the actual permutation, phase +placement, and event order are bound and executed separately. Each literal +pair also has a Gaussian quarter turn. + +Using the inherited pair's component formula, before wrapper/phase lowering, +the component arithmetic inventory is: + +| Component operation | Count | +|---|---:| +| ADD/SUB evaluations: \(8(184832)+1024(120)\) | 1,601,536 | +| Native signed-floor half evaluations: \(4(184832)\) | 739,328 | +| Exact real halves for the quarter donors | 212,992 | +| Doublings restoring those quarter donors | 212,992 | +| Native Gaussian quarter turns | 184,832 | + +The quarter count includes a closed donor-preserving implementation: +temporarily divide each donor real component twice, perform the signed ADD, +and double that donor component twice to restore it. Each quarter bank operation +therefore has 2,048 exact halves, 1,024 ADD/SUBs, and 2,048 doublings. +Its donor is Gaussian-divisible by four at the actual read, and this owned-source +caller permits the temporary mutation. A strictly read-only donor would instead +need a separately priced divided-copy and cleanup implementation. + +The native signed-floor formula, wrapper SWAPs, and phase applications remain +named native/component operations in this table. Their full strict physical +lowering, arithmetic scratch, address/control work, and tariffs are not included +in the 1,601,536 subtotal. In particular, it is not advertised as a complete +strict-register bill comparable term-for-term with section 1. The direct +schedules have no native transports, wrapper permutations, or quarter ADDs; +this is an explicit structural simplification for the declared coefficient +interface, not a proof of platform-independent speedup or global optimality. + +The primary receipt's measured core peak is explicitly the maximum at +whole-event bank boundaries. It does not measure internal native scratch, +codec intermediates, physical control, or finite-width overflow. + +## 5. Both codec directions remain in the reference caller + +The retained [PR3467 cost ledger](inputs/PR3467_COSTS.md) prices its explicit +52-bank codec. It is included byte-for-byte and credited, rather than rerun as +a new historical cost theorem. Per direction it uses 158 native occurrences, +rank mass 281, 71,936 native pairs, 331 monomial wrappers, and 159,020 Gaussian +payload SWAPs. Across both directions, the closed reference therefore contains: + +| Structural operation, codecs plus core | Count | +|---|---:| +| Native occurrences | \(158+402+158=718\) | +| Native rank mass | \(281+722+281=1284\) | +| Native pairs | \(71936+184832+71936=328704\) | +| Monomial wrappers | \(331+804+331=1466\) | +| Gaussian payload SWAPs | \(159020+388480+159020=706520\) | + +The encoder also has 119,808 Gaussian Newton ADDs, 129,992 Gaussian +multiplications by \(\pi\) including profiles, 5,120 Gaussian doublings for +positive terminal 4, and 47 full-bank differences. The decoder reverses those +operations with checked exact divisions and full-bank partial sums. + +The inherited ledger distinguishes its component-arithmetic counts from the +repository's strict ADD tariff: its optional three-step component SWAP permits +a source-minus-target overwrite. Those optional totals are not combined with +the strict direct schedule here. Any full strict lowering of that reference +codec must also price its arithmetic scratch, phases, and ownership contract. + +Inherited sufficient coefficient-to-prepared-Y width is \(244992H\) per real +component, with a \(612480H\) bound for the named encoder's pair work. Its inverse +ledger gives bounds for an admitted prepared-Y input. These are scoped to that +codec and are not silently used as a full physical-controller width certificate. + +## 6. Obligation and decision ledger + +| Obligation | Status | Evidence or remaining work | +|---|---|---| +| Exact closed coefficient/query identity | Proved, locally replayed | Selective return in PROOF; two literal implementations and full-array agreement | +| Terminal slots, source frames, dirty compensation | Source-bound and checked | Frozen WORD/NATIVE, explicit event list and adverse controls | +| Larger-domain observable quotient | Proved, formula/fixture checked | Shared five-active section and kernel quotient; no new readout range | +| All coefficient and dirty-D outputs returned | Proved and checked | Both caller implementations; both strict direct schedules | +| Direct logical arithmetic and zero cleanup | Constructive upper bounds | Strict primitive traces, exact half checks, zero exits and invoices | +| Direct finite signed widths | Proved conservative bounds | Row-sum argument and per-primitive observed peaks | +| Native/core/codec structural inventory | Source-bound or credited | Core counted here; exact inherited codec ledger retained | +| Physical caller with these coefficient meanings | Unknown | Name an actual supplied input and required output contract | +| Physical zero generation, addressing, routing, control, primitive tariffs | Unknown | Specify and price the actual implementation | +| Omitted full-prefix histories and external ports | Outside scope | Use or audit the distinct predecessor scopes; no closure inferred here | +| Fast recursive realization and complete supplier budget | Unknown | A changed fully paid route is required | + +**Family decision: narrow and stop at this caller/observability audit.** +The result resolves a named acceptance gap: a large entrance index alone does +not create an enlarged collector range or a new query. It also supplies an +exact returned alternative in two ownership contracts. The unchanged-profile +599/584 stop, all original hypotheses, and the selected frontier remain intact. +A further round needs a different actual observable/caller or a changed, +fully priced mechanism that can affect the supplier decision. diff --git a/research/p104-restored-query/PROOF.md b/research/p104-restored-query/PROOF.md new file mode 100644 index 0000000000..e80f81ab1c --- /dev/null +++ b/research/p104-restored-query/PROOF.md @@ -0,0 +1,296 @@ +# A restored coefficient caller factors through one Newton query + +Clear1nsight, with substantial OpenAI assistance. This is a scoped written +proof with a bounded finite replay, not a formal proof-kernel certificate. +The original word, recipes, stagewise domain, and their credit are preserved. + +## 1. Statement and exact boundary + +Let \(R=\mathbb Z[i]\), \(\pi=1+i\), \(N=512\), and + +\[ +E_r=\begin{pmatrix}1&0\\1&\pi\end{pmatrix}^{\otimes r}, +\qquad B_r=E_rR^{2^r},\qquad B=B_9. +\] + +The inputs are 52 separately owned Gaussian coefficient banks +\(a_0,\ldots,a_{51}\in R^N\), five distinct dirty banks +\(d_{31},d_{30},d_{29},d_{28},d_{27}\in B\), and a separate dirty query +\(q\in B\). All public frames are initially empty. The coefficient meanings +are those of PR #3467's encoder \(K:R^{52N}\to L\), recalled below. They +are not arbitrary pre-existing raw Y values. + +Consider this **new closed program**: + +1. Apply \(K\), obtaining the 52 prepared Y banks. +2. Execute the actual 257-event producer dependency cone before event 2025. +3. Execute the actual first collector, events 2025 through 2039. +4. Traverse the selected producer events in reverse, applying their inverses + except for the five Q compensation ADDs at 908, 910, 912, 914, and 916. +5. Apply \(K^{-1}\) to the returned Y banks. + +Then every coefficient bank and every dirty D bank is returned exactly, every +public frame is empty, private C is erased at zero, and + +\[ +q_{\rm out}=q+E_9(a_2+a_9+a_{16}+a_{27}+a_{51}). \tag{1} +\] + +The literal core in steps 2--4 has 524 events. Its return is appended by this +construction; it is not asserted to occur in the original 5,398-event word. +The source cone excludes 1,768 events of the full 2,025-event prefix. The +theorem does not execute or admit those omitted recipient histories or the +675 external ports. The distinct full-prefix result in PR #3466 and the +omitted adapters in PR #3469 are not replaced by this theorem. + +## 2. Inherited entrance theorem and coefficient meanings + +The retained [PR3467 proof](inputs/PR3467_PROOF.md) classifies \(L\subset B^{52}\): +the maximal module in that stated initial domain for which all cone quarter +increments are integral, every completed literal native pair equals its ideal +Gaussian gate, and all six cut banks lie in \(B\). It does not classify genuinely +rounded paths whose later errors cancel. + +In the actual read order of each D group, write +\(p_t=y_1+\cdots+y_t\), with \(p_0=0\). The change from the Y values to these +partial sums is unimodular. PR #3467 separately parameterizes 32 intervals +without a D transport, 15 intervals with one actual rank-one D transport, and +five terminal intervals. Nonterminal profiles use respectively + +\[ +E_9\operatorname{diag}(\pi^{\max(4-|S|,0)}),\qquad +E_9\operatorname{diag}(\pi^{\max(4-|S\setminus\{0\}|,0)}), +\] + +followed, where required, by the inverse right wrapper, then by the specified +actual inverse path. Each terminal partial sum is exactly \(4E_9a_t\), with positive +4; replacing it by \(\pi^4=-4\) would change the coefficient map. Finally, +successive partial sums are differenced into the Y banks. + +We inherit that \(K\) is an \(R\)-module isomorphism onto \(L\), and that + +\[ +S=(4B)^{52}\subset L\subset B^{52},\qquad +[B^{52}:L]=2^{20424},\quad [B^{52}:S]=2^{106496}. \tag{2} +\] + +These are predecessor results, not new lattice classifications here. +The [PR3382 proof](inputs/PR3382_PROOF.md) supplies the Newton invariance and +literal-pair criterion; the [PR3416 proof](inputs/PR3416_PROOF.md) supplies +the actual native covariance including global phase. The +[PR3426 proof](inputs/PR3426_PROOF.md) supplies the ideal five-group condition. +The primary implementation reuses authenticated predecessor code. The second +literal implementation derives its Y paths and arithmetic separately and +imports no predecessor executable, while retaining those written dependencies. + +## 3. The actual producer and collector + +Both implementations derive the dependency cone and the group order from the +frozen WORD and bind every used native occurrence to its old frame, new frame, +rank, and exact recipe. The resulting terminal coordinates are: + +| D group | Number of Y reads | Terminal coefficient slot | Last Y source | Last read event | +|---|---:|---:|---|---:| +| D31 | 3 | 2 | Y99 | 1231 | +| D30 | 7 | 9 | Y100 | 1393 | +| D29 | 7 | 16 | Y66 | 1459 | +| D28 | 11 | 27 | Y72 | 1641 | +| D27 | 24 | 51 | Y80 | 1831 | + +Write \(p_j\) for the terminal partial sum of group \(j\). +The six cut values, with the exact phase conventions of the source, are + +\[ +D_j=A_O(d_j+p_j/4),\qquad +Q7=A_P\left(q-\sum_jd_j\right), \tag{3} +\] + +where + +\[ +O=[256,136,64,40,16,4,2,1],\qquad P=[364]. +\] + +The Q path consists of native event 972. The five negative unit ADDs +into Q occur at 908, 910, 912, 914, and 916, before any Y quarter +enters the respective D. They therefore compensate the initial dirty values. + +The first collector allocates \(C=0\) at O, adds the five D banks into C, +uses the authentic rank-seven O-to-P native at 2031, adds C into Q7 +with coefficient \(+1\) at 2032, uses the authentic reverse native at 2033, +subtracts the five unchanged D banks in reverse order, and erases zero C +at 2039. From (3), after the query ADD its Q value is + +\[ +A_P\left(q-\sum_jd_j+\sum_j(d_j+p_j/4)\right) +=A_P\left(q+\sum_jp_j/4\right). \tag{4} +\] + +The Ds and Ys are untouched by the collector, and all its inputs are in B. +Inherited native invariance and covariance therefore apply. Every literal +completed pair is exact on this domain; an individual internal signed-floor +half is allowed to round. The proof never replaces that criterion by the +stronger and generally false demand that each internal half divide exactly. + +## 4. Why the selective return works + +During the reverse traversal, every D and Y operation sees the same states it +saw in the forward producer, in reverse order. In particular, each inverse +quarter increment is integral. Its donor is restored before that donor is +used again. Each inverse native on D or Y retraces an admitted exact path. + +Q differs from its original producer state only by (4). Its single inverse +native, event 972, maps (4) to \(q+\sum_jp_j/4\). This value lies in B because +each \(p_j/4=E_9a_{t_j}\) lies in B. Thus the changed Q input to that inverse +is also admitted. No further Q operation is executed: the five inverse +compensation ADDs are deliberately absent. The return restores every +prepared Y and every dirty D, and all 58 public frames are empty. + +Applying \(K^{-1}\) now returns every original coefficient bank. Substituting +the five terminal partial sums into (4) gives (1), proving the closed caller. + +Full producer reversal would instead perform the five positive dirty +compensation ADDs at the end. Its exact output is + +\[ +q_{\rm wrong}=q+\sum_jd_j+E_9\sum_{t\in T}a_t,\qquad +T=(2,9,16,27,51). \tag{5} +\] + +This is a concrete failed cleanup when the dirty sum is nonzero, not a generic +interface warning. Both literal implementations check (5) on every coordinate +of the signed dense fixture. Other controls remove inverse 972, alter the +collector phase, change the query sign, or change a return-quarter sign. + +## 5. The enlargement adds no five-readout range + +Define the normalized five-readout map on L by + +\[ +\rho_5(y)=\left(\frac14\sum_{Y\in G_j}y_Y\right)_{j=1}^5 +\in B^5. \tag{6} +\] + +Define \(\sigma:B^5\to S\) by placing \(4b_j\) in the final Y bank of group j +and zero in every other Y bank. The groups are disjoint, and +\(\rho_5\sigma=\operatorname{id}_{B^5}\). In particular, + +\[ +\rho_5(L)=\rho_5(S)=B^5. \tag{7} +\] + +Let \(K_5=\ker(\rho_5|_L)\). For any \(y\in L\), +\(y-\sigma\rho_5(y)\in K_5\); if \(y\in S\), the same difference lies in S. +The shared section gives + +\[ +L=K_5\oplus\sigma(B^5),\qquad +S=(S\cap K_5)\oplus\sigma(B^5). +\] + +Consequently the inclusion of \(K_5\) into L induces an isomorphism + +\[ +L/S\ \cong\ K_5/(S\cap K_5),\qquad |L/S|=2^{86072}. \tag{8} +\] + +This is the precise sense in which the entire relative enlargement has +readout-kernel representatives. **The map \(\rho_5\) does not descend to +L/S:** S itself has nonzero, indeed surjective, readouts. Equation (8) does +not identify a quotient with a literal subset of L. + +For a fixed dirty input, (7) means the larger domain does not enlarge the +range of the five normalized D increments. The five-active section reproduces +all five cut D values and Q's cut value, not merely the final summed query. +It need not reproduce intermediate Y/D values or any omitted external readout. + +## 6. One final increment, with all source information returned + +In the independent coefficient coordinates, + +\[ +\rho_5K(a)=(E_9a_2,E_9a_9,E_9a_{16},E_9a_{27},E_9a_{51}). +\] + +Thus \(\ker(\rho_5K)\) has Gaussian rank \(47N\). Summing the five readouts +gives the increment map + +\[ +\Phi(a)=E_9\sum_{t\in T}a_t,\qquad +\operatorname{rank}_R\Phi=N,\quad +\operatorname{rank}_R\ker\Phi=51N. \tag{9} +\] + +Indeed E is injective, a single terminal coordinate provides a section onto B, +and the terminal sum has four independent difference coordinates in addition +to the 47 nonterminal banks. This specializes the already credited rank-one +port-map observation in PR #3423 to an actual admitted, returned caller; it +does not claim a new general rank-one phenomenon. + +The **complete** map sends \((a,d,q)\) to \((a,d,q+\Phi(a))\). It is reversible: +its inverse subtracts \(\Phi(a)\) from Q. Its coefficient outputs do not +disappear. Kernel rank in (9), and the finite index in (8), are not erased +information, released storage, compressed inputs, or saved physical bits. + +Three source-bound fixtures make the distinctions concrete: + +- Set only \(a_{44}=\delta_{15}\). This slot is Y91 at 1817, followed by + Y90 at 1819, in a zero-transport gap of D27. Its profile exponent is zero, + and its prepared pair is \(p,-p\), where \(A_Op=E_9\delta_{15}\). + At the first quarter read the D increment is \(-1\) on exactly 32 addresses; + the next read cancels it. Since the Newton coefficient \(\delta_{15}\) + is not divisible by 4 and \(A_O\) preserves 4B, \(p\notin4B\). + This is a nonzero class in (8) with zero five-readout and Q increments. +- Set \(a_2=\delta_0,\ a_9=-\delta_0\). The first two readouts are nonzero + opposites, while Q's increment is zero. This fixture already belongs to S + and distinguishes terminal differences from the nonterminal kernel. +- Combine the nonterminal fixture with five distinct signed terminal + coefficient impulses. Compare K(a) with \(\sigma\rho_5K(a)\). + Both have the same five readouts and final increment. The original + nonterminal coefficient remains required in the complete returned output. + +The fixture module checks actual preparation, decoding, source paths, readout +arrays, and both direct schedules. It does not present those formula checks +as additional full literal-core replays. + +## 7. Two direct schedules for exactly this interface + +For a caller lending all coefficients read-only, supply a distinct owned zero +Gaussian bank Z. Gather the five terminal banks into Z, apply E, add Z to Q, +apply the exact inverse E, ungather the five terminals in reverse order, and +erase zero Z. All coefficients remain unchanged throughout. + +For a caller permitting temporary mutation of the first terminal coefficient +bank \(a_2\), gather the other four into that bank, encode it, add it to Q, +decode it, and subtract the other four in reverse order. This restores the +original possibly nonzero \(a_2\) and needs no extra Gaussian bank. The other +51 coefficient banks are read-only. In both modes the five dirty Ds are +untouched, so they can be carried through as unchanged outputs. + +Each direct schedule also uses one separate real zero scratch word. The +strict real-register programs for multiplication and exact division by +\(\pi\), their zero restoration, arithmetic counts, and finite signed-width +proof appear in [COSTS.md](COSTS.md). All inverse divisions are on the actual +image of the preceding encoding, which the Q read leaves unchanged. + +These schedules prove a logical caller equivalence and constructive arithmetic +upper bounds. They do not supply physical addressing, layout, zero generation, +or a fast recursive realization. The larger P104 supplier still needs its +other consumers and complete bill. The inherited 599/584 unchanged-profile +stop and the selected result remain unchanged. + +## 8. What the finite evidence establishes + +The registered verifier authenticates exact inputs and retained proof bytes, +compiles captured source bytes, independently constructs the two literal +executions, and compares full prepared, cut, returned-coefficient, returned-D, +returned-Y, and Q arrays before hashing them. Each dense core executes +524 events and compares 184,832 completed literal pairs with ideal values. +The direct strict-register executions match the same returned arrays and Q. + +The dense fixture is evidence for the implementation and exact source +composition. The universal statements above rely on the written algebra and +the explicitly inherited theorems; they are not inferred by testing one +fixture. Adversarial arithmetic, dirty-state, phase, frame, ownership, source, +and typed-receipt controls are separate from that positive evidence. +No independent human mathematical review is claimed. diff --git a/research/p104-restored-query/README.md b/research/p104-restored-query/README.md new file mode 100644 index 0000000000..81a080f2ef --- /dev/null +++ b/research/p104-restored-query/README.md @@ -0,0 +1,249 @@ +# Restored P104 query and its observable quotient + +**Result:** PR #3467's larger stagewise entrance gives no larger range for the +first collector's five readouts. A source-bound closed caller returns all +52 original coefficient banks and five dirty D banks, and changes Q by exactly + +\[ +Q_{\rm out}=Q_{\rm in}+E_9(a_2+a_9+a_{16}+a_{27}+a_{51}), +\qquad +E_9=\begin{pmatrix}1&0\\1&1+i\end{pmatrix}^{\otimes9}. +\] + +Two direct, strict real-register schedules implement the same returned +coefficient/query interface, with explicit ownership, zero cleanup, operation +counts, and signed-width bounds. This closes the named-caller/observable question +released by [PR #3467](https://github.com/CrocSwap/integer-mult-bounds/pull/3467). +It does not establish a physical supplier or a new multiplication bound. + +Clear1nsight, with substantial OpenAI assistance. Four concurrent agents split +coordination/source review, source composition, independent literal arithmetic, +and direct/quotient construction, with cross-review between those roles. +No independent human review or formal proof-kernel verification is claimed. + +## Exact scope and why it matters + +The inputs are 52 distinct Gaussian coefficient arrays of length 512, five +separate dirty D arrays in the Newton lattice \(B_9\), and a separate Q array +in \(B_9\). The coefficient meanings are those of the inherited encoder K. +They are not arbitrary raw Y values already supplied by another caller. + +The new caller applies K, the actual **257-event producer dependency cone**, +the actual **15-event first collector**, a **252-event selective inverse**, +and the inverse codec. The selective inverse omits only the five inverse Q +compensation ADDs. It returns all source banks and frames and erases the first +private C at zero. Reversing every producer operation instead leaves precisely +the unwanted sum of initial dirty D values in Q. + +This has three connected consequences: + +| Question | Answer established here | +|---|---| +| Does the enlarged source module enlarge the five collector readouts? | No. Both it and the strong product entrance map onto the same \(B_9^5\), with one common explicit section. | +| Can the actual collector be closed while restoring its sources? | Yes, with the specified selective inverse; full inversion has an exact dirty-state error. | +| What does the resulting returned caller compute? | One Newton transform of a sum of five terminal coefficient banks; two strict direct schedules implement it. | + +The 47 nonterminal coefficient banks and four terminal differences are invisible +to the final increment. They remain present as unchanged outputs. No source +information is erased and no bank storage is released by this observation. + +This is a changed caller/observability audit under the original +p104-side-correction card, not another static flag census or a new entrance +classification. The complete card, scope-change reason, overlap coverage, +checkpoints, and family decision are in [TASK.json](TASK.json). + +## Precise quotient statement + +Write \(L\subset B_9^{52}\) for the inherited exact stagewise module and +\(S=(4B_9)^{52}\). The already established indices are + +\[ +[B_9^{52}:L]=2^{20424},\qquad [B_9^{52}:S]=2^{106496}. +\] + +For the five disjoint chronological Y groups, let +\(\rho_5(y)_j=\frac14\sum_{Y\in G_j}y_Y\). +Place \(4b_j\) in the last Y of each group and zero elsewhere to obtain a +common section \(\sigma:B_9^5\to S\). Then + +\[ +\rho_5(L)=\rho_5(S)=B_9^5,\qquad +L/S\cong \ker(\rho_5|_L)/(S\cap\ker\rho_5),\quad |L/S|=2^{86072}. +\] + +Every relative-domain class has a readout-kernel representative. +\(\rho_5\) itself does **not** descend to L/S, because S has nonzero readouts. +The full derivation, actual terminal-slot table, selective-return proof, and +three discriminating fixtures are in [PROOF.md](PROOF.md). + +One fixture sets only \(a_{44}=\delta_{15}\). Its actual Y91/Y90 pair produces +a \(-1\) intermediate D value on 32 addresses and then cancels from all five +readouts and the final query. It lies outside S, while its nonzero coefficient +still must be returned. Another fixture has two nonzero opposite terminal +readouts and zero query increment. These distinguish the two different kernels. + +## Direct schedules and costs + +One mode gathers into an owned zero Gaussian bank and leaves every coefficient +read-only. The other temporarily uses \(a_2\), restores it, and requires no +extra Gaussian bank. Both need one separate real zero scratch word, restored +after every multiplication or exact division by \(1+i\). + +| Strict rank-nine invoice | Owned zero bank | Temporary terminal bank | +|---|---:|---:| +| Real ADD/SUB, excluding doubling | 43,520 | 41,472 | +| Real doublings | 2,304 | 2,304 | +| Exact real halves | 4,608 | 4,608 | +| ADD/SUB if doubling costs one ADD | 45,824 | 43,776 | +| Extra Gaussian banks | 1 | 0 | +| Separate real zero scratch words | 1 | 1 | + +With coefficient component bound H and initial Q component bound J, +the direct schedules have conservative bounds \(67260H\) for all non-query +arithmetic registers and \(J+16815H\) for Q. No fractional precision is added. + +The literal core has 402 native occurrences, rank mass 722, 184,832 native +pairs, 804 wrappers, 388,480 direct Gaussian payload SWAPs, and 120 weighted +ADDs. Both inherited codec directions are additional. These native/component +inventories are not silently equated with a fully strict physical bill. +The [cost ledger](COSTS.md) specifies donor restoration charges, inherited codec +cost models, zero/ownership contracts, and every remaining physical obligation. + +**Family decision: narrow and stop at this caller.** The unchanged-profile +599/584 supplier stop and the selected frontier remain unchanged. Further +construction needs a different required observable, a named physical caller, +or a changed fully priced mechanism. + +## Evidence and reproduction + +The source-bound integrated replay reports **PASS_P104_RESTORED_QUERY**. +Its [deterministic receipt](RECEIPT.json) records: + +- Two separately constructed dense literal executions, each with **524 events** + and **184,832 completed literal/ideal pair comparisons**. +- Equality of complete prepared Y, returned Y, returned coefficient, returned D, + six-bank cut, and Q arrays before hashing; all 58 public return frames empty. +- Both strict direct schedules matching the literal query and all returned + coefficient arrays; exact primitive counts, widths, and zero-scratch exits. +- Three preparation/readout/direct fixtures, signed arithmetic checks at + ranks 0, 1, 2, and 9, 81 Gaussian \(\pi\)-roundtrips, and ownership controls. +- Exact dirty-sum failure for full reversal; missing Q return frame, wrong + phase/readout/return signs; malformed, missing, corrupt, changing or linked + source inputs; Boolean-versus-integer receipt distinction. + +The dense final Q SHA256 is +6a42a56f516a1c19847cc05085d8febf6cdc519a2cabcc628ec3677ac1ae75bb. +Its initial 58-bank hash agrees with the frozen predecessor fixture. +Finite checks substantiate the implementations and source binding; the +arbitrary-input theorem relies on the written proof and inherited theorems. + +Run from a complete checkout with history and Python 3.12: + +~~~sh +python3.12 -B scripts/research_package.py --package research/p104-restored-query --check-only +python3.12 -B scripts/research_package.py --package research/p104-restored-query +python3.12 -B scripts/check_research_commit.py --package research/p104-restored-query --check-source-history +~~~ + +The registered manifest runs both normal and optimized Python, with 180 seconds +per command. All dependencies are standard library. No Lean, native build, +network access, external solver, or historical replay is required by the +scientific verifier. A direct source-export replay is: + +~~~sh +python3.12 -I -B research/p104-restored-query/verify.py +python3.12 -I -O -B research/p104-restored-query/verify.py +~~~ + +The default verifier checks the committed receipt and never rewrites it. +Its explicit developer option to regenerate this package's receipt is +--write-receipt. Frozen scientific inputs and retained predecessors are never +generated or modified by that command. + +For an exact committed export: + +~~~sh +python3.12 -B scripts/export_research_package.py export --package research/p104-restored-query --ref HEAD --output /tmp/p104-restored-query.tar +python3.12 -B scripts/export_research_package.py check /tmp/p104-restored-query.tar +~~~ + +The exporter includes the package and every declared live input. Its transport +integrity check is separate from mathematical verification and source provenance. +The registered metadata checks require Git history; the direct verifier does not. +The publication handoff records actual commit/export/hosted results separately, +rather than treating these reproduction instructions as evidence of unrun gates. + +## Source and review boundary + +The frozen scientific base is +6f100d4bb5083f8c35d96fd95a539811c62f245c, priority revision 6. +At the 05:11 UTC checkpoint on October 18, 2026, canonical main had advanced to +20ecf2891d80b5acf18d980b2164fb44ea7faa90. Relevant guidance, selected record, +external live inputs, and registered replay tools were byte-identical; the new +package path was absent. The original scientific baseline is intentionally kept. + +WORD SHA256: +cec1fb3fbd0067b500ad5119a62ba60685be718e769374d7ec8abdd2beaa7e50. +NATIVE compressed-source SHA256: +ab91c78835c3e10cf3b2cb8a5d4e0b7cfc3df1ae5a811298d27842f2193e1e3d. + +Ten exact selected predecessor files were compared with immutable public +PR3467 head 4e4b08c689242f7f3be2e5e08dc1ae8d728ff920 and retained in this +publication's ancestor 9e501ba770d31c9f3decd51c987081c3b0acd256. This preserves +the sources frozen when that predecessor was pending; it also makes the direct +export self-contained. [SOURCES.json](SOURCES.json) declares all live inputs, +origins, Git blobs, hashes, dependencies, and credit. Every declared source +commit must be an ancestor for the strict publication-history preflight. + +The primary checker reuses those authenticated implementations. The independent +checker imports no predecessor executable, derives actual Y paths separately, +and credits adapted arithmetic from our prior checker. Both inherit written +Newton/native theorems; neither is a new proof of all 1,245 native recipes. +Modules are compiled from captured bytes and all captured sources/proofs are +rechecked before a successful exit. The environment and checkout must remain +stable; this is not an atomic filesystem snapshot or an adversarial proof of +the Python runtime. + +The original full 2,025-event prefix, the 5,398-event whole word, other consumers, +the 675 external ports, physical layout/access/control, zero supply, strict +native/codec lowering, and the complete recursive bill are outside this result. +No selected construction replay or human mathematical approval is implied. + +## Open next questions + +The two structured questions, first steps, relevance, and blockers are in +[TASK.json](TASK.json): + +1. **Name a physical caller for these exact coefficient meanings.** State its + actual reads, returned outputs, dirty-bank admission, and zero or mutable + terminal storage before pricing the direct schedule's access and controller. + This package supplies no such physical caller. +2. **Name an additional required observable that detects the kernel.** Start + with the Y91/Y90 intermediate fixture and one legal consumer, including + frames, coefficient, acquisition, restoration, and a complete allowance. + Stop if no useful consumer is justified. A broader lattice census alone + cannot change the present readout conclusion. + +These are conditional handoffs, not a recommendation to expand the stopped +supplier or duplicate the distinct full-prefix/recipient work. + +## Predecessor credit + +- **ywz65, PR #2586:** frozen word, native recipes, and original physical + inverse-transpose lineage; **Arham Tahir, PR #2665:** retained scientific inputs. +- **Nick Petalas:** PR #3426's ideal correlated entrance, PR #3416's + phase-correct covariance, and the distinct full-prefix/adapter work in + #3466 and #3469. The sharper two-source calibration in #3449 is complementary. +- **Clear1nsight with substantial OpenAI assistance:** PR #3382's Newton + exactness application; #3423's actual producer interfaces and already established + rank-one port map; #3467's exact stagewise module, codec, and cost ledger. +- **Tekalign:** signed-floor and phase-sensitive checks in #3025 and #3218; + **Ross Richardson:** the exactness-domain question in #3068. +- **Jose Manuel and Vasek:** the inherited unchanged-profile cost stop, + with its original assumptions; all retained geometry, native, compiler, + precision, and repository contributors keep their original attribution. + +This applies the existing Gaussian Newton/Clifford lattice framework; it does +not claim a new classical lattice family. Root LICENSE and NOTICE, +upstream/LICENSE, the source archive notices, and exact predecessor documents +are retained as declared inputs. New work is Apache-2.0. diff --git a/research/p104-restored-query/RECEIPT.json b/research/p104-restored-query/RECEIPT.json new file mode 100644 index 0000000000..3afc5abfae --- /dev/null +++ b/research/p104-restored-query/RECEIPT.json @@ -0,0 +1,4092 @@ +{ + "authenticated_input_and_proof_sha256": { + "COSTS.md": "30fdce07028911c09753221c4e42ba19e8b8e83d478e01276615b2174e6cd288", + "LICENSE": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4", + "NOTICE": "b49022cb4104d90b182e4c335f670faf45529025b15db77bf0291835083c28bd", + "PROOF.md": "64494ebf245333ef0c4800cb9758e97893bb614a67a81605558c04fe629824f8", + "SOURCES.json": "9c7891378159c5439cc8cd013aae8c91a959e07b39207d1030148fc5d024710e", + "VERIFY.json": "58f1d920e2bb8b852c329c95adab156375f7880d94e320c91424afa1b443e2ca", + "research/p104-restored-query/inputs/ORIGINS.json": "f10dbb7834391792979c3d184402f4aefb85442f5202d07031663d03ffc986d0", + "research/p104-restored-query/inputs/PR3382_PROOF.md": "1ca8c0e7e78f0f39de6cff7accc68ccd3901bfb50759bf7a2e2896bcf63bf081", + "research/p104-restored-query/inputs/PR3416_PROOF.md": "0dc1c35158902299fc8748c8baf89205483562f041e9050580e6579c331ebeb5", + "research/p104-restored-query/inputs/PR3426_PROOF.md": "892df1e84bfe8858e45b3bda45d76154a28b5f17e8f1789169d6e112ff0164d1", + "research/p104-restored-query/inputs/PR3467_COSTS.md": "b23dd2efb8351eaae0af4ebf46df3b7121d925ac7ef75fe8906ef4033316a5ff", + "research/p104-restored-query/inputs/PR3467_PROOF.md": "4fb79a8da2740ac9608d5e153aec3199ab14e3955cf44710bb0a7f111d745fe1", + "research/p104-restored-query/inputs/PR3467_README.md": "4d606001f663bd0d1814b8c7392559379dfc00fe7c9c25967fea9725523a1f96", + "research/p104-restored-query/inputs/pr3467/admission.py": "00bd8c666fa758e76e47fb3e8835dd71770d1ce32c55d71d8d003dca2da15709", + "research/p104-restored-query/inputs/pr3467/classifier.py": "3e42ba4e5fa1cc819f3e7b773b38ca47476bf85f581f888cc99690e1cf2f2b40", + "research/p104-restored-query/inputs/pr3467/inputs/pr3382_model.py": "74c83367887dd885137b222155c86389fe0be9f1293a6f0e5fdb51d71f435fdd", + "research/p104-restored-query/inputs/pr3467/source.py": "c54dabffe141de6befb6069e145c5ccbde629e76afb0f0afa3eb07bd72ab4b25", + "research/p104-rounded-collector/PREDECESSORS.json": "89f17ce76729101536cfc0be02ad153451c6606ebcfd3a1d6588226a83c88c64", + "research/p104-rounded-collector/README.md": "a77514952eda13fac047c5a4daba92d6c01d3e83bb1b41da4b87211bec6c37c9", + "research/p104-rounded-collector/inputs/NATIVE.json.gz": "ab91c78835c3e10cf3b2cb8a5d4e0b7cfc3df1ae5a811298d27842f2193e1e3d", + "research/p104-rounded-collector/inputs/WORD.json": "cec1fb3fbd0067b500ad5119a62ba60685be718e769374d7ec8abdd2beaa7e50", + "upstream/LICENSE": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + }, + "caller_entrance_controls": { + "boolean_source_component": { + "reason": "exact Gaussian integer component types", + "rejected": true + }, + "wrong_source_rank": { + "reason": "all initial banks must have exactly512 Gaussian entries", + "rejected": true + } + }, + "claims_excluded": [ + "Full2025-event prefix", + "5398-event whole word", + "675 external ports", + "physical caller or tape implementation", + "new supplier or kappa", + "independent human review or formal proof-kernel verification" + ], + "cross_implementation": { + "Gaussian_entries_per_bank": 512, + "coefficient_banks": 52, + "comparison_method": "Actual integer arrays, before taking receipt hashes.", + "dirty_D_banks": 5, + "full_array_equalities": [ + "initial_y", + "returned_y", + "returned_coefficients", + "returned_dirty", + "output_q", + "cut" + ], + "prepared_and_returned_Y_banks_per_check": 52, + "producer_cut_banks": 6 + }, + "direct_arithmetic_and_ownership_controls": { + "equal_valued_distinct_banks": [ + { + "all_52_coefficient_banks_restored": true, + "completed_pi_operations_with_zero_scratch": 0, + "final_coefficients_sha256": "1c5d395db5724314d22a2c559795f24b932acd42d323a1c94472c1f69c92fbfd", + "final_query_sha256": "b0d317a3ada5818326ed8cf9a2c369a0833045f2d94f5144cd19ddd7bf978738", + "initial_coefficients_sha256": "1c5d395db5724314d22a2c559795f24b932acd42d323a1c94472c1f69c92fbfd", + "initial_query_sha256": "b0d317a3ada5818326ed8cf9a2c369a0833045f2d94f5144cd19ddd7bf978738", + "instruction_sha256": "2a010edebd7565bec0673b940e1a2ab1f14f70ae1fa63852f9c0c7500f0b8bbf", + "invoice": { + "arithmetic_scratch_final_disposals": 1, + "arithmetic_scratch_initialisations": 1, + "arithmetic_scratch_zero_checks": 0, + "exact_real_halves": 0, + "full_gaussian_bank_add_sub": 11, + "gaussian_banks_owned_beyond_inputs": 1, + "gaussian_entries_per_bank": 1, + "newton_pairs_per_direction": 0, + "owned_zero_gaussian_bank_erasures": 1, + "owned_zero_gaussian_bank_initialisations": 1, + "rank": 0, + "real_add_sub_excluding_doubling": 22, + "real_add_sub_if_doubling_is_one_add": 22, + "real_doublings": 0, + "real_zero_scratch_registers": 1 + }, + "logical_work_bank": "owned_zero", + "mode": "zero", + "observed_primitives": { + "add": 12, + "doubling": 0, + "exact_half": 0, + "subtract": 10 + }, + "owned_gaussian_scratch_zero_erased": true, + "query_initial_B_admission_checked_here": false, + "rank": 0, + "real_scratch_final": 0, + "status": "PASS", + "terminal_slots": [ + 2, + 9, + 16, + 27, + 51 + ], + "width": { + "initial_coefficient_component_bound_H": 0, + "initial_query_component_bound_J": 0, + "newton_real_row_sum_gain": 1, + "observed_all_registers": 0, + "observed_nonquery_registers": 0, + "observed_query": 0, + "observed_real_scratch": 0, + "observed_signed_storage_bits": 1, + "observed_work_bank": 0, + "proved_nonquery_arithmetic_bound": 0, + "proved_query_bound": 0, + "proved_stored_encoded_sum_bound": 0 + } + }, + { + "all_52_coefficient_banks_restored": true, + "completed_pi_operations_with_zero_scratch": 0, + "final_coefficients_sha256": "1c5d395db5724314d22a2c559795f24b932acd42d323a1c94472c1f69c92fbfd", + "final_query_sha256": "b0d317a3ada5818326ed8cf9a2c369a0833045f2d94f5144cd19ddd7bf978738", + "initial_coefficients_sha256": "1c5d395db5724314d22a2c559795f24b932acd42d323a1c94472c1f69c92fbfd", + "initial_query_sha256": "b0d317a3ada5818326ed8cf9a2c369a0833045f2d94f5144cd19ddd7bf978738", + "instruction_sha256": "29f208cdbc65119662bcd0b412febe5723faee1f00c1a5b764bb07aeb0cbaeda", + "invoice": { + "arithmetic_scratch_final_disposals": 1, + "arithmetic_scratch_initialisations": 1, + "arithmetic_scratch_zero_checks": 0, + "exact_real_halves": 0, + "full_gaussian_bank_add_sub": 9, + "gaussian_banks_owned_beyond_inputs": 0, + "gaussian_entries_per_bank": 1, + "newton_pairs_per_direction": 0, + "owned_zero_gaussian_bank_erasures": 0, + "owned_zero_gaussian_bank_initialisations": 0, + "rank": 0, + "real_add_sub_excluding_doubling": 18, + "real_add_sub_if_doubling_is_one_add": 18, + "real_doublings": 0, + "real_zero_scratch_registers": 1 + }, + "logical_work_bank": 2, + "mode": "inplace", + "observed_primitives": { + "add": 10, + "doubling": 0, + "exact_half": 0, + "subtract": 8 + }, + "owned_gaussian_scratch_zero_erased": null, + "query_initial_B_admission_checked_here": false, + "rank": 0, + "real_scratch_final": 0, + "status": "PASS", + "terminal_slots": [ + 2, + 9, + 16, + 27, + 51 + ], + "width": { + "initial_coefficient_component_bound_H": 0, + "initial_query_component_bound_J": 0, + "newton_real_row_sum_gain": 1, + "observed_all_registers": 0, + "observed_nonquery_registers": 0, + "observed_query": 0, + "observed_real_scratch": 0, + "observed_signed_storage_bits": 1, + "observed_work_bank": 0, + "proved_nonquery_arithmetic_bound": 0, + "proved_query_bound": 0, + "proved_stored_encoded_sum_bound": 0 + } + } + ], + "rejected_controls": { + "aliased_coefficient_bank": { + "reason": "coefficient banks must be distinct", + "status": "REJECT" + }, + "aliased_query": { + "reason": "query must be distinct from coefficients", + "status": "REJECT" + }, + "boolean_component": { + "reason": "coefficient bank components must be integers, excluding bool", + "status": "REJECT" + }, + "boolean_terminal_slot": { + "reason": "terminal slots must be integer indices in [0, 51]", + "status": "REJECT" + }, + "dirty_real_scratch": { + "reason": "pi multiplication requires zero scratch", + "status": "REJECT" + }, + "negative_odd_pi_division": { + "reason": "exact halving rejected an odd signed numerator", + "status": "REJECT" + }, + "repeated_terminal_slot": { + "reason": "terminal slots must be distinct", + "status": "REJECT" + } + }, + "signed_rank_cases": [ + { + "modes": [ + { + "all_52_coefficient_banks_restored": true, + "completed_pi_operations_with_zero_scratch": 0, + "final_coefficients_sha256": "705980eebb2ec106adb637b47c48f5ff8eef12431eb2d96a44fa757e3a151d96", + "final_query_sha256": "15aec0ba99e2b001234c131ccda67c039221e6b550acac8d1a80278e6757367d", + "initial_coefficients_sha256": "705980eebb2ec106adb637b47c48f5ff8eef12431eb2d96a44fa757e3a151d96", + "initial_query_sha256": "9ef5effa80645af921705554dd2f9825f6b60bfe3f421e093c6e7c66b93b8d36", + "instruction_sha256": "2a010edebd7565bec0673b940e1a2ab1f14f70ae1fa63852f9c0c7500f0b8bbf", + "invoice": { + "arithmetic_scratch_final_disposals": 1, + "arithmetic_scratch_initialisations": 1, + "arithmetic_scratch_zero_checks": 0, + "exact_real_halves": 0, + "full_gaussian_bank_add_sub": 11, + "gaussian_banks_owned_beyond_inputs": 1, + "gaussian_entries_per_bank": 1, + "newton_pairs_per_direction": 0, + "owned_zero_gaussian_bank_erasures": 1, + "owned_zero_gaussian_bank_initialisations": 1, + "rank": 0, + "real_add_sub_excluding_doubling": 22, + "real_add_sub_if_doubling_is_one_add": 22, + "real_doublings": 0, + "real_zero_scratch_registers": 1 + }, + "logical_work_bank": "owned_zero", + "mode": "zero", + "observed_primitives": { + "add": 12, + "doubling": 0, + "exact_half": 0, + "subtract": 10 + }, + "owned_gaussian_scratch_zero_erased": true, + "query_initial_B_admission_checked_here": false, + "rank": 0, + "real_scratch_final": 0, + "status": "PASS", + "terminal_slots": [ + 2, + 9, + 16, + 27, + 51 + ], + "width": { + "initial_coefficient_component_bound_H": 6, + "initial_query_component_bound_J": 9, + "newton_real_row_sum_gain": 1, + "observed_all_registers": 10, + "observed_nonquery_registers": 10, + "observed_query": 9, + "observed_real_scratch": 0, + "observed_signed_storage_bits": 5, + "observed_work_bank": 10, + "proved_nonquery_arithmetic_bound": 120, + "proved_query_bound": 39, + "proved_stored_encoded_sum_bound": 30 + } + }, + { + "all_52_coefficient_banks_restored": true, + "completed_pi_operations_with_zero_scratch": 0, + "final_coefficients_sha256": "705980eebb2ec106adb637b47c48f5ff8eef12431eb2d96a44fa757e3a151d96", + "final_query_sha256": "15aec0ba99e2b001234c131ccda67c039221e6b550acac8d1a80278e6757367d", + "initial_coefficients_sha256": "705980eebb2ec106adb637b47c48f5ff8eef12431eb2d96a44fa757e3a151d96", + "initial_query_sha256": "9ef5effa80645af921705554dd2f9825f6b60bfe3f421e093c6e7c66b93b8d36", + "instruction_sha256": "29f208cdbc65119662bcd0b412febe5723faee1f00c1a5b764bb07aeb0cbaeda", + "invoice": { + "arithmetic_scratch_final_disposals": 1, + "arithmetic_scratch_initialisations": 1, + "arithmetic_scratch_zero_checks": 0, + "exact_real_halves": 0, + "full_gaussian_bank_add_sub": 9, + "gaussian_banks_owned_beyond_inputs": 0, + "gaussian_entries_per_bank": 1, + "newton_pairs_per_direction": 0, + "owned_zero_gaussian_bank_erasures": 0, + "owned_zero_gaussian_bank_initialisations": 0, + "rank": 0, + "real_add_sub_excluding_doubling": 18, + "real_add_sub_if_doubling_is_one_add": 18, + "real_doublings": 0, + "real_zero_scratch_registers": 1 + }, + "logical_work_bank": 2, + "mode": "inplace", + "observed_primitives": { + "add": 10, + "doubling": 0, + "exact_half": 0, + "subtract": 8 + }, + "owned_gaussian_scratch_zero_erased": null, + "query_initial_B_admission_checked_here": false, + "rank": 0, + "real_scratch_final": 0, + "status": "PASS", + "terminal_slots": [ + 2, + 9, + 16, + 27, + 51 + ], + "width": { + "initial_coefficient_component_bound_H": 6, + "initial_query_component_bound_J": 9, + "newton_real_row_sum_gain": 1, + "observed_all_registers": 10, + "observed_nonquery_registers": 10, + "observed_query": 9, + "observed_real_scratch": 0, + "observed_signed_storage_bits": 5, + "observed_work_bank": 10, + "proved_nonquery_arithmetic_bound": 120, + "proved_query_bound": 39, + "proved_stored_encoded_sum_bound": 30 + } + } + ], + "rank": 0, + "subset_formula_endpoint_sha256": "15aec0ba99e2b001234c131ccda67c039221e6b550acac8d1a80278e6757367d" + }, + { + "modes": [ + { + "all_52_coefficient_banks_restored": true, + "completed_pi_operations_with_zero_scratch": 2, + "final_coefficients_sha256": "5e1b82c616ffe807428ae8fd95e24c3aa76eaefb9c8991b010809c930be8421b", + "final_query_sha256": "02430f83afbf0f6e93102fd4e474ac9f7beb00ca33952887e7c2908922f6b63c", + "initial_coefficients_sha256": "5e1b82c616ffe807428ae8fd95e24c3aa76eaefb9c8991b010809c930be8421b", + "initial_query_sha256": "7a288ce62b4effc24b2b09b184771ee20ce7175554a7ebcd693c84491e9cbc46", + "instruction_sha256": "61492e86c3e4b382e93d7b0cdb093c108ccc605e403080715bc51bf3e3ee421a", + "invoice": { + "arithmetic_scratch_final_disposals": 1, + "arithmetic_scratch_initialisations": 1, + "arithmetic_scratch_zero_checks": 2, + "exact_real_halves": 2, + "full_gaussian_bank_add_sub": 11, + "gaussian_banks_owned_beyond_inputs": 1, + "gaussian_entries_per_bank": 2, + "newton_pairs_per_direction": 1, + "owned_zero_gaussian_bank_erasures": 1, + "owned_zero_gaussian_bank_initialisations": 1, + "rank": 1, + "real_add_sub_excluding_doubling": 58, + "real_add_sub_if_doubling_is_one_add": 59, + "real_doublings": 1, + "real_zero_scratch_registers": 1 + }, + "logical_work_bank": "owned_zero", + "mode": "zero", + "observed_primitives": { + "add": 31, + "doubling": 1, + "exact_half": 2, + "subtract": 27 + }, + "owned_gaussian_scratch_zero_erased": true, + "query_initial_B_admission_checked_here": false, + "rank": 1, + "real_scratch_final": 0, + "status": "PASS", + "terminal_slots": [ + 2, + 9, + 16, + 27, + 51 + ], + "width": { + "initial_coefficient_component_bound_H": 6, + "initial_query_component_bound_J": 9, + "newton_real_row_sum_gain": 3, + "observed_all_registers": 20, + "observed_nonquery_registers": 20, + "observed_query": 19, + "observed_real_scratch": 10, + "observed_signed_storage_bits": 6, + "observed_work_bank": 20, + "proved_nonquery_arithmetic_bound": 360, + "proved_query_bound": 99, + "proved_stored_encoded_sum_bound": 90 + } + }, + { + "all_52_coefficient_banks_restored": true, + "completed_pi_operations_with_zero_scratch": 2, + "final_coefficients_sha256": "5e1b82c616ffe807428ae8fd95e24c3aa76eaefb9c8991b010809c930be8421b", + "final_query_sha256": "02430f83afbf0f6e93102fd4e474ac9f7beb00ca33952887e7c2908922f6b63c", + "initial_coefficients_sha256": "5e1b82c616ffe807428ae8fd95e24c3aa76eaefb9c8991b010809c930be8421b", + "initial_query_sha256": "7a288ce62b4effc24b2b09b184771ee20ce7175554a7ebcd693c84491e9cbc46", + "instruction_sha256": "1b88e511ef6ad682c1f2bd1a76e3a1cb1ad6fa072fbe1a276c32bead7d02861e", + "invoice": { + "arithmetic_scratch_final_disposals": 1, + "arithmetic_scratch_initialisations": 1, + "arithmetic_scratch_zero_checks": 2, + "exact_real_halves": 2, + "full_gaussian_bank_add_sub": 9, + "gaussian_banks_owned_beyond_inputs": 0, + "gaussian_entries_per_bank": 2, + "newton_pairs_per_direction": 1, + "owned_zero_gaussian_bank_erasures": 0, + "owned_zero_gaussian_bank_initialisations": 0, + "rank": 1, + "real_add_sub_excluding_doubling": 50, + "real_add_sub_if_doubling_is_one_add": 51, + "real_doublings": 1, + "real_zero_scratch_registers": 1 + }, + "logical_work_bank": 2, + "mode": "inplace", + "observed_primitives": { + "add": 27, + "doubling": 1, + "exact_half": 2, + "subtract": 23 + }, + "owned_gaussian_scratch_zero_erased": null, + "query_initial_B_admission_checked_here": false, + "rank": 1, + "real_scratch_final": 0, + "status": "PASS", + "terminal_slots": [ + 2, + 9, + 16, + 27, + 51 + ], + "width": { + "initial_coefficient_component_bound_H": 6, + "initial_query_component_bound_J": 9, + "newton_real_row_sum_gain": 3, + "observed_all_registers": 20, + "observed_nonquery_registers": 20, + "observed_query": 19, + "observed_real_scratch": 10, + "observed_signed_storage_bits": 6, + "observed_work_bank": 20, + "proved_nonquery_arithmetic_bound": 360, + "proved_query_bound": 99, + "proved_stored_encoded_sum_bound": 90 + } + } + ], + "rank": 1, + "subset_formula_endpoint_sha256": "02430f83afbf0f6e93102fd4e474ac9f7beb00ca33952887e7c2908922f6b63c" + }, + { + "modes": [ + { + "all_52_coefficient_banks_restored": true, + "completed_pi_operations_with_zero_scratch": 8, + "final_coefficients_sha256": "b1e97221240c9fb44b745cd25df10d2fade9a62c53f190b6eac1ab33ba44f8d5", + "final_query_sha256": "f06d4ea0c5a2c13e847ec06ca22280ab0dce885848d156c2d10a9b6ddecfc123", + "initial_coefficients_sha256": "b1e97221240c9fb44b745cd25df10d2fade9a62c53f190b6eac1ab33ba44f8d5", + "initial_query_sha256": "7d2e1fe3085a567ce8b25a82f9e5fb09e6eb19b9c91defebbb4fad13d6eed45d", + "instruction_sha256": "d323a6304f59002bcebb09d78843dfecf065ee22acf43f65a69c931e5b16d13d", + "invoice": { + "arithmetic_scratch_final_disposals": 1, + "arithmetic_scratch_initialisations": 1, + "arithmetic_scratch_zero_checks": 8, + "exact_real_halves": 8, + "full_gaussian_bank_add_sub": 11, + "gaussian_banks_owned_beyond_inputs": 1, + "gaussian_entries_per_bank": 4, + "newton_pairs_per_direction": 4, + "owned_zero_gaussian_bank_erasures": 1, + "owned_zero_gaussian_bank_initialisations": 1, + "rank": 2, + "real_add_sub_excluding_doubling": 144, + "real_add_sub_if_doubling_is_one_add": 148, + "real_doublings": 4, + "real_zero_scratch_registers": 1 + }, + "logical_work_bank": "owned_zero", + "mode": "zero", + "observed_primitives": { + "add": 76, + "doubling": 4, + "exact_half": 8, + "subtract": 68 + }, + "owned_gaussian_scratch_zero_erased": true, + "query_initial_B_admission_checked_here": false, + "rank": 2, + "real_scratch_final": 0, + "status": "PASS", + "terminal_slots": [ + 2, + 9, + 16, + 27, + 51 + ], + "width": { + "initial_coefficient_component_bound_H": 6, + "initial_query_component_bound_J": 9, + "newton_real_row_sum_gain": 7, + "observed_all_registers": 23, + "observed_nonquery_registers": 23, + "observed_query": 21, + "observed_real_scratch": 22, + "observed_signed_storage_bits": 6, + "observed_work_bank": 23, + "proved_nonquery_arithmetic_bound": 840, + "proved_query_bound": 219, + "proved_stored_encoded_sum_bound": 210 + } + }, + { + "all_52_coefficient_banks_restored": true, + "completed_pi_operations_with_zero_scratch": 8, + "final_coefficients_sha256": "b1e97221240c9fb44b745cd25df10d2fade9a62c53f190b6eac1ab33ba44f8d5", + "final_query_sha256": "f06d4ea0c5a2c13e847ec06ca22280ab0dce885848d156c2d10a9b6ddecfc123", + "initial_coefficients_sha256": "b1e97221240c9fb44b745cd25df10d2fade9a62c53f190b6eac1ab33ba44f8d5", + "initial_query_sha256": "7d2e1fe3085a567ce8b25a82f9e5fb09e6eb19b9c91defebbb4fad13d6eed45d", + "instruction_sha256": "52835fe6de8a8da3a9f4538fc25683f4aae582829671912be02a01fb9192dbb5", + "invoice": { + "arithmetic_scratch_final_disposals": 1, + "arithmetic_scratch_initialisations": 1, + "arithmetic_scratch_zero_checks": 8, + "exact_real_halves": 8, + "full_gaussian_bank_add_sub": 9, + "gaussian_banks_owned_beyond_inputs": 0, + "gaussian_entries_per_bank": 4, + "newton_pairs_per_direction": 4, + "owned_zero_gaussian_bank_erasures": 0, + "owned_zero_gaussian_bank_initialisations": 0, + "rank": 2, + "real_add_sub_excluding_doubling": 128, + "real_add_sub_if_doubling_is_one_add": 132, + "real_doublings": 4, + "real_zero_scratch_registers": 1 + }, + "logical_work_bank": 2, + "mode": "inplace", + "observed_primitives": { + "add": 68, + "doubling": 4, + "exact_half": 8, + "subtract": 60 + }, + "owned_gaussian_scratch_zero_erased": null, + "query_initial_B_admission_checked_here": false, + "rank": 2, + "real_scratch_final": 0, + "status": "PASS", + "terminal_slots": [ + 2, + 9, + 16, + 27, + 51 + ], + "width": { + "initial_coefficient_component_bound_H": 6, + "initial_query_component_bound_J": 9, + "newton_real_row_sum_gain": 7, + "observed_all_registers": 23, + "observed_nonquery_registers": 23, + "observed_query": 21, + "observed_real_scratch": 22, + "observed_signed_storage_bits": 6, + "observed_work_bank": 23, + "proved_nonquery_arithmetic_bound": 840, + "proved_query_bound": 219, + "proved_stored_encoded_sum_bound": 210 + } + } + ], + "rank": 2, + "subset_formula_endpoint_sha256": "f06d4ea0c5a2c13e847ec06ca22280ab0dce885848d156c2d10a9b6ddecfc123" + }, + { + "modes": [ + { + "all_52_coefficient_banks_restored": true, + "completed_pi_operations_with_zero_scratch": 4608, + "final_coefficients_sha256": "3c9b2c4dc005d83d73db0244db58bf8f1760a0e6b901ce9f55b1a4b1231d7c46", + "final_query_sha256": "9adb10228580b09754b0b9239eb2d7790e23dabd35928e7bfce51635b8eaeb2f", + "initial_coefficients_sha256": "3c9b2c4dc005d83d73db0244db58bf8f1760a0e6b901ce9f55b1a4b1231d7c46", + "initial_query_sha256": "11e121effa6583fd32a5420084dd761332ac427a62cfc09201835e5d10e4910d", + "instruction_sha256": "60d713630f85ca8ea1e922060c0ffbc7682e7d38f5c5bef113cc87b875c2e8ee", + "invoice": { + "arithmetic_scratch_final_disposals": 1, + "arithmetic_scratch_initialisations": 1, + "arithmetic_scratch_zero_checks": 4608, + "exact_real_halves": 4608, + "full_gaussian_bank_add_sub": 11, + "gaussian_banks_owned_beyond_inputs": 1, + "gaussian_entries_per_bank": 512, + "newton_pairs_per_direction": 2304, + "owned_zero_gaussian_bank_erasures": 1, + "owned_zero_gaussian_bank_initialisations": 1, + "rank": 9, + "real_add_sub_excluding_doubling": 43520, + "real_add_sub_if_doubling_is_one_add": 45824, + "real_doublings": 2304, + "real_zero_scratch_registers": 1 + }, + "logical_work_bank": "owned_zero", + "mode": "zero", + "observed_primitives": { + "add": 22272, + "doubling": 2304, + "exact_half": 4608, + "subtract": 21248 + }, + "owned_gaussian_scratch_zero_erased": true, + "query_initial_B_admission_checked_here": false, + "rank": 9, + "real_scratch_final": 0, + "status": "PASS", + "terminal_slots": [ + 2, + 9, + 16, + 27, + 51 + ], + "width": { + "initial_coefficient_component_bound_H": 6, + "initial_query_component_bound_J": 9, + "newton_real_row_sum_gain": 3363, + "observed_all_registers": 814, + "observed_nonquery_registers": 814, + "observed_query": 534, + "observed_real_scratch": 616, + "observed_signed_storage_bits": 11, + "observed_work_bank": 814, + "proved_nonquery_arithmetic_bound": 403560, + "proved_query_bound": 100899, + "proved_stored_encoded_sum_bound": 100890 + } + }, + { + "all_52_coefficient_banks_restored": true, + "completed_pi_operations_with_zero_scratch": 4608, + "final_coefficients_sha256": "3c9b2c4dc005d83d73db0244db58bf8f1760a0e6b901ce9f55b1a4b1231d7c46", + "final_query_sha256": "9adb10228580b09754b0b9239eb2d7790e23dabd35928e7bfce51635b8eaeb2f", + "initial_coefficients_sha256": "3c9b2c4dc005d83d73db0244db58bf8f1760a0e6b901ce9f55b1a4b1231d7c46", + "initial_query_sha256": "11e121effa6583fd32a5420084dd761332ac427a62cfc09201835e5d10e4910d", + "instruction_sha256": "8006920ef32fbc8463937f5da0e45509527ef46abaf4bf7aed7270ec422bcc55", + "invoice": { + "arithmetic_scratch_final_disposals": 1, + "arithmetic_scratch_initialisations": 1, + "arithmetic_scratch_zero_checks": 4608, + "exact_real_halves": 4608, + "full_gaussian_bank_add_sub": 9, + "gaussian_banks_owned_beyond_inputs": 0, + "gaussian_entries_per_bank": 512, + "newton_pairs_per_direction": 2304, + "owned_zero_gaussian_bank_erasures": 0, + "owned_zero_gaussian_bank_initialisations": 0, + "rank": 9, + "real_add_sub_excluding_doubling": 41472, + "real_add_sub_if_doubling_is_one_add": 43776, + "real_doublings": 2304, + "real_zero_scratch_registers": 1 + }, + "logical_work_bank": 2, + "mode": "inplace", + "observed_primitives": { + "add": 21248, + "doubling": 2304, + "exact_half": 4608, + "subtract": 20224 + }, + "owned_gaussian_scratch_zero_erased": null, + "query_initial_B_admission_checked_here": false, + "rank": 9, + "real_scratch_final": 0, + "status": "PASS", + "terminal_slots": [ + 2, + 9, + 16, + 27, + 51 + ], + "width": { + "initial_coefficient_component_bound_H": 6, + "initial_query_component_bound_J": 9, + "newton_real_row_sum_gain": 3363, + "observed_all_registers": 814, + "observed_nonquery_registers": 814, + "observed_query": 534, + "observed_real_scratch": 616, + "observed_signed_storage_bits": 11, + "observed_work_bank": 814, + "proved_nonquery_arithmetic_bound": 403560, + "proved_query_bound": 100899, + "proved_stored_encoded_sum_bound": 100890 + } + } + ], + "rank": 9, + "subset_formula_endpoint_sha256": "9adb10228580b09754b0b9239eb2d7790e23dabd35928e7bfce51635b8eaeb2f" + } + ], + "small_signed_exact_halves": 162, + "small_signed_pi_roundtrips": 81, + "status": "PASS" + }, + "direct_schedules": { + "inplace": { + "all_52_coefficient_banks_restored": true, + "completed_pi_operations_with_zero_scratch": 4608, + "final_coefficients_sha256": "3c9b2c4dc005d83d73db0244db58bf8f1760a0e6b901ce9f55b1a4b1231d7c46", + "final_query_sha256": "6a42a56f516a1c19847cc05085d8febf6cdc519a2cabcc628ec3677ac1ae75bb", + "initial_coefficients_sha256": "3c9b2c4dc005d83d73db0244db58bf8f1760a0e6b901ce9f55b1a4b1231d7c46", + "initial_query_sha256": "05fc2e65372df70075e6da95edbfe63b3caaaa9c4bc1f8a3b8c585057fcc31c3", + "instruction_sha256": "8006920ef32fbc8463937f5da0e45509527ef46abaf4bf7aed7270ec422bcc55", + "invoice": { + "arithmetic_scratch_final_disposals": 1, + "arithmetic_scratch_initialisations": 1, + "arithmetic_scratch_zero_checks": 4608, + "exact_real_halves": 4608, + "full_gaussian_bank_add_sub": 9, + "gaussian_banks_owned_beyond_inputs": 0, + "gaussian_entries_per_bank": 512, + "newton_pairs_per_direction": 2304, + "owned_zero_gaussian_bank_erasures": 0, + "owned_zero_gaussian_bank_initialisations": 0, + "rank": 9, + "real_add_sub_excluding_doubling": 41472, + "real_add_sub_if_doubling_is_one_add": 43776, + "real_doublings": 2304, + "real_zero_scratch_registers": 1 + }, + "logical_work_bank": 2, + "mode": "inplace", + "observed_primitives": { + "add": 21248, + "doubling": 2304, + "exact_half": 4608, + "subtract": 20224 + }, + "owned_gaussian_scratch_zero_erased": null, + "query_initial_B_admission_checked_here": false, + "rank": 9, + "real_scratch_final": 0, + "status": "PASS", + "terminal_slots": [ + 2, + 9, + 16, + 27, + 51 + ], + "width": { + "initial_coefficient_component_bound_H": 6, + "initial_query_component_bound_J": 271, + "newton_real_row_sum_gain": 3363, + "observed_all_registers": 814, + "observed_nonquery_registers": 814, + "observed_query": 810, + "observed_real_scratch": 616, + "observed_signed_storage_bits": 11, + "observed_work_bank": 814, + "proved_nonquery_arithmetic_bound": 403560, + "proved_query_bound": 101161, + "proved_stored_encoded_sum_bound": 100890 + } + }, + "zero": { + "all_52_coefficient_banks_restored": true, + "completed_pi_operations_with_zero_scratch": 4608, + "final_coefficients_sha256": "3c9b2c4dc005d83d73db0244db58bf8f1760a0e6b901ce9f55b1a4b1231d7c46", + "final_query_sha256": "6a42a56f516a1c19847cc05085d8febf6cdc519a2cabcc628ec3677ac1ae75bb", + "initial_coefficients_sha256": "3c9b2c4dc005d83d73db0244db58bf8f1760a0e6b901ce9f55b1a4b1231d7c46", + "initial_query_sha256": "05fc2e65372df70075e6da95edbfe63b3caaaa9c4bc1f8a3b8c585057fcc31c3", + "instruction_sha256": "60d713630f85ca8ea1e922060c0ffbc7682e7d38f5c5bef113cc87b875c2e8ee", + "invoice": { + "arithmetic_scratch_final_disposals": 1, + "arithmetic_scratch_initialisations": 1, + "arithmetic_scratch_zero_checks": 4608, + "exact_real_halves": 4608, + "full_gaussian_bank_add_sub": 11, + "gaussian_banks_owned_beyond_inputs": 1, + "gaussian_entries_per_bank": 512, + "newton_pairs_per_direction": 2304, + "owned_zero_gaussian_bank_erasures": 1, + "owned_zero_gaussian_bank_initialisations": 1, + "rank": 9, + "real_add_sub_excluding_doubling": 43520, + "real_add_sub_if_doubling_is_one_add": 45824, + "real_doublings": 2304, + "real_zero_scratch_registers": 1 + }, + "logical_work_bank": "owned_zero", + "mode": "zero", + "observed_primitives": { + "add": 22272, + "doubling": 2304, + "exact_half": 4608, + "subtract": 21248 + }, + "owned_gaussian_scratch_zero_erased": true, + "query_initial_B_admission_checked_here": false, + "rank": 9, + "real_scratch_final": 0, + "status": "PASS", + "terminal_slots": [ + 2, + 9, + 16, + 27, + 51 + ], + "width": { + "initial_coefficient_component_bound_H": 6, + "initial_query_component_bound_J": 271, + "newton_real_row_sum_gain": 3363, + "observed_all_registers": 814, + "observed_nonquery_registers": 814, + "observed_query": 810, + "observed_real_scratch": 616, + "observed_signed_storage_bits": 11, + "observed_work_bank": 814, + "proved_nonquery_arithmetic_bound": 403560, + "proved_query_bound": 101161, + "proved_stored_encoded_sum_bound": 100890 + } + } + }, + "implementation_sha256": { + "direct.py": "1db5e1d4d84589177a7f212aed2bc549924366151fe75e6ea76a31de3a08794d", + "independent.py": "e7e06d875ffcf1b34946f844141b3c9fcf2f7395e35aba4e18277e6fea279428", + "observability.py": "0b2f8f353843ccc67ff7203b118affe7347e5a8d5895c90e36bf7d3d45e4b3e7", + "primary.py": "d4ee86af07fd9ab5f81db6d4c1f953e12a8303f1d353cd4b03875718d9f5a419", + "sources.py": "50aabf9028104d28e2b84a751fdb0453741b828ffc2c440b4fc90d9b4d60d711", + "verify.py": "f67298f5f90f228a64257ed2def0b1812385289a56ad985d8dc8fc4088575f84" + }, + "independence": "The primary reuses authenticated predecessor code. The second derives Y paths and native arithmetic separately, imports no predecessor executable, and credits adapted arithmetic from PR3467; both inherit written theorems.", + "independent_literal": { + "closed_steps_sha256": "a6d625a6252bc32845046beead1ac1cd3b1f45f3ac95b52786974035fafcbb9d", + "cone_events_sha256": "798d43437c1911e7237d5eb7ce92f496b2ef6dca05359110349eca1c5386bdf4", + "controls": { + "extra_phase_after_native2031": { + "address": 0, + "bank": "C", + "event": 2039, + "kind": "private_not_zero", + "value": [ + 9, + 65 + ] + }, + "full_producer_inverse": { + "dirty_sum_sha256": "b6534ee7d08d551ff2159da3fe64a9c1e953f751ccdfbb6e96001889d423676c", + "failure": { + "actual": [ + 12, + 4 + ], + "address": 0, + "bank": "Q7", + "expected": [ + 13, + 0 + ], + "kind": "query_endpoint" + }, + "formula_checked_on_all_coordinates": true, + "wrong_q_sha256": "6645945597f55c38cd3ca069fe0ef217809f5904d9077ce8167def543eba0a65" + }, + "omitted_q_inverse972": { + "actual": [ + 364 + ], + "bank": "Q7", + "expected": [], + "kind": "return_frame" + }, + "query2032_wrong_sign": { + "actual": [ + -5, + -12 + ], + "address": 0, + "bank": "Q7", + "expected": [ + 13, + 0 + ], + "kind": "query_endpoint" + } + }, + "excluded_q_compensation_inverses": [ + 908, + 910, + 912, + 914, + 916 + ], + "full_array_checks": { + "all58_public_return_frames_empty": true, + "private_C_erased_zero": true, + "query_coordinates": 512, + "returned_coefficient_banks": 52, + "returned_dirty_d_banks": 5, + "returned_prepared_y_banks": 52 + }, + "inherited": [ + "PR3467 complete entrance and codec theorem", + "PR3416 native covariance with phase", + "PR3382 Newton invariance; PR3025/3068 literal gate lineage" + ], + "initial_all_banks_sha256": "4a1ead3a71275d790b35a2289640c293f02026a9fe7985b7a8aed84eaf3fa706", + "literal_counts": { + "completed_literal_pairs": 184832, + "events": 524, + "inverse_native_occurrences": 200, + "native_occurrences": 402, + "native_rank_mass": 722, + "private_erase": 1, + "private_zero": 1, + "quarter_adds": 104, + "weighted_adds": 120, + "wrappers": 804 + }, + "negative_controls_executed": true, + "output_q_sha256": "6a42a56f516a1c19847cc05085d8febf6cdc519a2cabcc628ec3677ac1ae75bb", + "parameters_sha256": "3c9b2c4dc005d83d73db0244db58bf8f1760a0e6b901ce9f55b1a4b1231d7c46", + "returned_coefficients_sha256": "3c9b2c4dc005d83d73db0244db58bf8f1760a0e6b901ce9f55b1a4b1231d7c46", + "scope": "524-event changed closed caller; omitted original histories unclaimed", + "source_sha256": { + "NATIVE.json.gz": "ab91c78835c3e10cf3b2cb8a5d4e0b7cfc3df1ae5a811298d27842f2193e1e3d", + "WORD.json": "cec1fb3fbd0067b500ad5119a62ba60685be718e769374d7ec8abdd2beaa7e50" + }, + "status": "PASS_INDEPENDENT_RESTORED_QUERY", + "terminal_slots": [ + 2, + 9, + 16, + 27, + 51 + ], + "terminal_sources": [ + "Y99", + "Y100", + "Y66", + "Y72", + "Y80" + ] + }, + "observable_quotient": { + "WORD_sha256": "cec1fb3fbd0067b500ad5119a62ba60685be718e769374d7ec8abdd2beaa7e50", + "dense_primary_binding": { + "actual_Q_output_sha256": "6a42a56f516a1c19847cc05085d8febf6cdc519a2cabcc628ec3677ac1ae75bb", + "actual_prepared_Y_sha256": "7f0be4e6f388ad00fa738cdaefe008a99cc6bfba9863505a48a326e4339a5224", + "five_physical_cut_readouts_sha256": "cfe6d6442c6fa90412e80e06e6c3d40ef3f4b995c9dfb3f13f8fae4944c77217", + "five_readout_sha256": "049e261d0767af0a1e5607b064e7056ac6df5c27b799f31f6a89e18e339bb99b", + "general_and_strong_five_readouts_equal": true, + "kernel_remainder_sha256": "3453c87471da6f167875d2cb9c6c8953edd78ee23d70cfad6c57845105800389", + "original_52_parameter_decode_checked": true, + "parameters_sha256": "3c9b2c4dc005d83d73db0244db58bf8f1760a0e6b901ce9f55b1a4b1231d7c46", + "strong_decode_has_zero_nonterminal_parameters": true, + "strong_section_Y_sha256": "5f255c7c5712ee9f4a15aa71e5aa56829bb2cf4e97c7cc6beb4399c3d12e8ff6", + "strong_section_is_not_permission_to_erase_original_coefficients": true + }, + "fixtures": [ + { + "direct_modes": [ + { + "instruction_sha256": "60d713630f85ca8ea1e922060c0ffbc7682e7d38f5c5bef113cc87b875c2e8ee", + "mode": "zero", + "observed_primitives": { + "add": 22272, + "doubling": 2304, + "exact_half": 4608, + "subtract": 21248 + }, + "output_q_sha256": "d1beb5283b0dcf0966072f9d04d0e7d4f6eb977a98f423f4a2c11849a0bcbffb", + "real_scratch_final": 0, + "returned_coefficient_banks": 52, + "returned_coefficients_sha256": "11cea0915ad20d52a20d40f11889ce9fe8a49fd708ab969a9246cb00b53562c8" + }, + { + "instruction_sha256": "8006920ef32fbc8463937f5da0e45509527ef46abaf4bf7aed7270ec422bcc55", + "mode": "inplace", + "observed_primitives": { + "add": 21248, + "doubling": 2304, + "exact_half": 4608, + "subtract": 20224 + }, + "output_q_sha256": "d1beb5283b0dcf0966072f9d04d0e7d4f6eb977a98f423f4a2c11849a0bcbffb", + "real_scratch_final": 0, + "returned_coefficient_banks": 52, + "returned_coefficients_sha256": "11cea0915ad20d52a20d40f11889ce9fe8a49fd708ab969a9246cb00b53562c8" + } + ], + "final_increment_sha256": "c8e145f4220685e764568718191bfa96c3227f8b845bc8032698b49d8f8b4d16", + "five_readouts_sha256": "83041d5ac108bce39286493c04d1163949b2332e90ee47e2c105cd26f7ebfde7", + "kind": "nonterminal", + "parameters_sha256": "11cea0915ad20d52a20d40f11889ce9fe8a49fd708ab969a9246cb00b53562c8", + "prepared_Y_sha256": "e39f670ed93f56a4d5d327fb47cb802f86c5dabc6439a049088ab00a366b603e", + "scope": "Pinned preparation/decoder, readout formula, and strict direct checks; no 524-event caller replay.", + "section_kernel_remainder_sha256": "e39f670ed93f56a4d5d327fb47cb802f86c5dabc6439a049088ab00a366b603e", + "strong_section_Y_sha256": "d38032ef39a5e73651468d4883af21be72da5c66fe9b70f40d651edbd8aeadc3", + "witness": { + "actual_D27_read_path": [ + 917, + 1161, + 1285, + 1452, + 1632 + ], + "actual_Y90_read_path": [ + 194, + 993, + 1100, + 1135, + 1240, + 1399, + 1600 + ], + "actual_Y91_read_path": [ + 195, + 992, + 1133, + 1238, + 1397, + 1598 + ], + "actual_intermediate_quarter_sha256": "dc12fc375e8b61021c913fce9df3ec9c521907a992eed9d9dd04bcee76a6139c", + "coefficient_basis_address": 15, + "coefficient_slot": 44, + "intermediate_then_cancelled": true, + "negative_unit_intermediate_entries": 32, + "outside_4B9_decoded_coefficient_witness": [ + 0, + 0, + 1 + ], + "prepared_nonzero_sources": [ + "Y91", + "Y90" + ], + "source_events": [ + 1817, + 1819 + ], + "source_path_matches_D_path": true + } + }, + { + "direct_modes": [ + { + "instruction_sha256": "60d713630f85ca8ea1e922060c0ffbc7682e7d38f5c5bef113cc87b875c2e8ee", + "mode": "zero", + "observed_primitives": { + "add": 22272, + "doubling": 2304, + "exact_half": 4608, + "subtract": 21248 + }, + "output_q_sha256": "d1beb5283b0dcf0966072f9d04d0e7d4f6eb977a98f423f4a2c11849a0bcbffb", + "real_scratch_final": 0, + "returned_coefficient_banks": 52, + "returned_coefficients_sha256": "22dda6218de496cac3b499c436a12e66686f9d18cd1bae8c42c1b8823cee47c0" + }, + { + "instruction_sha256": "8006920ef32fbc8463937f5da0e45509527ef46abaf4bf7aed7270ec422bcc55", + "mode": "inplace", + "observed_primitives": { + "add": 21248, + "doubling": 2304, + "exact_half": 4608, + "subtract": 20224 + }, + "output_q_sha256": "d1beb5283b0dcf0966072f9d04d0e7d4f6eb977a98f423f4a2c11849a0bcbffb", + "real_scratch_final": 0, + "returned_coefficient_banks": 52, + "returned_coefficients_sha256": "22dda6218de496cac3b499c436a12e66686f9d18cd1bae8c42c1b8823cee47c0" + } + ], + "final_increment_sha256": "c8e145f4220685e764568718191bfa96c3227f8b845bc8032698b49d8f8b4d16", + "final_increment_zero": true, + "five_readout_nonzero_banks": 2, + "five_readouts_sha256": "427e3c21c2098ae5835dd9807567dac624aa150ae90b8973709bca72b162702a", + "kind": "terminal_difference", + "parameters_sha256": "22dda6218de496cac3b499c436a12e66686f9d18cd1bae8c42c1b8823cee47c0", + "prepared_Y_sha256": "1ddd57fe72bfecf8a4cf17e767a51b9bdec5fc1cad6dff215163ba2feb2c25a9", + "scope": "Pinned preparation/decoder, readout formula, and strict direct checks; no 524-event caller replay.", + "section_kernel_remainder_sha256": "d38032ef39a5e73651468d4883af21be72da5c66fe9b70f40d651edbd8aeadc3", + "strong_section_Y_sha256": "1ddd57fe72bfecf8a4cf17e767a51b9bdec5fc1cad6dff215163ba2feb2c25a9" + }, + { + "bypassed_coefficient_slot_44_retained": true, + "direct_modes": [ + { + "instruction_sha256": "60d713630f85ca8ea1e922060c0ffbc7682e7d38f5c5bef113cc87b875c2e8ee", + "mode": "zero", + "observed_primitives": { + "add": 22272, + "doubling": 2304, + "exact_half": 4608, + "subtract": 21248 + }, + "output_q_sha256": "2d4958342b43bab813712e683078966313242a9d4398745f2699676c356d27a8", + "real_scratch_final": 0, + "returned_coefficient_banks": 52, + "returned_coefficients_sha256": "9ed562aff3a11f9addee2080044d42e2605c8d3a33baa542e2648857e59af1d8" + }, + { + "instruction_sha256": "8006920ef32fbc8463937f5da0e45509527ef46abaf4bf7aed7270ec422bcc55", + "mode": "inplace", + "observed_primitives": { + "add": 21248, + "doubling": 2304, + "exact_half": 4608, + "subtract": 20224 + }, + "output_q_sha256": "2d4958342b43bab813712e683078966313242a9d4398745f2699676c356d27a8", + "real_scratch_final": 0, + "returned_coefficient_banks": 52, + "returned_coefficients_sha256": "9ed562aff3a11f9addee2080044d42e2605c8d3a33baa542e2648857e59af1d8" + } + ], + "final_increment_sha256": "061acf6ec8f95da2f38051700a46c54193b656d71c4853257880bee4c4fd5f29", + "first_16_increment_entries": [ + [ + 1, + 0 + ], + [ + 0, + -1 + ], + [ + 0, + 1 + ], + [ + -1, + 0 + ], + [ + 2, + -1 + ], + [ + 1, + -2 + ], + [ + 1, + 0 + ], + [ + 0, + -1 + ], + [ + 1, + 2 + ], + [ + 0, + 1 + ], + [ + 0, + 3 + ], + [ + -1, + 2 + ], + [ + 2, + 1 + ], + [ + 1, + 0 + ], + [ + 1, + 2 + ], + [ + 0, + 1 + ] + ], + "five_readouts_sha256": "5b1e25544b5a063c0728fcdbea1ff2673c82cdb16032e9d0c52f5e7d9ca447e3", + "kind": "mixed", + "parameters_sha256": "9ed562aff3a11f9addee2080044d42e2605c8d3a33baa542e2648857e59af1d8", + "prepared_Y_sha256": "1f260533be457ec5874ea7aa23c9adea145d15e9186db97108ab4ef06417c32c", + "scope": "Pinned preparation/decoder, readout formula, and strict direct checks; no 524-event caller replay.", + "section_kernel_remainder_sha256": "e39f670ed93f56a4d5d327fb47cb802f86c5dabc6439a049088ab00a366b603e", + "strong_nonzero_sources": [ + "Y99", + "Y100", + "Y66", + "Y72", + "Y80" + ], + "strong_section_Y_sha256": "20480eaefb00f19dc905ec811b7ab28fe004632cc20a3f98ea594fb7719d3cdf" + } + ], + "quotient_and_rank": { + "B52_over_L_index_power_of_2": 20424, + "B52_over_S_index_power_of_2": 106496, + "E_determinant_pi_exponent": 2304, + "E_rank_certificate": "Triangular subset matrix with nonzero diagonal pi^popcount(address).", + "L_over_S_index_power_of_2": 86072, + "final_increment_coefficient_kernel_gaussian_rank": 26112, + "final_increment_gaussian_rank": 512, + "five_readout_coefficient_kernel_gaussian_rank": 24064, + "five_readout_gaussian_rank": 2560, + "interval_counts": { + "rank_one": 15, + "terminal": 5, + "zero": 32 + }, + "profile_index_exponents": { + "rank_one": 280, + "terminal": 2048, + "zero": 187 + }, + "quotient_statement": "L/S is isomorphic to K/(K intersect S), K=ker(rho5|L), via [y] -> [y-sigma(rho5(y))].", + "rank_scope": "Observation maps only; the full restored query shear erases no coefficient data.", + "reason": "rho5(S)=B9^5; the common terminal-source section splits both domains.", + "returned_coefficient_banks": 52, + "rho5_descends_to_L_over_S": false + }, + "scope": "Dense supplied literal endpoint binding plus three bounded preparation/readout/direct fixtures; no caller replay in this module.", + "source_groups": [ + { + "bank": "D31", + "size": 3, + "terminal_event": 1231, + "terminal_slot": 2, + "terminal_source": "Y99" + }, + { + "bank": "D30", + "size": 7, + "terminal_event": 1393, + "terminal_slot": 9, + "terminal_source": "Y100" + }, + { + "bank": "D29", + "size": 7, + "terminal_event": 1459, + "terminal_slot": 16, + "terminal_source": "Y66" + }, + { + "bank": "D28", + "size": 11, + "terminal_event": 1641, + "terminal_slot": 27, + "terminal_source": "Y72" + }, + { + "bank": "D27", + "size": 24, + "terminal_event": 1831, + "terminal_slot": 51, + "terminal_source": "Y80" + } + ], + "status": "PASS_SOURCE_BOUND_OBSERVABILITY" + }, + "primary_literal": { + "compensation_events_not_reversed": [ + 908, + 910, + 912, + 914, + 916 + ], + "controls": { + "full_inverse_dirty_error": { + "difference_sha256": "b6534ee7d08d551ff2159da3fe64a9c1e953f751ccdfbb6e96001889d423676c", + "nonzero_coordinates": 512 + }, + "missing_Q_return_frame": { + "reason": "empty returned frames", + "rejected": true + }, + "wrong_collector_global_phase": { + "reason": "private C not zero at erase", + "rejected": true + }, + "wrong_return_quarter_sign": { + "reason": "nonintegral ideal native pair at event 1285", + "rejected": true + } + }, + "counts": { + "events": 524, + "literal_zero_erases": 1, + "native_occurrences": 402, + "native_pairs": 184832, + "weighted_adds": 120 + }, + "cut_frames": { + "D27": [ + 256, + 136, + 64, + 40, + 16, + 4, + 2, + 1 + ], + "D28": [ + 256, + 136, + 64, + 40, + 16, + 4, + 2, + 1 + ], + "D29": [ + 256, + 136, + 64, + 40, + 16, + 4, + 2, + 1 + ], + "D30": [ + 256, + 136, + 64, + 40, + 16, + 4, + 2, + 1 + ], + "D31": [ + 256, + 136, + 64, + 40, + 16, + 4, + 2, + 1 + ], + "Q7": [ + 364 + ] + }, + "cut_sha256": "049e894e20c96bf4662310f44ca9327e6e03996100116023fe0dbc89940bcc74", + "full_array_cut_equations_checked": 6, + "initial_sha256": "4a1ead3a71275d790b35a2289640c293f02026a9fe7985b7a8aed84eaf3fa706", + "inventory": { + "counts": { + "add": 120, + "erase": 1, + "events": 524, + "native_forward_pairs": 94208, + "native_gaussian_quarter_turns": 184832, + "native_inverse_pairs": 90624, + "native_pairs": 184832, + "quarter_adds": 104, + "rank_mass": 722, + "real_add_sub_before_wrapper_and_phase_lowering": 1601536, + "real_exact_quarter_halves": 212992, + "real_native_floor_halves": 739328, + "real_quarter_donor_restoration_doublings": 212992, + "transport": 402, + "unit_adds": 16, + "wrapper_cycles": 23168, + "wrapper_gaussian_swaps": 388480, + "wrapper_occurrences": 804, + "zero": 1 + }, + "events": [ + [ + 126, + false, + "producer" + ], + [ + 127, + false, + "producer" + ], + [ + 128, + false, + "producer" + ], + [ + 129, + false, + "producer" + ], + [ + 130, + false, + "producer" + ], + [ + 131, + false, + "producer" + ], + [ + 132, + false, + "producer" + ], + [ + 133, + false, + "producer" + ], + [ + 134, + false, + "producer" + ], + [ + 135, + false, + "producer" + ], + [ + 136, + false, + "producer" + ], + [ + 167, + false, + "producer" + ], + [ + 168, + false, + "producer" + ], + [ + 169, + false, + "producer" + ], + [ + 170, + false, + "producer" + ], + [ + 171, + false, + "producer" + ], + [ + 172, + false, + "producer" + ], + [ + 173, + false, + "producer" + ], + [ + 174, + false, + "producer" + ], + [ + 175, + false, + "producer" + ], + [ + 176, + false, + "producer" + ], + [ + 177, + false, + "producer" + ], + [ + 178, + false, + "producer" + ], + [ + 179, + false, + "producer" + ], + [ + 180, + false, + "producer" + ], + [ + 181, + false, + "producer" + ], + [ + 182, + false, + "producer" + ], + [ + 183, + false, + "producer" + ], + [ + 184, + false, + "producer" + ], + [ + 185, + false, + "producer" + ], + [ + 186, + false, + "producer" + ], + [ + 187, + false, + "producer" + ], + [ + 188, + false, + "producer" + ], + [ + 189, + false, + "producer" + ], + [ + 190, + false, + "producer" + ], + [ + 191, + false, + "producer" + ], + [ + 192, + false, + "producer" + ], + [ + 193, + false, + "producer" + ], + [ + 194, + false, + "producer" + ], + [ + 195, + false, + "producer" + ], + [ + 196, + false, + "producer" + ], + [ + 197, + false, + "producer" + ], + [ + 198, + false, + "producer" + ], + [ + 199, + false, + "producer" + ], + [ + 200, + false, + "producer" + ], + [ + 201, + false, + "producer" + ], + [ + 202, + false, + "producer" + ], + [ + 203, + false, + "producer" + ], + [ + 204, + false, + "producer" + ], + [ + 205, + false, + "producer" + ], + [ + 206, + false, + "producer" + ], + [ + 207, + false, + "producer" + ], + [ + 908, + false, + "producer" + ], + [ + 909, + false, + "producer" + ], + [ + 910, + false, + "producer" + ], + [ + 911, + false, + "producer" + ], + [ + 912, + false, + "producer" + ], + [ + 913, + false, + "producer" + ], + [ + 914, + false, + "producer" + ], + [ + 915, + false, + "producer" + ], + [ + 916, + false, + "producer" + ], + [ + 917, + false, + "producer" + ], + [ + 972, + false, + "producer" + ], + [ + 980, + false, + "producer" + ], + [ + 981, + false, + "producer" + ], + [ + 982, + false, + "producer" + ], + [ + 983, + false, + "producer" + ], + [ + 984, + false, + "producer" + ], + [ + 985, + false, + "producer" + ], + [ + 986, + false, + "producer" + ], + [ + 987, + false, + "producer" + ], + [ + 988, + false, + "producer" + ], + [ + 989, + false, + "producer" + ], + [ + 990, + false, + "producer" + ], + [ + 991, + false, + "producer" + ], + [ + 992, + false, + "producer" + ], + [ + 993, + false, + "producer" + ], + [ + 994, + false, + "producer" + ], + [ + 995, + false, + "producer" + ], + [ + 996, + false, + "producer" + ], + [ + 997, + false, + "producer" + ], + [ + 998, + false, + "producer" + ], + [ + 999, + false, + "producer" + ], + [ + 1000, + false, + "producer" + ], + [ + 1001, + false, + "producer" + ], + [ + 1002, + false, + "producer" + ], + [ + 1003, + false, + "producer" + ], + [ + 1004, + false, + "producer" + ], + [ + 1005, + false, + "producer" + ], + [ + 1006, + false, + "producer" + ], + [ + 1007, + false, + "producer" + ], + [ + 1008, + false, + "producer" + ], + [ + 1009, + false, + "producer" + ], + [ + 1010, + false, + "producer" + ], + [ + 1011, + false, + "producer" + ], + [ + 1012, + false, + "producer" + ], + [ + 1013, + false, + "producer" + ], + [ + 1014, + false, + "producer" + ], + [ + 1015, + false, + "producer" + ], + [ + 1016, + false, + "producer" + ], + [ + 1017, + false, + "producer" + ], + [ + 1018, + false, + "producer" + ], + [ + 1019, + false, + "producer" + ], + [ + 1020, + false, + "producer" + ], + [ + 1051, + false, + "producer" + ], + [ + 1052, + false, + "producer" + ], + [ + 1053, + false, + "producer" + ], + [ + 1054, + false, + "producer" + ], + [ + 1055, + false, + "producer" + ], + [ + 1056, + false, + "producer" + ], + [ + 1057, + false, + "producer" + ], + [ + 1058, + false, + "producer" + ], + [ + 1059, + false, + "producer" + ], + [ + 1060, + false, + "producer" + ], + [ + 1061, + false, + "producer" + ], + [ + 1085, + false, + "producer" + ], + [ + 1087, + false, + "producer" + ], + [ + 1089, + false, + "producer" + ], + [ + 1090, + false, + "producer" + ], + [ + 1092, + false, + "producer" + ], + [ + 1093, + false, + "producer" + ], + [ + 1095, + false, + "producer" + ], + [ + 1097, + false, + "producer" + ], + [ + 1100, + false, + "producer" + ], + [ + 1103, + false, + "producer" + ], + [ + 1106, + false, + "producer" + ], + [ + 1109, + false, + "producer" + ], + [ + 1121, + false, + "producer" + ], + [ + 1124, + false, + "producer" + ], + [ + 1126, + false, + "producer" + ], + [ + 1128, + false, + "producer" + ], + [ + 1129, + false, + "producer" + ], + [ + 1131, + false, + "producer" + ], + [ + 1133, + false, + "producer" + ], + [ + 1135, + false, + "producer" + ], + [ + 1138, + false, + "producer" + ], + [ + 1141, + false, + "producer" + ], + [ + 1144, + false, + "producer" + ], + [ + 1147, + false, + "producer" + ], + [ + 1149, + false, + "producer" + ], + [ + 1152, + false, + "producer" + ], + [ + 1155, + false, + "producer" + ], + [ + 1157, + false, + "producer" + ], + [ + 1159, + false, + "producer" + ], + [ + 1161, + false, + "producer" + ], + [ + 1162, + false, + "producer" + ], + [ + 1164, + false, + "producer" + ], + [ + 1166, + false, + "producer" + ], + [ + 1169, + false, + "producer" + ], + [ + 1172, + false, + "producer" + ], + [ + 1175, + false, + "producer" + ], + [ + 1177, + false, + "producer" + ], + [ + 1179, + false, + "producer" + ], + [ + 1222, + false, + "producer" + ], + [ + 1224, + false, + "producer" + ], + [ + 1226, + false, + "producer" + ], + [ + 1228, + false, + "producer" + ], + [ + 1230, + false, + "producer" + ], + [ + 1231, + false, + "producer" + ], + [ + 1233, + false, + "producer" + ], + [ + 1235, + false, + "producer" + ], + [ + 1238, + false, + "producer" + ], + [ + 1240, + false, + "producer" + ], + [ + 1242, + false, + "producer" + ], + [ + 1245, + false, + "producer" + ], + [ + 1247, + false, + "producer" + ], + [ + 1250, + false, + "producer" + ], + [ + 1252, + false, + "producer" + ], + [ + 1254, + false, + "producer" + ], + [ + 1257, + false, + "producer" + ], + [ + 1259, + false, + "producer" + ], + [ + 1262, + false, + "producer" + ], + [ + 1264, + false, + "producer" + ], + [ + 1267, + false, + "producer" + ], + [ + 1269, + false, + "producer" + ], + [ + 1271, + false, + "producer" + ], + [ + 1273, + false, + "producer" + ], + [ + 1275, + false, + "producer" + ], + [ + 1277, + false, + "producer" + ], + [ + 1279, + false, + "producer" + ], + [ + 1281, + false, + "producer" + ], + [ + 1283, + false, + "producer" + ], + [ + 1285, + false, + "producer" + ], + [ + 1287, + false, + "producer" + ], + [ + 1289, + false, + "producer" + ], + [ + 1292, + false, + "producer" + ], + [ + 1294, + false, + "producer" + ], + [ + 1296, + false, + "producer" + ], + [ + 1298, + false, + "producer" + ], + [ + 1389, + false, + "producer" + ], + [ + 1391, + false, + "producer" + ], + [ + 1393, + false, + "producer" + ], + [ + 1395, + false, + "producer" + ], + [ + 1397, + false, + "producer" + ], + [ + 1399, + false, + "producer" + ], + [ + 1401, + false, + "producer" + ], + [ + 1403, + false, + "producer" + ], + [ + 1406, + false, + "producer" + ], + [ + 1408, + false, + "producer" + ], + [ + 1410, + false, + "producer" + ], + [ + 1412, + false, + "producer" + ], + [ + 1415, + false, + "producer" + ], + [ + 1417, + false, + "producer" + ], + [ + 1419, + false, + "producer" + ], + [ + 1421, + false, + "producer" + ], + [ + 1423, + false, + "producer" + ], + [ + 1425, + false, + "producer" + ], + [ + 1427, + false, + "producer" + ], + [ + 1429, + false, + "producer" + ], + [ + 1431, + false, + "producer" + ], + [ + 1433, + false, + "producer" + ], + [ + 1436, + false, + "producer" + ], + [ + 1438, + false, + "producer" + ], + [ + 1440, + false, + "producer" + ], + [ + 1442, + false, + "producer" + ], + [ + 1444, + false, + "producer" + ], + [ + 1446, + false, + "producer" + ], + [ + 1448, + false, + "producer" + ], + [ + 1450, + false, + "producer" + ], + [ + 1452, + false, + "producer" + ], + [ + 1453, + false, + "producer" + ], + [ + 1455, + false, + "producer" + ], + [ + 1457, + false, + "producer" + ], + [ + 1459, + false, + "producer" + ], + [ + 1461, + false, + "producer" + ], + [ + 1598, + false, + "producer" + ], + [ + 1600, + false, + "producer" + ], + [ + 1602, + false, + "producer" + ], + [ + 1604, + false, + "producer" + ], + [ + 1606, + false, + "producer" + ], + [ + 1608, + false, + "producer" + ], + [ + 1610, + false, + "producer" + ], + [ + 1612, + false, + "producer" + ], + [ + 1614, + false, + "producer" + ], + [ + 1616, + false, + "producer" + ], + [ + 1618, + false, + "producer" + ], + [ + 1620, + false, + "producer" + ], + [ + 1622, + false, + "producer" + ], + [ + 1624, + false, + "producer" + ], + [ + 1626, + false, + "producer" + ], + [ + 1628, + false, + "producer" + ], + [ + 1630, + false, + "producer" + ], + [ + 1632, + false, + "producer" + ], + [ + 1633, + false, + "producer" + ], + [ + 1635, + false, + "producer" + ], + [ + 1637, + false, + "producer" + ], + [ + 1639, + false, + "producer" + ], + [ + 1641, + false, + "producer" + ], + [ + 1643, + false, + "producer" + ], + [ + 1817, + false, + "producer" + ], + [ + 1819, + false, + "producer" + ], + [ + 1821, + false, + "producer" + ], + [ + 1823, + false, + "producer" + ], + [ + 1825, + false, + "producer" + ], + [ + 1827, + false, + "producer" + ], + [ + 1829, + false, + "producer" + ], + [ + 1831, + false, + "producer" + ], + [ + 2025, + false, + "collector" + ], + [ + 2026, + false, + "collector" + ], + [ + 2027, + false, + "collector" + ], + [ + 2028, + false, + "collector" + ], + [ + 2029, + false, + "collector" + ], + [ + 2030, + false, + "collector" + ], + [ + 2031, + false, + "collector" + ], + [ + 2032, + false, + "collector" + ], + [ + 2033, + false, + "collector" + ], + [ + 2034, + false, + "collector" + ], + [ + 2035, + false, + "collector" + ], + [ + 2036, + false, + "collector" + ], + [ + 2037, + false, + "collector" + ], + [ + 2038, + false, + "collector" + ], + [ + 2039, + false, + "collector" + ], + [ + 1831, + true, + "return" + ], + [ + 1829, + true, + "return" + ], + [ + 1827, + true, + "return" + ], + [ + 1825, + true, + "return" + ], + [ + 1823, + true, + "return" + ], + [ + 1821, + true, + "return" + ], + [ + 1819, + true, + "return" + ], + [ + 1817, + true, + "return" + ], + [ + 1643, + true, + "return" + ], + [ + 1641, + true, + "return" + ], + [ + 1639, + true, + "return" + ], + [ + 1637, + true, + "return" + ], + [ + 1635, + true, + "return" + ], + [ + 1633, + true, + "return" + ], + [ + 1632, + true, + "return" + ], + [ + 1630, + true, + "return" + ], + [ + 1628, + true, + "return" + ], + [ + 1626, + true, + "return" + ], + [ + 1624, + true, + "return" + ], + [ + 1622, + true, + "return" + ], + [ + 1620, + true, + "return" + ], + [ + 1618, + true, + "return" + ], + [ + 1616, + true, + "return" + ], + [ + 1614, + true, + "return" + ], + [ + 1612, + true, + "return" + ], + [ + 1610, + true, + "return" + ], + [ + 1608, + true, + "return" + ], + [ + 1606, + true, + "return" + ], + [ + 1604, + true, + "return" + ], + [ + 1602, + true, + "return" + ], + [ + 1600, + true, + "return" + ], + [ + 1598, + true, + "return" + ], + [ + 1461, + true, + "return" + ], + [ + 1459, + true, + "return" + ], + [ + 1457, + true, + "return" + ], + [ + 1455, + true, + "return" + ], + [ + 1453, + true, + "return" + ], + [ + 1452, + true, + "return" + ], + [ + 1450, + true, + "return" + ], + [ + 1448, + true, + "return" + ], + [ + 1446, + true, + "return" + ], + [ + 1444, + true, + "return" + ], + [ + 1442, + true, + "return" + ], + [ + 1440, + true, + "return" + ], + [ + 1438, + true, + "return" + ], + [ + 1436, + true, + "return" + ], + [ + 1433, + true, + "return" + ], + [ + 1431, + true, + "return" + ], + [ + 1429, + true, + "return" + ], + [ + 1427, + true, + "return" + ], + [ + 1425, + true, + "return" + ], + [ + 1423, + true, + "return" + ], + [ + 1421, + true, + "return" + ], + [ + 1419, + true, + "return" + ], + [ + 1417, + true, + "return" + ], + [ + 1415, + true, + "return" + ], + [ + 1412, + true, + "return" + ], + [ + 1410, + true, + "return" + ], + [ + 1408, + true, + "return" + ], + [ + 1406, + true, + "return" + ], + [ + 1403, + true, + "return" + ], + [ + 1401, + true, + "return" + ], + [ + 1399, + true, + "return" + ], + [ + 1397, + true, + "return" + ], + [ + 1395, + true, + "return" + ], + [ + 1393, + true, + "return" + ], + [ + 1391, + true, + "return" + ], + [ + 1389, + true, + "return" + ], + [ + 1298, + true, + "return" + ], + [ + 1296, + true, + "return" + ], + [ + 1294, + true, + "return" + ], + [ + 1292, + true, + "return" + ], + [ + 1289, + true, + "return" + ], + [ + 1287, + true, + "return" + ], + [ + 1285, + true, + "return" + ], + [ + 1283, + true, + "return" + ], + [ + 1281, + true, + "return" + ], + [ + 1279, + true, + "return" + ], + [ + 1277, + true, + "return" + ], + [ + 1275, + true, + "return" + ], + [ + 1273, + true, + "return" + ], + [ + 1271, + true, + "return" + ], + [ + 1269, + true, + "return" + ], + [ + 1267, + true, + "return" + ], + [ + 1264, + true, + "return" + ], + [ + 1262, + true, + "return" + ], + [ + 1259, + true, + "return" + ], + [ + 1257, + true, + "return" + ], + [ + 1254, + true, + "return" + ], + [ + 1252, + true, + "return" + ], + [ + 1250, + true, + "return" + ], + [ + 1247, + true, + "return" + ], + [ + 1245, + true, + "return" + ], + [ + 1242, + true, + "return" + ], + [ + 1240, + true, + "return" + ], + [ + 1238, + true, + "return" + ], + [ + 1235, + true, + "return" + ], + [ + 1233, + true, + "return" + ], + [ + 1231, + true, + "return" + ], + [ + 1230, + true, + "return" + ], + [ + 1228, + true, + "return" + ], + [ + 1226, + true, + "return" + ], + [ + 1224, + true, + "return" + ], + [ + 1222, + true, + "return" + ], + [ + 1179, + true, + "return" + ], + [ + 1177, + true, + "return" + ], + [ + 1175, + true, + "return" + ], + [ + 1172, + true, + "return" + ], + [ + 1169, + true, + "return" + ], + [ + 1166, + true, + "return" + ], + [ + 1164, + true, + "return" + ], + [ + 1162, + true, + "return" + ], + [ + 1161, + true, + "return" + ], + [ + 1159, + true, + "return" + ], + [ + 1157, + true, + "return" + ], + [ + 1155, + true, + "return" + ], + [ + 1152, + true, + "return" + ], + [ + 1149, + true, + "return" + ], + [ + 1147, + true, + "return" + ], + [ + 1144, + true, + "return" + ], + [ + 1141, + true, + "return" + ], + [ + 1138, + true, + "return" + ], + [ + 1135, + true, + "return" + ], + [ + 1133, + true, + "return" + ], + [ + 1131, + true, + "return" + ], + [ + 1129, + true, + "return" + ], + [ + 1128, + true, + "return" + ], + [ + 1126, + true, + "return" + ], + [ + 1124, + true, + "return" + ], + [ + 1121, + true, + "return" + ], + [ + 1109, + true, + "return" + ], + [ + 1106, + true, + "return" + ], + [ + 1103, + true, + "return" + ], + [ + 1100, + true, + "return" + ], + [ + 1097, + true, + "return" + ], + [ + 1095, + true, + "return" + ], + [ + 1093, + true, + "return" + ], + [ + 1092, + true, + "return" + ], + [ + 1090, + true, + "return" + ], + [ + 1089, + true, + "return" + ], + [ + 1087, + true, + "return" + ], + [ + 1085, + true, + "return" + ], + [ + 1061, + true, + "return" + ], + [ + 1060, + true, + "return" + ], + [ + 1059, + true, + "return" + ], + [ + 1058, + true, + "return" + ], + [ + 1057, + true, + "return" + ], + [ + 1056, + true, + "return" + ], + [ + 1055, + true, + "return" + ], + [ + 1054, + true, + "return" + ], + [ + 1053, + true, + "return" + ], + [ + 1052, + true, + "return" + ], + [ + 1051, + true, + "return" + ], + [ + 1020, + true, + "return" + ], + [ + 1019, + true, + "return" + ], + [ + 1018, + true, + "return" + ], + [ + 1017, + true, + "return" + ], + [ + 1016, + true, + "return" + ], + [ + 1015, + true, + "return" + ], + [ + 1014, + true, + "return" + ], + [ + 1013, + true, + "return" + ], + [ + 1012, + true, + "return" + ], + [ + 1011, + true, + "return" + ], + [ + 1010, + true, + "return" + ], + [ + 1009, + true, + "return" + ], + [ + 1008, + true, + "return" + ], + [ + 1007, + true, + "return" + ], + [ + 1006, + true, + "return" + ], + [ + 1005, + true, + "return" + ], + [ + 1004, + true, + "return" + ], + [ + 1003, + true, + "return" + ], + [ + 1002, + true, + "return" + ], + [ + 1001, + true, + "return" + ], + [ + 1000, + true, + "return" + ], + [ + 999, + true, + "return" + ], + [ + 998, + true, + "return" + ], + [ + 997, + true, + "return" + ], + [ + 996, + true, + "return" + ], + [ + 995, + true, + "return" + ], + [ + 994, + true, + "return" + ], + [ + 993, + true, + "return" + ], + [ + 992, + true, + "return" + ], + [ + 991, + true, + "return" + ], + [ + 990, + true, + "return" + ], + [ + 989, + true, + "return" + ], + [ + 988, + true, + "return" + ], + [ + 987, + true, + "return" + ], + [ + 986, + true, + "return" + ], + [ + 985, + true, + "return" + ], + [ + 984, + true, + "return" + ], + [ + 983, + true, + "return" + ], + [ + 982, + true, + "return" + ], + [ + 981, + true, + "return" + ], + [ + 980, + true, + "return" + ], + [ + 972, + true, + "return" + ], + [ + 917, + true, + "return" + ], + [ + 915, + true, + "return" + ], + [ + 913, + true, + "return" + ], + [ + 911, + true, + "return" + ], + [ + 909, + true, + "return" + ], + [ + 207, + true, + "return" + ], + [ + 206, + true, + "return" + ], + [ + 205, + true, + "return" + ], + [ + 204, + true, + "return" + ], + [ + 203, + true, + "return" + ], + [ + 202, + true, + "return" + ], + [ + 201, + true, + "return" + ], + [ + 200, + true, + "return" + ], + [ + 199, + true, + "return" + ], + [ + 198, + true, + "return" + ], + [ + 197, + true, + "return" + ], + [ + 196, + true, + "return" + ], + [ + 195, + true, + "return" + ], + [ + 194, + true, + "return" + ], + [ + 193, + true, + "return" + ], + [ + 192, + true, + "return" + ], + [ + 191, + true, + "return" + ], + [ + 190, + true, + "return" + ], + [ + 189, + true, + "return" + ], + [ + 188, + true, + "return" + ], + [ + 187, + true, + "return" + ], + [ + 186, + true, + "return" + ], + [ + 185, + true, + "return" + ], + [ + 184, + true, + "return" + ], + [ + 183, + true, + "return" + ], + [ + 182, + true, + "return" + ], + [ + 181, + true, + "return" + ], + [ + 180, + true, + "return" + ], + [ + 179, + true, + "return" + ], + [ + 178, + true, + "return" + ], + [ + 177, + true, + "return" + ], + [ + 176, + true, + "return" + ], + [ + 175, + true, + "return" + ], + [ + 174, + true, + "return" + ], + [ + 173, + true, + "return" + ], + [ + 172, + true, + "return" + ], + [ + 171, + true, + "return" + ], + [ + 170, + true, + "return" + ], + [ + 169, + true, + "return" + ], + [ + 168, + true, + "return" + ], + [ + 167, + true, + "return" + ], + [ + 136, + true, + "return" + ], + [ + 135, + true, + "return" + ], + [ + 134, + true, + "return" + ], + [ + 133, + true, + "return" + ], + [ + 132, + true, + "return" + ], + [ + 131, + true, + "return" + ], + [ + 130, + true, + "return" + ], + [ + 129, + true, + "return" + ], + [ + 128, + true, + "return" + ], + [ + 127, + true, + "return" + ], + [ + 126, + true, + "return" + ] + ], + "scope": "Core only; both PR3467 codec directions are additional. SWAP, phase, routing, ownership and recursive charges are separate.", + "wrapper_phase_histogram": { + "0": 142512, + "1": 78336, + "2": 112464, + "3": 78336 + } + }, + "negative_controls_executed": true, + "observed_core_bank_event_boundary_component_max": 1332, + "output_q_sha256": "6a42a56f516a1c19847cc05085d8febf6cdc519a2cabcc628ec3677ac1ae75bb", + "returned_coefficient_banks": 52, + "returned_coefficients_sha256": "3c9b2c4dc005d83d73db0244db58bf8f1760a0e6b901ce9f55b1a4b1231d7c46", + "returned_dirty_D_banks": 5, + "status": "PASS_SOURCE_BOUND_RESTORED_QUERY", + "terminal_slots": [ + 2, + 9, + 16, + 27, + 51 + ], + "terminal_sources": [ + "Y99", + "Y100", + "Y66", + "Y72", + "Y80" + ] + }, + "schema_version": 1, + "scope": "Rank9 coefficient caller: codec,257-event cone,15-event collector,252-event selective return,inverse codec. No omitted original histories.", + "source_and_typed_receipt_controls": { + "boolean_integer_distinction": { + "rejected": true + }, + "changed_captured_input": { + "reason": "source changed during replay: fixture", + "rejected": true + }, + "duplicate_key": { + "reason": "duplicate JSON key: x", + "rejected": true + }, + "floating_number": { + "reason": "noninteger JSON numeric token: 1.0", + "rejected": true + }, + "missing_source": { + "rejected": true + }, + "nonfinite_number": { + "reason": "noninteger JSON numeric token: NaN", + "rejected": true + }, + "source_parent_symlink": { + "rejected": true + }, + "source_symlink": { + "rejected": true + }, + "wrong_scientific_bytes": { + "reason": "source digest mismatch: WORD control", + "rejected": true + } + }, + "status": "PASS_P104_RESTORED_QUERY" +} diff --git a/research/p104-restored-query/SOURCES.json b/research/p104-restored-query/SOURCES.json new file mode 100644 index 0000000000..73b7a6c405 --- /dev/null +++ b/research/p104-restored-query/SOURCES.json @@ -0,0 +1,418 @@ +{ + "schema_version": 1, + "base_commit": "6f100d4bb5083f8c35d96fd95a539811c62f245c", + "files": [ + { + "path": "AGENTS.md", + "usage": "provenance", + "bytes": 5580, + "sha256": "eb25d8ec495b80190a4b1a634710819bb74f0fae88d5203285c2b75b6f147347", + "git_blob": "aea5573d1b65cef7d9e08ced46d869e75da8145b", + "purpose": "Entry guidance / selected context at the frozen canonical base; no selected-frontier change." + }, + { + "path": "autoresearch.md", + "usage": "provenance", + "bytes": 5298, + "sha256": "8c98d179208c34a8c6768931e13f3bbeaa1cb63d59c660799ffde05c40935d9b", + "git_blob": "e5445702e6bb589f55f252f7e7468cc7db394ca7", + "purpose": "Entry guidance / selected context at the frozen canonical base; no selected-frontier change." + }, + { + "path": "CONTRIBUTING.md", + "usage": "provenance", + "bytes": 7143, + "sha256": "8a49fe97e2ad088a2b2e0c5b222aaab08752783b1f9c1260790d7dd13011d215", + "git_blob": "fe54f23f19b082a9f8df3da9b2e205f7e230acf3", + "purpose": "Entry guidance / selected context at the frozen canonical base; no selected-frontier change." + }, + { + "path": "docs/research/current-priorities.md", + "usage": "provenance", + "bytes": 11358, + "sha256": "c95e09baa997b48ba00a26ea29168e782b17392d28184ecb7a17eea5472dd77c", + "git_blob": "231a089623bf11a70a434f5a57b0bf0a2ad4c317", + "purpose": "Entry guidance / selected context at the frozen canonical base; no selected-frontier change." + }, + { + "path": "docs/research/research-family-status.md", + "usage": "provenance", + "bytes": 14284, + "sha256": "9b98ab42364e90588e90410fd2773f9bc4bf5050f514101bed0a0246881b5b7e", + "git_blob": "9b7d65650d8fcd6247a758936b24426b40e40efa", + "purpose": "Entry guidance / selected context at the frozen canonical base; no selected-frontier change." + }, + { + "path": "docs/research/agent-procedure.md", + "usage": "provenance", + "bytes": 27753, + "sha256": "b2dd2f64e5746fce6289422351f2e3d1eb224f7db09aeb72f4d6626263190aa1", + "git_blob": "cfb399a5d0b0fcde1ba63adf99c1a6e54cc911b6", + "purpose": "Entry guidance / selected context at the frozen canonical base; no selected-frontier change." + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "bytes": 58553, + "sha256": "47b42433f5a85809a3aadd29c2c339da2c6ed728e4f7762df6b88bccb7874cf0", + "git_blob": "67f085acd86acd7d4e03922d9cf4b26bca66fed5", + "purpose": "Entry guidance / selected context at the frozen canonical base; no selected-frontier change." + }, + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "bytes": 10725, + "sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129", + "git_blob": "b1fea0c94436b236cc2b7d41a7be032811b94c81", + "purpose": "Entry guidance / selected context at the frozen canonical base; no selected-frontier change." + }, + { + "path": "research/p104-rounded-collector/inputs/WORD.json", + "usage": "input", + "bytes": 288482, + "sha256": "cec1fb3fbd0067b500ad5119a62ba60685be718e769374d7ec8abdd2beaa7e50", + "git_blob": "93acaabc0a523789ef2f1b06f6eeeefed5551397", + "purpose": "Exact scientific input: ywz65 PR2586 word/native archive, retained by Arham Tahir PR2665." + }, + { + "path": "research/p104-rounded-collector/inputs/NATIVE.json.gz", + "usage": "input", + "bytes": 49610, + "sha256": "ab91c78835c3e10cf3b2cb8a5d4e0b7cfc3df1ae5a811298d27842f2193e1e3d", + "git_blob": "04f2877aa5444948b7ae37efd267745af82cb34d", + "purpose": "Exact scientific input: ywz65 PR2586 word/native archive, retained by Arham Tahir PR2665." + }, + { + "path": "LICENSE", + "usage": "input", + "bytes": 11357, + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4", + "git_blob": "261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64", + "purpose": "Retained licence/source attribution and predecessor scope; not an executable mathematical dependency." + }, + { + "path": "NOTICE", + "usage": "input", + "bytes": 24973, + "sha256": "b49022cb4104d90b182e4c335f670faf45529025b15db77bf0291835083c28bd", + "git_blob": "59d8e0cf3102e15bd11db430838365531e2d7f18", + "purpose": "Retained licence/source attribution and predecessor scope; not an executable mathematical dependency." + }, + { + "path": "upstream/LICENSE", + "usage": "input", + "bytes": 11357, + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4", + "git_blob": "261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64", + "purpose": "Retained licence/source attribution and predecessor scope; not an executable mathematical dependency." + }, + { + "path": "research/p104-rounded-collector/PREDECESSORS.json", + "usage": "input", + "bytes": 894, + "sha256": "89f17ce76729101536cfc0be02ad153451c6606ebcfd3a1d6588226a83c88c64", + "git_blob": "944b9920686d1f3e23268191fcc652c66d246105", + "purpose": "Retained licence/source attribution and predecessor scope; not an executable mathematical dependency." + }, + { + "path": "research/p104-rounded-collector/README.md", + "usage": "input", + "bytes": 8807, + "sha256": "a77514952eda13fac047c5a4daba92d6c01d3e83bb1b41da4b87211bec6c37c9", + "git_blob": "95288f6821cc4983df25f1f18aaacfc49f4f6299", + "purpose": "Retained licence/source attribution and predecessor scope; not an executable mathematical dependency." + }, + { + "path": "research/p104-restored-query/inputs/ORIGINS.json", + "usage": "input", + "bytes": 2701, + "sha256": "f10dbb7834391792979c3d184402f4aefb85442f5202d07031663d03ffc986d0", + "git_blob": "9f56fec96bc230576eee75f8b36831ffeb3faf09", + "pin": "head:9e501ba770d31c9f3decd51c987081c3b0acd256:research/p104-restored-query/inputs/ORIGINS.json", + "purpose": "Exact predecessor source/proof/credit retained in this publication ancestry; ORIGINS.json records immutable PR3467 paths and hashes." + }, + { + "path": "research/p104-restored-query/inputs/PR3382_PROOF.md", + "usage": "input", + "bytes": 21243, + "sha256": "1ca8c0e7e78f0f39de6cff7accc68ccd3901bfb50759bf7a2e2896bcf63bf081", + "git_blob": "10b3202c788b5b03188eed91181441dfd793ff7f", + "pin": "head:9e501ba770d31c9f3decd51c987081c3b0acd256:research/p104-restored-query/inputs/PR3382_PROOF.md", + "purpose": "Exact predecessor source/proof/credit retained in this publication ancestry; ORIGINS.json records immutable PR3467 paths and hashes." + }, + { + "path": "research/p104-restored-query/inputs/PR3416_PROOF.md", + "usage": "input", + "bytes": 5914, + "sha256": "0dc1c35158902299fc8748c8baf89205483562f041e9050580e6579c331ebeb5", + "git_blob": "276f61cb64d253f6d43e1ec7e8230df551ad02cd", + "pin": "head:9e501ba770d31c9f3decd51c987081c3b0acd256:research/p104-restored-query/inputs/PR3416_PROOF.md", + "purpose": "Exact predecessor source/proof/credit retained in this publication ancestry; ORIGINS.json records immutable PR3467 paths and hashes." + }, + { + "path": "research/p104-restored-query/inputs/PR3426_PROOF.md", + "usage": "input", + "bytes": 7498, + "sha256": "892df1e84bfe8858e45b3bda45d76154a28b5f17e8f1789169d6e112ff0164d1", + "git_blob": "c7007ae86f5efe1785a55335d49737856f326ca5", + "pin": "head:9e501ba770d31c9f3decd51c987081c3b0acd256:research/p104-restored-query/inputs/PR3426_PROOF.md", + "purpose": "Exact predecessor source/proof/credit retained in this publication ancestry; ORIGINS.json records immutable PR3467 paths and hashes." + }, + { + "path": "research/p104-restored-query/inputs/PR3467_COSTS.md", + "usage": "input", + "bytes": 14074, + "sha256": "b23dd2efb8351eaae0af4ebf46df3b7121d925ac7ef75fe8906ef4033316a5ff", + "git_blob": "580057b88f8ae8b58556e4cf2d8aef8c5ef33dcc", + "pin": "head:9e501ba770d31c9f3decd51c987081c3b0acd256:research/p104-restored-query/inputs/PR3467_COSTS.md", + "purpose": "Exact predecessor source/proof/credit retained in this publication ancestry; ORIGINS.json records immutable PR3467 paths and hashes." + }, + { + "path": "research/p104-restored-query/inputs/PR3467_PROOF.md", + "usage": "input", + "bytes": 18727, + "sha256": "4fb79a8da2740ac9608d5e153aec3199ab14e3955cf44710bb0a7f111d745fe1", + "git_blob": "8e10fbbeae2d21ffd7832bdadccc59b76554dec8", + "pin": "head:9e501ba770d31c9f3decd51c987081c3b0acd256:research/p104-restored-query/inputs/PR3467_PROOF.md", + "purpose": "Exact predecessor source/proof/credit retained in this publication ancestry; ORIGINS.json records immutable PR3467 paths and hashes." + }, + { + "path": "research/p104-restored-query/inputs/PR3467_README.md", + "usage": "input", + "bytes": 12579, + "sha256": "4d606001f663bd0d1814b8c7392559379dfc00fe7c9c25967fea9725523a1f96", + "git_blob": "dd0e3bcec20834913c57d8197dcdc0fc6c8c1486", + "pin": "head:9e501ba770d31c9f3decd51c987081c3b0acd256:research/p104-restored-query/inputs/PR3467_README.md", + "purpose": "Exact predecessor source/proof/credit retained in this publication ancestry; ORIGINS.json records immutable PR3467 paths and hashes." + }, + { + "path": "research/p104-restored-query/inputs/pr3467/admission.py", + "usage": "input", + "bytes": 5159, + "sha256": "00bd8c666fa758e76e47fb3e8835dd71770d1ce32c55d71d8d003dca2da15709", + "git_blob": "c035cc9f95b3f9c3a29dbb0e22cbc6816a2b5ade", + "pin": "head:9e501ba770d31c9f3decd51c987081c3b0acd256:research/p104-restored-query/inputs/pr3467/admission.py", + "purpose": "Exact predecessor source/proof/credit retained in this publication ancestry; ORIGINS.json records immutable PR3467 paths and hashes." + }, + { + "path": "research/p104-restored-query/inputs/pr3467/classifier.py", + "usage": "input", + "bytes": 8070, + "sha256": "3e42ba4e5fa1cc819f3e7b773b38ca47476bf85f581f888cc99690e1cf2f2b40", + "git_blob": "6a299ce9b9bae7ee28bd4de6e00757dfe42eff72", + "pin": "head:9e501ba770d31c9f3decd51c987081c3b0acd256:research/p104-restored-query/inputs/pr3467/classifier.py", + "purpose": "Exact predecessor source/proof/credit retained in this publication ancestry; ORIGINS.json records immutable PR3467 paths and hashes." + }, + { + "path": "research/p104-restored-query/inputs/pr3467/inputs/pr3382_model.py", + "usage": "input", + "bytes": 17085, + "sha256": "74c83367887dd885137b222155c86389fe0be9f1293a6f0e5fdb51d71f435fdd", + "git_blob": "4dd24a2627db8239d062afc7888a39bf5cd0f478", + "pin": "head:9e501ba770d31c9f3decd51c987081c3b0acd256:research/p104-restored-query/inputs/pr3467/inputs/pr3382_model.py", + "purpose": "Exact predecessor source/proof/credit retained in this publication ancestry; ORIGINS.json records immutable PR3467 paths and hashes." + }, + { + "path": "research/p104-restored-query/inputs/pr3467/source.py", + "usage": "input", + "bytes": 12067, + "sha256": "c54dabffe141de6befb6069e145c5ccbde629e76afb0f0afa3eb07bd72ab4b25", + "git_blob": "2e6a5116dbe5f7746fa688ece81345ad4a89dd6a", + "pin": "head:9e501ba770d31c9f3decd51c987081c3b0acd256:research/p104-restored-query/inputs/pr3467/source.py", + "purpose": "Exact predecessor source/proof/credit retained in this publication ancestry; ORIGINS.json records immutable PR3467 paths and hashes." + } + ], + "retained_source_commit": "9e501ba770d31c9f3decd51c987081c3b0acd256", + "retained_sources": { + "source_commit": "4e4b08c689242f7f3be2e5e08dc1ae8d728ff920", + "files": [ + { + "path": "research/p104-restored-query/inputs/pr3467/source.py", + "origin_path": "research/p104-stagewise-entrance/source.py", + "bytes": 12067, + "sha256": "c54dabffe141de6befb6069e145c5ccbde629e76afb0f0afa3eb07bd72ab4b25" + }, + { + "path": "research/p104-restored-query/inputs/pr3467/classifier.py", + "origin_path": "research/p104-stagewise-entrance/classifier.py", + "bytes": 8070, + "sha256": "3e42ba4e5fa1cc819f3e7b773b38ca47476bf85f581f888cc99690e1cf2f2b40" + }, + { + "path": "research/p104-restored-query/inputs/pr3467/admission.py", + "origin_path": "research/p104-stagewise-entrance/admission.py", + "bytes": 5159, + "sha256": "00bd8c666fa758e76e47fb3e8835dd71770d1ce32c55d71d8d003dca2da15709" + }, + { + "path": "research/p104-restored-query/inputs/pr3467/inputs/pr3382_model.py", + "origin_path": "research/p104-stagewise-entrance/inputs/pr3382_model.py", + "bytes": 17085, + "sha256": "74c83367887dd885137b222155c86389fe0be9f1293a6f0e5fdb51d71f435fdd" + }, + { + "path": "research/p104-restored-query/inputs/PR3467_PROOF.md", + "origin_path": "research/p104-stagewise-entrance/PROOF.md", + "bytes": 18727, + "sha256": "4fb79a8da2740ac9608d5e153aec3199ab14e3955cf44710bb0a7f111d745fe1" + }, + { + "path": "research/p104-restored-query/inputs/PR3467_README.md", + "origin_path": "research/p104-stagewise-entrance/README.md", + "bytes": 12579, + "sha256": "4d606001f663bd0d1814b8c7392559379dfc00fe7c9c25967fea9725523a1f96" + }, + { + "path": "research/p104-restored-query/inputs/PR3467_COSTS.md", + "origin_path": "research/p104-stagewise-entrance/COSTS.md", + "bytes": 14074, + "sha256": "b23dd2efb8351eaae0af4ebf46df3b7121d925ac7ef75fe8906ef4033316a5ff" + }, + { + "path": "research/p104-restored-query/inputs/PR3382_PROOF.md", + "origin_path": "research/p104-stagewise-entrance/inputs/PR3382_PROOF.md", + "bytes": 21243, + "sha256": "1ca8c0e7e78f0f39de6cff7accc68ccd3901bfb50759bf7a2e2896bcf63bf081" + }, + { + "path": "research/p104-restored-query/inputs/PR3416_PROOF.md", + "origin_path": "research/p104-stagewise-entrance/inputs/PR3416_PROOF.md", + "bytes": 5914, + "sha256": "0dc1c35158902299fc8748c8baf89205483562f041e9050580e6579c331ebeb5" + }, + { + "path": "research/p104-restored-query/inputs/PR3426_PROOF.md", + "origin_path": "research/p104-stagewise-entrance/inputs/PR3426_PROOF.md", + "bytes": 7498, + "sha256": "892df1e84bfe8858e45b3bda45d76154a28b5f17e8f1789169d6e112ff0164d1" + } + ] + }, + "retained_source_policy": "Ten exact predecessor files plus their origin record are committed in this PR ancestry and bound through explicit head pins to that ancestor. Every live pin is declared in VERIFY.json. Standalone verification authenticates their bytes without Git or unmerged predecessor fetches; generic metadata additionally resolves Git pins. Original source files are unchanged.", + "mathematical_dependencies": [ + { + "source": "PR3467", + "statement": "K is the exact 52-bank coefficient isomorphism onto the stagewise module L, with terminal positive4 profiles and index2^20424 in B9^52. S=(4B9)^52 has ambient index2^106496.", + "status": "Inherited written theorem and source implementation, retained and attributed; no human review implied." + }, + { + "source": "PR3382", + "statement": "B9 definition/encoder, actual affine quadratic Gaussian wrapper and C-stage automorphisms, exact literal floor criterion.", + "status": "Inherited written theorem; its reused model is not an independent checker." + }, + { + "source": "PR3416", + "statement": "For each actual PR2586 native occurrence, the full ideal recipe equals Delta_new Delta_old^-1, including global phase.", + "status": "Inherited finite theorem. Actual recipe/source bindings and two separately constructed finite traces are checked here; complete1245-record covariance is not recertified." + }, + { + "source": "PR3426", + "statement": "On the58 initialB9 dependency domain, final ideal cut admission is exactly five disjointY sums in4B9.", + "status": "Predecessor theorem credited; its proof explicitly does not establish arbitrary literal correlated execution." + } + ], + "credit": [ + { + "author": "Clear1nsight, with substantial OpenAI assistance", + "pull_request": 3467, + "head": "4e4b08c689242f7f3be2e5e08dc1ae8d728ff920", + "contribution": "Exact stagewise module, invariant factors, actual-path coefficient codec, independent arithmetic and scoped codec ledger. Four executable inputs are reused by the primary checker and are not claimed independent." + }, + { + "author": "Nick Petalas / petalas", + "pull_request": 3449, + "head": "5cb2ff187a27de1cbd1a37933f7228b35b15702b", + "contribution": "Concurrent sharp two-source calibration of the rank-one interval module; no priority or dependency claim." + }, + { + "author": "Nick Petalas / petalas", + "pull_request": 3426, + "head": "ce2221dddab6efd3027c09269765dd7eb45f2877", + "contribution": "Correlated ideal producer classification, actual paired cancellation, explicit literal-stage admission handoff." + }, + { + "author": "Nick Petalas / petalas", + "pull_request": 3416, + "head": "f1112560883a5e81b1a29c37c81a79a20be31fe3", + "contribution": "All native chart identities and phase certificate; mathematical dependence retained as stated." + }, + { + "author": "Nick Petalas / petalas", + "pull_request": 3406, + "head": "18a054fd585ab4b2010770ec83cba0c9f28184e3", + "contribution": "Different whole-word independent product-domain theorem; not repeated here." + }, + { + "author": "Clear1nsight with substantial OpenAI assistance", + "pull_request": 3423, + "head": "15d28c4de37dc47ea07cd7173c8b318fca7a4d75", + "contribution": "Actual58-bank producer cone, stronger52-source prefix invariant, reachable weak-input witness and bounded consumer/cost contracts." + }, + { + "author": "Clear1nsight with substantial OpenAI assistance", + "pull_request": 3382, + "head": "2834523b1cd4ea83ba7a043e2e2f5f3332cf9909", + "contribution": "Gaussian Newton application, all-rank exactness and codec/intertwiner boundaries; model and proof reused unchanged." + }, + { + "author": "ywz65", + "pull_request": 2586, + "head": "7953c9a8f788a8de5cf2ced63d9a61b67c22c6f1", + "contribution": "Actual word and native archive; original source and physical inverse-transpose credit." + }, + { + "author": "Arham Tahir", + "pull_request": 2665, + "contribution": "Retained rounded-collector scientific inputs and source binding." + }, + { + "author": "Tekalign / tekuuu", + "pull_request": 3025, + "head": "a544ef068a46f4de3bc47d1d02149cbdc3ba547f", + "contribution": "Signed-floor pair and literal wrapper/cleanup conventions; PR3218 separately supplies Pauli-plus-anchor criterion." + }, + { + "author": "Ross Richardson", + "pull_request": 3068, + "head": "7d2c519a1fdcc6bf66f6f08757eed7c48762d3f2", + "contribution": "Neighboring period lattice and larger exactness-domain question." + }, + { + "author": "Jose Manuel / jmbarrancoml and Vasek / flyingviper", + "pull_request": 2744, + "head": "0166260409f55a56e7fefa48d859f7dd5b42b300", + "contribution": "Inherited conditional599/584 unchanged-consumer coverage stop, with all original assumptions." + }, + { + "author": "Retained P104 geometry, native, compiler, precision and repository contributors", + "contribution": "Full predecessor notices remain; no new lattice family or formal/full multiplication verification is claimed." + } + ], + "new_contribution": "Selective restoration through the actual first collector; exact terminal query and shared-section observable quotient; two equivalent strict finite register schedules, full-array source checks and caller/ownership controls.", + "scope_boundary": { + "actual_object": "PR3467 coefficient codec,257-event cone,first15-event collector,252-event selective inverse,inverse codec; rank9,52 coefficient banks,5 dirty D banks,Q7,one private collector C.", + "excluded": "Omitted1,768 prefix events,full5,398-event word,675 external recipients,physical/tape caller,recursive multiplication and selected-frontier change.", + "cost_model": "Strict direct real-register counts and signed widths are constructive; native/codec reference remains separately named component/structural inventory. Physical routing,zero supply,control and recursive charges are unknown.", + "observability": "rho5(L)=rho5(S)=B9^5; L/S is isomorphic to ker(rho5)/(S intersect ker(rho5)). rho5 does not descend to L/S. The complete map returns all52 coefficient banks.", + "family_decision": "Narrow and stop at the named caller/observable audit; unchanged599/584 stop remains." + }, + "coordination_context": { + "claim": "https://github.com/CrocSwap/integer-mult-bounds/discussions/2750#discussioncomment-19010968", + "priority_revision": 6, + "entry_open_pr_count": 427, + "complete_open_pr_pagination": true, + "discussion_pagination_complete": false, + "distinct_predecessors": [ + { + "pull_request": 3466, + "head": "5b240fb98ae187f336b247fb45e59037af131c17", + "scope": "Full-prefix paired Y27/Y26 entrance; not used as our general52-bank caller theorem." + }, + { + "pull_request": 3469, + "head": "f42cc424aad37f5734fd1c893ecdadd8cc53e1c1", + "scope": "93 omitted-frame adapters and separate-bank native-only tariff; no executable imported and no physical caller cost inferred." + } + ] + } +} diff --git a/research/p104-restored-query/TASK.json b/research/p104-restored-query/TASK.json new file mode 100644 index 0000000000..efdf1f0242 --- /dev/null +++ b/research/p104-restored-query/TASK.json @@ -0,0 +1,492 @@ +{ + "schema_version": 1, + "task_id": "p104-side-correction", + "priority_revision": 6, + "base_commit": "6f100d4bb5083f8c35d96fd95a539811c62f245c", + "original_card": { + "id": "p104-side-correction", + "question": "Can the proposed P104 joint endpoint flags be realized by a chronological correction program with coefficients, dirty restoration and an affordable complete bill?", + "starting_points": [ + "docs/research/research-family-status.md", + "research/p104-native-channel/README.md", + "research/p104-native-channel/PROOF.md", + "docs/research/community-efficient1000-review.md", + "research/p104-joint-unit-flags/README.md" + ], + "methods": [ + "Construct one side-correction word at an explicit chronological cut with the needed frames still available.", + "Derive a lower bound on the side correction and hosting costs that decides whether this channel can beat the selected budget." + ], + "acceptance_gate": "An exact arbitrary-input identity, source/target frame availability and restoration at the chosen cut, plus the complete channel+correction+idle/hosting bill or an explicit favorable bound. The native channel alone is not a supplier. A scoped local result may be retained without a complete supplier. Expanding it into further construction rounds requires the family-level budget and obligation gate in research-family-status.md; an optimistic passing relaxation alone is not acceptance.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read the revision-6 family record and #2981 static joint flags, alongside the reviewed #1991 channel. #2981 is an author-checked source archive, not an independently validated executable correction or a refutation of program-level lifetime floors.", + "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": "After checking live handoffs, pin one named collection from #2981 and attach acquisition/delivery times, source dependencies and coefficient requirements. Test legal access and arbitrary dirty restoration; price any completion against the full channel/endpoint/hosting allowance. Stop with the exact missing implication or a scoped counterexample rather than expanding the static cover census.", + "bottleneck_link": "Completing an already realized changed channel tests a concrete construction opportunity, instead of refining the incumbent packing. A positive local result still needs global and all-size admission.", + "allowed_variations": [ + "One correction factorization, one chronological cut, or one explicit hosting obstruction.", + "A changed correction schedule with an updated full bill and native frame contract." + ], + "scope_change_triggers": [ + "Recompiling the already certified low-rank channel without closing a new obligation.", + "Treating a pending ancestor, local histogram or unpriced side correction as an admitted global supplier.", + "Repeating a correction or physical conversion already supplied by a pending follow-up without adding independent coverage or a different unresolved obligation.", + "Repeating the 208-flag static matching or calling a static nested cover a chronological correction program. Independent audit of that certificate is distinct and remains useful." + ], + "overlap_terms": [ + "P104", + "I-G/2", + "side correction", + "native channel", + "1972", + "1991", + "2586", + "endpoint transport", + "physical dual", + "relay composition", + "2981", + "joint unit flags", + "acquisition delivery", + "static nesting" + ], + "existing_checks": [ + { + "scope": "PR #2981 reports static joint endpoint flags and a matching of 208 departure and arrival flags; archival intake is not independent verification.", + "evidence": "research/p104-joint-unit-flags/README.md", + "remaining": "Independent flag check and a chronological coefficient program with dirty restoration and a complete cost.", + "status": "author-checked", + "source_commit": "3d24b92d8ba057b57cb2d480170ec407520e6882", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + } + ] + }, + "author": "Clear1nsight, with substantial OpenAI assistance", + "ai_assistance": "Four concurrent OpenAI agents coordinate, derive, implement and independently cross-check. No independent human or formal proof review is claimed.", + "budget_minutes": null, + "budget_override": "The user removed the 60-minute limit and asked to continue resolving the proposed questions.", + "scope_status": "changed", + "actual_scope": "Close the PR3467 coefficient encoder through the actual 257-event producer cone, first 15-event collector and selective inverse, restoring all coefficient and dirty D banks; prove the collector/query observable quotient and give two directly equivalent strict arithmetic schedules with explicit logical ownership and signed widths.", + "scope_change_reason": "Continue the released PR3467 named-caller handoff. This is a caller and observability audit of the already classified stagewise domain, rather than a new static flag census or a larger entrance lattice. It resolves whether that domain enlargement changes the specified returned query.", + "scope_key": "P104/PR3467/restored-coefficient-caller/selective-return/observable-quotient", + "selection": { + "explicit_assignment": false, + "method": "Handoff first: continue PR3467 Open next questions after live overlap; print the original p104-side-correction card without rerolling.", + "card_seed": "296f10656b2cf98d8c4aa0075c432c47", + "catalogue_scope_key": "72dfbf0708467ad34793", + "canonical_thread": "https://github.com/CrocSwap/integer-mult-bounds/discussions/2750", + "claim_url": "https://github.com/CrocSwap/integer-mult-bounds/discussions/2750#discussioncomment-19010968", + "claim_created_utc": "2026-10-18T04:32:00Z", + "claim_expiry_utc": "2026-10-18T06:32:00Z" + }, + "declared_milestone": "audit", + "bottleneck_link": "Determine what the enlarged source domain actually lets this closed collector compute. An exact quotient and restored direct substitute prevent an entrance index from being mistaken for a new observable, a freed bank, or a supplier saving.", + "outcome": "completed", + "stop_rule": "One bounded caller theorem, explicit direct schedules, complete logical arithmetic/width invoice and independent source-bound replay. Stop at this caller; do not expand to the omitted original prefix, 675 external ports, or an unchanged stopped supplier.", + "optimistic_full_cost_budget": "Compare explicit finite logical schedules under named primitive tariffs. Core native/mixed arithmetic, both codec directions, scratch, returned inputs and finite widths are accounted for or cited with their exact model. Physical routing/control, zero supply and recursive supplier costs are unknown, not zero; unchanged 599/584 stop remains.", + "unresolved_costs": [ + "A physical caller that supplies these exact coefficient meanings and receives these returned outputs", + "Physical zero supply, layout, access, routing and controller costs", + "A fast recursive realization and its complete supplier bill", + "Other actual readouts and the omitted full-prefix or external-recipient execution" + ], + "family_expansion_decision": "narrow: close the named caller and its observable quotient; no expansion of the unchanged stopped supplier", + "predecessor_authors": [ + "ywz65, PR2586 frozen word/native recipes", + "Arham Tahir, PR2665 retained inputs", + "Clear1nsight, PR3382 Newton lattice and PR3423 actual producer interfaces", + "Nick Petalas, PR3426 ideal correlated entrance and PR3416 native covariance", + "Tekalign, PR3025 signed-floor bijection and PR3218 phase-sensitive native checks", + "Ross Richardson, PR3068 exactness-domain question", + "Jose Manuel and Vasek W, inherited unchanged-profile cost stop", + "Nick Petalas, concurrent PR3449 sharp two-source rank-one calibration, read at submission without imported code or priority claim", + "Clear1nsight, PR3467 exact stagewise module, invariant factors and codec; reused retained executable is explicitly not independent", + "Nick Petalas, PR3466 full-prefix paired domain and PR3462/3469 omitted adapters; distinct neighbouring scopes" + ], + "success_evidence": [ + "Written selective-return identity q_out=q+E9(a2+a9+a16+a27+a51), with all52 coefficients and5 dirtyD banks returned", + "Exact shared-section quotient L/S isomorphic to ker(rho5)/(S intersect ker(rho5)); relative index2^86072 adds no five-readout range", + "Two source-authenticated literal implementations compare all prepared,cut,returned andQ arrays; each524-event dense core checks184832 completed pairs", + "Two strict direct schedules match those actual outputs, with exact counters,owned/borrowed contracts,signed width bounds and zero-scratch checks", + "Three distinct source-bound preparation/readout/direct fixtures and semantic,source,ownership,typed-receipt rejection controls" + ], + "entry_overlap": { + "schema_version": 1, + "checked_utc": "2026-10-18T04:30:48+00:00", + "scope": "Entry overlap for the PR3467 closed logical caller and terminal-observation audit", + "canonical_main": { + "head": "6f100d4bb5083f8c35d96fd95a539811c62f245c", + "api_checked_utc": "2026-10-18T04:22:57+00:00", + "guidance_read_first": [ + "AGENTS.md", + "autoresearch.md", + "CONTRIBUTING.md" + ], + "priority_revision": 6, + "unchanged_guidance": true, + "selected_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129", + "git_fetch": "Root reports proxy connection refused; canonical reference and immutable source reads succeeded through GitHub MCP." + }, + "pr_coverage": { + "fetched_utc": "2026-10-18T04:22:57+00:00", + "pages": [ + 100, + 100, + 100, + 100, + 27 + ], + "records": 427, + "unique_records": 427, + "complete_pagination": true, + "non_atomic": true, + "sort": "created descending", + "previous_full_count": 368, + "added_numbers": "3455–3513 inclusive (59)", + "removed": [], + "existing_changed_heads": [ + { + "number": 1365, + "scope": "PR442 Lean entrance projector" + }, + { + "number": 1494, + "scope": "PR442 Lean idle-mask proof" + } + ], + "p104_existing_head_or_body_changes": [] + }, + "relevant_sources": [ + { + "number": 3467, + "head": "4e4b08c689242f7f3be2e5e08dc1ae8d728ff920", + "scope": "General 58-bank/257-event stagewise entrance, explicit 52-bank codec, direct preparation bounds; actual returned-source caller expressly open.", + "relationship": "Direct released handoff; preserve full predecessor credit." + }, + { + "number": 3466, + "head": "5b240fb98ae187f336b247fb45e59037af131c17", + "scope": "Fixed Y27=y,Y26=-y family through the full 2025-event prefix, index868; actual caller and remainder of word open.", + "relationship": "Different source family and observation interval. No direct import or rerun needed for proposed cone-only caller." + }, + { + "number": 3462, + "head": "7f0706bf7e7d6fce317d353d513157ebb368beb6", + "scope": "Rank-eight normalized endpoint completion for the 4027-event projection, 696 omitted effects.", + "relationship": "Different downstream full-endpoint contract; retains physical conversion/caller obligations." + }, + { + "number": 3469, + "head": "f42cc424aad37f5734fd1c893ecdadd8cc53e1c1", + "scope": "93 endpoint adapters, rank mass785, optimal 52*8^s+41*9^s only for separate bank-local native Clifford words with free monomials.", + "relationship": "Adapter handoff is completed. Different from the cone-only logical caller; no free monomial or physical-tariff premise should be borrowed." + }, + { + "number": 3508, + "head": "69b13ac1f39d647c9375582541c5a30bc6419354", + "scope": "Flag43 head-step repair on separate4058-event channel; nine retargeted transports and symbolic price delta.", + "relationship": "Different word and correction contract." + }, + { + "numbers": [ + 3497, + 3498, + 3500, + 3501, + 3507, + 3509, + 3510, + 3511 + ], + "scope": "Granular fixed-cover X102-to-Y71 support recurrence and empty cone intersection.", + "relationship": "No correlated Newton caller overlap; not a reason to repeat the existing fixed-cover census." + } + ], + "feedback": { + "numbers": [ + 3462, + 3466, + 3467, + 3469 + ], + "issue_comments": { + "3462": 0, + "3466": 0, + "3467": 1, + "3469": 0 + }, + "reviews": 0, + "inline_comments": 0, + "comment_3467": { + "author": "Clear1nsight", + "id": 6245000185, + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/3467#issuecomment-6245000185", + "scope": "Own source export/hosted-CI report and postpublication PR3466 context; no external mathematical feedback." + }, + "coverage": "Each of the12 REST comment/review collections requested with per_page100 page1; all returned fewer than100, so complete as observed." + }, + "precise_overlap_scan": { + "corpus": "All427 open PR title/body strings", + "terms": [ + "selective inverse", + "uncompute", + "five terminal coordinates", + "terminal quotient", + "terminal coefficient", + "closed caller", + "Q increment", + "observability", + "coefficient coordinates", + "codec/encoder return" + ], + "material_matches": [ + 3467 + ], + "incidental_matches": [ + 3464, + 3463, + 3386 + ], + "conclusion": "No other observed open PR body describes the selective inverse omitting five Q compensation ADDs, the exact restored coefficient-source caller, or the terminal observable quotient. Root owns current Discussion claim checks; this is not a global novelty assertion." + }, + "proposed_scope": { + "classification": "NARROW; handoff-first continuation of PR3467 question1", + "program": "52-bank encoder -> actual257-event producer cone -> literal15-event first collector -> reverse252 retained cone events, omitting five Q compensation ADDs -> decode", + "claimed_endpoint_to_verify": "Q becomes q+E(sum of five terminal coefficient banks); all52 coefficient banks and five dirty D return, and the private C bank is erased.", + "failure_control": "Full inverse of all257 cone events instead adds the initial dirty sum; demonstrate a nonzero dirty witness.", + "direct_equivalent_to_verify": "One owned-zero scratch: gather five terminal coefficient banks, E, Q ADD, E^-1, ungather, erase.", + "observability_limit": "A kernel statement applies only to the Q increment. Unchanged returned sources remain observable in the whole output. Credit PR3423 for the earlier rank-one observation; do not claim a new general rank-one theorem.", + "exclusions": [ + "Full2025-event prefix", + "Full5398-event word", + "External-recipient closure", + "General physical supplier", + "Free ownership/routing/bit-cost assumptions", + "Selected-frontier change" + ] + }, + "family_decision": "Continue as one bounded source-bound logical caller/observability implication. Price the declared direct primitive schedule and distinguish it from physical implementation and full supplier tariffs. Preserve the conditional unchanged-profile599/584 stop; no family implementation expansion follows automatically.", + "helper": { + "path": "/workspace/scratch/e0f2e65ab885/coordination/readonly-main/scripts/find_overlap.py", + "main_source": "6f100d4bb5083f8c35d96fd95a539811c62f245c", + "cache": "/workspace/scratch/e0f2e65ab885/coordination/p104-next-overlap-cache.json", + "targeted_report": "/workspace/scratch/e0f2e65ab885/coordination/p104-closed-caller-helper.json", + "local_records": 0, + "discussions_complete": false, + "note": "Only immutable current-main guidance/helper sources were recovered; original worktree was pruned. The helper warns that cached data may miss later changes and that Discussion data is absent." + }, + "limits": [ + "Open PRs including drafts, not a complete closed/merged corpus.", + "No arbitrary code-diff search; targeted exact proof/README reads only for3466/3469 and README3467.", + "No native, predecessor or mathematical replay in this audit.", + "Discussions and unpublished work are not included in the helper; root handles browser coverage.", + "No human scientific acceptance inferred from source archives, own comments or hosted-CI claims." + ], + "source_context_file": "/workspace/scratch/e0f2e65ab885/coordination/p104-next-source-context.json", + "source_pin_file": "/workspace/scratch/e0f2e65ab885/coordination/p104-next-context-pins.json" + }, + "checkpoints": [ + { + "checked_at_utc": "2026-10-18T04:22:57Z", + "canonical_main": "6f100d4bb5083f8c35d96fd95a539811c62f245c", + "priority_revision": 6, + "kind": "entry", + "decision": "Follow released PR3467 named-caller handoff; narrow to closed-return/observability audit; retain original frozen inputs and selected frontier.", + "selected_unchanged": true, + "open_pr_count": 427, + "complete_open_pr_pagination": true, + "discussion_pagination_complete": false + }, + { + "checked_at_utc": "2026-10-18T04:50:06Z", + "canonical_main": "6f100d4bb5083f8c35d96fd95a539811c62f245c", + "priority_revision": 6, + "kind": "canonical Git recovery", + "fetch": "Successful canonical blob-filtered Git clone with full commit history; sparse branch from the exact main head. No scientific baseline migration.", + "selected_unchanged": true + }, + { + "checked_at_utc": "2026-10-18T05:11:24.553550+00:00", + "canonical_main": "20ecf2891d80b5acf18d980b2164fb44ea7faa90", + "priority_revision": 6, + "kind": "presubmission compatibility", + "guidance_and_external_live_source_changes": [], + "new_package_path_collisions": [], + "selected_unchanged": true, + "scientific_base_retained": "6f100d4bb5083f8c35d96fd95a539811c62f245c", + "decision": "Continue at the frozen scientific base: new main is a descendant, all relevant guidance/live sources/registered replay tools are byte-identical, and the scoped package path is absent from new main. No source migration or branch rewrite is needed." + }, + { + "checked_at_utc": "2026-10-18T05:29:45Z", + "kind": "final publication checkpoint", + "canonical_main": "20ecf2891d80b5acf18d980b2164fb44ea7faa90", + "priority_revision": 6, + "fetch": "Successful canonical git fetch origin main; main remains the previously checked20ecf289 head. Frozen6f100d4 scientific inputs and source baseline preserved.", + "public_delta_checked_at_utc": "2026-10-18T05:26:43Z", + "public_delta_report_sha256": "0e7efbc83e26b4b8501b0ff942e56c113377f015d822dde84b52ce080a98f590", + "delta": "NewPR3545/3546 and changedPR3544 title/body/head scope are distinct.98 existing records compared in first-page open/closed windows, supplementing the earlier complete open-PR checkpoint.", + "discussion_coverage": "Fresh root reloads of canonical2750 and hub1166 before submission; latest five canonical comments and latest three hub comments checked. Own claim19010968 is active with no replies; nearest claims are DONE/released and latest hub scopes are distinct. Not complete Discussion pagination.", + "decision": "Finish the already claimed bounded restored-caller result; no priority,selected record,input or same-scope overlap change observed. No claim expansion." + } + ], + "first_step_evidence": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "status": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "scope": "Selected bindings and arithmetic orientation; no selected construction, historical suite or Lean replay.", + "record": { + "command": "python3 -B scripts/research_baseline.py", + "cwd": "/tmp/p104-canonical-recovered", + "canonical_head": "6f100d4bb5083f8c35d96fd95a539811c62f245c", + "head_after": "6f100d4bb5083f8c35d96fd95a539811c62f245c", + "started_at": "2026-10-18T04:57:47.040283+00:00", + "finished_at": "2026-10-18T04:57:47.307899+00:00", + "elapsed_seconds": 0.268, + "returncode": 0, + "baseline_status": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "baseline_sha256": "ff159ef8b51213ee06d088103f82e16e094c5b25fba7429999678259e8480262", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129", + "scope": "Source bindings and selected arithmetic orientation only; no historical, Lean or construction replay executed." + } + }, + "retained_source_authentication": { + "origin_commit": "4e4b08c689242f7f3be2e5e08dc1ae8d728ff920", + "files_checked": 10, + "method": "Read-only immutable public-head GitHub file fetches compared byte-for-byte by a separate agent", + "evidence_sha256": "cf0cc47bb913857e810852968d5b5c8a9c8ce54b9a4ab6cd3349bdba227790ab", + "status": "all match; original files unchanged" + }, + "verification_status": { + "environment": "Python3.12.14,standard library only", + "registered_command": [ + "python3.12", + "-B", + "scripts/research_package.py", + "--package", + "research/p104-restored-query" + ], + "metadata": "PASS_PACKAGE_METADATA_AND_PINS", + "registered": "PASS_REGISTERED_RESEARCH_PACKAGE", + "normal_and_optimized_scientific_status": "PASS_P104_RESTORED_QUERY", + "receipt_sha256": "27cf939d8766ac4baa120117d738045c80f8bde285f91446945f52b0f81188a1", + "native_pairs_per_literal_implementation": 184832, + "events_per_literal_implementation": 524, + "returned_coefficient_banks": 52, + "returned_dirty_D_banks": 5, + "independent_human_review": false, + "publication_gates": "The publication PR/handoff records exact committed-byte,source-history,exported CLI and hosted results after the source is frozen. These are separate from the completed registered scientific replay and are not prospectively claimed here." + }, + "evidence": "PROOF.md establishes the selective-return identity and precise shared-section observable quotient. RECEIPT.json is produced by two separately constructed literal implementations and two strict direct schedules with complete array comparisons, distinct kernel fixtures, signed arithmetic/ownership controls and fail-closed source/typed-receipt guards. Generic, exported and public verification evidence is recorded separately in verification_status.", + "open_questions": [ + { + "question": "Which existing physical caller supplies these exact52 coefficient meanings and requires only the restored query output?", + "why_it_matters": "The direct schedules are useful only under a real input/output and ownership contract; no physical supplier saving follows from an abstract equivalent map.", + "first_step": "Name one actual caller and boundary in the frozen program or a changed supplier. State its coefficient interpretation,all reads,52 returned source banks,dirtyD/Q admission and available zero or mutable-terminal storage before pricing access/control.", + "blocked_by": "No such physical coefficient caller is supplied by this package; Physical layout,primitive tariffs,zero supply and complete supplier allowance remain unspecified." + }, + { + "question": "Can a named additional required readout distinguish a ker(rho5) direction while paying for its acquisition and restoration?", + "why_it_matters": "All five existing collector increments and the final query miss the relative-domain enlargement; a useful changed mechanism must expose another actual observable rather than count more admissible states.", + "first_step": "Start with the source-bound Y91/Y90 intermediate witness at1817/1819 and identify one genuinely required legal consumer with an explicit frame,coefficient,ownership and complete cost allowance. Stop if no justified consumer exists.", + "blocked_by": "No additional consumer is claimed here; The full-prefix and675-port contracts belong to distinct work; reuse or audit them rather than expanding this package by default." + } + ], + "presubmission_overlap": { + "checked_utc": "2026-10-18T05:14:32.895617+00:00", + "canonical_main": "20ecf2891d80b5acf18d980b2164fb44ea7faa90", + "frozen_scientific_base": "6f100d4bb5083f8c35d96fd95a539811c62f245c", + "priority_revision": 6, + "checkpoint_decision": "Continue the already claimed bounded restored-caller result. Preserve frozen scientific inputs and base; update archival predecessor statuses and current-main checkpoint. No priority, selected frontier, input-byte or same-scope public-body change found.", + "limits": [ + "This is a current open-PR body/metadata audit, supplemented by the15 newly created closed PRs and three named predecessor feedback collections.", + "No arbitrary code diffs, allclosedPR corpus or complete local research corpus were searched by the helper.", + "Discussions are not in this agent cache; root owns fresh canonical2750/1166 browser checks and must combine that evidence before submission.", + "Concurrent pagination is not an atomic GitHub snapshot and later claims may appear.", + "Merged or successfulCI status does not itself establish scientific acceptance.", + "No Git branch, sparse-checkout, selected record or remote object was mutated by this checkpoint." + ], + "report_sha256": "96b97cfc78dcbeea38f095e4662f9454a4c8dc11a1631ae1c36b5223b6809dd1", + "guidance_files_unchanged": 8, + "scientific_and_retained_blobs_unchanged": 12, + "open_pr_records": 255, + "page_counts": [ + 100, + 100, + 55, + 0, + 0 + ], + "complete_open_pr_pagination": true, + "newly_created_and_merged_gap_prs": [ + 3514, + 3515, + 3516, + 3517, + 3518, + 3519, + 3520, + 3521, + 3522, + 3523, + 3524, + 3525, + 3526, + 3527, + 3528 + ], + "gap_bodies_checked": 15, + "nearest_predecessors": { + "3467": { + "head": "4e4b08c689242f7f3be2e5e08dc1ae8d728ff920", + "status": "merged at unchanged head; no new feedback" + }, + "3466": { + "head": "5b240fb98ae187f336b247fb45e59037af131c17", + "status": "merged at unchanged head; no new feedback" + }, + "3469": { + "head": "f42cc424aad37f5734fd1c893ecdadd8cc53e1c1", + "status": "merged at unchanged head; no new feedback" + } + }, + "same_scope_overlap_observed": false, + "relevant_distinct_p104_prs": [ + 3514, + 3519, + 3532 + ], + "helper": { + "cached_prs": 255, + "discussion_records": 0, + "local_records": 0, + "matches": 7, + "scope": "Actual canonical helper, broad hits individually distinguished; not a novelty certificate." + } + }, + "presubmission_discussions": { + "checked_at_utc": "2026-10-18T05:15:32.379773+00:00", + "threads": [ + 2750, + 1166 + ], + "method": "Freshly reloaded rendered current discussion comments; last7 canonical comments and latest3 hub handoffs read. Prior start-here/entry coverage preserved.", + "our_claim": "discussioncomment-19010968 remains active and unreplied", + "nearest_scopes": "3466/3469 remain DONE/released; latest visible hub handoffs3536/3538/3542 concern different scopes.", + "discussion_pagination_complete": false, + "decision": "No conflicting scoped claim observed. Ready for one focused restored-query PR, not an exhaustive novelty claim." + }, + "publication_source_binding": { + "retained_source_commit": "9e501ba770d31c9f3decd51c987081c3b0acd256", + "retained_tree_sha": "3d4999f0bd2748087c6624d82eb2f727d753943e", + "method": "The connected GitHub app created the retention commit with the exact locally tested tree. Only source-history pins and the generated receipt were rebound; predecessor bytes, mathematical proof, costs, implementation and frozen scientific inputs are unchanged. Final public-commit verification is recorded in the PR handoff." + } +} diff --git a/research/p104-restored-query/VERIFY.json b/research/p104-restored-query/VERIFY.json new file mode 100644 index 0000000000..2355aab768 --- /dev/null +++ b/research/p104-restored-query/VERIFY.json @@ -0,0 +1,49 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/p104-rounded-collector/inputs/WORD.json", + "research/p104-rounded-collector/inputs/NATIVE.json.gz", + "LICENSE", + "NOTICE", + "upstream/LICENSE", + "research/p104-rounded-collector/PREDECESSORS.json", + "research/p104-rounded-collector/README.md", + "research/p104-restored-query/inputs/ORIGINS.json", + "research/p104-restored-query/inputs/PR3382_PROOF.md", + "research/p104-restored-query/inputs/PR3416_PROOF.md", + "research/p104-restored-query/inputs/PR3426_PROOF.md", + "research/p104-restored-query/inputs/PR3467_COSTS.md", + "research/p104-restored-query/inputs/PR3467_PROOF.md", + "research/p104-restored-query/inputs/PR3467_README.md", + "research/p104-restored-query/inputs/pr3467/admission.py", + "research/p104-restored-query/inputs/pr3467/classifier.py", + "research/p104-restored-query/inputs/pr3467/inputs/pr3382_model.py", + "research/p104-restored-query/inputs/pr3467/source.py" + ], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 180, + "checks": "Authenticate all live scientific and retained inputs/proofs; compare two independently constructed literal524-event callers on full arrays; verify selective dirty compensation,exact Q,all source restoration,observable quotient and discriminating fixtures; execute both strict direct schedules with primitive/width/ownership controls; compare a typed deterministic receipt." + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 180, + "checks": "Repeat every registered source,mathematical,arithmetic,ownership and rejection gate under optimized Python; explicit guards remain active and receipt must be identical." + } + ] +} diff --git a/research/p104-restored-query/direct.py b/research/p104-restored-query/direct.py new file mode 100644 index 0000000000..4e077e6583 --- /dev/null +++ b/research/p104-restored-query/direct.py @@ -0,0 +1,446 @@ +"""Strict arithmetic models for the restored-query map in PROOF.md. + +Clear1nsight, with substantial OpenAI assistance. Apache-2.0. + +The caller supplies 52 distinct Gaussian coefficient banks, a separate query, +and the five source-bound terminal slots. This module neither derives those +slots nor proves that a query belongs to the inherited Newton lattice. It +implements Q += E_r(sum of the five terminal coefficient banks), restores all +52 coefficient banks, and cleans one real arithmetic scratch register. + +Only target += source, target -= source, explicit doubling, and checked exact +real halving change arithmetic registers. In particular, there is no +source-minus-target overwrite primitive. Python allocations make this a +functional reference model; the reported storage is the separately described +logical in-place schedule, not a measurement of Python memory or physical tape +cost. Integers have unbounded precision and every observed width is recorded. +""" + +from __future__ import annotations + +import hashlib +import json +from math import comb + + +class DirectError(ValueError): + """A shape, ownership, or arithmetic contract was not met.""" + + +class ExactDivisionError(DirectError): + """An alleged exact real halving had an odd numerator.""" + + +def _require(condition, message): + if not condition: + raise DirectError(message) + + +def _integer(value): + return type(value) is int + + +def _rank(length): + _require(_integer(length) and length > 0, "positive bank length required") + _require(length & (length - 1) == 0, "bank length must be a power of two") + rank = length.bit_length() - 1 + _require(rank <= 9, "finite reference contract is rank 0 through 9") + return rank + + +def _gaussian_bank(bank, length, label): + _require(type(bank) is list, label + " must be a list") + _require(len(bank) == length, label + " has the wrong length") + result = [] + for value in bank: + _require( + type(value) in (tuple, list) and len(value) == 2, + label + " must contain Gaussian pairs", + ) + _require( + all(_integer(component) for component in value), + label + " components must be integers, excluding bool", + ) + result.append((value[0], value[1])) + return result + + +def _digest(value): + encoded = json.dumps(value, separators=(",", ":"), ensure_ascii=True) + return hashlib.sha256(encoded.encode("ascii")).hexdigest() + + +def _magnitude(bank): + return max((abs(component) for value in bank for component in value), default=0) + + +def _pi_power(exponent): + real, imag = 1, 0 + for _ in range(exponent): + real, imag = real - imag, real + imag + return real, imag + + +def encode_gain(rank): + """Exact maximum real absolute row sum of E_r.""" + _require(_integer(rank) and 0 <= rank <= 9, "rank must be an integer in [0, 9]") + return sum( + comb(rank, degree) * sum(abs(x) for x in _pi_power(degree)) + for degree in range(rank + 1) + ) + + +def logical_cost(rank, mode): + """Arithmetic and logical-storage invoice; no physical routing tariff.""" + _require(_integer(rank) and 0 <= rank <= 9, "rank must be an integer in [0, 9]") + _require(mode in ("zero", "inplace"), "mode must be zero or inplace") + length = 1 << rank + pairs = rank * length // 2 + field_operations = 11 if mode == "zero" else 9 + add_sub = 14 * pairs + 2 * length * field_operations + return { + "rank": rank, + "gaussian_entries_per_bank": length, + "newton_pairs_per_direction": pairs, + "full_gaussian_bank_add_sub": field_operations, + "real_add_sub_excluding_doubling": add_sub, + "real_doublings": pairs, + "exact_real_halves": 2 * pairs, + "real_add_sub_if_doubling_is_one_add": add_sub + pairs, + "gaussian_banks_owned_beyond_inputs": 1 if mode == "zero" else 0, + "real_zero_scratch_registers": 1, + "owned_zero_gaussian_bank_initialisations": 1 if mode == "zero" else 0, + "owned_zero_gaussian_bank_erasures": 1 if mode == "zero" else 0, + "arithmetic_scratch_initialisations": 1, + "arithmetic_scratch_zero_checks": 2 * pairs, + "arithmetic_scratch_final_disposals": 1, + } + + +class _StrictMachine: + """Flat real registers with the permitted reversible arithmetic only.""" + + def __init__(self, banks, query_bank, work_bank): + self.length = len(banks[0]) + self.stride = 2 * self.length + self.values = [component for bank in banks for pair in bank for component in pair] + self.tau = len(self.values) + self.values.append(0) + self.query_bank = query_bank + self.work_bank = work_bank + self.counts = {"add": 0, "subtract": 0, "doubling": 0, "exact_half": 0} + self.clean_pi_exits = 0 + self.trace = hashlib.sha256() + self.peak_all = max(abs(x) for x in self.values) + self.peak_nonquery = max( + abs(x) + for index, x in enumerate(self.values) + if index // self.stride != query_bank + ) + self.peak_query = _magnitude(banks[query_bank]) + self.peak_work = _magnitude(banks[work_bank]) + self.peak_tau = 0 + + def _record(self, operation, target, source=None): + record = operation + ":" + str(target) + if source is not None: + record += ":" + str(source) + self.trace.update((record + "\n").encode("ascii")) + magnitude = abs(self.values[target]) + self.peak_all = max(self.peak_all, magnitude) + bank = target // self.stride + if bank == self.query_bank: + self.peak_query = max(self.peak_query, magnitude) + else: + self.peak_nonquery = max(self.peak_nonquery, magnitude) + if bank == self.work_bank: + self.peak_work = max(self.peak_work, magnitude) + if target == self.tau: + self.peak_tau = max(self.peak_tau, magnitude) + + def add(self, target, source, sign=1): + _require(target != source, "aliased ADD requires the explicit doubling primitive") + _require(type(sign) is int and sign in (-1, 1), "ADD sign must be +1 or -1") + self.values[target] += sign * self.values[source] + operation = "add" if sign == 1 else "subtract" + self.counts[operation] += 1 + self._record(operation, target, source) + + def double(self, target): + self.values[target] += self.values[target] + self.counts["doubling"] += 1 + self._record("doubling", target) + + def half(self, target): + if self.values[target] % 2: + raise ExactDivisionError("exact halving rejected an odd signed numerator") + self.values[target] //= 2 + self.counts["exact_half"] += 1 + self._record("exact_half", target) + + def multiply_pi(self, real, imag): + _require(self.values[self.tau] == 0, "pi multiplication requires zero scratch") + self.add(self.tau, real) + self.add(real, imag, -1) + self.add(imag, self.tau) + self.double(self.tau) + self.add(self.tau, real, -1) + self.add(self.tau, imag, -1) + _require(self.values[self.tau] == 0, "pi multiplication left dirty scratch") + self.clean_pi_exits += 1 + + def divide_pi(self, real, imag): + _require(self.values[self.tau] == 0, "pi division requires zero scratch") + self.add(self.tau, real) + self.add(self.tau, imag) + self.half(self.tau) + self.add(imag, real, -1) + self.half(imag) + self.add(real, imag) + self.add(self.tau, real, -1) + _require(self.values[self.tau] == 0, "pi division left dirty scratch") + self.clean_pi_exits += 1 + + def field_add(self, target_bank, source_bank, sign=1): + _require(target_bank != source_bank, "full-bank ADD operands must be distinct") + target_start = target_bank * self.stride + source_start = source_bank * self.stride + for offset in range(self.stride): + self.add(target_start + offset, source_start + offset, sign) + + def newton(self, bank, inverse=False): + rank = _rank(self.length) + bits = range(rank - 1, -1, -1) if inverse else range(rank) + start = bank * self.stride + for bit in bits: + mask = 1 << bit + for low in range(self.length): + if low & mask: + continue + high = low | mask + low_real = start + 2 * low + high_real = start + 2 * high + if inverse: + self.add(high_real, low_real, -1) + self.add(high_real + 1, low_real + 1, -1) + self.divide_pi(high_real, high_real + 1) + else: + self.multiply_pi(high_real, high_real + 1) + self.add(high_real, low_real) + self.add(high_real + 1, low_real + 1) + + def bank(self, bank): + start = bank * self.stride + return [ + (self.values[start + 2 * index], self.values[start + 2 * index + 1]) + for index in range(self.length) + ] + + +def run_direct(coefficients, query, terminal_slots, mode): + """Compute the stated map, returning arrays plus a deterministic receipt. + + Bank-list identities represent logical ownership boundaries. Equal-valued + distinct banks are legal; repeated bank objects, query aliasing, repeated + terminal slots, and Boolean integer fields are rejected. The inputs are + copied by this reference implementation. In logical inplace mode the + first supplied terminal bank is mutable work and is restored exactly. + + The query need not be in B_r for this arithmetic model to run. Admission + of the initial query to B_r, when that is the surrounding caller contract, + is a separate obligation; adding E_r of a Gaussian vector preserves it. + """ + _require(type(coefficients) is list and len(coefficients) == 52, "52 coefficient banks required") + _require(type(query) is list, "query must be a list") + length = len(query) + rank = _rank(length) + _require(len({id(bank) for bank in coefficients}) == 52, "coefficient banks must be distinct") + _require(all(query is not bank for bank in coefficients), "query must be distinct from coefficients") + _require(type(terminal_slots) in (tuple, list) and len(terminal_slots) == 5, "five terminal slots required") + _require( + all(_integer(slot) and 0 <= slot < 52 for slot in terminal_slots), + "terminal slots must be integer indices in [0, 51]", + ) + _require(len(set(terminal_slots)) == 5, "terminal slots must be distinct") + _require(type(mode) is str and mode in ("zero", "inplace"), "mode must be zero or inplace") + originals = [_gaussian_bank(bank, length, "coefficient bank") for bank in coefficients] + initial_query = _gaussian_bank(query, length, "query") + banks = [list(bank) for bank in originals] + [list(initial_query)] + query_bank = 52 + if mode == "zero": + banks.append([(0, 0) for _ in range(length)]) + work_bank = 53 + gather_slots = list(terminal_slots) + else: + work_bank = terminal_slots[0] + gather_slots = list(terminal_slots[1:]) + machine = _StrictMachine(banks, query_bank, work_bank) + for slot in gather_slots: + machine.field_add(work_bank, slot) + machine.newton(work_bank) + machine.field_add(query_bank, work_bank) + machine.newton(work_bank, inverse=True) + for slot in reversed(gather_slots): + machine.field_add(work_bank, slot, -1) + result_coefficients = [machine.bank(index) for index in range(52)] + result_query = machine.bank(query_bank) + _require(result_coefficients == originals, "coefficient restoration failed") + _require(machine.values[machine.tau] == 0, "final real scratch is dirty") + zero_erased = mode == "zero" and all(pair == (0, 0) for pair in machine.bank(work_bank)) + _require(mode != "zero" or zero_erased, "owned Gaussian scratch was not zero at erase") + invoice = logical_cost(rank, mode) + observed = machine.counts + _require( + observed["add"] + observed["subtract"] == invoice["real_add_sub_excluding_doubling"], + "observed ADD/SUB count differs from schedule", + ) + _require(observed["doubling"] == invoice["real_doublings"], "doubling count differs") + _require(observed["exact_half"] == invoice["exact_real_halves"], "half count differs") + _require(machine.clean_pi_exits == invoice["arithmetic_scratch_zero_checks"], "scratch check count differs") + coefficient_bound = max(_magnitude(bank) for bank in originals) + query_bound = _magnitude(initial_query) + gain = encode_gain(rank) + arithmetic_bound = 20 * gain * coefficient_bound + stored_bound = 5 * gain * coefficient_bound + final_query_bound = query_bound + stored_bound + _require(machine.peak_nonquery <= arithmetic_bound, "non-query arithmetic exceeded proved width") + _require(machine.peak_query <= final_query_bound, "query exceeded proved width") + receipt = { + "status": "PASS", + "mode": mode, + "rank": rank, + "terminal_slots": list(terminal_slots), + "logical_work_bank": "owned_zero" if mode == "zero" else terminal_slots[0], + "all_52_coefficient_banks_restored": True, + "query_initial_B_admission_checked_here": False, + "real_scratch_final": machine.values[machine.tau], + "owned_gaussian_scratch_zero_erased": zero_erased if mode == "zero" else None, + "invoice": invoice, + "observed_primitives": dict(observed), + "completed_pi_operations_with_zero_scratch": machine.clean_pi_exits, + "instruction_sha256": machine.trace.hexdigest(), + "initial_coefficients_sha256": _digest(originals), + "final_coefficients_sha256": _digest(result_coefficients), + "initial_query_sha256": _digest(initial_query), + "final_query_sha256": _digest(result_query), + "width": { + "initial_coefficient_component_bound_H": coefficient_bound, + "initial_query_component_bound_J": query_bound, + "newton_real_row_sum_gain": gain, + "proved_stored_encoded_sum_bound": stored_bound, + "proved_nonquery_arithmetic_bound": arithmetic_bound, + "proved_query_bound": final_query_bound, + "observed_all_registers": machine.peak_all, + "observed_nonquery_registers": machine.peak_nonquery, + "observed_work_bank": machine.peak_work, + "observed_query": machine.peak_query, + "observed_real_scratch": machine.peak_tau, + "observed_signed_storage_bits": machine.peak_all.bit_length() + 1, + }, + } + return {"coefficients": result_coefficients, "query": result_query, "receipt": receipt} + + +def _closed_form_encode(values): + """Small independent subset formula used only by the local controls.""" + rank = _rank(len(values)) + output = [] + for address in range(1 << rank): + real, imag = 0, 0 + subset = address + while True: + power_real, power_imag = _pi_power(subset.bit_count()) + source_real, source_imag = values[subset] + real += power_real * source_real - power_imag * source_imag + imag += power_real * source_imag + power_imag * source_real + if subset == 0: + break + subset = (subset - 1) & address + output.append((real, imag)) + return output + + +def _expect_reject(callback, error=DirectError): + try: + callback() + except error as exception: + return {"status": "REJECT", "reason": str(exception)} + raise DirectError("negative control was unexpectedly accepted") + + +def verify_controls(): + """Bounded signed, low-rank, arithmetic, and ownership controls. + + This is a reference-model gate. It does not repeat the native source + replay, authenticate terminal slots, or supply physical ownership proof. + """ + slots = [2, 9, 16, 27, 51] + cases = [] + for rank in (0, 1, 2, 9): + length = 1 << rank + coefficients = [ + [ + ( + ((37 * bank + 17 * index + 3 * index.bit_count()) % 11) - 5, + ((19 * bank + 29 * index + 5 * index.bit_count()) % 13) - 6, + ) + for index in range(length) + ] + for bank in range(52) + ] + query = [((7 * index % 17) - 8, (11 * index % 19) - 9) for index in range(length)] + terminal_sum = [ + tuple(sum(coefficients[slot][index][part] for slot in slots) for part in (0, 1)) + for index in range(length) + ] + increment = _closed_form_encode(terminal_sum) + expected = [(q[0] + y[0], q[1] + y[1]) for q, y in zip(query, increment)] + receipts = [] + for mode in ("zero", "inplace"): + result = run_direct(coefficients, query, slots, mode) + _require(result["query"] == expected, "subset-formula endpoint control failed") + _require(result["coefficients"] == coefficients, "dirty coefficient restoration control failed") + receipts.append(result["receipt"]) + cases.append({"rank": rank, "subset_formula_endpoint_sha256": _digest(expected), "modes": receipts}) + pi_roundtrips = 0 + signed_exact_divisions = 0 + for real in range(-4, 5): + for imag in range(-4, 5): + machine = _StrictMachine([[(real, imag)], [(0, 0)]], 1, 0) + machine.multiply_pi(0, 1) + _require(machine.bank(0) == [(real - imag, real + imag)], "pi control failed") + machine.divide_pi(0, 1) + _require(machine.bank(0) == [(real, imag)], "inverse pi control failed") + _require(machine.values[machine.tau] == 0, "roundtrip scratch control failed") + pi_roundtrips += 1 + signed_exact_divisions += 2 + odd_machine = _StrictMachine([[(-1, 0)], [(0, 0)]], 1, 0) + dirty_machine = _StrictMachine([[(1, -2)], [(0, 0)]], 1, 0) + dirty_machine.values[dirty_machine.tau] = 1 + zero_coefficients = [[(0, 0)] for _ in range(52)] + zero_query = [(0, 0)] + aliased_coefficients = list(zero_coefficients) + aliased_coefficients[1] = aliased_coefficients[0] + boolean_coefficients = [[(0, 0)] for _ in range(52)] + boolean_coefficients[0] = [(False, 0)] + rejections = { + "negative_odd_pi_division": _expect_reject(lambda: odd_machine.divide_pi(0, 1), ExactDivisionError), + "dirty_real_scratch": _expect_reject(lambda: dirty_machine.multiply_pi(0, 1)), + "aliased_coefficient_bank": _expect_reject(lambda: run_direct(aliased_coefficients, zero_query, slots, "zero")), + "aliased_query": _expect_reject(lambda: run_direct(zero_coefficients, zero_coefficients[0], slots, "inplace")), + "repeated_terminal_slot": _expect_reject(lambda: run_direct(zero_coefficients, zero_query, [2, 9, 16, 27, 27], "zero")), + "boolean_terminal_slot": _expect_reject(lambda: run_direct(zero_coefficients, zero_query, [False, 9, 16, 27, 51], "zero")), + "boolean_component": _expect_reject(lambda: run_direct(boolean_coefficients, zero_query, slots, "zero")), + } + equal_values = [ + run_direct(zero_coefficients, zero_query, slots, mode)["receipt"] + for mode in ("zero", "inplace") + ] + return { + "status": "PASS", + "signed_rank_cases": cases, + "small_signed_pi_roundtrips": pi_roundtrips, + "small_signed_exact_halves": signed_exact_divisions, + "rejected_controls": rejections, + "equal_valued_distinct_banks": equal_values, + } diff --git a/research/p104-restored-query/independent.py b/research/p104-restored-query/independent.py new file mode 100644 index 0000000000..450edfe2a8 --- /dev/null +++ b/research/p104-restored-query/independent.py @@ -0,0 +1,628 @@ +#!/usr/bin/env python3 +"""Independent literal replay of the restored first-collector caller. + +Clear1nsight, with substantial OpenAI assistance. Apache-2.0. +Gaussian arithmetic and the Y-path coefficient construction are adapted from +our independently written PR3467 independent.py, frozen at 4e4b08c689242f7f. +This file imports no predecessor or primary executable. The new source scan, +selective return schedule, full-array endpoint checks and controls are local. +The predecessor's universal module and native-covariance proofs are inherited; +their historical basis suites are not rerun here. +""" + +import argparse +from collections import Counter +from fractions import Fraction +import gzip +import hashlib +import io +import json +from pathlib import Path + + +WORD_SHA256 = "cec1fb3fbd0067b500ad5119a62ba60685be718e769374d7ec8abdd2beaa7e50" +NATIVE_SHA256 = "ab91c78835c3e10cf3b2cb8a5d4e0b7cfc3df1ae5a811298d27842f2193e1e3d" +SIZE = 512 +RANK = 9 +D_BANKS = ("D31", "D30", "D29", "D28", "D27") +DIRTY = (*D_BANKS, "Q7") +O_FRAME = (256, 136, 64, 40, 16, 4, 2, 1) +P_FRAME = (364,) +ZERO = (0, 0) +PI = ((1, 0), (1, 1), (0, 2), (-2, 2), (-4, 0)) + + +class ReplayFailure(ValueError): + """A precisely located arithmetic, lifetime or endpoint rejection.""" + + def __init__(self, record): + super().__init__(record["kind"]) + self.record = record + + +def need(condition, message): + if not condition: + raise ValueError(message) + + +def canonical(value): + return json.dumps(value, sort_keys=True, separators=(",", ":"), allow_nan=False) + + +def digest(value): + return hashlib.sha256(canonical(value).encode()).hexdigest() + + +def strict_json(raw): + def pairs(items): + out = {} + for key, value in items: + need(key not in out, "duplicate source JSON key") + out[key] = value + return out + def forbidden(value): + raise ValueError("noninteger JSON number: " + value) + return json.loads(raw, object_pairs_hook=pairs, + parse_float=forbidden, parse_constant=forbidden) + + +def read_pinned(path, expected): + path = Path(path) + need(path.is_file() and not path.is_symlink(), "regular scientific input required") + with path.open("rb") as handle: + raw = handle.read(1048577) + need(len(raw) <= 1048576, "scientific input capacity") + need(hashlib.sha256(raw).hexdigest() == expected, "scientific source SHA256 mismatch") + return raw + + +def read_inputs(word_path, native_path): + word = strict_json(read_pinned(word_path, WORD_SHA256)) + compressed = read_pinned(native_path, NATIVE_SHA256) + with gzip.GzipFile(fileobj=io.BytesIO(compressed)) as handle: + raw = handle.read(8388609) + need(len(raw) <= 8388608, "native expansion capacity") + return word, strict_json(raw) + + +def native_bindings(word, archive): + need(len(word["program"]) == 5398, "frozen word length") + need(len(word["initial_frames"]) == 358, "frozen public role count") + need(len(archive["transports"]) == 1245, "frozen native class count") + need(word["chart"] == archive["chart"], "native chart binding") + bound = {} + for record in archive["transports"]: + recipe = record["recipe"] + need(type(recipe["rank"]) is int and 1 <= recipe["rank"] <= RANK, "native rank") + for event in record["events"]: + need(type(event) is int and 0 <= event < 5398 and event not in bound, + "unique native occurrence") + literal = word["program"][event] + need(literal[0] == "transport", "native occurrence opcode") + need(literal[2:] == [record["old"], record["new"], recipe["rank"]], + "native occurrence/frame/rank binding") + bound[event] = recipe + expected = {i for i, event in enumerate(word["program"]) if event[0] == "transport"} + need(set(bound) == expected and len(bound) == 2070, "all native occurrences bound") + return bound + + +def select_source(word): + program, needed, selected = word["program"], set(DIRTY), [] + for event in reversed(range(2025)): + row = program[event] + if row[1] in needed: + need(row[0] in ("add", "transport"), "producer operation alphabet") + selected.append(event) + if row[0] == "add": + needed.add(row[2]) + selected.reverse() + ys = {"Y" + str(i) for i in (*range(22, 33), *range(63, 104))} + need(needed == ys | set(DIRTY) and len(selected) == 257, "exact producer cone") + need(all(word["initial_frames"][bank] == [] for bank in needed), "empty caller frames") + groups, slots = source_slots(program, selected) + compensation = [i for i in selected if program[i][:2] == ["add", "Q7"]] + need(compensation == [908, 910, 912, 914, 916], "five initial dirty compensations") + need([program[i][2] for i in compensation] == list(D_BANKS), "dirty compensation order") + need(all(Fraction(str(program[i][3])) == -1 and program[i][4] == [] + for i in compensation), "dirty compensation coefficients and frame") + need([i for i in selected if program[i][:2] == ["transport", "Q7"]] == [972], + "single Q frame map") + reverse = [(i, True) for i in reversed(selected) if i not in compensation] + need(len(reverse) == 252, "selective return count") + check_collector(program) + return {"cone": selected, "roles": sorted(needed), "groups": groups, "slots": slots, + "compensation": compensation, "reverse": reverse} + + +def source_slots(program, selected): + paths = {bank: [] for bank in (*DIRTY, *("Y" + str(i) for i in range(104)))} + groups = {bank: [] for bank in D_BANKS} + for event in selected: + row = program[event] + if row[0] == "transport": + paths[row[1]].append(event) + elif row[1] in groups: + need(str(row[3]) == "1/4" and row[2].startswith("Y"), "group quarter read") + groups[row[1]].append({"event": event, "source": row[2], "bank": row[1], + "source_path": paths[row[2]][:], "frame": row[4]}) + need([len(groups[bank]) for bank in D_BANKS] == [3, 7, 7, 11, 24], "group lengths") + slots = [] + for bank in D_BANKS: + rows = groups[bank] + for index, row in enumerate(rows): + following = rows[index + 1]["event"] if index + 1 < len(rows) else None + between = [] if following is None else [i for i in selected + if row["event"] < i < following and program[i][1] == bank] + need(all(program[i][0] == "transport" for i in between), "pure native gap") + need(len(between) <= 1, "single native per nonterminal gap") + if between: + need(program[between[0]][4] == 1, "rank-one interval") + kind = "terminal" if following is None else ("rank_one" if between else "zero") + slots.append({**row, "kind": kind, "next_event": following, + "transport_event": between[0] if between else None}) + need(len({slot["source"] for slot in slots}) == 52, "disjoint source groups") + need(Counter(slot["kind"] for slot in slots) == {"zero": 32, "rank_one": 15, "terminal": 5}, + "inherited interval census") + return groups, slots + + +def check_collector(program): + actual = program[2025:2040] + need(actual[0] == ["zero", "C", list(O_FRAME)], "literal collector allocation") + need(actual[6] == ["transport", "C", list(O_FRAME), list(P_FRAME), 7], "actual U event") + need(actual[8] == ["transport", "C", list(P_FRAME), list(O_FRAME), 7], "actual V event") + need(actual[-1] == ["erase", "C", list(O_FRAME)], "literal collector erasure") + for offset, bank in enumerate(D_BANKS, 1): + row = actual[offset] + need(row[:3] == ["add", "C", bank] and Fraction(str(row[3])) == 1 + and row[4] == list(O_FRAME), "collector gather order") + for offset, bank in enumerate(reversed(D_BANKS), 9): + row = actual[offset] + need(row[:3] == ["add", "C", bank] and Fraction(str(row[3])) == -1 + and row[4] == list(O_FRAME), "collector cleanup order") + need(actual[7][:3] == ["add", "Q7", "C"] and Fraction(str(actual[7][3])) == 1 + and actual[7][4] == list(P_FRAME), "collector readout") + + +def add(a, b): + return a[0] + b[0], a[1] + b[1] + + +def subtract(a, b): + return a[0] - b[0], a[1] - b[1] + + +def multiply(a, b): + return a[0] * b[0] - a[1] * b[1], a[0] * b[1] + a[1] * b[0] + + +def rotate(value, phase): + a, b = value + return ((a, b), (-b, a), (-a, -b), (b, -a))[phase % 4] + + +def vector_check(value): + need(type(value) is list and len(value) == SIZE, "Gaussian vector shape") + need(all(type(z) in (list, tuple) and len(z) == 2 and all(type(x) is int for x in z) + for z in value), "Gaussian integer components") + + +def encode(coefficients): + vector_check(coefficients) + out = [tuple(z) for z in coefficients] + for bit in range(RANK): + step = 1 << bit + for address in range(SIZE): + if not address & step: + out[address | step] = add(out[address], multiply(PI[1], out[address | step])) + return out + + +def divide_pi(value): + a, b = value + need((a + b) % 2 == 0, "unavailable exact Gaussian division") + return (a + b) // 2, (b - a) // 2 + + +def decode(values): + out = [tuple(z) for z in values] + for bit in reversed(range(RANK)): + step = 1 << bit + for address in range(SIZE): + if not address & step: + out[address | step] = divide_pi(subtract(out[address | step], out[address])) + return out + + +def pair(a, b, inverse, event, bit, address): + dr, di = subtract(a, b) + sign = -1 if inverse else 1 + ar, ai = add(a, b) + nums = ((ar - sign * di, ai + sign * dr), (ar + sign * di, ai - sign * dr)) + if any(x % 2 for z in nums for x in z): + raise ReplayFailure({"kind": "nonintegral_ideal_pair", "event": event, + "inverse": inverse, "bit": bit, "address": address}) + ideal = tuple((r // 2, i // 2) for r, i in nums) + middle = add(b, (dr // 2, di // 2)) + turned = (di, -dr) if inverse else (-di, dr) + second = subtract(middle, (turned[0] // 2, turned[1] // 2)) + literal = (add(second, turned), second) + need(literal == ideal, "completed signed-floor pair differs from ideal") + return literal + + +def wrapper_plan(record): + rows, linear, quadratic = (record[k] for k in ("matrix_rows", "linear_Z4", "quadratic_rows")) + need(len(rows) == len(linear) == len(quadratic) == RANK, "wrapper dimensions") + need(all(type(x) is int and 0 <= x < SIZE for x in rows + quadratic), "binary rows") + need(all(type(x) is int and 0 <= x < 4 for x in linear), "linear phases") + need(type(record["offset"]) is int and 0 <= record["offset"] < SIZE, "affine offset") + need(type(record["phase"]) is int and 0 <= record["phase"] < 4, "global phase") + mapping = [] + for address in range(SIZE): + target = record["offset"] ^ sum(((address & row).bit_count() % 2) << bit + for bit, row in enumerate(rows)) + phase = record["phase"] + for bit in range(RANK): + if address & (1 << bit): + phase += linear[bit] + upper = quadratic[bit] & ~((1 << (bit + 1)) - 1) + phase += 2 * (upper & address).bit_count() + mapping.append((target, phase % 4)) + need({target for target, _ in mapping} == set(range(SIZE)), "wrapper bijection") + return mapping + + +def wrapper(values, mapping, inverse=False): + out = [ZERO] * SIZE + for source, (target, phase) in enumerate(mapping): + if inverse: + out[source] = rotate(values[target], -phase) + else: + out[target] = rotate(values[source], phase) + return out + + +class Arithmetic: + def __init__(self, bound): + self.bound = bound + self.plans = {} + + def plan(self, raw): + key = canonical(raw) + if key not in self.plans: + need(len(self.plans) < 2500, "wrapper plan capacity") + self.plans[key] = wrapper_plan(raw) + return self.plans[key] + + def native(self, values, event, inverse=False, counts=None): + recipe = self.bound[event] + first, last = ("left", "right") if inverse else ("right", "left") + out = wrapper(values, self.plan(recipe[first]), inverse) + bits = reversed(range(recipe["rank"])) if inverse else range(recipe["rank"]) + for bit in bits: + step = 1 << bit + for address in range(SIZE): + if not address & step: + out[address], out[address | step] = pair( + out[address], out[address | step], inverse, event, bit, address) + if counts is not None: + counts["completed_literal_pairs"] += 1 + if counts is not None: + counts["native_occurrences"] += 1 + counts["native_rank_mass"] += recipe["rank"] + counts["inverse_native_occurrences"] += int(inverse) + counts["wrappers"] += 2 + return wrapper(out, self.plan(recipe[last]), inverse) + + def path(self, values, path, inverse=False): + out = list(values) + for event in reversed(path) if inverse else path: + out = self.native(out, event, inverse) + return out + + +def exponents(kind): + return [max(4 - (mask & ~1 if kind == "rank_one" else mask).bit_count(), 0) + for mask in range(SIZE)] + + +def prepare(parameters, slots, arithmetic): + need(type(parameters) is list and len(parameters) == 52, "52 coefficient banks") + initial, previous, bank = {}, [ZERO] * SIZE, None + for slot, coefficients in zip(slots, parameters, strict=True): + vector_check(coefficients) + if bank != slot["bank"]: + previous, bank = [ZERO] * SIZE, slot["bank"] + if slot["kind"] == "terminal": + partial = [(4 * r, 4 * i) for r, i in encode(coefficients)] + else: + weighted = [multiply(PI[e], value) for e, value in + zip(exponents(slot["kind"]), coefficients, strict=True)] + partial = encode(weighted) + if slot["kind"] == "rank_one": + right = arithmetic.bound[slot["transport_event"]]["right"] + partial = wrapper(partial, arithmetic.plan(right), inverse=True) + partial = arithmetic.path(partial, slot["source_path"], inverse=True) + initial[slot["source"]] = [subtract(new, old) for new, old in + zip(partial, previous, strict=True)] + previous = partial + need(len(initial) == 52, "all prepared sources") + for values in initial.values(): + decode(values) + return initial + + +def recover(initial_y, slots, arithmetic): + recovered, total, bank = [], [ZERO] * SIZE, None + for slot in slots: + if bank != slot["bank"]: + total, bank = [ZERO] * SIZE, slot["bank"] + total = [add(a, b) for a, b in zip(total, initial_y[slot["source"]], strict=True)] + if slot["kind"] == "terminal": + values = decode(total) + need(all(x % 4 == 0 for z in values for x in z), "terminal exact division") + coefficients = [(r // 4, i // 4) for r, i in values] + else: + values = arithmetic.path(total, slot["source_path"]) + if slot["kind"] == "rank_one": + right = arithmetic.bound[slot["transport_event"]]["right"] + values = wrapper(values, arithmetic.plan(right)) + coefficients = decode(values) + for index, exponent in enumerate(exponents(slot["kind"])): + for _ in range(exponent): + coefficients[index] = divide_pi(coefficients[index]) + recovered.append(coefficients) + return recovered + + +def clone_state(state): + return {bank: list(values) for bank, values in state.items()} + + +def increment(values, coefficient, event): + numerator, denominator = coefficient.as_integer_ratio() + need(abs(numerator) == 1 and denominator in (1, 4), "caller scalar alphabet") + for address, value in enumerate(values): + if any(numerator * x % denominator for x in value): + raise ReplayFailure({"kind": "nonintegral_addend", "event": event, + "address": address, "coefficient": str(coefficient)}) + return [(numerator * r // denominator, numerator * i // denominator) for r, i in values] + + +def run_steps(state, frames, steps, word, arithmetic, mutation=None): + counts = Counter() + for event, inverse in steps: + if mutation == "omit_q_return" and event == 972 and inverse: + continue + row = word["program"][event] + op, target = row[:2] + counts["events"] += 1 + if op == "transport": + old, new = (row[3], row[2]) if inverse else (row[2], row[3]) + need(frames[target] == tuple(old), "actual native entrance frame") + state[target] = arithmetic.native(state[target], event, inverse, counts) + frames[target] = tuple(new) + if mutation == "extra_native_phase" and event == 2031: + state[target] = [rotate(z, 1) for z in state[target]] + elif op == "add": + source = row[2] + need(frames[target] == frames[source] == tuple(row[4]), "common ADD frame") + coefficient = Fraction(str(row[3])) * (-1 if inverse else 1) + if mutation == "wrong_query_sign" and event == 2032: + coefficient = -coefficient + values = increment(state[source], coefficient, event) + state[target] = [add(a, b) for a, b in zip(state[target], values, strict=True)] + counts["weighted_adds"] += 1 + counts["quarter_adds"] += int(coefficient.denominator == 4) + elif op == "zero": + need(not inverse and target not in state, "private allocation") + state[target], frames[target] = [ZERO] * SIZE, tuple(row[2]) + counts["private_zero"] += 1 + else: + need(op == "erase" and not inverse and frames[target] == tuple(row[2]), "erase frame") + bad = next((i for i, z in enumerate(state[target]) if z != ZERO), None) + if bad is not None: + raise ReplayFailure({"kind": "private_not_zero", "event": event, + "bank": target, "address": bad, "value": state[target][bad]}) + del state[target] + del frames[target] + counts["private_erase"] += 1 + return counts + + +def summed(vectors): + out = [ZERO] * SIZE + for vector in vectors: + out = [add(a, b) for a, b in zip(out, vector, strict=True)] + return out + + +def endpoint(state, frames, initial, expected_q): + need(set(state) == set(initial) and "C" not in state, "returned public role set") + for bank in sorted(frames): + if frames[bank] != (): + raise ReplayFailure({"kind": "return_frame", "bank": bank, + "actual": list(frames[bank]), "expected": []}) + for bank in sorted(initial): + expected = expected_q if bank == "Q7" else initial[bank] + if state[bank] != expected: + first = next(i for i in range(SIZE) if state[bank][i] != expected[i]) + raise ReplayFailure({"kind": "query_endpoint" if bank == "Q7" else "source_return", + "bank": bank, "address": first, + "actual": state[bank][first], "expected": expected[first]}) + + +def rejection(operation, kind): + try: + operation() + except ReplayFailure as error: + need(error.record["kind"] == kind, "control failed at wrong boundary") + return error.record + raise ValueError("incorrect caller control was accepted: " + kind) + + +def control_full_inverse(after, after_frames, spec, word, arithmetic, initial, expected_q): + state, frames = clone_state(after), dict(after_frames) + steps = [(event, True) for event in reversed(spec["cone"])] + run_steps(state, frames, steps, word, arithmetic) + dirty_sum = summed(initial[bank] for bank in D_BANKS) + wrong = [add(a, b) for a, b in zip(expected_q, dirty_sum, strict=True)] + need(any(z != ZERO for z in dirty_sum), "nonzero dirty-sum control") + need(state["Q7"] == wrong, "complete wrong-inverse dirty contamination formula") + failure = rejection(lambda: endpoint(state, frames, initial, expected_q), "query_endpoint") + return {"failure": failure, "dirty_sum_sha256": digest(dirty_sum), + "wrong_q_sha256": digest(wrong), "formula_checked_on_all_coordinates": True} + + +def control_collector(cut, cut_frames, spec, word, arithmetic, initial, expected_q, mutation): + state, frames = clone_state(cut), dict(cut_frames) + collector = [(event, False) for event in range(2025, 2040)] + if mutation == "extra_native_phase": + failure = rejection(lambda: run_steps(state, frames, collector, word, arithmetic, mutation), + "private_not_zero") + need(failure["event"] == 2039, "wrong native phase must fail literal private erasure") + return failure + need(mutation == "wrong_query_sign", "named collector control") + run_steps(state, frames, collector, word, arithmetic, mutation) + run_steps(state, frames, spec["reverse"], word, arithmetic) + failure = rejection(lambda: endpoint(state, frames, initial, expected_q), "query_endpoint") + need(failure["bank"] == "Q7", "readout sign controls query") + return failure + + +def control_return(after, after_frames, spec, word, arithmetic, initial, expected_q): + state, frames = clone_state(after), dict(after_frames) + run_steps(state, frames, spec["reverse"], word, arithmetic, "omit_q_return") + failure = rejection(lambda: endpoint(state, frames, initial, expected_q), "return_frame") + need(failure["bank"] == "Q7" and failure["actual"] == list(P_FRAME), "named Q return gap") + return failure + + +def execute_closed(initial, spec, word, arithmetic): + state = clone_state(initial) + frames = {bank: () for bank in state} + counts = run_steps(state, frames, [(i, False) for i in spec["cone"]], word, arithmetic) + need(all(frames[bank] == O_FRAME for bank in D_BANKS) and frames["Q7"] == P_FRAME, + "actual cut frame contract") + for bank in DIRTY: + decode(state[bank]) + cut, cut_frames = clone_state(state), dict(frames) + collector = [(i, False) for i in range(2025, 2040)] + counts.update(run_steps(state, frames, collector, word, arithmetic)) + after, after_frames = clone_state(state), dict(frames) + counts.update(run_steps(state, frames, spec["reverse"], word, arithmetic)) + return state, frames, counts, cut, cut_frames, after, after_frames + + +def fixture_coefficients(slot): + return [(((37 * slot + 17 * k + 3 * k.bit_count()) % 11) - 5, + ((19 * slot + 29 * k + 5 * k.bit_count()) % 13) - 6) for k in range(SIZE)] + + +def run_controls(cut, cut_frames, after, after_frames, spec, word, arithmetic, initial, expected_q): + return { + "full_producer_inverse": control_full_inverse( + after, after_frames, spec, word, arithmetic, initial, expected_q), + "extra_phase_after_native2031": control_collector( + cut, cut_frames, spec, word, arithmetic, initial, expected_q, "extra_native_phase"), + "omitted_q_inverse972": control_return( + after, after_frames, spec, word, arithmetic, initial, expected_q), + "query2032_wrong_sign": control_collector( + cut, cut_frames, spec, word, arithmetic, initial, expected_q, "wrong_query_sign")} + + +def analyze(word, native, parameters, initial_dirty, *, run_negative_controls=False): + """Return full arrays for root comparison and a compact deterministic receipt. + + parameters:52 arbitrary Gaussian coefficient vectors, ordered by the five + source groups. initial_dirty:six B9 vectors named D31,D30,D29,D28,D27,Q7. + Source-byte authentication belongs to the caller; standalone mode pins it. + Negative controls are optional because they require nonzero witnesses; + enable them for the named dense fixture, not arbitrary zero/kernel inputs. + """ + bound = native_bindings(word, native) + spec = select_source(word) + arithmetic = Arithmetic(bound) + need(set(initial_dirty) == set(DIRTY), "six dirty input roles") + dirty = {bank: [tuple(z) for z in values] for bank, values in initial_dirty.items()} + for values in dirty.values(): + vector_check(values) + decode(values) + initial_y = prepare(parameters, spec["slots"], arithmetic) + initial = {**initial_y, **dirty} + expected_parameters = [[tuple(z) for z in vector] for vector in parameters] + terminal = [index for index, slot in enumerate(spec["slots"]) if slot["kind"] == "terminal"] + need(terminal == [2, 9, 16, 27, 51], "five terminal coefficient slots") + query = encode(summed(parameters[index] for index in terminal)) + expected_q = [add(a, b) for a, b in zip(dirty["Q7"], query, strict=True)] + state, frames, counts, cut, cut_frames, after, after_frames = execute_closed( + initial, spec, word, arithmetic) + endpoint(state, frames, initial, expected_q) + recovered = recover({bank: state[bank] for bank in initial_y}, spec["slots"], arithmetic) + need(recovered == expected_parameters, "all52 full coefficient arrays restored") + wanted = {"events": 524, "native_occurrences": 402, "native_rank_mass": 722, + "completed_literal_pairs": 184832, "inverse_native_occurrences": 200, + "wrappers": 804, "weighted_adds": 120, "quarter_adds": 104, + "private_zero": 1, "private_erase": 1} + need(dict(counts) == wanted, "complete literal caller inventory") + controls = (run_controls(cut, cut_frames, after, after_frames, spec, word, arithmetic, + initial, expected_q) if run_negative_controls else {}) + receipt = make_receipt(spec, parameters, initial, state, recovered, counts, controls) + return {"receipt": receipt, "initial_y": initial_y, + "returned_y": {bank: state[bank] for bank in initial_y}, + "returned_coefficients": recovered, + "returned_dirty": {bank: state[bank] for bank in D_BANKS}, + "output_q": state["Q7"], "cut": {bank: cut[bank] for bank in DIRTY}} + + +def make_receipt(spec, parameters, initial, state, recovered, counts, controls): + steps = ([(i, False) for i in spec["cone"]] + + [(i, False) for i in range(2025, 2040)] + spec["reverse"]) + terminal = [i for i, slot in enumerate(spec["slots"]) if slot["kind"] == "terminal"] + return {"status": "PASS_INDEPENDENT_RESTORED_QUERY", + "scope": "524-event changed closed caller; omitted original histories unclaimed", + "source_sha256": {"WORD.json": WORD_SHA256, "NATIVE.json.gz": NATIVE_SHA256}, + "cone_events_sha256": digest(spec["cone"]), "closed_steps_sha256": digest(steps), + "excluded_q_compensation_inverses": spec["compensation"], + "terminal_slots": terminal, + "terminal_sources": [spec["slots"][i]["source"] for i in terminal], + "literal_counts": dict(counts), "parameters_sha256": digest(parameters), + "initial_all_banks_sha256": digest(initial), "output_q_sha256": digest(state["Q7"]), + "returned_coefficients_sha256": digest(recovered), + "full_array_checks": {"returned_coefficient_banks": 52, "returned_prepared_y_banks": 52, + "returned_dirty_d_banks": 5, "query_coordinates": SIZE, + "all58_public_return_frames_empty": True, + "private_C_erased_zero": True}, + "negative_controls_executed": bool(controls), + "controls": controls, + "inherited": ["PR3467 complete entrance and codec theorem", + "PR3416 native covariance with phase", + "PR3382 Newton invariance; PR3025/3068 literal gate lineage"]} + + +def verify_independent(word_path, native_path): + word, native = read_inputs(word_path, native_path) + parameters = [fixture_coefficients(index) for index in range(52)] + dirty = {bank: encode(fixture_coefficients(index)) for index, bank in enumerate(DIRTY, 52)} + return analyze(word, native, parameters, dirty, run_negative_controls=True) + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--repo", type=Path, default=Path(__file__).resolve().parents[2]) + parser.add_argument("--output", type=Path) + args = parser.parse_args() + inputs = args.repo / "research/p104-rounded-collector/inputs" + result = verify_independent(inputs / "WORD.json", inputs / "NATIVE.json.gz")["receipt"] + rendered = canonical(result) + "\n" + if args.output: + with args.output.open("x", encoding="utf-8") as handle: + handle.write(rendered) + else: + print(rendered, end="") + + +if __name__ == "__main__": + main() diff --git a/research/p104-restored-query/inputs/ORIGINS.json b/research/p104-restored-query/inputs/ORIGINS.json new file mode 100644 index 0000000000..9f56fec96b --- /dev/null +++ b/research/p104-restored-query/inputs/ORIGINS.json @@ -0,0 +1,65 @@ +{ + "source_commit": "4e4b08c689242f7f3be2e5e08dc1ae8d728ff920", + "files": [ + { + "path": "research/p104-restored-query/inputs/pr3467/source.py", + "origin_path": "research/p104-stagewise-entrance/source.py", + "bytes": 12067, + "sha256": "c54dabffe141de6befb6069e145c5ccbde629e76afb0f0afa3eb07bd72ab4b25" + }, + { + "path": "research/p104-restored-query/inputs/pr3467/classifier.py", + "origin_path": "research/p104-stagewise-entrance/classifier.py", + "bytes": 8070, + "sha256": "3e42ba4e5fa1cc819f3e7b773b38ca47476bf85f581f888cc99690e1cf2f2b40" + }, + { + "path": "research/p104-restored-query/inputs/pr3467/admission.py", + "origin_path": "research/p104-stagewise-entrance/admission.py", + "bytes": 5159, + "sha256": "00bd8c666fa758e76e47fb3e8835dd71770d1ce32c55d71d8d003dca2da15709" + }, + { + "path": "research/p104-restored-query/inputs/pr3467/inputs/pr3382_model.py", + "origin_path": "research/p104-stagewise-entrance/inputs/pr3382_model.py", + "bytes": 17085, + "sha256": "74c83367887dd885137b222155c86389fe0be9f1293a6f0e5fdb51d71f435fdd" + }, + { + "path": "research/p104-restored-query/inputs/PR3467_PROOF.md", + "origin_path": "research/p104-stagewise-entrance/PROOF.md", + "bytes": 18727, + "sha256": "4fb79a8da2740ac9608d5e153aec3199ab14e3955cf44710bb0a7f111d745fe1" + }, + { + "path": "research/p104-restored-query/inputs/PR3467_README.md", + "origin_path": "research/p104-stagewise-entrance/README.md", + "bytes": 12579, + "sha256": "4d606001f663bd0d1814b8c7392559379dfc00fe7c9c25967fea9725523a1f96" + }, + { + "path": "research/p104-restored-query/inputs/PR3467_COSTS.md", + "origin_path": "research/p104-stagewise-entrance/COSTS.md", + "bytes": 14074, + "sha256": "b23dd2efb8351eaae0af4ebf46df3b7121d925ac7ef75fe8906ef4033316a5ff" + }, + { + "path": "research/p104-restored-query/inputs/PR3382_PROOF.md", + "origin_path": "research/p104-stagewise-entrance/inputs/PR3382_PROOF.md", + "bytes": 21243, + "sha256": "1ca8c0e7e78f0f39de6cff7accc68ccd3901bfb50759bf7a2e2896bcf63bf081" + }, + { + "path": "research/p104-restored-query/inputs/PR3416_PROOF.md", + "origin_path": "research/p104-stagewise-entrance/inputs/PR3416_PROOF.md", + "bytes": 5914, + "sha256": "0dc1c35158902299fc8748c8baf89205483562f041e9050580e6579c331ebeb5" + }, + { + "path": "research/p104-restored-query/inputs/PR3426_PROOF.md", + "origin_path": "research/p104-stagewise-entrance/inputs/PR3426_PROOF.md", + "bytes": 7498, + "sha256": "892df1e84bfe8858e45b3bda45d76154a28b5f17e8f1789169d6e112ff0164d1" + } + ] +} diff --git a/research/p104-restored-query/inputs/PR3382_PROOF.md b/research/p104-restored-query/inputs/PR3382_PROOF.md new file mode 100644 index 0000000000..10b3202c78 --- /dev/null +++ b/research/p104-restored-query/inputs/PR3382_PROOF.md @@ -0,0 +1,445 @@ +# A phase-complete Gaussian entrance for one literal P104 collector + +This result changes the admissible numerical states of one fixed collector. +It does not change its scalar/frame word, claim a new precision threshold, +or provide the missing complete P104 correction and supplier invoice. +The construction is motivated by Clifford-invariant and Barnes–Wall lattice +methods. The proof below uses the repository's exact Gaussian normalization; +it does not invoke a lattice classification theorem or claim a new lattice +family. + +The source is ywz65's PR #2586, head +`7953c9a8f788a8de5cf2ced63d9a61b67c22c6f1`, retained at +`research/p104-rounded-collector/inputs/WORD.json` and `NATIVE.json.gz`. +Tekalign's PR #3025 binds its first collector and supplies the literal signed +floor pair. Ross Richardson's PR #3068, head +`7d2c519a1fdcc6bf66f6f08757eed7c48762d3f2`, supplies the neighboring +period-domain contract and explicitly leaves a larger state exactness domain +open. Their constructions, inverses, source binding and earlier bounds retain +their credit. Exact consumed bytes and the isolated replay are recorded by +the accompanying source manifest and receipt. + +## 1. Coordinates and the explicit code + +Put `pi = 1+i`, so `pi^2 = 2i` and `1/pi = (1-i)/2`. An array of +`2^r` Gaussian integers is a function on the binary cube. It has unique +multilinear Newton coefficients: + +\[ + f(x)=\sum_{S\subseteq\{0,\ldots,r-1\}}a_S x^S, + \qquad x^S=\prod_{j\in S}x_j. +\] + +Uniqueness follows by Boolean differences, or by the triangular evaluation +matrix indexed by subsets. Define the Gaussian module + +\[ + \mathcal B_r=\{f:a_S\in\pi^{|S|}\mathbb Z[i]\text{ for every }S\}. +\] + +Its encoder is explicit: + +\[ + E_r=E_1^{\otimes r},\qquad + E_1=\begin{pmatrix}1&0\\1&\pi\end{pmatrix}. +\] + +Thus a coefficient pair `(c0,c1)` becomes `(c0,c0+pi*c1)`. Bit `j` is +the address bit `1< x xor y = x+y-2xy`, and gives + +\[ + (a,b,c,d)\longmapsto + (a,\ b+c+\pi d,\ c,\ (i-1)c-d). +\] + +The phase `CZ=(-1)^{xy}=1-2xy` gives + +\[ + (a,b,c,d)\longmapsto + (a,\ b,\ c,\ ia+(i-1)(b+c)-d). +\] + +These formulas use `x^2=x`, `y^2=y` and `2=-i*pi^2`. The other bits contribute +the same common coefficient factors, so the formulas apply at every rank. +Bit swaps simply permute coefficient indices. The listed self-inverse gates +remain self-inverse under conjugation; `C` and `S` have the integral inverses +shown above. Global Gaussian units preserve the module. Thus every full source +wrapper, and its inverse, preserves `B_r`. + +No unrestricted phase or permutation is admitted by this argument. For example, +the cubic phase `(-1)^(x0*x1*x2)` applied to the constant one produces Newton +coefficient `-2` at degree three. It is not divisible by `pi^3`, so the result +leaves `B_3`. The quadratic source schema matters. + +The old structured phase witness is a positive control here. The constant one +and `i^{x_j}=1+(i-1)x_j` both belong to `B_r`, because `i-1=i*pi`. +The latter leaves the older `Gamma` period lattice, as credited in PR #3068. +That earlier counterexample did not claim that it creates a lifting error. + +## 5. One complete source-bound collector + +Use zero-based events **2025–2039** of the retained PR #2586 word. They are: + +1. Allocate zero private `C` at the common source frame. +2. Add `D31,D30,D29,D28,D27` to `C`, in that order. +3. Apply the literal rank-seven transport `U` at event 2031. +4. Add `C` to the arbitrarily dirty query `Q7` at its common frame. +5. Apply the separately archived return `V` at event 2033. +6. Subtract the five original sources in reverse order; erase exact zero `C`. + +The source arrays have 512 complex entries and nine address bits. Both native +recipes have the form `M_left C_0 ... C_6 M_right`. The complete surrounding +wrapper acts on all nine bits, so the contract is `B_9`, not an unproved +rank-seven block restriction. Source authentication binds the two event +occurrences, their frames, the common-chart ADDs and their actual recipes. +The predecessor's exact native interpretation is retained; the finite operator +check of `VU=I` is separate from the lattice exactness argument. + +Assume the five source arrays and the initial query belong to `2^-f B_9`. +They are otherwise arbitrary, independently dirty and potentially correlated. +The five sources remain available and unchanged across this whole interval. +The private `C` is owned and starts zero. No alias of those distinct roles or +nonzero private initialization is granted. + +Let `s` be the sum of the five sources. Module closure gives `s in 2^-f B_9`. +By Sections 3–4 both actual transports execute their exact ideal maps on this +domain. The query becomes `Q7+U*s`. Since `VU=I`, the private register returns +to `s`; subtracting the unchanged sources makes it exactly zero. Thus the +literal endpoint is + +\[ + (D31,\ldots,D27,Q7,C=0) + \longmapsto(D31,\ldots,D27,Q7+U\sum_jD_j,C=0). +\] + +The query remains in the same declared lattice and grid. There is no rounded +query defect, per-input grid selection, residue history or numerical downcast +in this restricted-state execution. This permits the separately archived `V`; +the unrestricted approximate lifting contract instead needs its paired inverse. +They must not be interchanged when counting operations. + +This is a boundary assumption at the actual collector cut. The earlier producer +has not been proved to supply this state for arbitrary unrestricted inputs. +The later whole word also has additional operations. A repeated collector is +valid only when its sources, frames, permissions and declared lattice are +available at its own cut. + +## 6. Quarter ADD and the exact meaning of an encoder + +Whole-array ADD by any Gaussian-integer coefficient preserves `B_r`. For an +integral array `z`, a quarter source `z/4` belongs to `B_r` exactly when +`z` belongs to `4B_r`. Integral components alone do not imply that condition. +At rank one `(4,0)` belongs to `B_1`, but `(4,0)/4=(1,0)` does not. Extend +the pair constantly in the other eight bits for the actual nine-bit counterexample. +Conversely `z=4E_r c` always has the admissible quarter `E_r c`. +The named collector contains only unit ADDs, so this counterexample marks the +external interface; no quarter instruction is treated as free within its bill. + +Encoding arbitrary raw coefficients `c` as `E_r c` changes the logical action +of a physical native map `U` to + +\[ + T=E_r^{-1}UE_r. +\] + +The gate formulas prove that `T` is an explicitly described Gaussian-integral +automorphism for the stated alphabet. They do **not** say `UE_r=E_rU`. +Already `C E_1 != E_1 C`; a control checks this distinction. Substituting this +representation into a caller expecting a different map requires its own +intertwining adapters and their complete costs. + +For clarity, one fully specified optional cold preparation realizes this +different `T` contract. Keep five arbitrary raw Gaussian coefficient source +arrays borrowed and unchanged, and give the query mutable ownership. Allocate +five zero source banks, copy the borrowed sources into them by five full-array +ADDs, and encode the five banks and query. Run the original collector on these +six encoded fields. Decode the query and all five banks. Each source bank is +then exactly its original raw source; subtract that borrowed source, check zero +and dispose of the bank. The query endpoint is `q+T*sum(sources)`. + +This construction uses six encodes, six decodes, five copy ADDs, five cleanup +ADDs and five additional owned array lifetimes. It demonstrates a complete +logical codec schedule with literal restoration. It does not admit that `T` +as a requested recursive caller, give a free borrowed-input conversion, or +establish an advantage over an existing `U` implementation. + +## 7. Gate, codec and storage ledger + +All counts in this section concern a direct scalar reference with explicit +array access. They are not tape time, native child tariffs or a lower bound. +Gaussian units, signed arithmetic and addressing are separate operations. + +An encode or decode sweep has `r*2^(r-1)` tensor pairs. Encoding a pair uses +one multiplication by `pi` and one Gaussian ADD. Decoding uses one Gaussian +subtraction and one exact division by `pi`. Multiplication by `pi` is +`(a-b,a+b)`; exact division is `((a+b)/2,(b-a)/2)`. Thus each encode pair costs +four real additions/subtractions, while each decode pair adds two exact real +halvings. Each loads four real components and writes two. An in-place sweep +uses the owned numerical array and four real work words; loop/control storage +and physical routing are additional. Borrowed input cannot be overwritten to +obtain this in-place price. + +At `r=9`, each direction has **2,304 pairs**. The optional cold schedule therefore +adds 13,824 `pi` multiplications, 13,824 exact `pi` divisions, 110,592 real +additions/subtractions, 27,648 exact real halvings and its ten full-array copy/ +cleanup ADDs. Those ten ADDs add 10,240 real additions/subtractions, 20,480 +real-component reads and 10,240 writes. The codecs add 110,592 component reads +and 55,296 writes. Five extra owned banks add 2,560 complex words and 5,120 +component initializations and zero checks each. These quantities are additional +to the direct collector below; they are not paid by an abstract rank count. + +For the literal collector, both seven-stage transforms use `7*512=3,584` +pair applications altogether. Each credited signed-floor pair costs eight +real additions/subtractions, four real floor halvings and one Gaussian quarter +turn. The eleven field ADDs cost `22*512` more real additions/subtractions. +The four actual wrapper cycle counts, in chronological order, are + +\[ + U_{right}:64,\quad U_{left}:128,\quad V_{right}:160,\quad V_{left}:64. +\] + +The credited one-zero-Gaussian-scratch cycle algorithm uses `N+c` swaps for a +wrapper with `c` cycles and `N` unit phase applications. Here it gives **416 +cycles and 2,464 swaps**, plus 2,048 phase applications. The old paired-inverse +schedule's 384 cycles and 2,432 swaps do not price these separately archived +return wrappers. The phase acts on the cycle scratch before each swap, so its +arithmetic is counted without an extra full-array phase pass. + +| Direct collector operation | Count | +|---|---:| +| Signed-floor pair applications | 3,584 | +| Real additions/subtractions, including all eleven field ADDs | 39,936 | +| Real floor halvings | 14,336 | +| Pair Gaussian quarter turns | 3,584 | +| Actual wrapper Gaussian swaps | 2,464 | +| Actual wrapper unit phase applications | 2,048 | +| Butterfly real-component reads / writes | 14,336 / 14,336 | +| Field-ADD real-component reads / writes | 22,528 / 11,264 | +| Wrapper-swap component reads / writes, including scratch | 9,856 / 9,856 | +| Private initialization / zero-check component inspections | 1,024 / 1,024 | + +The 10,240 source-component reads are a subtotal of the field-ADD reads, not an +extra charge. The direct contract has five borrowed source arrays, one mutable +query, one owned zero private array and one zero Gaussian wrapper scratch, +with constant pair work. The optional cold schedule supplies the five source +arrays by additional owned copies. Source plans, range/type validation, +permissions, address/control work, physical movement, allocator behavior, +recursive children, precision metadata and final endpoint consumption require +their actual caller's tariff. They do not acquire a zero price from these +scalar counts. + +## 8. Finite headroom + +Let `H` bound the absolute value of every real and imaginary component at a +codec's own entrance. During an encode the exact largest real component row +sum after at most `r` factors is bounded by + +\[ + M_r=\sum_{k=0}^r {r\choose k} + (|\Re\pi^k|+|\Im\pi^k|). +\] + +This follows by expanding a tensor row; its entries are powers of `pi`, one +for each subset. A smaller partial row is covered by the same nonnegative +bound. For `r=9`, `M_r=3363`. Thus `M_r H` bounds stored encoder components; +`3 M_r H` is a conservative bound for its two-step arithmetic temporaries. + +A row of a `k`-factor inverse sweep is a signed sum of `2^k` inputs divided by +`pi^k`. Its real component row sum is +`2^k (|Re pi^-k|+|Im pi^-k|)=|Re pi^k|+|Im pi^k|`, at most +`2^ceil(r/2)`. Therefore decoder components are bounded by `2^ceil(r/2) H`, +and its subtraction/numerator temporaries by four times that amount. These +are sufficient arithmetic bounds, not a compression or precision advantage. + +For the direct collector suppose its six admitted entrance fields have +integer numerator components bounded by `H`. The sum of five sources has +Hilbert norm at most `5 sqrt(2N) H`. Every exact native prefix is unitary, +including each wrapper. At `N=512`, **160 H** bounds every native-prefix real +component; **161 H** bounds the updated query. A conservative signed-floor +pair scratch bound is **800 H**. Gathers and ungathers are bounded sums of at +most five unchanged sources. Partially written stages store either preceding +or completed pair values, so these same bounds cover the entire execution. + +For the optional cold caller, now let `H` bound its **raw coefficient** entrance. +Encoding gives `3363 H`; the collector therefore gives an encoded query bound +`161*3363 H=541443 H`. Decoding that query gives at most +`32*161*3363 H=17326176 H`. The conservative complete scratch bound is four +times this last quantity, **69304704 H**, which also dominates the encoder, +native pair, source-bank decoding and cleanup temporaries. These composed +bounds make the optional caller's finite-width obligation explicit; they are +not measured peaks or necessary widths. + +For a nonnegative integer component bound `M`, +`1+ceil_log2(M+1)` signed bits suffice. This states an explicit finite range; +an actual fixed-width implementation must use that range, retain the required +grid and charge its bit arithmetic. The older sharp scalar-grid/Clifford +denominator results remain credited and unchanged. + +## 9. Evidence boundary and stopping decision + +The written arguments hold at every finite rank. The new managed-Python model +and finite source checks are bounded by nine address bits, 512 complex entries +and 8,192 magnitude bits per admitted input or returned array component. +Signed storage may require another bit; exact arithmetic temporaries have the +additional finite headroom derived above. The functional model allocates fresh +lists, while the direct ledger prices the separately specified in-place codec +and credited cycle-scratch algorithm. It is not a measurement of Python +allocation. Membership checks and snapshots inside verification are test work; +a production caller must establish or pay for its lattice entrance. +Managed allocation and verification snapshots are not a physical memory +implementation. Exact checks use explicit exceptions, including under Python +optimization. + +Finite verification binds the two archived recipes, checks exact operators and +both literal directions on admitted states, tests dirty collector endpoints, +and exercises the missing-prefix, phase-alphabet, wrong weighting, quarter-ADD, +intertwiner and source/invoice failure boundaries. The separate checker uses +its own representation and does not derive a nonlinear universal theorem from +finite basis samples. Source-native correctness, physical ownership, eventual +recursive prices and human/proof-kernel admission remain separate premises. + +The result stops at a phase-compatible exactness theorem, one actual complete +local collector, an explicit codec/intertwiner, and their full direct logical +ledger. It neither proves that earlier arbitrary P104 inputs satisfy the +entrance nor extends the contract to the later quarter ADDs. A larger caller +needs an actual admitted source of this state and a compatible fully charged +consumer. No selected frontier, all-size supplier, new scalar-grid guard, +physical storage saving or new kappa follows. + +Prepared by Clear1nsight with substantial OpenAI assistance. Separate automated +derivation and review are not independent human or formal-kernel verification. +Apache-2.0; predecessor authors and original source notices retain their credit. diff --git a/research/p104-restored-query/inputs/PR3416_PROOF.md b/research/p104-restored-query/inputs/PR3416_PROOF.md new file mode 100644 index 0000000000..276f61cb64 --- /dev/null +++ b/research/p104-restored-query/inputs/PR3416_PROOF.md @@ -0,0 +1,117 @@ +# Exact covariance of the archived P104 native recipes + +All statements concern the two frozen PR2586 inputs in SOURCES.json, at nine +address bits. The ground field is Q(i), and arrays have 512 complex entries. +The word and native archive are ywz65's work. This package supplies a separate +finite verification of their native change-of-chart identities. It does not +construct a new native word or strengthen the original native invoice. + +## Canonical charts and the precise claim + +Write computational basis vectors as |x>, for x in F_2^9. For an independent +ordered frame W=(w_0,...,w_(r-1)), complete these columns greedily with the +standard basis e_0,...,e_8. Let G be the resulting binary matrix, A=G^-1, +and Q=I+A^T A over F_2. Set + + q(x) = sum_j Q_jj x_j + 2 sum_(j = i^q(x) |A x>. + +The phases use the binary representatives 0 and 1 of Q. Define + + C(a,b) = ((a+b+i(a-b))/2, (a+b-i(a-b))/2). + +For 0 to i^p(x) |B x+b>, using its archived address rows, offset, +linear Z4 phase, quadratic binary rows and constant Gaussian phase. The +verifier validates bijectivity and all numeric ranges before computing its +operator. All arithmetic is integral or Gaussian dyadic, with no numerical +tolerance and no floating point. + +The certified finite theorem is + + U = Delta_new Delta_old^-1 + +for every one of the 1,245 archived records, as operators on every vector in +Q(i)^512. Their 2,070 occurrences are each matched to the literal word's +recorded old frame, new frame and positive rank. Their chronological incoming +frames, all ADD common-frame constraints, private frame lifetimes and final +frames are checked. This covariance theorem does not itself prove the scalar +word's dirty restoration or zero erasure values. Those are separate obligations. + +## Complete operator comparison + +Use P(p,x,z)=i^p X^x Z^z, so + + P(p,x,z)|v> = i^(p+2 z.v)|v+x>, + P(p,x,z) P(q,u,w) = P(p+q+2 z.u, x+u, z+w). + +Phases are reduced modulo 4 and binary sums are XOR. A signed tableau records +the exact conjugates of the nine X_j and nine Z_j, including their phases. +For a one-coordinate C, + + C X C^-1 = X, + C Z C^-1 = -Y = i^3 XZ. + +Its inverse sends Z to Y=i XZ. These formulas follow directly from the +stated two-by-two matrix. `c_table` uses those identities. For every monomial +appearing in an actual recipe or canonical chart, `monomial_table` reconstructs +its candidate Pauli images, then checks each identity on all 512 computational +columns. In particular, for M|v>=i^q(v)|a(v)>, conjugation has address difference +`a(v+x)+a(v)` and phase difference `p+q(v+x)-q(v)+2 z.v`. +The check compares these with the proposed output Pauli at every v. No +inference from rank, unsigned symplectic data, or a few sampled inputs is used. +The product law then composes the exact signed actions through each circuit. + +Here is why those 18 identities determine an operator up to a scalar. +If invertible U and V have the same signed conjugation action, V^-1 U +commutes with every Z_j and X_j. Commuting with all Z_j makes V^-1 U diagonal +in the computational basis, because distinct addresses have different joint +Z eigenvalues. Commuting with every X_j makes its diagonal entries equal +along every cube edge. The cube is connected, so V^-1 U=lambda I. All factors +here are unitary and hence invertible. No external irreducibility theorem is +needed for this finite argument. + +Finally the checker compares the complete, exact nonzero column U|0> with +V|0>. Equality forces lambda=1. The column is stored as Gaussian integer +numerators over one power of two. Removing only common factors of two gives +a unique representation for a nonzero dyadic column. The stored receipt +contains a digest of each fully compared tableau and anchor, alongside frames, +rank and occurrences. Digests summarize the comparisons; the verifier does not +accept an identity by comparing hashes of operators. + +This criterion is established predecessor mathematics. In particular, +Tekalign's PR3218 supplies a separate Pauli-plus-anchor comparator and proof. +The present contribution is its independent implementation and exhaustive +application to the PR2586 corpus required by PR3406's stated proof dependency. + +## Connection to the Newton source theorem + +PR3406 at `18a054fd585ab4b2010770ec83cba0c9f28184e3` proves its sharp source +criterion under these exact native identities. This certificate supplies that +finite inherited premise. With the other hypotheses and proof of that pending +result retained, its entrance remains 4 B_9 on 104 independent Y inputs, +2 B_9 on 78 independent N inputs, and B_9 on the other 176 public inputs. +Here B_9 is the Gaussian Newton module introduced for this application by +Clear1nsight/PR3382. This does not independently recertify every other lemma or +turn that conditional restricted-state contract into an actual-caller theorem. + +The result is author-checked exact arithmetic, with a separately implemented +comparison path and independent dense controls. It has no human or proof-kernel +review. Physical storage, owners, routing, rounded recursive children, actual +input preparation, a favorable complete bill, tensor-depth transfer and the +selected multiplication theorem remain outside scope. No new kappa is claimed. diff --git a/research/p104-restored-query/inputs/PR3426_PROOF.md b/research/p104-restored-query/inputs/PR3426_PROOF.md new file mode 100644 index 0000000000..c7007ae86f --- /dev/null +++ b/research/p104-restored-query/inputs/PR3426_PROOF.md @@ -0,0 +1,145 @@ +# Correlated first-collector entrance + +Let `pi=1+i`, and let `B=B9` be the Gaussian Newton lattice + +\[ + B=\{f(x)=\sum_{S\subseteq[9]}a_S x^S:\pi^{|S|}\mid a_S\}. +\] + +It is a free `Z[i]` module of rank 512. All statements below concern the +literal PR2586 word at its first collector entrance, immediately before +zero-based event 2025. The exact sources and dependencies are in SOURCES.json. + +## Inherited operator hypotheses + +We use PR3382's theorem that the actual Gaussian wrappers and coordinate +butterflies are automorphisms of B, and agree with their signed-floor +implementations on B. Their inverses preserve B as well. +We use PR3416's finite native covariance theorem, including global phase. +Writing `A_H` for the empty-to-frame operator, each ideal transport from H +to K equals `A_K A_H^-1`. Thus every ideal bank has a well-defined +frame-normalized value `A_H^-1 v`. A transport leaves that value fixed. +An ADD with a common source/destination frame adds its stated scalar multiple +of the normalized source. These dependencies are inherited, not re-proved by +our three numerical fixtures. + +## The ideal final-cut classification + +Take arbitrary initial values of the 58 dependencies in B. Denote the five +initial D values by `d_j`, the initial Q7 by `q`, and the 52 initial Y values +by `y_s`. No independence restriction is imposed on these values. + +Backward slicing the authenticated destination-first word gives 257 events. +There are 200 transports and 57 ADDs. Fifty-two ADDs are positive quarters, +and five subtract initial D values into Q7 before those D banks acquire +any quarter contribution. The program groups the Y sources into disjoint +sets `S_j` of sizes 3, 7, 7, 11 and 24 for D31, D30, D29, D28 and D27. +The complete source/event lists and coefficient rows are in RECEIPT.json. +For example, `S_31={Y27,Y26,Y99}`, read at 1090, 1129 and 1231. +All 52 source paths contain transports only before their required read. + +An induction in source order, using the common ADD frames, proves + +\[ + D_j^{cut}=A_{F_D}\left(d_j+\frac14\sum_{s\in S_j}y_s\right), + \qquad + Q7^{cut}=A_{[364]}\left(q-\sum_jd_j\right), +\] + +where `F_D=[256,136,64,40,16,4,2,1]`. This is an ideal rational Gaussian +operator identity. It does not assume intermediate values are integral or +that an unrestricted signed-floor execution follows this identity. + +Since `d_j,q` belong to B and both displayed frame operators are +B-automorphisms, all six ideal outputs belong to B if and only if + +\[ + \boxed{\ \sum_{s\in S_j}y_s\in4B\quad\text{for each of the five groups.}\ } +\] + +Necessity follows by applying the inverse frame and subtracting `d_j`. +Sufficiency follows by adding a B quarter-sum to `d_j`; Q7 is always in B. +This proves the full ideal criterion for this stated initial B domain. + +For each group choose its first source as pivot. Keep the other Y coordinates +and replace the pivot coordinate by the sum of its group. The inverse replaces +the pivot by that sum minus the other group coordinates. These are integral +inverse changes of bank coordinates. The checker constructs both 52-by-52 +matrices and verifies both products are the identity. Consequently the admitted +Y module is isomorphic, by this explicit change of coordinates, to + +\[ + B^{47}\mathbin{\oplus}(4B)^5. +\] + +Every ideal admitted input is obtained by choosing arbitrary nonpivot Y +values in B, arbitrary `z_j` in B, and setting +`y_pivot=4 z_j-sum(nonpivot values in its group)`. +The quotient of `B^52` by this module is exactly `(B/4B)^5`, of cardinality +`2^10240`. This is an algebraic index, not a storage or operation bill. +PR3423's separate `y_s in 4B` restrictions characterize its stronger invariant +that every relevant prefix stays in B. They remain sufficient but are not +necessary for the ideal final cut. + +## A literal reachable cancellation + +Set `Y27=64 delta_0`, `Y26=-64 delta_0`, and every other component of all +358 initial banks to zero. Each nonzero initial bank is in B and outside 4B. +Indeed every Newton coefficient of `delta_0` is a sign, and +`v_pi(64)=12`. The degree-nine condition for 4B would require valuation 13. + +The checker executes every event from 0 through 2024 with exact Gaussian +integer components. Every fractional ADD is checked for componentwise exact +division. All 883 native occurrences are bound to their old/new frames and +ranks. Zero-input transports stay zero. On all active coordinate pairs, it +compares the literal signed-floor result against the ideal Gaussian pair. +All 7,680 comparisons pass across 26 active native occurrences. + +The first non-B event output is D31 at 1090. Its mask-349 Newton coefficient +is `-4-4i`, with degree six and pi valuation five. At the collector entrance, +all six produced banks are literally zero. The two nonzero initial Y values +are distinct physical roles. Their frames follow their actual histories, +so the cancellation is not an identification of storage roles. + +Deleting the Y26 input leaves the actual Y27-only counterexample from PR3423. +Our separate full-prefix implementation reproduces its failing D31 output, +with 256 nonzero Gaussian components and the same final array hash. The +amplitude-256 positive control stays admitted. These controls retain the +actual prefix and do not substitute an ADD at a freely chosen read point. + +The numerical fixture is a finite certificate. It also gives a narrow +analytic extension. A Gaussian integer multiple of this initial vector has +a Gaussian integer ideal state at every certified stage, because all those +states are Gaussian integer and the ideal operations are Gaussian linear. +For a coordinate pair, Gaussian integrality of the ideal outputs means the +real and imaginary input differences have the same parity. The literal pair +then equals the ideal pair, since +`floor(a/2)+ceil(b/2)=(a+b)/2` when `a,b` have the same parity. +Induction therefore proves the same exact full-prefix cancellation for every +Gaussian integer multiple. When the multiplier is not divisible by pi, the +two initial banks remain outside 4B and event 1090 still leaves B. +This extension is a proved consequence of the integral trace, not an +exhaustive numerical sweep of multipliers. + +## Scope and remaining obligations + +The universal theorem is about the ideal final cut. The exact literal trace +establishes one strict cancellation example and its Gaussian multiples. +A general correlated-domain classification for arbitrary rounded executions +is not proved. The 52-source prefix theorem in PR3423 and the independent +product-domain theorem in PR3406 are not contradicted. + +We do not supply a caller that prepares these correlations, control other +collectors, price ownership, route sources, preserve all downstream recipient +histories, or change PR3423's unchanged-profile stopping decision. A final-cut +cancellation cannot remove costs from the consumer or compiler without an +additional argument. No supplier admission, improved kappa, selected-frontier +change or complete multiplication theorem follows. + +Credit ywz65/PR2586 for the word and recipes, Arham Tahir/PR2665 for the +retained inputs, Clear1nsight/PR3382 and PR3423 for the Newton domain and actual +producer/consumer work, Tekalign/PR3025 for the signed-floor bijection, +Ross Richardson/PR3068 for the exactness-domain question, Nick Petalas/PR3406 +and PR3416, and all retained native, geometry, compiler and precision lineage. +The new result is the correlated ideal entrance and the exact literal +cancellation separating it from the prefix invariant. Apache-2.0. diff --git a/research/p104-restored-query/inputs/PR3467_COSTS.md b/research/p104-restored-query/inputs/PR3467_COSTS.md new file mode 100644 index 0000000000..580057b88f --- /dev/null +++ b/research/p104-restored-query/inputs/PR3467_COSTS.md @@ -0,0 +1,309 @@ +# Direct preparation cost and quotient audit + +This note prices the explicit preparation from **52 owned Gaussian coefficient +banks to the admitted Y module**. It uses the actual inverse donor paths, +the extra right wrappers, and the groupwise bank differences. It does not +price an arbitrary pre-existing Y caller, the other events of the original +prefix, or the 675 external-recipient histories. + +The inventory was independently reconstructed from the frozen WORD and +NATIVE data, without importing the package source layer, classifier, or a +predecessor executable. It is a constructive direct arithmetic schedule, +not a minimum, a physical tape tariff, or a supplier improvement. The +[proof](PROOF.md) states the admission theorem and codec contract; +[SOURCES.json](SOURCES.json) retains the exact origins and mathematical +dependencies. + +## 1. What the quotient counts mean + +Put $R=\mathbb Z[i]$, $\pi=1+i$, and $B=B_9$. The 32 intervals without +a D transport contribute diagonal exponents +$\max(4-|S|,0)$. The 15 rank-one intervals contribute +$\max(4-|S\setminus\{0\}|,0)$. Each of the five terminal coordinates +contributes exponent four on all 512 coefficients. + +| Exponent | No-transport multiplicity | Rank-one multiplicity | Terminal multiplicity | Aggregate | +|---|---:|---:|---:|---:| +| 0 | 32 × 382 | 15 × 326 | 0 | 17,114 | +| 1 | 32 × 84 | 15 × 112 | 0 | 4,368 | +| 2 | 32 × 36 | 15 × 56 | 0 | 1,992 | +| 3 | 32 × 9 | 15 × 16 | 0 | 528 | +| 4 | 32 × 1 | 15 × 2 | 5 × 512 | 2,622 | + +The quotient of $B^{52}$ by the exact stagewise entrance $\mathcal M$ is + +$$ +(R/(\pi))^{4368}\oplus(R/(\pi^2))^{1992} +\oplus(R/(\pi^3))^{528}\oplus(R/(\pi^4))^{2622}. +$$ + +The exponent-zero coordinates have trivial quotient factors. All 52 input +banks remain present; each admitted module has the same full Gaussian rank. +The index is + +$$ +[B^{52}:\mathcal M] +=2^{4368+2(1992)+3(528)+4(2622)} +=2^{20424}. +$$ + +For the ideal terminal-only module $\mathcal I$ from PR #3426 and the +stronger product entrance $\mathcal P=(4B)^{52}$, the inclusions are strict: + +$$ +\mathcal P\subsetneq\mathcal M\subsetneq\mathcal I,\qquad +[B^{52}:\mathcal I]=2^{10240},\quad +[B^{52}:\mathcal P]=2^{106496}. +$$ + +Consequently $[\mathcal I:\mathcal M]=2^{10184}$ and +$[\mathcal M:\mathcal P]=2^{86072}$. These quantify the additional +stagewise constraints and the larger allowed correlated set. They are not +saved physical bits, compressed storage, or eliminated operations. + +The elementary checks behind the first two rows are + +$$ +\sum_{j=0}^{3}(4-j)\binom9j=187,\qquad +2\sum_{j=0}^{3}(4-j)\binom8j=280, +$$ +$$ +32(187)+15(280)+5(2048)=20424. +$$ + +## 2. Actual path reconstruction + +The independent counter finds the first C allocation at zero-based event +2025, derives the five D source roles from the following five collector ADDs, +and finds their earlier quarter reads in the original order. It obtains group +sizes 3, 7, 7, 11 and 24. + +For each nonterminal read, it follows that D bank's native history from its +initial empty frame to the read frame. It separately checks the interval to +the next read. Every selected native occurrence is bound to the archive's +old frame, new frame and rank. The 32 empty intervals and 15 single rank-one +intervals yield 47 preparation paths. + +A rank-one coordinate first needs the inverse of its actual right wrapper. +It then uses the inverse D path, with native occurrences reversed and each +native inverted in its actual factor order. This is a constructive schedule +on independently supplied coefficient arrays. Repeated uses of one source +recipe are counted once per prepared array, not once per distinct archive +record. + +| Preparation part | Native occurrences | Rank sum | Wrapper occurrences | Wrapper cycles | Gaussian payload SWAPs | +|---|---:|---:|---:|---:|---:| +| Inverse donor paths | 158 | 281 | 316 | 9,748 | 152,044 | +| Extra inverse right wrappers | 0 | 0 | 15 | 704 | 6,976 | +| Total | 158 | 281 | 331 | 10,452 | 159,020 | + +Each rank unit acts on 256 address pairs, giving **71,936 pair applications**. +Each wrapper permutation is reconstructed on all 512 addresses and checked +to be a bijection. A cycle of length $l$ uses $l-1$ direct payload SWAPs, +so the total is + +$$ +331(512)-10452=159020. +$$ + +These are reversible gates on two owned Gaussian payload words. They need no +separate clean swap ancilla. This is different from the credited predecessor +schedule using $N+c$ swaps through one owned zero Gaussian scratch word; +those two invoices must not be mixed. Permutation cycles are unchanged by +taking the inverse. + +## 3. Phases and the complete arithmetic subtotal + +The wrapper phase is evaluated at its source address, using its recorded +constant phase, linear terms and only strict-upper quadratic terms $j1$ obstruction. A larger exact input domain does +not change that law or remove native children. This result narrows the missing +admission question; it does not reopen the stopped supplier construction or +claim a new $\kappa$. + +The actual word and native recipes remain ywz65's PR #2586 contribution, +retained through Arham Tahir's source package. Nick Petalas's PR #3426 supplies +the ideal correlated classification and this literal-admission handoff; his +PR #3416 supplies the inherited covariance theorem. Clear1nsight's PR #3382 +and PR #3423 supply the Newton application and prior actual-interface work. +Tekalign's signed-floor and native-comparison lineage, Ross Richardson's +exactness-domain work, and Jose Manuel/Vasek's conditional cost stop retain +their credit. This audit used separate automated source/count reconstruction, +not external human or formal proof-kernel verification. + +Prepared by Clear1nsight with substantial OpenAI assistance. Apache-2.0. diff --git a/research/p104-restored-query/inputs/PR3467_PROOF.md b/research/p104-restored-query/inputs/PR3467_PROOF.md new file mode 100644 index 0000000000..8e10fbbeae --- /dev/null +++ b/research/p104-restored-query/inputs/PR3467_PROOF.md @@ -0,0 +1,418 @@ +# Chronological partial sums classify the exact producer entrance + +Clear1nsight, with substantial OpenAI assistance. This note supplies the +mathematical derivation and an abstract reversible arithmetic schedule. Source +authentication, the actual path invoice, and replay evidence belong to the +package verifier. The inherited word and native recipes are unchanged. + +## 1. The classified contract + +Write $R=\mathbb Z[i]$, $\pi=1+i$, + +$$ +E_r=\begin{pmatrix}1&0\\1&\pi\end{pmatrix}^{\otimes r}, +\qquad B_r=E_rR^{2^r}. +$$ + +Address bit zero is the first tensor coordinate. The actual source uses $r=9$. +The formulas below hold at every rank at which the named gate exists; the +finite reference accepts ranks at most nine. + +The target is the fixed 257-event backward cone ending immediately before word +event 2025, with five targets D31, D30, D29, D28, D27 and Q7. Its 58 initial +banks are those six banks and 52 Y banks. All initial banks are required to be +in $B_9$. The D and Q values may be arbitrary dirty values in that domain. + +We classify exactly the following conjunction: + +1. Every quarter-ADD in this cone has a Gaussian-integral increment. +2. At every native pair in this cone, literal signed-floor execution equals the + stated ideal complex-linear gate. +3. All six target arrays at the cut belong to $B_9$. + +This is a necessary-and-sufficient description within the stated initial +domain. It is not a classification of genuinely rounded paths whose later +errors happen to cancel. It is also not a universal execution theorem for the +omitted events of the full 2025-event prefix: some of these Y banks feed other +D banks outside the cone. It neither admits the later external recipients nor +prices a physical caller. + +The native covariance, including global phase, is inherited from PR #3416. +The $B_r$-automorphisms and the literal pair criterion are inherited from +PR #3382; the relevant pair calculation is recalled below. PR #3426 supplies +the five terminal group-sum condition and explicitly leaves these stagewise +conditions open. The new step is to separate those conditions into independent +chronological partial-sum coordinates and solve every actual interval. + +## 2. Why the source correlations separate + +The source parser binds all selected ADDs and transports to the frozen WORD +and NATIVE bytes. It checks that the five groups have sizes $3,7,7,11,24$, +that each of the 52 Y sources occurs in exactly one group and once in that +group, and that all of these ADDs have coefficient $+1/4$. There are also +five coefficient $-1$ ADDs from the initial dirty Ds into Q7, before any +Y quarter is added to those Ds. + +For a group of size $m$, let $y_1,\ldots,y_m\in B_9$ be its initial Y +values in their actual read order and put + +$$ +p_t=\sum_{u=1}^t y_u,\qquad p_0=0. +$$ + +The change between $y$ and $p$ is triangular and unimodular over $R$: + +$$ +y_1=p_1,\qquad y_t=p_t-p_{t-1}\quad(t>1). +$$ + +It therefore maps $B_9^m$ bijectively to itself. The 52 partial-sum banks +are independent coordinates, not 52 simultaneous constraints on one bank. + +Let $A_H$ be the actual ideal native map from the initial empty frame to the +frame of a read, with its authenticated phase. Covariance gives the physical +D value immediately after that read as + +$$ +A_H\left(d+\frac{p_t}{4}\right), +$$ + +where $d\in B_9$ is the initial dirty D value. The same expression, with the +actual composed map in place of $A_H$, holds after each subsequent complete +stage until the next read. Every transformed dirty term is Gaussian integral, +so subtracting it leaves an integrality condition on $p_t/4$ alone. + +The interval includes the array immediately after the current quarter, every +literal pair stage of an intervening native, and the array immediately before +the next quarter. These endpoint requirements are necessary. They are also +sufficient for exact quarter increments: at a common read frame, subtracting +the old and new integral D states gives precisely $A_Hy_t/4$. For the first +read the old partial sum is zero. Thus no additional coupling between +successive partial-sum coordinates has been discarded. + +The exact source has 47 nonterminal intervals: **32 have no D transport and +15 have exactly one rank-one D transport**. That native is its actual right +monomial wrapper, then $C_0$, then its actual left monomial wrapper. No +paired-inverse substitute or frame-name-only identification is used. The five +terminal intervals are dealt with by the final-cut condition. + +## 3. Two local diagonal profiles + +### 3.1 No intervening transport + +Put + +$$ +L_0=B_r\cap4R^{2^r}. +$$ + +For $q=E_rc$, its unweighted Boolean Newton coefficient indexed by a subset +$S$ is $\pi^{|S|}c_S$. Boolean Möbius inversion and its inverse both have +integer entries. Consequently $q\in4R^{2^r}$ if and only if all those +Newton coefficients are divisible by $4$, equivalently by $\pi^4$. +Thus + +$$ +L_0=E_r\operatorname{diag} + \left(\pi^{\max(4-|S|,0)}\right)R^{2^r}. +\tag{1} +$$ + +For an actual zero-transport gap at frame $H$, the allowed initial partial +sum is exactly $A_H^{-1}L_0$. This includes both interval endpoints, which +are at the same frame and have the same D value. + +### 3.2 One actual rank-one transport + +Let its right wrapper be $M_R$ and put $P=M_RA_H$. Monomial wrappers and +their inverses preserve $4R^{2^r}$. They also preserve $B_r$ by the +inherited source-bound theorem. The interval condition is therefore exactly + +$$ +q=Pp_t\in4R^{2^r},\qquad C_0q\in4R^{2^r}. +\tag{2} +$$ + +Split the bit-zero pairs of $q\in B_r$ as + +$$ +q(x,0)=f(x),\qquad q(x,1)=f(x)+\pi g(x), +\qquad f,g\in B_{r-1}. +$$ + +The source's ideal gate is + +$$ +C=\frac1\pi\begin{pmatrix}i&1\\1&i\end{pmatrix}, +\qquad C(f,f+\pi g)=(f+g,f+i g). +$$ + +Conditions (2) are equivalent to $f,g\in4R^{2^{r-1}}$: necessity follows +by subtracting $q(x,0)=f(x)$ from $(C_0q)(x,0)=f(x)+g(x)$; sufficiency +follows directly from all four displayed values. Applying (1) separately to +the two coefficient blocks gives + +$$ +L_1=E_r\operatorname{diag} + \left(\pi^{\max(4-|S\setminus\{0\}|,0)}\right)R^{2^r}. +\tag{3} +$$ + +The allowed initial partial sum is exactly $P^{-1}L_1$. The left wrapper +adds no further divisibility condition because it is an integral monomial +automorphism, but its endpoint and its charged execution remain in the source +word. This is why testing the quarter output alone would give a larger, +incorrect domain. + +### 3.3 Terminal intervals and the literal pair + +At the cut the five Ds have the actual frame +$O=[256,136,64,40,16,4,2,1]$. A D has value +$A_O(d+p_m/4)$. Since $A_O$ is a bijection on +$B_r$ and $d\in B_r$, its membership in $B_r$ is equivalent to +$p_m\in4B_r$. That condition also keeps every remaining stage of this D in +$B_r$. Q7 remains in $B_r$, since it only combines the initially admitted +dirty D/Q values before its last transport. Thus each terminal coordinate has +the profile $4E_rR^{2^r}$, independently of its final read frame. + +For clarity, equality with the signed-floor pair does **not** require each +internal floor half to be an exact division. If the pair difference is +$(u,v)\in\mathbb Z^2$, ideal outputs are Gaussian integral exactly when +$u\equiv v\pmod2$. In that case + +$$ +\lfloor u/2\rfloor-\lfloor-v/2\rfloor=(u+v)/2, +\quad +\lfloor v/2\rfloor-\lfloor u/2\rfloor=(v-u)/2. +$$ + +These identities hold for positive and negative integers. They give the +literal output exactly, including the odd/odd case. If the parities differ, +the ideal pair is nonintegral and cannot equal an integer literal output. +This proves the necessity and sufficiency used above; the inverse pair has +the corresponding calculation with $i$ replaced by $-i$. + +## 4. The resulting exact module + +At rank nine the canonical diagonal exponents are: + +| Interval | Number | Multiplicities of exponents $0,1,2,3,4$ | Index exponent | +|---|---:|---|---:| +| No transport | 32 | $382,84,36,9,1$ | 187 | +| One rank-one transport | 15 | $326,112,56,16,2$ | 280 | +| Terminal $4B_9$ | 5 | $0,0,0,0,512$ | 2048 | + +Here the index is $2^e$ when the index exponent is $e$, because +$|R/(\pi^k)|=2^k$. The actual frame pullbacks are automorphisms of $B_9$, +and the partial-sum bank change is unimodular. Therefore they do not alter the +quotient type. The complete Y entrance is explicitly isomorphic, in these +coordinates, to the product of the 52 displayed diagonal modules. Its +quotient inside $B_9^{52}$ is + +$$ +(R/(\pi))^{4368}\oplus +(R/(\pi^2))^{1992}\oplus +(R/(\pi^3))^{528}\oplus +(R/(\pi^4))^{2622}. +$$ + +There are also 17,114 unrestricted Gaussian coefficient coordinates. The +total index exponent is + +$$ +32\cdot187+15\cdot280+5\cdot2048=20424. +$$ + +This adds 10,184 stagewise divisibility bits to PR #3426's terminal-only +algebraic index exponent 10,240. These are algebraic quotient counts, not a +physical storage bill or an operation lower bound. In particular, they do not +remove any ownership, precision, routing, or restoration obligation. + +## 5. An explicit typed preparation and inverse + +The in-place entry contract is 52 owned coefficient banks containing +independent arbitrary arrays $a_t\in R^{512}$, together with six separately +admitted dirty D/Q banks in $B_9$. The encoder touches the 52 owned banks; +it leaves those six dirty banks and all other roles unchanged. For each +partial-sum slot, form the appropriate profile: + +$$ +p_t=\begin{cases} +A_H^{-1}E_9D_0a_t,&\text{no transport},\\ +A_H^{-1}M_R^{-1}E_9D_1a_t,&\text{one rank-one transport},\\ +4E_9a_t,&\text{terminal}. +\end{cases} +$$ + +The terminal convention is **positive $4$**, whereas $\pi^4=-4$; the two +images agree but their coefficient fixtures have different signs. Use the +actual inverse path in reverse chronological order, not merely a matrix +having the same frame label. Then recover all Y banks by the groupwise +differences $y_t=p_t-p_{t-1}$. The five D and Q inputs retain their separate +$B_9$ contract. + +Every step is bijective between its stated domains. To invert, compute the +chronological partial sums, apply the actual forward path and (for a rank-one +gap) its right wrapper, apply $E_9^{-1}$, and perform the profile's exact +Gaussian divisions. Terminal decoding divides the Newton coefficients by +positive $4$. An unavailable division rejects. It never rounds an input +into the domain. + +The parameters range over the entire product $R^{512\cdot52}$, so this is +an arbitrary-parameter module construction. It is not restricted to Gaussian +multiples of the paired Y27/Y26 family in PR #3426. That family remains a +credited regression example inside the classified domain. + +`classifier.py` implements the diagonal maps and the bank-coordinate change +without importing a native implementation. Its outputs are exact Python +integers and it does not mutate its inputs. The source layer separately +performs the authenticated frame maps. The functional arrays allocated by +these references are not presented as a measured in-place physical layout. + +## 6. Constructive arithmetic invoice and width + +One in-place $E_r$ schedule uses $r2^{r-1}$ Gaussian additions and the +same number of multiplications by $\pi$. Its inverse uses Gaussian +subtractions and exact divisions by $\pi$. Applying the diagonal one +$\pi$-step at a time costs the sum of its exponents. A terminal multiplication +by positive $4$ is implemented as two Gaussian doublings per entry. + +At rank nine, preparation of all 52 profiles, before their actual frame +pullbacks, costs: + +| Operation | Constructive count | +|---|---:| +| Gaussian additions in the 52 Newton encoders | 119,808 | +| Gaussian multiplications by $\pi$, including the diagonal profiles | 129,992 | +| Gaussian doublings for the five terminal profiles | 5,120 | +| Field subtractions to recover the 52 Y banks | 47 | +| Gaussian subtractions represented by those field subtractions | 24,064 | + +The 47 field differences can be performed in place from the last bank to the +first within each group. Their inverse runs forward. The full preparation +also includes **all 47 nonterminal actual inverse frame paths and all 15 +extra inverse right wrappers**. The source audit finds 158 native occurrences +with total rank 281 in those paths: 71,936 pair gates and 316 native wrappers, +plus the 15 extra wrappers, for 331 wrappers in total. Actual wrapper cycles, +phases, and scratch are recorded in the source-bound invoice. They are not +zero and are not included in the table. + +The literal signed-floor backend uses eight real additions/subtractions and +four real floor-halves per pair, with unit phases separately counted. Counting +one Gaussian addition or $\pi$ multiplication as two real additions gives the +following complete arithmetic sum for preparation, with all frame paths: + +$$ +8\cdot71936+2\cdot119808+2\cdot129992 ++2\cdot5120+2\cdot24064=1,133,456 +$$ + +real additions/subtractions, together with 287,744 real floor-halves. Wrapper +movement and phase costs remain distinct invoice entries. Undo executes the +reversed paths and the exact profile inverses: its real-addition count is +1,123,216, since the 10,240 real terminal doublings become exact halvings. +It additionally has 259,984 real exact halves from Gaussian $\pi$ divisions +and 10,240 real terminal exact halves, as well as the same 287,744 native +floor-halves. These are constructive schedules, with no minimality claim. + +For a finite-width interpretation, let every real and imaginary component of +every supplied coefficient have absolute value at most $H$. The exact +coefficient-to-profile component gains at rank nine are 3456, 3828, and +13,452 for the three rows of the profile table. For example, the first is + +$$ +\sum_{d=0}^9 {9\choose d} + 2^{\lceil\max(4,d)/2\rceil}=3456. +$$ + +The rank-one gain is + +$$ +\sum_{d=0}^8{8\choose d} +[2^{\lceil\max(4,d)/2\rceil} ++2^{\lceil(\max(4,d)+1)/2\rceil}]=3828. +$$ + +These are absolute row sums in real coordinates and bound intermediate +Newton-encoder states as well. + +Every ideal native stage and monomial wrapper is unitary. A 512-entry array +with component bound $M$ has Euclidean norm at most $32M$, so every stage +of a frame pullback has component bound at most $32M$. Thus a nonterminal +partial sum has component bound at most $32\cdot3828H=122,496H$. Terminal +partial sums have bound $13,452H$. The bank-difference schedule has bound +$244,992H$. Separately, allowing a conservative factor five on the native +stage bound for the literal pair's difference, middle, and restore temporaries +gives the encoder-work bound $5\cdot122,496H=612,480H$. +Constant arithmetic work space and diagonal/Newton scratch also +fit this bound. This is less than $2^{20}H$. + +Conversely, if an admitted prepared Y input has component bound $J$, a +partial sum has bound $24J$. Its forward path has bound $768J$, the +Newton decoder has component gain at most 32, and exact profile divisions +do not increase the component bound. A conservative decoder stored bound is +$24,576J$, with temporary bound $98,304J<2^{17}J$. A signed storage +implementation needs a sign bit in addition to these magnitude bounds. +Widths must be reserved explicitly; the Python reference supplies no fixed +width physical implementation. These are codec bounds, not admission or +width statements about an omitted caller or external recipient. + +## 7. What this preparation does and does not pay for + +The preparation is a bijection **from arbitrary coefficient banks to admitted +native-domain Y banks**. It does not preserve the original interpretation of +an arbitrary pre-existing Y input. A caller must supply and prove the +appropriate input/output intertwining for this changed coordinate contract. + +If raw coefficient sources must remain borrowed and unchanged, one explicit +abstract schedule uses 52 owned zero banks, 52 copy ADDs, the preparation, +its inverse after the caller has returned the prepared banks, and 52 cleanup +subtractions against the unchanged sources. That final return is an input +condition to this schedule; it is not proved by a producer-only analysis. +Producing the six dirty D/Q banks from raw coefficients would separately +require six Newton encoders and their ownership/restoration contract. Allowing +arbitrary initially admitted dirty D/Q values does not declare them zero. + +Actual tape routes, copy tariffs, bounded-width gate implementation, supplier +and consumer interfaces, return frames, scratch ownership and liveness, and +any displaced-work credit remain explicit obligations. This result makes a +correlated stagewise producer entrance constructive and reviewable. It does +not reopen the frozen 599/584 profile screen or certify a fully paid caller. + +## 8. Lineage and limits of the new result + +The frozen word is ywz65's PR #2586 word, with its existing native archive and +collector lineage. The source-bound Newton domain and gate intertwiners are +from Clear1nsight's PR #3382; the literal actual-interface analysis is from +Clear1nsight's PR #3423; exact native covariance with phase is from PR #3416. +Nick Petalas / petalas's PR #3426 establishes the ideal correlated terminal +module and a nontrivial exact literal family, and names the stagewise +classification answered here. The wider lattice and collector predecessors +retain their credit in the package source manifest. + +The new universal statement is the explicit product of the two interval +profiles and five terminal profiles, transported by the actual histories and +the unimodular partial-sum change. Finite replay checks its application to +the frozen word; it is not substituted for the algebraic necessity proof. +No predecessor source, selected frontier, full-word claim, or external-port +scope is changed. + +## Concurrent sharp calibration + +At the submission checkpoint, Nick Petalas's independently developed +[PR #3449](https://github.com/CrocSwap/integer-mult-bounds/pull/3449), +head `5cb2ff187a27de1cbd1a37933f7228b35b15702b`, was public. It proves the +sharp $2^{280}$ module for the named $Y27=y$, $Y26=-y$ family across +events 1090, 1092, and 1129, with other sources in $4B_9$. Its Newton +exponent $\max(|S|,4+1_{0\in S})$ equals equation (3) after subtracting +$|S|$ to pass to weighted coefficient coordinates. That supplies a matching +independent calibration of the rank-one formula. Its proof was read at the +checkpoint, after this package's full module and dense receipt had been +constructed. No code, certificate, or provisional claim from it is imported. + +The contribution here is the complete 58-bank entrance, all 47 independently +parameterised intermediate partial sums and five terminal sums, the actual-path +encoder/inverse, and their direct cost/width obligations. No priority over the +concurrent local result is claimed. See [COSTS.md](COSTS.md) for the explicitly +stated component-overwrite model behind the optional SWAP/phase lowering; it +is not an assertion about the repository's stricter ADD tariff. diff --git a/research/p104-restored-query/inputs/PR3467_README.md b/research/p104-restored-query/inputs/PR3467_README.md new file mode 100644 index 0000000000..dd0e3bcec2 --- /dev/null +++ b/research/p104-restored-query/inputs/PR3467_README.md @@ -0,0 +1,256 @@ +# Exact correlated entrance for the first P104 collector + +Clear1nsight, with substantial OpenAI assistance from four concurrent agents. + +This package answers the stagewise admission question left by +[PR #3426](https://github.com/CrocSwap/integer-mult-bounds/pull/3426). +It gives the **maximal correlated entrance within the 58 initial Newton +banks** for exact literal execution of the first collector's **257-event +producer dependency cone**, followed by six admitted collector inputs. It +also supplies an explicit reversible parameterisation and its direct +arithmetic and width bill. + +The result is a local module theorem. Its index is $2^{20424}$, compared with +$2^{10240}$ for the predecessor's ideal final-cut conditions. The additional +factor $2^{10184}$ measures stagewise divisibility constraints. These are +algebraic indices, not saved storage bits or a supplier improvement. + +The frozen main is `6f100d4bb5083f8c35d96fd95a539811c62f245c`. The scientific +WORD and NATIVE bytes are the existing PR #2586 inputs retained through +PR #2665. The selected frontier and the conditional unchanged-profile +**599/584** cost stop are preserved. + +## Exact scope + +Let $R=\mathbb Z[i]$, $\pi=1+i$, and + +$$ +E_r=\begin{pmatrix}1&0\\1&\pi\end{pmatrix}^{\otimes r}, +\qquad B_r=E_rR^{2^r}. +$$ + +The actual rank is nine, with 512 Gaussian coordinates per bank. Initially, +the 52 Y banks and the six dirty banks D31, D30, D29, D28, D27 and Q7 all +belong to $B_9$. Those six dirty values are arbitrary admitted values. + +The classified contract requires every fractional ADD in the selected cone +to have an integral increment, every native pair's literal signed-floor +output to equal its ideal output, and all six target arrays immediately +before zero-based event 2025 to belong to $B_9$. The proof establishes both +necessity and sufficiency within this initial domain. + +The original prefix has 2,025 events, of which 1,768 are outside this cone. +This theorem does not admit their omitted arithmetic histories, the later +external recipients, or genuinely rounded trajectories whose errors later +cancel. The cone contains 200 native occurrences, 52 positive quarter-ADDs, +and five early dirty D-to-Q subtractions. The native rank sum is 354. + +## The admission theorem + +In each actual chronological Y group, replace its sources by independent +partial-sum coordinates + +$$ +p_t=y_1+\cdots+y_t,\qquad y_t=p_t-p_{t-1},\qquad p_0=0. +$$ + +This bank change is unimodular. The five groups have sizes 3, 7, 7, 11 and +24. Their 47 nonterminal intervals have only two types. The five final +partial sums supply the terminal conditions. + +| Partial-sum interval | Count | Diagonal exponent in weighted Newton coordinates | Local index | +|---|---:|---|---:| +| No D transport | 32 | $\max(4-|S|,0)$ | $2^{187}$ | +| One actual rank-one D transport | 15 | $\max(4-|S\setminus\{0\}|,0)$ | $2^{280}$ | +| Terminal sum | 5 | $4$ on every coefficient | $2^{2048}$ | + +For a read-frame map $A_H$ and a rank-one native's actual right wrapper +$M_R$, the nonterminal modules are respectively $A_H^{-1}L_0$ and +$(M_RA_H)^{-1}L_1$, with the displayed diagonal profiles defining $L_0$ +and $L_1$. Every terminal sum belongs to $4B_9$. + +The rank-one condition comes from testing both sides of its actual $C_0$ +stage. Writing a bit-zero pair as $(f,f+\pi g)$ gives +$C(f,f+\pi g)=(f+g,f+ig)$. Both arrays are divisible by four exactly when +both $f$ and $g$ are divisible by four. Testing only the quarter output +would miss this extra condition. + +Consequently the quotient of $B_9^{52}$ by the exact Y entrance +$\mathcal M$ is + +$$ +(R/(\pi))^{4368}\oplus(R/(\pi^2))^{1992} +\oplus(R/(\pi^3))^{528}\oplus(R/(\pi^4))^{2622}. +$$ + +There are also 17,114 unrestricted Gaussian coefficient coordinates. The +index exponent is $32(187)+15(280)+5(2048)=20424$. For the predecessor's +ideal entrance $\mathcal I$ and the strong independent product entrance, + +$$ +(4B_9)^{52}\subsetneq\mathcal M\subsetneq\mathcal I, +\qquad [\mathcal I:\mathcal M]=2^{10184}, +\qquad [\mathcal M:(4B_9)^{52}]=2^{86072}. +$$ + +[PROOF.md](PROOF.md) includes the dirty-input argument, sufficiency of the +quarter increments, terminal admission, and the literal pair parity +criterion. Odd internal floor-halves are allowed when the complete pair +still equals its integral ideal output. + +## Constructive encoder and inverse + +The encoder takes **52 owned arbitrary Gaussian coefficient banks**. It +applies each local diagonal profile and Newton encoder, follows the actual +inverse frame history, applies the extra inverse right wrapper where +required, and finally takes groupwise backward differences. Terminal scaling +uses positive $4$, since $\pi^4=-4$ has a different parameter convention. + +The inverse takes forward partial sums, follows the actual forward histories, +and performs exact Newton and diagonal divisions. It rejects unavailable +divisions. These maps are a bijection onto the entire classified entrance. +The six already admitted dirty D/Q banks are supplied separately. + +This parameterisation changes the numerical meaning of arbitrary raw source +arrays. A useful caller still needs an input/output intertwiner and a proved +returned-source, frame, and ownership contract. Functional Python arrays are +reference implementations of the algebraic schedule, without a measured +physical in-place layout. + +## Direct preparation costs + +The actual 47 nonterminal inverse paths contain 158 native occurrences of +total rank 281. Including the 15 extra right wrappers gives 331 wrapper +occurrences, 10,452 permutation cycles, and 159,020 direct Gaussian payload +SWAPs. The independent counter reconstructs these histories from the frozen +inputs without importing the primary implementation. + +| Arithmetic category | Encoder | Decoder | +|---|---:|---:| +| Real ADD/subtract subtotal before SWAP and phase lowering | 1,133,456 | 1,123,216 | +| Native real signed floor-halves | 287,744 | 287,744 | +| Additional exact real halves | 0 | 270,224 | +| Native pair applications | 71,936 | 71,936 | +| Gaussian payload SWAPs | 159,020 | 159,020 | + +Wrapper phases, native quarter turns, and movement are separately itemised +in [COSTS.md](COSTS.md). Its optional component-arithmetic lowering permits +source-minus-target overwrites; it is not the repository's stricter ADD +tariff. The resulting schedules are constructive upper bounds, with no +minimality claim. + +For raw coefficient component bound $H$, all encoder work is bounded by +$612480H<2^{20}H$. For an admitted Y component bound $J$, decoder work is +bounded by $98304J<2^{17}J$. Signed storage also needs a sign bit. These +bounds concern this codec; physical routing, control, copies, the six dirty +inputs, caller execution, and recursive tariffs still need their own bill. + +## Reproduction and evidence + +No third-party Python dependency is required. The registered Python 3.12 +commands run with ordinary and optimised interpretation: + +```sh +python3 -B scripts/research_package.py --package research/p104-stagewise-entrance --check-only +python3 -B scripts/research_package.py --package research/p104-stagewise-entrance +``` + +Both registered modes passed on CPython 3.12.14, producing the same complete +typed receipt. Its file SHA-256 is +`91b4f644189bacdd19952e360d55d3738a915e50cf98001baf7f47fda54bd561`; +its canonical scientific digest is +`f2ec5be0707ab21f9f7fae68ebb91e862c8ee8eff094fc2e62b37af39b9a0f49`. +Metadata and source pins also passed. Separate CLI processes in a disposable +Git-free copy rejected a missing WORD, a corrupted WORD, and a receipt with +Boolean `true` replacing integer `1`, each for the intended reason. + +Inside a Git-free package export, run: + +```sh +python3 -I -B research/p104-stagewise-entrance/verify.py +python3 -I -O -B research/p104-stagewise-entrance/verify.py +``` + +The verifier rebuilds [RECEIPT.json](RECEIPT.json) and compares its full typed +contents. It authenticates scientific and retained predecessor bytes before +mathematics and again before success. Its six implementation modules execute +from captured source bytes, and their hashes and the verifier hash are +recorded and rechecked. An explicit generation command uses exclusive +creation, so it cannot overwrite an existing receipt silently. + +The evidence includes: + +- Separate primary D-path and independent Y-path constructions agreeing on + the dense initial and cut hashes, with 52 codec roundtrips. Both evaluate + the actual cone and each checks all six full-array cut formulae. +- A deterministic dense fixture checking all 90,624 literal/ideal native + pairs and all 52 exact quarter reads. It passes through a non-$B_9$ + intermediate D28 value at event 1087 and returns admitted cut arrays. +- Two ideal-admitted controls rejected by the module decoder and literal + trace. Their first failures are an inexact quarter at event 1087 and an + inexact native pair at event 1089. +- The credited PR #3426 paired-$64$ family passing the cone and giving a + zero cut. Its cone counts are distinct from that predecessor's full-prefix + experiment. +- Independent threshold checks for every one of the 512 basis directions + in each nonterminal profile, plus an independently reconstructed cost + invoice. The written proof supplies universal necessity and sufficiency; + finite basis checks alone are not a proof for nonlinear rounded paths. +- Rejection of duplicate-key, floating, nonfinite, and Boolean-as-integer + receipt data, unavailable exact profile divisions, and a corrupt frozen + scientific source. + +The reused PR #3382 model is a dependency of the primary implementation. +`independent.py` and `independent_cost.py` import neither it nor the primary +layers. Complete native covariance is inherited from PR #3416; binding the +recipes here does not recertify its full 1,245-record theorem. No independent +human review or formal proof-kernel acceptance is claimed. + +## Coordination and credit + +The canonical claim is +[Discussion #2750, comment 19009685](https://github.com/CrocSwap/integer-mult-bounds/discussions/2750#discussioncomment-19009685). +The submission checkpoint found unchanged main and completed all four +open-PR pages, 368 records, alongside targeted Discussion refreshes. This is +a scoped overlap review, not a complete novelty certificate. + +The mathematical and source predecessors include ywz65's PR #2586 word, +Arham Tahir's PR #2665 retention, Clear1nsight's PR #3382 Newton domain and +PR #3423 producer interfaces, Nick Petalas's PR #3416 native covariance and +PR #3426 ideal correlated entrance, Tekalign's PR #3025 literal-floor and +PR #3218 phase-sensitive checks, Ross Richardson's PR #3068 domain question, +and Jose Manuel and Vasek W's inherited unchanged-profile cost stop. +[SOURCES.json](SOURCES.json) records exact source identities and retained +proofs, with the older collector lineage retained in the exported sources. + +Nick Petalas's concurrent +[PR #3449](https://github.com/CrocSwap/integer-mult-bounds/pull/3449), at +`5cb2ff187a27de1cbd1a37933f7228b35b15702b`, independently gives the sharp +index-$280$ condition for the particular Y27/Y26 rank-one window. Its proof +was read at submission and agrees with the local profile above. This package +adds the general 58-bank module, all 52 independent partial-sum coordinates, +and the actual-path codec and bill. No priority over that concurrent local +formula is claimed. + +Hiroki Kumazaki's PR #3446 recipient closure and Nick Petalas's PR #3448 +all-depth product entrance are complementary results. Their complete +executables were not replayed here, and their scopes are not absorbed into +this producer claim. + +## Open next questions + +1. **Which actual caller consumes these coefficient coordinates and returns + the prepared banks for undo?** Name its output, prove the input/output + intertwiner and return equations, and price copies, control, routes, + widths, cleanup, and displaced work. No such paid caller is supplied by + this producer theorem. +2. **What further stagewise conditions does that caller need outside the + cone?** Intersect this explicit module with its additional authenticated + reads and recipient histories. Coordinate with PR #3446's closure and + PR #3449's noncone-read handoff. The required whole execution and ownership + boundary must be specified first. +3. **Can a named changed supplier profile afford the complete bill?** Declare + the changed coverage or cost hypothesis and apply a fully charged + optimistic moment screen before another supplier construction round. + The unchanged 599/584 screen remains a stop; the larger admission module + supplies no new selected frontier or all-size transfer. diff --git a/research/p104-restored-query/inputs/pr3467/admission.py b/research/p104-restored-query/inputs/pr3467/admission.py new file mode 100644 index 0000000000..c035cc9f95 --- /dev/null +++ b/research/p104-restored-query/inputs/pr3467/admission.py @@ -0,0 +1,102 @@ +"""Constructive coordinates for the source-bound exact producer entrance. + +Clear1nsight, with substantial OpenAI assistance. Apache-2.0. +This is a parameterisation of new source values, not a repair of a caller's +existing values or a claim about any omitted prefix/recipient arithmetic. +""" + + +def encode_sources(structure, plans, model, source, classifier, parameters): + source.require(type(parameters) is list and len(parameters) == 52, + "52 independent partial-sum coefficient banks") + partials = [] + for gap, coefficients in zip(structure["gaps"], parameters): + value = classifier.encode_profile(coefficients, gap["kind"]) + if gap["kind"] == "rank_one": + plan = plans[gap["transport_event"]] + value = source.apply_wrapper(value, plan["right"], model, inverse=True) + if gap["kind"] != "terminal": + value = source.apply_path(value, gap["path_to_read"], plans, model, inverse=True) + partials.append(value) + initial_y = {} + offset = 0 + for bank in source.D_BANKS: + rows = structure["groups"][bank] + count = len(rows) + values = classifier.prefix_difference(partials[offset:offset + count]) + initial_y.update((row["source"], value) for row, value in zip(rows, values)) + offset += count + source.require(offset == 52 and set(initial_y) == set(source.YS), "complete source encoder") + return initial_y + + +def decode_sources(structure, plans, model, source, classifier, initial_y): + source.require(set(initial_y) == set(source.YS), "exact52 source roles") + source.require(all(model.member(values) for values in initial_y.values()), "initial source B domain") + partials = [] + for bank in source.D_BANKS: + rows = structure["groups"][bank] + partials.extend(classifier.prefix_sum([initial_y[row["source"]] for row in rows])) + parameters = [] + for gap, value in zip(structure["gaps"], partials): + if gap["kind"] != "terminal": + value = source.apply_path(value, gap["path_to_read"], plans, model) + if gap["kind"] == "rank_one": + value = source.apply_wrapper(value, plans[gap["transport_event"]]["right"], model) + parameters.append(classifier.decode_profile(value, gap["kind"])) + return parameters + + +def dense_fixture(structure, plans, model, source, classifier): + parameters = [source.coefficient_fixture(slot) for slot in range(52)] + initial = encode_sources(structure, plans, model, source, classifier, parameters) + for slot, name in enumerate(source.TARGETS, start=52): + initial[name] = model.encode(source.coefficient_fixture(slot)) + recovered = decode_sources(structure, plans, model, source, classifier, + {name: initial[name] for name in source.YS}) + source.require(recovered == parameters, "all52 actual-path source codec inverses") + return initial + + +def expected_cut(initial, structure, plans, model, source): + """PR3426's inherited ideal rows, checked against the literal dense trace.""" + outputs = {} + for bank in source.D_BANKS: + total = [(0, 0)] * source.SIZE + for row in structure["groups"][bank]: + total = [model.add(a, b) for a, b in zip(total, initial[row["source"]])] + source.require(all(x % 4 == 0 for value in total for x in value), "terminal quarter integral") + normalised = [model.add(a, (b[0] // 4, b[1] // 4)) + for a, b in zip(initial[bank], total)] + outputs[bank] = source.apply_path(normalised, structure["cut_paths"][bank], plans, model) + q = initial["Q7"][:] + for bank in source.D_BANKS: + q = [model.sub(a, b) for a, b in zip(q, initial[bank])] + outputs["Q7"] = source.apply_path(q, structure["cut_paths"]["Q7"], plans, model) + return outputs + + +def control_initials(structure, plans, model, source): + first = min((gap for gap in structure["gaps"] if gap["kind"] == "rank_one"), + key=lambda gap: gap["event"]) + rows = structure["groups"][first["bank"]] + position = next(i for i, row in enumerate(rows) if row["event"] == first["event"]) + following = rows[position + 1]["source"] + output = {} + for kind in ("quarter", "native"): + value = [(1, 0)] * source.SIZE if kind == "quarter" else [ + (-4, 0) if k & 1 else (0, 0) for k in range(source.SIZE)] + if kind == "native": + value = source.apply_wrapper(value, plans[first["transport_event"]]["right"], + model, inverse=True) + value = source.apply_path(value, first["path_to_read"], plans, model, inverse=True) + initial = {name: [(0, 0)] * source.SIZE for name in structure["dependencies"]} + initial[first["source"]] = value + initial[following] = [(-a, -b) for a, b in value] + source.require(all(model.member(v) for v in initial.values()), "control initial B domain") + output[kind] = initial + paired = {name: [(0, 0)] * source.SIZE for name in structure["dependencies"]} + paired["Y27"][0] = (64, 0) + paired["Y26"][0] = (-64, 0) + output["paired64"] = paired + return output diff --git a/research/p104-restored-query/inputs/pr3467/classifier.py b/research/p104-restored-query/inputs/pr3467/classifier.py new file mode 100644 index 0000000000..6a299ce9b9 --- /dev/null +++ b/research/p104-restored-query/inputs/pr3467/classifier.py @@ -0,0 +1,229 @@ +"""Explicit Gaussian profiles for the pinned producer's partial-sum gaps. + +Clear1nsight, with substantial OpenAI assistance. Apache-2.0. + +This module implements only the diagonal profiles and the reversible change of +bank coordinates. It neither reads the source word nor supplies a native path. +The source-bound caller is responsible for authenticating each gap and applying +its actual frame pullback. The finite reference uses at most nine address bits; +PROOF.md gives the algebraic statements at arbitrary rank. +""" + +from math import comb + + +MAX_RANK = 9 +KINDS = ("zero", "rank_one", "terminal") + + +class ClassifierError(ValueError): + """Malformed data or a violated finite-reference contract.""" + + +class OutsideProfile(ClassifierError): + """A Gaussian division required by the profile is unavailable.""" + + +def require(condition, message): + if not condition: + raise ClassifierError(message) + + +def _rank(rank): + require(type(rank) is int and 0 <= rank <= MAX_RANK, + "rank must be an integer in 0..9") + return rank + + +def _array(values, rank=None): + require(type(values) is list and values, + "Gaussian array must be a nonempty list") + size = len(values) + require(size <= 1 << MAX_RANK and size & (size - 1) == 0, + "Gaussian array length must be a power of two at most 512") + actual = size.bit_length() - 1 + if rank is not None: + require(_rank(rank) == actual, "array rank mismatch") + for value in values: + require(type(value) is tuple and len(value) == 2, + "Gaussian value must be a tuple of two integers") + require(all(type(component) is int for component in value), + "Gaussian components must be integers, not Boolean values") + return actual + + +def _add(a, b): + return a[0] + b[0], a[1] + b[1] + + +def _sub(a, b): + return a[0] - b[0], a[1] - b[1] + + +def _times_pi(a): + return a[0] - a[1], a[0] + a[1] + + +def _divide_pi(a): + real, imag = a + if (real + imag) % 2: + raise OutsideProfile("required division by 1+i is not Gaussian integral") + return (real + imag) // 2, (imag - real) // 2 + + +def _pi_l1(exponent): + """Sum of absolute real/imaginary parts of (1+i)**exponent.""" + return 1 << ((exponent + 1) // 2) + + +def profile(kind, rank=9): + """Return a canonical diagonal and its algebraic/abstract gate invoice. + + ``zero`` describes B_r intersect 4 Z[i]^(2**r). + ``rank_one`` describes q and C_0 q both in 4 Z[i]^(2**r). + ``terminal`` describes 4 B_r, encoded using +4, not pi**4 = -4. + + Index exponents are logarithms to base two of Gaussian-lattice indices. + They are not a physical storage, operation, or supplier-cost lower bound. + Counts describe one in-place arithmetic schedule, not Python allocations. + """ + _rank(rank) + require(type(kind) is str and kind in KINDS, "unknown gap kind") + require(kind != "rank_one" or rank >= 1, + "rank-one profile needs address bit zero") + size = 1 << rank + if kind == "zero": + exponents = [max(4 - mask.bit_count(), 0) for mask in range(size)] + gain = sum(comb(rank, degree) * _pi_l1(max(4, degree)) + for degree in range(rank + 1)) + elif kind == "rank_one": + exponents = [max(4 - (mask & ~1).bit_count(), 0) + for mask in range(size)] + gain = sum(comb(rank - 1, degree) + * (_pi_l1(max(4, degree)) + _pi_l1(max(4, degree) + 1)) + for degree in range(rank)) + else: + exponents = [4] * size + gain = 4 * sum(comb(rank, degree) * _pi_l1(degree) + for degree in range(rank + 1)) + pairs = rank * (size // 2) + diagonal_pi_steps = sum(exponents) if kind != "terminal" else 0 + return { + "kind": kind, + "rank": rank, + "dimension": size, + "exponents": exponents, + "exponent_histogram": {str(k): exponents.count(k) for k in range(5)}, + "pi_index_exponent": sum(exponents), + "coefficient_to_value_component_gain": gain, + "encode_schedule": { + "gaussian_additions": pairs, + "gaussian_pi_multiplications": pairs + diagonal_pi_steps, + "gaussian_doublings": 2 * size if kind == "terminal" else 0, + }, + "decode_schedule": { + "gaussian_subtractions": pairs, + "exact_gaussian_pi_divisions": pairs + diagonal_pi_steps, + "exact_gaussian_halvings": 2 * size if kind == "terminal" else 0, + }, + "source_path_cost_included": False, + } + + +def _encode_newton(coefficients): + rank = _array(coefficients) + values = coefficients[:] + for bit in range(rank): + step = 1 << bit + for address in range(len(values)): + if not address & step: + other = address | step + values[other] = _add(values[address], _times_pi(values[other])) + return values + + +def _decode_newton(values): + rank = _array(values) + coefficients = values[:] + for bit in reversed(range(rank)): + step = 1 << bit + for address in range(len(coefficients)): + if not address & step: + other = address | step + coefficients[other] = _divide_pi( + _sub(coefficients[other], coefficients[address])) + return coefficients + + +def encode_profile(coefficients, kind): + """Encode arbitrary Gaussian coefficients into the named local profile. + + No actual frame pullback is performed here. Terminal convention is +4 E c. + Inputs are never mutated. Python integers are exact and have no hidden + fixed-width wraparound; the proof states explicit finite-width obligations. + """ + rank = _array(coefficients) + data = profile(kind, rank) + if kind == "terminal": + return [(4 * a, 4 * b) for a, b in _encode_newton(coefficients)] + scaled = coefficients[:] + for address, exponent in enumerate(data["exponents"]): + for _ in range(exponent): + scaled[address] = _times_pi(scaled[address]) + return _encode_newton(scaled) + + +def decode_profile(values, kind): + """Invert the local profile, raising OutsideProfile off its image. + + Signed division is exact: a nonzero remainder rejects before // is used. + The output consists of the arbitrary Gaussian coefficient coordinates, + which are a different contract from the prepared native-domain array. + """ + rank = _array(values) + data = profile(kind, rank) + coefficients = _decode_newton(values) + if kind == "terminal": + result = [] + for real, imag in coefficients: + if real % 4 or imag % 4: + raise OutsideProfile("terminal Newton coefficient is not divisible by 4") + result.append((real // 4, imag // 4)) + return result + for address, exponent in enumerate(data["exponents"]): + for _ in range(exponent): + coefficients[address] = _divide_pi(coefficients[address]) + return coefficients + + +def _banks(banks): + require(type(banks) is list and banks, + "bank sequence must be a nonempty list") + rank = _array(banks[0]) + for bank in banks[1:]: + _array(bank, rank) + return rank + + +def prefix_difference(partials): + """Recover chronological Y sources from their independent partial sums. + + For m banks this uses m-1 field subtractions. The separate in-place + schedule runs indices m-1 down to 1 so the earlier partial sum survives + until its last use. This functional implementation does not mutate inputs. + """ + _banks(partials) + return [partials[0][:]] + [ + [_sub(current, previous) for current, previous in zip(partials[j], partials[j - 1])] + for j in range(1, len(partials)) + ] + + +def prefix_sum(sources): + """Invert prefix_difference using m-1 chronological field additions.""" + _banks(sources) + partials = [sources[0][:]] + for source in sources[1:]: + partials.append([_add(previous, value) + for previous, value in zip(partials[-1], source)]) + return partials diff --git a/research/p104-restored-query/inputs/pr3467/inputs/pr3382_model.py b/research/p104-restored-query/inputs/pr3467/inputs/pr3382_model.py new file mode 100644 index 0000000000..4dd24a2627 --- /dev/null +++ b/research/p104-restored-query/inputs/pr3467/inputs/pr3382_model.py @@ -0,0 +1,428 @@ +"""Exact Gaussian Newton-lattice reference for the pinned P104 collector. + +Clear1nsight, with substantial OpenAI assistance. Apache-2.0. +The all-rank statements are written in PROOF.md. This finite reference accepts +at most nine address bits and 8192 magnitude bits per real array component. It imports +no predecessor implementation and makes no recursive or physical cost claim. +""" + +from math import comb, isqrt + +MAX_RANK = 9 +MAX_COMPONENT_BITS = 8192 +PI = (1, 1) +ZERO = (0, 0) + + +class ModelError(ValueError): + """A malformed input or violated finite-reference contract.""" + + +class OutsideLattice(ModelError): + """A required exact Gaussian division is unavailable.""" + + +def require(condition, message): + if not condition: + raise ModelError(message) + + +def rank_check(rank): + require(type(rank) is int and 0 <= rank <= MAX_RANK, "rank must be in 0..9") + return rank + + +def gaussian_check(value): + require(type(value) is tuple and len(value) == 2, "Gaussian value must be a pair") + require(all(type(x) is int for x in value), "Gaussian components must be integers") + require(all(x.bit_length() <= MAX_COMPONENT_BITS for x in value), + "Gaussian component exceeds finite reference limit") + return value + + +def validate(values, rank=None): + require(type(values) is list and values, "array must be a nonempty list") + size = len(values) + require(size <= 1 << MAX_RANK and size & (size - 1) == 0, "binary array length") + actual = size.bit_length() - 1 + if rank is not None: + require(rank_check(rank) == actual, "array rank mismatch") + for value in values: + gaussian_check(value) + return actual + + +def add(a, b): + return a[0] + b[0], a[1] + b[1] + + +def sub(a, b): + return a[0] - b[0], a[1] - b[1] + + +def mul(a, b): + return a[0] * b[0] - a[1] * b[1], a[0] * b[1] + a[1] * b[0] + + +def rot(value, phase): + a, b = value + return ((a, b), (-b, a), (-a, -b), (b, -a))[phase % 4] + + +def times_pi(value): + return value[0] - value[1], value[0] + value[1] + + +def divide_pi(value): + a, b = value + if (a + b) % 2: + raise OutsideLattice("not divisible by 1+i") + return (a + b) // 2, (b - a) // 2 + + +def half_exact(value): + if value[0] % 2 or value[1] % 2: + raise OutsideLattice("ideal Gaussian pair has a nonintegral component") + return value[0] // 2, value[1] // 2 + + +def pi_power(exponent): + rank_check(exponent) + result = (1, 0) + for _ in range(exponent): + result = times_pi(result) + return result + + +def encode(coefficients): + """E_r c, with E_1(c0,c1)=(c0,c0+(1+i)c1), in address-bit order.""" + rank = validate(coefficients) + out = coefficients[:] + for bit in range(rank): + step = 1 << bit + for address in range(len(out)): + if not address & step: + out[address | step] = add(out[address], times_pi(out[address | step])) + validate(out, rank) + return out + + +def decode(values): + """Exact E_r inverse; membership fails on an unavailable pi division.""" + rank = validate(values) + out = values[:] + for bit in reversed(range(rank)): + step = 1 << bit + for address in range(len(out)): + if not address & step: + out[address | step] = divide_pi(sub(out[address | step], out[address])) + validate(out, rank) + return out + + +def member(values): + validate(values) + try: + decode(values) + except OutsideLattice: + return False + return True + + +def newton(values): + """Unweighted multilinear coefficients, obtained by Boolean differences.""" + rank = validate(values) + out = values[:] + for bit in range(rank): + step = 1 << bit + for address in range(len(out)): + if not address & step: + out[address | step] = sub(out[address | step], out[address]) + validate(out, rank) + return out + + +def ideal_pair_numerators(a, b, inverse=False): + """Return twice C(a,b), so nonintegral examples can be checked exactly.""" + gaussian_check(a) + gaussian_check(b) + require(type(inverse) is bool, "inverse flag must be Boolean") + total = add(a, b) + difference = rot(sub(a, b), 3 if inverse else 1) + return add(total, difference), sub(total, difference) + + +def ideal_pair(a, b, inverse=False): + first, second = ideal_pair_numerators(a, b, inverse) + return half_exact(first), half_exact(second) + + +def lift_pair(a, b, inverse=False): + """Literal componentwise signed-floor lifting, without a grid change.""" + gaussian_check(a) + gaussian_check(b) + require(type(inverse) is bool, "inverse flag must be Boolean") + difference = sub(a, b) + middle = add(b, (difference[0] // 2, difference[1] // 2)) + difference = rot(difference, 3 if inverse else 1) + second = sub(middle, (difference[0] // 2, difference[1] // 2)) + return add(second, difference), second + + +def stage(values, bit, inverse=False, literal=False): + rank = validate(values) + require(type(bit) is int and 0 <= bit < rank, "address bit outside array") + require(type(inverse) is bool and type(literal) is bool, "stage flags must be Boolean") + out = values[:] + step = 1 << bit + pair = lift_pair if literal else ideal_pair + for address in range(len(out)): + if not address & step: + other = address | step + out[address], out[other] = pair(out[address], out[other], inverse) + validate(out, rank) + return out + + +def ideal_stage(values, bit, inverse=False): + return stage(values, bit, inverse=inverse) + + +def lift_stage(values, bit, inverse=False): + return stage(values, bit, inverse=inverse, literal=True) + + +def gate_bits(kind, bits, rank): + require(kind in ("C", "CINV", "S", "SINV", "X", "SWAP", "CNOT", "CZ"), + "unsupported gate") + count = 2 if kind in ("SWAP", "CNOT", "CZ") else 1 + require(type(bits) in (tuple, list) and len(bits) == count, "gate arity") + require(all(type(bit) is int and 0 <= bit < rank for bit in bits), "gate address bits") + require(len(set(bits)) == len(bits), "gate bits must be distinct") + return tuple(bits) + + +def value_gate(values, kind, bits): + """The physical Gaussian gate; CNOT bits are (control,target).""" + rank = validate(values) + bits = gate_bits(kind, bits, rank) + if kind in ("C", "CINV"): + return ideal_stage(values, bits[0], inverse=kind == "CINV") + out = [ZERO] * len(values) + for address, value in enumerate(values): + target, phase = address, 0 + first = (address >> bits[0]) & 1 + if kind == "X": + target ^= 1 << bits[0] + elif kind in ("S", "SINV"): + phase = first * (1 if kind == "S" else 3) + elif kind == "CNOT": + target ^= first << bits[1] + elif kind == "CZ": + phase = 2 * first * ((address >> bits[1]) & 1) + elif first != ((address >> bits[1]) & 1): + target ^= (1 << bits[0]) | (1 << bits[1]) + out[target] = rot(value, phase) + return out + + +def coefficient_pair(a, b, kind): + if kind == "C": + return add(a, b), rot(b, 1) + if kind == "CINV": + last = rot(b, 3) + return sub(a, last), last + if kind == "S": + return a, rot(add(a, b), 1) + if kind == "SINV": + return a, sub(rot(b, 3), a) + require(kind == "X", "unsupported coefficient pair") + return add(a, times_pi(b)), rot(b, 2) + + +def coefficient_gate(coefficients, kind, bits): + """Direct integral E^-1 gate E formulas; no encode/decode calls.""" + rank = validate(coefficients) + bits = gate_bits(kind, bits, rank) + if kind == "SWAP": + return value_gate(coefficients, kind, bits) + out = coefficients[:] + first = 1 << bits[0] + if len(bits) == 1: + for address in range(len(out)): + if not address & first: + other = address | first + out[address], out[other] = coefficient_pair(out[address], out[other], kind) + validate(out, rank) + return out + second = 1 << bits[1] + for address in range(len(out)): + if address & (first | second): + continue + a, b, c, d = (out[address | mask] for mask in (0, first, second, first | second)) + if kind == "CNOT": + out[address | first] = add(add(b, c), times_pi(d)) + out[address | first | second] = sub(rot(times_pi(c), 1), d) + else: + require(kind == "CZ", "unsupported coefficient block") + out[address | first | second] = sub(add(rot(a, 1), rot(times_pi(add(b, c)), 1)), d) + validate(out, rank) + return out + + +def wrapper_plan(record): + """Exact source convention: input x receives its phase, then moves to Ax+b.""" + keys = {"matrix_rows", "offset", "linear_Z4", "quadratic_rows", "phase"} + require(type(record) is dict and set(record) == keys, "wrapper schema") + rows, linear, quadratic = (record[name] for name in + ("matrix_rows", "linear_Z4", "quadratic_rows")) + require(type(rows) is list, "wrapper matrix rows") + rank = rank_check(len(rows)) + require(type(linear) is list and type(quadratic) is list, "wrapper phase arrays") + require(len(linear) == len(quadratic) == rank, "wrapper dimensions") + size = 1 << rank + require(all(type(row) is int and 0 <= row < size for row in rows + quadratic), + "wrapper binary rows") + require(all(type(value) is int and 0 <= value < 4 for value in linear), "linear phases") + require(type(record["offset"]) is int and 0 <= record["offset"] < size, "affine offset") + require(type(record["phase"]) is int and 0 <= record["phase"] < 4, "global phase") + result = [] + for address in range(size): + target = record["offset"] + phase = record["phase"] + for j in range(rank): + target ^= ((rows[j] & address).bit_count() & 1) << j + if address >> j & 1: + phase += linear[j] + for k in range(j + 1, rank): + phase += 2 * ((quadratic[j] >> k) & 1) * ((address >> k) & 1) + result.append((target, phase % 4)) + require(len({target for target, _ in result}) == size, "wrapper must be bijective") + return result + + +def wrapper(values, record, inverse=False): + validate(values) + require(type(inverse) is bool, "inverse flag must be Boolean") + plan = wrapper_plan(record) + require(len(plan) == len(values), "wrapper and array dimensions") + out = [ZERO] * len(values) + for source, (target, phase) in enumerate(plan): + if inverse: + out[source] = rot(values[target], -phase) + else: + out[target] = rot(values[source], phase) + return out + + +def codec_ledger(rank): + rank_check(rank) + size = 1 << rank + pairs = rank * size // 2 + return {"rank": rank, "complex_coordinates": size, "pairs_per_direction": pairs, + "encode": {"gaussian_adds": pairs, "pi_multiplications": pairs, + "real_add_subtracts": 4 * pairs, "component_reads": 4 * pairs, + "component_writes": 2 * pairs}, + "decode": {"gaussian_subtracts": pairs, "exact_pi_divisions": pairs, + "real_add_subtracts": 4 * pairs, "exact_real_halves": 2 * pairs, + "component_reads": 4 * pairs, "component_writes": 2 * pairs}, + "owned_in_place_complex_words": size, "pair_real_work_words": 4, + "borrowed_input_copy_included": False, "routing_included": False} + + +def codec_bounds(rank, component_bound): + """Sufficient integer bounds, per codec's own entrance; not physical prices.""" + rank_check(rank) + require(type(component_bound) is int and component_bound >= 0, "nonnegative bound") + gain = sum(comb(rank, k) * sum(abs(x) for x in pi_power(k)) for k in range(rank + 1)) + inverse_gain = 1 << ((rank + 1) // 2) + return {"rank": rank, "entrance_component_bound": component_bound, + "encode_component_gain": gain, "encode_component_bound": gain * component_bound, + "encode_scratch_bound": 3 * gain * component_bound, + "decode_component_gain": inverse_gain, + "decode_component_bound": inverse_gain * component_bound, + "decode_scratch_bound": 4 * inverse_gain * component_bound} + + +def collector_bounds(rank, source_count, component_bound): + rank_check(rank) + require(type(source_count) is int and 1 <= source_count <= 5, "source count in 1..5") + require(type(component_bound) is int and component_bound >= 0, "nonnegative bound") + size = 1 << rank + root = isqrt(2 * size) + if root * root < 2 * size: + root += 1 + native = source_count * root * component_bound + return {"rank": rank, "entrance_component_bound": component_bound, + "source_count": source_count, "native_prefix_component_bound": native, + "query_component_bound": native + component_bound, + "pair_scratch_component_bound": 5 * native, + "assumption": "exact unitary native prefixes on the admitted lattice"} + + +def collector_ledger(rank, native_rank, wrapper_cycle_counts): + """Complete direct collector counts; four actual source wrappers are required.""" + rank_check(rank) + require(type(native_rank) is int and 1 <= native_rank <= rank, "native rank") + size = 1 << rank + require(type(wrapper_cycle_counts) is list and len(wrapper_cycle_counts) == 4, + "four literal wrapper cycle counts required") + require(all(type(c) is int and 1 <= c <= size for c in wrapper_cycle_counts), + "wrapper cycle count") + pairs = native_rank * size + swaps = 4 * size + sum(wrapper_cycle_counts) + return {"complex_coordinates": size, "native_rank_each_direction": native_rank, + "paired_butterflies": pairs, "field_adds": 11, + "real_add_subtracts": 8 * pairs + 22 * size, + "floor_halves": 4 * pairs, "butterfly_quarter_turns": pairs, + "wrapper_cycle_counts": wrapper_cycle_counts[:], + "wrapper_cycles": sum(wrapper_cycle_counts), "wrapper_swaps": swaps, + "wrapper_unit_phases": 4 * size, + "butterfly_component_reads": 4 * pairs, "butterfly_component_writes": 4 * pairs, + "field_add_component_reads": 44 * size, "field_add_component_writes": 22 * size, + "source_component_reads_within_field_adds": 20 * size, + "wrapper_swap_component_reads": 4 * swaps, "wrapper_swap_component_writes": 4 * swaps, + "private_initialization_components": 2 * size, "private_zero_check_components": 2 * size, + "borrowed_source_complex_words": 5 * size, "mutable_query_complex_words": size, + "owned_private_complex_words": size, "wrapper_zero_scratch_complex_words": 1, + "pair_real_work_words": 4, "codecs_included": False, + "physical_routing_and_recursive_tariff_included": False} + + +def cold_codec_ledger(rank): + """Optional T=E^-1 U E caller: prepare five owned source banks and query.""" + codec = codec_ledger(rank) + size = 1 << rank + pairs = codec["pairs_per_direction"] + return {"rank": rank, "encodes": 6, "decodes": 6, + "owned_source_copy_adds": 5, "owned_source_cleanup_adds": 5, + "extra_owned_source_complex_words": 5 * size, + "extra_private_initialization_components": 10 * size, + "extra_private_zero_check_components": 10 * size, + "codec_real_add_subtracts": 48 * pairs, + "codec_exact_real_halves": 12 * pairs, + "codec_pi_multiplications": 6 * pairs, "codec_exact_pi_divisions": 6 * pairs, + "codec_component_reads": 48 * pairs, "codec_component_writes": 24 * pairs, + "copy_cleanup_real_add_subtracts": 20 * size, + "copy_cleanup_component_reads": 40 * size, + "copy_cleanup_component_writes": 20 * size, + "add_to_direct_collector_invoice": True, + "logical_output_map": "T = E_r^-1 U E_r", + "original_U_caller_admitted": False, + "physical_routing_and_recursive_tariff_included": False} + + +def cold_codec_bounds(rank, component_bound): + """Compose the optional cold caller's bounds from its raw coefficient entry.""" + encoder = codec_bounds(rank, component_bound) + physical = collector_bounds(rank, 5, encoder["encode_component_bound"]) + decoder = codec_bounds(rank, physical["query_component_bound"]) + return {"rank": rank, "raw_entrance_component_bound": component_bound, + "encoded_component_bound": encoder["encode_component_bound"], + "native_prefix_component_bound": physical["native_prefix_component_bound"], + "encoded_query_component_bound": physical["query_component_bound"], + "decoded_query_component_bound": decoder["decode_component_bound"], + "complete_scratch_component_bound": max(encoder["encode_scratch_bound"], + physical["pair_scratch_component_bound"], + decoder["decode_scratch_bound"]), + "logical_output_map": "T = E_r^-1 U E_r"} diff --git a/research/p104-restored-query/inputs/pr3467/source.py b/research/p104-restored-query/inputs/pr3467/source.py new file mode 100644 index 0000000000..2e6a5116db --- /dev/null +++ b/research/p104-restored-query/inputs/pr3467/source.py @@ -0,0 +1,269 @@ +"""Authenticated structure and exact execution of the first P104 producer cone. + +Clear1nsight, with substantial OpenAI assistance. Apache-2.0. +The frozen word, native recipes and Gaussian model retain their named authors. +Only the selected dependency cone is executed, not the omitted prefix events. +""" + +import gzip +import hashlib +import json +from collections import Counter +from fractions import Fraction +from pathlib import Path +from types import ModuleType + + +PACKAGE = Path(__file__).resolve().parent +ROOT = PACKAGE.parents[1] +SIZE = 512 +CUT = 2025 +D_BANKS = ("D31", "D30", "D29", "D28", "D27") +TARGETS = D_BANKS + ("Q7",) +YS = tuple("Y" + str(j) for j in list(range(22, 33)) + list(range(63, 104))) +SOURCE_HASHES = { + "word": "cec1fb3fbd0067b500ad5119a62ba60685be718e769374d7ec8abdd2beaa7e50", + "native": "ab91c78835c3e10cf3b2cb8a5d4e0b7cfc3df1ae5a811298d27842f2193e1e3d", + "model": "74c83367887dd885137b222155c86389fe0be9f1293a6f0e5fdb51d71f435fdd", +} + + +class SourceError(ValueError): + """A source binding, execution or finite-domain condition failed.""" + + +def require(condition, message): + if not condition: + raise SourceError(message) + + +def canonical(value): + return json.dumps(value, sort_keys=True, separators=(",", ":")).encode() + + +def digest(value): + return hashlib.sha256(canonical(value)).hexdigest() + + +def read_pinned(path, label): + path = Path(path) + require(path.is_file() and not path.is_symlink(), "regular input required: " + label) + with path.open("rb") as handle: + data = handle.read(32 * 1024 * 1024 + 1) + require(len(data) <= 32 * 1024 * 1024, "bounded source size") + require(hashlib.sha256(data).hexdigest() == SOURCE_HASHES[label], + "source digest mismatch: " + label) + return data + + +def load_inputs(root=ROOT): + root = Path(root) + word = json.loads(read_pinned(root / "research/p104-rounded-collector/inputs/WORD.json", "word")) + raw_native = read_pinned(root / "research/p104-rounded-collector/inputs/NATIVE.json.gz", "native") + native = json.loads(gzip.decompress(raw_native)) + model_path = PACKAGE / "inputs/pr3382_model.py" + model_bytes = read_pinned(model_path, "model") + model = ModuleType("p104_pinned_newton_model") + exec(compile(model_bytes, str(model_path), "exec"), model.__dict__) + return word, native, model + + +def occurrence_map(native): + result = {} + for item in native["transports"]: + for event in item["events"]: + require(type(event) is int and event not in result, "unique native occurrence") + result[event] = item + require(len(native["transports"]) == 1245 and len(result) == 2070, + "frozen native archive dimensions") + return result + + +def structure(word, native): + program = word["program"] + require(len(program) == 5398, "frozen word length") + needed = set(TARGETS) + selected = [] + for event in reversed(range(CUT)): + record = program[event] + if record[1] in needed: + require(record[0] in ("transport", "add"), "producer opcode") + selected.append(event) + if record[0] == "add": + needed.add(record[2]) + selected.reverse() + require(needed == set(TARGETS) | set(YS), "exact initial dependencies") + require(len(selected) == 257, "exact producer event count") + require(Counter(program[e][0] for e in selected) == {"transport": 200, "add": 57}, + "producer event profile") + require(all(word["initial_frames"][name] == [] for name in needed), "empty initial frames") + occurrences = occurrence_map(native) + frames = {name: [] for name in needed} + paths = {name: [] for name in needed} + groups = {name: [] for name in D_BANKS} + q_reads = [] + rank_mass = 0 + for event in selected: + record = program[event] + opcode, bank = record[:2] + if opcode == "transport": + old, new, rank = record[2:] + item = occurrences[event] + require((item["old"], item["new"], item["recipe"]["rank"]) == + (old, new, rank), "native old/new/rank binding") + require(frames[bank] == old, "actual transport frame chronology") + frames[bank] = new[:] + paths[bank].append(event) + rank_mass += rank + else: + source, coefficient, frame = record[2:] + require(frames[bank] == frames[source] == frame, "common ADD frame") + coefficient = Fraction(str(coefficient)) + if bank == "Q7": + require(source in D_BANKS and coefficient == -1 and not groups[source], + "Q reads only initial dirty D before quarters") + q_reads.append([event, source]) + else: + require(bank in D_BANKS and source in YS and coefficient == Fraction(1, 4), + "positive quarter into D") + groups[bank].append({ + "bank": bank, "source": source, "event": event, + "frame": frames[bank][:], "path_to_read": paths[bank][:], + "source_path_to_read": paths[source][:], + }) + require(rank_mass == 354, "producer native rank mass") + require(sorted(source for _, source in q_reads) == sorted(D_BANKS), "five dirty Q reads") + require([len(groups[d]) for d in D_BANKS] == [3, 7, 7, 11, 24], "source group sizes") + require(sorted(g["source"] for rows in groups.values() for g in rows) == sorted(YS), + "disjoint source groups exhaust52 Y") + gaps = [] + for bank in D_BANKS: + rows = groups[bank] + for index, row in enumerate(rows): + gap = dict(row) + if index + 1 == len(rows): + gap.update(kind="terminal", next_event=None, transport_event=None) + else: + next_event = rows[index + 1]["event"] + between = [e for e in selected if row["event"] < e < next_event + and program[e][1] == bank] + require(all(program[e][0] == "transport" for e in between), "pure read gap") + require(len(between) <= 1, "at most one native in each nonterminal gap") + if between: + require(program[between[0]][4] == 1, "one rank-one native per nonempty gap") + gap.update(kind="rank_one" if between else "zero", next_event=next_event, + transport_event=between[0] if between else None) + gaps.append(gap) + require(Counter(g["kind"] for g in gaps) == {"zero": 32, "rank_one": 15, "terminal": 5}, + "complete interval profile") + return { + "selected": selected, "dependencies": sorted(needed), "groups": groups, "gaps": gaps, + "q_reads": q_reads, "cut_frames": {name: frames[name] for name in TARGETS}, + "cut_paths": {name: paths[name] for name in TARGETS}, + "native_count": 200, "native_rank_mass": rank_mass, + } + + +def native_plans(word, native, selected, model): + occurrences = occurrence_map(native) + plans = {} + for event in selected: + record = word["program"][event] + if record[0] != "transport": + continue + item = occurrences[event] + require((item["old"], item["new"], item["recipe"]["rank"]) == + (record[2], record[3], record[4]), "recipe binding") + recipe = item["recipe"] + plans[event] = {"rank": recipe["rank"], + "left": model.wrapper_plan(recipe["left"]), + "right": model.wrapper_plan(recipe["right"])} + return plans + + +def apply_wrapper(values, plan, model, inverse=False): + require(len(values) == len(plan) == SIZE, "wrapper dimensions") + out = [(0, 0)] * SIZE + for source, (target, phase) in enumerate(plan): + if inverse: + out[source] = model.rot(values[target], -phase) + else: + out[target] = model.rot(values[source], phase) + return out + + +def apply_native(values, event, plans, model, inverse=False, literal=False): + plan = plans[event] + out = apply_wrapper(values, plan["left" if inverse else "right"], model, inverse) + bits = range(plan["rank"] - 1, -1, -1) if inverse else range(plan["rank"]) + for bit in bits: + out = model.stage(out, bit, inverse=inverse, literal=literal) + return apply_wrapper(out, plan["right" if inverse else "left"], model, inverse) + + +def apply_path(values, path, plans, model, inverse=False): + out = values[:] + for event in reversed(path) if inverse else path: + out = apply_native(out, event, plans, model, inverse=inverse) + return out + + +def trace_cone(word, structure_record, plans, model, initial): + require(set(initial) == set(structure_record["dependencies"]), "initial execution roles") + require(all(model.member(value) for value in initial.values()), "initial execution B domain") + state = {name: values[:] for name, values in initial.items()} + pairs = 0 + max_component = max(abs(x) for values in state.values() for value in values for x in value) + first_non_b = None + for event in structure_record["selected"]: + record = word["program"][event] + opcode, bank = record[:2] + if opcode == "transport": + plan = plans[event] + out = apply_wrapper(state[bank], plan["right"], model) + for bit in range(plan["rank"]): + step = 1 << bit + for address in range(SIZE): + if address & step: + continue + other = address | step + a, b = out[address], out[other] + numerators = model.ideal_pair_numerators(a, b) + if any(x % 2 for value in numerators for x in value): + return {"ok": False, "failure": {"event": event, "bank": bank, + "kind": "nonintegral_ideal_pair", "bit": bit, + "address": address, "inputs": [a, b], + "twice_ideal": numerators}, "pairs_checked": pairs} + ideal = tuple((a // 2, b // 2) for a, b in numerators) + actual = model.lift_pair(a, b) + require(actual == ideal, "signed-floor versus ideal pair equality") + out[address], out[other] = actual + pairs += 1 + state[bank] = apply_wrapper(out, plan["left"], model) + else: + source, coefficient = record[2:4] + factor = Fraction(str(coefficient)) + p, q = factor.numerator, factor.denominator + values = state[source] + bad = next(((j, component, x) for j, value in enumerate(values) + for component, x in enumerate(value) if p * x % q), None) + if bad is not None: + return {"ok": False, "failure": {"event": event, "bank": bank, + "source": source, "kind": "nonintegral_fractional_add", + "coordinate": bad[0], "component": bad[1], "value": bad[2], + "numerator": p, "denominator": q}, "pairs_checked": pairs} + state[bank] = [model.add(a, (p * b[0] // q, p * b[1] // q)) + for a, b in zip(state[bank], values)] + max_component = max(max_component, *(abs(x) for value in state[bank] for x in value)) + if first_non_b is None and not model.member(state[bank]): + first_non_b = {"event": event, "bank": bank} + cut = {name: state[name] for name in TARGETS} + return {"ok": True, "pairs_checked": pairs, "first_non_b": first_non_b, + "max_state_component": max_component, "cut_sha256": digest(cut), + "cut_in_b": {name: model.member(value) for name, value in cut.items()}, "cut": cut} + + +def coefficient_fixture(slot): + require(type(slot) is int and 0 <= slot < 58, "fixture slot") + return [(((37 * slot + 17 * k + 3 * k.bit_count()) % 11) - 5, + ((19 * slot + 29 * k + 5 * k.bit_count()) % 13) - 6) for k in range(SIZE)] diff --git a/research/p104-restored-query/observability.py b/research/p104-restored-query/observability.py new file mode 100644 index 0000000000..438b4ca96a --- /dev/null +++ b/research/p104-restored-query/observability.py @@ -0,0 +1,526 @@ +"""Source-bound quotient and small preparation/readout/direct checks. + +Clear1nsight, with substantial OpenAI assistance. Apache-2.0. + +The inherited PR3467 encoder/decoder and source-bound Gaussian model are +received through the authenticated primary context. This module does not +execute the 524-event caller. Its dense checks bind arrays supplied by that +caller; its three small fixtures check preparation, readout formulas, and +both strict direct schedules. Algebraic index and rank statements concern +observations, not information erasure, physical storage, or operation bounds. +""" + +from collections import Counter +from fractions import Fraction +import hashlib +import json + + +SIZE = 512 +D_BANKS = ("D31", "D30", "D29", "D28", "D27") +WORD_KEY = "research/p104-rounded-collector/inputs/WORD.json" +WORD_SHA256 = "cec1fb3fbd0067b500ad5119a62ba60685be718e769374d7ec8abdd2beaa7e50" +TERMINAL_SLOTS = [2, 9, 16, 27, 51] +TERMINAL_SOURCES = ["Y99", "Y100", "Y66", "Y72", "Y80"] +TERMINAL_EVENTS = [1231, 1393, 1459, 1641, 1831] +O_FRAME = [256, 136, 64, 40, 16, 4, 2, 1] + + +class ObservationError(ValueError): + """A source, lattice, observation, or retained-output check failed.""" + + +def require(condition, message): + if not condition: + raise ObservationError(message) + + +def canonical(value): + return json.dumps(value, sort_keys=True, separators=(",", ":"), allow_nan=False) + + +def digest(value): + return hashlib.sha256(canonical(value).encode("utf-8")).hexdigest() + + +def typed_equal(actual, expected): + if type(actual) is not type(expected): + return False + if type(actual) is dict: + return actual.keys() == expected.keys() and all( + typed_equal(actual[key], expected[key]) for key in actual) + if type(actual) in (list, tuple): + return len(actual) == len(expected) and all( + typed_equal(a, b) for a, b in zip(actual, expected)) + return actual == expected + + +def bank_check(values): + require(type(values) is list and len(values) == SIZE, "512-entry bank required") + require(all(type(z) is tuple and len(z) == 2 + and all(type(x) is int for x in z) for z in values), + "Gaussian tuple components must be exact integers, excluding bool") + + +def parameters_check(parameters): + require(type(parameters) is list and len(parameters) == 52, + "52 coefficient banks required") + require(len({id(values) for values in parameters}) == 52, + "coefficient bank objects must be distinct") + for values in parameters: + bank_check(values) + + +def zeros(): + return [(0, 0) for _ in range(SIZE)] + + +def basis(address, scalar=(1, 0)): + require(type(address) is int and 0 <= address < SIZE, "basis address") + require(type(scalar) is tuple and len(scalar) == 2 + and all(type(x) is int for x in scalar), "Gaussian basis scalar") + values = zeros() + values[address] = scalar + return values + + +def plus(left, right): + return [(a + c, b + d) for (a, b), (c, d) in zip(left, right)] + + +def minus(left, right): + return [(a - c, b - d) for (a, b), (c, d) in zip(left, right)] + + +def total(banks): + result = zeros() + for values in banks: + bank_check(values) + result = plus(result, values) + return result + + +def scaled(values, scalar): + require(type(scalar) is int, "integer scale required") + return [(scalar * a, scalar * b) for a, b in values] + + +def subset_encode(values): + """Independent finite E_9 formula, without using a codec implementation.""" + bank_check(values) + powers = [(1, 0)] + for _ in range(9): + a, b = powers[-1] + powers.append((a - b, a + b)) + result = [] + for address in range(SIZE): + real, imag, subset = 0, 0, address + while True: + a, b = values[subset] + c, d = powers[subset.bit_count()] + real += a * c - b * d + imag += a * d + b * c + if subset == 0: + break + subset = (subset - 1) & address + result.append((real, imag)) + return result + + +def source_spec(context): + raw = context["captured"][WORD_KEY] + require(type(raw) is bytes and hashlib.sha256(raw).hexdigest() == WORD_SHA256, + "captured WORD hash") + word = context["word"] + require(typed_equal(word, json.loads(raw)), "context WORD differs from captured bytes") + program, structure = word["program"], context["structure"] + needed, selected = set(D_BANKS) | {"Q7"}, [] + for event in reversed(range(2025)): + row = program[event] + if row[1] in needed: + require(row[0] in ("add", "transport"), "producer opcode") + selected.append(event) + if row[0] == "add": + needed.add(row[2]) + selected.reverse() + require(len(selected) == 257 and typed_equal(selected, structure["selected"]), + "actual backward cone binding") + groups, rows, terminals = [], [], [] + for bank in D_BANKS: + reads = [event for event in selected if program[event][:2] == ["add", bank]] + group = [] + for position, event in enumerate(reads): + literal = program[event] + require(type(event) is int and literal[3] == "1/4", + "actual positive quarter read") + following = reads[position + 1] if position + 1 < len(reads) else None + between = [] if following is None else [ + e for e in selected if event < e < following and program[e][1] == bank] + require(all(program[e][0] == "transport" for e in between) + and len(between) <= 1, "actual single-native or empty interval") + require(not between or type(program[between[0]][4]) is int + and program[between[0]][4] == 1, "actual rank-one interval") + kind = "terminal" if following is None else ("rank_one" if between else "zero") + actual_path = [e for e in selected if e < event + and program[e][:2] == ["transport", bank]] + source_path = [e for e in selected if e < event + and program[e][:2] == ["transport", literal[2]]] + row = {"bank": bank, "source": literal[2], "event": event, + "frame": literal[4], "kind": kind, "next_event": following, + "transport_event": between[0] if between else None, + "path_to_read": actual_path, "source_path_to_read": source_path} + inherited = structure["gaps"][len(rows)] + require(all(typed_equal(inherited[key], value) for key, value in row.items()), + "inherited interval differs from actual source") + group.append(row["source"]) + if following is None: + terminals.append(len(rows)) + rows.append(row) + groups.append(group) + require([row["source"] for row in structure["groups"][bank]] == group, + "actual source group order") + require([len(group) for group in groups] == [3, 7, 7, 11, 24], "five group sizes") + require(len(rows) == 52 and len({row["source"] for row in rows}) == 52, + "52 disjoint sources") + require(typed_equal(terminals, TERMINAL_SLOTS), "five terminal slots") + require([rows[i]["source"] for i in terminals] == TERMINAL_SOURCES, + "actual terminal source names") + require([rows[i]["event"] for i in terminals] == TERMINAL_EVENTS, + "actual terminal read events") + require(typed_equal(terminals, context["terminal_slots"]), "primary terminal slots") + return {"groups": groups, "rows": rows, "terminals": terminals, + "names": [row["source"] for row in rows]} + + +def check_y(initial_y, spec, model): + require(type(initial_y) is dict and set(initial_y) == set(spec["names"]), + "exact 52 Y roles") + for values in initial_y.values(): + bank_check(values) + require(model.member(values), "initial Y must be in B9") + + +def rho5(initial_y, spec, model): + check_y(initial_y, spec, model) + result = [] + for group in spec["groups"]: + summed = total(initial_y[name] for name in group) + require(all(x % 4 == 0 for z in summed for x in z), "terminal group quarter") + values = [(a // 4, b // 4) for a, b in summed] + require(model.member(values), "terminal group quotient must be in B9") + result.append(values) + return result + + +def sigma(readouts, spec, model): + require(type(readouts) is list and len(readouts) == 5, "five readout banks") + section = {name: zeros() for name in spec["names"]} + for slot, values in zip(spec["terminals"], readouts): + bank_check(values) + require(model.member(values), "section input must be in B9") + section[spec["rows"][slot]["source"]] = scaled(values, 4) + require(rho5(section, spec, model) == readouts, "common strong section identity") + return section + + +def decode(context, initial_y): + return context["admission"].decode_sources( + context["structure"], context["plans"], context["model"], + context["source"], context["classifier"], initial_y) + + +def encode(context, parameters): + parameters_check(parameters) + return context["admission"].encode_sources( + context["structure"], context["plans"], context["model"], + context["source"], context["classifier"], parameters) + + +def readout_images(context, dirty, readouts): + result = {} + for bank, value in zip(D_BANKS, readouts): + bank_check(dirty[bank]) + require(context["model"].member(dirty[bank]), "dirty D initial B9 admission") + path = context["structure"]["cut_paths"][bank] + result[bank] = context["source"].apply_path( + plus(dirty[bank], value), path, context["plans"], context["model"]) + return result + + +def rational_rank(rows): + matrix = [[Fraction(value) for value in row] for row in rows] + pivot_row = 0 + for column in range(len(matrix[0])): + pivot = next((j for j in range(pivot_row, len(matrix)) + if matrix[j][column]), None) + if pivot is None: + continue + matrix[pivot_row], matrix[pivot] = matrix[pivot], matrix[pivot_row] + factor = matrix[pivot_row][column] + matrix[pivot_row] = [x / factor for x in matrix[pivot_row]] + for row in range(len(matrix)): + if row != pivot_row and matrix[row][column]: + factor = matrix[row][column] + matrix[row] = [a - factor * b for a, b in + zip(matrix[row], matrix[pivot_row])] + pivot_row += 1 + if pivot_row == len(matrix): + break + return pivot_row + + +def quotient_and_rank(context, spec): + kinds = Counter(row["kind"] for row in spec["rows"]) + require(kinds == {"zero": 32, "rank_one": 15, "terminal": 5}, + "actual interval census") + profiles = { + "zero": [max(4 - address.bit_count(), 0) for address in range(SIZE)], + "rank_one": [max(4 - (address & ~1).bit_count(), 0) for address in range(SIZE)], + "terminal": [4] * SIZE, + } + for kind, exponents in profiles.items(): + inherited = context["classifier"].profile(kind, 9) + require(typed_equal(exponents, inherited["exponents"]), "retained profile exponents") + profile_indices = {kind: sum(exponents) for kind, exponents in profiles.items()} + inherited_index = sum(kinds[kind] * index for kind, index in profile_indices.items()) + strong_index = len(spec["rows"]) * 4 * SIZE + relative_index = strong_index - inherited_index + require(profile_indices == {"zero": 187, "rank_one": 280, "terminal": 2048} + and (inherited_index, strong_index, relative_index) == (20424, 106496, 86072), + "source-profile and relative indices") + bank_matrix = [[int(j == slot) for j in range(52)] for slot in spec["terminals"]] + final_matrix = [[sum(row[column] for row in bank_matrix) for column in range(52)]] + five_rank, final_rank = rational_rank(bank_matrix), rational_rank(final_matrix) + require((five_rank, final_rank) == (5, 1), "observable bank ranks") + diagonal_exponent = sum(address.bit_count() for address in range(SIZE)) + require(diagonal_exponent == 2304, "Newton nonzero triangular diagonal") + return { + "interval_counts": dict(sorted(kinds.items())), + "profile_index_exponents": profile_indices, + "B52_over_L_index_power_of_2": inherited_index, + "B52_over_S_index_power_of_2": strong_index, + "L_over_S_index_power_of_2": relative_index, + "quotient_statement": "L/S is isomorphic to K/(K intersect S), K=ker(rho5|L), " + "via [y] -> [y-sigma(rho5(y))].", + "rho5_descends_to_L_over_S": False, + "reason": "rho5(S)=B9^5; the common terminal-source section splits both domains.", + "E_rank_certificate": "Triangular subset matrix with nonzero diagonal pi^popcount(address).", + "E_determinant_pi_exponent": diagonal_exponent, + "five_readout_gaussian_rank": five_rank * SIZE, + "final_increment_gaussian_rank": final_rank * SIZE, + "five_readout_coefficient_kernel_gaussian_rank": (52 - five_rank) * SIZE, + "final_increment_coefficient_kernel_gaussian_rank": (52 - final_rank) * SIZE, + "returned_coefficient_banks": 52, + "rank_scope": "Observation maps only; the full restored query shear erases no coefficient data.", + } + + +def section_check(context, spec, parameters, initial_y): + model = context["model"] + readouts = rho5(initial_y, spec, model) + expected = [subset_encode(parameters[slot]) for slot in spec["terminals"]] + require(readouts == expected, "actual group sums differ from E terminal coefficients") + require(all(model.encode(parameters[slot]) == value + for slot, value in zip(spec["terminals"], expected)), + "retained Newton codec differs from subset formula") + strong = sigma(readouts, spec, model) + kernel = {name: minus(initial_y[name], strong[name]) for name in spec["names"]} + require(all(not any(z != (0, 0) for z in value) + for value in rho5(kernel, spec, model)), "section remainder not in ker rho5") + require(decode(context, initial_y) == parameters, "original 52 coefficient decode") + strong_parameters = decode(context, strong) + expected_strong = [parameters[j][:] if j in spec["terminals"] else zeros() + for j in range(52)] + require(strong_parameters == expected_strong, "strong section coefficient projection") + return readouts, strong, kernel + + +def direct_checks(parameters, query, spec, increment, direct_module): + bank_check(query) + expected_q = plus(query, increment) + outputs = [] + for mode in ("zero", "inplace"): + result = direct_module.run_direct(parameters, query, spec["terminals"], mode) + require(result["coefficients"] == parameters, "direct schedule erased coefficient data") + require(result["query"] == expected_q, "direct observation differs from readout formula") + receipt = result["receipt"] + require(receipt["status"] == "PASS" and receipt["real_scratch_final"] == 0, + "direct scratch/result status") + require(mode != "zero" or receipt["owned_gaussian_scratch_zero_erased"] is True, + "owned direct scratch zero erasure") + outputs.append({ + "mode": mode, + "output_q_sha256": digest(result["query"]), + "returned_coefficients_sha256": digest(result["coefficients"]), + "returned_coefficient_banks": 52, + "observed_primitives": receipt["observed_primitives"], + "real_scratch_final": 0, + "instruction_sha256": receipt["instruction_sha256"], + }) + return outputs + + +def fixture_parameters(kind): + parameters = [zeros() for _ in range(52)] + if kind in ("nonterminal", "mixed"): + parameters[44] = basis(15) + if kind == "terminal_difference": + parameters[2], parameters[9] = basis(0), basis(0, (-1, 0)) + elif kind == "mixed": + for slot, address, scalar in zip( + TERMINAL_SLOTS, (0, 1, 2, 4, 8), + ((1, 0), (-1, 0), (0, 1), (0, -1), (1, 1))): + parameters[slot] = basis(address, scalar) + else: + require(kind == "nonterminal", "known discriminating fixture") + return parameters + + +def nonterminal_witness(context, spec, initial_y): + row, following = spec["rows"][44:46] + require(typed_equal( + {key: row[key] for key in ("bank", "source", "event", "kind", "frame", "next_event")}, + {"bank": "D27", "source": "Y91", "event": 1817, "kind": "zero", + "frame": O_FRAME, "next_event": 1819}), "named nonterminal witness source") + require(following["source"] == "Y90" and following["event"] == 1819 + and typed_equal(following["frame"], O_FRAME), "paired cancellation source") + p = initial_y["Y91"] + require(initial_y["Y90"] == scaled(p, -1), "Y91/Y90 opposite sources") + require({name for name, values in initial_y.items() if any(z != (0, 0) for z in values)} + == {"Y91", "Y90"}, "nonterminal witness support") + decoded = context["model"].decode(p) + witness = next(((address, part, value) for address, z in enumerate(decoded) + for part, value in enumerate(z) if value % 4), None) + require(witness is not None, "p must lie outside 4B9") + physical = context["source"].apply_path( + p, row["source_path_to_read"], context["plans"], context["model"]) + d_path_value = context["source"].apply_path( + p, row["path_to_read"], context["plans"], context["model"]) + expected = [(-4, 0) if address & 15 == 15 else (0, 0) for address in range(SIZE)] + require(physical == d_path_value == expected, "actual framed nonterminal profile") + require(all(x % 4 == 0 for z in physical for x in z), "physical quarter exactness") + quarter = [(a // 4, b // 4) for a, b in physical] + support = [address for address, value in enumerate(quarter) if value != (0, 0)] + require(len(support) == 32 and all(quarter[address] == (-1, 0) for address in support), + "32 negative unit intermediate entries") + following_physical = context["source"].apply_path( + initial_y["Y90"], following["source_path_to_read"], + context["plans"], context["model"]) + require(plus(physical, following_physical) == zeros(), "next quarter cancellation") + return { + "source_events": [1817, 1819], + "coefficient_slot": 44, + "coefficient_basis_address": 15, + "prepared_nonzero_sources": ["Y91", "Y90"], + "actual_Y91_read_path": row["source_path_to_read"], + "actual_Y90_read_path": following["source_path_to_read"], + "actual_D27_read_path": row["path_to_read"], + "source_path_matches_D_path": True, + "outside_4B9_decoded_coefficient_witness": list(witness), + "actual_intermediate_quarter_sha256": digest(quarter), + "negative_unit_intermediate_entries": len(support), + "intermediate_then_cancelled": True, + } + + +def small_fixture(context, spec, direct_module, kind): + parameters = fixture_parameters(kind) + initial_y = encode(context, parameters) + readouts, strong, kernel = section_check(context, spec, parameters, initial_y) + increment = total(readouts) + coefficient_sum = total(parameters[slot] for slot in spec["terminals"]) + require(increment == subset_encode(coefficient_sum), "summed readout linearity") + result = { + "kind": kind, + "scope": "Pinned preparation/decoder, readout formula, and strict direct checks; " + "no 524-event caller replay.", + "parameters_sha256": digest(parameters), + "prepared_Y_sha256": digest(initial_y), + "strong_section_Y_sha256": digest(strong), + "section_kernel_remainder_sha256": digest(kernel), + "five_readouts_sha256": digest(readouts), + "final_increment_sha256": digest(increment), + "direct_modes": direct_checks( + parameters, subset_encode(basis(0)), spec, increment, direct_module), + } + if kind == "nonterminal": + require(readouts == [zeros() for _ in range(5)] and increment == zeros(), + "nonterminal observation must vanish") + result["witness"] = nonterminal_witness(context, spec, initial_y) + elif kind == "terminal_difference": + value = subset_encode(basis(0)) + require(readouts == [value, scaled(value, -1), zeros(), zeros(), zeros()] + and increment == zeros(), "terminal difference observation") + require(initial_y == strong, "terminal difference must already be in strong section") + result["five_readout_nonzero_banks"] = 2 + result["final_increment_zero"] = True + else: + require(kind == "mixed" and initial_y != strong, "mixed kernel must be retained") + require({name for name, values in strong.items() if any(z != (0, 0) for z in values)} + == set(TERMINAL_SOURCES), "exact five-active strong section") + explicit = [ + (1 - ((x >> 0) & 1) - ((x >> 1) & 1) + ((x >> 2) & 1), + -((x >> 0) & 1) + ((x >> 1) & 1) - ((x >> 2) & 1) + 2 * ((x >> 3) & 1)) + for x in range(SIZE)] + require(increment == explicit and any(z != (0, 0) for z in increment), + "mixed nonzero explicit readout") + require(parameters[44] == basis(15), "nonterminal output remains nonzero") + result["strong_nonzero_sources"] = TERMINAL_SOURCES[:] + result["bypassed_coefficient_slot_44_retained"] = True + result["first_16_increment_entries"] = increment[:16] + return result + + +def analyze(primary_result, direct_module): + """Bind a primary literal result, then check the quotient's small fixtures.""" + require(type(primary_result) is dict, "primary result object") + context = primary_result["context"] + spec = source_spec(context) + parameters = primary_result["parameters"] + parameters_check(parameters) + readouts, strong, kernel = section_check( + context, spec, parameters, primary_result["initial_y"]) + dirty = primary_result["initial_dirty"] + require(type(dirty) is dict and set(dirty) == set(D_BANKS) | {"Q7"}, + "six separately admitted dirty roles") + bank_check(dirty["Q7"]) + require(context["model"].member(dirty["Q7"]), "dirty query initial B9 admission") + cut = primary_result["cut"] + require(type(cut) is dict and set(cut) == set(D_BANKS) | {"Q7"}, "six supplied cut roles") + cut_images = readout_images(context, dirty, readouts) + require(all(typed_equal(cut[bank], values) for bank, values in cut_images.items()), + "supplied physical cut differs from five readout images") + expected_q = plus(dirty["Q7"], total(readouts)) + require(typed_equal(primary_result["output_q"], expected_q), + "supplied literal Q output differs from final observation") + strong_images = readout_images(context, dirty, rho5(strong, spec, context["model"])) + require(cut_images == strong_images, "general and strong physical cut readouts differ") + indices = quotient_and_rank(context, spec) + fixtures = [small_fixture(context, spec, direct_module, kind) for kind in + ("nonterminal", "terminal_difference", "mixed")] + return { + "status": "PASS_SOURCE_BOUND_OBSERVABILITY", + "scope": "Dense supplied literal endpoint binding plus three bounded " + "preparation/readout/direct fixtures; no caller replay in this module.", + "WORD_sha256": WORD_SHA256, + "source_groups": [ + {"bank": bank, "size": len(group), "terminal_slot": slot, + "terminal_source": spec["rows"][slot]["source"], + "terminal_event": spec["rows"][slot]["event"]} + for bank, group, slot in zip(D_BANKS, spec["groups"], spec["terminals"])], + "quotient_and_rank": indices, + "dense_primary_binding": { + "parameters_sha256": digest(parameters), + "actual_prepared_Y_sha256": digest(primary_result["initial_y"]), + "strong_section_Y_sha256": digest(strong), + "kernel_remainder_sha256": digest(kernel), + "five_readout_sha256": digest(readouts), + "five_physical_cut_readouts_sha256": digest(cut_images), + "actual_Q_output_sha256": digest(primary_result["output_q"]), + "general_and_strong_five_readouts_equal": True, + "original_52_parameter_decode_checked": True, + "strong_decode_has_zero_nonterminal_parameters": True, + "strong_section_is_not_permission_to_erase_original_coefficients": True, + }, + "fixtures": fixtures, + } diff --git a/research/p104-restored-query/primary.py b/research/p104-restored-query/primary.py new file mode 100644 index 0000000000..fd2a9d706e --- /dev/null +++ b/research/p104-restored-query/primary.py @@ -0,0 +1,280 @@ +"""Source-bound producer, first collector, and selective return composition. + +The inherited PR3467 encoder and PR3382 arithmetic are reused with attribution. +This new composition does not execute the omitted full-prefix recipients. +Clear1nsight, with substantial OpenAI assistance. Apache-2.0. +""" + +from collections import Counter +from fractions import Fraction + + +class CallerError(ValueError): + """A chronological, arithmetic, restoration or observation check failed.""" + + +def require(condition, message): + if not condition: + raise CallerError(message) + + +def setup(context): + word, native = context["word"], context["native"] + source, model = context["source"], context["model"] + structure = source.structure(word, native) + collector = list(range(2025, 2040)) + require([word["program"][e][0] for e in collector] == + ["zero"] + ["add"] * 5 + ["transport", "add", "transport"] + + ["add"] * 5 + ["erase"], "literal first collector shape") + compensation = [e for e, _ in structure["q_reads"]] + require(compensation == [908, 910, 912, 914, 916], "five dirty compensations") + require(structure["cut_paths"]["Q7"] == [972], "actual Q frame path") + slots = [i for i, row in enumerate(structure["gaps"]) + if row["kind"] == "terminal"] + require(slots == [2, 9, 16, 27, 51], "source-derived terminal slot indices") + plans = source.native_plans(word, native, structure["selected"] + collector, model) + return {**context, "structure": structure, "plans": plans, + "collector": collector, "compensation": compensation, + "terminal_slots": slots} + + +def steps(context, full_inverse=False, omit_return_frame=False): + selected = context["structure"]["selected"] + result = [(e, False, "producer") for e in selected] + result += [(e, False, "collector") for e in context["collector"]] + result += [(e, True, "return") for e in reversed(selected) + if (full_inverse or e not in context["compensation"]) + and not (omit_return_frame and e == 972)] + return result + + +def wrapper_inventory(plan, inverse): + permutation = [target for target, _ in plan] + require(sorted(permutation) == list(range(512)), "wrapper permutation") + visited = set() + cycles = 0 + for start in range(512): + if start in visited: + continue + cycles += 1 + current = start + while current not in visited: + visited.add(current) + current = permutation[current] + phases = Counter(str((-phase if inverse else phase) % 4) + for _, phase in plan) + return {"gaussian_swaps": 512 - cycles, "cycles": cycles, + "phase_histogram": {str(i): phases[str(i)] for i in range(4)}} + + +def inventory(context): + word = context["word"]["program"] + counts = Counter() + phases = Counter() + event_rows = [] + for event, inverse, leg in steps(context): + record = word[event] + counts["events"] += 1 + counts[record[0]] += 1 + event_rows.append([event, inverse, leg]) + if record[0] == "transport": + rank = record[4] + counts["rank_mass"] += rank + counts["native_pairs"] += rank * 256 + counts["native_inverse_pairs" if inverse else "native_forward_pairs"] += rank * 256 + for side in ("left", "right"): + item = wrapper_inventory(context["plans"][event][side], inverse) + counts["wrapper_occurrences"] += 1 + counts["wrapper_gaussian_swaps"] += item["gaussian_swaps"] + counts["wrapper_cycles"] += item["cycles"] + phases.update(item["phase_histogram"]) + if record[0] == "add": + value = Fraction(str(record[3])) + require(value.denominator in (1, 4), "caller scalar alphabet") + counts["quarter_adds" if value.denominator == 4 else "unit_adds"] += 1 + counts["real_add_sub_before_wrapper_and_phase_lowering"] = ( + 8 * counts["native_pairs"] + 1024 * counts["add"]) + counts["real_native_floor_halves"] = 4 * counts["native_pairs"] + counts["real_exact_quarter_halves"] = 2048 * counts["quarter_adds"] + counts["real_quarter_donor_restoration_doublings"] = 2048 * counts["quarter_adds"] + counts["native_gaussian_quarter_turns"] = counts["native_pairs"] + require((counts["events"], counts["transport"], counts["rank_mass"], + counts["native_pairs"], counts["add"], counts["quarter_adds"]) == + (524, 402, 722, 184832, 120, 104), "complete literal caller inventory") + return {"counts": dict(sorted(counts.items())), + "wrapper_phase_histogram": {str(i): phases[str(i)] for i in range(4)}, + "events": event_rows, + "scope": "Core only; both PR3467 codec directions are additional. " + "SWAP, phase, routing, ownership and recursive charges are separate."} + + +def apply_native(values, event, inverse, context, counters, phase_mutant=False): + model, source = context["model"], context["source"] + plan = context["plans"][event] + out = source.apply_wrapper(values, plan["left" if inverse else "right"], model, inverse) + bits = reversed(range(plan["rank"])) if inverse else range(plan["rank"]) + for bit in bits: + stride = 1 << bit + for address in range(512): + if address & stride: + continue + other = address | stride + a, b = out[address], out[other] + twice = model.ideal_pair_numerators(a, b, inverse=inverse) + require(all(x % 2 == 0 for value in twice for x in value), + "nonintegral ideal native pair at event " + str(event)) + ideal = tuple((a // 2, b // 2) for a, b in twice) + actual = model.lift_pair(a, b, inverse=inverse) + require(actual == ideal, "literal/ideal native mismatch") + out[address], out[other] = actual + counters["native_pairs"] += 1 + out = source.apply_wrapper(out, plan["right" if inverse else "left"], model, inverse) + if phase_mutant: + out = [(-a, -b) for a, b in out] + counters["native_occurrences"] += 1 + return out + + +def execute(context, initial, *, full_inverse=False, omit_return_frame=False, + collector_phase_mutant=False, return_sign_mutant=False): + source, model, word = context["source"], context["model"], context["word"]["program"] + require(set(initial) == set(context["structure"]["dependencies"]), "exact initial roles") + require(all(type(values) is list and len(values) == 512 for values in initial.values()), + "all initial banks must have exactly512 Gaussian entries") + require(all(type(value) in (tuple, list) and len(value) == 2 + and all(type(x) is int for x in value) + for values in initial.values() for value in values), + "exact Gaussian integer component types") + require(all(model.member(value) for value in initial.values()), "initial B9 admission") + state = {name: values[:] for name, values in initial.items()} + frames = {name: [] for name in initial} + counters = Counter() + cut = None + max_component = max(abs(x) for values in state.values() for value in values for x in value) + for event, inverse, leg in steps(context, full_inverse, omit_return_frame): + record = word[event] + opcode, bank = record[:2] + if event == 2025: + cut = {name: state[name][:] for name in source.TARGETS} + if opcode == "zero": + require(not inverse and bank not in state, "fresh private zero") + state[bank], frames[bank] = [(0, 0)] * 512, record[2][:] + elif opcode == "erase": + require(not inverse and frames[bank] == record[2], "private erase frame") + require(all(value == (0, 0) for value in state[bank]), "private C not zero at erase") + del state[bank], frames[bank] + counters["literal_zero_erases"] += 1 + elif opcode == "transport": + old, new = (record[3], record[2]) if inverse else (record[2], record[3]) + require(frames[bank] == old, "native chronological entrance frame") + state[bank] = apply_native(state[bank], event, inverse, context, counters, + collector_phase_mutant and event == 2031) + frames[bank] = new[:] + else: + require(opcode == "add", "caller opcode") + donor, raw, frame = record[2:] + require(frames[bank] == frames[donor] == frame, "common physical ADD frame") + factor = Fraction(str(raw)) * (-1 if inverse else 1) + if return_sign_mutant and leg == "return" and event == 1831: + factor = -factor + p, q = factor.numerator, factor.denominator + require(all(p * x % q == 0 for value in state[donor] for x in value), + "unavailable exact fractional ADD at event " + str(event)) + state[bank] = [(a + p * c // q, b + p * d // q) + for (a, b), (c, d) in zip(state[bank], state[donor])] + counters["weighted_adds"] += 1 + if bank in state: + max_component = max(max_component, *(abs(x) for value in state[bank] for x in value)) + counters["events"] += 1 + require(cut is not None, "producer cut was observed") + return {"state": state, "frames": frames, "cut": cut, + "counts": dict(counters), "max_component": max_component} + + +def endpoint(context, execution, initial, parameters): + source, model = context["source"], context["model"] + state = execution["state"] + require(set(state) == set(initial), "returned public roles and erased private role") + require(all(frame == [] for frame in execution["frames"].values()), "empty returned frames") + require(all(state[name] == initial[name] for name in source.YS + source.D_BANKS), + "source or dirty D restoration failed") + total = [(0, 0)] * 512 + for slot in context["terminal_slots"]: + total = [model.add(a, b) for a, b in zip(total, parameters[slot])] + expected = [model.add(a, b) for a, b in zip(initial["Q7"], model.encode(total))] + require(state["Q7"] == expected, "Q coefficient intertwiner failed") + recovered = context["admission"].decode_sources( + context["structure"], context["plans"], model, source, context["classifier"], + {name: state[name] for name in source.YS}) + require(recovered == parameters, "all52 coefficient banks must return") + return recovered + + +def negative_controls(context, initial, parameters, result): + """Named dense controls; their witnesses must have nonzero readouts.""" + source, model = context["source"], context["model"] + bad = execute(context, initial, full_inverse=True) + dirty_sum = [(0, 0)] * 512 + for name in source.D_BANKS: + dirty_sum = [model.add(a, b) for a, b in zip(dirty_sum, initial[name])] + difference = [model.sub(a, b) for a, b in zip(bad["state"]["Q7"], result["state"]["Q7"])] + require(difference == dirty_sum and any(x != (0, 0) for x in difference), + "full inversion must expose the nonzero exact dirty-sum error") + controls = {"full_inverse_dirty_error": {"difference_sha256": source.digest(difference), + "nonzero_coordinates": sum(v != (0, 0) for v in difference)}} + for name, kwargs in (("missing_Q_return_frame", {"omit_return_frame": True}), + ("wrong_collector_global_phase", {"collector_phase_mutant": True}), + ("wrong_return_quarter_sign", {"return_sign_mutant": True})): + try: + mutated = execute(context, initial, **kwargs) + endpoint(context, mutated, initial, parameters) + except CallerError as error: + controls[name] = {"rejected": True, "reason": str(error)} + else: + raise CallerError("semantic mutation was accepted: " + name) + return controls + + +def analyze(raw_context, parameters=None, initial_dirty=None, *, run_negative_controls=False): + """Execute valid inputs; enable witness-dependent controls only for the dense gate.""" + context = setup(raw_context) + source, model = context["source"], context["model"] + if parameters is None: + parameters = [source.coefficient_fixture(slot) for slot in range(52)] + if initial_dirty is None: + initial_dirty = {name: model.encode(source.coefficient_fixture(slot)) + for slot, name in enumerate(source.TARGETS, start=52)} + initial_y = context["admission"].encode_sources( + context["structure"], context["plans"], model, source, + context["classifier"], parameters) + initial = {**initial_y, **{name: value[:] for name, value in initial_dirty.items()}} + result = execute(context, initial) + coefficients = endpoint(context, result, initial, parameters) + require(result["cut"] == context["admission"].expected_cut( + initial, context["structure"], context["plans"], model, source), + "all six full-array cut equations") + controls = negative_controls(context, initial, parameters, result) if run_negative_controls else {} + return {"receipt": { + "status": "PASS_SOURCE_BOUND_RESTORED_QUERY", + "terminal_slots": context["terminal_slots"], + "terminal_sources": [context["structure"]["gaps"][i]["source"] + for i in context["terminal_slots"]], + "cut_frames": context["structure"]["cut_frames"], + "compensation_events_not_reversed": context["compensation"], + "counts": result["counts"], + "observed_core_bank_event_boundary_component_max": result["max_component"], + "initial_sha256": source.digest(initial), + "cut_sha256": source.digest(result["cut"]), + "output_q_sha256": source.digest(result["state"]["Q7"]), + "returned_coefficients_sha256": source.digest(coefficients), + "full_array_cut_equations_checked": 6, + "returned_coefficient_banks": 52, "returned_dirty_D_banks": 5, + "negative_controls_executed": run_negative_controls, + "controls": controls, "inventory": inventory(context)}, + "initial_y": initial_y, "initial_dirty": initial_dirty, + "returned_y": {name: result["state"][name] for name in source.YS}, + "cut": result["cut"], + "returned_coefficients": coefficients, + "returned_dirty": {name: result["state"][name] for name in source.D_BANKS}, + "output_q": result["state"]["Q7"], "parameters": parameters, + "context": context} diff --git a/research/p104-restored-query/sources.py b/research/p104-restored-query/sources.py new file mode 100644 index 0000000000..3d5d14f8f1 --- /dev/null +++ b/research/p104-restored-query/sources.py @@ -0,0 +1,128 @@ +"""Capture and authenticate the exact retained sources before executing them. + +Clear1nsight, with substantial OpenAI assistance. Apache-2.0. +Original mathematical and implementation credit is retained in SOURCES.json. +""" + +import gzip +import hashlib +import json +from pathlib import Path +from types import ModuleType + + +SIZE = 512 +PACKAGE = Path(__file__).resolve().parent +ROOT = PACKAGE.parents[1] +PINNED = { + "research/p104-rounded-collector/inputs/WORD.json": + "cec1fb3fbd0067b500ad5119a62ba60685be718e769374d7ec8abdd2beaa7e50", + "research/p104-rounded-collector/inputs/NATIVE.json.gz": + "ab91c78835c3e10cf3b2cb8a5d4e0b7cfc3df1ae5a811298d27842f2193e1e3d", + "inputs/pr3467/source.py": + "c54dabffe141de6befb6069e145c5ccbde629e76afb0f0afa3eb07bd72ab4b25", + "inputs/pr3467/classifier.py": + "3e42ba4e5fa1cc819f3e7b773b38ca47476bf85f581f888cc99690e1cf2f2b40", + "inputs/pr3467/admission.py": + "00bd8c666fa758e76e47fb3e8835dd71770d1ce32c55d71d8d003dca2da15709", + "inputs/pr3467/inputs/pr3382_model.py": + "74c83367887dd885137b222155c86389fe0be9f1293a6f0e5fdb51d71f435fdd", +} + + +class SourceError(ValueError): + """A source, receipt or finite reference contract failed.""" + + +def require(condition, message): + if not condition: + raise SourceError(message) + + +def canonical(value): + return json.dumps(value, sort_keys=True, separators=(",", ":")).encode() + + +def digest(value): + return hashlib.sha256(canonical(value)).hexdigest() + + +def strict_json(data): + def pairs(items): + result = {} + for key, value in items: + require(key not in result, "duplicate JSON key: " + key) + result[key] = value + return result + + def invalid(value): + raise SourceError("noninteger JSON numeric token: " + value) + + return json.loads(data, object_pairs_hook=pairs, + parse_float=invalid, parse_constant=invalid) + + +def typed_equal(actual, expected): + if type(actual) is not type(expected): + return False + if isinstance(actual, dict): + return actual.keys() == expected.keys() and all( + typed_equal(actual[key], expected[key]) for key in actual) + if isinstance(actual, list): + return len(actual) == len(expected) and all( + typed_equal(a, b) for a, b in zip(actual, expected)) + return actual == expected + + +def read_regular(path): + path = Path(path) + require(not any(part.is_symlink() for part in (path, *path.parents)), + "source path contains a symbolic link: " + str(path)) + require(path.is_file() and not path.is_symlink(), + "regular source missing: " + str(path)) + with path.open("rb") as stream: + data = stream.read(32 * 1024 * 1024 + 1) + require(len(data) <= 32 * 1024 * 1024, "source exceeds bounded size") + return data + + +def module_from_bytes(data, path, name): + result = ModuleType(name) + result.__file__ = str(path) + exec(compile(data, str(path), "exec"), result.__dict__) + return result + + +def check_pinned_bytes(data, expected, name): + require(hashlib.sha256(data).hexdigest() == expected, + "source digest mismatch: " + name) + + +def capture_inputs(root=ROOT, package=PACKAGE): + root, package = Path(root), Path(package) + captured = {} + paths = {} + for name, expected in PINNED.items(): + path = (root if name.startswith("research/") else package) / name + data = read_regular(path) + check_pinned_bytes(data, expected, name) + captured[name], paths[name] = data, path + modules = {} + for name, short in (("source.py", "source"), + ("classifier.py", "classifier"), + ("admission.py", "admission"), + ("inputs/pr3382_model.py", "model")): + key = "inputs/pr3467/" + name + modules[short] = module_from_bytes(captured[key], paths[key], + "p104_retained_" + short) + word = json.loads(captured["research/p104-rounded-collector/inputs/WORD.json"]) + native = json.loads(gzip.decompress( + captured["research/p104-rounded-collector/inputs/NATIVE.json.gz"])) + return {"word": word, "native": native, **modules, + "captured": captured, "paths": paths} + + +def recheck_inputs(context): + for name, data in context["captured"].items(): + require(read_regular(context["paths"][name]) == data, + "source changed during replay: " + name) diff --git a/research/p104-restored-query/verify.py b/research/p104-restored-query/verify.py new file mode 100644 index 0000000000..b1d615262e --- /dev/null +++ b/research/p104-restored-query/verify.py @@ -0,0 +1,241 @@ +#!/usr/bin/env python3 +"""Bounded, source-bound replay of the restored P104 coefficient caller. + +Clear1nsight, with substantial OpenAI assistance. Apache-2.0. +All package modules are compiled from captured source bytes, without local +bytecode imports. Inherited theorems and reused implementations are identified +in SOURCES.json; the second literal implementation imports none of that code. +""" + +import argparse +import hashlib +import json +from pathlib import Path +import sys +import tempfile +from types import ModuleType + + +PACKAGE = Path(__file__).resolve().parent +ROOT = PACKAGE.parents[1] +IMPLEMENTATIONS = ("verify.py", "sources.py", "primary.py", "independent.py", + "direct.py", "observability.py") + + +def bootstrap(): + captured = {} + for name in IMPLEMENTATIONS: + path = PACKAGE / name + if not path.is_file() or any(p.is_symlink() for p in (path, *path.parents)): + raise ValueError("regular implementation required: " + name) + captured[name] = path.read_bytes() + source = ModuleType("restored_query_sources") + source.__file__ = str(PACKAGE / "sources.py") + exec(compile(captured["sources.py"], source.__file__, "exec"), source.__dict__) + modules = {"sources": source} + for name in IMPLEMENTATIONS[2:]: + modules[name[:-3]] = source.module_from_bytes( + captured[name], PACKAGE / name, "restored_query_" + name[:-3]) + return modules, captured + + +def authenticate_manifest(source): + paths = {"SOURCES.json": PACKAGE / "SOURCES.json", + "VERIFY.json": PACKAGE / "VERIFY.json", + "PROOF.md": PACKAGE / "PROOF.md", "COSTS.md": PACKAGE / "COSTS.md"} + captured = {name: source.read_regular(path) for name, path in paths.items()} + manifest = source.strict_json(captured["SOURCES.json"]) + source.require(manifest["schema_version"] == 1, "source manifest schema") + live = [] + for row in manifest["files"]: + if row["usage"] != "input": + continue + name = row["path"] + path = ROOT / name + source.require(type(name) is str and Path(name).as_posix() == name + and not Path(name).is_absolute() and ".." not in Path(name).parts, + "canonical source input path") + source.require(name not in captured, "duplicate live input") + data = source.read_regular(path) + source.require(hashlib.sha256(data).hexdigest() == row["sha256"] + and len(data) == row["bytes"], "source manifest mismatch: " + name) + captured[name], paths[name] = data, path + live.append(name) + declared = source.strict_json(captured["VERIFY.json"])["inputs"] + source.require(set(live) <= set(declared), "every live pin must be declared") + prefix = PACKAGE.relative_to(ROOT).as_posix() + "/" + for name, expected in source.PINNED.items(): + relative = name if name.startswith("research/") else prefix + name + source.require(relative in live, "execution input missing from live pins: " + relative) + source.check_pinned_bytes(captured[relative], expected, relative) + for name in ("PR3467_PROOF.md", "PR3467_README.md", "PR3467_COSTS.md", + "PR3382_PROOF.md", "PR3416_PROOF.md", "PR3426_PROOF.md", "ORIGINS.json"): + source.require(prefix + "inputs/" + name in live, + "retained proof/credit missing from live pins: " + name) + return captured, paths + + +def compare_implementations(source, primary, independent): + checks = ("initial_y", "returned_y", "returned_coefficients", "returned_dirty", + "output_q", "cut") + for name in checks: + source.require(primary[name] == independent[name], + "independent full-array disagreement: " + name) + source.require(primary["receipt"]["terminal_slots"] == + independent["receipt"]["terminal_slots"], "independent terminal slots") + return {"full_array_equalities": list(checks), + "prepared_and_returned_Y_banks_per_check": 52, + "coefficient_banks": 52, "dirty_D_banks": 5, + "producer_cut_banks": 6, "Gaussian_entries_per_bank": 512, + "comparison_method": "Actual integer arrays, before taking receipt hashes."} + + +def expected_rejection(source, callback, message): + try: + callback() + except (ValueError, OSError, KeyError) as error: + return {"rejected": True, "reason": str(error)} + raise source.SourceError(message) + + +def admission_controls(source, primary_module, primary): + initial = {**primary["initial_y"], **primary["initial_dirty"]} + short = {name: value[:] for name, value in initial.items()} + short["Q7"] = short["Q7"][:256] + boolean = {name: value[:] for name, value in initial.items()} + boolean["Q7"][0] = (True, 0) + results = {} + for name, data in (("wrong_source_rank", short), ("boolean_source_component", boolean)): + results[name] = expected_rejection( + source, lambda data=data: primary_module.execute(primary["context"], data), + "invalid source entrance accepted") + return results + + +def format_controls(source): + results = {} + for name, data in (("duplicate_key", b'{"x":1,"x":2}'), + ("floating_number", b'{"x":1.0}'), + ("nonfinite_number", b'{"x":NaN}')): + results[name] = expected_rejection( + source, lambda data=data: source.strict_json(data), "malformed receipt accepted") + source.require(not source.typed_equal({"x": [1]}, {"x": [True]}), + "Boolean/integer receipt ambiguity") + results["boolean_integer_distinction"] = {"rejected": True} + with tempfile.TemporaryDirectory(prefix="p104-query-source-") as directory: + root = Path(directory) + results["missing_source"] = expected_rejection( + source, lambda: source.read_regular(root / "missing"), "missing source accepted") + (root / "actual").write_bytes(b"unchanged") + (root / "alias").symlink_to(root / "actual") + results["source_symlink"] = expected_rejection( + source, lambda: source.read_regular(root / "alias"), "source symlink accepted") + (root / "folder").mkdir() + (root / "folder" / "input").write_bytes(b"unchanged") + (root / "folder-alias").symlink_to(root / "folder", target_is_directory=True) + results["source_parent_symlink"] = expected_rejection( + source, lambda: source.read_regular(root / "folder-alias" / "input"), + "source parent symlink accepted") + changing = root / "changing" + changing.write_bytes(b"after") + result = expected_rejection( + source, lambda: source.recheck_inputs({"captured": {"fixture": b"before"}, + "paths": {"fixture": changing}}), "changed captured input accepted") + source.require(result["reason"] == "source changed during replay: fixture", + "change control failed for the wrong reason") + results["changed_captured_input"] = result + name = "research/p104-rounded-collector/inputs/WORD.json" + bad = source.read_regular(ROOT / name) + b" " + result = expected_rejection( + source, lambda: source.check_pinned_bytes(bad, source.PINNED[name], "WORD control"), + "wrong scientific bytes accepted") + source.require(result["reason"] == "source digest mismatch: WORD control", + "scientific hash control failed for the wrong reason") + results["wrong_scientific_bytes"] = result + # Temporary paths are nondeterministic and are not part of the scientific receipt. + for name in ("missing_source", "source_symlink", "source_parent_symlink"): + results[name] = {"rejected": results[name]["rejected"]} + return results + + +def calculate(modules, captured_implementations, captured_manifest): + source = modules["sources"] + context = source.capture_inputs() + first = modules["primary"].analyze(context, run_negative_controls=True) + second = modules["independent"].analyze( + context["word"], context["native"], first["parameters"], first["initial_dirty"], + run_negative_controls=True) + comparison = compare_implementations(source, first, second) + direct = {} + for mode in ("zero", "inplace"): + result = modules["direct"].run_direct( + first["parameters"], first["initial_dirty"]["Q7"], + first["receipt"]["terminal_slots"], mode) + source.require(result["query"] == first["output_q"], "direct query differs from caller") + source.require(result["coefficients"] == first["returned_coefficients"], + "direct coefficient return differs from caller") + direct[mode] = result["receipt"] + receipt = { + "schema_version": 1, "status": "PASS_P104_RESTORED_QUERY", + "scope": "Rank9 coefficient caller: codec,257-event cone,15-event collector," + "252-event selective return,inverse codec. No omitted original histories.", + "implementation_sha256": {name: hashlib.sha256(data).hexdigest() + for name, data in captured_implementations.items()}, + "authenticated_input_and_proof_sha256": { + name: hashlib.sha256(data).hexdigest() for name, data in captured_manifest.items()}, + "primary_literal": first["receipt"], "independent_literal": second["receipt"], + "independence": "The primary reuses authenticated predecessor code. The second derives " + "Y paths and native arithmetic separately, imports no predecessor executable, " + "and credits adapted arithmetic from PR3467; both inherit written theorems.", + "cross_implementation": comparison, "direct_schedules": direct, + "observable_quotient": modules["observability"].analyze(first, modules["direct"]), + "direct_arithmetic_and_ownership_controls": modules["direct"].verify_controls(), + "caller_entrance_controls": admission_controls(source, modules["primary"], first), + "source_and_typed_receipt_controls": format_controls(source), + "claims_excluded": ["Full2025-event prefix", "5398-event whole word", "675 external ports", + "physical caller or tape implementation", "new supplier or kappa", + "independent human review or formal proof-kernel verification"], + } + source.recheck_inputs(context) + return source.strict_json(source.canonical(receipt)) + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--write-receipt", action="store_true", + help="Explicitly write this package's generated receipt after all checks") + args = parser.parse_args() + modules, implementations = bootstrap() + source = modules["sources"] + manifest, paths = authenticate_manifest(source) + receipt_path = PACKAGE / "RECEIPT.json" + expected_bytes = None if args.write_receipt else source.read_regular(receipt_path) + expected = None if expected_bytes is None else source.strict_json(expected_bytes) + actual = calculate(modules, implementations, manifest) + for name, data in implementations.items(): + source.require(source.read_regular(PACKAGE / name) == data, + "implementation changed during replay: " + name) + for name, data in manifest.items(): + source.require(source.read_regular(paths[name]) == data, + "input or proof changed during replay: " + name) + if args.write_receipt: + source.require(not receipt_path.is_symlink(), "receipt destination must not be a symlink") + receipt_path.write_text(json.dumps(actual, indent=2, sort_keys=True) + "\n", encoding="utf-8") + else: + source.require(source.read_regular(receipt_path) == expected_bytes, + "receipt changed during replay") + source.require(source.typed_equal(actual, expected), "typed deterministic receipt mismatch") + print(json.dumps({"status": actual["status"], "caller_events": 524, + "native_pairs_per_literal_implementation": 184832, + "restored_coefficient_banks": 52, + "query_sha256": actual["primary_literal"]["output_q_sha256"], + "receipt_sha256": hashlib.sha256(receipt_path.read_bytes()).hexdigest()}, + sort_keys=True)) + + +if __name__ == "__main__": + try: + main() + except (ValueError, OSError, KeyError, TypeError) as error: + print("FAIL_P104_RESTORED_QUERY: " + str(error), file=sys.stderr) + sys.exit(1)