Five things pokersolver does that its README does not mention - #99
Merged
Conversation
We wrap pokersolver and hit five undocumented behaviours building the wrapper. Four of them are open questions on the library's own tracker, unanswered for three to six years. This documents them with the input that produces each one. The sharpest is stronger than an omission: the README documents toString() as "maximum of 5 cards", and a seven-card flush returns seven. Verified against the installed 2.1.4, not read off the source. Every published row lives in src/config/pokersolverQuirks.ts and is re-run against the installed library by tests/pokersolverQuirks.test.ts, so a version bump that changes a behaviour fails the build instead of leaving the post wrong at a permanent URL. That test is also the guard bestFive() has never had: it asserts the overflow, the low ace and the ordering in a doc comment, and a comment about a dependency is checked by nobody (technology#78).
Deploying pip-web with
|
| Latest commit: |
df7b023
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c578c411.pip-web-9oj.pages.dev |
| Branch Preview URL: | https://post-pokersolver-undocumente.pip-web-9oj.pages.dev |
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.
A new blog post at
/blog/pokersolver-undocumented, plus the test that keeps it true.What it is
We wrap
pokersolverinsrc/lib/poker/handEval.tsand hit five of its behaviours that the README does not mention. Four of them are open questions on the library's own tracker, unanswered for between three and six years. This is one page documenting them, each with the exactHand.solvecall that produces it.Every case was produced by running the installed
pokersolver@2.1.4, not read off the source.The one that is a contradiction rather than an omission
The README documents
toString()as "Returns a formatted string of all cards involved in the identified hand type (maximum of 5 cards)."Seven. The other four are omissions: the six-card full house, the low ace rewritten to
'1', the overflow ordering, and a royal flush whosenameis"Straight Flush".It is also the guard
handEval.tshas never hadbestFive()asserts three of these behaviours (the overflow, the low ace, and that the hand-making cards stay first soslice(0, 5)is correct) in a doc comment. Nothing in the build checked it, and a minor version changing any of them would break every showdown silently. That istechnology#78.tests/pokersolverQuirks.test.tsnow runs all seven published cases against the installed library, checks the README sentence is still the one the post quotes, and exercises the threebestFiveclaims through our own wrapper. So the post and the guard are the same work: if the library moves, the build fails before the page lies.The published outputs are typed out by hand in
src/config/pokersolverQuirks.tsrather than derived at render time, same rule asdailyProof.ts(a value read out of the library can never disagree with it and therefore proves nothing).Gate
pnpm test:allgreen (515 tests, +12 new).pnpm buildclean, 22 markdown mirrors. biome-formatted.Merge order
This is the least urgent of the open PRs and should go last. #96 is the one that matters and carries the fix for a price claim that is false and live right now. #97 is the roundup and is dated 1 September.