RERAISE_TIEFE-Diagnose: diag_welt DIAG_SCHALTER=reraise (an gegen aus je Hand gepaart, DIAG_BLIND=1 ohne Read); Messschalter RERAISE_BLUFF=erst (tiefere Fortsetzung behaelt den Bluffanteil der ersten) und RERAISE_ZUG=frei (Draws vom Staerkeschnitt ausgenommen)
nemesis-1 an-aus: -11,78 (Flop vs-raise Value-Reraise -> Call -13,9: der Schnitt entfernt zuerst die Luft, die tiefere Stufe liess nur den nackten Bluffanteil zu); BLUFF=erst +2,74, cbet-folder +15,64 -> +15,29; ZUG=frei n1 -2,90 aber cbet-folder nur +4,25 (verworfen). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+15
-3
@@ -127,7 +127,11 @@ fn arm(opp_of: &dyn Fn(u64) -> (Opponent, u64), deals: u32, draws: u64, bot: boo
|
||||
/// difference (read − blind, luck-corrected) belongs to that node. Besides, every decision of the read
|
||||
/// arm is also taken blind on the same spot (`set_hero_read_diff`): per node how often the read changes
|
||||
/// the action or only the size.
|
||||
/// `DIAG_SCHALTER=reraise`: the same pairing, but both arms hold the Memory read and differ only in
|
||||
/// `RERAISE_TIEFE` (arm "Read" = on, "blind" = off; labels read `aus -> an`).
|
||||
fn read_arm(opp_of: &dyn Fn(u64) -> (Opponent, u64), deals: u32, draws: u64) {
|
||||
let schalter = std::env::var("DIAG_SCHALTER").as_deref() == Ok("reraise");
|
||||
use rechner::exploit::street_continuation::set_reraise_depth_override as rr;
|
||||
let mut diff: BTreeMap<String, [u32; 3]> = BTreeMap::new();
|
||||
let mut moved: BTreeMap<String, Agg> = BTreeMap::new();
|
||||
let (mut hands, mut same, mut total) = (0u32, 0u32, 0.0);
|
||||
@@ -146,15 +150,23 @@ fn read_arm(opp_of: &dyn Fn(u64) -> (Opponent, u64), deals: u32, draws: u64) {
|
||||
read,
|
||||
};
|
||||
set_hero_why(true);
|
||||
set_hero_read_diff(true);
|
||||
let (r, _) = play_hand_tracked_history(&setup(HandRead::Given(memory.read())), TableCost::FREE, Some(&mut memory));
|
||||
set_hero_read_diff(!schalter);
|
||||
// DIAG_BLIND=1 (switch mode): both arms without a read (the `@blind` rows).
|
||||
let seen = if schalter && std::env::var("DIAG_BLIND").as_deref() == Ok("1") { None } else { memory.read() };
|
||||
if schalter { rr(Some(true)); }
|
||||
let (r, _) = play_hand_tracked_history(&setup(HandRead::Given(seen)), TableCost::FREE, Some(&mut memory));
|
||||
let why_r = take_hero_why();
|
||||
for (node, x) in take_hero_read_diff() {
|
||||
let e = diff.entry(node).or_default();
|
||||
(0..3).for_each(|i| e[i] += x[i]);
|
||||
}
|
||||
set_hero_read_diff(false);
|
||||
let (b, _) = play_hand_tracked_history(&setup(HandRead::Given(None)), TableCost::FREE, None);
|
||||
if schalter { rr(Some(false)); }
|
||||
let (b, _) = play_hand_tracked_history(&setup(HandRead::Given(if schalter { seen } else { None })), TableCost::FREE, None);
|
||||
if schalter { rr(None); }
|
||||
if schalter && d + 1 == deals && hero_seat == 2 {
|
||||
eprintln!("read nach {deals}: raise_to_bet {:?} reraise_to_raise {:?} aggression {:?}", seen.and_then(|p| p.raise_to_bet), seen.and_then(|p| p.reraise_to_raise), seen.and_then(|p| p.aggression));
|
||||
}
|
||||
let why_b = take_hero_why();
|
||||
let delta = (r.hero_net - r.luck) - (b.hero_net - b.luck);
|
||||
hands += 1;
|
||||
|
||||
@@ -34,17 +34,32 @@ fn above(k: &Key, cut: &Key) -> bool {
|
||||
fn meets(rules: &Rules, c: &Continuation, hand: &[Card], board: &[Card], step: usize, cut: Option<&Key>) -> Option<bool> {
|
||||
glance(rules, hand, &board[..c.board_len.min(board.len())]).ok().map(|(made, draw)| {
|
||||
(made >= c.min_made || (c.draws_continue && draw >= c.min_draw))
|
||||
&& cut.is_none_or(|cut| key(rules, c, hand, board, step).is_some_and(|k| above(&k, cut)))
|
||||
&& (cut.is_none_or(|cut| key(rules, c, hand, board, step).is_some_and(|k| above(&k, cut)))
|
||||
|| (draws_free() && made < c.min_made && c.draws_continue && draw >= c.min_draw))
|
||||
})
|
||||
}
|
||||
|
||||
/// Messschalter (einmal gelesen) `RERAISE_ZUG=frei`: the strength cut of `top_share` narrows only the
|
||||
/// made hands; a hand that continues by its draw alone stays (the made-first key ranked every semibluff
|
||||
/// below the weakest made hand, so a flop re-raise range lost its draws - nemesis-1 raises by equity,
|
||||
/// `diag_welt DIAG_SCHALTER=reraise` 15.11.: Flop vs-raise value re-raise -> call -13,9 bb/100).
|
||||
fn draws_free() -> bool {
|
||||
use std::sync::OnceLock;
|
||||
static ON: OnceLock<bool> = OnceLock::new();
|
||||
*ON.get_or_init(|| std::env::var("RERAISE_ZUG").as_deref() == Ok("frei"))
|
||||
}
|
||||
|
||||
/// The strength cut of `top_share`: the key of the `ceil(share * alive)`-th strongest readable hand
|
||||
/// (at least one hand stays); `None` without a share or with a share of 1 or more.
|
||||
fn strength_cut(rules: &Rules, c: &Continuation, alive: &[Vec<Card>], board: &[Card], step: usize) -> Option<Key> {
|
||||
let share = c.top_share.filter(|t| t.is_finite() && *t < 1.0)?;
|
||||
let mut keys: Vec<Key> = alive.iter().filter_map(|h| key(rules, c, h, board, step)).collect();
|
||||
if draws_free() {
|
||||
keys.retain(|k| k.0 >= c.min_made);
|
||||
}
|
||||
keys.sort_by(|a, b| (b.0, b.1).cmp(&(a.0, a.1)).then(b.2.total_cmp(&a.2)));
|
||||
let n = ((share.max(0.0) * alive.len() as f64).ceil() as usize).clamp(1, keys.len().max(1));
|
||||
let pool = if draws_free() { keys.len() } else { alive.len() };
|
||||
let n = ((share.max(0.0) * pool as f64).ceil() as usize).clamp(1, keys.len().max(1));
|
||||
keys.get(n - 1).copied()
|
||||
}
|
||||
|
||||
|
||||
@@ -103,7 +103,26 @@ fn raise_draw_floor() -> Draw {
|
||||
fn reraise_depth_enabled() -> bool {
|
||||
use std::sync::OnceLock;
|
||||
static ON: OnceLock<bool> = OnceLock::new();
|
||||
*ON.get_or_init(|| std::env::var("RERAISE_TIEFE").as_deref() == Ok("1"))
|
||||
RERAISE_OVERRIDE.with(|o| o.get()).unwrap_or_else(|| *ON.get_or_init(|| std::env::var("RERAISE_TIEFE").as_deref() == Ok("1")))
|
||||
}
|
||||
|
||||
/// Messschalter (einmal gelesen) `RERAISE_BLUFF=erst`: the deeper continuation keeps the bluff share of
|
||||
/// the first (with its population prior) instead of the plain size share. The strength cut removes the
|
||||
/// air first, so the deeper step alone sets how many bluffs a re-raise range holds (nemesis-1, 15.11.).
|
||||
fn reraise_bluff_first() -> bool {
|
||||
use std::sync::OnceLock;
|
||||
static ON: OnceLock<bool> = OnceLock::new();
|
||||
*ON.get_or_init(|| std::env::var("RERAISE_BLUFF").as_deref() == Ok("erst"))
|
||||
}
|
||||
|
||||
thread_local! {
|
||||
static RERAISE_OVERRIDE: std::cell::Cell<Option<bool>> = const { std::cell::Cell::new(None) };
|
||||
}
|
||||
|
||||
/// Diagnostics only (`diag_welt DIAG_SCHALTER=reraise`): force `RERAISE_TIEFE` on or off on this thread,
|
||||
/// `None` = the environment switch.
|
||||
pub fn set_reraise_depth_override(on: Option<bool>) {
|
||||
RERAISE_OVERRIDE.with(|o| o.set(on));
|
||||
}
|
||||
|
||||
/// Raise-facing-a-bet frequency without a read: the pool value (anchor of the counted read,
|
||||
@@ -182,8 +201,12 @@ fn on_street(
|
||||
let k = aggressions_on(&spot.history, street, villain.seat);
|
||||
let deeper = (reraise_depth_enabled() && k >= 2).then_some(()).and(first).map(|c| Continuation {
|
||||
top_share: Some(reraise_share(villain, k)),
|
||||
bluff_share: own_aggression(&spot.history, ratios, street, villain.seat)
|
||||
.map_or(0.0, |(_, ratio)| bluff_share(villain.profile.as_ref(), ratio, street)),
|
||||
bluff_share: if reraise_bluff_first() {
|
||||
c.bluff_share
|
||||
} else {
|
||||
own_aggression(&spot.history, ratios, street, villain.seat)
|
||||
.map_or(0.0, |(_, ratio)| bluff_share(villain.profile.as_ref(), ratio, street))
|
||||
},
|
||||
..c
|
||||
});
|
||||
first.into_iter().chain(deeper).collect()
|
||||
|
||||
Reference in New Issue
Block a user