diff --git a/research/r439-staged-retirement-boundary/CERTIFICATE.json b/research/r439-staged-retirement-boundary/CERTIFICATE.json new file mode 100644 index 0000000000..d7b21008bc --- /dev/null +++ b/research/r439-staged-retirement-boundary/CERTIFICATE.json @@ -0,0 +1,427 @@ +{ + "baseline_adds": 24305, + "baseline_helper_frame_dimensions": [ + 0, + 1, + 4, + 6, + 7, + 8 + ], + "baseline_paid_children": 2920, + "baseline_paid_histogram": { + "1": 1323, + "2": 1342, + "3": 79, + "4": 44, + "5": 102, + "6": 11, + "7": 19 + }, + "baseline_paid_rank_mass": 5129, + "cap_frame": 525, + "cap_rank": 7, + "columns": 661, + "complete_scalar_adds": 24304, + "complete_scalar_word_sha256": "f88caf54498fbfc70cce5faece96c1f59b973464ded6d7447040a1b8a43e16f1", + "copies_erased_before_cut": 9, + "copy_ranks": [ + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7 + ], + "cut": 10, + "dirty_support": [ + 163, + 381, + 465, + 474 + ], + "dropped_helper_adds": [ + [ + "B", + 134, + 0, + 507, + 465, + 69 + ], + [ + "B", + 135, + 0, + 507, + 465, + 63 + ], + [ + "B", + 136, + 0, + 507, + 465, + 0 + ], + [ + "B", + 160, + 0, + 507, + 465, + 68 + ], + [ + "B", + 161, + 0, + 507, + 465, + 3 + ], + [ + "B", + 542, + 0, + 339, + 465, + 323 + ], + [ + "C", + 58, + 0, + 1, + 465, + 323 + ], + [ + "C", + 439, + 0, + 1, + 465, + 3 + ], + [ + "C", + 440, + 0, + 1, + 465, + 68 + ], + [ + "C", + 464, + 0, + 1, + 465, + 0 + ], + [ + "C", + 465, + 0, + 1, + 465, + 63 + ], + [ + "C", + 466, + 0, + 1, + 465, + 69 + ], + [ + "C", + 2348, + 0, + 1, + 465, + 0 + ] + ], + "enlarged_cap_rank": 8, + "first_least_join_failure": { + "cap_rank": 7, + "donor_offset": 0, + "failed_register": 111, + "index": 601, + "ordinal": 585, + "required_rank": 8, + "section": "B", + "source": 243, + "target": 111 + }, + "four_contact_witness": [ + [ + 48, + 163, + 48 + ], + [ + 117, + 48, + 5 + ], + [ + 493, + 5, + 243 + ], + [ + 601, + 243, + 111 + ] + ], + "full_target_relaxation": { + "includes_nine_copies": true, + "paid_children": 3085, + "paid_histogram": { + "1": 1522, + "2": 1298, + "3": 81, + "4": 85, + "5": 73, + "6": 11, + "7": 13, + "8": 2 + }, + "paid_rank_mass": 5239, + "status": "CHANGED_ENDPOINT_POSITIVE_CONTROL_ONLY" + }, + "helper": 465, + "inlined_reads": [ + { + "donor_offset": 0, + "donors": [ + 0, + 11, + 63, + 72, + 247, + 323, + 345, + 373, + 432 + ], + "index": 653, + "section": "B", + "target": 163 + }, + { + "donor_offset": 5, + "donors": [ + 0 + ], + "index": 583, + "section": "C", + "target": 381 + } + ], + "isolation_orders": [ + { + "legal": true, + "order": [ + 163, + 381, + 474 + ] + }, + { + "legal": true, + "order": [ + 163, + 474, + 381 + ] + }, + { + "legal": false, + "order": [ + 381, + 163, + 474 + ] + }, + { + "legal": false, + "order": [ + 381, + 474, + 163 + ] + }, + { + "legal": false, + "order": [ + 474, + 163, + 381 + ] + }, + { + "legal": false, + "order": [ + 474, + 381, + 163 + ] + } + ], + "isolation_program": [ + [ + 507, + 465, + 0 + ], + [ + 507, + 163, + 465 + ], + [ + 512, + 381, + 465 + ], + [ + 512, + 474, + 465 + ] + ], + "isolation_target_cut_coordinates": [ + 0, + 163, + 465 + ], + "negative_controls": [ + "omit_isolation_0", + "omit_isolation_1", + "omit_isolation_2", + "omit_isolation_3", + "wrong_copy_snapshot", + "omit_ghost_donor", + "omit_B601", + "omit_witness_edge_0", + "omit_witness_edge_1", + "omit_witness_edge_2", + "omit_witness_edge_3", + "wrong_separating_normal", + "source_corruption" + ], + "new_kappa": false, + "new_supplier": false, + "optimistic_two_slot_budget": [ + { + "child_count_delta": -3, + "histogram_delta": { + "1": -2, + "10": 1, + "2": -2, + "3": 1, + "7": -1 + }, + "old_remainder": 2, + "p_half_interval": [ + "-12899249840367620312893266580600328410937/5000000000000000000000000000000000000000", + "-25798499680735240625786533161200656821869/10000000000000000000000000000000000000000" + ], + "rank_mass_delta": 0 + }, + { + "child_count_delta": -3, + "histogram_delta": { + "1": -2, + "12": 1, + "2": -1, + "3": 1, + "4": -1, + "7": -1 + }, + "old_remainder": 4, + "p_half_interval": [ + "-7159531126827634396802413633328353508629/2500000000000000000000000000000000000000", + "-1789882781706908599200603408332088377157/625000000000000000000000000000000000000" + ], + "rank_mass_delta": 0 + }, + { + "child_count_delta": -3, + "histogram_delta": { + "1": -2, + "14": 1, + "2": -1, + "3": 1, + "6": -1, + "7": -1 + }, + "old_remainder": 6, + "p_half_interval": [ + "-1897341513673778161493370924207767642217/625000000000000000000000000000000000000", + "-30357464218780450583893934787324282275467/10000000000000000000000000000000000000000" + ], + "rank_mass_delta": 0 + } + ], + "restore_cut_coordinates": [ + 0, + 465 + ], + "schema_version": 1, + "separating_normal": [ + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "shortest_contact_path": [ + [ + 48, + 0, + 163, + 48 + ], + [ + 117, + 0, + 48, + 5 + ], + [ + 493, + 0, + 5, + 243 + ], + [ + 601, + 0, + 243, + 111 + ] + ], + "source_sha256": "e3e301e62bc2b41dbf1ceac0acf3d35824ebeab1848c5a2142d4577b109da52f", + "staged_helper_frame_dimensions": [ + 0, + 1, + 4, + 7 + ], + "status": "SCOPED_ALL_LENGTH_FOUR_CONTACT_OBSTRUCTION", + "tail_adds": 3548 +} diff --git a/research/r439-staged-retirement-boundary/COPY-LIFECYCLE.json b/research/r439-staged-retirement-boundary/COPY-LIFECYCLE.json new file mode 100644 index 0000000000..3e5bc8b8be --- /dev/null +++ b/research/r439-staged-retirement-boundary/COPY-LIFECYCLE.json @@ -0,0 +1,143 @@ +{ + "copy_lifetimes": [ + { + "copy_record": 21816, + "cut_coordinate465_coefficient": 0, + "cut_coordinate_support": [ + 472 + ], + "erase_record": 21880, + "original_u465_coefficient": 0, + "paid_rank": 7, + "source": 472, + "source_frame": 510, + "temporary": 661, + "temporary_frame": 0 + }, + { + "copy_record": 21881, + "cut_coordinate465_coefficient": 0, + "cut_coordinate_support": [ + 473 + ], + "erase_record": 21937, + "original_u465_coefficient": 0, + "paid_rank": 7, + "source": 473, + "source_frame": 511, + "temporary": 661, + "temporary_frame": 0 + }, + { + "copy_record": 21938, + "cut_coordinate465_coefficient": 0, + "cut_coordinate_support": [ + 474 + ], + "erase_record": 21994, + "original_u465_coefficient": 1, + "paid_rank": 7, + "source": 474, + "source_frame": 512, + "temporary": 661, + "temporary_frame": 0 + }, + { + "copy_record": 21995, + "cut_coordinate465_coefficient": 0, + "cut_coordinate_support": [ + 475 + ], + "erase_record": 22051, + "original_u465_coefficient": 0, + "paid_rank": 7, + "source": 475, + "source_frame": 513, + "temporary": 661, + "temporary_frame": 0 + }, + { + "copy_record": 22052, + "cut_coordinate465_coefficient": 0, + "cut_coordinate_support": [ + 476 + ], + "erase_record": 22116, + "original_u465_coefficient": 0, + "paid_rank": 7, + "source": 476, + "source_frame": 514, + "temporary": 661, + "temporary_frame": 0 + }, + { + "copy_record": 22117, + "cut_coordinate465_coefficient": 0, + "cut_coordinate_support": [ + 477 + ], + "erase_record": 22181, + "original_u465_coefficient": 0, + "paid_rank": 7, + "source": 477, + "source_frame": 515, + "temporary": 661, + "temporary_frame": 0 + }, + { + "copy_record": 22182, + "cut_coordinate465_coefficient": 0, + "cut_coordinate_support": [ + 478 + ], + "erase_record": 22238, + "original_u465_coefficient": 0, + "paid_rank": 7, + "source": 478, + "source_frame": 516, + "temporary": 661, + "temporary_frame": 0 + }, + { + "copy_record": 22239, + "cut_coordinate465_coefficient": 0, + "cut_coordinate_support": [ + 479 + ], + "erase_record": 22295, + "original_u465_coefficient": 0, + "paid_rank": 7, + "source": 479, + "source_frame": 517, + "temporary": 661, + "temporary_frame": 0 + }, + { + "copy_record": 22296, + "cut_coordinate465_coefficient": 0, + "cut_coordinate_support": [ + 480 + ], + "erase_record": 22360, + "original_u465_coefficient": 0, + "paid_rank": 7, + "source": 480, + "source_frame": 518, + "temporary": 661, + "temporary_frame": 0 + } + ], + "cut_after_B_adds": 10, + "cut_record": 22380, + "exporter_stdout": "exported 27234 records, 636 frames, n 661 ZERO 0", + "live_temporaries_at_cut": [], + "negative_controls": [ + "omitted_ERASE", + "COPY_before_ERASE" + ], + "note": "No native checker run: exact exported scalar records and explicit frame IDs only.", + "ordinary_columns": 661, + "record_count": 27234, + "records_sha256": "ea44aa047a2a9cf034de8b56b2166c49cf2dbdf9cd9ed6a20299a4f2b05ef09a", + "schema_version": 1 +} diff --git a/research/r439-staged-retirement-boundary/OVERLAP.json b/research/r439-staged-retirement-boundary/OVERLAP.json new file mode 100644 index 0000000000..abf28c3127 --- /dev/null +++ b/research/r439-staged-retirement-boundary/OVERLAP.json @@ -0,0 +1,28 @@ +{ + "schema_version": 1, + "base_commit": "0b1cccf86e2f5132ed286a26ef0a681a495740ea", + "claim_url": "https://github.com/CrocSwap/integer-mult-bounds/discussions/1929#discussioncomment-18925854", + "cached_search": { + "searched_at": "2026-10-14T14:29:54.207295+00:00", + "terms": ["staged retirement", "staged isolation", "helper465", "B601", "frame507"], + "open_prs": {"records": 584, "fetched_at": "2026-10-14T14:27:47.108625+00:00", "complete_pagination": true}, + "discussions": {"records": 565, "fetched_at": "2026-10-14T14:29:09.251198+00:00", "complete_pagination": true}, + "local_records": 873, + "matches": 5, + "match_scope": "Two own-round coordination comments, PR1271 local README/TASK handoff, and this new TASK.", + "warnings": ["Offline cache can miss subsequent changes; no code-diff or arbitrary nested-file coverage.", "No matches is not a novelty certificate."] + }, + "targeted_live_all_state_searches": [ + {"query": "gh pr list --state all --search '\"helper465\"' --limit 30", "results": [{"pr": 1271, "state": "MERGED", "head": "3437f884a0282af6acf51a1d9ef052c3e09e697b"}]}, + {"query": "gh pr list --state all --search '\"helper468\"' --limit 30", "results": [{"pr": 1393, "state": "MERGED", "head": "548f96032c7203953bcf3a3458b92f59b3e9261d"}]} + ], + "nearest_work": [ + {"pr": 1128, "head": "df29b159239b79d7e451d6ddda826a73e0e50a67", "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/1128", "already_established": "Two-sided restoration/dirty-column boundary floor, six rank-seven survivors.", "new_here": "Source-bound arbitrary multi-frame exact-isolation continuation obstruction at helper465 cut10; does not claim the general information-access method."}, + {"pr": 1256, "head": "d6d5a994fcdcd8d04ec439ff988daa8f37b17ece", "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/1256", "already_established": "First-single-frame restoration exclusions and helper470 two-frame construction.", "new_here": "The helper465 staged block itself passes; a four-contact continuation obstruction is independent of its length or rational frame choices."}, + {"pr": 1271, "head": "3437f884a0282af6acf51a1d9ef052c3e09e697b", "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/1271", "already_established": "All713 B cuts; helper465 necessary window10–48, explicit completion handoff.", "new_here": "Any exact isolation at the first surviving cut must modify at least one of B48/B117/B493/B601. Unrestricted suffix completion remains open."}, + {"pr": 1393, "head": "548f96032c7203953bcf3a3458b92f59b3e9261d", "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/1393", "local_path": "research/r439-helper468-late-cut/README.md", "already_established": "Single-frame helper468 cut obstruction and general rank-eight floor after B88 MOVE.", "new_here": "Different helper and a changed, arbitrary multi-frame isolation hypothesis; no enlarged helper468 census."}, + {"pr": 1913, "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/1913", "already_established": "Earlier session two-writer helper absorption, frozen and not reused.", "new_here": "No absorption or copied predecessor implementation; source-bound staged terminal-H4 contact propagation."} + ], + "alternatives_not_pursued": "The draw's nonabelian-register suggestion has extensive overlap (PR1333/1414/1491/1541 and successors); no new toy alphabet or increased seed/domain census was submitted.", + "limits": "Targeted all-state searches supplement local merged-package reads but are not an exhaustive theorem-priority or diff search. Exact mathematical premises, not seed differences, define this contribution. Selected artifacts and all predecessors remain unchanged." +} diff --git a/research/r439-staged-retirement-boundary/README.md b/research/r439-staged-retirement-boundary/README.md new file mode 100644 index 0000000000..77c382d88c --- /dev/null +++ b/research/r439-staged-retirement-boundary/README.md @@ -0,0 +1,280 @@ +# R439: four retained contacts obstruct staged helper465 isolation + +**Scoped all-length interface obstruction; no new supplier or kappa.** +PR1271 leaves a legal width-seven suffix for helper465 at B cut10 open. A +four-ADD, two-frame isolation block does pass that cut's full dirty boundary. +Nevertheless, **every exact isolation block with the same boundary**, of any +length and using any rational frames or restored dirty workspace, must change +at least one of four later original contacts to admit the original target +endpoints. Merely reframing or adding scalar gates cannot repair them. + +This is stronger than failure of one proposed schedule. It is **not** an +impossibility theorem for arbitrary helper465 retirement: changed scalar +boundaries, contact removal/reordering, changed physical roles or new transport +are material escape routes. + +## Exact contract and four-contact theorem + +The input is the selected PR589 word on PR555, SHA256 +`e3e301e62bc2b41dbf1ceac0acf3d35824ebeab1848c5a2142d4577b109da52f`. +Keep its D, A, nine retained COPY/scatter/ERASE lifecycles and first ten B records +unchanged. **Cut10 is after B[9]**, with zero-based record indices. All copies +have been erased. Let `u` be the 661 independent original register inputs and +`w=M u` the current scalar state. No incoming helper is assumed clean. + +This is checked against the **actual pinned selected exporter**, not inferred +from a 661-column flattening. `literal_copies.py` runs it, decodes all27,234 +records, and replays the complete original scalar/frame-ID stream. The exporter +reuses physical temporary661 at frame0: each COPY is followed by its scatter +reads and ERASE before the next COPY. The nine retained sources472–480 are at +frames510–518, each of rank seven. COPY records are +`21816,21881,21938,21995,22052,22117,22182,22239,22296`; the corresponding ERASE +records are `21880,21937,21994,22051,22116,22181,22238,22295,22360`. Cut10 is after +record22380. **There are no live correlated temporary roles at this cut.** + +Only the earlier snapshot of source474 has coefficient one on original dirt +`u_465`; its lifetime is21938–21994. Each snapshot equals its retained ordinary +source's cut coordinate `w_472,...,w_480`, so each has coefficient zero on the +independent cut coordinate `w_465`. The ordinary retained sources remain in M; +they are not discarded or treated as clean. [COPY-LIFECYCLE.json](COPY-LIFECYCLE.json) +records both notions of coefficient, all source/temporary frames and lifetimes. + +An **exact isolation block** has this complete boundary: + +- helper465 becomes its original dirty input `u_465`; +- every other row loses precisely its coefficient of `u_465`, and every other + original-input coefficient is unchanged; +- any auxiliary roles start independently dirty and are restored, without + contaminating these outputs. + +Allow arbitrary finite reversible linear scalar circuits, arbitrary rational +common gate frames in Q^8 and monotone frame enlargement. Scalar XORs require +a common frame for both operands. There is no new COPY/ERASE, frame descent, +reset, clean allocation, free address map or free physical-role permutation. +Physical register identities and original target output frames are retained. +The intended helper endpoint is frame512 of rank seven; the obstruction below +does not even need to assume that successful endpoint. + +After this block, suppose the suffix retains these **contacts in this order**: + +| Original record | Actual ADD | Frame information propagates | +|---|---|---| +| B[48] | `163 ^= 48` | 163 to48 | +| B[117] | `48 ^= 5` | 48 to5 | +| B[493] | `5 ^= 243` | 5 to243 | +| B[601] | `111 ^= 243` | 243 to111 | + +Their frame assignments need not remain original. Any number of additional +scalar gates and frame enlargements may be interspersed. Other original +contacts may be changed or omitted. There can be no legal completion with +original target111's final frame525. + +### Proof + +Direct replay of the pinned prefix gives + +``` +w_0 = u_0, w_465 = u_465 + u_0, +dirty-column465 support = {163,381,465,474}, +current frame465 =507, current frame163 =0. +``` + +The required isolation row for physical target163 is therefore uniquely + +``` +w'_163 = w_163 + u_465 = w_163 + w_465 + w_0. +``` + +Uniqueness is in **independent cut coordinates**: the scalar prefix is an +invertible product of transvections after substituting its consumed snapshots. +In particular, the coefficient of cut-coordinate465 in this output is one. +Independent auxiliary dirt cannot remove that required coefficient. + +**Dependency/frame lemma.** In a finite common-frame scalar circuit, a nonzero +coefficient of input coordinate i at output j implies a chronological dependency +path from i to j. Every gate frame on that path contains its predecessor's +current frame. Without descent or uncharged transport, the output frame thus +contains the input frame. This follows by induction on scalar gates; cancellation +can remove paths, but a nonzero coefficient leaves at least one path. Extra +independent dirty inputs do not alter it. + +Apply this lemma to the isolation row: target163's frame contains frame507. +Frame507 contains the rational direction `e0=(1,0,0,0,0,0,0,0)` (its pinned +line0 is `2e0`). Each contact in the table forces both operands to a common +frame. Monotonicity therefore carries e0 through + +``` +163 --B48--> 48 --B117--> 5 --B493--> 243 --B601--> 111. +``` + +Frame525 is exactly the rank-seven hyperplane `x0=0`: every source basis vector +has first coordinate zero, and exact integer elimination gives rank seven. +It cannot contain e0. Consequently target111 cannot reach its required endpoint. +This proves the all-length statement, without enumerating possible isolation +blocks, auxiliary counts or rational gate frames. The argument concerns frames, +not whether scalar coefficients cancel later. + +The proof is written, not proof-assistant checked. Its general dependency lemma +is the standard information-access principle used by the credited boundary +predecessors; the new contribution is this staged-isolation implication and +source-bound four-contact obstruction, not a new general rank principle. + +## Scalar-positive construction and all-frame negative control + +The following block realizes the exact isolation boundary: + +``` +frame507: 465 ^= 0 +frame507: 163 ^= 465 +frame512: 381 ^= 465 +frame512: 474 ^= 465 +``` + +Among all six orders of the last three clears, precisely the two that clear +163 first are geometrically legal. Their purpose is a positive control: unlike +the earlier single-common-frame block, this staged boundary itself is feasible. +It does not certify its continuation. + +For a complete scalar control, algebraically track the removed helper's +non-dirty signal in the current active coordinates. This **ghost expression is +not a free physical register**: its actual reads are emitted and counted. Delete +13 later helper-writing ADDs. Replace the two helper reads by these scalar sums: + +- B[653], target163: registers `0,11,63,72,247,323,345,373,432`; +- C[583], donor offset5 into381: register `0`. + +The original prefix, four isolation ADDs and this fully emitted suffix use +**24,304 ADDs versus24,305**. Both forward and inverse scalar replays pass all +661 independent columns. All source/helper dirt is restored and every target +has the required increment. This is deliberately **not** called an improvement: +its geometry fails. + +A separate least-join calculation permits **every rational monotone reframing** +of that scalar suffix, ignoring even its original gate frames. It also grants +the entire isolation block for free except for target163's proved mandatory +frame507. The first forced endpoint violation is B[601]: target111 requires +rank eight, with cap rank seven. The four-edge path is a shortest chronological +contact path from163 to111 through that prefix. Later ghost donor permutations +cannot affect this earlier failure. Neither legality of a finite frame catalogue +nor a search over selected frame IDs is being mistaken for all-rational coverage. + +As a positive geometric countercontrol, allowing **all111 target endpoints to +be full rank eight** makes the complete emitted scalar word monotone-frame +legal. The resulting local bill is **3,085 paid children, rank mass5,239**, +including all nine rank-seven COPYs. The original bill is **2,920 children, +rank mass5,129**. This changed-endpoint control is not a supplier proposal; +relaxing only target111 is not claimed to repair every later obstruction. + +## Favorable paid screen, not an achieved profile + +The original helper465 frame dimensions are `0,1,4,6,7,8`; the isolated helper's +local path can be `0,1,4,7`. Granting all additional scalar, source-access, +restoration, transport and realization work for free gives local delta +`+H3-H2-2H1`. This optimistic grant is solely an impossibility screen. + +For the predecessor's two-slot planning model, consume an idle rank-seven slot, +return all eight coordinates of the old slot to its remainder `r in {2,4,6}`, +and retain every other paid child, including the nine COPY/ERASE lifecycles: + +``` +Delta H = H3-H2-2H1-H7+H_(r+8)-H_r. +``` + +Rank mass is unchanged and child count decreases by three. For `p=1-a` with +`024304 controls=13 no_new_kappa +``` + +The primary engine uses packed F2 rows and rational RREF. The second uses sets, +independent ghost updates and fraction-free integer elimination; it imports no +primary or predecessor implementation. They agree on the complete emitted +scalar-word digest and endpoint, not just a target sample. Separate code paths +are not independent human review. The primary recomputes every certificate field; +`--emit` prints a new receipt without overwriting any file. Tests cover receipt +mutations, source corruption and source-only isolated optimized relocation. +[VALIDATION.json](VALIDATION.json) records actually exercised commands. + +The13 semantic negatives omit each isolation ADD, corrupt a COPY snapshot, +omit a ghost donor or B601, remove each witness edge, change the separating +normal, or corrupt the pinned input. The copied-value lifecycle is checked as +an exact scalar snapshot contract; native COPY realization and reverse physical +routing are not claimed. The original source's notices and archives are unchanged. + +The literal lifecycle audit also rejects an omitted ERASE and a second COPY +before ERASE. It runs Dylan Crow's pinned exporter as a subprocess; neither +independent scalar/geometry engine imports predecessor executable code. + +## Scope, overlap and open next questions + +Base `0b1cccf86e2f5132ed286a26ef0a681a495740ea`; independent OS-random chooser seed +`494d0ed24f025eea9e623e001763c7c4`, bit-mechanisms. The complete unrerolled output +is [SELECTION.json](SELECTION.json). The selected conditional kappa remains +`836330098538459/500000000000000000`, with the complex supplier binding. + +The task is declared **changed** from the emitted H2/K card to the concrete +terminal-aware H4 handoff: PR1194 and successors already cover semantic D. +PR1256 proves first-single-frame exclusions and constructs helper470 retirement; +PR1271 supplies later-cut necessary windows but no helper465 completion. The +helper468 late-cut package concerns a different helper and explicitly leaves +staged mechanisms open. This result covers arbitrary multi-frame exact isolation +at the stated helper465 cut, but only continuations retaining the four contacts. +It does not close PR1271's unrestricted suffix question or repeat the earlier +round's two-writer helper absorption result. Exact heads, local/merged context +and overlap coverage are in SOURCES.json and OVERLAP.json. + +## Open next questions + +1. Can one of the four contacts be replaced or retimed while preserving all + dirty columns and pricing every changed frame? Begin with B[48]'s source48 + read; it connects the isolated target to the frame506 source block. The + blocker is a complete legal continuation, not another isolation-star search. +2. Can a coupled suffix delay isolation and thereby avoid the exact intermediate + boundary? Begin with a specified alternative target163 row at cut10 and its + target-output obligations. Its changed scalar interface, full paid profile, + hosting and precision must be proved; the current theorem does not exclude it. + +No native5/9/11-stage replay, hosted supplier, selected cold replay, all-size +compiler proof, precision/tape reduction, Lean theorem, CI success or new kappa +is asserted by this package. + +## Credit and disclosure + +Prepared for **Adam Gall (@adamgall)** with substantial **OpenAI Codex / GPT-6 +Astra** assistance in mathematics, implementation, verification and writing. +New material is Apache-2.0; no independent human proof review is claimed. + +Credit **Ali Romman** (PR1128 two-sided boundary and PR1043 earlier helper470 +deletion), **Ross Richardson** (PR1256 first-restoration access and staged470 +construction), **Philipp / @mightyOil** (PR1271 complete later-cut windows), +**Cinna Davis** (helper468 late-cut follow-up), **Sagar Thakrar** (PR1023 hosting +incentive and PR1062 working example), **DreamingOfClouds** (PR589), **eumemic** +(PR555/543), and the retained compiler/hosting lineage. No predecessor source +code is imported or modified; their general information-access methods and +fully specified source word are reused with attribution. diff --git a/research/r439-staged-retirement-boundary/SELECTION.json b/research/r439-staged-retirement-boundary/SELECTION.json new file mode 100644 index 0000000000..bc6c8f9486 --- /dev/null +++ b/research/r439-staged-retirement-boundary/SELECTION.json @@ -0,0 +1,45 @@ +{ + "seed": "494d0ed24f025eea9e623e001763c7c4", + "track": "bit-mechanisms", + "suggestions": [ + { + "task_id": "bit-helper-contract", + "scope_key": "3475f46c8358c6a9211b", + "question": "Can one precisely specified helper-mixing word satisfy a replacement for the inherited H2/K interface?", + "method": "Derive a replacement interface lemma and price its implementation.", + "starting_points": ["research/r439-bsection-stars-seed01/README.md", "research/r439-copy-path-sharing-barrier/README.md"], + "acceptance_gate": "A full boundary contract and paid profile; unchanged scalar counts alone are insufficient.", + "first_step": {"command": ["python3", "-B", "research/r439-bsection-stars-seed01/verify.py"], "expected": "PASS_R439_BSECTION_STARS", "inspect": "Compare the two false H2/K flags with the unchanged paid profile in its README.", "scope": "Positive control / source-bound orientation only; this is not a new construction or full cold replay."}, + "first_experiment": "Write one replacement H2/K implication for a single helper-star operation, then try to falsify it on dirty inputs.", + "bottleneck_link": "A legitimate replacement could admit a cheaper bit circuit; scalar savings alone do not alter the selected moment.", + "allowed_variations": ["Choose one helper-star or quartet instance; narrow to one boundary implication."], + "scope_change_triggers": ["Changing only source count or scalar addition count without an interface argument."], + "overlap_terms": ["H2_D_frame0_targets_from_helpers", "K_equals_D", "helper-star"], + "scope_rule": "If you change the card's premise, record scope_status=changed and explain why. A package metadata check cannot establish mathematical relevance." + }, + { + "task_id": "bit-new-register-model", + "scope_key": "7084092dd726e7ba1f2f", + "question": "Can an explicitly larger or nonabelian register model escape the scoped three-register obstruction?", + "method": "Derive a target-specific relaxation bound for that same explicit alphabet.", + "starting_points": ["research/bit-three-register-lower-bound/README.md", "certificates/selected-result.json"], + "acceptance_gate": "Name the changed hypothesis, all counted roles and a uniform identity; finite column tests alone do not certify it.", + "first_step": {"command": ["python3", "-B", "scripts/research_baseline.py"], "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", "inspect": "Read Model section 1 of the three-register bound and identify the exact excluded free operations.", "scope": "Positive control / source-bound orientation only; this is not a new construction or full cold replay."}, + "first_experiment": "Write a complete operation alphabet outside one named premise and price a baseline before searching identities.", + "bottleneck_link": "A small-width completed saving changes the bit primitive; a finite-address identity alone is insufficient.", + "allowed_variations": ["Choose a fixed larger register count or a specified nonabelian operation family."], + "scope_change_triggers": ["Remaining inside the already-excluded three-register abelian model."], + "overlap_terms": ["three-register", "nonabelian", "group algebra"], + "scope_rule": "If you change the card's premise, record scope_status=changed and explain why. A package metadata check cannot establish mathematical relevance." + } + ], + "base_commit": "0b1cccf86e2f5132ed286a26ef0a681a495740ea", + "catalog_assessed_on": "2026-10-13", + "priority_revision": 3, + "priority_log": "docs/research/research-priority-log.md", + "catalog_sha256": "6686ad58f1fbdbc87134a78901b60fd53a20d3984355e91defbbebc9e9fa8075", + "selected_record_sha256": "10b9e340fd8e354a37a0c4813c90e5de1dd42044b5f6aca4a3fc5a42b685fa32", + "selected": {"kappa": "836330098538459/500000000000000000", "review": "docs/research/community-batch1099-review.md", "source_manifest": "research/community-frontier1094-audit/SELECTED-SOURCE.json", "reproduce": "make frontier1094-verify"}, + "status": "SUGGESTIONS_ONLY_NOT_RESERVED", + "next_step": "Check live overlap, refine one question's object and domain, and record a bounded task card. A different seed or scope key is not evidence of novelty." +} diff --git a/research/r439-staged-retirement-boundary/SOURCES.json b/research/r439-staged-retirement-boundary/SOURCES.json new file mode 100644 index 0000000000..5f3ba0607b --- /dev/null +++ b/research/r439-staged-retirement-boundary/SOURCES.json @@ -0,0 +1,71 @@ +{ + "schema_version": 1, + "base_commit": "0b1cccf86e2f5132ed286a26ef0a681a495740ea", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "ae6a99f28aa468649eb66a361e764d769363bf11", + "sha256": "10b9e340fd8e354a37a0c4813c90e5de1dd42044b5f6aca4a3fc5a42b685fa32" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "06c96f5579bb67ed1b86d334e78fbed7da6945f1", + "sha256": "6686ad58f1fbdbc87134a78901b60fd53a20d3984355e91defbbebc9e9fa8075" + }, + { + "path": "research/bit-early-retirement-cut/README.md", + "usage": "input", + "git_blob": "4f3716685c7a22ec4c1b8a68c8beb69021acd0a9", + "sha256": "57b952674aefc3fb6287ceaab7c940c100916dba8ba97104e1838c785e3d8e9f" + }, + { + "path": "research/e8-bit-p111-tuned/tune/bitE8mut-p111-tuned.json.gz", + "usage": "input", + "git_blob": "85a4499bf9e4911a705d50567a2c2ef6cf23739a", + "sha256": "e3e301e62bc2b41dbf1ceac0acf3d35824ebeab1848c5a2142d4577b109da52f" + }, + { + "path": "research/e8-bit-carrier-skeleton/code/bit/export_records.py", + "usage": "input", + "git_blob": "3632d370486a02f5456f7643ced03f8c925b2350", + "sha256": "8a5999601f917dbb492bb9ae9a344611f18cc7cedc53dc3c76496a369e530eb3" + }, + { + "path": "research/r439-later-retirement-cuts/README.md", + "usage": "input", + "git_blob": "c2fec1d897075f65569dfcc34b39bc81c628a0ce", + "sha256": "807db75512c471253cd2af26839ca9acf70eaa3c7c374118bdd66ac0c413f0ca" + } + ], + "predecessors": [ + { + "pr": 589, + "head": "a5afc8c6169ea61ba7c51dfd3cade02cc7b13b46", + "author": "DreamingOfClouds, on eumemic's PR555/543", + "role": "Selected source word, original dirty interface and frame paths." + }, + { + "pr": 1128, + "head": "df29b159239b79d7e451d6ddda826a73e0e50a67", + "author": "Ali Romman", + "role": "Two-sided width-seven necessary condition and six survivors; not a new lemma here." + }, + { + "pr": 1256, + "head": "d6d5a994fcdcd8d04ec439ff988daa8f37b17ece", + "author": "Ross Richardson", + "role": "Information-access implication and helper470 staged construction; not combined." + }, + { + "pr": 1271, + "head": "3437f884a0282af6acf51a1d9ef052c3e09e697b", + "author": "Philipp (@mightyOil)", + "role": "Later-cut windows and explicit helper465 cut10 completion handoff." + } + ], + "selection_file": "SELECTION.json", + "source_implementation_reuse": "No predecessor executable is imported by either scalar/geometry engine. literal_copies.py executes the pinned selected exporter solely to inspect its actual record chronology; its original notices remain unchanged.", + "selected_exporter_binding": "The pinned exporter digest is also present at research/community-frontier1094-audit/SELECTED-SOURCE.json line524 at the exact task base." +} diff --git a/research/r439-staged-retirement-boundary/TASK.json b/research/r439-staged-retirement-boundary/TASK.json new file mode 100644 index 0000000000..201db3f7df --- /dev/null +++ b/research/r439-staged-retirement-boundary/TASK.json @@ -0,0 +1,79 @@ +{ + "schema_version": 1, + "task_id": "bit-helper-contract", + "priority_revision": 3, + "base_commit": "0b1cccf86e2f5132ed286a26ef0a681a495740ea", + "original_card": { + "id": "bit-helper-contract", + "question": "Can one precisely specified helper-mixing word satisfy a replacement for the inherited H2/K interface?", + "starting_points": [ + "research/r439-bsection-stars-seed01/README.md", + "research/r439-copy-path-sharing-barrier/README.md" + ], + "methods": [ + "Derive a replacement interface lemma and price its implementation.", + "Seek an exact dirty-input or chronological-cut counterexample to the proposed replacement." + ], + "acceptance_gate": "A full boundary contract and paid profile; unchanged scalar counts alone are insufficient.", + "first_step": { + "command": [ + "python3", + "-B", + "research/r439-bsection-stars-seed01/verify.py" + ], + "expected": "PASS_R439_BSECTION_STARS", + "inspect": "Compare the two false H2/K flags with the unchanged paid profile in its README.", + "scope": "Positive control / source-bound orientation only; this is not a new construction or full cold replay." + }, + "first_experiment": "Write one replacement H2/K implication for a single helper-star operation, then try to falsify it on dirty inputs.", + "bottleneck_link": "A legitimate replacement could admit a cheaper bit circuit; scalar savings alone do not alter the selected moment.", + "allowed_variations": [ + "Choose one helper-star or quartet instance; narrow to one boundary implication." + ], + "scope_change_triggers": [ + "Changing only source count or scalar addition count without an interface argument." + ], + "overlap_terms": [ + "H2_D_frame0_targets_from_helpers", + "K_equals_D", + "helper-star" + ] + }, + "scope_status": "changed", + "actual_scope": "All-length obstruction for every exact multi-frame helper465 isolation block at PR589 B cut10 followed by any monotone scalar suffix retaining four specified contacts B48/B117/B493/B601 in order. The block may use arbitrary restored dirty auxiliaries; frames range over all rational subspaces. A complete ghost-inlined word supplies a scalar-positive but geometric-negative control.", + "scope_change_reason": "The emitted H2/K question is already covered by PR1194 and successors. PR1271 explicitly leaves a legal fully priced suffix for helper465 at cut10 open. The staged boundary itself passed, so the investigation isolates a source-bound necessary continuation condition rather than falsely claiming unrestricted retirement impossible. This evidence-driven refinement keeps the selected word, helper and cut fixed.", + "bottleneck_link": "A genuine width-seven endpoint could fit the narrower idle windows motivating PR1128/1256. A local scalar identity alone cannot alter the supplier moment, and the complex supplier remains binding.", + "budget_minutes": 90, + "stop_rule": "First derive the favorable complete two-slot profile; then test staged restoration/isolation at the earliest open cut with exact binary state and rational frames. Stop construction if an all-length information-access obstruction applies; any pivot must preserve the selected-word question and explicitly change the hypothesis.", + "outcome": "negative-result", + "evidence": "CERTIFICATE.json: all661 dirty columns and inverse; four-contact separating-direction witness; all-rational least-join violation at B601;13 semantic negatives; complete optimistic budget and changed-endpoint positive control. COPY-LIFECYCLE.json: actual pinned exporter chronology, nine erased temp661 lifetimes and zero live copied roles at cut10. Independent set/integer replay and focused regression tests are registered; actual exercised commands are recorded in VALIDATION.json. Working example and baseline bindings passed during orientation; neither is a cold replay.", + "author": "Adam Gall", + "ai_assistance": "Substantial OpenAI Codex GPT-6 Astra assistance in research, proof, implementation, verification and writing; no independent human proof review claimed.", + "seed": "494d0ed24f025eea9e623e001763c7c4", + "scope_key": "3475f46c8358c6a9211b:PR589:h465:B10:staged-terminal-H4", + "predecessors": { + "1128": "df29b159239b79d7e451d6ddda826a73e0e50a67", + "1256": "d6d5a994fcdcd8d04ec439ff988daa8f37b17ece", + "1271": "3437f884a0282af6acf51a1d9ef052c3e09e697b" + }, + "changed_hypothesis": "Allow a staged multi-frame suffix instead of PR1256's first single-frame restoration block; retain PR589 D/A/scatter and first ten B records.", + "method_domain": "Exact F2 dirty rows and inverse dependencies for 661 registers; exact Q^8 frame containment; arbitrary dirty inputs and original target/source outputs. Initial candidate is one helper, not an enlarged random census.", + "optimistic_full_budget": "Grant additional synthesis, scalar, restoration and realization work for free only as a lower-bound screen. Return all eight old host coordinates, consume one rank-seven idle slot and retain every other child. Replace the helper path by its fully counted monotone increments. At a rank-four cut, the previously favorable ideal delta is e3-e2-2e1-e7+e_(r+8)-e_r for r in {2,4,6}; this is not a placement or admitted supplier.", + "success_or_falsification": "Success requires a legal complete suffix, full dirty endpoint and paid local invoice. Falsification is an exact unavoidable missing dependency or paid floor, with a positive relaxed control; scalar endpoint failure alone is not a universal result.", + "initial_question": "Can helper465 be retired at cut10 by a staged complete suffix? The unrestricted question remains open; the four-contact exact-isolation family is the falsified mechanism.", + "claim_url": "https://github.com/CrocSwap/integer-mult-bounds/discussions/1929#discussioncomment-18925854", + "open_questions": [ + { + "question": "Can one of B48/B117/B493/B601 be replaced or retimed to avoid the frame-propagation chain?", + "why_it_matters": "At least one retained contact must change after exact isolation; a different frame assignment alone cannot suffice.", + "first_step": "Price a replacement for B48's source48 read before attempting a complete continuation.", + "blocked_by": "Complete dirty-state restoration, all target endpoints, and the cost of every changed frame and transport." + }, + { + "question": "Can a coupled suffix avoid the exact-isolation intermediate boundary?", + "why_it_matters": "The theorem does not exclude delayed isolation or a different target163 cut row.", + "first_step": "Specify the alternative target163 row at cut10 and derive its complete continuation obligations.", + "blocked_by": "A new scalar interface, paid profile, physical hosting and precision admission." + } + ] +} diff --git a/research/r439-staged-retirement-boundary/VALIDATION.json b/research/r439-staged-retirement-boundary/VALIDATION.json new file mode 100644 index 0000000000..997150a72e --- /dev/null +++ b/research/r439-staged-retirement-boundary/VALIDATION.json @@ -0,0 +1,47 @@ +{ + "schema_version": 1, + "date": "2026-10-14", + "environment": { + "python": "3.12.12 (main, Jan 14 2026, 23:36:32) [Clang 21.1.4 ]", + "implementation": "CPython", + "platform": "macOS-27.0.1-arm64-arm-64bit", + "machine": "arm64", + "dependencies": "Python standard library; existing uv-provisioned interpreter. No native compilation." + }, + "final_registered_replay": { + "command": "uv run --python 3.12 --no-project python scripts/research_package.py --package research/r439-staged-retirement-boundary", + "exit_code": 0, + "observed_wall_seconds": 3.61, + "commands_executed": [ + "python -I -O -B research/r439-staged-retirement-boundary/verify.py", + "python -I -O -B research/r439-staged-retirement-boundary/independent.py", + "python -I -O -B research/r439-staged-retirement-boundary/literal_copies.py", + "python -I -O -B research/r439-staged-retirement-boundary/test_package.py" + ], + "stdout_markers": [ + "PASS_R439_STAGED_RETIREMENT columns=661 contacts=4 first_failure=B601 scalar_ADDs=24305->24304 controls=13 no_new_kappa", + "PASS_R439_STAGED_INDEPENDENT columns=661 ADDs=24304 copies=9 contacts=4 integer_ranks=4,7,8", + "PASS_R439_LITERAL_COPY_CUT copies=9 reused_temp=661 live_at_B10=0 controls=2 records=27234", + "PASS_REGISTERED_RESEARCH_PACKAGE research/r439-staged-retirement-boundary outcome=negative-result" + ], + "tests": {"passed": 5, "observed_seconds": 2.140, "coverage": ["Complete certificate and five field mutations", "Source-byte corruption", "Contact chronology and endpoint materiality", "Late ghost donor reordering preserves scalar output but not earlier geometry", "Source-only relocated three-engine replay under -I -O -S -B"]} + }, + "resolved_preflight_failures": [ + "TASK outcome initially used prose; changed to supported negative-result enumeration before any registered command executed.", + "README initially used a bold Open next questions label; changed to the required level-two heading before any registered command executed.", + "Certificate comparison initially sorted in-memory integer histogram keys differently from parsed string keys. Normalized JSON keys before typed canonical comparison; complete receipt regenerated in memory and final replay passed. This correction did not change the mathematical certificate." + ], + "orientation_commands_exercised": [ + {"command": "uv run --python 3.12 --no-project python -B research/r439-bsection-stars-seed01/verify.py", "output": "PASS_R439_BSECTION_STARS blocks=10 gates=388->254 ADDs=11783->11515->11500 guard_rejections=24->0 columns=661 controls=8 no_new_kappa"}, + {"command": "uv run --python 3.12 --no-project python -B scripts/research_baseline.py", "output_marker": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", "binding_primitive": "complex"} + ], + "evidence_sha256": { + "CERTIFICATE.json": "6bc20b9ab32e90c69403a1fba4201d4c66ddfc0f225d021191dac911a62a5d03", + "COPY-LIFECYCLE.json": "6a516f6b27ff8649520965743cc4a0e1dbd4906e4172e0584ca117133106c1a0", + "complete_emitted_scalar_word": "f88caf54498fbfc70cce5faece96c1f59b973464ded6d7447040a1b8a43e16f1", + "exported_original_249_records": "ea44aa047a2a9cf034de8b56b2166c49cf2dbdf9cd9ed6a20299a4f2b05ef09a" + }, + "not_exercised_or_claimed": [ + "Native C++5/9/11-stage checker or compiler", "Whole-owner/window hosting", "Selected make frontier1094-verify cold replay", "All-size compiler, reverse physical routing, analytic transfer or precision/tape admission", "Lean/proof-assistant verification or independent human review", "Remote CI results", "A legal original-endpoint retirement circuit or new kappa" + ] +} diff --git a/research/r439-staged-retirement-boundary/VERIFY.json b/research/r439-staged-retirement-boundary/VERIFY.json new file mode 100644 index 0000000000..6c86b529f3 --- /dev/null +++ b/research/r439-staged-retirement-boundary/VERIFY.json @@ -0,0 +1,40 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/bit-early-retirement-cut/README.md", + "research/e8-bit-carrier-skeleton/code/bit/export_records.py", + "research/e8-bit-p111-tuned/tune/bitE8mut-p111-tuned.json.gz", + "research/r439-later-retirement-cuts/README.md" + ], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-O", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "All661 dirty columns/inverse, source pins, exact staged boundary, all-rational least-join obstruction, full local budget and13 semantic controls." + }, + { + "argv": ["{python}", "-I", "-O", "-B", "{package}/independent.py"], + "timeout_seconds": 120, + "checks": "Separately implemented set-valued complete scalar replay and exact integer direction/rank/contact witnesses." + }, + { + "argv": ["{python}", "-I", "-O", "-B", "{package}/literal_copies.py"], + "timeout_seconds": 120, + "checks": "Actual pinned exporter27234-record replay; all9 reused-temp lifetimes, no live correlated COPY at cut10, and2 lifecycle corruption controls." + }, + { + "argv": ["{python}", "-I", "-O", "-B", "{package}/test_package.py"], + "timeout_seconds": 240, + "checks": "Five focused regressions including certificate/source corruption, material contact order, late donor order and source-only isolated optimized relocation." + } + ] +} diff --git a/research/r439-staged-retirement-boundary/independent.py b/research/r439-staged-retirement-boundary/independent.py new file mode 100644 index 0000000000..11e0759cde --- /dev/null +++ b/research/r439-staged-retirement-boundary/independent.py @@ -0,0 +1,144 @@ +# SPDX-License-Identifier: Apache-2.0 +"""Set-valued scalar replay and integer-normal proof check; no primary imports.""" +import gzip +import hashlib +import json +from math import gcd +from pathlib import Path + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +WORD = "research/e8-bit-p111-tuned/tune/bitE8mut-p111-tuned.json.gz" +PIN = "e3e301e62bc2b41dbf1ceac0acf3d35824ebeab1848c5a2142d4577b109da52f" + + +def check(value, message): + if not value: + raise ValueError(message) + + +def integer_rank(vectors): + pivots = {} + for vector in vectors: + row = list(vector) + for column in sorted(pivots): + pivot = pivots[column] + if row[column]: + a, b = pivot[column], row[column] + row = [a * x - b * y for x, y in zip(row, pivot)] + divisor = 0 + for x in row: + divisor = gcd(divisor, abs(x)) + if divisor: + row = [x // divisor for x in row] + leading = next((i for i, x in enumerate(row) if x), None) + if leading is not None: + pivots[leading] = row + return len(pivots) + + +def run(): + raw = (ROOT / WORD).read_bytes() + check(hashlib.sha256(raw).hexdigest() == PIN, "source bytes") + w = json.loads(gzip.decompress(raw)) + receipt = json.loads((HERE / "CERTIFICATE.json").read_text()) + n, v = 2 * w["v"] + w["R"], w["v"] + state = [{i} for i in range(n)] + scalar_word = [] + frame_ids = w["start"][:] + for section in ("D", "A"): + for i, (f, t, donors) in enumerate(w[section]): + for j, s in enumerate(donors): + state[t].symmetric_difference_update(state[s]) + frame_ids[t] = frame_ids[s] = f + scalar_word.append([section, i, j, f, t, s]) + copies = {} + check([integer_rank([w["lines"][j] for j in w["frames"][frame_ids[r]]]) for r in w["ret"]] == [7] * 9, + "COPY ranks") + for i, r in enumerate(w["ret"]): + check(n not in copies, "no live correlated temporary before COPY") + copies[n] = set(state[r]) + for t, totals in enumerate(w["scatter"]): + if i in totals: + state[v + t].symmetric_difference_update(copies[n]) + scalar_word.append(["scatter", t, totals.index(i), 0, v + t, r]) + check(copies.pop(n) == state[r], "dirty ERASE contract") + check(not copies, "copy lifecycle closed") + for i, (f, t, donors) in enumerate(w["B"][:10]): + for j, s in enumerate(donors): + state[t].symmetric_difference_update(state[s]) + frame_ids[t] = frame_ids[s] = f + scalar_word.append(["B", i, j, f, t, s]) + cut = [set(row) for row in state] + check(cut[465] == {0, 465} and cut[0] == {0}, "independent restoration equation") + check([r for r in range(n) if 465 in cut[r]] == [163, 381, 465, 474], "dirty occurrences") + check(frame_ids[465] == 507 and frame_ids[163] == 0, "cut frames") + # Independently multiply the claimed isolation row by the cut matrix. + check(cut[163] ^ cut[465] ^ cut[0] == cut[163] ^ {465}, "mandatory independent cut coordinate") + stage = [(507, 465, 0), (507, 163, 465), (512, 381, 465), (512, 474, 465)] + for i, (f, t, s) in enumerate(stage): + state[t].symmetric_difference_update(state[s]) + scalar_word.append(["isolation", i, 0, f, t, s]) + for r in range(n): + check(state[r] == ({465} if r == 465 else cut[r] - {465}), "full isolation state") + # A set-valued ghost, updated directly under physical transvections. + signal = {0} + inlined = [] + dropped = 0 + for section, start in (("B", 10), ("C", 0)): + for i, (f, t, donors) in enumerate(w[section]): + if i < start: + continue + for j, s in enumerate(donors): + if t == 465: + signal.symmetric_difference_update({s}) + dropped += 1 + continue + sources = sorted(signal) if s == 465 else [s] + check(t not in sources, "active inlining reversible") + if s == 465: + inlined.append((section, i, t, sources)) + for donor in sources: + state[t].symmetric_difference_update(state[donor]) + if t in signal: + signal.symmetric_difference_update({donor}) + scalar_word.append([section, i, j, f, t, donor]) + check(not signal, "helper signal restored") + for r in range(n): + desired = {r, r - v} if v <= r < 2 * v else {r} + check(state[r] == desired, "complete set-valued endpoint") + check(len(scalar_word) == 24304 and dropped == 13, "full scalar invoice") + encoding = json.dumps(scalar_word, sort_keys=True, separators=(",", ":")).encode() + check(hashlib.sha256(encoding).hexdigest() == receipt["complete_scalar_word_sha256"], "complete word identity") + check(inlined == [("B", 653, 163, [0, 11, 63, 72, 247, 323, 345, 373, 432]), + ("C", 583, 381, [0])], "inlined donor lists") + # Proof geometry uses only integral vectors: e0 belongs to507 and normal e0* + # annihilates525. Seven independent rows in525 make the rank-eight witness exact. + plane507 = [w["lines"][i] for i in w["frames"][507]] + plane525 = [w["lines"][i] for i in w["frames"][525]] + check([2, 0, 0, 0, 0, 0, 0, 0] in plane507, "separating vector present") + check(all(row[0] == 0 for row in plane525), "normal annihilation") + check(integer_rank(plane507) == 4 and integer_rank(plane525) == 7 and + integer_rank(plane525 + [[1, 0, 0, 0, 0, 0, 0, 0]]) == 8, "integer rank witnesses") + chain = [(48, 163, 48), (117, 48, 5), (493, 5, 243), (601, 243, 111)] + for i, a, b in chain: + _, t, ss = w["B"][i] + check((t == a and b in ss) or (t == b and a in ss), "original contact pin") + # Independent one-direction chronological reachability, not rational joins. + distance = {163: 0} + for section, i, _, _, t, s in scalar_word: + if section != "B" or not 10 <= i <= 601: + continue + dt, ds = distance.get(t, 10**6), distance.get(s, 10**6) + if dt < 10**6: + distance[s] = min(ds, dt + 1) + if ds < 10**6: + distance[t] = min(dt, ds + 1) + check(distance[111] == 4, "four-contact temporal distance") + check(receipt["first_least_join_failure"]["index"] == 601 and receipt["cap_frame"] == 525, + "primary claim binding") + print("PASS_R439_STAGED_INDEPENDENT columns=661 ADDs=24304 copies=9 contacts=4 integer_ranks=4,7,8") + + +if __name__ == "__main__": + run() diff --git a/research/r439-staged-retirement-boundary/literal_copies.py b/research/r439-staged-retirement-boundary/literal_copies.py new file mode 100644 index 0000000000..6393fe1762 --- /dev/null +++ b/research/r439-staged-retirement-boundary/literal_copies.py @@ -0,0 +1,121 @@ +# SPDX-License-Identifier: Apache-2.0 +"""Replay the pinned selected exporter, including its reused correlated temp661.""" +import argparse +import gzip +import hashlib +import json +from pathlib import Path +import struct +import subprocess +import sys +import tempfile + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +EXPORTER = "research/e8-bit-carrier-skeleton/code/bit/export_records.py" +WORD = "research/e8-bit-p111-tuned/tune/bitE8mut-p111-tuned.json.gz" +PINS = {EXPORTER: "8a5999601f917dbb492bb9ae9a344611f18cc7cedc53dc3c76496a369e530eb3", + WORD: "e3e301e62bc2b41dbf1ceac0acf3d35824ebeab1848c5a2142d4577b109da52f"} + + +def require(ok, message): + if not ok: + raise ValueError(message) + + +def replay(records, word): + n, v = 2 * word["v"] + word["R"], word["v"] + values = {r: 1 << r for r in range(n)} + frames = dict(enumerate(word["start"])) + live, lifetimes = {}, [] + b_adds = 0 + cut = None + for index, record in enumerate(records): + op, x, y, z, f, phase = record + if op == 0: + require(frames.get(x) == y, "MOVE source frame") + frames[x] = z + elif op == 1: + require(x in values and y in values, "ADD missing role or erased copy") + require(frames[x] == f and frames[y] == f, "literal common frame") + values[x] ^= values[y] + if phase == 4: + b_adds += 1 + if b_adds == 10: + require(not live and len(values) == n, "correlated temp live at cut10") + cut = dict(values) + cut_record = index + elif op == 2: + require(y not in values and y not in live, "COPY overwrites live correlated role") + require(frames[x] == z and f == 0, "COPY source/temporary frames") + values[y], frames[y] = values[x], f + life = {"source": x, "temporary": y, "source_frame": z, "temporary_frame": f, + "paid_rank": phase, "copy_record": index, "original_u465_coefficient": (values[x] >> 465) & 1} + live[y] = (life, values[y]) + elif op == 3: + require(y in live and values[y] == values[x], "ERASE correlated value mismatch") + life, snapshot = live.pop(y) + life["erase_record"] = index + lifetimes.append((life, snapshot)) + del values[y] + del frames[y] + else: + raise ValueError("unknown record opcode") + require(cut is not None and not live and len(lifetimes) == 9, "literal coverage") + for life, snapshot in lifetimes: + # B[0:10] only writes targets: each retained source is exactly its + # independent ordinary cut coordinate, not a new independent copy. + require(snapshot == cut[life["source"]], "retained source changed before cut") + life["cut_coordinate_support"] = [life["source"]] + life["cut_coordinate465_coefficient"] = int(life["source"] == 465) + require(life["erase_record"] < cut_record, "late ERASE") + for r in range(n): + expected = (1 << r) ^ ((1 << (r - v)) if v <= r < 2 * v else 0) + require(values[r] == expected and frames[r] == word["final"][r], "literal baseline endpoint") + return {"schema_version": 1, "record_count": len(records), "ordinary_columns": n, + "cut_after_B_adds": 10, "cut_record": cut_record, "live_temporaries_at_cut": [], + "copy_lifetimes": [life for life, _ in lifetimes], + "note": "No native checker run: exact exported scalar records and explicit frame IDs only."} + + +def compute(root=ROOT): + for path, pin in PINS.items(): + require(hashlib.sha256((root / path).read_bytes()).hexdigest() == pin, "literal source hash") + word = json.loads(gzip.decompress((root / WORD).read_bytes())) + with tempfile.TemporaryDirectory(prefix="r439-copy-cut-") as work: + completed = subprocess.run([sys.executable, "-I", "-B", str(root / EXPORTER), str(root / WORD), work], + check=True, capture_output=True, text=True, timeout=120) + data = (Path(work) / "249-records.bin").read_bytes() + require(len(data) % 24 == 0, "record width") + records = list(struct.iter_unpack("<6i", data)) + result = replay(records, word) + result["exporter_stdout"] = completed.stdout.strip() + result["records_sha256"] = hashlib.sha256(data).hexdigest() + controls = [] + first_erase = next(i for i, record in enumerate(records) if record[0] == 3) + for label, bad in (("omitted_ERASE", records[:first_erase] + records[first_erase + 1:]), + ("COPY_before_ERASE", records[:first_erase] + [records[next(i for i, r in enumerate(records) if i > first_erase and r[0] == 2)]] + records[first_erase:])): + try: + replay(bad, word) + except ValueError: + controls.append(label) + else: + raise ValueError("lifecycle control accepted: " + label) + result["negative_controls"] = controls + return result + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument("--emit", action="store_true") + args = parser.parse_args() + result = compute() + if args.emit: + print(json.dumps(result, indent=2, sort_keys=True)) + else: + require(result == json.loads((HERE / "COPY-LIFECYCLE.json").read_text()), "lifecycle receipt mismatch") + print("PASS_R439_LITERAL_COPY_CUT copies=9 reused_temp=661 live_at_B10=0 controls=2 records=27234") + + +if __name__ == "__main__": + main() diff --git a/research/r439-staged-retirement-boundary/test_package.py b/research/r439-staged-retirement-boundary/test_package.py new file mode 100644 index 0000000000..a29f7785e8 --- /dev/null +++ b/research/r439-staged-retirement-boundary/test_package.py @@ -0,0 +1,93 @@ +# SPDX-License-Identifier: Apache-2.0 +"""Focused package/receipt tests, not a repository-wide suite.""" +import copy +import importlib.util +import json +from pathlib import Path +import shutil +import subprocess +import sys +import tempfile +import unittest + +HERE = Path(__file__).resolve().parent +spec = importlib.util.spec_from_file_location("staged_retirement", HERE / "verify.py") +V = importlib.util.module_from_spec(spec) +spec.loader.exec_module(V) + + +class PackageTests(unittest.TestCase): + @classmethod + def setUpClass(cls): + cls.word = V.load() + cls.receipt = json.loads((HERE / "CERTIFICATE.json").read_text()) + cls.actual = V.derive(cls.word) + + def test_complete_receipt_and_tampering(self): + V.verify_receipt(self.actual, self.receipt) + for key, value in (("complete_scalar_adds", 24303), ("copies_erased_before_cut", 8), + ("four_contact_witness", []), ("new_kappa", True)): + wrong = copy.deepcopy(self.receipt) + wrong[key] = value + with self.assertRaisesRegex(ValueError, "certificate mismatch"): + V.verify_receipt(self.actual, wrong) + wrong = copy.deepcopy(self.receipt) + wrong["first_least_join_failure"]["required_rank"] = 7 + with self.assertRaisesRegex(ValueError, "certificate mismatch"): + V.verify_receipt(self.actual, wrong) + + def test_source_corruption(self): + raw = (V.ROOT / V.WORD).read_bytes() + with self.assertRaisesRegex(ValueError, "source hash"): + V.authenticated_word(raw[:-1] + bytes([raw[-1] ^ 1])) + + def test_contact_order_and_endpoint_are_material(self): + chain = list(V.CHAIN) + chain[1], chain[2] = chain[2], chain[1] + with self.assertRaisesRegex(ValueError, "chronology/connectivity"): + V.check_chain(self.word, chain) + changed = copy.deepcopy(self.word) + changed["final"][111] = 1 + with self.assertRaisesRegex(ValueError, "annihilate"): + V.check_chain(changed) + + def test_late_donor_order_cannot_repair_earlier_failure(self): + w = self.word + fb = [V.basis([w["lines"][i] for i in frame]) for frame in w["frames"]] + rows, frames, _, _, _, _ = V.prefix(w, fb) + stage = [("isolation", i, 0, f, t, s) for i, (f, t, s) in enumerate(V.STAGE)] + isolated = V.execute(rows, stage) + tail, _, _ = V.inlined_suffix(w) + locations = [i for i, gate in enumerate(tail) if gate[0] == "B" and gate[1] == 653 and gate[2] == 0] + self.assertEqual(len(locations), 9) + changed = tail[:] + for i, gate in zip(locations, reversed([tail[i] for i in locations])): + changed[i] = gate + self.assertEqual(V.execute(isolated, changed), V.expected_rows(w)) + initial = [fb[f] for f in frames] + initial[163] = V.join(initial[163], fb[507]) + initial[465] = fb[512] + failure, _, _ = V.least_joins(w, fb, initial, changed) + self.assertEqual((failure["index"], failure["failed_register"]), (601, 111)) + + def test_isolated_source_only_export(self): + with tempfile.TemporaryDirectory(prefix="staged-retirement-export-") as temporary: + root = Path(temporary) + destination = root / "research" / HERE.name + shutil.copytree(HERE, destination, ignore=shutil.ignore_patterns("__pycache__")) + manifest = json.loads((HERE / "SOURCES.json").read_text()) + for item in manifest["files"]: + if item["usage"] == "input": + source, target = V.ROOT / item["path"], root / item["path"] + target.parent.mkdir(parents=True, exist_ok=True) + shutil.copyfile(source, target) + for script, marker in (("verify.py", "PASS_R439_STAGED_RETIREMENT"), + ("independent.py", "PASS_R439_STAGED_INDEPENDENT"), + ("literal_copies.py", "PASS_R439_LITERAL_COPY_CUT")): + completed = subprocess.run([sys.executable, "-I", "-O", "-S", "-B", str(destination / script)], + cwd=root, capture_output=True, text=True, timeout=120, check=True) + self.assertIn(marker, completed.stdout) + + +if __name__ == "__main__": + unittest.main(verbosity=2) diff --git a/research/r439-staged-retirement-boundary/verify.py b/research/r439-staged-retirement-boundary/verify.py new file mode 100644 index 0000000000..70bc0b43f9 --- /dev/null +++ b/research/r439-staged-retirement-boundary/verify.py @@ -0,0 +1,424 @@ +# SPDX-License-Identifier: Apache-2.0 +"""Source-bound staged-isolation obstruction. Adam Gall, with OpenAI assistance. + +No predecessor executable is imported. Acceptance uses integers/Fractions only. +""" +import argparse +from collections import Counter +from fractions import Fraction +from functools import lru_cache +import gzip +import hashlib +import itertools +import json +from math import isqrt +from pathlib import Path + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +WORD = "research/e8-bit-p111-tuned/tune/bitE8mut-p111-tuned.json.gz" +WORD_SHA256 = "e3e301e62bc2b41dbf1ceac0acf3d35824ebeab1848c5a2142d4577b109da52f" +HELPER, TARGET, CUT = 465, 163, 10 +STAGE = [(507, 465, 0), (507, 163, 465), (512, 381, 465), (512, 474, 465)] +CHAIN = [(48, 163, 48), (117, 48, 5), (493, 5, 243), (601, 243, 111)] + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def bits(value): + while value: + bit = value & -value + yield bit.bit_length() - 1 + value ^= bit + + +def digest(value): + return hashlib.sha256(json.dumps(value, sort_keys=True, separators=(",", ":")).encode()).hexdigest() + + +def authenticated_word(raw): + require(hashlib.sha256(raw).hexdigest() == WORD_SHA256, "word source hash") + return json.loads(gzip.decompress(raw)) + + +def load(root=ROOT): + manifest = json.loads((HERE / "SOURCES.json").read_text()) + for item in manifest["files"]: + if item["usage"] == "input": + raw = (root / item["path"]).read_bytes() + require(hashlib.sha256(raw).hexdigest() == item["sha256"], "source hash: " + item["path"]) + return authenticated_word((root / WORD).read_bytes()) + + +def basis(vectors): + """Canonical rational RREF; dimension is eight, never reduced modulo two.""" + rows = [list(map(Fraction, row)) for row in vectors] + pivot = 0 + for column in range(8): + selected = next((i for i in range(pivot, len(rows)) if rows[i][column]), None) + if selected is None: + continue + rows[pivot], rows[selected] = rows[selected], rows[pivot] + divisor = rows[pivot][column] + rows[pivot] = [value / divisor for value in rows[pivot]] + for i, row in enumerate(rows): + if i != pivot and row[column]: + multiplier = row[column] + rows[i] = [x - multiplier * y for x, y in zip(row, rows[pivot])] + pivot += 1 + if pivot == 8: + break + return tuple(tuple(row) for row in rows[:pivot]) + + +@lru_cache(maxsize=None) +def join(left, right): + if left == right: + return left + return basis(left + right) + + +def contains(outer, inner): + return join(outer, inner) == outer + + +def elementary(word, section, start=0): + for index, (frame, target, donors) in enumerate(word[section]): + if index < start: + continue + require(target not in donors and len(donors) == len(set(donors)), "non-transvection source record") + for offset, source in enumerate(donors): + yield (section, index, offset, frame, target, source) + + +def execute(rows, gates): + result = rows[:] + for gate in gates: + target, source = gate[-2:] + require(target != source, "self ADD") + result[target] ^= result[source] + return result + + +def expected_rows(word): + v, n = word["v"], 2 * word["v"] + word["R"] + return [(1 << r) ^ ((1 << (r - v)) if v <= r < 2 * v else 0) for r in range(n)] + + +def prefix(word, frame_bases, corrupt_copy=False): + """Actual retained snapshot lifecycle; scalar flattening only after ERASE.""" + v, n = word["v"], 2 * word["v"] + word["R"] + rows, frames = [1 << r for r in range(n)], word["start"][:] + gates = [] + histogram = Counter() + move_count = 0 + for section in ("D", "A"): + for gate in elementary(word, section): + _, _, _, f, t, s = gate + for r in (t, s): + require(contains(frame_bases[f], frame_bases[frames[r]]), "prefix monotonicity") + if frames[r] != f: + increment = len(frame_bases[f]) - len(frame_bases[frames[r]]) + require(increment > 0, "prefix zero-rank frame alias") + histogram[increment] += 1 + move_count += 1 + frames[r] = f + rows[t] ^= rows[s] + gates.append(gate) + copy_ranks = [len(frame_bases[frames[r]]) for r in word["ret"]] + histogram.update(copy_ranks) + # Match the pinned exporter's retained-major chronology. The same temp661 + # is created, read and erased once per retained source, before the next COPY. + live = {} + for total, source in enumerate(word["ret"]): + require(n not in live, "COPY over live temporary") + live[n] = rows[source] + for target, totals in enumerate(word["scatter"]): + if total in totals: + value = live[n] ^ ((1 << 0) if corrupt_copy and total == 0 else 0) + rows[v + target] ^= value + gates.append(("scatter", target, totals.index(total), 0, v + target, source)) + require(live.pop(n) == rows[source], "ERASE source changed") + require(not live, "live copy at retirement cut") + for gate in elementary(word, "B"): + if gate[1] >= CUT: + break + _, _, _, f, t, s = gate + for r in (t, s): + require(contains(frame_bases[f], frame_bases[frames[r]]), "B-prefix monotonicity") + if frames[r] != f: + histogram[len(frame_bases[f]) - len(frame_bases[frames[r]])] += 1 + move_count += 1 + frames[r] = f + rows[t] ^= rows[s] + gates.append(gate) + return rows, frames, gates, histogram, move_count, copy_ranks + + +def isolation_boundary(rows): + return [(1 << HELPER) if r == HELPER else value ^ (((value >> HELPER) & 1) << HELPER) + for r, value in enumerate(rows)] + + +def inlined_suffix(word): + """Track the removed helper's non-dirty signal in current active coordinates. + + A ghost expression is an algebraic calculation, NOT a free physical role. + Every actual donor read is emitted as one charged scalar ADD. + """ + ghost = 1 << 0 + gates, dropped, inlined = [], [], [] + for section, start in (("B", CUT), ("C", 0)): + for gate in elementary(word, section, start): + _, index, offset, frame, target, source = gate + if target == HELPER: + ghost ^= 1 << source + dropped.append(list(gate)) + continue + donors = list(bits(ghost)) if source == HELPER else [source] + require(target not in donors, "noninvertible ghost substitution") + if source == HELPER: + inlined.append({"section": section, "index": index, "donor_offset": offset, + "target": target, "donors": donors}) + for donor in donors: + gates.append((section, index, offset, frame, target, donor)) + if ghost >> target & 1: + ghost ^= 1 << donor + require(ghost == 0, "nonzero final ghost") + return gates, dropped, inlined + + +def least_joins(word, frame_bases, initial, gates, caps=None): + """All-rational monotone lower envelope, ignoring all old suffix gate frames.""" + current = initial[:] + if caps is None: + caps = [frame_bases[f] for f in word["final"]] + caps[HELPER] = frame_bases[512] + histogram = Counter() + for ordinal, gate in enumerate(gates): + section, index, offset, _, target, source = gate + common = join(current[target], current[source]) + for r in (target, source): + if current[r] != common: + histogram[len(common) - len(current[r])] += 1 + current[r] = common + if not contains(caps[r], common): + return {"section": section, "index": index, "donor_offset": offset, + "ordinal": ordinal, "target": target, "source": source, + "failed_register": r, "required_rank": len(common), + "cap_rank": len(caps[r])}, current, histogram + for r in range(len(current)): + require(contains(caps[r], current[r]), "final closure incompatibility") + if caps[r] != current[r]: + histogram[len(caps[r]) - len(current[r])] += 1 + current[r] = caps[r] + return None, current, histogram + + +def shortest_contact_path(gates, start, finish, last_index): + paths = {start: []} + for section, index, offset, _, t, s in gates: + if section != "B" or index > last_index: + break + before_t, before_s = paths.get(t), paths.get(s) + if before_t is not None and (before_s is None or len(before_t) + 1 < len(before_s)): + paths[s] = before_t + [[index, offset, t, s]] + if before_s is not None and (before_t is None or len(before_s) + 1 < len(before_t)): + paths[t] = before_s + [[index, offset, s, t]] + return paths.get(finish) + + +def check_chain(word, chain=CHAIN, normal=(1, 0, 0, 0, 0, 0, 0, 0)): + position, previous = TARGET, CUT - 1 + for index, source, destination in chain: + require(index > previous and source == position, "chain chronology/connectivity") + _, target, donors = word["B"][index] + require((target == source and destination in donors) or + (target == destination and source in donors), "chain source contact") + previous, position = index, destination + require(position == 111, "chain terminal role") + dot = lambda row: sum(a * b for a, b in zip(normal, row)) + require(any(dot(word["lines"][i]) for i in word["frames"][507]), "missing separating direction") + require(all(dot(word["lines"][i]) == 0 for i in word["frames"][word["final"][111]]), + "terminal normal does not annihilate cap") + + +def sqrt_interval(number, scale=10**40): + lower = isqrt(number * scale * scale) + upper = lower if lower * lower == number * scale * scale else lower + 1 + return Fraction(lower, scale), Fraction(upper, scale) + + +def budget(): + result = [] + for remainder in (2, 4, 6): + delta = Counter({3: 1, 2: -1, 1: -2, 7: -1}) + delta[remainder + 8] += 1 + delta[remainder] -= 1 + require(sum(rank * count for rank, count in delta.items()) == 0, "optimistic rank conservation") + require(sum(delta.values()) == -3, "optimistic child-count delta") + low = high = Fraction(0) + for rank, count in delta.items(): + left, right = sqrt_interval(rank) + low += count * (left if count > 0 else right) + high += count * (right if count > 0 else left) + require(high < 0, "square-root moment control") + result.append({"old_remainder": remainder, "histogram_delta": dict(sorted(delta.items())), + "rank_mass_delta": 0, "child_count_delta": -3, + "p_half_interval": [str(low), str(high)]}) + return result + + +def expect_failure(action, name): + try: + action() + except ValueError: + return name + raise ValueError("control accepted: " + name) + + +def derive(word): + v, n = word["v"], 2 * word["v"] + word["R"] + require((v, n) == (111, 661), "source dimensions") + fb = [basis([word["lines"][i] for i in frame]) for frame in word["frames"]] + rows, frames, prefix_gates, prefix_hist, prefix_moves, copy_ranks = prefix(word, fb) + require(rows[HELPER] == (1 << HELPER) ^ 1, "cut helper signal") + dirt = [r for r, value in enumerate(rows) if value >> HELPER & 1] + require(dirt == [163, 381, 465, 474], "cut dirty support") + require(frames[HELPER] == 507 and frames[TARGET] == 0, "cut frame binding") + inverse = [1 << r for r in range(n)] + inverse = execute(inverse, reversed(prefix_gates)) + require(inverse[HELPER] == (1 << HELPER) ^ 1, "restoration covector") + # Target163 must acquire the independent current coordinate465. + isolation_cut_row = (1 << TARGET) ^ inverse[HELPER] + require(list(bits(isolation_cut_row)) == [0, 163, 465], "mandatory target dependency") + baseline_tail = list(elementary(word, "B", CUT)) + list(elementary(word, "C")) + require(execute(rows, baseline_tail) == expected_rows(word), "baseline complete scalar endpoint") + baseline_frames = word["start"][:] + baseline_hist = Counter(copy_ranks) + helper_path = [len(fb[baseline_frames[HELPER]])] + for section in ("D", "A", "B", "C"): + for _, _, _, frame, target, source in elementary(word, section): + for r in (target, source): + require(contains(fb[frame], fb[baseline_frames[r]]), "baseline frame legality") + if frame != baseline_frames[r]: + baseline_hist[len(fb[frame]) - len(fb[baseline_frames[r]])] += 1 + baseline_frames[r] = frame + if r == HELPER: + helper_path.append(len(fb[frame])) + for r, final in enumerate(word["final"]): + require(contains(fb[final], fb[baseline_frames[r]]), "baseline final frame") + if final != baseline_frames[r]: + baseline_hist[len(fb[final]) - len(fb[baseline_frames[r]])] += 1 + if r == HELPER: + helper_path.append(len(fb[final])) + require(helper_path == [0, 1, 4, 6, 7, 8], "baseline helper path") + require(sum(baseline_hist.values()) == 2920 and + sum(rank * count for rank, count in baseline_hist.items()) == 5129, + "baseline complete local profile") + stage_gates = [("isolation", i, 0, f, t, s) for i, (f, t, s) in enumerate(STAGE)] + isolated = execute(rows, stage_gates) + require(isolated == isolation_boundary(rows), "exact staged isolation boundary") + tail, dropped, inlined = inlined_suffix(word) + complete = prefix_gates + stage_gates + tail + require(execute(isolated, tail) == expected_rows(word), "complete inlined scalar endpoint") + require(execute(expected_rows(word), reversed(complete)) == [1 << r for r in range(n)], "complete inverse endpoint") + require(all(HELPER not in gate[-2:] for gate in tail), "retired role reused") + # Exact legal stage controls: only the two orders clearing target163 first. + stage_orders = [] + for order in itertools.permutations((163, 381, 474)): + gates = [("isolation", 0, 0, 0, HELPER, 0)] + [ + ("isolation", i + 1, 0, 0, r, HELPER) for i, r in enumerate(order)] + failure, _, _ = least_joins(word, fb, [fb[f] for f in frames], gates) + stage_orders.append({"order": list(order), "legal": failure is None}) + require(sum(item["legal"] for item in stage_orders) == 2, "stage order classification") + # A lower bound for EVERY exact isolation block, not just the four ADDs. + relaxed_start = [fb[f] for f in frames] + relaxed_start[TARGET] = join(relaxed_start[TARGET], fb[507]) + # This endpoint is granted for free; h is never touched again in this tail. + relaxed_start[HELPER] = fb[512] + failure, _, _ = least_joins(word, fb, relaxed_start, tail) + require(failure is not None and (failure["section"], failure["index"], failure["failed_register"], + failure["required_rank"]) == ("B", 601, 111, 8), "least-join obstruction") + check_chain(word) + path = shortest_contact_path(tail, TARGET, 111, 601) + require(path is not None and len(path) == 4, "shortest contact witness") + # Relaxing ALL target endpoints to full makes the COMPLETE scalar word legal. + # This changes the interface and is only a positive geometry control. + full_caps = [fb[1] for _ in range(n)] + full_caps[HELPER] = fb[512] + relaxed_failure, _, relaxed_hist = least_joins(word, fb, [fb[f] for f in frames], stage_gates + tail, full_caps) + require(relaxed_failure is None, "full-target positive geometry control") + relaxed_hist.update(prefix_hist) + controls = [] + for omitted in range(len(stage_gates)): + bad = execute(rows, stage_gates[:omitted] + stage_gates[omitted + 1:]) + controls.append(expect_failure(lambda bad=bad: require(bad == isolation_boundary(rows), "isolation mutation"), + "omit_isolation_" + str(omitted))) + bad_copy_rows = prefix(word, fb, corrupt_copy=True)[0] + controls.append(expect_failure(lambda: require(execute(bad_copy_rows, baseline_tail) == expected_rows(word), "COPY mutation"), "wrong_copy_snapshot")) + bad_tail = tail[:] + inline_index = next(i for i, gate in enumerate(bad_tail) if gate[0] == "B" and gate[1] == 653) + bad_tail.pop(inline_index) + controls.append(expect_failure(lambda: require(execute(isolated, bad_tail) == expected_rows(word), "ghost mutation"), "omit_ghost_donor")) + bad_tail = [gate for gate in tail if not (gate[0] == "B" and gate[1] == 601)] + controls.append(expect_failure(lambda: require(execute(isolated, bad_tail) == expected_rows(word), "contact mutation"), "omit_B601")) + for omitted in range(4): + controls.append(expect_failure(lambda omitted=omitted: check_chain(word, CHAIN[:omitted] + CHAIN[omitted + 1:]), + "omit_witness_edge_" + str(omitted))) + controls.append(expect_failure(lambda: check_chain(word, normal=(0, 1, 0, 0, 0, 0, 0, 0)), "wrong_separating_normal")) + controls.append(expect_failure(lambda: authenticated_word(b"not the pinned compressed input"), "source_corruption")) + # A priced conditional screen, not a falsely admitted invoice. + baseline_count = len(prefix_gates) + len(baseline_tail) + require(baseline_count == 24305 and len(complete) == 24304, "scalar invoice") + return {"schema_version": 1, "status": "SCOPED_ALL_LENGTH_FOUR_CONTACT_OBSTRUCTION", + "source_sha256": WORD_SHA256, "cut": CUT, "helper": HELPER, "columns": n, + "copy_ranks": copy_ranks, "copies_erased_before_cut": len(copy_ranks), + "restore_cut_coordinates": list(bits(inverse[HELPER])), "dirty_support": dirt, + "isolation_target_cut_coordinates": list(bits(isolation_cut_row)), + "isolation_program": [list(gate) for gate in STAGE], "isolation_orders": stage_orders, + "first_least_join_failure": failure, "four_contact_witness": [list(edge) for edge in CHAIN], + "shortest_contact_path": path, "separating_normal": [1, 0, 0, 0, 0, 0, 0, 0], + "cap_frame": 525, "cap_rank": len(fb[525]), "enlarged_cap_rank": len(join(fb[507], fb[525])), + "inlined_reads": inlined, "dropped_helper_adds": dropped, + "baseline_adds": baseline_count, "complete_scalar_adds": len(complete), + "complete_scalar_word_sha256": digest(complete), "tail_adds": len(tail), + "baseline_paid_histogram": dict(sorted(baseline_hist.items())), + "baseline_paid_children": sum(baseline_hist.values()), + "baseline_paid_rank_mass": sum(rank * count for rank, count in baseline_hist.items()), + "baseline_helper_frame_dimensions": helper_path, + "staged_helper_frame_dimensions": [0, 1, 4, 7], + "optimistic_two_slot_budget": budget(), + "full_target_relaxation": {"status": "CHANGED_ENDPOINT_POSITIVE_CONTROL_ONLY", + "paid_histogram": dict(sorted(relaxed_hist.items())), + "paid_rank_mass": sum(rank * count for rank, count in relaxed_hist.items()), + "paid_children": sum(relaxed_hist.values()), "includes_nine_copies": True}, + "negative_controls": controls, "new_supplier": False, "new_kappa": False} + + +def verify_receipt(actual, expected): + # Normalize histogram keys before sorting: numeric 2/10 and parsed strings + # "2"/"10" have different sort orders. Preserve typed JSON values. + normalized = json.loads(json.dumps(actual)) + require(digest(normalized) == digest(expected), "certificate mismatch") + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument("--root", type=Path, default=ROOT) + parser.add_argument("--emit", action="store_true") + args = parser.parse_args() + result = derive(load(args.root)) + if args.emit: + print(json.dumps(result, sort_keys=True, indent=2)) + else: + verify_receipt(result, json.loads((HERE / "CERTIFICATE.json").read_text())) + print("PASS_R439_STAGED_RETIREMENT columns=661 contacts=4 first_failure=B601 " + "scalar_ADDs=24305->24304 controls=" + str(len(result["negative_controls"])) + " no_new_kappa") + + +if __name__ == "__main__": + main()