From ab9e8cd1ebe3c334a741a587dad71466a853ca15 Mon Sep 17 00:00:00 2001 From: ToikY <27568617+ToikY@users.noreply.github.com> Date: Wed, 11 Nov 2026 16:00:29 -0800 Subject: [PATCH 1/2] Exclude exact Type A QUERY scalar cache pairs --- .../LOCAL-PINS.json | 10 + .../p104-type-a-query-cache-pair-bound/NOTICE | 7 + .../PROOF.md | 18 + .../PROVENANCE.json | 21 + .../README.md | 36 + .../SOURCES.json | 18 + .../TASK.json | 117 +++ .../VERIFICATION.md | 7 + .../VERIFY.json | 19 + .../engines/independent.py | 227 ++++++ .../engines/lead.py | 151 ++++ .../engines/quote.py | 100 +++ .../inputs/7113-CALLER.json.gz | Bin 0 -> 11215 bytes .../inputs/7334-ADMITTED.json | 58 ++ .../inputs/7334-READBACK.json | 188 +++++ .../inputs/QUERY-CENSUS.json | 674 ++++++++++++++++++ .../inputs/pricing.py | 82 +++ .../receipts/SHA256.json | 6 + .../replay.py | 116 +++ 19 files changed, 1855 insertions(+) create mode 100644 research/p104-type-a-query-cache-pair-bound/LOCAL-PINS.json create mode 100644 research/p104-type-a-query-cache-pair-bound/NOTICE create mode 100644 research/p104-type-a-query-cache-pair-bound/PROOF.md create mode 100644 research/p104-type-a-query-cache-pair-bound/PROVENANCE.json create mode 100644 research/p104-type-a-query-cache-pair-bound/README.md create mode 100644 research/p104-type-a-query-cache-pair-bound/SOURCES.json create mode 100644 research/p104-type-a-query-cache-pair-bound/TASK.json create mode 100644 research/p104-type-a-query-cache-pair-bound/VERIFICATION.md create mode 100644 research/p104-type-a-query-cache-pair-bound/VERIFY.json create mode 100644 research/p104-type-a-query-cache-pair-bound/engines/independent.py create mode 100644 research/p104-type-a-query-cache-pair-bound/engines/lead.py create mode 100644 research/p104-type-a-query-cache-pair-bound/engines/quote.py create mode 100644 research/p104-type-a-query-cache-pair-bound/inputs/7113-CALLER.json.gz create mode 100644 research/p104-type-a-query-cache-pair-bound/inputs/7334-ADMITTED.json create mode 100644 research/p104-type-a-query-cache-pair-bound/inputs/7334-READBACK.json create mode 100644 research/p104-type-a-query-cache-pair-bound/inputs/QUERY-CENSUS.json create mode 100644 research/p104-type-a-query-cache-pair-bound/inputs/pricing.py create mode 100644 research/p104-type-a-query-cache-pair-bound/receipts/SHA256.json create mode 100644 research/p104-type-a-query-cache-pair-bound/replay.py diff --git a/research/p104-type-a-query-cache-pair-bound/LOCAL-PINS.json b/research/p104-type-a-query-cache-pair-bound/LOCAL-PINS.json new file mode 100644 index 0000000000..8632819881 --- /dev/null +++ b/research/p104-type-a-query-cache-pair-bound/LOCAL-PINS.json @@ -0,0 +1,10 @@ +{ + "engines/independent.py": "405ee4d5d31fe8ff60da31931e5fc5e5dffc1acb6ff60072175122f7e20d1207", + "engines/lead.py": "45cc341b8146c7f996b9c5b75c335fcebd53daa04a334b22e418052ffb5e6d09", + "engines/quote.py": "94a67b09b6fec9249f0e4b45ac5c92cb497b6030f44189404ddf0f3baae18b16", + "inputs/7113-CALLER.json.gz": "7e8038559cd158f6e32ef6d1a3bf15ab6a8ecc2239af32ab1699511ac28e26d9", + "inputs/7334-ADMITTED.json": "c95300e9bca27e44a25c82d794f88cbf70757c142806b0e4c590ea29feb81a13", + "inputs/7334-READBACK.json": "337668788fb39ec9575887f9c5faf438a880471f78d936357dabf7deeac5de82", + "inputs/QUERY-CENSUS.json": "ae9ae5116091dc73d10a5dad34a38eab7581ae26654ef30af8be0ffb1acbea5c", + "inputs/pricing.py": "f4d0b6c9314b838d882d6d06020f24881c19a3fda97a7c00df87b1e920785182" +} diff --git a/research/p104-type-a-query-cache-pair-bound/NOTICE b/research/p104-type-a-query-cache-pair-bound/NOTICE new file mode 100644 index 0000000000..de843684be --- /dev/null +++ b/research/p104-type-a-query-cache-pair-bound/NOTICE @@ -0,0 +1,7 @@ +Apache-2.0. + +#7113 supplies the literal signed caller and QUERY lowering. #7334 supplies +the admitted comparator. #7309 and #7310 supply exact related Type A +exclusions. #7198, #5803, #6975 and #3965 supply cache, ownership and +delivery precedents. #7298 supplies directed arithmetic. OpenAI Codex +and subagents materially assisted. diff --git a/research/p104-type-a-query-cache-pair-bound/PROOF.md b/research/p104-type-a-query-cache-pair-bound/PROOF.md new file mode 100644 index 0000000000..f656e360b4 --- /dev/null +++ b/research/p104-type-a-query-cache-pair-bound/PROOF.md @@ -0,0 +1,18 @@ +# Exact source obstruction for one retained QUERY result + +For an original Type A QUERY at clock t, let R_t be the complete normalized row of source role 1 just before the operation. The literal instruction adds `Q^(-1) R_t x` into role 0. At a later clock u, replacing the paid query by a fixed scalar multiple of the earlier completed result requires `Q^(-1)R_u x = λ Q^(-1)R_t x` for every public input x. The retained signed child is invertible on the complete factor, so `R_u=λ R_t` is necessary. Keeping the earlier result in an owned cache does not supply another input direction. Both QUERY exponents are exactly −1. The argument concerns reuse of that one result under the unchanged intervening caller, with scalar readout only. + +The source rows are elements of the signed caller's Gaussian Laurent ring in central q and the 17 body variables. An exact row proportionality with fixed rational λ survives specialization to q=±1 and all bodies one. The lead and independent rational engines propagate the source rows from the literal caller at different signs. Each signed J applies its two Type A shears and the matching body factor to all four roles. Scalar operations, queries, swaps and idle masks follow their literal chronological order. LAMBDA specializes to one at q=±1. The independent engine also checks every final Type A row against the complete specified endpoint at all four probes. + +| Producer, later QUERY | Public coordinates | Lead determinant at q=−1 | Independent determinant at q=+1 | +|---|---|---:|---:| +| 1516, 1580 | 19, 1 | 1 | 1 | +| 1516, 1659 | 19, 1 | 1 | 1 | +| 1516, 1721 | 19, 0 | −1 | 1 | +| 1580, 1659 | 1, 18 | 1 | −1 | +| 1580, 1721 | 1, 0 | −1 | 1 | +| 1659, 1721 | 1, 0 | −1 | 1 | + +Every nonzero exact minor proves the claimed row nonproportionality. Equal literal source labels do not preserve the source through the intervening stages. No premise about clean or zero public data is used. No symbolic survivor remains. + +The retained physical caller assigns a distinct owned query scratch to each clock and port. It initializes a full scratch, copies the arbitrary source, executes the rank-one signed child and ordinary adapters, uses the result and clears before serial reuse. A feasible cache would need a new live-ownership binding, its exact source and consumer coframes, signed all-width routing, restoration and fixed-tape proof. The price counts none of these as free in a candidate. Those conditions were not reached here. The fixed-port demotion bound and single modified-J obstruction have different hypotheses, because neither installs the retained q-dependent state considered here. diff --git a/research/p104-type-a-query-cache-pair-bound/PROVENANCE.json b/research/p104-type-a-query-cache-pair-bound/PROVENANCE.json new file mode 100644 index 0000000000..5e28345e49 --- /dev/null +++ b/research/p104-type-a-query-cache-pair-bound/PROVENANCE.json @@ -0,0 +1,21 @@ +{ + "files": { + "inputs/7113-CALLER.json.gz": { + "commit": "07a76c5e2738882c0cb322278e56f6cae3c9885d", + "git_blob": "9451ceaf6e8e037894680b549f3ef41c21b260d7", + "path": "research/signed-caller-8x9/expected/ODD-TYPE-AB-CALLER.json", + "sha256": "255d89f38cd45e38e5770f559bc43dc217e989032359768cdc7e8cdfd64b47bc", + "source": "https://github.com/CrocSwap/integer-mult-bounds/blob/07a76c5e2738882c0cb322278e56f6cae3c9885d/research/signed-caller-8x9/expected/ODD-TYPE-AB-CALLER.json", + "uncompress": true + }, + "inputs/pricing.py": { + "commit": "c522451caf287bb3c16eaece72be4c263315dca4", + "git_blob": "40ec194017bda1d524bba4f07b188c53281419d0", + "path": "research/adjacent-owned-add-exchange-bound/pricing.py", + "sha256": "f4d0b6c9314b838d882d6d06020f24881c19a3fda97a7c00df87b1e920785182", + "source": "https://github.com/CrocSwap/integer-mult-bounds/blob/c522451caf287bb3c16eaece72be4c263315dca4/research/adjacent-owned-add-exchange-bound/pricing.py", + "uncompress": false + } + }, + "schema_version": 1 +} diff --git a/research/p104-type-a-query-cache-pair-bound/README.md b/research/p104-type-a-query-cache-pair-bound/README.md new file mode 100644 index 0000000000..70328c56e6 --- /dev/null +++ b/research/p104-type-a-query-cache-pair-bound/README.md @@ -0,0 +1,36 @@ +# Exclude fixed-clock Type A QUERY cache pairs + +**NO VERIFIED GAIN. Exact conditional κ change 0%.** The exact signed #7113 caller has four Type A QUERYs at clocks 1516, 1580, 1659 and 1721. They share the literal source role 1, destination role 0 and central exponent −1. Their exact arbitrary-input source rows are pairwise nonproportional. Two independent rational replays exclude all six ordered-in-time reuse pairs. No case remains unresolved. + +The strongest independently reproduced comparable witness is [#7334](https://github.com/CrocSwap/integer-mult-bounds/pull/7334) at `aaeec8c0acf01e99a5f331ef363a698d9c084ace`, κ = 0.00364665195644, with exact caller [#7113](https://github.com/CrocSwap/integer-mult-bounds/pull/7113) at `07a76c5e2738882c0cb322278e56f6cae3c9885d`. Its peer gain of 0.000000430519994 over #7314 is separate from this contribution. The selected result remains unchanged. + +## Exact scope and price + +The tested reuse keeps one already paid query result in an owned cache and reads a fixed scalar multiple at one later original QUERY. The first consumer, the 17 literal J blocks, all other caller operators, clocks and public endpoints stay fixed. The four logical QUERYs act across 96 Type A ports. Removing one paid event would give exact raw credit 96, paid positions 110,423, productive positions 22,461 and surplus 1,520. The price-only full-stock upper is exactly 288, granting one producer and three reused events before setup, storage, routes, ownership, restoration, precision and tape. The actual scope builds at most one reuse. Ancillary costs were left as obligations because no source identity survives. After the support exclusion, the compatible credit in this scope is zero. + +The lead exact replay excludes every pair at q=−1 and all bodies one. The independent exact replay excludes every pair at q=+1 and all bodies one. Its full predecessor endpoint controls also check both signs and two nonunit body assignments. See [the proof and determinants](PROOF.md). + +## Replay + +Use CPython 3.12 with assertions. + +```sh +python3.12 -B scripts/research_package.py --package research/p104-type-a-query-cache-pair-bound +python3.12 -B scripts/check_research_commit.py --package research/p104-type-a-query-cache-pair-bound --check-modes --check-source-history +``` + +A Git-free checkout or export reproduces the exact four receipts into a new directory. + +```sh +python3.12 -I -B research/p104-type-a-query-cache-pair-bound/replay.py --out fresh-receipts +``` + +The replay authenticates the exact source bytes and rebuilds the complete price before either support engine reads the caller. It compares the price, both result receipts and controls to the recorded SHA-256 values, then recomputes every determinant from its exact serialized rows. A changed caller is rejected before decoding. [Verification receipts](VERIFICATION.md) + +## Credit + +[#7113](https://github.com/CrocSwap/integer-mult-bounds/pull/7113) supplies the exact signed caller and physical QUERY lowering. [#7334](https://github.com/CrocSwap/integer-mult-bounds/pull/7334) supplies the independently reproduced complete comparator. [#7198](https://github.com/CrocSwap/integer-mult-bounds/pull/7198) and [#5803](https://github.com/CrocSwap/integer-mult-bounds/pull/5803) supply chronological common-query cache compression and the request-row rank perspective. [#6975](https://github.com/CrocSwap/integer-mult-bounds/pull/6975) supplies an older owned inverse-Q lifecycle, and [#3965](https://github.com/CrocSwap/integer-mult-bounds/pull/3965) binds older private query outputs to delivered consumers. [#7309](https://github.com/CrocSwap/integer-mult-bounds/pull/7309) supplies the exact four-query census and fixed-port q-even demotion proof, and [#7310](https://github.com/CrocSwap/integer-mult-bounds/pull/7310) gives the single altered-J obstruction. [#7298](https://github.com/CrocSwap/integer-mult-bounds/pull/7298) supplies directed arithmetic. OpenAI Codex and subagents materially assisted the proof, implementation, independent checking and packaging. + +## Open next questions + +Can an encoded or updated cache, or a span of multiple already paid sources, supply a later query on the same paid invoice? Start by pinning one such cache contract and computing its full charged price and exact request rank. A successful normalized identity would still require signed all-width phase, a lawful owned lifetime, restoration, precision, tape and complete caller verification. The six pairwise exclusions leave these larger mechanisms open. diff --git a/research/p104-type-a-query-cache-pair-bound/SOURCES.json b/research/p104-type-a-query-cache-pair-bound/SOURCES.json new file mode 100644 index 0000000000..e8c2f265cd --- /dev/null +++ b/research/p104-type-a-query-cache-pair-bound/SOURCES.json @@ -0,0 +1,18 @@ +{ + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "files": [ + { + "git_blob": "75d77b328ea02ded535e7f23aee5b1e55d0bb1a8", + "path": "certificates/selected-result.json", + "sha256": "154c3d30455d778fd3343b6b4851f0fa4665f0f7625b0adb3675e2bafbbf6bf1", + "usage": "provenance" + }, + { + "git_blob": "3404fbdd5e7529a0674eef26114b5071e4586cec", + "path": "docs/research/agent-task-catalog.json", + "sha256": "ead6cdc9d0af6d58e8a49744d8ec8c7c15e13d2ba93c276c434bcf9b51b93a81", + "usage": "provenance" + } + ], + "schema_version": 1 +} diff --git a/research/p104-type-a-query-cache-pair-bound/TASK.json b/research/p104-type-a-query-cache-pair-bound/TASK.json new file mode 100644 index 0000000000..ab68c90bdf --- /dev/null +++ b/research/p104-type-a-query-cache-pair-bound/TASK.json @@ -0,0 +1,117 @@ +{ + "actual_scope": "Exact #7334 and #7113; retain one already paid Type A QUERY result and reuse a fixed scalar multiple at one later literal clock.", + "ai_assistance": "OpenAI Codex and subagents materially assisted proof, implementation, independent verification and packaging.", + "author": "Type A QUERY cache research", + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "bottleneck_link": "An exact cache hit could remove 96 paid rank-one positions from the signed complex invoice.", + "budget_minutes": 5, + "evidence": "All six exact pairs fail both independent rational source-row screens at opposite signs. No unresolved key.", + "open_questions": [ + { + "blocked_by": "The present scope admits only one cached result and fixed scalar reuse.", + "first_step": "Pin one changed cache contract, price all setup and storage, and test its request rank on the exact caller.", + "question": "Can an updated or multi-source cache support a later QUERY at positive complete price?", + "why_it_matters": "A reusable exact source would remove paid positions in the binding signed complex route." + } + ], + "original_card": { + "acceptance_gate": "An exact arbitrary-input identity, source/target frame availability and restoration at the chosen cut, plus the complete channel+correction+idle/hosting bill or an explicit favorable bound. The native channel alone is not a supplier. A scoped local result may be retained without a complete supplier. Expanding it into further construction rounds requires the family-level budget and obligation gate in research-family-status.md; an optimistic passing relaxation alone is not acceptance.", + "allowed_variations": [ + "One exact source head, helper/cut region or quantified proposition and changed hypothesis; check live handoffs first. Different seeds are not different scopes." + ], + "bottleneck_link": "Judge the actual current supplier contract and complete signed target/paid bill; frozen-profile ceilings require an applicability proof.", + "existing_checks": [ + { + "evidence": "research/p104-literal-slot-defect/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "scope": "PR #4133: literal-slot defect", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129", + "source_commit": "88666f1dee93fbd85b31fd5d6f91a219e111b5f4", + "status": "author-checked" + }, + { + "evidence": "research/p104-uniform-commutation-gap/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "scope": "PR #4136: uniform commutation gap", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129", + "source_commit": "281ce601a8be9db470de630759179c23e1dfaa88", + "status": "author-checked" + }, + { + "evidence": "research/p104-uniform-encoding-gap/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "scope": "PR #4140: uniform encoding gap", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129", + "source_commit": "de25c6525aa866962309df5d107b32d55e6e5628", + "status": "author-checked" + }, + { + "evidence": "research/p104-source-chart-shortcut/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "scope": "PR #4153: source-chart shortcut exhausts its optimistic allowance", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129", + "source_commit": "9123241fea53df77e51ffe30d9aca1625d4bf3a8", + "status": "author-checked" + }, + { + "evidence": "research/p104-fiber-tag-seam/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "scope": "PR #4154: fiber-tag seam mismatch", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129", + "source_commit": "4ffcdaee5d6255a9cea1fe53a5424435068089d0", + "status": "author-checked" + }, + { + "evidence": "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "remaining": "The next experiment must identify uncovered source-specific work. Successor archive intake does not transfer this admission.", + "scope": "Selected PR5599: complete helper-subspace construction and independent caller replay; five framework assumptions remain.", + "selected_record_sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5", + "source_commit": "09dd0965711ca7eeb169057a420abab1c9052137", + "status": "reviewed" + } + ], + "first_experiment": "Start with the selected #5599 emitted word and review pending #5718 distinct input/output bases plus #5717/#5719 coverage before claiming work. Pick one uncovered source word, helper group and cut region. Prove the arbitrary-input relation and legal entry/exit corrections, then compare full target and paid profiles. Reject if completion, owned lifetimes or consumer costs repay the gain. A static pairing rank alone is not a physical split.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read revision 8, the selected review and live exact-source handoffs. Then follow this card's bounded first_experiment.", + "scope": "Source-bound orientation only, not a supplier replay or theorem proof." + }, + "id": "p104-side-correction", + "methods": [ + "Construct and independently check one source-bound instance of the stated first experiment.", + "Seek an exact counterexample or target-specific complete-budget obstruction to that same proposed change." + ], + "overlap_terms": [ + "P104", + "helper basis", + "helper split", + "5718", + "dyadic capacity" + ], + "question": "Can joint helper bases and a legal causal split improve the complete P104 productive/paid invoice?", + "scope_change_triggers": [ + "Changing source head, helper/cut domain, operation alphabet or caller boundary without recording the new scope.", + "Treating an archived proposal or local numerical pass as complete supplier admission." + ], + "starting_points": [ + "docs/research/current-priorities.md", + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "research/p104-helper-subspace-splits/README.md", + "research/dyadic-helper-channel-capacity/README.md" + ] + }, + "outcome": "negative-result", + "priority_revision": 8, + "schema_version": 1, + "scope_change_reason": "The exact unchanged signed caller has four apparent repeat-source opportunities, with owned cache lifetime allowed.", + "scope_status": "changed", + "stop_rule": "Price all six one-pair alternatives first. Exhaust six pairs or 20 seconds; only a surviving exact source relation could enter a physical build.", + "task_id": "p104-side-correction" +} diff --git a/research/p104-type-a-query-cache-pair-bound/VERIFICATION.md b/research/p104-type-a-query-cache-pair-bound/VERIFICATION.md new file mode 100644 index 0000000000..1d493ff7c0 --- /dev/null +++ b/research/p104-type-a-query-cache-pair-bound/VERIFICATION.md @@ -0,0 +1,7 @@ +# Verification receipts + +The registered and Git-free replays use CPython 3.12.14 with assertions. The same four deterministic receipt hashes are pinned in `receipts/SHA256.json`. All six keys and both engines' exact determinants were reconstructed. The local direct replay exited 0 in 0.35 seconds, the staged Git-free export in 0.34 seconds, and the registered runner in 0.81 seconds. The registered run validated the exact base catalogue and selected-record metadata. The modified caller control returned nonzero before decoding and emitted no receipt. + +The bounded original lead and independent scientific runners exited zero in 0.05 and 0.04 seconds. The independent engine's four predecessor endpoint controls and signed toy controls passed. The price was separately reproduced from a relocated closure. Its initial port-count check was corrected to count the 96 distinct entries in the sealed port list. The frozen price and both exact source receipts were preserved during packaging. + +Comparator [#7334](https://github.com/CrocSwap/integer-mult-bounds/pull/7334) completed all four independent local stages. Its [exact-head hosted run](https://github.com/CrocSwap/integer-mult-bounds/actions/runs/43114736518) passed all three jobs at the recorded frontier refresh. The present contribution's committed-byte, executable-mode, source-history and hosted checks await its final submission commit. The Git-free check here used a staged tar, while the official committed export requires that commit. diff --git a/research/p104-type-a-query-cache-pair-bound/VERIFY.json b/research/p104-type-a-query-cache-pair-bound/VERIFY.json new file mode 100644 index 0000000000..914c0dbc5b --- /dev/null +++ b/research/p104-type-a-query-cache-pair-bound/VERIFY.json @@ -0,0 +1,19 @@ +{ + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/replay.py" + ], + "checks": "Rebuild the directed price, replay all six exact signed source exclusions independently, re-evaluate their determinant witnesses, and reject a changed caller.", + "timeout_seconds": 90 + } + ], + "inputs": [], + "python": "3.12", + "requirements": [], + "schema_version": 1, + "status": "ready" +} diff --git a/research/p104-type-a-query-cache-pair-bound/engines/independent.py b/research/p104-type-a-query-cache-pair-bound/engines/independent.py new file mode 100644 index 0000000000..e28dae9e86 --- /dev/null +++ b/research/p104-type-a-query-cache-pair-bound/engines/independent.py @@ -0,0 +1,227 @@ +"""Independent exact Type A QUERY source proportionality screen.""" +from argparse import ArgumentParser +from fractions import Fraction as Q +from functools import cache +from hashlib import sha256 +from itertools import combinations +from json import dumps, loads +from math import prod +from pathlib import Path +from signal import SIGALRM, alarm, signal +from time import monotonic + +HERE=Path(__file__).resolve().parent +HEAD='aaeec8c0acf01e99a5f331ef363a698d9c084ace' +CALLER='255d89f38cd45e38e5770f559bc43dc217e989032359768cdc7e8cdfd64b47bc' +PRICE='bbc486a3eb0e2aed03dd09f400fa94de1a59312058a9826880999155b10453bf' +CLOCKS=(1516,1580,1659,1721) +PROBES=((1,(1,)*17),(-1,(1,)*17),(-1,tuple(range(2,19))), + (1,(19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89))) + + +class Capped(Exception): + pass + + +def require(ok,message): + if not ok: + raise ValueError(message) + + +def unique(items): + record=dict(items) + require(len(record)==len(items),'Duplicate input key') + return record + + +def read(raw): + return loads(raw,object_pairs_hook=unique) + + +def pinned(path,digest): + raw=path.read_bytes() + require(sha256(raw).hexdigest()==digest,f'Changed input {path.name}') + return raw + + +@cache +def fraction(token): + return Q(token) + + +def add(rows,dst,src,q): + require(dst!=src,'Aliased scalar source') + for index,value in rows[src].items(): + new=rows[dst].get(index,0)+q*value + if new: + rows[dst][index]=new + else: + rows[dst].pop(index,None) + + +def scale(rows,dst,q): + require(q!=0,'Singular scalar operation') + if q!=1: + rows[dst]={i:v*q for i,v in rows[dst].items()} + + +def safe_time(deadline): + if monotonic()>=deadline: + raise Capped + + +def replay(caller,clocks,q,bodies,deadline,check_endpoint): + ty=caller['types']['A']; n=ty['roles']; alpha=Q(ty['alpha2']) + require(q in (-1,1) and all(bodies) and ty['offset']==0,'Invalid signed specialization') + rows=[{j:Q(1)} for j in range(n)] + sources,writes,stages={},[],[] + observed=[] + for clock,event in enumerate(caller['events']): + if clock%32==0 or clock in clocks: + safe_time(deadline) + kind,op,*args=event + if kind=='J': + stage=op; u,v,x,y=args[0] + require(len(set((u,v,x,y)))==4 and max(u,v,x,y)=deadline: + break + kind,op,*args=event + if clock in clocks: + assert event==["A","QUERY",0,1,-1] + answers[clock]=rows[1].copy() + if clock>=clocks[-1]: + break + if kind=="J": + x,y,u,v=args[0] + add(rows[y],rows[x],q) + add(rows[u],rows[v],a*q) + for role in (x,y,u,v): + rows[role]=scale(rows[role],body[op]) + if 1 in (x,y,u,v) and clock>clocks[0]: + writes.append([clock,event]) + elif kind=="A": + r,*z=args + if op=="ADD": + add(rows[r],rows[z[0]],rat(z[1])) + elif op=="QUERY": + add(rows[r],rows[z[0]],Q(q)**z[1]) + elif op=="SCALE": + rows[r]=scale(rows[r],rat(z[0])) + elif op=="SWAP": + rows[r],rows[z[0]]=rows[z[0]],rows[r] + elif op=="LAMBDA": + assert q*q==1 + elif op=="IDLE_ONE": + rows[r]=scale(rows[r],prod(body[j] for j in z[0])) + elif op=="IDLE_ODD": + rows[r]=scale(rows[r],prod(body[j] for j in z[0])*Q(q)**z[1]) + else: + raise ValueError(op) + if (r==1 or op=="SWAP" and z[0]==1) and clock>clocks[0]: + writes.append([clock,event]) + return answers,writes + + +def controls(): + assert compare({0:Q(1),1:Q(2)},{0:Q(-2),1:Q(-4)})==(Q(-2),None) + z,w=compare({0:Q(1),1:Q(2)},{0:Q(-2),1:Q(-3)}) + assert z is None and w["cross_product"]=="1" + assert compare({1:Q(1)},{0:Q(1)})==(None,{"coordinates":[1,0],"cross_product":"1"}) + return ["signed proportional source", "changed intervening write", "outside coordinate"] + + +def main(): + root=Path(sys.argv[1]) + frozen=checked(root/"price/PRICE.json",PRICE) + assert frozen["head"]==HEAD + checks=controls() + if sys.argv[2:]==["--controls-only"]: + print(checks) + return + c=checked(root/"price/inputs/7113-CALLER.json",CALLER) + assert (c["types"]["A"]["roles"],len(c["types"]["A"]["ports"]))==(36,96) + deadline=monotonic()+18 + probes=[(1,)*18,tuple(j+1 for j in range(18)),tuple(2*j+1 for j in range(18))] + snaps=[] + for values in probes: + sources,writes=snapshot(c,CLOCKS,values,-1,deadline) + snaps.append(sources) + answer=[] + for first,second in combinations(CLOCKS,2): + if monotonic()>=deadline or any(first not in r or second not in r for r in snaps): + break + ratios=[] + reason=None + for i,source in enumerate(snaps): + k,w=compare(source[first],source[second]) + if w: + reason=dict(status="source rows not proportional",probe=i,witness=w) + break + ratios.append(str(k)) + if len(set(ratios))>1: + reason=dict(status="ratio depends on body values",probe=i,ratios=ratios) + break + answer.append(dict(key=[first,second],**(reason or dict(status="provisional",ratios=ratios)))) + keys=[list(pair) for pair in combinations(CLOCKS,2)] + print(json.dumps(dict(head=HEAD,caller_sha256=CALLER,price_sha256=PRICE,case_cap=6,seconds=18, + q=-1,probes=probes,source_rows=[{i:{k:str(x) for k,x in row.items()} for i,row in r.items()} for r in snaps], + source_role_writes=writes,decisions=answer,unvisited=keys[len(answer):], + survivors=[r for r in answer if r["status"]=="provisional"],controls=checks),indent=2,sort_keys=True)) + + +if __name__=="__main__": + main() diff --git a/research/p104-type-a-query-cache-pair-bound/engines/quote.py b/research/p104-type-a-query-cache-pair-bound/engines/quote.py new file mode 100644 index 0000000000..338ee8702b --- /dev/null +++ b/research/p104-type-a-query-cache-pair-bound/engines/quote.py @@ -0,0 +1,100 @@ +"""Directed fixed-price stock for reusing one Type A QUERY result.""" +from collections import Counter +from fractions import Fraction as Q +from hashlib import sha256 +from itertools import combinations +from json import dumps, loads +from pathlib import Path +from runpy import run_path + +ROOT=Path(__file__).resolve().parent +HEAD='aaeec8c0acf01e99a5f331ef363a698d9c084ace' +CALLER='07a76c5e2738882c0cb322278e56f6cae3c9885d' +PINS={ + 'inputs/QUERY-CENSUS.json':'ae9ae5116091dc73d10a5dad34a38eab7581ae26654ef30af8be0ffb1acbea5c', + 'inputs/7334-READBACK.json':'337668788fb39ec9575887f9c5faf438a880471f78d936357dabf7deeac5de82', + 'inputs/7334-ADMITTED.json':'c95300e9bca27e44a25c82d794f88cbf70757c142806b0e4c590ea29feb81a13', + 'inputs/pricing.py':'f4d0b6c9314b838d882d6d06020f24881c19a3fda97a7c00df87b1e920785182', + 'inputs/7113-CALLER.json':'255d89f38cd45e38e5770f559bc43dc217e989032359768cdc7e8cdfd64b47bc', +} + + +def unique(pairs): + result=dict(pairs) + if len(result)!=len(pairs): + raise ValueError('Duplicate JSON key') + return result + + +def hist(data): + result=Counter({int(r):n for r,n in data.items()}) + assert len(result)==len(data) and all(r>0 and type(n) is int and n>0 for r,n in result.items()) + return result + + +def interval(values): + return list(map(str,values)) + + +def main(): + assert __debug__ + raw={} + for rel,pin in PINS.items(): + value=(ROOT/rel).read_bytes() + if sha256(value).hexdigest()!=pin: + raise ValueError(f'Changed dependency {rel}') + raw[rel]=value + read=lambda key:loads(raw[key],object_pairs_hook=unique) + census=read('inputs/QUERY-CENSUS.json') + base=read('inputs/7334-READBACK.json') + admission=read('inputs/7334-ADMITTED.json') + assert base['head']==admission['head']==HEAD and admission['exit']==0 + assert admission['status']=='independently_reproduced_comparable' and len(admission['stages'])==4 + assert base['caller_head']==admission['caller']==CALLER + assert census['caller_sha256']==admission['caller_sha256']==PINS['inputs/7113-CALLER.json'] + assert set(base['assumptions'])==set(admission['assumptions'])=={ + 'native_all_columns','owned_erasure','compiler','precision_tape','analytic_recovery'} + queries=census['query_events'] + clocks=sorted(map(int,queries)) + assert clocks==[1516,1580,1659,1721] + assert all(q=={'destination':0,'q_power':-1,'relative_defect_rank':1,'source':1} for q in queries.values()) + ports=len(set(census['ports'])) + assert ports==len(census['ports'])==96 and len(clocks)==4 + paid,targets=(hist(base[k]) for k in ('paid','targets')) + assert (sum(paid.values()),sum(targets.values()),paid[1])==(110519,22461,68384) + old=targets.copy(); old.subtract(paid) + assert sum(r*n for r,n in old.items())==base['rank_surplus']==1424 and not base['empty_root_credits'] + crossing=Q(base['new_raw_interval'][1]); bit=Q(base['bit_premise']); claim=Q(base['claim']) + assert claim==Q(admission['kappa'])0 and new_bit[0]>0 + stock[str(uses)]={'paid_delta':{'1':-removed},'target_delta':{},'paid':dict(new), + 'paid_positions':sum(new.values()),'productive_fields':22461, + 'rank_surplus':rank_mass,'empty_root_credits':0, + 'exact_credit':str(removed),'complete_margin_at_old_crossing':interval(new_cross), + 'complete_margin_at_retained_bit_premise':interval(new_bit)} + doc={'head':HEAD,'claim':str(claim),'caller_head':CALLER,'caller_sha256':admission['caller_sha256'], + 'input_sha256':PINS,'old_crossing_upper':str(crossing),'retained_bit_premise':str(bit), + 'old_paid':dict(paid),'targets':dict(targets),'old_rank_surplus':1424,'type_a_ports':ports, + 'old_complete_margin_at_crossing':interval(old_cross),'old_complete_margin_at_bit':interval(old_bit), + 'queries':queries,'eligible_pairs_before_support':[list(pair) for pair in combinations(clocks,2)], + 'first_build_use_cap':1,'support_pair_cap':6,'whole_stock_reuse_cap':3, + 'whole_optimistic_stock_upper':'288','by_number_of_reused_queries':stock, + 'scope':'Directed fixed-price stock only, granting source equality, legal owned cache and all added ordinary costs free. Caller bytes hashed and not decoded.'} + print(dumps(doc,indent=2,sort_keys=True)) + + +if __name__=='__main__': + main() diff --git a/research/p104-type-a-query-cache-pair-bound/inputs/7113-CALLER.json.gz b/research/p104-type-a-query-cache-pair-bound/inputs/7113-CALLER.json.gz new file mode 100644 index 0000000000000000000000000000000000000000..2479c3a61579df01c0958406746c550381a55dde GIT binary patch literal 11215 zcmZv=V{j!-{N+8-#L2{VCdtG$Cbn(cww)W>nb_8iZQHo9Z9c#MK3iM+V!OINb-MaZ z*XizWcO4=C%#Z(R;NO=yws8le2|GRG|Ma(TiZWlb+n{?^8%stSh+oOTvHVb-wzxJRp-*Yi^g+l*tS3mY37I~z;yw-09wKPKxeI6IX)wmBBx>h8<#d%ty`>hFvU9}lNdxX3cf z*2y}^o_LN>6j2;dBvZJ_vdT8ey2w7rUhL4YGqEvo)U%dbCtALNC|AgLie`(xnw68B zlBAM4D6%LvC^{(KDZ(j6D4q+)W$9&4GmSEhvi36fvQRTovl27sk-e~81uklc+*go0 zoz*`dzF!uQS6cEG-Ch`XwtR5E=N|pPw>HiNI{n>0jRgXCT1s#zZb$Pf!-y`BzHNvu zmIYR;{p+;94O+kY>^_6H-k>`kk^2kZ1RKBpAHB^%U;X7A&Yy(lLP z?~LvK-(O9CB>x?11++{()e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rjrj=D7^?ppdz=N8M|+?0 zME>trpQTxVT6(|FDF(ks{qG}&sVsr7OLcp{`%C?r?T^y$k0br>XQC{Q>z%F6*VDJl z>un#P-}A_F=c~YV&v|W3n!x4<=yF7!gJ}C>sw2za`~Iu6$9qB9`~GPwOI`qhLqNC3 z*ZsbOV@2TWVc^l7Bk$|U-2eG#|NZ+N^q%#V@TKnG{WTZ<(3lsB{ub{4cKi1J1-kzF zoO1oXN9N$Tto=U4>UmA$;PCJET=8@NyuBRZ=;`_TT6jmc|K52lZN1(>?A(sF_q|>D PMn*AXLoONv`|UQv! literal 0 HcmV?d00001 diff --git a/research/p104-type-a-query-cache-pair-bound/inputs/7334-ADMITTED.json b/research/p104-type-a-query-cache-pair-bound/inputs/7334-ADMITTED.json new file mode 100644 index 0000000000..464c89e45c --- /dev/null +++ b/research/p104-type-a-query-cache-pair-bound/inputs/7334-ADMITTED.json @@ -0,0 +1,58 @@ +{ + "assumptions": [ + "native_all_columns", + "owned_erasure", + "compiler", + "precision_tape", + "analytic_recovery" + ], + "base": "e54523517d0f03e58352e647c403a5af3e525a57", + "caller": "07a76c5e2738882c0cb322278e56f6cae3c9885d", + "caller_sha256": "255d89f38cd45e38e5770f559bc43dc217e989032359768cdc7e8cdfd64b47bc", + "crossing": [ + "0.00364665195644044790699554028334161", + "0.00364665195644044790699554028334162" + ], + "end": "2026-11-11T23:04:43Z", + "exit": 0, + "head": "aaeec8c0acf01e99a5f331ef363a698d9c084ace", + "hosted_at_admission": "plan and historical success; candidate replay in progress", + "inputs": { + "EARLY-RESULT.json": "ad1ca9b2e2febbf80d9bf8b6ceef14ff90fcc29ef9358310e551628eb1706649", + "INPUTS.json": "abedac59097a1c35c27d91cbdb07207bc562a64743bc406d13c94a8bc970592d", + "NATIVE-RESULT.json": "c6d1b00a83185ab0062397b363258b1f3f6685d755e9c1d4f7d3e7e511240812", + "PROPOSED-CLAIM.json": "6e31241944c123d2bd4aa8bc94d833b44b3d889bd6d9aafc579108f416b45f03", + "RESULT.json": "7f2d587c59f063b01f1e8b320084a7f0943f2f05d65e3e0f5e80448c6c8e8194", + "SOURCES.json": "ac7b4473035af648d6073e78b6c39675e706e8194b346bb55ed62a0adc81d593", + "VERIFY.json": "ede7dd2dd3733b9a73f72af9dd7edfe819b49b859c5c76e227ec82cb9c220513", + "WORD.json.gz": "4b9fd1187b34ed97c3ac0c760d73531735a5d0ebc5b4d4ab4377160b20d9bb2a" + }, + "kappa": "0.00364665195644", + "ours": "0", + "peer_gain": "0.000000430519994", + "prior_kappa": "0.003646221436446", + "receipt": { + "peer-prep/IDENTITIES.json": "f4d3f6ca2d87f8cd68c01ac9f77b69bd5a796f92bd567cea8afe3ac7c72e8e4b", + "peer-prep/STATIC.json": "500cc563b7dac8b1de1faf1dee9b820e73152dfddc15a650cd1191edd39e8c79", + "peer-price/RANK-STOCK.json": "4a7841699dd17688f6aada5c902a2a91e94558b2b1b4460c46b0e55aa95b3f9f", + "peer-price/READBACK.json": "337668788fb39ec9575887f9c5faf438a880471f78d936357dabf7deeac5de82", + "peer/COMMAND.txt": "714bfab024155d8216f3ef99f3ee7627ddc35ab341c486ac6bd53c476b757130", + "peer/COMMIT.stdout": "597470d8132a3812deb3624a859546c0c13d52b094fd6fc61e7416941130bd70", + "peer/END-UTC.txt": "9c46923c616c14da5b8ed503e1652021d7bd409a10ec91a78a03263013fba08a", + "peer/METADATA.stdout": "5873404cb4424dca918a00d503569f3c29a3190fd029a007e1afb2006399f647", + "peer/RUN.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa", + "peer/RUN.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "peer/RUN.stdout": "d589626c7581fbb9928bc615364cfee49deb62dfc0a39a903417ca62be89cf8c", + "peer/START-UTC.txt": "5b78fd6d42a2b42206891318c08e6014de57d7ca46b0201cd11a166f452210f7" + }, + "source_history": "exact anchored base and recursive package provenance, sparse shallow stock wrapper not executed", + "stages": { + "caller": "PASS_HELPER_319_FUSED_CALLER 91166298911/25000000000000", + "early": "PASS_HELPER_319_EXACT_NATIVE_AND_SIGNED_PRICE 0.00364665195644", + "frontier": "PASS_HELPER_319_FUSED_FRONTIER_PROPOSAL 91166298911/25000000000000", + "native": "PASS_HELPER_319_FUSED_NATIVE 3646017316711/1000000000000000" + }, + "start": "2026-11-11T22:54:48Z", + "status": "independently_reproduced_comparable", + "tree": "fa98712a459b20c10240450097c87de433f8a750" +} diff --git a/research/p104-type-a-query-cache-pair-bound/inputs/7334-READBACK.json b/research/p104-type-a-query-cache-pair-bound/inputs/7334-READBACK.json new file mode 100644 index 0000000000..625b508eea --- /dev/null +++ b/research/p104-type-a-query-cache-pair-bound/inputs/7334-READBACK.json @@ -0,0 +1,188 @@ +{ + "assumptions": [ + "native_all_columns", + "owned_erasure", + "compiler", + "precision_tape", + "analytic_recovery" + ], + "bit_admitted": "12039/3125000", + "bit_claim_headroom": "3000951089/25000000000000", + "bit_premise": "376669/100000000", + "caller_head": "07a76c5e2738882c0cb322278e56f6cae3c9885d", + "claim": "91166298911/25000000000000", + "context_c": 2430, + "context_headroom": 1666, + "copies": 17, + "directed_bounds": { + "new_at_claim": [ + "347195197206460540909548691538238227127/2000000000000000000000000000000000000000000000000", + "1735975986032302704547743457691191192207/10000000000000000000000000000000000000000000000000" + ], + "new_at_old_crossing_upper": [ + "333717954993733063339209580360321337006028706669/2000000000000000000000000000000000000000000000000", + "1668589774968665316696047901801606685030143589709/10000000000000000000000000000000000000000000000000" + ], + "new_at_raw_lower": [ + "8890529086421014119/10000000000000000000000000000000000000000000000000", + "8890529086421080299/10000000000000000000000000000000000000000000000000" + ], + "new_at_raw_upper": [ + "-29866980917152322049/10000000000000000000000000000000000000000000000000", + "-29866980917152266101/10000000000000000000000000000000000000000000000000" + ], + "new_at_tested": [ + "1464673416007288863003441470091977383033/10000000000000000000000000000000000000000000000000", + "1464673416007288863003441470091977438357/10000000000000000000000000000000000000000000000000" + ], + "old_at_claim": [ + "-1668785950738799647054310634446839861363893886031/10000000000000000000000000000000000000000000000000", + "-66751438029551985882172425377873594454555753177/400000000000000000000000000000000000000000000000" + ], + "old_at_old_crossing_upper": [ + "-357270001119021587349/10000000000000000000000000000000000000000000000000", + "-357270001119021530951/10000000000000000000000000000000000000000000000000" + ] + }, + "empty_root_credits": 0, + "exact_gain": "215259997/500000000000000", + "exact_relative_percent": "21525999700/1823110718223", + "head": "aaeec8c0acf01e99a5f331ef363a698d9c084ace", + "incumbent": "1823110718223/500000000000000", + "main_boundaries": 104, + "native_grid": [ + 1125, + 25 + ], + "native_ingredient_claim": "3646017316711/1000000000000000", + "new_raw_interval": [ + "364665195644044790699554028334161/100000000000000000000000000000000000", + "182332597822022395349777014167081/50000000000000000000000000000000000" + ], + "old_raw_upper": "36462214364462343366888845568981/10000000000000000000000000000000000", + "ordinary": 782715464, + "ordinary_delta": 52088, + "ordinary_headroom": 217284536, + "outer_functional": 4, + "outer_strict": 54, + "outer_strict_slack": "299635334804355997/10000000000000000000000000000000000", + "owned_lifetimes": 73, + "owned_peak": 50, + "paid": { + "1": 68384, + "2": 14501, + "3": 14093, + "4": 3791, + "5": 5865, + "6": 238, + "7": 170, + "8": 741, + "9": 32, + "16": 416, + "24": 416, + "32": 416, + "40": 416, + "48": 416, + "56": 416, + "64": 208 + }, + "paid_delta": { + "1": -17, + "5": -17, + "6": 17 + }, + "paid_positions": 110519, + "parent": "9d0119eb12fbd9fa534b48cd37b68e7099757b91", + "path_pins": { + "dependencies/7298/pricing.py": { + "sha256": "f4d0b6c9314b838d882d6d06020f24881c19a3fda97a7c00df87b1e920785182" + }, + "dependencies/7314/NATIVE-RESULT.json": { + "sha256": "336f463da5afe5b60bfd3b9f0ce8aeea5a5feb1f854613bf4218ba0b28b3371b" + }, + "dependencies/7314/PROPOSED-CLAIM.json": { + "sha256": "41a08c4b7d0b2de4af22bc778948a143027eb3065fff47b0400b6ded1cc52778" + }, + "dependencies/7314/RESULT.json": { + "sha256": "432191ca572c9221935787ebe392699e3a1ef4512b0bf4fbc704657321cc87ca" + }, + "dependencies/round65/price.json": { + "sha256": "25205ad2cf4230bd2b2b704eec9f96ec4a5486fd575b5599861b28ffdd15b00b" + }, + "receipts/EARLY-RESULT.json": { + "git_blob": "675d6cf2374f3384019dfd53b2bdffd845005f13", + "sha256": "ad1ca9b2e2febbf80d9bf8b6ceef14ff90fcc29ef9358310e551628eb1706649" + }, + "receipts/INPUTS.json": { + "git_blob": "95c53f4594287a72d9b586f10ee136d0a1686984", + "sha256": "abedac59097a1c35c27d91cbdb07207bc562a64743bc406d13c94a8bc970592d" + }, + "receipts/NATIVE-RESULT.json": { + "git_blob": "eb101307d4d0399efed96d88cf6d4c01ec9c7369", + "sha256": "c6d1b00a83185ab0062397b363258b1f3f6685d755e9c1d4f7d3e7e511240812" + }, + "receipts/PROOF.md": { + "git_blob": "7644e5571d583183ee93b686612b5ec4555f6911", + "sha256": "560de573bfd4563c16ca3c7308fa729b4188fabe802d8830f343c3873f75b59d" + }, + "receipts/PROPOSED-CLAIM.json": { + "git_blob": "6b491894580741e3e2c11a453722a0302db7b5d6", + "sha256": "6e31241944c123d2bd4aa8bc94d833b44b3d889bd6d9aafc579108f416b45f03" + }, + "receipts/README.md": { + "git_blob": "b3a055f4e0d334ce2e7df3310caaa0849eb3eba1", + "sha256": "b4db0eb83ab6a2f7151bed2da955a487f4816ec9d1976eccc21e54c2725490b0" + }, + "receipts/REFERENCE.json": { + "git_blob": "8859e243cc39546bcb1e257d95c19a658c455dc7", + "sha256": "3e66e054b803551f18b8670da0b2990a7d0eeb689dfc45b56dbcba295551da70" + }, + "receipts/REPLAY.txt": { + "git_blob": "0b8d8048c18740060f4b7f6d380a5f3a0f30ee53", + "sha256": "230984f4b8206ae4d0c0f18fbba86ff43a1a9623f8ed337cf1285360f9a67c0c" + }, + "receipts/RESULT.json": { + "git_blob": "3034a490f5b0656ae71495c99493c4ab1ac1f5c6", + "sha256": "7f2d587c59f063b01f1e8b320084a7f0943f2f05d65e3e0f5e80448c6c8e8194" + }, + "receipts/SOURCES.json": { + "git_blob": "6b97e903a6df8de437068a0e2907823885928053", + "sha256": "ac7b4473035af648d6073e78b6c39675e706e8194b346bb55ed62a0adc81d593" + }, + "receipts/VERIFY.json": { + "git_blob": "cc98ee2a5c5a79e670094a6f55c7cacda8fd330c", + "sha256": "ede7dd2dd3733b9a73f72af9dd7edfe819b49b859c5c76e227ec82cb9c220513" + }, + "receipts/construct.py": { + "git_blob": "89e923bd738dfc404ca76b7ae36f13844ac4bfbb", + "sha256": "ecb39578063d7f09153a85370a3b9bb7cbf8b36ff9891033a1cce7a2fe7f7fda" + } + }, + "physical_maps": 3037, + "productive_fields": 22461, + "rank_surplus": 1424, + "raw_strict_separation": "43051999421357030665572644351/100000000000000000000000000000000000", + "scope": "Exact receipt and directed-price readback. No native or caller execution in this audit.", + "source_archive_sha256": "0589953b3886d96eacf3bda3d38d8d574bb739fba1056af7f32f56047b6061e2", + "targets": { + "1": 306, + "2": 357, + "3": 799, + "4": 3825, + "5": 1360, + "6": 731, + "7": 323, + "8": 544, + "9": 10888, + "17": 416, + "25": 416, + "33": 416, + "41": 416, + "49": 416, + "57": 416, + "65": 416, + "73": 208, + "137": 208 + }, + "tested": "364665195644007/100000000000000000" +} diff --git a/research/p104-type-a-query-cache-pair-bound/inputs/QUERY-CENSUS.json b/research/p104-type-a-query-cache-pair-bound/inputs/QUERY-CENSUS.json new file mode 100644 index 0000000000..9e3320bb7c --- /dev/null +++ b/research/p104-type-a-query-cache-pair-bound/inputs/QUERY-CENSUS.json @@ -0,0 +1,674 @@ +{ + "caller_sha256": "255d89f38cd45e38e5770f559bc43dc217e989032359768cdc7e8cdfd64b47bc", + "controls": { + "negative_determinant_one_slack_one": true, + "positive_exact_slack_two": true + }, + "dimension": 36, + "head": "ed090b57ed88f8859e5ff4643645099e6ba856ea", + "mutants": [ + { + "minus_endpoint_difference_rank": 1, + "proof": "slack_one", + "remaining_defect_rank_budget": 37, + "removed": [ + 1516 + ] + }, + { + "minus_endpoint_difference_rank": 1, + "proof": "slack_one", + "remaining_defect_rank_budget": 37, + "removed": [ + 1580 + ] + }, + { + "minus_endpoint_difference_rank": 1, + "proof": "slack_one", + "remaining_defect_rank_budget": 37, + "removed": [ + 1659 + ] + }, + { + "minus_endpoint_difference_rank": 1, + "proof": "slack_one", + "remaining_defect_rank_budget": 37, + "removed": [ + 1721 + ] + }, + { + "minus_endpoint_difference_rank": 2, + "proof": "slack_zero", + "remaining_defect_rank_budget": 36, + "removed": [ + 1516, + 1580 + ] + }, + { + "minus_endpoint_difference_rank": 2, + "proof": "slack_zero", + "remaining_defect_rank_budget": 36, + "removed": [ + 1516, + 1659 + ] + }, + { + "minus_endpoint_difference_rank": 2, + "proof": "slack_zero", + "remaining_defect_rank_budget": 36, + "removed": [ + 1516, + 1721 + ] + }, + { + "minus_endpoint_difference_rank": 2, + "proof": "slack_zero", + "remaining_defect_rank_budget": 36, + "removed": [ + 1580, + 1659 + ] + }, + { + "minus_endpoint_difference_rank": 2, + "proof": "slack_zero", + "remaining_defect_rank_budget": 36, + "removed": [ + 1580, + 1721 + ] + }, + { + "minus_endpoint_difference_rank": 2, + "proof": "slack_zero", + "remaining_defect_rank_budget": 36, + "removed": [ + 1659, + 1721 + ] + }, + { + "minus_endpoint_difference_rank": 3, + "proof": "rank", + "remaining_defect_rank_budget": 35, + "removed": [ + 1516, + 1580, + 1659 + ] + }, + { + "minus_endpoint_difference_rank": 3, + "proof": "rank", + "remaining_defect_rank_budget": 35, + "removed": [ + 1516, + 1580, + 1721 + ] + }, + { + "minus_endpoint_difference_rank": 3, + "proof": "rank", + "remaining_defect_rank_budget": 35, + "removed": [ + 1516, + 1659, + 1721 + ] + }, + { + "minus_endpoint_difference_rank": 3, + "proof": "rank", + "remaining_defect_rank_budget": 35, + "removed": [ + 1580, + 1659, + 1721 + ] + }, + { + "minus_endpoint_difference_rank": 4, + "proof": "rank", + "remaining_defect_rank_budget": 34, + "removed": [ + 1516, + 1580, + 1659, + 1721 + ] + } + ], + "ports": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 16, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 28, + 29, + 30, + 31, + 32, + 33, + 36, + 37, + 38, + 39, + 40, + 41, + 43, + 44, + 45, + 46, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97, + 98, + 99, + 100, + 101, + 102, + 103 + ], + "proof_census": { + "rank": 5, + "slack_one": 4, + "slack_zero": 6 + }, + "q_minus_endpoint": "-I", + "q_plus_endpoint": "+I", + "query_events": { + "1516": { + "destination": 0, + "q_power": -1, + "relative_defect_rank": 1, + "source": 1 + }, + "1580": { + "destination": 0, + "q_power": -1, + "relative_defect_rank": 1, + "source": 1 + }, + "1659": { + "destination": 0, + "q_power": -1, + "relative_defect_rank": 1, + "source": 1 + }, + "1721": { + "destination": 0, + "q_power": -1, + "relative_defect_rank": 1, + "source": 1 + } + }, + "relative_j_blocks": [ + { + "axes": [ + 1, + 0, + 18, + 19 + ], + "plus_identity_restricted_rank": 2, + "relative_defect_entries": [ + [ + 0, + 1, + "-2" + ], + [ + 18, + 19, + "2" + ] + ], + "relative_defect_rank": 2, + "stage": 1 + }, + { + "axes": [ + 2, + 0, + 18, + 20 + ], + "plus_identity_restricted_rank": 2, + "relative_defect_entries": [ + [ + 0, + 2, + "-2" + ], + [ + 18, + 20, + "2" + ] + ], + "relative_defect_rank": 2, + "stage": 2 + }, + { + "axes": [ + 3, + 0, + 18, + 21 + ], + "plus_identity_restricted_rank": 2, + "relative_defect_entries": [ + [ + 0, + 3, + "-2" + ], + [ + 18, + 21, + "2" + ] + ], + "relative_defect_rank": 2, + "stage": 3 + }, + { + "axes": [ + 4, + 0, + 18, + 22 + ], + "plus_identity_restricted_rank": 2, + "relative_defect_entries": [ + [ + 0, + 4, + "-2" + ], + [ + 18, + 22, + "2" + ] + ], + "relative_defect_rank": 2, + "stage": 4 + }, + { + "axes": [ + 5, + 0, + 18, + 23 + ], + "plus_identity_restricted_rank": 2, + "relative_defect_entries": [ + [ + 0, + 5, + "-2" + ], + [ + 18, + 23, + "2" + ] + ], + "relative_defect_rank": 2, + "stage": 5 + }, + { + "axes": [ + 6, + 0, + 18, + 24 + ], + "plus_identity_restricted_rank": 2, + "relative_defect_entries": [ + [ + 0, + 6, + "-2" + ], + [ + 18, + 24, + "2" + ] + ], + "relative_defect_rank": 2, + "stage": 6 + }, + { + "axes": [ + 7, + 0, + 18, + 25 + ], + "plus_identity_restricted_rank": 2, + "relative_defect_entries": [ + [ + 0, + 7, + "-2" + ], + [ + 18, + 25, + "2" + ] + ], + "relative_defect_rank": 2, + "stage": 7 + }, + { + "axes": [ + 8, + 0, + 18, + 26 + ], + "plus_identity_restricted_rank": 2, + "relative_defect_entries": [ + [ + 0, + 8, + "-2" + ], + [ + 18, + 26, + "2" + ] + ], + "relative_defect_rank": 2, + "stage": 8 + }, + { + "axes": [ + 9, + 0, + 18, + 27 + ], + "plus_identity_restricted_rank": 2, + "relative_defect_entries": [ + [ + 0, + 9, + "-2" + ], + [ + 18, + 27, + "2" + ] + ], + "relative_defect_rank": 2, + "stage": 9 + }, + { + "axes": [ + 10, + 0, + 18, + 28 + ], + "plus_identity_restricted_rank": 2, + "relative_defect_entries": [ + [ + 0, + 10, + "-2" + ], + [ + 18, + 28, + "2" + ] + ], + "relative_defect_rank": 2, + "stage": 10 + }, + { + "axes": [ + 11, + 0, + 18, + 29 + ], + "plus_identity_restricted_rank": 2, + "relative_defect_entries": [ + [ + 0, + 11, + "-2" + ], + [ + 18, + 29, + "2" + ] + ], + "relative_defect_rank": 2, + "stage": 11 + }, + { + "axes": [ + 12, + 0, + 18, + 30 + ], + "plus_identity_restricted_rank": 2, + "relative_defect_entries": [ + [ + 0, + 12, + "-2" + ], + [ + 18, + 30, + "2" + ] + ], + "relative_defect_rank": 2, + "stage": 12 + }, + { + "axes": [ + 13, + 0, + 18, + 31 + ], + "plus_identity_restricted_rank": 2, + "relative_defect_entries": [ + [ + 0, + 13, + "-2" + ], + [ + 18, + 31, + "2" + ] + ], + "relative_defect_rank": 2, + "stage": 13 + }, + { + "axes": [ + 14, + 0, + 18, + 32 + ], + "plus_identity_restricted_rank": 2, + "relative_defect_entries": [ + [ + 0, + 14, + "-2" + ], + [ + 18, + 32, + "2" + ] + ], + "relative_defect_rank": 2, + "stage": 14 + }, + { + "axes": [ + 15, + 0, + 18, + 33 + ], + "plus_identity_restricted_rank": 2, + "relative_defect_entries": [ + [ + 0, + 15, + "-2" + ], + [ + 18, + 33, + "2" + ] + ], + "relative_defect_rank": 2, + "stage": 15 + }, + { + "axes": [ + 16, + 0, + 18, + 34 + ], + "plus_identity_restricted_rank": 2, + "relative_defect_entries": [ + [ + 0, + 16, + "-2" + ], + [ + 18, + 34, + "2" + ] + ], + "relative_defect_rank": 2, + "stage": 16 + }, + { + "axes": [ + 17, + 0, + 18, + 35 + ], + "plus_identity_restricted_rank": 2, + "relative_defect_entries": [ + [ + 0, + 17, + "-2" + ], + [ + 18, + 35, + "2" + ] + ], + "relative_defect_rank": 2, + "stage": 17 + } + ], + "subsets_tested": 15, + "unvisited_subsets": [] +} diff --git a/research/p104-type-a-query-cache-pair-bound/inputs/pricing.py b/research/p104-type-a-query-cache-pair-bound/inputs/pricing.py new file mode 100644 index 0000000000..40ec194017 --- /dev/null +++ b/research/p104-type-a-query-cache-pair-bound/inputs/pricing.py @@ -0,0 +1,82 @@ +"""Directed interval arithmetic and the retained signed BIT invoice.""" +from collections import Counter +from fractions import Fraction +from functools import cache + +TARGET = "10018846261809/2500000000000000" +SCALE = 10**49 + + +def rounded(x, upper): + scaled = SCALE*x + if upper: + return Fraction(-((-scaled.numerator) // scaled.denominator), SCALE) + return Fraction(scaled.numerator // scaled.denominator, SCALE) + + +@cache +def log_bounds(x): + z = (x-1)/(x+1) + terms = 60 + exact_partial = 2*sum(z**(2*i+1)/(2*i+1) for i in range(terms)) + tail = 2*z**(2*terms+1)/((2*terms+1)*(1-z*z)) + return rounded(exact_partial, False), rounded(exact_partial+tail, True) + + +@cache +def power_bounds(rank, k): + binary = 2**(rank.bit_length()-1) + shift = binary.bit_length()-1 + l2, u2 = log_bounds(Fraction(2)) + lo, hi = log_bounds(Fraction(rank, binary)) + lo, hi = k*(lo+shift*l2), k*(hi+shift*u2) + assert 0 <= lo <= hi < 1 + + def exponential(z, terms): + total = term = Fraction(1) + for i in range(1, terms+1): + term *= -z/i + total += term + return total + + return rounded(rank*exponential(hi, 35), False), rounded(rank*exponential(lo, 34), True) + + +def cost(hist, k): + lower = upper = Fraction(0) + for r, n in hist.items(): + a, b = (n*x for x in power_bounds(r, k)) + lower += min(a, b) + upper += max(a, b) + return lower, upper + + +def profile(invoice, native, word, ranks): + copies = invoice["native_calls"] + assert copies == len(invoice["native_instances"]) == 36 + assert {tuple((r["stage"], r["copy"])) for r in invoice["native_instances"]} == { + (stage, which) for stage in range(1, 19) for which in (0, 1) + } + assert all(r["ports"] == 111 for r in invoice["native_instances"]) + assert native == Counter({int(r): n for r, n in invoice["native_paid"].items()}) + assert sum(native.values()) == 2871 + caller_paid = {1: 444, **{r: 444 for r in range(7, 57, 7)}} + assert invoice["event_counts"]["QUERY"]*111 == caller_paid[1] + assert invoice["event_counts"]["IDLE_ONE"]*111 == 8*444 + full_paid = Counter({r: copies*n for r, n in native.items()}) + full_paid.update(caller_paid) + + helpers = Counter(ranks[word["final"][j]]-ranks[word["start"][j]] + for j in range(222, word["public"])) + assert helpers == Counter({int(r): n for r, n in invoice["native_helpers"].items()}) + caller_targets = {**{r: 444 for r in range(8, 65, 7)}, 127: 222} + full_targets = Counter({r: copies*n for r, n in helpers.items()}) + full_targets.update(caller_targets) + assert full_paid == Counter({int(r): n for r, n in invoice["paid"].items()}) + assert full_targets == Counter({int(r): n for r, n in invoice["targets"].items()}) + assert sum(full_paid.values()) == invoice["paid_jobs"] + assert sum(full_targets.values()) == invoice["productive_fields"] + signed = full_targets.copy() + signed.subtract(full_paid) + assert sum(r*n for r, n in signed.items()) == invoice["rank_surplus"] + return signed, copies diff --git a/research/p104-type-a-query-cache-pair-bound/receipts/SHA256.json b/research/p104-type-a-query-cache-pair-bound/receipts/SHA256.json new file mode 100644 index 0000000000..f9dc3acbda --- /dev/null +++ b/research/p104-type-a-query-cache-pair-bound/receipts/SHA256.json @@ -0,0 +1,6 @@ +{ + "CONTROLS.json": "e0b7054638fc2bda69c859c9181460c194ac67b200542f054237f105028c93a5", + "INDEPENDENT.json": "74b4c8f43c5f1155bf3a36c90a2b39411c35b225d7626067eafa874d12839577", + "LEAD.json": "5f8e710f80c575da740773b121557502cc207b2de01f75a141b17e0fecdf4f4a", + "PRICE.json": "bbc486a3eb0e2aed03dd09f400fa94de1a59312058a9826880999155b10453bf" +} diff --git a/research/p104-type-a-query-cache-pair-bound/replay.py b/research/p104-type-a-query-cache-pair-bound/replay.py new file mode 100644 index 0000000000..4afb11aa3e --- /dev/null +++ b/research/p104-type-a-query-cache-pair-bound/replay.py @@ -0,0 +1,116 @@ +"""Replay both exact Type A QUERY source exclusions and the complete price.""" +from argparse import ArgumentParser +from fractions import Fraction as Q +from gzip import decompress +from hashlib import sha1, sha256 +from json import loads +from pathlib import Path +from shutil import copyfile +from subprocess import run +from sys import executable +from tempfile import TemporaryDirectory + +HERE=Path(__file__).resolve().parent +CALLER='255d89f38cd45e38e5770f559bc43dc217e989032359768cdc7e8cdfd64b47bc' +CALLER_BLOB='9451ceaf6e8e037894680b549f3ef41c21b260d7' +HEAD='aaeec8c0acf01e99a5f331ef363a698d9c084ace' + + +def require(condition,message): + if not condition: + raise ValueError(message) + + +def unique(pairs): + result=dict(pairs) + require(len(result)==len(pairs),'Duplicate input path or JSON key') + return result + + +def read(raw): + return loads(raw,object_pairs_hook=unique) + + +def digest(raw): + return sha256(raw).hexdigest() + + +def replay(out): + for rel,expected in read((HERE/'LOCAL-PINS.json').read_bytes()).items(): + path=HERE/rel + require(path.resolve().is_relative_to(HERE) and digest(path.read_bytes())==expected, + f'Changed input {rel}') + wanted=read((HERE/'receipts/SHA256.json').read_bytes()) + source=decompress((HERE/'inputs/7113-CALLER.json.gz').read_bytes()) + require(digest(source)==CALLER and sha1(b'blob '+str(len(source)).encode()+b'\0'+source).hexdigest()==CALLER_BLOB, + 'Changed exact caller') + out.mkdir(parents=True,exist_ok=False) + with TemporaryDirectory(prefix='query-cache-') as tmp: + work=Path(tmp); price=work/'price'; independent=work/'independent' + (price/'inputs').mkdir(parents=True); (independent/'inputs').mkdir(parents=True) + for name in ('QUERY-CENSUS.json','7334-READBACK.json','7334-ADMITTED.json','pricing.py'): + copyfile(HERE/'inputs'/name,price/'inputs'/name) + copyfile(HERE/'engines/quote.py',price/'quote.py') + copyfile(HERE/'engines/independent.py',independent/'independent.py') + (price/'inputs/7113-CALLER.json').write_bytes(source) + (independent/'inputs/CALLER.json').write_bytes(source) + + def stage(name,script,*args): + result=run([executable,'-I','-B',str(script),*map(str,args)],cwd=work, + check=True,capture_output=True,timeout=20) + require(digest(result.stdout)==wanted[name],f'Changed receipt {name}') + (out/name).write_bytes(result.stdout) + return result.stdout + + quote=stage('PRICE.json',price/'quote.py') + (price/'PRICE.json').write_bytes(quote); (independent/'inputs/PRICE.json').write_bytes(quote) + primary=read(stage('LEAD.json',HERE/'engines/lead.py',work)) + second=read(stage('INDEPENDENT.json',independent/'independent.py','--support')) + stage('CONTROLS.json',independent/'independent.py','--controls-only') + stock=read(quote) + require(primary['head']==second['head']==stock['head']==HEAD and + primary['caller_sha256']==second['caller_sha256']==CALLER,'Changed comparator') + require(primary['price_sha256']==second['price_sha256']==digest(quote),'Support price mismatch') + require(primary['q']==-1 and second['endpoint_checks']==4 and + {p['q'] for p in second['probes']}=={-1,1},'Lost signed controls') + require(not any((primary['survivors'],primary['unvisited'],second['symbolic_only'],second['unvisited'])), + 'A support gate is incomplete') + require(len(primary['decisions'])==len(second['decisions'])==6,'Wrong exact pair count') + + def minor(rows,pair,coordinates): + first,later=(rows[str(clock)] for clock in pair) + i,j=map(str,coordinates) + return Q(first.get(i,'0'))*Q(later.get(j,'0'))-Q(first.get(j,'0'))*Q(later.get(i,'0')) + + for a,b,key in zip(primary['decisions'],second['decisions'],stock['eligible_pairs_before_support'],strict=True): + require(a['key']==b['pair']==key,'Changed ordered pair') + require(a['status']=='source rows not proportional' and b['status']=='exact_nonproportional_source', + 'Unexpected support disposition') + for receipt,rows,field in ((a,primary['source_rows'],'cross_product'),(b,second['sources'],'determinant')): + witness=receipt['witness'] + exact=minor(rows[receipt['probe']],key,witness['coordinates']) + require(exact and exact==Q(witness[field]),'Incorrect rational minor') + require(stock['whole_optimistic_stock_upper']=='288' and + stock['by_number_of_reused_queries']['1']['exact_credit']=='96','Changed stock upper') + (independent/'inputs/CALLER.json').write_bytes(source+b'\n') + negative=run([executable,'-I','-B',str(independent/'independent.py'),'--support'],cwd=work, + capture_output=True,timeout=20) + require(negative.returncode and b'Changed input CALLER.json' in negative.stderr and not negative.stdout, + 'Changed caller was accepted') + require({p.name for p in out.iterdir()}==set(wanted),'Changed receipt set') + print('PASS_TYPE_A_QUERY_CACHE_PAIR_BOUND pairs=6 excluded=6 unresolved=0 kappa_change=0') + + +def main(): + p=ArgumentParser(description=__doc__) + p.add_argument('--out',type=Path) + a=p.parse_args() + if a.out: + replay(a.out.resolve()) + else: + with TemporaryDirectory(prefix='query-cache-receipts-') as tmp: + replay(Path(tmp)/'out') + + +if __name__=='__main__': + main() From 1d924a75e40cf2e775f4a5cb2539f5c294464fc1 Mon Sep 17 00:00:00 2001 From: ToikY <27568617+ToikY@users.noreply.github.com> Date: Wed, 11 Nov 2026 16:06:57 -0800 Subject: [PATCH 2/2] Reuse the #7257 repair for the shared package CI planner Carry the exact documentation and pinned historical replay repair at d2e54af81f9dda6487636b79d4964a2385d89b2b. The scientific package is byte-identical. --- docs/ci-verification.md | 19 +++++- .../historical-selected-replay-gap/README.md | 6 +- .../SOURCES.json | 60 +++++++++--------- .../VERIFY.json | 31 +-------- .../historical-selected-replay-gap/verify.py | 63 ++++++++++++++----- 5 files changed, 100 insertions(+), 79 deletions(-) diff --git a/docs/ci-verification.md b/docs/ci-verification.md index 63ba3e9aa8..52b62d0481 100644 --- a/docs/ci-verification.md +++ b/docs/ci-verification.md @@ -1,8 +1,25 @@ # CI verification -## Current selected-family replay: #6030 +## Current selected-family replay: #7000 with #7001 The [selected record](../certificates/selected-result.json) binds conditional +κ = 0.00363005817 to the [application review](research/pr-intake-evidence/pr7000-application/PROOF-REVIEW.md), +[validation receipts](research/pr-intake-evidence/pr7000-application/VALIDATION.json), +and [explicit source closure](../certificates/frontier7000-source.json). +`make frontier7000-verify` follows that exact-source selected replay. The review +reuses eleven authenticated preceding executions and records seven fresh serial +application, scalar and complete native-catalogue executions. The earlier +monolithic timeout is retained separately and is not completed coverage. +Consult the receipts for exact commands, source heads and limits. + +The five inherited framework assumptions remain. No complete uniform word, +literal multiplier execution, independent human proof or formal-kernel proof +is asserted. Routine research submissions do not need to rerun this +selected-family replay. The sections below preserve historical checkpoints. + +## Historical selected-family replay: #6030 + +The [historical checkpoint](../certificates/checkpoints/frontier6030.json) binds conditional κ = 0.003125804 to the [proof review](research/pr-intake-evidence/pr6030-audit/PROOF-REVIEW.md), [validation receipts](research/pr-intake-evidence/pr6030-audit/VALIDATION.json), and [explicit source closure](../certificates/frontier6030-source.json). diff --git a/research/historical-selected-replay-gap/README.md b/research/historical-selected-replay-gap/README.md index 55d8cc3b49..36d9a873ca 100644 --- a/research/historical-selected-replay-gap/README.md +++ b/research/historical-selected-replay-gap/README.md @@ -69,7 +69,11 @@ python3 -B scripts/research_package.py --package research/historical-selected-re The direct command prints `PASS_HISTORICAL_SELECTED_REPLAY_GAP`. A registered replay prints `PASS_REGISTERED_RESEARCH_PACKAGE`. Both require Git history -containing the two inspected commits. +containing the two inspected commits and the source and manifest objects at +`2485805a6d47f36ea83ddde6327d453ac82d44dc`. The verifier uses a temporary +sparse checkout of that commit, checks the declared source digests there, and +uses its planner and manifest inventory. The recorded rejections and selection +therefore remain reproducible after later changes to the live Makefile or CI guide. ## Open next questions diff --git a/research/historical-selected-replay-gap/SOURCES.json b/research/historical-selected-replay-gap/SOURCES.json index c1010eec95..62bb8b3950 100644 --- a/research/historical-selected-replay-gap/SOURCES.json +++ b/research/historical-selected-replay-gap/SOURCES.json @@ -4,13 +4,13 @@ "files": [ { "path": "Makefile", - "usage": "input", + "usage": "provenance", "git_blob": "0d683a06b9e7ee162496108ce9a7c5d2ee94fccf", "sha256": "4f2d4f2dcd15139ec82658a975f85ed300897385f85799218539f4c8d60567da" }, { "path": "certificates/partial-swap-network.json", - "usage": "input", + "usage": "provenance", "git_blob": "eccafa830c16170c36faf93045ddf1f638f7bcd4", "sha256": "4c0b9d37e1034b2076e30a70f8e514416298c462d9ee98bc87fe6556b14df786" }, @@ -22,7 +22,7 @@ }, { "path": "docs/ci-verification.md", - "usage": "input", + "usage": "provenance", "git_blob": "63ba3e9aa8bdc5e942b56e34244b92b16f854085", "sha256": "c7d3027e9ad8bcbff68f07aa9576b30fb2f3c76c44d876d40c7fdbf4a3e2228a" }, @@ -34,163 +34,163 @@ }, { "path": "research/clifford-state-performance/SOURCE.json", - "usage": "input", + "usage": "provenance", "git_blob": "6f98a0061a5104dfab82c9e806f819b41811f684", "sha256": "396d0f08df24952248140d5c65c51b8c902ef1c580892ff7ea182890530f67ee" }, { "path": "research/community-batch1047-audit/CONTENT-COVERAGE.json", - "usage": "input", + "usage": "provenance", "git_blob": "5e0f92af463ec12c5e1dcc3effd44081a88af647", "sha256": "07a9daeaf2bda308a92e9a4684f13d5fc766c7772d74801fceb7f4599fdab226" }, { "path": "research/community-batch1099-audit/CONTENT-COVERAGE.json", - "usage": "input", + "usage": "provenance", "git_blob": "9e13266bf85e627f1b7dc225e9530ea69fd2c7f0", "sha256": "421e1211fb1897c45621dc6801c276e53f2e6f335583c9c9049e535f87c0a3b1" }, { "path": "research/community-batch932-audit/CONTENT-COVERAGE.json", - "usage": "input", + "usage": "provenance", "git_blob": "cc4d03eb59b9ab3f952735f7e88ff18c2d15d7af", "sha256": "184629cac91a5cfaca50330a88596008b824221433867dcf8117539c913c284a" }, { "path": "research/community-batch970-audit/CONTENT-COVERAGE.json", - "usage": "input", + "usage": "provenance", "git_blob": "8b9f4111badf7de5d97684799560b55110e9da79", "sha256": "23188ed920e38a54006cb883e181585620821c63bf7e8b5e05d32719417cc37e" }, { "path": "research/community-frontier741-audit/CONTENT-COVERAGE.json", - "usage": "input", + "usage": "provenance", "git_blob": "a5300d4e7a5381a3f443fc54c768ca6f0f236d68", "sha256": "3c820fb30e1b4d9bcfc6a7ab524375e5b2abd66b940af2c509146104f0bcd79c" }, { "path": "research/community-frontier890-audit/CONTENT-COVERAGE.json", - "usage": "input", + "usage": "provenance", "git_blob": "d7ff6d777b01d69b6ce84caf25d3b7e4a4d2f211", "sha256": "6b185a9902652f893f3ebd8ada92d2f11b6de6533a9a4d11718a8a4496101128" }, { "path": "research/community-hyperplane599-audit/SOURCE.json", - "usage": "input", + "usage": "provenance", "git_blob": "546f37d326d10a99910ae8f908e71ef768524d98", "sha256": "65099d764bfcc39bda5e4d9966783611b094c3522dbdd1435cd498d657a8ef8e" }, { "path": "research/community-k492-audit/SOURCE.json", - "usage": "input", + "usage": "provenance", "git_blob": "e538481e4cb16ed936d3195f2dfb5b5a9ca0a76b", "sha256": "2c0f4fa5bc150d05658af2e7c54c4d2c337dd52b7efd3d69530ae73bcbdf452a" }, { "path": "research/community-reconciliation92-audit/MANIFEST.json", - "usage": "input", + "usage": "provenance", "git_blob": "2a2e93685173d5f13cbb5abe740f5d90352e0228", "sha256": "5f501f3c118131e7d069f30ad77186eb2ad6961f9680a0ef105f4514ed41808a" }, { "path": "research/partial-swap-digest/baseline.py", - "usage": "input", + "usage": "provenance", "git_blob": "a2f0190704db83bd8ef48e46e723c49b925804fe", "sha256": "81e9af92cdf38243a540cdcff2062778e449467848d444da37a9553c12ca4c34" }, { "path": "research/r420-two-sided-basis/SOURCES.json", - "usage": "input", + "usage": "provenance", "git_blob": "5d718e11e62f4bcadecf1e02d6b61f87dbe190b0", "sha256": "d9810b0d139c5a1211fd2c1f0d142187cc1fca30026e1e7bc4f9ecfacf1596d1" }, { "path": "research/skip-clones/SOURCE.json", - "usage": "input", + "usage": "provenance", "git_blob": "8d1bb3b9c8189e35e5d8bfdfa632d7473e8be0d5", "sha256": "0b68e63e35a97ce6b0cdb6e291b88ebaa8f2dd4afb70b2498f10ee89428258dc" }, { "path": "research/split-skip/SOURCE.json", - "usage": "input", + "usage": "provenance", "git_blob": "2ab610b6ea2edd2865fda793ef2168b0c76afb4f", "sha256": "7c2b4646a3ecfef6f881da5c43e4bd0fa9a4d1b00548b8ab458d897e16735134" }, { "path": "scripts/historical-ci-inputs/Makefile", - "usage": "input", + "usage": "provenance", "git_blob": "aff68409021c9d401a6f8013b9dfd7dbcc30f2a8", "sha256": "ea8830dd79da493e2d75baf753d733ff7efbcf2b4794afe41fae0ac8f3055646" }, { "path": "scripts/historical-ci-inputs/ledger-batch932-run_isolated_tests.py", - "usage": "input", + "usage": "provenance", "git_blob": "65db599ab0b1dea0312c4ca048e0bd0f44c3736f", "sha256": "96ea543e6c707424afe247e77bd86c82152f90fc76a0773c4232145da5cdf8d1" }, { "path": "scripts/historical-ci-inputs/ledger-batch932-test_isolated_test_runner.py", - "usage": "input", + "usage": "provenance", "git_blob": "34820a8f24678f918f4d0e7a35380d8013fc3495", "sha256": "628391b6abfbc8674ceec1751867a4392f2cc0b5b66886243e139af86cf355ac" }, { "path": "scripts/historical-ci-inputs/ledger-batch970-verify_selected_result.py", - "usage": "input", + "usage": "provenance", "git_blob": "c755b76e0d44ba4917aa94440ebe54daefce5b2a", "sha256": "d7fd929726b326aeeaf0a3996475adec88eee9aac09ae0bebeeaa0bc1fc8f199" }, { "path": "scripts/historical-ci-inputs/ledger-frontier741-ci-verification.md", - "usage": "input", + "usage": "provenance", "git_blob": "7f3c012504187917a728b9fe87043f0fc8cd006a", "sha256": "a854022e0e1d5d4db4d60e586be3ea56005013ef14a1fc06d02bc06e8529c4b0" }, { "path": "scripts/historical-ci-inputs/partial-swap-context.json", - "usage": "input", + "usage": "provenance", "git_blob": "ad65114886bf34a4fd27e79f3be502389e689faa", "sha256": "833a9642f33aeab2ffea17ec9c6b82e0a953f90192b2c82e10bef21538dccba9" }, { "path": "scripts/historical-ci-inputs/partial-swap-network.json", - "usage": "input", + "usage": "provenance", "git_blob": "52075f2463f60af5e16571347f24274fce73a1ea", "sha256": "f3c4be597b2f2136da4ae2cc80c7454f63c90aa01f84e5b8131cee4dd55de815" }, { "path": "scripts/partial_swap/shared.py", - "usage": "input", + "usage": "provenance", "git_blob": "44a0e454c70f9c4b98e258b8443612e6a119904b", "sha256": "5a0646a50b9f3e8ea55168620a78e8853b0ab810517cefc8cfb8696aedee278a" }, { "path": "scripts/replay_historical_check.py", - "usage": "input", + "usage": "provenance", "git_blob": "1e92fff2782970ef71378f594f2350d245a4db26", "sha256": "5467619c78183d3adc82b0cb55af28e5c1a01fca2b0588677816244b53e2bafd" }, { "path": "scripts/research_package.py", - "usage": "input", + "usage": "provenance", "git_blob": "091b4c8f58bac9a9580d76025b887dc5c873d05f", "sha256": "e1256016e7f51827d04fa2179255989f639ae1d97afaa9c16265f85a0c6abd70" }, { "path": "scripts/run_isolated_tests.py", - "usage": "input", + "usage": "provenance", "git_blob": "a96ab35b315ce492e7fbbfd6c5ae211aa066b541", "sha256": "49eb56dd0fc0d8d8ffdb209970a7adf2176223580646f575d5c22e59543b381c" }, { "path": "scripts/verify_selected_result.py", - "usage": "input", + "usage": "provenance", "git_blob": "6882a4700e410dec569b51ae2eaf1a19cc019195", "sha256": "d6b305eac5b9bdb8172c469ad30a1655a60fa0aceac8b1bf610e1b73f51babd8" }, { "path": "tests/test_isolated_test_runner.py", - "usage": "input", + "usage": "provenance", "git_blob": "343b24abf6719b81805eba5a84c74e57634c8288", "sha256": "3a5470d0b139828b90e19bf9583ddeafcd69f8e34f2824664eb3a2958a52e34d" } diff --git a/research/historical-selected-replay-gap/VERIFY.json b/research/historical-selected-replay-gap/VERIFY.json index 98553e72ed..ab7efa3471 100644 --- a/research/historical-selected-replay-gap/VERIFY.json +++ b/research/historical-selected-replay-gap/VERIFY.json @@ -4,36 +4,7 @@ "python": "3.12", "requirements": [], "inputs": [ - "Makefile", - "certificates/partial-swap-network.json", - "docs/ci-verification.md", - "research/clifford-state-performance/SOURCE.json", - "research/community-batch1047-audit/CONTENT-COVERAGE.json", - "research/community-batch1099-audit/CONTENT-COVERAGE.json", - "research/community-batch932-audit/CONTENT-COVERAGE.json", - "research/community-batch970-audit/CONTENT-COVERAGE.json", - "research/community-frontier741-audit/CONTENT-COVERAGE.json", - "research/community-frontier890-audit/CONTENT-COVERAGE.json", - "research/community-hyperplane599-audit/SOURCE.json", - "research/community-k492-audit/SOURCE.json", - "research/community-reconciliation92-audit/MANIFEST.json", - "research/partial-swap-digest/baseline.py", - "research/r420-two-sided-basis/SOURCES.json", - "research/skip-clones/SOURCE.json", - "research/split-skip/SOURCE.json", - "scripts/historical-ci-inputs/Makefile", - "scripts/historical-ci-inputs/ledger-batch932-run_isolated_tests.py", - "scripts/historical-ci-inputs/ledger-batch932-test_isolated_test_runner.py", - "scripts/historical-ci-inputs/ledger-batch970-verify_selected_result.py", - "scripts/historical-ci-inputs/ledger-frontier741-ci-verification.md", - "scripts/historical-ci-inputs/partial-swap-context.json", - "scripts/historical-ci-inputs/partial-swap-network.json", - "scripts/partial_swap/shared.py", - "scripts/replay_historical_check.py", - "scripts/research_package.py", - "scripts/run_isolated_tests.py", - "scripts/verify_selected_result.py", - "tests/test_isolated_test_runner.py" + "scripts/research_package.py" ], "commands": [ { diff --git a/research/historical-selected-replay-gap/verify.py b/research/historical-selected-replay-gap/verify.py index 83b995941a..9d266c5a4e 100644 --- a/research/historical-selected-replay-gap/verify.py +++ b/research/historical-selected-replay-gap/verify.py @@ -6,8 +6,10 @@ """ import hashlib import importlib.util +import json import subprocess import sys +import tempfile from pathlib import Path ROOT = Path(__file__).resolve().parents[2] @@ -61,31 +63,47 @@ def require(ok, message): raise SystemExit(message) -def load_checker(): - path = ROOT / "scripts/replay_historical_check.py" - spec = importlib.util.spec_from_file_location("historical_selected_replay_gap_checker", path) +def load_module(path): + spec = importlib.util.spec_from_file_location(path.stem, path) module = importlib.util.module_from_spec(spec) spec.loader.exec_module(module) return module +def checkout_snapshot(snapshot, sources, runner, env): + paths = [runner.canonical_relative_path(row["path"]) for row in sources["files"]] + git = ["git", "-c", "maintenance.auto=false", "-c", "gc.auto=0", + "-c", "core.autocrlf=false"] + subprocess.run([*git, "clone", "--quiet", "--shared", "--no-tags", "--no-checkout", + "--", str(ROOT), str(snapshot)], cwd=ROOT, env=env, check=True) + subprocess.run([*git, "update-ref", "--no-deref", "HEAD", INSPECTED], + cwd=snapshot, env=env, check=True) + # The pinned planner reads omitted manifests from the sparse HEAD/index. + patterns = "".join(f"/{path.as_posix()}\n" for path in paths) + subprocess.run([*git, "sparse-checkout", "set", "--no-cone", "--stdin"], + cwd=snapshot, env=env, input=patterns.encode("utf-8"), check=True) + subprocess.run([*git, "read-tree", "-mu", "HEAD"], cwd=snapshot, env=env, check=True) + for path, row in zip(paths, sources["files"], strict=True): + require(hashlib.sha256((snapshot / path).read_bytes()).hexdigest() == row["sha256"], + "historical checkout source digest changed: " + path.as_posix()) + + def entries(checker): for name, config in checker.CONFIG.items(): for entry in [config, *config.get("additional_inputs", [])]: yield name, entry -def reject(checker, entry): +def reject(root, checker, entry): try: - checker.authenticated_input(ROOT, entry) + checker.authenticated_input(root, entry) except ValueError as exc: return str(exc) raise SystemExit("historical input was admitted: " + entry["path"]) -def main(): - require(not sys.flags.optimize, "assertions must stay enabled") - checker = load_checker() +def check_snapshot(root, env): + checker = load_module(root / "scripts/replay_historical_check.py") selected = [entry for name, entry in entries(checker) if name == "tooling-ledger" and entry["path"] == SELECTED_PATH] require(len(selected) == 1, "selected-result checker overlay is not unique") @@ -94,7 +112,7 @@ def main(): require(entry["accepted_live_sha256"] == [SELECTED_ACCEPTED], "accepted selected-checker successors changed") frozen = (checker.INPUTS / entry["input"]).read_bytes() - live = (ROOT / SELECTED_PATH).read_bytes() + live = (root / SELECTED_PATH).read_bytes() require(hashlib.sha256(frozen).hexdigest() == SELECTED_PIN, "frozen selected checker bytes changed") require(hashlib.sha256(live).hexdigest() == SELECTED_LIVE, "live selected checker digest changed") require(SELECTED_LIVE not in (SELECTED_PIN, SELECTED_ACCEPTED), "live checker was already admitted") @@ -102,7 +120,7 @@ def main(): # live successor, not a broken comparison. require(SELECTED_PIN in (SELECTED_PIN, *entry["accepted_live_sha256"]), "pin membership control failed") - require(reject(checker, entry) == REJECTIONS[SELECTED_PATH][1], + require(reject(root, checker, entry) == REJECTIONS[SELECTED_PATH][1], "selected checker rejection text changed") counts = {path: 0 for path in REJECTIONS} @@ -110,7 +128,7 @@ def main(): for _name, item in entries(checker): if item["path"] not in REJECTIONS: continue - message = reject(checker, item) + message = reject(root, checker, item) counts[item["path"]] += 1 messages.setdefault(item["path"], message) for path, (count, message) in REJECTIONS.items(): @@ -118,20 +136,31 @@ def main(): require(messages[path] == message, "rejection text changed for " + path) require(sum(counts.values()) == 19, "rejection total changed") ci = [item for _name, item in entries(checker) if item["path"] == CI_PATH] - require(len(ci) == 1 and hashlib.sha256((ROOT / CI_PATH).read_bytes()).hexdigest() == CI_LIVE, + require(len(ci) == 1 and hashlib.sha256((root / CI_PATH).read_bytes()).hexdigest() == CI_LIVE, "selected CI note digest changed") diff = subprocess.check_output( - ["git", "diff", "--name-only", PARENT, INSPECTED], cwd=ROOT, text=True) + ["git", "diff", "--name-only", PARENT, INSPECTED], cwd=root, env=env, text=True) changed = sorted(name for name in diff.splitlines() if name) require(changed == CHANGED, "inspected commit diff changed") - sys.path.insert(0, str(ROOT / "scripts")) - from research_package import plan_details - details = plan_details(ROOT, set(changed)) + planner = load_module(root / "scripts/research_package.py") + details = planner.plan_details(root, set(changed)) require([row["package"] for row in details] == PLAN_PACKAGES, "helper plan selection changed") matched = {name for row in details for names in row["causes"].values() for name in names} require(sorted(set(changed) - matched) == UNMATCHED, "unmatched plan paths changed") - require(plan_details(ROOT, set()) == [], "empty change set selected a package") + require(planner.plan_details(root, set()) == [], "empty change set selected a package") + + +def main(): + require(not sys.flags.optimize, "assertions must stay enabled") + sources = json.loads(Path(__file__).with_name("SOURCES.json").read_bytes()) + require(sources["base_commit"] == INSPECTED, "historical checkout base changed") + runner = load_module(ROOT / "scripts/research_package.py") + env = runner.git_source_env() + with tempfile.TemporaryDirectory(prefix="historical-selected-replay-") as temporary: + snapshot = Path(temporary) / "snapshot" + checkout_snapshot(snapshot, sources, runner, env) + check_snapshot(snapshot, env) print("PASS_HISTORICAL_SELECTED_REPLAY_GAP") print("selected_checker_live=" + SELECTED_LIVE) print("rejections=19 distinct_paths=7 plan_packages=9")