fix(ai): the bots checked the flop round multiway, and nothing measured it - #98
Merged
Merged
Conversation
…ed it Every postflop gate in the policy was an absolute equity number written for a heads-up pot. An equity point is not the same size against three opponents as against one, so multiway the gates were unreachable: measured on a loose profile the AI led an unbet pot 21% of the time heads-up and 7% against two or three. Quoted as a multiple of a fair share of the pot instead. Heads-up a fair share is exactly 0.5, so every multiple reproduces the absolute it replaced and no heads-up pot plays differently. Multiway leading goes to 16% and 23%. Also corrects the WithTheMembership docblock, which said nothing rendered it (technology#75).
Deploying pip-web with
|
| Latest commit: |
96c41a0
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://79c84dda.pip-web-9oj.pages.dev |
| Branch Preview URL: | https://fix-postflop-multiway-bettin.pip-web-9oj.pages.dev |
Contributor
Author
|
Third sim seed finished after I opened this, and it firms the beatability number up.
What it is good enough for is the thing I was actually checking, which is that making the bots bet multiway did not make the beginner table harder. It did not. It still needs you to sit at it, because none of this says whether the table is more fun. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pip-web#2 said the bots do not play like people. Session 24 measured the preflop game and found it was right, twice over. Nothing had ever measured the postflop game, and every band test intests/ai.test.tsstops at the flop being dealt. So I measured it.What was wrong
Every postflop gate in
decideActionis an absolute equity number, and all four were written for a heads-up pot:An equity point is not the same size against three opponents as against one. Heads-up, 0.62 is a decent made hand. Four-handed it is close to the nuts, so multiway the gates are simply unreachable and the AI checks the pot round. This is the identical defect session 24 fixed preflop, one street later: an absolute threshold that the size of the field makes unpayable.
Measured on a loose profile, 80 six-handed hands, counting every postflop decision where the pot was checked to the AI:
And on the shipped venue profiles, 60 hands each:
The loose tables are the ones that go multiway, and they are the ones a beginner meets first. Friends' Garage sees a flop in 85% of hands with 2.5 players still in it. The Main Event sees one in 47% of hands, almost always heads-up. So the defect was concentrated exactly where a new player would be sitting.
The fix, and the reason it can ship without a playtest of 29 tables
The gates are now quoted as a multiple of a fair share of the pot,
1 / (opponents + 1), which is what "ahead of this field" actually means.Heads-up a fair share is exactly 0.5, so every multiple reproduces the absolute it replaced: 0.5 x 1.24 = 0.62, x 1.56 = 0.78, x 1.2 = 0.6, x 0.8 = 0.4. No heads-up pot plays differently. Only multiway spots move, which is where the defect was. A test pins that identity, so moving one of those multiples without realising it changes every table is now a failing build rather than a surprise.
The bluff ceiling was wrong in the other direction and gets the same treatment: four-handed, "under 0.40" is almost every holding, so the AI fired its full bluff frequency with hands that were good for the pot size and called it a bluff.
Does it make the beginner table harder? No, it appears to make it beatable
This is the result I did not expect and the one worth your attention.
pnpm sim garage --n 60 --hero beginner:config/venues.tssays Friends' Garage is "loose-passive on purpose: calls too much, rarely bluffs. A beginner beats it." Before this change a beginner did not beat it. They sat a point below a fair share of the field. Checking every marginal hand down lets the bots realise their equity for free, which is worth more than the chips they were not putting in.Read the numbers with the caveat they deserve: n=60 tournaments, so the standard error on a win rate near 0.4 is about 6 points and a single 10-point gap is not conclusive on its own. What it does rule out is the failure I was actually checking for, which is the table becoming unbeatable. It went the other way.
The gate
pnpm test:allgreen, 505 tests,pnpm buildclean. Two new tests:2 opponents: 7% of unbet pots led (n=280), against 21% heads-up. Verified by stashing the fix and running it. Written as a collected list compared against[]rather than a loop of assertions, and it asserts its own sample size first, because a rate over a handful of spots is not a rate.What the gate did NOT cover
garagewas simulated for difficulty. The other 26 inherit the argument, not a measurement. The heads-up no-op property is what makes that reasonable, since 8 of the 10 ladder rungs play postflop almost entirely heads-up and are therefore untouched by construction.Also in here, one comment:
WithTheMembership's docblock said no paid kind was registered so nothing rendered it. That stopped being true in v1.16.0 and the sentence is serving on playpip.io today (technology#75).