Stop asking all-in players to act #38

Closed
jheaps wants to merge 0 commits from feature/casino-holdem-allin-runout into master
Owner

Same approach as #37 — checking the engine against how the game actually works, rather than adding to it.

A player who is all-in is still in the hand and still wins pots, but has nothing left to decide. The engine did not know that: it chose the next player to act by walking to whoever was still in the hand, chips or no chips.

So a dealer with three players all-in pre-flop was asked to check for each of them on the flop, the turn and the river — nine taps to say nothing — and mid-street the action could land on someone who had already pushed their last chip in.

Now the action passes over all-in players, and once fewer than two people have chips the betting is over: the bar runs Deal Flop → Turn → River → Showdown straight through, labelled "All-in — running out the board" so the absence of a question reads as deliberate rather than as a stuck screen.

Validation (Playwright, headed)

  • Three shapes checked directly: everyone all-in; one short all-in with a covering player who still has chips (also no betting — it takes two to bet); and a normal hand, which is unaffected and still asks each street.
  • 800 randomised hands, 2–8 seats, random sit-outs and stacks, asserting five invariants: chips conserved, no negative stacks, no hand runs past the river, every hand terminates, and nobody is ever asked to act who is all-in or not in the hand. Zero failures.
  • A hand driven through the real UI: short stack shoves, the other two are still asked in turn, the all-in player is skipped, and the flop then runs out with the note shown.

The stricter invariant is what found the real scope of this. My first fix only covered the street boundary, and the randomised run immediately flagged 12 hands where the action still passed to an all-in player mid-street — there were three places choosing who acts next, not one. Without that assertion I would have shipped a third of the fix.

Branched from master; touches betting.js, actionBar.js and one new CSS rule. Independent of #33–#37 except for a one-line addition to holdem.css.

Same approach as #37 — checking the engine against how the game actually works, rather than adding to it. A player who is all-in is still in the hand and still wins pots, but has **nothing left to decide**. The engine did not know that: it chose the next player to act by walking to whoever was still in the hand, chips or no chips. So a dealer with three players all-in pre-flop was asked to **check for each of them on the flop, the turn and the river — nine taps to say nothing** — and mid-street the action could land on someone who had already pushed their last chip in. Now the action passes over all-in players, and once fewer than two people have chips the betting is over: the bar runs **Deal Flop → Turn → River → Showdown** straight through, labelled *"All-in — running out the board"* so the absence of a question reads as deliberate rather than as a stuck screen. ## Validation (Playwright, headed) - **Three shapes checked directly**: everyone all-in; one short all-in with a covering player who still has chips (also no betting — it takes two to bet); and a normal hand, which is **unaffected** and still asks each street. - **800 randomised hands**, 2–8 seats, random sit-outs and stacks, asserting five invariants: chips conserved, no negative stacks, no hand runs past the river, every hand terminates, and **nobody is ever asked to act who is all-in or not in the hand**. Zero failures. - A hand driven through the real UI: short stack shoves, the other two are still asked in turn, the all-in player is skipped, and the flop then runs out with the note shown. **The stricter invariant is what found the real scope of this.** My first fix only covered the street boundary, and the randomised run immediately flagged 12 hands where the action still passed to an all-in player mid-street — there were three places choosing who acts next, not one. Without that assertion I would have shipped a third of the fix. Branched from `master`; touches `betting.js`, `actionBar.js` and one new CSS rule. Independent of #33–#37 except for a one-line addition to `holdem.css`.
jheaps added 1 commit 2026-09-01 01:37:41 -06:00
A player who is all-in is still in the hand and still wins pots, but has nothing
left to decide. The engine didn't know that: it picked the next player to act by
walking to whoever was still in the hand, chips or no chips.

So a dealer with three players all-in pre-flop was asked to check for each of
them on the flop, the turn and the river — nine taps to say nothing — and the
action could land mid-street on someone who'd already pushed their last chip in.

Now the action passes over players who are all-in, and once fewer than two
people have chips left the betting is simply over: the bar runs Deal Flop, Turn,
River, Showdown straight through, and says "All-in — running out the board" so
the absence of a question reads as deliberate rather than as a stuck screen.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015bnp7xKUPFFSpwkYNFaPgb
jheaps closed this pull request 2026-09-01 02:42:17 -06:00

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jheaps/JoshHeaps.Net#38