diff --git a/research/native-rounded-loop-defect/.gitattributes b/research/native-rounded-loop-defect/.gitattributes new file mode 100644 index 0000000000..32c4aa2f30 --- /dev/null +++ b/research/native-rounded-loop-defect/.gitattributes @@ -0,0 +1 @@ +source/* -text diff --git a/research/native-rounded-loop-defect/PINS.json b/research/native-rounded-loop-defect/PINS.json new file mode 100644 index 0000000000..b91aa39319 --- /dev/null +++ b/research/native-rounded-loop-defect/PINS.json @@ -0,0 +1,37 @@ +[ + { + "path": "source/ACTUAL-WORD.json.gz", + "upstream_path": "research/kappa-round3-warp-20261022/ACTUAL-WORD.json.gz", + "commit": "32890bc5de034ab8fc93ac88ead7279a6a416d04", + "sha256": "7679daa4ec6a40f56fc7f0202379a6f454310e94945aba4f48beaaaafb838d05", + "git_blob": "46d929df83817b85a5387bcdb9745e0627d6366e" + }, + { + "path": "source/graph-certificate.json.gz", + "upstream_path": "research/coherent-frame-additivity/CERTIFICATE.json.gz", + "commit": "32890bc5de034ab8fc93ac88ead7279a6a416d04", + "sha256": "e69cd4db3a2bd6661d267be8a35a2f871cefe1ac03bdaf471c13ea627a705358", + "git_blob": "a90d2fd0441ecafda09d111237567a96f48d1dbd" + }, + { + "path": "source/coherence-background.md", + "upstream_path": "research/coherent-frame-additivity/README.md", + "commit": "32890bc5de034ab8fc93ac88ead7279a6a416d04", + "sha256": "cf6889e806a9b4fa9a75beccefaa998627a9b35b77be529f0fe26718f60b9d67", + "git_blob": "5c72c03ba7887aedad30acf4c20f40346da2fee5" + }, + { + "path": "source/lifting.py", + "upstream_path": "research/p104-reversible-lifting/lifting.py", + "commit": "32890bc5de034ab8fc93ac88ead7279a6a416d04", + "sha256": "9424ee08f22b717f6d58f7cc46f189c5549fa86778afcd0c0762ab2daf591160", + "git_blob": "524ed59c1e498f78134681bea49fac55e9541068" + }, + { + "path": "source/clifford_exact.py", + "upstream_path": "research/t74-native-fast/vendor/native/new/code/borrow/vendor/clifford/clifford_exact.py", + "commit": "32890bc5de034ab8fc93ac88ead7279a6a416d04", + "sha256": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962", + "git_blob": "166841a037f069249f6f7f6dedb89248812f59e2" + } +] diff --git a/research/native-rounded-loop-defect/PROOF.md b/research/native-rounded-loop-defect/PROOF.md new file mode 100644 index 0000000000..51a633ae55 --- /dev/null +++ b/research/native-rounded-loop-defect/PROOF.md @@ -0,0 +1,31 @@ +# Concrete native holonomy obstruction + +## Literal source and hypothesis being tested + +The pinned round-three ACTUAL-WORD forward program supplies events8160,8148,8196,8197. Their native frame edges are 0→29,0→2,2→341,29→341, all rank one. The retained coherent-frame-additivity certificate places the first three in its forest and the last among its chords. Frames0,29,2,341 are respectively [],[38],[11],[38,11]. The closed walk traverses the first and last edges backwards. These occurrences may concern different supplier roles; this is the consistency cycle required of a single frame-potential implementation, not a claim that the supplier executes these four instructions consecutively on one role. + +For frame a let F_a be its exact canonical unitary. Each exact edge is F_b F_a^-1. The loop telescopes to identity, including its global phase. The independently decoded native recipes each equal this operator as both tableau and zero-state vector. Tableau equality alone would miss global phase and is explicitly fault-tested. + +Use the existing P104 integer-lifting `pair` unchanged. For Gaussian integer inputs a,b, set d=a-b, s=b+floor(d/2), d'=i d, b'=s-floor(d'/2), a'=b'+d'; floor is componentwise. The inverse uses -i. Each step is a bijective lift; reversing the quarter turn gives the exact inverse on all Gaussian integers. Signed affine monomial wrappers are exact permutations and quarter turns; inverse wrappers preserve exact reversibility. These are actual native adapters, not an abstract inverse oracle. + +## Witness and quantified conclusion + +Take 512 Gaussian integer slots, all zero except slot1=1. The authenticated executable verifies every intermediate sparse row twice: the original source in-place kernel and a separately written recipe/floor interpreter. After the loop the only nonzero entries are slot1=i, slot10=1, slot39=1. The defect is (i-1)e1+e10+e39, with squared Euclidean norm4. A rational interpreter replacing floor by exact division yields precisely e1. Every edge followed by its own inverse, and the reverse of the entire literal rounded word, restore the input exactly. + +For every integer g>=0 set h=2^-g. Realize the same integer-coordinate implementation on h Z[i]^512. Input h e1 gives output h(i e1+e10+e39); its defect2h is strictly nonzero. This proves failure of exact graph flatness at every dyadic precision, rather than a finite precision search failure. An interface quantified over all positive widths already fails at width1. This does not establish failure at every width, a large-input relative-error lower bound, or failure of a different jointly coherent implementation. Indeed16e1 is an aligned-lattice positive control with zero defect. + +If a family of bijective rounded frame potentials P_a existed with every directed rounded edge P_b P_a^-1 equal to these four actual implementations, their product around the loop would be identity on every input. The witness contradicts this. The argument concerns exact potential consistency; approximate end-to-end accuracy may still be adequate with an independently proved budget. No inference from invertibility alone to flatness is permitted. + +## Error, internal magnitude and complete diagnostic invoice + +For one pair, compare to its ideal Gaussian unitary. Let e=d/2-floor(d/2) and e'=d'/2-floor(d'/2). Each component is0 or1/2; both outputs acquire the same error e'-e. Thus the pair Euclidean error is at most1. There are256 disjoint pairs in a rank-one512-vector call, so its norm error is at most16, also for the inverse sign. Exact monomial wrappers preserve norm. Four calls therefore have worst-case Euclidean defect at most64 grid units, by unitary transport and the triangle inequality. This applies to every Gaussian integer input, not just the witness. + +If every initial real/imaginary component has magnitude<=M, ideal pair components have magnitude<=2M, and rounded outputs<=2M+1/2. Four prefixes therefore have components<=16M+15/2. Within the literal lifts differences, pre-floor values, sums and quarter turns are bounded conservatively by32M+16 across the four calls. Signed integers with w=1+ceil(log2(32M+17)) bits suffice; grid spacing h changes physical units, not integer register bounds. This is an absolute precision analysis of this four-edge diagnostic, not a complete multiplication error budget. + +The paid profile is exactly four H1, with eight signed monomial wrapper applications. At width1 there are1024 pair operations,4096 wrapped Gaussian values, and the receipt records actual permutation cycles/swaps. A register-reused arithmetic implementation of each pair uses eight real additions/subtractions, four real floor divisions by2 and one sign change; the Python source is a semantic reference, not an instruction-for-instruction tariff implementation. Its eager rotate tuple and Python temporaries are not priced as that schedule. The source code compiles cycles at invocation time; any prepared-plan variant must charge that setup/storage rather than claim it absent. + +One live512-vector is mutated; a monomial cycle uses one owned-zero Gaussian scratch restored after each cycle. The verifier holds independent snapshots/oracles solely as instrumentation. Eight wrapper plans contain4096(index,phase) entries; generating them and cycle schedules is ordinary O(512) work per wrapper with explicit retained plans, not recursively cheap oracle access. All diagnostic calls and reverse-control calls are separately counted in tests; the scientific profile four H1 refers only to the proposed closed walk. There is no claimed scalar allowance, saved recursive work, all-width runtime, complete supplier cleanup theorem or kappa improvement. + +## Family expansion decision + +The result closes independent edge-by-edge P104 rounding as an exact frame-potential service on this actual paid graph. It does not close history-preserving, jointly coherent, additive, or differently rounded services. The R15 nearest-even service is different and makes no exact inverse claim. Existing generic nonlinear counterexamples and graph-cycle enumeration did not establish this concrete native failure. Any next construction must state how it restores flatness and additivity, charge correction/history creation and erasure, bound precision/internal values, and compose the complete caller invoice; a local inverse test cannot substitute for those obligations. diff --git a/research/native-rounded-loop-defect/README.md b/research/native-rounded-loop-defect/README.md new file mode 100644 index 0000000000..1f5c8849d4 --- /dev/null +++ b/research/native-rounded-loop-defect/README.md @@ -0,0 +1,13 @@ +# An actual native paid cycle has nonzero integer-lifting holonomy + +The four-edge native frame cycle 29→0→2→341→29 is exactly identity over Gaussian rationals. Applying the existing P104 reversible integer lifting core through the literal signed native adapters instead sends the unit input e1 to i e1+e10+e39. Its defect has Euclidean norm2 in grid units. Every individual child and the reversed whole loop remain exactly invertible. + +This supplies the missing concrete native example for the coherent-frame-additivity handoff. It reuses the existing rounding method; it does not propose a new one. Scaling the witness by any dyadic grid spacing proves failure of exact graph flatness at every precision. The witness is width one, which suffices to refute an interface required at all positive widths. No claim is made that every width or every input fails. + +Run `python3 -I -B research/native-rounded-loop-defect/verify.py` and the same command with `-O`. Source bytes are authenticated before import. Both integer and ideal rational paths have an independent recipe/floor interpreter. The receipt includes every sparse cut, literal event identifiers, and actual operation counters. `PROOF.md` states scope, analytic bounds and complete diagnostic cost. + +## Open next questions + +Can coherent frame potentials replace independently rounded native edges without exceeding the recursive budget? Can a changed child ABI retain correction information around this actual loop? Additivity and endpoint correctness remain separate obligations even after graph flatness is achieved. No complete caller, recursive child tariff or new kappa is claimed. + +Package-boundary controls run with `python3 -I -B research/native-rounded-loop-defect/test_package.py`: copied-source mutation must fail before import; receipt mutation must fail in normal and optimized Python. All executable inputs are local to this package. Frozen predecessor bytes retain their attribution. diff --git a/research/native-rounded-loop-defect/RECIPES.json b/research/native-rounded-loop-defect/RECIPES.json new file mode 100644 index 0000000000..ec453b2741 --- /dev/null +++ b/research/native-rounded-loop-defect/RECIPES.json @@ -0,0 +1 @@ +[{"rank": 1, "left": {"matrix_rows": [2, 5, 9, 16, 32, 1, 64, 128, 256], "offset": 0, "quadratic_rows": [0, 0, 0, 0, 0, 0, 0, 0, 0], "linear_Z4": [2, 0, 0, 0, 0, 0, 0, 0, 0], "phase": 0}, "right": {"matrix_rows": [38, 1, 34, 36, 8, 16, 64, 128, 256], "offset": 1, "quadratic_rows": [0, 6, 6, 0, 0, 0, 0, 0, 0], "linear_Z4": [0, 3, 3, 0, 0, 2, 0, 0, 0], "phase": 1}}, {"rank": 1, "left": {"matrix_rows": [3, 5, 8, 1, 16, 32, 64, 128, 256], "offset": 0, "quadratic_rows": [0, 0, 0, 0, 0, 0, 0, 0, 0], "linear_Z4": [2, 0, 0, 0, 0, 0, 0, 0, 0], "phase": 0}, "right": {"matrix_rows": [11, 9, 10, 4, 16, 32, 64, 128, 256], "offset": 1, "quadratic_rows": [3, 3, 0, 0, 0, 0, 0, 0, 0], "linear_Z4": [3, 3, 0, 2, 0, 0, 0, 0, 0], "phase": 1}}, {"rank": 1, "left": {"matrix_rows": [2, 5, 9, 16, 32, 1, 64, 128, 256], "offset": 0, "quadratic_rows": [0, 0, 0, 0, 0, 0, 0, 0, 0], "linear_Z4": [2, 0, 0, 0, 0, 0, 0, 0, 0], "phase": 0}, "right": {"matrix_rows": [38, 1, 34, 36, 8, 16, 64, 128, 256], "offset": 1, "quadratic_rows": [0, 6, 6, 0, 0, 0, 0, 0, 0], "linear_Z4": [0, 3, 3, 0, 0, 2, 0, 0, 0], "phase": 1}}, {"rank": 1, "left": {"matrix_rows": [3, 5, 8, 1, 16, 32, 64, 128, 256], "offset": 0, "quadratic_rows": [0, 0, 0, 0, 0, 0, 0, 0, 0], "linear_Z4": [2, 0, 0, 0, 0, 0, 0, 0, 0], "phase": 0}, "right": {"matrix_rows": [11, 9, 10, 4, 16, 32, 64, 128, 256], "offset": 1, "quadratic_rows": [3, 3, 0, 0, 0, 0, 0, 0, 0], "linear_Z4": [3, 3, 0, 2, 0, 0, 0, 0, 0], "phase": 1}}] \ No newline at end of file diff --git a/research/native-rounded-loop-defect/RESULT.json b/research/native-rounded-loop-defect/RESULT.json new file mode 100644 index 0000000000..6f18ae94a7 --- /dev/null +++ b/research/native-rounded-loop-defect/RESULT.json @@ -0,0 +1,120 @@ +{ + "events": [ + 8160, + 8148, + 8196, + 8197 + ], + "directions": [ + "inverse", + "forward", + "forward", + "inverse" + ], + "frames": [ + 29, + 0, + 2, + 341, + 29 + ], + "witness_input": [ + [ + 1, + [ + 1, + 0 + ] + ] + ], + "witness_output": [ + [ + 1, + [ + 0, + 1 + ] + ], + [ + 10, + [ + 1, + 0 + ] + ], + [ + 39, + [ + 1, + 0 + ] + ] + ], + "defect_squared_norm": 4, + "cuts": [ + [ + [ + 1, + [ + 1, + 0 + ] + ] + ], + [ + [ + 1, + [ + 0, + 1 + ] + ] + ], + [ + [ + 1, + [ + -1, + 1 + ] + ], + [ + 39, + [ + 1, + 0 + ] + ] + ], + [ + [ + 1, + [ + 0, + 1 + ] + ], + [ + 10, + [ + 1, + 0 + ] + ], + [ + 39, + [ + 1, + 0 + ] + ] + ] + ], + "meter": { + "pairs": 1024, + "wrapper_values": 4096, + "wrapper_cycles": 512, + "wrapper_swaps": 4608 + }, + "claim": "Every dyadic grid has a scaled witness; exact child inverses do not imply native graph flatness." +} diff --git a/research/native-rounded-loop-defect/SOURCES.json b/research/native-rounded-loop-defect/SOURCES.json new file mode 100644 index 0000000000..12b6914220 --- /dev/null +++ b/research/native-rounded-loop-defect/SOURCES.json @@ -0,0 +1,48 @@ +{ + "schema_version": 1, + "base_commit": "32890bc5de034ab8fc93ac88ead7279a6a416d04", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "fc3d4ba105e1f097d0d7d051a308281e86ab1446", + "sha256": "66974efdced4083c00025f97d95d83909a226cdf801edb9301c195c6641f6903" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "f126dd2e2dad2b669e75d1d0d0bd05c600725602", + "sha256": "f7a48bfa2659b88378282a8eee7d9fe52cdf505594124c4d1686b58510fffd72" + }, + { + "path": "research/kappa-round3-warp-20261022/ACTUAL-WORD.json.gz", + "usage": "provenance", + "git_blob": "46d929df83817b85a5387bcdb9745e0627d6366e", + "sha256": "7679daa4ec6a40f56fc7f0202379a6f454310e94945aba4f48beaaaafb838d05" + }, + { + "path": "research/coherent-frame-additivity/CERTIFICATE.json.gz", + "usage": "provenance", + "git_blob": "a90d2fd0441ecafda09d111237567a96f48d1dbd", + "sha256": "e69cd4db3a2bd6661d267be8a35a2f871cefe1ac03bdaf471c13ea627a705358" + }, + { + "path": "research/coherent-frame-additivity/README.md", + "usage": "provenance", + "git_blob": "5c72c03ba7887aedad30acf4c20f40346da2fee5", + "sha256": "cf6889e806a9b4fa9a75beccefaa998627a9b35b77be529f0fe26718f60b9d67" + }, + { + "path": "research/p104-reversible-lifting/lifting.py", + "usage": "provenance", + "git_blob": "524ed59c1e498f78134681bea49fac55e9541068", + "sha256": "9424ee08f22b717f6d58f7cc46f189c5549fa86778afcd0c0762ab2daf591160" + }, + { + "path": "research/t74-native-fast/vendor/native/new/code/borrow/vendor/clifford/clifford_exact.py", + "usage": "provenance", + "git_blob": "166841a037f069249f6f7f6dedb89248812f59e2", + "sha256": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962" + } + ] +} diff --git a/research/native-rounded-loop-defect/TASK.json b/research/native-rounded-loop-defect/TASK.json new file mode 100644 index 0000000000..86dda95644 --- /dev/null +++ b/research/native-rounded-loop-defect/TASK.json @@ -0,0 +1,74 @@ +{ + "schema_version": 1, + "task_id": "uniform-transfer-audit", + "priority_revision": 7, + "base_commit": "32890bc5de034ab8fc93ac88ead7279a6a416d04", + "original_card": { + "id": "uniform-transfer-audit", + "question": "Does one quantified step of the proposed #4100 all-size construction hold at its actual caller?", + "starting_points": [ + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "research/unconditional-batched-crt/README.md" + ], + "methods": [ + "Prove one missing implication with explicit quantified hypotheses.", + "Find an exact counterexample at the claimed interface boundary." + ], + "acceptance_gate": "Identify the proposition and what would change downstream; do not equate a finite replay with a universal proof.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read PROOF.md and AUDIT.md in #4100. Select one distinct obligation: CRT total repair, native/free-algebra lifting, precision/conditioning, or complete fixed-tape cost. This is an author-submitted proof, not an accepted unconditional theorem.", + "scope": "Source-binding orientation only; no scientific replay, theorem acceptance or supplier admission. Budget any heavy replay separately." + }, + "first_experiment": "Check live handoffs; name one proposition, its caller, quantified domain and dependency closure. Independently prove the implication or exhibit a precise gap/counterexample. Prioritize CRT.md total repair or COMPLEX.md free-algebra lift only if unclaimed. Stop at the chosen obligation; do not substitute finite samples or root arithmetic for an all-size proof, or launch the complete package by default.", + "bottleneck_link": "Finite supplier improvements are useful only under the retained transfer obligations.", + "allowed_variations": [ + "One CRT repair, native lift, precision/conditioning or tape-cost proposition, with its exact caller." + ], + "scope_change_triggers": [ + "Replacing a quantified obligation with another finite smoke test.", + "Treating archive intake, an author PASS receipt or a finite composed fixture as discharge of the universal hypotheses." + ], + "overlap_terms": [ + "uniform transfer", + "all-size", + "precision", + "4100", + "unconditional-batched-crt" + ], + "existing_checks": [ + { + "scope": "PR #4100: proposed unconditional construction and finite checks, without independent acceptance.", + "evidence": "research/unconditional-batched-crt/README.md", + "remaining": "Independent proof audit of one caller-bound all-size implication; all other premises remain explicit.", + "status": "author-checked", + "source_commit": "337d04939571a637aeab54a0f58f54fde811663a", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + } + ] + }, + "scope_status": "changed", + "actual_scope": "Existing reversible lifting through actual native signed adapters fails exact flatness on one paid graph cycle at every dyadic grid precision.", + "scope_change_reason": "Concrete native compatibility obligation left open by abstract coherence witnesses.", + "bottleneck_link": "Closes a specific missing interface obligation before another construction round; no selected-frontier change.", + "budget_minutes": 60, + "stop_rule": "20-minute source-bound proof gate, then finish exact quantified result and controls; stop if only an old theorem or finite extrapolation survives.", + "outcome": "negative-result", + "evidence": "PROOF.md; source-pinned verify.py; RESULT.json; VERIFY.json", + "author": "JoyboyBrian", + "ai_assistance": "OpenAI Codex substantial proof and implementation assistance", + "open_questions": [ + { + "question": "Construct jointly coherent frame potentials and prove additive caller compatibility with full cost and precision.", + "why_it_matters": "A changed interface is necessary before claiming additional recursive savings.", + "first_step": "Write the complete changed producer/caller invoice before synthesis.", + "blocked_by": "Unproved changed-interface implementation" + } + ] +} diff --git a/research/native-rounded-loop-defect/VERIFY.json b/research/native-rounded-loop-defect/VERIFY.json new file mode 100644 index 0000000000..a833886101 --- /dev/null +++ b/research/native-rounded-loop-defect/VERIFY.json @@ -0,0 +1,40 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 30, + "checks": "Exact signed source loop, independent integer and rational replay, inverse and lattice positives, absolute-phase rejection" + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 30, + "checks": "Exact signed source loop, independent integer and rational replay, inverse and lattice positives, absolute-phase rejection" + }, + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/test_package.py" + ], + "timeout_seconds": 30, + "checks": "Isolated normal and optimized source-before-import authentication, typed receipt and native recipe mutations" + } + ] +} diff --git a/research/native-rounded-loop-defect/source/ACTUAL-WORD.json.gz b/research/native-rounded-loop-defect/source/ACTUAL-WORD.json.gz new file mode 100644 index 0000000000..46d929df83 Binary files /dev/null and b/research/native-rounded-loop-defect/source/ACTUAL-WORD.json.gz differ diff --git a/research/native-rounded-loop-defect/source/clifford_exact.py b/research/native-rounded-loop-defect/source/clifford_exact.py new file mode 100644 index 0000000000..166841a037 --- /dev/null +++ b/research/native-rounded-loop-defect/source/clifford_exact.py @@ -0,0 +1,149 @@ +"""Small exact Gaussian-dyadic Clifford compiler, independent of gx internals. +Paulis use i^p X^x Z^z. State vectors use integer Gaussian numerators / 2^d. +The tableau is supplemented by a literal circuit, so global phases are kept. +""" +from dataclasses import dataclass + +def parity(x):return x.bit_count()&1 +def rank(rows): + p={} + for x in rows: + while x: + b=x.bit_length()-1 + if b not in p:p[b]=x;break + x^=p[b] + return len(p) +def transpose(rows,n):return tuple(sum(((rows[j]>>i)&1)<>j&1);a[j],a[k]=a[k],a[j] + for i in range(n): + if i!=j and a[i]>>j&1:a[i]^=a[j] + assert [r&((1<>n for r in a) +def basis_extend(cols,n): + out=[] + for x in list(cols)+[1<len(out):out.append(x) + assert len(out)==n + return tuple(out) +def nullspace(rows,n): + a=list(rows);p=[];k=0 + for j in range(n): + t=next((i for i in range(k,len(a)) if a[i]>>j&1),None) + if t is None:continue + a[t],a[k]=a[k],a[t] + for i in range(len(a)): + if i!=k and a[i]>>j&1:a[i]^=a[k] + p.append(j);k+=1 + return tuple((1<>j)&1)<>i&1:out=pmul(out,T[i]) + for i in range(n): + if z>>i&1:out=pmul(out,T[n+i]) + return out +def compose(A,B):return tuple(apply(A,p) for p in B) +def inverse(T): + n=len(T)//2;cols=[x|(z<>n;u,v,p=apply(T,(x,z,0));assert (u,v)==identity(n)[j][:2];out.append((x,z,(-p)%4)) + return tuple(out) +def qvalue(Q,alpha,x,n): + return (sum(alpha[i] for i in range(n) if x>>i&1)+2*sum(parity((Q[i]>>(i+1))&(x>>(i+1))) for i in range(n) if x>>i&1))%4 +def mul_i(a,p): + x,y=a;p%=4 + return [(x,y),(-y,x),(-x,-y),(y,-x)][p] +@dataclass +class Op: + n:int + tab:tuple + circuit:list + def then(self,b): + assert self.n==b.n + return Op(self.n,compose(b.tab,self.tab),self.circuit+b.circuit) + def adjoint(self): + circ=[] + for e in reversed(self.circuit): + if e[0]=='P':circ.append(('P',inv(e[1],self.n))) + elif e[0]=='D':circ.append(('D',e[1],tuple((-x)%4 for x in e[2]))) + elif e[0]=='C':circ.append(('C',e[1],-e[2])) + elif e[0]=='phase':circ.append(('phase',(-e[1])%4)) + else:circ.append(e) + return Op(self.n,inverse(self.tab),circ) + def zero_state(self,basis=0): + N=1<>i)&1 for i in range(n)) + assert all(alpha[i]%2==(Q[i]>>i)&1 for i in range(n)) + return Op(n,tuple([(1<>i&1 else 0,1<>i&1 else 0) for i in range(n)]),[('C',q,sgn)]) +def xgate(n,b):return Op(n,tuple([(1<>i)&1)) for i in range(n)]),[('X',b)]) +def fourier(n,axes=None): + out=ident(n) + for i in range(n) if axes is None else axes:out=out.then(cgate(n,1<len(selected):picks.append(j);selected.append(x) + assert len(picks)==r and all(x>>r==0 for x in Bcols) + Br=transpose(selected,r);Bi=inv(Br,r);Dr=transpose([Dcols[j]&((1< (x+c y,y)` is equivalent to + +`A(x+c y)=A(x)+c A(y)` for all x,y. + +Putting y=0, then x=0, and finally y=c^-1 z proves additivity. The converse +follows from dyadic homogeneity. [PROOF.md](PROOF.md) states the exact domains +and the gatewise claim boundary; there is no proof-assistant claim. + +The independently written source parser checks both actual round-three +orientations, each with 21,449 events and 632 persistent fields. **All 1,002 +active frames in each orientation have a distinct persistent-register ADD +with a unit dyadic coefficient, outside every owned-center macro.** The +certificate retains one exact source event per frame per orientation, +including its register pair and coefficient. Both persistent endpoint frame +lists, all eight owned macros, and the retained paid profile are checked. + +Two exact distinctions prevent an invalid implication: + +- The reversible rounded map `(x,y) -> (x+floor(y/2),y)` has exact two-sided + inverses but fails ADD equivariance at x=y=(0,1). +- The radial bijection `v -> ||v||² v` commutes with **every unitary** but + still fails ADD equivariance. Its all-unitary property is proved from + norm preservation, rather than inferred from finite tests. + +Separately, each paid occurrence graph has 1,002 vertices, 3,298 edges, +one component and 2,297 fundamental closed-walk tests for a potential +assignment. Identifying parallel unordered pairs gives 2,855 edges and +cycle rank 1,854. These counts do not show that a particular implementation +fails any test. They identify obligations that inverse pairs alone leave. + +This closes one local implication in the **gatewise coherent-potential +recipe with unchanged scalar gates**. It does not exclude global correlated +error schemes, changed scalar circuits, additive coherent realizations, or +a different paired caller. Precision, independent fresh D factors, physical +Gaussian/frame compatibility, workspace, routing, recursive pricing and BIT +admission remain open. The selected conditional κ is unchanged. + +## Reproduce + +From the repository root, with standard-library Python 3.12: + +```sh +python3.12 -I -B research/coherent-frame-additivity/verify.py +python3.12 -I -O -B research/coherent-frame-additivity/verify.py +python3.12 -B scripts/research_package.py --package research/coherent-frame-additivity +``` + +Expected direct output: + +```text +PASS_COHERENT_FRAME_ADDITIVITY frames_per_orientation=1002 paid_cycle_rank=2297 controls=5 no_new_kappa +``` + +[RESULT.json](RESULT.json) records the recomputed summary and the SHA256 of +the canonical decompressed [certificate](CERTIFICATE.json.gz). Default replay +is read-only. `--write-result NEW_PATH` explicitly creates a new summary and +its sibling certificate, without overwriting either. Gzip headers and streams +are not mathematical evidence: replay compares exact canonical payload bytes. + +Finite corroboration includes 12,005 rational linear ADD cases, 98 rounded +two-sided inverse round trips and 147 rational radial/orthogonal cases. +Four semantic source mutations and a changed-source-byte control must fail +for their specified reasons. Conditions use exceptions and remain active +under `-O`. No native physical suite, selected cold replay, Lean build or +full multiplication theorem is part of this audit. + +## Sources and overlap + +Canonical base: `b91956876e5b4122fd89179f1b57557ff8378f15`, priority revision 7. +Assignment seed: `7497f9f029574287f7cf5b3d5415bf74`, independent-verification +track, `formal-interface-lemma` card. The scope change to a written local +boundary theorem is declared in [TASK.json](TASK.json). + +[SOURCES.json](SOURCES.json) pins the sole executed scientific input, +Cao Yifan's actual round-three word, and historical assignment context. +[VENDORED.json](VENDORED.json) authenticates Yiyang's exact PR4966 inverse +proof at `039b6ea51ab7a7efb38fc6851f345839683251b0`; no predecessor +implementation is imported or executed. + +The [overlap receipt](OVERLAP.json) records live open-PR/discussion and local +note coverage. PR4966 already distinguishes exact reversibility from linear +operator identities; the new evidence is the ADD criterion and complete +all-active-frame source binding. Nick Petalas's coherent-transvection +neighborhood proves geometric graph transport constraints, which receive +credit here; the elementary graph lemma is not claimed as new mathematics. +Coverage does not include every code diff or unpublished work and is not +a novelty certificate. + +Canonical investigation: +[Discussion4611](https://github.com/CrocSwap/integer-mult-bounds/discussions/4611#discussioncomment-19138553). + +## Open next questions + +- Can additive actual frame potentials satisfy the paid closed-walk and + unchanged warp equations at a charged precision? Start with one actual + non-tree paid edge and its forest path, including their true recursive + realizations. Such realizations and their full bill are not supplied here. +- If nonlinear potentials are retained, can a literal conjugated scalar + gate or a paid quantitative error bound replace unchanged ADDs? Start with + one emitted persistent-register witness and carry the correction through + the actual two-call caller. Unknown correction and storage costs are not zero. + +## Credit + +Yiyang (@Lyy-iiis), with OpenAI Codex assistance, supplies PR4966's paid-site +precision census and same-realization inverse construction. Cao Yifan supplies +the round-three actual word and its retained predecessor lineage. The +two-full Laurent-border, native E8/Clifford and PR4610 predecessor attribution +remains with the source authors. Nick Petalas supplies the related binary +symplectic graph-neighborhood result. No claim of independent human review +is made. Prepared by Cinna Davis with substantial OpenAI Codex assistance +in research, proof explanation, implementation, verification and writing. +New work is Apache-2.0; the vendored predecessor retains its original notice. diff --git a/research/native-rounded-loop-defect/source/graph-certificate.json.gz b/research/native-rounded-loop-defect/source/graph-certificate.json.gz new file mode 100644 index 0000000000..a90d2fd044 Binary files /dev/null and b/research/native-rounded-loop-defect/source/graph-certificate.json.gz differ diff --git a/research/native-rounded-loop-defect/source/lifting.py b/research/native-rounded-loop-defect/source/lifting.py new file mode 100644 index 0000000000..524ed59c1e --- /dev/null +++ b/research/native-rounded-loop-defect/source/lifting.py @@ -0,0 +1,233 @@ +"""Integer-lifting P104 reference. Tekalign/Codex, Apache-2.0. + +This is a scalar reference, not an admitted recursively cheap native child. +No predecessor executable is imported here. Unbounded signed integers, no aliasing. +""" + + +def need(ok, message): + if not ok: + raise ValueError(message) + + +def rot(z, phase): + a, b = z + return ((a, b), (-b, a), (-a, -b), (b, -a))[phase % 4] + + +def pair(a, b, inverse=False): + """Four Gaussian lifts and one quarter turn; floor acts componentwise.""" + d = (a[0] - b[0], a[1] - b[1]) + s = (b[0] + d[0] // 2, b[1] + d[1] // 2) + d = rot(d, -1 if inverse else 1) + b = (s[0] - d[0] // 2, s[1] - d[1] // 2) + return (b[0] + d[0], b[1] + d[1]), b + + +def plan(record): + need(set(record) == {'matrix_rows', 'offset', 'linear_Z4', + 'quadratic_rows', 'phase'}, 'wrapper schema') + rows, lin, quad = (record[k] for k in + ('matrix_rows', 'linear_Z4', 'quadratic_rows')) + need(len(rows) == len(lin) == len(quad) == 9, 'wrapper dimension') + need(all(type(x) is int and 0 <= x < 512 for x in rows + quad), 'binary rows') + need(all(type(x) is int and 0 <= x < 4 for x in lin), 'linear phase') + need(type(record['offset']) is int and 0 <= record['offset'] < 512, 'offset') + need(type(record['phase']) is int and 0 <= record['phase'] < 4, 'global phase') + out = [] + for x in range(512): + bits = [(x >> j) & 1 for j in range(9)] + y = record['offset'] + for j, row in enumerate(rows): + y ^= (sum(bits[k] * ((row >> k) & 1) for k in range(9)) % 2) << j + phase = record['phase'] + sum(bits[j] * lin[j] for j in range(9)) + phase += 2 * sum(bits[j] * bits[k] * ((quad[j] >> k) & 1) + for j in range(9) for k in range(j + 1, 9)) + out.append((y, phase % 4)) + need(sorted(y for y, _ in out) == list(range(512)), 'wrapper bijection') + return out + + +def inverse_plan(p): + out = [None] * len(p) + for x, (y, phase) in enumerate(p): + out[y] = (x, -phase % 4) + return out + + +def permute(value, p): + need(len(value) == len(p), 'wrapper width') + out = [(0, 0)] * len(value) + for x, (y, phase) in enumerate(p): + out[y] = rot(value[x], phase) + return out + + +def cycles(p): + """Input-independent schedule, compiled once and retained as recipe data.""" + seen, result = set(), [] + for start in range(len(p)): + if start in seen: + continue + cycle, x = [], start + while x not in seen: + seen.add(x) + cycle.append(x) + x = p[x][0] + need(x == start, 'permutation cycle') + result.append(cycle) + return result + + +def permute_inplace(value, p, meter=None): + """Cycle swaps use one zero Gaussian scratch, restored after each cycle. + + Cycle compilation is input-independent setup, separately charged in README. + """ + schedule = cycles(p) + for cycle in schedule: + start = cycle[0] + scratch, value[start] = value[start], (0, 0) + for x in cycle: + y, phase = p[x] + scratch = rot(scratch, phase) + scratch, value[y] = value[y], scratch + need(scratch == (0, 0), 'wrapper scratch restored') + if meter is not None: + meter['wrapper_cycles'] = meter.get('wrapper_cycles', 0) + len(schedule) + meter['wrapper_swaps'] = meter.get('wrapper_swaps', 0) + len(value) + len(schedule) + + +def kernel(value, rank, left, right, inverse=False, meter=None): + n = len(value) + need(n > 1 and n & (n - 1) == 0 and 1 <= rank < n.bit_length(), 'kernel domain') + if inverse: + left, right = inverse_plan(right), inverse_plan(left) + permute_inplace(value, right, meter) + for bit in (reversed(range(rank)) if inverse else range(rank)): + for x in range(n): + if x >> bit & 1: + continue + y = x ^ (1 << bit) + value[x], value[y] = pair(value[x], value[y], inverse) + if meter is not None: + meter['pairs'] += 1 + if meter is not None: + meter['wrapper_values'] += 2 * n + permute_inplace(value, left, meter) + return value + + +def exact(value, rank, left, right): + """Exact rational oracle: return Gaussian numerators / 2**rank.""" + value = permute(value, right) + for bit in range(rank): + for x in range(len(value)): + if x >> bit & 1: + continue + y = x ^ (1 << bit) + a, b = value[x] + c, d = value[y] + value[x] = (a - b + c + d, b + a + d - c) + value[y] = (a + b + c - d, b - a + d + c) + return permute(value, left) + + +def working_grid(value, f, b): + need(type(f) is type(b) is int and f >= 0 and b >= 0, 'grid parameters') + magnitude = max(abs(v) for z in value for v in z) + if not magnitude: + return f + h = magnitude.bit_length() - 1 - f + return max(f, b + 8 - h) + + +def shift(value, delta): + if delta >= 0: + return [(a << delta, b << delta) for a, b in value] + divisor = 1 << -delta + need(all(v % divisor == 0 for z in value for v in z), 'exact downshift') + return [(a // divisor, b // divisor) for a, b in value] + + +def norm2(value): + return sum(a*a + b*b for a, b in value) + + +def difference(a, b): + return [(x-u, y-v) for (x, y), (u, v) in zip(a, b)] + + +def execute_collector(sources, query, f, b, left, right, observer=None): + """Execution path: mutate query, restore private C; no array snapshots. + + Optional observer is verifier instrumentation, absent in the execution. + """ + need(len(sources) == 5 and all(len(v) == 512 for v in sources) + and len(query) == 512, 'collector shape') + need(all(type(t) is int for v in sources + [query] for z in v for t in z), + 'integer collector entrance') + meter = dict(pairs=0, wrapper_values=0, field_adds=0) + c = [(0, 0)] * 512 + for source in sources: + for j, (x, y) in enumerate(source): + a, z = c[j] + c[j] = (a+x, z+y) + meter['field_adds'] += 1 + if observer: + observer('entrance', c) + F = working_grid(c, f, b) + for j, (a, z) in enumerate(c): + c[j] = (a << (F-f), z << (F-f)) + kernel(c, 7, left, right, meter=meter) + if observer: + observer('sent', c) + for j, ((a, z), (x, y)) in enumerate(zip(query, c)): + query[j] = ((a << (F-f))+x, (z << (F-f))+y) + meter['field_adds'] += 1 + kernel(c, 7, left, right, inverse=True, meter=meter) + if observer: + observer('returned', c) + divisor = 1 << (F-f) + for j, (a, z) in enumerate(c): + need(a % divisor == z % divisor == 0, 'exact downshift') + c[j] = (a // divisor, z // divisor) + for source in reversed(sources): + for j, (x, y) in enumerate(source): + a, z = c[j] + c[j] = (a-x, z-y) + meter['field_adds'] += 1 + need(all(a == z == 0 for a, z in c), 'private erasure') + if observer: + observer('private', c) + return F, meter + + +def collector(sources, query, f, b, left, right): + """Instrumentation wrapper, deliberately separate from execution storage.""" + snapshots = {} + q = list(query) + F, meter = execute_collector(sources, q, f, b, left, right, + lambda name, value: snapshots.update({name: list(value)})) + need(snapshots['returned'] == shift(snapshots['entrance'], F-f), 'exact paired return') + return dict(query=q, grid=F, meter=meter, **snapshots) + + +def invoice(n=512, rank=7, wrapper_cycles=0): + """Logical scalar-reference currency; no physical tape tariff inferred.""" + pairs = rank * n # outbound plus return + return dict(pairs=pairs, real_adds=8*pairs+22*n, + floor_halves=4*pairs, quarter_turns=pairs, + wrapper_values=4*n, field_adds=11, + source_component_reads=20*n, query_component_adds=2*n, + embedding_components=4*n, downshift_components=2*n, + magnitude_scan_components=2*n, zero_scan_components=2*n, + entrance_validation_components=12*n, + private_initialization_components=2*n, + wrapper_cycles=wrapper_cycles, wrapper_swaps=4*n+wrapper_cycles, + wrapper_swap_component_reads=4*(4*n+wrapper_cycles), + wrapper_swap_component_writes=4*(4*n+wrapper_cycles), + butterfly_component_reads=4*pairs, + butterfly_component_writes=4*pairs, + field_add_component_reads=44*n, + field_add_component_writes=22*n) diff --git a/research/native-rounded-loop-defect/test_package.py b/research/native-rounded-loop-defect/test_package.py new file mode 100644 index 0000000000..48c6ca799a --- /dev/null +++ b/research/native-rounded-loop-defect/test_package.py @@ -0,0 +1,27 @@ +"""Isolated package-boundary faults; no shared source mutation.""" +import json,shutil,subprocess,sys,tempfile +from pathlib import Path +HERE=Path(__file__).resolve().parent + +def need(ok,why): + if not ok:raise ValueError(why) +def run(p,opt):return subprocess.run([sys.executable,'-I']+opt+['-B',str(p/'verify.py')],capture_output=True,text=True,timeout=15) +for opt in ([],['-O']): + with tempfile.TemporaryDirectory() as tmp: + p=Path(tmp)/'package';shutil.copytree(HERE,p) + for item in [p]+list(p.rglob('*')):item.chmod(0o700 if item.is_dir()else 0o600) + result=run(p,opt);need(result.returncode==0,'isolated baseline '+result.stderr) + source=p/'source/lifting.py';old=source.read_bytes();source.write_bytes(old+b'\nraise RuntimeError("UNAUTHENTICATED_CODE_EXECUTED")\n') + result=run(p,opt);need(result.returncode!=0 and 'source authentication' in result.stderr and 'UNAUTHENTICATED_CODE_EXECUTED' not in result.stderr,'authenticate before executing source') + source.write_bytes(old) + receipt=p/'RESULT.json';old=receipt.read_bytes();data=json.loads(old);data['unexpected_field']='tampered';receipt.write_text(json.dumps(data)) + result=run(p,opt);need(result.returncode!=0 and 'receipt equality' in result.stderr,'typed whole receipt rejection');receipt.write_bytes(old) + data=json.loads(old) + if 'witness_input' in data:data['witness_input'][0][0]=True + else:data['fused_gates']=float(data['fused_gates']) + receipt.write_text(json.dumps(data));result=run(p,opt) + need(result.returncode!=0 and 'receipt equality' in result.stderr,'bool/int or float/int receipt type rejection');receipt.write_bytes(old) + if (p/'RECIPES.json').exists(): + q=p/'RECIPES.json';data=json.loads(q.read_text());data[0]['left']['phase']=(data[0]['left']['phase']+1)%4;q.write_text(json.dumps(data));result=run(p,opt) + need(result.returncode!=0 and 'native recipe receipt' in result.stderr,'native recipe mutation rejection') +print('PASS_PACKAGE_BOUNDARY_CONTROLS normal and optimized') diff --git a/research/native-rounded-loop-defect/verify.py b/research/native-rounded-loop-defect/verify.py new file mode 100644 index 0000000000..284ec40ce6 --- /dev/null +++ b/research/native-rounded-loop-defect/verify.py @@ -0,0 +1,87 @@ +"""Literal native-loop lifting obstruction. JoyboyBrian/OpenAI, Apache-2.0.""" +import gzip,hashlib,importlib.util,json,sys +from pathlib import Path +from fractions import Fraction as F +from collections import defaultdict,deque +p=Path(__file__).resolve().parent + +def need(ok,why): + if not ok:raise ValueError(why) +for pin in json.loads((p/'PINS.json').read_text()): + need(hashlib.sha256((p/pin['path']).read_bytes()).hexdigest()==pin['sha256'],'source authentication '+pin['path']) +def load(name): + spec=importlib.util.spec_from_file_location(name,p/'source'/(name+'.py'));mod=importlib.util.module_from_spec(spec);sys.modules[name]=mod;spec.loader.exec_module(mod);return mod +ce=load('clifford_exact');lift=load('lifting') +STEPS=((0,True),(1,False),(2,False),(3,True)) + +def mono(rec): + return ce.diag(9,tuple(rec['quadratic_rows']),tuple(rec['linear_Z4'])).then(ce.perm(9,tuple(rec['matrix_rows']))).then(ce.xgate(9,rec['offset'])).then(ce.Op(9,ce.identity(9),[('phase',rec['phase'])])) +def equal(a,b):return a.tab==b.tab and a.zero_state()==b.zero_state() +def rotate(z,k): + a,b=z + if k%4==0:return a,b + if k%4==1:return -b,a + if k%4==2:return -a,-b + return b,-a + +def wrapper(v,rec,inverse=False): + # Independently interpret signed affine recipe; no lifting plan is called. + out=[None]*512 + for x in range(512): + y=rec['offset'] + for j,row in enumerate(rec['matrix_rows']):y^=((row&x).bit_count()%2)<>j)&1)*rec['linear_Z4'][j]for j in range(9)) + phase+=2*sum(((x>>j)&1)*((x>>k)&1)*((rec['quadratic_rows'][j]>>k)&1)for j in range(9)for k in range(j+1,9)) + if inverse:out[x]=rotate(v[y],-phase) + else:out[y]=rotate(v[x],phase) + need(all(z is not None for z in out),'independent wrapper bijection') + return out + +def independent(v,rec,inverse=False,ideal=False): + v=wrapper(v,rec['left' if inverse else 'right'],inverse) + for x in range(0,512,2): + a,b=v[x],v[x+1];d=(a[0]-b[0],a[1]-b[1]) + half=lambda z:F(z,2) if ideal else z//2 + s=(b[0]+half(d[0]),b[1]+half(d[1]));e=rotate(d,-1 if inverse else 1) + b=(s[0]-half(e[0]),s[1]-half(e[1]));a=(b[0]+e[0],b[1]+e[1]);v[x],v[x+1]=a,b + return wrapper(v,rec['right' if inverse else 'left'],inverse) + +def main(): + word=json.loads(gzip.decompress((p/'source/ACTUAL-WORD.json.gz').read_bytes()));program=word['programs']['forward'];frames=word['canonical']['frames'] + cert=json.loads(gzip.decompress((p/'source/graph-certificate.json.gz').read_bytes()))['forward'] + expected={8160:['climb','warp_retimed',230,0,29,1],8148:['climb','warp_retimed',224,0,2,1],8196:['climb','warp_retimed',0,2,341,1],8197:['climb','warp_retimed',27,29,341,1]} + for i,e in expected.items():need(program[i]==e,'literal event binding') + need(all(i in cert['forest_event_ids']for i in (8160,8148,8196)) and 8197 in cert['chord_event_ids'],'fundamental cycle binding') + need([frames[i]for i in (0,29,2,341)]==[[],[38],[11],[38,11]],'literal frames') + recipes=[];ops=[] + for a,b in ((0,29),(0,2),(2,341),(29,341)): + op=ce.canonical_frame(9,frames[a]).adjoint().then(ce.canonical_frame(9,frames[b]));rec,_=ce.lower_child(op) + need(rec['rank']==1,'actual paid rank1');decoded=mono(rec['right']).then(ce.fourier(9,[0])).then(mono(rec['left'])) + need(equal(op,decoded),'signed native recipe exact including phase');recipes.append(rec);ops.append(op) + need(json.dumps(recipes,sort_keys=True)==json.dumps(json.loads((p/'RECIPES.json').read_text()),sort_keys=True),'native recipe receipt') + product=ce.ident(9) + for j,inv in STEPS:product=product.then(ops[j].adjoint()if inv else ops[j]) + need(equal(product,ce.ident(9)),'ideal closed walk identity with absolute phase') + plans=[(lift.plan(q['left']),lift.plan(q['right']))for q in recipes] + start=[(0,0)]*512;start[1]=(1,0);v=start[:];ref=start[:];ideal=start[:];meter=dict(pairs=0,wrapper_values=0);cuts=[] + for j,inv in STEPS: + before=v[:];lift.kernel(v,1,*plans[j],inverse=inv,meter=meter);ref=independent(ref,recipes[j],inv);ideal=independent(ideal,recipes[j],inv,True) + need(v==ref,'independent floor and wrapper replay') + back=v[:];lift.kernel(back,1,*plans[j],inverse=not inv);need(back==before,'same child exact inverse') + cuts.append([[i,list(z)]for i,z in enumerate(v)if z!=(0,0)]) + expected_output=[[1,[0,1]],[10,[1,0]],[39,[1,0]]] + need(cuts[-1]==expected_output,'exact nonzero holonomy');need(ideal==start,'independent rational loop identity') + need(v!=start,'flatness falsified') + for j,inv in reversed(STEPS):lift.kernel(v,1,*plans[j],inverse=not inv) + need(v==start,'whole literal reverse restores witness') + # Grid-translation positive control: even enough input makes all floors exact. + v=[(a*16,b*16)for a,b in start] + for j,inv in STEPS:lift.kernel(v,1,*plans[j],inverse=inv) + need(v==[(a*16,b*16)for a,b in start],'aligned lattice positive control') + # Altering one global phase is invisible to a tableau-only check, but rejected here. + changed=json.loads(json.dumps(recipes[0]));changed['left']['phase']=(changed['left']['phase']+1)%4 + bad=mono(changed['right']).then(ce.fourier(9,[0])).then(mono(changed['left'])) + need(bad.tab==ops[0].tab and not equal(bad,ops[0]),'absolute phase fault detection') + result=dict(events=[8160,8148,8196,8197],directions=['inverse','forward','forward','inverse'],frames=[29,0,2,341,29],witness_input=[[1,[1,0]]],witness_output=expected_output,defect_squared_norm=4,cuts=cuts,meter=meter,claim='Every dyadic grid has a scaled witness; exact child inverses do not imply native graph flatness.') + need(json.dumps(result,sort_keys=True)==json.dumps(json.loads((p/'RESULT.json').read_text()),sort_keys=True),'receipt equality');print('PASS_NATIVE_ROUNDED_LOOP_DEFECT '+json.dumps(result,sort_keys=True)) +if __name__=='__main__':main()