diff --git a/research/staged-644-660-native-binding-audit/README.md b/research/staged-644-660-native-binding-audit/README.md new file mode 100644 index 0000000000..876eee751e --- /dev/null +++ b/research/staged-644-660-native-binding-audit/README.md @@ -0,0 +1,271 @@ +# Staged helpers 644/660: native entrance residual under a separate kernel + +**Finite native/interface audit; no new kappa, supplier admission or frontier change.** + +PR3605 lowers helpers 644 and 660 from width 8 to width 7 by letting them enter +at `span(429,30)` instead of `span(30)`. Its consumers reuse those STAGED +words: #3624, #3626, #3630, #3633 and #3638. PR3687 checked the words as exact +free-operator identities. Its first open question asks whether the **native +phases** of the paired `span(429,30)` entrance hold, checked without the `bw_*` +lineage code. This package answers that question for both providers and both +orientations. The answer is **yes**. + +- **The width-7 residual is exact.** Operators are written in product order, + with the rightmost acting first. The emitted recipe for + `span(429,30) -> FULL` satisfies `L · F_7 · R = T_FULL · T_E^-1` on all 512 + Gaussian columns, including global phase. The wrapped form + `L^-1 · T_FULL · T_E^-1 · R^-1 = F_7` and the inverse-transpose form follow + from it, and both are evaluated as well. The check uses Sagar Thakrar's + separately written kernel + `research/frontier1094-recipes-exact-seed76/clifford.py`, which imports no + repository code. No `bw_*` module takes part in it. +- **The emitted program uses exactly this recipe for 644 and 660.** The + unchanged producer emits one `pre`/`post` residual wrapper pair at frame + `[429,30]`, with no terminal field. There is one ordinary `new_to_old` exit + adapter at FULL and no private buffer, in both orientations. The climbs are + `[2,1,2,1,1]` for 644 and `[2,2,1,1,1]` for 660. Both sum to 7, and each of + the ten distinct climb recipes also passes the separate kernel. All 17 direct + scalar clocks per helper match the source word, including the 8 FULL-frame + cleanup gates. +- **Only this residual changes.** As a single-change control, the parent PR3133 + words go through the same producer. There, 644/660 enter at `span(30)` with + width 8, and their first climb is 3 instead of 2. Every climb ends at the + same frame as in the staged words; only the first climb's start differs. + Across all 408 helpers, only 644 and 660 change their entrance/terminal pair. + The serialized residual recipes go from 56 to 57, and the new one is + `([429,30], FULL)`. Counting the unwrapped cold class `([], FULL)`, which has + no recipe, the entrance/terminal pair classes go from 57 to 58. + +**The retimed and delayed consumer words keep this entrance residual.** Two +later word families move the releases that read 644/660. These are the +RETIMED644-660 words of #3642, which #3653 reuses byte for byte, and the DELAYED +words of #3682. All four consumer words (two families, two providers) go +through the same producer and binding, with PR3605's STAGED words as the +single-change control. The answer is again **yes**: + +- 644 and 660 still enter at `[429,30]` with key `137`. The width-7 recipe + passes the separate kernel on all 512 columns. Each reconstructed + residual-adapter file equals the STAGED one, so all 57 recipes and 72 warp + records are unchanged. No helper among the 408 changes its entrance/terminal + pair. +- In both orientations, 644/660 keep the STAGED emitted structure: one wrapper + pair at `[429,30]`, one `new_to_old` exit adapter at FULL, no private buffer, + and the STAGED climb frames and ranks. Apart from the clocks, one thing + changes: the moved release that reads each helper (`640 += 2*644`, + `656 -= 660`) now runs at `Q` instead of `[429,30]`. All 17 direct scalar + clocks and frames per helper match the consumer word. Binding the STAGED word to a + consumer program is rejected at the scalar/climb clock check. So the binding + sees the retiming rather than passing for any word. +- The first climb `span(429,30) -> Q` moves from B1045 to B592 (644) and from + B1085 to B642 (660) in RETIMED. In DELAYED it moves from B1045 to B1043 and + from B1085 to B1084. Here `Q` is `span(423,65,20,10)` for 644 and + `span(427,96,24,6)` for 660. +- Only the release donors 640 and 656 change their climbs. Each replaces climbs + `1,2` by one direct climb `span(30) -> Q` of rank 3, as #3642 and #3682 + describe (H1+H2 -> H3), and both merged climb recipes pass the separate + kernel. +- Each regenerated `LOCAL-CHECKS.json`, in LF form, equals the receipt that the + producing PR recorded from its own native run: `11743473…` (#3642) and + `7ff1aabb…` (#3682). So the programs checked here are the ones those runs + emitted. + +Expected verifier line: + +```text +PASS_STAGED_644_660_NATIVE_BINDING providers=2 helpers=644,660 entrance=span(429,30) terminal=FULL residual_width=7 parent_width=8 shared_key=137 climb_recipes=10 recipes=56->57 controls=7x2 single_change=2 both_orientations no_new_kappa consumers=RETIMED644-660,DELAYED consumer_width=7 consumer_key=137 consumer_pair_changes=0 recorded_receipts=4 merged_donor_climbs=2 +``` + +## What the check does + +For entrance `E` and terminal `U`, the native residual is `S(E,U) = T_U T_E^-1`. +The source compiler factors it as `S = L F_w R`, where `F_w` is the coordinate +Fourier primitive on the first `w` axes, and `w = dim U - dim E`. Here +`E = [429,30]`, `U = FULL` and `w = 7`; the other two axes are spectators. + +1. The verifier runs the pinned `bw_transport.py` and `bw_emit.py` (byte-identical + to the copies used by the #2979 group audits) on PR3605's two STAGED words. + It then binds every emitted event of helpers 644/660 to the source word. It + checks the wrapper entrance, the climb chain from `[429,30]` to FULL, the one + exit adapter, the event order (wrapper, climbs, exit, cleanup, wrapper) and + every direct scalar clock. +2. It rebuilds the serialized residual-adapter file with the source compiler, + and the separate kernel then checks the shared recipe (key `137`) and every + climb recipe. +3. It runs the parent PR3133 words through the same producer as the + single-change control above, and checks the parent's width-8 recipe too. +4. It rejects seven residual controls per provider. Three fail at the + all-column operator check: a global-phase change, the parent's right wrapper + substituted, and the same-dimension wrong plane `[429,18]`. Four fail at the + width check: no entrance, the contained line `[429]`, the old entrance `[30]` + and the parent recipe at the new entrance. +5. It runs each consumer word through the same producer and compares it with + the STAGED word of the same provider. It requires the recorded `LOCAL-CHECKS` + receipt, an identical residual-adapter file and identical entrance/terminal + pairs. For 644/660 it requires the full source-to-emission binding against + the consumer word, the STAGED recipe key with the kernel check, and the + STAGED climb frames. It also requires that only the + donors' climb chains change, each by one merged climb that the kernel + checks. Binding the STAGED word to the consumer program must be rejected. + +The words differ from the STAGED words only where #3642 and #3682 say. This +is a local observation from diffing the words; `verify.py` does not compute it. + +- **RETIMED** swaps B591/B592 and B641/B642, and raises each moved release + `640 += 2*644` and `656 -= 660` to `Q`. It regenerates the cleanup and the + reported local profile. +- **DELAYED** moves the same two releases to just before old B1045 and B1085, + at `Q`. It shifts the B cut (and nothing else) of 38 of the 72 warp entries + by one or two, and regenerates the cleanup and the reported local profile. + +`LOCAL-CHECKS.json` comes from `bw_emit.py`, which writes it with `write_text` +and so uses CRLF line ends on Windows. The verifier therefore digests its LF +form. The first two commits recorded the CRLF digest, which a Linux or macOS +replay would not reproduce. The LF digests are the ones that equal the +consumers' recorded receipts. + +`test_verify.py` adds corruptions that must fail through the same code paths. +These include a missing `post` wrapper, a wrong wrapper frame, a restored-helper +terminal field, a deleted or mis-ranked climb, and an entry adapter in place of +the exit adapter. They also cover a moved exit adapter, an added private +buffer, a sign-flipped scalar and the wrong orientation. Word, recipe and +source-pin corruptions are covered as well, including a corrupted DELAYED copy. +For the RETIMED base word, the tests check the recorded receipt and that the +RETIMED word does not bind the STAGED program. They then require each consumer +comparison to fail at its own check: a changed STAGED recipe, 644's entrance +swapped with donor 640's (which keeps the recipe set), a deleted non-donor +climb, and a donor that stops at `[429,30]`. One observation came from a wrong +test expectation. `[30,429]`, the same two vectors in the other order, passes +the identity, while `[435,30]`, another basis of the same plane, fails. So the +frame operator depends on the stored basis rather than only on the plane. The +wrong-entrance test therefore uses a different plane, `[430,30]`. + +## Sources + +The base is canonical main `20ecf2891d80b5acf18d980b2164fb44ea7faa90`, priority +revision 6 (κ = `0.001672660197076918`). [SOURCES.json](SOURCES.json) pins every +input by Git blob and SHA-256. + +- **Staged words.** `inputs/STAGED644-660-{base,extra}.json.gz` are byte copies + of `research/staged-644-660-width-reduction/STAGED644-660-*.json.gz` at PR3605 + head `3efbb5de06a49ffeea6684482f2d3fe48cdca3fb`. The repository's `head:` pin + must name the live path, so these copies are pinned as provenance rows under + their original path. The verifier checks the copies' bytes against those pins. + The hashes also match PR3605's `ARTIFACTS.json`. +- **Consumer words.** These are pinned in the same way, each at its PR head + under its original path. The verifier requires every pin of a copy to carry + the same SHA-256. + - `inputs/RETIMED644-660-{base,extra}.json.gz` are byte copies of + `research/staged-release-retiming-t530/local-audit/words/RETIMED644-660-*.json.gz` + at #3642 head `6568db75adbb61437190545f6fef1534c70e91e5`. They are also + byte copies of + `research/retimed-t488-composition/local-audit/words/RETIMED644-660-*.json.gz` + at #3653 head `607a09ff441c79b215a8127a81f4cc70021d0d9b`. + - `inputs/DELAYED-{base,extra}.json.gz` are byte copies of + `research/staged-donor-release/lead1-words/DELAYED-*.json.gz` at #3682 head + `431e6c6023ef352c41696469de7fb614cd4ded8c`. +- **Recorded consumer receipts.** These are #3642's + `local-audit/receipts/native-{base,extra}/native/local/LOCAL-CHECKS.json` and + #3682's `evidence/native-{base,extra}/LOCAL-CHECKS.json`, pinned at the same + heads. The verifier compares each regenerated receipt with the pinned SHA-256. + It does not read these files. +- **Consumer documents.** #3642's `PROOF.md`, #3653's `README.md` and #3682's + `PROOF.md` are pinned for the word changes described above. Every other + statement about these words comes from the word bytes themselves. +- **Parent words.** These are PR3133's `edits/FINAL-WORD-{base,extra}.json.gz` + on main. +- **Producer and compiler.** These are the retained t74-native-fast + `bw_transport.py`, `bw_emit.py` and `vendor/clifford/clifford_exact.py`. They + are producers, not independent evidence. + +PR3605's own registered chain already checks the emitted program with the +lineage code. `bw_audit_local.py` checks every residual wrapper, climb and +scalar frame, `bw_adapters.py` checks every entrance recipe, and both rely on +the `bw_gauss` kernel. `check_residual.py` checks the one changed `(E,U)` pair +with the same kernel. What was missing, as PR3687 says, is a check that does +not use that lineage. This package supplies one: the separate kernel for the +identity, plus its own source-to-emission binding. The same holds for the +consumers. #3642's pinned `PROOF.md` says its separate native runs check +ledger, wrapper, phase and warp contracts, and #3682's reports two five-stage +native runs. This package's regenerated `LOCAL-CHECKS` equal the receipts those +runs recorded. + +**Local-only cross-check (not part of the registered replay).** The producer's +own `bw_adapters.py` needs numpy. Under Python 3.13.1 and numpy 2.2.2 (not +PR3605's declared numpy 2.5.4), it wrote a `RESIDUAL-ADAPTERS.json` for each +provider. The LF-normalized bytes equal this package's reconstruction: +`a19e744f…` (base) and `c4ddd4db…` (extra). So the recipe checked here is the +one the native chain serializes. On Windows, `bw_adapters.py` writes CRLF +through `write_text`. This cross-check was run on the STAGED words only. The +package's reconstructions for the consumer words are byte-identical to these. + +## Reproduction + +```sh +python3 -I -B research/staged-644-660-native-binding-audit/verify.py +python3 -I -B research/staged-644-660-native-binding-audit/test_verify.py -v +python3 -B scripts/research_package.py --package research/staged-644-660-native-binding-audit --check-only +python3.12 -Werror -B scripts/research_package.py --package research/staged-644-660-native-binding-audit +``` + +These use only the Python 3.12 standard library. On a Windows 11 laptop the +verifier takes about 80 seconds (up to three minutes under load) and the tests +about 50 seconds. The PR heads must be present for the provenance pins: + +```sh +git fetch --no-tags origin refs/pull/3605/head refs/pull/3642/head refs/pull/3653/head refs/pull/3682/head refs/pull/3687/head +``` + +## Scope and unchecked obligations + +This checks the native entrance of the two changed helpers in the STAGED, +RETIMED and DELAYED words, and the merged donor climbs of the latter two. It +does not check: + +- the native phases of the other 56 serialized residual recipes, the 72 warp + records (240 emitted warp events) or the scalar macros under an independent + kernel; +- that the moved releases commute with the gates they cross. That is #3642's + and #3682's argument, and their free-operator checks. This package binds the + clocks at which the releases are emitted, not the operator they produce; +- any other climb or residual of the donors 640/656; +- owner journals, physical stock, prefix, precision and tape; +- the T740 release, the consumer releases (T530, T488, T360) and their κ; +- the inherited all-size compiler, analytic transfer and BIT hypotheses. + +A passing finite audit does not admit a supplier or change the selected record. + +## Open next questions + +The structured list is in [TASK.json](TASK.json). + +1. **Do all 57 serialized residual recipes and 72 warp records pass the + separate kernel?** Loop `check_recipe` over every reconstructed adapter key, + and check each warp record as a monomial identity. The STAGED, RETIMED and + DELAYED adapter files are identical, so one run covers all three families. +2. **Is the complete emitted 644/660 lane phase-exact under an independent + simulator?** This would need an emitted-event interpreter for the scalar + macros and warps, compared with PR3687's free-operator endpoint. It would + also check the moved releases natively. +3. **Which open PRs carry 644/660 words that differ from the STAGED, RETIMED + and DELAYED bytes?** This package covers exactly those six words. First + step: list the blob ids of `*644-660*.json.gz` and `DELAYED-*.json.gz` + files across open PR heads, and run the consumer comparison on any new + ones. + +## Credit + +- **Construction:** Ross Richardson's PR3605. +- **Parent words:** dcharb78's PR3133, with the word lineage credited there. +- **Consumer words:** roger-sato's #3642 (RETIMED, reused by rohanarun's + #3653) and zxv's #3682 (DELAYED). +- **Open question:** Sagar Thakrar's PR3687 posed the question answered here. +- **Separate kernel:** Sagar Thakrar's, from frontier1094-recipes-exact-seed76. +- **Producer lineage:** DreamingOfClouds/PR458, retained t74-native-fast + (PR2226 notices). +- **Method and code:** adapted from Wentao Li's + `research/rank7-group-d-native-widths-audit/`, which in turn adapts the + group A–C audits. + +Prepared by Mainzu with substantial assistance from Claude Code (Anthropic, +Claude Opus 5.5). No independent human or formal-kernel review is claimed. +Apache-2.0. diff --git a/research/staged-644-660-native-binding-audit/RESULT.json b/research/staged-644-660-native-binding-audit/RESULT.json new file mode 100644 index 0000000000..9afe8b52a8 --- /dev/null +++ b/research/staged-644-660-native-binding-audit/RESULT.json @@ -0,0 +1,2292 @@ +{ + "native": { + "climb_recipes": { + "[[256,136,64,32,24,4,2,1],[256,128,64,32,16,8,4,2,1]]": 1, + "[[256,136,66,34,24,6,1],[256,136,64,32,24,4,2,1]]": 1, + "[[257,128,65,32,17,9,5,3],[256,128,64,32,16,8,4,2,1]]": 1, + "[[260,128,65,32,20,9,3],[257,128,65,32,17,9,5,3]]": 1, + "[[290,136,96,24,6,1],[256,136,66,34,24,6,1]]": 1, + "[[292,131,65,20,10],[260,128,65,32,20,9,3]]": 2, + "[[423,65,20,10],[292,131,65,20,10]]": 1, + "[[427,96,24,6],[290,136,96,24,6,1]]": 2, + "[[429,30],[423,65,20,10]]": 2, + "[[429,30],[427,96,24,6]]": 2 + }, + "consumers": { + "DELAYED": { + "base": { + "adapter_sha256": "a19e744f741bf917a72d63aab09cf7e10f5566091458568747b97f7bf0ea945a", + "binding_sha256": { + "644": { + "backward": "df9c48ffab76b888ed085917c8754efa93d9cda0b321bc8ee07aa5ddc50fe2d1", + "forward": "df9c48ffab76b888ed085917c8754efa93d9cda0b321bc8ee07aa5ddc50fe2d1" + }, + "660": { + "backward": "c702b044c9511c842820db12df80dbb207b46d9780420f49da7625e45068f6c8", + "forward": "c702b044c9511c842820db12df80dbb207b46d9780420f49da7625e45068f6c8" + } + }, + "changed_scalar_clocks": { + "644": 12, + "660": 4 + }, + "climb_clocks": { + "644": { + "consumer": [ + [ + "B", + 1043 + ], + [ + "B", + 1055 + ], + [ + "B", + 1640 + ], + [ + "B", + 1643 + ], + [ + "final", + 0 + ] + ], + "staged": [ + [ + "B", + 1045 + ], + [ + "B", + 1056 + ], + [ + "B", + 1640 + ], + [ + "B", + 1643 + ], + [ + "final", + 0 + ] + ] + }, + "660": { + "consumer": [ + [ + "B", + 1084 + ], + [ + "B", + 1096 + ], + [ + "B", + 1704 + ], + [ + "B", + 1707 + ], + [ + "final", + 0 + ] + ], + "staged": [ + [ + "B", + 1085 + ], + [ + "B", + 1096 + ], + [ + "B", + 1704 + ], + [ + "B", + 1707 + ], + [ + "final", + 0 + ] + ] + } + }, + "controls": { + "644": "source-to-emission direct scalar/climb clocks", + "660": "source-to-emission direct scalar/climb clocks" + }, + "donor_climb_ranks": { + "640": [ + [ + 1, + 2, + 2, + 1, + 1, + 1 + ], + [ + 3, + 2, + 1, + 1, + 1 + ] + ], + "656": [ + [ + 1, + 2, + 2, + 1, + 1, + 1 + ], + [ + 3, + 2, + 1, + 1, + 1 + ] + ] + }, + "events": { + "backward": 22766, + "forward": 22766 + }, + "local_checks_sha256": "7ff1aabbc1cab42fd4c045859071657dbccdeb398a52334b13f072f0731c87d5", + "merged_donor_climbs": { + "640": "[[30],[423,65,20,10]]", + "656": "[[30],[427,96,24,6]]" + }, + "recipe_keys": { + "644": "137", + "660": "137" + }, + "residual_ranks": { + "644": 7, + "660": 7 + }, + "word_sha256": "0aca7560603d65902a50d68af43f594abd93b09594bac24878b846b1e51475fa" + }, + "extra": { + "adapter_sha256": "c4ddd4db13db5ed6b3672f8ddd0dc3a2bfff50068779b51489c6f002972f6163", + "binding_sha256": { + "644": { + "backward": "df9c48ffab76b888ed085917c8754efa93d9cda0b321bc8ee07aa5ddc50fe2d1", + "forward": "df9c48ffab76b888ed085917c8754efa93d9cda0b321bc8ee07aa5ddc50fe2d1" + }, + "660": { + "backward": "c702b044c9511c842820db12df80dbb207b46d9780420f49da7625e45068f6c8", + "forward": "c702b044c9511c842820db12df80dbb207b46d9780420f49da7625e45068f6c8" + } + }, + "changed_scalar_clocks": { + "644": 12, + "660": 4 + }, + "climb_clocks": { + "644": { + "consumer": [ + [ + "B", + 1043 + ], + [ + "B", + 1055 + ], + [ + "B", + 1640 + ], + [ + "B", + 1643 + ], + [ + "final", + 0 + ] + ], + "staged": [ + [ + "B", + 1045 + ], + [ + "B", + 1056 + ], + [ + "B", + 1640 + ], + [ + "B", + 1643 + ], + [ + "final", + 0 + ] + ] + }, + "660": { + "consumer": [ + [ + "B", + 1084 + ], + [ + "B", + 1096 + ], + [ + "B", + 1704 + ], + [ + "B", + 1707 + ], + [ + "final", + 0 + ] + ], + "staged": [ + [ + "B", + 1085 + ], + [ + "B", + 1096 + ], + [ + "B", + 1704 + ], + [ + "B", + 1707 + ], + [ + "final", + 0 + ] + ] + } + }, + "controls": { + "644": "source-to-emission direct scalar/climb clocks", + "660": "source-to-emission direct scalar/climb clocks" + }, + "donor_climb_ranks": { + "640": [ + [ + 1, + 2, + 2, + 1, + 1, + 1 + ], + [ + 3, + 2, + 1, + 1, + 1 + ] + ], + "656": [ + [ + 1, + 2, + 2, + 1, + 1, + 1 + ], + [ + 3, + 2, + 1, + 1, + 1 + ] + ] + }, + "events": { + "backward": 22766, + "forward": 22766 + }, + "local_checks_sha256": "7ff1aabbc1cab42fd4c045859071657dbccdeb398a52334b13f072f0731c87d5", + "merged_donor_climbs": { + "640": "[[30],[423,65,20,10]]", + "656": "[[30],[427,96,24,6]]" + }, + "recipe_keys": { + "644": "137", + "660": "137" + }, + "residual_ranks": { + "644": 7, + "660": 7 + }, + "word_sha256": "6928ad79dc683e7e7bbf4b5da60f2df91f478c58b797922d6df41d9d43c87048" + } + }, + "RETIMED644-660": { + "base": { + "adapter_sha256": "a19e744f741bf917a72d63aab09cf7e10f5566091458568747b97f7bf0ea945a", + "binding_sha256": { + "644": { + "backward": "c6da2b054bd23b046e89ae2de2eb448c36cdc100da6e4e3c56d232bb42b387e4", + "forward": "c6da2b054bd23b046e89ae2de2eb448c36cdc100da6e4e3c56d232bb42b387e4" + }, + "660": { + "backward": "76d96b99981a46462c9ffb62bf9fa366ab72282a7be9bd93b7c430be143423b7", + "forward": "76d96b99981a46462c9ffb62bf9fa366ab72282a7be9bd93b7c430be143423b7" + } + }, + "changed_scalar_clocks": { + "644": 4, + "660": 4 + }, + "climb_clocks": { + "644": { + "consumer": [ + [ + "B", + 592 + ], + [ + "B", + 1056 + ], + [ + "B", + 1640 + ], + [ + "B", + 1643 + ], + [ + "final", + 0 + ] + ], + "staged": [ + [ + "B", + 1045 + ], + [ + "B", + 1056 + ], + [ + "B", + 1640 + ], + [ + "B", + 1643 + ], + [ + "final", + 0 + ] + ] + }, + "660": { + "consumer": [ + [ + "B", + 642 + ], + [ + "B", + 1096 + ], + [ + "B", + 1704 + ], + [ + "B", + 1707 + ], + [ + "final", + 0 + ] + ], + "staged": [ + [ + "B", + 1085 + ], + [ + "B", + 1096 + ], + [ + "B", + 1704 + ], + [ + "B", + 1707 + ], + [ + "final", + 0 + ] + ] + } + }, + "controls": { + "644": "source-to-emission direct scalar/climb clocks", + "660": "source-to-emission direct scalar/climb clocks" + }, + "donor_climb_ranks": { + "640": [ + [ + 1, + 2, + 2, + 1, + 1, + 1 + ], + [ + 3, + 2, + 1, + 1, + 1 + ] + ], + "656": [ + [ + 1, + 2, + 2, + 1, + 1, + 1 + ], + [ + 3, + 2, + 1, + 1, + 1 + ] + ] + }, + "events": { + "backward": 22766, + "forward": 22766 + }, + "local_checks_sha256": "11743473efa1822069303b49c62b1853af4236f46ef54b4778a27e2e70d79d06", + "merged_donor_climbs": { + "640": "[[30],[423,65,20,10]]", + "656": "[[30],[427,96,24,6]]" + }, + "recipe_keys": { + "644": "137", + "660": "137" + }, + "residual_ranks": { + "644": 7, + "660": 7 + }, + "word_sha256": "6df3356808e29909776be8bc0faf03df983401a267c2d740d1ac2dbcaa278269" + }, + "extra": { + "adapter_sha256": "c4ddd4db13db5ed6b3672f8ddd0dc3a2bfff50068779b51489c6f002972f6163", + "binding_sha256": { + "644": { + "backward": "c6da2b054bd23b046e89ae2de2eb448c36cdc100da6e4e3c56d232bb42b387e4", + "forward": "c6da2b054bd23b046e89ae2de2eb448c36cdc100da6e4e3c56d232bb42b387e4" + }, + "660": { + "backward": "76d96b99981a46462c9ffb62bf9fa366ab72282a7be9bd93b7c430be143423b7", + "forward": "76d96b99981a46462c9ffb62bf9fa366ab72282a7be9bd93b7c430be143423b7" + } + }, + "changed_scalar_clocks": { + "644": 4, + "660": 4 + }, + "climb_clocks": { + "644": { + "consumer": [ + [ + "B", + 592 + ], + [ + "B", + 1056 + ], + [ + "B", + 1640 + ], + [ + "B", + 1643 + ], + [ + "final", + 0 + ] + ], + "staged": [ + [ + "B", + 1045 + ], + [ + "B", + 1056 + ], + [ + "B", + 1640 + ], + [ + "B", + 1643 + ], + [ + "final", + 0 + ] + ] + }, + "660": { + "consumer": [ + [ + "B", + 642 + ], + [ + "B", + 1096 + ], + [ + "B", + 1704 + ], + [ + "B", + 1707 + ], + [ + "final", + 0 + ] + ], + "staged": [ + [ + "B", + 1085 + ], + [ + "B", + 1096 + ], + [ + "B", + 1704 + ], + [ + "B", + 1707 + ], + [ + "final", + 0 + ] + ] + } + }, + "controls": { + "644": "source-to-emission direct scalar/climb clocks", + "660": "source-to-emission direct scalar/climb clocks" + }, + "donor_climb_ranks": { + "640": [ + [ + 1, + 2, + 2, + 1, + 1, + 1 + ], + [ + 3, + 2, + 1, + 1, + 1 + ] + ], + "656": [ + [ + 1, + 2, + 2, + 1, + 1, + 1 + ], + [ + 3, + 2, + 1, + 1, + 1 + ] + ] + }, + "events": { + "backward": 22766, + "forward": 22766 + }, + "local_checks_sha256": "11743473efa1822069303b49c62b1853af4236f46ef54b4778a27e2e70d79d06", + "merged_donor_climbs": { + "640": "[[30],[423,65,20,10]]", + "656": "[[30],[427,96,24,6]]" + }, + "recipe_keys": { + "644": "137", + "660": "137" + }, + "residual_ranks": { + "644": 7, + "660": 7 + }, + "word_sha256": "65624efec36b35934b750c1741ba2ad4e6df3cff86e44536b0c016ebddb0fb55" + } + } + }, + "donor_climb_recipes": { + "[[30],[423,65,20,10]]": 3, + "[[30],[427,96,24,6]]": 3 + }, + "providers": { + "base": { + "adapter_sha256": "a19e744f741bf917a72d63aab09cf7e10f5566091458568747b97f7bf0ea945a", + "bindings": { + "644": { + "backward": { + "cleanup_scalar_count": 8, + "climbs": [ + { + "index": 14205, + "new": [ + 423, + 65, + 20, + 10 + ], + "old": [ + 429, + 30 + ], + "rank": 2 + }, + { + "index": 14221, + "new": [ + 292, + 131, + 65, + 20, + 10 + ], + "old": [ + 423, + 65, + 20, + 10 + ], + "rank": 1 + }, + { + "index": 15383, + "new": [ + 260, + 128, + 65, + 32, + 20, + 9, + 3 + ], + "old": [ + 292, + 131, + 65, + 20, + 10 + ], + "rank": 2 + }, + { + "index": 15388, + "new": [ + 257, + 128, + 65, + 32, + 17, + 9, + 5, + 3 + ], + "old": [ + 260, + 128, + 65, + 32, + 20, + 9, + 3 + ], + "rank": 1 + }, + { + "index": 16606, + "new": [ + 256, + 128, + 64, + 32, + 16, + 8, + 4, + 2, + 1 + ], + "old": [ + 257, + 128, + 65, + 32, + 17, + 9, + 5, + 3 + ], + "rank": 1 + } + ], + "compact_helper": 613, + "direct_scalar_count": 17, + "direct_scalar_sha256": "ee7314a96af92f2d7751a280c320ce779c48086dba03c3fae3282c280c900311", + "entrance": [ + 429, + 30 + ], + "exit_adapter": [ + 17148, + "new_to_old", + 1 + ], + "recipe_key": "137", + "terminal": [ + 256, + 128, + 64, + 32, + 16, + 8, + 4, + 2, + 1 + ], + "wrappers": [ + [ + 6651, + "pre" + ], + [ + 22748, + "post" + ] + ] + }, + "forward": { + "cleanup_scalar_count": 8, + "climbs": [ + { + "index": 14205, + "new": [ + 423, + 65, + 20, + 10 + ], + "old": [ + 429, + 30 + ], + "rank": 2 + }, + { + "index": 14221, + "new": [ + 292, + 131, + 65, + 20, + 10 + ], + "old": [ + 423, + 65, + 20, + 10 + ], + "rank": 1 + }, + { + "index": 15383, + "new": [ + 260, + 128, + 65, + 32, + 20, + 9, + 3 + ], + "old": [ + 292, + 131, + 65, + 20, + 10 + ], + "rank": 2 + }, + { + "index": 15388, + "new": [ + 257, + 128, + 65, + 32, + 17, + 9, + 5, + 3 + ], + "old": [ + 260, + 128, + 65, + 32, + 20, + 9, + 3 + ], + "rank": 1 + }, + { + "index": 16606, + "new": [ + 256, + 128, + 64, + 32, + 16, + 8, + 4, + 2, + 1 + ], + "old": [ + 257, + 128, + 65, + 32, + 17, + 9, + 5, + 3 + ], + "rank": 1 + } + ], + "compact_helper": 613, + "direct_scalar_count": 17, + "direct_scalar_sha256": "ee7314a96af92f2d7751a280c320ce779c48086dba03c3fae3282c280c900311", + "entrance": [ + 429, + 30 + ], + "exit_adapter": [ + 17148, + "new_to_old", + 1 + ], + "recipe_key": "137", + "terminal": [ + 256, + 128, + 64, + 32, + 16, + 8, + 4, + 2, + 1 + ], + "wrappers": [ + [ + 6651, + "pre" + ], + [ + 22748, + "post" + ] + ] + } + }, + "660": { + "backward": { + "cleanup_scalar_count": 8, + "climbs": [ + { + "index": 14278, + "new": [ + 427, + 96, + 24, + 6 + ], + "old": [ + 429, + 30 + ], + "rank": 2 + }, + { + "index": 14294, + "new": [ + 290, + 136, + 96, + 24, + 6, + 1 + ], + "old": [ + 427, + 96, + 24, + 6 + ], + "rank": 2 + }, + { + "index": 15519, + "new": [ + 256, + 136, + 66, + 34, + 24, + 6, + 1 + ], + "old": [ + 290, + 136, + 96, + 24, + 6, + 1 + ], + "rank": 1 + }, + { + "index": 15524, + "new": [ + 256, + 136, + 64, + 32, + 24, + 4, + 2, + 1 + ], + "old": [ + 256, + 136, + 66, + 34, + 24, + 6, + 1 + ], + "rank": 1 + }, + { + "index": 16614, + "new": [ + 256, + 128, + 64, + 32, + 16, + 8, + 4, + 2, + 1 + ], + "old": [ + 256, + 136, + 64, + 32, + 24, + 4, + 2, + 1 + ], + "rank": 1 + } + ], + "compact_helper": 621, + "direct_scalar_count": 17, + "direct_scalar_sha256": "db11bf105281f190be4ab63d8decea9f6b318230eedd29fe9970354cec046f7a", + "entrance": [ + 429, + 30 + ], + "exit_adapter": [ + 17156, + "new_to_old", + 1 + ], + "recipe_key": "137", + "terminal": [ + 256, + 128, + 64, + 32, + 16, + 8, + 4, + 2, + 1 + ], + "wrappers": [ + [ + 6659, + "pre" + ], + [ + 22756, + "post" + ] + ] + }, + "forward": { + "cleanup_scalar_count": 8, + "climbs": [ + { + "index": 14278, + "new": [ + 427, + 96, + 24, + 6 + ], + "old": [ + 429, + 30 + ], + "rank": 2 + }, + { + "index": 14294, + "new": [ + 290, + 136, + 96, + 24, + 6, + 1 + ], + "old": [ + 427, + 96, + 24, + 6 + ], + "rank": 2 + }, + { + "index": 15519, + "new": [ + 256, + 136, + 66, + 34, + 24, + 6, + 1 + ], + "old": [ + 290, + 136, + 96, + 24, + 6, + 1 + ], + "rank": 1 + }, + { + "index": 15524, + "new": [ + 256, + 136, + 64, + 32, + 24, + 4, + 2, + 1 + ], + "old": [ + 256, + 136, + 66, + 34, + 24, + 6, + 1 + ], + "rank": 1 + }, + { + "index": 16614, + "new": [ + 256, + 128, + 64, + 32, + 16, + 8, + 4, + 2, + 1 + ], + "old": [ + 256, + 136, + 64, + 32, + 24, + 4, + 2, + 1 + ], + "rank": 1 + } + ], + "compact_helper": 621, + "direct_scalar_count": 17, + "direct_scalar_sha256": "db11bf105281f190be4ab63d8decea9f6b318230eedd29fe9970354cec046f7a", + "entrance": [ + 429, + 30 + ], + "exit_adapter": [ + 17156, + "new_to_old", + 1 + ], + "recipe_key": "137", + "terminal": [ + 256, + 128, + 64, + 32, + 16, + 8, + 4, + 2, + 1 + ], + "wrappers": [ + [ + 6659, + "pre" + ], + [ + 22756, + "post" + ] + ] + } + } + }, + "changed_helpers": [ + 644, + 660 + ], + "controls": { + "contained_line": "entrance-relative width", + "old_entrance": "entrance-relative width", + "omitted_entrance": "entrance-relative width", + "parent_recipe_at_new_entrance": "entrance-relative width", + "parent_wrapper_alias": "phase-exact all-column residual", + "phase": "phase-exact all-column residual", + "wrong_entrance_plane": "phase-exact all-column residual" + }, + "local_checks_sha256": "1cd75f8209677e59bb26be8d7d0920109628a5da1ff80d4f07b03356711a2237", + "pair_classes": { + "parent": 57, + "staged": 58 + }, + "parent_bindings": { + "644": { + "climb_ranks": [ + 3, + 1, + 2, + 1, + 1 + ], + "direct_scalar_count": 17, + "entrance": [ + 30 + ] + }, + "660": { + "climb_ranks": [ + 3, + 2, + 1, + 1, + 1 + ], + "direct_scalar_count": 17, + "entrance": [ + 30 + ] + } + }, + "parent_local_checks_sha256": "681abd7fb34ef2b691dd95f4d7284c493989c7d57b16776ce8c2ae96f946f49c", + "parent_residual": { + "columns": 512, + "orientations": 2, + "rank": 8, + "recipe": { + "left": { + "linear_Z4": [ + 2, + 3, + 3, + 3, + 2, + 2, + 2, + 2, + 0 + ], + "matrix_rows": [ + 1, + 258, + 4, + 8, + 14, + 16, + 32, + 64, + 128 + ], + "offset": 0, + "phase": 0, + "quadratic_rows": [ + 0, + 14, + 14, + 14, + 0, + 0, + 0, + 0, + 0 + ] + }, + "rank": 8, + "right": { + "linear_Z4": [ + 2, + 0, + 0, + 0, + 0, + 2, + 2, + 2, + 2 + ], + "matrix_rows": [ + 1, + 2, + 20, + 24, + 32, + 64, + 128, + 256, + 16 + ], + "offset": 241, + "phase": 1, + "quadratic_rows": [ + 0, + 16, + 16, + 16, + 14, + 0, + 0, + 0, + 0 + ] + } + }, + "spectator_axes": 1 + }, + "parent_word_sha256": "300a9b8ad1d554f0e6f84f43f3f5fd870a5b4e5f81ad856900b6e8999684892e", + "residual_recipes": { + "parent": 56, + "staged": 57 + }, + "residuals": { + "137": { + "columns": 512, + "orientations": 2, + "rank": 7, + "recipe": { + "entrance_rank": 2, + "frame": 137, + "left": { + "linear_Z4": [ + 3, + 3, + 2, + 2, + 3, + 2, + 3, + 0, + 0 + ], + "matrix_rows": [ + 129, + 258, + 4, + 8, + 14, + 16, + 32, + 64, + 93 + ], + "offset": 0, + "phase": 0, + "quadratic_rows": [ + 93, + 14, + 83, + 83, + 93, + 0, + 93, + 0, + 0 + ] + }, + "rank": 7, + "right": { + "linear_Z4": [ + 0, + 0, + 0, + 0, + 0, + 0, + 2, + 0, + 0 + ], + "matrix_rows": [ + 1, + 2, + 276, + 280, + 288, + 64, + 384, + 256, + 16 + ], + "offset": 161, + "phase": 1, + "quadratic_rows": [ + 256, + 16, + 272, + 272, + 14, + 256, + 0, + 256, + 173 + ] + }, + "vectors": [ + 429, + 30 + ] + }, + "spectator_axes": 2 + } + }, + "warp_records": 72, + "word_sha256": "735c540b1fe29d0ceeb4d2f304ec941e5f2bd3bc92bafc8cce2b4f9a67a3b653" + }, + "extra": { + "adapter_sha256": "c4ddd4db13db5ed6b3672f8ddd0dc3a2bfff50068779b51489c6f002972f6163", + "bindings": { + "644": { + "backward": { + "cleanup_scalar_count": 8, + "climbs": [ + { + "index": 14205, + "new": [ + 423, + 65, + 20, + 10 + ], + "old": [ + 429, + 30 + ], + "rank": 2 + }, + { + "index": 14221, + "new": [ + 292, + 131, + 65, + 20, + 10 + ], + "old": [ + 423, + 65, + 20, + 10 + ], + "rank": 1 + }, + { + "index": 15383, + "new": [ + 260, + 128, + 65, + 32, + 20, + 9, + 3 + ], + "old": [ + 292, + 131, + 65, + 20, + 10 + ], + "rank": 2 + }, + { + "index": 15388, + "new": [ + 257, + 128, + 65, + 32, + 17, + 9, + 5, + 3 + ], + "old": [ + 260, + 128, + 65, + 32, + 20, + 9, + 3 + ], + "rank": 1 + }, + { + "index": 16606, + "new": [ + 256, + 128, + 64, + 32, + 16, + 8, + 4, + 2, + 1 + ], + "old": [ + 257, + 128, + 65, + 32, + 17, + 9, + 5, + 3 + ], + "rank": 1 + } + ], + "compact_helper": 613, + "direct_scalar_count": 17, + "direct_scalar_sha256": "ee7314a96af92f2d7751a280c320ce779c48086dba03c3fae3282c280c900311", + "entrance": [ + 429, + 30 + ], + "exit_adapter": [ + 17148, + "new_to_old", + 1 + ], + "recipe_key": "137", + "terminal": [ + 256, + 128, + 64, + 32, + 16, + 8, + 4, + 2, + 1 + ], + "wrappers": [ + [ + 6651, + "pre" + ], + [ + 22748, + "post" + ] + ] + }, + "forward": { + "cleanup_scalar_count": 8, + "climbs": [ + { + "index": 14205, + "new": [ + 423, + 65, + 20, + 10 + ], + "old": [ + 429, + 30 + ], + "rank": 2 + }, + { + "index": 14221, + "new": [ + 292, + 131, + 65, + 20, + 10 + ], + "old": [ + 423, + 65, + 20, + 10 + ], + "rank": 1 + }, + { + "index": 15383, + "new": [ + 260, + 128, + 65, + 32, + 20, + 9, + 3 + ], + "old": [ + 292, + 131, + 65, + 20, + 10 + ], + "rank": 2 + }, + { + "index": 15388, + "new": [ + 257, + 128, + 65, + 32, + 17, + 9, + 5, + 3 + ], + "old": [ + 260, + 128, + 65, + 32, + 20, + 9, + 3 + ], + "rank": 1 + }, + { + "index": 16606, + "new": [ + 256, + 128, + 64, + 32, + 16, + 8, + 4, + 2, + 1 + ], + "old": [ + 257, + 128, + 65, + 32, + 17, + 9, + 5, + 3 + ], + "rank": 1 + } + ], + "compact_helper": 613, + "direct_scalar_count": 17, + "direct_scalar_sha256": "ee7314a96af92f2d7751a280c320ce779c48086dba03c3fae3282c280c900311", + "entrance": [ + 429, + 30 + ], + "exit_adapter": [ + 17148, + "new_to_old", + 1 + ], + "recipe_key": "137", + "terminal": [ + 256, + 128, + 64, + 32, + 16, + 8, + 4, + 2, + 1 + ], + "wrappers": [ + [ + 6651, + "pre" + ], + [ + 22748, + "post" + ] + ] + } + }, + "660": { + "backward": { + "cleanup_scalar_count": 8, + "climbs": [ + { + "index": 14278, + "new": [ + 427, + 96, + 24, + 6 + ], + "old": [ + 429, + 30 + ], + "rank": 2 + }, + { + "index": 14294, + "new": [ + 290, + 136, + 96, + 24, + 6, + 1 + ], + "old": [ + 427, + 96, + 24, + 6 + ], + "rank": 2 + }, + { + "index": 15519, + "new": [ + 256, + 136, + 66, + 34, + 24, + 6, + 1 + ], + "old": [ + 290, + 136, + 96, + 24, + 6, + 1 + ], + "rank": 1 + }, + { + "index": 15524, + "new": [ + 256, + 136, + 64, + 32, + 24, + 4, + 2, + 1 + ], + "old": [ + 256, + 136, + 66, + 34, + 24, + 6, + 1 + ], + "rank": 1 + }, + { + "index": 16614, + "new": [ + 256, + 128, + 64, + 32, + 16, + 8, + 4, + 2, + 1 + ], + "old": [ + 256, + 136, + 64, + 32, + 24, + 4, + 2, + 1 + ], + "rank": 1 + } + ], + "compact_helper": 621, + "direct_scalar_count": 17, + "direct_scalar_sha256": "db11bf105281f190be4ab63d8decea9f6b318230eedd29fe9970354cec046f7a", + "entrance": [ + 429, + 30 + ], + "exit_adapter": [ + 17156, + "new_to_old", + 1 + ], + "recipe_key": "137", + "terminal": [ + 256, + 128, + 64, + 32, + 16, + 8, + 4, + 2, + 1 + ], + "wrappers": [ + [ + 6659, + "pre" + ], + [ + 22756, + "post" + ] + ] + }, + "forward": { + "cleanup_scalar_count": 8, + "climbs": [ + { + "index": 14278, + "new": [ + 427, + 96, + 24, + 6 + ], + "old": [ + 429, + 30 + ], + "rank": 2 + }, + { + "index": 14294, + "new": [ + 290, + 136, + 96, + 24, + 6, + 1 + ], + "old": [ + 427, + 96, + 24, + 6 + ], + "rank": 2 + }, + { + "index": 15519, + "new": [ + 256, + 136, + 66, + 34, + 24, + 6, + 1 + ], + "old": [ + 290, + 136, + 96, + 24, + 6, + 1 + ], + "rank": 1 + }, + { + "index": 15524, + "new": [ + 256, + 136, + 64, + 32, + 24, + 4, + 2, + 1 + ], + "old": [ + 256, + 136, + 66, + 34, + 24, + 6, + 1 + ], + "rank": 1 + }, + { + "index": 16614, + "new": [ + 256, + 128, + 64, + 32, + 16, + 8, + 4, + 2, + 1 + ], + "old": [ + 256, + 136, + 64, + 32, + 24, + 4, + 2, + 1 + ], + "rank": 1 + } + ], + "compact_helper": 621, + "direct_scalar_count": 17, + "direct_scalar_sha256": "db11bf105281f190be4ab63d8decea9f6b318230eedd29fe9970354cec046f7a", + "entrance": [ + 429, + 30 + ], + "exit_adapter": [ + 17156, + "new_to_old", + 1 + ], + "recipe_key": "137", + "terminal": [ + 256, + 128, + 64, + 32, + 16, + 8, + 4, + 2, + 1 + ], + "wrappers": [ + [ + 6659, + "pre" + ], + [ + 22756, + "post" + ] + ] + } + } + }, + "changed_helpers": [ + 644, + 660 + ], + "controls": { + "contained_line": "entrance-relative width", + "old_entrance": "entrance-relative width", + "omitted_entrance": "entrance-relative width", + "parent_recipe_at_new_entrance": "entrance-relative width", + "parent_wrapper_alias": "phase-exact all-column residual", + "phase": "phase-exact all-column residual", + "wrong_entrance_plane": "phase-exact all-column residual" + }, + "local_checks_sha256": "1cd75f8209677e59bb26be8d7d0920109628a5da1ff80d4f07b03356711a2237", + "pair_classes": { + "parent": 57, + "staged": 58 + }, + "parent_bindings": { + "644": { + "climb_ranks": [ + 3, + 1, + 2, + 1, + 1 + ], + "direct_scalar_count": 17, + "entrance": [ + 30 + ] + }, + "660": { + "climb_ranks": [ + 3, + 2, + 1, + 1, + 1 + ], + "direct_scalar_count": 17, + "entrance": [ + 30 + ] + } + }, + "parent_local_checks_sha256": "681abd7fb34ef2b691dd95f4d7284c493989c7d57b16776ce8c2ae96f946f49c", + "parent_residual": { + "columns": 512, + "orientations": 2, + "rank": 8, + "recipe": { + "left": { + "linear_Z4": [ + 2, + 3, + 3, + 3, + 2, + 2, + 2, + 2, + 0 + ], + "matrix_rows": [ + 1, + 258, + 4, + 8, + 14, + 16, + 32, + 64, + 128 + ], + "offset": 0, + "phase": 0, + "quadratic_rows": [ + 0, + 14, + 14, + 14, + 0, + 0, + 0, + 0, + 0 + ] + }, + "rank": 8, + "right": { + "linear_Z4": [ + 2, + 0, + 0, + 0, + 0, + 2, + 2, + 2, + 2 + ], + "matrix_rows": [ + 1, + 2, + 20, + 24, + 32, + 64, + 128, + 256, + 16 + ], + "offset": 241, + "phase": 1, + "quadratic_rows": [ + 0, + 16, + 16, + 16, + 14, + 0, + 0, + 0, + 0 + ] + } + }, + "spectator_axes": 1 + }, + "parent_word_sha256": "495d030f1e03b90e954dad3043994f03293d41b9ed220a3beaef849df435d3f0", + "residual_recipes": { + "parent": 56, + "staged": 57 + }, + "residuals": { + "137": { + "columns": 512, + "orientations": 2, + "rank": 7, + "recipe": { + "entrance_rank": 2, + "frame": 137, + "left": { + "linear_Z4": [ + 3, + 3, + 2, + 2, + 3, + 2, + 3, + 0, + 0 + ], + "matrix_rows": [ + 129, + 258, + 4, + 8, + 14, + 16, + 32, + 64, + 93 + ], + "offset": 0, + "phase": 0, + "quadratic_rows": [ + 93, + 14, + 83, + 83, + 93, + 0, + 93, + 0, + 0 + ] + }, + "rank": 7, + "right": { + "linear_Z4": [ + 0, + 0, + 0, + 0, + 0, + 0, + 2, + 0, + 0 + ], + "matrix_rows": [ + 1, + 2, + 276, + 280, + 288, + 64, + 384, + 256, + 16 + ], + "offset": 161, + "phase": 1, + "quadratic_rows": [ + 256, + 16, + 272, + 272, + 14, + 256, + 0, + 256, + 173 + ] + }, + "vectors": [ + 429, + 30 + ] + }, + "spectator_axes": 2 + } + }, + "warp_records": 72, + "word_sha256": "886338fc32da14f3389a82c8120a1bcf9c5e2f0ec3e9b2d377fdae809e1d977f" + } + } + }, + "schema_version": 1, + "status": "PASS_STAGED_644_660_NATIVE_BINDING" +} diff --git a/research/staged-644-660-native-binding-audit/SOURCES.json b/research/staged-644-660-native-binding-audit/SOURCES.json new file mode 100644 index 0000000000..04a979226a --- /dev/null +++ b/research/staged-644-660-native-binding-audit/SOURCES.json @@ -0,0 +1,260 @@ +{ + "schema_version": 1, + "base_commit": "20ecf2891d80b5acf18d980b2164fb44ea7faa90", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "b1fea0c94436b236cc2b7d41a7be032811b94c81", + "sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "67f085acd86acd7d4e03922d9cf4b26bca66fed5", + "sha256": "47b42433f5a85809a3aadd29c2c339da2c6ed728e4f7762df6b88bccb7874cf0" + }, + { + "path": "research/t74-native-fast/vendor/native/new/code/borrow/bw_transport.py", + "usage": "input", + "git_blob": "08248542b18864c94a5ac050c8669f68519838e1", + "sha256": "9818e08b819310b40f1441b89be8c4369584a5b3fa5dfe9b86b1df9a7f5d6a76" + }, + { + "path": "research/t74-native-fast/vendor/native/new/code/borrow/bw_emit.py", + "usage": "input", + "git_blob": "6d47f63ab7a533941b3881bbfd3ae4dac5f76932", + "sha256": "99b59a6fa3feda86785e4225157dcb1a6169d256cec4f5e0acc9cea7a701df76" + }, + { + "path": "research/t74-native-fast/vendor/native/new/code/borrow/vendor/clifford/clifford_exact.py", + "usage": "input", + "git_blob": "166841a037f069249f6f7f6dedb89248812f59e2", + "sha256": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962" + }, + { + "path": "research/frontier1094-recipes-exact-seed76/clifford.py", + "usage": "input", + "git_blob": "6f1e6a38febde7eb7a7341d317522e6650d84408", + "sha256": "d5e42ddabd141b7bfbd70fe13908f3c3a06aeccebeab90623596bfb1988b97fb" + }, + { + "path": "research/rank7-coupled-586-588-carrier-fold/edits/FINAL-WORD-base.json.gz", + "usage": "input", + "git_blob": "cb4cc24a4545944627ad595c0c5080196952b9f0", + "sha256": "300a9b8ad1d554f0e6f84f43f3f5fd870a5b4e5f81ad856900b6e8999684892e" + }, + { + "path": "research/rank7-coupled-586-588-carrier-fold/edits/FINAL-WORD-extra.json.gz", + "usage": "input", + "git_blob": "decc8f26d8aab108baf75f0d8b2d1012eb06d076", + "sha256": "495d030f1e03b90e954dad3043994f03293d41b9ed220a3beaef849df435d3f0" + }, + { + "path": "research/staged-644-660-width-reduction/STAGED644-660-base.json.gz", + "usage": "provenance", + "git_blob": "dc6d321b1e8e2a837a1ff7bb60e8f8f78d043db5", + "sha256": "735c540b1fe29d0ceeb4d2f304ec941e5f2bd3bc92bafc8cce2b4f9a67a3b653", + "pin": "head:3efbb5de06a49ffeea6684482f2d3fe48cdca3fb:research/staged-644-660-width-reduction/STAGED644-660-base.json.gz" + }, + { + "path": "research/staged-644-660-width-reduction/STAGED644-660-extra.json.gz", + "usage": "provenance", + "git_blob": "78e7b2bb0653c8dcc0133980a19dd9d97ebdb67e", + "sha256": "886338fc32da14f3389a82c8120a1bcf9c5e2f0ec3e9b2d377fdae809e1d977f", + "pin": "head:3efbb5de06a49ffeea6684482f2d3fe48cdca3fb:research/staged-644-660-width-reduction/STAGED644-660-extra.json.gz" + }, + { + "path": "research/staged-644-660-width-reduction/README.md", + "usage": "provenance", + "git_blob": "003a156197e32a437949c4a02b352ab8698f4eee", + "sha256": "c1956badbcd92f2f88dcea833facc39eefb7eef8f220fb7b1941b4c552109d89", + "pin": "head:3efbb5de06a49ffeea6684482f2d3fe48cdca3fb:research/staged-644-660-width-reduction/README.md" + }, + { + "path": "research/staged-644-660-width-reduction/check_residual.py", + "usage": "provenance", + "git_blob": "7e75bde5b4c3a0d345b89e71631abeb9994781ec", + "sha256": "e34b06ae725f062d15ad83cbd3ef2f91d3d78c380ccc93c8d2deba1c9e354c70", + "pin": "head:3efbb5de06a49ffeea6684482f2d3fe48cdca3fb:research/staged-644-660-width-reduction/check_residual.py" + }, + { + "path": "research/staged-644-660-width-reduction/verify.py", + "usage": "provenance", + "git_blob": "7f2f6170705a77a8ca5e31007d986912373a33f0", + "sha256": "0ef49b725fc132cd5fc26a9a81028739896232d938bae22cef132384c7cbab13", + "pin": "head:3efbb5de06a49ffeea6684482f2d3fe48cdca3fb:research/staged-644-660-width-reduction/verify.py" + }, + { + "path": "research/staged-644-660-width-reduction/ARTIFACTS.json", + "usage": "provenance", + "git_blob": "c58b91b5dd95c07e530a8393f5e87f3384a2a426", + "sha256": "867bd848d04505518463eb06b1905e70ccc9256bb73312d3cd1dc57623bb319b", + "pin": "head:3efbb5de06a49ffeea6684482f2d3fe48cdca3fb:research/staged-644-660-width-reduction/ARTIFACTS.json" + }, + { + "path": "research/staged-644-660-independent-audit/README.md", + "usage": "provenance", + "git_blob": "bfc15a07cabbd99b6917c5f81f65f34229bd1839", + "sha256": "7ffddf5ed8b9aa8ef713de7d03f137d1596183f580b4a024c7e2f1071c4f522e", + "pin": "head:f798838eb8ede4178e94f240e7b7e54b3f80c82d:research/staged-644-660-independent-audit/README.md" + }, + { + "path": "research/staged-release-retiming-t530/local-audit/words/RETIMED644-660-base.json.gz", + "usage": "provenance", + "git_blob": "d69125e0c7d34af9299e411ada5c30dfc7b95ad1", + "sha256": "6df3356808e29909776be8bc0faf03df983401a267c2d740d1ac2dbcaa278269", + "pin": "head:6568db75adbb61437190545f6fef1534c70e91e5:research/staged-release-retiming-t530/local-audit/words/RETIMED644-660-base.json.gz" + }, + { + "path": "research/staged-release-retiming-t530/local-audit/words/RETIMED644-660-extra.json.gz", + "usage": "provenance", + "git_blob": "f3c580b06506e8888fe766c9a1e0bb1a748d7b74", + "sha256": "65624efec36b35934b750c1741ba2ad4e6df3cff86e44536b0c016ebddb0fb55", + "pin": "head:6568db75adbb61437190545f6fef1534c70e91e5:research/staged-release-retiming-t530/local-audit/words/RETIMED644-660-extra.json.gz" + }, + { + "path": "research/retimed-t488-composition/local-audit/words/RETIMED644-660-base.json.gz", + "usage": "provenance", + "git_blob": "d69125e0c7d34af9299e411ada5c30dfc7b95ad1", + "sha256": "6df3356808e29909776be8bc0faf03df983401a267c2d740d1ac2dbcaa278269", + "pin": "head:607a09ff441c79b215a8127a81f4cc70021d0d9b:research/retimed-t488-composition/local-audit/words/RETIMED644-660-base.json.gz" + }, + { + "path": "research/retimed-t488-composition/local-audit/words/RETIMED644-660-extra.json.gz", + "usage": "provenance", + "git_blob": "f3c580b06506e8888fe766c9a1e0bb1a748d7b74", + "sha256": "65624efec36b35934b750c1741ba2ad4e6df3cff86e44536b0c016ebddb0fb55", + "pin": "head:607a09ff441c79b215a8127a81f4cc70021d0d9b:research/retimed-t488-composition/local-audit/words/RETIMED644-660-extra.json.gz" + }, + { + "path": "research/staged-donor-release/lead1-words/DELAYED-base.json.gz", + "usage": "provenance", + "git_blob": "7ccd0962b89adb78e643689573333059262d27b7", + "sha256": "0aca7560603d65902a50d68af43f594abd93b09594bac24878b846b1e51475fa", + "pin": "head:431e6c6023ef352c41696469de7fb614cd4ded8c:research/staged-donor-release/lead1-words/DELAYED-base.json.gz" + }, + { + "path": "research/staged-donor-release/lead1-words/DELAYED-extra.json.gz", + "usage": "provenance", + "git_blob": "3f1fb47183d97bf4b544ea51c59394bb6a9801ee", + "sha256": "6928ad79dc683e7e7bbf4b5da60f2df91f478c58b797922d6df41d9d43c87048", + "pin": "head:431e6c6023ef352c41696469de7fb614cd4ded8c:research/staged-donor-release/lead1-words/DELAYED-extra.json.gz" + }, + { + "path": "research/staged-release-retiming-t530/local-audit/receipts/native-base/native/local/LOCAL-CHECKS.json", + "usage": "provenance", + "git_blob": "fffbfc2f9096d3d1fad0842f6b0898585a4e47b9", + "sha256": "11743473efa1822069303b49c62b1853af4236f46ef54b4778a27e2e70d79d06", + "pin": "head:6568db75adbb61437190545f6fef1534c70e91e5:research/staged-release-retiming-t530/local-audit/receipts/native-base/native/local/LOCAL-CHECKS.json" + }, + { + "path": "research/staged-release-retiming-t530/local-audit/receipts/native-extra/native/local/LOCAL-CHECKS.json", + "usage": "provenance", + "git_blob": "fffbfc2f9096d3d1fad0842f6b0898585a4e47b9", + "sha256": "11743473efa1822069303b49c62b1853af4236f46ef54b4778a27e2e70d79d06", + "pin": "head:6568db75adbb61437190545f6fef1534c70e91e5:research/staged-release-retiming-t530/local-audit/receipts/native-extra/native/local/LOCAL-CHECKS.json" + }, + { + "path": "research/staged-donor-release/evidence/native-base/LOCAL-CHECKS.json", + "usage": "provenance", + "git_blob": "39d91d34bc6115d89c8577e7a75ed59dbed4b3df", + "sha256": "7ff1aabbc1cab42fd4c045859071657dbccdeb398a52334b13f072f0731c87d5", + "pin": "head:431e6c6023ef352c41696469de7fb614cd4ded8c:research/staged-donor-release/evidence/native-base/LOCAL-CHECKS.json" + }, + { + "path": "research/staged-donor-release/evidence/native-extra/LOCAL-CHECKS.json", + "usage": "provenance", + "git_blob": "39d91d34bc6115d89c8577e7a75ed59dbed4b3df", + "sha256": "7ff1aabbc1cab42fd4c045859071657dbccdeb398a52334b13f072f0731c87d5", + "pin": "head:431e6c6023ef352c41696469de7fb614cd4ded8c:research/staged-donor-release/evidence/native-extra/LOCAL-CHECKS.json" + }, + { + "path": "research/staged-release-retiming-t530/PROOF.md", + "usage": "provenance", + "git_blob": "54ec7d1ab72fd639a35bc1aa7127d1eb33719f01", + "sha256": "bee5879b1f48a5a4efec30f75f2f8a348f1bd1eaf5ddf04f7d92a9cf1a904125", + "pin": "head:6568db75adbb61437190545f6fef1534c70e91e5:research/staged-release-retiming-t530/PROOF.md" + }, + { + "path": "research/retimed-t488-composition/README.md", + "usage": "provenance", + "git_blob": "f0f003474aa97ca112807829d281708795e0e228", + "sha256": "dac5a44abfe961bc86446a6ca6c3b6c76afe588d44c725911e7bd391b1c059b7", + "pin": "head:607a09ff441c79b215a8127a81f4cc70021d0d9b:research/retimed-t488-composition/README.md" + }, + { + "path": "research/staged-donor-release/PROOF.md", + "usage": "provenance", + "git_blob": "a9da712a7dd24194ab3fff64246adeba2bdf608d", + "sha256": "89ce2b0aa2dcf84ebcab04aedc451420815bc48af25c69998594910e9976a31b", + "pin": "head:431e6c6023ef352c41696469de7fb614cd4ded8c:research/staged-donor-release/PROOF.md" + }, + { + "path": "research/rank7-group-d-native-widths-audit/native.py", + "usage": "provenance", + "git_blob": "8b98cbd4fe82562fbf0a71965a264d05c1c01660", + "sha256": "36f7ccb56ffd47170bf339597f09900241ad2294e2e1aa0ecc85cabc554527ee" + }, + { + "path": "research/rank7-group-d-native-widths-audit/common.py", + "usage": "provenance", + "git_blob": "90bdf8880bc51d3104b524eca49f961f61686639", + "sha256": "787830615ff85399c38c64834ec653dbb5cf8d2a0027798ddd3dfd35cafe09c7" + }, + { + "path": "research/rank7-group-d-native-widths-audit/verify.py", + "usage": "provenance", + "git_blob": "e8cf6a8c612f1c700aad8c746bf94819e80a0b34", + "sha256": "124c6577459ef80fa1b82e7f4d66d2f734accdb69e207442700db2d1477bfc23" + }, + { + "path": "research/rank7-group-d-native-widths-audit/test_verify.py", + "usage": "provenance", + "git_blob": "fdb7c6bacb36254c44b3f1fba5db589428eebe63", + "sha256": "508b8404b518d5045041e8b62789e16aa5e2a0bba261b60ff4639776f4ff0dde" + }, + { + "path": "research/t74-native-fast/vendor/native/new/code/borrow/bw_adapters.py", + "usage": "provenance", + "git_blob": "82beaa9c1d13bcd5f79d0a5e10e8a10733eac347", + "sha256": "c5907050a9a7fa36d4fcba3ad4fe440d1bec2063360c095013891785ba65c3ce" + }, + { + "path": "research/t74-native-fast/vendor/native/new/code/borrow/bw_gauss.py", + "usage": "provenance", + "git_blob": "1ff29dfb244e2114de8e586a450ae9fb70308d58", + "sha256": "0884b14d6d77cde419a3c773ad9b21d0d18de1e6e20e6b6d5add458ed32ba4cb" + }, + { + "path": "research/t74-native-fast/vendor/native/new/code/borrow/bw_audit_local.py", + "usage": "provenance", + "git_blob": "912a0c447c2ad34eb5ef3270e04ad0a73ca20a55", + "sha256": "08d5864d9b77902fc5ab5a062a8ea843fe1e572243b8c580abb0a421b2e46d07" + }, + { + "path": "research/t74-native-fast/vendor/native/new/code/borrow/bw_phases.py", + "usage": "provenance", + "git_blob": "99f351785ebca5fbf3336bedcd7b48bac9c255e5", + "sha256": "9d1a620e26715f4c42fd0347ecc14ef5a4a9031867869b64e8bae4d8526a821e" + }, + { + "path": "research/t74-native-fast/vendor/native/new/code/borrow/bw_check_recipes.py", + "usage": "provenance", + "git_blob": "6db8ad50eb2562700432a852501aad720aa34816", + "sha256": "d600b959a0ac462dc28deb8c0d5d8f9e0c76d7f7d7b6f92a296c5ef9e0a1de19" + }, + { + "path": "research/frontier1094-recipes-exact-seed76/README.md", + "usage": "provenance", + "git_blob": "4a4747e0c302e58cc8f4c5516d57dc8b81ce95d0", + "sha256": "a0635fd335cf2949a00f6a1eee8826188efbccd3051d4cc26dd8cee2fe725ce8" + }, + { + "path": "research/t74-native-fast/NATIVE-LINEAGE-NOTICE", + "usage": "provenance", + "git_blob": "380e979f0e84e00a22bd890615d87cc4684ad740", + "sha256": "ee0c73ca35877aad0e0b6adc560a3881cb82276dba4cf2d4fc58cd19e57cc420" + } + ] +} diff --git a/research/staged-644-660-native-binding-audit/TASK.json b/research/staged-644-660-native-binding-audit/TASK.json new file mode 100644 index 0000000000..a1c106a255 --- /dev/null +++ b/research/staged-644-660-native-binding-audit/TASK.json @@ -0,0 +1,144 @@ +{ + "schema_version": 1, + "task_id": "independent-moment", + "priority_revision": 6, + "base_commit": "20ecf2891d80b5acf18d980b2164fb44ea7faa90", + "original_card": { + "id": "independent-moment", + "question": "Does one changed supplier or assembly claim lack a source-bound independent check of a specific new implication?", + "starting_points": [ + "certificates/selected-result.json", + "research/rank7-joint-endframes/README.md", + "docs/research/research-family-status.md" + ], + "methods": [ + "Independently reconstruct a coordinated frame/circuit change and its single-change control, then derive the complete rank and physical ledger.", + "Implement certified moment inequalities through a different exact enclosure method." + ], + "acceptance_gate": "Demonstrate independence, source binding, positive cases and semantic failure controls. Name the existing checks and the missing coverage. More digits or another equivalent evaluation of an unchanged root is not by itself new verification coverage.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read #2979 joint rank-7 end-frame proposal and the revision-6 evidence status. Its claimed kappa is not selected. Compare coordinated changes with the losing single-change controls and locate the complete physical ledger; an aggregate moment alone does not validate the mechanism.", + "scope": "Positive control / source-bound orientation only; this is not a new construction or full cold replay." + }, + "first_experiment": "Prioritize a bounded independent audit of #2979: reconstruct one joint group and its single-lowering control, check the declared frames/chronology, then trace changed children, idle widths and cleanup buffers into the complete invoice and both supplier caps. Choose one still-missing implication after checking existing audits. Stop with exact unresolved dependencies if full admission exceeds the session; do not launch a new lowering census on an unvalidated premise or substitute extra root digits for mechanism checking.", + "bottleneck_link": "Independent pricing prevents unsupported frontier claims and can reveal genuine accounting slack.", + "allowed_variations": [ + "Reconstruct either a source ledger or a numeric enclosure with a different method." + ], + "scope_change_triggers": [ + "Importing the primary function and calling its output independent verification.", + "Promoting #2979 from merged source archive to validated supplier solely from author PASS receipts or aggregate pricing." + ], + "overlap_terms": [ + "independent moment", + "rank histogram", + "exact enclosure", + "2979", + "rank7 joint endframes", + "paired extraction", + "joint lowering" + ] + }, + "scope_status": "refined", + "actual_scope": "PR3605 (head 3efbb5de) staged helpers 644 and 660 only: bind their emitted native entering wrappers, climbs, FULL exit adapters and direct scalar clocks to the source words in both orientations and both providers, and check the shared span(429,30)->FULL width-7 residual and every climb recipe on all 512 Gaussian columns with Sagar Thakrar's separately written kernel (no bw_* code in the identity check). The parent PR3133 words through the same producer are the single-change control. Extension: the same binding and kernel check on the consumer words that retime the 644/660 releases, RETIMED644-660 (#3642 head 6568db75, byte-identical in #3653 head 607a09ff) and DELAYED (#3682 head 431e6c60), with PR3605's STAGED words as the single-change control, each regenerated emission bound to the producing PR's recorded LOCAL-CHECKS receipt.", + "scope_change_reason": "The card's first experiment targets #2979, whose four rank-7 groups already have native residual audits (group A, #3411 group B, the group-C package, group D). The live #2979-descendant line (PR3605 and the consumers that reuse its STAGED words: #3624, #3626, #3630, #3633, #3638) changes exactly one native residual, the span(429,30) entrance of ordinary FULL helpers 644/660. PR3687 checked those words as free-operator identities and left the native phases of this entrance as its open question 1, asking for a check without the bw_* lineage code. This package answers that one question. The extension answers the package's own first open question: the retimed (#3642/#3653) and delayed (#3682) consumers use different words, so the check covers them only if those words keep the same native entrance.", + "bottleneck_link": "The whole 8->7 width saving of PR3605 rests on the native wrapper identity for span(429,30), and every listed consumer inherits it. A width saving that the native residual does not realize would cancel the consumers' conditional gains.", + "budget_minutes": 60, + "stop_rule": "Finish the finite native binding and separate-kernel identity for helpers 644/660 in the STAGED, RETIMED and DELAYED words, with the parent PR3133 and STAGED single-change controls. No owner journal, release, root or kappa work; record any changed entrance or recipe as a finding; stop at a source mismatch or a failed identity.", + "outcome": "completed", + "evidence": "RESULT.json via verify.py: for both providers and both orientations, helpers 644/660 have one pre/post residual wrapper pair at frame span(429,30) with no terminal field, one new_to_old exit adapter at FULL, no private buffer, and climbs [2,1,2,1,1] / [2,2,1,1,1] summing to 7; all 17 direct scalar clocks per helper match the source word. The shared recipe (key 137) satisfies L*F_7*R = T_FULL*T_E^-1 (operator order, rightmost first) phase-exactly on all 512 columns under the separate kernel; the wrapped and inverse-transpose forms, which follow from it, are also evaluated. Ten distinct climb recipes also pass. The parent PR3133 words give width 8 with first climbs 3 instead of 2, every climb ending at the same frame; only 644/660 change entrance/terminal pairs. Serialized residual recipes go 56 -> 57; pair classes go 57 -> 58, counting the unwrapped cold class ([], FULL). Seven residual controls per provider are rejected: three at the all-column operator check (global phase, parent right-wrapper alias, wrong plane [429,18]) and four at the width check. Consumers: for RETIMED644-660 (#3642, reused byte for byte by #3653) and DELAYED (#3682), both providers and both orientations, the LF-form regenerated LOCAL-CHECKS.json equals the producing PR's recorded receipt (11743473... and 7ff1aabb...); the reconstructed residual-adapter file equals the STAGED one (all 57 recipes and 72 warp records); no helper changes its entrance/terminal pair; 644/660 keep key 137, the span(429,30) wrapper pair, the FULL exit adapter and the STAGED climb frames and ranks, and the width-7 recipe passes the separate kernel; all 17 direct scalar clocks per helper match the consumer word, and binding the STAGED word to a consumer program is rejected. The first climb moves B1045->B592 and B1085->B642 (RETIMED) or B1045->B1043 and B1085->B1084 (DELAYED). Only donors 640/656 change climbs, [1,2,2,1,1,1] -> [3,2,1,1,1], and both merged climb recipes span(30)->span(423,65,20,10) and span(30)->span(427,96,24,6) pass the separate kernel. The LOCAL-CHECKS digest is now taken in LF form (bw_emit.py writes CRLF on Windows), which makes the receipt platform-independent. test_verify.py: 8 tests; emitted-stream, recipe, word, pin and consumer-comparison corruptions are rejected, each consumer corruption at its own check. Local-only (not registered): the producer's own bw_adapters.py under Python 3.13.1 and numpy 2.2.2 writes a RESIDUAL-ADAPTERS.json whose LF-normalized bytes equal this package's reconstruction for both providers.", + "author": "Mainzu", + "ai_assistance": "Substantial assistance from Claude Code (Anthropic, Claude Opus 5.5) for source search, the verifier and drafting; no independent human review is claimed.", + "open_questions": [ + { + "question": "Do all 57 serialized residual recipes and all 72 warp records (240 emitted warp events) of the staged words pass the separate kernel, not only the changed recipe?", + "why_it_matters": "This package checks the one residual recipe that PR3605 changes; the other 56 are inherited from the PR3133 parent and rely on the bw_gauss lineage check or earlier group audits. The STAGED, RETIMED and DELAYED adapter files are identical, so one run covers all three word families.", + "first_step": "Loop check_recipe over every key of the reconstructed adapter file and check each warp K record as a monomial identity with the same kernel; record the runtime.", + "blocked_by": "Not attempted; it extends coverage rather than answering PR3687's open question." + }, + { + "question": "Does the complete emitted 644/660 lane, including scalar macros and the warps of their partners, realize the free-operator identity phase-exactly under an independent simulator?", + "why_it_matters": "Correct wrapper and climb recipes do not by themselves prove that the emitted scalar macros between them are phase-exact; PR3605 checks that with the inherited bw_phases stage. For the consumers it would also check natively that the moved releases commute with the gates they cross, which this package binds only as emission clocks.", + "first_step": "Simulate the emitted forward stream on basis inputs supported on the 644/660 lanes with the separate kernel's Gaussian state and compare with the free-operator endpoint from PR3687.", + "blocked_by": "Needs an independent emitted-event interpreter for scalar macros and warps, which neither this package nor the group audits provide." + }, + { + "question": "Which open PRs carry 644/660 words that differ from the STAGED, RETIMED and DELAYED bytes checked here?", + "why_it_matters": "This package covers exactly six words (three families, two providers); a consumer that vendors further-edited words is not covered until it passes the same comparison.", + "first_step": "List the blob ids of *644-660*.json.gz and DELAYED-*.json.gz files across open PR heads with git ls-tree, and run the consumer comparison (common.CONSUMERS plus a pin) on any new bytes.", + "blocked_by": "Not attempted; only #3642, #3653 and #3682 were fetched for this extension." + } + ], + "existing_checks": [ + { + "pr": 3605, + "head": "3efbb5de06a49ffeea6684482f2d3fe48cdca3fb", + "scope": "Author's registered native chain on the staged words: bw_audit_local.py checks every emitted residual wrapper, climb and scalar frame, bw_adapters.py checks every entrance recipe, bw_phases.py and bw_check_recipes.py run as well, and check_residual.py checks the changed span(429,30)->FULL pair; all rely on the bw_gauss lineage kernel. Independence from that lineage is the missing coverage." + }, + { + "pr": 3687, + "head": "f798838eb8ede4178e94f240e7b7e54b3f80c82d", + "scope": "Independent free-operator identity, frames, cleanup and invoice of the staged words; native phases of the span(429,30) entrance left as open question 1." + }, + { + "pr": 3681, + "head": "9f7813943b488d386407b1f4fdc1a3b2a8d39f84", + "scope": "Fresh-bootstrap replay of PR3605's full wrapper; runs the inherited native chain, not an independent kernel." + }, + { + "pr": 3642, + "head": "6568db75adbb61437190545f6fef1534c70e91e5", + "scope": "Author's RETIMED644-660 words, minimal commuting/frame proof, free-operator replay and separate native runs that its PROOF.md says check ledger, wrapper, phase and warp contracts; its recorded LOCAL-CHECKS receipt is bound here." + }, + { + "pr": 3653, + "head": "607a09ff441c79b215a8127a81f4cc70021d0d9b", + "scope": "Reuses #3642's RETIMED644-660 words byte for byte in its T488 composition; covered here through those bytes." + }, + { + "pr": 3682, + "head": "431e6c6023ef352c41696469de7fb614cd4ded8c", + "scope": "Author's DELAYED words, commuting argument and two five-stage native runs with the inherited lineage chain; its recorded LOCAL-CHECKS receipt is bound here." + }, + { + "package": "research/rank7-group-d-native-widths-audit", + "scope": "Method and code adapted here (as are group A, #3411 group B and group C); its helpers and words are disjoint from 644/660 on the staged words." + } + ], + "dependency_heads": { + "3605": "3efbb5de06a49ffeea6684482f2d3fe48cdca3fb", + "3642": "6568db75adbb61437190545f6fef1534c70e91e5", + "3653": "607a09ff441c79b215a8127a81f4cc70021d0d9b", + "3682": "431e6c6023ef352c41696469de7fb614cd4ded8c", + "3687": "f798838eb8ede4178e94f240e7b7e54b3f80c82d" + }, + "selection": { + "track": "independent-verification", + "task_id": "independent-moment", + "picker_seed": "545f4d3833045bd0390a6883a5a80aba", + "method": "The picker drew independent-verification. The #1166 PR3605 replay handoff was already done by #3681, and #2979's groups are all bound, so the task is PR3687's open question 1.", + "canonical_thread": "https://github.com/CrocSwap/integer-mult-bounds/discussions/3606" + }, + "unchecked_obligations": [ + "Native phases of all other residual classes, warps and scalar macros under an independent kernel", + "That the consumers' moved releases commute with the gates they cross (their authors' argument; bound here only as emission clocks)", + "Other climbs and residuals of the donors 640/656", + "644/660 words on PR heads other than #3605, #3642, #3653 and #3682", + "Owner journals, physical stock, prefix/precision/tape and the T740 or consumer (T530, T488, T360) releases and their kappa", + "Inherited all-size compiler, analytic transfer and BIT hypotheses" + ], + "result_kind": "finite native/interface audit; no defect found in stated scope", + "refresh_checkpoint": { + "at_utc": "2026-10-18T18:40:00Z", + "canonical_main": "20ecf2891d80b5acf18d980b2164fb44ea7faa90", + "priority_revision": 6, + "selected_kappa": "0.001672660197076918", + "changes": "None since the previous checkpoint (17:25 UTC, open PRs through #3701 checked for overlap); git ls-remote confirms main and the #3605, #3642, #3653, #3682 and #3687 heads are unchanged." + } +} diff --git a/research/staged-644-660-native-binding-audit/VERIFY.json b/research/staged-644-660-native-binding-audit/VERIFY.json new file mode 100644 index 0000000000..7a1fb27966 --- /dev/null +++ b/research/staged-644-660-native-binding-audit/VERIFY.json @@ -0,0 +1,35 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/t74-native-fast/vendor/native/new/code/borrow/bw_transport.py", + "research/t74-native-fast/vendor/native/new/code/borrow/bw_emit.py", + "research/t74-native-fast/vendor/native/new/code/borrow/vendor/clifford/clifford_exact.py", + "research/frontier1094-recipes-exact-seed76/clifford.py", + "research/rank7-coupled-586-588-carrier-fold/edits/FINAL-WORD-base.json.gz", + "research/rank7-coupled-586-588-carrier-fold/edits/FINAL-WORD-extra.json.gz" + ], + "commands": [ + { + "argv": [ + "{python}", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 600, + "checks": "Source-bound emitted 644/660 entering wrappers, climbs, FULL exit adapters and direct scalar clocks in both orientations and providers; separate-kernel all-512-column phase-exact width-7 residual and every climb; parent PR3133 single-change control; seven residual controls per provider; the RETIMED644-660 (#3642/#3653) and DELAYED (#3682) consumer words against the STAGED control: recorded native receipts, identical residual adapters and entrance/terminal pairs, 644/660 bindings with the separate-kernel width-7 check, and donor-only merged climbs checked by the same kernel." + }, + { + "argv": [ + "{python}", + "-B", + "{package}/test_verify.py", + "-v" + ], + "timeout_seconds": 600, + "checks": "Emitted-stream, recipe, source-pin and consumer-comparison corruptions must be rejected through the main binding and kernel paths, each consumer corruption at its own check." + } + ] +} diff --git a/research/staged-644-660-native-binding-audit/common.py b/research/staged-644-660-native-binding-audit/common.py new file mode 100644 index 0000000000..7128671657 --- /dev/null +++ b/research/staged-644-660-native-binding-audit/common.py @@ -0,0 +1,148 @@ +# SPDX-License-Identifier: Apache-2.0 +"""Bounded source loading for the staged 644/660 native-binding audit. + +Adapted from research/rank7-group-d-native-widths-audit/common.py (Wentao Li). +""" + +import gzip +import hashlib +import io +import json +import sys +import types +from pathlib import Path + +PACKAGE = Path(__file__).resolve().parent +ROOT = PACKAGE.parents[1] +LOCAL = "research/staged-644-660-native-binding-audit/inputs/" +SNAPSHOT = "research/staged-644-660-width-reduction/" +PR3605 = "3efbb5de06a49ffeea6684482f2d3fe48cdca3fb" +PR3642 = "6568db75adbb61437190545f6fef1534c70e91e5" +PR3653 = "607a09ff441c79b215a8127a81f4cc70021d0d9b" +PR3682 = "431e6c6023ef352c41696469de7fb614cd4ded8c" +# Consumer words that retime the 644/660 releases: package copy stem -> the same +# bytes pinned at each PR head under its original path ({tag} is the provider). +CONSUMERS = { + "RETIMED644-660": { + PR3642: "research/staged-release-retiming-t530/local-audit/words/RETIMED644-660-{tag}.json.gz", + PR3653: "research/retimed-t488-composition/local-audit/words/RETIMED644-660-{tag}.json.gz"}, + "DELAYED": {PR3682: "research/staged-donor-release/lead1-words/DELAYED-{tag}.json.gz"}, +} +# LOCAL-CHECKS.json receipts recorded by each consumer's own native run. +RECEIPTS = { + "RETIMED644-660": {PR3642: "research/staged-release-retiming-t530/local-audit/receipts/" + "native-{tag}/native/local/LOCAL-CHECKS.json"}, + "DELAYED": {PR3682: "research/staged-donor-release/evidence/native-{tag}/LOCAL-CHECKS.json"}, +} +# The release donors whose climbs the consumer words merge. +DONORS = (640, 656) +PARENT = "research/rank7-coupled-586-588-carrier-fold/edits/" +ENGINE = "research/t74-native-fast/vendor/native/new/code/borrow/" +COMPILER = ENGINE + "vendor/clifford/clifford_exact.py" +KERNEL = "research/frontier1094-recipes-exact-seed76/clifford.py" +PROVIDERS = ("base", "extra") +HELPERS = (644, 660) +FULL = [256, 128, 64, 32, 16, 8, 4, 2, 1] +ENTRANCE = [429, 30] +PARENT_ENTRANCE = [30] +# Same dimension as ENTRANCE and in reduced echelon form; it contains 429 but not 30. +WRONG_ENTRANCE = [429, 18] +# The contained line 429 (dimension one, so a different native width). +CONTAINED_LINE = [429] +LIMIT = 64 * 1024 * 1024 + + +def require(ok, message): + if not ok: + raise ValueError(message) + + +def unique(pairs): + result = dict(pairs) + require(len(result) == len(pairs), "duplicate JSON key") + return result + + +def decode(raw, compressed=False): + if compressed: + with gzip.GzipFile(fileobj=io.BytesIO(raw)) as stream: + raw = stream.read(LIMIT + 1) + require(len(raw) <= LIMIT, "decoded input capacity") + return json.loads(raw, object_pairs_hook=unique) + + +def digest(raw): + return hashlib.sha256(raw).hexdigest() + + +def encoded(value): + return (json.dumps(value, sort_keys=True, separators=(",", ":")) + "\n").encode() + + +def authenticate(root=ROOT): + rows = decode((PACKAGE / "SOURCES.json").read_bytes())["files"] + pins = {r["path"]: r["sha256"] for r in rows if r["usage"] == "input"} + declared = set(decode((PACKAGE / "VERIFY.json").read_bytes())["inputs"]) + require(set(pins) == declared and len(pins) <= 16, "exact live input inventory") + # Package-local copies of PR3605's and the consumers' words: their bytes must + # equal the provenance rows pinned at each PR head under the original path. + for tag in PROVIDERS: + pins[staged_name(tag)] = pinned(rows, PR3605, SNAPSHOT + f"STAGED644-660-{tag}.json.gz") + for stem in CONSUMERS: + pins[consumer_name(stem, tag)] = agreed(rows, CONSUMERS[stem], tag) + blobs = {} + for name, sha in pins.items(): + path = root / name + require(path.stat().st_size <= LIMIT, "raw input capacity") + raw = path.read_bytes() + require(digest(raw) == sha, "source SHA256: " + name) + blobs[name] = raw + return blobs + + +def pinned(rows, head, origin): + row = [r for r in rows if r["path"] == origin] + require(len(row) == 1 and row[0]["usage"] == "provenance" and + row[0].get("pin") == f"head:{head}:{origin}", "snapshot provenance pin") + return row[0]["sha256"] + + +def agreed(rows, origins, tag): + """One SHA-256 shared by every PR head that carries the same file.""" + shas = {pinned(rows, head, path.format(tag=tag)) for head, path in origins.items()} + require(len(shas) == 1, "identical bytes at every pinned PR head") + return shas.pop() + + +def recorded_receipts(): + rows = decode((PACKAGE / "SOURCES.json").read_bytes())["files"] + return {stem: {tag: agreed(rows, RECEIPTS[stem], tag) for tag in PROVIDERS} + for stem in CONSUMERS} + + +def staged_name(tag): + return LOCAL + f"STAGED644-660-{tag}.json.gz" + + +def consumer_name(stem, tag): + return LOCAL + f"{stem}-{tag}.json.gz" + + +def parent_name(tag): + return PARENT + f"FINAL-WORD-{tag}.json.gz" + + +def module(raw, name): + """Compile authenticated bytes directly, without consulting a .pyc file.""" + result = types.ModuleType(name) + sys.modules[name] = result + exec(compile(raw, name, "exec"), result.__dict__) + return result + + +def reject(action, reason): + try: + action() + except (ValueError, AssertionError) as error: + return str(error) + raise ValueError("control accepted: " + reason) diff --git a/research/staged-644-660-native-binding-audit/inputs/DELAYED-base.json.gz b/research/staged-644-660-native-binding-audit/inputs/DELAYED-base.json.gz new file mode 100644 index 0000000000..7ccd0962b8 Binary files /dev/null and b/research/staged-644-660-native-binding-audit/inputs/DELAYED-base.json.gz differ diff --git a/research/staged-644-660-native-binding-audit/inputs/DELAYED-extra.json.gz b/research/staged-644-660-native-binding-audit/inputs/DELAYED-extra.json.gz new file mode 100644 index 0000000000..3f1fb47183 Binary files /dev/null and b/research/staged-644-660-native-binding-audit/inputs/DELAYED-extra.json.gz differ diff --git a/research/staged-644-660-native-binding-audit/inputs/RETIMED644-660-base.json.gz b/research/staged-644-660-native-binding-audit/inputs/RETIMED644-660-base.json.gz new file mode 100644 index 0000000000..d69125e0c7 Binary files /dev/null and b/research/staged-644-660-native-binding-audit/inputs/RETIMED644-660-base.json.gz differ diff --git a/research/staged-644-660-native-binding-audit/inputs/RETIMED644-660-extra.json.gz b/research/staged-644-660-native-binding-audit/inputs/RETIMED644-660-extra.json.gz new file mode 100644 index 0000000000..f3c580b065 Binary files /dev/null and b/research/staged-644-660-native-binding-audit/inputs/RETIMED644-660-extra.json.gz differ diff --git a/research/staged-644-660-native-binding-audit/inputs/STAGED644-660-base.json.gz b/research/staged-644-660-native-binding-audit/inputs/STAGED644-660-base.json.gz new file mode 100644 index 0000000000..dc6d321b1e Binary files /dev/null and b/research/staged-644-660-native-binding-audit/inputs/STAGED644-660-base.json.gz differ diff --git a/research/staged-644-660-native-binding-audit/inputs/STAGED644-660-extra.json.gz b/research/staged-644-660-native-binding-audit/inputs/STAGED644-660-extra.json.gz new file mode 100644 index 0000000000..78e7b2bb06 Binary files /dev/null and b/research/staged-644-660-native-binding-audit/inputs/STAGED644-660-extra.json.gz differ diff --git a/research/staged-644-660-native-binding-audit/native.py b/research/staged-644-660-native-binding-audit/native.py new file mode 100644 index 0000000000..4ac817f3af --- /dev/null +++ b/research/staged-644-660-native-binding-audit/native.py @@ -0,0 +1,443 @@ +# SPDX-License-Identifier: Apache-2.0 +"""Bind the emitted 644/660 entering wrappers, then check them with a separate exact kernel. + +The retained t74-native-fast bw_transport.py/bw_emit.py and the PR458-lineage +adapter convention are producers, not independent evidence. The separately +implemented Gaussian kernel is Sagar Thakrar's retained verifier; neither is new +here. Adapted from research/rank7-group-d-native-widths-audit/native.py (Wentao +Li), itself adapted from the group-A/B/C audits, to PR3605's ordinary FULL-terminal +helpers 644/660. Unlike the restored group helpers, these have no private buffer: +they are wrapped by one residual pair and leave through one ordinary exit adapter. +The consumer words that retime the 644/660 releases (PR3642/PR3653 RETIMED, PR3682 +DELAYED) go through the same binding, with PR3605's STAGED words as the control. +""" + +import copy +import os +import subprocess +import sys + +from common import (COMPILER, CONSUMERS, CONTAINED_LINE, DONORS, ENGINE, ENTRANCE, FULL, + HELPERS, KERNEL, PARENT_ENTRANCE, PROVIDERS, WRONG_ENTRANCE, + consumer_name, decode, digest, encoded, module, parent_name, + recorded_receipts, reject, require, staged_name) + + +def bind_program_receipts(programs, checks): + require(set(programs) == set(checks) == {"forward", "backward"}, + "both emitted orientations") + for orientation, events in programs.items(): + row = checks[orientation] + require(row["events"] == len(events) and + row["sha256"] == digest(encoded(events)[:-1]), + "event stream digest in emitted receipt") + + +def generate(blobs, raw_word, work): + """Run the unchanged producer on authenticated bytes in a fresh directory.""" + work.mkdir(exist_ok=True) + tools = work / "tools" + tools.mkdir() + for name in ("bw_transport.py", "bw_emit.py"): + (tools / name).write_bytes(blobs[ENGINE + name]) + word = work / "WORD.json.gz" + word.write_bytes(raw_word) + output = work / "local" + env = dict(os.environ, PYTHONDONTWRITEBYTECODE="1") + env.pop("PYTHONOPTIMIZE", None) + for script, args in (("bw_transport.py", [word, output]), ("bw_emit.py", [output])): + run = subprocess.run([sys.executable, "-I", "-B", str(tools / script), + *map(str, args)], env=env, capture_output=True, + text=True, timeout=120, check=False) + require(run.returncode == 0, script + ": " + run.stderr[-2000:]) + # bw_emit.py writes this receipt with write_text (CRLF on Windows); digest the + # LF form so the receipt is platform-independent and matches recorded runs. + checks = (output / "LOCAL-CHECKS.json").read_bytes().replace(b"\r\n", b"\n") + canonical = decode((output / "CANONICAL-WORD.json.gz").read_bytes(), True) + programs = decode((output / "LOCAL-PROGRAMS.json.gz").read_bytes(), True) + bind_program_receipts(programs, decode(checks)) + return canonical, programs, digest(checks) + + +def adapter_file(compiler, canonical): + """Reconstruct the serialized residual-adapter file by the PR458-lineage convention.""" + frames = canonical["frames"] + pairs = {(canonical["start"][r], canonical["final"][r]) + for r in range(224, 632)} + recipes, warps = {}, {} + for e, u in sorted(pairs): + if u == 1 and e == 0: + continue + entrance, terminal = frames[e], frames[u] + op = compiler.canonical_frame(9, tuple(entrance)).adjoint().then( + compiler.canonical_frame(9, tuple(terminal))) + rec, _ = compiler.lower_child(op) + row = dict(frame=e, vectors=entrance, entrance_rank=len(entrance), + rank=rec["rank"], left=rec["left"], right=rec["right"]) + key = str(e) + if u != 1: + row.update(terminal=u, terminal_vectors=terminal, terminal_rank=len(terminal)) + key = f"{e}:{u}" + recipes[key] = row + for w in canonical["warps"]: + columns = tuple(w["G_columns"]) + matrix = compiler.transpose(columns, 9) + inverse_columns = compiler.transpose(compiler.inv(matrix, 9), 9) + q = tuple((1 << i) ^ sum(compiler.parity(a & b) << j + for j, b in enumerate(inverse_columns)) + for i, a in enumerate(inverse_columns)) + op = compiler.perm(9, matrix).then(compiler.diag(9, q)) + _, rec = compiler.monomial(op) + warps[str(w["op"])] = dict(op=w["op"], from_frame=w["from_frame"], + to_frame=w["to_frame"], G_columns=w["G_columns"], K=rec) + return decode(encoded(dict(status="RESIDUAL_ADAPTER_RECIPES", recipes=recipes, warps=warps))) + + +def conjugate(circuit): + out = [] + for gate in circuit: + if gate[0] == "C": + out.append(("C", gate[1], -gate[2])) + elif gate[0] == "D": + out.append(("D", gate[1], [-a % 4 for a in gate[2]])) + elif gate[0] == "PH": + out.append(("PH", -gate[1] % 4)) + else: + require(gate[0] in ("P", "X"), "real monomial primitive") + out.append(gate) + return out + + +def check_recipe(kernel, rec, entrance, terminal): + width = len(terminal) - len(entrance) + require(type(rec["rank"]) is int and rec["rank"] == width, "entrance-relative width") + require(kernel.well_formed(rec["left"]) and + (rec["right"] is None or kernel.well_formed(rec["right"])), + "serialized monomials") + left = kernel.monomial(rec["left"]) + right = [] if rec["right"] is None else kernel.monomial(rec["right"]) + reference = kernel.adjoint(kernel.canonical_frame(entrance)) + kernel.canonical_frame(terminal) + candidate = right + kernel.fourier(width) + left + wrapped = kernel.adjoint(right) + reference + kernel.adjoint(left) + require(kernel.same_operator(candidate, reference), "phase-exact all-column residual") + require(kernel.same_operator(wrapped, kernel.fourier(width)), "wrapped coordinate factor") + require(kernel.same_operator(conjugate(wrapped), kernel.fourier(width, -1)), + "inverse-transpose coordinate factor") + return {"rank": width, "columns": 512, "orientations": 2, + "spectator_axes": 9 - width, "recipe": rec} + + +def source_events(word, helper): + """Reconstruct all direct scalar clocks and climbs of one ordinary helper from its word.""" + require(str(helper) not in word["helper_final"], "ordinary FULL-terminal helper") + touched = {helper} + for section in ("precondition", "compensation", "cut"): + require(all(not (touched & set(g[1:3] if g[0] == "add" else g[1:2])) + for g in word[section]), "no uncovered direct source section") + require(all(not (touched & {c["source"], c["target"]}) + for c in word["initial_corrections"]), "no uncovered direct correction") + require(all(w[1] != helper for w in word["warps"]), "no direct lender warp") + scalars, climbs = [], [] + current = word["start_extra"].get(str(helper), []) + for section, phase in (("A", "A"), ("B", "B"), ("restore", "cleanup_tail")): + clock = 0 + for gate in word[section]: + regs = gate[1:3] if gate[0] == "add" else gate[1:2] + if touched & set(regs): + require(gate[0] in ("add", "scale"), "no direct source warp") + if current != gate[-1]: + climbs.append([phase, clock, current, gate[-1], len(gate[-1]) - len(current)]) + current = gate[-1] + scalars.append([phase, clock, gate[:-1], gate[-1]]) + clock += gate[0] != "warp" + if current != FULL: + # The emitter's final phase lifts every ordinary helper to FULL before cleanup. + climbs.append(["final", 0, current, FULL, len(FULL) - len(current)]) + clock = 0 + for gate in word["cleanup"]: + regs = gate[1:3] if gate[0] == "add" else gate[1:2] + if touched & set(regs): + require(gate[0] in ("add", "scale") and gate[-1] == FULL, "FULL-frame cleanup") + scalars.append(["full_frame_cleanup", clock, gate[:-1], gate[-1]]) + clock += gate[0] != "warp" + return scalars, climbs + + +def scalar_original(operation, kept, backward): + require(operation[0] in ("add", "scale", "copy", "clear"), "known emitted scalar") + count = 2 if operation[0] in ("add", "copy") else 1 + regs = [] + for kind, r in operation[1:1 + count]: + require(kind in ("L", "Z", "C"), "register namespace") + regs.append(-1 if kind == "C" else kept[r] + (704 if kind == "Z" else 0)) + row = [operation[0], *regs, *operation[1 + count:]] + if backward and row[0] == "add": + row[1], row[2], row[3] = row[2], row[1], -row[3] + elif backward and row[0] == "scale": + row[2], row[3] = row[3], row[2] + return row, regs + + +def emitted_binding(word, canonical, stream, helper, backward=False): + """Entrance wrapper pair, climbs, one FULL exit adapter and direct scalar clocks.""" + kept = [r for r in range(704) if r not in word["removed"]] + require(canonical["helper_origin"] == kept[224:], "original-to-compact binding") + r = kept.index(helper) + e, u = canonical["start"][r], canonical["final"][r] + entrance = word["start_extra"].get(str(helper), []) + require(entrance and canonical["frames"][e] == entrance and u == 1 and + canonical["frames"][u] == FULL, "literal entrance/FULL pair") + require(r not in canonical["zero_buffers"], "ordinary helper has no private buffer") + wrappers, adapters, climbs, scalars, climb_clocks, scalar_indices = [], [], [], [], [], [] + phase, clock = None, 0 + for i, event in enumerate(stream): + if event[0] == "phase": + phase, clock = event[1], 0 + elif event[0] == "residual_adapter" and event[2] == r: + require(event[3:] == [e], "emitted wrapper entrance without terminal") + wrappers.append([i, event[1], phase]) + elif event[0] == "adapter" and event[2] == r: + adapters.append([i, event[1], event[3], phase]) + elif event[0] == "zero_buffer": + require(event[2] != r, "no private lifetime for an ordinary helper") + elif event[0] == "climb" and event[2] == r: + old, new = (canonical["frames"][f] for f in event[3:5]) + require(event[5] == len(new) - len(old) > 0, "emitted climb rank") + climbs.append({"index": i, "old": old, "new": new, "rank": event[5]}) + climb_clocks.append([phase, clock, old, new, event[5]]) + elif event[0] == "scalar": + row, regs = scalar_original(event[1], kept, backward) + require(["Z", r] not in event[1][1:3], "no private register use") + if helper in regs: + scalars.append([phase, clock, row, canonical["frames"][event[2]]]) + scalar_indices.append(i) + clock += 1 + elif event[0] == "warp": + require(event[1] not in (["L", r], ["Z", r]), "no unaccounted direct warp") + expected_scalars, expected_climbs = source_events(word, helper) + require(scalars == expected_scalars and climb_clocks == expected_climbs, + "source-to-emission direct scalar/climb clocks") + require([x[1:] for x in wrappers] == [["pre", "entry_adapters"], ["post", "full_frame_cleanup"]], + "two residual wrappers") + require([x[1:] for x in adapters] == [["new_to_old", 1, "exit_adapters"]], + "one ordinary FULL exit adapter and no entry adapter") + cleanup = [i for i, s in zip(scalar_indices, scalars) if s[0] == "full_frame_cleanup"] + require(cleanup and wrappers[0][0] < climbs[0]["index"] and + climbs[-1]["index"] < adapters[0][0] < min(cleanup) and + max(scalar_indices) < wrappers[1][0], "wrapper, climbs, exit, cleanup order") + current = entrance + for climb in climbs: + require(climb["old"] == current, "complete direct climb chain") + current = climb["new"] + require(current == FULL and sum(c["rank"] for c in climbs) == len(FULL) - len(entrance), + "complete entrance-relative path") + return {"compact_helper": r, "recipe_key": str(e), "entrance": entrance, + "terminal": FULL, "wrappers": [x[:2] for x in wrappers], + "exit_adapter": adapters[0][:3], "climbs": climbs, + "direct_scalar_count": len(scalars), + "cleanup_scalar_count": len(cleanup), + "direct_scalar_sha256": digest(encoded(scalars))} + + +def check_climb(compiler, kernel, old, new, climb_recipes): + """Lower one climb with the source compiler and check it with the separate kernel.""" + identity = encoded([old, new]).decode().strip() + if identity not in climb_recipes: + op = compiler.canonical_frame(9, tuple(old)).adjoint().then( + compiler.canonical_frame(9, tuple(new))) + candidate, _ = compiler.lower_child(op) + climb_recipes[identity] = check_recipe(kernel, decode(encoded(candidate)), old, new)["rank"] + return identity + + +def climb_chains(word, canonical, stream): + """Original helper id -> its emitted [old, new, rank] climbs in stream order.""" + kept = [r for r in range(704) if r not in word["removed"]] + chains = {} + for event in stream: + if event[0] == "climb": + old, new = (canonical["frames"][f] for f in event[3:5]) + chains.setdefault(kept[event[2]], []).append([old, new, event[5]]) + return chains + + +def recipe_classes(adapters): + """Serialized residual recipes by literal entrance and terminal vectors.""" + return {encoded([row["vectors"], row.get("terminal_vectors", FULL)]) + for row in adapters["recipes"].values()} + + +def pair_inventory(canonical, word): + """Original helper id -> literal entrance/terminal vectors for every compact helper.""" + kept = [r for r in range(704) if r not in word["removed"]] + frames = canonical["frames"] + return {kept[r]: (frames[canonical["start"][r]], frames[canonical["final"][r]]) + for r in range(224, 632)} + + +def provider(blobs, tag, work, compiler, kernel, climb_recipes): + raw = blobs[staged_name(tag)] + word = decode(raw, True) + canonical, programs, checks_sha = generate(blobs, raw, work / "staged") + adapters = adapter_file(compiler, canonical) + bindings, residuals = {}, {} + for h in HELPERS: + bindings[str(h)] = {orientation: emitted_binding(word, canonical, stream, h, + orientation == "backward") + for orientation, stream in programs.items()} + forward, backward = bindings[str(h)]["forward"], bindings[str(h)]["backward"] + require(forward["entrance"] == ENTRANCE and + [c["rank"] for c in forward["climbs"]] == [c["rank"] for c in backward["climbs"]], + "staged entrance in both orientations") + key = forward["recipe_key"] + row = adapters["recipes"][key] + require(row["vectors"] == ENTRANCE and "terminal" not in row, "serialized FULL recipe row") + if key not in residuals: + residuals[key] = check_recipe(kernel, row, ENTRANCE, FULL) + for climb in forward["climbs"]: + check_climb(compiler, kernel, climb["old"], climb["new"], climb_recipes) + require(len(residuals) == 1, "one shared entering residual class") + + # Single-change control: the parent PR3133 word through the same producer. + raw_parent = blobs[parent_name(tag)] + parent = decode(raw_parent, True) + canonical_parent, programs_parent, parent_checks_sha = generate(blobs, raw_parent, work / "parent") + parent_bindings = {} + for h in HELPERS: + rows = {orientation: emitted_binding(parent, canonical_parent, stream, h, + orientation == "backward") + for orientation, stream in programs_parent.items()} + require(rows["forward"]["entrance"] == PARENT_ENTRANCE, "parent entrance span(30)") + old_climbs, new_climbs = rows["forward"]["climbs"], bindings[str(h)]["forward"]["climbs"] + # Every climb ends at the same frame; only the first climb's start differs. + require(len(old_climbs) == len(new_climbs) and + [c["new"] for c in old_climbs] == [c["new"] for c in new_climbs] and + [c["old"] for c in old_climbs[1:]] == [c["old"] for c in new_climbs[1:]], + "parent and staged climb frames") + parent_bindings[str(h)] = {"entrance": PARENT_ENTRANCE, + "climb_ranks": [c["rank"] for c in old_climbs], + "direct_scalar_count": rows["forward"]["direct_scalar_count"]} + op = compiler.canonical_frame(9, tuple(PARENT_ENTRANCE)).adjoint().then( + compiler.canonical_frame(9, tuple(FULL))) + parent_recipe, _ = compiler.lower_child(op) + parent_recipe = decode(encoded(parent_recipe)) + parent_check = check_recipe(kernel, parent_recipe, PARENT_ENTRANCE, FULL) + old, new = pair_inventory(canonical_parent, parent), pair_inventory(canonical, word) + require(set(old) == set(new), "same helper names") + changed = sorted(h for h in old if old[h] != new[h]) + require(changed == list(HELPERS) and + all(old[h] == (PARENT_ENTRANCE, FULL) and new[h] == (ENTRANCE, FULL) for h in changed), + "only the two staged entrances change") + classes_old, classes_new = set(map(str, old.values())), set(map(str, new.values())) + require(classes_new - classes_old == {str((ENTRANCE, FULL))}, "one new entrance/terminal class") + # The pair classes include the unwrapped cold class ([], FULL), which has no recipe. + parent_adapters = adapter_file(compiler, canonical_parent) + recipes_old, recipes_new = recipe_classes(parent_adapters), recipe_classes(adapters) + require(recipes_new - recipes_old == {encoded([ENTRANCE, FULL])} and + len(recipes_new) == len(recipes_old) + 1, "one new serialized residual recipe") + + key = bindings["644"]["forward"]["recipe_key"] + rec = adapters["recipes"][key] + controls = {} + controls["omitted_entrance"] = reject(lambda: check_recipe(kernel, rec, [], FULL), "entrance") + controls["contained_line"] = reject(lambda: check_recipe(kernel, rec, CONTAINED_LINE, FULL), + "contained line") + controls["old_entrance"] = reject(lambda: check_recipe(kernel, rec, PARENT_ENTRANCE, FULL), + "parent entrance") + bad = copy.deepcopy(rec); bad["left"]["phase"] = (bad["left"]["phase"] + 1) % 4 + controls["phase"] = reject(lambda: check_recipe(kernel, bad, ENTRANCE, FULL), "phase") + require(parent_recipe["right"] != rec["right"], "distinct parent right wrapper") + bad = copy.deepcopy(rec); bad["right"] = parent_recipe["right"] + controls["parent_wrapper_alias"] = reject(lambda: check_recipe(kernel, bad, ENTRANCE, FULL), + "parent alias") + # Same dimension, different plane: the check is operator-level, not metadata. + controls["wrong_entrance_plane"] = reject( + lambda: check_recipe(kernel, rec, WRONG_ENTRANCE, FULL), "wrong plane") + controls["parent_recipe_at_new_entrance"] = reject( + lambda: check_recipe(kernel, parent_recipe, ENTRANCE, FULL), "parent recipe") + record = {"word_sha256": digest(raw), "parent_word_sha256": digest(raw_parent), + "local_checks_sha256": checks_sha, "parent_local_checks_sha256": parent_checks_sha, + "adapter_sha256": digest(encoded(adapters)), "bindings": bindings, + "residuals": residuals, "parent_bindings": parent_bindings, + "parent_residual": parent_check, "changed_helpers": changed, + "pair_classes": {"parent": len(classes_old), "staged": len(classes_new)}, + "residual_recipes": {"parent": len(recipes_old), "staged": len(recipes_new)}, + "warp_records": len(canonical["warps"]), + "controls": controls} + return record, (word, canonical, programs, adapters, bindings) + + +def consumer(blobs, stem, tag, work, compiler, kernel, donor_recipes, staged, receipt): + """Bind a consumer word that retimes the 644/660 releases; the STAGED word is the control.""" + raw = blobs[consumer_name(stem, tag)] + canonical, programs, checks_sha = generate(blobs, raw, work / stem) + require(checks_sha == receipt, "recorded consumer native receipt") + record = compare(staged, decode(raw, True), canonical, programs, compiler, kernel, donor_recipes) + return {"word_sha256": digest(raw), "local_checks_sha256": checks_sha, **record} + + +def compare(staged, word, canonical, programs, compiler, kernel, donor_recipes): + """Consumer emission against the STAGED control: entrance side, 644/660, donors.""" + s_word, s_canonical, s_programs, s_adapters, s_bindings = staged + # Entrance side: every serialized recipe and warp record, and every helper's + # entrance/terminal pair, equal the STAGED word's. + adapters = adapter_file(compiler, canonical) + require(adapters == s_adapters, "unchanged serialized residual adapters") + require(pair_inventory(canonical, word) == pair_inventory(s_canonical, s_word), + "unchanged entrance/terminal pairs") + frames = lambda row: [[c["old"], c["new"], c["rank"]] for c in row["climbs"]] + bindings, keys, ranks, clocks, scalars, controls = {}, {}, {}, {}, {}, {} + for h in HELPERS: + rows = {orientation: emitted_binding(word, canonical, stream, h, orientation == "backward") + for orientation, stream in programs.items()} + before, forward = s_bindings[str(h)]["forward"], rows["forward"] + require(forward["entrance"] == ENTRANCE and forward["recipe_key"] == before["recipe_key"] and + frames(forward) == frames(before) and + [c["rank"] for c in rows["backward"]["climbs"]] == [c["rank"] for c in forward["climbs"]], + "unchanged entrance, recipe key and climb frames") + ranks[str(h)] = check_recipe(kernel, adapters["recipes"][forward["recipe_key"]], + ENTRANCE, FULL)["rank"] + (old_scalars, old_climbs), (new_scalars, new_climbs) = (source_events(w, h) + for w in (s_word, word)) + clocks[str(h)] = {"staged": [c[:2] for c in old_climbs], "consumer": [c[:2] for c in new_climbs]} + scalars[str(h)] = sum(row not in old_scalars for row in new_scalars) + # The binding sees the retiming: the STAGED word does not describe this program. + controls[str(h)] = reject(lambda h=h: emitted_binding(s_word, canonical, programs["forward"], h), + "staged word on consumer program") + keys[str(h)] = forward["recipe_key"] + bindings[str(h)] = {orientation: digest(encoded(row)) for orientation, row in rows.items()} + # Only the two release donors change climbs: one direct climb replaces their first + # two (H1 + H2 -> H3), and the separate kernel checks that new climb recipe. + old, new = climb_chains(s_word, s_canonical, s_programs["forward"]), climb_chains( + word, canonical, programs["forward"]) + require(sorted(h for h in old.keys() | new.keys() if old.get(h) != new.get(h)) == list(DONORS), + "only the donors' climb chains change") + merged = {} + for h in DONORS: + before, after = old[h], new[h] + require([c[2] for c in before[:2]] == [1, 2] and after[1:] == before[2:] and + after[0] == [before[0][0], before[1][1], 3], "one merged donor climb") + merged[str(h)] = check_climb(compiler, kernel, after[0][0], after[0][1], donor_recipes) + return {"adapter_sha256": digest(encoded(adapters)), "binding_sha256": bindings, + "recipe_keys": keys, "residual_ranks": ranks, "climb_clocks": clocks, + "changed_scalar_clocks": scalars, + "donor_climb_ranks": {str(h): [[c[2] for c in old[h]], [c[2] for c in new[h]]] + for h in DONORS}, + "merged_donor_climbs": merged, "events": {o: len(p) for o, p in programs.items()}, + "controls": controls} + + +def audit(blobs, work): + compiler = module(blobs[COMPILER], "staged_pair_source_compiler") + kernel = module(blobs[KERNEL], "staged_pair_independent_kernel") + receipts = recorded_receipts() + climb_recipes, donor_recipes, providers, consumers = {}, {}, {}, {} + for tag in PROVIDERS: + (work / tag).mkdir() + providers[tag], staged = provider(blobs, tag, work / tag, compiler, kernel, climb_recipes) + for stem in CONSUMERS: + consumers.setdefault(stem, {})[tag] = consumer( + blobs, stem, tag, work / tag, compiler, kernel, donor_recipes, staged, + receipts[stem][tag]) + return {"providers": providers, "consumers": consumers, "climb_recipes": climb_recipes, + "donor_climb_recipes": donor_recipes} diff --git a/research/staged-644-660-native-binding-audit/test_verify.py b/research/staged-644-660-native-binding-audit/test_verify.py new file mode 100644 index 0000000000..b4bc70b15a --- /dev/null +++ b/research/staged-644-660-native-binding-audit/test_verify.py @@ -0,0 +1,184 @@ +# SPDX-License-Identifier: Apache-2.0 +"""Semantic failures at the emitted 644/660 wrapper, climb, exit and recipe boundaries. + +Adapted from research/rank7-group-d-native-widths-audit/test_verify.py (Wentao Li). +""" + +import copy +import shutil +import sys +import tempfile +import unittest +from pathlib import Path + +HERE = Path(__file__).resolve().parent +if str(HERE) not in sys.path: + sys.path.insert(0, str(HERE)) + +import native +from common import (COMPILER, DONORS, ENTRANCE, FULL, HELPERS, KERNEL, PACKAGE, + PARENT_ENTRANCE, ROOT, authenticate, consumer_name, decode, module, + recorded_receipts, staged_name) + + +class BoundaryTests(unittest.TestCase): + @classmethod + def setUpClass(cls): + cls.blobs = authenticate() + cls.result = decode((PACKAGE / "RESULT.json").read_bytes()) + cls.row = cls.result["native"]["providers"]["base"] + cls.kernel = module(cls.blobs[KERNEL], "staged_pair_test_kernel") + cls.compiler = module(cls.blobs[COMPILER], "staged_pair_test_compiler") + cls.tmp = tempfile.TemporaryDirectory(prefix="staged-pair-tests-") + raw = cls.blobs[staged_name("base")] + cls.word = decode(raw, True) + cls.canonical, cls.programs, cls.checks = native.generate( + cls.blobs, raw, Path(cls.tmp.name) / "staged") + cls.r = cls.row["bindings"]["644"]["forward"]["compact_helper"] + cls.recipe = cls.row["residuals"]["137"]["recipe"] + cls.parent_recipe = cls.row["parent_residual"]["recipe"] + cls.adapters = native.adapter_file(cls.compiler, cls.canonical) + raw = cls.blobs[consumer_name("RETIMED644-660", "base")] + cls.retimed = decode(raw, True) + cls.retimed_canonical, cls.retimed_programs, cls.retimed_checks = native.generate( + cls.blobs, raw, Path(cls.tmp.name) / "retimed") + + @classmethod + def tearDownClass(cls): + cls.tmp.cleanup() + + def stream(self): + return copy.deepcopy(self.programs["forward"]) + + def bind(self, stream, word=None, helper=644, backward=False): + return native.emitted_binding(word or self.word, self.canonical, stream, helper, backward) + + def assertRejects(self, action, message=""): + with self.assertRaises((ValueError, AssertionError)) as caught: + action() + self.assertIn(message, str(caught.exception)) + + def index(self, stream, kind, *head): + return next(i for i, e in enumerate(stream) + if e[0] == kind and e[1:1 + len(head)] == list(head)) + + def test_positive_and_receipt(self): + self.assertEqual(self.checks, self.row["local_checks_sha256"]) + for orientation in ("forward", "backward"): + for h in (644, 660): + binding = self.bind(self.programs[orientation], helper=h, + backward=orientation == "backward") + self.assertEqual(binding, self.row["bindings"][str(h)][orientation]) + self.assertEqual(native.check_recipe(self.kernel, self.recipe, ENTRANCE, FULL)["rank"], 7) + self.assertEqual(native.check_recipe(self.kernel, self.parent_recipe, + PARENT_ENTRANCE, FULL)["rank"], 8) + + def test_wrapper_corruptions(self): + s = self.stream(); del s[self.index(s, "residual_adapter", "post", self.r)] + self.assertRejects(lambda: self.bind(s)) + s = self.stream(); i = self.index(s, "residual_adapter", "pre", self.r) + s[i] = s[i][:3] + [self.canonical["start"][self.r] - 1] + self.assertRejects(lambda: self.bind(s)) + s = self.stream(); i = self.index(s, "residual_adapter", "pre", self.r) + s[i] = s[i] + [1] # A restored-helper terminal field on a FULL helper. + self.assertRejects(lambda: self.bind(s)) + + def test_climb_and_exit_corruptions(self): + s = self.stream(); del s[self.index(s, "climb", "B", self.r)] + self.assertRejects(lambda: self.bind(s)) + s = self.stream(); i = self.index(s, "climb", "B", self.r); s[i][5] += 1 + self.assertRejects(lambda: self.bind(s)) + s = self.stream(); i = self.index(s, "adapter", "new_to_old", self.r) + s[i] = ["adapter", "old_to_new", self.r, s[i][3]] + self.assertRejects(lambda: self.bind(s)) + s = self.stream(); i = self.index(s, "adapter", "new_to_old", self.r) + event = s.pop(i) + s.insert(self.index(s, "zero_buffer", "free", self.canonical["zero_buffers"][-1]), event) + self.assertRejects(lambda: self.bind(s)) + s = self.stream(); s.insert(self.index(s, "phase", "full_frame_cleanup") + 1, + ["zero_buffer", "alloc", self.r]) + self.assertRejects(lambda: self.bind(s)) + + def test_scalar_and_orientation_corruptions(self): + s = self.stream() + i = next(i for i, e in enumerate(s) if e[0] == "scalar" and e[1][0] == "add" and + ["L", self.r] in e[1][1:3]) + s[i][1][3] = -s[i][1][3] + self.assertRejects(lambda: self.bind(s)) + self.assertRejects(lambda: self.bind(self.programs["forward"], backward=True)) + word = copy.deepcopy(self.word); word["start_extra"]["644"] = list(PARENT_ENTRANCE) + self.assertRejects(lambda: self.bind(self.programs["forward"], word=word)) + word = copy.deepcopy(self.word); word["helper_final"]["644"] = list(FULL) + self.assertRejects(lambda: self.bind(self.programs["forward"], word=word)) + + def test_recipe_corruptions(self): + check = lambda rec, e=ENTRANCE: native.check_recipe(self.kernel, rec, e, FULL) + bad = copy.deepcopy(self.recipe); bad["left"], bad["right"] = bad["right"], bad["left"] + self.assertRejects(lambda: check(bad)) + bad = copy.deepcopy(self.recipe); bad["right"] = None + self.assertRejects(lambda: check(bad)) + bad = copy.deepcopy(self.recipe); bad["left"]["offset"] ^= 1 + self.assertRejects(lambda: check(bad)) + bad = copy.deepcopy(self.recipe); bad["rank"] = 8 + self.assertRejects(lambda: check(bad)) + # A different plane through the parent line 30 (430 is not in span(429,30)). + self.assertRejects(lambda: check(self.recipe, [430, 30])) + + def compare(self, adapters=None, canonical=None, forward=None): + bindings = {str(h): {"forward": self.bind(self.programs["forward"], helper=h)} + for h in HELPERS} + staged = (self.word, self.canonical, self.programs, adapters or self.adapters, bindings) + programs = dict(self.retimed_programs, forward=forward or self.retimed_programs["forward"]) + return native.compare(staged, self.retimed, canonical or self.retimed_canonical, + programs, self.compiler, self.kernel, {}) + + def test_consumer_positive_and_receipt(self): + row = self.result["native"]["consumers"]["RETIMED644-660"]["base"] + self.assertEqual(self.retimed_checks, recorded_receipts()["RETIMED644-660"]["base"]) + self.assertEqual(self.retimed_checks, row["local_checks_sha256"]) + self.assertEqual(self.compare(), {k: v for k, v in row.items() + if k not in ("word_sha256", "local_checks_sha256")}) + for h in HELPERS: # The retimed word does not describe the STAGED program either. + self.assertRejects(lambda: native.emitted_binding( + self.retimed, self.canonical, self.programs["forward"], h), + "source-to-emission direct scalar/climb clocks") + + def test_consumer_corruptions(self): + adapters = copy.deepcopy(self.adapters) + adapters["recipes"]["137"]["left"]["phase"] ^= 1 + self.assertRejects(lambda: self.compare(adapters=adapters), + "unchanged serialized residual adapters") + # Moving the span(429,30) entrance from 644 to its donor 640 keeps the recipe set. + canonical = copy.deepcopy(self.retimed_canonical) + kept = [r for r in range(704) if r not in self.retimed["removed"]] + a, b = kept.index(644), kept.index(DONORS[0]) + canonical["start"][a], canonical["start"][b] = canonical["start"][b], canonical["start"][a] + self.assertRejects(lambda: self.compare(canonical=canonical), + "unchanged entrance/terminal pairs") + # An extra changed climb chain outside the donors. + s = copy.deepcopy(self.retimed_programs["forward"]) + del s[next(i for i, e in enumerate(s) if e[0] == "climb" and + kept[e[2]] not in (*HELPERS, *DONORS))] + self.assertRejects(lambda: self.compare(forward=s), "only the donors' climb chains change") + # The donor stops at its old intermediate frame span(429,30) instead of one merged climb. + s = copy.deepcopy(self.retimed_programs["forward"]) + i = next(i for i, e in enumerate(s) if e[0] == "climb" and kept[e[2]] == DONORS[0]) + s[i][4:6] = [self.retimed_canonical["frames"].index(ENTRANCE), 1] + self.assertRejects(lambda: self.compare(forward=s), "one merged donor climb") + + def test_source_pin_corruption(self): + with tempfile.TemporaryDirectory(prefix="staged-pair-pins-") as work: + root = Path(work) + for name in self.blobs: + (root / name).parent.mkdir(parents=True, exist_ok=True) + shutil.copyfile(ROOT / name, root / name) + self.assertEqual(authenticate(root), self.blobs) + for target in (root / staged_name("extra"), root / consumer_name("DELAYED", "base")): + good = target.read_bytes() + raw = bytearray(good); raw[-5] ^= 1; target.write_bytes(bytes(raw)) + self.assertRejects(lambda: authenticate(root)) + target.write_bytes(good) + + +if __name__ == "__main__": + unittest.main() diff --git a/research/staged-644-660-native-binding-audit/verify.py b/research/staged-644-660-native-binding-audit/verify.py new file mode 100644 index 0000000000..acd73f10fa --- /dev/null +++ b/research/staged-644-660-native-binding-audit/verify.py @@ -0,0 +1,70 @@ +# SPDX-License-Identifier: Apache-2.0 +"""PR3605 staged helpers 644/660: emitted native residual binding and separate-kernel check.""" + +import json +import sys +import tempfile +from pathlib import Path + +HERE = Path(__file__).resolve().parent +if str(HERE) not in sys.path: + sys.path.insert(0, str(HERE)) + +import native +from common import CONSUMERS, HELPERS, PACKAGE, authenticate, decode, require + + +def compute(): + blobs = authenticate() + with tempfile.TemporaryDirectory(prefix="staged-pair-native-") as work: + record = native.audit(blobs, Path(work)) + result = {"schema_version": 1, "status": "PASS_STAGED_644_660_NATIVE_BINDING", + "native": record} + for tag, row in record["providers"].items(): + widths = [row["residuals"][row["bindings"][str(h)]["forward"]["recipe_key"]]["rank"] + for h in HELPERS] + require(widths == [7, 7], "emitted residual widths 7/7: " + tag) + require(row["parent_residual"]["rank"] == 8, "parent residual width 8: " + tag) + require(row["changed_helpers"] == list(HELPERS), "single-change control: " + tag) + require(len(row["controls"]) == 7, "seven residual controls: " + tag) + require(row["residual_recipes"] == {"parent": 56, "staged": 57} and + row["pair_classes"] == {"parent": 57, "staged": 58}, "class inventory: " + tag) + for h in HELPERS: + ranks = [c["rank"] for c in row["bindings"][str(h)]["forward"]["climbs"]] + parent = row["parent_bindings"][str(h)]["climb_ranks"] + require(sum(ranks) == 7 and sum(parent) == 8 and ranks[1:] == parent[1:] and + ranks[0] + 1 == parent[0], "only the first native climb changes: " + tag) + require(list(record["consumers"]) == list(CONSUMERS), "consumer inventory") + for stem, rows in record["consumers"].items(): + for tag, row in rows.items(): + staged = record["providers"][tag] + keys = [row["recipe_keys"][str(h)] for h in HELPERS] + require(row["residual_ranks"] == {"644": 7, "660": 7} and + keys == [staged["bindings"][str(h)]["forward"]["recipe_key"] for h in HELPERS] and + row["adapter_sha256"] == staged["adapter_sha256"] and len(row["controls"]) == 2, + "consumer keeps the staged width-7 entrance residual: " + stem + " " + tag) + require(list(record["donor_climb_recipes"].values()) == [3, 3], "two merged donor climb recipes") + require(authenticate() == blobs, "source stability during replay") + return decode(json.dumps(result).encode()) + + +def main(): + require(sys.argv[1:] in ([], ["--emit"]), "usage: verify.py [--emit]") + result = compute() + if sys.argv[1:]: + print(json.dumps(result, indent=1, sort_keys=True)) + else: + require(decode((PACKAGE / "RESULT.json").read_bytes()) == result, "deterministic receipt") + base = result["native"]["providers"]["base"] + key = base["bindings"]["644"]["forward"]["recipe_key"] + print(result["status"] + + " providers=2 helpers=644,660 entrance=span(429,30) terminal=FULL" + + f" residual_width=7 parent_width=8 shared_key={key}" + + f" climb_recipes={len(result['native']['climb_recipes'])} recipes=56->57" + + " controls=7x2 single_change=2 both_orientations no_new_kappa" + + " consumers=" + ",".join(CONSUMERS) + f" consumer_width=7 consumer_key={key}" + + " consumer_pair_changes=0 recorded_receipts=4 merged_donor_climbs=2") + + +if __name__ == "__main__": + main()