Slot 2, the decision place: Chandrupatla's own acceptance band, put inside our step rule as an instrument, does NOT close the gap - CHA 3066 (project) / 2899 (credit) against his 2423, while APS doubles 2806 -> 5432, and the band is not idle (63.6% refusals). The fifth independent test of one conclusion: the remaining gap is the ORDER of the model the step is built on, not the place the similarity is read in. By the declared stop rule (M1 and M2 both false) the 'where is the similarity read' line is closed: all four places measured.

Not empty-handed: our own parameter-free reading 'defect' - refuse when |phi - xi| > min(xi, 1 - xi) - sets a new canonical best, APS 2523 at 153/154 (previous 2527, Chandrupatla 2785), guarantee intact (0 of 135 family cells), refusing on 7.0% of steps. It is a second point on the same trade, not a replacement: 5733 over both sets against 5511, because CHA gives back 3210. Also: _shape_ratios crashed on a missing third point, which evaluate would have turned into a silent sweep of zeros; the slope-gate pin was anchored on line spelling; and the server copy had drifted (stale relax/sor.py, test_relaxation.py absent - 746 tests instead of 755). All synced, 92/92 files identical by content, 755 pass on the server.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
vvs
2026-09-21 06:58:59 +01:00
co-authored by Claude Opus 5
parent 15b94242e0
commit 2357379c2d
15 changed files with 601 additions and 14 deletions
+80 -9
View File
@@ -157,6 +157,66 @@ def _read_z(resid, sc, exponent, m):
return z
def _shape_ratios(x, fx, u, fu, v, fv):
"""(xi, phi) for the triple, or None when it is degenerate.
The two dimensionless ratios the DECISION place is written in (PREREG 2026-09-21,
slot 2): xi of positions, phi of values, equal for a linear f. _shape_defect is
|phi - xi| of these same two; both callers must read one definition, or the step
place and the decision place could silently disagree about what the triple is.
A missing point (the first steps of a run have no third evaluation yet) is a
degenerate triple, not an error: returning None here is what keeps every caller from
raising inside the loop, where `evaluate` would swallow it and charge the full budget
- the failure mode that produced a whole sweep of 39800 on 2026-09-20."""
if x is None or u is None or v is None:
return None
if v == u or fv == fu:
return None
xi = (x - u) / (v - u)
ph = (fx - fu) / (fv - fu)
if not (math.isfinite(xi) and math.isfinite(ph)):
return None
return xi, ph
def _decide_refuse(mode, S, z, x, fx, u, fu, v, fv):
"""The DECISION place: does the local model deserve this evaluation, or is halving
the better use of it? Returns True to refuse the similarity step.
Three readings, all of quantities already in hand and all without a constant:
"band" Chandrupatla's 1997 acceptance band, 1 - sqrt(1-xi) < phi < sqrt(xi).
NOT OURS. It is in the grid as an INSTRUMENT: it answers whether the
remaining gap lives in this place at all. It must never be presented as
part of the proposed method.
"defect" refuse when the configuration is less like a linear one than the iterate
is off-centre: |phi - xi| > min(xi, 1 - xi). Two computed dimensionless
quantities compared; no threshold.
"simpair" refuse when the configuration's similarity to linear is below the
iterate's similarity to the root: S(|phi - xi|) < S(z). The SAME S is
used in both places on purpose - pairing a different S per place would be
a menu, and a menu is the same fault as a hardcoded constant.
A degenerate triple carries no decision, so the step is allowed and the safeguard
keeps it honest; refusing on missing information would be a guess.
"""
r = _shape_ratios(x, fx, u, fu, v, fv)
if r is None:
return False
xi, ph = r
if mode == "band":
if not (0.0 < xi < 1.0):
return True
return not (1.0 - math.sqrt(1.0 - xi) < ph < math.sqrt(xi))
defect = abs(ph - xi)
if mode == "defect":
return defect > min(abs(xi), abs(1.0 - xi))
if mode == "simpair":
return S(defect) < S(z)
return False
def _shape_defect(x, fx, u, fu, v, fv):
"""|phi - xi| for the triple, or None when it is degenerate.
@@ -164,13 +224,8 @@ def _shape_defect(x, fx, u, fu, v, fv):
VALUES; both are invariant under affine rescaling of x and of f. For a linear f they
are equal, so their gap measures how unlike a linear configuration the triple is —
the same dimensionless currency Chandrupatla's acceptance band is written in."""
if v == u or fv == fu:
return None
xi = (x - u) / (v - u)
ph = (fx - fu) / (fv - fu)
if not (math.isfinite(xi) and math.isfinite(ph)):
return None
return abs(ph - xi)
r = _shape_ratios(x, fx, u, fu, v, fv)
return None if r is None else abs(r[1] - r[0])
def _pick_triple(x, fx, x_prev, f_prev, x_prev2, f_prev2, A, FA, B, FB, far):
@@ -549,8 +604,14 @@ def pure_root(f, a, b, xtol, maxfev, similarity="ratio", scale="derived",
"{'derived3', 'derived3_cap', 'bracket', 'far'}")
if space not in SPACES:
raise ValueError(f"unknown space {space!r}")
if prestep not in ("none", "progress", "slope"):
if prestep not in ("none", "progress", "slope", "band", "defect", "simpair"):
raise ValueError(f"unknown prestep {prestep!r}")
if prestep in ("band", "defect", "simpair") and scale not in (
"derived3", "derived3_cap", "derived3_m", "bracket", "far"):
# the decision reads a TRIPLE; under the two-point scale there is no third point
# to read a configuration from, and reading one from elsewhere would hide that
raise ValueError("prestep in {'band','defect','simpair'} needs a three-point "
"history (scale derived3*/bracket/far)")
if points not in POINT_RULES:
raise ValueError(f"unknown points rule {points!r}")
if direction not in DIRECTIONS:
@@ -754,7 +815,17 @@ def pure_root(f, a, b, xtol, maxfev, similarity="ratio", scale="derived",
if exponent == "order" else None)
z_now = _read_z(abs(fx), sc, exponent, m_loc)
step = None
if prestep == "slope":
if prestep in ("band", "defect", "simpair"):
# THE DECISION PLACE (PREREG 2026-09-21, slot 2). Same slot as the
# slope gate, a different reading of it: the question is not whether
# the slope has settled but whether the CONFIGURATION deserves the
# model. The triple is the recency triple, so only the reading
# changes against the slope-gate cells.
if _decide_refuse(prestep, S, z_now, x, fx, x_prev, f_prev,
x_prev2, f_prev2):
step = 0.5 * (A + B) - x
pre_refused += 1
if step is None and prestep == "slope":
# PRE-STEP GATE ON SHAPE (PREREG 2026-09-21). The step trusts the
# local slope, so the question of trust is whether that slope has
# SETTLED: two consecutive estimates of opposite sign mean the local