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-banked-transfer-pivots/.gitattributes b/research/p104-banked-transfer-pivots/.gitattributes new file mode 100644 index 0000000000..769b82c6ee --- /dev/null +++ b/research/p104-banked-transfer-pivots/.gitattributes @@ -0,0 +1,3 @@ +source/parent-invoice.json -text +source/7669-CREDITS.md -text whitespace=cr-at-eol +source/source-edits.json -text diff --git a/research/p104-banked-transfer-pivots/LICENSE b/research/p104-banked-transfer-pivots/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/p104-banked-transfer-pivots/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/research/p104-banked-transfer-pivots/NOTICE b/research/p104-banked-transfer-pivots/NOTICE new file mode 100644 index 0000000000..951f081717 --- /dev/null +++ b/research/p104-banked-transfer-pivots/NOTICE @@ -0,0 +1,7 @@ +Apache License 2.0. Research prepared for Ali Romman with substantial OpenAI Codex assistance. + +New work includes the fifteen certified sender/receiver pivots, the forward and transposed communication construction, the complete native row checker, and the finite stock and precision application for this 16-call program. + +SYLforge supplied the composition, native word reconstruction, published invoice and exact 16-stage caller bytes from PR #7669. Their original PROVENANCE.md is preserved in source/7669-CREDITS.md. It credits the H5B work of SYLforge, DreamingOfClouds' joint native reconstructions, Clear1nsight's coefficient splitting, role-379 and helper work, Rohan Arun's signed caller lineage, and prior contributions from CubeJerry, Douglas Colkitt and others. The source/ directory holds the exact file bytes identified in SOURCE-PINS.json. + +The group-ring caller checker, independent operator checks, bit service, finite-cost method and field guide adapt the corresponding code and arguments of Ali Romman's PR #7663. That package in turn builds on the contributors named in its preserved source/7663-NOTICE. The unchanged directed log/exp gate retains its listed sources in source/gate-NOTICE. Earlier paid-transfer and bank-support constructions include PRs #7434 and #7576. Jerry Chen (CubeJerry) supplied the selected PRs #7000 and #7001 and the typed initializer in PR #7586. The per-call odd-grid induction and the selected application review provide the complete-root realization and finite-cost substitution. Douglas Colkitt and the credited repository authors supplied the pinned operator engines, price evaluator and research workflow. The license accompanies this package. diff --git a/research/p104-banked-transfer-pivots/PIVOTS.json b/research/p104-banked-transfer-pivots/PIVOTS.json new file mode 100644 index 0000000000..feede77664 --- /dev/null +++ b/research/p104-banked-transfer-pivots/PIVOTS.json @@ -0,0 +1,17 @@ +[ + {"direction": "forward","remove": 99123,"pivot": 103275,"source_chart": 1031,"combination": [[103275,"10"],[103472,"-3"]],"sender": [[-1499,"1"]],"receiver": [[102595,"2"],[102596,"-11/2"],[102600,"-11/2"],[102604,"3/4"],[102624,"-5/2"],[102625,"-5/2"],[102744,"3/4"],[102745,"9/2"],[102885,"2"],[102891,"-1"],[102892,"-3/4"],[102952,"-1"],[102953,"-2"],[102954,"-1"],[102955,"2"],[103036,"1"],[103037,"2"],[103085,"-4"],[103086,"1"],[103270,"5/2"],[103432,"-3/4"],[103433,"9/2"]]}, + {"direction": "forward","remove": 97031,"pivot": 102748,"source_chart": 549,"combination": [[102748,"1"]],"sender": [[94976,"-1/2"],[96385,"-1/2"],[97049,"1"]],"receiver": [[103160,"1/2"]]}, + {"direction": "transpose","remove": 89622,"pivot": 88983,"source_chart": 318,"combination": [[88983,"1"]],"sender": [[97185,"2"],[97393,"1"]],"receiver": [[88940,"-1"],[88954,"1"],[88987,"-1"],[88989,"-1"],[89118,"1"],[96568,"-1"]]}, + {"direction": "transpose","remove": 89629,"pivot": 87777,"source_chart": 336,"combination": [[87777,"1/2"]],"sender": [[97386,"1"],[97405,"1/2"]],"receiver": [[87457,"1/2"],[87459,"-1/2"],[87747,"-1/2"],[87784,"-1/2"],[87820,"-1/2"],[90056,"1/2"]]}, + {"direction": "transpose","remove": 93636,"pivot": 87508,"source_chart": 412,"combination": [[87508,"1/2"]],"sender": [[96713,"1/2"],[97697,"1"]],"receiver": [[87510,"-1/2"],[87678,"1/2"],[87686,"-1/2"],[87704,"-1/2"],[87722,"-1/2"],[96707,"1/2"]]}, + {"direction": "transpose","remove": 99190,"pivot": 99169,"source_chart": 603,"combination": [[99169,"-1/4"]],"sender": [[99597,"1"]],"receiver": [[95743,"1/2"]]}, + {"direction": "forward","remove": 87508,"pivot": 96713,"source_chart": 3,"combination": [[96713,"1"]],"sender": [[-1117,"1"],[-1095,"1"],[-969,"1/2"],[-964,"-1/2"],[-935,"1/2"],[-908,"-1/2"]],"receiver": [[97628,"1/2"]]}, + {"direction": "forward","remove": 87777,"pivot": 97405,"source_chart": 3,"combination": [[97405,"2"]],"sender": [[-1474,"1"],[-1472,"4"],[-1471,"3/2"],[-1470,"2"],[-1450,"2"],[-1344,"2/3"],[-1341,"-1"],[-1329,"2"],[-1319,"-1"],[-1312,"1"],[-1308,"-1/2"],[-1288,"1/4"],[-1285,"-1/2"],[-1280,"-1/2"],[-1266,"-1/8"],[-1256,"-1/2"],[-1251,"1/2"],[-1250,"-1/4"],[-1249,"-1/2"],[-1246,"1/2"],[-1243,"-1/2"],[-1241,"1/4"],[-1239,"-1/2"],[-1237,"1"],[-1236,"1/2"],[-1235,"-1/2"],[-1234,"-1/2"],[-1230,"-1/2"],[-1229,"-1/2"],[-1228,"1/2"],[-1223,"-1/2"],[-1216,"-1"],[-1215,"-1"],[-1209,"-2"],[-1203,"-1"],[-1202,"-1"],[-1191,"1/4"],[-1189,"1/4"],[-1188,"1"],[-1185,"-1/2"],[-1177,"-1/2"],[-1176,"-1/2"],[-1173,"1"],[-1172,"-8"],[-1171,"2"],[-1114,"1/2"],[-1107,"1/2"],[-1106,"1/2"],[-1096,"-1/4"],[-1082,"2"],[-1080,"-1/4"],[-1075,"1/4"],[-1074,"1/4"],[-1071,"-1"],[-1069,"-1"],[-1066,"1"],[-1047,"-1"],[-1044,"2"],[-1043,"1/2"],[-1040,"1"],[-1038,"-1"],[-1036,"2"],[-1035,"1/2"],[-1033,"2"],[-1028,"-1"],[-1020,"-2"],[-1014,"-2"],[-1010,"2"],[-964,"-1"],[-958,"-1"],[-914,"-1/2"],[-908,"-1"],[-890,"-1"],[-813,"-1/4"],[-811,"4"],[-790,"-1"],[-757,"-2"],[-753,"1/2"],[-734,"-8"],[-733,"-4"],[-705,"5/2"],[-698,"1/4"],[-660,"-1/2"],[-656,"-1/4"],[-644,"-1/4"],[-642,"-1/4"],[-641,"1/8"],[-636,"-1/4"],[-625,"1/4"],[-620,"1/4"],[-618,"-1/4"],[-612,"-1/2"],[-610,"1/8"],[-609,"1/8"],[-600,"1/2"],[-591,"-1/4"],[-590,"-2"],[-588,"-1/4"],[-584,"-1/4"],[-583,"-1/4"],[-569,"1/2"],[-565,"1/2"],[-564,"1/2"],[-545,"7/2"],[-544,"4"],[-539,"1/2"],[-538,"-2"],[-537,"4"],[-532,"-2"],[-531,"1"],[-529,"7/4"],[-528,"2"],[-523,"-1"],[-518,"2"],[-513,"2"],[-512,"2"],[-498,"1/4"],[-497,"-1"],[-492,"2"],[-480,"1"],[-471,"1"],[-470,"1"],[-449,"2"],[-443,"-1/2"],[-442,"2"],[-441,"-2"],[-440,"-5/4"],[-435,"1/2"],[-430,"-8"],[-418,"-2"],[-415,"2"],[-400,"2"],[-384,"1"],[-364,"-1"],[-361,"2"],[-349,"1/2"],[-337,"3/2"],[-321,"-1/2"],[-320,"-1"],[-317,"3/4"],[-314,"2"],[-312,"1"],[-307,"1/2"],[-284,"3"],[-282,"-1"],[-281,"2"],[-277,"1/4"],[-273,"5/2"],[-269,"4"],[-265,"2"],[-258,"-1"],[-256,"-1/4"],[-237,"-3/2"],[-231,"2"],[-174,"1"],[-151,"1/2"],[-130,"1/2"],[-22,"-1"]],"receiver": [[97385,"-2"]]}, + {"direction": "forward","remove": 88983,"pivot": 97185,"source_chart": 3,"combination": [[97185,"1"]],"sender": [[-1046,"1"],[-1000,"1"],[-972,"1"],[-943,"-1"]],"receiver": [[97188,"-1"]]}, + {"direction": "transpose","remove": 89623,"pivot": 88940,"source_chart": 318,"combination": [[88940,"1"]],"sender": [[90092,"1"],[95202,"-1"]],"receiver": [[88954,"-1"],[89118,"-1"],[89639,"-1"],[90058,"1/2"],[96568,"1/2"]]}, + {"direction": "transpose","remove": 89630,"pivot": 87457,"source_chart": 336,"combination": [[87457,"-2"]],"sender": [[95049,"2"],[95162,"1"]],"receiver": [[87459,"2"],[87747,"2"],[90056,"-1"],[95094,"-1"]]}, + {"direction": "transpose","remove": 93637,"pivot": 87678,"source_chart": 412,"combination": [[87678,"-2"]],"sender": [[94756,"2"],[94777,"1"]],"receiver": [[87686,"2"],[87704,"2"],[94749,"-1"],[96707,"-1"]]}, + {"direction": "forward","remove": 87457,"pivot": 95049,"source_chart": 3,"combination": [[95049,"1"]],"sender": [[-1062,"1"],[-1019,"1"],[-974,"-1"],[-941,"1"]],"receiver": [[95052,"-1"]]}, + {"direction": "forward","remove": 87678,"pivot": 94756,"source_chart": 3,"combination": [[94756,"1/2"]],"sender": [[-1474,"1"],[-1473,"1/16"],[-1467,"1/4"],[-1344,"2/3"],[-1320,"-1/8"],[-1319,"-1/2"],[-1312,"-1/4"],[-1310,"-1/8"],[-1285,"-1/8"],[-1280,"-1/4"],[-1273,"1/2"],[-1266,"1/16"],[-1265,"-1/2"],[-1261,"-1/4"],[-1260,"1/2"],[-1257,"1/2"],[-1256,"-1/4"],[-1254,"1/4"],[-1250,"-1/4"],[-1249,"-1/2"],[-1248,"1/2"],[-1246,"1/2"],[-1245,"3/4"],[-1237,"-1/4"],[-1236,"1/4"],[-1235,"-1/2"],[-1234,"-1/2"],[-1231,"-1/8"],[-1230,"-1/4"],[-1229,"1/4"],[-1211,"-1/2"],[-1209,"1/2"],[-1204,"-1/2"],[-1200,"-1/4"],[-1199,"1/2"],[-1197,"-1/4"],[-1195,"-1/2"],[-1194,"-1/8"],[-1192,"1/4"],[-1189,"1/8"],[-1188,"1"],[-1187,"1/4"],[-1183,"-1/8"],[-1182,"-1/4"],[-1181,"-1/4"],[-1179,"-1/2"],[-1178,"-1/4"],[-1177,"-1/2"],[-1176,"-1/2"],[-1175,"1/4"],[-1174,"1/2"],[-1173,"-1"],[-1170,"-1/4"],[-1167,"-1/4"],[-1165,"1/2"],[-1162,"1"],[-1161,"1/2"],[-1145,"-1/2"],[-1143,"-1/2"],[-1140,"-1/2"],[-1129,"-1/8"],[-1127,"1/2"],[-1125,"1/2"],[-1123,"1/2"],[-1111,"-1/8"],[-1106,"-1/4"],[-1105,"-1/4"],[-1096,"-1/4"],[-1095,"-1/2"],[-1085,"1/8"],[-1078,"-1/2"],[-1073,"1/8"],[-1069,"-1/2"],[-1066,"1/4"],[-1063,"-1/2"],[-1059,"1/2"],[-1056,"1/2"],[-1049,"1/2"],[-1043,"-1/2"],[-1040,"1"],[-1034,"-1/4"],[-1033,"1/2"],[-1028,"-1"],[-1027,"-1/2"],[-1023,"-1/2"],[-1018,"1/2"],[-1012,"1/2"],[-1004,"1/8"],[-1000,"-1/4"],[-992,"-1/2"],[-988,"1/2"],[-985,"1/2"],[-984,"1/2"],[-983,"1/2"],[-982,"1/2"],[-981,"1/2"],[-976,"-1/2"],[-975,"-1/2"],[-974,"1/2"],[-973,"1/2"],[-972,"1/2"],[-969,"-1/2"],[-965,"-1/2"],[-964,"-1/2"],[-962,"-1/2"],[-958,"1/2"],[-957,"-1/2"],[-955,"-1/2"],[-946,"-1/2"],[-945,"-1/2"],[-944,"-1/2"],[-943,"1/2"],[-942,"1/2"],[-941,"1/2"],[-935,"1/2"],[-931,"-1/2"],[-929,"-1/2"],[-928,"-1"],[-927,"-1/2"],[-926,"-1/2"],[-923,"1/2"],[-922,"1/2"],[-921,"1/2"],[-920,"1/2"],[-919,"1/2"],[-917,"-1/2"],[-915,"1/2"],[-914,"-1/4"],[-913,"-1/2"],[-912,"-1/2"],[-908,"1/2"],[-907,"1/2"],[-905,"1/2"],[-904,"1/2"],[-903,"1"],[-901,"-1/2"],[-899,"1/2"],[-898,"-1/2"],[-897,"1/2"],[-896,"-1/2"],[-891,"1/2"],[-890,"-1/2"],[-888,"-1/2"],[-887,"-1/2"],[-883,"-1/2"],[-831,"1/2"],[-813,"1/4"],[-794,"-1/2"],[-761,"1/4"],[-733,"-4"],[-680,"-1/8"],[-665,"-1/2"],[-660,"-3/4"],[-656,"-1/4"],[-644,"-1/4"],[-642,"1/8"],[-641,"1/16"],[-636,"-1/4"],[-618,"1/8"],[-612,"1/4"],[-610,"-1/16"],[-593,"-1/8"],[-591,"1/8"],[-568,"1/4"],[-566,"1/8"],[-563,"-1/4"],[-562,"1/8"],[-561,"-1/2"],[-559,"1/2"],[-553,"-1/4"],[-552,"1/8"],[-551,"1/64"],[-548,"-1"],[-546,"1"],[-544,"-1/2"],[-540,"-1/2"],[-537,"1"],[-526,"-1/4"],[-524,"-1/4"],[-523,"1/2"],[-520,"-1/2"],[-519,"1/2"],[-514,"1/2"],[-509,"-1/2"],[-503,"1/4"],[-495,"1/2"],[-491,"-1/2"],[-485,"-1/16"],[-480,"-1"],[-471,"1"],[-470,"-1"],[-465,"-1/8"],[-462,"-1/4"],[-440,"-1/8"],[-429,"1/4"],[-419,"1/4"],[-408,"1/4"],[-405,"1/4"],[-365,"-1/4"],[-364,"-1"],[-361,"1/4"],[-357,"1/8"],[-355,"-1/16"],[-353,"1/8"],[-349,"1/2"],[-343,"-1/4"],[-335,"-1/16"],[-314,"1/2"],[-303,"1/16"],[-285,"-3/4"],[-284,"1"],[-282,"-1"],[-277,"1/4"],[-273,"1/4"],[-270,"1/8"],[-269,"4"],[-266,"1/128"],[-253,"1/64"],[-248,"-1/4"],[-244,"1/4"],[-243,"-1/4"],[-206,"-1/8"],[-174,"-1"],[-165,"1/4"],[-160,"-1/4"],[-4,"1/32"]],"receiver": []}, + {"direction": "transpose","remove": 90064,"pivot": 89639,"source_chart": 533,"combination": [[89639,"1"]],"sender": [[90844,"-1/2"],[98420,"1"],[98422,"1/2"]],"receiver": [[88940,"1"],[90095,"-1"]]} +] diff --git a/research/p104-banked-transfer-pivots/PROOF.md b/research/p104-banked-transfer-pivots/PROOF.md new file mode 100644 index 0000000000..7d6403f24d --- /dev/null +++ b/research/p104-banked-transfer-pivots/PROOF.md @@ -0,0 +1,69 @@ +# A banked transfer circuit for the signed 16-stage caller + +Assume the native all-column, owned-storage, compiler, fixed-tape and analytic-recovery hypotheses of the selected record. The circuit below gives **κ ≥ 0.0037260455556** in that framework. The raw crossing is strictly between 0.00372604555571 and 0.00372604555572. The open parent gives a raw crossing below 0.0037218793484. The new contribution includes the changed complete invoice and a physical realization with new finite constants. [Selected application, sections 2–7](https://github.com/CrocSwap/integer-mult-bounds/blob/e54523517d0f03e58352e647c403a5af3e525a57/docs/research/pr-intake-evidence/pr7000-application/PROOF-REVIEW.md) · [Open parent](https://github.com/CrocSwap/integer-mult-bounds/pull/7669) + +## 1. Replace one incoming transfer + +Start with the exact 150,522-event word with SHA-256 `ee251f6005d2a92b887c5b804bd7aac05989d278b2c9ccb3c3091b50d533b08d`. It has 6,157 paid MOVEs. The source loader checks twelve replacement blocks, their preimages, and the hashes of the supplied predecessor and reconstructed word. [Source file pins](SOURCE-PINS.json) · [Source edits](source/source-edits.json) + +At chart A write the physical field as T_A z, with T_A the canonical Clifford of its ordered basis. At native multiplicity f use the f-fold tensor power and the identity on spectators. A local rational sum in one chart computes the same sum of the normalized signals z. A paid A→B edge applies T_B T_A⁻¹ and so leaves z invariant. For actual independent input x at chart E, z = T_E⁻¹ x is a coordinate in the proof. The machine receives x directly. + +Give each entrance field its own bank with token `~r` for input role r. Fold the original scalar operations at each chart into rational linear forms on these banks and the returned paid fields. At each original MOVE record its source form and its destination chart. Use its source event index as the token for its return. Retain the form at each public exit. INIT supplies a zero row and CLEAR retires the old local row. This gives a directed acyclic circuit from independent inputs to all terminal forms. The implementation below stores snapshots in fresh private fields. It can use an earlier result at its chart until its last consumer has returned. [Construction and scheduler](network.py) + +Take a paid token t received at B. Suppose the full set S of rows which read t consists of transfers from B to the same C. Let h_m be the normalized row sent by slot m in S. Write α_m for the coefficient of t in that local form. Choose coefficients γ_m, with unspecified entries zero, such that s = Σ γ_m α_m is nonzero. Choose j in S with γ_j nonzero and set Y = Σ γ_m h_m. The witness gives a local form W at another chart F and a local form D at C such that **W = Y + D** on all independent inputs. + +Delete t. Change slot j to send W from F to C. For every other m in S, send h′_m = h_m − (α_m/s)Y from B to C. The coefficient of t in h′_m is zero. At C recover Y = W − D. Every old value has a local expression there: + +```text +h_m = h′_m + (α_m/s)Y for m ≠ j +h_j = (α_j/s)Y − Σ_{m ≠ j} (γ_m/γ_j)h′_m +``` + +The second equality follows from Σγ_m(h_m − α_mY/s) = 0. Substitute these expressions in every subsequent read. Local availability matters on both sides of the replacement. The scheduler checks every donor’s destination chart against the consumer’s actual source chart, includes the terminal edges and constructs a topological order. A cycle rejects a candidate even when its unrestricted linear equations hold. Each successful replacement removes exactly one paid edge. + +For example, the first entry deletes slot 99123. It uses Y = 10h₁₀₃₂₇₅ − 3h₁₀₃₄₇₂. The sender at chart 1031 has the entrance value for independent role 1498. The 22 terms in the receiver list give exactly that value minus Y. Thus slot 103275 can send that one entrance field. The checker recomputes this identity over every input coefficient. Changing the sender sign fails that check. [All fifteen witnesses](PIVOTS.json) · [Exact rational checker](native.py) + +Seven steps use the forward circuit. Eight use its transpose. Transpose exchanges inputs and terminals, reverses the paid edges and reverses each scalar incidence with the same rational weight. Each input-to-output path has the same weight on its reversed path. Hence the new normalized map is the ordinary matrix transpose. Check the rational substitution in this direction and transpose back. The implementation executes only the final forward circuit. The schedule and the physical recipe for every forward pair are checked after construction. A search over possible senders and receiver spans nominated the witnesses. The finite checks use only the published witnesses and exact arithmetic. + +## 2. Check the native and complete signed operators + +The endpoint check evaluates the whole final circuit on 1,501 independent formal input fields. For each of 96 A ports its first pair returns (x,y+x) and its second pair returns (u−v,v) in normalized coordinates. At each of eight B ports the returned pair is (x−y,(x+y)/2). The 1,101 helper outputs each return their own normalized entrance value. Consequently a helper with actual endpoints E and G implements T_G T_E⁻¹ on its own arbitrary physical input. All helper endpoints, including the parent’s special starts and exits, have their actual positive job rank in the target census. + +For each paid or helper pair, construct the recipe for T_B T_A⁻¹. Direct binary span tests check containment and rank. A second engine checks signed Pauli action and absolute Gaussian phase. Equality of the Pauli action fixes a Clifford up to a scalar, and equality on the image of the zero-basis vector fixes that scalar. All 3,024 distinct pairs pass. For the ten distinct pairs at surviving slots with a new physical route, compare all 512 forward columns and all 512 adjoint columns directly. At all 104 main ports, check both rank-zero adapters and their phases. In the 96 second planes the two charts match the corresponding first-plane charts at both ends. This establishes the finite physical maps on nine axes. The retained native assumption supplies their uniform realization at multiplicity f. [Operator verifier](catalogue.py) + +Use the exact 4,192-event caller from the parent. Each of the 16 stages uses eight disjoint body axes and nine common axes, for actual ambient rank 137. Expand each of 68 formal roles over the Gaussian group ring with one head power modulo four and one formal power for each stage. The head and stage maps commute on the admitted layout. Replay every signed operation, including queries, idle operations, the LAMBDA mix and simultaneous butterfly reads. Each exit equals the declared positive body monomial on its original input owner. Replication on the real ports gives 3,536 root owners. Each stage has 400 distinct main owners and 1,101 independent fresh helpers. The latter supply 17,616 more targets. [Signed caller verifier](caller.py) · [Owner and invoice checks](verify.py) + +| Complete paid change | Rank 1 | Rank 2 | Rank 3 | Rank 4 | Total | +| --- | ---: | ---: | ---: | ---: | ---: | +| Per native invocation | −23 | +2 | +5 | +1 | −15 | +| Across all 16 invocations | −368 | +32 | +80 | +16 | −240 | + +All other paid counts agree with the parent. Every target count agrees. The weighted change at exponent one is zero. The complete positive rank-mass surplus is 1,328. At the desired exponent the distinct costs of ranks 1 through 4 give a strict saving. The verifier first reproduces both full parent histograms from its source and caller, then measures the changed graph. [Complete histograms and exact margins](RESULT.json) + +Let M(k) = Σᵣ(Tᵣ−Pᵣ)r^(1−k). The 256-bit power evaluator and the independent 80-decimal-place log/exp intervals put M above zero at 0.00372604555571 and below zero at 0.00372604555572. Its derivative is strictly negative on the required interval. At the application probe 0.00372604555567 the lower margin exceeds 1.66 × 10⁻⁸. The 1,920-fold product uses paid cutoff 11, target floor 12 and shift 1/7. The paid ratio is below 1−10⁻²⁷. The two tail ratios are below 31/32. The program checks separated compiler funding and the input lift, with written logarithm power 2,287, seven gaps of 10⁻¹⁴ and H = 14,558,800,000,000,000,000. It checks 54 strict and four functional outer predicates. The least margin is 10⁻¹⁵. The selected BIT saving of 0.00385248 supplies the weaker 0.00376669 required here. The proof uses claim 0.0037260455556 in the outer conclusion. [Interval gate](source/interval_gate.py) · [Selected BIT review](https://github.com/CrocSwap/integer-mult-bounds/blob/e54523517d0f03e58352e647c403a5af3e525a57/docs/research/pr-intake-evidence/pr7000-application/PROOF-REVIEW.md) + +## 3. Retain the complete root grid + +Scale the actual input arrays at each caller and each native entrance by 2,025. Divide their completed exits by 2,025 at the same boundary. This uses 2(3,536 + 16 × 1,501) = 55,104 full-array conversions. The native and caller entrance factors have separate physical charges. The native helper entrances can contain arbitrary values in the admitted root format. [Common-grid induction](https://github.com/CrocSwap/integer-mult-bounds/blob/e54523517d0f03e58352e647c403a5af3e525a57/research/odd-native-common-grid/PROOF.md) + +For each native row v, recursively bound its coefficient denominator by the least common multiple of b times its donor’s bound over incoming coefficients a/b in lowest terms. The least common multiple over all rows is 2,025 × 2¹⁸. On this grid the checker verifies 8,533,666 elementary coefficient products and their exact divisions before addition. A row contains the T_A T_E⁻¹ factor for input chart E on every contribution from that same input. These factors telescope around every normalized path. Partial sums in the specified row order have scaled coefficient mass at most 55,817,215,425/32. This bound uses the sum of absolute term masses before cancellation. The largest numerator or denominator needs 13 bits. + +The caller replay uses grid 2,025 × 2⁹. It checks 153,295 nontrivial pre-product divisions and every output on all signed monomials. Its scaled prefix mass is at most 495,734,175/2. Replicating a port duplicates a whole row on a distinct physical owner. In one unfinished context, a native row nested inside a caller row therefore has exterior denominator height at most 27 and mass at most 27,670,501,239,509,649,375/64 < 2⁵⁹. This also bounds an independent helper. Completed children contribute a whole Clifford factor and retain any exterior debt at their entrance. Banked earlier rows retain the bounds from their own prefixes. An interrupted ordinary SWAP has the temporary factor two of the selected proof and contains no recursive call. + +Take c = 2 max(27,59) = 118 and K* = 1,920 × 153¹⁹²⁰ × (H+1)². The bit length of cK* is 14,080, strictly less than H. The selected unfinished-depth estimate therefore gives ct < D at each recursive root of active dimension D and unfinished depth t. Its complete-factor Clifford row bound gives fractional width at most p + ceil(D/2) + 27t and magnitude bits below h+D+2. Use F = p+D fractional bits and signed width W = p+h+2D+3, with W+26 for fixed-coefficient products and the complete LAMBDA numerators. All 13-bit numerators fit in this reserve. Induction on the finite ideal instruction tree gives exact physical results in that same root format, including odd divisions, shifts and final unscalings. Process the selected initial and final phase layers, reserved row factors and final normalization at their original boundaries. Apply the single final truncation in the selected argument. This proof does not assume exact returns from a separately rounded descendant. [Root-width and boundary proof, sections 4–7](https://github.com/CrocSwap/integer-mult-bounds/blob/e54523517d0f03e58352e647c403a5af3e525a57/docs/research/pr-intake-evidence/pr7000-application/PROOF-REVIEW.md) + +## 4. Pay for the private snapshots and restoration + +Let n = 1,501 be the public width and k = 6,142 the number of positive transfers. Copy each entrance into one private snapshot. Reserve a separate source accumulator for each of k paid rows and n terminal rows. Reserve one returned snapshot for each paid row and four scratch fields for serial scalar operations. These 2n+2k+4 = 15,290 private homes are in addition to the actual public fields and adapter workspace. Give every home its stage and occurrence tag. Form a row in a fresh zero accumulator by exact scalar reads from prior snapshots at its chart. Keep each donor intact. A paid row gets its own complete child and both adapters. Move or copy the completed field to its return bank. Wait for the child and its adapters before the next dependent step. Keep all terminal accumulators separate until every output is available, install them on the public boundary, and erase the private homes in full. Scheme-wide native reservation is 244,640 full-field homes per raw signed caller. None earns productive credit. + +The selected shape and movement primitives provide one complete field view at a time. Use a typed guide with a left and a right marker on a separate track. For R rows, active dimension D and W signed component bits, its payload has L = (2W+3)R2ᴰ positions. At each position it carries the appropriate scientific zero symbol, including delimiters and represented blanks. Prepare the guide from R, D and W. A fixed-width component template can be duplicated once per address with a rewound source head. The total borrow travel of an ordinary binary address counter over m successive decrements is O(m). Thus guide production, alignment, return and retirement take O(L+1) plus descriptor setup. A separate immutable guide can serve equal views with the same format. The guide and bank origins have separate guards. + +On initialization the outward pass writes the guide’s designated symbol to each payload cell. On erasure it writes raw blank to every payload cell. It returns both heads without writes. After j outward steps the first j payload cells have their prescribed symbols, while the suffix and exterior guards retain their contents. Including departure, reversal and halt, the pass takes exactly 2L+3 transitions for arbitrary dirty data, including old internal blanks. Allocate the field with this extent before using it and retire its full backing. A small finite program can place K homes consecutively on fixed tapes. A selection, scan, return or installation within that occurrence then costs O(K(L+1)) on equal views. On a changed view charge its selected layout construction and the actual packed extent. K is fixed once the raw or compiled occurrence is fixed. Park the enclosing tuple before every recursive descent and retain the backing until its owner returns. This uses the selected view and compiler assumptions. The bound on local guide work covers the scan and return in addition to the choice of home. [Bit and reset service checks](physical.py) · [Earlier private-field construction](https://github.com/CrocSwap/integer-mult-bounds/blob/b81f40997de646de30749d367484d89e59fc3013/research/p104-joint-chart-banks/PROOF.md) + +For a fixed a/b, low-to-high multiplication on sign/magnitude has carry at most |a|. High-to-low division keeps a remainder less than b. The positional invariants of these two scans give the signed product and exact quotient for every admitted width. Check the remainder before installation. A ripple addition preserves the donor. Complete scalar movement includes sign handling, work fields, head returns and retirement. The selected bounded-scan implementation fits the allowance of 2²¹ transitions per padded component bit for these 13-bit constants. The replay also exercises 4,038 signed coefficient cases, including values over 64 bits, rejects an odd last tick, and checks guards and internal blanks in both reset modes. + +There are 169,343 local terms in the returned and terminal forms. Charge 32 scalar services per term, plus explicit per-row preparation and return, public copying and installation, field retirement, caller macros and conversions. The resulting bound per raw caller is 117,280,256 scalar services. The reset allowance of 11,816,384 covers two services per reserved native home and four more per term or row. Charge the actual extent at each use. The 276,944 monomial slots include both adapters per paid and productive occurrence, both main adapters, and the signed caller’s actual local routing. At most 4 × 154² elementary records per slot gives 26,272,015,616 total. Charge each record at the selected complete-volume rate, with actual setup and return. The constants and their formulas are in the replay. [Cost calculation](physical.py) · [Receipt](RESULT.json) + +Construct the finite chronological product, completion, splitting and integer compiler with the invoice in section 2. Let J count native occurrences and U count raw caller occurrences in this finite compiled template. Reserve at least 15,290J native homes, U caller query/normalizer tuples, guides, guards, suspended fields, and all compiler and primitive backing. Charge their initialization, selection, head returns and cleanup in G, including compiler wrappers and the source-specific BIT stock from the selected proof. Use the actual productive width Wp and this owned reserve O in the selected substitution Z=Wp+O, E0=64(Z+N+P+G+1)³, B0=P+E0, C0=32NB0². Include Wp in the row-divisibility stock and the simultaneous BIT and complex capacities in the packed layout. These finite substitutions increase the constant and the input threshold. All strict outer gaps have already been checked, so the selected asymptotic absorption argument applies after the constants are fixed. The numerical exponent concerns that asymptotic construction. The package gives no practical speed or memory improvement for ordinary integer multiplication. + +Independent review of this application remains open. Native all-column realization, owned allocation and erasure, compiler uniformity, fixed-tape precision and movement, and analytic recovery remain assumptions. The parent’s fixed-tariff, separately rounded program has different numerical and storage obligations. The exact finite checks and the proof above apply to the charged common-root implementation specified here. diff --git a/research/p104-banked-transfer-pivots/README.md b/research/p104-banked-transfer-pivots/README.md new file mode 100644 index 0000000000..595afc8cf1 --- /dev/null +++ b/research/p104-banked-transfer-pivots/README.md @@ -0,0 +1,37 @@ +# Fifteen fewer paid transfers per native call + +The construction gives **conditional κ ≥ 0.0037260455556** under the five assumptions in the selected multiplication framework. It starts with SYLforge’s 16-call construction. At fifteen places a sender can supply a linear combination that the receiver needs from a different chart. Each change saves one recursive call. The complete construction saves 240 calls and retains all 21,152 productive fields. [Parent PR #7669](https://github.com/CrocSwap/integer-mult-bounds/pull/7669) · [Construction and application proof](PROOF.md) + +| Quantity | Published parent | This construction | +| --- | ---: | ---: | +| Paid transfers per native call | 6,157 | 6,142 | +| Paid calls in the complete construction | 102,064 | 101,824 | +| Productive fields | 21,152 | 21,152 | +| Target minus paid rank mass | 1,328 | 1,328 | +| Directed bracket for the raw crossing | (0.0037218793483, 0.0037218793484) | (0.00372604555571, 0.00372604555572) | + +The claimed saving exceeds the parent’s **upper** endpoint by 0.0000041662072, or 0.11194%. That increment is 1.758 times the 0.0000023694495 increment in PR #7663. The comparison with the selected conditional κ of 0.00363005817 is 2.64424% and includes the work of the predecessor authors. The new implementation reserves 15,290 private full-field homes per native call. The two constructions have different finite resource budgets. [Previous step](https://github.com/CrocSwap/integer-mult-bounds/pull/7663) · [Selected record at the base commit](https://github.com/CrocSwap/integer-mult-bounds/blob/e54523517d0f03e58352e647c403a5af3e525a57/certificates/selected-result.json) + +## Review and reproduce + +1. Read the first entry in [PIVOTS.json](PIVOTS.json) with the identity in [section 1](PROOF.md#1-replace-one-incoming-transfer). All fifteen entries use event indices from the same pinned parent. A negative input token `~r` denotes public role `r`. +2. Inspect the paid and productive histograms, two directed price checks, compiler margins and physical charges in [RESULT.json](RESULT.json). The physical and precision argument is in [sections 3 and 4](PROOF.md#3-retain-the-complete-root-grid). +3. Run the package from the repository root with Python 3.12 and its standard library. + +```sh +python3.12 -B scripts/research_package.py --package research/p104-banked-transfer-pivots --check-only +python3.12 -B scripts/research_package.py --package research/p104-banked-transfer-pivots +``` + +The eight registered commands reconstruct the source word, check the fifteen exact identities, verify every public endpoint and price the complete signed caller. The six catalogue slices check phase and rank for 3,024 physical pairs. They compare all forward and adjoint columns on the ten distinct rerouted pairs. They also check all 104 main ports. The replay rejects a wrong sender sign, a wrong phase, a nonlocal donor, a causal cycle and an inexact division. [Replay manifest](VERIFY.json) · [Repository input pins](SOURCES.json) · [Open-source head and file pins](SOURCE-PINS.json) + +The finite certificates cover the stated circuits. The application still requires native all-column realization, owned allocation and erasure, compiler closure, fixed-tape precision and movement, and analytic recovery. The exact-grid argument applies to the common root format. The separately rounded finite-tariff implementation described in the parent needs its own error proof. Independent scientific review and a materialized full multiplier remain open. [Application proof](PROOF.md) · [Parent scope](https://github.com/CrocSwap/integer-mult-bounds/blob/eaef5d1580e5761feaed09262b964871f3e5f553/research/ee251f60-composition/README.md) + +## Open next questions + +- Can some of the 15,290 private snapshots share backing? Compute the last read of each snapshot in the published schedule. A smaller bound needs a proof of allocation, resets and selection across child returns. +- Can a pivot increase the target minus paid rank mass? Check candidate sender relations against arbitrary independent inputs, their legal receiver dependencies and the full 16-call invoice. The present changes preserve the rank mass exactly. + +## Credit + +Ali Romman, with substantial OpenAI Codex assistance. The fifteen rational pivots, the resulting bank program and the application to the 16-call construction are new here. SYLforge supplied the source word and caller bytes. DreamingOfClouds, Clear1nsight, Rohan Arun, Jerry Chen (CubeJerry), Douglas Colkitt and the contributors recorded in the source notices supplied predecessor constructions, operator and compiler methods, and the selected framework. [Attribution](NOTICE) · [Parent provenance](source/7669-CREDITS.md) · [Coordination discussion](https://github.com/CrocSwap/integer-mult-bounds/discussions/7111#discussioncomment-19700346) diff --git a/research/p104-banked-transfer-pivots/RESULT.json b/research/p104-banked-transfer-pivots/RESULT.json new file mode 100644 index 0000000000..11e0617c58 --- /dev/null +++ b/research/p104-banked-transfer-pivots/RESULT.json @@ -0,0 +1,471 @@ +{ + "native": { + "grid": "530841600", + "odd": 2025, + "dyadic_height": 18, + "peak_scaled_mass": "55817215425/32", + "checked_products": 8533666, + "terms": 169343, + "slots": 6142, + "coefficient_bits": 13, + "public": 1501, + "mains": 400 + }, + "pivot_checks": 15, + "application": { + "claim": "0.0037260455556", + "parent_upper": "0.0037218793484", + "invoice": { + "contract": { + "ambient_rank": 137, + "boundary": "actual signed caller research candidate with 16 native calls", + "model": "mixed-target-unnormalized-power-v1", + "rank_semantics": "H_r costs r^(1-C); debit surrendered productive fields" + }, + "paid": { + "1": 63408, + "2": 14096, + "3": 9712, + "4": 3904, + "5": 5792, + "6": 1392, + "7": 176, + "8": 752, + "9": 96, + "16": 416, + "24": 416, + "32": 416, + "40": 416, + "48": 416, + "56": 416 + }, + "schema": "integer-mult-recursive-invoice/v1", + "targets": { + "1": 288, + "2": 336, + "3": 752, + "4": 3632, + "5": 1248, + "6": 704, + "7": 304, + "8": 512, + "9": 10256, + "17": 416, + "25": 416, + "33": 416, + "41": 416, + "49": 416, + "57": 416, + "65": 416, + "129": 208 + } + }, + "paid_change": { + "1": -368, + "2": 32, + "3": 80, + "4": 16 + }, + "parent_paid": 102064, + "paid": 101824, + "targets": 21152, + "signed_surplus": 1328, + "caller": { + "paid": { + "8": 640, + "9": 32, + "56": 416, + "48": 416, + "40": 416, + "32": 416, + "24": 416, + "16": 416, + "1": 384 + }, + "targets": { + "129": 208, + "65": 416, + "57": 416, + "49": 416, + "41": 416, + "33": 416, + "25": 416, + "17": 416, + "9": 416 + }, + "uses": { + "ADD": 92400, + "SCALE": 11728, + "IDLE_ONE": 3136, + "LAMBDA": 10672, + "IDLE_ODD": 32, + "SWAP": 240, + "QUERY": 384 + }, + "calls": 16, + "dyadic_height": 9, + "odd_scale": 2025, + "peak_scaled_mass": "495734175/2", + "exact_preproduct_divisions": 153295, + "root_owners": 3536, + "fresh_helpers": 17616 + }, + "stage_owners": [ + 400, + 400, + 400, + 400, + 400, + 400, + 400, + 400, + 400, + 400, + 400, + 400, + 400, + 400, + 400, + 400 + ], + "pivots": [ + [ + "forward", + 99123, + 103275, + 6156 + ], + [ + "forward", + 97031, + 102748, + 6155 + ], + [ + "transpose", + 89622, + 88983, + 6154 + ], + [ + "transpose", + 89629, + 87777, + 6153 + ], + [ + "transpose", + 93636, + 87508, + 6152 + ], + [ + "transpose", + 99190, + 99169, + 6151 + ], + [ + "forward", + 87508, + 96713, + 6150 + ], + [ + "forward", + 87777, + 97405, + 6149 + ], + [ + "forward", + 88983, + 97185, + 6148 + ], + [ + "transpose", + 89623, + 88940, + 6147 + ], + [ + "transpose", + 89630, + 87457, + 6146 + ], + [ + "transpose", + 93637, + 87678, + 6145 + ], + [ + "forward", + 87457, + 95049, + 6144 + ], + [ + "forward", + 87678, + 94756, + 6143 + ], + [ + "transpose", + 90064, + 89639, + 6142 + ] + ], + "powers": [ + [ + "0.0037218793483", + "lower", + { + "lower": "-115581413614341996474187058928191596648794056289072610410151828119639/3618502788666131106986593281521497120414687020801267626233049500247285301248", + "upper": "-231162827228683992948374117856383193297588112578145220820303649100105/7237005577332262213973186563042994240829374041602535252466099000494570602496" + } + ], + [ + "0.0037218793484", + "higher", + { + "lower": "25099189947401472581608269319475629675469453296780090483218745223129/7237005577332262213973186563042994240829374041602535252466099000494570602496", + "upper": "25099189947401472581608269319475629675469453296780090483218752144353/7237005577332262213973186563042994240829374041602535252466099000494570602496" + } + ], + [ + "0.0037260455556", + "higher", + { + "lower": "10676315656068772786401876040842803440271897926827976004135600820172706002715/7237005577332262213973186563042994240829374041602535252466099000494570602496", + "upper": "5338157828034386393200938020421401720135948963413988002067800410086356706747/3618502788666131106986593281521497120414687020801267626233049500247285301248" + } + ], + [ + "0.0037260455556", + "lower", + { + "lower": "-149975923487221802665958718531258228814033709673447697709475154677989/3618502788666131106986593281521497120414687020801267626233049500247285301248", + "upper": "-299951846974443605331917437062516457628067419346895395418950301937773/7237005577332262213973186563042994240829374041602535252466099000494570602496" + } + ], + [ + "0.00372604555567", + "lower", + { + "lower": "-60385823677098567459210685988678444302588290538654637231066475166033/3618502788666131106986593281521497120414687020801267626233049500247285301248", + "upper": "-60385823677098567459210685988678444302588290538654637231066471487679/3618502788666131106986593281521497120414687020801267626233049500247285301248" + } + ], + [ + "0.00372604555571", + "lower", + { + "lower": "-35904222376829088228416467236735442153112745723993098955519433949/14134776518227074636666380005943348126619871175004951664972849610340958208", + "upper": "-18382961856936493172949231225208546382393725810684466665225943092327/7237005577332262213973186563042994240829374041602535252466099000494570602496" + } + ], + [ + "0.00372604555572", + "higher", + { + "lower": "3607104758688023652523693795164294881085488895839601403897038418149/3618502788666131106986593281521497120414687020801267626233049500247285301248", + "upper": "7214209517376047305047387590328589762170977791679202807794084359101/7237005577332262213973186563042994240829374041602535252466099000494570602496" + } + ] + ], + "compiler": { + "claim": "9315113889/2500000000000", + "tested": "372604555567/100000000000000", + "raw_bracket": [ + "372604555571/100000000000000", + "93151138893/25000000000000" + ], + "moment_margins": { + "372604555571/100000000000000": [ + "15875835713837552291826628962232052841124379848542910598102864403499321/6250000000000000000000000000000000000000000000000000000000000000000000000000000", + "15875835713837552291826628962232052841124379848542910598102864405740439/6250000000000000000000000000000000000000000000000000000000000000000000000000000" + ], + "93151138893/25000000000000": [ + "-3115156469191304458068498827493552879195403033025021963016738010322167/3125000000000000000000000000000000000000000000000000000000000000000000000000000", + "-6230312938382608916136997654987105758390806066050043926033476018413129/6250000000000000000000000000000000000000000000000000000000000000000000000000000" + ], + "372604555567/100000000000000": [ + "52150215161363623842261144221150972839456016083329301170749375087135109/3125000000000000000000000000000000000000000000000000000000000000000000000000000", + "52150215161363623842261144221150972839456016083329301170749375088240387/3125000000000000000000000000000000000000000000000000000000000000000000000000000" + ] + }, + "moment_margin_float": { + "372604555571/100000000000000": [ + 2.5401337142140085e-09, + 2.5401337142140085e-09 + ], + "93151138893/25000000000000": [ + -9.968500701412173e-10, + -9.968500701412173e-10 + ], + "372604555567/100000000000000": [ + 1.668806885163636e-08, + 1.668806885163636e-08 + ] + }, + "derivative_upper": -348613.3290464958, + "alpha": [ + 0.9999999999999382, + 0.9999999999999382 + ], + "gamma": [ + 0.9334323771155476, + 0.9334323771155476 + ], + "delta": [ + 0.9322377190117992, + 0.9322377190117992 + ], + "minimum_log_power": 2286, + "written_log_power": 2287, + "compiler_gap": "1/100000000000000", + "H": "14558800000000000000", + "BIT_pin": "376669/100000000", + "BIT_margin": "4064444433/100000000000000", + "outer": { + "strict_count": 54, + "functional_count": 4, + "minimum_margin": "1/1000000000000000", + "BIT_just_below_effective_rejected": true + }, + "input_lift": { + "margins": { + "9315113889/2500000000000": [ + "12700427118191787467959187764741998320358523764062379104098810847051285503909/10000000000000000000000000000000000000000000000000000000000000000000000000000000", + "127004271181917874679591877647419983203585237640623791040988108470512855041029/100000000000000000000000000000000000000000000000000000000000000000000000000000000" + ], + "372604555567/100000000000000": [ + "25400854236839944168811969910073971827943612210810061720852213229284472466403/20000000000000000000000000000000000000000000000000000000000000000000000000000000", + "63502135592099860422029924775184929569859030527025154302130533073211181166981/50000000000000000000000000000000000000000000000000000000000000000000000000000000" + ] + }, + "interval_kappa_cap": "376669/100000000", + "derivative_upper_on_required_interval": "-2299831290525933154178526076272396899996972093654613095735772838275432653960006518819/2500000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "source_BIT_wide_crude_bound_would_be": "-2299831290525933154178526076272396899996972093654613095735772838275432653960006518819/2500000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + } + }, + "physical": { + "odd_conversions": 55104, + "coefficient_bits": 13, + "scalar_test_cases": 4038, + "raw_private_homes": 244640, + "homes_per_native": 15290, + "reset_services_upper": 11816384, + "scalar_services_upper": 117280256, + "scalar_steps_per_bit_upper": 2097152, + "monomial_slots_upper": 276944, + "elementary_records_upper": 26272015616, + "dyadic_height": 27, + "context_mass_upper": "27670501239509649375/64", + "context_mass_bits": 59, + "context_c": 118, + "depth_guard_bits": 14080, + "H": 14558800000000000000 + } + }, + "catalogue": [ + { + "slice": 0, + "total": 3024, + "checked": 504, + "columns": [ + [ + 3, + 318 + ], + [ + 3, + 533 + ], + [ + 3, + 571 + ], + [ + 3, + 720 + ], + [ + 3, + 744 + ], + [ + 549, + 127 + ] + ], + "ports": 104, + "recipes_sha256": "85397b3c3c825fdcdc1c0f9645de09b68d94de993162b88f5f8e9df86353f76e" + }, + { + "slice": 1, + "total": 3024, + "checked": 504, + "columns": [ + [ + 3, + 603 + ] + ], + "ports": 0, + "recipes_sha256": "a0ddba81d51e13c08ed992bc41745162fcfc5e7a783ecd2cfb53629aaa6a0844" + }, + { + "slice": 2, + "total": 3024, + "checked": 504, + "columns": [ + [ + 1031, + 127 + ] + ], + "ports": 0, + "recipes_sha256": "3add2c15ba2c35e006eaba30aef64b1123ed321f8ff0cf896e7f41e3c86751b9" + }, + { + "slice": 3, + "total": 3024, + "checked": 504, + "columns": [ + [ + 3, + 521 + ] + ], + "ports": 0, + "recipes_sha256": "62117424de94d6fd37bbd00f2a086ed91d98b25c209e95caa0a2c80fc8e6dbd7" + }, + { + "slice": 4, + "total": 3024, + "checked": 504, + "columns": [ + [ + 3, + 717 + ] + ], + "ports": 0, + "recipes_sha256": "f2a265277d90114f5a3b905a118644b3cc29f31dd5ed7392ed8c8f444745de37" + }, + { + "slice": 5, + "total": 3024, + "checked": 504, + "columns": [], + "ports": 0, + "recipes_sha256": "342b912d277c857cd2be7ad744c550c3981a59518570895c6079ce8eac0e2a6a" + } + ] +} diff --git a/research/p104-banked-transfer-pivots/SOURCE-PINS.json b/research/p104-banked-transfer-pivots/SOURCE-PINS.json new file mode 100644 index 0000000000..489f8a60e9 --- /dev/null +++ b/research/p104-banked-transfer-pivots/SOURCE-PINS.json @@ -0,0 +1,58 @@ +[ + { + "file": "source/K372-2-WORD.json.gz", + "commit": "eaef5d1580e5761feaed09262b964871f3e5f553", + "path": "research/ee251f60-composition/data/K372-2-WORD.json.gz", + "sha256": "631babeca90e78c5caac713484fe618328b9beee8294baef6ac45ffc9a75dd3b", + "git_blob": "1273c83178693e1627a2324680907f9b0e95e995" + }, + { + "file": "source/source-edits.json", + "commit": "eaef5d1580e5761feaed09262b964871f3e5f553", + "path": "research/ee251f60-composition/EDIT.json", + "sha256": "05b84f9578fddc7adc7805f20afdfe5ea679d298b2232d7f718193185f471656", + "git_blob": "23368c8750e6d981ee10664187c6a2c3859be542" + }, + { + "file": "source/caller.json.gz", + "commit": "eaef5d1580e5761feaed09262b964871f3e5f553", + "path": "research/ee251f60-composition/data/CALLER.json.gz", + "sha256": "d889996a337f648087208ab51c98eaf052705d4fca88b5d01b6e9257a829897a", + "git_blob": "26a75a1ae32cb4944a65281cfb08775967cb39a0" + }, + { + "file": "source/parent-invoice.json", + "commit": "eaef5d1580e5761feaed09262b964871f3e5f553", + "path": "research/ee251f60-composition/data/INVOICE.json", + "sha256": "c79d8c51ad34c7c14134c41d3ae132ab91101e8e24674b52a2abfa191de3fd00", + "git_blob": "4cfe4f0fe98a820153cac58747dd80fb2a2402e6" + }, + { + "file": "source/7669-CREDITS.md", + "commit": "eaef5d1580e5761feaed09262b964871f3e5f553", + "path": "research/ee251f60-composition/PROVENANCE.md", + "sha256": "706c6c852e87e371ddf1828244b2f0c2b00279728818023aa911c8947d69ab83", + "git_blob": "bbee2437f012c3268eb5cd920adfa37394c1de72" + }, + { + "file": "source/interval_gate.py", + "commit": "b81f40997de646de30749d367484d89e59fc3013", + "path": "research/p104-joint-chart-banks/source/interval_gate.py", + "sha256": "60a743d13f668ef86db4b8215b4d5d04430a671ba6f1fe06d9c1c4c3dfe86da5", + "git_blob": "e24dc46079b4c25152f5afc096dda2ce8ee58ff5" + }, + { + "file": "source/gate-NOTICE", + "commit": "b81f40997de646de30749d367484d89e59fc3013", + "path": "research/p104-joint-chart-banks/source/independent-NOTICE", + "sha256": "cadbc642ca84311d2c7a6cf704c7828cb4cf77e3c784b66e4c6e8a5c28002fb8", + "git_blob": "1bc9b4da2b8398954cd7a49356eb9d397785d0a6" + }, + { + "file": "source/7663-NOTICE", + "commit": "b81f40997de646de30749d367484d89e59fc3013", + "path": "research/p104-joint-chart-banks/NOTICE", + "sha256": "5fd4367578d2339fbdcd7dc116b6c12cb4fa72e92d2e3d67be537a36c8bd9d40", + "git_blob": "6ce1bc49a3612c9e906df02de81bcba84be8e803" + } +] diff --git a/research/p104-banked-transfer-pivots/SOURCES.json b/research/p104-banked-transfer-pivots/SOURCES.json new file mode 100644 index 0000000000..f51fc62b8a --- /dev/null +++ b/research/p104-banked-transfer-pivots/SOURCES.json @@ -0,0 +1,42 @@ +{ + "schema_version": 1, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "75d77b328ea02ded535e7f23aee5b1e55d0bb1a8", + "sha256": "154c3d30455d778fd3343b6b4851f0fa4665f0f7625b0adb3675e2bafbbf6bf1" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "3404fbdd5e7529a0674eef26114b5071e4586cec", + "sha256": "ead6cdc9d0af6d58e8a49744d8ec8c7c15e13d2ba93c276c434bcf9b51b93a81" + }, + { + "path": "research/shared-wire-split-composition/frozen/clifford_exact.py", + "usage": "input", + "git_blob": "166841a037f069249f6f7f6dedb89248812f59e2", + "sha256": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962" + }, + { + "path": "research/shared-wire-split-composition/frozen/native_verify.py", + "usage": "input", + "git_blob": "2c209dfa9cfade3bc20ac5fc9d876b433a147f8c", + "sha256": "3049471905b47b385c88378a1a3be7a18b8858aadd035b8a6da2f4a03b470f38" + }, + { + "path": "scripts/compare_recursive_invoices.py", + "usage": "input", + "git_blob": "fda2a852e9937e42fe40df0707694465ca7c1b48", + "sha256": "3930c22c11da7bc6042cfeb6e459ecb06e4478430037bee3469d034353855fc6" + }, + { + "path": "scripts/evaluate_recursive_power.py", + "usage": "input", + "git_blob": "ca50f8021fc3238a58fd420383f4619a8d008ace", + "sha256": "52b20f41fd0bb55fa88dccd6015af2ce358917817b9506720f3e60ce681cc3ad" + } + ] +} diff --git a/research/p104-banked-transfer-pivots/TASK.json b/research/p104-banked-transfer-pivots/TASK.json new file mode 100644 index 0000000000..eff8753936 --- /dev/null +++ b/research/p104-banked-transfer-pivots/TASK.json @@ -0,0 +1,123 @@ +{ + "schema_version": 1, + "task_id": "p104-side-correction", + "priority_revision": 8, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "original_card": { + "id": "p104-side-correction", + "question": "Can joint helper bases and a legal causal split improve the complete P104 productive/paid invoice?", + "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" + ], + "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." + ], + "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.", + "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." + }, + "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.", + "bottleneck_link": "Judge the actual current supplier contract and complete signed target/paid bill; frozen-profile ceilings require an applicability proof.", + "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." + ], + "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." + ], + "overlap_terms": [ + "P104", + "helper basis", + "helper split", + "5718", + "dyadic capacity" + ], + "existing_checks": [ + { + "scope": "PR #4133: literal-slot defect", + "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.", + "status": "author-checked", + "source_commit": "88666f1dee93fbd85b31fd5d6f91a219e111b5f4", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4136: uniform commutation gap", + "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.", + "status": "author-checked", + "source_commit": "281ce601a8be9db470de630759179c23e1dfaa88", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4140: uniform encoding gap", + "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.", + "status": "author-checked", + "source_commit": "de25c6525aa866962309df5d107b32d55e6e5628", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4153: source-chart shortcut exhausts its optimistic allowance", + "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.", + "status": "author-checked", + "source_commit": "9123241fea53df77e51ffe30d9aca1625d4bf3a8", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4154: fiber-tag seam mismatch", + "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.", + "status": "author-checked", + "source_commit": "4ffcdaee5d6255a9cea1fe53a5424435068089d0", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "Selected PR5599: complete helper-subspace construction and independent caller replay; five framework assumptions remain.", + "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.", + "status": "reviewed", + "source_commit": "09dd0965711ca7eeb169057a420abab1c9052137", + "selected_record_sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5" + } + ] + }, + "scope_status": "refined", + "actual_scope": "Replace paid crossings on the 16-call native source from PR 7669 with rational changes of sender and receiver bases. Check the complete exact-grid application.", + "scope_change_reason": "The contact search on PR 7663 did not beat its complete invoice. PR 7669 supplied a stronger open comparator during the search. The new construction retains its public interfaces and uses a new private bank program.", + "bottleneck_link": "Each pivot removes one paid recursive child. The full signed caller, physical costs and outer compiler determine the resulting exponent.", + "budget_minutes": 180, + "stop_rule": "Require a complete conditional step larger than the preceding PR 7663 increment, exact public rows, directed prices, and explicit storage, precision and compiler charges.", + "outcome": "completed", + "evidence": "PIVOTS.json gives 15 witnesses. RESULT.json records 240 fewer paid calls and a conditional saving of 0.0037260455556. PROOF.md gives the exact-grid application.", + "author": "Ali Romman", + "ai_assistance": "Substantial OpenAI Codex assistance with research, implementation, verification and writing.", + "open_questions": [ + { + "question": "Can the private snapshots share backing after their last read?", + "why_it_matters": "The direct construction reserves 15,290 private homes per native invocation.", + "first_step": "Derive last-use intervals from the verified schedule. Recheck the source, destination and full-extent reset at each reuse.", + "blocked_by": "A physical lifetime and selection proof for the smaller layout." + }, + { + "question": "Can a different crossing change the signed rank mass?", + "why_it_matters": "The fifteen pivots retain the parent rank-mass surplus. The fixed new invoice crosses below 0.00372604555572.", + "first_step": "Find one typed sender relation with a favorable rank-mass change, then check its receiver dependencies and complete invoice.", + "blocked_by": "A new arbitrary-input relation at a legal causal cut." + } + ] +} diff --git a/research/p104-banked-transfer-pivots/VERIFY.json b/research/p104-banked-transfer-pivots/VERIFY.json new file mode 100644 index 0000000000..c3bd43bea2 --- /dev/null +++ b/research/p104-banked-transfer-pivots/VERIFY.json @@ -0,0 +1,100 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/shared-wire-split-composition/frozen/clifford_exact.py", + "research/shared-wire-split-composition/frozen/native_verify.py", + "scripts/compare_recursive_invoices.py", + "scripts/evaluate_recursive_power.py" + ], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "Reconstruct the parent and candidate bills, all native and signed caller outputs, exact-grid and storage costs, directed powers and all 58 outer predicates. Reject a cycle, wrong chart and odd last tick." + }, + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/native.py" + ], + "timeout_seconds": 210, + "checks": "Verify all fifteen saved-signal identities by exact rational evaluation on independent inputs. Reject a reversed sender sign." + }, + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/catalogue.py", + "0" + ], + "timeout_seconds": 180, + "checks": "Check the signed action, absolute phase and rank for this slice of 504 chart pairs. Check every forward and adjoint column for changed slot pairs in this slice and reject an incorrect phase. Check all 104 main adapters." + }, + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/catalogue.py", + "1" + ], + "timeout_seconds": 120, + "checks": "Check the signed action, absolute phase and rank for this slice of 504 chart pairs. Check every forward and adjoint column for changed slot pairs in this slice and reject an incorrect phase." + }, + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/catalogue.py", + "2" + ], + "timeout_seconds": 120, + "checks": "Check the signed action, absolute phase and rank for this slice of 504 chart pairs. Check every forward and adjoint column for changed slot pairs in this slice and reject an incorrect phase." + }, + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/catalogue.py", + "3" + ], + "timeout_seconds": 120, + "checks": "Check the signed action, absolute phase and rank for this slice of 504 chart pairs. Check every forward and adjoint column for changed slot pairs in this slice and reject an incorrect phase." + }, + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/catalogue.py", + "4" + ], + "timeout_seconds": 120, + "checks": "Check the signed action, absolute phase and rank for this slice of 504 chart pairs. Check every forward and adjoint column for changed slot pairs in this slice and reject an incorrect phase." + }, + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/catalogue.py", + "5" + ], + "timeout_seconds": 120, + "checks": "Check the signed action, absolute phase and rank for this slice of 504 chart pairs. Check every forward and adjoint column for changed slot pairs in this slice and reject an incorrect phase." + } + ] +} diff --git a/research/p104-banked-transfer-pivots/caller.py b/research/p104-banked-transfer-pivots/caller.py new file mode 100644 index 0000000000..945c27d8c4 --- /dev/null +++ b/research/p104-banked-transfer-pivots/caller.py @@ -0,0 +1,129 @@ +"""Replay the signed caller over the Gaussian group ring and price its actual entries.""" +from collections import Counter +from fractions import Fraction +from functools import cache +from pathlib import Path +import sys + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) +from network import main_roles, need, rational + + +def divided(value, denominator): + quotient, remainder = divmod(value, denominator) + need(remainder == 0, "caller grid remainder") + return quotient + + +def caller_replay(caller, word): + stages = caller["stages"] + cs = 2025 + height = 9 + unit = cs << height + zero = (0,) * stages + rows = [{(r, 0, zero): (unit, 0)} for r in range(caller["roles"])] + peak = unit + checks = 0 + paid = Counter() + targets = Counter() + uses = Counter() + stages_seen = [] + types = caller["types"] + need(types["A"]["ports"] == word["hosted"]["Dports"] and sorted(types["A"]["ports"] + types["B"]["ports"]) == list(range(len(word["ports"]))), "port allocation") + need(9 + 8 * stages == caller["ambient_rank"] <= 153, "caller geometry") + role_sets = {name: set(range(ty["offset"], ty["offset"] + ty["roles"])) for name, ty in types.items()} + need(role_sets["A"].isdisjoint(role_sets["B"]) and role_sets["A"] | role_sets["B"] == set(range(len(rows))), "type owners") + + @cache + def shifted(exponents, shift): + exponents = list(exponents) + for k in shift: + exponents[k - 1] += 1 + return tuple(exponents) + + def term(row, ar=1, ai=0, denominator=1, phase=0, shift=()): + nonlocal peak, checks + out = {} + for (r, q, powers), (x, y) in row.items(): + u, v = ar * x - ai * y, ar * y + ai * x + if denominator != 1: + u, v = divided(u, denominator), divided(v, denominator) + checks += 1 + out[r, (q + phase) % 4, shifted(powers, shift) if shift else powers] = (u, v) + peak = max(peak, sum(abs(x) + abs(y) for x, y in out.values())) + return out + + def plus(a, b): + nonlocal peak + out = a.copy() + for k, (u, v) in b.items(): + x, y = out.get(k, (0, 0)) + if x + u or y + v: + out[k] = (x + u, y + v) + else: + out.pop(k, None) + peak = max(peak, sum(abs(x) + abs(y) for x, y in out.values())) + return out + + for event in caller["events"]: + ty = event[0] + if ty == "J": + _, stage, (x, y, u, v), (a, b, alpha, beta) = event + need(stage == len(stages_seen) + 1 and alpha == "-1" and beta == "1/2" and types["A"]["alpha2"] == "-1", "joint coefficients") + need(len({x, y, u, v}) == 4 and {x, y, u, v} <= role_sets["A"] and a != b and {a, b} <= role_sets["B"], "joint owner alias") + stages_seen.append(stage) + rows[y] = plus(rows[y], term(rows[x], phase=-1)) + rows[u] = plus(rows[u], term(rows[v], -1, phase=1)) + r, s = rows[a], rows[b] + rows[a] = plus(r, term(s, -1, phase=1)) + rows[b] = plus(term(s, denominator=2), term(r, denominator=2, phase=-1)) + for role in (x, y, u, v, a, b): + rows[role] = term(rows[role], shift=(stage,)) + continue + _, op, r, *args = event + need(r in role_sets[ty], "local caller owner") + count = len(types[ty]["ports"]) + uses[op] += count + if op in ("ADD", "SWAP", "QUERY"): + need(args[0] in role_sets[ty] and args[0] != r, "caller donor") + if op == "SWAP": + s = args[0] + rows[r], rows[s] = rows[s], rows[r] + elif op == "QUERY": + s, q = args + need(q in (-1, 1), "query sign") + rows[r] = plus(rows[r], term(rows[s], phase=q)) + paid[1] += count + elif op in ("SCALE", "ADD"): + amount = rational(args[-1]) + if op == "SCALE": + rows[r] = term(rows[r], amount.numerator, denominator=amount.denominator) + else: + rows[r] = plus(rows[r], term(rows[args[0]], amount.numerator, denominator=amount.denominator)) + elif op == "LAMBDA": + sign = args[0] + need(sign in (-1, 1), "lambda sign") + original = rows[r] + rows[r] = plus(term(original, 1, sign, 2), term(original, 1, -sign, 2, phase=2)) + else: + need(op in ("IDLE_ONE", "IDLE_ODD"), "caller operation") + block = tuple(args[0]) + need(len(set(block)) == len(block) and all(1 <= k <= stages for k in block), "idle stages") + phase = args[1] if op == "IDLE_ODD" else 0 + need(op != "IDLE_ODD" or phase in (-1, 1), "idle sign") + rows[r] = term(rows[r], phase=phase, shift=block) + paid[8 * len(block) + phase % 2] += count + need(stages_seen == list(range(1, stages + 1)), "all native calls") + for ty in types.values(): + for offset, (phase, coefficient_phase, *powers) in enumerate(ty["diagonal"]): + r = ty["offset"] + offset + need(coefficient_phase == 0 and len(powers) == stages and set(powers) <= {0, 1}, "positive root boundary") + need(rows[r] == {(r, phase % 4, tuple(powers)): (unit, 0)}, "complete signed caller endpoint") + rank = 8 * sum(powers) + phase % 2 + need(rank > 0 and any(powers), "empty root credit") + targets[rank] += len(ty["ports"]) + return dict(paid=dict(paid), targets=dict(targets), uses=dict(uses), calls=stages, + dyadic_height=height, odd_scale=cs, peak_scaled_mass=str(Fraction(peak, 2**height)), + exact_preproduct_divisions=checks, root_owners=sum(targets.values()), + fresh_helpers=stages * (word["public"] - len(main_roles(word)))) diff --git a/research/p104-banked-transfer-pivots/catalogue.py b/research/p104-banked-transfer-pivots/catalogue.py new file mode 100644 index 0000000000..3ac4634c21 --- /dev/null +++ b/research/p104-banked-transfer-pivots/catalogue.py @@ -0,0 +1,104 @@ +"""Check every native transfer, helper job and main-port adapter.""" +from collections import Counter +from functools import cache +from hashlib import sha256 +from pathlib import Path +import copy +import sys + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) +from network import encoded, main_roles, need, networks, read, source_word + +ROOT = HERE.parents[1] +sys.path.insert(0, str(ROOT / "research/shared-wire-split-composition/frozen")) +import clifford_exact as producer +import native_verify as checker + + +def span(basis): + points = {0} + for v in basis: + need(type(v) is int and 0 < v < 512 and v not in points, "independent native axes") + points |= {x ^ v for x in points} + return sum(1 << x for x in points) + + +def rank_data(word, net): + masks = [span(b) for b in word["frames"]] + dimensions = [len(b) for b in word["frames"]] + + def rank(pair): + a, b = pair + need(0 <= a < len(masks) and 0 <= b < len(masks), "frame index") + intersection = (masks[a] & masks[b]).bit_count() + need(intersection in (1 << dimensions[a], 1 << dimensions[b]) and a != b, "positive nested pair") + return abs(dimensions[a] - dimensions[b]) + + mains = main_roles(word) + helper_pairs = [(net.initial[r], net.final[r]) for r in range(len(net.initial)) if r not in mains] + return Counter(map(rank, net.moves.values())), Counter(map(rank, helper_pairs)), set(helper_pairs) + + +def verify(shard, parts=6): + word = source_word() + parent, net, _ = networks(word) + _, _, helpers = rank_data(word, net) + pairs = sorted(set(net.moves.values()) | helpers) + rerouted = {pair for node, pair in net.moves.items() if pair != parent.moves[node]} + basis = word["frames"] + + @cache + def chart(i): + return producer.canonical_frame(9, tuple(basis[i])) + + @cache + def frame(i): + return checker.frame(basis[i], 9) + + records = [] + exhaustive = [] + for a, b in pairs[shard::parts]: + recipe, _ = producer.lower_child(chart(a).adjoint().then(chart(b))) + need(recipe["rank"] == abs(len(basis[a]) - len(basis[b])) > 0, "physical rank") + actual = checker.recipe(recipe) + target = checker.adjoint(frame(a)) + frame(b) + checker.equal(actual, target, "signed Pauli action and Gaussian phase") + if (a, b) in rerouted: + for u, v in ((actual, target), (checker.adjoint(actual), checker.adjoint(target))): + for col in range(512): + need(checker.state(u, col) == checker.state(v, col), "literal Gaussian column") + exhaustive.append([a, b]) + if not records: + wrong = copy.deepcopy(recipe) + wrong["left"]["phase"] = (wrong["left"]["phase"] + 1) % 4 + bad = checker.recipe(wrong) + need(checker.tableau(bad) == checker.tableau(actual), "phase-only mutation") + try: + checker.equal(bad, target, "altered phase") + except ValueError: + pass + else: + raise ValueError("incorrect absolute phase accepted") + records.append([a, b, recipe]) + ports = 0 + if shard == 0: + for x, q in zip(word["live"], word["ports"], strict=True): + a, b = net.initial[x], net.final[x + 112] + first, _ = producer.lower_child(producer.cgate(9, q, 1).adjoint().then(chart(a))) + last, _ = producer.lower_child(chart(b).adjoint().then(producer.cgate(9, q, -1).then(producer.fourier(9)))) + need(first["rank"] == last["rank"] == 0 and not basis[net.initial[x + 112]], "main adapters") + checker.equal(checker.recipe(first), (("C", q, -1),) + frame(a), "main input phase") + checker.equal(checker.recipe(last), checker.adjoint(frame(b)) + (("C", q, -1),) + checker.fourier(9), "main output phase") + checker.equal(frame(net.final[x]), checker.fourier(9), "full main endpoint") + ports += 1 + return dict(slice=shard, total=len(pairs), checked=len(records), columns=exhaustive, + ports=ports, recipes_sha256=sha256(encoded(records)).hexdigest()) + + +if __name__ == "__main__": + shard = int(sys.argv[1]) + need(sys.flags.optimize == 0 and 0 <= shard < 6, "catalogue configuration") + result = verify(shard) + need(result == read(HERE / "RESULT.json")["catalogue"][shard], "catalogue receipt") + print("PASS_PIVOT_CATALOGUE", shard, result["checked"], len(result["columns"])) diff --git a/research/p104-banked-transfer-pivots/native.py b/research/p104-banked-transfer-pivots/native.py new file mode 100644 index 0000000000..3e09f65fe3 --- /dev/null +++ b/research/p104-banked-transfer-pivots/native.py @@ -0,0 +1,132 @@ +"""Check exact rational signals, all endpoints, and the common integer grid.""" +from fractions import Fraction +from math import lcm +from pathlib import Path +import sys + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) +from network import add_scaled, coefficients, fold, main_roles, need, pivot, read, source_word + + +def grid(net, order): + denominators = {~r: 1 for r in range(len(net.initial))} + common = 1 + for node in order: + bound = 1 + for donor, factor in net.forms[node].items(): + bound = lcm(bound, denominators[donor] * factor.denominator) + denominators[node] = bound + common = lcm(common, bound) + return common + + +def evaluate(net, requested=None): + order = net.schedule() + if requested is not None: + active = set(requested) + for k in reversed(order): + if k in active: + active.update(net.forms[k]) + order = [k for k in order if k in active] + unit = grid(net, order) + values = {~r: {r: unit} for r in range(len(net.initial))} + mass = {~r: unit for r in range(len(net.initial))} + peak = unit + work = 0 + for k in order: + row = {} + bound = 0 + for donor, factor in sorted(net.forms[k].items()): + a, b = factor.numerator, factor.denominator + bound += abs(a) * mass[donor] // b + for i, value in values[donor].items(): + quotient, remainder = divmod(a * value, b) + need(remainder == 0, "native term left the grid") + new = row.get(i, 0) + quotient + if new: + row[i] = new + else: + row.pop(i, None) + work += len(values[donor]) + peak = max(peak, bound) + values[k] = row + mass[k] = sum(map(abs, row.values())) + return unit, values, peak, work + + +def expected(word, unit): + n = word["public"] + out = [{r: unit} for r in range(n)] + hosted = word["hosted"] + a_ports = set(hosted["Dports"]) + for j, x in enumerate(word["live"]): + y = x + 112 + if j in a_ports: + out[y][x] = unit + else: + need(unit % 2 == 0, "butterfly half") + out[x][y] = -unit + out[y] = {x: unit // 2, y: unit // 2} + for x, y in zip(hosted["X2"], hosted["Y2"], strict=True): + out[x][y] = -unit + return out + + +def check_endpoints(net, word): + unit, rows, peak, terms = evaluate(net) + targets = expected(word, unit) + need([rows[net.first_output + r] for r in range(len(targets))] == targets, "native output matrix") + power = (unit & -unit).bit_length() - 1 + numerator_bits = max(abs(c.numerator).bit_length() for row in net.forms.values() for c in row.values()) + denominator_bits = max(c.denominator.bit_length() for row in net.forms.values() for c in row.values()) + return dict(grid=str(unit), odd=unit >> power, dyadic_height=power, peak_scaled_mass=str(Fraction(peak, 1 << power)), + checked_products=terms, terms=sum(map(len, net.forms.values())), slots=len(net.moves), + coefficient_bits=max(numerator_bits, denominator_bits), public=len(targets), mains=len(main_roles(word))) + + +def verify_pivot(net, edit): + combo = coefficients(edit["combination"]) + source = coefficients(edit["sender"]) + side = coefficients(edit["receiver"]) + _, values, _, _ = evaluate(net, combo.keys() | source.keys() | side.keys()) + target = {} + for m, a in combo.items(): + add_scaled(target, values[m], a) + for m, a in side.items(): + add_scaled(target, values[m], a) + got = {} + for m, a in source.items(): + add_scaled(got, values[m], a) + need(target == got, "saved signal identity") + + +def check_pivots(): + word = source_word() + net = fold(word) + edits = read(HERE / "PIVOTS.json") + checked = 0 + for i, edit in enumerate(edits): + if edit["direction"] == "transpose": + net = net.transpose() + verify_pivot(net, edit) + if i == 0: + donor, weight = edit["sender"][0] + corrupted = dict(edit, sender=[[donor, str(-Fraction(weight))], *edit["sender"][1:]]) + try: + verify_pivot(net, corrupted) + except ValueError as exc: + need(str(exc) == "saved signal identity", "sender sign control reason") + else: + raise ValueError("incorrect sender sign accepted") + checked += 1 + net = pivot(net, edit) + if edit["direction"] == "transpose": + net = net.transpose() + return checked + + +if __name__ == "__main__": + checked = check_pivots() + need(checked == read(HERE / "RESULT.json")["pivot_checks"], "pivot coverage") + print("PASS_EXACT_PIVOTS", checked) diff --git a/research/p104-banked-transfer-pivots/network.py b/research/p104-banked-transfer-pivots/network.py new file mode 100644 index 0000000000..0ebc1925c4 --- /dev/null +++ b/research/p104-banked-transfer-pivots/network.py @@ -0,0 +1,217 @@ +"""Construct the communication circuit and apply the rational pivots.""" +from dataclasses import dataclass +from fractions import Fraction +from functools import cache +from graphlib import TopologicalSorter +from hashlib import sha1, sha256 +from pathlib import Path +import gzip +import json + +HERE = Path(__file__).resolve().parent +PARENT = "ee251f6005d2a92b887c5b804bd7aac05989d278b2c9ccb3c3091b50d533b08d" + + +def need(condition, message): + if not condition: + raise ValueError(message) + + +def encoded(value): + return json.dumps(value, sort_keys=True, separators=(",", ":")).encode() + + +def read(path): + raw = path.read_bytes() + return json.loads(gzip.decompress(raw) if path.suffix == ".gz" else raw) + + +def source_word(): + for pin in read(HERE / "SOURCE-PINS.json"): + raw = (HERE / pin["file"]).read_bytes() + need(sha256(raw).hexdigest() == pin["sha256"], "source SHA-256") + need(sha1(f"blob {len(raw)}\0".encode() + raw).hexdigest() == pin["git_blob"], "source Git blob") + base = read(HERE / "source/K372-2-WORD.json.gz") + patch = read(HERE / "source/source-edits.json") + need(sha256(encoded(base)).hexdigest() == patch["source"], "source edit origin") + result = [] + cursor = 0 + for edit in patch["edits"]: + start, stop = edit["start"], edit["stop"] + need(cursor <= start <= stop <= len(base["program"]), "source edit range") + need(base["program"][start:stop] == edit["before"], "source edit preimage") + result.extend(base["program"][cursor:start]) + result.extend(edit["after"]) + cursor = stop + result.extend(base["program"][cursor:]) + word = dict(base, program=result) + need(sha256(encoded(word)).hexdigest() == patch["candidate"] == PARENT, "parent word") + return word + + +def main_roles(word): + h = word["hosted"] + return set(word["live"]) | {i + 112 for i in word["live"]} | set(h["X2"]) | set(h["Y2"]) + + +@cache +def rational(literal): + return Fraction(literal) + + +def add_scaled(row, donor, factor): + for index, value in donor.items(): + new = row.get(index, 0) + factor * value + if new: + row[index] = new + else: + row.pop(index, None) + + +@dataclass +class Network: + first_output: int + initial: list + final: list + moves: dict + forms: dict + + def schedule(self): + for node, form in self.forms.items(): + chart = self.moves[node][0] if node < self.first_output else self.final[node - self.first_output] + for donor in form: + if donor < 0: + need(0 <= ~donor < len(self.initial), "input owner") + donor_chart = self.initial[~donor] + else: + need(donor in self.moves, "missing donor") + donor_chart = self.moves[donor][1] + need(donor_chart == chart, "nonlocal scalar") + need(set(self.forms) == self.moves.keys() | set(range(self.first_output, self.first_output + len(self.final))), + "output inventory") + dependencies = {node: sorted(i for i in self.forms[node] if i >= 0) for node in sorted(self.forms)} + return list(TopologicalSorter(dependencies).static_order()) + + def transpose(self): + def reverse(node): + if node < 0: + return self.first_output + ~node + if node >= self.first_output: + return ~(node - self.first_output) + return node + + edges = {k: {} for k in self.moves} + edges.update({self.first_output + r: {} for r in range(len(self.initial))}) + for node, form in self.forms.items(): + for donor, coefficient in form.items(): + edges[reverse(donor)][reverse(node)] = coefficient + moves = {k: (b, a) for k, (a, b) in self.moves.items()} + return Network(self.first_output, self.final, self.initial, moves, edges) + + +def fold(word): + n = word["public"] + rows = [{~r: 1} for r in range(n)] + [None] * word["owned_fields"] + charts = word["initial"][:] + [None] * word["owned_fields"] + forms, moves = {}, {} + for clock, event in enumerate(word["program"]): + op, r = event[:2] + if op == "INIT": + need(r >= n and rows[r] is None, "private birth") + rows[r], charts[r] = {}, event[2] + continue + need(rows[r] is not None, "inactive register") + if op == "MOVE": + _, _, a, b, owned = event + need(charts[r] == a and owned == (r >= n), "original transfer") + moves[clock], forms[clock] = (a, b), rows[r] + rows[r], charts[r] = {clock: 1}, b + else: + need(charts[r] == event[-1], "original scalar chart") + if op == "CLEAR": + need(r >= n, "public retirement") + rows[r], charts[r] = None, None + elif op == "SCALE": + rows[r] = {k: v * rational(event[2]) for k, v in rows[r].items()} + else: + need(op == "ADD" and event[2] != r and charts[event[2]] == charts[r], "original donor") + add_scaled(rows[r], rows[event[2]], rational(event[3])) + need(charts[:n] == word["final"] and all(f is None for f in charts[n:]), "original exit") + first = len(word["program"]) + forms.update({first + r: rows[r] for r in range(n)}) + return Network(first, word["initial"], word["final"], moves, forms) + + +def coefficients(entries): + result = {k: rational(v) for k, v in entries} + need(len(entries) == len(result) and all(result.values()), "sparse coefficient list") + return result + + +def pivot(net, edit): + drop, lead = edit["remove"], edit["pivot"] + combination = coefficients(edit["combination"]) + sender = coefficients(edit["sender"]) + side = coefficients(edit["receiver"]) + need(lead in combination and drop in net.moves and lead in net.moves, "pivot slots") + _, middle = net.moves[drop] + old, destination = net.moves[lead] + uses = {m: row[drop] for m, row in net.forms.items() if drop in row} + need(old == middle and combination.keys() <= uses.keys(), "pivot combination") + need(all(net.moves.get(m) == (middle, destination) for m in uses), "shared destination") + aggregate = {} + for m, weight in combination.items(): + add_scaled(aggregate, net.forms[m], weight) + response = aggregate.get(drop, 0) + need(response, "zero pivot response") + + forms = net.forms.copy() + del forms[drop] + forms[lead] = sender + for m, weight in uses.items(): + if m != lead: + residual = net.forms[m].copy() + add_scaled(residual, aggregate, -Fraction(weight, response)) + need(drop not in residual, "uncancelled transfer") + forms[m] = residual + + combined = {lead: 1} + add_scaled(combined, side, -1) + recovered = {} + for m, weight in uses.items(): + if m == lead: + row = {k: -v / combination[lead] for k, v in combination.items() if k != lead} + else: + row = {m: 1} + add_scaled(row, combined, Fraction(weight, response)) + recovered[m] = row + for k, row in list(forms.items()): + affected = row.keys() & recovered.keys() + if affected: + new = {i: v for i, v in row.items() if i not in affected} + for i in affected: + add_scaled(new, recovered[i], row[i]) + forms[k] = new + moves = net.moves.copy() + del moves[drop] + moves[lead] = (edit["source_chart"], destination) + return Network(net.first_output, net.initial, net.final, moves, forms) + + +def networks(word): + parent = fold(word) + net = parent + receipts = [] + for edit in read(HERE / "PIVOTS.json"): + direction = edit["direction"] + need(direction in ("forward", "transpose"), "pivot direction") + if direction == "transpose": + net = net.transpose() + before = len(net.moves) + net = pivot(net, edit) + if direction == "transpose": + net = net.transpose() + net.schedule() + need(len(net.moves) == before - 1, "paid slot count") + receipts.append([direction, edit["remove"], edit["pivot"], len(net.moves)]) + return parent, net, receipts diff --git a/research/p104-banked-transfer-pivots/physical.py b/research/p104-banked-transfer-pivots/physical.py new file mode 100644 index 0000000000..2ec7f5e01b --- /dev/null +++ b/research/p104-banked-transfer-pivots/physical.py @@ -0,0 +1,95 @@ +"""Price the finite bank program and exercise its exact scalar and reset services.""" +from fractions import Fraction +from network import need + + +def scalar_bits(x, factor): + a, b = abs(factor.numerator), factor.denominator + magnitude = abs(x) + carry = 0 + bits = [] + for j in range(max(1, magnitude.bit_length()) + a.bit_length() + 1): + carry += a * ((magnitude >> j) & 1) + bits.append(carry & 1) + carry >>= 1 + need(carry == 0, "product width") + quotient = remainder = 0 + for bit in reversed(bits): + trial = 2 * remainder + bit + next_bit = int(trial >= b) + remainder = trial - next_bit * b + quotient = 2 * quotient + next_bit + need(remainder == 0, "physical grid remainder") + return -quotient if (x < 0) != (factor.numerator < 0) else quotient + + +def overwrite(guide, bank, clear): + need(guide is not bank and guide[0] == ("left", "") and guide[-1] == ("right", ""), "typed guide") + pos = 1 + steps = 1 + while guide[pos][0] == "cell": + bank[pos] = "_" if clear else guide[pos][1] + pos += 1 + steps += 1 + need(guide[pos][0] == "right", "guide terminator") + pos -= 1 + steps += 1 + while guide[pos][0] == "cell": + pos -= 1 + steps += 1 + need(pos == 0, "head return") + return steps + 1 + + +def services(factors): + cases = 0 + for factor in factors: + for k in (0, -127, -1, 1, 19, (1 << 68) + 1): + value = k * factor.denominator + need(scalar_bits(value, factor) == k * factor.numerator, "finite scalar service") + cases += 1 + try: + scalar_bits(1, Fraction(1, 2)) + except ValueError as exc: + need(str(exc) == "physical grid remainder", "odd-tick reason") + else: + raise ValueError("odd last tick escaped") + for payload in ("", "0:0|_", ("0" * 19 + ":" + "0" * 19 + "|_") * 32): + guide = [("left", "")] + [("cell", c) for c in payload] + [("right", "")] + bank = ["left guard"] + ["_" if i % 2 else "#" for i in range(len(payload))] + ["right guard"] + for clear in (False, True): + expected = "_" * len(payload) if clear else payload + need(overwrite(guide, bank, clear) == 2 * len(payload) + 3, "two-head cost") + need(bank == ["left guard", *expected, "right guard"], "guard or extent") + return cases + + +def budget(net, caller, raw, audit, paid, targets, signed): + n, k, terms = raw["public"], raw["slots"], raw["terms"] + calls, roots = audit["calls"], audit["root_owners"] + uses = audit["uses"] + factors = {Fraction(c) for row in net.forms.values() for c in row.values()} + factors.update(Fraction(e[-1]) for e in caller["events"] if e[0] != "J" and e[1] in ("SCALE", "ADD")) + for scale in (raw["odd"], audit["odd_scale"], 2): + factors.update((Fraction(scale), Fraction(1, scale), Fraction(-1, scale))) + bits = max(max(abs(c.numerator).bit_length(), c.denominator.bit_length()) for c in factors) + cases = services(factors) + conversions = 2 * (roots + calls * n) + homes = 2 * n + 2 * k + 4 + resets = calls * (2 * homes + 4 * (terms + k + n)) + scalar_count = 32 * (calls * (terms + 4 * (k + n) + 2 * n + homes) + sum(uses.values()) + conversions) + maps = (2 * sum(paid.values()) + 2 * sum(targets.values()) + 2 * calls * raw["mains"] + + 2 * (uses["IDLE_ODD"] + uses["IDLE_ONE"]) + 3 * uses["QUERY"] + uses["LAMBDA"] + uses["IDLE_ODD"]) + height = raw["dyadic_height"] + audit["dyadic_height"] + mass = Fraction(raw["peak_scaled_mass"]) * Fraction(audit["peak_scaled_mass"]) + mass_bits = ((mass.numerator + mass.denominator - 1) // mass.denominator).bit_length() + c = 2 * max(height, mass_bits) + h = int(signed["H"]) + depth = 1920 * 153**1920 * (h + 1)**2 + need((c * depth).bit_length() < h, "root exactness guard") + return dict(odd_conversions=conversions, coefficient_bits=bits, scalar_test_cases=cases, + raw_private_homes=calls * homes, homes_per_native=homes, reset_services_upper=resets, + scalar_services_upper=scalar_count, scalar_steps_per_bit_upper=2**max(20, bits + 8), + monomial_slots_upper=maps, elementary_records_upper=maps * 4 * 154**2, + dyadic_height=height, context_mass_upper=str(mass), context_mass_bits=mass_bits, + context_c=c, depth_guard_bits=(c * depth).bit_length(), H=h) diff --git a/research/p104-banked-transfer-pivots/source/7663-NOTICE b/research/p104-banked-transfer-pivots/source/7663-NOTICE new file mode 100644 index 0000000000..6ce1bc49a3 --- /dev/null +++ b/research/p104-banked-transfer-pivots/source/7663-NOTICE @@ -0,0 +1,7 @@ +Apache-2.0. Ali Romman with substantial OpenAI Codex assistance. + +The new material is the joint chart assignment, its source-bound operator and caller checks, and the fresh-cost complete-root scalar and private-bank specialization. The parent data are from Clear1nsight's PR #7660 on DreamingOfClouds' PRs #7658 and #7641 and SYLforge's PR #7637. The contributors credited in those sources retain their credit. Original notices are in source/parent-NOTICE, source/physical-NOTICE and source/word-NOTICE. + +Rohan Arun supplied the 17-stage signed caller in PR #7113. The unmodified interval gate and the exact caller data come from its pinned source. See source/caller-NOTICE and source/independent-NOTICE, and the source file inventory for all consumed bytes. The two operator engines and integer power evaluator come from the declared current-main inputs. + +Jerry Chen (CubeJerry) supplied selected PRs #7000 and #7001. The selected application and its phase, common-root, finite-cost and compiler arguments, the odd-native common-grid package, the prior typed six-Gamma reset of PR #7586 and the contributors credited in those records provided the foundations used here. PR #7661 independently derives the fixed caller residuals. PR #7662 supplies a rounded parent-clock alternative. This package uses neither implementation. diff --git a/research/p104-banked-transfer-pivots/source/7669-CREDITS.md b/research/p104-banked-transfer-pivots/source/7669-CREDITS.md new file mode 100644 index 0000000000..bbee2437f0 --- /dev/null +++ b/research/p104-banked-transfer-pivots/source/7669-CREDITS.md @@ -0,0 +1,43 @@ +# Provenance, credit and scope + +This is a cumulative contribution. Thank you to everyone who has made their constructions, exact inputs, failure cases and careful reviews available. Those contributions made this composition possible; the small increment here should not obscure the much larger body of work it rests on. We aim to leave equally inspectable material for the next researcher. + +## Direct lineage and reused methods + +- **SYLforge, #7637:** the H5B frame-restored233-CLEAR construction is the published ancestor of this research. The present K372-2 source retains its descendants rather than starting a new independent construction. [PR7637](https://github.com/CrocSwap/integer-mult-bounds/pull/7637). +- **DreamingOfClouds, #7641 and #7658:** #7641 combines20 edits over #7637. #7658 supplies the large-neighbourhood construction and its exact joint hub reconstruction: helper360/537 SWAP-NULL relabel, main176 bypass, helper236 contact re-chart, helper370 last-stay removal and helper461 first-stay removal. The source explicitly credits its #7630/#7636 relabel lineage and #7634 swap law. Our source descends from this word; those gains are not claimed as new work here. [PR7641](https://github.com/CrocSwap/integer-mult-bounds/pull/7641), [PR7658](https://github.com/CrocSwap/integer-mult-bounds/pull/7658). +- **Clear1nsight:** the contact re-chart type from #7612 and the24-bit coefficient-splitting report are part of the construction's lineage. #7626 contributed source isolation/portable materialization, and #7631/#7633 are credited by the parent lineage. #7660 separately published the role379 shortcut already present in our source; we do not count its rediscovery as another improvement. [PR7612](https://github.com/CrocSwap/integer-mult-bounds/pull/7612), [coefficient report](https://github.com/CrocSwap/integer-mult-bounds/discussions/7111#discussioncomment-19691406), [PR7660](https://github.com/CrocSwap/integer-mult-bounds/pull/7660). +- **ToikY, #7643:** the contact re-chart work is explicitly credited by #7658 alongside Clear1nsight's #7612. Its74-erasure contract and κ are not added to this candidate. No shared CI repair is copied by this PR. [PR7643](https://github.com/CrocSwap/integer-mult-bounds/pull/7643). +- **Rohan Arun, #7113:** the signed caller/accounting lineage underlies the actual16-call composition. Its original source commit is07a76c5e2738882c0cb322278e56f6cae3c9885d. We recount the literal16-call input here; we do not substitute historical17-call constants. [PR7113](https://github.com/CrocSwap/integer-mult-bounds/pull/7113). +- **Ali Romman and upstream contributors:** #7605 supplies an earlier exact protected/application checkpoint cited by the #7637 lineage. The two unmodified directed invoice comparison files are copied from canonical upstream base e54523517d0f03e58352e647c403a5af3e525a57, retaining their attribution and Apache-2.0 headers. Their arithmetic is not a full scientific acceptance gate. [PR7605](https://github.com/CrocSwap/integer-mult-bounds/pull/7605). +- **CubeJerry, Douglas Colkitt and the earlier source contributors:** the retained framework, primitive/service work and repository infrastructure form part of the inherited basis. This package does not claim that their open supplier obligations are resolved by a successful finite replay. + +## What this contribution adds + +The predecessor K372-2 supplies five EARLY edits (1188,1013,940,1141,1195, with940/1141 sharing one ADD). This construction recomputes the1517/770 bypass on that actual source and combined it with a three-field triangle repair. The new contribution is their compatible composition, exact12-block edit, final235 CLEAR witnesses and a small reproducible publication package. Substantial OpenAI Codex assistance was used for research and packaging. New work is Apache-2.0. + +Exact source canonical:3dd1199d95291ee96e6c0aeb6f55f86244a569b1d4975840bf0207e2dcf9c025. Exact candidate canonical:ee251f6005d2a92b887c5b804bd7aac05989d278b2c9ccb3c3091b50d533b08d. Byte hashes are in MANIFEST.json. The12 edit blocks specify every changed event and leave all other fields unchanged. The parent research generators are not silently imported; this publication uses the transparent exact edit as its deterministic reconstruction recipe. + +## Related work, not automatically incorporated + +Ali Romman's #7662 studies one half-ADD rounding-error propagation with CubeJerry's service contract. Nick Petalas's #7654 provides a scoped minimal-rank interpolation result used as background when assessing structural repairs. Neither is a substitute for this candidate's entire rounded caller or physical supply proof. Their actual domains and assumptions must be checked before application. [PR7662](https://github.com/CrocSwap/integer-mult-bounds/pull/7662), [PR7654](https://github.com/CrocSwap/integer-mult-bounds/pull/7654). + +At the publication checkpoint, upstream main remained e54523517d0f03e58352e647c403a5af3e525a57. Ali Romman's #7663 uses a separate17-call full-private-bank model and changed helper endpoints; Clear1nsight's #7664 concerns180erasures/17calls; #7666 charges bank selection and return without claiming a new κ. K372-4 is later, separate research with changed helper-boundary conditions. None is silently folded into ee251f60 or used to assert identical physical assumptions. This is not a claim to the greatest bound across all models. + +## Fresh versus reused evidence + +Publication replay freshly reconstructs the whole word, runs exact rows/CLEAR, recounts native/caller histograms and checks the four directed price points. Normal, optimized Python and a Git-free committed-byte export were tested. The recorded ordinary/precision/native-phase/owner evidence retains its narrower scope and original source identifiers; it is not advertised as freshly rerun. No selected record, frozen predecessor package or common verifier is changed. + +## Editorial normalization of publication labels + +The follow-up editorial commit replaces workstation labels with construction terminology. It changes no candidate, edit, certificate, invoice, numeric result, executable code or contributor attribution. The original recorded bytes remain retrievable at commit `95d476623f1468822057554475dc8badb19bfa44`. Evidence JSON field labels and descriptive scopes are normalized, not recomputed scientific results. In NATIVE-EVIDENCE-REUSE.json, `predecessor-receipt:K372-2/NATIVE-NEW.json` is a historical receipt identifier, not a packaged file path. In PRICE-SUMMARY.json, recorded command invoice arguments now use the equivalent packaged `data/INVOICE.json` path; this is a portability transcription, not the verbatim original command. The fresh replay constructs and runs its own package-relative command. MANIFEST.json authenticates the edited publication bytes. + +Evidence byte-custody mapping (original -> editorially normalized SHA-256): + +- `evidence/BUILD.json`: `4744201691120223ded62a3e0d55ea1029203f3ea996305163e7db8d9e3679a4` -> `a0bafbb3f44920ed6ac1ed3d83385f025f5bbbcf5e9c8013ab1ca55ccf23c32d`. + +- `evidence/NATIVE-EVIDENCE-REUSE.json`: `6615b8a051ac9e4d8c73b5decf8a70d2a33d14da0c4c369574dec946984aa351` -> `84bab14d5c584aa8853b8e1025b562541ac6657e458d120ec803f2bc149c3eb8`. + +- `evidence/ROLE770-BUILD.json`: `c4ee72317678791d4b801479df0af052f3a50662c11ce3f3393b2151368fc92d` -> `1c400f16efbc427c40c811a57dc656fe97c2c84f94c71529e2c5c0598b146369`. + +- `evidence/PRICE-SUMMARY.json`: `c2777382c677634f7017b68c55dbd831a40945b77057f26b738f857c17ee8759` -> `d13741fe3217a01edd0b79b40dad037e644e441fbbc300838df99c0b050a5f42`. diff --git a/research/p104-banked-transfer-pivots/source/K372-2-WORD.json.gz b/research/p104-banked-transfer-pivots/source/K372-2-WORD.json.gz new file mode 100644 index 0000000000..1273c83178 Binary files /dev/null and b/research/p104-banked-transfer-pivots/source/K372-2-WORD.json.gz differ diff --git a/research/p104-banked-transfer-pivots/source/caller.json.gz b/research/p104-banked-transfer-pivots/source/caller.json.gz new file mode 100644 index 0000000000..26a75a1ae3 Binary files /dev/null and b/research/p104-banked-transfer-pivots/source/caller.json.gz differ diff --git a/research/p104-banked-transfer-pivots/source/gate-NOTICE b/research/p104-banked-transfer-pivots/source/gate-NOTICE new file mode 100644 index 0000000000..1bc9b4da2b --- /dev/null +++ b/research/p104-banked-transfer-pivots/source/gate-NOTICE @@ -0,0 +1,13 @@ +# Attribution and source reuse + +New independent operator/invoice verification and fixed-grid interval implementation: OpenAI Codex-assisted research session, 2026-11-10. Apache-2.0. + +DreamingOfClouds supplied the #6936 native predecessor and #6937 shared-wire backup/E-free root. CubeJerry supplied #6912 caller blocks, #6980's QUERY-only caller and #6970/#6985 precision methods. Preserve Ali Romman's #5599 helper-split attribution, icekylinx's #104 odd-grid attribution and unpaidmoon's #6930 width-phase attribution in the parent construction. + +Three unchanged source files are authenticated by exact SHA256 and source commit/path in `INDEPENDENT-SOURCES.json`: + +- #6970 `independent_bounds.py`: fixed integer-grid and positive caller-transfer engine. +- #6985 `envelopes.py`: positive forward envelopes and backward covector witnesses. +- #6985 `source_binding.py`: retained helper functions for the envelope engine. + +The adapter applies only two literal helper-census substitutions in memory and records them. It does not call that adaptation an independent mathematical implementation. The new reverse native operator, formal caller ring and elementary interval engine do not import the source authors' operator or invoice checkers. diff --git a/research/p104-banked-transfer-pivots/source/interval_gate.py b/research/p104-banked-transfer-pivots/source/interval_gate.py new file mode 100644 index 0000000000..e24dc46079 --- /dev/null +++ b/research/p104-banked-transfer-pivots/source/interval_gate.py @@ -0,0 +1,128 @@ +#!/usr/bin/env python3 +"""Independent certified fixed-grid intervals (80 decimal places). +ln via 2 atanh after binary range reduction; exp(-x) via alternating +Taylor brackets. Uses only integer floor/ceiling, not Decimal transcendents. +""" +from fractions import Fraction as F +from functools import lru_cache +from pathlib import Path +import json,argparse +if not __debug__: raise RuntimeError('Run without -O; assertions are proof checks.') +B=10**80 + +def ceildiv(a,b):return -((-a)//b) +def exact(q): + q=F(q);return q.numerator*B//q.denominator,ceildiv(q.numerator*B,q.denominator) +def add(a,b):return a[0]+b[0],a[1]+b[1] +def sub(a,b):return a[0]-b[1],a[1]-b[0] +def mul(a,b): + p=[a[i]*b[j] for i in (0,1) for j in (0,1)];return min(p)//B,ceildiv(max(p),B) +def div(a,b): + assert b[0]>0 + p=[F(a[i]*B,b[j]) for i in (0,1) for j in (0,1)] + return min(p).__floor__(),max(p).__ceil__() +def smul(a,q):return mul(a,exact(q)) +def atanh_log(y): + yi=exact(y);yy=mul(yi,yi);p=yi;s=(0,0) + for j in range(100):s=add(s,smul(p,F(2,2*j+1)));p=mul(p,yy) + # 0 <= tail <= 2 y^201/[201(1-y^2)] < 3*(1/3)^201. + return s[0],s[1]+ceildiv(3*B,3**201) +@lru_cache(None) +def log(r): + assert r>=1 + k=r.bit_length()-1;y=F(r-2**k,r+2**k) + a=atanh_log(y);b=atanh_log(F(1,3));return add(a,smul(b,k)) +def expminus(x): + assert 0<=x[0]<=x[1]0 and margins[str(hi)][1]<0 and margins[str(tested)][0]>0 + target=moment(T,tested);paid=moment(P,tested) + alpha=div(paid,target) + # Tail exponent = 1-tested+1/7; argument exp may not be negative. + # r^(1-tested+1/7)=r^(1-tested)* exp(log(r)/7). + def exppos(x): + assert 0<=x[0]<=x[1]0 and gap.numerator==1;step=gap.denominator + wins=lambda j:(step*j+1)**written<2**j + l,h=1,2 + while not wins(h):l,h=h,2*h + while h-l>1: + m=(l+h)//2 + if wins(m):h=m + else:l=m + assert wins(h) and not wins(h-1) + # Monotonicity: upper derivative bound on [0, cap]. + derivative=(0,0) + for rr in T.keys()|P.keys(): + c=T.get(rr,0)-P.get(rr,0);r=int(rr) + term=mul(power(r,cap if c>=0 else 0),log(r));derivative=add(derivative,smul(term,-c)) + assert derivative[1]<0 + result=dict(claim=str(claim),tested=str(tested),raw_bracket=[str(lo),str(hi)],moment_margins={k:show(v) for k,v in margins.items()},moment_margin_float={k:value(v) for k,v in margins.items()},derivative_upper=float(F(derivative[1],B)),alpha=value(alpha),gamma=value(gamma),delta=value(delta),minimum_log_power=lp,written_log_power=written,compiler_gap=str(gap),H=str(step*h),BIT_pin=str(cap),BIT_margin=str(cap-tested)) + # Outer formulas evaluated independently after algebraically substituting + # b=k+5g,a=k+4g,q=k+3g,epsilon=1-g,beta=1-3g. + k=claim;g=gap;b=k+5*g;a=k+4*g;q=k+3*g;ep=1-g;be=1-3*g;r0=g/10;stop=layout=g + sig=1-b;tau=1-a;internal=tau+(1-stop)*max(sig-tau,0);leaf=sig+stop*(1-sig);lam=1-(q+a)/2;xi=ep*(1+q)-F(3,32)+layout;key=be+1-ep + M=[ep*q,a,1-ep+q*be,1-ep+a*be,1-ep+be,F(3,32)+xi-ep,xi+F(1,2)-ep,ep,1-(ep+be+48-128+2)] + checks=[cap-a,b-a,q,b-q,a-q,stop,1-stop,(1-stop)*b-a,1-internal-q,1-leaf-q,lam-tau,lam-sig,lam-internal,1-q-lam,1-q-leaf,ep,1-ep,xi-F(1,2),ep-xi,be,ep-be,1-be,1-(2*xi-2)-r0-be,1-(2*xi-2)-be,1-ep-r0,1-ep,r0,1-key,1-be-2*(1-ep),128-48-be,layout,ep-a,F(1,32)-b,F(2**45-7**16),F(2),2-xi,F(5),1-be,1-be,1-ep,M[2]-M[0],g,k-F('.001730970419199163702738'),1-ep,F(11,2)]+[x-k for x in M] + functional=[1-be,be*(1-F(3,1000)),128-48-ep-be-1,be*(1-F(1,250))] + assert len(checks)==54 and len(functional)==4 and min(checks+functional)>0 + result['outer']=dict(strict_count=54,functional_count=4,minimum_margin=str(min(checks+functional)),BIT_just_below_effective_rejected=(a-F(1,10**12))-a<0) + # Input-lift is only needed on [1-tested_complex,1]. A stronger BIT + # pin is irrelevant to this interval; the source's crude BIT-wide bound + # is not imported beyond its valid range. + pos={7:1,3:1,5:1};neg={9:1,4:1,1:2};d1=(0,0);curvature=(0,0) + for hist,sign in ((pos,1),(neg,-1)): + for r,c in hist.items(): + d1=add(d1,smul(log(r),sign*c*r)) + curvature=add(curvature,smul(mul(log(r),log(r)),c*r)) + lift_cap=cap if cap<=F('.00376669') else tested + assert tested<=lift_cap and F(d1[1],B)+lift_cap*F(curvature[1],B)<0 + lifts={} + for price in (claim,tested): + lift=sub(moment(pos,price),moment(neg,price));assert lift[0]>0 + assert price*(-F(d1[1],B))-price*price*F(curvature[1],B)/2>0 + lifts[str(price)]=show(lift) + result['input_lift']=dict(margins=lifts,interval_kappa_cap=str(lift_cap),derivative_upper_on_required_interval=str(F(d1[1],B)+lift_cap*F(curvature[1],B)),source_BIT_wide_crude_bound_would_be=str(F(d1[1],B)+cap*F(curvature[1],B))) + return result +if __name__=='__main__': + p=argparse.ArgumentParser();p.add_argument('audit');p.add_argument('--claim',default='.00362852408');p.add_argument('--tested',default='.00362852408007');p.add_argument('--lower',default='.00362852408398727978896072723289');p.add_argument('--upper',default='.00362852408398727978896072723290');p.add_argument('--out',required=True);p.add_argument('--bit-pin',default='.00376669');a=p.parse_args() + r=gate(json.loads(Path(a.audit).read_text())['invoice'],a.claim,a.tested,a.lower,a.upper,a.bit_pin);Path(a.out).write_text(json.dumps(r,indent=2)+'\n');print(json.dumps(r,indent=2)) diff --git a/research/p104-banked-transfer-pivots/source/parent-invoice.json b/research/p104-banked-transfer-pivots/source/parent-invoice.json new file mode 100644 index 0000000000..4cfe4f0fe9 --- /dev/null +++ b/research/p104-banked-transfer-pivots/source/parent-invoice.json @@ -0,0 +1 @@ +{"contract":{"ambient_rank":137,"boundary":"actual signed caller research candidate with 16 native calls","model":"mixed-target-unnormalized-power-v1","rank_semantics":"H_r costs r^(1-C); debit surrendered productive fields"},"paid":{"1":63776,"16":416,"2":14064,"24":416,"3":9632,"32":416,"4":3888,"40":416,"48":416,"5":5792,"56":416,"6":1392,"7":176,"8":752,"9":96},"schema":"integer-mult-recursive-invoice/v1","targets":{"1":288,"129":208,"17":416,"2":336,"25":416,"3":752,"33":416,"4":3632,"41":416,"49":416,"5":1248,"57":416,"6":704,"65":416,"7":304,"8":512,"9":10256}} \ No newline at end of file diff --git a/research/p104-banked-transfer-pivots/source/source-edits.json b/research/p104-banked-transfer-pivots/source/source-edits.json new file mode 100644 index 0000000000..23368c8750 --- /dev/null +++ b/research/p104-banked-transfer-pivots/source/source-edits.json @@ -0,0 +1,979 @@ +{ + "schema": "source-bound-exact-event-edit/v1", + "source": "3dd1199d95291ee96e6c0aeb6f55f86244a569b1d4975840bf0207e2dcf9c025", + "candidate": "ee251f6005d2a92b887c5b804bd7aac05989d278b2c9ccb3c3091b50d533b08d", + "unchanged_headers": true, + "edits": [ + { + "start": 0, + "stop": 0, + "before": [], + "after": [ + [ + "ADD", + 112, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 113, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 114, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 116, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 117, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 118, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 119, + 607, + "1/2", + 3 + ], + [ + "ADD", + 120, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 122, + 607, + "1/2", + 3 + ], + [ + "ADD", + 123, + 607, + "1/2", + 3 + ], + [ + "ADD", + 137, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 138, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 139, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 140, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 141, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 142, + 607, + "-1", + 3 + ], + [ + "ADD", + 169, + 607, + "1/2", + 3 + ], + [ + "ADD", + 170, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 171, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 172, + 607, + "-1", + 3 + ], + [ + "ADD", + 173, + 607, + "1/4", + 3 + ], + [ + "ADD", + 174, + 607, + "1/2", + 3 + ], + [ + "ADD", + 175, + 607, + "1/2", + 3 + ], + [ + "ADD", + 176, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 177, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 178, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 179, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 180, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 181, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 182, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 183, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 184, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 185, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 186, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 187, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 191, + 607, + "1/2", + 3 + ], + [ + "ADD", + 192, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 193, + 607, + "1/2", + 3 + ], + [ + "ADD", + 194, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 195, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 196, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 198, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 199, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 200, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 201, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 202, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 203, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 204, + 607, + "1/2", + 3 + ], + [ + "ADD", + 206, + 607, + "1/2", + 3 + ], + [ + "ADD", + 207, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 208, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 209, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 228, + 607, + "1/4", + 3 + ], + [ + "ADD", + 236, + 607, + "1/4", + 3 + ], + [ + "ADD", + 255, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 272, + 607, + "1/4", + 3 + ], + [ + "ADD", + 279, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 306, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 311, + 607, + "-1", + 3 + ], + [ + "ADD", + 313, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 316, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 336, + 607, + "1/4", + 3 + ], + [ + "ADD", + 347, + 607, + "1/4", + 3 + ], + [ + "ADD", + 351, + 607, + "1/4", + 3 + ], + [ + "ADD", + 436, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 437, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 438, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 439, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 522, + 607, + "1", + 3 + ], + [ + "ADD", + 530, + 607, + "1", + 3 + ], + [ + "ADD", + 536, + 607, + "1/4", + 3 + ], + [ + "ADD", + 599, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 600, + 607, + "1/4", + 3 + ], + [ + "ADD", + 609, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 611, + 607, + "1/4", + 3 + ], + [ + "ADD", + 617, + 607, + "1/4", + 3 + ], + [ + "ADD", + 625, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 627, + 607, + "1/4", + 3 + ], + [ + "ADD", + 635, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 640, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 655, + 607, + "1/4", + 3 + ], + [ + "ADD", + 697, + 607, + "-1/4", + 3 + ], + [ + "ADD", + 752, + 607, + "17/8", + 3 + ], + [ + "ADD", + 812, + 607, + "1/2", + 3 + ], + [ + "ADD", + 1079, + 607, + "1/2", + 3 + ], + [ + "ADD", + 1122, + 607, + "-1", + 3 + ], + [ + "ADD", + 1176, + 607, + "-1/4", + 3 + ], + [ + "ADD", + 1228, + 607, + "1/8", + 3 + ], + [ + "ADD", + 1233, + 607, + "1/8", + 3 + ], + [ + "ADD", + 1234, + 607, + "1/4", + 3 + ], + [ + "ADD", + 1255, + 607, + "1/4", + 3 + ], + [ + "ADD", + 1265, + 607, + "-1/2", + 3 + ], + [ + "ADD", + 1279, + 607, + "1/8", + 3 + ], + [ + "ADD", + 1331, + 607, + "-1/2", + 3 + ] + ] + }, + { + "start": 87321, + "stop": 87321, + "before": [], + "after": [ + [ + "INIT", + 1551, + 115 + ], + [ + "ADD", + 1551, + 770, + "1", + 115 + ] + ] + }, + { + "start": 96905, + "stop": 96905, + "before": [], + "after": [ + [ + "ADD", + 1279, + 1551, + "-1", + 115 + ] + ] + }, + { + "start": 96959, + "stop": 96961, + "before": [ + [ + "MOVE", + 1517, + 549, + 115, + true + ], + [ + "ADD", + 1517, + 1518, + "1/4", + 115 + ] + ], + "after": [ + [ + "MOVE", + 1517, + 549, + 593, + true + ] + ] + }, + { + "start": 96963, + "stop": 96964, + "before": [ + [ + "MOVE", + 1517, + 115, + 593, + true + ] + ], + "after": [] + }, + { + "start": 97747, + "stop": 97749, + "before": [ + [ + "MOVE", + 236, + 265, + 751, + false + ], + [ + "ADD", + 544, + 236, + "-2", + 751 + ] + ], + "after": [ + [ + "ADD", + 236, + 1000, + "1/4", + 265 + ], + [ + "ADD", + 1000, + 236, + "-2", + 265 + ], + [ + "MOVE", + 236, + 265, + 927, + false + ] + ] + }, + { + "start": 97750, + "stop": 97750, + "before": [], + "after": [ + [ + "ADD", + 544, + 1000, + "1/2", + 751 + ] + ] + }, + { + "start": 97751, + "stop": 97752, + "before": [ + [ + "ADD", + 236, + 1000, + "1/4", + 751 + ] + ], + "after": [] + }, + { + "start": 97753, + "stop": 97753, + "before": [], + "after": [ + [ + "ADD", + 544, + 236, + "-1", + 927 + ], + [ + "ADD", + 236, + 544, + "1/2", + 927 + ] + ] + }, + { + "start": 99687, + "stop": 99687, + "before": [], + "after": [ + [ + "ADD", + 614, + 1551, + "1", + 115 + ] + ] + }, + { + "start": 100116, + "stop": 100117, + "before": [ + [ + "MOVE", + 236, + 751, + 127, + false + ] + ], + "after": [ + [ + "MOVE", + 236, + 927, + 127, + false + ] + ] + }, + { + "start": 150409, + "stop": 150409, + "before": [], + "after": [ + [ + "ADD", + 278, + 770, + "1/2", + 127 + ], + [ + "ADD", + 566, + 770, + "1", + 127 + ], + [ + "ADD", + 567, + 770, + "1/2", + 127 + ], + [ + "ADD", + 612, + 770, + "1", + 127 + ], + [ + "ADD", + 613, + 770, + "1", + 127 + ], + [ + "ADD", + 614, + 770, + "1", + 127 + ], + [ + "ADD", + 1078, + 770, + "1/2", + 127 + ], + [ + "ADD", + 1204, + 770, + "-1/4", + 127 + ], + [ + "ADD", + 1259, + 770, + "-1/4", + 127 + ], + [ + "ADD", + 1280, + 770, + "1", + 127 + ], + [ + "ADD", + 1368, + 770, + "1", + 127 + ], + [ + "ADD", + 1374, + 770, + "2", + 127 + ], + [ + "SCALE", + 770, + "-1", + 127 + ], + [ + "CLEAR", + 1551, + 115 + ] + ] + } + ] +} diff --git a/research/p104-banked-transfer-pivots/verify.py b/research/p104-banked-transfer-pivots/verify.py new file mode 100644 index 0000000000..2de8722b80 --- /dev/null +++ b/research/p104-banked-transfer-pivots/verify.py @@ -0,0 +1,127 @@ +"""Verify the complete application and compare it with the published parent.""" +from collections import Counter +from fractions import Fraction +from graphlib import CycleError +from pathlib import Path +import json +import sys + +HERE = Path(__file__).resolve().parent +sys.path[:0] = [str(HERE), str(HERE / "source"), str(HERE.parents[1] / "scripts")] +from caller import caller_replay +from catalogue import rank_data +from evaluate_recursive_power import evaluate +from interval_gate import gate +from native import check_endpoints +from network import Network, need, networks, read, source_word +from physical import budget + +CLAIM = "0.0037260455556" +PROBE = "0.00372604555567" +LOWER = "0.00372604555571" +UPPER = "0.00372604555572" +BIT = "0.00376669" + + +def complete(word, net, audited): + native, helper, _ = rank_data(word, net) + calls = audited["calls"] + paid = Counter({r: calls * count for r, count in native.items()}) + target = Counter({r: calls * count for r, count in helper.items()}) + paid.update(audited["paid"]) + target.update(audited["targets"]) + return paid, target + + +def histogram(counter): + return {str(i): n for i, n in sorted(counter.items())} + + +def ownership(word, caller): + h = word["hosted"] + hosted = dict(zip(h["Dports"], zip(h["X2"], h["Y2"], strict=True), strict=True)) + geom = [] + for e in caller["events"]: + if e[0] != "J": + continue + pairs = [] + for j, x in enumerate(word["live"]): + y = x + 112 + if j in hosted: + u, v = hosted[j] + for side in ("initial", "final"): + need(word[side][u] == word[side][x] and word[side][v] == word[side][y], "second-plane chart") + pairs.extend(zip((x, y, u, v), ((j, r) for r in e[2]), strict=True)) + else: + pairs.extend(zip((x, y), ((j, r) for r in e[3][:2]), strict=True)) + need(len(pairs) == len(dict(pairs)) == len({who for _, who in pairs}) == 400, "stage owners") + geom.append(len(pairs)) + need(len(geom) == caller["stages"], "stage bindings") + return geom + + +def controls(net): + # A self-dependency and a wrong coframe must both fail before execution. + node = next(iter(net.moves)) + move = net.moves[node] + moves = net.moves.copy() + moves[node] = (move[1], move[1]) + cyclic = Network(net.first_output, net.initial, net.final, moves, dict(net.forms)) + cyclic.forms[node] = {node: 1} + try: + cyclic.schedule() + except CycleError: + pass + else: + raise ValueError("causal cycle accepted") + moves = net.moves.copy() + moves[node] = (move[1], move[1]) + try: + Network(net.first_output, net.initial, net.final, moves, net.forms).schedule() + except ValueError as exc: + need(str(exc) == "nonlocal scalar", "coframe control reason") + else: + raise ValueError("incorrect sender chart accepted") + + +def application(): + word = source_word() + parent, net, edits = networks(word) + controls(net) + caller = read(HERE / "source/caller.json.gz") + audited = caller_replay(caller, word) + owners = ownership(word, caller) + origin = read(HERE / "source/parent-invoice.json") + old_paid, old_targets = complete(word, parent, audited) + need(histogram(old_paid) == origin["paid"] and histogram(old_targets) == origin["targets"], "published parent invoice") + paid, targets = complete(word, net, audited) + need(targets == old_targets, "productive boundary") + cur = dict(origin, paid=histogram(paid), targets=histogram(targets)) + empty = dict(origin, paid={}, targets={}) + signed = gate({"P": paid, "T": targets}, CLAIM, PROBE, LOWER, UPPER, BIT) + signs = [] + for data, at, sign in ((origin, "0.0037218793483", "lower"), (origin, "0.0037218793484", "higher"), + (origin, CLAIM, "higher"), (cur, CLAIM, "lower"), (cur, PROBE, "lower"), + (cur, LOWER, "lower"), (cur, UPPER, "higher")): + result = evaluate(empty, data, 1 - Fraction(at), 256) + need(result["classification"] == "new_cost_" + sign, "independent price") + signs.append([at, sign, result["new_minus_old"]]) + norm = check_endpoints(net, word) + physical = budget(net, caller, norm, audited, paid, targets, signed) + delta = {str(i): paid[i] - old_paid[i] for i in sorted(paid.keys() | old_paid.keys()) if paid[i] != old_paid[i]} + return dict(native=norm, pivot_checks=len(edits), + application=dict(claim=CLAIM, parent_upper="0.0037218793484", invoice=cur, paid_change=delta, + parent_paid=sum(old_paid.values()), paid=sum(paid.values()), targets=sum(targets.values()), + signed_surplus=sum(r * (targets[r] - paid[r]) for r in paid.keys() | targets.keys()), + caller=audited, stage_owners=owners, pivots=edits, powers=signs, compiler=signed, + physical=physical)) + + +if __name__ == "__main__": + need(sys.flags.optimize == 0, "directed gate requires assertions") + result = application() + stored = read(HERE / "RESULT.json") + # JSON object keys are strings in the published receipt. + need(json.loads(json.dumps(result)) == {k: stored[k] for k in result}, "application receipt") + a = result["application"] + print("PASS_BANKED_APPLICATION", a["claim"], a["paid"], a["targets"])