diff --git a/research/p104-commutation-cut/README.md b/research/p104-commutation-cut/README.md new file mode 100644 index 0000000000..c75f12f02f --- /dev/null +++ b/research/p104-commutation-cut/README.md @@ -0,0 +1,179 @@ +# The P104 eight-array cut survives arbitrary interleaving of its frame paths + +Reordering the PR1972/PR1991 P104 channel and redesigning all its scalar +operations cannot make its side correction free while its per-register frame +paths and private lifetimes are retained. Even with arbitrary common-frame linear +operations, the source-to-target transfer has rank at most **8d**, where d is +the dimension of one array. The 104-port identity requires **104d**. The +original `G/2` channel attains the bound. + +The new quantifier is **every interleaving of the per-register transport chains**, +with **all original scalar reads/writes discarded and freely redesigned**, rather +than one chronological event list. This +closes a restricted version of the retiming question left open by +[PR2082](https://github.com/CrocSwap/integer-mult-bounds/pull/2082) and +[PR2090](https://github.com/CrocSwap/integer-mult-bounds/pull/2090). Changing a +register's frame path, replacing/fusing transports, +new storage lifetimes and non-common-chart operations remain outside the result. +There is **no new supplier or kappa**. + +## Exact domain + +Start with the pinned 4,058-event word, its 104 X sources, 104 Y targets, +72 arbitrary dirty helpers and eight owned C lifetimes. The input witness is +SHA256 `0f541bef7f19fdeffd67157684e9f03d785f42c89973632f508fc1a0452b580e`. + +Delete all 2,624 original ADDs and eight COPY instructions, including all +their cross-register ordering dependencies. Only the 1,410 transports and +eight private allocation/disposal pairs remain. Retain their order separately +for each register, including the order of C's eight lifetimes. Admit every +interleaving of these chains as whole transport events. No access inside a +recursive child is granted. Between events, grant any finite linear program +on existing live registers in exactly the same canonical frame, including +singular operations if desired. Original scalar coefficients, source choices +and access order need not be retained. Requiring restoration of borrowed +inputs only restricts this favorable class further. + +Retain the original frame transports and C allocation/disposal lifetimes. +Each role ends at its original frame. We do not grant arbitrary storage at +unoccupied frames or identify frames merely because they have equal rank. +The theorem concerns linear maps, not adaptive or nonlinear programs. + +## A union graph for all retimings + +A wire node is one register's interval between successive retained transport +or lifetime events, labelled by its canonical frame. Separate C lifetimes +have separate nodes. Each transport supplies a directed wire edge from its +input interval to its output interval; initialization has no predecessor and +disposal has no successor. + +For every pair of intervals on different registers with exactly equal frames, +add both directed communication edges. After the original scalar dependencies +are discarded, different registers' transport chains are independent, so each +such pair can overlap in some interleaving. More importantly, every actual +common-frame operation in every admitted execution is represented by an edge. + +The graph deliberately permits incompatible choices from different schedules +and even cycles. We do **not** claim that all its edges can occur together. +Every actual data dependency maps to a walk in this enlarged graph. Extra +operations may repeatedly change a row inside one interval without changing +its frame, and are therefore still covered. Same-role intervals are connected +only by their directed transport chains, not by free access to past values. + +The implementation also computes interval overlap from the event partial +order, and checks that granting *every* cross-register equal-frame pair gives +exactly the same graph. This prevents accidentally retaining an original +scalar-order restriction. + +Delete the eight C-descending transport edges at original zero-based event +indices + +``` +2463, 2472, 2479, 2487, 2495, 2503, 2510, 2518. +``` + +Each is one rank-seven native descent, and each carries **one array**. Native +child rank seven is not seven independent array wires. Exact reachability +in the enlarged graph finds no X-input to Y-output path. + +## Rank implication and attainment + +Fix any admitted retiming and inserted linear program. Replace the values +at those eight transport outputs by eight independent array variables. In +the resulting broken program, no X input influences a Y output except via +these variables: otherwise its actual dependency path would appear in the +union graph after the same eight edges were removed. + +With all other independent inputs set to zero, the original X-to-Y map +therefore factors through the eight original edge values. These values may +depend on previous such values; evaluating them in their actual chronological +order still gives a linear map from X into an 8d-dimensional space. The +transfer rank is at most 8d. Arbitrary dirty inputs and scalar/address mixing +within frames do not increase this dimension. + +For sharpness, the original word is an admitted ordering. The checker +reconstructs its 280-input rational map and verifies all source and helper +endpoints, including query compensation and cleanup. Its transfer is `G/2`. +The independently reconstructed roots satisfy `G²=26G` and `trace(G)=208`. +Thus `G/26` is an idempotent of trace eight over Q, so G has rank eight; the +array-valued transfer has rank 8d. This replays the inherited scalar channel, +not a new native compilation. + +## Evidence and reproduction + +Two separately implemented exact graph checkers agree: + +* 1,698 wire intervals in 444 binary subspaces; +* 1,402 retained transport edges after removing the eight descents; +* 71,224 directed potential common-frame edges; +* 853 reachable intervals and zero reachable final targets; +* restoring any one omitted descent reaches 52 targets; restoring all reaches 104. + +The primary implementation uses forward ancestor bitsets and complete XOR +spans. The second builds per-role traces, reverse descendant sets and reduced +binary bases; it imports no primary graph code. Both were written with Codex +assistance, so this is not independent human review. + +A deterministic legal retiming moves 3,989 event positions. The full rational +280-input endpoint replay and independent union-graph invariants still pass. +Controls restore each omitted edge, inject a forbidden cross-frame bypass, +remove dirty compensation or cleanup, and reverse frame-basis presentation. +The complete regenerated receipt is compared with `RESULT.json`. + +```sh +python3 -I -O -B research/p104-commutation-cut/verify.py +python3 scripts/research_package.py --package research/p104-commutation-cut --check-only +python3.12 scripts/research_package.py --package research/p104-commutation-cut +``` + +The direct check is read-only, standard-library only, and needs no network, +Git or predecessor executable imports. `--write` deliberately regenerates +only this package's receipt. Source pins authenticate before calculation. +The unchanged local profile has mass 2368: 2312 persistent boundary progress +plus COPY56. No new correction tariff, global owner assignment, precision, +all-size theorem, selected cold replay or native phase recompilation is +claimed. In particular, the 96 missing array directions are **not** a +96-child lower bound for changed frame paths. + +## Relation to current work + +PR2082 (`60f4e337ffba470e09727dd435b1f1be3b67d03d`) and PR2090 +(`dff116efc2c4ddd7236020ad8316db5c98aa693e`) establish the sharp rank-eight cut +for the frozen chronological itinerary. Their graph/cut idea and distinction +between array dimension and child rank are retained here. The new result is +the union over arbitrary interleavings of the fixed frame paths, after +discarding all scalar-event dependencies, and its exact certificate. Their terminal-excursion budget arguments are not new claims +of this package. PR2083 treats the completed terminal cut; PR2089 constructs +a paid tail correction. Both change the transport list and are outside this +theorem. + +The investigation began as an attempted constructive retiming, after local +log-reuse and additive-access screens failed. Those exploratory finite-field +searches are not used to prove this result and are not presented as native +lower bounds. The public package contains the exact successful certificate, +not a claim of a successful identity construction. + +## Open next questions + +Change at least one actual frame path, storage lifetime or permitted +cross-chart interface. A concrete first experiment is +to replace one gather or delivery transport so that a source-bearing helper +can meet a target-bearing helper at a new intermediate frame. Rebuild the +union graph and require a bypass of this eight-edge cut, then verify dirty +restoration and a complete native invoice. A bypass alone is not identity +completion. Retiming or scalar resynthesis along the original per-role frame paths is +no longer the open case identified here. + +## Credit + +Rohan Arun / PR1972 (`fd82d172f46933fd253c2c6de4bd5eaff5429cfd`) supplies the +scalar/frame channel; Chafik Boukhalfa / PR1991 +(`6e222517e182e98499239bc9a4009f540e1c5520`) supplies its native realization; +Adam Gall / PR1940 supplies the 32-chain schedule. Retain Josie Elliston / +PR1071, Ali Romman / PR1125, and the PR968/717/446/595/620 geometry and decoder +lineage. David Arias / PR2082 and Adam Gall / PR2090 supply the immediate +frozen-itinerary obstructions. No predecessor source is modified or copied. + +New work by Jeremy Diviney with substantial OpenAI Codex assistance in +mathematics, code, verification and prose. Apache-2.0. No formal-kernel proof, +independent human review or exhaustive novelty guarantee is claimed. diff --git a/research/p104-commutation-cut/RESULT.json b/research/p104-commutation-cut/RESULT.json new file mode 100644 index 0000000000..19855281d0 --- /dev/null +++ b/research/p104-commutation-cut/RESULT.json @@ -0,0 +1,83 @@ +{ + "controls": { + "all_cross_role_overlaps_granted": true, + "basis_invariance": true, + "cross_frame_bypass": true, + "intact_graph": true, + "nontrivial_retiming": true, + "scalar_mutations": [ + "omitted compensation/cleanup at 0", + "omitted compensation/cleanup at 4057" + ], + "single_descent_restorations": 8 + }, + "cut_original_event_indices": [ + 2463, + 2472, + 2479, + 2487, + 2495, + 2503, + 2510, + 2518 + ], + "formal_columns": 280, + "graph": { + "causal_edges": 1402, + "cut_events": [ + 734, + 737, + 740, + 743, + 746, + 749, + 752, + 755 + ], + "cut_ranks": [ + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7 + ], + "frames": 444, + "nodes": 1698, + "potential_common_frame_edges": 71224, + "reachable_nodes": 853, + "single_edge_reopened_targets": [ + 52, + 52, + 52, + 52, + 52, + 52, + 52, + 52 + ] + }, + "original_events": 4058, + "original_transfer_rank": 8, + "paid_profile": { + "1": 1074, + "2": 58, + "3": 86, + "4": 104, + "5": 48, + "6": 24, + "7": 8, + "8": 8 + }, + "rank_mass": 2368, + "removed_original_scalar_events": 2632, + "required_identity_rank": 104, + "retimed_events_moved": 3989, + "retimed_order_sha256": "af3ba729bda1034687ba450a2805b47d6dafd7327482818a38dea41e5cdf8c19", + "scope": "Arbitrary interleaving of the original per-role transport/lifetime chains; all original scalar reads/writes and their cross-role dependencies discarded. Arbitrary common-frame linear resynthesis on existing live roles. No new frame path, storage, native correction price, global owner, precision or kappa claim.", + "source_witness_sha256": "0f541bef7f19fdeffd67157684e9f03d785f42c89973632f508fc1a0452b580e", + "status": "PASS_P104_ALL_COMMUTATIONS_CUT", + "transport_lifetime_events": 1426 +} diff --git a/research/p104-commutation-cut/SOURCES.json b/research/p104-commutation-cut/SOURCES.json new file mode 100644 index 0000000000..65afd7c5c9 --- /dev/null +++ b/research/p104-commutation-cut/SOURCES.json @@ -0,0 +1,36 @@ +{ + "schema_version": 1, + "base_commit": "0fdd7d82de03e43c9e5a1000dfbcd380d1b687d2", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "ae6a99f28aa468649eb66a361e764d769363bf11", + "sha256": "10b9e340fd8e354a37a0c4813c90e5de1dd42044b5f6aca4a3fc5a42b685fa32" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "e8870e5917057d59b730eb14721a778639eca050", + "sha256": "d46eb6d5b3e279428753d770653663fbdf1063e55c255ea073d768f344927ef7" + }, + { + "path": "research/p104-native-channel/inputs/LOWRANK-RESULT.json", + "usage": "input", + "git_blob": "cbd1c6bdc9e34b25c64b2636ccd6acd2392232d4", + "sha256": "7143ec7780f6f38a8c294df8009c3621936b281d05ae79946ce22f581b73d1b1" + }, + { + "path": "research/p104-native-channel/inputs/LOWRANK-WITNESS.json", + "usage": "input", + "git_blob": "86beaf424e9f0f800ae3a62797d94ec9386b7706", + "sha256": "0f541bef7f19fdeffd67157684e9f03d785f42c89973632f508fc1a0452b580e" + }, + { + "path": "research/p104-native-channel/inputs/P104-FIXTURE.json", + "usage": "input", + "git_blob": "2e16f99b295bb386fd13bd8fbd57b42ef54143a9", + "sha256": "516c06f6ec3cb84be588c546108de897650288576dd5fbf5fe44b9c5546ad8a4" + } + ] +} diff --git a/research/p104-commutation-cut/TASK.json b/research/p104-commutation-cut/TASK.json new file mode 100644 index 0000000000..1b8fbf1558 --- /dev/null +++ b/research/p104-commutation-cut/TASK.json @@ -0,0 +1,87 @@ +{ + "schema_version": 1, + "task_id": "p104-side-correction", + "priority_revision": 4, + "base_commit": "0fdd7d82de03e43c9e5a1000dfbcd380d1b687d2", + "original_card": { + "id": "p104-side-correction", + "question": "Can the native P104 low-rank channel be completed with a legal, fully charged I-G/2 side correction?", + "starting_points": [ + "research/p104-native-channel/README.md", + "research/p104-native-channel/PROOF.md", + "docs/research/community-efficient1000-review.md" + ], + "methods": [ + "Construct one side-correction word at an explicit chronological cut with the needed frames still available.", + "Derive a lower bound on the side correction and hosting costs that decides whether this channel can beat the selected budget." + ], + "acceptance_gate": "An exact arbitrary-input identity, source/target frame availability and restoration at the chosen cut, plus the complete channel+correction+idle/hosting bill or an explicit favorable bound. The native channel alone is not a supplier.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read the P104 open next questions and its fixed local histogram; inspect why appending I-G/2 after source completion is not justified. #1991 supplies the checked native channel, not the missing correction.", + "scope": "Source-bound orientation only. Read the named package and review before relying on its local evidence; this command is not its replay or supplier admission." + }, + "first_experiment": "Choose one exact side-correction cut and bound its allowed cost from a favorable completed moment at a declared target. Stop or hand off if the necessary source/target access cannot be justified or even the optimistic total misses the target.", + "bottleneck_link": "Completing an already realized changed channel tests a concrete construction opportunity, instead of refining the incumbent packing. A positive local result still needs global and all-size admission.", + "allowed_variations": [ + "One correction factorization, one chronological cut, or one explicit hosting obstruction.", + "A changed correction schedule with an updated full bill and native frame contract." + ], + "scope_change_triggers": [ + "Recompiling the already certified low-rank channel without closing a new obligation.", + "Treating a pending ancestor, local histogram or unpriced side correction as an admitted global supplier." + ], + "overlap_terms": [ + "P104", + "I-G/2", + "side correction", + "native channel", + "1972", + "1991" + ] + }, + "scope_status": "changed", + "actual_scope": "Sharp eight-array communication cut for arbitrary interleaving of the pinned P104 per-role transport/lifetime chains, with every original ADD/COPY and scalar access dependency discarded and arbitrary common-frame linear resynthesis.", + "scope_change_reason": "Constructive timing and scalar-access screens failed. PR2082/2090 cover one frozen chronology; the exact stronger union graph discards every original scalar dependency, retaining only per-role frame paths and existing storage lifetimes. This is a scoped obstruction, not the card construction gate.", + "bottleneck_link": "Identity completion needs rank104 source-to-target transfer. Showing rank8 under all timing and scalar redesign along these frame paths forces a changed native path/storage/interface before further supplier work.", + "budget_minutes": 60, + "stop_rule": "Accept only an exact source-bound union-graph cut checked by two separate implementations, with all cross-role equal-frame overlaps granted. Do not infer a native tariff or kappa from this communication rank.", + "outcome": "negative-result", + "evidence": "README.md proof; RESULT.json canonical replay from verify.py; two independent graph constructions, 280-column scalar replay and semantic controls.", + "author": "Jeremy Diviney", + "ai_assistance": "Substantial OpenAI Codex assistance in research, proof, implementation, tests and prose. No subagents, independent human review or formal proof assistant.", + "open_questions": [ + { + "question": "Can a changed frame path or storage lifetime bypass the eight descending-copy edges cheaply?", + "why_it_matters": "Pure commutations and added common-frame operations cannot complete identity transfer.", + "first_step": "Change one gather/delivery helper transport, recompute the union graph, then derive restored arbitrary-input endpoints and fully paid native profile.", + "blocked_by": "No such modified native word or invoice is supplied; crossing the cut alone does not prove identity completion." + } + ], + "selection": "Explicit continuing user task; no random task draw or advance public reservation.", + "overlap": { + "utc": "2026-10-14T19:36:00Z", + "open_pr_snapshot_count": 376, + "discussion_records": 762, + "complete_pagination": true, + "nearest_prs": [ + 2082, + 2090, + 2083, + 2089 + ], + "difference": "Arbitrary interleavings of per-role frame paths, removing all original scalar access dependencies; prior PR2082/2090 fix one chronological word.", + "limits": "Bodies, discussion records and relevant READMEs; no exhaustive closed-code or literature search.", + "discussion_snapshot_utc": "2026-10-14T19:29:00Z" + }, + "upstream_checkpoint": { + "commit": "0fdd7d82de03e43c9e5a1000dfbcd380d1b687d2", + "utc": "2026-10-14T19:34:00Z", + "guidance_changes": "None relative to scientific base; priority revision4 and selected record unchanged." + } +} diff --git a/research/p104-commutation-cut/VERIFY.json b/research/p104-commutation-cut/VERIFY.json new file mode 100644 index 0000000000..2ebd5f3759 --- /dev/null +++ b/research/p104-commutation-cut/VERIFY.json @@ -0,0 +1,24 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/p104-native-channel/inputs/LOWRANK-RESULT.json", + "research/p104-native-channel/inputs/LOWRANK-WITNESS.json", + "research/p104-native-channel/inputs/P104-FIXTURE.json" + ], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-O", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "Two exact union graphs, all-column scalar endpoints, eight restored-edge controls, intact/bypass checks, legal retiming and frame basis invariance; complete canonical receipt." + } + ] +} diff --git a/research/p104-commutation-cut/graph.py b/research/p104-commutation-cut/graph.py new file mode 100644 index 0000000000..5e486d9703 --- /dev/null +++ b/research/p104-commutation-cut/graph.py @@ -0,0 +1,85 @@ +"""Union graph for arbitrary interleaving of the fixed P104 frame paths. + +Default: discard every original ADD/COPY and all scalar-access dependencies. +Retain each role's transport/lifetime chain, granting arbitrary linear scalar +resynthesis between equal frames. The larger union may contain incompatible +choices and cycles; disconnection is a conservative certificate. +Jeremy Diviney with substantial OpenAI Codex assistance. Apache-2.0. +""" +from collections import defaultdict +import hashlib,json,time +from pathlib import Path +HERE=Path(__file__).resolve().parent +BASE=HERE.parent/'p104-native-channel' + +def need(ok,why): + if not ok:raise ValueError(why) + +def key(vs): + out={0} + for v in vs:out|={x^v for x in tuple(out)} + return tuple(sorted(out)) + +def build(remove_descents=True,force_overlap=False,transport_only=True): + raw=(BASE/'inputs/LOWRANK-WITNESS.json').read_bytes() + need(hashlib.sha256(raw).hexdigest()=='0f541bef7f19fdeffd67157684e9f03d785f42c89973632f508fc1a0452b580e','pin') + w=json.loads(raw) + retained=[i for i,e in enumerate(w['program']) if not transport_only or e[0] not in ('add','copy')] + program=[w['program'][i] for i in retained];N=len(program) + last={};anc=[] + for at,e in enumerate(program): + regs=e[1:3] if e[0] in ('add','copy') else e[1:2];a=0 + for r in regs: + if r in last:a |= anc[last[r]]|(1<p and (pivots[q]>>p)&1:pivots[q]^=pivots[p] + return tuple(pivots[p] for p in sorted(pivots)) + +def check(w): + events=w['program'];n=len(events);touches=defaultdict(list) + for j,e in enumerate(events): + for r in e[1:3] if e[0] in ('add','copy') else e[1:2]:touches[r].append(j) + next_events=[set() for _ in events] + for trace in touches.values(): + for a,b in zip(trace,trace[1:]):next_events[a].add(b) + descendants=[set() for _ in events] + for a in range(n-1,-1,-1): + for b in next_events[a]:descendants[a].add(b);descendants[a].update(descendants[b]) + # Build each role's frame intervals separately, with its own private births. + nodes=[];role_nodes={};initial={};final={} + for role in sorted(touches): + current=basis(w['initial_frames'][role]) if role in w['initial_frames'] else None + start=-1;trace=[] + if current is not None:initial[role]=len(nodes) + for at in touches[role]: + e=events[at] + if e[1]!=role:continue # original READ orders events but does not split a wire + op=e[0] + if op=='zero': + require(current is None,'private birth');current=basis(e[2]);start=at;continue + require(current is not None,'live role') + trace.append(len(nodes));nodes.append((role,start,at,current)) + if op=='erase':current=None;continue + if op=='transport': + require(current==basis(e[2]),'old frame');current=basis(e[3]) + start=at + if current is not None: + final[role]=len(nodes);trace.append(len(nodes));nodes.append((role,start,n,current)) + require(current==basis(w['final_frames'][role]),'final frame') + role_nodes[role]=trace + adjacency=[set() for _ in nodes];ends={};starts={} + for i,(role,a,b,_) in enumerate(nodes):ends[role,b]=i;starts[role,a]=i + removed=[];causal=0 + for at,e in enumerate(events): + op=e[0];r=e[1] + if op in ('zero','erase'):continue + left,right=ends[r,at],starts[r,at] + if op=='transport' and r=='C' and len(basis(e[2]))>len(basis(e[3])): + removed.append((at,left,right,e[4])) + else:adjacency[left].add(right);causal+=1 + if op in ('add','copy'): + src=e[2];trace=role_nodes[src];ss=[nodes[j][1] for j in trace] + k=bisect_left(ss,at)-1;source=trace[k] + require(nodes[source][1]100,'nontrivial retiming') + return result + +def main(): + ap=argparse.ArgumentParser();ap.add_argument('--write',action='store_true');args=ap.parse_args() + pins=json.loads((HERE/'SOURCES.json').read_text()) + for item in pins['files']: + if item['usage']=='input':need(hashlib.sha256((ROOT/item['path']).read_bytes()).hexdigest()==item['sha256'],'input pin '+item['path']) + graph_module=load('graph');other=load('independent') + w=json.loads((graph_module.BASE/'inputs/LOWRANK-WITNESS.json').read_bytes()) + fixture=json.loads((graph_module.BASE/'inputs/P104-FIXTURE.json').read_bytes())['section4_explicit_P104'] + ports=port_data(fixture);paid=scalar(w,ports) + baseline=json.loads((graph_module.BASE/'inputs/LOWRANK-RESULT.json').read_text()) + need(paid=={int(k):v for k,v in baseline['paid_profile'].items()},'exact baseline profile') + # Discard every original scalar instruction and its cross-role dependency. + # Each retained event touches only one role. This permits arbitrary scalar + # resynthesis and arbitrary interleaving of the fixed transport chains. + skeleton=dict(w,program=[e for e in w['program'] if e[0] not in ('add','copy')]) + g=graph_module.build();ind=other.check(skeleton) + need(not g['reached_targets'] and len(g['removed_edges'])==8,'eight-edge union cut') + primary={'nodes':len(g['nodes']),'frames':len({n[3] for n in g['nodes']}), + 'causal_edges':g['causal_edges'],'potential_common_frame_edges':g['potential_common_frame_edges'], + 'cut_events':[e[0] for e in g['removed_edges']],'cut_ranks':[e[3] for e in g['removed_edges']], + 'reachable_nodes':int(g['reachable_mask_hex'],16).bit_count(), + 'single_edge_reopened_targets':[]} + for _,a,b,_ in g['removed_edges']: + targets=reachable(g,[(a,b)]);need(targets,'restore one descent');primary['single_edge_reopened_targets'].append(len(targets)) + need(primary==ind,'two independent graph constructions') + need(len(reachable(g,[(a,b) for _,a,b,_ in g['removed_edges']]))==104,'intact graph reaches all targets') + bypass=(g['input_nodes']['X0'],g['output_nodes']['Y0']) + need('Y0' in reachable(g,[bypass]),'deliberate cross-frame bypass control') + order=retime(w['program']);rw=dict(w,program=[w['program'][i] for i in order]);need(scalar(rw,ports)==paid,'retimed all-column endpoint') + retimed=other.check(dict(rw,program=[e for e in rw['program'] if e[0] not in ('add','copy')])) + for k in ('nodes','frames','causal_edges','potential_common_frame_edges','reachable_nodes'): + need(retimed[k]==ind[k],'retimed graph invariant '+k) + controls=[] + for at in (0,len(w['program'])-1): + bad=json.loads(json.dumps(w));need(bad['program'][at][0]=='add','endpoint-control cut');bad['program'][at][3]='0' + try:scalar(bad,ports) + except ValueError:controls.append('omitted compensation/cleanup at '+str(at)) + else:raise ValueError('endpoint mutation survived') + bw=json.loads(json.dumps(w)) + for f in list(bw['initial_frames'].values())+list(bw['final_frames'].values()):f.reverse() + for e in bw['program']: + if e[0]=='transport':e[2].reverse();e[3].reverse() + else:e[-1].reverse() + need(other.check(dict(bw,program=[e for e in bw['program'] if e[0] not in ('add','copy')]))==ind,'frame basis order invariant') + need(graph_module.build(force_overlap=True)['adjacency']==g['adjacency'], + 'all cross-role equal-frame intervals may overlap in this relaxed skeleton') + result={'status':'PASS_P104_ALL_COMMUTATIONS_CUT','source_witness_sha256':g['source_witness_sha256'], + 'original_events':len(w['program']),'formal_columns':len(w['initial_frames']), + 'transport_lifetime_events':len(skeleton['program']), + 'removed_original_scalar_events':len(w['program'])-len(skeleton['program']), + 'cut_original_event_indices':[g['retained_event_indices'][e[0]] for e in g['removed_edges']], + 'graph':primary,'original_transfer_rank':8,'required_identity_rank':104, + 'paid_profile':{str(k):v for k,v in paid.items()},'rank_mass':sum(r*c for r,c in paid.items()), + 'retimed_events_moved':sum(i!=j for i,j in enumerate(order)), + 'retimed_order_sha256':hashlib.sha256(json.dumps(order,separators=(',',':')).encode()).hexdigest(), + 'controls':{'single_descent_restorations':8,'cross_frame_bypass':True, + 'intact_graph':True,'scalar_mutations':controls,'basis_invariance':True, + 'nontrivial_retiming':True,'all_cross_role_overlaps_granted':True}, + 'scope':'Arbitrary interleaving of the original per-role transport/lifetime chains; all original scalar reads/writes and their cross-role dependencies discarded. Arbitrary common-frame linear resynthesis on existing live roles. No new frame path, storage, native correction price, global owner, precision or kappa claim.'} + path=HERE/'RESULT.json' + if args.write:path.write_text(json.dumps(result,sort_keys=True,indent=2)+'\n') + else:need(result==json.loads(path.read_text()),'complete canonical receipt') + print(json.dumps(result,sort_keys=True)) + +if __name__=='__main__':main()