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-shortcut-eta-target/ATLAS.json b/research/p104-shortcut-eta-target/ATLAS.json new file mode 100644 index 0000000000..55a3b21c3d --- /dev/null +++ b/research/p104-shortcut-eta-target/ATLAS.json @@ -0,0 +1 @@ +{"atlas_sha256": "f581128079a67c9fc6341ee96dce772342748f508c77f7d5956bf41408d97f58", "contacts": {"atlas_sha256": "bc28417912a4dcc1a949990776163791f772d9dace2254af8090dac32c9f6930", "contacts": 6656, "maximum_contact_records": 170, "walsh_phase_values": 95420416}, "images": {"basis_images": 1938432, "distinct_factors": 3786, "factor_occurrences": 6136, "maximum_factor_records": 93}, "pairs": 2964, "ports": 104} diff --git a/research/p104-shortcut-eta-target/BILL-INPUTS.json b/research/p104-shortcut-eta-target/BILL-INPUTS.json new file mode 100644 index 0000000000..279a1d6a95 --- /dev/null +++ b/research/p104-shortcut-eta-target/BILL-INPUTS.json @@ -0,0 +1,753 @@ +{ + "entry": { + "eta": "39/10000", + "gaussian_height": 1024, + "kappa": "69/20000", + "ordinary_heights": [ + 3000, + 3080 + ], + "stop_denominator": 1000000000000000000 + }, + "gaussian": { + "ambient": 306, + "cells": [ + [ + "1/2", + "1", + "31223791220247958189074039343229813613604250988572874496397130629218566144/31308343368750722590446554892589758430633301153504668578991732166798033155" + ], + [ + "1/2", + "2", + "84552148502764401372515549359944817029050164931794082594601537579467011/31308343368750722590446554892589758430633301153504668578991732166798033155" + ], + [ + "1", + "2", + "197545821959375959667401933718562718598167402204119271489107081171522365682991/197646598424581381094423818818723984807232785527337807406375716057905564221440" + ], + [ + "1", + "3", + "100776465205421427021885100161266209065383323218535917268634886383198538449/197646598424581381094423818818723984807232785527337807406375716057905564221440" + ], + [ + "2", + "3", + "1453735872760501575234447709613049030866873779768015348088255651725530185551/35837354306797876619729994611562287722503569132625615740955026270064461898176682" + ], + [ + "2", + "4", + "4036431474657277548092793145836722634597769538078848109299530072400079490784/663654709385145863328333233547449772638954983937511402610278264260452998114383" + ], + [ + "2", + "5", + "158014729090129947325819901043335111722364747525971965693877632862927332990/663654709385145863328333233547449772638954983937511402610278264260452998114383" + ], + [ + "2", + "6", + "10369879295701624676971171702314074716358803469173119494255906227255784272185/1327309418770291726656666467094899545277909967875022805220556528520905996228766" + ], + [ + "2", + "7", + "5513414823788485825694736373586923780026811913681696269007480634787981375/39038512316773286078137249032202927802291469643383023682957544956497235183199" + ], + [ + "2", + "8", + "166490561100159723605739429803377745830184431938620697655048501920354306760096/663654709385145863328333233547449772638954983937511402610278264260452998114383" + ], + [ + "2", + "9", + "1635879450978746417994408519467487415893254177413476871982399038659091891795/234231073900639716468823494193217566813748817860298142097745269738983411099194" + ], + [ + "2", + "10", + "28428873448626367576933560570959950092758787307064420827157473203143203714626/663654709385145863328333233547449772638954983937511402610278264260452998114383" + ], + [ + "2", + "12", + "3099126398220930552363767397939533450123384458557656995988425232766339040477/1990964128155437589984999700642349317916864951812534207830834792781358994343149" + ], + [ + "2", + "14", + "50588630775672110083779059021723776008771406302687385436359684846485093492688/1990964128155437589984999700642349317916864951812534207830834792781358994343149" + ], + [ + "2", + "16", + "45402866072217821246901887408390468858131288446754652333354101373405712205834/663654709385145863328333233547449772638954983937511402610278264260452998114383" + ], + [ + "2", + "17", + "1263815308504060484205158185013130180072812137100137496374421235731740419130/1990964128155437589984999700642349317916864951812534207830834792781358994343149" + ], + [ + "2", + "18", + "21107530325913467123819494028737696355488554543712530593866878915552580259920121/35837354306797876619729994611562287722503569132625615740955026270064461898176682" + ], + [ + "3", + "18", + "1" + ], + [ + "4", + "18", + "1" + ], + [ + "5", + "18", + "1" + ], + [ + "6", + "18", + "54247740329085375130771593412065222786753227157070527888193685538800345545586341/79951934736872021305296364609974219973356788217814030469872550138559749097207531" + ], + [ + "6", + "25", + "66807272490243060136610267275778597261748994227105223216744896307450597194480/26650644912290673768432121536658073324452262739271343489957516712853249699069177" + ], + [ + "6", + "33", + "88090131694814051674984424583385056058205468817479462688931751558912646688080/26650644912290673768432121536658073324452262739271343489957516712853249699069177" + ], + [ + "6", + "34", + "199647710875287750517039120241231653743375161346868481346952713505642270153128/650015729568065213864198086259953007913469822909057158291646749093981699977297" + ], + [ + "6", + "41", + "109352668789045232016914627470720588822281586214539130760173009128167301269180/26650644912290673768432121536658073324452262739271343489957516712853249699069177" + ], + [ + "6", + "49", + "354775751203945829443431450247851049741708067301307926006131867581812687331226/79951934736872021305296364609974219973356788217814030469872550138559749097207531" + ], + [ + "7", + "49", + "1" + ], + [ + "8", + "49", + "15329663569424308414958643077310150003668672223975856583496503732538346371184/50801688139912969908189955129293861416381617964036545767772609409076663856155741" + ], + [ + "8", + "50", + "12019483917791627060165396227690433443882360890155089505920326729616506705064068/16933896046637656636063318376431287138793872654678848589257536469692221285385247" + ], + [ + "8", + "57", + "151831584040281374944118469530121164490967120883773659834207036516622439819880/16933896046637656636063318376431287138793872654678848589257536469692221285385247" + ], + [ + "8", + "65", + "173052585003281721406685746858409787467291277844800859867402578873117292241580/16933896046637656636063318376431287138793872654678848589257536469692221285385247" + ], + [ + "8", + "66", + "13753254215837975130226395153979658078856091425161577834323303870325386198407973/50801688139912969908189955129293861416381617964036545767772609409076663856155741" + ], + [ + "10", + "66", + "33792374355210061203295104763778640134975269682384737828451590675680267498074647/88760111792878023771671625675352048165976768685301492065332210775545551414291788" + ], + [ + "10", + "82", + "54967737437667962568376520911573408031001499002916754236880620099865283916217141/88760111792878023771671625675352048165976768685301492065332210775545551414291788" + ], + [ + "12", + "82", + "4054099327310628693904906602191556175630247312985439846416848610152205756662803/13722931691350872843774719675379442511731670110215838282028360633618719683124037" + ], + [ + "12", + "98", + "9668832364040244149869813073187886336101422797230398435611512023466513926461234/13722931691350872843774719675379442511731670110215838282028360633618719683124037" + ], + [ + "14", + "98", + "1" + ], + [ + "16", + "98", + "1" + ], + [ + "24", + "98", + "1" + ], + [ + "32", + "98", + "1" + ], + [ + "40", + "98", + "1" + ], + [ + "48", + "98", + "261811228154661635699372364449191337659202268669618602461408859285288668238405/448787936491574690857053805035902639425109327947260712662623006144922592810864" + ], + [ + "48", + "114", + "186976708336913055157681440586711301765907059277642110201214146859633924572459/448787936491574690857053805035902639425109327947260712662623006144922592810864" + ], + [ + "56", + "114", + "1" + ], + [ + "64", + "114", + "1" + ], + [ + "80", + "114", + "800278241295943644884499870051327610051513718810523767895957115684633634658570/2214916436293483545085512886764680579422954654069476934979651758988336267259041" + ], + [ + "80", + "129", + "19761094088211427502397463285026539553330582590924932120334928826688988718095/2214916436293483545085512886764680579422954654069476934979651758988336267259041" + ], + [ + "80", + "130", + "3092853882282324773167661980994071906470311203255051518765764333651914953176/4911122918610828259613110613668914810250453778424560831440469532124914118091" + ], + [ + "96", + "130", + "348044177318807672968389271345716992920901261273099011845520989253516706807/420654067482957396114834073543070686604209135960299325306536339175036979583" + ], + [ + "96", + "258", + "72609890164149723146444802197353693683307874687200313461015349921520272776/420654067482957396114834073543070686604209135960299325306536339175036979583" + ], + [ + "112", + "258", + "1" + ] + ], + "debit": "32493/262144", + "largest_target": 258, + "level_floor": 1874, + "paid": [ + [ + "1/2", + 10080 + ], + [ + "1", + 911520 + ], + [ + "2", + 82862352 + ], + [ + "3", + 114240 + ], + [ + "4", + 17069808 + ], + [ + "5", + 76320 + ], + [ + "6", + 10314288 + ], + [ + "7", + 2400 + ], + [ + "8", + 4920816 + ], + [ + "10", + 6884064 + ], + [ + "12", + 887568 + ], + [ + "14", + 216480 + ], + [ + "16", + 612384 + ], + [ + "24", + 6240 + ], + [ + "32", + 569088 + ], + [ + "40", + 6240 + ], + [ + "48", + 569088 + ], + [ + "56", + 6240 + ], + [ + "64", + 562848 + ], + [ + "80", + 562848 + ], + [ + "96", + 562848 + ], + [ + "112", + 562848 + ] + ], + "targets": [ + [ + "1", + 5040 + ], + [ + "2", + 456768 + ], + [ + "3", + 2400 + ], + [ + "4", + 252672 + ], + [ + "5", + 7920 + ], + [ + "6", + 216720 + ], + [ + "7", + 3360 + ], + [ + "8", + 5225088 + ], + [ + "9", + 129360 + ], + [ + "10", + 714384 + ], + [ + "12", + 21648 + ], + [ + "14", + 303072 + ], + [ + "16", + 714384 + ], + [ + "17", + 6240 + ], + [ + "18", + 11668272 + ], + [ + "25", + 6240 + ], + [ + "33", + 6240 + ], + [ + "34", + 562848 + ], + [ + "41", + 6240 + ], + [ + "49", + 6240 + ], + [ + "50", + 562848 + ], + [ + "57", + 6240 + ], + [ + "65", + 6240 + ], + [ + "66", + 562848 + ], + [ + "82", + 562848 + ], + [ + "98", + 562848 + ], + [ + "114", + 562848 + ], + [ + "129", + 3120 + ], + [ + "130", + 562848 + ], + [ + "258", + 281424 + ] + ], + "trial": "2144845547/549755813888", + "typed_counts": [ + 282336, + 281328 + ], + "upper_divisor": 1724 + }, + "ordinary": { + "cells": [ + [ + "1", + "4", + "2273215950465131342009579210393548491098967147250281011235262403709715143/32219796766811029813605848933200306980196221123369196495501599640276434944" + ], + [ + "1", + "8", + "29946580816345898471596269722806758489097253976118915484266337236566719801/32219796766811029813605848933200306980196221123369196495501599640276434944" + ], + [ + "2", + "8", + "1797198386338945236537211059007140809947993438884715371233240941556479021615/2381942444102927876165986031141444187293898626102445791176122019546374868632" + ], + [ + "2", + "15", + "9684773237154065560430421190230551498994668429956748106055959700252781945/132330135783495993120332557285635788182994368116802543954229001085909714924" + ], + [ + "2", + "22", + "7091564311187028877482620458976840202341691465963495934168142051585870455/66165067891747996560166278642817894091497184058401271977114500542954857462" + ], + [ + "2", + "29", + "155121824292476419951653054186987203079700262703823100403820689528254435627/2381942444102927876165986031141444187293898626102445791176122019546374868632" + ], + [ + "3", + "29", + "1" + ], + [ + "4", + "29", + "98334412767228253464854682164987813930603242370466181704235702223666176027/530417055108530766462034842874957275845809969888466010902972596698948639285" + ], + [ + "4", + "36", + "432082642341302512997180160709969461915206727517999829198736894475282463258/530417055108530766462034842874957275845809969888466010902972596698948639285" + ], + [ + "5", + "36", + "1" + ], + [ + "6", + "36", + "277184624447344577370258042676795996941425088716292163487811186440537362193/839760630209056248928545885906851451505394484079192944197097678906094272837" + ], + [ + "6", + "43", + "562576005761711671558287843230055454563969395362900780709286492465556910644/839760630209056248928545885906851451505394484079192944197097678906094272837" + ], + [ + "7", + "43", + "1" + ], + [ + "14", + "43", + "13858100454250440034224401715578993754541679385537741158118153500650460046/17594376777087101782589719460963467994179486730114890373695966983267986107" + ], + [ + "14", + "50", + "3736276322836661748365317745384474239637807344577149215577813482617526061/17594376777087101782589719460963467994179486730114890373695966983267986107" + ], + [ + "21", + "50", + "1" + ], + [ + "28", + "50", + "32439673380290497275665379525481069572990693234718549576647887389555920885/35093736071088025044012030953889792207568755481211348375729775046383578798" + ], + [ + "28", + "57", + "2654062690797527768346651428408722634578062246492798799081887656827657913/35093736071088025044012030953889792207568755481211348375729775046383578798" + ], + [ + "35", + "57", + "1" + ], + [ + "42", + "57", + "8253309864952974553819991196207474241013633687556699616405680138268081796/17519136694460196879371180818489383696182411088671231896782552514034930933" + ], + [ + "42", + "64", + "9265826829507222325551189622281909455168777401114532280376872375766849137/17519136694460196879371180818489383696182411088671231896782552514034930933" + ], + [ + "49", + "64", + "52158518022612121575104076431134820436609205512991764214510982586509509179/61280118305452909003737656611638075625918308241973737720889515203112261742" + ], + [ + "49", + "127", + "9121600282840787428633580180503255189309102728981973506378532616602752563/61280118305452909003737656611638075625918308241973737720889515203112261742" + ], + [ + "56", + "127", + "1" + ] + ], + "debit": "11239/8192", + "level_floor": 18960, + "paid": [ + [ + "1", + 48720 + ], + [ + "2", + 45144 + ], + [ + "3", + 1980 + ], + [ + "4", + 1260 + ], + [ + "5", + 1296 + ], + [ + "6", + 2664 + ], + [ + "7", + 480 + ], + [ + "14", + 444 + ], + [ + "21", + 444 + ], + [ + "28", + 444 + ], + [ + "35", + 444 + ], + [ + "42", + 444 + ], + [ + "49", + 444 + ], + [ + "56", + 444 + ] + ], + "reserve": "256/255", + "suffix_coefficient": "64", + "targets": [ + [ + "4", + 864 + ], + [ + "8", + 14268 + ], + [ + "15", + 444 + ], + [ + "22", + 444 + ], + [ + "29", + 444 + ], + [ + "36", + 444 + ], + [ + "43", + 444 + ], + [ + "50", + 444 + ], + [ + "57", + 444 + ], + [ + "64", + 444 + ], + [ + "127", + 222 + ] + ], + "tariff": "47/20", + "trial": "4391986206293/1125899906842624" + }, + "source": { + "expected_result_sha256": "abef5f5070bd3c3bc154fd9fef8d32b048c1b6df7e906b8e5a8a2e7a10284c2c", + "head": "06691302af526a488f3dee0298035f86b6e69c51", + "pr": 8088, + "runtime_sha256": { + "grades.py": "6124744b40f806c80b6f10010a72e755bc11d64a8cc9a04f5e8316799eb6f05d", + "installations.py": "5df81fddba26013b142195f5c3119491fa2f07b1e72c3616ae76e7d7ffbb0fd1", + "raw_binary_stage.py": "e24bd735598d278dbd46cada584a63da01796d77ad557a45b80a4dfc7bbbd0b0", + "strong-bit.json.gz": "9e7392c52bcf29c0cc58c54c619f95c28f476394c33e8e0a5aa30c9557d31362", + "strong_complex.py": "8f3fb92523df006e2e94505127088aaf2e64fadd20b3cab2344f62d7690e875d", + "typed_transport.py": "b76b9ad3dc0dd91473026c079585f830387eaa3c34c25a7820ee5057d5cbf941", + "w5669_shortcut5.json.gz": "6ef741c346ea075c4f2ed11f9d42d7076103e72d4a9e5059d495f1cb990fd149" + }, + "shortcut_graph_sha256": "ed3bea7186f962f3a8a8ae389cecce3d1ef48a7a832cf9af6c9048a6b5919b35" + }, + "terminal": { + "eta": "1/256", + "gaussian_height": 85406, + "kappa": "39/10000", + "ordinary_heights": [ + 8192, + 106000, + 1681001 + ], + "stop_denominator": 1000000000000000000 + } +} diff --git a/research/p104-shortcut-eta-target/BILL.json b/research/p104-shortcut-eta-target/BILL.json new file mode 100644 index 0000000000..3b8f5ef89a --- /dev/null +++ b/research/p104-shortcut-eta-target/BILL.json @@ -0,0 +1 @@ +{"complete_recurring_log2_C": 593252820, "conditional_cost_form": "T(n) <= F_target + 2^593252820 n (1+log2 n)^(1-39/10000)", "entry_conversion_bits": 847, "entry_log2_B": 125433364, "entry_log2_C": 125660246, "expected_result_sha256": "abef5f5070bd3c3bc154fd9fef8d32b048c1b6df7e906b8e5a8a2e7a10284c2c", "gaussian_allowance_lower": {"decimal": "1.0897150687365971443779514848411", "fraction": "6840252349043510048113321919813842065011185432299507007305/6277101735386680763835789423207666416102355444464034512896"}, "gaussian_factor_upper": {"decimal": "1.0897150490631412929351654779581", "fraction": "42843003939710249088100488101692863381903368679214792792543574121683675818127480511488870619681137355727568675595312790263263494981901710256392188873350032589456275600795607276706722425037358240515293842793003480365186503826996719342420299061139781688353611085428664831241896956898354170685783075360102967484255878572020828255471034572034930520902542546765306170704743199602477611962124783222902002333859856205081283194663958709840933802620257977305781302297383943385749017396423900744183228890900454340760259212202495490708006120304418014513413022111360223141298696278881462491939082162523726226443992517574656/39315786247554886719442996951601233608988741939124558047362026586706232423747063027654830106767845093921234760216865134062611131886841307020610076232979226027215328897226956488885106902526001419796167662249322804459931216233942674184406450503980065613266990718985877478854722706408815876764698691647894281127098451145007203788069613612517457651502191377820424741827616202565695609921377451196619646526592158185494557910013118592749906416257154706205345000574278725083564229345506003097336110952574436071817367681836797638516180255084796234001648588333546645603033550498291319515944519119288196138238389711169375"}, "gaussian_finer_tick_rejected": true, "gaussian_transport_margin": {"decimal": "2.0835458888116808619948628220713E-12", "fraction": "181764928149611047411816132454303131107174724001174891/87238264885674270962097412292498817263230673653803153397047113920"}, "input_sha256": "5abff005451120cc0436fe47f150a008e206403bac059158ccd6c809431d5af0", "negative_controls": {"gaussian_height_minus_one_unfunded": true, "last_ordinary_height_minus_one_unfunded": true, "old_word_unfunded": true}, "ordinary_allowance_lower": {"decimal": "2.5881984536570935951831783526381", "fraction": "8123192502488032928200225232317956356652618600476784347941/3138550867693340381917894711603833208051177722232017256448"}, "ordinary_factor_upper": {"decimal": "2.5881357912808240652272451318991", "fraction": "281976393982548434965755301326767912094416525531065820728340359067839845950652548291543507448748593578949999814158319616/108949613437014890234341606502585819299563951201679784335767045162360776265821948566724436014018562342733691880219609375"}, "ordinary_transport_margin": {"decimal": "2.2622412283210649175082977858042E-16", "fraction": "33439964044089341967667874974664725056959552194/147817852603221274607754514012212562776850596371326789657486283"}, "profile": {"entry": {"activation_exponent": 7437, "cuts": [3077, 6221], "first_header_offset": 4, "gaussian_rate": "2078299883/549755813888", "signed": {"functional": 4, "ordinary_margin": "1/1000000000000000000", "positive_margin": "138582096165769387223/419430400000000000000000", "smallest_margin": "1/10000000000000000000", "strict": 54}, "stages": [{"booked": "3429777082171614693/1000000000000000000000", "height": 3000, "slack": "1139933093/1073741824000000000000000000000", "upper": "120674553040874617/35184372088832000000"}, {"booked": "690000000000001/200000000000000000", "height": 3080, "slack": "55053468115579837956394099357/10334765056000000000000000000000000", "upper": "35709992911315631511781674099357/10334765056000000000000000000000000"}]}, "terminal": {"activation_exponent": 1881073, "cuts": [8290, 114354, 1795419], "first_header_offset": 4, "gaussian_rate": "91557268013573/23476222520459264", "signed": {"functional": 4, "ordinary_margin": "1/1000000000000000000", "positive_margin": "140214350142583769/17910936371200000000000000000", "smallest_margin": "1/10000000000000000000", "strict": 54}, "stages": [{"booked": "3718459644522841499/1000000000000000000000", "height": 8192, "slack": "1827798949/1073741824000000000000000000000", "upper": "1046653341841581/281474976710656000"}, {"booked": "31097972806740573/8000000000000000000", "height": 106000, "slack": "7792038038789/7113539584000000000000000000000000", "upper": "27652082567863081014584742038789/7113539584000000000000000000000000"}, {"booked": "780000000000001/200000000000000000", "height": 1681001, "slack": "18375833487309615126701/1804961079885824000000000000000000000", "upper": "7039348211573098458292709044246701/1804961079885824000000000000000000000"}]}}, "scope": "Exact funding, finite-price arithmetic and clock with supplied source-bound inputs; physical contracts and fixed setup remain separate.", "source_head": "06691302af526a488f3dee0298035f86b6e69c51", "status": "PASS_INDEPENDENT_FROZEN_TWO_TIER_BILL", "terminal_log2_B": 574461897, "terminal_log2_C": 593252819} diff --git a/research/p104-shortcut-eta-target/CALLER.json b/research/p104-shortcut-eta-target/CALLER.json new file mode 100644 index 0000000000..4807ce7a4e --- /dev/null +++ b/research/p104-shortcut-eta-target/CALLER.json @@ -0,0 +1 @@ +{"binding": {"ambient": 137, "calls": 48, "helper_label_sha256": "536e4ea667b6b45e2a50124ffaa2c53e1cc79bc701aae68154ad7f411049bbdc", "local_colors": 16, "native_main_bindings": 19200, "physical_port_contacts": 4992, "root_owners": 9840, "stage_binding_sha256": "e299be1a5f2bfc5cd47a8cd644516e9b68eeb932275683df0ecdd52f958274be", "stage_helper_owners": 42768, "template_roots": {"A": 120, "rotated": 192}}, "caller": {"A": {"exponent_bits": 4, "maximum_stage_occurrences": 15, "minimum_grid": 4, "peak_mass": "256", "peak_native_entrance_mass": "26", "preproduct_divisions": 2686, "separate_component_divisions": 9904}, "rotated": {"exponent_bits": 4, "maximum_stage_occurrences": 15, "minimum_grid": 8, "peak_mass": "212", "peak_native_entrance_mass": "91/2", "preproduct_divisions": 8308, "separate_component_divisions": 17868}}, "caller_sha": "156fdf3a4a129b39225fd6ca51011de27974d7f104e8b04907c17ed5344bc858", "context_guard": 872, "graph": {"coefficients_each_way": 1666681, "donors": 322917, "forward_digit_bits": 178, "roles": 1291, "transpose_digit_bits": 162}, "paid": 281328, "paid_hist": {"1": 183312, "2": 37728, "3": 22848, "4": 10896, "5": 15264, "6": 1968, "7": 480, "8": 1344, "16": 1248, "24": 1248, "32": 1248, "40": 1248, "48": 1248, "56": 1248}, "per_context_dyadic": 148, "per_context_mass": 436, "stages": {"ADD": 575856, "IDLE_ONE": 8736, "LAMBDA": 30000, "NATIVE": 48, "PORT_VIEWS": 96, "QUERY": 480, "SCALE": 128688, "SWAP": 97008}, "target_hist": {"1": 1008, "2": 432, "3": 480, "4": 11568, "5": 1584, "6": 48, "7": 672, "8": 1584, "9": 25872, "17": 1248, "25": 1248, "33": 1248, "41": 1248, "49": 1248, "57": 1248, "65": 1248, "129": 624}, "targets": 52608} diff --git a/research/p104-shortcut-eta-target/CENSUS.json b/research/p104-shortcut-eta-target/CENSUS.json new file mode 100644 index 0000000000..00ced66ca5 --- /dev/null +++ b/research/p104-shortcut-eta-target/CENSUS.json @@ -0,0 +1,119 @@ +{ + "added_move_tuples": 5, + "atlas_counts": { + "factors": 2964, + "forms": 6960, + "moves": 5669, + "roots": 312, + "words": 2 + }, + "canonical_bytes": 5638123, + "cells": 51, + "compressed_bytes": 1351798, + "grade_count_sum": 52, + "heights": [ + 3000, + 3080, + 1024, + 8192, + 106000, + 1681001, + 85406 + ], + "interpretation": "Observed finite counts verify cardinality/width hypotheses; do not alone prove an all-input action bound, paid-source admission, or terminal-scale multiplication.", + "json_bytes": 6322415, + "max_cell_fraction_bits": 266, + "new_only_pairs": 1, + "new_pairs": 2964, + "new_shape": { + "max_depth": 5, + "max_integer_bits": 18, + "max_list_entries": 6960, + "max_map_entries": 7, + "max_string_utf8_bytes": 36, + "nodes": 1027908 + }, + "new_word_sha": "ed3bea7186f962f3a8a8ae389cecce3d1ef48a7a832cf9af6c9048a6b5919b35", + "old_pairs": 2971, + "old_shape": { + "max_depth": 5, + "max_integer_bits": 18, + "max_list_entries": 6965, + "max_map_entries": 7, + "max_string_utf8_bytes": 36, + "nodes": 1029916 + }, + "old_word_sha": "38d2b3a2311a9ba5fee091cc7aa204c7ed95651aec95d75184b2391df090cbfb", + "removed_move_tuples": 10, + "removed_pairs": 8, + "role_counts": [ + { + "paid": 282336, + "targets": 52608, + "total": 334944 + }, + { + "paid": 281328, + "targets": 52608, + "total": 333936 + } + ], + "runtime_sha256": { + "grades.py": "6124744b40f806c80b6f10010a72e755bc11d64a8cc9a04f5e8316799eb6f05d", + "installations.py": "5df81fddba26013b142195f5c3119491fa2f07b1e72c3616ae76e7d7ffbb0fd1", + "raw_binary_stage.py": "e24bd735598d278dbd46cada584a63da01796d77ad557a45b80a4dfc7bbbd0b0", + "retimed_supplier.py": "2a87c2781ca93fa854aee098dcb7c50a65f2a46267ba926e3997b442e5a25f2c", + "strong_complex.py": "8f3fb92523df006e2e94505127088aaf2e64fadd20b3cab2344f62d7690e875d", + "transport.py": "9eb8f0d77a4c53fc4fddffdfe198cab930b6d1f49e2b6d43c970397051bb7818", + "w5669_shortcut5.json.gz": "6ef741c346ea075c4f2ed11f9d42d7076103e72d4a9e5059d495f1cb990fd149" + }, + "source_head": "06691302af526a488f3dee0298035f86b6e69c51", + "source_stock": { + "absolute_log2_private_control_envelope": 1721345027, + "binary_cuts": [ + 8290, + 114354, + 1795419 + ], + "first_public_offset": 4, + "initial_s": 1881074, + "public_exponent_A": 1881073, + "retimed_all_size_margin_floor": 909174, + "retimed_first_stripe_margin": 938483, + "stage_and_outer_fixed_log_overhead": 1968, + "storage_upper": "6.2 p T < 297.6 n bits" + }, + "top_lengths": { + "final": { + "new": 1291, + "old": 1291 + }, + "forms": { + "new": 6960, + "old": 6965 + }, + "frames": { + "new": 1103, + "old": 1103 + }, + "initial": { + "new": 1291, + "old": 1291 + }, + "moves": { + "new": 5669, + "old": 5674 + }, + "schedule": { + "new": 6960, + "old": 6965 + } + }, + "typed_cells": 88, + "unchanged_graph_sections": [ + "final", + "first_output", + "frames", + "initial" + ] +} diff --git a/research/p104-shortcut-eta-target/COMPARATOR.json b/research/p104-shortcut-eta-target/COMPARATOR.json new file mode 100644 index 0000000000..9be593adcf --- /dev/null +++ b/research/p104-shortcut-eta-target/COMPARATOR.json @@ -0,0 +1,18 @@ +{ + "both_suppliers_public_shortfall": "798771792092461729005323201043/1876498055168000000000000000000000000", + "comparison_unit": "Public-rate units on the binding supplier guard after both fixed terminal invoices; positive and ordinary charges are already aggregated. Min of the two stage ceilings, component clamp and subtraction of 5e-18.", + "fixed_gaussian_public_upper": "108010118581621413024045251/27697925324800000000000000000", + "fixed_ordinary_public_upper": "7317543643363107538270994676798957/1876498055168000000000000000000000000", + "fixed_public_upper": "7317543643363107538270994676798957/1876498055168000000000000000000000000", + "fixed_upper_decimal_interval": [ + "0.003899574328473246965922", + "0.003899574328473246965923" + ], + "native_calls_per_gaussian_word": 48, + "ordinary_calls": 36, + "parent_public": "3899574328473/1000000000000000", + "required_saving_interval": [ + "0.000000425671526753034077", + "0.000000425671526753034078" + ] +} diff --git a/research/p104-shortcut-eta-target/DIRECTORY.json b/research/p104-shortcut-eta-target/DIRECTORY.json new file mode 100644 index 0000000000..24c971fa28 --- /dev/null +++ b/research/p104-shortcut-eta-target/DIRECTORY.json @@ -0,0 +1,95 @@ +{ + "controls": { + "rejected": [ + "corrupt_byte", + "repinned_bad_magic", + "repinned_truncated_record", + "truncated_directory", + "wrong_digest" + ], + "status": "PASS_DIRECTORY_CORRUPTION_CONTROLS" + }, + "emitter": { + "directory_bytes": 36702384, + "directory_records": 2492269, + "directory_sha256": "d6444797e1b7e3b0348e842b2efc12b9462da55ba8e1530abc477ecdcc021211", + "lazy_native_open_and_width_forbidden": true, + "profile_heights": [ + [ + 3000, + 3080, + 1024 + ], + [ + 8192, + 106000, + 1681001, + 85406 + ] + ], + "status": "PASS_TARGET_DIRECTORY_EMITTED" + }, + "receiver": { + "directory_bytes": 36702384, + "directory_sha256": "d6444797e1b7e3b0348e842b2efc12b9462da55ba8e1530abc477ecdcc021211", + "getter_count": 7, + "linked_source_sha256": { + "fixed_directory.py": "4571703f0c61f57088af0fe16d7d4e21fca1dbebc155128b420f5e32f086b7b7", + "grades.py": "2e39814b2c1cce848de7dda6368f89ef9e826e83e672c7490582a16f111880e7", + "raw_binary_stage.py": "de8cc4093128e594d571732dee548d68b99cd6492ee5e5c08fb3801ac9616a2e", + "strong_binary.py": "6729c5bed76871f75623ddc48b5c4c161a6dfb9a2b1466a2a6b51c43df80e196" + }, + "ordinary_receivers": [ + { + "direct_receiver": true, + "height": 3000, + "owner_bits": 276001 + }, + { + "direct_receiver": true, + "height": 3080, + "owner_bits": 283361 + }, + { + "direct_receiver": true, + "height": 8192, + "owner_bits": 753665 + }, + { + "direct_receiver": true, + "height": 106000, + "owner_bits": 9752001 + }, + { + "direct_receiver": true, + "height": 1681001, + "owner_bits": 154652093 + } + ], + "positive_suppliers": [ + { + "carrier_bits": 1025, + "height": 1024, + "multiplicities": [ + 5, + 451 + ], + "owner_bits": 94209, + "typed_cells": 88 + }, + { + "carrier_bits": 85407, + "height": 85406, + "multiplicities": [ + 5, + 451 + ], + "owner_bits": 7857353, + "typed_cells": 88 + } + ], + "scope": "Fresh process; seven getters bound and actual direct owners instantiated. No astronomical compiled execution, WASI trace or universal setup bound.", + "status": "PASS_FIXED_DIRECTORY_RECEIVED" + }, + "status": "PASS_SEPARATE_PROCESS_FIXED_INSTALLATION" +} diff --git a/research/p104-shortcut-eta-target/EVIDENCE.md b/research/p104-shortcut-eta-target/EVIDENCE.md new file mode 100644 index 0000000000..b62d67ae68 --- /dev/null +++ b/research/p104-shortcut-eta-target/EVIDENCE.md @@ -0,0 +1,27 @@ +# Reproduction and assurance + +The observations below used CPython 3.12 on Linux. All quantities in the signed invoices use integers or fractions. The predecessor source image was built from commit 06691302af526a488f3dee0298035f86b6e69c51. An independently restored image matched all 107 candidate runtime files except the two explicit profile and floor edits. Its 50 frequency-package files matched, as did the underlying tiered files. The three copied peer test programs are authenticated in SOURCE8088.json. The comparison accepts an external checkout of the precise PR head for a Git-object check. The registered version validates the retained source bytes offline. [Installation](install.py) · [Source pins](SOURCE8088.json) + +Run the groups from this directory with `python3.12 -IB verify.py GROUP`. Each group creates an empty temporary installation and uses fresh Python processes. The registered command from the root is in the README. [Manifest](VERIFY.json) + +| Group | Observed result and limit | +|---|---| +| price | Both exact bills pass. A separately implemented checker uses 192-bit outward square roots to recompute funding, both signed tiers and their complete clock from the regenerated histogram and cell tables. The K7 word has 24 coupling cells. The two Gaussian types have 51 grade cells and 88 typed cells. The conservative ordinary tariff and reserve pass at floor 18,960. The occupied-edge fixture has 323,165 opens and closes and 432 returned paid prefixes. The separate 81- and 6,561-record tape fixtures restore their sources and reject the opposite sign. | +| algebra | 25,143,710 exact grid contributions. 1,666,681 rational coefficients checked forward and again in transpose. The independent old/new forward comparison rejects a modified output. The atlas checks 2,964 pairs and 104 ports. Both mixed caller templates return the correct signed source and chronological paid stream over all 48 calls. | +| setup | Seven actual heights encode in at most 21 bits. The supplied profile scalars occupy at most 60 bits. Constructors run with the lazy calendar-opening interface disabled. Independent fixed emitters generated the same 36,702,384-byte directory on this host. Its observed SHA-256 was d6444797e1b7e3b0348e842b2efc12b9462da55ba8e1530abc477ecdcc021211. All five ordinary receiver instances use direct mode. The separate receiver links seven getters and both physical suppliers. It rejects a changed byte, a missing byte, a wrong digest, a repinned incorrect magic and a repinned truncated record. | +| layers | Actual Gaussian cutoff tests pass at 1024 and 85406. Both installed suppliers resolve the new word. The graph-mutation and old-fallback controls distinguish the changed path. The calendar and owner fixtures cover type crossings. The placement witness reaches the 1/624 share at both heights. Raw tests execute 282,336 and 281,328 paid labels. An exterior replay reports 563,664 labels. | +| product | The nested replay restores a real held helper. The signed product fixture returns −345550037539, restores both input heads and reproduces the first five coefficients. It enters the typed native path zero times inside that small multiplication. The raw, exterior and nested fixtures supply the separate evidence for the changed physical word. | + +For the individual finite physical runs the observed wall times were 55.85 s (raw), 74.83 s (exterior), 84.21 s (nested), and 151.14 s (instrumented product). The exact grid, signed caller and independent atlas took about 20 s, 34 s and 37 s respectively. These measurements describe the verification workload. The proved recurring coefficient prices the tape model. No terminal-scale multiplication, fresh Lean proof of the whole construction or new WASI fuel trace was run. + +A useful numerical control is to leave the new graph in place and reduce G by one. The terminal Gaussian signed margin becomes strictly negative. Independently reducing H₃ by one fails the ordinary guard. Using η=κ, η=q or η=1/250 also fails a strict premise. The independent bill checker also rejects a corrupt cell, two lowered heights and a rehashed lower clock. A damaged source, altered physical move, mutated rational output, incorrect signed tape return and damaged directory are exercised separately. [Strict price controls](RESULT.json) · [Ordinary controls](ORDINARY.json) · [Grid](GRID.json) · [Caller](CALLER.json) + +The executable source is the basis for the counts. #8088's prose contains an exterior-total discrepancy, and its retained proof note describes an earlier profile. The two actual typed lists and their exterior replay give 282336+281328=563664. [Upstream construction](https://github.com/CrocSwap/integer-mult-bounds/pull/8088) + +## Prior and parallel work + +- #8088, 06691302af526a488f3dee0298035f86b6e69c51, supplies the Gaussian word, positive price and production path. Its 20-bit ordinary profile is the predecessor measured here. [PR](https://github.com/CrocSwap/integer-mult-bounds/pull/8088) +- #8084, af73b476d5fdeaa763e0bff2dd87b2ecaf097c49, supplies the ordinary component and generic encoded-height argument. #8081, 510113821774bb27f7ddaad4e8b94837a1c2cf52, concerns an expanded setup with the earlier Gaussian word. This package rechecks the changed compiler inputs and keeps the new fixed-action census hypothesis explicit. [Ordinary result](https://github.com/CrocSwap/integer-mult-bounds/pull/8084) · [Setup predecessor](https://github.com/CrocSwap/integer-mult-bounds/pull/8081) +- ToikY's #8072, 75f7e1c44f48c43983016bcf8878c4d9e5e87c62, anchors the capped-allocation lineage. #8077's earlier two-type obstruction remains scoped to its former word. #8087 and #8086 report nearby retunings below #8088. [Allocation](https://github.com/CrocSwap/integer-mult-bounds/pull/8072) · [Earlier obstruction](https://github.com/CrocSwap/integer-mult-bounds/pull/8077) · [Period retuning](https://github.com/CrocSwap/integer-mult-bounds/pull/8087) · [20-bit stacked retuning](https://github.com/CrocSwap/integer-mult-bounds/pull/8086) + +The canonical selected baseline bound κ=0.00363005817 and its research assumptions are recorded at main e54523517d0f03e58352e647c403a5af3e525a57. A source-bound orientation check returned PASS_RESEARCH_BASELINE_BINDINGS_ONLY on an export containing the selected record's complete manifest and supplements. Scientific selection is a maintainer decision. [Selected record](https://github.com/CrocSwap/integer-mult-bounds/blob/e54523517d0f03e58352e647c403a5af3e525a57/certificates/selected-result.json) diff --git a/research/p104-shortcut-eta-target/FLOOR.json b/research/p104-shortcut-eta-target/FLOOR.json new file mode 100644 index 0000000000..2370972f73 --- /dev/null +++ b/research/p104-shortcut-eta-target/FLOOR.json @@ -0,0 +1 @@ +{"finite_occupied_edge": {"carrier": 8388608, "extent": "complete fixture event stream", "first_band_contacts": [[18960, 29, [[0, 0, 24764, 7], [0, 1, 24764, 7], [0, 0, 24766, 2], [0, 1, 24766, 2], [1, 0, 24764, 7], [1, 1, 24764, 7], [1, 0, 24766, 2], [1, 1, 24766, 2]]], [18962, 29, [[0, 0, 24766, 5], [0, 1, 24766, 5], [0, 0, 24768, 5], [0, 1, 24768, 5], [1, 0, 24766, 5], [1, 1, 24766, 5], [1, 0, 24768, 5], [1, 1, 24768, 5]]]], "lower": 18960, "lower_return_counts": {"18952": 108, "18954": 120}, "native_closes": 323165, "native_opens": 323165, "paid_singletons": 683705746532, "returned_paid_prefixes": 432, "tested_occupied_K7_grade": [49, 64], "upper": 24774}, "signed_tapes": [{"component_width": 1, "modulus": 3, "paid_exchanges": 3, "records": 81, "wrong_signed_return_rejected": true}, {"component_width": 2, "modulus": 9, "paid_exchanges": 1, "records": 6561, "wrong_signed_return_rejected": true}], "stock": {"birth_bound": "2V", "copy_group_bound": "3N^3", "first_two_columns": [18952, 18954], "fringe_upper_1e9": 7439580927, "grid_absolute_error_exponent_at_H1024": -27312, "minimum_positive_scale_h_guard": 1024, "normalized_error_allowance": "2^-128", "psi_lower_floor": 386067, "suffix_birth_error_upper_at_H1024": "2^30/N^5", "suffix_target_axes": 286098, "whole_field_width": "N^92"}} diff --git a/research/p104-shortcut-eta-target/GRID.json b/research/p104-shortcut-eta-target/GRID.json new file mode 100644 index 0000000000..c0a4dd94c4 --- /dev/null +++ b/research/p104-shortcut-eta-target/GRID.json @@ -0,0 +1 @@ +{"distinct_literals": 60189, "dyadic": 30, "grid": 154113755636630124932500335624192000, "largest_divisor": 16641408, "maximum_literal_bits": 87, "nontrivial": 17229517, "odd": 143529619683167082194704875, "peak": "205356183613811630452617549443093585249505045823/1621896683681232672237748224000", "products": 25143710, "roles": 1291} diff --git a/research/p104-shortcut-eta-target/LICENSE b/research/p104-shortcut-eta-target/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/p104-shortcut-eta-target/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-shortcut-eta-target/NOTICE.md b/research/p104-shortcut-eta-target/NOTICE.md new file mode 100644 index 0000000000..fb37cb1943 --- /dev/null +++ b/research/p104-shortcut-eta-target/NOTICE.md @@ -0,0 +1,5 @@ +# Attribution and source custody + +Clear1nsight contributed the combined 39/10000 installation, exact changed-word scalar/width and caller reassessment, independent forward-map and installation checks, and the two-tier signed application. OpenAI Codex materially assisted the research, proofs, verification and writing. Three Terra research agents checked complementary parts of the installation. + +Floration, with Claude assistance, found and implemented the five relay shortcuts and supplied the 20-bit #8088 construction. The algebra and physical tests here replay that word. ToikY contributed the #8053 onward K7 application lineage and the #8072 capped-allocation comparator. Ali Romman supplied the earlier rational word, signed producer, stage accounting and serial setup work. SYLforge supplied the #8052 K7 ordinary circuit and physical replay. #8084 supplies the η-lift ordinary booking and 25-bit height guard. The source files, embedded archives and original notices retain their licenses and earlier credits. [Floration's source](https://github.com/CrocSwap/integer-mult-bounds/pull/8088) · [ToikY's comparator](https://github.com/CrocSwap/integer-mult-bounds/pull/8072) · [Ordinary lift](https://github.com/CrocSwap/integer-mult-bounds/pull/8084) · [Retained notice](parent8088/NOTICE.md) · [License](LICENSE) diff --git a/research/p104-shortcut-eta-target/ORDINARY.json b/research/p104-shortcut-eta-target/ORDINARY.json new file mode 100644 index 0000000000..f4dcd4bbd6 --- /dev/null +++ b/research/p104-shortcut-eta-target/ORDINARY.json @@ -0,0 +1,116 @@ +{ + "activation_exponent": 1881073, + "complete_log2_C": 593252820, + "conservative_factor_exceeds_parent_debit_upper_by": "3457954184977887892309442903028447990578728282543276364417893399474764397065144333137436308636331086604004891439279878485187661070476531300376053537895665365157095128611053459/113981301262532366742376526588577681204387604182678966795811426422226881274097660563847613621637576403537263351932738651279973159032259030981293134532993375295024052305920000000", + "controls_rejected": [ + "eta-equals-public-kappa", + "eta-equals-ordinary-booking", + "eta-equals-rho", + "last-ordinary-height-minus-one", + "gaussian-height-minus-one", + "setup-height-2^25", + "setup-scalar-over-128-bits" + ], + "cuts": [ + 8290, + 114354, + 1795419 + ], + "entry_conversion_bits": 847, + "entry_log2_C": 125660246, + "eta": "1/256", + "gaussian_height": 85406, + "gaussian_margin_over_booking": "140214350142583769/17910936371200000000000000000", + "gaussian_previous_height_margin": "-65659993096843937/7164290662400000000000000000", + "heights": [ + 8192, + 106000, + 1681001 + ], + "kappa": "39/10000", + "native_recipe_open_seam": "PASS_CAPTURED_PLAN", + "ordinary_booking": "780000000000001/200000000000000000", + "ordinary_conservative_factor_margin_lower": "21427017562210358950446597697428535234468013860534110603900576612069664190864264736263618464720590694290654721077751760900692105102676905803300875044790635569796122884662907/341943903787597100227129579765733043613162812548036900387434279266680643822292981691542840864912729210611790055798215953839919477096777092943879403598980125885072156917760000000", + "ordinary_debit_used": "11239/8192", + "ordinary_floor": 18960, + "rho": "1/250", + "runtime_pins": { + "binary_receiver.py": "a7cc759e9a88e60dbcd59ca314ae5b9d39a33b5c642b56e680bbab775b0f06c5", + "grades.py": "6124744b40f806c80b6f10010a72e755bc11d64a8cc9a04f5e8316799eb6f05d", + "inputs/triangular/staged_carriers.py": "6c925ae4b39dc9999ac5891d1a27dcbb38e129a36e1473b2b418f27a806b6fc4", + "installations.py": "5df81fddba26013b142195f5c3119491fa2f07b1e72c3616ae76e7d7ffbb0fd1", + "ordinary_carrier.py": "aa1a64d48daf22f3918922481899a460dfe8e70268388e41f133279bc78f141d", + "raw_binary_stage.py": "e24bd735598d278dbd46cada584a63da01796d77ad557a45b80a4dfc7bbbd0b0", + "retimed_supplier.py": "2a87c2781ca93fa854aee098dcb7c50a65f2a46267ba926e3997b442e5a25f2c", + "strong-bit.json.gz": "9e7392c52bcf29c0cc58c54c619f95c28f476394c33e8e0a5aa30c9557d31362", + "strong_complex.py": "8f3fb92523df006e2e94505127088aaf2e64fadd20b3cab2344f62d7690e875d", + "transport.py": "9eb8f0d77a4c53fc4fddffdfe198cab930b6d1f49e2b6d43c970397051bb7818", + "w5669_shortcut5.json.gz": "6ef741c346ea075c4f2ed11f9d42d7076103e72d4a9e5059d495f1cb990fd149" + }, + "scope": "Exact ordinary component and captured direct/compiled dispatch only; no physical product or new portable trace. Parent receipt.bank was invoked with an explicit old-debit override, not via its unchanged hardcoded main check.", + "seams": [ + { + "component_log": 500, + "direct": true, + "scanned_log": 128000, + "stage": 2 + }, + { + "component_log": 7125, + "direct": true, + "scanned_log": 1824000, + "stage": 3 + }, + { + "component_log": 3750, + "direct": false, + "scanned_log": 960000, + "stage": 2 + }, + { + "component_log": 59125, + "direct": false, + "scanned_log": 15136000, + "stage": 3 + } + ], + "setup_numeric_guards": { + "all_seven_heights_in_25_bit_range": true, + "max_scalar_encoding_bits": 60, + "scope": "Numeric premises only; the 8088 shortcut-word base action census needs separate rebinding." + }, + "signed_outer": { + "functional": 4, + "ordinary_margin": "1/1000000000000000000", + "positive_margin": "140214350142583769/17910936371200000000000000000", + "smallest_margin": "1/10000000000000000000", + "strict": 54 + }, + "source_head": "06691302af526a488f3dee0298035f86b6e69c51", + "stages": [ + { + "booked": "3718459644522841499/1000000000000000000000", + "height": 8192, + "margin": "1827798949/1073741824000000000000000000000", + "raw_upper": "1046653341841581/281474976710656000", + "upper": "1046653341841581/281474976710656000" + }, + { + "booked": "31097972806740573/8000000000000000000", + "height": 106000, + "margin": "7792038038789/7113539584000000000000000000000000", + "raw_upper": "27652082567863081014584742038789/7113539584000000000000000000000000", + "upper": "27652082567863081014584742038789/7113539584000000000000000000000000" + }, + { + "booked": "780000000000001/200000000000000000", + "height": 1681001, + "margin": "18375833487309615126701/1804961079885824000000000000000000000", + "raw_upper": "7039348211573098458292709044246701/1804961079885824000000000000000000000", + "upper": "7039348211573098458292709044246701/1804961079885824000000000000000000000" + } + ], + "status": "PASS_ORDINARY_COMPONENT_AND_FINITE_SEAMS", + "terminal_log2_B": 574461897, + "terminal_log2_C": 593252819 +} diff --git a/research/p104-shortcut-eta-target/PHASES.json b/research/p104-shortcut-eta-target/PHASES.json new file mode 100644 index 0000000000..a69e4a9c56 --- /dev/null +++ b/research/p104-shortcut-eta-target/PHASES.json @@ -0,0 +1,70 @@ +{ + "calls": 12064, + "distinct_shapes": 29, + "max_circuit_gates": 32, + "max_path_variables": 18, + "max_qubits": 9, + "scope": "Instrumented finite constructor execution; recorded maxima do not by themselves prove a uniform compiler action bound.", + "top_shapes": [ + { + "calls": 2964, + "gates": 3, + "paths": 0, + "qubits": 9 + }, + { + "calls": 2964, + "gates": 6, + "paths": 0, + "qubits": 9 + }, + { + "calls": 515, + "gates": 24, + "paths": 12, + "qubits": 9 + }, + { + "calls": 483, + "gates": 28, + "paths": 12, + "qubits": 9 + }, + { + "calls": 467, + "gates": 26, + "paths": 14, + "qubits": 9 + }, + { + "calls": 463, + "gates": 30, + "paths": 14, + "qubits": 9 + }, + { + "calls": 458, + "gates": 28, + "paths": 16, + "qubits": 9 + }, + { + "calls": 452, + "gates": 32, + "paths": 16, + "qubits": 9 + }, + { + "calls": 426, + "gates": 18, + "paths": 6, + "qubits": 9 + }, + { + "calls": 370, + "gates": 22, + "paths": 6, + "qubits": 9 + } + ] +} diff --git a/research/p104-shortcut-eta-target/PRICES.json b/research/p104-shortcut-eta-target/PRICES.json new file mode 100644 index 0000000000..cce380dcfe --- /dev/null +++ b/research/p104-shortcut-eta-target/PRICES.json @@ -0,0 +1,55 @@ +{ + "ordinary_floor": 18960, + "ordinary_raw_margin": "55321779883482082595639/244544123725211460862213013703178693829", + "ordinary_tariff": "47/20", + "ordinary_reserve": "256/255", + "ordinary_debit": "11239/8192", + "ordinary_factor_upper": "93992131327516144988585100442256623180447484080533281287314498958603301100146346558617124263369364557172111210151149568/36316537812338296744780535500861939766521317067226594778589015054120258755273982855574812004672854114244563960073203125", + "ordinary_allowance_lower": "8123192502488032928200225232317956356652618600476784347941/3138550867693340381917894711603833208051177722232017256448", + "gaussian": { + "trial": "2144845547/549755813888", + "weights": [ + 5, + 451 + ], + "real_targets": [ + 52608, + 52608 + ], + "real_loans": [ + 282336, + 281328 + ], + "weighted_targets": 23989248, + "weighted_loans": 128290608, + "directed_margin": "25058737434575388224575020763/12026966897699221379437011099669697124641", + "grade_cells": 51, + "typed_cells": 88, + "min_individual_share": "84552148502764401372515549359944817029050164931794082594601537579467011/2860129876771506011238618397035687755768702340256804091497779103672800801628608", + "raw_loss": "32493/262144", + "finite_loss": { + "debit": "32493/262144", + "lower_band": 1874, + "upper_divisor": 1724, + "upper_scale": 263772, + "weighted_target_axes": 677246016, + "fringe": "9855327798491145000008863611532376016988768776524141279702351778045123210618948864642927936166641175388866240444915926300679636006691575485715060252445081351560429404511158572360378279210639068080753530558224129392605801257746179782957096064788428064753669613420462519401696785546490279430080018137642933835029211580682854203685497104978657309177854278066988223552089745565498322648766352359836788046785020187491928709028380672/1342540347115003801339193634434118005969396584285962442394959680393309123888495653671285995487875229178096266927976831591204700090080192133325202296541848553230643969974272240538847398499051171111777461260201928540243171377784715338372417078127721083771125765869564048493216028935498620492028436115290562587407642634709562627328187188324708170778235532923474771273686539644997760676043397700918553715386317622276832315088178455", + "psi_lower": "36774473797948037912541634097319747003962336700199693263185882360108702157204359298849184867697091848216479995115497386337385946240131323176845598251098906577844387526162820503736128940557939295960932285381747537950101211679504229529740379309339083420407786722205325615622484024288593604461947377591301975260073070627318995418672896973647110540817123114001402885032828105953443989475620884756624494834416485967126325/39705077055616758278398945718051270079611438391017956157398730393989438789277411838957841865629177832072563146472685672846872214469179617143201512976452800338626006041794233403917197722699527632604968482024969035216709987572500437752314454941061554198481484429943611438686069826395238026562564130057975559635506987142353835625307135663742826983170452337581165507977519446768523155949307595075711756167806976", + "upper_factor": "134667828521352946827277466923875792742152375382159190455807148713042743779215305635750257991965288838288719960034256612002029434764148272719558843914695715191801891192941005051504337914181031605782716144250340031975697947945996890931788989525599377871413615387566852154789135127352312497311434855201439925870554904241254867886758903637446909883062852425586685301736720143445020707734415017867921629872549964489271241855789110424006584585024504735895884925924106791529175262703307716505501393496931406502797178207294089568551602504714558234605348776657310756368049810181098265475603759104/123580773374774139706743239199911715736300977349790795558001573628030255043046429657611426002240582458056212955511247617563450590225969427286635772453353747514638005869472174378209726976604548505671114727150196313963306505957707180235079767540675988558958727593661411586205630782812490534897988699310975574852767165940503581524301776246934358632848298093520591047826407102440056585801857110986448849642213266520351744694262757454851094484829657958670678869440431292058646015766763918814535977632841275152600551084571577381729778445461612470638411946979432368932333435171592011149954840625" + }, + "capacity_cut": { + "new": [ + "2356659474246895453004862288340047/5070602400912917605986812821504", + "75413103175900654496155594298779059/162259276829213363391578010288128" + ], + "90": [ + "168820568970742257315174557382401181/162259276829213363391578010288128", + "337641137941484514630349115332889169/324518553658426726783156020576256" + ], + "91": [ + "-156428030449689521334616704420940755/162259276829213363391578010288128", + "-156428030449689521334616704133756587/162259276829213363391578010288128" + ] + } + } +} diff --git a/research/p104-shortcut-eta-target/PROOF.md b/research/p104-shortcut-eta-target/PROOF.md new file mode 100644 index 0000000000..5c0db78557 --- /dev/null +++ b/research/p104-shortcut-eta-target/PROOF.md @@ -0,0 +1,69 @@ +# A conditional signed installation at κ = 39/10000 + +Let n≥2 be the larger significant bit length of two canonical signed integers. Let g=10⁻¹⁸ and let F denote the fixed cost to generate, serialize, receive and link the two installations before reading the operands. Under the five inherited assumptions stated below, the construction has the bound + + T(n) ≤ F + 2^593252820 · n (1 + log₂ n)^(1 − 39/10000). + +For a declared noncanonical interval, include its length in n or charge its complete scan and head restoration. The fixed data and finite program do not depend on n. The precision parameter is p=6⌈log₂ n⌉. A height H represents a rank 2^H. The coefficient above prices the complete recurring application, including conversion of the lower tier. The numerical fixed-setup estimate has its own hypothesis. + +## Why the two changes work together + +The five Gaussian relay shortcuts are floration's construction. They change the distribution of positive paid ranks while preserving their linear total. They improve the directed moment because its grade price is concave. The #8088 profile then stops growing at the 20-bit height limit. Its ordinary component also caps the component exponent at 0.0039. The signed application requires an ordinary booking q=κ+5g, so that clamp cannot serve the requested κ. + +Use the ordinary construction from #8084 with η=1/256 and H=(8192,106000,1681001). Its local trial is c_B=4391986206293/2^50. The actual raw recipe has 18,906 productive and 104,652 paid labels with 24 coupling cells. Restore the operating floor 18,960, the suffix allowance 64, the tariff 47/20 and the full reserve 256/255. The child ratio is (75/32)/(47/20)=375/376, hence the geometric sum is 376. The independent lower enclosure for 2^(11239/8192) exceeds the directed all-in factor for this word. Use d_B=11239/8192 in both tiers. This retains #8088's larger fixed additions of five entry clock bits and three bits per terminal stage. [Ordinary construction](https://github.com/CrocSwap/integer-mult-bounds/pull/8084) · [Actual component invoice](ORDINARY.json) · [Supplier prices](PRICES.json) + +Starting at b₀=0 form Uᵢ=min(η,[249(c_B−d_B/Hᵢ)+bᵢ₋₁]/250). For the nonterminal stages set bᵢ=(⌊10²¹Uᵢ⌋−1)/10²¹. At the last stage set b₃=q=0.003900000000000005. The last stage has positive slack + + U₃ − q = 18375833487309615126701 / 1804961079885824000000000000000000000. + +With the first two bookings fixed, H₃=1681000 gives U₃q. The least positive integer G that satisfies it is + + G = floor(d_G/(c_G−q)) + 1 = 85406. + +The exact Gaussian booking is 91557268013573/23476222520459264. Its excess over q is 140214350142583769/17910936371200000000000000000. For G=85405 the excess is −65659993096843937/7164290662400000000000000000. The pre-shortcut word also fails at G=85406. The minimum here holds for this precise trial, debit and stopping rule. [Complete signed invoice](RESULT.json) · [Five shortcuts](https://github.com/CrocSwap/integer-mult-bounds/pull/8088) + +## Why this is a gain over the predecessor + +Keep #8088's first two stage bookings, its tariffs, its actual G=66037 and its terminal height 1048575. Every public rate must satisfy + + κ < min((249(c_B−d_B,8088/1048575)+b₂)/250, c_G−d_G/66037, 0.0039) − 5g, + +with d_B,8088=1420718/2^20. Its right side lies in [0.003899574328473246965922, 0.003899574328473246965923]. Even allowing any finite number of stages with every H≤2²⁰−1 gives the ceiling c_B−d_B,8088/(2²⁰−1)−5g < 0.003899575231324069. To see this, bound each local ordinary price by c_B−d_B,8088/(2²⁰−1). Induction preserves this bound under the convex combination with the preceding price, starting from zero. Both ceilings lie strictly below 39/10000. Our final ordinary height takes 21 bits. Its recurring coefficient has a smaller logarithm than the predecessor's by 92,243,140. These comparisons keep the changed height domain explicit. [Comparator calculation](COMPARATOR.json) + +## Why the new word can execute + +Fix the original common input grid 154113755636630124932500335624192000. Its odd part is 143529619683167082194704875, with 30 dyadic positions. At each node compute the row of integer coefficients on every input basis element. For every ordered donor of reduced weight a/b first check b divides every live coefficient v. Accumulate a(v/b) only after this check. Linearity then proves exact execution of the multiply-after-divide primitive on every combination of the 1,291 inputs. Every terminal row equals the specified public row. Across 322,917 donors, all 25,143,710 nonzero basis contributions pass, including 17,229,517 nontrivial divisions. The gcd test returns one. All 60,189 distinct graph literals and the odd conversions fit the physical scalar splitting rule. The largest literal uses 87 bits and the largest short divisor is 16,641,408. [Grid replay](GRID.json) + +Equality of terminal maps alone gives no bound on internal growth. At every executed row compute wᵢ=Σⱼ |aᵢⱼ|wⱼ starting with w=1. This bounds the sum of absolute values of partial donor terms. The changed exact maximum is + + 205356183613811630452617549443093585249505045823 / 1621896683681232672237748224000. + +Combine it with the signed caller's native entrance and its 2025 odd factor. The recomputed per-context allowances are 148 dyadic positions and 436 mass bits. Thus the doubled guard 872 suffices at both installed heights. The independent rational graph criterion verifies 1,666,681 coefficients in each direction with directed packing sizes 178 and 162 bits. A second implementation compares old and new maps over 21 blocks of up to 64 inputs with 300-bit signed digits and rejects a modified output coefficient. [Signed caller and forward/transpose evidence](CALLER.json) · [Independent forward-map verifier](check_rational.py) + +The 2,964 required chart pairs include a pair absent from the predecessor. The compiler constructs their signed Pauli tableaux and fixes absolute phase on the vacuum. A separate chart verifier checks the resulting atlas, its 104 ports, 1,938,432 monomial basis images and 6,656 signed contacts. The signed caller replays 48 native calls and 19,200 independent main bindings, as well as the chronological returns and source tags. The physical checks exercise both typed words on nonzero inputs, an exterior placement and a nonzero nested transfer. A distinct small signed multiplication returns −345550037539 and restores both input heads. The instrumented multiplication fixture made zero calls to the typed native path. Those calls are exercised in the separate native fixtures. [Atlas](ATLAS.json) · [Native path checker](check_path_binding.py) + +## Complete signed cost and fixed installation + +The entry profile retains (3000,3080;1024) and κ=0.00345. Each of the two tiers passes the 54 strict rows, four functional rows and the independent positive guard. The public switch occurs at 2^1881073+4. The preceding admissible header selects entry. The terminal first/cofinal stripe slacks are 938483 and 909174. The inherited live-data estimate then gives 6.2pT<297.6n bits in its stated regime. The funded signed clock has + + log₂ B_terminal = 128 + 3·3 + 320(8192+106000+1681001) = 574461897 + log₂ C_terminal = 1602 + 220·85406 + 574461897 = 593252819. + log₂ C_entry = 125660246. + entry surcharge = ceil((0.0039−0.00345)1881073) = 847. + log₂ C = 1 + max(125660246+847,593252819) = 593252820. + +The selector and header restoration receive the final bit. The coefficient is the one in the stated inequality for all input sizes. Lookup, initialization and erasure during fixed setup belong to F; every input-dependent calendar, transport and restoration remains in the recurring invoice. [Source-pinned price](RESULT.json) + +The installer runs before the operand tapes are read. It reconstructs the fixed words, materializes both sets of recipes, serializes the reachable finite directory, and links the receivers that will supply each native call. These operations have finite cost for this fixed instance. Thus adding F leaves the claimed exponent unchanged. The two real constructors use carriers of 1025 and 85407 bits. The directory observed on CPython 3.12 had 2,492,269 records, 36,702,384 bytes and largest integer width 266. A separately launched receiver instantiates all five direct ordinary receivers and both positive suppliers, recovers both (5,451) mixtures and validates all seven getters. Five damaged-directory controls are rejected. The replay checks semantic identities and corruption controls. A serialized hash identifies the run which produced it. [Directory and linked receiver receipt](DIRECTORY.json) · [Fixed receiver replay](check_receiver.py) · [New-word source census](CENSUS.json) + +A sharper numerical estimate follows **if** the changed numerical compiler uses at most 2^64 indexed actions, in addition to the original 2^68-action and 2^38-datum-width bounds. Charge a full new numerical rebuild, 2^55 additional preprocessing actions and 137556398080 height/scalar actions. The extra charge is <2^65. With N=2^68+2^65, w=2^38, h=2w+2, S=4wN, L=8S·512·128 and E=2^16(h+4)(7h+9)+8·2^16(h+4)², the complete upper bill (N+1)(L+E+2^120)2^32 is <2^228. The observed constructor uses 12,064 phase evaluations on nine qubits, with at most 32 gates and 18 path variables per evaluation. The new factor pair makes a fresh action census necessary to claim that sharper number on the same five hypotheses. The asymptotic argument above only needs the demonstrated finite fixed installation. The predecessor's WASI fuel measurement concerns a different profile. [Serial charge calculation](check_setup.py) + +## Inherited premises and open next questions + +The conditional multiplication statement retains five assumptions: native operators, phase conventions and spectators at arbitrary positive column multiplicities; owned erasure and suspended-center cleanup; uniform closure of the mixed-target compiler and chronological composition; the fixed-tape movement and precision/storage model; and the analytic decomposition, fine-prime avoidance and exact output recovery. The finite checks instantiate the changed interfaces. A terminal-scale multiplication, human proof review and independent formal admission remain open. [Canonical assumption statements](https://github.com/CrocSwap/integer-mult-bounds/blob/e54523517d0f03e58352e647c403a5af3e525a57/certificates/selected-result.json) + +1. Can a metered producer and receiver for the exact 5,669-move word certify a numerical bound on F without the extra indexed-action hypothesis? +2. Can the two final ordinary heights be reduced together while retaining strictly positive final booking slack and the full charged clock? +3. Can an independent reviewer discharge an all-size native, precision or recovery premise for this exact installation? diff --git a/research/p104-shortcut-eta-target/README.md b/research/p104-shortcut-eta-target/README.md new file mode 100644 index 0000000000..f3a2d6c20d --- /dev/null +++ b/research/p104-shortcut-eta-target/README.md @@ -0,0 +1,26 @@ +# A signed P104 construction at conditional κ = 0.0039 + +Combining floration's five Gaussian relay shortcuts with the ordinary η-lift yields κ=39/10000 under the five inherited multiplication assumptions. The entry and terminal stages run from one installed source. The terminal ordinary heights are (8192,106000,1681001), the Gaussian height is 85406 and the complete recurring coefficient has log₂ C=593252820. The fixed installation cost is additive. The smaller optional numerical setup cap has a separate compiler-action hypothesis. [Proof and assumptions](PROOF.md) · [Exact invoice](RESULT.json) + +| Quantity | #8088 | This installation | +|---|---:|---:| +| Public conditional κ | 0.003899574328473 | 0.003900000000000 | +| Largest ordinary height | 1,048,575 | 1,681,001 | +| Gaussian height | 66,037 | 85,406 | +| Complete recurring log₂ C | 685,495,960 | 593,252,820 | + +The literal #8088 directed upper crossing is below 0.003899574328473246965923. The new construction extends the ordinary height field to 21 bits. It charges the full 256/255 ordinary reserve, computes every new scalar division on the 1,291-input basis, and checks the new graph's context headroom. The removed relay costs, exact compiler and typed ownership are credited to their original sources. [Source pins](SOURCE8088.json) · [Attribution](NOTICE.md) · [Directed comparison](COMPARATOR.json) + +## Replay + +From the repository root with Git and CPython 3.12: + +```sh +python3.12 -IB scripts/research_package.py --package research/p104-shortcut-eta-target +``` + +The package carries the authenticated #8088 inputs. Each replay group installs into a separate temporary directory. The change from the generated predecessor runtime affects exactly the terminal profile in installations.py and the ordinary floor in raw_binary_stage.py. The registered checks cover exact prices, operators and binding, installed setup and receipt, actual suppliers, and finite product tests. [Verification and observed outcomes](EVIDENCE.md) + +## Open next questions + +A fully metered setup for these exact bytes would strengthen the numerical fixed-cost claim. Independent assurance of the five all-size premises and a better ordinary allocation have distinct next tests. [Research questions](PROOF.md#inherited-premises-and-open-next-questions) diff --git a/research/p104-shortcut-eta-target/RESULT.json b/research/p104-shortcut-eta-target/RESULT.json new file mode 100644 index 0000000000..d1c4cbfa76 --- /dev/null +++ b/research/p104-shortcut-eta-target/RESULT.json @@ -0,0 +1,153 @@ +{ + "parent_fixed_G_public_ceiling": "108010118581621413024045251/27697925324800000000000000000", + "parent_any_20bit_ordinary_public_ceiling": "140496870481169645387192563247/36028762659225600000000000000000", + "signed_gain_over_20bit_ceiling": "15303889810194612807436753/36028762659225600000000000000000", + "target": "39/10000", + "ordinary_guard": "780000000000001/200000000000000000", + "ordinary_debit": "11239/8192", + "gaussian_debit": "32493/262144", + "gaussian_raw": "2144845547/549755813888", + "entry": { + "kappa": "69/20000", + "ordinary_H": [ + 3000, + 3080 + ], + "numerical_H": 1024, + "ordinary_rates": [ + "3429777082171614693/1000000000000000000000", + "690000000000001/200000000000000000" + ], + "gaussian_rate": "2078299883/549755813888", + "signed": { + "strict": 54, + "functional": 4, + "smallest_margin": "1/10000000000000000000", + "ordinary_margin": "1/1000000000000000000", + "positive_margin": "138582096165769387223/419430400000000000000000" + }, + "stock": { + "binary_cuts": [ + 3077, + 6221 + ], + "public_exponent_A": 7437, + "first_public_offset": 4, + "initial_s": 7438, + "stage_and_outer_fixed_log_overhead": 1964, + "retimed_first_stripe_margin": 1701, + "retimed_all_size_margin_floor": 1635, + "absolute_log2_private_control_envelope": 3153922, + "storage_upper": "6.2 p T < 297.6 n bits" + }, + "geometry": { + "public_offset_above_2_to_A": 4, + "first_extent_bits_minus_b": -7433, + "last_extent_bits_minus_b": -7432, + "minimum_width": 3809536, + "log2_axis_count": 7412, + "largest_axis_width": 5592406, + "private_clock_log2_upper": 5734316302, + "actual_dense_root_entry_log2": 11184812 + }, + "binary_surcharges": [ + 0, + 25818582 + ], + "log2_B": 125433364, + "log2_C": 125660246, + "ordinary_stage_bounds": [ + { + "height": 3000, + "booked": "3429777082171614693/1000000000000000000000", + "upper": "120674553040874617/35184372088832000000", + "slack": "1139933093/1073741824000000000000000000000" + }, + { + "height": 3080, + "booked": "690000000000001/200000000000000000", + "upper": "35709992911315631511781674099357/10334765056000000000000000000000000", + "slack": "55053468115579837956394099357/10334765056000000000000000000000000" + } + ] + }, + "terminal": { + "kappa": "39/10000", + "ordinary_H": [ + 8192, + 106000, + 1681001 + ], + "numerical_H": 85406, + "ordinary_rates": [ + "3718459644522841499/1000000000000000000000", + "31097972806740573/8000000000000000000", + "780000000000001/200000000000000000" + ], + "gaussian_rate": "91557268013573/23476222520459264", + "signed": { + "strict": 54, + "functional": 4, + "smallest_margin": "1/10000000000000000000", + "ordinary_margin": "1/1000000000000000000", + "positive_margin": "140214350142583769/17910936371200000000000000000" + }, + "stock": { + "binary_cuts": [ + 8290, + 114354, + 1795419 + ], + "public_exponent_A": 1881073, + "first_public_offset": 4, + "initial_s": 1881074, + "stage_and_outer_fixed_log_overhead": 1968, + "retimed_first_stripe_margin": 938483, + "retimed_all_size_margin_floor": 909174, + "absolute_log2_private_control_envelope": 1721345027, + "storage_upper": "6.2 p T < 297.6 n bits" + }, + "geometry": { + "public_offset_above_2_to_A": 4, + "first_extent_bits_minus_b": -1881069, + "last_extent_bits_minus_b": -1881068, + "minimum_width": 963111168, + "log2_axis_count": 1881040, + "largest_axis_width": 1431655766, + "private_clock_log2_upper": 1467943673842, + "actual_dense_root_entry_log2": 2863311532 + }, + "binary_surcharges": [], + "log2_B": 574461897, + "log2_C": 593252819, + "ordinary_stage_bounds": [ + { + "height": 8192, + "booked": "3718459644522841499/1000000000000000000000", + "upper": "1046653341841581/281474976710656000", + "slack": "1827798949/1073741824000000000000000000000" + }, + { + "height": 106000, + "booked": "31097972806740573/8000000000000000000", + "upper": "27652082567863081014584742038789/7113539584000000000000000000000000", + "slack": "7792038038789/7113539584000000000000000000000000" + }, + { + "height": 1681001, + "booked": "780000000000001/200000000000000000", + "upper": "7039348211573098458292709044246701/1804961079885824000000000000000000000", + "slack": "18375833487309615126701/1804961079885824000000000000000000000" + } + ] + }, + "G_minus_one_positive_margin": "-65659993096843937/7164290662400000000000000000", + "old_word_positive_margin": "-427525806400280646439223/143287490969600000000000000000", + "entry_conversion_bits": 847, + "complete_log2_C": 593252820, + "public_A": 1881073, + "public_offset": 4, + "peak_height": 1681001, + "parent_complete_log2_C": 685495960, + "delta_from_8088": "425671527/1000000000000000" +} diff --git a/research/p104-shortcut-eta-target/SOURCE8088.json b/research/p104-shortcut-eta-target/SOURCE8088.json new file mode 100644 index 0000000000..f1be37d3bb --- /dev/null +++ b/research/p104-shortcut-eta-target/SOURCE8088.json @@ -0,0 +1,50 @@ +{ + "commit": "06691302af526a488f3dee0298035f86b6e69c51", + "package": "research/p104-shortcut-word-lift-20bit", + "files": { + "LICENSE": { + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4", + "git_blob": "261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64" + }, + "NOTICE.md": { + "sha256": "9bb1b93c10f93bc4d5c6cf7e0e9a25e91c0bb260a1224a536420d0c145ef58d6", + "git_blob": "bdad26a55c826d83a537a3fbd0792df9f832c827" + }, + "PEER-SOURCE.json": { + "sha256": "798c2e6394c258986484a116198cc542a6d2b4c1f289e5816de2cfecf5141c51", + "git_blob": "6f84b3aef4b8c5026e348d88700bc9401514ccab" + }, + "prepare.py": { + "sha256": "3524bade68458207f78f3cd4040d06cc16334a8fb085a5570e0d391e384b9305", + "git_blob": "b4477aa797e83c3f131df689ffc5bcd394df411a" + }, + "verify.py": { + "sha256": "a6a03bccedfbbfa1739ccc8ef3052853accdc91e8f329969de3a3d17ae8219c7", + "git_blob": "36e20c189f037034e2550ebdc87f34748293dbd3" + }, + "peer8057.tar.gz": { + "sha256": "0e0d559bdb15e7b647f88a2b5e27fcdc9e28e81d8f4145459876ba6da2e9314c", + "git_blob": "3a3ded828f6bbf9b6e6a76ba255d480452f4d269" + }, + "w5669_shortcut5.json.gz": { + "sha256": "6ef741c346ea075c4f2ed11f9d42d7076103e72d4a9e5059d495f1cb990fd149", + "git_blob": "2381d62342e3caa457e1ef498f05ba98dcc1b11c" + }, + "RESULT.json": { + "sha256": "fc0c929df882fcabf4ba1481f5e11c69daa7e50184b3bbae7330a8c88c013f14", + "git_blob": "d3aa1658f47cdf297b71afb37c02ff260979308b" + }, + "check_stage_seam.py": { + "sha256": "ba0427d889081c12993a16f491e32fffb5e22fe9a37b6baade8f2c8c2c0878f3", + "git_blob": "5f06eb78fded204ffb7729661c4070a8766149b3" + }, + "check_cutoff.py": { + "sha256": "51ffd638ee01377cc72718469007e556f7fb5b646bfd5258301dc0e29755fea1", + "git_blob": "89b93baa92af16fe8062ea9b0e0074f33fe8a5a2" + }, + "check_ordinary_floor.py": { + "sha256": "417c9e4f1be8fd6be197a93aa136e527765a65032d7845eda653bdc89132edee", + "git_blob": "94cf4e2a2b5da7feed3d1aeba7f37d33116b0051" + } + } +} diff --git a/research/p104-shortcut-eta-target/SOURCES.json b/research/p104-shortcut-eta-target/SOURCES.json new file mode 100644 index 0000000000..6e1856313a --- /dev/null +++ b/research/p104-shortcut-eta-target/SOURCES.json @@ -0,0 +1,94 @@ +{ + "schema_version": 1, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "75d77b328ea02ded535e7f23aee5b1e55d0bb1a8", + "sha256": "154c3d30455d778fd3343b6b4851f0fa4665f0f7625b0adb3675e2bafbbf6bf1" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "3404fbdd5e7529a0674eef26114b5071e4586cec", + "sha256": "ead6cdc9d0af6d58e8a49744d8ec8c7c15e13d2ba93c276c434bcf9b51b93a81" + } + ], + "embedded_source": { + "repository": "CrocSwap/integer-mult-bounds", + "pull_request": 8088, + "head": "06691302af526a488f3dee0298035f86b6e69c51", + "scope": "Offline verification checks every retained SHA-256 and Git blob name. A separate optional source-history check uses the exact Git export.", + "files": [ + { + "stored_path": "parent8088/LICENSE", + "source_path": "research/p104-shortcut-word-lift-20bit/LICENSE", + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4", + "git_blob": "261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64" + }, + { + "stored_path": "parent8088/NOTICE.md", + "source_path": "research/p104-shortcut-word-lift-20bit/NOTICE.md", + "sha256": "9bb1b93c10f93bc4d5c6cf7e0e9a25e91c0bb260a1224a536420d0c145ef58d6", + "git_blob": "bdad26a55c826d83a537a3fbd0792df9f832c827" + }, + { + "stored_path": "parent8088/PEER-SOURCE.json", + "source_path": "research/p104-shortcut-word-lift-20bit/PEER-SOURCE.json", + "sha256": "798c2e6394c258986484a116198cc542a6d2b4c1f289e5816de2cfecf5141c51", + "git_blob": "6f84b3aef4b8c5026e348d88700bc9401514ccab" + }, + { + "stored_path": "parent8088/prepare.py", + "source_path": "research/p104-shortcut-word-lift-20bit/prepare.py", + "sha256": "3524bade68458207f78f3cd4040d06cc16334a8fb085a5570e0d391e384b9305", + "git_blob": "b4477aa797e83c3f131df689ffc5bcd394df411a" + }, + { + "stored_path": "parent8088/verify.py", + "source_path": "research/p104-shortcut-word-lift-20bit/verify.py", + "sha256": "a6a03bccedfbbfa1739ccc8ef3052853accdc91e8f329969de3a3d17ae8219c7", + "git_blob": "36e20c189f037034e2550ebdc87f34748293dbd3" + }, + { + "stored_path": "parent8088/peer8057.tar.gz", + "source_path": "research/p104-shortcut-word-lift-20bit/peer8057.tar.gz", + "sha256": "0e0d559bdb15e7b647f88a2b5e27fcdc9e28e81d8f4145459876ba6da2e9314c", + "git_blob": "3a3ded828f6bbf9b6e6a76ba255d480452f4d269" + }, + { + "stored_path": "parent8088/w5669_shortcut5.json.gz", + "source_path": "research/p104-shortcut-word-lift-20bit/w5669_shortcut5.json.gz", + "sha256": "6ef741c346ea075c4f2ed11f9d42d7076103e72d4a9e5059d495f1cb990fd149", + "git_blob": "2381d62342e3caa457e1ef498f05ba98dcc1b11c" + }, + { + "stored_path": "parent8088/RESULT.json", + "source_path": "research/p104-shortcut-word-lift-20bit/RESULT.json", + "sha256": "fc0c929df882fcabf4ba1481f5e11c69daa7e50184b3bbae7330a8c88c013f14", + "git_blob": "d3aa1658f47cdf297b71afb37c02ff260979308b" + }, + { + "stored_path": "parent8088/check_stage_seam.py", + "source_path": "research/p104-shortcut-word-lift-20bit/check_stage_seam.py", + "sha256": "ba0427d889081c12993a16f491e32fffb5e22fe9a37b6baade8f2c8c2c0878f3", + "git_blob": "5f06eb78fded204ffb7729661c4070a8766149b3" + }, + { + "stored_path": "parent8088/check_cutoff.py", + "source_path": "research/p104-shortcut-word-lift-20bit/check_cutoff.py", + "sha256": "51ffd638ee01377cc72718469007e556f7fb5b646bfd5258301dc0e29755fea1", + "git_blob": "89b93baa92af16fe8062ea9b0e0074f33fe8a5a2" + }, + { + "stored_path": "parent8088/check_ordinary_floor.py", + "source_path": "research/p104-shortcut-word-lift-20bit/check_ordinary_floor.py", + "sha256": "417c9e4f1be8fd6be197a93aa136e527765a65032d7845eda653bdc89132edee", + "git_blob": "94cf4e2a2b5da7feed3d1aeba7f37d33116b0051" + } + ], + "ordinary_profile_predecessor": "af73b476d5fdeaa763e0bff2dd87b2ecaf097c49", + "allocation_lineage": "75f7e1c44f48c43983016bcf8878c4d9e5e87c62" + } +} diff --git a/research/p104-shortcut-eta-target/TASK.json b/research/p104-shortcut-eta-target/TASK.json new file mode 100644 index 0000000000..3483f04b8f --- /dev/null +++ b/research/p104-shortcut-eta-target/TASK.json @@ -0,0 +1,97 @@ +{ + "schema_version": 1, + "task_id": "supplier-boundary-audit", + "priority_revision": 8, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "original_card": { + "id": "supplier-boundary-audit", + "question": "Does one changed supplier have complete source-bound native, caller, ordinary and outer admission coverage?", + "starting_points": [ + "docs/research/current-priorities.md", + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md" + ], + "methods": [ + "Construct and independently check one source-bound instance of the stated first experiment.", + "Seek an exact counterexample or target-specific complete-budget obstruction to that same proposed change." + ], + "acceptance_gate": "Pin the current sources and one obligation; the historical owner audit is an example, not evidence of a current bug.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read revision 8, the selected review and live exact-source handoffs. Then follow this card's bounded first_experiment.", + "scope": "Source-bound orientation only, not a supplier replay or theorem proof." + }, + "first_experiment": "Choose one latest uncovered candidate and build a delta coverage map against the selected review. For P104, #5717 changes owned-lifetime assumptions and #5719 covers exact #5713 causal premises; neither automatically transfers to #5718. For BIT, #5679/#5708 need component admission and compatible outer use. Check controls and exact source identity before reuse; stop with one resolved gap or explicit remaining obligation. A heavy full replay requires a separate serial resource budget.", + "bottleneck_link": "Judge the actual current supplier contract and complete signed target/paid bill; frozen-profile ceilings require an applicability proof.", + "allowed_variations": [ + "One exact source head, helper/cut region or quantified proposition and changed hypothesis; check live handoffs first. Different seeds are not different scopes." + ], + "scope_change_triggers": [ + "Changing source head, helper/cut domain, operation alphabet or caller boundary without recording the new scope.", + "Treating an archived proposal or local numerical pass as complete supplier admission." + ], + "overlap_terms": [ + "supplier admission", + "5717", + "5719", + "5708", + "owned lifetime" + ], + "existing_checks": [ + { + "scope": "PR #4088: author-checked local words, native receipts, owner/phase fill and exact moment.", + "evidence": "research/staged544-mixed-fourth-entry/README.md", + "remaining": "Rebind and validate ordinary/outer admission with all four providers; full mixed release not established.", + "status": "author-checked", + "source_commit": "72d7efc181edb21806a878f174847c96dd410ab0", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #3801: successor scatter-boundary decision package.", + "evidence": "research/scatter-boundary-decision/README.md", + "remaining": "Consult its exact acceptance scope before any new exporter audit; not proof of a selected failure.", + "status": "author-checked", + "source_commit": "911f8800ba7a4b03603ef62c5ffc6240e53cb5fd", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "Selected PR5599: complete helper-subspace construction and independent caller replay; five framework assumptions remain.", + "evidence": "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "remaining": "The next experiment must identify uncovered source-specific work. Successor archive intake does not transfer this admission.", + "status": "reviewed", + "source_commit": "09dd0965711ca7eeb169057a420abab1c9052137", + "selected_record_sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5" + } + ] + }, + "scope_status": "refined", + "scope_change_reason": "The user nominated floration’s exact #8088 five-shortcut word for a complete 39/10000 construction with an enlarged ordinary height.", + "actual_scope": "Prove the conditional 39/10000 application using the #8088 Gaussian word and #8084 ordinary eta-lift, recheck exact grid and context headroom, both signed tiers, physical finite fixtures, fixed installation and its explicit action-count qualification.", + "bottleneck_link": "Neither the old Gaussian word nor the old ordinary clamp meets the target. A joint construction needs exact new coefficients, directed supplier funding, signed clocks, and a working two-tier installer.", + "budget_minutes": null, + "stop_rule": "Stop at the independently replayed conditional target, or record the first precise obstruction and signed deficit.", + "outcome": "completed", + "evidence": "PROOF.md, EVIDENCE.md, RESULT.json, COMPARATOR.json, GRID.json, CALLER.json, ATLAS.json, PRICES.json, ORDINARY.json, FLOOR.json, CENSUS.json and the registered offline checks.", + "author": "Clear1nsight", + "ai_assistance": "Substantial OpenAI Codex assistance in mathematical analysis, setup accounting, implementation, verification and documentation.", + "open_questions": [ + { + "question": "What numerical fixed setup upper can be measured for this exact new image?", + "why_it_matters": "The coefficient for recurring work is directed, while the tighter setup ceiling depends on the action census.", + "first_step": "Meter both pinned fixed producer and receiver and include parsing, linking and cleanup.", + "blocked_by": "A new complete portable fuel trace for the five-shortcut installation is outstanding." + }, + { + "question": "Can independent review discharge a retained all-size hypothesis?", + "why_it_matters": "The complete exponent remains conditional on five framework premises.", + "first_step": "Audit arbitrary-column native transport, owned erasure, or precision against the exact word and caller.", + "blocked_by": "All-size independent proof review remains open." + } + ] +} diff --git a/research/p104-shortcut-eta-target/VERIFY.json b/research/p104-shortcut-eta-target/VERIFY.json new file mode 100644 index 0000000000..cb1cdaed42 --- /dev/null +++ b/research/p104-shortcut-eta-target/VERIFY.json @@ -0,0 +1,109 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/p104-shortcut-eta-target/ATLAS.json", + "research/p104-shortcut-eta-target/BILL-INPUTS.json", + "research/p104-shortcut-eta-target/BILL.json", + "research/p104-shortcut-eta-target/CALLER.json", + "research/p104-shortcut-eta-target/CENSUS.json", + "research/p104-shortcut-eta-target/COMPARATOR.json", + "research/p104-shortcut-eta-target/DIRECTORY.json", + "research/p104-shortcut-eta-target/FLOOR.json", + "research/p104-shortcut-eta-target/GRID.json", + "research/p104-shortcut-eta-target/ORDINARY.json", + "research/p104-shortcut-eta-target/PHASES.json", + "research/p104-shortcut-eta-target/PRICES.json", + "research/p104-shortcut-eta-target/RESULT.json", + "research/p104-shortcut-eta-target/SOURCE8088.json", + "research/p104-shortcut-eta-target/SOURCES.json", + "research/p104-shortcut-eta-target/TASK.json", + "research/p104-shortcut-eta-target/check_atlas.py", + "research/p104-shortcut-eta-target/check_bill.py", + "research/p104-shortcut-eta-target/check_bootstrap.py", + "research/p104-shortcut-eta-target/check_caller.py", + "research/p104-shortcut-eta-target/check_census.py", + "research/p104-shortcut-eta-target/check_comparator.py", + "research/p104-shortcut-eta-target/check_cutoff.py", + "research/p104-shortcut-eta-target/check_floor.py", + "research/p104-shortcut-eta-target/check_grid.py", + "research/p104-shortcut-eta-target/check_negative_controls.py", + "research/p104-shortcut-eta-target/check_ordinary.py", + "research/p104-shortcut-eta-target/check_path_binding.py", + "research/p104-shortcut-eta-target/check_phase_census.py", + "research/p104-shortcut-eta-target/check_prices.py", + "research/p104-shortcut-eta-target/check_product_path.py", + "research/p104-shortcut-eta-target/check_rational.py", + "research/p104-shortcut-eta-target/check_receiver.py", + "research/p104-shortcut-eta-target/check_setup.py", + "research/p104-shortcut-eta-target/freeze_inputs.py", + "research/p104-shortcut-eta-target/install.py", + "research/p104-shortcut-eta-target/invoice.py", + "research/p104-shortcut-eta-target/parent8088/LICENSE", + "research/p104-shortcut-eta-target/parent8088/NOTICE.md", + "research/p104-shortcut-eta-target/parent8088/PEER-SOURCE.json", + "research/p104-shortcut-eta-target/parent8088/RESULT.json", + "research/p104-shortcut-eta-target/parent8088/check_cutoff.py", + "research/p104-shortcut-eta-target/parent8088/check_ordinary_floor.py", + "research/p104-shortcut-eta-target/parent8088/check_stage_seam.py", + "research/p104-shortcut-eta-target/parent8088/peer8057.tar.gz", + "research/p104-shortcut-eta-target/parent8088/prepare.py", + "research/p104-shortcut-eta-target/parent8088/verify.py", + "research/p104-shortcut-eta-target/parent8088/w5669_shortcut5.json.gz", + "research/p104-shortcut-eta-target/verify.py" + ], + "commands": [ + { + "argv": [ + "{python}", + "-IB", + "{package}/verify.py", + "price" + ], + "timeout_seconds": 185, + "checks": "Rebuild both literal supplier prices, replay an independent interval and complete signed clock checker, physical ordinary tapes, adjacent height controls and the exact predecessor upper crossing." + }, + { + "argv": [ + "{python}", + "-IB", + "{package}/verify.py", + "algebra" + ], + "timeout_seconds": 220, + "checks": "Verify before-multiply divisions on the entire word, both matrix directions, chronological owners, the signed Clifford atlas and an independent corrupted-output control." + }, + { + "argv": [ + "{python}", + "-IB", + "{package}/verify.py", + "setup" + ], + "timeout_seconds": 175, + "checks": "Build both fixed profiles, census phase operations, emit and rebind the finite directory in fresh processes, and reject corruptions. The supplementary serial cap retains an action-census hypothesis." + }, + { + "argv": [ + "{python}", + "-IB", + "{package}/verify.py", + "layers" + ], + "timeout_seconds": 267, + "checks": "Replay the upper and lower cutoff at both actual heights, authenticate the active path, and run the calendar, ownership, placement, two raw types and exterior fixtures." + }, + { + "argv": [ + "{python}", + "-IB", + "{package}/verify.py", + "product" + ], + "timeout_seconds": 353, + "checks": "Execute a real nested nonzero crossing and restored signed multiplication, while counting native-path use of the small multiplication fixture." + } + ] +} diff --git a/research/p104-shortcut-eta-target/check_atlas.py b/research/p104-shortcut-eta-target/check_atlas.py new file mode 100644 index 0000000000..045ac957b8 --- /dev/null +++ b/research/p104-shortcut-eta-target/check_atlas.py @@ -0,0 +1,48 @@ +"""Validate the installed Clifford atlas against the independent chart verifier.""" + +import json +from pathlib import Path +import sys + + +def audit(runtime): + sys.path.insert(0, str(runtime)) + from upstream import install + + paths = install() + from strong_complex import digest, load_changed, required_pairs + from phase_atlas import catalogue + from charts import native_catalogue + from check_complex import all_images + from contacts import contact_receipt + + data = runtime / "inputs" + graph, layout = load_changed(data) + current = catalogue(graph, layout) + assert ( + digest(current) + == "f581128079a67c9fc6341ee96dce772342748f508c77f7d5956bf41408d97f58" + ) + assert {(a, b) for a, b, _ in current["pairs"]} == required_pairs(graph, layout) + checked = native_catalogue(graph, layout, current) + images = all_images(checked) + grade = paths[-1] / "research/grade14-native-realization" + contacts = contact_receipt( + layout, + json.loads((grade / "retained/data/CALLER-PHASE-BASES.json").read_bytes())[ + "by_q" + ], + ) + return dict( + atlas_sha256=digest(current), + pairs=len(current["pairs"]), + ports=len(current["ports"]), + images=images, + contacts=contacts, + ) + + +if __name__ == "__main__": + if not __debug__: + raise ValueError("Enable assertions") + print(json.dumps(audit(Path(sys.argv[1]).resolve()), sort_keys=True)) diff --git a/research/p104-shortcut-eta-target/check_bill.py b/research/p104-shortcut-eta-target/check_bill.py new file mode 100644 index 0000000000..d7df04d481 --- /dev/null +++ b/research/p104-shortcut-eta-target/check_bill.py @@ -0,0 +1,249 @@ +#!/usr/bin/env python3 +"""Independently check a frozen two-tier signed price and recurring clock. + +Uses only exact rational/integer arithmetic and outward dyadic square roots; +does not import the candidate's invoice, receipt, or numerical code. The +frozen grade tables are source-bound inputs, not a proof of physical action. +""" +from argparse import ArgumentParser +from collections import defaultdict +from decimal import Decimal, localcontext +from fractions import Fraction as F +from hashlib import sha256 +import json +from math import isqrt +from pathlib import Path +import sys + +ap = ArgumentParser() +ap.add_argument('--inputs', type=Path, default=Path(__file__).with_name('frozen-inputs.json')) +ap.add_argument('--expected-result', type=Path, required=True) +args = ap.parse_args() +if sys.version_info[:2] != (3, 12): + raise SystemExit('Use CPython 3.12 with assertions enabled') +if not __debug__: + raise SystemExit('Assertions must be enabled') +data = json.loads(args.inputs.read_bytes()) +expected_bytes = args.expected_result.read_bytes() +assert sha256(expected_bytes).hexdigest() == data['source']['expected_result_sha256'] +expected = json.loads(expected_bytes) +S = 1 << 192 + +def ceilfrac(x): + return -(-x.numerator // x.denominator) + +def pow_interval(base, exponent): + """192-bit directed enclosure of a positive rational to a dyadic power.""" + base, exponent = F(base), F(exponent) + assert base > 0 and 0 <= exponent < 1 and exponent.denominator.bit_count() == 1 + lower = (base * S).__floor__() + upper = ceilfrac(base * S) + plo = phi = S + for bit in range(exponent.denominator.bit_length() - 2, -1, -1): + lower = isqrt(lower * S) + upper = 1 + isqrt(upper * S - 1) + if exponent.numerator >> bit & 1: + plo = plo * lower // S + phi = -(-phi * upper // S) + return F(plo, S), F(phi, S) + +def qtext(x): + with localcontext() as ctx: + ctx.prec = 32 + return {'fraction': str(x), 'decimal': str(Decimal(x.numerator) / Decimal(x.denominator))} + +def unpack(book): + targets = {F(k): int(v) for k, v in book['targets']} + paid = {F(k): int(v) for k, v in book['paid']} + cells = {(F(r), F(k)): F(q) for r, k, q in book['cells']} + assert len(targets) == len(book['targets']) and len(paid) == len(book['paid']) + assert len(cells) == len(book['cells']) + return targets, paid, cells + +def funding(book): + targets, paid, cells = unpack(book) + c = F(book['trial']) + target_power = {k: pow_interval(k, 1-c) for k in targets} + paid_power = {r: pow_interval(r, 1-c) for r in paid} + total_t = sum(n * target_power[k][0] for k, n in targets.items()) + total_p = sum(n * paid_power[r][1] for r, n in paid.items()) + assert total_t > total_p + rows = defaultdict(F) + columns = defaultdict(F) + for (r, k), q in cells.items(): + assert r in paid and k in targets and q > 0 and 5*r <= 4*k + rows[r] += q + columns[k] += paid[r] * paid_power[r][1] * q + assert set(rows) == set(paid) and all(v == 1 for v in rows.values()) + assert all(0 < columns[k] <= targets[k] * target_power[k][0] for k in targets) + return {'targets': targets, 'paid': paid, 'cells': cells, 'trial': c, + 'margin': (total_t-total_p)/total_t} + +o = funding(data['ordinary']) +g = funding(data['gaussian']) +assert len(o['cells']) == 24 and len(g['cells']) == 51 +assert sum(o['targets'].values()) == 18906 and sum(o['paid'].values()) == 104652 +assert sum(g['targets'].values()) == 23989248 and sum(g['paid'].values()) == 128290608 +assert data['gaussian']['typed_counts'] == [282336, 281328] +assert o['trial'] == F(4391986206293, 2**50) +assert g['trial'] == F(17158764376, 2**42) + +# Ordinary finite factor includes the original 256/255 reserve and 47/20 tariff. +delta = F(1, 2**128) +L = data['ordinary']['level_floor'] +assert L == 18960 and F(data['ordinary']['debit']) == F(11239,8192) +base = 1024 * 134 * L +olow, ohigh = pow_interval(base, o['trial']) +common = (F(47,20)*F(256,255)*F(4097,4096)*F(1028,1024) + * (1+F(64,L)+delta) / ((1-F(10,L))*(1-delta)**3)) +ordinary_lo, ordinary_hi = common*olow, common*ohigh +ordinary_allowance_lo = 2*pow_interval(2,F(3047,8192))[0] +assert ordinary_hi < ordinary_allowance_lo +assert F(75,32)/F(47,20) == F(375,376) + +# Independent 51-cell Gaussian finite factor, with outward powers and +# directed lower/upper edge slope bounds. +ct = g['trial'] +psi_lo = psi_hi = F(0) +for (r,k), q in g['cells'].items(): + lo, hi = pow_interval(k/r, ct) + weight = g['paid'][r] * q * r + psi_lo += weight * (lo-1)/ct + psi_hi += weight * (hi-1)/ct +assert 0 < psi_lo <= psi_hi +axes = sum(k*n for k,n in g['targets'].items()) +assert axes == 677246016 +gl = data['gaussian']['level_floor'] +scale = data['gaussian']['upper_divisor'] * data['gaussian']['ambient'] // 2 +assert (gl,scale) == (1874,263772) +fringe_hi = 10*axes/((1-ct)*psi_lo) +fringe_lo = 10*axes/((1-ct)*psi_hi) +plo, phi = pow_interval(scale*gl,ct) +gcommon = (1+delta)*(1+F(4*data['gaussian']['largest_target'],scale))/(1-delta)**4 +gaussian_lo = gcommon*plo*(1+fringe_lo/gl+delta) +gaussian_hi = gcommon*phi*(1+fringe_hi/gl+delta) +gdebit = F(data['gaussian']['debit']) +assert gdebit == F(1039776,2**23) == F(32493,262144) +allowance = pow_interval(2,gdebit) +finer = pow_interval(2,F(1039775,2**23)) +assert gaussian_hi < allowance[0] and gaussian_lo > finer[1] + +def signed_margins(k, g, ordinary, positive): + a,b,q = k+4*g, k+5*g, k+3*g + ep,be = 1-g, 1-3*g + sigma,tau = 1-b, 1-a + internal = tau+(1-g)*max(sigma-tau,0) + leaf = sigma+g*(1-sigma) + lam = 1-(q+a)/2 + xi = ep*(1+q)-F(3,32)+g + key = be+1-ep + powers = [ep*q,a,1-ep+q*be,1-ep+a*be,1-ep+be,F(3,32)+xi-ep, + xi+F(1,2)-ep,ep,1-(ep+be+48-128+2)] + strict = [ordinary-a,b-a,q,b-q,a-q,g,1-g,(1-g)*b-a,1-internal-q,1-leaf-q, + lam-tau,lam-sigma,lam-internal,1-q-lam,1-q-leaf,ep,1-ep,xi-F(1,2),ep-xi, + be,ep-be,1-be,1-(2*xi-2)-g/10-be,1-(2*xi-2)-be,1-ep-g/10,1-ep, + g/10,1-key,1-be-2*(1-ep),128-48-be,g,ep-a,F(1,32)-b,F(2**45-7**16), + F(2),2-xi,F(5),1-be,1-be,1-ep,powers[2]-powers[0],g, + k-F('.001730970419199163702738'),1-ep,F(11,2)] + [x-k for x in powers] + functional = [1-be,be*(1-F(3,1000)),128-48-ep-be-1,be*(1-F(1,250))] + assert len(strict) == 54 and len(functional) == 4 + assert min(*strict,*functional,positive-b) > 0 + return {'strict':len(strict), 'functional':len(functional), + 'smallest_margin':str(min(*strict,*functional,positive-b)), + 'ordinary_margin':str(ordinary-a), 'positive_margin':str(positive-b)} + +def stages(profile): + heights = profile['ordinary_heights'] + k, eta = F(profile['kappa']), F(profile['eta']) + stop = F(1,profile['stop_denominator']) + book = k + 5*stop + assert F(1,250) > eta > book + previous = F(0) + out = [] + for i,h in enumerate(heights): + upper = min(eta, (249*(o['trial']-F(11239,8192*h))+previous)/250) + chosen = book if i+1 == len(heights) else F((upper*10**21).__floor__()-1,10**21) + assert previous < chosen < upper + out.append({'height':h,'booked':str(chosen),'upper':str(upper),'slack':str(upper-chosen)}) + previous = chosen + positive = ct-gdebit/profile['gaussian_height'] + signed = signed_margins(k,stop,book,positive) + return out,positive,signed + +def ceil_log2(n): + assert n > 0 + return (n-1).bit_length() + +def cuts(heights): + out=[] + for h in heights: + minimum = -(-250*(h+64)//249) + out.append(max(minimum, h+out[-1]+64 if out else 0)) + return out + +def activation(last, h): + goal=last+h+102 + s=max(512,goal) + while s < goal+7*ceil_log2(s): + s=goal+7*ceil_log2(s) + q=ceil_log2(s) + if (1< 2 * (carrier // (2048 * 306)) + assert upper % 2 == 0 and 4*258*(upper-8) < n + assert len(cells) == 88 and tuple(word.multiplicity for word in types) == WEIGHTS + assert (volume, ticks, rounds) == (carrier**6, carrier**82, carrier**2) + assert options == {"width": 1 << (92*height), "delay_base": 1 << 19} + return True + + original = grades.TypedPlan + try: + grades.TypedPlan = verify + assert recipe.open() + finally: + grades.TypedPlan = original + + +heights = (ENTRY.complex_log, TERMINAL.complex_log) +assert heights == (1024, 85406) +for height in heights: + verify_constructor_call(height) +print("PASS_LITERAL_UPPER_FENCE", UPPER_DIVISOR, LOWER, heights, flush=True) + +for band, expected in ((LOWER, (2, 0)), (LOWER+2, (0, 0))): + widths = [] + for kind, scale in enumerate(SCALES): + header = column_header(band-8, kind) + assert header % 2 == kind and header - kind == band-8 + widths.append((header-kind)*scale) + assert tuple(width % 4 for width in widths) == expected +assert (LOWER-8, 2*(LOWER-8)) == (1866,3732) + +native = tuple(NativeType((2,), (1,), weight) for weight in WEIGHTS) +shares = {(a,1,b,2):Q(w,sum(WEIGHTS)) for a in range(2) for b,w in enumerate(WEIGHTS)} +t = 1-GAUSSIAN_C +n, volume = 65536, 2**29 +plan = TypedPlan(n, native, shares, t, LOWER, 4126, volume, 3, 16, delay_base=3, padding=1) +mass = Measure(t, volume, 64*n.bit_length()) +assert plan.bands.start == LOWER and (LOWER-2,0) not in plan.count +for band in plan.bands: + for kind, weight in enumerate(WEIGHTS): + assert plan.count[band,kind] == ceil(weight * mass.mass(band,band+2)[1]) +assert {(a,link.kind) for (_,a,_),ls in plan.send.items() for link in ls} == {(0,0),(0,1),(1,0),(1,1)} +grants = [] +for recipient in range(2): + for link in plan.receive[LOWER,recipient,0]: + assert link.band in (2*LOWER,2*LOWER+2) and plan.delay[LOWER] < plan.delay[link.band] + assert link.count > 0 + grants.append((recipient,link.kind,link.band,link.count)) +assert len(grants) == 8 and plan.source_width > 0 and plan.leaves_per_epoch > 0 +print('PASS_LITERAL_LOWER_CUTOFF', LOWER, (1866,3732), grants, plan.leaves_per_epoch, flush=True) diff --git a/research/p104-shortcut-eta-target/check_floor.py b/research/p104-shortcut-eta-target/check_floor.py new file mode 100644 index 0000000000..4c96270cf9 --- /dev/null +++ b/research/p104-shortcut-eta-target/check_floor.py @@ -0,0 +1,48 @@ +"""Replay the original ordinary stock hypotheses and two finite signed tapes at the installed floor.""" + +from pathlib import Path +import json +import runpy +import sys + +if not __debug__: + raise ValueError("Enable assertions") + +tree = Path(sys.argv[1]).resolve() +runtime = tree / "runtime" +peer = tree / "research/frequency-weighted-native-multiplier" +sys.argv = [__file__, str(runtime)] +sys.path.insert(0, str(runtime)) +from upstream import install + +install() +from installations import BINARY_C +from raw_binary_stage import binary_word +from unpowered_price import intervals +from strict_moment import UNIT + +original = (peer / "check_ordinary_floor.py").read_bytes() +for before, after in ( + (b"LOWER=4474", b"LOWER=18960"), + (b"(4466,4468)", b"(18952,18954)"), +): + assert original.count(before) == 1 + original = original.replace(before, after) +ns = { + "__name__": "actual_target_floor", + "__file__": str(peer / "check_ordinary_floor.py"), +} +exec(compile(original, ns["__file__"], "exec"), ns) +word = binary_word() +stock = ns["all_size_stock"](word, BINARY_C, intervals, UNIT) +fixture = ns["finite_plan"](word, BINARY_C) +seam = runpy.run_path(str(peer / "check_stage_seam.py")) +tapes = [seam["verify_tape"](1, [0, 1], [2, 1]), seam["verify_tape"](2, [1, 7], [3, 1])] +assert stock["first_two_columns"] == [18952, 18954] +assert fixture["tested_occupied_K7_grade"] == [49, 64] and fixture["native_opens"] > 0 +print( + json.dumps( + {"stock": stock, "finite_occupied_edge": fixture, "signed_tapes": tapes}, + sort_keys=True, + ) +) diff --git a/research/p104-shortcut-eta-target/check_grid.py b/research/p104-shortcut-eta-target/check_grid.py new file mode 100644 index 0000000000..a6f77b8c92 --- /dev/null +++ b/research/p104-shortcut-eta-target/check_grid.py @@ -0,0 +1,94 @@ +"""Replay all changed-word scalar divisions and calculate the width of a raw context.""" + +from fractions import Fraction +from math import gcd, prod +from pathlib import Path +import json +import sys + + +def audit(runtime): + sys.path.insert(0, str(runtime)) + from upstream import install + + install() + from strong_complex import GRID, ODD, DYADIC, load_changed, digest + from spool import short_divisors + + data = runtime / "inputs" + graph, layout = load_changed(data) + assert ( + digest(graph) + == "ed3bea7186f962f3a8a8ae389cecce3d1ef48a7a832cf9af6c9048a6b5919b35" + ) + n = len(graph["initial"]) + stocks = {~i: {i: GRID} for i in range(n)} + mass = {~i: Fraction(1) for i in range(n)} + moves = {k for k, _, _ in graph["moves"]} + forms = {k: [(s, Fraction(c)) for s, c in row] for k, row in graph["forms"]} + want = [{i: GRID} for i in range(n)] + for i, x in enumerate(layout["live"]): + y = x + 112 + if i in layout["hosted"]["Dports"]: + want[y][x] = GRID + else: + want[x][y] = -GRID + want[y] = {x: GRID // 2, y: GRID // 2} + for x, y in zip(layout["hosted"]["X2"], layout["hosted"]["Y2"], strict=True): + want[x][y] = -GRID + peak = Fraction(1) + common = GRID + factors = set() + total = divisions = 0 + for k in graph["schedule"]: + row = {} + weight = Fraction(0) + for s, c in forms[k]: + a, b = c.numerator, c.denominator + factors.add(c) + weight += abs(c) * mass[s] + for i, v in stocks[s].items(): + quotient, rem = divmod(v, b) + if rem: + raise ArithmeticError( + f"inexact physical division: node {k}, donor {s}, basis {i}, numerator {a}, denominator {b}, input {v}, remainder {rem}" + ) + term = a * quotient + if common != 1: + common = gcd(common, term) + row[i] = row.get(i, 0) + term + count = len(stocks[s]) + total += count + divisions += count if b != 1 else 0 + peak = max(peak, weight) + nonzero = {i: v for i, v in row.items() if v} + if k in moves: + stocks[k] = nonzero + mass[k] = weight + else: + assert nonzero == want[k - graph["first_output"]], k + largest = width = 0 + for c in factors | {Fraction(ODD), Fraction(1, ODD)}: + pieces = short_divisors(c.denominator) + assert prod(pieces) == c.denominator and all(1 < v < 2**24 for v in pieces) + largest = max(largest, *pieces, 0) + width = max(width, c.numerator.bit_length(), c.denominator.bit_length()) + assert common == 1 and ODD << DYADIC == GRID + return dict( + grid=GRID, + odd=ODD, + dyadic=DYADIC, + roles=n, + products=total, + nontrivial=divisions, + peak=str(peak), + distinct_literals=len(factors), + maximum_literal_bits=width, + largest_divisor=largest, + ) + + +if __name__ == "__main__": + if not __debug__: + raise ValueError("Run with assertions enabled") + print(json.dumps(audit(Path(sys.argv[1]).resolve()), sort_keys=True), flush=True) diff --git a/research/p104-shortcut-eta-target/check_negative_controls.py b/research/p104-shortcut-eta-target/check_negative_controls.py new file mode 100644 index 0000000000..fba789c0fa --- /dev/null +++ b/research/p104-shortcut-eta-target/check_negative_controls.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python3 +"""Reject four independently altered bill fixtures without touching the inputs.""" +from argparse import ArgumentParser +from copy import deepcopy +from fractions import Fraction +from hashlib import sha256 +import json +from pathlib import Path +import subprocess +import sys +import tempfile + +ap = ArgumentParser() +ap.add_argument('--inputs', type=Path, required=True) +ap.add_argument('--expected-result', type=Path, required=True) +ap.add_argument('--output', type=Path, required=True) +args = ap.parse_args() +source = json.loads(args.inputs.read_bytes()) +expected = json.loads(args.expected_result.read_bytes()) +checker = Path(__file__).with_name('check_bill.py') +results = [] +with tempfile.TemporaryDirectory(prefix='independent-bill-controls-') as directory: + root = Path(directory) + for name in ('cell', 'last-height', 'gaussian-height', 'repinned-clock'): + data, result = deepcopy(source), deepcopy(expected) + if name == 'cell': + cell = data['gaussian']['cells'][0] + cell[2] = str(Fraction(cell[2]) + Fraction(1, 2**100)) + elif name == 'last-height': + data['terminal']['ordinary_heights'][-1] -= 1 + elif name == 'gaussian-height': + data['terminal']['gaussian_height'] -= 1 + else: + result['complete_log2_C'] -= 1 + result_bytes = (json.dumps(result, sort_keys=True) + '\n').encode() + if name == 'repinned-clock': + data['source']['expected_result_sha256'] = sha256(result_bytes).hexdigest() + else: + result_bytes = args.expected_result.read_bytes() + inp, exp = root / f'{name}-inputs.json', root / f'{name}-expected.json' + inp.write_text(json.dumps(data, sort_keys=True) + '\n') + exp.write_bytes(result_bytes) + run = subprocess.run([sys.executable, '-IB', str(checker), '--inputs', str(inp), '--expected-result', str(exp)], + capture_output=True, text=True, timeout=30) + assert run.returncode != 0 and 'PASS_INDEPENDENT_FROZEN_TWO_TIER_BILL' not in run.stdout, name + results.append({'control': name, 'returncode': run.returncode, 'stderr_sha256': sha256(run.stderr.encode()).hexdigest(), + 'stderr_last_line': run.stderr.strip().splitlines()[-1] if run.stderr.strip() else ''}) +out = args.output.resolve() +out.parent.mkdir(parents=True, exist_ok=True) +out.write_text(json.dumps({'controls': results}, indent=2) + '\n') +print('PASS_INDEPENDENT_BILL_NEGATIVE_CONTROLS', out, flush=True) diff --git a/research/p104-shortcut-eta-target/check_ordinary.py b/research/p104-shortcut-eta-target/check_ordinary.py new file mode 100644 index 0000000000..a5912bd7bb --- /dev/null +++ b/research/p104-shortcut-eta-target/check_ordinary.py @@ -0,0 +1,316 @@ +#!/usr/bin/env python3 +"""Check the #8084 ordinary lift on the pinned, patched #8088 runtime. + +Usage: python3.12 -I -B check_ordinary.py RUNTIME FREQUENCY_PACKAGE + +This checks the literal stage parser with captured receiver/body seams, exact +directed prices and the source's outer admission and clock routine. It does not +run the astronomical physical product, prove inherited premises, or accept a +combined kappa result. The caller must reconstruct the two source directories +from the stated pinned predecessor; the checked runtime/source SHA-256 values +below fail closed on altered relevant files. +""" + +from collections import Counter +from dataclasses import replace +from fractions import Fraction as Q +from hashlib import sha256 +import importlib.util +import json +from pathlib import Path +import sys +from tempfile import TemporaryDirectory + + +RUNTIME_PINS = { + "installations.py": "5df81fddba26013b142195f5c3119491fa2f07b1e72c3616ae76e7d7ffbb0fd1", + "ordinary_carrier.py": "aa1a64d48daf22f3918922481899a460dfe8e70268388e41f133279bc78f141d", + "raw_binary_stage.py": "e24bd735598d278dbd46cada584a63da01796d77ad557a45b80a4dfc7bbbd0b0", + "binary_receiver.py": "a7cc759e9a88e60dbcd59ca314ae5b9d39a33b5c642b56e680bbab775b0f06c5", + "transport.py": "9eb8f0d77a4c53fc4fddffdfe198cab930b6d1f49e2b6d43c970397051bb7818", + "grades.py": "6124744b40f806c80b6f10010a72e755bc11d64a8cc9a04f5e8316799eb6f05d", + "retimed_supplier.py": "2a87c2781ca93fa854aee098dcb7c50a65f2a46267ba926e3997b442e5a25f2c", + "strong_complex.py": "8f3fb92523df006e2e94505127088aaf2e64fadd20b3cab2344f62d7690e875d", + "strong-bit.json.gz": "9e7392c52bcf29c0cc58c54c619f95c28f476394c33e8e0a5aa30c9557d31362", + "w5669_shortcut5.json.gz": "6ef741c346ea075c4f2ed11f9d42d7076103e72d4a9e5059d495f1cb990fd149", + "inputs/triangular/staged_carriers.py": "6c925ae4b39dc9999ac5891d1a27dcbb38e129a36e1473b2b418f27a806b6fc4", +} +PEER_PINS = { + "receipt.py": "504ece3196cf8d574d368c72918b9e4b4ce6837bd7241a6a4725b7a6ddbe7275", + "independent_price.py": "fcd4254414d601a96b91822ff3c6b615de9caa1a9bb35ba1f5adff37745647ea", +} +TIERED_PINS = { + "source/activation.py": "6e7f89d40a4d10ecd40a50e5b96334dfc64db90841ece7e3ef12eeca5ee5093b", + "source/outer_budget.py": "ca4438db28a447ed5c43d87d43f0ac10a0cb2b4e183342ac93139d517b9d4d02", + "source/ordinary_clock.py": "91dcf0ef72dddbde998b80f3d8b30c8036de9ce97e06e2bbd9c4159bf292020d", +} +K = Q(39, 10000) +GAP = Q(1, 10**18) +ORDINARY = K + 5 * GAP +ETA = Q(1, 256) +HEIGHTS = (8192, 106000, 1681001) +GAUSSIAN_H = 85406 +OLD_DEBIT = Q(11239, 8192) +PARENT_DEBIT = Q(1420718, 2**20) +GAUSSIAN_DEBIT = Q(1039776, 2**23) + + +def pins(root, expected): + for name, digest in expected.items(): + if sha256((root / name).read_bytes()).hexdigest() != digest: + raise ValueError(f"Source image differs at {name}") + + +def load_module(name, path): + spec = importlib.util.spec_from_file_location(name, path) + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + return module + + +class DyadicWidth(int): + def __pow__(self, exponent): + assert self.bit_count() == 1 and exponent >= 0 + return 1 << ((self.bit_length() - 1) * exponent) + + +def dispatch_fixture(profile, cuts, stage, log_width): + """Execute real selection/layout with exact dyadic roots and captured sinks.""" + import ordinary_carrier as carrier + + assert stage in (2, 3) and log_width % 32000 == 0 + number = DyadicWidth(1 << log_width) + previous = 1 << cuts[stage - 2] + width = max(previous + 1, 1 << (log_width // 250)) + component = 1 << (log_width // 256) + count = -(-width // component) + short, longer = divmod(width, count) + layout = (longer, short + 1, count - longer, short) + rank = 1 << profile.rank_logs[stage - 1] + direct = -(-number // width) <= 1 << (8 * profile.rank_logs[stage - 1]) + calls = [] + + def root(value, degree): + assert value.bit_count() == 1 + exponent, remainder = divmod(value.bit_length() - 1, degree) + assert remainder == 0 + return 1 << exponent + + def receiver(dimension, actual_layout, prior, *, direct, profile): + assert dimension == rank and actual_layout == layout + assert direct == expected_direct and prior.func is carrier.ternary + assert prior.keywords == {"maximum": stage - 1, "profile": profile} + return stage + + def body(source, target, digits, prefix, gap, suffix, backend): + assert digits == number and (prefix, gap, suffix, backend) == (1, 3, 5, stage) + calls.append(stage) + + expected_direct = direct + saved = carrier.ceil_root, carrier.Receiver, carrier.root_body + try: + carrier.ceil_root, carrier.Receiver, carrier.root_body = root, receiver, body + carrier.ternary(None, None, number, 1, 3, 5, maximum=stage, profile=profile) + finally: + carrier.ceil_root, carrier.Receiver, carrier.root_body = saved + assert calls == [stage] + return {"stage": stage, "scanned_log": log_width, + "component_log": log_width // 256, "direct": direct} + + +def rejected(label, function): + try: + function() + except (AssertionError, ArithmeticError, ValueError): + return label + raise AssertionError(f"Control {label} was accepted") + + +def setup_parameter_guard(profile): + """Check only #8084's numeric setup premises, not its fixed-word census.""" + heights = (*profile.rank_logs, profile.complex_log) + scalars = (profile.kappa.numerator, profile.kappa.denominator, + profile.eta.numerator, profile.eta.denominator, + profile.positive_stop_denominator) + if not all(isinstance(h, int) and 1024 <= h < 2**25 for h in heights): + raise ValueError("A setup height is outside the 25-bit interval") + if not all(isinstance(x, int) and abs(x).bit_length() <= 128 for x in scalars): + raise ValueError("A setup scalar encoding exceeds 128 bits") + if profile.positive_stop_denominator <= 0: + raise ValueError("The stop denominator must be positive") + return max(abs(x).bit_length() for x in scalars) + + +def main(runtime, peer): + if not __debug__: + raise ValueError("Run with assertions enabled") + tiered = peer.parent / "tiered-native-multiplier" + pins(runtime, RUNTIME_PINS) + pins(peer, PEER_PINS) + pins(tiered, TIERED_PINS) + # -B does not prevent cache reads. Use a private, empty cache namespace for + # imports from the runtime and its authenticated nested source bundles. + with TemporaryDirectory(prefix="ordinary-check-cache-") as cache: + sys.pycache_prefix = cache + sys.dont_write_bytecode = True + sys.path[:0] = [str(runtime), str(tiered / "source"), str(tiered)] + from upstream import install + install() + from activation import resource_receipt + from installations import BINARY_C, GAUSSIAN_C, ENTRY, TERMINAL, activation + from module_atoms import ceil_root + from ordinary_clock import first_stage_bound + from ordinary_carrier import stage_for_width_log + from outer_budget import qualify + from raw_binary_stage import binary_recipe, binary_word + from staged_carriers import entrance_logs + import transport + + assert TERMINAL.rank_logs == HEIGHTS and TERMINAL.complex_log == GAUSSIAN_H + assert TERMINAL.kappa == K and TERMINAL.eta == ETA + assert TERMINAL.ordinary == ORDINARY and K < ORDINARY < ETA < Q(1, 250) + assert BINARY_C == Q(4391986206293, 2**50) + assert GAUSSIAN_C == Q(17158764376, 2**42) + assert first_stage_bound(ETA) == first_stage_bound(ENTRY.eta) + assert len(ENTRY.rank_logs) == 2 and len(TERMINAL.rank_logs) == 3 + scalar_bits = max(setup_parameter_guard(ENTRY), setup_parameter_guard(TERMINAL)) + + # The 8088 word's positive trial and debit fund q only from G=85406. + def positive_at(height): + return GAUSSIAN_C - GAUSSIAN_DEBIT / height + + assert positive_at(GAUSSIAN_H - 1) < ORDINARY < positive_at(GAUSSIAN_H) + assert positive_at(66037) < ORDINARY + signed = qualify(K, GAP, ORDINARY, positive_at(GAUSSIAN_H)) + assert signed["strict"] == 54 and signed["functional"] == 4 + + # The exact parent bank parser is reused, but its old 4474-floor debit + # is temporarily replaced by the separately certified 18960-floor + # debit. The parent receipt's hardcoded main/check is not called. + saved_argv = sys.argv + sys.argv = [str(peer / "receipt.py"), str(runtime)] + try: + receipt = load_module("ordinary_parent_receipt", peer / "receipt.py") + price = load_module("ordinary_directed_price", peer / "independent_price.py") + finally: + sys.argv = saved_argv + assert receipt.ORDINARY_DEBIT == PARENT_DEBIT + assert receipt.DEBIT == GAUSSIAN_DEBIT + old = receipt.ORDINARY_DEBIT + receipt.ORDINARY_DEBIT = OLD_DEBIT + try: + early = receipt.bank(ENTRY) + terminal = receipt.bank(TERMINAL) + controls = [ + rejected("eta-equals-public-kappa", lambda: receipt.bank(replace(TERMINAL, eta=K))), + rejected("eta-equals-ordinary-booking", lambda: receipt.bank(replace(TERMINAL, eta=ORDINARY))), + rejected("eta-equals-rho", lambda: receipt.bank(replace(TERMINAL, eta=Q(1, 250)))), + rejected("last-ordinary-height-minus-one", lambda: receipt.bank(replace(TERMINAL, rank_logs=(*HEIGHTS[:-1], HEIGHTS[-1] - 1)))), + rejected("gaussian-height-minus-one", lambda: receipt.bank(replace(TERMINAL, complex_log=GAUSSIAN_H - 1))), + rejected("setup-height-2^25", lambda: setup_parameter_guard(replace(TERMINAL, complex_log=2**25))), + rejected("setup-scalar-over-128-bits", lambda: setup_parameter_guard(replace(TERMINAL, positive_stop_denominator=2**128))), + ] + finally: + receipt.ORDINARY_DEBIT = old + + previous, stages = Q(0), [] + for i, height in enumerate(HEIGHTS): + raw = (249 * (BINARY_C - OLD_DEBIT / height) + previous) / 250 + upper = min(ETA, raw) + selected = ORDINARY if i == len(HEIGHTS) - 1 else Q((upper * 10**21).__floor__() - 1, 10**21) + assert previous < selected < upper + stages.append({"height": height, "raw_upper": str(raw), "upper": str(upper), + "booked": str(selected), "margin": str(upper - selected)}) + previous = selected + assert terminal["ordinary_rates"] == [x["booked"] for x in stages] + assert min(K, Q(stages[-1]["raw_upper"])) < ORDINARY + + # Bound the *chosen conservative expression*, including 256/255 and + # the 47/20 child tariff, on a directed 192-bit grid. The last control + # does not claim the actual physical factor is lower-bounded by it. + delta = Q(1, 2**128) + factor = (Q(47, 20) * Q(256, 255) * Q(4097, 4096) * Q(1028, 1024) + * (1 + Q(64, 18960) + delta) / ((1 - Q(10, 18960)) * (1 - delta)**3)) + low, high = price.powers(1024 * 134 * 18960, BINARY_C) + factor_lo, factor_hi = factor * low, factor * high + old_allow = 2 * price.powers(2, OLD_DEBIT - 1)[0] + parent_allow = 2 * price.powers(2, PARENT_DEBIT - 1)[1] + assert factor_hi < old_allow and factor_lo > parent_allow + assert Q(75, 32) / Q(47, 20) == Q(375, 376) + + word = binary_word() + assert (len(word.targets), len(word.paid), len(word.cells)) == (18906, 104652, 24) + recipes = tuple(binary_recipe(h) for h in HEIGHTS) + assert all(r.level_floor == 18960 and r.trial == BINARY_C + and r.targets is word.targets and r.paid is word.paid and r.cells is word.cells + for r in recipes) + + # Run the literal opening seam at the small candidate stage with the + # eventual Plan captured; the two large calendars remain unopened. + recipe = recipes[0] + n = 1 << HEIGHTS[0] + def capture(n0, targets, paid, cells, t, lower, upper, volume, ticks, rounds, **flags): + assert n0 == n and lower == 18960 and t == 1 - BINARY_C + assert targets is word.targets and paid is word.paid and cells is word.cells + assert upper == 2 * (n // (2048 * recipe.ambient)) + assert (volume, ticks, rounds) == (n**6, n**82, n**2) + assert flags == {"width": 1 << (92 * HEIGHTS[0]), "delay_base": 1 << 19} + return True + saved_plan = transport.Plan + try: + transport.Plan = capture + assert recipe.open() + finally: + transport.Plan = saved_plan + + cuts = tuple(entrance_logs(HEIGHTS)) + assert cuts == (8290, 114354, 1795419) + assert all(cuts[i - 1] + 2 < HEIGHTS[i] for i in (1, 2)) + for stage, cut in enumerate(cuts, 1): + assert [stage_for_width_log(cut + d, len(HEIGHTS), HEIGHTS) for d in (-1, 0, 1)] == [stage - 1, stage, stage] + seams = [dispatch_fixture(TERMINAL, cuts, 2, 128000), + dispatch_fixture(TERMINAL, cuts, 3, 1824000), + dispatch_fixture(TERMINAL, cuts, 2, 960000), + dispatch_fixture(TERMINAL, cuts, 3, 15136000)] + assert [row["direct"] for row in seams] == [True, True, False, False] + for value in ((1 << 256) + 1, (1 << 257) - 1, (1 << 512) + 123): + root = ceil_root(value, 256) + assert (root - 1)**256 < value <= root**256 + + stock = resource_receipt(TERMINAL) + assert stock["binary_cuts"] == list(cuts) and activation(TERMINAL) == stock["public_exponent_A"] + conversion = ((K - ENTRY.kappa) * activation(TERMINAL)).__ceil__() + complete = 1 + max(early["log2_C"] + conversion, terminal["log2_C"]) + assert terminal["log2_B"] == 128 + 9 + 320 * sum(HEIGHTS) + assert complete == 1 + terminal["log2_C"] + assert max(HEIGHTS).bit_length() == 21 and GAUSSIAN_H.bit_length() <= 20 + + print(json.dumps({ + "status": "PASS_ORDINARY_COMPONENT_AND_FINITE_SEAMS", + "source_head": "06691302af526a488f3dee0298035f86b6e69c51", + "runtime_pins": RUNTIME_PINS, + "kappa": str(K), "ordinary_booking": str(ORDINARY), "eta": str(ETA), + "rho": str(Q(1, 250)), "heights": list(HEIGHTS), "stages": stages, + "gaussian_height": GAUSSIAN_H, + "gaussian_margin_over_booking": str(positive_at(GAUSSIAN_H) - ORDINARY), + "gaussian_previous_height_margin": str(positive_at(GAUSSIAN_H - 1) - ORDINARY), + "signed_outer": signed, "cuts": list(cuts), "seams": seams, + "controls_rejected": controls, + "ordinary_debit_used": str(OLD_DEBIT), + "ordinary_conservative_factor_margin_lower": str(old_allow - factor_hi), + "conservative_factor_exceeds_parent_debit_upper_by": str(factor_lo - parent_allow), + "ordinary_floor": 18960, "native_recipe_open_seam": "PASS_CAPTURED_PLAN", + "activation_exponent": activation(TERMINAL), "entry_log2_C": early["log2_C"], + "entry_conversion_bits": conversion, "terminal_log2_B": terminal["log2_B"], + "terminal_log2_C": terminal["log2_C"], "complete_log2_C": complete, + "setup_numeric_guards": {"all_seven_heights_in_25_bit_range": True, + "max_scalar_encoding_bits": scalar_bits, + "scope": "Numeric premises only; the 8088 shortcut-word base action census needs separate rebinding."}, + "scope": "Exact ordinary component and captured direct/compiled dispatch only; no physical product or new portable trace. Parent receipt.bank was invoked with an explicit old-debit override, not via its unchanged hardcoded main check.", + }, indent=2, sort_keys=True)) + + +if __name__ == "__main__": + if len(sys.argv) != 3: + raise SystemExit(__doc__) + main(Path(sys.argv[1]).resolve(), Path(sys.argv[2]).resolve()) diff --git a/research/p104-shortcut-eta-target/check_path_binding.py b/research/p104-shortcut-eta-target/check_path_binding.py new file mode 100644 index 0000000000..7f52c0d4dc --- /dev/null +++ b/research/p104-shortcut-eta-target/check_path_binding.py @@ -0,0 +1,109 @@ +#!/usr/bin/env python3 +"""Bind candidate producer, both native types and actual raw executor to the shortcut graph.""" +from argparse import ArgumentParser +from datetime import datetime, timezone +from hashlib import sha256 +from pathlib import Path +from types import SimpleNamespace +from unittest.mock import patch +import gzip +import inspect +import json +import sys + +ap = ArgumentParser() +ap.add_argument('runtime', type=Path) +ap.add_argument('--output', type=Path, required=True) +args = ap.parse_args() +runtime = args.runtime.resolve() +started = datetime.now(timezone.utc) +sys.path.insert(0, str(runtime)) +import strong_complex +from strong_complex import digest +from installations import ENTRY, TERMINAL +from grades import numerical_source, numerical_recipe +from band_product import Product, production_supplier +from retimed_supplier import Positive +from raw48 import ComplexRaw +from clock_ports import clock_word + +atlas, word, targets, paid, cells = numerical_source() +expected = 'ed3bea7186f962f3a8a8ae389cecce3d1ef48a7a832cf9af6c9048a6b5919b35' +assert digest(atlas.graph) == expected +assert len(atlas.graph['moves']) == 5669 and len(atlas.moves) == 5669 +assert atlas.moves == {k: (a, b) for k, a, b in atlas.graph['moves']} +assert len(word.targets) == 52608 and len(word.paid) == 281328 +assert (len(numerical_recipe(1024).types()[0].paid), len(numerical_recipe(1024).types()[1].paid)) == (282336, 281328) +for profile in (ENTRY, TERMINAL): + supplier = production_supplier(profile.complex_log, profile.positive_stop_denominator) + recipe = numerical_recipe(profile.complex_log) + assert supplier.physical is atlas and supplier.word is word and supplier.recipe is recipe + assert recipe.targets is targets and recipe.paid is paid and recipe.cells is cells + assert ComplexRaw(atlas, {}, None, low=0, bundle=1, slots=306).art is atlas + +returns = [(prefix, entries) for prefix, entries in word.paid.segments if prefix and prefix[0] == 'return'] +assert len(returns) == 48 +ordered = tuple(k for k in atlas.graph['schedule'] if k in atlas.moves) +assert len(ordered) == 5669 +new_nodes = {104489, 104490, 104491, 104492, 104493} +old_nodes = {95050, 95056, 95398, 95425, 96741, 96743, 97628, 99468, 100531, 101275} +for _, entries in returns: + ids = tuple(node for node, rank in entries) + assert ids == ordered and new_nodes.issubset(ids) and not old_nodes.intersection(ids) + +source = inspect.getsource(ComplexRaw.graph) +assert all(fragment in source for fragment in ('g = a.graph', 'for node in g["schedule"]', 'a.forms[node]', 'node in a.moves')) +assert 'production_supplier' in inspect.getsource(Product.h) +assert 'numerical_source()' in inspect.getsource(Positive.__init__) +assert 'self.physical' in inspect.getsource(Positive._run) + +# A valid compressed graph with one changed move must fail the installed +# content digest before it can be substituted into an atlas. +mutant = dict(atlas.graph) +mutant['moves'] = [list(row) for row in atlas.graph['moves']] +mutant['moves'][0][1] += 1 +damaged = gzip.compress(json.dumps(mutant, separators=(',', ':'), sort_keys=True).encode()) +word_path = runtime / 'w5669_shortcut5.json.gz' +original_read = Path.read_bytes + +def patched_read(path): + if path == word_path: + return damaged + return original_read(path) + +strong_complex.load_changed.cache_clear() +with patch.object(Path, 'read_bytes', patched_read): + try: + strong_complex.load_changed(runtime / 'inputs') + raise AssertionError('Damaged shortcut graph was accepted') + except ValueError as exc: + assert 'shortcut Gaussian graph differs' in str(exc) +strong_complex.load_changed.cache_clear() +assert digest(strong_complex.load_changed(runtime / 'inputs')[0]) == expected + +# An explicit in-memory old-word fallback would yield a different paid stream +# and is rejected by the target digest and label checks. +from sparse_helpers import rebuild +from verify_split_helpers import read, reconstruct +parent, _ = rebuild() +old, _ = reconstruct(parent, read('BANK-FACTORS.json.gz')) +fake = SimpleNamespace(**vars(atlas)) +fake.graph = old +fake.moves = {k: (a, b) for k, a, b in old['moves']} +old_word = clock_word(fake) +assert digest(old) != expected and len(old_word.paid) == 281568 and len(old_word.paid) != len(word.paid) + +report = {'started_at': started.isoformat(), 'finished_at': datetime.now(timezone.utc).isoformat(), + 'graph_sha256': expected, 'old_graph_sha256': digest(old), 'native_calls': len(returns), + 'moves_per_native_call': len(ordered), 'productive_labels': len(word.targets), + 'paid_labels': len(word.paid), 'old_paid_labels': len(old_word.paid), + 'typed_paid_labels': [282336, 281328], 'entry_gaussian_height': ENTRY.complex_log, + 'terminal_gaussian_height': TERMINAL.complex_log, + 'altered_shortcut_digest_rejected': True, 'old_word_fallback_distinguished': True, + 'source_sha256': {name: sha256((runtime / name).read_bytes()).hexdigest() for name in + ('strong_complex.py', 'w5669_shortcut5.json.gz', 'grades.py', 'typed_raw.py', 'retimed_supplier.py', 'band_product.py')}, + 'scope': 'Loader, graph, label and executor binding; finite product path is separately instrumented.'} +out = args.output.resolve() +out.parent.mkdir(parents=True, exist_ok=True) +out.write_text(json.dumps(report, indent=2) + '\n') +print('PASS_SHORTCUT_PATH_BINDING', json.dumps(report, sort_keys=True), flush=True) diff --git a/research/p104-shortcut-eta-target/check_phase_census.py b/research/p104-shortcut-eta-target/check_phase_census.py new file mode 100644 index 0000000000..375d5eb2f9 --- /dev/null +++ b/research/p104-shortcut-eta-target/check_phase_census.py @@ -0,0 +1,28 @@ +"""Observe bounded phase-circuit calls in a fresh target compiler construction.""" +from collections import Counter +from hashlib import sha256 +from pathlib import Path +import json,sys +root=Path(sys.argv[1]).resolve(); runtime=root/'runtime' +assert sha256((runtime/'installations.py').read_bytes()).hexdigest()=='5df81fddba26013b142195f5c3119491fa2f07b1e72c3616ae76e7d7ffbb0fd1' +sys.path.insert(0,str(runtime)) +from upstream import install +install() +import phase_atlas +actual=phase_atlas.matrix_element +counts=Counter();max_gates=max_paths=0;max_n=0 + +def measure(circuit,n,source,target): + global max_gates,max_paths,max_n + paths=sum(g[0]=='C' for g in circuit) + counts[(n,len(circuit),paths)]+=1 + max_gates=max(max_gates,len(circuit));max_paths=max(max_paths,paths);max_n=max(max_n,n) + return actual(circuit,n,source,target) +phase_atlas.matrix_element=measure +from band_product import prepare_native +layers=prepare_native() +assert len(layers)==2 and len(layers[0])+len(layers[1])==7 +assert max_n==9 and max_gates<128 and max_paths<128 and sum(counts.values())<2**20 +print(json.dumps({'calls':sum(counts.values()),'max_qubits':max_n,'max_circuit_gates':max_gates,'max_path_variables':max_paths, + 'distinct_shapes':len(counts),'top_shapes':[{'qubits':n,'gates':l,'paths':p,'calls':v} for (n,l,p),v in counts.most_common(10)], + 'scope':'Instrumented finite constructor execution; recorded maxima do not by themselves prove a uniform compiler action bound.'},indent=2,sort_keys=True)) diff --git a/research/p104-shortcut-eta-target/check_prices.py b/research/p104-shortcut-eta-target/check_prices.py new file mode 100644 index 0000000000..89740f3a66 --- /dev/null +++ b/research/p104-shortcut-eta-target/check_prices.py @@ -0,0 +1,65 @@ +"""Recompute the finite supplier prices from the actual installed word.""" + +from collections import Counter +from fractions import Fraction as Q +from pathlib import Path +import json +import sys + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +from invoice import source_module, OB, GB + + +def verify(tree): + peer = tree / "research/frequency-weighted-native-multiplier" + runtime = tree / "runtime" + sys.argv = [__file__, str(runtime)] + rc = source_module("target_receipt", peer / "receipt.py") + independent = source_module( + "target_independent_price", peer / "independent_price.py" + ) + lo, hi = rc.prepare_native() + assert len(lo) == 3 and len(hi) == 4 + for profile, recipes in zip((rc.ENTRY, rc.TERMINAL), (lo, hi), strict=True): + assert tuple(v.rank_log for v in recipes) == ( + *profile.rank_logs, + profile.complex_log, + ) + assert all( + v.level_floor == 18960 and v.trial == rc.BINARY_C for v in recipes[:-1] + ) + assert recipes[-1].trial == rc.GAUSSIAN_C + assert hi[-1].targets is lo[-1].targets and hi[-1].cells is lo[-1].cells + targets, paid = rc.raw_moments(rc.graph(), rc.caller()) + for recipe in (*lo[:-1], *hi[:-1]): + assert (Counter(recipe.targets), Counter(recipe.paid)) == (targets, paid) + om, cells = rc.certify(rc.BINARY_C, (targets, paid)) + assert om > 0 and cells == hi[0].cells and len(cells) == 24 + factor = Q(47, 20) * rc.tape_factor(134, rc.BINARY_C, 18960, suffix=64) + # Full original 256/255 reserve remains inside tape_factor. + alo, ahi = independent.powers(2, OB - 1) + assert factor < 2 * alo and Q(75, 32) / Q(47, 20) == Q(375, 376) + gp = rc.check_numerical(hi[-1]) + assert ( + rc.DEBIT == GB + and gp["real_targets"] == [52608, 52608] + and gp["real_loans"] == [282336, 281328] + ) + assert gp["grade_cells"] == 51 and gp["typed_cells"] == 88 + independent.weighted() + return { + "ordinary_floor": 18960, + "ordinary_raw_margin": str(om), + "ordinary_tariff": "47/20", + "ordinary_reserve": "256/255", + "ordinary_debit": str(OB), + "ordinary_factor_upper": str(factor), + "ordinary_allowance_lower": str(2 * alo), + "gaussian": gp, + } + + +if __name__ == "__main__": + if not __debug__: + raise ValueError("Enable assertions") + print(json.dumps(verify(Path(sys.argv[1]).resolve()), indent=2)) diff --git a/research/p104-shortcut-eta-target/check_product_path.py b/research/p104-shortcut-eta-target/check_product_path.py new file mode 100644 index 0000000000..1846d98f63 --- /dev/null +++ b/research/p104-shortcut-eta-target/check_product_path.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +"""Run the inherited signed-product check against the actual candidate runtime. + +Counts show whether this finite product crosses the typed native-word boundary. +""" +import json +from pathlib import Path +import runpy +import sys + +runtime = Path(sys.argv[1]).resolve() +peer = Path(sys.argv[2]).resolve() +sys.path.insert(0, str(runtime)) +from installations import ENTRY, TERMINAL +from strong_complex import digest +from grades import numerical_source +from typed_raw import TypedRaw +from retimed_supplier import Positive + +atlas = numerical_source()[0] +assert digest(atlas.graph) == 'ed3bea7186f962f3a8a8ae389cecce3d1ef48a7a832cf9af6c9048a6b5919b35' +counts = {'typed_native_calls': 0, 'positive_run_calls': 0, 'direct_positive_calls': 0, 'recursive_positive_calls': 0} +native = TypedRaw.native +run = Positive._run + +def traced_native(self, *args, **kwargs): + counts['typed_native_calls'] += 1 + return (yield from native(self, *args, **kwargs)) + +def traced_run(self, field, low, selected, columns, root_width): + from retimed_supplier import power_le + counts['positive_run_calls'] += 1 + if selected <= self.carrier or power_le(selected, self.denominator, root_width): + counts['direct_positive_calls'] += 1 + else: + counts['recursive_positive_calls'] += 1 + return run(self, field, low, selected, columns, root_width) + +TypedRaw.native = traced_native +Positive._run = traced_run +module = runpy.run_path(str(peer / 'verify.py')) +sys.path.insert(0, str(runtime)) +module['product'](runtime) +print('CANDIDATE_PRODUCT_PATH_COUNTERS', json.dumps(counts, sort_keys=True), flush=True) +print('PASS_CANDIDATE_RESTORED_SIGNED_PRODUCT', flush=True) diff --git a/research/p104-shortcut-eta-target/check_rational.py b/research/p104-shortcut-eta-target/check_rational.py new file mode 100644 index 0000000000..4b7fac9a3d --- /dev/null +++ b/research/p104-shortcut-eta-target/check_rational.py @@ -0,0 +1,145 @@ +#!/usr/bin/env python3 +"""Compare the old and five-shortcut 1291-output maps exactly over Q. + +Each rational DAG row is converted to an integer linear circuit with a known +positive denominator and an absolute coefficient bound. For 64 inputs at a +time, signed integer digits in a base larger than the worst possible +cross-multiplied coefficient encode all basis vectors simultaneously. A zero +packed integer implies every signed coefficient is zero by reduction modulo +the base, so this is an exact identity, not a random or modular test. +""" +from argparse import ArgumentParser +from datetime import datetime, timezone +from fractions import Fraction +from hashlib import sha256 +import json +from math import gcd, lcm +from pathlib import Path +import sys +import time + +ap = ArgumentParser() +ap.add_argument('runtime', type=Path) +ap.add_argument('--preflight', action='store_true') +ap.add_argument('--output', type=Path, default=Path(__file__).resolve().parent / 'rational-identity-receipt.json') +args = ap.parse_args() +runtime = args.runtime.resolve() +sys.path.insert(0, str(runtime)) +from upstream import install +install() +from strong_complex import digest, load_changed, WORD, SHORTCUT_WORD +from sparse_helpers import rebuild + +started = datetime.now(timezone.utc) +clock = time.monotonic() +new, layout = load_changed(runtime / 'inputs') +from verify_split_helpers import read, reconstruct +parent, _ = rebuild() +old, _ = reconstruct(parent, read('BANK-FACTORS.json.gz')) +assert digest(old) == WORD == '38d2b3a2311a9ba5fee091cc7aa204c7ed95651aec95d75184b2391df090cbfb' +assert digest(new) == SHORTCUT_WORD == 'ed3bea7186f962f3a8a8ae389cecce3d1ef48a7a832cf9af6c9048a6b5919b35' +assert all(old[k] == new[k] for k in ('initial', 'final', 'frames', 'first_output')) +n = len(new['initial']) +assert n == len(new['final']) == 1291 +first = new['first_output'] +inputs = [~i for i in range(n)] +outputs = [first + i for i in range(n)] + +def build(graph): + order = graph['schedule'] + rows = {k: row for k, row in graph['forms']} + moves = {k: (a, b) for k, a, b in graph['moves']} + assert len(rows) == len(order) and len(set(order)) == len(order) + assert set(order) == set(rows) == set(moves) | set(outputs) + chart = dict(zip(inputs, graph['initial'], strict=True)) + denom = dict.fromkeys(inputs, 1) + mass = dict.fromkeys(inputs, 1) + code = [] + terms = 0 + for k in order: + a, b = moves[k] if k in moves else (graph['final'][k - first],) * 2 + assert all(chart[s] == a for s, _ in rows[k]), ('donor chart', k) + scaled = [(s, Fraction(c) / denom[s]) for s, c in rows[k]] + d = lcm(*(v.denominator for _, v in scaled)) + weights = [(s, v.numerator * (d // v.denominator)) for s, v in scaled] + divisor = gcd(d, *(abs(v) for _, v in weights)) + d //= divisor + weights = [(s, v // divisor) for s, v in weights] + denom[k] = d + mass[k] = sum(abs(v) * mass[s] for s, v in weights) + chart[k] = b + code.append((k, weights)) + terms += len(weights) + return {'code': code, 'denom': denom, 'mass': mass, 'rows': rows, 'moves': moves, 'terms': terms} + +before = build(old) +after = build(new) +assert len(before['moves']) == 5674 and len(after['moves']) == 5669 +limit = max(after['denom'][o] * before['mass'][o] + before['denom'][o] * after['mass'][o] for o in outputs) +bits = max(1, limit.bit_length() + 1) +common = set(before['rows']) & set(after['rows']) +def normalized(row): + return tuple((s, Fraction(c)) for s, c in row) + +modified_rows = sorted(k for k in common if normalized(before['rows'][k]) != normalized(after['rows'][k])) +old_only = sorted(set(before['moves']) - set(after['moves'])) +new_only = sorted(set(after['moves']) - set(before['moves'])) +changed_moves = sorted(k for k in set(before['moves']) & set(after['moves']) if before['moves'][k] != after['moves'][k]) +report = {'started_at': started.isoformat(), 'old_graph_sha256': digest(old), 'new_graph_sha256': digest(new), + 'roles': n, 'old_moves': len(before['moves']), 'new_moves': len(after['moves']), + 'old_form_terms': before['terms'], 'new_form_terms': after['terms'], + 'changed_common_rows': len(modified_rows), 'removed_move_labels': old_only, + 'new_move_labels': new_only, 'changed_move_labels': changed_moves, + 'digit_bits': bits, 'coefficient_bound_bits': limit.bit_length(), + 'runtime': str(runtime), 'word_file_sha256': sha256((runtime / 'w5669_shortcut5.json.gz').read_bytes()).hexdigest()} +if args.preflight: + report['preflight_only'] = True + print(json.dumps(report, sort_keys=True), flush=True) + raise SystemExit(0) + +def evaluate(prog, start, stop): + values = dict.fromkeys(inputs, 0) + for i in range(start, stop): + values[~i] = 1 << (bits * (i - start)) + for k, weights in prog['code']: + values[k] = sum(values[s] * v for s, v in weights) + return values + +blocks = 0 +for start in range(0, n, 64): + stop = min(n, start + 64) + a, b = evaluate(before, start, stop), evaluate(after, start, stop) + for o in outputs: + if a[o] * after['denom'][o] != b[o] * before['denom'][o]: + raise ArithmeticError(f'exact rational output {o}, block {start}') + blocks += 1 + +# Increase one real output coefficient by one, choosing a donor that is +# nonzero on an actual basis block. No source file is altered. +found = None +for start in range(0, n, 64): + stop = min(n, start + 64) + b = evaluate(after, start, stop) + for output in outputs: + source = next((s for s, _ in after['rows'][output] if b[s]), None) + if source is not None: + found = output, source, start, stop, b + break + if found: + break +assert found is not None +output, source, start, stop, b = found +a = evaluate(before, start, stop) +changed_num = b[output] * after['denom'][source] + b[source] * after['denom'][output] +assert changed_num * before['denom'][output] != a[output] * after['denom'][output] * after['denom'][source] +report.update({'preflight_only': False, 'input_blocks': blocks, 'matrix_entries': n * n, + 'all_exact_outputs_match': True, 'modified_output_negative_control_rejected': True, + 'negative_control_output': output, 'negative_control_donor': source, + 'negative_control_input_block': [start, stop], + 'finished_at': datetime.now(timezone.utc).isoformat(), + 'elapsed_seconds': round(time.monotonic() - clock, 6), + 'scope': 'Full rational forward map equality; all-column phase, compilation, ownership, physical cost and signed outer recovery remain separate obligations.'}) +out = args.output.resolve() +out.parent.mkdir(parents=True, exist_ok=True) +out.write_text(json.dumps(report, indent=2) + '\n') +print('PASS_RATIONAL_1291_OUTPUT_IDENTITY', json.dumps(report, sort_keys=True), flush=True) diff --git a/research/p104-shortcut-eta-target/check_receiver.py b/research/p104-shortcut-eta-target/check_receiver.py new file mode 100644 index 0000000000..75d417fe0f --- /dev/null +++ b/research/p104-shortcut-eta-target/check_receiver.py @@ -0,0 +1,292 @@ +#!/usr/bin/env python3 +"""Emit and receive the #8088 target fixed directory in separate processes. + +Usage: python3.12 -I -B receiver_check.py run CANDIDATE_ROOT +Individual modes: emit CANDIDATE_ROOT OUTPUT_DAG; receive CANDIDATE_ROOT DAG +EXPECTED_SHA256; controls CANDIDATE_ROOT DAG EXPECTED_SHA256. + +The candidate root contains runtime/ and research/frequency-weighted-native- +multiplier/. The paired run authenticates the receiver against the digest of +the directory emitted in its own first child. No WASI fuel or universal setup +time bound follows from these finite checks. +""" + +from fractions import Fraction as Q +from hashlib import sha256 +import importlib.util +import json +from pathlib import Path +import shutil +import struct +import subprocess +import sys +from tempfile import TemporaryDirectory + + +RUNTIME_PINS = { + "installations.py": "5df81fddba26013b142195f5c3119491fa2f07b1e72c3616ae76e7d7ffbb0fd1", + "raw_binary_stage.py": "e24bd735598d278dbd46cada584a63da01796d77ad557a45b80a4dfc7bbbd0b0", + "strong_binary.py": "64673cce85c94f90c498ca01bfda138bb98e08b56ad3777c6565be86bde09020", + "strong_complex.py": "8f3fb92523df006e2e94505127088aaf2e64fadd20b3cab2344f62d7690e875d", + "grades.py": "6124744b40f806c80b6f10010a72e755bc11d64a8cc9a04f5e8316799eb6f05d", + "transport.py": "9eb8f0d77a4c53fc4fddffdfe198cab930b6d1f49e2b6d43c970397051bb7818", + "retimed_supplier.py": "2a87c2781ca93fa854aee098dcb7c50a65f2a46267ba926e3997b442e5a25f2c", + "binary_receiver.py": "a7cc759e9a88e60dbcd59ca314ae5b9d39a33b5c642b56e680bbab775b0f06c5", + "band_product.py": "0a2a243378ced624fa94100d7743bab5209edacda1e3b5a5c2fda6fd0a66791b", + "upstream.py": "d9b079965d8abc04be3eda662fc84ba9a08c4f03e8ccc7bd3e775876164e6c10", + "strong-bit.json.gz": "9e7392c52bcf29c0cc58c54c619f95c28f476394c33e8e0a5aa30c9557d31362", + "w5669_shortcut5.json.gz": "6ef741c346ea075c4f2ed11f9d42d7076103e72d4a9e5059d495f1cb990fd149", +} +PORTABLE_PINS = { + "consumer.py": "411cc1052a70f7084de81f6f1e54636737d5e5155d0756b8271d5d82c268d3b3", + "compiler_state.py": "11f371903410a53aa138bb9b9c49e9441393a34092fff922716a78b5521e1870", + "tape_directory.py": "70bf289334f724cabf1cfa9e074199e6be93ef0aeba8193f279e5ef1336de97b", + "fixed_directory.py": "c99e9945295b954b453f4995474db4ec8da9e7d8d6ba1a564456213d066e5904", + "record_census.py": "8132c345cfcc5e7d89494fa437685673273f878f2dc40e0187bf2b84eee17e08", +} +EXPECTED_HEIGHTS = ((3000, 3080, 1024), (8192, 106000, 1681001, 85406)) + + +def digest(path): + h = sha256() + with path.open("rb") as source: + for block in iter(lambda: source.read(1024 * 1024), b""): + h.update(block) + return h.hexdigest() + + +def verify_pins(root, pins): + for name, expected in pins.items(): + if digest(root / name) != expected: + raise ValueError(f"Source differs at {name}") + + +def paths(root): + runtime = root / "runtime" + portable = root / "research/frequency-weighted-native-multiplier/portable" + verify_pins(runtime, RUNTIME_PINS) + verify_pins(portable, PORTABLE_PINS) + return runtime, portable + + +def load_module(name, path): + spec = importlib.util.spec_from_file_location(name, path) + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + return module + + +def emit(root, output): + runtime, portable = paths(root) + sys.path[:0] = [str(runtime), str(portable)] + from upstream import install + install() + from compiler_state import construct + from installations import ENTRY, TERMINAL, PROFILES + from tape_directory import dump + from grades import WeightedRecipe + from transport import Recipe + assert tuple(PROFILES.values()) == (ENTRY, TERMINAL) + assert TERMINAL.kappa == Q(39, 10000) and TERMINAL.eta == Q(1, 256) + + def forbidden(*args, **kwargs): + raise AssertionError("Fixed directory construction opened a native calendar or width") + + saved = Recipe.open, Recipe.width, WeightedRecipe.open, WeightedRecipe.width + Recipe.open, Recipe.width = forbidden, property(forbidden) + WeightedRecipe.open, WeightedRecipe.width = forbidden, property(forbidden) + try: + state = construct() + heights = tuple(tuple(recipe.rank_log for recipe in layer) for layer in state[0]) + assert heights == EXPECTED_HEIGHTS + assert all(r.level_floor == 18960 for layer in state[0] for r in layer[:-1]) + with output.open("xb") as target: + count = dump(target, state) + finally: + Recipe.open, Recipe.width, WeightedRecipe.open, WeightedRecipe.width = saved + assert count < 2**32 and output.stat().st_size < 2**38 + verify_pins(runtime, RUNTIME_PINS) + verify_pins(portable, PORTABLE_PINS) + return {"status": "PASS_TARGET_DIRECTORY_EMITTED", "directory_sha256": digest(output), + "directory_bytes": output.stat().st_size, "directory_records": count, + "profile_heights": heights, "lazy_native_open_and_width_forbidden": True} + + +def check_digest(path, expected): + if len(expected) != 64 or any(ch not in "0123456789abcdef" for ch in expected): + raise ValueError("Expected digest must be a lowercase SHA-256") + actual = digest(path) + if actual != expected: + raise ValueError("Fixed-directory digest mismatch") + return actual + + +def receive(root, directory, expected): + runtime, portable = paths(root) + check_digest(directory, expected) + with TemporaryDirectory(prefix="fixed-receiver-") as tmp: + machine = Path(tmp) / "machine" + shutil.copytree(runtime, machine, ignore=shutil.ignore_patterns("__pycache__", "*.pyc")) + consumer = load_module("pinned_consumer", portable / "consumer.py") + # Reuse the exact seven-getter AST adapter; verify its source above. + assert sum(len(v) for v in consumer.BINDINGS.values()) == 7 + consumer.install_bindings(machine) + target = machine / "installed-native.dag" + shutil.copyfile(directory, target) + check_digest(target, expected) + # Authenticate the same open file before and after parsing, then bind + # the stock consumer's compiler_state/tape_directory functions. + (machine / "fixed_directory.py").write_text( + "from functools import cache\nfrom hashlib import sha256\nfrom pathlib import Path\n" + "from compiler_state import bind\nfrom tape_directory import load\n" + f"EXPECTED = {expected!r}\n" + "@cache\ndef data():\n" + " with Path(__file__).with_name('installed-native.dag').open('rb') as f:\n" + " h = sha256()\n" + " for b in iter(lambda: f.read(1048576), b''): h.update(b)\n" + " if h.hexdigest() != EXPECTED: raise ValueError('fixed-directory digest mismatch')\n" + " f.seek(0)\n state = bind(load(f))\n" + " f.seek(0)\n h = sha256()\n" + " for b in iter(lambda: f.read(1048576), b''): h.update(b)\n" + " if h.hexdigest() != EXPECTED: raise ValueError('fixed-directory changed during load')\n" + " return state\n" + ) + linked_sha = {name: digest(machine / name) for name in + ("strong_binary.py", "grades.py", "raw_binary_stage.py", "fixed_directory.py")} + sys.path.insert(0, str(machine)) + from upstream import install + install() + from binary_receiver import Receiver + from band_product import prepare_native, production_supplier + from fixed_directory import data + from grades import numerical_recipe, numerical_source + from installations import ENTRY, TERMINAL, PROFILES + from raw_binary_stage import binary_recipe, binary_word + from retimed_supplier import Positive + from strong_binary import caller, fixed_binary_charts, graph + + compiled = data() + assert tuple(PROFILES.values()) == (ENTRY, TERMINAL) + assert (graph() is compiled[2] and caller() is compiled[3] + and fixed_binary_charts() is compiled[4]) + assert binary_word() is compiled[1] and numerical_source() is compiled[5] + assert Receiver.__init__.__globals__["binary_recipe"] is binary_recipe + assert Positive.__init__.__globals__["numerical_source"] is numerical_source + assert Positive.__init__.__globals__["numerical_recipe"] is numerical_recipe + assert tuple(tuple(r.rank_log for r in layer) for layer in compiled[0]) == EXPECTED_HEIGHTS + owner_rows, positive_rows = [], [] + for profile, layer in zip(PROFILES.values(), compiled[0], strict=True): + assert tuple(prepare_native(profile)) == layer + for height, recipe in zip(profile.rank_logs, layer[:-1], strict=True): + assert binary_recipe(height) is recipe and recipe.level_floor == 18960 + # Direct mode avoids expanding an astronomical quotient table; + # the actual Receiver constructor still materializes its owner. + receiver = Receiver(1 << height, (0, 2, 1, 1), direct=True, profile=profile) + assert receiver.recipe is recipe and receiver.owners.bit_count() == 1 + assert receiver.owners.bit_length() == 92 * height + 1 + assert receiver.stock == receiver.owners and receiver.low == receiver.high == 1 + owner_rows.append({"height": height, "owner_bits": receiver.owners.bit_length(), + "direct_receiver": True}) + del receiver + positive = production_supplier(profile.complex_log, profile.positive_stop_denominator) + assert isinstance(positive, Positive) and positive.physical is compiled[5][0] + assert positive.recipe is layer[-1] and numerical_recipe(profile.complex_log) is layer[-1] + assert positive.carrier.bit_length() == profile.complex_log + 1 + assert positive.carrier.bit_count() == 1 + assert [v.multiplicity for v in positive.recipe.types()] == [5, 451] + cells = positive.recipe.typed_cells() + assert len(cells) == 88 + owners = positive.owners + assert owners.bit_count() == 1 and owners.bit_length() == 92 * profile.complex_log + 1 + positive_rows.append({"height": profile.complex_log, "carrier_bits": positive.carrier.bit_length(), + "owner_bits": owners.bit_length(), "multiplicities": [5, 451], + "typed_cells": len(cells)}) + del positive, owners + assert check_digest(target, expected) == expected + return {"status": "PASS_FIXED_DIRECTORY_RECEIVED", "directory_sha256": expected, + "directory_bytes": target.stat().st_size, "getter_count": 7, + "ordinary_receivers": owner_rows, "positive_suppliers": positive_rows, + "linked_source_sha256": linked_sha, + "scope": "Fresh process; seven getters bound and actual direct owners instantiated. No astronomical compiled execution, WASI trace or universal setup bound."} + + +def controls(root, directory, expected): + runtime, portable = paths(root) + check_digest(directory, expected) + rejected = [] + with TemporaryDirectory(prefix="fixed-receiver-corrupt-") as tmp: + temp = Path(tmp) + variants = {} + bad = temp / "corrupt.dag" + shutil.copyfile(directory, bad) + with bad.open("r+b") as f: + f.seek(16); old = f.read(1); f.seek(16); f.write(bytes([old[0] ^ 1])) + variants["corrupt_byte"] = (bad, expected) + truncated = temp / "truncated.dag" + shutil.copyfile(directory, truncated) + with truncated.open("r+b") as f: + f.truncate(truncated.stat().st_size - 1) + variants["truncated_directory"] = (truncated, expected) + variants["wrong_digest"] = (directory, "0" * 64) + for name, (path, pin) in variants.items(): + try: + check_digest(path, pin) + except ValueError: + rejected.append(name) + else: + raise AssertionError(f"Control accepted: {name}") + # Repinning a malformed input does not make the binary parser accept it. + sys.path[:0] = [str(runtime), str(portable)] + from upstream import install + install() + from tape_directory import load + malformed = {"repinned_bad_magic": b"BAD-DAG!", + "repinned_truncated_record": b"IMBDAG1\x00" + struct.pack("0 and all(type(x) is int and abs(x).bit_length()<=128 for x in vals.values()) +assert all(bounded(p) for p in installations.PROFILES.values()) +scalar_bits={name:{k:abs(v).bit_length() for k,v in scalar_values(p).items()} for name,p in installations.PROFILES.items()} +negative={ + 'kappa_numerator':replace(terminal,kappa=Q(1<<128,1)), + 'kappa_denominator':replace(terminal,kappa=Q(1,1<<128)), + 'eta_numerator':replace(terminal,eta=Q(1<<128,1)), + 'eta_denominator':replace(terminal,eta=Q(1,1<<128)), + 'stop_oversized':replace(terminal,positive_stop_denominator=1<<128), + 'stop_zero':replace(terminal,positive_stop_denominator=0), +} +assert all(not bounded(p) for p in negative.values()) +stock=resource_receipt(terminal);entry_stock=resource_receipt(entry) +assert tuple(stock['binary_cuts'])==(8290,114354,1795419) +assert stock['retimed_first_stripe_margin']>1024 and stock['retimed_all_size_margin_floor']>1024 + +def rejected(fn): + try: fn() + except (ArithmeticError,AssertionError,ValueError,ZeroDivisionError): return True + return False + +bad_stock=replace(terminal,rank_logs=(8192,stock['binary_cuts'][0]+2,terminal.rank_logs[-1])) +assert rejected(lambda:resource_receipt(bad_stock)) +assert not all(1024<=h<2**25 for h in (*terminal.rank_logs,2**25)) +positive=installations.GAUSSIAN_C-Q(1039776,2**23*terminal.complex_log) +g=Q(1,terminal.positive_stop_denominator) +signed=qualify(terminal.kappa,g,terminal.ordinary,positive) +assert rejected(lambda:qualify(terminal.kappa,Q(0),terminal.ordinary,positive)) +assert rejected(lambda:qualify(terminal.kappa,Q(1,10**6),terminal.ordinary,positive)) +conversion=((terminal.kappa-entry.kappa)*stock['public_exponent_A']).__ceil__() +assert conversion-1<(terminal.kappa-entry.kappa)*stock['public_exponent_A']<=conversion + +carrier_steps=2*2048*(2**25+1); scalar_steps=7*2**24 +# Charge a full extra source numerical compiler, plus explicit shortcut +# decoding/authentication, without assuming unused predecessor slack. +new_word_compiler_allowance=2**64; shortcut_allowance=2**55 +extra=carrier_steps+scalar_steps+new_word_compiler_allowance+shortcut_allowance +assert extra<2**65 +w,n=2**38,2**68+2**65;h=2*w+2 +S=4*w*n;L=8*S*512*128 +E=2**16*(h+4)*(7*h+9)+8*2**16*(h+4)**2 +serial=(n+1)*(L+E+2**120)*2**32 +assert serial==274865081678638624429267135103304688028750991263086118674744387567616 and serial<2**228 +def require_widths(layers): + assert all(r.width_log==92*r.rank_log for layer in layers for r in layer) + +saved=Recipe.open,Recipe.width,WeightedRecipe.open,WeightedRecipe.width + +def forbidden(*args,**kwargs): raise AssertionError('fixed constructor touched a lazy opening or width') +Recipe.open=forbidden;Recipe.width=property(forbidden);WeightedRecipe.open=forbidden;WeightedRecipe.width=property(forbidden) +try: + state=construct();layers=state[0] + assert [[r.rank_log for r in layer] for layer in layers]==[list(heights[:3]),list(heights[3:])] + assert tuple(prepare_native(terminal))==layers[1] + require_widths(layers) + target=layers[1][-1]; prior_width=target.width_log + try: + target.width_log=prior_width+1 + assert rejected(lambda:require_widths(layers)) + finally: target.width_log=prior_width + require_widths(layers) + assert all(r.level_floor==18960 for layer in layers for r in layer[:-1]) + assert all(r.targets is state[1].targets and r.paid is state[1].paid and r.cells is state[1].cells for layer in layers for r in layer[:-1]) + assert layers[0][-1].targets is layers[1][-1].targets and layers[0][-1].cells is layers[1][-1].cells + suppliers=[production_supplier(p.complex_log,p.positive_stop_denominator) for p in (entry,terminal)] + assert all(s.recipe is layer[-1] for s,layer in zip(suppliers,layers,strict=True)) + assert all(s.carrier.bit_length()==p.complex_log+1 and s.carrier.bit_count()==1 for s,p in zip(suppliers,(entry,terminal),strict=True)) + with TemporaryDirectory(prefix='target-8088-setup-') as tmp: + out=Path(tmp)/'directory.dag' + with out.open('wb') as f: count=dump(f,state) + census=inspect(out);directory_sha=sha256(out.read_bytes()).hexdigest() + assert count==census['records'] and count<2**32 and census['bytes']<2**38 and census['largest_integer_bits']<2**38 +finally: + Recipe.open,Recipe.width,WeightedRecipe.open,WeightedRecipe.width=saved + +print(json.dumps({'scope':'actual fixed constructor, encoded profiles, stock and separately priced serial envelope; no portable trace or all-size admission', + 'runtime_sha256':expected,'heights':heights,'profile_scalar_bits':scalar_bits,'scalar_guard_bits':128, + 'scalar_corruptions_rejected':sorted(negative),'zero_and_weak_stop_rejected':True,'changed_recipe_width_rejected':True,'prefix_stock_corruption_rejected':True,'25_bit_boundary_rejected':True, + 'positive_margin':str(positive-terminal.kappa-5*g),'signed':signed,'entry_stock':entry_stock,'terminal_stock':stock,'entry_conversion_bits':conversion, + 'carrier_bits':[s.carrier.bit_length() for s in suppliers], 'directory_records':count,'directory_bytes':census['bytes'], + 'largest_directory_integer_bits':census['largest_integer_bits'],'directory_sha256':directory_sha, + 'carrier_scalar_actions':carrier_steps+scalar_steps,'new_word_preprocessing_actions_reserved':shortcut_allowance, + 'new_word_compiler_actions_reserved':new_word_compiler_allowance, + 'combined_extra_actions':extra,'extra_action_ceiling':2**65,'serial_transition_upper':serial,'power_of_two_upper':228, + 'inherited_bound_status':'Requires the inherited 2^68 action and 2^38 datum bounds, and a source-specific proof that the complete numerical compiler for the new word fits the separately reserved 2^64 actions; finite census alone does not establish them.'},indent=2,sort_keys=True)) +print('PASS_8088_TARGET_FIXED_CONSTRUCTOR',flush=True) diff --git a/research/p104-shortcut-eta-target/freeze_inputs.py b/research/p104-shortcut-eta-target/freeze_inputs.py new file mode 100644 index 0000000000..280fe746d4 --- /dev/null +++ b/research/p104-shortcut-eta-target/freeze_inputs.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python3 +"""Freeze source-bound grade histograms and transport cells for the independent bill.""" +from argparse import ArgumentParser +from collections import Counter +from fractions import Fraction +from hashlib import sha256 +import json +from pathlib import Path +import sys + +ap = ArgumentParser() +ap.add_argument('--runtime', required=True, type=Path) +ap.add_argument('--expected-result', required=True, type=Path) +ap.add_argument('--output', required=True, type=Path) +args = ap.parse_args() +runtime = args.runtime.resolve() +sys.path.insert(0, str(runtime)) +from upstream import install +install() +from installations import BINARY_C, GAUSSIAN_C, ENTRY, TERMINAL +from grades import numerical_source, numerical_recipe +from raw_binary_stage import binary_word +from strong_complex import digest + +atlas, word, g_targets, g_paid, g_cells = numerical_source() +ordinary = binary_word() +assert digest(atlas.graph) == 'ed3bea7186f962f3a8a8ae389cecce3d1ef48a7a832cf9af6c9048a6b5919b35' +assert (len(word.targets), len(word.paid), len(g_cells)) == (52608, 281328, 51) +assert (len(ordinary.targets), len(ordinary.paid), len(ordinary.cells)) == (18906, 104652, 24) +assert (ENTRY.rank_logs, ENTRY.complex_log, TERMINAL.rank_logs, TERMINAL.complex_log) == ( + (3000, 3080), 1024, (8192, 106000, 1681001), 85406) + +def histogram(hist): + return [[str(Fraction(rank)), int(count)] for rank, count in sorted(hist.items())] + +def cells(entries): + return [[str(Fraction(r)), str(Fraction(k)), str(Fraction(q))] + for (r, k), q in sorted(entries.items())] + +def profile(p): + return {'ordinary_heights': list(p.rank_logs), 'gaussian_height': p.complex_log, + 'kappa': str(p.kappa), 'eta': str(p.eta), 'stop_denominator': p.positive_stop_denominator} + +files = ('installations.py', 'strong_complex.py', 'w5669_shortcut5.json.gz', 'grades.py', + 'raw_binary_stage.py', 'strong-bit.json.gz', 'typed_transport.py') +data = {'source': {'pr': 8088, 'head': '06691302af526a488f3dee0298035f86b6e69c51', + 'shortcut_graph_sha256': digest(atlas.graph), + 'runtime_sha256': {name: sha256((runtime / name).read_bytes()).hexdigest() for name in files}, + 'expected_result_sha256': sha256(args.expected_result.read_bytes()).hexdigest()}, + 'ordinary': {'trial': str(BINARY_C), 'targets': histogram(Counter(ordinary.targets)), + 'paid': histogram(Counter(ordinary.paid)), 'cells': cells(ordinary.cells), + 'level_floor': 18960, 'debit': '11239/8192', 'suffix_coefficient': '64', + 'tariff': '47/20', 'reserve': '256/255'}, + 'gaussian': {'trial': str(GAUSSIAN_C), 'targets': histogram(g_targets.histogram), + 'paid': histogram(g_paid.histogram), 'cells': cells(g_cells), + 'level_floor': 1874, 'upper_divisor': 1724, 'ambient': 306, + 'largest_target': 258, 'debit': '32493/262144', + 'typed_counts': [len(t.paid) for t in numerical_recipe(1024).types()]}, + 'entry': profile(ENTRY), 'terminal': profile(TERMINAL)} +out = args.output.resolve() +out.parent.mkdir(parents=True, exist_ok=True) +out.write_text(json.dumps(data, indent=2, sort_keys=True) + '\n') +print('PASS_FROZEN_LITERAL_INVOICE_INPUTS', out, sha256(out.read_bytes()).hexdigest(), flush=True) diff --git a/research/p104-shortcut-eta-target/install.py b/research/p104-shortcut-eta-target/install.py new file mode 100644 index 0000000000..db133c7e5e --- /dev/null +++ b/research/p104-shortcut-eta-target/install.py @@ -0,0 +1,81 @@ +"""Restore floration's pinned word, then install the eta-lift ordinary recipe.""" + +import hashlib +import json +from pathlib import Path +import runpy +import subprocess +import sys + +HERE = Path(__file__).resolve().parent +PARENT = HERE / "parent8088" +SOURCE = "06691302af526a488f3dee0298035f86b6e69c51" +PIN_SHA = "93c5ea20bbc6497a461ac6d2a8f69770b927c2d67eb991c57da2e9f8a3e8f5e6" +ORDINARY = (8192, 106000, 1681001) +GAUSSIAN = 85406 + + +def digest(data): + return hashlib.sha256(data).hexdigest() + + +def replace_pinned(path, before, text, replacement): + data = path.read_bytes() + if digest(data) != before or data.count(text) != 1: + raise ValueError( + "Candidate patch does not match its authenticated source: " + path.name + ) + path.write_bytes(data.replace(text, replacement)) + + +def build(tree): + if not __debug__: + raise RuntimeError("Use Python with assertions enabled") + source = (HERE / "SOURCE8088.json").read_bytes() + if digest(source) != PIN_SHA: + raise ValueError("Unexpected #8088 source record") + pins = json.loads(source) + assert pins["commit"] == SOURCE + for name, expected in pins["files"].items(): + data = (PARENT / name).read_bytes() + git_blob = hashlib.sha1( + b"blob " + str(len(data)).encode() + b"\0" + data + ).hexdigest() + if digest(data) != expected["sha256"] or git_blob != expected["git_blob"]: + raise ValueError("Unexpected #8088 input: " + name) + tree = Path(tree).resolve() + tree.mkdir(parents=True, exist_ok=True) + if any(tree.iterdir()): + raise ValueError("Use a new empty installation directory") + peer = runpy.run_path(str(PARENT / "verify.py"))["restore"](tree) + runpy.run_path(str(PARENT / "prepare.py"))["materialize"](peer) + for name in ("check_stage_seam.py", "check_cutoff.py", "check_ordinary_floor.py"): + (peer / name).write_bytes((PARENT / name).read_bytes()) + runtime = tree / "runtime" + subprocess.run([sys.executable, "-IB", peer / "bootstrap.py", runtime], check=True) + replace_pinned( + runtime / "installations.py", + "cb93c268fca5a8051381018845907df2dca64083c58cfa27f1a1528a4e7d5c26", + b'TERMINAL = Profile((62186, 986008, 1048575), 66037, Q(".003899574328473"))', + b"TERMINAL = Profile((8192, 106000, 1681001), 85406, Q(39, 10000), eta=Q(1, 256))", + ) + replace_pinned( + runtime / "raw_binary_stage.py", + "8020d33828233e7016700849a507a8cee78db8a17a33b6063b737313ea05b07f", + b"level_floor=4474", + b"level_floor=18960", + ) + return peer, runtime + + +if __name__ == "__main__": + from argparse import ArgumentParser + + parser = ArgumentParser(description=__doc__) + parser.add_argument("destination", type=Path) + params = parser.parse_args() + peer, runtime = build(params.destination) + print( + "PASS_PINNED_TARGET_INSTALLATION", + digest((runtime / "installations.py").read_bytes()), + ) diff --git a/research/p104-shortcut-eta-target/invoice.py b/research/p104-shortcut-eta-target/invoice.py new file mode 100644 index 0000000000..a06c17765f --- /dev/null +++ b/research/p104-shortcut-eta-target/invoice.py @@ -0,0 +1,148 @@ +"""Price both installed tiers and independently derive the two binding integer heights.""" + +from fractions import Fraction as Q +import importlib.util +import json +from pathlib import Path +import sys + +TARGET, ETA = Q(39, 10000), Q(1, 256) +OB, GB = Q(11239, 8192), Q(1039776, 2**23) +STOP = Q(1, 10**18) +GRID = 10**21 + + +def source_module(name, path): + spec = importlib.util.spec_from_file_location(name, path) + m = importlib.util.module_from_spec(spec) + spec.loader.exec_module(m) + return m + + +def rates(profile, cb): + previous = Q(0) + result = [] + for i, h in enumerate(profile.rank_logs): + upper = min(profile.eta, (249 * (cb - OB / h) + previous) / 250) + booked = ( + profile.ordinary + if i + 1 == len(profile.rank_logs) + else Q(int(upper * GRID) - 1, GRID) + ) + if not previous < booked < upper: + raise ValueError("Unfunded ordinary stage") + result.append( + { + "height": h, + "booked": str(booked), + "upper": str(upper), + "slack": str(upper - booked), + } + ) + previous = booked + return result + + +def calculate(tree): + runtime = tree / "runtime" + peer = tree / "research/frequency-weighted-native-multiplier" + sys.argv = [__file__, str(runtime)] + rc = source_module("weighted_target_receipt", peer / "receipt.py") + from installations import ( + BINARY_C, + GAUSSIAN_C, + ENTRY, + TERMINAL, + at_public, + activation, + ) + from outer_budget import margins + + assert ( + ENTRY.rank_logs == (3000, 3080) + and ENTRY.complex_log == 1024 + and ENTRY.kappa == Q(".00345") + ) + assert (TERMINAL.rank_logs, TERMINAL.complex_log, TERMINAL.kappa, TERMINAL.eta) == ( + (8192, 106000, 1681001), + 85406, + TARGET, + ETA, + ) + assert TERMINAL.ordinary == TARGET + 5 * STOP and GAUSSIAN_C == Q( + 17158764376, 2**42 + ) + assert BINARY_C == Q(4391986206293, 2**50) and rc.DEBIT == GB + # The price routine takes its tariff from module globals. Use #8072's + # full-reserve debit for both tiers and keep #8088's larger clock additions. + rc.ORDINARY_DEBIT = OB + early, late = rc.bank(ENTRY), rc.bank(TERMINAL) + for o, profile in ((early, ENTRY), (late, TERMINAL)): + rs = rates(profile, BINARY_C) + assert [x["booked"] for x in rs] == o["ordinary_rates"] + assert Q(o["gaussian_rate"]) == GAUSSIAN_C - GB / profile.complex_log + strict, functional, positive = margins( + profile.kappa, STOP, profile.ordinary, Q(o["gaussian_rate"]) + ) + assert ( + len(strict) == 54 + and len(functional) == 4 + and min(strict + functional + [positive]) > 0 + ) + o["ordinary_stage_bounds"] = rs + G = TERMINAL.complex_log + H = TERMINAL.rank_logs + q = TERMINAL.ordinary + want = GB / (GAUSSIAN_C - q) + assert want.numerator // want.denominator + 1 == G + assert margins(TARGET, STOP, q, GAUSSIAN_C - GB / (G - 1))[-1] < 0 + _, _, bad_legacy = margins( + TARGET, STOP, q, Q(17145637307, 2**42) - Q(64939, 524288) / G + ) + assert bad_legacy < 0 + previous = Q(late["ordinary_rates"][-2]) + assert (249 * (BINARY_C - OB / (H[-1] - 1)) + previous) / 250 < q + A = activation(TERMINAL) + offset = (-pow(2, A, 6)) % 6 + header = (1 << A) + offset + assert at_public(header) is TERMINAL and at_public(header - 6) is ENTRY + premium = rc.ceil((TARGET - ENTRY.kappa) * A) + complete = 1 + max(early["log2_C"] + premium, late["log2_C"]) + # Independent closed-form recomputation of the full terminal and global cost. + B = 128 + 3 * len(H) + 320 * sum(H) + assert B == late["log2_B"] and late["log2_C"] == max(84500001, 1602 + 220 * G + B) + assert late["log2_C"] >= early["log2_C"] + premium + parent_fixed_ceiling = GAUSSIAN_C - GB / 66037 - 5 * STOP + # Each new ordinary rate lies below a convex combination of its local + # ceiling and the previous rate. Induct from zero at the largest 20-bit H. + parent_20bit_ceiling = BINARY_C - Q(1420718, 2**20) / (2**20 - 1) - 5 * STOP + assert Q(".003899574328473") < parent_fixed_ceiling < parent_20bit_ceiling < TARGET + return { + "parent_fixed_G_public_ceiling": str(parent_fixed_ceiling), + "parent_any_20bit_ordinary_public_ceiling": str(parent_20bit_ceiling), + "signed_gain_over_20bit_ceiling": str(TARGET - parent_20bit_ceiling), + "target": str(TARGET), + "ordinary_guard": str(q), + "ordinary_debit": str(OB), + "gaussian_debit": str(GB), + "gaussian_raw": str(GAUSSIAN_C), + "entry": early, + "terminal": late, + "G_minus_one_positive_margin": str( + margins(TARGET, STOP, q, GAUSSIAN_C - GB / (G - 1))[-1] + ), + "old_word_positive_margin": str(bad_legacy), + "entry_conversion_bits": premium, + "complete_log2_C": complete, + "public_A": A, + "public_offset": offset, + "peak_height": max(*H, G), + "parent_complete_log2_C": 685495960, + "delta_from_8088": str(TARGET - Q(".003899574328473")), + } + + +if __name__ == "__main__": + if not __debug__: + raise ValueError("Enable assertions") + print(json.dumps(calculate(Path(sys.argv[1]).resolve()), indent=2)) diff --git a/research/p104-shortcut-eta-target/parent8088/LICENSE b/research/p104-shortcut-eta-target/parent8088/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/p104-shortcut-eta-target/parent8088/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-shortcut-eta-target/parent8088/NOTICE.md b/research/p104-shortcut-eta-target/parent8088/NOTICE.md new file mode 100644 index 0000000000..bdad26a55c --- /dev/null +++ b/research/p104-shortcut-eta-target/parent8088/NOTICE.md @@ -0,0 +1,5 @@ +# Attribution + +Ali Romman supplied the #8042 matched-interval suffix derivation, #8057 weighted signed producer and caller, and the earlier #8055 serial setup proof. SYLforge supplied the #8052 K7 ordinary circuit and physical replay. #8066 contributes the prior ordinary price and #8067 the literal K7 floor and directed fringe calculation. #8070 supplies the Gaussian booking, #8071 the earlier K7 booking, and #8072 the exact fixed-booking allocation comparison. This package uses the K7-specific suffix bound in the complete charged envelope and allocates the resulting ordinary headroom. + +The archived source and notices retain their original license. The separate historical CI prerequisite reuses Jerry Chen's #7257 source navigation and snapshot repair. OpenAI Codex materially assisted arithmetic, implementation and independent verification. [Original suffix proof](https://github.com/aliromman/integer-mult-bounds/blob/dfd25d553a843a946ca0b94130a5ff8943e98fdd/research/retimed-native-multiplier/TRANSFER.md) · [Full predecessor credit](PROOF.md) · [License](LICENSE) diff --git a/research/p104-shortcut-eta-target/parent8088/PEER-SOURCE.json b/research/p104-shortcut-eta-target/parent8088/PEER-SOURCE.json new file mode 100644 index 0000000000..6f84b3aef4 --- /dev/null +++ b/research/p104-shortcut-eta-target/parent8088/PEER-SOURCE.json @@ -0,0 +1,94 @@ +{ + "archive_sha256": "0e0d559bdb15e7b647f88a2b5e27fcdc9e28e81d8f4145459876ba6da2e9314c", + "files_sha256": { + "research/frequency-weighted-native-multiplier/FINITE-LOSS.md": "12c6069437a0cbb61c80804f89f027ef9709c186e67d26fb0584ad6e71048052", + "research/frequency-weighted-native-multiplier/GaussianFiniteLoss.lean": "9d247f73d9da2748399b821612b30f20140783c08d761b6d4ef7d3c7c3d07064", + "research/frequency-weighted-native-multiplier/LICENSE": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4", + "research/frequency-weighted-native-multiplier/MEASUREMENTS.json": "9ea26ae002146ae21291ecc0a6b224e5cccb9e3b5d199522558a645863da4f7b", + "research/frequency-weighted-native-multiplier/NOTICE.md": "02e69a1d57e2208ce49b3362a5672136887c1968d66de83a8f358e6d4a9353df", + "research/frequency-weighted-native-multiplier/PROOF.md": "4dbb38cdbe5b691edf4845fe8cf2a99be5d43455cc73199ab7e305abaa91acca", + "research/frequency-weighted-native-multiplier/README.md": "173313f895d9f810e5c32853ff383c8ee962e475dead35e5634047aa9c8a1453", + "research/frequency-weighted-native-multiplier/RESULT.json": "2f4faa6648592f589df22a8a0a07ba6856d20786294a44a7776c7d6e0efa14a5", + "research/frequency-weighted-native-multiplier/SOURCES.json": "01d9e6b6b28cd174800cadfb59f4f064b3844575da297d82e16eb19a0d11c868", + "research/frequency-weighted-native-multiplier/TASK.json": "9db85415d252a595907a8c1ddf8ce64acc5c0aa67dc8f6b4656139053bb40a52", + "research/frequency-weighted-native-multiplier/VERIFICATION.md": "58568a8f5e097a1d828aeff33ea33c63863c4b28dd1a87fd7dca9adebb5d6c1f", + "research/frequency-weighted-native-multiplier/VERIFY.json": "4f5506a41e62585e34c80c6838922d33b04d42e010fab310690f340a5be3721e", + "research/frequency-weighted-native-multiplier/WeightedNumerical.lean": "2017bae8064554efb13c564503d8f88c4615e9f733a74aa5eaf4047e5bd8af94", + "research/frequency-weighted-native-multiplier/bootstrap.py": "a824c0ba9bb5efe5ad5b6c9b891b363b6d2ac31b0a57b9e27b68a6c2bca6f7ee", + "research/frequency-weighted-native-multiplier/check_calendar.py": "1c51b8bd75ef2d9d8847b2ebf88d7dbcc44d89954146c2bdede8854915392b8c", + "research/frequency-weighted-native-multiplier/check_exterior.py": "aee4fd29eb2fa021f806c987e0db23ecb7148e5dc846581f62d3ba39ed7ef725", + "research/frequency-weighted-native-multiplier/check_lean.py": "32e49adef4502f193b5ded2cc4e7f8cea6a285283fda4db2152570a4b68098cb", + "research/frequency-weighted-native-multiplier/check_nested.py": "9b2eaf387abbeeef43dd9bb31081ba73f3423e8233fb3446d61fce802a1c6b5b", + "research/frequency-weighted-native-multiplier/check_ownership.py": "a1fdaf5eaaa4215bc90051db48e17d0bf9cf7fe03f67a4d2bdf4e328f3c1a73a", + "research/frequency-weighted-native-multiplier/check_placement.py": "e4317a1eb36f692912ca4739364859118711620838705d8e33b1eabec32b0990", + "research/frequency-weighted-native-multiplier/check_raw.py": "d62d50279969bfecf23d2e14412949fa643394c1539ccb87db7dac5f79e2d97e", + "research/frequency-weighted-native-multiplier/grades.py": "8d2e3d14ac2149f985d7f6a75bf36182d7f68aadf8df6595fc0774224d4951ac", + "research/frequency-weighted-native-multiplier/independent_price.py": "448811cdb4a2bdefd4f736c2bad81c2a833bde634bcf65498e05267b5ee7ead0", + "research/frequency-weighted-native-multiplier/measure_setup.py": "cbfe019024fbeee428c415549db10180af69995078825b6341bc9021f3d08723", + "research/frequency-weighted-native-multiplier/portable/EVIDENCE.json": "3bfffdda94bbc6a14282399eca69b8619c96bd587c7957b3bdf854e03ef89427", + "research/frequency-weighted-native-multiplier/portable/NOTICE.md": "57d7e187fb48df97838976a7942e41dc381f00daeff7c2b5c392fb1a6f252517", + "research/frequency-weighted-native-multiplier/portable/README.md": "141d07df12c9e5352a8f83a03a033dd2c41cc5d0d6e0edb3532cab462536a974", + "research/frequency-weighted-native-multiplier/portable/STACK-LOCALITY.md": "0211732aaa6083a305e861f8172b581b0a9c98e10191d8432d546ee224c0bf5f", + "research/frequency-weighted-native-multiplier/portable/TRACE-CLOCK.md": "9f2b0d125cc35f91bb037363505d027331c79153211ea21de838405ae01a1a2a", + "research/frequency-weighted-native-multiplier/portable/bounded_wasi.py": "8232cc247e5910aab7a0fecb03426088c8f851fd93cbf8fb3587a4a5d7ee143d", + "research/frequency-weighted-native-multiplier/portable/compare.py": "7a906b2b871011595f66882897e7ff0fa79f007fc7887ae0c21b555d778a75c8", + "research/frequency-weighted-native-multiplier/portable/compiler_state.py": "11f371903410a53aa138bb9b9c49e9441393a34092fff922716a78b5521e1870", + "research/frequency-weighted-native-multiplier/portable/consumer.py": "411cc1052a70f7084de81f6f1e54636737d5e5155d0756b8271d5d82c268d3b3", + "research/frequency-weighted-native-multiplier/portable/fixed_directory.py": "c99e9945295b954b453f4995474db4ec8da9e7d8d6ba1a564456213d066e5904", + "research/frequency-weighted-native-multiplier/portable/guest_opcodes.py": "9b2a1b128939cc8d2ef379199c09af74c52ed4b696640fce01606c431d931db6", + "research/frequency-weighted-native-multiplier/portable/module_census.py": "f22218fc37012f5c14b17afba3e8b868fd7268f25931836397f00fbdd319f6f7", + "research/frequency-weighted-native-multiplier/portable/producer.py": "5a76b94efb0bb59a686255f212b532a0f44a586649befda07dbfc5fe86c6a8b7", + "research/frequency-weighted-native-multiplier/portable/record_census.py": "8132c345cfcc5e7d89494fa437685673273f878f2dc40e0187bf2b84eee17e08", + "research/frequency-weighted-native-multiplier/portable/run.py": "6a1e17556326107cac9e70f446b2a90c35e9b4b07bfb7c4b31e5fe9b081f7d9b", + "research/frequency-weighted-native-multiplier/portable/signed.py": "7620e713be7a8064c5b9f83e6573cfabab801b627f0133b7998fdb51a6bac449", + "research/frequency-weighted-native-multiplier/portable/source_image.py": "e354c3fb2bb05eb36dc2438d89c30b18b7973638c51af526d8e55b56803c73ba", + "research/frequency-weighted-native-multiplier/portable/tape_directory.py": "70bf289334f724cabf1cfa9e074199e6be93ef0aeba8193f279e5ef1336de97b", + "research/frequency-weighted-native-multiplier/portable/verify_receipt.py": "8b42d3c5f35d6810321eb000e10b4e5593d543296cc670c3c8847e7051c1b30c", + "research/frequency-weighted-native-multiplier/positive_debit.py": "7320b6a4ef1320d765e9b41a9b1e286db83a1d36d96f46bee0bef37974e8b8d9", + "research/frequency-weighted-native-multiplier/receipt.py": "82d921fdc33006e2d356d8bf78f3c85777722322d716be44b42bc763a04c8095", + "research/frequency-weighted-native-multiplier/runtime.patch": "f35d37cc1746b5a7ac137a3f6de6de887a24f3af578283c24a64c8a25ccc584b", + "research/frequency-weighted-native-multiplier/typed_raw.py": "0c268432c9d48798c17d927f2d900b5e69dfc6585166cd71f253913e389c3b47", + "research/frequency-weighted-native-multiplier/typed_transport.py": "b76b9ad3dc0dd91473026c079585f830387eaa3c34c25a7820ee5057d5cbf941", + "research/frequency-weighted-native-multiplier/verify.py": "07730c6859c26de43b8621bf7e5b778187f41ac17419569ada7c6e10f5d04d4a", + "research/tiered-native-multiplier/CLOCK.md": "cf71e4a3216df23eb7e4fa8a8d9de3735e6257c65ca8a60a5085d9f3c90c4ecb", + "research/tiered-native-multiplier/LICENSE": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4", + "research/tiered-native-multiplier/MEASUREMENTS.json": "a1083bc55178baf0015ef83ef169f45df61475fcc648f487e03c852c871f1f00", + "research/tiered-native-multiplier/NOTICE.md": "c386dabe3fd1d046bddc782c671219757c7708e9ec874a6ede55b540edc95f2c", + "research/tiered-native-multiplier/NUMERICAL.md": "14b86724db522393981ed54b540a35f27bd952f3d95d6e6d14c5b23896811dc9", + "research/tiered-native-multiplier/README.md": "d2c214591f03313dece24592cde3193deffb2f1057b891604597b5e8c6d020ca", + "research/tiered-native-multiplier/RESULT.json": "661e16fcb533b69b97ad2dc91ab81bed79c44e7fdce01306ce573cb6f0ed7fa7", + "research/tiered-native-multiplier/SERIAL-SETUP.md": "1ca7e23ae113647605a31fa309c3bbdde2baf2d442913247fcda4c8a1eef7e7c", + "research/tiered-native-multiplier/SETUP.md": "6951a98f2f8a0bf73c8d60b16ebbbd66bf87584251df8afbefe4e3a0330bfbf3", + "research/tiered-native-multiplier/SOURCES.json": "7a10012734132909e99b0c6160d68d0b8647e1607d25679efb1f5315cf8e23de", + "research/tiered-native-multiplier/ScaledEntrance.lean": "e404be78622db98e9c3b490a15d0e9f002a2cf1eee9ecbd0a9516efbd0db5329", + "research/tiered-native-multiplier/TASK.json": "2cfe7fe1ea4ee8cd07d24048d45e543fdb8a6fa6585ebdc20b1ede55982a16a7", + "research/tiered-native-multiplier/TierCost.lean": "668a248d1060dd4fe97a0edb6652cb3782b8ba4ccc0d00ec73ee6ae253eb9945", + "research/tiered-native-multiplier/VERIFICATION.md": "343f4b2de9b49c1536d35046eee086898bad48023b7da528c5096ca43a1358d0", + "research/tiered-native-multiplier/VERIFY.json": "c684d5b86039809900c85fb0ce64d531db23c62e06bfcf210d6b2cc349480492", + "research/tiered-native-multiplier/bootstrap.py": "74ac8f1d3af21f86cda48a3d50084d6fa5faf84b44ec2e5929b587f40f5bcfd1", + "research/tiered-native-multiplier/check_gaussian.py": "383a3385bc9763d6eb557163ee62aa9ab999b0d98c719a004db87abfee063d24", + "research/tiered-native-multiplier/check_lean.py": "0d53ee2a814887bb53e78f62f2d2e73544641f2cac470dbecec93cdb0aa17203", + "research/tiered-native-multiplier/check_phase_passes.py": "6afd65da931476680d88cb54336ffedf531c3063af181f75403d511e24e83b94", + "research/tiered-native-multiplier/check_placement.py": "d416329ba75727d8f968abc39caded0c1a1fd3f21ffc9286274c5b834aab7154", + "research/tiered-native-multiplier/check_serial_setup.py": "11d1c3209cb523a360ab9abaefb3122507fdf5cb469169890fe2dac636812c47", + "research/tiered-native-multiplier/grades.py": "340684fdd5ca0e611836b0e7301f1c339282ba532bf9e3ec8055944d8981f3c8", + "research/tiered-native-multiplier/independent_price.py": "0b2ecc4a1845a2807782644b6b2675e2fcb194fcbb3ae80b50af9a775363e952", + "research/tiered-native-multiplier/installations.py": "1c6978b8c7d136ef87191512d9ab9eb3dda8a818844244b96cb165d46d97b1df", + "research/tiered-native-multiplier/measure_setup.py": "896349b654c7b8195e9823beaee080d2d30b3f72a562de90c7b6e2554bdd20bb", + "research/tiered-native-multiplier/receipt.py": "3d0219eb2262ea64ccf2dc8da4d2877e32c519c4670d99577703f8bfc236ba61", + "research/tiered-native-multiplier/runtime.patch": "6c93961841be2abc3629928074e2c7917d264e94187276fc88a33f922a3c62e4", + "research/tiered-native-multiplier/serial_setup.py": "61b5058d394ed74e943303e4bdbf21d58ccf5d8bb39fc4b02e97bc135d7bdbbc", + "research/tiered-native-multiplier/source/INSTALLER-NOTICE.md": "c6b1753ad6ebda2a2143b1a9efc80fadad6c1b27552c3ec8bc7bfdb431fb8eeb", + "research/tiered-native-multiplier/source/K7-NOTICE.md": "9c5ae9750012d305d917e625d14a33cc880e810e801e73364725bcdc24bffdb5", + "research/tiered-native-multiplier/source/K7-STACK-LEDGER.json": "a0c0d5b241e6861a5c49a287617e48fba56b09824f5ef4fcb7f03152edf37e8e", + "research/tiered-native-multiplier/source/activation.py": "6e7f89d40a4d10ecd40a50e5b96334dfc64db90841ece7e3ef12eeca5ee5093b", + "research/tiered-native-multiplier/source/check_binary_k7.py": "5eeb8f818725249cbabf215c323c3f8351b1c4ed3c127119341e6ed09f490dd6", + "research/tiered-native-multiplier/source/installer.tar.gz": "6696459e2e3552f802e7caaaf93dc86c9bb6b62ee38631702bff2e3a8a9a481a", + "research/tiered-native-multiplier/source/ordinary_clock.py": "91dcf0ef72dddbde998b80f3d8b30c8036de9ce97e06e2bbd9c4159bf292020d", + "research/tiered-native-multiplier/source/outer_budget.py": "ca4438db28a447ed5c43d87d43f0ac10a0cb2b4e183342ac93139d517b9d4d02", + "research/tiered-native-multiplier/source/outer_clock.py": "63363c3da673365f3ac5e1b7e318c6938005f1e9c9896799504cc598efbf96fa", + "research/tiered-native-multiplier/source/strong-bit-k7.json.gz": "9e7392c52bcf29c0cc58c54c619f95c28f476394c33e8e0a5aa30c9557d31362", + "research/tiered-native-multiplier/verify.py": "d6cf9085e87743db14932a21cf895f8bd4d0f126b6c0bb7220d3255268dba39a" + }, + "head": "cbe847a953b971f9c6c5a0a6661e2008acd29086" +} diff --git a/research/p104-shortcut-eta-target/parent8088/RESULT.json b/research/p104-shortcut-eta-target/parent8088/RESULT.json new file mode 100644 index 0000000000..d3aa1658f4 --- /dev/null +++ b/research/p104-shortcut-eta-target/parent8088/RESULT.json @@ -0,0 +1,168 @@ +{ + "gaussian": { + "trial": "2144845547/549755813888", + "weights": [ + 5, + 451 + ], + "real_targets": [ + 52608, + 52608 + ], + "real_loans": [ + 282336, + 281328 + ], + "weighted_targets": 23989248, + "weighted_loans": 128290608, + "directed_margin": "25058737434575388224575020763/12026966897699221379437011099669697124641", + "grade_cells": 51, + "typed_cells": 88, + "min_individual_share": "84552148502764401372515549359944817029050164931794082594601537579467011/2860129876771506011238618397035687755768702340256804091497779103672800801628608", + "raw_loss": "32493/262144", + "finite_loss": { + "debit": "32493/262144", + "lower_band": 1874, + "upper_divisor": 1724, + "upper_scale": 263772, + "weighted_target_axes": 677246016, + "fringe": "9855327798491145000008863611532376016988768776524141279702351778045123210618948864642927936166641175388866240444915926300679636006691575485715060252445081351560429404511158572360378279210639068080753530558224129392605801257746179782957096064788428064753669613420462519401696785546490279430080018137642933835029211580682854203685497104978657309177854278066988223552089745565498322648766352359836788046785020187491928709028380672/1342540347115003801339193634434118005969396584285962442394959680393309123888495653671285995487875229178096266927976831591204700090080192133325202296541848553230643969974272240538847398499051171111777461260201928540243171377784715338372417078127721083771125765869564048493216028935498620492028436115290562587407642634709562627328187188324708170778235532923474771273686539644997760676043397700918553715386317622276832315088178455", + "psi_lower": "36774473797948037912541634097319747003962336700199693263185882360108702157204359298849184867697091848216479995115497386337385946240131323176845598251098906577844387526162820503736128940557939295960932285381747537950101211679504229529740379309339083420407786722205325615622484024288593604461947377591301975260073070627318995418672896973647110540817123114001402885032828105953443989475620884756624494834416485967126325/39705077055616758278398945718051270079611438391017956157398730393989438789277411838957841865629177832072563146472685672846872214469179617143201512976452800338626006041794233403917197722699527632604968482024969035216709987572500437752314454941061554198481484429943611438686069826395238026562564130057975559635506987142353835625307135663742826983170452337581165507977519446768523155949307595075711756167806976", + "upper_factor": "134667828521352946827277466923875792742152375382159190455807148713042743779215305635750257991965288838288719960034256612002029434764148272719558843914695715191801891192941005051504337914181031605782716144250340031975697947945996890931788989525599377871413615387566852154789135127352312497311434855201439925870554904241254867886758903637446909883062852425586685301736720143445020707734415017867921629872549964489271241855789110424006584585024504735895884925924106791529175262703307716505501393496931406502797178207294089568551602504714558234605348776657310756368049810181098265475603759104/123580773374774139706743239199911715736300977349790795558001573628030255043046429657611426002240582458056212955511247617563450590225969427286635772453353747514638005869472174378209726976604548505671114727150196313963306505957707180235079767540675988558958727593661411586205630782812490534897988699310975574852767165940503581524301776246934358632848298093520591047826407102440056585801857110986448849642213266520351744694262757454851094484829657958670678869440431292058646015766763918814535977632841275152600551084571577381729778445461612470638411946979432368932333435171592011149954840625" + }, + "capacity_cut": { + "new": [ + "2356659474246895453004862288340047/5070602400912917605986812821504", + "75413103175900654496155594298779059/162259276829213363391578010288128" + ], + "90": [ + "168820568970742257315174557382401181/162259276829213363391578010288128", + "337641137941484514630349115332889169/324518553658426726783156020576256" + ], + "91": [ + "-156428030449689521334616704420940755/162259276829213363391578010288128", + "-156428030449689521334616704133756587/162259276829213363391578010288128" + ] + } + }, + "entry": { + "kappa": "69/20000", + "ordinary_H": [ + 3000, + 3080 + ], + "numerical_H": 1024, + "ordinary_rates": [ + "429429543222806817/125000000000000000000", + "690000000000001/200000000000000000" + ], + "gaussian_rate": "2078299883/549755813888", + "signed": { + "strict": 54, + "functional": 4, + "smallest_margin": "1/10000000000000000000", + "ordinary_margin": "1/1000000000000000000", + "positive_margin": "138582096165769387223/419430400000000000000000" + }, + "stock": { + "binary_cuts": [ + 3077, + 6221 + ], + "public_exponent_A": 7437, + "first_public_offset": 4, + "initial_s": 7438, + "stage_and_outer_fixed_log_overhead": 1964, + "retimed_first_stripe_margin": 1701, + "retimed_all_size_margin_floor": 1635, + "absolute_log2_private_control_envelope": 3153922, + "storage_upper": "6.2 p T < 297.6 n bits" + }, + "geometry": { + "public_offset_above_2_to_A": 4, + "first_extent_bits_minus_b": -7433, + "last_extent_bits_minus_b": -7432, + "minimum_width": 3809536, + "log2_axis_count": 7412, + "largest_axis_width": 5592406, + "private_clock_log2_upper": 5734316302, + "actual_dense_root_entry_log2": 11184812 + }, + "binary_surcharges": [ + 0, + 25818582 + ], + "log2_B": 125433364, + "log2_C": 125660246 + }, + "terminal": { + "kappa": "3899574328473/1000000000000000", + "ordinary_H": [ + 62186, + 986008, + 1048575 + ], + "numerical_H": 66037, + "ordinary_rates": [ + "1931781575745158583/500000000000000000000", + "1949674759309293453/500000000000000000000", + "779914865694601/200000000000000000" + ], + "gaussian_rate": "141571022627303/36304224681721856", + "signed": { + "strict": 54, + "functional": 4, + "smallest_margin": "1/10000000000000000000", + "ordinary_margin": "1/1000000000000000000", + "positive_margin": "33069152611014851/27697925324800000000000000000" + }, + "stock": { + "binary_cuts": [ + 62500, + 1048572, + 2097211 + ], + "public_exponent_A": 2163503, + "first_public_offset": 4, + "initial_s": 2163504, + "stage_and_outer_fixed_log_overhead": 1968, + "retimed_first_stripe_margin": 1079694, + "retimed_all_size_margin_floor": 1045976, + "absolute_log2_private_control_envelope": 1073740803, + "storage_upper": "6.2 p T < 297.6 n bits" + }, + "geometry": { + "public_offset_above_2_to_A": 4, + "first_extent_bits_minus_b": -2163499, + "last_extent_bits_minus_b": -2163498, + "minimum_width": 1107715328, + "log2_axis_count": 2163470, + "largest_axis_width": 1431655766, + "private_clock_log2_upper": 1468233164592, + "actual_dense_root_entry_log2": 2863311532 + }, + "binary_surcharges": [], + "log2_B": 670966217, + "log2_C": 685495959 + }, + "previous_rate": "1949109876753/500000000000000", + "rate_delta": "1354574967/1000000000000000", + "complete_log2_C": 685495960, + "ordinary_floor": 4474, + "ordinary_matched_suffix_coefficient": "186/25", + "ordinary_finite_debit": "710359/524288", + "ordinary_child_tariff": "2401/1024", + "ordinary_child_contraction": "2400/2401", + "ordinary_child_geometric_sum": 2401, + "ordinary_entry_clock_extra": 5, + "ordinary_terminal_clock_extra": 9, + "entry_price_surcharge": 973, + "fixed_funding_height_floors": [ + 1047843, + 66037 + ], + "log2_fixed_setup_upper": 228, + "native_setup_transition_upper": 217364570380528137475793294892811967875864032914108887556978854854656, + "native_setup_grade_actions": 269057152, + "max_native_H": 1048575 +} diff --git a/research/p104-shortcut-eta-target/parent8088/check_cutoff.py b/research/p104-shortcut-eta-target/parent8088/check_cutoff.py new file mode 100644 index 0000000000..89b93baa92 --- /dev/null +++ b/research/p104-shortcut-eta-target/parent8088/check_cutoff.py @@ -0,0 +1,75 @@ +"""Check the literal upper fence, integer cutoff births and timed returns.""" +from fractions import Fraction as Q +from pathlib import Path +import sys + +sys.path.insert(0, str(Path(sys.argv[1]).resolve())) +from upstream import install + +install() +import grades +from grades import LOWER, SCALES, UPPER_DIVISOR, WEIGHTS, numerical_recipe +from installations import ENTRY, GAUSSIAN_C, TERMINAL +from transport import Measure, ceil +from typed_transport import NativeType, TypedPlan, column_header + +assert LOWER == 1874 and SCALES == (1, 2) and WEIGHTS == (5, 451) +assert UPPER_DIVISOR == 1724 + + +def verify_constructor_call(height): + recipe = numerical_recipe(height) + carrier = 1 << height + + def verify(n, types, cells, t, lower, upper, volume, ticks, rounds, **options): + assert (n, lower, t) == (carrier, LOWER, 1-GAUSSIAN_C) + assert upper == 2 * (carrier // (1724 * 306)) + assert upper > 2 * (carrier // (2048 * 306)) + assert upper % 2 == 0 and 4*258*(upper-8) < n + assert len(cells) == 88 and tuple(word.multiplicity for word in types) == WEIGHTS + assert (volume, ticks, rounds) == (carrier**6, carrier**82, carrier**2) + assert options == {"width": 1 << (92*height), "delay_base": 1 << 19} + return True + + original = grades.TypedPlan + try: + grades.TypedPlan = verify + assert recipe.open() + finally: + grades.TypedPlan = original + + +heights = (ENTRY.complex_log, TERMINAL.complex_log) +assert heights == (1024, 66037) +for height in heights: + verify_constructor_call(height) +print("PASS_LITERAL_UPPER_FENCE", UPPER_DIVISOR, LOWER, heights, flush=True) + +for band, expected in ((LOWER, (2, 0)), (LOWER+2, (0, 0))): + widths = [] + for kind, scale in enumerate(SCALES): + header = column_header(band-8, kind) + assert header % 2 == kind and header - kind == band-8 + widths.append((header-kind)*scale) + assert tuple(width % 4 for width in widths) == expected +assert (LOWER-8, 2*(LOWER-8)) == (1866,3732) + +native = tuple(NativeType((2,), (1,), weight) for weight in WEIGHTS) +shares = {(a,1,b,2):Q(w,sum(WEIGHTS)) for a in range(2) for b,w in enumerate(WEIGHTS)} +t = 1-GAUSSIAN_C +n, volume = 65536, 2**29 +plan = TypedPlan(n, native, shares, t, LOWER, 4126, volume, 3, 16, delay_base=3, padding=1) +mass = Measure(t, volume, 64*n.bit_length()) +assert plan.bands.start == LOWER and (LOWER-2,0) not in plan.count +for band in plan.bands: + for kind, weight in enumerate(WEIGHTS): + assert plan.count[band,kind] == ceil(weight * mass.mass(band,band+2)[1]) +assert {(a,link.kind) for (_,a,_),ls in plan.send.items() for link in ls} == {(0,0),(0,1),(1,0),(1,1)} +grants = [] +for recipient in range(2): + for link in plan.receive[LOWER,recipient,0]: + assert link.band in (2*LOWER,2*LOWER+2) and plan.delay[LOWER] < plan.delay[link.band] + assert link.count > 0 + grants.append((recipient,link.kind,link.band,link.count)) +assert len(grants) == 8 and plan.source_width > 0 and plan.leaves_per_epoch > 0 +print('PASS_LITERAL_LOWER_CUTOFF', LOWER, (1866,3732), grants, plan.leaves_per_epoch, flush=True) diff --git a/research/p104-shortcut-eta-target/parent8088/check_ordinary_floor.py b/research/p104-shortcut-eta-target/parent8088/check_ordinary_floor.py new file mode 100644 index 0000000000..94cf4e2a2b --- /dev/null +++ b/research/p104-shortcut-eta-target/parent8088/check_ordinary_floor.py @@ -0,0 +1,221 @@ +"""Check the actual ordinary floor and fully charged occupied-edge calendar.""" +from collections import Counter +from fractions import Fraction as Q +from hashlib import sha256 +import json +from pathlib import Path +import sys + +RUNTIME=Path(sys.argv[1]).resolve() +sys.path.insert(0,str(RUNTIME)) +from upstream import install + +install() +LOWER=4474 + + +def ceil(x): + return -(-x.numerator//x.denominator) + + +def all_size_stock(word, c, intervals, unit): + """Discharge the parameterized TRANSFER.md hypotheses at the new floor.""" + t = 1-c + targets, paid = Counter(word.targets), Counter(word.paid) + assert max(targets) <= 134 and min(paid) >= 1 + assert all(5*r <= 4*k for r,k in word.cells) + assert all(sum(p for (u,k),p in word.cells.items() if u==r)==1 for r in paid) + # Check actual directed per-receiving-label funding and the whole raw margin. + t_lower = {k: intervals(k,t)[0] for k in targets} + p_upper = {r: intervals(r,t)[1] for r in paid} + t_hi = sum(n*intervals(k,t)[1] for k,n in targets.items()) + p_lo = sum(n*intervals(r,t)[0] for r,n in paid.items()) + assert sum(targets[k]*v for k,v in t_lower.items())>sum(paid[r]*v for r,v in p_upper.items()) + assert 100*p_lo>99*t_hi + for k,n in targets.items(): + load=sum(paid[r]*p*p_upper[r] for (r,s),p in word.cells.items() if s==k) + assert 01 + + # Check the smallest admitted numerical scale; every margin below grows + # with N. Actual binary native stages start no earlier than H=3000. + H=1024 + N=1<=(1-delta)*N + assert Q(6,5)**4>2 and Q(6,5)**73>2**19 + assert len(word.paid)<2**19 + assert 2**19*Q(1,1024*ambient*LOWER)**77+Q(1,N**77)<1 + lower_power=Q(intervals(LOWER,t)[0],unit) + assert lower_power>1024 and Q(1,t*lower_power)+Q(2,N**5)<2 + # Endpoint inverse bases are >1/(512N) through all roots. The + # original 61-stage envelope costs 397+30.5H bits per endpoint. + assert c.denominator.bit_length()-1<=60 and Q(1,N)-Q(1,2**(64*(H+1)))>Q(1,512*N) + grid_error_bits=397+31*H+6*H+3-64*(H+1) + assert grid_error_bits<-132 + # Time and integer errors are already normalized conservatively without + # the L**c*psi denominator, which is strictly greater than one. + assert c>0 and 1=1024. + assert suffix_birth_error1 + assert (1-Q(1,N))/Q(257,256)>Q(1,2) + return {"fringe_upper_1e9":ceil(fringe*10**9),"psi_lower_floor":int(psi), + "grid_absolute_error_exponent_at_H1024":grid_error_bits, + "suffix_target_axes":target_axes, + "suffix_birth_error_upper_at_H1024":"2^30/N^5", + "normalized_error_allowance":"2^-128", + "birth_bound":"2V","copy_group_bound":"3N^3","whole_field_width":"N^92", + "first_two_columns":[LOWER-8,LOWER-6],"minimum_positive_scale_h_guard":1024} + + +def bound_recipe(old, lower): + """Pass the proposed literal cutoff through the installed Recipe.open seam.""" + import transport + + assert old.level_floor==lower + N=1<=0 and sender in live + closes+=1 + assert not live and not pending and not any(held.values()) and opens==closes + assert axes==plan.leaves_per_epoch and len(first_counts)==2 + return {"tested_occupied_K7_grade":[r,k],"lower":LOWER,"upper":hi,"carrier":n, + "first_band_contacts":contacts,"native_opens":opens,"native_closes":closes, + "returned_paid_prefixes":loans,"paid_singletons":axes, + "lower_return_counts":dict(first_counts),"extent":"complete fixture event stream"} + + +def check(): + from band_product import prepare_native + from installations import BINARY_C, ENTRY, TERMINAL + from raw_binary_stage import binary_word + from strict_moment import UNIT + from unpowered_price import intervals + + stage=(RUNTIME/"raw_binary_stage.py").read_bytes() + assert sha256(stage).hexdigest()=="8020d33828233e7016700849a507a8cee78db8a17a33b6063b737313ea05b07f" + assert TERMINAL.rank_logs==(62186,986008,1048575) and TERMINAL.complex_log==66037 + word=binary_word() + assert (len(word.targets),len(word.paid),len(word.cells))==(18906,104652,24) + a,b=prepare_native() + ordinary=(*a[:-1],*b[:-1]) + assert tuple(recipe.rank_log for recipe in ordinary)==(*ENTRY.rank_logs,*TERMINAL.rank_logs) + assert (a[-1].rank_log,b[-1].rank_log)==(1024,66037) + openings=[bound_recipe(recipe,LOWER) for recipe in ordinary] + stock=all_size_stock(word,BINARY_C,intervals,UNIT) + finite=finite_plan(word,BINARY_C) + assert finite["tested_occupied_K7_grade"]==[49,64] + assert finite["native_opens"]==76380 and finite["returned_paid_prefixes"]==456 + assert finite["paid_singletons"]==38003660528 + print("PASS_LITERAL_ORDINARY_FLOOR",json.dumps( + {"new_binary_openings":openings,"binary_all_size":stock,"binary_integer_fixture":finite}, + sort_keys=True),flush=True) + + +if __name__=="__main__": + check() diff --git a/research/p104-shortcut-eta-target/parent8088/check_stage_seam.py b/research/p104-shortcut-eta-target/parent8088/check_stage_seam.py new file mode 100644 index 0000000000..5f06eb78fd --- /dev/null +++ b/research/p104-shortcut-eta-target/parent8088/check_stage_seam.py @@ -0,0 +1,245 @@ +"""Replay literal ordinary dispatch and bounded signed bank returns.""" +from dataclasses import replace +from fractions import Fraction as Q +from hashlib import sha256 +from io import BytesIO +from itertools import product +import json +from pathlib import Path +import sys + +RUNTIME = Path(sys.argv[1]).resolve() +sys.path.insert(0, str(RUNTIME)) +from upstream import install + +install() + + +class DyadicWidth(int): + """Speed up exact exponentiation of a mathematically dyadic test width.""" + def __pow__(self, exponent): + assert self.bit_count() == 1 and exponent >= 0 + return 1 << ((self.bit_length() - 1) * exponent) + + +def verify_stage(profile, cuts, number, log_width): + import ordinary_carrier as carrier + + calls = [] + base = DyadicWidth(1 << log_width) + prev = 1 << cuts[number-2] + power = 1 << (log_width//250) + assert log_width % 10000 == 0 + width = max(prev+1, power) + component = 1 << (39*log_width//10000) + count = -(-width//component) + short, longer = divmod(width,count) + expected_layout = (longer, short+1, count-longer, short) + rank = 1 << profile.rank_logs[number-1] + expect_direct = -(-base//width) <= 1 << (8*profile.rank_logs[number-1]) + + def root(value, degree): + assert value.bit_count() == 1 + quotient, remainder = divmod(value.bit_length()-1,degree) + assert not remainder + return 1 << quotient + + def receiver(dimension, layout, previous, *, direct, profile): + assert dimension == rank and layout == expected_layout and direct == expect_direct + assert previous.func is carrier.ternary + assert previous.keywords == {"maximum": number-1, "profile": profile} + return number + + def body(source,target,digits,prefix,gap,suffix,backend): + assert digits==base and (prefix,gap,suffix)==(1,3,5) and backend==number + calls.append((digits.bit_length()-1,backend)) + + actual = carrier.ceil_root, carrier.Receiver, carrier.root_body + try: + carrier.ceil_root, carrier.Receiver, carrier.root_body = root, receiver, body + carrier.ternary(None,None,base,1,3,5,maximum=number,profile=profile) + finally: + carrier.ceil_root, carrier.Receiver, carrier.root_body = actual + assert calls == [(log_width,number)] + return {"stage":number,"scanned_log":log_width,"rank_log":rank.bit_length()-1, + "predecessor_cut":cuts[number-2],"direct":expect_direct, + "component_log":component.bit_length()-1} + + +def verify_tape(width, u, v): + from five_exchange import same_order_line + from growing_binary import Weighted + from same_order_body import SameOrderBody + from streaming_routes import cold_swap_tape + from ternary_leaf import select_pivot + + class Core(SameOrderBody, Weighted): + def __init__(self): + super().__init__(2,(1,width,0,0),cold_swap_tape) + self.stock=self.owners + self.calls=0 + + def weighted(self,*args,**kwargs): + assert kwargs["atoms"]==1paid and gaussian_upper(TERMINAL.complex_log)>paid + # The ordinary side binds: the install is the 15-digit floor of its rate. + assert TERMINAL.kappa<=ordinary_upper(ranks)-5*STOP30 + assert 2660000*(30+2)<2**30 and 17**16*10**(21*16)<2**1182 + + stock=resource_receipt(TERMINAL) + cuts=tuple(stock["binary_cuts"]) + assert tuple(entrance_logs(ranks))==cuts + assert all(cuts[i-1]+21024 and stock["retimed_all_size_margin_floor"]>1024 + signed=qualify(TERMINAL.kappa,STOP,paid,gaussian_upper(TERMINAL.complex_log)) + assert (signed["strict"],signed["functional"])==(54,4) + logB=128+3*len(ranks)+320*sum(ranks) + late=1602+220*TERMINAL.complex_log+logB + conversion=((TERMINAL.kappa-ENTRY.kappa)*activation(TERMINAL)).__ceil__() + assert conversion==PREMIUM + assert 1+max(125660246+conversion,late)==TOTAL + assert TOTAL>318292011 + + h1,h2,h3=ranks + def require_funding(proposed,gaussian): + if ordinary_upper(proposed)<=paid or gaussian_upper(gaussian)<=paid: + raise ArithmeticError("Profile does not fund the terminal price") + def require_budget(cap): + if 1+max(125660246+conversion,late)>cap: + raise ArithmeticError("The full recurring invoice exceeds the declared cap") + capped=((26384,417171,524288),39002) + controls=[ + rejected(lambda:require_funding((h1,h2-1,h3),TERMINAL.complex_log),"second-ordinary-height-minus-one"), + rejected(lambda:require_funding((h1,h2,h3-1),TERMINAL.complex_log),"third-ordinary-height-minus-one"), + rejected(lambda:require_funding(*capped),"capped-combined-profile-at-new-rate"), + rejected(lambda:require_funding(ranks,TERMINAL.complex_log-1),"gaussian-height-minus-one"), + rejected(lambda:require_funding(ranks,TERMINAL.complex_log) or require_budget(318292011),"inherited-cap-318292011"), + rejected(lambda:qualify(TERMINAL.kappa,STOP,paid-STOP,gaussian_upper(TERMINAL.complex_log)),"outer-ordinary-margin-removed"), + rejected(lambda:resource_receipt(replace(TERMINAL,rank_logs=(h1,cuts[0]+2,h3))),"prefix-height-at-previous-cut"), + rejected(lambda:require_budget(TOTAL-1),"recurring-bound-minus-one"), + ] + # A 21-bit Gaussian height would need a fresh setup census. + assert (2**20).bit_length()==21 + + # Economical ordinary heights: Cauchy relaxation (as in #8078), our debit. + # The ordinary side binds; the prefix rule cut[i-1]+21: + mid=(lo+hi)//2 + try: + resource_receipt(replace(TERMINAL,rank_logs=(a,mid,h3))) + lo=mid + except AssertionError: + hi=mid + return lo + assert max_h2(h1)==h2 and h3==2**20-1 + neighbours=[ordinary_upper((a,max_h2(a),h3)) for a in (h1-64,h1+64)] + assert all(n UNIT + psi += paid[r] * share * r * (Q(floor, UNIT) - 1) / c''' + +NATIVE_SETUP = ''' setup = native_clock() + grade_count = len(low[-1].paid.histogram) + len(low[-1].targets.histogram) + actual_roles = sum(len(v.targets) + len(v.paid) for v in high[-1].types()) + assert actual_roles < 2**20 and grade_count < 2**8 + assert len(low) + len(high) == 7 and max(h.bit_length() for h in (*ENTRY.rank_logs, ENTRY.complex_log, *TERMINAL.rank_logs, TERMINAL.complex_log)) <= 20 + grade_actions = 2**20 * 256 + 2**8 * 256 * 8 + 32 * (grade_count + 2)**2 + 2**12 + assert grade_actions < 2**32 and setup["all_setup"] < 2**228''' + +DIRECTED_ORDINARY = '''def ordinary_debit(): + delta = Q(1, 2**128) + predecessor_tariff = Q(47, 20) + child_tariff = Q(2401, 1024) + + def bounds(floor, suffix, tariff=child_tariff, reserve=Q(1)): + # #8082: the ordinary contraction is paid by the clock sum, so the + # positive 256/255 summation reserve is not charged here. + multiplier = ( + tariff * reserve * Q(4097, 4096) * Q(1028, 1024) + * (1 + Q(suffix, floor) + delta) / ((1 - Q(10, floor)) * (1 - delta)**3) + ) + lo, hi = powers(1024 * 134 * floor, BINARY_C) + return multiplier * lo, multiplier * hi + + lo, hi = bounds(4474, Q(186, 25)) + # #8073's own booking at its floor, kept as a positive control. + k_lo, k_hi = bounds(18960, 8, predecessor_tariff, Q(256, 255)) + # #8076's own booking (floor 18960, 8/L, child tariff) at 11178/8192. + t_lo, t_hi = bounds(18960, 8, child_tariff, Q(256, 255)) + assert t_hi < 2 * powers(2, Q(2986, 8192))[0] + # Our earlier retune (floor 4474, (186/25)/L, tariff 47/20) at 1430037/2^20. + r_lo, r_hi = bounds(4474, Q(186, 25), predecessor_tariff, Q(256, 255)) + # #8082 (reserve dropped, tariff 47/20) at 1424116/2^20, and the tariff stack with 256/255 at 1426639/2^20. + e_lo, e_hi = bounds(4474, Q(186, 25), predecessor_tariff) + assert e_hi < 2 * powers(2, Q(375540, 2**20))[0] + c_lo, c_hi = bounds(4474, Q(186, 25), child_tariff, Q(256, 255)) + assert c_hi < 2 * powers(2, Q(378063, 2**20))[0] + assert r_hi < 2 * powers(2, Q(381461, 2**20))[0] + assert 2 * powers(2, Q(3012, 8192))[0] - k_hi > Q("0.0000277614405947") + prior_lo, prior_hi = bounds(18960, 64, predecessor_tariff, Q(256, 255)) + old_lo, old_hi = bounds(32768, 64, predecessor_tariff, Q(256, 255)) + allowance_lo, allowance_hi = (2 * end for end in powers(2, Q(372142, 2**20))) + finer_allowance = 2 * powers(2, Q(372141, 2**20))[1] + reserve = allowance_lo - hi + assert reserve > 0 and lo - finer_allowance > 0 + # The new allowance also fails at #8073's floor 18960 with the 8/L suffix. + assert k_lo > allowance_hi + # Both parent bookings fail the combined allowance. + assert t_lo > allowance_hi and r_lo > allowance_hi and e_lo > allowance_hi and c_lo > allowance_hi + print("ORDINARY_RESERVE", float(reserve), float(lo - finer_allowance), float(k_lo - allowance_hi)) + assert prior_lo > allowance_hi + assert 2 * powers(2, Q(3047, 8192))[0] - prior_hi > Q("0.000062662376093595") + assert prior_lo - 2 * powers(2, Q(6093, 16384))[1] > Q("0.000046832527238212") + assert prior_hi**1024 < 2**1405 < old_lo**1024 + assert old_hi**512 < 2**703 + assert Q(75, 32) / Q(47, 20) == Q(375, 376) + + # #8076: an equal tariff gives unit contraction; 2401/1024 gives sum 2401. + child_volume = Q(75, 32) + old_ratio, new_ratio = child_volume / predecessor_tariff, child_volume / child_tariff + assert new_ratio == Q(2400, 2401) and 1 / (1 - new_ratio) == 2401 + old_sum, new_sum = 1 / (1 - old_ratio), 1 / (1 - new_ratio) + assert old_sum == 376 and old_sum < new_sum < 8 * old_sum + assert 2**16 < (Q(7, 10) * old_sum)**2 < 2**17 + assert 2**21 < (Q(7, 10) * new_sum)**2 < 2**22 + print("PASS_DIRECTED_ORDINARY_DEBIT", 4474, "1420718/1048576", "2400/2401", "(186/25)/L, no 256/255") + print("PASS_CHILD_TARIFF", "2401/1024", "volume<=75/32", "sum=2401", "entry+5", "terminal+9") + + +''' + +EDITS = { + "runtime.patch": ( + ('TERMINAL = Profile((8192, 129414, 524288), 483871, Q(".00389821"))', + 'TERMINAL = Profile((62186, 986008, 1048575), 66037, Q(".003899574328473"))'), + ), + "positive_debit.py": ( + ("from strict_moment import UNIT, power_interval", "from strict_moment import UNIT, power_interval\nfrom unpowered_price import intervals"), + ("POSITIVE_DEBIT = Q(65081, 524288)", "POSITIVE_DEBIT = Q(1039776, 2**23)"), + (OLD_EDGE, DIRECTED_EDGE), + ("assert psi > Q(1790217668064, 10000)", 'assert psi > Q("926190717.2837")'), + ("assert fringe < Q(7579, 1000)", 'assert fringe < Q("7.340806")'), + ), + "receipt.py": ( + ('sys.path.append(str(HERE / "portable"))', 'sys.path.append(str(HERE.parent / "tiered-native-multiplier"))'), + ("from verify_receipt import verify as fixed_installation", "from check_serial_setup import clock as native_clock"), + ("DEBIT = Q(65081, 2**19)", "DEBIT = Q(1039776, 2**23)\nORDINARY_DEBIT = Q(1420718, 2**20)\nCHILD_TARIFF = Q(2401, 1024)"), + ("def tape_factor(ambient, rate):", "def tape_factor(ambient, rate, lower, suffix=64):"), + (" delta, lower = Q(1, 2**128), 32768", " delta = Q(1, 2**128)"), + ("(1 + Q(64, lower) + delta)", "(1 + Q(suffix, lower) + delta)"), + ("assert ordinary.ambient == 134 and ordinary.trial == BINARY_C", + "assert ordinary.ambient == 134 and ordinary.trial == BINARY_C\n" + " assert ordinary.level_floor == 4474"), + ("Q(11, 8 * height)", "ORDINARY_DEBIT / height"), + ("Q(11, 8) / (BINARY_C - TERMINAL.ordinary)", + "ORDINARY_DEBIT / (BINARY_C - TERMINAL.ordinary)"), + (" bound = 128 + 320 * sum(heights)", + " # The complete per-stage envelope grows by <8 (#8076).\n" + " bound = 128 + 3 * len(heights) + 320 * sum(heights)"), + (" bound = 40 + 17 + 16384 * sum(heights) + sum(additions)", + " # Charge the square of the new geometric child sum (#8076).\n" + " bound = 40 + 22 + 16384 * sum(heights) + sum(additions)"), + (" assert (tape_factor(134, BINARY_C) * Q(47, 20)) ** 8 < 2**11", + ' ordinary_upper = Q("2.557796525567700799")\n' + " assert tape_factor(134, BINARY_C, 4474, Q(186, 25)) * Q(255, 256) * CHILD_TARIFF < ordinary_upper\n" + " assert ordinary_upper**1048576 < 2**1420718\n" + " assert Q(75, 32) / CHILD_TARIFF == Q(2400, 2401)"), + ("assert cost == 318259431 and premium == 514", "assert cost == 685495960 and premium == 973\n" + " assert early['log2_C'] == 125660246 and late['log2_B'] == 670966217"), + ("(517430, 483870)", "(1047843, 66037)"), + ('older = Q(".0038982016137")', 'older = Q(".003898219753506")'), + ("assert gain == Q(83863, 10**13)", "assert gain == Q(\".003899574328473\") - Q(\".003898219753506\")"), + (" complete_log2_C=cost,", " complete_log2_C=cost,\n" + " ordinary_floor=4474,\n" + " ordinary_matched_suffix_coefficient=\"186/25\",\n" + " ordinary_finite_debit=str(ORDINARY_DEBIT),\n" + " ordinary_child_tariff=str(CHILD_TARIFF),\n" + ' ordinary_child_contraction="2400/2401",\n' + " ordinary_child_geometric_sum=2401,\n" + " ordinary_entry_clock_extra=5,\n" + " ordinary_terminal_clock_extra=3 * len(TERMINAL.rank_logs),"), + (" setup = fixed_installation()", NATIVE_SETUP), + (''' log2_fixed_setup_upper=setup["trace_exponent"], + log2_portable_setup_guard=setup["conservative_exponent"], + log2_full_store_setup_upper=setup["full_store_trace_exponent"], + portable_setup_transition_upper=setup["transitions"],''', + ''' log2_fixed_setup_upper=setup["setup_exponent"], + native_setup_transition_upper=setup["all_setup"], + native_setup_grade_actions=grade_actions,'''), + ), + "independent_price.py": ( + ("lower = powers(2, Q(65081, 524288))[0]", "lower = powers(2, Q(1039776, 2**23))[0]"), + ('assert lower - upper > Q("0.00012957")', 'assert lower - upper > Q("0.000007887415")'), + ("TERMINAL.kappa - peer == Q(83863, 10**13)", 'TERMINAL.kappa - peer == Q(".003899574328473") - Q(".0038982016137")'), + ("def rounded_peer():", DIRECTED_ORDINARY + "def rounded_peer():"), + (" weighted()\n rounded_peer()", " weighted()\n ordinary_debit()\n rounded_peer()"), + ), +} + + +# Apply exact real-integer frequencies and reprice the full typed calendar. +EDITS["runtime.patch"] += ( + ("+GAUSSIAN_C = Q(17145637167, 2**42)", "+GAUSSIAN_C = Q(17158764376, 2**42)"), +) +EDITS["grades.py"] = (("WEIGHTS = (1, 90)", "WEIGHTS = (5, 451)"),) +EDITS["positive_debit.py"] += ( + ("assert target_axes == 135150528", "assert target_axes == 677246016"), + ("assert 91 / (t * 2**10)", "assert sum((5, 451)) / (t * 2**10)"), +) +EDITS["receipt.py"] += ( + ("def raw_counts(base, multiplicity):", "def raw_counts(base, multiplicity, primary=1):"), + ("t, p = targets.copy(), paid.copy()", + "t = Counter({grade: entry * primary for grade, entry in targets.items()})\n" + " p = Counter({grade: entry * primary for grade, entry in paid.items()})"), + ("p[1] -= 1008\n p[Q(1, 2)] += 2016", + "p[1] -= 1008 * primary\n p[Q(1, 2)] += 2016 * primary"), + ("def total_interval(counts):", "def total_interval(counts, trial=GAUSSIAN_C):"), + ("intervals(grade, 1 - GAUSSIAN_C)", "intervals(grade, 1 - trial)"), + ("WEIGHTS == (1, 90)", "WEIGHTS == (5, 451)"), + ("t, p = raw_counts(base, 90)", "t, p = raw_counts(base, WEIGHTS[1], WEIGHTS[0])"), + ("<= 261", "<= 270"), + (" cuts = {}", + " high = total_interval({k: n for k, n in t.items() if k > 2})\n" + " required = total_interval({r: n for r, n in p.items() if 5 * r > 8})\n" + " assert high[0] - required[1] > 462\n" + " past_targets, past_paid = raw_counts(base, 541, 6)\n" + " assert total_interval(past_targets)[1] < total_interval(past_paid)[0]\n" + " old_tariff = Q(17145637167, 2**42)\n" + " cuts = {\"new\": [str(high[0] - required[1]), str(high[1] - required[0])]}"), + (" cap = total_interval({k: n for k, n in chosen.items() if k > 2})", + " cap = total_interval({k: n for k, n in chosen.items() if k > 2}, old_tariff)"), + (" load = total_interval({r: n for r, n in required.items() if 5 * r > 8})", + " load = total_interval({r: n for r, n in required.items() if 5 * r > 8}, old_tariff)"), + (" net = total_interval(chosen)[0] - total_interval(required)[1]", + " net = total_interval(chosen, old_tariff)[0] - total_interval(required, old_tariff)[1]"), +) +EDITS["independent_price.py"] += ( + ('assert psi > Q("184971191.2157")', 'assert psi > Q("926190717")'), + ('fringe < Q("7.335168")', 'fringe < Q("7.340806")'), +) +EDITS["independent_price.py"] += ( + ("assert (targets.total(), paid.total()) == (105216, 564142)", "assert (targets.total(), paid.total()) == (105216, 563662)"), +) +EDITS["check_placement.py"] = ( + ("assert 90 * (hi - lo) * M * pi > 4", "assert WEIGHTS[1] * (hi - lo) * M * pi > 4"), +) +EDITS["check_exterior.py"] = ( + ("from band_product import production_supplier", "from band_product import production_supplier\nfrom installations import GAUSSIAN_C"), + ("c = Q(17145637167, 2**42)", "c = GAUSSIAN_C"), +) +EDITS["check_nested.py"] = ( + (" * cells[1, 2]\n * 90", " * cells[1, 2]\n * types[0].multiplicity\n * types[1].multiplicity"), + ("share == cells[1, 2] * 90 / t[2]", "share == cells[1, 2] * types[1].multiplicity / t[2]"), + ("and grant.numerator // grant.denominator == 899557645", "and 4_400_000_000 < grant.numerator // grant.denominator < 4_600_000_000"), +) +EDITS["check_ownership.py"] = ( + ("def run(freq, ticks, lower, upper, volume, n, rounds, delay):", + "def run(freq, ticks, lower, upper, volume, n, rounds, delay, primary=1):"), + ("NativeType((2,), (1, 1), 1)", "NativeType((2,), (1, 1), primary)"), + ("(1, 1, 0, 2): Q(1, 2 * freq)", "(1, 1, 0, 2): Q(primary, 2 * freq)"), + ("1 - Q(1, 2 * freq)", "1 - Q(primary, 2 * freq)"), + (" frequency=freq,", " frequency=(primary, freq),"), + ("run(90, 8, 10, 42, 450, 384, 32, 4)]", + "run(90, 8, 10, 42, 450, 384, 32, 4), run(451, 8, 10, 42, 90, 384, 32, 4, primary=5)]"), +) + + +# Keep the reproduced lower edge and widen the actual even upper fence. +EDITS["grades.py"] += ( + ("LOWER = 2048", "LOWER = 1874\nUPPER_DIVISOR = 1724"), + ("2048 * self.ambient", "UPPER_DIVISOR * self.ambient"), +) +EDITS["positive_debit.py"] += ( + ("BAND_LOWER = 2048", "BAND_LOWER = 1874"), + ("from unpowered_price import intervals", "from unpowered_price import intervals\nfrom grades import UPPER_DIVISOR"), + (" upper = 2 * (M // (2048 * recipe.ambient))", + " scale = UPPER_DIVISOR * recipe.ambient // 2\n" + " upper = 2 * (M // (2 * scale))\n" + " assert 4 * max(targets) * (upper - 8) < M and 516 * (upper + 2) < M"), + ("1024 * recipe.ambient * upper", "scale * upper"), + ("Q(4 * max(targets), 1024 * recipe.ambient)", "Q(4 * max(targets), scale)"), + ("power_interval(1024 * recipe.ambient * lower, c)", "power_interval(scale * lower, c)"), + (' "lower_band": lower,', ' "lower_band": lower,\n "upper_divisor": UPPER_DIVISOR,\n "upper_scale": scale,'), + ("assert t > Q(996, 1000) and 11 * t > 10", + "assert t > Q(996, 1000) and power_interval(lower, t)[0] > 1024 * UNIT"), +) +EDITS["receipt.py"] += (("and LOWER == 2048", "and LOWER == 1874"), + # The shortcut word moves #8057's single-weight capacity control. + ("assert cap[1] - load[0] < -1515 and net > Q(3, 100)", "assert cap[1] - load[0] < -960 and net > Q(3, 100)"), +) +EDITS["independent_price.py"] += ( + ("from installations import BINARY_C, TERMINAL", "from installations import BINARY_C, TERMINAL\nfrom grades import LOWER, UPPER_DIVISOR"), + (" upper = (", " scale = UPPER_DIVISOR * recipe.ambient // 2\n upper = ("), + ("Q(4 * 258, 1024 * 306)", "Q(4 * 258, scale)"), + ("powers(1024 * 306 * 2048, c)[1]", "powers(scale * LOWER, c)[1]"), + ("fringe / 2048", "fringe / LOWER"), + (' assert lower - upper > Q("0.000007887415")', + ' assert lower - upper > 0 and lower - upper > Q("0.000000019")\n' + ' assert powers(2, Q(1039775, 2**23))[0] < upper\n' + ' psi_hi = sum(recipe.paid.histogram[r] * share * r * (powers(Q(k,r), c)[1] - 1) / c\n' + ' for (r,k), share in recipe.cells.items())\n' + ' prior_fringe = 10 * axes / ((1-c) * psi_hi)\n' + ' prior_scale = 1024 * recipe.ambient\n' + ' prior_factor = ((1+delta) * (1+Q(4*258,prior_scale)) * powers(prior_scale*LOWER,c)[0]\n' + ' * (1+prior_fringe/LOWER+delta) / (1-delta)**4)\n' + ' assert prior_factor - powers(2, Q(64939,524288))[1] > Q("0.000127791")'), +) +EDITS["check_placement.py"] += ( + ("from grades import numerical_recipe, WEIGHTS", "from grades import numerical_recipe, LOWER, UPPER_DIVISOR, WEIGHTS"), + (" U = 2 * (M // (2048 * 306))", + " scale = UPPER_DIVISOR * recipe.ambient // 2\n" + " assert UPPER_DIVISOR == 1724 and scale == 263772\n" + " U = 2 * (M // (2 * scale))"), + (" assert U < lo < hi < M", " assert LOWER < e < U < lo < hi < M"), + (" assert period == 1620 and tickets == (0, 324, 648) and f.swaps[0] == (1, 324, 1)", + " assert period == 1364 and tickets == (0, 272, 545) and f.swaps[0] == (1, 272, 1)"), +) +EDITS["verify.py"] = ( + ('("check_calendar.py", "check_ownership.py")', + '("check_calendar.py", "check_ownership.py", "check_cutoff.py", "check_stage_seam.py", "check_ordinary_floor.py")'), +) + + +SHORTCUT_FILE = "w5669_shortcut5.json.gz" +SHORTCUT_SHA = "6ef741c346ea075c4f2ed11f9d42d7076103e72d4a9e5059d495f1cb990fd149" +SHORTCUT_PATCH = '--- a/strong_complex.py\n+++ b/strong_complex.py\n@@ -8,6 +8,7 @@\n import json\n \n WORD = "38d2b3a2311a9ba5fee091cc7aa204c7ed95651aec95d75184b2391df090cbfb"\n+SHORTCUT_WORD = "ed3bea7186f962f3a8a8ae389cecce3d1ef48a7a832cf9af6c9048a6b5919b35"\n LAYOUT = "0ce3f9e383fc4bfdd22612b9e34fc9759d97204215937b82d23aec2cedd9b8ee"\n ADDITIONAL = "6ff19e063214b1698165d9da1fcd6182d9b837ac2d6e61aa71658b629aabbc95"\n GRID = 154113755636630124932500335624192000\n@@ -42,7 +43,16 @@\n graph, _ = reconstruct(parent, read("BANK-FACTORS.json.gz"))\n if digest(graph) != WORD or digest(layout) != LAYOUT:\n raise ValueError("The reconstructed Gaussian graph or its owner layout differs")\n- return graph, layout\n+ # Install the five exact chart-3 relay shortcuts on the reconstructed word.\n+ import gzip\n+ shortcut = json.loads(gzip.decompress((Path(__file__).resolve().parent / "w5669_shortcut5.json.gz").read_bytes()))\n+ if digest(shortcut) != SHORTCUT_WORD:\n+ raise ValueError("The shortcut Gaussian graph differs")\n+ if any(shortcut[key] != graph[key] for key in ("initial", "final", "frames", "first_output")):\n+ raise ValueError("The shortcut word changed an endpoint, chart or output")\n+ if (len(graph["moves"]), len(shortcut["moves"])) != (5674, 5669):\n+ raise ValueError("The shortcut word does not remove exactly five transfers")\n+ return shortcut, layout\n \n \n def required_pairs(graph, layout):\n@@ -85,7 +95,7 @@\n \n graph, layout = load_changed(data)\n catalogue = native_catalogue(graph, layout)\n- if digest(catalogue) != "8a9ff9558bf5fa3854699937fe063f98c86467d5d32a4488bfc878d2be081e70":\n+ if digest(catalogue) != "f581128079a67c9fc6341ee96dce772342748f508c77f7d5956bf41408d97f58":\n raise ValueError("The generated all-column Clifford catalogue differs")\n tables = Path(grade) / "retained/data"\n bases = read_json(tables / "CALLER-PHASE-BASES.json")["by_q"]\n' +SHORTCUT_IMAGES = {"before": 'b0f18924be837173ccbbd1b7814a7a9a27228d68ff0dcbaf44a90a2065d0574c', "after": "8f3fb92523df006e2e94505127088aaf2e64fadd20b3cab2344f62d7690e875d"} +EDITS["bootstrap.py"] = ( + ('for name in ("grades.py", "typed_raw.py", "typed_transport.py"):', + 'for name in ("grades.py", "typed_raw.py", "typed_transport.py", "w5669_shortcut5.json.gz"):'), +) + + +def materialize(package): + from pathlib import Path + word = (Path(__file__).resolve().parent / SHORTCUT_FILE).read_bytes() + if sha256(word).hexdigest() != SHORTCUT_SHA: + raise ValueError("The shortcut word archive differs") + (package / SHORTCUT_FILE).write_bytes(word) + for name, replacements in EDITS.items(): + replace(package / name, replacements) + with (package / "runtime.patch").open("a") as patch: + patch.write(RAW_FLOOR_PATCH) + patch.write(SHORTCUT_PATCH) + path = package / "SOURCES.json" + pins = json.loads(path.read_bytes()) + pins["runtime_images"]["installations.py"]["after"] = NEW_INSTALLATION + pins["runtime_images"]["raw_binary_stage.py"] = RAW_FLOOR_IMAGES + pins["runtime_images"]["strong_complex.py"] = SHORTCUT_IMAGES + for name in ("runtime.patch", "grades.py", SHORTCUT_FILE): + pins["local_sources"][name] = sha256((package / name).read_bytes()).hexdigest() + pins["runtime_images"]["grades.py"]["after"] = pins["local_sources"]["grades.py"] + path.write_text(json.dumps(pins, indent=2) + "\n") diff --git a/research/p104-shortcut-eta-target/parent8088/verify.py b/research/p104-shortcut-eta-target/parent8088/verify.py new file mode 100644 index 0000000000..36e20c189f --- /dev/null +++ b/research/p104-shortcut-eta-target/parent8088/verify.py @@ -0,0 +1,83 @@ +"""Restore authenticated public inputs, apply one retune and replay a signed mode.""" +from argparse import ArgumentParser +from hashlib import sha256 +import json +from pathlib import Path +import runpy +from subprocess import run +import sys +import tarfile +from tempfile import TemporaryDirectory + +HERE = Path(__file__).resolve().parent +HEAD = "cbe847a953b971f9c6c5a0a6661e2008acd29086" +SOURCE_SHA = "798c2e6394c258986484a116198cc542a6d2b4c1f289e5816de2cfecf5141c51" + + +def unique_object(pairs): + result = {} + for name, value in pairs: + if name in result: + raise ValueError(f"Repeated source key {name}") + result[name] = value + return result + + +def restore(tree): + source = (HERE / "PEER-SOURCE.json").read_bytes() + if sha256(source).hexdigest() != SOURCE_SHA: + raise ValueError("Peer source manifest differs") + pins = json.loads(source, object_pairs_hook=unique_object) + archive = HERE / "peer8057.tar.gz" + if pins["head"] != HEAD or sha256(archive.read_bytes()).hexdigest() != pins["archive_sha256"]: + raise ValueError("Unexpected source archive") + seen = set() + with tarfile.open(archive) as bundle: + for item in bundle: + path = Path(item.name) + if path.is_absolute() or ".." in path.parts or str(path) != item.name: + raise ValueError(f"Invalid source path {item.name}") + if item.isdir(): + continue + if not item.isfile() or item.name in seen or item.name not in pins["files_sha256"]: + raise ValueError(f"Unexpected or repeated peer file {item.name}") + data = bundle.extractfile(item).read() + if sha256(data).hexdigest() != pins["files_sha256"][item.name]: + raise ValueError(f"Source differs at {item.name}") + destination = tree / path + destination.parent.mkdir(parents=True, exist_ok=True) + destination.write_bytes(data) + seen.add(item.name) + if seen != pins["files_sha256"].keys(): + raise ValueError("Source archive is missing a file") + return tree / "research" / "frequency-weighted-native-multiplier" + + +def main(): + modes = ("price", "calendar", "raw", "exterior", "nested", "product", "setup", "regenerate") + parser = ArgumentParser(description=__doc__) + parser.add_argument("mode", choices=modes) + args = parser.parse_args() + with TemporaryDirectory(prefix="k7-shortcut-lift-") as temporary: + tree = Path(temporary) + peer = restore(tree) + runpy.run_path(str(HERE / "prepare.py"))["materialize"](peer) + for name in ("check_cutoff.py", "check_stage_seam.py", "check_ordinary_floor.py"): + (peer / name).write_bytes((HERE / name).read_bytes()) + if args.mode == "regenerate": + runtime = tree / "runtime" + run([sys.executable, "-IB", str(peer / "bootstrap.py"), str(runtime)], check=True) + result = run([sys.executable, "-IB", str(peer / "receipt.py"), str(runtime)], check=True, capture_output=True, text=True) + print(json.dumps(json.loads(result.stdout), indent=2)) + return + if args.mode == "setup": + serial = peer.parent / "tiered-native-multiplier" / "check_serial_setup.py" + run([sys.executable, "-IB", str(serial)], check=True) + else: + (peer / "RESULT.json").write_bytes((HERE / "RESULT.json").read_bytes()) + run([sys.executable, "-IB", str(peer / "verify.py"), args.mode], check=True) + print("PASS_SHORTCUT_WORD_LIFT_20BIT", args.mode, flush=True) + + +if __name__ == "__main__": + main() diff --git a/research/p104-shortcut-eta-target/parent8088/w5669_shortcut5.json.gz b/research/p104-shortcut-eta-target/parent8088/w5669_shortcut5.json.gz new file mode 100644 index 0000000000..2381d62342 Binary files /dev/null and b/research/p104-shortcut-eta-target/parent8088/w5669_shortcut5.json.gz differ diff --git a/research/p104-shortcut-eta-target/verify.py b/research/p104-shortcut-eta-target/verify.py new file mode 100644 index 0000000000..f92f7e4caf --- /dev/null +++ b/research/p104-shortcut-eta-target/verify.py @@ -0,0 +1,149 @@ +"""Cold, source-pinned checks for the conditional 39/10000 installation.""" + +from argparse import ArgumentParser +from pathlib import Path +from tempfile import TemporaryDirectory +import json +import subprocess +import sys + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) +from install import build + + +def run(script, *args, expected=None, scope=None): + print("RUN", script.name, flush=True) + with TemporaryDirectory(prefix="target-private-cache-") as cache: + proc = subprocess.run( + [ + sys.executable, + "-IB", + "-X", + f"pycache_prefix={cache}", + str(script), + *map(str, args), + ], + capture_output=True, + text=True, + ) + if proc.returncode: + print(proc.stdout, file=sys.stderr) + print(proc.stderr, file=sys.stderr) + raise RuntimeError(f"{script.name} exited {proc.returncode}") + if expected: + observed = json.loads(proc.stdout) + assert observed == json.loads((HERE / expected).read_bytes()), script.name + if scope: + assert scope in proc.stdout, (script.name, scope) + if expected is None: + print(proc.stdout.strip()[-1024:], flush=True) + + +def replay(mode): + if not __debug__: + raise RuntimeError("Run with assertions enabled") + with TemporaryDirectory(prefix="target-8088-") as scratch: + root = Path(scratch) + tree = root / "application" + peer, runtime = build(tree) + if mode == "price": + run(HERE / "invoice.py", tree, expected="RESULT.json") + tables = root / "bill-inputs.json" + run( + HERE / "freeze_inputs.py", + "--runtime", + runtime, + "--expected-result", + HERE / "RESULT.json", + "--output", + tables, + scope="PASS_FROZEN_LITERAL_INVOICE_INPUTS", + ) + assert json.loads(tables.read_bytes()) == json.loads( + (HERE / "BILL-INPUTS.json").read_bytes() + ) + run( + HERE / "check_bill.py", + "--inputs", + tables, + "--expected-result", + HERE / "RESULT.json", + expected="BILL.json", + ) + run(HERE / "check_comparator.py", expected="COMPARATOR.json") + run(HERE / "check_negative_controls.py", "--inputs", tables, "--expected-result", HERE / "RESULT.json", "--output", root/"negative.json", scope="PASS_INDEPENDENT_BILL_NEGATIVE_CONTROLS") + run(HERE / "check_prices.py", tree, expected="PRICES.json") + run(HERE / "check_ordinary.py", runtime, peer, expected="ORDINARY.json") + run(HERE / "check_floor.py", tree, expected="FLOOR.json") + elif mode == "algebra": + run(HERE / "check_grid.py", runtime, expected="GRID.json") + run( + HERE / "check_caller.py", + runtime, + HERE / "GRID.json", + expected="CALLER.json", + ) + run(HERE / "check_atlas.py", runtime, expected="ATLAS.json") + run( + HERE / "check_rational.py", + runtime, + "--output", + root / "matrix.json", + scope="PASS_RATIONAL_1291_OUTPUT_IDENTITY", + ) + elif mode == "setup": + run( + HERE / "check_bootstrap.py", + HERE / "parent8088", + tree, + "--frozen-bytes", + scope="PASS_PINNED_BOOTSTRAP_COMPARISON", + ) + run(HERE / "check_census.py", tree, expected="CENSUS.json") + run(HERE / "check_phase_census.py", tree, expected="PHASES.json") + run( + HERE / "check_setup.py", + tree, + scope="PASS_8088_TARGET_FIXED_CONSTRUCTOR", + ) + run( + HERE / "check_receiver.py", + "run", + tree, + scope="PASS_SEPARATE_PROCESS_FIXED_INSTALLATION", + ) + elif mode == "layers": + run(HERE / "check_cutoff.py", runtime, scope="PASS_LITERAL_LOWER_CUTOFF") + run( + HERE / "check_path_binding.py", + runtime, + "--output", + root / "path.json", + scope="PASS_SHORTCUT_PATH_BINDING", + ) + for name in ( + "check_calendar.py", + "check_ownership.py", + "check_placement.py", + "check_raw.py", + "check_exterior.py", + ): + run(peer / name, runtime) + elif mode == "product": + run(peer / "check_nested.py", runtime, scope="PASS_NONZERO_INTERIOR") + run( + HERE / "check_product_path.py", + runtime, + peer, + scope="PASS_CANDIDATE_RESTORED_SIGNED_PRODUCT", + ) + else: + raise ValueError(mode) + print("PASS_TARGET_" + mode.upper(), flush=True) + + +if __name__ == "__main__": + p = ArgumentParser(description=__doc__) + p.add_argument("mode", choices=["price", "algebra", "setup", "layers", "product"]) + replay(p.parse_args().mode)