Files
pokerfreak/src/exploit/profile.rs
T
mmintelandClaude Opus 5.5 0deb2e10de 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>
2026-11-13 21:27:08 +01:00

88 lines
5.4 KiB
Rust

/// Observed opponent tendencies, all frequencies in `[0, 1]`. Every field optional.
/// Wire shape (extension):
/// `"profile": {"vpip": 0.45, "pfr": 0.08, "foldToBet": 0.3, "aggression": 0.4}`.
///
/// The fields below `aggression` are the HUD numbers the client already delivers but the core did
/// not read before (`lesen/profil.py` DURCHGEREICHT). They carry their client names on the wire
/// (`src/wire/decode_villain.rs`) and reach the engine per villain. No exploit rule reads them yet:
/// every new read must first earn its place on the ladder benchmark (`read_gate`), which no
/// candidate has so far. They stand ready for the opponent memory and future, ladder-proven rules.
#[derive(Clone, Copy, Debug, PartialEq, Default)]
pub struct Profile {
/// Voluntarily put money in pot, preflop.
pub vpip: Option<f64>,
/// Preflop raise frequency.
pub pfr: Option<f64>,
/// How often the player folds to a bet postflop.
pub fold_to_bet: Option<f64>,
/// Share of the player's postflop actions that are bets or raises (aggression
/// frequency). Steers how much of their betting range is a bluff (`bluff_share`).
pub aggression: Option<f64>,
/// Aggression frequency on the TURN only (bets+raises over the player's turn actions). `None`
/// until the memory/HUD has turn data. The turn gearbox (`engine::turn_subgame`) prefers it over
/// the pooled `aggression`: a player who barrels turns but checks flops reads as a turn bluffer
/// here, so the defensive veto does not fold a good call against them.
pub turn_aggression: Option<f64>,
/// Aggression frequency on the RIVER only. `None` until the memory/HUD has river data. The river
/// gearbox (`engine::river_subgame`) prefers it over the pooled `aggression`, since river bluffing
/// tendency differs from flop/turn barreling.
pub river_aggression: Option<f64>,
/// Fold-to-bet split by street `[flop, turn, river]`, already shrunk toward the pooled
/// `fold_to_bet` by the street's own sample size (`sim::memory`), so a thin street stays at the
/// pooled read and a well-sampled one moves to its own rate. `None` per street = no data. Read
/// only by `fold_chance::fold_chance_on` (hero's fold equity on that street).
pub street_fold_to_bet: [Option<f64>; 3],
/// How often the player continuation-bets the flop as the preflop aggressor.
pub cbet: Option<f64>,
/// How often the player folds to a continuation bet.
pub fold_to_cbet: Option<f64>,
/// Preflop three-bet frequency.
pub three_bet: Option<f64>,
/// How often the player folds to a three-bet.
pub fold_to_three_bet: Option<f64>,
/// How often the player attempts to steal the blinds from late position.
pub steal: Option<f64>,
/// How often the player check-raises.
pub check_raise: Option<f64>,
/// Went to showdown: how often the player reaches showdown once seeing the flop. A high
/// value marks a sticky, showdown-happy opponent.
pub wtsd: Option<f64>,
/// Won at showdown: how often the player wins once at showdown.
pub wsd: Option<f64>,
/// Confidence in this read, in `[0, 1)`: 0 without data, rising with the observed postflop
/// sample (half at `sim::memory::CONFIDENCE_HALF` actions). Not a tendency — it says how far the
/// read may be trusted. The river gearbox (`engine::river_subgame`) turns it into the KL trust
/// 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,
}
}
}