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-two-move-typed-volume-bound/NOTICE b/research/p104-two-move-typed-volume-bound/NOTICE new file mode 100644 index 0000000000..9a25a88d3b --- /dev/null +++ b/research/p104-two-move-typed-volume-bound/NOTICE @@ -0,0 +1 @@ +Apache-2.0 contribution. Exact predecessor and source references are in PROVENANCE.json. OpenAI Codex and its subagents materially assisted proof, implementation, independent verification and packaging. diff --git a/research/p104-two-move-typed-volume-bound/PINS.txt b/research/p104-two-move-typed-volume-bound/PINS.txt new file mode 100644 index 0000000000..ebd3fb95e4 --- /dev/null +++ b/research/p104-two-move-typed-volume-bound/PINS.txt @@ -0,0 +1,13 @@ +2921f90faea5a3bf18d55d6bb457f22a911ac058c7fc498e1eddb28d265e680e closure/round212/independent/RESULT.json +bdf2519d81b02f9c627906850f7c509dafbb25cfa5149b5a52b8baeffdc1c87b closure/round212/independent/replay.py +eb245312a93701e953f68e55cb1dd3233ed93901e1383ecaf15b4e7e56361d0a closure/round212/lead/RESULT.json +064e11ecfedce9937ea1782e5baee37e89b3c9eebabed5b4a9ba84f412bbe078 closure/round212/lead/inputs/7113-SHA256.json +4b9fd1187b34ed97c3ac0c760d73531735a5d0ebc5b4d4ab4377160b20d9bb2a closure/round212/lead/inputs/WORD.json.gz +2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962 closure/round212/lead/inputs/clifford_exact.py +3049471905b47b385c88378a1a3be7a18b8858aadd035b8a6da2f4a03b470f38 closure/round212/lead/inputs/native_verify.py +f4d0b6c9314b838d882d6d06020f24881c19a3fda97a7c00df87b1e920785182 closure/round212/lead/inputs/pricing.py +2f6776cf9758d460a806483d8901eb856edf60f4ec741a7895b022fb90237ce2 closure/round212/lead/typed_volume.py +aa7f824df2b45a65067f21397aab3eead56837539693010aa898dbaaca0d8f9a closure/round213/independent/RESULT.json +9b29cbdf4081fe9affaeebac623104ba3ee499ed3f1db8ef9a29b0b0733b6f71 closure/round213/independent/replay.py +24edbd5a8752254a9668ff231d72664b4cc89520f0992973fd3dee6ada0e78e1 closure/round213/lead/RESULT.json +cb133fc0bff857418546d0ce6ad0b7b20d109ac06a18ac1d8698bb08a53c783f closure/round213/lead/monomial.py diff --git a/research/p104-two-move-typed-volume-bound/PROOF.md b/research/p104-two-move-typed-volume-bound/PROOF.md new file mode 100644 index 0000000000..a84d873fe0 --- /dev/null +++ b/research/p104-two-move-typed-volume-bound/PROOF.md @@ -0,0 +1,27 @@ +# One-field displacement bound for the exact chart-117 pair + +Fix the two old public MOVE instructions at clocks 32944 and 32945 in #7334. Their exact records are `MOVE 625 3 117 false` and `MOVE 624 3 117 false`. The old frame is empty and the new frame vectors are `(8,17,34,68,391)` in the nine-axis field. The exact normalized signed compiler lowers the chart operation to rank five. The verifier writes the literal frame as P⁻¹ C^⊗5 P on its five active axes with four spectators, for a unitary monomial P. The signed Pauli and exact global phase agree with the compiled recipe. An independent Gaussian-integer evaluator matches every one of the 512 one-slice columns. Removing one C gate changes the result. The signed square sends the zero basis column to −i times basis 504, so the square is not scalar. Together with the exact fourth power I, this establishes projective order four. + +For tensor width f, let N=2^(9f), T be the lifted one-lane chart, and A=diag(T,T) be the required map on the two original arbitrary lanes. The verified one-slice frame conjugation lifts by tensor product across the f independent slices. All estimates below allow arbitrary inputs in both lanes. The paid-rank tariff alone does not determine address volume. + +## Identity erasure at every positive width + +The normalized single-axis C has eigenvalues 1 and i. For five independent C axes, the counts of eigenvalue exponents modulo four are (6,6,10,10). Each extra active axis averages the previous cyclic distribution with a one-step translate, so the largest probability cannot increase. For all f≥1 the maximum one-field eigenspace dimension is therefore at most (5/16)N. Spectators multiply all multiplicities by the same factor. Thus rank(A−I)≥2N−2(5/16)N=11N/8. + +Under identity erasure, removing the one body-dependent change leaves the identity on both original lanes. If the difference factors through one original N-dimensional field with fixed adapters, write it as B K D, where D maps the pair to the field and B maps back. Its rank is at most N even with unrestricted linear adapters. This is incompatible with 11N/8. The same eigenvalue bound is insensitive to a common global scalar on the target chart. + +## Unitary monomial erasure with one normalized core + +Each one-slice chart column has 32 nonzero entries, all with squared modulus 1/32. This was checked for all 512 columns in both evaluators. The lifted chart at f=4 has maximum entry modulus (1/√32)^4=1/1024. The same maximum applies to A. + +Let M be any unitary monomial on the complete two-lane space, allowing coordinate permutations across lanes and arbitrary unit-modulus coefficients. Set W=M* A. Its trace selects at most 2N entries of A, each multiplied by a unit phase. Hence |tr W|≤2N/1024. If z is the dimension fixed by W, unitarity gives Re(tr W)≥z−(2N−z). It follows that z≤N(1+1/1024), and therefore rank(A−M)≥(1023/1024)N. + +A proposed one-core map has the same pre/post unitary monomial adapters with and without the core. After removing the core, the adapters give a monomial M. The difference from M has the rank of the core minus identity on its one active N-dimensional lane. The other lane contributes zero. At f=4 a normalized rank-r core for r=1,…,6 has 4r independent C axes and the remaining spectators. The least fraction of any phase residue modulo four is at least 1/8, as checked by exact binomial counts in both engines. Thus its displacement rank is at most 7N/8. This bound also permits a fourth-root phase normalization of the core, which only changes the residue fixed by identity. The strict dimension gap is (127/1024)N, or 8,522,825,728 at f=4. A rank-1-to-6 core cannot realize the target. + +Within the same tensor-lift model, the last inequality also holds for every f≥4 by an algebraic bound. The target entry maximum cannot exceed 1/1024 once f≥4. The minimum of the four residue probabilities is 1/8 at four active axes and cannot decrease under the same averaging for any further axes. The direct numerical width check in this package is f=4. + +## Directed price and scope + +Let H(r)=r^(1−κ) at the pinned comparator crossing. An optimistic retirement of both old rank-five paid children in favor of one rank-six child on each of 17 invocations gives `17(2H(5)−H(6))`. Directed rational evaluation places it between 67.66946959214 and 67.66946959215 raw. The frozen receipt carries both exact endpoints. This is a gross price before extra sources, routing, restoration or physical checks. The normalized rank exclusions stop this model before a literal build. + +The identity result assumes a change that factors through one original field. The monomial result assumes one original field with one normalized core and unitary monomial erasure on the pair. A larger active field, additional body-dependent bypasses, nonmonomial erasure or changed comparator premises need separate analysis and a full price. No arbitrary-input native replacement, all-size complexity change, or κ increase is established. diff --git a/research/p104-two-move-typed-volume-bound/PROVENANCE.json b/research/p104-two-move-typed-volume-bound/PROVENANCE.json new file mode 100644 index 0000000000..9cf7e5dd74 --- /dev/null +++ b/research/p104-two-move-typed-volume-bound/PROVENANCE.json @@ -0,0 +1,77 @@ +{ + "ai_assistance": "OpenAI Codex and subagents materially assisted proof, implementation, independent replay and packaging.", + "caller": { + "commit": "07a76c5e2738882c0cb322278e56f6cae3c9885d", + "scope": "Exact retained signed caller. No caller replay is required for this scoped exclusion.", + "source": "https://github.com/CrocSwap/integer-mult-bounds/pull/7113" + }, + "comparator": { + "head": "aaeec8c0acf01e99a5f331ef363a698d9c084ace", + "pull_request": 7334, + "source": "https://github.com/CrocSwap/integer-mult-bounds/pull/7334", + "status": "strongest independently reproduced complete comparable witness" + }, + "files": { + "closure/round212/lead/inputs/7113-SHA256.json": { + "commit": "07a76c5e2738882c0cb322278e56f6cae3c9885d", + "git_blob": "5a7d6b80dc51aa918a5d521b60d18f9a6bbbc52e", + "path": "research/signed-caller-8x9/SHA256.json", + "sha256": "064e11ecfedce9937ea1782e5baee37e89b3c9eebabed5b4a9ba84f412bbe078", + "source": "https://github.com/rohanarun/integer-mult-bounds/blob/07a76c5e2738882c0cb322278e56f6cae3c9885d/research/signed-caller-8x9/SHA256.json" + }, + "closure/round212/lead/inputs/WORD.json.gz": { + "commit": "aaeec8c0acf01e99a5f331ef363a698d9c084ace", + "git_blob": "73f43007192eb5a38eb5abb591b871df3e52c7cd", + "path": "research/p104-helper-319-fused-return/WORD.json.gz", + "sha256": "4b9fd1187b34ed97c3ac0c760d73531735a5d0ebc5b4d4ab4377160b20d9bb2a", + "source": "https://github.com/Clear1nsight/integer-mult-bounds/blob/aaeec8c0acf01e99a5f331ef363a698d9c084ace/research/p104-helper-319-fused-return/WORD.json.gz", + "uncompress": false + }, + "closure/round212/lead/inputs/clifford_exact.py": { + "commit": "07a76c5e2738882c0cb322278e56f6cae3c9885d", + "git_blob": "166841a037f069249f6f7f6dedb89248812f59e2", + "path": "research/signed-caller-8x9/replay/supplier7112/short-caller/admission-source/frozen/clifford_exact.py", + "sha256": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962", + "source": "https://github.com/rohanarun/integer-mult-bounds/blob/07a76c5e2738882c0cb322278e56f6cae3c9885d/research/signed-caller-8x9/replay/supplier7112/short-caller/admission-source/frozen/clifford_exact.py" + }, + "closure/round212/lead/inputs/native_verify.py": { + "commit": "07a76c5e2738882c0cb322278e56f6cae3c9885d", + "git_blob": "2c209dfa9cfade3bc20ac5fc9d876b433a147f8c", + "path": "research/signed-caller-8x9/replay/supplier7112/short-caller/admission-source/frozen/native_verify.py", + "sha256": "3049471905b47b385c88378a1a3be7a18b8858aadd035b8a6da2f4a03b470f38", + "source": "https://github.com/rohanarun/integer-mult-bounds/blob/07a76c5e2738882c0cb322278e56f6cae3c9885d/research/signed-caller-8x9/replay/supplier7112/short-caller/admission-source/frozen/native_verify.py" + }, + "closure/round212/lead/inputs/pricing.py": { + "commit": "c522451caf287bb3c16eaece72be4c263315dca4", + "git_blob": "40ec194017bda1d524bba4f07b188c53281419d0", + "path": "research/adjacent-owned-add-exchange-bound/pricing.py", + "sha256": "f4d0b6c9314b838d882d6d06020f24881c19a3fda97a7c00df87b1e920785182", + "source": "https://github.com/CrocSwap/integer-mult-bounds/blob/c522451caf287bb3c16eaece72be4c263315dca4/research/adjacent-owned-add-exchange-bound/pricing.py", + "uncompress": false + } + }, + "predecessors": { + "7245": { + "head": "f26fe4e1835b9af061b978e2ef8633a5a8d762c1", + "role": "Fixed-output consolidation on a different exact native word. It left changed typed multi-output children open.", + "source": "https://github.com/CrocSwap/integer-mult-bounds/pull/7245" + }, + "7406": { + "head": "a5fa7b464a773afb47eb8b9725b94f660c407528", + "role": "Different one-field identity-erasure precedent on the exact stage-17 Type B returns. It leaves a changed erasure open.", + "source": "https://github.com/CrocSwap/integer-mult-bounds/pull/7406" + }, + "7414": { + "head": "9a9e39d8a91ef27d36ef1fa20a478625fd04eba2", + "role": "Exact adjacent-pair census and independent normalized source rows for this pair. Its proportional-row exclusion is retained.", + "source": "https://github.com/CrocSwap/integer-mult-bounds/pull/7414" + }, + "pricing": { + "head": "c522451caf287bb3c16eaece72be4c263315dca4", + "role": "Directed power arithmetic for the relaxed gross comparison.", + "source": "https://github.com/CrocSwap/integer-mult-bounds/blob/c522451caf287bb3c16eaece72be4c263315dca4/research/adjacent-owned-add-exchange-bound/pricing.py" + } + }, + "schema_version": 1, + "source_payload_sha256": "9aa8d6b054ba7eb2289d052c1079b16be518d2f0fbfb244569fa18e3733acdac" +} diff --git a/research/p104-two-move-typed-volume-bound/README.md b/research/p104-two-move-typed-volume-bound/README.md new file mode 100644 index 0000000000..84a336fc90 --- /dev/null +++ b/research/p104-two-move-typed-volume-bound/README.md @@ -0,0 +1,19 @@ +# Bound one-field typed compression of two public MOVEs + +The exact [#7334 native word](https://github.com/CrocSwap/integer-mult-bounds/pull/7334) at `aaeec8c0acf01e99a5f331ef363a698d9c084ace` contains two adjacent public MOVEs at clocks 32944 and 32945. Roles 625 and 624 both move from chart 3 to chart 117. Each old operation is rank five and both arbitrary dirty inputs must receive the full output. The [#7113 signed caller](https://github.com/CrocSwap/integer-mult-bounds/pull/7113) at `07a76c5e2738882c0cb322278e56f6cae3c9885d` supplies the pinned exact Gaussian compiler and verifier. **NO VERIFIED GAIN.** + +The chart operator is exactly monomial-conjugate to five C axes and has projective order four. On two fields of dimension N each, identity erasure leaves rank at least 11N/8 at every positive tensor width. A change that factors through one of the original fields has rank at most N. At width four, erasing one core and leaving any unitary monomial gives target displacement rank at least 1023N/1024. One normalized rank-1-to-6 C core can supply at most 7N/8. Both necessary inequalities fail. The optimistic two-rank-five to one-rank-six tariff is about +67.66946959214 raw before other costs. No typed child realizes it in this scope. [Proof](PROOF.md) + +Use POSIX CPython 3.12 from a clean checkout: + +```sh +python3.12 -I -B research/p104-two-move-typed-volume-bound/replay.py +``` + +The replay authenticates the exact word, compiler, input paths and receipts. It runs both methods, compares all 512 one-slice columns where applicable, checks a dropped-gate control, and recomputes the directed price and rank bounds. It uses the standard library and needs no network or prior temporary state. [Verification](VERIFICATION.md) + +## Open next questions + +Can an enlarged typed field or a genuinely body-dependent bypass serve both dirty-input outputs with fewer fully charged complex children? First pin one such interface and compute its admitted width, address volume, complete compatible count and directed price. A price-positive case still needs exact arbitrary-input forward and adjoint action, ownership, route and restoration, paid profile, precision, tapes, and the full recurrence. This package covers one pair and the stated erasure models. + +[#7414](https://github.com/CrocSwap/integer-mult-bounds/pull/7414) supplies the exact adjacent-pair census and the independent rows for this pair. [#7245](https://github.com/CrocSwap/integer-mult-bounds/pull/7245) supplies the earlier fixed-output consolidation comparison and leaves a changed typed child open. [#7406](https://github.com/CrocSwap/integer-mult-bounds/pull/7406) supplies the separate Type B one-field displacement precedent. #7334 supplies the exact word and #7113 the signed Gaussian tools. OpenAI Codex and its subagents materially assisted the proof, implementation, independent replay and packaging. diff --git a/research/p104-two-move-typed-volume-bound/SOURCES.json b/research/p104-two-move-typed-volume-bound/SOURCES.json new file mode 100644 index 0000000000..e8c2f265cd --- /dev/null +++ b/research/p104-two-move-typed-volume-bound/SOURCES.json @@ -0,0 +1,18 @@ +{ + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "files": [ + { + "git_blob": "75d77b328ea02ded535e7f23aee5b1e55d0bb1a8", + "path": "certificates/selected-result.json", + "sha256": "154c3d30455d778fd3343b6b4851f0fa4665f0f7625b0adb3675e2bafbbf6bf1", + "usage": "provenance" + }, + { + "git_blob": "3404fbdd5e7529a0674eef26114b5071e4586cec", + "path": "docs/research/agent-task-catalog.json", + "sha256": "ead6cdc9d0af6d58e8a49744d8ec8c7c15e13d2ba93c276c434bcf9b51b93a81", + "usage": "provenance" + } + ], + "schema_version": 1 +} diff --git a/research/p104-two-move-typed-volume-bound/TASK.json b/research/p104-two-move-typed-volume-bound/TASK.json new file mode 100644 index 0000000000..78a8170773 --- /dev/null +++ b/research/p104-two-move-typed-volume-bound/TASK.json @@ -0,0 +1,117 @@ +{ + "actual_scope": "One adjacent pair of public #7334 MOVEs, clocks 32944/32945, roles 625/624, charts 3 to 117, through one original ambient-nine field. Identity erasure at every positive width; unitary monomial erasure with one normalized rank-1-to-6 C core at width four.", + "ai_assistance": "OpenAI Codex and subagents materially assisted proof, implementation, independent verification and packaging.", + "author": "Bound one-field typed compression of two public MOVEs", + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "bottleneck_link": "Replacing two rank-five native paid MOVEs by one rank-six child can reduce the complex paid moment only if it implements both full arbitrary-input outputs.", + "budget_minutes": 14, + "evidence": "Exact Gaussian order four and all-width identity-erasure rank at least 11N/8. At width four any unitary monomial erasure leaves rank at least 1023N/1024, beyond the one-field core cap 7N/8.", + "open_questions": [ + { + "blocked_by": "The one-field normalized child cannot supply the required arbitrary-input displacement, even allowing unitary monomial erasure.", + "first_step": "Price an enlarged typed child or genuinely body-dependent bypass on a consistent full invoice before testing one exact pair.", + "question": "Can another typed interface supply both dirty-input outputs with fewer fully charged complex children?", + "why_it_matters": "A source-bound capacity witness could justify literal native verification and whole-construction pricing." + } + ], + "original_card": { + "acceptance_gate": "An exact arbitrary-input identity, source/target frame availability and restoration at the chosen cut, plus the complete channel+correction+idle/hosting bill or an explicit favorable bound. The native channel alone is not a supplier. A scoped local result may be retained without a complete supplier. Expanding it into further construction rounds requires the family-level budget and obligation gate in research-family-status.md; an optimistic passing relaxation alone is not acceptance.", + "allowed_variations": [ + "One exact source head, helper/cut region or quantified proposition and changed hypothesis; check live handoffs first. Different seeds are not different scopes." + ], + "bottleneck_link": "Judge the actual current supplier contract and complete signed target/paid bill; frozen-profile ceilings require an applicability proof.", + "existing_checks": [ + { + "evidence": "research/p104-literal-slot-defect/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "scope": "PR #4133: literal-slot defect", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129", + "source_commit": "88666f1dee93fbd85b31fd5d6f91a219e111b5f4", + "status": "author-checked" + }, + { + "evidence": "research/p104-uniform-commutation-gap/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "scope": "PR #4136: uniform commutation gap", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129", + "source_commit": "281ce601a8be9db470de630759179c23e1dfaa88", + "status": "author-checked" + }, + { + "evidence": "research/p104-uniform-encoding-gap/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "scope": "PR #4140: uniform encoding gap", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129", + "source_commit": "de25c6525aa866962309df5d107b32d55e6e5628", + "status": "author-checked" + }, + { + "evidence": "research/p104-source-chart-shortcut/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "scope": "PR #4153: source-chart shortcut exhausts its optimistic allowance", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129", + "source_commit": "9123241fea53df77e51ffe30d9aca1625d4bf3a8", + "status": "author-checked" + }, + { + "evidence": "research/p104-fiber-tag-seam/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "scope": "PR #4154: fiber-tag seam mismatch", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129", + "source_commit": "4ffcdaee5d6255a9cea1fe53a5424435068089d0", + "status": "author-checked" + }, + { + "evidence": "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "remaining": "The next experiment must identify uncovered source-specific work. Successor archive intake does not transfer this admission.", + "scope": "Selected PR5599: complete helper-subspace construction and independent caller replay; five framework assumptions remain.", + "selected_record_sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5", + "source_commit": "09dd0965711ca7eeb169057a420abab1c9052137", + "status": "reviewed" + } + ], + "first_experiment": "Start with the selected #5599 emitted word and review pending #5718 distinct input/output bases plus #5717/#5719 coverage before claiming work. Pick one uncovered source word, helper group and cut region. Prove the arbitrary-input relation and legal entry/exit corrections, then compare full target and paid profiles. Reject if completion, owned lifetimes or consumer costs repay the gain. A static pairing rank alone is not a physical split.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read revision 8, the selected review and live exact-source handoffs. Then follow this card's bounded first_experiment.", + "scope": "Source-bound orientation only, not a supplier replay or theorem proof." + }, + "id": "p104-side-correction", + "methods": [ + "Construct and independently check one source-bound instance of the stated first experiment.", + "Seek an exact counterexample or target-specific complete-budget obstruction to that same proposed change." + ], + "overlap_terms": [ + "P104", + "helper basis", + "helper split", + "5718", + "dyadic capacity" + ], + "question": "Can joint helper bases and a legal causal split improve the complete P104 productive/paid invoice?", + "scope_change_triggers": [ + "Changing source head, helper/cut domain, operation alphabet or caller boundary without recording the new scope.", + "Treating an archived proposal or local numerical pass as complete supplier admission." + ], + "starting_points": [ + "docs/research/current-priorities.md", + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "research/p104-helper-subspace-splits/README.md", + "research/dyadic-helper-channel-capacity/README.md" + ] + }, + "outcome": "negative-result", + "priority_revision": 8, + "schema_version": 1, + "scope_change_reason": "Both independent inputs must be preserved. Change the paid child model from fixed-output reuse to a typed two-lane reconstruction on one original field.", + "scope_status": "changed", + "stop_rule": "One pinned MOVE pair, 30 runner seconds per engine and test; no enlargement or candidate build after exact rank exclusion.", + "task_id": "p104-side-correction" +} diff --git a/research/p104-two-move-typed-volume-bound/VERIFICATION.md b/research/p104-two-move-typed-volume-bound/VERIFICATION.md new file mode 100644 index 0000000000..b48f71e81d --- /dev/null +++ b/research/p104-two-move-typed-volume-bound/VERIFICATION.md @@ -0,0 +1,7 @@ +# Verification and caps + +From a clean POSIX checkout run the one CPython 3.12 command in README.md. `PINS.txt` authenticates every engine, input and frozen output by relative path and rejects duplicate or unlisted closure paths. The exact #7334 compressed and decompressed word hashes and source commit are in PROVENANCE.json. The #7113 source manifest independently binds the two exact Gaussian implementations. The runner byte-compares the regenerated JSON outputs for both rounds and both engines. + +Each engine had one selected pair and a 30-second runner cap. At CPython 3.12.14 the independent R212 and R213 runs exited 0 in 0.17s and 0.11s. R212 uses the normalized signed tableau plus absolute phase and an independent Gaussian-integer column evaluator. The dropped-C mutation changes the zero basis column. Its square is independently witnessed by the nonzero off-diagonal entry −i at row 504, column 0. The exact normalized recipe, source and target frame, count of 512 columns, rank five and spectral counts are pinned in the receipts. + +R213 checks all one-slice columns in both methods, then the exact f=4 entry bound, monomial trace bound and residue counts for ranks 1–6. No 2N-square matrix is materialized. The proof in PROOF.md establishes the universal rank statements from these identities. The wrapper checks the exact dimension gap and the gross price endpoints without floating point. The corresponding dirty-input native, tape, precision and all-size recurrence checks were unrun because no candidate survived this scope. diff --git a/research/p104-two-move-typed-volume-bound/VERIFY.json b/research/p104-two-move-typed-volume-bound/VERIFY.json new file mode 100644 index 0000000000..6d75cd12e5 --- /dev/null +++ b/research/p104-two-move-typed-volume-bound/VERIFY.json @@ -0,0 +1,19 @@ +{ + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/replay.py" + ], + "checks": "Check the exact two MOVE events, signed rank-five chart action, all 512 one-slice columns, displacement bounds, directed price and negative controls.", + "timeout_seconds": 155 + } + ], + "inputs": [], + "python": "3.12", + "requirements": [], + "schema_version": 1, + "status": "ready" +} diff --git a/research/p104-two-move-typed-volume-bound/closure/round212/independent/RESULT.json b/research/p104-two-move-typed-volume-bound/closure/round212/independent/RESULT.json new file mode 100644 index 0000000000..da775ae51b --- /dev/null +++ b/research/p104-two-move-typed-volume-bound/closure/round212/independent/RESULT.json @@ -0,0 +1,57 @@ +{ + "ambient_axes": 9, + "caller": "07a76c5e2738882c0cb322278e56f6cae3c9885d", + "clocks": [ + 32944, + 32945 + ], + "dropped_C_gate_rejected": true, + "head": "aaeec8c0acf01e99a5f331ef363a698d9c084ace", + "initial_residue_counts": [ + 6, + 6, + 10, + 10 + ], + "maximum_eigenspace_fraction_all_f_ge_1": "5/16", + "paid_rank": 5, + "pins": { + "WORD.json.gz": "4b9fd1187b34ed97c3ac0c760d73531735a5d0ebc5b4d4ab4377160b20d9bb2a", + "clifford_exact.py": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962", + "native_verify.py": "3049471905b47b385c88378a1a3be7a18b8858aadd035b8a6da2f4a03b470f38" + }, + "projective_order": 4, + "required_two_lane_ambient_fraction_all_f_ge_1": "11/8", + "roles": [ + 625, + 624 + ], + "runner_cap_seconds": 30, + "signed_one_slice_columns_verified": 512, + "source": 3, + "square_column_zero": [ + { + "504": [ + 0, + -1 + ] + }, + 0 + ], + "square_offdiagonal_witness": [ + 504, + 0, + 0, + -1, + 0 + ], + "target": 117, + "target_frame": [ + 8, + 17, + 34, + 68, + 391 + ], + "word_sha256": "9aa8d6b054ba7eb2289d052c1079b16be518d2f0fbfb244569fa18e3733acdac" +} diff --git a/research/p104-two-move-typed-volume-bound/closure/round212/independent/replay.py b/research/p104-two-move-typed-volume-bound/closure/round212/independent/replay.py new file mode 100644 index 0000000000..aeb369cdf0 --- /dev/null +++ b/research/p104-two-move-typed-volume-bound/closure/round212/independent/replay.py @@ -0,0 +1,145 @@ +"""Independently replay exact Gaussian columns for the single R212 pair.""" +from gzip import decompress +from hashlib import sha256 +from json import dumps, loads +from pathlib import Path +from runpy import run_path +from signal import SIGALRM, alarm, signal +from sys import argv, implementation, version_info + +PINS = { + 'WORD.json.gz': '4b9fd1187b34ed97c3ac0c760d73531735a5d0ebc5b4d4ab4377160b20d9bb2a', + 'clifford_exact.py': '2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962', + 'native_verify.py': '3049471905b47b385c88378a1a3be7a18b8858aadd035b8a6da2f4a03b470f38', +} +WORD = '9aa8d6b054ba7eb2289d052c1079b16be518d2f0fbfb244569fa18e3733acdac' +HEAD = 'aaeec8c0acf01e99a5f331ef363a698d9c084ace' +CALLER = '07a76c5e2738882c0cb322278e56f6cae3c9885d' +CAP = 30 + + +def no_duplicates(items): + out = dict(items) + assert len(out) == len(items) + return out + + +def parity(x): + return x.bit_count() % 2 + + +def gaussian_multiply(u, v): + a, b = u + c, d = v + return a*c-b*d, a*d+b*c + + +def add(out, address, value): + a, b = out.get(address, (0, 0)) + c, d = value + if a+c or b+d: + out[address] = a+c, b+d + else: + out.pop(address, None) + + +def column(circuit, basis): + state, den = {basis: (1, 0)}, 0 + phases = ((1, 0), (0, 1), (-1, 0), (0, -1)) + for gate in circuit: + tag, *args = gate + out = {} + for label, value in state.items(): + if tag == 'C': + direction, sign = args + add(out, label, gaussian_multiply(value, (1, sign))) + add(out, label ^ direction, gaussian_multiply(value, (1, -sign))) + elif tag == 'P': + matrix, = args + addr = sum(parity(label & row) << i for i, row in enumerate(matrix)) + assert addr not in out + out[addr] = value + elif tag == 'X': + mask, = args + out[label ^ mask] = value + elif tag == 'D': + matrix, linear = args + hits = [i for i in range(9) if label >> i & 1] + exponent = sum(linear[i] for i in hits) + exponent += 2 * sum(1 for i in hits for j in hits if j > i and matrix[i] >> j & 1) + out[label] = gaussian_multiply(value, phases[exponent % 4]) + else: + assert tag == 'phase' + out[label] = gaussian_multiply(value, phases[args[0] % 4]) + state = out + den += tag == 'C' + while den and all(not ((a | b) & 1) for a, b in state.values()): + state = {i: (a//2, b//2) for i, (a, b) in state.items()} + den -= 1 + return state, den + + +def stop(*_): + raise TimeoutError('R212 independent 30-second cap') + + +def main(): + assert __debug__ and implementation.name == 'cpython' and version_info[:2] == (3, 12) + assert len(argv) == 2, 'pass the pinned exact input directory' + root = Path(argv[1]).resolve() + signal(SIGALRM, stop) + alarm(CAP) + raw = {} + for name, digest in PINS.items(): + raw[name] = (root / name).read_bytes() + assert sha256(raw[name]).hexdigest() == digest, name + body = decompress(raw['WORD.json.gz']) + assert sha256(body).hexdigest() == WORD + word = loads(body, object_pairs_hook=no_duplicates) + clocks = [32944, 32945] + roles = [625, 624] + old, new = 3, 117 + assert len(word['program']) == 76466 and word['public'] == 1501 + for t, r in zip(clocks, roles, strict=True): + assert word['program'][t] == ['MOVE', r, old, new, False] + source, target = [tuple(word['frames'][i]) for i in (old, new)] + assert source == () and target == (8, 17, 34, 68, 391) + compiler = run_path(str(root / 'clifford_exact.py')) + verifier = run_path(str(root / 'native_verify.py')) + op = compiler['canonical_frame'](9, source).adjoint().then(compiler['canonical_frame'](9, target)) + recipe, compiled = compiler['lower_child'](op) + literal = verifier['adjoint'](verifier['frame'](source, 9)) + verifier['frame'](target, 9) + assert recipe['rank'] == 5 + assert tuple(compiled.circuit) == verifier['recipe'](recipe) + assert literal[2:7] == verifier['fourier'](5) + assert literal[:2] == verifier['adjoint'](literal[7:]) and len(literal) == 9 + for j in range(512): + assert column(compiled.circuit, j) == column(literal, j) + # An off-diagonal coordinate of V² is an exact non-scalar witness. + squares = column(literal + literal, 0) + off = next((i, value) for i, value in sorted(squares[0].items()) if i != 0) + assert column(literal + verifier['adjoint'](literal), 0) == ({0: (1, 0)}, 0) + broken = literal[:2] + literal[3:] + assert column(broken, 0) != column(literal, 0) + # One C axis contributes independent phases 1 and i. For five axes + # the residue distribution is exact, and each further convolution + # with the next bit's (1/2,1/2) cannot raise its largest entry. + counts = [1, 0, 0, 0] + for _ in range(5): + counts = [counts[i] + counts[(i-1) % 4] for i in range(4)] + assert counts == [6, 6, 10, 10] + assert 2*(sum(counts)-max(counts)) > sum(counts) + alarm(0) + print(dumps({'head': HEAD, 'caller': CALLER, 'pins': PINS, 'word_sha256': WORD, + 'clocks': clocks, 'roles': roles, 'source': old, 'target': new, + 'ambient_axes': 9, 'paid_rank': recipe['rank'], 'target_frame': target, + 'signed_one_slice_columns_verified': 512, 'square_column_zero': squares, + 'square_offdiagonal_witness': [off[0], 0, *off[1], squares[1]], + 'projective_order': 4, 'initial_residue_counts': counts, + 'maximum_eigenspace_fraction_all_f_ge_1': '5/16', + 'required_two_lane_ambient_fraction_all_f_ge_1': '11/8', + 'dropped_C_gate_rejected': True, 'runner_cap_seconds': CAP}, sort_keys=True, indent=2)) + + +if __name__ == '__main__': + main() diff --git a/research/p104-two-move-typed-volume-bound/closure/round212/lead/RESULT.json b/research/p104-two-move-typed-volume-bound/closure/round212/lead/RESULT.json new file mode 100644 index 0000000000..592e6449eb --- /dev/null +++ b/research/p104-two-move-typed-volume-bound/closure/round212/lead/RESULT.json @@ -0,0 +1,31 @@ +{ + "clocks": [ + 32944, + 32945 + ], + "pins": { + "WORD.json.gz": "4b9fd1187b34ed97c3ac0c760d73531735a5d0ebc5b4d4ab4377160b20d9bb2a", + "clifford_exact.py": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962", + "native_verify.py": "3049471905b47b385c88378a1a3be7a18b8858aadd035b8a6da2f4a03b470f38", + "pricing.py": "f4d0b6c9314b838d882d6d06020f24881c19a3fda97a7c00df87b1e920785182" + }, + "projective_order": 4, + "quote": [ + "676694695921411156400360696382228102098994375179647/10000000000000000000000000000000000000000000000000", + "67669469592141115640036069638222814745625133170433/1000000000000000000000000000000000000000000000000" + ], + "rank": 5, + "squared_pauli": [ + 7, + [ + 128, + 0, + 0 + ], + [ + 128, + 0, + 2 + ] + ] +} diff --git a/research/p104-two-move-typed-volume-bound/closure/round212/lead/inputs/7113-SHA256.json b/research/p104-two-move-typed-volume-bound/closure/round212/lead/inputs/7113-SHA256.json new file mode 100644 index 0000000000..5a7d6b80dc --- /dev/null +++ b/research/p104-two-move-typed-volume-bound/closure/round212/lead/inputs/7113-SHA256.json @@ -0,0 +1,69 @@ +{ + "replay/supplier7108/CALLER.json": "9557f713ab4ffb91ede05e8a6d5668c694b9940fc16f2f2d657e2f2b2cac2d3f", + "replay/supplier7112/RESULT.json": "7b808ff32d9803084aaaf820cd172ddc9001c7aebbd17e0324e779abeff91b30", + "replay/supplier7112/WORD.json.gz": "fe0b1dc3049a6b72760a705af2e698e0e9998e969e19862a696eba63434eb233", + "replay/supplier7112/short-caller/DATA-PHASES.json": "c5916ff312678f12aba403847643fbbc29f643acec60bdf836fa56cd3e8251fa", + "replay/supplier7112/short-caller/ODD-LOCALIZED-GROUPING.json": "8aac6b3d9e528bffbcf411bbd300c8e0f0b7bf75da45ab12badf3f3530ffcbe2", + "replay/supplier7112/short-caller/ODD-UNIT-DYADIC-TAPES.json": "c3195057f7a6723a81172ed540d0f1c4ba699ff3cb8dc37cbde7bb481d9b976c", + "replay/supplier7112/short-caller/ODD-UNIT-PREFIX-CLOSURES.json": "3b953e5d3e83e7573a3e908a5a23edb78773d4d22816aca54f766f0f0e9f5403", + "replay/supplier7112/short-caller/SHORT-ADMISSION-PARTIAL.json": "7977815fe72382738727e3d550eea3bc735923c9c57968872d4f863cb39cd401", + "replay/supplier7112/short-caller/SHORT-CALLER-RAW-PRICE.json": "a4f83d65d250efb40f6506658374d7414afdde11c96eb88b7d2fbb182aa090c1", + "replay/supplier7112/short-caller/SHORT-CATALOGUE-0-1000.log": "a916a76627fb79bf606b22f857ca93db6342891fb2c85b20658b5002c359e422", + "replay/supplier7112/short-caller/SHORT-CATALOGUE-1000-2000.log": "da633bfa408e98a2f2a958262a09d5e4274a9b25f7b4a6a73df5a97f37338f79", + "replay/supplier7112/short-caller/SHORT-CATALOGUE-2000-3047.log": "e8d500c0261a4a9e0cf3da2838d82806ed497ab9cf57cb8620ca6debfb98525c", + "replay/supplier7112/short-caller/SHORT-PRECISION.json": "68a00d2b83ee2eb944d2e05fc7f32bc9aa37282c45b968f0ab6fd500659ac028", + "replay/supplier7112/short-caller/SHORT-TYPE-A-ROOT.json": "e9812d720942d8149c219dfa28c1081ff1d353529e5282ca4624a04233f38f88", + "replay/supplier7112/short-caller/admission-source/ARCHIVE-CHAIN.json": "6de95c4eb396e69883fbeeb3989782bbbe232c22644af1c804050badca10f456", + "replay/supplier7112/short-caller/admission-source/FULL-RESULT.json": "d9ba709fa5dcefffe3f3abdcf34600ce188224703cfd743e6db8b58ba4816cb7", + "replay/supplier7112/short-caller/admission-source/INDEPENDENT-NOTICE.md": "cadbc642ca84311d2c7a6cf704c7828cb4cf77e3c784b66e4c6e8a5c28002fb8", + "replay/supplier7112/short-caller/admission-source/INDEPENDENT-SOURCES.json": "dced1457df5230466ba6202fd6d4595bc2b7fb2a65302806bf2720b1837ff350", + "replay/supplier7112/short-caller/admission-source/LICENSE": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4", + "replay/supplier7112/short-caller/admission-source/NATIVE-INPUTS.json": "9bb6c1567783661334d6c1d23f715ce5635cbbb513678819ab9e020a34c7e4c0", + "replay/supplier7112/short-caller/admission-source/NOTICE": "da12736e2e824167ff56f2ecb623a5f88f75a270410360890f61dffc33bab249", + "replay/supplier7112/short-caller/admission-source/data/bit-admission.json": "a46b6c6040f75184cab5467656811ad988c216e3bc8e44d595a5015b6e49620b", + "replay/supplier7112/short-caller/admission-source/data/caller.json": "3828d53e80ea97e8b866320f081af20b6b93bfebd58b95b56b85a7afe151af5e", + "replay/supplier7112/short-caller/admission-source/data/final.json.gz": "2b94953dc14a122e3ef089633f05b58ec689ec5156feb7c784ed3e137dc01883", + "replay/supplier7112/short-caller/admission-source/frozen/clifford_exact.py": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962", + "replay/supplier7112/short-caller/admission-source/frozen/native_verify.py": "3049471905b47b385c88378a1a3be7a18b8858aadd035b8a6da2f4a03b470f38", + "replay/supplier7112/short-caller/admission-source/frozen/physical.py": "4e995d1158033d83bf69b671f23dc7924d66edbbe07623ba063ba7421234ea20", + "replay/supplier7112/short-caller/admission-source/frozen/verify_host3_odd.py": "e75ad2096ba2587d1dc9c8982b2c2eb7c6fd2636a80adcd943314ef2cf6fd258", + "replay/supplier7112/short-caller/admission-source/independent.py": "21f46a8340331abb1486b50bd4e04453f1968b0a5950d86ff7780dd368590874", + "replay/supplier7112/short-caller/admission-source/interval_gate.py": "60a743d13f668ef86db4b8215b4d5d04430a671ba6f1fe06d9c1c4c3dfe86da5", + "replay/supplier7112/short-caller/admission-source/precision_replay.py": "850d9098c5946ab27ef5228acc54d59df2196e72259d3e21588ec0c319c8f5ee", + "replay/supplier7112/short-caller/admission-source/retained/odd-native-common-grid/independent_bounds.py": "198521def614fe78fa728f1dde2b7fb820c0c0e0ac3ad0c9224dccbf51eac0d5", + "replay/supplier7112/short-caller/admission-source/retained/query-only-precision-envelope/envelopes.py": "783da6b5b450fc07434946cb9ec86070dfee01df6b5fa1c385cb024def2c9a9f", + "replay/supplier7112/short-caller/admission-source/retained/query-only-precision-envelope/source_binding.py": "624c459311c58f3847b7713b818bfd340153abf42919f02ac9aa8892ed52a2bd", + "replay/supplier7112/short-caller/assemble_odd_application.py": "6cdac39ab196a70c53ba2283c2555cd8dee30644dcc4769628b46fb53bd55a1f", + "replay/supplier7112/short-caller/candidate_gate.py": "e71097ca81a082afd7c647324a6c94cb357aeb1084693a095a0f3e0b45a9b11a", + "replay/supplier7112/short-caller/check_odd_caller_exact_grid.py": "abd5a5fd011b71e5b382cbc058855594d4f2fe7b049f375506675c0303180f54", + "replay/supplier7112/short-caller/check_odd_fixed_tape_counts.py": "e6246e9f8fbeae3077d82e585eafd3647c1a8758c58f33c7c13e7efa6c1e42bb", + "replay/supplier7112/short-caller/check_odd_partial_admission.py": "4416b1ea5f07f8a91028a2e500116588fbdfaed95a8ef9bac7a46bcb44b9478e", + "replay/supplier7112/short-caller/check_odd_physical_binding.py": "5c80c3b0415a7f91d216395248dd6f13297eed637732098e1ca8fb0548951b98", + "replay/supplier7112/short-caller/check_odd_precision.py": "b2d9c13577158157a587ace766d9dadb7819a0164b372722329d9754e1be6c61", + "replay/supplier7112/short-caller/connected.py": "469537b46fb92c5aca926d3b1497da5425408673b0a73ba1427f23d872b414e7", + "replay/supplier7112/short-caller/cut_library.py": "7ccb81af19db54ec7cdb44849af018d4ca8893f80f17277914f8566715985133", + "replay/supplier7112/short-caller/emit_odd_type_ab.py": "7a7993648433c6febad8c07b315aec1b96598835a3f587b62040423c33c3b71f", + "replay/supplier7112/short-caller/emit_odd_type_b.py": "d1fa8b67d98beacd6bb574b3d5fcbc94b8646a7ffbce91d2a6fd4d690d3c5329", + "replay/supplier7112/short-caller/host34.py": "bded1a8626d65ee40c4ba3b25780fc03f0fa08906f3c83f631892df072d9a9b7", + "replay/supplier7112/short-caller/independent.py": "21f46a8340331abb1486b50bd4e04453f1968b0a5950d86ff7780dd368590874", + "replay/supplier7112/short-caller/interval_gate.py": "60a743d13f668ef86db4b8215b4d5d04430a671ba6f1fe06d9c1c4c3dfe86da5", + "replay/supplier7112/short-caller/lower.py": "67345fdfc8e5bb816e24b37dfafad0396372c48ec4e1b95b8b69f019a8fdfdee", + "replay/supplier7112/short-caller/mirrored.py": "55dd441a3a7f504b351857d45fd701994a0950ae1baec6c4c2b4b0166fb69db3", + "replay/supplier7112/short-caller/odd_unit_dyadic_tapes.py": "3cdafa35635360a487ce400ec8d585f6134dd7c58209543528e98e7db178bbc7", + "replay/supplier7112/short-caller/screen.py": "01e3eaba4b710a080e6e393e53157e6a119fdf312620eed26e9185ca91f6bea6", + "replay/supplier7112/short-caller/short_dyadic_seam.py": "6e588b365618ab2df4fa2d1f16073d09a953a7cd6e826e1f96bbf87f950b672b", + "replay/supplier7112/short-caller/short_native_catalogue.py": "775695c379f407801910531565cc371012cee501b2cec5f5d718ecdccf06b64d", + "replay/supplier7112/short-caller/signed_child.py": "ef03444360f02225138be9b38e2f9a85f313eeaa910d63a365de0f16d228cb8b", + "replay/supplier7112/short-caller/signed_model.py": "f88c798b9a22c656ea0b755b4f32be411c1f80687dff1a1ac9e9c2a0b5f4203e", + "replay/supplier7112/short-caller/stage.py": "0ab5546e926dd98d3ad833909b534840b7d8d0467c4790ca09bc2b14b37313f5", + "replay/supplier7112/short-caller/upstream_application.py": "d98987db98553dc55bfc80e3ca47abfcd51c57af6f8cda61101391d8eae94184", + "replay/supplier7112/short-caller/upstream_native_catalogue.py": "6120e1ea1e07eeba757694d209437a38f121b0a377cc466889a30fa52c561472", + "expected/ODD-8X9-APPLICATION-CHECKS.json": "10512d62f540fe7bb839ec94b6a21bbdf4a3dfadf56b4ec9095d4b242bda19b8", + "expected/ODD-ADMISSION-PARTIAL.json": "75ec76e4393ef1622fcff9e2727dc411921076af4a506d97506665add140fa86", + "expected/ODD-CALLER-EXACT-GRID.json": "87d25d9fa3778bf4784e3a9e17f32ce5ba372663c6e97392cc62b87e6719042c", + "expected/ODD-FIXED-TAPE-COUNTS.json": "1a8bf36a966edca8c61f3be803cdbe136307095dec40245cdc93e79a9062fe99", + "expected/ODD-PHYSICAL-BINDING.json": "ade5f8cbb2e30677b1d48d23a1aa270b3d0b72e2504472ab9fdb71d124b075b5", + "expected/ODD-PRECISION.json": "9c03607288cc2afb80cb02c197f93360978233036418b32b09ad91be16f9c153", + "expected/ODD-TYPE-AB-CALLER.json": "255d89f38cd45e38e5770f559bc43dc217e989032359768cdc7e8cdfd64b47bc", + "expected/ODD-TYPE-AB-REPLAY.json": "71fd0a7ad8b743266c6a75100f3543b48ea7d6fcbe45f008d3b61270e3b660a0" +} diff --git a/research/p104-two-move-typed-volume-bound/closure/round212/lead/inputs/WORD.json.gz b/research/p104-two-move-typed-volume-bound/closure/round212/lead/inputs/WORD.json.gz new file mode 100644 index 0000000000..73f4300719 Binary files /dev/null and b/research/p104-two-move-typed-volume-bound/closure/round212/lead/inputs/WORD.json.gz differ diff --git a/research/p104-two-move-typed-volume-bound/closure/round212/lead/inputs/clifford_exact.py b/research/p104-two-move-typed-volume-bound/closure/round212/lead/inputs/clifford_exact.py new file mode 100644 index 0000000000..166841a037 --- /dev/null +++ b/research/p104-two-move-typed-volume-bound/closure/round212/lead/inputs/clifford_exact.py @@ -0,0 +1,149 @@ +"""Small exact Gaussian-dyadic Clifford compiler, independent of gx internals. +Paulis use i^p X^x Z^z. State vectors use integer Gaussian numerators / 2^d. +The tableau is supplemented by a literal circuit, so global phases are kept. +""" +from dataclasses import dataclass + +def parity(x):return x.bit_count()&1 +def rank(rows): + p={} + for x in rows: + while x: + b=x.bit_length()-1 + if b not in p:p[b]=x;break + x^=p[b] + return len(p) +def transpose(rows,n):return tuple(sum(((rows[j]>>i)&1)<>j&1);a[j],a[k]=a[k],a[j] + for i in range(n): + if i!=j and a[i]>>j&1:a[i]^=a[j] + assert [r&((1<>n for r in a) +def basis_extend(cols,n): + out=[] + for x in list(cols)+[1<len(out):out.append(x) + assert len(out)==n + return tuple(out) +def nullspace(rows,n): + a=list(rows);p=[];k=0 + for j in range(n): + t=next((i for i in range(k,len(a)) if a[i]>>j&1),None) + if t is None:continue + a[t],a[k]=a[k],a[t] + for i in range(len(a)): + if i!=k and a[i]>>j&1:a[i]^=a[k] + p.append(j);k+=1 + return tuple((1<>j)&1)<>i&1:out=pmul(out,T[i]) + for i in range(n): + if z>>i&1:out=pmul(out,T[n+i]) + return out +def compose(A,B):return tuple(apply(A,p) for p in B) +def inverse(T): + n=len(T)//2;cols=[x|(z<>n;u,v,p=apply(T,(x,z,0));assert (u,v)==identity(n)[j][:2];out.append((x,z,(-p)%4)) + return tuple(out) +def qvalue(Q,alpha,x,n): + return (sum(alpha[i] for i in range(n) if x>>i&1)+2*sum(parity((Q[i]>>(i+1))&(x>>(i+1))) for i in range(n) if x>>i&1))%4 +def mul_i(a,p): + x,y=a;p%=4 + return [(x,y),(-y,x),(-x,-y),(y,-x)][p] +@dataclass +class Op: + n:int + tab:tuple + circuit:list + def then(self,b): + assert self.n==b.n + return Op(self.n,compose(b.tab,self.tab),self.circuit+b.circuit) + def adjoint(self): + circ=[] + for e in reversed(self.circuit): + if e[0]=='P':circ.append(('P',inv(e[1],self.n))) + elif e[0]=='D':circ.append(('D',e[1],tuple((-x)%4 for x in e[2]))) + elif e[0]=='C':circ.append(('C',e[1],-e[2])) + elif e[0]=='phase':circ.append(('phase',(-e[1])%4)) + else:circ.append(e) + return Op(self.n,inverse(self.tab),circ) + def zero_state(self,basis=0): + N=1<>i)&1 for i in range(n)) + assert all(alpha[i]%2==(Q[i]>>i)&1 for i in range(n)) + return Op(n,tuple([(1<>i&1 else 0,1<>i&1 else 0) for i in range(n)]),[('C',q,sgn)]) +def xgate(n,b):return Op(n,tuple([(1<>i)&1)) for i in range(n)]),[('X',b)]) +def fourier(n,axes=None): + out=ident(n) + for i in range(n) if axes is None else axes:out=out.then(cgate(n,1<len(selected):picks.append(j);selected.append(x) + assert len(picks)==r and all(x>>r==0 for x in Bcols) + Br=transpose(selected,r);Bi=inv(Br,r);Dr=transpose([Dcols[j]&((1<> j) & 1) << i for i, row in enumerate(matrix)) for j in range(len(matrix))) + + +def inverse(matrix): + n = len(matrix) + rows = [row | (1 << (n+i)) for i, row in enumerate(matrix)] + for j in range(n): + pivot = next((i for i in range(j, n) if rows[i] >> j & 1), None) + require(pivot is not None, 'singular binary chart') + rows[j], rows[pivot] = rows[pivot], rows[j] + for i in range(n): + if i != j and rows[i] >> j & 1: + rows[i] ^= rows[j] + require([row & ((1 << n)-1) for row in rows] == [1 << i for i in range(n)], 'binary inverse') + return tuple(row >> n for row in rows) + + +def extend(vectors, n): + columns, pivots = [], {} + for value in tuple(vectors) + tuple(1 << i for i in range(n)): + reduced = value + while reduced: + j = reduced.bit_length()-1 + if j not in pivots: + pivots[j] = reduced + columns.append(value) + break + reduced ^= pivots[j] + require(len(columns) == n, 'frame basis extension') + return tuple(columns) + + +def adjoint(circuit): + out = [] + for gate in reversed(circuit): + if gate[0] == 'P': + out.append(('P', inverse(gate[1]))) + elif gate[0] == 'D': + out.append(('D', gate[1], tuple(-a % 4 for a in gate[2]))) + elif gate[0] == 'C': + out.append(('C', gate[1], -gate[2])) + elif gate[0] == 'phase': + out.append(('phase', -gate[1] % 4)) + else: + require(gate[0] == 'X', 'adjoint gate type') + out.append(gate) + return tuple(out) + + +def fourier(rank): + return tuple(('C', 1 << i, 1) for i in range(rank)) + + +def frame(vectors, n): + rank = len(vectors) + if rank == 0: + return () + if rank == n: + return fourier(n) + matrix = transpose(extend(vectors, n)) + columns = transpose(inverse(matrix)) + quadratic = tuple((1 << i) ^ sum(parity(a & b) << j for j, b in enumerate(columns)) for i, a in enumerate(columns)) + diagonal = tuple((row >> i) & 1 for i, row in enumerate(quadratic)) + chart = (('P', matrix), ('D', quadratic, diagonal)) + return adjoint(chart) + fourier(rank) + chart + + +def monomial(record): + matrix = tuple(record['matrix_rows']) + quadratic = tuple(record['quadratic_rows']) + linear = tuple(record['linear_Z4']) + require(transpose(quadratic) == quadratic, 'quadratic symmetry') + require(len(matrix) == len(quadratic) == len(linear) == 9, 'monomial dimension') + require(all(a % 2 == (quadratic[i] >> i) & 1 for i, a in enumerate(linear)), 'diagonal parity') + inverse(matrix) + return (('D', quadratic, linear), ('P', matrix), ('X', record['offset']), ('phase', record['phase'])) + + +def recipe(record): + rank = record['rank'] + require(isinstance(rank, int) and 0 <= rank <= 9, 'child rank') + if rank == 0: + require(record['right'] is None, 'rank zero right factor') + return monomial(record['left']) + return monomial(record['right']) + fourier(rank) + monomial(record['left']) + + +def tableau(circuit, n=9): + rows = [(1 << i, 0, 0) for i in range(n)] + [(0, 1 << i, 0) for i in range(n)] + for gate in circuit: + tag = gate[0] + out = [] + inverse_transpose = transpose(inverse(gate[1])) if tag == 'P' else None + for x, z, phase in rows: + if tag == 'P': + x, z = mul(gate[1], x), mul(inverse_transpose, z) + elif tag == 'X': + phase += 2 * parity(z & gate[1]) + elif tag == 'C': + if parity(z & gate[1]): + x ^= gate[1] + phase += 3 * gate[2] + elif tag == 'D': + quadratic, linear = gate[1:] + phase += sum(linear[i] for i in range(n) if x >> i & 1) + phase += 2 * sum(parity((quadratic[i] >> (i+1)) & (x >> (i+1))) for i in range(n) if x >> i & 1) + z ^= mul(quadratic, x) + else: + require(tag == 'phase', 'tableau gate type') + out.append((x, z, phase % 4)) + rows = out + return tuple(rows) + + +@lru_cache(maxsize=512) +def action(gate): + if gate[0] == 'P': + return tuple(mul(gate[1], x) for x in range(512)) + require(gate[0] == 'D', 'state action type') + quadratic, linear = gate[1:] + return tuple((sum(linear[i] for i in range(9) if x >> i & 1) + + 2 * sum(parity((quadratic[i] >> (i+1)) & (x >> (i+1))) for i in range(9) if x >> i & 1)) % 4 for x in range(512)) + + +def rotate(pair, power): + a, b = pair + return ((a, b), (-b, a), (-a, -b), (b, -a))[power % 4] + + +def state(circuit, basis=0): + value, denominator = {basis: (1, 0)}, 0 + for gate in circuit: + tag = gate[0] + result = {} + if tag == "C": + direction, sign = gate[1:] + for address, (a, b) in value.items(): + for target, pair in ((address, (a - sign*b, b + sign*a)), + (address ^ direction, (a + sign*b, b - sign*a))): + old = result.get(target, (0, 0)) + result[target] = (old[0] + pair[0], old[1] + pair[1]) + denominator += 1 + else: + for address, pair in value.items(): + if tag == "P": + target = mul(gate[1], address) + elif tag == "X": + target = address ^ gate[1] + else: + target = address + if tag == "D": + pair = rotate(pair, action(gate)[address]) + else: + require(tag == "phase", "Unknown Gaussian state gate") + pair = rotate(pair, gate[1]) + require(target not in result, "A monomial address map is not injective") + result[target] = pair + value = {address: pair for address, pair in result.items() if pair != (0, 0)} + while denominator and all((a | b) % 2 == 0 for a, b in value.values()): + denominator -= 1 + value = {address: (a//2, b//2) for address, (a, b) in value.items()} + return value, denominator + + +def equal(actual, expected, label): + require(tableau(actual) == tableau(expected), label + ": signed Pauli action") + require(state(actual) == state(expected), label + ": exact global phase") + + +def verify(data, certificate): + word = data["word"] + original, clean = data["programs"], data["clean_programs"] + source_recipes = data["recipes"] + residuals = data["residuals"]["recipes"] + native_tags = {"climb", "adapter", "residual_adapter"} + for orientation in ("forward", "backward"): + native = [event for event in clean[orientation] if event[0] in native_tags] + require(native == [event for event in original[orientation] if event[0] in native_tags], + "A retained native event changed") + require(len(native) == 5056, "The retained native event count changed") + frames = [frame(tuple(vectors), 9) for vectors in word["frames"]] + used = {(event[3], event[4]) for program in clean.values() + for event in program if event[0] == "climb"} + children = {(record["old"], record["new"]): record for record in source_recipes["children"]} + require(len(children) == len(source_recipes["children"]) and used <= set(children), + "The retained child recipe coverage is incomplete") + for old, new in sorted(used): + record = children[old, new] + require(record["rank"] == len(word["frames"][new]) - len(word["frames"][old]), + "A retained child has the wrong rank") + equal(recipe(record), adjoint(frames[old]) + frames[new], "Retained child") + endpoints = {(record["role"], record["port"]): record + for record in source_recipes["endpoint_adapters"]} + require(len(endpoints) == len(source_recipes["endpoint_adapters"]) + and set(endpoints) == {(role, p) for role in ("source", "target") for p in range(112)}, + "The endpoint adapter coverage is incomplete") + for (role, port), record in endpoints.items(): + direction = word["ports"][port] + conventional = (("C", direction, 1),) if role == "source" else ( + ("C", direction, -1),) + fourier(9) + index = word["start"][port] if role == "source" else word["final"][112 + port] + require(record["frame"] == index and record["rank"] == 0, "An endpoint frame changed") + equal(recipe(record), adjoint(conventional) + frames[index], "Endpoint adapter") + used_residuals = set() + for program in clean.values(): + for event in program: + if event[0] != "residual_adapter": + continue + _, position, register, entry, *tail = event + terminal = tail[0] if tail else 1 + key = str(entry) if terminal == 1 else str(entry) + ":" + str(terminal) + require(key in residuals and position in ("pre", "post"), "A residual binding changed") + require(entry == word["start"][register] and terminal == word["final"][register], + "A residual endpoint changed") + used_residuals.add(key) + for key in sorted(used_residuals): + record = residuals[key] + equal(recipe(record), adjoint(frames[record["frame"]]) + frames[record.get("terminal", 1)], + "Residual adapter") + records = certificate["input_recipes"] + ports = certificate["compensation_ports"] + require([record["port"] for record in records] == ports and len(records) == 8, + "The eight input recipes changed") + columns = 0 + for item in records: + port, label = item["port"], item["label"] + require(label == word["ports"][port] and item["canonical_start_frame_id"] == word["start"][port], + "An input recipe has the wrong supplier label") + record = item["recipe"] + require(record["rank"] == 1, "An input copy has the wrong child rank") + for side in ("left", "right"): + factor = record[side] + require(factor["quadratic_rows"] == [0] * 9 and factor["linear_Z4"] == [0] * 9 + and factor["offset"] == factor["phase"] == 0, + "An input factor is not an address permutation") + actual, expected = recipe(record), (("C", label, 1),) + equal(actual, expected, "Positive inherited input line") + for basis in range(512): + require(state(actual, basis) == state(expected, basis), "A complete input Gaussian column differs") + columns += 1 + negative = monomial(record["right"]) + (("C", 1, -1),) + monomial(record["left"]) + require(tableau(negative) != tableau(expected) or state(negative) != state(expected), + "An inverse input child was not detected") + phased = actual + (("phase", 1),) + require(tableau(phased) == tableau(actual) and state(phased) != state(expected), + "An input phase-only error was not detected") + return {"status": "PASS_EXACT_INPUT_NATIVE_FRAMES", "retained_native_events_per_orientation": 5056, + "retained_child_recipes": len(used), "endpoint_adapter_recipes": len(endpoints), + "residual_adapter_recipes": len(used_residuals), "new_input_recipes": len(records), + "new_exact_gaussian_columns": columns, "inverse_input_child_controls": len(records), + "phase_only_controls": len(records), "address_permutation_factors": 2 * len(records), + "method": "Independent signed Pauli and exact Gaussian interpretation; no compiler import", + "scope": "Positive inherited input frames before every retained adapter. No recursive hosting claim."} diff --git a/research/p104-two-move-typed-volume-bound/closure/round212/lead/inputs/pricing.py b/research/p104-two-move-typed-volume-bound/closure/round212/lead/inputs/pricing.py new file mode 100644 index 0000000000..40ec194017 --- /dev/null +++ b/research/p104-two-move-typed-volume-bound/closure/round212/lead/inputs/pricing.py @@ -0,0 +1,82 @@ +"""Directed interval arithmetic and the retained signed BIT invoice.""" +from collections import Counter +from fractions import Fraction +from functools import cache + +TARGET = "10018846261809/2500000000000000" +SCALE = 10**49 + + +def rounded(x, upper): + scaled = SCALE*x + if upper: + return Fraction(-((-scaled.numerator) // scaled.denominator), SCALE) + return Fraction(scaled.numerator // scaled.denominator, SCALE) + + +@cache +def log_bounds(x): + z = (x-1)/(x+1) + terms = 60 + exact_partial = 2*sum(z**(2*i+1)/(2*i+1) for i in range(terms)) + tail = 2*z**(2*terms+1)/((2*terms+1)*(1-z*z)) + return rounded(exact_partial, False), rounded(exact_partial+tail, True) + + +@cache +def power_bounds(rank, k): + binary = 2**(rank.bit_length()-1) + shift = binary.bit_length()-1 + l2, u2 = log_bounds(Fraction(2)) + lo, hi = log_bounds(Fraction(rank, binary)) + lo, hi = k*(lo+shift*l2), k*(hi+shift*u2) + assert 0 <= lo <= hi < 1 + + def exponential(z, terms): + total = term = Fraction(1) + for i in range(1, terms+1): + term *= -z/i + total += term + return total + + return rounded(rank*exponential(hi, 35), False), rounded(rank*exponential(lo, 34), True) + + +def cost(hist, k): + lower = upper = Fraction(0) + for r, n in hist.items(): + a, b = (n*x for x in power_bounds(r, k)) + lower += min(a, b) + upper += max(a, b) + return lower, upper + + +def profile(invoice, native, word, ranks): + copies = invoice["native_calls"] + assert copies == len(invoice["native_instances"]) == 36 + assert {tuple((r["stage"], r["copy"])) for r in invoice["native_instances"]} == { + (stage, which) for stage in range(1, 19) for which in (0, 1) + } + assert all(r["ports"] == 111 for r in invoice["native_instances"]) + assert native == Counter({int(r): n for r, n in invoice["native_paid"].items()}) + assert sum(native.values()) == 2871 + caller_paid = {1: 444, **{r: 444 for r in range(7, 57, 7)}} + assert invoice["event_counts"]["QUERY"]*111 == caller_paid[1] + assert invoice["event_counts"]["IDLE_ONE"]*111 == 8*444 + full_paid = Counter({r: copies*n for r, n in native.items()}) + full_paid.update(caller_paid) + + helpers = Counter(ranks[word["final"][j]]-ranks[word["start"][j]] + for j in range(222, word["public"])) + assert helpers == Counter({int(r): n for r, n in invoice["native_helpers"].items()}) + caller_targets = {**{r: 444 for r in range(8, 65, 7)}, 127: 222} + full_targets = Counter({r: copies*n for r, n in helpers.items()}) + full_targets.update(caller_targets) + assert full_paid == Counter({int(r): n for r, n in invoice["paid"].items()}) + assert full_targets == Counter({int(r): n for r, n in invoice["targets"].items()}) + assert sum(full_paid.values()) == invoice["paid_jobs"] + assert sum(full_targets.values()) == invoice["productive_fields"] + signed = full_targets.copy() + signed.subtract(full_paid) + assert sum(r*n for r, n in signed.items()) == invoice["rank_surplus"] + return signed, copies diff --git a/research/p104-two-move-typed-volume-bound/closure/round212/lead/typed_volume.py b/research/p104-two-move-typed-volume-bound/closure/round212/lead/typed_volume.py new file mode 100644 index 0000000000..e271e78256 --- /dev/null +++ b/research/p104-two-move-typed-volume-bound/closure/round212/lead/typed_volume.py @@ -0,0 +1,31 @@ +from fractions import Fraction as F +from gzip import decompress +from hashlib import sha256 +from json import dumps, loads +from pathlib import Path +from runpy import run_path +from signal import alarm + +root = Path(__file__).resolve().parent / 'inputs' +pins = {'WORD.json.gz':'4b9fd1187b34ed97c3ac0c760d73531735a5d0ebc5b4d4ab4377160b20d9bb2a','clifford_exact.py':'2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962','native_verify.py':'3049471905b47b385c88378a1a3be7a18b8858aadd035b8a6da2f4a03b470f38','pricing.py':'f4d0b6c9314b838d882d6d06020f24881c19a3fda97a7c00df87b1e920785182'} +alarm(30) +for name,digest in pins.items(): + assert sha256((root/name).read_bytes()).hexdigest() == digest +w = loads(decompress((root/'WORD.json.gz').read_bytes())) +assert w['program'][32944:32946] == [['MOVE',625,3,117,False],['MOVE',624,3,117,False]] +a,b = (tuple(w['frames'][i]) for i in (3,117)) +assert a == () and b == (8,17,34,68,391) +C,V = (run_path(str(root/name)) for name in ('clifford_exact.py','native_verify.py')) +recipe,_ = C['lower_child'](C['canonical_frame'](9,a).adjoint().then(C['canonical_frame'](9,b))) +assert recipe['rank'] == 5 +T = V['frame'](b,9) +assert T == V['adjoint'](T[-2:]) + V['fourier'](5) + T[-2:] +V['equal'](T,V['recipe'](recipe),'exact chart and phase') +V['equal'](T*4,(),'exact order divides four') +witness = next([i,list(x),list(y)] for i,(x,y) in enumerate(zip(V['tableau'](()),V['tableau'](T*2),strict=True)) if x!=y) +h = run_path(str(root/'pricing.py'))['power_bounds'] +lo,hi = map(F,('0.00364665195644044790699554028334161','0.00364665195644044790699554028334162')) +quote = [17*(2*h(5,hi)[0]-h(6,lo)[1]),17*(2*h(5,lo)[1]-h(6,hi)[0])] +assert 0 < quote[0] < quote[1] +alarm(0) +print(dumps({'pins':pins,'rank':5,'clocks':[32944,32945],'projective_order':4,'squared_pauli':witness,'quote':list(map(str,quote))},sort_keys=True,indent=2)) diff --git a/research/p104-two-move-typed-volume-bound/closure/round213/independent/RESULT.json b/research/p104-two-move-typed-volume-bound/closure/round213/independent/RESULT.json new file mode 100644 index 0000000000..b0c70ed5ef --- /dev/null +++ b/research/p104-two-move-typed-volume-bound/closure/round213/independent/RESULT.json @@ -0,0 +1,101 @@ +{ + "ambient_dimension": 68719476736, + "caller": "07a76c5e2738882c0cb322278e56f6cae3c9885d", + "clocks": [ + 32944, + 32945 + ], + "columns": 512, + "core_cases": [ + { + "displacement": "60129542144", + "fixed_fraction": "1/8", + "phase_counts": [ + 2, + 4, + 6, + 4 + ], + "rank": 1 + }, + { + "displacement": "49392123904", + "fixed_fraction": "9/32", + "phase_counts": [ + 72, + 64, + 56, + 64 + ], + "rank": 2 + }, + { + "displacement": "52076478464", + "fixed_fraction": "31/128", + "phase_counts": [ + 992, + 1024, + 1056, + 1024 + ], + "rank": 3 + }, + { + "displacement": "51405389824", + "fixed_fraction": "129/512", + "phase_counts": [ + 16512, + 16384, + 16256, + 16384 + ], + "rank": 4 + }, + { + "displacement": "51573161984", + "fixed_fraction": "511/2048", + "phase_counts": [ + 261632, + 262144, + 262656, + 262144 + ], + "rank": 5 + }, + { + "displacement": "51531218944", + "fixed_fraction": "2049/8192", + "phase_counts": [ + 4196352, + 4194304, + 4192256, + 4194304 + ], + "rank": 6 + } + ], + "core_displacement_upper": "60129542144", + "f": 4, + "head": "aaeec8c0acf01e99a5f331ef363a698d9c084ace", + "nonzero_one_slice_entries": 16384, + "one_slice_max_squared_magnitude": "1/32", + "pins": { + "WORD.json.gz": "4b9fd1187b34ed97c3ac0c760d73531735a5d0ebc5b4d4ab4377160b20d9bb2a", + "clifford_exact.py": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962", + "native_verify.py": "3049471905b47b385c88378a1a3be7a18b8858aadd035b8a6da2f4a03b470f38" + }, + "r212_runner_sha256": "bdf2519d81b02f9c627906850f7c509dafbb25cfa5149b5a52b8baeffdc1c87b", + "relative_fixed_dimension_upper": "68786585600", + "relative_trace_upper": "134217728", + "roles": [ + 625, + 624 + ], + "runner_cap_seconds": 30, + "source": 3, + "strict_dimension_gap": "8522825728", + "target": 117, + "target_displacement_lower": "68652367872", + "target_entry_cap": "1/1024", + "word_sha256": "9aa8d6b054ba7eb2289d052c1079b16be518d2f0fbfb244569fa18e3733acdac" +} diff --git a/research/p104-two-move-typed-volume-bound/closure/round213/independent/replay.py b/research/p104-two-move-typed-volume-bound/closure/round213/independent/replay.py new file mode 100644 index 0000000000..3e6a235123 --- /dev/null +++ b/research/p104-two-move-typed-volume-bound/closure/round213/independent/replay.py @@ -0,0 +1,97 @@ +"""Independent one-pair width-four monomial-erasure displacement bound.""" +from fractions import Fraction as Q +from gzip import decompress +from hashlib import sha256 +from json import dumps, loads +from pathlib import Path +from runpy import run_path +from signal import SIGALRM, alarm, signal +from sys import argv, implementation, version_info + +CAP = 30 +WIDTH = 4 +PRIOR_RUNNER = 'bdf2519d81b02f9c627906850f7c509dafbb25cfa5149b5a52b8baeffdc1c87b' + + +def counts(bits): + residue = [1, 0, 0, 0] + for _ in range(bits): + residue = [residue[i] + residue[(i-1) % 4] for i in range(4)] + assert sum(residue) == 1 << bits + return residue + + +def stop(*_): + raise TimeoutError('R213 independent 30-second cap') + + +def main(): + assert __debug__ and implementation.name == 'cpython' and version_info[:2] == (3, 12) + assert len(argv) == 3, 'pass R212 independent replay.py and exact source input root' + prior, root = [Path(s).resolve() for s in argv[1:]] + signal(SIGALRM, stop) + alarm(CAP) + assert sha256(prior.read_bytes()).hexdigest() == PRIOR_RUNNER + old = run_path(str(prior)) + raw = {} + for name, digest in old['PINS'].items(): + raw[name] = (root / name).read_bytes() + assert sha256(raw[name]).hexdigest() == digest, name + body = decompress(raw['WORD.json.gz']) + assert sha256(body).hexdigest() == old['WORD'] + word = loads(body, object_pairs_hook=old['no_duplicates']) + clocks, roles = [32944, 32945], [625, 624] + start, end = 3, 117 + for clock, role in zip(clocks, roles, strict=True): + assert word['program'][clock] == ['MOVE', role, start, end, False] + src, dest = [tuple(word['frames'][chart]) for chart in (start, end)] + assert src == () and dest == (8, 17, 34, 68, 391) + verifier = run_path(str(root / 'native_verify.py')) + frame = verifier['adjoint'](verifier['frame'](src, 9)) + verifier['frame'](dest, 9) + assert frame[2:7] == verifier['fourier'](5) and frame[:2] == verifier['adjoint'](frame[7:]) + nonzero = 0 + max_square = Q(0) + column = old['column'] + for j in range(512): + state, denominator_power = column(frame, j) + assert len(state) == 32 + magnitudes = {Q(a*a+b*b, 4**denominator_power) for a, b in state.values()} + assert magnitudes == {Q(1, 32)} + max_square = max(max_square, max(magnitudes)) + nonzero += len(state) + assert nonzero == 512*32 + target_entry_cap = max_square ** (WIDTH//2) + assert target_entry_cap == Q(1, 1024) + N = 1 << (9*WIDTH) + # On a 2N-dimensional unitary, m fixed eigenvectors give Re(trace) >= + # 2m-2N. The monomial matching can select at most 2N target entries. + trace_upper = 2 * N * target_entry_cap + fixed_upper = N + trace_upper/2 + target_rank_lower = 2*N - fixed_upper + assert target_rank_lower == Q(1023, 1024)*N + core_rows = [] + core_max = Q(0) + for rank in range(1, 7): + bits = rank * WIDTH + residue = counts(bits) + fixed_fraction = Q(residue[0], 1 << bits) + assert fixed_fraction == Q(1, 4) + Q((-1)**rank, 1 << (2*rank+1)) + assert fixed_fraction >= Q(1, 8) + movement = (1-fixed_fraction) * N + core_rows.append({'rank': rank, 'phase_counts': residue, 'fixed_fraction': str(fixed_fraction), 'displacement': str(movement)}) + core_max = max(core_max, movement) + assert core_max == Q(7, 8)*N + assert target_rank_lower - core_max == Q(127, 1024)*N > 0 + alarm(0) + print(dumps({'head': old['HEAD'], 'caller': old['CALLER'], 'pins': old['PINS'], 'word_sha256': old['WORD'], + 'r212_runner_sha256': PRIOR_RUNNER, 'clocks': clocks, 'roles': roles, 'source': start, 'target': end, + 'f': WIDTH, 'ambient_dimension': N, 'columns': 512, 'nonzero_one_slice_entries': nonzero, + 'one_slice_max_squared_magnitude': str(max_square), 'target_entry_cap': str(target_entry_cap), + 'relative_trace_upper': str(trace_upper), 'relative_fixed_dimension_upper': str(fixed_upper), + 'target_displacement_lower': str(target_rank_lower), 'core_cases': core_rows, + 'core_displacement_upper': str(core_max), 'strict_dimension_gap': str(target_rank_lower-core_max), + 'runner_cap_seconds': CAP}, sort_keys=True, indent=2)) + + +if __name__ == '__main__': + main() diff --git a/research/p104-two-move-typed-volume-bound/closure/round213/lead/RESULT.json b/research/p104-two-move-typed-volume-bound/closure/round213/lead/RESULT.json new file mode 100644 index 0000000000..ef2bfa1b39 --- /dev/null +++ b/research/p104-two-move-typed-volume-bound/closure/round213/lead/RESULT.json @@ -0,0 +1,56 @@ +{ + "case_cap": 1, + "clocks": [ + 32944, + 32945 + ], + "core_rank_upper_per_ambient": "7/8", + "core_residue_fractions": { + "1": [ + "1/8", + "1/4", + "3/8", + "1/4" + ], + "2": [ + "9/32", + "1/4", + "7/32", + "1/4" + ], + "3": [ + "31/128", + "1/4", + "33/128", + "1/4" + ], + "4": [ + "129/512", + "1/4", + "127/512", + "1/4" + ], + "5": [ + "511/2048", + "1/4", + "513/2048", + "1/4" + ], + "6": [ + "2049/8192", + "1/4", + "2047/8192", + "1/4" + ] + }, + "one_slice_columns": 512, + "one_slice_support": 32, + "pins": { + "round212/lead/inputs/WORD.json.gz": "4b9fd1187b34ed97c3ac0c760d73531735a5d0ebc5b4d4ab4377160b20d9bb2a", + "round212/lead/inputs/native_verify.py": "3049471905b47b385c88378a1a3be7a18b8858aadd035b8a6da2f4a03b470f38" + }, + "seconds_cap": 30, + "target_entry_upper": "1/1024", + "target_pair_rank_lower_per_ambient": "1023/1024", + "width": 4 +} diff --git a/research/p104-two-move-typed-volume-bound/closure/round213/lead/monomial.py b/research/p104-two-move-typed-volume-bound/closure/round213/lead/monomial.py new file mode 100644 index 0000000000..ec379c7234 --- /dev/null +++ b/research/p104-two-move-typed-volume-bound/closure/round213/lead/monomial.py @@ -0,0 +1,52 @@ +"""Exact typed MOVE rank capacities for any unitary monomial erasure.""" +from fractions import Fraction as F +from gzip import decompress +from hashlib import sha256 +from json import dumps,loads +from math import comb +from pathlib import Path +from runpy import run_path +from signal import alarm + +ROOT = Path(__file__).resolve().parents[2] +PINS = { + 'round212/lead/inputs/WORD.json.gz':'4b9fd1187b34ed97c3ac0c760d73531735a5d0ebc5b4d4ab4377160b20d9bb2a', + 'round212/lead/inputs/native_verify.py':'3049471905b47b385c88378a1a3be7a18b8858aadd035b8a6da2f4a03b470f38', +} + + +def main(): + assert __debug__ + alarm(30) + for name,digest in PINS.items(): + assert sha256((ROOT/name).read_bytes()).hexdigest() == digest + paths = ROOT/'round212/lead/inputs' + word = loads(decompress((paths/'WORD.json.gz').read_bytes())) + assert word['program'][32944:32946] == [['MOVE',625,3,117,False],['MOVE',624,3,117,False]] + assert not word['frames'][3] and word['frames'][117] == [8,17,34,68,391] + v = run_path(str(paths/'native_verify.py')) + target = v['frame'](word['frames'][117],9) + for j in range(512): + col, log_den = v['state'](target,j) + assert len(col) == 32 + assert all(32*(a*a+b*b) == 2**(2*log_den) for a,b in col.values()) + width = 4 + max_entry = F(1,2**(5*width//2)) + pair_rank_lower = 1-max_entry + ranks = {} + for r in range(1,7): + n = width*r + residue_fractions = [F(sum(comb(n,j) for j in range(i,n+1,4)),2**n) for i in range(4)] + ranks[r] = list(map(str,residue_fractions)) + assert min(residue_fractions) >= F(1,8) + child_rank_upper = F(7,8) + assert pair_rank_lower == F(1023,1024) > child_rank_upper + alarm(0) + print(dumps({'pins':PINS,'clocks':[32944,32945],'width':width,'one_slice_columns':512, + 'one_slice_support':32,'target_entry_upper':str(max_entry),'target_pair_rank_lower_per_ambient':str(pair_rank_lower), + 'core_rank_upper_per_ambient':str(child_rank_upper),'core_residue_fractions':ranks, + 'case_cap':1,'seconds_cap':30},sort_keys=True,indent=2)) + + +if __name__ == '__main__': + main() diff --git a/research/p104-two-move-typed-volume-bound/replay.py b/research/p104-two-move-typed-volume-bound/replay.py new file mode 100644 index 0000000000..50090737fa --- /dev/null +++ b/research/p104-two-move-typed-volume-bound/replay.py @@ -0,0 +1,90 @@ +"""Replay both exact one-field typed MOVE exclusion bounds.""" +from fractions import Fraction as Q +from hashlib import sha256 +from json import loads +from pathlib import Path +from subprocess import run +from sys import executable, implementation, version_info + +PACKAGE = Path(__file__).resolve().parent +ROOT = PACKAGE / 'closure' +INPUTS = ROOT / 'round212/lead/inputs' +COMPARATOR = 'aaeec8c0acf01e99a5f331ef363a698d9c084ace' +CALLER = '07a76c5e2738882c0cb322278e56f6cae3c9885d' +CLOCKS = [32944,32945] + + +def check_pins(): + pins = {} + for line in (PACKAGE/'PINS.txt').read_text().splitlines(): + digest, rel = line.split() + assert rel not in pins and sha256((PACKAGE/rel).read_bytes()).hexdigest() == digest, rel + pins[rel] = digest + assert set(pins) == {p.relative_to(PACKAGE).as_posix() for p in ROOT.rglob('*') if p.is_file()} + caller_manifest = loads((INPUTS/'7113-SHA256.json').read_bytes()) + for name in ('clifford_exact.py', 'native_verify.py'): + bound = caller_manifest[f'replay/supplier7112/short-caller/admission-source/frozen/{name}'] + assert bound == pins[f'closure/round212/lead/inputs/{name}'] + + +def checked(script, result, *args): + proc = run([executable, '-I', '-B', str(ROOT/script), *map(str,args)], + check=True, capture_output=True, timeout=35) + assert not proc.stderr and proc.stdout == (ROOT/result).read_bytes(), script + return loads(proc.stdout) + + +def check_identity(lead, independent): + assert lead['rank'] == independent['paid_rank'] == 5 + assert lead['projective_order'] == independent['projective_order'] == 4 + assert lead['squared_pauli'] == [7,[128,0,0],[128,0,2]] + assert independent['square_offdiagonal_witness'] == [504,0,0,-1,0] + assert independent['signed_one_slice_columns_verified'] == 512 + assert independent['dropped_C_gate_rejected'] + counts = independent['initial_residue_counts'] + assert counts == [6,6,10,10] and Q(max(counts),sum(counts)) == Q(5,16) + assert Q(independent['required_two_lane_ambient_fraction_all_f_ge_1']) == 2*(1-Q(5,16)) == Q(11,8) + lo, hi = map(Q,lead['quote']) + assert Q('67.66946959214') < lo < hi < Q('67.66946959215') + + +def check_monomial(lead, independent): + assert lead['width'] == independent['f'] == 4 + assert lead['one_slice_columns'] == independent['columns'] == 512 + assert lead['one_slice_support'] * independent['columns'] == independent['nonzero_one_slice_entries'] + n = independent['ambient_dimension'] + assert n == 1 << 36 + entry_cap = Q(lead['target_entry_upper']) + assert entry_cap == Q(independent['target_entry_cap']) == Q(1,1024) + assert Q(independent['one_slice_max_squared_magnitude'])**2 == entry_cap + assert Q(independent['relative_trace_upper']) == 2*n*entry_cap + assert Q(independent['relative_fixed_dimension_upper']) == n*(1+entry_cap) + rank_lower = Q(independent['target_displacement_lower']) + assert rank_lower == n*Q(lead['target_pair_rank_lower_per_ambient']) == n*Q(1023,1024) + core_upper = Q(independent['core_displacement_upper']) + assert core_upper == n*Q(lead['core_rank_upper_per_ambient']) == n*Q(7,8) + for row in independent['core_cases']: + fractions = list(map(Q, lead['core_residue_fractions'][str(row['rank'])])) + assert Q(row['fixed_fraction']) == fractions[0] + assert min(fractions) >= Q(1,8) and sum(fractions) == 1 + assert Q(independent['strict_dimension_gap']) == rank_lower-core_upper == n*Q(127,1024) + + +def main(): + assert __debug__ and implementation.name == 'cpython' and version_info[:2] == (3,12) + check_pins() + lead212 = checked('round212/lead/typed_volume.py','round212/lead/RESULT.json') + ind212 = checked('round212/independent/replay.py','round212/independent/RESULT.json',INPUTS) + lead213 = checked('round213/lead/monomial.py','round213/lead/RESULT.json') + ind213 = checked('round213/independent/replay.py','round213/independent/RESULT.json',ROOT/'round212/independent/replay.py',INPUTS) + assert all(receipt['clocks'] == CLOCKS for receipt in (lead212,ind212,lead213,ind213)) + for independent in (ind212,ind213): + assert (independent['head'],independent['caller']) == (COMPARATOR,CALLER) + assert independent['roles'] == [625,624] and (independent['source'],independent['target']) == (3,117) + check_identity(lead212,ind212) + check_monomial(lead213,ind213) + print('PASS_TYPED_MOVE_VOLUME: identity 11N/8, monomial 1023N/1024, normalized core at most 7N/8') + + +if __name__ == '__main__': + main()