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-first-receiver-contraction-bound/LOCAL-PINS.json b/research/p104-first-receiver-contraction-bound/LOCAL-PINS.json new file mode 100644 index 0000000000..b2b31979d1 --- /dev/null +++ b/research/p104-first-receiver-contraction-bound/LOCAL-PINS.json @@ -0,0 +1,26 @@ +{ + "PROVENANCE.json": "e92fdbb1df6b9235380dcccabd0e9e4dd7c8a2139d7e7182b19326576e06d473", + "engines/first_receiver.py": "4f304c3eed2950677247d7e0736f31c859ad3d6ee1ea299c7b43c3a8a0b0dd58", + "engines/full_receiver.py": "b032d6037dc7b9093875e36452e9a148f4031154f73672551cc18c1f8e505699", + "engines/local_gate.py": "dd143c03b3dca582ed41c01ba254ae44cec8da5cb011ecebf6035e9d432e86f1", + "engines/r159_forward.py": "278495aff00a25afbfab6a0318a8de044eb05fce732f3ca8e0243d544530474d", + "engines/r160_forward.py": "53ea06a70db760bb3a1b337f13f46c7a77bd800294f5f39823e704a0d426b810", + "inputs/7274-WORD.json.gz": "66bc395b599bc0b805c5061bbbd124e2027ad86645c07abe40d0b472fa1a7a2b", + "inputs/7334-WORD.json.gz": "4b9fd1187b34ed97c3ac0c760d73531735a5d0ebc5b4d4ab4377160b20d9bb2a", + "inputs/ADMITTED.json": "c95300e9bca27e44a25c82d794f88cbf70757c142806b0e4c590ea29feb81a13", + "inputs/PLAN.md": "13224daa1271a10de69dc7c45d105e9518765da9529771a181b5447f70d02ee6", + "inputs/PR7362-SHA256.json": "2c90ca39b0f075cc4b3ec9e90c66fde473465e7bb50cf1db9a820d3a29556c0b", + "inputs/R29-RESULT.json": "6fa36e6a2b618ad96a6e18389c165dc04f3f987b186d8ce33bdb82bed47ef5b5", + "inputs/R92-PRICE.json.gz": "2274f514fb12f9ced0c24abe0c02a76c16cfee4c61f909e37a5ad89b07852371", + "inputs/aggregate.py": "8bf1b91d7fc0937305466686522f5fb3920c66c71830acfc94adde84ba4f49e1", + "inputs/donor_span.py": "4d5306e2c0b7e91c79d22c82e8e760aed2c311979298c558e631975d4d1ae5b1", + "inputs/pricing.py": "f4d0b6c9314b838d882d6d06020f24881c19a3fda97a7c00df87b1e920785182", + "inputs/reverse_span.py": "f8b48f2ed99d003e20f5b3fb2270603c4edbc3ce9a01484102816aa2710ce9ff", + "receipts/PRICE.json": "9b1ea080bc4ac60e9c78b054352b41d7732989b4492692a2e37c0f578092712a", + "receipts/R159-FORWARD.json": "cbd68f70602a75234718642adf6dce528a1e8c4ce8ea043aca029c8fd8b1db38", + "receipts/R159-GATE.json": "80159b185c223fba77118d61a72bb0cf533d6b5bc7b0591dcc681ef6144c03fd", + "receipts/R159-REVERSE.json": "a7b794a3a3d1f79c1f277334a03bf6ff98044d132a9e8fdb1122a8cc59d3f9ac", + "receipts/R160-FORWARD.json": "41c854d890cd79f1c953b4d5a02d79b389d76080c10429807b8cddb32f6102dc", + "receipts/R160-REVERSE.json": "68afed36a9279340b41e1f1f873956d9b7d222d49fc824c28b79dc645f95f3e6", + "receipts/SHA256.json": "6c474f35e6d793ae95e2a1ccb65fe8e29aa7d02d66311e4c643aa3ff1f4d4c71" +} diff --git a/research/p104-first-receiver-contraction-bound/NOTICE b/research/p104-first-receiver-contraction-bound/NOTICE new file mode 100644 index 0000000000..cc496ec277 --- /dev/null +++ b/research/p104-first-receiver-contraction-bound/NOTICE @@ -0,0 +1,3 @@ +Apache-2.0. + +Exact source and contribution attribution appear in README.md and PROVENANCE.json. OpenAI Codex and subagents materially assisted. diff --git a/research/p104-first-receiver-contraction-bound/PROOF.md b/research/p104-first-receiver-contraction-bound/PROOF.md new file mode 100644 index 0000000000..b14b70dbb1 --- /dev/null +++ b/research/p104-first-receiver-contraction-bound/PROOF.md @@ -0,0 +1,31 @@ +# Exact chart-652 bank obstruction + +At pre-event 42651 let Rᵣ be the row mapping the arbitrary public inputs to normalized field r in the literal #7334 prefix. The original post-ADD row is + +```text +T = R793 + (1/2) R930. +``` + +The chart is fixed and its operator is invertible, so evaluating these normalized rows proves a necessary physical identity for any same-clock scalar reconstruction. The paid contraction lifts role 930 out of this chart before the ADD. Grant arbitrary rational coefficients for R165, R586 and R793. For a one-receiver repair with unchanged other fields the new row is a R793 + b R165 + c R586. Exact replay gives + +```text +input axis R930 R793 R165 R586 T +930 -1 1/2 0 0 0 +893 0 1/2 0 0 1/2 +``` + +Axis 930 forces a = 0. An invertible local one-receiver update needs a nonzero diagonal. To test a larger scope, grant a new zero owned field and allow COPY of the old receiver into scratch, subtraction to zero the receiver, reconstruction from the unchanged donors and CLEAR. A fresh zero field adds no source row, and its local linear state remains in the span of the original cocharted rows. Even if erasure is free and a = 0 is granted, axis 893 makes the remaining row equation impossible. The two exact donor rows are independent; the target has an exterior nonzero coordinate and increases rank to three. + +The signed normalized proof uses the literal native MOVE chart transport and ADD coefficients. The fixed input/ownership identities are inherited from the authenticated source. The replay checks the six matching old and current MOVE/ADD anchors, the strict nesting and the receiver's next chart, and reconstructs the literal live bank. The old endpoint membership is a supplied exact receipt on the old word. It concerns donor observations at the two endpoints and therefore does not grant access at the intermediate receiver clock. This package does not rerun or widen the older search. + +## Complete directed quote + +The fixed productive profile has 22,461 targets, rank surplus 1,424 and no empty-root credit. Paid positions would fall from 110,519 to 110,485. With hᵣ the raw rank-r tariff, the signed complex margin changes by + +```text +17 (h1 + h2 + h4 − h7). +``` + +The full interval computation uses all paid and productive bins. The lower complete margin at the pinned strictly higher probe exceeds 0.4123270058096044. At the fixed κ = 0.0040075385047236 target the complete margin remains below −139.3135861810168. The one-scope optimistic budget grants up to eight ordinary events and one stationary owned scratch, with no new paid rank. This reserves 64,328 ordinary source units across 17 copies, taking the incumbent 782,715,464 to at most 782,779,792 in the stated favorable model. It is a price relaxation for a prospective exact repair. It gives no credit for an unbuilt compiler, precision, tape or ownership change. Both exact local gates fail before any such build. + +The #7334 native-all-columns, owned erasure, compiler, precision/tape and analytic-recovery premises and the retained BIT supplier govern the comparison. The result excludes the two scoped same-clock repairs and leaves the complete conditional exponent unchanged. diff --git a/research/p104-first-receiver-contraction-bound/PROVENANCE.json b/research/p104-first-receiver-contraction-bound/PROVENANCE.json new file mode 100644 index 0000000000..6bed820584 --- /dev/null +++ b/research/p104-first-receiver-contraction-bound/PROVENANCE.json @@ -0,0 +1,69 @@ +{ + "derived_inputs": { + "inputs/R92-PRICE.json.gz": { + "compression": "gzip", + "key": "R92-PRICE.json", + "receipt": "inputs/PR7362-SHA256.json" + } + }, + "files": { + "inputs/7274-WORD.json.gz": { + "commit": "ff79af7a208132e16d51ceca3e1428444894367e", + "git_blob": "8701c521b5cd63adc8610b228aefe634125c622d", + "path": "research/p104-funded-shorter-return/WORD.json.gz", + "sha256": "66bc395b599bc0b805c5061bbbd124e2027ad86645c07abe40d0b472fa1a7a2b", + "source": "https://github.com/CrocSwap/integer-mult-bounds/blob/ff79af7a208132e16d51ceca3e1428444894367e/research/p104-funded-shorter-return/WORD.json.gz" + }, + "inputs/7334-WORD.json.gz": { + "commit": "aaeec8c0acf01e99a5f331ef363a698d9c084ace", + "git_blob": "73f43007192eb5a38eb5abb591b871df3e52c7cd", + "path": "research/p104-helper-319-fused-return/WORD.json.gz", + "sha256": "4b9fd1187b34ed97c3ac0c760d73531735a5d0ebc5b4d4ab4377160b20d9bb2a", + "source": "https://github.com/Clear1nsight/integer-mult-bounds/blob/aaeec8c0acf01e99a5f331ef363a698d9c084ace/research/p104-helper-319-fused-return/WORD.json.gz", + "uncompress": false + }, + "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/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/donor_span.py": { + "commit": "403e0d388c35e83b15eab5bba67be563b33d5a8a", + "git_blob": "46e4621b69bba513f327de53153298e7f4ca0645", + "path": "research/p104-owned-add-source-span-bound/engines/forward.py", + "sha256": "4d5306e2c0b7e91c79d22c82e8e760aed2c311979298c558e631975d4d1ae5b1", + "source": "https://github.com/CrocSwap/integer-mult-bounds/blob/403e0d388c35e83b15eab5bba67be563b33d5a8a/research/p104-owned-add-source-span-bound/engines/forward.py" + }, + "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_span.py": { + "commit": "403e0d388c35e83b15eab5bba67be563b33d5a8a", + "git_blob": "5efbeac87e3963085149244304614844307c8034", + "path": "research/p104-owned-add-source-span-bound/engines/reverse.py", + "sha256": "f8b48f2ed99d003e20f5b3fb2270603c4edbc3ce9a01484102816aa2710ce9ff", + "source": "https://github.com/CrocSwap/integer-mult-bounds/blob/403e0d388c35e83b15eab5bba67be563b33d5a8a/research/p104-owned-add-source-span-bound/engines/reverse.py" + } + }, + "schema_version": 1, + "supplied_evidence": { + "inputs/PLAN.md": "Frozen current one-case scope and original directed quote summary.", + "inputs/R29-RESULT.json": "Exact earlier #7274 endpoint-support search receipt. Bundled here with authenticated role anchors; replay scopes the current first receiver.", + "inputs/aggregate.py": "Exact R122 lead forward rational reducer, bundled source; retained algorithm credited to the owned two-write aggregate study." + } +} diff --git a/research/p104-first-receiver-contraction-bound/README.md b/research/p104-first-receiver-contraction-bound/README.md new file mode 100644 index 0000000000..54269cff93 --- /dev/null +++ b/research/p104-first-receiver-contraction-bound/README.md @@ -0,0 +1,26 @@ +# P104 first-receiver repair bound after a three-MOVE contraction + +One earlier exact endpoint membership still fails the first intermediate receiver on the current word. Both same-clock repairs tested here are excluded. Conditional κ stays at the independently reproduced 0.00364665195644 on exact [#7334](https://github.com/CrocSwap/integer-mult-bounds/pull/7334) `aaeec8c0acf01e99a5f331ef363a698d9c084ace` with the [#7113 signed caller](https://github.com/CrocSwap/integer-mult-bounds/pull/7113) `07a76c5e2738882c0cb322278e56f6cae3c9885d`. The maintainer-selected record is separate. + +Public role 930 follows charts 3→652→657→649 at paid ranks 2, 4 and 1. A direct rank-seven lift at clock 42650 removes access to the chart-652 source for the receiver-793 ADD at pre-event cut 42651. Receiver 793 leaves for chart 653 at clock 42653. This package checks the one exact chart-652 bank at the original ADD clock. Its two unchanged public donors are 165 and 586. There are no live owned donors on that chart. + +- On input 930, the receiver's existing coefficient is +1/2, the old ADD contributes −1/2, and both distinct donors are zero. Any local invertible update to receiver 793 while leaving its donors fixed requires a nonzero receiver diagonal. Matching this input forces diagonal zero. +- Grant one fresh stationary owned scratch field and allow the receiver to be erased before reconstruction. The first input still forces zero total coefficient on the old receiver. On input 893, the required full receiver row is +1/2 and both distinct donors are zero. The exact rational donor rank is two and adding the target raises it to three. + +A hypothetical contraction across all 17 copies gives paid delta `{1:−17,2:−17,4:−17,7:+17}` with productive ranks fixed. The complete directed margin at the old crossing upper is in `(0.4127144682830787, 0.4127144682830788)` raw units before unbuilt ancillary work. One extra paid rank-one position defeats this one-edit quote. See [proof and price](PROOF.md). + +## Reproduce + +From the package directory, using CPython 3.12 and assertions enabled: + +```sh +python3.12 -I -B replay.py +``` + +The standard-library replay authenticates all relative inputs, reconstructs the full directed price and both exact signed row proofs, and checks the forward/adjoint agreement and mutation controls. `--out receipts-replayed` saves the deterministic receipts listed in [receipts/SHA256.json](receipts/SHA256.json). + +## Open next questions + +A different receiver deadline, a changed paid path or a temporally retained source could change the bank. Price one concrete changed mechanism before searching new clocks. Neither later receiver of this carrier, any other interval from the older endpoint search, nor an expanded ownership interface was evaluated. The five comparator assumptions remain in force. + +[#7274](https://github.com/CrocSwap/integer-mult-bounds/pull/7274) and its retained R29 endpoint search supply the old exact role-930 geometry and endpoint membership. [#7312](https://github.com/CrocSwap/integer-mult-bounds/pull/7312) supplies the earlier common-lift contact restriction. [#7338](https://github.com/CrocSwap/integer-mult-bounds/pull/7338) and [#7383](https://github.com/CrocSwap/integer-mult-bounds/pull/7383) cover distinct compensated fusion and shared-midpoint scopes. [#7355](https://github.com/CrocSwap/integer-mult-bounds/pull/7355) supplies the reverse rational engine. [#7387](https://github.com/CrocSwap/integer-mult-bounds/pull/7387) and [#7389](https://github.com/CrocSwap/integer-mult-bounds/pull/7389) supply related owned MOVE reconstruction and zero-initialization evidence. [#7334](https://github.com/CrocSwap/integer-mult-bounds/pull/7334), [#7113](https://github.com/CrocSwap/integer-mult-bounds/pull/7113), [#7362](https://github.com/CrocSwap/integer-mult-bounds/pull/7362) and [#7298](https://github.com/CrocSwap/integer-mult-bounds/pull/7298) supply the exact comparator, caller, complete invoice and directed tariff. OpenAI Codex and subagents materially assisted. diff --git a/research/p104-first-receiver-contraction-bound/SOURCES.json b/research/p104-first-receiver-contraction-bound/SOURCES.json new file mode 100644 index 0000000000..e8c2f265cd --- /dev/null +++ b/research/p104-first-receiver-contraction-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-first-receiver-contraction-bound/TASK.json b/research/p104-first-receiver-contraction-bound/TASK.json new file mode 100644 index 0000000000..3d80404ff8 --- /dev/null +++ b/research/p104-first-receiver-contraction-bound/TASK.json @@ -0,0 +1,117 @@ +{ + "actual_scope": "Exact #7334 pre-event 42651, chart652 receiver793 and original donors165/586, after the one role930 three-MOVE contraction. Test same-clock invertible update and fresh scratch erase/reconstruct.", + "ai_assistance": "OpenAI Codex and subagents materially assisted proof, implementation, independent verification and packaging.", + "author": "P104 first receiver contraction research", + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "bottleneck_link": "A positive paid contraction and old endpoint span do not satisfy the intermediate receiver deadline.", + "budget_minutes": 12, + "evidence": "Independent forward and reverse rational engines give the same signed coordinate obstructions. One bank, both local repair scopes excluded.", + "open_questions": [ + { + "blocked_by": "The exact same-clock original bank fails both the invertible and erase-and-reconstruct scope.", + "first_step": "Freeze a single alternative receiver deadline or paid itinerary and compute the full invoice before one exact coframe and support test.", + "question": "Could a different charged path or earlier legal receiver repair change the first receiver bank?", + "why_it_matters": "A valid intermediate repair is required before the older endpoint membership can improve a complete bound." + } + ], + "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": "Changes the cost and physical receiver contract of an exact earlier endpoint membership on one source-bound three-MOVE chain.", + "scope_status": "changed", + "stop_rule": "Freeze one case, one bank and 20 seconds per direction. Verify both exact certificates before considering physical build.", + "task_id": "p104-side-correction" +} diff --git a/research/p104-first-receiver-contraction-bound/VERIFICATION.md b/research/p104-first-receiver-contraction-bound/VERIFICATION.md new file mode 100644 index 0000000000..3be8a4bff6 --- /dev/null +++ b/research/p104-first-receiver-contraction-bound/VERIFICATION.md @@ -0,0 +1,9 @@ +# Verification receipt + +CPython 3.12 with assertions and standard-library dependencies. The direct replay exited 0 in 3.23 seconds. The Git-free relocated copy with an empty environment exited 0 in 3.54 seconds and reproduced the same six deterministic receipts. The official registered wrapper exited 0 in 3.89 seconds. See [receipts/SHA256.json](receipts/SHA256.json). + +The frozen R159 reverse audit and independent forward impulse agree on the complete cocharted e930 response and the forced zero diagonal. R160 independently reconstructs the exact normalized donor and receiver rows, confirms donor rank two and augmented rank three, and matches the forward e893 witness. Original signed literal events, chart ancestry, live public/owned bank and the next recipient MOVE are checked. Planting a cocharted source in the synthetic control gives an exact span hit. A changed target coordinate and a same-support separating covector exercise the negative controls. The package rejects changed current word bytes, a changed R159 receipt and a duplicate dependency path key before mathematical output. + +A preliminary R159 reverse driver stopped before operator propagation because it assigned the later chart-657 sign to the prior chart-3 ADD. The authenticated literal source has +1 at chart-3 clock 42649 and −1 at chart-657 clock 42693. The corrected replay checks both signs. + +These scoped checks do not replay the full #7334 supplier or the older R29 endpoint search. Their exact admission and search receipts are retained. No physical candidate was built. Hosted and proposed-file source-history and mode checks apply after publication. diff --git a/research/p104-first-receiver-contraction-bound/VERIFY.json b/research/p104-first-receiver-contraction-bound/VERIFY.json new file mode 100644 index 0000000000..03e30d8025 --- /dev/null +++ b/research/p104-first-receiver-contraction-bound/VERIFY.json @@ -0,0 +1,19 @@ +{ + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/replay.py" + ], + "checks": "Rebuild the complete directed quote and reproduce both exact signed first-receiver gates in two directions.", + "timeout_seconds": 100 + } + ], + "inputs": [], + "python": "3.12", + "requirements": [], + "schema_version": 1, + "status": "ready" +} diff --git a/research/p104-first-receiver-contraction-bound/engines/first_receiver.py b/research/p104-first-receiver-contraction-bound/engines/first_receiver.py new file mode 100644 index 0000000000..969a1ba694 --- /dev/null +++ b/research/p104-first-receiver-contraction-bound/engines/first_receiver.py @@ -0,0 +1,176 @@ +"""Exact reverse e930 separation of the first retained chart-652 receiver.""" +from argparse import ArgumentParser +from fractions import Fraction +from gzip import decompress +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/PLAN.md': '13224daa1271a10de69dc7c45d105e9518765da9529771a181b5447f70d02ee6', + 'inputs/R29-RESULT.json': '6fa36e6a2b618ad96a6e18389c165dc04f3f987b186d8ce33bdb82bed47ef5b5', + 'inputs/7334-WORD.json.gz': '4b9fd1187b34ed97c3ac0c760d73531735a5d0ebc5b4d4ab4377160b20d9bb2a', + 'inputs/7274-WORD.json.gz': '66bc395b599bc0b805c5061bbbd124e2027ad86645c07abe40d0b472fa1a7a2b', + 'inputs/reverse_span.py': 'f8b48f2ed99d003e20f5b3fb2270603c4edbc3ce9a01484102816aa2710ce9ff', +} +HEAD = 'aaeec8c0acf01e99a5f331ef363a698d9c084ace' +CALLER = '07a76c5e2738882c0cb322278e56f6cae3c9885d' +CUT, MOVER, RECEIVER, CHART = 42651, 930, 793, 652 +CLOCKS = [42650, 42651, 42692, 42693, 42695, 42697] +OLD_CLOCKS = [42648, 42649, 42690, 42691, 42693, 42695] +EVENTS = [ + ['MOVE', 930, 3, 652, False], + ['ADD', 793, 930, '1/2', 652], + ['MOVE', 930, 652, 657, False], + ['ADD', 1473, 930, '-1', 657], + ['ADD', 930, 982, '-1', 657], + ['MOVE', 930, 657, 649, False], +] + + +def unique(pairs): + obj = dict(pairs) + if len(obj) != len(pairs): + raise ValueError('duplicate JSON key') + return obj + + +def checked(root): + raw = {path: (root / path).read_bytes() for path in PINS} + for path, data in raw.items(): + if sha256(data).hexdigest() != PINS[path]: + raise ValueError(f'changed dependency {path}') + return raw + + +def span(basis): + out = {0} + for u in basis: + assert u not in out and 0 < u < 512 + out |= {u ^ v for v in out} + return out + + +def literal(word, old, receipt): + assert len(word['program']) == 76466 and word['public'] == 1501 + assert [word['program'][i] for i in CLOCKS] == EVENTS + assert [old['program'][i] for i in OLD_CLOCKS] == EVENTS + assert word['program'][42649] == ['ADD', 1473, 930, '1', 3] + assert word['program'][42653] == ['MOVE', 793, 652, 653, False] + assert '[42648,42695,"in_span",1060,5,0]' in dumps(receipt, separators=(',', ':')) + frames = [word['frames'][label] for label in (3, 652, 657, 649)] + assert list(map(len, frames)) == [0, 2, 6, 7] + a, b, c, d = map(span, frames) + assert a < b < c < d + return frames + + +def bank_at(word, deadline): + n = word['public'] + state = word['final'] + [None] * word['owned_fields'] + fresh_copy = set() + bank = None + for clock in range(len(word['program']) - 1, -1, -1): + if clock % 128 == 0 and monotonic() >= deadline: + raise TimeoutError('literal reverse chart walk') + op, d, *args = word['program'][clock] + assert 0 <= d < len(state) and (d not in fresh_copy or op == 'INIT') + if op == 'MOVE': + left, right, owned = args + assert state[d] == right and owned == (d >= n) + state[d] = left + elif op == 'INIT': + assert d >= n and state[d] == args[0] + state[d] = None + fresh_copy.discard(d) + elif op == 'CLEAR': + assert d >= n and state[d] is None + state[d] = args[0] + else: + assert op in ('SCALE', 'ADD', 'COPY') and state[d] == args[-1] + assert Fraction(args[-2]) + if op in ('ADD', 'COPY'): + src = args[0] + assert d != src and 0 <= src < len(state) and state[src] == args[-1] + if op == 'COPY': + assert d >= n + fresh_copy.add(d) + if clock == CUT: + assert state[MOVER] == state[RECEIVER] == CHART + bank = [role for role, frame in enumerate(state) if frame == CHART and role != MOVER] + assert not fresh_copy and state == word['initial'] + [None] * word['owned_fields'] + assert bank is not None and RECEIVER in bank + return bank + + +def evaluate(word, requests, engine, deadline, input_axis): + rows = engine['transpose_prefix'](word, requests, sum(map(len, requests.values())), deadline) + return [Fraction(coeffs.get(input_axis, 0), den) for coeffs, den in rows] + + +def controls(engine, deadline): + # Both exact controls traverse negative SCALE, ADD, and dirty COPY rules. + toy = {'public': 3, 'owned_fields': 1, 'program': [ + ['SCALE', 0, '-2', 0], ['INIT', 3, 0], ['COPY', 3, 0, '1/2', 0], + ['ADD', 1, 3, '-1', 0], ['CLEAR', 3, 0], ['ADD', 2, 1, '3', 0], + ]} + assert evaluate(toy, {4: [(0, 0), (2, 1), (3, 2)], 5: [(1, 3)]}, + engine, deadline, 0) == [-2, 0, -1, 1] + return ['nonzero required and zero donor', 'retained owned donor nonzero', 'signed COPY and CLEAR'] + + +def stop(*_): + raise TimeoutError('hard 20-second cap') + + +def main(): + assert __debug__ + parser = ArgumentParser(description=__doc__) + parser.add_argument('--root', type=Path, default=ROOT) + parser.add_argument('--controls-only', action='store_true') + args = parser.parse_args() + signal(SIGALRM, stop) + alarm(20) + deadline = monotonic() + 19 + raw = checked(args.root) + engine = run_path(str(args.root / 'inputs/reverse_span.py')) + tests = controls(engine, deadline) + if args.controls_only: + print(dumps(tests)) + return + result = {'head': HEAD, 'caller': CALLER, 'pins': PINS, 'caps': {'cases': 1, 'seconds': 20}, + 'cut': CUT, 'chart': CHART, 'source': MOVER, 'receiver': RECEIVER, 'controls': tests} + try: + word, old = (loads(decompress(raw[f'inputs/{n}-WORD.json.gz']), object_pairs_hook=unique) + for n in ('7334', '7274')) + receipt = loads(raw['inputs/R29-RESULT.json'], object_pairs_hook=unique) + frames = literal(word, old, receipt) + bank = bank_at(word, deadline) + roles = [MOVER, *bank] + values = evaluate(word, {CUT: [(role, i) for i, role in enumerate(roles)]}, engine, deadline, MOVER) + source, donors = values[0], values[1:] + required = source / 2 + assert len(donors) == len(bank) + result.update(frames=frames, old_clocks=OLD_CLOCKS, current_clocks=CLOCKS, + events=EVENTS, receiver_next_clock=42653, case_count=1, + source_coordinate=str(source), required_coordinate=str(required), + receiver_old_coordinate=str(donors[bank.index(RECEIVER)]), + bank_public=[r for r in bank if r < word['public']], + bank_owned=[r for r in bank if r >= word['public']], + bank_values=[[r, str(v)] for r, v in zip(bank, donors, strict=True)], + disposition='excluded' if required and not any(donors) else 'unresolved') + except TimeoutError as exc: + result.update(disposition='unresolved', reason=str(exc), case_count=0) + finally: + alarm(0) + print(dumps(result, indent=2, sort_keys=True)) + if result['case_count'] == 0: + raise SystemExit(2) + + +if __name__ == '__main__': + main() diff --git a/research/p104-first-receiver-contraction-bound/engines/full_receiver.py b/research/p104-first-receiver-contraction-bound/engines/full_receiver.py new file mode 100644 index 0000000000..d841c07fd6 --- /dev/null +++ b/research/p104-first-receiver-contraction-bound/engines/full_receiver.py @@ -0,0 +1,120 @@ +"""Check the exact chart-652 reconstruction after allowing receiver erasure.""" +from argparse import ArgumentParser +from fractions import Fraction as Q +from gzip import decompress +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/r159_reverse.py': '4f304c3eed2950677247d7e0736f31c859ad3d6ee1ea299c7b43c3a8a0b0dd58', + 'inputs/RESULT.json': 'a7b794a3a3d1f79c1f277334a03bf6ff98044d132a9e8fdb1122a8cc59d3f9ac', + 'inputs/GATE.json': '80159b185c223fba77118d61a72bb0cf533d6b5bc7b0591dcc681ef6144c03fd', +} +CUT, SOURCE, RECEIVER = 42651, 930, 793 +DONORS = (165, 586) + + +def check(root, name): + raw = (root / name).read_bytes() + if sha256(raw).hexdigest() != PINS[name]: + raise ValueError(f'changed dependency {name}') + return raw + + +def coefficient(row, axis): + vector, denominator = row + return Q(vector.get(axis, 0), denominator) + + +def signed_return(engine, source, receiver, bank): + target = engine['sum_scaled'](receiver, source, (1, 2)) + result = engine['exact_span'](bank, target) + if result['status'] == 'absent_exterior_coordinate': + j = result['coordinate'] + dual = {j: Q(1)} + elif result['status'] == 'exact_rank_exclusion': + dual = {j: Q(x) for j, x in result['separating_covector'].items()} + else: + return target, result, None + dot = engine['dot'] + assert all(dot(row, dual) == 0 for _, row in bank) + assert dot(target, dual) != 0 + witness = { + 'covector': {str(j): str(x) for j, x in sorted(dual.items())}, + 'source': str(dot(source, dual)), 'receiver': str(dot(receiver, dual)), + 'target': str(dot(target, dual)), + 'donors': {str(r): str(dot(row, dual)) for r, row in bank}, + } + return target, result, witness + + +def controls(engine): + source, receiver = ({0: -1}, 1), ({0: 1, 2: 3}, 2) + donor = (165, ({1: 1}, 1)) + exact = (586, ({2: 3}, 2)) + blocked = (586, ({3: 3}, 2)) + _, result, _ = signed_return(engine, source, receiver, [donor, exact]) + assert result['status'] == 'exact_span' + _, result, witness = signed_return(engine, source, receiver, [donor, blocked]) + assert result['status'] == 'absent_exterior_coordinate' + assert witness['target'] == '3/2' and witness['covector'] == {'2': '1'} + return ['exact cancellation at the forced zero-diagonal input', + 'synthetic surviving receiver return', 'synthetic absent coordinate'] + + +def stop(*_): + raise TimeoutError('hard 20-second cap') + + +def main(): + assert __debug__ + p = ArgumentParser(description=__doc__) + p.add_argument('--root', type=Path, default=ROOT) + p.add_argument('--controls-only', action='store_true') + args = p.parse_args() + signal(SIGALRM, stop) + alarm(20) + deadline = monotonic() + 19 + for name in PINS: + check(args.root, name) + prior = run_path(str(args.root / 'inputs/r159_reverse.py')) + raw = prior['checked'](args.root) + engine = run_path(str(args.root / 'inputs/reverse_span.py')) + tests = controls(engine) + if args.controls_only: + print(dumps(tests)) + return + result = {'head': prior['HEAD'], 'caller': prior['CALLER'], + 'key': [CUT, RECEIVER, 652], 'cases': 1, 'cap_seconds': 20, + 'pins': PINS | prior['PINS'], 'controls': tests} + try: + gate = loads(check(args.root, 'inputs/GATE.json'), object_pairs_hook=prior['unique']) + assert gate['status'] == 'excluded' and gate['necessary_receiver_diagonal'] == '0' + word = loads(decompress(raw['inputs/7334-WORD.json.gz']), object_pairs_hook=prior['unique']) + assert word['program'][CUT] == ['ADD', RECEIVER, SOURCE, '1/2', 652] + assert prior['bank_at'](word, deadline) == [*DONORS, RECEIVER] + roles = (SOURCE, RECEIVER, *DONORS) + rows = engine['transpose_prefix'](word, {CUT: [(r, i) for i, r in enumerate(roles)]}, len(roles), deadline) + source, receiver, *donor_rows = rows + bank = list(zip(DONORS, donor_rows, strict=True)) + assert [coefficient(row, SOURCE) for row in rows] == [Q(-1), Q(1, 2), Q(0), Q(0)] + target, proof, witness = signed_return(engine, source, receiver, bank) + assert not coefficient(target, SOURCE) + result.update(roles=roles, rows=rows, target=target, proof=proof, witness=witness, + status='excluded' if witness else 'exact normalized span survives') + except TimeoutError as exc: + result.update(status='unresolved', reason=str(exc), cases=0) + finally: + alarm(0) + print(dumps(result, indent=2, sort_keys=True)) + if not result['cases']: + raise SystemExit(2) + + +if __name__ == '__main__': + main() diff --git a/research/p104-first-receiver-contraction-bound/engines/local_gate.py b/research/p104-first-receiver-contraction-bound/engines/local_gate.py new file mode 100644 index 0000000000..381e0ca4dc --- /dev/null +++ b/research/p104-first-receiver-contraction-bound/engines/local_gate.py @@ -0,0 +1,43 @@ +"""Certify the invertible one-receiver obstruction from the frozen transpose.""" +from fractions import Fraction as Q +from hashlib import sha256 +from json import dumps, loads +from pathlib import Path +import sys + +PIN = 'a7b794a3a3d1f79c1f277334a03bf6ff98044d132a9e8fdb1122a8cc59d3f9ac' + + +def classify(values, receiver, required): + old = values[receiver] + after = old + required + if any(v for r, v in values.items() if r != receiver): + return 'unresolved', after, None + diagonal = after / old if old else None + if required and (not old or not diagonal): + return 'excluded', after, diagonal + return 'unresolved', after, diagonal + + +assert classify({1: Q(1), 2: Q(0)}, 1, Q(-1)) == ('excluded', 0, 0) +assert classify({1: Q(1), 2: Q(0)}, 1, Q(1)) == ('unresolved', 2, 2) +assert classify({1: Q(1), 2: Q(1)}, 1, Q(-1)) == ('unresolved', 0, None) +assert classify({1: Q(0), 2: Q(0)}, 1, Q(1)) == ('excluded', 1, None) +raw = Path(sys.argv[1]).read_bytes() +assert sha256(raw).hexdigest() == PIN, 'changed transpose receipt' +data = loads(raw) +assert data['case_count'] == 1 and data['cut'] == 42651 +assert data['bank_owned'] == [] and data['bank_public'] == [165, 586, 793] +bank = {role: Q(v) for role, v in data['bank_values']} +receiver = data['receiver'] +assert bank[receiver] == Q(data['receiver_old_coordinate']) +result, after, diagonal = classify(bank, receiver, Q(data['required_coordinate'])) +assert result == 'excluded' and after == diagonal == 0 +print(dumps({ + 'cut': 42651, 'input_axis': 930, 'case_count': 1, + 'scope': 'same-clock chart652 one-receiver replacement with unchanged donors', + 'old_receiver': str(bank[receiver]), 'required_add': data['required_coordinate'], + 'distinct_donor_values': {str(r): str(v) for r, v in bank.items() if r != receiver}, + 'required_receiver_return': str(after), 'necessary_receiver_diagonal': str(diagonal), + 'status': result, 'pin': PIN, +}, indent=2, sort_keys=True)) diff --git a/research/p104-first-receiver-contraction-bound/engines/r159_forward.py b/research/p104-first-receiver-contraction-bound/engines/r159_forward.py new file mode 100644 index 0000000000..9dd452ae22 --- /dev/null +++ b/research/p104-first-receiver-contraction-bound/engines/r159_forward.py @@ -0,0 +1,60 @@ +"""Forward exact e930 impulse at the frozen chart-652 receiver.""" +from fractions import Fraction as Q +from gzip import decompress +from hashlib import sha256 +from json import dumps, loads +from pathlib import Path +from signal import SIGALRM, alarm, signal + +ROOT = Path(__file__).resolve().parent +WORD = "inputs/CURRENT.json.gz" +PIN = "4b9fd1187b34ed97c3ac0c760d73531735a5d0ebc5b4d4ab4377160b20d9bb2a" +CUT, CHART, CARRIER, RECEIVER = 42651, 652, 930, 793 + + +def timeout(*_): + raise TimeoutError("20-second hard cap") + + +def main(): + assert __debug__ + signal(SIGALRM, timeout) + alarm(20) + raw = (ROOT / WORD).read_bytes() + assert sha256(raw).hexdigest() == PIN + payload = decompress(raw) + assert sha256(payload).hexdigest() == "9aa8d6b054ba7eb2289d052c1079b16be518d2f0fbfb244569fa18e3733acdac" + w = loads(payload) + tape, n = w["program"], w["public"] + assert tape[CUT] == ["ADD", 793, 930, "1/2", 652] + assert tape[42653] == ["MOVE", 793, 652, 653, False] + chart = w["initial"][:] + [None] * w["owned_fields"] + vals = [Q(r == CARRIER) for r in range(len(chart))] + for op, r, *a in tape[:CUT]: + if op == "MOVE": + assert chart[r] == a[0] and a[2] == (r >= n) + chart[r] = a[1] + elif op in ("INIT", "CLEAR"): + assert r >= n and chart[r] == (None if op == "INIT" else a[0]) + chart[r] = a[0] if op == "INIT" else None + vals[r] = Q(0) + elif op == "SCALE": + assert chart[r] == a[-1] + vals[r] *= Q(a[0]) + else: + s, q, f = a + assert op in ("ADD", "COPY") and chart[r] == chart[s] == f + vals[r] = (vals[r] if op == "ADD" else Q(0)) + Q(q) * vals[s] + assert chart[CARRIER] == chart[RECEIVER] == CHART + bank = {i: str(vals[i]) for i,c in enumerate(chart) if c == CHART and i not in (CARRIER, RECEIVER)} + target = vals[CARRIER] / 2 + assert vals[CARRIER] == -1 and vals[RECEIVER] == Q(1, 2) and target == -Q(1, 2) + assert bank == {165:"0", 586:"0"} and vals[RECEIVER] + target == 0 + alarm(0) + print(dumps(dict(pins={WORD:PIN},cut=CUT,chart=CHART,carrier=str(vals[CARRIER]),receiver=str(vals[RECEIVER]), + required=str(target),post_receiver="0",donors=bank,runner_seconds=20,scope=1), + indent=2,sort_keys=True)) + + +if __name__ == "__main__": + main() diff --git a/research/p104-first-receiver-contraction-bound/engines/r160_forward.py b/research/p104-first-receiver-contraction-bound/engines/r160_forward.py new file mode 100644 index 0000000000..5014a3ee67 --- /dev/null +++ b/research/p104-first-receiver-contraction-bound/engines/r160_forward.py @@ -0,0 +1,90 @@ +"""Price and check the full chart-local receiver reconstruction.""" +from collections import Counter +from fractions import Fraction as Q +from gzip import decompress +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 sys import argv +from time import monotonic + +ROOT = Path(__file__).resolve().parent +PINS = { + "inputs/R159-IMPULSE.json": "cbd68f70602a75234718642adf6dce528a1e8c4ce8ea043aca029c8fd8b1db38", + "inputs/R92-PRICE.json": "05d7a5ebdd2eeedd6c8f534e8e2eeac22484daf9f387f4a6b88cc9eed22a6b8f", + "inputs/WORD.json.gz": "4b9fd1187b34ed97c3ac0c760d73531735a5d0ebc5b4d4ab4377160b20d9bb2a", + "inputs/aggregate.py": "8bf1b91d7fc0937305466686522f5fb3920c66c71830acfc94adde84ba4f49e1", + "inputs/donor_span.py": "4d5306e2c0b7e91c79d22c82e8e760aed2c311979298c558e631975d4d1ae5b1", + "inputs/pricing.py": "f4d0b6c9314b838d882d6d06020f24881c19a3fda97a7c00df87b1e920785182", +} +CUT, CHART, CARRIER, RECEIVER = 42651, 652, 930, 793 + + +def read(name): + raw = (ROOT/name).read_bytes() + if sha256(raw).hexdigest() != PINS[name]: + raise ValueError(f"changed dependency {name}") + return raw + + +def stop(*_): + raise TimeoutError("20-second hard cap") + + +def price(): + base = loads(read("inputs/R92-PRICE.json")) + read("inputs/pricing.py") + cost = run_path(str(ROOT/"inputs/pricing.py"))["cost"] + p,t = (Counter({int(k):n for k,n in base[key].items()}) for key in ("old_paid","old_targets")) + invoice = t.copy() + invoice.subtract(p) + assert (sum(p.values()),sum(t.values()),sum(r*n for r,n in invoice.items())) == (110519,22461,1424) + delta = {1:17,2:17,4:17,7:-17} + invoice.update(delta) + quote = {k:list(map(str,cost(invoice,Q(base[k])))) for k in ("old_crossing_upper","probe","moonshot")} + assert Q(quote["probe"][0]) > 0 and Q(quote["old_crossing_upper"][1]) < 1 + reserve = 17*(8*340+1000+64) + assert reserve == 64328 and 782715464+reserve < 10**9 + return dict(pins=PINS,head=base["head"],caller=base["caller_head"],paid_after=110485,productive=22461, + rank_surplus=1424,paid_delta={r:-n for r,n in delta.items()},complete=quote, + ordinary_reserve=reserve,one_owned_slot_at_cut=True) + + +def main(): + assert __debug__ and argv[1:] in ([],["--price"]) + signal(SIGALRM, stop) + alarm(20) + deadline = monotonic()+20 + quote = price() + if argv[1:]: + print(dumps(quote,sort_keys=True,indent=2)) + return + prior = loads(read("inputs/R159-IMPULSE.json")) + assert (prior["carrier"],prior["receiver"],prior["donors"]) == ("-1","1/2",{"165":"0","586":"0"}) + word = loads(decompress(read("inputs/WORD.json.gz"))) + assert word["program"][CUT]==["ADD",793,930,"1/2",652] + read("inputs/donor_span.py") + read("inputs/aggregate.py") + helper = run_path(str(ROOT/"inputs/donor_span.py")) + alg = run_path(str(ROOT/"inputs/aggregate.py")) + controls = alg["controls"](helper) + banks, targets = helper["snapshot"](word,{CUT:{(CHART,RECEIVER)}},{CUT:{CARRIER,RECEIVER}},deadline) + stock = banks[CUT,CHART,RECEIVER] + carrier, receiver = targets[CUT,CARRIER], targets[CUT,RECEIVER] + assert stock.pop(CARRIER)==carrier and sorted(stock)==[165,586] + target = receiver.copy() + helper["axpy"](target,carrier,Q(1,2)) + assert 930 not in target and target[893]==Q(1,2) + assert all(893 not in row for row in stock.values()) + separation = alg["exact_span"](target,stock,deadline,helper) + assert separation and separation["decision"]=="outside donor span" + alarm(0) + print(dumps(dict(price=quote,chart=CHART,cut=CUT,donor_roles=sorted(stock),coordinate=893, + target_coefficient="1/2",donor_coefficients=["0","0"],controls=controls, + exact=separation,scope=1,runner_seconds=20),sort_keys=True,indent=2)) + + +if __name__ == "__main__": + main() diff --git a/research/p104-first-receiver-contraction-bound/inputs/7274-WORD.json.gz b/research/p104-first-receiver-contraction-bound/inputs/7274-WORD.json.gz new file mode 100644 index 0000000000..8701c521b5 Binary files /dev/null and b/research/p104-first-receiver-contraction-bound/inputs/7274-WORD.json.gz differ diff --git a/research/p104-first-receiver-contraction-bound/inputs/7334-WORD.json.gz b/research/p104-first-receiver-contraction-bound/inputs/7334-WORD.json.gz new file mode 100644 index 0000000000..73f4300719 Binary files /dev/null and b/research/p104-first-receiver-contraction-bound/inputs/7334-WORD.json.gz differ diff --git a/research/p104-first-receiver-contraction-bound/inputs/ADMITTED.json b/research/p104-first-receiver-contraction-bound/inputs/ADMITTED.json new file mode 100644 index 0000000000..464c89e45c --- /dev/null +++ b/research/p104-first-receiver-contraction-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-first-receiver-contraction-bound/inputs/PLAN.md b/research/p104-first-receiver-contraction-bound/inputs/PLAN.md new file mode 100644 index 0000000000..fc23b540d7 --- /dev/null +++ b/research/p104-first-receiver-contraction-bound/inputs/PLAN.md @@ -0,0 +1,11 @@ +# R159 retained endpoint membership to one physical receiver + +Exact current comparator #7334 aaeec8c0acf01e99a5f331ef363a698d9c084ace and signed #7113 07a76c5e2738882c0cb322278e56f6cae3c9885d. Word gzip SHA256 4b9fd1187b34ed97c3ac0c760d73531735a5d0ebc5b4d4ab4377160b20d9bb2a. The retained #7274 ff79af7a208132e16d51ceca3e1428444894367e word gzip SHA256 66bc395b599bc0b805c5061bbbd124e2027ad86645c07abe40d0b472fa1a7a2b and Round 29 complex/RESULT.json SHA256 6fa36e6a2b618ad96a6e18389c165dc04f3f987b186d8ce33bdb82bed47ef5b5 record [42648,42695,"in_span",1060,5,0]. This is exact membership of the old mover's endpoint discrepancy in the union of available endpoint-chart donor rows, with 1,060 unit and five nonunit prefix basis rows recorded. It does not certify any intermediate receiver deadline or current support. This is the shortest of the 44 old memberships. R29 attempted only the distinct highest-marginal role965 interval [39511,41031], whose first chart9 receiver has an exact physical support blocker. Preserve that exclusion. + +Source-only literal readback matches six unique events in both native words. Public mover930 follows 3→652→657→649, ranks 2,4,1. The old MOVE clocks 42648/42690/42695 are current 42650/42692/42697. The old crossed ADDs 42649/42691/42693 are current 42651 ADD793←930 coefficient +1/2 at 652, 42693 ADD1473←930 coefficient −1 at 657, and 42695 ADD930←982 coefficient −1 at 657. The first receiver 793 next MOVEs 652→653 at current 42653. The last source read before the proposed old first lift is ADD1473←930 at 42649 on chart3. Keep its old clock. Direct 3→649 at 42650 leaves mover930 off chart652. Other paid paths and all ownership remain fixed. + +Exact current price from the retained R92 complete signed profile and #7298 tariff. Across 17 copies ΔP1=−17, ΔP2=−17, ΔP4=−17, ΔP7=+17, ΔT=0. Paid 110,485, productive 22,461, surplus 1424. One candidate is the complete selected stock. Optimistic complete margin at old upper crossing is enclosed by [0.4127144682830787,0.4127144682830788], and complete probe lower >0.4123270058096044. Fixed-target upper <−139.3135861810168. A single extra raw rank-one defeats the current one-edit price. No addition of other old memberships. + +First exact implementation, one candidate and one current cut/20 seconds: authenticate old receipt, current word and the six literal maps, then reuse the R147 exact signed coordinate tracer on input e930. At pre42651 compare the original required coefficient of +R930/2 to every legally live unchanged chart652 source at that same cut, excluding mover930 after its proposed direct lift. An all-zero bank and nonzero required coefficient excludes same-clock first receiver synthesis. A nonzero bank witness or zero target component leaves the key unresolved for an explicitly priced follow-up. Record literal phase/chart data and the next receiver deadline. Do not search the second receiver, later donor banks or another interval in this gate. If a rank-positive additional route is unavoidable at the original cut, its full price rules out this mechanism. No coordinate solver or candidate replay ran in the scout. + +#7334 changes public role319 and its chart207 component, with the six role930 source events distinct. #7338 screens single-helper two-MOVE compensated component fusion, while #7383 tests three-MOVE windows with roles1250/532/198 and fixed partners. #7312's inherited consecutive-pair common-lift gate can supply related constituent evidence. R29 supplies the original 44-target scope and exact physical negative on role965. Fresh live overlap remains required before launching. diff --git a/research/p104-first-receiver-contraction-bound/inputs/PR7362-SHA256.json b/research/p104-first-receiver-contraction-bound/inputs/PR7362-SHA256.json new file mode 100644 index 0000000000..b1486e0b5c --- /dev/null +++ b/research/p104-first-receiver-contraction-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-first-receiver-contraction-bound/inputs/R29-RESULT.json b/research/p104-first-receiver-contraction-bound/inputs/R29-RESULT.json new file mode 100644 index 0000000000..3bc8bd4d0e --- /dev/null +++ b/research/p104-first-receiver-contraction-bound/inputs/R29-RESULT.json @@ -0,0 +1,4791 @@ +{ + "caps": { + "cases": 517, + "pilot_cases": 96, + "pilot_seconds": 180, + "rows": 20000, + "seconds": 480, + "width": 64 + }, + "combined_exclusions": [ + [ + 32764, + 45694 + ], + [ + 36440, + 50020 + ], + [ + 37344, + 37371 + ], + [ + 38147, + 40309 + ], + [ + 38300, + 45885 + ], + [ + 38318, + 46088 + ], + [ + 38523, + 41877 + ], + [ + 38531, + 41895 + ], + [ + 38567, + 58079 + ], + [ + 38983, + 43369 + ], + [ + 39015, + 40947 + ], + [ + 39138, + 45768 + ], + [ + 39205, + 42962 + ], + [ + 39300, + 43222 + ], + [ + 39425, + 41473 + ], + [ + 39428, + 44126 + ], + [ + 39452, + 42340 + ], + [ + 39477, + 44304 + ], + [ + 39522, + 42784 + ], + [ + 39542, + 41880 + ], + [ + 39814, + 43140 + ], + [ + 39951, + 42801 + ], + [ + 40138, + 41847 + ], + [ + 40149, + 46179 + ], + [ + 40217, + 43421 + ], + [ + 40219, + 44276 + ], + [ + 40309, + 41847 + ], + [ + 40334, + 44079 + ], + [ + 40336, + 41101 + ], + [ + 40388, + 43272 + ], + [ + 40390, + 45015 + ], + [ + 40392, + 46003 + ], + [ + 40426, + 46200 + ], + [ + 40435, + 40441 + ], + [ + 40621, + 40634 + ], + [ + 40621, + 40643 + ], + [ + 40689, + 41402 + ], + [ + 40710, + 42801 + ], + [ + 40725, + 41095 + ], + [ + 40735, + 45780 + ], + [ + 41156, + 43101 + ], + [ + 41284, + 42116 + ], + [ + 41336, + 42123 + ], + [ + 41339, + 41344 + ], + [ + 41340, + 42113 + ], + [ + 41440, + 46175 + ], + [ + 41767, + 41776 + ], + [ + 41780, + 44664 + ], + [ + 42046, + 42051 + ], + [ + 42657, + 43922 + ], + [ + 42690, + 42710 + ], + [ + 42863, + 42869 + ], + [ + 42902, + 42915 + ], + [ + 43036, + 43098 + ] + ], + "further_exclusions_lower_bound": 147, + "head": "ff79af7a208132e16d51ceca3e1428444894367e", + "input_manifest": "638402337d17a3d5c937939bd25cc0f65d4dff30ee65b2dc023811df636e9218", + "input_paths": 93, + "new_exclusions": [], + "new_paid": { + "1": 2019, + "2": 1169, + "3": 857, + "4": 161, + "5": 307, + "6": 146, + "7": 68, + "8": 64, + "9": 4 + }, + "outcome_counts": { + "in_span": 44, + "width_cap": 52 + }, + "outcomes": [ + [ + 37832, + 49989, + "width_cap", + 83, + 2458, + 0 + ], + [ + 38670, + 45716, + "width_cap", + 1064, + 74, + 0 + ], + [ + 37195, + 54218, + "width_cap", + 91, + 6323, + 0 + ], + [ + 38394, + 52201, + "width_cap", + 95, + 4481, + 0 + ], + [ + 33896, + 46718, + "width_cap", + 1078, + 952, + 0 + ], + [ + 36445, + 56821, + "in_span", + 1118, + 8043, + 0 + ], + [ + 37851, + 49989, + "width_cap", + 82, + 2461, + 0 + ], + [ + 38147, + 41847, + "width_cap", + 2, + 33, + 0 + ], + [ + 34065, + 46508, + "width_cap", + 44, + 778, + 0 + ], + [ + 34361, + 46162, + "width_cap", + 41, + 441, + 0 + ], + [ + 37862, + 47397, + "width_cap", + 55, + 1328, + 0 + ], + [ + 37990, + 41044, + "in_span", + 1060, + 1, + 0 + ], + [ + 37997, + 45015, + "in_span", + 1060, + 1, + 0 + ], + [ + 37999, + 42784, + "in_span", + 1060, + 1, + 0 + ], + [ + 38001, + 43978, + "in_span", + 1060, + 4, + 0 + ], + [ + 38034, + 43033, + "in_span", + 1060, + 1, + 0 + ], + [ + 38044, + 41762, + "in_span", + 1060, + 1, + 0 + ], + [ + 38057, + 41038, + "in_span", + 1060, + 1, + 0 + ], + [ + 38059, + 45022, + "in_span", + 1060, + 4, + 0 + ], + [ + 38275, + 43942, + "in_span", + 1060, + 4, + 0 + ], + [ + 38283, + 44026, + "in_span", + 1060, + 4, + 0 + ], + [ + 38321, + 41101, + "in_span", + 1060, + 4, + 0 + ], + [ + 38328, + 45040, + "in_span", + 1060, + 4, + 0 + ], + [ + 38347, + 42718, + "in_span", + 1060, + 2, + 0 + ], + [ + 38349, + 45073, + "in_span", + 1060, + 5, + 0 + ], + [ + 38360, + 43924, + "in_span", + 1060, + 4, + 0 + ], + [ + 38362, + 43003, + "in_span", + 1060, + 1, + 0 + ], + [ + 39890, + 43272, + "in_span", + 1060, + 1, + 0 + ], + [ + 42648, + 42710, + "in_span", + 1060, + 1, + 0 + ], + [ + 38101, + 56843, + "width_cap", + 115, + 8343, + 0 + ], + [ + 38104, + 56847, + "width_cap", + 115, + 8346, + 0 + ], + [ + 40964, + 45716, + "width_cap", + 24, + 96, + 0 + ], + [ + 32585, + 49991, + "width_cap", + 83, + 2464, + 0 + ], + [ + 35419, + 41880, + "in_span", + 1060, + 1, + 0 + ], + [ + 37831, + 48130, + "width_cap", + 62, + 1612, + 0 + ], + [ + 38266, + 40947, + "in_span", + 1060, + 1, + 0 + ], + [ + 39511, + 41031, + "in_span", + 1060, + 1, + 0 + ], + [ + 33975, + 54199, + "width_cap", + 89, + 6319, + 0 + ], + [ + 35168, + 48041, + "width_cap", + 60, + 1577, + 0 + ], + [ + 35175, + 51326, + "width_cap", + 85, + 3624, + 0 + ], + [ + 36792, + 48846, + "width_cap", + 71, + 1927, + 0 + ], + [ + 36981, + 54210, + "width_cap", + 89, + 6324, + 0 + ], + [ + 37223, + 54218, + "width_cap", + 89, + 6328, + 0 + ], + [ + 37497, + 48071, + "width_cap", + 59, + 1592, + 0 + ], + [ + 37644, + 47475, + "width_cap", + 55, + 1356, + 0 + ], + [ + 38812, + 48134, + "width_cap", + 61, + 1616, + 0 + ], + [ + 40954, + 46444, + "width_cap", + 42, + 747, + 0 + ], + [ + 40140, + 57201, + "width_cap", + 122, + 8646, + 0 + ], + [ + 40612, + 46133, + "width_cap", + 39, + 425, + 0 + ], + [ + 42650, + 46183, + "width_cap", + 41, + 467, + 0 + ], + [ + 34008, + 46240, + "width_cap", + 40, + 521, + 0 + ], + [ + 34082, + 46247, + "width_cap", + 40, + 528, + 0 + ], + [ + 38147, + 40317, + "width_cap", + 2, + 27, + 0 + ], + [ + 39039, + 45941, + "width_cap", + 37, + 232, + 0 + ], + [ + 40435, + 42734, + "width_cap", + 2, + 8, + 0 + ], + [ + 41107, + 47380, + "width_cap", + 54, + 1322, + 0 + ], + [ + 42654, + 42724, + "width_cap", + 2, + 8, + 0 + ], + [ + 42928, + 46587, + "width_cap", + 43, + 860, + 0 + ], + [ + 42977, + 49989, + "width_cap", + 82, + 2459, + 0 + ], + [ + 43053, + 45916, + "width_cap", + 37, + 207, + 0 + ], + [ + 43791, + 46603, + "width_cap", + 43, + 875, + 0 + ], + [ + 32597, + 44200, + "in_span", + 1060, + 5, + 0 + ], + [ + 33183, + 44161, + "in_span", + 1060, + 4, + 0 + ], + [ + 37919, + 43140, + "in_span", + 1060, + 1, + 0 + ], + [ + 37973, + 44852, + "in_span", + 1060, + 1, + 0 + ], + [ + 38040, + 43222, + "in_span", + 1060, + 1, + 0 + ], + [ + 38250, + 42340, + "in_span", + 1060, + 1, + 0 + ], + [ + 38254, + 44730, + "in_span", + 1060, + 7, + 0 + ], + [ + 38258, + 44466, + "in_span", + 1060, + 4, + 0 + ], + [ + 38262, + 44399, + "in_span", + 1060, + 1, + 0 + ], + [ + 38337, + 43219, + "in_span", + 1060, + 1, + 0 + ], + [ + 38339, + 43454, + "in_span", + 1060, + 3, + 0 + ], + [ + 38341, + 41759, + "in_span", + 1060, + 1, + 0 + ], + [ + 38345, + 43440, + "in_span", + 1060, + 1, + 0 + ], + [ + 38351, + 44906, + "in_span", + 1060, + 4, + 0 + ], + [ + 38407, + 41892, + "in_span", + 1060, + 1, + 0 + ], + [ + 39544, + 41402, + "in_span", + 1060, + 1, + 0 + ], + [ + 39631, + 43874, + "in_span", + 1060, + 1, + 0 + ], + [ + 40053, + 41527, + "in_span", + 1060, + 1, + 0 + ], + [ + 41079, + 43101, + "in_span", + 1060, + 1, + 0 + ], + [ + 41731, + 44664, + "in_span", + 1060, + 1, + 0 + ], + [ + 32031, + 47099, + "width_cap", + 48, + 1208, + 0 + ], + [ + 34069, + 46508, + "width_cap", + 42, + 781, + 0 + ], + [ + 34365, + 46162, + "width_cap", + 39, + 444, + 0 + ], + [ + 36618, + 45669, + "width_cap", + 19, + 23, + 0 + ], + [ + 37850, + 38863, + "width_cap", + 6, + 11, + 0 + ], + [ + 37862, + 38851, + "width_cap", + 3, + 31, + 0 + ], + [ + 38066, + 48193, + "width_cap", + 62, + 1645, + 0 + ], + [ + 38983, + 46751, + "width_cap", + 46, + 1021, + 0 + ], + [ + 39036, + 46887, + "width_cap", + 47, + 1126, + 0 + ], + [ + 39513, + 46517, + "width_cap", + 45, + 791, + 0 + ], + [ + 39890, + 40396, + "in_span", + 1060, + 5, + 0 + ], + [ + 40360, + 47251, + "width_cap", + 51, + 1278, + 0 + ], + [ + 40423, + 46200, + "width_cap", + 39, + 490, + 0 + ], + [ + 42648, + 42695, + "in_span", + 1060, + 5, + 0 + ], + [ + 39129, + 48097, + "width_cap", + 60, + 1598, + 0 + ] + ], + "pilot": { + "cases": 96, + "decision": "pivot", + "directed_reduction": "0", + "hits": 0 + }, + "prefix_subsequences": 96, + "prior_margin": "735490584293668366874515833/10000000000000000000000000", + "prior_necessary_exclusions": 147, + "raw_upper": "735490584293668366874515833/10000000000000000000000000", + "saving_upper": "2138179516775143035620207047/10000000000000000000000000", + "scope": 517, + "site_tests": 0, + "status": "POSITIVE_OR_INCOMPLETE_STOCK_UPPER", + "stop_reason": "pilot rate gate", + "target": "10018846261809/2500000000000000", + "unresolved_ids": [ + [ + 29001, + 56489 + ], + [ + 29008, + 48313 + ], + [ + 29656, + 29803 + ], + [ + 29662, + 29720 + ], + [ + 29705, + 46177 + ], + [ + 29711, + 29724 + ], + [ + 29716, + 46177 + ], + [ + 29778, + 29871 + ], + [ + 29928, + 29954 + ], + [ + 29935, + 42201 + ], + [ + 29957, + 48925 + ], + [ + 30015, + 47859 + ], + [ + 30019, + 47859 + ], + [ + 31763, + 47504 + ], + [ + 32031, + 47099 + ], + [ + 32197, + 32214 + ], + [ + 32197, + 41251 + ], + [ + 32213, + 45672 + ], + [ + 32431, + 36883 + ], + [ + 32533, + 57941 + ], + [ + 32585, + 49991 + ], + [ + 32597, + 44200 + ], + [ + 32749, + 45935 + ], + [ + 32768, + 47085 + ], + [ + 33183, + 44161 + ], + [ + 33187, + 45520 + ], + [ + 33188, + 44161 + ], + [ + 33353, + 50562 + ], + [ + 33593, + 51947 + ], + [ + 33695, + 46055 + ], + [ + 33724, + 37106 + ], + [ + 33730, + 46569 + ], + [ + 33842, + 37373 + ], + [ + 33853, + 51780 + ], + [ + 33896, + 46718 + ], + [ + 33975, + 38138 + ], + [ + 33975, + 54199 + ], + [ + 34005, + 45887 + ], + [ + 34008, + 46240 + ], + [ + 34065, + 46508 + ], + [ + 34069, + 46508 + ], + [ + 34077, + 46508 + ], + [ + 34082, + 46247 + ], + [ + 34143, + 34432 + ], + [ + 34283, + 34340 + ], + [ + 34289, + 47455 + ], + [ + 34305, + 46908 + ], + [ + 34322, + 46004 + ], + [ + 34323, + 56424 + ], + [ + 34331, + 46201 + ], + [ + 34333, + 46960 + ], + [ + 34361, + 46162 + ], + [ + 34364, + 35341 + ], + [ + 34365, + 46162 + ], + [ + 34529, + 36062 + ], + [ + 34564, + 46162 + ], + [ + 34622, + 50281 + ], + [ + 34645, + 37112 + ], + [ + 34651, + 47099 + ], + [ + 34727, + 51964 + ], + [ + 34789, + 46174 + ], + [ + 34867, + 45976 + ], + [ + 34917, + 51969 + ], + [ + 35168, + 48041 + ], + [ + 35171, + 48041 + ], + [ + 35175, + 51326 + ], + [ + 35178, + 51326 + ], + [ + 35181, + 47455 + ], + [ + 35188, + 46908 + ], + [ + 35191, + 47451 + ], + [ + 35194, + 47451 + ], + [ + 35198, + 49995 + ], + [ + 35272, + 35312 + ], + [ + 35299, + 35309 + ], + [ + 35302, + 46972 + ], + [ + 35337, + 46972 + ], + [ + 35417, + 41685 + ], + [ + 35419, + 41880 + ], + [ + 36035, + 36059 + ], + [ + 36054, + 36079 + ], + [ + 36064, + 47416 + ], + [ + 36082, + 47416 + ], + [ + 36407, + 56232 + ], + [ + 36410, + 56232 + ], + [ + 36421, + 45538 + ], + [ + 36445, + 56821 + ], + [ + 36618, + 36649 + ], + [ + 36618, + 45669 + ], + [ + 36621, + 36647 + ], + [ + 36624, + 36636 + ], + [ + 36645, + 45672 + ], + [ + 36649, + 45669 + ], + [ + 36780, + 57607 + ], + [ + 36783, + 37887 + ], + [ + 36789, + 47944 + ], + [ + 36792, + 48846 + ], + [ + 36795, + 46515 + ], + [ + 36798, + 57935 + ], + [ + 36801, + 57935 + ], + [ + 36804, + 37887 + ], + [ + 36806, + 46515 + ], + [ + 36807, + 57941 + ], + [ + 36809, + 48846 + ], + [ + 36814, + 47944 + ], + [ + 36817, + 57607 + ], + [ + 36896, + 57113 + ], + [ + 36916, + 57113 + ], + [ + 36981, + 54210 + ], + [ + 36987, + 47568 + ], + [ + 37004, + 54210 + ], + [ + 37007, + 47568 + ], + [ + 37086, + 37109 + ], + [ + 37195, + 54218 + ], + [ + 37223, + 54218 + ], + [ + 37238, + 54218 + ], + [ + 37241, + 48317 + ], + [ + 37247, + 48317 + ], + [ + 37347, + 47095 + ], + [ + 37350, + 47095 + ], + [ + 37497, + 37892 + ], + [ + 37497, + 48071 + ], + [ + 37516, + 54199 + ], + [ + 37518, + 37892 + ], + [ + 37518, + 48071 + ], + [ + 37627, + 39042 + ], + [ + 37644, + 47475 + ], + [ + 37645, + 39042 + ], + [ + 37660, + 47475 + ], + [ + 37831, + 48130 + ], + [ + 37832, + 49989 + ], + [ + 37850, + 38863 + ], + [ + 37851, + 49989 + ], + [ + 37856, + 48130 + ], + [ + 37859, + 37877 + ], + [ + 37862, + 37873 + ], + [ + 37862, + 38851 + ], + [ + 37862, + 47397 + ], + [ + 37865, + 48130 + ], + [ + 37871, + 38863 + ], + [ + 37873, + 38851 + ], + [ + 37873, + 47397 + ], + [ + 37886, + 58900 + ], + [ + 37890, + 48226 + ], + [ + 37892, + 48071 + ], + [ + 37894, + 54210 + ], + [ + 37896, + 46124 + ], + [ + 37899, + 54198 + ], + [ + 37901, + 54218 + ], + [ + 37905, + 54203 + ], + [ + 37915, + 47475 + ], + [ + 37919, + 43140 + ], + [ + 37973, + 44852 + ], + [ + 37976, + 39514 + ], + [ + 37981, + 49269 + ], + [ + 37990, + 41044 + ], + [ + 37995, + 54214 + ], + [ + 37997, + 45015 + ], + [ + 37999, + 42784 + ], + [ + 38001, + 43978 + ], + [ + 38034, + 43033 + ], + [ + 38040, + 43222 + ], + [ + 38044, + 41762 + ], + [ + 38057, + 41038 + ], + [ + 38059, + 45022 + ], + [ + 38066, + 48193 + ], + [ + 38073, + 48348 + ], + [ + 38076, + 40456 + ], + [ + 38086, + 46850 + ], + [ + 38089, + 49219 + ], + [ + 38090, + 39779 + ], + [ + 38094, + 48108 + ], + [ + 38101, + 56843 + ], + [ + 38104, + 56847 + ], + [ + 38105, + 43662 + ], + [ + 38107, + 48193 + ], + [ + 38138, + 54199 + ], + [ + 38147, + 40317 + ], + [ + 38147, + 41847 + ], + [ + 38148, + 39962 + ], + [ + 38169, + 48172 + ], + [ + 38176, + 48834 + ], + [ + 38202, + 41446 + ], + [ + 38250, + 42340 + ], + [ + 38254, + 44730 + ], + [ + 38258, + 44466 + ], + [ + 38262, + 44399 + ], + [ + 38266, + 40947 + ], + [ + 38275, + 43942 + ], + [ + 38283, + 44026 + ], + [ + 38294, + 49211 + ], + [ + 38297, + 46087 + ], + [ + 38304, + 43942 + ], + [ + 38307, + 44026 + ], + [ + 38312, + 49211 + ], + [ + 38321, + 41101 + ], + [ + 38328, + 45040 + ], + [ + 38337, + 43219 + ], + [ + 38339, + 43454 + ], + [ + 38341, + 41759 + ], + [ + 38345, + 43440 + ], + [ + 38347, + 42718 + ], + [ + 38349, + 45073 + ], + [ + 38351, + 44906 + ], + [ + 38360, + 43924 + ], + [ + 38362, + 43003 + ], + [ + 38375, + 47952 + ], + [ + 38383, + 46646 + ], + [ + 38384, + 52740 + ], + [ + 38386, + 45634 + ], + [ + 38388, + 45632 + ], + [ + 38394, + 52201 + ], + [ + 38396, + 41773 + ], + [ + 38407, + 41892 + ], + [ + 38418, + 58004 + ], + [ + 38423, + 47191 + ], + [ + 38452, + 46486 + ], + [ + 38458, + 46518 + ], + [ + 38459, + 57341 + ], + [ + 38467, + 58079 + ], + [ + 38481, + 57592 + ], + [ + 38497, + 42079 + ], + [ + 38519, + 44399 + ], + [ + 38520, + 44466 + ], + [ + 38525, + 46561 + ], + [ + 38526, + 43450 + ], + [ + 38528, + 46575 + ], + [ + 38529, + 44730 + ], + [ + 38532, + 41892 + ], + [ + 38534, + 43454 + ], + [ + 38536, + 44852 + ], + [ + 38537, + 44906 + ], + [ + 38545, + 46850 + ], + [ + 38550, + 47191 + ], + [ + 38561, + 48108 + ], + [ + 38573, + 49219 + ], + [ + 38575, + 58004 + ], + [ + 38670, + 45716 + ], + [ + 38730, + 47312 + ], + [ + 38785, + 51326 + ], + [ + 38787, + 48041 + ], + [ + 38792, + 57220 + ], + [ + 38798, + 57616 + ], + [ + 38812, + 48134 + ], + [ + 38815, + 55987 + ], + [ + 38818, + 48134 + ], + [ + 38820, + 55987 + ], + [ + 38849, + 48134 + ], + [ + 38851, + 47397 + ], + [ + 38853, + 48126 + ], + [ + 38881, + 45022 + ], + [ + 38883, + 48348 + ], + [ + 38959, + 46172 + ], + [ + 38983, + 46751 + ], + [ + 39004, + 57222 + ], + [ + 39017, + 47060 + ], + [ + 39036, + 46887 + ], + [ + 39039, + 45941 + ], + [ + 39082, + 47243 + ], + [ + 39096, + 46988 + ], + [ + 39105, + 48707 + ], + [ + 39129, + 48097 + ], + [ + 39133, + 43978 + ], + [ + 39141, + 52275 + ], + [ + 39175, + 51791 + ], + [ + 39226, + 46887 + ], + [ + 39285, + 49991 + ], + [ + 39290, + 39504 + ], + [ + 39293, + 47358 + ], + [ + 39296, + 47358 + ], + [ + 39297, + 44849 + ], + [ + 39299, + 46127 + ], + [ + 39302, + 49991 + ], + [ + 39339, + 42660 + ], + [ + 39430, + 44200 + ], + [ + 39476, + 42396 + ], + [ + 39511, + 39898 + ], + [ + 39511, + 41031 + ], + [ + 39513, + 46517 + ], + [ + 39520, + 39898 + ], + [ + 39520, + 41031 + ], + [ + 39524, + 46517 + ], + [ + 39532, + 57592 + ], + [ + 39537, + 58894 + ], + [ + 39544, + 41402 + ], + [ + 39546, + 41880 + ], + [ + 39631, + 43874 + ], + [ + 39633, + 46843 + ], + [ + 39640, + 46843 + ], + [ + 39752, + 47199 + ], + [ + 39764, + 45390 + ], + [ + 39811, + 55953 + ], + [ + 39813, + 55953 + ], + [ + 39839, + 45315 + ], + [ + 39859, + 39868 + ], + [ + 39873, + 41773 + ], + [ + 39890, + 40396 + ], + [ + 39890, + 43272 + ], + [ + 39897, + 45786 + ], + [ + 39905, + 39930 + ], + [ + 39905, + 42721 + ], + [ + 39907, + 41044 + ], + [ + 40053, + 41527 + ], + [ + 40058, + 46976 + ], + [ + 40138, + 40317 + ], + [ + 40140, + 57201 + ], + [ + 40143, + 48407 + ], + [ + 40150, + 57345 + ], + [ + 40157, + 45832 + ], + [ + 40255, + 47637 + ], + [ + 40260, + 47329 + ], + [ + 40263, + 56927 + ], + [ + 40266, + 47637 + ], + [ + 40309, + 40317 + ], + [ + 40311, + 45040 + ], + [ + 40313, + 57201 + ], + [ + 40316, + 45760 + ], + [ + 40338, + 48407 + ], + [ + 40360, + 47251 + ], + [ + 40388, + 40396 + ], + [ + 40395, + 45782 + ], + [ + 40423, + 46200 + ], + [ + 40435, + 42734 + ], + [ + 40438, + 41038 + ], + [ + 40443, + 47712 + ], + [ + 40517, + 46358 + ], + [ + 40532, + 48624 + ], + [ + 40612, + 46133 + ], + [ + 40615, + 46133 + ], + [ + 40624, + 41290 + ], + [ + 40629, + 46912 + ], + [ + 40633, + 48097 + ], + [ + 40677, + 53447 + ], + [ + 40682, + 46513 + ], + [ + 40688, + 46107 + ], + [ + 40691, + 41527 + ], + [ + 40693, + 46513 + ], + [ + 40694, + 49097 + ], + [ + 40698, + 56927 + ], + [ + 40701, + 53447 + ], + [ + 40712, + 42718 + ], + [ + 40717, + 45776 + ], + [ + 40724, + 45736 + ], + [ + 40725, + 40736 + ], + [ + 40727, + 45073 + ], + [ + 40746, + 40756 + ], + [ + 40746, + 44072 + ], + [ + 40750, + 47251 + ], + [ + 40830, + 55948 + ], + [ + 40831, + 57001 + ], + [ + 40918, + 45630 + ], + [ + 40932, + 42106 + ], + [ + 40940, + 41759 + ], + [ + 40942, + 45766 + ], + [ + 40954, + 45536 + ], + [ + 40954, + 46444 + ], + [ + 40964, + 45716 + ], + [ + 40970, + 44442 + ], + [ + 41005, + 46012 + ], + [ + 41006, + 43110 + ], + [ + 41079, + 43101 + ], + [ + 41081, + 48168 + ], + [ + 41098, + 48669 + ], + [ + 41107, + 47380 + ], + [ + 41112, + 44690 + ], + [ + 41137, + 46718 + ], + [ + 41165, + 43440 + ], + [ + 41172, + 43874 + ], + [ + 41210, + 46279 + ], + [ + 41238, + 49015 + ], + [ + 41246, + 49015 + ], + [ + 41248, + 44290 + ], + [ + 41254, + 45518 + ], + [ + 41260, + 44123 + ], + [ + 41262, + 47329 + ], + [ + 41287, + 48656 + ], + [ + 41302, + 43460 + ], + [ + 41342, + 43219 + ], + [ + 41385, + 45212 + ], + [ + 41458, + 46633 + ], + [ + 41463, + 46633 + ], + [ + 41494, + 46470 + ], + [ + 41496, + 50921 + ], + [ + 41502, + 45871 + ], + [ + 41569, + 41762 + ], + [ + 41594, + 52098 + ], + [ + 41597, + 56355 + ], + [ + 41607, + 47247 + ], + [ + 41658, + 49467 + ], + [ + 41661, + 49467 + ], + [ + 41670, + 44888 + ], + [ + 41675, + 46533 + ], + [ + 41677, + 46533 + ], + [ + 41710, + 47872 + ], + [ + 41712, + 47872 + ], + [ + 41731, + 44664 + ], + [ + 41733, + 48075 + ], + [ + 41736, + 48075 + ], + [ + 41752, + 46483 + ], + [ + 41766, + 45188 + ], + [ + 41766, + 47708 + ], + [ + 41808, + 46052 + ], + [ + 41858, + 44667 + ], + [ + 41866, + 52201 + ], + [ + 41868, + 52201 + ], + [ + 41939, + 46539 + ], + [ + 42014, + 46473 + ], + [ + 42019, + 46473 + ], + [ + 42037, + 42089 + ], + [ + 42042, + 46539 + ], + [ + 42055, + 48556 + ], + [ + 42072, + 46470 + ], + [ + 42263, + 48921 + ], + [ + 42293, + 49972 + ], + [ + 42296, + 56821 + ], + [ + 42307, + 50018 + ], + [ + 42325, + 48272 + ], + [ + 42405, + 49850 + ], + [ + 42429, + 47211 + ], + [ + 42434, + 44401 + ], + [ + 42453, + 47807 + ], + [ + 42541, + 48598 + ], + [ + 42547, + 50562 + ], + [ + 42558, + 46531 + ], + [ + 42619, + 46692 + ], + [ + 42623, + 43924 + ], + [ + 42628, + 46692 + ], + [ + 42630, + 47952 + ], + [ + 42648, + 42695 + ], + [ + 42648, + 42710 + ], + [ + 42650, + 46183 + ], + [ + 42653, + 42659 + ], + [ + 42653, + 47789 + ], + [ + 42654, + 42662 + ], + [ + 42654, + 42724 + ], + [ + 42659, + 47789 + ], + [ + 42664, + 46488 + ], + [ + 42667, + 46183 + ], + [ + 42678, + 45770 + ], + [ + 42689, + 45739 + ], + [ + 42690, + 42695 + ], + [ + 42692, + 42737 + ], + [ + 42694, + 45778 + ], + [ + 42764, + 43003 + ], + [ + 42769, + 47511 + ], + [ + 42847, + 48991 + ], + [ + 42849, + 48991 + ], + [ + 42862, + 45784 + ], + [ + 42896, + 46658 + ], + [ + 42904, + 46658 + ], + [ + 42906, + 46170 + ], + [ + 42922, + 50111 + ], + [ + 42924, + 50111 + ], + [ + 42928, + 46587 + ], + [ + 42956, + 57224 + ], + [ + 42969, + 56779 + ], + [ + 42972, + 48899 + ], + [ + 42977, + 49989 + ], + [ + 43011, + 46573 + ], + [ + 43024, + 43033 + ], + [ + 43026, + 46109 + ], + [ + 43035, + 46572 + ], + [ + 43053, + 45916 + ], + [ + 43073, + 43076 + ], + [ + 43073, + 49989 + ], + [ + 43074, + 44401 + ], + [ + 43180, + 46823 + ], + [ + 43181, + 46402 + ], + [ + 43201, + 46071 + ], + [ + 43246, + 48756 + ], + [ + 43248, + 46433 + ], + [ + 43256, + 48531 + ], + [ + 43305, + 46095 + ], + [ + 43345, + 49880 + ], + [ + 43355, + 45475 + ], + [ + 43468, + 46152 + ], + [ + 43473, + 52204 + ], + [ + 43562, + 48531 + ], + [ + 43564, + 46460 + ], + [ + 43656, + 43662 + ], + [ + 43791, + 46603 + ], + [ + 43815, + 50020 + ], + [ + 43827, + 48272 + ], + [ + 43915, + 47074 + ], + [ + 43936, + 48215 + ], + [ + 43956, + 46718 + ], + [ + 44040, + 46362 + ], + [ + 44155, + 49374 + ], + [ + 44173, + 45982 + ], + [ + 44265, + 45568 + ], + [ + 44306, + 46437 + ], + [ + 44392, + 47305 + ], + [ + 44436, + 47615 + ], + [ + 44514, + 46759 + ], + [ + 44587, + 46066 + ], + [ + 44590, + 46068 + ], + [ + 44593, + 46390 + ], + [ + 44598, + 46377 + ], + [ + 44687, + 46266 + ], + [ + 44707, + 47431 + ], + [ + 44724, + 46762 + ], + [ + 44843, + 46411 + ], + [ + 44865, + 46419 + ], + [ + 44885, + 46787 + ], + [ + 44900, + 46784 + ], + [ + 44936, + 46433 + ], + [ + 44958, + 48756 + ], + [ + 44994, + 48714 + ], + [ + 45034, + 46332 + ], + [ + 45052, + 46441 + ], + [ + 45066, + 47993 + ], + [ + 45356, + 47439 + ], + [ + 45536, + 46444 + ], + [ + 45610, + 48718 + ], + [ + 45612, + 47962 + ], + [ + 45617, + 51320 + ], + [ + 45620, + 47927 + ], + [ + 45622, + 48846 + ] + ], + "unvisited_ids": [ + [ + 29001, + 56489 + ], + [ + 29008, + 48313 + ], + [ + 29656, + 29803 + ], + [ + 29662, + 29720 + ], + [ + 29705, + 46177 + ], + [ + 29711, + 29724 + ], + [ + 29716, + 46177 + ], + [ + 29778, + 29871 + ], + [ + 29928, + 29954 + ], + [ + 29935, + 42201 + ], + [ + 29957, + 48925 + ], + [ + 30015, + 47859 + ], + [ + 30019, + 47859 + ], + [ + 31763, + 47504 + ], + [ + 32197, + 32214 + ], + [ + 32197, + 41251 + ], + [ + 32213, + 45672 + ], + [ + 32431, + 36883 + ], + [ + 32533, + 57941 + ], + [ + 32749, + 45935 + ], + [ + 32768, + 47085 + ], + [ + 33187, + 45520 + ], + [ + 33188, + 44161 + ], + [ + 33353, + 50562 + ], + [ + 33593, + 51947 + ], + [ + 33695, + 46055 + ], + [ + 33724, + 37106 + ], + [ + 33730, + 46569 + ], + [ + 33842, + 37373 + ], + [ + 33853, + 51780 + ], + [ + 33975, + 38138 + ], + [ + 34005, + 45887 + ], + [ + 34077, + 46508 + ], + [ + 34143, + 34432 + ], + [ + 34283, + 34340 + ], + [ + 34289, + 47455 + ], + [ + 34305, + 46908 + ], + [ + 34322, + 46004 + ], + [ + 34323, + 56424 + ], + [ + 34331, + 46201 + ], + [ + 34333, + 46960 + ], + [ + 34364, + 35341 + ], + [ + 34529, + 36062 + ], + [ + 34564, + 46162 + ], + [ + 34622, + 50281 + ], + [ + 34645, + 37112 + ], + [ + 34651, + 47099 + ], + [ + 34727, + 51964 + ], + [ + 34789, + 46174 + ], + [ + 34867, + 45976 + ], + [ + 34917, + 51969 + ], + [ + 35171, + 48041 + ], + [ + 35178, + 51326 + ], + [ + 35181, + 47455 + ], + [ + 35188, + 46908 + ], + [ + 35191, + 47451 + ], + [ + 35194, + 47451 + ], + [ + 35198, + 49995 + ], + [ + 35272, + 35312 + ], + [ + 35299, + 35309 + ], + [ + 35302, + 46972 + ], + [ + 35337, + 46972 + ], + [ + 35417, + 41685 + ], + [ + 36035, + 36059 + ], + [ + 36054, + 36079 + ], + [ + 36064, + 47416 + ], + [ + 36082, + 47416 + ], + [ + 36407, + 56232 + ], + [ + 36410, + 56232 + ], + [ + 36421, + 45538 + ], + [ + 36618, + 36649 + ], + [ + 36621, + 36647 + ], + [ + 36624, + 36636 + ], + [ + 36645, + 45672 + ], + [ + 36649, + 45669 + ], + [ + 36780, + 57607 + ], + [ + 36783, + 37887 + ], + [ + 36789, + 47944 + ], + [ + 36795, + 46515 + ], + [ + 36798, + 57935 + ], + [ + 36801, + 57935 + ], + [ + 36804, + 37887 + ], + [ + 36806, + 46515 + ], + [ + 36807, + 57941 + ], + [ + 36809, + 48846 + ], + [ + 36814, + 47944 + ], + [ + 36817, + 57607 + ], + [ + 36896, + 57113 + ], + [ + 36916, + 57113 + ], + [ + 36987, + 47568 + ], + [ + 37004, + 54210 + ], + [ + 37007, + 47568 + ], + [ + 37086, + 37109 + ], + [ + 37238, + 54218 + ], + [ + 37241, + 48317 + ], + [ + 37247, + 48317 + ], + [ + 37347, + 47095 + ], + [ + 37350, + 47095 + ], + [ + 37497, + 37892 + ], + [ + 37516, + 54199 + ], + [ + 37518, + 37892 + ], + [ + 37518, + 48071 + ], + [ + 37627, + 39042 + ], + [ + 37645, + 39042 + ], + [ + 37660, + 47475 + ], + [ + 37856, + 48130 + ], + [ + 37859, + 37877 + ], + [ + 37862, + 37873 + ], + [ + 37865, + 48130 + ], + [ + 37871, + 38863 + ], + [ + 37873, + 38851 + ], + [ + 37873, + 47397 + ], + [ + 37886, + 58900 + ], + [ + 37890, + 48226 + ], + [ + 37892, + 48071 + ], + [ + 37894, + 54210 + ], + [ + 37896, + 46124 + ], + [ + 37899, + 54198 + ], + [ + 37901, + 54218 + ], + [ + 37905, + 54203 + ], + [ + 37915, + 47475 + ], + [ + 37976, + 39514 + ], + [ + 37981, + 49269 + ], + [ + 37995, + 54214 + ], + [ + 38073, + 48348 + ], + [ + 38076, + 40456 + ], + [ + 38086, + 46850 + ], + [ + 38089, + 49219 + ], + [ + 38090, + 39779 + ], + [ + 38094, + 48108 + ], + [ + 38105, + 43662 + ], + [ + 38107, + 48193 + ], + [ + 38138, + 54199 + ], + [ + 38148, + 39962 + ], + [ + 38169, + 48172 + ], + [ + 38176, + 48834 + ], + [ + 38202, + 41446 + ], + [ + 38294, + 49211 + ], + [ + 38297, + 46087 + ], + [ + 38304, + 43942 + ], + [ + 38307, + 44026 + ], + [ + 38312, + 49211 + ], + [ + 38375, + 47952 + ], + [ + 38383, + 46646 + ], + [ + 38384, + 52740 + ], + [ + 38386, + 45634 + ], + [ + 38388, + 45632 + ], + [ + 38396, + 41773 + ], + [ + 38418, + 58004 + ], + [ + 38423, + 47191 + ], + [ + 38452, + 46486 + ], + [ + 38458, + 46518 + ], + [ + 38459, + 57341 + ], + [ + 38467, + 58079 + ], + [ + 38481, + 57592 + ], + [ + 38497, + 42079 + ], + [ + 38519, + 44399 + ], + [ + 38520, + 44466 + ], + [ + 38525, + 46561 + ], + [ + 38526, + 43450 + ], + [ + 38528, + 46575 + ], + [ + 38529, + 44730 + ], + [ + 38532, + 41892 + ], + [ + 38534, + 43454 + ], + [ + 38536, + 44852 + ], + [ + 38537, + 44906 + ], + [ + 38545, + 46850 + ], + [ + 38550, + 47191 + ], + [ + 38561, + 48108 + ], + [ + 38573, + 49219 + ], + [ + 38575, + 58004 + ], + [ + 38730, + 47312 + ], + [ + 38785, + 51326 + ], + [ + 38787, + 48041 + ], + [ + 38792, + 57220 + ], + [ + 38798, + 57616 + ], + [ + 38815, + 55987 + ], + [ + 38818, + 48134 + ], + [ + 38820, + 55987 + ], + [ + 38849, + 48134 + ], + [ + 38851, + 47397 + ], + [ + 38853, + 48126 + ], + [ + 38881, + 45022 + ], + [ + 38883, + 48348 + ], + [ + 38959, + 46172 + ], + [ + 39004, + 57222 + ], + [ + 39017, + 47060 + ], + [ + 39082, + 47243 + ], + [ + 39096, + 46988 + ], + [ + 39105, + 48707 + ], + [ + 39133, + 43978 + ], + [ + 39141, + 52275 + ], + [ + 39175, + 51791 + ], + [ + 39226, + 46887 + ], + [ + 39285, + 49991 + ], + [ + 39290, + 39504 + ], + [ + 39293, + 47358 + ], + [ + 39296, + 47358 + ], + [ + 39297, + 44849 + ], + [ + 39299, + 46127 + ], + [ + 39302, + 49991 + ], + [ + 39339, + 42660 + ], + [ + 39430, + 44200 + ], + [ + 39476, + 42396 + ], + [ + 39511, + 39898 + ], + [ + 39520, + 39898 + ], + [ + 39520, + 41031 + ], + [ + 39524, + 46517 + ], + [ + 39532, + 57592 + ], + [ + 39537, + 58894 + ], + [ + 39546, + 41880 + ], + [ + 39633, + 46843 + ], + [ + 39640, + 46843 + ], + [ + 39752, + 47199 + ], + [ + 39764, + 45390 + ], + [ + 39811, + 55953 + ], + [ + 39813, + 55953 + ], + [ + 39839, + 45315 + ], + [ + 39859, + 39868 + ], + [ + 39873, + 41773 + ], + [ + 39897, + 45786 + ], + [ + 39905, + 39930 + ], + [ + 39905, + 42721 + ], + [ + 39907, + 41044 + ], + [ + 40058, + 46976 + ], + [ + 40138, + 40317 + ], + [ + 40143, + 48407 + ], + [ + 40150, + 57345 + ], + [ + 40157, + 45832 + ], + [ + 40255, + 47637 + ], + [ + 40260, + 47329 + ], + [ + 40263, + 56927 + ], + [ + 40266, + 47637 + ], + [ + 40309, + 40317 + ], + [ + 40311, + 45040 + ], + [ + 40313, + 57201 + ], + [ + 40316, + 45760 + ], + [ + 40338, + 48407 + ], + [ + 40388, + 40396 + ], + [ + 40395, + 45782 + ], + [ + 40438, + 41038 + ], + [ + 40443, + 47712 + ], + [ + 40517, + 46358 + ], + [ + 40532, + 48624 + ], + [ + 40615, + 46133 + ], + [ + 40624, + 41290 + ], + [ + 40629, + 46912 + ], + [ + 40633, + 48097 + ], + [ + 40677, + 53447 + ], + [ + 40682, + 46513 + ], + [ + 40688, + 46107 + ], + [ + 40691, + 41527 + ], + [ + 40693, + 46513 + ], + [ + 40694, + 49097 + ], + [ + 40698, + 56927 + ], + [ + 40701, + 53447 + ], + [ + 40712, + 42718 + ], + [ + 40717, + 45776 + ], + [ + 40724, + 45736 + ], + [ + 40725, + 40736 + ], + [ + 40727, + 45073 + ], + [ + 40746, + 40756 + ], + [ + 40746, + 44072 + ], + [ + 40750, + 47251 + ], + [ + 40830, + 55948 + ], + [ + 40831, + 57001 + ], + [ + 40918, + 45630 + ], + [ + 40932, + 42106 + ], + [ + 40940, + 41759 + ], + [ + 40942, + 45766 + ], + [ + 40954, + 45536 + ], + [ + 40970, + 44442 + ], + [ + 41005, + 46012 + ], + [ + 41006, + 43110 + ], + [ + 41081, + 48168 + ], + [ + 41098, + 48669 + ], + [ + 41112, + 44690 + ], + [ + 41137, + 46718 + ], + [ + 41165, + 43440 + ], + [ + 41172, + 43874 + ], + [ + 41210, + 46279 + ], + [ + 41238, + 49015 + ], + [ + 41246, + 49015 + ], + [ + 41248, + 44290 + ], + [ + 41254, + 45518 + ], + [ + 41260, + 44123 + ], + [ + 41262, + 47329 + ], + [ + 41287, + 48656 + ], + [ + 41302, + 43460 + ], + [ + 41342, + 43219 + ], + [ + 41385, + 45212 + ], + [ + 41458, + 46633 + ], + [ + 41463, + 46633 + ], + [ + 41494, + 46470 + ], + [ + 41496, + 50921 + ], + [ + 41502, + 45871 + ], + [ + 41569, + 41762 + ], + [ + 41594, + 52098 + ], + [ + 41597, + 56355 + ], + [ + 41607, + 47247 + ], + [ + 41658, + 49467 + ], + [ + 41661, + 49467 + ], + [ + 41670, + 44888 + ], + [ + 41675, + 46533 + ], + [ + 41677, + 46533 + ], + [ + 41710, + 47872 + ], + [ + 41712, + 47872 + ], + [ + 41733, + 48075 + ], + [ + 41736, + 48075 + ], + [ + 41752, + 46483 + ], + [ + 41766, + 45188 + ], + [ + 41766, + 47708 + ], + [ + 41808, + 46052 + ], + [ + 41858, + 44667 + ], + [ + 41866, + 52201 + ], + [ + 41868, + 52201 + ], + [ + 41939, + 46539 + ], + [ + 42014, + 46473 + ], + [ + 42019, + 46473 + ], + [ + 42037, + 42089 + ], + [ + 42042, + 46539 + ], + [ + 42055, + 48556 + ], + [ + 42072, + 46470 + ], + [ + 42263, + 48921 + ], + [ + 42293, + 49972 + ], + [ + 42296, + 56821 + ], + [ + 42307, + 50018 + ], + [ + 42325, + 48272 + ], + [ + 42405, + 49850 + ], + [ + 42429, + 47211 + ], + [ + 42434, + 44401 + ], + [ + 42453, + 47807 + ], + [ + 42541, + 48598 + ], + [ + 42547, + 50562 + ], + [ + 42558, + 46531 + ], + [ + 42619, + 46692 + ], + [ + 42623, + 43924 + ], + [ + 42628, + 46692 + ], + [ + 42630, + 47952 + ], + [ + 42653, + 42659 + ], + [ + 42653, + 47789 + ], + [ + 42654, + 42662 + ], + [ + 42659, + 47789 + ], + [ + 42664, + 46488 + ], + [ + 42667, + 46183 + ], + [ + 42678, + 45770 + ], + [ + 42689, + 45739 + ], + [ + 42690, + 42695 + ], + [ + 42692, + 42737 + ], + [ + 42694, + 45778 + ], + [ + 42764, + 43003 + ], + [ + 42769, + 47511 + ], + [ + 42847, + 48991 + ], + [ + 42849, + 48991 + ], + [ + 42862, + 45784 + ], + [ + 42896, + 46658 + ], + [ + 42904, + 46658 + ], + [ + 42906, + 46170 + ], + [ + 42922, + 50111 + ], + [ + 42924, + 50111 + ], + [ + 42956, + 57224 + ], + [ + 42969, + 56779 + ], + [ + 42972, + 48899 + ], + [ + 43011, + 46573 + ], + [ + 43024, + 43033 + ], + [ + 43026, + 46109 + ], + [ + 43035, + 46572 + ], + [ + 43073, + 43076 + ], + [ + 43073, + 49989 + ], + [ + 43074, + 44401 + ], + [ + 43180, + 46823 + ], + [ + 43181, + 46402 + ], + [ + 43201, + 46071 + ], + [ + 43246, + 48756 + ], + [ + 43248, + 46433 + ], + [ + 43256, + 48531 + ], + [ + 43305, + 46095 + ], + [ + 43345, + 49880 + ], + [ + 43355, + 45475 + ], + [ + 43468, + 46152 + ], + [ + 43473, + 52204 + ], + [ + 43562, + 48531 + ], + [ + 43564, + 46460 + ], + [ + 43656, + 43662 + ], + [ + 43815, + 50020 + ], + [ + 43827, + 48272 + ], + [ + 43915, + 47074 + ], + [ + 43936, + 48215 + ], + [ + 43956, + 46718 + ], + [ + 44040, + 46362 + ], + [ + 44155, + 49374 + ], + [ + 44173, + 45982 + ], + [ + 44265, + 45568 + ], + [ + 44306, + 46437 + ], + [ + 44392, + 47305 + ], + [ + 44436, + 47615 + ], + [ + 44514, + 46759 + ], + [ + 44587, + 46066 + ], + [ + 44590, + 46068 + ], + [ + 44593, + 46390 + ], + [ + 44598, + 46377 + ], + [ + 44687, + 46266 + ], + [ + 44707, + 47431 + ], + [ + 44724, + 46762 + ], + [ + 44843, + 46411 + ], + [ + 44865, + 46419 + ], + [ + 44885, + 46787 + ], + [ + 44900, + 46784 + ], + [ + 44936, + 46433 + ], + [ + 44958, + 48756 + ], + [ + 44994, + 48714 + ], + [ + 45034, + 46332 + ], + [ + 45052, + 46441 + ], + [ + 45066, + 47993 + ], + [ + 45356, + 47439 + ], + [ + 45536, + 46444 + ], + [ + 45610, + 48718 + ], + [ + 45612, + 47962 + ], + [ + 45617, + 51320 + ], + [ + 45620, + 47927 + ], + [ + 45622, + 48846 + ] + ], + "visited": 96 +} diff --git a/research/p104-first-receiver-contraction-bound/inputs/R92-PRICE.json.gz b/research/p104-first-receiver-contraction-bound/inputs/R92-PRICE.json.gz new file mode 100644 index 0000000000..0307eb95e2 Binary files /dev/null and b/research/p104-first-receiver-contraction-bound/inputs/R92-PRICE.json.gz differ diff --git a/research/p104-first-receiver-contraction-bound/inputs/aggregate.py b/research/p104-first-receiver-contraction-bound/inputs/aggregate.py new file mode 100644 index 0000000000..c040962092 --- /dev/null +++ b/research/p104-first-receiver-contraction-bound/inputs/aggregate.py @@ -0,0 +1,164 @@ +"""Test the two fixed public endpoint banks for the literal role-532 aggregate.""" +from fractions import Fraction as Q +from gzip import decompress +from hashlib import sha256 +from json import dumps, loads +from pathlib import Path +from runpy import run_path +import sys +from time import monotonic + +ROOT = Path(__file__).resolve().parents[1] +HEAD = "aaeec8c0acf01e99a5f331ef363a698d9c084ace" +CALLER = "07a76c5e2738882c0cb322278e56f6cae3c9885d" +PAYLOAD = "9aa8d6b054ba7eb2289d052c1079b16be518d2f0fbfb244569fa18e3733acdac" +PINS = { + "inputs/7334-WORD.json.gz": "4b9fd1187b34ed97c3ac0c760d73531735a5d0ebc5b4d4ab4377160b20d9bb2a", + "inputs/R130-PRICE.json": "d9074aad58d3ffdad995ba68b2ffa541ae2b7df833b757d8e1a9767118140f39", + "inputs/donor_span.py": "4d5306e2c0b7e91c79d22c82e8e760aed2c311979298c558e631975d4d1ae5b1", +} +ROLE = 532 +BANKS = ((44611, 3, ROLE), (44612, 207, ROLE)) +SOURCES = ((41177, 363, Q(1), 744), (41179, 452, Q(-2), 746)) + + +def unique(pairs): + obj = dict(pairs) + if len(obj) != len(pairs): + raise ValueError("duplicate JSON key") + return obj + + +def read(path): + data = (ROOT / path).read_bytes() + if sha256(data).hexdigest() != PINS[path]: + raise ValueError(f"changed dependency {path}") + return data + + +def invoice(): + old = loads(read("inputs/R130-PRICE.json"), object_pairs_hook=unique) + assert old["head"] == HEAD and old["caller"] == CALLER + assert old["word_sha256"] == PINS["inputs/7334-WORD.json.gz"] + by_role = {p["role"]: p for p in old["candidates"] if all(e[1] == p["role"] for _, e in p["contacts"])} + assert set(by_role) == {198, ROLE} + lead = by_role[ROLE] + assert lead["clocks"] == [41176, 41178, 44611] and lead["charts"] == [3, 744, 746, 207] + assert lead["contacts"] == [[t, ["ADD", ROLE, s, str(q), c]] for t, s, q, c in SOURCES] + assert lead["paid_delta"] == {"2": -17, "3": -34, "8": 17} + assert 0 < Q(lead["probe_lower"]) <= Q(lead["raw_upper"]) < 1 + return dict(head=HEAD, caller=CALLER, pins=PINS, candidate=lead, + compatible_cap=2, gross_upper=str(sum(Q(p["raw_upper"]) for p in by_role.values())), + paid=old["after_paid_one"], productive=old["productive"], surplus=old["surplus"], + selected_banks=[list(k) for k in BANKS], unresolved_role198=[42533,42599,44596]) + + +def exact_span(target, bank, deadline, helpers): + absent = set(target).difference(*(row.keys() for row in bank.values())) + if absent: + i = min(absent) + return dict(decision="outside donor span", separator={i: "1"}, separator_value=str(target[i]), + absent_coordinates=sorted(absent)) + # Row elimination, then transpose the reduction onto one nonzero residual coordinate. + axpy = helpers["axpy"] + basis = {} + for role, vector in sorted(bank.items()): + if monotonic() >= deadline: + return None + row, weights = vector.copy(), {role: Q(1)} + helpers["reduce_row"](row, basis, weights, -1) + if row: + i = min(row) + factor = row[i] + basis[i] = ({j: a / factor for j, a in row.items()}, {j: a / factor for j, a in weights.items()}) + row, weights = target.copy(), {} + helpers["reduce_row"](row, basis, weights, 1) + if not row: + check = {} + for role, q in weights.items(): + axpy(check, bank[role], q) + assert check == target + return dict(decision="exact span survivor", rank=len(basis), + coefficients={i: str(q) for i, q in weights.items()}) + i = min(row) + dual = {i: Q(1)} + for pivot, (vector, _) in sorted(basis.items(), reverse=True): + value = sum(q * dual.get(j, 0) for j, q in vector.items()) + if value: + dual[pivot] = dual.get(pivot, 0) - value + if not dual[pivot]: + del dual[pivot] + def dot(vector): + return sum(q * vector.get(j, 0) for j, q in dual.items()) + assert all(dot(v) == 0 for v in bank.values()) and dot(target) == row[i] + return dict(decision="outside donor span", rank=len(basis), + separator={j: str(q) for j, q in dual.items()}, separator_value=str(dot(target))) + + +def controls(helpers): + d = monotonic() + 1 + bank = {7: {0: Q(1), 1: Q(1)}, 8: {1: Q(2)}} + assert exact_span({0: Q(3)}, bank, d, helpers)["coefficients"] == {7: "3", 8: "-3/2"} + assert exact_span({0: Q(3), 2: Q(1)}, bank, d, helpers)["separator"] == {2: "1"} + covector = exact_span({0: Q(1)}, {7: bank[7]}, d, helpers) + assert covector["separator"] == {0: "-1", 1: "1"} and covector["separator_value"] == "-1" + return ["two donor exact aggregate", "exterior-coordinate perturbation", "same-support covector separation"] + + +def main(): + assert __debug__ + price = invoice() + if sys.argv[1:] == ["--price-only"]: + print(dumps(price, sort_keys=True, indent=2)) + return + assert not sys.argv[1:] + deadline = monotonic() + 18 + read("inputs/donor_span.py") + helpers = run_path(str(ROOT / "inputs/donor_span.py")) + control = controls(helpers) + raw = decompress(read("inputs/7334-WORD.json.gz")) + assert sha256(raw).hexdigest() == PAYLOAD + word = loads(raw, object_pairs_hook=unique) + program = word["program"] + assert len(program) == 76466 + paid = price["candidate"] + a, b, c = paid["clocks"] + charts = paid["charts"] + assert [program[t] for t in (a, b, c)] == [ + ["MOVE", ROLE, x, y, False] for x, y in zip(charts[:-1], charts[1:], strict=True) + ] + selected = set() + for t in range(a + 1, c): + if t == b: + continue + e = program[t] + if ROLE in (e[1:3] if e[0] in {"ADD", "COPY"} else e[1:2]): + selected.add(t) + assert selected == {t for t, *_ in SOURCES} + assert all(program[t] == ["ADD", ROLE, s, str(q), chart] for t, s, q, chart in SOURCES) + req = {cut: {(chart, role)} for cut, chart, role in BANKS} + refs = {t: {s} for t, s, *_ in SOURCES} + banks, values = helpers["snapshot"](word, req, refs, deadline) + rows, aggregate = [], {} + if all((t, s) in values for t, s, *_ in SOURCES): + for t, s, q, _ in SOURCES: + helpers["axpy"](aggregate, values[t, s], q) + for key in BANKS: + if key not in banks or monotonic() >= deadline: + break + bank = {i: row for i, row in banks[key].items() if i < word["public"]} + result = exact_span(aggregate, bank, deadline, helpers) + if result is None: + break + rows.append(dict(key=list(key), bank_roles=sorted(bank), **result)) + unvisited = [list(k) for k in BANKS[len(rows):]] + print(dumps(dict(head=HEAD, caller=CALLER, pins=PINS, price=price, + aggregate={i: str(a) for i, a in aggregate.items()}, + controls=control, rows=rows, unvisited=unvisited, + role198_status="outside this two-bank scope"), sort_keys=True, indent=2)) + if unvisited: + raise SystemExit(2) + + +if __name__ == "__main__": + main() diff --git a/research/p104-first-receiver-contraction-bound/inputs/donor_span.py b/research/p104-first-receiver-contraction-bound/inputs/donor_span.py new file mode 100644 index 0000000000..46e4621b69 --- /dev/null +++ b/research/p104-first-receiver-contraction-bound/inputs/donor_span.py @@ -0,0 +1,169 @@ +"""Match the literal ADD source using other live rows in the retimed chart.""" +from collections import Counter, defaultdict +from fractions import Fraction as Q +from functools import cache +from gzip import decompress +from hashlib import sha256 +import json +from pathlib import Path +import sys +from time import monotonic + +HEAD="aaeec8c0acf01e99a5f331ef363a698d9c084ace" +WORD="4b9fd1187b34ed97c3ac0c760d73531735a5d0ebc5b4d4ab4377160b20d9bb2a" +PRICE="c9166ff18194a7e69f91a06f76329a2ff838bb65b08c4ed7a5a06038fdfa966d" + + +def checked(path,want,compressed=False): + raw=path.read_bytes() + if sha256(raw).hexdigest()!=want: + raise ValueError(f"changed dependency: {path.name}") + return json.loads(decompress(raw) if compressed else raw) + + +@cache +def scalar(x): + return Q(x) + + +def axpy(dst,src,c): + for k,a in src.items(): + value=dst.get(k,0)+c*a + if value: + dst[k]=value + else: + dst.pop(k,None) + + +def reduce_row(row,basis,weights,multiplier): + for k,(v,w) in sorted(basis.items()): + a=row.get(k,0) + if a: + axpy(row,v,-a) + axpy(weights,w,multiplier*a) + + +def solve(target,bank,deadline): + basis={} + for role,vector in sorted(bank.items()): + if monotonic()>=deadline: + return None + r=vector.copy() + w={role:Q(1)} + reduce_row(r,basis,w,-1) + if r: + k=min(r) + d=r[k] + basis[k]=({i:a/d for i,a in r.items()},{i:a/d for i,a in w.items()}) + residual=target.copy() + weights={} + reduce_row(residual,basis,weights,1) + rebuilt={} + for role,a in weights.items(): + axpy(rebuilt,bank[role],a) + axpy(rebuilt,residual,Q(1)) + assert rebuilt==target + return dict(rank=len(basis), residual={i:str(v) for i,v in residual.items()}, + matching_coefficients={i:str(v) for i,v in weights.items()} if not residual else None) + + +def snapshot(word,requested,targets,deadline): + public=word["public"] + active=word["initial"]+[None]*word["owned_fields"] + rows=[{i:Q(1)} for i in range(public)]+[None]*word["owned_fields"] + banks,values={},{} + stop=max(requested.keys()|targets.keys()) + for t,e in enumerate(word["program"]): + if t%64==0 and monotonic()>=deadline: + break + for chart,r in requested.get(t,()): + banks[t,chart,r]={i:rows[i].copy() for i in range(len(active)) if i!=r and active[i]==chart and rows[i]} + for s in targets.get(t,()): + assert active[s] is not None + values[t,s]=rows[s].copy() + if t==stop: + break + op,r,*args=e + if op=="MOVE": + assert active[r]==args[0] and args[2]==(r>=public) + active[r]=args[1] + elif op=="INIT": + assert active[r] is None and rows[r] is None and r>=public + active[r]=args[0] + rows[r]={} + elif op=="CLEAR": + assert active[r]==args[0] and rows[r] is not None and r>=public + active[r]=rows[r]=None + elif op=="SCALE": + assert active[r]==args[1] and scalar(args[0]) + rows[r]={i:v*scalar(args[0]) for i,v in rows[r].items()} + else: + s,k,chart=args + assert active[r]==active[s]==chart and r!=s and op in ("ADD","COPY") + if op=="COPY": + assert r>=public and not rows[r] + axpy(rows[r],rows[s],scalar(k)) + return banks,values + + +def controls(): + d=monotonic()+1 + a,b={0:Q(1),1:Q(1)},{1:Q(2)} + assert solve({0:Q(3)}, {7:a,8:b},d)["matching_coefficients"]=={7:"3",8:"-3/2"} + assert solve({2:Q(1)}, {7:a,8:b},d)["residual"]=={2:"1"} + assert solve({0:Q(3)}, {7:{0:Q(1),2:Q(1)},8:b},d)["residual"]=={2:"-3"} + assert solve({}, {7:a},d)["matching_coefficients"]=={} + return ["two-donor span","separating coordinate","changed donor row","zero source"] + + +def main(): + root=Path(sys.argv[1]) + price=checked(root/"price/PRICE.json",PRICE) + word=checked(root/"inputs/7334-WORD.json.gz",WORD,True) + assert price["head"]==HEAD and price["word_sha256"]==WORD + moves=word["program"] + req,targets=defaultdict(set),defaultdict(set) + bykey={} + for p in price["candidates"]: + r,s=p["owner"],p["peer"] + f,g=p["move_clocks"] + a,b,c=p["chart_path"] + t,add=p["literal_ADD"] + assert add[:2]==[r,s] and moves[t]==["ADD",*add] and f=deadline or (t,s) not in values or (cut,chart,r) not in banks: + pending.append(key) + continue + bank=banks[cut,chart,r] + source=values[t,s] + result=solve(source,bank,deadline) + if result is None: + pending.append(key) + continue + output.append(dict(key=key,source=[t,s],target_chart=chart,bank_roles=sorted(bank), + source_nnz=len(source),**result, + decision="exact span survivor" if result["matching_coefficients"] is not None else "outside donor span")) + print(json.dumps(dict(head=HEAD,price_sha256=PRICE,word_sha256=WORD,status="CAPPED" if pending else "EXHAUSTED", + case_cap=33,seconds_cap=18,controls=checks,counts=Counter(x["decision"] for x in output), + decisions=output,unvisited=pending,survivors=[x["key"] for x in output if x["matching_coefficients"] is not None]), + indent=2,sort_keys=True)) + + +if __name__=="__main__": + main() diff --git a/research/p104-first-receiver-contraction-bound/inputs/pricing.py b/research/p104-first-receiver-contraction-bound/inputs/pricing.py new file mode 100644 index 0000000000..40ec194017 --- /dev/null +++ b/research/p104-first-receiver-contraction-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-first-receiver-contraction-bound/inputs/reverse_span.py b/research/p104-first-receiver-contraction-bound/inputs/reverse_span.py new file mode 100644 index 0000000000..5efbeac87e --- /dev/null +++ b/research/p104-first-receiver-contraction-bound/inputs/reverse_span.py @@ -0,0 +1,393 @@ +"""Independent normalized reverse-contact and fraction-free donor-span gate.""" +from argparse import ArgumentParser +from collections import Counter, defaultdict +from fractions import Fraction +from functools import cache +from gzip import decompress +from hashlib import sha256 +from json import dumps, loads +from math import gcd, isqrt, lcm +from pathlib import Path +from signal import SIGALRM, alarm, signal +from time import monotonic + +HEAD = "aaeec8c0acf01e99a5f331ef363a698d9c084ace" +WORD = "4b9fd1187b34ed97c3ac0c760d73531735a5d0ebc5b4d4ab4377160b20d9bb2a" +PRICE = "c9166ff18194a7e69f91a06f76329a2ff838bb65b08c4ed7a5a06038fdfa966d" +PRIME = 65521 + + +def unique(pairs): + values = dict(pairs) + assert len(values) == len(pairs), "duplicate JSON key" + return values + + +def checked(path, pin, compressed=False): + raw = path.read_bytes() + if sha256(raw).hexdigest() != pin: + raise ValueError(f"changed input {path.name}") + return loads(decompress(raw) if compressed else raw, object_pairs_hook=unique) + + +@cache +def coefficient(raw): + q = Fraction(raw) + assert q and q.denominator % PRIME, "nonunit native denominator" + return q.numerator, q.denominator + + +def normalized(values, denominator): + if not values: + return {}, 1 + divisor = gcd(denominator, *values.values()) + if divisor != 1: + return {j: a // divisor for j, a in values.items()}, denominator // divisor + return values, denominator + + +def sum_scaled(first, second, factor): + a, da = first + b, db = second + numerator, denom = factor + if not b: + return first + common = lcm(da, db * denom) + out = {j: v * (common // da) for j, v in a.items()} + weight = numerator * (common // (db * denom)) + for j, v in b.items(): + val = out.get(j, 0) + weight * v + if val: + out[j] = val + else: + out.pop(j, None) + return normalized(out, common) + + +def incidence(e): + return e[1:3] if e[0] in ("ADD", "COPY") else e[1:2] + + +def candidates(word, quote): + n = word["public"] + tape = word["program"] + stock = {} + for case in quote["candidates"]: + owner = case["owner"] + left, right = case["move_clocks"] + a, middle, c = case["chart_path"] + original, entry = case["literal_ADD"] + assert case["owner_access"] == "destination" and entry[0] == owner + assert entry[1] == case["peer"] and entry[-1] == middle + assert tape[left] == ["MOVE", owner, a, middle, True] + assert tape[right] == ["MOVE", owner, middle, c, True] + assert tape[original] == ["ADD", *entry] + assert n <= owner and left < original < right + assert [i for i in range(left + 1, right) if owner in incidence(tape[i])] == [original] + assert case["cut_windows_pre_event"] == {"entrance": [left, right], "exit": [left + 1, right]} + stock[owner, left, right] = case + assert len(stock) == 3 and len({tuple(k) for k in quote["keys"]}) == quote["case_cap"] == 33 + return stock + + +def collect(word, cuts, observations, cap): + """Forward structural pass only. Assign one ID to each requested live value.""" + n = word["public"] + chart = list(word["initial"]) + [None] * word["owned_fields"] + revisions = [0] * len(chart) + fresh = set() + starts = {} + lifetimes = {} + requests = defaultdict(list) + observation_ids = {} + bank_ids = {} + value_id = {} + paid = Counter() + + @cache + def span(f): + vectors = {0} + for v in word["frames"][f]: + assert v not in vectors + vectors.update(v ^ t for t in tuple(vectors)) + return vectors + + def request(t, role): + assert chart[role] is not None + key = role, revisions[role] + if key not in value_id: + value_id[key] = len(value_id) + requests[t].append((role, value_id[key])) + return value_id[key] + + tape = word["program"] + for t in range(len(tape) + 1): + if t % 128 == 0 and monotonic() >= cap: + raise TimeoutError("literal structural scan") + for role in observations.get(t, ()): + observation_ids[t, role] = request(t, role) + for key, chart_id, exclude in cuts.get(t, ()): + bank_ids[key] = [(r, request(t, r)) for r, c in enumerate(chart) if c == chart_id and r != exclude] + if t == len(tape): + break + op, d, *args = tape[t] + assert 0 <= d < len(chart) + if op == "INIT": + assert d >= n and chart[d] is None + chart[d], starts[d] = args[0], t + fresh.add(d) + elif op == "CLEAR": + assert d >= n and chart[d] == args[0] and d in starts + lifetimes[d, starts.pop(d)] = t + chart[d] = None + fresh.discard(d) + elif op == "MOVE": + a, b, owned = args + assert chart[d] == a and owned == (d >= n) + assert span(a) < span(b) or owned and span(b) < span(a) + paid[abs(len(word["frames"][b]) - len(word["frames"][a]))] += 1 + chart[d] = b + fresh.discard(d) + continue + elif op == "SCALE": + assert chart[d] == args[-1] + coefficient(args[-2]) + fresh.discard(d) + else: + assert op in ("ADD", "COPY") + src, coeff, f = args + assert d != src and chart[d] == chart[src] == f + coefficient(coeff) + if op == "COPY": + assert d >= n and d in fresh + fresh.discard(d) + revisions[d] += 1 + assert not starts and chart == word["final"] + [None] * word["owned_fields"] + return requests, observation_ids, bank_ids, lifetimes, dict(paid), len(value_id) + + +def transpose_prefix(word, requests, count, cap): + """Propagate all requested output covectors backward, then transpose to input rows.""" + n = word["public"] + empty = ({}, 1) + adjoint = [empty] * (n + word["owned_fields"]) + tape = word["program"] + for t in range(max(requests), -1, -1): + if t % 128 == 0 and monotonic() >= cap: + raise TimeoutError("reverse normalized prefix") + op, d, *args = tape[t] + if op in ("INIT", "CLEAR"): + adjoint[d] = empty + elif op == "SCALE": + adjoint[d] = sum_scaled(empty, adjoint[d], coefficient(args[-2])) + elif op in ("ADD", "COPY"): + src = args[0] + adjoint[src] = sum_scaled(adjoint[src], adjoint[d], coefficient(args[-2])) + if op == "COPY": + adjoint[d] = empty + else: + assert op == "MOVE" + for r, output in requests.get(t, ()): + adjoint[r] = sum_scaled(adjoint[r], ({output: 1}, 1), (1, 1)) + assert not any(d for d, _ in adjoint[n:]) + by_output = [[] for _ in range(count)] + for coord, (coeffs, d) in enumerate(adjoint[:n]): + assert d % PRIME + for i, v in coeffs.items(): + by_output[i].append((coord, v, d)) + rows = [] + for entries in by_output: + common = lcm(*(d for _, _, d in entries)) + rows.append(normalized({i: v * (common // d) for i, v, d in entries}, common)) + return rows + + +def eliminate(v, basis, record=False): + """Reverse-pivot integer elimination. All leading pivots are exact.""" + v = v.copy() + reductions = [] + multiplier = 1 + while v: + k = max(v) + if k not in basis: + break + w = basis[k] + a, b = w[k], v[k] + d = gcd(a, b) + a, b = a // d, b // d + next_v = {j: a * x for j, x in v.items()} + for j, x in w.items(): + z = next_v.get(j, 0) - b * x + if z: + next_v[j] = z + else: + next_v.pop(j, None) + assert k not in next_v + g = gcd(*next_v.values()) or 1 + v = {j: x // g for j, x in next_v.items()} + if record: + reductions.append((k, Fraction(b, a) * multiplier)) + multiplier *= Fraction(g, a) + return v, reductions, multiplier + + +def dot(row, covector): + numerator, denominator = row + return sum((numerator.get(j, 0) * v for j, v in covector.items()), Fraction(0)) / denominator + + +def exact_span(bank, target): + t, dt = target + if not t: + return dict(status="exact_span", coefficients={}) + exterior = next((j for j in sorted(t) if all(j not in row for _, (row, _) in bank)), None) + basis = {} + histories = {} + for role, (v, d) in bank: + reduced, steps, scale = eliminate(v, basis, record=True) + if reduced: + pivot = max(reduced) + basis[pivot] = reduced + histories[pivot] = (role, d, steps, scale) + if exterior is not None: + residue = t[exterior] * pow(dt, -1, PRIME) % PRIME + return dict(status="absent_exterior_coordinate", donor_rank=len(basis), augmented_rank=len(basis)+1, + coordinate=exterior, target_coefficient=str(Fraction(t[exterior], dt)), + target_residue_mod_prime=residue) + residual, steps, scale = eliminate(t, basis, record=True) + if residual: + k = max(residual) + dual = {k: Fraction(1)} + for p, v in sorted(basis.items()): + coefficient = -sum((v.get(j, 0) * c for j, c in dual.items()), Fraction(0)) / v[p] + if coefficient: + dual[p] = coefficient + target_value = dot(target, dual) + assert target_value and all(dot(v, dual) == 0 for _, v in bank) + return dict(status="exact_rank_exclusion", donor_rank=len(basis), augmented_rank=len(basis) + 1, + missing_reverse_pivot=k, residual_integer_row=residual, + separating_covector={j: str(v) for j, v in dual.items()}, separated_target=str(target_value)) + pending = dict(steps) + solution = defaultdict(Fraction) + for pivot in sorted(basis): + if pivot not in pending: + continue + weight = pending.pop(pivot) + if not weight: + continue + role, denom, reductions, factor = histories[pivot] + weight /= factor + solution[role] += weight * denom / dt + for j, scalar in reductions: + pending[j] = pending.get(j, Fraction(0)) - weight * scalar + assert not pending + check = ({}, 1) + rows = dict(bank) + for r, x in solution.items(): + check = sum_scaled(check, rows[r], (x.numerator, x.denominator)) + assert check == target, (check, target) + return dict(status="exact_span", donor_rank=len(basis), + coefficients={r: str(x) for r, x in sorted(solution.items()) if x}) + + +def controls(): + toy = {"public": 4, "owned_fields": 1, "frames": [[]], "initial": [0] * 4, "final": [0] * 4, + "program": [["INIT", 4, 0], ["COPY", 4, 0, "1/2", 0], ["ADD", 4, 1, "-3", 0], + ["ADD", 0, 2, "2", 0], ["CLEAR", 4, 0]]} + req, ids, banks, _, _, count = collect(toy, {3:[((3,), 0, 4)], 4:[((4,), 0, 4)]}, {3:[4]}, float("inf")) + rows = transpose_prefix(toy, req, count, float("inf")) + target = rows[ids[3, 4]] + before = [(r, rows[i]) for r, i in banks[3,] if r in (0, 1)] + after = [(r, rows[i]) for r, i in banks[4,] if r in (0, 1)] + assert exact_span(before, target)["coefficients"] == {0:"1/2", 1:"-3"} + assert exact_span(after, target)["status"] == "exact_rank_exclusion" + assert exact_span(before[1:], target)["status"] == "absent_exterior_coordinate" + # Nontrivial exact dependency and reconstruction after a shared pivot. + multi = [(5, ({0: 3, 1: -1}, 2)), (6, ({0: 1, 1: 4}, 3)), (7, ({0: 11, 1: 2}, 1))] + hit = exact_span(multi, ({0: 11, 1: 2}, 1)) + assert hit["status"] == "exact_span" and len(hit["coefficients"]) == 2 + return ["signed_multi_source_and_owned_COPY", "intervening_write_blocks_span", "absent_exterior_coordinate", + "dependent_donor_bank_exact_reconstruction"] + + +def audit(word, quote, cap, decisions): + assert (word["public"], word["owned_fields"], len(word["program"])) == (1501, 68, 76466) + stock = candidates(word, quote) + observed = defaultdict(set) + cuts = defaultdict(list) + for row in quote["keys"]: + key = tuple(row) + owner, left, right, side, t = key + item = stock[owner, left, right] + chart = item["chart_path"][0 if side == "entrance" else 2] + assert item["cut_windows_pre_event"][side][0] <= t <= item["cut_windows_pre_event"][side][1] + cuts[t].append((key, chart, owner)) + observed[item["literal_ADD"][0]].add(item["peer"]) + requests, refs, banks, lifetimes, paid, count = collect(word, cuts, observed, cap) + assert paid == {1:4000, 2:853, 3:829, 4:223, 5:345, 6:14, 7:10, 8:5} + for item in stock.values(): + left, right = item["owner_lifetime"] + assert lifetimes[item["owner"], left] == right + rows = transpose_prefix(word, requests, count, cap) + for entry in quote["keys"]: + if monotonic() >= cap: + raise TimeoutError("exact donor bank gate") + owner, left, right, side, t = entry + item = stock[owner, left, right] + source = item["peer"] + target_id = refs[item["literal_ADD"][0], source] + target = rows[target_id] + bank = [(r, rows[i]) for r, i in banks[tuple(entry)]] + chart = item["chart_path"][0 if side == "entrance" else 2] + decision = exact_span(bank, target) + decisions.append(dict(key=entry, proposed_chart=chart, literal_read_peer=source, + literal_read_clock=item["literal_ADD"][0], donors=len(bank), owned_donors=sum(r>=word["public"] for r,_ in bank), + target_row_id=target_id, donor_role_row_ids=banks[tuple(entry)], + donor_rowset_sha256=sha256(dumps(bank, sort_keys=True).encode()).hexdigest(), **decision)) + return rows + + +def main(): + parser = ArgumentParser(description=__doc__) + parser.add_argument("--word", type=Path) + parser.add_argument("--price", type=Path) + parser.add_argument("--controls-only", action="store_true") + args = parser.parse_args() + if args.controls_only: + print(dumps(controls())) + return + assert args.word is not None and args.price is not None and __debug__ + start = monotonic() + def stop(*_): + raise TimeoutError("hard 20-second runner cap") + signal(SIGALRM, stop) + alarm(20) + decisions = [] + keys = [] + rows = None + tests = [] + timed_out = None + try: + tests = controls() + assert all(PRIME % d for d in range(2, isqrt(PRIME)+1)) + quote = checked(args.price, PRICE) + assert quote["head"] == HEAD and quote["word_sha256"] == WORD + keys = quote["keys"] + rows = audit(checked(args.word, WORD, compressed=True), quote, start+18, decisions) + except TimeoutError as error: + timed_out = str(error) + finally: + alarm(0) + result = dict(head=HEAD, word_sha256=WORD, price_sha256=PRICE, prime=PRIME, + case_cap=33, runner_cap_seconds=20, controls=tests, distinct_requested_rows=len(rows) if rows is not None else None, + requested_integer_rows=rows, + cases=decisions, disposition_counts=dict(Counter(r["status"] for r in decisions)), + unresolved=keys[len(decisions):], timeout=timed_out, + survivors=[r for r in decisions if r["status"] == "exact_span"]) + print(dumps(result, sort_keys=True, indent=2)) + if timed_out: + raise SystemExit(2) + + +if __name__ == "__main__": + main() diff --git a/research/p104-first-receiver-contraction-bound/receipts/PRICE.json b/research/p104-first-receiver-contraction-bound/receipts/PRICE.json new file mode 100644 index 0000000000..d8c17dc82d --- /dev/null +++ b/research/p104-first-receiver-contraction-bound/receipts/PRICE.json @@ -0,0 +1,37 @@ +{ + "caller": "07a76c5e2738882c0cb322278e56f6cae3c9885d", + "complete": { + "moonshot": [ + "-696567930905084099980408314680942035674739072693821/5000000000000000000000000000000000000000000000000", + "-696567930905084099980408314680942035674739072665341/5000000000000000000000000000000000000000000000000" + ], + "old_crossing_upper": [ + "4127144682830787168085915397938892124066012906481/10000000000000000000000000000000000000000000000000", + "1031786170707696792021478849484723031016503240603/2500000000000000000000000000000000000000000000000" + ], + "probe": [ + "2061635029048022230038238512531066526075813669173/5000000000000000000000000000000000000000000000000", + "4123270058096044460076477025062133052151627394277/10000000000000000000000000000000000000000000000000" + ] + }, + "head": "aaeec8c0acf01e99a5f331ef363a698d9c084ace", + "one_owned_slot_at_cut": true, + "ordinary_reserve": 64328, + "paid_after": 110485, + "paid_delta": { + "1": -17, + "2": -17, + "4": -17, + "7": 17 + }, + "pins": { + "inputs/R159-IMPULSE.json": "cbd68f70602a75234718642adf6dce528a1e8c4ce8ea043aca029c8fd8b1db38", + "inputs/R92-PRICE.json": "05d7a5ebdd2eeedd6c8f534e8e2eeac22484daf9f387f4a6b88cc9eed22a6b8f", + "inputs/WORD.json.gz": "4b9fd1187b34ed97c3ac0c760d73531735a5d0ebc5b4d4ab4377160b20d9bb2a", + "inputs/aggregate.py": "8bf1b91d7fc0937305466686522f5fb3920c66c71830acfc94adde84ba4f49e1", + "inputs/donor_span.py": "4d5306e2c0b7e91c79d22c82e8e760aed2c311979298c558e631975d4d1ae5b1", + "inputs/pricing.py": "f4d0b6c9314b838d882d6d06020f24881c19a3fda97a7c00df87b1e920785182" + }, + "productive": 22461, + "rank_surplus": 1424 +} diff --git a/research/p104-first-receiver-contraction-bound/receipts/R159-FORWARD.json b/research/p104-first-receiver-contraction-bound/receipts/R159-FORWARD.json new file mode 100644 index 0000000000..8b6fab72cd --- /dev/null +++ b/research/p104-first-receiver-contraction-bound/receipts/R159-FORWARD.json @@ -0,0 +1,17 @@ +{ + "carrier": "-1", + "chart": 652, + "cut": 42651, + "donors": { + "165": "0", + "586": "0" + }, + "pins": { + "inputs/CURRENT.json.gz": "4b9fd1187b34ed97c3ac0c760d73531735a5d0ebc5b4d4ab4377160b20d9bb2a" + }, + "post_receiver": "0", + "receiver": "1/2", + "required": "-1/2", + "runner_seconds": 20, + "scope": 1 +} diff --git a/research/p104-first-receiver-contraction-bound/receipts/R159-GATE.json b/research/p104-first-receiver-contraction-bound/receipts/R159-GATE.json new file mode 100644 index 0000000000..40796f5482 --- /dev/null +++ b/research/p104-first-receiver-contraction-bound/receipts/R159-GATE.json @@ -0,0 +1,16 @@ +{ + "case_count": 1, + "cut": 42651, + "distinct_donor_values": { + "165": "0", + "586": "0" + }, + "input_axis": 930, + "necessary_receiver_diagonal": "0", + "old_receiver": "1/2", + "pin": "a7b794a3a3d1f79c1f277334a03bf6ff98044d132a9e8fdb1122a8cc59d3f9ac", + "required_add": "-1/2", + "required_receiver_return": "0", + "scope": "same-clock chart652 one-receiver replacement with unchanged donors", + "status": "excluded" +} diff --git a/research/p104-first-receiver-contraction-bound/receipts/R159-REVERSE.json b/research/p104-first-receiver-contraction-bound/receipts/R159-REVERSE.json new file mode 100644 index 0000000000..ffed7b7553 --- /dev/null +++ b/research/p104-first-receiver-contraction-bound/receipts/R159-REVERSE.json @@ -0,0 +1,134 @@ +{ + "bank_owned": [], + "bank_public": [ + 165, + 586, + 793 + ], + "bank_values": [ + [ + 165, + "0" + ], + [ + 586, + "0" + ], + [ + 793, + "1/2" + ] + ], + "caller": "07a76c5e2738882c0cb322278e56f6cae3c9885d", + "caps": { + "cases": 1, + "seconds": 20 + }, + "case_count": 1, + "chart": 652, + "controls": [ + "nonzero required and zero donor", + "retained owned donor nonzero", + "signed COPY and CLEAR" + ], + "current_clocks": [ + 42650, + 42651, + 42692, + 42693, + 42695, + 42697 + ], + "cut": 42651, + "disposition": "unresolved", + "events": [ + [ + "MOVE", + 930, + 3, + 652, + false + ], + [ + "ADD", + 793, + 930, + "1/2", + 652 + ], + [ + "MOVE", + 930, + 652, + 657, + false + ], + [ + "ADD", + 1473, + 930, + "-1", + 657 + ], + [ + "ADD", + 930, + 982, + "-1", + 657 + ], + [ + "MOVE", + 930, + 657, + 649, + false + ] + ], + "frames": [ + [], + [ + 82, + 268 + ], + [ + 9, + 16, + 36, + 66, + 130, + 261 + ], + [ + 2, + 9, + 16, + 36, + 64, + 128, + 261 + ] + ], + "head": "aaeec8c0acf01e99a5f331ef363a698d9c084ace", + "old_clocks": [ + 42648, + 42649, + 42690, + 42691, + 42693, + 42695 + ], + "pins": { + "inputs/7274-WORD.json.gz": "66bc395b599bc0b805c5061bbbd124e2027ad86645c07abe40d0b472fa1a7a2b", + "inputs/7334-WORD.json.gz": "4b9fd1187b34ed97c3ac0c760d73531735a5d0ebc5b4d4ab4377160b20d9bb2a", + "inputs/PLAN.md": "13224daa1271a10de69dc7c45d105e9518765da9529771a181b5447f70d02ee6", + "inputs/R29-RESULT.json": "6fa36e6a2b618ad96a6e18389c165dc04f3f987b186d8ce33bdb82bed47ef5b5", + "inputs/reverse_span.py": "f8b48f2ed99d003e20f5b3fb2270603c4edbc3ce9a01484102816aa2710ce9ff" + }, + "receiver": 793, + "receiver_next_clock": 42653, + "receiver_old_coordinate": "1/2", + "required_coordinate": "-1/2", + "source": 930, + "source_coordinate": "-1" +} diff --git a/research/p104-first-receiver-contraction-bound/receipts/R160-FORWARD.json b/research/p104-first-receiver-contraction-bound/receipts/R160-FORWARD.json new file mode 100644 index 0000000000..d6bad21ecc --- /dev/null +++ b/research/p104-first-receiver-contraction-bound/receipts/R160-FORWARD.json @@ -0,0 +1,73 @@ +{ + "chart": 652, + "controls": [ + "two donor exact aggregate", + "exterior-coordinate perturbation", + "same-support covector separation" + ], + "coordinate": 893, + "cut": 42651, + "donor_coefficients": [ + "0", + "0" + ], + "donor_roles": [ + 165, + 586 + ], + "exact": { + "absent_coordinates": [ + 893, + 915, + 939, + 946, + 967, + 987 + ], + "decision": "outside donor span", + "separator": { + "893": "1" + }, + "separator_value": "1/2" + }, + "price": { + "caller": "07a76c5e2738882c0cb322278e56f6cae3c9885d", + "complete": { + "moonshot": [ + "-696567930905084099980408314680942035674739072693821/5000000000000000000000000000000000000000000000000", + "-696567930905084099980408314680942035674739072665341/5000000000000000000000000000000000000000000000000" + ], + "old_crossing_upper": [ + "4127144682830787168085915397938892124066012906481/10000000000000000000000000000000000000000000000000", + "1031786170707696792021478849484723031016503240603/2500000000000000000000000000000000000000000000000" + ], + "probe": [ + "2061635029048022230038238512531066526075813669173/5000000000000000000000000000000000000000000000000", + "4123270058096044460076477025062133052151627394277/10000000000000000000000000000000000000000000000000" + ] + }, + "head": "aaeec8c0acf01e99a5f331ef363a698d9c084ace", + "one_owned_slot_at_cut": true, + "ordinary_reserve": 64328, + "paid_after": 110485, + "paid_delta": { + "1": -17, + "2": -17, + "4": -17, + "7": 17 + }, + "pins": { + "inputs/R159-IMPULSE.json": "cbd68f70602a75234718642adf6dce528a1e8c4ce8ea043aca029c8fd8b1db38", + "inputs/R92-PRICE.json": "05d7a5ebdd2eeedd6c8f534e8e2eeac22484daf9f387f4a6b88cc9eed22a6b8f", + "inputs/WORD.json.gz": "4b9fd1187b34ed97c3ac0c760d73531735a5d0ebc5b4d4ab4377160b20d9bb2a", + "inputs/aggregate.py": "8bf1b91d7fc0937305466686522f5fb3920c66c71830acfc94adde84ba4f49e1", + "inputs/donor_span.py": "4d5306e2c0b7e91c79d22c82e8e760aed2c311979298c558e631975d4d1ae5b1", + "inputs/pricing.py": "f4d0b6c9314b838d882d6d06020f24881c19a3fda97a7c00df87b1e920785182" + }, + "productive": 22461, + "rank_surplus": 1424 + }, + "runner_seconds": 20, + "scope": 1, + "target_coefficient": "1/2" +} diff --git a/research/p104-first-receiver-contraction-bound/receipts/R160-REVERSE.json b/research/p104-first-receiver-contraction-bound/receipts/R160-REVERSE.json new file mode 100644 index 0000000000..92897a02ec --- /dev/null +++ b/research/p104-first-receiver-contraction-bound/receipts/R160-REVERSE.json @@ -0,0 +1,496 @@ +{ + "caller": "07a76c5e2738882c0cb322278e56f6cae3c9885d", + "cap_seconds": 20, + "cases": 1, + "controls": [ + "exact cancellation at the forced zero-diagonal input", + "synthetic surviving receiver return", + "synthetic absent coordinate" + ], + "head": "aaeec8c0acf01e99a5f331ef363a698d9c084ace", + "key": [ + 42651, + 793, + 652 + ], + "pins": { + "inputs/7274-WORD.json.gz": "66bc395b599bc0b805c5061bbbd124e2027ad86645c07abe40d0b472fa1a7a2b", + "inputs/7334-WORD.json.gz": "4b9fd1187b34ed97c3ac0c760d73531735a5d0ebc5b4d4ab4377160b20d9bb2a", + "inputs/GATE.json": "80159b185c223fba77118d61a72bb0cf533d6b5bc7b0591dcc681ef6144c03fd", + "inputs/PLAN.md": "13224daa1271a10de69dc7c45d105e9518765da9529771a181b5447f70d02ee6", + "inputs/R29-RESULT.json": "6fa36e6a2b618ad96a6e18389c165dc04f3f987b186d8ce33bdb82bed47ef5b5", + "inputs/RESULT.json": "a7b794a3a3d1f79c1f277334a03bf6ff98044d132a9e8fdb1122a8cc59d3f9ac", + "inputs/r159_reverse.py": "4f304c3eed2950677247d7e0736f31c859ad3d6ee1ea299c7b43c3a8a0b0dd58", + "inputs/reverse_span.py": "f8b48f2ed99d003e20f5b3fb2270603c4edbc3ce9a01484102816aa2710ce9ff" + }, + "proof": { + "augmented_rank": 3, + "coordinate": 893, + "donor_rank": 2, + "status": "absent_exterior_coordinate", + "target_coefficient": "1/2", + "target_residue_mod_prime": 32761 + }, + "roles": [ + 930, + 793, + 165, + 586 + ], + "rows": [ + [ + { + "897": 1, + "918": 1, + "930": -1, + "982": -1 + }, + 1 + ], + [ + { + "34": -8, + "47": -4, + "159": 4, + "265": 16, + "270": 16, + "284": -32, + "303": 16, + "372": 1, + "408": -16, + "440": 8, + "445": -4, + "497": 4, + "499": -16, + "537": 32, + "541": -16, + "542": 16, + "641": -16, + "643": -16, + "655": 2, + "679": 8, + "688": 4, + "711": 8, + "733": 4, + "757": 4, + "761": -8, + "893": 8, + "896": -8, + "897": -8, + "901": -8, + "915": -8, + "918": -8, + "924": 16, + "930": 8, + "939": -8, + "946": -8, + "967": 8, + "969": 8, + "982": 8, + "987": -8, + "997": -16, + "999": 16, + "1006": -12, + "1008": 8, + "1013": 24, + "1018": -16, + "1058": -64, + "1063": -4, + "1074": -8, + "1090": 4, + "1102": 8, + "1127": -16, + "1194": -32, + "1196": -16, + "1197": 8, + "1207": -8, + "1214": -8, + "1221": -8, + "1224": -8, + "1238": 4, + "1243": 16, + "1248": 4, + "1253": 8, + "1255": -8, + "1258": -8, + "1259": -8, + "1274": -8, + "1284": -16, + "1322": 4, + "1340": 16 + }, + 16 + ], + [ + { + "2": 8, + "5": 8, + "8": 8, + "11": -8, + "12": 8, + "15": 8, + "16": 8, + "19": -4, + "20": 8, + "23": -8, + "24": -8, + "25": -8, + "26": -8, + "28": -8, + "29": -8, + "31": -8, + "32": -8, + "33": -8, + "34": -8, + "36": 8, + "40": 4, + "41": 8, + "44": -8, + "46": -8, + "47": -4, + "48": 8, + "49": 8, + "53": -8, + "54": 8, + "58": 8, + "59": 8, + "63": 8, + "64": 8, + "69": -8, + "70": 8, + "74": -8, + "75": -8, + "77": -8, + "78": 8, + "79": -8, + "80": 8, + "82": 8, + "83": 8, + "88": -8, + "91": -8, + "94": 8, + "97": -8, + "99": -8, + "102": -8, + "103": 8, + "106": -8, + "107": 8, + "108": 8, + "111": 8, + "127": 8, + "131": 4, + "152": -4, + "159": 4, + "165": -8, + "255": -16, + "265": 32, + "269": -8, + "270": 28, + "284": -64, + "286": -4, + "292": 4, + "303": 16, + "320": 2, + "348": -4, + "360": 20, + "370": 16, + "372": -1, + "377": 8, + "408": -16, + "417": -8, + "423": -2, + "426": 4, + "429": -16, + "440": -4, + "445": -12, + "478": 8, + "479": -8, + "490": 8, + "491": -8, + "497": -4, + "499": -16, + "537": 16, + "541": -8, + "542": 8, + "545": 16, + "550": -8, + "553": -72, + "592": 8, + "609": -8, + "641": 16, + "655": 2, + "665": 16, + "671": 20, + "679": 24, + "680": -2, + "688": 7, + "711": 5, + "733": 4, + "757": 4, + "761": -8, + "810": -8, + "811": 32, + "896": 16, + "901": -8, + "924": 16, + "969": 24, + "997": -16, + "999": 8, + "1001": -6, + "1006": -4, + "1008": 24, + "1011": -16, + "1012": -16, + "1013": -184, + "1016": 8, + "1030": 188, + "1032": -40, + "1037": -16, + "1039": -32, + "1051": -32, + "1053": -8, + "1055": -8, + "1058": -32, + "1063": -8, + "1064": -16, + "1065": 4, + "1074": -16, + "1075": -2, + "1077": -24, + "1081": -8, + "1090": -8, + "1091": -4, + "1095": 16, + "1102": 24, + "1110": 16, + "1111": -8, + "1113": -40, + "1116": 14, + "1118": -16, + "1120": 2, + "1127": -8, + "1129": -56, + "1132": 4, + "1134": -16, + "1136": 16, + "1144": -16, + "1164": 16, + "1184": 8, + "1194": -32, + "1196": -16, + "1197": 8, + "1207": 6, + "1214": -24, + "1215": -4, + "1221": -8, + "1222": 16, + "1224": -8, + "1234": -31, + "1235": -6, + "1238": 8, + "1248": 12, + "1253": 8, + "1255": -16, + "1272": -6, + "1274": -8, + "1284": -48, + "1307": -8, + "1331": 6, + "1340": 16, + "1473": 16 + }, + 16 + ], + [ + { + "2": -4, + "5": -4, + "8": -4, + "11": 4, + "12": -4, + "15": -4, + "16": -4, + "19": 2, + "20": -4, + "23": 4, + "24": 4, + "25": 4, + "26": 4, + "28": 4, + "29": 4, + "31": 4, + "32": 4, + "33": 4, + "36": -4, + "39": -4, + "40": -2, + "41": -4, + "44": 4, + "46": 4, + "48": -4, + "49": -4, + "53": 4, + "54": -4, + "58": -4, + "59": -4, + "63": -4, + "64": -4, + "69": 4, + "70": -4, + "74": 4, + "75": 4, + "77": 4, + "78": -4, + "79": 4, + "80": -4, + "82": -4, + "83": -4, + "88": 4, + "91": 4, + "94": -4, + "97": 4, + "99": 4, + "102": 4, + "103": -4, + "106": 4, + "107": -4, + "108": -4, + "111": -4, + "131": -2, + "152": 2, + "251": -4, + "265": -8, + "269": 4, + "284": 16, + "320": -1, + "348": 2, + "366": 2, + "370": -8, + "377": -4, + "407": 4, + "417": 4, + "423": 1, + "426": -2, + "429": 8, + "445": 4, + "498": -4, + "592": -4, + "609": 4, + "641": -16, + "643": -8, + "665": -8, + "679": -8, + "680": -4, + "757": 1, + "810": 4, + "811": -16, + "896": -12, + "969": -8, + "1012": 8, + "1018": -8, + "1027": 4, + "1051": 16, + "1063": 2, + "1064": 8, + "1065": -2, + "1074": 4, + "1090": 6, + "1102": -8, + "1118": 8, + "1214": 8, + "1222": -8, + "1238": -2, + "1243": 8, + "1248": -4, + "1255": 4, + "1258": -4, + "1259": -4, + "1322": 2 + }, + 4 + ] + ], + "status": "excluded", + "target": [ + { + "34": -8, + "47": -4, + "159": 4, + "265": 16, + "270": 16, + "284": -32, + "303": 16, + "372": 1, + "408": -16, + "440": 8, + "445": -4, + "497": 4, + "499": -16, + "537": 32, + "541": -16, + "542": 16, + "641": -16, + "643": -16, + "655": 2, + "679": 8, + "688": 4, + "711": 8, + "733": 4, + "757": 4, + "761": -8, + "893": 8, + "896": -8, + "901": -8, + "915": -8, + "924": 16, + "939": -8, + "946": -8, + "967": 8, + "969": 8, + "987": -8, + "997": -16, + "999": 16, + "1006": -12, + "1008": 8, + "1013": 24, + "1018": -16, + "1058": -64, + "1063": -4, + "1074": -8, + "1090": 4, + "1102": 8, + "1127": -16, + "1194": -32, + "1196": -16, + "1197": 8, + "1207": -8, + "1214": -8, + "1221": -8, + "1224": -8, + "1238": 4, + "1243": 16, + "1248": 4, + "1253": 8, + "1255": -8, + "1258": -8, + "1259": -8, + "1274": -8, + "1284": -16, + "1322": 4, + "1340": 16 + }, + 16 + ], + "witness": { + "covector": { + "893": "1" + }, + "donors": { + "165": "0", + "586": "0" + }, + "receiver": "1/2", + "source": "0", + "target": "1/2" + } +} diff --git a/research/p104-first-receiver-contraction-bound/receipts/SHA256.json b/research/p104-first-receiver-contraction-bound/receipts/SHA256.json new file mode 100644 index 0000000000..73ce6f15a7 --- /dev/null +++ b/research/p104-first-receiver-contraction-bound/receipts/SHA256.json @@ -0,0 +1,8 @@ +{ + "PRICE.json": "9b1ea080bc4ac60e9c78b054352b41d7732989b4492692a2e37c0f578092712a", + "R159-FORWARD.json": "cbd68f70602a75234718642adf6dce528a1e8c4ce8ea043aca029c8fd8b1db38", + "R159-GATE.json": "80159b185c223fba77118d61a72bb0cf533d6b5bc7b0591dcc681ef6144c03fd", + "R159-REVERSE.json": "a7b794a3a3d1f79c1f277334a03bf6ff98044d132a9e8fdb1122a8cc59d3f9ac", + "R160-FORWARD.json": "41c854d890cd79f1c953b4d5a02d79b389d76080c10429807b8cddb32f6102dc", + "R160-REVERSE.json": "68afed36a9279340b41e1f1f873956d9b7d222d49fc824c28b79dc645f95f3e6" +} diff --git a/research/p104-first-receiver-contraction-bound/replay.py b/research/p104-first-receiver-contraction-bound/replay.py new file mode 100644 index 0000000000..910d6c6925 --- /dev/null +++ b/research/p104-first-receiver-contraction-bound/replay.py @@ -0,0 +1,163 @@ +"""Reproduce both chart-652 first-receiver 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 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 decode(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 dependencies(): + pins = decode(source('LOCAL-PINS.json')) + for name, expected in pins.items(): + if digest(source(name)) != expected: + raise ValueError(f'changed package dependency {name}') + for name, entry in decode(source('PROVENANCE.json'))['files'].items(): + raw = source(name) + assert digest(raw) == entry['sha256'] + assert sha1(f'blob {len(raw)}\0'.encode() + raw).hexdigest() == entry['git_blob'] + price = decompress(source('inputs/R92-PRICE.json.gz')) + assert digest(price) == decode(source('inputs/PR7362-SHA256.json'))['R92-PRICE.json'] + a = decode(source('inputs/ADMITTED.json')) + assert a['head'] == 'aaeec8c0acf01e99a5f331ef363a698d9c084ace' + assert a['caller'] == '07a76c5e2738882c0cb322278e56f6cae3c9885d' + assert a['kappa'] == '0.00364665195644' and a['exit'] == 0 + assert a['inputs']['WORD.json.gz'] == digest(source('inputs/7334-WORD.json.gz')) + assert set(a['stages']) == {'native', 'early', 'caller', 'frontier'} + return price + + +def write(path, raw): + path.parent.mkdir(parents=True, exist_ok=True) + path.write_bytes(raw) + + +def call(script, *args, succeeds=True): + result = run([sys.executable, '-I', '-B', str(script), *map(str, args)], + capture_output=True, timeout=22) + if succeeds: + if result.returncode: + sys.stderr.write(result.stderr.decode(errors='replace')) + result.check_returncode() + return result + + +def verify_agreement(price, left, raw, gate, right, full): + assert price['paid_delta'] == {'1': -17, '2': -17, '4': -17, '7': 17} + assert (price['paid_after'], price['productive'], price['rank_surplus']) == (110485, 22461, 1424) + assert price['ordinary_reserve'] == 64328 and price['one_owned_slot_at_cut'] + assert Q('0.4127144682830787') < Q(price['complete']['old_crossing_upper'][0]) + assert Q(price['complete']['old_crossing_upper'][1]) < Q('0.4127144682830788') < 1 + assert Q(price['complete']['probe'][0]) > Q('0.4123270058096044') + assert Q(price['complete']['moonshot'][1]) < Q('-139.3135861810168') + assert left['cut'] == raw['cut'] == gate['cut'] == right['cut'] == full['key'][0] == 42651 + assert left['carrier'] == raw['source_coordinate'] == '-1' + assert left['receiver'] == raw['receiver_old_coordinate'] == gate['old_receiver'] == '1/2' + assert left['required'] == raw['required_coordinate'] == gate['required_add'] == '-1/2' + assert left['post_receiver'] == gate['required_receiver_return'] == gate['necessary_receiver_diagonal'] == '0' + assert raw['bank_owned'] == [] and raw['bank_public'] == [165, 586, 793] + assert left['donors'] == gate['distinct_donor_values'] == {'165': '0', '586': '0'} + assert gate['status'] == full['status'] == 'excluded' + assert price == right['price'] and right['donor_roles'] == [165, 586] + assert right['exact']['separator'] == full['witness']['covector'] == {'893': '1'} + assert right['target_coefficient'] == full['witness']['target'] == '1/2' + assert right['donor_coefficients'] == list(full['witness']['donors'].values()) == ['0', '0'] + assert full['witness']['receiver'] == '1/2' and full['witness']['source'] == '0' + assert (full['proof']['donor_rank'], full['proof']['augmented_rank']) == (2, 3) + assert len(full['rows']) == 4 + + +def replay(tmp, out): + price_source = dependencies() + expected = decode(source('receipts/SHA256.json')) + outputs = {} + word = source('inputs/7334-WORD.json.gz') + + def record(name, script, *args): + data = call(script, *args).stdout + assert digest(data) == expected[name] + assert data == source(f'receipts/{name}') + outputs[name] = data + return decode(data) + + forward159, reverse, forward160 = (tmp / name for name in ('forward159', 'reverse', 'forward160')) + for root, script in ((forward159, 'r159_forward.py'), (forward160, 'r160_forward.py'), + (reverse, 'first_receiver.py'), (reverse, 'local_gate.py'), (reverse, 'full_receiver.py')): + write(root / script, source(f'engines/{script}')) + for name in ('7334-WORD.json.gz', '7274-WORD.json.gz', 'R29-RESULT.json', 'PLAN.md', 'reverse_span.py'): + write(reverse / 'inputs' / name, source(f'inputs/{name}')) + write(forward159 / 'inputs/CURRENT.json.gz', word) + write(forward160 / 'inputs/WORD.json.gz', word) + write(forward160 / 'inputs/R92-PRICE.json', price_source) + for name in ('pricing.py', 'aggregate.py', 'donor_span.py'): + write(forward160 / 'inputs' / name, source(f'inputs/{name}')) + + price = record('PRICE.json', forward160 / 'r160_forward.py', '--price') + f159 = record('R159-FORWARD.json', forward159 / 'r159_forward.py') + r159 = record('R159-REVERSE.json', reverse / 'first_receiver.py') + write(reverse / 'inputs/RESULT.json', outputs['R159-REVERSE.json']) + gate = record('R159-GATE.json', reverse / 'local_gate.py', reverse / 'inputs/RESULT.json') + write(reverse / 'inputs/GATE.json', outputs['R159-GATE.json']) + write(reverse / 'inputs/r159_reverse.py', source('engines/first_receiver.py')) + write(forward160 / 'inputs/R159-IMPULSE.json', outputs['R159-FORWARD.json']) + f160 = record('R160-FORWARD.json', forward160 / 'r160_forward.py') + r160 = record('R160-REVERSE.json', reverse / 'full_receiver.py') + verify_agreement(price, f159, r159, gate, f160, r160) + + for name, driver in (('inputs/GATE.json', 'full_receiver.py'), + ('inputs/7334-WORD.json.gz', 'first_receiver.py')): + path = reverse / name + raw = path.read_bytes() + path.write_bytes(raw + b' ') + check = call(reverse / driver, succeeds=False) + assert check.returncode == 1 and not check.stdout and b'changed dependency' in check.stderr + path.write_bytes(raw) + + assert set(outputs) == set(expected) + if out: + for name, data in outputs.items(): + write(out / name, data) + print(dumps({'cases': 1, 'repair_scopes_excluded': 2, 'kappa_delta': '0', + 'deterministic_receipts': len(outputs), 'corrupted_inputs_rejected': 2}, sort_keys=True)) + print('PASS_P104_FIRST_RECEIVER_CONTRACTION_BOUND') + + +def main(): + if sys.implementation.name != 'cpython' or 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-first-receiver-') as path: + replay(Path(path), args.out) + + +if __name__ == '__main__': + main()