diff --git a/research/pr3934-pr3955-operator-replay/README.md b/research/pr3934-pr3955-operator-replay/README.md new file mode 100644 index 0000000000..c2a8205236 --- /dev/null +++ b/research/pr3934-pr3955-operator-replay/README.md @@ -0,0 +1,88 @@ +# The open PR3934 → PR3959 chain still uses PR3251's retracted idle-axis moves (no new κ) + +**Scoped negative result (audit). No new κ, no selected-frontier change.** + +The highest open κ claims, PR3934 (0.0017348), PR3939, PR3955, PR3958 and PR3959 (0.0017367), take +their complex root from PR3934's hosted receivers and PR3955's hosted frame selection. Both stack +on PR3251. Its author retracted PR3251, with PR3184, PR3190, PR3198 and PR3200, on 2026-10-18: +merged PR3296 and PR3311 show that these idle-axis moves change the exact eight-stream physical +operator. No comment on the open chain records this. + +This package binds that exact replay to the chain's literal MOVES files. + +## Result + +| Check | Result | +|---|---| +| PR3251 moves contained in PR3934 | all 435,604 | +| PR3296's port-0 witness (owner 0, axis 2^72, 14→8 and 15→10) | contained in PR3934 and PR3955 | +| PR3934's own new moves (all into hosted receivers), each replayed at its (owner, port) | 2,374 moves, 2,274 configurations, 140 owners: **all change the operator, none preserved** | +| PR3955 at owner replica 0, ports that donate only literal remainder axes | 55 of 112 ports: **all 55 change the operator**, port 0 included | +| PR3955 at owner replica 0, ports with reselected frames | 57 ports, not replayed (see scope) | + +So the complex roots of PR3934 (0.0017348652) and PR3955 (0.0017411726) are not supported by +their constructions. Without these moves, the chain's complex side falls back to PR3148 +(0.0017297775), which is then binding. The bit-side work of PR3647 and PR3959 is not affected by +this audit, but it cannot raise κ while the complex side binds lower. + +## Scope + +- Same contract as PR3296: the unchanged completed local-invocation contract, and the exact + operator at the moved-axis character. A changed character proves the configuration does not + preserve the operator. Repaired or rescheduled exchanges are not covered. +- PR3934's new moves are replayed **alone**, on the literal PR3148 hosting. In 920 of the 2,274 + configurations they are the only moves at their owner and port, so this is also their literal + configuration there. The other 1,354 also contain retracted PR3251 moves, which PR3296, PR3311 + and the PR3251 retraction reject separately. +- PR3296's census, which its author extended to all 740 owners in the PR3251 retraction comment, + already covers this class of single-axis transfers, hosted receivers included. What is new here + is the binding to the open chain's literal files. +- PR3955's frame selection lets hosted cells occupy "any" subset of a bin's frame, but does not + give the cell-to-axis map. For the 57 reselected ports the exact operator is therefore not + defined, and they are not replayed. The 55 identity-selection ports need no new assumption. +- Owner replicas other than 0 use PR3296's replay with only the owner index changed, as in the + PR3251 retraction. The scalar baseline does not test the owner index: the data events of another + replica also give it. The owner-0 witness reproduces PR3296's RESULT.json exactly. + +## Reproduce + +Standard library only, about 30 s: + +```sh +python3 -B research/pr3934-pr3955-operator-replay/verify.py +python3 scripts/research_package.py --package research/pr3934-pr3955-operator-replay --check-only +``` + +It prints `PASS_PR3934_PR3955_OPERATOR_REPLAY hosted_receiver_moves=2374 changed=2374 +pr3955_owner0_identity_ports=55 changed=55 no_new_kappa` and requires equality with `RESULT.json`. +Run locally on Windows: directly with Python 3.11.2, and through the registered replay with +Python 3.12.10 (`PASS_REGISTERED_RESEARCH_PACKAGE`, about 50 s). + +Inputs: `vendor/PR3251-MOVES.json.gz` and `vendor/PR3934-MOVES.json.gz` are byte-identical to +PR3934's head `74fb4dfa`, and `vendor/PR3955-MOVES.json.gz` to PR3955's head `38aaf88c` +(pins in `SOURCES.json`). PR3959's head `babd2e36` carries the same blobs. + +Controls: an axis outside the donor remainder and a self-move are rejected, and an empty overlay +preserves the operator. + +## Open next questions + +1. **Does any reselected PR3955 frame, with an explicit cell-to-axis map, preserve the operator?** + First step: state the map for one reselected port of owner replica 0 and replay it here. + Blocked by: PR3955 does not specify the map. +2. **What is the best κ claim that uses no PR3184–PR3251-type idle-axis moves?** First step: + check PR3945 (staged544, 0.0017306632) and PR3802 (0.0017305784) for such moves. Blocked by: + neither has independent review. + +Details are in `TASK.json`. + +## Credit + +Nick Petalas (PR3187) for the exact replay; Matarener (PR3296) for the remainder binding and +census; 1337isnot1337 (PR3311) for the independent audit; Rohan Arun (PR3184–PR3251, PR3934–PR3959) +for the audited constructions and the all-owner retraction census; Jeremy Diviney (PR3148) for the +fill; Gonzalo-Mier (PR1252) for the per-axis rule; Gareth Davidson (PR1387) for the original +physical-stream obstruction. PR3133's notice is retained through PR3187's vendor directory. + +Written and run by Claude (Anthropic) via Claude Code, in a session donated by Erwan. No human +or formal review is claimed. Apache-2.0. diff --git a/research/pr3934-pr3955-operator-replay/RESULT.json b/research/pr3934-pr3955-operator-replay/RESULT.json new file mode 100644 index 0000000000..463d967e02 --- /dev/null +++ b/research/pr3934-pr3955-operator-replay/RESULT.json @@ -0,0 +1,44 @@ +{ + "admitted": false, + "controls": { + "axis_not_in_donor_remainder": "rejected: PR3190 declared rule", + "empty_overlay_preserves_operator": "PASS", + "self_move": "rejected: PR3190 declared rule" + }, + "controls_owner_port": [ + 4, + 44 + ], + "inclusion": { + "pr3251_in_pr3934": 435604, + "pr3251_in_pr3955": 324038, + "pr3251_moves": 435604, + "pr3934_new_moves": 2374, + "witness_in_pr3934": true, + "witness_in_pr3955": true + }, + "new_kappa": false, + "owner0_port0_witness_entries": { + "72": 10 + }, + "pr3934_hosted_receivers": { + "changed_entries_histogram": { + "10": 100, + "3": 600, + "5": 1574 + }, + "configurations": 2274, + "moves": 2374, + "moves_into_hosted_receivers": 2374, + "owners": 140, + "preserved_configurations": [] + }, + "pr3955_owner0": { + "identity_ports_changed": 55, + "identity_selection_ports": 55, + "ports_with_moves": 112, + "reselected_ports_not_replayed": 57 + }, + "selected_frontier_changed": false, + "status": "PASS_PR3934_PR3955_OPERATOR_REPLAY" +} diff --git a/research/pr3934-pr3955-operator-replay/SOURCES.json b/research/pr3934-pr3955-operator-replay/SOURCES.json new file mode 100644 index 0000000000..83f1b5e2ee --- /dev/null +++ b/research/pr3934-pr3955-operator-replay/SOURCES.json @@ -0,0 +1,141 @@ +{ + "schema_version": 1, + "base_commit": "20ecf2891d80b5acf18d980b2164fb44ea7faa90", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "b1fea0c94436b236cc2b7d41a7be032811b94c81", + "sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "67f085acd86acd7d4e03922d9cf4b26bca66fed5", + "sha256": "47b42433f5a85809a3aadd29c2c339da2c6ed728e4f7762df6b88bccb7874cf0" + }, + { + "path": "research/adaptive-kernel-demotion/inputs/DATA-PHASES.json", + "usage": "input", + "git_blob": "d9a4f84211182ca200c081ea061d724c8a2cfb70", + "sha256": "c5916ff312678f12aba403847643fbbc29f643acec60bdf836fa56cd3e8251fa" + }, + { + "path": "research/pr3190-remainder-stream-obstruction/obstruction.py", + "usage": "input", + "git_blob": "c86f4687dc1ed5f07ab7be2407310f36104a19ab", + "sha256": "5b0d3cc33bd76aba359c2cf0ea24b08a9986c2f05ddcabc6b69ed5643d487ec9" + }, + { + "path": "research/pr3190-remainder-stream-obstruction/vendor/PR3190-MOVES.json.gz", + "usage": "input", + "git_blob": "e8401e6d138d9fcf9725530e7ae36d2db1386bda", + "sha256": "c76310bc9bdb7e693bdb8910e7ea084354251110a02ee629e3e8aad7418b695f" + }, + { + "path": "research/rank7-idle-star-stream-obstruction/SOURCES.json", + "usage": "input", + "git_blob": "a4bf03526b6ef83b656a7c4a9fcd04315350e9c7", + "sha256": "81b9048365550a7a0c33308ad60bcee98c9bdd6a566308572d9ef57501accfb4" + }, + { + "path": "research/rank7-idle-star-stream-obstruction/algebra.py", + "usage": "input", + "git_blob": "6a7ff3b2fd184428569e997261a4d00bbf993455", + "sha256": "ba1e12f72e8c1b0521b566bd2cb0fbf288ad2ae866cd574e3d7a4f8ee83d7554" + }, + { + "path": "research/rank7-idle-star-stream-obstruction/source.py", + "usage": "input", + "git_blob": "76ff8121ca6c8861f2c89f24f4f8c89957b50da3", + "sha256": "277c86537127ec53b2f0b5960274925986676b26826b37655b8f174c94512ee5" + }, + { + "path": "research/rank7-idle-star-stream-obstruction/vendor/BASE-FILL.json.gz", + "usage": "input", + "git_blob": "92b49b42b8f381d686a9fb8057e74e4b7548cd5c", + "sha256": "68b8bae90144248774b1920cd27f9519caa3dc427704d8a9da6d4c491d912fc4" + }, + { + "path": "research/rank7-idle-star-stream-obstruction/vendor/EXCHANGE.json", + "usage": "input", + "git_blob": "f323db0fd94a80f691b1606e813d0738b27058ae", + "sha256": "5063791f327d067f37478488c97ce449e5b34cfb61d6309fc6924c5e360fe839" + }, + { + "path": "research/rank7-idle-star-stream-obstruction/vendor/PR3133-CREDITS.md", + "usage": "input", + "git_blob": "24f00912d4ec829c3c8d2a8d086aa135664a124c", + "sha256": "1d9d8f56d8899f55878e4cb2c4e052b22506444016a51c2e678773505f5189e6" + }, + { + "path": "research/rank7-idle-star-stream-obstruction/vendor/PR3133-NOTICE", + "usage": "input", + "git_blob": "89c20926ea7f803718f751d95989d5a269908efd", + "sha256": "c9731c9cca25ede32c2a1b3aef6d5b249973cb2ed5fb2494407bdca598763661" + }, + { + "path": "research/rank7-idle-star-stream-obstruction/vendor/PROVIDERS.json", + "usage": "input", + "git_blob": "0b2343675099d0a9fe90da6e1f1e53f50235567e", + "sha256": "52eb0d85caa7b2d4a93acdf5011f52b793f61ddca86235fb03cd9a09397ad4cd" + }, + { + "path": "research/rank7-idle-star-stream-obstruction/vendor/STAR-MOVES.json.gz", + "usage": "input", + "git_blob": "ef209aa4a9c2c81d983ea58146a7cbd6770eda4c", + "sha256": "ea833cc374c16c4bed4da6328a77353171944d947bed1d28085212ffad786e90" + }, + { + "path": "research/rank7-joint-endframes/allocation/DISPATCH.json", + "usage": "input", + "git_blob": "9544fee4e6ee1f202cee22bfaeaf229ee3b2515e", + "sha256": "65e435bd68e97243c003677271b88485a29d4d0fae2dff1354100404a145e74c" + }, + { + "path": "research/rank7-joint-endframes/allocation/ORDER.json", + "usage": "input", + "git_blob": "7409c4df1092241729739596c7648bda504e6aad", + "sha256": "519d1d5dbb997a219fcfcad34c0b03e7838bef24199784d7e964fa10090f66e1" + }, + { + "path": "research/rank7-joint-endframes/allocation/vendor/PLAN.json.gz", + "usage": "input", + "git_blob": "7a1db55a4d53ee99280be4f3ab7d29f7b2033adf", + "sha256": "d566cfb87b71639d4138e1f89b543e2dd6a7772070226a2a14c799a6835bf21e" + }, + { + "path": "research/rank7-joint-endframes/allocation/vendor/TEMPLATE.json.gz", + "usage": "input", + "git_blob": "114808c32b1799da53524bdc25cea67efb60009e", + "sha256": "21297b20f1f2dc76eb9dd8124416068c3cb096bab9df17fa4da19bc68dfe082e" + }, + { + "path": "research/split-centres-global/proofs/INHERITED-COMPLEX-GEOMETRY.txt", + "usage": "input", + "git_blob": "c4150cb693414c098690eae79b3aea5f47c184ff", + "sha256": "c1ff55536594222a8d2a30bc0e0956959774e1be2d5420b7838ad553ee556df2" + }, + { + "path": "research/pr3934-pr3955-operator-replay/vendor/PR3251-MOVES.json.gz", + "usage": "input", + "git_blob": "d2b8831feb9dd56b5a92aee70401b97f779b1764", + "sha256": "ec9c11b924e4ab9de4f66cb42cc914fb7eb8c80c0f16f7a34d1dcf51f73ad52e", + "pin": "head:465cfe985c84f8ecfa47c6d91444df07b4e4baec:research/pr3934-pr3955-operator-replay/vendor/PR3251-MOVES.json.gz" + }, + { + "path": "research/pr3934-pr3955-operator-replay/vendor/PR3934-MOVES.json.gz", + "usage": "input", + "git_blob": "a42281c813a4408ba471edc193d71ee7c32690b2", + "sha256": "173c83d34d4922584da0a8acdb429c29e0ad3e4a7960fb4de05bfec4848c9249", + "pin": "head:465cfe985c84f8ecfa47c6d91444df07b4e4baec:research/pr3934-pr3955-operator-replay/vendor/PR3934-MOVES.json.gz" + }, + { + "path": "research/pr3934-pr3955-operator-replay/vendor/PR3955-MOVES.json.gz", + "usage": "input", + "git_blob": "6cef92eb88ea0cfe827031592a78bc891bd9ea59", + "sha256": "01e8417b90783f707cd18871be7c615eb9162f356460f07963b5198522aa692b", + "pin": "head:465cfe985c84f8ecfa47c6d91444df07b4e4baec:research/pr3934-pr3955-operator-replay/vendor/PR3955-MOVES.json.gz" + } + ] +} diff --git a/research/pr3934-pr3955-operator-replay/TASK.json b/research/pr3934-pr3955-operator-replay/TASK.json new file mode 100644 index 0000000000..c59d3f9d1a --- /dev/null +++ b/research/pr3934-pr3955-operator-replay/TASK.json @@ -0,0 +1,72 @@ +{ + "schema_version": 1, + "task_id": "independent-moment", + "priority_revision": 6, + "base_commit": "20ecf2891d80b5acf18d980b2164fb44ea7faa90", + "original_card": { + "id": "independent-moment", + "question": "Does one changed supplier or assembly claim lack a source-bound independent check of a specific new implication?", + "starting_points": [ + "certificates/selected-result.json", + "research/rank7-joint-endframes/README.md", + "docs/research/research-family-status.md" + ], + "methods": [ + "Independently reconstruct a coordinated frame/circuit change and its single-change control, then derive the complete rank and physical ledger.", + "Implement certified moment inequalities through a different exact enclosure method." + ], + "acceptance_gate": "Demonstrate independence, source binding, positive cases and semantic failure controls. Name the existing checks and the missing coverage. More digits or another equivalent evaluation of an unchanged root is not by itself new verification coverage.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read #2979 joint rank-7 end-frame proposal and the revision-6 evidence status. Its claimed kappa is not selected. Compare coordinated changes with the losing single-change controls and locate the complete physical ledger; an aggregate moment alone does not validate the mechanism.", + "scope": "Positive control / source-bound orientation only; this is not a new construction or full cold replay." + }, + "first_experiment": "Prioritize a bounded independent audit of #2979: reconstruct one joint group and its single-lowering control, check the declared frames/chronology, then trace changed children, idle widths and cleanup buffers into the complete invoice and both supplier caps. Choose one still-missing implication after checking existing audits. Stop with exact unresolved dependencies if full admission exceeds the session; do not launch a new lowering census on an unvalidated premise or substitute extra root digits for mechanism checking.", + "bottleneck_link": "Independent pricing prevents unsupported frontier claims and can reveal genuine accounting slack.", + "allowed_variations": [ + "Reconstruct either a source ledger or a numeric enclosure with a different method." + ], + "scope_change_triggers": [ + "Importing the primary function and calling its output independent verification.", + "Promoting #2979 from merged source archive to validated supplier solely from author PASS receipts or aggregate pricing." + ], + "overlap_terms": [ + "independent moment", + "rank histogram", + "exact enclosure", + "2979", + "rank7 joint endframes", + "paired extraction", + "joint lowering" + ] + }, + "scope_status": "changed", + "actual_scope": "Do the open candidates PR3934 (hosted receivers) and PR3955 (hosted frame selection), whose complex root PR3939, PR3958 and PR3959 reuse, preserve the exact eight-stream physical operator with their literal MOVES files?", + "scope_change_reason": "The highest open kappa claims (PR3934 to PR3959, up to 0.0017367) stack on PR3251, which its author retracted on 2026-10-18 after PR3296/PR3311. No comment on the open chain records this. Binding the existing exact replay to their literal moves is the missing check before anyone builds on them.", + "bottleneck_link": "Every kappa gain of PR3934-PR3959 over PR3148 on the complex side comes from idle-axis moves. If those moves change the physical operator, the claims are not supported and the complex side falls back to PR3148 (about 0.0017298).", + "budget_minutes": 90, + "stop_rule": "Stop at literal, source-bound replays of the vendored moves and the owner-0 frame-selection ports that need no new assumption; do not attempt repairs, a new construction or the reselected ports.", + "outcome": "negative-result", + "evidence": "verify.py: PR3934 contains all 435,604 moves of the retracted PR3251; PR3934 and PR3955 contain PR3296's witness moves (0,0,14->8 and 15->10, axis 2^72). Each of PR3934's 2,374 new moves, all into hosted receivers, changes the exact operator at its own (owner, port): 2,274 configurations over 140 owner replicas, none preserved; in 920 of them these are the only moves at that owner and port. At owner replica 0, 55 of PR3955's 112 ports donate only literal remainder axes (identity selection); all 55 change the operator, including port 0. The other 57 ports use reselected frames whose cell-to-axis map PR3955 does not state, so they are not replayed.", + "author": "Claude (AI), session donated by Erwan", + "ai_assistance": "Written and run by Claude (Anthropic) via Claude Code in a session donated by Erwan. Reuses PR3187 and PR3296 checker code unchanged; only the owner-replica index is new. No independent human review.", + "open_questions": [ + { + "question": "Does any reselected PR3955 frame, with an explicit cell-to-axis map, preserve the exact operator?", + "why_it_matters": "Frame selection is the only part of the PR3955 complex root not covered by a literal replay here; without a map the operator is not defined.", + "first_step": "State the hosted cell-to-axis map for one reselected port of owner replica 0 and replay it with this verifier.", + "blocked_by": "PR3955 does not specify the map; every single-axis transfer already fails at all 740 owners (PR3251 retraction comment)." + }, + { + "question": "What is the best kappa claim that does not use PR3184-PR3251-type idle-axis moves?", + "why_it_matters": "The open chain PR3934-PR3959 currently heads the claimed values; the uncontaminated frontier is lower.", + "first_step": "Check PR3945 (staged544, 0.0017306632) and PR3802 (0.0017305784) for any dependence on idle-axis moves.", + "blocked_by": "Neither has independent review." + } + ] +} diff --git a/research/pr3934-pr3955-operator-replay/VERIFY.json b/research/pr3934-pr3955-operator-replay/VERIFY.json new file mode 100644 index 0000000000..14fe687fdf --- /dev/null +++ b/research/pr3934-pr3955-operator-replay/VERIFY.json @@ -0,0 +1,39 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/adaptive-kernel-demotion/inputs/DATA-PHASES.json", + "research/pr3190-remainder-stream-obstruction/obstruction.py", + "research/pr3190-remainder-stream-obstruction/vendor/PR3190-MOVES.json.gz", + "research/pr3934-pr3955-operator-replay/vendor/PR3251-MOVES.json.gz", + "research/pr3934-pr3955-operator-replay/vendor/PR3934-MOVES.json.gz", + "research/pr3934-pr3955-operator-replay/vendor/PR3955-MOVES.json.gz", + "research/rank7-idle-star-stream-obstruction/SOURCES.json", + "research/rank7-idle-star-stream-obstruction/algebra.py", + "research/rank7-idle-star-stream-obstruction/source.py", + "research/rank7-idle-star-stream-obstruction/vendor/BASE-FILL.json.gz", + "research/rank7-idle-star-stream-obstruction/vendor/EXCHANGE.json", + "research/rank7-idle-star-stream-obstruction/vendor/PR3133-CREDITS.md", + "research/rank7-idle-star-stream-obstruction/vendor/PR3133-NOTICE", + "research/rank7-idle-star-stream-obstruction/vendor/PROVIDERS.json", + "research/rank7-idle-star-stream-obstruction/vendor/STAR-MOVES.json.gz", + "research/rank7-joint-endframes/allocation/DISPATCH.json", + "research/rank7-joint-endframes/allocation/ORDER.json", + "research/rank7-joint-endframes/allocation/vendor/PLAN.json.gz", + "research/rank7-joint-endframes/allocation/vendor/TEMPLATE.json.gz", + "research/split-centres-global/proofs/INHERITED-COMPLEX-GEOMETRY.txt" + ], + "commands": [ + { + "argv": [ + "{python}", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 600, + "checks": "pinned PR3251/PR3934/PR3955 MOVES; PR3251 moves and PR3296 witness contained in the open chain; owner-0 port-0 witness reproduces PR3296 (10 entries at 2^72); each of PR3934's 2,374 hosted-receiver moves changes the exact operator at its own owner replica and port; every identity-selection PR3955 port of owner replica 0 changes it; empty-overlay, foreign-axis and self-move controls; equality with RESULT.json" + } + ] +} diff --git a/research/pr3934-pr3955-operator-replay/vendor/PR3251-MOVES.json.gz b/research/pr3934-pr3955-operator-replay/vendor/PR3251-MOVES.json.gz new file mode 100644 index 0000000000..d2b8831feb Binary files /dev/null and b/research/pr3934-pr3955-operator-replay/vendor/PR3251-MOVES.json.gz differ diff --git a/research/pr3934-pr3955-operator-replay/vendor/PR3934-MOVES.json.gz b/research/pr3934-pr3955-operator-replay/vendor/PR3934-MOVES.json.gz new file mode 100644 index 0000000000..a42281c813 Binary files /dev/null and b/research/pr3934-pr3955-operator-replay/vendor/PR3934-MOVES.json.gz differ diff --git a/research/pr3934-pr3955-operator-replay/vendor/PR3955-MOVES.json.gz b/research/pr3934-pr3955-operator-replay/vendor/PR3955-MOVES.json.gz new file mode 100644 index 0000000000..6cef92eb88 Binary files /dev/null and b/research/pr3934-pr3955-operator-replay/vendor/PR3955-MOVES.json.gz differ diff --git a/research/pr3934-pr3955-operator-replay/verify.py b/research/pr3934-pr3955-operator-replay/verify.py new file mode 100644 index 0000000000..132cb96afa --- /dev/null +++ b/research/pr3934-pr3955-operator-replay/verify.py @@ -0,0 +1,190 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +"""Replay PR3934's and PR3955's literal idle-axis moves with PR3187's exact eight-stream operator. + +PR3934 (hosted receivers) and PR3955 (hosted frame selection) supply the complex root used by +PR3939, PR3958 and PR3959. This verifier checks: + +1. inclusion: every move of the retracted PR3251 is in PR3934, and PR3934 and PR3955 both contain + PR3296's port-0 witness moves; +2. hosted receivers: each of PR3934's 2,374 moves outside PR3251, applied alone at its own + (owner replica, port), changes the exact operator at its moved-axis character; +3. frame selection: at owner replica 0, every PR3955 port whose donated axes all lie in the literal + remainders (identity selection) changes the exact operator; other ports are counted, not replayed. + +The operator model, fill authentication and data events are PR3187's (Nick Petalas) and the per-port +projection, remainders and declared rule are PR3296's (Matarener), imported unchanged. The only new +code path is the owner-replica index, which PR3296 fixes at 0. + +--write regenerates RESULT.json instead of comparing with it. +""" +import argparse +import gzip +import hashlib +import json +import sys +from collections import Counter, defaultdict +from pathlib import Path + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE.parent / "pr3190-remainder-stream-obstruction")) +sys.path.insert(0, str(HERE.parent / "rank7-idle-star-stream-obstruction")) +import obstruction as O # noqa: E402 + +S, A = O.S, O.A +COLUMNS = ["replica", "port", "donor_child", "receiver_child", "axis"] +PINS = { + "PR3251": ("ec9c11b924e4ab9de4f66cb42cc914fb7eb8c80c0f16f7a34d1dcf51f73ad52e", 435604), + "PR3934": ("173c83d34d4922584da0a8acdb429c29e0ad3e4a7960fb4de05bfec4848c9249", 437978), + "PR3955": ("01e8417b90783f707cd18871be7c615eb9162f356460f07963b5198522aa692b", 521798), +} +WITNESS = [(0, 0, 14, 8, O.AXIS72), (0, 0, 15, 10, O.AXIS72)] + + +def load(name): + raw = S.read_bytes(HERE / "vendor" / (name + "-MOVES.json.gz")) + sha, count = PINS[name] + S.require(hashlib.sha256(raw).hexdigest() == sha, name + " MOVES pin") + data = json.loads(gzip.decompress(raw)) + S.require(data["columns"] == COLUMNS and len(data["moves"]) == count, name + " MOVES shape") + return [(r, p, d, c, int(a)) for r, p, d, c, a in data["moves"]] + + +def owner_rows(owners): + """PR3296's fill projection, for a set of owner replicas instead of owner 0 only.""" + vendor = S.PACKAGE / "vendor" + base = S.decode(S.read_bytes(vendor / "BASE-FILL.json.gz"))["rows"] + edits = S.journal_edits(base, S.decode(S.read_bytes(vendor / "EXCHANGE.json"))) + rows = defaultdict(list) + for index in range(S.TOTAL_ROWS): + row = edits[index] if index in edits else S.lifted_row(base, index) + if row[2] in owners: + rows[row[2], row[4]].append(row) + return rows + + +def replay(ctx, blocks, hosts, residual, character, owner): + """O.replay with the owner's own data events instead of replica 0's.""" + matrix = A.identity() + for time, (stage, replica) in enumerate(ctx["order"]): + for stream, axes in hosts.get(time, ()): + A.phase(matrix, stream, sum(A.dot(character, v) for v in axes)) + if replica == owner: + for event in blocks[stage]: + A.data_event(matrix, event, ctx, residual, character) + return matrix + + +def changed_entries(ctx, blocks, moves, owner): + residual, hosts = O.residual_and_hosts(ctx) + final = O.apply_moves(ctx["recipe"], residual, moves) + out = {} + for character in sorted({axis for _, _, axis in moves}): + before = replay(ctx, blocks, hosts, residual, character, owner) + S.require(before == O.scalar(character), "baseline equals the scalar operator") + out[character.bit_length() - 1] = len(O.diff(before, replay(ctx, blocks, hosts, final, character, owner))) + return out, residual, hosts + + +def rejected(f): + try: + f() + except ValueError as error: + return "rejected: " + str(error) + raise AssertionError("control accepted") + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--write", action="store_true") + args = parser.parse_args() + pr3251, pr3934, pr3955 = load("PR3251"), load("PR3934"), load("PR3955") + set3251, set3934, set3955 = set(pr3251), set(pr3934), set(pr3955) + new3934 = [m for m in pr3934 if m not in set3251] + S.require(set3251 <= set3934, "PR3934 contains every PR3251 move") + S.require(all(m in set3934 and m in set3955 for m in WITNESS), "PR3934 and PR3955 contain PR3296's witness") + inclusion = dict(pr3251_moves=len(pr3251), pr3251_in_pr3934=len(set3251 & set3934), pr3934_new_moves=len(new3934), + pr3251_in_pr3955=len(set3251 & set3955), witness_in_pr3934=True, witness_in_pr3955=True) + + ctx0, rows0, recipes = O.contexts() + blocks = A.stage_blocks(ctx0["template"]) + groups = defaultdict(list) + for owner, port, donor, receiver, axis in new3934: + groups[owner, port].append((donor, receiver, axis)) + rows = owner_rows({owner for owner, _ in groups}) + + def context(owner, port): + return dict(ctx0, rows=rows0[port] if owner == 0 else rows[owner, port], recipe=recipes[port]) + + # Positive control of the owner generalization: PR3296's port-0 witness. + witness, _, _ = changed_entries(context(0, 0), blocks, [m[2:] for m in WITNESS], 0) + S.require(witness == {72: 10}, "owner-0 port-0 witness equals PR3296 RESULT.json (10 entries at 2^72)") + + hosted_receivers, entries, per_owner, preserved = 0, Counter(), Counter(), [] + first = None + for (owner, port), moves in sorted(groups.items()): + ctx = context(owner, port) + result, residual, hosts = changed_entries(ctx, blocks, moves, owner) + full = [len(e["orthogonal_axes"]) for e in ctx["recipe"]["idle_children"]] + hosted_receivers += sum(len(residual[r]) < full[r] for _, r, _ in moves) + entries.update(result.values()) + per_owner[owner] += len(moves) + if not all(result.values()): + preserved.append([owner, port]) + if first is None: + first = (owner, port, ctx, moves, residual, hosts) + S.require(sum(per_owner.values()) == len(new3934), "every new PR3934 move replayed") + S.require(not preserved, "every new PR3934 move changes the exact operator") + + # Controls on the first non-zero-owner configuration. The scalar baseline does not depend on the owner + # index (replaying another replica's data events also gives it), so it is not used as an owner control. + owner, port, ctx, moves, residual, hosts = first + character = moves[0][2] + before = replay(ctx, blocks, hosts, residual, character, owner) + controls = dict( + empty_overlay_preserves_operator="PASS" if replay( + ctx, blocks, hosts, O.apply_moves(ctx["recipe"], residual, []), character, owner) == before else "FAIL", + axis_not_in_donor_remainder=rejected(lambda: O.apply_moves( + ctx["recipe"], residual, [(moves[0][0], moves[0][1], 1 << 200)])), + self_move=rejected(lambda: O.apply_moves(ctx["recipe"], residual, [(moves[0][0], moves[0][0], character)])), + ) + S.require(owner != 0 and all(v != "FAIL" for v in controls.values()), "controls") + + # PR3955 at owner replica 0. + by_port = defaultdict(list) + for owner0, port0, donor, receiver, axis in pr3955: + if owner0 == 0: + by_port[port0].append((donor, receiver, axis)) + identity, reselected, unchanged = [], [], [] + for port0, moves0 in sorted(by_port.items()): + ctx = context(0, port0) + residual, _ = O.residual_and_hosts(ctx) + if not all(axis in residual[donor] for donor, _, axis in moves0): + reselected.append(port0) + continue + identity.append(port0) + result, _, _ = changed_entries(ctx, blocks, moves0, 0) + if not all(result.values()): + unchanged.append(port0) + S.require(not unchanged, "every identity-selection PR3955 port changes the exact operator") + + got = dict( + status="PASS_PR3934_PR3955_OPERATOR_REPLAY", admitted=False, selected_frontier_changed=False, new_kappa=False, + inclusion=inclusion, owner0_port0_witness_entries={"72": 10}, + pr3934_hosted_receivers=dict(moves=len(new3934), configurations=len(groups), owners=len(per_owner), + moves_into_hosted_receivers=hosted_receivers, preserved_configurations=preserved, + changed_entries_histogram={str(k): v for k, v in sorted(entries.items())}), + controls=controls, controls_owner_port=[owner, port], + pr3955_owner0=dict(ports_with_moves=len(by_port), identity_selection_ports=len(identity), + identity_ports_changed=len(identity) - len(unchanged), reselected_ports_not_replayed=len(reselected)), + ) + path = HERE / "RESULT.json" + if args.write: + path.write_text(json.dumps(got, indent=1, sort_keys=True) + "\n", encoding="utf-8", newline="\n") + S.require(json.loads(json.dumps(got)) == json.loads(path.read_text(encoding="utf-8")), "recomputed result differs from RESULT.json") + print("PASS_PR3934_PR3955_OPERATOR_REPLAY hosted_receiver_moves=%d changed=%d pr3955_owner0_identity_ports=%d changed=%d no_new_kappa" + % (len(new3934), len(new3934), len(identity), len(identity) - len(unchanged))) + + +if __name__ == "__main__": + main()