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-changed-shared-midpoint-bound/LOCAL-PINS.json b/research/p104-changed-shared-midpoint-bound/LOCAL-PINS.json new file mode 100644 index 0000000000..fe9681c762 --- /dev/null +++ b/research/p104-changed-shared-midpoint-bound/LOCAL-PINS.json @@ -0,0 +1,23 @@ +{ + "PROVENANCE.json": "165fcf880f0934acf181877f3c535ff47eb47e6c6884962048ecfb2bd752a0cc", + "engines/r108/compare.py": "58f3479acf0446306baedc7a5dd8d102ef40fc3528069e345af8008481b895e5", + "engines/r108/reverse_routes.py": "a81a41c1cd33de0a612b568cbf470003d933a344396bc6dc53b85a91888dfe27", + "engines/r108/routes.py": "fe6839145121a22c9c4b1329731089c7bce7df4d6711a2e58c332c2eb8217cd6", + "engines/r111/geometry.py": "f9a64d816b85e8941aa7addfe08cc118949159f44daee8e8cd041cce8e84451c", + "engines/r111/quote.py": "4c35b1772154001daa2a5ff6b5d16722cd6fa41ced8c68402a9f565487b7eb69", + "engines/r111/verify.py": "1a830683f787cd82992bc1fca5c0e39f32646dd0aabb64881cdc3a0797874ec6", + "engines/stock.py": "2925dde93266cb71782dca77bf77fc7ef05c89bdb997aa19106376ceac1caff5", + "inputs/7314-HELPERS.json.gz": "e817ac36ffd85b5b8ad7320daf57bedfa5692b4a0f2990570008afe4888bca6d", + "inputs/7334-WORD.json.gz": "4b9fd1187b34ed97c3ac0c760d73531735a5d0ebc5b4d4ab4377160b20d9bb2a", + "inputs/PR7319-SHA256.json": "ca3ed296a19bdd7b2b37608e93d1763d97c7620ac9faef732a01bae4f485114c", + "inputs/PR7362-SHA256.json": "2c90ca39b0f075cc4b3ec9e90c66fde473465e7bb50cf1db9a820d3a29556c0b", + "inputs/PR7365-SHA256.json": "f8418b2b07e4ecb6d49d8839015e9ceab2224816d7863edd59cb03f29de34566", + "inputs/R100-GEOMETRY.json.gz": "ca159a989afa5c4ae67a2e77de2faadf5db5bc535d6c1e15bb080abc49e0866c", + "inputs/R100-PRICE.json.gz": "8ced8ba518250f652856ebf72ee8733532289d62450511e94d4ba17dc6eaae99", + "inputs/R92-PRICE.json.gz": "857b2776d4fb18844a08c82bb9387ddb3332d025bc7ecef2e606e6666705acf2", + "inputs/pricing.py": "f4d0b6c9314b838d882d6d06020f24881c19a3fda97a7c00df87b1e920785182", + "receipts/R108-AGREEMENT.json": "33e31c27852d9b375572ecc024b9e6c96ee1b429c8641bc83ec3a4be4cb11036", + "receipts/R111-AGREEMENT.json": "b98f7bcfcf8f8fb640f3d6825a6714418948d4b95581859591ed16fed408dbc9", + "receipts/SHA256.json": "e86ebfa47739ab29000e16d9bae359c2b93bf88aef9452a30b955130aedc3026", + "replay.py": "77f36f8c52f2c2f49470fb89f3b41a540aeed9b2f9bbc974d0b1013e8c55a0f6" +} diff --git a/research/p104-changed-shared-midpoint-bound/NOTICE b/research/p104-changed-shared-midpoint-bound/NOTICE new file mode 100644 index 0000000000..a18f990f18 --- /dev/null +++ b/research/p104-changed-shared-midpoint-bound/NOTICE @@ -0,0 +1,8 @@ +Apache-2.0. + +#7334 and #7113 supply the exact native word and signed caller. +#7358 and #7361 supply the inherited rechart methods. #7338 +supplies prior compensated fusion evidence on the exact chart-746 +component. #7365, #7319 and #7362 supply the source receipts, and +#7298 the directed tariff. OpenAI Codex and subagents materially +assisted the proof, implementation and verification. diff --git a/research/p104-changed-shared-midpoint-bound/PROOF.md b/research/p104-changed-shared-midpoint-bound/PROOF.md new file mode 100644 index 0000000000..9027c88213 --- /dev/null +++ b/research/p104-changed-shared-midpoint-bound/PROOF.md @@ -0,0 +1,94 @@ +# Exact changed-role midpoint exclusions + +## Two-role topology + +Keep the original nonzero ADD, its signed coefficient and clock, +both outside paths, and the four paid MOVE clocks. Each operand +must have its immediately preceding and following literal contact +be a public ascending MOVE into and out of the old ADD chart. +Both operands of ADD and COPY are contacts. This guard prevents +a rechart of an unmodified intervening operator. + +The regenerated ten anchors come from the exact #7365 stock and +independent #7319 public-helper census. The forward contact +index and independent reverse chart walk agree on all their +adjacent events. For the other operand, six anchors have a +blocking ADD before only, one after only, and three on both +sides. Thus zero pairs reach actual reprice or exact GF(2) +offset tests. In the initial relaxation, eight of ten could +have a strictly positive rank profile if the peer geometry +were available. The directed one-edit upper was about +0.250511783519717 raw, the compatible relaxed whole upper about +1.372746550052082 raw, and the complete margin upper at κ = +0.0040075385047236 about −138.259532576579. Those stock ceilings +allow unknown peer ranks and grant ancillary work free. The +ten literal contacts give a verified compatible saving of zero +for this pair scope. + +## Closed component on chart 746 + +The two blocking ADDs involving role 452 give a single joint +component with these exact old routes. + +| Public role | Entrance chart | Midpoint | Exit chart | MOVE clocks | +|---:|---:|---:|---:|---| +| 1250 | 744 | 746 | 207 | 40833, 44593 | +| 452 | 263 | 746 | 916 | 40832, 41180 | +| 532 | 744 | 746 | 207 | 41178, 44611 | + +The two original contacts are `40834 ADD 452,1250,+2` and +`41179 ADD 532,452,−2`. Both walks verify they are the only contacts +of these roles inside their respective MOVE intervals. This exact +component also appears in the independently replayed +[#7338](https://github.com/CrocSwap/integer-mult-bounds/pull/7338) +`GEOMETRY-69.json` receipt under keys `532:41178:44611` and +`1250:40833:44593`; the [published receipt manifest](https://github.com/CrocSwap/integer-mult-bounds/blob/349996445176e934ffb3c76813adcd230ca8f783/research/p104-compensated-fusion-readout-bound/receipts/SHA256.json) +pins it at SHA-256 `a2dd10737f5bfbd3818e6766df3890e445fd46f661af9521f5d724b7c56c1d45`. +That contribution tests a compensated paid contraction. This +scope retains all six calls and redistributes their paid ranks +with a common replacement chart. + +The old paid leg ranks are 3+2, 3+1 and 3+2. Changing the +common midpoint rank from 6 to 6+δ changes each pair from +(p,q) to (p+δ,q−δ). Across all 17 copies, the only strictly +positive directed actual offset is δ = −2. Its signed paid +histogram delta is {1:+34, 2:−34, 3:−34, 4:+34}. Paid count +110,519, productive count 22,461 and signed rank surplus +1,424 stay fixed. This offset grants a net of at most about +0.106305391209185 raw at the incumbent crossing upper, and +one extra raw rank-one call overruns the price. The initial +whole component upper 0.197627453181767 grants all possible +peer ranks free and chooses at most one edit. It cannot be +added to the pair stock. The complete fixed-target upper is +about −139.549893451902. + +Write L = A₇₄₄ + A₂₆₃ for the span of the two entrance frames, +and H = C₂₀₇ ∩ C₉₁₆ for the intersection of the exit frames. Both old entrance frames lie in chart 746, and +chart 746 lies in both exits. Any common candidate frame E +must therefore satisfy L ⊆ E ⊆ H, with all six +leg ranks positive. Exact enumeration and independent Gaussian +elimination give `dim(L)=5` and `dim(H)=6`. The only profitable +actual rank is four, so it cannot contain L. Both engines match +the entire binary vector sets. There is no signed physical +candidate to materialize. + +## Same six legs with two coframes + +Retain both literal ADD clocks and each old outer chart. If role +452 enters a middle chart between the two ADDs, the first ADD +would use chart 263. Role 1250 would need an ascending paid +MOVE from 744 into 263. Both charts have rank three, and vector +134 belongs to 744 and not to 263. If 452 exits its middle chart +between the two ADDs, the second ADD would use chart 916. Role +532 would need to ascend from 916 into 207, but vector 1 belongs +to 916 and not to 207. Vector numbers are the original binary +frame encodings. If both MOVEs fall between the ADDs, both +obstructions apply. With neither paid MOVE between the ADDs, +452 occupies one chart throughout and the distinct-coframe +case does not arise. This argument keeps the six original paid +legs, both ADD clocks and outside charts fixed. + +These are scoped necessary-condition exclusions under the retained +native all-column, owned-erasure, compiler, precision/tape and +analytic recovery premises. No arbitrary-input supplier change, +full caller replay or new κ is asserted. diff --git a/research/p104-changed-shared-midpoint-bound/PROVENANCE.json b/research/p104-changed-shared-midpoint-bound/PROVENANCE.json new file mode 100644 index 0000000000..be17ffd4c3 --- /dev/null +++ b/research/p104-changed-shared-midpoint-bound/PROVENANCE.json @@ -0,0 +1,62 @@ +{ + "derived_gzip": { + "7314-HELPERS": { + "key": "REVERSE.json", + "receipt": "inputs/PR7319-SHA256.json" + }, + "R100-GEOMETRY": { + "key": "r100/lead/GEOMETRY.json", + "receipt": "inputs/PR7365-SHA256.json" + }, + "R100-PRICE": { + "key": "r100/lead/PRICE.json", + "receipt": "inputs/PR7365-SHA256.json" + }, + "R92-PRICE": { + "key": "R92-PRICE.json", + "receipt": "inputs/PR7362-SHA256.json" + } + }, + "files": { + "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/PR7319-SHA256.json": { + "commit": "b2d3bc4dd584f8d3aacd244505b12286db4d4875", + "git_blob": "3a28905e8d69888617b56578761c16d39fcdf7a6", + "path": "research/p104-helper-entrance-first-contact-bound/receipts/SHA256.json", + "sha256": "ca3ed296a19bdd7b2b37608e93d1763d97c7620ac9faef732a01bae4f485114c", + "source": "https://github.com/CrocSwap/integer-mult-bounds/blob/b2d3bc4dd584f8d3aacd244505b12286db4d4875/research/p104-helper-entrance-first-contact-bound/receipts/SHA256.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", + "uncompress": false + }, + "inputs/PR7365-SHA256.json": { + "commit": "98be9db1f28cdc5fa8962c7da065bc0174db9744", + "git_blob": "2c2e083626e3e3227dcc8cb2864e61222b273d3f", + "path": "research/p104-changed-public-move-contraction-bound/receipts/SHA256.json", + "sha256": "f8418b2b07e4ecb6d49d8839015e9ceab2224816d7863edd59cb03f29de34566", + "source": "https://github.com/CrocSwap/integer-mult-bounds/blob/98be9db1f28cdc5fa8962c7da065bc0174db9744/research/p104-changed-public-move-contraction-bound/receipts/SHA256.json" + }, + "inputs/pricing.py": { + "commit": "c522451caf287bb3c16eaece72be4c263315dca4", + "git_blob": "40ec194017bda1d524bba4f07b188c53281419d0", + "path": "research/adjacent-owned-add-exchange-bound/pricing.py", + "sha256": "f4d0b6c9314b838d882d6d06020f24881c19a3fda97a7c00df87b1e920785182", + "source": "https://github.com/CrocSwap/integer-mult-bounds/blob/c522451caf287bb3c16eaece72be4c263315dca4/research/adjacent-owned-add-exchange-bound/pricing.py", + "uncompress": false + } + }, + "schema_version": 1 +} diff --git a/research/p104-changed-shared-midpoint-bound/README.md b/research/p104-changed-shared-midpoint-bound/README.md new file mode 100644 index 0000000000..52dac2e5bb --- /dev/null +++ b/research/p104-changed-shared-midpoint-bound/README.md @@ -0,0 +1,72 @@ +# Shared midpoint recharts on changed P104 helper paths + +**NO VERIFIED GAIN.** Exact Δκ = 0, a 0% change from the independently +reproduced conditional κ = `0.00364665195644` on exact +[#7334](https://github.com/CrocSwap/integer-mult-bounds/pull/7334) +`aaeec8c0acf01e99a5f331ef363a698d9c084ace` with signed +[#7113](https://github.com/CrocSwap/integer-mult-bounds/pull/7113) +`07a76c5e2738882c0cb322278e56f6cae3c9885d`. + +A common intermediate chart could reprice two paid MOVE paths around +a literal ADD while preserving their endpoints and paid clocks. Two +literal walks exhaust ten frozen changed-role anchors. The moving +helper always has the required MOVE pair. Every other operand has +an adjacent ADD on at least one side, so no anchor has the required +four-MOVE topology. [Exact contact receipt](receipts/R108-AGREEMENT.json). + +Two of those ADDs share role 452 and form one genuine closed +three-role component with roles 1250 and 532 on chart 746. Its sole +strictly positive actual price uses a common rank-four chart. The +entrance union has rank five and the exit intersection rank six, so +no rank-four chart can work. An additional same-six-leg check +excludes using two distinct coframes by moving either of role 452's +paid clocks between the two ADDs. No scoped case remains unresolved. +[Exact geometry and chronology receipt](receipts/R111-AGREEMENT.json). + +## Replay + +From a clean checkout, use CPython 3.12 with assertions enabled: + +```sh +python3.12 -I -B research/p104-changed-shared-midpoint-bound/replay.py +``` + +The standard-library replay authenticates the exact native word and +published predecessor receipts, regenerates the ten-anchor stock and +both contact walks, reconstructs the closed component's complete +paid delta, and checks the exact GF(2) spans and chronology witnesses. +It rejects modified stock and price inputs. Use `--out fresh-directory` +to retain all nine receipts. It needs no Git metadata, network, external +dependency root or previous temporary state. +[Provenance](PROVENANCE.json) · [Path-keyed hashes](LOCAL-PINS.json) · +[Proof and full price](PROOF.md). + +## Open next questions + +Can a different paid itinerary create a coframe of a feasible rank +while leaving enough margin for the complete changed bill? Start +with one explicit route change and price its paid calls, routing, +ownership, restoration, precision and tape before testing signed +arbitrary-input action. This package closes the ten exact pairs, +one exact common-chart component, and the stated fixed-six-leg +two-coframe chronology. Other components, changed outer charts, +additional legs and moved ADD clocks remain outside this scope. + +## Credit + +[#7334](https://github.com/CrocSwap/integer-mult-bounds/pull/7334) +supplies the exact native word and comparator, and +[#7113](https://github.com/CrocSwap/integer-mult-bounds/pull/7113) +the signed caller. [#7358](https://github.com/CrocSwap/integer-mult-bounds/pull/7358) +and [#7361](https://github.com/CrocSwap/integer-mult-bounds/pull/7361) +supply the four-MOVE and closed-component rechart methods on inherited +roles. Their changed-role guards exclude this component. +[#7338](https://github.com/CrocSwap/integer-mult-bounds/pull/7338) +previously recorded the same chart-746 block for a different +compensated paid-fusion test. [#7365](https://github.com/CrocSwap/integer-mult-bounds/pull/7365) +supplies the changed-role anchor and price stock. +[#7319](https://github.com/CrocSwap/integer-mult-bounds/pull/7319) +supplies the helper census, [#7362](https://github.com/CrocSwap/integer-mult-bounds/pull/7362) +the complete stock receipt and [#7298](https://github.com/CrocSwap/integer-mult-bounds/pull/7298) +the exact tariff. OpenAI Codex and subagents materially assisted +the proof, implementation, independent replay and packaging. diff --git a/research/p104-changed-shared-midpoint-bound/SOURCES.json b/research/p104-changed-shared-midpoint-bound/SOURCES.json new file mode 100644 index 0000000000..e8c2f265cd --- /dev/null +++ b/research/p104-changed-shared-midpoint-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-changed-shared-midpoint-bound/TASK.json b/research/p104-changed-shared-midpoint-bound/TASK.json new file mode 100644 index 0000000000..c2e63fdaa2 --- /dev/null +++ b/research/p104-changed-shared-midpoint-bound/TASK.json @@ -0,0 +1,117 @@ +{ + "actual_scope": "On exact #7334, test ten changed-role public sole-ADD anchors and their one closed chart-746 three-role component for a common paid midpoint rechart with fixed outside paths and paid counts.", + "ai_assistance": "OpenAI Codex and subagents materially assisted proof, implementation, independent verification and packaging.", + "author": "P104 changed-helper shared-midpoint research", + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "bottleneck_link": "Redistributing paid rank across the existing recursive MOVE calls can improve the complete signed cost only if all operands share a legal replacement chart without an unpriced intermediate contact.", + "budget_minutes": 8, + "evidence": "Two literal contact walks exclude all ten four-MOVE signatures. Both three-role engines confirm the only directed-positive offset requires rank four, below the exact rank-five entrance union. Same-six-leg chronology witnesses exclude two distinct coframes under the stated clock constraints.", + "open_questions": [ + { + "blocked_by": "The ten original pair paths and the fixed chart-746 six-leg component are exhausted within their stated contact and chart constraints.", + "first_step": "Specify one exact route change, pin all affected contacts, and check its complete directed price before any signed support test.", + "question": "Can a different priced paid itinerary enable a feasible common chart?", + "why_it_matters": "A legal shift in existing paid ranks can move the binding complex recurrence without changing productive ranks." + } + ], + "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": "Extends the inherited #7358 and #7361 shared-midpoint methods to exact changed public helper roles, including the closed chart-746 two-ADD component.", + "scope_status": "changed", + "stop_rule": "At most 76,466 events, ten exact pair anchors and 20 runner seconds. No actual offsets if topology fails. The frozen single closed component has at most three actual offsets and 20 seconds; skip build after exact geometry exclusion.", + "task_id": "p104-side-correction" +} diff --git a/research/p104-changed-shared-midpoint-bound/VERIFICATION.md b/research/p104-changed-shared-midpoint-bound/VERIFICATION.md new file mode 100644 index 0000000000..7c5eb97362 --- /dev/null +++ b/research/p104-changed-shared-midpoint-bound/VERIFICATION.md @@ -0,0 +1,19 @@ +# Verification + +CPython 3.12 with assertions and the standard library. The clean +local replay returned exit 0 and regenerated all nine exact receipts. +A separate relocated copy without Git metadata or inherited +environment variables returned exit 0 and matched every receipt +byte-for-byte. The direct and relocated full runs took 1.45 and 1.40 +seconds on the verification host. A modified stock and modified +price each returned exit 1 in their authenticated engine. + +Both topology walks exhausted all 76,466 events and ten frozen +anchors. There was no eligible two-role reprice. The one independent +closed component exhausted its exact offset scope and matched the +forward component in routes, bill and complete binary span sets. +Signed physical construction and full changed-caller verification +were skipped after the topology and geometry exclusions. + +The paths and complete receipt digests are in +[LOCAL-PINS.json](LOCAL-PINS.json) and [receipts/SHA256.json](receipts/SHA256.json). diff --git a/research/p104-changed-shared-midpoint-bound/VERIFY.json b/research/p104-changed-shared-midpoint-bound/VERIFY.json new file mode 100644 index 0000000000..4b34160921 --- /dev/null +++ b/research/p104-changed-shared-midpoint-bound/VERIFY.json @@ -0,0 +1,19 @@ +{ + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/replay.py" + ], + "checks": "Authenticate exact predecessor inputs, regenerate directed stock, independently compare ten pair contact paths and the closed component price, verify exact GF(2) exclusion and two-coframe witnesses, reject changed stock and price.", + "timeout_seconds": 120 + } + ], + "inputs": [], + "python": "3.12", + "requirements": [], + "schema_version": 1, + "status": "ready" +} diff --git a/research/p104-changed-shared-midpoint-bound/engines/r108/compare.py b/research/p104-changed-shared-midpoint-bound/engines/r108/compare.py new file mode 100644 index 0000000000..9a7ac655cb --- /dev/null +++ b/research/p104-changed-shared-midpoint-bound/engines/r108/compare.py @@ -0,0 +1,56 @@ +"""Match the ten R108 forward and reverse exact neighboring contacts.""" +from collections import Counter +from hashlib import sha256 +from json import dumps, loads +from pathlib import Path +import sys + +PINS = { + "independent/RESULT.json": "2fa3e2ac13b486416976ddf9c228ed80147eab7a1efacf8be26b5860102156c7", + "lead/ROUTES.json": "7787cbedb364a51ae1c3712086bbc3f70da35ba018037429ad7794d52c8edb93", +} + + +def unique(items): + result = dict(items) + if len(result) != len(items): + raise ValueError("duplicate JSON key") + return result + + +def main(root): + values = [] + for rel,digest in PINS.items(): + data = (root/rel).read_bytes() + if sha256(data).hexdigest() != digest: + raise ValueError(f"changed receipt: {rel}") + values.append(loads(data,object_pairs_hook=unique)) + reverse,forward=values + assert reverse["head"]==forward["head"] and reverse["caller"]==forward["caller"] + assert all(reverse["pins"][k]==forward["pins"][k] for k in reverse["pins"]) + assert reverse["complete"] and not reverse["unvisited"] and reverse["timeout"] is None + assert reverse["progress"]["events_replayed"]==forward["events"]==76466 + assert reverse["counts"]=={"adjacent contact is not MOVE":10} + assert forward["topology_counts"]=={"no four-MOVE topology":10} and not forward["price_counts"] + results, sides=[],Counter() + for a,b in zip(reverse["rows"],forward["results"],strict=True): + assert a["key"]==b["key"] and a["contact"]==[b["clock"],b["add"]] + assert a["midpoint_chart"]==b["old_chart"] and a["peer"]==b["peer"] + assert a["moving"]["role"]==b["mover"] and a["moving"]["clocks"]==b["anchor_move_clocks"] + neighbours=[a["other"][k] for k in ("previous","next")] + assert neighbours==[list(p) for p in zip(b["peer_neighbour_clocks"],b["peer_neighbour_events"],strict=True)] + assert b["status"]=="no four-MOVE topology" and not b["variants"] + blockers=[side for side,(_,event) in zip(("before","after"),neighbours,strict=True) if event[0]!="MOVE"] + assert blockers and all(event[0] in ("ADD","MOVE") for _,event in neighbours) + sides["both" if len(blockers)==2 else blockers[0]]+=1 + results.append(dict(key=a["key"],anchor_clock=b["clock"],mover_moves=[a["moving"]["previous"],a["moving"]["next"]], + peer=a["peer"],peer_neighbours=neighbours,blocking_sides=blockers)) + assert len(results)==10 + print(dumps(dict(head=forward["head"],input_sha256=PINS,matched=10,no_route=10, + actual_offset_count=0,geometry="skipped",remaining=0,blocking_sides=sides,results=results), + indent=2,sort_keys=True)) + + +if __name__=="__main__": + assert __debug__ + main(Path(sys.argv[1])) diff --git a/research/p104-changed-shared-midpoint-bound/engines/r108/reverse_routes.py b/research/p104-changed-shared-midpoint-bound/engines/r108/reverse_routes.py new file mode 100644 index 0000000000..10ec0262da --- /dev/null +++ b/research/p104-changed-shared-midpoint-bound/engines/r108/reverse_routes.py @@ -0,0 +1,192 @@ +"""Reconstruct the ten frozen R108 two-operand routes from reverse contacts.""" +from argparse import ArgumentParser +from bisect import bisect_left +from collections import Counter, defaultdict +from fractions import Fraction +from gzip import decompress +from hashlib import sha256 +from json import dumps, loads +from pathlib import Path +from signal import SIGALRM, alarm, signal +from time import monotonic +import sys + +ROOT = Path(__file__).resolve().parent +HEAD = "aaeec8c0acf01e99a5f331ef363a698d9c084ace" +CALLER = "07a76c5e2738882c0cb322278e56f6cae3c9885d" +WORD = "4b9fd1187b34ed97c3ac0c760d73531735a5d0ebc5b4d4ab4377160b20d9bb2a" +PAYLOAD = "9aa8d6b054ba7eb2289d052c1079b16be518d2f0fbfb244569fa18e3733acdac" +PINS = { + "inputs/STOCK.json": "2d256cbcc5fcbf2fb361c47b2d764c98e2f5ba1f734abb95e03be3935223ff28", + "inputs/7334-WORD.json.gz": WORD, +} +EVENTS, ANCHORS, SECONDS = 76466, 10, 20 + + +def unique(items): + out = dict(items) + if len(out) != len(items): + raise ValueError("duplicate JSON key") + return out + + +def authenticate(root, pins): + result = {} + for path, expected in pins.items(): + data = (root / path).read_bytes() + if sha256(data).hexdigest() != expected: + raise ValueError(f"changed dependency: {path}") + result[path] = data + return result + + +def operands(event): + op, dst, *args = event + return (dst,args[0]) if op in ("ADD","COPY") else (dst,) + + +def neighboring(contacts, clock): + i = bisect_left(contacts,clock,key=lambda pair:pair[0]) + assert i < len(contacts) and contacts[i][0] == clock + before = contacts[i-1] if i else None + after = contacts[i+1] if i+1 < len(contacts) else None + return before, after + + +def decode_route(before, after, role, chart, dimensions): + result = dict(role=role, previous=before, next=after) + if before is None or after is None: + return result | dict(status="missing adjacent contact") + f, first = before + g, second = after + if first[0] != "MOVE" or second[0] != "MOVE": + return result | dict(status="adjacent contact is not MOVE") + assert first[1] == second[1] == role and not first[4] and not second[4] + a,b = first[2:4] + bb,c = second[2:4] + assert b == bb == chart + p,q = dimensions[b]-dimensions[a], dimensions[c]-dimensions[b] + assert p>0 and q>0 + return result | dict(status="both paid MOVEs adjacent", clocks=[f,g], charts=[a,b,c], ranks=[p,q]) + + +def controls(): + move_in=["MOVE",1,4,5,False] + add=["ADD",2,1,"-1/2",5] + move_out=["MOVE",1,5,7,False] + assert operands(add)==(2,1) + assert operands(["COPY",7,1,"1",5])==(7,1) + before,after=neighboring([(1,move_in),(4,add),(7,move_out)],4) + assert decode_route(before,after,1,5,list(range(8)))["ranks"]==[1,2] + blocker=["ADD",3,1,"1",5] + before,after=neighboring([(1,move_in),(3,blocker),(4,add),(7,move_out)],4) + assert decode_route(before,after,1,5,list(range(8)))["status"]=="adjacent contact is not MOVE" + return ["ADD/COPY source counts as a contact","immediate signed adjacent paid MOVE pair", + "intervening read prevents route"] + + +def walk(word, targets, deadline, progress): + tape = word["program"] + public, owned = word["public"], word["owned_fields"] + assert (len(tape),public,owned)==(EVENTS,1501,68) + active = word["final"] + [None]*owned + contacts=defaultdict(list) + for t in range(EVENTS-1,-1,-1): + progress["first_unvisited_event"]=t + if t%128==0 and monotonic()>=deadline: + raise TimeoutError("reverse event cap") + op,r,*args=event=tape[t] + if op=="MOVE": + old,new,is_owned=args + assert active[r]==new and is_owned==(r>=public) + active[r]=old + elif op in ("INIT","CLEAR"): + assert r>=public and active[r]==(args[0] if op=="INIT" else None) + active[r]=None if op=="INIT" else args[0] + else: + assert op in ("ADD","COPY","SCALE") and active[r]==args[-1] + if op!="SCALE": + assert r!=args[0] and active[args[0]]==active[r] + assert op!="COPY" or r>=public + for role in operands(event): + if role in targets: + contacts[role].append((t,event)) + progress["events_replayed"]+=1 + assert active==word["initial"]+[None]*owned + progress["first_unvisited_event"]=None + return {role:list(reversed(contacts[role])) for role in targets} + + +def examine(word, anchors, contacts, deadline, rows): + dimensions=list(map(len,word["frames"])) + for anchor in anchors: + if monotonic()>=deadline: + raise TimeoutError("anchor case cap") + clock,event=anchor["contact"] + first,last,mover=anchor["key"] + peer=anchor["peer"] + assert first=deadline: + raise TimeoutError("R108 contact index") + for r in touches(e): + if r in roles: + log[r].append(t) + invoice=Counter({int(k):v for k,v in prior["old_targets"].items()}) + invoice.subtract({int(k):v for k,v in prior["old_paid"].items()}) + assert sum(k*v for k,v in invoice.items())==1424 + at,probe,target=[Q(old[k]) for k in ("old_crossing_upper","probe","fixed_target")] + cost=run_path(str(ROOT/"inputs/pricing.py"))["cost"] + results=[] + counts=Counter() + for row in rows: + f,g,s=row["key"] + p=row["peer"] + a,b,c=row["charts"] + t,add=row["contact"] + assert tape[t]==add and set(add[1:3])=={s,p} and s0 for r in rs) + record.update(charts=[a,ap,b,c,cp],ranks=rs,all_paid_clocks=[f,g,i,j]) + for d in range(1-min(rs[0],rs[2]),min(rs[1],rs[3])): + if not d: + continue + delta=paid_delta(rs,d) + signed={k:-v for k,v in delta.items()} + after=invoice.copy() + after.update(signed) + lower,upper=cost(after,probe) + margin=cost(signed,at) + assert sum(k*v for k,v in delta.items())==0 and sum(delta.values())==0 + record["variants"].append(dict(offset=d,required_rank=len(frames[b])+d,paid_delta=delta, + net=list(map(str,margin)),full_probe=[str(lower),str(upper)], + target_net=list(map(str,cost(signed,target))), + status="positive" if lower>0 else "nonpositive" if upper<=0 else "price unresolved")) + record["status"]="four-MOVE topology" + counts[record["status"]]+=1 + results.append(record) + alarm(0) + variants=[v for r in results for v in r["variants"]] + assert len(variants)<=160 + print(json.dumps(dict(head=old["head"],caller=old["caller_head"],pins=PINS,events=len(tape), + controls=["bidirectional contact index","positive ranks","unchanged paid mass and count"], + old_paid=110519,productive=22461,results=results,topology_counts=counts, + price_counts=Counter(v["status"] for v in variants),caps={"anchors":10,"events":76466,"seconds":20,"offsets":160}), + indent=2,sort_keys=True)) + + +if __name__=="__main__": + main() diff --git a/research/p104-changed-shared-midpoint-bound/engines/r111/geometry.py b/research/p104-changed-shared-midpoint-bound/engines/r111/geometry.py new file mode 100644 index 0000000000..4c6cca1883 --- /dev/null +++ b/research/p104-changed-shared-midpoint-bound/engines/r111/geometry.py @@ -0,0 +1,115 @@ +"""Test literal closure and exact chart dimensions of one priced component.""" +from collections import defaultdict +from fractions import Fraction as Q +from gzip import decompress +from hashlib import sha256 +import json +from pathlib import Path +from signal import SIGALRM, alarm, signal +from time import monotonic + +ROOT=Path(__file__).resolve().parents[1] +PINS={ + "lead/PRICE.json":"96802c4ee39368c0e0b7d5b245372a979f68047ecbb0ae3517ced7e38dbf9a9a", + "inputs/7334-WORD.json.gz":"4b9fd1187b34ed97c3ac0c760d73531735a5d0ebc5b4d4ab4377160b20d9bb2a", +} + + +def checked(path): + raw=(ROOT/path).read_bytes() + if sha256(raw).hexdigest()!=PINS[path]: + raise ValueError(f"changed dependency {path}") + return raw + + +def span(vectors): + out={0} + for v in vectors: + assert 0=deadline: + raise TimeoutError("contact index") + for r in touches(e): + if r in roles: + log[r].append([t,e]) + fields=[] + ranks=[] + for r,a,b,c,f,g in p["fields"]: + assert tape[f]==["MOVE",r,a,b,False] and tape[g]==["MOVE",r,b,c,False] + middle=[x for x in log[r] if f0 for z in rs) + fields.append(dict(role=r,route=[a,b,c],clocks=[f,g],ranks=rs,middle=middle,closed=middle==expected)) + ranks.append(rs) + assert ranks[0]==ranks[2]==[3,2] + positive=[v for v in p["positive_relaxed_variants"] if v["old_peer_ranks"]==ranks[1]] + assert len(positive)<=p["limits"]["actual_offsets"] + active=all(r["closed"] for r in fields) + geometry=[] + if active and positive: + spans=list(map(span,w["frames"])) + low={u^v for u in spans[744] for v in spans[263]} + high=spans[207]&spans[916] + assert low<=spans[746]<=high and len(spans[746])==64 + for v in positive: + rank=v["rank"] + possible=len(low)<=2**rank<=len(high) + existing=[i for i,s in enumerate(spans) if len(s)==2**rank and low<=s<=high] if possible else [] + new_basis=w["frames"][existing[0]] if existing else extend(basis(low),high,rank) if possible else None + geometry.append(v|dict(status="geometry survivor" if possible else + "low union too large" if 2**rank0: + variants.append(dict(old_peer_ranks=[p,q],offset=d,rank=6+d,paid_delta=d_paid, + net=list(map(str,net)),full_probe=list(map(str,whole)), + target_net=list(map(str,cost(credit,target))), + extra_rank_one_upper=str(cost(new,at)[1]-1))) + assert variants and all(Q(v["extra_rank_one_upper"])<0 for v in variants) + result=dict(head=routes["head"],caller=routes["caller"],pins=PINS,fields=fields, + add_events=[[r["clock"],r["add"]] for r in pair],word_sha256=prior["word_sha256"],payload_sha256=prior["word_payload_sha256"], + old_chart=746,old_chart_rank=6,old_paid=110519,new_paid=110519,productive=22461,surplus=1424, + positive_relaxed_variants=variants,one_upper=str(max(Q(v["net"][1]) for v in variants)), + complete_target_upper=str(cost(old,target)[1]+max(Q(v["target_net"][1]) for v in variants)), + limits={"components":1,"events":76466,"actual_offsets":3,"seconds":20,"prototype_seconds":120,"prototype_cases":1}) + print(json.dumps(result,indent=2,sort_keys=True)) + + +if __name__=="__main__": + assert __debug__ + main() diff --git a/research/p104-changed-shared-midpoint-bound/engines/r111/verify.py b/research/p104-changed-shared-midpoint-bound/engines/r111/verify.py new file mode 100644 index 0000000000..d1403783e7 --- /dev/null +++ b/research/p104-changed-shared-midpoint-bound/engines/r111/verify.py @@ -0,0 +1,247 @@ +"""Reverse closure, exact actual price, and GF(2) interval for the frozen chart-746 component.""" +from argparse import ArgumentParser +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 time import monotonic +import sys + +ROOT=Path(__file__).resolve().parent +HEAD="aaeec8c0acf01e99a5f331ef363a698d9c084ace" +CALLER="07a76c5e2738882c0cb322278e56f6cae3c9885d" +WORD="4b9fd1187b34ed97c3ac0c760d73531735a5d0ebc5b4d4ab4377160b20d9bb2a" +PAYLOAD="9aa8d6b054ba7eb2289d052c1079b16be518d2f0fbfb244569fa18e3733acdac" +PINS={ + "inputs/PRICE.json":"96802c4ee39368c0e0b7d5b245372a979f68047ecbb0ae3517ced7e38dbf9a9a", + "inputs/R108-ROUTES.json":"7787cbedb364a51ae1c3712086bbc3f70da35ba018037429ad7794d52c8edb93", + "inputs/R100-PRICE.json":"7109125bbf60e3015c8c0ac7b10b24b7de61f358c1508d06604ebccd89ef6343", + "inputs/R92-PRICE.json":"05d7a5ebdd2eeedd6c8f534e8e2eeac22484daf9f387f4a6b88cc9eed22a6b8f", + "inputs/pricing.py":"f4d0b6c9314b838d882d6d06020f24881c19a3fda97a7c00df87b1e920785182", + "inputs/reverse_routes.py":"a81a41c1cd33de0a612b568cbf470003d933a344396bc6dc53b85a91888dfe27", + "inputs/7334-WORD.json.gz":WORD, +} +EVENTS,SECONDS,OFFSETS=76466,20,3 + + +def unique(items): + d=dict(items) + if len(d)!=len(items): + raise ValueError("duplicate JSON key") + return d + + +def pinned(path,digest): + raw=path.read_bytes() + if sha256(raw).hexdigest()!=digest: + raise ValueError(f"changed dependency: {path.name}") + return raw + + +def closure(word,price,prior,old_price,engine,cost,deadline,state): + fields=price["fields"] + adds=price["add_events"] + expected={r:[(f,["MOVE",r,a,b,False]),*((t,e) for t,e in adds if r in e[1:3]),(g,["MOVE",r,b,c,False])] + for r,a,b,c,f,g in fields} + assert set(expected)=={1250,452,532} and all(Q(e[-2]) for _,e in adds) + state.update(events_replayed=0,first_unvisited_event=EVENTS-1) + contacts=engine["walk"](word,set(expected),deadline,state) + ranks,rows,blockers=[],[],[] + for role,a,b,c,f,g in fields: + assert role0 and q>0 + ranks.append((p,q)) + assert len({t for _,_,_,_,f,g in fields for t in (f,g)})==6 + if blockers: + return dict(contacts=rows,blocked_roles=blockers,actual_offsets=[],positive_offsets=[]) + assert ranks[0]==ranks[2]==(3,2) and len(word["frames"][746])==6 + p,q=ranks[1] + targets=Counter({int(r):n for r,n in prior["old_targets"].items()}) + paid=Counter({int(r):n for r,n in prior["old_paid"].items()}) + assert sum(paid.values())==price["old_paid"]==price["new_paid"]==110519 + assert sum(targets.values())==price["productive"]==22461 + old=targets.copy() + old.subtract(paid) + assert sum(r*n for r,n in old.items())==1424 + at,probe,target=(Q(old_price[k]) for k in ("old_crossing_upper","probe","fixed_target")) + expected_prices={v["offset"]:v for v in price["positive_relaxed_variants"] if v["old_peer_ranks"]==[p,q]} + actual,positive=[],[] + for delta in range(1-min(p,3),min(q,2)): + if not delta: + continue + if monotonic()>=deadline: + raise TimeoutError("actual offset price cap") + change=Counter() + for l,h in ranks: + change.update((l+delta,h-delta)) + change.subtract((l,h)) + d_paid={r:17*n for r,n in change.items() if n} + assert sum(d_paid.values())==sum(r*n for r,n in d_paid.items())==0 + credit={r:-n for r,n in d_paid.items()} + invoice=old.copy() + invoice.update(credit) + whole=cost(invoice,probe) + row=dict(offset=delta,rank=6+delta,paid_delta=d_paid,full_probe=list(map(str,whole))) + actual.append(row) + if whole[0]>0: + positive.append(row) + original=expected_prices[delta] + assert {str(k):v for k,v in d_paid.items()}==original["paid_delta"] and row["full_probe"]==original["full_probe"] + assert list(map(str,cost(credit,at)))==original["net"] + assert list(map(str,cost(credit,target)))==original["target_net"] + else: + assert whole[1]<=0 and delta not in expected_prices + assert len(actual)<=OFFSETS and {r["offset"] for r in positive}==set(expected_prices) + return dict(contacts=rows,blocked_roles=[],old_ranks=ranks,actual_offsets=actual,positive_offsets=positive) + + +def vector_span(basis): + result={0} + for v in basis: + assert isinstance(v,int) and 0=deadline: + raise TimeoutError("exact GF(2) cap") + rank=v["rank"] + assert max(map(dimension,lows)) 0 and cost(changed,probe)[1] > 0: + alternatives[left,right,offset] = (interval[1],cost(credit,target)[1]) + maxima = [max((v[i] for v in alternatives.values()),default=Q(0)) for i in (0,1)] + return len(alternatives),maxima + + +def packing(rows,axis): + conflicts = [] + for row in rows: + conflicts.append(sum(1< 0 + if add[2] == mover and add[1] < 1501: + typed.append(dict(key=r["key"],charts=r["charts"],ranks=r["ranks"], contact=[clock,add], + recipient=add[1],quote=quote,uppers=[Q(quote[k][1]) for k in ("net","net_target")])) + peer = add[2] if add[1] == mover else add[1] + if peer >= 1501 or peer in protected or peer not in helpers: + skip.append([clock,"peer outside eligible public helper class"]) + continue + if peer in changed and not any(v["key"][2] == peer and v["contacts"] == [[clock,add]] for v in single): + skip.append([clock,"changed peer has no corresponding sole-ADD pair"]) + continue + variants, uppers = rank_tilt(r,old,cost,at,probe,target) + tilt.append(dict(key=r["key"],ranks=r["ranks"],charts=r["charts"],contact=[clock,add], + peer=peer,positive_relaxed_profiles=variants,uppers=uppers)) + assert len(typed) == 8 and len({r["key"][2] for r in typed}) == 7 + assert sum(2*(r["key"][1]-r["key"][0]-1) for r in typed) == 33560 + assert len(single) == 17 and len(tilt)+len(skip) == len(single) + assert all(len({tuple(r["key"]) for r in rows}) == len(rows) for rows in (typed,tilt)) + + def summary(rows): + return dict(one_upper=str(max(row["uppers"][0] for row in rows)), + whole_upper=str(packing(rows,0)),fixed_target_complete_upper=str(cost(old,target)[1]+packing(rows,1)), + anchors=rows) + + result = dict(head=price["head"],caller=price["caller_head"],pins=PINS|{"helpers":HELPERS}, + classification="receipt-only price arithmetic, no literal word or support", + source_side=summary(typed),midpoint_rank_tilt=summary(tilt),midpoint_guard_exclusions=skip) + print(dumps(result,indent=2,sort_keys=True,default=str)) + + +if __name__ == "__main__": + main() diff --git a/research/p104-changed-shared-midpoint-bound/inputs/7314-HELPERS.json.gz b/research/p104-changed-shared-midpoint-bound/inputs/7314-HELPERS.json.gz new file mode 100644 index 0000000000..04698c9459 Binary files /dev/null and b/research/p104-changed-shared-midpoint-bound/inputs/7314-HELPERS.json.gz differ diff --git a/research/p104-changed-shared-midpoint-bound/inputs/7334-WORD.json.gz b/research/p104-changed-shared-midpoint-bound/inputs/7334-WORD.json.gz new file mode 100644 index 0000000000..73f4300719 Binary files /dev/null and b/research/p104-changed-shared-midpoint-bound/inputs/7334-WORD.json.gz differ diff --git a/research/p104-changed-shared-midpoint-bound/inputs/PR7319-SHA256.json b/research/p104-changed-shared-midpoint-bound/inputs/PR7319-SHA256.json new file mode 100644 index 0000000000..3a28905e8d --- /dev/null +++ b/research/p104-changed-shared-midpoint-bound/inputs/PR7319-SHA256.json @@ -0,0 +1,6 @@ +{ + "COMPARE.json": "58d851ca486ec84ea0d1f063eb427ed0204b1b1e49219376d0ab20f6692e043e", + "CONTACT.json": "6d6cb681db29501aec002bd620514b4c48db03424243bf71686ba023dd8d6507", + "PRICE.json": "8d70669e720faabc932366dafbc1bd1fdaef6f088c4eb02b0ea3707ba309ab53", + "REVERSE.json": "bf353b3e05d0bf5fe3e49c15673c4cb9203251329bd594009303541cf7fecc09" +} diff --git a/research/p104-changed-shared-midpoint-bound/inputs/PR7362-SHA256.json b/research/p104-changed-shared-midpoint-bound/inputs/PR7362-SHA256.json new file mode 100644 index 0000000000..b1486e0b5c --- /dev/null +++ b/research/p104-changed-shared-midpoint-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-changed-shared-midpoint-bound/inputs/PR7365-SHA256.json b/research/p104-changed-shared-midpoint-bound/inputs/PR7365-SHA256.json new file mode 100644 index 0000000000..2c2e083626 --- /dev/null +++ b/research/p104-changed-shared-midpoint-bound/inputs/PR7365-SHA256.json @@ -0,0 +1,10 @@ +{ + "r100/independent/AGREEMENT.json": "ef797676d7550c65ca1780e5c7f8cc568f53f9c80ce764a659754c0cbcdc13e3", + "r100/independent/RESULT.json": "5462d132a6610dc8953332cadcad0c9b2096fa7db2bc131af3dbd80614b52d25", + "r100/lead/GEOMETRY.json": "075301daf545c8021800c36af19d05517e3c4136dac4e2114cb85204d0b31c64", + "r100/lead/PRICE.json": "7109125bbf60e3015c8c0ac7b10b24b7de61f358c1508d06604ebccd89ef6343", + "r101/independent/AGREEMENT.json": "9618ff9dc2282bee0068866879d900f881dc440234c5d12cb0dcf983c21eb6f3", + "r101/independent/RESULT.json": "526deef9465a563146100282ccb84bcc3d7613333354c48ec9452d97ff7d3d20", + "r101/lead/PRICE.json": "ac5ecb17f0e9f3c068423998b350a78c1a4769b6f61b50838be5f3e0d0b1a00c", + "r101/lead/SUPPORT.json": "b7700e618ce3c69cbe7544842f265e980f87903dea30121df118861d104b2c51" +} diff --git a/research/p104-changed-shared-midpoint-bound/inputs/R100-GEOMETRY.json.gz b/research/p104-changed-shared-midpoint-bound/inputs/R100-GEOMETRY.json.gz new file mode 100644 index 0000000000..fe9a6f6919 Binary files /dev/null and b/research/p104-changed-shared-midpoint-bound/inputs/R100-GEOMETRY.json.gz differ diff --git a/research/p104-changed-shared-midpoint-bound/inputs/R100-PRICE.json.gz b/research/p104-changed-shared-midpoint-bound/inputs/R100-PRICE.json.gz new file mode 100644 index 0000000000..8b1113438c Binary files /dev/null and b/research/p104-changed-shared-midpoint-bound/inputs/R100-PRICE.json.gz differ diff --git a/research/p104-changed-shared-midpoint-bound/inputs/R92-PRICE.json.gz b/research/p104-changed-shared-midpoint-bound/inputs/R92-PRICE.json.gz new file mode 100644 index 0000000000..5aabb0ff2e Binary files /dev/null and b/research/p104-changed-shared-midpoint-bound/inputs/R92-PRICE.json.gz differ diff --git a/research/p104-changed-shared-midpoint-bound/inputs/pricing.py b/research/p104-changed-shared-midpoint-bound/inputs/pricing.py new file mode 100644 index 0000000000..40ec194017 --- /dev/null +++ b/research/p104-changed-shared-midpoint-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-changed-shared-midpoint-bound/receipts/R108-AGREEMENT.json b/research/p104-changed-shared-midpoint-bound/receipts/R108-AGREEMENT.json new file mode 100644 index 0000000000..5255c87e8d --- /dev/null +++ b/research/p104-changed-shared-midpoint-bound/receipts/R108-AGREEMENT.json @@ -0,0 +1,582 @@ +{ + "actual_offset_count": 0, + "blocking_sides": { + "after": 1, + "before": 6, + "both": 3 + }, + "geometry": "skipped", + "head": "aaeec8c0acf01e99a5f331ef363a698d9c084ace", + "input_sha256": { + "independent/RESULT.json": "2fa3e2ac13b486416976ddf9c228ed80147eab7a1efacf8be26b5860102156c7", + "lead/ROUTES.json": "7787cbedb364a51ae1c3712086bbc3f70da35ba018037429ad7794d52c8edb93" + }, + "matched": 10, + "no_route": 10, + "remaining": 0, + "results": [ + { + "anchor_clock": 40168, + "blocking_sides": [ + "before", + "after" + ], + "key": [ + 40167, + 40173, + 962 + ], + "mover_moves": [ + [ + 40167, + [ + "MOVE", + 962, + 3, + 597, + false + ] + ], + [ + 40173, + [ + "MOVE", + 962, + 597, + 120, + false + ] + ] + ], + "peer": 1340, + "peer_neighbours": [ + [ + 38174, + [ + "ADD", + 1340, + 981, + "-2", + 597 + ] + ], + [ + 42539, + [ + "ADD", + 1340, + 499, + "4", + 597 + ] + ] + ] + }, + { + "anchor_clock": 40240, + "blocking_sides": [ + "before", + "after" + ], + "key": [ + 40239, + 40833, + 1250 + ], + "mover_moves": [ + [ + 40239, + [ + "MOVE", + 1250, + 3, + 744, + false + ] + ], + [ + 40833, + [ + "MOVE", + 1250, + 744, + 746, + false + ] + ] + ], + "peer": 1125, + "peer_neighbours": [ + [ + 40238, + [ + "ADD", + 1123, + 1125, + "-1", + 744 + ] + ], + [ + 41088, + [ + "ADD", + 1125, + 1464, + "1/2", + 744 + ] + ] + ] + }, + { + "anchor_clock": 41177, + "blocking_sides": [ + "before" + ], + "key": [ + 41176, + 41178, + 532 + ], + "mover_moves": [ + [ + 41176, + [ + "MOVE", + 532, + 3, + 744, + false + ] + ], + [ + 41178, + [ + "MOVE", + 532, + 744, + 746, + false + ] + ] + ], + "peer": 363, + "peer_neighbours": [ + [ + 41156, + [ + "ADD", + 1464, + 363, + "1/2", + 744 + ] + ], + [ + 42026, + [ + "MOVE", + 363, + 744, + 1070, + false + ] + ] + ] + }, + { + "anchor_clock": 40209, + "blocking_sides": [ + "before" + ], + "key": [ + 40208, + 41321, + 1305 + ], + "mover_moves": [ + [ + 40208, + [ + "MOVE", + 1305, + 120, + 856, + false + ] + ], + [ + 41321, + [ + "MOVE", + 1305, + 856, + 983, + false + ] + ] + ], + "peer": 1065, + "peer_neighbours": [ + [ + 39183, + [ + "ADD", + 578, + 1065, + "1/2", + 856 + ] + ], + [ + 43425, + [ + "MOVE", + 1065, + 856, + 980, + false + ] + ] + ] + }, + { + "anchor_clock": 42534, + "blocking_sides": [ + "before", + "after" + ], + "key": [ + 42533, + 42599, + 198 + ], + "mover_moves": [ + [ + 42533, + [ + "MOVE", + 198, + 3, + 597, + false + ] + ], + [ + 42599, + [ + "MOVE", + 198, + 597, + 120, + false + ] + ] + ], + "peer": 709, + "peer_neighbours": [ + [ + 42532, + [ + "ADD", + 122, + 709, + "2", + 597 + ] + ], + [ + 42536, + [ + "ADD", + 217, + 709, + "2", + 597 + ] + ] + ] + }, + { + "anchor_clock": 43136, + "blocking_sides": [ + "before" + ], + "key": [ + 43135, + 44564, + 654 + ], + "mover_moves": [ + [ + 43135, + [ + "MOVE", + 654, + 120, + 856, + false + ] + ], + [ + 44564, + [ + "MOVE", + 654, + 856, + 983, + false + ] + ] + ], + "peer": 302, + "peer_neighbours": [ + [ + 42395, + [ + "ADD", + 302, + 578, + "-1/2", + 856 + ] + ], + [ + 44529, + [ + "MOVE", + 302, + 856, + 980, + false + ] + ] + ] + }, + { + "anchor_clock": 40834, + "blocking_sides": [ + "after" + ], + "key": [ + 40833, + 44593, + 1250 + ], + "mover_moves": [ + [ + 40833, + [ + "MOVE", + 1250, + 744, + 746, + false + ] + ], + [ + 44593, + [ + "MOVE", + 1250, + 746, + 207, + false + ] + ] + ], + "peer": 452, + "peer_neighbours": [ + [ + 40832, + [ + "MOVE", + 452, + 263, + 746, + false + ] + ], + [ + 41179, + [ + "ADD", + 532, + 452, + "-2", + 746 + ] + ] + ] + }, + { + "anchor_clock": 38255, + "blocking_sides": [ + "before" + ], + "key": [ + 38254, + 44594, + 969 + ], + "mover_moves": [ + [ + 38254, + [ + "MOVE", + 969, + 3, + 392, + false + ] + ], + [ + 44594, + [ + "MOVE", + 969, + 392, + 207, + false + ] + ] + ], + "peer": 1109, + "peer_neighbours": [ + [ + 38085, + [ + "ADD", + 1109, + 951, + "1/2", + 392 + ] + ], + [ + 41084, + [ + "MOVE", + 1109, + 392, + 739, + false + ] + ] + ] + }, + { + "anchor_clock": 40103, + "blocking_sides": [ + "before" + ], + "key": [ + 40102, + 44609, + 205 + ], + "mover_moves": [ + [ + 40102, + [ + "MOVE", + 205, + 3, + 392, + false + ] + ], + [ + 44609, + [ + "MOVE", + 205, + 392, + 207, + false + ] + ] + ], + "peer": 347, + "peer_neighbours": [ + [ + 39388, + [ + "ADD", + 187, + 347, + "-1/2", + 392 + ] + ], + [ + 41075, + [ + "MOVE", + 347, + 392, + 739, + false + ] + ] + ] + }, + { + "anchor_clock": 41179, + "blocking_sides": [ + "before" + ], + "key": [ + 41178, + 44611, + 532 + ], + "mover_moves": [ + [ + 41178, + [ + "MOVE", + 532, + 744, + 746, + false + ] + ], + [ + 44611, + [ + "MOVE", + 532, + 746, + 207, + false + ] + ] + ], + "peer": 452, + "peer_neighbours": [ + [ + 40834, + [ + "ADD", + 452, + 1250, + "2", + 746 + ] + ], + [ + 41180, + [ + "MOVE", + 452, + 746, + 916, + false + ] + ] + ] + } + ] +} diff --git a/research/p104-changed-shared-midpoint-bound/receipts/R111-AGREEMENT.json b/research/p104-changed-shared-midpoint-bound/receipts/R111-AGREEMENT.json new file mode 100644 index 0000000000..3aaa7aea61 --- /dev/null +++ b/research/p104-changed-shared-midpoint-bound/receipts/R111-AGREEMENT.json @@ -0,0 +1,26 @@ +{ + "dimension_interval": [ + 5, + 6 + ], + "distinct_coframe_chronology": { + "entrance_between_adds": { + "outside_vector": 134, + "required_strict_inclusion": [ + 744, + 263 + ] + }, + "exit_between_adds": { + "outside_vector": 1, + "required_strict_inclusion": [ + 916, + 207 + ] + } + }, + "head": "aaeec8c0acf01e99a5f331ef363a698d9c084ace", + "matched_positive_offsets": 1, + "matched_roles": 3, + "rejected_rank": 4 +} diff --git a/research/p104-changed-shared-midpoint-bound/receipts/SHA256.json b/research/p104-changed-shared-midpoint-bound/receipts/SHA256.json new file mode 100644 index 0000000000..e977655658 --- /dev/null +++ b/research/p104-changed-shared-midpoint-bound/receipts/SHA256.json @@ -0,0 +1,11 @@ +{ + "R106-STOCK.json": "2d256cbcc5fcbf2fb361c47b2d764c98e2f5ba1f734abb95e03be3935223ff28", + "R108-AGREEMENT.json": "33e31c27852d9b375572ecc024b9e6c96ee1b429c8641bc83ec3a4be4cb11036", + "R108-REVERSE.json": "2fa3e2ac13b486416976ddf9c228ed80147eab7a1efacf8be26b5860102156c7", + "R108-ROUTES.json": "7787cbedb364a51ae1c3712086bbc3f70da35ba018037429ad7794d52c8edb93", + "R111-AGREEMENT.json": "b98f7bcfcf8f8fb640f3d6825a6714418948d4b95581859591ed16fed408dbc9", + "R111-GEOMETRY.json": "05b6fa2d4480627d4c83918763b9d8c80a229d24a741520729f84b2c75d559a2", + "R111-LITERAL-PRICE.json": "0f2159c625f7c4c0853f58ff7f01ef0e97df216aea109134a3d7ff3f5ce95b13", + "R111-PRICE.json": "96802c4ee39368c0e0b7d5b245372a979f68047ecbb0ae3517ced7e38dbf9a9a", + "R111-REVERSE-GEOMETRY.json": "4966213b7a121f8e5d3f7718f24195ffc0d1c185c769076fc1e459f6507ca37a" +} diff --git a/research/p104-changed-shared-midpoint-bound/replay.py b/research/p104-changed-shared-midpoint-bound/replay.py new file mode 100644 index 0000000000..17627564d3 --- /dev/null +++ b/research/p104-changed-shared-midpoint-bound/replay.py @@ -0,0 +1,184 @@ +"""Rebuild the changed-role shared-midpoint price, topology and exact exclusion.""" +from argparse import ArgumentParser +from fractions import Fraction +from gzip import decompress +from hashlib import sha1,sha256 +from json import dumps,loads +from pathlib import Path,PurePosixPath +from runpy import run_path +from shutil import copyfile +from subprocess import run +import sys +from tempfile import TemporaryDirectory + +ROOT=Path(__file__).resolve().parent +HEAD="aaeec8c0acf01e99a5f331ef363a698d9c084ace" + + +def unique(items): + result=dict(items) + if len(result)!=len(items): + 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 relative(name): + path=PurePosixPath(name) + if path.is_absolute() or path.as_posix()!=name or ".." in path.parts: + raise ValueError(f"invalid relative path: {name}") + return path + + +def authenticate(): + pins=decode((ROOT/"LOCAL-PINS.json").read_bytes()) + for name,expected in pins.items(): + if digest((ROOT/relative(name)).read_bytes())!=expected: + raise ValueError(f"changed package dependency: {name}") + provenance=decode((ROOT/"PROVENANCE.json").read_bytes()) + for name,record in provenance["files"].items(): + raw=(ROOT/relative(name)).read_bytes() + assert digest(raw)==record["sha256"]==pins[name] + assert sha1(f"blob {len(raw)}\0".encode()+raw).hexdigest()==record["git_blob"] + inputs={} + for name,record in provenance["derived_gzip"].items(): + raw=decompress((ROOT/"inputs"/f"{name}.json.gz").read_bytes()) + published=decode((ROOT/relative(record["receipt"])).read_bytes()) + assert digest(raw)==published[record["key"]] + inputs[name]=raw + return inputs + + +def command(script,*args,timeout=25,check=True): + response=run([sys.executable,"-I","-B",str(script),*map(str,args)],capture_output=True,timeout=timeout) + if check and response.returncode: + sys.stderr.write(response.stderr.decode(errors="replace")) + response.check_returncode() + return response + + +def compare_triad(lead,literal,exact,verify_script): + assert lead["closed"] and not literal["blocked_roles"] + assert lead["events"]==literal["progress"]["events_replayed"]==76466 + for x,y,r in zip(lead["fields"],literal["contacts"],literal["old_ranks"],strict=True): + assert x["role"]==y["role"] and x["clocks"]==[y["contacts"][0][0],y["contacts"][-1][0]] + assert x["middle"]==y["contacts"][1:-1] and x["ranks"]==r + assert literal["old_ranks"]==[[3,2],[3,1],[3,2]] + a,b,c=lead["results"][0],literal["positive_offsets"][0],exact["results"][0] + assert len(lead["results"])==len(literal["positive_offsets"])==len(exact["results"])==1 + assert all(a[k]==b[k] for k in ("offset","rank","full_probe","paid_delta")) + assert a["offset"]==c["offset"]==-2 and a["rank"]==c["rank"]==4 + assert a["status"]=="low union too large" and not c["abstract_feasible"] + assert a["existing_charts"]==c["existing_chart_labels"]==[] + span=run_path(str(verify_script))["vector_span"] + assert sorted(span(a["low_union_basis"]))==exact["low_union_vectors"] + assert sorted(span(a["high_intersection_basis"]))==exact["high_intersection_vectors"] + assert (exact["low_union_rank"],exact["high_intersection_rank"])==(5,6) + data=dict(head=lead["head"],matched_roles=3,matched_positive_offsets=1,dimension_interval=[5,6], + rejected_rank=4,distinct_coframe_chronology=exact["distinct_coframe_chronology"]) + return (dumps(data,indent=2,sort_keys=True)+"\n").encode() + + +def copy(root,folder,files): + for name,source in files.items(): + copyfile(root/relative(source),folder/relative(name)) + + +def replay(scratch,out): + inputs=authenticate() + expected=decode((ROOT/"receipts/SHA256.json").read_bytes()) + produced={} + + def record(name,raw,path=None): + assert digest(raw)==expected[name],("changed receipt",name) + produced[name]=raw + if path is not None: + path.write_bytes(raw) + return decode(raw) + + r100,r108,r111=(scratch/name for name in ("r100","r108","r111")) + for root in (r100,r108,r111): + for folder in ("inputs","lead","independent/inputs"): + (root/folder).mkdir(parents=True) + for root in (r108,r111): + copy(ROOT,root,{"inputs/7334-WORD.json.gz":"inputs/7334-WORD.json.gz","inputs/pricing.py":"inputs/pricing.py"}) + for key in ("R100-PRICE","R92-PRICE"): + (root/"inputs"/f"{key}.json").write_bytes(inputs[key]) + (r100/"lead/GEOMETRY.json").write_bytes(inputs["R100-GEOMETRY"]) + (r100/"lead/PRICE.json").write_bytes(inputs["R100-PRICE"]) + (r100/"inputs/R92-PRICE.json").write_bytes(inputs["R92-PRICE"]) + (r100/"inputs/7314-HELPERS.json").write_bytes(inputs["7314-HELPERS"]) + copyfile(ROOT/"inputs/pricing.py",r100/"inputs/pricing.py") + stock=record("R106-STOCK.json",command(ROOT/"engines/stock.py","--r100",r100, + "--helpers",r100/"inputs/7314-HELPERS.json").stdout,r108/"inputs/STOCK.json") + assert stock["head"]==HEAD and len(stock["midpoint_rank_tilt"]["anchors"])==10 + assert sum(r["positive_relaxed_profiles"]>0 for r in stock["midpoint_rank_tilt"]["anchors"])==8 + assert Fraction(stock["midpoint_rank_tilt"]["fixed_target_complete_upper"])<0 + + copy(ROOT,r108,{"lead/routes.py":"engines/r108/routes.py","independent/reverse_routes.py":"engines/r108/reverse_routes.py", + "independent/compare.py":"engines/r108/compare.py"}) + for name in ("STOCK.json","7334-WORD.json.gz"): + copyfile(r108/"inputs"/name,r108/"independent/inputs"/name) + routes=record("R108-ROUTES.json",command(r108/"lead/routes.py").stdout,r108/"lead/ROUTES.json") + rev=record("R108-REVERSE.json",command(r108/"independent/reverse_routes.py").stdout,r108/"independent/RESULT.json") + agreement=record("R108-AGREEMENT.json",command(r108/"independent/compare.py",r108).stdout) + assert produced["R108-AGREEMENT.json"]==(ROOT/"receipts/R108-AGREEMENT.json").read_bytes() + assert routes["topology_counts"]=={"no four-MOVE topology":10} and not routes["price_counts"] + assert rev["complete"] and rev["progress"]["events_replayed"]==76466 and not rev["unvisited"] + assert agreement["matched"]==agreement["no_route"]==10 and agreement["actual_offset_count"]==agreement["remaining"]==0 + + copy(ROOT,r111,{"lead/quote.py":"engines/r111/quote.py","lead/geometry.py":"engines/r111/geometry.py", + "independent/verify.py":"engines/r111/verify.py", + "independent/inputs/reverse_routes.py":"engines/r108/reverse_routes.py"}) + (r111/"inputs/R108-ROUTES.json").write_bytes(produced["R108-ROUTES.json"]) + price=record("R111-PRICE.json",command(r111/"lead/quote.py").stdout,r111/"lead/PRICE.json") + assert price["old_paid"]==price["new_paid"]==110519 and price["productive"]==22461 + assert Fraction(price["complete_target_upper"])<0 and price["surplus"]==1424 + lead=record("R111-GEOMETRY.json",command(r111/"lead/geometry.py").stdout) + for name in ("7334-WORD.json.gz","R100-PRICE.json","R108-ROUTES.json","R92-PRICE.json","pricing.py"): + copyfile(r111/"inputs"/name,r111/"independent/inputs"/name) + copyfile(r111/"lead/PRICE.json",r111/"independent/inputs/PRICE.json") + verify=r111/"independent/verify.py" + literal_path=r111/"LITERAL-PRICE.json" + literal=record("R111-LITERAL-PRICE.json",command(verify,"literal-price").stdout,literal_path) + exact=record("R111-REVERSE-GEOMETRY.json",command(verify,"geometry","--literal",literal_path, + "--literal-sha256",expected["R111-LITERAL-PRICE.json"]).stdout) + comparison=record("R111-AGREEMENT.json",compare_triad(lead,literal,exact,verify)) + assert produced["R111-AGREEMENT.json"]==(ROOT/"receipts/R111-AGREEMENT.json").read_bytes() + assert comparison["matched_positive_offsets"]==1 and comparison["rejected_rank"]==4 + + for victim,script,args in ( + (r108/"independent/inputs/STOCK.json",r108/"independent/reverse_routes.py",()), + (r111/"independent/inputs/PRICE.json",verify,("literal-price",)), + ): + victim.write_bytes(victim.read_bytes()+b"\n") + failure=command(script,*args,check=False) + assert failure.returncode==1 and not failure.stdout + assert b"changed dependency:" in failure.stderr and victim.name.encode() in failure.stderr + + assert set(produced)==set(expected) + if out is not None: + out.mkdir(parents=True) + for name,raw in produced.items(): + (out/relative(name)).write_bytes(raw) + print("PASS_CHANGED_SHARED_MIDPOINT_BOUND pairs=10 missing_topology=10 closed_triads=1 positive_offsets=1 excluded=1 unresolved=0") + + +def main(): + assert __debug__ and sys.version_info[:2]==(3,12) + p=ArgumentParser(description=__doc__) + p.add_argument("--out",type=Path,help="new directory for the nine regenerated receipts") + args=p.parse_args() + with TemporaryDirectory() as directory: + replay(Path(directory),args.out) + + +if __name__=="__main__": + main()