MOTOR_SHARINGAN_REIN: SHARINGAN spielt jede Hand ganz (2-6 Spieler, ohne Motor-Uebergaben, ohne NL2-Nachschicht); lesen/arm_anteil.py; Probe 600/600 aus gleich, rein 96,6 %
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -61,7 +61,7 @@ BEKANNTE_SCHALTER = ("FAUSTREGEL", "DROSSEL", "MDF_UNREAD", "RAISE_DRAWS", "RAIS
|
||||
"MOTOR_VORFLOP_FLOP_QUELLE", "MOTOR_HYB_UEBERSETZUNG", "MOTOR_HYB_FLOP_SUCHE", "MOTOR_HYB_ZELLE", "MOTOR_HYB_RAKE", "MOTOR_PREIS_STRAFF", "MOTOR_STACKOFF", "MOTOR_STACKOFF_TAFEL", "MOTOR_BLUFFPREIS", "MOTOR_VORFLOP_STACKOFF", "MOTOR_VORFLOP_TAFEL", "MOTOR_VORFLOP_SPLASH", "MOTOR_VORFLOP_SPLASH_TAFEL",
|
||||
"MOTOR_SHARINGAN_WARTEN", "MOTOR_SHARINGAN_FRIST_MS", "MOTOR_SHARINGAN_FAEDEN", "MOTOR_SHARINGAN_ADRESSE", "MOTOR_SHARINGAN_EXE",
|
||||
# SHARINGAN-Suche (29.11. spaet, Standard aus): Turn/River und Flop aus seiner Echtzeit-Suche, entscheiden/motor/src/sharingan.rs
|
||||
"MOTOR_SUCHE_QUELLE", "MOTOR_SUCHE_FLOP", "MOTOR_SUCHE_ITERS", "MOTOR_SUCHE_FAEDEN", "MOTOR_SUCHE_DECKEL", "MOTOR_SUCHE_PUFFER", "MOTOR_SUCHE_ADRESSE", "MOTOR_SUCHE_EXE",
|
||||
"MOTOR_SUCHE_QUELLE", "MOTOR_SHARINGAN_REIN", "MOTOR_SUCHE_FLOP", "MOTOR_SUCHE_ITERS", "MOTOR_SUCHE_FAEDEN", "MOTOR_SUCHE_DECKEL", "MOTOR_SUCHE_PUFFER", "MOTOR_SUCHE_ADRESSE", "MOTOR_SUCHE_EXE",
|
||||
# SHARINGAN-Suche mehrtischfest (30.11., Standard aus): Plaetze, Budget nach Tischuhr, Vorsuche, Vorstart, Prioritaet
|
||||
"MOTOR_SUCHE_PARALLEL", "MOTOR_SUCHE_BUDGET", "MOTOR_SUCHE_BUDGET_MIN", "MOTOR_SUCHE_BUDGET_MS_JE_1000", "MOTOR_SUCHE_FRUEH", "MOTOR_SUCHE_VORSTART", "MOTOR_SUCHE_PRIO", "MOTOR_SUCHE_FLOP_ITERS", "MOTOR_SUCHE_FLOP_DECKEL", "MOTOR_FLOP_BAHN",
|
||||
# VERTRAUEN, 29.11., Standard aus: Ausbeutung nach Limit und Spieler dosiert, entscheiden/vertrauen.py
|
||||
@@ -97,7 +97,7 @@ LAEUFER_SCHALTER = ("AUSWAHL_FREI", "RUECKKEHR_STACK", "LEER_HOECHST", "NEUSTART
|
||||
"MOTOR_VORFLOP_FLOP_QUELLE", "MOTOR_HYB_UEBERSETZUNG", "MOTOR_HYB_FLOP_SUCHE", "MOTOR_HYB_ZELLE", "MOTOR_HYB_RAKE", "MOTOR_PREIS_STRAFF", "MOTOR_STACKOFF", "MOTOR_STACKOFF_TAFEL", "MOTOR_BLUFFPREIS", "MOTOR_VORFLOP_STACKOFF", "MOTOR_VORFLOP_TAFEL", "MOTOR_VORFLOP_SPLASH", "MOTOR_VORFLOP_SPLASH_TAFEL",
|
||||
"MOTOR_SHARINGAN_WARTEN", "MOTOR_SHARINGAN_FRIST_MS", "MOTOR_SHARINGAN_FAEDEN", "MOTOR_SHARINGAN_ADRESSE", "MOTOR_SHARINGAN_EXE",
|
||||
# SHARINGAN-Suche (29.11. spaet, Standard aus): Turn/River und Flop aus seiner Echtzeit-Suche, entscheiden/motor/src/sharingan.rs
|
||||
"MOTOR_SUCHE_QUELLE", "MOTOR_SUCHE_FLOP", "MOTOR_SUCHE_ITERS", "MOTOR_SUCHE_FAEDEN", "MOTOR_SUCHE_DECKEL", "MOTOR_SUCHE_PUFFER", "MOTOR_SUCHE_ADRESSE", "MOTOR_SUCHE_EXE",
|
||||
"MOTOR_SUCHE_QUELLE", "MOTOR_SHARINGAN_REIN", "MOTOR_SUCHE_FLOP", "MOTOR_SUCHE_ITERS", "MOTOR_SUCHE_FAEDEN", "MOTOR_SUCHE_DECKEL", "MOTOR_SUCHE_PUFFER", "MOTOR_SUCHE_ADRESSE", "MOTOR_SUCHE_EXE",
|
||||
# SHARINGAN-Suche mehrtischfest (30.11., Standard aus): Plaetze, Budget nach Tischuhr, Vorsuche, Vorstart, Prioritaet
|
||||
"MOTOR_SUCHE_PARALLEL", "MOTOR_SUCHE_BUDGET", "MOTOR_SUCHE_BUDGET_MIN", "MOTOR_SUCHE_BUDGET_MS_JE_1000", "MOTOR_SUCHE_FRUEH", "MOTOR_SUCHE_VORSTART", "MOTOR_SUCHE_PRIO", "MOTOR_SUCHE_FLOP_ITERS", "MOTOR_SUCHE_FLOP_DECKEL", "MOTOR_FLOP_BAHN",
|
||||
# VERTRAUEN, 29.11., Standard aus: Ausbeutung nach Limit und Spieler dosiert, entscheiden/vertrauen.py
|
||||
|
||||
@@ -110,6 +110,8 @@ thread_local! {
|
||||
static SCHMAL_MS: std::cell::Cell<Option<f64>> = const { std::cell::Cell::new(None) };
|
||||
static REST: std::cell::Cell<Option<f64>> = const { std::cell::Cell::new(None) };
|
||||
static KAPPE_TRAF: std::cell::Cell<bool> = const { std::cell::Cell::new(false) };
|
||||
// MOTOR_SHARINGAN_REIN: warum in einer SHARINGAN-Hand doch unser Motor spielte
|
||||
static REIN_AUSFALL: std::cell::Cell<Option<&'static str>> = const { std::cell::Cell::new(None) };
|
||||
// MOTOR_VORRECHNEN=1 (28.11.): Tisch der laufenden Anfrage (Feld `tisch`) und je gemerktem Spiel sein Tisch
|
||||
static TISCH: std::cell::RefCell<Option<String>> = const { std::cell::RefCell::new(None) };
|
||||
static MERK_TISCH: std::cell::RefCell<Vec<(u64, String)>> = const { std::cell::RefCell::new(Vec::new()) };
|
||||
@@ -480,9 +482,33 @@ impl Motor {
|
||||
}
|
||||
|
||||
fn antworte_roh(&self, q: &Value) -> Value {
|
||||
match self.versuche(q) {
|
||||
REIN_AUSFALL.with(|r| r.set(None));
|
||||
let r = self.versuche(q);
|
||||
// MOTOR_SHARINGAN_REIN: seine Zuege ohne unsere NL2-Nachschicht (das Gedaechtnis zaehlt weiter mit)
|
||||
if crate::sharingan::rein() && self.hybrid(q) {
|
||||
if let Ok(a) = &r {
|
||||
if a["reason"].as_str().is_some_and(|x| x.starts_with("sharingan")) {
|
||||
crate::gedaechtnis::beobachte(q);
|
||||
return a.clone();
|
||||
}
|
||||
}
|
||||
let grund = REIN_AUSFALL.with(|r| r.get()).unwrap_or("kein Kontext (Sitze, Verlauf)");
|
||||
let mut a = match r {
|
||||
Ok(a) => self.nl2(q, a),
|
||||
Err(e) => Self::notfall(q, &e),
|
||||
};
|
||||
a["reason"] = json!(format!("[rein-ausfall: {grund}] {}", a["reason"].as_str().unwrap_or("")));
|
||||
return a;
|
||||
}
|
||||
match r {
|
||||
Ok(a) => self.nl2(q, a),
|
||||
Err(e) => {
|
||||
Err(e) => Self::notfall(q, &e),
|
||||
}
|
||||
}
|
||||
|
||||
fn notfall(q: &Value, e: &str) -> Value {
|
||||
{
|
||||
{
|
||||
// Notfall: Equity gegen Zufallshaende gegen den Preis, vorsichtig; im reason erkennbar
|
||||
let legal = |x: &str| q["legalActions"].as_array().is_some_and(|l| l.iter().any(|y| y == x));
|
||||
let (offen, pot) = (q["toCall"].as_f64().unwrap_or(0.0), q["pot"].as_f64().unwrap_or(0.0));
|
||||
@@ -559,13 +585,25 @@ impl Motor {
|
||||
|
||||
/// Hybrid (MOTOR_VORFLOP_FLOP_QUELLE=sharingan): nur der 6-max-Hauptmotor ohne Straddle, Splash und Antes
|
||||
fn hybrid(&self, q: &Value) -> bool {
|
||||
crate::sharingan::an() && !self.s.turnier && self.s.n == 6 && !self.s.straddle && self.s.splash == 0 && !self.s.ante && self.s.art != crate::spiel::Art::PushFold
|
||||
crate::sharingan::an() && !self.s.turnier && (self.s.n == 6 || crate::sharingan::rein() && (2..=6).contains(&self.s.n)) && !self.s.straddle && self.s.splash == 0 && !self.s.ante && self.s.art != crate::spiel::Art::PushFold
|
||||
&& Self::splash_tot(q) == 0.0 && Self::ante_tot(q) == 0.0 && !Self::ist_straddle(q) && q.get("eigen").is_none() && q.get("probeHand").is_none()
|
||||
}
|
||||
|
||||
fn versuche(&self, q: &Value) -> Result<Value, String> {
|
||||
let _hybrid = if crate::sharingan::an() { Some(crate::sharingan::Wache::setze(self.hybrid(q).then(|| crate::sharingan::Kontext::aus(q)).flatten())) } else { None };
|
||||
if let Some(k) = _hybrid.as_ref().and_then(|_| crate::sharingan::kontext()) {
|
||||
// MOTOR_SHARINGAN_REIN=1: die ganze Hand SHARINGAN (Suche, sonst Blueprint), unser Motor nur bei Ausfall
|
||||
if crate::sharingan::rein() {
|
||||
if q["street"] != "PREFLOP" {
|
||||
if let Some(a) = crate::sharingan::such_zug(q, &k) {
|
||||
return Ok(a);
|
||||
}
|
||||
}
|
||||
if let Some(a) = crate::sharingan::zug(q, &k) {
|
||||
return Ok(a);
|
||||
}
|
||||
REIN_AUSFALL.with(|r| r.set(Some("keine Antwort von SHARINGAN")));
|
||||
}
|
||||
// MOTOR_SUCHE_QUELLE=sharingan: seine Suche auf Turn/River und auf dem Flop, wo sonst sein Blueprint spielt
|
||||
if crate::sharingan::suche_an() {
|
||||
let st = q["street"].as_str().unwrap_or("");
|
||||
|
||||
@@ -62,6 +62,14 @@ pub fn an() -> bool {
|
||||
static AN: OnceLock<bool> = OnceLock::new();
|
||||
*AN.get_or_init(|| std::env::var("MOTOR_VORFLOP_FLOP_QUELLE").is_ok_and(|x| x == "sharingan"))
|
||||
}
|
||||
/// MOTOR_SHARINGAN_REIN=1 (30.11. Nacht, Owner "SHARINGAN anmachen und testen", Standard aus): jede Hand an Cash-Tischen mit 2 bis 6
|
||||
/// Spielern (ohne Splash, Ante, Straddle) spielt SHARINGAN von vorne bis hinten: Vorflop auch an den Rake-Knoten, Flop auch nach
|
||||
/// fremden Groessen, Suche auf Flop/Turn/River ohne RNR-Sperre, ohne unsere NL2-Nachschicht. Kommt keine Suche, spielt sein
|
||||
/// Blueprint; erst wenn auch der nicht antwortet, unser Motor (Grund beginnt mit "[rein-ausfall"). Nur mit dem Hybrid.
|
||||
pub fn rein() -> bool {
|
||||
static A: OnceLock<bool> = OnceLock::new();
|
||||
*A.get_or_init(|| an() && std::env::var("MOTOR_SHARINGAN_REIN").is_ok_and(|x| x == "1"))
|
||||
}
|
||||
|
||||
fn schalter(k: &str, w: &str) -> bool {
|
||||
std::env::var(k).is_ok_and(|x| x == w)
|
||||
@@ -72,25 +80,25 @@ pub fn phm() -> bool {
|
||||
}
|
||||
pub fn flop_suche() -> bool {
|
||||
static A: OnceLock<bool> = OnceLock::new();
|
||||
*A.get_or_init(|| schalter("MOTOR_HYB_FLOP_SUCHE", "1"))
|
||||
*A.get_or_init(|| schalter("MOTOR_HYB_FLOP_SUCHE", "1") && !rein())
|
||||
}
|
||||
/// MOTOR_HYB_ZELLE=flop_cbet (30.11. nachts, Standard aus): gegen eine Kopf-an-Kopf-C-Bet am Flop (erste Erhoehung des Flops
|
||||
/// durch den letzten Erhoeher vor dem Flop, zwei Spieler) spielt der Motor statt SHARINGAN den Flop dieses Spielers weiter
|
||||
/// (wie nach einer fremden Groesse). Zelle "FLOP gegen C-Bet" aus verlust/karte-mit-suche.txt (+10,5 +-7,6 bb/100 Motor - SHARINGAN).
|
||||
pub fn zelle_cbet() -> bool {
|
||||
static A: OnceLock<bool> = OnceLock::new();
|
||||
*A.get_or_init(|| schalter("MOTOR_HYB_ZELLE", "flop_cbet"))
|
||||
*A.get_or_init(|| schalter("MOTOR_HYB_ZELLE", "flop_cbet") && !rein())
|
||||
}
|
||||
pub fn rake_tafel() -> bool {
|
||||
static A: OnceLock<bool> = OnceLock::new();
|
||||
*A.get_or_init(|| schalter("MOTOR_HYB_RAKE", "tafel") || vorflop_motor())
|
||||
*A.get_or_init(|| (schalter("MOTOR_HYB_RAKE", "tafel") || vorflop_motor()) && !rein())
|
||||
}
|
||||
/// MOTOR_HYB_RAKE=vorflop (30.11. nachmittags, Standard aus): den ganzen Vorflop spielt unsere Tabelle, SHARINGAN erst ab dem
|
||||
/// Flop (Blueprint, Suche). Grund: echte NL2-Haende seit dem Hybrid, 6 Plaetze, Opens ausser den Blinds: SHARINGAN -0,71 bb je
|
||||
/// Open (426, 2,0-2,25 bb), unsere Tabelle davor +0,80 (1297, 2,5-2,9 bb); gegen 3-Bet callt er 47 % statt 27 %.
|
||||
pub fn vorflop_motor() -> bool {
|
||||
static A: OnceLock<bool> = OnceLock::new();
|
||||
*A.get_or_init(|| schalter("MOTOR_HYB_RAKE", "vorflop"))
|
||||
*A.get_or_init(|| schalter("MOTOR_HYB_RAKE", "vorflop") && !rein())
|
||||
}
|
||||
fn live() -> bool {
|
||||
static A: OnceLock<bool> = OnceLock::new();
|
||||
@@ -188,13 +196,15 @@ impl Kontext {
|
||||
sitze.extend(hist_q.iter().filter_map(|h| h["seat"].as_i64()));
|
||||
sitze.sort_unstable();
|
||||
sitze.dedup();
|
||||
if sitze.len() != 6 {
|
||||
// sechs Plaetze; mit MOTOR_SHARINGAN_REIN 2 bis 6 (sein Dienst spielt 2 bis 6, Kopf an Kopf ist der Knopf der SB)
|
||||
let n = sitze.len();
|
||||
if n != 6 && !(rein() && (2..=6).contains(&n)) {
|
||||
return None;
|
||||
}
|
||||
let pos = |s: i64| sitze.iter().position(|&x| x == s);
|
||||
let sb = pos(hist_q.iter().find(|h| h["action"] == "POST_SB")?["seat"].as_i64()?)?;
|
||||
let bbs = pos(hist_q.iter().find(|h| h["action"] == "POST_BB")?["seat"].as_i64()?)?;
|
||||
if bbs != (sb + 1) % 6 || hist_q.iter().filter(|h| h["action"] == "POST_BB").count() != 1 {
|
||||
if bbs != (sb + 1) % n || hist_q.iter().filter(|h| h["action"] == "POST_BB").count() != 1 {
|
||||
return None;
|
||||
}
|
||||
let strasse_nr = |s: &str| ["PREFLOP", "FLOP", "TURN", "RIVER"].iter().position(|x| *x == s).map(|x| x as u8);
|
||||
@@ -208,6 +218,9 @@ impl Kontext {
|
||||
let mut fremd_kandidat: Vec<(usize, i64, usize)> = Vec::new();
|
||||
// C-Bet-Zelle: letzter Erhoeher vor dem Flop, Abgaenge, Index der C-Bet in `zuege`
|
||||
let (mut vor_agg, mut raus, mut cbet): (Option<usize>, [bool; 6], Option<usize>) = (None, [false; 6], None);
|
||||
for r in raus.iter_mut().skip(n) {
|
||||
*r = true; // leere Plaetze (nur mit weniger als sechs)
|
||||
}
|
||||
let rake_knoten_von = |s: usize, erh: u32, frei: &[bool; 6]| vorflop_motor() || (erh == 1 && !frei[s]) || (erh == 0 && s == sb);
|
||||
for h in hist_q {
|
||||
let x = h["action"].as_str()?;
|
||||
@@ -279,7 +292,7 @@ impl Kontext {
|
||||
if strasse == 0 && x != "FOLD" {
|
||||
frei[s] = true;
|
||||
}
|
||||
zuege.push(Zug { strasse, sitz: ((s + 6 - sb) % 6) as u8, j: hist.len(), art, to, motor });
|
||||
zuege.push(Zug { strasse, sitz: ((s + n - sb) % n) as u8, j: hist.len(), art, to, motor });
|
||||
}
|
||||
if let Some(t) = to {
|
||||
hoch = hoch.max(t);
|
||||
@@ -295,7 +308,7 @@ impl Kontext {
|
||||
}
|
||||
let mut spieler = Vec::new();
|
||||
let mut start = [0i64; 6];
|
||||
for s in 0..6 {
|
||||
for s in 0..n {
|
||||
start[s] = stand[s]? + drin[s];
|
||||
spieler.push(json!({"seat": s, "stack_start": start[s]}));
|
||||
}
|
||||
@@ -303,20 +316,20 @@ impl Kontext {
|
||||
let erst_fremd = fremd_kandidat.iter().find(|&&(s, d, _)| d < start[s]).map(|x| x.2);
|
||||
let flop_fremd = erst_fremd.is_some();
|
||||
if let (Some(i), true) = (erst_fremd, flop_suche()) {
|
||||
for z in zuege.iter_mut().skip(i).filter(|z| z.strasse == 1 && z.sitz == ((hs + 6 - sb) % 6) as u8) {
|
||||
for z in zuege.iter_mut().skip(i).filter(|z| z.strasse == 1 && z.sitz == ((hs + n - sb) % n) as u8) {
|
||||
z.motor = true;
|
||||
}
|
||||
}
|
||||
let flop_cbet = cbet.is_some();
|
||||
if let (Some(i), true) = (cbet, zelle_cbet()) {
|
||||
for z in zuege.iter_mut().skip(i).filter(|z| z.strasse == 1 && z.sitz == ((hs + 6 - sb) % 6) as u8) {
|
||||
for z in zuege.iter_mut().skip(i).filter(|z| z.strasse == 1 && z.sitz == ((hs + n - sb) % n) as u8) {
|
||||
z.motor = true;
|
||||
}
|
||||
}
|
||||
let brett: Vec<String> = ["FLOP", "TURN", "RIVER"].iter().flat_map(|s| q["board"][*s].as_array().into_iter().flatten().filter_map(karte)).collect();
|
||||
let loch: Vec<String> = q["heroCards"].as_array()?.iter().filter_map(karte).collect();
|
||||
let seed = q["seed"].as_u64().unwrap_or(1);
|
||||
let mut basis = json!({"small_blind": 50, "big_blind": 100, "button_seat": (sb + 5) % 6, "hero_seat": pos(held)?, "hole_cards": loch,
|
||||
let mut basis = json!({"small_blind": 50, "big_blind": 100, "button_seat": if n == 2 { sb } else { (sb + n - 1) % n }, "hero_seat": pos(held)?, "hole_cards": loch,
|
||||
"board": brett, "players": spieler, "history": hist, "options": {"seed": seed, "include_probs": false}});
|
||||
if phm() {
|
||||
// je Hand fest: eigene Lochkarten, Startstapel, Knopf (FNV-1a)
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Wer hat wirklich gespielt? Anteil der Entscheidungen je Quelle, je A/B-Arm (30.11.: SHARINGAN lief im Hybrid nur bei 26 % der
|
||||
Entscheidungen, ohne dass es jemand sah; dieser Bericht gehoert nach jeden Lauf).
|
||||
|
||||
Quelle je gespieltem Zug (Feld `grund` in archiv/lauf/zuege.jsonl):
|
||||
S-Suche "sharingan search ..."
|
||||
S-Blueprint "sharingan blueprint ..." / sonstige "sharingan ..."
|
||||
Rein-Ausfall "[rein-ausfall: ...]" (MOTOR_SHARINGAN_REIN: SHARINGAN-Hand, doch unser Motor; Grund steht dabei)
|
||||
Motor alles andere
|
||||
Arm einer Hand: der erste Zug mit `ab.arm` A oder B (die Muenze haengt an der Hand). Ohne AB_SPOT steht alles unter "-".
|
||||
Gemischt heisst: eine Hand des Arms B, in der ein Zug nicht aus B kam (`nicht_gezogen`, B zu spaet) oder ein Rein-Ausfall war.
|
||||
Keine Hand-Ebene in der Ausgabe, nur Zaehlungen.
|
||||
|
||||
python lesen/arm_anteil.py [zuege.jsonl] [--ab 2026-11-30T23:00]
|
||||
"""
|
||||
import collections
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
|
||||
_WURZEL = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
|
||||
def quelle(grund):
|
||||
g = str(grund or "")
|
||||
if g.startswith("[rein-ausfall"):
|
||||
return "Rein-Ausfall"
|
||||
if g.startswith("sharingan search"):
|
||||
return "S-Suche"
|
||||
if g.startswith("sharingan"):
|
||||
return "S-Blueprint"
|
||||
return "Motor"
|
||||
|
||||
|
||||
def lies(pfad, ab):
|
||||
haende = collections.OrderedDict()
|
||||
for z in open(pfad, "rb"):
|
||||
if b'"grund"' not in z:
|
||||
continue
|
||||
try:
|
||||
r = json.loads(z)
|
||||
except ValueError:
|
||||
continue
|
||||
zeit = str(r.get("zeit") or "").replace(" ", "T")
|
||||
if ab and zeit < ab:
|
||||
continue
|
||||
h = haende.setdefault(str(r.get("hand")), {"arm": None, "zuege": []})
|
||||
x = r.get("ab") if isinstance(r.get("ab"), dict) else {}
|
||||
if h["arm"] is None and x.get("arm") in ("A", "B"):
|
||||
h["arm"] = x["arm"]
|
||||
h["zuege"].append((r.get("street"), quelle(r.get("grund")), x.get("art"), str(r.get("grund") or "")))
|
||||
return haende
|
||||
|
||||
|
||||
def bericht(haende):
|
||||
z = []
|
||||
je = collections.defaultdict(collections.Counter)
|
||||
gemischt = collections.Counter()
|
||||
ausfall = collections.Counter()
|
||||
for h in haende.values():
|
||||
arm = h["arm"] or "-"
|
||||
for st, q, art, g in h["zuege"]:
|
||||
je[(arm, st)][q] += 1
|
||||
je[(arm, "alle")][q] += 1
|
||||
if q == "Rein-Ausfall":
|
||||
ausfall[g.split("]", 1)[0][:70]] += 1
|
||||
if arm == "B" and any(art == "nicht_gezogen" or q == "Rein-Ausfall" for _, q, art, _ in h["zuege"]):
|
||||
gemischt["B"] += 1
|
||||
arme = collections.Counter(h["arm"] or "-" for h in haende.values())
|
||||
z.append(f"Haende je Arm: {dict(arme)}; Arm-B-Haende gemischt (nicht gezogen oder Rein-Ausfall): {gemischt['B']}")
|
||||
quellen = ("S-Suche", "S-Blueprint", "Motor", "Rein-Ausfall")
|
||||
z.append(f"{'Arm':4s} {'Strasse':8s} {'Zuege':>7s} " + " ".join(f"{q:>13s}" for q in quellen))
|
||||
for (arm, st) in sorted(je, key=lambda k: (k[0], ("PREFLOP", "FLOP", "TURN", "RIVER", "alle").index(k[1]) if k[1] in ("PREFLOP", "FLOP", "TURN", "RIVER", "alle") else 9)):
|
||||
c = je[(arm, st)]
|
||||
n = sum(c.values())
|
||||
z.append(f"{arm:4s} {str(st):8s} {n:7d} " + " ".join(f"{c[q] / n:13.1%}" for q in quellen))
|
||||
if ausfall:
|
||||
z.append("Rein-Ausfaelle: " + json.dumps(ausfall.most_common(8), ensure_ascii=False))
|
||||
return z
|
||||
|
||||
|
||||
def main():
|
||||
a = sys.argv[1:]
|
||||
ab = a[a.index("--ab") + 1] if "--ab" in a else None
|
||||
pos = [x for i, x in enumerate(a) if not x.startswith("--") and (i == 0 or a[i - 1] != "--ab")]
|
||||
pfad = pos[0] if pos else os.path.join(_WURZEL, "archiv", "lauf", "zuege.jsonl")
|
||||
print("\n".join(bericht(lies(pfad, ab))))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,32 @@
|
||||
---
|
||||
titel: SHARINGAN rein gegen Motor rein, A/B je Hand live
|
||||
strang: motor
|
||||
plan: PLAN-motor, Motorwahl (Owner 30.11. Nacht: "SHARINGAN anmachen und testen", Hybrid lief nur zu 26 %)
|
||||
frage: Gewinnt SHARINGAN, das jede Hand ganz spielt (2 bis 6 Spieler, ohne Motor-Uebergaben und NL2-Nachschicht), gegen unseren Motor allein an denselben Tischen?
|
||||
tor: B (SHARINGAN rein) gegen A (Motor rein) in bb/100 AIVAT ueber die Spot-Haende, 95-%-Intervall; B wird Basis, wenn das Intervall nicht klar unter 0 liegt (Grundstrategie: nicht klar schlechter) UND der Anteil gemischter B-Haende unter 5 % bleibt; Notbremse je Marke wie live.
|
||||
decke: Unterschied der beiden Engines bis etwa 10 bb/100 (30.11.: Hybrid -5,5 gegen Motor +3,6/+7,2); Aufloesung je 10.000 Haende etwa +-6 bb/100, gut die Haelfte der Haende spielt B
|
||||
abbruch: Auswertung nach jeder Sitzung (lesen/ab_spot.py und lesen/arm_anteil.py); Stopp, sobald das Intervall entschieden ist; sofort Stopp, wenn arm_anteil mehr als 5 % gemischte B-Haende oder SHARINGAN-Anteil in B unter 90 % zeigt (dann misst der Lauf nicht SHARINGAN)
|
||||
quelle: eigene Echtgeld-Haende NL2 (live A/B, Owner 29.11.: nur live zaehlt)
|
||||
status: geplant
|
||||
ergebnis: –
|
||||
entscheidung: offen
|
||||
punkt: –
|
||||
schalter: MOTOR_SHARINGAN_REIN=1 (Arm B, mit MOTOR_VORFLOP_FLOP_QUELLE=sharingan, MOTOR_SUCHE_QUELLE=sharingan)
|
||||
buendel: –
|
||||
stand: 2026-12-01
|
||||
bericht: BERICHT.md
|
||||
starter: –
|
||||
nachfolger: –
|
||||
eichung: –
|
||||
stackoff: Pflicht in der Auswertung (lesen/stackoff.py je Arm)
|
||||
---
|
||||
|
||||
Rauchprobe 01.12. 00:05 (probe.py, probe.txt):
|
||||
- Aus: neue Exe ohne Schalter gegen die Live-Exe 656c5997 auf 600 echten Anfragen vom 30.11.: 600/600 gleich.
|
||||
- Rein: 500 echte Anfragen je (Spielerzahl 2..6, Strasse): SHARINGAN 96,6 % (Suche 275, Blueprint 208), Ausfall 17. Davon 14 "kein Kontext" (z. B. nachgepostete Blinds), 3 sind Straddle-Haende ausserhalb des Rein-Bereichs (ganze Hand Motor).
|
||||
- Rechenzeit Median/p95: Flop 80/302 ms, Turn 46/118 ms, River 26/51 ms.
|
||||
|
||||
Bekannt und offen:
|
||||
- Hand mit nachgepostetem BB: Motor die ganze Hand (gezaehlt als Rein-Ausfall).
|
||||
- Splash, Ante, Straddle: ganze Hand Motor, in beiden Armen gleich.
|
||||
- SHARINGAN ist ohne Rake gelernt.
|
||||
@@ -0,0 +1,28 @@
|
||||
Aus (MOTOR_SHARINGAN_REIN nicht gesetzt) gegen pokerbench-motor-schatten.exe: 600/600 gleich
|
||||
Rein (MOTOR_SHARINGAN_REIN=1): je (Spieler, Strasse) Antworten suche / blueprint / ausfall
|
||||
(2, 'FLOP'): {'suche': 12, 'blueprint': 13}
|
||||
(2, 'PREFLOP'): {'blueprint': 25}
|
||||
(2, 'RIVER'): {'blueprint': 15, 'suche': 10}
|
||||
(2, 'TURN'): {'suche': 9, 'blueprint': 16}
|
||||
(3, 'FLOP'): {'suche': 25}
|
||||
(3, 'PREFLOP'): {'blueprint': 25}
|
||||
(3, 'RIVER'): {'blueprint': 8, 'suche': 17}
|
||||
(3, 'TURN'): {'suche': 18, 'blueprint': 7}
|
||||
(4, 'FLOP'): {'suche': 24, 'blueprint': 1}
|
||||
(4, 'PREFLOP'): {'blueprint': 24, 'ausfall': 1}
|
||||
(4, 'RIVER'): {'suche': 21, 'ausfall': 2, 'blueprint': 2}
|
||||
(4, 'TURN'): {'blueprint': 5, 'suche': 19, 'ausfall': 1}
|
||||
(5, 'FLOP'): {'ausfall': 1, 'suche': 23, 'blueprint': 1}
|
||||
(5, 'PREFLOP'): {'blueprint': 25}
|
||||
(5, 'RIVER'): {'suche': 17, 'blueprint': 6, 'ausfall': 2}
|
||||
(5, 'TURN'): {'suche': 20, 'ausfall': 3, 'blueprint': 2}
|
||||
(6, 'FLOP'): {'suche': 22, 'ausfall': 1, 'blueprint': 2}
|
||||
(6, 'PREFLOP'): {'blueprint': 23, 'ausfall': 2}
|
||||
(6, 'RIVER'): {'suche': 19, 'blueprint': 4, 'ausfall': 2}
|
||||
(6, 'TURN'): {'blueprint': 4, 'suche': 19, 'ausfall': 2}
|
||||
zusammen {'blueprint': 208, 'suche': 275, 'ausfall': 17}; SHARINGAN-Anteil 96.6%
|
||||
Ausfallgruende: [["[rein-ausfall: kein Kontext (Sitze, Verlauf)", 14], ["motor preis: Verlauf passt nicht (Zug 0: Baum Strasse 0 Sitz 2, echt 0 3); Gewin", 1], ["motor preis: Verlauf passt nicht (Zug 0: Baum Strasse 0 Sitz 3, echt 0 4); Gewin", 1], ["motor preis: Verlauf passt nicht (Zug 0: Baum Strasse 0 Sitz 4, echt 0 5); Gewin", 1]]
|
||||
TURN: Median 46 ms, p95 118 ms
|
||||
PREFLOP: Median 2 ms, p95 3 ms
|
||||
FLOP: Median 80 ms, p95 302 ms
|
||||
RIVER: Median 26 ms, p95 51 ms
|
||||
@@ -0,0 +1,111 @@
|
||||
"""MOTOR_SHARINGAN_REIN: Aus-Pruefung und Rein-Probe auf echten Anfragen vom 30.11. (Schattenlog des Live-Baums).
|
||||
|
||||
1. Aus: neue Exe ohne Schalter gegen die Live-Exe, je Strasse bis zu 150 Anfragen, ohne Dienste (wie aus_pruefung.py): muss gleich sein.
|
||||
2. Rein: neue Exe mit allen Live-Schaltern, Hybrid und Suche an, MOTOR_SHARINGAN_REIN=1, SHARINGAN-Dienste auf Probe-Ports
|
||||
(47135/47137, nie die Live-Ports), je (Spielerzahl, Strasse) bis zu 25 Anfragen: Anteil der Antworten von SHARINGAN,
|
||||
Ausfaelle mit Grund, Rechenzeit. Schreibt probe.txt (Zaehlungen, keine Hand-Ebene).
|
||||
|
||||
python -I -X utf8 probe.py <live.exe> <neu.exe>
|
||||
"""
|
||||
import collections
|
||||
import json
|
||||
import os
|
||||
import random
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "stackoff_preis"))
|
||||
from aus_pruefung import D, LIVE, lauf # noqa: E402
|
||||
|
||||
HIER = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
||||
def live_schalter():
|
||||
u = {}
|
||||
for z in open(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.startswith(("MOTOR_", "TURNIER_")):
|
||||
u[k] = v
|
||||
return u
|
||||
|
||||
|
||||
def lauf_rein(exe, faelle):
|
||||
env = {k: v for k, v in os.environ.items() if not k.startswith("MOTOR_")}
|
||||
env.update(live_schalter())
|
||||
env.update({"MOTOR_SHARINGAN_REIN": "1", "MOTOR_SUCHE_QUELLE": "sharingan", "MOTOR_SHARINGAN_ADRESSE": "127.0.0.1:47135",
|
||||
"MOTOR_SUCHE_ADRESSE": "127.0.0.1:47137", "MOTOR_SHARINGAN_WARTEN": "900", "MOTOR_SUCHE_FRUEH": "0"})
|
||||
p = subprocess.Popen([exe, "dienst", "sechs100", D, "2000-600-400", "200", f"{D}/sechs100-v2.bin", "genau", f"hu={D}/hu100-v1.bin,{D}/hu200-v2.bin"],
|
||||
stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, text=True, encoding="utf-8", env=env,
|
||||
creationflags=0x4000 | 0x08000000)
|
||||
out = []
|
||||
for r in faelle:
|
||||
q = {k: v for k, v in r["q"].items() if k != "frist_rest_s"}
|
||||
t = time.time()
|
||||
p.stdin.write(json.dumps(dict(q, seed=r.get("seed") or 1)) + "\n")
|
||||
p.stdin.flush()
|
||||
a = json.loads(p.stdout.readline())
|
||||
a["_ms"] = (time.time() - t) * 1000
|
||||
out.append(a)
|
||||
p.kill()
|
||||
return out
|
||||
|
||||
|
||||
def main():
|
||||
alt, neu = sys.argv[1:3]
|
||||
F = []
|
||||
for z in open(LIVE + "/archiv/lauf/schatten.jsonl", "rb"):
|
||||
if b'"q"' not in z or b"2026-11-30T" not in z[:40]:
|
||||
continue
|
||||
try:
|
||||
r = json.loads(z)
|
||||
except ValueError:
|
||||
continue
|
||||
if r.get("q") and r.get("motor") and "Splash" not in str(r["motor"].get("reason")):
|
||||
F.append(r)
|
||||
random.seed(5)
|
||||
z = []
|
||||
je = collections.defaultdict(list)
|
||||
for r in F:
|
||||
je[r["q"]["street"]].append(r)
|
||||
aus = [x for v in je.values() for x in random.sample(v, min(150, len(v)))]
|
||||
a, b = lauf(alt, aus, {}), lauf(neu, aus, {})
|
||||
rund = lambda x: None if x is None else round(x, 6) # noqa: E731
|
||||
gleich = sum((x.get("action"), rund(x.get("size"))) == (y.get("action"), rund(y.get("size"))) for x, y in zip(a, b))
|
||||
z.append(f"Aus (MOTOR_SHARINGAN_REIN nicht gesetzt) gegen {os.path.basename(alt)}: {gleich}/{len(aus)} gleich")
|
||||
je = collections.defaultdict(list)
|
||||
for r in F:
|
||||
je[(len(r["q"].get("villains") or []) + 1, r["q"]["street"])].append(r)
|
||||
rein = [x for v in je.values() for x in random.sample(v, min(25, len(v)))]
|
||||
# erst warm: der Dienst startet im Hintergrund, die ersten Fragen warten (WARTEN=900)
|
||||
c = lauf_rein(neu, rein)
|
||||
st = collections.defaultdict(collections.Counter)
|
||||
gruende = collections.Counter()
|
||||
ms = collections.defaultdict(list)
|
||||
for r, x in zip(rein, c):
|
||||
k = (len(r["q"].get("villains") or []) + 1, r["q"]["street"])
|
||||
g = str(x.get("reason"))
|
||||
quelle = "suche" if g.startswith("sharingan search") else "blueprint" if g.startswith("sharingan") else "ausfall"
|
||||
st[k][quelle] += 1
|
||||
ms[k[1]].append(x["_ms"])
|
||||
if quelle == "ausfall":
|
||||
gruende[g.split("]", 1)[0][:80]] += 1
|
||||
z.append("Rein (MOTOR_SHARINGAN_REIN=1): je (Spieler, Strasse) Antworten suche / blueprint / ausfall")
|
||||
for k in sorted(st):
|
||||
z.append(f" {k}: {dict(st[k])}")
|
||||
tot = collections.Counter()
|
||||
for v in st.values():
|
||||
tot.update(v)
|
||||
z.append(f" zusammen {dict(tot)}; SHARINGAN-Anteil {(tot['suche'] + tot['blueprint']) / max(1, sum(tot.values())):.1%}")
|
||||
z.append(" Ausfallgruende: " + json.dumps(gruende.most_common(10), ensure_ascii=False))
|
||||
for s, v in ms.items():
|
||||
v.sort()
|
||||
z.append(f" {s}: Median {v[len(v) // 2]:.0f} ms, p95 {v[int(len(v) * 0.95)]:.0f} ms")
|
||||
open(os.path.join(HIER, "probe.txt"), "w", encoding="utf-8", newline="\n").write("\n".join(z) + "\n")
|
||||
print("\n".join(z))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,28 @@
|
||||
Aus (MOTOR_SHARINGAN_REIN nicht gesetzt) gegen pokerbench-motor-schatten.exe: 600/600 gleich
|
||||
Rein (MOTOR_SHARINGAN_REIN=1): je (Spieler, Strasse) Antworten suche / blueprint / ausfall
|
||||
(2, 'FLOP'): {'suche': 12, 'blueprint': 13}
|
||||
(2, 'PREFLOP'): {'blueprint': 25}
|
||||
(2, 'RIVER'): {'blueprint': 15, 'suche': 10}
|
||||
(2, 'TURN'): {'suche': 9, 'blueprint': 16}
|
||||
(3, 'FLOP'): {'suche': 25}
|
||||
(3, 'PREFLOP'): {'blueprint': 25}
|
||||
(3, 'RIVER'): {'blueprint': 8, 'suche': 17}
|
||||
(3, 'TURN'): {'suche': 18, 'blueprint': 7}
|
||||
(4, 'FLOP'): {'suche': 24, 'blueprint': 1}
|
||||
(4, 'PREFLOP'): {'blueprint': 24, 'ausfall': 1}
|
||||
(4, 'RIVER'): {'suche': 21, 'ausfall': 2, 'blueprint': 2}
|
||||
(4, 'TURN'): {'blueprint': 5, 'suche': 19, 'ausfall': 1}
|
||||
(5, 'FLOP'): {'ausfall': 1, 'suche': 23, 'blueprint': 1}
|
||||
(5, 'PREFLOP'): {'blueprint': 25}
|
||||
(5, 'RIVER'): {'suche': 17, 'blueprint': 6, 'ausfall': 2}
|
||||
(5, 'TURN'): {'suche': 20, 'ausfall': 3, 'blueprint': 2}
|
||||
(6, 'FLOP'): {'suche': 22, 'ausfall': 1, 'blueprint': 2}
|
||||
(6, 'PREFLOP'): {'blueprint': 23, 'ausfall': 2}
|
||||
(6, 'RIVER'): {'suche': 19, 'blueprint': 4, 'ausfall': 2}
|
||||
(6, 'TURN'): {'blueprint': 4, 'suche': 19, 'ausfall': 2}
|
||||
zusammen {'blueprint': 208, 'suche': 275, 'ausfall': 17}; SHARINGAN-Anteil 96.6%
|
||||
Ausfallgruende: [["[rein-ausfall: kein Kontext (Sitze, Verlauf)", 14], ["motor preis: Verlauf passt nicht (Zug 0: Baum Strasse 0 Sitz 2, echt 0 3); Gewin", 1], ["motor preis: Verlauf passt nicht (Zug 0: Baum Strasse 0 Sitz 3, echt 0 4); Gewin", 1], ["motor preis: Verlauf passt nicht (Zug 0: Baum Strasse 0 Sitz 4, echt 0 5); Gewin", 1]]
|
||||
TURN: Median 46 ms, p95 118 ms
|
||||
PREFLOP: Median 2 ms, p95 3 ms
|
||||
FLOP: Median 80 ms, p95 302 ms
|
||||
RIVER: Median 26 ms, p95 51 ms
|
||||
Reference in New Issue
Block a user