SOLVER3_FOHNE, SOLVER3_TOHNE, SOLVER3_FSPERRE (aus, live bitgleich); drei.py DREI_FENSTER; drei_kipp.py Mischarme. Pflicht 39/44, Latenz max 1215 ms, Faustregel 97->78. Bericht messung/solver_kern/STUFE4B.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
90 lines
6.2 KiB
Rust
90 lines
6.2 KiB
Rust
//! The track switches every bench binary reads from the environment (`ab_zelle`, `nemesis`), in one
|
|
//! place so a leak finder runs the same engine as the ladder. Identity when no switch is set.
|
|
|
|
/// Read the track switches from the environment and set them (see each line).
|
|
pub fn apply_env() {
|
|
// HERO=gto: the balanced bot plays hero's seat (engine-vs-bot comparison on the same deals).
|
|
crate::sim::table::set_hero_gto(std::env::var("HERO").as_deref() == Ok("gto"));
|
|
// SIM_RAKE=mikro: the whole ladder at the live micro table (5 %, cap 10 bb, preflop raked; the
|
|
// rake leaves the table). `RAKE_LIVE=1` (read by the engine itself) prices it in the decisions.
|
|
crate::sim::session::set_ladder_rake(std::env::var("SIM_RAKE").as_deref() == Ok("mikro"));
|
|
// SIM_RIVERCALL=1: die Sim-Gegner antworten auf den ersten River-Einsatz mit der an PHH geeichten
|
|
// groessenabhaengigen Call-Range (`sim::rivercall`); nur die Gegner aendern sich.
|
|
crate::sim::rivercall::set_enabled(std::env::var("SIM_RIVERCALL").as_deref() == Ok("1"));
|
|
// SIM_POOLRUF=1|alle: die Pool-Personas (1) bzw. alle lesenden Gegner (alle) antworten auf Einsaetze nach
|
|
// Handklasse, an echten NL2-Haenden geeicht (`sim::poolruf`); nur die Gegner aendern sich.
|
|
crate::sim::poolruf::set_mode(std::env::var("SIM_POOLRUF").ok().as_deref());
|
|
// RIVER_SD=1: the river showdown read (world memory) into the session read (arm).
|
|
crate::sim::memory::set_river_showdown(std::env::var("RIVER_SD").as_deref() == Ok("1"));
|
|
// LESEN_DRAHT=hud|gezaehlt: the Memory read through the live wire's shrink, with the samples live had
|
|
// before counted reads (hud) or the true counts (gezaehlt) — plan D1b, `sim::memory::WireRead`.
|
|
{
|
|
use crate::sim::memory::{set_wire_read, WireRead};
|
|
set_wire_read(match std::env::var("LESEN_DRAHT").as_deref() {
|
|
// raise = GEGNER_ZAEHLUNG=raise: the HUD samples of today plus the counted raiseToBet/reraiseToRaise
|
|
// (exactly `hud`); live = today without them.
|
|
Ok("hud") | Ok("live") | Ok("raise") | Ok("gedaechtnis") => WireRead::Hud,
|
|
Ok("gezaehlt") => WireRead::Counted,
|
|
_ => WireRead::Off,
|
|
});
|
|
crate::sim::memory::set_wire_without_counted(std::env::var("LESEN_DRAHT").as_deref() == Ok("live"));
|
|
crate::sim::memory::set_wire_memory_fold(std::env::var("LESEN_DRAHT").as_deref() == Ok("gedaechtnis"));
|
|
}
|
|
// GEDAECHTNIS_FOLD=a,b: foldToBet as the memory handover decodes it (plan D2), only with LESEN_DRAHT=gezaehlt.
|
|
// LESEN_DRAHT=gedaechtnis ohne GEDAECHTNIS_FOLD: der Kern-Anker, den live die Uebergabe ohne bestandenes
|
|
// D2-Tor bekommt (0,45 bei 30 Chancen, `wire::decode_villain`).
|
|
crate::sim::memory::set_fold_prior(std::env::var("GEDAECHTNIS_FOLD").ok().and_then(|v| {
|
|
let mut it = v.split(',').map(|x| x.trim().parse::<f64>().ok());
|
|
Some((it.next()??, it.next()??))
|
|
}).or_else(|| (std::env::var("LESEN_DRAHT").as_deref() == Ok("gedaechtnis")).then_some((13.5, 16.5))));
|
|
// READS=cbet,3bet,xr: the line-specific HUD reads (fold to c-bet / fold to 3-bet / check-raise).
|
|
use crate::sim::memory::{set_line_reads, READ_CBET, READ_CHECK_RAISE, READ_THREE_BET};
|
|
let reads = std::env::var("READS").unwrap_or_default();
|
|
let mask = reads.split(',').fold(0u8, |m, r| match r.trim() {
|
|
"cbet" => m | READ_CBET,
|
|
"3bet" => m | READ_THREE_BET,
|
|
"xr" => m | READ_CHECK_RAISE,
|
|
_ => m,
|
|
});
|
|
set_line_reads(mask);
|
|
// RAISE_MODEL=1: the check-raise in the tree of a bet into a check (`engine::bluff`).
|
|
crate::engine::bluff::set_raise_model(std::env::var("RAISE_MODEL").as_deref() == Ok("1"));
|
|
// RIVER_DBR=1: the data-biased robust river counter-strategy (`engine::river_subgame::dbr_decision`).
|
|
{
|
|
use crate::engine::river_subgame::{set_river_player, RiverPlayer};
|
|
set_river_player(match std::env::var("RIVER_DBR").as_deref() {
|
|
Ok("1") => RiverPlayer::Dbr,
|
|
Ok("nash") => RiverPlayer::Nash,
|
|
Ok("spiel") => RiverPlayer::Game,
|
|
Ok("grund") => RiverPlayer::Grund,
|
|
_ => RiverPlayer::Off,
|
|
});
|
|
// TURN_SPIEL=grund: the turn+river game with both ranges from the blueprint (plan E3,
|
|
// `engine::turn_game`), only where the blueprint recognises the spot. Needs GRUNDSTRATEGIE like
|
|
// RIVER_DBR=grund. Size/budget: TURN_COMBOS, TURN_CARDS, TURN_ITERS (defaults in `TurnConfig`).
|
|
// SOLVER_RIVER=1|modell (stage A, solver everywhere): `engine::river_spieler`.
|
|
crate::engine::river_spieler::set_river_spieler(crate::engine::river_spieler::from_env());
|
|
crate::engine::turn_game::set_turn_ueberall(crate::engine::turn_game::turn_ueberall_from_env());
|
|
crate::engine::flop_spieler::set_flop_spieler(crate::engine::flop_spieler::from_env());
|
|
crate::engine::river3_spieler::set_river3(crate::engine::river3_spieler::from_env());
|
|
let (turn3, flop3) = crate::engine::multi3_spieler::from_env();
|
|
crate::engine::multi3_spieler::set_turn3(turn3);
|
|
crate::engine::multi3_spieler::set_flop3(flop3);
|
|
let (nur_offen, ohne) = crate::engine::multi3_spieler::lage_from_env();
|
|
crate::engine::multi3_spieler::set_lage(nur_offen, ohne);
|
|
crate::engine::multi3_spieler::ohne_from_env();
|
|
use crate::engine::turn_game::{set_turn_player, TurnPlayer};
|
|
let turn_grund = std::env::var("TURN_SPIEL").as_deref() == Ok("grund");
|
|
set_turn_player(if turn_grund { TurnPlayer::Grund } else { TurnPlayer::Off });
|
|
// The blueprint arm waits until the blueprint run has finished (its FERTIG marker), so a
|
|
// queued arm never reads a half-trained checkpoint; then loads it once.
|
|
if turn_grund || std::env::var("RIVER_DBR").as_deref() == Ok("grund") {
|
|
let dir = std::path::PathBuf::from(std::env::var_os("GRUNDSTRATEGIE").expect("RIVER_DBR=grund / TURN_SPIEL=grund needs GRUNDSTRATEGIE"));
|
|
while !dir.join("grundstrategie").join("FERTIG").exists() {
|
|
std::thread::sleep(std::time::Duration::from_secs(60));
|
|
}
|
|
assert!(crate::blueprint::ranges::grundstrategie().is_some(), "blueprint did not load from {dir:?}");
|
|
}
|
|
}
|
|
}
|