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") diff --git a/research/p104-type-a-rank17-prefix-bound/LOCAL-PINS.json b/research/p104-type-a-rank17-prefix-bound/LOCAL-PINS.json new file mode 100644 index 0000000000..6d7f416a01 --- /dev/null +++ b/research/p104-type-a-rank17-prefix-bound/LOCAL-PINS.json @@ -0,0 +1,15 @@ +{ + "PROVENANCE.json": "46a6c1bcf007f8534e5d2756aa5160a24ae32684377bffafce2ecdf53355c07d", + "engines/forward.py": "1043c6cb86af5c3fe348e62e5e7f89c2148e1273f1456382907a1a77a739b0df", + "engines/quote.py": "33b3c71e0aa46d6bd7b552e6e963b80b8b4ee7b5d8d45b7fea2a01492181affe", + "engines/role10_reverse.py": "868c78fb6fb9602bb8cda0d2ec4176ce0b3aaccbc9f82fce19427bf8a2c7a6d0", + "engines/role7_forward.py": "8a95f19e21de49774b87ccb25056b3fc28804941d692b4473a4b77454d9f98f8", + "engines/role7_reverse.py": "4062476fac8e8f334cc21ca30c90d6c82aed88c31a15212ee1ff301705d378d5", + "inputs/ADMITTED.json": "c95300e9bca27e44a25c82d794f88cbf70757c142806b0e4c590ea29feb81a13", + "inputs/CALLER.json.gz": "97ac968988664cf85e1e5acbaafdea5e54be15c8a09be1207fa93be33fe99896", + "inputs/PR7362-SHA256.json": "2c90ca39b0f075cc4b3ec9e90c66fde473465e7bb50cf1db9a820d3a29556c0b", + "inputs/R92-PRICE.json.gz": "2274f514fb12f9ced0c24abe0c02a76c16cfee4c61f909e37a5ad89b07852371", + "inputs/pricing.py": "f4d0b6c9314b838d882d6d06020f24881c19a3fda97a7c00df87b1e920785182", + "inputs/reverse.py": "d763b974585a439472bcaacf0913fc5c8469ea24212545287a3a359526ff51cd", + "receipts/SHA256.json": "1695edf853053a1bbbd86be23a48f8353a98bdcf6f730a0320f8ac5c0d845081" +} diff --git a/research/p104-type-a-rank17-prefix-bound/NOTICE b/research/p104-type-a-rank17-prefix-bound/NOTICE new file mode 100644 index 0000000000..3b0201d537 --- /dev/null +++ b/research/p104-type-a-rank17-prefix-bound/NOTICE @@ -0,0 +1,3 @@ +Apache-2.0. + +Exact source and contributor attribution appear in README.md and PROVENANCE.json. OpenAI Codex and subagents materially assisted. diff --git a/research/p104-type-a-rank17-prefix-bound/PROOF.md b/research/p104-type-a-rank17-prefix-bound/PROOF.md new file mode 100644 index 0000000000..1a7f0dd2ae --- /dev/null +++ b/research/p104-type-a-rank17-prefix-bound/PROOF.md @@ -0,0 +1,30 @@ +# Prefix necessity and exact price + +Let Bⱼ denote the independent body at stage j. Take Laurent polynomials over Q(i) in the body variables, with q⁴ = 1 and with body inverses allowed for original reverse replay. The monomials with each fixed body exponent vector and q exponent in {0,1,2,3} have unique coefficients. An ordinary basis change and its inverse have coefficients in the body-independent even subring generated by q² over Q(i). Give them arbitrary invertible matrices over that subring. This relaxation includes the scoped ordinary signed basis changes. + +Write F for the original prefix before the proposed cut and S for the invertible retained suffix. For root r, the scoped split consumes the original independent dirty input xᵣ into the first output and substitutes a fresh independent dirty input into the continuing field for the second output. A legal ordinary basis M puts the continuing prefix into its cut coordinates. When the old input xᵣ varies, the first new output changes by qᵖBⱼxᵣ and every continuing coordinate must have zero xᵣ coefficient. This follows from invertibility of the retained suffix and independence of all dirty inputs. Thus for one distinguished cut coordinate t, + +```text +M F e_r = q^p B_j e_t +F e_r = q^p B_j M^(-1) e_t. +``` + +Every nonzero term of the full original column must have body exactly Bⱼ and phase parity p mod 2. Foreign bodies or both phase parities violate this identity even with arbitrary invertible ordinary mixing. The total odd phase allows either uniform parity p for the first output. The second receives the complementary phase. This tests a necessary condition for one independently exposed productive field at the fixed cut. + +The literal full diagonal is q⁻¹B₉B₁₀ on role 10 and q⁻¹B₇B₈ on role 7. The reverse engine seeds the corresponding endpoint monomial, walks all 4,783 literal events backwards, and recovers the original unit input column. The separate forward engine starts at the unit input, uses exact rational Gaussian coefficients and stage multisets, and recovers the same final diagonal. It tests each cut directly. A pre-event cut k includes exactly events 0 through k−1. + +On role 10, the row-0 q⁰ coefficient of body exponent zero is −1 at both tested cuts. On role 7, cut 1139 already has even coefficient (−1−i)/2 on q⁰B₇ at row 7 and odd coefficient (−1+i)/2 on q¹B₇ at row 0. Both phases persist through cut 1423 with body B₇. All 43 cuts from 1424 through 1466 have nonzero B₇B₈ or another foreign body. The per-cut replay gives exact first witnesses and preserves the full normalized column digests. There are no interval assumptions in either replay. + +## Complete directed quote + +Let hᵣ(κ) be the retained raw rank-r recurrence tariff and C(κ) = Σᵣ(Tᵣ−Pᵣ)hᵣ(κ) the complex margin. The replacement gives + +```text +ΔP = 0 +ΔT = {8: +96, 9: +96, 17: −96} +ΔC(κ) = 96 (h8(κ) + h9(κ) − h17(κ)). +``` + +The predecessor has 110,519 paid jobs and 22,461 productive targets. One relaxed split yields 22,557 productive targets, 110,519 paid jobs and rank surplus 1,424. The exact rational replay uses the full directed histogram from the public predecessor and checks the one-edit margin, relaxed whole stock and paid-child ceiling. At the fixed κ = 0.0040075385047236 target, even the relaxed four-root complete margin is below −121.8578808554613 raw units. + +The price reserves 1,248,768 ordinary source units for one edit, including at most 32 scalar macros, two grid conversions and two ordinary maps per port. The incumbent ordinary bill is 782,715,464 against the existing one-billion ceiling. This is a favorable quote pending actual ordinary coefficients, fresh dirty ownership, compiler, precision, tape and recovery checks. Every tested cut fails before those costs or obligations could be realized. The existing native-all-columns, owned erasure, compiler, precision/tape and analytic recovery premises continue to govern the comparison. The local prefix result leaves the retained BIT supplier in place. diff --git a/research/p104-type-a-rank17-prefix-bound/PROVENANCE.json b/research/p104-type-a-rank17-prefix-bound/PROVENANCE.json new file mode 100644 index 0000000000..0013db257d --- /dev/null +++ b/research/p104-type-a-rank17-prefix-bound/PROVENANCE.json @@ -0,0 +1,50 @@ +{ + "derived_inputs": { + "inputs/R92-PRICE.json.gz": { + "compression": "gzip", + "key": "R92-PRICE.json", + "receipt": "inputs/PR7362-SHA256.json" + } + }, + "files": { + "inputs/ADMITTED.json": { + "commit": "349996445176e934ffb3c76813adcd230ca8f783", + "git_blob": "464c89e45c4eca230c099e8bac784a90200a5069", + "path": "research/p104-compensated-fusion-readout-bound/inputs/ADMITTED.json", + "sha256": "c95300e9bca27e44a25c82d794f88cbf70757c142806b0e4c590ea29feb81a13", + "source": "https://github.com/CrocSwap/integer-mult-bounds/blob/349996445176e934ffb3c76813adcd230ca8f783/research/p104-compensated-fusion-readout-bound/inputs/ADMITTED.json", + "uncompress": false + }, + "inputs/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/PR7362-SHA256.json": { + "commit": "5eec7ed633dcf9b9bbc95552aa653da296f863fb", + "git_blob": "b1486e0b5cfe4535f381ed26f7bce4aee21d8a43", + "path": "research/p104-rank-two-virtual-cut-bound/receipts/SHA256.json", + "sha256": "2c90ca39b0f075cc4b3ec9e90c66fde473465e7bb50cf1db9a820d3a29556c0b", + "source": "https://github.com/CrocSwap/integer-mult-bounds/blob/5eec7ed633dcf9b9bbc95552aa653da296f863fb/research/p104-rank-two-virtual-cut-bound/receipts/SHA256.json" + }, + "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 + }, + "inputs/reverse.py": { + "commit": "ceb27ae824a8e7913d1d17a6430c1569704c1e15", + "git_blob": "10da94b40d14863c22eea75e6d1d9d0db50125be", + "path": "research/p104-rank137-productive-root-bound/engines/reverse.py", + "sha256": "d763b974585a439472bcaacf0913fc5c8469ea24212545287a3a359526ff51cd", + "source": "https://github.com/CrocSwap/integer-mult-bounds/blob/ceb27ae824a8e7913d1d17a6430c1569704c1e15/research/p104-rank137-productive-root-bound/engines/reverse.py" + } + }, + "schema_version": 1 +} diff --git a/research/p104-type-a-rank17-prefix-bound/README.md b/research/p104-type-a-rank17-prefix-bound/README.md new file mode 100644 index 0000000000..8e71dc6945 --- /dev/null +++ b/research/p104-type-a-rank17-prefix-bound/README.md @@ -0,0 +1,28 @@ +# Fixed-paid Type A rank-17 split prefix bound + +Two exact Gaussian Laurent replays exclude all 330 tested splits of the signed Type A caller. The conditional exponent saving is unchanged. The comparison uses the independently reproduced conditional κ = 0.00364665195644 at exact [#7334](https://github.com/CrocSwap/integer-mult-bounds/pull/7334) `aaeec8c0acf01e99a5f331ef363a698d9c084ace` and its [#7113 caller](https://github.com/CrocSwap/integer-mult-bounds/pull/7113) `07a76c5e2738882c0cb322278e56f6cae3c9885d`. The maintainer-selected record at canonical main `e54523517d0f03e58352e647c403a5af3e525a57` records κ = 0.00363005817. + +| Role and tested pre-event cuts | Required first body | Exact result | +| --- | --- | --- | +| 10, cuts 1743 and 1744, IDLE stage 9 before J stage 10 | B₉ | Both columns have body-independent terms | +| 7, all 328 cuts 1139–1466, J stage 7 before IDLE stage 8 | B₇ | 285 columns have the required body and both central parities. The other 43 contain a foreign body. | + +Each cut must have a prefix divisible by its required body with a residual of one central parity. An odd prefix places the sign on the rank-nine first output. An even prefix puts the sign on the rank-nine second output. The exact forward and reverse implementations agree on the full column at both role-10 cuts and on all 328 role-7 column digests, counts and body and phase witnesses. No case in this scope remained unresolved. The suffix and physical build gates require a prefix survivor. + +One hypothetical split across the 96 Type A ports replaces 96 productive rank-17 targets with 96 each of ranks eight and nine. The paid histogram is fixed. The directed one-split gross allowance is below 4.077730393712098 raw units at the upper end of the old crossing, and the complete directed margin at the pinned strictly higher probe exceeds 4.077343926692402 before unbuilt ancillary costs. Four distinct roots have a relaxed gross upper below 16.310921574848387 raw units, and one extra paid rank-one child on each of the 96 ports defeats even that relaxed stock. The four-root price grants compatibility and has no implication for support outside the tested cuts. See [proof and price](PROOF.md) and [exact source identities](PROVENANCE.json). + +## Reproduce + +From the package directory with CPython 3.12 and assertions enabled, run + +```sh +python3.12 -I -B replay.py +``` + +The command uses the standard library and package-relative inputs. It authenticates the caller and inherited price, replays both directions, compares all exact witnesses, checks the original endpoints and synthetic controls, and rejects a changed caller and a changed price. Add `--out receipts-replayed` to save the five regenerated receipts. Their expected SHA-256 digests are in [receipts/SHA256.json](receipts/SHA256.json). + +## Open next questions + +A genuinely different, fully priced caller factorization could change the prefix column. Freeze one such paid and ordinary bill, then compute its exact endpoint and first-body column before attempting a supplier. Other roots, other role-10 cuts and bases that need paid phase/body access fall outside the tested scope. A surviving prefix would still require a paired cut dual, a restored suffix and a fresh independent dirty field with the retained all-width ownership, tape, precision, compiler and recovery contract. + +[#7334](https://github.com/CrocSwap/integer-mult-bounds/pull/7334) supplies the complete comparable baseline. [#7113](https://github.com/CrocSwap/integer-mult-bounds/pull/7113) supplies the literal signed caller. [#7316](https://github.com/CrocSwap/integer-mult-bounds/pull/7316) supplies the reverse Laurent method and the distinct rank-137 root split criterion. [#7362](https://github.com/CrocSwap/integer-mult-bounds/pull/7362) supplies the pinned complete comparator price, and [#7298](https://github.com/CrocSwap/integer-mult-bounds/pull/7298) supplies directed tariff arithmetic. [#7175](https://github.com/CrocSwap/integer-mult-bounds/pull/7175) supplies abstract fixed-profile comparison context. OpenAI Codex and subagents materially assisted proof development, implementation, independent verification and packaging. diff --git a/research/p104-type-a-rank17-prefix-bound/SOURCES.json b/research/p104-type-a-rank17-prefix-bound/SOURCES.json new file mode 100644 index 0000000000..e8c2f265cd --- /dev/null +++ b/research/p104-type-a-rank17-prefix-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-rank17-prefix-bound/TASK.json b/research/p104-type-a-rank17-prefix-bound/TASK.json new file mode 100644 index 0000000000..3e5d369619 --- /dev/null +++ b/research/p104-type-a-rank17-prefix-bound/TASK.json @@ -0,0 +1,117 @@ +{ + "actual_scope": "The exact signed Type A role 10 at two idle-first cuts and role 7 at all 328 J-first cuts. Test both allocations of the odd central phase at unchanged paid ranks.", + "ai_assistance": "OpenAI Codex and subagents materially assisted proof, implementation, independent verification and packaging.", + "author": "P104 Type A caller split research", + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "bottleneck_link": "A fixed-paid split must isolate the first body-only product under a legal ordinary basis before the second body is applied.", + "budget_minutes": 12, + "evidence": "Independent exact forward and reverse Gaussian Laurent operators agree on both role-10 columns and all 328 role-7 columns. Every tested cut has foreign body support or mixed central parity.", + "open_questions": [ + { + "blocked_by": "Both fixed-clock cuts for role 10 and the whole role-7 J-to-idle window fail the necessary prefix condition.", + "first_step": "Name the changed caller factor and freeze its complete paid and ordinary cost before testing one exact endpoint column.", + "question": "Can a different charged caller factorization isolate a fresh productive field while retaining the endpoint?", + "why_it_matters": "A changed caller changes the prefix obstruction and must remain competitive under the same all-width contract." + } + ], + "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": "Applies the fixed-paid productive split card to distinct signed Type A caller roots at rank 17, with both phase allocations priced together.", + "scope_status": "changed", + "stop_rule": "Test two frozen role-10 cuts and all 328 role-7 cuts, each pass capped at 25 runner seconds. Proceed to paired suffix and physical checks only if a pure, uniform-phase prefix survives.", + "task_id": "p104-side-correction" +} diff --git a/research/p104-type-a-rank17-prefix-bound/VERIFICATION.md b/research/p104-type-a-rank17-prefix-bound/VERIFICATION.md new file mode 100644 index 0000000000..e26c56aaaf --- /dev/null +++ b/research/p104-type-a-rank17-prefix-bound/VERIFICATION.md @@ -0,0 +1,9 @@ +# Verification receipt + +CPython 3.12 with standard-library dependencies and assertions. The package-relative replay on 2026-11-12 UTC exited 0 and regenerated all five pinned receipts. A relocated copy ran with an empty environment in 0.72 seconds and produced byte-identical receipts. The official registered package wrapper also exited 0 in 1.23 seconds, with `PASS_REGISTERED_RESEARCH_PACKAGE` for this package. + +The exact forward and reverse replays check the original caller endpoint and planted valid prefixes. The rank-17 gate accepts pure even and pure odd one-body prefixes, rejects a mixed-parity prefix and a foreign body, and checks an exact reverse negative QUERY direction. The package driver rejects altered caller bytes and altered price bytes before mathematical output, each with exit 1. A duplicate path key in the dependency manifest also exits 1 before replay. The five output hashes are in [receipts/SHA256.json](receipts/SHA256.json). + +The initial even-prefix-only role-7 check and the later both-allocation check produced identical normalized column hashes at every cut. The package replays the stronger both-allocation check. At no cut was a paired suffix or physical construction needed. This local result does not replay the native supplier or promote the selected record. The exact earlier comparable replay and its assumptions are pinned in [inputs/ADMITTED.json](inputs/ADMITTED.json). + +Hosted status for this contribution is pending publication. The registered source-history and proposed-file mode checks are applicable once the contribution is committed. diff --git a/research/p104-type-a-rank17-prefix-bound/VERIFY.json b/research/p104-type-a-rank17-prefix-bound/VERIFY.json new file mode 100644 index 0000000000..b727a461ef --- /dev/null +++ b/research/p104-type-a-rank17-prefix-bound/VERIFY.json @@ -0,0 +1,19 @@ +{ + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/replay.py" + ], + "checks": "Regenerate the directed whole-invoice price and both independent signed Laurent columns on each of the 330 cuts. Verify exact agreement and corruption controls.", + "timeout_seconds": 95 + } + ], + "inputs": [], + "python": "3.12", + "requirements": [], + "schema_version": 1, + "status": "ready" +} diff --git a/research/p104-type-a-rank17-prefix-bound/engines/forward.py b/research/p104-type-a-rank17-prefix-bound/engines/forward.py new file mode 100644 index 0000000000..35805f33ac --- /dev/null +++ b/research/p104-type-a-rank17-prefix-bound/engines/forward.py @@ -0,0 +1,119 @@ +"""Independent forward Gaussian-Laurent column for the two frozen cuts.""" +from fractions import Fraction as Q +from hashlib import sha256 +from json import dumps, loads +from pathlib import Path +from signal import SIGALRM, alarm, signal + +ROOT = Path(__file__).resolve().parent +PINS = { + "inputs/CALLER.json": "255d89f38cd45e38e5770f559bc43dc217e989032359768cdc7e8cdfd64b47bc", + "inputs/PRICE.json": "e076ac34017cc3c86c185a3f5982857dd70325012e196a2dcdd8d2d85a3957dc", +} +CUTS = (1743, 1744) +ROLE = 10 +ONE = (Q(1), Q(0)) + + +def verify(path): + raw = (ROOT / path).read_bytes() + if sha256(raw).hexdigest() != PINS[path]: + raise ValueError(f"changed dependency {path}") + return loads(raw) + + +def add_scaled(dest, src, a, b, exponent=0, factors=()): + for (phase, stages), (x, y) in src.items(): + key = ((phase + exponent) % 4, tuple(sorted(stages + factors))) + u, v = dest.get(key, (0, 0)) + value = (u + a * x - b * y, v + a * y + b * x) + if any(value): + dest[key] = value + else: + dest.pop(key, None) + + +def scaled(src, a=Q(1), b=Q(0), exponent=0, factors=()): + dest = {} + add_scaled(dest, src, a, b, exponent, factors) + return dest + + +def propagate(rows, event, alpha): + if event[0] == "J": + _, stage, (u, v, x, y), _ = event + add_scaled(rows[v], rows[u], Q(1), Q(0), exponent=-1) + add_scaled(rows[x], rows[y], alpha, Q(0), exponent=1) + for role in (u, v, x, y): + rows[role] = scaled(rows[role], factors=(stage,)) + return + if event[0] != "A": + return + _, op, role, *args = event + if op == "ADD": + add_scaled(rows[role], rows[args[0]], Q(args[1]), Q(0)) + elif op == "QUERY": + add_scaled(rows[role], rows[args[0]], Q(1), Q(0), exponent=args[1]) + elif op == "SWAP": + peer, = args + rows[role], rows[peer] = rows[peer], rows[role] + elif op == "SCALE": + rows[role] = scaled(rows[role], a=Q(args[0])) + elif op == "IDLE_ONE": + rows[role] = scaled(rows[role], factors=tuple(args[0])) + else: + assert op == "LAMBDA" and args[0] in (-1, 1) + source = rows[role] + sign = args[0] + rows[role] = scaled(source, Q(1, 2), Q(sign, 2)) + add_scaled(rows[role], source, Q(1, 2), Q(-sign, 2), exponent=2) + + +def classify(rows, cut): + entries = [[i, phase, list(stages), str(a), str(b)] + for i, vector in enumerate(rows) for (phase, stages), (a, b) in sorted(vector.items())] + wrong = [item for item in entries if item[1] % 2 or item[2] != [9]] + assert entries + return dict(cut=cut, entries=entries, bad_terms=wrong, + status="prefix excluded" if wrong else "paired support needed") + + +def stop(*_): + raise TimeoutError("25-second exact cap") + + +def main(): + assert __debug__ + signal(SIGALRM, stop) + alarm(25) + c = verify("inputs/CALLER.json") + price = verify("inputs/PRICE.json") + assert c["stages"] == 17 and len(c["events"]) == 4783 + assert c["events"][1742] == ["A", "IDLE_ONE", ROLE, [9]] + assert c["events"][3377][0:3] == ["J", 10, [10, 0, 18, 28]] + A = c["types"]["A"] + assert A["offset"] == 0 and len(A["ports"]) == 96 + rows = [{} for _ in range(A["roles"])] + rows[ROLE] = {(0, ()): ONE} + alpha = Q(A["alpha2"]) + checks = [] + for clock, event in enumerate(c["events"], 1): + propagate(rows, event, alpha) + if clock in CUTS: + checks.append(classify(rows, clock)) + assert rows[ROLE] == {(3, (9, 10)): ONE} + assert all(not vector for r, vector in enumerate(rows) if r != ROLE) + bad = [{(1, (9,)): ONE}] + assert classify(bad, 0)["status"] == "prefix excluded" + wrong_stage = [{(2, (10,)): ONE}] + assert classify(wrong_stage, 0)["status"] == "prefix excluded" + good = [{(2, (9,)): ONE}] + assert classify(good, 0)["status"] == "paired support needed" + alarm(0) + print(dumps(dict(pins=PINS, head=price["head"], caller=price["caller"], tested_role=ROLE, + events=len(c["events"]), cuts=checks, controls=["full original column", "wrong phase", + "foreign stage", "valid prefix only"]), sort_keys=True, indent=2)) + + +if __name__ == "__main__": + main() diff --git a/research/p104-type-a-rank17-prefix-bound/engines/quote.py b/research/p104-type-a-rank17-prefix-bound/engines/quote.py new file mode 100644 index 0000000000..45bcb0fb84 --- /dev/null +++ b/research/p104-type-a-rank17-prefix-bound/engines/quote.py @@ -0,0 +1,26 @@ +"""Price one exact Type-A rank-seventeen 8+9 output split.""" +from collections import Counter +from fractions import Fraction as Q +from hashlib import sha256 +from json import dumps,loads +from pathlib import Path +from runpy import run_path +R=Path(__file__).resolve().parent/'inputs' +PINS={'R92-PRICE.json':'05d7a5ebdd2eeedd6c8f534e8e2eeac22484daf9f387f4a6b88cc9eed22a6b8f','pricing.py':'f4d0b6c9314b838d882d6d06020f24881c19a3fda97a7c00df87b1e920785182','CALLER.json':'255d89f38cd45e38e5770f559bc43dc217e989032359768cdc7e8cdfd64b47bc'} +raw={p:(R/p).read_bytes() for p in PINS} +assert all(sha256(v).hexdigest()==PINS[p] for p,v in raw.items()) +b,c=(loads(raw[p]) for p in ('R92-PRICE.json','CALLER.json')) +assert b['head']=='aaeec8c0acf01e99a5f331ef363a698d9c084ace' and b['caller_head']=='07a76c5e2738882c0cb322278e56f6cae3c9885d' +a=c['types']['A'];assert len(a['ports'])==96 and len(c['events'])==4783 +roots=[i for i,x in enumerate(a['diagonal']) if x[:2]==[-1,0] and sum(x[2:])==2] +assert roots==[7,10,25,28] and c['events'][1742]==['A','IDLE_ONE',10,[9]] and c['events'][3377][:3]==['J',10,[10,0,18,28]] +p,t=(Counter({int(k):v for k,v in b[x].items()}) for x in ('old_paid','old_targets')) +s=t.copy();s.subtract(p);d={8:96,9:96,17:-96};cost=run_path(str(R/'pricing.py'))['cost'] +def quote(k): + g=cost(d,k);o=cost(s,k) + return dict(gross=list(map(str,g)),one_complete=list(map(str,(o[0]+g[0],o[1]+g[1]))), + four_compatible_gross_upper=str(4*g[1]),four_complete_upper=str(o[1]+4*g[1]), + four_with_extra_rank1_per_port_upper=str(o[1]+4*g[1]-96)) +print(dumps(dict(head=b['head'],caller=b['caller_head'],pins=PINS,roles=roots,chosen=10,cuts=[1743,1744],paid=110519,productive=22557,rank_surplus=1424, +delta=d,quotes={k:quote(Q(b[k])) for k in ('old_crossing_upper','probe','moonshot')}, +ordinary_reservation={'scalar_macros':32*96+2*96,'ordinary_map_slots':2*96,'source_units':32*96*340+2*96*(1000+64)}),indent=2,sort_keys=True)) diff --git a/research/p104-type-a-rank17-prefix-bound/engines/role10_reverse.py b/research/p104-type-a-rank17-prefix-bound/engines/role10_reverse.py new file mode 100644 index 0000000000..be7b053eb2 --- /dev/null +++ b/research/p104-type-a-rank17-prefix-bound/engines/role10_reverse.py @@ -0,0 +1,149 @@ +"""Exact reverse Gaussian Laurent test of the two paid-fixed rank-17 split cuts.""" +from argparse import ArgumentParser +from collections import Counter +from fractions import Fraction as Q +from hashlib import sha256 +from json import dumps,loads +from pathlib import Path +from runpy import run_path +from signal import SIGALRM,alarm,signal +from time import monotonic + +ROOT=Path(__file__).resolve().parent +PINS={ + 'inputs/CALLER.json':'255d89f38cd45e38e5770f559bc43dc217e989032359768cdc7e8cdfd64b47bc', + 'inputs/PRICE.json':'e076ac34017cc3c86c185a3f5982857dd70325012e196a2dcdd8d2d85a3957dc', + 'inputs/reverse.py':'d763b974585a439472bcaacf0913fc5c8469ea24212545287a3a359526ff51cd', +} +HEAD='aaeec8c0acf01e99a5f331ef363a698d9c084ace' +CALLER='07a76c5e2738882c0cb322278e56f6cae3c9885d' +ROLE,CUTS,EVENTS,SECONDS=10,(1743,1744),4783,25 +ZERO=(0,)*17 +B9=tuple(int(j==9) for j in range(1,18)) +B10=tuple(int(j==10) for j in range(1,18)) +FINAL=tuple(a+b for a,b in zip(B9,B10,strict=True)) + + +def unique(items): + d=dict(items) + if len(d)!=len(items): + raise ValueError('duplicate input key') + return d + + +def checked(root,p): + raw=(root/p).read_bytes() + if sha256(raw).hexdigest()!=PINS[p]: + raise ValueError('changed dependency '+p) + return raw + + +def inputs(root): + raw={p:checked(root,p) for p in PINS} + p,c=(loads(raw['inputs/'+s+'.json'],object_pairs_hook=unique) for s in ('PRICE','CALLER')) + assert p['head']==HEAD and p['caller']==CALLER and p['chosen']==ROLE and p['cuts']==list(CUTS) + assert p['delta']=={'8':96,'9':96,'17':-96} + assert p['paid']==110519 and p['productive']==22557 and p['rank_surplus']==1424 + assert Q(p['quotes']['probe']['one_complete'][0])>0 + assert Q(p['quotes']['old_crossing_upper']['four_with_extra_rank1_per_port_upper'])<0 + a=c['types']['A'] + assert (len(c['events']),c['stages'],a['roles'],len(a['ports']))==(EVENTS,17,36,96) + assert a['diagonal'][ROLE]==[-1,0,*FINAL] + assert c['events'][1741:1744]==[['A','ADD',10,0,'2'],['A','IDLE_ONE',10,[9]],['A','ADD',10,0,'-2']] + assert c['events'][3377][:3]==['J',10,[10,0,18,28]] + return c,run_path(str(root/'inputs/reverse.py')) + + +def terms(rows): + return [[r,q,list(body),str(a),str(b)] for r,row in enumerate(rows) + for (q,body),(a,b) in sorted(row.items())] + + +def classify(rows): + rows=terms(rows) + assert rows + wrong_body=next((t for t in rows if tuple(t[2])!=B9),None) + odd_phase=next((t for t in rows if t[1]%2),None) + return {'status':'foreign body' if wrong_body else 'odd central phase' if odd_phase else 'positive prefix only', + 'term_count':len(rows),'terms':rows,'first_foreign_body':wrong_body,'first_odd_phase':odd_phase} + + +def controls(engine): + base={(0,B9):(Q(1),Q(0))} + even={(2,B9):(Q(0),Q(-1))} + odd={(3,B9):(Q(1),Q(0))} + wrong={(0,B10):(Q(1),Q(0))} + assert classify([base,even])['status']=='positive prefix only' + assert classify([base,odd])['status']=='odd central phase' + assert classify([base,wrong])['status']=='foreign body' + row=[base.copy(),{}] + engine['undo'](row,['A','QUERY',1,0,-1],Q(-1)) + assert row[1]=={(3,B9):(Q(-1),Q(0))} + return [*engine['control'](),'noncoordinate even B9 passes','odd phase mutation rejects', + 'foreign body mutation rejects','negative query direction undo'] + + +def verify(c,engine,deadline,visited): + a=c['types']['A'];events=c['events'] + rows=[{} for _ in range(a['roles'])] + rows[ROLE]={(3,FINAL):(Q(1),Q(0))} + records=[] + for boundary in range(len(events),-1,-1): + visited['first_unvisited_boundary']=boundary + if boundary%128==0 and monotonic()>=deadline: + break + if boundary in CUTS: + records.append(dict(cut=boundary,**classify(rows))) + visited['cuts_evaluated']+=1 + if boundary: + engine['undo'](rows,events[boundary-1],Q(a['alpha2'])) + visited['events_undone']+=1 + complete=visited['events_undone']==EVENTS + if complete: + assert rows[ROLE]=={(0,ZERO):(Q(1),Q(0))} and all(not row for r,row in enumerate(rows) if r!=ROLE) + # A global q phase commutes with every normalized event, so this + # shifted initial root also checks the deliberately wrong endpoint. + wrong=engine['mapped'](rows[ROLE],q=1) + assert wrong=={(1,ZERO):(Q(1),Q(0))} and wrong!=rows[ROLE] + visited['first_unvisited_boundary']=None + return sorted(records,key=lambda r:r['cut']),complete + + +def main(): + assert __debug__ + cli=ArgumentParser(description=__doc__) + cli.add_argument('--root',type=Path,default=ROOT) + cli.add_argument('--controls-only',action='store_true') + args=cli.parse_args() + c,engine=inputs(args.root) + tests=controls(engine) + if args.controls_only: + print(dumps(tests));return + def stop(*_): + raise TimeoutError('hard 25-second prefix cap') + signal(SIGALRM,stop) + alarm(SECONDS) + deadline=monotonic()+SECONDS-1 + progress={'events_undone':0,'cuts_evaluated':0} + rows=[] + complete=False + error=None + try: + rows,complete=verify(c,engine,deadline,progress) + except TimeoutError as e: + error=str(e) + finally: + alarm(0) + result={'head':HEAD,'caller':CALLER,'pins':PINS,'role':ROLE,'cuts':CUTS, + 'caps':{'cases':2,'events':EVENTS,'seconds':SECONDS},'controls':tests,'rows':rows, + 'counts':Counter(r['status'] for r in rows),'endpoint_recovered':complete,'progress':progress, + 'unvisited':sorted(set(CUTS)-{r['cut'] for r in rows}),'timeout':error} + if not complete: + result['unresolved']='full original endpoint replay incomplete' + print(dumps(result,indent=2,sort_keys=True)) + if not complete: + raise SystemExit(2) + + +if __name__=='__main__': + main() diff --git a/research/p104-type-a-rank17-prefix-bound/engines/role7_forward.py b/research/p104-type-a-rank17-prefix-bound/engines/role7_forward.py new file mode 100644 index 0000000000..8b61b79efb --- /dev/null +++ b/research/p104-type-a-rank17-prefix-bound/engines/role7_forward.py @@ -0,0 +1,79 @@ +"""Classify the exact role-7 prefix for both sign allocations.""" +from fractions import Fraction +from hashlib import sha256 +from json import dumps, loads +from pathlib import Path +from runpy import run_path +from signal import SIGALRM, alarm, signal + +ROOT = Path(__file__).resolve().parent +PINS = { + "inputs/CALLER.json": "255d89f38cd45e38e5770f559bc43dc217e989032359768cdc7e8cdfd64b47bc", + "inputs/PRICE.json": "e076ac34017cc3c86c185a3f5982857dd70325012e196a2dcdd8d2d85a3957dc", + "inputs/forward.py": "1043c6cb86af5c3fe348e62e5e7f89c2148e1273f1456382907a1a77a739b0df", +} +ROLE, START, END = 7, 1139, 1466 + + +def checked(path): + raw = (ROOT / path).read_bytes() + if sha256(raw).hexdigest() != PINS[path]: + raise ValueError(f"changed dependency {path}") + return raw + + +def stop(*_): + raise TimeoutError("25-second exact cap") + + +def sample(rows, cut): + cells = [[r, q, [body.count(s) for s in range(1, 18)], str(a), str(b)] + for r, row in enumerate(rows) for (q, body), (a, b) in sorted(row.items())] + cells.sort(key=lambda x: (x[0], x[1], x[2])) + assert cells + factors = [int(s == 7) for s in range(1, 18)] + foreign = next((cell for cell in cells if cell[2] != factors), None) + parity = sorted({cell[1] % 2 for cell in cells}) + digest = sha256((dumps(cells, separators=(",", ":")) + "\n").encode()).hexdigest() + witness = [next(cell for cell in cells if cell[1] % 2 == p) for p in parity] + result = dict(cut=cut, terms=len(cells), sha256=digest, first_foreign_body=foreign, + parity=parity, parity_witnesses=witness) + if foreign is None and len(parity) == 1: + result["surviving_column"] = cells + return result + + +def main(): + assert __debug__ + signal(SIGALRM, stop) + alarm(25) + caller, price = (loads(checked(p)) for p in ("inputs/CALLER.json", "inputs/PRICE.json")) + checked("inputs/forward.py") + alg = run_path(str(ROOT / "inputs/forward.py")) + assert ROLE in price["roles"] and caller["events"][START - 1][:3] == ["J", 7, [7, 0, 18, 25]] + assert caller["events"][END] == ["A", "IDLE_ONE", ROLE, [8]] + assert len(caller["events"]) == 4783 + kind = caller["types"]["A"] + rows = [{} for _ in range(kind["roles"])] + rows[ROLE] = {(0, ()): alg["ONE"]} + alpha = Fraction(kind["alpha2"]) + receipt = [] + for clock, event in enumerate(caller["events"], 1): + alg["propagate"](rows, event, alpha) + if START <= clock <= END: + receipt.append(sample(rows, clock)) + assert len(receipt) == END - START + 1 == 328 + assert rows[ROLE] == {(3, (7, 8)): alg["ONE"]} + assert all(not row for r, row in enumerate(rows) if r != ROLE) + assert "surviving_column" in sample([{(1, (7,)): alg["ONE"]}], 0) + assert "surviving_column" in sample([{(2, (7,)): alg["ONE"]}], 0) + assert "surviving_column" not in sample([{(1, (7,)): alg["ONE"], (2, (7,)): alg["ONE"]}], 0) + alarm(0) + survivors = [row["cut"] for row in receipt if "surviving_column" in row] + print(dumps(dict(head=price["head"], caller=price["caller"], pins=PINS, role=ROLE, + caps=dict(cuts=328, seconds=25), rows=receipt, survivors=survivors), + indent=2, sort_keys=True)) + + +if __name__ == "__main__": + main() diff --git a/research/p104-type-a-rank17-prefix-bound/engines/role7_reverse.py b/research/p104-type-a-rank17-prefix-bound/engines/role7_reverse.py new file mode 100644 index 0000000000..68882046eb --- /dev/null +++ b/research/p104-type-a-rank17-prefix-bound/engines/role7_reverse.py @@ -0,0 +1,167 @@ +"""Exact reverse Gaussian Laurent test over every cut of the role-7 paid-fixed rank-17 split window.""" +from argparse import ArgumentParser +from collections import Counter +from fractions import Fraction as Q +from hashlib import sha256 +from json import dumps,loads +from pathlib import Path +from runpy import run_path +from signal import SIGALRM,alarm,signal +from time import monotonic + +ROOT=Path(__file__).resolve().parent +PINS={ + 'inputs/CALLER.json':'255d89f38cd45e38e5770f559bc43dc217e989032359768cdc7e8cdfd64b47bc', + 'inputs/PRICE.json':'e076ac34017cc3c86c185a3f5982857dd70325012e196a2dcdd8d2d85a3957dc', + 'inputs/reverse.py':'d763b974585a439472bcaacf0913fc5c8469ea24212545287a3a359526ff51cd', +} +HEAD='aaeec8c0acf01e99a5f331ef363a698d9c084ace' +CALLER='07a76c5e2738882c0cb322278e56f6cae3c9885d' +ROLE,CUTS,EVENTS,SECONDS=7,range(1139,1467),4783,25 +ZERO=(0,)*17 +B7=tuple(int(j==7) for j in range(1,18)) +B8=tuple(int(j==8) for j in range(1,18)) +FINAL=tuple(a+b for a,b in zip(B7,B8,strict=True)) + + +def unique(items): + d=dict(items) + if len(d)!=len(items): + raise ValueError('duplicate input key') + return d + + +def checked(root,p): + raw=(root/p).read_bytes() + if sha256(raw).hexdigest()!=PINS[p]: + raise ValueError('changed dependency '+p) + return raw + + +def inputs(root): + raw={p:checked(root,p) for p in PINS} + p,c=(loads(raw['inputs/'+s+'.json'],object_pairs_hook=unique) for s in ('PRICE','CALLER')) + assert p['head']==HEAD and p['caller']==CALLER and p['chosen']==10 and p['cuts']==[1743,1744] and ROLE in p['roles'] + assert p['delta']=={'8':96,'9':96,'17':-96} + assert p['paid']==110519 and p['productive']==22557 and p['rank_surplus']==1424 + assert Q(p['quotes']['probe']['one_complete'][0])>0 + assert Q(p['quotes']['old_crossing_upper']['four_with_extra_rank1_per_port_upper'])<0 + a=c['types']['A'] + assert (len(c['events']),c['stages'],a['roles'],len(a['ports']))==(EVENTS,17,36,96) + assert a['diagonal'][ROLE]==[-1,0,*FINAL] + assert c['events'][1138]==['J',7,[7,0,18,25],[36,37,'-1','1/2']] + assert c['events'][1466]==['A','IDLE_ONE',7,[8]] + return c,run_path(str(root/'inputs/reverse.py')) + + +def terms(rows): + return [[r,q,list(body),str(a),str(b)] for r,row in enumerate(rows) + for (q,body),(a,b) in sorted(row.items())] + + +def classify(rows): + rows=terms(rows) + assert rows + wrong_body=next((t for t in rows if tuple(t[2])!=B7),None) + odd_phase=next((t for t in rows if t[1]%2),None) + even_phase=next((t for t in rows if not t[1]%2),None) + return {'status':'foreign body' if wrong_body else 'mixed central parity' if odd_phase and even_phase else 'positive prefix only', + 'allowed_phase_parities':[] if wrong_body or (odd_phase and even_phase) else [int(bool(odd_phase))], + 'first_even_phase':even_phase, + 'term_count':len(rows),'column_sha256':sha256((dumps(rows,separators=(',',':'))+'\n').encode()).hexdigest(),'first_foreign_body':wrong_body,'first_odd_phase':odd_phase} + + +def controls(engine): + base={(0,B7):(Q(1),Q(0))} + even={(2,B7):(Q(0),Q(-1))} + odd={(3,B7):(Q(1),Q(0))} + wrong={(0,B8):(Q(1),Q(0))} + assert classify([base,even])['status']=='positive prefix only' + assert classify([base,odd])['status']=='mixed central parity' + assert classify([odd])['allowed_phase_parities']==[1] + assert classify([even])['allowed_phase_parities']==[0] + assert classify([base,wrong])['status']=='foreign body' + row=[base.copy(),{}] + engine['undo'](row,['A','QUERY',1,0,-1],Q(-1)) + assert row[1]=={(3,B7):(Q(-1),Q(0))} + return [*engine['control'](),'noncoordinate even B7 passes','mixed parity mutation rejects','pure odd prefix control', + 'foreign body mutation rejects','negative query direction undo'] + + +def groups(records, fields): + grouped=[] + for record in records: + values={key:record[key] for key in fields} + if grouped and grouped[-1]['last']+1==record['cut'] and grouped[-1]['values']==values: + grouped[-1]['last']=record['cut'] + else: + grouped.append({'first':record['cut'],'last':record['cut'],'values':values}) + return grouped + + +def verify(c,engine,deadline,visited,records): + a=c['types']['A'];events=c['events'] + rows=[{} for _ in range(a['roles'])] + rows[ROLE]={(3,FINAL):(Q(1),Q(0))} + for boundary in range(len(events),-1,-1): + visited['first_unvisited_boundary']=boundary + if boundary%128==0 and monotonic()>=deadline: + break + if boundary in CUTS: + records.append(dict(cut=boundary,**classify(rows))) + visited['cuts_evaluated']+=1 + if boundary: + engine['undo'](rows,events[boundary-1],Q(a['alpha2'])) + visited['events_undone']+=1 + complete=visited['events_undone']==EVENTS + if complete: + assert rows[ROLE]=={(0,ZERO):(Q(1),Q(0))} and all(not row for r,row in enumerate(rows) if r!=ROLE) + # A global q phase commutes with every normalized event, so this + # shifted initial root also checks the deliberately wrong endpoint. + wrong=engine['mapped'](rows[ROLE],q=1) + assert wrong=={(1,ZERO):(Q(1),Q(0))} and wrong!=rows[ROLE] + visited['first_unvisited_boundary']=None + return complete + + +def main(): + assert __debug__ + cli=ArgumentParser(description=__doc__) + cli.add_argument('--root',type=Path,default=ROOT) + cli.add_argument('--controls-only',action='store_true') + args=cli.parse_args() + c,engine=inputs(args.root) + tests=controls(engine) + if args.controls_only: + print(dumps(tests));return + def stop(*_): + raise TimeoutError('hard 25-second prefix cap') + signal(SIGALRM,stop) + alarm(SECONDS) + deadline=monotonic()+SECONDS-1 + progress={'events_undone':0,'cuts_evaluated':0} + rows=[] + complete=False + error=None + try: + complete=verify(c,engine,deadline,progress,rows) + except TimeoutError as e: + error=str(e) + finally: + alarm(0) + rows.sort(key=lambda r:r['cut']) + result={'head':HEAD,'caller':CALLER,'pins':PINS,'role':ROLE,'cuts':[CUTS.start,CUTS.stop-1], + 'caps':{'cases':len(CUTS),'events':EVENTS,'seconds':SECONDS},'controls':tests,'rows':rows, + 'counts':Counter(r['status'] for r in rows), + 'equal_column_ranges':groups(rows,('column_sha256',)), + 'equal_obstruction_ranges':groups(rows,('status','first_foreign_body','first_odd_phase','first_even_phase')),'endpoint_recovered':complete,'progress':progress, + 'unvisited':sorted(set(CUTS)-{r['cut'] for r in rows}),'timeout':error} + if not complete or len(rows)!=len(CUTS): + result['unresolved']='full original endpoint replay incomplete' + print(dumps(result,indent=2,sort_keys=True)) + if not complete or len(rows)!=len(CUTS): + raise SystemExit(2) + + +if __name__=='__main__': + main() diff --git a/research/p104-type-a-rank17-prefix-bound/inputs/ADMITTED.json b/research/p104-type-a-rank17-prefix-bound/inputs/ADMITTED.json new file mode 100644 index 0000000000..464c89e45c --- /dev/null +++ b/research/p104-type-a-rank17-prefix-bound/inputs/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-rank17-prefix-bound/inputs/CALLER.json.gz b/research/p104-type-a-rank17-prefix-bound/inputs/CALLER.json.gz new file mode 100644 index 0000000000..576a9580e6 Binary files /dev/null and b/research/p104-type-a-rank17-prefix-bound/inputs/CALLER.json.gz differ diff --git a/research/p104-type-a-rank17-prefix-bound/inputs/PR7362-SHA256.json b/research/p104-type-a-rank17-prefix-bound/inputs/PR7362-SHA256.json new file mode 100644 index 0000000000..b1486e0b5c --- /dev/null +++ b/research/p104-type-a-rank17-prefix-bound/inputs/PR7362-SHA256.json @@ -0,0 +1,11 @@ +{ + "R92-COMPARE.json": "92bd567e3203a2cbc2e0c508bf921966c59ead267c1f373f7534a4a50cb208ac", + "R92-GEOMETRY.json": "e9f93f3271855012b2de705c70f186f78c31a369d28110e92c5f2ffadae209b3", + "R92-GUARDS.json": "c23e9c74b3479e4af6c452eeb73e000878148ec385560a0642433a1c5bac4a07", + "R92-PRICE.json": "05d7a5ebdd2eeedd6c8f534e8e2eeac22484daf9f387f4a6b88cc9eed22a6b8f", + "R92-REVERSE.json": "f8e56b109352e07dfb8203bdbe42a10cb94374246b4cd419421e4f52e2730c4a", + "R93-COMPARE.json": "8a1f52179e5d457aa729714b0b79577894c1e22ab74a8b2f700838f471ffceb1", + "R93-MODULAR.json": "01ad2a656e69699b80b56d63cdf82448e424cd1c6e67636d53c079a6f03f55a5", + "R93-PRICE.json": "c108a061c6c03306a99a6fbafe919208954a7479ae28fb8a8fbf45d9832e6144", + "R93-RATIONAL.json": "2800af56efe23f7420a12f0713a659cd4fa4a3fb7c58449749ef697097ccccbf" +} diff --git a/research/p104-type-a-rank17-prefix-bound/inputs/R92-PRICE.json.gz b/research/p104-type-a-rank17-prefix-bound/inputs/R92-PRICE.json.gz new file mode 100644 index 0000000000..0307eb95e2 Binary files /dev/null and b/research/p104-type-a-rank17-prefix-bound/inputs/R92-PRICE.json.gz differ diff --git a/research/p104-type-a-rank17-prefix-bound/inputs/pricing.py b/research/p104-type-a-rank17-prefix-bound/inputs/pricing.py new file mode 100644 index 0000000000..40ec194017 --- /dev/null +++ b/research/p104-type-a-rank17-prefix-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-rank17-prefix-bound/inputs/reverse.py b/research/p104-type-a-rank17-prefix-bound/inputs/reverse.py new file mode 100644 index 0000000000..10da94b40d --- /dev/null +++ b/research/p104-type-a-rank17-prefix-bound/inputs/reverse.py @@ -0,0 +1,140 @@ +"""Reconstruct selected exact signed prefix columns by inverting the caller.""" +from argparse import ArgumentParser +from collections import Counter +from fractions import Fraction as Q +from hashlib import sha256 +import json +from pathlib import Path +from signal import SIGALRM, alarm, signal + +CALLER_SHA = '255d89f38cd45e38e5770f559bc43dc217e989032359768cdc7e8cdfd64b47bc' +ZERO = (0,)*17 +ONE = (1,)*17 +ROOTS = (0,18) + + +def update(out,source,real=Q(1),imag=Q(0),q=0,stages=ZERO): + for (phase,body),(a,b) in source.items(): + key = (phase+q)%4, tuple(x+y for x,y in zip(body,stages,strict=True)) + c,d = out.get(key,(0,0)) + value = c+real*a-imag*b,d+imag*a+real*b + if any(value): + out[key] = value + else: + out.pop(key,None) + + +def mapped(source,**kw): + out = {} + update(out,source,**kw) + return out + + +def negative_stages(mask): + stages = [0]*17 + for stage in mask: + assert 1 <= stage <= 17 and not stages[stage-1] + stages[stage-1] = -1 + return tuple(stages) + + +def undo(rows,event,alpha): + if event[0]=='J': + _,stage,(u,v,x,y),_ = event + for r in (u,v,x,y): + rows[r] = mapped(rows[r],stages=negative_stages([stage])) + update(rows[v],rows[u],real=Q(-1),q=-1) + update(rows[x],rows[y],real=-alpha,q=1) + return + if event[0]!='A': + return + _,op,r,*args = event + if op=='SWAP': + s = args[0] + rows[r],rows[s] = rows[s],rows[r] + elif op in ('QUERY','ADD'): + update(rows[r],rows[args[0]],real=-Q(args[1]) if op=='ADD' else Q(-1),q=args[1] if op=='QUERY' else 0) + elif op=='SCALE': + rows[r] = mapped(rows[r],real=1/Q(args[0])) + elif op=='LAMBDA': + sign = args[0] + assert sign in (-1,1) + source = rows[r] + rows[r] = mapped(source,real=Q(1,2),imag=Q(-sign,2)) + update(rows[r],source,real=Q(1,2),imag=Q(sign,2),q=2) + else: + assert op=='IDLE_ONE' + rows[r] = mapped(rows[r],stages=negative_stages(args[0])) + + +def case(rows,slot): + if [i for i,v in enumerate(rows) if v] != [slot]: + return {'decision':'multiple_or_different_slot'} + cell = rows[slot] + if len(cell)!=1: + return {'decision':'not_monomial','terms':len(cell)} + (phase,stages),scalar = next(iter(cell.items())) + out = {'phase':phase,'body':list(stages),'coefficient':list(map(str,scalar))} + if any(v not in (0,1) for v in stages): + return dict(out,decision='not_body_partition') + first = 8*sum(stages)+(phase%2) + out['ranks'] = [first,137-first] + return dict(out,decision='positive_column_only' if 0 < first < 137 else 'zero_rank_side') + + +def control(): + v = {(0,ZERO):(Q(1),Q(0))} + before = [v,{}] + rows = [v.copy(),{}] + undo(rows,['A','LAMBDA',0,1],Q(1)) + undo(rows,['A','LAMBDA',0,-1],Q(1)) + assert rows==before + undo(rows,['A','QUERY',1,0,1],Q(1)) + assert case(rows,0)['decision']=='multiple_or_different_slot' + assert case([v],0)['decision']=='zero_rank_side' + monomial = {(3,(1,)*8+(0,)*9):(Q(1),Q(0))} + assert case([monomial],0)['ranks']==[65,72] + assert case([monomial],0)['decision']=='positive_column_only' + return ['lambda_inverse','nonisolated_column','zero_rank_control','positive_65_72_control'] + + +def run(caller,prior,prior_hash): + assert prior['root_cases_visited']==9568 and prior['counts']['interior_support_only']==241 + events=caller['events']; kind=caller['types']['A']; alpha=Q(kind['alpha2']) + cases = [x for x in prior['witnesses'] if not x['endpoint']] + assert len(cases)==241 and {x['root'] for x in cases}==set(ROOTS) + report=[] + for r in ROOTS: + row = kind['diagonal'][r] + assert row[0]==-1 and row[1]==0 and tuple(row[2:])==ONE + rows = [{} for _ in range(kind['roles'])] + rows[r] = {(3,ONE):(Q(1),Q(0))} + boundary = {x['boundary']:x['slot'] for x in cases if x['root']==r} + assert len(boundary)==sum(x['root']==r for x in cases) + for i in reversed(range(len(events))): + if i+1 in boundary: + slot=boundary[i+1] + report.append(dict(root=r,boundary=i+1,slot=slot,**case(rows,slot))) + undo(rows,events[i],alpha) + assert rows[r]=={(0,ZERO):(Q(1),Q(0))} and all(not v for i,v in enumerate(rows) if i!=r) + assert len(report)==241 + return {'caller_sha256':CALLER_SHA,'body_one_sha256':prior_hash,'controls':control(), + 'endpoints_recovered':len(ROOTS),'counts':dict(Counter(row['decision'] for row in report)), + 'positive_column_only':[r for r in report if r['decision']=='positive_column_only'],'records':report} + + +if __name__=='__main__': + assert __debug__ + p=ArgumentParser(description=__doc__) + p.add_argument('caller',type=Path) + p.add_argument('body_one',type=Path) + p.add_argument('--body-one-sha',required=True) + a=p.parse_args() + def limit(*_): + raise TimeoutError('independent reverse runner watchdog') + signal(SIGALRM,limit) + alarm(60) + c,b = a.caller.read_bytes(),a.body_one.read_bytes() + assert sha256(c).hexdigest()==CALLER_SHA and sha256(b).hexdigest()==a.body_one_sha + print(json.dumps(run(json.loads(c),json.loads(b),a.body_one_sha),indent=2,sort_keys=True)) + alarm(0) diff --git a/research/p104-type-a-rank17-prefix-bound/receipts/SHA256.json b/research/p104-type-a-rank17-prefix-bound/receipts/SHA256.json new file mode 100644 index 0000000000..7a944edd0b --- /dev/null +++ b/research/p104-type-a-rank17-prefix-bound/receipts/SHA256.json @@ -0,0 +1,7 @@ +{ + "PRICE.json": "e076ac34017cc3c86c185a3f5982857dd70325012e196a2dcdd8d2d85a3957dc", + "ROLE10-FORWARD.json": "7d50254c3e4f2eefdd4cab1b764e7a30fe2188985ad4d73a07be0ac006a8fb40", + "ROLE10-REVERSE.json": "ceb5c3351f55d7d151f1abcadb3f69447464b840242df9cfd1fa72597f472552", + "ROLE7-FORWARD.json": "61cf4108bb74dc71eb8aab705cc415b78cb439083a11b0f091f54449f8c6e2ff", + "ROLE7-REVERSE.json": "4ac9bcf61743ae744af45ddfae329176ec7d1b1ae61694f8b9a00e5830fd8f41" +} diff --git a/research/p104-type-a-rank17-prefix-bound/replay.py b/research/p104-type-a-rank17-prefix-bound/replay.py new file mode 100644 index 0000000000..c31ed69972 --- /dev/null +++ b/research/p104-type-a-rank17-prefix-bound/replay.py @@ -0,0 +1,175 @@ +"""Replay the directed price and all exact Type A rank-17 prefix tests.""" +from argparse import ArgumentParser +from collections import Counter +from gzip import decompress +from hashlib import sha1, sha256 +from json import dumps, loads +from pathlib import Path +from subprocess import run +import sys +from tempfile import TemporaryDirectory + +ROOT = Path(__file__).resolve().parent + + +def unique(pairs): + result = dict(pairs) + if len(result) != len(pairs): + raise ValueError('duplicate JSON key') + return result + + +def read_json(raw): + return loads(raw, object_pairs_hook=unique) + + +def digest(raw): + return sha256(raw).hexdigest() + + +def source(name): + path = Path(name) + if path.is_absolute() or '..' in path.parts or path.as_posix() != name: + raise ValueError(f'invalid package path {name}') + return (ROOT / path).read_bytes() + + +def verify_inputs(): + pins = read_json(source('LOCAL-PINS.json')) + for name, expected in pins.items(): + if digest(source(name)) != expected: + raise ValueError(f'changed package dependency {name}') + provenance = read_json(source('PROVENANCE.json')) + for name, entry in provenance['files'].items(): + raw = source(name) + if entry.get('uncompress'): + raw = decompress(raw) + assert digest(raw) == entry['sha256'] + assert sha1(f'blob {len(raw)}\0'.encode() + raw).hexdigest() == entry['git_blob'] + old_price = decompress(source('inputs/R92-PRICE.json.gz')) + price_receipt = read_json(source('inputs/PR7362-SHA256.json')) + assert digest(old_price) == price_receipt['R92-PRICE.json'] + admitted = read_json(source('inputs/ADMITTED.json')) + assert admitted['head'] == 'aaeec8c0acf01e99a5f331ef363a698d9c084ace' + assert admitted['caller'] == '07a76c5e2738882c0cb322278e56f6cae3c9885d' + assert admitted['kappa'] == '0.00364665195644' and admitted['exit'] == 0 + assert admitted['caller_sha256'] == digest(decompress(source('inputs/CALLER.json.gz'))) + assert set(admitted['stages']) == {'native', 'caller', 'early', 'frontier'} + return old_price + + +def write(path, raw): + path.parent.mkdir(parents=True, exist_ok=True) + path.write_bytes(raw) + + +def call(script, *, succeeds=True): + p = run([sys.executable, '-I', '-B', str(script)], capture_output=True, timeout=28) + if succeeds: + if p.returncode: + sys.stderr.write(p.stderr.decode(errors='replace')) + p.check_returncode() + return p + + +def compare_role10(reverse, forward): + assert forward['tested_role'] == reverse['role'] == 10 + assert reverse['endpoint_recovered'] and not reverse['unvisited'] + assert [x['cut'] for x in reverse['rows']] == [1743, 1744] + for a, b in zip(reverse['rows'], forward['cuts'], strict=True): + assert a['cut'] == b['cut'] and a['status'] == 'foreign body' + normalized = [[r, q, [stages.count(s) for s in range(1, 18)], re, im] + for r, q, stages, re, im in b['entries']] + assert a['terms'] == sorted(normalized, key=lambda t: t[:3]) + assert a['first_foreign_body'] and b['status'] == 'prefix excluded' + assert a['first_foreign_body'][2] == [0] * 17 + + +def compare_role7(reverse, forward): + assert forward['role'] == reverse['role'] == 7 + assert reverse['endpoint_recovered'] and not reverse['unvisited'] and not forward['survivors'] + assert [x['cut'] for x in reverse['rows']] == list(range(1139, 1467)) + assert reverse['counts'] == {'foreign body': 43, 'mixed central parity': 285} + for a, b in zip(reverse['rows'], forward['rows'], strict=True): + assert a['cut'] == b['cut'] and a['term_count'] == b['terms'] + assert a['column_sha256'] == b['sha256'] + assert a['first_foreign_body'] == b['first_foreign_body'] + assert not a['allowed_phase_parities'] and b['parity'] == [0, 1] + assert b['parity_witnesses'] == [a['first_even_phase'], a['first_odd_phase']] + + +def replay(root, out): + old_price = verify_inputs() + expected = read_json(source('receipts/SHA256.json')) + receipts = {} + caller = decompress(source('inputs/CALLER.json.gz')) + + def record(name, script): + raw = call(script).stdout + assert digest(raw) == expected[name], f'changed deterministic receipt {name}' + receipts[name] = raw + return read_json(raw) + + quote = root / 'quote' + write(quote / 'quote.py', source('engines/quote.py')) + write(quote / 'inputs/R92-PRICE.json', old_price) + write(quote / 'inputs/CALLER.json', caller) + write(quote / 'inputs/pricing.py', source('inputs/pricing.py')) + price = record('PRICE.json', quote / 'quote.py') + assert (price['paid'], price['productive'], price['rank_surplus']) == (110519, 22557, 1424) + assert price['delta'] == {'8': 96, '9': 96, '17': -96} + + stages = {} + for key, engine in ( + ('ROLE10-REVERSE', 'role10_reverse.py'), + ('ROLE10-FORWARD', 'forward.py'), + ('ROLE7-REVERSE', 'role7_reverse.py'), + ('ROLE7-FORWARD', 'role7_forward.py'), + ): + stage = root / key + write(stage / engine, source(f'engines/{engine}')) + write(stage / 'inputs/CALLER.json', caller) + write(stage / 'inputs/PRICE.json', receipts['PRICE.json']) + if key.endswith('REVERSE'): + write(stage / 'inputs/reverse.py', source('inputs/reverse.py')) + if key == 'ROLE7-FORWARD': + write(stage / 'inputs/forward.py', source('engines/forward.py')) + stages[key] = record(key + '.json', stage / engine) + compare_role10(stages['ROLE10-REVERSE'], stages['ROLE10-FORWARD']) + compare_role7(stages['ROLE7-REVERSE'], stages['ROLE7-FORWARD']) + + bad_caller = root / 'ROLE10-REVERSE' + write(bad_caller / 'inputs/CALLER.json', caller + b' ') + p = call(bad_caller / 'role10_reverse.py', succeeds=False) + assert p.returncode == 1 and not p.stdout and b'changed dependency inputs/CALLER.json' in p.stderr + bad_price = root / 'ROLE7-FORWARD' + write(bad_price / 'inputs/PRICE.json', receipts['PRICE.json'] + b' ') + p = call(bad_price / 'role7_forward.py', succeeds=False) + assert p.returncode == 1 and not p.stdout and b'changed dependency inputs/PRICE.json' in p.stderr + + assert set(receipts) == set(expected) + if out: + for name, raw in receipts.items(): + write(out / name, raw) + print(dumps({ + 'cases': 330, 'excluded': 330, 'unresolved': 0, + 'role10': {'foreign body': 2}, + 'role7': dict(Counter(r['status'] for r in stages['ROLE7-REVERSE']['rows'])), + 'deterministic_receipts': len(receipts), 'corrupted_inputs_rejected': 2, + 'kappa_delta': '0', + }, sort_keys=True)) + print('PASS_P104_TYPE_A_RANK17_PREFIX_BOUND') + + +def main(): + if sys.version_info[:2] != (3, 12) or not __debug__: + raise SystemExit('CPython 3.12 with assertions is required') + parser = ArgumentParser(description=__doc__) + parser.add_argument('--out', type=Path) + args = parser.parse_args() + with TemporaryDirectory(prefix='p104-rank17-') as path: + replay(Path(path), args.out) + + +if __name__ == '__main__': + main()