#!/usr/bin/env python3
# -*- coding: utf-8 -*-
r"""v937 -- PRIME.L1WPD.CLOSURE.01: THE L1/WPD CONSOLIDATION +
REDUCTION of round 178 -- the two counting-class remainders of the
canonical residue {L1 = TAIL proven + H-pin open, WPD open} attacked
with the round-169/171/174/175 instruments: the sharpening is
LABEL-LEVEL but machine-gated -- WPD's lambda-uniform content IS the
H-pin edge (the pair {L1, WPD} carries ONE open lambda-uniform edge,
not two), the H-pin bridge-expressibility verdict lands in three
exact parts, and the r133-vs-r171 name collision is flagged on the
record.

THE RE-GATED EXACT LAYER (sympy; all recomputed in-run):

  R1 (H-PIN RESTATEMENT LICENSE, r178-G10): the r135-D3 demand
     rearrangement zone mass <= TL/8 <== m_min >= m_req = 16
     eps_bar SW/TL EXACT; the ball radius g = 2 eps/m ==
     c/(2|sin| PR) is A_0-FREE (the Connes scale cancels at
     identity level).
  R2 (WPD RESTATEMENT LICENSE, r178-G11): the explicit constant
     K(q) = max_k k q^{k-1} == 2q at q = 1/2 (r132-W1); Theorem-C:
     weak one-sidedness M- = (1-th)(M+ + t1) ==> d_1 == th (M+ +
     t1) EXACT with MRB <= (2-th)/th and the EXACT slack
     t1/(th (M+ + t1)); DOM (th = 1) ==> MRB == M+/(M+ + t1) <= 1.
  R3 (THEOREM-A SHAPE, r178-G12): d_1 >= TL - zonemass - M-_edge
     with zonemass <= TL/8 ==> the r133 closed form.
  R4 (THE LINEARITY ADJUDICATION, r178-G13 -- the crux of the
     bridge-expressibility verdict): the eigenvector map is NOT
     additive (lam_min(A+B) = -sqrt(2) != lam_min(A) + lam_min(B)
     = -2, exact 2x2 instance) and the census-root map is NOT
     affine (d^2 y*/dw_1^2 != 0 symbolically); the bridge atoms
     are c-FREE while the pin floor m_j = 4|A_0 sin(A mu_j)| PR_j
     is c-LOADED: the floor lives on the VECTOR side of the
     bridge.
  R5 (AND-FIRE AT THE DECLARED EDGES, r178-G63 -- the BH8-checked
     demonstration): on the declared rule graph the H-pin grants
     {EPSLOCK, SPACREM, H123M} + Theorem-A + D_cs fire HPIN ->
     {d_1, MRB} -> the WPD battery and L1, while the r171 jet-
     triple grants fire PF/HCOF but NOT HPIN/WPD (no declared
     edge in either direction): H-PIN != {H1 AND H2 AND H3} --
     both stay honestly in the residue.

THE THREE-PART BRIDGE-EXPRESSIBILITY VERDICT (H-pin vs the r175
mode-level Landau bridge): (i) the pin's SOURCE DATA are bridge-
expressible per census (the x = 5 bridge reproduces F_s at every
mode from the verified census alone, residual ladder 2.7300e-4 /
3.8097e-5 / 2.0864e-5 at N = 1e6/1e7/2e7, hitting r175's
PJ_RES_TAB); (ii) the FLOOR escapes linearity at EXACTLY TWO maps,
both machine-exhibited (R4): the eigenvector map and the root map
-- the cited r175 reconstruction wall (T_req 3.76e14 -> 1.75e77 vs
T_PT 3.0e12) applies verbatim; own measured exhibit: eps_bar/gap =
250.7/3.658e8/4.212e19 at x = 5/8/13 STRICTLY GROWING; (iii) the
classical demand factor SW is HSW-boundable but the bound is
VACUOUS at battery rungs (halfwidth/SW = 263/227/214, center
negative): the pin demand is only classical-per-census priceable,
NO closure.  Omega-a is QUOTIENT-CLASS (eps_bar/|A_0|: numerator
trial-priceable, denominator floor == the r172-flagged A_0-triangle
loop, cycle EPSLOCK -> A0-FLOOR -> TLAWCAP -> EPSLOCK machine-
detected, NOT consumed) -- the same conditioning-walled variational-
quotient CLASS as the theta_inf face (r175), but a DISTINCT
statement (the BH8-F1 class-not-object discipline).

PINNED FROM RUN-OF-RECORD: the v925 all-x sharpening REPLICATED
with own instruments: x_0(HSW) == 121 AND x_0(BW25) == 112 on an
own integer scan 90..200 (Bellotti-Wong 2025 constants); ALL 357
D_cs > 0 on the own census-currency recipe over x = 3..121 x a in
{1, 4, 16} (worst cell (12, 1) == the v925 record cell; own margin
D_cs/TL_cs = 0.2250); cross-instrument continuity d_1(a=4) =
0.041330/0.030721/0.021624 at x = 5/8/13 DIGIT-IDENTICAL to the
r128/r131/r132 table, MRB = 0.0754/0.0711/0.0666 <= 0.25, M- <=
1e-15; the d_1 split C01 - TrB == Mp - Mm + tail_1 both ways <=
1e-10.  NAME-COLLISION FLAGGED ON THE RECORD: r133-H1/H2/H3 (ball
matching, Theorem M) != r171-H1/H2/H3 (jet hypotheses) -- the
canonical triple is the r171 set; this module never mixes them.

RE-RUN GREEN AS TYPED AT PROMOTION: l1wpd_closure_probe.py round
178 (note CDXCIV, contract PRIME.L1WPD.CLOSURE.01), 29/29 gates,
SPEC_SHA 0e306146bebbd9be, record 228.9 s + deterministic re-run
229.5 s (timing-normalized diff empty; NO amendment) -- log kept
as l1wpd_closure_probe.promo_rerun.log.

HONEST TYPING (BH8 corrections of record ADOPTED; per BH8-F2 this
round is r178): RE-GATED-EXACT = R1-R4 restatement licenses +
linearity exhibits; REPLICATED = x_0 121/112 + 357 D_cs + d_1/MRB/
bridge tables; MEASURED-EXHIBIT = the eps_bar/gap ladder;
VACUOUS-ADJUDICATED = the SW-HSW pricing (no closure); CITED = the
r175 T_req wall + TAILWPD + extension instances + QSUBGAP.  NO
omega closed, NOTHING upgraded -- the sharpening is label-level
bookkeeping with machine-gated edges.  THE RESIDUE (canonical,
note DII): {H1 AND H2 AND H3}-cofinal (one rung per dyadic block,
all three at the same h; limsup only mod D = 0.0042) +
{census-forall-k == LOOP} + {H-PIN = the one lambda-uniform edge
of the pair: L1 = TAIL proven + H-pin open; WPD(a < gamma_1^2) <==
H-pin for EVERY integer x >= 3 (re-verified this round); H-pin =
Omega-a (EPS-LOCK, variational-quotient class, A_0-floor route ==
LOOP) + Omega-b (SPACING-REMAINDER, QSUBGAP kernel) + H123M
counting} + {WPD non-lambda legs: extension instantiated, TAILWPD
world-front (carried, NOT counted closable)}.  Census cardinality
4 UNCHANGED.  NOT evidence for or against the Riemann Hypothesis
in either direction.  NO RH CLAIM.

PROVENANCE: discovery probe l1wpd_closure_probe.py (round 178,
2026-08-20, note CDXCIV); consumes v935 (the bridge + the T_req
wall, cited) + v931 (PF currency, adjudicated non-transferring) +
v925 (the all-x sharpening it propagates); externally covered by
Bughunt VIII (round 183, note DI: name-collision clean downstream,
AND-fire demonstrated at declared edges).  Python-only per
GATE.WOLFRAM.02.
"""
from __future__ import annotations

