//! Scan the LIVE engine's heads-up river exploitability across board textures. //! //! The first postflop-exploitability number for this engine (the measure MODULES.md names as missing). //! For each board, hero and villain hold the FULL remaining range (every unblocked two-card combo); //! the harness (`sim::exploit_river`) buckets them by exact showdown strength, solves the river //! subgame for the equilibrium value, plays the engine's real policy as hero, and lets the villain //! best-respond. Exploitability = v* - value(engine | villain best-responds), in bb/100, always >= 0. //! //! Run: `cargo run --release --bin exploit_scan`. Pot and bet default to 6 and 4 bb (two-thirds pot). use rechner::card::Card; use rechner::exploit::profile::Profile; use rechner::sim::exploit_river::{exploitability_river, RiverSpec}; const ITERS: u32 = 60_000; const SEED: u64 = 0x5EED_0001; const POT: f64 = 6.0; const BET: f64 = 4.0; /// The 52-card deck minus the board. fn remaining(board: &[Card]) -> Vec { (0..52) .filter_map(Card::from_index) .filter(|c| !board.contains(c)) .collect() } /// Every two-card combo from a card list. fn combos(cards: &[Card]) -> Vec> { let mut out = Vec::new(); for i in 0..cards.len() { for j in (i + 1)..cards.len() { out.push(vec![cards[i], cards[j]]); } } out } fn scan(label: &str, board_text: &str, profile: Option, profile_label: &str) { let board = Card::parse_list(board_text).expect("valid board"); let deck = remaining(&board); let range = combos(&deck); let spec = RiverSpec { board: &board, hero_range: &range, villain_range: &range, villain_profile: profile, pot: POT, bet: BET, }; match exploitability_river(&spec, ITERS, SEED) { Some(r) => println!( "{label:<22} {board_text:<17} {profile_label:<8} buckets {:>3} v* {:>8.1} engine {:>8.1} exploitability {:>7.1} bb/100", r.buckets, r.gto_value, r.engine_value_vs_br, r.exploitability ), None => println!("{label:<22} {board_text:<17} degenerate subgame"), } } fn main() { // A representative near-GTO villain belief (reads.rs gto), and the unread default. let gto = Profile { vpip: Some(0.32), pfr: Some(0.22), fold_to_bet: Some(0.42), aggression: Some(0.40), ..Profile::default() }; println!("heads-up river exploitability, pot {POT} bet {BET} (two-thirds), {ITERS} solver iters\n"); let boards = [ ("dry ace-high", "Ah Kd 7c 2s 9h"), ("paired board", "Kh Kd 7c 2s 9h"), ("wet connected", "9h 8h 7c 6s 2h"), ("monotone", "Ah Jh 8h 3h 2c"), ("low dry", "7c 4d 2s 9h Js"), ("broadway", "Ah Ks Qd Jc 2h"), ]; for (label, board) in boards { scan(label, board, None, "unread"); } println!(); for (label, board) in boards { scan(label, board, Some(gto), "gto"); } }