poker-flopsolve 0.4.1 → 0.5.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,143 @@
1
+ # Changelog
2
+
3
+ ## 0.5.0-beta.1
4
+
5
+ The second beta of 0.5.0 (`npm install poker-flopsolve@beta`): everything since 0.5.0-beta.0.
6
+
7
+ ### Lite: compress the ranges first (issue #156)
8
+
9
+ - `solveLite` and `liteConfig` take `compressRanges` (off by default): before the blueprint is
10
+ solved, each range keeps the fewest of its combinations, re-weighted, whose equity
11
+ distributions on this flop's boards stay within a tolerance (default 0.01) of the full
12
+ range's. `compressRanges(spot)` does the same on its own.
13
+ - For wide ranges. A button open against a big-blind call (433–518 combinations a side) on 4
14
+ threads settled in 40.6 s against 87.6 on As Kh 7d, 31.2 against 62.1 on Ts 9s 4h and 16.5
15
+ against 27.3 on Ks 9s 4s, in 0.42–0.72× the storage, with the root play 1.2–2.7 points from
16
+ Lite's on the full ranges, where two Lite solves of the full ranges were 1.8–3.0 apart.
17
+ - On narrow ranges it gains little and can lose. The bench ranges, about 200 combinations a side:
18
+ As Kh 7d settled in 16.0 s against 21.5 (135 MiB against 173), Ts 9s 4h in 8.6 against 12.7 (91 against 122), and Ks 9s 4s in 7.8 against 6.6 (57 against 47). Dropping combinations breaks the
19
+ symmetries that fold boards together.
20
+ - It keeps how the range plays, not what one combination does: the blueprint and its re-solves
21
+ hold a strategy only for the combinations kept.
22
+ - The compressor is poker-rangecompress, vendored as `src/vendor/range-compress.js` (JavaScript
23
+ with its WebAssembly kernels embedded; the package still has no dependencies). It adds about
24
+ 60 kB to the bundle, before minifying.
25
+
26
+ ### Lite's exploitability in the full game (issue #154)
27
+
28
+ - `exploitabilityInExact(lite, exact)` measures how exploitable a Lite solve's play is in
29
+ the caller's full game. It copies Lite's strategy onto a run of the full spot wherever
30
+ Lite has the decision, keeps that run's own play below the sizes and raises Lite cut, and
31
+ returns the exploitability as a % of the pot.
32
+ - The benchmark page's Accuracy box, after a Lite solve, offers "Measure against Exact"
33
+ when the full game fits in the memory left beside it. It solves Exact to the form's
34
+ target and shows Lite's exploitability with Exact's own beside it.
35
+
36
+ ### Faster: engine threads share out boards (issue #133)
37
+
38
+ - On the WebAssembly engine, threads take the split round's boards off a shared queue,
39
+ costliest first, instead of fixed slices. `solveLite` on As Kh 7d settled about 15% sooner
40
+ on 2 and 4 threads in headless Chromium (57.9 → 49.3 s, 33.7 → 28.1 s), turn re-solves
41
+ 12–19% sooner; the slowest thread now walks within 1% of the mean, from about 13%.
42
+ - A threaded solve on the WebAssembly engine is now bitwise the same at every thread count
43
+ from two up, not only at a fixed count. One thread still agrees with it only to floating
44
+ point, as before.
45
+ - `npm run bench:lite` (issue #133) times `solveLite` phase by phase in any browser, at each
46
+ thread count, and reports each thread's walking time.
47
+
48
+ ### Changed: EV is a percentage of the pot (issue #130) — breaking
49
+
50
+ - `Solution.ev(player)` and `Solution.handEvs(player)` now report the player's **share of the
51
+ pot, in percent**, instead of chips against a half-pot baseline. Folding (or losing every
52
+ showdown) is 0%, winning the pot uncontested is 100%, and `ev(0) + ev(1)` is 100. On Ks 9d 4c
53
+ with a 60 pot, `12.5 / −12.5` chips now reads `70.8 / 29.2`%.
54
+ - The pot is the spot's starting pot (`SpotConfig.pot`), exposed as `Solution.evPot`. Convert
55
+ back with **old chips = `pct / 100 × pot − pot / 2`**, or read `Solution.evChips(player)`
56
+ and `Solution.handEvsChips(player)`, which return the old numbers.
57
+ - New `SpotConfig.evPot` (default `pot`). `Solution.subgameAt` sets it to the original spot's,
58
+ so `resolveSubgame` and `LiteSolution.resolve` (nested too) report in % of the **original
59
+ flop pot**: values read the same way down a hand, and folding at a subgame's root reads below
60
+ 0 (the chips put in on earlier streets). For those, convert with the flop pot, `evPot`.
61
+ - Applies to the presets' solutions (`solveLite`, `largeTree`), subgame solutions, the CLI and
62
+ the UI readout, which now show `%`.
63
+ - Unchanged, still chips on the half-pot baseline: `Solver.valuesAt`, `pairValuesAt`,
64
+ `rootValues`, `handEvs` on the `Solver`, regrets, `ResolvedSubgame.alternative` / `entered`,
65
+ and `exploitability()` (`exploitabilityPercent()` stays % of the spot's own pot).
66
+ - napkinpoker: `tools/bench/flopsolve/flop-vs-pfrs.mjs` reads `ev()` and needs `evChips()` to
67
+ keep its chip numbers, or a `%` label; `src/villain/flopsolve-villain.js` reads `valuesAt`,
68
+ which is unchanged.
69
+
70
+ ## 0.5.0-beta.0
71
+
72
+ The first beta of 0.5.0, published under npm's `beta` tag (`npm install poker-flopsolve@beta`); `latest` stays 0.4.1 until 0.5.0. A minor release. Every approximation below is opt-in and off by default. The README's
73
+ [Choosing an approximation](README.md#choosing-an-approximation) maps goals to presets, and its
74
+ [options inventory](README.md#options-inventory) gives each option's status and measured cost.
75
+
76
+ ### Presets (issue #115)
77
+
78
+ - `solveLite` / `litePreset` (#100): the flop as given, one turn and river size, shared river
79
+ storage, runout buckets, sampling, a stop on the root play, and turn re-solves on demand.
80
+ - `largeTree` (#102, in `poker-flopsolve/wasm-storage`): `thinSizes`, 16-bit storage on the
81
+ WebAssembly engine and sampling. The round's target tree, 17.2 GiB at 32 bits, fits in 1.97 GiB.
82
+ - Both report what they changed: `LiteSolution.changes`, `LitePreset.changes` and
83
+ `LargeTree.changes` list the sizes cut by street and player, the rounds simplified, and every
84
+ setting set or dropped (#115).
85
+ - `litePreset` (#115) returns what `solveLite` solves, without solving it, for a page that steps its
86
+ own run.
87
+ - `keepBudget` on `solveLite` / `litePreset` (#113): keep the most-reached flop lines unshared within
88
+ a storage budget, ranked on a short solve of the blueprint with its river checked down
89
+ (`checkedDown`, `keepWithin`); `LiteSolution.kept` lists them. On issue #47's flops, 150 MiB at 16
90
+ bits cut a turn re-solve's best-response gain by a third to a half, root play unchanged.
91
+ With a budget, `settle`'s tolerance defaults to 0.005, not 0.01 (#123): the kept lines' turn
92
+ ranges go on improving after the root play settles, and stopping later cut the re-solve gain by
93
+ 15–28% more for out of position (3–34% in position) for 16–32% more time on 4 threads.
94
+
95
+ ### New opt-ins since 0.4.1
96
+
97
+ Spot settings (`SpotConfig`):
98
+ - `shareHistories`: one river storage for betting lines that meet (#49).
99
+ - `shareHistories.keepLines`, with `linesWithin` and `turnLineReach`: keep the most-reached lines
100
+ unshared within a memory budget (#101).
101
+ - `thinSizes`: one size at most decisions, the shape that adaptive growth found (#51).
102
+ - `removeActions`: cut named bets, raises and shoves from the tree (#51).
103
+ - `compactStorage`: 8-bit regrets and strategy sums (#50).
104
+
105
+ Solve settings (`SolveOptions`):
106
+ - `approximations.chanceSampling`: deals sampled with baselines (#25). It runs on worker threads
107
+ (#99) and over 16-bit storage (#102).
108
+ - `approximations.coarseStart`: start from a bucketed copy of the spot (#24).
109
+ - `approximations.currentProfileEv`, with `Solution.handEvs`: EVs under the current profile (#35).
110
+ - `warmCards`: warm starts between flops (#30).
111
+ - `settle`, with `trackSettle`, `rootPlay`, `rootPlayMovement` and `rootPlayNodes`: stop when the
112
+ root play stops moving (#100).
113
+ - `wasmStorage` (`poker-flopsolve/wasm-storage`): 16-bit and compact storage on the WebAssembly
114
+ engine, threads included (#84).
115
+
116
+ Re-solving and threads:
117
+ - `resolveSubgame`: re-solve a node's subgame at new betting (#47).
118
+ - `poker-flopsolve/threads`, with `enableThreads`: worker threads in the browser (#29).
119
+
120
+ ### Removed before release (#125)
121
+
122
+ These were added during 0.5.0's development, measured as dead ends in #115, and removed before the
123
+ release, so no published version has them. Their numbers are in
124
+ [docs/APPROXIMATIONS.md](docs/APPROXIMATIONS.md#removed-before-050-125).
125
+
126
+ - `SpotConfig.lineRunouts` (#53): more costly than the presets, JavaScript only, and it refused
127
+ sharing, compact storage, sampling and coarse starts. Use `largeTree` or `thinSizes`.
128
+ `Spot.resolveBoard` lost its `node` argument with it.
129
+ - `ShareHistories.spr`, `.fromRound` and `.weighting` (#49): measured lossier than they save.
130
+ Sharing covers the river alone, exact meetings, weighted by reach.
131
+ - `ResolveOptions.gadget` and `.values`, the `Gadget` type and `ResolvedSubgame.gadget` / `.gifts`
132
+ (#47): the safe gadgets measured worse than plain re-solving. `measure: true` still reports
133
+ `alternative` and `entered`.
134
+
135
+ ### Documentation
136
+
137
+ - The README opens its performance part with a goal table and an options inventory. The per-option
138
+ sections are an appendix.
139
+ - The record of approximations measured and left out moved from the `Approximations` type to
140
+ [docs/APPROXIMATIONS.md](docs/APPROXIMATIONS.md) (#115).
141
+ - Both presets are in the options pair matrix and scored against napkinpoker's reference solves in
142
+ `npm test` (#103, #115). Those fixtures moved to the private napkinpoker repository (#119); the
143
+ scoring test skips where they are absent.