Skip to content

fix(cfr): fall back to Call when preflop chart prescribes raise but cap is reached#271

Merged
elliottneilclark merged 1 commit intomasterfrom
elliott/fix_preflop_bet_capped
Apr 16, 2026
Merged

fix(cfr): fall back to Call when preflop chart prescribes raise but cap is reached#271
elliottneilclark merged 1 commit intomasterfrom
elliott/fix_preflop_bet_capped

Conversation

@elliottneilclark
Copy link
Copy Markdown
Owner

When max_raises_per_round (default 3) was reached during preflop,
PreflopChartActionGenerator::convert_preflop_action still emitted a
Bet(three_bet_amount) for chart entries marked Raise/ThreeBet/FourBet.
The downstream validate_actions pipeline (introduced in 598ebb5) then
stripped this bet via filter_raises_when_capped, leaving an empty
action set. ActionPicker::pick_action subsequently panicked with
"cannot sample empty range" inside rng.random_range(0..0).

The fix checks game_state.is_raise_capped() in convert_preflop_action
and returns AgentAction::Call for any raise-type chart action when the
cap is reached. This preserves the chart's intent — the hand is playable
— while respecting the raise limit so the agent calls to see the flop
instead of producing an action that gets filtered into an empty set.

…ap is reached

When `max_raises_per_round` (default 3) was reached during preflop,
`PreflopChartActionGenerator::convert_preflop_action` still emitted a
`Bet(three_bet_amount)` for chart entries marked Raise/ThreeBet/FourBet.
The downstream `validate_actions` pipeline (introduced in 598ebb5) then
stripped this bet via `filter_raises_when_capped`, leaving an empty
action set. `ActionPicker::pick_action` subsequently panicked with
"cannot sample empty range" inside `rng.random_range(0..0)`.

The fix checks `game_state.is_raise_capped()` in `convert_preflop_action`
and returns `AgentAction::Call` for any raise-type chart action when the
cap is reached. This preserves the chart's intent — the hand is playable
— while respecting the raise limit so the agent calls to see the flop
instead of producing an action that gets filtered into an empty set.
@elliottneilclark elliottneilclark merged commit ccb012a into master Apr 16, 2026
2 checks passed
@elliottneilclark elliottneilclark deleted the elliott/fix_preflop_bet_capped branch April 16, 2026 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant