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-single-export-parity/CARRIER-INVARIANT.json b/research/p104-single-export-parity/CARRIER-INVARIANT.json new file mode 100644 index 0000000000..5b681de945 --- /dev/null +++ b/research/p104-single-export-parity/CARRIER-INVARIANT.json @@ -0,0 +1,341 @@ +{ + "omit_a": { + "affected_output_support": [ + 92, + 99, + 231, + 428, + 433, + 434, + 435, + 448, + 449, + 473, + 516, + 582 + ], + "baseline_controls_with_nonzero_noise_pairing": [ + 361, + 369, + 372, + 379, + 387, + 391, + 433, + 444, + 451, + 474, + 482, + 485, + 577, + 585, + 588, + 594, + 602, + 605, + 795, + 803, + 806, + 1490, + 1498, + 1501, + 1504, + 1511, + 1518, + 1558, + 1565, + 1572, + 1593, + 1600, + 1607, + 1610, + 1613, + 1617, + 1621, + 1678, + 1683, + 1687, + 1691, + 1715, + 1723, + 1730, + 1736, + 1744, + 1747, + 1787, + 1798, + 1805, + 1811, + 1819, + 1822, + 1881, + 1889, + 1893, + 1916, + 1924, + 1927, + 1947, + 1954, + 1961, + 2541, + 2546, + 2556, + 2561, + 2613, + 2721, + 2729, + 2736, + 2741, + 2787, + 3192, + 3564, + 3567, + 3572, + 3582, + 3587, + 3702, + 3710, + 3717, + 3725, + 3771, + 4104, + 4116, + 4134, + 4254, + 4269, + 4311, + 4560, + 4566, + 4800, + 5014, + 5257, + 5263, + 5516, + 5743, + 5763, + 8105, + 8108, + 8139, + 8414, + 8505, + 8541, + 8553, + 8675, + 9350, + 9520, + 10039 + ], + "formal_noise_columns": 2802, + "formal_noise_left_parity": 0, + "formal_noise_output_rank": 629, + "missing_native_move": 10039, + "nonzero_clears_on_arbitrary_inputs": 3433, + "oracle_control": { + "before_native_clock": 29847, + "chart": 1, + "owner": 2829, + "recovers_rows": 630 + }, + "ordinary_chart1_history_rank": 504, + "public_rank": 629, + "public_rank_with_all_ordinary_chart1_history": 629, + "residual_input_support": [ + 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 + ], + "retained_clears": 3433, + "retained_native_move": 10036, + "terminal_helper_probe": 231 + }, + "omit_b": { + "affected_output_support": [ + 63, + 222, + 230, + 362, + 367, + 368, + 369 + ], + "baseline_controls_with_nonzero_noise_pairing": [ + 266, + 269, + 273, + 277, + 300, + 303, + 307, + 311, + 454, + 461, + 468, + 1177, + 1187, + 1198, + 1204, + 1215, + 1222, + 1225, + 1235, + 1246, + 1428, + 1440, + 1443, + 1767, + 1774, + 1781, + 1859, + 1866, + 1873, + 2000, + 2003, + 2007, + 2011, + 2056, + 2064, + 2067, + 2121, + 2126, + 2130, + 2271, + 2276, + 2280, + 2355, + 2358, + 2364, + 2388, + 2400, + 2403, + 2414, + 2418, + 2424, + 2460, + 2478, + 2493, + 2496, + 2501, + 2721, + 2729, + 2733, + 3387, + 3399, + 3417, + 4813, + 4827, + 4834, + 4840, + 4846, + 4872, + 4879, + 5055, + 5062, + 5175, + 5189, + 5416, + 5437, + 5450, + 5470, + 5490, + 5497, + 5516, + 5576, + 5590, + 5604, + 6003, + 6010, + 6017, + 6023, + 6919, + 8113, + 8196, + 8208, + 8246, + 8330, + 8342, + 8383, + 8414, + 8426, + 8450, + 8474, + 8486, + 8608, + 8682, + 8813, + 8861, + 9024, + 9043, + 9074, + 9136, + 9199, + 9223, + 9235, + 9839, + 10036 + ], + "formal_noise_columns": 2802, + "formal_noise_left_parity": 0, + "formal_noise_output_rank": 629, + "missing_native_move": 10036, + "nonzero_clears_on_arbitrary_inputs": 3433, + "oracle_control": { + "before_native_clock": 29578, + "chart": 1, + "owner": 2828, + "recovers_rows": 630 + }, + "ordinary_chart1_history_rank": 504, + "public_rank": 629, + "public_rank_with_all_ordinary_chart1_history": 629, + "residual_input_support": [ + 254, + 255, + 258, + 259, + 276, + 361, + 365, + 367, + 393, + 431, + 442, + 458, + 459, + 465, + 472, + 482, + 497, + 512 + ], + "retained_clears": 3433, + "retained_native_move": 10039, + "terminal_helper_probe": 222 + }, + "tape_sha256": "74e93daf2b7acf794ffb51f92f03f51556f68126d41ee13a8969bddb4cbe6326" +} diff --git a/research/p104-single-export-parity/FUNDING.json b/research/p104-single-export-parity/FUNDING.json new file mode 100644 index 0000000000..8b0f84f34c --- /dev/null +++ b/research/p104-single-export-parity/FUNDING.json @@ -0,0 +1,217 @@ +{ + "24 fusions": { + "paid_count": 104880, + "paid_rank_sum": 285600, + "raw": [ + "-0.003139741060403536", + "-0.003139741060403535" + ], + "split_268": [ + "-0.000002967218905930", + "-0.000002967218905929" + ] + }, + "25 fusions": { + "paid_count": 104879, + "paid_rank_sum": 285600, + "raw": [ + "0.002246316249447241", + "0.002246316249447242" + ], + "split_268": [ + "0.000002122723798414", + "0.000002122723798415" + ] + }, + "36 net rank-one deletions": { + "paid_count": 104868, + "paid_rank_sum": 285564, + "raw": [ + "35.867594883503177832", + "35.867594883503177833" + ], + "split_268": [ + "0.033329702776022543", + "0.033329702776022544" + ] + }, + "baseline": { + "paid_count": 104904, + "paid_rank_sum": 285600, + "raw": [ + "-0.132405116496822168", + "-0.132405116496822167" + ], + "split_268": [ + "-0.000125133587380463", + "-0.000125133587380462" + ] + }, + "one net rank-one deletion": { + "paid_count": 104903, + "paid_rank_sum": 285599, + "raw": [ + "0.867594883503177832", + "0.867594883503177833" + ], + "split_268": [ + "0.000819561054648514", + "0.000819561054648515" + ] + }, + "shared application": { + "functional_gates": 4, + "kappa_target": "194523/50000000", + "last_stage_headroom": "695295976805812087/17179869184000000000000000000000", + "minimum_signed_gate_margin": "1/1000000000000000000", + "ordinary_gate_margin": "249/25000000000000000", + "positive_cap": "1274827/327680000", + "positive_gate_margin": "260546871/80000000000000000", + "positive_split_128": [ + "0.000214245636671934", + "0.000214245636671935" + ], + "stage_rates": [ + "968675584670509/250000000000000000", + "3890384730755733/1000000000000000000", + "972614733561007/250000000000000000", + "3890459948177981/1000000000000000000", + "3890459997053717/1000000000000000000", + "389046000001/100000000000000" + ], + "status": "conditional prices; physical word required", + "strict_gates": 54 + }, + "single rank shortenings": { + "14": { + "raw": [ + "0.853669930839602722", + "0.853669930839602723" + ], + "split_268": [ + "0.000806412331929296", + "0.000806412331929297" + ] + }, + "2": { + "raw": [ + "0.862208826193327056", + "0.862208826193327057" + ], + "split_268": [ + "0.000814475257148468", + "0.000814475257148469" + ] + }, + "21": { + "raw": [ + "0.852068182722787952", + "0.852068182722787953" + ], + "split_268": [ + "0.000804899860303616", + "0.000804899860303617" + ] + }, + "28": { + "raw": [ + "0.850943535237099081", + "0.850943535237099082" + ], + "split_268": [ + "0.000803837895830999", + "0.000803837895831000" + ] + }, + "3": { + "raw": [ + "0.860185982309396219", + "0.860185982309396220" + ], + "split_268": [ + "0.000812565175309919", + "0.000812565175309920" + ] + }, + "35": { + "raw": [ + "0.850076278894444208", + "0.850076278894444209" + ], + "split_268": [ + "0.000803018975858407", + "0.000803018975858408" + ] + }, + "4": { + "raw": [ + "0.858874622380752113", + "0.858874622380752114" + ], + "split_268": [ + "0.000811326914297846", + "0.000811326914297847" + ] + }, + "42": { + "raw": [ + "0.849370381099836544", + "0.849370381099836545" + ], + "split_268": [ + "0.000802352420651740", + "0.000802352420651741" + ] + }, + "49": { + "raw": [ + "0.848775180776577540", + "0.848775180776577541" + ], + "split_268": [ + "0.000801790392946732", + "0.000801790392946733" + ] + }, + "5": { + "raw": [ + "0.857900644283787799", + "0.857900644283787800" + ], + "split_268": [ + "0.000810407227509176", + "0.000810407227509177" + ] + }, + "56": { + "raw": [ + "0.848260661989449059", + "0.848260661989449060" + ], + "split_268": [ + "0.000801304549856805", + "0.000801304549856806" + ] + }, + "6": { + "raw": [ + "0.857125167791586592", + "0.857125167791586593" + ], + "split_268": [ + "0.000809674976882206", + "0.000809674976882207" + ] + }, + "7": { + "raw": [ + "0.856480746514861149", + "0.856480746514861150" + ], + "split_268": [ + "0.000809066475910131", + "0.000809066475910132" + ] + } + } +} diff --git a/research/p104-single-export-parity/LICENSE b/research/p104-single-export-parity/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/p104-single-export-parity/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-single-export-parity/NOTICE.md b/research/p104-single-export-parity/NOTICE.md new file mode 100644 index 0000000000..f63b5b3020 --- /dev/null +++ b/research/p104-single-export-parity/NOTICE.md @@ -0,0 +1,16 @@ +# Attribution and retained material + +The unchanged graph `pinned/strong-bit.json.gz` is Ali Romman's #8027 binary +source at `fb9b6a7b0d27da1cf98430893a3016bf811e2aa4`; the original source +and its upstream lineage are identified in [PARENT-NOTICE](PARENT-NOTICE). +The unchanged paired caller is from `research/paired-query-only-bit` at the +pinned base, and `pinned/price_audit.py` is the #8036 price reader. The caller, +source, pre-existing readout lists and price method retain their contributors' +credit and [Apache-2.0 license](LICENSE). See [SOURCES.json](SOURCES.json) for +byte hashes, Git blobs, commits and dependency distinctions. + +Clear1nsight's #8036 supplied the two single-readout substitutions; ToikY +nominated the chart-510 investigation, and DreamingOfClouds supplied the +#7852 toolkit. This follow-up, proof, pricing and verification were prepared +with substantial OpenAI Codex assistance. The forward and reverse programs +are separate author-side computational checks, not independent human review. diff --git a/research/p104-single-export-parity/PARENT-NOTICE b/research/p104-single-export-parity/PARENT-NOTICE new file mode 100644 index 0000000000..fe51894a1a --- /dev/null +++ b/research/p104-single-export-parity/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-single-export-parity/PROOF.md b/research/p104-single-export-parity/PROOF.md new file mode 100644 index 0000000000..0399e36fa0 --- /dev/null +++ b/research/p104-single-export-parity/PROOF.md @@ -0,0 +1,95 @@ +# Proof and verification boundaries + +## Scalar domain and source + +The pinned native graph is the literal #8027 111-port tape: 39,600 instructions, 630 public field owners, 2,803 MOVE occurrences and 3,433 private clears. Its source and the original one-export readout lists are pinned to #8027 and #8036 in `SOURCES.json`. A public field can be restricted to an arbitrary constant binary field. Impossibility on those binary inputs is therefore a necessary obstruction for any proposed word required to serve all original arbitrary field inputs. Clocks below are zero-based original instruction indices. + +## A parity unaffected by every surviving payload + +For either one-export branch, direct forward propagation gives + +`T = M + s r`, + +where rows of `M` are the original public-output forms, `s` selects affected outputs and `r` is the missing input parity. The reverse interpreter independently checks the transpose of each 630-by-630 matrix. The native operator is an involution. Set `ℓ = r M⁻¹`; the checked helper support gives `ℓ = r` and `ℓs = 1`. Therefore + +`ℓT = ℓM + (ℓs)r = r + r = 0`, + +while `ℓM = r ≠ 0`. Thus `T` omits an output parity required by the original operator. Both branch maps have rank 629. + +Freeze the remaining local instructions, MOVE positions and endpoints, and the final readout. Insert an independent formal symbol `z_e` into each surviving pre-MOVE payload. Linearity of the fixed suffix gives + +`y = T x + Σ_e d_e z_e`. + +The forward replay inserts all 2,802 independent symbols at once; its exact rank of `[T D]` is 629 and `ℓ[T D] = 0`. The reverse replay independently reconstructs each `d_e`, verifies `ℓd_e = 0` for every one, and checks the 630×630 transpose. Any collection of causal additive payload substitutions is represented by choosing the corresponding `z_e` as a function of the inputs and earlier choices. They cannot change `ℓy = 0`; the native map has `ℓMx = rx`, which is nonzero for some input. This proof allows simultaneous substitutions of any values at those MOVE slots. It does not allow new free ADDs, altered terminal reads, new contacts or new chart/owner bindings. + +The verifier checks rank 629 both for `T` and for the full span of reverse MOVE sensitivities. It also rejects a corrupted source and checks a deliberately faulty native carrier that a legal live cocharted ADD repairs; the wrong donor fails. The forward oracle places `r` at the synthesized register immediately before its first true reader and restores the original 630 rows. This deliberately supplies information for free and is not a physical repair. + +## Cut allowing changed decoding + +At chart 1 the original graph starts with no public inputs and ends with 505 independent public target fields. The checked native ingress counts are 323 rank-one, 180 rank-two and two rank-four MOVEs. Deleting either rank-one export leaves 504 incoming scalar fields. Regardless of the order or content of those retained arrivals, a binary transcript of 504 values has at most `2^504` states. A chart-1 decoder with no other initial side information has no way to produce the original 505 independent target bits, which attain `2^505` values. This argument permits arbitrary encodings and arbitrary terminal local decoding, including access to local history. It keeps the contact count and chart endpoints; additional messages, preloaded information or changes to the output domain are outside it. + +The executable control confirms that the native target and history ranks are 505, each hybrid chart-1 history and public-output rank is 504, and the union of all changed public outputs with changed chart-1 history has rank 629. The rank observations are finite linear controls; the transcript-count argument gives the stated arbitrary-encoding conclusion on binary fields. + +## Fixed-history cheaper ingress exclusion + +At an original chart-1 ingress of rank two or four, let `f` be the native +normalized received form. Let `H` contain every chart-1 field observed before +that exact clock and the full preclock native history of every existing chart +whose nested edge to chart 1 has strictly smaller rank. Grant the receiver all +of `H` for free, simultaneously and without charging the donor transfers. +For each of the 182 ingresses, the executable certificate gives a vector `q` +with `q·H = 0` and `q·f = 1`. Hence two original inputs differing by `q` are +indistinguishable from this entire granted stock but require different values +of `f`. No combination of those original-history senders, even with arbitrary +local decoding and unlimited free pooling, can reproduce that receipt at its +original clock. This fixes native preclock source histories and the original +receipt requirement; changed producers, later information or a different +terminal code may escape the screen. + +The census covers 180 rank-two and two rank-four original ingresses and checks +21,600 plus 600 donor combinations separately. Rational projector arithmetic +checks all 300 eligible lower-rank source charts against the identity chart. +Each case includes a separating vector, an actually live native-sender +positive control and a deliberately corrupted vector. The full native forward +and reverse operators and all 3,433 private dirty clears are also checked. +For the earliest case at clock 6908, the destination field is `e47 + e328`, +and `q = e47 + e48 + e52 + e58` is one certificate. + +## Literal two-contact relay and its displaced output + +The original tape sends owner 2326 from 326 to 531 at clock 8072 and sends +owner 2327 from 326 to 1 at clock 8075. On the diagnostic tape, omit the two +source XORs that add native owners 1857 and 2224 to 2326; send the resulting +field to 531 at the original 8072 contact. Create 2327 as a copy of that +field at 531 and use 531 → 1 at clock 8075. The native 2327 receipt is +preserved. Both contacts are nested on the exact rational projectors, and the +second has rank one rather than rank two. This is a literal incomplete +operator, not an admitted supplier. + +The displaced residual is the original `x1857 + x2224` at the source. The +replay checks the exact 27 input coordinates in `RELAY.json`. Just before the +first reader at 10137, the original and diagnostic live charts agree and +only owner 2326's field differs. Injecting the residual there restores the +complete live state and, consequently, all 630 public rows and the symbolic +values at all 3,433 private clears. Without that oracle nine named output rows +fail. The actual source and charge of the residual remain unproved. + +For the retained old-export contract, the native 2327 receipt and the two +531 → 1 fields at clocks 10138 and 10141 are three independent binary forms. +Chart 531 starts with no public information and has exactly two ingress slots +through 10141. Two binary messages have at most four possible values, whereas +these three independent demands attain eight. Therefore arbitrary recoding of +those two arrivals cannot supply all three original forms; changing one of the +old exports or adding another receipt is outside the argument. + +## Conditional price + +The binary source inventory is rebuilt from the pinned native graph, its 36 LOCAL calls and the pinned outer caller. Replacing `paid[1]` by `paid[1]-1`, with every other paid and productive count unchanged, is an explicit **hypothetical one-net-rank-one deletion across the complete 36-call word**. The directed log/exp calculation and the distinct integer-root calculation enclose the same raw and 268-factor surplus. With the stated histogram, the surplus is positive and exceeds `2/2^50`; stage and signed-gate controls pass under the retained #8035 numerical positive profile. + +This calculation does not show a legal one-net deletion, a compatible 268-factor physical owner schedule, or a replacement for the positive/outer physical proofs. The two literal one-export tapes are singular. The tariff must be recomputed after any additional paid change or altered productive inventory. + +A second family keeps the total paid count unchanged and replaces exactly one +rank `r > 1` by `r − 1` in the entire caller histogram. All 13 native paid +ranks above one pass both directed raw and 268-factor checks under the same +unchanged-productive-inventory premise. This is an arithmetic condition, not +a construction of a legal lower-rank destination. diff --git a/research/p104-single-export-parity/README.md b/research/p104-single-export-parity/README.md new file mode 100644 index 0000000000..c2c20199e4 --- /dev/null +++ b/research/p104-single-export-parity/README.md @@ -0,0 +1,119 @@ +# Chart-1 savings: parity, cheaper ingress and a conditional price + +Each of the two one-export variants of the [#8036 chart-510 rewrite](https://github.com/CrocSwap/integer-mult-bounds/pull/8036) deletes one native rank-one MOVE. Neither is a valid supplier on the 630 independent public fields: its output map has rank **629**, and a specific output parity is zero on every possible input. Giving arbitrary additive changes to any combination of the other **2,802** MOVE payloads cannot restore the native output map while the remaining local instructions and final reads stay fixed. + +A separate fixed-interface cut remains valid even if the chart-1 local decoder and all scalar payloads are freely recoded. Chart 1 starts with no public field. It has **505** independent prescribed final fields but, in either one-export variant, only **504** incoming scalar MOVEs. Those 504 messages cannot encode all 505 independent binary target bits. This cut keeps the remaining contact incidences and final public chart bindings; extra contacts, moved endpoints, extra initial side information, or a different public output contract are outside it. + +The price of one rank shortening also motivates a separate fixed-history +screen. All **182** native chart-1 arrivals of rank greater than one need +information unavailable from the pooled histories of every cheaper chart and +chart 1 at the original clock. This does not rule out a changed producer or +changed destination demand. + +At trial **κ = 0.00389046**, a hypothetical complete 36-call BIT invoice with one net rank-one paid deletion, no other tariff changes and the same productive inventory passes the stated 268-factor directed numerical test. This is a **conditional price**, not a legal rewrite. The two available one-export words fail the operator obligation, and an actual changed producer must also pay for physical routing, private owners, cleanup, the paired caller and the finite outer application. No new κ lower bound is claimed. + +## Fixed-code parity + +Let `M` be the original 630-field binary operator, which the replay verifies is an involution. Removing either native chart-510 export and installing its #8036 local readout gives `T = M + s r` over `F₂`. The source tape and ordered cocharted donor lists are embedded. The forward and independently implemented reverse checks agree on all 630×630 coefficients: + +| Deleted native MOVE | Changed output rank | Weight of `r` | Weight of `s` | Surviving MOVEs | +|---|---:|---:|---:|---:| +| clock 10039, owner 2829, chart 510 → 1 | 629 | 29 | 12 | 2,802 | +| clock 10036, owner 2828, chart 510 → 1 | 629 | 18 | 7 | 2,802 | + +For each, `ℓ = r M⁻¹ = r`, `ℓs = 1`, and `ℓT = 0`. For every remaining MOVE, let `d` be its exact downstream output sensitivity. Both the simultaneous forward-noise replay and the reverse interpreter check `ℓd = 0` for all 2,802 sites. Thus arbitrary, simultaneous, causal, even nonlinear choices of their scalar payload changes cannot alter this parity when the free local instructions, owner/endpoint schedule and final readout remain fixed. An additional terminal read of changed private history is not covered by that parity claim. + +The original word and both changed words retain the same 3,433 private clears, all symbolically dirty on unrestricted inputs. The verifier includes a legal synthetic fault-and-repair control, a wrong-donor rejection, a corrupted-source rejection, and a residual oracle immediately before the first relevant reader. The oracle and external helper read are diagnostic controls: their delivery and cost are not supplied. + +## Decoder-independent chart-1 cut + +The 505 required fields at chart 1 consist of 111 first-rail outputs, 391 rank-eight helper outputs and three rank-four helper outputs. They are independent binary linear functions of the original public inputs. The native tape has exactly 505 incoming MOVEs to chart 1, with rank histogram `{1: 323, 2: 180, 4: 2}`, and no outgoing MOVEs. Either one-export variant has 504 arrivals and no initial public data at that chart. + +Even if the retained scalar messages are arbitrary functions of the full input and preceding history, the transcript of 504 binary arrivals has at most `2^504` values. A deterministic cocharted decoder therefore cannot reproduce all `2^505` possible target tuples. The same argument applies by restricting arbitrary bank contents to constant binary fields. It does not price or prohibit an extra contact, a changed chart interface, prepositioned side information or a changed target domain. + +## Cheaper existing chart-1 senders + +The native 505 chart-1 arrivals include **180 rank-two and two rank-four** +contacts. For each, keep its original received field and clock. Grant free +retention of every earlier native chart-1 value and the whole preclock native +history of every existing sender with a cheaper nested contact to chart 1. The +receiver is even given the union of *all* those senders' histories for free. +The required original field is outside that union for all **182** arrivals. +This grants more information than choosing a single cheaper sender. It does +not include changed upstream producers, a changed receipt requirement or +additional retimed information. + +The checker verifies all 300 relevant rational projector candidates and +**22,200** individual sender tests: 21,600 for the rank-two arrivals and 600 +for the rank-four arrivals. Each exclusion has a checked dual input shift; +the original sender is an actual live positive control for every arrival. +At clock 6908, the required field is `e47 + e328`, and the shift +`e47 + e48 + e52 + e58` is invisible to chart 1 and every cheaper sender's +preclock native history but flips that field. The same checker independently +verifies the original 630-row forward and adjoint operators, all 3,433 dirty +clears, corrupted dual witnesses and a corrupted source. See +[SHORTER-INGRESS.json.gz](SHORTER-INGRESS.json.gz) for every case. + +## A literal 326 → 531 → 1 diagnostic + +At native clock 8075, field 2327 normally moves directly from chart 326 to +chart 1 at rank two. A literal diagnostic changes the earlier 326 → 531 +payload at clock 8072 and sends a copy onward from 531 → 1 at clock 8075, +so the second contact has rank one and the original 2327 receipt is exact. +The resulting displaced field is owner 2326. Immediately before its first +reader at clock 10137 it is the **only** live owner with a wrong normalized +value; without repair, nine final public rows fail. + +The missing value is the native XOR of owners 1857 and 2224 at the 326 source. +Its 27-input support is `3, 59, 60–72, 230, 359, 362, 365, 367, 372, 375, +378, 386, 388, 390, 522`. Granting that value as an oracle XOR into owner +2326 immediately before clock 10137 makes the entire live state, all 630 final +rows and all 3,433 private clear values equal to the native word. This is a +control, not a delivered or priced repair. + +By clock 10141, chart 531 has only two original incoming contacts, at clocks +8072 and 8098, and no initial public field. Preserving receipt 2327 and both +original 531 → 1 exports at clocks 10138 and 10141 asks for three independent +binary forms. The two-arrival capacity is insufficient, even with arbitrary +recoding inside that stated interface. Extra or retimed receipts and changes to +the old export requirements remain open. The replay checks the exact rational +nesting of 326 ⊂ 531 ⊂ 1 as well as the literal state and oracle controls. +[RELAY.json](RELAY.json) records the complete residual and both reader checks. + +## Conditional tariff at the trial + +The paid counts below are for the entire 36-call binary caller. The numeric verifier rebuilds its binary histogram from the pinned graph and caller, and compares rational log/exp enclosures with an integer-root enclosure reader from #8036. The positive-supplier histogram and signed outer gates are the explicitly retained #8035 profile; this package does not rerun that positive supplier's physical source. + +| Hypothetical change | Paid count | Rank sum | Raw surplus interval | 268-factor surplus interval | +|---|---:|---:|---|---| +| None | 104,904 | 285,600 | −0.132405116496822168 to −0.132405116496822167 | −0.000125133587380463 to −0.000125133587380462 | +| One net rank-one deletion | 104,903 | 285,599 | 0.867594883503177832 to 0.867594883503177833 | 0.000819561054648514 to 0.000819561054648515 | +| 36 net rank-one deletions | 104,868 | 285,564 | 35.867594883503177832 to 35.867594883503177833 | 0.033329702776022543 to 0.033329702776022544 | +| One rank-two charge shortened to rank one | 104,904 | 285,599 | 0.862208826193327056 to 0.862208826193327057 | 0.000814475257148468 to 0.000814475257148469 | + +The same directed test passes for replacing one existing paid rank `r > 1` +by `r − 1` at each of the 13 ranks present in the complete caller inventory. +This hypothetical keeps the paid count and productive inventory fixed; it +does not identify a legal shortened contact. The smallest powered surplus in +the 13 examples is at least `0.000801304549856805`. + +The numerical certificate also retains the positive 128-factor price, six staged rates, 21-bit ordinary and 10-bit positive debit, and **54 strict plus four functional** signed gates; its minimum strict/functional margin is `10⁻¹⁸`. The replay checks the previously priced 24-versus-25 fusion boundary as a control. Adding a rank-one payment, changing the productive inventory or changing the physical supplier invalidates the one-net-deletion invoice unless repriced. + +## Reproduce + +With Python 3.12 and the standard library: + +```sh +python3.12 -I -B verify.py +``` + +The verifier authenticates the embedded sources and reference outputs, runs the forward noise certificate, the independent reverse audit, the chart-1 cut, the cheaper-sender screen, the literal relay diagnostic and the conditional directed price. It compares each deterministic result with its checked receipt without rewriting any source or receipt. `VERIFY.json` registers the same command. Base provenance is pinned to `e54523517d0f03e58352e647c403a5af3e525a57`; the external graph and its original source head are separately pinned in `SOURCES.json`. + +## Open next questions + +- Can an altered paid incidence or a delivered side observation recover the missing chart-1 information within the complete invoice? Start with a named source, destination, clock and displaced reader; this leaves the fixed-interface cut. The frozen-history screen does not cover changed producers or changed received values. +- Can a changed primitive word, including its private owner schedule and physical bank lifecycle, produce an actual one-net-rank-one saving? First emit and replay all 630 forward rows, their adjoints and the actual 36-call paid/productive inventories. A scalar or hypothetical price by itself does not answer this. + +## Attribution + +Ali Romman supplied the 111-port graph and physical supplier. ToikY nominated the chart-510 site, DreamingOfClouds supplied the #7852 toolkit, and Clear1nsight prepared #8036 and this follow-up with substantial OpenAI Codex assistance. The literal source's prior credits and Apache-2.0 license are retained in [PARENT-NOTICE](PARENT-NOTICE) and [LICENSE](LICENSE). The separate forward and reverse computational checks are author-side evidence; independent human scientific review remains open. diff --git a/research/p104-single-export-parity/RELAY.json b/research/p104-single-export-parity/RELAY.json new file mode 100644 index 0000000000..929dab0622 --- /dev/null +++ b/research/p104-single-export-parity/RELAY.json @@ -0,0 +1,78 @@ +{ + "route_dimensions": [ + 6, + 7, + 8 + ], + "preserved_receipt": 2327, + "displaced_owner": 2326, + "displaced_read_clocks": [ + 10137, + 30079 + ], + "residual_input_support": [ + 3, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 230, + 359, + 362, + 365, + 367, + 372, + 375, + 378, + 386, + 388, + 390, + 522 + ], + "checks": { + "10137": { + "residual_in_retained_history": false, + "residual_in_live_other_owners": false, + "historical_rank": 2, + "other_live_rank": 1 + }, + "30079": { + "residual_in_retained_history": false, + "residual_in_live_other_owners": false, + "historical_rank": 3, + "other_live_rank": 2 + } + }, + "uncorrected_wrong_public_rows": [ + 0, + 11, + 117, + 223, + 224, + 230, + 249, + 250, + 251 + ], + "only_wrong_owner_at_first_reader": [ + 2326 + ], + "oracle_first_state_exact": true, + "oracle_final_map_exact": true, + "oracle_original_clear_values_preserved": 3433, + "early_hub_arrivals": [ + 8072, + 8098 + ], + "three_original_readout_demands_rank": 3 +} diff --git a/research/p104-single-export-parity/REVERSE-RESULT.json b/research/p104-single-export-parity/REVERSE-RESULT.json new file mode 100644 index 0000000000..ae328d2e31 --- /dev/null +++ b/research/p104-single-export-parity/REVERSE-RESULT.json @@ -0,0 +1,264 @@ +{ + "branches": { + "a": { + "additional_cochart_adds": 8, + "exact_signature_matches": 0, + "explicit_nonzero_kernel_input": [ + 92, + 99, + 203, + 210, + 231, + 428, + 433, + 434, + 435, + 448, + 449, + 473, + 516, + 582 + ], + "historical_span_hits": 0, + "live_donor_hits": 0, + "move_signature_span_rank": 629, + "move_slots_odd_against_separator": 0, + "nonzero_symbolic_clears": 3433, + "oracle_at_nearest_rejected": true, + "output_operator_rank": 629, + "output_signature": [ + 92, + 99, + 231, + 428, + 433, + 434, + 435, + 448, + 449, + 473, + 516, + 582 + ], + "owner_only_overgrant_hits": 0, + "positive_control": { + "bad_control_donor": 224, + "clock": 2, + "corrupt_donor": 223, + "exact_tape_repaired": true, + "legal_live_hits": 2, + "legal_witness": [ + 223 + ], + "matching_slots": 2, + "owner": 630, + "sender_chart": 0, + "wrong_donor_rejected": true + }, + "private_clear_count": 3433, + "readout_owners": [ + 2336, + 2344, + 2416, + 2439, + 2448, + 2451, + 2482, + 2655, + 2698 + ], + "removed_move_clock": 10039, + "removed_paid_move_rank": 1, + "residual": [ + 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 + ], + "separator": [ + 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 + ], + "separator_dot_target": 1, + "signature_min_hamming_distance": 3, + "signature_nearest_clock": 9767, + "surviving_move_slots": 2802 + }, + "b": { + "additional_cochart_adds": 22, + "exact_signature_matches": 0, + "explicit_nonzero_kernel_input": [ + 63, + 174, + 222, + 230, + 362, + 367, + 368, + 369 + ], + "historical_span_hits": 0, + "live_donor_hits": 0, + "move_signature_span_rank": 629, + "move_slots_odd_against_separator": 0, + "nonzero_symbolic_clears": 3433, + "oracle_at_nearest_rejected": true, + "output_operator_rank": 629, + "output_signature": [ + 63, + 222, + 230, + 362, + 367, + 368, + 369 + ], + "owner_only_overgrant_hits": 0, + "positive_control": { + "bad_control_donor": 224, + "clock": 2, + "corrupt_donor": 223, + "exact_tape_repaired": true, + "legal_live_hits": 2, + "legal_witness": [ + 223 + ], + "matching_slots": 2, + "owner": 630, + "sender_chart": 0, + "wrong_donor_rejected": true + }, + "private_clear_count": 3433, + "readout_owners": [ + 2359, + 2362, + 2372, + 2394, + 2397, + 2408, + 2416, + 2419, + 2425, + 2431, + 2434, + 2465, + 2484, + 2518, + 2530, + 2571, + 2576, + 2584, + 2600, + 2617, + 2623, + 2626, + 2778 + ], + "removed_move_clock": 10036, + "removed_paid_move_rank": 1, + "residual": [ + 254, + 255, + 258, + 259, + 276, + 361, + 365, + 367, + 393, + 431, + 442, + 458, + 459, + 465, + 472, + 482, + 497, + 512 + ], + "separator": [ + 254, + 255, + 258, + 259, + 276, + 361, + 365, + 367, + 393, + 431, + 442, + 458, + 459, + 465, + 472, + 482, + 497, + 512 + ], + "separator_dot_target": 1, + "signature_min_hamming_distance": 3, + "signature_nearest_clock": 8196, + "surviving_move_slots": 2802 + } + }, + "input_corruption_rejected": true, + "source": { + "commit": "99878b566bfcce80ef7ae2650a1231a203361445", + "compressed_sha256": "74e93daf2b7acf794ffb51f92f03f51556f68126d41ee13a8969bddb4cbe6326", + "expanded_sha256": "b096d6df2a0c4688296b13ab0cfd50fec1c7dec732819c624ddd7a745a144b69", + "read_mode": "local graph file verified by SHA-256; no non-stdlib imports" + } +} diff --git a/research/p104-single-export-parity/SHORTER-INGRESS.json.gz b/research/p104-single-export-parity/SHORTER-INGRESS.json.gz new file mode 100644 index 0000000000..3d5e0f7be5 Binary files /dev/null and b/research/p104-single-export-parity/SHORTER-INGRESS.json.gz differ diff --git a/research/p104-single-export-parity/SOURCES.json b/research/p104-single-export-parity/SOURCES.json new file mode 100644 index 0000000000..22bb4ca14d --- /dev/null +++ b/research/p104-single-export-parity/SOURCES.json @@ -0,0 +1,78 @@ +{ + "schema_version": 1, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "75d77b328ea02ded535e7f23aee5b1e55d0bb1a8", + "sha256": "154c3d30455d778fd3343b6b4851f0fa4665f0f7625b0adb3675e2bafbbf6bf1" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "3404fbdd5e7529a0674eef26114b5071e4586cec", + "sha256": "ead6cdc9d0af6d58e8a49744d8ec8c7c15e13d2ba93c276c434bcf9b51b93a81" + }, + { + "path": "research/paired-query-only-bit/EFREE-CALLER.json.gz", + "usage": "provenance", + "git_blob": "f022272a8d51ede841778dec76e2bfb24b614d04", + "sha256": "757b3523798f840bdb02028b23708c3416627a99ea09e7a3c4bcdc5cd0c7ce4b" + } + ], + "vendored_graph": { + "repository": "https://github.com/aliromman/integer-mult-bounds", + "pull_request": 8027, + "head": "fb9b6a7b0d27da1cf98430893a3016bf811e2aa4", + "path": "research/p104-live-relative-gain/BINARY-CANDIDATE.json.gz", + "local_path": "pinned/strong-bit.json.gz", + "git_blob": "16f8cafb1c4d139a99a62e46eb40c118e6176c34", + "sha256": "74e93daf2b7acf794ffb51f92f03f51556f68126d41ee13a8969bddb4cbe6326", + "expanded_sha256": "b096d6df2a0c4688296b13ab0cfd50fec1c7dec732819c624ddd7a745a144b69", + "provenance_note": "External PR bytes are vendored unchanged and checked by blob and SHA-256; this package does not contain full source Git history." + }, + "vendored_caller": { + "repository": "CrocSwap/integer-mult-bounds", + "head": "e54523517d0f03e58352e647c403a5af3e525a57", + "path": "research/paired-query-only-bit/EFREE-CALLER.json.gz", + "local_path": "pinned/EFREE-CALLER.json.gz", + "git_blob": "f022272a8d51ede841778dec76e2bfb24b614d04", + "sha256": "757b3523798f840bdb02028b23708c3416627a99ea09e7a3c4bcdc5cd0c7ce4b" + }, + "mathematical_dependencies": [ + { + "pr": 8036, + "head": "99878b566bfcce80ef7ae2650a1231a203361445", + "use": "one-export readout lists, direct and inverse graph structure, and reference integer-root price reader" + }, + { + "pr": 8035, + "head": "ea776471bf8ed143a0625cf2d7532f65d15eb5f9", + "use": "conditional positive inventory and signed outer-gate profile; physical replay not rerun in this package" + }, + { + "pr": 8033, + "head": "a1313ff9f84fd00d50b282fe432e522191277821", + "use": "268-factor retained numerical scheduling profile" + } + ], + "retained_files_sha256": { + "LICENSE": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4", + "PARENT-NOTICE": "b213998c8dae6d88e4a1f0fd17c81dd78c31ef35bc9460fa16ca692326f1a02b", + "carrier_invariant.py": "83f4121fdcc0d509c3b46908090a1d078109a60153386885d346b36128694fdb", + "reverse_audit.py": "98e359de4a6942751525dcf6b5d53f5dee7884cdd92871ef6dace89b294cdb37", + "terminal_cut.py": "e14b137854ec7a25c7112a84d5751250bc2f9e0a9a5d61b0699386093a8dd2e5", + "verify_funding.py": "b9596574f4ded80c2bee2d44fef4d1d4aff859f53eadacb089130f34bed6779e", + "pinned/price_audit.py": "ca650d573f605bf51a8806a772903b6775cd036dfbfe7f043eccd3e51bc9977b", + "pinned/EFREE-CALLER.json.gz": "757b3523798f840bdb02028b23708c3416627a99ea09e7a3c4bcdc5cd0c7ce4b", + "CARRIER-INVARIANT.json": "5586990a135dc4a52aa19125683ba615d894eb705ab640cb599f2ce003b43983", + "REVERSE-RESULT.json": "01e89971f02bacff80bb3ef1ce35238694d70656fd65d7c675b4796a2ebe95b9", + "TERMINAL-CUT.json": "ac3af9315192cba95e0c66336cc07bbd9afc495a5ab6e4684c0370f5fe76e3a1", + "FUNDING.json": "0064a1d953c66fcbaa4766e139e6b1d09daaa4934b66c0eeccb5595907183ff6", + "shorter_ingress.py": "db84863ee72f11396d67da4f48aa352deca4a8c05493e03689446a561aa245ff", + "SHORTER-INGRESS.json.gz": "8c0f0b645dbfa47623c240f8279263289b5c6706c5adf9e986e661879b41f21a", + "relay_example.py": "bc6975a644527366daa0915f0a15f87125abb6c595135ecaba2bd1ac88d38dba", + "RELAY.json": "6c63864ffc139cd11083be6ada1e26030abd88028f89fc6efbd3c010121a4b01" + } +} diff --git a/research/p104-single-export-parity/TASK.json b/research/p104-single-export-parity/TASK.json new file mode 100644 index 0000000000..621250ddc7 --- /dev/null +++ b/research/p104-single-export-parity/TASK.json @@ -0,0 +1,93 @@ +{ + "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 donor requested a scoped obstruction and conditional price for the one-export specializations of the #8036 P104 source, rather than a selected bootstrap stock envelope.", + "actual_scope": "Replay both one-export variants, prove their fixed-code parity and decoder-independent chart-1 cut, screen 182 native higher-rank chart-1 arrivals, replay a literal 326-to-531 diagnostic, and independently enclose conditional whole-word deletion and shortening prices.", + "bottleneck_link": "A one-net-rank-one paid reduction has sufficient conditional arithmetic headroom at the trial, but no such valid physical supplier is constructed.", + "stop_rule": "Authenticate source bytes, replay all public fields and surviving MOVE sensitivities in independent directions, prove the chart-1 contact cut, and verify both numerical enclosures with controls.", + "outcome": "negative-result", + "evidence": "README.md, PROOF.md, CARRIER-INVARIANT.json, REVERSE-RESULT.json, TERMINAL-CUT.json, SHORTER-INGRESS.json.gz, RELAY.json, FUNDING.json and the registered replay.", + "author": "Clear1nsight", + "ai_assistance": "Substantial OpenAI Codex assistance in research, proof, implementation, arithmetic and documentation.", + "open_questions": [ + { + "question": "Can an altered incidence or a delivered side observation restore the missing chart-1 information within the complete invoice?", + "why_it_matters": "The original fixed interface is saturated, while one genuine net rank-one saving has sufficient conditional trial margin.", + "first_step": "Name a source, destination, legal clock and displaced reader, then calculate its complete new paid and productive inventory.", + "blocked_by": "No legal side-information route and full owner/cleanup invoice is supplied." + }, + { + "question": "Can another native or changed primitive word realize one net rank-one saving with the complete original operator?", + "why_it_matters": "The two literal one-export variants are singular and the physical caller needs all bound ports.", + "first_step": "Emit a changed tape and replay all 630 rows, their adjoints and the full 36-call invoice.", + "blocked_by": "A valid replacement and physical owner lifecycle are not constructed." + }, + { + "question": "Can any higher-rank native chart-1 arrival be shortened after changing an upstream producer or the required receipt?", + "why_it_matters": "All 182 fixed-receipt cheaper-sender tests fail under native source histories, but altered histories and joint codes remain outside the result.", + "first_step": "Name one arrival and an earlier changed producer, then price and replay the displaced original reader and complete caller.", + "blocked_by": "No legal changed producer or complete paid/terminal restoration is supplied." + } + ] +} diff --git a/research/p104-single-export-parity/TERMINAL-CUT.json b/research/p104-single-export-parity/TERMINAL-CUT.json new file mode 100644 index 0000000000..665b7e4d31 --- /dev/null +++ b/research/p104-single-export-parity/TERMINAL-CUT.json @@ -0,0 +1,30 @@ +{ + "initial_top_fields": 0, + "original_ingress_by_paid_rank": { + "1": 323, + "2": 180, + "4": 2 + }, + "prescribed_top_output_rank": 505, + "replays": { + "omit_a": { + "formal_public_and_top_history_rank": 629, + "formal_top_history_rank": 504, + "formal_top_public_rank": 504, + "incoming_moves": 504 + }, + "omit_b": { + "formal_public_and_top_history_rank": 629, + "formal_top_history_rank": 504, + "formal_top_public_rank": 504, + "incoming_moves": 504 + }, + "original": { + "formal_public_and_top_history_rank": 630, + "formal_top_history_rank": 505, + "formal_top_public_rank": 505, + "incoming_moves": 505 + } + }, + "source_sha256": "74e93daf2b7acf794ffb51f92f03f51556f68126d41ee13a8969bddb4cbe6326" +} diff --git a/research/p104-single-export-parity/VERIFY.json b/research/p104-single-export-parity/VERIFY.json new file mode 100644 index 0000000000..e889b6ff3e --- /dev/null +++ b/research/p104-single-export-parity/VERIFY.json @@ -0,0 +1,19 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 600, + "checks": "Replay 630 public rows, 2802 forward/reverse MOVE sensitivities, chart-1 information cut, 182 cheaper-ingress exclusions and 22200 donor tests, the 326-to-531 literal relay with nested projectors, and conditional deletion/shortening prices with controls." + } + ] +} diff --git a/research/p104-single-export-parity/carrier_invariant.py b/research/p104-single-export-parity/carrier_invariant.py new file mode 100644 index 0000000000..bd10cf39a4 --- /dev/null +++ b/research/p104-single-export-parity/carrier_invariant.py @@ -0,0 +1,174 @@ +# SPDX-License-Identifier: Apache-2.0 +"""Forward certificate for the unmatched chart-510 export at #8036 (99878b566bfc). + +Ali Romman supplied the pinned 111-port tape. The local reader lists are the +Clear1nsight #8036 lists. The formal MOVE-noise certificate extends that work. +Run with Python 3.10+ and a path to the original strong-bit.json.gz or its folder. +""" +import argparse +from functools import reduce +from gzip import decompress +from hashlib import sha256 +import json +from operator import xor +from pathlib import Path + + +SHA = '74e93daf2b7acf794ffb51f92f03f51556f68126d41ee13a8969bddb4cbe6326' +EXPANDED_SHA = 'b096d6df2a0c4688296b13ab0cfd50fec1c7dec732819c624ddd7a745a144b69' +LENSES = { + 'a': (10037, 2829, 2335, 29847, 3525, 231, + (2336,2344,2416,2439,2448,2451,2482,2655,2698)), + 'b': (10034, 2828, 2337, 29578, 3496, 222, + (2359,2362,2372,2394,2397,2408,2416,2419,2425,2431,2434,2465, + 2484,2518,2530,2571,2576,2584,2600,2617,2623,2626,2778)), +} + + +def rank(rows): + pivots = {} + for row in rows: + while row: + k = row.bit_length() + if k not in pivots: + pivots[k] = row + break + row ^= pivots[k] + return len(pivots) + + +def support(word): + return [i for i in range(word.bit_length()) if word >> i & 1] + + +def combine(rows, coeffs): + return reduce(xor,(rows[i] for i in support(coeffs)),0) + + +def mask(bits): + return sum(1 << i for i in bits) + + +def tape(word, missing): + original = word['program'] + if missing is None: + return list(enumerate(original)) + start, reg, donor, first, dest, _, lenders = LENSES[missing] + assert original[start:start+3] == [['INIT',reg,510], ['ADD',reg,donor,510], ['MOVE',reg,510,1]] + assert original[first] == ['ADD',dest,reg,1] + for j in range(start+3, first): + row = original[j] + assert reg != row[1] and (row[0] not in ('ADD','SWAP') or reg != row[2]) + localized = [['INIT',reg,1]] + [['ADD',reg,j,1] for j in lenders] + return (list(enumerate(original[:start])) + [(None,row) for row in localized] + + list(enumerate(original[start+3:],start+3))) + + +def forward(word, tape, *, noise=False, oracle=None): + """Each z_e is fresh. It modifies its MOVE payload before further free operations.""" + n = word['public'] + charts = dict(enumerate(word['start'])) + fields = {i:1<= n and i not in fields + charts[i],fields[i] = args[0],0 + elif op == 'ADD': + j,chart = args + assert charts[j] == charts[i] == chart + fields[i] ^= fields[j] + elif op == 'SWAP': + j, = args + charts[i], charts[j] = charts[j], charts[i] + fields[i], fields[j] = fields[j], fields[i] + if charts[j] == 1: + top_history.append(fields[j]) + elif op == 'CLEAR': + assert i >= n and charts.pop(i) == args[0] + retired.append((i,args[0],bool(fields.pop(i)))) + continue + else: + assert op == 'MOVE' and charts[i] == args[0] and clock is not None + if noise: + fields[i] ^= 1 << (n + len(carriers)) + carriers.append(clock) + charts[i] = args[1] + if charts[i] == 1: + top_history.append(fields[i]) + assert charts == dict(enumerate(word['final'])) + return [fields[i] for i in range(n)],carriers,retired,top_history + + +def verify(word, which, base, base_noisy, baseline_carriers, old_clears): + n = word['public'] + selected = tape(word, which) + new, carrier_clocks, retired, history = forward(word,selected) + noisy, noisy_clocks, _, _ = forward(word,selected,noise=True) + assert carrier_clocks == noisy_clocks and len(carrier_clocks) == 2802 + start, reg, _, first, _, probe, _ = LENSES[which] + difference = [old ^ changed for old,changed in zip(base,new)] + residuals = set(difference) - {0} + assert len(residuals) == 1 + residual, = residuals + signature = mask(i for i,v in enumerate(difference) if v) + assert all(i >= 222 and (word['start'][i],word['final'][i]) == (0,1) for i in support(residual)) + assert all(word['final'][i] == 1 for i in support(signature)) + assert [residual.bit_count(),signature.bit_count()] == ([29,12] if which=='a' else [18,7]) + assert len(new) == n == 630 and rank(new) == 629 + # M is involutive, r is supported on original helper outputs fixed by M. + ell = combine(base,residual) + assert ell == residual and (ell & signature).bit_count() % 2 == 1 + collision = mask(i for i,row in enumerate(base) if (row & signature).bit_count() % 2) + assert all((row & collision).bit_count() % 2 == 0 for row in new+history) + assert rank(new+history) == 629 + assert combine(noisy,ell) == 0 and rank(noisy) == 629 + native_noise = combine(base_noisy,ell) + assert native_noise & ((1<> n)] + assert start+2 in native_hits + assert [(i,c) for i,c,_ in retired] == [(i,c) for i,c,_ in old_clears] and len(retired) == 3433 + # One original helper value brought to chart 1 restores each affected row. + assert (word['start'][probe],word['final'][probe]) == (0,1) and signature >> probe & 1 + assert (new[probe] ^ (1 << probe)) == residual + decoded = [v ^ ((new[probe] ^ (1<> i & 1 else 0) for i,v in enumerate(new)] + assert decoded == base + # Oracle control at the first actual reader. The paid schedule supplies no such oracle. + fixed,_,_,_ = forward(word,selected,oracle=(first,reg,residual)) + assert fixed == base + fresh_bit = 1 << (n + len(carrier_clocks)) + perturbed,_,_,_ = forward(word,selected,noise=True,oracle=(first,reg,fresh_bit)) + assert combine(perturbed,ell) == fresh_bit + assert [v ^ w for v,w in zip(noisy,perturbed)] == [fresh_bit if signature >> i & 1 else 0 for i in range(n)] + return {'missing_native_move':start+2, 'retained_native_move':10036 if which=='a' else 10039, + 'residual_input_support':support(residual), 'affected_output_support':support(signature), + 'public_rank':rank(new), 'public_rank_with_all_ordinary_chart1_history':rank(new+history), + 'ordinary_chart1_history_rank':rank(history), 'formal_noise_columns':len(carrier_clocks), + 'formal_noise_output_rank':rank(noisy), 'formal_noise_left_parity':0, + 'baseline_controls_with_nonzero_noise_pairing':native_hits, 'terminal_helper_probe':probe, + 'oracle_control':{'before_native_clock':first,'owner':reg,'chart':1,'recovers_rows':len(fixed)}, + 'retained_clears':len(retired),'nonzero_clears_on_arbitrary_inputs':sum(b for _,_,b in retired)} + + +def main(): + p=argparse.ArgumentParser(description=__doc__);p.add_argument('tape',type=Path);a=p.parse_args() + path=a.tape/'strong-bit.json.gz' if a.tape.is_dir() else a.tape + raw=path.read_bytes();expanded=decompress(raw) + assert sha256(raw).hexdigest()==SHA and sha256(expanded).hexdigest()==EXPANDED_SHA + word=json.loads(expanded);old=tape(word,None) + base,base_clocks,clears,_=forward(word,old) + assert base==[(1<= 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-single-export-parity/pinned/strong-bit.json.gz b/research/p104-single-export-parity/pinned/strong-bit.json.gz new file mode 100644 index 0000000000..16f8cafb1c Binary files /dev/null and b/research/p104-single-export-parity/pinned/strong-bit.json.gz differ diff --git a/research/p104-single-export-parity/relay_example.py b/research/p104-single-export-parity/relay_example.py new file mode 100644 index 0000000000..86370814cc --- /dev/null +++ b/research/p104-single-export-parity/relay_example.py @@ -0,0 +1,141 @@ +"""Check the two-transfer route through chart 531, using only the pinned native graph.""" +import gzip +from hashlib import sha256 +import json +from pathlib import Path + + +def insert(basis, x): + while x: + n=x.bit_length()-1 + if n not in basis: + basis[n]=x + return + x^=basis[n] + + +def remainder(basis, x): + for n in sorted(basis, reverse=True): + if x>>n & 1: + x^=basis[n] + return x + + +def main(): + path=Path(__file__).resolve().parent/"pinned"/"strong-bit.json.gz" + data=path.read_bytes() + assert sha256(data).hexdigest()=="74e93daf2b7acf794ffb51f92f03f51556f68126d41ee13a8969bddb4cbe6326" + src=json.loads(gzip.decompress(data)) + tape=src["program"] + assert tape[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]] + assert [src["frames"][str(c)]["dim"] for c in (326,531,1)]==[6,7,8] + def run(mode): + return interpret(src, tape, mode) + old=run("original") + alt=run("changed") + oracle=run("oracle") + assert old["package_at_8075"]==alt["package_at_8075"]==oracle["package_at_8075"] + assert old["first_state"]==oracle["first_state"] + assert old["final"]==oracle["final"] + assert old["clears"]==oracle["clears"] and len(old["clears"])==3433 + assert all(v==((1<>i&1], + "checks":alt["checks"],"uncorrected_wrong_public_rows":errors, + "only_wrong_owner_at_first_reader":different,"oracle_first_state_exact":True, + "oracle_final_map_exact":True,"oracle_original_clear_values_preserved":3433, + "early_hub_arrivals":receipts,"three_original_readout_demands_rank":len(demand)} + print(json.dumps(report,indent=2)) + + +def interpret(src, tape, mode): + chart=dict(enumerate(src["start"])) + vals={i:1<8072 and op=="ADD" and args[0]==2326] + assert read_clocks==[10137,30079] + for i,row in enumerate(tape): + if i==8068: + residual=vals[1857]^vals[2224] + if i==10137: + if mode=="oracle": + vals[2326]^=residual + insert(stock,vals[2326]) + first_state=(chart.copy(),vals.copy()) + if i in (8075,10138,10141): + contract.append(vals[row[1]]) + if i in read_clocks: + live={} + for owner,c in chart.items(): + if c==531 and owner!=2326: + insert(live,vals[owner]) + checks[i]={ + "residual_in_retained_history":remainder(stock,residual)==0, + "residual_in_live_other_owners":remainder(live,residual)==0, + "historical_rank":len(stock),"other_live_rank":len(live)} + if mode!="original" and i in (8070,8071): + continue + if mode!="original": + row={8073:["INIT",2327,531],8074:["ADD",2327,2326,531], + 8075:["MOVE",2327,531,1]}.get(i,row) + op,d,*args=row + if op=="INIT": + assert d not in chart + chart[d],vals[d]=args[0],0 + elif op=="CLEAR": + assert chart.pop(d)==args[0] + clears.append((i,d,args[0],vals[d])) + vals.pop(d) + elif op=="ADD": + a,c=args + assert chart[a]==c==chart[d] + vals[d]^=vals[a] + elif op=="MOVE": + a,b=args + assert chart[d]==a + chart[d]=b + else: + assert op=="SWAP" + a,=args + vals[a],vals[d]=vals[d],vals[a] + chart[a],chart[d]=chart[d],chart[a] + if chart[a]==531: + insert(stock,vals[a]) + if chart.get(d)==531: + insert(stock,vals[d]) + if i==8075: + package_at_8075=vals[2327] + assert chart==dict(enumerate(src["final"])) + assert residual + return {"checks":checks,"residual":residual,"first_state":first_state,"final":vals, + "clears":clears,"package_at_8075":package_at_8075,"contract_rows":contract} + + +if __name__=="__main__": + main() diff --git a/research/p104-single-export-parity/reverse_audit.py b/research/p104-single-export-parity/reverse_audit.py new file mode 100644 index 0000000000..00bdf113a4 --- /dev/null +++ b/research/p104-single-export-parity/reverse_audit.py @@ -0,0 +1,254 @@ +#!/usr/bin/env python3 +"""Single-readout chart-510 substitutions: all surviving pre-MOVE one-owner recodes. + +No non-stdlib imports. Default source is a copy of the graph blob from exact +commit 99878b566bfcce80ef7ae2650a1231a203361445; it is checked by both gzip +and expanded SHA-256. Original clocks are preserved as stable labels. +""" +import gzip,hashlib,json,sys +from collections import Counter,defaultdict +from pathlib import Path + +HERE=Path(__file__).resolve().parent +GZIP_SHA='74e93daf2b7acf794ffb51f92f03f51556f68126d41ee13a8969bddb4cbe6326' +EXPANDED_SHA='b096d6df2a0c4688296b13ab0cfd50fec1c7dec732819c624ddd7a745a144b69' +A=(2336,2344,2416,2439,2448,2451,2482,2655,2698) +B=(2359,2362,2372,2394,2397,2408,2416,2419,2425,2431,2434,2465,2484,2518,2530,2571,2576,2584,2600,2617,2623,2626,2778) + +def digest(data): return hashlib.sha256(data).hexdigest() +def load(path): + raw=Path(path).read_bytes() + if digest(raw)!=GZIP_SHA: raise ValueError('compressed input SHA mismatch') + expanded=gzip.decompress(raw) + if digest(expanded)!=EXPANDED_SHA: raise ValueError('expanded input SHA mismatch') + graph=json.loads(expanded) + assert graph['public']==630 and len(graph['program'])==39600 and len(graph['frames'])==636 + assert graph['program'][10034:10040]==[ + ['INIT',2828,510],['ADD',2828,2337,510],['MOVE',2828,510,1], + ['INIT',2829,510],['ADD',2829,2335,510],['MOVE',2829,510,1]] + return graph + +def bits(x): return [i for i in range(x.bit_length()) if x>>i&1] +def rowxor(it): + z=0 + for x in it:z^=x + return z + +class Basis: + def __init__(self,seq=()): + self.b={} + for lab,row in seq:self.add(lab,row) + def add(self,lab,row): + # Provenance is a frozenset of physical source labels (cancels repeated labels). + cert=frozenset((lab,)) + while row: + p=row.bit_length()-1 + if p not in self.b:self.b[p]=(row,cert);return + a,c=self.b[p];row^=a;cert=cert.symmetric_difference(c) + def get(self,row): + cert=frozenset() + while row: + p=row.bit_length()-1 + if p not in self.b:return None + a,c=self.b[p];row^=a;cert=cert.symmetric_difference(c) + return sorted(cert,key=repr) + +def changed(P,which): + assert which in ('a','b') + lo,hi,owner,donors=(10037,10040,2829,A) if which=='a' else (10034,10037,2828,B) + new=[(f'{which}:init',['INIT',owner,1])]+[(f'{which}:add:{j}',['ADD',owner,d,1]) for j,d in enumerate(donors)] + return [(i,row) for i,row in enumerate(P[:lo])]+new+[(i,row) for i,row in enumerate(P[hi:],hi)] + +def trace(G,tape,inject=None): + n=G['public']; frames=dict(enumerate(G['start'])); v={i:1<>i)&1)==((dual[i]>>o)&1) + for o in range(630) for i in range(630)) + +def insert_before(tape,clock,extra): + out=[];seen=0 + for label,row in tape: + if label==clock: out.extend(extra);seen+=1 + out.append((label,row)) + assert seen==1 + return out + +def positive_control(G,tape,reference): + # A deliberate legal fault, using an actually live, separate donor at chart 0 + # on the unchanged first MOVE. The exact same local ADD cancels it. This is + # a scanner test, not a claimed repair of either target rank-one defect. + fault=['ADD',630,223,0] + faulty=insert_before(tape,2,[('control:fault',fault)]) + bad,_=trace(G,faulty) + sig,dual=signatures(G,faulty) + target=sig[2][0];residual=1<<223 + assert target and all((a^b)==(residual if target>>i&1 else 0) + for i,(a,b) in enumerate(zip(reference,bad))) + report,live,owner,hist=forward_screen(G,faulty,sig,residual,target) + own=[x for x in live if x['clock']==2] + assert own and 630 not in own[0]['live_witness'] + repaired=insert_before(faulty,2,[('control:repair',fault)]) + assert trace(G,repaired)[0]==reference + # Donor 224 is also live at chart 0 but is the wrong correction. + wrong=insert_before(faulty,2,[('control:wrong',['ADD',630,224,0])]) + assert trace(G,wrong)[0]!=reference + return {'clock':2,'owner':630,'sender_chart':0,'corrupt_donor':223, + 'legal_witness':own[0]['live_witness'],'bad_control_donor':224, + 'matching_slots':len(report),'legal_live_hits':len(live), + 'exact_tape_repaired':True,'wrong_donor_rejected':True} + +def main(): + path=Path(sys.argv[1]) if len(sys.argv)>1 else HERE/'strong-bit.json.gz' + G=load(path);P=G['program'];old=list(enumerate(P));base,old_clears=trace(G,old) + assert base==[(1<0 and trace(G,tape,(near,residual))[0]!=base + control=positive_control(G,tape,forms) + result['branches'][which]={ + 'readout_owners':list(A if which=='a' else B), + 'removed_move_clock':10039 if which=='a' else 10036, + 'residual':bits(residual),'output_signature':bits(wanted),'separator':bits(ell), + 'explicit_nonzero_kernel_input':bits(collision), + 'separator_dot_target':1,'surviving_move_slots':len(sigs), + 'move_slots_odd_against_separator':len(odd), + 'exact_signature_matches':len(matches),'live_donor_hits':len(live), + 'owner_only_overgrant_hits':len(owner),'historical_span_hits':len(hist), + 'output_operator_rank':len(Basis(enumerate(forms)).b), + 'move_signature_span_rank':len(span.b),'private_clear_count':len(clears), + 'nonzero_symbolic_clears':sum(bool(v) for _,_,v in clears), + 'additional_cochart_adds':8 if which=='a' else 22, + 'removed_paid_move_rank':1, + 'signature_nearest_clock':near,'signature_min_hamming_distance':near_dist, + 'oracle_at_nearest_rejected':True,'positive_control':control} + print(which, 'separator pairs 1 with target and 0 with all',len(sigs), + 'surviving MOVE signatures; signature span rank',len(span.b), + '; legal synthetic correction at clock 2 passed',flush=True,file=sys.stderr) + # Actually exercise the graph loader's corruption gate on a changed byte. + import tempfile + original=path.read_bytes() + with tempfile.TemporaryDirectory(prefix='p104-corruption-') as tmp: + broken=Path(tmp)/'broken.gz';broken.write_bytes(original[:-1]+bytes([original[-1]^1])) + try:load(broken) + except ValueError as exc:assert str(exc)=='compressed input SHA mismatch' + else:raise AssertionError('corrupted graph was accepted') + result['input_corruption_rejected']=True + # Deterministic comparison is optional: no source files or receipts are changed. + print(json.dumps(result,sort_keys=True,indent=2)) + +if __name__=='__main__':main() diff --git a/research/p104-single-export-parity/shorter_ingress.py b/research/p104-single-export-parity/shorter_ingress.py new file mode 100644 index 0000000000..aa0a479647 --- /dev/null +++ b/research/p104-single-export-parity/shorter_ingress.py @@ -0,0 +1,180 @@ +#!/usr/bin/env python3 +"""All chart-1 rank-two/rank-four ingresses vs every cheaper existing sender. + +Requires only the Python standard library. The optional argument is a local +copy of the pinned gzip input; both compressed and expanded hashes are checked. +Clocks are zero-based in the source graph. See README.md for exact scope. +""" +import gzip, hashlib, json, sys, tempfile +from collections import Counter +from fractions import Fraction +from pathlib import Path + +HERE=Path(__file__).resolve().parent +CSHA='74e93daf2b7acf794ffb51f92f03f51556f68126d41ee13a8969bddb4cbe6326' +ESHA='b096d6df2a0c4688296b13ab0cfd50fec1c7dec732819c624ddd7a745a144b69' +def sha(x):return hashlib.sha256(x).hexdigest() +def load(path): + raw=Path(path).read_bytes() + if sha(raw)!=CSHA:raise ValueError('compressed source hash mismatch') + expanded=gzip.decompress(raw) + if sha(expanded)!=ESHA:raise ValueError('expanded source hash mismatch') + g=json.loads(expanded) + assert g['public']==630 and len(g['frames'])==636 and len(g['program'])==39600 + return g + +def support(x):return [i for i in range(x.bit_length()) if (x>>i)&1] +def dot(a,b):return (a&b).bit_count()&1 +class Basis: + def __init__(self):self.rows={} + def add(self,x): + while x: + p=x.bit_length()-1 + if p not in self.rows:self.rows[p]=x;return + x^=self.rows[p] + def reduce(self,x): + result=0 + while x: + p=x.bit_length()-1 + if p in self.rows:x^=self.rows[p] + else:result|=1<1 else HERE/'strong-bit.json.gz' + g=load(path);P=g['program'];F=g['frames'];dims={int(i):v['dim'] for i,v in F.items()} + dcount=Counter(dims.values());assert dict(sorted(dcount.items()))=={0:1,1:111,2:153,4:70,6:180,7:120,8:1} + ident=[[Fraction(int(i==j)) for j in range(8)] for i in range(8)] + assert projector(F['1'])==ident + candidates=sorted(i for i,d in dims.items() if d in (6,7)) + for c in candidates: + p=projector(F[str(c)]) + assert matrix_mul(p,ident)==matrix_mul(ident,p)==p + # Also verify the two original rank-four sources' rational projectors. + for c in (506,509):projector(F[str(c)]) + n=g['public'];fr=dict(enumerate(g['start']));v={i:1<=n and fr.pop(d)==args[0];clear_count+=1;dirty_clears+=int(bool(v.pop(d))) + else:raise ValueError(op) + if d in fr:hist[fr[d]].add(v[d]) + assert fr==dict(enumerate(g['final'])) + assert [v[i] for i in range(n)]==[(1<>i)&1)==((dual[i]>>o)&1) for o in range(n) for i in range(n)) + assert dict(counts)=={'rank_4_arrivals':2,'rank_4_sender_checks':600,'rank_2_arrivals':180,'rank_2_sender_checks':21600} + assert len(checks)==len(positive)==182 and checks[0]['clock']==6908 + assert clear_count==dirty_clears==3433 + with tempfile.TemporaryDirectory(prefix='p104-bad-') as tmp: + b=Path(tmp)/'bad.gz';raw=path.read_bytes();b.write_bytes(raw[:-1]+bytes([raw[-1]^1])) + try:load(b) + except ValueError as e:assert str(e)=='compressed source hash mismatch' + else:raise AssertionError('corrupted source accepted') + output={'source_compressed_sha256':CSHA,'source_expanded_sha256':ESHA, + 'source':'#8036 commit 99878b566bfcce80ef7ae2650a1231a203361445 graph blob', + 'counts':dict(sorted(counts.items())), 'individual_cheaper_donor_hits':0, + 'cheaper_histories_pooled_hits':0,'chart1_free_history_hits':0, + 'rational_candidate_projectors_verified':len(candidates),'output_rows':630, + 'original_private_clears':clear_count,'symbolically_dirty_private_clears':dirty_clears, + 'positive_original_sender_controls':len(positive),'corrupted_input_rejected':True, + 'explicit_short_separators':{'6908':[47,48,52,58],'8075':[1,71]}, + 'checks':checks} + print(json.dumps(output,sort_keys=True,indent=2)) +if __name__=='__main__':main() diff --git a/research/p104-single-export-parity/terminal_cut.py b/research/p104-single-export-parity/terminal_cut.py new file mode 100644 index 0000000000..84cb924ff2 --- /dev/null +++ b/research/p104-single-export-parity/terminal_cut.py @@ -0,0 +1,51 @@ +# SPDX-License-Identifier: Apache-2.0 +"""Replay the saturated chart-1 input cut on Ali Romman's #8027 tape and #8036 lists.""" +from collections import Counter +from gzip import decompress +from hashlib import sha256 +import json +from pathlib import Path +import sys + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +from carrier_invariant import EXPANDED_SHA, SHA, forward, rank, tape + + +def report(path): + path = path / 'strong-bit.json.gz' if path.is_dir() else path + packed = path.read_bytes() + unpacked = decompress(packed) + assert sha256(packed).hexdigest() == SHA and sha256(unpacked).hexdigest() == EXPANDED_SHA + word = json.loads(unpacked) + top = [i for i,chart in enumerate(word['final']) if chart == 1] + classes = Counter(('first_rail' if i < 111 else 'second_rail' if i < 222 else 'helper', + word['frames'][str(word['start'][i])]['dim']) for i in top) + assert classes == {('first_rail',1):111, ('helper',0):391, ('helper',4):3} + arrivals = [row for row in word['program'] if row[0] == 'MOVE' and row[3] == 1] + ranks = Counter(8-word['frames'][str(row[2])]['dim'] for row in arrivals) + assert word['start'].count(1) == 0 and len(top) == len(arrivals) == 505 + assert ranks == {1:323, 2:180, 4:2} + assert not any(row[0]=='MOVE' and row[2]==1 for row in word['program']) + native, _, _, native_history = forward(word,tape(word,None)) + assert rank(native[i] for i in top) == rank(native_history) == len(top) + results = {} + for missing in (None, 'a', 'b'): + instructions = tape(word,missing) + count = sum(row[0]=='MOVE' and row[3]==1 for _,row in instructions) + rows, _, _, history = forward(word,instructions,noise=True) + target_rank = rank(rows[i] for i in top) + history_rank = rank(history) + merged_rank = rank(rows+history) + expected_top = 505 - int(missing is not None) + expected_full = 630 - int(missing is not None) + assert count == target_rank == history_rank == expected_top + assert rank(rows) == merged_rank == expected_full + results['original' if missing is None else 'omit_'+missing] = { + 'incoming_moves':count, 'formal_top_public_rank':target_rank, + 'formal_top_history_rank':history_rank, 'formal_public_and_top_history_rank':merged_rank} + return {'source_sha256':SHA, 'initial_top_fields':0, 'prescribed_top_output_rank':len(top), + 'original_ingress_by_paid_rank':dict(ranks), 'replays':results} + + +if __name__ == '__main__': + print(json.dumps(report(Path(sys.argv[1])), sort_keys=True, indent=2)) diff --git a/research/p104-single-export-parity/verify.py b/research/p104-single-export-parity/verify.py new file mode 100644 index 0000000000..f74b3765b7 --- /dev/null +++ b/research/p104-single-export-parity/verify.py @@ -0,0 +1,42 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +"""Authenticate and replay both parity proofs, chart cut, and conditional price.""" +from hashlib import sha1,sha256 +from pathlib import Path +import gzip,json,subprocess,sys + +HERE=Path(__file__).resolve().parent +sys.path.insert(0,str(HERE)) + +def main(): + if sys.flags.optimize:raise RuntimeError('Assertions must remain enabled') + meta=json.loads((HERE/'SOURCES.json').read_bytes()) + for name,expected in meta['retained_files_sha256'].items(): + assert sha256((HERE/name).read_bytes()).hexdigest()==expected,name + graph=HERE/'pinned'/'strong-bit.json.gz';raw=graph.read_bytes();g=meta['vendored_graph'] + assert sha256(raw).hexdigest()==g['sha256'] + assert sha256(gzip.decompress(raw)).hexdigest()==g['expanded_sha256'] + assert sha1(b'blob '+str(len(raw)).encode()+b'\0'+raw).hexdigest()==g['git_blob'] + from shorter_ingress import projector,matrix_mul + frames=json.loads(gzip.decompress(raw))['frames'] + small,mid,large=[projector(frames[str(i)]) for i in (326,531,1)] + assert matrix_mul(small,mid)==matrix_mul(mid,small)==small + assert matrix_mul(mid,large)==matrix_mul(large,mid)==mid + print('PASS_RELAY_PROJECTOR_NESTING',flush=True) + checks=[('carrier_invariant.py',[str(graph)],'CARRIER-INVARIANT.json','FORWARD_NOISE'), + ('reverse_audit.py',[str(graph)],'REVERSE-RESULT.json','REVERSE_PARITY'), + ('terminal_cut.py',[str(graph)],'TERMINAL-CUT.json','TERMINAL_INTERFACE_CUT'), + ('shorter_ingress.py',[str(graph)],'SHORTER-INGRESS.json.gz','CHEAPER_INGRESS_CUT'), + ('relay_example.py',[],'RELAY.json','RELAY_DIAGNOSTIC'), + ('verify_funding.py',[],'FUNDING.json','CONDITIONAL_FUNDING')] + for script,args,expected,label in checks: + result=subprocess.run([sys.executable,'-I','-B',str(HERE/script),*args], + capture_output=True,text=True,timeout=480,check=True) + actual=json.loads(result.stdout);expected_data=(HERE/expected).read_bytes() + if expected.endswith('.gz'):expected_data=gzip.decompress(expected_data) + witness=json.loads(expected_data) + assert actual==witness,'replayed '+label+' does not match the checked receipt' + print('PASS_'+label,flush=True) + print('PASS_SINGLE_EXPORT_PARITY_AND_CONDITIONAL_FUNDING',flush=True) + +if __name__=='__main__':main() diff --git a/research/p104-single-export-parity/verify_funding.py b/research/p104-single-export-parity/verify_funding.py new file mode 100644 index 0000000000..b53b9e5ec1 --- /dev/null +++ b/research/p104-single-export-parity/verify_funding.py @@ -0,0 +1,179 @@ +"""Reprice the two sufficient P104 invoices at the paper's exact target. + +Run with CPython 3.12: python3.12 -IB verify_funding.py +The independent moment bounds below use rational log and exponential series. +The pinned reference encloses powers by successive integer square roots. +""" +from fractions import Fraction as Q +from functools import lru_cache +from hashlib import sha256 +from pathlib import Path +import importlib.util +import json + + +ROOT = Path(__file__).resolve().parent +PIN = ROOT / "pinned" +GRID = 1 << 160 + + +def load_reference(): + path = PIN / "price_audit.py" + expected = "ca650d573f605bf51a8806a772903b6775cd036dfbfe7f043eccd3e51bc9977b" + assert sha256(path.read_bytes()).hexdigest() == expected + spec = importlib.util.spec_from_file_location("p104_reference_price", path) + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + return module + + +def down(x): + return Q((x * GRID).__floor__(), GRID) + + +def up(x): + return Q((x * GRID).__ceil__(), GRID) + + +@lru_cache(None) +def log_series(u): + # log(u) = 2 atanh(z), with the omitted denominators at least 2N+1. + z = (u - 1) / (u + 1) + assert 0 <= z <= Q(1, 3) + n = 64 + part = 2 * sum(z ** (2*j+1) / (2*j+1) for j in range(n)) + tail = 2 * z ** (2*n+1) / ((2*n+1) * (1-z*z)) + return down(part), up(part+tail) + + +def exp_series(u): + # Terms after degree n have successive ratio at most u/(n+2). + assert 0 <= u <= Q(1, 2) + n = 42 + term = total = Q(1) + for j in range(1, n+1): + term *= u/j + total += term + tail = term*u/(n+1)/(1-u/(n+2)) + return down(total), up(total+tail) + + +@lru_cache(None) +def power(r, exponent): + assert r >= 1 and exponent >= 0 + if r == 1 or exponent == 0: + return Q(1), Q(1) + h = r.bit_length()-1 + l2, u2 = log_series(Q(2)) + lm, um = log_series(Q(r, 1 << h)) + lo = down((h*l2+lm)*exponent/16) + hi = up((h*u2+um)*exponent/16) + elo, _ = exp_series(lo) + _, ehi = exp_series(hi) + return down(elo**16), up(ehi**16) + + +def moment(hist, exponent): + lo = hi = Q(0) + for r, count in hist.items(): + a, b = power(r, exponent) + lo += count*a + hi += count*b + return lo, hi + + +def surplus(target, paid, c, v, z, w, weight, keep): + t = 1-c + tl, th = moment(target, t) + pl, ph = moment(paid, t) + gl, gh = moment(paid, t+z) + ol, oh = moment(target, t-w) + cl, ch = power(12, z) + kl, kh = power(keep, w) + lo = 1-(ph/tl)**v-weight*(gh/(tl*cl))**v-(oh*kh/tl)**v + hi = 1-(pl/th)**v-weight*(gl/(th*ch))**v-(ol*kl/th)**v + return lo, hi + + +def difference(target, paid, k): + tl, th = moment(target, 1-k) + pl, ph = moment(paid, 1-k) + return tl-ph, th-pl + + +def agree(interval, reference): + assert max(interval[0], reference[0]) <= min(interval[1], reference[1]) + + +def main(): + ref = load_reference() + k, c, g = Q(194523, 50000000), Q(70084296829703, 2**54), Q(1, 10**17) + assert k == ref.K and g == ref.G + target, base = ref.load_inputs() + cases = {"baseline": (0, 0), "24 fusions": (24, 0), "25 fusions": (25, 0), + "one net rank-one deletion": (0, 1), "36 net rank-one deletions": (0, 36)} + report = {} + for label, (fusions, deletions) in cases.items(): + paid = base.copy() + paid[1] -= 2*fusions+deletions + paid[2] += fusions + assert min(paid.values()) > 0 + assert sum(paid.values()) == 104904-fusions-deletions + first_moment = sum(r*n for r, n in paid.items()) + assert first_moment == 285600-deletions + raw = difference(target, paid, k) + split = surplus(target, paid, c, 268, ref.Z, ref.W, ref.WEIGHT, 15) + agree(raw, ref.raw_difference(target, paid, k)) + agree(split, ref.powered_surplus(target, paid, c, 268, ref.Z, ref.W, ref.WEIGHT, 15)) + if deletions or fusions == 25: + assert raw[0] > 0 and split[0] > Q(2, 2**50) + ref.power_and_enumeration_checks(268, 2**50, c, sum(paid.values())) + else: + assert raw[1] < 0 and split[1] < 0 + report[label] = {"paid_count": sum(paid.values()), "paid_rank_sum": first_moment, + "raw": ref.enclosing_text(*raw, 18), + "split_268": ref.enclosing_text(*split, 18)} + shortenings = {} + for r in sorted(base): + if r == 1: + continue + paid = base.copy() + paid[r] -= 1 + paid[r-1] += 1 + assert sum(paid.values()) == 104904 and sum(q*n for q,n in paid.items()) == 285599 + raw = difference(target, paid, k) + split = surplus(target, paid, c, 268, ref.Z, ref.W, ref.WEIGHT, 15) + agree(raw, ref.raw_difference(target, paid, k)) + agree(split, ref.powered_surplus(target, paid, c, 268, ref.Z, ref.W, ref.WEIGHT, 15)) + assert raw[0] > Q(84,100) and split[0] > Q(79,100000) + shortenings[str(r)] = {"raw": ref.enclosing_text(*raw,18), + "split_268": ref.enclosing_text(*split,18)} + ref.power_and_enumeration_checks(268, 2**50, c, 104904) + assert len(shortenings) == 13 + report["single rank shortenings"] = shortenings + pos = surplus(ref.POS_TARGET, ref.POS_PAID, ref.POS_C, 128, Q(19,64), Q(23,64), Q(2), 16) + agree(pos, ref.powered_surplus(ref.POS_TARGET, ref.POS_PAID, ref.POS_C, 128, + Q(19,64), Q(23,64), Q(2), 16)) + assert pos[0] > Q(2, 2**15) + assert ref.bit_debit(268, 2**50, c) == 21 and ref.positive_debit() == 10 + levels = ref.stage_prices(c, 21) + cap = ref.POS_C-Q(10, 1600000) + strict, functional, positive_gap = ref.signed_margins(k, g, ref.ORDINARY, cap) + assert len(strict) == 54 and len(functional) == 4 + assert min(*strict, *functional, positive_gap) == Q(1, 10**18) + assert min(ref.signed_margins(k, 0, ref.ORDINARY, cap)[0]) == 0 + assert min(ref.signed_margins(k, g, k+4*g, cap)[0]) == 0 + assert ref.signed_margins(k, g, ref.ORDINARY, k+5*g)[2] == 0 + report["shared application"] = { + "positive_split_128": ref.enclosing_text(*pos, 18), "positive_cap": str(cap), + "ordinary_gate_margin": str(ref.ORDINARY-k-4*g), "positive_gate_margin": str(positive_gap), + "last_stage_headroom": str(levels[-1][2]-ref.ORDINARY), + "stage_rates": [str(level[3]) for level in levels], + "minimum_signed_gate_margin": str(min(*strict,*functional,positive_gap)), + "strict_gates": len(strict), "functional_gates": len(functional), + "kappa_target": str(k), "status": "conditional prices; physical word required"} + print(json.dumps(report, indent=2, sort_keys=True)) + + +if __name__ == "__main__": + main()