diff --git a/research/r437-replica-indexed-emission/.gitattributes b/research/r437-replica-indexed-emission/.gitattributes new file mode 100644 index 0000000000..df894ce1b8 --- /dev/null +++ b/research/r437-replica-indexed-emission/.gitattributes @@ -0,0 +1 @@ +UPSTREAM-NOTICE.md -text -whitespace diff --git a/research/r437-replica-indexed-emission/PREDECESSORS.json b/research/r437-replica-indexed-emission/PREDECESSORS.json new file mode 100644 index 0000000000..86c87df724 --- /dev/null +++ b/research/r437-replica-indexed-emission/PREDECESSORS.json @@ -0,0 +1,46 @@ +{ + "files": [ + { + "local": "inputs/template.json.gz", + "head": "babd2e36471422cd3e97f912a5cf2846da52a222", + "path": "research/rank7-pooled-r437-bit/R437-GLOBAL-TEMPLATE.json.gz", + "git_blob": "f56efc7ca3648d2070b791d4551a3d77dd7fdde4", + "sha256": "6e03c76f5a4227394ea57e901eb7e93f4d1ee411ccfecd483fd44ea043550494" + }, + { + "local": "inputs/moves.json", + "head": "babd2e36471422cd3e97f912a5cf2846da52a222", + "path": "research/rank7-pooled-r437-bit/POOL-MOVES.json", + "git_blob": "2cdb414a38cff6f0b872445f0980f2e3bc1895eb", + "sha256": "0a58b239795d213743b5654c59a3e4622a0ddd4a53d8dba3fa30dedef4558dff" + }, + { + "local": "inputs/emit_k.py", + "head": "a24f9ff95c12fd0b6792e3f710569237efd72db2", + "path": "research/bit-p111-r437-gl464-470-20261018/vendor/emit_k.py", + "git_blob": "bd8156a726c848cdcdf1e4893ba1fbcc3364946e", + "sha256": "a476e0df8aebfe0412989a24e0502b2a29b80b6f7a5088b0ccd59e7d087becd3" + }, + { + "local": "inputs/audit_hosted_k.py", + "head": "a24f9ff95c12fd0b6792e3f710569237efd72db2", + "path": "research/bit-p111-r437-gl464-470-20261018/vendor/audit_hosted_k.py", + "git_blob": "d8ec96cc42b82c0cdb81deeef1500d41836082b6", + "sha256": "9170e70c3f377bacc30e52d1e964bce61cc146d6f5ade5df4e00886d7f9fb0d5" + }, + { + "local": "inputs/catalogue.py", + "head": "20ecf2891d80b5acf18d980b2164fb44ea7faa90", + "path": "research/selected-bit-node/catalogue.py", + "git_blob": "0efc0575a7623ac41c094d2e8772beda5a9fdc29", + "sha256": "83ea88f82d4a83c5f889774bfe3519b7ebaa24b6a0e2a969dafff012107a89bf" + }, + { + "local": "UPSTREAM-NOTICE.md", + "head": "a24f9ff95c12fd0b6792e3f710569237efd72db2", + "path": "research/bit-p111-r437-gl464-470-20261018/UPSTREAM-NOTICE.md", + "git_blob": "9b519b904d456b0b5861f7469a66c365e77799a6", + "sha256": "8ed83f2f0bde43a41e44279f44d29efaeae3df44850b86f0e3578edf3ee104e4" + } + ] +} diff --git a/research/r437-replica-indexed-emission/PROOF.md b/research/r437-replica-indexed-emission/PROOF.md new file mode 100644 index 0000000000..0bda02582f --- /dev/null +++ b/research/r437-replica-indexed-emission/PROOF.md @@ -0,0 +1,108 @@ +# Replica-indexed emission boundary + +This is a finite IR compilation result and a conditional transport lemma. It is +not a physical CALL/RETURN implementation or an all-size multiplication theorem. +All sources are bound in PREDECESSORS.json. New analysis by Chris R / Clear1nsight +with substantial OpenAI Codex assistance, Apache-2.0. + +## The first literal obstruction + +PR #3959's first move changes stage 6, caller replica 1, helper 421 (local role +643) from absolute family 1097, child 6, offset 0, width 8 to absolute family +209, child 6, offset 16, width 8. The source call is calls[193]. The unchanged +replica-0 helper 421 owner is family 209, child 6, offset 0, width 8. + +The selected-bit-node Catalogue._bind guard demands identical routes and +family = replica0_family + 888*replica. Therefore the new family 209 fails the +expected 1097 and its offset 16 fails offset 0. This does not depend on runtime +values, q, precision, or helper initialization. The verifier executes the +retained AST guard, adapting only 661 to 659 exactly as PR #3967 does, and obtains +`replica owner symmetry`. It also checks the unmodified R437 positive control. + +Deleting that assertion would be unsound. The same catalogue builds only the +replica-0 requests and multiplies their rank histogram by 32; its semantic key +has no replica component. The pooled profile has 400877 rank 2 residuals and 1 rank 14 +residual, which cannot be represented by such a 32-fold histogram. Topology's +idle_family also adds888*replica to one representative request. Thus both the +local-owner domain and physical idle request domain must become replica aware. +This is a limitation of that compressed interface, not a refutation of pooling. + +## A completed absolute-owner IR adapter + +The new compiler applies each move to exactly one(stage,replica,helper) key and +checks its full old owner record before replacement. No input word, schedule or +move is regenerated. It validates 125856 final helper roles: stage membership in +the destination window; destination family in the inactive pair; width 8 and +coordinate extent; and disjoint occupancy keyed by(child,absolute family). +The source's schedule touches all replicas of each active pair in phase order, +so a window of an inactive pair remains valid for a different caller replica. + +Idle records are constructed for each(child,replica,copy), subtracting the +actual occupied prefix from its capacity. These are an explicit replica-indexed +IR invoice; they are not objects accepted by the old physical Catalogue. +The exact delta is the credited PR #3959 delta +{2:+13,6:-1,14:+1,26:-32,42:+19}. The number of paid requests 903456, rank mass +1808352 and maximum child 42 are retained. The halving test2*42^2<64^2 still +holds. All fallback and inherited preparation/native costs remain additional. + +The final stream block of retained R437 emit_k.py already reads absolute owners. +We execute that block unchanged on the overlaid calls. It serializes every local +instruction with its literal absolute target/source owner, or the inherited +private centre when the source is the private output. The independently retained +audit_hosted_k.digest function agrees on the complete ordered stream digest and +7814016 event count. Both are predecessor algorithms, not an independent compiler +written for this package. RESULT.json records the number of changed events and +the new digest. The old source stream's digest cannot authenticate the new stream. + +## Conditional uniform transport lemma + +Let A be any set of coordinate values and I a finite logical register set. Let +j:I→J be an injection into a physical coordinate set, and let E_j identify the +logical values with the coordinates j(I), leaving the complement fixed. For any +local map P:A^I→A^I define its transported map by + + P^j(x)|j(I) = j_* P(j^*x), P^j(x)|J\j(I) = x|J\j(I). + +Then(PQ)^j=P^j Q^j, the identity transports to the identity, and if P is a +permutation then(P^-1)^j=(P^j)^-1. These follow by substituting the restriction +and extension formulas; no value distribution or zero helper hypothesis occurs. +If a local word restores a subset D of dirty logical registers for every input, +its transport restores j(D) for every physical input. Composition preserves this +statement while each call's owner injection is valid and the promised frames +and untouched windows are respected. + +For the verified owner IR, active data roles lie in the active pair; hosted roles +lie in inactive pairs and occupy disjoint width 8 cells; the private stream uses +the inherited separate centre. Thus the role-to-slot map is injective at every +local invocation. The lemma proves uniform *abstract slot transport*, conditional +on the inherited local word and the charts identifying those slots. It does not +prove that source access, chart preparation or address routing is free. PR #3980's +unpooled chart-unit and key-separation result does not by itself cover this new +request domain. A chart matrix may change when a move changes the physical port +or pending axes; the new native catalogue must bind that actual chart. + +The transport lemma is the categorical composition law for products of register +sets. The occupancy certificate is a network allocation with demands at logical +helpers and capacities at absolute host cells. The pair is useful because it +separates validity of an allocation from functorial compilation and from the +remaining physical realization, without assigning a zero cost to either join. + +## Complete scoped obligation ledger + +| Obligation | Status | Evidence or remaining work | +|---|---|---| +| Pinned63-move ownership and untouched windows | proved finite | All 125856 roles and destination capacities checked | +| Absolute-address local IR emission | proved finite | Two retained encoders;7814016 events; exact digest | +| Replica-indexed idle IR invoice | proved finite | Every absolute child/family prefix; exact profile | +| Uniform arbitrary-value/dirty-state slot transport | proved conditional lemma | Product-set injection and composition proof above | +| Old compressed physical catalogue compatibility | rejected | First actual move and non32-divisible histogram | +| Replica-aware native source identifiers and chart keys | unknown | Must include actual caller/owner information | +| Whole native forward/backward residual execution | unknown | No production constructors or residual body executed | +| Physical CALL/RETURN, source reads and consumers | unknown | No pooled physical gate or returned payload executed | +| Address routing, stock, parking, restoration, visited cells | unknown | No free renaming/SWAP assumption and no new upper bound | +| All-size, SOURCE, correlated hosting, field/cover and precision joins | inherited unknown | Not discharged by this finite package | +| Full dual-supplier κ improvement/admission | unknown | No new numeric claim; selected record unchanged | + +The bounded next decision is one actual cross-replica source code and physical +CALL/RETURN with its complete accounting. Repeating a controlled unpooled payload +or re-pooling the same63 moves would not discharge it. diff --git a/research/r437-replica-indexed-emission/README.md b/research/r437-replica-indexed-emission/README.md new file mode 100644 index 0000000000..9a657c2461 --- /dev/null +++ b/research/r437-replica-indexed-emission/README.md @@ -0,0 +1,71 @@ +# R437 replica-indexed emission and the physical catalogue boundary + +**Partial result: complete finite local-IR emission; physical CALL/RETURN open.** + +The first cross-replica move in Rohan Arun's PR #3959 cannot enter the retained +physical catalogue: stage 6/replica 1/helper 421 changes family 1097/offset 0 to +family 209/offset 16, violating the catalogue's exact replica symmetry. We execute +the actual retained guard to establish this, and supply a bounded absolute-owner +IR adapter for all 63 proposed moves. The retained emitter and its separate +retained audit encoder agree on all 7814016 events. All 125856 hosted roles and the +replica-indexed idle invoice are checked. See RESULT.json for the changed-event +count and new stream digest, and PROOF.md for the exact source boundary, +arbitrary-value/dirty-state transport lemma and complete obligation ledger. + +This adds an executable emitted-IR binding beyond PR #3959's static map. It does +not implement a replica-aware physical catalogue, run a pooled native body or +claim a new κ. The existing PR #3967 physical adapter and PR #3980 owner-chart proof +are explicitly unpooled. Their results remain credited and outside this result. + +## Reproduction and pins + +`python3 -B scripts/research_package.py --package research/r437-replica-indexed-emission` + +The replay is standard-library-only, read-only and Git-free when exported. Five +retained computation inputs plus the source notice are self-contained, byte-pinned in PREDECESSORS.json and +checked against their original Git objects before publication. Template content +must also match the source digest in POOL-MOVES. Repository-level provenance is recorded in SOURCES.json. No native rebuild, whole historical +replay, Lean, external solver or network is needed. Six negative controls reject +stale owner, wrong replica, overlap, extent, pair and duplicate-key changes. + +## Scope, overlap and expansion decision + +Main20ecf2891d80b5acf18d980b2164fb44ea7faa90, priority revision6. Explicit donor +assignment refines supplier-boundary-audit. The parent session checked 679 live +open PR bodies and current active/handoff discussions on 2026-10-19, then added +PR #3980/3982/3983 deltas. Broader Discussion, closed and private coverage is partial. +Live predecessor heads were checked:3959 babd2e36471422cd3e97f912a5cf2846da52a222; +3967 32af060614fefa9729c86370524c2e72265acd76; +3647 a24f9ff95c12fd0b6792e3f710569237efd72db2. The canonical scoped claim is on PR #3959. The local overlap helper examined 2492 records at 08:09 UTC with no usable remote cache; the parent live snapshot supplies the open-PR coverage. Canonical main was fetched again at the publication checkpoint and remained unchanged. + +Narrow to one physical refinement boundary. Stop after the bounded emitted-IR +certificate and literal factorization counterexample; do not run a larger +packing search or infer a selected-frontier change. The primary field is +reversible compiler refinement, paired with network capacity allocation and +compositional register transport. This is a mathematical pairing of distinct +obligations, not an independent human review. + +## Open next questions + +TASK.json records the scoped next questions. First, compile the actual +stage 6/replica 1/helper 421 source and native chart with replica-indexed semantics, +then execute its physical return and consumers with the complete bill. Only +after that join can the full pooled supplier's inherited obligations and both +supplier budgets support an admitted κ claim. Unknown physical routing, +preparation, scratch, precision or restoration costs are not zero. + +## Credit and license + +Rohan Arun, PR #3959/3958/3939, supplies the 63 moves, pooled profile and conditional +endpoint; this package claims none of that packing novelty. ai-nanachi, PR #3647, +supplies R437/OQ4 and its retained emitters. Credit Ali Romman/1043, +Sagar Thakrar/3700/2423/1023, mightyOil/1281, DaysSky/442, chafreaky/444, +DreamingOfClouds/510 and the e8-bit-p111 adaptations. Preserve eumemic, +545/543/555, Dylan Crow and the upstream lineage. The physical catalogue and +adapter lineage includes zxv/3690, David Arias/2753, Jose Manuel/jmbarrancoml +2809/2899/2915/3562, ywz65/2635, Nick Petalas/2808, alephnan, Adam Gall and +Ross Richardson; PR #3967 and PR #3980 are immediate unpooled predecessors. + +New code, proof and writing by Chris R / Clear1nsight with substantial OpenAI +Codex assistance. Apache-2.0; retained source headers and notices are preserved. +Passing replay is a finite certificate, not formal-kernel or human acceptance. diff --git a/research/r437-replica-indexed-emission/RESULT.json b/research/r437-replica-indexed-emission/RESULT.json new file mode 100644 index 0000000000..866ce8ce28 --- /dev/null +++ b/research/r437-replica-indexed-emission/RESULT.json @@ -0,0 +1,57 @@ +{ + "status": "PASS_REPLICA_INDEXED_IR_NOT_PHYSICAL_EXECUTION", + "moves": 63, + "cross_replica_moves": 62, + "logical_helpers": 125856, + "local_events": 7814016, + "changed_local_events": 2265, + "pooled_emitted_program_sha256": "68d691118d9ac43f79a35cd2d6662a8257e68eddfc6a0fd79524ca15145c775e", + "profile": { + "1": 380160, + "2": 400877, + "3": 22176, + "4": 26592, + "5": 29376, + "6": 17375, + "7": 26496, + "14": 1, + "42": 403 + }, + "profile_delta": { + "2": 13, + "6": -1, + "14": 1, + "26": -32, + "42": 19 + }, + "paid_requests": 903456, + "rank_mass": 1808352, + "idle_records": 63936, + "idle_records_sha256": "27d938cff6eb665ea8bf50b4ec68340fc4e4a36dd025f3b87a72c2fa52f1e00a", + "first_counterexample": { + "stage": 6, + "call_replica": 1, + "helper": 421, + "old": { + "family": 1097, + "child": 6, + "offset": 0 + }, + "new": { + "family": 209, + "child": 6, + "offset": 16 + } + }, + "retained_catalogue_rejection": "replica owner symmetry", + "controls_rejected": [ + "stale old family", + "wrong logical replica", + "overlapping destination cells", + "destination beyond window", + "wrong destination pair", + "duplicate moved owner" + ], + "physical_CALL_RETURN_executed": false, + "new_kappa_claim": false +} diff --git a/research/r437-replica-indexed-emission/SOURCES.json b/research/r437-replica-indexed-emission/SOURCES.json new file mode 100644 index 0000000000..0839f4876a --- /dev/null +++ b/research/r437-replica-indexed-emission/SOURCES.json @@ -0,0 +1,18 @@ +{ + "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" + } + ] +} diff --git a/research/r437-replica-indexed-emission/TASK.json b/research/r437-replica-indexed-emission/TASK.json new file mode 100644 index 0000000000..758ebcb6c0 --- /dev/null +++ b/research/r437-replica-indexed-emission/TASK.json @@ -0,0 +1,72 @@ +{ + "schema_version": 1, + "task_id": "supplier-boundary-audit", + "priority_revision": 6, + "base_commit": "20ecf2891d80b5acf18d980b2164fb44ea7faa90", + "original_card": { + "id": "supplier-boundary-audit", + "question": "Does one selected supplier obligation follow from its actual source-bound checks?", + "starting_points": [ + "certificates/selected-result.json", + "research/owner-boundary-audit/README.md", + "research/scatter-export-parity-audit/README.md" + ], + "methods": [ + "Trace one hypothesis through the source, checker and complete caller.", + "Construct one semantically invalid but superficially well-formed fixture and test rejection." + ], + "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_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read #2977 reported duplicate-scatter counterexample and its opt-in repair. The archive is not a production fix or an independently validated selected-result failure; the selected generator emits unique rows.", + "scope": "Source-binding orientation only; does not replay or validate the reported bug." + }, + "first_experiment": "First check whether the scatter repair has been adopted. If still open, independently reproduce #2977 symbolic-versus-exported parity on the tiny duplicate fixture, compare the selected unique-row positive control, and define either enforced uniqueness or consistent multiplicity semantics. A bounded guard-adoption patch must preserve valid inputs and test the actual exported action. Stop after this obligation; no full historical replay or frontier change follows from the mutant alone.", + "bottleneck_link": "Closing a current acceptance gap or proof obligation strengthens reliability even without changing kappa.", + "allowed_variations": [ + "Audit one named current condition using a new semantic counterexample." + ], + "scope_change_triggers": [ + "Reporting the historical timing-only diagnostic as a new current acceptance bug.", + "Calling a malformed mutant a failure of the selected construction, or importing an opt-in repair without testing the exporter boundary." + ], + "overlap_terms": [ + "owner boundary", + "bridge omission", + "hosting", + "2977", + "scatter export", + "duplicate index", + "parity semantics" + ] + }, + "scope_status": "refined", + "actual_scope": "Compile the 63 pinned R437 pooled moves into the retained absolute-owner IR emitter, exhibit the first actual rejection by the compressed physical catalogue, and specify the replica-indexed refinement boundary.", + "scope_change_reason": "Explicit donor assignment targets the unresolved cross-replica native join after PR3959; the existing unpooled PR3967 adapter enforces replica symmetry.", + "bottleneck_link": "The proposed bit endpoint in PR3959 binds its paired conditional kappa, but this package advances only its owner-to-emitted-IR obligation. Physical compilation and full supplier admission are unresolved.", + "budget_minutes": 60, + "stop_rule": "Stop at a source-bound first-move mismatch and a bounded complete IR emission; do not infer physical CALL/RETURN or a new kappa from static ownership.", + "outcome": "partial", + "evidence": "RESULT.json, PROOF.md, the exact retained guard and two retained stream encoders, six rejected ownership mutations.", + "author": "Chris R / Clear1nsight with OpenAI Codex", + "ai_assistance": "Substantial OpenAI Codex assistance for analysis, code, proofs, tests and writing.", + "open_questions": [ + { + "question": "Can the production physical catalogue and topology accept replica-indexed owner and idle requests?", + "why_it_matters": "The present compressed catalogue rejects the first cross-replica move; source-code identity and native returns must use the new complete request domain.", + "first_step": "Build the stage6 replica1 helper421 native request at family209 offset16 and bind its actual source code, chart, return capsule and consumers.", + "blocked_by": "Complete replica-aware production source identity, address routing, preparation, restoration and cost/visited-cell contracts." + }, + { + "question": "Can the full pooled R437 supplier retain its advertised endpoint after native costs?", + "why_it_matters": "No numerical kappa improvement is admitted from this finite IR certificate.", + "first_step": "Compose the completed physical refinement with the complete dual-supplier budget using exact source heads.", + "blocked_by": "All inherited R437 all-size, SOURCE, correlated hosting, common field/cover, stock, precision and physical consumer obligations." + } + ] +} diff --git a/research/r437-replica-indexed-emission/UPSTREAM-NOTICE.md b/research/r437-replica-indexed-emission/UPSTREAM-NOTICE.md new file mode 100644 index 0000000000..9b519b904d --- /dev/null +++ b/research/r437-replica-indexed-emission/UPSTREAM-NOTICE.md @@ -0,0 +1,71 @@ +# Notice + +Apache-2.0 (`LICENSE`, copied from #493's package). Prepared by eumemic with substantial Anthropic Claude +assistance. + +## New in this package + +- `code/gen_p3.py` (the generator of the punctured word: the L3 skeleton of #543 restricted to the live lines, the + pseudo-target totals, the phase-A mini-nodes and extra carriers), `code/pwordl.py` (word builder for a live subset + of the 120 lines; output in the bitE8/1 layout with the `ports_geom` and `punctured` fields introduced by #545), + `data/bitE8mut-p111.json.gz` (the word), `data/punct.json` (its frozen parameters), `discovery/choose.py` and + `discovery/search.py` (the nomination of P and of the parameters; not run by `verify.sh`). +- `code/gen_p3.py` carries `derive`, `ex_part` and `plan_thirds` from #543's `code/gen_l3.py` (eumemic), and + `data/plan-l3.json` is #543's CP-SAT plan, unchanged. `code/nodeopt.py`, `code/planio.py`, `code/mutants.py`, + `code/mutrec_b.py` and `code/provenance.py` are #543's files, unchanged. +- `code/xcheck_p.py`: #543's independent checker `code/xcheck.py` with nine listed edits for v <= 120 live labels + (root-line enumeration of the lattice, frame closure and target frames over the live labels) and a new part T (the + frame and COPY rank of every retained total at the scatter, and whether it is the hyperplane of a punctured line). +- `code/mutants_p.py` (punctured-design controls), `code/adapt9p.py` (#510's nine-stage files parameterised for + v <= 120 and any copy ranks, the way #545's `adapt.py` parameterises #493's eleven-stage files), `code/cited.py`, + `code/receipt_kappa.py`, `code/summary.py`, `verify.sh`, `EXPECTED.json`, `DEPENDS.json`, `requirements.txt`, + `data/complex-b.json`, `data/selection9-p111.json` and `data/hosting11-p111.json` (frozen nominations of #442's + hosting programme, rediscovered by `verify.sh`), `.github/workflows/e8-bit-p111.yml`. + +## Vendored, byte-identical (git blob ids in `SOURCE-pr*.json`, checked by `code/provenance.py`) + +- **PR #510 (DreamingOfClouds, with Claude Opus 5.5 via Claude Code), commit 64edee1** (`vendor/pr510/`): the same 19 + files as #543's package (#510's nine-stage chain with the files it vendors from #463, #443, #442 and #315, and #503's + R480 word). Their notices are listed in #543's NOTICE and in the files. +- **PR #545 (DreamingOfClouds, with Claude Opus 5.5 via Claude Code; draft), commit 376426f** (`vendor/pr545/`): + `code/adapt.py` and `code/punct_cfg.py`, run unchanged on this package's word; `data/bitE8mut-v111-r489.json.gz`, + `data/hosting-v111-r489.json` and `EXPECTED.json` (a control). +- **PR #548 (Dugongue), commit 66dbc2b** (`data/complex/pr548/`): `EXPECTED.json` and `evidence/EXACT-ASSEMBLY.json`. +- **PR #544 (chafreaky, with OpenAI Codex assistance), commit 4858bb3** (`data/complex/pr544/`): `EXPECTED.json` and + the Linux exact-assembly receipt. +- **PR #535 (icekylinx, with GPT-6 Astra assistance), commit 8b758a1** (`data/complex/pr535/`): `EXPECTED.json` and + `evidence/audit/EXACT-ASSEMBLY-PR493.json`. + +## Used from main, unchanged (pinned in `DEPENDS.json`) + +- `research/e8-bit-carrier-skeleton` (PR #493, eumemic): the skeleton modules and D4 partition the generator imports, + #370's checker (run here in #545's v <= 120 form), the official cohort checkers, `gram_frames.py`, the record + exporter, the geometries and the eleven-stage chain that #545's `adapt.py` parameterises, #442's hosting programme, + the R489 word, the control receipts and #315's engines. +- `research/direct-delivery504-global/EXPECTED.json` (PR #531, icekylinx): its complex b and kappa. + +## Cited, not rebuilt + +Complex coarse savings in `data/complex-b.json`, each bound to its PR's receipt by `code/cited.py`: PR #548 (primary; +open), PR #544 and PR #535 (open), PR #531 (merged), and PR #484, #471 and #458 (controls). + +## Ideas used + +- PR #545 (DreamingOfClouds): the punctured-star unit. Nine lines are neither sources nor targets; each retained total + is a pseudo-target that reads what the removed target would read, at frame rank 7, so the decoder constant is 63; + the rank-mass identity with v and the decoder constant as parameters; the parameterisation of the hub chain. +- PR #543 (eumemic): the R420 L3 skeleton with keepers read by targets and rewritten in phase B. +- PR #493 (eumemic), PR #503 and #510 (DreamingOfClouds), PR #425 (Zhihao Chen / jacklightChen), PR #370 (Dylan Crow), + PR #472, #445, #443 (chafreaky), PR #442 (DaysSky), PR #463 and #315 (DreamingOfClouds), PR #386 (Zhihao Chen): the + skeleton, the scalar-interface lemma, the format, and the pricing pipelines. +- PR #523 (icekylinx): the puncture pattern on the complex side, cited by #545. +- Jacob Sussman introduced the E8 unit. + +R437 composition: Ali Romman (@aliromman), with substantial OpenAI Codex assistance, authored the public1043 helper470 source-boundary deletion. Its exact canonical-main package and NOTICE are retained in public1043/. The new contribution here composes that credited deletion with the independently validated helper464 GL, then reconstructs actual owners, full invoice, independent checks and portable replay. + +Sagar Thakrar (thakrarsagar), PR3700 Open question4, proposed the exact +window6 two-leftover coalescing used by this follow-up. No code from that +PR is imported by the author pipeline; root independently replayed its +hosting and price engines. Full owner/template/invoice regeneration and +packaging used substantial OpenAI Codex assistance. All prior credits and +Apache-2.0 notices remain in place. diff --git a/research/r437-replica-indexed-emission/VERIFY.json b/research/r437-replica-indexed-emission/VERIFY.json new file mode 100644 index 0000000000..06e794749d --- /dev/null +++ b/research/r437-replica-indexed-emission/VERIFY.json @@ -0,0 +1,19 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 240, + "checks": "Exact pinned bytes, retained symmetry guard rejection, all125856 owners, all7814016 emitted events through two retained encoders, exact profile and six mutations" + } + ] +} diff --git a/research/r437-replica-indexed-emission/compiler.py b/research/r437-replica-indexed-emission/compiler.py new file mode 100644 index 0000000000..512047d8b9 --- /dev/null +++ b/research/r437-replica-indexed-emission/compiler.py @@ -0,0 +1,136 @@ +"""Replica-indexed owner overlay, scoped before physical CALL/RETURN. + +Apache-2.0. Chris R / Clear1nsight with substantial OpenAI Codex assistance. +The input schedule, local words and proposed 63 moves are predecessor work. +""" +import ast +import copy +import hashlib +import json +from collections import Counter, defaultdict +from pathlib import Path + +HERE = Path(__file__).resolve().parent + + +def need(value, reason): + if not value: + raise ValueError(reason) + + +def retained_symmetry_check(template): + """Execute the actual retained guard, with PR3967's private=659 adaptation.""" + tree = ast.parse((HERE / 'inputs/catalogue.py').read_text()) + cls = next(n for n in tree.body if isinstance(n, ast.ClassDef) and n.name == 'Catalogue') + bind = next(n for n in cls.body if isinstance(n, ast.FunctionDef) and n.name == '_bind') + stage_loop = copy.deepcopy(next(n for n in bind.body if isinstance(n, ast.For) + and isinstance(n.target, ast.Name) and n.target.id == 'stage')) + need(isinstance(stage_loop, ast.For) and len(stage_loop.body) == 5, + 'retained catalogue stage-loop shape') + stage_loop.body = stage_loop.body[:2] + class Private(ast.NodeTransformer): + def visit_Constant(self, node): + return ast.copy_location(ast.Constant(659), node) if node.value == 661 else node + stage_loop = Private().visit(stage_loop) + program = ast.fix_missing_locations(ast.Module(body=[stage_loop], type_ignores=[])) + exec(compile(program, '', 'exec'), + {'t': template, 'need': need}) + + +def compile_owners(template, moves): + t = copy.deepcopy(template) + last, seen, windows = {}, [], {} + for position, event in enumerate(t['schedule']): + if event['kind'] == 'local_cover_sweep': + seen.append((position, event['stage'], event['pair'])) + last[event['pair']] = position + elif event['kind'] == 'bridge': + last[event['dst']] = last[event['src']] = position + elif event['kind'] == 'idle': + stages = [s for p, s, pair in seen + if last.get(event['pair'], -1) < p < position and pair != event['pair']] + if event['rank'] and stages: + windows[str(event['idx'])] = [event['pair'], event['rank'], sorted(stages)] + need(windows == t['hosting']['windows'], 'windows derived from literal chronology') + calls = {(c['stage'], c['replica']): c for c in t['calls']} + need(len(calls) == 288, 'complete stage-replica call domain') + changed = set() + for move in moves: + key = move['stage'], move['call_replica'], move['helper'] + need(key not in changed, 'duplicate moved logical owner') + changed.add(key) + call = calls[key[:2]] + old, new = move['old'], move['new'] + role = 222 + move['helper'] + need(call['owners'][role] == [old['family'], ['hosted', old['child'], old['offset'], 8]], + 'exact predecessor owner') + call['owners'][role] = [new['family'], ['hosted', new['child'], new['offset'], 8]] + occupancy = defaultdict(set) + count = 0 + for call in t['calls']: + for family, route in call['owners'][222:]: + need(route[0] == 'hosted', 'host-all domain') + _, child, offset, width = route + pair, capacity, stages = t['hosting']['windows'][str(child)] + need(call['stage'] in stages and pair != call['pair'], 'untouched destination window') + need(0 <= family < 28416 and (family % 888) // 222 == pair, + 'absolute destination family pair') + need(width == 8 and 0 <= offset and offset + width <= capacity, + 'whole residual within destination') + cells = set(range(offset, offset + width)) + need(not cells.intersection(occupancy[child, family]), 'disjoint absolute owner cells') + occupancy[child, family].update(cells) + count += 1 + need(count == 125856, 'each logical helper hosted exactly once') + profile = Counter() + for call in t['calls']: + for event in t['local_programs'][call['orientation']]: + if event[0] == 0 and event[4]: profile[event[4]] += 1 + elif event[0] == 2: profile[event[5]] += 1 + idle_records = [] + for event in t['schedule']: + if event['kind'] != 'idle' or not event['rank']: continue + child, pair, capacity = event['idx'], event['pair'], event['rank'] + for replica in range(32): + for cp in range(222): + family = replica * 888 + pair * 222 + cp + used = occupancy[child, family] + need(used == set(range(len(used))), 'compact occupied prefix') + rank = capacity - len(used) + if rank: + profile[rank] += 1 + idle_records.append([child, replica, cp, family, len(used), rank]) + need(sum(profile.values()) == 903456, 'all paid requests retained') + need(sum(r*n for r,n in profile.items()) == 1808352, 'rank mass retained') + return t, profile, idle_records + + +def retained_emit(template): + """Execute the unchanged final stream-emission block of pinned emit_k.py.""" + source = (HERE / 'inputs/emit_k.py').read_text() + start = source.index(' expanded=hashlib.sha256(); count=0; local=2*V+R\n') + end = source.index(" res['additional_interface']=", start) + code = '\n'.join(line[4:] for line in source[start:end].splitlines()) + scope = {'t': template, 'res': {}, 'hashlib': hashlib, 'json': json, + 'V': 111, 'R': 437, 'LIVE': 28416} + exec(compile(code, '', 'exec'), scope) + return scope['res'] + + +def independent_emit(template): + """Use the separately retained predecessor audit encoder without adaptation.""" + source = ast.parse((HERE / 'inputs/audit_hosted_k.py').read_text()) + function = next(n for n in source.body if isinstance(n, ast.FunctionDef) and n.name == 'digest') + scope = {'hashlib': hashlib, 'json': json, 'V': 111} + exec(compile(ast.fix_missing_locations(ast.Module(body=[function], type_ignores=[])), + '', 'exec'), scope) + return scope['digest'](template) + + +def changed_event_count(before, after): + count = 0 + for old, new in zip(before['calls'], after['calls']): + changed = {i for i,(a,b) in enumerate(zip(old['owners'],new['owners'])) if a != b} + for z in before['local_programs'][old['orientation']]: + count += z[1] in changed or (z[0] != 0 and z[2] in changed) + return count diff --git a/research/r437-replica-indexed-emission/inputs/audit_hosted_k.py b/research/r437-replica-indexed-emission/inputs/audit_hosted_k.py new file mode 100644 index 0000000000..d8ec96cc42 --- /dev/null +++ b/research/r437-replica-indexed-emission/inputs/audit_hosted_k.py @@ -0,0 +1,161 @@ +# Adapted from PR #510's vendored audit_hosted_k.py by research/e8-bit-p111/code/adapt9p.py. Apache-2.0. +# Independent ownership/window audit, extending DaysSky PR442 and chafreaky PR444 (OpenAI Codex); no generator imports. +# Generalised to an arbitrary odd stage count, any replica count and host-every-residual templates by DreamingOfClouds with +# Claude Opus 5.5 (Anthropic), via Claude Code. Apache-2.0. +"""Independent ownership/window audit of an idle-axis-hosted compressed S-stage bit template. +Usage: audit_hosted_k.py PARENT_DIR HOSTED_DIR OUT.json +PARENT_DIR holds the parent's records/ and nine/-style GLOBAL files via --parent-nine (default PARENT_DIR/nine). +At the nine-stage defaults this performs PR #444's checks and fourteen mutations; at S = 11 the mutations that need a +bank are replaced by stage-count, window and exterior-coordinate controls.""" +import copy, gzip, hashlib, json, sys +from collections import Counter, defaultdict +from pathlib import Path +V=CST=None # set in main(): V from the parent GLOBAL.json, CST from the parent template's local programs +read=lambda p:json.loads(Path(p).read_text()) +template=lambda p:json.loads(gzip.decompress(Path(p).read_bytes())) + +def windows(schedule): + last={}; seen=[]; win={}; rank={}; pair={} + for pos,e in enumerate(schedule): + if e['kind']=='local_cover_sweep': + seen.append((pos,e['stage'],e['pair']));last[e['pair']]=pos + elif e['kind']=='bridge': + last[e['dst']]=pos;last[e['src']]=pos + elif e['kind']=='exchange': + assert pos==len(schedule)-1 + else: + assert e['kind']=='idle' + i=e['idx'];assert i not in win + win[i]={s for q,s,p in seen if last.get(e['pair'],-1)=5 and L%2==1 and M==1+7*L + mutable={'version','live','banks_per_stage','hosting','helper_route','calls','schedule'} + assert set(t)==set(parent)|{'hosting'} + assert {k:v for k,v in t.items() if k not in mutable}=={k:v for k,v in parent.items() if k not in mutable} + assert t['replicas']==T and t['m']==M and t['private_centre_reserve']==9 + sched=copy.deepcopy(parent['schedule']);idx=0 + for e in sched: + if e['kind']=='idle':e['idx']=idx;idx+=1 + assert t['schedule']==sched + W,rank,pair=windows(t['schedule']);hs=t['hosting'] + assert hs['windows']=={str(i):[pair[i],rank[i],sorted(W[i])] for i in W if rank[i]>0 and W[i]} + used=defaultdict(set);hosted={} + for i,cp,off,w,s,h in hs['slots']: + assert i in W and s in W[i] and 0<=s0 and 0<=off and off+w<=rank[i] + cells=set(range(off,off+w));assert not cells & used[i,cp];used[i,cp]|=cells + assert (s,h) not in hosted;hosted[s,h]=(i,cp,off,w) + rem={};summaries={} + for i in rank: + if not rank[i]:continue + for cp in range(2*V):rem[i,cp]=rank[i]-len(used[i,cp]) + if str(i) in hs['windows']: + summaries[str(i)]={str(r):n for r,n in sorted(Counter(rem[i,cp] for cp in range(2*V)).items())} + assert hs['remainders']==summaries + banks={int(s):n for s,n in hs['banks_per_stage'].items()} + assert set(banks)==set(range(L)) and all(isinstance(n,int) and n>=0 for n in banks.values()) + assert {int(s):n for s,n in t['banks_per_stage'].items()}==banks + base={};end=DATA + for s in range(L):base[s]=end;end+=banks[s] + assert t['live']==end + assert len(t['calls'])==L*T and len(parent['calls'])==L*T + occ=defaultdict(set);bank_count=0;host_count=0 + assert {(c['stage'],c['replica']) for c in t['calls']}=={(s,r) for s in range(L) for r in range(T)} + for c,pc in zip(t['calls'],parent['calls']): + assert {k:v for k,v in c.items() if k!='owners'}=={k:v for k,v in pc.items() if k!='owners'} + s,rep,p=c['stage'],c['replica'],c['pair'];own=c['owners'] + assert len(own)==2*V+R and own[:2*V]==pc['owners'][:2*V] + for h,(f,r) in enumerate(own[2*V:]): + if (s,h) in hosted: + i,cp,off,w=hosted[s,h];side,port=divmod(cp,V) + assert r==['hosted',i,off,w] and f==rep*(2*K*V)+(2*pair[i]+side)*V+port + assert pair[i]!=p and 0<=f2*max(paid)**depth + return paid,host_count,bank_count + +def digest(t): + # Independent streamed hashing uses the same specified JSON instruction format. + h=hashlib.sha256();n=0;R=len(t['calls'][0]['owners'])-2*V + for call in t['calls']: + for z in t['local_programs'][call['orientation']]: + x=[z[0],call['owners'][z[1]]] + if z[0]==0:x.extend(z[2:]) + else: + x.append(call['owners'][z[2]] if z[2]<2*V+R else [t['live'],['private',0]]) + x.extend(z[3:]) + h.update(json.dumps(x,separators=(',',':')).encode());h.update(b'\n');n+=1 + return h.hexdigest(),n + +def main(): + global V,CST + par,bd,out=map(Path,sys.argv[1:4]);pt=template(par/'nine/GLOBAL-TEMPLATE.json.gz') + t=template(bd/'GLOBAL-TEMPLATE.json.gz');g=read(bd/'GLOBAL.json');pg=read(par/'nine/GLOBAL.json') + V=pg['v'];CST=sum(z[5] for z in pt['local_programs']['forward'] if z[0]==2) + assert 100<=V<=120 and CST==sum(z[5] for z in pt['local_programs']['reverse'] if z[0]==2) + st=read(par/'records/249-states.json');frames=read(par/'records/frames.json')['frames'] + L=t['stages'];T=t['replicas'];M=t['m'];K=(L-1)//2;R=pg['R'];depth=g['halving_depth'];DATA=2*K*V*T + widths=[8-frames[str(st['initial'][str(h)])]['dim'] for h in range(2*V,2*V+R)] + P,host,bank=audit(t,pt,widths,depth) + th=hashlib.sha256(gzip.decompress((bd/'GLOBAL-TEMPLATE.json.gz').read_bytes())).hexdigest() + assert th==g['template_sha256'] and g['parent_template_sha256']==pg['template_sha256'] + assert P==Counter({int(r):n for r,n in g['profile'].items()}) + DEFICIT=T*(2*K*V-L*CST) + assert (g['live'],g['physical'],g['rank_mass'],g['deficit'],g['paid_calls'],g['maxchild'])==(t['live'],t['live']+9,sum(r*n for r,n in P.items()),DEFICIT,sum(P.values()),max(P)) + assert g['hosted_residuals']==host and g['bank_assignments']==bank + dg,n=digest(t);assert dg==g['emitted_program_sha256'] and n==g['emitted_events']==pg['emitted_events'] + assert dg!=pg['emitted_program_sha256'] + controls=[] + def reject(name,fn): + q=copy.deepcopy(t);fn(q) + try:audit(q,pt,widths,depth) + except (AssertionError,KeyError,IndexError,TypeError):controls.append(name) + else:raise AssertionError('accepted '+name) + def owner(q,kind): + return next(o for c in q['calls'] for o in c['owners'][2*V:] if o[1][0]==kind) + Wd,rk,pr=windows(t['schedule']) + def outside_stage(q): + i,cp,off,w,s,h=q['hosting']['slots'][0]; q['hosting']['slots'][0][4]=next(x for x in range(L) if x not in Wd[i]) + reject('slot outside window',outside_stage) + reject('copy index outside family',lambda q:q['hosting']['slots'][0].__setitem__(1,2*V)) + reject('negative slot offset',lambda q:q['hosting']['slots'][0].__setitem__(2,-1)) + reject('wrong residual width',lambda q:q['hosting']['slots'][0].__setitem__(3,1+q['hosting']['slots'][0][3])) + reject('duplicate helper',lambda q:q['hosting']['slots'].append(q['hosting']['slots'][0])) + reject('omitted helper',lambda q:q['hosting']['slots'].pop()) + reject('hosted owner in another replica or outside the data stock',lambda q:owner(q,'hosted').__setitem__(0,owner(q,'hosted')[0]+2*K*V)) + reject('hosted owner on a wrong data family',lambda q:owner(q,'hosted').__setitem__(0,q['calls'][0]['owners'][0][0])) + if bank: + reject('wrong bank slot',lambda q:owner(q,'bank')[1].__setitem__(1,M)) + reject('wrong bank stage',lambda q:owner(q,'bank').__setitem__(0,t['live']-1)) + reject('wrong call orientation',lambda q:q['calls'][0].__setitem__('orientation','reverse')) + reject('duplicate call',lambda q:q['calls'].__setitem__(1,q['calls'][0])) + reject('changed idle rank',lambda q:next(e for e in q['schedule'] if e['kind']=='idle').__setitem__('rank',1)) + reject('understated live stock',lambda q:q.__setitem__('live',q['live']-1)) + reject('missing remainder summary',lambda q:q['hosting']['remainders'].pop(next(iter(q['hosting']['remainders'])))) + reject('stale stage count',lambda q:q.__setitem__('stages',L-2)) + reject('hosted coordinate beyond the pending set',lambda q:q['hosting']['slots'][0].__setitem__(2,rk[q['hosting']['slots'][0][0]])) + reject('overlapping hosted coordinates',lambda q:q['hosting']['slots'].append(q['hosting']['slots'][0][:5]+[(q['hosting']['slots'][0][5]+1)%R])) + res=dict(status='PASS_INDEPENDENT_REPLICATED_HOSTING_AUDIT',template_sha256=th,emitted_program_sha256=dg,emitted_events=n, + profile={str(r):z for r,z in sorted(P.items())},live=t['live'],physical=t['live']+9,hosted_residuals=host, + bank_assignments=bank,rank_mass=sum(r*n for r,n in P.items()),deficit=DEFICIT,maxchild=max(P),mutations_rejected=controls) + out.write_text(json.dumps(res,indent=2)+'\n');print(json.dumps(res)) +if __name__=='__main__':main() diff --git a/research/r437-replica-indexed-emission/inputs/catalogue.py b/research/r437-replica-indexed-emission/inputs/catalogue.py new file mode 100644 index 0000000000..0efc0575a7 --- /dev/null +++ b/research/r437-replica-indexed-emission/inputs/catalogue.py @@ -0,0 +1,268 @@ +"""Fixed selected request compilation, adapted from pinned PR2234 provider.py. + +Only q, rational labels and low classes enter these compilation routines. +Runtime precision, high matrices, widths and coefficients remain on tapes. +""" +from collections import Counter, defaultdict +from dataclasses import dataclass +from fractions import Fraction as F +from functools import cached_property, lru_cache +from hashlib import sha256 +import importlib.util +import json + +from binding import split_basis +from low_codes import LowCodes +import oracle +from plan import compile_plan +from sources import ROOT, Template, compile_specification, identity, product +from words import need + + +def canonical(value): + return json.dumps(value,sort_keys=True,separators=(",",":")) + + +@dataclass(frozen=True) +class Base: + kind: str + data: tuple + rank: int + + @cached_property + def key(self): + values=[[str(x) for x in row] for row in self.data] if self.kind=="local" else self.data + return sha256(canonical([self.kind,self.rank,values]).encode()).hexdigest() + + @lru_cache(None) + def matrix(self): + out=[[F(0)]*64 for _ in range(64)] + if self.kind=="local": + for i,row in enumerate(self.data):out[i][:8]=row + else: + need(self.kind=="idle" and len(set(self.data))==self.rank,"fixed idle base") + for i in self.data:out[i][i]=F(1) + return tuple(map(tuple,out)) + + @lru_cache(None) + def basis(self,q): + return split_basis(self.matrix(),self.rank,q) + + +@dataclass(frozen=True) +class Chart: + kind: str + port: int = -1 + stage: int = -1 + axes: tuple = () + + @property + def key(self):return (self.kind,self.port,self.stage,self.axes) + + +@dataclass(frozen=True) +class Request: + kind: str + stage: int + position: int + role: int + family: int + old_frame: int + new_frame: int + base: Base + chart: Chart + header_space: str + source_chart: object = None + + def record(self): + return [self.kind,self.stage,self.position,self.role,self.family, + self.old_frame,self.new_frame,self.base.key,self.base.rank, + self.chart.key,self.header_space,self.source_chart.key if self.source_chart else None] + + +class Catalogue: + dimension=64 + replicas=32 + families=28416 + private=661 + replica_stride=888 + + def __init__(self,q): + self.q=q + path=ROOT/"research/pr589-five-helper-hosting/verify.py" + spec=importlib.util.spec_from_file_location("retained_selected_node_source",path) + self.old=importlib.util.module_from_spec(spec);spec.loader.exec_module(self.old) + self.word,self.template,self.geometry=(self.old.read(p) for p in + (self.old.WORD,self.old.HOST,self.old.GEO)) + rows=[self.old.projection([self.word["lines"][i] for i in frame]) for frame in self.word["frames"]] + self.projectors=[p for p,_ in rows];self.dimensions=[r for _,r in rows] + self.idles={event["idx"]:event for event in self.template["schedule"] if event["kind"]=="idle"} + self.requests=[];self.bases={};self.charts=set();self.erase_guards=[] + self._bind() + self.codes=LowCodes(q,64,len(self.requests)) + self.identifiers={self.semantic_key(request):i for i,request in enumerate(self.requests)} + need(len(self.identifiers)==len(self.requests),"unique full catalogue request identifiers") + + @staticmethod + def semantic_key(request): + return (request.kind,request.stage,request.role if request.kind=="IDLE" else request.position) + + def base(self,a,b): + lo,hi=(a,b) if self.dimensions[a]<=self.dimensions[b] else (b,a) + value=Base("local",self.old.sub(self.projectors[hi],self.projectors[lo]), + self.dimensions[hi]-self.dimensions[lo]) + return self.bases.setdefault(value.key,value) + + def pending(self,child):return tuple(self.old.pending_axes(self.idles[child])) + + def owner_chart(self,call,role): + family,route=call["owners"][role] + if route[0]=="data":return Chart("data",route[2],route[1]) + need(route[0]=="hosted","selected owner route kind") + _,child,offset,width=route + axes=self.pending(child)[offset:offset+width] + need(len(axes)==8,"complete selected helper support") + return Chart("host",family%111 if min(axes)<8 else -1,axes=axes) + + @lru_cache(None) + def chart_matrix(self,chart): + out=identity(64) + if chart.kind=="identity":return tuple(map(tuple,out)) + if chart.kind=="data": + if chart.stage==0:return tuple(map(tuple,out)) + axes=list(range(8))+list(range(8+7*(chart.stage-1),8+7*chart.stage)) + rho=self.geometry["ports"][chart.port]["rho15"] + for i,a in enumerate(axes): + for j,b in enumerate(axes):out[a][b]=F(rho[i][j]) + return tuple(map(tuple,out)) + if chart.kind=="family" or (chart.kind=="host" and chart.port>=0): + port=self.geometry["ports"][chart.port] + for i in range(8):out[i][:8]=[F(port["q"][i],2)]+list(map(F,port["complement_columns"][i])) + if chart.kind=="host": + domain,support=set(range(8)),set(chart.axes);permutation=list(range(64)) + for a,b in zip(sorted(domain-support),sorted(support-domain)): + permutation[a],permutation[b]=b,a + need(set(permutation[:8])==support,"selected owner support completion") + out=[[row[permutation[j]] for j in range(64)] for row in out] + else:need(chart.kind=="family","known fixed chart") + return tuple(map(tuple,out)) + + def _append(self,request): + need(0 0 and x[2]} + avail = Counter() + for s in range(L): + for w in width: avail[s, w] += 1 + sel = Path(a.selection); key = a.key + if a.discover: + group = {7: 2} if (L == 9 and not a.host_all) else None + ys, zs, val = HK.solve(win, 2 * V, dict(avail), M, group=group, host_all=a.host_all, max_remainder=a.cap) + HK.save_selection(sel, key, ys, zs, val) + ys, zs, val = HK.load_selection(sel, key) + helpers = {s: [(h, width[h]) for h in range(R)] for s in range(L)} + slots, rem = HK.expand(win, ys, zs, helpers, 2 * V) + hosted = {(s, h): (i, c, off, w) for i, c, off, w, s, h in slots} + if a.host_all: assert len(hosted) == L * R, 'host-all selection leaves unhosted residuals' + # remaining helpers -> exact width-m banks (per stage, same set of helpers in every replica) + left = {s: [h for h in range(R) if (s, h) not in hosted] for s in range(L)} + nb = {}; place = {} + for s in range(L): + original = left[s] + if not original: nb[s] = 0; continue + placed, nb[s] = placement([width[h] for h in original], T, M) + for (rep, index), location in placed.items(): + place[s, rep, original[index]] = location + base = [DATA] + for s in range(L): base.append(base[-1] + nb[s]) + LIVE = base[-1] + # owners + for c in t['calls']: + s, rep, p = c['stage'], c['replica'], c['pair']; own = c['owners'][:2 * V] + for h in range(R): + if (s, h) in hosted: + i, cp, off, w = hosted[s, h]; pair = win[i][0]; side, port = divmod(cp, V) + own.append([rep * (2 * K * V) + (2 * pair + side) * V + port, ['hosted', i, off, w]]) + else: + b, off, w = place[s, rep, h]; own.append([base[s] + b, ['bank', off, w]]) + assert len({(f, tuple(r)) for f, r in own}) == 2 * V + R and all(0 <= f < LIVE for f, r in own) + c['owners'] = own + # profile: local programs unchanged; idle children replaced by remainders + paid = Counter() + for c in t['calls']: + for z in t['local_programs'][c['orientation']]: + if z[0] == 0 and z[4]: paid[z[4]] += 1 + if z[0] == 2: paid[z[5]] += 1 + remainder = {} + for e in t['schedule']: + if e['kind'] == 'idle' and e['rank']: + i = e['idx'] + if i in win: + rr = Counter(rem[i, cp] for cp in range(2 * V)); remainder[i] = {str(k): v for k, v in sorted(rr.items())} + for r_, n in rr.items(): + if r_: paid[r_] += n * T + else: + paid[e['rank']] += 2 * V * T + mass = sum(r * n for r, n in paid.items()); assert M * LIVE - mass == DEFICIT, M * LIVE - mass + D = a.depth; assert 2 * max(paid) ** D < M ** D, ('halving depth too small', D, max(paid), M) + t.update(version=a.version_tag, live=LIVE, banks_per_stage=nb, + hosting=dict(windows={str(i): [w[0], w[1], sorted(w[2])] for i, w in win.items()}, + slots=[list(x) for x in slots], remainders=remainder, banks_per_stage=nb, + rule='helper (stage s, helper h) of replica r owns coordinates [off, off+w) of the pending idle-child ' + 'projector of data family r*%d+(2*pair+side)*%d+port (copy = side*%d+port); s lies strictly between ' + 'the last local/bridge touch of that pair and the child; the child keeps the remaining coordinates.' % (2 * K * V, V, V)), + helper_route='bank owner (exact width-%d tiling of the unhosted residuals of each stage) or hosted owner (data family, pending idle coordinates)' % M) + tb = json.dumps(t, separators=(',', ':'), sort_keys=True).encode(); (out / 'GLOBAL-TEMPLATE.json.gz').write_bytes(gzip.compress(tb, mtime=0)) + res = dict(g); res.update(status='PASS_IDLE_AXIS_HOSTED_BIT_TEMPLATE', live=LIVE, physical=LIVE + 9, template_sha256=hashlib.sha256(tb).hexdigest(), + parent_template_sha256=g['template_sha256'], profile=dict(sorted(paid.items())), paid_calls=sum(paid.values()), rank_mass=mass, + maxchild=max(paid), banks_per_stage=nb, banks_per_stage_hosted=nb, hosted_residuals_per_replica=len(slots), hosted_residuals=len(slots) * T, + hosted_coordinates_per_replica=sum(x[3] for x in slots), saved_idle_cost_proxy=val, seconds=time.monotonic() - t0) + res['bank_assignments'] = sum(1 for c in t['calls'] for f, r in c['owners'][2 * V:] if r[0] == 'bank') + res['halving_integer_inequality'] = [M ** D, 2 * max(paid) ** D]; res['halving_depth'] = D + res['deficit'] = DEFICIT + res['scope'] += ' Additional PR442 idle-data hosting interface is assumed; every hosting window and coordinate ownership is audited.' + # Re-emit the renamed stream: ownership has changed, so the parent's + # instruction digest must not be reused. + expanded=hashlib.sha256(); count=0; local=2*V+R + for call in t['calls']: + owners=call['owners'] + for z in t['local_programs'][call['orientation']]: + op=z[0] + if op==0: mapped=[op,owners[z[1]],*z[2:]] + else: + ox=owners[z[1]];oy=owners[z[2]] if z[2]