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-three-move-two-add-retime-bound/LOCAL-PINS.json b/research/p104-three-move-two-add-retime-bound/LOCAL-PINS.json new file mode 100644 index 0000000000..05638eb8c6 --- /dev/null +++ b/research/p104-three-move-two-add-retime-bound/LOCAL-PINS.json @@ -0,0 +1,17 @@ +{ + "PROVENANCE.json": "7d65ff48b0585d5f235df3bafc5e97fab024a5b8bca037f09930204917564cdb", + "engines/barriers.py": "3851b0c9942b3f1768e393e15c736900b5d61bb12fea39b6222c559ddfd2e0fa", + "engines/quote.py": "133a311023965e5e39636d7febd47e54a303481ed26a177d5816ae45f9c89265", + "engines/retime.py": "90d3cb0e0079244265320b77e1a3e67fd61dbaa837390f1ba8bce59edd7fd91f", + "inputs/7334-WORD.json.gz": "4b9fd1187b34ed97c3ac0c760d73531735a5d0ebc5b4d4ab4377160b20d9bb2a", + "inputs/ADMITTED.json": "c95300e9bca27e44a25c82d794f88cbf70757c142806b0e4c590ea29feb81a13", + "inputs/BENCHMARK.json": "004331cff6ca8644489d7b7084e5c67439d74a2d283e4d64a9fdb9f88679253d", + "inputs/PR7362-SHA256.json": "2c90ca39b0f075cc4b3ec9e90c66fde473465e7bb50cf1db9a820d3a29556c0b", + "inputs/PR7365-SHA256.json": "f8418b2b07e4ecb6d49d8839015e9ceab2224816d7863edd59cb03f29de34566", + "inputs/R100-GEOMETRY.json.gz": "2191d4852024aeabdaf6da6142b63a34ba7801b82431fdf060ddc7e8c4deb498", + "inputs/R92-PRICE.json.gz": "2274f514fb12f9ced0c24abe0c02a76c16cfee4c61f909e37a5ad89b07852371", + "inputs/pricing.py": "f4d0b6c9314b838d882d6d06020f24881c19a3fda97a7c00df87b1e920785182", + "receipts/AGREEMENT.json": "a58c4f8ee85a3aa9c1757743e5bad4159ce07f0a9e033652f652c7fe3079029c", + "receipts/SHA256.json": "0572c4a86d3f4afbfa4820340d19f5fddf3baf3f5e48b6d2fd8c684233035ba6", + "replay.py": "9f73eed2916be601899aebcd4a41fcb7cc259fb0e2d03f7f2eac20977d949dd0" +} diff --git a/research/p104-three-move-two-add-retime-bound/NOTICE b/research/p104-three-move-two-add-retime-bound/NOTICE new file mode 100644 index 0000000000..6b2b10d343 --- /dev/null +++ b/research/p104-three-move-two-add-retime-bound/NOTICE @@ -0,0 +1,3 @@ +Apache-2.0. + +#7334 and #7113 supply the exact current word and signed caller. #7365 supplies the exact chronology census, #7362 the paid/target stock, #7338 overlapping component evidence and admission, and #7298 the directed price. #7368, #7369, #7371, #7372 and #7003 supply related retiming or coframe precedents. OpenAI Codex and subagents materially assisted. diff --git a/research/p104-three-move-two-add-retime-bound/PROOF.md b/research/p104-three-move-two-add-retime-bound/PROOF.md new file mode 100644 index 0000000000..b7c15e7a6e --- /dev/null +++ b/research/p104-three-move-two-add-retime-bound/PROOF.md @@ -0,0 +1,21 @@ +# Two fixed ADDs and one direct public MOVE + +The frozen #7365 inventory covers 14 changed public role histories on exact #7334. Among their consecutive public MOVE triples, exactly five have two incident ADDs and no other scalar or lifetime contact. The rewrite retains each signed ADD and its original operands, preserves their mutual order and all other paid itineraries and contracts the three public ascents into one direct entrance-to-exit child. + +| Mover | Original paid clocks | Endpoint charts | Original ADD clocks and partners | Paid ranks before → after | +|---:|---|---|---|---| +| 198 | 42533, 42599, 44596 | 3, 207 | 42534 role 709, 42600 role 1555 | 1+4+3 → 8 | +| 532 | 41176, 41178, 44611 | 3, 207 | 41177 role 363, 41179 role 452 | 3+3+2 → 8 | +| 532 | 41178, 44611, 46018 | 744, 127 | 41179 role 452, 44612 role 205 | 3+2+1 → 6 | +| 1250 | 40239, 40833, 44593 | 3, 207 | 40240 role 1125, 40834 role 452 | 3+3+2 → 8 | +| 1250 | 40833, 44593, 55971 | 744, 127 | 40834 role 452, 44595 role 969 | 3+2+1 → 6 | + +For normalized operands, a MOVE leaves the row value fixed. For each ADD, exact elementary operator commutation with each background event bounds its movable interval. The lead keeps other operations fixed and treats owned lifecycle and touching COPY as barriers. The independent audit evaluates the two possible orders as exact rational maps and includes the COPY pre-write guard. This permits a same-source COPY when the exact guarded actions agree. It computes the same ten intervals and partner identities from the literal tape. + +After contraction the mover has only its entrance or exit chart. Therefore each ADD needs its original partner on one of those charts within its interval, regardless of the selected direct clock. The independent walk traces partner occupancy over every such interval, including owned role 1555, whose relevant INIT and CLEAR are at 40127 and 42601. None of the ten intervals has an endpoint hit. In parallel the lead checks every legal slot at all three old direct clocks for each window. All 47,490 typed checks give zero slots. Both audits exclude all five windows. + +## Complete price + +Each direct replacement would remove two net paid positions per copy, a 34-position decrease across 17 copies from 110,519 to 110,485. The 22,461 productive positions and signed rank surplus 1,424 stay fixed. The two role-532 windows share paid clocks, as do the two on role 1250. At most three edits can coexist. At the old crossing the exact quote gives an optimistic one-edit upper no larger than 0.533734823462223 raw and compatible whole upper no larger than 1.548051774782075 raw, both rounded up. The complete fixed-target upper at κ = 0.0040075385047236 is at most −138.0666026358706. One added paid rank-one position defeats each single edit. The quote grants ancillary work free. + +The proof preserves the five inherited framework premises and requires only the scoped pairwise commuting relocation. It leaves changed donors, changed operands, noncommuting aggregate rewrites and changed ownership or routing outside this result. diff --git a/research/p104-three-move-two-add-retime-bound/PROVENANCE.json b/research/p104-three-move-two-add-retime-bound/PROVENANCE.json new file mode 100644 index 0000000000..1a699889f0 --- /dev/null +++ b/research/p104-three-move-two-add-retime-bound/PROVENANCE.json @@ -0,0 +1,59 @@ +{ + "derived_inputs": { + "inputs/BENCHMARK.json": { + "receipt": "inputs/ADMITTED.json", + "relationship": "Exact admission SHA, head, and crossing checked at replay" + }, + "inputs/R100-GEOMETRY.json.gz": { + "compression": "gzip", + "key": "r100/lead/GEOMETRY.json", + "receipt": "inputs/PR7365-SHA256.json" + }, + "inputs/R92-PRICE.json.gz": { + "compression": "gzip", + "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/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/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-three-move-two-add-retime-bound/README.md b/research/p104-three-move-two-add-retime-bound/README.md new file mode 100644 index 0000000000..d5d3a996dc --- /dev/null +++ b/research/p104-three-move-two-add-retime-bound/README.md @@ -0,0 +1,29 @@ +# Fixed-partner two-ADD retiming across three public MOVEs + +**NO VERIFIED GAIN.** Exact Δκ = 0 relative to independently reproduced conditional κ = `0.00364665195644` on #7334 at `aaeec8c0acf01e99a5f331ef363a698d9c084ace` with signed #7113 at `07a76c5e2738882c0cb322278e56f6cae3c9885d`. [Comparator #7334](https://github.com/CrocSwap/integer-mult-bounds/pull/7334) · [Signed caller #7113](https://github.com/CrocSwap/integer-mult-bounds/pull/7113) + +All five eligible windows from the changed-public-role census fail the direct three-MOVE contraction with both original ADD partners and paid itineraries fixed. The primary checks 47,490 typed cuts across 15 candidate MOVE placements and finds no legal slot. The independent check finds that neither partner reaches either endpoint chart within its commuting interval, even granting a direct MOVE at any clock in the original window. No scoped key remains unresolved. [Proof](PROOF.md) · [Agreement](receipts/AGREEMENT.json) + +The complete compatible upper is 1.548051774782075 raw, rounded up, for at most three edits. One supported edit would remove 34 paid positions across 17 copies and leave 22,461 productive positions. The verified saving is zero. + +## Replay + +Use CPython 3.12 with assertions from a clean checkout. + +```sh +python3.12 -I -B research/p104-three-move-two-add-retime-bound/replay.py +``` + +The standard-library replay authenticates the exact #7365 contact census, #7362 rank stock, admitted #7334 comparator and native word. It regenerates the complete directed price and both literal audits and compares all five windows. Add `--out fresh-directory` to retain four receipts. [Verification](VERIFICATION.md) · [Provenance](PROVENANCE.json) · [Path-keyed pins](LOCAL-PINS.json) + +## Open next questions + +Could the two incoming ADDs on role 198 or the first role-532 window be replaced by their signed aggregate from different existing donors? Start from those two exact window keys and preprice the changed donor interface, then check the exact aggregate row against cocharted donor rows at the original endpoints. This result keeps each original ADD partner and does not settle that changed-donor mechanism. [Frozen window keys](receipts/AGREEMENT.json) + +## Credit + +#7365 at `98be9db1f28cdc5fa8962c7da065bc0174db9744` supplies the exact contact census. #7362 supplies the full rank stock, #7338 the admitted witness and partially overlapping two-MOVE component keys, and #7298 the directed arithmetic. [#7365](https://github.com/CrocSwap/integer-mult-bounds/pull/7365) · [#7362](https://github.com/CrocSwap/integer-mult-bounds/pull/7362) · [#7338](https://github.com/CrocSwap/integer-mult-bounds/pull/7338) · [#7298](https://github.com/CrocSwap/integer-mult-bounds/pull/7298) + +#7368 covers the exact role-532 contact at 44612 under its sole-ADD model. #7369 supplies related chart-746 roles and keeps six paid legs at fixed ADD clocks. #7371 and #7372 cover two-MOVE windows on other movers. #7003 supplies the earlier commuting slide method. [#7368](https://github.com/CrocSwap/integer-mult-bounds/pull/7368) · [#7369](https://github.com/CrocSwap/integer-mult-bounds/pull/7369) · [#7371](https://github.com/CrocSwap/integer-mult-bounds/pull/7371) · [#7372](https://github.com/CrocSwap/integer-mult-bounds/pull/7372) · [#7003](https://github.com/CrocSwap/integer-mult-bounds/pull/7003) + +OpenAI Codex and subagents materially assisted proof, implementation, independent verification and packaging. diff --git a/research/p104-three-move-two-add-retime-bound/SOURCES.json b/research/p104-three-move-two-add-retime-bound/SOURCES.json new file mode 100644 index 0000000000..e8c2f265cd --- /dev/null +++ b/research/p104-three-move-two-add-retime-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-three-move-two-add-retime-bound/TASK.json b/research/p104-three-move-two-add-retime-bound/TASK.json new file mode 100644 index 0000000000..7828918062 --- /dev/null +++ b/research/p104-three-move-two-add-retime-bound/TASK.json @@ -0,0 +1,117 @@ +{ + "actual_scope": "Exact #7334, five consecutive three-public-MOVE windows containing exactly two fixed ADDs, with old partners and all other paid itineraries fixed.", + "ai_assistance": "OpenAI Codex and subagents materially assisted proof, implementation, independent verification and packaging.", + "author": "P104 three-MOVE two-ADD retiming research", + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "bottleneck_link": "A direct public child saves two paid calls only if both original ADD partners can coframe within exact commuting intervals.", + "budget_minutes": 10, + "evidence": "47,490 primary typed slot checks give zero placements. Independent exact chart and barrier audit proves no endpoint hit for all ten original ADD partners, even granting an arbitrary direct clock inside each window.", + "open_questions": [ + { + "blocked_by": "Both fixed original partners miss the required endpoints in every window.", + "first_step": "Freeze the two incoming-only windows on roles 198 and 532 and price an exact aggregate supplied by changed existing donors.", + "question": "Can a different cocharted public/owned donor bank reproduce the complete signed two-ADD aggregate?", + "why_it_matters": "A lawful aggregate could allow a charged direct MOVE while retaining the exact arbitrary-input action." + } + ], + "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": "Tests three paid legs and a coordinated two-ADD shift under the exact original operands.", + "scope_status": "changed", + "stop_rule": "Freeze five windows, three retained clocks per window, up to 150,000 typed cuts and 20 seconds. Stop after exact endpoint absence at all five.", + "task_id": "p104-side-correction" +} diff --git a/research/p104-three-move-two-add-retime-bound/VERIFICATION.md b/research/p104-three-move-two-add-retime-bound/VERIFICATION.md new file mode 100644 index 0000000000..0153790c5f --- /dev/null +++ b/research/p104-three-move-two-add-retime-bound/VERIFICATION.md @@ -0,0 +1,7 @@ +# Verification + +The direct CPython 3.12 replay exited zero in 0.64 seconds. The relocated Git-free replay with an empty inherited environment exited zero in 0.52 seconds. All four receipts matched byte for byte. + +The primary replay tests 47,490 typed cuts across the 15 fixed direct MOVE placements and finds zero legal ADD slots. The independent replay reads all 76,466 events, verifies all five old paid and scalar windows, and matches all ten commuting intervals and original partners. It checks the owned lifetime of role 1555 and confirms no endpoint hit even with an arbitrary direct MOVE clock inside each original window. The engines' built-in controls exercise commuting and noncommuting ADDs, COPY guard behavior and owned lifetime barriers. + +[Provenance](PROVENANCE.json) · [Replay command](README.md) · [Agreement](receipts/AGREEMENT.json) diff --git a/research/p104-three-move-two-add-retime-bound/VERIFY.json b/research/p104-three-move-two-add-retime-bound/VERIFY.json new file mode 100644 index 0000000000..5249379a40 --- /dev/null +++ b/research/p104-three-move-two-add-retime-bound/VERIFY.json @@ -0,0 +1,19 @@ +{ + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/replay.py" + ], + "checks": "Authenticate predecessor manifests and complete price, regenerate both exact five-window audits and compare all original fixed partner interval and endpoint dispositions.", + "timeout_seconds": 100 + } + ], + "inputs": [], + "python": "3.12", + "requirements": [], + "schema_version": 1, + "status": "ready" +} diff --git a/research/p104-three-move-two-add-retime-bound/engines/barriers.py b/research/p104-three-move-two-add-retime-bound/engines/barriers.py new file mode 100644 index 0000000000..2c6dc019f8 --- /dev/null +++ b/research/p104-three-move-two-add-retime-bound/engines/barriers.py @@ -0,0 +1,194 @@ +"""Prove endpoint-chart absence without choosing a direct MOVE clock.""" +from collections import defaultdict +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 +from time import monotonic + +ROOT = Path(__file__).resolve().parents[1] +PINS = { + "lead/PRICE.json": "d9074aad58d3ffdad995ba68b2ffa541ae2b7df833b757d8e1a9767118140f39", + "inputs/7334-WORD.json.gz": "4b9fd1187b34ed97c3ac0c760d73531735a5d0ebc5b4d4ab4377160b20d9bb2a", + "lead/RESULT.json": "96d0cca54073810d12c9b01c408a52771e189b20a0863f9231a6e559f3a22729", +} +PAYLOAD = "9aa8d6b054ba7eb2289d052c1079b16be518d2f0fbfb244569fa18e3733acdac" + + +def unique(items): + result = dict(items) + if len(result) != len(items): + raise ValueError("duplicate JSON key") + return result + + +def checked(path, zipped=False): + raw = (ROOT / path).read_bytes() + if sha256(raw).hexdigest() != PINS[path]: + raise ValueError(f"changed dependency {path}") + if zipped: + raw = decompress(raw) + assert sha256(raw).hexdigest() == PAYLOAD + return loads(raw, object_pairs_hook=unique) + + +def affected(event): + return event[1:3] if event[0] in ("ADD", "COPY") else event[1:2] + + +def commutes(add, event): + if event[0] == "MOVE" or not set(affected(add)) & set(affected(event)): + return True + if event[0] in ("INIT", "CLEAR"): + return False + roles = sorted(set(affected(add)) | set(affected(event))) + def evaluate(first, second): + rows = {r:[Q(r==s) for s in roles] for r in roles} + guard = None + for e in (first, second): + op,d,*args = e + if op == "SCALE": + rows[d] = [Q(args[0])*v for v in rows[d]] + else: + src,q,_ = args + if op == "COPY": + guard = rows[d] + rows[d] = [Q(q)*v for v in rows[src]] + else: + assert op == "ADD" + rows[d] = [a+Q(q)*b for a,b in zip(rows[d],rows[src],strict=True)] + return rows,guard + return evaluate(add,event) == evaluate(event,add) + + +def controls(): + add = ["ADD",1,2,"1",3] + assert commutes(add,["ADD",1,4,"1",3]) + assert not commutes(add,["ADD",2,4,"1",3]) + assert commutes(add,["COPY",5,2,"1",3]) + assert not commutes(add,["COPY",5,1,"1",3]) + assert not commutes(add,["CLEAR",2,3]) + assert commutes(add,["SCALE",1,"1",3]) + return ["exact transvection commuting and noncommuting pairs", + "same-source COPY commutes but changed COPY input does not", "owned lifetime barrier"] + + +def stop(*_): + raise TimeoutError("15-second topology cap") + + +def scan(word, candidates, deadline): + n, tape = word["public"], word["program"] + state = word["initial"][:] + [None]*word["owned_fields"] + paths, lifetimes, tests = defaultdict(list), defaultdict(list), [] + clocks = defaultdict(list) + for row in candidates: + mover = row["role"] + left,middle,right = row["clocks"] + assert mover < n + for clock,a,b in zip(row["clocks"],row["charts"][:-1],row["charts"][1:],strict=True): + assert tape[clock] == ["MOVE",mover,a,b,False] + pair = [] + for clock,event in row["contacts"]: + assert event[0] == "ADD" and tape[clock] == event and mover in affected(event) + peer, = set(affected(event))-{mover} + pair.append({"clock":clock,"event":event,"peer":peer,"left":None,"right":None}) + paths[peer] = [(0,state[peer])] + assert left < pair[0]["clock"] < middle < pair[1]["clock"] < right + for test in pair: + tests.append((left,right,test,pair[1]["clock"] if test is pair[0] else pair[0]["clock"])) + clocks[mover].append((left,right,{t["clock"] for t in pair})) + row["independent_pair"] = pair + for t,event in enumerate(tape): + if t%256==0 and monotonic()>=deadline: + stop() + op,d,*args = event + touched = set(affected(event)) + for mover in touched & clocks.keys(): + for left,right,expected in clocks[mover]: + if left=n) + after=args[1] + elif op=="INIT": + assert before is None and d>=n + after=args[0] + elif op=="CLEAR": + assert before==args[0] and d>=n + after=None + else: + assert before==args[-1] and op in ("ADD","COPY","SCALE") + if op in ("ADD","COPY"): + assert state[args[0]]==before and args[0]!=d + if op=="COPY": + assert d>=n + after=before + state[d]=after + if before!=after and d in paths: + paths[d].append((t+1,after)) + if op in ("INIT","CLEAR"): + lifetimes[d].append([t,event]) + assert state==word["final"]+[None]*word["owned_fields"] + return paths,lifetimes + + +def main(): + assert __debug__ + signal(SIGALRM,stop) + alarm(15) + deadline=monotonic()+13 + test_controls=controls() + price=checked("lead/PRICE.json") + lead=checked("lead/RESULT.json") + word=checked("inputs/7334-WORD.json.gz",zipped=True) + assert price["head"]==lead["head"] and lead["price"]==PINS["lead/PRICE.json"] + assert len(word["program"])==price["event_cap"]==76466 + assert len(price["candidates"])==len(lead["rows"])==5 and not lead["unvisited"] + paths,lives=scan(word,price["candidates"],deadline) + results=[] + for row,old in zip(price["candidates"],lead["rows"],strict=True): + left,_,right=row["clocks"] + endpoints=[row["charts"][0],row["charts"][-1]] + observed=[] + for test in row["independent_pair"]: + peer=test["peer"] + lo=test["left"][0]+1 if test["left"] else left + hi=test["right"][0] if test["right"] else right+1 + starts=paths[peer]+[(len(word["program"])+1,None)] + occupancy=[[max(a,lo),min(b-1,hi),chart] for (a,chart),(b,_) in zip(starts,starts[1:]) + if max(a,lo)<=min(b-1,hi)] + assert sum(b-a+1 for a,b,_ in occupancy)==hi-lo+1 + assert any(a<=test["clock"]<=b and c==test["event"][-1] for a,b,c in occupancy) + hits=[segment for segment in occupancy if segment[2] in endpoints] + observed.append(test|{"bounds":[lo,hi],"occupancy":occupancy,"endpoint_hits":hits}) + assert row["clocks"]==old["clocks"] and row["role"]==old["role"] + assert [o["bounds"] for o in observed]==old["commuting_intervals"] + assert [o["peer"] for o in observed]==old["partners"] + results.append({"role":row["role"],"clocks":row["clocks"],"endpoints":endpoints,"tests":observed, + "excluded":any(not o["endpoint_hits"] for o in observed)}) + assert 1555 in lives and len(lives[1555])>=2 + assert any(o["peer"]==1555 for row in results for o in row["tests"]) + alarm(0) + print(dumps(dict(pins=PINS,head=price["head"],caller=price["caller"],controls=test_controls, + events=76466,cap_seconds=15,results=results,owned_1555_lifetime_events=lives[1555], + excluded=sum(r["excluded"] for r in results),unresolved=sum(not r["excluded"] for r in results), + scope="Exact five priced windows and same original endpoint charts, partners and pairwise commuting relocation.", + direct_move_clock_granted_arbitrary_inside_original_window=True),sort_keys=True,indent=2)) + + +if __name__=="__main__": + main() diff --git a/research/p104-three-move-two-add-retime-bound/engines/quote.py b/research/p104-three-move-two-add-retime-bound/engines/quote.py new file mode 100644 index 0000000000..3703b59da4 --- /dev/null +++ b/research/p104-three-move-two-add-retime-bound/engines/quote.py @@ -0,0 +1,96 @@ +"""Price the exact two-ADD, three-public-MOVE stock before native replay.""" +from collections import Counter, defaultdict +from fractions import Fraction +from hashlib import sha256 +from json import dumps, loads +from pathlib import Path +from runpy import run_path + +ROOT = Path(__file__).resolve().parents[1] +PINS = { + "inputs/R100-GEOMETRY.json": "075301daf545c8021800c36af19d05517e3c4136dac4e2114cb85204d0b31c64", + "inputs/R92-PRICE.json": "05d7a5ebdd2eeedd6c8f534e8e2eeac22484daf9f387f4a6b88cc9eed22a6b8f", + "inputs/BENCHMARK.json": "004331cff6ca8644489d7b7084e5c67439d74a2d283e4d64a9fdb9f88679253d", + "inputs/pricing.py": "f4d0b6c9314b838d882d6d06020f24881c19a3fda97a7c00df87b1e920785182", +} + + +def unique(pairs): + obj = dict(pairs) + if len(obj) != len(pairs): + raise ValueError("duplicate JSON key") + return obj + + +def authenticate(path, digest): + data = (ROOT / path).read_bytes() + if sha256(data).hexdigest() != digest: + raise ValueError(f"changed input {path}") + return data + + +def output(): + raw = [authenticate(path, digest) for path, digest in PINS.items()] + geometry, price, benchmark = [loads(data, object_pairs_hook=unique) for data in raw[:3]] + assert geometry["head"] == price["head"] == benchmark["head"] == "aaeec8c0acf01e99a5f331ef363a698d9c084ace" + assert geometry["timeout"] is None and geometry["first_unvisited_event"] is None + cost = run_path(str(ROOT / "inputs/pricing.py"))["cost"] + hist = lambda x: Counter({int(k): v for k, v in x.items()}) + target, paid = hist(price["old_targets"]), hist(price["old_paid"]) + assert sum(target.values()) == 22461 and sum(paid.values()) == 110519 + base = target.copy() + base.subtract(paid) + assert sum(r * count for r, count in base.items()) == 1424 + lower, upper = map(Fraction, benchmark["crossing"]) + probe, fixed = (Fraction(price[key]) for key in ("probe", "moonshot")) + assert upper == Fraction(price["old_crossing_upper"]) + by_role = defaultdict(list) + for row in geometry["pairs"]: + by_role[row["key"][2]].append(row) + candidates = [] + profiles = Counter() + for role, pairs in sorted(by_role.items()): + for left, right in zip(pairs, pairs[1:]): + start, middle, _ = left["key"] + assert middle == right["key"][0] and left["charts"][1:] == right["charts"][:2] + end = right["key"][1] + ops = left["contacts"] + right["contacts"] + if len(ops) != 2 or any(op[0] != "ADD" for _, op in ops): + continue + ranks = [*left["ranks"][:2], right["ranks"][1]] + delta = Counter(ranks) + delta.subtract([sum(ranks)]) + delta = {r: 17 * v for r, v in delta.items() if v} + assert sum(delta.values()) == 34 and sum(r * v for r, v in delta.items()) == 0 + full = base.copy() + full.update(delta) + assert cost(full, probe)[0] > 0 and cost(full, lower)[1] < 1 + profiles[role] += 1 + candidates.append({ + "role": role, "clocks": [start, middle, end], "charts": [*left["charts"], right["charts"][-1]], + "contacts": ops, "old_ranks": ranks, "new_rank": sum(ranks), + "paid_delta": {r: -v for r, v in delta.items()}, + "raw_upper": str(cost(delta, lower)[1]), "target_upper": str(cost(delta, fixed)[1]), + "probe_lower": str(cost(full, probe)[0]), + }) + assert dict(profiles) == {198: 1, 532: 2, 1250: 2} + for role, count in profiles.items(): + if count == 2: + first, second = [row for row in candidates if row["role"] == role] + assert set(first["clocks"]) & set(second["clocks"]) + def max_per_role(field): + return sum(max(Fraction(row[field]) for row in candidates if row["role"] == role) for role in profiles) + return { + "head": price["head"], "caller": price["caller_head"], "pins": PINS, + "word_sha256": price["word_sha256"], "before_paid": 110519, "after_paid_one": 110485, + "productive": 22461, "surplus": 1424, "compatible_cap": len(profiles), + "gross_upper": str(max_per_role("raw_upper")), + "fixed_target_complete_upper": str(cost(base, fixed)[1] + max_per_role("target_upper")), + "candidates": candidates, "event_cap": 76466, "typed_cut_cap": 150000, "runner_seconds": 20, + "old_crossing": [str(lower), str(upper)], + } + + +if __name__ == "__main__": + assert __debug__ + print(dumps(output(), indent=2, sort_keys=True)) diff --git a/research/p104-three-move-two-add-retime-bound/engines/retime.py b/research/p104-three-move-two-add-retime-bound/engines/retime.py new file mode 100644 index 0000000000..322ec4281d --- /dev/null +++ b/research/p104-three-move-two-add-retime-bound/engines/retime.py @@ -0,0 +1,160 @@ +"""Check fixed-partner chronological placements for the priced triples.""" +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 time import monotonic + +ROOT = Path(__file__).resolve().parents[1] +PRICE = "d9074aad58d3ffdad995ba68b2ffa541ae2b7df833b757d8e1a9767118140f39" +PAYLOAD = "9aa8d6b054ba7eb2289d052c1079b16be518d2f0fbfb244569fa18e3733acdac" + + +def commute(add, event): + _, dst, src, *_ = add + op, other, *a = event + if op == "MOVE": + return True + if op == "ADD": + return src != other and dst != a[0] + if op == "COPY": + return not {dst, src}.intersection({other, a[0]}) + if op == "SCALE" and Fraction(a[0]) == 1: + return True + assert op in {"INIT", "CLEAR", "SCALE"} + return other not in {dst, src} + + +def controls(): + add = ["ADD", 1, 2, "3", 3] + assert commute(add, ["ADD", 1, 4, "-1", 3]) + assert not commute(add, ["ADD", 2, 4, "-1", 3]) + assert not commute(add, ["ADD", 4, 1, "-1", 3]) + assert not commute(add, ["COPY", 3, 1, "1", 3]) + assert commute(add, ["SCALE", 2, "1", 3]) + assert not commute(add, ["SCALE", 2, "2", 3]) + return ["commuting writes", "source and destination dependencies", "COPY guard", "nontrivial scale"] + + +def possible_interval(program, clock, other_clock, left, right): + add = program[clock] + lo, hi = left, right + 1 + for t in range(clock - 1, left - 1, -1): + if t != other_clock and not commute(add, program[t]): + lo = t + 1 + break + for t in range(clock + 1, right + 1): + if t != other_clock and not commute(add, program[t]): + hi = t + break + return lo, hi + + +def positions(word, wanted): + """Read the literal original pre-event chart of every scalar partner.""" + n = word["public"] + state = word["initial"][:] + [None] * word["owned_fields"] + chart_at = {r: [] for r in wanted} + program = word["program"] + for op, role, *a in program: + for r in chart_at: + chart_at[r].append(state[r]) + if op == "MOVE": + before, after, owned = a + assert state[role] == before and owned == (role >= n) + state[role] = after + elif op == "INIT": + assert state[role] is None and role >= n + state[role] = a[0] + elif op == "CLEAR": + assert state[role] == a[0] and role >= n + state[role] = None + else: + assert state[role] == a[-1] + if op in {"ADD", "COPY"}: + assert state[a[0]] == state[role] and a[0] != role + else: + assert op == "SCALE" + for r in chart_at: + chart_at[r].append(state[r]) + assert state == word["final"] + [None] * word["owned_fields"] + return chart_at + + +def main(): + assert __debug__ + helpers = run_path(str(ROOT / "lead/quote.py")) + read, unique = helpers["authenticate"], helpers["unique"] + price = loads(read("lead/PRICE.json", PRICE), object_pairs_hook=unique) + deadline = monotonic() + price["runner_seconds"] + raw = decompress(read("inputs/7334-WORD.json.gz", price["word_sha256"])) + assert sha256(raw).hexdigest() == PAYLOAD + word = loads(raw, object_pairs_hook=unique) + program = word["program"] + assert len(program) == price["event_cap"] + candidates = price["candidates"] + assert len(candidates) == 5 + + def partner(role, event): + dst, src = event[1:3] + assert dst != src and role in (dst, src) + return src if dst == role else dst + + wanted = {partner(row["role"], event) for row in candidates for _, event in row["contacts"]} + chart_at = positions(word, wanted) + visited, rows = 0, [] + for row in candidates: + if monotonic() >= deadline: + break + role = row["role"] + left, middle, right = row["clocks"] + charts = row["charts"] + for clock, a, b in zip(row["clocks"], charts[:-1], charts[1:], strict=True): + assert program[clock] == ["MOVE", role, a, b, False] + (c0, add0), (c1, add1) = row["contacts"] + assert left < c0 < middle < c1 < right + assert program[c0] == add0 and program[c1] == add1 + observed = [ + t for t in range(left + 1, right) + if program[t][0] in {"ADD", "COPY"} and role in program[t][1:3] + or program[t][0] == "SCALE" and program[t][1] == role + ] + assert observed == [c0, c1] + intervals = [possible_interval(program, a, b, left, right) for a, b in [(c0, c1), (c1, c0)]] + partners = [partner(role, e) for e in [add0, add1]] + placements = [] + for clock in row["clocks"]: + permitted = [] + for (lo, hi), peer in zip(intervals, partners, strict=True): + visited += hi - lo + 1 + if visited > price["typed_cut_cap"] or monotonic() >= deadline: + break + permitted.append([ + t for t in range(lo, hi + 1) + if chart_at[peer][t] == (charts[0] if t <= clock else charts[-1]) + ]) + if len(permitted) != 2: + break + first, second = permitted + witness = None + if first: + after = next((t for t in second if t >= first[0]), None) + if after is not None: + witness = [first[0], after] + placements.append({"retained_clock": clock, "slot_counts": list(map(len, permitted)), "witness": witness}) + if len(placements) != 3: + break + rows.append({"role": role, "clocks": row["clocks"], "partners": partners, + "commuting_intervals": intervals, "placements": placements}) + missing = [r["clocks"] for r in candidates[len(rows):]] + print(dumps({"head": price["head"], "price": PRICE, "word": PAYLOAD, "rows": rows, + "typed_cut_checks": visited, "unvisited": missing, "controls": controls()}, + indent=2, sort_keys=True)) + if missing: + raise SystemExit(2) + + +if __name__ == "__main__": + main() diff --git a/research/p104-three-move-two-add-retime-bound/inputs/7334-WORD.json.gz b/research/p104-three-move-two-add-retime-bound/inputs/7334-WORD.json.gz new file mode 100644 index 0000000000..73f4300719 Binary files /dev/null and b/research/p104-three-move-two-add-retime-bound/inputs/7334-WORD.json.gz differ diff --git a/research/p104-three-move-two-add-retime-bound/inputs/ADMITTED.json b/research/p104-three-move-two-add-retime-bound/inputs/ADMITTED.json new file mode 100644 index 0000000000..464c89e45c --- /dev/null +++ b/research/p104-three-move-two-add-retime-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-three-move-two-add-retime-bound/inputs/BENCHMARK.json b/research/p104-three-move-two-add-retime-bound/inputs/BENCHMARK.json new file mode 100644 index 0000000000..3cadb16667 --- /dev/null +++ b/research/p104-three-move-two-add-retime-bound/inputs/BENCHMARK.json @@ -0,0 +1,67 @@ +{ + "admission_sha256": "c95300e9bca27e44a25c82d794f88cbf70757c142806b0e4c590ea29feb81a13", + "assumptions": [ + "native_all_columns", + "owned_erasure", + "compiler", + "precision_tape", + "analytic_recovery" + ], + "checks": { + "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" + }, + "crossing": [ + "0.00364665195644044790699554028334161", + "0.00364665195644044790699554028334162" + ], + "head": "aaeec8c0acf01e99a5f331ef363a698d9c084ace", + "kappa": "0.00364665195644", + "main": "e54523517d0f03e58352e647c403a5af3e525a57", + "package_sha256": { + "research/p104-helper-319-fused-return/EARLY-RESULT.json": "ad1ca9b2e2febbf80d9bf8b6ceef14ff90fcc29ef9358310e551628eb1706649", + "research/p104-helper-319-fused-return/ENVIRONMENT.json": "1a4a755aa63e3c25c09a493550a0d13a58e23f8b50083d3f81ce3716581d8ad3", + "research/p104-helper-319-fused-return/INPUTS.json": "abedac59097a1c35c27d91cbdb07207bc562a64743bc406d13c94a8bc970592d", + "research/p104-helper-319-fused-return/NATIVE-RESULT.json": "c6d1b00a83185ab0062397b363258b1f3f6685d755e9c1d4f7d3e7e511240812", + "research/p104-helper-319-fused-return/NOTICE": "fd84c06a1c3343a1802808741c0863ffcec031f5c98eb78ddc350a747d3e2ddc", + "research/p104-helper-319-fused-return/PROOF.md": "560de573bfd4563c16ca3c7308fa729b4188fabe802d8830f343c3873f75b59d", + "research/p104-helper-319-fused-return/PROPOSED-CLAIM.json": "6e31241944c123d2bd4aa8bc94d833b44b3d889bd6d9aafc579108f416b45f03", + "research/p104-helper-319-fused-return/README.md": "b4db0eb83ab6a2f7151bed2da955a487f4816ec9d1976eccc21e54c2725490b0", + "research/p104-helper-319-fused-return/REFERENCE.json": "3e66e054b803551f18b8670da0b2990a7d0eeb689dfc45b56dbcba295551da70", + "research/p104-helper-319-fused-return/REPLAY.txt": "230984f4b8206ae4d0c0f18fbba86ff43a1a9623f8ed337cf1285360f9a67c0c", + "research/p104-helper-319-fused-return/RESULT.json": "7f2d587c59f063b01f1e8b320084a7f0943f2f05d65e3e0f5e80448c6c8e8194", + "research/p104-helper-319-fused-return/SOURCES.json": "ac7b4473035af648d6073e78b6c39675e706e8194b346bb55ed62a0adc81d593", + "research/p104-helper-319-fused-return/TASK.json": "cceea066802e1175b1a78f65e8bff4677ce09e87fd7686265d63ee7236b32b1a", + "research/p104-helper-319-fused-return/VERIFY.json": "ede7dd2dd3733b9a73f72af9dd7edfe819b49b859c5c76e227ec82cb9c220513", + "research/p104-helper-319-fused-return/WORD.json.gz": "4b9fd1187b34ed97c3ac0c760d73531735a5d0ebc5b4d4ab4377160b20d9bb2a", + "research/p104-helper-319-fused-return/adapt.py": "a9237d6dff55ce13c1e1d10159f592f35a0a79eb0a3c054063ba39665ba96296", + "research/p104-helper-319-fused-return/construct.py": "ecb39578063d7f09153a85370a3b9bb7cbf8b36ff9891033a1cce7a2fe7f7fda", + "research/p104-helper-319-fused-return/derive_grid.py": "ceb7a44ef19d72a16db7b43c65c85910d965499d1715436011de32af5d39dbb0", + "research/p104-helper-319-fused-return/frontier.py": "c5f5e4e1f1f2d189f4816291764f1966c8165a7090d8624f72828199400333c2", + "research/p104-helper-319-fused-return/inputs/pr7314.tar.gz": "0589953b3886d96eacf3bda3d38d8d574bb739fba1056af7f32f56047b6061e2", + "research/p104-helper-319-fused-return/packing_reference.py": "c977cf46a9498d013145f74186081ec67674d11473295df399bca61f8a4e7382", + "research/p104-helper-319-fused-return/price.py": "6ec0f568b3491f3713ffabb2a8cc7b467339da175c8dcaa76369fbc3a9881029", + "research/p104-helper-319-fused-return/source.py": "a2be5bb28c7a9c9d528b8bae0d9ef99636bb8fabf80d66b7f8d3084de68358aa", + "research/p104-helper-319-fused-return/verify_caller.py": "6ef60923041d97f77f8291f568f2e81492af09021f4e1065054cf5376cbff861", + "research/p104-helper-319-fused-return/verify_early.py": "94e0e8bac205eed91f9f1f0ada110479a067ee7a3cd73d38d231947a0d46c0f9", + "research/p104-helper-319-fused-return/verify_native.py": "592729b40642957a4d2766c386d73925a1044d2b4eedce5176d988b8cef3b134" + }, + "receipt_sha256": { + "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_tree": "fa98712a459b20c10240450097c87de433f8a750", + "status": "exact-complete-receipt-reused" +} diff --git a/research/p104-three-move-two-add-retime-bound/inputs/PR7362-SHA256.json b/research/p104-three-move-two-add-retime-bound/inputs/PR7362-SHA256.json new file mode 100644 index 0000000000..b1486e0b5c --- /dev/null +++ b/research/p104-three-move-two-add-retime-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-three-move-two-add-retime-bound/inputs/PR7365-SHA256.json b/research/p104-three-move-two-add-retime-bound/inputs/PR7365-SHA256.json new file mode 100644 index 0000000000..2c2e083626 --- /dev/null +++ b/research/p104-three-move-two-add-retime-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-three-move-two-add-retime-bound/inputs/R100-GEOMETRY.json.gz b/research/p104-three-move-two-add-retime-bound/inputs/R100-GEOMETRY.json.gz new file mode 100644 index 0000000000..dbd7e6172e Binary files /dev/null and b/research/p104-three-move-two-add-retime-bound/inputs/R100-GEOMETRY.json.gz differ diff --git a/research/p104-three-move-two-add-retime-bound/inputs/R92-PRICE.json.gz b/research/p104-three-move-two-add-retime-bound/inputs/R92-PRICE.json.gz new file mode 100644 index 0000000000..0307eb95e2 Binary files /dev/null and b/research/p104-three-move-two-add-retime-bound/inputs/R92-PRICE.json.gz differ diff --git a/research/p104-three-move-two-add-retime-bound/inputs/pricing.py b/research/p104-three-move-two-add-retime-bound/inputs/pricing.py new file mode 100644 index 0000000000..40ec194017 --- /dev/null +++ b/research/p104-three-move-two-add-retime-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-three-move-two-add-retime-bound/receipts/AGREEMENT.json b/research/p104-three-move-two-add-retime-bound/receipts/AGREEMENT.json new file mode 100644 index 0000000000..199fa5d5d6 --- /dev/null +++ b/research/p104-three-move-two-add-retime-bound/receipts/AGREEMENT.json @@ -0,0 +1,139 @@ +{ + "agreement": [ + { + "clocks": [ + 42533, + 42599, + 44596 + ], + "endpoints": [ + 3, + 207 + ], + "partner_bounds": [ + [ + 42533, + 42588 + ], + [ + 42533, + 42601 + ] + ], + "partner_clocks": [ + 42534, + 42600 + ], + "role": 198 + }, + { + "clocks": [ + 41176, + 41178, + 44611 + ], + "endpoints": [ + 3, + 207 + ], + "partner_bounds": [ + [ + 41176, + 44612 + ], + [ + 41176, + 41181 + ] + ], + "partner_clocks": [ + 41177, + 41179 + ], + "role": 532 + }, + { + "clocks": [ + 41178, + 44611, + 46018 + ], + "endpoints": [ + 744, + 127 + ], + "partner_bounds": [ + [ + 41178, + 41181 + ], + [ + 41178, + 44613 + ] + ], + "partner_clocks": [ + 41179, + 44612 + ], + "role": 532 + }, + { + "clocks": [ + 40239, + 40833, + 44593 + ], + "endpoints": [ + 3, + 207 + ], + "partner_bounds": [ + [ + 40239, + 44594 + ], + [ + 40832, + 41179 + ] + ], + "partner_clocks": [ + 40240, + 40834 + ], + "role": 1250 + }, + { + "clocks": [ + 40833, + 44593, + 55971 + ], + "endpoints": [ + 744, + 127 + ], + "partner_bounds": [ + [ + 40833, + 41179 + ], + [ + 40833, + 44603 + ] + ], + "partner_clocks": [ + 40834, + 44595 + ], + "role": 1250 + } + ], + "caller": "07a76c5e2738882c0cb322278e56f6cae3c9885d", + "excluded_windows": 5, + "head": "aaeec8c0acf01e99a5f331ef363a698d9c084ace", + "typed_cut_checks": 47490, + "unresolved": 0 +} diff --git a/research/p104-three-move-two-add-retime-bound/receipts/SHA256.json b/research/p104-three-move-two-add-retime-bound/receipts/SHA256.json new file mode 100644 index 0000000000..bc2281c872 --- /dev/null +++ b/research/p104-three-move-two-add-retime-bound/receipts/SHA256.json @@ -0,0 +1,5 @@ +{ + "INDEPENDENT.json": "ab54b03574d0a13c674d7f6c18c1716356097bea80e7d943805dd59bf33253bb", + "LEAD.json": "96d0cca54073810d12c9b01c408a52771e189b20a0863f9231a6e559f3a22729", + "PRICE.json": "d9074aad58d3ffdad995ba68b2ffa541ae2b7df833b757d8e1a9767118140f39" +} diff --git a/research/p104-three-move-two-add-retime-bound/replay.py b/research/p104-three-move-two-add-retime-bound/replay.py new file mode 100644 index 0000000000..8037ccd49d --- /dev/null +++ b/research/p104-three-move-two-add-retime-bound/replay.py @@ -0,0 +1,143 @@ +"""Git-free replay of the five fixed-partner three-MOVE exclusions.""" +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 shutil import copyfile +from subprocess import run +import sys +from tempfile import TemporaryDirectory + +ROOT=Path(__file__).resolve().parent + + +def unique(items): + doc=dict(items) + if len(doc)!=len(items): + raise ValueError("duplicate JSON key") + return doc + + +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("invalid relative path "+name) + return path + + +def source(name): + return (ROOT/relative(name)).read_bytes() + + +def inputs(): + pins=decode(source("LOCAL-PINS.json")) + for name,expected in pins.items(): + if digest(source(name))!=expected: + raise ValueError("changed package dependency "+name) + provenance=decode(source("PROVENANCE.json")) + for name,record in provenance["files"].items(): + raw=source(name) + assert digest(raw)==record["sha256"]==pins[name] + assert sha1(f"blob {len(raw)}\0".encode()+raw).hexdigest()==record["git_blob"] + raw={} + for name,record in provenance["derived_inputs"].items(): + predecessor=decode(source(record["receipt"])) + if name.endswith(".gz"): + content=decompress(source(name)) + assert digest(content)==predecessor[record["key"]] + raw[PurePosixPath(name).name.removesuffix(".gz")]=content + else: + content=source(name) + bench=decode(content) + assert bench["admission_sha256"]==digest(source(record["receipt"])) + assert all(bench[k]==predecessor[k] for k in ("head","crossing","kappa","assumptions")) + raw[PurePosixPath(name).name]=content + return raw + + +def command(script,check=True): + call=run([sys.executable,"-I","-B",str(script)],capture_output=True,timeout=25) + if check and call.returncode: + sys.stderr.write(call.stderr.decode(errors="replace")) + call.check_returncode() + return call + + +def replay(root,out): + raw_inputs=inputs() + expected=decode(source("receipts/SHA256.json")) + for folder in ("inputs","lead","independent"): + (root/folder).mkdir(parents=True) + for name,content in raw_inputs.items(): + (root/"inputs"/name).write_bytes(content) + copyfile(ROOT/"inputs/pricing.py",root/"inputs/pricing.py") + copyfile(ROOT/"inputs/7334-WORD.json.gz",root/"inputs/7334-WORD.json.gz") + for path in ("lead/quote.py","lead/retime.py","independent/barriers.py"): + copyfile(ROOT/"engines"/Path(path).name,root/path) + + outputs={} + def record(name,script,target=None): + raw=command(root/script).stdout + assert digest(raw)==expected[name],("changed receipt",name) + outputs[name]=raw + if target: + (root/target).write_bytes(raw) + return decode(raw) + + price=record("PRICE.json","lead/quote.py","lead/PRICE.json") + assert price["before_paid"]==110519 and price["after_paid_one"]==110485 + assert price["surplus"]==1424 and price["productive"]==22461 + assert len(price["candidates"])==5 and price["compatible_cap"]==3 + assert Fraction(price["fixed_target_complete_upper"])<0 + lead=record("LEAD.json","lead/retime.py","lead/RESULT.json") + independent=record("INDEPENDENT.json","independent/barriers.py") + assert lead["typed_cut_checks"]==47490 and not lead["unvisited"] + assert independent["events"]==76466 and independent["excluded"]==5 and independent["unresolved"]==0 + assert independent["direct_move_clock_granted_arbitrary_inside_original_window"] + agreement=[] + for case,a,b in zip(price["candidates"],lead["rows"],independent["results"],strict=True): + assert case["role"]==a["role"]==b["role"] and case["clocks"]==a["clocks"]==b["clocks"] + assert [case["charts"][0],case["charts"][-1]]==b["endpoints"] + assert [x["peer"] for x in b["tests"]]==a["partners"] + assert [x["bounds"] for x in b["tests"]]==a["commuting_intervals"] + assert [p["retained_clock"] for p in a["placements"]]==case["clocks"] + assert all(p["slot_counts"]==[0,0] and p["witness"] is None for p in a["placements"]) + assert len(b["tests"])==2 and all(not x["endpoint_hits"] for x in b["tests"]) + assert b["excluded"] + agreement.append(dict(role=case["role"],clocks=case["clocks"],endpoints=b["endpoints"], + partner_clocks=[x["clock"] for x in b["tests"]],partner_bounds=a["commuting_intervals"])) + summary=dict(head=price["head"],caller=price["caller"],typed_cut_checks=47490, + agreement=agreement,excluded_windows=5,unresolved=0) + raw=(dumps(summary,indent=2,sort_keys=True)+"\n").encode() + outputs["AGREEMENT.json"]=raw + assert raw==source("receipts/AGREEMENT.json") + + assert set(outputs)-{"AGREEMENT.json"}==set(expected) + if out is not None: + out.mkdir(parents=True) + for name,raw in outputs.items(): + (out/relative(name)).write_bytes(raw) + print("PASS_P104_THREE_MOVE_TWO_ADD_RETIME_BOUND windows=5 typed_cuts=47490 unresolved=0") + + +def main(): + assert __debug__ and sys.version_info[:2]==(3,12) + parser=ArgumentParser(description=__doc__) + parser.add_argument("--out",type=Path) + args=parser.parse_args() + with TemporaryDirectory() as tmp: + replay(Path(tmp),args.out) + + +if __name__=="__main__": + main()