Gegnermodell: MDF-Fix, Strassen- und Linien-Reads, leichter 3-Bet, Leiter-Infrastruktur

Bewiesen auf der gepaarten Leiter (19 Gegner, 95 %-CI, kein Profil verliert):
- MDF-Floor/Veto-Fix: in der Sim bit-identisch, echte Haende Overfold 36 -> 7.5 bb.
- Aggressions-Vertrauen, Strassen-Reads (Turn/River-Aggression, Fold-auf-Bet je Strasse,
  Bayes-geschrumpft zum Gesamt-Read), Zug-Logging der Gegnerprofile, Replay mit geloggten Profilen.
- Leichter 3-Bet gegen 3-Bet-Folder (EV-Break-even risk/(pot+risk)): +6.62 +-5.23 bb/100
  gegen den 3-Bet-Folder, sonst unveraendert.
- Fold-auf-C-Bet preist die C-Bet: neutral.
- Welt-Archetypen cbet-folder, 3bet-folder, check-raiser; ab_zelle (Zellen-Leiter, fortsetzbar),
  Warteschlange mit Thread-Budget, ab.py.

Nicht drin: der Check-Raise-Abschlag (drei Varianten, keine sauber; wird durch ein
Spielbaum-Modell ersetzt), der River-Showdown-Read bleibt aus (Verlierer -1.31).
Ergebnisse: messung_engine/ERGEBNISSE.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-13 21:27:08 +01:00
co-authored by Claude Opus 5.5
parent c03530a1c4
commit 0deb2e10de
34 changed files with 1497 additions and 26 deletions
+17 -1
View File
@@ -75,9 +75,25 @@ pub fn fold_chance(profile: Option<&Profile>, ratio: f64, facing_raise: bool) ->
fold_chance_on(profile, ratio, facing_raise, None)
}
/// Fold base against hero's continuation bet: the opponent's fold-to-c-bet read when it carries one
/// (a calling station's is trust-damped like its pooled read), else the flop read (`fold_base_on`).
/// A c-bet folder gives up the flop far more often than its pooled fold-to-bet says, and a sticky
/// flop caller far less.
pub fn fold_base_cbet(profile: Option<&Profile>) -> f64 {
match profile.and_then(|p| p.fold_to_cbet.filter(|f| !f.is_nan()).map(|f| (p, f.clamp(0.0, 1.0)))) {
Some((p, f)) if classify(p) == Style::CallingStation => DEFAULT_FOLD_TO_BET + station_trust(p) * (f - DEFAULT_FOLD_TO_BET),
Some((_, f)) => f,
None => fold_base_on(profile, Some(Street::Flop)),
}
}
/// `fold_chance` with the street's own fold read (`fold_base_on`).
pub fn fold_chance_on(profile: Option<&Profile>, ratio: f64, facing_raise: bool, street: Option<Street>) -> f64 {
let f = fold_base_on(profile, street);
sized_fold(fold_base_on(profile, street), ratio, facing_raise)
}
/// P(fold) to a bet of `ratio` pots from a fold base `f` (the reference-size fold rate).
pub fn sized_fold(f: f64, ratio: f64, facing_raise: bool) -> f64 {
let ratio = if ratio.is_nan() { 0.0 } else { ratio.max(0.0) };
let sized = if f >= 1.0 {
if ratio > 0.0 { 1.0 } else { 0.0 }
+6
View File
@@ -25,6 +25,9 @@ const WEAK_PLAYER: Profile = Profile {
wtsd: None,
wsd: None,
confidence: None,
aggression_confidence: None,
river_bluff_share: None,
river_bluff_shown: None,
};
fn prior(mark: &str) -> Option<Profile> {
@@ -54,5 +57,8 @@ pub fn with_mark(measured: Option<Profile>, mark: &str) -> Option<Profile> {
wtsd: known.wtsd.or(prior.wtsd),
wsd: known.wsd.or(prior.wsd),
confidence: known.confidence.or(prior.confidence),
aggression_confidence: known.aggression_confidence,
river_bluff_share: known.river_bluff_share,
river_bluff_shown: known.river_bluff_shown,
})
}
+30 -1
View File
@@ -81,9 +81,23 @@ fn over_bluffs(profile: &Profile) -> bool {
fn range_may_bluff(spot: &Spot) -> bool {
let mut live = spot.villains.iter().filter(|v| !v.folded).peekable();
live.peek().is_none()
|| live.any(|v| v.profile.as_ref().is_none_or(over_bluffs))
|| live.any(|v| v.profile.as_ref().is_none_or(|p| bluff_unread(p) || over_bluffs(p)))
}
/// A profile WITHOUT a postflop aggression read says nothing about bluffing (a live HUD often carries
/// only vpip/pfr): it is unread on the axis the floor needs, so it is defended exactly like an unread
/// villain. Only a measured aggression below the over-bluff line counts as evidence of a value-weighted
/// range. (Replay 10.11., hand 174898200346: vpip-only read, river top pair folded to a pair of tens,
/// 28.5 bb, because a missing aggression was read as "proven balanced".)
fn bluff_unread(profile: &Profile) -> bool {
profile.aggression.is_none_or(f64::is_nan)
|| profile.aggression_confidence.is_some_and(|c| c.is_nan() || c < AGGRESSION_READ_MIN)
}
/// An aggression read thinner than this (live: about 10 seen postflop moves at the 30-move half-life)
/// is no evidence either way: the same floor the river gearbox needs before it trusts a read.
const AGGRESSION_READ_MIN: f64 = 0.25;
/// True when hero must defend `made` against the bet he faces (never fold): on the river, with
/// a bluff-catcher or better, whose strength puts it in the top `1 - alpha` of the range, and the
/// bettor is not a confirmed under-bluffer.
@@ -197,6 +211,21 @@ mod tests {
assert!(defends(&spot, Made::MiddlePair));
}
#[test]
fn a_profile_without_an_aggression_read_is_defended_like_an_unread_one() {
// Live HUD with vpip only (replay 10.11., hand 174898200346): no bluff evidence either way,
// so the floor holds exactly as for an unread villain.
let vpip_only = Profile { vpip: Some(0.6), ..Profile::default() };
let spot = Spot { villains: vec![villain(Some(vpip_only))], ..river(12.0, 6.0) };
assert!(defends(&spot, Made::MiddlePair));
let thin = Profile { aggression: Some(0.0), aggression_confidence: Some(2.0 / 32.0), ..Profile::default() };
let spot = Spot { villains: vec![villain(Some(thin))], ..river(12.0, 6.0) };
assert!(defends(&spot, Made::MiddlePair), "two seen moves are no under-bluff evidence");
let nan = Profile { aggression: Some(f64::NAN), ..Profile::default() };
let spot = Spot { villains: vec![villain(Some(nan))], ..river(12.0, 6.0) };
assert!(defends(&spot, Made::MiddlePair));
}
#[test]
fn a_balanced_regular_is_not_floored() {
// The near-GTO opponent (reads.rs oracle p(0.32, 0.22, 0.42, 0.40)): moderate aggression 0.40
+29
View File
@@ -55,4 +55,33 @@ pub struct Profile {
/// radius λ: strong read → exploit far, weak read → stay near GTO. `None` = no confidence signal
/// (treated as 0 by the gearbox). No classify/gate rule reads it; it only scales exploitation.
pub confidence: Option<f64>,
/// Confidence of the AGGRESSION read alone, in `[0, 1)`. Live the client HUD has no aggression:
/// it comes from the few postflop moves this session saw (`lesen/profil.py`), while `confidence`
/// comes from the HUD hand count, so the two can disagree by orders of magnitude (500 HUD hands,
/// 2 seen moves). `None` = the aggression read is as good as `confidence` (the session memory,
/// where both come from the same postflop sample). Read through `bluff_read_confidence`.
pub aggression_confidence: Option<f64>,
/// River showdown read: of the player's river bets/raises that were SHOWN DOWN, the share that was
/// air (equity below `AIR_STRENGTH` vs a random hand on the final board). Unbiased evidence of the
/// river betting range: whether hero calls depends on hero's cards, not the bettor's. The river
/// gearbox blends it into its bluff belief by `river_bluff_shown` (`engine::river_subgame`).
pub river_bluff_share: Option<f64>,
/// How many river bets/raises `river_bluff_share` rests on.
pub river_bluff_shown: Option<f64>,
}
/// Equity vs a random hand on the river below which a shown river bet counts as air (a bluff): the
/// lower two strength bands (`sim::welt_memory::STRENGTH_BANDS`).
pub const AIR_STRENGTH: f64 = 0.4;
impl Profile {
/// How far a read about this player's BLUFFING may be trusted: the weaker of the overall read
/// and the aggression read. `None` = no confidence signal (the gearbox treats it as 0).
pub fn bluff_read_confidence(&self) -> Option<f64> {
let ok = |x: Option<f64>| x.filter(|c| !c.is_nan());
match (ok(self.confidence), ok(self.aggression_confidence)) {
(Some(c), Some(a)) => Some(c.min(a)),
(c, _) => c,
}
}
}
+44
View File
@@ -36,8 +36,16 @@ pub const PRIOR: Profile = Profile {
wtsd: None,
wsd: None,
confidence: None,
aggression_confidence: None,
river_bluff_share: None,
river_bluff_shown: None,
};
/// Postflop moves at which an aggression read and the population weigh the same — the session
/// memory's half-life (`sim::memory::CONFIDENCE_HALF`), so a live read earns trust as fast as a
/// simulated one.
pub const AGGRESSION_HALF: f64 = 30.0;
/// Weight of the sample in `[0, 1)`.
pub fn trust(hands: f64) -> f64 {
if hands.is_nan() || hands <= 0.0 {
@@ -76,5 +84,41 @@ pub fn shrink(profile: &Profile, hands: f64) -> Profile {
// count earns the gearbox's trust exactly as a session-memory read does. Keep an explicit
// confidence if one was already set.
confidence: profile.confidence.or(Some(w)),
aggression_confidence: profile.aggression_confidence,
river_bluff_share: profile.river_bluff_share,
river_bluff_shown: profile.river_bluff_shown,
}
}
/// The aggression read on its OWN sample: `raw` was measured over `actions` postflop moves (not over
/// the HUD's hands), so it is shrunk toward the population with that weight and carries it as
/// `aggression_confidence`. No usable count: the profile is returned unchanged.
pub fn shrink_aggression(profile: Profile, raw: Option<f64>, actions: f64) -> Profile {
if actions.is_nan() || actions < 0.0 {
return profile;
}
let w = actions / (actions + AGGRESSION_HALF);
Profile { aggression: pull(raw, PRIOR.aggression, w), aggression_confidence: Some(w), ..profile }
}
/// Anchors of the line reads that have no pooled read to shrink toward (a regular's HUD): fold to
/// 3-bet and check-raise. Shared by the sim memory and the wire.
pub const FOLD_TO_THREE_BET_ANCHOR: f64 = 0.55;
pub const CHECK_RAISE_ANCHOR: f64 = 0.08;
/// Street samples at which one street's own read and the pooled read weigh the same — the session
/// memory's `sim::memory::STREET_FOLD_PRIOR`, so a live street read earns trust as a simulated one.
pub const STREET_PRIOR: f64 = 15.0;
/// One street's read (`raw`, measured over `n` moves on that street) pulled toward the `pooled` read of
/// all streets: `(raw·n + STREET_PRIOR·pooled) / (n + STREET_PRIOR)`. A few river moves barely move
/// the river belief off the pooled one. No street sample, a broken count or no pooled read to anchor
/// on: `None`, so the engine falls back to the pooled read (never a raw 0/1 from one move).
pub fn shrink_street(raw: Option<f64>, n: f64, pooled: Option<f64>) -> Option<f64> {
let raw = raw.filter(|x| !x.is_nan())?;
let pooled = pooled.filter(|x| !x.is_nan())?;
if n.is_nan() || n <= 0.0 {
return None;
}
Some((raw * n + STREET_PRIOR * pooled) / (n + STREET_PRIOR))
}
+14 -4
View File
@@ -1,5 +1,5 @@
use super::fold_chance::{fold_chance_on, MAX_FOLD};
use crate::game::Spot;
use super::fold_chance::{fold_base_cbet, fold_chance_on, sized_fold, MAX_FOLD};
use crate::game::{line, Spot};
/// Pressure of a raise to `to`: the chips beyond a call, `to - to_call`, over the pot
/// after calling, `pot + to_call`. A plain bet (`to_call = 0`) is `to / pot`.
@@ -21,6 +21,16 @@ pub fn table_fold(spot: &Spot, to: f64, scale: f64) -> f64 {
if live.peek().is_none() {
return 0.0;
}
live.map(|v| (fold_chance_on(v.profile.as_ref(), ratio, facing_raise, Some(spot.street)) * scale).clamp(0.0, MAX_FOLD))
.product()
// Hero's continuation bet is priced by the fold-to-c-bet read (`fold_base_cbet`).
let cbet = line::cbet_spot(&spot.history, spot.hero_seat, spot.street);
live.map(|v| {
let p = v.profile.as_ref();
let f = if cbet {
sized_fold(fold_base_cbet(p), ratio, facing_raise)
} else {
fold_chance_on(p, ratio, facing_raise, Some(spot.street))
};
(f * scale).clamp(0.0, MAX_FOLD)
})
.product()
}