From 36816c9309f7d02ee20067f6e33dc490db93e0b4 Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Sun, 8 Nov 2026 19:01:19 +0100 Subject: [PATCH] ICM-Verteidigung auf Nash kalibriert + Open-Jam entkoppelt (letzte 10%) Defense: die Call-Verengung lag ~10pp zu locker (24/27/33% statt ICM-Nash 14/18/22), weil width_factor linear (1-4p) mit 0.5-Boden den harten Bubble nicht unter die halbe Chip-Range verengen konnte. Jetzt konkav: 1 - 1.89*sqrt(premium), stetig bei p=0, beisst frueh, saettigt am Boden. Engine-Defense 13/18/22 - deckt ICM-Nash, nie LOCKERER (der sichere Fehler). Entkopplung: call_premium greift nur noch bei einem echten Aggressor in der Historie (Verteidigung). First-in (Open/Jam) traegt die ICM ueber jam_pressure (Weitung), nicht ueber ein verengendes Call-Premium - sonst bluteten Defense-Kalibrierung und Open-Jam ineinander (die staerkere sqrt-Verengung drueckte den Jam unter den ICM-Nash-Push). Jam bleibt so weltklasse: 99/77/68 vs ICM-Nash 97/79/65. Benchmark misst CALL-Spots + Defense jetzt mit History (sonst priced kein Premium). Cash unberuehrt (nur mit Turnierlage aktiv). Mutationstest auf DEFEND_NARROW scharf. --- entscheiden/turnier_benchmark.py | 8 ++++++-- src/icm/risk.rs | 30 +++++++++++++++++++++++++----- tests/icm_bubble.rs | 27 +++++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 7 deletions(-) diff --git a/entscheiden/turnier_benchmark.py b/entscheiden/turnier_benchmark.py index 9b18ee5a..b0c91b52 100644 --- a/entscheiden/turnier_benchmark.py +++ b/entscheiden/turnier_benchmark.py @@ -41,13 +41,17 @@ def _karten(h): def _call_spot(h, stack, lage=None): - """Hero in der BB, ein Villain (deckt Hero) ist All-in; Hero callt oder foldet.""" + """Hero in der BB, ein Villain (deckt Hero) ist All-in; Hero callt oder foldet. MIT History + (der All-in des Villains): ohne einen Aggressor priced die ICM kein Call-Premium (hero gilt als + first-in) - die Verengung an der Bubble bliebe sonst ungemessen.""" r = {"variant": "NLHE", "bigBlind": 1.0, "seats": 3, "heroSeat": 1, "heroCards": _karten(h), "board": {}, "street": "PREFLOP", "pot": stack + 1.5, "toCall": stack - 1.0, "heroStack": stack, "legalActions": ["FOLD", "CALL"], "allowedSizes": [], "villains": [{"seat": 2, "stack": stack + 5.0, "folded": False}, - {"seat": 3, "stack": 4.0, "folded": True}]} + {"seat": 3, "stack": 4.0, "folded": True}], + "history": [{"street": "PREFLOP", "seat": 1, "action": "POST_BB", "amount": 1.0}, + {"street": "PREFLOP", "seat": 2, "action": "ALL_IN", "amount": stack + 5.0}]} if lage: r["tournament"] = lage return json.dumps(r) diff --git a/src/icm/risk.rs b/src/icm/risk.rs index 7420319c..f46d84e7 100644 --- a/src/icm/risk.rs +++ b/src/icm/risk.rs @@ -6,9 +6,15 @@ use crate::game::Spot; /// Largest premium ever applied (equity share). pub const MAX_PREMIUM: f64 = 0.25; -/// Narrowing of the preflop width per point of premium (`1 - 4 p`, floor `MIN_WIDTH`). -pub const WIDTH_PER_PREMIUM: f64 = 4.0; -pub const MIN_WIDTH: f64 = 0.5; +/// Narrowing of the preflop defence width for a premium: `1 - DEFEND_NARROW * sqrt(premium)`, +/// floor `MIN_WIDTH`. The square root is CONCAVE - ICM bites hard already at a modest premium and +/// then saturates - because the old linear `1 - 4p` with a 0.5 floor could not narrow the call +/// below half the chip range (hard bubble stuck at ~24 % where ICM-Nash wants ~14 %), while a steeper +/// linear over-tightened the soft bubble. `DEFEND_NARROW` is calibrated at +/// `entscheiden/turnier_benchmark.icm_defense_score` so the engine's BB-call % tracks the ICM-Nash +/// defence across hard/medium/soft bubbles (within ~2pp) without ever defending LOOSER than it. +pub const DEFEND_NARROW: f64 = 1.89; +pub const MIN_WIDTH: f64 = 0.2; /// Equity needed to call in money terms. `hero`/`opp` are the chips behind (the pot is /// separate), `risk` what the call puts in, `gain` what is won (the pot). Folding hands the @@ -52,6 +58,18 @@ pub fn call_premium(spot: &Spot, lage: &Turnierlage) -> Option { if spot.to_call <= 0.0 { return Some(0.0); } + // Only DEFENCE (hero faces a real bet/raise/all-in) carries a call premium. Without an + // aggressor in the history hero is first in (open, limp, open-jam) - there the ICM is the + // open-jam WIDENING (`jam_pressure`), not a narrowing call premium. Pricing a premium there + // too narrowed the open-jam and coupled the defence and jam calibrations (8.11.: the defence + // sqrt-narrowing bled into the jam %, dropping it below the ICM-Nash push). + let faces_bet = spot + .history + .iter() + .any(|r| r.action.is_aggressive() && spot.live_villains().any(|v| v.seat == r.seat)); + if !faces_bet { + return Some(0.0); + } // What hero already put in this hand (blind, ante): the field lists chips at hand start. let committed = (lage.stacks[lage.hero] - spot.hero_stack).max(0.0); let matched = committed + spot.to_call; @@ -68,9 +86,11 @@ pub fn call_premium(spot: &Spot, lage: &Turnierlage) -> Option { Some((needed - chips_be).clamp(0.0, MAX_PREMIUM)) } -/// Factor on the preflop range width for a premium. +/// Factor on the preflop range width for a premium (defence): `1 - DEFEND_NARROW * sqrt(premium)`, +/// clamped to `[MIN_WIDTH, 1.0]`. Concave: a tiny premium narrows little (continuous at `p = 0`, +/// factor 1.0), a real bubble premium narrows hard toward the floor. pub fn width_factor(premium: f64) -> f64 { - (1.0 - WIDTH_PER_PREMIUM * premium).clamp(MIN_WIDTH, 1.0) + (1.0 - DEFEND_NARROW * premium.max(0.0).sqrt()).clamp(MIN_WIDTH, 1.0) } /// Shape of the open-jam widening. `JAM_CONVEXITY` (cubic) models that ICM pressure ACCELERATES as diff --git a/tests/icm_bubble.rs b/tests/icm_bubble.rs index 5399cb4b..03197c8a 100644 --- a/tests/icm_bubble.rs +++ b/tests/icm_bubble.rs @@ -162,3 +162,30 @@ fn no_bet_to_face_costs_no_premium() { spot.to_call = 0.0; assert_eq!(call_premium(&spot, &bubble(12.0)), Some(0.0)); } + +#[test] +fn only_facing_an_aggressor_costs_a_premium() { + // Facing the small blind's all-in (an aggressor in the history): the bubble asks a premium. + let defence = facing_jam("Ks Qs", 12.0); + assert!(call_premium(&defence, &bubble(12.0)).unwrap() > 0.0); + // Same chips to put in, but hero is first in (no aggressor): the call premium is zero - the ICM + // there is the open-jam widening, not a narrowing. Without this the defence narrowing bled into + // the open-jam and dropped it below the ICM-Nash push (8.11.). + let open = Spot { history: vec![record(1, SeenAction::PostBigBlind, 1.0)], ..defence }; + assert_eq!(call_premium(&open, &bubble(12.0)), Some(0.0)); +} + +#[test] +fn the_defence_width_factor_is_concave_and_floored() { + use rechner::icm::risk::{width_factor, MIN_WIDTH}; + assert_eq!(width_factor(0.0), 1.0); // no premium, no narrowing (continuous at zero) + // Strictly decreasing in the premium. + assert!(width_factor(0.05) > width_factor(0.10) && width_factor(0.10) > width_factor(0.15)); + // Concave (square root): the first slice of premium narrows MORE than a later, equal slice. + assert!(width_factor(0.0) - width_factor(0.05) > width_factor(0.05) - width_factor(0.10)); + // Calibrated to the ICM-Nash defence: ~0.47 at a soft bubble premium, ~0.28 at a hard one. + assert!((width_factor(0.0797) - 0.466).abs() < 0.02, "{}", width_factor(0.0797)); + assert!((width_factor(0.1452) - 0.280).abs() < 0.02, "{}", width_factor(0.1452)); + // Never below the floor, even at an extreme premium. + assert_eq!(width_factor(1.0), MIN_WIDTH); +}