Skip to content

Add Opening (RFI) range viewer alongside push/fold - #3

Merged
testtest126 merged 1 commit into
mainfrom
feature/opening-range-rfi
Jul 19, 2026
Merged

Add Opening (RFI) range viewer alongside push/fold#3
testtest126 merged 1 commit into
mainfrom
feature/opening-range-rfi

Conversation

@testtest126

Copy link
Copy Markdown
Owner

Summary

Adds standard-stack (20–100bb) opening / raise-first-in ranges, as a second mode on the existing "Preflop Ranges" grid — the biggest gap identified in a read-only assessment of the app for a beginner MTT/PKO player: the only existing preflop model was short-stack push/fold (1–20bb), covering a minority of an MTT's actual preflop decisions.

⚠️ Draft — poker content needs your sanity check before this is canon. See "Correctness — please review" below before merging.

  • PokerKit/Sources/PokerKit/OpeningRange.swift — new model, mirrors PushFoldRange.swift's shape exactly (same breakpoint/interpolation pattern, same ChenScore-based hand ranking, reuses PushFoldRange.scoreThreshold(forPercentage:) directly rather than a second hand-ranking system).
  • PreflopGrid.swift — one new function, openingDecisions(position:effectiveStackBB:), alongside the existing decisions(...). No duplication of the 169-hand grid enumeration.
  • PreflopRangeView.swift — a "Push/Fold" / "Opening" segmented control that swaps the model and the stack-slider range (1–20bb vs 20–100bb).
  • StudyTool.swift + README.md — fixed a pre-existing honesty gap: the home-screen summary text promised "opening/3-bet/4-bet ranges" that didn't exist; now accurately describes what's built (opening + push/fold; still no 3-bet/4-bet).
  • Tests: OpeningRangeTests.swift (9 tests) + 2 new tests in PreflopGridTests.swift — AA always opens, ranges widen monotonically by position and as the stack shortens, button > UTG, SB > BTN, the load-bearing "grid matches direct decision" invariant, interpolation/clamping. 94/94 PokerKit tests pass (83 existing + 11 new).

Correctness — please review

Per this repo's own rule (bad poker math is worse than none), the full source basis and every extrapolation is disclosed in ai-docs/RANGES.md, not just asserted. Short version:

  • 100bb column is sourced: PokerCoaching.com's "Implementable GTO Charts" (6-max, mixes removed), cross-verified by fetching it twice independently — UTG 10.1%, LJ 17.6%, HJ 21.4%, CO 27.8%, BTN 43.5%, SB 62.3%.
  • SB is deliberately tightened: a second source (freebetrange.com) put SB at 39–47%, meaningfully lower than the 62.3% GTO figure above. Rather than pick whichever number sounds more authoritative, the shipped table uses 45% — the conservative end — and this is called out explicitly as a disclosed judgment call, not a citation.
  • 40bb column: extrapolated from a single anchor point (UTG ≈13% from a separate source, a +3pt widening vs. the 100bb UTG figure), applied uniformly. Not independently sourced per-position.
  • 20bb column: hand-tuned extrapolation with no direct source (+6pt vs. 100bb), existing mainly so the slider has a smooth floor near where PushFoldRange picks up. Flagged in the doc as the least trustworthy column.

Please specifically sanity-check the SB override and the 40bb/20bb extrapolations — those are the parts I'm least confident in and where your own judgment/experience is worth more than a second web search.

Test plan

  • swift test --package-path PokerKit — 94/94 passing
  • xcodebuild build -scheme Poker (iPhone 16 Pro simulator) — BUILD SUCCEEDED
  • Manual verification in simulator: mode toggle changes the grid/summary/legend, stack slider re-ranges and resets to a sensible default (50bb) on mode switch, BTN selection widens the range as expected (UTG 14% → BTN 50% at 50bb)
  • Owner sanity-check of the range numbers themselves before merge

🤖 Generated with Claude Code

Standard-stack (20-100bb) raise-first-in ranges by position, as a second
mode on the existing Preflop Ranges grid. Mirrors PushFoldRange.swift's
shape and honesty posture — hand-tuned study aid, not solver output — and
reuses ChenScore + PushFoldRange.scoreThreshold rather than introducing a
second hand-ranking system.

The 100bb column is sourced (PokerCoaching's implementable GTO charts,
cross-verified); 40bb/20bb are disclosed extrapolations from a single
anchor point, and SB is deliberately tightened below its cited source
after two references disagreed by a wide margin. Full basis and
uncertainty notes in ai-docs/RANGES.md.

Also fixes the stale "opening/3-bet/4-bet" over-promise in StudyTool's
home-screen summary and README now that opening ranges exist (3-bet/4-bet
still doesn't).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@testtest126
testtest126 marked this pull request as ready for review July 19, 2026 09:26
@testtest126
testtest126 merged commit 1cb49d4 into main Jul 19, 2026
2 checks passed
@testtest126
testtest126 deleted the feature/opening-range-rfi branch July 20, 2026 10:50
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