Sicherung 01.12.: ungesicherte Dateien aus Worktree C:\Users\marcm\pf-sicherung (Zweig main, HEAD f4ba499a)

2 Dateien. Nicht enthalten: 6 Dateien (Bau, Binaer, > 25 MB, archiv/lauf, Spuren echter Haende), 0 Loeschungen nicht nachgezogen. Der Worktree selbst ist unveraendert.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-01 13:36:15 +01:00
co-authored by Claude Opus 5.5
parent f4ba499a47
commit a9113f7f8d
2 changed files with 45 additions and 0 deletions
@@ -0,0 +1,45 @@
"""Grobe Pruefung MOTOR_STACKOFF_EICHUNG (01.12.): echte Nachflop-Anfragen seit 24.11. (Schattenlog Live-Baum), Live-Schalter.
1. Aus: neue Exe ohne Schalter gegen die Live-Exe auf 450 zufaelligen Anfragen (alle Strassen) -> muss gleich sein.
2. An: alle Nachflop-Anfragen, in denen der Motor RAISE/ALL_IN spielte, mit und ohne Schalter: Zahl der Aenderungen, Arten,
Strasse/Groesse und die Haende wie gespielt (netto bb, nur Summen). 6 Faeden (je ein Exe-Prozess, ~5 GB je Prozess).
python -I -X utf8 eichung_pruefung.py <alt.exe> <neu.exe>"""
import collections, json, os, random, sys
from concurrent.futures import ThreadPoolExecutor
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from aus_pruefung import LIVE, lauf
alt, neu = sys.argv[1:3]
F = []
for z in open(LIVE + "/archiv/lauf/schatten.jsonl", "rb"):
if b'"q"' not in z: continue
try: r = json.loads(z)
except ValueError: continue
if r.get("q") and str(r.get("zeit", "")) >= "2026-11-24" and r.get("motor"): F.append(r)
netto = {}
for z in open(LIVE + "/archiv/lauf/haende.jsonl", encoding="utf-8"):
try: h = json.loads(z)
except ValueError: continue
if h.get("bb"): netto[str(h.get("hand"))] = h["netto"] / h["bb"]
def parallel(exe, faelle, extra, n=6):
teile = [faelle[i::n] for i in range(n)]
with ThreadPoolExecutor(n) as ex: res = list(ex.map(lambda t: lauf(exe, t, extra), teile))
out = [None] * len(faelle)
for i, r in enumerate(res):
for j, x in enumerate(r): out[i + j * n] = x
return out
rund = lambda x: None if x is None else round(x, 6)
gleich = lambda x, y: (x.get("action"), rund(x.get("size"))) == (y.get("action"), rund(y.get("size")))
random.seed(13)
aus = random.sample(F, 450)
a, b = parallel(alt, aus, {}), parallel(neu, aus, {})
z = [f"Aus gegen {os.path.basename(alt)}: {sum(map(gleich, a, b))}/{len(aus)} gleich"]
an = [r for r in F if r["q"]["street"] != "PREFLOP" and r["motor"].get("action") in ("RAISE", "ALL_IN")]
c = parallel(neu, an, {})
d = parallel(neu, an, {"MOTOR_STACKOFF_EICHUNG": "1"})
weg = [(r, x, y) for r, x, y in zip(an, c, d) if not gleich(x, y)]
arten = collections.Counter(f"{r['q']['street']} {x.get('action')}->{y.get('action')}" for r, x, y in weg)
summe = sum(netto.get(str(r.get("hand")), 0) for r, _, _ in weg if r.get("gespielt") is not False)
z.append(f"An: {len(weg)}/{len(an)} Nachflop-Raises geaendert {dict(arten)}; diese Haende wie gespielt {summe:+.1f} bb")
for r, x, y in weg[:25]:
z.append(f" {r['q']['street']} {x.get('action')} {x.get('size')} -> {y.get('action')} | Hand {netto.get(str(r.get('hand')), 0):+.0f} | {str(y.get('reason'))[:150]}")
open("eichung_pruefung.txt.tmp", "w", encoding="utf-8", newline="\n").write("\n".join(z) + "\n"); os.replace("eichung_pruefung.txt.tmp", "eichung_pruefung.txt")
print("\n".join(z))