From af5b2ff1c0afa3100c961fa11b4d6e1fe18714cb Mon Sep 17 00:00:00 2001 From: commdata2338 <199849969+commdata2338@users.noreply.github.com> Date: Sat, 17 Oct 2026 13:06:16 -0500 Subject: [PATCH] Research: PR #3189's eighteenth-position QQ16 error witness survives the local native core Lifts PR #3189's B1,2 child-error witness through the literal local native suffix instead of treating non-scalar maps as identities. The Gaussian-integer direction w = T_236 ONE (entries in {-1,0,1}, squared norm 512) is injected after child 13489 on L344, and the 13,529-event suffix is executed exactly. After scalar 26472, L93 is exactly (-81921/262144) ONE: 17 fractional positions cannot represent this channel, while 18 suffice at every completed event for this direction. Final data errors are L75 = -ONE/2 and L93 = ONE/2; six borrowed helpers (L337, L338, L339, L341, L343, L346) retain errors and all private fields are zero, so an endpoint-only grid check misses the intermediate requirement. A separately implemented sparse Fraction engine matches the complete changed-field trace and every endpoint vector, and four reverse adjoints check the attaining and terminal components. This is a finite certificate for one direction at completed events under a completed-child defect model. Actual child rounding, recipe interiors, dirty-input bounds, helper restoration, global embedding and the paid consumer remain open; no supplier, selected-record or kappa change is claimed. Adds research/qq16-native-noise-lift/ only. Submitted by @commdata2338 with substantial AI assistance (OpenAI Codex research and implementation; packaged with Claude Code). Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01X86sCSXdoDd61SDFfC1PKG --- research/qq16-native-noise-lift/README.md | 179 ++ research/qq16-native-noise-lift/RESULT.json | 2281 +++++++++++++++++ research/qq16-native-noise-lift/SOURCES.json | 42 + research/qq16-native-noise-lift/TASK.json | 209 ++ research/qq16-native-noise-lift/VERIFY.json | 47 + .../qq16-native-noise-lift/independent.py | 292 +++ .../qq16-native-noise-lift/test_verify.py | 132 + research/qq16-native-noise-lift/verify.py | 270 ++ 8 files changed, 3452 insertions(+) create mode 100644 research/qq16-native-noise-lift/README.md create mode 100644 research/qq16-native-noise-lift/RESULT.json create mode 100644 research/qq16-native-noise-lift/SOURCES.json create mode 100644 research/qq16-native-noise-lift/TASK.json create mode 100644 research/qq16-native-noise-lift/VERIFY.json create mode 100644 research/qq16-native-noise-lift/independent.py create mode 100644 research/qq16-native-noise-lift/test_verify.py create mode 100644 research/qq16-native-noise-lift/verify.py diff --git a/research/qq16-native-noise-lift/README.md b/research/qq16-native-noise-lift/README.md new file mode 100644 index 0000000000..2a3cadecca --- /dev/null +++ b/research/qq16-native-noise-lift/README.md @@ -0,0 +1,179 @@ +# The QQ16 eighteenth-position witness survives the local native core + +**Finite native error-channel certificate.** The B1,2 child-error witness in +[Tekalign's PR3189](https://github.com/CrocSwap/integer-mult-bounds/pull/3189) +survives the literal retained native core, including its changing frames and +occupied residual adapters. It is not an artifact of replacing those maps by +identities. This answers PR3189's second **Open next question** for one local +512-coordinate payload factor. It does not supply a rounded recursive child, +a global producer accuracy bound, or an affordable consumer. + +All event numbers below are zero-based in the expanded `B_1_2` program of the +unchanged [joint-query certificate](../joint-query/certificate.json.gz). +The retained backward core starts at event 1864. Its suffix after the named +injection contains no cover maps or new native-line wrappers. +`ONE` is the real vector of 512 ones. The complete Gaussian-integer injection +is recorded explicitly in `RESULT.json`, so it can also be used without relying +on its frame-based description. + +| Item | Exact value | +| --- | --- | +| Injection | After child 13489: `['climb','A',344,226,236,1]` | +| Error direction | `w = T_236 ONE`, source frame basis `[416,75,19]` | +| Components of w | Real and imaginary entries in `{-1,0,1}`; squared Hilbert norm 512 | +| Attaining cut | After 26472: `L93 += -L103/8`, local frame 1 | +| Error at that cut | `(-81921/262144) ONE` | +| Largest component denominator exponent at completed events | 18, first attained at this cut | +| Largest absolute component in this error trace | `81921/4` | +| Final data error | `L75 = -ONE/2`, `L93 = ONE/2`; all other data fields zero | +| Final helper error support | L337, L338, L339, L341, L343, L346 | +| Final private error | All eight fields zero | + +The helper defect is material: this error channel does **not** restore borrowed +state. The six helper squared norms are respectively `32,128,128,32,128,128`. +Their full component histograms and vector hashes are in `RESULT.json`; for +example the final coordinate zero of L337 is `i/2`. The originally perturbed +L344 itself has zero final error. + +## What this proves about a grid + +Let the ideal and perturbed computations agree until this completed child. +Insert the additive defect `h w`, for any positive grid quantum h, then apply +the subsequent native maps and scalar operations exactly. Linearity makes the +error at each cut h times the checked trace, regardless of the underlying +ideal data and dirty-helper values. This is a completed-child defect model, +not a claim that a particular child or rounding algorithm produces this error. + +The injection is on the Gaussian component lattice `h Z[i]`. At the attaining +cut, a real component expressed in units of `h/2^17` is `-81921/2`, which is +not an integer. Thus 17 fractional guard positions cannot represent even this +one channel exactly. If the ideal component at this cut is on the working +grid, the perturbed component is off it; rounding that component to the grid +incurs absolute error at least `h/2^18`. The exact error trace is on +`h/2^18 Z[i]` at every +**completed program event**, so 18 is necessary and sufficient for this +particular direction and these cuts. + +This is a lower-bound witness for a more general native error-lattice contract, +not a sharp upper bound for every child direction. It does not bound the +intermediate arithmetic inside a child recipe. The final data and helper +errors need only one fractional position, so an endpoint-only grid check would +miss the intermediate requirement. + +## Evidence and reproduction + +From the repository root, standard-library Python 3.12: + +```sh +python3 -Werror -I -B scripts/research_package.py \ + --package research/qq16-native-noise-lift +``` + +Expected markers: + +```text +PASS_QQ16_NATIVE_NOISE_LIFT guard=18 coefficient=-81921/262144 data_fields=2 helpers=6 private=0 +PASS_QQ16_NATIVE_NOISE_FORWARD guard=18 complete_trace_and_endpoint=matched +PASS_QQ16_NATIVE_NOISE_DUAL coefficient=-81921/262144 checks=4 coordinate=0 +``` + +Nine behavioral test groups and the registered-package PASS follow. The +primary replay is read-only; `verify.py --write PATH` exclusively creates an +absent receipt. It authenticates four live inputs and three archive members. +The regenerated receipt compares every proof-relevant field, including the +explicit injected vector, all endpoint vectors' canonical hashes, every +changed-field cut's trace digest, source event bytes and the scalar-projection +positive control. + +The primary interpreter executes the 13,529-event local suffix on Gaussian +dyadic vectors. Zero operands may skip a linear native kernel because that +kernel maps zero to zero; no cost saving is attributed to this shortcut. +There are 16 child occurrences, nine adapter occurrences, four residual +adapter occurrences and 584 scalar occurrences with nonzero changed outputs. +The other suffix events are still visited and authenticated. + +`independent.py` imports neither the primary checker nor predecessor executable +code. Its sparse Gaussian `Fraction` engine independently executes the complete +single-channel suffix, matching the full changed-field trace digest, the 18-bit +guard, all 512 attaining components and every endpoint vector. It also applies +backward adjoints of the literal monomial/line recipes. Starting from coordinate +zero of L93 at the attaining cut, it derives the response to the explicit +witness input. Three additional dual calculations check terminal L75, L93 and +the occupied residual output L337. This is independent arithmetic coverage of +one channel, not an all-child census or an independent review of native semantics. + +Controls reject changed global phase, an unframed injection, injection before +instead of after the child, a changed attaining ADD sign, a residual-adapter +orientation error, source corruption, changed injection bytes and unknown +events. Zero and signed dyadic scaling are positive controls. A nonzero complex +adjoint identity tests the independently implemented kernel order; duplicate +JSON keys and boolean/integer receipt confusion are also checked. + +## Scope, costs and expansion decision + +The certificate concerns the actual **local retained core recipes** at one +nine-axis payload factor, after a single independent completed-child defect. +It checks local physical component values, including nonzero residual outputs. +It does not execute the earlier B1 cover sweeps or validate a global owner +placement, 73-axis embedding, tensor-depth extension or selected supplier. +Those are inherited or open interfaces, and no payload-only replacement for +a cover action is made here: no cover map remains in the studied suffix. + +The ideal native recipes and their access interpretation are inherited from +the reviewed QQ16/native work. The numerical replay checks their exact linear +response, not their implementation at the retained recursive tariff. +Actual child-return rounding and correlations, errors within recipes, dirty +input bounds, fixed-format overflow and a receiver-compatible grid remain +unresolved. Nor does this certificate price storage, movement, cleanup, +hosting, the F17 consumer or a complete recursive invoice. These unknown costs +are not zero. [PR2965's conditional output-error transfer](../qq16-producer-defect-transfer/README.md) +is unchanged; its producer accuracy and restoration premises are not supplied. + +Family decision: **narrow and stop** after this one handoff. No new search, +controller implementation, selected-frontier change or kappa improvement is +claimed. The selected cold replay, complete predecessor suites, all 7,004 +projected error columns and a formal proof kernel were not run. The result is +author-checked with a separately implemented arithmetic check; no independent +human review or hosted CI pass is claimed. + +## Open next questions + +Can an actual child implementation exclude or correctly price this error +channel? Begin with the named `226 -> 236` child on L344, its returned-value +and defect lattices, and the following receiver operations. A returned-value +grid and a norm bound alone do not establish defect-lattice closure. This +requires a specific child implementation and dirty-input/grid contract. + +Can the all-cut local guarantee be extended to the actual global caller's +physical grid while restoring every borrowed helper? Bind the retained-core +embedding and owner placement, then propagate its actual errors and charge +native arithmetic, movement, storage and F17 consumption together. The local +channel certificate does not establish an affordable full producer/consumer. +See `TASK.json` for the structured handoff and stop rules. + +## Sources and credit + +Base main: `463113d675af7410ac91d53a4fed51ec6494eb9a`, priority revision 6. +The claim is in discussion #2727. `SOURCES.json` pins the live certificate, +selected archive, native primitive evaluator and PR3189 receipt. Exact +predecessor heads are recorded in `TASK.json`: + +- Tekalign (`tekuuu`), PR3189 `70537595e46444c8a63455523d9851a5efe55385`: + the child-error lattice criterion, projected witness and explicit native-lift handoff. +- dcharb78, PR3181 `80fc72d14546088e9fce3c06dc12bc67270da0af`: + ideal scalar interior/grid and adjoint work motivating the audited implication. +- Tekalign, PR3017 `0f493f4c264fbc70ee14364b68af260d858c143c`: + exact Gaussian-dyadic primitives and local native execution conventions. +- Ross Richardson, PR3067 `e1e28b4070ae52efa5a9d0aa826bc588be7206f2`: + physical F0 execution/rounding methodology. The new primary event dispatcher + adapts the PR3017/3067 conventions; it is not an independent native implementation. +- Nick Petalas, PR2965 `526f2c242202b31b15e09a7502dfb8ff757b2bad`; + Arham Tahir, PR2995/3036; Ali Romman and the joint-query team; Sagar Thakrar, + DLamdata, ywz65, starship-s, Douglas Colkitt and the retained selected/native lineage. + +Prepared for commdata2338 (@commdata2338), with substantial OpenAI Codex assistance. +New work is Apache-2.0. No predecessor bytes or notices are changed. + +The checks use managed Python integers and collections, fixed 712 fields and +512 coordinates, bounded serialized input sizes and explicit replay timeouts. +They are research verifiers, not fixed-storage or constant-time machine programs. diff --git a/research/qq16-native-noise-lift/RESULT.json b/research/qq16-native-noise-lift/RESULT.json new file mode 100644 index 0000000000..03ec9b3371 --- /dev/null +++ b/research/qq16-native-noise-lift/RESULT.json @@ -0,0 +1,2281 @@ +{ + "attainment": { + "coefficient": "-81921/262144", + "event": 26472, + "instruction": [ + "scalar", + [ + "add", + [ + "L", + 93 + ], + [ + "L", + 103 + ], + -1, + 8 + ], + 1 + ], + "wire": 93 + }, + "core_offset": 1864, + "event_count": 27019, + "native": { + "changed_field_trace_sha256": "780edd0247002e5826335ce4db8962e7cef41a0ac0f88fe3da6adda8fcd94b78", + "first_attainment": [ + 26472, + 93 + ], + "guard": 18, + "injection": { + "denominator_exponent": 0, + "exponent": 0, + "imag": [ + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + 1, + 1, + 0, + 0, + 1, + 1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + 1, + 1, + 0, + 0, + 1, + 1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + 1, + 1, + 0, + 0, + 1, + 1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + 1, + 1, + 0, + 0, + 1, + 1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + 1, + 1, + 0, + 0, + 1, + 1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + 1, + 1, + 0, + 0, + 1, + 1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + 1, + 1, + 0, + 0, + 1, + 1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + 1, + 1, + 0, + 0, + 1, + 1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + 1, + 1, + 0, + 0, + 1, + 1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + 1, + 1, + 0, + 0, + 1, + 1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + 1, + 1, + 0, + 0, + 1, + 1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + 1, + 1, + 0, + 0, + 1, + 1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + 1, + 1, + 0, + 0, + 1, + 1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + 1, + 1, + 0, + 0, + 1, + 1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + 1, + 1, + 0, + 0, + 1, + 1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + 1, + 1, + 0, + 0, + 1, + 1, + 0 + ], + "imag_histogram": { + "-1": 64, + "0": 256, + "1": 192 + }, + "real": [ + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + -1, + 0, + 0, + -1, + -1, + 0, + 0, + -1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + -1, + 0, + 0, + -1, + -1, + 0, + 0, + -1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + -1, + 0, + 0, + -1, + -1, + 0, + 0, + -1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + -1, + 0, + 0, + -1, + -1, + 0, + 0, + -1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + -1, + 0, + 0, + -1, + -1, + 0, + 0, + -1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + -1, + 0, + 0, + -1, + -1, + 0, + 0, + -1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + -1, + 0, + 0, + -1, + -1, + 0, + 0, + -1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + -1, + 0, + 0, + -1, + -1, + 0, + 0, + -1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + -1, + 0, + 0, + -1, + -1, + 0, + 0, + -1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + -1, + 0, + 0, + -1, + -1, + 0, + 0, + -1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + -1, + 0, + 0, + -1, + -1, + 0, + 0, + -1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + -1, + 0, + 0, + -1, + -1, + 0, + 0, + -1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + -1, + 0, + 0, + -1, + -1, + 0, + 0, + -1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + -1, + 0, + 0, + -1, + -1, + 0, + 0, + -1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + -1, + 0, + 0, + -1, + -1, + 0, + 0, + -1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + -1, + 0, + 0, + -1, + -1, + 0, + 0, + -1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 0, + -1, + -1, + 0, + 0, + -1, + -1, + 0 + ], + "real_histogram": { + "-1": 192, + "0": 256, + "1": 64 + }, + "sha256": "46c4908837b78c26d84cffae6b3ed3a49fc6eed0a1ce1dfd34212403ff2bcbab", + "squared_norm": "512" + }, + "max_abs_component": "81921/4", + "occupied_event_counts": { + "adapter": 9, + "climb": 16, + "residual_adapter": 4, + "scalar": 584 + }, + "occupied_native_events": [ + [ + 13522, + [ + "climb", + "A", + 346, + 236, + 240, + 1 + ] + ], + [ + 14925, + [ + "climb", + "A", + 93, + 240, + 416, + 4 + ] + ], + [ + 14938, + [ + "climb", + "A", + 58, + 240, + 417, + 4 + ] + ], + [ + 16870, + [ + "climb", + "B", + 344, + 236, + 658, + 3 + ] + ], + [ + 17943, + [ + "climb", + "B", + 344, + 658, + 828, + 1 + ] + ], + [ + 17946, + [ + "climb", + "B", + 263, + 828, + 823, + 1 + ] + ], + [ + 17948, + [ + "climb", + "B", + 344, + 828, + 827, + 1 + ] + ], + [ + 18957, + [ + "climb", + "final", + 1, + 240, + 1, + 5 + ] + ], + [ + 18962, + [ + "climb", + "final", + 6, + 240, + 1, + 5 + ] + ], + [ + 19014, + [ + "climb", + "final", + 58, + 417, + 1, + 1 + ] + ], + [ + 19049, + [ + "climb", + "final", + 93, + 416, + 1, + 1 + ] + ], + [ + 19107, + [ + "climb", + "final", + 263, + 823, + 1, + 1 + ] + ], + [ + 19167, + [ + "climb", + "final", + 344, + 827, + 1, + 1 + ] + ], + [ + 19168, + [ + "climb", + "final", + 345, + 240, + 1, + 5 + ] + ], + [ + 19171, + [ + "climb", + "final", + 349, + 240, + 1, + 5 + ] + ], + [ + 19217, + [ + "climb", + "final", + 407, + 658, + 1, + 3 + ] + ], + [ + 19472, + [ + "adapter", + "new_to_old", + 1, + 1 + ] + ], + [ + 19477, + [ + "adapter", + "new_to_old", + 6, + 1 + ] + ], + [ + 19529, + [ + "adapter", + "new_to_old", + 58, + 1 + ] + ], + [ + 19564, + [ + "adapter", + "new_to_old", + 93, + 1 + ] + ], + [ + 19734, + [ + "adapter", + "new_to_old", + 263, + 1 + ] + ], + [ + 19794, + [ + "adapter", + "new_to_old", + 344, + 1 + ] + ], + [ + 19795, + [ + "adapter", + "new_to_old", + 345, + 1 + ] + ], + [ + 19798, + [ + "adapter", + "new_to_old", + 349, + 1 + ] + ], + [ + 19844, + [ + "adapter", + "new_to_old", + 407, + 1 + ] + ], + [ + 26796, + [ + "residual_adapter", + "post", + 337, + 0, + 240 + ] + ], + [ + 26797, + [ + "residual_adapter", + "post", + 339, + 0, + 240 + ] + ], + [ + 26798, + [ + "residual_adapter", + "post", + 341, + 0, + 240 + ] + ], + [ + 26799, + [ + "residual_adapter", + "post", + 346, + 0, + 240 + ] + ] + ], + "occupied_residuals": [ + [ + 26796, + 337, + "5796480e82d80ac59c9d08051acd127715ecf86854885fd638a2799825efd16e" + ], + [ + 26797, + 339, + "938a41c7c9c1f47f3ce4770cd58743e2d2f4e5b920f93fe4865fd41bd39ef496" + ], + [ + 26798, + 341, + "308370b6a03de938a1b0b5cd0dc93d0e4617a892409586ad9938f7a3e7359d1c" + ], + [ + 26799, + 346, + "1b33e72e8f158929de5080c01d65adecf0a5b2f5033e7d2194ab65bab312cd56" + ] + ], + "target": { + "denominator_exponent": 18, + "imag_histogram": { + "0": 512 + }, + "real_histogram": { + "-81921/262144": 512 + }, + "sha256": "338699202dc8fca46591b6adba0e7e4eb692757486a59001cddcf3b93284b3a5", + "squared_norm": "6711050241/134217728" + } + }, + "nonzero_data_fields": [ + 75, + 93 + ], + "nonzero_helpers": [ + 337, + 338, + 339, + 341, + 343, + 346 + ], + "nonzero_outputs": { + "337": { + "denominator_exponent": 1, + "imag_histogram": { + "-1/2": 32, + "0": 448, + "1/2": 32 + }, + "real_histogram": { + "-1/2": 32, + "0": 448, + "1/2": 32 + }, + "sha256": "5796480e82d80ac59c9d08051acd127715ecf86854885fd638a2799825efd16e", + "squared_norm": "32" + }, + "338": { + "denominator_exponent": 1, + "imag_histogram": { + "0": 512 + }, + "real_histogram": { + "-1/2": 512 + }, + "sha256": "9752b9954f9321edbf39d278e9c58c89eb0d531506a1fca20e7d819bdc50228c", + "squared_norm": "128" + }, + "339": { + "denominator_exponent": 0, + "imag_histogram": { + "-1": 32, + "0": 448, + "1": 32 + }, + "real_histogram": { + "-1": 32, + "0": 448, + "1": 32 + }, + "sha256": "938a41c7c9c1f47f3ce4770cd58743e2d2f4e5b920f93fe4865fd41bd39ef496", + "squared_norm": "128" + }, + "341": { + "denominator_exponent": 1, + "imag_histogram": { + "-1/2": 32, + "0": 448, + "1/2": 32 + }, + "real_histogram": { + "-1/2": 32, + "0": 448, + "1/2": 32 + }, + "sha256": "308370b6a03de938a1b0b5cd0dc93d0e4617a892409586ad9938f7a3e7359d1c", + "squared_norm": "32" + }, + "343": { + "denominator_exponent": 1, + "imag_histogram": { + "0": 512 + }, + "real_histogram": { + "1/2": 512 + }, + "sha256": "ba22f690aef9b00faddfecc2aec5c14ade52c68c59e021671fde7f2ad9ae4c19", + "squared_norm": "128" + }, + "346": { + "denominator_exponent": 0, + "imag_histogram": { + "-1": 32, + "0": 448, + "1": 32 + }, + "real_histogram": { + "-1": 32, + "0": 448, + "1": 32 + }, + "sha256": "1b33e72e8f158929de5080c01d65adecf0a5b2f5033e7d2194ab65bab312cd56", + "squared_norm": "128" + }, + "75": { + "denominator_exponent": 1, + "imag_histogram": { + "0": 512 + }, + "real_histogram": { + "-1/2": 512 + }, + "sha256": "9752b9954f9321edbf39d278e9c58c89eb0d531506a1fca20e7d819bdc50228c", + "squared_norm": "128" + }, + "93": { + "denominator_exponent": 1, + "imag_histogram": { + "0": 512 + }, + "real_histogram": { + "1/2": 512 + }, + "sha256": "ba22f690aef9b00faddfecc2aec5c14ade52c68c59e021671fde7f2ad9ae4c19", + "squared_norm": "128" + } + }, + "nonzero_private": [], + "origin": { + "event": 13489, + "instruction": [ + "climb", + "A", + 344, + 226, + 236, + 1 + ], + "wire": 344 + }, + "program": "B_1_2", + "projection": { + "endpoint": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "-1/2", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1/2", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1/4", + "-1/2", + "1/2", + "0", + "-1/4", + "0", + "1/2", + "0", + "0", + "-1/2", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + "first_attainment": [ + 26472, + 93, + "-81921/262144" + ], + "guard": 18, + "target": "-81921/262144" + }, + "schema": "qq16-native-noise-lift/v1", + "suffix_event_counts": { + "adapter": 626, + "climb": 2949, + "phase": 6, + "residual_adapter": 240, + "scalar": 9708 + }, + "suffix_sha256": "557484e07b76aebf2003762a84cb79b7d1e64b2d4c496798f35ff9341f34599d" +} diff --git a/research/qq16-native-noise-lift/SOURCES.json b/research/qq16-native-noise-lift/SOURCES.json new file mode 100644 index 0000000000..2ca8b0cd01 --- /dev/null +++ b/research/qq16-native-noise-lift/SOURCES.json @@ -0,0 +1,42 @@ +{ + "schema_version": 1, + "base_commit": "463113d675af7410ac91d53a4fed51ec6494eb9a", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "b1fea0c94436b236cc2b7d41a7be032811b94c81", + "sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "67f085acd86acd7d4e03922d9cf4b26bca66fed5", + "sha256": "47b42433f5a85809a3aadd29c2c339da2c6ed728e4f7762df6b88bccb7874cf0" + }, + { + "path": "research/community-frontier1042-audit/selected-replay.tar.gz", + "usage": "input", + "git_blob": "6f4dc6fe7631d8aacf8081fcaecf32197181685b", + "sha256": "22c3f4dce4b897a1d423d1388801933e288b6a6b1906cb15e1b16a5eb68db754" + }, + { + "path": "research/joint-query/certificate.json.gz", + "usage": "input", + "git_blob": "c6e876d8b48d768214deee265ade428f8983b566", + "sha256": "a5ed85fac5ebf3c091482a113ab0d351eb5a7892fe2841a35e16017ec1ff49f7" + }, + { + "path": "research/qq16-native-dirty-fault/native.py", + "usage": "input", + "git_blob": "e1976b3a55a40206808405b99a4c443093378bef", + "sha256": "999eb1230798b25821de7771ecfa86381e137124059b30ccef167169d176ee8e" + }, + { + "path": "research/qq16-noise-lattice-audit/RESULT.json", + "usage": "input", + "git_blob": "9ee8bbd1eb6286469810650562913af93f414b81", + "sha256": "68776da579b82115d947336721ed559d8afbed78b394e8e68f6fd3fae7fdfd65" + } + ] +} diff --git a/research/qq16-native-noise-lift/TASK.json b/research/qq16-native-noise-lift/TASK.json new file mode 100644 index 0000000000..8963a57d2d --- /dev/null +++ b/research/qq16-native-noise-lift/TASK.json @@ -0,0 +1,209 @@ +{ + "schema_version": 1, + "task_id": "joint-query-controller", + "priority_revision": 6, + "base_commit": "463113d675af7410ac91d53a4fed51ec6494eb9a", + "original_card": { + "id": "joint-query-controller", + "question": "Can a literal QQ16 producer meet the proposed completed-output error budgets with dirty helpers and an affordable physical consumer?", + "starting_points": [ + "docs/research/research-family-status.md", + "research/joint-query/README.md", + "research/joint-query/evidence/QQ16-SELECTED-WITNESS.md", + "research/joint-query/evidence/JOINT-QUERY-TRANSFER.md", + "docs/research/community-efficient1000-review.md", + "research/qq16-producer-defect-transfer/README.md" + ], + "methods": [ + "Derive one literal producer's completed-output defects and intermediate dirty-helper bounds, with its physical bill.", + "Design or audit one consumer, retention or hosting boundary and its complete cost for the pinned producer/decoder." + ], + "acceptance_gate": "Name the changed premise of the fixed F0/B1 observation obstruction. Show exactly which query is recovered, legal native reads and restoration, and a full favorable budget including cover maps, helpers and endpoints. Local inverse identities alone do not close the global controller. A scoped local result may be retained without a complete supplier. Expanding it into further construction rounds requires the family-level budget and obligation gate in research-family-status.md; an optimistic passing relaxation alone is not acceptance.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read the revision-6 family record and #2965 producer-defect transfer after the local QQ16 decoder contract. Its author-checked output-error estimate does not implement producer interiors, bound dirty helpers, or pay for the consumer; independently check the implication used.", + "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": "Pin one literal F0/B1 producer and its native-child contracts; derive the actual intermediate magnitude ledger and completed-output defects, including dirty helpers and correlations. Compare with #2965 budgets and price storage, movement, cleanup and F17 consumption. Stop with a precise missing bound if no producer contract supplies it; do not optimize another decoder precision constant in isolation.", + "bottleneck_link": "The native local words exist; retained query information and its physical access are the missing link to a composed recursive interface.", + "allowed_variations": [ + "One paid query, one changed first pair, or one precisely specified affine helper state.", + "A counterexample or lower bound for that exact proposed repair.", + "One unresolved obligation of a newer local decoder, with exact source heads and a distinct claim/domain." + ], + "scope_change_triggers": [ + "Retaining the fixed first pair and ordinary schedule while allowing only homogeneous selected-only control, already excluded by the witness.", + "Treating cover-map counts as zero-cost physical address operations.", + "Recreating the pending complete local decoder or early-record/output-bank coalescing already under investigation without a distinct audit or changed premise.", + "Treating a completed-output defect inequality as a producer-interior, dirty-range or physical-cost certificate." + ], + "overlap_terms": [ + "QQ16", + "joint-query", + "changing-chart controller", + "selected observation", + "1969", + "2540", + "early record", + "output-bank retention", + "complete native decoder", + "2965", + "producer defect", + "dirty-helper range", + "F17 consumer" + ] + }, + "scope_status": "refined", + "actual_scope": "Lift the single PR3189 B1,2 eighteenth-position child-error witness through the literal local native suffix, including occupied residual adapters; certify one 512-component direction and its final helper defects.", + "scope_change_reason": "PR3189 explicitly leaves this local native lift open. This tests one producer precision implication rather than repeating decoder constants, ideal scalar range or all-child censuses.", + "bottleneck_link": "An exact-scalar precision budget must survive actual native child errors. The projected witness now has a finite local native realization, while producer rounding/restoration and consumer cost remain open.", + "budget_minutes": 60, + "stop_rule": "Stop after the one named suffix and independent arithmetic/failure controls. Do not infer a global native guard, actual rounded child, supplier admission or favorable complete invoice.", + "outcome": "completed", + "evidence": "RESULT.json; source-authenticated Gaussian-dyadic suffix replay; independently implemented sparse Fraction full forward trace/endpoints and four reverse-adjoint components; nine behavioral control groups.", + "author": "commdata2338", + "ai_assistance": "Substantial OpenAI Codex assistance in derivation, implementation, checking and writing. No independent human review is claimed.", + "open_questions": [ + { + "question": "Can an actual completed child exclude or correctly price this error direction?", + "why_it_matters": "Exact-gate producer budgets require a receiver-compatible defect lattice or an explicit scalar rounding charge.", + "first_step": "Pin a concrete 226-to-236 child on L344, its input bound and returned-value/defect lattices, then test the literal receiver suffix.", + "blocked_by": "A specified finite child implementation and dirty-input/grid contract." + }, + { + "question": "Can the local error guarantee be extended to the actual global caller while restoring borrowed helpers?", + "why_it_matters": "The local witness does not establish a full producer/consumer or its cost.", + "first_step": "Bind the retained-core embedding and owner placement, propagate actual errors, and charge native arithmetic, movement, storage and F17 consumption together.", + "blocked_by": "Global embedding, restoration, physical owner and complete-cost contracts." + } + ], + "scope_key": "42581d429acc9509d503/PR3189/B1_2/13489-L344/26472-L93/native-error-lattice", + "milestone": "finite certificate and scoped producer-interface audit", + "family_decision": "narrow-and-stop", + "selection": { + "method": "Specific released handoff on the joint-query-controller track, after checking #1166 and newer canonical evidence; the card was retrieved with --task.", + "track": "recursive-interfaces", + "task_id": "joint-query-controller", + "retrieval_nonce": "134d1a219519996a25815ea6f535e427", + "catalogue_scope_key": "42581d429acc9509d503", + "existing_checks": [], + "coverage_interpretation": "Empty catalogue coverage is unknown. Read newer retained packages and canonical threads before selection.", + "handoff": "PR3189 Open next questions, second question: lift the L344 defect after B1,2 event 13489 through actual native recipes to event 26472." + }, + "canonical_thread": "https://github.com/CrocSwap/integer-mult-bounds/discussions/2727", + "predecessors": [ + { + "pr": 3189, + "head": "70537595e46444c8a63455523d9851a5efe55385", + "author": "Tekalign (tekuuu)", + "role": "projected child-error lattice witness and native-lift handoff" + }, + { + "pr": 3181, + "head": "80fc72d14546088e9fce3c06dc12bc67270da0af", + "author": "dcharb78", + "role": "ideal scalar grid/range proposal audited by PR3189; not used as an established precision theorem" + }, + { + "pr": 3017, + "head": "0f493f4c264fbc70ee14364b68af260d858c143c", + "author": "Tekalign (tekuuu)", + "role": "live exact vector primitives and native event semantics" + }, + { + "pr": 3067, + "head": "e1e28b4070ae52efa5a9d0aa826bc588be7206f2", + "author": "Ross Richardson", + "role": "physical F0 execution methodology" + }, + { + "pr": 2965, + "head": "526f2c242202b31b15e09a7502dfb8ff757b2bad", + "author": "Nick Petalas", + "role": "conditional completed-output transfer motivation" + } + ], + "boundary": { + "inputs": "one Gaussian-integer vector w=T_236 ONE inserted after child13489 on L344; all other error fields zero", + "domain": "one 512-coordinate local payload factor, B_1_2 suffix13490..27018", + "outputs": "full local error endpoint; intermediate L93 coefficient -81921/262144 at26472", + "restoration": "six borrowed helper fields retain errors; private error is zero", + "inherited": "exact native recipe/access semantics; the primary dispatcher adapts PR3017/3067 conventions" + }, + "cost_ledger": { + "unchanged_word": "No new primitive or saving is proposed; all original operations remain.", + "proved": "Local exact response and completed-event component lattice for one error direction.", + "unknown": [ + "actual native child rounding/correlations", + "dirty-input bounds", + "global embedding and owner placement", + "recipe-internal finite arithmetic", + "storage/movement and cleanup cost", + "F17 consumer and complete recursive invoice" + ] + }, + "limits": [ + "No full B1 cover sweep replay", + "No global 73-axis grid or all-depth theorem", + "No arbitrary-direction native upper bound", + "No rounded child realization", + "No supplier or kappa change", + "No full predecessor or selected cold replay", + "No independent human review or hosted CI claim" + ], + "refresh_checkpoint": { + "utc": "2026-10-17T17:40:15.120680+00:00", + "canonical_main": "463113d675af7410ac91d53a4fed51ec6494eb9a", + "priority_revision": 6, + "relevant_changes": [], + "decision": "Continue the bounded local audit with frozen source inputs; no relevant main changes." + }, + "overlap": { + "entry_queries": [ + "--task joint-query-controller", + "noise lattice / noise-lattice / 18-bit / 13489", + "3189 / child-error lattice / 13489 / native noise" + ], + "entry_coverage": { + "open_prs_fetched_at": "2026-10-17T17:04:11.636955+00:00", + "open_prs_records": 245, + "discussions_fetched_at": "2026-10-17T17:04:42.538402+00:00", + "discussions_records": 1985, + "complete_pagination": true + }, + "latest_board_read": "2026-10-17T17:39:04.580509+00:00", + "claim_url": "https://github.com/CrocSwap/integer-mult-bounds/discussions/2727#discussioncomment-19001776", + "nearest_work": "PR3189 explicitly leaves this local native lift open. PR3181 covers ideal/projected quantities; PR3017/3036/3067 and qq16-native-rounded-components cover different F0 faults. Concurrent bounded F0 exact-grid and F0-to-B1 error-envelope tasks have different scopes.", + "limits": "Non-atomic cached metadata plus current main, not a search of every diff or unpublished result.", + "final_query": "13489 AND L344 (offline helper; also reread #1166 and #2727)", + "final_coverage": { + "open_prs_fetched_at": "2026-10-17T17:37:12.534077+00:00", + "open_prs_records": 251, + "discussions_fetched_at": "2026-10-17T17:39:04.580509+00:00", + "discussions_records": 2015, + "complete_pagination": true + }, + "final_result": "Only the predecessor, this contribution and its own public claim matched the precise object. Concurrent #2727 claims concern a bounded F0 exact grid and a two-stage norm envelope; neither duplicates this native channel." + }, + "validation": { + "utc": "2026-10-17T17:41:07.310330+00:00", + "environment": "Linux, CPython 3.12.3, standard library only", + "registered_replay": "PASS_REGISTERED_RESEARCH_PACKAGE; full primary receipt, independent full trace/endpoint and four adjoints, 9 behavioral tests passed", + "focused_final_tests": "9 tests, 17.691 seconds, OK", + "optimized": "Primary verify.py and the final independent.py both passed under -Werror -I -O -B", + "baseline": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY; orientation only", + "not_run": [ + "selected cold replay", + "full predecessor suites", + "all-child native guard census", + "native rounded child or global caller execution", + "formal proof kernel", + "hosted CI" + ] + } +} diff --git a/research/qq16-native-noise-lift/VERIFY.json b/research/qq16-native-noise-lift/VERIFY.json new file mode 100644 index 0000000000..7b3b192087 --- /dev/null +++ b/research/qq16-native-noise-lift/VERIFY.json @@ -0,0 +1,47 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/community-frontier1042-audit/selected-replay.tar.gz", + "research/joint-query/certificate.json.gz", + "research/qq16-native-dirty-fault/native.py", + "research/qq16-noise-lattice-audit/RESULT.json" + ], + "commands": [ + { + "argv": [ + "{python}", + "-Werror", + "-I", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "Complete exact native error-channel receipt, projected positive control, 17/18 grid distinction and full local endpoint." + }, + { + "argv": [ + "{python}", + "-Werror", + "-I", + "-B", + "{package}/independent.py" + ], + "timeout_seconds": 180, + "checks": "Separate sparse Fraction complete forward trace, all completed-event denominators and every endpoint; four reverse-adjoint component checks." + }, + { + "argv": [ + "{python}", + "-Werror", + "-I", + "-B", + "{package}/test_verify.py" + ], + "timeout_seconds": 180, + "checks": "Nine behavioral groups for source/site binding, native phase, timing/frame, residual orientation, scalar sign, zero/scaling, adjoints and typed receipts." + } + ] +} diff --git a/research/qq16-native-noise-lift/independent.py b/research/qq16-native-noise-lift/independent.py new file mode 100644 index 0000000000..4178ffe09e --- /dev/null +++ b/research/qq16-native-noise-lift/independent.py @@ -0,0 +1,292 @@ +#!/usr/bin/env python3 +"""Independent sparse Fraction forward and reverse checks; no native imports. + +Prepared for commdata2338 with substantial OpenAI Codex assistance. Apache-2.0. +The explicit injected vector is a witness input, not an oracle for the response. +""" +from fractions import Fraction as F +import gzip +import hashlib +import json +from pathlib import Path +import tarfile + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +PINS = { + 'research/joint-query/certificate.json.gz': 'a5ed85fac5ebf3c091482a113ab0d351eb5a7892fe2841a35e16017ec1ff49f7', + 'research/community-frontier1042-audit/selected-replay.tar.gz': '22c3f4dce4b897a1d423d1388801933e288b6a6b1906cb15e1b16a5eb68db754', +} + + +def require(ok, message): + if not ok: + raise ValueError(message) + + +def load(): + for name, pin in PINS.items(): + require(hashlib.sha256((ROOT / name).read_bytes()).hexdigest() == pin, 'independent source pin') + p = json.loads(gzip.decompress((ROOT / 'research/joint-query/certificate.json.gz').read_bytes())) + events = [] + for e in p['programs']['B_1_2']: + if e[0] == 'retained_core': + require(e[1:3] == ['backward', 1], 'backward core') + events.extend(p['core_words']['backward']) + elif e[0] in ('private_sweep', 'cover_sweep'): + events.extend(e[2]) + else: + events.append(e) + require(len(events) == 27019, 'event count') + require(events[13489] == ['climb', 'A', 344, 226, 236, 1], 'origin') + require(events[26472] == ['scalar', ['add', ['L', 93], ['L', 103], -1, 8], 1], 'target') + with tarfile.open(ROOT / 'research/community-frontier1042-audit/selected-replay.tar.gz') as arc: + recipes = json.load(arc.extractfile('slots/local/CLIFFORD-RECIPES.json')) + residuals = json.load(arc.extractfile('slots/local/RESIDUAL-ADAPTERS.json')) + return events, recipes, residuals + + +def wire(token): + require(token[0] in ('L', 'C'), 'wire type') + return token[1] + (704 if token[0] == 'C' else 0) + + +def plus(a, b, coefficient=F(1)): + result = dict(a) + for x, (r, i) in b.items(): + oldr, oldi = result.get(x, (F(0), F(0))) + z = oldr + coefficient*r, oldi + coefficient*i + if z == (0, 0): + result.pop(x, None) + else: + result[x] = z + return result + + +def scale(a, coefficient): + return {x: (r*coefficient, i*coefficient) for x, (r, i) in a.items() if coefficient} + + +def rotation(z, angle): + r, i = z + for _ in range(angle % 4): + r, i = -i, r + return r, i + + +def permutation(record): + require(len(record['matrix_rows']) == 9, 'nine-axis monomial') + table = [] + for x in range(512): + y = record['offset'] + for k, row in enumerate(record['matrix_rows']): + y ^= ((row & x).bit_count() & 1) << k + angle = record['phase'] + for a in range(9): + if (x >> a) & 1: + angle += record['linear_Z4'][a] + for b in range(a+1, 9): + if ((x >> b) & 1) and ((record['quadratic_rows'][a] >> b) & 1): + angle += 2 + table.append((y, angle % 4)) + require(len({y for y, _ in table}) == 512, 'permutation bijection') + return table + + +def mono(value, record, adjoint): + if not value: + return {} + result = {} + for x, (y, phase) in enumerate(permutation(record)): + source, target, angle = (y, x, -phase) if adjoint else (x, y, phase) + if source in value: + result[target] = rotation(value[source], angle) + return result + + +def gaussian(value, axis, sign): + """C_axis or its adjoint from the two translation coefficients.""" + result = {} + for x, (r, i) in value.items(): + for y, z in ((x, ((r-sign*i)/2, (i+sign*r)/2)), + (x ^ axis, ((r+sign*i)/2, (i-sign*r)/2))): + old = result.get(y, (F(0), F(0))) + total = old[0] + z[0], old[1] + z[1] + if total != (0, 0): + result[y] = total + else: + result.pop(y, None) + return result + + +def native_adjoint(value, recipe): + value = mono(value, recipe['left'], True) + for j in reversed(range(recipe['rank'])): + value = gaussian(value, 1 << j, -1) + if recipe['rank']: + value = mono(value, recipe['right'], True) + else: + require(recipe['right'] is None, 'rank-zero native') + return value + + +def native_forward(value, recipe): + if recipe['rank']: + value = mono(value, recipe['right'], False) + for j in range(recipe['rank']): + value = gaussian(value, 1 << j, 1) + else: + require(recipe['right'] is None, 'rank-zero native') + return mono(value, recipe['left'], False) + + +def encoded(value): + """Canonical full vector, independently reduced from Fraction components.""" + exponent = 0 + for pair in value.values(): + for v in pair: + require(v.denominator & (v.denominator-1) == 0, 'Gaussian dyadic component') + exponent = max(exponent, v.denominator.bit_length()-1) + real, imag = [0]*512, [0]*512 + for x, (r, i) in value.items(): + real[x] = r.numerator * ((1 << exponent) // r.denominator) + imag[x] = i.numerator * ((1 << exponent) // i.denominator) + return real, imag, exponent + + +def json_bytes(value): + return json.dumps(value, sort_keys=True, separators=(',', ':')).encode() + + +def full_forward(events, recipes, residuals, witness): + children = {(r['old'], r['new']): r for r in recipes['children']} + endpoints = {(r['role'], r['port']): r for r in recipes['endpoint_adapters']} + state = [{} for _ in range(712)] + state[344] = {x: (F(a, 1 << witness['exponent']), F(b, 1 << witness['exponent'])) + for x, (a, b) in enumerate(zip(witness['real'], witness['imag'])) if a or b} + trace, peak, cut = hashlib.sha256(), witness['exponent'], None + for at in range(13490, len(events)): + e = events[at] + if e[0] == 'scalar': + g, d = e[1], wire(e[1][1]) + if g[0] == 'clear': + require(d >= 704, 'owned private clear') + state[d] = {} + elif g[0] == 'scale': + state[d] = scale(state[d], F(g[2], g[3])) + else: + require(g[0] == 'add', 'known scalar') + state[d] = plus(state[d], state[wire(g[2])], F(g[3], g[4])) + elif e[0] == 'climb': + _, _, d, old, new, rank = e + require(children[old, new]['rank'] == rank, 'rank binding') + state[d] = native_forward(state[d], children[old, new]) + elif e[0] == 'adapter': + _, direction, d, _ = e + if direction == 'old_to_new' and d < 112: + state[d] = mono(state[d], endpoints['source', d]['left'], False) + elif direction == 'new_to_old' and 112 <= d < 224: + state[d] = mono(state[d], endpoints['target', d-112]['left'], True) + else: + require(direction in ('old_to_new', 'new_to_old'), 'adapter direction') + elif e[0] == 'residual_adapter': + direction, d, a = e[1:4] + b = e[4] if len(e) == 5 else 1 + require(direction in ('pre', 'post'), 'residual direction') + key = str(a) if b == 1 else f'{a}:{b}' + part = 'right' if direction == 'pre' else 'left' + state[d] = mono(state[d], residuals['recipes'][key][part], True) + else: + require(e[0] == 'phase', 'unknown event in local suffix') + continue + packed = encoded(state[d]) + peak = max(peak, packed[2]) + trace.update(json_bytes([at, d, hashlib.sha256(json_bytes(packed)).hexdigest()]) + b'\n') + if at == 26472: + cut = dict(state[93]) + return state, peak, trace.hexdigest(), cut + + +def dual_channel(events, recipes, residuals, target=26472, output=93, coordinate=0): + children = {(r['old'], r['new']): r for r in recipes['children']} + endpoints = {(r['role'], r['port']): r for r in recipes['endpoint_adapters']} + state = [{} for _ in range(712)] + state[output] = {coordinate: (F(1), F(0))} + for at in range(target, 13489, -1): + e = events[at] + if e[0] == 'scalar': + g, d = e[1], wire(e[1][1]) + if g[0] == 'clear': + state[d] = {} + elif g[0] == 'scale': + state[d] = scale(state[d], F(g[2], g[3])) + else: + require(g[0] == 'add', 'known scalar') + s = wire(g[2]) + state[s] = plus(state[s], state[d], F(g[3], g[4])) + elif e[0] == 'climb': + _, _, d, old, new, rank = e + require(children[old, new]['rank'] == rank, 'rank binding') + state[d] = native_adjoint(state[d], children[old, new]) + elif e[0] == 'adapter': + _, direction, d, _ = e + if direction == 'old_to_new' and d < 112: + state[d] = mono(state[d], endpoints['source', d]['left'], True) + elif direction == 'new_to_old' and 112 <= d < 224: + state[d] = mono(state[d], endpoints['target', d-112]['left'], False) + else: + require(direction in ('old_to_new', 'new_to_old'), 'adapter direction') + elif e[0] == 'residual_adapter': + direction, d, a = e[1:4] + b = e[4] if len(e) == 5 else 1 + require(direction in ('pre', 'post'), 'residual direction') + key = str(a) if b == 1 else f'{a}:{b}' + part = 'right' if direction == 'pre' else 'left' + state[d] = mono(state[d], residuals['recipes'][key][part], False) + else: + require(e[0] == 'phase', 'unknown event in local suffix') + return state[344] + + +def inner(dual, witness): + real, imag = F(0), F(0) + for x, (r, i) in dual.items(): + a, b = F(witness['real'][x], 1 << witness['exponent']), F(witness['imag'][x], 1 << witness['exponent']) + real += r*a + i*b + imag += r*b - i*a + return real, imag + + +def main(): + events, recipes, residuals = load() + receipt = json.loads((HERE / 'RESULT.json').read_text()) + witness = receipt['native']['injection'] + require(witness['exponent'] == 0 and len(witness['real']) == len(witness['imag']) == 512, + 'integer witness shape') + require(all(type(v) is int and v in (-1, 0, 1) for v in witness['real'] + witness['imag']), + 'witness components') + require(sum(v*v for v in witness['real'] + witness['imag']) == 512, 'witness norm') + state, peak, trace, cut = full_forward(events, recipes, residuals, witness) + require(peak == 18, 'independent complete-event guard') + require(trace == receipt['native']['changed_field_trace_sha256'], 'complete forward trace') + require(cut == {x: (F(-81921, 262144), F(0)) for x in range(512)}, 'whole attaining vector') + require({str(i) for i, v in enumerate(state) if v} == set(receipt['nonzero_outputs']), + 'complete endpoint support') + for i, value in enumerate(state): + if value: + require(hashlib.sha256(json_bytes(encoded(value))).hexdigest() + == receipt['nonzero_outputs'][str(i)]['sha256'], 'complete endpoint vector') + print('PASS_QQ16_NATIVE_NOISE_FORWARD guard=18 complete_trace_and_endpoint=matched') + dual = dual_channel(events, recipes, residuals) + value = inner(dual, witness) + require(value == (F(-81921, 262144), F(0)), 'independent native coefficient') + require((value[0] * (1 << 17)).denominator == 2, 'seventeen-bit rejection') + for output, expected in ((75, (F(-1, 2), F(0))), (93, (F(1, 2), F(0))), + (337, (F(0), F(1, 2)))): + final_dual = dual_channel(events, recipes, residuals, len(events)-1, output, 0) + require(inner(final_dual, witness) == expected, 'independent final component') + print('PASS_QQ16_NATIVE_NOISE_DUAL coefficient=-81921/262144 checks=4 coordinate=0') + + +if __name__ == '__main__': + main() diff --git a/research/qq16-native-noise-lift/test_verify.py b/research/qq16-native-noise-lift/test_verify.py new file mode 100644 index 0000000000..ab9c27a7ee --- /dev/null +++ b/research/qq16-native-noise-lift/test_verify.py @@ -0,0 +1,132 @@ +#!/usr/bin/env python3 +"""Behavioral controls for the exact local native noise witness. Apache-2.0.""" +from copy import deepcopy +from fractions import Fraction as Q +from pathlib import Path +import tempfile +import types +import unittest + +HERE = Path(__file__).resolve().parent + + +def module(name): + path = HERE / (name + '.py') + result = types.ModuleType(name) + result.__file__ = str(path) + exec(compile(path.read_bytes(), str(path), 'exec'), result.__dict__) + return result + + +V, D = module('verify'), module('independent') + + +class NativeNoiseTests(unittest.TestCase): + @classmethod + def setUpClass(cls): + cls.N, cls.packet, cls.word, cls.recipes, cls.residuals = V.load() + cls.events = V.expand(cls.packet) + cls.state, cls.report, cls.cut = V.native_channel( + cls.N, cls.events, cls.word, cls.recipes, cls.residuals) + + def run_channel(self, events=None, recipes=None, **kwargs): + return V.native_channel(self.N, self.events if events is None else events, + self.word, self.recipes if recipes is None else recipes, + self.residuals, **kwargs) + + def test_completed_event_grid_and_endpoint(self): + self.assertEqual(self.cut, self.N.scaled(self.N.ONE, Q(-81921, 262144))) + self.assertEqual(self.report['guard'], 18) + self.assertEqual(self.report['first_attainment'], [26472, 93]) + self.assertEqual(self.state[75], self.N.scaled(self.N.ONE, Q(-1, 2))) + self.assertEqual(self.state[93], self.N.scaled(self.N.ONE, Q(1, 2))) + self.assertEqual([i for i in range(224, 704) if self.state[i] != self.N.ZERO], + [337, 338, 339, 341, 343, 346]) + self.assertTrue(all(v == self.N.ZERO for v in self.state[704:])) + self.assertEqual((V.EXPECTED * 2**17).denominator, 2) + self.assertEqual((V.EXPECTED * 2**18).denominator, 1) + + def test_zero_and_signed_dyadic_scaling(self): + state, report, cut = self.run_channel(injection=self.N.ZERO) + self.assertTrue(all(v == self.N.ZERO for v in state)) + self.assertEqual(report['guard'], 0) + self.assertEqual(cut, self.N.ZERO) + source = self.N.frame(self.word['frames'][236]) + state, report, cut = self.run_channel(injection=self.N.scaled(source, Q(-1, 8))) + self.assertEqual(state, [self.N.scaled(v, Q(-1, 8)) for v in self.state]) + self.assertEqual(cut, self.N.scaled(self.cut, Q(-1, 8))) + self.assertEqual(report['guard'], 21) + + def test_child_global_phase_is_material(self): + recipes = deepcopy(self.recipes) + entry = next(r for r in recipes['children'] if (r['old'], r['new']) == (236, 240)) + entry['left']['phase'] = (entry['left']['phase'] + 1) % 4 + _, _, bad_cut = self.run_channel(recipes=recipes, stop=V.TARGET) + self.assertNotEqual(bad_cut, self.cut) + + def test_injection_frame_and_timing_are_material(self): + _, _, bad_frame = self.run_channel(injection=self.N.ONE, stop=V.TARGET) + _, _, bad_time = self.run_channel(origin=V.ORIGIN-1, stop=V.TARGET) + self.assertNotEqual(bad_frame, self.cut) + self.assertNotEqual(bad_time, self.cut) + + def test_residual_orientation_is_material(self): + events = deepcopy(self.events) + self.assertEqual(events[26796][0:3], ['residual_adapter', 'post', 337]) + events[26796][1] = 'pre' + state, _, cut = self.run_channel(events=events) + self.assertEqual(cut, self.cut) + self.assertNotEqual(state[337], self.state[337]) + + def test_attaining_scalar_sign_is_material(self): + events = deepcopy(self.events) + events[V.TARGET][1][3] *= -1 + _, _, bad_cut = self.run_channel(events=events, stop=V.TARGET) + self.assertNotEqual(bad_cut, self.cut) + _, _, bad_trace, independent_cut = D.full_forward( + events, self.recipes, self.residuals, self.report['injection']) + self.assertNotEqual(bad_trace, self.report['changed_field_trace_sha256']) + self.assertNotEqual(independent_cut, {x: (V.EXPECTED, Q(0)) for x in range(512)}) + + def test_source_and_site_bindings_fail_closed(self): + # Only corrupt local disposable bytes; the real immutable input is never edited. + with tempfile.TemporaryDirectory(prefix='noise-pin-', dir=HERE) as tmp: + root = Path(tmp) + path = root / 'research/community-frontier1042-audit/selected-replay.tar.gz' + path.parent.mkdir(parents=True) + path.write_bytes(b'corrupt archive control') + with self.assertRaisesRegex(ValueError, 'source pin'): + V.load(root) + packet = deepcopy(self.packet) + packet['core_words']['backward'][V.ORIGIN-1864][2] = 345 + with self.assertRaisesRegex(ValueError, 'injection child'): + V.expand(packet) + packet = deepcopy(self.packet) + packet['core_words']['backward'][-1] = ['unrecognized'] + with self.assertRaisesRegex(ValueError, 'suffix'): + V.expand(packet) + + def test_json_controls(self): + with self.assertRaisesRegex(ValueError, 'duplicate'): + V.decode(b'{"x": 1, "x": 2}') + self.assertNotEqual(V.canonical({'x': 1}), V.canonical({'x': True})) + self.assertNotEqual(V.canonical({'x': 1}), V.canonical({'x': '1'})) + + def test_independent_adjoint_identity(self): + a = {0: (Q(1, 8), Q(-2)), 37: (Q(3), Q(1, 4)), 511: (Q(-1), Q(0))} + b = {i: (Q(i % 7 - 3), Q(i % 5 - 2)) for i in range(512)} + recipe = next(r for r in self.recipes['children'] if (r['old'], r['new']) == (236, 240)) + def dense(v): + return self.N.vector([int(v.get(i, (0, 0))[0]*8) for i in range(512)], + [int(v.get(i, (0, 0))[1]*8) for i in range(512)], 3) + av = self.N.recipe(dense(a), recipe) + aw = {'real': av[0], 'imag': av[1], 'exponent': av[2]} + aa = dense(a) + source = {'real': aa[0], 'imag': aa[1], 'exponent': aa[2]} + result = D.inner(b, aw) + self.assertNotEqual(result, (0, 0)) + self.assertEqual(result, D.inner(D.native_adjoint(b, recipe), source)) + + +if __name__ == '__main__': + unittest.main() diff --git a/research/qq16-native-noise-lift/verify.py b/research/qq16-native-noise-lift/verify.py new file mode 100644 index 0000000000..1a6eb77827 --- /dev/null +++ b/research/qq16-native-noise-lift/verify.py @@ -0,0 +1,270 @@ +#!/usr/bin/env python3 +"""Exact local native lift of PR3189's one B1,2 child-error channel. + +Prepared for commdata2338, with substantial OpenAI Codex assistance. +Apache-2.0. Native vector primitives are credited live input from Tekalign/PR3017. +""" +import argparse +from collections import Counter +from fractions import Fraction as Q +import gzip +import hashlib +import json +from pathlib import Path +import tarfile +import types + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +ORIGIN, WIRE, TARGET, OUT = 13489, 344, 26472, 93 +EXPECTED = Q(-81921, 262144) +MEMBERS = { + 'slots/local/CANONICAL-WORD.json.gz': '16bc0ebb04b4be6c0ade74badc6a0c0cdba4215eda86e4ff9f13abf8ecebd219', + 'slots/local/CLIFFORD-RECIPES.json': 'd0768f2164d5f64a2fdbec422f1cfde4e400818792f1904ca541958377243731', + 'slots/local/RESIDUAL-ADAPTERS.json': '383f40aadd00a4ac700dfd0d4c22d6c6c0be9a9863116e4d69c7acd23bafae0c', +} + + +def need(ok, message): + if not ok: + raise ValueError(message) + + +def canonical(value): + return json.dumps(value, sort_keys=True, separators=(',', ':')).encode() + + +def digest(value): + return hashlib.sha256(canonical(value)).hexdigest() + + +def unique(pairs): + result = {} + for key, value in pairs: + need(key not in result, 'duplicate JSON key') + result[key] = value + return result + + +def decode(raw, cap=12_000_000): + need(len(raw) <= cap, 'JSON size cap') + return json.loads(raw, object_pairs_hook=unique) + + +def load(root=ROOT): + for entry in decode((HERE / 'SOURCES.json').read_bytes())['files']: + if entry['usage'] == 'input': + need(hashlib.sha256((root / entry['path']).read_bytes()).hexdigest() + == entry['sha256'], 'source pin: ' + entry['path']) + path = root / 'research/qq16-native-dirty-fault/native.py' + native = types.ModuleType('source_authenticated_native') + exec(compile(path.read_bytes(), str(path), 'exec'), native.__dict__) + packet = decode(gzip.decompress((root / 'research/joint-query/certificate.json.gz').read_bytes())) + need(packet['schema'] == 'conserved-qq16-full-cover-native-words-v1', 'packet schema') + objects = [] + with tarfile.open(root / 'research/community-frontier1042-audit/selected-replay.tar.gz') as archive: + for name, pin in MEMBERS.items(): + members = [m for m in archive.getmembers() if m.name == name] + need(len(members) == 1 and members[0].isfile() + and members[0].size <= 12_000_000, 'unique regular bounded member') + raw = archive.extractfile(members[0]).read() + need(hashlib.sha256(raw).hexdigest() == pin, 'archive member pin: ' + name) + objects.append(decode(gzip.decompress(raw) if name.endswith('.gz') else raw)) + prior = decode((root / 'research/qq16-noise-lattice-audit/RESULT.json').read_bytes()) + witness = prior['cases']['B_1_2']['child_attainment'] + need(witness['origin'] == {'event': ORIGIN, 'kind': 'climb', 'wire': WIRE} + and witness['attainment'] == {'event': TARGET, 'wire': OUT, + 'bits': 18, 'coefficient': str(EXPECTED)}, 'predecessor witness') + return native, packet, *objects + + +def expand(packet): + result, core_start = [], None + for e in packet['programs']['B_1_2']: + if e[0] == 'retained_core': + need(core_start is None and e[1:3] == ['backward', 1], 'one backward stage-one core') + core_start = len(result) + result.extend(packet['core_words']['backward']) + elif e[0] in ('private_sweep', 'cover_sweep'): + result.extend(e[2]) + else: + result.append(e) + need(core_start == 1864 and len(result) == 27019, 'expanded word binding') + need(result[ORIGIN] == ['climb', 'A', WIRE, 226, 236, 1], 'injection child') + need(result[TARGET] == ['scalar', ['add', ['L', OUT], ['L', 103], -1, 8], 1], 'attaining scalar') + need(all(e[0] in ('scalar', 'climb', 'adapter', 'residual_adapter', 'phase') + for e in result[ORIGIN + 1:]), 'suffix is wholly inside the local native core') + return result + + +def reg(token): + kind, at = token + need(kind in ('L', 'C') and type(at) is int + and 0 <= at < (704 if kind == 'L' else 8), 'register') + return at + (704 if kind == 'C' else 0) + + +def scalar_channel(events, origin=ORIGIN, wire=WIRE): + values = [Q(0)] * 712 + values[wire] = Q(1) + peak, attaining, cut = 0, None, None + for at in range(origin + 1, len(events)): + e = events[at] + if e[0] == 'scalar': + g, dst = e[1], reg(e[1][1]) + if g[0] == 'clear': + values[dst] = Q(0) + elif g[0] == 'scale': + values[dst] *= Q(g[2], g[3]) + else: + need(g[0] == 'add', 'scalar kind') + values[dst] += Q(g[3], g[4]) * values[reg(g[2])] + bits = values[dst].denominator.bit_length() - 1 + if bits > peak: + peak, attaining = bits, [at, dst, str(values[dst])] + if at == TARGET: + cut = values[OUT] + return {'guard': peak, 'first_attainment': attaining, 'target': str(cut), + 'endpoint': [str(v) for v in values]} + + +def indexes(recipes): + children = {(r['old'], r['new']): r for r in recipes['children']} + endpoints = {(r['role'], r['port']): r for r in recipes['endpoint_adapters']} + need(len(children) == len(recipes['children']) and len(endpoints) == 224, 'recipe uniqueness') + return children, endpoints + + +def step(N, e, state, children, endpoints, residuals): + kind = e[0] + if kind == 'scalar': + g, dst = e[1], reg(e[1][1]) + if g[0] == 'clear': + need(dst >= 704, 'owned CLEAR only') + state[dst] = N.ZERO + elif g[0] == 'scale': + state[dst] = N.scaled(state[dst], Q(g[2], g[3])) + else: + need(g[0] == 'add', 'scalar operation') + state[dst] = N.plus(state[dst], N.scaled(state[reg(g[2])], Q(g[3], g[4]))) + elif kind == 'climb': + _, _, dst, old, new, rank = e + recipe = children[old, new] + need(recipe['rank'] == rank, 'child rank') + if state[dst] != N.ZERO: + state[dst] = N.recipe(state[dst], recipe) + elif kind == 'adapter': + _, direction, dst, _ = e + need(direction in ('old_to_new', 'new_to_old'), 'adapter direction') + if direction == 'old_to_new' and dst < 112: + state[dst] = N.mono(state[dst], N.monomial_key(endpoints['source', dst]['left'])) + elif direction == 'new_to_old' and 112 <= dst < 224: + state[dst] = N.mono(state[dst], N.monomial_key(endpoints['target', dst-112]['left']), True) + elif kind == 'residual_adapter': + direction, dst, a = e[1:4] + b = e[4] if len(e) == 5 else 1 + need(direction in ('pre', 'post'), 'residual direction') + key = str(a) if b == 1 else f'{a}:{b}' + part = 'right' if direction == 'pre' else 'left' + state[dst] = N.mono(state[dst], N.monomial_key(residuals['recipes'][key][part]), True) + else: + need(kind == 'phase', 'unknown local native event') + return None + return dst + + +def summary(value): + re, im, exponent = value + return {'denominator_exponent': exponent, 'sha256': digest(value), + 'real_histogram': dict(sorted(Counter(str(Q(v, 1 << exponent)) for v in re).items())), + 'imag_histogram': dict(sorted(Counter(str(Q(v, 1 << exponent)) for v in im).items())), + 'squared_norm': str(Q(sum(v*v for v in re + im), 1 << (2*exponent)))} + + +def native_channel(N, events, word, recipes, residuals, origin=ORIGIN, wire=WIRE, + injection=None, stop=None): + children, endpoints = indexes(recipes) + injected = N.frame(word['frames'][236]) if injection is None else injection + state = [N.ZERO] * 712 + state[wire] = injected + cut, first, peak, max_component = None, None, injected[2], Q(0) + trace = hashlib.sha256() + occupied = Counter() + occupied_residuals = [] + occupied_native_events = [] + for at in range(origin + 1, (stop + 1) if stop is not None else len(events)): + e = events[at] + dst = step(N, e, state, children, endpoints, residuals) + if dst is not None: + value = state[dst] + if value != N.ZERO: + occupied[e[0]] += 1 + if e[0] not in ('scalar', 'phase'): + occupied_native_events.append([at, e]) + if e[0] == 'residual_adapter': + occupied_residuals.append([at, dst, digest(value)]) + if value[2] > peak: + peak = value[2] + first = [at, dst] + bound = Q(max(abs(v) for v in value[0] + value[1]), 1 << value[2]) + max_component = max(max_component, bound) + trace.update(canonical([at, dst, digest(value)]) + b'\n') + if at == TARGET: + cut = state[OUT] + return state, {'injection': {'real': list(injected[0]), 'imag': list(injected[1]), + 'exponent': injected[2], **summary(injected)}, + 'target': summary(cut) if cut is not None else None, + 'guard': peak, 'first_attainment': first, + 'max_abs_component': str(max_component), + 'changed_field_trace_sha256': trace.hexdigest(), + 'occupied_event_counts': dict(sorted(occupied.items())), + 'occupied_native_events': occupied_native_events, + 'occupied_residuals': occupied_residuals}, cut + + +def build(root=ROOT): + N, packet, word, recipes, residuals = load(root) + events = expand(packet) + projection = scalar_channel(events) + need(projection['target'] == str(EXPECTED) and projection['guard'] == 18, 'projection positive control') + state, result, cut = native_channel(N, events, word, recipes, residuals) + need(cut == N.scaled(N.ONE, EXPECTED), 'native attaining vector') + need(result['guard'] == 18, 'physical completed-event guard') + need(result['injection']['exponent'] == 0, 'integer Gaussian injection') + need(set(result['injection']['real'] + result['injection']['imag']) <= {-1, 0, 1}, 'bounded injection') + need(Q(result['injection']['squared_norm']) == 512, 'injection norm') + need((EXPECTED * (1 << 17)).denominator == 2, 'seventeen-position negative control') + need((EXPECTED * (1 << 18)).denominator == 1, 'eighteen-position positive control') + output = {str(i): summary(v) for i, v in enumerate(state) if v != N.ZERO} + return {'schema': 'qq16-native-noise-lift/v1', 'program': 'B_1_2', + 'core_offset': 1864, 'event_count': len(events), + 'origin': {'event': ORIGIN, 'wire': WIRE, 'instruction': events[ORIGIN]}, + 'attainment': {'event': TARGET, 'wire': OUT, 'instruction': events[TARGET], + 'coefficient': str(EXPECTED)}, + 'suffix_event_counts': dict(sorted(Counter(e[0] for e in events[ORIGIN+1:]).items())), + 'suffix_sha256': digest(events[ORIGIN+1:]), + 'projection': projection, 'native': result, 'nonzero_outputs': output, + 'nonzero_data_fields': [i for i in range(224) if state[i] != N.ZERO], + 'nonzero_helpers': [i for i in range(224, 704) if state[i] != N.ZERO], + 'nonzero_private': [i for i in range(704, 712) if state[i] != N.ZERO]} + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--write', type=Path, help='exclusively create an absent receipt') + args = parser.parse_args() + result = build() + if args.write: + with args.write.open('x') as stream: + json.dump(result, stream, indent=2, sort_keys=True) + stream.write('\n') + else: + want = decode((HERE / 'RESULT.json').read_bytes()) + need(canonical(result) == canonical(want), 'complete receipt differs') + print('PASS_QQ16_NATIVE_NOISE_LIFT guard=18 coefficient=-81921/262144' + f" data_fields={len(result['nonzero_data_fields'])}" + f" helpers={len(result['nonzero_helpers'])} private={len(result['nonzero_private'])}") + + +if __name__ == '__main__': + main()