Solver-Kern gegen All-in: Equity 0,00 erklärt (ALL_IN = Raise-Stufe), ALLIN_EINSATZ, Jam-Range-Pfad; kein Kandidat besteht (aus, live bitgleich)

bis:1.3 Holdout +2412 bb n.s., Pflicht hart 177599200076; Jam-Range Dev +15004, Holdout -2857.
Pflichtfall 180802100046 neu (44). Bericht messung/solver_kern/ALLIN.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-19 16:27:16 +01:00
co-authored by Claude Opus 5.5
parent fb14d89bf4
commit 2491ecbfb2
15 changed files with 725 additions and 20 deletions
+21 -13
View File
@@ -72,24 +72,32 @@ fn level(action: SeenAction) -> Option<usize> {
}
}
/// `level` of the record at `i`. Under `ALLIN_EINSATZ=1` an ALL_IN is a raise only after an earlier
/// bet or raise on its street; opening the street it is a bet (its size is read like any bet). Off (default,
/// bit-identical): every ALL_IN is a raise. Live 19.11. (hand 180802100046): a river donk all-in of 0,29 pot
/// got the bet curve AND the river raise floor, AcKd on Ks (top pair) had equity 0,00 and folded.
fn level_in(history: &[ActionRecord], i: usize, action: SeenAction) -> Option<usize> {
if action == SeenAction::AllIn && allin_einsatz() {
/// `level` of the record at `i` (`ratio`: its chips over the pot before it). Under `ALLIN_EINSATZ` an ALL_IN
/// that opens the street (no bet or raise before it there) is a bet, read by its size like any bet: always
/// with `1`, up to `bis:<x>` pots with `bis:x` (bigger opening all-ins keep the raise floor). After an earlier
/// bet or raise it is a raise. Off (default, bit-identical): every ALL_IN is a raise. Live 19.11. (hand
/// 180802100046): a river donk all-in of 0,29 pot got the bet curve AND the river raise floor, AcKd on Ks (top
/// pair) had equity 0,00 and folded. The hhDealer data write an all-in as BET/RAISE: no offline gate saw it.
fn level_in(history: &[ActionRecord], i: usize, action: SeenAction, ratio: Option<f64>) -> Option<usize> {
if let (SeenAction::AllIn, Some(max)) = (action, allin_einsatz()) {
let street = history[i].street;
let after_aggression = history[..i].iter().any(|r| r.street == street && r.action.is_aggressive());
return Some(usize::from(after_aggression));
let opens = !history[..i].iter().any(|r| r.street == street && r.action.is_aggressive());
if opens && ratio.is_some_and(|x| x <= max) {
return Some(0);
}
}
level(action)
}
/// Messschalter `ALLIN_EINSATZ=1` (einmal gelesen), see `level_in`.
pub fn allin_einsatz() -> bool {
/// Messschalter `ALLIN_EINSATZ` (einmal gelesen), see `level_in`: `Some(max ratio)` (`1` = no limit).
pub fn allin_einsatz() -> Option<f64> {
use std::sync::OnceLock;
static AN: OnceLock<bool> = OnceLock::new();
*AN.get_or_init(|| std::env::var("ALLIN_EINSATZ").as_deref() == Ok("1"))
static AN: OnceLock<Option<f64>> = OnceLock::new();
*AN.get_or_init(|| match std::env::var("ALLIN_EINSATZ").as_deref() {
Ok("1") => Some(f64::INFINITY),
Ok(x) => x.strip_prefix("bis:").and_then(|v| v.trim().parse().ok()).filter(|v: &f64| *v > 0.0),
Err(_) => None,
})
}
/// The strongest aggression of the villain on `street`: highest level, then biggest ratio.
@@ -104,7 +112,7 @@ fn own_aggression(
.zip(ratios)
.enumerate()
.filter(|(_, (r, _))| r.street == street && r.seat == seat)
.filter_map(|(i, (r, ratio))| level_in(history, i, r.action).map(|l| (l, *ratio)))
.filter_map(|(i, (r, ratio))| level_in(history, i, r.action, *ratio).map(|l| (l, *ratio)))
.max_by(|a, b| {
a.0.cmp(&b.0).then(
a.1.unwrap_or(-1.0)