D1c: Leseschicht im River-Veto hinter GEGNER_RANGE (aus), Werte auf echten Gegnern, Messarme eingereiht
- river_subgame: river_tree_weighted (Gewicht je Gegner-Kombi), read_belief (gekippte Range, festgelegter geglaubter Gegner aus Fold/Bluffanteil), KL gegen das ungekippte Gleichgewicht, Vertrauen aus RangeRead::trust; ohne Schalter bitgleich. - range_read::on() (GEGNER_RANGE=1), decide.py kennt den Schalter. - bin/range_read_scan + messung_zaehlung/range_read.py: 634 echte Gegner-Spots; gezaehlt 85/123 River-Spots mit Bluff-Vertrauen >= 0,5 (live 0). - Leiter range-an + LBR range-lbr-typ eingereiht; STAND §10, PLAN D1c. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -99,6 +99,7 @@ Eine Regel für Bankroll und Gesamt-Verlustdeckel über die 30 000 Hände fehlt
|
||||
|---|---|---|---|
|
||||
| D1 | Zähler je Gegner und Read schreibt live mit (Teil von L0) | Zählungen wachsen, Dedupe stimmt | live |
|
||||
| D1b | Gezählte Reads an den Kern: Zählung je Kennung mit echter Stichprobe in die Profile (`lesen/profil.py` `mit_zaehlung`), Schalter `GEGNER_ZAEHLUNG=1`; gezeigte River-Einsätze (`riverBluffShown`) zum River-Getriebe, eigener Schalter `GEGNER_SHOWDOWN=1` | Messregel 1a: Leiter mit Gedächtnis-Read im Draht-Format (`LESEN_DRAHT=hud` gegen `gezaehlt`) ohne Verlierer, LBR gepaart dünn gegen gezählt ≤ +5 bb/100; Replay echter Entscheidungen zeigt, was sich ändert | gebaut, beide Schalter aus. Replay 1345 echte Züge: 3 anders (0,2 %), Stil-Read anders in 238 von 516 Nach-Flop-Spots. Leiter + LBR eingereiht (`messung_zaehlung/`). **Wechselpunkt: Owner** |
|
||||
| D1c | Gedächtnis formt die Ranges des Solvers: `exploit::range_read` (Range-Kippung nach Lockerheit, Bluffanteil je Größe aus Straßen-Aggression und gezeigten River-Einsätzen, Fold je Straße, Vertrauen aus echter Stichprobe) → Kippung der Kombigewichte, festgelegter geglaubter Gegner, KL-Schranke λ aus Vertrauen. Schalter `GEGNER_RANGE=1`, aus. Schnittstelle mit solver-ueberall vereinbart (Orchestrator 14.11.) | LBR gepaart nicht schlechter jenseits des Rauschens; Leiter mit Gedächtnis-Read: Gewinn, kein Profil verliert | gebaut, zuerst im bestehenden River-Veto verdrahtet; Werte auf 634 echten Gegner-Spots plausibel. Leiter `range-an` + LBR `range-lbr-typ` eingereiht. Haken wandert in den Einstieg von solver-ueberall, sobald Stufe A steht |
|
||||
| D2 | Priors aus echten Händen eichen (`lesen/eichung.py`), ab 200 Gegnern mit je ≥ 30 Chancen | κ-Intervalle endlich; ersetzt die gesetzten Anker | Werkzeug steht; 0 von 16 Reads am Tor (39 Gegner); vpip μ̂ 0,70 statt Anker 0,28 |
|
||||
| D3 | Gezeigte Hände verengen die Range-Annahme je Gegner | Vorhersage auf zurückgehaltenen Händen besser (Log-Loss) | Werkzeug steht; 5 echte gezeigte Hände, zu wenig |
|
||||
| D4 | Entscheidungs-Audit: jede echte River- und Turn-Entscheidung wird nachgerechnet, EV-Verlust je Entscheidung | Bericht je Woche; zeigt das größte Leck in echten Spots | Werkzeug steht (`bin/audit`); hatte die MDF-Boden-Calls schon markiert. **Wochenbericht läuft noch nicht** |
|
||||
|
||||
@@ -282,3 +282,6 @@ das E1-Tor erneut.
|
||||
| D1b Replay echter Züge (14.11., 19:25–20:14, Live-Schalter) | 1345 NLHE-Züge mit Sitzliste; Nachspiel = Original auf 1344. Ohne Profil → live: 6 anders. **Live → gezählt: 3 anders (0,2 %)**: 2 River-Calls → Fold, 1 Flop-Raise → Enthalten. Die Reads ändern sich stark (Stil anders in 238 von 516 Nach-Flop-Spots: Nit 0 → 142, Station 54 → 89, LAG 3 → 37), die Entscheidungen kaum: der Kern nutzt Reads nur eng (Angriff nur gegen Station, `read_gate`; viele lose Spieler haben hohes HUD-Fold-to-Aggression). Nächster Hebel ist die Read-Nutzung im Kern, nicht die Eingabe | D1b, Messregel 1a |
|
||||
| D1b Showdown-Lesung, Menge | 50 min Client-Log (857 Hände, 12–16 Tische): 228 mit Aufdecken, 188 mit ganzem Board, **59 gezeigte River-Einsätze, 6 davon Luft**. Füllt langsam; am 13.11. auf der Leiter ein Verlierer (sd-an −1,31 ±0,95), darum eigener Schalter, aus | D1b, D3 |
|
||||
| D1b Messungen | eingereiht in `messung_engine/warteschlange.txt` des Live-Worktrees: Leiter `zaehlung-hud` gegen `zaehlung-gez` (19 Zeilen + micro-passiv, Gedächtnis-Read im Draht-Format, `MDF_UNREAD=0`), LBR gepaart Pool-Regular und Lose-Passiv je dünn gegen gezählt (2000 Hände, Live-Schalter). Ergebnis: ausstehend | D1b |
|
||||
| D1c Leseschicht gebaut (Schalter `GEGNER_RANGE`, aus) | `exploit::range_read`: Kippung der Range nach vpip gegen die Population (`exp(t·(p−½))`, Masse bleibt), Bluffanteil je Einsatzgröße = Indifferenz `s/(1+2s)` × Aggression der Straße / Population, am River zur gezeigten Luft hin (Gewicht n/(n+15)), Fold je Straße, Bluff-Vertrauen = schwächerer Read, gezeigte River-Einsätze zählen mit. Im River-Veto: Gegner glaubt auf der gekippten Range, Held bleibt per KL an das UNgekippte Gleichgewicht gebunden. Kein Populations-Prior. Specs: range_read 5, river_subgame 14 grün | D1c |
|
||||
| D1c Werte auf echten Gegnern (14.11., 634 Gegner-Spots nach dem Flop) | Live-Profile: 127 ohne Read; Kippung Median +0,05 (p10 −0,40), Bluffanteil Potbet 0,33 fast überall (keine Straßen-Reads), Bluff-Vertrauen ≥ 0,5 auf 0 von 123 River-Spots. **Gezählte Profile: alle mit Read; Kippung p10 −0,91 / Median +0,04 / p90 +0,20, Bluffanteil Potbet 0,18–0,36, Fold Median 0,62, Vertrauen Median 0,73, Bluff-Vertrauen ≥ 0,5 auf 85 von 123 River-Spots.** Gezeigte River-Einsätze im Speicher: noch 0 (Zählung erst ab diesem Stand) | D1c |
|
||||
| D1c Messungen | eingereiht: Leiter `range-an` (19 Zeilen + micro-passiv, gezählter Gedächtnis-Read, `MDF_UNREAD=0`) gegen `zaehlung-gez`; LBR `range-lbr-typ` (Pool-Regular gezählt, Live-Schalter) gepaart gegen `zaehlung-lbr-typ-gez`. Ergebnis: ausstehend | D1c |
|
||||
|
||||
@@ -33,7 +33,7 @@ SCHALTER_DATEI = os.path.join(BASE, "..", "betrieb", "kern_schalter.txt")
|
||||
# GEGNER_ZAEHLUNG=1 ist kein Kern-Schalter, sondern einer des Laeufers (betrieb/runner.py): die gezaehlten
|
||||
# Reads je Gegner gehen in die Profile. Er steht hier, damit er in der Arm-Marke jeder Hand steht.
|
||||
BEKANNTE_SCHALTER = ("MDF_UNREAD", "RAISE_DRAWS", "RAISE_PRIOR", "TURN_SPIEL", "GRUNDSTRATEGIE",
|
||||
"GEGNER_ZAEHLUNG", "GEGNER_SHOWDOWN")
|
||||
"GEGNER_ZAEHLUNG", "GEGNER_SHOWDOWN", "GEGNER_RANGE")
|
||||
# Pfade gehoeren nicht in die Arm-Marke.
|
||||
OHNE_MARKE = ("GRUNDSTRATEGIE",)
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
# Plan D1c (Leseschicht im River-Veto, GEGNER_RANGE=1): Leiter gegen zaehlung-gez (gleiche Zeilen, gleicher gezaehlter Gedaechtnis-Read), LBR gepaart gegen zaehlung-lbr-typ-gez
|
||||
range-an|D:\Projects\pokerfreak\.claude\worktrees\exploit-live-ec8091\messung_zaehlung\bin\pokerbench-range-leiter.exe|D:\Projects\pokerfreak\.claude\worktrees\exploit-live-ec8091\messung_zaehlung\arme\range-an 2000 4000 4 wert-sizer,polar,umgekehrt,textur-cbet,position,tanker,balanciert,cbet-folder,3bet-folder,check-raiser,gto,station,fish,reg,nit,maniac,nemesis-1,nemesis-2,nemesis-3,micro-passiv|LESEN_DRAHT=gezaehlt;MDF_UNREAD=0;GEGNER_RANGE=1|D:\Projects\pokerfreak\.claude\worktrees\exploit-live-ec8091
|
||||
range-lbr-typ|D:\Projects\pokerfreak\.claude\worktrees\exploit-live-ec8091\messung_zaehlung\bin\pokerbench-range-lbr.exe|D:\Projects\pokerfreak\.claude\worktrees\exploit-live-ec8091\messung_zaehlung\lbr\range-typ.txt 2000|MDF_UNREAD=0;TURN_SPIEL=grund;GRUNDSTRATEGIE=D:\Projects\pokerfreak\.claude\worktrees\engine-lecks-angreifen-de7b88\daten;GEGNER_RANGE=1;LBR_PROFIL={"vpip":0.23,"pfr":0.16,"foldToBet":0.69,"hands":92,"aggression":0.333,"aggressionActions":37,"turnAggression":0.387,"turnAggressionActions":12,"riverAggression":0.25,"riverAggressionActions":7,"flopFoldToBet":0.5,"flopFacingBet":5,"turnFoldToBet":0.625,"turnFacingBet":4,"riverFoldToBet":0.8,"riverFacingBet":2}|D:\Projects\pokerfreak\.claude\worktrees\exploit-live-ec8091
|
||||
@@ -0,0 +1,78 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Die Leseschicht (src/exploit/range_read.rs) auf echten Gegnern: Verteilung von Kippung, Bluffanteil,
|
||||
Fold und Vertrauen ueber alle Nach-Flop-Spots vom 14.11. (je Spot und Gegner in der Hand), einmal mit
|
||||
den Live-Profilen, einmal mit den gezaehlten (mit_zaehlung, auf Wunsch mit Showdown-Lesung).
|
||||
|
||||
python messung_zaehlung/range_read.py <live-worktree> [--scan <range_read_scan.exe>]
|
||||
"""
|
||||
import collections
|
||||
import json
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
HIER = os.path.dirname(os.path.abspath(__file__))
|
||||
sys.path.insert(0, HIER)
|
||||
import reads as RD # noqa: E402
|
||||
import replay as R # noqa: E402
|
||||
|
||||
FLOOR = 0.25 # river_subgame CONFIDENCE_FLOOR
|
||||
|
||||
|
||||
def scan(exe, profile):
|
||||
r = subprocess.run([exe], input="\n".join(json.dumps(p) for p in profile) + "\n",
|
||||
capture_output=True, text=True, timeout=600)
|
||||
out = []
|
||||
for z in r.stdout.strip().split("\n"):
|
||||
t = z.split("\t")
|
||||
out.append(None if t[0] == "-" else {"tilt": float(t[0]), "bluff_pot": float(t[1]),
|
||||
"bluff_23": float(t[2]),
|
||||
"fold": None if t[3] == "-" else float(t[3]),
|
||||
"conf": float(t[4]), "trust": float(t[5])})
|
||||
return out
|
||||
|
||||
|
||||
def q(xs):
|
||||
xs = sorted(xs)
|
||||
if not xs:
|
||||
return "-"
|
||||
p = lambda f: xs[min(len(xs) - 1, int(f * len(xs)))]
|
||||
return f"n={len(xs)} p10 {p(.1):+.2f} p25 {p(.25):+.2f} med {p(.5):+.2f} p75 {p(.75):+.2f} p90 {p(.9):+.2f}"
|
||||
|
||||
|
||||
def bericht(name, werte, strassen):
|
||||
print(f"== {name}: {len(werte)} Gegner-Spots, ohne Read {sum(w is None for w in werte)}")
|
||||
w = [x for x in werte if x]
|
||||
for k in ("tilt", "bluff_pot", "bluff_23", "fold", "conf", "trust"):
|
||||
print(f" {k:9s} {q([x[k] for x in w if x[k] is not None])}")
|
||||
for s in ("FLOOR", 0.5):
|
||||
g = FLOOR if s == "FLOOR" else s
|
||||
print(f" Bluff-Vertrauen >= {g}: {sum(x['trust'] >= g for x in w)}; River-Spots {sum(x['trust'] >= g for x, st in zip(werte, strassen) if x and st == 'RIVER')} von {strassen.count('RIVER')}")
|
||||
|
||||
|
||||
def main():
|
||||
live = sys.argv[1]
|
||||
exe = sys.argv[sys.argv.index("--scan") + 1] if "--scan" in sys.argv else os.path.join(HIER, "bin", "pokerbench-zaehlung-scan.exe")
|
||||
speicher = json.load(open(os.path.join(live, "archiv", "lauf", "zaehler.json"), encoding="utf-8"))
|
||||
listen = RD.laden_listen(os.path.join(HIER, "sitzlisten_14-11.json"))
|
||||
F = RD.faelle(live, speicher, listen)
|
||||
lp, gp, gs, st = [], [], [], []
|
||||
k2 = {}
|
||||
for a, g in F:
|
||||
for v in a["villains"]:
|
||||
if v.get("folded"):
|
||||
continue
|
||||
lp.append(v.get("profile") or {})
|
||||
gp.append(g.get(v["seat"]) or {})
|
||||
st.append(a.get("street"))
|
||||
# Showdown-Lesung: dieselben Spots, gezaehlt + riverBluffShare (nur wo der Speicher sie hat)
|
||||
for a, g in F:
|
||||
pass
|
||||
bericht("live", scan(exe, lp), st)
|
||||
bericht("gezaehlt", scan(exe, gp), st)
|
||||
n_shown = sum(1 for z in speicher.values() if isinstance(z, dict) and z.get("riverBluffShown"))
|
||||
print(f"Speicher: {sum(1 for k in speicher if k != '_gezaehlt')} Spieler, mit gezeigten River-Einsaetzen: {n_shown}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,34 @@
|
||||
//! Read layer on real villains (plan D1c): one wire-form profile object per stdin line, decoded as a
|
||||
//! live request's `villains[].profile`, then `exploit::range_read::RangeRead`. Prints one tab line
|
||||
//! per profile: tilt, bluff share river (pot bet / 2/3 pot), fold river, confidence, bluff trust
|
||||
//! river, or `-` without a read.
|
||||
//!
|
||||
//! messung_zaehlung/range_read.py writes the profiles and reads this back.
|
||||
|
||||
use rechner::exploit::range_read::RangeRead;
|
||||
use std::io::BufRead;
|
||||
|
||||
fn main() {
|
||||
let stdin = std::io::stdin();
|
||||
for line in stdin.lock().lines() {
|
||||
let Ok(line) = line else { break };
|
||||
let text = format!("{{\"villains\":[{{\"seat\":1,\"stack\":100,\"folded\":false,\"profile\":{}}}]}}", line.trim());
|
||||
let profile = rechner::json::parse::parse(&text)
|
||||
.ok()
|
||||
.and_then(|root| rechner::wire::decode_villain::villains(&root).ok())
|
||||
.and_then(|v| v.into_iter().next())
|
||||
.and_then(|v| v.profile);
|
||||
match RangeRead::from_profile(profile.as_ref()) {
|
||||
Some(r) => println!(
|
||||
"{:.4}\t{:.4}\t{:.4}\t{}\t{:.4}\t{:.4}",
|
||||
r.tilt,
|
||||
r.bluff_share(2, 1.0),
|
||||
r.bluff_share(2, 0.66),
|
||||
r.fold_to_bet(2).map_or("-".to_string(), |f| format!("{f:.4}")),
|
||||
r.confidence,
|
||||
r.trust(true, 2)
|
||||
),
|
||||
None => println!("-"),
|
||||
}
|
||||
}
|
||||
}
|
||||
+127
-14
@@ -50,6 +50,7 @@ use crate::cfr::tree::{Node, Tree};
|
||||
use crate::exploit::fold_chance::DEFAULT_FOLD_TO_BET;
|
||||
use crate::exploit::posterior::DEFAULT_AGGRESSION;
|
||||
use crate::exploit::profile::Profile;
|
||||
use crate::exploit::range_read::{self, RangeRead};
|
||||
use crate::game::{Choice, Decision, SeenAction, Spot, Street, Villain};
|
||||
use crate::hand::showdown::judge;
|
||||
use crate::hand::strength::Strength;
|
||||
@@ -145,16 +146,36 @@ fn subgame(spot: &Spot, hero_combos: &[Vec<Card>], villain_combos: &[Vec<Card>],
|
||||
|
||||
/// The card-exact river tree and its strength ladder, unsolved (see `subgame`).
|
||||
fn river_tree(spot: &Spot, hero_combos: &[Vec<Card>], villain_combos: &[Vec<Card>], pot: f64, bet: f64) -> Option<(Tree, Vec<Strength>)> {
|
||||
river_tree_weighted(spot, hero_combos, villain_combos, None, pot, bet)
|
||||
}
|
||||
|
||||
/// `river_tree` with a weight per villain combo (the read's range tilt, `RangeRead::reweigh`):
|
||||
/// each deal counts its villain combo's weight instead of 1. `None` = all 1 (bit-identical).
|
||||
fn river_tree_weighted(
|
||||
spot: &Spot,
|
||||
hero_combos: &[Vec<Card>],
|
||||
villain_combos: &[Vec<Card>],
|
||||
villain_weights: Option<&[f64]>,
|
||||
pot: f64,
|
||||
bet: f64,
|
||||
) -> Option<(Tree, Vec<Strength>)> {
|
||||
let rules = spot.rules();
|
||||
let judged = |combos: &[Vec<Card>]| -> Vec<(Vec<Card>, Strength)> {
|
||||
combos.iter().filter_map(|c| judge(&rules, c, &spot.board).ok().map(|s| (c.clone(), s))).collect()
|
||||
let judged = |combos: &[Vec<Card>], weights: Option<&[f64]>| -> Vec<(Vec<Card>, Strength, f64)> {
|
||||
combos
|
||||
.iter()
|
||||
.enumerate()
|
||||
.filter_map(|(i, c)| {
|
||||
let w = weights.and_then(|w| w.get(i).copied()).unwrap_or(1.0);
|
||||
judge(&rules, c, &spot.board).ok().map(|s| (c.clone(), s, w))
|
||||
})
|
||||
.collect()
|
||||
};
|
||||
let hero = judged(hero_combos);
|
||||
let villain = judged(villain_combos);
|
||||
let hero = judged(hero_combos, None);
|
||||
let villain = judged(villain_combos, villain_weights);
|
||||
if hero.is_empty() || villain.is_empty() {
|
||||
return None;
|
||||
}
|
||||
let mut ladder: Vec<Strength> = hero.iter().chain(&villain).map(|(_, s)| *s).collect();
|
||||
let mut ladder: Vec<Strength> = hero.iter().chain(&villain).map(|(_, s, _)| *s).collect();
|
||||
ladder.sort();
|
||||
ladder.dedup();
|
||||
let n = ladder.len();
|
||||
@@ -163,11 +184,11 @@ fn river_tree(spot: &Spot, hero_combos: &[Vec<Card>], villain_combos: &[Vec<Card
|
||||
}
|
||||
let bucket = |s: Strength| ladder.partition_point(|d| *d < s).min(n - 1);
|
||||
let mut chance = vec![0.0; n * n];
|
||||
for (hc, hs) in &hero {
|
||||
for (hc, hs, _) in &hero {
|
||||
let hb = bucket(*hs);
|
||||
for (vc, vs) in &villain {
|
||||
for (vc, vs, w) in &villain {
|
||||
if disjoint(hc, vc) {
|
||||
chance[hb * n + bucket(*vs)] += 1.0;
|
||||
chance[hb * n + bucket(*vs)] += *w;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -257,14 +278,68 @@ pub(crate) fn river_bluff_aggression(profile: Option<&Profile>, pot: f64, bet: f
|
||||
if gto_bluff <= 0.0 {
|
||||
return a;
|
||||
}
|
||||
let s = share.clamp(0.0, 0.999);
|
||||
let bluff_prob = (s * (1.0 - VALUE_RANK) / (BLUFF_RANK * (1.0 - s))).clamp(0.0, 1.0);
|
||||
let shown = (bluff_prob * DEFAULT_AGGRESSION / gto_bluff).clamp(0.0, 1.0);
|
||||
let shown = aggression_for_share(share, gto_bluff);
|
||||
let base = a.unwrap_or(DEFAULT_AGGRESSION);
|
||||
let w = n / (n + SHOWN_HALF);
|
||||
Some(base + w * (shown - base))
|
||||
}
|
||||
|
||||
/// The aggression at which `believed_villain` bets a range whose air share is `share` (bets = value
|
||||
/// above `VALUE_RANK` + `bluff_prob` of the range below `BLUFF_RANK`, `bluff_prob = gto_bluff · a /
|
||||
/// DEFAULT_AGGRESSION`), inverted. `gto_bluff = bet/(pot+bet)` > 0.
|
||||
fn aggression_for_share(share: f64, gto_bluff: f64) -> f64 {
|
||||
let s = share.clamp(0.0, 0.999);
|
||||
let bluff_prob = (s * (1.0 - VALUE_RANK) / (BLUFF_RANK * (1.0 - s))).clamp(0.0, 1.0);
|
||||
(bluff_prob * DEFAULT_AGGRESSION / gto_bluff).clamp(0.0, 1.0)
|
||||
}
|
||||
|
||||
/// Strength percentile of each villain combo within its own range (mid-rank, equal weight per
|
||||
/// combo, ties share their middle): the `p` of `RangeRead::reweigh`. Unjudgeable combos get ½.
|
||||
fn range_percentiles(spot: &Spot, combos: &[Vec<Card>]) -> Vec<f64> {
|
||||
let rules = spot.rules();
|
||||
let strengths: Vec<Option<Strength>> = combos.iter().map(|c| judge(&rules, c, &spot.board).ok()).collect();
|
||||
let mut sorted: Vec<Strength> = strengths.iter().flatten().copied().collect();
|
||||
sorted.sort();
|
||||
let n = sorted.len().max(1) as f64;
|
||||
strengths
|
||||
.iter()
|
||||
.map(|s| match s {
|
||||
Some(s) => {
|
||||
let below = sorted.partition_point(|d| d < s) as f64;
|
||||
let equal = sorted.partition_point(|d| d <= s) as f64 - below;
|
||||
(below + equal / 2.0) / n
|
||||
}
|
||||
None => 0.5,
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// The read layer (`exploit::range_read`, switch `GEGNER_RANGE=1`) applied to the river gearbox: the
|
||||
/// game the believed villain plays on (villain range tilted), the believed villain (fold-to-bet and
|
||||
/// the air share of its betting range for this size, node-locked) and the trust behind it. Hero's
|
||||
/// reference stays the UNtilted equilibrium, so the KL bound covers the tilt too.
|
||||
fn read_belief(spot: &Spot, game: &Subgame, villain_combos: &[Vec<Card>], read: &RangeRead, profile: Option<&Profile>, pot: f64, bet: f64) -> Option<(Tree, Strategy)> {
|
||||
let tree = if read.tilt != 0.0 {
|
||||
let pct = range_percentiles(spot, villain_combos);
|
||||
let weights = read.reweigh(&pct.iter().map(|p| (1.0, *p)).collect::<Vec<_>>());
|
||||
let (tree, ladder) = river_tree_weighted(spot, villain_combos, villain_combos, Some(&weights), pot, bet)?;
|
||||
if ladder != game.ladder {
|
||||
return None;
|
||||
}
|
||||
tree
|
||||
} else {
|
||||
game.tree.clone()
|
||||
};
|
||||
let gto_bluff = if pot + bet > 0.0 { bet / (pot + bet) } else { 0.0 };
|
||||
if gto_bluff <= 0.0 {
|
||||
return None;
|
||||
}
|
||||
let share = read.bluff_share(2, if pot > 0.0 { bet / pot } else { 0.0 });
|
||||
let believed = Profile { fold_to_bet: read.fold_to_bet(2).or(profile.and_then(|p| p.fold_to_bet)), ..profile.copied().unwrap_or_default() };
|
||||
let opponent = believed_villain(&tree, game.ladder.len(), Some(&believed), pot, bet, Some(aggression_for_share(share, gto_bluff)));
|
||||
Some((tree, opponent))
|
||||
}
|
||||
|
||||
/// The KL trust radius from the read's confidence (payoff/chip units). `λ = LAMBDA_POT_SCALE · pot ·
|
||||
/// (1−c)/c`: no confidence (`None`/0) → `∞` → `kl_best_response` returns exact GTO (the proven
|
||||
/// unexploitable baseline — it can never again balance against a fish it cannot read); confidence → 1
|
||||
@@ -339,7 +414,12 @@ pub fn river_exploit_plan(spot: &Spot, villain_combos: &[Vec<Card>], profile: Op
|
||||
}
|
||||
// Only exploit on a read strong enough to trust; otherwise the heuristic keeps the edge.
|
||||
// The gearbox exploits a belief about BLUFFING: trust it only as far as the aggression read goes.
|
||||
let confidence = profile.and_then(Profile::bluff_read_confidence);
|
||||
// With the read layer on (GEGNER_RANGE=1), its own bluff trust (shown river bets count too).
|
||||
let read = if range_read::on() { RangeRead::from_profile(profile) } else { None };
|
||||
let confidence = match &read {
|
||||
Some(r) => Some(r.trust(true, 2)),
|
||||
None => profile.and_then(Profile::bluff_read_confidence),
|
||||
};
|
||||
if confidence.unwrap_or(0.0) < CONFIDENCE_FLOOR {
|
||||
return None;
|
||||
}
|
||||
@@ -358,9 +438,14 @@ pub fn river_exploit_plan(spot: &Spot, villain_combos: &[Vec<Card>], profile: Op
|
||||
|
||||
let game = subgame(spot, villain_combos, villain_combos, pot, bet)?;
|
||||
let n = game.ladder.len();
|
||||
let opponent = believed_villain(&game.tree, n, profile, pot, bet, river_bluff_aggression(profile, pot, bet));
|
||||
let lambda = lambda_from_confidence(confidence, pot);
|
||||
let tilted = kl_best_response(&game.tree, &opponent, &game.solved.strategy, 0, lambda);
|
||||
let tilted = match read.as_ref().and_then(|r| read_belief(spot, &game, villain_combos, r, profile, pot, bet)) {
|
||||
Some((tree, opponent)) => kl_best_response(&tree, &opponent, &game.solved.strategy, 0, lambda),
|
||||
None => {
|
||||
let opponent = believed_villain(&game.tree, n, profile, pot, bet, river_bluff_aggression(profile, pot, bet));
|
||||
kl_best_response(&game.tree, &opponent, &game.solved.strategy, 0, lambda)
|
||||
}
|
||||
};
|
||||
let hb = game.bucket(hero_strength);
|
||||
|
||||
// Node 0 "hero" [check, bet] when first to act; node 4 "hero_vs_bet" [fold, call] facing a bet.
|
||||
@@ -1039,6 +1124,34 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
/// The read layer (`GEGNER_RANGE`): a looser range (tilt < 0) and more believed air both make
|
||||
/// hero call a bluff-catcher more; the tilt keeps the ladder, and a population read with no
|
||||
/// shown bets leaves the believed fold-to-bet as read.
|
||||
#[test]
|
||||
fn the_read_layer_tilts_the_range_and_locks_the_believed_bettor() {
|
||||
let board = Card::parse_list("Ah Kd 7c 2s 9h").unwrap();
|
||||
let villain = sample_villain();
|
||||
let spot = river_vs_bet(&board, "Jc Js", 6.0, 6.0, None);
|
||||
let game = subgame(&spot, &villain, &villain, 6.0, 6.0).unwrap();
|
||||
let hb = game.bucket(judge(&spot.rules(), &spot.hero_cards, &board).unwrap());
|
||||
let call = |p: Profile| {
|
||||
let r = RangeRead::from_profile(Some(&p)).unwrap();
|
||||
let (tree, opp) = read_belief(&spot, &game, &villain, &r, Some(&p), 6.0, 6.0).unwrap();
|
||||
let lambda = lambda_from_confidence(Some(r.trust(true, 2)), 6.0);
|
||||
kl_best_response(&tree, &opp, &game.solved.strategy, 0, lambda).row(4, hb)[1]
|
||||
};
|
||||
let base = Profile { vpip: Some(0.28), ..prof(0.45, 0.35, 0.85) };
|
||||
let loose = call(Profile { vpip: Some(0.84), ..base });
|
||||
let tight = call(Profile { vpip: Some(0.10), ..base });
|
||||
assert!(loose > tight, "a looser range is called more: {loose:.3} vs {tight:.3}");
|
||||
let bluffer = call(Profile { river_aggression: Some(0.9), ..base });
|
||||
let honest = call(Profile { river_aggression: Some(0.03), ..base });
|
||||
assert!(bluffer > honest, "more believed air is called more: {bluffer:.3} vs {honest:.3}");
|
||||
let pct = range_percentiles(&spot, &villain);
|
||||
assert!(pct.iter().all(|p| (0.0..=1.0).contains(p)));
|
||||
assert!(pct[0] > pct[5], "AJ (aces) above 54 (nothing)");
|
||||
}
|
||||
|
||||
/// The veto never touches hero's offense: a base that is not a call is returned unchanged even
|
||||
/// though a plan exists (guards against the −43/−48 full-replacement regression returning).
|
||||
#[test]
|
||||
|
||||
@@ -50,6 +50,13 @@ pub struct RangeRead {
|
||||
pub bluff_confidence: f64,
|
||||
}
|
||||
|
||||
/// Measurement switch (read once): `GEGNER_RANGE=1` lets the river gearbox (`engine::river_subgame`)
|
||||
/// apply the read layer. Default off: bit-identical to before.
|
||||
pub fn on() -> bool {
|
||||
static ON: std::sync::OnceLock<bool> = std::sync::OnceLock::new();
|
||||
*ON.get_or_init(|| std::env::var("GEGNER_RANGE").as_deref() == Ok("1"))
|
||||
}
|
||||
|
||||
fn ok(x: Option<f64>) -> Option<f64> {
|
||||
x.filter(|v| v.is_finite())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user