Information schadet nie: STEAL_BREITE=wert, INFO_KONSISTENT=paar|bluff|1

- STEAL_BREITE=wert: ein niedriger foldToBet macht die Oeffnungsbreite nie enger als blind
  (gegen Caller zaehlt der Wert, nicht der Steal). Leiter gg. Live +2,80 +-0,43, station +24,
  micro-passiv +0,58, kein Verlierer.
- INFO_KONSISTENT: Aggressions-Schwellen lesen den Read als Posterior. Der Read schrumpft auf
  den Prior 0,35, die Schwellen (0,45) sind in Orakel-Einheiten geeicht; ein Read ohne
  Stichprobe war so "passiver als blind". Mit Schalter steht der Prior-Teil auf dem neutralen
  Wert der Schwelle (sample::aggression_at), ein voller Read bleibt gleich.
  =paar: PAAR_RAISE-Riegel (maniac +5,9 offen, sonst 0 Deals). =bluff: Bluff-Anteil,
  Verlierer (fish -8,2, micro-passiv -8,7), nicht live.
- gedaechtnis_station: DIAG_A=blind|orakel, DIAG_B=orakel|hud|gezaehlt, maniac/nem2, DIAG_SPEC.

Alles aus = bitgleich, Lib-Specs gruen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-17 20:58:34 +01:00
co-authored by Claude Opus 5.5
parent 729daf3973
commit fe244c9868
6 changed files with 113 additions and 8 deletions
+10
View File
@@ -32,8 +32,15 @@ fn street_factor(street: Street) -> f64 {
}
}
pub use super::sample::{aggression_at, info_konsistent};
fn style_factor(profile: Option<&Profile>) -> f64 {
let Some(p) = profile else { return 1.0 };
if info_konsistent() {
if let Some(a) = aggression_at(p, AVERAGE_AGGRESSION) {
return (a / AVERAGE_AGGRESSION).clamp(0.0, MAX_FACTOR);
}
}
match p.aggression.filter(|a| !a.is_nan()) {
Some(a) => (a.clamp(0.0, 1.0) / AVERAGE_AGGRESSION).clamp(0.0, MAX_FACTOR),
None => match classify(p) {
@@ -86,6 +93,9 @@ pub fn with_pop_prior_on(
let unread = profile.is_none_or(|p| p.pool_baseline);
let prior = if unread && !sustained && prior_allowed {
POP_BLUFF_PRIOR[street as usize]
} else if info_konsistent() && !sustained && prior_allowed {
// Gelesen: der Teil ohne Aggressions-Stichprobe glaubt, was blind glaubt (Populations-Prior).
profile.and_then(super::sample::aggression_weight).map_or(0.0, |w| (1.0 - w) * POP_BLUFF_PRIOR[street as usize])
} else {
0.0
};
+59
View File
@@ -110,6 +110,51 @@ pub fn shrink(profile: &Profile, hands: f64) -> Profile {
}
}
/// Messschalter (einmal gelesen) `INFO_KONSISTENT=1` (Auftrag 17.11. "Information schadet nie"): jede
/// Schwelle auf der Aggression liest den Read als Posterior. Der Read ist `w * roh + (1 - w) * PRIOR`
/// (`shrink_aggression`, Prior 0,35); die Schwellen der Entscheidung (Station 0,45, Bluff-Mittel 0,45,
/// passiv 0,45) sind aber in Orakel-Einheiten geeicht, in denen "nichts bekannt" = blind = neutral heisst.
/// Ohne Schalter war ein Read ohne Aggressions-Stichprobe darum "passiver als blind" (0,35 < 0,45):
/// weniger Bluffs geglaubt, Paar-Raise gesperrt, Station-Klasse - Information schadete. Mit Schalter
/// zaehlt der Stichproben-Teil `w` mit dem rohen Wert, der Rest mit dem neutralen Wert der Schwelle;
/// ein voller Read (Orakel, `aggression_confidence` fehlt = 1) bleibt unveraendert. Vorgabe aus: bitgleich.
pub fn info_konsistent() -> bool {
info_modus() & 1 != 0
}
/// Nur der Paar-Raise-Riegel (`PAAR_RAISE`, `engine::options::all_passive`): `INFO_KONSISTENT=1|paar`.
pub fn info_konsistent_paar() -> bool {
info_modus() & 2 != 0
}
/// Bit 1 = Bluff-Anteil, Bit 2 = Paar-Riegel; `1` beide, `bluff` / `paar` je einer (Zerlegung).
fn info_modus() -> u8 {
use std::sync::OnceLock;
static MODUS: OnceLock<u8> = OnceLock::new();
*MODUS.get_or_init(|| match std::env::var("INFO_KONSISTENT").as_deref() {
Ok("1") => 3,
Ok("bluff") => 1,
Ok("paar") => 2,
_ => 0,
})
}
/// Gewicht der eigenen Aggressions-Stichprobe im Read (`aggression_confidence`; fehlt sie bei einem
/// Read mit Aggression, ist er voll = 1). `None` ohne Aggressions-Read.
pub fn aggression_weight(p: &Profile) -> Option<f64> {
p.aggression.filter(|a| a.is_finite())?;
Some(p.aggression_confidence.filter(|c| c.is_finite()).unwrap_or(1.0).clamp(0.0, 1.0))
}
/// Die Aggression des Reads mit dem Prior-Teil auf `neutral` statt auf `PRIOR` (siehe
/// `info_konsistent`): `w * roh + (1 - w) * neutral`. `None` ohne Aggressions-Read.
pub fn aggression_at(p: &Profile, neutral: f64) -> Option<f64> {
let a = p.aggression.filter(|a| a.is_finite())?.clamp(0.0, 1.0);
let w = aggression_weight(p)?;
let prior = PRIOR.aggression.unwrap_or(0.35);
Some((a + (1.0 - w) * (neutral - prior)).clamp(0.0, 1.0))
}
/// The aggression read on its OWN sample: `raw` was measured over `actions` postflop moves (not over
/// the HUD's hands), so it is shrunk toward the population with that weight and carries it as
/// `aggression_confidence`. No usable count: the profile is returned unchanged.
@@ -268,4 +313,18 @@ mod tests {
assert_eq!(field_hands(10.0, 60.0), 30.0);
assert_eq!(field_hands(0.0, 60.0), 0.0);
}
/// Information schadet nie: ein Read ohne Aggressions-Stichprobe steht auf dem neutralen Wert der
/// Schwelle (= blind), ein voller Read (Orakel ohne `aggression_confidence`) bleibt unveraendert,
/// dazwischen zaehlt die Stichprobe mit ihrem Gewicht.
#[test]
fn aggression_at_reads_the_prior_part_as_neutral() {
let leer = shrink_aggression(Profile::default(), Some(0.9), 0.0);
assert!((aggression_at(&leer, 0.45).unwrap() - 0.45).abs() < 1e-12);
let orakel = Profile { aggression: Some(0.25), ..Profile::default() };
assert_eq!(aggression_at(&orakel, 0.45), Some(0.25));
let halb = shrink_aggression(Profile::default(), Some(0.05), AGGRESSION_HALF);
assert!((aggression_at(&halb, 0.45).unwrap() - 0.25).abs() < 1e-12);
assert_eq!(aggression_at(&Profile::default(), 0.45), None);
}
}
+13 -1
View File
@@ -19,5 +19,17 @@ pub fn width_from_folds(folds: &[f64]) -> f64 {
return 1.0;
}
let mean = folds.iter().sum::<f64>() / folds.len() as f64;
(1.0 + PER_FOLD * (mean - DEFAULT_FOLD_TO_BET)).clamp(BOUNDS.0, BOUNDS.1)
let w = (1.0 + PER_FOLD * (mean - DEFAULT_FOLD_TO_BET)).clamp(BOUNDS.0, BOUNDS.1);
if steal_wert() { w.max(1.0) } else { w }
}
/// Schalter `STEAL_BREITE=wert` (17.11., Tor "Information schadet nie"; einmal gelesen): gegen Spieler, die
/// weniger folden, wird nicht enger geoeffnet. Wer weniger foldet, callt mit schwaecheren Haenden; der
/// Raise verliert Foldequity, gewinnt aber Wert gegen die breitere Calling-Range. Die Verengung kannte nur die
/// Foldequity: mit dem WAHREN Read (Orakel) limpte der SB 6 % statt zu raisen und das BB raiste gegen einen
/// Limp gar nicht mehr (station -10,1 und -4,2 bb/100 in diesen Zellen). Mehr Breite gegen Folder bleibt.
pub fn steal_wert() -> bool {
use std::sync::OnceLock;
static AN: OnceLock<bool> = OnceLock::new();
*AN.get_or_init(|| std::env::var("STEAL_BREITE").as_deref() == Ok("wert"))
}