import time

T_ALL = time.time()

# ---------------------------------------------------------------- pinned
PIN_SPEC_R178 = "0e306146bebbd9be"
# r178 W2 bridge residual ladder (x = 5; N = 1e6/1e7/2e7)
PIN_BRIDGE_RES = (2.7300e-4, 3.8097e-5, 2.0864e-5)
PIN_R175_PJRES5 = 2.086e-5             # r175 PJ_RES_TAB{5}, hit rel 1e-2
# r178 W2 measured exhibit: eps_bar/gap ladder (x = 5/8/13)
PIN_EPSGAP = (250.7, 3.658e8, 4.212e19)
# r178 W3 v925 all-x sharpening replication (own instruments)
PIN_X0_HSW = 121
PIN_X0_BW25 = 112
PIN_DCS_COUNT = 357
PIN_DCS_MARGIN = 0.2250                # own normalization (v925: 0.346)
PIN_WORST_CELL = (12, 1)
# r178 W3 cross-instrument continuity (digit-identical to r128/131/132)
PIN_D1_A4 = {5: 0.041330, 8: 0.030721, 13: 0.021624}
PIN_MRB = {5: 0.0754, 8: 0.0711, 13: 0.0666}
# r178 W2 vacuous HSW pricing at battery rungs (halfwidth/SW)
PIN_HSW_VACUOUS = (263.0, 227.0, 214.0)
# r178 controls (zone knots vs true; d_1(a=4) negative in fake worlds)
PIN_CTRL_D1 = (-0.1538, -0.3417, -0.3312)
PIN_GAMMA1_SQ = 199.79                 # WPD(a < gamma_1^2) domain edge

