motor-breit-live: Rauchprobe am Live-Ort (Live-schatten.py, kern_schalter, Live-Exe ae942a40): 50/50 Turn/River beantwortet, 0 Frist gerissen, nach breit 27 / schmal-schaetzung 16 / schmal-frist 3, p95 3,94 s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
Umgebung: MOTOR_BRETTQ=1 MOTOR_FLOPBLUFF=0 MOTOR_FOLDRUNDUNG=0 MOTOR_LUFT=0 MOTOR_NACH_BREIT=1 MOTOR_NACH_BREIT_FRIST=4 MOTOR_NACH_BREIT_MAL=3 MOTOR_NACH_BREIT_SCHAETZ=3 MOTOR_NACH_BREIT_ZIEL=1 MOTOR_SCHATTEN=D:\Projects\pokerfreak MOTOR_SPIELT=1 MOTOR_STRASSEN=0 MOTOR_SUCHE_BODEN_VR=0.1 MOTOR_SUCHE_RIVER_JAM=1
|
||||
Motor SPIELT
|
||||
Befehl: D:\Projects\pokerfreak\entscheiden\motor\target\pokerbench-motor-schatten.exe dienst sechs100 D:\Projects\pokerfreak\daten\grundstrategie\motor 2000-600-400 200q400 D:\Projects\pokerfreak\daten\grundstrategie\motor\sechs100-q.bin genau hu=D:\Projects\pokerfreak\daten\grundstrategie\motor\hu100-v1.bin,D:\Projects\pokerfreak\daten\grundstrategie\motor\hu200-v2.bin
|
||||
Laden + erste Antwort 0.9 s: CALL
|
||||
0 RIVER 1.61 s CHECK
|
||||
1 RIVER 0.38 s CALL
|
||||
2 TURN 1.39 s CALL
|
||||
3 TURN 1.13 s RAISE
|
||||
4 RIVER 0.10 s CALL
|
||||
5 RIVER 1.42 s RAISE
|
||||
6 TURN 1.30 s CHECK
|
||||
7 RIVER 0.89 s FOLD
|
||||
8 TURN 2.77 s CHECK
|
||||
9 TURN 2.53 s RAISE
|
||||
10 RIVER 3.99 s RAISE
|
||||
11 RIVER 2.85 s CHECK
|
||||
12 TURN 3.95 s RAISE
|
||||
13 RIVER 0.75 s CHECK
|
||||
14 TURN 1.31 s CHECK
|
||||
15 RIVER 0.77 s RAISE
|
||||
16 TURN 3.27 s CHECK
|
||||
17 RIVER 3.63 s CHECK
|
||||
18 TURN 1.37 s CHECK
|
||||
19 RIVER 0.86 s CHECK
|
||||
20 TURN 1.35 s CHECK
|
||||
21 TURN 1.54 s CALL
|
||||
22 TURN 1.38 s CHECK
|
||||
23 RIVER 0.35 s CHECK
|
||||
24 RIVER 0.72 s CHECK
|
||||
25 TURN 1.18 s CHECK
|
||||
26 RIVER 1.96 s RAISE
|
||||
27 RIVER 1.87 s CALL
|
||||
28 TURN 3.93 s CHECK
|
||||
29 TURN 0.30 s FOLD
|
||||
30 TURN 3.43 s CHECK
|
||||
31 RIVER 1.12 s CALL
|
||||
32 TURN 1.23 s CHECK
|
||||
33 RIVER 0.80 s RAISE
|
||||
34 TURN 1.22 s CHECK
|
||||
35 RIVER 0.63 s CHECK
|
||||
36 TURN 1.20 s CHECK
|
||||
37 TURN 1.07 s CALL
|
||||
38 RIVER 2.13 s FOLD
|
||||
39 RIVER 2.09 s FOLD
|
||||
40 TURN 0.00 s CHECK
|
||||
41 RIVER 0.00 s RAISE
|
||||
42 TURN 1.22 s CHECK
|
||||
43 RIVER 0.68 s RAISE
|
||||
44 RIVER 0.00 s FOLD
|
||||
45 TURN 1.17 s CHECK
|
||||
46 RIVER 0.86 s FOLD
|
||||
47 TURN 3.94 s CHECK
|
||||
48 TURN 0.00 s CALL
|
||||
49 RIVER 0.52 s CHECK
|
||||
Antworten 50/50, ohne Antwort (Frist/ungueltig) 0, Fehler im Log 0 []
|
||||
nach: {'breit': 27, 'schmal-schaetzung': 16, 'schmal-frist': 3, None: 3, 'schmal-gemerkt': 1}; gespielt: {'motor': 50}; ungueltig: 0
|
||||
Zeit je Zug Median 1.23 p95 3.94 max 3.99 s
|
||||
@@ -0,0 +1,79 @@
|
||||
"""Rauchprobe am Live-Ort (29.11.): entscheiden/schatten.py des Live-Baums (nur importiert), Umgebung aus dessen
|
||||
betrieb/kern_schalter.txt (die Schluessel aus decide.LAEUFER_SCHALTER, wie der Laeufer sie in os.environ legt), starte() mit der
|
||||
Live-Wurzel (Live-Exe, Live-Daten), spielt=True wie beim Spielen. 50 echte Turn/River-Anfragen aus dem Schatten-Log (paket.satz),
|
||||
je mit frist=9 wie der Laeufer (MOTOR_FRIST). Log in eine eigene Datei, nie ins Live-Log. Keine Tische, kein Client.
|
||||
|
||||
python rauch.py <log.jsonl> [anzahl=50]
|
||||
"""
|
||||
import ast
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
from collections import Counter
|
||||
|
||||
LIVE = "D:/Projects/pokerfreak/.claude/worktrees/engine-lecks-angreifen-de7b88"
|
||||
HIER = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
||||
def laeufer_schalter():
|
||||
baum = ast.parse(open(os.path.join(LIVE, "entscheiden", "decide.py"), encoding="utf-8").read())
|
||||
for k in baum.body:
|
||||
if isinstance(k, ast.Assign) and any(getattr(t, "id", "") == "LAEUFER_SCHALTER" for t in k.targets):
|
||||
return set(ast.literal_eval(k.value))
|
||||
raise SystemExit("LAEUFER_SCHALTER fehlt")
|
||||
|
||||
|
||||
def main():
|
||||
log, n = sys.argv[1], int(sys.argv[2]) if len(sys.argv) > 2 else 50
|
||||
if os.path.exists(log):
|
||||
sys.exit(f"{log} gibt es schon")
|
||||
erlaubt = laeufer_schalter() | {"MOTOR_SCHATTEN", "MOTOR_SPIELT"}
|
||||
gesetzt = {}
|
||||
for z in open(os.path.join(LIVE, "betrieb", "kern_schalter.txt"), encoding="utf-8"):
|
||||
z = z.strip()
|
||||
if z and not z.startswith("#") and "=" in z:
|
||||
k, v = z.split("=", 1)
|
||||
if k.strip() in erlaubt and k.strip().startswith("MOTOR_"):
|
||||
gesetzt[k.strip()] = v.strip()
|
||||
for k in [k for k in os.environ if k.startswith("MOTOR_")]:
|
||||
del os.environ[k]
|
||||
os.environ.update(gesetzt)
|
||||
print("Umgebung:", " ".join(f"{k}={v}" for k, v in sorted(gesetzt.items())))
|
||||
sys.path[:0] = [os.path.join(LIVE, "entscheiden"), HIER]
|
||||
import schatten as S
|
||||
import paket
|
||||
assert os.path.abspath(S.__file__).replace("\\", "/").lower().startswith(LIVE.lower()), S.__file__
|
||||
m = S.starte(gesetzt["MOTOR_SCHATTEN"], spielt=True, ziel=log)
|
||||
assert m is not None, "Motor startet nicht"
|
||||
print("Befehl:", " ".join(m.befehl))
|
||||
saetze = paket.satz()
|
||||
warm = next(r for r in saetze if r["q"]["street"] == "PREFLOP")
|
||||
t0 = time.time()
|
||||
a = S.zug(json.dumps(warm["q"]), "rauch", "warm", 300)
|
||||
print(f"Laden + erste Antwort {time.time() - t0:.1f} s: {a and a.get('action')}")
|
||||
tr = [r for r in saetze if r["q"]["street"] in ("TURN", "RIVER")][:n]
|
||||
keine = 0
|
||||
for i, r in enumerate(tr):
|
||||
t1 = time.time()
|
||||
a = S.zug(json.dumps(r["q"]), "rauch", f"{r['hand']}-{i}", 9.0)
|
||||
keine += a is None
|
||||
print(f"{i:2} {r['q']['street']:5} {time.time() - t1:5.2f} s {a and a.get('action')}", flush=True)
|
||||
time.sleep(1)
|
||||
z = [json.loads(x) for x in open(log, encoding="utf-8")]
|
||||
antw = [x for x in z if "motor" in x and x.get("hand") != "warm"]
|
||||
nach = Counter(x["motor"].get("nach") for x in antw)
|
||||
riss = [x for x in z if x.get("fehler")]
|
||||
zeit = sorted(x["wartet_s"] + x["rechnet_s"] for x in antw)
|
||||
q95 = zeit[min(len(zeit) - 1, int(.95 * len(zeit)))] if zeit else float("nan")
|
||||
print(f"Antworten {len(antw)}/{len(tr)}, ohne Antwort (Frist/ungueltig) {keine}, Fehler im Log {len(riss)} {[x.get('fehler') for x in riss][:3]}")
|
||||
print(f"nach: {dict(nach)}; gespielt: {dict(Counter(x.get('gespielt') for x in antw))}; ungueltig: {sum(bool(x.get('ungueltig')) for x in antw)}")
|
||||
print(f"Zeit je Zug Median {zeit[len(zeit) // 2]:.2f} p95 {q95:.2f} max {zeit[-1]:.2f} s")
|
||||
sys.stdout.flush()
|
||||
# die Motor-Prozesse gehoeren zu diesem Prozess: ganzen Baum beenden (Schatten haelt sie in Faeden ohne Griff)
|
||||
import subprocess
|
||||
subprocess.run(["taskkill", "/F", "/T", "/PID", str(os.getpid())], capture_output=True, creationflags=0x08000000)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user