Files
pokerfreak/src/bin/exploit_scan.rs
T
mmintelandClaude Opus 4.8 1492fb6a38 Synthetik-Labor: Population, Zwillings-Tor, adaptive Liga, Optimizer, Sim-to-Real
Ersetzt die irrefuehrende Oracle-Leiter durch eine ehrliche Messmethodik
(Oracle aus, Read via Memory/Posterior gegen eine gezogene Gegner-Population).

Stufen:
- 0 Exploitation-Luecke: +18.98 bb/100 gegen die gezogene Population
- 1 Kalibrierung an echte HUD-Daten (lesen/kalibrierung.py)
- 2 Zwillings-Tor (EGTA + Exploitability-Waechter): Offense +43.95,
  Boden gto -36.25 (verliert gegen Balancierte - die Oracle-verdeckte Wurzel)
- 3 Adaptive Liga L0-L3 (reaktiv / modellierend / Liga)
- 4 Sim-to-Real: HUD-Gap (sim::simreal) + Outcome-Abgleich (lesen/liveabgleich.py):
  real -266.75 vs Sim +43.95 => Gap -311; A/B-Pipeline + Runbook fertig,
  nur der geldechte Live-Lauf unter beiden Armen bleibt offen
- 5 Optimizer (Diagonal-CMA-ES, parallel): Nemesis -414.81 bb/100

Befunde und Architektur in docs/notizen/. Lab-Tests gruen
(Rust lib 92/0, python liveabgleich/kalibrierung/gegnersignal gruen).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-11 09:57:32 +01:00

86 lines
3.0 KiB
Rust

//! 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<Card> {
(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<Vec<Card>> {
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>, 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");
}
}