PREREG_flat_analogy_mem outcome (decided on the smoke, all 199 problems): NOT accepted. Remembering the analogy until the next flag: CHA 2635 -> 2552 (G2: 2625 -> 2548; flat fun3-6 1234 -> 1151, M4 holds) but APS 2806 -> 2814 (G2: 2782 -> 2787 = Chandrupatla, M2 fails) - the extra false entries. Server regression x2: 1069 passed, 1 failed = the expected paper-number check.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
vvs
2026-09-21 15:06:37 +01:00
co-authored by Claude Opus 5
parent 4bf8634757
commit 441373800b
4 changed files with 60 additions and 8 deletions
+20 -5
View File
@@ -746,7 +746,7 @@ def pure_root(f, a, b, xtol, maxfev, similarity="ratio", scale="derived",
raise ValueError(f"unknown space {space!r}")
if prestep not in ("none", "progress", "slope", "band", "defect", "simpair", "flat",
"flat2", "flatcreep", "flatstick", "flatstickmid", "flatstickexit",
"flatjudge", "flatanalog"):
"flatjudge", "flatanalog", "flatanalogmem"):
raise ValueError(f"unknown prestep {prestep!r}")
if prestep in ("band", "defect", "simpair") and scale not in (
"derived3", "derived3_cap", "derived3_m", "bracket", "far"):
@@ -804,6 +804,7 @@ def pure_root(f, a, b, xtol, maxfev, similarity="ratio", scale="derived",
sticky_m = None # order read at entry to the sticky flat regime (flatstick*)
judged = 0 # flatjudge: +1 the last point looked flat, -1 linear, 0 tie
configs = [] # flatanalog: the run's memory of (xi, phi, |dx|, |df|)
analogy_seen = False # flatanalogmem: the run has been judged analogous to its past
if stats is not None:
stats['forced'] = 0
stats['pre_refused'] = 0
@@ -1018,16 +1019,27 @@ def pure_root(f, a, b, xtol, maxfev, similarity="ratio", scale="derived",
else:
step = 0.5 * (A + B) - x
pre_refused += 1
if step is None and prestep == "flatanalog":
if step is None and prestep in ("flatanalog", "flatanalogmem"):
# PREREG_flat_analogy 2026-09-21. A pure power is similar to itself
# under zoom: its configuration RECURS, while a simple root's tends
# to the line. Enter on the unkept promise only when the current
# configuration is nearer to its own past than to the line AND the
# analogous pair scales as a power of order >= 2. Every state the
# gate sees joins the memory after it has been judged.
# PREREG_flat_analogy_mem 2026-09-21 (flatanalogmem): the flag rises
# in the cycle's non-recurring phases, the analogy shows in the
# others - so the analogy is judged at EVERY state and remembered as
# a property of the run; the regime is entered at the next flag.
cur = _config3(x, fx, x_prev, f_prev, x_prev2, f_prev2)
if (sticky_m is None and last_model and f_prev != 0.0
and fx / f_prev >= 0.25 and _analogous_and_steep(cur, configs)):
flag = (sticky_m is None and last_model and f_prev != 0.0
and fx / f_prev >= 0.25)
if prestep == "flatanalogmem":
if _analogous_and_steep(cur, configs):
analogy_seen = True
enter = flag and analogy_seen
else:
enter = flag and _analogous_and_steep(cur, configs)
if enter:
sticky_m = math.inf
if stats is not None:
stats['stick_entries'] = stats.get('stick_entries', 0) + 1
@@ -1156,7 +1168,7 @@ def pure_root(f, a, b, xtol, maxfev, similarity="ratio", scale="derived",
w_before = abs(B - A)
mid_now, lin_mid = 0.5 * (A + B), 0.5 * (FA + FB) # before the bracket moves
fnew = g(x_new)
if (prestep in ("flatstickexit", "flatanalog") and sticky_m is not None
if (prestep in ("flatstickexit", "flatanalog", "flatanalogmem") and sticky_m is not None
and x_new == mid_now
and abs(fnew - lin_mid) < abs(fnew)):
# PREREG_flat_exit 2026-09-21. A midpoint evaluated in the regime is judged
@@ -1165,6 +1177,9 @@ def pure_root(f, a, b, xtol, maxfev, similarity="ratio", scale="derived",
# like the linear one - the regime is left and the model steps again.
# Ordinal: two distances compared, no threshold; a tie stays.
sticky_m = None
# flatanalogmem: "linear" refutes "flat" - the remembered analogy is
# cleared and must be established anew (PREREG_flat_analogy_mem)
analogy_seen = False
if stats is not None:
stats['stick_exits'] = stats.get('stick_exits', 0) + 1
if prestep == "flatjudge":