Point 1. The base step's order is Muller's 1.839, not 2: the derivative of the parabola through
the last three points errs by f'''/6 (x_n - x_{n-1})(x_n - x_{n-2}) = O(e_{n-1} e_{n-2}).
order_high_precision.py (3000 digits, to 1e-2900): 1.840 on cos x - x, e^x - 2, x^3 - x - 2,
sin x - 1/2; 2.000 only on x^2 - 2; two-point 1.618. The double-precision medians (2.000, 1.94)
are removed from the text.
Point 3. Every protocol number is re-scored under the criterion of section 9 - a sign change
within 1e-6 or f(x) == 0. rescore_uniform.py re-runs all 2779 distinct configurations of the 25
protocol sweeps on APS and CHA (the runs did not keep x) -> sweep_uniform.json, same row format;
it reproduces the APS/CHA lines of Table 10 exactly (built-in check). verify_article.py,
audit_similarity_places.py and the gap diagnostics read the re-scored data; the multiplier and
endowment measurements score by the same criterion. Table 7 (two criteria side by side) is gone;
7.3 now explains why the criterion is a sign change. Consequences stated in the text: the base
rule 2634 / 2357 against Chandrupatla 2595 / 1505 (1.5% behind on APS, no longer "level"); A'
2259 / 1074 (12.9% and 28.6% below Chandrupatla); the defect reading 2351 is second to the
shape reading 2337, not the record; the remembered analogy is level with no regime (2633 vs
2634) under this criterion; Table 9a's range is 19% to 425%.
Point 8. report_sweep.head_to_head counts every problem, failures charged (it counted only the
problems both methods solved, which is why Table 8 rows summed to 153 and 40). Family-level
comparisons added (A' vs Chandrupatla 8/1/6 of 15 and 7/0/2 of 9 families, not significant), and
an independence paragraph in section 9.
Point 11. sweep_itp.py: ITP (recommended constants and per-problem oracle) on all six corpora ->
Table 10; behind A' on every corpus, 0 bound violations.
Points 7, 9, 10 and the internals: the 2x bound is ours, not the rivals' promise; the law
predicts the group order only; "outside the proven bracket" explained (narrowest bracket of all
observed signs); 7.4's fun1 paragraph corrected (five costs under safe; the unguarded numbers
belong to fun1.4, fun1.5 and to fun3.1, fun5.1 separately); Table 1's last cell; the corpus-4
composition and odd multiplicities stated, also in the abstract.
build_tex.py: pdflatex output decoded with errors="replace" (a UTF-8 character cut by TeX's log
wrap crashed the build). Table 10 column widths rebalanced.
Checks: verify_article on the server 500 OK / 0 BAD (467 existing with the new values, 33 new);
regression x2 on the server 1232 passed, 0 failed; PDF 28 pages, 0 errors, 0 undefined, 0 overfull.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
101 lines
3.9 KiB
Python
101 lines
3.9 KiB
Python
"""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
|
|
|
|
|
|
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):
|
|
"""The sweep re-scored under the paper's single criterion (sweep_uniform.json)."""
|
|
from rescore_uniform import load_uniform
|
|
return load_uniform(path)
|
|
|
|
|
|
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()
|