slope-stability gate: the PROJECT'S OWN target is met for the first time — 5922 < 6026 over both sets at 193/199 with the guarantee intact (slope.ratio.derived3.project: APS 2848 + CHA 3074), CHA improves 4516 -> 2903 (x1.56), repairs 77.5% -> 55.3%. Honest cost: APS 2806 -> 2848, which moves us from 1st to 3rd on the canonical set (chandrupatla 2785, toms748 2820), so my stricter S1 fails while the project target passes — a positioning decision, recorded not resolved. Refusal CURRENCY is what decides: bracket progress 4449 vs model shape 2848, a 1601-evaluation difference for the same 'refuse before the step' idea

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
vvs
2026-09-20 23:27:43 +01:00
co-authored by Claude Opus 5
parent a6116cd027
commit e4769be9a3
10 changed files with 345 additions and 6 deletions
+24 -2
View File
@@ -467,8 +467,12 @@ def pure_root(f, a, b, xtol, maxfev, similarity="ratio", scale="derived",
raise ValueError(f"unknown scale {scale!r}")
if space not in SPACES:
raise ValueError(f"unknown space {space!r}")
if prestep not in ("none", "progress"):
if prestep not in ("none", "progress", "slope"):
raise ValueError(f"unknown prestep {prestep!r}")
if prestep == "slope" and scale not in ("derived", "derived3"):
# there is no slope to judge under a chosen or bracket scale; judging something
# else would hide that, so the call fails instead
raise ValueError("prestep='slope' requires scale in {'derived', 'derived3'}")
if space == "log" and scale not in ("derived", "derived3"):
# u-space needs a slope; with a chosen or bracket scale there is none to
# transform, and computing something anyway would hide that (PREREG §3a).
@@ -497,6 +501,8 @@ def pure_root(f, a, b, xtol, maxfev, similarity="ratio", scale="derived",
sg.credit = endowment
forced = 0
pre_refused = 0
slope = 0.0
slope_prev = None
if stats is not None:
stats['forced'] = 0
stats['pre_refused'] = 0
@@ -596,7 +602,20 @@ def pure_root(f, a, b, xtol, maxfev, similarity="ratio", scale="derived",
x_new = 0.5 * (A + B)
else:
step = None
if prestep == "progress":
if 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
# model is not established at all, and the evaluation is better spent
# halving. A SIGN is compared, not a magnitude — no threshold, no
# factor, no constant. Where the slope sign is stable (a simple root
# of a smooth f) the gate is inert, which is exactly what the
# progress gate could not manage: it charged APS 4449 against 2806.
if (slope_prev is not None and slope != 0.0 and slope_prev != 0.0
and (slope > 0.0) != (slope_prev > 0.0)):
step = 0.5 * (A + B) - x
pre_refused += 1
if step is None and prestep == "progress":
# PRE-STEP GATE (PREREG 2026-09-21). Measured cause of our cost:
# the safeguard REPAIRS 77.5% of evaluations after the fact, while
# Chandrupatla REFUSES its model on 72% of steps for free and
@@ -635,6 +654,9 @@ def pure_root(f, a, b, xtol, maxfev, similarity="ratio", scale="derived",
x_new = projected
step = x_new - x
sg.note_step(step)
# the slope this step trusted, kept so the NEXT step can ask whether it
# has settled (prestep="slope"); only meaningful for the derived scales
slope_prev = slope
if not math.isfinite(x_new) or not (min(A, B) < x_new < max(A, B)):
x_new = 0.5 * (A + B)