Eine Weltklasse-Engine entscheidet jeden knappen Spot selbst. Das alte Unsicherheitsband um den Breakpoint gab ABSTAIN zurueck -> live FOLD und foldete so die rausch-nahe +EV-Call-SEITE weg (Overfold, bes. Flop/Turn mit grossem std_error; PLO5-Benchmark-Defekt). Der call_margin bleibt die Call-Schwelle (scored erzwingt sie); nur die Enthaltung faellt weg, der EV-maximale winner entscheidet. Das marginale Raise-Band (Spew-Schutz) und der Invalid-Equity-ABSTAIN bleiben. Verifiziert: Cash-Benchmark +2.06 bb/100 'nicht unterscheidbar' (keine Regression), PLO5-Benchmark rc 1->0 (Defekt behoben), River-Sonde 0 Leck, engine_choose_postflop/engine_uncertainty gruen, AoF/Kurzstack 40 gruen. Pre-existing reds unberuehrt (cfr_multi Chart-Drift; pipeline_tournament + icm_bubble = ICM-Defense-Verengung flippt auf CFR-FacingJam-Spots 0 Haende, eigener Hebel).
92 lines
3.8 KiB
Rust
92 lines
3.8 KiB
Rust
mod spot_fixture;
|
|
|
|
use rechner::engine::postflop::choose_postflop;
|
|
use rechner::engine::uncertainty::{abstain_confidence, MAX_UNCERTAIN_CONFIDENCE, MIN_UNCERTAIN_CONFIDENCE};
|
|
use rechner::exploit::thresholds::Thresholds;
|
|
use rechner::game::Choice;
|
|
use rechner::read::draw::Draw;
|
|
use rechner::read::made::Made;
|
|
use rechner::read::suit_pattern::SuitPattern;
|
|
use spot_fixture::*;
|
|
|
|
const BASE: Thresholds = Thresholds::BASE;
|
|
|
|
fn close(a: f64, b: f64) -> bool {
|
|
(a - b).abs() < 1e-9
|
|
}
|
|
|
|
#[test]
|
|
fn confidence_rises_linearly_from_the_edge_to_the_rim_of_the_band() {
|
|
assert!(close(abstain_confidence(0.0, 0.04), 0.05));
|
|
assert!(close(abstain_confidence(0.02, 0.04), 0.175));
|
|
assert!(close(abstain_confidence(0.04, 0.04), 0.30));
|
|
assert_eq!(MIN_UNCERTAIN_CONFIDENCE, 0.05);
|
|
assert_eq!(MAX_UNCERTAIN_CONFIDENCE, 0.30);
|
|
}
|
|
|
|
#[test]
|
|
fn confidence_never_leaves_its_range() {
|
|
for (d, w) in [(1.0, 0.04), (-1.0, 0.04), (0.01, 0.0), (f64::NAN, 0.1), (0.1, f64::NAN), (f64::INFINITY, 1.0)] {
|
|
let c = abstain_confidence(d, w);
|
|
assert!((0.05..=0.30).contains(&c), "{d} {w} -> {c}");
|
|
}
|
|
}
|
|
|
|
// round_flop: break-even 1/3, plain call margin 0.02 -> call breakpoint 0.3533.
|
|
|
|
#[test]
|
|
fn folds_just_below_the_effective_breakpoint() {
|
|
// 0.34 is below the call breakpoint 0.3533 -> decisive Fold (Owner 8.11.: no abstain band).
|
|
let d = choose_postflop(&round_flop(), &estimate(0.34, 0.005), &BASE, &neutral_read());
|
|
assert_eq!(d.choice, Choice::Fold);
|
|
}
|
|
|
|
#[test]
|
|
fn just_under_the_breakpoint_folds_decisively() {
|
|
let near = choose_postflop(&round_flop(), &estimate(0.352, 0.005), &BASE, &neutral_read());
|
|
let rim = choose_postflop(&round_flop(), &estimate(0.335, 0.005), &BASE, &neutral_read());
|
|
assert_eq!((near.choice, rim.choice), (Choice::Fold, Choice::Fold));
|
|
}
|
|
|
|
#[test]
|
|
fn the_texture_adjusted_breakpoint_still_decides() {
|
|
// Medium pair on a dry board lifts the call margin to 0.034 -> breakpoint 0.3673.
|
|
// Share 0.36 clears the plain breakpoint (0.3533 -> Call) but not the texture one (-> Fold).
|
|
let medium = read_of(Made::MiddlePair, Draw::None, 0, SuitPattern::Rainbow, 0.1);
|
|
let plain = choose_postflop(&round_flop(), &estimate(0.36, 0.001), &BASE, &neutral_read());
|
|
let shifted = choose_postflop(&round_flop(), &estimate(0.36, 0.001), &BASE, &medium);
|
|
assert_eq!(plain.choice, Choice::Call);
|
|
assert_eq!(shifted.choice, Choice::Fold, "{shifted:?}");
|
|
}
|
|
|
|
#[test]
|
|
fn the_multiway_adjusted_breakpoint_still_decides() {
|
|
// Three-way: realized 0.38 * 0.9409 = 0.3575, breakpoint 0.3333 + 0.04 = 0.3733 -> Fold.
|
|
let spot = with_villains(round_flop(), 3);
|
|
let d = choose_postflop(&spot, &estimate(0.38, 0.001), &BASE, &neutral_read());
|
|
assert_eq!(d.choice, Choice::Fold, "{d:?}");
|
|
}
|
|
|
|
#[test]
|
|
fn marginal_raise_versus_call_abstains_with_small_confidence() {
|
|
// Flush draw, share 0.40, fold-equity scale 0.85: P(fold) to a raise to 20 is
|
|
// 0.595 * 0.7 * 0.85 = 0.354, worth 3.54 - 0.646 * 2 = 2.25 against the call's 1.0.
|
|
// EV standard error = std_error * final pot (45): 2.25 noisy, 0.9 tight.
|
|
let th = Thresholds { fold_equity_scale: 0.85, ..BASE };
|
|
let noisy = choose_postflop(&round_flop(), &estimate(0.40, 0.05), &th, &flush_draw_read());
|
|
assert_eq!(noisy.choice, Choice::Abstain, "{noisy:?}");
|
|
let c = noisy.confidence.value();
|
|
assert!((0.05..=0.30).contains(&c), "{c}");
|
|
let tight = choose_postflop(&round_flop(), &estimate(0.40, 0.02), &th, &flush_draw_read());
|
|
assert!(matches!(tight.choice, Choice::Raise { .. }), "{tight:?}");
|
|
}
|
|
|
|
#[test]
|
|
fn invalid_equity_stays_at_zero_confidence() {
|
|
for share in [f64::NAN, -0.1, 1.5] {
|
|
let d = choose_postflop(&round_flop(), &estimate(share, 0.01), &BASE, &neutral_read());
|
|
assert_eq!(d.choice, Choice::Abstain);
|
|
assert_eq!(d.confidence.value(), 0.0);
|
|
}
|
|
}
|