Merge branch 'main' into claude/objective-pascal-ede964

This commit is contained in:
2026-11-20 23:10:54 +01:00
39 changed files with 3407 additions and 67 deletions
+38 -6
View File
@@ -26,14 +26,42 @@ const DRAWS: [bool; 3] = [true, true, false];
/// (`t * a / 0.30`, clamped to `[0.5 t, 2 t]`; no read: `t`). Live 17.11. KK on Ad7hAh7sJc called a
/// passive player's 1.5-pot river bet at "equity 0.66": the made-class floor kept 88-TT (18 of 28
/// combos) as value. Leak finder family A (calls against all-ins). Unset: off, bit-identical.
fn gegen_gross() -> Option<(f64, bool)> {
///
/// Zusaetze (20.11., Stack-off-Messung `messung/stackoff/`): `river` narrows only on the river (flop/turn
/// all-ins keep their range: there calling a jam with an overpair is +EV in the NL2 population), `ab:<r>` sets
/// the river bet size from which a bet narrows (default `GROSS_RATIO`); with `river` only the size counts, a
/// river all-in below it keeps its range; `allin` narrows only a bet that is all-in for one side (hhDealer holdout
/// 20.11.: a non-all-in river bet of 0,75 pot or more is called profitably by one pair, narrowing it cost -7 582 bb). Without them: unchanged.
#[derive(Clone, Copy)]
struct GegenGross {
t: f64,
akt: bool,
nur_river: bool,
nur_allin: bool,
ab: f64,
}
fn gegen_gross() -> Option<GegenGross> {
use std::sync::OnceLock;
static G: OnceLock<Option<(f64, bool)>> = OnceLock::new();
static G: OnceLock<Option<GegenGross>> = OnceLock::new();
*G.get_or_init(|| {
let v = std::env::var("GEGEN_GROSS").ok()?;
let mut parts = v.split(',');
let t = parts.next()?.trim().parse::<f64>().ok().filter(|t| t.is_finite() && *t > 0.0 && *t < 1.0)?;
Some((t, parts.any(|p| p.trim() == "akt")))
let mut g = GegenGross { t, akt: false, nur_river: false, nur_allin: false, ab: GROSS_RATIO };
for p in parts.map(str::trim) {
match p {
"akt" => g.akt = true,
"river" => g.nur_river = true,
"allin" => g.nur_allin = true,
p => {
if let Some(r) = p.strip_prefix("ab:").and_then(|r| r.parse::<f64>().ok()).filter(|r| r.is_finite() && *r > 0.0) {
g.ab = r;
}
}
}
}
Some(g)
})
}
@@ -50,13 +78,17 @@ const GROSS_POOL_AGGRESSION: f64 = 0.30;
/// The value share of `GEGEN_GROSS` for the villain's aggression on the current `street`, or `None`
/// when the switch is off or the bet is neither all-in for hero nor a big river bet.
fn gegen_gross_share(spot: &Spot, villain: &Villain, ratios: &[Option<f64>], street: Street) -> Option<f64> {
let (t, akt) = gegen_gross()?;
let GegenGross { t, akt, nur_river, nur_allin, ab } = gegen_gross()?;
if nur_river && street != Street::River {
return None;
}
let (_, ratio) = own_aggression(&spot.history, ratios, street, villain.seat)?;
let last_is_villain = spot.history.iter().rev().find(|r| r.street == street && r.action.is_aggressive()).is_some_and(|r| r.seat == villain.seat);
let hero_all_in = last_is_villain && spot.to_call > 0.0 && spot.to_call >= spot.hero_stack - 1e-9;
let villain_all_in = spot.history.iter().any(|r| r.street == street && r.seat == villain.seat && r.action == SeenAction::AllIn);
let big_river = street == Street::River && ratio.is_some_and(|r| r >= GROSS_RATIO);
if !(hero_all_in || villain_all_in || big_river) {
let big_river = street == Street::River && ratio.is_some_and(|r| r >= ab);
// `river`: only the size counts (a small river jam keeps its range: one pair calls it profitably).
if !(big_river || (!nur_river && (hero_all_in || villain_all_in))) || (nur_allin && !(hero_all_in || villain_all_in)) {
return None;
}
let a = villain.profile.as_ref().and_then(|p| p.aggression).filter(|a| a.is_finite() && akt);