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-certified-zero-epoch-leaf/LICENSE b/research/p104-certified-zero-epoch-leaf/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/p104-certified-zero-epoch-leaf/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-certified-zero-epoch-leaf/PARENT-NOTICE b/research/p104-certified-zero-epoch-leaf/PARENT-NOTICE new file mode 100644 index 0000000000..fe51894a1a --- /dev/null +++ b/research/p104-certified-zero-epoch-leaf/PARENT-NOTICE @@ -0,0 +1,31 @@ +Mixed paid cutoffs for the P104 ordinary BIT supplier + +Prepared for Clear1nsight with substantial OpenAI Codex assistance. The +new schedule, directed comparison, occurrence controls, and documentation +are offered under Apache-2.0. + +verify.py adapts the Apache-2.0 verifiers from Dugongue's PR #7831 +(2d1fb9c878ae1e292cb918de40fa8e4f7fa7f75e) and Rohan Arun's PR #7835 +(43007c979859fa84ccc3a3509ccacc9620d181fa). Rohan Arun submitted #7835 +through the original X request at +https://x.com/RohanArun/status/2123655584797143516. The source manifest +retains the published #7835 NOTICE. + +Retained predecessor NOTICE from the grade-14 package follows. + +Iterated returns on the P104 ordinary suppliers + +Clear1nsight prepared the successor construction, explicit witnesses and verification +with substantial OpenAI Codex assistance, including independent computational checks. +The new material is offered under Apache-2.0. + +The exact starting words and the rational and binary replay interfaces are from +Clear1nsight's PR #7781. The paid and productive scalar operations, the 48-call +complex schedule, the punctured binary supplier and the common outer application +come from Ali Romman's PR #7776. The two paid projections build on the local +quotient and terminal repair in #7774 and #7781. The binary paired caller and +finite compiler use work by DreamingOfClouds, Jerry Chen (CubeJerry), zxv and the +contributors cited in their retained sources. SYLforge, Rohan Arun, Cinna Davis, +Douglas Colkitt and other predecessors contributed the caller, physical and +analytic framework. The source-fetch helper is adapted from #7774. The immutable +source manifest identifies the public inputs and their notices. diff --git a/research/p104-certified-zero-epoch-leaf/PROOF.md b/research/p104-certified-zero-epoch-leaf/PROOF.md new file mode 100644 index 0000000000..e300d8d08c --- /dev/null +++ b/research/p104-certified-zero-epoch-leaf/PROOF.md @@ -0,0 +1,63 @@ +# Proof boundaries and checks + +## Source and computation domain + +The literal graph is the 630-owner, 39,600-instruction binary source from #8027, compressed SHA-256 `74e93daf2b7acf794ffb51f92f03f51556f68126d41ee13a8969bddb4cbe6326`. The paired 798-event caller, compressed SHA-256 `757b3523798f840bdb02028b23708c3416627a99ea09e7a3c4bcdc5cd0c7ce4b`, has 36 `LOCAL` calls and 18,906 separate productive jobs. The source archive is the exact predecessor retained by #8035, whose head is `ea776471bf8ed143a0625cf2d7532f65d15eb5f9`; #8035's overlay changes the allowed powers and pricing profiles, not the native input, instruction or bank semantics used here. The exact #8041 graph and caller are pinned in `pinned/`. Every source input may be an arbitrary whole field in the supplier's all-column contract. Address permutations, local XOR, swaps and initialization are linear on these fields. + +The installed fixed-stock profile uses `v=268` and a productive rank floor `15^268`. `PoweredWord.native` allocates every target tuple below that floor as a separate live zero owner and retires it after the complete native execution. The full tensor is far too large for literal enumeration in this control. Algebraic identities about it are proved by finite induction on its factor count; the small cases are executable checks of the actual iterator and physical source. + +## First paid tuple + +The first four caller events are root-only `ADD`, `SWAP`, `ADD`, `SWAP`; event 4 is `LOCAL` and binds its own 408 distinct helpers. Before the first graph `MOVE`, the literal tape executes only + +``` +INIT 630, chart 0 +ADD 630, 222, chart 0 +MOVE 630, chart 0 -> chart 2 +``` + +The first yielded paid label is therefore `('move', 4, 2, 630)` of rank 1. Its payload is a zero-preserving chart transform of the event-4 helper 222. The corresponding public helper has endpoint rank 8. No earlier paid action or root-only prelude reads that helper, and owner 630 is newly initialized. These statements do not require any restriction on the other inputs and hold for arbitrary field values. + +In `PoweredWord.native`, each tensor level instantiates one raw frame for every remaining productive suffix, advances every frame to the next paid label in source order, and recursively serves the set of resulting requests. For the first paid label at every level, induction selects exactly the original productive path `(helper,4,222)` in every coordinate; all intermediate operations on that path are initialization, copying, and chart routing, which preserve the zero field. The terminal original path has rank `8^v`; for floor greater than 8 it was allocated by `fresh` as a distinct zero bank. Consequently the first powered yielded job is a full zero field at every physical column, not merely a binary constant or an assumed equality of particular inputs. All 268 paid ranks equal 1, so `blocks()` emits one rank-one block per column. + +This argument is tied to the actual `PoweredWord.native`/`StrongBinarySource` prefix and its separate owned banks. A certificate based only on a matching label is insufficient for a different interpreter. The prototype stores a typed witness and checks the embedded sources and source-port lists; a production integration must also bind its runtime implementation and its bank, chart and owner contracts. + +## Where the skip would occur + +`epoch_tape.epoch` writes a chronological sequence of frame opens, `ISSUE`s, closes and `FINISH`es. `epoch_tape.run` advances the native iterator on every `ISSUE`; `FINISH` serves any unconsumed tail by calling `machine.leaf` once per remaining axis. Do not delete the `ISSUE`: it starts the required native request and keeps every source frame aligned. + +A unit with no child that borrows its first issued loan has a zero field from its `ISSUE` through its `FINISH`. The first loan is a private live source owner; the bounded prototype also rejects a loan that was borrowed or shared with another active loan. Skipping a leaf permutation of a zero field preserves the complete data state. At any deepest unit of a nonempty finite band, the child-consumed count is zero and `columns=x//denominator-1` is at least `floor-1`, hence positive. Thus at least one actually scheduled elementary leaf exists under this conditional implementation argument. The prototype's one-unit finite plan exhibits exactly one such leaf without counting a tensor tuple itself as an elementary action. + +`certified_epoch.py` keeps `ISSUE`, `CLOSE`, owner cleanup, and all other `FINISH` handling. It tracks each frame's paid ordinal and each first loan's borrowed/aliased status. This is not a drop-in patch of #8035: its certificate is a caller-supplied source binding, and the cost of its frame counters, loan flags, alias tracking, proof generation, tape operations and any physical routing must be included before claiming a complete compiler saving. It also conservatively declines the skip if the certified loan was borrowed, even if a separate proof could show it returned zero. + +The bounded fixture uses one hand-constructed unit and a source wrapper that exposes only the first block to the epoch. It still executes every subsequent real graph/caller paid block inside the same frame in its original chronological order. It uses two symbolic field positions and represents each leaf as their transposition. It does not claim to reconstruct the actual full rational chart. All 5,772 independent symbolic input bits are propagated in one run, so equality of every public output form proves equality for all inputs in that finite model. The positive input control puts nonzero data into helper 222 at floor 8, where the helper is no longer fresh; an unsafe skip then changes 109 outputs. The certificate explicitly rejects that floor. + +## Forward map and transpose + +For any given compiled execution, a skipped leaf applied to a zero bank is the identity on the full current state. By induction, all later operations, outputs, and cleanup match the old forward execution. This applies to every admitted input when the zero-source proof applies. Thus the complete linear public maps are equal, and their transposes are algebraically equal. The retained target permutation is an involution, so a correctly implemented forward service run again gives its inverse. This statement does not provide a legal literal reverse schedule for the private `CLEAR` instructions, whose dirty-bank erasures remain charged and require their inherited physical treatment. + +## Single-source family + +The census propagates unions of public input labels and a Boolean paid-taint flag. `ADD` unions the labels and ORs taint; `SWAP` exchanges both; `INIT` supplies the empty set; a `MOVE` records its state and then sets taint. The outer caller's paid `QUERY` and `IDLE_ONE` are likewise marked. This conservative analysis never uses cancellations and counts a label only if its payload has exactly one input and its entire dependency has no earlier paid action. + +The per-factor census is: + +| Target rank | Paid rank | Labels | +| ---: | ---: | ---: | +| 4 | 1 | 288 | +| 4 | 2 | 108 | +| 8 | 1 | 7,848 | +| 8 | 2 | 5,508 | +| 8 | 4 | 72 | + +All 13,824 labels use a single helper. Any tensor product of these labels depends on a single original target tuple of ranks at most 8, with no prior paid operation on the contributing path. Its target rank is at most `8^268 < 15^268`, so it begins as a fresh zero field. Its paid rank is at most `4^268 < 12^268`, so the corresponding paid tuple has exactly one block, of rank equal to the product of its factors. The dataflow conditions apply separately at each synchronized tensor level and permit unrelated field operations before the selected label. The prototype certifies only the first tuple, not the entire census family. + +At κ = `0.00389046`, write `t=1-κ`. The family's complete raw rank moment is `(8136 + 5616·2^t + 72·4^t)^268`. The price reader produces outward integer-root enclosures for the pinned target and paid histograms. Integer arithmetic checks that this family is less than `10^-300` of the full, unpruned target moment. It also checks that, after removing the entire family with no offsetting costs, the raw paid moment exceeds the full target moment by more than `10^-4` of the full target moment. The productive cutoff and paid splits only make that optimistic comparison harder. Thus this family cannot establish the trial κ; no model-wide ceiling follows from this local arithmetic. + +#8034's ordered support transport already rules out a positive raw moment at or above its pinned rate for the broader, explicitly stated rule that bills full paid tuples whenever their conservative Cartesian dependency support meets the retained target set. Each selected single-source tuple here has singleton support and misses that set. The present result does not challenge #8034, and #8034 does not by itself install this particular physical `FINISH` check or price its control overhead. + +## Existing clean versus retained helper inputs + +The graph's raw helper coordinates are separate productive jobs, not uniformly zero. With all other 267 productive factors at rank 127, `4·127^267 > 15^268`; all first-factor jobs are retained. The complete-caller constant-field witnesses use only this allowed source-service subdomain. The chart-510 one-export variants fail, and the named pair has two independent input kernel vectors. The chart-531 relay fails on a retained root input even with the event-4 helpers all zero. This does not prove those source assignments arise from particular integer operands at the public multiplication entry. + +Conversely, 186 suffix factors of rank 8 and 81 of rank 64 yield `A=2^1044` with `8A < 15^268 <= 15A`. All first-factor rank-8 and rank-4 targets are already fresh zero; 34 root roles of rank at least 15 remain productive. On their 3,774-dimensional binary constant-field subspace, the full caller replay agrees after both chart-510 local export deletions. This is a local slice observation: the stock powered interpreter synchronizes all suffixes, so it is not by itself a deleted charged tensor job. diff --git a/research/p104-certified-zero-epoch-leaf/README.md b/research/p104-certified-zero-epoch-leaf/README.md new file mode 100644 index 0000000000..85adf6dfcc --- /dev/null +++ b/research/p104-certified-zero-epoch-leaf/README.md @@ -0,0 +1,48 @@ +# A certified zero loan in the powered BIT compiler + +This is an exploratory compiler construction, **not a new κ bound**. In the pinned 268-factor, floor-15 BIT source, the first powered paid tuple is an actual rank-one block whose data is zero for every admitted input. A prototype retains the chronological `ISSUE`, generator state, private owners and normal cleanup, and skips the final leaf only when a typed first-loan certificate applies and the loan has neither been borrowed nor aliased. It is not installed in #8035's physical compiler. + +A hand-built finite one-unit epoch using the authentic powered iterator and the pinned complete 36-call graph executes 285,600 elementary leaf actions before the change and 285,599 after. All output forms match for 5,772 independent input bits, and all private owners return. This exact finite control uses a symbolic two-point address permutation and a power-1/floor-29 diagnostic, not the deployed power-268 geometry. It exposes only the first paid block to the epoch, issuing all later blocks inside that single frame in their original order. It is deliberately not a production planner replay. An unsafe control with floor 8 makes the first helper a retained input: the certificate rejects it, and forcing the skip changes 109 output owners. + +Separately, a nonconstant sparse physical control executes the real pinned projector and 36-call source at power 1 and floor 15, verifies 13,824 zero blocks, skips them, checks the first result against an independent coordinate-exchange oracle, and recovers the original inputs on the second invocation. These finite controls support the construction but do not enumerate or physically replay the astronomical 268-factor product. + +## Exact source and residuals + +The first paid label is `('move', 4, 2, 630)`: immediately before it, the graph initializes owner 630 at chart 0 and XORs into it the event-4 helper 222. Its productive target has rank 8 and its paid contact has rank 1. In a `v`-factor source the tuple consisting solely of that paid label recursively selects the original productive tuple consisting solely of helper `(4,222)`. At `v=268`, its rank is `8^268`, below `15^268`, so the actual `PoweredWord.native` constructs it with `physical.fresh`, a separate zero field. Every source-prefix operation and chart route on this dependency preserves zero; no earlier paid operation can have influenced it. The emitted tuple is one rank-one block, scaled by the current column count. + +At a deepest unit in any nonempty finite installed band, the original `ISSUE` is followed by a `FINISH` with no child consumption. The unit has at least one column. The issued zero loan is therefore an elementary-leaf opportunity. The prototype skips only a certified unborrowed, unaliased loan at `FINISH`; it keeps the `ISSUE` and every generator/owner operation. Its extra frame/loan counters, alias and borrow tracking, metadata and ordinary control-machine work are not yet priced in the installed physical model. A production implementation must bind the actual source implementation, generate and validate the certificate, propagate it through real epochs, and charge all added control and routing. The code here is a prototype and does not itself certify an arbitrary machine or generator that happens to supply the same labels. + +The complete public forward map is unchanged when the skipped loan is zero for every admitted input. Thus its linear transpose is unchanged as a mathematical operator; the original target projector is involutive, so a correctly installed forward service can be called twice for the inverse. Literal reversal of dirty private `CLEAR`s is a separate physical obligation and is not asserted. + +## Family and price + +The conservative dependency scan finds 13,824 of the 104,904 raw paid labels whose payload depends on exactly one rank-4 or rank-8 helper and has no earlier paid operation on any contributing field. Their paid ranks are 8,136 of rank 1, 5,616 of rank 2 and 72 of rank 4. Each of the `13,824^268` tuples drawn solely from these labels is sourced from an already omitted helper tuple of rank at most `8^268`. Each is one powered block because its rank is at most `4^268`, below the `12^268` cap. This is a sufficient family, not a claim of all possible zero jobs. The executable prototype implements the first tuple only. + +At κ = 0.00389046, an integer-root directed bound gives the entire family's rank moment divided by the full productive moment below `10^-300`. Even granting deletion of the entire family, retaining all productive credit and ignoring all split penalties, the paid-minus-target raw moment remains greater than `10^-4` times the target moment. This does not fund the requested trial. + +[#8034](https://github.com/CrocSwap/integer-mult-bounds/pull/8034) already covers suppression of paid tuples whose conservative Cartesian support misses retained productive tuples and proves a scoped raw moment ceiling for that model. The family here is inside that scope. The bounded epoch mechanism, owner and timing controls are presented as an implementation experiment, not as a route around that result. + +## Boundary of clean helpers + +The same physical powered source also has retained helper inputs: for 267 other factor targets of rank 127, `4·127^267 > 15^268`, so every first-factor target port is retained. On the constant-field subclass, explicit complete-caller replays show the chart-510 one-export edits fail on retained helper 266 or 254. A paired version has two independent kernel witnesses. For the #8041 chart-531 relay, even when all its first-call helpers are zero, a retained root input makes the residual nonzero and breaks the complete caller. These witnesses concern the source's arbitrary-field interface; reachability from a particular pair of top-level integer operands is not established here. + +An opposite slice already has fresh-zero helpers: 186 rank-eight and 81 rank-64 suffix targets give `8·2^1044 < 15^268 ≤ 15·2^1044`. On that slice, a constant-field symbolic replay verifies both chart-510 readouts together for 3,774 retained root bits. It does not prove a powered paid saving: the original tensor code synchronizes all suffixes at each paid label. + +## Cold replay + +With Python 3.12 and the standard library: + +```sh +python3.12 -I -B verify.py +``` + +The isolated replay authenticates the #8027 graph, the paired caller, the #8030 predecessor archive retained by #8035, and the #8041 price reader; it stages everything in a temporary directory. It runs the source-domain examples, local clean slice, single-source dependency census, toy powered scheduler, v=1 nonconstant physical control, bounded epoch and unsafe control, and directed arithmetic. The verifier does not mutate the package, submit a contribution or install the compiler. + +## Open next questions + +- Can the typed first-loan check be bound to and priced in the actual installed band compiler, with a complete physical owner and reverse-service replay? +- Can an exact partial-rank or algebraic cancellation outside the #8034 support model produce a positive whole-source gain? + +## Attribution + +Ali Romman supplied the literal paired graph and physical source; predecessor credits and the Apache-2.0 notice are retained in [PARENT-NOTICE](PARENT-NOTICE). Clear1nsight coordinated the investigation with substantial OpenAI Codex assistance. The source pins and mathematical boundaries are detailed in [PROOF.md](PROOF.md). diff --git a/research/p104-certified-zero-epoch-leaf/SOURCES.json b/research/p104-certified-zero-epoch-leaf/SOURCES.json new file mode 100644 index 0000000000..bfa2bb33b8 --- /dev/null +++ b/research/p104-certified-zero-epoch-leaf/SOURCES.json @@ -0,0 +1,50 @@ +{ + "schema_version": 1, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "graph": { + "pr": 8027, + "head": "fb9b6a7b0d27da1cf98430893a3016bf811e2aa4", + "sha256": "74e93daf2b7acf794ffb51f92f03f51556f68126d41ee13a8969bddb4cbe6326" + }, + "caller_sha256": "757b3523798f840bdb02028b23708c3416627a99ea09e7a3c4bcdc5cd0c7ce4b", + "physical_profile": { + "pr": 8035, + "head": "ea776471bf8ed143a0625cf2d7532f65d15eb5f9", + "note": "The pinned predecessor archive and physical source code are retained by this profile; the epoch prototype here is not installed in it." + }, + "predecessor": { + "pr": 8030, + "head": "6285dd829114705862e8d91facaedc1f31d3cfcb", + "archive_sha256": "769d5a05cc1373fa22ed5956af636992fcd19d7e5c1753a32033a73c358cd31c" + }, + "price_and_chart_obstructions": { + "pr": 8041, + "head": "05f6172d4d9487090fa24c75137a7c60e6fcd67e", + "price_reader_sha256": "ca650d573f605bf51a8806a772903b6775cd036dfbfe7f043eccd3e51bc9977b" + }, + "support_transport": { + "pr": 8034, + "head": "5251f24363ea1c20bd1cb10ae18ba85f54212394", + "scope": "conditional full-rank Boolean-support billing" + }, + "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/paired-query-only-bit/EFREE-CALLER.json.gz", + "usage": "provenance", + "git_blob": "f022272a8d51ede841778dec76e2bfb24b614d04", + "sha256": "757b3523798f840bdb02028b23708c3416627a99ea09e7a3c4bcdc5cd0c7ce4b" + } + ] +} diff --git a/research/p104-certified-zero-epoch-leaf/TASK.json b/research/p104-certified-zero-epoch-leaf/TASK.json new file mode 100644 index 0000000000..55e267dd8e --- /dev/null +++ b/research/p104-certified-zero-epoch-leaf/TASK.json @@ -0,0 +1,87 @@ +{ + "schema_version": 1, + "task_id": "selected-stock-envelope", + "priority_revision": 8, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "original_card": { + "id": "selected-stock-envelope", + "question": "What explicit uniform stock envelope does the actual selected stopped producer supply at one bootstrap stage?", + "starting_points": [ + "research/selected-bootstrap-stock-audit/README.md", + "research/bootstrap-cutoff-time-space-split/README.md", + "certificates/selected-result.json", + "docs/research/community-efficient1000-review.md", + "research/stock-margin-chain/README.md" + ], + "methods": [ + "Derive a source-bound reserve recurrence at the actual selected atom widths, separating parent stock from completed inner borrowing.", + "Find an exact missing implication or counterexample to a proposed selected-stage stock envelope." + ], + "acceptance_gate": "Bind every coefficient and depth factor to the selected producer and state the width domain. Compare a proved envelope with the sufficient cutoff guard; a large numerical headroom or a historical m=120 coefficient is not a selected m=73 proof.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Resolve the current selected review, separate complex/ordinary BIT/admitted BIT/outer budgets, and compare the card against live handoffs before starting. Historical ceilings require exact source/model equivalence.", + "scope": "Source-binding orientation only; not a scientific replay or all-size proof. Materialize selected inputs if this checkout is sparse." + }, + "first_experiment": "Choose one actual selected producer/stage and derive its parent reserve and depth coefficient from source. Check whether newer handoffs already cover that exact obligation. Stop with the missing implementation lemma if it cannot be bounded; do not rerun #2972 cutoff/headroom arithmetic as a new contribution.", + "bottleneck_link": "This reduces a concrete inherited implementation obligation without confusing unchanged kappa arithmetic with a completed theorem.", + "allowed_variations": [ + "One stage or one explicit reserve/depth implication.", + "An independently checked same-domain proof repair, retaining all remaining assumptions." + ], + "scope_change_triggers": [ + "Importing the historical 57604 or 252 allowance without a selected-producer binding.", + "Calling a conditional fit lemma a full outer-proof adoption.", + "Replacing an actual selected stock coefficient with cutoff comparisons or a conditional fit inequality." + ], + "overlap_terms": [ + "selected stock", + "stock envelope", + "bootstrap cutoff", + "1956", + "1965", + "1990", + "2972", + "stock-margin-chain", + "actual_stock_coefficient" + ], + "existing_checks": [ + { + "scope": "Retained stock audit identifies missing actual selected-stage coefficients; later cutoff-chain arithmetic does not supply them.", + "evidence": "docs/research/research-family-status.md#revision-6-handoffs-source-archives-awaiting-independent-validation", + "remaining": "Derive one actual reserve/depth coefficient from the selected producer.", + "status": "reviewed", + "source_commit": "836b19bfa309ceafbc8ee32a15e8c4b10dde7e11", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + } + ] + }, + "scope_status": "changed", + "scope_change_reason": "The research request asks for an actual source-bound zero-job and compiler-level optimization control rather than only a price or parity obstruction.", + "actual_scope": "Prove the first powered paid tuple has a fresh-zero source; prototype a typed unborrowed FINISH skip; replay a bounded symbolic epoch, the v=1 physical source, retained-input and unsafe-pruning controls, and the complete defined family price.", + "bottleneck_link": "Demonstrates one counted elementary-leaf saving in a bounded compiler control while identifying source binding, physical control costs, and trial economics that remain open.", + "stop_rule": "Authenticate the paired physical sources; bind the first paid prefix to the omitted target; execute a complete symbolic bounded epoch with a failing unsafe control; check a genuine nonconstant v=1 source and directed full-family arithmetic.", + "outcome": "partial", + "evidence": "README.md, PROOF.md, certified_epoch.py, bounded_epoch_control.py, physical_zero_v1.py, single_source_scan.py, economics_zero_family.py and the registered cold replay.", + "author": "Clear1nsight", + "ai_assistance": "Substantial OpenAI Codex assistance in research, proof, implementation, arithmetic and documentation.", + "open_questions": [ + { + "question": "Can the typed first-loan certificate be installed and charged in the exact band compiler while preserving every real owner and adjoint obligation?", + "why_it_matters": "A finite symbolic control does not prove the deployed physical epoch or its complete price.", + "first_step": "Bind each runtime frame to the literal PoweredWord and StrongBinarySource, pass the exact source ordinal and nonalias evidence into real ISSUE and FINISH records, and account for control and tape costs.", + "blocked_by": "No installed or priced 268-factor compiler and independent all-size replay are supplied." + }, + { + "question": "Can a physical optimization outside the #8034 full-rank support model increase the complete source price?", + "why_it_matters": "The entire verified single-source zero family is far too small for the trial and is already covered by the support-pruning ceiling.", + "first_step": "Identify a retained-support nonzero field with an exact partial-column or algebraic cancellation, then emit and price the complete changed caller.", + "blocked_by": "No such profitable all-input physical operator and paid/productive invoice is currently supplied." + } + ] +} diff --git a/research/p104-certified-zero-epoch-leaf/VERIFY.json b/research/p104-certified-zero-epoch-leaf/VERIFY.json new file mode 100644 index 0000000000..b6653925d3 --- /dev/null +++ b/research/p104-certified-zero-epoch-leaf/VERIFY.json @@ -0,0 +1,14 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [], + "commands": [ + { + "argv": ["{python}", "-I", "-B", "{package}/verify.py"], + "timeout_seconds": 240, + "checks": "Authenticate the pinned source; replay the retained-domain and paired-call counterexamples, clean-slice control, single-source census, powered scheduler control, nonconstant v=1 physical operations, bounded certified epoch and negative control, and directed raw arithmetic." + } + ] +} diff --git a/research/p104-certified-zero-epoch-leaf/bounded_epoch_control.py b/research/p104-certified-zero-epoch-leaf/bounded_epoch_control.py new file mode 100644 index 0000000000..2dd6ebbde6 --- /dev/null +++ b/research/p104-certified-zero-epoch-leaf/bounded_epoch_control.py @@ -0,0 +1,180 @@ +#!/usr/bin/env python3 +"""Bounded one-unit epoch control for the certified first-loan optimization. + +Uses the actual #8035 predecessor's PoweredWord, tag lists, pinned graph and +caller, and actual epoch_tape.Image/run stream. The 36-call source is executed +with symbolic pairs over F2 and real owner lifetimes. Address routing and each +leaf are a tiny two-point involution: this is a bounded linear-control model, +not a replay of the full ternary projector geometry. physical_zero_v1.py is a +separate nonconstant physical projector control. The finite band is explicitly +constructed by hand; it is not claimed to be an installed production plan. +""" +import json,sys +from pathlib import Path +from dataclasses import replace +from types import SimpleNamespace +HERE=Path(__file__).resolve().parent +sys.path.insert(0,str(HERE)) +from upstream import install +install() +from strong_binary import graph,caller +from tagged_sources import binary_ports +from periodic import Job,Unit,period +import epoch_tape +from certified_epoch import first_zero_certificate,run + +G=graph();C=caller();q=C['ports'];dims={int(k):x['dim'] for k,x in G['frames'].items()} +graph_sha='74e93daf2b7acf794ffb51f92f03f51556f68126d41ee13a8969bddb4cbe6326' +caller_sha='757b3523798f840bdb02028b23708c3416627a99ea09e7a3c4bcdc5cd0c7ce4b' + +class Banks: + def __init__(self):self.data={};self.next=0 + def make(self,a=0,b=0): + owner=self.next;self.next+=1;self.data[owner]=(a,b);return owner + def zero(self):return self.make() + def clone(self,owner):return self.make(*self.data[owner]) + def xor(self,a,b): + x,y=self.data[a];s,t=self.data[b];self.data[a]=(x^s,y^t) + def swap(self,a,b):self.data[a],self.data[b]=self.data[b],self.data[a] + def retire(self,owner,require_zero=False): + value=self.data.pop(owner) + if require_zero:assert value==(0,0) + +class ScalarSource: + """Exact source owner/ADD schedule; two-point physical action in leaf().""" + def __init__(self,banks):self.banks=banks + def fresh(self,exemplar,rank,tag):return Job(self.banks.zero(),tuple(range(rank))) + def retire(self,job):self.banks.retire(job.owner,require_zero=True) + def raw(self,inputs,columns): + B=self.banks;active={tag:job.owner for tag,job in inputs} + for clock,(op,*args) in enumerate(C['events']): + if op=='LOCAL': + stage,x,y=args + owners=([active['root',x,p] for p in range(q)]+ + [active['root',y,p] for p in range(q)]+ + [active['helper',clock,i] for i in range(2*q,G['public'])]) + regs=dict(enumerate(owners));chart=dict(enumerate(G['start'])) + for site,(cmd,d,*a) in enumerate(G['program']): + if cmd=='INIT':assert d not in regs;regs[d]=B.zero();chart[d]=a[0] + elif cmd=='ADD': + s,c=a;assert chart[d]==c==chart[s];B.xor(regs[d],regs[s]) + elif cmd=='SWAP': + s,=a;B.swap(regs[d],regs[s]);chart[d],chart[s]=chart[s],chart[d] + elif cmd=='CLEAR': + assert d>=G['public'] and chart.pop(d)==a[0];B.retire(regs.pop(d)) + elif cmd=='MOVE': + f,t=a;assert chart[d]==f + r=abs(dims[t]-dims[f]);yield ('move',clock,site,d),Job(regs[d],tuple(range(r*columns))) + chart[d]=t + else:raise AssertionError(cmd) + assert chart==dict(enumerate(G['final'])) and len(regs)==G['public'] + elif op=='IDLE_ONE': + x,stages=args + for p in range(q):yield (op,clock,p),Job(active['root',x,p],tuple(range(7*len(stages)*columns))) + elif op=='ADD': + x,y=args + for p in range(q):B.xor(active['root',x,p],active['root',y,p]) + elif op=='SWAP': + x,y=args + for p in range(q):B.swap(active['root',x,p],active['root',y,p]) + elif op=='QUERY': + x,y=args + for p in range(q): + source=B.clone(active['root',y,p]);yield (op,clock,p),Job(source,tuple(range(columns))) + B.xor(active['root',x,p],source);B.retire(source) + else:raise AssertionError(op) + +class Machine: + def __init__(self,word,seed): + self.word=word;self.banks=Banks();self.source=ScalarSource(self.banks);self.leaves=0;self.seed=seed + def leaf(self,job): + assert len(job.axes)==1 + a,b=self.banks.data[job.owner];self.banks.data[job.owner]=(b,a);self.leaves+=1 + def native(self,ports,columns): + # Only the first full powered block is surfaced to this deliberately + # bounded epoch. Serve all later real blocks inside the same frame and + # in their original order. With one frame and no child, this preserves + # the exact source chronology, but is not a production band schedule. + for i,(block,job) in enumerate(zip(self.word.paid_paths(),self.word.native(ports,columns,self.source),strict=True)): + if i==0: + assert block.rank==1 and block.first==0 + yield job + else: + for axis in job.axes:self.leaf(Job(job.owner,(axis,))) + def zero(self,exemplar):return Job(self.banks.zero(),exemplar.axes) + def retire_zero(self,job):self.banks.retire(job.owner,require_zero=True) + +class Planner: + def __init__(self,word): + self.n=512 + kept=[p for p,yes in word.target_paths() if yes] + paid=[next(word.paid_paths())] + self.rule=SimpleNamespace(ambient=word.ambient**word.power, + targets=tuple(p.rank for p in kept),paid=tuple(b.rank for b in paid)) + size=len(kept);unit=Unit((),1,tuple(('source',i) for i in range(size))) + forest=SimpleNamespace(layers={(): (unit,)},prefixes=frozenset({()})) + self.plan=SimpleNamespace(width=size,forest=forest,copies=1,owners_per_copy=size, + offsets=tuple(range(size)),periods=tuple(period(self.n,p.rank) for p in kept), + rounds=1,active=self.n) + self.code=epoch_tape.Image(self.rule,self.plan) + self.kept=kept + def __call__(self,n):assert n==self.n;return self.plan + def image(self,n):assert n==self.n;return self.code + +def evaluate(word,planner,mode): + machine=Machine(word,mode);axis=tuple(range(planner.n));jobs=[] + for i,port in enumerate(planner.kept): + tag=port.tag[0] + if mode=='all':a,b=1<<(2*i),1<<(2*i+1) + elif tag==('helper',4,222):a,b=1,0 + else:a,b=0,0 + jobs.append(Job(machine.banks.make(a,b),axis)) + if mode in ('all','helper-baseline'): + epoch_tape.run(planner.rule,planner.n,jobs,machine,planner=planner);stats=None + else: + if mode=='helper-unsafe':cert=None + else:cert=first_zero_certificate(word,G,C,graph_sha,caller_sha) + stats=run(planner.rule,planner.n,jobs,machine,planner=planner,certificate=cert, + unsafe_first=(mode=='helper-unsafe')) + assert len(machine.banks.data)==len(jobs) + result=[machine.banks.data[j.owner] for j in jobs] + return result,machine.leaves,stats + +raw=binary_ports(G,C) +# Floor 29 gives a valid one-factor diagnostic rule with every helper omitted. +w=replace(raw,power=1,floor=29,low_cut=12,high_cut=12);planner=Planner(w) +print('prepared certified bounded stream',len(planner.kept),planner.code.records,file=sys.stderr,flush=True) +base,base_leaves,_=evaluate(w,planner,'all') +# Same symbolic input as baseline; use a separate flag so optimized evaluation +# retains the complete independent basis rather than the negative-control seed. +def optimized_all(): + machine=Machine(w,'all');axis=tuple(range(planner.n));jobs=[] + for i,p in enumerate(planner.kept):jobs.append(Job(machine.banks.make(1<<(2*i),1<<(2*i+1)),axis)) + cert=first_zero_certificate(w,G,C,graph_sha,caller_sha) + stats=run(planner.rule,planner.n,jobs,machine,planner=planner,certificate=cert) + assert len(machine.banks.data)==len(jobs) + return [machine.banks.data[j.owner] for j in jobs],machine.leaves,stats +changed,changed_leaves,stats=optimized_all() +assert base==changed and base_leaves-changed_leaves==1 +assert stats['skipped_elementary_leaf_calls']==1 and stats['certified_first']==1 +print('certified symbolic map passed',file=sys.stderr,flush=True) +# Unsafe negative control: floor=8 retains helper 222, so certificate must fail. +wbad=replace(raw,power=1,floor=8,low_cut=12,high_cut=12) +try:first_zero_certificate(wbad,G,C,graph_sha,caller_sha) +except AssertionError:pass +else:raise AssertionError('The certificate accepted a nonzero-capable helper input') +plbad=Planner(wbad) +badbase,badbase_leaves,_=evaluate(wbad,plbad,'helper-baseline') +badchanged,bad_leaves,badstats=evaluate(wbad,plbad,'helper-unsafe') +different=[i for i,(x,y) in enumerate(zip(badbase,badchanged,strict=True)) if x!=y] +assert different and badbase_leaves-bad_leaves==1 +print(json.dumps({'certified_case':{'power':1,'floor':29,'retained_owners':len(planner.kept), + 'independent_input_bits':2*len(planner.kept),'image_records':planner.code.records, + 'baseline_leaf_actions':base_leaves,'changed_leaf_actions':changed_leaves, + 'actual_elementary_leaf_actions_saved':base_leaves-changed_leaves,'stats':stats, + 'all_public_output_forms_match':True,'all_owned_fields_returned':True}, + 'negative_control':{'power':1,'floor':8,'certificate_rejected':True, + 'baseline_leaf_actions':badbase_leaves,'unsafe_leaf_actions':bad_leaves, + 'different_output_owner_count':len(different),'different_output_indices_first_10':different[:10]}, + 'scope':'hand-constructed one-unit bounded epoch; symbolic two-point involution; physical_zero_v1.py checks genuine projector action separately'},indent=2)) +print('PASS_BOUNDED_CERTIFIED_EPOCH_AND_UNSAFE_CONTROL') diff --git a/research/p104-certified-zero-epoch-leaf/certified_epoch.py b/research/p104-certified-zero-epoch-leaf/certified_epoch.py new file mode 100644 index 0000000000..cba5709aeb --- /dev/null +++ b/research/p104-certified-zero-epoch-leaf/certified_epoch.py @@ -0,0 +1,123 @@ +"""Prototype: skip an unborrowed first zero loan at FINISH, without skipping ISSUE. + +The certificate is deliberately restricted to the first paid block in each +native frame. It assumes the pinned source's first-cut contract has been +independently established: the first cut copies helper (4,222), and applying +it in every powered factor reads the omitted (helper,4,222)^power input. +The caller must bind `word`, graph, caller and the physical source interpreter +to the authenticated implementations. Merely providing plausible metadata +for a different interpreter is NOT a certificate of that interpreter. +""" +from dataclasses import dataclass +from itertools import count +from hashlib import sha256 +from pathlib import Path +import gzip +import json +from periodic import row_axes +from epoch_tape import OPEN,ISSUE,CLOSE,FINISH,LOAN + +@dataclass(frozen=True) +class FirstZeroCertificate: + power:int + floor:int + source_tag:tuple + paid_tag:tuple + source_rank:int + paid_rank:int + source_graph_sha256:str + caller_sha256:str + + +def first_zero_certificate(word,graph,caller,graph_sha,caller_sha): + assert graph_sha=='74e93daf2b7acf794ffb51f92f03f51556f68126d41ee13a8969bddb4cbe6326' + assert caller_sha=='757b3523798f840bdb02028b23708c3416627a99ea09e7a3c4bcdc5cd0c7ce4b' + source=Path(__file__).resolve().parent/'pinned' + for name,digest,claimed in [('strong-bit.json.gz',graph_sha,graph), + ('EFREE-CALLER.json.gz',caller_sha,caller)]: + data=(source/name).read_bytes() + assert sha256(data).hexdigest()==digest + assert json.loads(gzip.decompress(data))==claimed + from tagged_sources import binary_ports + expected=binary_ports(graph,caller) + assert (word.ambient,word.targets,word.paid)==(expected.ambient,expected.targets,expected.paid) + assert caller['events'][:5]==[['ADD',0,1],['SWAP',0,1],['ADD',19,20],['SWAP',19,20],['LOCAL',1,1,0]] + assert graph['program'][:3]==[['INIT',630,0],['ADD',630,222,0],['MOVE',630,0,2]] + first_target=('helper',4,222);first_paid=('move',4,2,630) + targets=[p for p in word.targets if p.tag==first_target] + assert len(targets)==1 and targets[0].rank==8 + assert word.paid[0].tag==first_paid and word.paid[0].rank==1 + assert 8**word.power < word.floor**word.power + assert not word.target((word.targets.index(targets[0]),)*word.power).rank>=word.floor**word.power + blocks=list(word.blocks((0,)*word.power)) + assert len(blocks)==1 and blocks[0].first==0 and blocks[0].rank==1 + assert blocks[0].tags==(first_paid,)*word.power + return FirstZeroCertificate(word.power,word.floor,first_target,first_paid,8,1,graph_sha,caller_sha) + + +def run(rule,n,fields,machine,*,planner,certificate,unsafe_first=False): + """Follow epoch_tape.run exactly, except at a certified unborrowed FINISH. + + unsafe_first exists solely to demonstrate a failing negative control; use + requires explicitly passing True and no certificate. + """ + if unsafe_first: assert certificate is None + else: assert isinstance(certificate,FirstZeroCertificate) + plan=planner(n); public=tuple(fields) + if len(public)!=plan.width or len({j.owner for j in public})!=plan.width or any(len(j.axes)!=n for j in public): + raise ValueError('The carrier needs independent full input fields') + stats={'issued':0,'issued_first':0,'certified_first':0,'borrowed_certificates':0, + 'aliased_certificates':0,'skipped_elementary_leaf_calls':0,'performed_elementary_leaf_calls':0} + def finish(job,first,skip=False): + for i in range(first,len(job.axes)): + if skip: stats['skipped_elementary_leaf_calls']+=1 + else: machine.leaf(job.select((i,)));stats['performed_elementary_leaf_calls']+=1 + if plan.forest is None: + for job in public:finish(job,0) + return stats + code=planner.image(n);fields=list(public) + for _ in range(plan.copies*plan.owners_per_copy-plan.width):fields.append(machine.zero(public[0])) + frames={};ordinals={};loans={};first_loans=set();borrowed=set();aliased=set();owners={};end=object() + for iteration in range(plan.rounds): + for row in code.rows(): + op,key,*args=row + if op==OPEN: + columns,*descriptors=args;entries=iter(descriptors);ports=[] + for kind in entries: + index,size=next(entries),next(entries) + if kind==LOAN: + if index in first_loans:borrowed.add(index) + job=loans[index].select(range(size)) + else: + q=next(entries) + job=fields[index+iteration//q].select(row_axes(plan.active,size,q,iteration%q)) + ports.append(job) + frames[key]=iter(machine.native(tuple(ports),columns));ordinals[key]=0 + elif op==ISSUE: + loan,size=args;job=next(frames[key]);ordinal=ordinals[key];ordinals[key]+=1 + if len(job.axes)!=size:raise ValueError('A native cut issued the wrong rank') + loans[loan]=job;stats['issued']+=1 + if ordinal==0: + stats['issued_first']+=1 + if certificate or unsafe_first:first_loans.add(loan);stats['certified_first']+=bool(certificate) + previous=owners.setdefault(job.owner,set()) + if previous: + aliased.update(previous);aliased.add(loan) + previous.add(loan) + elif op==CLOSE: + if next(frames.pop(key),end) is not end:raise ValueError('A native cut remained after the final return') + del ordinals[key] + elif op==FINISH: + job=loans.pop(key);first=args[0] + skip=key in first_loans and key not in borrowed and key not in aliased + if key in borrowed:stats['borrowed_certificates']+=1 + if key in aliased:stats['aliased_certificates']+=1 + finish(job,first,skip) + owners[job.owner].remove(key) + if not owners[job.owner]:del owners[job.owner] + first_loans.discard(key);borrowed.discard(key);aliased.discard(key) + else:raise ValueError('The installed instruction is unknown') + if frames or loans or owners:raise ArithmeticError('The epoch left an open frame or loan') + for job in public:finish(job,plan.active) + for job in reversed(fields[len(public):]):machine.retire_zero(job) + return stats diff --git a/research/p104-certified-zero-epoch-leaf/clean_slice.py b/research/p104-certified-zero-epoch-leaf/clean_slice.py new file mode 100644 index 0000000000..46b190ffe9 --- /dev/null +++ b/research/p104-certified-zero-epoch-leaf/clean_slice.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python3 +"""A preexisting omitted-helper slice in the pinned 268-fold source. + +At one explicitly specified target suffix, 34 root roles are retained and +four rank-eight root roles and all 36 x 408 helper jobs are fresh zero. Replay the complete 36-call caller +for arbitrary binary *constant* input values in those 3,774 roots, changing +both chart-510 readouts in the first call. This is an unpriced local tape +specialization: the unchanged tensor interpreter synchronizes all suffixes and +continues to issue the complete paid job stream. +""" +import json +from pathlib import Path +import sys +sys.path.insert(0,str(Path(__file__).resolve().parent)) +import constant_nested_witness as z + +p=z.p;g=z.g;c=z.c;q=z.q;n=z.n;dims=z.dims +# Suffix: 186 copies of a concrete rank-eight helper label and 81 of a +# concrete rank-64 root label. All products use exact Python integers. +a,b=186,81 +assert a+b==267 +assert c['events'][4][0]=='LOCAL' +assert abs(dims[g['final'][266]]-dims[g['start'][266]])==8 +assert 1+7*len(c['diagonal'][1]['stages'])==64 +suffix=8**a*64**b; cut=15**268 +assert 8*suffix=cut] +assert len(retained_roles)==34 and set([0,1,19,20]) <= set(retained_roles) +assert all(abs(dims[g['final'][h]]-dims[g['start'][h]])*suffix=cut +assert all(abs(dims[g['final'][h]]-dims[g['start'][h]]) in (4,8) for h in range(222,630)) +assert all((1+7*len(x['stages']))*suffix>=cut for x in c['diagonal']) +# In each local call a and b are #8036/#8041's one-export branch names. +readouts={ + 'a':(10037,2829,2335,[2336,2344,2416,2439,2448,2451,2482,2655,2698]), + 'b':(10034,2828,2337,[2359,2362,2372,2394,2397,2408,2416,2419,2425,2431,2434,2465,2484,2518,2530,2571,2576,2584,2600,2617,2623,2626,2778]) +} +residuals={ + 'a':[266,268,274,279,291,293,316,400,401,407,413,414,421,422,425,428,434,437,445,449,452,500,501,512,513,569,570,578,579], + 'b':[254,255,258,259,276,361,365,367,393,431,442,458,459,465,472,482,497,512] +} +def graph_tape(mode): + if mode in readouts: + start,reg,donor,others=readouts[mode] + assert p[start:start+3]==[['INIT',reg,510],['ADD',reg,donor,510],['MOVE',reg,510,1]] + return list(enumerate(p[:start]))+[(None,['INIT',reg,1])]+[(None,['ADD',reg,k,1]) for k in others]+list(enumerate(p[start+3:],start+3)) + if mode=='relay': + assert p[8068:8076]==[['INIT',2326,326],['ADD',2326,1855,326],['ADD',2326,1857,326],['ADD',2326,2224,326],['MOVE',2326,326,531],['INIT',2327,326],['ADD',2327,1855,326],['MOVE',2327,326,1]] + repl={8073:['INIT',2327,531],8074:['ADD',2327,2326,531],8075:['MOVE',2327,531,1]} + return [(k,repl.get(k,row)) for k,row in enumerate(p) if k not in (8070,8071)] + assert mode=='native' + return list(enumerate(p)) +tapes={name:graph_tape(name) for name in ('native','a','b','relay')} +base_hist=Counter(abs(dims[row[3]]-dims[row[2]]) for _,row in tapes['native'] if row[0]=='MOVE') +assert all(base_hist-Counter(abs(dims[row[3]]-dims[row[2]]) for _,row in tapes[x] if row[0]=='MOVE')==Counter({1:1}) for x in ('a','b')) +relay_hist=Counter(abs(dims[row[3]]-dims[row[2]]) for _,row in tapes['relay'] if row[0]=='MOVE') +assert base_hist-relay_hist==Counter({2:1}) and relay_hist-base_hist==Counter({1:1}) + +def inner(values, mode, probe=False): + v=dict(enumerate(values)); charts=dict(enumerate(g['start'])); clears=0; relay_residual=None + for clock,(op,d,*args) in tapes[mode]: + if probe and clock==8068: + relay_residual=v[1857]^v[2224] + if op=='INIT': + assert d not in charts and d>=630; charts[d]=args[0]; v[d]=0 + elif op=='ADD': + src,site=args; assert charts[d]==site==charts[src]; v[d]^=v[src] + elif op=='SWAP': + src,=args; charts[d],charts[src]=charts[src],charts[d]; v[d],v[src]=v[src],v[d] + elif op=='MOVE': + src,dst=args; assert charts[d]==src; charts[d]=dst + # Every physical address field is constant, so this completed + # paid coordinate permutation acts as the identity on data. + elif op=='CLEAR': + assert d>=630 and charts.pop(d)==args[0]; del v[d]; clears+=1 + else: raise AssertionError(op) + assert charts==dict(enumerate(g['final'])) and set(v)==set(range(630)) and clears==3433 + return [v[i] for i in range(630)],relay_residual + +def run(mode,initial): + roots=[[0]*q for _ in range(c['roles'])] + helpers={k:[0]*(n-2*q) for k,e in enumerate(c['events']) if e[0]=='LOCAL'} + if initial[0]=='helper': helpers[initial[1]][initial[2]-2*q]=1 + else: _,role,port=initial;roots[role][port]=1 + seen=0; probe={} + for clock,(op,*args) in enumerate(c['events']): + if op=='LOCAL': + stage,x,y=args; inp=roots[x]+roots[y]+helpers[clock] + if clock==4: + probe['event_4_local_input_ones']=[i for i,v in enumerate(inp) if v] + probe['a_residual_bit']=sum(inp[i] for i in residuals['a'])%2 + probe['b_residual_bit']=sum(inp[i] for i in residuals['b'])%2 + localmode=mode if clock==4 else 'native' + out,relay=inner(inp,localmode,probe=(clock==4)) + if clock==4: probe['event_4_relay_residual_bit']=relay + roots[x]=out[:q]; roots[y]=out[q:2*q];helpers[clock]=out[2*q:] + seen+=1 + elif op in ('ADD','QUERY'): + x,y=args;roots[x]=[a^b for a,b in zip(roots[x],roots[y],strict=True)] + elif op=='SWAP': + x,y=args; roots[x],roots[y]=roots[y],roots[x] + elif op=='IDLE_ONE': + pass + else: raise AssertionError(op) + assert seen==36 + result={('root',r,i):v for r,row in enumerate(roots) for i,v in enumerate(row)} + result.update({('helper',k,i+2*q):v for k,row in helpers.items() for i,v in enumerate(row)}) + return result,probe + +def main(): + results={} + for mode,initial in [('a',('helper',4,266)),('b',('helper',4,254)),('relay',('root',0,3))]: + native,probe0=run('native',initial); changed,probe1=run(mode,initial) + assert [k for k,v in native.items() if v]==[initial] + bad=[k for k in native if native[k]!=changed[k]] + assert bad + if mode in ('a','b'): assert probe1[mode+'_residual_bit']==1 + else: assert probe1['event_4_relay_residual_bit']==1 + results[mode]={'input':initial,'event4':probe1,'output_mismatch_count':len(bad),'output_mismatches':bad} + print(json.dumps({'source_graph_sha256':'74e93daf2b7acf794ffb51f92f03f51556f68126d41ee13a8969bddb4cbe6326','caller_sha256':'757b3523798f840bdb02028b23708c3416627a99ea09e7a3c4bcdc5cd0c7ce4b','power':268,'floor':15,'selected_suffix':['root',0,0],'selected_suffix_rank':127,'repetitions':267,'all_first_factor_ports_retained':True,'minimum_target_rank_exceeds_floor':4*suffix>=cut,'threshold_bits':cut.bit_length(),'helper_rank_bits':(8*suffix).bit_length(),'root_rank_bits':(127*suffix).bit_length(),'results':results},indent=2)) + print('PASS_ACTUAL_RETAINED_CONSTANT_SUBDOMAIN_COUNTEREXAMPLES') + +if __name__=='__main__': main() diff --git a/research/p104-certified-zero-epoch-leaf/economics_zero_family.py b/research/p104-certified-zero-epoch-leaf/economics_zero_family.py new file mode 100644 index 0000000000..ee9a589c15 --- /dev/null +++ b/research/p104-certified-zero-epoch-leaf/economics_zero_family.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python3 +"""Directed arithmetic for the no-paid-taint zero-tuple family. + +Bounds use the pinned #8041 integer-root interval reader. We generously retain +all original target mass and grant deletion of every selected tensor block; +even the unsplit raw moment still fails at kappa=0.00389046. +""" +from collections import Counter +from fractions import Fraction as Q +from pathlib import Path +import sys,json +sys.path.insert(0,str(Path(__file__).resolve().parent/'pinned')) +from price_audit import BIT_TARGET,BIT_PAID,moment,UNIT,K +T=Counter(BIT_TARGET);P=Counter(BIT_PAID);S=Counter({1:8136,2:5616,4:72}) +assert sum(S.values())==13824 and sum(k*v for k,v in S.items())==19656 +power=268;t=1-K +Tlo,Thi=moment(T,t);Plo,Phi=moment(P,t);Slo,Shi=moment(S,t) +assert 14*Shi10**300 +raw_deficit=Plo**power-Thi**power-Shi**power +assert raw_deficit>0 +assert 10_000*raw_deficit>Thi**power +print(json.dumps({'kappa':str(K),'power':power, + 'family_raw_paid_rank_hist':dict(S), + 'family_tuple_count':'13824**268', + 'exact_family_moment':'(8136 + 5616*2**(1-k) + 72*4**(1-k))**268', + 'family_moment_over_unpruned_target_moment':'< 10**-300', + 'raw_paid_less_family_minus_unpruned_target_over_target':'> 1/10000', + 'scope':'generously keep all target moments, discard all identified paid tuple moments, omit all split penalties; directed integer-root enclosures'},indent=2)) +print('PASS_ZERO_FAMILY_STILL_INSUFFICIENT_AT_TRIAL') diff --git a/research/p104-certified-zero-epoch-leaf/native_scheduler_control.py b/research/p104-certified-zero-epoch-leaf/native_scheduler_control.py new file mode 100644 index 0000000000..440adc7fa5 --- /dev/null +++ b/research/p104-certified-zero-epoch-leaf/native_scheduler_control.py @@ -0,0 +1,69 @@ +#!/usr/bin/env python3 +"""Exercise the retained PoweredWord.native tensor iterator at toy power 3. + +Only the raw-source *prefix dependency* is stubbed: two inputs copy genuine +rank-8 helper tags, the third copies a rank-64 root as a positive control. +This validates the live scheduler/loan shape and demonstrates why the v=268 +family needs a zero-preservation proof; it is not an independent physical +#8035 replay and does not execute the 36-call source. +""" +import sys,json +from pathlib import Path +from itertools import product +HERE=Path(__file__).resolve().parent +sys.path.insert(0,str(HERE)) +from upstream import install +install() +from periodic import Job +from powered import Port,PoweredWord + +H0=('helper',4,222);H1=('helper',4,223);R=('root',1,0) +J0=('move',4,2,630);J1=('move',4,5,631);JR=('diagnostic-root-copy',) +targets=(Port(H0,8),Port(H1,8),Port(R,64)) +paid=(Port(J0,1),Port(J1,1),Port(JR,2)) +class Physical: + def __init__(self):self.values={};self.next=0;self.fresh_paths=[];self.raw_closes=0 + def make(self,value,axes): + i=self.next;self.next+=1;self.values[i]=value;return Job(i,tuple(range(axes))) + def fresh(self,exemplar,rank,tag): + self.fresh_paths.append(tag);return self.make(0,rank) + def retire(self,job): + assert self.values.pop(job.owner)==0 + def raw(self,inputs,columns): + assert [x[0] for x in inputs]==[H0,H1,R] + for i,p in enumerate(paid): + temp=self.make(self.values[inputs[i][1].owner],p.rank*columns) + yield p.tag,temp + self.values.pop(temp.owner) + self.raw_closes+=1 + +def check(floor): + w=PoweredWord(134,targets,paid,3,floor,12,12) + physical=Physical() + productive=[] + for port,keep in w.target_paths(): + if keep:productive.append(physical.make(1,port.rank)) + assert len(productive) in (19,27) + blocks=[] + for block,job in zip(w.paid_paths(),w.native(productive,1,physical),strict=True): + value=physical.values[job.owner] + low=all(tag in (J0,J1) for tag in block.tags) + if floor==15: + assert value==(0 if low else 1) + else: + assert value==1 + blocks.append((block,value)) + assert len(physical.values)==len(productive) + assert len(blocks)==27 + return {'floor':floor,'retained_target_paths':len(productive), + 'fresh_target_paths':len(physical.fresh_paths), + 'emitted_blocks':len(blocks), + 'selected_low_rank_blocks':sum(all(t in (J0,J1) for t in b.tags) for b,_ in blocks), + 'selected_low_rank_zero_blocks':sum(all(t in (J0,J1) for t in b.tags) and v==0 for b,v in blocks), + 'positive_control_nonzero_blocks':sum(v!=0 for _,v in blocks), + 'cleanup_all_fresh_returned_zero':True} +result=[check(15),check(8)] +assert result[0]['selected_low_rank_zero_blocks']==8 +assert result[1]['selected_low_rank_zero_blocks']==0 +print(json.dumps(result,indent=2)) +print('PASS_ACTUAL_POWERED_ITERATOR_TOY_PREFIX_CONTROL') diff --git a/research/p104-certified-zero-epoch-leaf/paired_constant_witness.py b/research/p104-certified-zero-epoch-leaf/paired_constant_witness.py new file mode 100644 index 0000000000..fb07a33c74 --- /dev/null +++ b/research/p104-certified-zero-epoch-leaf/paired_constant_witness.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python3 +"""Two explicit retained-input kernel vectors for simultaneous paired faults. + +For the all-constant data subclass, every completed native lower-factor job is +identity on its field. Recoding by invertible maps before or after the two +faults cannot make a singular full-state map invertible. This does not rule out +extra clean storage, new communication, changed target domains, or nonconstant +and redesigned schedules. +""" +import json +from pathlib import Path +import sys +sys.path.insert(0, str(Path(__file__).resolve().parent)) +from constant_nested_witness import c,g,inner,n,q,suffix,cut + +assert 4*suffix >= cut + +# Native-local kernel vectors for one-export variants, independently replayed +# through the actual complete caller below. Each set contains actual top-level +# productive tags, not local 630-row indices. +a = [('root',1,92),('root',1,99)] + [('helper',4,i) for i in (231,428,433,434,435,448,449,473,516,582)] +b = [('root',20,63)] + [('helper',5,i) for i in (222,230,362,367,368,369)] +assert not set(a)&set(b) + +def caller(changes, ones): + root=[[0]*q for _ in range(c['roles'])] + helper={k:[0]*(n-2*q) for k,e in enumerate(c['events']) if e[0]=='LOCAL'} + for kind,x,y in ones: + if kind=='root': root[x][y]^=1 + else: helper[x][y-2*q]^=1 + boundary={} + for clock,(op,*args) in enumerate(c['events']): + if op=='LOCAL': + stage,x,y=args; inp=root[x]+root[y]+helper[clock] + out,_=inner(inp,changes.get(clock,'native')) + root[x]=out[:q];root[y]=out[q:2*q];helper[clock]=out[2*q:] + if clock in changes: + boundary[clock]={'input_ones':[i for i,v in enumerate(inp) if v], + 'output_ones':[i for i,v in enumerate(out) if v]} + elif op in ('ADD','QUERY'): + x,y=args;root[x]=[u^v for u,v in zip(root[x],root[y],strict=True)] + elif op=='SWAP': + x,y=args;root[x],root[y]=root[y],root[x] + elif op=='IDLE_ONE': pass + else: raise AssertionError(op) + result={('root',r,i):v for r,row in enumerate(root) for i,v in enumerate(row)} + result.update({('helper',k,i+2*q):v for k,row in helper.items() for i,v in enumerate(row)}) + return {k for k,v in result.items() if v},boundary + +results={} +for name,ones in [('first',a),('second',b),('xor',a+b)]: + before,_=caller({},ones); after,boundary=caller({4:'a',5:'b'},ones) + assert before==set(ones) and after==set() + results[name]={'input_tags':ones,'native_nonzero_outputs':len(before), + 'changed_nonzero_outputs':len(after),'fault_boundaries':boundary} +assert len(a)==12 and len(b)==7 +print(json.dumps({'changed_local_events':{'4':'a (remove clock 10039)', + '5':'b (remove clock 10036)'}, + 'all_factors':'rank-127 suffix repeated 267; all first-factor ports retained', + 'independent_kernel_vectors':2,'results':results},indent=2)) +print('PASS_RETAINED_PAIRED_KERNELS') diff --git a/research/p104-certified-zero-epoch-leaf/physical_zero_v1.py b/research/p104-certified-zero-epoch-leaf/physical_zero_v1.py new file mode 100644 index 0000000000..125fa29a3c --- /dev/null +++ b/research/p104-certified-zero-epoch-leaf/physical_zero_v1.py @@ -0,0 +1,75 @@ +#!/usr/bin/env python3 +"""Run genuine #8035 physical 36-call source on a finite v=1 stand-in. + +Power 1 is a feasible diagnostic, NOT the installed v=268. Real native +projector matrices, ADD/SWAP/INIT/CLEAR, fresh ownership and synchronization +are used. Seed several nonconstant sparse ternary address fields in retained +root jobs. Verify every selected single-source cut is physically empty, skip +its paid call, and run twice; compare the first pass with an independent +coordinate-exchange oracle and the second with the exact initial fields. +""" +import json,sys +from pathlib import Path +from dataclasses import replace +from random import Random +HERE=Path(__file__).resolve().parent +sys.path.insert(0,str(HERE)) +from upstream import install +install() +from strong_binary import graph,caller,StrongBinarySource +from tagged_sources import binary_ports +from periodic import Job +from check_raw_delta import Sparse + +selected=json.loads((HERE/'zero_raw_labels.json').read_text()) +safe={tuple(r[0]) for r in selected} +assert len(safe)==13824 +raw=binary_ports(graph(),caller()) +word=replace(raw,power=1,floor=15,low_cut=12,high_cut=12) +assert word.paid[0].tag==('move',4,2,630) and word.paid[0].rank==1 +n=134;modulus=3 +ident=tuple(bytes(int(i==j) for i in range(n)) for j in range(n)) +banks=Sparse(ident,modulus) +source=StrongBinarySource(banks) +seeds={('root',0,0),('root',1,0),('root',19,5)} +rng=Random(5329) +prod=[];expected={};initial={} +for port,keep in word.target_paths(): + if not keep:continue + owner=banks.zero(); job=Job(owner,tuple(range(port.rank))) + prod.append(job) + if port.tag[0] in seeds: + h=bytes(rng.randrange(modulus) for _ in range(n)) + t=bytes(rng.randrange(modulus) for _ in range(n)) + label=port.tag[0] + banks.values[owner].add((label,ident,h,t)); initial[owner]=banks.values[owner].copy() + eh=bytes(t[i] if i= 0. + + Each iterative square root is rounded outward. After BITS bits, one + additional copy of the last root encloses any nonzero fractional tail. + """ + assert rank > 0 and exponent >= 0 + n, rem_n = divmod(exponent.numerator, exponent.denominator) + den = exponent.denominator + lo = hi = rank**n * UNIT + root_lo = root_hi = rank * UNIT + for _ in range(BITS): + root_lo = isqrt(root_lo * UNIT) + z = root_hi * UNIT + root_hi = isqrt(z) + if root_hi * root_hi < z: root_hi += 1 + rem_n *= 2 + if rem_n >= den: + rem_n -= den + lo = lo * root_lo // UNIT + hi = ceil_div(hi * root_hi, UNIT) + if rem_n: hi = ceil_div(hi * root_hi, UNIT) + return lo, hi + + +def moment(hist, exponent): + lo = hi = 0 + for rank, count in hist.items(): + a,b = power_bound(rank,exponent) + lo += count*a; hi += count*b + return lo,hi + + +def raw_difference(targets, paid, c): + tl,th=moment(targets,1-c); pl,ph=moment(paid,1-c) + return Q(tl-ph,UNIT),Q(th-pl,UNIT) + + +def changed(paid, m): + assert isinstance(m,int) and 0 <= m <= paid[1]//2 + p = paid.copy(); p[1] -= 2*m; p[2] += m + assert sum(r*n for r,n in p.items()) == 285600 + assert sum(p.values()) == 104904-m + return p + + +def powered_surplus(targets, paid, c, v, z, w, weight, keep): + t=1-c + tl,th=moment(targets,t); pl,ph=moment(paid,t) + gl,gh=moment(paid,t+z); p12lo,p12hi=power_bound(12,z) + ol,oh=moment(targets,t-w); klo,khi=power_bound(keep,w) + alo,ahi=Q(pl,th),Q(ph,tl) + gamlo,gamhi=Q(gl*UNIT,th*p12hi),Q(gh*UNIT,tl*p12lo) + lamlo,lamhi=Q(ol*klo,th*UNIT),Q(oh*khi,tl*UNIT) + lo = 1-ahi**v-weight*gamhi**v-lamhi**v + hi = 1-alo**v-weight*gamlo**v-lamlo**v + assert lo<=hi + return lo,hi + + +def crossing(targets, paid): + """Directed 1e-26 bracket; monotonicity is proved in README.""" + s=10**26; center=floor_frac(K*s) + lo,hi=center-10**19,center+10**19 + assert raw_difference(targets,paid,Q(lo,s))[0] > 0 + assert raw_difference(targets,paid,Q(hi,s))[1] < 0 + while hi-lo>1: + mid=(lo+hi)//2 + a,b=raw_difference(targets,paid,Q(mid,s)) + assert a>0 or b<0, 'directed grid too coarse to decide a bisection point' + if a>0: lo=mid + else: hi=mid + return enclosing_text(Q(lo,s),Q(hi,s),26) + + +def bit_debit(v, floor, c): + scale=4*(134*127)**v*floor + assert Q(1024*floor,15*(floor-2)) < 69 and 69**100 < 2**611 + return ceil_frac(Q(611,100)+c*(scale-1).bit_length()) + + +def positive_debit(): + floor=1<<15; v=128 + assert 32*floor*4 < 9*15*(floor-2) and 9**4 < 2**5*4**4 + scale=4*(153*129)**v*floor + return ceil_frac(Q(5,4)+POS_C*(scale-1).bit_length()+1) + + +def stage_prices(c, d): + prev=Q(0); result=[] + for i,h in enumerate(RANK_LOGS): + covered=c-Q(d,h) + limit=min((249*covered+prev)/250,ETA) + rate=ORDINARY if i==len(RANK_LOGS)-1 else Q(floor_frac(limit*10**18)-1,10**18) + assert prev2 and Q(101,100)*c/Z16*4**13 and 15**v>=2*12**v + assert 512*v <= min(RANK_LOGS) + assert 2**64*(v+1)*2**(28*v)<2**(512*v) + assert 872*(Q(13,4)+Q(2,512))*(512*v)<2**(512*v) + assert L>2 + + +def main(): + targets,paid=load_inputs() + # Round c upward from a readable decimal to the 2^-56 grid. + c = Q(ceil_frac(Q('0.00389046000025')*2**56),2**56) + assert K < ORDINARY < c < ETA + m0=raw_difference(targets,paid,K) + p2lo,p2hi=power_bound(2,1-K) + delta_lo,delta_hi=2-Q(p2hi,UNIT),2-Q(p2lo,UNIT) + assert m0[1]<0 and 00) + + assert bit_debit(268,1<<50,c)==21 and positive_debit()==10 + stages=stage_prices(c,21) + positive=POS_C-Q(10,M_LOG) + assert 0K+4*G and positive>K+5*G + strict,functional,pay=signed_margins(K,G,ORDINARY,positive) + assert min(*strict,*functional,pay)>0 + assert min(*signed_margins(K,G,K+4*G,positive)[0])==0 + assert signed_margins(K,G,ORDINARY,K+5*G)[2]==0 + assert min(*signed_margins(K,Q(0),ORDINARY,positive)[0])==0 + power_and_enumeration_checks(268,1<<50,c,104904-25) + out={ + 'interpretation':'m replacements of two separate rank-one paid occurrences by one rank-two paid occurrence within the whole 36-call raw word; no physical realization asserted', + 'sources':{'paired_pr_8027_head':'fb9b6a7b0d27da1cf98430893a3016bf811e2aa4', + 'profile_pr_8035_head':'ea776471bf8ed143a0625cf2d7532f65d15eb5f9', + 'graph_sha256':'74e93daf2b7acf794ffb51f92f03f51556f68126d41ee13a8969bddb4cbe6326', + 'caller_sha256':'757b3523798f840bdb02028b23708c3416627a99ea09e7a3c4bcdc5cd0c7ce4b'}, + 'kappa':str(K), 'bit_c_fraction':str(c), 'bit_c_decimal_bounds':enclosing_text(c,c,20), + 'ordinary_rate':str(ORDINARY), 'signed_gap':str(G), 'eta':str(ETA), + 'positive_paid_cap':str(positive), 'positive_paid_cap_decimal_bounds':enclosing_text(positive,positive,20), + 'ordinary_margin':str(ORDINARY-K-4*G), 'positive_margin':str(pay), + 'bit_debit':21,'positive_debit':10,'rank_logs':RANK_LOGS,'ordinary_stage_rates':[str(x[3]) for x in stages], + 'sixth_stage_headroom':str(stages[-1][2]-ORDINARY), + 'signed_gates':{'strict':len(strict),'functional':len(functional),'minimum_margin':str(min(*strict,*functional,pay)), + 'controls':'equality at either supplier gate and g=0 each fail'}, + 'raw_minimum_real_replacements_at_target_bounds':enclosing_text(*threshold,14), + 'raw_difference_at_target_bounds':{}, 'raw_crossing_bounds':{}, + 'powered_268_surplus_bounds':{}, + } + for m in (24,25,26,27,36): + p=changed(paid,m) + d=raw_difference(targets,p,K) + su=powered_surplus(targets,p,c,268,Z,W,WEIGHT,15) + out['raw_difference_at_target_bounds'][str(m)]=enclosing_text(*d,16) + out['powered_268_surplus_bounds'][str(m)]=enclosing_text(*su,18) + if m==24: assert su[1] < 0 + else: assert su[0] > Q(2,1<<50) + # Although a replacement increases the tilted split moment, certify that + # the full powered bound decreases throughout the real interval [0, 36]. + # The base debit decreases and the split debit increases with m; bounding + # both derivative magnitudes at m=36 proves the net derivative negative. + t=1-c; target_lo,target_hi=moment(targets,t) + end=changed(paid,36) + pl,_=moment(end,t); _,ph_tilt=moment(end,t+Z) + p2tlo,p2thi=power_bound(2,t) + p2zlo,p2zhi=power_bound(2,t+Z) + p12lo,_=power_bound(12,Z) + assert p2thi<2*UNIT and p2zlo>2*UNIT + alpha_end_lo=Q(pl,target_hi) + gamma_end_hi=Q(ph_tilt*UNIT,target_lo*p12lo) + base_saving_lo=Q(2*UNIT-p2thi,target_hi) + tilt_surcharge_hi=Q((p2zhi-2*UNIT)*UNIT,target_lo*p12lo) + assert base_saving_lo*alpha_end_lo**267 > WEIGHT*tilt_surcharge_hi*gamma_end_hi**267 + out['powered_268_certificate_strictly_decreases_on_m_0_to_36']=True + out['raw_crossing_bounds']={str(m):crossing(targets,changed(paid,m)) for m in (24,25)} + # At most 36 such substitutions cannot absorb even one additional rank-one + # occurrence. This control applies to the whole 36-call raw word. + extra=changed(paid,36); extra[1]+=1 + extra_bound=raw_difference(targets,extra,K) + assert extra_bound[1] < 0 + out['m36_plus_one_rank_one_raw_difference_at_target_bounds']=enclosing_text(*extra_bound,16) + pos_su=powered_surplus(POS_TARGET,POS_PAID,POS_C,128,Q(19,64),Q(23,64),Q(2),16) + assert pos_su[0] > Q(2,1<<15) + out['positive_128_surplus_bounds']=enclosing_text(*pos_su,15) + + # Arithmetic-only smaller power: this is not enabled in #8035's runtime. + small=powered_surplus(targets,changed(paid,25),c,132,Z,W,WEIGHT,15) + assert small[0] > Q(2,1<<25) and bit_debit(132,1<<25,c)==14 + smallstages=stage_prices(c,14) + power_and_enumeration_checks(132,1<<25,c,104904-25) + out['exploratory_power_132']={'floor':str(1<<25),'bit_debit':14, + 'surplus_bounds':enclosing_text(*small,18), + 'sixth_stage_headroom':str(smallstages[-1][2]-ORDINARY), + 'status':'arithmetic screen only; power 132 needs new runtime/physical/stock and supplier transfer proof'} + assert powered_surplus(targets,changed(paid,25),c,131,Z,W,WEIGHT,15)[1] < 0 + rendered=json.dumps(out,indent=2,sort_keys=True)+'\n' + if len(sys.argv)==2: Path(sys.argv[1]).write_text(rendered) + else: print(rendered,end='') + print('PASS_HYPOTHETICAL_PRICE_BOUNDARY_24_25; NO_REWRITE_OR_THEOREM_CLAIMED') + +if __name__=='__main__': main() diff --git a/research/p104-certified-zero-epoch-leaf/pinned/strong-bit.json.gz b/research/p104-certified-zero-epoch-leaf/pinned/strong-bit.json.gz new file mode 100644 index 0000000000..16f8cafb1c Binary files /dev/null and b/research/p104-certified-zero-epoch-leaf/pinned/strong-bit.json.gz differ diff --git a/research/p104-certified-zero-epoch-leaf/predecessor-8030.tar.gz b/research/p104-certified-zero-epoch-leaf/predecessor-8030.tar.gz new file mode 100644 index 0000000000..e00a6bfe83 Binary files /dev/null and b/research/p104-certified-zero-epoch-leaf/predecessor-8030.tar.gz differ diff --git a/research/p104-certified-zero-epoch-leaf/single_source_scan.py b/research/p104-certified-zero-epoch-leaf/single_source_scan.py new file mode 100644 index 0000000000..7dec8407bc --- /dev/null +++ b/research/p104-certified-zero-epoch-leaf/single_source_scan.py @@ -0,0 +1,103 @@ +#!/usr/bin/env python3 +"""Conservative first-source unpaid-prefix family for the pinned raw source. + +Value dependencies are unions, never cancellations. A paid-taint boolean is +ORed through each local operation and set after any paid operation, so selected +payloads have exactly one original public input and no prior paid operation on +any contributing field. All chart checks are from the pinned native replay. +""" +from collections import Counter +import hashlib,json +from pathlib import Path +import sys +sys.path.insert(0,str(Path(__file__).resolve().parent)) +import constant_nested_witness as z +from math import log10 + +c,g,q,n=z.c,z.g,z.q,z.n; dims=z.dims +roots=[[1<<(r*q+p) for p in range(q)] for r in range(c['roles'])] +taint=[[False]*q for _ in range(c['roles'])] +tags=[('root',r,p) for r in range(c['roles']) for p in range(q)] +ranks=[1+7*len(c['diagonal'][r]['stages']) for r in range(c['roles']) for _ in range(q)] +candidates=[]; paid_count=0; allpaid=[]; call_count=0 + +def record(tag,paidrank,dep,risk): + global paid_count + if dep and not dep&(dep-1) and not risk: + i=dep.bit_length()-1 + candidates.append((tag,paidrank,tags[i],ranks[i])) + allpaid.append((tag,paidrank)); paid_count+=1 + +for clock,(op,*args) in enumerate(c['events']): + if op=='LOCAL': + stage,x,y=args + v=dict(enumerate(roots[x]+roots[y])); t=dict(enumerate(taint[x]+taint[y])) + for h in range(2*q,n): + i=len(tags);tags.append(('helper',clock,h)) + rank=abs(dims[g['final'][h]]-dims[g['start'][h]]) + ranks.append(rank);v[h]=1<0 +# At c=0, all emitted ranks <=12^268 and need no paid splitting. This is the +# exact maximal rank sum for the *defined no-paid-taint single-source family*, +# not a maximality claim over all zero jobs. +rankmass=sum(r[1] for r in selected)**P-sum(r[1] for r in equal)**P +print(json.dumps({'source_graph_sha256':'74e93daf2b7acf794ffb51f92f03f51556f68126d41ee13a8969bddb4cbe6326', + 'source_caller_sha256':'757b3523798f840bdb02028b23708c3416627a99ea09e7a3c4bcdc5cd0c7ce4b', + 'productive_ports':len(tags),'paid_labels':len(allpaid),'no_paid_taint_single_source_total':len(candidates), + 'all_single_source_hist':[{'target_rank':a,'paid_rank':b,'target_kind':k,'count':v} for (a,b,k),v in sorted(counts_all.items())], + 'selected_target_rank_le15_paid_rank_le12':len(selected), + 'selected_target_rank_lt15':len(strict),'selected_target_rank_eq15':len(equal), + 'selected_hist':[{'target_rank':a,'paid_rank':b,'target_kind':k,'count':v} for (a,b,k),v in sorted(counts.items())], + 'selected_first_examples':selected[:20], + 'first_paid_label':allpaid[0], 'factor_power':P,'floor':15, + 'exact_zero_tuple_count_expression':f'{len(selected)}**{P} - {len(equal)}**{P}', + 'exact_zero_tuple_count_digits':len(str(family)), + 'exact_total_unpowered_rank_expression':f'{sum(r[1] for r in selected)}**{P} - {sum(r[1] for r in equal)}**{P}', + 'exact_rank_sum_digits':len(str(rankmass)), + 'zero_tuple_count_over_all_paid_tuple_bound_log10':P*log10(len(selected)/paid_count), + 'scope':'conservative no-prior-paid-path dataflow; no maximality among other zero jobs; single paid block per selected tuple'},indent=2)) +print('PASS_NO_PAID_TAINT_SINGLE_SOURCE_SCAN') diff --git a/research/p104-certified-zero-epoch-leaf/verify.py b/research/p104-certified-zero-epoch-leaf/verify.py new file mode 100644 index 0000000000..a4c2afd6cc --- /dev/null +++ b/research/p104-certified-zero-epoch-leaf/verify.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +"""Cold replay of the source-bound, exploratory zero-loan controls.""" +from pathlib import Path +from tempfile import TemporaryDirectory +from hashlib import sha256 +import os,shutil,subprocess,sys,tarfile + +HERE=Path(__file__).resolve().parent +ARCHIVE='predecessor-8030.tar.gz' +PINS={ARCHIVE:'769d5a05cc1373fa22ed5956af636992fcd19d7e5c1753a32033a73c358cd31c', + 'pinned/strong-bit.json.gz':'74e93daf2b7acf794ffb51f92f03f51556f68126d41ee13a8969bddb4cbe6326', + 'pinned/EFREE-CALLER.json.gz':'757b3523798f840bdb02028b23708c3416627a99ea09e7a3c4bcdc5cd0c7ce4b', + 'pinned/price_audit.py':'ca650d573f605bf51a8806a772903b6775cd036dfbfe7f043eccd3e51bc9977b'} +for name,digest in PINS.items(): + if sha256((HERE/name).read_bytes()).hexdigest()!=digest:raise ValueError('Pinned input differs: '+name) +checks=[ + ('constant_nested_witness.py','PASS_ACTUAL_RETAINED_CONSTANT_SUBDOMAIN_COUNTEREXAMPLES'), + ('paired_constant_witness.py','PASS_RETAINED_PAIRED_KERNELS'), + ('clean_slice.py','PASS_PREEXISTING_CLEAN_ROOT_SLICE_LOCAL_ONLY'), + ('single_source_scan.py','PASS_NO_PAID_TAINT_SINGLE_SOURCE_SCAN'), + ('native_scheduler_control.py','PASS_ACTUAL_POWERED_ITERATOR_TOY_PREFIX_CONTROL'), + ('physical_zero_v1.py','PASS_PHYSICAL_V1_ZERO_SKIP_AND_INVOLUTION'), + ('bounded_epoch_control.py','PASS_BOUNDED_CERTIFIED_EPOCH_AND_UNSAFE_CONTROL'), + ('economics_zero_family.py','PASS_ZERO_FAMILY_STILL_INSUFFICIENT_AT_TRIAL'), +] +with TemporaryDirectory(prefix='zero-epoch-cold-') as temporary: + root=Path(temporary) + with tarfile.open(HERE/ARCHIVE,'r:gz') as packet: + for member in packet: + path=Path(member.name) + if path.is_absolute() or '..' in path.parts or not member.isfile(): + raise ValueError('Unexpected predecessor archive member') + dest=root/path;dest.parent.mkdir(parents=True,exist_ok=True) + with packet.extractfile(member) as inp, dest.open('wb') as out:shutil.copyfileobj(inp,out) + for path in HERE.glob('*.py'): + if path.name!='verify.py':shutil.copy2(path,root/path.name) + shutil.copytree(HERE/'pinned',root/'pinned') + for script,marker in checks: + completed=subprocess.run([sys.executable,'-I','-B',str(root/script)],cwd=root, + capture_output=True,text=True,timeout=180) + if completed.returncode or marker not in completed.stdout: + print(completed.stdout);print(completed.stderr,file=sys.stderr) + raise RuntimeError('Failed check '+script) + print(marker,flush=True) +print('PASS_CERTIFIED_ZERO_EPOCH_EXPLORATORY_COLD_REPLAY')