diff --git a/research/gaussian-caller-outside-pricing/PROOF.md b/research/gaussian-caller-outside-pricing/PROOF.md new file mode 100644 index 0000000000..50c3183be3 --- /dev/null +++ b/research/gaussian-caller-outside-pricing/PROOF.md @@ -0,0 +1,96 @@ +# Proof: the caller outside the selected pricing assembly does not consume C + +## Setting + +The selected conditional result is PR6030, κ = 781451/250000000. +`research/p104-helper470-twin-rung-removal/pricing.py` is the pricing +assembly admitted with that result. Inside `run`, after the stock gate + + atom > ordinary > admitted > TESTED, + +it builds a parameter dictionary whose `bit_saving` entry is `admitted` +and passes that dictionary to the PR4359 ledger. The recorded PR5679 +component + + C = 3507410738409/1000000000000000 + +is the `admitted` field of `research/g20-helper-split/ORDINARY-RESULT.json`, +with `whole_kappa = null`. The fork note that rejects C as that assembly's +admitted input does not identify a caller outside the assembly. This note +names the caller the selected verifier actually loads. + +## The caller and its parameters + +`research/p104-helper470-twin-rung-removal/verify.py` loads + + research/p104-productive-controller/caller.py + +and then, in this order, + + caller = C.construct() + physical = C.physical(caller, word) + price = P.run(local, native, caller, physical) + +`construct` takes no arguments. Its return value is the controller object +stored in `CONTROLLER.json`. The verifier's equality message calls that +object the physical caller. That JSON object has no `bit_saving` field and +does not contain the numerator of C. + +`physical` is the function that contains the Gaussian checks. Its source +has exactly one copy of each of + + Multiply the Gaussian pair twice with exact real and imaginary parts. + All idle Gaussian axes + +and its only parameters are `word` and `local`, with no defaults. The +selected call passes two positional arguments. The first is the controller +returned by `construct`. The second is the regenerated edited word stored +in the verifier's variable `word`. That second object is the edited PR5907 +word, not the replay dictionary the verifier names `local`, and not C. +Neither parameter is named `bit_saving`. The function's only direct return +statement builds a dictionary. Its keys include `whole_idle_jobs` and do +not include `bit_saving`. No function in the module has an argument named +`bit_saving`, and the module text does not contain that identifier. + +`pricing.run` is a different function. Its parameters are +`local, native, word, physical`. The `bit_saving` entry is created inside +the body and set to `admitted`. `physical` returns before that assignment. +The caller does not use the pricing assembly. + +## What this obstruction says + +For this named function, there is no `bit_saving` input that can be set to +C. The recorded controller artifact also has no such field. The caller +therefore does not consume C. No execution receipt for `physical` is +claimed, because an execution cannot place C into a parameter the function +does not have. + +## Finite census of `caller.py` + +At base commit `7c49fe32c55de02c2c873655c804b16e4c3fef0a`, +`git ls-tree -r --name-only` lists every path in the tree. The paths whose +final component is `caller.py` are exactly 15, and they are the list in +`verify.py`. Each blob was read in full. None contains the byte string +`bit_saving`. Exactly seven of those blobs contain `Gaussian` or +`gaussian`. Five of them are the same blob, +`6ac5e735691555ecafe2afbcff71edd923178113`: the named file and the copies +under the caller-independent audit, the contact-independent audit, +`research/p104-coupled-helper-bases/caller.py`, and +`research/p104-cut-stability/whole-caller/inputs/caller.py`. The other two +are different files. `research/native-involutive-dual/caller.py` contains +the check `Real K commutes full Gaussian` and the field +`gaussian_supplier`. `research/physical-boundary-rhs-caller/caller.py` +imports `gaussian_page`. Neither of those two defines `physical`. None of +the seven contains `bit_saving`. This is an exhaustive finite census of +that filename at that commit. It is not a census of every function in the +repository. In particular, +`research/gaussian-height-contract/check_caller.py` is not named +`caller.py`, and the PR4359 ledger is not in this census. + +## What is not claimed + +This does not rerun the selected stock gate, change the thinned +controller's cover, or treat the assembly rejection of C as a prohibition +on every possible caller. A function outside these 15 files could still +have a `bit_saving` parameter. The selected κ is unchanged. The five +framework assumptions remain in force. `physical` was not executed. diff --git a/research/gaussian-caller-outside-pricing/README.md b/research/gaussian-caller-outside-pricing/README.md new file mode 100644 index 0000000000..defaeccd3a --- /dev/null +++ b/research/gaussian-caller-outside-pricing/README.md @@ -0,0 +1,97 @@ +# The caller outside the selected pricing assembly does not consume C + +**Negative result for one named caller. No new κ.** The selected conditional +exponent stays **781451/250000000**. + +The recorded PR5679 component is + + C = 3507410738409/1000000000000000 + +from `research/g20-helper-split/ORDINARY-RESULT.json`, with `whole_kappa` +null. The selected PR6030 pricing assembly assigns its own `bit_saving` +entry from the thinned controller's admitted BIT. This package does not +reopen that assignment or the cover inside it. + +The caller outside that assembly is `physical` in +`research/p104-productive-controller/caller.py`. The selected verifier loads +that module and calls `C.physical(caller, word)` before `pricing.run`. The +function's parameters are `word` and `local`. It checks the Gaussian pair +and the idle Gaussian axes, and it has no `bit_saving` parameter. The +selected call is `physical(caller, word)`. Its first argument is the +controller returned by `construct`, equal to `CONTROLLER.json`, which has +no `bit_saving` field. Its second argument is the regenerated edited word, +not the replay dictionary and not C. This caller does not consume C. + +At the same base commit, the tree contains exactly 15 files named +`caller.py`. None of those blobs contains `bit_saving`. That is a census of +one filename, not a proof that no other function can accept C. + +## Task and overlap + +Base commit `7c49fe32c55de02c2c873655c804b16e4c3fef0a` on canonical +`CrocSwap/integer-mult-bounds` main. Priority revision 8. Catalogue card +`supplier-boundary-audit`. Scope status: **refined**. + +The card asks whether one changed supplier has complete native, caller, +ordinary and outer admission coverage, and says to stop at one resolved +gap. The candidate is the PR5679 component. The gap taken here is the +caller the selected verifier loads before the pricing assembly. The stock +gate inside that assembly, and any other cover for its ordinary formula, +stay outside this package. + +Session r137. The question is open question 2 of the r114 note on +discussion #1166, comment 19492491, recorded in fork PR 149. Overlap at +`2026-11-10T02:08:04Z` searched 885 open PR bodies and 6,934 discussion +records, plus the local notes at `7c49fe32`. No open PR states this +caller's parameter list. Neighbouring notes use the same caller file for +an income bound, or they leave a stronger Gaussian caller unnamed. No +matches is not proof that a hidden diff is absent. + +The family-status expansion gate was not opened. This package does not +extend a construction. + +## Validation + +Environment: Python 3.12, standard library, and local Git for the pinned +tree listing. From the repository root: + +```sh +python3 -B research/gaussian-caller-outside-pricing/verify.py +python3 -O -B research/gaussian-caller-outside-pricing/verify.py +python3 -B scripts/research_package.py --package research/gaussian-caller-outside-pricing +``` + +The verifier prints `PASS_GAUSSIAN_CALLER_OUTSIDE_PRICING`. The launcher +prints `PASS_REGISTERED_RESEARCH_PACKAGE` with outcome `negative-result`. +Checks raise `SystemExit`, so `-O` does not disable them. + +The verifier parses `physical`, checks that the selected call site orders +`C.physical` before `pricing.run`, and compares the 15 `caller.py` blobs at +the base commit. Controls: an in-memory parameter named `bit_saving` is +detected, and a reversed call order is rejected. + +Not run: `physical`, the PR5679 caller replay, the pricing assembly, the +outer ledger, native maps, compiler, tape, analytic recovery, +`make frontier6030-verify`, Lean, and Docker. Unknown costs are not treated +as zero. + +## Credit + +The caller and the selected verifier are DreamingOfClouds' PR #6030 chain, +with the productive controller caller from the retained P104 lineage. The +component C is Ali Romman's PR #5679, recorded in `research/g20-helper-split`. +The assembly rejection of C inside the selected pricing is the r114 note, +not a result of this package. Dugongue, ai-nanachi, and the notices retained +in those packages keep their credit. + +Prepared by unpaidmoon with substantial Cursor Grok assistance. Apache-2.0. + +## Open next questions + +1. Can a function that is not one of these 15 `caller.py` files, and is not + `pricing.run`, accept C as a parameter named `bit_saving` while checking + a Gaussian pair or idle Gaussian axis? First step: name that function + from a file whose final component is not `caller.py` and whose path is + not `research/p104-helper470-twin-rung-removal/pricing.py`, then execute + it at C. Blocked by the absence of such a checked function. This census + does not search other filenames, and it does not execute the ledger. diff --git a/research/gaussian-caller-outside-pricing/SOURCES.json b/research/gaussian-caller-outside-pricing/SOURCES.json new file mode 100644 index 0000000000..c68e95e415 --- /dev/null +++ b/research/gaussian-caller-outside-pricing/SOURCES.json @@ -0,0 +1,48 @@ +{ + "schema_version": 1, + "base_commit": "7c49fe32c55de02c2c873655c804b16e4c3fef0a", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "input", + "git_blob": "d59b5035e7b4cbaa9d688a1d32dd0d6eb79c466a", + "sha256": "9b8d0eea95b3bf0dfcb7938a732a6439b87a2685dec2a5ab9e525b3b34debbfa" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "3404fbdd5e7529a0674eef26114b5071e4586cec", + "sha256": "ead6cdc9d0af6d58e8a49744d8ec8c7c15e13d2ba93c276c434bcf9b51b93a81" + }, + { + "path": "research/g20-helper-split/ORDINARY-RESULT.json", + "usage": "input", + "git_blob": "bfe417c5cca5227714238c80d65700e3f6a2e8d8", + "sha256": "382ca0d6c763dd26e12cac2e490eb1ecd8d40f1a1501b0e059aacc04fe7528de" + }, + { + "path": "research/p104-helper470-twin-rung-removal/pricing.py", + "usage": "input", + "git_blob": "65bb723f8558dc60ff92764db1a43d8bf438aa09", + "sha256": "3c6cf2966ccfe5a5fb6c90f89f46ac224ea455127e35dd34975683c68c36d710" + }, + { + "path": "research/p104-helper470-twin-rung-removal/verify.py", + "usage": "input", + "git_blob": "6e8585e43ea7f8acbcdec6eec0bf196a2d81cb28", + "sha256": "91663e9d34c6bd6da8e52175ea77f9918d4dfa8f960ae0c7b53bbd404226fa4f" + }, + { + "path": "research/p104-productive-controller/CONTROLLER.json", + "usage": "input", + "git_blob": "cc539db709cf7a6c42872c4380902736ad453af3", + "sha256": "a84f6bbd547379597464e56c420cc665f96bc43a9a1351eed4b7cd0fce3cc4b9" + }, + { + "path": "research/p104-productive-controller/caller.py", + "usage": "input", + "git_blob": "6ac5e735691555ecafe2afbcff71edd923178113", + "sha256": "300d40043953e4f6aecfde8f2d1004b8ad6dc5a79ec3c7666c9908c2466c91c8" + } + ] +} diff --git a/research/gaussian-caller-outside-pricing/TASK.json b/research/gaussian-caller-outside-pricing/TASK.json new file mode 100644 index 0000000000..e5abc5529a --- /dev/null +++ b/research/gaussian-caller-outside-pricing/TASK.json @@ -0,0 +1,91 @@ +{ + "schema_version": 1, + "task_id": "supplier-boundary-audit", + "priority_revision": 8, + "base_commit": "7c49fe32c55de02c2c873655c804b16e4c3fef0a", + "original_card": { + "id": "supplier-boundary-audit", + "question": "Does one changed supplier have complete source-bound native, caller, ordinary and outer admission coverage?", + "starting_points": [ + "docs/research/current-priorities.md", + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md" + ], + "methods": [ + "Construct and independently check one source-bound instance of the stated first experiment.", + "Seek an exact counterexample or target-specific complete-budget obstruction to that same proposed change." + ], + "acceptance_gate": "Pin the current sources and one obligation; the historical owner audit is an example, not evidence of a current bug.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read revision 8, the selected review and live exact-source handoffs. Then follow this card's bounded first_experiment.", + "scope": "Source-bound orientation only, not a supplier replay or theorem proof." + }, + "first_experiment": "Choose one latest uncovered candidate and build a delta coverage map against the selected review. For P104, #5717 changes owned-lifetime assumptions and #5719 covers exact #5713 causal premises; neither automatically transfers to #5718. For BIT, #5679/#5708 need component admission and compatible outer use. Check controls and exact source identity before reuse; stop with one resolved gap or explicit remaining obligation. A heavy full replay requires a separate serial resource budget.", + "bottleneck_link": "Judge the actual current supplier contract and complete signed target/paid bill; frozen-profile ceilings require an applicability proof.", + "allowed_variations": [ + "One exact source head, helper/cut region or quantified proposition and changed hypothesis; check live handoffs first. Different seeds are not different scopes." + ], + "scope_change_triggers": [ + "Changing source head, helper/cut domain, operation alphabet or caller boundary without recording the new scope.", + "Treating an archived proposal or local numerical pass as complete supplier admission." + ], + "overlap_terms": [ + "supplier admission", + "5717", + "5719", + "5708", + "owned lifetime" + ], + "existing_checks": [ + { + "scope": "PR #4088: author-checked local words, native receipts, owner/phase fill and exact moment.", + "evidence": "research/staged544-mixed-fourth-entry/README.md", + "remaining": "Rebind and validate ordinary/outer admission with all four providers; full mixed release not established.", + "status": "author-checked", + "source_commit": "72d7efc181edb21806a878f174847c96dd410ab0", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #3801: successor scatter-boundary decision package.", + "evidence": "research/scatter-boundary-decision/README.md", + "remaining": "Consult its exact acceptance scope before any new exporter audit; not proof of a selected failure.", + "status": "author-checked", + "source_commit": "911f8800ba7a4b03603ef62c5ffc6240e53cb5fd", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "Selected PR5599: complete helper-subspace construction and independent caller replay; five framework assumptions remain.", + "evidence": "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "remaining": "The next experiment must identify uncovered source-specific work. Successor archive intake does not transfer this admission.", + "status": "reviewed", + "source_commit": "09dd0965711ca7eeb169057a420abab1c9052137", + "selected_record_sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5" + } + ] + }, + "scope_status": "refined", + "actual_scope": "Name the Gaussian caller loaded by the selected PR6030 verifier before pricing.run, and decide whether that caller's parameters consume the recorded PR5679 component C.", + "scope_change_reason": "The card asks for one resolved admission gap on a latest candidate and allows stopping at one gap. The candidate is the PR5679 component. This package names the caller outside the selected pricing assembly. It does not rerun that assembly's stock gate or change the thinned controller's cover.", + "bottleneck_link": "A whole kappa needs a caller that can take the higher BIT component. The caller the selected verifier loads before the pricing assembly has no bit_saving input, so this component is not consumed there.", + "budget_minutes": 60, + "stop_rule": "Stop after naming that caller and its parameters. Do not execute the caller, edit the cover, or change kappa.", + "outcome": "negative-result", + "evidence": "verify.py parses physical(word, local), checks the selected call order, and censuses every caller.py blob at the base commit. PROOF.md states the obstruction.", + "author": "unpaidmoon", + "ai_assistance": "Substantial Cursor Grok assistance with the source census, verifier, and writeup. No independent human or proof-kernel review.", + "open_questions": [ + { + "question": "Can a function outside the 15 caller.py files, and outside pricing.run, accept C as a parameter named bit_saving while checking a Gaussian pair or idle Gaussian axis?", + "why_it_matters": "The filename census does not prove that no other function can consume the component.", + "first_step": "Name the function from a file whose final component is not caller.py and whose path is not research/p104-helper470-twin-rung-removal/pricing.py, then execute it at C.", + "blocked_by": "No such checked function is supplied here. The ledger is not executed." + } + ] +} diff --git a/research/gaussian-caller-outside-pricing/VERIFY.json b/research/gaussian-caller-outside-pricing/VERIFY.json new file mode 100644 index 0000000000..b79971764b --- /dev/null +++ b/research/gaussian-caller-outside-pricing/VERIFY.json @@ -0,0 +1,41 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "certificates/selected-result.json", + "research/g20-helper-split/ORDINARY-RESULT.json", + "research/p104-helper470-twin-rung-removal/pricing.py", + "research/p104-helper470-twin-rung-removal/verify.py", + "research/p104-productive-controller/CONTROLLER.json", + "research/p104-productive-controller/caller.py" + ], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-W", + "error", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 60, + "checks": "physical(word, local) is the Gaussian caller loaded before pricing.run; it has no bit_saving parameter; the 15 caller.py blobs at the base commit contain no bit_saving; an added parameter and a reversed call order fail." + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-W", + "error", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 60, + "checks": "physical(word, local) is the Gaussian caller loaded before pricing.run; it has no bit_saving parameter; the 15 caller.py blobs at the base commit contain no bit_saving; an added parameter and a reversed call order fail." + } + ] +} diff --git a/research/gaussian-caller-outside-pricing/verify.py b/research/gaussian-caller-outside-pricing/verify.py new file mode 100644 index 0000000000..b24a94b844 --- /dev/null +++ b/research/gaussian-caller-outside-pricing/verify.py @@ -0,0 +1,260 @@ +#!/usr/bin/env python3 +"""The Gaussian caller outside the selected pricing assembly has no bit_saving input. + +The selected PR6030 verifier loads research/p104-productive-controller/caller.py +and calls physical before pricing.run. That function checks the +idle Gaussian axes and the Gaussian pair. Its parameters are word and local. +Neither it, nor the controller object the verifier labels the physical caller, +carries bit_saving. It therefore cannot consume the recorded PR5679 component. + +This verifier does not execute physical, the pricing assembly, or the ledger. +""" +from fractions import Fraction +import ast +import json +import subprocess +from pathlib import Path + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +CALLER = ROOT / "research/p104-productive-controller/caller.py" +CONTROLLER = ROOT / "research/p104-productive-controller/CONTROLLER.json" +ASSEMBLY_VERIFY = ROOT / "research/p104-helper470-twin-rung-removal/verify.py" +PRICING = ROOT / "research/p104-helper470-twin-rung-removal/pricing.py" +COMPONENT = ROOT / "research/g20-helper-split/ORDINARY-RESULT.json" +SELECTED = ROOT / "certificates/selected-result.json" +TASK = HERE / "TASK.json" +C_VALUE = Fraction(3507410738409, 1000000000000000) +CALLER_PY = ( + "research/bit-carrier-owner-admission/caller.py", + "research/bit-compact-carrier-retirement/provider/caller.py", + "research/bit-stage-mixedwidth-packing/provider/caller.py", + "research/crt-repair-query-budget/caller.py", + "research/literal-complete-row-parking-caller/caller.py", + "research/native-involutive-dual/caller.py", + "research/p104-caller-independent-audit/capsule/outputs/p104-contact-reassessment-20261025/sources/predecessor/caller.py", + "research/p104-contact-independent-audit/capsule/outputs/p104-contact-reassessment-20261025/sources/predecessor/caller.py", + "research/p104-coupled-helper-bases/caller.py", + "research/p104-cut-stability/whole-caller/inputs/caller.py", + "research/p104-productive-controller/caller.py", + "research/p104-retained-operand-independent-audit/caller.py", + "research/physical-boundary-rhs-caller/caller.py", + "research/rank7-boolean-scalar-caller/caller.py", + "research/selected-complex-layer-closure/caller.py", +) +GAUSSIAN_MARKERS = ( + "Multiply the Gaussian pair twice with exact real and imaginary parts.", + "All idle Gaussian axes", +) +GAUSSIAN_CALLER_PY = ( + "research/native-involutive-dual/caller.py", + "research/p104-caller-independent-audit/capsule/outputs/p104-contact-reassessment-20261025/sources/predecessor/caller.py", + "research/p104-contact-independent-audit/capsule/outputs/p104-contact-reassessment-20261025/sources/predecessor/caller.py", + "research/p104-coupled-helper-bases/caller.py", + "research/p104-cut-stability/whole-caller/inputs/caller.py", + "research/p104-productive-controller/caller.py", + "research/physical-boundary-rhs-caller/caller.py", +) +PHYSICAL_BLOB = "6ac5e735691555ecafe2afbcff71edd923178113" +PHYSICAL_COPIES = ( + "research/p104-caller-independent-audit/capsule/outputs/p104-contact-reassessment-20261025/sources/predecessor/caller.py", + "research/p104-contact-independent-audit/capsule/outputs/p104-contact-reassessment-20261025/sources/predecessor/caller.py", + "research/p104-coupled-helper-bases/caller.py", + "research/p104-cut-stability/whole-caller/inputs/caller.py", + "research/p104-productive-controller/caller.py", +) + + +def need(ok, message): + if not ok: + raise SystemExit("FAIL: " + message) + + +def contains_bit_saving(text): + return "bit_saving" in text + + +def ordered(text, marks): + position = 0 + for mark in marks: + found = text.find(mark, position) + if found < 0: + return False + position = found + len(mark) + return True + + +def git_blob(revision, path): + raw = subprocess.check_output( + ["git", "-C", str(ROOT), "rev-parse", "--verify", revision + ":" + path], + stderr=subprocess.DEVNULL, + ) + return raw.decode("ascii").strip() + + +def git_text(revision, path): + raw = subprocess.check_output( + ["git", "-C", str(ROOT), "show", revision + ":" + path], + stderr=subprocess.DEVNULL, + ) + return raw.decode("utf-8") + + +def tree_paths(revision): + raw = subprocess.check_output( + ["git", "-C", str(ROOT), "ls-tree", "-r", "--name-only", revision], + stderr=subprocess.DEVNULL, + ) + return raw.decode("utf-8").splitlines() + + +def argument_names(function): + names = [item.arg for item in function.args.args] + names += [item.arg for item in function.args.posonlyargs] + names += [item.arg for item in function.args.kwonlyargs] + if function.args.vararg is not None: + names.append(function.args.vararg.arg) + if function.args.kwarg is not None: + names.append(function.args.kwarg.arg) + return names + + +def walk_keys(value, found): + if isinstance(value, dict): + for key, item in value.items(): + found.append(str(key)) + walk_keys(item, found) + elif isinstance(value, list): + for item in value: + walk_keys(item, found) + + +def main(): + task = json.loads(TASK.read_text(encoding="utf-8")) + base = task["base_commit"] + need(base == "7c49fe32c55de02c2c873655c804b16e4c3fef0a", "pinned base commit") + need(task["scope_status"] == "refined", "scope stays the caller question") + + listed = tuple(path for path in tree_paths(base) if path.rsplit("/", 1)[-1] == "caller.py") + need(listed == CALLER_PY, "caller.py census is the complete base-commit listing") + hits = [] + gaussian_files = [] + for path in listed: + text = git_text(base, path) + if contains_bit_saving(text): + hits.append(path) + if "Gaussian" in text or "gaussian" in text: + gaussian_files.append(path) + need(hits == [], "no caller.py blob at the base commit contains bit_saving") + need(tuple(gaussian_files) == GAUSSIAN_CALLER_PY, + "Gaussian caller.py census matches the pinned list") + need(all(git_blob(base, path) == PHYSICAL_BLOB for path in PHYSICAL_COPIES), + "five physical caller.py paths are one blob") + dual = git_text(base, "research/native-involutive-dual/caller.py") + boundary = git_text(base, "research/physical-boundary-rhs-caller/caller.py") + need("def physical(" not in dual and "def physical(" not in boundary, + "the other two Gaussian caller.py files do not define physical") + need("Real K commutes full Gaussian" in dual and "gaussian_supplier" in dual, + "native involutive caller is the commutation check") + need("from gaussian_page import Header, Cell, skip_bits" in boundary, + "boundary caller imports gaussian_page") + + caller_text = CALLER.read_text(encoding="utf-8") + need(caller_text == git_text(base, "research/p104-productive-controller/caller.py"), + "working caller.py matches the base blob") + need(not contains_bit_saving(caller_text), "named caller source has no bit_saving") + need(contains_bit_saving("def physical(word, local, bit_saving):"), + "scanner control sees an added bit_saving parameter") + for marker in GAUSSIAN_MARKERS: + need(caller_text.count(marker) == 1, "Gaussian marker once: " + marker) + + tree = ast.parse(caller_text) + functions = [node for node in tree.body if isinstance(node, ast.FunctionDef)] + need([node.name for node in functions] == ["replay", "construct", "physical", "controls"], + "caller.py function list") + all_args = [] + for node in ast.walk(tree): + if isinstance(node, ast.FunctionDef): + all_args.extend(argument_names(node)) + need("bit_saving" not in all_args, "no function argument is named bit_saving") + physical = functions[2] + need(argument_names(physical) == ["word", "local"], "physical parameters") + need(physical.args.defaults == [] and physical.args.kw_defaults == [], + "physical parameters have no hidden default") + returns = [stmt for stmt in physical.body if isinstance(stmt, ast.Return)] + need(len(returns) == 1 and isinstance(returns[0].value, ast.Dict), "one dict return") + return_keys = [] + for key in returns[0].value.keys: + need(isinstance(key, ast.Constant) and isinstance(key.value, str), "return keys are strings") + return_keys.append(key.value) + need("bit_saving" not in return_keys, "physical's return does not carry bit_saving") + need("whole_idle_jobs" in return_keys, "physical reports the idle Gaussian jobs") + + controller_raw = CONTROLLER.read_text(encoding="utf-8") + controller = json.loads(controller_raw) + keys = [] + walk_keys(controller, keys) + need("bit_saving" not in keys, "CONTROLLER.json has no bit_saving field") + need(str(C_VALUE.numerator) not in controller_raw, "recorded controller does not contain C") + + component = json.loads(COMPONENT.read_text(encoding="utf-8")) + admitted = Fraction(component["admitted"]) + need(admitted == C_VALUE, "recorded PR5679 component") + need(component["whole_kappa"] is None, "component is not a whole kappa") + need(str(C_VALUE.numerator) not in caller_text, "caller source does not contain C") + + assembly_verify = ASSEMBLY_VERIFY.read_text(encoding="utf-8") + call = ( + "C = load(root / 'research/p104-productive-controller/caller.py', 'base_caller')", + "caller = C.construct()", + "need(caller == read(root / 'research/p104-productive-controller/CONTROLLER.json'), 'Exact physical caller')", + "physical = C.physical(caller, word)", + "P = load(HERE / 'pricing.py', 'edit_price')", + "price = P.run(local, native, caller, physical)", + ) + need(ordered(assembly_verify, call), "selected verifier calls physical before pricing.run") + swapped = ( + "price = P.run(local, native, caller, physical)\n" + "physical = C.physical(caller, word)\n" + ) + need(not ordered(swapped, ("physical = C.physical(caller, word)", "price = P.run(local, native, caller, physical)")), + "order control rejects pricing before the caller") + + pricing = PRICING.read_text(encoding="utf-8") + need(pricing.count("def run(local,native,word,physical):") == 1, "pricing.run parameters") + need("bit_saving" not in pricing.split("def run", 1)[0], "pricing has no bit_saving before run") + need(pricing.count("'bit_saving':admitted") == 1, "assembly assigns bit_saving from admitted") + need(pricing.count("atom > ordinary > admitted > TESTED") == 1, "assembly stock gate") + need("def physical" not in pricing, "pricing.py does not define physical") + run_args = ast.parse(pricing) + run = next(node for node in run_args.body if isinstance(node, ast.FunctionDef) and node.name == "run") + need(argument_names(run) == ["local", "native", "word", "physical"], + "pricing.run does not take bit_saving") + + selected = json.loads(SELECTED.read_text(encoding="utf-8")) + need(selected["kappa"] == "781451/250000000", "selected frontier unchanged") + + receipt = { + "status": "PASS_GAUSSIAN_CALLER_OUTSIDE_PRICING", + "caller": "research/p104-productive-controller/caller.py:physical", + "parameters": ["word", "local"], + "bit_saving_input": None, + "named_caller_consumes_C": False, + "component": str(admitted), + "whole_kappa": None, + "selected_kappa": selected["kappa"], + "caller_py_files": len(listed), + "caller_py_bit_saving_hits": hits, + "gaussian_caller_py_files": gaussian_files, + "physical_return_keys": return_keys, + "controller_has_bit_saving": False, + "assembly_bit_saving_assignment": "'bit_saving':admitted", + "assembly_call_after_physical": True, + "physical_executed": False, + } + print("PASS_GAUSSIAN_CALLER_OUTSIDE_PRICING") + print(json.dumps(receipt, indent=2, sort_keys=True)) + + +if __name__ == "__main__": + main()