Files
pokerfreak/src/exploit/bluff_share.rs
T
mmintelandClaude Opus 4.8 b0aee07076 Replay-Harness, Wurzel-Fix am Equity-Bias, MDF-River-Boden und Stage-0-Blind-Messlatte
Replay-Harness (entscheiden/replay.py, eval7.py, tests/replay_spec.py): rekonstruiert Hero-
Entscheidungen aus echten Hand-Histories, misst Fold-to-bet, den Equity-Bias gegen einen
unabhaengigen Evaluator und den belegten EV-Verlust (Overfold/Overcall). benchmarks/replay_*.txt
frieren Vorher/Nachher ein.

Wurzel am Equity-Bias (exploit/bluff_share.rs, street_continuation.rs): der Micro-Pool barrelt
ueber GTO-Balance, also bekommt eine UNGELESENE Range (profile None, auch blind gegatet) auf dem
ERSTEN Barrel einen Populations-Ueber-Bluff-Prior (with_pop_prior, barrel-bewusst - ein Sustained-
Barrel bleibt value-gewichtet). bluff_share bleibt rein. Overfold im Replay 40.6 -> 7.5 bb,
Bias -0.221 -> -0.186.

MDF-River-Boden (exploit/mdf_floor.rs, engine/decide.rs): ein River-Fold einer verteidigbaren
Made-Hand gegen eine Range, die bluffen kann, wird zum Call (MDF/Break-even), ausser jeder lebende
Gegner ist ein belegter Under-Bluffer. Laeuft auf dem UNGEGATETEN Spot, Kern-EV unangetastet.

Stage 0 - Blind-Messlatte (sim/session.rs, table.rs, benchmark.rs, tests/sim_blind.rs): ein neues
blind-Feld haelt den HUD-Read zurueck; zwei Blind-Szenarien (Fisch, Calling Station) beziffern den
Sitzungsertrag eines Reads (Fisch +53.8, Station +26.3 bb/100). Die 10 alten Szenarien bleiben Bit
fuer Bit gleich; baseline.txt neu mit 12 Szenarien. Kein Rueckschritt auf der Messlatte.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-10 13:56:45 +01:00

68 lines
3.0 KiB
Rust

//! What part of an opponent's betting range is a bluff.
//!
//! | step | rule |
//! |---|---|
//! | base | `s / (1 + 2s)` for a bet of `s` pots: the river share at which a caller is indifferent (Chen/Ankenman, "The Mathematics of Poker"); unknown or broken size counts as 0.66 |
//! | street | river 1.0, turn 0.6, flop 0.5 (earlier, draws do the bluffing and already stay in the range), preflop 0 |
//! | style | nit 0.4, calling station 0.5 (passive players bet for value), loose-aggressive 1.5, otherwise 1.0 |
//! | aggression | when the profile gives it, `aggression / 0.45` (0.45 = an average aggression frequency) replaces the style factor, clamped to [0, 2] |
//! | cap | at most 0.6 |
use super::profile::Profile;
use super::style::{classify, Style};
use crate::game::Street;
pub const NEUTRAL_RATIO: f64 = 0.66;
pub const MAX_BLUFF_SHARE: f64 = 0.6;
const AVERAGE_AGGRESSION: f64 = 0.45;
const MAX_FACTOR: f64 = 2.0;
/// Populations-Ueber-Bluff-Prior gegen einen UNGELESENEN Gegner: der Micro-Pool c-bettet/barrelt
/// weit ueber GTO-Balance, also bekommt eine unbekannte (auch auf blind gegatete) Range auf
/// Flop/Turn mindestens diesen Bluff-Anteil. River bleibt dem MDF-Boden ueberlassen.
/// Micro-Prior; spaeter stake-skaliert.
const POP_BLUFF_PRIOR: [f64; 4] = [0.0, 0.40, 0.35, 0.0]; // preflop, flop, turn, river
fn street_factor(street: Street) -> f64 {
match street {
Street::Preflop => 0.0,
Street::Flop => 0.5,
Street::Turn => 0.6,
Street::River => 1.0,
}
}
fn style_factor(profile: Option<&Profile>) -> f64 {
let Some(p) = profile else { return 1.0 };
match p.aggression.filter(|a| !a.is_nan()) {
Some(a) => (a.clamp(0.0, 1.0) / AVERAGE_AGGRESSION).clamp(0.0, MAX_FACTOR),
None => match classify(p) {
Style::Nit => 0.4,
Style::CallingStation => 0.5,
Style::LooseAggressive => 1.5,
Style::Regular | Style::Unknown => 1.0,
},
}
}
/// Bluff share of the range that bet `ratio` pots on `street`. Always in `[0, MAX_BLUFF_SHARE]`.
pub fn bluff_share(profile: Option<&Profile>, ratio: Option<f64>, street: Street) -> f64 {
let s = ratio.filter(|r| r.is_finite() && *r > 0.0).unwrap_or(NEUTRAL_RATIO);
let balanced = s / (1.0 + 2.0 * s);
(balanced * street_factor(street) * style_factor(profile)).clamp(0.0, MAX_BLUFF_SHARE)
}
/// Lift the population over-bluff prior onto a base bluff share. It applies ONLY to an UNREAD
/// villain (`profile` None - including a read gated to blind) on a FIRST barrel: a sustained
/// multi-street line (`sustained`, the villain already bet/raised an earlier street) is
/// value-weighted even in the micro pool, so it gets no bump. River and preflop carry no prior
/// (the river is the MDF floor's job). Never exceeds `MAX_BLUFF_SHARE`.
pub fn with_pop_prior(profile: Option<&Profile>, street: Street, sustained: bool, base: f64) -> f64 {
let prior = if profile.is_none() && !sustained {
POP_BLUFF_PRIOR[street as usize]
} else {
0.0
};
base.max(prior).min(MAX_BLUFF_SHARE)
}