From 306370dfde0097a1a0b6e3b539c6437fbe46a679 Mon Sep 17 00:00:00 2001 From: Gareth Davidson Date: Tue, 13 Oct 2026 22:11:05 +0100 Subject: [PATCH 1/2] research: audit exact phases of selected PR1094 residual charts --- .../selected1094-chart-phase/EXPECTED.json | 234 +++++++++++++++ research/selected1094-chart-phase/NOTICE.md | 32 ++ .../selected1094-chart-phase/PRODUCTION.json | 22 ++ research/selected1094-chart-phase/PROOF.md | 198 +++++++++++++ research/selected1094-chart-phase/README.md | 129 +++++++++ .../selected1094-chart-phase/SOURCES.json | 66 +++++ research/selected1094-chart-phase/TASK.json | 71 +++++ .../selected1094-chart-phase/VALIDATION.md | 71 +++++ research/selected1094-chart-phase/VERIFY.json | 51 ++++ research/selected1094-chart-phase/algebra.py | 153 ++++++++++ .../production_check.py | 144 +++++++++ .../selected1094-chart-phase/test_package.py | 128 ++++++++ research/selected1094-chart-phase/verify.py | 273 ++++++++++++++++++ 13 files changed, 1572 insertions(+) create mode 100644 research/selected1094-chart-phase/EXPECTED.json create mode 100644 research/selected1094-chart-phase/NOTICE.md create mode 100644 research/selected1094-chart-phase/PRODUCTION.json create mode 100644 research/selected1094-chart-phase/PROOF.md create mode 100644 research/selected1094-chart-phase/README.md create mode 100644 research/selected1094-chart-phase/SOURCES.json create mode 100644 research/selected1094-chart-phase/TASK.json create mode 100644 research/selected1094-chart-phase/VALIDATION.md create mode 100644 research/selected1094-chart-phase/VERIFY.json create mode 100644 research/selected1094-chart-phase/algebra.py create mode 100644 research/selected1094-chart-phase/production_check.py create mode 100644 research/selected1094-chart-phase/test_package.py create mode 100644 research/selected1094-chart-phase/verify.py diff --git a/research/selected1094-chart-phase/EXPECTED.json b/research/selected1094-chart-phase/EXPECTED.json new file mode 100644 index 0000000000..e0a928d2bb --- /dev/null +++ b/research/selected1094-chart-phase/EXPECTED.json @@ -0,0 +1,234 @@ +{ + "orthogonal_census": [ + { + "coefficient_checks": 4, + "defect_histogram": { + "0": 1 + }, + "dimension": 1, + "first_failure": null, + "matrices": 1, + "permutations": 1, + "preserving": 1, + "stream_sha256": "0fc87cae0d9937fe7b2b906e6072dda4e2845278359361c678afc6996528bbb5" + }, + { + "coefficient_checks": 16, + "defect_histogram": { + "0": 2 + }, + "dimension": 2, + "first_failure": null, + "matrices": 2, + "permutations": 2, + "preserving": 2, + "stream_sha256": "ebdee6aed08f56837b285d52175721d05b8dabee30faa2f74350c79e2d74689b" + }, + { + "coefficient_checks": 96, + "defect_histogram": { + "0": 6 + }, + "dimension": 3, + "first_failure": null, + "matrices": 6, + "permutations": 6, + "preserving": 6, + "stream_sha256": "c4668619e98f83b491c784fb5bdccd04edbbb063d7cc60658a5601f4c83123da" + }, + { + "coefficient_checks": 1536, + "defect_histogram": { + "0": 24, + "15": 24 + }, + "dimension": 4, + "first_failure": { + "columns": [ + 7, + 11, + 13, + 14 + ], + "defect": 15 + }, + "matrices": 48, + "permutations": 24, + "preserving": 24, + "stream_sha256": "576fbb722337c9e36c53a4971e7fa313aa9b321a92b8041183e0e3474b19ebc5" + }, + { + "coefficient_checks": 46080, + "defect_histogram": { + "0": 120, + "15": 120, + "23": 120, + "27": 120, + "29": 120, + "30": 120 + }, + "dimension": 5, + "first_failure": { + "columns": [ + 1, + 14, + 22, + 26, + 28 + ], + "defect": 30 + }, + "matrices": 720, + "permutations": 120, + "preserving": 120, + "stream_sha256": "8813f68ce04ead3fa18e9b8899d30563cddec2d0f9dd7ab69ec082c96601c254" + }, + { + "coefficient_checks": 2949120, + "defect_histogram": { + "0": 1440, + "15": 1440, + "23": 1440, + "27": 1440, + "29": 1440, + "30": 1440, + "39": 1440, + "43": 1440, + "45": 1440, + "46": 1440, + "51": 1440, + "53": 1440, + "54": 1440, + "57": 1440, + "58": 1440, + "60": 1440 + }, + "dimension": 6, + "first_failure": { + "columns": [ + 1, + 2, + 28, + 44, + 52, + 56 + ], + "defect": 60 + }, + "matrices": 23040, + "permutations": 720, + "preserving": 1440, + "stream_sha256": "cdea048e49cb27a6824ff449c91d4c5c9e903d0ce918aab91e2d7a02d16f3efb" + } + ], + "scope": "Exact source-bound residual chart and phase audit, conditional on normalized local endpoints; no current production defect, new supplier, runtime or kappa claim.", + "selected": { + "active_chart_signatures": 10008, + "calls": 144, + "chart_gram_entries": 53300658, + "chart_stream_sha256": "e9d95a4a108476a0971d19c8815e1cb747e3b28214b44c92500fdd9647f9bf6d", + "controls": [ + "same-projector orthogonal phase mutant", + "repeated spectator axis", + "active/spectator swap", + "missing chart column", + "out-of-range axis", + "dependent kernel" + ], + "full_charts": 10002, + "kernel_coefficients_both_signs": 5348224, + "kernel_stream_sha256": "dfd51b03011b9d0a95f0ea656cfa2a4523eac6c7bf6fff495622b7f74a0fe378", + "positive_controls": [ + "axis permutation", + "six-axis nonpermutation Z4-preserving rebase" + ], + "roles": 69120, + "roles_by_width": { + "4": 8064, + "5": 4608, + "7": 4320, + "8": 17568, + "9": 34560 + }, + "same_projector_mutated_signatures": 10008, + "width_inventory": { + "4": 56, + "5": 32, + "7": 30, + "8": 122, + "9": 240 + }, + "witness": { + "affected_displacements": 8, + "chart": "59704a868960355a1814d0dd719e17d62ce315fe5a177b665dd0bc09706116d1", + "displacement": 477, + "expected_amplitude": [ + "0", + "1/4" + ], + "mutated_active": [ + 458, + 460, + 457, + 472 + ], + "mutated_amplitude": [ + "0", + "-1/4" + ], + "original_active": [ + 477, + 475, + 478, + 463 + ], + "role": { + "child": 10, + "copy": 547, + "family": 4467, + "helper": 49, + "offset": 0, + "owner_replica": 4, + "port": 99, + "replica": 0, + "stage": 0, + "time": 0, + "width": 4 + }, + "same_projector": true, + "same_spectators": true, + "spectator_fiber_inputs": [ + 0, + 471 + ], + "total_displacements": 16, + "zero_displacement_amplitude": [ + "-1/4", + "0" + ] + } + }, + "sources": { + "archive_members": { + "candidate/strict/REPLAY.json": "ce0678fa7abaab221de74baeace0c6696d5ea23a36719a58cff230215a06aae7", + "candidate/strict/global/base/providers/gauge44/CANONICAL-WORD.json.gz": "16bc0ebb04b4be6c0ade74badc6a0c0cdba4215eda86e4ff9f13abf8ecebd219", + "candidate/strict/global/base/providers/gauge44/LOCAL-CHECKS.json": "2b8b1891a736598010232bfb26abc31973b265a53a2009a3fcfd9138b5ecadb4", + "candidate/strict/global/base/split-centres/GLOBAL-TEMPLATE.json.gz": "a179dad87651aba340a5a8ddbcd86a8e757cad87b8a1f8bad48106fbecd38518", + "candidate/strict/global/base/work/complex-nine-native/DATA-PHASES.json": "c5916ff312678f12aba403847643fbbc29f643acec60bdf836fa56cd3e8251fa", + "candidate/strict/global/hosted/ACTUAL-SIGMAS.json.gz": "f12383eb2691fe33cc9f0525ccb5f6429db6d7bbf0eec76e97f50e752f943dd9", + "candidate/strict/global/hosted/GLOBAL-TEMPLATE.json.gz": "2acf02b418078e37090495c601fe550448751d4f35912757b13a1f778efc7760", + "candidate/strict/global/hosted/HOSTED.json": "1ea853d02e3d3377f03761909bf1825bde48431e9e2258303c57c78be12a4b95" + }, + "files": { + "research/community-frontier1094-audit/REPLAY.json": "ce0678fa7abaab221de74baeace0c6696d5ea23a36719a58cff230215a06aae7", + "research/community-frontier1094-audit/selected-replay.tar.gz": "f1da80610bf33c58527f18ad63b4350d0b864e1d4486141ee17ac9bed4d529d6", + "research/complex-k492-owner-repair/vendor/multicold/vendor/pr558/vendor/pr552/complex-global/vendor531/vendor/clifford/clifford_exact.py": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962", + "research/complex-t16-rare-pattern-exchanges/SOURCE.json": "4cfd44cebfe88f4450294239fbea8feecb564338dc3027b76065227f5d19cb6f", + "research/complex-t16-rare-pattern-exchanges/data/OWNERS.json.gz": "87902c528dfab7d503dcf8a784260e3ab6fb7424c418a1820f7261f25be7b6bc", + "research/gauge44-slots-t16/code/audit_allcold.py": "1467a2acb654e62552c69fb9a7c4c85f70a02120881d222313865058ab71a6cc", + "research/gauge44-slots-t16/code/emit_allcold.py": "354367e1fd6185a67b04f4268bcae4d502e47b18cb2131e247f5bcab5b3a769e", + "research/hyperplane-end-lean/PROOF.md": "1cbce5cf0ff0152f71e8ae7bef25841d1ce13010af248ff7209182d2328c21c9" + } + }, + "status": "PASS_SELECTED1094_CHART_PHASE" +} diff --git a/research/selected1094-chart-phase/NOTICE.md b/research/selected1094-chart-phase/NOTICE.md new file mode 100644 index 0000000000..e4653d5ae8 --- /dev/null +++ b/research/selected1094-chart-phase/NOTICE.md @@ -0,0 +1,32 @@ +# Attribution and scope + +Gareth Davidson (@bitplane), with substantial OpenAI Codex assistance. +Apache-2.0. No subagent or independent human review is implied. + +Credit Rohan Arun's selected PR1094 and PR1087's Jeremy Kothe packing lineage, +Hao Yan's controller and T16 chart/owner interface, Josie Elliston's independent +owner audit, and Douglas Colkitt's maintainer composition. The local Clifford, +normalization and spectator contracts retain the PR425/433/471/593/599 and +subsequent supplier lineage and all source notices. This package reads the +original repository inputs in place; it does not modify or relicense them. + +Parallel evidence considered at entry: + +- PR1209 (@akiva8201-dotcom), `d1ba263139ceb6eb811628b7560a3f87f3c9652e`: + selected pending-axis independence and chronological cuts. +- PR1149 (@woklerx), `f66dd4019d67a9660921bc204532306b47f4196e`: + canonical-frame rank identity and its phase limitation. +- PR702 (BigCactusLabs), `27db45ac6befa99d6c06be920a93845023e81937`: + exact amplitudes for all fourteen historical cold wrappers. +- PR712 (Joshua Snider), `4773b879a1087540f5919c726ec8c670dadfa0c5`: + symbolic quadratic-phase check of one historical cold wrapper. + +The new mathematical verifier imports none of those implementations or the +supplier/controller/Clifford executor. Its separate production companion +executes explicitly identified, unchanged ASTs from pinned source code to test +existing protection; this is declared separately from independent evidence. + +The quadratic-refinement fact and Fourier/Clifford algebra are classical. +No algebraic priority is claimed. The source-bound application, counterexample, +finite census and executable comparison are the contribution. No selected +frontier change, κ improvement or full multiplication theorem is supplied. diff --git a/research/selected1094-chart-phase/PRODUCTION.json b/research/selected1094-chart-phase/PRODUCTION.json new file mode 100644 index 0000000000..4596d4d8f8 --- /dev/null +++ b/research/selected1094-chart-phase/PRODUCTION.json @@ -0,0 +1,22 @@ +{ + "controls": [ + "same-projector rebase with recomputed chart content hash", + "wrong literal spectator route" + ], + "extracted_source_sha256": "68a8fac85447742dce26f6e0b08ba8d98b429972fc8b4bc9f3fdb743e3bd2dcb", + "kernel_method_source_sha256": "afc72a5c142cc42fce97ceb5bf280ee3b68723317f3b899f1f9ad939babd1102", + "kernel_source": "research/complex-k492-owner-repair/vendor/multicold/vendor/pr558/vendor/pr552/complex-global/vendor531/vendor/clifford/clifford_exact.py", + "kernel_source_sha256": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962", + "positive_chart_stream_sha256": "e9d95a4a108476a0971d19c8815e1cb747e3b28214b44c92500fdd9647f9bf6d", + "positive_charts": 10002, + "positive_roles": 69120, + "scope": "Verbatim orthobasis/audit functions and chart-table assertion with explicit pinned-archive context; not the top-level script, native supplier, phase wrappers, invoice or cold driver.", + "selected_functions": [ + "orthobasis", + "audit" + ], + "source": "research/gauge44-slots-t16/code/audit_allcold.py", + "source_kernel_columns": 512, + "source_sha256": "1467a2acb654e62552c69fb9a7c4c85f70a02120881d222313865058ab71a6cc", + "status": "PASS_PINNED_CONTROLLER_CHART_PROTECTION" +} diff --git a/research/selected1094-chart-phase/PROOF.md b/research/selected1094-chart-phase/PROOF.md new file mode 100644 index 0000000000..6ba3890c6c --- /dev/null +++ b/research/selected1094-chart-phase/PROOF.md @@ -0,0 +1,198 @@ +# An active subspace does not fix its exact complex residual + +Gareth Davidson, with substantial OpenAI Codex assistance. Apache-2.0. +The quadratic-refinement principle is classical; the contribution is its +explicit application, counterexample and source binding at this supplier boundary. + +## 1. The inherited operation and the audited implication + +The pinned `clifford_exact.py` defines, for a binary displacement `q`, + +\[ +C_q^{(s)}=\frac{1+s i}{2}I+\frac{1-s i}{2}X_q, +\qquad (X_q f)(x)=f(x+q),\quad s\in\{1,-1\}. +\] + +Its `fourier(n, axes)` is the product of these commuting `C` gates on the +named coordinate axes. This is **not the ordinary real Walsh–Hadamard gate**; +the source constructs the latter using additional diagonal gates. The exact +Gaussian phases matter here. The positive sign is the normalized residual in +the inherited wrapper contract. The negative sign is its operator inverse; it +is not an assertion that the complete scalar-backward supplier has a different +helper endpoint. The source uses the same normalization wrappers in both scalar +orientations. + +The local normalization hypothesis is inherited: the fully wrapped helper acts +as `C_[w] tensor I` on its nine coordinates. This audit concerns the subsequent +physical coordinate chart. It does not re-prove the scalar word or its wrappers. +The coordinate-operator calculation below holds on complex functions on +`F2^m`; its use in the whole physical cover/compiler retains the source's +realization hypotheses. + +The false weakened implication is: + +> Two orthogonal charts with the same active subspace/projector implement the +> same normalized complex residual. + +The selected production contract is stronger: it binds the literal ordered +pending axes, routes and emitted chart table. It passes this audit. + +## 2. Exact kernel and spectator lifting + +Let `U` be an `m`-by-`w` binary matrix with `U^t U = I`, with columns `u_j`. +Write `C_U^(s)` for the product of `C_(u_j)^(s)`. Its convolution coefficient at +displacement `U z`, for `z in F2^w`, is + +\[ +K_U^{(s)}(Uz)=\left(\frac{1+s i}{2}\right)^w + (-s i)^{\operatorname{wt}(z)}. \tag{1} +\] + +All these coefficients are nonzero, and other displacements have coefficient +zero. Expand the product, selecting the `X` term exactly where `z_j=1`. +Independence of the columns gives a unique subset for each displacement, and +`(1-si)/(1+si)=-si`, proving (1). + +For a complete orthogonal chart `Q`, the address permutation `P_Q e_x=e_(Qx)` +satisfies `P_Q X_ej P_Q^-1=X_(Qej)`. Consequently, + +\[ +P_Q(C_{[w]}^{(s)}\otimes I)P_Q^{-1}=C_{Q[:,0:w]}^{(s)}. \tag{2} +\] + +The remaining chart coordinates are unchanged. This holds for every spectator +fiber and arbitrary complex payload by linearity. Neither (1) nor (2) needs a +clean spectator. Translation invariance means a complete kernel fixes every +input column; there is no zero-input-column blind spot **within this convolution +class**. No `2^73`-column numerical replay is claimed. + +## 3. Necessary and sufficient phase refinement + +Let `S in O(w,2)` and `V=U S`. The two active projectors agree: +`VV^t=U SS^t U^t=UU^t`. Define the binary vector + +\[ +d_j=\frac{\operatorname{wt}(S^t e_j)-1}{2}\pmod2. \tag{3} +\] + +The numerator is even because every row of an orthogonal matrix has odd weight. +For every `z`, + +\[ +\operatorname{wt}(S^t z)-\operatorname{wt}(z)=2d\cdot z\pmod4. \tag{4} +\] + +To prove this, put `q(z)=wt(z) mod4`. Its polarization is +`q(x+y)-q(x)-q(y)=-2(x dot y) mod4`. Orthogonality preserves this polarization +and preserves `q mod2`. Thus `(q(S^t z)-q(z))/2 mod2` is additive and takes the +values (3) on the coordinate basis. This proves (4) for every dimension. + +Since `V(S^t z)=Uz`, equations (1) and (4) give + +\[ +K_V^{(s)}(Uz)=(-1)^{d\cdot z}K_U^{(s)}(Uz). \tag{5} +\] + +Therefore `C_V^(s)=C_U^(s)` **if and only if every row of `S` has weight `1 mod4`**. +Necessity uses the nonzero coefficient at `Ue_j` whenever `d_j=1`. +The same criterion holds for both signs. Equivalently, `S^t` must preserve the +`Z/4` weight refinement, not only its binary bilinear form. + +More explicitly, with `D_d f(x)=(-1)^(d dot U^t x) f(x)`, + +\[ +C_V^{(s)}=D_d C_U^{(s)}D_d. \tag{6} +\] + +This follows by multiplying each convolution coefficient at `Uz` by the two +endpoint characters. It suggests a possible pair of diagonal repairs, but +this package implements no physical repair and claims no free adapters or +cost improvement. Also, a nonzero defect is not removable by a global scalar: +the nonzero zero-displacement coefficient is unchanged, forcing that scalar +to be one, while a coefficient with `d dot z=1` changes sign. + +## 4. Smallest bad rebase and a nonpermutation positive case + +In dimension four use `S=I+J`, where `J` is the all-ones matrix. Its columns +are `(14,13,11,7)` in bit-mask notation. It is orthogonal, but each row has +weight three, so `d=15`. It preserves the full active projector and, when +embedded as `diag(S,I_(m-4))`, every spectator column. All support and amplitude +magnitudes are unchanged. Exactly eight of sixteen displacement coefficients +change sign: the coefficient at zero stays `-1/4`, whereas that at the first +original active axis changes from `i/4` to `-i/4`. + +Even squaring the operators misses this distinction. Directly `C_q^2=X_q`; +both products square to the same translation, since an orthogonal matrix fixes +the all-ones characteristic vector of the binary dot product. + +Dimension six supplies a useful positive control. `I+J` is orthogonal with +row weights five, so it preserves `C` exactly although it is not a permutation. +The criterion does not simply ban all changes of basis. + +The complete finite enumeration selects every possible ordered unit-norm, +pairwise-orthogonal column sequence. Pruning a prefix only removes vectors +that cannot be its next orthogonal column. A complete sequence is a basis, +because taking its inner product with any column proves linear independence. +This gives an exhaustive enumeration without a heuristic or random search: + +| Dimension | Orthogonal matrices | Exact `C` preservers | Permutations | +|---|---:|---:|---:| +| 1 | 1 | 1 | 1 | +| 2 | 2 | 2 | 2 | +| 3 | 6 | 6 | 6 | +| 4 | 48 | 24 | 24 | +| 5 | 720 | 120 | 120 | +| 6 | 23,040 | 1,440 | 720 | + +Literal Gaussian-integer convolution checks (5) for every displacement and +both signs of all 23,817 matrices: 2,996,852 coefficient comparisons. A separate +unpruned tuple enumeration corroborates the complete matrix sets through +dimension four. Thus four is the first failing dimension, and six the first +dimension with a nonpermutation exact preserver, within these completely +enumerated smaller dimensions. The universal criterion itself is proved above. + +## 5. Binding to the selected PR1094 replay + +The inputs are the current selected replay archive, not the older +`gauge44-slots-t16/evidence/` directories. The complete archive, eight consumed +members, literal owners and reference code are pinned. The hosted decoded +template hash, phase/canonical-word/check hashes and selected REPLAY object +are cross-bound before the mathematical check. + +The check covers all 69,120 roles in 144 calls. It binds their actual emitted +routes to the pending ordered slice and spectator coordinates, and reconstructs +the complete chart stream digest. All 10,002 emitted 73-column charts pass all +53,300,658 Gram entries. There are 10,008 `(chart,width)` signatures: the same +complete chart can be used at different active widths, so width is part of +the cache key. For each signature, literal physical convolution, a separate +closed subset formula and chart-transported coordinate convolution agree on +every coefficient in both directions: 5,348,224 comparisons. + +Every active width is at least four. The embedded bad rebase has a nonzero +phase witness on each of the 10,008 signatures. The retained concrete example +is stage 0, invocation replica 0, helper 49, physical family 4467, owner replica +4, port 99, child 10, offset 0, width 4. Its original active axes are +`[477,475,478,463]`; the rebased axes are `[458,460,457,472]`. At displacement +477 the coefficient changes from `i/4` to `-i/4`. The example also applies to +the spectator fiber starting at 471. These are binary address masks, not data +values. The complete dirty data can be arbitrary. + +`production_check.py` separately executes the **unchanged ASTs** of the pinned +controller's `orthobasis` and `audit` functions and its emitted-chart equality +assertion. The surrounding namespace is explicitly reconstructed from pinned +archive inputs; other top-level obligations are not re-executed. Compilation +uses `optimize=0`, preserving the predecessor's assertions even under `-O`. +The original table passes. A same-projector mutant with a correctly recomputed +chart hash fails the source equality guard, and a wrong spectator route fails +the source route predicate. This is evidence for an existing protection, not +a defect report or a full production-driver replay. +The same companion check also executes the verbatim source `Op.zero_state` +method on only `C` gates: all 64 columns of four six-coordinate circuits, in +both directions (512 columns), agree with the new Gaussian-integer kernels. +This binds the formula to the actual gate semantics without importing the +source compiler or claiming coverage of its other gate types. + +Local scalar/native/phase-wrapper replay, chronology beyond that extracted +predicate, cost/precision/tape invoices, compiler/physical realization and +analytic transfer remain inherited. The theorem and finite checks do not +promote a new supplier or change the selected multiplication exponent. diff --git a/research/selected1094-chart-phase/README.md b/research/selected1094-chart-phase/README.md new file mode 100644 index 0000000000..677792d1e5 --- /dev/null +++ b/research/selected1094-chart-phase/README.md @@ -0,0 +1,129 @@ +# Selected PR1094 charts: geometry and exact phase + +**Adversarial supplier-boundary audit; no new κ and no selected production defect.** +An orthogonal change of the active axes can preserve their full projector, +all spectator coordinates, support and amplitude magnitudes while changing the +exact normalized complex residual. The missing condition is preservation of +coordinate weight modulo four. The selected controller binds the actual axes +and rejects the demonstrated mutation. + +For an orthonormal active basis `U` and a rebase `V=US`, with `S` orthogonal over +F2, the inherited complex residuals agree exactly **if and only if every row of +S has weight 1 modulo 4**. Otherwise their convolution kernels differ by an +explicit binary character. [PROOF.md](PROOF.md) derives the criterion for every +dimension from the actual `C_q=((1+i)I+(1-i)X_q)/2` operation. This is a classical +phase-refinement argument applied to this interface, not a new algebraic +priority claim. These `C` gates are not ordinary real Hadamard gates. + +The smallest bad rebase is `I+J` on four axes: its rows have weight three. It +changes the coefficient at the first original active axis from `i/4` to `-i/4`, +while the zero-displacement coefficient remains `-1/4`. Thus the discrepancy is +not a global phase. A six-axis `I+J` rebase, whose rows have weight five, is a +nonpermutation positive example that preserves the exact residual. + +## Selected source-bound evidence + +The audit reads the **actual selected PR1094 replay archive**, pinned at main +`49b3157d1d89adcef16df8be98445451672be5ba`, and all 69,120 literal helper owners. +It does not mistake the retained historical `evidence/` directories for a +current replay. Exact Git/SHA-256 input pins are in [SOURCES.json](SOURCES.json). +Submission is based on `dadfea6e8a78ff6ba901705f87532a71c6f5bbb8`; every experimental input remains unchanged. + +| Completed check | Coverage | +|---|---:| +| Complete calls / helper roles | 144 / 69,120 | +| Emitted 73-axis charts / all Gram entries | 10,002 / 53,300,658 | +| Distinct `(chart,width)` signatures | 10,008 | +| Exact kernel coefficients, both signs | 5,348,224 | +| Embedded same-projector phase witnesses | All 10,008 signatures | +| All orthogonal matrices, dimensions 1–6 | 23,817 | +| Small-census exact coefficient comparisons | 2,996,852 | + +Every original chart passes. The complete role/route/chart stream agrees with +the archived digest. Each kernel is checked by literal physical convolution, +a separate subset formula and coordinate transport through the actual chart. +Translation invariance and the written argument extend a kernel to arbitrary +complex inputs and every spectator fiber; `2^73` input columns were not enumerated. +The operator inverse is checked as well, without identifying it with the +scalar-backward supplier's helper endpoint. + +The concrete selected example is **stage 0, replica 0, helper 49**, physical +family 4467, owner replica 4, port 99, child 10, offset 0, width 4. Its active +axes `[477,475,478,463]` become `[458,460,457,472]`. The full 73-dimensional Gram +matrix, active projector and every spectator column stay unchanged; the +coefficient at displacement 477 changes from `i/4` to `-i/4`. + +[production_check.py](production_check.py) separately exercises the unchanged +source `orthobasis`/`audit` function ASTs and emitted-chart equality assertion, +with an explicit namespace built from the pinned archive. The original input +passes; the same-projector mutant with a correct new content hash and a wrong +spectator route reject. This is an isolated source-predicate replay, **not the +complete top-level admission driver**. The verbatim source `Op.zero_state` +method also agrees with the new kernels on 512 six-coordinate input columns +using only C gates. It does not test other source gate types. + +## Reproduce + +From the repository root, standard-library Python 3.10+: + +```sh +python3 -I -O -B research/selected1094-chart-phase/verify.py +python3 -I -O -B research/selected1094-chart-phase/production_check.py +python3 -I -O -B research/selected1094-chart-phase/test_package.py +python3.12 scripts/research_package.py --package research/selected1094-chart-phase +``` + +The mathematical marker is `PASS_SELECTED1094_CHART_PHASE`, with +`roles=69120 charts=10002 no_new_kappa`. Complete deterministic receipts are +[EXPECTED.json](EXPECTED.json) and [PRODUCTION.json](PRODUCTION.json). +The verifier compares decoded complete JSON, not compression bytes of a +regenerated output. All original input containers retain strict immutable pins. +`--receipt /absolute/new/file.json` saves a new receipt; `--source-root` supports +an input-only relocation. Existing outputs are refused. + +Eight package tests cover all columns and spectator fibers of a small exact +operator, inverse/square identities, an independent unpruned low-dimensional +census, positive nonpermutation rebasing, and actual optimized subprocess +failures for source/container/receipt corruption and occupied outputs. Six +mathematical controls and two source-predicate controls delimit the checks. +See [VALIDATION.md](VALIDATION.md) for exact environments and results. + +## Scope, overlap and credit + +Task `supplier-boundary-audit`, **refined** to the selected normalized residual +chart's ordered-axis/phase obligation. Chooser seed +`08486e2f4cb05dd9e1b849fa4eff7033`, priority revision 2. +[Discussion 1237](https://github.com/CrocSwap/integer-mult-bounds/discussions/1237) +records the scoped claim; [TASK.json](TASK.json) gives the stopping rule. + +Selected PR1094 source: `0fc329d0bec93ca7cd288eaea1295172e8789810`, inheriting +PR1087 `589d1cedf5ef5f231182f4ec86408616311a8af0`. Credit Rohan Arun, Jeremy Kothe, +Hao Yan and the retained Clifford, normalization, ownership and supplier lineage. +PR1209 independently checks pending-axis independence and chronological cuts, +explicitly excluding spectator charts. PR1149 checks canonical-frame recursive +ranks. PR702/712 check historical local wrapper phases. This adds the physical +active-basis phase criterion and current emitted-chart binding; those different +checks are not replaced. See [NOTICE.md](NOTICE.md) for exact parallel heads. + +The local normalized endpoint is inherited. Full scalar/native/phase-wrapper +replay, invoice and precision/tape checks, all-size compiler, physical cover +realization and analytic transfer remain outside scope. The source predicate +replay adds no new proof of its inherited premises. Neither a faster algorithm +nor an improved paid supplier profile or κ follows from this audit. + +Prepared by **Gareth Davidson (@bitplane)** with substantial **OpenAI Codex +assistance**. No subagents or independent human review. Apache-2.0. + +## Open next questions + +1. Could a phase-preserving rebase reduce actual chart-adapter work? This matters + only if the complete physical invoice improves. First test a six-axis + weight-five rebase on one pinned width-seven role, preserving the full + wrapped endpoint and accounting for every route and adapter. Current literal + route admission would need a separately justified extension; no savings are + established here. +2. Can the universal phase criterion be formalized alongside the existing exact + C-gate semantics? Start with the Z/4 weight polarization identity, then prove + convolution conjugation for an arbitrary orthogonal basis. This would certify + the implication rather than only the finite census; the physical compiler + and archive-to-theorem binding would still be separate obligations. diff --git a/research/selected1094-chart-phase/SOURCES.json b/research/selected1094-chart-phase/SOURCES.json new file mode 100644 index 0000000000..e386cf7f73 --- /dev/null +++ b/research/selected1094-chart-phase/SOURCES.json @@ -0,0 +1,66 @@ +{ + "schema_version": 1, + "base_commit": "49b3157d1d89adcef16df8be98445451672be5ba", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "ae6a99f28aa468649eb66a361e764d769363bf11", + "sha256": "10b9e340fd8e354a37a0c4813c90e5de1dd42044b5f6aca4a3fc5a42b685fa32" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "c05fafaa25ba95b2d5af86b1800427198e3d20eb", + "sha256": "89b5928bc92c81e2647b6d702a7ad85a6795b8f44e2eb267b2ff3145d8f2b2ce" + }, + { + "path": "research/community-frontier1094-audit/REPLAY.json", + "usage": "input", + "git_blob": "2cfb7fffa7cd78f418be16c13224c3206b6d0183", + "sha256": "ce0678fa7abaab221de74baeace0c6696d5ea23a36719a58cff230215a06aae7" + }, + { + "path": "research/community-frontier1094-audit/selected-replay.tar.gz", + "usage": "input", + "git_blob": "c24daf067f9c543421d89ca2eeaa4eb78a57fb6f", + "sha256": "f1da80610bf33c58527f18ad63b4350d0b864e1d4486141ee17ac9bed4d529d6" + }, + { + "path": "research/complex-k492-owner-repair/vendor/multicold/vendor/pr558/vendor/pr552/complex-global/vendor531/vendor/clifford/clifford_exact.py", + "usage": "input", + "git_blob": "166841a037f069249f6f7f6dedb89248812f59e2", + "sha256": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962" + }, + { + "path": "research/complex-t16-rare-pattern-exchanges/SOURCE.json", + "usage": "input", + "git_blob": "1e43afd08c060373b6fde3c775c23c180cb6a794", + "sha256": "4cfd44cebfe88f4450294239fbea8feecb564338dc3027b76065227f5d19cb6f" + }, + { + "path": "research/complex-t16-rare-pattern-exchanges/data/OWNERS.json.gz", + "usage": "input", + "git_blob": "d3ba33d7e703a3229d9fb8a360f69d2f318bbb70", + "sha256": "87902c528dfab7d503dcf8a784260e3ab6fb7424c418a1820f7261f25be7b6bc" + }, + { + "path": "research/gauge44-slots-t16/code/audit_allcold.py", + "usage": "input", + "git_blob": "923bf7b675ca09f4d2633e7e53f16a1b23b6d5bc", + "sha256": "1467a2acb654e62552c69fb9a7c4c85f70a02120881d222313865058ab71a6cc" + }, + { + "path": "research/gauge44-slots-t16/code/emit_allcold.py", + "usage": "input", + "git_blob": "28a08a79da911d8f0e16f4bf8df47c580fb6b255", + "sha256": "354367e1fd6185a67b04f4268bcae4d502e47b18cb2131e247f5bcab5b3a769e" + }, + { + "path": "research/hyperplane-end-lean/PROOF.md", + "usage": "input", + "git_blob": "a94a2ac168c088a1282ea411766bc859178620df", + "sha256": "1cbce5cf0ff0152f71e8ae7bef25841d1ce13010af248ff7209182d2328c21c9" + } + ] +} diff --git a/research/selected1094-chart-phase/TASK.json b/research/selected1094-chart-phase/TASK.json new file mode 100644 index 0000000000..4cefadcf84 --- /dev/null +++ b/research/selected1094-chart-phase/TASK.json @@ -0,0 +1,71 @@ +{ + "schema_version": 1, + "task_id": "supplier-boundary-audit", + "priority_revision": 2, + "base_commit": "49b3157d1d89adcef16df8be98445451672be5ba", + "original_card": { + "id": "supplier-boundary-audit", + "question": "Does one selected supplier obligation follow from its actual source-bound checks?", + "starting_points": [ + "certificates/selected-result.json", + "research/owner-boundary-audit/README.md" + ], + "methods": [ + "Trace one hypothesis through the source, checker and complete caller.", + "Construct one semantically invalid but superficially well-formed fixture and test rejection." + ], + "acceptance_gate": "Pin the current sources and one obligation; the historical owner audit is an example, not evidence of a current bug.", + "first_step": { + "command": [ + "python3", + "-B", + "research/owner-boundary-audit/verify.py" + ], + "expected": "PASS_PR626_NEXT_TOUCH_BOUNDARY_AUDIT", + "inspect": "Identify why the timing-only omission passes but the full production controller still rejects it.", + "scope": "Positive control / source-bound orientation only; this is not a new construction or full cold replay." + }, + "first_experiment": "Choose one current supplier obligation and trace whether its acceptance depends on an independent check.", + "bottleneck_link": "Closing a current acceptance gap or proof obligation strengthens reliability even without changing kappa.", + "allowed_variations": [ + "Audit one named current condition using a new semantic counterexample." + ], + "scope_change_triggers": [ + "Reporting the historical timing-only diagnostic as a new current acceptance bug." + ], + "overlap_terms": [ + "owner boundary", + "bridge omission", + "hosting" + ] + }, + "scope_status": "refined", + "actual_scope": "Prove and test the Z/4 weight-refinement criterion for an orthogonal rebase of the normalized complex residual; bind all selected PR1094 routes/charts and exercise the existing source rejection of a same-projector phase mutant.", + "scope_change_reason": "Pin the selected PR1094 normalized physical residual chart and audit the exact ordered-axis/phase obligation; historical timing-only omissions and the existing PR1209 pending-axis audit are not presented as new defects.", + "bottleneck_link": "This strengthens an exact supplier boundary without changing the paid profile or kappa; a future chart optimization must preserve phase as well as geometry.", + "budget_minutes": 60, + "stop_rule": "One selected archive and every literal role/chart; all orthogonal bases in dimensions1 through6; one embedded four-axis obstruction and a six-axis nonpermutation positive control. No new supplier, broad optimization or full cold replay.", + "outcome": "completed", + "evidence": "PROOF.md, EXPECTED.json, PRODUCTION.json, three explicit commands and registered replay; source-specific controls and package tests.", + "author": "Gareth Davidson (@bitplane), with substantial OpenAI Codex assistance", + "ai_assistance": "Substantial OpenAI Codex assistance in mathematics, code and writing; no subagents or independent human review.", + "open_questions": [ + { + "question": "Can a phase-preserving orthogonal rebase reduce actual chart-adapter work?", + "why_it_matters": "A geometric simplification helps only if exact endpoints and the complete physical invoice improve.", + "first_step": "Test the six-axis weight-five rebase on one pinned width-seven role with complete normalized endpoint and route/adapter pricing.", + "blocked_by": "Current literal route admission needs a justified extension; no cost or supplier improvement is supplied." + }, + { + "question": "Can the universal phase criterion be formalized against exact C-gate semantics?", + "why_it_matters": "This would kernel-check the quantified implication beyond the finite census.", + "first_step": "Formalize the Z/4 weight polarization identity and then convolution conjugation under an orthogonal basis.", + "blocked_by": "Compiler/physical realization and archive-to-theorem binding remain separate obligations." + } + ], + "assignment_seed": "08486e2f4cb05dd9e1b849fa4eff7033", + "discussion": "https://github.com/CrocSwap/integer-mult-bounds/discussions/1237", + "selected_source": "0fc329d0bec93ca7cd288eaea1295172e8789810", + "submission_base": "dadfea6e8a78ff6ba901705f87532a71c6f5bbb8", + "overlap": "Final 21:05 UTC snapshot:844 open PRs through1247,9 Discussion threads including comments,324 local records; complete pagination,no warnings. Named predecessor heads unchanged; historical PR407 is a distinct scalar entrance-frame construction." +} diff --git a/research/selected1094-chart-phase/VALIDATION.md b/research/selected1094-chart-phase/VALIDATION.md new file mode 100644 index 0000000000..18a4170c0c --- /dev/null +++ b/research/selected1094-chart-phase/VALIDATION.md @@ -0,0 +1,71 @@ +# Validation record + +2026-10-13, Linux x86-64, CPython 3.14.4 and system CPython 3.12.3. +Standard library only. All three registered commands pass under isolated, +optimized execution; the predecessor ASTs are explicitly compiled with +`optimize=0` so their assertions remain active. + +```sh +/usr/bin/python3.12 scripts/research_package.py --package research/selected1094-chart-phase +python3 -I -O -B research/selected1094-chart-phase/verify.py +python3 -I -O -B research/selected1094-chart-phase/production_check.py +python3 -I -O -B research/selected1094-chart-phase/test_package.py +python3 -B scripts/verify_selected_result.py +``` + +The complete mathematical receipt agrees across versions: + +```text +34f3fc87deac2e04323d140b490133f7ebe2788c66143c926b5e266126993269 +``` + +The complete isolated production-predicate receipt also agrees: + +```text +0f1fc10c00dfbedeebc2c96353c18bdc2a7fff9a40abbd789397e21b395bf1cb +``` + +A fresh minimal directory held the package and only its eight declared external +inputs, with every file and directory made read-only. All three commands passed +from an unrelated working directory on Python 3.14; all 20 files in that input +closure were unchanged. The mathematical receipt equals the complete committed +EXPECTED object. The final documentation-only validation note was added after +this replay. The registered Python 3.12 hook passes metadata validation, the +mathematical verifier, the source-predicate companion and all eight tests. + +Evidence covers 69,120 helper roles, 10,002 complete charts, 53,300,658 Gram +entries, 10,008 chart/width signatures and 5,348,224 exact kernel coefficients. +The orthogonal census checks 23,817 matrices and 2,996,852 coefficient equations. +Six mathematical controls and two unmodified-source predicate controls reject. +The source C-only evaluator checks 512 full input columns. The eight package +tests include all columns/fibers of a small operator, inverse and square +identities, independent unpruned enumeration through dimension four, a valid +nonpermutation rebase, and actual optimized subprocess corruption tests. + +All eight input pins and two provenance pins match the named Git objects and +SHA-256 digests. The selected-record check passes. No scientific input changes +between experimental base `49b3157d1d89adcef16df8be98445451672be5ba` and submission +base `dadfea6e8a78ff6ba901705f87532a71c6f5bbb8`. + +Final overlap at 21:05 UTC covered all 844 open PRs through #1247, nine Discussion +threads plus their comments (16 records), and 324 local README/TASK/ledger +records. Remote pagination was complete, with no refresh warnings. Terms: +`orthogonal rebase`, `weight modulo`, `weight mod4`, `phase refinement`, +`spectator chart`, `chart phase`. The relevant PR702/712/1149/1209 heads stayed +unchanged. A historical PR407 entrance-frame match is a different construction. +This is bounded overlap evidence, not a novelty certificate. + +The cross-environment checks caught two harness issues, both corrected before +submission. A disposable copied receipt now has its own writable mode before +mutation when the source package is read-only. Receipt fingerprints hash exact +extracted source segments instead of version-dependent `ast.dump` formatting; +the executed ASTs and source predicates are unchanged. A local executable named +`python3.12` resolved to Python 3.14 and was correctly rejected by the hook; +the successful 3.12 run used `/usr/bin/python3.12` explicitly. Initial failures +were not counted as passing checks. + +The full supplier cold replay, historical global suites, other Clifford gate +types, local wrapper/native execution, invoice/precision/tape checks and a Lean +build were not run. The extracted source-predicate check inherits its supplied +context; it is not a complete admission-driver replay. Hosted PR CI is separate +and no hosted success is implied by these local results. diff --git a/research/selected1094-chart-phase/VERIFY.json b/research/selected1094-chart-phase/VERIFY.json new file mode 100644 index 0000000000..4a67e54685 --- /dev/null +++ b/research/selected1094-chart-phase/VERIFY.json @@ -0,0 +1,51 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/community-frontier1094-audit/REPLAY.json", + "research/community-frontier1094-audit/selected-replay.tar.gz", + "research/complex-k492-owner-repair/vendor/multicold/vendor/pr558/vendor/pr552/complex-global/vendor531/vendor/clifford/clifford_exact.py", + "research/complex-t16-rare-pattern-exchanges/SOURCE.json", + "research/complex-t16-rare-pattern-exchanges/data/OWNERS.json.gz", + "research/gauge44-slots-t16/code/audit_allcold.py", + "research/gauge44-slots-t16/code/emit_allcold.py", + "research/hyperplane-end-lean/PROOF.md" + ], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-O", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 180, + "checks": "Complete current chart/role binding, literal kernels, exhaustive small orthogonal census and six failure controls." + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-B", + "{package}/production_check.py" + ], + "timeout_seconds": 180, + "checks": "Verbatim pinned source controller predicates, two rejection controls and512 source C-kernel columns; isolated scope." + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-B", + "{package}/test_package.py" + ], + "timeout_seconds": 180, + "checks": "Eight semantic and package tests including actual optimized source/container/receipt corruption and occupied-output controls." + } + ] +} diff --git a/research/selected1094-chart-phase/algebra.py b/research/selected1094-chart-phase/algebra.py new file mode 100644 index 0000000000..ff88282131 --- /dev/null +++ b/research/selected1094-chart-phase/algebra.py @@ -0,0 +1,153 @@ +"""Exact binary charts and Gaussian convolution, independently implemented. + +Gareth Davidson, with OpenAI Codex assistance. Apache-2.0. +No predecessor executable code is imported. +""" +from collections import Counter +import hashlib +import json + + +def require(ok, message): + if not ok: + raise ValueError(message) + + +def canonical(value): + return json.dumps(value, sort_keys=True, separators=(',', ':'), allow_nan=False).encode() + + +def digest(value): + return hashlib.sha256(canonical(value)).hexdigest() + + +def linear(columns, x): + out = 0 + while x: + bit = x & -x + out ^= columns[bit.bit_length() - 1] + x ^= bit + return out + + +def transpose(columns, n): + return tuple(sum(((q >> j) & 1) << i for i, q in enumerate(columns)) for j in range(n)) + + +def rank(vectors): + pivots = {} + for vector in vectors: + while vector: + p = vector.bit_length() - 1 + if p in pivots: + vector ^= pivots[p] + else: + pivots[p] = vector + break + return len(pivots) + + +def orthonormal(columns, ambient): + require(all(type(q) is int and 0 < q < (1 << ambient) for q in columns), 'axis range/type') + require(all((a & b).bit_count() % 2 == (i == j) + for i, a in enumerate(columns) for j, b in enumerate(columns)), 'Gram identity') + + +def projector(columns, ambient): + # The image of every physical coordinate vector under U U^t. + return tuple(linear(columns, sum(((q >> j) & 1) << i for i, q in enumerate(columns))) + for j in range(ambient)) + + +def multiply(a, b): + return (a[0] * b[0] - a[1] * b[1], a[0] * b[1] + a[1] * b[0]) + + +def rotate(a, exponent): + return (a, (-a[1], a[0]), (-a[0], -a[1]), (a[1], -a[0]))[exponent % 4] + + +def convolution(axes, sign=1): + """Literal product of (1+si)I+(1-si)X_q; common denominator 2^len(axes).""" + require(sign in (-1, 1) and type(sign) is int, 'C direction') + state = {0: (1, 0)} + for q in axes: + out = {} + for x, value in state.items(): + for y, factor in ((x, (1, sign)), (x ^ q, (1, -sign))): + a, b = multiply(value, factor) + c, d = out.get(y, (0, 0)) + out[y] = (a + c, b + d) + state = out + return state + + +def closed_kernel(axes, sign=1): + """Independent subset formula, using only integer powers and rotations.""" + prefactor = (1, 0) + for _ in axes: + prefactor = multiply(prefactor, (1, sign)) + out = {linear(axes, z): rotate(prefactor, -sign * z.bit_count()) + for z in range(1 << len(axes))} + require(len(out) == (1 << len(axes)), 'dependent convolution axes') + return out + + +def rebased(axes, change): + return tuple(linear(axes, v) for v in change) + + +def defect(change): + n = len(change) + orthonormal(change, n) + rows = transpose(change, n) + return sum((((r.bit_count() - 1) // 2) & 1) << i for i, r in enumerate(rows)) + + +def orthogonal_matrices(n): + # Exhaust every ordered orthonormal basis, with no random nomination. + vectors = [x for x in range(1, 1 << n) if x.bit_count() & 1] + + def extend(columns, candidates): + if len(columns) == n: + yield tuple(columns) + return + for q in candidates: + yield from extend(columns + [q], [v for v in candidates if not ((q & v).bit_count() & 1)]) + + yield from extend([], vectors) + + +def census(): + result = [] + for n in range(1, 7): + basis = tuple(1 << i for i in range(n)) + wanted = {s: convolution(basis, s) for s in (-1, 1)} + matrices = preserving = permutations = coefficient_checks = 0 + masks = Counter() + stream = hashlib.sha256() + first_failure = None + for columns in orthogonal_matrices(n): + matrices += 1 + delta = defect(columns) + masks[delta] += 1 + preserving += delta == 0 + permutations += all(x.bit_count() == 1 for x in columns) + stream.update(canonical([columns, delta]) + b'\n') + for sign in (-1, 1): + actual = convolution(columns, sign) + require(len(actual) == (1 << n), 'orthogonal support') + for x, amplitude in actual.items(): + factor = -1 if (delta & x).bit_count() & 1 else 1 + require(amplitude == tuple(factor * a for a in wanted[sign][x]), 'phase-defect theorem') + coefficient_checks += 1 + require((actual == wanted[sign]) == (delta == 0), 'exact preservation iff') + if delta and first_failure is None: + first_failure = dict(columns=columns, defect=delta) + result.append(dict(dimension=n, matrices=matrices, preserving=preserving, + permutations=permutations, coefficient_checks=coefficient_checks, + defect_histogram=dict(sorted(masks.items())), stream_sha256=stream.hexdigest(), + first_failure=first_failure)) + require([r['matrices'] for r in result] == [1, 2, 6, 48, 720, 23040], 'complete small orthogonal census') + require([r['preserving'] for r in result] == [1, 2, 6, 24, 120, 1440], 'small refinement stabilizers') + return result diff --git a/research/selected1094-chart-phase/production_check.py b/research/selected1094-chart-phase/production_check.py new file mode 100644 index 0000000000..577861086a --- /dev/null +++ b/research/selected1094-chart-phase/production_check.py @@ -0,0 +1,144 @@ +#!/usr/bin/env python3 +"""Exercise the pinned controller's existing chart protection in isolation. + +This executes two verbatim function ASTs and the verbatim chart-table equality +assertion, not the whole admission driver. Its other top-level obligations are +inherited. The independent mathematical verifier imports none of this code. +Gareth Davidson, with OpenAI Codex assistance. Apache-2.0. +""" +import argparse +import ast +from collections import Counter, defaultdict +import copy +import hashlib +import json +from pathlib import Path +import sys +from types import SimpleNamespace + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) +from algebra import canonical, convolution, digest, rebased, require +from verify import inputs, load_bytes, read + +SOURCE = 'research/gauge44-slots-t16/code/audit_allcold.py' +KERNEL_SOURCE = 'research/complex-k492-owner-repair/vendor/multicold/vendor/pr558/vendor/pr552/complex-global/vendor531/vendor/clifford/clifford_exact.py' + + +def check(root): + data, _ = inputs(root) # Pins are checked before compiling source code. + text = (root / SOURCE).read_text() + tree = ast.parse(text, filename=SOURCE) + functions = [n for n in tree.body if isinstance(n, ast.FunctionDef) and n.name in ('orthobasis', 'audit')] + require({n.name for n in functions} == {'orthobasis', 'audit'}, 'source functions') + predicates = [] + for n in tree.body: + if isinstance(n, ast.Assert) and isinstance(n.test, ast.Compare): + left = n.test.left + if (isinstance(left, ast.Subscript) and isinstance(left.value, ast.Name) + and left.value.id == 'r' and isinstance(left.slice, ast.Constant) + and left.slice.value == 'sigmas'): + predicates.append(n) + require(len(predicates) == 1, 'source chart equality predicate') + template, word = data['template'], data['word'] + reg = template['local_providers'] + ns = dict(json=json, hashlib=hashlib, copy=copy, Counter=Counter, defaultdict=defaultdict, + canon=word, parent=data['parent'], ph=data['phases'], registry=reg, + providers={'gauge44': {'widths': reg['gauge44']['widths'], 'checks': data['checks']}}, + DATA=template['live'], PHYSICAL=template['physical'], V=word['v'], + R=word['R'], N=2*word['v']+word['R'], CENTRES=len(word['centers']), + M=73, T=16, HOSTED=144*word['R'], expected_provider=lambda stage, replica: 'gauge44', + prank={entry['child']: entry['rank'] for entry in data['parent']['idle_children']}, + BASE=Path('/pinned-archive/base')) + def sha(path): + require(str(path).endswith('work/complex-nine-native/DATA-PHASES.json'), 'isolated source SHA request') + return data['hosted']['source_artifacts']['work/complex-nine-native/DATA-PHASES.json'] + ns['sha'] = sha + # optimize=0 explicitly retains the predecessor's assertions under -O. + code = compile(ast.Module(body=functions, type_ignores=[]), SOURCE, 'exec', optimize=0) + exec(code, ns) + ns['bases'] = [ns['orthobasis'](p) for p in range(112)] + original = ns['audit'](template) + require(original['sigma_digest'] == data['hosted']['sigma_stream_sha256'], 'source positive stream') + equality = compile(ast.Module(body=predicates, type_ignores=[]), SOURCE, 'exec', optimize=0) + ns.update(r=original, OUT=Path('/pinned-archive/hosted')) + def compare(charts): + def read_charts(path): + require(path.name == 'ACTUAL-SIGMAS.json.gz', 'isolated source chart request') + return charts + ns['read'] = read_charts + exec(equality, ns) + compare(data['sigmas']) + witness = next(z for z in data['owners'] if z['width'] == 4) + # Find its already source-verified chart from the original table. + axes = data['phases']['recipes'][witness['port']]['idle_children'][witness['child']]['orthogonal_axes'][witness['offset']:witness['offset']+4] + name, columns = next((k, v) for k, v in data['sigmas'].items() if v[:4] == axes) + change = tuple((15 ^ (1 << i)) if i < 4 else (1 << i) for i in range(73)) + mutant = list(rebased(columns, change)) + changed = dict(data['sigmas']) + del changed[name] + new_name = hashlib.sha256(json.dumps(mutant, separators=(',', ':')).encode()).hexdigest() + changed[new_name] = mutant # The mutant carries its correct content hash. + rejected = [] + try: + compare(changed) + except AssertionError: + rejected.append('same-projector rebase with recomputed chart content hash') + require(len(rejected) == 1, 'source chart-table guard failed') + bad_template = copy.deepcopy(template) + call = next(c for c in bad_template['calls'] if (c['stage'], c['replica']) == (witness['stage'], witness['replica'])) + call['owners'][224 + witness['helper']][1][-1][0] = 72 + try: + ns['audit'](bad_template) + except AssertionError: + rejected.append('wrong literal spectator route') + require(len(rejected) == 2, 'source spectator-route guard failed') + kernel_text = (root / KERNEL_SOURCE).read_text() + kernel_tree = ast.parse(kernel_text, filename=KERNEL_SOURCE) + cls = next(n for n in kernel_tree.body if isinstance(n, ast.ClassDef) and n.name == 'Op') + zero = next(n for n in cls.body if isinstance(n, ast.FunctionDef) and n.name == 'zero_state') + kernel_ns = {} + exec(compile(ast.Module(body=[zero], type_ignores=[]), KERNEL_SOURCE, 'exec', optimize=0), kernel_ns) + column_checks = 0 + for axes in ((1,2,4,8), (14,13,11,7), (1,2,4,8,16,32), (62,61,59,55,47,31)): + for sign in (-1, 1): + operation = SimpleNamespace(n=6, circuit=[('C', q, sign) for q in axes]) + wanted = convolution(axes, sign) + for x in range(64): + vector, denominator_bits = kernel_ns['zero_state'](operation, x) + for y, value in enumerate(vector): + scaled = tuple(a * (1 << (len(axes)-denominator_bits)) for a in value) + require(scaled == wanted.get(x ^ y, (0,0)), 'literal source C-kernel column') + column_checks += 1 + return dict(status='PASS_PINNED_CONTROLLER_CHART_PROTECTION', + source=SOURCE, source_sha256=hashlib.sha256(text.encode()).hexdigest(), + selected_functions=[n.name for n in functions], + extracted_source_sha256=hashlib.sha256('\n\n'.join(ast.get_source_segment(text, n) for n in functions+predicates).encode()).hexdigest(), + positive_roles=original['hosted'], positive_charts=len(original['sigmas']), + positive_chart_stream_sha256=original['sigma_digest'], controls=rejected, + kernel_source=KERNEL_SOURCE, + kernel_source_sha256=hashlib.sha256((root / KERNEL_SOURCE).read_bytes()).hexdigest(), + kernel_method_source_sha256=hashlib.sha256(ast.get_source_segment(kernel_text, zero).encode()).hexdigest(), + source_kernel_columns=column_checks, + scope='Verbatim orthobasis/audit functions and chart-table assertion with explicit pinned-archive context; not the top-level script, native supplier, phase wrappers, invoice or cold driver.') + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--source-root', type=Path, default=HERE.parents[1]) + parser.add_argument('--write-expected', action='store_true') + args = parser.parse_args() + expected = HERE / 'PRODUCTION.json' + if args.write_expected: + require(not expected.exists(), 'production receipt already exists') + result = load_bytes(canonical(check(args.source_root.resolve()))) + if args.write_expected: + with expected.open('x') as stream: + json.dump(result, stream, indent=2, sort_keys=True); stream.write('\n') + else: + require(result == read(expected), 'complete production receipt mismatch') + print(result['status'], 'controls=2', 'receipt_sha256=' + digest(result)) + + +if __name__ == '__main__': + main() diff --git a/research/selected1094-chart-phase/test_package.py b/research/selected1094-chart-phase/test_package.py new file mode 100644 index 0000000000..e0353444b8 --- /dev/null +++ b/research/selected1094-chart-phase/test_package.py @@ -0,0 +1,128 @@ +#!/usr/bin/env python3 +"""Semantic failure controls and actual optimized subprocess checks. +Gareth Davidson, with OpenAI Codex assistance. Apache-2.0. +""" +import itertools +import json +from pathlib import Path +import shutil +import subprocess +import sys +import tempfile +import unittest + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) +import algebra as a +import verify as v + + +def dense_column(axes, ambient, column, sign=1): + state = [(0, 0)] * (1 << ambient) + state[column] = (1, 0) + for q in axes: + old = state + state = [] + for x in range(1 << ambient): + ar, ai = old[x] + br, bi = old[x ^ q] + state.append((ar-sign*ai+br+sign*bi, ai+sign*ar+bi-sign*br)) + return state + + +class Tests(unittest.TestCase): + def test_every_column_and_spectator_fiber(self): + good, bad = (1, 2, 4, 8), (14, 13, 11, 7) + changed = 0 + for x in range(64): + expected = dense_column(good, 6, x) + actual = dense_column(bad, 6, x) + kernel = a.convolution(good) + for y in range(64): + self.assertEqual(expected[y], kernel.get(x ^ y, (0, 0))) + multiplier = -1 if ((x ^ y) & 15).bit_count() & 1 else 1 + self.assertEqual(actual[y], tuple(multiplier*t for t in expected[y])) + if expected[y] != (0, 0): + self.assertEqual(x >> 4, y >> 4) + changed += expected[y] != actual[y] + self.assertEqual(changed, 512) + + def test_inverse_and_square(self): + for axes in ((1, 2, 4, 8), (14, 13, 11, 7)): + forward, backward = a.convolution(axes), a.convolution(axes, -1) + inverse, square = {}, {} + for x, p in forward.items(): + for y, q in backward.items(): + u, z = a.multiply(p, q); r, s = inverse.get(x ^ y, (0, 0)); inverse[x ^ y] = (u+r, z+s) + for y, q in forward.items(): + u, z = a.multiply(p, q); r, s = square.get(x ^ y, (0, 0)); square[x ^ y] = (u+r, z+s) + self.assertEqual({x:p for x,p in inverse.items() if p != (0,0)}, {0:(256,0)}) + self.assertEqual({x:p for x,p in square.items() if p != (0,0)}, {15:(256,0)}) + + def test_low_dimension_exhaustion(self): + # A different enumerator tries every tuple, without orthogonal-prefix pruning. + for n in range(1, 5): + brute = set() + for columns in itertools.product(range(1, 1 << n), repeat=n): + if all((x & y).bit_count() % 2 == (i == j) + for i,x in enumerate(columns) for j,y in enumerate(columns)): + brute.add(columns) + self.assertEqual(brute, set(a.orthogonal_matrices(n))) + + def test_nonpermutation_positive_and_projector_control(self): + positive = tuple(63 ^ (1 << i) for i in range(6)) + self.assertTrue(all(q.bit_count() == 5 for q in positive)) + self.assertEqual(a.convolution(positive), a.convolution((1,2,4,8,16,32))) + self.assertEqual(a.defect(positive), 0) + bad = (14,13,11,7) + self.assertEqual(a.projector(bad,4), a.projector((1,2,4,8),4)) + self.assertNotEqual(a.convolution(bad), a.convolution((1,2,4,8))) + with self.assertRaisesRegex(ValueError, 'axis range/type'): + a.orthonormal((True,), 1) + + def test_json_controls(self): + for text in ('{"x":0,"x":1}', '{"x":NaN}', '{"x":Infinity}'): + with self.assertRaises(ValueError): + v.load_bytes(text.encode()) + + def process(self, package, root, *args): + return subprocess.run([sys.executable, '-I', '-O', '-B', str(package/'verify.py'), + '--source-root', str(root), *map(str,args)], + cwd='/tmp', text=True, capture_output=True, timeout=180) + + def test_actual_source_and_immutable_container_corruption(self): + with tempfile.TemporaryDirectory() as temp: + root = Path(temp) + pins = [p for p in v.read(HERE/'SOURCES.json')['files'] if p['usage']=='input'] + for item in pins: + target = root/item['path']; target.parent.mkdir(parents=True, exist_ok=True) + shutil.copyfile(HERE.parents[1]/item['path'],target) + first = root/pins[0]['path']; raw = first.read_bytes(); first.write_bytes(raw+b' ') + p = self.process(HERE,root) + self.assertNotEqual(p.returncode,0); self.assertIn('source pin:',p.stderr) + first.write_bytes(raw) + archive = root/v.ARCHIVE; raw = bytearray(archive.read_bytes()); raw[4] ^= 1; archive.write_bytes(raw) + p = self.process(HERE,root) + self.assertNotEqual(p.returncode,0); self.assertIn('source pin:',p.stderr) + + def test_actual_receipt_corruption(self): + with tempfile.TemporaryDirectory() as temp: + package = Path(temp)/'package'; shutil.copytree(HERE,package) + receipt = v.read(package/'EXPECTED.json'); receipt['selected']['kernel_coefficients_both_signs'] -= 1 + (package/'EXPECTED.json').chmod(0o644) # Only this disposable mutant copy. + (package/'EXPECTED.json').write_text(json.dumps(receipt)) + p = self.process(package,HERE.parents[1]) + self.assertNotEqual(p.returncode,0); self.assertIn('complete receipt mismatch',p.stderr) + + def test_occupied_outputs_are_preserved(self): + with tempfile.TemporaryDirectory() as temp: + target = Path(temp)/'kept.json'; target.write_text('preserve me') + p = self.process(HERE,HERE.parents[1],'--receipt',target) + self.assertNotEqual(p.returncode,0); self.assertIn('receipt already exists',p.stderr) + self.assertEqual(target.read_text(),'preserve me') + p = self.process(HERE,HERE.parents[1],'--write-expected') + self.assertNotEqual(p.returncode,0); self.assertIn('expected receipt already exists',p.stderr) + + +if __name__ == '__main__': + unittest.main() diff --git a/research/selected1094-chart-phase/verify.py b/research/selected1094-chart-phase/verify.py new file mode 100644 index 0000000000..4d0cfbe76f --- /dev/null +++ b/research/selected1094-chart-phase/verify.py @@ -0,0 +1,273 @@ +#!/usr/bin/env python3 +"""Source-bound residual chart/phase audit; no new supplier or kappa. + +Gareth Davidson, with OpenAI Codex assistance. Apache-2.0. +""" +import argparse +from collections import Counter +from fractions import Fraction +import gzip +import hashlib +import json +from pathlib import Path +import sys +import tarfile + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) +from algebra import (canonical, census, closed_kernel, convolution, defect, digest, + linear, orthonormal, projector, rank, rebased, require) + +ARCHIVE = 'research/community-frontier1094-audit/selected-replay.tar.gz' +OWNERS = 'research/complex-t16-rare-pattern-exchanges/data/OWNERS.json.gz' +PREFIX = 'candidate/strict/' +MEMBERS = { + 'template': PREFIX + 'global/hosted/GLOBAL-TEMPLATE.json.gz', + 'sigmas': PREFIX + 'global/hosted/ACTUAL-SIGMAS.json.gz', + 'hosted': PREFIX + 'global/hosted/HOSTED.json', + 'phases': PREFIX + 'global/base/work/complex-nine-native/DATA-PHASES.json', + 'word': PREFIX + 'global/base/providers/gauge44/CANONICAL-WORD.json.gz', + 'parent': PREFIX + 'global/base/split-centres/GLOBAL-TEMPLATE.json.gz', + 'checks': PREFIX + 'global/base/providers/gauge44/LOCAL-CHECKS.json', + 'replay': PREFIX + 'REPLAY.json', +} + + +def pairs(items): + out = {} + for key, value in items: + require(key not in out, 'duplicate JSON key') + out[key] = value + return out + + +def load_bytes(data, compressed=False): + if compressed: + data = gzip.decompress(data) + def invalid(value): + raise ValueError('nonfinite JSON: ' + value) + return json.loads(data, object_pairs_hook=pairs, parse_constant=invalid) + + +def read(path): + return load_bytes(path.read_bytes(), path.suffix == '.gz') + + +def inputs(root): + manifest = read(HERE / 'SOURCES.json') + pins = {} + for item in manifest['files']: + if item['usage'] != 'input': + continue + p = root / item['path'] + require(p.resolve().is_relative_to(root.resolve()), 'source path escape') + data = p.read_bytes() + require(hashlib.sha256(data).hexdigest() == item['sha256'], 'source pin: ' + item['path']) + pins[item['path']] = item['sha256'] + objects, member_pins = {}, {} + with tarfile.open(root / ARCHIVE, 'r:gz') as archive: + names = [m.name for m in archive.getmembers()] + require(len(names) == len(set(names)), 'duplicate archive member') + for key, name in MEMBERS.items(): + member = archive.getmember(name) + require(member.isfile(), 'nonregular archive input') + data = archive.extractfile(member).read() + objects[key] = load_bytes(data, name.endswith('.gz')) + member_pins[name] = hashlib.sha256(data).hexdigest() + objects['owners'] = read(root / OWNERS) + require(objects['replay'] == read(root / 'research/community-frontier1094-audit/REPLAY.json'), 'selected replay binding') + source = read(root / 'research/complex-t16-rare-pattern-exchanges/SOURCE.json') + for name in ('audit_allcold.py', 'emit_allcold.py'): + require(source['files']['code/' + name] == pins['research/gauge44-slots-t16/code/' + name], 'selected controller code binding') + h = objects['hosted'] + require(digest(objects['template']) == h['template_sha256'], 'decoded hosted template binding') + for key, suffix in (('word', 'providers/gauge44/CANONICAL-WORD.json.gz'), + ('phases', 'work/complex-nine-native/DATA-PHASES.json'), + ('checks', 'providers/gauge44/LOCAL-CHECKS.json')): + require(member_pins[MEMBERS[key]] == h['source_artifacts'][suffix], 'hosted source binding') + return objects, dict(files=pins, archive_members=member_pins) + + +def port_basis(q): + # Orthogonal transvection taking the first missing coordinate to q, + # followed by the source's declared coordinate order. + missing = next(j for j in range(9) if not ((q >> j) & 1)) + v = q ^ (1 << missing) + order = list(range(73)) + order[0], order[missing] = order[missing], order[0] + return tuple((1 << j) ^ (v if (v >> j) & 1 else 0) for j in order) + + +def chart_contract(columns, expected_axes, ambient=73): + require(len(columns) == ambient, 'complete chart') + orthonormal(columns, ambient) + width = len(expected_axes) + require(tuple(columns[:width]) == tuple(expected_axes), 'ordered active-axis binding') + + +def reject(name, call): + try: + call() + except (ValueError, KeyError, IndexError): + return name + raise ValueError('control unexpectedly accepted: ' + name) + + +def audit_selected(data): + word, hosted, template, phases = (data[k] for k in ('word', 'hosted', 'template', 'phases')) + require((word['v'], word['h'], word['R'], phases['m']) == (112, 9, 480, 73), 'selected dimensions') + require(data['owners'] == template['hosting']['pooled_slots'], 'literal role binding') + require(len(data['owners']) == hosted['hosted_residuals'] == data['replay']['roles'] == 69120, 'selected roles') + bases = [port_basis(q) for q in word['ports']] + for p, b in enumerate(bases): + orthonormal(b, 73) + require(phases['recipes'][p]['q'] == word['ports'][p], 'physical port identity') + widths = [] + for h in range(word['R']): + start = word['frames'][word['start'][224 + h]] + final = word['frames'][word['final'][224 + h]] + require(rank(start + final) == rank(final), 'nested helper frames') + widths.append(rank(final) - rank(start)) + require(set(widths) == {4, 5, 7, 8, 9}, 'selected widths') + charts = data['sigmas'] + require(len(charts) == hosted['unique_actual_73column_sigmas'] == data['replay']['actual_73_axis_charts'] == 10002, 'selected charts') + for name, columns in charts.items(): + require(hashlib.sha256(json.dumps(columns, separators=(',', ':')).encode()).hexdigest() == name, 'chart content hash') + require(len(columns) == 73, 'chart dimension') + orthonormal(columns, 73) + calls = {(c['stage'], c['replica']): c for c in template['calls']} + require(len(calls) == 144, 'selected complete calls') + used, signatures, route_cache, role_keys = set(), {}, {}, set() + stream = hashlib.sha256() + count_by_width = Counter() + first_role = None + for role in data['owners']: + stage, rep, helper, family = (role[k] for k in ('stage', 'replica', 'helper', 'family')) + key = (stage, rep, helper) + require(key not in role_keys, 'duplicate role') + role_keys.add(key) + call = calls[stage, rep] + actual_family, route = call['owners'][224 + helper] + require(actual_family == family and role['time'] == call['time'], 'call route binding') + port, child, offset, width = (role[k] for k in ('port', 'child', 'offset', 'width')) + require(width == widths[helper] and 0 <= port < 112 and family % 112 == port, 'role width/port') + require(role['copy'] == role['owner_replica'] * 112 + port, 'owner copy') + pending = phases['recipes'][port]['idle_children'][child]['orthogonal_axes'] + require(type(offset) is int and offset >= 0 and offset + width <= len(pending), 'pending slice bounds') + active = tuple(pending[offset:offset + width]) + route_key = (port, child, offset, width) + if route_key not in route_cache: + b = bases[port] + positions = [b.index(q) for q in active] + spectators = [j for j in range(73) if j not in positions][:9 - width] + expected_route = [3, child, offset] if width == 9 else [4, child, offset, width, spectators] + order = positions + spectators + [j for j in range(73) if j not in positions and j not in spectators] + columns = tuple(b[j] for j in order) + name = hashlib.sha256(json.dumps(columns, separators=(',', ':')).encode()).hexdigest() + require(name in charts and tuple(charts[name]) == columns, 'missing literal emitted chart') + require(columns[:width] == active, 'pending active columns') + route_cache[route_key] = (name, expected_route) + name, expected_route = route_cache[route_key] + require(route == expected_route, 'literal residual/spectator route') + used.add(name) + signatures[name, width] = active + stream.update(json.dumps([stage, rep, helper, family, name], separators=(',', ':')).encode() + b'\n') + count_by_width[width] += 1 + if width == 4 and first_role is None: + first_role = dict(role=role, chart=name) + require(role_keys == {(s, r, h) for s in range(9) for r in range(16) for h in range(480)}, 'complete role domain') + require(used == set(charts), 'unreferenced emitted chart') + require(stream.hexdigest() == hosted['sigma_stream_sha256'], 'complete chart stream') + + kernel_stream = hashlib.sha256() + coefficient_checks = mutated_checks = 0 + for (name, width), active in sorted(signatures.items()): + # Literal physical convolution, subset formula, and chart transport. + for sign in (-1, 1): + physical = convolution(active, sign) + direct = closed_kernel(active, sign) + coordinate = convolution(tuple(1 << i for i in range(width)), sign) + transported = {linear(charts[name], z): value for z, value in coordinate.items()} + require(physical == direct == transported, 'exact normalized residual kernel') + coefficient_checks += len(physical) + kernel_stream.update(canonical([name, width, sign, sorted(physical.items())]) + b'\n') + change = tuple((15 ^ (1 << i)) if i < 4 else (1 << i) for i in range(width)) + alternative = rebased(active, change) + require(defect(change) == 15, 'four-axis defect') + bad, good = closed_kernel(alternative), closed_kernel(active) + require(bad[0] == good[0] and bad[active[0]] == tuple(-a for a in good[active[0]]), 'same-projector phase witness') + mutated_checks += 1 + + role, name = first_role['role'], first_role['chart'] + original = tuple(charts[name]) + change = tuple((15 ^ (1 << i)) if i < 4 else (1 << i) for i in range(73)) + mutant = rebased(original, change) + orthonormal(mutant, 73) + require(projector(original[:4], 73) == projector(mutant[:4], 73), 'same active projector') + require(original[4:] == mutant[4:], 'unchanged spectator completion') + good, bad = convolution(original[:4]), convolution(mutant[:4]) + require(good == closed_kernel(original[:4]) and bad == closed_kernel(mutant[:4]), 'literal four-axis witness') + require(set(good) == set(bad) and all(a*a+b*b == 16 for a,b in good.values()), 'same nonzero support/magnitudes') + require(good[0] == bad[0] and good[original[0]] != bad[original[0]], 'not a global phase') + controls = [reject('same-projector orthogonal phase mutant', lambda: chart_contract(mutant, original[:4]))] + repeated = list(original); repeated[-1] = repeated[0] + controls.append(reject('repeated spectator axis', lambda: chart_contract(repeated, original[:4]))) + swapped = list(original); swapped[0], swapped[4] = swapped[4], swapped[0] + controls.append(reject('active/spectator swap', lambda: chart_contract(swapped, original[:4]))) + controls.append(reject('missing chart column', lambda: chart_contract(original[:-1], original[:4]))) + controls.append(reject('out-of-range axis', lambda: chart_contract(original[:-1] + (1 << 73,), original[:4]))) + controls.append(reject('dependent kernel', lambda: closed_kernel((1, 1)))) + positive = tuple(63 ^ (1 << i) for i in range(6)) + require(defect(positive) == 0 and convolution(positive) == convolution(tuple(1 << i for i in range(6))), 'positive nonpermutation rebase') + require(convolution(tuple(reversed(original[:4]))) == good, 'positive axis permutation') + sample = dict(first_role) + sample.update(original_active=original[:4], mutated_active=mutant[:4], + displacement=original[0], same_projector=True, same_spectators=True, + expected_amplitude=[str(Fraction(a,16)) for a in good[original[0]]], + mutated_amplitude=[str(Fraction(a,16)) for a in bad[original[0]]], + zero_displacement_amplitude=[str(Fraction(a,16)) for a in good[0]], + spectator_fiber_inputs=[0, original[4]], + affected_displacements=sum(good[x] != bad[x] for x in good), total_displacements=len(good)) + return dict(roles=len(role_keys), calls=len(calls), full_charts=len(charts), + chart_gram_entries=len(charts)*73*73, width_inventory=dict(sorted(Counter(widths).items())), + roles_by_width=dict(sorted(count_by_width.items())), active_chart_signatures=len(signatures), + kernel_coefficients_both_signs=coefficient_checks, kernel_stream_sha256=kernel_stream.hexdigest(), + chart_stream_sha256=stream.hexdigest(), same_projector_mutated_signatures=mutated_checks, + witness=sample, controls=controls, + positive_controls=['axis permutation', 'six-axis nonpermutation Z4-preserving rebase']) + + +def run(root): + data, pins = inputs(root) + return dict(status='PASS_SELECTED1094_CHART_PHASE', sources=pins, + selected=audit_selected(data), orthogonal_census=census(), + scope='Exact source-bound residual chart and phase audit, conditional on normalized local endpoints; no current production defect, new supplier, runtime or kappa claim.') + + +def main(): + ap = argparse.ArgumentParser(description=__doc__) + ap.add_argument('--source-root', type=Path, default=HERE.parents[1]) + ap.add_argument('--receipt', type=Path) + ap.add_argument('--write-expected', action='store_true') + args = ap.parse_args() + if args.receipt: + require(not args.receipt.exists(), 'receipt already exists') + expected = HERE / 'EXPECTED.json' + if args.write_expected: + require(not expected.exists(), 'expected receipt already exists') + result = load_bytes(canonical(run(args.source_root.resolve()))) + if args.write_expected: + with expected.open('x') as stream: + json.dump(result, stream, indent=2, sort_keys=True); stream.write('\n') + else: + require(result == read(expected), 'complete receipt mismatch') + if args.receipt: + with args.receipt.open('x') as stream: + json.dump(result, stream, indent=2, sort_keys=True); stream.write('\n') + print(result['status'], 'roles=' + str(result['selected']['roles']), + 'charts=' + str(result['selected']['full_charts']), 'no_new_kappa') + print('receipt_sha256', digest(result)) + + +if __name__ == '__main__': + main() From add1e2673ef000c097ec0fd70058e644af048d6b Mon Sep 17 00:00:00 2001 From: Gareth Davidson Date: Tue, 13 Oct 2026 22:11:57 +0100 Subject: [PATCH 2/2] research: record pass23 submission and exact replay receipts --- research/selected1094-chart-phase/TASK.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/research/selected1094-chart-phase/TASK.json b/research/selected1094-chart-phase/TASK.json index 4cefadcf84..fd4b5fd978 100644 --- a/research/selected1094-chart-phase/TASK.json +++ b/research/selected1094-chart-phase/TASK.json @@ -67,5 +67,10 @@ "discussion": "https://github.com/CrocSwap/integer-mult-bounds/discussions/1237", "selected_source": "0fc329d0bec93ca7cd288eaea1295172e8789810", "submission_base": "dadfea6e8a78ff6ba901705f87532a71c6f5bbb8", - "overlap": "Final 21:05 UTC snapshot:844 open PRs through1247,9 Discussion threads including comments,324 local records; complete pagination,no warnings. Named predecessor heads unchanged; historical PR407 is a distinct scalar entrance-frame construction." + "overlap": "Final 21:05 UTC snapshot:844 open PRs through1247,9 Discussion threads including comments,324 local records; complete pagination,no warnings. Named predecessor heads unchanged; historical PR407 is a distinct scalar entrance-frame construction.", + "pr": "https://github.com/CrocSwap/integer-mult-bounds/pull/1255", + "mathematical_head": "306370dfde0097a1a0b6e3b539c6437fbe46a679", + "submitted_at_utc": "2026-10-13T21:11:54.846133+00:00", + "receipt_sha256": "34f3fc87deac2e04323d140b490133f7ebe2788c66143c926b5e266126993269", + "production_receipt_sha256": "0f1fc10c00dfbedeebc2c96353c18bdc2a7fff9a40abbd789397e21b395bf1cb" }