BUDGET=baum: Kartenwahl balanciert vs Schritt gegen Vollwert (balanciert niedriger, bleibt Standard), Fensterschaetzung

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-21 02:11:12 +01:00
co-authored by Claude Opus 5.5
parent bdd132ebbf
commit 34ad4a5783
6 changed files with 74 additions and 1 deletions
+21
View File
@@ -70,3 +70,24 @@ Abstand gewaehlt/Vollwert (44 Karten, je 38 Iterationen), `messung/solver_kern/b
Checkwert 0.2-3.2 (siehe `vs_live.md`/`vs_iter.md`, Zeilenliste). Das sind knappe Faelle, wie die Kartenauswertung oben zeigt.
* Entscheidung offen fuer den Orchestrator: balanciert (hier, bewiesen monoton, aber andere Schaetzung als live) oder `BAUM_WAHL`-Schritt
als Standard (fast live-identisch, hat aber das Jd8h-Springen).
## Kartenwahl entschieden: balanciert bleibt Standard (Kriterium: Naehe zum Vollwert)
Test (fest: `SOLVER_ITER=hu_turn:38,hu_flop:40`, beide Arme auf den von baum gewaehlten Karten, Referenz = alle Karten (44 Turn / 49 Flop),
EV-Verlust = bester Vollwert minus Vollwert der gespielten Aktion, nur Spots mit Wertliste; `wahl_ausw.txt`, `wahl_ausw.py`):
| Menge | balanciert: mittl. EV-Verlust / schlimmster / gleiche Aktion | Schritt: dito |
|---|---|---|
| Fixture HU Turn (57; 13/14 mit Wertliste; Karten 6/9/13/16) | 0.0000 / 0.000 / 13 von 13 | 0.0176 / 0.238 / 12 von 14 |
| Kipp Turn (16; 16 Karten) | 0.0369 / 0.353 / 12 von 16 | 0.0590 / 0.353 / 8 von 16 |
| Fixture HU Flop (99; 31 mit Wertliste; 16 Karten) | 0.0008 / 0.024 / 30 von 31 | 0.0171 / 0.507 / 29 von 31 |
Balanciert ist in allen drei Mengen niedriger oder gleich (schlimmster Fall der Kipp-Spots gleich). Es bleibt Standard; die
Schritt-Wahl bleibt als Messschalter `BAUM_WAHL=schritt`.
## Fenster fuer Gate (b) (12 Tische) und die Zeit-Solo-Messung (Schaetzung)
`latenz12_gruende.py <arm>` startet 12 Prozesse `kern_grund`, jeder die ganze 238-Zeilen-Fixture (2856 Entscheidungen, davon ~2400
postflop gezaehlt), alle gleichzeitig = 12 Tische parallel auf 12 von 32 Kernen. Dauer je Prozess ~ Solo-Dauer: live solo 86 s;
baum etwa gleich viel Rechenzeit, bei 12 parallelen mit Cache/Speicher-Konkurrenz 1.2-1.5x: ca. 2-2.5 min je Arm.
Es gibt keine fruehere Zeitmessung (`latenz12_ab.txt` ist leer). Gesamtfenster: Solo-Zeitlauf baum ca. 1.5-2 min + 12-Tische baum
ca. 2.5 min (+ 12-Tische live zum Vergleich ca. 2.5 min) = 4-5 min ohne, 7 min mit Live-Vergleich, allein auf der Maschine.
Das Skript ruft fest die Mess-exe `grund-mess` auf: fuer baum eine Kopie mit dem baum-exe und `BUDGET=baum` im Arm noetig (kleine Aenderung, nicht gemacht).
+6
View File
@@ -0,0 +1,6 @@
cd /c/Users/marcm/pokerfreak-solverkern/budget/kipp
python vergl.py fixture_turn_hu.jsonl w_fixt_bal.txt -
python vergl.py fixture_turn_hu.jsonl w_fixt_str.txt - schritt
python vergl.py kipp_turn.jsonl w_kipp_bal.txt -
python vergl.py kipp_turn.jsonl w_kipp_str.txt - schritt
echo done > kw1.done
+5
View File
@@ -0,0 +1,5 @@
cd /c/Users/marcm/pokerfreak-solverkern/budget/kipp
python vergl.py fixture_flop_hu.jsonl w_flop_bal.txt -
python vergl.py fixture_flop_hu.jsonl w_flop_str.txt - schritt
python vergl.py fixture_flop_hu.jsonl w_flop_full.txt 47
echo done > kw2.done
+2 -1
View File
@@ -8,7 +8,8 @@ for z in open(ks, encoding="utf-8"):
if z and not z.startswith("#") and "=" in z:
k, v = z.split("=", 1); env[k.strip()] = v.strip()
env.pop("SOLVER_ITER", None)
env.update(BUDGET="baum", KERN_GRUND_ZEIT="1", SOLVER_ITER="hu_turn:38")
env.update(BUDGET="baum", KERN_GRUND_ZEIT="1", SOLVER_ITER="hu_turn:38,hu_flop:40")
if len(sys.argv) > 4: env["BAUM_WAHL"] = sys.argv[4]
if sys.argv[3] != "-": env["BAUM_KARTEN"] = sys.argv[3]
src, out = os.path.abspath(sys.argv[1]), os.path.abspath(sys.argv[2])
p = subprocess.Popen([exe, src], env=env, stdout=open(out, "w", encoding="utf-8"), stderr=subprocess.DEVNULL, creationflags=0x4000)
@@ -0,0 +1,34 @@
import re,statistics as st,sys
def lies(f):
r=[]
for l in open(f,encoding='utf-8'):
p=l.rstrip('\n').split('\t')
m=re.search(r'(\d+) (?:river|turn) cards, (\d+) iters',p[2])
v={}
vals=re.search(r'\(pots\): (.*?)\] ->',p[2])
if vals:
for a,x in re.findall(r'(fold|call|check|raise to [\d.]+) ([+-][\d.]+)',vals.group(1)): v[a]=float(x)
a=re.search(r'-> (fold|call|check|raise to [\d.]+)',p[2])
r.append(dict(k=int(m.group(1)) if m else None,v=v,act=a.group(1) if a else None))
return r
def bewerte(arm,full,name):
loss=[];same=0;n=0;worst=(0,None)
for i,(x,y) in enumerate(zip(arm,full)):
if not y['v'] or x['act'] is None or y['act'] is None: continue
n+=1
best=max(y['v'].values())
val=y['v'].get(x['act'])
if val is None: val=min(y['v'].values())
L=best-val; loss.append(L)
if L>worst[0]: worst=(L,i+1)
same+= x['act'].split()[0]==y['act'].split()[0]
cut=sum(1 for x in arm if x['k'] is not None and x['k']<16)
return f"{name}: n={n} mean EV loss {st.mean(loss):.4f} pots, worst {worst[0]:.3f} (line {worst[1]}), action agreement {same}/{n}"
rows=[('fixture HU turn (57)','w_fixt_%s.txt','fix_k44.txt'),('Kipp turn (16)','w_kipp_%s.txt','kipp_k44.txt'),('fixture HU flop (99)','w_flop_%s.txt','w_flop_full.txt')]
for name,pat,full in rows:
F=lies(full)
for arm,lab in (('bal','balanced'),('str','stride')):
A=lies(pat%arm)
cards=sorted(set(x['k'] for x in A if x['k']))
n_cut=sum(1 for x in A if x['k'] and x['k']<(16))
print(bewerte(A,F,f"{name} {lab}"),f"| cards used {cards[:8]}")
@@ -0,0 +1,6 @@
fixture HU turn (57) balanced: n=13 mean EV loss 0.0000 pots, worst 0.000 (line None), action agreement 13/13 | cards used [6, 9, 13, 16]
fixture HU turn (57) stride: n=14 mean EV loss 0.0176 pots, worst 0.238 (line 5), action agreement 12/14 | cards used [6, 9, 13, 16]
Kipp turn (16) balanced: n=16 mean EV loss 0.0369 pots, worst 0.353 (line 16), action agreement 12/16 | cards used [16]
Kipp turn (16) stride: n=16 mean EV loss 0.0590 pots, worst 0.353 (line 16), action agreement 8/16 | cards used [16]
fixture HU flop (99) balanced: n=31 mean EV loss 0.0008 pots, worst 0.024 (line 75), action agreement 30/31 | cards used [16]
fixture HU flop (99) stride: n=31 mean EV loss 0.0171 pots, worst 0.507 (line 29), action agreement 29/31 | cards used [16]