Offer bet sizes the table's chips can actually make #95

Closed
jheaps wants to merge 1 commits from fix/casino-holdem-buildable-bet-sizes into fix/casino-holdem-pot-sized-raise
Owner

A loose end I left in #94, chased down.

Half the pot lands on a half chip constantly. Pre-flop at 1/2 the honest half-pot is $4.50, and the smallest chip in the default legend is a dollar — the tool's own chip breakdown calls that "4×$1, $0.50 no chip covers". The button offered it anyway, so the dealer rounded it themselves every single time.

What changed

The pot-derived quick amounts round up to something the table can build. Up, not down or nearest: these are bet sizes, a pot-sized bet that has been shaved is no longer a pot-sized bet, and rounding up cannot drop an amount below a legal minimum the way rounding the other way can.

Only when the legend describes this game. A smallest chip larger than the big blind means the denominations were never set for these stakes, and rounding a 5c/10c table up to whole dollars would be the tool doing real damage on the strength of a field somebody forgot to fill in. Those tables keep exact amounts and the wrong legend stays visible rather than being quietly applied. A table with no legend at all has been told nothing about chips, so nothing is applied there either.

The minimum raise is deliberately not rounded. It is what the rules require, and moving it to suit the chip tray would change what is legal rather than what is convenient.

Verification

7 new tests added to tests/holdem/potRaise.test.js — rounding up rather than down, amounts already whole left exactly alone, a cent table keeping its cents, the stale-legend and no-legend guards, and a sweep of five fractions checking each comes out buildable, never shaved, and never rounded by as much as a whole chip. Suite at 387 tests, 0 failures.

Playwright MCP across five table configurations:

table Min ½ pot Pot buildable
$1 chips at 1/2 $4 $5 $7 yes
cent chips at 5c/10c $0.20 $0.23 $0.35 yes
$5 chips at 5/10 $20 $25 $35 yes
$1 chips on a 5c/10c game $0.20 $0.23 $0.35 left exact — guard fires
no legend $4 $4.50 $7 left exact — nothing to apply

Contrast and layout audit clean, no console errors.

Stacked on fix/casino-holdem-pot-sized-raise.

🤖 Generated with Claude Code

https://claude.ai/code/session_015bnp7xKUPFFSpwkYNFaPgb

A loose end I left in #94, chased down. Half the pot lands on a half chip constantly. Pre-flop at 1/2 the honest half-pot is **$4.50**, and the smallest chip in the default legend is a dollar — the tool's own chip breakdown calls that *"4×$1, $0.50 no chip covers"*. The button offered it anyway, so the dealer rounded it themselves every single time. **What changed** The pot-derived quick amounts round up to something the table can build. **Up**, not down or nearest: these are bet sizes, a pot-sized bet that has been shaved is no longer a pot-sized bet, and rounding up cannot drop an amount below a legal minimum the way rounding the other way can. Only when the legend describes this game. A smallest chip *larger than the big blind* means the denominations were never set for these stakes, and rounding a 5c/10c table up to whole dollars would be the tool doing real damage on the strength of a field somebody forgot to fill in. Those tables keep exact amounts and the wrong legend stays visible rather than being quietly applied. A table with no legend at all has been told nothing about chips, so nothing is applied there either. The **minimum raise is deliberately not rounded**. It is what the rules require, and moving it to suit the chip tray would change what is legal rather than what is convenient. **Verification** 7 new tests added to `tests/holdem/potRaise.test.js` — rounding up rather than down, amounts already whole left exactly alone, a cent table keeping its cents, the stale-legend and no-legend guards, and a sweep of five fractions checking each comes out buildable, never shaved, and never rounded by as much as a whole chip. Suite at 387 tests, 0 failures. Playwright MCP across five table configurations: | table | Min | ½ pot | Pot | buildable | |---|---|---|---|---| | $1 chips at 1/2 | $4 | **$5** | $7 | yes | | cent chips at 5c/10c | $0.20 | $0.23 | $0.35 | yes | | $5 chips at 5/10 | $20 | **$25** | $35 | yes | | $1 chips on a 5c/10c game | $0.20 | $0.23 | $0.35 | left exact — guard fires | | no legend | $4 | $4.50 | $7 | left exact — nothing to apply | Contrast and layout audit clean, no console errors. Stacked on `fix/casino-holdem-pot-sized-raise`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_015bnp7xKUPFFSpwkYNFaPgb
jheaps added 1 commit 2026-09-02 00:05:55 -06:00
Half the pot lands on a half chip constantly. Pre-flop at 1/2 the honest half-pot is
$4.50, and the smallest chip in the default legend is a dollar — the tool's own chip
breakdown calls it "4×$1, $0.50 no chip covers". The button offered it anyway, so the
dealer rounded it themselves every single time.

The pot-derived quick amounts now round up to something the table can build. Up, not
down or nearest: these are bet sizes, a pot-sized bet that has been shaved is no
longer a pot-sized bet, and rounding up cannot drop an amount below a legal minimum
the way rounding the other way can.

Only when the legend describes this game. A smallest chip larger than the big blind
means the denominations were never set for these stakes, and rounding a 5c/10c table
up to whole dollars would be the tool doing real damage on the strength of a field
somebody forgot to fill in. Those tables keep exact amounts, and the wrong legend
stays visible rather than being quietly applied. A table with no legend at all is
told nothing about chips and so has nothing applied either.

Verified across five tables: default dollar chips at 1/2 give $4/$5/$7, cent chips at
5c/10c keep $0.20/$0.23/$0.35, five-dollar chips at 5/10 give $20/$25/$35, and both
the stale-legend and no-legend tables are left exact.

The minimum raise is deliberately not rounded. It is what the rules require, and
moving it to suit the chip tray would change what is legal rather than what is
convenient.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015bnp7xKUPFFSpwkYNFaPgb
jheaps closed this pull request 2026-09-02 09:58:02 -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#95