Two audits, both on existing data or traces, method untouched. (1) Where S is evaluated: only in the step length (and simpair, and two refuted modes); the slope gate, the triple by shape, the far end and 'defect' decide by comparing - which is a similarity judgment of the ordinal kind ('which is more similar'), where every decreasing S gives the same decision. Their gains depend strongly on the S in the STEP: triple by shape -493 with the tent, up to +250 with others; defect -283 with the tent, up to +215. The records are the pairing of the tent step with those judgments.
(2) Valeri: 'similarity should solve the flat-family problem'. The similarity of two successive contraction ratios, min/max(rho_n, rho_n-1), was pre-declared as the detector; it FAILS and is inverted - AUC 0.28-0.42 flat against the rest, and 'the contraction did not speed up' fires more on APS (37.6%) than on the flat families (28.2%). The rho sequence shows why: on x^m the method runs a period-4 cycle - two Newton undershoots at exactly (1-1/m)^m (0.328 for m=5, 0.346 for m=9), one crossing, one nearly empty step (rho ~ 1) - so successive ratios are dissimilar, not constant. The safeguard is not the cause: the steps are as proposed. Candidate detectors suggested by the cycle are new hypotheses, not built. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,100 @@
|
||||
"""Where is the similarity function S actually evaluated, and does it earn the gains?
|
||||
|
||||
Valeri, 2026-09-21: "check again in which places and which similarity functions are
|
||||
used, because that is what gave the gain".
|
||||
|
||||
Static reading of simroot/pure.py: S is EVALUATED only in the step length
|
||||
(1 - S(z))*(far - x), in the 'simpair' decision S(|phi-xi|) < S(z), and in two refuted
|
||||
modes (log space, progress gate). The readings behind the records - the slope-sign gate,
|
||||
the triple chosen by shape, the far end by dissimilarity, the 'defect' decision - compare
|
||||
quantities directly and never call S.
|
||||
|
||||
The ablation, read off the existing Linux sweeps (no new run): for each reading and for
|
||||
each of the nine functions S used in the step, the gain of the reading is
|
||||
total(reading on) - total(reading off)
|
||||
with the same S, scale and safeguard. If the gain is the same whatever S is, S does not
|
||||
produce it; if it changes with S, S takes part.
|
||||
|
||||
python -u audit_similarity_places.py
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
|
||||
SIMS = ("ratio", "sqrt", "cbrt", "rational", "ratio_soft", "exp_abs", "rat_sq", "exp_sq",
|
||||
"cosine")
|
||||
NAME = {"ratio": "tent 1-|z|", "sqrt": "1-sqrt|z|", "cbrt": "1-|z|^1/3",
|
||||
"rational": "1/(1+|z|)", "ratio_soft": "(1+|z|)^-2", "exp_abs": "e^-|z|",
|
||||
"rat_sq": "1/(1+z^2)", "exp_sq": "e^-z^2", "cosine": "1/sqrt(1+z^2)"}
|
||||
|
||||
|
||||
def load(path):
|
||||
with open(path, encoding="utf8") as fh:
|
||||
return json.load(fh)
|
||||
|
||||
|
||||
def key(r):
|
||||
s = r["spec"]
|
||||
pad = list(s) + [None] * (9 - len(s))
|
||||
return (pad[1], pad[2], pad[3], pad[5] or "none", pad[6] or "recent",
|
||||
pad[7] or "distance")
|
||||
|
||||
|
||||
def index(*paths):
|
||||
out = {}
|
||||
for p in paths:
|
||||
for r in load(p):
|
||||
if r["spec"][0] == "pure":
|
||||
out.setdefault(key(r), r)
|
||||
return out
|
||||
|
||||
|
||||
def both(r):
|
||||
return r["APS"]["total"] + r["CHA"]["total"]
|
||||
|
||||
|
||||
def main():
|
||||
cells = index("sweep_full.json", "sweep_slope.json", "sweep_points.json",
|
||||
"sweep_direction.json", "sweep_decision.json")
|
||||
# reading, its 'on' cell, its 'off' cell (same S, scale, guard), guard as in the record
|
||||
readings = (
|
||||
("slope-sign gate", ("slope", "recent", "distance"), ("none", "recent", "distance"),
|
||||
"project"),
|
||||
("triple by shape", ("slope", "shape", "distance"), ("slope", "recent", "distance"),
|
||||
"safe"),
|
||||
("far end by dissimilarity", ("slope", "recent", "dissimilar"),
|
||||
("slope", "recent", "distance"), "project"),
|
||||
("decision 'defect'", ("defect", "recent", "distance"), ("none", "recent", "distance"),
|
||||
"project"),
|
||||
("decision 'simpair' (uses S)", ("simpair", "recent", "distance"),
|
||||
("none", "recent", "distance"), "project"),
|
||||
)
|
||||
print("Gain of each reading (APS | CHA), by the similarity S used in the STEP."
|
||||
" Negative = cheaper.\n")
|
||||
header = f"{'S in the step':<16}" + "".join(f"{r[0]:>30}" for r in readings)
|
||||
print(header)
|
||||
spread = {}
|
||||
for sim in SIMS:
|
||||
row = f"{NAME[sim]:<16}"
|
||||
for name, on, off, gu in readings:
|
||||
a = cells.get((sim, "derived3", gu) + on)
|
||||
b = cells.get((sim, "derived3", gu) + off)
|
||||
if a is None or b is None:
|
||||
row += f"{'—':>30}"
|
||||
continue
|
||||
da = a["APS"]["total"] - b["APS"]["total"]
|
||||
dc = a["CHA"]["total"] - b["CHA"]["total"]
|
||||
spread.setdefault(name, []).append((sim, da, dc))
|
||||
row += f"{da:>+14d} |{dc:>+7d} "
|
||||
print(row)
|
||||
print("\nDoes the gain depend on S? Range of the gain over the nine functions:")
|
||||
for name, rows in spread.items():
|
||||
das = [r[1] for r in rows]
|
||||
dcs = [r[2] for r in rows]
|
||||
print(f" {name:<30} APS {min(das):+6d} .. {max(das):+6d} "
|
||||
f"CHA {min(dcs):+6d} .. {max(dcs):+6d} (over {len(rows)} functions)")
|
||||
return spread
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user