PREREG_flat_twice outcome: stage 1 passed (twice-in-a-row fires on 27.8% of model steps on the flat families, 8.7% on APS, 4.3% on fun1; flat/APS ratio 3.20 against the single flag's 2.47), stage 2 FAILED: under the projection APS 2806 -> 2803 (W2 holds, the per-problem edge over Chandrupatla kept at 83/28/42) but CHA 3220 -> 3341 and the flat families 1823 -> 1975 (W1, W4 fail); with G2 the same. Under safe/step the twice gate is inert (3390 -> 3388) where the single one gave 3037.

Mechanism: the flat cycle is undershoot, undershoot, crossing, near-empty step. The single flag fires after the first undershoot and replaces the second - a useless step; the twice flag fires after the second and replaces the CROSSING, the one step of the cycle that collapses the bracket. The second undershoot's r is ~0.26, next to the 1/4 threshold, so the pair often does not even form. Again a detectability gain that did not carry to run cost. Next candidate (not pre-registered): the unkept promise AND a creep - the same step moving the same way as the previous one.

Removed a vacuous pin I had written (s2 <= max(s1, s2)). Regression on the branch: 935 pass twice; the only red test is the paper-number check.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
vvs
2026-09-21 13:45:20 +01:00
co-authored by Claude Opus 5
parent 6a8bb2315f
commit 9884b21204
7 changed files with 156 additions and 16 deletions
+16 -1
View File
@@ -665,7 +665,8 @@ 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", "band", "defect", "simpair", "flat"):
if prestep not in ("none", "progress", "slope", "band", "defect", "simpair", "flat",
"flat2"):
raise ValueError(f"unknown prestep {prestep!r}")
if prestep in ("band", "defect", "simpair") and scale not in (
"derived3", "derived3_cap", "derived3_m", "bracket", "far"):
@@ -719,6 +720,7 @@ def pure_root(f, a, b, xtol, maxfev, similarity="ratio", scale="derived",
slope = 0.0
slope_prev = None
last_model = False # was the step just evaluated the model's own? (flat gate)
unkept_run = 0 # consecutive model steps whose promise failed (flat2)
if stats is not None:
stats['forced'] = 0
stats['pre_refused'] = 0
@@ -900,6 +902,14 @@ def pure_root(f, a, b, xtol, maxfev, similarity="ratio", scale="derived",
# the model's again and is judged by its own result.
step = 0.5 * (A + B) - x
pre_refused += 1
if step is None and prestep == "flat2" and unkept_run >= 2:
# PREREG_flat_twice 2026-09-21. The same unkept promise as
# "flat" (model step, no crossing, r >= 1/4), but only after it has
# failed TWICE IN A ROW: on a flat function the undershoot repeats,
# at a simple root a single failure is usually followed by fast
# convergence. Two is the fewest at which "repeats" is defined.
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
@@ -998,6 +1008,11 @@ def pure_root(f, a, b, xtol, maxfev, similarity="ratio", scale="derived",
last_model = model_target is not None and x_new == model_target
w_before = abs(B - A)
fnew = g(x_new)
# the run of unkept promises (flat2): x, fx are still the point the step left
if last_model and fx != 0.0 and fnew / fx >= 0.25:
unkept_run += 1
else:
unkept_run = 0
sg.j += 1 # one step of the bisection budget is spent
sg.allow *= 0.5
x_prev2, f_prev2 = x_prev, f_prev