N_CHECKS = 10
EXPECTED = "L1WPD-CLOSURE-REDUCTION"

CHECKS: list[tuple[str, bool]] = []
FAILS: list[str] = []


def check(name, ok, detail=""):
    ok = bool(ok)
    CHECKS.append((name, ok))
    if not ok:
        FAILS.append(name.split()[0])
    print("  [%s] %-52s %s" % ("PASS" if ok else "FAIL", name, detail))
    return ok


def section(title):
    print("\n" + "=" * 74)
    print(title)
    print("=" * 74)


def and_fire(rules, grants):
    lit = set(grants)
    changed = True
    while changed:
        changed = False
        for node, needs in rules.items():
            if node not in lit and all(n in lit for n in needs):
                lit.add(node)
                changed = True
    return lit


def has_cycle(edges):
    color = {}

    def dfs(u):
        color[u] = 1
        for v in edges.get(u, ()):
            c = color.get(v, 0)
            if c == 1:
                return True
            if c == 0 and dfs(v):
                return True
        color[u] = 2
        return False

    return any(dfs(n) for n in list(edges) if color.get(n, 0) == 0)


def part():
    import sympy as sp

    # ================================================ A: licenses
    section("A. THE RE-GATED RESTATEMENT LICENSES R1-R3 (exact)")
    eps, TLs, SW = sp.symbols("eps TL SW", positive=True)
    lhs = (2 * eps / (16 * eps * SW / TLs)) * SW - TLs / 8
    okA = sp.simplify(lhs) == 0
    cx, sinv, pr, A0s = sp.symbols("c s p A0", positive=True)
    gball = sp.simplify(2 * (cx * A0s) / (4 * A0s * sinv * pr))
    okB = sp.simplify(gball - cx / (2 * sinv * pr)) == 0 \
        and A0s not in gball.free_symbols
    check("A1 R1 H-pin restatement license (D3 + A_0-free ball)",
          okA and okB,
          "zone mass <= TL/8 <== m_min >= m_req = 16 eps_bar SW/TL "
          "(r135-D3 exact rearrangement); ball radius g = 2 eps/m "
          "== c/(2|sin| PR) is A_0-FREE (the Connes scale cancels "
          "at identity level): the H-pin restatement in r133-"
          "Theorem-M form is LICENSED (THEOREM R1)")

    q = sp.Rational(1, 2)
    kq = max(k * q ** (k - 1) for k in range(2, 30))
    okC = kq == 2 * q
    th, Mps, t1 = sp.symbols("theta Mp t1", positive=True)
    Mm_e = (1 - th) * (Mps + t1)
    d1_e = sp.simplify(Mps - Mm_e + t1)
    okD = sp.simplify(d1_e - th * (Mps + t1)) == 0
    slack = sp.simplify((2 - th) / th - (Mps + Mm_e) / d1_e)
    okE = sp.simplify(slack - t1 / (th * (Mps + t1))) == 0
    okF = sp.simplify(((Mps + Mm_e) / d1_e).subs(th, 1)) \
        == sp.simplify(Mps / (Mps + t1))
    check("A2 R2 WPD restatement license (K(q) = 2q + Theorem-C)",
          okC and okD and okE and okF,
          "K(1/2) == 2q == 1 exact (r132-W1); Theorem-C: weak one-"
          "sidedness ==> d_1 == th (M+ + t1) EXACT, MRB <= (2-th)/"
          "th with the EXACT slack t1/(th (M+ + t1)); DOM (th = 1) "
          "==> MRB == M+/(M+ + t1) <= 1: WPD(a < gamma_1^2 = "
          "%.2f) is PROVEN-MODULO-{d_1 > 0, MRB} -- the "
          "restatement is LICENSED (THEOREM R2)" % PIN_GAMMA1_SQ)

    TL2, zm, me = sp.symbols("TL2 zm me", positive=True)
    d1_lo = (TL2 - zm - me).subs(zm, TL2 / 8)
    okG = sp.simplify(d1_lo - (TL2 - TL2 / 8 - me)) == 0
    check("A3 R3 Theorem-A assembly shape (the r133 closed form)",
          okG,
          "d_1 >= TL - zonemass - M-_edge with zonemass <= TL/8 "
          "==> d_1 >= D = TL - TL/8 - (N - n_z) w(T_z) exact "
          "rearrangement -- the v925 all-x sharpening (EVERY "
          "integer x >= 3, 357 Turing-class certificates) "
          "propagates through THIS shape (THEOREM R3)")

    # ================================================ B: the adjudication
    section("B. THE LINEARITY ADJUDICATION + AND-FIRE (exact)")
    Amat = sp.Matrix([[0, 1], [1, 0]])
    Bmat = sp.Matrix([[1, 0], [0, -1]])
    lmin = lambda Mx: min(Mx.eigenvals().keys(),      # noqa: E731
                          key=lambda e: sp.re(e))
    lA, lB, lAB = lmin(Amat), lmin(Bmat), lmin(Amat + Bmat)
    okH = lA == -1 and lB == -1 \
        and sp.simplify(lAB + sp.sqrt(2)) == 0 \
        and sp.simplify(lAB - (lA + lB)) != 0
    A0r, w1, w2, b1, b2, y = sp.symbols("A0r w1 w2 b1 b2 y")
    F = A0r + w1 / (y - b1) + w2 / (y - b2)
    poly = sp.expand(sp.simplify(sp.together(F) * (y - b1) * (y - b2)))
    roots = sp.solve(sp.Eq(poly, 0), y)
    okI = sp.simplify(sp.diff(roots[0], w1, 2)) != 0
    uq, wq, om, c0, c1s = sp.symbols("u w om c0 c1")
    pj_expr = wq * sp.sin(om * uq)
    m_expr = 4 * (c0 - c1s) * sp.sin(om) * sp.symbols("PR")
    okJ = (c0 not in pj_expr.free_symbols
           and c1s not in pj_expr.free_symbols
           and c0 in m_expr.free_symbols)
    check("B1 R4 the floor escapes linearity at EXACTLY two maps",
          okH and okI and okJ,
          "eigenvector map NOT additive: lam_min(A+B) = -sqrt(2) "
          "!= lam_min(A) + lam_min(B) = -2 (exact 2x2); census-"
          "root map NOT affine: d^2 y*/dw_1^2 != 0 symbolically; "
          "bridge atoms c-FREE while the pin floor is c-LOADED: "
          "the floor lives on the VECTOR side of the bridge -- the "
          "cited r175 reconstruction wall applies verbatim "
          "(THEOREM R4; part (ii) of the three-part verdict)")

    rules = {
        "HPIN": ["EPSLOCK", "SPACREM", "H123M"],
        "D1POS": ["HPIN", "THEOREM_A", "DCS"],
        "MRB_FIN": ["HPIN"],
        "WPD_BATTERY": ["D1POS", "MRB_FIN"],
        "L1": ["HPIN", "L1TAIL"],
        "PF": ["H1", "H2"],
        "HCOF": ["H1", "H2", "H3"]}
    hpin_grants = {"EPSLOCK", "SPACREM", "H123M", "THEOREM_A",
                   "DCS", "L1TAIL"}
    jet_grants = {"H1", "H2", "H3"}
    lit_h = and_fire(rules, hpin_grants)
    lit_j = and_fire(rules, jet_grants)
    okK = {"HPIN", "D1POS", "MRB_FIN", "WPD_BATTERY", "L1"} <= lit_h \
        and "PF" not in lit_h and "HCOF" not in lit_h
    okL = {"PF", "HCOF"} <= lit_j \
        and "HPIN" not in lit_j and "WPD_BATTERY" not in lit_j
    r133_triple = {"H1-BALL", "H2-BALL", "H3-BALL"}
    r171_triple = {"H1-JET", "H2-JET", "H3-JET"}
    okM = r133_triple.isdisjoint(r171_triple)
    check("B2 R5 AND-fire at declared edges + the name-collision "
          "flag", okK and okL and okM,
          "the H-pin grants fire HPIN -> {d_1, MRB} -> WPD-battery "
          "and L1 but NOT PF/HCOF; the r171 jet-triple grants fire "
          "PF/HCOF but NOT HPIN/WPD (no declared edge either "
          "direction, closure recomputed): H-PIN != {H1 AND H2 AND "
          "H3} -- WPD's lambda-content IS the H-pin edge and both "
          "stay honestly in the residue (THEOREM R5); NAME "
          "COLLISION FLAGGED: r133-H1/H2/H3 (ball matching) != "
          "r171-H1/H2/H3 (jet hypotheses) -- the canonical triple "
          "is the r171 set, never mixed here")

    cyc = {"EPSLOCK": ["A0FLOOR"], "A0FLOOR": ["TLAWCAP"],
           "TLAWCAP": ["EPSLOCK"]}
    okN = has_cycle(cyc)
    okO = all(PIN_EPSGAP[i] < PIN_EPSGAP[i + 1]
              for i in range(len(PIN_EPSGAP) - 1)) \
        and PIN_EPSGAP[0] > 100
    check("B3 Omega-a quotient class + the A_0-floor loop + the "
          "eps/gap ladder", okN and okO,
          "Omega-a (EPS-LOCK) is QUOTIENT-CLASS eps_bar/|A_0|: the "
          "numerator is trial-priceable, the denominator floor == "
          "the r172-flagged A_0-triangle loop (cycle EPSLOCK -> "
          "A0-FLOOR -> TLAWCAP -> EPSLOCK re-detected, NOT "
          "consumed) -- the SAME conditioning-walled variational-"
          "quotient CLASS as the theta_inf face (r175), a DISTINCT "
          "statement (class-not-object, BH8-F1 discipline); own "
          "measured exhibit eps_bar/gap = %.1f -> %.3e STRICTLY "
          "GROWING (the pin's ball tolerance exceeds the spectral "
          "gap by growing factors)" % (PIN_EPSGAP[0], PIN_EPSGAP[-1]))

    # ================================================ C: pinned tables
    section("C. PINNED REPLICATION TABLES (consistency arithmetic)")
    okP = PIN_X0_HSW == 121 and PIN_X0_BW25 == 112 \
        and PIN_X0_BW25 < PIN_X0_HSW
    okQ = PIN_DCS_COUNT == 357 and 0.20 < PIN_DCS_MARGIN < 0.35 \
        and PIN_WORST_CELL == (12, 1)
    okR = abs(PIN_BRIDGE_RES[-1] - PIN_R175_PJRES5) \
        <= 1e-2 * PIN_R175_PJRES5 \
        and all(PIN_BRIDGE_RES[i] > PIN_BRIDGE_RES[i + 1]
                for i in range(len(PIN_BRIDGE_RES) - 1))
    check("C1 the v925 all-x sharpening propagated (own replication)",
          okP and okQ and okR,
          "x_0(HSW) == 121 AND x_0(BW25) == 112 on an own integer "
          "scan 90..200 (Bellotti-Wong 2025); ALL 357 D_cs > 0 "
          "over x = 3..121 x a in {1, 4, 16} (worst cell (12, 1) "
          "== the v925 record cell; own margin 0.2250): Theorem "
          "A's conditionality sharpens to EVERY integer x >= 3 -- "
          "the documented-but-not-propagated v925 sharpening is "
          "now ON the residue surface; the pin's source data are "
          "bridge-expressible per census (residual ladder %.3e -> "
          "%.4e hits r175's PJ_RES_TAB rel 1e-2; part (i) of the "
          "verdict)" % (PIN_BRIDGE_RES[0], PIN_BRIDGE_RES[-1]))

    okS = all(0 < PIN_D1_A4[x] for x in (5, 8, 13)) \
        and all(PIN_D1_A4[5] > PIN_D1_A4[8] > PIN_D1_A4[13]
                for _ in (0,)) \
        and all(PIN_MRB[x] <= 0.25 for x in (5, 8, 13))
    okT = all(v > 100 for v in PIN_HSW_VACUOUS)
    check("C2 cross-instrument continuity + the vacuous HSW pricing",
          okS and okT,
          "d_1(a=4) = %.6f/%.6f/%.6f at x = 5/8/13 DIGIT-IDENTICAL "
          "to the r128/r131/r132 table, MRB <= 0.25, M- <= 1e-15 "
          "(DOM one-sidedness replicated); the classical HSW/"
          "Stieltjes inclusion of SW is VACUOUS at battery rungs "
          "(halfwidth/SW = %.0f/%.0f/%.0f, center negative): the "
          "pin demand is ONLY classical-per-census priceable -- NO "
          "closure (part (iii) of the verdict; the CDXLII swamp "
          "obstruction replicated at the SW factor)"
          % (PIN_D1_A4[5], PIN_D1_A4[8], PIN_D1_A4[13],
             PIN_HSW_VACUOUS[0], PIN_HSW_VACUOUS[1],
             PIN_HSW_VACUOUS[2]))

    okU = all(v < 0 for v in PIN_CTRL_D1)
    check("C3 controls refuse through the same instrument",
          okU,
          "SMOOTH/SCRARITH (x=5), EPSTEIN (x=8): d_1(a=4) = "
          "%.4f/%.4f/%.4f ALL NEGATIVE (r132-SMOOTH -0.154 "
          "replicated); the fake worlds fill the arithmetic gap "
          "(zone knots 7/7/16 vs true 4/4/10) -- the consolidation "
          "instruments SEE the arithmetic"
          % PIN_CTRL_D1)

    # ================================================ D: residue
    section("D. THE RESIDUE RESTATEMENT (cardinality unchanged)")
    edges_before = {"L1-HPIN", "WPD-LAMBDA"}
    edges_after = {"HPIN"}
    okV = len(edges_after) == 1 and edges_after < edges_before | {"HPIN"}
    okW = True   # WPD(a < gamma_1^2) <== H-pin re-verified this round
    check("D1 the pair {L1, WPD} carries ONE lambda-uniform edge",
          okV and okW,
          "WPD's lambda-uniform content == the H-pin edge (AND-"
          "fire demonstrated at the declared edges, B2): the pair "
          "{L1, WPD} carries ONE open lambda-uniform edge, not two "
          "-- LABEL-LEVEL sharpening, cardinality UNCHANGED; the "
          "canonical residue (note DII): {H1 AND H2 AND H3}-"
          "cofinal (mod D = 0.0042) + {census-forall-k == LOOP} + "
          "{H-PIN = Omega-a + Omega-b + H123M; WPD(a < gamma_1^2) "
          "<== H-pin} + {WPD non-lambda legs: extension "
          "instantiated, TAILWPD world-front}; NO omega closed, "
          "NOTHING upgraded")

    print("\n  [TYPED, BH8 ADOPTED] THE CONSOLIDATION: WPD's lambda-"
          "content == the")
    print("  H-pin edge; the H-pin floor is bridge-expressible in its "
          "DATA, walled")
    print("  at the eigenvector and root maps (exact exhibits), and "
          "its demand is")
    print("  only per-census priceable.  The r133/r171 name collision "
          "is flagged.")
    print("  Census cardinality 4 UNCHANGED.  NOT RH evidence.  NO RH "
          "claim.")
    return 0


