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
+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);
}
}