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-paired-delayed-cover/PROOF.md b/research/p104-paired-delayed-cover/PROOF.md new file mode 100644 index 0000000000..c1714f1b0f --- /dev/null +++ b/research/p104-paired-delayed-cover/PROOF.md @@ -0,0 +1,19 @@ +# A smaller cover loss at the existing #8027 carrier + +The fixed #8027 binary ordinary cap can be repriced at **0.003890115176583**, with tested point 0.00389011517657 and conditional κ **0.00389011517650**. The preceding complete claim is 0.00389011507650. The exact difference is 0.00000000010000 and the relative increase is (20000/7780230153)%. The independent audit reconstructs both supplier prices. The signed application passes at the new cap; its deterministic receipt is in application/RESULT.json. [Peer package and sources](https://github.com/aliromman/integer-mult-bounds/tree/fb9b6a7b0d27da1cf98430893a3016bf811e2aa4/research/p104-live-relative-gain) + +**Identical physical supplier.** Pin the original 768-factor separated word, paid cutoff 15^768, productive floor 16^768 and ambient 134^768. The peer reader reconstructs all 630 fields at 111 physical ports, 36 BIT caller uses and the unchanged signed invoice. The fixed uniform supplier has rank N=2^H with H=299610000000000 and productive width B. Let P be its fully compiled rank-one paid leaves. The old native raw bracket is [0.003890115286594,0.003890115286595]. The frozen finite compiler uses C_trial=0.003890115276594 and its original uniform loss e=10⁻¹⁰ at exactly this N. Thus P/B < N^(1−C_uniform), C_uniform=C_trial−e. All proof below uses that existing strict inequality. The prime, physical width, fixed catalogue exclusions, all source-complement and exit batches and four levels of retained stock are those of this #8027 compiler. [Finite supplier, exact seed, stages and old cover](https://github.com/CrocSwap/integer-mult-bounds/blob/89a67c404226d51028e135de2b9169e9020d57af/research/p104-iterated-returns/binary/finite.py#L114-L183) + +**The retained theorem prices the actual bad classes.** Apply the documented delayed-cover bridge *after* the finite compiler has produced its final rank-one list. The theorem preserves the good normalized leaf count and gives, at the assessed exponent τ, μ_τ≤(P/B)N^(−τ)[1+(2N³/q)·32N²]. The hypothesis on each cover root's weight is the retained ancestor-only one; no dependence on the still-fresh cover row is added. Nonunits incur the original swaps, paired scalings, reversals and restoration. Its factor 32N² already prices the bad branch; the probability term is 2N³/q. The frozen rational matchers, exclusions and high-digit/low-type routing do not depend on d. Keep the same q>2⁴⁵ N⁵. Then the complete positive surcharge s=64N⁵/q is strictly less than 2⁻³⁹. The old sufficient checks 2⁴⁵d>256 and integer H·d were convenient conservative comparisons to prove the product below one; they are not assumptions of the displayed moment inequality. [Generic finite-word cover theorem and fixed costs](https://github.com/CrocSwap/integer-mult-bounds/blob/e54523517d0f03e58352e647c403a5af3e525a57/research/p104-shared-native-helper-splits/retained/compiler/bit-audit/retained/DELAYED-COVER-BRIDGE.md#L229-L262) + +Set d′=1/(H·2³⁸)=1/82356169699491840000000000 and τ=1−C_uniform+d′. This remains strictly between the previously established uniform exponent and 1. The good moment is 1/2 and exp(z)>1+z for z>0, + + N^d′ = exp((ln 2)·2⁻³⁸) > 1+2⁻³⁹ > 1+s. + +Thus μ_τ<1 for the same already paid fallback. The recorded upper and lower rational comparison endpoints coincide at 1+2⁻³⁹; both underlying inequalities are strict. No larger prime, extra stock, changed order of specialization, altered source or physical precision decrease is used. Holding other expenses fixed, change only the second loss: C_covered=C_trial−10⁻¹⁰−d′. The R329 actual-carrier cover argument motivated this source-specific comparison; its old 451-factor carrier is not used in the calculation. + +**Same seed DAG and all four ordinary stages.** Start from the exact admitted seed 0.00385248 in the pinned frontier7000 CLAIM.json and ρ=1/250. At each of precisely four frozen levels form E=(1−ρ)C_covered+ρ C_prev, then C_new=(floor(10¹⁵ E)−1)/10¹⁵, just as in the peer code. Check C_prev 1 + H*debit/2 by exp(x)>1+x and log(2)>1/2. + surcharge = Q(1,2**39) + check(Q(c["surcharge_strict_upper"]) == Q(independent["surcharge_upper_strict"]) == surcharge + and Q(c["N_to_d_strictly_above"]) == 1+surcharge + and Q(independent["power_growth_lower_strict"]) == H*debit/2 == surcharge, "delayed cover") + trial = Q(old["trial"]) + seed = Q(old["seed"]) + check(trial == Q(independent["trial"]) == Q(peer_result["binary_raw"][0])-Q(1,10**11) + and seed == Q("0.00385248") and Q(old["old_cover_loss"]) == gap, "unchanged trial and seed") + current = Q(old["cap"]) + check(current == Q(independent["old_cap"]) == Q(peer_result["binary_ordinary"]) + and Q(old["claim"]) == Q(independent["old_claim"]) == Q(peer_result["claim"]), "known-good peer cap") + stages(current,old["stages"],independent["old_rows"],seed,trial-2*gap) + covered = trial-gap-debit + check(covered == Q(c["covered"]), "full changed cost") + cap = stages(c["cap"],c["stages"],independent["new_rows"],seed,covered) + gate_cap(cap,independent["cap"]) + tick = Q(1,10**14) + claim = (min(cap//tick,Q(peer_result["rational_raw"][0])//tick)-8)*tick + tested = claim+7*tick + generous = Q(peer_result["binary_raw"][1])-2*gap + check(claim == Q(c["claim"]) == Q(independent["candidate"]) and tested == Q(c["tested"]) == Q(independent["tested"]) + and Q(peer_result["claim"]) < generous == Q(independent["relaxed_old_ceiling"]) < claim < tested < cap + and claim-generous == Q(independent["separation"]), "directed old separation and tested grid") + try: + gate_cap(cap+tick,independent["cap"]) + except ValueError as error: + check(str(error) == "unproved ordinary cap","cap control reason") + else: + raise ValueError("unsafe extra cap accepted") + return cap + + +def peer_copy(peer, supplied): + peer.mkdir() + for name, expected in PEER_FILES.items(): + (peer/name).write_bytes(locked(supplied/name,expected)) + spec = importlib.util.spec_from_file_location("registered_peer_8027",peer/"verify_application.py") + module = importlib.util.module_from_spec(spec) + sys.modules[spec.name] = module + spec.loader.exec_module(module) + return module + + +def binary(peer, work, package, baseline, component): + # Repeat verify_application.ordinary_bit's literal entry points and retain the + # actual finite proof, including the selected atom and ordinary service ledger. + parent,source = work/"parent",work/"source" + finite = peer.module("finite_bit",package/"binary/finite.py") + for root,pins in ((source,finite.SOURCE_PINS),(parent,finite.PACKAGE_PINS)): + for name,pin in pins.items(): + finite.pinned(root/name,pin) + literal = peer.module("literal",parent/"binary/independent/literal.py") + price = peer.module("binary_price",parent/"binary/independent/price.py") + compiler = peer.module("credited_product",source/finite.FINITE) + word = literal.candidate_word(parent/"binary/WORD.json.gz") + caller = literal.pinned(source/finite.PAIRED/"EFREE-CALLER.json.gz",literal.CALLER_SHA) + native = finite.candidate_receipt(literal,peer.HERE/"BINARY-CANDIDATE.json.gz",baseline["binary_word"],word,caller) + seed = Q(json.loads((source/finite.CLAIM).read_bytes())["admitted_BIT_saving"]) + old = finite.ordinary_certificate(price,compiler,native,seed,None,None) + summary = dict(public=native["public"],instructions=native["instruction_counts"],productive=native["native_targets"], + paid=native["native_paid"],calls=native["native_calls"],paid_all=native["paid"], + productive_all=native["targets"],ordinary=native["ordinary"]) + check(normalize(summary) == baseline["binary_native"] and native["native_calls"] == 36, "literal signed binary bill") + check(old["raw_crossing"] == baseline["binary_raw"] and old["ordinary_admitted"] == baseline["binary_ordinary"] + and old["independent_directed_compiler"]["H"] == baseline["binary_H"] + and old["finite_product_bound_bit_lengths"] == baseline["binary_product"], "complete peer finite control") + old_data, new_data = component["comparator"],component["candidate"] + check(list(old_row["claim"] for old_row in old["ordinary_bootstrap"]) == [s["admitted"] for s in old_data["stages"]] + and Q(old["tested_saving"]) == Q(old_data["trial"]) and Q(old["uniform_loss"]) == Q(old_data["uniform_loss"]) + and Q(old["delayed_cover_loss"]) == Q(old_data["old_cover_loss"]) and seed == Q(old_data["seed"]), + "original finite ordinary bootstrap and stock control") + admitted, bootstrap = price.bootstrap(seed,Q(new_data["covered"]),[s["admitted"] for s in new_data["stages"]]) + check(admitted == Q(new_data["cap"]), "credited bootstrap at new covered rate") + return dict(peer_finite=old, delayed_cover_debit=new_data["cover_loss"], covered=new_data["covered"], + candidate_stages=bootstrap, admitted=new_data["cap"]) + + +def outer_prices(peer, work, baseline, candidate, physical): + import audit_expanded as review + gate_path = work/"source/research/p104-dual-supplier-lift/complex/supplier_gate.py" + g = review.load("separate_candidate_outer",gate_path,review.SUPPLIER_GATE_SHA) + invoice = physical["application"]["invoice"] + weights = {"T":invoice["targets"],"P":invoice["paid"]} + raw = baseline["rational_raw"] + tick = Q(1,10**14) + + def gate(cap, claim): + g.BIT_PIN = str(cap) + return g.gate(weights,Q(claim),Q(claim)+7*tick,*raw,Q(cap)) + + # Both points are computed from the new replay's immutable original 48-call bill. + old = gate(baseline["binary_ordinary"],baseline["claim"]) + check(old["H"] == baseline["H"] and old["outer"] == baseline["outer"], "known-good signed outer control") + result = gate(candidate["binary_ordinary"],candidate["claim"]) + check(result["outer"]["strict_count"] == 54 and result["outer"]["functional_count"] == 4, + "new signed strict and functional checks") + # A real extra paid unit must break the directed lower crossing sign. + damaged = weights["P"].copy() + damaged["1"] = damaged.get("1",0)+1 + left = Q(raw[0]) + good = g.sub(g.moment(weights["T"],left),g.moment(weights["P"],left)) + bad = g.sub(g.moment(weights["T"],left),g.moment(damaged,left)) + check(good[0] > 0 > bad[1], "one extra paid rank breaks the raw lower crossing") + return result + + +def main(): + cli = ArgumentParser(description=__doc__) + for name in ("peer-package","primary","independent","out"): + cli.add_argument("--"+name,required=True,type=Path) + args = cli.parse_args() + check(sys.version_info[:2] == (3,12) and sys.implementation.name == "cpython" and __debug__, + "requires CPython 3.12 with assertions") + primary = json.loads(locked(args.primary,PRIMARY)) + independent = json.loads(locked(args.independent,INDEPENDENT)) + args.out.mkdir(parents=False,exist_ok=False) + with TemporaryDirectory() as cache: + work = Path(cache) + peer = peer_copy(work/"peer-code",args.peer_package) + baseline = peer.read("APPLICATION.json") + cap = certify(primary,independent,baseline) + package = peer.source_tree(work,baseline) + print("PASS authenticated peer closure and both cover certificates",flush=True) + record = binary(peer,work,package,baseline,primary) + save(args.out/"BINARY.json",record) + print("PASS original literal binary, peer stock, new covered bootstrap",flush=True) + result = dict(baseline) + result.update(binary_ordinary=primary["candidate"]["cap"],claim=primary["candidate"]["claim"]) + word,layout,proof = peer.rational_application(work,package,result,cap) + # Both producer and independent reader consume the public JSON representation of all indices. + proof = normalize(proof) + check(proof["caller_proof"]["readback"]["event_stream_sha256"] == proof["caller"] + and proof["caller_census"]["calls"] == baseline["rational_calls"] == 48, "literal paired rational caller") + print("PASS rational word, native/converted plans, signed price and physical application",flush=True) + outer = outer_prices(peer,work,baseline,result,proof) + result.update(H=outer["H"],outer=outer["outer"]) + peer.audit(work,package,result,cap,word,layout,proof) + check(result["premises"] == baseline["premises"] and len(result["premises"]) == 5 + and Q(result["claim"])-Q(baseline["claim"]) == Q(independent["gain"]), + "complete signed gain and inherited premises") + save(args.out/"PHYSICAL.json",proof) + save(args.out/"APPLICATION.json",result) + names = ("APPLICATION.json","PHYSICAL.json","BINARY.json") + save(args.out/"REPLAY.json",dict(peer_head=HEAD,source_archive=baseline["source_archive"], + source_count=baseline["source_count"],primary_sha256=PRIMARY,independent_sha256=INDEPENDENT, + cap=result["binary_ordinary"],tested=independent["tested"],claim=result["claim"], + old_claim=baseline["claim"],difference=independent["gain"],percent_gain=independent["percent_gain"], + old_relaxed_ceiling=independent["relaxed_old_ceiling"],strict_separation=independent["separation"], + outer=outer["outer"],caller=proof["caller"],rational_raw=result["rational_raw"], + controls=["original_four_stage_stock_and_cap","original_outer_on_rebuilt_48_calls", + "tampered_cap_rejected","one_extra_rank_one_paid_rejected"], + premises=baseline["premises"],output_sha256={n:sha256((args.out/n).read_bytes()).hexdigest() for n in names})) + print("PASS_COMPLETE_PEER_COVER_APPLICATION",result["claim"],independent["tested"],independent["gain"],flush=True) + + +if __name__ == "__main__": + main() diff --git a/research/p104-paired-delayed-cover/independent/ACCEPT.json b/research/p104-paired-delayed-cover/independent/ACCEPT.json new file mode 100644 index 0000000000..39e40fd521 --- /dev/null +++ b/research/p104-paired-delayed-cover/independent/ACCEPT.json @@ -0,0 +1,45 @@ +{ + "caller_sha256": "156fdf3a4a129b39225fd6ca51011de27974d7f104e8b04907c17ed5344bc858", + "cap": "3890115176583/1000000000000000", + "changed_peer_summary_fields": [ + "binary_ordinary", + "claim" + ], + "claim": "7780230353/2000000000000", + "gain": "1/10000000000", + "minimum_complete_stock_stage_margin": "25050001616669393/21446919192576000000000000000000", + "native_calls_binary": 36, + "native_calls_rational": 48, + "newly_checked_controls": [ + "extra_rank_one", + "cap_equals_tested" + ], + "outcome": "PASS_COMPLETE_INDEPENDENT_SIGNED_ACCEPTANCE", + "output_sha256": { + "APPLICATION.json": "d072d3299a9eae8779f293ea68feafae2664821b2446215d2b9f9681acb4bba2", + "BINARY.json": "f4aad2d07449c864479f26cc3b3ed4bbd8321f0ca14e1efc8676b28b54c27ed4", + "PHYSICAL.json": "14798ec81680db86bd1d67c5ebe91d7692b90cba04f8023fc106a4747c5bd796" + }, + "paid_rational": 281568, + "peer_head": "fb9b6a7b0d27da1cf98430893a3016bf811e2aa4", + "premises": [ + "native_all_columns", + "owned_erasure", + "compiler", + "precision_tape", + "analytic_recovery" + ], + "price_receipts": { + "independent": "5c723ea9c6b085b6e0aa792f34cfa64daed551a9bf2f629efc54d219008596d2", + "primary": "228b7c47572c9b1c7568db2f59248af454296a1e3ad094da585073bbd594f5cb" + }, + "productive_rational": 52608, + "replay_receipt_sha256": "419d4bdfb95c4484d0ddc81f34c89ee45bdefc0955a85dd496c1043396260e37", + "signed_checks": { + "BIT_just_below_effective_rejected": true, + "functional_count": 4, + "minimum_margin": "1/1000000000000000", + "strict_count": 54 + }, + "tested": "389011517657/100000000000000" +} diff --git a/research/p104-paired-delayed-cover/independent/PRICE.json b/research/p104-paired-delayed-cover/independent/PRICE.json new file mode 100644 index 0000000000..cafd8b24b0 --- /dev/null +++ b/research/p104-paired-delayed-cover/independent/PRICE.json @@ -0,0 +1,100 @@ +{ + "H": 299610000000000, + "bridge_sha256": "9731b93026717f5fa15851e3633cbb4bdc76eba2bffb9d6b4a3b69f7dd502443", + "candidate": "0.00389011517650", + "cap": "0.003890115176583", + "delayed_cover_loss": "1/82356169699491840000000000", + "gain": "1/10000000000", + "member_pins": { + "parent/binary/independent/price.py": "d720df6f3f7a22554e83d0c29243af3ee04fa036073404926bab7bc2f2687e1b", + "parent/qualify_complex.py": "236988674f4efe96134de83a224f9c5f4508f6049237415bc24a18669cf5ad67", + "recipient/binary/finite.py": "c780cea060f4a9efef064b239636162a7e8e84e40369abc1a1c4679dfbeb3041", + "recipient/continuation/audit_expanded.py": "0316153c1822724e1a3d08066aec9601a891073b0209954eaf302ffa014bf5ac", + "source/research/p104-dual-supplier-lift/complex/supplier_gate.py": "3796b2e5a27f3caa142d16364154788e60d0099f1e24a8dcd028e4fbd35a84ca", + "source/research/paired-query-only-bit/retained/inputs/credited_trim.py": "fcff17fdd3108be68761fbde0fcbfe218be166cf518c99f7163e60d53ab785d9" + }, + "new_rows": [ + { + "bound": "83427757207860194751150820049/21446919192576000000000000000000", + "margin": "34829796768484049/21446919192576000000000000000000", + "new": "1944982317943/500000000000000", + "old": "12039/3125000" + }, + { + "bound": "83430972927687435457048349393/21446919192576000000000000000000", + "margin": "25050001616669393/21446919192576000000000000000000", + "new": "389011457443/100000000000000", + "old": "1944982317943/500000000000000" + }, + { + "bound": "83430985790566783539052546769/21446919192576000000000000000000", + "margin": "28824659394562769/21446919192576000000000000000000", + "new": "486264396773/125000000000000", + "old": "389011457443/100000000000000" + }, + { + "bound": "16686197168403657166549890397/4289383838515200000000000000000", + "margin": "5833562020328797/4289383838515200000000000000000", + "new": "3890115176583/1000000000000000", + "old": "486264396773/125000000000000" + } + ], + "old_cap": "0.003890115076583", + "old_claim": "0.00389011507650", + "old_rows": [ + { + "bound": "486245567035953/125000000000000000", + "margin": "203/125000000000000000", + "new": "1944982268143/500000000000000", + "old": "12039/3125000" + }, + { + "bound": "15195759665753/3906250000000000", + "margin": "221/125000000000000000", + "new": "3890114474431/1000000000000000", + "old": "1944982268143/500000000000000" + }, + { + "bound": "972528768546337/250000000000000000", + "margin": "337/250000000000000000", + "new": "486264384273/125000000000000", + "old": "3890114474431/1000000000000000" + }, + { + "bound": "97252876914609/25000000000000000", + "margin": "17/12500000000000000", + "new": "3890115076583/1000000000000000", + "old": "486264384273/125000000000000" + } + ], + "percent_gain": "20000/7780230153", + "power_growth_lower_strict": "1/549755813888", + "raw": [ + "0.003890115286594", + "0.003890115286595" + ], + "relaxed_old_ceiling": "778023017319/200000000000000", + "separation": "17981/200000000000000", + "signed_intervals": [ + [ + "1.771210880690334105626958485304937539375328300327716370899999999999999E-10", + "1.771210880690334105626958485304937539375328300327716411400000000000001E-10" + ], + [ + "-2.069812024853376839669253199700518767735744143730315849600000000000001E-10", + "-2.069812024853376839669253199700518767735744143730315806299999999999999E-10" + ] + ], + "signed_status": "requires fresh full signed compiler and independent expansion", + "source_pins": { + "APPLICATION-SOURCES.tar.gz": "d85d011ca74e8592c21c1e4db91a1a9021af26dcebc4dfdc2af7251f9c1bf968", + "APPLICATION.json": "587ece477179606eed6fd9a334ac6d6e27f0067f82c3d6281993736e0570a76f", + "BINARY-CANDIDATE.json.gz": "74e93daf2b7acf794ffb51f92f03f51556f68126d41ee13a8969bddb4cbe6326", + "WORD.json.gz": "731246c085638706bdb97e7e88618f8923e27ee4ce8eb4869f0847f8f4699f7c", + "verify_application.py": "f774304804e705ac576459cca725b348f09e67e6020fe6165df9b7d39c605c54" + }, + "surcharge_upper_strict": "1/549755813888", + "tested": "0.00389011517657", + "trial": "1945057638297/500000000000000", + "uniform_loss": "1/10000000000" +} diff --git a/research/p104-paired-delayed-cover/independent/PROOF.md b/research/p104-paired-delayed-cover/independent/PROOF.md new file mode 100644 index 0000000000..7a04070e74 --- /dev/null +++ b/research/p104-paired-delayed-cover/independent/PROOF.md @@ -0,0 +1,21 @@ +# One delayed-cover refinement on the exact #8027 word + +The starting point is Ali Romman's complete #8027, head `fb9b6a7b0d27da1cf98430893a3016bf811e2aa4`. Its registered replay passed at 0.00389011507650 before this one-case test. The independent price gives a BIT ordinary cap of **0.003890115176583** and a proposed complete claim of **0.00389011517650**. The signed consumer and expanded audit independently passed at this cap. Their outputs are authenticated by the registered replay. [Exact application](https://github.com/aliromman/integer-mult-bounds/blob/fb9b6a7b0d27da1cf98430893a3016bf811e2aa4/research/p104-live-relative-gain/verify_application.py) · [Predecessor PR](https://github.com/CrocSwap/integer-mult-bounds/pull/8027) + +## Source, uniform job, and fixed prime + +Read the 36-call full binary signed profile from the authenticated source. An independent 70-digit decimal interval reader checks the opposite endpoint signs of Σ(Tᵣ−Pᵣ)r^(1−κ) at 0.003890115286594 and 0.003890115286595. Decimal log and exp have correctly rounded results and each elementary or transcendental step is widened by one adjacent representable value. The separate registered peer replay establishes the actual word and native-supplier interfaces/derivative. The word, product and uniform compilation stay frozen at 768 factors, cutoff 15, productive floor 16, ambient factor 134 and original uniform debit e=10⁻¹⁰. The old trial is the lower raw endpoint less 10⁻¹¹. Set C₀=trial−e. Its original strict rank-one moment gives P/B2^45 N⁵ outside the actual catalogue's finite forbidden primes. Neither a different q nor a different catalogue is necessary. For variable N≥2^H, the numerical implication below applies whenever the chosen q still satisfies that N-specific bound; the peer's other components are certified only at its original N. The 451-factor proof's larger prime and all of its compiler constants are irrelevant here. + +The retained delayed-cover bridge §§5–7 covers each fully precompiled uniform job over fresh roles. Different leaves may have different inherited weights; within each recursive invocation its weight is independent of every fresh role and cover row. Its normalized good term is (P/B)N^(−τ). The *complete* fallback costs multiply it by at most 1+(2N³/q)(32N²). This multiplies the per-job moment for each level of the covered recurrence, including swaps, scalings, reversals, and previously paid child costs. It gives one exponent loss for that recurrence. It does not create one fresh multiplicative surcharge outside each of the four later ordinary bootstrap stages. Set d=1/(H·2³⁸), τ=1−C₀+d, so the good term is 1/2 by integration on the unit interval and exp(x)>1+x for x>0, Nᵈ≥exp(Hd ln2)>1+2⁻³⁹. The complete normalized moment is strictly <1. In particular no rounded integer horizon is used. The illustrative bridge shortcut q>256N⁵/d is a sufficient way to dominate the fallback; it is not used as an extra prime-selection premise. Zero debit fails the direct positive-loss guard. At the frozen d the old scalar shortcut 2⁻³⁹ 2^45*N^5 avoiding the frozen finite catalogue witnesses' and + h==base['binary_H'] and old['uniform']['N']==f'2^{h}',"same carrier and prime rule") + need(old['stock']['W']=='B*|GL_N(F_q)|*q^(N^2*(w-1))' and 'S_old' in old['stock']['reserve'] + and old['stock']['backend_levels']==4 and old['stock']['depth']=='2+ceil(log_N(n))',"stock and restoration invariant") + need(F(binary['delayed_cover_debit'])==F(1,h*2**38) and F(old['uniform']['gap'])==F(1,10**10) + and old['uniform']['preceding_integer_grid_fails'] and old['uniform']['logarithm_power']==623,"charged separate debits") + need(old['finite_product_bound_bit_lengths']==base['binary_product'] and old['raw_crossing']==base['binary_raw'],"original finite compiler") + cap=F(binary['admitted']);claim=F(app['claim']);tick=F(1,10**14);tested=claim+7*tick + need(cap==F(app['binary_ordinary'])==F(independent['cap'])==F(primary['candidate']['cap']) and + claim==F(independent['candidate'])==F(primary['candidate']['claim']),"independent paid and signed bind") + previous=F('0.00385248') + for s,row in zip(binary['candidate_stages'],independent['new_rows'],strict=True): + q=F(249,250)*F(binary['covered'])+previous/250 + new=F((q*10**15)//1-1,10**15) + need(new==F(s['claim'])==F(row['new']) and previous==F(s['previous']) and + min(q-new,F(1,250)-new,F(249,250)-new)==F(row['margin'])>0,"fully charged strict ordinary stage") + previous=new + need(previous==cap,"terminal acceptance") + caller=obj(a.peer/'CALLER-CENSUS.json');bank=obj(a.peer/'BANK-FACTORS-RECEIPT.json') + p=physical['native'];c=physical['caller_census'];actual=physical['application'] + need(all(c[k]==caller[k] for k in caller) and c['calls']==48,"exact fixed caller") + need(physical['caller']==physical['caller_proof']['readback']['event_stream_sha256']== + '156fdf3a4a129b39225fd6ca51011de27974d7f104e8b04907c17ed5344bc858',"signed caller/phase order") + invoice={} + for key,nkey,ckey in [('paid','paid_native_ranks','fixed_caller_paid'),('targets','positive_helper_ranks','fixed_root_targets')]: + tally=Counter({k:v*c['calls'] for k,v in p[nkey].items()}) + tally.update(c[ckey]);invoice[key]=dict(tally) + need(invoice[key]==actual['invoice'][key]==bank['paid' if key=='paid' else 'productive'],"three independent signed invoice sources") + need(p['retired_and_guards_restored'] and p['all_public_inputs_preserved_until_final_installs'] + and p['same_owner_complete_fixture_outputs']==p['exact_all_public_rows']==p['exact_source_columns']==bank['public']==1291, + "native restoration and public inputs") + need(p['coefficient_products']==bank['forward_terms']==base['rational_grid']['all_basis_products'] and bank['adjoint_terms']==88780788 and + p['minimum_product_grid']==int(bank['minimum_product_grid'])==base['rational_grid']['product_grid'],"basis, adjoint and grid") + need(base['rational_word']==bank['new_word'] and base['rational_layout']==bank['layout'],"literal word/layout") + need(actual['ordinary']['ordinary_elementary_record_upper']==base['ordinary']['ordinary_elementary_record_upper'] and + physical['common_depth_guards']==base['ordinary']['common_depth_guards'],"ordinary work and tape depth") + with tarfile.open(a.peer/'APPLICATION-SOURCES.tar.gz') as tar: + data=tar.extractfile('source/research/p104-dual-supplier-lift/complex/supplier_gate.py').read() + need(hashlib.sha256(data).hexdigest()=='3796b2e5a27f3caa142d16364154788e60d0099f1e24a8dcd028e4fbd35a84ca',"signed gate source") + with tempfile.TemporaryDirectory() as tmp: + path=Path(tmp)/'gate.py';path.write_bytes(data) + gate=runpy.run_path(str(path))['gate'] + gate.__globals__['BIT_PIN']=str(cap) + weights={'T':invoice['targets'],'P':invoice['paid']} + g=gate(weights,claim,tested,*base['rational_raw'],cap) + need(g==actual['compiler'] and g['outer']==base['outer'] and F(g['BIT_margin'])==cap-tested,"independent signed gate/54+4") + need(all(F(app['rational_raw'][i])==F(g['raw_bracket'][i]) for i in (0,1)),"retained raw endpoints") + need(g['outer']['strict_count']==54 and g['outer']['functional_count']==4 and F(g['outer']['minimum_margin'])>0,"complete gate") + def rejects(code): + try: + code() + except (AssertionError,ValueError): + return True + return False + damaged={'T':weights['T'],'P':dict(weights['P'])};damaged['P']['1']+=1 + need(rejects(lambda:gate(damaged,claim,tested,*base['rational_raw'],cap)),"unpaid rank control") + need(rejects(lambda:gate(weights,claim,tested,*base['rational_raw'],tested)),"strict below-cap negative") + need(claim>F(base['binary_raw'][1])-2*F(old['uniform']['gap']) and claim-F(base['claim'])==F(result['difference']),"strict historical separation") + output=dict(outcome='PASS_COMPLETE_INDEPENDENT_SIGNED_ACCEPTANCE',peer_head=result['peer_head'],price_receipts={'primary':sha(a.primary),'independent':sha(a.independent)}, + replay_receipt_sha256=sha(a.run/'REPLAY.json'),output_sha256=seen,changed_peer_summary_fields=sorted(changes), + cap=str(cap),claim=str(claim),tested=str(tested),gain=str(claim-F(base['claim'])),signed_checks=g['outer'],newly_checked_controls=['extra_rank_one','cap_equals_tested'], + native_calls_binary=app['binary_native']['calls'],native_calls_rational=c['calls'],paid_rational=sum(weights['P'].values()),productive_rational=sum(weights['T'].values()), + minimum_complete_stock_stage_margin=str(min(F(s['margin']) for s in independent['new_rows'])),caller_sha256=physical['caller'],premises=app['premises']) + with a.out.open('x') as stream: + json.dump(output,stream,sort_keys=True,indent=2);stream.write('\n') + print(output['outcome'],app['claim'],output['gain']) +if __name__=='__main__': + main() diff --git a/research/p104-paired-delayed-cover/independent/price.py b/research/p104-paired-delayed-cover/independent/price.py new file mode 100644 index 0000000000..4298249272 --- /dev/null +++ b/research/p104-paired-delayed-cover/independent/price.py @@ -0,0 +1,120 @@ +"""Reprice one authenticated 768-factor cover using independent interval and rational arithmetic.""" +from argparse import ArgumentParser +from collections import Counter +from decimal import Decimal, localcontext +from fractions import Fraction as F +from hashlib import sha256 +import json +from pathlib import Path +import tarfile + +PINS = { + "APPLICATION.json":"587ece477179606eed6fd9a334ac6d6e27f0067f82c3d6281993736e0570a76f", + "APPLICATION-SOURCES.tar.gz":"d85d011ca74e8592c21c1e4db91a1a9021af26dcebc4dfdc2af7251f9c1bf968", + "verify_application.py":"f774304804e705ac576459cca725b348f09e67e6020fe6165df9b7d39c605c54", + "BINARY-CANDIDATE.json.gz":"74e93daf2b7acf794ffb51f92f03f51556f68126d41ee13a8969bddb4cbe6326", + "WORD.json.gz":"731246c085638706bdb97e7e88618f8923e27ee4ce8eb4869f0847f8f4699f7c", +} +MEMBERS = { + "recipient/binary/finite.py":"c780cea060f4a9efef064b239636162a7e8e84e40369abc1a1c4679dfbeb3041", + "parent/binary/independent/price.py":"d720df6f3f7a22554e83d0c29243af3ee04fa036073404926bab7bc2f2687e1b", + "parent/qualify_complex.py":"236988674f4efe96134de83a224f9c5f4508f6049237415bc24a18669cf5ad67", + "source/research/paired-query-only-bit/retained/inputs/credited_trim.py":"fcff17fdd3108be68761fbde0fcbfe218be166cf518c99f7163e60d53ab785d9", + "recipient/continuation/audit_expanded.py":"0316153c1822724e1a3d08066aec9601a891073b0209954eaf302ffa014bf5ac", + "source/research/p104-dual-supplier-lift/complex/supplier_gate.py":"3796b2e5a27f3caa142d16364154788e60d0099f1e24a8dcd028e4fbd35a84ca", +} +BRIDGE = "9731b93026717f5fa15851e3633cbb4bdc76eba2bffb9d6b4a3b69f7dd502443" + +def need(ok, message): + if not ok: + raise ValueError(message) + +def moment(profile, exponent): + # Decimal exp and ln are correctly rounded nearest. Enclose each transcendental and + # each arithmetic operation separately. Negative counts reverse interval endpoints. + with localcontext() as ctx: + ctx.prec = 70 + lo = hi = Decimal(0) + t = Decimal(1) - Decimal(exponent) + for r, count in sorted(profile.items()): + if not count: + continue + log_r = Decimal(r).ln() + zlo = (t * log_r.next_minus()).next_minus().exp().next_minus() + zhi = (t * log_r.next_plus()).next_plus().exp().next_plus() + if count < 0: + zlo, zhi = zhi, zlo + lo = (lo + (count*zlo).next_minus()).next_minus() + hi = (hi + (count*zhi).next_plus()).next_plus() + return lo, hi + +def stages(covered): + old = F("0.00385248") + rho = F(1,250) + rows = [] + for _ in range(4): + envelope = (1-rho)*covered + rho*old + value = F(envelope * 10**15 // 1 - 1, 10**15) + margin = min(rho-value,1-rho-value,envelope-value) + need(margin > 0 and value > old, "strict three-term stage") + rows.append(dict(old=str(old), new=str(value), bound=str(envelope), margin=str(margin))) + old = value + return old, rows + +def dec(q, places): + scale = 10**places + need((q*scale).denominator == 1, "inexact decimal output") + return f"0.{int(q*scale):0{places}d}" + +def main(): + ap = ArgumentParser() + for field in ("peer","bridge","out"): + ap.add_argument("--"+field,type=Path,required=True) + a = ap.parse_args() + for name, expected in PINS.items(): + need(sha256((a.peer/name).read_bytes()).hexdigest()==expected,name) + with tarfile.open(a.peer/"APPLICATION-SOURCES.tar.gz") as t: + names=t.getnames() + need(len(names)==len(set(names)), "duplicate archive path") + for name, expected in MEMBERS.items(): + need(sha256(t.extractfile(name).read()).hexdigest()==expected,name) + need(sha256(a.bridge.read_bytes()).hexdigest()==BRIDGE, "cover theorem bytes") + app = json.loads((a.peer/"APPLICATION.json").read_text()) + native = app["binary_native"] + profile=Counter({int(k):v for k,v in native["productive_all"].items()}) + profile.subtract({int(k):v for k,v in native["paid_all"].items()}) + raw=app["binary_raw"] + need(raw==["0.003890115286594","0.003890115286595"],"endpoint pins") + signed=[moment(profile,k) for k in raw] + need(signed[0][0] > 0 > signed[1][1], "opposite directed signs") + h=app["binary_H"]; need(h==299610000000000,"original H") + gap=F(1,10**10); trial=F(raw[0])-F(1,10**11) + d=F(1,h*2**38) + excess_upper=F(64,2**45) + growth_lower=h*d/2 + need(growth_lower==excess_upper and d>0, "strict exp/log lower and strict prime upper meet") + need(0 < excess_upper and gap/4 > excess_upper and not excess_upper < d/4, "zero debit and stale shortcut controls") + need(native["calls"]==36 and native["ordinary"]["ordinary_records"]==896869203600 and + native["ordinary"]["owned_backing"]==6994188,"stock control") + old_cap, old_rows=stages(trial-2*gap) + cap, rows=stages(trial-gap-d) + need(old_cap==F(app["binary_ordinary"]), "known-good four-stage control") + qtick=10**14 + def grid(cap): + return F(min(int(F(app["rational_raw"][0])*qtick),int(cap*qtick))-8,qtick) + old=grid(old_cap); candidate=grid(cap); tested=candidate+F(7,qtick) + need(old==F(app["claim"]) and candidate>old and testedceiling,"strict separation even before charging the old seven ticks") + result=dict(source_pins=PINS,member_pins=MEMBERS,bridge_sha256=BRIDGE,raw=raw, + signed_intervals=[[str(x) for x in s] for s in signed],H=h,trial=str(trial), + uniform_loss=str(gap),delayed_cover_loss=str(d),surcharge_upper_strict=str(excess_upper), + power_growth_lower_strict=str(growth_lower),old_rows=old_rows,new_rows=rows, + old_cap=dec(old_cap,15),cap=dec(cap,15),old_claim=dec(old,14),candidate=dec(candidate,14), + tested=dec(tested,14),gain=str(candidate-old),percent_gain=str(100*(candidate-old)/old), + relaxed_old_ceiling=str(ceiling),separation=str(candidate-ceiling),signed_status="requires fresh full signed compiler and independent expansion") + with a.out.open("x") as stream: + json.dump(result,stream,indent=2,sort_keys=True);stream.write("\n") + print("PASS",result["cap"],result["candidate"],result["tested"],result["gain"],result["percent_gain"]) +if __name__=="__main__": + main() diff --git a/research/p104-paired-delayed-cover/normalized/PROOF.md b/research/p104-paired-delayed-cover/normalized/PROOF.md new file mode 100644 index 0000000000..e73d90b94d --- /dev/null +++ b/research/p104-paired-delayed-cover/normalized/PROOF.md @@ -0,0 +1,21 @@ +# Normalizing the charged log factor on the 768-factor fixed carrier + +One fixed scale h=1024 with p=623 and θ̄=42/43 passes on the exact #8027 word. The directed uniform loss is 23731/299610000000000. Repricing the four ordinary stages under the existing R347 cover gives cap 0.003890115197377, tested point 0.00389011519736 and complete-grid κ 0.00389011519729. The verified increase over the signed delayed-cover predecessor is 0.00000000002079, exactly (594/1111461479)%. The independent supplier proof and fresh complete signed replay both pass. + +Let t=1−0.003890115276594 and A=134^768. All original source-complement and exit batches, catalogue, prime, stock, routes and precision remain in force. The separated word has upper paid rank r=15^768 and retained floor k=16^768. The signed profile contains rank 64 and rank 8, so 256 copies of rank 64 and 512 copies of rank 8 attain the floor. The retained integer-flow lemma gives n/A2267000 because log₂ A>7·768. Concavity of log(1+x/h), vanishing at zero, bounds the full base range. The exact integer checks r^432Hp and ln 2>1/2. The proved upper bound covers the entire larger-width tail. At this same N and q the original bad-branch price surcharge is <2^-39. The frozen R347 debit d=1/(H·2^38) pays it since 2^(Hd)>1+Hd/2. No new prime, transport or physical operation enters. + +Under the predecessor’s all-size services, each ordinary bootstrap uses its existing atom width and restored stock, prices (249/250)·covered+previous/250 and admits its 10^-15 floor less one tick. All four exact rational envelopes are in the receipt. Replaying the old 10^-10 uniform debit recovers each R347 admission and complete pair of grid checks. The old proof's relaxed ceiling 0.003890115186595 gives it the raw *upper* endpoint and forgives the trial, cover, stage and signed-grid losses. The new complete claim exceeds that ceiling by 0.000000000010695. Thus the comparison certifies a stronger sufficient price on an identical native crossing. The new measure tightens only the full paid-leaf bound. [#8027 source and complete application](https://github.com/aliromman/integer-mult-bounds/tree/fb9b6a7b0d27da1cf98430893a3016bf811e2aa4/research/p104-live-relative-gain) + +Run the complete clean replay from the repository root under CPython 3.12. + +```sh +python3.12 -IB scripts/research_package.py --package research/p104-paired-delayed-cover +``` + +The primary arithmetic case took 0.035 seconds under its 30-second cap. The independent signed acceptance reconstructed the invoice, checked the exact old and new admissions, and rejected one extra paid rank-one operation, cap equality and J−1. Only h=1024, p=623 advanced to a construction. Native action on all columns, owned erasure, compiler realization, precision and tape, and analytic recovery remain conditional. [Signed application](application/RESULT.json) · [Independent acceptance](independent/ACCEPT.json) + +Ali Romman supplied #8027’s literal circuits, Jacob Alan Sussman the exact finite flow, DreamingOfClouds the ambient cap, and zxv the normalized induction in #4480. The earlier #8026 contribution applied normalization on the different 451-factor word. The fixed-carrier cover proof in this package supplies the certified fallback debit. Clear1nsight’s independent signed pricing and peer replay are inherited. OpenAI Codex materially assisted the proof and replay. [Shifted-log induction](https://github.com/CrocSwap/integer-mult-bounds/blob/4cf054a50c5718616594ec4ca2c9114278120a8b/research/net-tax-rank-compiler/SHIFTED-LOG.md) diff --git a/research/p104-paired-delayed-cover/normalized/application/RESULT.json b/research/p104-paired-delayed-cover/normalized/application/RESULT.json new file mode 100644 index 0000000000..6d665a00b2 --- /dev/null +++ b/research/p104-paired-delayed-cover/normalized/application/RESULT.json @@ -0,0 +1,48 @@ +{ + "caller": "156fdf3a4a129b39225fd6ca51011de27974d7f104e8b04907c17ed5344bc858", + "cap": "0.003890115197377", + "claim": "0.00389011519729", + "controls": [ + "original_peer_stock_and_signed_gate", + "R347_four_stages_and_signed_gate", + "h512_optimistic_price_excluded", + "terminal_J_minus_one_rejected", + "below_effective_cap_rejected", + "one_extra_rank_one_paid_rejected" + ], + "difference": "2079/100000000000000", + "independent_sha256": "523d6dc93a7cd34bf6183a66d03b624ab2f0dfcf18b7e95032b7d0ab695fa24f", + "old_claim": "0.00389011517650", + "old_relaxed_ceiling": "778023037319/200000000000000", + "outer": { + "BIT_just_below_effective_rejected": true, + "functional_count": 4, + "minimum_margin": "1/1000000000000000", + "strict_count": 54 + }, + "output_sha256": { + "APPLICATION.json": "f2541214cdd21df7f26855442cfe539f21bf68224fcb55565c453693ca884068", + "BINARY.json": "f7837fde586911e94b52cd9459bc8a0d732585a3eee7745b901e92db3ae34426", + "PHYSICAL.json": "33423aecb542c596dc7febdc69d8b1511a60ce92fb77ccb914345000df73d73b" + }, + "peer_head": "fb9b6a7b0d27da1cf98430893a3016bf811e2aa4", + "percent_gain": "594/1111461479", + "premises": [ + "native_all_columns", + "owned_erasure", + "compiler", + "precision_tape", + "analytic_recovery" + ], + "primary_sha256": "ef3f829625b03c09f1cdff2440ef92b9869b4cb4d0821bf9c0fd5910c9d6ad3c", + "prior_adapter_sha256": "d6dd8f406e4e09377b2539a744ada909d3ab44baefdec17d0af450d6e867f051", + "prior_receipt_sha256": "419d4bdfb95c4484d0ddc81f34c89ee45bdefc0955a85dd496c1043396260e37", + "rational_raw": [ + "0.00389848144654", + "0.00389848144655" + ], + "source_archive": "d85d011ca74e8592c21c1e4db91a1a9021af26dcebc4dfdc2af7251f9c1bf968", + "source_count": 134, + "strict_separation": "2139/200000000000000", + "tested": "0.00389011519736" +} diff --git a/research/p104-paired-delayed-cover/normalized/application/replay.py b/research/p104-paired-delayed-cover/normalized/application/replay.py new file mode 100644 index 0000000000..ef23059707 --- /dev/null +++ b/research/p104-paired-delayed-cover/normalized/application/replay.py @@ -0,0 +1,149 @@ +# SPDX-License-Identifier: Apache-2.0 +"""Replay a certified normalized supplier against the original signed #8027 application.""" +from argparse import ArgumentParser +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 + + +ADAPTER = "d6dd8f406e4e09377b2539a744ada909d3ab44baefdec17d0af450d6e867f051" +PREVIOUS = "419d4bdfb95c4484d0ddc81f34c89ee45bdefc0955a85dd496c1043396260e37" +PRIMARY = "ef3f829625b03c09f1cdff2440ef92b9869b4cb4d0821bf9c0fd5910c9d6ad3c" +INDEPENDENT = "523d6dc93a7cd34bf6183a66d03b624ab2f0dfcf18b7e95032b7d0ab695fa24f" + + +def check(flag, message): + if not flag: + raise ValueError(message) + + +def read(path, pin): + data = path.read_bytes() + check(sha256(data).hexdigest()==pin, "input SHA-256 "+path.name) + return json.loads(data) + + +def previous_adapter(path): + check(sha256(path.read_bytes()).hexdigest()==ADAPTER,"R347 adapter") + spec=importlib.util.spec_from_file_location("fixed_cover_adapter",path) + module=importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + return module + + +def pair(primary, independent, prior, historical, baseline): + case=independent["case"] + case_keys=("p","h","J","H","theta") + check(all(case[k]==primary[k] for k in case_keys),"both source certificates") + p,h,J,H=(case[k] for k in case_keys[:4]) + check((p,h,J,H,case["v"],case["theta"])==(623,1024,23731,299610000000000,768,"42/43"),"frozen case") + trial=Q(primary["trial"]) + debit=Q(historical["delayed_cover_debit"]) + loss=Q(J,H) + cap=Q(primary["candidate"]["cap"]) + covered=trial-loss-debit + check(trial==Q(case["C"])==Q(historical["peer_finite"]["tested_saving"]) + and debit==Q(1,H*2**38)==Q(primary["cover_loss"])==Q(independent["cover_loss"]) + and loss==Q(primary["uniform_loss"])==Q(independent["uniform_loss"]) + and covered==Q(primary["candidate"]["covered"])==Q(independent["covered"]),"only uniform debit changed") + need=(H+h)**p + check(h**p*2**(J-1)<=need 512**p*2**(39*p) + and trial-Q(39*p,H)Q(1,10**11) + and claim-Q(prior["claim"])==Q(independent["gap_vs_old"])==Q(primary["absolute_gain"]), + "signed grid and previous ceiling") + return cap + + +def main(): + cli=ArgumentParser(description=__doc__) + for name in ("peer-package","prior-package","prior-run","primary","independent","out"): + cli.add_argument("--"+name,required=True,type=Path) + a=cli.parse_args() + check(sys.version_info[:2]==(3,12) and sys.implementation.name=="cpython" and __debug__,"CPython 3.12") + old=previous_adapter(a.prior_package/"application/replay.py") + s=read(a.prior_run/"REPLAY.json",PREVIOUS) + old_app=read(a.prior_run/"APPLICATION.json",s["output_sha256"]["APPLICATION.json"]) + old_bit=read(a.prior_run/"BINARY.json",s["output_sha256"]["BINARY.json"]) + old_primary=read(a.prior_package/"primary/PRICE.json",old.PRIMARY) + old_audit=read(a.prior_package/"independent/PRICE.json",old.INDEPENDENT) + primary=read(a.primary,PRIMARY) + independent=read(a.independent,INDEPENDENT) + a.out.mkdir(exist_ok=False) + with TemporaryDirectory() as tmp: + work=Path(tmp) + peer=old.peer_copy(work/"peer-code",a.peer_package) + base=peer.read("APPLICATION.json") + check(old.certify(old_primary,old_audit,base)==Q(s["cap"]),"R347 and #8027 control prices") + cap=pair(primary,independent,s,old_bit,base) + package=peer.source_tree(work,base) + original=old.normalize(old.binary(peer,work,package,base,old_primary)) + check(original==old_bit,"fresh original stock, signed 36-call bill, prior four-stage bootstrap") + c=primary["candidate"] + engine=sys.modules["binary_price"] + admission,four=engine.bootstrap(Q(primary["seed"]),Q(c["covered"]),[i["admitted"] for i in c["stages"]]) + check(admission==cap,"full peer bootstrap on new certified covered price") + old.save(a.out/"BINARY.json",dict(prior_binary_sha256=s["output_sha256"]["BINARY.json"], + peer_finite=original["peer_finite"], delayed_cover_debit=original["delayed_cover_debit"], + uniform_loss=primary["uniform_loss"], covered=c["covered"], candidate_stages=four, admitted=c["cap"])) + print("PASS normalized source, stock and native 36-call bill",flush=True) + new_app=dict(base,binary_ordinary=c["cap"],claim=c["claim"]) + word,layout,physical=peer.rational_application(work,package,new_app,cap) + physical=old.normalize(physical) + old_physical=read(a.prior_run/"PHYSICAL.json",s["output_sha256"]["PHYSICAL.json"]) + for key in ("caller","caller_proof","caller_census","native","conversion","compiler_controls","common_root"): + check(physical[key]==old_physical[key],"unchanged physical "+key) + for key in ("invoice","ordinary","bracket"): + check(physical["application"][key]==old_physical["application"][key],"unchanged signed "+key) + check(physical["caller_census"]["calls"]==base["rational_calls"]==48 + and physical["caller_proof"]["readback"]["event_stream_sha256"]==physical["caller"]==s["caller"], + "signed caller and all readback phases") + del old_physical + control=old.outer_prices(peer,work,base,old_app,physical) + check(control["H"]==old_app["H"] and control["outer"]==old_app["outer"],"original #8027 and R347 outer bills") + new=old.outer_prices(peer,work,old_app,new_app,physical) + new_app.update(H=new["H"],outer=new["outer"]) + peer.audit(work,package,new_app,cap,word,layout,physical) + check(new["outer"]["BIT_just_below_effective_rejected"] and new["outer"]["strict_count"]==54 + and new["outer"]["functional_count"]==4 and s["premises"]==new_app["premises"],"complete signed controls") + old.save(a.out/"APPLICATION.json",new_app) + old.save(a.out/"PHYSICAL.json",physical) + files=("APPLICATION.json","BINARY.json","PHYSICAL.json") + old.save(a.out/"REPLAY.json",dict(peer_head=old.HEAD,source_archive=base["source_archive"],source_count=base["source_count"], + prior_receipt_sha256=PREVIOUS,prior_adapter_sha256=ADAPTER,primary_sha256=PRIMARY,independent_sha256=INDEPENDENT, + cap=c["cap"],tested=c["tested"],claim=c["claim"],old_claim=s["claim"],difference=primary["absolute_gain"], + percent_gain=primary["relative_percent"],old_relaxed_ceiling=primary["old_relaxed_ceiling"], + strict_separation=primary["separation"],outer=new["outer"],caller=physical["caller"], + rational_raw=new_app["rational_raw"],premises=new_app["premises"], + controls=["original_peer_stock_and_signed_gate","R347_four_stages_and_signed_gate","h512_optimistic_price_excluded", + "terminal_J_minus_one_rejected","below_effective_cap_rejected","one_extra_rank_one_paid_rejected"], + output_sha256={name:sha256((a.out/name).read_bytes()).hexdigest() for name in files})) + print("PASS_COMPLETE_NORMALIZED_768_APPLICATION",c["claim"],c["tested"],primary["absolute_gain"],flush=True) + + +if __name__=="__main__": + main() diff --git a/research/p104-paired-delayed-cover/normalized/independent/ACCEPT.json b/research/p104-paired-delayed-cover/normalized/independent/ACCEPT.json new file mode 100644 index 0000000000..ccff04c684 --- /dev/null +++ b/research/p104-paired-delayed-cover/normalized/independent/ACCEPT.json @@ -0,0 +1,84 @@ +{ + "caller": "156fdf3a4a129b39225fd6ca51011de27974d7f104e8b04907c17ed5344bc858", + "cap": "0.003890115197377", + "claim": "0.00389011519729", + "gain_vs_peer": "12079/100000000000000", + "gain_vs_previous": "2079/100000000000000", + "invoice": { + "P": { + "1": 183312, + "16": 1248, + "2": 38016, + "24": 1248, + "3": 23040, + "32": 1248, + "4": 10848, + "40": 1248, + "48": 1248, + "5": 15072, + "56": 1248, + "6": 1968, + "7": 480, + "8": 1344 + }, + "T": { + "1": 1008, + "129": 624, + "17": 1248, + "2": 432, + "25": 1248, + "3": 480, + "33": 1248, + "4": 11568, + "41": 1248, + "49": 1248, + "5": 1584, + "57": 1248, + "6": 48, + "65": 1248, + "7": 672, + "8": 1584, + "9": 25872 + } + }, + "known_good": [ + "8027", + "R347" + ], + "minimum_ordinary_slack": "22297949782149841/21446919192576000000000000000000", + "native_calls": [ + 36, + 48 + ], + "outcome": "PASS_COMPLETE_INDEPENDENT_NORMALIZED_ACCEPTANCE", + "outer": { + "BIT_just_below_effective_rejected": true, + "functional_count": 4, + "minimum_margin": "1/1000000000000000", + "strict_count": 54 + }, + "outputs": { + "APPLICATION.json": "f2541214cdd21df7f26855442cfe539f21bf68224fcb55565c453693ca884068", + "BINARY.json": "f7837fde586911e94b52cd9459bc8a0d732585a3eee7745b901e92db3ae34426", + "PHYSICAL.json": "33423aecb542c596dc7febdc69d8b1511a60ce92fb77ccb914345000df73d73b" + }, + "peer_head": "fb9b6a7b0d27da1cf98430893a3016bf811e2aa4", + "percent_vs_peer": "24158/7780230153", + "percent_vs_previous": "594/1111461479", + "premises": [ + "native_all_columns", + "owned_erasure", + "compiler", + "precision_tape", + "analytic_recovery" + ], + "previous_ceiling_separation": "2139/200000000000000", + "prior_replay_sha256": "419d4bdfb95c4484d0ddc81f34c89ee45bdefc0955a85dd496c1043396260e37", + "rejections": [ + "J_minus_one", + "extra_paid_rank_one", + "cap_equals_tested" + ], + "replay_sha256": "9b00a17913efb76995b01c7b75f5b00aab394a0531e26490ab02a5940adcac3c", + "tested": "0.00389011519736" +} diff --git a/research/p104-paired-delayed-cover/normalized/independent/PRICE.json b/research/p104-paired-delayed-cover/normalized/independent/PRICE.json new file mode 100644 index 0000000000..a1526acbf9 --- /dev/null +++ b/research/p104-paired-delayed-cover/normalized/independent/PRICE.json @@ -0,0 +1,91 @@ +{ + "beyond_preregistered_guard": "139/200000000000000", + "cap": "0.003890115197377", + "case": { + "C": "1945057638297/500000000000000", + "H": 299610000000000, + "J": 23731, + "h": 1024, + "p": 623, + "theta": "42/43", + "v": 768 + }, + "claim": "0.00389011519729", + "cover_loss": "1/82356169699491840000000000", + "covered": "1001171835458229660421190603/257363030310912000000000000000", + "eta_lower": "4.398968020952745468073360037317371236241236990403183015991193117603978E-7", + "gap_vs_old": "2079/100000000000000", + "lower_shift_ratio": "1924455698166975067024035047787941203328663165473300536929057004549844530468518471380017924056855054678873213672159394293501357756329079470663483346438332230791496973144604649642258208047855220620578706051034346886494439997415939146366252661127437441972778597657415374474166279060123719647369917446312514536560870065042606482737325498119607501225788530216295779624579575779187044841969679965482593415318457417003954404309990227266113260887378154994666097366602516735797136115722270135590704012255293474077731727656002145985019960061133122628197362549421150451694171135642537279384456409361240267500154292099173186123581747892222448573290056170045711327816039167707225037300343425120000586333563838426770429640651550793781839319700810636431341131832866581515332383954991065707143049696601673421288445949871757338478406640442493146835932161066588090117257794122996917150537306380717328428522657681980661054223005764179187777037102154865456986849706191188710684059845304031102560975772807938467054529489578269605888/4475564558729955636045719165123281750201893728690542638040509869981026635884428559292604903238832976275980382900922049248029910599036065310666012152706588219353113625311554572304947785148888486734154736536356512479551944233976192819772377978013013932605506819367727275407050940032643147080282595319470902626356163217595197021987089036592276422159995540288684724768056283921676756677294794927054593192057025824583420209282678412056160004234840919417789294615146088259432323940022993303238704061742885712560293307701039982234846149951829879800880634282986521993890253440386370910429069276218964971186449354086843301095448113933084100148781432328292528845257196954826342800006558661807467465614567723797892742526876289225315126931725069865311852546378625105910763769593945059528591556101361712157014034863981051647466945146892862415184626420610884924324333851960965266558001919576183942075319202053463534611182699834285697217538651882038106731778537659533988654098945573140788065932098535895992989536010088525661857277507", + "new_stages": [ + { + "bound": "83427757652037122568878820049/21446919192576000000000000000000", + "cap": "3889964656597/1000000000000000", + "previous": "12039/3125000", + "slack": "24614217054948049/21446919192576000000000000000000" + }, + { + "bound": "83430973373641111848366115537/21446919192576000000000000000000", + "cap": "3890114595223/1000000000000000", + "previous": "3889964656597/1000000000000000", + "slack": "32935621701667537/21446919192576000000000000000000" + }, + { + "bound": "83430986236527494519865477841/21446919192576000000000000000000", + "cap": "1945057597489/500000000000000", + "previous": "3890114595223/1000000000000000", + "slack": "22297949782149841/21446919192576000000000000000000" + }, + { + "bound": "83430986287979082601239153361/21446919192576000000000000000000", + "cap": "3890115197377/1000000000000000", + "previous": "1945057597489/500000000000000", + "slack": "22726888166001361/21446919192576000000000000000000" + } + ], + "old_cap": "0.003890115176583", + "old_claim": "0.00389011517650", + "old_relaxed_ceiling": "778023037319/200000000000000", + "old_stages": [ + { + "bound": "83427757207860194751150820049/21446919192576000000000000000000", + "cap": "1944982317943/500000000000000", + "previous": "12039/3125000", + "slack": "34829796768484049/21446919192576000000000000000000" + }, + { + "bound": "83430972927687435457048349393/21446919192576000000000000000000", + "cap": "389011457443/100000000000000", + "previous": "1944982317943/500000000000000", + "slack": "25050001616669393/21446919192576000000000000000000" + }, + { + "bound": "83430985790566783539052546769/21446919192576000000000000000000", + "cap": "486264396773/125000000000000", + "previous": "389011457443/100000000000000", + "slack": "28824659394562769/21446919192576000000000000000000" + }, + { + "bound": "16686197168403657166549890397/4289383838515200000000000000000", + "cap": "3890115176583/1000000000000000", + "previous": "486264396773/125000000000000", + "slack": "5833562020328797/4289383838515200000000000000000" + } + ], + "percent_vs_old": "594/1111461479", + "pins": { + "AMBIENT.md": "95cc9e31bc030ec94b04decddcca2d28ee98cfec0ca7803b54666b2b76a5c9ab", + "APPLICATION-SOURCES.tar.gz": "d85d011ca74e8592c21c1e4db91a1a9021af26dcebc4dfdc2af7251f9c1bf968", + "APPLICATION.json": "587ece477179606eed6fd9a334ac6d6e27f0067f82c3d6281993736e0570a76f", + "BINARY.json": "f4aad2d07449c864479f26cc3b3ed4bbd8321f0ca14e1efc8676b28b54c27ed4", + "REPLAY.json": "419d4bdfb95c4484d0ddc81f34c89ee45bdefc0955a85dd496c1043396260e37", + "SHIFTED-LOG.md": "04eba2e0a2a6cdd4ee512254142cbe45e647a73b66ad67b2c1c0a62e0883238a", + "accept.json": "babc9a23a60da353403b4d6f0a3a346c0523a42645618890a592929747fb019a" + }, + "separation": "2139/200000000000000", + "small_ranks": "0..134^768", + "status": "PASS uniform proof and complete price; fresh signed application required", + "tail_derivative_positive": true, + "terminal_lower_fails": true, + "tested": "0.00389011519736", + "uniform_loss": "23731/299610000000000" +} diff --git a/research/p104-paired-delayed-cover/normalized/independent/PROOF.md b/research/p104-paired-delayed-cover/normalized/independent/PROOF.md new file mode 100644 index 0000000000..485c8c9f30 --- /dev/null +++ b/research/p104-paired-delayed-cover/normalized/independent/PROOF.md @@ -0,0 +1,19 @@ +# One normalized leaf bound at the fixed #8027 carrier + +**Component outcome.** At fixed h=1024, p=623, θ̄=42/43 and H=299610000000000, the least integer uniform charge numerator is **J=23731**. Keeping R347's positive cover debit gives cap 0.003890115197377, tested 0.00389011519736 and a complete κ of 0.00389011519729. This exceeds R347 by 0.00000000002079, exactly (594/1111461479) percent. Independent full signed replay and invoice reconstruction passed at this cap. [Original construction](https://github.com/CrocSwap/integer-mult-bounds/pull/8027) · [zxv’s normalized induction](https://github.com/CrocSwap/integer-mult-bounds/blob/4cf054a50c5718616594ec4ca2c9114278120a8b/research/net-tax-rank-compiler/SHIFTED-LOG.md) + +**Complete jobs and available credit.** Write v=768, A=134^v, r=15^v, k=16^v, C=0.003890115276594, t=1−C. The authenticated #8027 tensors retain all paid slabs and all original work on discarded productive outputs. Their strict normalized t-moment surplus is positive in both compiler readers. All product targets below k are surrendered. The minimum remaining rank is attained since 256 rank-64 and 512 rank-8 factors have positive multiplicity and their product is k. For any input n≥A, the inherited integer fixed-batch construction pairs all internal demands, leaves separate matched-array exits, and normalizes its complement and exit counts by the same total number of productive source jobs. For source ranks n/A7v>h and log₂ A<8v. Thus A^(1−t)<2^(8vC)<2^p1/A, the inequality 1−(1−y)^t≥ty≥t A^(t−1)y^t yields a complementary budget ≥ηU(n)Σwₛsᵗ, including s=n, for η=t A^(t−1). An independent 70-decimal outward logarithm/exponential calculation proves η>4.398968020952745468073360037317371236241236990403183015991193117603978·10⁻⁷ and independently verifies θ̄^623 is below this lower bound. Both estimates agree with the original fixed compiler's enclosure. Strong integer induction gives L(n)≤F(n) for all n. No extra volume factor survives that recurrence. + +**Terminal threshold and all larger widths.** The exact integer check h^p·2^(J−1)≤(h+H)^p2Hp and ln2>1/2 imply D′(x)>0. Thus F(n)2⁴⁸ implies J>39p; even granting free cover and downstream work then misses the preregistered price. Other integer h remain untested. + +**Same stock and four fully charged stages.** At the attained N=2^H, the existing prime q>2^45 N⁵ avoiding the original finite catalogue gives full fallback multiplier <1+2⁻³⁹. The fixed d=1/(H·2³⁸) gives Nᵈ>1+2⁻³⁹. Only the proof bound on P/B changes. The same word and fresh-role schedule retain B, N, q, W(w)^D S_old, nested seed, full restoration and unchanged tape/precision. All ordinary stores, gauges, routes, specialization and retained calls remain as in #8027. From b₀=0.00385248, four stages price (249/250)(C−J/H−d)+bᵢ₋₁/250, taking the floor at 10⁻¹⁵ less one unit. At each stage the checker also charges the separate 1/250 and 249/250 root bounds. All minimum stage slacks are strictly positive, allowing new fixed proof thresholds with finite constants on the previous physical dispatch. The rational route debits eight 10⁻¹⁴ ticks before reporting, seven of which are added to reach the tested point. All 36/48-call contracts and five physical premises remain in force. + +Giving the R347 proof its raw upper and waiving every cost except its 10⁻¹⁰ uniform loss gives 0.003890115186595. The complete point clears that ceiling by 0.000000000010695 and clears the additional 10⁻¹¹ selection requirement by 0.000000000000695. The original raw crossing does not move. The predecessor good control reconstructs R347's complete cap, claim and tested point from its own debit and signed result. + +**Receipt.** One frozen arithmetic case took 0.089 seconds under a 30-second external limit, with 10 seconds reserved for checks. No other power, cutoff, word, or signed case was numerically searched. The program takes explicit --peer-application, --peer-archive, --binary, --signed, --accepted, --ambient-proof, --shift-proof and --out paths under CPython 3.12. Source pins in receipt.json use distinct canonical filenames. The two prose proof dependencies are immutable #4480 and ambient §6. The registered command rebuilds the signed application and independently authenticates its complete outputs against this price. [Signed acceptance](ACCEPT.json) + +Ali Romman supplied #8027's changed word and composed application. Clear1nsight supplied prior price and independent replay. Jacob Alan Sussman supplied the integer fixed-batch flow, DreamingOfClouds the ambient-cap extension, and zxv the normalized-log estimate. Earlier #8026 replayed that structural bound on a different 451-factor word. R347 supplied the newly bound complete 768-factor same-prime cover. OpenAI Codex assisted with proof and verifier development. diff --git a/research/p104-paired-delayed-cover/normalized/independent/accept.py b/research/p104-paired-delayed-cover/normalized/independent/accept.py new file mode 100644 index 0000000000..b59a4bbab4 --- /dev/null +++ b/research/p104-paired-delayed-cover/normalized/independent/accept.py @@ -0,0 +1,158 @@ +# SPDX-License-Identifier: Apache-2.0 +"""Check the fixed normalized proof, saved physical data and original signed supplier gate.""" +from argparse import ArgumentParser +from collections import Counter +from fractions import Fraction as Q +from hashlib import sha256 +import json +from pathlib import Path +import runpy +import sys +from tarfile import open as open_tar +from tempfile import TemporaryDirectory + + +def check(truth, label): + if not truth: + raise ValueError(label) + + +def digest(data): + return sha256(data).hexdigest() + + +def unique(items): + result = dict(items) + check(len(result) == len(items), "repeated JSON key") + return result + + +def read(path, expected): + data = path.read_bytes() + check(digest(data) == expected, path.name + " digest") + return json.loads(data, object_pairs_hook=unique) + + +def load_run(root, receipt): + result = read(root / "REPLAY.json", receipt) + files = result["output_sha256"] + return (result, *(read(root / name, files[name]) for name in + ("BINARY.json", "PHYSICAL.json", "APPLICATION.json"))) + + +def differences(first, second): + return sorted(k for k in first.keys() | second.keys() if first.get(k) != second.get(k)) + + +def require_rejection(operation): + try: + operation() + except (AssertionError, ValueError): + return + raise ValueError("expected gate rejection") + + +def verify(args): + base = read(args.peer / "APPLICATION.json", "587ece477179606eed6fd9a334ac6d6e27f0067f82c3d6281993736e0570a76f") + bank = read(args.peer / "BANK-FACTORS-RECEIPT.json", "bdb3052152bdd15ae36c30c98877dcebf864fc2c58a7b1fa66f2d5affa149288") + census = read(args.peer / "CALLER-CENSUS.json", "6a685bdc50aeba01a79fa437490190568513d62e0765844e7f3e8fa29a913e16") + prior_digest = "419d4bdfb95c4484d0ddc81f34c89ee45bdefc0955a85dd496c1043396260e37" + new_digest = "9b00a17913efb76995b01c7b75f5b00aab394a0531e26490ab02a5940adcac3c" + prior, prior_bit, old_physical, old_app = load_run(args.prior_run, prior_digest) + final, bit, physical, app = load_run(args.run, new_digest) + primary = read(args.primary, "ef3f829625b03c09f1cdff2440ef92b9869b4cb4d0821bf9c0fd5910c9d6ad3c") + indep = read(args.independent, "523d6dc93a7cd34bf6183a66d03b624ab2f0dfcf18b7e95032b7d0ab695fa24f") + check(final["prior_receipt_sha256"] == prior_digest and final["peer_head"] == prior["peer_head"], "previous supplier") + check(bit["peer_finite"] == prior_bit["peer_finite"] and + bit["prior_binary_sha256"] == prior["output_sha256"]["BINARY.json"], "actual stock and original 36 calls") + check(differences(app, old_app) == differences(app, base) == ["binary_ordinary", "claim"], "physical application invariant") + check(differences(physical, old_physical) == ["application"] and + differences(physical["application"], old_physical["application"]) == ["claim", "compiler"], "exact physical change scope") + case = indep["case"] + H, h, p, J = (case[k] for k in ("H", "h", "p", "J")) + check((H,h,p,J) == (299610000000000,1024,623,23731) and + h**p * 2**(J-1) <= (h+H)**p < h**p * 2**J and + (h+H)*J > 2*H*p and 15**43 < 16**42 and + 2**h * 15**(768*43) <= 134**(768*42) and + Q(42,43)**p < Q(indep["eta_lower"]), "all-height uniform bounds and adjacent failed J") + loss = Q(J, H) + cover = Q(1, H*2**38) + covered = Q(case["C"])-loss-cover + check(Q(bit["uniform_loss"]) == Q(primary["uniform_loss"]) == Q(indep["uniform_loss"]) == loss and + Q(bit["delayed_cover_debit"]) == Q(prior_bit["delayed_cover_debit"]) == cover and + Q(bit["covered"]) == Q(indep["covered"]) == covered, "charged uniform + inherited cover") + previous = Q("0.00385248") + slacks = [] + check(len(bit["candidate_stages"]) == 4, "four stock stages") + for emitted, separate in zip(bit["candidate_stages"], indep["new_stages"], strict=True): + envelope = (249*covered + previous)/250 + cap = Q((envelope*10**15)//1 - 1, 10**15) + slack = min(envelope-cap,Q(1,250)-cap,Q(249,250)-cap) + check(previous == Q(emitted["previous"]) == Q(separate["previous"]) and cap == Q(emitted["claim"]) == Q(separate["cap"]) and + Q(separate["bound"]) == envelope and Q(separate["slack"]) == slack > 0, "literal ordinary stage") + slacks.append(slack) + previous = cap + check(cap == Q(app["binary_ordinary"]) == Q(bit["admitted"]) == Q(primary["candidate"]["cap"]) == Q(indep["cap"]), "complete BIT") + native = physical["native"] + actual = physical["application"] + check(all(physical["caller_census"][k] == census[k] for k in census) and census["calls"] == 48 and + physical["caller"] == physical["caller_proof"]["readback"]["event_stream_sha256"] == final["caller"] and + app["binary_native"]["calls"] == 36, "caller chronology and population") + check(native["retired_and_guards_restored"] and native["all_public_inputs_preserved_until_final_installs"] and + native["same_owner_complete_fixture_outputs"] == native["exact_source_columns"] == native["exact_all_public_rows"] == bank["public"], "ownership and recovery") + invoice = {} + for key, local, caller, reference, emitted in ( + ("T","positive_helper_ranks","fixed_root_targets","productive","targets"), + ("P","paid_native_ranks","fixed_caller_paid","paid","paid"), + ): + tally = Counter({r:n*census["calls"] for r,n in native[local].items()}) + tally.update(census[caller]) + check(dict(tally) == bank[reference] == actual["invoice"][emitted], "reconstructed "+key) + invoice[key] = dict(tally) + archive = args.peer / "APPLICATION-SOURCES.tar.gz" + check(digest(archive.read_bytes()) == base["source_archive"], "original source bundle") + with open_tar(archive) as packed: + source = packed.extractfile("source/research/p104-dual-supplier-lift/complex/supplier_gate.py").read() + check(digest(source) == "3796b2e5a27f3caa142d16364154788e60d0099f1e24a8dcd028e4fbd35a84ca", "original gate") + with TemporaryDirectory() as work: + gate_file = Path(work)/"gate.py" + gate_file.write_bytes(source) + gate = runpy.run_path(str(gate_file))["gate"] + tick = Q(1,10**14) + def signed(summary, weights, admission): + claim = Q(summary["claim"]) + gate.__globals__["BIT_PIN"] = str(Q(summary["binary_ordinary"])) + return gate(weights,claim,claim+7*tick,*summary["rational_raw"],admission) + for summary in (base,old_app,app): + g = signed(summary,invoice,Q(summary["binary_ordinary"])) + check(g["outer"] == summary["outer"] and g["H"] == summary["H"], "historical and current signed gates") + check(g == actual["compiler"] and g["outer"]["strict_count"] == 54 and g["outer"]["functional_count"] == 4, "complete signed receipt") + claim, tested = Q(app["claim"]), Q(final["tested"]) + check(claim == Q(indep["claim"]) == Q(primary["candidate"]["claim"]) and tested == claim+7*tick < cap, "signed endpoints") + damaged = {"T":invoice["T"], "P":dict(invoice["P"])} + damaged["P"]["1"] += 1 + require_rejection(lambda: signed(app,damaged,cap)) + require_rejection(lambda: signed(app,invoice,tested)) + gain = claim - Q(old_app["claim"]) + peer_gain = claim - Q(base["claim"]) + gap = claim - (Q(base["binary_raw"][1]) - Q(1,10**10)) + check(gain == Q(final["difference"]) == Q(indep["gap_vs_old"]) and gap == Q(indep["separation"]) > Q(1,10**11), "strict prior ceiling") + return dict(outcome="PASS_COMPLETE_INDEPENDENT_NORMALIZED_ACCEPTANCE",peer_head=final["peer_head"],prior_replay_sha256=prior_digest, + replay_sha256=new_digest,outputs=final["output_sha256"],invoice=invoice,caller=physical["caller"],native_calls=[36,48], + cap=final["cap"],claim=app["claim"],tested=final["tested"],gain_vs_previous=str(gain),percent_vs_previous=str(100*gain/Q(old_app["claim"])), + gain_vs_peer=str(peer_gain),percent_vs_peer=str(100*peer_gain/Q(base["claim"])),previous_ceiling_separation=str(gap), + minimum_ordinary_slack=str(min(slacks)),outer=g["outer"],known_good=["8027","R347"],rejections=["J_minus_one","extra_paid_rank_one","cap_equals_tested"], + premises=app["premises"]) + + +if __name__ == "__main__": + check(sys.version_info[:2] == (3,12) and __debug__, "CPython 3.12 with assertions") + parser = ArgumentParser() + for key in ("peer","prior-run","run","primary","independent","out"): + parser.add_argument("--"+key,type=Path,required=True) + opts = parser.parse_args() + result = verify(opts) + with opts.out.open("x") as stream: + json.dump(result,stream,sort_keys=True,indent=2) + stream.write("\n") + print(result["outcome"],result["claim"],result["gain_vs_previous"]) diff --git a/research/p104-paired-delayed-cover/normalized/independent/price.py b/research/p104-paired-delayed-cover/normalized/independent/price.py new file mode 100644 index 0000000000..0b3d652f96 --- /dev/null +++ b/research/p104-paired-delayed-cover/normalized/independent/price.py @@ -0,0 +1,106 @@ +"""One exact normalized paid-leaf bound on the frozen #8027 uniform job and R347 stock.""" +import argparse +from decimal import Decimal, localcontext +from fractions import Fraction as F +import hashlib +import json +from pathlib import Path +import tarfile + +PINS = { + 'peer_application':'587ece477179606eed6fd9a334ac6d6e27f0067f82c3d6281993736e0570a76f', + 'peer_archive':'d85d011ca74e8592c21c1e4db91a1a9021af26dcebc4dfdc2af7251f9c1bf968', + 'binary':'f4aad2d07449c864479f26cc3b3ed4bbd8321f0ca14e1efc8676b28b54c27ed4', + 'signed':'419d4bdfb95c4484d0ddc81f34c89ee45bdefc0955a85dd496c1043396260e37', + 'accepted':'babc9a23a60da353403b4d6f0a3a346c0523a42645618890a592929747fb019a', + 'ambient_proof':'95cc9e31bc030ec94b04decddcca2d28ee98cfec0ca7803b54666b2b76a5c9ab', + 'shift_proof':'04eba2e0a2a6cdd4ee512254142cbe45e647a73b66ad67b2c1c0a62e0883238a', +} +NAMES = {'peer_application':'APPLICATION.json','peer_archive':'APPLICATION-SOURCES.tar.gz','binary':'BINARY.json','signed':'REPLAY.json','accepted':'accept.json','ambient_proof':'AMBIENT.md','shift_proof':'SHIFTED-LOG.md'} + +def check(ok, message): + if not ok: + raise ValueError(message) + +def stage_grid(covered, rational_left): + rho=F(1,250); old=F('0.00385248');rows=[] + for _ in range(4): + envelope=(1-rho)*covered+rho*old + cap=F(int(10**15*envelope)-1,10**15) + slack=min(rho-cap,1-rho-cap,envelope-cap) + check(cap>old and slack>0,'strict complete stage') + rows.append(dict(previous=str(old),cap=str(cap),bound=str(envelope),slack=str(slack))) + old=cap + grid=10**14 + claim=F(min(int(cap*grid),int(rational_left*grid))-8,grid) + return cap,claim,claim+F(7,grid),rows + +def decimal_text(q, digits): + n=q*(10**digits) + check(n.denominator==1,'finite decimal') + return f'0.{int(n):0{digits}d}' + +def main(): + parser=argparse.ArgumentParser() + for k in PINS: + parser.add_argument('--'+k.replace('_','-'),dest=k,type=Path,required=True) + parser.add_argument('--out',required=True,type=Path) + a=parser.parse_args() + for k,expected in PINS.items(): + check(hashlib.sha256(getattr(a,k).read_bytes()).hexdigest()==expected,'source '+k) + load=lambda k:json.loads(getattr(a,k).read_bytes()) + base=load('peer_application');prior_binary=load('binary');prior_signed=load('signed');prior_accept=load('accepted') + old=prior_binary['peer_finite'];uni=old['uniform'];comp=old['independent_directed_compiler'] + with tarfile.open(a.peer_archive) as tar: + member='source/research/paired-query-only-bit/retained/inputs/credited_trim.py' + check(hashlib.sha256(tar.extractfile(member).read()).hexdigest()=='fcff17fdd3108be68761fbde0fcbfe218be166cf518c99f7163e60d53ab785d9','uniform compiler source') + C=F(old['tested_saving']);t=1-C + v,ambient,cut,floor=(comp[k] for k in ('product_exponent','ambient_base','cutoff','productive_floor')) + H,p,h=uni['H'],uni['logarithm_power'],1024 + check((v,ambient,cut,floor,H,p)==(768,134,15,16,299610000000000,623),'one frozen profile') + check(uni['N']==f'2^{H}' and F(uni['theta'])==F(42,43) and C==F('0.003890115276594'),'trial and fixed carrier') + check(old['finite_separation']['targets']==base['binary_native']['productive_all'] and + old['finite_separation']['paid']==base['binary_native']['paid_all'] and + F(old['finite_separation']['strict_normalized_gap']['lower'])>0,'real complete t-moment') + targets=old['finite_separation']['targets'] + check(min(targets['8'],targets['64'])>0 and 256+512==v and 64**256*8**512==floor**v,'attained minimum') + check(cut**43h and (8*v)*C2*H*p,'positive log tail derivative for all x >= H') + d=F(1,H*(2**38)) + check(F(prior_binary['delayed_cover_debit'])==d and H*d/2==F(64,2**45) and + old['cover_prime_condition']=='odd q > 2^45*N^5 avoiding the frozen finite catalogue witnesses','same positive charged cover') + loss=F(J,H);old_loss=F(uni['gap']);left=F(base['rational_raw'][0]) + oc,ok,ot,ost=stage_grid(C-old_loss-d,left) + check(oc==F(prior_signed['cap'])==F(prior_binary['admitted']) and ok==F(prior_accept['claim']) + and ot==F(prior_signed['tested']) and prior_accept['outcome']=='PASS_COMPLETE_INDEPENDENT_SIGNED_ACCEPTANCE','complete predecessor control') + cap,k,tested,rows=stage_grid(C-loss-d,left) + ceiling=F(base['binary_raw'][1])-old_loss + threshold=ceiling+F(1,10**11) + check(ok0,'positive parameters') + check(F(p*39,H)>C-threshold and H>2**48,'smaller dyadic scale optimistic ceiling') + out={'pins':{NAMES[k]:v for k,v in PINS.items()},'case':{'v':v,'h':h,'p':p,'H':H,'theta':'42/43','C':str(C),'J':J}, + 'eta_lower':str(eta_lo),'lower_shift_ratio':str(ratio),'small_ranks':'0..134^768','uniform_loss':str(loss),'cover_loss':str(d), + 'terminal_lower_fails':True,'tail_derivative_positive':True,'old_stages':ost,'new_stages':rows,'old_cap':decimal_text(oc,15), + 'old_claim':decimal_text(ok,14),'covered':str(C-loss-d),'cap':decimal_text(cap,15),'claim':decimal_text(k,14), + 'tested':decimal_text(tested,14),'gap_vs_old':str(k-ok),'percent_vs_old':str(100*(k-ok)/ok),'old_relaxed_ceiling':str(ceiling), + 'separation':str(k-ceiling),'beyond_preregistered_guard':str(k-threshold),'status':'PASS uniform proof and complete price; fresh signed application required'} + with a.out.open('x') as f: + json.dump(out,f,indent=2,sort_keys=True);f.write('\n') + print('PASS normalized price',J,out['cap'],out['claim'],out['tested'],out['gap_vs_old']) +if __name__=='__main__': + main() diff --git a/research/p104-paired-delayed-cover/normalized/primary/PRICE.json b/research/p104-paired-delayed-cover/normalized/primary/PRICE.json new file mode 100644 index 0000000000..0198c55dc4 --- /dev/null +++ b/research/p104-paired-delayed-cover/normalized/primary/PRICE.json @@ -0,0 +1,98 @@ +{ + "H": 299610000000000, + "J": 23731, + "absolute_gain": "2079/100000000000000", + "base_exponent_upper": "29877/10000", + "base_upper": 2267000, + "caller": "156fdf3a4a129b39225fd6ca51011de27974d7f104e8b04907c17ed5344bc858", + "candidate": { + "cap": "0.003890115197377", + "claim": "0.00389011519729", + "covered": "1001171835458229660421190603/257363030310912000000000000000", + "stages": [ + { + "admitted": "0.003889964656597", + "envelope": "83427757652037122568878820049/21446919192576000000000000000000", + "old": "12039/3125000", + "slack": "24614217054948049/21446919192576000000000000000000" + }, + { + "admitted": "0.003890114595223", + "envelope": "83430973373641111848366115537/21446919192576000000000000000000", + "old": "3889964656597/1000000000000000", + "slack": "32935621701667537/21446919192576000000000000000000" + }, + { + "admitted": "0.003890115194978", + "envelope": "83430986236527494519865477841/21446919192576000000000000000000", + "old": "3890114595223/1000000000000000", + "slack": "22297949782149841/21446919192576000000000000000000" + }, + { + "admitted": "0.003890115197377", + "envelope": "83430986287979082601239153361/21446919192576000000000000000000", + "old": "1945057597489/500000000000000", + "slack": "22726888166001361/21446919192576000000000000000000" + } + ], + "tested": "0.00389011519736" + }, + "comparator": { + "cap": "0.003890115176583", + "claim": "0.00389011517650", + "covered": "1001171830106700409605190603/257363030310912000000000000000", + "stages": [ + { + "admitted": "0.003889964635886", + "envelope": "83427757207860194751150820049/21446919192576000000000000000000", + "old": "12039/3125000", + "slack": "34829796768484049/21446919192576000000000000000000" + }, + { + "admitted": "0.003890114574430", + "envelope": "83430972927687435457048349393/21446919192576000000000000000000", + "old": "1944982317943/500000000000000", + "slack": "25050001616669393/21446919192576000000000000000000" + }, + { + "admitted": "0.003890115174184", + "envelope": "83430985790566783539052546769/21446919192576000000000000000000", + "old": "389011457443/100000000000000", + "slack": "28824659394562769/21446919192576000000000000000000" + }, + { + "admitted": "0.003890115176583", + "envelope": "16686197168403657166549890397/4289383838515200000000000000000", + "old": "486264396773/125000000000000", + "slack": "5833562020328797/4289383838515200000000000000000" + } + ], + "tested": "0.00389011517657" + }, + "cover_loss": "1/82356169699491840000000000", + "decision": "ADVANCE_ONE_COMPLETE_SIGNED_REPLAY", + "eta_lower": "498054942361703/1133500000000000000000", + "floor_factors": { + "64": 256, + "8": 512 + }, + "h": 1024, + "old_relaxed_ceiling": "778023037319/200000000000000", + "p": 623, + "peer_head": "fb9b6a7b0d27da1cf98430893a3016bf811e2aa4", + "pins": { + "ordinary/BINARY.json": "f4aad2d07449c864479f26cc3b3ed4bbd8321f0ca14e1efc8676b28b54c27ed4", + "ordinary/REPLAY.json": "419d4bdfb95c4484d0ddc81f34c89ee45bdefc0955a85dd496c1043396260e37", + "peer/APPLICATION-SOURCES.tar.gz": "d85d011ca74e8592c21c1e4db91a1a9021af26dcebc4dfdc2af7251f9c1bf968", + "peer/APPLICATION.json": "587ece477179606eed6fd9a334ac6d6e27f0067f82c3d6281993736e0570a76f", + "peer/BINARY-CANDIDATE.json.gz": "74e93daf2b7acf794ffb51f92f03f51556f68126d41ee13a8969bddb4cbe6326" + }, + "relative_percent": "594/1111461479", + "rho": "1/250", + "seed": "12039/3125000", + "separation": "2139/200000000000000", + "theta": "42/43", + "trial": "1945057638297/500000000000000", + "uniform_loss": "23731/299610000000000", + "word": "b096d6df2a0c4688296b13ab0cfd50fec1c7dec732819c624ddd7a745a144b69" +} diff --git a/research/p104-paired-delayed-cover/normalized/primary/price.py b/research/p104-paired-delayed-cover/normalized/primary/price.py new file mode 100644 index 0000000000..82a374dbbf --- /dev/null +++ b/research/p104-paired-delayed-cover/normalized/primary/price.py @@ -0,0 +1,126 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +"""One normalized majorant on the authenticated 768-factor compiler.""" +import argparse +from fractions import Fraction as Q +from hashlib import sha256 +from pathlib import Path +import json +import sys + +PINS = { + "ordinary/BINARY.json": "f4aad2d07449c864479f26cc3b3ed4bbd8321f0ca14e1efc8676b28b54c27ed4", + "ordinary/REPLAY.json": "419d4bdfb95c4484d0ddc81f34c89ee45bdefc0955a85dd496c1043396260e37", + "peer/APPLICATION.json": "587ece477179606eed6fd9a334ac6d6e27f0067f82c3d6281993736e0570a76f", + "peer/APPLICATION-SOURCES.tar.gz": "d85d011ca74e8592c21c1e4db91a1a9021af26dcebc4dfdc2af7251f9c1bf968", + "peer/BINARY-CANDIDATE.json.gz": "74e93daf2b7acf794ffb51f92f03f51556f68126d41ee13a8969bddb4cbe6326", +} + + +def check(cond, what): + if not cond: + raise ValueError(what) + + +def decimal(q, places): + n = q * 10**places + check(n.denominator == 1 and n > 0, "decimal not on declared grid") + a, b = divmod(n.numerator, 10**places) + return f"{a}.{b:0{places}d}" + + +def price(covered, seed, rho, rational): + previous = seed + rows = [] + for _ in range(4): + bound = (1-rho)*covered + rho*previous + admitted = Q((bound*10**15).__floor__() - 1, 10**15) + check(previous < admitted < bound < rho < 1-bound, "all strict paid stage terms") + rows.append({"old":str(previous), "envelope":str(bound), + "admitted":decimal(admitted,15), "slack":str(bound-admitted)}) + previous = admitted + grid = (min(rational, previous)*10**14).__floor__() - 8 + claim, tested = Q(grid,10**14), Q(grid+7,10**14) + check(claim < tested < previous < rational, "complete signed grid and binding limit") + return {"stages":rows, "covered":str(covered), "cap":decimal(previous,15), + "claim":decimal(claim,14), "tested":decimal(tested,14)} + + +def solve(args): + raw = {} + for key, expected in sorted(PINS.items()): + namespace, name = key.split("/") + data = (getattr(args, namespace) / name).read_bytes() + check(sha256(data).hexdigest() == expected, key) + if name.endswith(".json"): + raw[key] = json.loads(data) + binary = raw["ordinary/BINARY.json"] + signed = raw["ordinary/REPLAY.json"] + peer = raw["peer/APPLICATION.json"] + base = binary["peer_finite"] + comp = base["independent_directed_compiler"] + sep = base["finite_separation"] + H,p,h = comp["H"],comp["logarithm_power"],1024 + theta, C = Q(comp["theta"]),Q(comp["trial"]) + t, v = 1-C,comp["product_exponent"] + a,r,k = comp["ambient_base"],comp["cutoff"],comp["productive_floor"] + check((H,p,theta,v,a,r,k,C)==(299610000000000,623,Q(42,43),768,134,15,16,Q("0.003890115276594")), "fixed case") + check(base["uniform"]["H"]==H and base["uniform"]["logarithm_power"]==p and Q(base["uniform"]["theta"])==theta, "both source compilers") + check(signed["source_archive"]==PINS["peer/APPLICATION-SOURCES.tar.gz"] and signed["source_count"]==134, "signed closure") + check(comp["N"]==f"2^{H}" and Q(sep["strict_normalized_gap"]["lower"])>0, "separated moment and exact carrier") + check(sep["targets"]["64"]>0 and sep["targets"]["8"]>0 and 256+512==v and 64**256*8**512==k**v, "literal productive floor") + check(r**43 < k**42 and (1<base_upper, "all ordinary base ranks by concavity") + num,den=(H+h)**p,h**p + J = (num//den).bit_length() + check(den*(1<<(J-1))<=num2*H*p, "positive derivative for every log-rank at least H") + loss=Q(J,H) + old_loss=Q(base["uniform_loss"]) + d=Q(binary["delayed_cover_debit"]) + check(d==Q(1,H*2**38) and H*d/2==Q(64,2**45) and base["cover_prime_condition"].startswith("odd q > 2^45*N^5"), "unchanged strict cover") + seed=Q(base["ordinary_bootstrap"][0]["previous"]) + rho=Q(base["rho"]) + raw_low,raw_high=map(Q,peer["binary_raw"]) + rational=Q(peer["rational_raw"][0]) + check(seed==Q(".00385248") and rho==Q(1,250) and C==raw_low-Q(1,10**11) and old_loss==Q(1,10**10), "stock and original trial") + old=price(C-old_loss-d,seed,rho,rational) + check([x["admitted"] for x in old["stages"]]==[x["claim"] for x in binary["candidate_stages"]], "unchanged original four stages") + check(all(old[field]==signed[field] for field in ("claim","tested","cap")), "reproduce full R347 control") + new=price(C-loss-d,seed,rho,rational) + old_upper=raw_high-old_loss + diff=Q(new["claim"])-Q(old["claim"]) + check(0 < d < loss < old_loss and Q(new["claim"]) > old_upper+Q(1,10**11), "fixed whole-price target") + return {"decision":"ADVANCE_ONE_COMPLETE_SIGNED_REPLAY", "pins":dict(sorted(PINS.items())), + "peer_head":signed["peer_head"],"word":peer["binary_word"],"caller":signed["caller"], + "h":h,"p":p,"theta":str(theta),"H":H,"J":J,"base_upper":base_upper, + "base_exponent_upper":str(Q(u,10000)), "eta_lower":str(t/base_upper), + "trial":str(C),"seed":str(seed),"rho":str(rho),"uniform_loss":str(loss), + "cover_loss":str(d),"floor_factors":{"8":512,"64":256}, "comparator":old, + "candidate":new,"old_relaxed_ceiling":str(old_upper), + "separation":str(Q(new["claim"])-old_upper),"absolute_gain":str(diff), + "relative_percent":str(100*diff/Q(old["claim"]))} + + +def main(): + a=argparse.ArgumentParser() + a.add_argument("--peer",type=Path,required=True) + a.add_argument("--ordinary",type=Path,required=True) + a.add_argument("--out",type=Path,required=True) + args=a.parse_args() + check(sys.version_info[:2]==(3,12), "CPython 3.12 required") + result=solve(args) + with args.out.open("x") as f: + json.dump(result,f,indent=2,sort_keys=True) + f.write("\n") + print("PASS_NORMALIZED_768_PRICE",result["J"],result["candidate"]["cap"],result["candidate"]["claim"],result["candidate"]["tested"]) + + +if __name__=="__main__": + main() diff --git a/research/p104-paired-delayed-cover/peer-8027.tar.gz b/research/p104-paired-delayed-cover/peer-8027.tar.gz new file mode 100644 index 0000000000..df2437e629 Binary files /dev/null and b/research/p104-paired-delayed-cover/peer-8027.tar.gz differ diff --git a/research/p104-paired-delayed-cover/primary/PRICE.json b/research/p104-paired-delayed-cover/primary/PRICE.json new file mode 100644 index 0000000000..4e00992b4c --- /dev/null +++ b/research/p104-paired-delayed-cover/primary/PRICE.json @@ -0,0 +1,135 @@ +{ + "decision": "ADVANCE_ONE_COMPLETE_SIGNED_REPLAY", + "pins": { + "peer": { + "APPLICATION.json": "587ece477179606eed6fd9a334ac6d6e27f0067f82c3d6281993736e0570a76f", + "APPLICATION-SOURCES.tar.gz": "d85d011ca74e8592c21c1e4db91a1a9021af26dcebc4dfdc2af7251f9c1bf968", + "BINARY-CANDIDATE.json.gz": "74e93daf2b7acf794ffb51f92f03f51556f68126d41ee13a8969bddb4cbe6326", + "verify_application.py": "f774304804e705ac576459cca725b348f09e67e6020fe6165df9b7d39c605c54", + "SOURCES.json": "4dd42ee240925ae1bc1ffa3b885b33eb66ab4d323695d106c00ce7519dffd9bb" + }, + "peer_archive": { + "recipient/binary/finite.py": "c780cea060f4a9efef064b239636162a7e8e84e40369abc1a1c4679dfbeb3041", + "parent/binary/independent/price.py": "d720df6f3f7a22554e83d0c29243af3ee04fa036073404926bab7bc2f2687e1b", + "parent/qualify_complex.py": "236988674f4efe96134de83a224f9c5f4508f6049237415bc24a18669cf5ad67", + "recipient/continuation/qualify.py": "fdf559fbe15f52c2b31f2947712a46aa6b4c93f211ea9a0b1f05b07d69664227", + "source/certificates/frontier7000/CLAIM.json": "3f8add8252adb223b60418ec69351a69b6b5edfe601ec1c6b4b65cd9e2afd9b2", + "source/research/paired-query-only-bit/EFREE-CALLER.json.gz": "757b3523798f840bdb02028b23708c3416627a99ea09e7a3c4bcdc5cd0c7ce4b", + "source/research/paired-query-only-bit/retained/inputs/credited_trim.py": "fcff17fdd3108be68761fbde0fcbfe218be166cf518c99f7163e60d53ab785d9" + }, + "bridge": "9731b93026717f5fa15851e3633cbb4bdc76eba2bffb9d6b4a3b69f7dd502443" + }, + "events": [ + { + "utc": "2026-11-21T17:13:29.798+00:00", + "elapsed": 6.16665929555893e-05, + "stage": "one case started" + }, + { + "utc": "2026-11-21T17:13:29.822+00:00", + "elapsed": 0.024280792102217674, + "stage": "authenticated literal 768 supplier, both callers and source; exact old cap and grid" + }, + { + "utc": "2026-11-21T17:13:29.822+00:00", + "elapsed": 0.024586791172623634, + "stage": "whole-cover contraction, four stages, ordinary and candidate signed-grid price" + }, + { + "utc": "2026-11-21T17:13:29.824+00:00", + "elapsed": 0.025810958817601204, + "stage": "one case closed" + } + ], + "comparator": { + "head": "fb9b6a7b0d27da1cf98430893a3016bf811e2aa4", + "word": "b096d6df2a0c4688296b13ab0cfd50fec1c7dec732819c624ddd7a745a144b69", + "trial": "1945057638297/500000000000000", + "uniform_loss": "1/10000000000", + "H": 299610000000000, + "seed": "12039/3125000", + "old_cover_loss": "1/10000000000", + "stages": [ + { + "previous": "12039/3125000", + "endpoint": "486245567035953/125000000000000000", + "admitted": "0.003889964536286", + "charged_minimum_slack": "203/125000000000000000" + }, + { + "previous": "1944982268143/500000000000000", + "endpoint": "15195759665753/3906250000000000", + "admitted": "0.003890114474431", + "charged_minimum_slack": "221/125000000000000000" + }, + { + "previous": "3890114474431/1000000000000000", + "endpoint": "972528768546337/250000000000000000", + "admitted": "0.003890115074184", + "charged_minimum_slack": "337/250000000000000000" + }, + { + "previous": "486264384273/125000000000000", + "endpoint": "97252876914609/25000000000000000", + "admitted": "0.003890115076583", + "charged_minimum_slack": "17/12500000000000000" + } + ], + "cap": "0.003890115076583", + "claim": "0.00389011507650", + "tested": "0.00389011507657" + }, + "candidate": { + "case": "same-prime-2^-38", + "cover_loss": "1/82356169699491840000000000", + "uniform_loss": "1/10000000000", + "surcharge_strict_upper": "1/549755813888", + "N_to_d_strictly_above": "549755813889/549755813888", + "covered": "1001171830106700409605190603/257363030310912000000000000000", + "stages": [ + { + "previous": "12039/3125000", + "endpoint": "83427757207860194751150820049/21446919192576000000000000000000", + "admitted": "0.003889964635886", + "charged_minimum_slack": "34829796768484049/21446919192576000000000000000000" + }, + { + "previous": "1944982317943/500000000000000", + "endpoint": "83430972927687435457048349393/21446919192576000000000000000000", + "admitted": "0.003890114574430", + "charged_minimum_slack": "25050001616669393/21446919192576000000000000000000" + }, + { + "previous": "389011457443/100000000000000", + "endpoint": "83430985790566783539052546769/21446919192576000000000000000000", + "admitted": "0.003890115174184", + "charged_minimum_slack": "28824659394562769/21446919192576000000000000000000" + }, + { + "previous": "486264396773/125000000000000", + "endpoint": "16686197168403657166549890397/4289383838515200000000000000000", + "admitted": "0.003890115176583", + "charged_minimum_slack": "5833562020328797/4289383838515200000000000000000" + } + ], + "cap": "0.003890115176583", + "tested": "0.00389011517657", + "claim": "0.00389011517650", + "old_ceiling": "155604603461/40000000000000", + "separation": "3599/40000000000000", + "absolute_gain": "1/10000000000", + "relative_percent": "20000/7780230153" + }, + "supervisor": { + "launch": "2026-11-21T17:13:29.776+00:00", + "verification": "2026-11-21T17:13:29.828+00:00", + "child_exit": 0, + "killed": false, + "child_wall": 0.05158429220318794, + "discovery_cap": 30, + "reserve_seconds": 10, + "output": "", + "sealed": "2026-11-21T17:13:29.828+00:00", + "total_wall": 0.051876042038202286 + } +} diff --git a/research/p104-paired-delayed-cover/primary/price.py b/research/p104-paired-delayed-cover/primary/price.py new file mode 100644 index 0000000000..ebbc0d4242 --- /dev/null +++ b/research/p104-paired-delayed-cover/primary/price.py @@ -0,0 +1,161 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +"""One 768-factor delayed-cover loss, fixed peer word, carrier and prefix.""" +from argparse import ArgumentParser +from datetime import datetime,timezone +from fractions import Fraction as F +from hashlib import sha256 +from pathlib import Path +from tempfile import TemporaryDirectory +import gzip,io,json,os,signal,subprocess,sys,tarfile,time + +PKG={ + 'APPLICATION.json':'587ece477179606eed6fd9a334ac6d6e27f0067f82c3d6281993736e0570a76f', + 'APPLICATION-SOURCES.tar.gz':'d85d011ca74e8592c21c1e4db91a1a9021af26dcebc4dfdc2af7251f9c1bf968', + 'BINARY-CANDIDATE.json.gz':'74e93daf2b7acf794ffb51f92f03f51556f68126d41ee13a8969bddb4cbe6326', + 'verify_application.py':'f774304804e705ac576459cca725b348f09e67e6020fe6165df9b7d39c605c54', + 'SOURCES.json':'4dd42ee240925ae1bc1ffa3b885b33eb66ab4d323695d106c00ce7519dffd9bb', +} +ARCH={ + 'recipient/binary/finite.py':'c780cea060f4a9efef064b239636162a7e8e84e40369abc1a1c4679dfbeb3041', + 'parent/binary/independent/price.py':'d720df6f3f7a22554e83d0c29243af3ee04fa036073404926bab7bc2f2687e1b', + 'parent/qualify_complex.py':'236988674f4efe96134de83a224f9c5f4508f6049237415bc24a18669cf5ad67', + 'recipient/continuation/qualify.py':'fdf559fbe15f52c2b31f2947712a46aa6b4c93f211ea9a0b1f05b07d69664227', + 'source/certificates/frontier7000/CLAIM.json':'3f8add8252adb223b60418ec69351a69b6b5edfe601ec1c6b4b65cd9e2afd9b2', + 'source/research/paired-query-only-bit/EFREE-CALLER.json.gz':'757b3523798f840bdb02028b23708c3416627a99ea09e7a3c4bcdc5cd0c7ce4b', + 'source/research/paired-query-only-bit/retained/inputs/credited_trim.py':'fcff17fdd3108be68761fbde0fcbfe218be166cf518c99f7163e60d53ab785d9', +} +BRIDGE='9731b93026717f5fa15851e3633cbb4bdc76eba2bffb9d6b4a3b69f7dd502443' +HEAD='fb9b6a7b0d27da1cf98430893a3016bf811e2aa4' + + +def utc(): return datetime.now(timezone.utc).isoformat(timespec='milliseconds') + + +def require(flag,msg): + if not flag: raise ValueError(msg) + + +def dec(x,n): + unit=10**n;u=x*unit;require(u.denominator==1,'decimal grid') + return f'{u.numerator//unit}.{u.numerator%unit:0{n}d}' + + +def stages(covered,seed): + rho=F(1,250);v=seed;out=[] + for _ in range(4): + bound=(1-rho)*covered+rho*v + nxt=F((bound*10**15).__floor__()-1,10**15) + require(v1+(H*d)/2. + covered=trial-uniform-loss + cap,invoice=stages(covered,seed) + claim,tested=grid(cap,rational_low) + tick=F(1,10**14) + old_ceiling=high-2*uniform-7*tick + require(030: d['decision']='CAPPED_UNRESOLVED' + elif cp.returncode!=0 or d.get('decision')=='RUNNING': d['decision']='CHILD_ERROR' + d['supervisor']={'launch':start,'verification':utc(),'child_exit':cp.returncode,'killed':killed, + 'child_wall':wall,'discovery_cap':30,'reserve_seconds':10,'output':stdout[-500:]} + if 'candidate' in d: require(F(d['candidate']['claim'])-F(d['comparator']['claim'])==F(d['candidate']['absolute_gain']),'receipt comparison') + d['supervisor'].update(sealed=utc(),total_wall=time.monotonic()-begin) + if d['supervisor']['total_wall']>40: d['decision']='CAPPED_UNRESOLVED' + a.out.write_text(json.dumps(d,indent=2)+'\n') + print(d['decision'],d.get('error',''),d.get('candidate',{}).get('cap','')) + + +if __name__=='__main__': + main() diff --git a/research/p104-paired-delayed-cover/verify.py b/research/p104-paired-delayed-cover/verify.py new file mode 100644 index 0000000000..fb9943fbd6 --- /dev/null +++ b/research/p104-paired-delayed-cover/verify.py @@ -0,0 +1,167 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +"""Replay two independent prices and the signed application of their ordinary cap.""" +from hashlib import sha1, sha256 +from pathlib import Path, PurePosixPath +from tempfile import TemporaryDirectory +import json +import subprocess +import sys +import tarfile + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +BRIDGE = 'research/p104-shared-native-helper-splits/retained/compiler/bit-audit/retained/DELAYED-COVER-BRIDGE.md' +PEER_ARCHIVE = '8d376948e23de166f8f015cfc7d5ba28d0ce6732ae865ff129905c2a29fa3fa0' +PEER_TREE = 'b14720ac48ff13a93d0dd094cfddeba285c5aa74' +EXPECTED = { + 'normalized/primary/PRICE.json': 'ef3f829625b03c09f1cdff2440ef92b9869b4cb4d0821bf9c0fd5910c9d6ad3c', + 'normalized/independent/PRICE.json': '523d6dc93a7cd34bf6183a66d03b624ab2f0dfcf18b7e95032b7d0ab695fa24f', + 'normalized/independent/ACCEPT.json': '35481cf9a929a3dd137a9e63134b7e97ee7c5408d4e675a3e8ad67b16d9a7b71', + 'normalized/application/RESULT.json': '9b00a17913efb76995b01c7b75f5b00aab394a0531e26490ab02a5940adcac3c', + 'primary/PRICE.json': '228b7c47572c9b1c7568db2f59248af454296a1e3ad094da585073bbd594f5cb', + 'independent/PRICE.json': '5c723ea9c6b085b6e0aa792f34cfa64daed551a9bf2f629efc54d219008596d2', + 'independent/ACCEPT.json': 'babc9a23a60da353403b4d6f0a3a346c0523a42645618890a592929747fb019a', + 'application/RESULT.json': '419d4bdfb95c4484d0ddc81f34c89ee45bdefc0955a85dd496c1043396260e37', +} + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def unique_map(pairs): + result = {} + for key, value in pairs: + require(key not in result, 'duplicate JSON key '+key) + result[key] = value + return result + + +def read_json(path): + return json.loads(path.read_bytes(), object_pairs_hook=unique_map) + + +def authenticate(path, digest): + require(sha256(path.read_bytes()).hexdigest() == digest, 'SHA-256 mismatch for '+path.name) + + +def unpack(destination): + source = read_json(HERE/'SOURCES.json')['offline_peer'] + require(source['archive_sha256'] == PEER_ARCHIVE and source['tree'] == PEER_TREE, + 'incorrect peer source') + archive = HERE/'peer-8027.tar.gz' + authenticate(archive, PEER_ARCHIVE) + expected = source['files'] + require(len(expected) == 30, 'expected 30 peer source files') + destination.mkdir() + seen = set() + objects = [] + with tarfile.open(archive, 'r:gz') as members: + for member in members: + name = member.name + require(name in expected and name not in seen, 'unknown or duplicated peer archive path') + require(name not in ('.','..') and PurePosixPath(name).parts == (name,) + and '/' not in name and '\\' not in name, 'invalid peer archive path') + spec = expected[name] + require(member.isreg() and member.type in (tarfile.REGTYPE, tarfile.AREGTYPE) + and not member.linkname and member.size == spec['size'] + and 0 <= member.size <= 4*1024*1024, 'invalid peer member') + file = members.extractfile(member) + require(file is not None, 'missing peer data') + with file: + data = file.read() + require(len(data) == member.size and sha256(data).hexdigest() == spec['sha256'], + 'corrupt peer member '+name) + blob = sha1(b'blob '+str(len(data)).encode()+b'\0'+data).digest() + require(blob.hex() == spec['git_blob'] and spec['git_mode'] in ('100644','100755'), + 'Git object mismatch '+name) + # Write only individually authenticated single-level regular files into a fresh directory. + with (destination/name).open('xb') as output: + output.write(data) + objects.append((name, spec['git_mode'], blob)) + seen.add(name) + require(seen == set(expected), 'missing peer source') + tree = b''.join(mode.encode()+b' '+name.encode()+b'\0'+blob for name,mode,blob in sorted(objects)) + require(sha1(b'tree '+str(len(tree)).encode()+b'\0'+tree).hexdigest() == PEER_TREE, + 'peer tree hash mismatch') + + +def run(script, *arguments): + subprocess.run([sys.executable, '-I', '-B', str(HERE/script), *map(str,arguments)], check=True) + + +def prices(peer, work, bridge): + first, second = work/'primary.json', work/'independent.json' + run('primary/price.py', '--peer-package', peer, '--bridge', bridge, '--out', first) + run('independent/price.py', '--peer', peer, '--bridge', bridge, '--out', second) + # Only the primary discovery runner records wall-clock events. + fixed = read_json(HERE/'primary/PRICE.json') + rebuilt = read_json(first) + for event_key in ('events','supervisor'): + del rebuilt[event_key] + del fixed[event_key] + require(rebuilt == fixed and rebuilt['decision'] == 'ADVANCE_ONE_COMPLETE_SIGNED_REPLAY', + 'fresh primary scientific price differs') + authenticate(second, EXPECTED['independent/PRICE.json']) + + +def verify_normalization(peer, work, previous, accepted): + primary = work/'normalized-primary.json' + independent = work/'normalized-independent.json' + run('normalized/primary/price.py', '--peer', peer, '--ordinary', previous, '--out', primary) + run('normalized/independent/price.py', + '--peer-application', peer/'APPLICATION.json', '--peer-archive', peer/'APPLICATION-SOURCES.tar.gz', + '--binary', previous/'BINARY.json', '--signed', previous/'REPLAY.json', '--accepted', accepted, + '--ambient-proof', ROOT/'research/p104-shared-native-helper-splits/retained/compiler/PROOF.md', + '--shift-proof', ROOT/'research/net-tax-rank-compiler/SHIFTED-LOG.md', '--out', independent) + authenticate(primary, EXPECTED['normalized/primary/PRICE.json']) + authenticate(independent, EXPECTED['normalized/independent/PRICE.json']) + signed = work/'normalized-signed' + run('normalized/application/replay.py', '--peer-package', peer, '--prior-package', HERE, + '--prior-run', previous, '--primary', primary, '--independent', independent, '--out', signed) + authenticate(signed/'REPLAY.json', EXPECTED['normalized/application/RESULT.json']) + result = read_json(signed/'REPLAY.json') + require(set(result['output_sha256']) == {'BINARY.json','PHYSICAL.json','APPLICATION.json'}, + 'normalized signed evidence inventory') + for filename, digest in result['output_sha256'].items(): + authenticate(signed/filename, digest) + acceptance = work/'normalized-accepted.json' + run('normalized/independent/accept.py', '--peer', peer, '--prior-run', previous, + '--run', signed, '--primary', primary, '--independent', independent, '--out', acceptance) + authenticate(acceptance, EXPECTED['normalized/independent/ACCEPT.json']) + print('PASS_PAIRED_NORMALIZED_COVER', result['claim'], result['difference'], flush=True) + run('weighted/verify.py', '--peer', peer, '--cover-run', previous, '--normalized-run', signed, + '--normalized-accept', acceptance, '--work', work/'weighted') + + +def main(): + require(sys.implementation.name == 'cpython' and sys.version_info[:2] == (3,12) and __debug__, + 'requires CPython 3.12 with assertions') + for name,digest in EXPECTED.items(): + authenticate(HERE/name,digest) + with TemporaryDirectory(prefix='paired-cover-') as name: + work = Path(name) + peer = work/'peer' + unpack(peer) + prices(peer, work, ROOT/BRIDGE) + cold = work/'signed' + run('application/replay.py', '--peer-package', peer, '--primary', HERE/'primary/PRICE.json', + '--independent', HERE/'independent/PRICE.json', '--out', cold) + authenticate(cold/'REPLAY.json', EXPECTED['application/RESULT.json']) + result = read_json(HERE/'application/RESULT.json') + require(set(result['output_sha256']) == {'BINARY.json','PHYSICAL.json','APPLICATION.json'}, + 'signed evidence inventory') + for filename,digest in result['output_sha256'].items(): + authenticate(cold/filename,digest) + accept = work/'accepted.json' + run('independent/accept.py', '--peer', peer, '--run', cold, '--adapter', HERE/'application/replay.py', + '--primary', HERE/'primary/PRICE.json', '--independent', HERE/'independent/PRICE.json', '--out', accept) + authenticate(accept, EXPECTED['independent/ACCEPT.json']) + print('PASS_PAIRED_DELAYED_COVER', result['claim'], result['difference'], flush=True) + verify_normalization(peer, work, cold, accept) + + +if __name__ == '__main__': + main() diff --git a/research/p104-paired-delayed-cover/weighted/PROOF.md b/research/p104-paired-delayed-cover/weighted/PROOF.md new file mode 100644 index 0000000000..8ab1c40664 --- /dev/null +++ b/research/p104-paired-delayed-cover/weighted/PROOF.md @@ -0,0 +1,35 @@ +# An upper tail for actual paid slabs certifies a degree-128 leaf bound + +R350's mean-only Bernoulli bound fails at seven finite heights. This calculation instead proves an L¹²⁸ norm bound for a single **actual completed 768-factor paid label**, then bounds the sum of every G+1-label exit. At unchanged h=1024, the result reduces the 768-factor terminal debit from 23731/H to 4876/H. The complete ordinary BIT cap is 0.003890115260308. The candidate κ is 0.00389011526022, tested at 0.00389011526029. Relative to reproduced R348 this adds 0.00000000006293, exactly (89900/55573074247)%. Relative to the external #8027 point it adds 0.00000000018372, exactly (12248/2593410051)%. This primary price must be coupled to a fresh full 36/48-call signed replay and independent audit before certifying the complete result. + +## Paid event and positive completion charge + +Let Pᵣ and Tᵣ denote the original 36-call paid and productive multiplicities, v=768, J=15^v, floor K=16^v, ambient m=134^v, t=1−C and C=0.003890115276594. The original source independently computes Pₜ=ΣPᵣrᵗ and Tₜ=ΣTᵣrᵗ, α=Pₜ/Tₜ and γ=Pₜ₊ᵤ/(15ᵘTₜ) for u=1/5. Under the raw positive t-weighted paid product law the mass of rank R is counted with chronological multiplicity and total Q=Pₜ^v. For the event R>J^(4/5), positivity gives + + Q⁻¹ Σraw,high Rᵗ ≤ [(γ/α)·15^(1/25)]^768. + +This is Markov's inequality applied to Rᵘ. The rate uses γ_upper/α_lower. The primary also independently reprices Pₜ₊ᵤ/(15ᵘPₜ) from the full paid histogram, with outward decimal bounds. Positive rational 223/200 exceeds 15^(1/25) by direct integer exponentiation and still gives a certified raw tail <9.804·10⁻⁹. The exponent u(1−4/5) is 1/25. + +For R≤J the label remains intact. A larger tuple is split into disjoint full-J slabs with at most one smaller remainder. A high child implies its own parent was high. On any parent, the high children's summed t-mass is at most the original high-parent mass plus its positive splitting excess. For R>J, its whole split t-mass is at most 2R J^(t−1)≤2R^(t+u)/Jᵘ since u≥1−t. The global excess divided by Q is at most 2(γ_upper/α_lower)^v <9.668·10⁻⁴⁵. The completed denominator is at least Q by subadditivity, and every normalized completed log rank X=ln(r)/ln J lies in [0,1]. Equality X=4/5 can stay in the low class. The #8027 compiler specializes small productive targets to previously owned zero buffers. It keeps every original paid call and the 2·18906^768 ordinary boundary allowance; it adds zero recursive completion calls. This property comes from its frozen construction in parent/binary/PROOF.md and credited_trim.py, and does not follow merely from the net superpotential. The positive uplift and charged denominator yield the completed high-event bound in receipt.json. Hence + + E[X^128] ≤ (4/5)^128 + Pr(X>4/5) < 9.805·10⁻⁹ < (9/10)^128. + +## Exact exits, whole-job induction and fixed stock + +For n≥m, G=floor(log_K(n/m)), with the floor attained by 256 factors of productive rank 64 and 512 factors of rank 8. Along any chronological paid prefix of length j≤G and multiplier ρ, a complete class exists because mρK^(G−j)≤mK^G≤n. Every present parent matches its required child, and a missing parent contributes new sources without deleting its child's class. At depth G the degree-zero unit of multiplicity one emits every paid label. Thus all exits consist of precisely G+1 successive chronological labels; after conditioning on exit t-mass their distribution is the product of the completed single-label t-law. Integer multiplicities and the count of all sources normalize equally in exit and source sums. For this last inequality Minkowski only requires the indicated marginal L¹²⁸ bounds; no independence of arbitrary input data is assumed. [Exact weighted-exit theorem](https://github.com/CrocSwap/integer-mult-bounds/blob/4cf054a50c5718616594ec4ca2c9114278120a8b/research/net-tax-rank-compiler/WEIGHTED-EXITS.md) · [Whole-job ambient recurrence](https://github.com/CrocSwap/integer-mult-bounds/blob/e54523517d0f03e58352e647c403a5af3e525a57/research/p104-shared-native-helper-splits/retained/compiler/PROOF.md#6-ambient-cap-version-of-the-exact-finite-flow) + +With a=h ln2, write a/ln J≤A₀=7/20, (a+ln m)/ln J≥B₀=21/10, ln K/ln J≥β=51/50. All these inequalities are exact integer-power comparisons. At each integer G≥0, the L¹²⁸ norm of the normalized shifted paid exit is ≤A₀+(G+1)·9/10 by the triangle inequality. Its available denominator is ≥B₀+βG. The ratio is a weighted average of (A₀+9/10)/B₀ and (9/10)/β with weights B₀ and βG. Its 128th power is therefore at most the larger endpoint power, <1.103·10⁻⁷, strictly below the original complement budget η=t m^(t−1)>4.398·10⁻⁷. The actual original strict t-moment bounds all exits against the counted source t-mass. For source fractions s/n>1/m, 1−(1−s/n)^t≥η(s/n)^t; monotonicity of the positive log factor preserves this complement budget, and s=n gives zero remainder. Small ranks are covered since log₂ m>h and m^(1−t)<2^128. Concavity of log₂(1+x/h) between zero and log₂ m pays the entire base; n=1 is exact and n=0 is accounted separately. Integer strong induction gives L(n)≤nᵗ(1+log₂(n)/h)^128. + +At the actual N=2^H, H=299610000000000, exact integer powers verify h^128·2^4875≤(H+h)^128256H and ln2>1/2. The smaller terminal numerator fails. Original q>2^45N⁵ and d=1/(H·2³⁸) give 1+64N⁵/q2*H*p,"one fewer terminal unit is inadmissible") + d=Q(old_bit["delayed_cover_debit"]); C=Q(old_bit["peer_finite"]["tested_saving"]) + check(d==Q(1,H*2**38)==Q(independent["cover_loss"]) and Q(L,H)==Q(independent["uniform_loss"]), + "same physical cover and new whole-carrier uniform charge") + covered=C-d-Q(L,H) + cap=price(covered,independent["stages"],Q(".00385248")) + tick=Q(1,10**14) + k=(min(cap,Q(base["rational_raw"][0]))//tick-8)*tick + check(covered==Q(independent["covered"]) and cap==Q(independent["cap"]) and k==Q(independent["claim"]) + and k+7*tick==Q(independent["tested"])Q(1,10**11) and k-Q(s["claim"])==Q(independent["gain"]), + "relaxed R348 proof separation") + bind_primary(primary,independent) + return cap + + +def main(): + cli=ArgumentParser(description=__doc__) + for name in ("peer-package","cover-package","prior-run","prior-accept","primary","independent","out"): + cli.add_argument("--"+name,required=True,type=Path) + a=cli.parse_args() + check(sys.version_info[:2]==(3,12) and sys.implementation.name=="cpython" and __debug__,"CPython 3.12") + old=previous_adapter(a.cover_package/"application/replay.py") + s=read(a.prior_run/"REPLAY.json",PREVIOUS) + signed=read(a.prior_accept,"35481cf9a929a3dd137a9e63134b7e97ee7c5408d4e675a3e8ad67b16d9a7b71") + check(signed["outcome"]=="PASS_COMPLETE_INDEPENDENT_NORMALIZED_ACCEPTANCE" and signed["claim"]==s["claim"],"R348 complete acceptance") + prior_app=read(a.prior_run/"APPLICATION.json",s["output_sha256"]["APPLICATION.json"]) + old_bit=read(a.prior_run/"BINARY.json",s["output_sha256"]["BINARY.json"]) + old_primary=read(a.cover_package/"primary/PRICE.json",old.PRIMARY) + old_audit=read(a.cover_package/"independent/PRICE.json",old.INDEPENDENT) + primary=read(a.primary,PRIMARY) + independent=read(a.independent,INDEPENDENT) + a.out.mkdir(exist_ok=False) + with TemporaryDirectory() as tmp: + work=Path(tmp) + peer=old.peer_copy(work/"peer-code",a.peer_package) + base=peer.read("APPLICATION.json") + check(old.certify(old_primary,old_audit,base)==Q(".003890115176583"),"R347 and #8027 controls") + cap=pair(primary,independent,s,old_bit,base) + package=peer.source_tree(work,base) + original=old.normalize(old.binary(peer,work,package,base,old_primary)) + check(original["peer_finite"]==old_bit["peer_finite"] and original["delayed_cover_debit"]==old_bit["delayed_cover_debit"], + "fresh original stock and signed 36-call bill") + engine=sys.modules["binary_price"] + seed=Q(".00385248") + prior_cap,prior_four=engine.bootstrap(seed,Q(old_bit["covered"]),[i["claim"] for i in old_bit["candidate_stages"]]) + check(prior_cap==Q(s["cap"]) and old.normalize(prior_four)==old_bit["candidate_stages"],"reprice R348 original stock") + targets=[] + for i in independent["stages"]: + z=Q(i["cap"])*10**15 + check(z.denominator==1,"strict-stage fixed point") + targets.append(f"0.{int(z):015d}") + admission,four=engine.bootstrap(seed,Q(independent["covered"]),targets) + check(admission==cap,"new complete ordinary bootstrap") + old.save(a.out/"BINARY.json",dict(prior_binary_sha256=s["output_sha256"]["BINARY.json"], + peer_finite=original["peer_finite"],delayed_cover_debit=original["delayed_cover_debit"], + uniform_loss=independent["uniform_loss"],covered=independent["covered"],candidate_stages=four,admitted=independent["cap"])) + print("PASS paid tail, root and infinite-height endpoints, original stock and native 36-call bill",flush=True) + new_app=dict(base,binary_ordinary=independent["cap"],claim=independent["claim"]) + word,layout,physical=peer.rational_application(work,package,new_app,cap) + physical=old.normalize(physical) + prior_physical=read(a.prior_run/"PHYSICAL.json",s["output_sha256"]["PHYSICAL.json"]) + for key in ("caller","caller_proof","caller_census","native","conversion","compiler_controls","common_root"): + check(physical[key]==prior_physical[key],"unchanged physical "+key) + for key in ("invoice","ordinary","bracket"): + check(physical["application"][key]==prior_physical["application"][key],"unchanged signed "+key) + check(physical["caller_census"]["calls"]==base["rational_calls"]==48 + and physical["caller_proof"]["readback"]["event_stream_sha256"]==physical["caller"]==s["caller"], + "signed caller and readback phases") + del prior_physical + control=old.outer_prices(peer,work,base,prior_app,physical) + check(control["H"]==prior_app["H"] and control["outer"]==prior_app["outer"],"original #8027 and R348 signed prices") + new=old.outer_prices(peer,work,prior_app,new_app,physical) + new_app.update(H=new["H"],outer=new["outer"]) + peer.audit(work,package,new_app,cap,word,layout,physical) + check(new["outer"]["BIT_just_below_effective_rejected"] and new["outer"]["strict_count"]==54 + and new["outer"]["functional_count"]==4 and s["premises"]==new_app["premises"],"complete signed controls") + old.save(a.out/"APPLICATION.json",new_app) + old.save(a.out/"PHYSICAL.json",physical) + files=("APPLICATION.json","BINARY.json","PHYSICAL.json") + old.save(a.out/"REPLAY.json",dict(peer_head=old.HEAD,source_archive=base["source_archive"],source_count=base["source_count"], + prior_receipt_sha256=PREVIOUS,prior_adapter_sha256=ADAPTER,primary_sha256=PRIMARY,independent_sha256=INDEPENDENT, + cap=independent["cap"],tested=independent["tested"],claim=independent["claim"],old_claim=s["claim"],difference=independent["gain"], + percent_gain=independent["percent"],old_relaxed_ceiling=independent["old_relaxed_ceiling"], + strict_separation=independent["separation"],outer=new["outer"],caller=physical["caller"], + rational_raw=new_app["rational_raw"],premises=new_app["premises"], + controls=["original_peer_stock_and_signed_gate","R348_four_stages_and_signed_gate","both_Minkowski_endpoints", + "terminal_J_minus_one_rejected","below_effective_cap_rejected","one_extra_rank_one_paid_rejected"], + output_sha256={name:sha256((a.out/name).read_bytes()).hexdigest() for name in files})) + print("PASS_COMPLETE_PAID_TAIL_APPLICATION",independent["claim"],independent["tested"],independent["gain"],flush=True) + + +def bind_primary(primary,independent): + check(primary["result"]=="PASS_WHOLE_TUPLE_PRICE_SIGNED_REPLAY_REQUIRED" + and independent["decision"]=="ADVANCE_ONE_SIGNED_REPLAY","both independently certified inputs") + check(primary["case"]["top_cut"]==independent["cutoff"] and primary["case"]["Lp_bound"]==independent["norm_upper"] + and all(primary["case"][k]==independent[k] for k in ("p","h","H")) + and primary["L"]==independent["uniform_numerator"],"identified price point") + shared=("cap","claim","tested","uniform_loss","cover_loss","covered","gain","percent","separation","eta_lower") + check(all(Q(primary[k])==Q(independent[k]) for k in shared) and primary["prior_claim"]==independent["old_claim"], + "both full prices and signed grid") + for k,j in (("endpoint_g0","root_ratio"),("endpoint_infinity","infinite_height_ratio"),("relaxed_old_ceiling","old_relaxed_ceiling")): + check(Q(primary[k])==Q(independent[j]),"matched "+k) + check(Q(primary["one_label_moment_upper"])1 else (D(0),D(0)) + s=D(exponent.numerator)/D(exponent.denominator) + check(F(s)==exponent and s>=0,"exact exponent") + bounds=[(s*lo).next_minus().exp().next_minus(),(s*hi).next_plus().exp().next_plus()] + return F(bounds[0]),F(bounds[1]),F(lo),F(hi) + + +def out(q,n=20): + return F((q*10**n).__ceil__(),10**n) + + +def distribution(T,P,t,old): + u=F(1,5) + with localcontext() as ctx: + ctx.prec=64 + w={r:weight(r,t) for r in T.keys() | P.keys()} + pt_lo=sum(n*w[r][0] for r,n in P.items()) + tt_hi=sum(n*w[r][1] for r,n in T.items()) + tt_lo=sum(n*w[r][0] for r,n in T.items()) + l15=weight(15,u) + pu_hi=sum(n*weight(r,t+u)[1] for r,n in P.items()) + raw_hi=out(sum(n*w[r][1]*w[r][3] for r,n in P.items())/(pt_lo*l15[2])) + alpha_lo=F((pt_lo/tt_hi*10**20).__floor__(),10**20) + gamma_hi=out(pu_hi/(tt_lo*l15[0])) + check(alpha_lo>0 and alpha_lo=F(old["gamma"]["lower"]), "original ratios") + # Enclose the positive excess at a stable rational grid before powering. + excess=out(2*out(gamma_hi/alpha_lo)**768) + check(raw_hi+excess<=F(3,4),"completed mean exceeds frozen bound") + return {"raw_mean_upper":str(raw_hi),"alpha_lower":str(alpha_lo),"gamma_upper":str(gamma_hi), + "split_uplift_upper":str(excess),"extra_recursive_mass":0,"completed_mean_upper":str(raw_hi+excess)} + + +def coefficients(p,eta): + # Independently form S(i,j) on the falling-factor basis. Clear all + # denominators in the binomial-polynomial numerator and denominator. + sn=[[1]] + for i in range(1,p+1): + prev=sn[-1] + sn.append([0]+[j*(prev[j] if j0,"positive denominator "+str(j)) + ratio=F(3**j*a*50**p,4**(j+1)*20**p*b) + ratios.append(ratio) + if ratio>=eta: + return ratios,j + return ratios,None + + +def decimal(x,n): + z=x*10**n + check(z.denominator==1 and 00 and T[8]>0 and 64**256*8**512==16**768,"complete positions, attained floor") + check(sep["specialized_initial_and_final"]==0 and sep["owned_allocation_records_bound"]=="2*18906^768" + and sep["construction"]=="chronological product; specialize low complete targets to owned zero; retain all original paid calls; split paid calls on disjoint axes" + and F(sep["strict_normalized_gap"]["lower"])>0,"full paid stock incl. boundary work") + C=F(b["tested_saving"]); t=1-C;H=peer["binary_H"]; h,p,v=1024,128,768 + check((H,C)==(299610000000000,F("0.003890115276594")),"trial and carrier") + J=15**v; K=16**v; A=134**v + check((1<<(20*h))<=J**7 and ((1<=J**21 and K**50>=J**51,"signed natural-log ratios") + check(7*v>h and 128**v < A < 256**v and 8*v*Crelaxed+F(1,10**11),"whole-construction shortfall") + print("PASS source and whole-word feasibility",flush=True) + law=distribution(T,P,t,sep) + print("PASS weighted full split law",flush=True) + ratios,failure=coefficients(p,eta) + peak=max(range(len(ratios)),key=ratios.__getitem__) + data={"pins":dict(sorted(PINS.items())),"member_pins":{MEMBER:TRIM},"case":{"H":H,"p":p,"h":h,"q":"3/4"}, + "law":law,"old_relaxed_ceiling":str(relaxed),"eta_lower":str(eta), + "ratios":[str(x) for x in ratios],"peak_index":peak,"peak":str(ratios[peak]), + "failed_coefficient":failure,"unvisited_coefficients":p+1-len(ratios),"g0_ratio":str(ratios[0])} + if failure is not None: + data["decision"]="FIXED_COEFFICIENT_EXCLUSION" + return data + L=(((H+h)**p)//h**p).bit_length() + check(h**p*2**(L-1)<=(H+h)**p2*H*p,"terminal, preceding debit and all larger widths") + d=F(binary["delayed_cover_debit"]); seed=F(".00385248"); rational=F(peer["rational_raw"][0]) + check(d==1/F(H*2**38),"positive cover unchanged") + old,old_claim,old_test,_=stage(C,seed,d,23731,H,rational) + check((old,old_claim,old_test)==tuple(previous[k] for k in ("cap","claim","tested")),"old signed price") + cap,k,tested,rows=stage(C,seed,d,L,H,rational) + check(F(k)>relaxed+F(1,10**11),"directed separation") + data.update(decision="ADVANCE_ONE_SIGNED_REPLAY",uniform_numerator=L,cap=cap,claim=k,tested=tested, + covered=str(C-d-F(L,H)),uniform_loss=str(F(L,H)),cover_loss=str(d),stages=rows, + old_claim=old_claim,gain=str(F(k)-F(old_claim)),percent=str(100*(F(k)-F(old_claim))/F(old_claim)), + separation=str(F(k)-relaxed)) + return data + + +if __name__=="__main__": + ap=ArgumentParser() + for key in PINS: + ap.add_argument("--"+key.replace("_","-"),required=True,type=Path,dest=key) + ap.add_argument("--out",required=True,type=Path);args=ap.parse_args() + result=solve(args) + with args.out.open("x") as f: + json.dump(result,f,indent=2,sort_keys=True);f.write("\n") + print(result["decision"],result["peak_index"],result.get("claim")) diff --git a/research/p104-paired-delayed-cover/weighted/controls/mean.py b/research/p104-paired-delayed-cover/weighted/controls/mean.py new file mode 100644 index 0000000000..795270039f --- /dev/null +++ b/research/p104-paired-delayed-cover/weighted/controls/mean.py @@ -0,0 +1,101 @@ +# SPDX-License-Identifier: Apache-2.0 +"""Use one previously certified paid-law ceiling in the fixed p=128 basis test.""" +from argparse import ArgumentParser +from fractions import Fraction as F +from hashlib import sha256 +from math import comb +from pathlib import Path +import json +import runpy +import sys + +METHOD="e0961b875a7f4db9e53f4f2910cad969ea4bb86f0f453ec6ca13a2cb1d0e7559" +RECEIPT="0239f7f69dea671a66a37e3bcaae61c16d23dc794812d519d1c020821332ad36" + + +def check(flag, label): + if not flag: + raise ValueError(label) + + +def solve(args): + check(sha256(args.predecessor_checker.read_bytes()).hexdigest()==METHOD,"predecessor checker") + check(sha256(args.predecessor_price.read_bytes()).hexdigest()==RECEIPT,"predecessor exclusion") + prev=json.loads(args.predecessor_price.read_bytes()) + auditor=runpy.run_path(str(args.predecessor_checker)) + for key,pin in auditor["PINS"].items(): + check(sha256(getattr(args,key).read_bytes()).hexdigest()==pin,"pinned source "+key) + # Run the unmodified paid-law calculation only. Its prior coefficient scan + # is separately authenticated; every new candidate comparison uses q=67/100. + read=lambda p:json.loads(p.read_bytes()) + peer=read(args.application);prior=read(args.prior_price);signed=read(args.accept);b=read(args.binary) + check(signed["outcome"]=="PASS_COMPLETE_INDEPENDENT_NORMALIZED_ACCEPTANCE" and signed["claim"]==prior["claim"],"complete R348 control") + native=peer["binary_native"]; P={int(r):n for r,n in native["paid_all"].items()};T={int(r):n for r,n in native["productive_all"].items()} + sep=b["peer_finite"]["finite_separation"] + check(native["paid_all"]==sep["paid"] and native["productive_all"]==sep["targets"] + and 64**256*8**512==16**768 and min(T[64],T[8])>0,"signed product labels") + C=F(b["peer_finite"]["tested_saving"]);t=1-C + law=auditor["distribution"](T,P,t,sep) + check(law==prev["law"] and F(law["completed_mean_upper"])<=F(67,100),"exact reusable mean") + case=prev["case"];p,h,H=(case[k] for k in ("p","h","H")) + check((p,h,H)==(128,1024,299610000000000) and case["q"]=="3/4" + and prev["failed_coefficient"]==8 and len(prev["ratios"])==9,"scope of original failure") + v=768;J=15**v;K=16**v;A=134**v + check((1<<(20*h))<=J**7 and ((1<=J**21 and K**50>=J**51 and 7*v>h and 8*v*Cold_ceiling+F(1,10**11),"fixed fully charged shortfall") + eta=F(prev["eta_lower"]) + check(eta==F(b["peer_finite"]["uniform"]["eta"]["lower"]) + and F(prev["ratios"][8])>F(b["peer_finite"]["uniform"]["eta"]["upper"]),"known failure against upper capacity") + S=[[1]] + for i in range(1,p+1): + last=S[-1] + S.append([0]+[j*(last[j] if j0,"positive denominator") + ratio=F(67**j*a*50**p,100**(j+1)*20**p*z) + ratios[j]=ratio + if ratio>=eta: + failure=j + break + tested=list(ratios) + peak=max(tested,key=ratios.__getitem__) + print("COEFFICIENTS",len(tested),"peak",peak,"first failed",failure,flush=True) + data={"pins":{**dict(sorted(auditor["PINS"].items())),"previous_checker":METHOD,"previous_receipt":RECEIPT}, + "h":h,"q":"67/100","p":p,"H":H,"law":law,"eta_lower":str(eta),"tested_indices":tested, + "ratios":{str(j):str(ratios[j]) for j in tested},"unresolved_indices":[j for j in range(p+1) if j not in ratios], + "peak_index":peak,"peak":str(ratios[peak]),"failed_index":failure,"old_relaxed_ceiling":str(old_ceiling)} + if failure is not None: + data["decision"]="FIXED_COEFFICIENT_EXCLUSION" + return data + L=(((H+h)**p)//h**p).bit_length() + check(h**p*2**(L-1)<=(H+h)**p2*H*p,"terminal, preceding debit and all larger widths") + d=F(b["delayed_cover_debit"]); seed=F(".00385248"); rational=F(peer["rational_raw"][0]) + check(d==F(1,H*2**38),"positive cover unchanged") + old,old_claim,old_test,_=auditor["stage"](C,seed,d,23731,H,rational) + check((old,old_claim,old_test)==tuple(prior[k] for k in ("cap","claim","tested")),"full predecessor control") + cap,k,tested,rows=auditor["stage"](C,seed,d,L,H,rational) + check(F(k)>old_ceiling+F(1,10**11),"strict directed improvement") + data.update(decision="ADVANCE_ONE_SIGNED_REPLAY",uniform_numerator=L,cap=cap,claim=k,tested=tested, + covered=str(C-d-F(L,H)),uniform_loss=str(F(L,H)),cover_loss=str(d),stages=rows, + old_claim=old_claim,gain=str(F(k)-F(old_claim)),percent=str(100*(F(k)-F(old_claim))/F(old_claim)), + separation=str(F(k)-old_ceiling)) + return data + + +if __name__=="__main__": + ap=ArgumentParser() + for key in ("predecessor_checker","predecessor_price","accept","application","archive","binary","prior_price","weighted","out"): + ap.add_argument("--"+key.replace("_","-"),required=True,type=Path,dest=key) + args=ap.parse_args() + check(sys.version_info[:2]==(3,12) and __debug__,"CPython 3.12 non-optimized") + result=solve(args) + with args.out.open("x") as f: + json.dump(result,f,indent=2,sort_keys=True);f.write("\n") + print(result["decision"],result.get("claim")) diff --git a/research/p104-paired-delayed-cover/weighted/independent/ACCEPT.json b/research/p104-paired-delayed-cover/weighted/independent/ACCEPT.json new file mode 100644 index 0000000000..8c776ce409 --- /dev/null +++ b/research/p104-paired-delayed-cover/weighted/independent/ACCEPT.json @@ -0,0 +1,113 @@ +{ + "caller": "156fdf3a4a129b39225fd6ca51011de27974d7f104e8b04907c17ed5344bc858", + "cap": "0.003890115260308", + "claim": "0.00389011526022", + "gain_vs_peer": "4593/25000000000000", + "gain_vs_previous": "6293/100000000000000", + "invoice": { + "P": { + "1": 183312, + "16": 1248, + "2": 38016, + "24": 1248, + "3": 23040, + "32": 1248, + "4": 10848, + "40": 1248, + "48": 1248, + "5": 15072, + "56": 1248, + "6": 1968, + "7": 480, + "8": 1344 + }, + "T": { + "1": 1008, + "129": 624, + "17": 1248, + "2": 432, + "25": 1248, + "3": 480, + "33": 1248, + "4": 11568, + "41": 1248, + "49": 1248, + "5": 1584, + "57": 1248, + "6": 48, + "65": 1248, + "7": 672, + "8": 1584, + "9": 25872 + } + }, + "known_good": [ + "8027", + "normalized_uniform" + ], + "moment_endpoints": [ + "86361685550944446253863518628003995711160003644362813850237034701685918031624270579715075034722882265605472939461496635969950989468319466936530037770580747746862471103668212890625/5969104346894268081227127544369532170015095312194834027929354042567350669542387998506329070754173609675893918520514338828907331836642624775378397111250585828101167849594706641664032932626866298080824462934016", + "3464823841570940447511989197632600142600357270938450628136751668972148475371287127017463688665854485527890158948205456823643544339574873447418212890625/31438508665248587260582831903168193798224918146861981871343795372991732345781536726224251645729386355831780309674298407083784970278050966323510245488971991041" + ], + "native_calls": [ + 36, + 48 + ], + "ordinary_stages": [ + [ + "12039/3125000", + "83427758996331821445806820049/21446919192576000000000000000000", + "3889964719277/1000000000000000", + "26418103319268049/21446919192576000000000000000000" + ], + [ + "3889964719277/1000000000000000", + "83430974723312982305256770257/21446919192576000000000000000000", + "1945057329077/500000000000000", + "28734370592066257/21446919192576000000000000000000" + ], + [ + "1945057329077/500000000000000", + "16686197517244179536725095773/4289383838515200000000000000000", + "3890115257909/1000000000000000", + "7925881108378973/4289383838515200000000000000000" + ], + [ + "3890115257909/1000000000000000", + "16686197527534497152999830877/4289383838515200000000000000000", + "972528815077/250000000000000", + "8011668785149277/4289383838515200000000000000000" + ] + ], + "outcome": "PASS_COMPLETE_INDEPENDENT_WEIGHTED_ACCEPTANCE", + "outer": { + "BIT_just_below_effective_rejected": true, + "functional_count": 4, + "minimum_margin": "1/1000000000000000", + "strict_count": 54 + }, + "outputs": { + "APPLICATION.json": "75135ac29a60407b5a8af98dcdd7fdda05b1be976e5046a2b387fa4b7765e39c", + "BINARY.json": "d39f8db2807e95c7de47fb6c7cdd24abf1b1fa1925357e3a7112528b772b3344", + "PHYSICAL.json": "d71bd4c2c8ceffd8c57030ec2317d093f4a90386ea313f3511a06366a08b2278" + }, + "peer_head": "fb9b6a7b0d27da1cf98430893a3016bf811e2aa4", + "percent_vs_peer": "12248/2593410051", + "percent_vs_previous": "89900/55573074247", + "premises": [ + "native_all_columns", + "owned_erasure", + "compiler", + "precision_tape", + "analytic_recovery" + ], + "previous_ceiling_separation": "12663029/239688000000000000", + "prior_replay_sha256": "9b00a17913efb76995b01c7b75f5b00aab394a0531e26490ab02a5940adcac3c", + "rejections": [ + "terminal_numerator_minus_one", + "extra_paid_rank_one", + "cap_equals_tested" + ], + "replay_sha256": "65473eba091d40551586a3e078bb6c4155813ba64e7207e0698765a2e738da0d", + "tested": "0.00389011526029" +} diff --git a/research/p104-paired-delayed-cover/weighted/independent/PRICE.json b/research/p104-paired-delayed-cover/weighted/independent/PRICE.json new file mode 100644 index 0000000000..06b7bf0a31 --- /dev/null +++ b/research/p104-paired-delayed-cover/weighted/independent/PRICE.json @@ -0,0 +1,73 @@ +{ + "H": 299610000000000, + "cap": "0.003890115260308", + "claim": "0.00389011526022", + "cover_loss": "1/82356169699491840000000000", + "covered": "1001171851654551333637190603/257363030310912000000000000000", + "cutoff": "4/5", + "decision": "ADVANCE_ONE_SIGNED_REPLAY", + "eta_lower": "54987100261909318350917/125000000000000000000000000000", + "gain": "6293/100000000000000", + "h": 1024, + "high_mass_upper": "45663178725605719/250000000000000000000000", + "infinite_height_ratio": "3464823841570940447511989197632600142600357270938450628136751668972148475371287127017463688665854485527890158948205456823643544339574873447418212890625/31438508665248587260582831903168193798224918146861981871343795372991732345781536726224251645729386355831780309674298407083784970278050966323510245488971991041", + "markov_base_upper": "49/50", + "moment_upper": "225137338821911654772894290724588484544545709242052620882565167230861293824028912386108919/1232595164407830945955825883254353483864385054857848444953560829162597656250000000000000000000000", + "norm_guard_power": "139008452377144732764939786789661303114218850808529137991604824430036072629766435941001769154109609521811665540548899435521/100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "norm_upper": "9/10", + "old_claim": "0.00389011519729", + "old_relaxed_ceiling": "23310348345714559/5992200000000000000", + "p": 128, + "pass_endpoints": [ + true, + true + ], + "percent": "89900/55573074247", + "pins": { + "accept": "35481cf9a929a3dd137a9e63134b7e97ee7c5408d4e675a3e8ad67b16d9a7b71", + "application": "587ece477179606eed6fd9a334ac6d6e27f0067f82c3d6281993736e0570a76f", + "archive": "d85d011ca74e8592c21c1e4db91a1a9021af26dcebc4dfdc2af7251f9c1bf968", + "binary": "f4aad2d07449c864479f26cc3b3ed4bbd8321f0ca14e1efc8676b28b54c27ed4", + "law_checker": "e0961b875a7f4db9e53f4f2910cad969ea4bb86f0f453ec6ca13a2cb1d0e7559", + "law_receipt": "0239f7f69dea671a66a37e3bcaae61c16d23dc794812d519d1c020821332ad36", + "prior_failed_certificate": "ea84892ef2b2da5572e7cdabe54d228ee74f6671d11f87bd6aa263306fd8ffdc", + "prior_price": "523d6dc93a7cd34bf6183a66d03b624ab2f0dfcf18b7e95032b7d0ab695fa24f", + "weighted": "28e0308f315a583282291fa01998d53a874b4b7e3073cacc3ddbb38c5a7f66c7" + }, + "raw_high_mass_upper": "45663178725603219/250000000000000000000000", + "root_ratio": "86361685550944446253863518628003995711160003644362813850237034701685918031624270579715075034722882265605472939461496635969950989468319466936530037770580747746862471103668212890625/5969104346894268081227127544369532170015095312194834027929354042567350669542387998506329070754173609675893918520514338828907331836642624775378397111250585828101167849594706641664032932626866298080824462934016", + "separation": "12663029/239688000000000000", + "source_alpha_lower": "49999999999322758753/50000000000000000000", + "source_gamma_upper": "43779143423714297457/50000000000000000000", + "stages": [ + { + "bound": "83427758996331821445806820049/21446919192576000000000000000000", + "cap": "3889964719277/1000000000000000", + "previous": "12039/3125000", + "slack": "26418103319268049/21446919192576000000000000000000" + }, + { + "bound": "83430974723312982305256770257/21446919192576000000000000000000", + "cap": "1945057329077/500000000000000", + "previous": "3889964719277/1000000000000000", + "slack": "28734370592066257/21446919192576000000000000000000" + }, + { + "bound": "16686197517244179536725095773/4289383838515200000000000000000", + "cap": "3890115257909/1000000000000000", + "previous": "1945057329077/500000000000000", + "slack": "7925881108378973/4289383838515200000000000000000" + }, + { + "bound": "16686197527534497152999830877/4289383838515200000000000000000", + "cap": "972528815077/250000000000000", + "previous": "3890115257909/1000000000000000", + "slack": "8011668785149277/4289383838515200000000000000000" + } + ], + "tested": "0.00389011526029", + "total_split_uplift_upper": "1/100000000000000000000", + "u": "1/5", + "uniform_loss": "1219/74902500000000", + "uniform_numerator": 4876 +} diff --git a/research/p104-paired-delayed-cover/weighted/independent/PROOF.md b/research/p104-paired-delayed-cover/weighted/independent/PROOF.md new file mode 100644 index 0000000000..5cf44c3560 --- /dev/null +++ b/research/p104-paired-delayed-cover/weighted/independent/PROOF.md @@ -0,0 +1,22 @@ +# One high-tail bound for all paid exits + +For the #8027 768-factor word, p=128, h=1024 and threshold a=4/5, the completed paid label X satisfies ‖X‖₁₂₈<9/10. The resulting log-moment ratios at heights zero and infinity are respectively below 1.447×10⁻²⁹ and 1.103×10⁻⁷. Both lie below the directed source-complement capacity 4.39896802095×10⁻⁷. This proves all intermediate heights and replaces the Bernoulli coefficient tests that failed in R349 and R350. The paid raw crossing and underlying circuits are unchanged. + +**Complete paid law.** Take C=0.003890115276594, t=1−C, v=768 and J=15^v. In the raw ordered tensor let R be the paid rank under t-weight (total normalizing mass Pₜ^v). Its Markov bound for R>J^a is +`Pr(R>J^a) ≤ (γ·15^(u(1−a))/α)^v`, where α=Pₜ/Tₜ, γ=Pₜ₊ᵤ/(15ᵘ Tₜ) and u=1/5. This is the direct product of all one-letter paid moment ratios. Exact integer powers give 15^(1/25)<223/200. Reusing the independently reconstructed directed α lower and γ upper bounds gives one-letter Markov factor ≤49/50 and a raw high mass at most 45663178725603219/250000000000000000000000. The signed native count is 104904 paid positions, with 18906 productive positions. Low productive targets are erased as owned zeros. The original 2·18906^768 allocation/restoration records remain charged. + +If a completed child label exceeds J^a, its raw parent exceeds J^a. For unsplit parents its paid t-mass is unchanged. For split parents every child’s total t-mass is bounded by the original mass plus its proven positive split excess. Since a<1, every split parent R>J was included in the raw marked event. Summing all positive excess is safe; its bound is 2(γ/α)^v times Pₜ^v and is at most 10^-20 after normalization. Subadditivity of x^t gives completed denominator at least Pₜ^v. Therefore, for X=ln(child rank)/ln J, Pr(X>a)≤raw bound+10^-20. Since 0≤X≤1, E X^128≤(4/5)^128+Pr(X>a)<(9/10)^128. The full positive excess, all omitted-target credit, all remainders, ordinary boundary service and 36-call native invoice are retained. [Literal #8027 supplier](https://github.com/aliromman/integer-mult-bounds/tree/fb9b6a7b0d27da1cf98430893a3016bf811e2aa4/research/p104-live-relative-gain) + +**All heights.** Put K=16^768 and A=134^768. Among retained targets, 256 rank-64 factors and 512 rank-8 factors attain K. The ambient-capped chronological construction thus has maximal depth G=floor(log_K(n/A)). At depth l every chronological path of paid calls with product ρ≤J^l has a degree G−l unit because AρK^(G−l)≤AK^G≤n. Missing parents create sources. At depth G the degree-zero unit has multiplicity one and emits the complete paid list. This includes G=0, when the root emits exactly one list. Under paid t-weight, each of the G+1 positions in an exit therefore has the same marginal ‖X‖₁₂₈ bound. The proof takes a norm of a finite integer invoice; no physical independence is needed for Minkowski. [Exact exit enumeration](https://github.com/CrocSwap/integer-mult-bounds/blob/4cf054a50c5718616594ec4ca2c9114278120a8b/research/net-tax-rank-compiler/WEIGHTED-EXITS.md) + +The logarithmic guards at h=1024 give a shift upper a₀=7/20, base lower b₀=21/10 and height slope β=51/50. Minkowski bounds the normalized 128th-moment ratio by `((a₀+(G+1)9/10)/(b₀+βG))^128`. The fraction is a convex combination of its endpoint ratios with weights b₀/(b₀+βG) and βG/(b₀+βG); both denominators are positive. Thus it suffices to check exactly the two endpoint powers reported above. The actual capacity lower η=tA^(t−1) is inherited from the directed supplier. In the all-size induction, for 0≤n≤A the normalized factor covers the ordinary base by concavity. At positive source fractions y=s/n>1/A, 1−(1−y)^t≥ηy^t funds the complete exits using the retained nonnegative t-moment surplus. Zero complements cost zero. Monotonicity of the log factor and decreasing child ranks finish strong induction. [Ambient source and complement proof](https://github.com/CrocSwap/integer-mult-bounds/blob/e54523517d0f03e58352e647c403a5af3e525a57/research/p104-shared-native-helper-splits/retained/compiler/PROOF.md#L225-L289) + +**Complete conditional price.** For H=299610000000000, the least integer L with (H+h)^p2Hp makes the log comparison persist for every larger width. Keep R347's original prime and positive cover loss d=1/(H·2^38); the new covered saving is C−4876/H−d. Replaying the four strict stock stages, restored ordinary backend and signed grid yields cap 0.003890115260308, tested 0.00389011526029 and claim 0.00389011526022. It clears even the deliberately relaxed R348 ceiling (grant raw upper, charge only 23731/H) by 12663029/239688000000000000, above the extra 10^-11 guard. The price increase against R348 is 6293/10^14, exactly (89900/55573074247)%. The independent signed acceptance checks the complete physical result, billed ranks and these same four stages. + +One fixed 45-second case completed in 0.038143 s cold, with 15 seconds reserved for verification. Deterministic receipt SHA-256 0f43bebea0a8a4a258e14ea7495ed9d2bdbfe8f952dafd423d7e1651b4807332. The checker authenticates the old failure and R348 signed acceptance. All five physical/compiler premises remain in force. Credit Ali Romman and the retained signed-reader authors for #8027, zxv for the weighted exit distribution, Jacob Alan Sussman and DreamingOfClouds for the whole-job and ambient flow, the earlier #8026 paid-uplift proof, and the R347/R348 original stock and signed checks. OpenAI Codex materially assisted the proof and verification. + +```sh +python3.12 -IB scripts/research_package.py --package research/p104-paired-delayed-cover +``` + +The registered replay reconstructs the complete signed application and independently authenticates the achieved bound. [Signed acceptance](ACCEPT.json) diff --git a/research/p104-paired-delayed-cover/weighted/independent/accept.py b/research/p104-paired-delayed-cover/weighted/independent/accept.py new file mode 100644 index 0000000000..53f12b3b23 --- /dev/null +++ b/research/p104-paired-delayed-cover/weighted/independent/accept.py @@ -0,0 +1,211 @@ +# SPDX-License-Identifier: Apache-2.0 +"""Bind one complete weighted-exit supplier to its literal 48-call signed application.""" +from argparse import ArgumentParser +from collections import Counter +from fractions import Fraction as Q +from hashlib import sha256 +import json +from pathlib import Path +import runpy +import sys +import tarfile +from tempfile import TemporaryDirectory + + +def check(condition, reason): + if not condition: + raise ValueError(reason) + + +def unique(pairs): + data = dict(pairs) + check(len(data) == len(pairs), "duplicate key") + return data + + +def read(path, expected): + data = path.read_bytes() + check(sha256(data).hexdigest() == expected, "digest mismatch in " + path.name) + return json.loads(data, object_pairs_hook=unique) + + +def run_files(root, sha): + record = read(root/"REPLAY.json", sha) + names = ("BINARY.json", "PHYSICAL.json", "APPLICATION.json") + check(set(names) == set(record["output_sha256"]), "run inventory") + return (record, *(read(root/n, record["output_sha256"][n]) for n in names)) + + +def different(a, b): + return sorted(k for k in a.keys() | b.keys() if a.get(k) != b.get(k)) + + +def physical_invoice(peer, physical, prior, application, previous): + bank = read(peer/"BANK-FACTORS-RECEIPT.json", "bdb3052152bdd15ae36c30c98877dcebf864fc2c58a7b1fa66f2d5affa149288") + caller = read(peer/"CALLER-CENSUS.json", "6a685bdc50aeba01a79fa437490190568513d62e0765844e7f3e8fa29a913e16") + check(different(physical, prior) == ["application"] and + different(physical["application"], prior["application"]) == ["claim","compiler"], + "phase, ownership, precision, route, tape, ordinary cost or conservation changed") + check(different(application, previous) == ["binary_ordinary","claim"], "unexpected change to result summary") + check(physical["caller"] == physical["caller_proof"]["readback"]["event_stream_sha256"] == + "156fdf3a4a129b39225fd6ca51011de27974d7f104e8b04907c17ed5344bc858", "signed caller") + native = physical["native"] + check(native["retired_and_guards_restored"] and native["all_public_inputs_preserved_until_final_installs"] + and native["same_owner_complete_fixture_outputs"] == native["exact_all_public_rows"] == + native["exact_source_columns"] == bank["public"] == 1291, "independent rows and restoration") + check(all(physical["caller_census"][k] == v for k,v in caller.items()) and caller["calls"] == 48 and + application["binary_native"]["calls"] == 36, "signed caller counts") + invoice = {} + for key, nkey, ckey, bkey, actual in ( + ("T","positive_helper_ranks","fixed_root_targets","productive","targets"), + ("P","paid_native_ranks","fixed_caller_paid","paid","paid"), + ): + total = Counter({r:n*caller["calls"] for r,n in native[nkey].items()}) + total.update(caller[ckey]) + check(total == bank[bkey] == physical["application"]["invoice"][actual], "signed invoice "+key) + invoice[key] = dict(total) + return invoice + + +def signed_gate(peer, base, invoice, previous, app, physical): + archive = peer/"APPLICATION-SOURCES.tar.gz" + check(sha256(archive.read_bytes()).hexdigest() == base["source_archive"], "exact gate archive") + with tarfile.open(archive) as tar: + source = tar.extractfile("source/research/p104-dual-supplier-lift/complex/supplier_gate.py").read() + check(sha256(source).hexdigest()=="3796b2e5a27f3caa142d16364154788e60d0099f1e24a8dcd028e4fbd35a84ca", "gate") + with TemporaryDirectory() as work: + path=Path(work)/"gate.py" + path.write_bytes(source) + gate=runpy.run_path(str(path))["gate"] + tick=Q(1,10**14) + def calculate(data, weights, cap): + k=Q(data["claim"]) + gate.__globals__["BIT_PIN"]=str(Q(data["binary_ordinary"])) + return gate(weights,k,k+7*tick,*data["rational_raw"],cap) + for data in (base,previous,app): + result=calculate(data,invoice,Q(data["binary_ordinary"])) + check(result["H"]==data["H"] and result["outer"]==data["outer"], "signed positive control") + check(result==physical["application"]["compiler"] and result["outer"]["strict_count"]==54 and + result["outer"]["functional_count"]==4 and Q(result["outer"]["minimum_margin"])>0,"all signed checks") + damaged={"T":invoice["T"],"P":dict(invoice["P"])} + damaged["P"]["1"]+=1 + for weights,cap in ((damaged,Q(app["binary_ordinary"])),(invoice,Q(app["claim"])+7*tick)): + try: + calculate(app,weights,cap) + except (AssertionError,ValueError): + continue + raise ValueError("negative signed control accepted") + return result["outer"] + + +def ordinary(bit, previous, previous_result, h, J, trial): + H=299610000000000 + check(bit["peer_finite"]==previous["peer_finite"] and bit["prior_binary_sha256"]== + previous_result["output_sha256"]["BINARY.json"], "original stock and 36-call binary") + check(h==1024 and h**128 * 2**(J-1) <= (h+H)**128 < h**128 * 2**J and + (h+H)*J > 2*H*128, "minimal terminal and tail") + cover=Q(1,H*2**38) + check(Q(bit["uniform_loss"])==Q(J,H) and Q(bit["delayed_cover_debit"])==cover==Q(previous["delayed_cover_debit"]), + "separate uniform and cover charges") + covered=trial-Q(J,H)-cover + check(covered==Q(bit["covered"]), "full covered price") + stage=Q("0.00385248") + rows=[] + check(len(bit["candidate_stages"])==4, "all four restored stages") + for row in bit["candidate_stages"]: + bound=(249*covered+stage)/250 + admitted=Q((bound*10**15)//1-1,10**15) + slack=min(bound-admitted,Q(1,250)-admitted,Q(249,250)-admitted) + check(stage==Q(row["previous"]) and admitted==Q(row["claim"]) and stage0 and + Q(row["envelope"][0])<=bound<=Q(row["envelope"][1]), "complete stage") + rows.append([str(stage),str(bound),str(admitted),str(slack)]) + stage=admitted + check(stage==Q(bit["admitted"]), "terminal cap") + return stage,rows + + +def moment_guards(independent, finite): + theta = Q(4,5) + norm = Q(9,10) + alpha = Q(independent["source_alpha_lower"]) + gamma = Q(independent["source_gamma_upper"]) + split = Q(independent["total_split_uplift_upper"]) + upper = Q(independent["raw_high_mass_upper"]) + check(Q(223,200)**25 > 15 and gamma/alpha*Q(223,200) <= Q(49,50) and + upper >= Q(49,50)**768 and 2*(gamma/alpha)**768 <= split, "original paid law and all positive split surplus") + check(theta**128+upper+split == Q(independent["moment_upper"]) < norm**128 == + Q(independent["norm_guard_power"]), "128th moment") + guards = (((Q(7,20)+norm)/Q(21,10))**128, (norm/Q(51,50))**128) + eta = Q(finite["uniform"]["eta"]["lower"]) + check(guards == (Q(independent["root_ratio"]),Q(independent["infinite_height_ratio"])) and + eta == Q(independent["eta_lower"]) and max(guards)Q(1,10**11) and + claim-prev_k==Q(independent["gain"]), "true previous-proof ceiling and gain") + check_source_prices(primary,independent,signed) + return dict(outcome="PASS_COMPLETE_INDEPENDENT_WEIGHTED_ACCEPTANCE",peer_head=signed["peer_head"],prior_replay_sha256=prior_id, + replay_sha256=REPLAY,outputs=signed["output_sha256"],invoice=invoice,caller=physical["caller"],native_calls=[36,48], + cap=app["binary_ordinary"],claim=app["claim"],tested=signed["tested"],gain_vs_previous=str(claim-prev_k), + percent_vs_previous=str(100*(claim-prev_k)/prev_k),gain_vs_peer=str(claim-peer_k),percent_vs_peer=str(100*(claim-peer_k)/peer_k), + previous_ceiling_separation=str(gap),ordinary_stages=rows,moment_endpoints=endpoint_ratios,outer=outer, + known_good=["8027","normalized_uniform"],rejections=["terminal_numerator_minus_one","extra_paid_rank_one","cap_equals_tested"], + premises=app["premises"]) + + +if __name__=="__main__": + check(sys.implementation.name=="cpython" and sys.version_info[:2]==(3,12) and __debug__,"CPython 3.12 with assertions") + parser=ArgumentParser() + for k in ("peer","prior-accept","prior-run","run","primary","independent","out"): + parser.add_argument("--"+k,type=Path,required=True) + a=parser.parse_args() + result=main(a) + with a.out.open("x") as f: + json.dump(result,f,sort_keys=True,indent=2) + f.write("\n") + print(result["outcome"],result["claim"],result["gain_vs_previous"]) diff --git a/research/p104-paired-delayed-cover/weighted/independent/price.py b/research/p104-paired-delayed-cover/weighted/independent/price.py new file mode 100644 index 0000000000..a8d9ce6cf5 --- /dev/null +++ b/research/p104-paired-delayed-cover/weighted/independent/price.py @@ -0,0 +1,108 @@ +# SPDX-License-Identifier: Apache-2.0 +"""One charged paid-tail interval and two all-height Minkowski endpoints.""" +from argparse import ArgumentParser +from fractions import Fraction as F +from hashlib import sha256 +from pathlib import Path +import json +import runpy +import sys + + +LAW_CHECKER="e0961b875a7f4db9e53f4f2910cad969ea4bb86f0f453ec6ca13a2cb1d0e7559" +LAW_RECEIPT="0239f7f69dea671a66a37e3bcaae61c16d23dc794812d519d1c020821332ad36" +MEAN_FAILURE="ea84892ef2b2da5572e7cdabe54d228ee74f6671d11f87bd6aa263306fd8ffdc" + + +def need(test,reason): + if not test: + raise ValueError(reason) + + +def locked(path,sha): + blob=path.read_bytes() + need(sha256(blob).hexdigest()==sha,"source hash "+path.name) + return blob + + +def upward(q): + return F((q*10**24).__ceil__(),10**24) + + +def prove(args): + old=json.loads(locked(args.law_receipt,LAW_RECEIPT)) + stopped=json.loads(locked(args.failure,MEAN_FAILURE)) + locked(args.law_checker,LAW_CHECKER) + lawlib=runpy.run_path(str(args.law_checker)) + raw={k:locked(getattr(args,k),pin) for k,pin in lawlib["PINS"].items()} + peer=json.loads(raw["application"]); prior=json.loads(raw["prior_price"]) + accepted=json.loads(raw["accept"]); binary=json.loads(raw["binary"]) + need(accepted["outcome"]=="PASS_COMPLETE_INDEPENDENT_NORMALIZED_ACCEPTANCE" and accepted["claim"]==prior["claim"],"R348 accepted") + need(stopped["failed_index"]==11 and stopped["q"]=="67/100" and old["failed_coefficient"]==8,"frozen pivot") + finite=binary["peer_finite"]; sep=finite["finite_separation"]; native=peer["binary_native"] + p,h,H=128,1024,peer["binary_H"] + C=F(finite["tested_saving"]); t=1-C + A,J,K=134**768,15**768,16**768 + need(native["calls"]==36 and native["paid_all"]==sep["paid"] and native["productive_all"]==sep["targets"] + and (C,H)==(F("0.003890115276594"),299610000000000),"fixed physical source and rate") + P={int(k):n for k,n in native["paid_all"].items()};T={int(k):n for k,n in native["productive_all"].items()} + need(sum(P.values())==104904 and sum(T.values())==18906 and min(T[64],T[8])>0 and 64**256*8**512==K, + "complete paid stock and actual floor") + need(sep["specialized_initial_and_final"]==0 and sep["owned_allocation_records_bound"]=="2*18906^768" + and sep["construction"]=="chronological product; specialize low complete targets to owned zero; retain all original paid calls; split paid calls on disjoint axes" + and F(sep["strict_normalized_gap"]["lower"])>0,"all ordinary boundaries and full split law") + need(1<<(20*h)<=J**7 and ((1<=J**21 and K**50>=J**51 and A>128**768 and 7*768>h and 8*768*C15,"power for one-letter tail") + need(quotient*F(223,200)<=F(49,50) and quotient<1,"directed Markov factor") + raw_high=upward(F(49,50)**768) + # For split tuples w/parent > J, total completed t-mass minus raw + # t-mass is positive and bounded by 2 gamma^768 times T_t^768. + uplift=F(law["split_uplift_upper"]) + need(uplift==F(1,10**20) and 2*quotient**768<=uplift,"all split positive excess charged") + tail=raw_high+uplift + moment=a**p+tail + need(moment2*H*p,"neighboring integer debits, whole upper tail") + d=F(binary["delayed_cover_debit"]); seed=F(".00385248");rat=F(peer["rational_raw"][0]) + need(d==F(1,H*2**38) and H*d/2==F(64,2**45),"actual cover surcharge") + oc,ok,ot,_=lawlib["stage"](C,seed,d,23731,H,rat) + need((oc,ok,ot)==tuple(prior[k] for k in ("cap","claim","tested")),"preceding four-stage price") + cap,k,tested,rows=lawlib["stage"](C,seed,d,L,H,rat) + U=F(peer["binary_raw"][1])-F(23731,H) + need(F(k)>U+F(1,10**11),"fully charged relaxed predecessor separation") + out.update(decision="ADVANCE_ONE_SIGNED_REPLAY",uniform_numerator=L,cap=cap,claim=k,tested=tested, + covered=str(C-d-F(L,H)),uniform_loss=str(F(L,H)),cover_loss=str(d),stages=rows, + old_claim=ok,gain=str(F(k)-F(ok)),percent=str(100*(F(k)-F(ok))/F(ok)), + old_relaxed_ceiling=str(U),separation=str(F(k)-U)) + return out + + +if __name__=="__main__": + cmd=ArgumentParser() + for key in ("law_checker","law_receipt","failure","accept","application","archive","binary","prior_price","weighted","out"): + cmd.add_argument("--"+key.replace("_","-"),required=True,type=Path,dest=key) + a=cmd.parse_args() + need(sys.version_info[:2]==(3,12) and __debug__,"CPython 3.12") + result=prove(a) + with a.out.open("x") as f: + json.dump(result,f,indent=2,sort_keys=True);f.write("\n") + print(result["decision"],result["pass_endpoints"],result.get("claim"),result.get("cap")) diff --git a/research/p104-paired-delayed-cover/weighted/moment/PROOF.md b/research/p104-paired-delayed-cover/weighted/moment/PROOF.md new file mode 100644 index 0000000000..7e04077af9 --- /dev/null +++ b/research/p104-paired-delayed-cover/weighted/moment/PROOF.md @@ -0,0 +1,31 @@ +# A 41-term audit of the completed paid log moment + +At h=1024, p=40 and the original physical carrier H=299610000000000, the smallest terminal numerator is **1524**. The complete ordinary cap is 0.003890115271496. The signed price selects tested 0.00389011527148 and complete κ=0.00389011527141. This is 0.00000000001119 above fully reproduced R351, exactly (18650/64835254337) percent, and 0.00000000019491 above peer #8027, exactly (12994/2593410051) percent. The new point clears the generous R351 complete ceiling raw_upper−4876/H by exactly 6528443/5992200000000000000. The fresh independent signed application passed at this cap. [Peer construction and contracts](https://github.com/CrocSwap/integer-mult-bounds/pull/8027) + +## One-letter bound and charged completion + +Let v=768, c=15, J=c^v, K=16^v, m=134^v, C=0.003890115276594, and t=1−C. Take Pᵣ from the entire signed 36-call paid native inventory, including caller operations. Under its t-weight law, Y=ln r/ln c, supported on [0,3/2] since max paid rank 56 satisfies 56²<15³. The independent price reader rounds each positive rᵗ and ln(r) outward and bounds ΣPᵣrᵗ ln(r)/(ΣPᵣrᵗ ln15) ≤0.668205196471034<67/100. R350’s checked complete mean and R351’s raw paid/target ratio provide controls. The normalized raw tensor log of an original paid rank R is X_raw=ln R/ln J=(ΣYᵢ)/v with v independent coordinates **in this finite t-weighted raw tuple measure**. Their total paid mass Q equals (ΣPᵣrᵗ)^v. + +For each coordinate, the chord inequality on [0,3/2] bounds an increasing convex function by its expectation on the two endpoints 0,3/2 with upper endpoint probability q=(67/100)/(3/2)=67/150. Iterate the conditional expectation of ((ΣYᵢ)/v)^40 one coordinate at a time. The comparison gives E_raw[X_raw^40] ≤ (3/(2v))^40 E[B^40] for B~Binomial(v,q). Falling-factorial moments are (v)_j q^j. The exact power moment is Σⱼ₌₀⁴⁰ S(40,j)(v)_j q^j with nonnegative Stirling coefficients. All 41 terms are in receipt.json; term zero vanishes. The known mean of B is 8576/25. The resulting raw upper bound is <3.633·10⁻⁷. + +Raw tuples R≤J remain single labels. A larger rank has X_raw>1, and every paid child after the actual slab split has X≤1. Therefore the new log-moment numerator minus the prior numerator on that tuple is ≤Σ_child rᵗ−Rᵗ, the full positive split excess. The completed denominator is ≥Q. As proved from the positive charged #8027 histogram and tail u=1/5, this excess divided by Q is ≤2(γ_upper/α_lower)^768, with α=Pₜ/Tₜ, γ=Pₜ₊ᵤ/(15ᵘTₜ). The checker also derives the direct ratio Pₜ₊ᵤ/(15ᵘPₜ) from paid inventory and verifies the directed inequality. Productive deletion adds precisely zero recursive completing labels: the transfer specializes to owned zeros, retains every original paid call and charges all boundary ordinary records. The full normalized uplift is <9.668·10⁻⁴⁵. No independence for the coordinates of a *post-split* slab is required. This proves E_complete[X^40]<(7/10)^40, whose right side exceeds 6.366·10⁻⁷. + +## All heights, integer jobs and full paid price + +The attained productive floor K has positive factors 256 ranks 64 and 512 ranks 8. For n≥m, G=floor(log_K(n/m)). Every paid-prefix class remains present since its multiplier ≤J^l and filling the remaining G−l factors with K keeps its ambient ≤n. Missing parents introduce fresh source jobs. Every present parent matches smaller child targets in the same integral flow. At depth G, the degree-zero point of multiplicity one emits every paid label, including when G=0. Thus the complete normalized exits enumerate all length-G+1 sequences of actual separated labels. Their t-weight distribution is the product of their completed single-label t-law. The proof operates on exact labelled multiplicities, with the original common divisor of source and exit counts. [Integer source proof](https://github.com/CrocSwap/integer-mult-bounds/blob/e54523517d0f03e58352e647c403a5af3e525a57/research/p104-shared-native-helper-splits/retained/compiler/PROOF.md#6-ambient-cap-version-of-the-exact-finite-flow) · [Weighted-exit theorem](https://github.com/CrocSwap/integer-mult-bounds/blob/4cf054a50c5718616594ec4ca2c9114278120a8b/research/net-tax-rank-compiler/WEIGHTED-EXITS.md) + +Let a=h ln2. The integer source guards give a/ln J≤7/20, (a+ln m)/ln J≥21/10, ln K/ln J≥51/50. For the G+1 completed labels, the L⁴⁰ triangle inequality gives an exit numerator upper 7/20+(G+1)·7/10. Divide by 21/10+(51/50)G. This ratio lies between its values at G=0 and G→∞ because it is a weighted average of the two. Its 40th powers at those endpoints are bounded by 9.095·10⁻¹³ and 2.884·10⁻⁷ respectively; both are strictly less than the original source-complement η=t·m^(t−1)>4.398·10⁻⁷. Summing the retained t-superpotential pays all exits from source complements, including zero remainders and roots. At small ranks, log₂m>h and 8vC<40; concavity of log₂(1+x/h) from x=0 to x=log₂m yields the required majorant for every base n, including n=1 with equality and n=0 separately. Strong integer induction then gives all-size normalized paid leaves. + +Exact integer powers at N=2^H verify h^40 2^1523≤(H+h)^4080H and ln2>1/2, the ratio stays below its allowed exponential for all larger log-widths. The frozen physical q>2^45N⁵ and d=1/(H·2³⁸) pay the same strict fallback under the same actual prime, W(w)^D S_old, ownership, route, restoration, precision and tape obligations. The certified covered input is C−1524/H−d. Four levels from 0.00385248 pay all three ordinary terms and subtract one tick after the 10⁻¹⁵ floor. The final signed grid deducts all eight ticks, with seven ticks from claim to tested. The R351 known-good four-stage result reproduces; no-tail-credit and one-lower terminal controls fail. All five physical contracts and the original raw crossing remain unchanged. + +## Clean replay and scope + +The registered command authenticates the #8027 archive, reconstructs all predecessor prices, then evaluates the new 41-term calculation, independent 769-atom comparison and complete signed consumer under CPython 3.12. + +```sh +python3.12 -IB scripts/research_package.py --package research/p104-paired-delayed-cover +``` + +Only p=40, h=1024 and the stated norm bound were tested in this proof. The fresh signed replay gave κ=0.00389011527141 at tested point 0.00389011527148, with ordinary cap 0.003890115271496. The independent reader confirmed the price and paid-positive, cap-equality and terminal negatives. [Signed application](application/RESULT.json) · [Independent acceptance](independent/ACCEPT.json) + +Ali Romman supplied the paired circuits and composed replay, Clear1nsight the finite compiler and audits, Jacob Alan Sussman and DreamingOfClouds the integer flow and ambient generalization, and zxv the normalized and weighted-exit estimates. Prior #8026 supplied the coordinatewise paid-log moment and split-uplift idea on another word. The p=128 result here established transfer on the 768-factor word. OpenAI Codex materially assisted. [Peer construction](https://github.com/CrocSwap/integer-mult-bounds/pull/8027) · [Earlier component](https://github.com/CrocSwap/integer-mult-bounds/pull/8026) diff --git a/research/p104-paired-delayed-cover/weighted/moment/application/RESULT.json b/research/p104-paired-delayed-cover/weighted/moment/application/RESULT.json new file mode 100644 index 0000000000..ac9d77bb88 --- /dev/null +++ b/research/p104-paired-delayed-cover/weighted/moment/application/RESULT.json @@ -0,0 +1,49 @@ +{ + "caller": "156fdf3a4a129b39225fd6ca51011de27974d7f104e8b04907c17ed5344bc858", + "cap": "0.003890115271496", + "claim": "0.00389011527141", + "controls": [ + "original_peer_stock_and_signed_gate", + "R351_four_stages_and_signed_gate", + "both_Minkowski_endpoints", + "769_direct_vs_41_Stirling_terms", + "terminal_J_minus_one_rejected", + "below_effective_cap_rejected", + "one_extra_rank_one_paid_rejected" + ], + "difference": "1119/100000000000000", + "independent_sha256": "5c9d36bad5d7fca162d135e9d8658ab408a6d89edd262be167747cc164c12229", + "old_claim": "0.00389011526022", + "old_relaxed_ceiling": "23310348722814559/5992200000000000000", + "outer": { + "BIT_just_below_effective_rejected": true, + "functional_count": 4, + "minimum_margin": "1/1000000000000000", + "strict_count": 54 + }, + "output_sha256": { + "APPLICATION.json": "e3ece7fbc9906d04b80f3a200f38a791856d86326d705bb559cfa9763ae0da81", + "BINARY.json": "ef447314f827a1747709d442a6c8f179e5033230d704fac19b22fa5f1772b096", + "PHYSICAL.json": "f2ecf4245c1e580495eceb77e68859ecf1dbeec63fa0251deb82ecce8e419aff" + }, + "peer_head": "fb9b6a7b0d27da1cf98430893a3016bf811e2aa4", + "percent_gain": "18650/64835254337", + "premises": [ + "native_all_columns", + "owned_erasure", + "compiler", + "precision_tape", + "analytic_recovery" + ], + "primary_sha256": "8c09bcccce796c9b01efed5d9363af8fe6b8719f588eb6de5148933411a8850d", + "prior_adapter_sha256": "d6dd8f406e4e09377b2539a744ada909d3ab44baefdec17d0af450d6e867f051", + "prior_receipt_sha256": "65473eba091d40551586a3e078bb6c4155813ba64e7207e0698765a2e738da0d", + "rational_raw": [ + "0.00389848144654", + "0.00389848144655" + ], + "source_archive": "d85d011ca74e8592c21c1e4db91a1a9021af26dcebc4dfdc2af7251f9c1bf968", + "source_count": 134, + "strict_separation": "6528443/5992200000000000000", + "tested": "0.00389011527148" +} diff --git a/research/p104-paired-delayed-cover/weighted/moment/application/replay.py b/research/p104-paired-delayed-cover/weighted/moment/application/replay.py new file mode 100644 index 0000000000..fa3d221821 --- /dev/null +++ b/research/p104-paired-delayed-cover/weighted/moment/application/replay.py @@ -0,0 +1,165 @@ +# SPDX-License-Identifier: Apache-2.0 +"""Bind one authenticated source-moment supplier proof to the complete signed #8027 consumer.""" +from argparse import ArgumentParser +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 + + +ADAPTER = "d6dd8f406e4e09377b2539a744ada909d3ab44baefdec17d0af450d6e867f051" +PREVIOUS = "65473eba091d40551586a3e078bb6c4155813ba64e7207e0698765a2e738da0d" +PRIMARY = "8c09bcccce796c9b01efed5d9363af8fe6b8719f588eb6de5148933411a8850d" +INDEPENDENT = "5c9d36bad5d7fca162d135e9d8658ab408a6d89edd262be167747cc164c12229" + + +def check(flag, message): + if not flag: + raise ValueError(message) + + +def read(path, pin): + data = path.read_bytes() + check(sha256(data).hexdigest()==pin, "input SHA-256 "+path.name) + return json.loads(data) + + +def previous_adapter(path): + check(sha256(path.read_bytes()).hexdigest()==ADAPTER,"R347 adapter") + spec=importlib.util.spec_from_file_location("fixed_cover_adapter",path) + module=importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + return module + + +def price(covered,rows,seed): + previous=seed + check(len(rows)==4,"four original ordinary service levels") + for row in rows: + envelope=(249*covered+previous)/250 + cap=Q((envelope*10**15).__floor__()-1,10**15) + check(previous==Q(row["previous"]) and cap==Q(row["cap"]) and envelope==Q(row["bound"]) + and envelope-cap==Q(row["slack"]) and previous0 and independent["direct_terms"]==769 + and (Q(3,2*v)**p)*sum(terms)==Q(primary["raw_moment_upper"])==direct, + "exact direct binomial and falling-factor sum agree") + check(Q(primary["extra_recursive_completion"])==0 and Q(independent["completed_moment"])==direct+Q(independent["full_split_upper"]) + and Q(primary["complete_moment_upper"])==direct+Q(primary["positive_split_uplift_upper"]) + and max(Q(primary["complete_moment_upper"]),Q(independent["completed_moment"]))2*H*p,"exact terminal plus tail") + C=Q(prior_bit["peer_finite"]["tested_saving"]);d=Q(prior_bit["delayed_cover_debit"]) + check(d==Q(1,H*2**38) and Q(prior_bit["uniform_loss"])==Q(4876,H),"actual R351 charges") + for key in ("cap","claim","tested","uniform_loss","cover_loss","covered","gain","percent","separation","eta_lower","relaxed_old_ceiling"): + check(Q(primary[key])==Q(independent[key]),"complete two-way price "+key) + covered=C-d-Q(L,H); cap=price(covered,independent["stages"],Q(".00385248")) + check(Q(independent["covered"])==covered and cap==Q(independent["cap"]) and Q(independent["cover_loss"])==d,"full peer cost admission") + for a,b in zip(primary["stages"],independent["stages"],strict=True): + for k,j in (("admitted","cap"),("endpoint","bound"),("previous","previous"),("charged_minimum_slack","slack")): + check(Q(a[k])==Q(b[j]),"both bootstrap certificates") + tick=Q(1,10**14);claim=(min(cap,Q(base["rational_raw"][0]))//tick-8)*tick + ceiling=Q(base["binary_raw"][1])-Q(4876,H) + check(Q(s["claim"])==Q(independent["old_claim"]) and claim==Q(independent["claim"]) + and claim+7*tick==Q(independent["tested"])0, + "strict directed R351 separation and complete grid") + return cap + + +if __name__=="__main__": + main() diff --git a/research/p104-paired-delayed-cover/weighted/moment/independent/ACCEPT.json b/research/p104-paired-delayed-cover/weighted/moment/independent/ACCEPT.json new file mode 100644 index 0000000000..cd60835b3d --- /dev/null +++ b/research/p104-paired-delayed-cover/weighted/moment/independent/ACCEPT.json @@ -0,0 +1,113 @@ +{ + "caller": "156fdf3a4a129b39225fd6ca51011de27974d7f104e8b04907c17ed5344bc858", + "cap": "0.003890115271496", + "claim": "0.00389011527141", + "gain_vs_peer": "19491/100000000000000", + "gain_vs_previous": "1119/100000000000000", + "invoice": { + "P": { + "1": 183312, + "16": 1248, + "2": 38016, + "24": 1248, + "3": 23040, + "32": 1248, + "4": 10848, + "40": 1248, + "48": 1248, + "5": 15072, + "56": 1248, + "6": 1968, + "7": 480, + "8": 1344 + }, + "T": { + "1": 1008, + "129": 624, + "17": 1248, + "2": 432, + "25": 1248, + "3": 480, + "33": 1248, + "4": 11568, + "41": 1248, + "49": 1248, + "5": 1584, + "57": 1248, + "6": 48, + "65": 1248, + "7": 672, + "8": 1584, + "9": 25872 + } + }, + "known_good": [ + "8027", + "R351 full accepted" + ], + "moment_term_counts": [ + 41, + 769 + ], + "native_calls": [ + 36, + 48 + ], + "ordinary_stages": [ + [ + "12039/3125000", + "83427759235317545690594020049/21446919192576000000000000000000", + "194498236521/50000000000000", + "29121785232100049/21446919192576000000000000000000" + ], + [ + "194498236521/50000000000000", + "83430974963254638632295467729/21446919192576000000000000000000", + "1945057334671/500000000000000", + "22258771090475729/21446919192576000000000000000000" + ], + [ + "1945057334671/500000000000000", + "83430987826166414456118840017/21446919192576000000000000000000", + "3890115269097/1000000000000000", + "37014251494968017/21446919192576000000000000000000" + ], + [ + "3890115269097/1000000000000000", + "83430987877618002537492515537/21446919192576000000000000000000", + "486264408937/125000000000000", + "37443189878819537/21446919192576000000000000000000" + ] + ], + "outcome": "PASS_COMPLETE_INDEPENDENT_40TH_MOMENT_ACCEPTANCE", + "outer": { + "BIT_just_below_effective_rejected": true, + "functional_count": 4, + "minimum_margin": "1/1000000000000000", + "strict_count": 54 + }, + "outputs": { + "APPLICATION.json": "e3ece7fbc9906d04b80f3a200f38a791856d86326d705bb559cfa9763ae0da81", + "BINARY.json": "ef447314f827a1747709d442a6c8f179e5033230d704fac19b22fa5f1772b096", + "PHYSICAL.json": "f2ecf4245c1e580495eceb77e68859ecf1dbeec63fa0251deb82ecce8e419aff" + }, + "peer_head": "fb9b6a7b0d27da1cf98430893a3016bf811e2aa4", + "percent_vs_peer": "12994/2593410051", + "percent_vs_previous": "18650/64835254337", + "premises": [ + "native_all_columns", + "owned_erasure", + "compiler", + "precision_tape", + "analytic_recovery" + ], + "previous_ceiling_separation": "6528443/5992200000000000000", + "prior_replay_sha256": "65473eba091d40551586a3e078bb6c4155813ba64e7207e0698765a2e738da0d", + "rejections": [ + "one lower terminal", + "added rational paid rank one", + "supplied cap equals tested rate" + ], + "replay_sha256": "0fed060d852e6e37c1ff4ffe514d5765c9efdd6e0a3a24f6bc59cbbdcc7b0d79", + "tested": "0.00389011527148" +} diff --git a/research/p104-paired-delayed-cover/weighted/moment/independent/PRICE.json b/research/p104-paired-delayed-cover/weighted/moment/independent/PRICE.json new file mode 100644 index 0000000000..21bfa1936b --- /dev/null +++ b/research/p104-paired-delayed-cover/weighted/moment/independent/PRICE.json @@ -0,0 +1,77 @@ +{ + "H": 299610000000000, + "binomial_probability": "67/150", + "cap": "0.003890115271496", + "claim": "0.00389011527141", + "completed_moment": "1574590389800944577619197096899926319949061821979304875747111601112243650669710579110475194626956283578693312535697379289884679096624913535483143822665092209189/4335147257421198269013889602576615157509964448961739333360913602083732444470768688251336801648640000000000000000000000000000000000000000000000000000000000000000000000", + "cover_loss": "1/82356169699491840000000000", + "covered": "1001171854533897408875590603/257363030310912000000000000000", + "decision": "ADVANCE_ONE_SIGNED_REPLAY", + "direct_terms": 769, + "eta_lower": "54987100261909318350917/125000000000000000000000000000", + "full_split_upper": "1/100000000000000000000", + "gain": "1119/100000000000000", + "h": 1024, + "infinite_height_ratio": "57905761067641178540192733082440108773880638182163238525390625/200820037536218678526581935459796317182144451848849339719949924452001", + "law": { + "alpha_lower": "49999999999322758753/50000000000000000000", + "completed_mean_upper": "66820519647103349021/100000000000000000000", + "extra_recursive_mass": 0, + "gamma_upper": "43779143423714297457/50000000000000000000", + "raw_mean_upper": "3341025982355167451/5000000000000000000", + "split_uplift_upper": "1/100000000000000000000" + }, + "norm_budget": "6366805760909027985741435139224001/10000000000000000000000000000000000000000", + "norm_upper": "7/10", + "old_claim": "0.00389011526022", + "one_letter_maximum": "3/2", + "one_letter_mean_budget": "67/100", + "p": 40, + "percent": "18650/64835254337", + "pins": { + "accept": "32d40619c37fdcf91f63930e3ebdf1ec0e19210f91e4f1a74617fcc1b3ada10c", + "application": "587ece477179606eed6fd9a334ac6d6e27f0067f82c3d6281993736e0570a76f", + "archive": "d85d011ca74e8592c21c1e4db91a1a9021af26dcebc4dfdc2af7251f9c1bf968", + "binary": "f4aad2d07449c864479f26cc3b3ed4bbd8321f0ca14e1efc8676b28b54c27ed4", + "law": "e0961b875a7f4db9e53f4f2910cad969ea4bb86f0f453ec6ca13a2cb1d0e7559", + "mean": "ea84892ef2b2da5572e7cdabe54d228ee74f6671d11f87bd6aa263306fd8ffdc", + "old_independent": "0f43bebea0a8a4a258e14ea7495ed9d2bdbfe8f952dafd423d7e1651b4807332", + "old_primary": "4acbb38393550df5b046f125328a67bc344fe592a107556145ac315acf083a34", + "signed": "65473eba091d40551586a3e078bb6c4155813ba64e7207e0698765a2e738da0d", + "weighted": "28e0308f315a583282291fa01998d53a874b4b7e3073cacc3ddbb38c5a7f66c7" + }, + "raw_moment": "1574590389800901226146622884917236181053036055827729776102621983718910041533689741786030486940073770210676826135697379289884679096624913535483143822665092209189/4335147257421198269013889602576615157509964448961739333360913602083732444470768688251336801648640000000000000000000000000000000000000000000000000000000000000000000000", + "relaxed_old_ceiling": "23310348722814559/5992200000000000000", + "root_ratio": "1/1099511627776", + "separation": "6528443/5992200000000000000", + "stages": [ + { + "bound": "83427759235317545690594020049/21446919192576000000000000000000", + "cap": "194498236521/50000000000000", + "previous": "12039/3125000", + "slack": "29121785232100049/21446919192576000000000000000000" + }, + { + "bound": "83430974963254638632295467729/21446919192576000000000000000000", + "cap": "1945057334671/500000000000000", + "previous": "194498236521/50000000000000", + "slack": "22258771090475729/21446919192576000000000000000000" + }, + { + "bound": "83430987826166414456118840017/21446919192576000000000000000000", + "cap": "3890115269097/1000000000000000", + "previous": "1945057334671/500000000000000", + "slack": "37014251494968017/21446919192576000000000000000000" + }, + { + "bound": "83430987877618002537492515537/21446919192576000000000000000000", + "cap": "486264408937/125000000000000", + "previous": "3890115269097/1000000000000000", + "slack": "37443189878819537/21446919192576000000000000000000" + } + ], + "tested": "0.00389011527148", + "uniform_loss": "127/24967500000000", + "uniform_numerator": 1524, + "v": 768 +} diff --git a/research/p104-paired-delayed-cover/weighted/moment/independent/PROOF.md b/research/p104-paired-delayed-cover/weighted/moment/independent/PROOF.md new file mode 100644 index 0000000000..989eaee891 --- /dev/null +++ b/research/p104-paired-delayed-cover/weighted/moment/independent/PROOF.md @@ -0,0 +1,21 @@ +# The p=40 norm of a completed 768-factor paid label + +The convex upper measure on the 768 actual raw paid coordinates gives a 40th moment no greater than **3.632149720186347×10⁻⁷**. Charging all positive t-mass added by paid splitting gives **3.632149720186447×10⁻⁷**, strictly below (7/10)^40. Thus the complete paid word has L⁴⁰ norm below 7/10 in its normalized log rank. Compared with the R351 bound, this permits reducing the required logarithmic power from 128 to 40 at the same scale, carrier, signed word and cover prime. + +**Where the measure comes from.** The full #8027 36-call paid inventory has 104904 one-letter positions, smallest grade one and largest grade 56. Its 18906 productive positions form a separate histogram. Put C=0.003890115276594 and t=1−C. Weight each paid letter r by its multiplicity times r^t. Write Y=ln(r)/ln(15). The directed source mean calculation from R349, rerun against these literal signed histograms under the authenticated R351 source archive, gives E[Y]≤0.66820519647103349020<67/100. Since 56²<15³, each Y is in [0,3/2]. The t-mass of the full raw ordered tensor is exactly Pₜ^768, so the normalized log rank before splitting is (Y₁+…+Y₇₆₈)/768 for independent coordinates in this finite counting measure. [Fixed #8027 program and native proof](https://github.com/aliromman/integer-mult-bounds/tree/fb9b6a7b0d27da1cf98430893a3016bf811e2aa4/research/p104-live-relative-gain) + +For fixed other coordinates the function f(Y)=((ΣYᵢ)/768)^40 is increasing and convex. Its chord between zero and 3/2, followed by conditional expectation, replaces Y by (3/2)Bernoulli(67/150) as an upper bound. Repeat for the 768 independent raw factors. With B binomial(768,67/150), the resulting bound is (3/1536)^40 E[B^40]. This verifier sums all 769 nonnegative integer weights comb(768,k)67^k83^(768−k) with common denominator 150^768. It checks that they sum to one after normalization and that their first moment is exactly 768·67/150, then sums k^40 with the same weights. The independent primary computes 41 falling-factorial Stirling terms. Both yield the same exact rational moment; their sum equality is also checked before the signed reprice. + +**Completion.** Let J=15^768. For a split parent R>J its raw log rank exceeds one and every child's normalized log lies in [0,1]. Its 40th-log-moment numerator thus increases by at most (Σchildren r^t−R^t). This is nonnegative as a t-mass difference by subadditivity; the log-moment difference itself may have either sign. Summing all positive t-mass uplift gives at most 2(γ/α)^768 Pₜ^768. The previous independently rerun outward rational enclosure charges 10⁻²⁰ after dividing by Pₜ^768. The completed denominator is at least Pₜ^768. The source retains every original paid call and the 2·18906^768 allocation/restoration records; specializing low productive tuples adds zero recursive paths. The R351 peer physical and ownership hooks, precision/tape service and original full inventory remain in the price. This argument uses independence only before splitting. + +**Integer source/complement induction.** The integer flow produces exactly G+1 complete paid labels along each exit at depth G=floor(log_K(n/A)), A=134^768 and K=16^768. The exact signed product of 256 rank-64 and 512 rank-8 productive positions attains K. Every class in the depth-l construction contains the required minimal-degree point since AρK^(G−l)≤AK^G≤n. Missing parents contribute top sources; the G=0 root has degree-zero multiplicity one and all paid children. Under the normalized exit t-mass each of the G+1 labels therefore has the just-proved L⁴⁰ norm. For h=1024 the directed shift parameters a₀=7/20, b₀=21/10, β=51/50 bound the true logs. Minkowski makes the exit-to-parent ratio at most ((a₀+(G+1)·7/10)/(b₀+βG))^40. The fraction is the weighted average of its G=0 and G→∞ limits, so checking these two powers covers every G. Their exact values are 2^-40 and (35/51)^40, each below η_lower=0.000000439896802095274546807336. Monotonicity and 1−(1−s/n)^t≥t A^(t−1)(s/n)^t pay every separate source complement and all exits. The normalized base covers all ranks ≤A by concavity and 7·768>h, 8·768·C<40. Taking F(0)=0 includes zero complements. [Weighted exit theorem](https://github.com/CrocSwap/integer-mult-bounds/blob/4cf054a50c5718616594ec4ca2c9114278120a8b/research/net-tax-rank-compiler/WEIGHTED-EXITS.md) · [Ambient whole-job proof](https://github.com/CrocSwap/integer-mult-bounds/blob/e54523517d0f03e58352e647c403a5af3e525a57/research/p104-shared-native-helper-splits/retained/compiler/PROOF.md#L225-L289) + +**Terminal and full cost.** At the existing H=299610000000000, (H+h)^40 lies in [h^40·2^1523,h^40·2^1524). The log derivative stays positive for log₂ n≥H because (H+h)·1524>2H·40. Charge 1524/H plus the unchanged d=1/(H·2^38), then the four strict original stock stages and the complete signed grid. This yields cap 0.003890115271496, tested 0.00389011527148 and claim 0.00389011527141, a difference 1119/10^14 or exactly (18650/64835254337)% over R351. Even granting the previous proof the raw upper and forgiving every loss other than 4876/H, the candidate clears that relaxed ceiling by 6528443/5992200000000000000. The component price is conditional on the unchanged physical/compiler premises; complete signed replay is the subsequent gate. + +One fixed case took 0.050406 seconds cold under a 45-second cap with 15 seconds reserved for verification. Deterministic receipt 5c9d36bad5d7fca162d135e9d8658ab408a6d89edd262be167747cc164c12229. Ali Romman supplied the #8027 native circuits, Clear1nsight the retained compilers and signed audits, Jacob Alan Sussman and DreamingOfClouds the whole-job/ambient flow, and zxv the paid-exit theorem. The #8026 coordinate-moment argument and R349–351 charged-law work supplied the existing techniques and predecessor controls. OpenAI Codex materially assisted the independent proof and implementation. + +```sh +python3.12 -IB scripts/research_package.py --package research/p104-paired-delayed-cover +``` + +The complete new cap passed the fresh signed consumer and separate price/invoice reconstruction. [Signed acceptance](ACCEPT.json) diff --git a/research/p104-paired-delayed-cover/weighted/moment/independent/accept.py b/research/p104-paired-delayed-cover/weighted/moment/independent/accept.py new file mode 100644 index 0000000000..8c35e86d5f --- /dev/null +++ b/research/p104-paired-delayed-cover/weighted/moment/independent/accept.py @@ -0,0 +1,90 @@ +"""Validate the changed 40th-moment service against both full signed application outputs.""" +from argparse import ArgumentParser +from fractions import Fraction as F +from hashlib import sha256 +import json +from pathlib import Path +import runpy +import sys + +def need(condition, reason): + if not condition: + raise ValueError(reason) + +def digest(path): + return sha256(path.read_bytes()).hexdigest() + +def run(a): + need(digest(a.prior_checker)=='1e6518e266b01d5124eaa71fee4344a28ea07d6655a50376d7779699e2218073','independent 48-call checker') + lib=runpy.run_path(str(a.prior_checker)) + read=lib['read'] + oldsha='65473eba091d40551586a3e078bb6c4155813ba64e7207e0698765a2e738da0d' + oldaccept=read(a.prior_accept,'32d40619c37fdcf91f63930e3ebdf1ec0e19210f91e4f1a74617fcc1b3ada10c') + old,oldbit,oldphys,oldapp=lib['run_files'](a.prior_run,oldsha) + need(oldaccept['outcome']=='PASS_COMPLETE_INDEPENDENT_WEIGHTED_ACCEPTANCE' and + oldaccept['outputs']==old['output_sha256'] and oldaccept['replay_sha256']==oldsha,'fully accepted prior') + pr=read(a.primary,'8c09bcccce796c9b01efed5d9363af8fe6b8719f588eb6de5148933411a8850d') + ind=read(a.independent,'5c9d36bad5d7fca162d135e9d8658ab408a6d89edd262be167747cc164c12229') + peer=read(a.peer/'APPLICATION.json','587ece477179606eed6fd9a334ac6d6e27f0067f82c3d6281993736e0570a76f') + s,bit,physical,app=lib['run_files'](a.run,a.replay_sha) + need(s['prior_receipt_sha256']==oldsha and s['peer_head']==old['peer_head'] and + s['primary_sha256']==digest(a.primary) and s['independent_sha256']==digest(a.independent),'two independently frozen suppliers') + need(pr['case']['p']==ind['p']==40 and pr['case']['v']==ind['v']==768 and + pr['case']['h']==ind['h']==1024 and pr['case']['H']==ind['H']==299610000000000,'same case') + H=ind['H'];h=ind['h'];p=ind['p'];v=ind['v'];L=ind['uniform_numerator'];lam=F(7,10) + need(L==pr['L']==1524 and bit['peer_finite']==oldbit['peer_finite'] and + bit['prior_binary_sha256']==old['output_sha256']['BINARY.json'],'same source, stock and original costs') + need(ind['decision']=='ADVANCE_ONE_SIGNED_REPLAY' and pr['result']=='PASS_FULL_PRICED_MOMENT_SIGNED_REQUIRED','two prices pass') + terms=list(map(F,pr['stirling_terms_0_through_40'])) + scaled=sum(terms)*(F(3,2*v)**p) + need(len(terms)==41 and terms[0]==0 and all(x>0 for x in terms[1:]) and ind['direct_terms']==769 and + scaled==F(pr['raw_moment_upper'])==F(ind['raw_moment']),'exact equality of 769 probability terms and 41 Stirling contributions') + for raw,extra,total in ((scaled,pr['positive_split_uplift_upper'],pr['complete_moment_upper']), + (scaled,ind['full_split_upper'],ind['completed_moment'])): + need(raw+F(extra)==F(total)2*H*p,'first strict carrier and continuous tail') + d=F(1,H*2**38) + need(F(bit['delayed_cover_debit'])==F(oldbit['delayed_cover_debit'])==d and F(bit['uniform_loss'])==F(L,H) and + F(oldbit['uniform_loss'])==F(4876,H),'unmodified complete cover with separately repriced uniform service') + C=F(bit['peer_finite']['tested_saving']) + covered=C-F(L,H)-d;previous=F('0.00385248');rows=[] + need(covered==F(bit['covered'])==F(ind['covered'])==F(pr['covered']),'full covered service') + for ob,ib,pb in zip(bit['candidate_stages'],ind['stages'],pr['stages'],strict=True): + end=(249*covered+previous)/250 + nxt=F(int(end*10**15)-1,10**15);slack=min(end-nxt,F(1,250)-nxt,F(249,250)-nxt) + need(nxt==F(ob['claim'])==F(ib['cap'])==F(pb['admitted']) and F(ob['previous'])==previous and + F(ib['bound'])==F(pb['endpoint'])==end and F(ob['envelope'][0])<=end<=F(ob['envelope'][1]) and + F(ib['slack'])==F(pb['charged_minimum_slack'])==slack>0 and previous0 and delta==F(s['difference'])>0 and app['premises']==oldapp['premises'],'strict signed gain') + return dict(outcome='PASS_COMPLETE_INDEPENDENT_40TH_MOMENT_ACCEPTANCE',peer_head=s['peer_head'],prior_replay_sha256=oldsha, + replay_sha256=a.replay_sha,outputs=s['output_sha256'],invoice=invoice,caller=physical['caller'],native_calls=[36,48], + cap=app['binary_ordinary'],claim=app['claim'],tested=s['tested'],gain_vs_previous=str(delta),percent_vs_previous=str(100*delta/F(old['claim'])), + gain_vs_peer=str(peer_delta),percent_vs_peer=str(100*peer_delta/F(peer['claim'])),previous_ceiling_separation=str(sep),ordinary_stages=rows, + moment_term_counts=[41,769],outer=outer,premises=app['premises'],known_good=['8027','R351 full accepted'], + rejections=['one lower terminal','added rational paid rank one','supplied cap equals tested rate']) +def main(): + cli=ArgumentParser() + for name in ('prior-checker','prior-run','prior-accept','primary','independent','peer','run','out'): + cli.add_argument('--'+name,type=Path,required=True) + cli.add_argument('--replay-sha',required=True) + a=cli.parse_args();need(sys.implementation.name=='cpython' and sys.version_info[:2]==(3,12) and __debug__,'CPython 3.12') + result=run(a) + with a.out.open('x') as f:json.dump(result,f,sort_keys=True,indent=2);f.write('\n') + print(result['outcome'],result['claim'],result['gain_vs_previous']) +if __name__=='__main__': + main() diff --git a/research/p104-paired-delayed-cover/weighted/moment/independent/price.py b/research/p104-paired-delayed-cover/weighted/moment/independent/price.py new file mode 100644 index 0000000000..29feebac70 --- /dev/null +++ b/research/p104-paired-delayed-cover/weighted/moment/independent/price.py @@ -0,0 +1,109 @@ +# SPDX-License-Identifier: Apache-2.0 +"""Independent direct enumeration of the single 768-factor fortieth moment.""" +from argparse import ArgumentParser +from fractions import Fraction as Q +from hashlib import sha256 +from math import comb +from pathlib import Path +import json +import runpy +import sys + + +PINS={ + "law":"e0961b875a7f4db9e53f4f2910cad969ea4bb86f0f453ec6ca13a2cb1d0e7559", + "old_primary":"4acbb38393550df5b046f125328a67bc344fe592a107556145ac315acf083a34", + "old_independent":"0f43bebea0a8a4a258e14ea7495ed9d2bdbfe8f952dafd423d7e1651b4807332", + "accept":"32d40619c37fdcf91f63930e3ebdf1ec0e19210f91e4f1a74617fcc1b3ada10c", + "signed":"65473eba091d40551586a3e078bb6c4155813ba64e7207e0698765a2e738da0d", + "mean":"ea84892ef2b2da5572e7cdabe54d228ee74f6671d11f87bd6aa263306fd8ffdc", + "application":"587ece477179606eed6fd9a334ac6d6e27f0067f82c3d6281993736e0570a76f", + "binary":"f4aad2d07449c864479f26cc3b3ed4bbd8321f0ca14e1efc8676b28b54c27ed4", + "archive":"d85d011ca74e8592c21c1e4db91a1a9021af26dcebc4dfdc2af7251f9c1bf968", + "weighted":"28e0308f315a583282291fa01998d53a874b4b7e3073cacc3ddbb38c5a7f66c7", +} + + +def need(flag,why): + if not flag: + raise ValueError(why) + + +def enumeration(v,p): + # Integer numerators under the one common probability denominator. + mass=first=moment=0 + for k in range(v+1): + w=comb(v,k)*67**k*83**(v-k) + mass+=w + first+=w*k + moment+=w*k**p + den=150**v + need(mass==den and 150*first==67*v*den,"every binomial cell and first moment") + return Q(3,2*v)**p*Q(moment,den) + + +def prove(a): + for key,expected in PINS.items(): + need(sha256(getattr(a,key).read_bytes()).hexdigest()==expected,"input "+key) + lib=runpy.run_path(str(a.law)) + load=lambda p:json.loads(p.read_bytes()) + prev=load(a.old_independent); signed=load(a.signed); accept=load(a.accept);old_primary=load(a.old_primary) + peer=load(a.application); binary=load(a.binary); full=binary["peer_finite"] + need(accept["outcome"]=="PASS_COMPLETE_INDEPENDENT_WEIGHTED_ACCEPTANCE" and all(x["claim"]==prev["claim"] for x in (signed,accept,old_primary)),"R351 independent signed comparator") + p,h,v=40,1024,768 + H=peer["binary_H"]; C=Q(full["tested_saving"]); t=1-C; A,K,J=134**v,16**v,15**v + need((H,C)==(299610000000000,Q("0.003890115276594")),"unchanged carrier and trial") + old_upper=Q(peer["binary_raw"][1])-Q(prev["uniform_numerator"],H) + need(Q(prev["uniform_numerator"])==4876 and C-Q(1560,H)-Q(2,10**13)>old_upper>Q(signed["claim"]),"entire paid opportunity") + sep=full["finite_separation"]; native=peer["binary_native"] + need(native["calls"]==36 and native["paid_all"]==sep["paid"] and native["productive_all"]==sep["targets"] + and sep["construction"]=="chronological product; specialize low complete targets to owned zero; retain all original paid calls; split paid calls on disjoint axes" + and sep["owned_allocation_records_bound"]=="2*18906^768" and sep["specialized_initial_and_final"]==0 + and Q(sep["strict_normalized_gap"]["lower"])>0,"retained whole paid law") + P={int(k):n for k,n in native["paid_all"].items()};T={int(k):n for k,n in native["productive_all"].items()} + need(sum(P.values())==104904 and sum(T.values())==18906 and T[64]*T[8]>0 and 64**256*8**512==K + and min(P)>=1 and max(P)==56 and 56**2<15**3,"one-letter support and attained floor") + need((1<<(20*h))<=J**7 and ((1<=J**21 and K**50>=J**51 + and 7*v>h and 128**v=lam**p: + data["decision"]="NORM_GATE_EXCLUDED"; return data + L=(((H+h)**p)//(h**p)).bit_length() + need(h**p*2**(L-1)<=(H+h)**p2*H*p,"neighboring terminal integers and tail") + d=Q(binary["delayed_cover_debit"]);seed=Q(".00385248");rational=Q(peer["rational_raw"][0]) + need(d==Q(1,H*2**38),"original positive cover") + old,oldk,oldt,_=lib["stage"](C,seed,d,4876,H,rational) + need((old,oldk,oldt)==tuple(signed[k] for k in ("cap","claim","tested")),"prior complete stage and grid price") + cap,k,tested,rows=lib["stage"](C,seed,d,L,H,rational) + need(Q(k)>old_upper>Q(oldk),"strict proof change") + data.update(decision="ADVANCE_ONE_SIGNED_REPLAY",uniform_numerator=L,cap=cap,claim=k,tested=tested,covered=str(C-d-Q(L,H)), + uniform_loss=str(Q(L,H)),cover_loss=str(d),stages=rows,old_claim=oldk, + gain=str(Q(k)-Q(oldk)),percent=str(100*(Q(k)-Q(oldk))/Q(oldk)),separation=str(Q(k)-old_upper)) + return data + + +if __name__=="__main__": + parser=ArgumentParser() + for name in [*PINS,"out"]: + parser.add_argument("--"+name.replace("_","-"),dest=name,type=Path,required=True) + args=parser.parse_args() + need(sys.version_info[:2]==(3,12) and __debug__,"CPython 3.12") + result=prove(args) + with args.out.open("x") as f: + json.dump(result,f,sort_keys=True,indent=2);f.write("\n") + print(result["decision"],result.get("cap"),result.get("claim")) diff --git a/research/p104-paired-delayed-cover/weighted/moment/primary/PRICE.json b/research/p104-paired-delayed-cover/weighted/moment/primary/PRICE.json new file mode 100644 index 0000000000..56386677f6 --- /dev/null +++ b/research/p104-paired-delayed-cover/weighted/moment/primary/PRICE.json @@ -0,0 +1,122 @@ +{ + "L": 1524, + "cap": "0.003890115271496", + "case": { + "H": 299610000000000, + "h": 1024, + "norm_limit": "7/10", + "p": 40, + "q_letter": "67/150", + "raw_support": "3/2", + "v": 768 + }, + "claim": "0.00389011527141", + "complete_moment_upper": "1574590389800901226146622884917236181094946878304308572540099461346663187492382772132455269693391638758674697827664604442462735696827201095658810710058372209189/4335147257421198269013889602576615157509964448961739333360913602083732444470768688251336801648640000000000000000000000000000000000000000000000000000000000000000000000", + "controls": [ + "R351 positive signed control", + "lower terminal insufficient", + "uncertified unit norm fails" + ], + "cover_loss": "1/82356169699491840000000000", + "covered": "1001171854533897408875590603/257363030310912000000000000000", + "endpoint_infinity": "57905761067641178540192733082440108773880638182163238525390625/200820037536218678526581935459796317182144451848849339719949924452001", + "endpoint_zero": "1/1099511627776", + "eta_lower": "54987100261909318350917/125000000000000000000000000000", + "extra_recursive_completion": "0", + "gain": "1119/100000000000000", + "moment_budget": "6366805760909027985741435139224001/10000000000000000000000000000000000000000", + "peer_gain": "19491/100000000000000", + "peer_percent": "12994/2593410051", + "percent": "18650/64835254337", + "pins": { + "peer-application": "587ece477179606eed6fd9a334ac6d6e27f0067f82c3d6281993736e0570a76f", + "peer-archive": "d85d011ca74e8592c21c1e4db91a1a9021af26dcebc4dfdc2af7251f9c1bf968", + "r347-binary": "f4aad2d07449c864479f26cc3b3ed4bbd8321f0ca14e1efc8676b28b54c27ed4", + "r350-mean": "922f50e004b2844054c2be938df676412f7ce6c1963af96f9e231cc1fd016987", + "r351-accept": "32d40619c37fdcf91f63930e3ebdf1ec0e19210f91e4f1a74617fcc1b3ada10c", + "r351-audit": "0f43bebea0a8a4a258e14ea7495ed9d2bdbfe8f952dafd423d7e1651b4807332", + "r351-full": "65473eba091d40551586a3e078bb6c4155813ba64e7207e0698765a2e738da0d", + "r351-helper": "dd1790feeed03c6dd6b3df5c32f60416f814fe67cc2b6cac75d301c2c3702a5a", + "r351-price": "4acbb38393550df5b046f125328a67bc344fe592a107556145ac315acf083a34", + "weighted-theorem": "28e0308f315a583282291fa01998d53a874b4b7e3073cacc3ddbb38c5a7f66c7" + }, + "positive_split_uplift_upper": "38670725572085714983/4000000000000000000000000000000000000000000000000000000000000000", + "prior_cap": "0.003890115260308", + "prior_claim": "0.00389011526022", + "raw_mean_upper": "66820519647103349019472844574565419287146406341338599975232740371/100000000000000000000000000000000000000000000000000000000000000000", + "raw_moment_upper": "1574590389800901226146622884917236181053036055827729776102621983718910041533689741786030486940073770210676826135697379289884679096624913535483143822665092209189/4335147257421198269013889602576615157509964448961739333360913602083732444470768688251336801648640000000000000000000000000000000000000000000000000000000000000000000000", + "relaxed_old_ceiling": "23310348722814559/5992200000000000000", + "result": "PASS_FULL_PRICED_MOMENT_SIGNED_REQUIRED", + "separation": "6528443/5992200000000000000", + "stages": [ + { + "admitted": "194498236521/50000000000000", + "charged_minimum_slack": "29121785232100049/21446919192576000000000000000000", + "endpoint": "83427759235317545690594020049/21446919192576000000000000000000", + "previous": "12039/3125000" + }, + { + "admitted": "1945057334671/500000000000000", + "charged_minimum_slack": "22258771090475729/21446919192576000000000000000000", + "endpoint": "83430974963254638632295467729/21446919192576000000000000000000", + "previous": "194498236521/50000000000000" + }, + { + "admitted": "3890115269097/1000000000000000", + "charged_minimum_slack": "37014251494968017/21446919192576000000000000000000", + "endpoint": "83430987826166414456118840017/21446919192576000000000000000000", + "previous": "1945057334671/500000000000000" + }, + { + "admitted": "486264408937/125000000000000", + "charged_minimum_slack": "37443189878819537/21446919192576000000000000000000", + "endpoint": "83430987877618002537492515537/21446919192576000000000000000000", + "previous": "3890115269097/1000000000000000" + } + ], + "stirling_terms_0_through_40": [ + "0", + "8576/25", + "121142009717069816384/1875", + "3819232399066698667694902062464/46875", + "162204608622303253549274027879840661664/234375", + "5548915235453623390145411221671904103755392/15625", + "4328115336262323773326927488513374738241537349771328/146484375", + "826396826001158340797579914729905003621391699859677146752/1220703125", + "536761092388394412975839256843819973726951449650383182542689424/91552734375", + "3878156202522258075141843076666306018382795482303140310921530233344/164794921875", + "3109161966613924984624185381737256778856372198656104124754899490767961344/61798095703125", + "488620002367886486829313675392781386474266669157972852665899828421811078544384/7724761962890625", + "262351524397217804493081721822423284809196198081137269538492113043971424664876443392/5214214324951171875", + "77543690981508598976298105435276592714364984283329784412937860040618259080921727216896/2896785736083984375", + "432194758279836651070280501411047397139153475290216509386504962996977550242643966865171456/43451786041259765625", + "580352993849671963411419340792334148344810401727427726181134470297527427778179597181674691968/217258930206298828125", + "217137338577812509386390303809670983081518201425298780366615368345503669912179971876301434672450296/407360494136810302734375", + "6097646517264633865614139757171833261151816796675267102336559253553917116675695764015468851971849536/75437128543853759765625", + "289913772683727351630233002273698690179519333850845883819952219960658837900329100692519048302986093496608/30552037060260772705078125", + "80266962712452602688125262464013579419914871286223822735811746695691508956013230567578123559100836407542848/91656111180782318115234375", + "2211797770610110270853385583163270969675651148094087139237436904911339644175328462609300540071198796580995925264/34371041692793369293212890625", + "653909635367389709894247182490805036395342881989286020062133034680044910170795811509142323955324596921691567662016/171855208463966846466064453125", + "784654359232312447013125049095040212866275855430413758343732466214687388360983974005571300013765801895302742639442848/4296380211599171161651611328125", + "28509463324351256020354962946382038106648240590273378336772951923517007350743874545620199347172214622355837689614542144/3978129825554788112640380859375", + "124177451235306749632502850175650281757185534473971899063268078985768570696525078266826972270578330314879105200645536678584/537047526449896395206451416015625", + "132344727344313268496625858841803803402266220896059533920830972892961337242686367508144282194915101780426566537394455917696/21481901057995855808258056640625", + "684636908452979145095702260657518881803406720287479445012504431958950176090877218019526106740941587743049084872476957051855849664/5034820560467778705060482025146484375", + "104515287387381457085452166308767004259680188734099097111929885275927813799896075138640800784178672137613535243596228201009431816576/41956838003898155875504016876220703125", + "3219866995506568866029319266338825075844621604237476656831346522368453420745132071319115209716287965165208998752499735294358164073263584/84962596957893765647895634174346923828125", + "2710222733618386240783194660860823995443182759430439524547942059974848864102113096526384188010190732615082383271056992217732409404874624/5664173130526251043193042278289794921875", + "95633359333928331923622533420400868473190436762539960697334967546264192713254458579682463698933676673126413427044518913587978903466844450112/19116584315526097270776517689228057861328125", + "34363525986115389490681297088203073050790786280241311020603964128893548543891284369020110664968317159292085704415155340468310798994698193280768/796524346480254052949021570384502410888671875", + "18222612656109097340902482069050860232807565299756460322599343390922666449115815301295432261464294384677671902784238770357167832860975784071415256/59739325986019053971176617778837680816650390625", + "523602820797973981775453147585728281476307275802168734325186147734624051479978567442521093365332189727737017512151028356133799212339172437377842752/298696629930095269855883088894188404083251953125", + "36235708139636009223369788671531922635646440634426295687176019438514014863993626378026816901548106725980851838706381065770793107423349532354131229664/4480449448951429047838246333412826061248779296875", + "24425186559329931273285195922797379826097902734242930552798663063974101129884390129432582572071412583400670334557847232478520402654947345970475082432/829712860916931305155230802483856678009033203125", + "3462596690720167752208647628498596305654752447005725022394073285142294413084065626784849061434225368970920481837461339350167160530156001869825584423153296/42004213583919647323483559375745244324207305908203125", + "107712813086582969764200744665105662325802091172436963273055582708441162468335570867088921222679399812562587664512311677429530236822766319446634809858048576/630063203758794709852253390636178664863109588623046875", + "2332385534398066289901368210442625053742812799298493684501983685924424757350129538468734846384854219104555585887333209941673145119449048453219218040359959968/9450948056381920647783800859542679972946643829345703125", + "52209142557166783633444356600800362186984427466219371216929987221310578893361480881696028071708567440001745403089001051829397495557095176131328125562473978048/236273701409548016194595021488566999323666095733642578125", + "33634736070482447148468960502438694870461121540737479533983741767575084479377107875708018084658404023847278288528491062236246463483897853853836388583516889704/364619909582635827460794786247788579203188419342041015625" + ], + "tested": "0.00389011527148", + "uniform_loss": "127/24967500000000" +} diff --git a/research/p104-paired-delayed-cover/weighted/moment/primary/price.py b/research/p104-paired-delayed-cover/weighted/moment/primary/price.py new file mode 100644 index 0000000000..9de42dfbfc --- /dev/null +++ b/research/p104-paired-delayed-cover/weighted/moment/primary/price.py @@ -0,0 +1,130 @@ +"""One fixed degree-40 raw coordinate moment with complete paid splitting on #8027.""" +from argparse import ArgumentParser +from decimal import Decimal, localcontext +from fractions import Fraction as F +from hashlib import sha256 +import json +from pathlib import Path +import runpy +import subprocess +import sys +import tarfile +import time + +PINS={'peer-application':'587ece477179606eed6fd9a334ac6d6e27f0067f82c3d6281993736e0570a76f', + 'peer-archive':'d85d011ca74e8592c21c1e4db91a1a9021af26dcebc4dfdc2af7251f9c1bf968', + 'r347-binary':'f4aad2d07449c864479f26cc3b3ed4bbd8321f0ca14e1efc8676b28b54c27ed4', + 'r350-mean':'922f50e004b2844054c2be938df676412f7ce6c1963af96f9e231cc1fd016987', + 'r351-helper':'dd1790feeed03c6dd6b3df5c32f60416f814fe67cc2b6cac75d301c2c3702a5a', + 'r351-price':'4acbb38393550df5b046f125328a67bc344fe592a107556145ac315acf083a34', + 'r351-audit':'0f43bebea0a8a4a258e14ea7495ed9d2bdbfe8f952dafd423d7e1651b4807332', + 'r351-full':'65473eba091d40551586a3e078bb6c4155813ba64e7207e0698765a2e738da0d', + 'r351-accept':'32d40619c37fdcf91f63930e3ebdf1ec0e19210f91e4f1a74617fcc1b3ada10c', + 'weighted-theorem':'28e0308f315a583282291fa01998d53a874b4b7e3073cacc3ddbb38c5a7f66c7'} + +def check(condition,label): + if not condition: + raise ValueError(label) + +def save(path,obj): + with path.open('x') as f: + json.dump(obj,f,sort_keys=True,indent=2);f.write('\n') + +def log_bounds(k): + if k==1:return F(0),F(0) + with localcontext() as ctx: + ctx.prec=75 + x=Decimal(k).ln() + return F(x.next_minus()),F(x.next_plus()) + +def run(a): + paths={k:getattr(a,k.replace('-','_')) for k in PINS} + for k,path in paths.items(): + check(sha256(path.read_bytes()).hexdigest()==PINS[k],k) + load=lambda k:json.loads(paths[k].read_bytes()) + prev=load('r351-price');peer=load('peer-application');old=load('r347-binary')['peer_finite'];actual=load('r351-full') + accepted=load('r351-accept');mean_control=load('r350-mean');other=load('r351-audit') + helper=runpy.run_path(str(paths['r351-helper'])) + with tarfile.open(paths['peer-archive']) as tar: + for n,hsh in helper['MEMBERS'].items(): + check(sha256(tar.extractfile(n).read()).hexdigest()==hsh,n) + check(actual['claim']==accepted['claim']==prev['claim']=='0.00389011526022' and accepted['replay_sha256']==PINS['r351-full'],'complete signed control') + check(F(other['cap'])==F(prev['cap'])==F(accepted['cap']),'independent precursor cap') + v,p,h,H=768,40,1024,299610000000000 + C=F('0.003890115276594');t=Decimal('0.996109884723406');u=Decimal('0.2');d=F(1,H*2**38);lam=F(7,10) + ceiling=F(peer['binary_raw'][1])-F(4876,H) + check(H+hceiling>=F(actual['claim']),'whole candidate paid ceiling') + bi=old['independent_directed_compiler'];sep=old['finite_separation'];nat=peer['binary_native'] + check(bi['product_exponent']==v and bi['cutoff']==15 and bi['productive_floor']==16 and bi['ambient_base']==134 and bi['H']==H and F(bi['trial'])==C,'source') + P={int(k):n for k,n in nat['paid_all'].items()};T={int(k):n for k,n in nat['productive_all'].items()} + check(sep['paid']==nat['paid_all'] and sep['targets']==nat['productive_all'] and sep['source_paid_calls']==sum(P.values()) + and sep['source_paid_rank_mass']==sum(k*n for k,n in P.items()) and sep['source_public_fields']==sum(T.values()),'separate one-letter laws') + check(max(P)==56 and 56**2<15**3 and T[8]>0 and T[64]>0 and 8**512*64**256==16**768,'support and actual attained floor') + check(sep['construction']=='chronological product; specialize low complete targets to owned zero; retain all original paid calls; split paid calls on disjoint axes' and + sep['owned_allocation_records_bound']==f'2*{sum(T.values())}^{v}' and sep['specialized_initial_and_final']==0,'zero recursive completion; all ordinary specialized work retained') + check(2**(20*h)<=15**(7*v) and (2**h*134**v)**10>=15**(21*v) and 16**50>=15**51 and 7*v>h and 8*v*C0,'binomial mean and positive moment') + raw=(letter_max/v)**p*sum(terms);completed=raw+split + rec={'case':{'p':p,'v':v,'H':H,'h':h,'q_letter':str(q),'raw_support':'3/2','norm_limit':str(lam)},'pins':PINS, + 'raw_mean_upper':str(helper['ceil_grid'](mean)),'stirling_terms_0_through_40':[str(x) for x in terms], + 'raw_moment_upper':str(raw),'positive_split_uplift_upper':str(split),'extra_recursive_completion':'0','complete_moment_upper':str(completed), + 'moment_budget':str(lam**p),'eta_lower':str(eta),'endpoint_zero':str(end0),'endpoint_infinity':str(endinf)} + if completed>=lam**p: + rec['result']='EXCLUDED_FROZEN_NORM_CERTIFICATE';save(a.out,rec);print(rec['result'],flush=True);return + inc=(H+h)**p;den=h**p;L=(inc//den).bit_length() + check((den<<(L-1))<=inc<(den<2*H*p,'minimal terminal and increasing all-size tail') + check(F(64,2**45)==H*d/2 and old['cover_prime_condition']=='odd q > 2^45*N^5 avoiding the frozen finite catalogue witnesses','full delayed cover') + old_cap,old_claim,old_tested,_=helper['four'](C-F(4876,H)-d,F(peer['rational_raw'][0])) + check((old_cap,old_claim,old_tested)==tuple(map(F,(actual['cap'],actual['claim'],actual['tested']))),'R351 four exact stages positive control') + covered=C-F(L,H)-d + cap,claim,tested,stages=helper['four'](covered,F(peer['rational_raw'][0])) + check(claim>ceiling and claim>old_claim and claim=F(old['uniform']['eta']['upper']),'unpriced norm control') + rec.update(result='PASS_FULL_PRICED_MOMENT_SIGNED_REQUIRED',L=L,uniform_loss=str(F(L,H)),cover_loss=str(d),covered=str(covered),stages=stages, + cap=helper['dec'](cap,15),claim=helper['dec'](claim,14),tested=helper['dec'](tested,14), + prior_cap=actual['cap'],prior_claim=actual['claim'],gain=str(claim-old_claim),percent=str(100*(claim-old_claim)/old_claim), + peer_gain=str(claim-F(peer['claim'])),peer_percent=str(100*(claim-F(peer['claim']))/F(peer['claim'])), + relaxed_old_ceiling=str(ceiling),separation=str(claim-ceiling),controls=['R351 positive signed control','lower terminal insufficient','uncertified unit norm fails']) + save(a.out,rec);print(rec['result'],L,rec['cap'],rec['claim'],rec['tested'],flush=True) + +def main(): + parser=ArgumentParser() + for key in PINS:parser.add_argument('--'+key,type=Path,required=True) + parser.add_argument('--out',type=Path,required=True);parser.add_argument('--child',action='store_true') + a=parser.parse_args();check(sys.implementation.name=='cpython' and sys.version_info[:2]==(3,12) and __debug__,'CPython 3.12') + if a.child:run(a);return + clock=a.out.with_suffix('.timing.json') + check(not any(f.exists() for f in (a.out,clock,a.out.with_suffix('.progress.jsonl'))),'fresh output paths') + start=time.monotonic() + try:code=subprocess.run([sys.executable,'-IB',__file__,*sys.argv[1:],'--child'],timeout=45).returncode + except subprocess.TimeoutExpired:code=124 + save(clock,{'exit_code':code,'limit_seconds':45,'elapsed_seconds':round(time.monotonic()-start,6)});raise SystemExit(code) +if __name__=='__main__': + main() diff --git a/research/p104-paired-delayed-cover/weighted/primary/PRICE.json b/research/p104-paired-delayed-cover/weighted/primary/PRICE.json new file mode 100644 index 0000000000..ac64f9fa0c --- /dev/null +++ b/research/p104-paired-delayed-cover/weighted/primary/PRICE.json @@ -0,0 +1,90 @@ +{ + "L": 4876, + "alpha_lower": "124999999998306896882855592940969042467/125000000000000000000000000000000000000", + "archive_member_pins": { + "parent/binary/PROOF.md": "2bddffa4d670237ffc72514c3c5b4be4b9dabdd7696e0c4e0759f7fd7c10e575", + "recipient/binary/finite.py": "c780cea060f4a9efef064b239636162a7e8e84e40369abc1a1c4679dfbeb3041", + "source/research/paired-query-only-bit/retained/inputs/credited_trim.py": "fcff17fdd3108be68761fbde0fcbfe218be166cf518c99f7163e60d53ab785d9" + }, + "cap": "0.003890115260308", + "case": { + "H": 299610000000000, + "Lp_bound": "9/10", + "ambient_base": 134, + "floor_base": 16, + "h": 1024, + "p": 128, + "slab_base": 15, + "t": "498054942361703/500000000000000", + "top_cut": "4/5", + "v": 768 + }, + "claim": "0.00389011526022", + "completed_tail_upper": "245092766217672059932015092913585517715415293482149783897/25000000000000000000000000000000000000000000000000000000000000000", + "controls": [ + "R348 complete good control", + "R350 finite Bernoulli bad control", + "no-tail-credit bad end", + "one lower terminal fails" + ], + "cover_loss": "1/82356169699491840000000000", + "covered": "1001171851654551333637190603/257363030310912000000000000000", + "direct_raw_ratio_upper": "5472392928038409786320671167310044437057264592427815619536521551/6250000000000000000000000000000000000000000000000000000000000000", + "endpoint_g0": "86361685550944446253863518628003995711160003644362813850237034701685918031624270579715075034722882265605472939461496635969950989468319466936530037770580747746862471103668212890625/5969104346894268081227127544369532170015095312194834027929354042567350669542387998506329070754173609675893918520514338828907331836642624775378397111250585828101167849594706641664032932626866298080824462934016", + "endpoint_infinity": "3464823841570940447511989197632600142600357270938450628136751668972148475371287127017463688665854485527890158948205456823643544339574873447418212890625/31438508665248587260582831903168193798224918146861981871343795372991732345781536726224251645729386355831780309674298407083784970278050966323510245488971991041", + "eta_lower": "54987100261909318350917/125000000000000000000000000000", + "extra_recursive_completion_upper": "0", + "gain": "6293/100000000000000", + "gamma_upper": "35023314738971437965587612438538899719/40000000000000000000000000000000000000", + "headroom_above_extra_guard": "10266149/239688000000000000", + "one_label_moment_budget": "139008452377144732764939786789661303114218850808529137991604824430036072629766435941001769154109609521811665540548899435521/100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "one_label_moment_upper": "26574078952886150145424873301841262736958035699173200285272908823121995150825166369233313025232921413/2710505431213761085018632002174854278564453125000000000000000000000000000000000000000000000000000000000000000", + "peer_gain": "4593/25000000000000", + "peer_percent": "12248/2593410051", + "percent": "89900/55573074247", + "pins": { + "R347-binary": "f4aad2d07449c864479f26cc3b3ed4bbd8321f0ca14e1efc8676b28b54c27ed4", + "R348-accept": "35481cf9a929a3dd137a9e63134b7e97ee7c5408d4e675a3e8ad67b16d9a7b71", + "R348-full": "9b00a17913efb76995b01c7b75f5b00aab394a0531e26490ab02a5940adcac3c", + "R348-price": "523d6dc93a7cd34bf6183a66d03b624ab2f0dfcf18b7e95032b7d0ab695fa24f", + "R350-exclusion": "922f50e004b2844054c2be938df676412f7ce6c1963af96f9e231cc1fd016987", + "peer-application": "587ece477179606eed6fd9a334ac6d6e27f0067f82c3d6281993736e0570a76f", + "peer-archive": "d85d011ca74e8592c21c1e4db91a1a9021af26dcebc4dfdc2af7251f9c1bf968", + "weighted-theorem": "28e0308f315a583282291fa01998d53a874b4b7e3073cacc3ddbb38c5a7f66c7" + }, + "positive_split_uplift_upper": "38670725572085714983/4000000000000000000000000000000000000000000000000000000000000000", + "prior_cap": "0.003890115197377", + "prior_claim": "0.00389011519729", + "raw_tail_upper": "980371064870688239728060371654342069894893034626456261013/100000000000000000000000000000000000000000000000000000000000000000", + "relaxed_old_ceiling": "23310348345714559/5992200000000000000", + "result": "PASS_WHOLE_TUPLE_PRICE_SIGNED_REPLAY_REQUIRED", + "separation": "12663029/239688000000000000", + "stages": [ + { + "admitted": "3889964719277/1000000000000000", + "charged_minimum_slack": "26418103319268049/21446919192576000000000000000000", + "endpoint": "83427758996331821445806820049/21446919192576000000000000000000", + "previous": "12039/3125000" + }, + { + "admitted": "1945057329077/500000000000000", + "charged_minimum_slack": "28734370592066257/21446919192576000000000000000000", + "endpoint": "83430974723312982305256770257/21446919192576000000000000000000", + "previous": "3889964719277/1000000000000000" + }, + { + "admitted": "3890115257909/1000000000000000", + "charged_minimum_slack": "7925881108378973/4289383838515200000000000000000", + "endpoint": "16686197517244179536725095773/4289383838515200000000000000000", + "previous": "1945057329077/500000000000000" + }, + { + "admitted": "972528815077/250000000000000", + "charged_minimum_slack": "8011668785149277/4289383838515200000000000000000", + "endpoint": "16686197527534497152999830877/4289383838515200000000000000000", + "previous": "3890115257909/1000000000000000" + } + ], + "tested": "0.00389011526029", + "uniform_loss": "1219/74902500000000" +} diff --git a/research/p104-paired-delayed-cover/weighted/primary/price.py b/research/p104-paired-delayed-cover/weighted/primary/price.py new file mode 100644 index 0000000000..a230b846c4 --- /dev/null +++ b/research/p104-paired-delayed-cover/weighted/primary/price.py @@ -0,0 +1,146 @@ +"""Certify one fixed 768-factor high-tail / L128 triangle-inequality bound.""" +from argparse import ArgumentParser +from decimal import Decimal, localcontext +from fractions import Fraction as F +from hashlib import sha256 +import json +from pathlib import Path +import subprocess +import sys +import tarfile +import time + +PINS = { + 'peer-application':'587ece477179606eed6fd9a334ac6d6e27f0067f82c3d6281993736e0570a76f', + 'peer-archive':'d85d011ca74e8592c21c1e4db91a1a9021af26dcebc4dfdc2af7251f9c1bf968', + 'R347-binary':'f4aad2d07449c864479f26cc3b3ed4bbd8321f0ca14e1efc8676b28b54c27ed4', + 'R348-price':'523d6dc93a7cd34bf6183a66d03b624ab2f0dfcf18b7e95032b7d0ab695fa24f', + 'R348-full':'9b00a17913efb76995b01c7b75f5b00aab394a0531e26490ab02a5940adcac3c', + 'R348-accept':'35481cf9a929a3dd137a9e63134b7e97ee7c5408d4e675a3e8ad67b16d9a7b71', + 'weighted-theorem':'28e0308f315a583282291fa01998d53a874b4b7e3073cacc3ddbb38c5a7f66c7', + 'R350-exclusion':'922f50e004b2844054c2be938df676412f7ce6c1963af96f9e231cc1fd016987'} +MEMBERS={'recipient/binary/finite.py':'c780cea060f4a9efef064b239636162a7e8e84e40369abc1a1c4679dfbeb3041', + 'source/research/paired-query-only-bit/retained/inputs/credited_trim.py':'fcff17fdd3108be68761fbde0fcbfe218be166cf518c99f7163e60d53ab785d9', + 'parent/binary/PROOF.md':'2bddffa4d670237ffc72514c3c5b4be4b9dabdd7696e0c4e0759f7fd7c10e575'} + +def check(ok, why): + if not ok: + raise ValueError(why) + +def save(path, result): + with path.open('x') as f: + json.dump(result,f,sort_keys=True,indent=2);f.write('\n') + +def ceil_grid(x): + scale=10**65 + return F(-(-scale*x//1),scale) + +def positive_power(k,s): + if k==1: + return F(1),F(1) + with localcontext() as c: + c.prec=75 + log=Decimal(k).ln() + return F((s*log.next_minus()).next_minus().exp().next_minus()),F((s*log.next_plus()).next_plus().exp().next_plus()) + +def four(covered, rational): + previous=F('0.00385248');rho=F(1,250);rows=[] + for _ in range(4): + envelope=(1-rho)*covered+rho*previous + admitted=F(int(envelope*10**15)-1,10**15) + margin=min(rho-admitted,1-rho-admitted,envelope-admitted) + check(admitted>previous and margin>0,'strict four-level service') + rows.append({'previous':str(previous),'endpoint':str(envelope),'admitted':str(admitted),'charged_minimum_slack':str(margin)}) + previous=admitted + claim=F(min(int(rational*10**14),int(previous*10**14))-8,10**14) + return previous,claim,claim+F(7,10**14),rows + +def dec(x,p): + n=x*10**p;check(n.denominator==1,'exact decimal') + return f'0.{int(n):0{p}d}' + +def run(a): + paths={k:getattr(a,k.lower().replace('-','_')) for k in PINS} + for key,path in paths.items(): + check(sha256(path.read_bytes()).hexdigest()==PINS[key],key) + load=lambda k:json.loads(paths[k].read_bytes()) + with tarfile.open(paths['peer-archive']) as tar: + names=tar.getnames();check(len(names)==len(set(names)),'archive uniqueness') + for key,expected in MEMBERS.items(): + check(sha256(tar.extractfile(key).read()).hexdigest()==expected,key) + app=load('peer-application');old=load('R347-binary')['peer_finite'];prior=load('R348-price') + signed=load('R348-full');accepted=load('R348-accept');negative=load('R350-exclusion') + check(prior['claim']==signed['claim']==accepted['claim']=='0.00389011519729' and accepted['replay_sha256']==PINS['R348-full'],'signed comparable benchmark') + check(negative['observed_direct_enclosure_failures']==list(range(11,18)) and negative['first_failed_j']==11,'old Bernoulli exclusion control') + v,H,p,h=768,299610000000000,128,1024 + C=F('0.003890115276594');d=F(1,H*2**38) + prev=F(signed['claim']);ceil_old=F(app['binary_raw'][1])-F(23731,H);guard=ceil_old+F(1,10**11) + check(H+hguard,'full optimistic price prior to source check') + s=old['finite_separation'];native=app['binary_native'];comp=old['independent_directed_compiler'] + check((comp['product_exponent'],comp['cutoff'],comp['productive_floor'],comp['ambient_base'],comp['H'])==(v,15,16,134,H) + and F(comp['trial'])==C and s['paid_tail_offset']=='1/5','native source') + P={int(k):n for k,n in native['paid_all'].items()};T={int(k):n for k,n in native['productive_all'].items()} + check(s['paid']==native['paid_all'] and s['targets']==native['productive_all'] and s['source_paid_calls']==sum(P.values()) and + s['source_public_fields']==sum(T.values()) and s['source_paid_rank_mass']==sum(k*n for k,n in P.items()),'separate full paid and productive inventories') + check(s['construction']=='chronological product; specialize low complete targets to owned zero; retain all original paid calls; split paid calls on disjoint axes' + and s['owned_allocation_records_bound']==f'2*{sum(T.values())}^{v}' and s['specialized_initial_and_final']==0,'zero new recursive completion; paid backing retained') + check(T[8]>0 and T[64]>0 and 8**512*64**256==16**v and 512+256==v,'attained productive floor') + ratios=comp['ratio_intervals'] + alpha=F(ratios[0][0]);gamma=F(ratios[1][1]);base=gamma/alpha + t=Decimal('0.996109884723406');u=Decimal('0.2') + paid_lo=sum(n*positive_power(r,t)[0] for r,n in P.items()) + paid_high=sum(n*positive_power(r,t+u)[1] for r,n in P.items()) + direct_ratio=paid_high/(positive_power(15,u)[0]*paid_lo) + check(015 and base*root_upper<1,'rational root and true decay') + raw_tail=ceil_grid((base*root_upper)**v) + extra=ceil_grid(2*base**v) + prob=raw_tail+extra + moment=threshold**p+prob + check(0=15**(21*v) and 16**50>=15**51,'three logarithmic guards') + check(2**7<134<2**8 and 7*v>h and 8*v*C=F(old['uniform']['eta']['upper']),'no distributional credit negative') + check(F(old['finite_separation']['strict_normalized_gap']['lower'])>0 and old['cover_prime_condition']=='odd q > 2^45*N^5 avoiding the frozen finite catalogue witnesses' + and F(prior['cover_loss'])==d and H*d/2==F(64,2**45),'whole-job budget and existing q-adic stock') + den=h**p;num=(H+h)**p;J=(num//den).bit_length() + check((den<<(J-1))<=num<(den<2*H*p,'adjacent minimal terminal and continuous tail') + raw_left=F(app['rational_raw'][0]);covered=C-F(J,H)-d + old_c,old_k,old_t,_=four(C-F(23731,H)-d,raw_left) + check((old_c,old_k,old_t)==tuple(F(signed[k]) for k in ('cap','claim','tested')),'predecessor four stages and signed points') + cap,claim,tested,rows=four(covered,raw_left) + check(guard