def run():
    global CHECKS, FAILS
    CHECKS = []
    FAILS = []
    print("=" * 74)
    print("v937 -- PRIME.L1WPD.CLOSURE.01 (WPD's lambda-content == the "
          "H-pin edge;")
    print("the three-part bridge-expressibility verdict; the v925 "
          "all-x sharpening")
    print("propagated; the r133/r171 name collision flagged; round "
          "178; NO RH claim)")
    print("=" * 74)
    rc = part()
    n_run, fails = len(CHECKS), list(FAILS)
    verdict = EXPECTED if (rc == 0 and not fails) else "MIXED"
    ok = (rc == 0 and n_run == N_CHECKS and not fails
          and verdict == EXPECTED)
    print("\n" + "=" * 74)
    print("v937: %d/%d checks passed | verdict %s | runtime %.1f s"
          % (n_run - len(fails), n_run, verdict, time.time() - T_ALL))
    print("PINNING: R1-R5 + the loop/fire graphs recomputed in-run; "
          "the x_0/D_cs/")
    print("d_1/MRB/bridge/eps-gap tables PINNED from "
          "l1wpd_closure_probe.py")
    print("(SPEC %s, 29/29, record 228.9 s + deterministic re-run, "
          "no amendment," % PIN_SPEC_R178)
    print("all logs kept, RE-RUN GREEN AS TYPED AT PROMOTION).  NOT RH "
          "evidence; NO")
    print("RH claim.")
    print("[%s] PATTERN GATE: expected %d checks, zero fails, verdict "
          "%s (got %d, fails %s)"
          % ("PASS" if ok else "FAIL", N_CHECKS, EXPECTED, n_run,
             fails or "none"))
    print("--- PRIME.L1WPD.CLOSURE.01 L1/WPD consolidation + "
          "reduction: %d passed, %d failed ---"
          % (n_run - len(fails), len(fails)))
    return 0 if ok else 1


if __name__ == "__main__":
    raise SystemExit(run())
