RERAISE_TIEFE stetig: k-te Aggression einer Strasse behaelt den staerksten Anteil r^(k-1) (top_share, raise_to_bet, ohne Haende Pool 0,30); Schwelle/Trust entfernt; aus bit-identisch

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-15 03:23:18 +01:00
co-authored by Claude Opus 5.5
parent a4d30e73c0
commit 00e3a3ff8e
14 changed files with 204 additions and 59 deletions
+1
View File
@@ -25,5 +25,6 @@ pub fn call_continuation(villain: &Villain, street: Street, ratio: f64, facing_r
min_draw: crate::read::draw::Draw::Gutshot,
bluff_share: 0.0,
continue_share: Some(1.0 - fold_chance(villain.profile.as_ref(), ratio, facing_raise)),
top_share: None,
}
}
+4
View File
@@ -29,6 +29,10 @@ pub struct Continuation {
pub min_draw: Draw,
pub bluff_share: f64,
pub continue_share: Option<f64>,
/// `top_share`, when set, keeps only the strongest that share of the hands still in the range at
/// this step (by made hand, then draw, `engine::range_filter`) as value; `bluff_share` is admitted
/// below it as usual. A re-raise narrows the range this way per raise level (`RERAISE_TIEFE`).
pub top_share: Option<f64>,
}
impl RangeSpec {
+31 -45
View File
@@ -93,38 +93,29 @@ fn raise_draw_floor() -> Draw {
})
}
/// Floor rung of a RE-RAISE (the villain's second or later bet/raise on one street: a 3-bet after a
/// check-raise, a 4-bet after hero's 3-bet ...) per street: two pair on flop and turn, set on the river.
const RERAISE_RUNG: [i32; 3] = [6, 6, 7];
/// Messschalter (einmal gelesen): `RERAISE_TIEFE=1` modelliert eine Re-Erhoehung (zweite oder spaetere
/// Aggression des Gegners auf einer Strasse) strenger als eine erste Erhoehung, gewichtet mit dem
/// Vertrauen, dass seine Erhoehungen Wert sind (`reraise_trust`, raise_to_bet 0,25 voll bis 0,35 aus): Boden bis
/// zwei Paare / Set, ab halbem Vertrauen nur Kombi-Draws, Bluff-Anteil bis halb, kein Populations-Prior. Befund 15.11. (diag_welt cbet-folder):
/// gegen reine Wert-Erhoehungen blieb die Equity ueber drei Erhoehungen bei 0,64 (Top Pair + Gutshot
/// 5-bettet all-in), weil `level` jede Erhoehung gleich zaehlte; Erhoehungskriege kosteten dort rund
/// 58 bb/100. Vorgabe: aus (alt, bit-identisch).
/// Messschalter (einmal gelesen): `RERAISE_TIEFE=1` verengt die Range bei jeder weiteren Aggression des
/// Gegners auf einer Strasse (zweite Erhoehung, dritte ...) stetig nach seiner gemessenen Frequenz, gegen
/// einen Einsatz zu erhoehen (`Profile::raise_to_bet`, Bayes je Linie): nach der k-ten Aggression bleibt
/// der staerkste Anteil r^(k-1) dessen, was nach der ersten noch in der Range war, plus Bluffs. Ohne Read
/// gilt der Pool-Wert. Befund 15.11. (diag_welt cbet-folder): gegen reine Wert-Erhoehungen blieb die Equity
/// ueber drei Erhoehungen bei 0,64 (Top Pair + Gutshot 5-bettet all-in), weil `level` jede Erhoehung gleich
/// zaehlte; Erhoehungskriege kosteten dort rund 58 bb/100. Vorgabe: aus (alt, bit-identisch).
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"))
}
/// Raise-facing-a-bet read (`Profile::raise_to_bet`) at or below which a re-raise counts as fully
/// value-weighted, and at or above which the re-raise model stays the old one. The pooled aggression
/// does not separate (memory 15.11.: nemesis-2 0.32-0.38, reg 0.25-0.32; the aggression-gated pilot
/// still lost −26 ± 18 against nemesis-2); raise-to-bet does (nemesis-2 0.41-0.49, reg 0.10-0.17,
/// c-bet/3-bet folders 0.10-0.25).
const RERAISE_FULL_RAISE_TO_BET: f64 = 0.25;
const RERAISE_NO_RAISE_TO_BET: f64 = 0.35;
/// Raise-facing-a-bet frequency without a read: the pool value (anchor of the counted read,
/// `wire::decode_villain` and `sim::memory`: 0.30), so zero hands mean the pool's narrowing.
pub const RAISE_TO_BET_POOL: f64 = 0.30;
/// Trust that this villain's re-raises are value-only: linear in the raise-to-bet read between the two
/// bounds above, `0` without a read (blind = the old model, bit-identical).
fn reraise_trust(villain: &Villain) -> f64 {
match villain.profile.as_ref().and_then(|p| p.raise_to_bet).filter(|a| a.is_finite()) {
Some(r) => ((RERAISE_NO_RAISE_TO_BET - r) / (RERAISE_NO_RAISE_TO_BET - RERAISE_FULL_RAISE_TO_BET)).clamp(0.0, 1.0),
None => 0.0,
}
/// The share of the range that continues after the villain's `k`-th aggression on one street
/// (`k >= 2`): `r^(k-1)` with `r` the raise-to-bet read (shrunk to the pool in the read), clamped to
/// `[0.02, 1]`.
pub fn reraise_share(villain: &Villain, k: usize) -> f64 {
let r = villain.profile.as_ref().and_then(|p| p.raise_to_bet).filter(|a| a.is_finite()).unwrap_or(RAISE_TO_BET_POOL);
r.clamp(0.02, 1.0).powi(k.saturating_sub(1) as i32)
}
/// How many times the villain bet or raised on `street`.
@@ -149,28 +140,12 @@ fn on_street(
ratios: &[Option<f64>],
villain: &Villain,
street: Street,
) -> Option<Continuation> {
) -> Vec<Continuation> {
let slot = street as usize - 1;
let sustained = aggressed_earlier(&spot.history, street, villain.seat);
let trust = if reraise_depth_enabled() && aggressions_on(&spot.history, street, villain.seat) >= 2 {
reraise_trust(villain)
} else {
0.0
};
let made_bet =
own_aggression(&spot.history, ratios, street, villain.seat).map(|(lvl, ratio)| {
let bluff = bluff_share(villain.profile.as_ref(), ratio, street);
if trust > 0.0 && lvl == 1 {
// Trust-weighted: the floor moves from the raise rung toward the re-raise rung, strong
// draws only from half trust on, the bluff share shrinks to half at full trust.
let base = RAISE_RUNG[slot] + ((RERAISE_RUNG[slot] - RAISE_RUNG[slot]) as f64 * trust).round() as i32;
return (
rung(base, size_notch(ratio) + style_rung(villain)),
DRAWS[slot],
if trust >= 0.5 { Draw::Combo } else { raise_draw_floor() },
(1.0 - 0.5 * trust) * bluff,
);
}
let base = [BET_RUNG, RAISE_RUNG][lvl][slot];
(
rung(base, size_notch(ratio) + style_rung(villain)),
@@ -191,14 +166,25 @@ fn on_street(
0.0,
)
});
merge(made_bet, made_call).map(|(min_made, draws_continue, min_draw, bluff_share)| Continuation {
let first = merge(made_bet, made_call).map(|(min_made, draws_continue, min_draw, bluff_share)| Continuation {
board_len: street.board_len(),
min_made,
draws_continue,
min_draw,
bluff_share,
continue_share: None,
})
top_share: None,
});
// Each further aggression on the street keeps the strongest r^(k-1) of what the first left, with
// the plain size bluff share below it (a sustained line earns no population over-bluff prior).
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)),
..c
});
first.into_iter().chain(deeper).collect()
}
/// Postflop narrowing from the villain own actions, one entry per dealt street
@@ -224,6 +210,6 @@ pub fn continuations(spot: &Spot, villain: &Villain) -> Vec<Continuation> {
[Street::Flop, Street::Turn, Street::River]
.into_iter()
.filter(|street| street.board_len() <= spot.board.len())
.filter_map(|street| on_street(spot, &ratios, villain, street))
.flat_map(|street| on_street(spot, &ratios, villain, street))
.collect()
}