basis-rein: Nachweis-Werkzeug (Grund-Praefixe, Abweichungsbuch nach Art) und SCHALTER-Eintrag; 0 Regelspuren auf 29.849 echten Anfragen
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
# Schalter-Einträge basis-rein (zum Übernehmen in docs/notizen/SCHALTER.md auf main)
|
||||
|
||||
Fassung basis-rein, Zweig `claude/basis-rein` @ 807e7a4e (= Teil 2 + Turn-Fix + River-Wert-Code a065d3a8, dazu R0). Inventur:
|
||||
`docs/notizen/R0-INVENTUR.md`. Nachweis (SSD `pruefstand/basis-rein/R0-NACHWEIS.txt`, Werkzeug `messung/motor/paket/r0_nachweis.py`): alle
|
||||
29.849 echten Anfragen 01.12. (ab 14:04) bis 04.12. mit `R0=1` und der VOLLEN Teil-3-Zeile: 0 Regelspuren (nur Tafel, genau, Flop exakt, preis,
|
||||
notfall, Splash); 713 Abweichungen gegen die Live-Basis 331206FA, davon 581 durch weggefallene Regeln (NL2-Typ 321, NL2-Einsatz 122,
|
||||
NL2-Daten 56, NL2-Iso 49, NL2-Raise 15, NL2-All-in 7, Schwachjam-Sperre 11 aus dem Läufer) und 132 durch Rechnung (Turn/River exakt 102,
|
||||
Vorflop-Tafel 13, Preis-Weg 10, Flop exakt 7).
|
||||
|
||||
| Schalter | was er tut | Stand | Beleg | Datum |
|
||||
|---|---|---|---|---|
|
||||
| `R0` (auch `MOTOR_R0`) | Reine Basis: schaltet im Motor nl2.rs samt Gedächtnis, MOTOR_VORFLOP_ALLIN, MOTOR_RIVER_WERT, MOTOR_ALLIN_EICHUNG und die Jam-Probe aus, auch wenn sie gesetzt sind; Antworten nur aus Tafel und Löser. Läufer-Regeln (Schwachjam-Sperre, MOTOR_REIN_GEGEN) sind nicht im Motor und dort nicht zu setzen. | in Prüfung | R0-NACHWEIS: 0 Regelspuren auf 29.849 echten Anfragen; Specs `r0::` | 2026-12-04 |
|
||||
@@ -0,0 +1,87 @@
|
||||
"""Nachweis basis-rein (R0): (1) jede Antwort traegt nur Tafel-/Loeser-Gruende; (2) Abweichungsbuch gegen die Live-Basis nach Art.
|
||||
|
||||
Eingaben (pruefstand/basis-rein auf der SSD): ein.jsonl, ref.jsonl (geloggte Antwort der Live-Basis 331206FA: Feld motor), Teile
|
||||
ein<t>.jsonl / aus<t>.jsonl (R0-Lauf mit voller Teil-3-Zeile).
|
||||
|
||||
(1) Grund-Praefix je Antwort: erlaubt sind nur `motor <STRASSE> (...)` (Tafel), `motor <STRASSE> genau`, `motor FLOP exakt`, `motor preis`,
|
||||
`motor notfall`, `Splash<d> motor ...`. Jede andere Spur (NL2-, [Vorflop-All-in, river-wert, Jam-Probe, Schwachjam ...) ist ein Fehler.
|
||||
(2) Abweichung = (Aktion, Groesse) anders als die Live-Basis. Art = welche Regel der Basis wegfiel (Praefix ihres Grundes), sonst die
|
||||
Rechenart der neuen Antwort (Flop exakt, Rake/Uebersetzung im Loeser oder in der Tafel, Wiedergabe). Je Art: Zahl, Strassen.
|
||||
Aufruf: python3 r0_nachweis.py <ordner> <bericht.txt>
|
||||
"""
|
||||
import sys
|
||||
|
||||
sys.dont_write_bytecode = True
|
||||
|
||||
import collections # noqa: E402
|
||||
import json # noqa: E402
|
||||
import os # noqa: E402
|
||||
import re # noqa: E402
|
||||
|
||||
ERLAUBT = re.compile(r"^(Splash\d+ )?motor (PREFLOP|FLOP|TURN|RIVER)( genau| exakt)? ?\(|^(Splash\d+ )?motor (preis|notfall)|^(Splash\d+ )?motor FLOP exakt")
|
||||
REGEL = re.compile(r"(NL2-[A-Za-z-]+|\[Vorflop-All-in|river-wert|Jam-Probe|Schwachjam-Sperre|Vorflop-All-in)")
|
||||
|
||||
|
||||
def art_basis(grund):
|
||||
m = REGEL.search(grund or "")
|
||||
return m.group(1).strip("[") if m else None
|
||||
|
||||
|
||||
def main():
|
||||
d, ziel = sys.argv[1], sys.argv[2]
|
||||
if os.path.exists(ziel):
|
||||
raise SystemExit(f"{ziel} existiert schon")
|
||||
E = open(os.path.join(d, "ein.jsonl")).read().splitlines()
|
||||
R = [json.loads(z) for z in open(os.path.join(d, "ref.jsonl"))]
|
||||
paare, versatz = [], 0
|
||||
for t in range(5):
|
||||
e = open(os.path.join(d, f"ein{t}.jsonl")).read().splitlines()
|
||||
a = [json.loads(z) for z in open(os.path.join(d, f"aus{t}.jsonl"))]
|
||||
paare += [(versatz + j, a[j]) for j in range(len(a))]
|
||||
versatz += len(e)
|
||||
praefix, fehler = collections.Counter(), []
|
||||
arten = collections.defaultdict(collections.Counter)
|
||||
beispiele = {}
|
||||
for i, o in paare:
|
||||
g = str(o.get("reason") or "")
|
||||
kopf = re.sub(r"\(.*", "", g)[:28].strip()
|
||||
praefix[kopf] += 1
|
||||
if not ERLAUBT.search(g) or REGEL.search(g):
|
||||
fehler.append((i, g[:160]))
|
||||
q = json.loads(E[i])
|
||||
b = R[i]["motor"]
|
||||
if (b.get("action"), b.get("size")) == (o.get("action"), o.get("size")):
|
||||
continue
|
||||
weg = art_basis(b.get("reason"))
|
||||
if weg:
|
||||
art = f"Regel weg: {weg}"
|
||||
elif "FLOP exakt" in g:
|
||||
art = "Flop exakt (neu gerechnet)"
|
||||
elif " genau" in g:
|
||||
art = "Turn/River exakt (Rake, Turn-Fix, Uebersetzung, Ziehung)"
|
||||
elif g.startswith("motor preis") or str(b.get("reason", "")).startswith("motor preis"):
|
||||
art = "Preis-Weg (Uebersetzung liest den Verlauf jetzt)"
|
||||
elif q["street"] == "PREFLOP":
|
||||
art = "Vorflop-Tafel (Uebersetzung/Rake/Ziehung)"
|
||||
else:
|
||||
art = "Tafel nach dem Flop (Wiedergabe/Ziehung)"
|
||||
arten[art][q["street"]] += 1
|
||||
beispiele.setdefault(art, (R[i]["hand"], q["street"], f"{b.get('action')} {b.get('size')}", f"{o.get('action')} {o.get('size')}", str(b.get("reason"))[:110], g[:110]))
|
||||
out = [f"# basis-rein (R0) Nachweis: {len(paare)} von {len(E)} Anfragen gerechnet (01.12. ab 14:04 bis 04.12.)", "",
|
||||
f"## (1) Grund-Praefixe: Regelspuren {len(fehler)}"]
|
||||
out += [f" {n:6d} {k}" for k, n in praefix.most_common()]
|
||||
out += [f" FEHLER #{i}: {g}" for i, g in fehler[:50]]
|
||||
gesamt = sum(sum(c.values()) for c in arten.values())
|
||||
out += ["", f"## (2) Abweichungen gegen die Live-Basis 331206FA: {gesamt} von {len(paare)}"]
|
||||
for art, c in sorted(arten.items(), key=lambda t: -sum(t[1].values())):
|
||||
out.append(f" {sum(c.values()):5d} {art}: " + ", ".join(f"{s} {n}" for s, n in c.most_common()))
|
||||
h, st, alt, neu, ga, gn = beispiele[art]
|
||||
out.append(f" z. B. Hand {h} {st}: {alt} -> {neu} | Basis: {ga} | R0: {gn}")
|
||||
with open(ziel + ".tmp", "x") as f:
|
||||
f.write("\n".join(out) + "\n")
|
||||
os.rename(ziel + ".tmp", ziel)
|
||||
print("\n".join(out[:4]))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user