river_spieler::lock_villain nutzt RangeRead::believed_row (eine Quelle mit der Leseschicht), Gewicht je Knoten trust(gegen Bets / Fold)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-14 21:30:17 +01:00
co-authored by Claude Opus 5.5
parent ca30bc6213
commit 3b5cee5442
2 changed files with 394 additions and 411 deletions
-6
View File
@@ -1,6 +0,0 @@
575 eindeutige Anfragen, Schalter ['SOLVER_RIVER=1', 'SOLVER_TURN=1', 'GRUNDSTRATEGIE=D:\\Projects\\pokerfreak\\.claude\\worktrees\\engine-lecks-angreifen-de7b88\\daten', 'MDF_UNREAD=0', 'TURN_SPIEL=grund']
TURN 1-Gegner: 478 Solver 427 ( 89.3 %) Zeit Solver p50 2045 p99 3781 max 4345 ms solver=427 e3=43 heuristik=8
TURN 2-Gegner: 88 Solver 0 ( 0.0 %) Zeit Solver p50 0 p99 0 max 0 ms heuristik=88
TURN 3-Gegner: 7 Solver 0 ( 0.0 %) Zeit Solver p50 0 p99 0 max 0 ms heuristik=7
TURN 4-Gegner: 2 Solver 0 ( 0.0 %) Zeit Solver p50 0 p99 0 max 0 ms heuristik=2
TURN alle Anfragen: p50 1191 p99 3753 max 4345 ms
+12 -23
View File
@@ -292,15 +292,11 @@ pub fn solver_lists(spot: &Spot, mode: RiverSpieler, read: Option<&RangeRead>) -
Some((h, v, source)) Some((h, v, source))
} }
/// Value hands bet from this strength percentile up when the believed villain is checked to /// Lock the villain's river decisions toward the read (restricted Nash response, `TrSolver::lock`):
/// (as `river_subgame`'s VALUE_RANK). /// the believed row per combo is `RangeRead::believed_row` (one source of truth with the read layer).
const BELIEVED_VALUE_RANK: f64 = 0.60; /// Facing an opening bet the weight is the fold read's trust, where it may bet the bluff read's trust;
/// facing a raise the node stays free (the read says nothing about raises). Nodes the read has no
/// Lock the villain's river decisions toward the read (restricted Nash response): facing a bet it folds /// opinion on stay pure CFR.
/// the weakest `fold_to_bet` share of its range and calls the rest (weight = the fold read's trust);
/// checked to, it bets its top `1 - BELIEVED_VALUE_RANK` at the size nearest 75 % pot plus the weakest
/// hands as bluffs so that the air share of the bet is `bluff_share` (weight = the bluff read's trust).
/// Facing a raise it stays free.
fn lock_villain(solver: &mut TrSolver, read: &RangeRead, pot: f64, board: u64, villain_weights: &[f64]) { fn lock_villain(solver: &mut TrSolver, read: &RangeRead, pot: f64, board: u64, villain_weights: &[f64]) {
let pct = percentiles(solver.masks(1), villain_weights, board); let pct = percentiles(solver.masks(1), villain_weights, board);
// The action that led into each node (a raise faced vs an opening bet faced). // The action that led into each node (a raise faced vs an opening bet faced).
@@ -323,20 +319,13 @@ fn lock_villain(solver: &mut TrSolver, read: &RangeRead, pot: f64, board: u64, v
}) })
.collect(); .collect();
for (node, acts) in nodes { for (node, acts) in nodes {
let a = acts.len(); let facing = acts.contains(&Act::Fold);
let facing_bet = acts.contains(&Act::Fold) && matches!(incoming[node], Some(Act::Bet(_))); if facing && !matches!(incoming[node], Some(Act::Bet(_))) {
if facing_bet { continue;
let Some(f) = read.fold_to_bet(2) else { continue }; }
let call = acts.iter().position(|x| *x == Act::Call).unwrap_or(1); let rows: Option<Vec<f64>> = pct.iter().map(|p| read.believed_row(2, &acts, pot, *p)).collect::<Option<Vec<Vec<f64>>>>().map(|r| r.concat());
let rows: Vec<f64> = pct.iter().flat_map(|p| (0..a).map(move |k| if *p < f { f64::from(k == 0) } else { f64::from(k == call) })).collect(); if let Some(rows) = rows {
solver.lock(node, rows, read.trust(false, 2)); solver.lock(node, rows, read.trust(!facing, 2));
} else if !acts.contains(&Act::Fold) && acts.first() == Some(&Act::Check) {
let Some((bet, to)) = acts.iter().enumerate().filter_map(|(k, x)| if let Act::Bet(t) = x { Some((k, *t)) } else { None }).min_by(|x, y| (x.1 / pot - 0.75).abs().total_cmp(&(y.1 / pot - 0.75).abs())) else { continue };
let bs = read.bluff_share(2, to / pot).clamp(0.0, 0.9);
let value = 1.0 - BELIEVED_VALUE_RANK;
let bluff = (value * bs / (1.0 - bs)).min(BELIEVED_VALUE_RANK);
let rows: Vec<f64> = pct.iter().flat_map(|p| (0..a).map(move |k| if *p >= BELIEVED_VALUE_RANK || *p < bluff { f64::from(k == bet) } else { f64::from(k == 0) })).collect();
solver.lock(node, rows, read.trust(true, 2));
} }
} }
} }