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-retimed-dyadic-endpoint/ENDPOINT-OVERLAY.json b/research/p104-retimed-dyadic-endpoint/ENDPOINT-OVERLAY.json new file mode 100644 index 0000000000..d50b07e24a --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/ENDPOINT-OVERLAY.json @@ -0,0 +1,13 @@ +{ + "path": "installations.py", + "parent_head": "e26425171238e142cc9ffb510fd953f344bd41c7", + "old_sha256": "2244e7e27f7348575944eb652a741861a0a04d77b18c297db221ef74b3116a16", + "new_sha256": "949365269b77d0b85a6933e421ec49a78588fb6545756ca95c2a75f8151ca47b", + "edits": [ + [ + "BINARY_C = Q(4484997569314581, 2**60)", + "BINARY_C = Q(287039844436133239, 2**66)" + ] + ], + "append": "\n# Refitted fixed-inventory endpoint; source controller and recipe remain unchanged.\nDYADIC_ENDPOINT = Profile(tuple(2*10**12*16**i for i in range(7)), 36000,\n Q(39,10000), Q(\".003890115286594461\"), 10**21)\nPROFILES[\"dyadic-endpoint\"] = DYADIC_ENDPOINT\n" +} diff --git a/research/p104-retimed-dyadic-endpoint/ENDPOINT-PRICE.json b/research/p104-retimed-dyadic-endpoint/ENDPOINT-PRICE.json new file mode 100644 index 0000000000..8bfcf5988a --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/ENDPOINT-PRICE.json @@ -0,0 +1,198 @@ +{ + "scope": "finite financial and first-placement refit of pinned e264 source with a changed binary trial; physical production and full independent proof remain unexecuted", + "pinned_head": "e26425171238e142cc9ffb510fd953f344bd41c7", + "profile": { + "ranks": [ + 2000000000000, + 32000000000000, + 512000000000000, + 8192000000000000, + 131072000000000000, + 2097152000000000000, + 33554432000000000000 + ], + "numerical_H": 36000, + "kappa": "3890115286594461/1000000000000000000", + "kappa_decimal": "0.003890115286594461", + "gap": "1/1000000000000000000000", + "binary_c": "287039844436133239/73786976294838206464", + "binary_c_decimal": "0.00389011528659446112769684095189504091649723704904", + "positive_c": "2092819/536870912", + "positive_cap": "783955157/201326592000", + "positive_cap_decimal": "0.00389394738773504892985026041666666666666666666667", + "positive_margin_decimal": "0.00000383210114058792485026041666666666666666666666667" + }, + "old_source_resolution_checked_separately": true, + "source_binary_tariff": { + "productive": 18906, + "paid": 104904, + "cells": 24, + "directed_margin": "191135881425181897/61353847083031545306054570474927705731", + "factor_upper_times_1000000": 1101615 + }, + "source_numerical_tariff": { + "productive": 105216, + "paid": 564144, + "cells": 54, + "directed_margin": "1162362417094264714206716158580/712832082881474022086691592938270190237", + "factor_upper_times_1000000": 1111354 + }, + "stages": [ + { + "height": 2000000000000, + "rate": "1937277412381666641/500000000000000000000", + "margin": "83461101521127/70368744177664000000000000000000000", + "margin_decimal": "1.1860535880874607528312481008470058441162109375E-21" + }, + { + "height": 32000000000000, + "rate": "194502652235216987/50000000000000000000", + "margin": "11558537596983499/8796093022208000000000000000000000000", + "margin_decimal": "1.3140535880874607528312481008470058441162109375E-21" + }, + { + "height": 512000000000000, + "rate": "972528759406056459/250000000000000000000", + "margin": "2565914607738511/1759218604441600000000000000000000000", + "margin_decimal": "1.4585535880874607528312481008470058441162109375E-21" + }, + { + "height": 8192000000000000, + "rate": "389011528559841301/100000000000000000000", + "margin": "10881513312180427/8796093022208000000000000000000000000", + "margin_decimal": "1.2370848380874607528312481008470058441162109375E-21" + }, + { + "height": 131072000000000000, + "rate": "778023057318093297/200000000000000000000", + "margin": "3114244492484239/1759218604441600000000000000000000000", + "margin_decimal": "1.7702430412124607528312481008470058441162109375E-21" + }, + { + "height": 2097152000000000000, + "rate": "778023057318888899/200000000000000000000", + "margin": "1930857522126479/1759218604441600000000000000000000000", + "margin_decimal": "1.0975654289077732528312481008470058441162109375E-21" + }, + { + "height": 33554432000000000000, + "rate": "778023057318892201/200000000000000000000", + "margin": "27007124810227343/1759218604441600000000000000000000000", + "margin_decimal": "1.53517730781387302840812481008470058441162109375E-20" + } + ], + "signed": { + "strict": 54, + "functional": 4, + "smallest_margin": "1/10000000000000000000000", + "ordinary_margin": "1/1000000000000000000000", + "positive_margin": "588610735194305257/153600000000000000000000" + }, + "receipt": { + "A_lower_in_this_price": 26427326172637272976, + "kappa": "3890115286594461/1000000000000000000", + "binary_H": [ + 2000000000000, + 32000000000000, + 512000000000000, + 8192000000000000, + 131072000000000000, + 2097152000000000000, + 33554432000000000000 + ], + "numerical_H": 36000, + "width_logs": [ + 184000000000000, + 2944000000000000, + 47104000000000000, + 753664000000000000, + 12058624000000000000, + 192937984000000000000, + 3087007744000000000000, + 3312000 + ], + "stage_rates": [ + "1937277412381666641/500000000000000000000", + "194502652235216987/50000000000000000000", + "972528759406056459/250000000000000000000", + "389011528559841301/100000000000000000000", + "778023057318093297/200000000000000000000", + "778023057318888899/200000000000000000000", + "778023057318892201/200000000000000000000" + ], + "signed_gate": { + "strict": 54, + "functional": 4, + "smallest_margin": "1/10000000000000000000000", + "ordinary_margin": "1/1000000000000000000000", + "positive_margin": "588610735194305257/153600000000000000000000" + }, + "geometry": { + "public_offset_above_2_to_A": 4, + "first_extent_bits_minus_b": -35791394008032165515, + "last_extent_bits_minus_b": -35791394008032165514, + "minimum_width": 18325193732112468747520, + "log2_axis_count": 35791394008032165442, + "largest_axis_width": 25185954575304774473046, + "private_clock_log2_upper": 25827103663970322030125712, + "actual_dense_root_entry_log2": 50371909150609548946092 + }, + "binary_cuts": [ + 2008032128579, + 34008032128643, + 546008032128707, + 8738008032128771, + 139810008032128835, + 2236962008032128899, + 35791394008032128963 + ], + "public_exponent_A": 35791394008032165519, + "first_public_offset": 4, + "initial_s": 35791394008032165520, + "stage_and_outer_fixed_log_overhead": 1984, + "retimed_first_stripe_margin": 17895697004016080514, + "retimed_all_size_margin_floor": 17336456472640578186, + "absolute_log2_private_control_envelope": 34359738368000000000004, + "storage_upper": "6.2 p T < 297.6 n bits", + "log2_fixed_setup_and_install_le": 513, + "log2_ordinary_clock_le": 586406199296000000000097, + "log2_C_le": 586406199296000007921699 + }, + "first_stage_bound": 162402, + "later_stage_bound": 28726102, + "outer_stop_log2_ceiling": 1182, + "outer_full_cofinal_constant_log2_le": 1591, + "outer_original_financial_checks": { + "small_stop_tail_factor_log2": 1591, + "private_prefix_log2": 126082079, + "controls_prefix_log2": 5081414, + "private_prefix_after_input_log2": 84484466, + "early_log2_C_bound": 84500000, + "tail_log2_fixed_factor_including_b_to_n": 1434, + "tail_unit": "(1 + B + Z) * n * (1 + log2(n))^(1-kappa)" + }, + "first_positive_external": { + "period_bit_length": 11, + "period_sha256": "3b3ac26a1e5dfbab1b3a8005a8a3770abac420af4c02441bb58fe321fea8d453", + "ticket_bit_lengths": [ + 0, + 9, + 10 + ], + "ticket_sha256": [ + "6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d", + "f7a9e5ef9dbd90c8ced3da1e10282b63e5d5184ec95552cb7e0cba7f22ac273d", + "dfe894228db98ec56cc959f75bde08f03b2b57686246aee0fe164dbfa520741f" + ], + "root_tag": [ + "root", + "rotated", + 0, + 4080, + 1 + ], + "per_target_probability": "1/624", + "actual_position_probe": "first swap (1,ticket[1],1) was issued by ComplexRaw.align" + }, + "controls": "reject g=0, g=10^-17, ordinary equality and positive equality" +} diff --git a/research/p104-retimed-dyadic-endpoint/ENDPOINT-RUNTIME.json b/research/p104-retimed-dyadic-endpoint/ENDPOINT-RUNTIME.json new file mode 100644 index 0000000000..ddbff0a09f --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/ENDPOINT-RUNTIME.json @@ -0,0 +1,127 @@ +{ + "arithmetic_and_stock": { + "A_lower_in_this_price": 26427326172637272976, + "absolute_log2_private_control_envelope": 34359738368000000000004, + "binary_H": [ + 2000000000000, + 32000000000000, + 512000000000000, + 8192000000000000, + 131072000000000000, + 2097152000000000000, + 33554432000000000000 + ], + "binary_cuts": [ + 2008032128579, + 34008032128643, + 546008032128707, + 8738008032128771, + 139810008032128835, + 2236962008032128899, + 35791394008032128963 + ], + "first_public_offset": 4, + "geometry": { + "actual_dense_root_entry_log2": 50371909150609548946092, + "first_extent_bits_minus_b": -35791394008032165515, + "largest_axis_width": 25185954575304774473046, + "last_extent_bits_minus_b": -35791394008032165514, + "log2_axis_count": 35791394008032165442, + "minimum_width": 18325193732112468747520, + "private_clock_log2_upper": 25827103663970322030125712, + "public_offset_above_2_to_A": 4 + }, + "initial_s": 35791394008032165520, + "kappa": "3890115286594461/1000000000000000000", + "log2_C_le": 586406199296000007921699, + "log2_fixed_setup_and_install_le": 513, + "log2_ordinary_clock_le": 586406199296000000000097, + "numerical_H": 36000, + "public_exponent_A": 35791394008032165519, + "retimed_all_size_margin_floor": 17336456472640578186, + "retimed_first_stripe_margin": 17895697004016080514, + "signed_gate": { + "functional": 4, + "ordinary_margin": "1/1000000000000000000000", + "positive_margin": "588610735194305257/153600000000000000000000", + "smallest_margin": "1/10000000000000000000000", + "strict": 54 + }, + "stage_and_outer_fixed_log_overhead": 1984, + "stage_rates": [ + "1937277412381666641/500000000000000000000", + "194502652235216987/50000000000000000000", + "972528759406056459/250000000000000000000", + "389011528559841301/100000000000000000000", + "778023057318093297/200000000000000000000", + "778023057318888899/200000000000000000000", + "778023057318892201/200000000000000000000" + ], + "storage_upper": "6.2 p T < 297.6 n bits", + "width_logs": [ + 184000000000000, + 2944000000000000, + 47104000000000000, + 753664000000000000, + 12058624000000000000, + 192937984000000000000, + 3087007744000000000000, + 3312000 + ] + }, + "binary_recipe_count": 7, + "candidate": { + "binary_C": "287039844436133239/73786976294838206464", + "binary_H": [ + 2000000000000, + 32000000000000, + 512000000000000, + 8192000000000000, + 131072000000000000, + 2097152000000000000, + 33554432000000000000 + ], + "gap": "1/1000000000000000000000", + "kappa": "3890115286594461/1000000000000000000", + "numerical_H": 36000 + }, + "e264_git_blobs": { + "activation.py": "20525c7fa39de6300e0a01b1e0155dbc324d6940", + "check_complete.py": "3c13191ead65cfdb3c0c75e4958f5d6853939fba", + "five_exchange.py": "dbbba0ba77fc7d4ce9fc82d63e6cf9a0bd3c1b24", + "installations.py": "4feaf4ce771646cf363791b4770609f1da773140", + "machine.patch": "16b6205d1f2da87e643159add52146a4e3475211", + "raw_binary_stage.py": "444da9677aed25cc881312435d825fb5b6312f0c", + "receiver.patch": "4b7db79b29b83e17e49faa981a0b7a4c4ea21a11", + "retimed_supplier.py": "388b2cf6591d979ffc29bd3a187d35a3cc72f4cc", + "transport.py": "7006360e5b9a117a64ba77a215339ea8242a8ba3" + }, + "last_rate_margin": "27007124810227343/1759218604441600000000000000000000000", + "positive_word": { + "cells": 54, + "first_crossing": { + "per_target_probability": "1/624", + "placements": { + "36000": { + "first_tickets": [ + 0, + 324, + 648 + ], + "period": 1620 + } + }, + "root_tag": [ + "root", + "rotated", + 0, + 4080, + 1 + ] + }, + "paid_count": 564144, + "target_count": 105216 + }, + "scope": "feasible source-bound controls and exact arithmetic; no production payload or all-size proof", + "source_mutation": "BINARY_C and an installed named profile in installations.py" +} diff --git a/research/p104-retimed-dyadic-endpoint/ENDPOINT-SETUP.json b/research/p104-retimed-dyadic-endpoint/ENDPOINT-SETUP.json new file mode 100644 index 0000000000..4b3f289bd8 --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/ENDPOINT-SETUP.json @@ -0,0 +1,44 @@ +{ + "generic_66_root_error_log_upper": "409-(49/2)*H", + "measure_controls": [ + { + "intervals_overlap": true, + "isqrt_calls": 132, + "rank": 2 + }, + { + "intervals_overlap": true, + "isqrt_calls": 132, + "rank": 3 + }, + { + "intervals_overlap": true, + "isqrt_calls": 132, + "rank": 15 + }, + { + "intervals_overlap": true, + "isqrt_calls": 132, + "rank": 127 + } + ], + "positive_cap": "783955157/201326592000", + "positive_count": 1, + "scaled_signed_max_bits": 182, + "scope": "fixed-item and arithmetic guards; all-size control accounting remains a written proof", + "signed_common_scale": "3*D^2", + "sizes_in_bits": { + "binary_trial_denominator_bits": 67, + "max_binary_cut_log_bits": 65, + "max_binary_width_log_bits": 72, + "max_rank_log_bits": 65, + "positive_carrier_bits": 36001, + "public_exponent_bits": 65, + "stop_denominator_bits": 70 + }, + "source_item_allowance_bits": 274877906944, + "stage_count": 7, + "stop_10_21_selected_products_upper": 29, + "stop_10_21_squares_upper": 69, + "stop_absorption_ceiling_bits": 1182 +} diff --git a/research/p104-retimed-dyadic-endpoint/ENDPOINT-TARIFF.json b/research/p104-retimed-dyadic-endpoint/ENDPOINT-TARIFF.json new file mode 100644 index 0000000000..9c305278b2 --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/ENDPOINT-TARIFF.json @@ -0,0 +1,16 @@ +{ + "actual_e264_tariff": { + "cells": 24, + "directed_margin": "191135881425181897/61353847083031545306054570474927705731", + "factor_upper_times_1000000": 1101615, + "paid": 104904, + "productive": 18906 + }, + "binary_trial": "287039844436133239/73786976294838206464", + "cell_count": 24, + "directed_margin": "191135881425181897/61353847083031545306054570474927705731", + "independent_mass_difference": "2293630577105472279/2596148429267413814265248164610048", + "minimum_cell_fraction": "32319110759898211617413870105970683942576909013549492525472743662309915541/650036754128965941747242698242057254829358686585881864302173366356832944128", + "scope": "exact finite price/coupling; not a tape-simulation proof", + "t_denominator_bits": 67 +} diff --git a/research/p104-retimed-dyadic-endpoint/FIXED-C-CONTROL.json b/research/p104-retimed-dyadic-endpoint/FIXED-C-CONTROL.json new file mode 100644 index 0000000000..fa198606b0 --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/FIXED-C-CONTROL.json @@ -0,0 +1,198 @@ +{ + "scope": "finite financial and first-placement refit of pinned e264 source; physical production and full independent proof remain unexecuted", + "pinned_head": "e26425171238e142cc9ffb510fd953f344bd41c7", + "profile": { + "ranks": [ + 1000000000000, + 16000000000000, + 256000000000000, + 4096000000000000, + 65536000000000000, + 1048576000000000000, + 16777216000000000000 + ], + "numerical_H": 36000, + "kappa": "194505764329723/50000000000000000", + "kappa_decimal": "0.00389011528659446", + "gap": "1/100000000000000000000", + "binary_c": "4484997569314581/1152921504606846976", + "binary_c_decimal": "0.00389011528659446038230784736811074253637343645096", + "positive_c": "2092819/536870912", + "positive_cap": "783955157/201326592000", + "positive_cap_decimal": "0.00389394738773504892985026041666666666666666666667", + "positive_margin_decimal": "0.00000383210114058887985026041666666666666666666666667" + }, + "source_prior_resolution_exact_match": true, + "source_binary_tariff": { + "productive": 18906, + "paid": 104904, + "cells": 24, + "directed_margin": "82842835076019278655/81805129444042060601000009008477661941", + "factor_upper_times_1000000": 1101615 + }, + "source_numerical_tariff": { + "productive": 105216, + "paid": 564144, + "cells": 54, + "directed_margin": "1162362417094264714206716158580/712832082881474022086691592938270190237", + "factor_upper_times_1000000": 1111354 + }, + "stages": [ + { + "height": 1000000000000, + "rate": "3874554824078582539/1000000000000000000000", + "margin": "1955608949861/1099511627776000000000000000000000", + "margin_decimal": "1.7786159786382995662279427051544189453125E-21" + }, + { + "height": 16000000000000, + "rate": "3890053044658803119/1000000000000000000000", + "margin": "265891595474257/137438953472000000000000000000000000", + "margin_decimal": "1.9346159786382995662279427051544189453125E-21" + }, + { + "height": 256000000000000, + "rate": "1945057518810684071/500000000000000000000", + "margin": "258332453033297/137438953472000000000000000000000000", + "margin_decimal": "1.8796159786382995662279427051544189453125E-21" + }, + { + "height": 4096000000000000, + "rate": "3890115285598233661/1000000000000000000000", + "margin": "241985807504721/137438953472000000000000000000000000", + "margin_decimal": "1.7606784786382995662279427051544189453125E-21" + }, + { + "height": 65536000000000000, + "rate": "3890115286590454577/1000000000000000000000", + "margin": "207669555680593/137438953472000000000000000000000000", + "margin_decimal": "1.5109948848882995662279427051544189453125E-21" + }, + { + "height": 1048576000000000000, + "rate": "972528821648610763/250000000000000000000", + "margin": "141512597362001/137438953472000000000000000000000000", + "margin_decimal": "1.0296396602789245662279427051544189453125E-21" + }, + { + "height": 16777216000000000000, + "rate": "77802305731889201/20000000000000000000", + "margin": "24925661277246801/137438953472000000000000000000000000", + "margin_decimal": "1.813580549587408386287279427051544189453125E-19" + } + ], + "signed": { + "strict": 54, + "functional": 4, + "smallest_margin": "1/1000000000000000000000", + "ordinary_margin": "1/100000000000000000000", + "positive_margin": "117722147038890389/30720000000000000000000" + }, + "receipt": { + "A_lower_in_this_price": 5801742189575446161, + "kappa": "194505764329723/50000000000000000", + "binary_H": [ + 1000000000000, + 16000000000000, + 256000000000000, + 4096000000000000, + 65536000000000000, + 1048576000000000000, + 16777216000000000000 + ], + "numerical_H": 36000, + "width_logs": [ + 92000000000000, + 1472000000000000, + 23552000000000000, + 376832000000000000, + 6029312000000000000, + 96468992000000000000, + 1543503872000000000000, + 3312000 + ], + "stage_rates": [ + "3874554824078582539/1000000000000000000000", + "3890053044658803119/1000000000000000000000", + "1945057518810684071/500000000000000000000", + "3890115285598233661/1000000000000000000000", + "3890115286590454577/1000000000000000000000", + "972528821648610763/250000000000000000000", + "77802305731889201/20000000000000000000" + ], + "signed_gate": { + "strict": 54, + "functional": 4, + "smallest_margin": "1/1000000000000000000000", + "ordinary_margin": "1/100000000000000000000", + "positive_margin": "117722147038890389/30720000000000000000000" + }, + "geometry": { + "public_offset_above_2_to_A": 4, + "first_extent_bits_minus_b": -17895697004016101251, + "last_extent_bits_minus_b": -17895697004016101250, + "minimum_width": 9162596866056243844352, + "log2_axis_count": 17895697004016101179, + "largest_axis_width": 12592977287652387236523, + "private_clock_log2_upper": 12913551831985161034055560, + "actual_dense_root_entry_log2": 25185954575304774473046 + }, + "binary_cuts": [ + 1004016064322, + 17004016064386, + 273004016064450, + 4369004016064514, + 69905004016064578, + 1118481004016064642, + 17895697004016064706 + ], + "public_exponent_A": 17895697004016101255, + "first_public_offset": 4, + "initial_s": 17895697004016101256, + "stage_and_outer_fixed_log_overhead": 1984, + "retimed_first_stripe_margin": 8947848502008048386, + "retimed_all_size_margin_floor": 8668228236320297058, + "absolute_log2_private_control_envelope": 17179869184000000000004, + "storage_upper": "6.2 p T < 297.6 n bits", + "log2_fixed_setup_and_install_le": 513, + "log2_ordinary_clock_le": 293203099648000000000097, + "log2_C_le": 293203099648000007921699 + }, + "first_stage_bound": 162402, + "later_stage_bound": 28726102, + "outer_stop_log2_ceiling": 1129, + "outer_full_cofinal_constant_log2_le": 1538, + "outer_original_financial_checks": { + "small_stop_tail_factor_log2": 1591, + "private_prefix_log2": 126082079, + "controls_prefix_log2": 5081414, + "private_prefix_after_input_log2": 84484466, + "early_log2_C_bound": 84500000, + "tail_log2_fixed_factor_including_b_to_n": 1434, + "tail_unit": "(1 + B + Z) * n * (1 + log2(n))^(1-kappa)" + }, + "first_positive_external": { + "period_bit_length": 11, + "period_sha256": "3b3ac26a1e5dfbab1b3a8005a8a3770abac420af4c02441bb58fe321fea8d453", + "ticket_bit_lengths": [ + 0, + 9, + 10 + ], + "ticket_sha256": [ + "6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d", + "f7a9e5ef9dbd90c8ced3da1e10282b63e5d5184ec95552cb7e0cba7f22ac273d", + "dfe894228db98ec56cc959f75bde08f03b2b57686246aee0fe164dbfa520741f" + ], + "root_tag": [ + "root", + "rotated", + 0, + 4080, + 1 + ], + "per_target_probability": "1/624", + "actual_position_probe": "first swap (1,ticket[1],1) was issued by ComplexRaw.align" + }, + "controls": "reject g=0, g=10^-17, ordinary equality and positive equality" +} diff --git a/research/p104-retimed-dyadic-endpoint/GLOBAL-CROSSING.json b/research/p104-retimed-dyadic-endpoint/GLOBAL-CROSSING.json new file mode 100644 index 0000000000..7ac878cebf --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/GLOBAL-CROSSING.json @@ -0,0 +1,61 @@ +{ + "pivot": 8, + "negative_low": { + "1": -48972, + "2": -44892, + "3": -1980, + "4": -900, + "5": -1044, + "6": -2916, + "7": -480 + }, + "upper_tail_counts": { + "14": 666, + "15": 1110, + "21": 666, + "22": 1110, + "28": 666, + "29": 1110, + "35": 666, + "36": 1110, + "42": 666, + "43": 1110, + "49": 666, + "50": 1110, + "56": 666, + "57": 1110, + "64": 666, + "127": 222 + }, + "D_at_t_zero_and_one": [ + -85998, + 1506 + ], + "upper_bound_for_t_at_most_zero": -30678, + "price_bracket_decimal": [ + "0.003890115286594461129996942", + "0.003890115286594461129996943" + ], + "price_bracket_fractions": [ + "1945057643297230564998471/500000000000000000000000000", + "3890115286594461129996943/1000000000000000000000000000" + ], + "inner_dyadic_witnesses": [ + "4931306978008479291729931451/1267650600228229401496703205376", + "4931306978008479291729932717/1267650600228229401496703205376" + ], + "sign_numerators_at_witnesses": [ + [ + 1457154697782, + 1457195972250 + ], + [ + -534622260294, + -534579885888 + ] + ], + "common_power_scale": 5192296858534827628530496329220096, + "last_raw_report_tick_numerator": 3890115286594461, + "report_denominator": 1000000000000000000, + "damaged_high_tail_rejected": true +} diff --git a/research/p104-retimed-dyadic-endpoint/GLOBAL-PROOF.md b/research/p104-retimed-dyadic-endpoint/GLOBAL-PROOF.md new file mode 100644 index 0000000000..78030fab18 --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/GLOBAL-PROOF.md @@ -0,0 +1,44 @@ +# Why the full raw invoice has exactly one crossing + +For the complete 36-call binary circuit, write its raw difference as +$D(t)=\sum_r a_r r^t$, where $a_r$ is the productive count minus the paid +count at rank $r$. The price $c$ uses $t=1-c$. Normalizing at the rank +where the sign pattern changes gives a global monotonicity proof. + +**Lemma.** Let $p>0$. Suppose $a_r\le0$ for $r1$, because its derivative is +$x^{t-1}(1+t\log x)>0$. By summation by parts the derivative of the upper +contribution is $\sum_{j=1}^m S_j(q_j-q_{j-1})\ge0$. This proves strict +increase on the whole half-line. + +For the source word take $p=8$. The seven lower coefficients at ranks 1 +through 7 are $-48972,-44892,-1980,-900,-1044,-2916,-480$. +Above rank 8 the nonzero coefficients pair 444 labels at each of +$14,21,28,35,42,49,56$ with the same number one rank higher. +The two additional productive counts are 444 at rank 64 and 222 at rank +127. Every upper tail is at least 222. Since $D(0)=-85998$ and +$D(1)=1506$, there is exactly one crossing on $0\le t\le1$. +In particular, the raw funding condition $D(1-c)>0$ cannot resume above +a failed trial anywhere in $0\le c\le1$. For $t\le0$ all positive +coefficients occur at ranks at least eight and their sum is 18,294. Keeping +just the negative rank-one term bounds $D(t)\le-48,972+18,294=-30,678$. +The same sign dichotomy therefore holds for all real prices. + +Integer square-root enclosures at two internal dyadics independently put the +crossing $c_*$ strictly between 0.003890115286594461129996942 and +0.003890115286594461129996943. The outward integer sign intervals have +common denominator $2^{112}$. Their numerators are +$[1457154697782,1457195972250]$ and $[-534622260294,-534579885888]$. +Thus 0.003890115286594461 is the largest multiple of $10^{-18}$ +that can satisfy this raw test for these exact labelled words. +Whether a particular finite priced machine reaches that grid point is a +separate construction. Other productive or paid inventories change the +polynomial and its crossing. diff --git a/research/p104-retimed-dyadic-endpoint/LICENSE b/research/p104-retimed-dyadic-endpoint/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/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-retimed-dyadic-endpoint/PREDECESSOR-NOTICE.md b/research/p104-retimed-dyadic-endpoint/PREDECESSOR-NOTICE.md new file mode 100644 index 0000000000..68f00c098e --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/PREDECESSOR-NOTICE.md @@ -0,0 +1,9 @@ +Ali Romman prepared the retimed column construction, direct/quotient reflection, two-scale Gaussian receiver, signed physical integration, and the proofs and tests, with substantial OpenAI Codex assistance. Author-side adversarial checks are included. Independent scientific review remains open. The source and predecessor packages retain their Apache 2.0 notices. + +- Ali Romman's [PR #8030](https://github.com/CrocSwap/integer-mult-bounds/pull/8030) supplies the executable single-band physical baseline, tagged word interpreters, linear square geometry, stopped positive call and signed entry. [Original complete attribution](https://github.com/CrocSwap/integer-mult-bounds/blob/6285dd829114705862e8d91facaedc1f31d3cfcb/research/single-band-native-carriers/NOTICE.md) +- Clear1nsight’s [PR #8033](https://github.com/CrocSwap/integer-mult-bounds/pull/8033) supplied the tilted split tariff and [PR #8035](https://github.com/CrocSwap/integer-mult-bounds/pull/8035) the modified stopping margin, signed comparison and portable archived sources. The 54 strict and four functional outer inequalities are reproduced under the original license. [Signed source evidence](https://github.com/CrocSwap/integer-mult-bounds/blob/ea776471bf8ed143a0625cf2d7532f65d15eb5f9/research/p104-single-band-signed-margin/README.md) +- The two paid words and their original helper sources come from Ali Romman’s [PR #8027](https://github.com/CrocSwap/integer-mult-bounds/pull/8027). It credits Clear1nsight's iterated-return programs and scalar audit. [PR #7981](https://github.com/CrocSwap/integer-mult-bounds/pull/7981) and [PR #7914](https://github.com/CrocSwap/integer-mult-bounds/pull/7914) supply earlier physical storage, matrix routing, precision and signed product work. The expanded histories and notices remain in the archived source. +- [PR #8040](https://github.com/CrocSwap/integer-mult-bounds/pull/8040) first removed the expanded fixed epoch by counting powered grades and regenerating the real labels. This work changes the physical use of the raw word and the required rank. [Predecessor setup receipt](https://github.com/aliromman/integer-mult-bounds/blob/1ca6b8111297ac2cc2dcfe5da0027656898f7589/research/counted-native-bands/RESULT.json) +- The unchanged canonical selection credits Jerry Chen / CubeJerry, DreamingOfClouds and the shared native work. The separate existing historical verification repair originated in [PR #7257](https://github.com/CrocSwap/integer-mult-bounds/pull/7257). [Selected application](https://github.com/CrocSwap/integer-mult-bounds/blob/e54523517d0f03e58352e647c403a5af3e525a57/certificates/selected-result.json) + +Clear1nsight supplied the 430-factor trial, its attainment, exact six-stage upper bound and predecessor tape bridge in [PR #8044](https://github.com/CrocSwap/integer-mult-bounds/pull/8044). The archived receipt is reproduced under its Apache 2.0 license. The seventh retimed stage, full-cost comparison, sharper all-size stop accounting and lower bounds across stage counts are this package’s contributions. [Pinned predecessor](https://github.com/Clear1nsight/integer-mult-bounds/blob/c3746ea769fcf0d20818d7e18366f1b602e4aa3d/research/p104-six-stage-resolution/README.md) diff --git a/research/p104-retimed-dyadic-endpoint/PROOF.md b/research/p104-retimed-dyadic-endpoint/PROOF.md new file mode 100644 index 0000000000..4e366a2edd --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/PROOF.md @@ -0,0 +1,154 @@ +# Fixed-word endpoint and e264 refit + +## Global raw bound + +Let `D(t)=T(t)-P(t)` be the difference of productive and paid moments for +the exact homogeneous 36-call binary word, where each rank occurrence counts. The +[global lemma](GLOBAL-PROOF.md) normalizes at rank 8 and uses nonnegative +upper tails to prove `D(t)/8^t` strictly increasing for every `t≥0`. +For `t≤0`, the rank-one deficit and the total positive count prove +`D(t)≤-30678`. At `t=0` and `t=1`, `D` is respectively `-85998` and +`1506`. Thus there is one crossing and no re-entry for all real `t`. +Two directed integer-root enclosures put its corresponding price strictly +inside + +``` +0.003890115286594461129996942 < c* < +0.003890115286594461129996943. +``` + +The next `10^-18` reporting point is therefore above the raw crossing. +This conclusion fixes the exact paid and productive occurrences; it is +not an upper bound for a changed word or a different multiplier. +`global_crossing.py` rebuilds the literal source inventory, checks the +signed coefficients, tail sums, endpoint signs and a corrupted-tail +rejection. It reproduces [GLOBAL-CROSSING.json](GLOBAL-CROSSING.json). + +## A funded seven-stage arithmetic profile + +The source at e264 uses the rate rule + +``` +covered_i = c - 11/(8 H_i) +limit_i = min(eta, (249*covered_i + b_(i-1))/250), b_0=0 +``` + +and chooses the first six rates on its own `10^-21` grid. The final rate +is `κ+5g`. For the named candidate use + +``` +c = 287039844436133239/2^66 +g = 10^-21 kappa = 0.003890115286594461 +H_i = 2*10^12*16^i i=0,...,6 +H_M = 36000 eta = 39/10000 +``` + +The exact source `profile_row` verifies every strict stage inequality and +the 54 strict and four functional signed gates. The seventh limit exceeds +`κ+5g` by + +``` +27007124810227343 / 1759218604441600000000000000000000000. +``` + +The binary directed relative surplus is exactly +`191135881425181897/61353847083031545306054570474927705731` in the +source's certified enclosure. The recomputed transport has 24 nonempty +grade cells; the original full 18,906/104,904 target/paid label census is +unchanged. The later signed numerical construction uses two copies of its +48-call word; its unchanged two-scale positive source has 105,216/564,144 +labels and 54 cells. The source tariff checks row and column sums, +minimum positive cell share, the physical `11/(8H)` and `39/(256H)` +debits, and both budget factors. Two different directed raw readers give +positive binary margin. [Tariff receipt](ENDPOINT-TARIFF.json) + +The previous source price `4484997569314581/2^60` is already below the +new κ; the source price guard rejects the candidate with that old value. +The package also checks the different `0.003890115286594460` control +using the old price and seven stages, in a separate reconstructed source +and interpreter. No previous certificate is overwritten. + +## How much dyadic precision is needed? + +For these fixed seven heights and `g=10^-21`, the largest raw-funded +64-bit dyadic has numerator `71759961109033309`. Even omitting all +intermediate rounding, its seventh ordinary upper is below `κ+4g` by +approximately `2.4301e-20`. Every dyadic with fewer denominator bits is +also on this mesh, so none can satisfy the fixed-height ordinary gate. +The largest funded 65-bit dyadic has numerator `143519922218066619`; its +six rounded intermediate rates leave approximately `1.7975e-21` above +`κ+5g` at stage seven. The selected 66-bit trial leaves approximately +`1.5352e-20`. These are exact rational checks in +[denominator_design.py](denominator_design.py), conditional on the fixed +raw inventory, heights and rate rule. The 65-bit result is only raw and +ordinary arithmetic; it is not a complete installed positive/physical +witness. + +## Extending the 66-root precision and fixed setup + +The binary `t=1-c` has denominator `2^66`. The actual source loop has +67 passes, 66 root levels and at most 67 accumulator products, instead +of the published 60/61 bound. The original grid has spacing +`2^(-64(H+1))`; its source recurrence bounds a step by +`4*sqrt(512*N) < 2^7*sqrt(N)`. Conservatively charging both endpoints and +`V/t`, with `V=N^6` and `t>1/2`, bounds their count error by + +``` +16*(2^7*sqrt(N))^67*N^6 / 2^(64(H+1)) + = 2^(409 - 49*H/2) < 1/4 for H >= 1024. +``` + +This extends the written rounding induction; the executable check counts +132 actual paired integer-square-root calls at four feasible arguments and +compares the resulting intervals with an independent rational log/exp +reader. The source's former numerical statement `binary surplus >1e-18` +is replaced by the directed margin above; the test separately verifies +the source's positive-cell and `δ=2^-128` conditions. No production-sized +calendar is opened by this test. + +The maximum binary H, cut and public exponent need 65 bits; `92H` needs +72 bits. The actual numerical rank `2^36000` needs 36,001 bits. The +stopping denominator `10^21` has 70 bits and 29 one-bits, so the original +69-square/29-multiply bound applies. For the numerical cap at H=36000, +the fixed signed fractions have common scale `3D²`, not the `19D²` used +by the older H=19000 instance. These values are all far below the source's +`2^38`-bit item allowance. [Exact controls](ENDPOINT-SETUP.json) · [Uniform source ranges](UNIFORM-RANGES.md) + +The additional dyadic levels can at most double the source's stated +endpoint arithmetic allowance. With a conservative extra factor for the +candidate installation, the cited fixed indexed-action envelope is below +`2^70`. The source's `2^400` sequential access/arithmetic allowance and +`2^32` parsing factor then give `2^502 < 2^513`. Even doubling the +source's table-preparation bound to `2^151*N^2*(H+1)^6` stays below +`N^3` for H≥1024. This is an adaptation of the source's written cost +accounting, not an independently measured production runtime or a proof +of all its compiler and storage premises. + +## Physical interpretation and limits + +The overlay installs a named profile before source imports and rebuilds +both grade couplings from the changed c. It exercises actual stage +selection at all seven cut boundaries and the source's first numerical +external placement at H=36000 (period 1620, first tickets 0, 324, 648; +first swap 1↔324). Its finite positive receiver is constructed at the +stated rank and stopping denominator; the M/M+1 dispatch test mocks the +payload. These observations do not allocate a production-dimensional +binary field or execute the physical multiplier at the sufficient entrance. + +The [role-transfer argument](ROLE-TRANSFER.md) binds the changed-c +admissible jobs to the same stage-store branches and page arities, using +the source's stated global data census. That binding remains a written +argument under the inherited premises; a later parameterized kernel lemma +is not a formal proof of this particular source-to-role mapping. + +The earlier #8048 uses a different `3d33cb0` retimed source with its own +prices and heights; this refit is pinned at e264 even though #8042 later +added related stage-store formal work at dfd25d5. A standalone [Lean +4.8/4.34.1 certificate](lean/Endpoint.lean) checks the seven exact +rational stage bookings, six rounding rules, the signed +booking inequality and corruption controls. Its raw upper is an external +hypothesis; neither the source/coupling nor the all-size multiplier is +Lean-verified by this certificate. The global upper and the +finite lower remain conditional on their respective fixed-source models; +the five inherited all-size obligations and independent human review +remain open. diff --git a/research/p104-retimed-dyadic-endpoint/README.md b/research/p104-retimed-dyadic-endpoint/README.md new file mode 100644 index 0000000000..cbae4e2812 --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/README.md @@ -0,0 +1,131 @@ +# Retimed P104: the last raw-inventory grid point + +This package studies the exact retimed source of [#8042 at +e264251](https://github.com/aliromman/integer-mult-bounds/tree/e26425171238e142cc9ffb510fd953f344bd41c7/research/retimed-native-multiplier). +It proves that the fixed homogeneous 36-call binary inventory has one raw-moment +crossing and that **0.003890115286594461** is the largest `10^-18` grid +point below it. It also installs and checks a candidate at that grid point, +conditional on the source's inherited all-size premises. The source's raw +word, timed scheduler and 11/8 binary and 39/256 numerical tariffs are +retained; its binary dyadic trial is changed and its coupling is recomputed. + +The new candidate has seven binary rank logarithms `2*10^12*16^i` +for `i=0,...,6`, positive rank logarithm 36,000, stop exponent `10^-21`, +and binary trial `287039844436133239/2^66`. The literal source checks +24 binary coupling cells, 54 positive coupling cells, all seven stage +rates and 54 strict plus four functional signed gates. The directed binary +raw margin is positive, approximately `3.1153e-21`; the seventh-stage +ordinary margin is approximately `1.5352e-20`. The sufficient public +precision exponent is `35791394008032165519`. These enormous constants +are not a practical crossover. [Exact receipt](ENDPOINT-PRICE.json) · +[Raw bound and proof](GLOBAL-PROOF.md) · [Source refit and limits](PROOF.md) + +The unmodified e264 source trial is below the proposed κ, and its actual +stage-price checker rejects the new profile. A separately reproduced +seven-stage fixed-trial control supports `0.003890115286594460` with the +original `4484997569314581/2^60`. The present 66-bit witness changes the +trial, recalculates its coupling and uses a 66-root precision extension; +it is not inherited from that control. For these fixed seven heights and +stopping margin, even the most favorable funded +64-bit dyadic fails an unrounded ordinary upper bound. A 65-bit dyadic +passes the raw and ordinary arithmetic, while the fully installed profile +here uses 66 bits; no full 65-bit installation is asserted. [Exact design +check](denominator_design.py). + +The full asymptotic claim is in the **ideal finite-tape model** under the +source's five premises: all-column native action, owned erasure and +restoration, compiler transfer, precision and tape services, and analytic +recovery. The implication also relies on the source's written dfd +source-to-role, storage, time and geometry binding; the abstract stage-store +lemma and finite fence tests do not themselves prove that mapping. The +finite replay does not independently establish those premises, execute +production-dimensional payloads, establish a measured speedup, or formalize +the full multiplier in Lean. A standalone Lean 4.8 +certificate checks the seven exact stage bookings and rejection controls, +conditional on an externally supplied raw endpoint; it does not check the +source tariff or physical construction. The 32-site signed +product exercises its local H kernel; supplier construction and boundary +routing are separate feasible controls, with payload placement mocked at +the astronomical threshold. + +## Reproduce + +With CPython 3.12, assertions enabled, Git and the standard library: + +```sh +python3.12 -IB scripts/research_package.py --package research/p104-retimed-dyadic-endpoint +``` + +For an offline directory without the repository runner: + +```sh +for case in price install schedule physical receiver slabs product; do + python3.12 -IB verify.py "$case" +done +``` + +Each case verifies the complete 73-blob e264 source tree before rebuilding +a private source copy. The `source-e264.tar.gz` stores 72 small files and +`predecessor-8030.tar.gz` supplies the single large source blob. The +`ENDPOINT-OVERLAY.json` changes the trial and adds a named installed +profile only after verifying its parent bytes. The source's bootstrap then +applies its original machine and receiver patches. See `VERIFY.json` for +individual limits and exact coverage. An earlier physical run timed out at +350 seconds during concurrent work; the identical complete source case +passed serially in 348.79 seconds under the 430-second limit. This is a +finite replay timing, not an upper bound on other hosts. The [case +receipts](evidence/REPLAY-SUMMARY.json) retain launch limits, observations +and failed calibrations. Byte and Git-tree authentication do not imply +that full upstream history is present. + +The optional standalone arithmetic certificate uses only Lean core. It +has been replayed with Lean 4.8.0 and with the source's pinned Lean 4.34.1, +without external Lean modules. It is separate from the Python CI cases: + +```sh +lean --trust=0 lean/Endpoint.lean +python3.12 -IB lean/verify.py /path/to/lean +``` + +The optional harness checks trust-zero compilation, an `.olean` import, +axiom reports, two corrupted-source rejections and, when available, a +separate `leanchecker` replay. Local trust-zero runs completed successfully; [the Lean 4.34.1 harness +log](evidence/LEAN-VERIFY-4.34.log) and [the 4.8 axiom report](evidence/LEAN-4.8.log) +and [certificate](lean/Endpoint.lean) do not formalize the directed raw +interval, source coupling, ownership, tape model or overall multiplier. + +The published [#8042 head dfd25d5](https://github.com/aliromman/integer-mult-bounds/commit/dfd25d553a843a946ca0b94130a5ff8943e98fdd) +adds a related stage-store formal refinement; its price and operative +machine source were unchanged in the inspected comparison. This package +uses e264 as its operative pin and does not claim that later Lean checks +formalize the new profile. The earlier [#8048](https://github.com/CrocSwap/integer-mult-bounds/pull/8048) +uses the earlier `3d33cb0` retimed source with different prices and +heights; it must not be substituted for this e264 24/54-cell refit. The +nine-stage hosted local-word packing model has a different coverage +hypothesis; the raw crossing above supplies a +replacement upper bound for this fixed inventory, with +`0.999999999999999966582753100 < κ/c* < +0.999999999999999966582753358`. This ratio is not a complex packing cap. + +## Open next questions + +1. Can an independent proof establish the source's all-column action, + owner restoration and precise compiler transfer for this exact profile? + Start with the emitted 24-cell binary schedule and a source-bound + all-column owner invariant; finite control replays do not provide it. +2. Can a legal changed physical word increase the raw crossing? Name one + changed incidence, reproduce both field operators and all owner returns, + then reprice its complete new paid/productive inventory. +3. Can the astronomical first-use dimensions be reduced without changing + the funded rate? Start by proving an admissible stage-height/stock lower + bound under the actual seven-stage retimed receiver and its full invoice. + +## Credit + +Ali Romman supplied the retimed binary and two-scale Gaussian source and +its physical and tape proofs; #8044 supplied the earlier directed local +raw-crossing interval. This campaign supplies the global one-crossing +lemma, candidate refit and source-bound checks. Other predecessor credit is +retained in [PREDECESSOR-NOTICE.md](PREDECESSOR-NOTICE.md) and the pinned +source archive. Substantial OpenAI Codex assistance was used in research, +implementation and verification. Apache-2.0; see [LICENSE](LICENSE). diff --git a/research/p104-retimed-dyadic-endpoint/ROLE-TRANSFER.md b/research/p104-retimed-dyadic-endpoint/ROLE-TRANSFER.md new file mode 100644 index 0000000000..4f74f0859f --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/ROLE-TRANSFER.md @@ -0,0 +1,48 @@ +# Transport precision and the historical store + +The scope is the changed binary price and seven new heights installed on the +e264 retimed source. The seven-stage fixed-head argument is Ali Romman's +[stage-storage proof at dfd25d5](https://github.com/aliromman/integer-mult-bounds/blob/dfd25d553a843a946ca0b94130a5ff8943e98fdd/research/retimed-native-multiplier/STAGE-STORE.md). +A [byte-pinned offline copy](dfd/STAGE-STORE.md) and its [Lean source](dfd/lean/StageStore.lean) are included for inspection; the Python replay does not run this Lean file or prove its source mapping. That follow-up adds a written binding, inventory checks and a kernel lemma. +The source of the allocator, roles, native circuits, transport and receiver +is identical at e264 and dfd25d5. Its global data census is a written +argument under the five original premises. + +**Parameter transfer.** Rebuilding the 24 binary coupling cells changes +which previously permitted owners a scheduled job uses. It introduces no +owner type, tape operation, generator or call edge. The numerical schedule +still uses the two independent sets, 54 cells and half-column split. +The static role-fence analysis therefore has exactly the same branches +and page arities. The ordinary predecessor index decreases. A stage root +can remain live once per index; a same-stage child uses the same arena, +and a sibling begins at the retained parent end. These are invariants of +the emitting code on all its admissible jobs. + +The relevant numerical hypotheses are uniform. On the binary side +$t=1-c>0.996$. Every nonzero cell has the certified minimum per-label +mass above $2^{-64}$, and all used edges obey $4k\ge5r$. Hence a +coupled child satisfies $d\le4(e+2)/5<5e/6$ over the stated bands. +The source's number of births per tick is at most $2N^6$: the +integrated birth mass over $[32768,U]$ is at most +$N^6\,32768^{-t}/t$, and rounding contributes fewer than two per +bin. There are fewer than $N$ bins. The new 66-level enclosure keeps +the integral error below one quarter, so the same rounding argument +applies. The raw counts and maximum grade keep the same delay bound +$N^{77}$. With fewer than $2^{67}$ new slots per context, the entire +additional physical stock fits $2^{68}N^{83}$. Even with the +$B=N^{92}$ external slots reserved, this is less than $2B$ at every +installed height, since $2^{68}=1024", + "lifetime_ratio_guard": "(6/5)^77 > 2^20", + "max_reduced_cell_bits": 249, + "minimum_share_per_target": "10773036919966070539137956701990227980858969671183164175157581220769971847/4096531624520743364891123484321444819934618442864227508832296554780761213894656", + "paid_max": 56, + "paid_min": 1, + "raw_mass_ratio_lower": "61353847083031545305863434593502523834/61353847083031545306054570474927705731", + "raw_paid_count": 104904, + "raw_target_count": 18906, + "row_sums_and_capacity_equalities": true, + "scope": "exact parameter and source checks; dfd source-to-role interpretation is written", + "stage_head_allowance": 888, + "support_same_as_dfd_trial": true, + "target_max": 127, + "two_scale_positive_counts": [ + 105216, + 564144, + 54 + ] +} diff --git a/research/p104-retimed-dyadic-endpoint/UNIFORM-RANGES.md b/research/p104-retimed-dyadic-endpoint/UNIFORM-RANGES.md new file mode 100644 index 0000000000..d26b3ae9b2 --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/UNIFORM-RANGES.md @@ -0,0 +1,25 @@ +# Same-source stage-store implication for the 461 refit + +**Disposition.** Assuming the five physical, compiler/precision and analytic premises used by #8042, and accepting the same source-to-tape arguments that #8042 uses for its own seven-stage result, the changed-c 461 profile needs no additional, sixth all-size hypothesis identified by this review. The arithmetic and range extensions below are specific proof obligations for the changed profile; they are not additional scientific axioms. This is a conditional implication from the pinned retimed construction, not independent scientific acceptance, a production-size execution, or a Lean proof of the complete multiplier. If the written source-to-tape binding is not accepted, that underlying question remains open for both the source construction and this refit. + +## Source identity and the role theorem + +The role proof is from [#8042 at `dfd25d553a843a946ca0b94130a5ff8943e98fdd`](https://github.com/aliromman/integer-mult-bounds/blob/dfd25d553a843a946ca0b94130a5ff8943e98fdd/research/retimed-native-multiplier/STAGE-STORE.md). Its `machine.patch`, `receiver.patch`, `transport.py`, `retimed_supplier.py`, `five_exchange.py`, `unpowered_price.py`, `check_complete.py`, `activation.py`, `TRANSFER.md`, and `INSTALLATION.md` are byte-identical to the e264 source used by this refit. In particular the Git blobs for the first three are respectively `16b6205d1f2da87e643159add52146a4e3475211`, `4b7db79b29b83e17e49faa981a0b7a4c4ea21a11`, and `7006360e5b9a117a64ba77a215339ea8242a8ba3`. The only modified machine source is `installations.py`, where the binary rational `BINARY_C` changes and the seven-stage profile is appended under a named key. + +The dfd [StageStore.historical](https://github.com/aliromman/integer-mult-bounds/blob/dfd25d553a843a946ca0b94130a5ff8943e98fdd/research/retimed-native-multiplier/lean/StageStore.lean) theorem is explicitly quantified over arbitrary finite depth D and interval bound W. Its conclusion concerns the abstract push/replace/pop trace, not Python code by itself. The dfd source argument supplies the mapping: nine page kinds plus pending/answer yield 20 arena heads, the fixed work-site census gives 91 scratch positions per stage, and seven stage sets plus one terminal set fit in 888 roles. The program's seven raw/scheduler generators yield outside open scratch scopes. The dfd exact inventory and fence scripts were run unmodified against the changed-c reconstructed source and pass (the package price replay). They are finite and structural evidence; the uniform source-to-role and physical owner interpretation remains the published written proof, not a Lean-verified implementation theorem. + +Changing c modifies integer incidence counts and event timing; it does **not** give an identical execution trace. The point is instead that the dfd role/fence proof uses the same code, fixed source labels, stage count and the uniform inequalities checked below. One need not assume that the old and new calendars agree. + +## Uniform hypotheses and changed parameters + +* **Coupling.** The actual binary labels remain 18,906 productive and 104,904 paid, with max target 127 and paid grades from 1 to 56. `uniform_ranges.py` reconstructs the new exact 24-cell coupling: each share is positive, each cell satisfies `4k>=5r`, each paid row sums to one, and each target column has exactly its directed capacity. Its support is the same set of 24 grade pairs as for the dfd trial, although the rational shares differ. The minimum share divided by total target multiplicity exceeds 2^-64; all reduced cell numerators and denominators have at most 249 bits. Both directed raw-price engines give strict positive surplus, and the unmodified e264 physical-tariff check passes its `P/T>99/100`, `P>10`, maximum-grade, complete physical multiplier and 11/8-bit conditions. The unchanged positive supplier has 105,216 targets, 564,144 paid cuts, 54 cells, ambient 1224 and ranks down to 1/2; its separate first-placement check is unchanged by c. +* **Finite bins and lifetime.** The binary trial has `0996/1000>1/2`. The unchanged `Recipe` uses L=32768, V=N^6, K=N^82, B=N^92 and U<=N/(1024A). The source's density estimate gives `sum m[e] <= V/(t L^t)+2U < 2V` for N>=2: `t L^t>1` and `2U<=2N=5r`, the source’s finite-bin calculation bounds each actual interior prefix by its lender and charges fewer than 10k residual axes. Ordered opens/issues/closes and the actual two delay bases are unchanged. The exact integer inequality `6^77>2^20*5^77` gives delay at most `(e/L)^77`; with fewer than 2^20 paid ordinals and the stated U, each context closes in =1024, including all seven binary ranks and H_M=36000. Pending loans retain the real owner rather than adding an uncounted field. These are the unchanged dfd custody and field-count arguments instantiated on the new exact coupling, not a claim that finite tests enumerated the calendar. +* **Directed arithmetic.** The reduced c denominator is 2^66, so the actual `Measure.inverse_power` loop has 66 square-root levels and at most 67 accumulator products. The published 60/61 figures cannot be copied literally. The same error induction, with `4 sqrt(512N)<2^7 sqrt(N)`, two endpoints, `V=N^6`, `t>1/2` and grid `2^(64(H+1))`, gives the conservative count error `<2^(409-49H/2)<1/4` for every H>=1024. Four finite actual-Measure probes and the independent raw tariff checks pass. Its extra six root levels increase the fixed coupling work by less than a factor two; a doubled coupling bucket remains within the source's fixed setup envelope. The time-dependent table and whole-field movement still use the source's separate `N^96` visits, `N^700` pure-control and payload-scan accounting, with this new fixed loop factor charged. +* **Stage, precision and representation.** All seven H are >=1024, so each binary N=2^H exceeds eight, the range required for the source’s 75/32 quotient-volume average. The numerical carrier is M=2^36000 and its positive capacity, causal precision and stock guards pass at that rank. Eta=39/10000<1/250, every preceding cut is at least two below the next H, and the unmodified `resource_receipt` passes the connected first entry and all later stripe, owner, q/control and table inequalities. Actual selection at both sides of all seven cutoffs and the first positive alignment at H_M=36000 pass. Binary H and cutoff keys occupy 65 bits, `92H` 72 bits, numerical rank `2^36000` 36,001 bits, D=10^21 70 bits and the binary trial denominator 67 bits; each is far below the fixed 2^38-bit item allowance. An independent source-bound candidate-only monitor constructed the changed-c eight-recipe installation with 14,915,531 returned Fractions (max 262 bits) and zero calendars. Its [captured log](evidence/INDEPENDENT-INSTALL.log) measured 247.576 seconds; this is fixed setup only. That run passed the equivalent profile as an object, whereas this package installs it by name. The stop still uses the original D=10^21, so the source's 98-product and `OuterStop` bounds apply unchanged. The source's H_M=19000 numerator scale factor 19 must be replaced: here the exact positive cap is `783955157/201326592000`, and 3D^2 clears the positive margin and all 58 signed gates with at most 182-bit scaled numerators. +* **Historical sum.** Given the written dfd mapping, the above context/owner bounds and unchanged page/packet lifetime rules supply the interval-depth and extent hypotheses of `StageStore.historical` for every role. A root binary rectangle costs <9, at most seven decreasing-stage entries add <2 each, and same-stage real children do not increase their parent argument. For m=7 the dfd explicit summation exponent is `1890+3 bitlength(s+128)`, below its allocated `1984+4 bitlength(s+128)`. The unmodified candidate resource receipt checks the first and monotone-tail stripe inequalities; coefficient/table/control and outer I/O use the source's separately checked additive budgets. The 65-bit cutoff keys are one bit longer than a published numerical example but vastly smaller than the fixed source item limit; no 64-bit hardware word or random access is assumed in this model. + +## Evidence and remaining limits + +`endpoint_runtime.py` and `ENDPOINT-RUNTIME.json` run the actual overlaid profile, new seven binary recipe constructors, the source's profile and selector functions, positive supplier, and exact first placement. `endpoint_tariff.py`, `uniform_ranges.py`, `endpoint_setup.py`, `dfd_checks.py` and their adjacent receipts check the changed coupling, stated uniform inequalities, longer numeric loop, stage-role source identity and finite fences. `endpoint_monitored.py` runs the source's monitored candidate-only setup; `old_c_negative.py` shows the original e264 binary trial rejects the proposed κ. The package receiver case separately checks small actual direct and quotient payloads. + +These checks do not run astronomical calendars or seven nested production fields. The abstract Lean role theorem has hypotheses; applying it to the reconstructed machine uses the dfd written source mapping. The price/profile/first-crossing receipts and this 66-level extension show why the new constants satisfy that mapping's stated ranges. They do not independently verify every upstream mathematical proof or establish maintainer acceptance. diff --git a/research/p104-retimed-dyadic-endpoint/VERIFY.json b/research/p104-retimed-dyadic-endpoint/VERIFY.json new file mode 100644 index 0000000000..d44209df2e --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/VERIFY.json @@ -0,0 +1,86 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/verify.py", + "price" + ], + "timeout_seconds": 55, + "checks": "Authenticate e264; replay source and fixed-c control; verify new full 24/54 prices, signed gates, 66-root checks and global raw crossing. Replay the later dfd stage inventory/fence controls on the candidate source. Reject corrupted source-tree metadata and both archives. Verify the fixed-height 64/65/66-bit design bounds." + }, + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/verify.py", + "install" + ], + "timeout_seconds": 330, + "checks": "Monitor actual candidate-only seven binary recipes and positive recipe; verify real dispatch, cutoff and finite setup controls." + }, + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/verify.py", + "schedule" + ], + "timeout_seconds": 20, + "checks": "Replay changed-c source chronological loan, reentry and incomplete-period checks." + }, + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/verify.py", + "physical" + ], + "timeout_seconds": 430, + "checks": "Replay e264 36/48 raw fields, nonzero two-scale owners, source precision and physical return checks." + }, + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/verify.py", + "receiver" + ], + "timeout_seconds": 205, + "checks": "Replay e264 physical direct and quotient receiver controls and low-inventory checks." + }, + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/verify.py", + "slabs" + ], + "timeout_seconds": 10, + "checks": "Replay fenced signed scanners and restoring ordinary shuttles." + }, + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/verify.py", + "product" + ], + "timeout_seconds": 150, + "checks": "Run profile-bound feasible signed product with actual physical shuttles and local H dispatch." + } + ] +} diff --git a/research/p104-retimed-dyadic-endpoint/check_integrity.py b/research/p104-retimed-dyadic-endpoint/check_integrity.py new file mode 100644 index 0000000000..0be356018c --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/check_integrity.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python3 +"""Corrupt each archival boundary and require the real extractor to reject it.""" +from importlib.util import spec_from_file_location,module_from_spec +from pathlib import Path +from tempfile import TemporaryDirectory +import json +import shutil + +HERE=Path(__file__).resolve().parent +spec=spec_from_file_location('endpoint_source_integrity',HERE/'verify.py') +verifier=module_from_spec(spec) +spec.loader.exec_module(verifier) + +with TemporaryDirectory(prefix='endpoint-corruption-') as work: + base=Path(work);files=base/'package';files.mkdir() + names=('SOURCE-E264.json','source-e264.tar.gz','predecessor-8030.tar.gz') + for name in names: + shutil.copyfile(HERE/name,files/name) + verifier.HERE=files + for index,name in enumerate(names): + target=files/name;old=target.read_bytes() + if name.endswith('.json'): + obj=json.loads(old);obj['source_tree']='0'*40 + target.write_text(json.dumps(obj)) + else: + target.write_bytes(old[:-1]+bytes((old[-1]^1,))) + dest=base/str(index);dest.mkdir() + try: + verifier.checked_source(dest) + except ValueError: + pass + else: + raise AssertionError('Corrupted source accepted: '+name) + target.write_bytes(old) +print('PASS_E264_THREE_SOURCE_CORRUPTIONS_REJECTED',flush=True) diff --git a/research/p104-retimed-dyadic-endpoint/denominator_design.py b/research/p104-retimed-dyadic-endpoint/denominator_design.py new file mode 100644 index 0000000000..50915a931d --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/denominator_design.py @@ -0,0 +1,52 @@ +"""Exact dyadic design threshold for the fixed seven heights and ordinary transfer.""" + +from fractions import Fraction + + +def verify(): + # Proved by GLOBAL-PROOF and reconstructed by global_crossing.py. + lower = Fraction("0.003890115286594461129996942") + upper = Fraction("0.003890115286594461129996943") + target = Fraction("0.003890115286594461") + eta = Fraction("0.0039") + gap = Fraction(1, 10**21) + heights = [2 * 10**12 * 16**i for i in range(7)] + results = {} + for bits in (64, 65, 66): + denominator = 2**bits + numerator = (upper * denominator) // 1 + price = Fraction(numerator, denominator) + # Thus this is the maximum possible *raw-funded* point on its mesh. + assert price < lower < upper < price + Fraction(1, denominator) + unrounded = 0 + booked = 0 + for stage, height in enumerate(heights, 1): + debited = price - Fraction(11, 8 * height) + unrounded = (249 * debited + unrounded) / 250 + limit = min(eta, (249 * debited + booked) / 250) + if stage < 7: + booked = ((limit // gap) - 1) * gap + results[bits] = (numerator, unrounded - target - 4 * gap, + limit - target - 5 * gap) + + # The unrounded recurrence is an upper bound even if the previous rates + # may be chosen freely. It increases in price and in the previous rate. + # Every dyadic with <=64 denominator bits is also on the 64-bit mesh. + assert results[64][0] == 71759961109033309 + assert results[64][1] == Fraction(-6679915143415124983420909, + 274877906944000000000000000000000000000000000) + assert results[65][0] == 143519922218066619 + assert results[65][2] == Fraction(7905295224657471, + 4398046511104000000000000000000000000) + assert results[66][0] == 287039844436133239 + assert results[66][2] == Fraction(27007124810227343, + 1759218604441600000000000000000000000) + assert results[64][1] < 0 < results[65][2] < results[66][2] + return results + + +if __name__ == "__main__": + for bits, (n, upper_gap, booking_gap) in verify().items(): + print(bits, n, "unrounded_limit_minus_target_4g", upper_gap, + "rounded_limit_minus_booking_5g", booking_gap) + print("PASS_RAW_AND_ORDINARY_MINIMUM_DYADIC_DEPTH_65") diff --git a/research/p104-retimed-dyadic-endpoint/dfd/STAGE-STORE.md b/research/p104-retimed-dyadic-endpoint/dfd/STAGE-STORE.md new file mode 100644 index 0000000000..8ee02945d5 --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/dfd/STAGE-STORE.md @@ -0,0 +1,35 @@ +# Fixed tape roles at the seventh stage + +The 54-cell numerical supplier calls seven installed ordinary receivers. This section binds their recursive data to a fixed number of serial heads. The five physical and analytic premises remain in force. The concurrent [seven-stage price](https://github.com/CrocSwap/integer-mult-bounds/pull/8048) uses the older 31-cell numerical word and a different ordinary tariff. Its [open inventory question](https://github.com/Clear1nsight/integer-mult-bounds/blob/9b4bb847d7573c8e08827fee22e9bcad8c9bb43c/research/p104-seven-stage-retimed/PROOF.md) concerns that installation. + +## Fixed heads and the two forms of recursion + +Reserve one fixed set per ordinary stage. The page kinds and arities are `weighted` 2, `compiler` 3, `issued-leaf` 1, `chart-line` 2, `chart-packet` 2, `direct-coordinate` 2, `exposed-leaf` 2, `matcher` 2 and `triangular-body` 2. The pending and answer tapes bring the total to 20. Assign one scratch head per `work_tapes` call site and tuple position per stage. The sites together specify 91 slots, including the binary rectangle, cold routes and 22 buckets in `scale_atom`. Seven disjoint sets require at most 777 binary native heads. An eighth complete set for the public rectangle and cold terminal raises this conservative count to 888. The outer and Gaussian heads retain their own allocations. [Installed site list and binding checks](check_stage_inventory.py) · [Ordinary source delta](machine.patch) + +At the public entrance `ordinary_swap` holds its two rectangle streams. It enters `ternary` with the length of the installed rank list. Its descendants use the ternary service directly. A stage root retains five work files and passes one consecutive prefix slab at a time. The root pads its input and output by a factor less than two. The receiver binds `previous` to `ternary` with `maximum=stage-1`. The direct matcher, stopped weighted pair, quotient affine operation and limb scaler can hold scratch across this call. At most one root of each index is live. The earlier stage consumes and fills the two identified parent intervals while it uses its own fixed heads for new scratch. Terminal bit and trit primitives return directly. The iterative limb scaler holds three permanent scratch files and may open seven more in an odd step or one for a carry. + +A same-stage paid call comes from the empty direct line, the coordinate call between the two basis routes, or one of the ordered quotient children. Here the current binary arena stays live. A temporary direct receiver shares that arena with its parent when one is already open. At the paid call, the raw iterator has already returned its Job. Its clone, move and XOR work files have closed. The intermediate scratch in the basis or quotient routes ends before the same-stage call or crosses a strictly earlier stage. The five rank-root files persist once. Within the rank, recursive calls therefore retain named pages, packet markers and real owner slots. They can reuse the same scratch tapes at arbitrary depth. [Direct and quotient bodies](five_exchange.py) · [Rank-local source and decoder](raw_binary_stage.py) · [Weighted receiver changes](receiver.patch) + +On a named page tape, each child opens at the end of the current parent. A parent can be read while its child is open. Writing or truncating a page requires that it be on top. The weighted child copies its argument onto its own page before any deeper operation. Its final copy back takes place after its descendants have returned. Releasing a page erases its bytes and pops its marker. The next sibling starts at the same live parent end. The pending stack appends complete packets in reverse order and erases each popped interval. The answer tape appends replies and clears through the saved return marker. Lower markers survive. A head can cross the whole parent bank on entry or return. The receiver keeps its position across ordered child windows and pays for these scans, including the cleanup traversals. [Ordinary movement induction](ORDINARY-CLOCK.md) · [Physical receiver](RECEIVER.md) + +Let V be the entering weighted field. At c=Nf+r the two residual factors atom^r enter the actual gap and suffix. A compiler slot therefore has volume V/B, with the unused prefix, all high representatives and both coarse blocks intact. Its Q low packets each have volume V/(BQ). A direct child takes the full slot, and a covered child takes one whole low packet. The matcher can use a preceding interchange up to volume V. Every N²-byte tag in a wide sort accompanies at least 3^(2Nfw) actual payload addresses. The split, sorted copy, full answer, temporary padding and pending packet belong to the current local bound. [Extent equations and historical limits](ACTIVATION.md) + +## Gaussian storage and suspended raw operations + +The positive entrance or an external CRT or outer shuttle can call the public binary service. A Gaussian `Field.swap` snapshots its full field, obtains its full replacement, and calls the ordinary service with both. Their storage persists until return. The outer placement files, the complete current slab and widened H working field all retain separate charges. A descending ordinary path has only one public rectangle, with enlargement less than nine. [Source and lowering](machine.patch) · [Positive cost](NUMERICAL.md) + +An active positive invocation opens `Arena.child` for its B rows. Its input snapshot closes before `Plan.run`. The output scratch opens after the last raw return. A paid child receives exactly one extant row of volume V/B. Its arena starts beyond the parent's historical slot high. New allocations in the parent are suspended until the child's slots retire. The allocator truncates to the saved start. A free slot is used before the high grows. `Field.blank` retains its arena and `replace` checks that the two arenas agree. Graph-node fields, mixed-chart results, saved replacements, simultaneous raw outputs and scalar snapshots therefore occupy actual charged cohort slots or immediate scratch. `ComplexRaw.scratch` gives an existing field a new owner key. [Two-copy source and return](retimed_supplier.py) + +The seven raw or scheduler generators in the [source check](check_stage_inventory.py) yield with no open work-file, page or snapshot scope. Their suspended owners remain live. Group them by raw birth tick. At most 2N^6 births per tick, a lifetime below N^77, and fewer than 2^67 new fields per context give at most 2^68 N^83 additional physical slots. The B=N^92 external owners remain reserved. The sum is less than 2B over the installed range. A pending Job names an existing slot and stores its charged control axes. This argument covers the two distinct subjobs at a half-column cut. [Causal stock bounds](TRANSFER.md) · [Generation and controls](INSTALLATION.md) + +## Historical peak and complete cost + +Induct along an active call path. Same-stage true arguments contract. A transition to an earlier stage adds at most one factor of two. With the binary rectangle and fixed positive entrance, every true incoming argument stays within 2^(m+12) starting stripes. A suspended backing or retired sibling can enlarge one head's highest address. Its high is bounded by the greatest sum of local open extents over the trace on that head, including all earlier siblings. Fixed heads may have maxima at different times. Sum their maxima. This is the historical allocation cover that enters the complete storage proof. + +With the starting stripe factor 128, at most 32(s+128) native heights, the local bound 2^800 and outer bound 2^1024, even charging eight complete sets in the existing physical-role estimate adds only three bits. The logarithm of the complete factor is at most + + 7 + (m+12) + 800 + 1024 + 5 + 35 + 3 bitlength(s+128). + +At m=7 this equals 1890+3 bitlength(s+128), below the installed D(s)=1984+4 bitlength(s+128). The private coefficient, control, numeric table and index bounds are separate. Crossing to a preceding stage already has its own term in the ordinary clock. Fencing the role tapes changes neither the complete time receipt nor the connected threshold. [All-size space proof](ACTIVATION.md) · [Complete clock](CLOCK.md) · [Exact receipt](RESULT.json) + +`StageStore.historical` proves the single-role historical inequality for any sequence of pushes, interval replacements and pops with the stated depth and extent bounds. The written argument above binds those operations and their parameters to the installed source. The finite replay checks the actual allocator at seven stages, three nested levels per stage and a second dirty sibling. Across 42 visits it checked 10,752 historical bytes, 125,062 charged head movements, all restored data and zeroes on return. The separate Gaussian replay found that siblings reuse the actual 128-byte historical parent end. Run `python3.12 -IB research/retimed-native-multiplier/verify.py slabs` from the repository root. [Lean proof](lean/StageStore.lean) · [Physical fence replay](check_stage_fences.py) · [Verification scope](VERIFICATION.md) diff --git a/research/p104-retimed-dyadic-endpoint/dfd/check_stage_fences.py b/research/p104-retimed-dyadic-endpoint/dfd/check_stage_fences.py new file mode 100644 index 0000000000..f26151d58c --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/dfd/check_stage_fences.py @@ -0,0 +1,108 @@ +"""Exercise the seven binary stage stacks and the Gaussian historical allocator.""" + +from contextlib import ExitStack +from io import BytesIO + +from check_stage_inventory import inventory + + +def verify(): + from stack_tapes import Arena + from spool import Arena as GaussianArena + + kinds = inventory() + stages = [Arena() for _ in range(7)] + maxima = [{} for _ in stages] + + def visit(stage, level): + arena = stages[stage] + records = [] + with ExitStack() as scope: + for site, arity in kinds.items(): + for i, page in enumerate(scope.enter_context(arena.frames(site, arity))): + data = bytes([(71 * stage + 19 * level + i + len(site)) % 255 + 1]) + data *= 19 + stage + 3 * level + i + page.write(data) + records.append((page, data)) + key = site, i + maxima[stage][key] = max(maxima[stage].get(key, 0), page.base + len(data)) + pending, answers = arena.pending, arena.answers + pending_top, answers_top = pending.top, answers.top + argument = bytes([stage + 1, level + 1]) * 13 + expected = argument[::-1] + source = BytesIO(argument) + source.seek(len(argument)) + pending.push_reverse(source, len(argument)) + answers.append(BytesIO(expected), len(expected)) + for key, top in ((("pending", 0), pending.top), (("answers", 0), answers.top)): + maxima[stage][key] = max(maxima[stage].get(key, 0), top) + if level: + visit(stage, level - 1) + elif stage: + visit(stage - 1, 2) + for page, data in records: + page.seek(0) + assert page.read() == data + restored = BytesIO() + pending.pop_forward(restored, len(argument)) + assert restored.getvalue() == argument and pending.top == pending_top + restored = BytesIO() + answers.take_answers(answers_top, restored) + assert restored.getvalue() == expected and answers.top == answers_top + + try: + # Use the same historical addresses for a second sibling after the first returns. + visit(6, 2) + visit(6, 2) + for arena, extent in zip(stages, maxima, strict=True): + assert len(arena.heads) == 20 + for key, head in arena.heads.items(): + assert not head.frames and head.peak == extent[key] + head.file.seek(0) + assert head.file.read() == bytes(head.peak) + peaks = sum(arena.counts()[2] for arena in stages) + moves = sum(arena.counts()[1] for arena in stages) + finally: + for arena in stages: + arena.close() + + gaussian = GaussianArena(4, 1) + try: + roots = [gaussian.field() for _ in range(4)] + for i, field in enumerate(roots): + field.stream.write(bytes([i + 1]) * gaussian.extent) + roots.pop().retire() + assert gaussian.high == 4 and gaussian.live == 3 + starts = [] + for _ in range(2): + with gaussian.child(2) as child: + starts.append(child.start) + assert child.start == 4 * gaussian.extent + fields = [child.field() for _ in range(5)] + for field in fields: + field.stream.write(b"q" * child.extent) + fields[-1].retire() + with child.child(1) as inner: + assert inner.start == child.start + 5 * child.extent + field = inner.field() + field.stream.write(b"r" * inner.extent) + field.retire() + for field in fields[:-1]: + field.stream.seek(0) + assert field.stream.read(child.extent) == b"q" * child.extent + field.retire() + assert starts[0] == starts[1] + for i, field in enumerate(roots): + field.stream.seek(0) + assert field.stream.read(gaussian.extent) == bytes([i + 1]) * gaussian.extent + field.retire() + finally: + gaussian.close() + + assert (peaks, moves, starts[0]) == (10752, 125062, 128) + print("seven binary stages, 20 arena heads and 91 scratch slots per stage;", + "historical bytes", peaks, "charged movements", moves, "Gaussian sibling base", starts[0]) + + +if __name__ == "__main__": + verify() diff --git a/research/p104-retimed-dyadic-endpoint/dfd/check_stage_inventory.py b/research/p104-retimed-dyadic-endpoint/dfd/check_stage_inventory.py new file mode 100644 index 0000000000..69ced8d201 --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/dfd/check_stage_inventory.py @@ -0,0 +1,116 @@ +"""Check the allocation sites reached from the installed signed caller.""" + +import ast +import inspect +from importlib import import_module +from textwrap import dedent + + +# Include the nested event generators and the callbacks that these functions return. +BODIES = { + "ordinary_carrier": "ordinary_swap ternary stage_body", + "triangular_ordinary": "root_body", + "binary_receiver": "Receiver.__init__ Receiver.weighted Receiver.compiled", + "receiver": "Receiver.weighted Receiver.storage Receiver.transition Receiver.compensate Receiver.serve_line OwnerBanks.route", + "same_order_body": "SameOrderBody.body_ordinary SameOrderBody.weighted", + "five_exchange": "direct_line same_order_line", + "growing_binary": "pipe", + "direct_body": "direct_route scale_atom", + "module_atoms": "lower_tape negate_tape weighted_pair", + "quotient_route": "affine_packet high_packet sort_packets quotient_right_route", + "limb_scale": "unit_scale", + "raw_binary": "Banks.start Banks.zero Banks.read Banks.install Banks.retire Banks.clone Banks.swap Banks.xor BinarySource.inner", + "strong_binary": "StrongBinarySource.raw", + "raw_binary_stage": "BinaryWord.native run", + "streaming_routes": "cold_swap_tape type_route negate_field shift_field integer_scale work_tapes", + "compact_crt": "binary_swap", + "stack_tapes": "FileHead Page PacketStack Arena", + "transport": "Recipe.open Plan.run Plan.decode Plan.events", + "retimed_supplier": "Raw.native Positive._run", + "positive_dispatch": "native_h h_pack", + "positive": "Positive.apply Positive.hadamard one_axis", + "complex_stage": "place_and_apply", + "raw48": "ComplexRaw.raw ComplexRaw.graph ComplexRaw.align ComplexRaw.unalign ComplexRaw.chart ComplexRaw.fresh ComplexRaw.retire", + "compact_columns": "Columns.one Columns.row Columns.repair", + "spool": "scratch snapshot Segment Arena Field", +} +RAW_GENERATORS = { + "strong_binary.StrongBinarySource.raw", "raw_binary.BinarySource.inner", + "raw_binary_stage.BinaryWord.native", "raw48.ComplexRaw.raw", + "raw48.ComplexRaw.graph", "retimed_supplier.Raw.native", "transport.Plan.events", +} +PAGE_ARITIES = { + "chart-line": 2, "chart-packet": 2, "compiler": 3, "direct-coordinate": 2, + "exposed-leaf": 2, "issued-leaf": 1, "matcher": 2, "triangular-body": 2, "weighted": 2, +} + + +def inventory(): + import band_product + import binary_receiver + import complex_stage + import direct_body + import five_exchange + import ordinary_carrier + import positive + import positive_dispatch + import raw48 + import receiver + import retimed_supplier + import same_order_body + import spool + + assert band_product.Positive is retimed_supplier.Positive + assert band_product.ordinary_swap is ordinary_carrier.ordinary_swap + assert band_product.h_pack is positive_dispatch.h_pack + assert positive_dispatch.place_and_apply is complex_stage.place_and_apply + assert binary_receiver.Receiver.__mro__[1:3] == (receiver.Receiver, same_order_body.SameOrderBody) + assert receiver.direct_line is direct_body.direct_line is five_exchange.direct_line + assert receiver.same_order_line is five_exchange.same_order_line + assert retimed_supplier.ComplexRaw is raw48.ComplexRaw + assert retimed_supplier.Positive.__base__ is positive.Positive + assert positive.Arena is spool.Arena + + pages = set() + work = [] + yields = set() + calls_weighted = set() + binds_weighted = set() + for module, names in BODIES.items(): + source = import_module(module) + for name in names.split(): + body = source + for part in name.split("."): + body = getattr(body, part) + symbol = module + "." + name + nodes = list(ast.walk(ast.parse(dedent(inspect.getsource(body))))) + for node in nodes: + if isinstance(node, ast.Call): + func = ast.unparse(node.func).rsplit(".", 1)[-1] + if func == "pipe": + pages.add((ast.literal_eval(node.args[1]), 2)) + if func == "frames" and isinstance(node.args[0], ast.Constant): + pages.add(tuple(ast.literal_eval(arg) for arg in node.args[:2])) + if func == "work_tapes": + work.append(ast.literal_eval(node.args[0])) + if func == "weighted": + calls_weighted.add(symbol) + if symbol == "transport.Plan.decode": + assert func not in {"work_tapes", "scratch", "snapshot", "TemporaryFile"} + if symbol in RAW_GENERATORS: + if isinstance(node, (ast.Yield, ast.YieldFrom)): + yields.add(symbol) + if isinstance(node, (ast.With, ast.AsyncWith)): + assert not any(isinstance(child, (ast.Yield, ast.YieldFrom)) + for child in ast.walk(node)) + if module == "five_exchange" and isinstance(node, ast.Attribute) and node.attr == "weighted": + binds_weighted.add(symbol) + + assert pages == set(PAGE_ARITIES.items()) + assert sum(PAGE_ARITIES.values()) + 2 == 20 # Add both packet stacks. + assert max(work) == 22 and sum(work) == 91 + assert yields == RAW_GENERATORS + assert calls_weighted == {"binary_receiver.Receiver.weighted", "receiver.Receiver.weighted", + "same_order_body.SameOrderBody.body_ordinary", "receiver.Receiver.serve_line"} + assert binds_weighted == {"five_exchange.direct_line", "five_exchange.same_order_line"} + return PAGE_ARITIES diff --git a/research/p104-retimed-dyadic-endpoint/dfd/lean/StageStore.lean b/research/p104-retimed-dyadic-endpoint/dfd/lean/StageStore.lean new file mode 100644 index 0000000000..8c425a0e75 --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/dfd/lean/StageStore.lean @@ -0,0 +1,68 @@ +import Mathlib.Tactic + +namespace StageStore + +/-- A fixed physical role has an ordered list of open suffix lengths and the + greatest position reached so far. Closing a sibling preserves that high. -/ +structure Tape where + slots : List ℕ + high : ℕ + +def reserved (D W : ℕ) (t : Tape) : Prop := + t.slots.length ≤ D ∧ (∀ v ∈ t.slots,v≤W) ∧ t.high ≤ D*W + +theorem intervalTotal (W : ℕ) (vs : List ℕ) (h : ∀ x ∈ vs, x≤W) : + vs.sum ≤ vs.length*W := by + induction vs with + | nil => simp + | cons x xs ih => + have head := h x (by simp) + have tail := ih (by intro y hy; exact h y (by simp [hy])) + simp only [List.sum_cons,List.length_cons,Nat.succ_mul] + omega + +/-- push allocates a delimited reusable suffix. replace accounts an opened + interval's new own extent. remove erases it and restores its parent end. -/ +inductive Step (D W : ℕ) : Tape → Tape → Prop + | push (vs : List ℕ) (h k : ℕ) (hd : vs.length < D) (hw : k≤W) : + Step D W ⟨vs,h⟩ ⟨k::vs,max h (k+vs.sum)⟩ + | replace (vs : List ℕ) (h old k : ℕ) (hw : k≤W) : + Step D W ⟨old::vs,h⟩ ⟨k::vs,max h (k+vs.sum)⟩ + | remove (vs : List ℕ) (h old : ℕ) : + Step D W ⟨old::vs,h⟩ ⟨vs,h⟩ + +theorem oneStep (D W : ℕ) {u v : Tape} (h : reserved D W u) (step : Step D W u v) : + reserved D W v := by + cases step with + | push vs hist k hd hw => + obtain ⟨_,bounds,past⟩ := h + have ht := intervalTotal W vs bounds + have hd' : (vs.length+1)*W≤D*W := Nat.mul_le_mul_right W hd + simp only [Nat.add_mul,one_mul] at hd' + refine ⟨by simpa using hd,by simpa [hw] using And.intro hw bounds,?_⟩ + change max hist (k+vs.sum) ≤ D*W + exact max_le past (by omega) + | replace vs hist old k hw => + obtain ⟨hd,bounds,past⟩ := h + have hb : ∀ x ∈ vs,x≤W := by intro x hx; exact bounds x (by simp [hx]) + have ht := intervalTotal W vs hb + change vs.length+1≤D at hd + have hd' := Nat.mul_le_mul_right W hd + simp only [Nat.add_mul,one_mul] at hd' + refine ⟨hd,by simpa using And.intro hw hb,?_⟩ + change max hist (k+vs.sum) ≤ D*W + exact max_le past (by omega) + | remove vs hist old => + obtain ⟨hd,bounds,past⟩ := h + change vs.length+1≤D at hd + exact ⟨by change vs.length≤D; omega,by intro x hx; exact bounds x (by simp [hx]),past⟩ + +theorem historical (D W : ℕ) {t : Tape} + (path : Relation.ReflTransGen (Step D W) ⟨[],0⟩ t) : t.high ≤ D*W := by + suffices reserved D W t from this.2.2 + induction path with + | refl => simp [reserved] + | tail _ step ih => exact oneStep D W ih step + +#print axioms historical +end StageStore diff --git a/research/p104-retimed-dyadic-endpoint/dfd_checks.py b/research/p104-retimed-dyadic-endpoint/dfd_checks.py new file mode 100644 index 0000000000..615ae413b8 --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/dfd_checks.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +"""Run dfd25d's Git-blob-pinned small stage fences on the e264 overlay.""" +from fractions import Fraction +from hashlib import sha1 +from pathlib import Path +import runpy +import sys + +HERE=Path(__file__).resolve().parent +machine=Path(sys.argv[1]).resolve() +sys.path.insert(0,str(machine)) +sys.path.insert(1,str(HERE/'dfd')) +from upstream import install +install() +from installations import BINARY_C,DYADIC_ENDPOINT,PROFILES +assert BINARY_C==Fraction(287039844436133239,2**66) +assert PROFILES['dyadic-endpoint'] is DYADIC_ENDPOINT +for name,expected in { + 'check_stage_inventory.py':'69ced8d2018ad04c71e69e7aec524e1457549d14', + 'check_stage_fences.py':'f26151d58c78f98779f8408f5d6e9fe133f2615b', + 'STAGE-STORE.md':'8ee02945d5ce723df3e5171cdc2f0ef70b595ec3', + 'lean/StageStore.lean':'8c425a0e7580542ff4ee0d3734eea76bb02cf5b5', +}.items(): + data=(HERE/'dfd'/name).read_bytes() + actual=sha1(b'blob '+str(len(data)).encode()+b'\0'+data).hexdigest() + assert actual==expected, name +runpy.run_path(str(HERE/'dfd'/'check_stage_fences.py'),run_name='__main__') +print('PASS_DFD_STAGE_FENCES_ON_E264_ENDPOINT',flush=True) diff --git a/research/p104-retimed-dyadic-endpoint/endpoint_monitored.py b/research/p104-retimed-dyadic-endpoint/endpoint_monitored.py new file mode 100644 index 0000000000..69c1b1c7a5 --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/endpoint_monitored.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python3 +"""Measure fixed candidate setup; run operand-dependent guards separately.""" +from importlib.util import module_from_spec,spec_from_file_location +from pathlib import Path +from unittest.mock import patch +import sys + +source, machine, result = map(Path,sys.argv[1:4]) +sys.path.insert(0,str(machine.resolve())) +sys.path.insert(1,str(source.resolve())) +from upstream import install +install() +from installations import DYADIC_ENDPOINT,PROFILES +import check_installation + +# The source's <=4096-bit/zero-calendar measurement is for fixed setup only. +# Keep the named installed profile and monitor the exact prepare_native path. +assert PROFILES['dyadic-endpoint'] is DYADIC_ENDPOINT +with patch.object(check_installation,'PROFILES',{'dyadic-endpoint':DYADIC_ENDPOINT}): + check_installation.main() +print('PASS_E264_CANDIDATE_MONITORED_FIXED_SETUP',flush=True) + +# Entrance, placement and boundary arithmetic are operand-dependent controls; +# they are intentionally outside the source's fixed-setup monitor. +runtime=Path(__file__).with_name('endpoint_runtime.py') +spec=spec_from_file_location('endpoint_runtime',runtime) +module=module_from_spec(spec) +sys.argv=[str(runtime),str(source),str(machine),str(result)] +spec.loader.exec_module(module) +module.main() +print('PASS_E264_CANDIDATE_FINITE_RUNTIME_GUARDS',flush=True) diff --git a/research/p104-retimed-dyadic-endpoint/endpoint_price.py b/research/p104-retimed-dyadic-endpoint/endpoint_price.py new file mode 100644 index 0000000000..70e5366df8 --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/endpoint_price.py @@ -0,0 +1,91 @@ +"""e264 exact-source financial and first-external-location refit; no payload materialization.""" +from collections import Counter +from decimal import Decimal,localcontext +from fractions import Fraction as Q +from pathlib import Path +import hashlib,json,sys + +HERE=Path(__file__).resolve().parent +sys.path.insert(0,str(Path(sys.argv[1]).resolve())) +from upstream import install +install() +from installations import DYADIC_ENDPOINT as LAST_GRID,BINARY_C,GAUSSIAN_C,PROFILES +from check_complete import profile_row,tariff,first_external_swap +from independent_binary_price import raw_moments +from strong_binary import graph,caller +from unpowered_price import ranks +from outer_budget import qualify +from outer_clock import financial_checks +from ordinary_clock import first_stage_bound,polynomial_to_fibre_bound + +def dec(x): + with localcontext() as c: + c.prec=48 + return str(Decimal(x.numerator)/Decimal(x.denominator)) +def hashint(x): + return hashlib.sha256(x.to_bytes(max(1,(x.bit_length()+7)//8),'big')).hexdigest() + +profile=LAST_GRID +assert profile.kappaprofile.ordinary>profile.kappa+Q(4,profile.positive_stop_denominator) +for args in ((profile.kappa,Q(0),profile.ordinary,positive), + (profile.kappa,Q(1,10**17),profile.ordinary,positive), + (profile.kappa,Q(1,10**21),profile.kappa+Q(4,10**21),positive), + (profile.kappa,Q(1,10**21),profile.ordinary,profile.ordinary)): + try:qualify(*args) + except ArithmeticError:pass + else:raise AssertionError('unfunded border accepted') +cuts=row['binary_cuts'] +assert max(cuts).bit_length()<=65 and row['public_exponent_A'].bit_length()<=65 +first=first_stage_bound(profile.eta);later=polynomial_to_fibre_bound() +assert first+80*profile.rank_logs[0]<1024*profile.rank_logs[0] +assert all(later+80*h<1024*h for h in profile.rank_logs[1:]) +g=Q(1,profile.positive_stop_denominator) +stop_factor_log=((17*profile.positive_stop_denominator)**16-1).bit_length() +assert stop_factor_log==1182 and 400+stop_factor_log+9+2<1600 +financial=financial_checks() +binary_census=raw_moments(graph(),caller()) +binary=tariff(BINARY_C,binary_census,134) +positive_census=ranks() +numeric=tariff(GAUSSIAN_C,positive_census,1224) +assert (binary['cells'],numeric['cells'])==(24,54) +assert PROFILES['dyadic-endpoint'] is profile +placement=first_external_swap(positive_census) +first36000=placement['placements']['36000'] +assert first36000['first_tickets'][0]==0 and first36000['first_tickets'][1]>1 +period=first36000['period'];tickets=first36000['first_tickets'] +actual_first={'period_bit_length':period.bit_length(),'period_sha256':hashint(period), + 'ticket_bit_lengths':[x.bit_length() for x in tickets], + 'ticket_sha256':[hashint(x) for x in tickets], + 'root_tag':placement['root_tag'],'per_target_probability':placement['per_target_probability'], + 'actual_position_probe':'first swap (1,ticket[1],1) was issued by ComplexRaw.align'} +previous=Q(0);stages=[] +for i,(h,r) in enumerate(zip(profile.rank_logs,row['stage_rates'],strict=True)): + rate=Q(r);limit=min(profile.eta,(249*(BINARY_C-Q(11,8*h))+previous)/250) + assert previous 1024 + for i, (h, cut) in enumerate(zip(profile.rank_logs, cuts), 1): + assert stage_for_width_log(cut-1,7,profile.rank_logs) == i-1 + assert stage_for_width_log(cut,7,profile.rank_logs) == i + assert stage_for_width_log(cut,i-1,profile.rank_logs) == i-1 + assert 249*cut >= 250*(h+64) + if i > 1: + assert cuts[i-2]+2 < h + class FakeDigits: + def __lt__(self, n): return False + def bit_length(self): return cut+1 + with patch('ordinary_carrier.stage_body') as body: + ternary(None,None,FakeDigits(),1,1,1,maximum=7,profile=profile) + assert body.call_args.args[6] == i + assert body.call_args.args[7] is profile + assert receiver.same_order_line is five_exchange.same_order_line + assert direct_body.direct_line is five_exchange.direct_line + print('PASS_461_PRICING_AND_TRUE_SEVEN_SELECTOR_BOUNDARIES', flush=True) + + recipes = [binary_recipe(h) for h in profile.rank_logs] + assert all(recipe.rank_log == h and recipe.width_log == 92*h + for recipe,h in zip(recipes,profile.rank_logs,strict=True)) + assert all(recipe.trial == BINARY_C for recipe in recipes) + print('PASS_461_ACTUAL_BINARY_COUPLING_AND_SEVEN_RECIPES', flush=True) + + census = ranks() + assert sum(census[0].values()) == 105216 + assert sum(census[1].values()) == 564144 + import check_complete + with patch.object(check_complete, 'PROFILES', {'candidate': profile}): + crossing = first_external_swap(census) + assert crossing['placements']['36000']['period'] == 1620 + assert crossing['placements']['36000']['first_tickets'] == [0,324,648] + print('PASS_461_PRODUCTION_RANK_FIRST_PHYSICAL_ALIGNMENT_GUARD', flush=True) + + from retimed_supplier import Positive + supplier = Positive(profile.complex_log, profile.positive_stop_denominator) + assert supplier.carrier.bit_length() - 1 == 36000 + assert supplier.denominator == 10**21 + assert supplier.recipe.rank_log == 36000 and supplier.recipe.width_log == 92*36000 + assert len(supplier.recipe.targets) == 105216 and len(supplier.recipe.paid) == 564144 + assert len(supplier.recipe.cells) == 54 + import positive_dispatch + m = supplier.carrier + # A fresh source call checks the true rank boundary. The payload is deliberately mocked. + class DummyPositive: + def __init__(self,*args,**kwargs): pass + def hadamard(self,*args,**kwargs): pass + with patch.object(positive_dispatch,'Positive',DummyPositive), \ + patch.object(positive_dispatch,'place_and_apply') as placement: + positive_dispatch.native_h(None,0,m,1792,0,1,None,36000,lambda:supplier) + assert not placement.called + positive_dispatch.native_h(None,0,m+1,1792,0,1,None,36000,lambda:supplier) + assert placement.call_count == 1 and placement.call_args.args[-1] is supplier + print('PASS_461_ACTUAL_POSITIVE_RECIPE_AND_DISPATCH_BOUNDARY', flush=True) + + previous = Q() + for i,h in enumerate(profile.rank_logs): + limit = min(profile.eta,(249*(BINARY_C-Q(11,8*h))+previous)/250) + booked = profile.ordinary if i==6 else Q((limit*10**21).__floor__()-1,10**21) + assert str(booked) == row['stage_rates'][i] and previous < booked < limit + previous = booked + final_limit_margin = limit-booked + assert final_limit_margin == Q(27007124810227343,1759218604441600000000000000000000000) + assert row['signed_gate']['smallest_margin'] == '1/10000000000000000000000' + result = {'e264_git_blobs': expected, 'source_mutation': 'BINARY_C and an installed named profile in installations.py', + 'candidate': {'kappa': str(profile.kappa), 'gap': '1/1000000000000000000000', + 'binary_C': str(BINARY_C), + 'binary_H': list(profile.rank_logs), 'numerical_H':profile.complex_log}, + 'arithmetic_and_stock': row, 'binary_recipe_count':len(recipes), + 'positive_word': {'target_count':sum(census[0].values()), 'paid_count':sum(census[1].values()), + 'cells':len(supplier.recipe.cells), 'first_crossing':crossing}, + 'last_rate_margin':str(final_limit_margin), + 'scope':'feasible source-bound controls and exact arithmetic; no production payload or all-size proof'} + Path(sys.argv[3]).write_text(json.dumps(result,sort_keys=True,indent=2)+'\n') + print('PASS_461_SOURCE_OVERLAY_FINITE_GUARDS_ONLY',flush=True) + + +if __name__ == '__main__': + main() diff --git a/research/p104-retimed-dyadic-endpoint/endpoint_setup.py b/research/p104-retimed-dyadic-endpoint/endpoint_setup.py new file mode 100644 index 0000000000..394b50b8a5 --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/endpoint_setup.py @@ -0,0 +1,77 @@ +#!/usr/bin/env python3 +"""Exact item-size, 66-root, stop and control guards for the e264 overlay.""" +from pathlib import Path +from fractions import Fraction as Q +from unittest.mock import patch +import hashlib +import json +import sys + +ROOT=Path(__file__).resolve().parent +sys.path.insert(0,str(Path(sys.argv[1]).resolve())) +sys.path.insert(1,str(ROOT)) +from upstream import install +install() +from installations import BINARY_C,GAUSSIAN_C,Profile +from activation import resource_receipt +from outer_budget import margins +from independent_binary_price import rank_price +import transport + +p=Profile(tuple(2*10**12*16**j for j in range(7)),36000, + Q(39,10000),Q('.003890115286594461'),10**21) +D=p.positive_stop_denominator +rec=resource_receipt(p) +H=max(p.rank_logs) +sizes={'max_rank_log_bits':H.bit_length(), + 'max_binary_cut_log_bits':max(rec['binary_cuts']).bit_length(), + 'public_exponent_bits':rec['public_exponent_A'].bit_length(), + 'max_binary_width_log_bits':(92*H).bit_length(), + 'positive_carrier_bits':(1<=1024 + +positive=GAUSSIAN_C-Q(39,256*p.complex_log) +strict,functional,paid=margins(p.kappa,Q(1,D),p.ordinary,positive) +assert len(strict)==54 and len(functional)==4 and min(*strict,*functional,paid)>0 +assert all((x*D**2).denominator==1 for x in (*strict,*functional)) +assert (paid*D**2).denominator == 3 +assert all((x*3*D**2).denominator==1 for x in (*strict,*functional,paid)) +gate_bits=max(abs((x*3*D**2).numerator).bit_length() for x in (*strict,*functional,paid)) +assert gate_bits<=186 + +t=1-BINARY_C +assert t.denominator==2**66 +measure=transport.Measure(t,1,640) +original=transport.isqrt +counts=[] +for rank in (2,3,15,127): + count=[0] + def counted(value): + count[0]+=1 + return original(value) + with patch.object(transport,'isqrt',side_effect=counted): + lo,hi=measure.inverse_power(rank) + assert count[0]==132 # two isqrt calls at each of 66 root levels + lower,upper=rank_price(rank,t) + assert Q(lo,measure.grid)<=1/lower and Q(hi,measure.grid)>=1/upper + counts.append({'rank':rank,'isqrt_calls':count[0], 'intervals_overlap':True}) +result={'sizes_in_bits':sizes,'source_item_allowance_bits':2**38, + 'stage_count':len(p.rank_logs),'positive_count':1, + 'stop_10_21_squares_upper':69,'stop_10_21_selected_products_upper':29, + 'stop_absorption_ceiling_bits':((17*D)**16-1).bit_length(), + 'positive_cap':str(positive),'signed_common_scale':'3*D^2', + 'scaled_signed_max_bits':gate_bits,'measure_controls':counts, + 'generic_66_root_error_log_upper':'409-(49/2)*H', + 'scope':'fixed-item and arithmetic guards; all-size control accounting remains a written proof'} +Path(sys.argv[2]).write_text(json.dumps(result,sort_keys=True,indent=2)+'\n') +print('PASS_461_FIXED_ITEM_STOP_AND_66_ROOT_CONTROLS',flush=True) diff --git a/research/p104-retimed-dyadic-endpoint/endpoint_tariff.py b/research/p104-retimed-dyadic-endpoint/endpoint_tariff.py new file mode 100644 index 0000000000..9cfc5a0a01 --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/endpoint_tariff.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python3 +"""Run e264's genuine 66-bit binary tariff at the changed trial.""" +from pathlib import Path +from collections import Counter +from fractions import Fraction as Q +import json +import sys + +ROOT=Path(__file__).resolve().parent +sys.path.insert(0,str(Path(sys.argv[1]).resolve())) +sys.path.insert(1,str(ROOT)) +from upstream import install +install() +from installations import BINARY_C +from raw_binary_stage import binary_word +from unpowered_price import certify +from check_complete import tariff +from independent_binary_price import mass,raw_moments +from strong_binary import graph,caller + +word=binary_word() +targets,paid=Counter(word.targets),Counter(word.paid) +assert (targets,paid)==raw_moments(graph(),caller()) +margin,cells=certify(BINARY_C,(targets,paid)) +assert margin>0 and cells +independent=mass(targets,1-BINARY_C,False)-mass(paid,1-BINARY_C,True) +assert independent>0 +print('PASS_461_TWO_DIRECTED_RAW_MARGINS',flush=True) +# This is the literal e264 tariff guard, including the minimum cell share, +# split/moment enclosure and the physical 11/8-bit bound. +bill=tariff(BINARY_C,(targets,paid),134) +assert bill['cells']==len(cells) +print('PASS_461_E264_BINARY_PHYSICAL_TARIFF',flush=True) +result={'binary_trial':str(BINARY_C),'t_denominator_bits':(1-BINARY_C).denominator.bit_length(), + 'directed_margin':str(margin),'independent_mass_difference':str(independent), + 'cell_count':len(cells),'minimum_cell_fraction':str(min(cells.values())), + 'actual_e264_tariff':bill,'scope':'exact finite price/coupling; not a tape-simulation proof'} +Path(sys.argv[2]).write_text(json.dumps(result,sort_keys=True,indent=2)+'\n') diff --git a/research/p104-retimed-dyadic-endpoint/evidence/INDEPENDENT-INSTALL.log b/research/p104-retimed-dyadic-endpoint/evidence/INDEPENDENT-INSTALL.log new file mode 100644 index 0000000000..08c0e20d78 --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/evidence/INDEPENDENT-INSTALL.log @@ -0,0 +1,9 @@ +candidate-461 [2000000000000, 32000000000000, 512000000000000, 8192000000000000, 131072000000000000, 2097152000000000000, 33554432000000000000] 36000 +installed binary labels 18906 104904 +binary difference forms and joint charts 2352 111 +rational results and maximum reduced width 14915531 262 +operand-dependent calendars created during fixed setup 0 +expanded packaged input bytes 6788928 +instrumented installation seconds 247.576 +peak resident bytes 286560256 +PASS_461_SOURCE_MONITORED_FIXED_INSTALLATION diff --git a/research/p104-retimed-dyadic-endpoint/evidence/LEAN-4.8.log b/research/p104-retimed-dyadic-endpoint/evidence/LEAN-4.8.log new file mode 100644 index 0000000000..57d7f3bb25 --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/evidence/LEAN-4.8.log @@ -0,0 +1,31 @@ +'Endpoint461.binary_denominator' does not depend on any axioms +'Endpoint461.grid_denominator' does not depend on any axioms +'Endpoint461.all_bookings' does not depend on any axioms +'Endpoint461.all_roundings' does not depend on any axioms +'Endpoint461.booked1' does not depend on any axioms +'Endpoint461.booked2' does not depend on any axioms +'Endpoint461.booked3' does not depend on any axioms +'Endpoint461.booked4' does not depend on any axioms +'Endpoint461.booked5' does not depend on any axioms +'Endpoint461.booked6' does not depend on any axioms +'Endpoint461.booked7' does not depend on any axioms +'Endpoint461.rounded1' does not depend on any axioms +'Endpoint461.rounded2' does not depend on any axioms +'Endpoint461.rounded3' does not depend on any axioms +'Endpoint461.rounded4' does not depend on any axioms +'Endpoint461.rounded5' does not depend on any axioms +'Endpoint461.rounded6' does not depend on any axioms +'Endpoint461.cap1' does not depend on any axioms +'Endpoint461.cap2' does not depend on any axioms +'Endpoint461.cap3' does not depend on any axioms +'Endpoint461.cap4' does not depend on any axioms +'Endpoint461.cap5' does not depend on any axioms +'Endpoint461.cap6' does not depend on any axioms +'Endpoint461.cap7' does not depend on any axioms +'Endpoint461.signed_booking' does not depend on any axioms +'Endpoint461.signed_strict' does not depend on any axioms +'Endpoint461.upper_below_next' does not depend on any axioms +'Endpoint461.current_trial_below_upper' does not depend on any axioms +'Endpoint461.conditional_endpoint' does not depend on any axioms +'Endpoint461.damaged_c_rejected' does not depend on any axioms +'Endpoint461.next_tick_rejected' does not depend on any axioms diff --git a/research/p104-retimed-dyadic-endpoint/evidence/LEAN-VERIFY-4.34.log b/research/p104-retimed-dyadic-endpoint/evidence/LEAN-VERIFY-4.34.log new file mode 100644 index 0000000000..10d639c1a2 --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/evidence/LEAN-VERIFY-4.34.log @@ -0,0 +1,8 @@ +LEAN_VERSION Lean (version 4.34.1, x86_64-unknown-linux-gnu, commit 5045d0056413266e57c625dcd7c365b10e377c52, Release) +SOURCE_SHA256 2d2ff39d4fdf9d4fb4e60e842ff2ceb62e197e1339d01c924610f20e25ae0f44 +TRUST_ZERO_AXIOM_FREE_DECLARATIONS 31 +TRUST_ZERO_OLEAN_IMPORT_AXIOM_FREE 7 +SEPARATE_LEANCHECKER passed +CORRUPTION_REJECTIONS damaged_c next_kappa_tick +OBSERVED_ELAPSED_SECONDS 1.508 +PASS_ENDPOINT461_LEAN_CORE diff --git a/research/p104-retimed-dyadic-endpoint/evidence/PACKAGE-INSTALL.log b/research/p104-retimed-dyadic-endpoint/evidence/PACKAGE-INSTALL.log new file mode 100644 index 0000000000..c8701c6891 --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/evidence/PACKAGE-INSTALL.log @@ -0,0 +1,18 @@ +PASS_PINNED_E264_TREE e26425171238e142cc9ffb510fd953f344bd41c7 173859e6ffac6f43f1cd40357967e366d55f5a42 73 +PASS_ENDPOINT_OVERLAY_C_AND_NAMED_PROFILE +dyadic-endpoint [2000000000000, 32000000000000, 512000000000000, 8192000000000000, 131072000000000000, 2097152000000000000, 33554432000000000000] 36000 +installed binary labels 18906 104904 +binary difference forms and joint charts 2352 111 +rational results and maximum reduced width 14915531 262 +operand-dependent calendars created during fixed setup 0 +expanded packaged input bytes 6788928 +instrumented installation seconds 259.596 +peak resident bytes 285978624 +PASS_E264_CANDIDATE_MONITORED_FIXED_SETUP +PASS_461_PRICING_AND_TRUE_SEVEN_SELECTOR_BOUNDARIES +PASS_461_ACTUAL_BINARY_COUPLING_AND_SEVEN_RECIPES +PASS_461_PRODUCTION_RANK_FIRST_PHYSICAL_ALIGNMENT_GUARD +PASS_461_ACTUAL_POSITIVE_RECIPE_AND_DISPATCH_BOUNDARY +PASS_461_SOURCE_OVERLAY_FINITE_GUARDS_ONLY +PASS_E264_CANDIDATE_FINITE_RUNTIME_GUARDS +PASS_E264_ENDPOINT install diff --git a/research/p104-retimed-dyadic-endpoint/evidence/PACKAGE-INSTALL.time b/research/p104-retimed-dyadic-endpoint/evidence/PACKAGE-INSTALL.time new file mode 100644 index 0000000000..3da1aa8bcc --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/evidence/PACKAGE-INSTALL.time @@ -0,0 +1 @@ +WALL_SECONDS=264.24 EXIT=0 diff --git a/research/p104-retimed-dyadic-endpoint/evidence/REPLAY-SUMMARY.json b/research/p104-retimed-dyadic-endpoint/evidence/REPLAY-SUMMARY.json new file mode 100644 index 0000000000..247f697755 --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/evidence/REPLAY-SUMMARY.json @@ -0,0 +1,70 @@ +{ + "environment": "CPython 3.12.3, standard library and Git; local host", + "scope": "Each case was run separately. Observed wall times are not a performance guarantee. Every case finished within its final declared budget; some earlier commands were launched with a larger cap, as stated.", + "cases": { + "price": { + "seconds": 38.14, + "launch_cap_seconds": 55, + "declared_seconds": 55, + "log": "price.log" + }, + "install": { + "seconds": 264.24, + "launch_cap_seconds": 350, + "declared_seconds": 330, + "log": "PACKAGE-INSTALL.log" + }, + "schedule": { + "seconds": 10.62, + "launch_cap_seconds": 40, + "declared_seconds": 20, + "log": "schedule.log" + }, + "physical": { + "seconds": 348.79, + "launch_cap_seconds": 430, + "declared_seconds": 430, + "log": "physical.log" + }, + "receiver": { + "seconds": 162.05, + "launch_cap_seconds": 170, + "declared_seconds": 205, + "log": "receiver.log" + }, + "slabs": { + "seconds": 2.68, + "launch_cap_seconds": 30, + "declared_seconds": 10, + "log": "slabs.log" + }, + "product": { + "seconds": 118.25, + "launch_cap_seconds": 170, + "declared_seconds": 150, + "log": "product.log" + } + }, + "failed_calibrations": [ + { + "case": "install", + "scope": "initial monitor incorrectly wrapped operand-dependent guards; rejected", + "seconds": 249.72, + "exit": 1 + }, + { + "case": "install", + "scope": "fixed setup passed; a receipt adapter shadowed the source blob dictionary, fixed before successful rerun", + "seconds": 264.82, + "exit": 1 + }, + { + "case": "physical", + "scope": "full physical case under concurrent work timed out without a pass marker; serial rerun passed", + "seconds": 350, + "exit": 124 + } + ], + "lean": "Optional standalone arithmetic harness passed separately; see LEAN-VERIFY-4.34.log.", + "limits": "No production-dimensional payload, full independent source-to-tape proof, maintainer acceptance or full Lean multiplier theorem is claimed." +} diff --git a/research/p104-retimed-dyadic-endpoint/evidence/physical.log b/research/p104-retimed-dyadic-endpoint/evidence/physical.log new file mode 100644 index 0000000000..e45a3fb748 --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/evidence/physical.log @@ -0,0 +1,15 @@ +PASS_PINNED_E264_TREE e26425171238e142cc9ffb510fd953f344bd41c7 173859e6ffac6f43f1cd40357967e366d55f5a42 73 +PASS_ENDPOINT_OVERLAY_C_AND_NAMED_PROFILE +binary constant-address physical emitter 18906 104904 2352 111 {'routes': 53796, 'elementary_steps': 1298332} +original output owners, selected axes, physical writes 105216 13440384 143616 +complete two-column raw path 105216 564144 115056 +independent columns 2 16 nonzero paid cuts by copy {2: 16, 16: 15} all cuts 564144 +returned owners 105216 active output axes 13440384 nonzero Hilbert dimensions 262144 22300745198530623141535718272648361505980416 peak handles 115056 +all other outputs retained zero; both nonzero states match the independent closed H-kernel formula +graph 323573 edges 57 direct scalar bits 25146238 basis products 17231591 nontrivial separate divisions +A source signed grid 4 height/entrance 43 41 Mell 71 ceil-log-mass 238 +rotated source signed grid 8 height/entrance 121 118 Mell 148 ceil-log-mass 436 +bound per causal raw context 148 436 +all listed profiles satisfy the finite reserve and clock inequalities +PASS_RETIMED_MULTIPLIER physical +PASS_E264_ENDPOINT physical diff --git a/research/p104-retimed-dyadic-endpoint/evidence/physical.time b/research/p104-retimed-dyadic-endpoint/evidence/physical.time new file mode 100644 index 0000000000..55f9e0b03e --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/evidence/physical.time @@ -0,0 +1 @@ +WALL_SECONDS=348.79 EXIT=0 diff --git a/research/p104-retimed-dyadic-endpoint/evidence/price.log b/research/p104-retimed-dyadic-endpoint/evidence/price.log new file mode 100644 index 0000000000..447063d560 --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/evidence/price.log @@ -0,0 +1,31 @@ +PASS_PINNED_E264_TREE e26425171238e142cc9ffb510fd953f344bd41c7 173859e6ffac6f43f1cd40357967e366d55f5a42 73 +selected-price A 6913 log2 C <= 92141171 +small A 20345 log2 C <= 301819251 +compact A 161992 log2 C <= 2510262059 +balanced A 13674566 log2 C <= 223726063267 +near A 237047783945 log2 C <= 3883790340181683 +matched A 422797742630271 log2 C <= 6927118188548181691 +resolution A 101973332976357367 log2 C <= 1670731087109379198659 +binary / numerical transport pairs 24 54 +PASS_RETIMED_MULTIPLIER cost +PASS_E264_REFIT_FINANCIAL_AND_FIRST_EXTERNAL +kappa 0.00389011528659446 final_margin 1.813580549587408386287279427051544189453125E-19 positive_margin 0.00000383210114058887985026041666666666666666666666667 +source tariff cells 24 54 A 17895697004016101255 first_external {'period_bit_length': 11, 'period_sha256': '3b3ac26a1e5dfbab1b3a8005a8a3770abac420af4c02441bb58fe321fea8d453', 'ticket_bit_lengths': [0, 9, 10], 'ticket_sha256': ['6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d', 'f7a9e5ef9dbd90c8ced3da1e10282b63e5d5184ec95552cb7e0cba7f22ac273d', 'dfe894228db98ec56cc959f75bde08f03b2b57686246aee0fe164dbfa520741f'], 'root_tag': ['root', 'rotated', 0, 4080, 1], 'per_target_probability': '1/624', 'actual_position_probe': 'first swap (1,ticket[1],1) was issued by ComplexRaw.align'} log2C 293203099648000007921699 +PASS_UNMODIFIED_SOURCE_REJECTS_461_AT_PRICE_GUARD 115 +PASS_ENDPOINT_OVERLAY_C_AND_NAMED_PROFILE +PASS_E264_LAST_GRID_FINANCIAL_AND_FIRST_EXTERNAL +kappa 0.003890115286594461 final_margin 1.53517730781387302840812481008470058441162109375E-20 positive_margin 0.00000383210114058792485026041666666666666666666666667 +source tariff cells 24 54 A 35791394008032165519 first_external {'period_bit_length': 11, 'period_sha256': '3b3ac26a1e5dfbab1b3a8005a8a3770abac420af4c02441bb58fe321fea8d453', 'ticket_bit_lengths': [0, 9, 10], 'ticket_sha256': ['6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d', 'f7a9e5ef9dbd90c8ced3da1e10282b63e5d5184ec95552cb7e0cba7f22ac273d', 'dfe894228db98ec56cc959f75bde08f03b2b57686246aee0fe164dbfa520741f'], 'root_tag': ['root', 'rotated', 0, 4080, 1], 'per_target_probability': '1/624', 'actual_position_probe': 'first swap (1,ticket[1],1) was issued by ComplexRaw.align'} log2C 586406199296000007921699 +PASS_461_TWO_DIRECTED_RAW_MARGINS +PASS_461_E264_BINARY_PHYSICAL_TARIFF +PASS_461_FIXED_ITEM_STOP_AND_66_ROOT_CONTROLS +PASS_461_UNIFORM_SOURCE_RANGES_AND_COUPLING_CAPACITIES +PASS_GLOBAL_RAW_CROSSING +64 71759961109033309 unrounded_limit_minus_target_4g -6679915143415124983420909/274877906944000000000000000000000000000000000 rounded_limit_minus_booking_5g -55651073095559943/2199023255552000000000000000000000000 +65 143519922218066619 unrounded_limit_minus_target_4g 1541330907017406039017557/549755813888000000000000000000000000000000000 rounded_limit_minus_booking_5g 7905295224657471/4398046511104000000000000000000000000 +66 287039844436133239 unrounded_limit_minus_target_4g 17983823007882468083894489/1099511627776000000000000000000000000000000000 rounded_limit_minus_booking_5g 27007124810227343/1759218604441600000000000000000000000 +PASS_RAW_AND_ORDINARY_MINIMUM_DYADIC_DEPTH_65 +seven binary stages, 20 arena heads and 91 scratch slots per stage; historical bytes 10752 charged movements 125062 Gaussian sibling base 128 +PASS_DFD_STAGE_FENCES_ON_E264_ENDPOINT +PASS_E264_THREE_SOURCE_CORRUPTIONS_REJECTED +PASS_E264_ENDPOINT price diff --git a/research/p104-retimed-dyadic-endpoint/evidence/price.time b/research/p104-retimed-dyadic-endpoint/evidence/price.time new file mode 100644 index 0000000000..5ad9a7b3d8 --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/evidence/price.time @@ -0,0 +1 @@ +WALL_SECONDS=38.14 EXIT=0 diff --git a/research/p104-retimed-dyadic-endpoint/evidence/product.log b/research/p104-retimed-dyadic-endpoint/evidence/product.log new file mode 100644 index 0000000000..d99df45bf9 --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/evidence/product.log @@ -0,0 +1,5 @@ +PASS_PINNED_E264_TREE e26425171238e142cc9ffb510fd953f344bd41c7 173859e6ffac6f43f1cd40357967e366d55f5a42 73 +PASS_ENDPOINT_OVERLAY_C_AND_NAMED_PROFILE +PASS_E264_LAST_GRID_PROFILE_BOUND_SIGNED_CONTROL +{"dispatch": [[36000, [36000, 1000000000000000000000], 32]], "result": {"product": "-345550037539", "bits": [20, 19], "H_calls": 157248, "coefficients_prefix": [11811, 10996, 4152, 868, 77], "seconds": 109.9017, "shuttles": 138, "padded_bytes": 633744, "rank": 2, "stage_body_records": 6561}} +PASS_E264_ENDPOINT product diff --git a/research/p104-retimed-dyadic-endpoint/evidence/product.time b/research/p104-retimed-dyadic-endpoint/evidence/product.time new file mode 100644 index 0000000000..8a80d65f33 --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/evidence/product.time @@ -0,0 +1 @@ +WALL_SECONDS=118.25 EXIT=0 diff --git a/research/p104-retimed-dyadic-endpoint/evidence/receiver.log b/research/p104-retimed-dyadic-endpoint/evidence/receiver.log new file mode 100644 index 0000000000..f6f554be6c --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/evidence/receiver.log @@ -0,0 +1,24 @@ +PASS_PINNED_E264_TREE e26425171238e142cc9ffb510fd953f344bd41c7 173859e6ffac6f43f1cd40357967e366d55f5a42 73 +PASS_ENDPOINT_OVERLAY_C_AND_NAMED_PROFILE +direct lows 1 true children 1 records 324 physical statistics (8, 116640, 7776) +quotient lows 16 true children 32 records 5184 physical statistics (10, 2790288, 90720) +noncommuting 2 3 1 calls 1 records 648 +noncommuting 2 9 0 calls 1 records 52488 +noncommuting 3 3 2 calls 1 records 5832 +noncommuting 3 3 0 calls 1 records 5832 +complete noncommuting direct comparisons 64800 +physical 2 1 (1, 1, 0, 0) highs 1 children 5 records 648 +physical 2 1 (1, 1, 0, 0) highs 1 children 5 records 648 +physical 3 1 (1, 1, 0, 0) highs 1 children 5 records 2916 +physical 3 1 (1, 1, 0, 0) highs 1 children 3 records 2916 +physical 3 1 (1, 1, 0, 0) highs 1 children 1 records 2916 +physical 2 1 (1, 2, 0, 0) highs 2 children 5 records 26244 +physical 2 1 (2, 1, 0, 0) highs 1 children 3 records 13122 +physical 3 2 (1, 1, 0, 0) highs 1 children 3 records 531441 +physical 2 1 (1, 2, 1, 1) highs 1 children 5 records 531441 +physical cells 1112292 call counts {5: 5, 3: 3, 1: 1} independent modular vectors 2000 +rank 2 low rows 16 native (u,v) pairs 24 mean range 2 3 +rank 3 low rows 416 native (u,v) pairs 234 mean range 27/13 33/13 +rank 4 low rows 33280 native (u,v) pairs 4 mean range 21/10 12/5 +PASS_RETIMED_MULTIPLIER receiver +PASS_E264_ENDPOINT receiver diff --git a/research/p104-retimed-dyadic-endpoint/evidence/receiver.time b/research/p104-retimed-dyadic-endpoint/evidence/receiver.time new file mode 100644 index 0000000000..8f3822b7d1 --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/evidence/receiver.time @@ -0,0 +1 @@ +WALL_SECONDS=162.05 EXIT=0 diff --git a/research/p104-retimed-dyadic-endpoint/evidence/schedule.log b/research/p104-retimed-dyadic-endpoint/evidence/schedule.log new file mode 100644 index 0000000000..4252d4066b --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/evidence/schedule.log @@ -0,0 +1,7 @@ +PASS_PINNED_E264_TREE e26425171238e142cc9ffb510fd953f344bd41c7 173859e6ffac6f43f1cd40357967e366d55f5a42 73 +PASS_ENDPOINT_OVERLAY_C_AND_NAMED_PROFILE +fixed width / slots / groups / actual leaves / raw / zero returns / chart checks 4096 1440 3 2958336 75168 88768 51288 +ticks, native calls, crossing returns, primitive leaves, retired zeros, noncommuting frames 45 135 50 3648 48 221 +nested same-program stream restored both complete 2,048-row schedules; leaves each 30816 +PASS_RETIMED_MULTIPLIER schedule +PASS_E264_ENDPOINT schedule diff --git a/research/p104-retimed-dyadic-endpoint/evidence/schedule.time b/research/p104-retimed-dyadic-endpoint/evidence/schedule.time new file mode 100644 index 0000000000..8b43fe1bce --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/evidence/schedule.time @@ -0,0 +1 @@ +WALL_SECONDS=10.62 EXIT=0 diff --git a/research/p104-retimed-dyadic-endpoint/evidence/slabs.log b/research/p104-retimed-dyadic-endpoint/evidence/slabs.log new file mode 100644 index 0000000000..d5ee498b4a --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/evidence/slabs.log @@ -0,0 +1,7 @@ +PASS_PINNED_E264_TREE e26425171238e142cc9ffb510fd953f344bd41c7 173859e6ffac6f43f1cd40357967e366d55f5a42 73 +PASS_ENDPOINT_OVERLAY_C_AND_NAMED_PROFILE +signed magnitude tapes 21861 plus EOF restoration and two signed product calls +ordinary dispatcher cold 12 direct rank-two slabs 3 arbitrary direct bytes 78732 +bounded-copy chunk crossings 4; round-trip rectangle slabs 3 +PASS_RETIMED_MULTIPLIER slabs +PASS_E264_ENDPOINT slabs diff --git a/research/p104-retimed-dyadic-endpoint/evidence/slabs.time b/research/p104-retimed-dyadic-endpoint/evidence/slabs.time new file mode 100644 index 0000000000..6dd7b62d94 --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/evidence/slabs.time @@ -0,0 +1 @@ +WALL_SECONDS=2.68 EXIT=0 diff --git a/research/p104-retimed-dyadic-endpoint/fixed_c_control.py b/research/p104-retimed-dyadic-endpoint/fixed_c_control.py new file mode 100644 index 0000000000..50b0c326cf --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/fixed_c_control.py @@ -0,0 +1,94 @@ +"""e264 exact-source financial and first-external-location refit; no payload materialization.""" +from collections import Counter +from decimal import Decimal,localcontext +from fractions import Fraction as Q +from pathlib import Path +import hashlib,json,sys + +HERE=Path(__file__).resolve().parent +sys.path.insert(0,str(Path(sys.argv[1]).resolve())) +from upstream import install +install() +from installations import Profile,BINARY_C,GAUSSIAN_C,PROFILES,RESOLUTION +from check_complete import profile_row,tariff,first_external_swap +from independent_binary_price import raw_moments +from strong_binary import graph,caller +from unpowered_price import ranks +from outer_budget import qualify +from outer_clock import financial_checks +from ordinary_clock import first_stage_bound,polynomial_to_fibre_bound + +def dec(x): + with localcontext() as c: + c.prec=48 + return str(Decimal(x.numerator)/Decimal(x.denominator)) +def hashint(x): + return hashlib.sha256(x.to_bytes(max(1,(x.bit_length()+7)//8),'big')).hexdigest() + +profile=Profile(tuple(10**12*16**i for i in range(7)),36000,Q(39,10000), + Q('.003890115286594460'),10**20) +assert profile.kappaprofile.ordinary>profile.kappa+Q(4,profile.positive_stop_denominator) +for args in ((profile.kappa,Q(0),profile.ordinary,positive), + (profile.kappa,Q(1,10**17),profile.ordinary,positive), + (profile.kappa,Q(1,10**20),profile.kappa+Q(4,10**20),positive), + (profile.kappa,Q(1,10**20),profile.ordinary,profile.ordinary)): + try:qualify(*args) + except ArithmeticError:pass + else:raise AssertionError('unfunded border accepted') +cuts=row['binary_cuts'] +assert max(cuts).bit_length()<=64 and row['public_exponent_A'].bit_length()<=64 +first=first_stage_bound(profile.eta);later=polynomial_to_fibre_bound() +assert first+80*profile.rank_logs[0]<1024*profile.rank_logs[0] +assert all(later+80*h<1024*h for h in profile.rank_logs[1:]) +g=Q(1,profile.positive_stop_denominator) +stop_factor_log=((17*profile.positive_stop_denominator)**16-1).bit_length() +assert stop_factor_log==1129 and 400+stop_factor_log+9+2<1600 +financial=financial_checks() +binary_census=raw_moments(graph(),caller()) +binary=tariff(BINARY_C,binary_census,134) +positive_census=ranks() +numeric=tariff(GAUSSIAN_C,positive_census,1224) +assert (binary['cells'],numeric['cells'])==(24,54) +PROFILES['refit']=profile +placement=first_external_swap(positive_census) +first36000=placement['placements']['36000'] +assert first36000['first_tickets'][0]==0 and first36000['first_tickets'][1]>1 +period=first36000['period'];tickets=first36000['first_tickets'] +actual_first={'period_bit_length':period.bit_length(),'period_sha256':hashint(period), + 'ticket_bit_lengths':[x.bit_length() for x in tickets], + 'ticket_sha256':[hashint(x) for x in tickets], + 'root_tag':placement['root_tag'],'per_target_probability':placement['per_target_probability'], + 'actual_position_probe':'first swap (1,ticket[1],1) was issued by ComplexRaw.align'} +previous=Q(0);stages=[] +for i,(h,r) in enumerate(zip(profile.rank_logs,row['stage_rates'],strict=True)): + rate=Q(r);limit=min(profile.eta,(249*(BINARY_C-Q(11,8*h))+previous)/250) + assert previous p) + tails = {r: sum(count for j, count in a.items() if j >= r) for r in high} + if not low or any(count > 0 for count in low.values()) or min(low.values()) >= 0: + raise ValueError('lower coefficients do not force monotonicity') + if any(count < 0 for count in tails.values()): + raise ValueError('negative upper tail') + return low, tails + + +def check(directory): + sys.path.insert(0, str(Path(directory).resolve())) + from upstream import install + install() + from independent_binary_price import raw_moments + from strong_binary import graph, caller + from strict_moment import UNIT, power_interval + + targets, paid = raw_moments(graph(), caller()) + pivot = 8 + coefficients = Counter(targets) + coefficients.subtract(paid) + negative_low, tails = signed_support(coefficients, pivot) + totals = [sum(a * r**t for r, a in coefficients.items()) for t in (0, 1)] + assert totals[0] < 0 < totals[1] + nonpositive_t_bound = coefficients[1] + sum(a for a in coefficients.values() if a > 0) + assert nonpositive_t_bound == -30_678 + # For t>=0, x**t log x is nonnegative and strictly increasing for x>1. + # Summing the upper terms by parts makes the positive derivative explicit. + denom = 1 << 100 + lower = Fraction('.003890115286594461129996942') + upper = Fraction('.003890115286594461129996943') + dy_lo = Fraction(-((-lower * denom) // 1), denom) + dy_hi = Fraction((upper * denom) // 1, denom) + assert lower <= dy_lo < dy_hi <= upper + + def signs(c): + low = 0 + high = 0 + for r, a in coefficients.items(): + lo, hi = power_interval(r, 1-c) + low += min(a*lo, a*hi) + high += max(a*lo, a*hi) + return [low,high] + + pos, neg = signs(dy_lo), signs(dy_hi) + assert pos[0] > 0 > neg[1] + grid = 10**18 + last = (lower*grid)//1 + assert last == (upper*grid)//1 + # Alter one high surplus label, and the certificate must refuse the changed + # structure even though every low coefficient still passes its sign test. + damaged = coefficients.copy() + damaged[127] -= tails[127]+1 + try: + signed_support(damaged, pivot) + except ValueError as exc: + assert str(exc) == 'negative upper tail' + else: + raise AssertionError('corrupt tail passed the monotonicity certificate') + return {'pivot':pivot,'negative_low':negative_low,'upper_tail_counts':tails, + 'D_at_t_zero_and_one':totals,'upper_bound_for_t_at_most_zero':nonpositive_t_bound,'price_bracket_decimal':['0.003890115286594461129996942','0.003890115286594461129996943'], + 'price_bracket_fractions':list(map(str,(lower,upper))), + 'inner_dyadic_witnesses':list(map(str,(dy_lo,dy_hi))), + 'sign_numerators_at_witnesses':[pos,neg],'common_power_scale':UNIT, + 'last_raw_report_tick_numerator':last,'report_denominator':grid, + 'damaged_high_tail_rejected':True} + +if __name__=='__main__': + print(json.dumps(check(sys.argv[1]),indent=2)) diff --git a/research/p104-retimed-dyadic-endpoint/lean/Consumer.lean b/research/p104-retimed-dyadic-endpoint/lean/Consumer.lean new file mode 100644 index 0000000000..fec459fa80 --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/lean/Consumer.lean @@ -0,0 +1,8 @@ +import Endpoint +#print axioms Endpoint461.all_bookings +#print axioms Endpoint461.all_roundings +#print axioms Endpoint461.signed_booking +#print axioms Endpoint461.signed_strict +#print axioms Endpoint461.conditional_endpoint +#print axioms Endpoint461.damaged_c_rejected +#print axioms Endpoint461.next_tick_rejected diff --git a/research/p104-retimed-dyadic-endpoint/lean/Endpoint.lean b/research/p104-retimed-dyadic-endpoint/lean/Endpoint.lean new file mode 100644 index 0000000000..da5751d6a4 --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/lean/Endpoint.lean @@ -0,0 +1,150 @@ +/-! +A Lean-core certificate for the literal seven-stage .594461 endpoint. + +Rates use units 10^-21. For stage i, the raw service price is C/D - +11/(8 H_i), with C/D = 287039844436133239/2^66. The ordinary limit before +its eta cap is (249*(C/D - 11/(8 H_i)) + previous)/250. `booked` is the +exact positive-denominator cross multiplication of previous < rate < +min(39/10000, limit). `one_tick` additionally checks that the first six +rates are exactly floor(10^21 * limit) - 1. No floating point is used. + +The directed raw-word upper endpoint is an INPUT from the external 112-bit +source audit: this file proves its separation from the next 10^-18 tick; it +does not prove the source interpretation, the outward interval itself, the +transport or the complete multiplier. Source: pinned e264 price recurrence. +-/ + +set_option maxRecDepth 100000 +set_option maxHeartbeats 0 + +namespace Endpoint461 + +def C : Nat := 287039844436133239 +def D : Nat := 73786976294838206464 -- 2^66 +def G : Nat := 1000000000000000000000 -- 10^21 + +def H1 : Nat := 2000000000000 +def H2 : Nat := 32000000000000 +def H3 : Nat := 512000000000000 +def H4 : Nat := 8192000000000000 +def H5 : Nat := 131072000000000000 +def H6 : Nat := 2097152000000000000 +def H7 : Nat := 33554432000000000000 + +def B1 : Nat := 3874554824763333282 +def B2 : Nat := 3890053044704339740 +def B3 : Nat := 3890115037624225836 +def B4 : Nat := 3890115285598413010 +def B5 : Nat := 3890115286590466485 +def B6 : Nat := 3890115286594444495 +def B7 : Nat := 3890115286594461005 +def K : Nat := 3890115286594461000 + +/-- All terms are nonnegative; move the debit to the left before comparing. -/ +def rhs (c previous h : Nat) : Nat := + 249*c*G*8*h + previous*D*8*h + +def lhs (rate h : Nat) : Nat := + 250*rate*D*8*h + 249*11*D*G + +abbrev booked (c previous rate h : Nat) : Prop := + 0 < h ∧ previous < rate ∧ 10000*rate < 39*G ∧ lhs rate h < rhs c previous h + +abbrev one_tick (c previous rate h : Nat) : Prop := + lhs (rate+1) h ≤ rhs c previous h ∧ rhs c previous h < lhs (rate+2) h + +/-- The uncapped price is below eta: then min(eta,price) is price. -/ +abbrev eta_price (c previous h : Nat) : Prop := + 10000*(rhs c previous h) < 39*250*G*D*8*h + 10000*249*11*D*G + +theorem binary_denominator : D = 2^66 := by decide +theorem grid_denominator : G = 10^21 := by decide + +theorem booked1 : booked C 0 B1 H1 := by decide +theorem booked2 : booked C B1 B2 H2 := by decide +theorem booked3 : booked C B2 B3 H3 := by decide +theorem booked4 : booked C B3 B4 H4 := by decide +theorem booked5 : booked C B4 B5 H5 := by decide +theorem booked6 : booked C B5 B6 H6 := by decide +theorem booked7 : booked C B6 B7 H7 := by decide + +theorem rounded1 : one_tick C 0 B1 H1 := by decide +theorem rounded2 : one_tick C B1 B2 H2 := by decide +theorem rounded3 : one_tick C B2 B3 H3 := by decide +theorem rounded4 : one_tick C B3 B4 H4 := by decide +theorem rounded5 : one_tick C B4 B5 H5 := by decide +theorem rounded6 : one_tick C B5 B6 H6 := by decide + +theorem cap1 : eta_price C 0 H1 := by decide +theorem cap2 : eta_price C B1 H2 := by decide +theorem cap3 : eta_price C B2 H3 := by decide +theorem cap4 : eta_price C B3 H4 := by decide +theorem cap5 : eta_price C B4 H5 := by decide +theorem cap6 : eta_price C B5 H6 := by decide +theorem cap7 : eta_price C B6 H7 := by decide + +theorem signed_booking : B7 = K + 5 := by decide +theorem signed_strict : K + 4 < B7 := by decide + +/-- hi/10^27 is the *externally certified* directed raw crossing upper. -/ +def hi : Nat := 3890115286594461129996943 +def nextGrid : Nat := 3890115286594462 -- denominator 10^18 + +theorem upper_below_next : hi < nextGrid * 10^9 := by decide +theorem current_trial_below_upper : C*10^27 < hi*D := by decide + +/-- Given any positive-denominator rational upper-bounded by the external hi, + that rational lies strictly below the next 10^-18 grid point. -/ +theorem conditional_endpoint (numerator denominator : Nat) (positive : 0 < denominator) + (directed_raw_upper : numerator*10^27 ≤ hi*denominator) : + numerator*10^27 < (nextGrid*10^9)*denominator := + Nat.lt_of_le_of_lt directed_raw_upper (Nat.mul_lt_mul_of_pos_right upper_below_next positive) + +/-- Corruption controls: decrementing c's numerator spoils the booked first + stage, while raising κ by a whole 10^-18 tick spoils the final stage. -/ +theorem damaged_c_rejected : ¬ booked (C-1) 0 B1 H1 := by decide +theorem next_tick_rejected : ¬ booked C B6 (K+1005) H7 := by decide + +theorem all_bookings : booked C 0 B1 H1 ∧ booked C B1 B2 H2 ∧ + booked C B2 B3 H3 ∧ booked C B3 B4 H4 ∧ booked C B4 B5 H5 ∧ + booked C B5 B6 H6 ∧ booked C B6 B7 H7 := + ⟨booked1, booked2, booked3, booked4, booked5, booked6, booked7⟩ + +theorem all_roundings : one_tick C 0 B1 H1 ∧ one_tick C B1 B2 H2 ∧ + one_tick C B2 B3 H3 ∧ one_tick C B3 B4 H4 ∧ + one_tick C B4 B5 H5 ∧ one_tick C B5 B6 H6 := + ⟨rounded1, rounded2, rounded3, rounded4, rounded5, rounded6⟩ + +#print axioms binary_denominator +#print axioms grid_denominator +#print axioms all_bookings +#print axioms all_roundings +#print axioms booked1 +#print axioms booked2 +#print axioms booked3 +#print axioms booked4 +#print axioms booked5 +#print axioms booked6 +#print axioms booked7 +#print axioms rounded1 +#print axioms rounded2 +#print axioms rounded3 +#print axioms rounded4 +#print axioms rounded5 +#print axioms rounded6 +#print axioms cap1 +#print axioms cap2 +#print axioms cap3 +#print axioms cap4 +#print axioms cap5 +#print axioms cap6 +#print axioms cap7 +#print axioms signed_booking +#print axioms signed_strict +#print axioms upper_below_next +#print axioms current_trial_below_upper +#print axioms conditional_endpoint +#print axioms damaged_c_rejected +#print axioms next_tick_rejected + +end Endpoint461 diff --git a/research/p104-retimed-dyadic-endpoint/lean/verify.py b/research/p104-retimed-dyadic-endpoint/lean/verify.py new file mode 100644 index 0000000000..248ad37721 --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/lean/verify.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python3 +"""Replay the Lean 4 core endpoint, axiom audit, olean import and corruptions.""" +import argparse, hashlib, os, pathlib, re, subprocess, tempfile, time + +HERE=pathlib.Path(__file__).resolve().parent +EXPECTED='2d2ff39d4fdf9d4fb4e60e842ff2ceb62e197e1339d01c924610f20e25ae0f44' + +def main(): + p=argparse.ArgumentParser() + p.add_argument('lean',help='path to a Lean 4 binary, e.g. /path/to/bin/lean') + args=p.parse_args() + lean=str(pathlib.Path(args.lean).resolve()) + data=(HERE/'Endpoint.lean').read_bytes() + assert hashlib.sha256(data).hexdigest()==EXPECTED + source=data.decode('utf-8') + assert not re.search(r'\b(sorry|admit|axiom|unsafe|native_decide)\b',source) + names=re.findall(r'^#print axioms (\w+)\s*$',source,re.M) + assert len(names)==31 and len(names)==len(set(names)) + version=subprocess.check_output([lean,'--version'],text=True).strip() + start=time.monotonic() + with tempfile.TemporaryDirectory(prefix='kernel-replay-') as folder: + work=pathlib.Path(folder) + (work/'Endpoint.lean').write_bytes(data) + run=subprocess.run([lean,'--trust=0','-o','Endpoint.olean','Endpoint.lean'], + cwd=work,text=True,capture_output=True) + assert run.returncode==0,(run.returncode,run.stdout,run.stderr) + lines=run.stdout.splitlines() + assert len(lines)==len(names),(len(lines),len(names)) + assert all("'Endpoint461."+name+"' does not depend on any axioms" in lines + for name in names) + assert 'sorryAx' not in run.stdout+run.stderr + (work/'Consumer.lean').write_text((HERE/'Consumer.lean').read_text()) + env=os.environ.copy();env['LEAN_PATH']=str(work) + consumer=subprocess.run([lean,'--trust=0','Consumer.lean'],cwd=work,env=env, + text=True,capture_output=True) + assert consumer.returncode==0,(consumer.stdout,consumer.stderr) + assert len(consumer.stdout.splitlines())==7 + assert all('does not depend on any axioms' in line for line in consumer.stdout.splitlines()) + checker=pathlib.Path(lean).with_name('leanchecker') + separate='not available in this toolchain' + if checker.exists(): + env['PATH']=str(checker.parent)+os.pathsep+env.get('PATH','') + replay=subprocess.run([str(checker),'-v','Endpoint'],cwd=work,env=env, + text=True,capture_output=True) + assert replay.returncode==0 and 'replaying Endpoint' in replay.stdout+replay.stderr + separate='passed' + changes=[('DamagedC','def C : Nat := 287039844436133239', + 'def C : Nat := 287039844436133238'), + ('NextTick','def K : Nat := 3890115286594461000', + 'def K : Nat := 3890115286594462000')] + for name,before,after in changes: + assert source.count(before)==1 + (work/f'{name}.lean').write_text(source.replace(before,after)) + bad=subprocess.run([lean,'--trust=0',f'{name}.lean'],cwd=work,text=True,capture_output=True) + assert bad.returncode!=0 and re.search( + r"error:\s*tactic\s+['`]decide['`]\s+proved that the proposition", + bad.stdout,re.I) + print('LEAN_VERSION',version) + print('SOURCE_SHA256',EXPECTED) + print('TRUST_ZERO_AXIOM_FREE_DECLARATIONS',len(names)) + print('TRUST_ZERO_OLEAN_IMPORT_AXIOM_FREE',7) + print('SEPARATE_LEANCHECKER',separate) + print('CORRUPTION_REJECTIONS','damaged_c','next_kappa_tick') + print('OBSERVED_ELAPSED_SECONDS',round(time.monotonic()-start,3)) + print('PASS_ENDPOINT461_LEAN_CORE') + +if __name__=='__main__':main() diff --git a/research/p104-retimed-dyadic-endpoint/old_c_negative.py b/research/p104-retimed-dyadic-endpoint/old_c_negative.py new file mode 100644 index 0000000000..874e530210 --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/old_c_negative.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python3 +"""The unmodified e264 binary trial cannot fund the .461 candidate.""" +from pathlib import Path +from fractions import Fraction as Q +import sys +import traceback + +ROOT=Path(__file__).resolve().parent +sys.path.insert(0,str(Path(sys.argv[1]).resolve())) +sys.path.insert(1,str(ROOT)) +from upstream import install +install() +from installations import Profile,BINARY_C +from activation import resource_receipt +from check_complete import profile_row + +assert BINARY_C == Q(4484997569314581,2**60) +p=Profile(tuple(2*10**12*16**j for j in range(7)),36000, + Q(39,10000),Q('.003890115286594461'),10**21) +assert BINARY_C < p.kappa < p.ordinary +resource_receipt(p) +try: + profile_row(p) +except AssertionError as error: + frames=traceback.extract_tb(error.__traceback__) + last=frames[-1] + assert last.filename.endswith('/check_complete.py') + assert last.line=='assert prev < b < limit' + print('PASS_UNMODIFIED_SOURCE_REJECTS_461_AT_PRICE_GUARD',last.lineno) +else: + raise AssertionError('The unmodified binary trial unexpectedly funded .461') diff --git a/research/p104-retimed-dyadic-endpoint/predecessor-8030.tar.gz b/research/p104-retimed-dyadic-endpoint/predecessor-8030.tar.gz new file mode 100644 index 0000000000..e00a6bfe83 Binary files /dev/null and b/research/p104-retimed-dyadic-endpoint/predecessor-8030.tar.gz differ diff --git a/research/p104-retimed-dyadic-endpoint/source-e264.tar.gz b/research/p104-retimed-dyadic-endpoint/source-e264.tar.gz new file mode 100644 index 0000000000..1a2ba4ba9e Binary files /dev/null and b/research/p104-retimed-dyadic-endpoint/source-e264.tar.gz differ diff --git a/research/p104-retimed-dyadic-endpoint/uniform_ranges.py b/research/p104-retimed-dyadic-endpoint/uniform_ranges.py new file mode 100644 index 0000000000..d40ab0b5ad --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/uniform_ranges.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python3 +"""Exact parameter checks for the dfd stage-store/retimed uniform ranges.""" +from collections import Counter +from fractions import Fraction as Q +from pathlib import Path +import json +import sys + +ROOT=Path(__file__).resolve().parent +sys.path.insert(0,str(Path(sys.argv[1]).resolve())) +sys.path.insert(1,str(ROOT)) +from upstream import install +install() +from installations import BINARY_C +from raw_binary_stage import binary_word +from unpowered_price import certify, intervals +from strict_moment import UNIT + +w=binary_word() +targets,paid=Counter(w.targets),Counter(w.paid) +old=Q(4484997569314581,2**60) +newmargin,new=certify(BINARY_C,(targets,paid)) +oldmargin,prior=certify(old,(targets,paid)) +t=1-BINARY_C +assert 0Q(996,1000) +assert newmargin>0 and oldmargin>0 +assert set(new)==set(prior) and len(new)==24 +assert sum(targets.values())==18906<2**16 +assert sum(paid.values())==104904<2**19 +assert max(targets)==127 and min(paid)==1 and max(paid)==56 +assert all(4*k>=5*r and q>0 for (r,k),q in new.items()) +assert min(new.values())/sum(targets.values())>Q(1,2**64) +assert all(sum(q for (r,k),q in new.items() if r==rr)==1 for rr in paid) +targets_mass={k:n*intervals(k,t)[0] for k,n in targets.items()} +paid_mass={r:n*intervals(r,t)[1] for r,n in paid.items()} +T,P=sum(targets_mass.values()),sum(paid_mass.values()) +assert all(sum(paid_mass[r]*q for (r,z),q in new.items() if z==k) + == Q(targets_mass[k]*P,T) for k in targets) +assert Q(P,T)>Q(99,100) and Q(P,UNIT)>10 +assert 6**77 > 2**20*5**77 +assert 2**21 < (1024*134*32768)**77 +# For H>=1024, N>=2: t>1/2 and L>=4 give t*L^t>1; +# 2N < N^6. Therefore ceil integral births <2 N^6 per tick. +assert Q(1,2)**2*32768 > 1 and 2*2 < 2**6 +# <=2N^6 births/tick, 2^20', + 'cohort_guard':'2^68 N^83 < N^92 for H>=1024', + 'stage_head_allowance':888, + 'scope':'exact parameter and source checks; dfd source-to-role interpretation is written'} +Path(sys.argv[2]).write_text(json.dumps(result,indent=2,sort_keys=True)+'\n') +print('PASS_461_UNIFORM_SOURCE_RANGES_AND_COUPLING_CAPACITIES') diff --git a/research/p104-retimed-dyadic-endpoint/verify.py b/research/p104-retimed-dyadic-endpoint/verify.py new file mode 100644 index 0000000000..eb14c6d565 --- /dev/null +++ b/research/p104-retimed-dyadic-endpoint/verify.py @@ -0,0 +1,160 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +"""Authenticate the e264 source and replay a single bounded refit case.""" +from argparse import ArgumentParser +from hashlib import sha1,sha256 +import json +from pathlib import Path, PurePosixPath +import subprocess +import shutil +import sys +import tarfile +from tempfile import TemporaryDirectory + +HERE=Path(__file__).resolve().parent +HEAD='e26425171238e142cc9ffb510fd953f344bd41c7' +TREE='173859e6ffac6f43f1cd40357967e366d55f5a42' + + +def check(ok,message): + if not ok: + raise ValueError(message) + + +def git_oid(kind,data): + return sha1(kind.encode()+b' '+str(len(data)).encode()+b'\0'+data).hexdigest() + + +def tree_id(rows): + nodes={};entries=[] + for name,oid in rows.items(): + node,sep,tail=name.partition('/') + if sep: + nodes.setdefault(node,{})[tail]=oid + else: + entries.append((node,'100644',oid)) + entries.extend((n,'40000',tree_id(v)) for n,v in nodes.items()) + entries.sort(key=lambda row:(row[0]+('/' if row[1]=='40000' else '')).encode()) + return git_oid('tree',b''.join(mode.encode()+b' '+name.encode()+b'\0'+bytes.fromhex(oid) + for name,mode,oid in entries)) + + +def checked_source(dest): + spec=json.loads((HERE/'SOURCE-E264.json').read_bytes()) + check(spec['head']==HEAD and spec['source_tree']==TREE,'pinned e264 head and source tree') + raw=(HERE/'source-e264.tar.gz').read_bytes() + check(sha256(raw).hexdigest()==spec['source_archive_sha256'],'e264 archive checksum') + records={x['path']:x for x in spec['files']} + check(len(records)==len(spec['files'])==72,'complete distinct e264 metadata') + seen={} + with tarfile.open(HERE/'source-e264.tar.gz','r:gz') as archive: + for item in archive: + name=item.name;parts=PurePosixPath(name).parts + check(parts and '/'.join(parts)==name and '\\' not in name and + all(x not in ('/', '.', '..') for x in parts) and name not in seen and + name in records and item.isfile() and not item.linkname, + 'confined unique regular source file '+name) + row=records[name] + check(item.size==row['size'] and 0<=item.size<=4*1024*1024,'source size '+name) + with archive.extractfile(item) as f: + data=f.read() + check(len(data)==item.size and sha256(data).hexdigest()==row['sha256'] and + git_oid('blob',data)==row['git_blob'],'literal e264 blob '+name) + path=dest.joinpath(*parts);path.parent.mkdir(parents=True,exist_ok=True) + with path.open('xb') as out:out.write(data) + seen[name]=row['git_blob'] + check(set(seen)==set(records),'complete e264 archive') + pin=spec['large_blob'];data=(HERE/'predecessor-8030.tar.gz').read_bytes() + check(pin['path']=='predecessor/predecessor-8030.tar.gz' and + sha256(data).hexdigest()==pin['sha256'] and git_oid('blob',data)==pin['git_blob'], + 'complete predecessor archive') + path=dest/pin['path'];path.parent.mkdir(exist_ok=True,parents=True) + with path.open('xb') as out:out.write(data) + seen[pin['path']]=pin['git_blob'] + check(tree_id(seen)==TREE,'exact complete e264 Git package tree') + print('PASS_PINNED_E264_TREE',HEAD,TREE,len(seen),flush=True) + + +def run(*args): + subprocess.run([sys.executable,'-I','-B',*(str(x) for x in args)],check=True) + + + +def changed_source(source,dest): + shutil.copytree(source,dest) + spec=json.loads((HERE/'ENDPOINT-OVERLAY.json').read_bytes()) + check(spec['parent_head']==HEAD and spec['path']=='installations.py','overlay parent') + path=dest/spec['path'];raw=path.read_bytes() + check(sha256(raw).hexdigest()==spec['old_sha256'],'overlay original') + text=raw.decode() + for old,new in spec['edits']: + check(text.count(old)==1,'unique overlay anchor') + text=text.replace(old,new) + data=(text+spec['append']).encode() + check(sha256(data).hexdigest()==spec['new_sha256'],'overlay changed source') + path.write_bytes(data) + print('PASS_ENDPOINT_OVERLAY_C_AND_NAMED_PROFILE',flush=True) + + +def install(source,machine): + subprocess.run([sys.executable,'-I','-B',str(source/'bootstrap.py'),str(machine)],check=True) + helpers=('activation.py','check_complete.py','check_installation.py','ordinary_clock.py', + 'outer_clock.py','outer_budget.py','resolution.py','equal_rate.py','RESULT.json') + for name in helpers: + shutil.copyfile(source/name,machine/name) + + +def compare_json(actual,expected): + check(json.loads(actual.read_bytes())==json.loads((HERE/expected).read_bytes()), + 'sealed receipt '+expected) + + +def main(): + cli=ArgumentParser(description=__doc__) + cli.add_argument('case',choices=('baseline','price','install','schedule','physical','receiver','slabs','product')) + args=cli.parse_args() + check(sys.version_info[:2]==(3,12) and sys.implementation.name=='cpython' and __debug__, + 'CPython 3.12 with assertions required') + with TemporaryDirectory(prefix='p104-e264-endpoint-') as work: + root=Path(work);source=root/'source';source.mkdir();checked_source(source) + if args.case=='baseline': + run(source/'verify.py','cost') + elif args.case=='price': + # Source baseline and its fixed-c .460 control use the old c in a + # separate interpreter before the 66-bit candidate is installed. + run(source/'verify.py','cost') + oldmachine=root/'oldmachine';install(source,oldmachine) + control=root/'fixed-c.json' + run(HERE/'fixed_c_control.py',oldmachine,source,control) + compare_json(control,'FIXED-C-CONTROL.json') + run(HERE/'old_c_negative.py',oldmachine) + changed=root/'changed';changed_source(source,changed) + machine=root/'machine';install(changed,machine) + for script,expected in (('endpoint_price.py','ENDPOINT-PRICE.json'), + ('endpoint_tariff.py','ENDPOINT-TARIFF.json'), + ('endpoint_setup.py','ENDPOINT-SETUP.json'), + ('uniform_ranges.py','UNIFORM-RANGES.json')): + out=root/(script+'.json');run(HERE/script,machine,out);compare_json(out,expected) + out=subprocess.check_output([sys.executable,'-I','-B',str(HERE/'global_crossing.py'),str(machine)]) + check(json.loads(out)==json.loads((HERE/'GLOBAL-CROSSING.json').read_bytes()),'global crossing receipt') + print('PASS_GLOBAL_RAW_CROSSING',flush=True) + run(HERE/'denominator_design.py') + run(HERE/'dfd_checks.py',machine) + run(HERE/'check_integrity.py') + else: + changed=root/'changed';changed_source(source,changed) + if args.case in ('schedule','physical','receiver','slabs'): + run(changed/'verify.py',args.case) + else: + machine=root/'machine';install(changed,machine) + if args.case=='install': + out=root/'runtime.json' + run(HERE/'endpoint_monitored.py',source,machine,out) + compare_json(out,'ENDPOINT-RUNTIME.json') + elif args.case=='product': + run(HERE/'endpoint_product.py',machine) + print('PASS_E264_ENDPOINT',args.case,flush=True) + + +if __name__=='__main__': + main()