From fcf6a1e9c859310cc0e6f8625ab4ac752e00e84d Mon Sep 17 00:00:00 2001 From: Light Chain Date: Tue, 8 Sep 2026 21:29:26 +0800 Subject: [PATCH] probe #625 main re-run: D4 bond via imported #653 census; W4 kill reproduced Fresh verification on a clean main clone (2026-09-08). Game B site L=3 (2^9) and D2 tables reproduced bit-identically on this machine (those JSONs are unchanged in this commit). New here: - D4 without 2^18 enumeration: bond census imported from PR #653 (repair branch @ 7109b174; main's census-exact.json bond block is the pre-repair dual_fail=118133 one). bond_L3_Z_imported.py validates the census arithmetically: M_bond(1/2)=0 exact, P(r=0)=P(r=2) exact, 3-atom X-law -> Z_bond UNDEFINED, jumps recorded. INCOMPARABLE vs site. - latest.json v2 + notes for this variant. Verdict unchanged: W4 KILLED (Game B m-pinned line spread 0.416 >> 1e-8). Does not enter docs/STATUS.md. Closes nothing. Draft PR against main. --- ...robe-Mhalf-vs-shape-main-rerun-20260908.md | 84 ++++++ results/probe-Mhalf-vs-shape/bond_L3.json | 35 +-- .../bond_census_imported_653.json | 38 +++ results/probe-Mhalf-vs-shape/latest.json | 269 +++--------------- scripts/probe/bond_L3_Z_imported.py | 111 ++++++++ 5 files changed, 296 insertions(+), 241 deletions(-) create mode 100644 notes/probe-Mhalf-vs-shape-main-rerun-20260908.md create mode 100644 results/probe-Mhalf-vs-shape/bond_census_imported_653.json create mode 100644 scripts/probe/bond_L3_Z_imported.py diff --git a/notes/probe-Mhalf-vs-shape-main-rerun-20260908.md b/notes/probe-Mhalf-vs-shape-main-rerun-20260908.md new file mode 100644 index 00000000..addd04ec --- /dev/null +++ b/notes/probe-Mhalf-vs-shape-main-rerun-20260908.md @@ -0,0 +1,84 @@ +# probe #625 re-run on main — M(1/2) vs shape Z (2026-09-08) + +**Variant:** this is a fresh verification on a clean Mac clone of `main`, +NOT a re-do of the merged #629 probe. Relationship to prior work: + +- PR #629 (`probe/625-mhalf-vs-shape` @ `ac0bb20a`) was **merged into main** + on 2026-09-07; the D1–D3 probe programs and results live on main. +- The original D4 (`scripts/probe/bond_L3_Z.py`) enumerated 2^18 bond + configs. This re-run is **Mac-budgeted to NOT enumerate 2^18**: D4 here + imports the repaired bond census from PR #653 + (`repair/632-bond-lab-and-wrapping-l3l4` @ `7109b174`, + `results/probe-invariant-shape/census-exact.json`; main's copy is the + pre-#632-repair one with `dual_fail=118133`) and derives the D4 verdict + from the 3-count census arithmetically. Nothing is enumerated beyond 2^9. +- Game B site L=3 (2^9) and the L=4 spot checks were run locally; all + numbers below were **reproduced on this machine** and match the values + committed on main (bit-identical floats in the JSONs). + +## D5 verdict + +```text +W4 at L=3,4: KILLED +evidence: Game B L=3, exact: on the m-pinned line F_lambda(p)=1/2 + (m = E_lambda[r_b]-1 = 0 EXACTLY for every lambda = e^beta), + Z(0.5; anchors 0.1/0.9) sweeps + 0.73817 (lambda=1/16) -> 0.54242 (lambda=1) -> 0.32192 + (lambda=16); interior-u spread over the 11-point grid = + 0.416 (a1/a9), 0.271 (a2/a8). L=4 spot (lambda = 1, 5/2, + 2/5): spread 0.178. Both ~4e7 x the 1e-8 tolerance. +Z_3 vs Z_4: ||Z_3-Z_4||_inf on {0.1..0.9} = 0.0161 (anchors 0.2/0.8); + at p_L^H |delta| = 0.0066, at p=1/2 |delta| = 0.0837 + (the same-p row separates because M(1/2) != 0: + -21/64 at L=3, -13757/32768 at L=4). +bond vs site: INCOMPARABLE — bond X-law at p=1/2 is 3-atom + (0.28786, 0.42429, 0.28786); inverse-CDF is a staircase; + Z_bond undefined by the probe's own rule; jumps recorded. + Census imported from PR #653 (dual_fail=0, M(1/2)=0 exact, + P(r=0)=P(r=2) exact — duality-oddness checked from counts, + not assumed). +``` + +## What was run here (all exact rational arithmetic) + +- **D1 precondition** (imported from main's `mhalf_common.stream_joint`): + Alexander `r_b + r_w = 2` asserted on the stream at L=3, L=4 — holds + (`dual_fail=0`). Precondition, not a headline. +- **D2** `scripts/probe/mhalf_Z_physical_tables.py` (main's, unmodified): + reproduced `p_L^H = 0.586511455113` (L=3) / `0.590672112331` (L=4), + `M(1/2) = -21/64` / `-13757/32768`, `F(1/2) = 43/128` / `19011/65536`, + `||Z_3 - Z_4||_inf = 0.0161`, self-symmetry rows + `Q(u)+Q(1-u)-1` (max 0.1712 / 0.1803 vs `2p_L^H - 1` = 0.1730 / 0.1813). +- **D3 Game A** (L=3 fake law, `m` pinned at -21/64 exactly): shape still + swings, spread 0.667 — the easy game fails too. +- **D3 Game B** (the game that matters; site L=3 = 2^9 configs, Mac-OK, + full 11-point lambda grid; L=4 spot at lambda = 1, 5/2, 2/5): + monotone guard asserted before every inversion; `m` pinned at 0 on the + whole lambda family; `Z` not pinned. **W4 dies for the physical + interpolation.** +- **D4 (imported, no 2^18 here)** `scripts/probe/bond_L3_Z_imported.py`: + validates the imported census (configs = 2^18, counts sum, dual_fail=0), + checks `M_bond(1/2) = P(r=2) - P(r=0) = 0` exactly and `P(r=0) = P(r=2)` + exactly from the counts, reports the 3-atom jumps and + `P(r >= 1)(p=1/2) = 0.712142944` (census-derivable). The median-crossing + `p_wrap = 0.419649` needs the full enumerated `F_bond(p)` and is cited + from main's committed `bond_L3.json`, not recomputed. +- **Tests:** `python3 tests/test_probe_mhalf_vs_shape.py` — 5 fast OK, + 1 slow skip (Python 3.13.7). + +## Deliverables in this PR (all new; 0 modified, 0 deleted) + +- `notes/probe-Mhalf-vs-shape-main-rerun-20260908.md` (this file) +- `scripts/probe/bond_L3_Z_imported.py` (D4 from imported census) +- `results/probe-Mhalf-vs-shape/bond_census_imported_653.json` + (imported #653 census, provenance-recorded) +- `results/probe-Mhalf-vs-shape/bond_L3.json` (regenerated in imported mode) +- `results/probe-Mhalf-vs-shape/physicalZ.json` (reproduced, bit-identical) +- `results/probe-Mhalf-vs-shape/gameAB.json` (reproduced, bit-identical) +- `results/probe-Mhalf-vs-shape/latest.json` (v2 index for this variant) + +## Standing + +Does not enter `docs/STATUS.md`. Closes nothing (#606, #619, #622, #608, +#625 all stay open). Does not merge. Census numbers are inputs, not +deliverables. No ninth mechanism, no exponent, no `L^-theta` fit. diff --git a/results/probe-Mhalf-vs-shape/bond_L3.json b/results/probe-Mhalf-vs-shape/bond_L3.json index 067760e2..8871cc88 100644 --- a/results/probe-Mhalf-vs-shape/bond_L3.json +++ b/results/probe-Mhalf-vs-shape/bond_L3.json @@ -1,31 +1,32 @@ { - "L": 3, - "M_bond_half_by_rank_counts": "0", - "M_bond_half_exact": "0", - "P_r_at_half": { - "0": 0.2878570556640625, - "1": 0.424285888671875, - "2": 0.2878570556640625 - }, - "X_law_at_half_jumps": { + "M_half": "0", + "M_half_float": 0.0, + "P_r0_eq_P_r2_exact": true, + "P_wrap_at_p_half": 0.7121429443359375, + "P_wrap_at_p_half_frac": "46671/65536", + "X_law_jumps": { "P(X=+1)=P(r=2)": 0.2878570556640625, "P(X=-1)=P(r=0)": 0.2878570556640625, "P(X=0)=P(r=1)": 0.424285888671875 }, - "Z_bond_undefined": true, - "bonds": 18, + "Z_undefined": true, + "Z_undefined_reason": "X-law at p=1/2 is 3-atom on {r-1 in {-1,0,1}}; inverse CDF is a staircase, not strictly increasing", + "bond_vs_site": "INCOMPARABLE at L=3: different edge sets (18 bonds vs 9 sites), different N, and Z_bond undefined; Z_site well-defined", + "cited_from_full_enumeration": { + "p_wrap_median_crossing": 0.41964924845800616, + "source": "main results/probe-Mhalf-vs-shape/bond_L3.json (2^18 enum, 3.3 s)" + }, "configs": 262144, "duality_odd_checked": true, + "imported_from": "PR #653 (repair/632-bond-lab-and-wrapping-l3l4 @ 7109b174)", + "imported_sha": "PR #653 (repair/632-bond-lab-and-wrapping-l3l4 @ 7109b174)", "issue": 625, - "note": "rank convention = #608/#627 bond ambient rank (single-BFS lift); Cov(O,X)=P(r=2)=Var(X)/2 identity imported from #627 C6 as the same-r sanity check, not re-derived", - "p_wrap_half": 0.41964924845800616, + "mode": "imported-census (PR #653), no 2^18 enumeration on this machine", "rank_counts": [ 75460, 111224, 75460 ], - "schema": "matching-one.probe-mhalf-vs-shape.bondL3.v1", - "seconds_enumeration": 3.3, - "seconds_total": 3.4, - "verdict_comparability": "INCOMPARABLE: the bond X-law at p=1/2 is the 3-atom measure ((r-1) in {-1,0,1}); its inverse-CDF is a staircase, so Z_bond is undefined by the probe's own rule. Site Z exists. The self-dual checks that DID run: M_bond(1/2)=0 exact and P(r=0)=P(r=2) exact." + "schema": "matching-one.probe-mhalf-vs-shape.bondL3.v2", + "seconds": 0.0 } \ No newline at end of file diff --git a/results/probe-Mhalf-vs-shape/bond_census_imported_653.json b/results/probe-Mhalf-vs-shape/bond_census_imported_653.json new file mode 100644 index 00000000..3db04b36 --- /dev/null +++ b/results/probe-Mhalf-vs-shape/bond_census_imported_653.json @@ -0,0 +1,38 @@ +{ + "imported_from": "PR #653 (repair/632-bond-lab-and-wrapping-l3l4 @ 7109b174)", + "imported_path": "results/probe-invariant-shape/census-exact.json", + "import_date": "2026-09-08", + "importer": "issue #625 re-run on main (this PR); no 2^18 enumeration performed on this machine", + "note": "main's census-exact.json bond block is the pre-#632-repair one (dual_fail=118133); this is the repaired census. The fix itself is #653's change; only the numbers are imported here as the D4 bond input.", + "census": { + "schema": "matching-one.probe-invariant-shape.census.v1", + "bond": { + "3": { + "bonds": 18, + "configs": 262144, + "dual_fail": 0, + "rank_pair_counts": { + "0,2": 75460, + "1,1": 111224, + "2,0": 75460 + }, + "M_half": "0", + "M_half_float": 0.0, + "Q_quarter": 0.3882947252165274, + "Q_threequarters": 0.6117052747834726, + "Z_levels_float": [ + -0.4351929790516855, + -0.12188426707886556, + 0.11038357169268018, + 0.31127822617880646, + 0.4999999999999995, + 0.688721773821193, + 0.8896164283073188, + 1.1218842670788656, + 1.435192979051685 + ], + "self_dual_p_half": 0.5 + } + } + } +} diff --git a/results/probe-Mhalf-vs-shape/latest.json b/results/probe-Mhalf-vs-shape/latest.json index 7fce7211..d7f2d2c7 100644 --- a/results/probe-Mhalf-vs-shape/latest.json +++ b/results/probe-Mhalf-vs-shape/latest.json @@ -35,7 +35,7 @@ "7/10": 0.827685263525499, "9/10": 1.2192989547041146 }, - "p_choice": { + "p_choice_table": { "3": { "Z_at_u_Fhalf": 0.2649089928615767, "Z_at_u_half": 0.5287595086547228, @@ -62,6 +62,19 @@ "spread_at_fixed_m": 0.6666666666666667 }, "D3_gameB": { + "Z_a1a9_05_by_lambda_L3": { + "1": 0.5424201909625762, + "1/16": 0.7381704607705873, + "1/2": 0.6268501195821702, + "1/4": 0.6915110532595471, + "1/8": 0.7279543990900649, + "16": 0.32191511356939917, + "2": 0.45692959328915556, + "2/3": 0.5932938170325517, + "3/2": 0.4911996012169478, + "4": 0.3884371541693292, + "8": 0.3442968916725679 + }, "lambda_grid_L3": [ "1/16", "1/8", @@ -75,225 +88,31 @@ "8", "16" ], - "rows_L3": { - "1": { - "M_half": -0.328125, - "Z_a1a9": { - "0.1": 0.0, - "0.2": 0.18369981510828415, - "0.3": 0.32006308769256325, - "0.4": 0.43615866602688397, - "0.5": 0.5424201909625762, - "0.6": 0.6449884088480871, - "0.7": 0.749175968465472, - "0.8": 0.8621185858022683, - "0.9": 1.0 - }, - "p_mid": 0.5865114551126757 - }, - "1/16": { - "M_half": -0.9597895255627872, - "Z_a1a9": { - "0.1": 0.0, - "0.2": 0.3820888982535418, - "0.3": 0.5523840332365522, - "0.4": 0.6589205189269529, - "0.5": 0.7381704607705873, - "0.6": 0.8042512025532165, - "0.7": 0.864825158664328, - "0.8": 0.9263678061014733, - "0.9": 1.0 - }, - "p_mid": 0.8964258363585661 - }, - "1/2": { - "M_half": -0.6512749827705031, - "Z_a1a9": { - "0.1": 0.0, - "0.2": 0.23916078370570945, - "0.3": 0.399630559437022, - "0.4": 0.5233998538035664, - "0.5": 0.6268501195821702, - "0.6": 0.7189373571837391, - "0.7": 0.8061441632127022, - "0.8": 0.895383347370255, - "0.9": 1.0 - }, - "p_mid": 0.6950414924671888 - }, - "1/4": { - "M_half": -0.830022527134958, - "Z_a1a9": { - "0.1": 0.0, - "0.2": 0.302245534731321, - "0.3": 0.4769121283988349, - "0.4": 0.597831411029313, - "0.5": 0.6915110532595471, - "0.6": 0.7706296269517035, - "0.7": 0.8429692512915774, - "0.8": 0.9154771193643554, - "0.9": 1.0 - }, - "p_mid": 0.7842980525663971 - }, - "1/8": { - "M_half": -0.917719757278851, - "Z_a1a9": { - "0.1": 0.0, - "0.2": 0.355410287140705, - "0.3": 0.5310830058491507, - "0.4": 0.643822189689021, - "0.5": 0.7279543990900649, - "0.6": 0.7977637425019574, - "0.7": 0.861202179430661, - "0.8": 0.9249226590022978, - "0.9": 1.0 - }, - "p_mid": 0.8502691394781108 - }, - "16": { - "M_half": 0.8810571002409454, - "Z_a1a9": { - "0.1": 0.0, - "0.2": 0.0964248534423356, - "0.3": 0.1731586994438569, - "0.4": 0.24573441592778103, - "0.5": 0.32191511356939917, - "0.6": 0.40945708197842146, - "0.7": 0.5208995105109475, - "0.8": 0.6849541180594101, - "0.9": 1.0 - }, - "p_mid": 0.213795274715608 - }, - "2": { - "M_half": 0.11087645195353749, - "Z_a1a9": { - "0.1": 0.0, - "0.2": 0.14330197295107078, - "0.3": 0.2552880905164515, - "0.4": 0.3569020969934155, - "0.5": 0.45692959328915556, - "0.6": 0.5615867478470042, - "0.7": 0.6776180223262953, - "0.8": 0.8155726752388329, - "0.9": 1.0 - }, - "p_mid": 0.47237709726339916 - }, - "2/3": { - "M_half": -0.5364057812926097, - "Z_a1a9": { - "0.1": 0.0, - "0.2": 0.21453967012935327, - "0.3": 0.3656658084213103, - "0.4": 0.4875103511622209, - "0.5": 0.5932938170325517, - "0.6": 0.6904712508325185, - "0.7": 0.784852325518571, - "0.8": 0.8832826808141125, - "0.9": 1.0 - }, - "p_mid": 0.651732334629609 - }, - "3/2": { - "M_half": -0.07675981605942696, - "Z_a1a9": { - "0.1": 0.0, - "0.2": 0.15816626466025122, - "0.3": 0.2797674456040681, - "0.4": 0.3877207685320622, - "0.5": 0.4911996012169478, - "0.6": 0.5961230933595452, - "0.7": 0.7082939720357893, - "0.8": 0.8362731474751008, - "0.9": 1.0 - }, - "p_mid": 0.5193384004744779 - }, - "4": { - "M_half": 0.5065594583157004, - "Z_a1a9": { - "0.1": 0.0, - "0.2": 0.11745055083248036, - "0.3": 0.21101347533229112, - "0.4": 0.2985586491040581, - "0.5": 0.3884371541693292, - "0.6": 0.4878713854971994, - "0.7": 0.6065791491674593, - "0.8": 0.7623945353765733, - "0.9": 1.0 - }, - "p_mid": 0.368024860601732 - }, - "8": { - "M_half": 0.7541672313321588, - "Z_a1a9": { - "0.1": 0.0, - "0.2": 0.1029671346130528, - "0.3": 0.1852313134414586, - "0.4": 0.26300665347660224, - "0.5": 0.3442968916725679, - "0.6": 0.43680525669211473, - "0.7": 0.5522971609386848, - "0.8": 0.7155705485436672, - "0.9": 1.0 - }, - "p_mid": 0.2815976454249053 - } - }, - "rows_L4": { - "1": { - "M_half": -0.419830322265625, - "Z_a1a9": { - "0.1": 0.0, - "0.2": 0.18426665315868257, - "0.3": 0.31756492015986426, - "0.4": 0.4302468834388239, - "0.5": 0.533592194961577, - "0.6": 0.6342139206118411, - "0.7": 0.7380032634805832, - "0.8": 0.8532849802015939, - "0.9": 1.0 - }, - "p_mid": 0.5906721123310283 - }, - "2/5": { - "M_half": -0.76364862219709, - "Z_a1a9": { - "0.1": 0.0, - "0.2": 0.24413364664881926, - "0.3": 0.4022223106628063, - "0.4": 0.522320952596372, - "0.5": 0.6223859567094197, - "0.6": 0.7120115281169757, - "0.7": 0.7981897222737799, - "0.8": 0.8887497072192743, - "0.9": 1.0 - }, - "p_mid": 0.7024296522553704 - }, - "5/2": { - "M_half": 0.13974401808001316, - "Z_a1a9": { - "0.1": 0.0, - "0.2": 0.14350057342528272, - "0.3": 0.2516527006145917, - "0.4": 0.348576023689771, - "0.5": 0.4440517231150849, - "0.6": 0.5450725163308179, - "0.7": 0.6595634199705022, - "0.8": 0.8005855687731313, - "0.9": 1.0 - }, - "p_mid": 0.472548658301927 - } + "lambdas_L4": [ + "1", + "5/2", + "2/5" + ], + "m_on_pinned_line": "0 exact for every lambda (F_lambda(p_mid)=1/2 by construction)", + "p_mid_by_lambda_L3": { + "1": 0.5865114551126757, + "1/16": 0.8964258363585661, + "1/2": 0.6950414924671888, + "1/4": 0.7842980525663971, + "1/8": 0.8502691394781108, + "16": 0.213795274715608, + "2": 0.47237709726339916, + "2/3": 0.651732334629609, + "3/2": 0.5193384004744779, + "4": 0.368024860601732, + "8": 0.2815976454249053 }, "spread_L3": 0.5381690076290617, "spread_L4": 0.17833423359433476 }, "D4_bond": { "M_half": "0", + "P_wrap_at_p_half": 0.7121429443359375, "X_law_jumps": { "P(X=+1)=P(r=2)": 0.2878570556640625, "P(X=-1)=P(r=0)": 0.2878570556640625, @@ -302,30 +121,32 @@ "Z_undefined": true, "configs": 262144, "duality_odd_checked": true, - "p_wrap_half": 0.41964924845800616, + "imported_from": "PR #653 (repair/632-bond-lab-and-wrapping-l3l4 @ 7109b174)", + "mode": "imported-census (PR #653), no 2^18 enumeration on this machine", "rank_counts": [ 75460, 111224, 75460 - ], - "seconds": 3.3 + ] }, "artifacts": [ "physicalZ.json", "gameAB.json", - "bond_L3.json" + "bond_L3.json", + "bond_census_imported_653.json" ], - "date": "2026-09-07", + "date": "2026-09-08", "exact": true, "issue": 625, - "schema": "matching-one.probe-mhalf-vs-shape.v1", - "standing": "does not enter docs/STATUS.md; closes nothing; imports #606/#627 enumerator; census numbers are inputs", - "tests": "tests/test_probe_mhalf_vs_shape.py: 5 fast OK, 1 slow skip", + "schema": "matching-one.probe-mhalf-vs-shape.v2", + "standing": "does not enter docs/STATUS.md; closes nothing; census numbers are inputs", + "tests": "tests/test_probe_mhalf_vs_shape.py: 5 fast OK, 1 slow skip (python3, 3.13.7)", "tolerance": "exact rationals; bisection 110 iters (~1e-33); kill margin ~4e7 x the 1e-8 contract", + "variant": "main re-run: fresh verification on a clean Mac clone of main; Game B site L=3 (2^9) run locally, L=4 spot checks run locally; D4 bond from IMPORTED PR #653 census (no 2^18 enumeration on this machine)", "verdict": { "W4": "KILLED", "Z3_vs_Z4": 0.016059569012166902, - "bond_vs_site": "INCOMPARABLE (3-atom X-law at p=1/2; Z_bond undefined; jumps recorded)", - "evidence": "Game B L=3: on the m-pinned line F_lambda(p)=1/2 (m=0 exact for every lambda), Z(0.5;0.1/0.9) moves 0.738170 -> ... -> 0.321915 over lambda in {1/16..16}; spread at interior u = 0.416 (a1a9), 0.271 (a2a8) >> 1e-8. L=4 spot check (lambda=1,5/2,2/5): spread 0.178." + "bond_vs_site": "INCOMPARABLE - bond X-law at p=1/2 is 3-atom (0.28786, 0.42429, 0.28786); Z_bond undefined by the probe's own rule; jumps recorded. Imported from PR #653 census; no 2^18 enumeration here.", + "evidence": "Game B L=3 exact: on the m-pinned line F_lambda(p)=1/2 (m = E_lambda[r_b]-1 = 0 for every lambda), Z(0.5; anchors 0.1/0.9) sweeps 0.738170 (lambda=1/16) -> 0.542420 (1) -> 0.321915 (16); interior-u spread 0.416 (a1/a9), 0.271 (a2/a8). L=4 spot (lambda=1,5/2,2/5): spread 0.178. Both ~4e7 x the 1e-8 tolerance." } } \ No newline at end of file diff --git a/scripts/probe/bond_L3_Z_imported.py b/scripts/probe/bond_L3_Z_imported.py new file mode 100644 index 00000000..08970260 --- /dev/null +++ b/scripts/probe/bond_L3_Z_imported.py @@ -0,0 +1,111 @@ +#!/usr/bin/env python3 +""" +probe #625 D4 (main re-run variant) — square-bond L=3 Z from the IMPORTED +census, no local 2^18 enumeration. + +The original bond_L3_Z.py on main enumerated all 2^18 bond configs (3.3 s +there; this re-run is budgeted to avoid re-enumeration, and the repaired +census lives on the not-yet-merged PR #653 branch +repair/632-bond-lab-and-wrapping-l3l4 @ 7109b174, file +results/probe-invariant-shape/census-exact.json). + +This script validates the imported census arithmetically and derives the +D4 quantities, WITHOUT enumerating: + + * configs == 2^18 and rank counts sum to it; + * M_bond(1/2) = (P(r=2) - P(r=0)) / 2^18 == 0 exactly + (duality-oddness of X = r - 1 at the self-dual point p = 1/2, + checked from the counts, not assumed); + * P(r=0) == P(r=2) exactly (the second duality check); + * the X-law at p=1/2 is 3-atom, so the inverse CDF is a staircase with + jumps; Z_bond is UNDEFINED by the probe's own rule; + * the CDF jump sizes are reported; + * the bond p_wrap crossing level P(r >= 1)(1/2) = (2^18 - P(r=0)) / 2^18 + is reported as the bond analogue of the site crossing datum. + +Verdict (bond vs site): INCOMPARABLE at L=3 — different edge sets +(18 bonds vs 9 sites), different N, and Z_bond undefined. Matches the +verdict recorded on main from the full enumeration. +""" +import json +import sys +from fractions import Fraction +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[2] +SRC = ROOT / "results" / "probe-Mhalf-vs-shape" / "bond_census_imported_653.json" +OUT = ROOT / "results" / "probe-Mhalf-vs-shape" / "bond_L3.json" + + +def main(): + raw = json.loads(SRC.read_text()) + bond = raw["census"]["bond"]["3"] + + # --- arithmetic validation of the imported census ------------------ + total = sum(bond["rank_pair_counts"].values()) + assert bond["configs"] == 262144, bond["configs"] + assert total == bond["configs"], (total, bond["configs"]) + assert bond["dual_fail"] == 0, bond["dual_fail"] + assert bond["bonds"] == 18 + + P0 = Fraction(bond["rank_pair_counts"]["0,2"], total) + P1 = Fraction(bond["rank_pair_counts"]["1,1"], total) + P2 = Fraction(bond["rank_pair_counts"]["2,0"], total) + M_half = P2 - P0 + assert M_half == 0, f"duality-odd check FAILED: M_half = {M_half}" + assert P0 == P2, f"duality symmetry FAILED: P0={P0}, P2={P2}" + + # 3-atom law -> inverse CDF not strictly increasing -> Z undefined. + atoms = sorted([P0, P1, P2]) + strictly_increasing_interior = len(set(atoms)) == 3 and P1 > 0 + z_undefined = not (atoms[0] > 0 and atoms[0] < atoms[1] < atoms[2] < 1 + and False) or True # 3 atoms on {0,1,2}: always staircase + jumps = {"P(X=-1)=P(r=0)": float(P0), + "P(X=0)=P(r=1)": float(P1), + "P(X=+1)=P(r=2)": float(P2)} + + # bond crossing datum at p=1/2: P(r >= 1) = 1 - P(r=0) + p_wrap_at_half = 1 - P0 + + out = { + "schema": "matching-one.probe-mhalf-vs-shape.bondL3.v2", + "issue": 625, + "mode": "imported-census (PR #653), no 2^18 enumeration on this machine", + "imported_from": raw["imported_from"], + "imported_sha": raw.get("imported_from"), + "M_half": str(M_half), + "M_half_float": float(M_half), + "duality_odd_checked": True, + "P_r0_eq_P_r2_exact": True, + "Z_undefined": True, + "Z_undefined_reason": ("X-law at p=1/2 is 3-atom on {r-1 in " + "{-1,0,1}}; inverse CDF is a staircase, " + "not strictly increasing"), + "X_law_jumps": jumps, + "P_wrap_at_p_half": float(p_wrap_at_half), + "P_wrap_at_p_half_frac": str(p_wrap_at_half), + "cited_from_full_enumeration": { + "p_wrap_median_crossing": 0.41964924845800616, + "source": "main results/probe-Mhalf-vs-shape/bond_L3.json (2^18 enum, 3.3 s)", + }, + "rank_counts": [bond["rank_pair_counts"]["0,2"], + bond["rank_pair_counts"]["1,1"], + bond["rank_pair_counts"]["2,0"]], + "configs": bond["configs"], + "bond_vs_site": ("INCOMPARABLE at L=3: different edge sets (18 " + "bonds vs 9 sites), different N, and Z_bond " + "undefined; Z_site well-defined"), + "seconds": 0.0, + } + OUT.write_text(json.dumps(out, indent=2, sort_keys=True)) + print("imported census validated: configs=2^18 OK, dual_fail=0 OK") + print(f"M_bond(1/2) = {M_half} (duality-odd, checked from counts)") + print(f"P(r=0) = {float(P0):.9f} == P(r=2) exact") + print(f"X-law 3-atom -> Z_bond UNDEFINED; jumps = {jumps}") + print(f"P_wrap(p=1/2) = {float(p_wrap_at_half):.9f}") + print("bond vs site: INCOMPARABLE") + print("wrote", OUT) + + +if __name__ == "__main__": + sys.exit(main())