poker-flopsolve 0.2.0 → 0.3.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/README.md +21 -9
- package/dist/browser.js +421 -138
- package/dist/browser.js.map +1 -1
- package/dist/engine-worker.d.ts +2 -0
- package/dist/engine-worker.js +57 -0
- package/dist/engine-worker.js.map +1 -0
- package/dist/index.d.ts +12 -2
- package/dist/index.js +433 -139
- package/dist/index.js.map +1 -1
- package/dist/worker.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -241,6 +241,18 @@ Measured on an Apple M2, single threaded:
|
|
|
241
241
|
`defineSpot` reports the projected cost before anything is allocated, and refuses a spot
|
|
242
242
|
over `maxBytes` with concrete suggestions. `maxCombos` caps range width.
|
|
243
243
|
|
|
244
|
+
### WebAssembly engine
|
|
245
|
+
|
|
246
|
+
The traversal runs in WebAssembly (`assembly/engine.ts`): 32-bit vectors and storage,
|
|
247
|
+
SIMD on every contiguous row, card sums and showdown sweeps in 64-bit. Its storage lives
|
|
248
|
+
in its own memory and the rest of the solver reads it through views, so every query,
|
|
249
|
+
warm start and analysis works unchanged. With threads (Node), all of them share one
|
|
250
|
+
WebAssembly memory and split the runouts as below. It runs wherever it can — 32-bit
|
|
251
|
+
storage, the default, and WebAssembly SIMD, which current Node and browsers have —
|
|
252
|
+
and `run.engine` says which ran. `engine: 'js'` forces the JavaScript traversal;
|
|
253
|
+
`precision: 'f64'` or `'i16'` use it too. Against the JavaScript traversal it is about
|
|
254
|
+
2.4× faster per iteration, and about 3× in Chromium.
|
|
255
|
+
|
|
244
256
|
### SIMD kernels
|
|
245
257
|
|
|
246
258
|
Regret matching and the average-strategy pass — the per-hand normalisation at every
|
|
@@ -348,15 +360,15 @@ bundled. Measured in a 4-core cloud container, time to 0.3% of pot:
|
|
|
348
360
|
|
|
349
361
|
| Spot | Threads | poker-flopsolve | postflop-solver | Ratio |
|
|
350
362
|
|---|---|---|---|---|
|
|
351
|
-
| Turn | 1 | 4
|
|
352
|
-
| Flop | 1 |
|
|
353
|
-
| Monotone flop | 1 |
|
|
354
|
-
|
|
|
355
|
-
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
363
|
+
| Turn | 1 | 1.4 s | 0.9 s | 1.7× |
|
|
364
|
+
| Flop | 1 | 29.4 s | 18.5 s | 1.6× |
|
|
365
|
+
| Monotone flop | 1 | 9.5 s | 5.2 s | 1.8× |
|
|
366
|
+
| Turn | 4 | 0.5 s | 0.3 s | 2.0× |
|
|
367
|
+
| Flop | 4 | 9.1 s | 5.1 s | 1.8× |
|
|
368
|
+
| Monotone flop | 4 | 2.9 s | 1.4 s | 2.1× |
|
|
369
|
+
|
|
370
|
+
0.2.0, still in JavaScript, was 4–6× behind; the WebAssembly engine below is most of
|
|
371
|
+
the difference.
|
|
360
372
|
|
|
361
373
|
### Accuracy targets
|
|
362
374
|
|