Skip to content

Add per-position and per-stack stats in chips and chipEV - #15

Merged
grenkoff merged 1 commit into
mainfrom
feature/position-stack-chipev-stats
Jun 16, 2026
Merged

grenkoff merged 1 commit into
mainfrom
feature/position-stack-chipev-stats

Conversation

@grenkoff

Copy link
Copy Markdown
Owner

Summary

Adds dashboard breakdowns of hero results by position (UTG/HJ/CO/BTN/SB/BB) and by effective
stack
— to surface where in a tournament the user earns most/least — in two units:

  • chips — actual net result;
  • chipEV — all-in-adjusted result ("All-In EV"): in 2-player all-in showdowns the runout is
    replaced by equity * pot - invested, stripping variance.

(Supersedes #14, which GitHub auto-closed when its base branch was deleted on the #13 merge.)

Changes

  • Rust chipEV engine (crates/hh-parser/src/equity.rs): self-contained 7-card evaluator +
    seeded SplitMix64 Monte-Carlo (preflop) / exhaustive enumeration (flop+). Deterministic, no new
    deps. Parser sets chip_ev per player (= result outside qualifying all-in showdowns).
  • Migration 0004_chip_ev.sql; chip_ev threaded through mapping (both paths), HandPlayer,
    TABLE_COLUMNS, and exposed via PyO3.
  • overview() gains by_position and result_ev on each bucket; new PositionBucket model.
  • New MetricByCategory grouped-bar chart (chips/100 vs chipEV/100, totals/hands/winrate tooltip);
    two dashboard cards (by position, by effective stack).

v1 limitation

chipEV adjusts only 2-player all-in showdowns with both hole cards known. Multiway/side-pot
all-ins and unknown cards keep the actual result.

Verification

  • cargo test (16 passed: AA vs KK ~82%, zero-sum, uncalled all-in == result).
  • uv run pytest (38 passed), ruff + mypy clean; frontend typecheck + lint clean.
  • Backfilled the dev user (749,902 rows, 47,312 chipEV-adjusted, OPTIMIZE FINAL, no dup inflation).
    Result: BTN best (+1,645 chips/100), BB worst (-737/100); hero +806,500 chips vs +760,657 chipEV.

@grenkoff
grenkoff merged commit 39b8757 into main Jun 16, 2026
3 checks passed
@grenkoff
grenkoff deleted the feature/position-stack-chipev-stats branch June 16, 2026 23:07
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