diff --git a/archiv/population.json b/archiv/population.json new file mode 100644 index 00000000..7c46b41d --- /dev/null +++ b/archiv/population.json @@ -0,0 +1,17 @@ +{ + "n_players": 10, + "weights": { + "fish": 0.0, + "reg": 1.0, + "nit": 0.0, + "maniac": 0.0 + }, + "spread_hud": { + "reg": { + "vpip": 0.04294699575575042, + "pfr": 0.026749870196985173, + "foldToBet": 0.08887569346502389 + } + }, + "quelle": "rec-log.log" +} \ No newline at end of file diff --git a/benchmarks/baseline.txt b/benchmarks/baseline.txt index fb02753f..f9426a68 100644 --- a/benchmarks/baseline.txt +++ b/benchmarks/baseline.txt @@ -1,51 +1,96 @@ -label f8e1035c+lokal +label 24549fb+lokal scenario heads-up reg deals 1000 seed 1592590337 -counts 3890 65 0 -samples 0.75 -0.2751893939393939 0.7040151515151516 -0.32166666666666655 0.5438888888888911 0.10833333333333339 -1.6742929292929296 -5.876515151515152 0.1418644781144801 0.18465909090909083 0.03136363636363643 0.06058080808080807 2.7617424242424287 -0.30267676767676766 -0.34261363636364095 0.75 -0.10287878787878796 0.41833333333333345 0.75 0.75 0.2946969696969697 0.39666666666666667 0.75 27.605833333333337 0.2675 0 0.6315867003367028 0.36 0.75 -0.924225589225582 0 0.75 0.75 0.019486531986534272 0.5645707070707071 0 41.70016835016835 0.2774663299663349 1.6522727272727278 -0.01041666666666674 0.841540404040404 0.75 -0.052083333333332926 0.75 0.8746212121212121 0.75 0.3139646464646486 0.75 0.2523484848484849 0.02151515151515121 0.75 0.75 0.75 0.1469949494949495 0.3325 47.605303030303034 0.4477272727272743 -0.6571969696969696 0.75 0.29027777777777775 -0.6729166666666666 -0.21939393939393936 0.75 0.75 0.75 -0.27500000000000013 -1.758333333333331 0.75 0.75 -0.28474747474747253 -0.2907954545454544 1.0116666666666667 -0.4415151515151514 0.7788636363636363 -0.033333333333333104 0.304520202020202 -0.012499999999999956 -0.1383207070707071 0.22999999999999998 0.75 0.27005050505050504 0.0823358585858609 0.09102693602693812 -12.055454545454545 0.75 0.4031818181818181 -14.247748316498315 0.2877272727272727 0.75 0.75 -0.004166666666666652 0.5832828282828284 0 -4.326262626262623 0.75 0.75 0.3358333333333333 1.0121843434343436 0 1.6024621212121213 1.2627272727272727 0.75 0.5608333333333333 -0.305867003367001 0.75 0.3358333333333333 0.75 -0.1421212121212121 0.75 0.03125 -0.6087752525252526 -18.912020202020198 0.5533333333333333 0.46 -2.5397222222222173 0.4441287878787876 -0.35481060606060355 -1.5498316498316522 0.36833333333333335 -0.2821969696969697 -0.15416666666666667 -0.6512626262626263 0.3883333333333333 0.245 0.75 22.856133557800224 0.4 0.75 13.635984848484851 -0.13060606060606028 0.573939393939394 0.07777777777778017 1.4837121212121211 0.19128787878787867 0.9626893939393986 0.4442424242424243 -4.198253367003361 0.75 0.3323863636363662 0.029861111111113225 1.9083333333333332 -0.2259469696969696 -1.2458333333333336 0.75 -18.993336139169465 2.9047348484848436 -0.75 -0.18222222222222217 1.235631313131318 -1.7687499999999976 0.75 0 46.143055555555556 0.24416666666666664 0 0.75 0.75 0.8315151515151565 -0.6416666666666667 -0.1589015151515154 0.7133333333333334 1.8945707070707116 0.3516666666666667 -44.54375 0.75 -13.526641414141409 0.28125 -0.027083333333333126 0.3225 0.6733333333333333 0.06108585858586091 0.31666666666666665 -0.6067550505050505 0.75 1.34231060606061 0.14381313131313134 -1.15117985409652 -0.15333333333333332 0.31583333333333335 0.75 45.270420875420875 -0.022916666666666696 0.31 0 -0.10375000000000012 -0.14069444444444446 0.07916666666666661 0.008333333333333304 0.75 0.75 3.0584680134680147 0.33166666666666667 0.28368686868686865 1.6180976430976481 0.75 -0.15833333333333333 0.20613636363636367 0.9060563973064022 0.31458333333333344 0 0 -0.02083333333333326 -0.30827020202020206 0.001742424242424212 0.1640151515151515 1.4590404040403984 -0.35 0.6563973063973112 -0.48876262626262634 0 -0.049116161616159726 0.75 0.18547979797979797 0.16799242424242422 0.13962121212121215 0 0.6466161616161616 0.75 0.2546717171717172 5.954013748597082 0.75 0.47969696969696973 0.75 0 0.75 -2.0692550505050504 0.75 0.3303030303030303 0 -20.536969696969695 1.8257996632996607 -0.2113636363636363 -23.76523569023569 0.3404166666666668 0.8263636363636364 0.04791666666666661 -0.125 0.8169696969696969 0.75 -5.8686237373737375 0.75 0.07499999999999996 0.75 0.75 0.75 -0.9911826599326576 -0.09166666666666656 -0.010416666666667074 0.75 0.75 0.75 0.08416666666666683 -2.6479166666666667 0.10416666666666652 -0.13958333333333328 0.75 1.6496212121212097 0.75 0.39428030303030326 -0.22291666666666665 0.527861952861948 -0.09375 0.5616666666666666 -0.13958333333333317 0.16449494949494947 0.871338383838383 0.365 0.75 0.17527777777778009 0 0.23257575757575744 0.75 3.3523737373737412 0.6539772727272681 16.10208333333334 0.576262626262626 1.0401262626262604 0.24128787878787872 0.75 -0.06041666666666634 -1 0.75 0.75 0.2809469696969701 -0.02083333333333326 -3.3808880471380434 0.5838383838383838 0.28335858585858587 0.5566666666666666 0.75 0 0.13916666666666666 -0.11124999999999996 0.445 -0.7644318181818182 0.1898989898989899 0.75 0.75 0.36 0.3766666666666667 -24.364166666666666 -0.21079545454545456 -5.972744107744102 0.55 0 0.4339898989898989 32.310799663299655 0.75 0.75 0.35 0.75 0.75 0.42666666666666664 0.5623737373737372 0.7402272727272727 0.18121212121212116 0.2849999999999999 0.75 0 0.75 0.75 -1.061249999999997 -0.07367424242424236 -3.387212401795737 -1.7124999999999977 -1.792499999999999 0.4890656565656566 0.3233333333333333 -0.18340909090909097 -0.13242424242424222 0.75 0.13749999999999996 0.75 1.8736111111111162 0.23291666666666677 0.75 0.39848484848484855 0.3068939393939394 0.27166666666666667 0 0.13162878787878562 0.35583333333333333 0.08295454545454062 0.6875757575757576 0.75 0.75 0.8962626262626288 0.75 -0.605239898989899 0.36666666666666664 0.75 -0.2354166666666666 0.5775 0.4816666666666667 5.059638047138046 -1 -0.04166666666666674 -1.2960437710437684 -0.01666666666666672 0.75 0 0.056195286195288574 1.942803030303028 0.75 0.3575 1.1514478114478095 0.23083333333333333 -2.3462247474747455 0.3591666666666667 1.126746632996635 0 -0.09166666666666667 0.5455303030303029 -0.2994949494949496 0.605 0.75 -0.6766414141414142 0.5381818181818181 0 -0.08483726150392101 0.41583333333333333 0.75 -0.8323863636363638 -2.436851851851854 0.75 -0.15333333333333332 0.75 0.75 0.75 0.75 0.38590909090909087 0.07928030303030342 0.75 -0.539583333333336 0.16295454545454546 0.75 -0.6115530303030303 0.75 -48.66813131313132 0.75 0.12250000000000516 0.5303535353535354 -0.4049873737373737 0.10249999999999998 0 0.595454545454548 -0.75 13.891792929292933 -0.153796296296294 0.75 -0.3964015151515152 0.75 0.2526515151515152 -0.125 0.75 0 -0.24078282828282827 0.3483333333333334 0.5924789562289542 0.75 0.45833333333333326 0.10303030303029859 -1.7062499999999976 0.3170454545454545 0.628611111111111 -0.15404040404040842 0.75 -4.277377946127941 -1.7708333333333308 0.75 0.02083333333333326 0.375 0.014583333333333393 -0.05590909090909091 -0.7110058922558946 1.9333333333333333 0.4348484848484849 0.38121212121212134 0.02499999999999991 0.75 9.088657407407418 0.3416666666666667 0.75 0.7313103254769908 -1.471843434343434 2.0556060606060607 0.07878787878787885 0.32325757575757574 0.36409090909090913 -0.14166666666666683 0 0.29568181818181816 0.75 -0.06458333333333344 -0.2847853535353564 -0.22708333333333353 -1.4840909090909111 0.75 0.3208333333333333 -0.2991161616161617 -0.3270833333333334 0.75 0.3661363636363636 0.75 0.571388888888889 0.047727272727270176 0.38916666666666666 -0.10416666666666674 0.16333333333333327 0.75 32.07530303030303 0.6254545454545459 -0.20871212121212124 -0.4768939393939393 0.75 0.75 0 0.75 0.75 3.173358585858582 0.7734343434343435 0.2564141414141412 -0.6633333333333333 0 1.0583333333333333 -8.67431537598204 -0.008333333333333193 0.09359848484848465 -0.5860479797979798 -0.16660353535353534 -16.25667227833894 0.26 0.6098484848484844 0.2783333333333333 20.36564253647587 -0.0064898989898989345 0.3525 -0.2562500000000002 0.75 46.52045454545455 -0.16666666666666674 0.75 0.75 0 0 0.6112121212121212 -0.36736111111111114 -0.07291666666666663 -0.029166666666666785 0.75 0.2733333333333332 0.75 0.75 -0.22696969696969693 -0.21628787878787892 0.5123484848484849 0.10700757575757569 0.75 0.75 0.75 2.8217382154882156 0.165909090909091 0.6543686868686869 -1.4575000000000022 0.75 -0.21458333333333335 0.3625 -0.9392045454545452 0.31166666666666665 -0.4227272727272715 0.6554924242424243 -0.10833333333333317 0.75 -0.20178030303030303 0 0.25671717171717434 -0.40700757575757585 0 0.39109848484848486 -22.30493827160494 -1.5008333333333357 -0.12916666666666665 0.75 0.75 0.75 0.75 0.75 -0.1969907407407412 0.75 0.4346801346801372 0.07499999999999307 0.75 0.8985269360269317 -13.770204826038151 0.3941287878787836 0.4075 0.3626010101010101 0.75 0.39502525252525256 0 0.75 0.08124999999999982 0.75 -0.1479166666666667 1.1672348484848485 0.75 0 0.75 -0.056628787878787834 0.3925 0.75 0.7341287878787879 0.75 0.3926010101010101 0.75 0.10694444444444917 1.3247474747474794 0.29833333333333334 0.75 0 1.4744318181818183 0.28878787878787876 0.38249999999999995 -0.14374999999999982 0.75 0.75 0.75 -0.6600757575757552 0.75 0.75 0.75 0.29583333333333334 0.31260101010101005 -0.17152777777777772 0.33 2.3428787878787887 -0.778409090909093 -23.519197998503564 0.75 -46.605555555555554 0.5886363636363656 -0.14614898989899006 -0.19564393939393931 0.75 0.75 0.75 1.6782828282828268 0.3914646464646464 0.75 0.75 0.5857575757575757 45.91431818181818 0.39583333333333337 -0.26477272727272727 0.449431818181818 -0.012499999999999956 -1.695833333333331 -5.082331649831645 2.40625 0.75 -0.5916666666666668 0.4083333333333333 0.13527777777777472 -0.010416666666666519 -1 0.5945202020202021 0.44166666666666665 0.5716666666666667 0.7360479797979815 0.4375 0 0.75 -0.26989898989898764 12.287941919191914 -0.11458333333333337 -0.2585227272727273 0 0 0.988552188552188 47.23977272727272 0 0.75 -0.2308080808080808 -0.21750000000000003 -10.205812289562274 0.3075 0.24165824915826306 -22.729775533108864 0 2.254166666666667 -0.16125000000000012 0.75 -0.07790404040404053 0 0.18507575757575978 0.6565151515151516 0.3290151515151516 0.75 3.7831313131313067 0.44916666666666666 0.75 0.75 0.3441666666666667 -1.1598569023569016 0.75 0.23916666666666664 -0.8260521885521879 -48.85719696969697 0.2875 0 0 5.924719416386083 -1.5587542087542063 41.02626262626262 0.75 0.02416666666666656 0.39249999999999996 0.5516666666666667 -0.21875 -0.15202020202020206 2.277272727272745 0.75 0.40914141414141414 -0.13722222222222225 0.75 -3.4844696969696978 -0.14909090909090683 0.75 0.3833333333333334 -0.09999999999999987 0 0.3458333333333332 -3.994633838383833 0.039722222222222214 0.3053030303030303 0.26 0.4175 -7.250757575757576 0.4090993265993279 -0.6208333333333333 0.39166666666666666 0.15121212121212124 -2.5479166666666666 0 -0.9391035353535353 -1.0104797979797966 0.75 0.40800505050505054 -49.090833333333336 0 0.4541666666666667 3.175606060606065 0.8833333333333286 0.0616666666666667 0.5151094276094303 0.42583333333333334 0.15340909090909083 -4.533017676767675 0.75 -0.039259259259256996 0.05624999999999991 6.110500841750844 -0.1996212121212122 -0.030239898989898872 -0.2729166666666669 1.3596717171717163 -1 0.75 0 -1.6632575757575756 1.5162752525252488 0.75 -11.706565656565651 0.3766666666666667 -20.031962682379344 0 0.30416666666666664 -0.2020833333333334 1.8358333333333308 0.75 0.75 0 -0.02108585858585854 -0.0854166666666667 0.04190656565656792 -0.08958333333333335 -0.029166666666661456 0.75 0.2648989898989899 -1.499797979797979 -3.7583136924803604 0.75 0.32166666666666666 0 -0.3821212121212122 -0.18761363636363637 -34.97453703703704 -0.13416666666666655 0.7282196969697017 0.75 0.07047979797980031 0 0.17568181818181838 0.06972222222222002 0.06426346801347071 0.75 0.75 -0.33333333333333326 -1.0541666666666667 -1.3184090909090933 -6.670509259259262 0.365 0.5113636363636364 0.3041666666666665 0.75 -0.006249999999999867 0.3962121212121186 0.75 2.4926360830527523 -0.004166666666666874 1.0265656565656611 -1.4333754208754186 0.11250000000000004 -0.22499999999999998 -0.3728535353535354 29.76460998877664 -0.38882575757575766 -0.3294402356902333 0 -0.275 -0.46034090909090897 -0.09883838383839105 -0.20176767676767682 1.5399200336700307 0.75 0.75 0.75 0.75 0.75 -3.046957070707073 0.75 0.25909090909090904 -0.3558712121212122 0.75 0.49613636363637115 -1.9874999999999998 -0.20814393939393927 0.75 -0.5008838383838385 0.030833333333338375 0.75 0.75 0.016666666666666607 -0.4395833333333332 0.5616666666666665 -0.9953072390572393 0.9443560606060608 0.6382575757575757 0.32318181818181824 0.15573232323232322 0.23958613916947202 0.17813131313131308 -0.23352272727272727 0.2534090909090909 0.75 0.5811868686868686 -0.10689393939393943 0.17666666666666664 0.75 0 -0.2004166666666667 0.75 0.2665909090909091 0.75 -0.14943181818181817 0.75 0.12083333333333846 0.75 -0.07708333333333339 0.75 -0.8547348484848485 3.233295454545448 0.011439393939394027 -1.0612584175084152 3.034301346801349 0.3258333333333333 -1.8879166666666667 0.09375 0.75 0.6058333333333333 0.27888888888888885 0.12689393939393945 0 -0.037361111111108736 0.75 -0.7484217171717171 0.5833333333333335 0.75 0.75 0.10208333333333341 -0.1274621212121212 0.3383333333333333 -0.1020833333333333 -0.04458333333333331 0.6975883838383888 -0.02499999999999325 0.75 0.3408333333333333 -1.3199242424242417 0.75 -0.1260732323232323 0.75 0.19154040404040396 0.75 0.75 0.558510101010101 0.4075 0.75 -8.328522727272714 0.75 0.75 -0.1201515151515129 0.3147474747474748 0.41166666666666674 -6.561826599326601 1.271401515151515 0.75 0.75 -2.1866161616161555 -0.3810269360269336 0.5883333333333334 0.75 -0.46477272727272734 -13.223657407407401 -0.9164772727272752 0.75 0.5466161616161617 0 -0.2250000000000001 0.3433333333333333 0.75 0.36249999999999993 -0.5799873737373737 4.364427609427619 -0.7823863636363635 -0.640088383838384 -0.05833333333333346 -1.0214015151515174 -9.399242424242424 31.194141414141413 0.75 1.0151515151515151 -0.32871212121212123 -0.21250000000000002 -0.1259469696969674 -0.031249999999999778 -0.02499999999999991 0.3284343434343434 -0.18541666666666679 0.3975000000000001 0.40022727272727276 -0.3927777777777717 0.75 0.8390151515151516 -11.059280303030299 -1.1344065656565645 -0.004166666666666652 -0.07083333333333353 0.5176262626262627 0.75 -0.23699494949494948 -0.06041666666666656 0.28583333333333333 0.14795454545454545 0 0.10094696969696493 0.03125 25.588699494949495 0.8765151515151468 11.735289001122327 11.417264309764317 0.6333333333333333 -0.003219696969696928 0.75 -0.3219065656565656 0.75 0.37916666666666665 0.75 0.75 -0.7517045454545455 -0.6189141414141442 -0.22083333333333344 0 0.75 0.6542424242424243 0.3254040404040404 0 0.37916666666666665 0.6911279461279509 2.439583333333333 -0.36098484848484846 5.884027777777777 0.75 0.75 0.9848063973063965 0.75 0.35966750841750583 0.75 0.42 0.75 -1 0.1499999999999999 0.08832070707070727 0.3046464646464647 -34.14419191919192 0.31782828282828285 0.5103535353535351 -0.6573863636363662 -0.21511363636363667 -1.471212121212119 0.34419191919191916 5.20217171717172 4.293181818181821 -0.15416666666666667 0.24583333333333335 2.7275336700336728 0.75 1.5501893939393991 2.0162878787878764 3.510159932659934 0 0.75 -0.007462121212121087 -0.557689393939394 0.75 0.6401010101010101 0 0.6971969696969696 0.75 -0.007500000000000062 +counts 4163 9 0 +samples 0.75 -0.2751893939393939 0.7040151515151516 -0.32166666666666655 0.5438888888888911 0.10833333333333339 -1.6742929292929296 -5.876515151515152 -1.0479783950617279 0.18465909090909083 0.03136363636363643 -1.2047390572390566 2.7617424242424287 -0.30267676767676766 -0.34261363636364095 0.75 27.50318181818181 0.41833333333333345 0.75 0.75 0.2946969696969697 0.39666666666666667 0.75 27.605833333333337 0.2675 -0.023055555555553275 -0.7905513468013419 0.36 0.75 -3.2663973063972955 -20.079312570145895 0.75 0.75 -0.3237373737373741 0.5645707070707071 2.619444444444442 41.70016835016835 0.2774663299663349 1.6522727272727278 -0.01041666666666674 0.841540404040404 0.75 -0.964541245791243 0.75 0.8746212121212121 0.75 0.20840909090909032 0.75 0.2523484848484849 -1.8118181818181813 0.75 0.75 0.75 -1.2927356902356895 0.3325 47.605303030303034 -2.822474747474743 -0.6571969696969696 0.75 0.29027777777777775 -0.6729166666666666 -0.21939393939393936 0.75 0.75 0.75 -0.27500000000000013 -1.758333333333331 0.75 0.75 -0.28474747474747253 -0.2907954545454544 1.0116666666666667 -0.4415151515151514 0.7788636363636363 -0.033333333333333104 0.304520202020202 -0.012499999999999956 -0.1383207070707071 0.22999999999999998 0.75 0.27005050505050504 -0.3451893939393942 -1.3765375982042645 -29.29030303030303 0.75 0.4031818181818181 -14.247748316498315 0.2877272727272727 0.75 0.75 -0.004166666666666652 0.5832828282828284 -6.00282454171343 4.467929292929294 0.75 0.75 0.3358333333333333 1.0121843434343436 2.125555555555553 1.6024621212121213 1.2627272727272727 0.75 0.5608333333333333 -1.2427356902356896 0.75 0.3358333333333333 0.75 -0.1421212121212121 0.75 0.03125 -2.269549663299661 -62.324688552188555 0.5533333333333333 0.46 -2.5397222222222173 0.4441287878787876 -0.35481060606060355 -4.289730639730639 0.36833333333333335 -0.2821969696969697 -0.15416666666666667 -1.9084175084175063 0.3883333333333333 0.245 0.75 8.691992143658819 0.4 0.75 4.986994949494957 -0.13060606060606028 0.573939393939394 0.07777777777778017 1.4837121212121211 0.19128787878787867 0.9626893939393986 0.4442424242424243 -4.198253367003361 0.75 -0.6183712121212073 -0.35208333333333375 1.9083333333333332 -0.2259469696969696 0.00416666666666643 0.75 -18.993336139169465 2.9047348484848436 -0.75 -0.18222222222222217 1.235631313131318 -1.7687499999999976 0.75 1.604071268237941 46.143055555555556 0.24416666666666664 0 0.75 0.75 0.8315151515151565 -0.6416666666666667 -0.1589015151515154 0.7133333333333334 1.8945707070707116 0.3516666666666667 -44.54375 0.75 -25.350434904601574 0.28125 -0.027083333333333126 0.3225 0.6733333333333333 -4.150698653198649 0.31666666666666665 -0.6067550505050505 0.75 1.34231060606061 0.14381313131313134 -0.44178030303030313 -0.15333333333333332 0.31583333333333335 0.75 45.270420875420875 -0.022916666666666696 0.31 0.14416666666667144 -0.10375000000000012 -0.14069444444444446 0.07916666666666661 0.008333333333333304 0.75 0.75 3.0584680134680147 0.33166666666666667 0.28368686868686865 -0.8204545454545347 0.75 -0.15833333333333333 0.20613636363636367 0.9060563973064022 0.31458333333333344 -5.013442760942757 0 -0.02083333333333326 -0.30827020202020206 0.001742424242424212 0.1640151515151515 1.4590404040403984 -0.35 0.6563973063973112 -0.48876262626262634 0 -0.049116161616159726 0.75 0.18547979797979797 0.16799242424242422 0.13962121212121215 0.0012205387205410645 0.6466161616161616 0.75 0.2546717171717172 4.534821829405165 0.75 0.47969696969696973 0.75 -1.6090347923681252 0.75 0.6597011784511833 0.75 0.3303030303030303 -0.03472222222221999 -20.536969696969695 1.196843434343434 -0.2113636363636363 -23.76523569023569 0.3404166666666668 0.8263636363636364 -0.5581439393939371 -0.125 0.8169696969696969 0.75 -37.333270202020195 0.75 0.07499999999999996 0.75 0.75 0.75 -13.954145622895613 -0.09166666666666656 -1.3736321548821528 0.75 0.75 0.75 0.08416666666666683 -2.6479166666666667 0.10416666666666652 -0.13958333333333328 0.75 1.6496212121212097 0.75 0.39428030303030326 -0.22291666666666665 0.527861952861948 -0.09375 0.5616666666666666 -0.13958333333333317 -0.07321548821548585 0.871338383838383 0.365 0.75 0.17527777777778009 0 0.23257575757575744 0.75 -1.0718686868686773 0.6539772727272681 16.10208333333334 -0.8345763187429855 1.0401262626262604 0.24128787878787872 0.75 -0.06041666666666634 -1 0.75 0.75 0.2809469696969701 -0.02083333333333326 -3.3808880471380434 0.5838383838383838 0.28335858585858587 0.5566666666666666 0.75 -0.5717424242424218 0.13916666666666666 -0.11124999999999996 0.445 -0.7644318181818182 0.1898989898989899 0.75 0.75 0.36 0.3766666666666667 -24.364166666666666 -0.21079545454545456 -5.972744107744102 0.55 -6.9960493827160475 0.4339898989898989 32.310799663299655 0.75 0.75 0.35 0.75 0.75 0.42666666666666664 0.5623737373737372 0.7402272727272727 -1.2632323232323226 0.2849999999999999 0.75 0.32888888888889123 0.75 0.75 -1.061249999999997 -0.07367424242424236 -3.387212401795737 -1.7124999999999977 -0.7633333333333334 0.4890656565656566 0.3233333333333333 -0.18340909090909097 -0.13242424242424222 0.75 0.13749999999999996 0.75 1.8736111111111162 0.23291666666666677 0.75 0.39848484848484855 0.3068939393939394 0.27166666666666667 3.94918911335578 0.13162878787878562 0.35583333333333333 0.08295454545454062 0.6875757575757576 0.75 0.75 0.8962626262626288 0.75 -1.8093644781144755 0.36666666666666664 0.75 -0.2354166666666666 0.5775 0.4816666666666667 5.059638047138046 -1 -0.04166666666666674 -1.2960437710437684 -0.01666666666666672 0.75 0 0.056195286195288574 -0.20635521885522046 0.75 0.3575 1.1514478114478095 0.23083333333333333 -2.3462247474747455 0.3591666666666667 1.126746632996635 -5.462373737373737 -0.09166666666666667 0.5455303030303029 -0.2994949494949496 0.605 0.75 -0.6766414141414142 0.5381818181818181 0.12083333333333568 -0.08483726150392101 0.41583333333333333 0.75 -0.8323863636363638 -2.436851851851854 0.75 -0.15333333333333332 0.75 0.75 0.75 0.75 0.38590909090909087 0.07928030303030342 0.75 -0.539583333333336 0.16295454545454546 0.75 -0.6115530303030303 0.75 -5.473686868686864 0.75 0.12250000000000516 0.5303535353535354 -1.473590067340065 0.10249999999999998 0.06444444444444675 0.595454545454548 -0.75 12.390109427609433 -0.153796296296294 0.75 -0.3964015151515152 0.75 0.2526515151515152 -0.125 0.75 0 -0.24078282828282827 0.3483333333333334 0.5924789562289542 0.75 0.45833333333333326 0.10303030303029859 -1.7062499999999976 0.3170454545454545 0.628611111111111 -0.15404040404040842 0.75 -4.277377946127941 -1.7708333333333308 0.75 0.02083333333333326 0.375 0.014583333333333393 -0.05590909090909091 -0.7110058922558946 1.9333333333333333 0.4348484848484849 0.38121212121212134 0.02499999999999991 0.75 -4.648155162738492 0.3416666666666667 0.75 0.7313103254769908 -1.471843434343434 2.0556060606060607 0.07878787878787885 0.32325757575757574 0.36409090909090913 -0.14166666666666683 1.12611111111111 0.29568181818181816 0.75 -0.06458333333333344 -0.2847853535353564 -0.22708333333333353 -1.4840909090909111 0.75 0.3208333333333333 -0.2991161616161617 -0.3270833333333334 0.75 0.3661363636363636 0.75 0.571388888888889 0.047727272727270176 0.38916666666666666 -0.10416666666666674 0.16333333333333327 0.75 -0.38303030303030283 0.6254545454545459 -0.20871212121212124 -0.4768939393939393 0.75 0.75 -0.4348653198653176 0.75 0.75 -0.7146885521885507 0.7734343434343435 0.2564141414141412 -0.6633333333333333 13.783619528619528 1.0583333333333333 -8.67431537598204 -0.008333333333333193 -0.41869107744107525 -1.663489057239055 -0.16660353535353534 -21.75611111111111 0.26 0.6098484848484844 0.2783333333333333 20.36564253647587 -0.0064898989898989345 0.3525 -0.2562500000000002 0.75 46.52045454545455 -0.16666666666666674 0.75 0.75 17.990673400673394 1.308672839506173 0.6112121212121212 -0.36736111111111114 -0.07291666666666663 -0.029166666666666785 0.75 0.2733333333333332 0.75 0.75 -0.22696969696969693 -0.21628787878787892 0.5123484848484849 0.10700757575757569 0.75 0.75 0.75 2.8217382154882156 0.165909090909091 0.6543686868686869 -1.4575000000000022 0.75 -0.21458333333333335 0.3625 -0.9392045454545452 0.31166666666666665 -0.4227272727272715 0.6554924242424243 -0.10833333333333317 0.75 -0.20178030303030303 0 0.25671717171717434 -1.4107954545454522 -0.4187205387205364 0.39109848484848486 -8.2 -1.5008333333333357 -0.12916666666666665 0.75 0.75 0.75 0.75 0.75 -0.1969907407407412 0.75 0.4346801346801372 0.07499999999999307 0.75 0.056776094276092204 -13.770204826038151 0.3941287878787836 0.4075 0.3626010101010101 0.75 0.39502525252525256 0 0.75 0.08124999999999982 0.75 -0.1479166666666667 1.1672348484848485 0.75 -3.8928338945005576 0.75 -0.056628787878787834 0.3925 0.75 0.7341287878787879 0.75 0.3926010101010101 0.75 0.10694444444444917 1.3247474747474794 0.29833333333333334 0.75 -0.49669472502805867 1.4744318181818183 0.28878787878787876 0.38249999999999995 -0.14374999999999982 0.75 0.75 0.75 -0.6600757575757552 0.75 0.75 0.75 0.29583333333333334 0.31260101010101005 -0.17152777777777772 0.33 2.3428787878787887 -0.778409090909093 56.1268223905724 0.75 -46.605555555555554 0.5886363636363656 -0.14614898989899006 -0.19564393939393931 0.75 0.75 0.75 0.17954545454545556 0.3914646464646464 0.75 0.75 0.5857575757575757 45.91431818181818 0.39583333333333337 -0.26477272727272727 0.449431818181818 -0.012499999999999956 -1.695833333333331 -5.082331649831645 2.40625 0.75 -0.5916666666666668 0.4083333333333333 0.13527777777777472 -0.010416666666666519 -1 0.5945202020202021 0.44166666666666665 0.5716666666666667 0.7360479797979815 0.4375 0 0.75 -0.26989898989898764 36.03794191919193 -0.11458333333333337 -0.2585227272727273 0 -0.4226094276094253 0.988552188552188 38.36351010101009 0.05360269360269598 0.75 -0.2308080808080808 -0.21750000000000003 -10.205812289562274 0.3075 0.12204545454545368 -22.729775533108864 -1.2869444444444438 2.254166666666667 -0.16125000000000012 0.75 -0.07790404040404053 0 0.18507575757575978 0.6565151515151516 0.3290151515151516 0.75 2.2279124579124527 0.44916666666666666 0.75 0.75 0.3441666666666667 -1.8904966329966326 0.75 0.23916666666666664 -1.68632154882155 -48.85719696969697 0.2875 0 0.015833333333335586 8.62765151515151 -4.828956228956224 41.02626262626262 0.75 0.02416666666666656 0.39249999999999996 0.5516666666666667 -0.21875 -0.15202020202020206 2.277272727272745 0.75 0.40914141414141414 -0.13722222222222225 0.75 -0.9625841750841735 -0.14909090909090683 0.75 0.3833333333333334 -0.09999999999999987 -1.413333333333336 0.3458333333333332 -13.068707912457903 0.039722222222222214 0.3053030303030303 0.26 0.4175 -0.6434343434343435 0.4090993265993279 -0.6208333333333333 0.39166666666666666 0.15121212121212124 -2.5479166666666666 -3.67721661054994 -0.9391035353535353 -1.0104797979797966 0.75 0.40800505050505054 -49.090833333333336 0.1013888888888912 0.4541666666666667 3.175606060606065 0.8833333333333286 0.0616666666666667 0.5151094276094303 0.42583333333333334 0.15340909090909083 -4.533017676767675 0.75 -0.039259259259256996 0.05624999999999991 1.491813973063981 -0.1996212121212122 -0.030239898989898872 -0.2729166666666669 -3.930732323232319 -1 0.75 1.0653619528619513 -1.6632575757575756 0.5597095959595928 0.75 -26.17794612794613 0.3766666666666667 -20.031962682379344 -13.674234006734 0.30416666666666664 -0.2020833333333334 0.17573232323232135 0.75 0.75 0.20638888888889106 -0.02108585858585854 -0.0854166666666667 -4.6648274410774375 -0.08958333333333335 -0.029166666666661456 0.75 0.2648989898989899 -1.499797979797979 -40.13036756453423 0.75 0.32166666666666666 0 -0.3821212121212122 -0.18761363636363637 -34.97453703703704 -0.13416666666666655 0.7282196969697017 0.75 -4.908476430976426 0 0.17568181818181838 0.06972222222222002 0.06426346801347071 0.75 0.75 -0.33333333333333326 -1.5541666666666643 -1.3184090909090933 -18.602327441077442 0.365 0.5113636363636364 0.3041666666666665 0.75 -0.006249999999999867 0.3962121212121186 0.75 2.4926360830527523 -0.004166666666666874 0.7083838383838361 -4.703577441077435 0.11250000000000004 -0.22499999999999998 -0.3728535353535354 4.751001683501684 -0.38882575757575766 -5.143413299663296 0 -0.275 0.7997601010101005 -0.09883838383839105 -1.8448653198653178 1.5399200336700307 0.75 0.75 0.75 0.75 0.75 -3.046957070707073 0.75 0.25909090909090904 -0.3558712121212122 0.75 0.49613636363637115 -1.9874999999999998 -0.20814393939393927 0.75 -0.5008838383838385 0.030833333333338375 0.75 0.75 0.016666666666666607 -0.4395833333333332 0.5616666666666665 -0.9953072390572393 0.9443560606060608 0.6382575757575757 0.32318181818181824 0.15573232323232322 -0.7789323793490439 0.17813131313131308 -0.23352272727272727 0.2534090909090909 0.75 0.5811868686868686 -0.10689393939393943 -1.2253535353535345 0.75 5.300735129068466 -0.2004166666666667 0.75 0.2665909090909091 0.75 -0.14943181818181817 0.75 1.2666666666666708 0.75 -0.07708333333333339 0.75 -0.8547348484848485 3.4226893939393896 -0.49613636363636116 -1.0612584175084152 3.034301346801349 0.3258333333333333 -1.8879166666666667 0.09375 0.75 0.6058333333333333 0.27888888888888885 0.12689393939393945 0.1436363636363659 -0.037361111111108736 0.75 -0.7484217171717171 0.5833333333333335 0.75 0.75 -1.3112163299663275 -0.1274621212121212 0.3383333333333333 -0.1020833333333333 -0.04458333333333331 -0.7657954545454472 -0.02499999999999325 0.75 0.3408333333333333 -0.7189141414141398 0.75 -0.1260732323232323 0.75 0.19154040404040396 0.75 0.75 0.558510101010101 0.4075 0.75 -34.71741161616162 0.75 0.75 -0.1201515151515129 -0.15511784511784277 0.41166666666666674 -6.561826599326601 1.271401515151515 0.75 0.75 -2.1866161616161555 -0.3810269360269336 0.5883333333333334 0.75 -0.46477272727272734 -13.223657407407401 -0.9164772727272752 0.75 0.5466161616161617 0 -0.2250000000000001 0.3433333333333333 0.75 0.36249999999999993 -1.8430345117845093 0.4386139169472614 -0.7823863636363635 -0.640088383838384 -1.7249999999999976 -1.0214015151515174 -13.596492704826037 31.194141414141413 0.75 1.0151515151515151 -0.32871212121212123 -0.21250000000000002 -0.1259469696969674 -0.031249999999999778 -0.02499999999999991 0.3284343434343434 -0.18541666666666679 0.3975000000000001 0.40022727272727276 -0.9650000000000043 0.75 0.8390151515151516 -11.059280303030299 -1.1344065656565645 -0.004166666666666652 -0.07083333333333353 0.5176262626262627 0.75 -0.23699494949494948 -0.06041666666666656 0.28583333333333333 0.14795454545454545 8.661343995510661 0.10094696969696493 0.03125 22.08280723905724 0.8765151515151468 -0.6089870931537593 22.541843434343434 0.6333333333333333 -0.003219696969696928 0.75 -0.3219065656565656 0.75 0.37916666666666665 0.75 0.75 -0.7517045454545455 -0.5242171717171752 -0.22083333333333344 -0.39285353535353307 0.75 0.6542424242424243 0.3254040404040404 -0.038787878787876484 0.37916666666666665 0.6911279461279509 2.439583333333333 -0.36098484848484846 8.807428451178446 0.75 0.75 0.9848063973063965 0.75 -0.238270202020207 0.75 0.42 0.75 -1 0.1499999999999999 0.08832070707070727 -4.722289562289558 -34.14419191919192 0.31782828282828285 0.5103535353535351 -0.6573863636363662 -0.21511363636363667 -1.471212121212119 0.34419191919191916 5.20217171717172 10.586111111111101 -0.15416666666666667 1.8775000000000046 -0.6184259259259179 0.75 1.5501893939393991 2.0162878787878764 3.510159932659934 -0.1719332210998863 0.75 -0.007462121212121087 -0.557689393939394 0.75 0.6401010101010101 0 0.6971969696969696 0.75 -0.007500000000000062 scenario heads-up nit deals 1000 seed 1592590337 -counts 2107 17 0 -samples 0.75 0.75 0.7040151515151516 0.75 0.6337878787878788 0.75 0.47583333333333333 -1.1088383838383864 -0.1523737373737375 0.75 0.9253030303030303 -0.06719696969696975 0.75 -1.1794444444444467 1.6649621212121213 0.75 0.75 0.75 0.75 0.75 0.2946969696969697 0.75 0.75 0.75 0.75 0 0.1622474747474747 0.75 0.75 0.75 0.013964646464646568 0.75 0.75 0.29406565656565653 0.5645707070707071 0.4083333333333333 0.75 0.75 1.1145833333333335 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.34166666666666656 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.5493686868686869 0.75 0.75 0.75 -0.6729166666666666 0.5533333333333333 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 -0.2847222222222222 0.75 0.75 -0.1383207070707071 0.75 0.75 0.27005050505050504 -2.806969696969697 0.05767676767676766 0.75 0.75 0.75 -4.905997474747475 0.75 0.75 0.75 0.75 0.75 0 0.75 0.75 0.75 0.75 1.0121843434343436 0.19666666666666666 0.75 1.2627272727272727 0.75 0.75 -0.7080555555555557 0.75 0.75 0.75 0.75 0.75 0.75 -0.6087752525252526 0.75 0.5533333333333333 0.75 0.75 0.75 0.75 0.75 0.36833333333333335 0.75 0.75 -1.5502525252525254 0.75 0.245 0.75 25.1756734006734 0.75 0.75 0.31540404040404013 0.75 0.75 2.0901515151515153 0.75 0.75 0.75 0.75 0.75 0.75 0.75 -0.07291666666666674 1.9083333333333332 0.75 0.75 0.75 -0.34928451178451025 0.75 -47.67790404040404 0.54 0.75 0.75 0.75 0.42199494949494953 -0.24583333333333335 0.75 0.3208333333333334 0.75 0.75 0.48303030303030303 0.75 0.75 0.75 0.75 0.75 0.75 0.75 1 0.3125 0.75 0.75 0.75 0.3118939393939394 0.31666666666666665 0.75 0.75 0.75 0.14381313131313134 -1.1880050505050506 0.75 0.75 0.75 9.997693602693603 -0.2729166666666667 0.75 0.34750000000000003 0.75 0.75 0.75 0.75 0.75 0.75 -4.995235690235686 0.75 0.75 1 0.75 0.3416666666666667 0.75 1.4072601010101011 0.75 -3.819469696969694 0.3030555555555555 0.75 -0.30827020202020206 0.7267424242424243 0.75 0.75 0.75 0.75 13.353409090909091 0.3375 0.9377525252525252 0.75 0.3314393939393939 0.16799242424242422 0.3441666666666667 0.28623737373737373 0.75 0.75 0.75 5.339966329966329 0.75 0.75 0.75 0.08131313131313134 0.75 -0.18541666666666679 0.75 0.75 0.2708333333333333 -33.687289562289564 0.3130050505050505 0.75 0.75 0.23416666666666663 0.75 0.75 0.75 0.75 0.75 0.75 0.75 -0.46458333333333335 0.75 0.75 0.75 -0.9928661616161616 -0.41874999999999996 1 0.75 0.75 0.75 0.75 0.75 0.10416666666666652 -0.13958333333333328 0.75 0.75 0.75 0.47969696969696973 0.75 0.05296717171717169 0.75 0.75 0.2250000000000001 0.75 0.5556818181818184 0.75 0.75 0.22166666666666668 0.36749999999999994 0.23257575757575744 0.75 0.4430303030303031 0.38882575757575744 1 1.459520202020202 0.3805303030303031 1 0.75 0.75 16.850631313131316 0.75 0.75 0.75 0.75 -0.7959848484848484 0.75 0.28335858585858587 0.75 0.75 0 0.75 0.75 0.75 0.75 0.1898989898989899 0.75 0.75 0.75 0.75 -1.1975000000000025 0.75 -4.460690235690228 0.55 -0.7755555555555556 0.4339898989898989 -8.371906565656566 0.75 0.75 0.35 0.75 0.75 0.75 0.3123737373737372 0.75 0.75 0.75 0.75 0.4266666666666667 0.75 0.75 0.5570075757575759 0.0854166666666667 0.75 0.75 -0.4824999999999976 0.75 0.75 0.75 0.75 0.75 -0.11250000000000004 0.75 2.3833333333333333 0.3350000000000001 0.75 0.39848484848484855 0.75 0.75 0.36037878787878785 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.36666666666666664 0.75 0.75 0.75 0.4816666666666667 0.75 -0.8089015151515151 0.75 0.7721380471380521 0.75 0.75 0.6697474747474748 0.75 0.75 0.75 0.3575 0.5357575757575757 0.23083333333333333 -6.191174242424242 0.75 0.75 0 0.75 0.75 0.75 0.75 0.75 -0.6766414141414142 0.75 0.3375 -48.79726430976431 0.75 0.75 -0.8323863636363638 0.009444444444444366 0.75 0.5966666666666667 0.75 0.75 0.75 0.75 0.75 0.75 0.75 -0.539583333333336 0.75 0.75 -0.6115530303030303 0.75 0.75 0.75 0.22999999999999998 0.75 0.75 0.415 0.31333333333333335 -0.29375000000000007 18.8302398989899 1 -0.046388888888888924 0.75 -0.3964015151515152 0.75 0.75 0.75 0.75 0.22833333333333333 0.75 0.75 0.09833333333333338 0.75 0.45833333333333326 0.5954545454545457 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 -2.7089015151515152 0.75 0.75 0.45224747474747473 -48.41458333333333 2.0556060606060607 0.75 0.75 0.75 0.75 0.6092424242424244 0.75 0.75 -0.06458333333333344 0.75 0.75 0.75 0.75 0.75 -0.2991161616161617 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 -6.96674242424242 0.9742424242424241 0.75 0.75 0.75 0.75 0.29833333333333334 0.75 0.75 3.3446338383838343 0.75 0.75 0.75 0 0.75 0.75 -0.35265151515151516 0.75 0.75 0.75 -15.392474747474742 0.26 0.75 0.75 0.14924242424242418 0.75 0.75 0.75 0.75 3.234957912457908 0.75 0.75 0.75 18.443333333333328 0.4947222222222223 0.75 -0.6173611111111111 -0.07291666666666663 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.5123484848484849 0.75 0.75 0.75 0.75 2.8217382154882156 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 1.1348484848484848 0.75 0.75 0.75 0.6025757575757577 -0.7722222222222221 0.3358333333333333 -0.12291666666666679 0 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 -2.5869949494949487 0.75 0.4083333333333332 0.75 0.75 1.1556186868686873 0.75 0.75 0.4075 0.75 0.75 0.75 0 0.75 1 0.75 0.75 0.75 0.75 0 0.75 0.75 0.75 0.75 1.1487121212121212 0.75 0.75 0.75 0.37083333333333335 0.5176767676767677 0.75 0.75 0.49136363636363634 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 1 17.731489898989906 0.75 0.75 0.75 0.75 -0.04791666666666661 0.75 0.75 0.75 -0.13541666666666674 0.75 0.75 0.75 0.5857575757575757 11.714288720538727 0.39583333333333337 -0.033333333333333326 0.75 -0.012499999999999956 0.75 0.75 0.75 0.75 0.75 0.75 0.1925 0.75 -0.6986742424242424 0.75 0.75 0.75 0.75 0.75 0.23659090909090907 0.75 -0.26989898989898764 1 -0.48503787878787874 0.75 49.18325757575757 0 -0.07499999999999996 0.75 0.30868686868686873 0.75 -0.4808080808080808 0.75 0.75 0.75 0.75 19.149478114478114 0.13416666666666666 0.75 0.75 0.75 -0.32790404040404053 0.3016666666666667 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 -48.85719696969697 0.2875 0 0 5.333417508417508 -1.264141414141414 0.75 0.75 0.545 0.75 0.75 0.75 0.75 1 0.75 0.75 0.75 0.75 0.75 0.29 0.75 0.75 -0.022916666666666696 -0.14500000000000002 0.3458333333333332 0.75 0.39916666666666667 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 -0.04791666666666661 -0.053030303030303094 0.75 0.75 0.75 0.75 -49.09083333333332 0.32916666666666666 0.75 0.75 0.75 0.44083333333333335 0.75 0.75 0.15340909090909083 -0.6030303030303006 0.75 0.2688888888888889 -0.07499999999999996 -0.5479166666666666 -0.719128787878788 -0.3736742424242423 0.02083333333333337 0.5309090909090908 -0.7167929292929294 0.75 0.5503787878787878 -1.034469696969697 0.75 0.75 1.0712121212121213 0.3766666666666667 -0.35609427609427713 0 0.75 0.75 0.5525 0.75 0.75 0.37416666666666665 -0.27108585858585854 0.75 -0.19109848484848468 -0.08958333333333335 1 0.75 0.30833333333333335 -0.1078787878787878 -2.570858585858588 0.75 0.75 0.2351767676767677 0.75 0.6875757575757576 -18.250631313131315 0.75 0.75 0.75 -0.3457575757575757 0.30083333333333334 0.75 0.43166666666666664 0.35583333333333333 0.75 0.75 0.75 -0.5541666666666667 2.014924242424242 0.75 0.75 0.75 0.75 0.75 -0.375 -0.3918560606060606 0.75 3.802508417508414 0.75 0.473030303030303 0.75 -0.05833333333333335 0.75 -0.3728535353535354 0.75 -0.6388257575757577 -3.284343434343432 0.23583333333333334 -0.275 0.75 0.75 0.75 0.583270202020202 0.75 0.75 0.75 0.75 0.75 0.7603030303030303 0.75 0.75 0.75 0.75 0.026704545454545592 0.75 0.75 0.75 0.75 0.6937500000000001 0.75 0.75 -0.3583333333333334 0.75 0.75 0.75 0.75 0.75 0.32318181818181824 0.75 0.5866414141414142 0.75 -0.006249999999999978 0.2534090909090909 0.75 0.75 0.5893181818181819 0.75 0.75 1.0019023569023549 0.5725 0.75 0.35750000000000004 0.75 -0.14943181818181817 0.75 -1.3645833333333335 0.75 0.75 0.75 -2.0479166666666666 -1.2625 0.75 0.75 1.163510101010101 0.3258333333333333 0.75 0.75 0.75 0.75 0.75 0.75 0.3472727272727273 0.3491666666666667 0.75 -0.4517045454545454 0.75 0.75 0.75 -0.42733585858585854 0.75 0.75 -0.1020833333333333 0.75 0.379469696969697 2.0592803030303033 0.75 0.75 -0.5229545454545432 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 6.025959595959598 0.75 0.75 0.75 0.75 0.75 41.44387626262626 0.75 0.75 0.75 0.75 0.75 0.75 0.75 -0.8814393939393965 -0.9935858585858595 0.75 0.75 0.75 1.16984848484848 -0.2250000000000001 0.75 0.75 0.75 -0.5799873737373737 0.40827020202020203 -0.7823863636363635 0.75 -0.36875 0.75 -6.8558922558922575 32.67685185185186 0.75 0.75 0.75 -0.21250000000000002 0.014393939393939403 0.75 -0.02499999999999991 0.75 0.75 0.75 0.75 1.0733333333333333 0.75 0.75 -8.573547979797977 0.03257575757575759 0.75 0.75 0.5176262626262627 0.75 0.75 0.3270833333333334 0.75 0.75 4.789974747474746 0.75 0.75 0.75 0.75 7.794368686868687 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 -0.2895833333333333 0.5846212121212121 -0.22083333333333344 0 0.75 0.75 0.75 0.2690909090909091 0.75 0.5854040404040404 0.75 0.75 6.8371212121212075 0.75 0.75 0.75 0.75 0.10166666666666668 0.75 0.75 0.75 -0.9482323232323231 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.21916666666666668 0.75 -0.15416666666666667 0.985 -0.04375000000000018 0.75 0.75 0.75 0.75 0.138459595959596 0.75 0.75 0.75 0.75 0.75 0.28154040404040404 0.75 0.75 0.75 +counts 2182 5 0 +samples 0.75 0.75 0.7040151515151516 0.75 0.6337878787878788 0.75 0.47583333333333333 -1.1088383838383864 -0.8836868686868686 0.75 0.9253030303030303 -0.06719696969696975 0.75 -3.5127777777777824 1.6649621212121213 0.75 0.75 0.75 0.75 0.75 0.2946969696969697 0.75 0.75 0.75 0.75 0.05166666666666664 -0.8781565656565657 0.75 0.75 0.75 0.013964646464646568 0.75 0.75 0.011237373737373657 0.5645707070707071 0.4083333333333333 0.75 0.75 1.1145833333333335 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.34166666666666656 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.5493686868686869 0.75 0.75 0.75 -0.6729166666666666 0.5533333333333333 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 -0.2847222222222222 0.75 0.75 -0.1383207070707071 0.75 0.75 0.27005050505050504 -1 -0.8776767676767676 0.75 0.75 0.75 -4.905997474747475 0.75 0.75 0.75 0.75 0.75 -0.990235690235691 0.75 0.75 0.75 0.75 1.0121843434343436 0.19666666666666666 0.75 1.2627272727272727 0.75 0.75 -0.7080555555555557 0.75 0.75 0.75 0.75 0.75 0.75 -1.8537247474747476 0.75 0.5533333333333333 0.75 0.75 0.75 0.75 0.75 0.36833333333333335 0.75 0.75 -9.580555555555554 0.75 0.245 0.75 25.1756734006734 0.75 0.75 0.31540404040404013 0.75 0.75 2.0901515151515153 0.75 0.75 0.75 0.75 0.75 0.75 0.75 -0.07291666666666674 1.9083333333333332 0.75 0.75 0.75 -0.34928451178451025 0.75 -47.67790404040404 0.54 0.75 0.75 0.75 0.42199494949494953 -0.24583333333333335 0.75 0.3208333333333334 0.75 0.75 0.48303030303030303 0.75 0.75 0.75 0.75 0.75 0.75 0.75 1 0.3125 0.75 0.75 0.75 -0.9062878787878788 0.31666666666666665 0.75 0.75 0.75 -0.16729797979797978 -1.1880050505050506 0.75 0.75 0.75 9.997693602693603 -0.2729166666666667 0.75 0.34750000000000003 0.75 0.75 0.75 0.75 0.75 0.75 -4.995235690235686 0.75 0.75 1 0.75 0.3416666666666667 0.75 1.4072601010101011 0.75 -1.1528030303030303 0.3030555555555555 0.75 -0.30827020202020206 0.7267424242424243 0.75 0.75 0.75 0.75 42.217045454545456 0.3375 0.9377525252525252 0.75 0.3314393939393939 0.16799242424242422 0.3441666666666667 0.28623737373737373 0.75 0.75 0.75 5.339966329966329 0.75 0.75 0.75 -0.2631313131313131 0.75 -0.18541666666666679 0.75 0.75 0.2708333333333333 -55.505471380471384 -0.15467171717171713 0.75 0.75 0.23416666666666663 0.75 0.75 0.75 0.75 0.75 0.75 0.75 -1.5479166666666666 0.75 0.75 0.75 -8.492866161616162 -0.41874999999999996 1 0.75 0.75 0.75 0.75 0.75 0.10416666666666652 -0.13958333333333328 0.75 0.75 0.75 0.47969696969696973 0.75 -1.0404671717171716 0.75 0.75 0.2250000000000001 0.75 0.5556818181818184 0.75 0.75 0.22166666666666668 0.36749999999999994 0.23257575757575744 0.75 0.4430303030303031 0.38882575757575744 1 1.459520202020202 0.3805303030303031 1 0.75 0.75 21.547601010101012 0.75 0.75 0.75 0.75 -0.7959848484848484 0.75 0.28335858585858587 0.75 0.75 -0.4186363636363637 0.75 0.75 0.75 0.75 0.1898989898989899 0.75 0.75 0.75 0.75 -1.1975000000000025 0.75 -4.460690235690228 0.55 -0.7755555555555556 0.4339898989898989 -8.371906565656566 0.75 0.75 0.35 0.75 0.75 0.75 0.3123737373737372 0.75 0.75 0.75 0.75 0.4266666666666667 0.75 0.75 0.5570075757575759 0.0854166666666667 0.75 0.75 -0.4824999999999976 0.75 0.75 0.75 0.75 0.75 -0.11250000000000004 0.75 2.3833333333333333 0.3350000000000001 0.75 -0.0015151515151514694 0.75 0.75 0.36037878787878785 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.36666666666666664 0.75 0.75 0.75 0.4816666666666667 0.75 -0.8089015151515151 0.75 0.7721380471380521 0.75 0.75 0.6697474747474748 0.75 0.75 0.75 0.3575 0.5357575757575757 0.23083333333333333 -6.191174242424242 0.75 0.75 -4.6106060606060595 0.75 0.75 0.75 0.75 0.75 -0.6766414141414142 0.75 0.3375 -48.79726430976431 0.75 0.75 -0.8323863636363638 0.009444444444444366 0.75 0.5966666666666667 0.75 0.75 0.75 0.75 0.75 0.75 0.75 -0.539583333333336 0.75 0.75 -0.6115530303030303 0.75 0.75 0.75 0.22999999999999998 0.75 0.75 0.415 0.31333333333333335 -0.29375000000000007 -4.578851010101009 1 -0.046388888888888924 0.75 -0.3964015151515152 0.75 0.75 0.75 0.75 0.22833333333333333 0.75 0.75 0.09833333333333338 0.75 0.45833333333333326 0.5954545454545457 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 -4.996780303030299 0.75 0.75 0.45224747474747473 -46.96003787878788 2.0556060606060607 0.75 0.75 0.75 0.75 0.6092424242424244 0.75 0.75 -0.06458333333333344 0.75 0.75 0.75 0.75 0.75 -0.2991161616161617 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 -37.71674242424242 0.9742424242424241 0.75 0.75 0.75 0.75 0.29833333333333334 0.75 0.75 3.3446338383838343 0.75 0.75 0.75 11.885959595959598 0.75 0.75 -0.35265151515151516 0.75 0.75 0.75 -15.392474747474742 0.26 0.75 0.75 0.14924242424242418 0.75 0.75 0.75 0.75 3.234957912457908 0.75 0.75 0.75 18.443333333333328 0.4947222222222223 0.75 -0.6173611111111111 -0.07291666666666663 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.5123484848484849 0.75 0.75 0.75 0.75 2.8217382154882156 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 1.1348484848484848 0.75 0.75 0.75 0.6025757575757577 -0.7722222222222221 0.3358333333333333 -0.12291666666666679 -2.756161616161613 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 -2.5869949494949487 0.75 0.4083333333333332 0.75 0.75 1.1556186868686873 0.75 0.75 0.4075 0.75 0.75 0.75 0 0.75 1 0.75 0.75 0.75 0.75 -0.9093939393939394 0.75 0.75 0.75 0.75 1.1487121212121212 0.75 0.75 0.75 0.37083333333333335 0.5176767676767677 0.75 0.75 0.49136363636363634 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 1 17.731489898989906 0.75 0.75 0.75 0.75 -0.04791666666666661 0.75 0.75 0.75 -0.13541666666666674 0.75 0.75 0.75 0.5857575757575757 11.714288720538727 0.39583333333333337 -0.033333333333333326 0.75 -0.012499999999999956 0.75 0.75 0.75 0.75 0.75 0.75 0.1925 0.75 -0.6986742424242424 0.75 0.75 0.75 0.75 0.75 0.23659090909090907 0.75 -0.26989898989898764 1 -0.48503787878787874 0.75 49.18325757575757 -0.29080808080808085 -0.07499999999999996 0.75 0.30868686868686873 0.75 -0.4808080808080808 0.75 0.75 0.75 0.75 19.149478114478114 0.13416666666666666 0.75 0.75 0.75 -0.32790404040404053 0.3016666666666667 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 -48.85719696969697 0.2875 0 0.08499999999999996 1.0931818181818187 -3.3095959595959594 0.75 0.75 0.545 0.75 0.75 0.75 0.75 1 0.75 0.75 0.75 0.75 0.75 0.29 0.75 0.75 -0.022916666666666696 -0.14500000000000002 0.3458333333333332 0.75 0.39916666666666667 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 -0.04791666666666661 -0.053030303030303094 0.75 0.75 0.75 0.75 -49.09083333333332 0.32916666666666666 0.75 0.75 0.75 0.44083333333333335 0.75 0.75 0.15340909090909083 -0.6030303030303006 0.75 0.2688888888888889 -0.07499999999999996 -0.5479166666666666 -0.719128787878788 -1.0554924242424242 0.02083333333333337 0.5309090909090908 -0.7167929292929294 0.75 0.5503787878787878 -1.034469696969697 0.75 0.75 3.970202020202011 0.3766666666666667 -0.35609427609427713 -6.946313131313131 0.75 0.75 0.5525 0.75 0.75 0.37416666666666665 -0.27108585858585854 0.75 -3.577462121212121 -0.08958333333333335 1 0.75 0.30833333333333335 -0.1078787878787878 -29.782979797979795 0.75 0.75 0.2351767676767677 0.75 0.6875757575757576 -6.432449494949495 0.75 0.75 0.75 -3.1942424242424243 0.30083333333333334 0.75 0.43166666666666664 0.35583333333333333 0.75 0.75 0.75 -0.5541666666666667 2.014924242424242 0.75 0.75 0.75 0.75 0.75 -0.375 2.1460227272727233 0.75 3.802508417508414 0.75 0.473030303030303 0.75 -0.05833333333333335 0.75 -0.3728535353535354 0.75 -0.6388257575757577 -3.284343434343432 0.23583333333333334 -0.275 0.75 0.75 0.75 0.583270202020202 0.75 0.75 0.75 0.75 0.75 0.7603030303030303 0.75 0.75 0.75 0.75 0.026704545454545592 0.75 0.75 0.75 0.75 0.6937500000000001 0.75 0.75 -0.3583333333333334 0.75 0.75 0.75 0.75 0.75 0.32318181818181824 0.75 0.5866414141414142 0.75 -0.006249999999999978 0.2534090909090909 0.75 0.75 0.5893181818181819 0.75 0.75 1.0019023569023549 0.5725 0.75 0.35750000000000004 0.75 -0.14943181818181817 0.75 -1.3645833333333335 0.75 0.75 0.75 -2.0479166666666666 -1.2625 0.75 0.75 1.163510101010101 0.3258333333333333 0.75 0.75 0.75 0.75 0.75 0.75 0.3472727272727273 0.3491666666666667 0.75 -0.4517045454545454 0.75 0.75 0.75 -8.960164141414142 0.75 0.75 -0.1020833333333333 0.75 0.379469696969697 2.0592803030303033 0.75 0.75 -0.5229545454545432 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 6.025959595959598 0.75 0.75 0.75 0.75 0.75 41.44387626262626 0.75 0.75 0.75 0.75 0.75 0.75 0.75 -0.8814393939393965 -0.9935858585858595 0.75 0.75 0.75 1.16984848484848 -0.2250000000000001 0.75 0.75 0.75 -1.4840277777777777 -2.4503156565656576 -0.7823863636363635 0.75 -1.61875 0.75 -6.8558922558922575 32.67685185185186 0.75 0.75 0.75 -0.21250000000000002 0.014393939393939403 0.75 -0.02499999999999991 0.75 0.75 0.75 0.75 1.0733333333333333 0.75 0.75 -11.300820707070706 0.03257575757575759 0.75 0.75 0.5176262626262627 0.75 0.75 0.3270833333333334 0.75 0.75 4.789974747474746 0.75 0.75 0.75 0.75 7.794368686868687 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 -0.2895833333333333 0.5846212121212121 -0.22083333333333344 -0.2653030303030304 0.75 0.75 0.75 0.2690909090909091 0.75 0.5854040404040404 0.75 0.75 6.8371212121212075 0.75 0.75 0.75 0.75 -1 0.75 0.75 0.75 -2.0063131313131315 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.21916666666666668 0.75 -0.15416666666666667 0.985 -2.1649621212121217 0.75 0.75 0.75 0.75 0.138459595959596 0.75 0.75 0.75 0.75 0.75 0.28154040404040404 0.75 0.75 0.75 scenario heads-up maniac deals 1000 seed 1592590337 -counts 5741 158 0 -samples -0.13497474747474736 -0.0938762626262668 -0.9336489898989898 14.813030303030306 -0.7865530303030304 -0.44267676767676734 -2.557474747474748 -6.637058080808076 1.1992382154882204 -0.19241161616161628 0 12.785921717171721 1.381969696969692 -14.253535353535355 -2.3708333333333336 -0.15626262626262621 -4.589949494949496 -0.3125 -0.01071969696969699 -0.5367424242424241 -0.05340909090909074 -2.4096590909090905 -39.56691919191919 0.04806818181818073 0 0.03333333333333344 9.391186868686857 0 -2.5078030303030303 1.2313636363636418 2.4464436026936056 8.500454545454547 0.2738762626262584 1.1912457912457906 0 -1.877651515151515 21.4020202020202 -2.549301346801342 0.4204545454545454 -2.49354797979798 -1.3142676767676769 -0.058800505050504825 1.8174747474747477 -8.440707070707074 -0.01496212121212126 0.06255050505050502 0.5368939393939349 46.51159090909092 0 11.044242424242425 -0.7591919191919194 -0.9484848484848487 -1.1653030303030303 0.1469949494949495 -0.696780303030303 45.76357323232324 1.1353535353535351 -0.6571969696969696 -1.6963636363636365 2.168055555555555 -0.75 -4.720681818181818 0.46825757575757576 0.3538131313131313 -2.5315404040404044 -1.6103787878787879 -2.89310606060606 2.2713636363636356 1.3884090909090916 -0.3436489898989874 0.8979419191919193 0.039166666666667016 10.992121212121212 10.195202020202018 0.6686111111111118 0.304520202020202 -3.857702020202021 1.5078072390572363 -1.9940656565656565 -1.8454545454545457 1.983585858585859 42.1108207070707 7.349309764309765 -11.873358585858586 -18.18693181818182 -2.342651515151515 -20.945538720538725 9.842803030303031 -1.5322727272727272 -5.639987373737373 -0.6178282828282833 7.4160101010101 1.8690235690235744 -2.3954545454545455 1.384520202020202 -1.937878787878788 0.3358333333333333 -5.904356060606067 -2.009406565656566 -0.7787878787878788 0.15202020202020194 0.4678030303030305 -1.3969318181818182 0 0.4231565656565657 -5.630000000000001 2.5116666666666667 -1.4118181818181819 -0.2908333333333333 -0.3576893939393939 -0.75 43.09782828282829 -0.901300505050505 0.07250000000000006 39.57138888888888 0.9732702020202013 4.2617045454545455 44.22588383838384 -0.04791666666666683 -0.29015151515151516 -0.27 1.2072390572390566 1.190795454545455 2.302083333333334 1.0186363636363636 47.936313131313135 -0.8834595959595959 0.41840909090909095 42.96207070707071 28.816010101010104 -0.6281439393939395 -40.33636363636363 0.6417676767676767 -3.823888888888891 44.781830808080805 -0.3210227272727273 5.754776936026941 0.17707070707070705 -5.744191919191918 -2.622916666666667 2.2985479797979798 0.0086489898989901 -2.7420833333333334 0.009987373737373906 18.06679292929293 2.6710984848484802 47.967718855218855 -0.9638257575757576 -7.014128787878786 -0.19291666666666663 -0.7235353535353534 -0.3362373737373736 48.75416666666667 0.09265151515151515 -1.8606691919191918 0.44565656565656564 -0.9383964646464646 -0.4409090909090907 -0.46378787878787886 7.429797979797979 -0.3179166666666666 0.05770202020201998 2.81719696969697 0.4762500000000003 0.5783333333333334 -41.95055555555555 -0.09375 -0.3359090909090907 0.8679545454545456 -0.6774242424242424 13.550265151515154 0 -0.49655303030303033 0.5321969696969697 -2.8623358585858583 7.489541245791245 -1.2737331649831671 -0.15333333333333332 -2.0445833333333336 0.00034090909091366584 0 -1.973611111111111 -1.8431818181818185 -0.043749999999999956 -2.7502651515151517 -0.14069444444444446 1.0234217171717217 -0.6160984848484847 2.2406439393939395 -0.024191919191921762 -22.377020202020205 -0.9302651515151514 0.28368686868686865 32.96483585858586 -0.7930303030303031 -1.7978535353535352 -0.04746212121212123 0.2237499999999979 -2.122840909090909 0 0 -6.702462121212122 0.09999999999999976 0.9779545454545464 0.2457070707070732 -30.87186868686869 -2.6 -0.6775883838383838 0.031249999999999778 -1.8934974747474749 0.30416666666667136 1.4262121212121213 0.2488005050505051 -4.239457070707073 -2.020770202020202 4.804840067340067 -0.7332070707070706 2.3511742424242423 0.2546717171717172 39.64814393939394 0.7725631313131315 -0.7989267676767675 2.0704924242424236 1.0705597643097668 -1.6140656565656566 -1.8192550505050504 -0.20272727272727287 -5.654545454545453 -2.3420454545454548 -46.99181818181819 48.26578282828283 -0.33765151515151504 6.545202020202019 -0.1912499999999998 -0.1541287878787878 -12.626363636363637 -0.125 -5.997424242424243 -0.5557575757575758 9.513308080808079 -0.4965909090909092 46.713750000000005 -0.05191919191919192 -1.8026893939393938 0.44007575757575734 28.32594696969698 -2.9762500000000003 29.571578282828284 -0.07666666666666666 2.4377651515151513 0.75 0.7214393939393893 -2.9314015151515154 -0.22784090909090926 -0.6850378787878788 0.3640151515151515 47.19886363636363 1.3547474747474744 -8.319053030303031 -0.3138257575757575 4.0561742424242375 -0.36073232323232307 -0.6173358585858586 2.2 3.804877946127947 7.134974747474756 -0.8123358585858587 -0.6070833333333333 1.1472727272727274 0 0.298484848484851 2.084318181818182 7.62631313131313 -2.5166666666666666 0.21186868686868365 3.076262626262626 -0.10132575757575757 -5.284772727272729 -1.7169570707070707 4.560871212121211 27.98293350168351 -0.18708333333333338 -0.8241792929292928 0.04185606060606095 4.279848484848484 3.447209595959605 0.5906565656565632 1.8384890572390562 -1.827929292929293 -0.3915909090909091 8.151325757575759 -0.008825757575762094 -2.748522727272727 0.445 -0.7644318181818182 2.791919191919192 -0.31420454545454546 -0.5177651515151513 -26.355113636363633 -0.15833333333333321 -2.0540404040404043 -0.23564393939393946 2.317020202020199 -3.300063131313131 33.12190656565657 -0.3078914141414142 48.01428451178451 -2.0144696969696967 -0.2877020202020202 0 1.7049999999999998 0.1537878787878788 0.4327272727272725 7.256818181818177 -7.446893939393938 0 -1.7511363636363633 -0.8220328282828282 -2.0645202020202023 31.21318181818182 -0.782537878787879 2.397234848484848 -0.01041666666666663 -6.539848484848481 -0.7323863636363637 9.387537878787878 1.0803114478114457 -1.9809343434343436 0.8141666666666691 48.532272727272726 0.3425 -0.5333964646464647 -6.526553030303031 39.73833333333333 -0.09708333333333297 -0.377739898989899 1.3242424242424298 0 0 -0.19261363636363638 0.48011363636363186 0.35583333333333333 -0.17676767676767613 -0.15446969696969692 -23.428535353535352 -0.45462121212121476 5.062929292929293 0.5260984848484851 -0.9394402356902369 -2.666666666666667 0.16449494949494947 -0.6047348484848483 -0.8665656565656567 -0.17374999999999996 0.5545033670033697 -0.75 0.46881313131313374 0 -2.3895833333333334 2.446590909090909 -0.9035353535353536 -1.3548569023568975 13.374621212121221 -0.31234848484848476 -1.9931818181818184 -8.99708333333333 -0.601439393939394 31.386300505050507 -2.9582954545454543 28.2214436026936 -5.724810606060606 -0.631439393939394 -0.7096590909090912 2.2213383838383836 -0.7634974747474749 0.3508080808080808 -0.75 -0.051969696969697 -1.9594065656565653 0.09222222222222598 -2.15334595959596 2.4869696969696973 0.48882575757575975 14.933888888888887 -2.5393560606060603 0.040000000000000036 1.966969696969697 -0.25625 0.5711363636363637 38.633569023569024 1.2358207070707063 -0.11061868686868642 -0.04234848484848486 0.12291666666666667 44.80847222222223 -0.5736742424242424 0.5113005050505006 -2.419204545454545 18.917575757575758 0.11506313131313128 -2.601590909090909 -0.5113005050505053 7.856144781144785 -1.9993181818181818 0.06666666666666687 3.7998106060606016 -4.11515151515151 47.61313131313131 0 -2.0219318181818178 -0.018750000000000044 34.17787878787878 1.0168560606060562 -1.5550757575757577 5.396805555555556 -2.144128787878788 -0.07291666666666663 0.17106060606060602 4.146468855218855 0.15489898989898987 0 -2.3079545454545456 -27.9397601010101 1.704987373737373 2.1062878787878763 12.46580808080809 2.4748863636363634 0.1628661616161664 6.157575757575769 -3.840391414141415 -0.5361111111111111 -0.5382575757575755 -0.5169318181818181 -5.837121212121213 -0.313699494949495 -0.22702020202020168 2.2587121212121213 -1.2778787878787878 -1.480050505050505 -0.1293181818181819 21.327462121212122 -0.6583333333333332 30.19693181818182 2.33060606060606 -1.603901515151513 0 2.0986742424242415 -0.028977272727272352 -3.633131313131315 -3.0491161616161615 -2.397348484848485 1.0658333333333383 1.4639015151515196 -0.4343560606060607 -0.2840909090909096 -0.025593434343429866 -0.874242424242424 -2.202727272727273 5.504545454545455 -0.004166666666666874 -2.381931818181818 -1.8648484848484848 0.3661363636363636 -0.05060606060606054 0.6469570707070753 -1.3739898989898993 0 -3.0816287878787882 2.465 0.16462121212121206 45.2539393939394 0.4063636363636369 -3.731881313131316 0.19166666666666665 2.18125 -40.23963383838384 0 0.9624494949494904 -0.5254545454545455 -5.8007954545454545 -0.5893181818181817 -1.498169191919192 -0.6195075757575756 -38.10075757575758 1.0583333333333333 2.7705303030303057 0.8237121212121216 1.5666624579124568 -0.002083333333333437 -0.2132954545454545 -11.936325757575759 -3.174545454545455 0.28333333333333144 0.3720833333333333 -2.667550505050505 0.1526220538720492 0.10755050505050501 -2.7416035353535357 -0.20833333333333337 45.85378787878787 -0.2416666666666667 -1.2495833333333333 0.19833333333333347 -17.967424242424244 -0.39513888888888893 0.13268939393939405 23.00848063973064 -0.05208333333333337 0.5906818181818181 -1.8873358585858586 -1.918712121212121 -1.1483585858585859 9.272462121212122 -1.2491287878787878 -14.670833333333338 -0.4892045454545455 1.7198232323232294 -1.1103282828282828 -0.1734469696969697 -0.605568181818182 -0.75 -0.05045454545454531 -0.17113636363636364 -2.936414141414141 -0.2695833333333333 -1.196401515151515 0.3625 -2.0125378787878785 -1.9256439393939393 -4.378977272727274 -6.409911616161616 -0.5449242424242424 -0.06875000000000009 1.4023611111111156 -43.71748737373737 -2.700707070707071 -3.7505681818181844 -1.9656565656565657 -0.044406565656568475 -2.6437500000000003 46.47208333333334 -0.33204545454545453 0.3894065656565656 0.75 -2.1164772727272725 -0.13292929292929279 0.2604545454545455 35.412272727272736 -0.1296590909090909 1.3155050505050503 -0.21905303030303447 -0.24859848484848496 8.284974747474752 47.774810606060605 4.805050505050506 -2.9576136363636367 -5.628661616161617 0.17420454545454556 0.06585858585858595 3.032828282828283 17.509953703703708 -0.7465151515151516 -0.7671464646464645 0.4700757575757575 -1.4958207070707092 -0.3525252525252527 0 -1.175416666666667 21.53907828282828 -2.716666666666667 -0.47492424242424236 5.22094696969697 0.05662878787878778 0.19026515151515155 -0.039583333333333304 -10.186237373737372 7.444570707070707 0.32333333333333325 0.9018686868686867 -1.960290404040404 -1.9271590909090908 -0.15321969696969728 0.5455681818181819 -0.28541666666666654 -0.05012626262626252 -2.0013257575757573 0.7093181818181817 3.7950378787878787 -2.268977272727275 -0.21598484848484834 0.2917676767676768 -1.8696338383838382 1.7331228956228948 0.07847222222222228 -1.247020202020202 -0.8387500000000045 0.8370707070707072 -48.77983585858587 -0.4650126262626264 -37.257954545454545 0.24772727272727468 47.6724537037037 -0.18819444444444455 -0.17393939393939395 0.385 -1.699166666666664 2.2621590909090914 -0.19324494949494953 0.40416666666666656 -0.9064520202020202 -6.3449494949494945 47.05386363636364 -2.2778409090909086 0.0877525252525252 1.200946969696969 -0.12749999999999995 -1.355757575757576 -1.304469696969697 0.10833333333333317 0.03893939393939383 -0.5916666666666668 -2.036300505050505 -0.014166666666671102 -0.1070833333333332 -0.3450757575757577 -0.15636363636363632 -0.6601010101010101 -0.81375 -13.624962121212123 8.911931818181818 0.16893939393939417 0.060833333333333184 8.298106060606061 20.434722222222227 12.560113636363646 0.10624999999999996 0 0 0.25 9.312651515151515 -0.040467171717171846 -0.15988636363636355 1.4683922558922538 -1.2175 -34.68645202020202 -1.9307575757575757 -0.8808333333333334 -0.35722222222221944 -1.6020833333333333 0.004166666666666763 -0.7887752525252526 -1.7382702020202019 0.85029461279461 -1.8688131313131313 -0.10992424242424237 -0.2097727272727271 -4.5359974747474645 -0.10833333333333317 7.619427609427608 0.41936868686868684 -0.22212121212121216 -8.846115319865316 0.3441666666666667 -25.46090909090909 -1.4891287878787876 -1.5533459595959596 9.296969696969693 -0.047916666666672825 -0.5005681818181817 -39.939204545454544 1.4045454545454552 43.6469696969697 13.108648989898994 -36.0519696969697 -0.23204545454545444 2.2050757575757576 -0.52625 -10.514810606060607 1.5994318181818183 0.09797979797979794 -12.419848484848487 -0.5495454545454521 0.63896043771044 -0.5980176767676769 0.09750000000000014 -13.618434343434345 -0.37109848484848507 0.40265151515151515 -2.0797348484848484 3.366578282828282 -0.1312500000000001 -1.977335858585859 40.44734848484848 -10.516136363636363 -2.493181818181818 0.26 -2.0857323232323237 0.49995791245790744 -0.7216666666666663 -1.3280303030303031 -2.310416666666667 48.89073232323232 -3.0775883838383837 0 -1.7856186868686872 41.226704545454545 0.002083333333333215 -0.21584595959595965 48.86212121212122 0 -1.878787878787879 -13.439217171717171 0.09946969696969232 -2.6756060606060608 -0.32991582491582216 0.11333333333333334 -4.808712121212118 -5.7183712121212125 41.13207070707071 7.12726851851852 0.2649999999999997 3.9099999999999993 5.398181818181819 3.8619528619528567 1.494507575757575 -2.6517424242424243 -0.37695707070707085 1.6047727272727275 -0.7155303030303033 -8.59652777777778 38.80349747474748 -1.2284469696969698 -4.829924242424242 -0.16875000000000018 4.798834175084174 -0.005808080808080707 0.07638888888888884 -1.2445833333333334 42.28098484848485 -0.09375 1.3607828282828325 0 0.016666666666666496 -0.9255681818181819 4.900542929292937 -0.594760101010101 -0.31742424242423795 0.75 0 17.783333333333324 33.96858585858586 0.10977272727272724 -0.06833333333333347 0 -1.6911279461279438 -2.288219696969697 -22.62632575757575 -1.4750757575757574 -1.4914772727272727 0.12993686868686877 47.68628787878788 2.7325757575757574 0.005227272727272969 3.024166666666667 3.7164688552188543 -2.1662878787878785 -1.3213636363636363 -2.135353535353535 -0.8041666666666667 0.5660984848484802 -2.2976136363636366 -2.008143939393939 1.088535353535346 -2.0451515151515154 0.4 4.49888888888889 -4.417159090909091 -0.1363257575757576 32.75761363636364 -0.8210227272727298 -0.7030303030303031 5.208686868686872 5.823131313131313 -1.40010101010101 -0.12500000000000044 -45.17265151515152 11.627651515151523 44.57779882154882 -1.8823863636363634 0.07083333333333319 7.038295454545455 -5.918063973063979 19.17018097643098 -13.44741161616162 -0.933939393939394 -2.4640909090909093 0.9674242424242425 -1.7820075757575757 0.3641666666666667 -2.501098484848484 -17.598674242424245 3.4321969696969656 -0.13541666666666674 -2.773169191919192 -4.041843434343434 -2.8551136363636385 0.05833333333333357 -2.308068181818182 0.6193602693602716 -2.9175 -1.1171085858585856 -0.1644444444444445 -4.153787878787879 -0.4395833333333332 -0.21693181818181828 36.044330808080815 -2.4642803030303027 -0.8831439393939393 0 46.25002104377104 5.447739898989898 -1.9671969696969696 0.17291666666666639 0.1102272727272724 1.0951767676767723 2.4312500000000004 3.005075757575758 3.077651515151516 -0.26382575757575744 0 -2.555416666666667 -0.7984090909090907 0 0.5616666666666666 -0.04166666666666696 0.048257575757576 -2.776136363636364 -3.000277777777778 -0.23958333333333337 -7.995551346801344 48.50757575757576 42.470113636363635 -2.545479797979798 10.81508838383838 -3.3325547138047136 0 -1.9788257575757577 3.682689393939394 -22.553611111111124 -4.247891414141416 0.27888888888888885 0 2.381818181818182 -0.8242803030303028 -0.5195833333333334 2.3021254208754156 1.9878787878787874 7.793446969696969 0.4556818181818183 46.585189393939395 -0.7109217171717173 0.3383333333333333 -0.5793560606060606 -1.8068560606060606 28.778750000000002 4.413573232323231 -0.7141666666666666 0 34.84659090909092 5.008585858585862 0.38114898989898993 -2.1225757575757576 1.3573442760942807 -1.7334469696969697 -5.179280303030303 1.280479797979793 0.18666666666666676 0.3344318181818182 8.708244949494947 -2.4484469696969695 -1.3646338383838383 -0.643560606060606 2.752878787878788 -0.6940025252525253 -42.46974747474748 2.2817045454545406 -1.1864898989898989 46.538952020202025 -5.4290404040404034 -29.751755050505047 -2.74885101010101 -0.5396969696969697 6.14907407407407 -23.29483585858586 -4.020833333333336 -0.8234722222222222 -2.1477230639730616 14.871969696969693 -3.58510101010101 0 -0.36469696969696974 0.13876262626262625 -0.5799873737373737 4.3399663299663365 -0.75 -0.28680555555555565 4.726249999999999 -0.008333333333333304 5.1613425925925895 30.098787878787878 -1.1966666666666668 1.0151515151515151 -0.9349621212121212 -0.8270833333333334 -3.4017045454545456 -0.3790656565656563 5.0625 0.045580808080808 -1.489507575757576 1.7649873737373736 1.0527525252525232 -2.321161616161617 -0.16208333333333336 -0.7460227272727273 36.6402398989899 -6.061174242424243 -3.40550505050505 -0.1725000000000002 -0.5482323232323232 -8.042727272727273 -0.3196969696969697 -1.5866540404040403 -3.160681818181818 0 -0.6598484848484849 0.40578703703703667 -0.7776641414141414 44.134520202020205 -0.07468434343434383 32.954823232323236 -40.186439393939395 -1.884154040404038 0.062499999999999556 -2.5206439393939393 -0.07190656565656561 -1.7163636363636363 0.28623737373737373 -2.513409090909091 -0.2288257575757573 -0.13333333333333353 -5.789393939393939 0.4075757575757577 2.9087121212121207 0.4182323232323232 0.642121212121217 0.8635774410774433 8.886805555555556 0 -0.7635101010101011 -1.6072348484848482 -0.38742424242424234 37.735542929292926 -0.16282828282828266 0.37424242424242427 2.0865151515151505 -1.0903787878787878 0.12049242424241946 0.16180555555555554 -1.365037878787879 0.3393181818181818 0.014898989898990411 -2.238257575757576 4.403867845117847 29.49625 42.31376262626263 -0.02998737373737348 0.796734006734009 0.04242424242423792 -0.21511363636363667 -1.8651515151515152 0.8421085858585811 8.948787878787877 4.373257575757575 -0.15416666666666667 -2.2541666666666664 18.56159090909091 -1.7717297979797983 -16.96414141414141 2.0648232323232323 -34.244659090909096 3.171022727272728 -0.8697727272727274 0.807201178451183 -0.3011237373737373 0.38083333333333336 0.6401010101010101 2.548232323232323 -0.06738636363636374 -2.149924242424243 -0.3778030303030304 +counts 6480 8 0 +samples -0.13497474747474736 -0.0938762626262668 8.258699494949493 14.813030303030306 42.327083333333334 -0.44267676767676734 -2.557474747474748 -22.023421717171715 1.1992382154882204 -0.19241161616161628 -3.5498484848484857 10.2722095959596 -1.6271212121212173 26.171767676767676 0.5837121212121218 -0.15626262626262621 -11.738939393939397 2.9425 -0.01071969696969699 -0.5367424242424241 -0.1693181818181817 -2.4096590909090905 -36.582070707070706 0.04806818181818073 0 -0.6118939393939393 9.391186868686857 0 1.227045454545455 -28.117121212121205 -22.343985690235687 19.66560606060606 0.2738762626262584 0.5734427609427604 0 1.3473484848484851 1.3010101010100996 -2.549301346801342 0.4204545454545454 8.934482323232324 -1.3142676767676769 -0.058800505050504825 1.8174747474747477 -10.599797979797984 -0.01496212121212126 0.06255050505050502 0.346893939393935 44.02623737373738 -0.24295454545454542 11.044242424242425 -0.7591919191919194 -0.9484848484848487 0.5468181818181821 -11.619671717171718 -0.696780303030303 12.634785353535356 -7.281313131313131 -0.6571969696969696 -1.6963636363636365 2.0388888888888888 -0.75 0.2793181818181818 0.46825757575757576 0.3538131313131313 -10.031540404040403 -1.6103787878787879 0.5841666666666667 2.2713636363636356 1.3884090909090916 -0.3436489898989874 -6.495214646464646 0.07416666666666716 10.992121212121212 6.145429292929291 0.6686111111111118 0.304520202020202 -3.115277777777778 1.5078072390572363 -1.9940656565656565 -1.8454545454545457 1.983585858585859 39.88036616161616 7.349309764309765 -41.20146464646464 17.81306818181818 1.3164393939393944 -23.021296296296295 17.069621212121213 -0.0868181818181819 -28.139987373737373 -0.504343434343435 15.019393939393936 -10.950673400673388 8.647727272727273 1.384520202020202 -1.937878787878788 0.3358333333333333 -1.5924873737373693 -2.640618686868687 -0.7787878787878788 5.076565656565656 0.4678030303030305 -1.3969318181818182 0 0.4231565656565657 -0.6300000000000003 1.5116666666666665 -1.4118181818181819 -0.2908333333333333 -0.675871212121212 -0.75 43.09782828282829 -0.901300505050505 0.07250000000000006 17.071388888888883 -5.971174242424241 -28.670113636363638 20.839520202020203 -0.6520075757575758 -0.29015151515151516 -0.27 -0.7662457912457921 1.190795454545455 2.718901515151515 1.0186363636363636 16.034797979797986 -3.8834595959595957 0.41840909090909095 -0.31065656565656496 28.816010101010104 -0.6281439393939395 -40.33636363636363 0.6417676767676767 4.080656565656565 44.781830808080805 0.01170454545454569 -16.74522306397306 0.17707070707070705 -0.9098484848484869 -3.310416666666667 2.2985479797979798 0.0086489898989901 -2.7420833333333334 -1.990012626262626 18.06679292929293 -0.52890151515152 47.967718855218855 -2.510492424242424 2.8722348484848492 -0.19291666666666663 -0.7235353535353534 -3.3788383838383798 48.75416666666667 0.09265151515151515 -4.58036616161616 0.44565656565656564 -0.9383964646464646 -1.1251515151515148 -0.46378787878787886 5.0093434343434335 -0.3179166666666666 0.703914141414141 2.81719696969697 0.4762500000000003 0.5783333333333334 -1.9447979797979684 -0.09375 -0.3359090909090907 0.8679545454545456 -0.6774242424242424 13.550265151515154 0 -0.49655303030303033 0.5321969696969697 -2.8623358585858583 7.489541245791245 0.2536910774410752 -0.15333333333333332 -2.0445833333333336 0.00034090909091366584 0 -5.8902777777777775 -1.9131818181818185 -0.0012499999999999734 8.045189393939397 -0.14069444444444446 1.0234217171717217 -0.6160984848484847 2.2406439393939395 -0.024191919191921762 -24.15984848484849 0.600037878787879 0.28368686868686865 13.923926767676758 -0.7930303030303031 -2.830429292929293 -0.04746212121212123 0.2237499999999979 0.9226136363636361 -38.849318181818184 0 8.297537878787878 0.09999999999999976 0.9779545454545464 -5.587626262626262 8.817525252525254 -2.6 18.442108585858584 0.031249999999999778 -5.241982323232323 0.30416666666667136 1.4262121212121213 -0.194760101010101 -2.080366161616162 -2.7458459595959597 4.663552188552188 -5.192853535353535 2.3511742424242423 0.2546717171717172 37.46632575757576 0.7725631313131315 -0.04165404040403975 2.0704924242424236 0.31449915824916075 -18.795883838383837 1.332260101010101 -0.20272727272727287 8.234343434343433 -2.5295454545454548 -31.037272727272736 45.41123737373738 -0.33765151515151504 6.545202020202019 -0.1912499999999998 -0.1541287878787878 35.46431818181818 -0.125 -5.997424242424243 -0.5557575757575758 13.118030303030302 -0.4965909090909092 46.713750000000005 -0.05191919191919192 -1.8026893939393938 0.44007575757575734 28.32594696969698 -2.9762500000000003 27.4617297979798 -0.07666666666666666 2.4377651515151513 0.75 0.7214393939393893 2.0685984848484846 -0.22784090909090926 -0.6850378787878788 0.3640151515151515 47.19886363636363 3.5138383838383827 5.99912878787879 -0.3138257575757575 4.0561742424242375 -0.36073232323232307 -0.6173358585858586 2.2 3.0154840067340074 0.1905303030303127 -0.8123358585858587 -0.6070833333333333 1.1472727272727274 0 -1.1787878787878765 2.084318181818182 5.387676767676766 0.7787878787878784 0.21186868686868365 -3.047196969696967 23.01905303030303 3.0485606060606054 -1.7169570707070707 22.607790404040404 27.98293350168351 -0.18708333333333338 -0.8241792929292928 -0.7105681818181815 4.279848484848484 -5.089154040404031 0.5906565656565632 1.8384890572390562 -1.827929292929293 -0.3915909090909091 7.273371212121213 -0.008825757575762094 1.1923863636363639 0.445 -0.7644318181818182 2.361616161616162 -0.31420454545454546 -0.5177651515151513 18.030946969696974 0.9716666666666667 -19.434419191919194 -0.23564393939393946 2.317020202020199 -3.300063131313131 -10.244154040404034 48.03448232323232 48.01428451178451 -2.0144696969696967 -5.845277777777778 0 1.7049999999999998 0.1537878787878788 0.4327272727272725 7.256818181818177 -14.45901515151515 0 -2.709772727272727 -0.8220328282828282 -1.784520202020202 31.21318181818182 -0.782537878787879 0.7495075757575751 -0.01041666666666663 -6.539848484848481 -3.2323863636363637 -35.78723484848485 1.0803114478114457 -2.010934343434344 -7.519166666666667 47.30053030303031 0.3425 -0.5333964646464647 -6.526553030303031 2.0933333333333337 -3.097083333333333 -0.377739898989899 1.3242424242424298 -0.07931818181818184 0 4.7420580808080794 -0.11079545454545903 -0.6441666666666666 -0.17676767676767613 -0.15446969696969692 -42.64065656565656 -0.45462121212121476 5.062929292929293 0.5260984848484851 -11.918817340067344 -2.666666666666667 -0.6248989898989898 -0.6047348484848483 -0.8665656565656567 -0.17374999999999996 0.5545033670033697 -0.75 0.46881313131313374 0 1.2505681818181822 2.446590909090909 -1.6042929292929293 -1.3548569023568975 7.2281565656565645 -0.31234848484848476 1.0793181818181814 3.749128787878788 -0.601439393939394 31.386300505050507 -2.9582954545454543 18.571443602693602 2.109280303030304 -0.631439393939394 -0.7096590909090912 2.2213383838383836 -0.7634974747474749 0.3508080808080808 -0.75 -0.051969696969697 -1.9469065656565652 0.09222222222222598 -2.3149368686868685 2.4869696969696973 0.48882575757575975 14.933888888888887 -3.2166287878787885 0.040000000000000036 1.966969696969697 -0.25625 0.5711363636363637 29.633569023569024 1.2358207070707063 -0.11061868686868642 -0.04234848484848486 0.12291666666666667 44.80847222222223 -0.5736742424242424 0.5113005050505006 8.808068181818182 18.917575757575758 0.11506313131313128 0.3870454545454538 -43.40559343434344 6.125084175084179 -1.9993181818181818 0.006666666666666932 3.7998106060606016 -4.11515151515151 45.32525252525252 0 -2.0219318181818178 -0.018750000000000044 -5.185757575757577 1.0168560606060562 -0.2535606060606058 -24.80016414141414 -2.144128787878788 -0.07291666666666663 0.17106060606060602 4.146468855218855 0.15489898989898987 0.375 0.4193181818181821 -27.9397601010101 -5.239457070707069 2.1062878787878763 0.46580808080809 2.4748863636363634 -29.37501262626262 -0.16060606060605043 -12.543421717171725 -0.5361111111111111 -0.5382575757575755 -0.5169318181818181 8.336060606060606 -0.313699494949495 -0.22702020202020168 2.563257575757576 2.722121212121212 23.78510101010101 -0.1293181818181819 -1.1725378787878817 1.3416666666666668 30.19693181818182 2.33060606060606 -1.603901515151513 0 2.0986742424242415 -0.0592045454545449 4.7002020202020205 -3.0491161616161615 -4.993863636363638 1.0658333333333383 1.4639015151515196 -0.4343560606060607 -0.22348484848484906 -0.025593434343429866 -2.521969696969697 -2.202727272727273 5.504545454545455 -0.004166666666666874 8.697613636363636 -1.8648484848484848 0.3661363636363636 -0.05060606060606054 0.6469570707070753 -4.02929292929293 -0.5658333333333334 -3.0816287878787882 2.465 -11.489924242424243 45.2539393939394 0.4063636363636369 2.688573232323232 0.19166666666666665 2.18125 -40.23963383838384 -0.7019696969696969 0.9624494949494904 -0.5254545454545455 9.293674242424244 -0.5893181818181817 -2.077159090909092 2.3904924242424244 -53.90060606060606 1.0583333333333333 2.7705303030303057 0.8237121212121216 1.5666624579124568 -0.002083333333333437 -0.2132954545454545 -11.64506313131313 -8.66090909090909 0.28333333333333144 0.3720833333333333 5.511237373737373 0.1526220538720492 0.10755050505050501 -10.241603535353535 -0.20833333333333337 45.85378787878787 -0.2416666666666667 0.0004166666666667873 0.19833333333333347 -0.20308080808081286 1.1445833333333315 0.13268939393939405 23.00848063973064 -0.05208333333333337 0.5906818181818181 2.1126641414141414 -4.055075757575757 -1.1483585858585859 -3.0002651515151513 -1.2491287878787878 -14.670833333333338 -0.41806818181818217 1.7198232323232294 -1.1103282828282828 -7.150719696969698 -0.605568181818182 -0.75 -0.05045454545454531 -0.17113636363636364 -8.936414141414142 -0.2695833333333333 0.5990530303030301 0.3625 -2.0125378787878785 3.510719696969698 -4.378977272727274 -3.788699494949496 -0.5449242424242424 -0.06875000000000009 1.4023611111111156 40.03251262626263 7.161414141414141 4.582765151515152 6.231919191919191 -4.2110732323232325 2.962310606060606 40.47208333333333 -0.9184090909090908 0.3894065656565656 0.75 0.6638257575757578 -0.13292929292929279 0.2604545454545455 35.412272727272736 -0.1296590909090909 1.3155050505050503 -0.21905303030303447 -0.24859848484848496 8.284974747474752 0.27867424242423766 2.7898989898989903 5.701477272727274 16.163686868686867 0.17420454545454556 0.06585858585858595 3.032828282828283 17.509953703703708 -0.7465151515151516 -0.7671464646464645 0.4700757575757575 -1.4958207070707092 -0.3525252525252527 -36.039848484848484 -1.175416666666667 21.53907828282828 0.46083333333333343 -0.47492424242424236 5.22094696969697 0.05662878787878778 0.19026515151515155 -0.039583333333333304 -8.974116161616159 5.440782828282828 0.32333333333333325 -2.0981313131313133 -5.377866161616163 -1.9271590909090908 -0.28685606060606084 0.5455681818181819 -0.28541666666666654 -0.05012626262626252 29.22594696969697 0.7093181818181817 3.7950378787878787 -2.268977272727275 -0.21598484848484834 0.2917676767676768 -1.8696338383838382 1.7331228956228948 0.07847222222222228 -1.247020202020202 -23.338750000000005 -1.3750505050505049 26.760845959595965 -0.4650126262626264 -37.257954545454545 -5.585606060606061 47.6724537037037 -0.18819444444444455 -0.17393939393939395 0.385 -1.699166666666664 -0.021931818181817775 -0.19324494949494953 0.40416666666666656 -0.9064520202020202 -4.701313131313131 47.05386363636364 -2.749431818181818 0.0877525252525252 5.519128787878786 -0.12749999999999995 3.192727272727273 30.381893939393944 0.10833333333333317 0.03893939393939383 1.4083333333333332 -1.811300505050505 -0.014166666666671102 -0.1070833333333332 -0.3450757575757577 -0.15636363636363632 -0.3351010101010101 -0.81375 -11.548598484848487 8.312310606060606 0.16893939393939417 0.060833333333333184 -28.54795454545455 26.35075757575758 12.560113636363646 0.10624999999999996 0 -0.6862121212121213 0.25 0.1217424242424201 -0.11440656565656582 -0.15988636363636355 1.4683922558922538 -1.2175 -19.13089646464647 -1.9307575757575757 -0.06568181818181884 -0.35722222222221944 -16.147310606060607 0.004166666666666763 -0.7887752525252526 -1.7382702020202019 0.85029461279461 -1.8688131313131313 -0.24628787878787883 -0.2097727272727271 -4.5359974747474645 -0.10833333333333317 7.619427609427608 0.41936868686868684 -0.22212121212121216 5.042773569023571 0.3441666666666667 -5.460909090909091 -1.4891287878787876 -6.17455808080808 3.84242424242424 -0.047916666666672825 -0.6380681818181819 -39.939204545454544 0.6047727272727279 -42.74078282828283 11.707133838383843 -3.642878787878793 -0.23204545454545444 0.43234848484848465 -0.52625 -20.026174242424243 1.5994318181818183 0.09797979797979794 32.56030303030303 -0.5495454545454521 0.63896043771044 -0.5980176767676769 0.09750000000000014 -15.050631313131312 -0.37109848484848507 0.40265151515151515 4.3657196969696965 3.366578282828282 -1.5951893939393942 4.385921717171717 -0.6662878787878803 -0.016136363636363393 -2.493181818181818 0.26 -2.645353535353536 0.49995791245790744 -5.721666666666667 1.809469696969697 -2.310416666666667 48.89073232323232 -4.130618686868687 -2.91969696969697 -2.234684343434344 -4.0653409090909065 0.002083333333333215 0.008169191919191743 0.08457070707071068 -0.421590909090909 -7.242424242424242 -13.439217171717171 -2.0914393939393987 -16.505151515151514 -0.32991582491582216 0.11333333333333334 6.857954545454546 9.281628787878788 41.13207070707071 7.12726851851852 0.2649999999999997 3.9099999999999993 5.398181818181819 3.8619528619528567 1.494507575757575 -0.8562878787878783 -0.37695707070707085 1.6047727272727275 -5.253787878787882 -8.59652777777778 33.321679292929296 -1.2284469696969698 -31.98901515151515 -0.038750000000000284 4.798834175084174 -0.18133838383838385 0.07638888888888884 -1.2445833333333334 32.85825757575758 -0.09375 1.3607828282828325 -2.8259848484848478 0.016666666666666496 -0.9255681818181819 4.900542929292937 -0.594760101010101 -0.31742424242423795 0.75 0 17.783333333333324 -4.4405050505050525 0.10977272727272724 -0.06833333333333347 0 -1.6911279461279438 -2.288219696969697 -22.62632575757575 -1.4750757575757574 -1.4914772727272727 0.12993686868686877 47.68628787878788 2.7325757575757574 0.005227272727272969 3.024166666666667 3.7164688552188543 -2.1662878787878785 -1.3213636363636363 -5.779292929292929 -2.6564393939393938 0.07450757575757105 30.762992424242423 -2.008143939393939 1.088535353535346 1.9548484848484846 0.4 4.49888888888889 -4.798977272727279 -0.1363257575757576 30.916704545454543 -0.8210227272727298 -0.7030303030303031 -25.647373737373734 4.042828282828283 -1.40010101010101 -0.12500000000000044 27.600075757575752 11.627651515151523 44.339920033670026 -8.73465909090909 0.07083333333333319 4.538295454545455 -5.918063973063979 16.700484006734012 -13.44741161616162 -0.933939393939394 -2.4640909090909093 0.9674242424242425 -1.7820075757575757 0.3641666666666667 -0.4556439393939353 -17.598674242424245 3.4321969696969656 -0.13541666666666674 2.226830808080808 -0.9660858585858594 -2.8551136363636385 0.05833333333333357 -2.308068181818182 0.6193602693602716 -2.9175 -1.1171085858585856 -0.1644444444444445 -13.017424242424244 -0.4395833333333332 -0.21693181818181828 26.092310606060614 -2.4642803030303027 -0.8831439393939393 0 45.71721801346801 3.781073232323232 -1.9671969696969696 0.17291666666666639 -0.8693181818181823 1.0951767676767723 0.8895833333333334 6.206363636363637 -32.54689393939394 -0.26382575757575744 23.00570707070707 2.444583333333333 -0.7984090909090907 0 0.5616666666666666 -0.04166666666666696 0.048257575757576 21.425 1.9997222222222222 -0.23958333333333337 -5.3288846801346805 48.50757575757576 42.35647727272727 20.90300505050505 28.315845959595954 -3.3325547138047136 0 -0.7288257575757576 3.682689393939394 -2.591489898989906 3.5096843434343437 0.27888888888888885 0 2.423636363636364 -0.8242803030303028 -0.5195833333333334 2.3021254208754156 1.9878787878787874 -23.070189393939394 0.4556818181818183 46.585189393939395 -0.7109217171717173 0.3383333333333333 -0.5793560606060606 0.824962121212121 26.54011363636364 -26.44248737373737 -0.7141666666666666 0.022499999999999964 -9.417727272727262 5.008585858585862 0.38114898989898993 -15.637727272727272 1.3573442760942807 -1.7334469696969697 20.672992424242423 1.280479797979793 0.18666666666666676 0.3344318181818182 -0.2816540404040495 8.775037878787879 -1.3646338383838383 -11.776742424242425 2.005909090909091 -6.868093434343434 -42.46974747474748 2.2817045454545406 -1.1864898989898989 46.538952020202025 -27.929040404040403 1.8883964646464655 2.25114898989899 -0.5396969696969697 6.14907407407407 21.70516414141414 -24.573863636363637 -0.8234722222222222 2.5189436026936027 -16.378030303030307 1.4148989898989899 0 -0.36469696969696974 0.13876262626262625 -0.5799873737373737 0.08087542087542765 -0.75 -0.28680555555555565 4.726249999999999 -0.008333333333333304 5.1613425925925895 30.098787878787878 -1.1966666666666668 1.0151515151515151 -0.9349621212121212 -0.8270833333333334 -3.4017045454545456 -0.3790656565656563 5.0625 0.030883838383838347 0.05897727272727282 1.7649873737373736 1.0527525252525232 -0.7526767676767685 -0.16208333333333336 -0.7460227272727273 -0.5188510101010095 -6.061174242424243 1.5944949494949499 -0.1725000000000002 -0.5482323232323232 -10.542727272727273 -0.3196969696969697 0.24455808080808072 -3.160681818181818 -0.5561363636363637 7.343409090909098 8.73912037037038 -0.7776641414141414 -13.608914141414143 1.6260732323232316 36.098762626262626 4.813560606060605 -1.884154040404038 0.062499999999999556 3.47935606060606 -0.07190656565656561 4.283636363636363 0.28623737373737373 2.486590909090909 -0.2288257575757573 -0.13333333333333353 -4.896136363636363 0.4075757575757577 2.2607575757575753 0.4182323232323232 0.642121212121217 0.8635774410774433 8.694078282828283 -0.3018939393939395 -5.735580808080808 -1.6072348484848482 -0.38742424242424234 -21.791224747474747 -0.16282828282828266 0.37424242424242427 -10.413484848484849 -1.0903787878787878 -1.8032196969697019 0.16180555555555554 -1.365037878787879 0.3393181818181818 0.014898989898990411 -5.760984848484849 4.403867845117847 17.78412878787879 10.711994949494958 -0.07650252525252488 0.796734006734009 0.04242424242423792 -0.21511363636363667 -9.365151515151515 0.8421085858585811 8.948787878787877 -12.944924242424245 -0.15416666666666667 -3.0491666666666664 18.56159090909091 -1.7717297979797983 10.258080808080813 2.954217171717172 -16.158800505050507 -0.5363257575757574 -0.8697727272727274 0.807201178451183 -0.3011237373737373 0.38083333333333336 0.6401010101010101 2.548232323232323 -0.06738636363636374 -2.149924242424243 -0.3778030303030304 scenario heads-up fish deals 1000 seed 1592590337 -counts 7473 48 0 -samples -0.054166666666666585 0.41369949494949076 1.4042045454545382 4.549713804713807 5.115921717171724 0.13560606060606095 0.1299999999999999 0.6230429292929318 4.486283670033677 0.9525378787878839 0.7733459595959598 12.991452020202024 -0.7262121212121236 8.147828282828275 -0.42511363636364097 -0.20916666666666672 -0.7604545454545386 1.1058333333333334 0.3870075757575757 -0.3175 0.24128787878787894 0.2029166666666668 5.757673400673404 -7.802436868686868 0.2675 0.30916666666666676 1.54699074074074 0.36 1.4908501683501678 -1.011010101010096 4.051317340067342 1.133787878787884 0.22337121212121236 1.6031144781144773 0.5140446127946177 0.2958333333333335 13.896700336700343 0.08579966329966804 -0.43996212121212075 -0.01041666666666674 0.1333333333333333 -0.031022727272729367 0.2711489898989903 0.5045791245791248 0.545643939393944 0.1700000000000001 1.957449494949494 46.14963804713806 1.0277904040404062 1.9533333333333311 2.3847474747474795 -0.20416666666666672 0.43318181818181545 4.155096801346795 0.5410227272727319 -39.93844696969698 1.2212962962962932 -0.7863636363636363 0.05212121212121179 1.0324074074074026 -0.06066919191919151 -0.7818939393939394 0.1267803030303032 0.2129671717171715 1.0440909090909094 -0.35583333333333345 -0.06532828282828274 1.104865319865322 1.5296548821548814 5.989473905723902 2.068968855218862 0.015833333333333588 4.07010101010101 2.203863636363641 7.337037037037037 0.9682828282828332 -0.012499999999999956 1.5078072390572363 1.0591666666666715 -0.40000000000000013 0.8479124579124535 24.739078282828284 7.7916329966329965 20.12686868686869 2.0576809764309756 0.2427020202020158 5.226346801346796 2.4709343434343354 -0.600454545454548 1.1630429292929274 -0.004166666666666652 3.258030303030307 1.8690235690235744 3.914814814814809 -0.25083333333333335 0.7734848484848484 0.24208333333333332 -0.8643728956228951 1.213354377104372 -0.28636363636363904 0.9290572390572387 1.586489898989892 -0.1412500000000001 4.476540404040399 1.3092676767676814 2.9533838383838367 2.5116666666666667 -0.05500000000000005 0.5424999999999953 -0.13041666666666663 48.73785774410774 -3.7060016835016834 -0.08625000000000005 0.07250000000000006 4.838055555555563 2.8944823232323227 8.90066077441077 33.529671717171716 0.3204166666666665 -0.29015151515151516 -0.27 1.382744107744107 0.10291666666666666 1.3703156565656598 0.7769696969696972 18.82026936026936 0.9208333333333286 -0.17325757575757583 11.708375420875424 7.151885521885527 0.5385227272727271 -37.87121212121212 1.4528787878787877 0.6013636363636314 8.3288005050505 0.8050378787878834 3.400972222222226 0.9867087542087568 6.142760942760939 -0.008333333333333526 0.6941708754208779 1.5661405723905724 0.00416666666666643 1.54130050505051 11.674957912457918 2.80140151515151 -22.6753367003367 -0.805138888888889 0.9085479797979849 -0.19291666666666663 0.0050000000000001155 5.822121212121216 18.991666666666667 0.6600757575757574 -1.6130681818181816 0.07318181818181801 -0.14041666666666663 0.7315151515151567 -0.4435858585858611 1.5964646464646437 -0.3179166666666666 0.4447390572390624 0.8626515151515107 2.5972937710437733 0.5783333333333334 -2.343981481481484 0.28125 -0.027083333333333126 0.5681439393939396 -0.18499999999999994 2.1209217171717163 0.31666666666666665 0.2786994949494951 0.4009469696969696 -0.09708333333333341 1.8000210437710478 1.466645622895621 -0.15333333333333332 0.2679166666666665 0.3796338383838396 5.920252525252528 -2.4458333333333333 0.28499999999999986 0.3037500000000001 0.8962499999999998 7.3138510101010095 1.403333333333338 -0.16416666666666668 1.1221254208754239 -0.024191919191921762 0.06666666666667354 0.4611489898989901 0.7412836700336654 11.487626262626266 0.15393939393939393 0.16249999999999998 0.19041666666666668 1.0885942760942748 0.7842297979798032 18.89473484848484 0.2516666666666666 0.002083333333333215 0.21868686868686849 0.7987121212121187 -0.5338383838383789 1.8267171717171649 -0.09999999999999998 1.0118055555555532 10.218118686868678 0.3770833333333333 0.055597643097638816 -0.2783333333333333 0.580239898989899 1.362394781144781 0.19208333333333333 3.7021885521885483 0.6236784511784561 5.17693181818182 -0.02304292929292928 4.116435185185183 1.260778619528622 0.5923863636363638 0.15003787878787866 1.151872895622898 7.431788720538718 0.48623737373737375 -0.20272727272727287 1.2157323232323227 0.25833333333333314 0.041666666666666075 14.788762626262631 -0.33765151515151504 1.2699494949494947 0.3404166666666668 0.6655681818181864 0.047916666666659724 -0.26249999999999996 -0.06686868686868186 -0.7603030303030304 -2.9620580808080774 -0.1203282828282829 14.510185185185188 -0.7179545454545456 -0.033749999999999836 0.09916666666666651 18.71563973063973 -0.09166666666666656 4.809507575757575 -1.300719696969697 -0.062234848484848615 0.14575757575757575 0.9174999999999954 -0.43140151515151515 0.4842803030303029 -0.0958333333333331 0.24356060606060637 -12.919128787878796 5.241616161616163 0.6215530303030306 -0.04166666666666674 9.787121212121207 -0.03749999999999987 -0.0904166666666667 -0.13958333333333317 0.7690193602693556 3.4582070707070667 1.1295833333333334 -0.2945833333333332 0.19833333333333325 0.1862499999999998 2.0282828282828276 -0.22193181818181806 3.6099494949494986 0.5893939393939349 28.151830808080817 1.324082491582491 6.123985690235693 2.179419191919191 -1.0515530303030305 0.5246001683501635 3.7895412457912503 1.4795833333333381 -0.32291666666666663 0.37185606060606097 5.517045454545463 4.214936868686878 0.9669191919191895 2.121847643097642 -0.3796969696969723 -0.015328282828282913 2.35867424242424 1.2773190235690235 1.5554166666666713 0.20333333333333353 1.2999621212121253 0.95740740740741 -0.6740530303030327 0.277689393939394 1.408926767676767 0.7183333333333335 0.31916666666666194 -0.23564393939393946 7.681060606060605 -0.14375000000000004 1.0967718855218873 5.824751683501686 9.827167508417505 0.12416666666666676 0.013749999999999929 0.1562500000000001 1.4234343434343457 0.35833333333333334 0.03500000000000003 -0.10429292929293199 2.9376178451178423 5.722457912457911 0.35583333333333345 -1.103270202020202 3.8419444444444406 2.255290404040407 -0.1954166666666668 0.9121212121212099 0.14867424242424243 -0.027083333333333126 -11.651578282828275 0.4495075757575864 1.0803114478114457 0.22749999999999987 4.502954545454548 9.853434343434344 0.1362500000000002 0.05624999999999991 10.444490740740745 -1.5708333333333333 0.23291666666666677 -0.18708333333333338 1.5272727272727327 1.1716666666666615 0.27166666666666667 1.6713005050505034 1.222537878787884 2.770416666666667 0.8585858585858577 0.30815656565657057 -0.883097643097638 0.8787121212121211 6.9147811447811405 1.07912878787879 -0.6052651515151426 -2.3000000000000003 6.355214646464643 0.8687499999999955 -0.08500000000000008 1.5222601010101053 -0.10416666666666696 0.06306818181818175 1.8008838383838375 -0.7219907407407333 0.5081439393939392 -0.05340909090909107 0.484225589225594 3.9863299663299747 32.353409090909096 -0.21260101010101007 0.18249999999999994 0.9185227272727319 0.3141666666666666 12.30305134680135 -1.9993560606060607 8.013110269360268 0.19581228956229468 -0.22250000000000003 3.1777904040404077 0.0369949494949493 -0.0720833333333335 0.3888131313131311 -0.027083333333333237 2.410151515151515 -1.6219065656565652 -0.03635521885521342 0.13874999999999976 1.7438720538720587 0.7700757575757597 7.337222222222223 0.4268055555555512 -0.15333333333333332 -0.1853030303030304 -0.25625 -0.08378787878787863 8.263535353535351 3.131342592592587 1.8974621212121217 0.025833333333333375 0.5395833333333357 6.167394781144777 -0.06261363636363626 0.5113005050505006 1.5762499999999995 -30.45250841750842 -0.13847222222222222 0.9691666666666714 -0.13305134680134412 10.975000000000009 0.10249999999999998 1.0744444444444405 4.1438552188552125 14.76374158249159 5.561111111111114 5.902348484848483 0.25458333333333333 -0.018750000000000044 -4.375193602693599 1.1350378787878743 -0.2058333333333333 5.823573232323233 0.4137500000000001 0.005366161616161658 0.20666666666666678 1.807226430976431 0.5492803030303031 1.1270833333333332 1.2476010101010095 0.779936868686868 1.704987373737373 -0.9115404040403998 16.347626262626264 1.7382702020202012 -0.08258838383837919 3.1550505050505038 -0.2616035353535313 0.07499999999999996 0.12083333333333357 0.09670454545454554 0.47060606060605603 1.4534722222222194 0.9287037037037063 4.953661616161618 0.7221212121212122 2.3208333333333355 0.4211868686868687 11.10279882154883 0.47026515151515635 0.638093434343437 1.1758585858585908 -10.051641414141407 0.5226515151515106 2.0986742424242415 0.38518939393939433 1.6914478114478035 0.029166666666666563 1.0331060606060654 0.507803030303035 -0.0512499999999978 -0.17375000000000007 -0.061868686868689515 -1.0533712121212053 -0.0625000000000071 0.12416666666666665 0.3354377104377151 0.6986952861952882 -0.3554166666666668 0.24500000000000016 0.22371212121212147 0.03708333333333341 1.503017676767675 -0.020833333333340365 0.14124999999999988 0.03958333333333308 1.8300000000000047 5.994061447811443 26.761725589225584 1.444444444444444 0.8009469696969649 0.038257575757575824 -0.31875 -21.646199494949496 0.29833333333333334 1.804537037037036 0.49070707070707564 4.366961279461276 -3.361540404040404 1.9937247474747477 0.20958333333333345 -20.64767676767677 0.08333333333333326 3.3240993265993257 0.38308080808080336 1.5666624579124568 0.18103956228956009 0.1917550505050506 -18.45507996632997 0.6433333333333284 4.405387205387205 0.3720833333333333 3.2562710437710436 0.4480765993265947 0.3525 -2.2001893939393913 -0.3191666666666667 2.639654882154879 -0.2416666666666667 0.0004166666666667873 0.19833333333333347 -22.463400673400674 2.816250000000002 -0.08973484848484825 4.2118265993266 -0.05208333333333337 -0.10250000000000015 -0.1641035353535354 1.0358333333333378 0.5281060606060606 5.055290404040406 -0.5021590909090907 0.14229797979798198 0.70117424242424 2.7854671717171717 0.13462121212121203 0.7189772727272774 0.44556818181818186 9.50303030303031 0.08590909090909105 0.40950336700337187 9.83176767676768 -0.13069444444444445 -0.2645833333333334 0.25833333333333325 -0.2170833333333333 2.2120664983164917 0.47253787878787445 1.3434553872053865 -0.015883838383838222 -0.06875000000000009 1.4497348484848438 5.476620370370371 0.9301515151515106 0.7001893939393891 3.463922558922559 1.209128787878785 -2.060416666666662 9.722083333333334 -0.1941666666666667 -0.18887626262626278 -0.12193181818181831 -0.060416666666666785 0.7746464646464694 0.4451136363636367 -0.03958333333334085 -0.1296590909090909 1.6127104377104369 0.07499999999999307 0.3372601010101009 5.198758417508419 8.462031144781154 1.4178451178451197 0.3682954545454544 4.017609427609422 0.31056818181818185 0.867542087542083 0.5328282828282829 3.898842592592602 0.08124999999999982 -0.13583333333333325 0.7352272727272682 6.010239898989898 -0.1759848484848484 4.303825757575751 -0.1754166666666669 5.603977272727276 0.17583333333333323 0.08189393939393919 -0.17496212121212118 0.2270833333333332 0.1968308080808081 0.0632954545454546 0.2623316498316519 3.1152777777777816 0.32333333333333325 4.402184343434343 0.6585984848484897 -0.78170454545455 1.4840530303030346 0.1970833333333334 -0.28541666666666654 -0.1725757575757575 -0.1545833333333334 -0.8691119528619553 1.1990782828282847 -0.30306818181818196 0.2461363636363637 -0.3393560606060585 0.3020833333333334 6.675353535353531 -0.461994949494952 0.2883333333333335 1.567647306397311 1.935395622895622 -16.915879629629654 -0.0887500000000001 -36.17583333333333 1.205303030303037 4.966140572390575 0.4039772727272726 -0.17393939393939395 0.41492424242424275 -0.03249999999999986 1.8638888888888874 2.3120244107744172 0.6160984848484898 -0.13624999999999998 0.6145454545454594 13.69534932659933 0.5535984848484901 2.27209595959596 9.1869739057239 -0.12749999999999995 0.02050505050505036 7.102601010101008 1.9357744107744153 0.41924242424242397 0.4083333333333333 0.16874999999999984 0.3508333333333288 1.5595833333333382 0.6633207070707022 1.811144781144781 0.04166666666666674 -0.450113636363639 -2.1048611111111137 0.9260311447811471 0.40553030303030324 0.060833333333333184 1.150681818181825 11.46386784511785 4.804608585858593 2.204734848484848 36.7647601010101 0.4510101010101013 1.493602693602693 45.284772727272724 1.7522264309764357 -0.15988636363636355 1.987584175084173 -0.21750000000000003 -1.928034511784508 0.2283333333333334 0.9096717171717167 -37.133383838383835 1.7189520202020196 0.012500000000000067 -0.16125000000000012 0.08875000000000005 24.855723905723906 0.31416666666666665 0.8002272727272774 0.32431818181818184 4.807992424242425 0.013661616161616319 3.7831313131313067 0.28704545454545455 -0.14636363636363647 0.3205513468013417 0.3441666666666667 -7.114781144781144 0.2154166666666667 0.4787499999999999 8.872895622895637 0.14231902356902282 0.26041666666666663 -43.43415404040404 1.239974747474753 4.382786195286195 12.679356060606064 -4.788333333333345 0.3058333333333334 1.2362878787878837 -0.1095833333333377 -0.05824494949494419 1.627083333333338 0.2603535353535352 14.950883838383838 -0.1410227272727249 0.7248190235690258 0.12420454545454529 0.09750000000000014 4.779924242424237 2.102521043771043 0.16268939393939413 0.23541666666666672 -0.09999999999999987 -3.476249999999996 0.31041666666666634 1.05741161616162 0.1741666666666666 0.19166666666666665 0.3245833333333332 0.5186363636363682 5.156944444444439 0.6561111111111065 -0.004419191919191823 0.18958333333333327 10.23332491582491 3.7919402356902303 3.868392255892258 0.18046717171717175 13.162015993266 -0.1512500000000001 0.1921590909090909 -0.2569107744107768 0.17291666666666666 0.12083333333333324 2.630530303030305 0.7024999999999954 0.0616666666666667 1.105690235690235 0.11333333333333334 1.2746212121212173 3.1599116161616125 18.07819865319866 1.7561574074074129 0.05624999999999991 8.843665824915824 1.8009469696969669 6.08333333333333 0.02083333333333337 1.099166666666674 -0.09375000000000022 -0.12249999999999994 0.9303030303030275 2.192108585858585 7.997756734006731 -0.14208333333333345 -0.28648989898990296 0.20791666666666653 1.867723063973076 25.263122895622896 0.3604166666666668 -0.28625 2.926489898989894 -0.15375000000000005 1.3607828282828325 0.16791666666666683 7.457744107744108 -0.17708333333333337 14.527495791245794 1.6729166666666713 -28.190446127946124 0.8856439393939349 1.0546927609427637 9.798350168350163 16.330446127946118 0.10977272727272724 0.2883333333333332 0.3409848484848485 0.30255892255892736 0.13056818181818175 -7.595265151515145 -0.13416666666666655 0.8032196969697014 0.3448358585858591 24.990479797979795 0.5334090909090907 1.8726515151515106 1.1608333333333334 2.0300547138047134 0.12916666666666676 -0.2183333333333335 -0.01666666666666683 0.07708333333333339 1.4825378787878785 6.608110269360266 0.33791666666666687 1.309747474747467 0.35257575757575743 0.09166666666666667 1.6604166666666718 0.3962121212121186 -0.06814393939393948 2.1289562289562216 -0.27178030303030587 0.3230303030303029 4.581414141414145 0.11250000000000004 -0.27749999999999997 6.213383838383834 12.082567340067346 3.680744949494952 4.193455387205395 -1.64655303030303 0.07083333333333319 1.2669318181818152 3.946784511784506 7.39701178451179 3.3560395622895633 -0.20666666666666667 0.1949999999999999 0.988257575757576 0.2437499999999999 0.2391666666666667 1.3166792929292883 -0.584785353535353 3.597853535353531 0.5842803030303052 3.990972222222216 5.1765782828282845 -0.3551136363636389 1.283080808080813 -0.034583333333333466 0.6193602693602716 -0.0724999999999999 -0.09791666666666665 -0.008888888888888946 0.016666666666666607 -0.26124999999999987 -0.08208333333333351 8.572781986531997 -0.010189393939393776 0.46773989898990376 1.1582196969696943 9.642285353535348 5.043817340067344 0.1275 0.9195496632996584 0.3636363636363633 1.0743434343434388 1.334448653198646 1.9314898989898994 1.0684595959595955 1.6585227272727323 5.968779461279465 0.6329166666666619 -0.1449999999999999 0.41185606060606095 0.007563131313131355 0.02651515151515116 0.048257575757576 5.524305555555557 0.29000000000000004 -0.23958333333333337 12.842159090909096 6.459659090909091 9.9875 1.6709511784511775 4.672159090909089 -0.8325547138047136 0.719772727272732 -0.1379166666666667 -0.04458333333333331 -10.198055555555547 0.2874621212121239 0.33861111111111103 0.1854166666666665 2.040959595959595 0.16375000000000012 -0.019583333333333397 9.502356902356897 0.5863636363636315 8.338901515151516 0.24454545454545007 14.478345959595964 0.39261363636363145 0.3383333333333333 0.1479166666666667 -0.04458333333333331 0.6975883838383888 -0.02499999999999325 -0.4016666666666666 0.006553030303027896 1.4850000000000017 5.008585858585862 1.2902398989899009 1.0279292929292931 1.3573442760942807 9.819583333333334 3.745719696969692 4.727449494949493 5.742222222222231 2.568017676767679 -0.04327020202019849 -0.2037500000000001 -0.35124999999999995 0.4650757575757576 1.4275420875420854 0.07625000000000004 -15.269739057239057 0.19837121212121211 -0.04166666666666674 18.6332196969697 1.9295454545454607 0.21945707070708131 -0.10541666666666671 -0.2101515151515151 5.7324074074074005 4.97718434343434 -0.5536742424242449 -0.22624999999999995 0.6729840067340117 3.466060606060609 -0.07499999999999996 0.2704166666666666 -0.13742424242424245 1.0291666666666712 -0.5799873737373737 4.3583122895622965 -0.6590909090909092 -0.0469065656565657 1.6083333333333383 -0.7848611111111131 4.640046296296294 18.35202020202021 0.05333333333333329 0.024431818181818277 -0.1054166666666666 -0.039583333333333415 0.6831439393939345 -0.21886363636363637 7.5625 0.9716582491582514 -0.11324494949494968 0.22458333333333347 0.8917676767676747 -0.018333333333333535 -0.16208333333333336 0.6744318181818183 4.777756734006738 3.5746843434343436 -0.15500000000000003 -0.1725000000000002 1.2045791245791233 -1.022525252525252 -0.3196969696969697 -0.06041666666666656 0.28583333333333333 0.5614015151515155 1.958409090909086 2.6280092592592554 -0.13624999999999998 5.763783670033666 1.9758207070707061 6.842516835016834 2.7736616161616126 2.2683712121212194 0.062499999999999556 -0.32291666666666674 0.016666666666666607 -0.7805681818181816 0.17708333333333326 -0.013409090909091037 1.5840530303030294 0.8654040404040431 0.9106313131313126 0.02499999999999991 0.40871212121212075 0.45156565656565684 0.642121212121217 0.8635774410774433 0.41094696969697014 0.5307449494949497 0.5286279461279508 -0.19208333333333327 0.26510101010101506 4.156502525252524 0.08666666666666678 0.37424242424242427 0.6555387205387198 -0.2858333333333334 1.8455850168350163 0.3395833333333333 0.8470833333333285 0.07643939393939408 0.06666666666666732 -0.07916666666666683 4.403867845117847 5.445744949494948 5.1619949494949475 0.28784090909090937 2.233097643097642 0.4969696969696925 -0.21511363636363667 3.2272095959595912 2.199347643097642 1.915000000000005 0.7682070707070721 -0.1941666666666667 0.23083333333333333 15.43604797979798 -0.4415530303030304 4.101515151515153 0.7438636363636315 -1.997521043771049 0.7345664983164957 -0.14250000000000007 0.9639183501683548 1.13953282828283 0.5289393939393989 0.510408249158254 -13.16349326599326 0.15988636363636355 0.009166666666666712 2.0253282828282817 +counts 7487 7 0 +samples -0.054166666666666585 0.41369949494949076 1.4042045454545382 4.549713804713807 3.4359217171717242 0.13560606060606095 0.1299999999999999 0.6230429292929318 4.486283670033677 0.9525378787878839 0.7733459595959598 12.991452020202024 -0.7262121212121236 8.147828282828275 -0.42511363636364097 -0.20916666666666672 -0.7604545454545386 1.1058333333333334 0.3870075757575757 -0.3175 0.24128787878787894 0.2029166666666668 5.757673400673404 -7.802436868686868 0.2675 0.30916666666666676 1.54699074074074 0.36 1.4908501683501678 -1.011010101010096 4.051317340067342 1.133787878787884 0.22337121212121236 1.6031144781144773 0.5140446127946177 0.2958333333333335 13.896700336700343 0.08579966329966804 -0.43996212121212075 -0.01041666666666674 0.1333333333333333 -0.031022727272729367 0.2711489898989903 0.5045791245791248 0.545643939393944 0.1700000000000001 1.957449494949494 43.61691077441079 1.0277904040404062 1.9533333333333311 2.3847474747474795 -0.20416666666666672 0.43318181818181545 4.155096801346795 0.5410227272727319 -39.93844696969698 1.2212962962962932 -0.7863636363636363 0.05212121212121179 1.0324074074074026 -0.06066919191919151 -0.7818939393939394 0.1267803030303032 0.2129671717171715 1.0440909090909094 -0.35583333333333345 -0.06532828282828274 1.104865319865322 1.5296548821548814 5.989473905723902 2.068968855218862 0.015833333333333588 4.07010101010101 2.203863636363641 7.337037037037037 0.9682828282828332 -0.012499999999999956 1.5078072390572363 1.0591666666666715 -0.40000000000000013 0.8479124579124535 24.739078282828284 7.7916329966329965 20.12686868686869 2.0576809764309756 0.2427020202020158 5.226346801346796 2.4709343434343354 -0.600454545454548 1.1630429292929274 -0.004166666666666652 3.258030303030307 0.7474747474747527 3.914814814814809 -0.25083333333333335 0.7734848484848484 0.24208333333333332 -0.8643728956228951 1.213354377104372 -0.28636363636363904 0.9290572390572387 1.586489898989892 -0.1412500000000001 4.476540404040399 1.3092676767676814 2.9533838383838367 2.5116666666666667 -0.05500000000000005 0.5424999999999953 -0.13041666666666663 48.73785774410774 -3.7060016835016834 -0.08625000000000005 0.07250000000000006 4.838055555555563 2.8944823232323227 8.90066077441077 33.529671717171716 0.3204166666666665 -0.29015151515151516 -0.27 1.382744107744107 0.10291666666666666 1.3703156565656598 0.7769696969696972 18.82026936026936 0.9208333333333286 -0.17325757575757583 11.708375420875424 7.151885521885527 0.5385227272727271 -37.87121212121212 1.4528787878787877 0.6013636363636314 8.3288005050505 0.8050378787878834 3.400972222222226 0.9867087542087568 6.142760942760939 -0.008333333333333526 0.6941708754208779 1.5661405723905724 0.00416666666666643 1.54130050505051 11.674957912457918 2.80140151515151 -22.6753367003367 -0.805138888888889 0.9085479797979849 -0.19291666666666663 0.0050000000000001155 5.822121212121216 18.991666666666667 0.6600757575757574 -1.6130681818181816 0.07318181818181801 -0.14041666666666663 0.7315151515151567 -0.4435858585858611 1.5964646464646437 -0.3179166666666666 0.4447390572390624 0.8626515151515107 2.5972937710437733 0.5783333333333334 -2.343981481481484 0.28125 -0.027083333333333126 0.5681439393939396 -0.18499999999999994 2.1209217171717163 0.31666666666666665 0.2786994949494951 0.4009469696969696 -0.09708333333333341 1.8000210437710478 1.466645622895621 -0.15333333333333332 0.2679166666666665 0.3796338383838396 5.920252525252528 -2.4458333333333333 0.28499999999999986 0.3037500000000001 0.8962499999999998 7.3138510101010095 1.403333333333338 -0.16416666666666668 1.1221254208754239 -0.024191919191921762 0.06666666666667354 0.4611489898989901 0.7412836700336654 11.487626262626266 0.15393939393939393 0.16249999999999998 0.19041666666666668 1.0885942760942748 0.7842297979798032 18.89473484848484 0.2516666666666666 0.002083333333333215 0.21868686868686849 0.7987121212121187 -0.5338383838383789 1.8267171717171649 -0.09999999999999998 1.0118055555555532 10.218118686868678 0.3770833333333333 0.055597643097638816 -0.2783333333333333 0.580239898989899 1.362394781144781 0.19208333333333333 3.7021885521885483 0.6236784511784561 5.17693181818182 -0.02304292929292928 4.116435185185183 1.260778619528622 0.5923863636363638 0.15003787878787866 1.151872895622898 7.431788720538718 0.48623737373737375 -0.20272727272727287 1.2157323232323227 0.25833333333333314 0.041666666666666075 14.788762626262631 -0.33765151515151504 1.2699494949494947 0.3404166666666668 0.6655681818181864 0.047916666666659724 -0.26249999999999996 -0.06686868686868186 -0.7603030303030304 -2.9620580808080774 -0.1203282828282829 14.510185185185188 -0.7179545454545456 -0.033749999999999836 0.09916666666666651 18.71563973063973 -0.09166666666666656 4.809507575757575 -1.300719696969697 -0.062234848484848615 0.14575757575757575 0.9174999999999954 -0.43140151515151515 0.4842803030303029 -0.0958333333333331 0.24356060606060637 -12.919128787878796 5.241616161616163 0.6215530303030306 -0.04166666666666674 9.787121212121207 -0.03749999999999987 -0.0904166666666667 -0.13958333333333317 0.7690193602693556 3.4582070707070667 1.1295833333333334 -0.2945833333333332 0.19833333333333325 0.1862499999999998 2.0282828282828276 -0.22193181818181806 3.6099494949494986 0.5893939393939349 28.151830808080817 1.324082491582491 6.123985690235693 2.179419191919191 -1.0515530303030305 0.5246001683501635 3.7895412457912503 1.4795833333333381 -0.32291666666666663 0.37185606060606097 5.517045454545463 4.214936868686878 0.9669191919191895 2.121847643097642 -0.3796969696969723 -0.015328282828282913 2.35867424242424 1.2773190235690235 1.5554166666666713 0.20333333333333353 1.2999621212121253 0.95740740740741 -0.6740530303030327 0.277689393939394 1.408926767676767 0.7183333333333335 0.31916666666666194 -0.23564393939393946 7.681060606060605 -0.14375000000000004 1.0967718855218873 5.824751683501686 9.827167508417505 0.12416666666666676 0.013749999999999929 0.1562500000000001 1.4234343434343457 0.35833333333333334 0.03500000000000003 -0.10429292929293199 2.9376178451178423 5.722457912457911 0.35583333333333345 -1.103270202020202 3.8419444444444406 2.255290404040407 -0.1954166666666668 0.9121212121212099 0.14867424242424243 -0.027083333333333126 -11.651578282828275 0.4495075757575864 1.0803114478114457 0.22749999999999987 4.502954545454548 9.853434343434344 0.1362500000000002 0.05624999999999991 10.444490740740745 -1.5708333333333333 0.23291666666666677 -0.18708333333333338 1.5272727272727327 1.1716666666666615 0.27166666666666667 1.6713005050505034 1.222537878787884 2.770416666666667 0.8585858585858577 0.30815656565657057 -0.883097643097638 0.8787121212121211 6.9147811447811405 1.07912878787879 -0.6052651515151426 -2.3000000000000003 6.355214646464643 0.8687499999999955 -0.08500000000000008 1.5222601010101053 -0.10416666666666696 0.06306818181818175 1.8008838383838375 -0.7219907407407333 0.5081439393939392 -0.05340909090909107 0.484225589225594 3.9863299663299747 32.353409090909096 -0.21260101010101007 0.18249999999999994 0.9185227272727319 0.3141666666666666 12.30305134680135 -1.9993560606060607 8.013110269360268 0.19581228956229468 -0.22250000000000003 3.1777904040404077 0.0369949494949493 -0.0720833333333335 0.3888131313131311 -0.027083333333333237 2.410151515151515 -1.6219065656565652 -0.03635521885521342 0.13874999999999976 1.7438720538720587 0.7700757575757597 7.337222222222223 0.4268055555555512 -0.15333333333333332 -0.1853030303030304 -0.25625 -0.08378787878787863 8.263535353535351 3.131342592592587 1.8974621212121217 0.025833333333333375 0.5395833333333357 6.167394781144777 -0.06261363636363626 0.5113005050505006 1.5762499999999995 -30.45250841750842 -0.13847222222222222 0.9691666666666714 -0.13305134680134412 10.975000000000009 0.10249999999999998 1.0744444444444405 4.1438552188552125 14.76374158249159 5.561111111111114 5.902348484848483 0.25458333333333333 -0.018750000000000044 -4.375193602693599 1.1350378787878743 -0.2058333333333333 5.823573232323233 0.4137500000000001 0.005366161616161658 0.20666666666666678 1.807226430976431 0.5492803030303031 1.1270833333333332 1.2476010101010095 0.779936868686868 1.704987373737373 -0.9115404040403998 16.347626262626264 1.7382702020202012 -0.08258838383837919 3.1550505050505038 -0.2616035353535313 0.07499999999999996 0.12083333333333357 0.09670454545454554 0.47060606060605603 1.4534722222222194 0.9287037037037063 4.953661616161618 0.7221212121212122 2.3208333333333355 0.4211868686868687 11.10279882154883 0.47026515151515635 0.638093434343437 1.1758585858585908 -23.60164141414141 0.5226515151515106 2.0986742424242415 0.38518939393939433 1.6914478114478035 0.029166666666666563 1.0331060606060654 0.507803030303035 -0.0512499999999978 -0.17375000000000007 -0.061868686868689515 -1.0533712121212053 -0.0625000000000071 0.12416666666666665 0.3354377104377151 0.6986952861952882 -0.3554166666666668 0.24500000000000016 0.22371212121212147 0.03708333333333341 1.503017676767675 -0.020833333333340365 0.14124999999999988 0.03958333333333308 1.8300000000000047 5.994061447811443 26.761725589225584 1.444444444444444 0.8009469696969649 0.038257575757575824 -0.31875 -21.646199494949496 0.29833333333333334 1.804537037037036 0.49070707070707564 4.366961279461276 -3.361540404040404 1.9937247474747477 0.20958333333333345 -20.64767676767677 0.08333333333333326 3.3240993265993257 0.38308080808080336 1.5666624579124568 0.18103956228956009 0.1917550505050506 -18.45507996632997 0.6433333333333284 4.405387205387205 0.3720833333333333 3.2562710437710436 0.4480765993265947 0.3525 -2.2001893939393913 -0.3191666666666667 2.639654882154879 -0.2416666666666667 0.0004166666666667873 0.19833333333333347 -22.463400673400674 2.816250000000002 -0.08973484848484825 4.2118265993266 -0.05208333333333337 -0.10250000000000015 -0.1641035353535354 1.0358333333333378 0.5281060606060606 5.055290404040406 -0.5021590909090907 0.14229797979798198 0.70117424242424 2.7854671717171717 0.13462121212121203 0.7189772727272774 0.44556818181818186 9.50303030303031 0.08590909090909105 0.40950336700337187 9.83176767676768 -0.13069444444444445 -0.2645833333333334 0.25833333333333325 -0.2170833333333333 2.2120664983164917 0.47253787878787445 1.3434553872053865 -0.015883838383838222 -0.06875000000000009 1.4497348484848438 5.476620370370371 0.9301515151515106 0.7001893939393891 3.463922558922559 1.209128787878785 -2.060416666666662 9.722083333333334 -0.1941666666666667 -0.18887626262626278 -0.12193181818181831 -0.060416666666666785 0.7746464646464694 0.4451136363636367 -0.03958333333334085 -0.1296590909090909 1.6127104377104369 0.07499999999999307 0.3372601010101009 5.198758417508419 8.462031144781154 1.4178451178451197 0.3682954545454544 4.017609427609422 0.31056818181818185 0.867542087542083 0.5328282828282829 3.898842592592602 0.08124999999999982 -0.13583333333333325 0.7352272727272682 6.010239898989898 -0.1759848484848484 4.303825757575751 -0.1754166666666669 5.603977272727276 0.17583333333333323 0.08189393939393919 -0.17496212121212118 0.2270833333333332 0.1968308080808081 0.0632954545454546 0.2623316498316519 3.1152777777777816 0.32333333333333325 4.402184343434343 0.6585984848484897 -0.78170454545455 1.4840530303030346 0.1970833333333334 -0.28541666666666654 -0.1725757575757575 -0.1545833333333334 -0.8691119528619553 1.1990782828282847 -0.30306818181818196 0.2461363636363637 -0.3393560606060585 0.3020833333333334 6.675353535353531 -0.461994949494952 0.2883333333333335 1.567647306397311 1.935395622895622 -16.915879629629654 -0.0887500000000001 -45.045833333333334 1.205303030303037 4.966140572390575 0.4039772727272726 -0.17393939393939395 0.41492424242424275 -0.03249999999999986 1.8638888888888874 2.3120244107744172 0.6160984848484898 -0.13624999999999998 0.6145454545454594 13.69534932659933 0.5535984848484901 2.27209595959596 9.1869739057239 -0.12749999999999995 0.02050505050505036 7.102601010101008 1.9357744107744153 0.41924242424242397 0.4083333333333333 0.16874999999999984 0.3508333333333288 1.5595833333333382 0.6633207070707022 1.811144781144781 0.04166666666666674 -0.450113636363639 -2.1048611111111137 0.9260311447811471 0.40553030303030324 0.060833333333333184 1.150681818181825 11.46386784511785 4.804608585858593 2.204734848484848 36.7647601010101 0.16020202020202046 1.493602693602693 45.284772727272724 1.7522264309764357 -0.15988636363636355 1.987584175084173 -0.21750000000000003 -1.928034511784508 0.2283333333333334 0.9096717171717167 -37.133383838383835 1.7189520202020196 0.012500000000000067 -0.16125000000000012 0.08875000000000005 24.855723905723906 0.31416666666666665 0.8002272727272774 0.32431818181818184 2.4746590909090895 0.013661616161616319 3.7831313131313067 0.28704545454545455 -0.14636363636363647 0.3205513468013417 0.3441666666666667 -7.114781144781144 0.2154166666666667 0.4787499999999999 8.872895622895637 0.14231902356902282 0.26041666666666663 -43.43415404040404 1.239974747474753 16.16777777777778 12.679356060606064 -4.788333333333345 0.3058333333333334 1.2362878787878837 -0.1095833333333377 -0.05824494949494419 1.627083333333338 0.2603535353535352 14.950883838383838 -0.1410227272727249 0.7248190235690258 0.12420454545454529 0.09750000000000014 4.779924242424237 2.102521043771043 0.16268939393939413 0.23541666666666672 -0.09999999999999987 -3.476249999999996 0.31041666666666634 -1.94258838383838 0.1741666666666666 0.19166666666666665 0.3245833333333332 0.5186363636363682 5.156944444444439 0.6561111111111065 -0.004419191919191823 0.18958333333333327 10.23332491582491 3.7919402356902303 3.868392255892258 0.18046717171717175 13.162015993266 -0.1512500000000001 0.1921590909090909 -0.2569107744107768 0.17291666666666666 0.12083333333333324 2.630530303030305 0.7024999999999954 0.0616666666666667 1.105690235690235 0.11333333333333334 1.2746212121212173 3.1599116161616125 18.07819865319866 1.7561574074074129 0.05624999999999991 8.843665824915824 1.8009469696969669 6.08333333333333 0.02083333333333337 1.099166666666674 -0.09375000000000022 -0.12249999999999994 0.9303030303030275 2.192108585858585 7.997756734006731 -0.14208333333333345 -0.28648989898990296 0.20791666666666653 1.867723063973076 25.263122895622896 0.3604166666666668 -0.28625 2.926489898989894 -0.15375000000000005 1.3607828282828325 0.16791666666666683 7.457744107744108 -0.17708333333333337 14.527495791245794 1.6729166666666713 -28.190446127946124 0.8856439393939349 1.0546927609427637 9.798350168350163 16.330446127946118 0.10977272727272724 0.2883333333333332 0.3409848484848485 0.30255892255892736 0.13056818181818175 -7.595265151515145 -0.13416666666666655 0.8032196969697014 0.3448358585858591 24.990479797979795 0.5334090909090907 1.8726515151515106 1.1608333333333334 2.0300547138047134 0.12916666666666676 -0.2183333333333335 -0.01666666666666683 0.07708333333333339 1.4825378787878785 6.608110269360266 0.33791666666666687 1.309747474747467 0.35257575757575743 0.09166666666666667 1.6604166666666718 0.3962121212121186 -0.06814393939393948 2.1289562289562216 -0.27178030303030587 0.3230303030303029 4.581414141414145 0.11250000000000004 -0.27749999999999997 6.213383838383834 12.082567340067346 3.680744949494952 4.193455387205395 -1.64655303030303 0.07083333333333319 1.2669318181818152 3.946784511784506 6.415193602693607 3.3560395622895633 -0.20666666666666667 0.1949999999999999 0.988257575757576 0.2437499999999999 0.2391666666666667 1.3166792929292883 -0.584785353535353 3.597853535353531 0.5842803030303052 3.990972222222216 5.1765782828282845 -0.3551136363636389 1.283080808080813 -0.034583333333333466 0.6193602693602716 -0.0724999999999999 -0.09791666666666665 -0.008888888888888946 0.016666666666666607 -0.26124999999999987 -0.08208333333333351 8.572781986531997 -0.010189393939393776 0.46773989898990376 1.1582196969696943 9.642285353535348 5.043817340067344 0.1275 0.9195496632996584 0.3636363636363633 1.0743434343434388 1.334448653198646 1.9314898989898994 1.0684595959595955 1.6585227272727323 5.968779461279465 0.6329166666666619 -0.1449999999999999 0.41185606060606095 0.007563131313131355 0.02651515151515116 0.048257575757576 5.524305555555557 0.29000000000000004 -0.23958333333333337 12.842159090909096 6.459659090909091 9.9875 1.6709511784511775 4.672159090909089 -0.8325547138047136 0.719772727272732 -0.1379166666666667 -0.04458333333333331 -10.198055555555547 0.2874621212121239 0.33861111111111103 0.1854166666666665 2.040959595959595 0.16375000000000012 -0.019583333333333397 9.502356902356897 0.5863636363636315 8.338901515151516 0.24454545454545007 14.478345959595964 0.39261363636363145 0.3383333333333333 0.1479166666666667 -0.04458333333333331 0.6975883838383888 -0.02499999999999325 -0.4016666666666666 0.006553030303027896 1.4850000000000017 5.008585858585862 1.2902398989899009 1.0279292929292931 1.3573442760942807 9.819583333333334 3.745719696969692 4.727449494949493 5.742222222222231 2.568017676767679 -0.04327020202019849 -0.2037500000000001 -0.35124999999999995 0.4650757575757576 1.4275420875420854 0.07625000000000004 -15.269739057239057 0.19837121212121211 -0.04166666666666674 18.6332196969697 1.9295454545454607 0.21945707070708131 -0.10541666666666671 -0.2101515151515151 5.7324074074074005 4.97718434343434 -0.5536742424242449 -0.22624999999999995 0.6729840067340117 3.466060606060609 -0.07499999999999996 0.2704166666666666 -0.13742424242424245 1.0291666666666712 -0.5799873737373737 4.3583122895622965 -0.6590909090909092 -0.0469065656565657 1.6083333333333383 -0.7848611111111131 4.640046296296294 18.35202020202021 0.05333333333333329 0.024431818181818277 -0.1054166666666666 -0.039583333333333415 0.6831439393939345 -0.21886363636363637 7.5625 0.9716582491582514 -0.11324494949494968 0.22458333333333347 0.8917676767676747 -0.018333333333333535 -0.16208333333333336 0.6744318181818183 4.777756734006738 3.5746843434343436 -0.15500000000000003 -0.1725000000000002 1.2045791245791233 -1.022525252525252 -0.3196969696969697 -0.06041666666666656 0.28583333333333333 0.5614015151515155 1.958409090909086 2.6280092592592554 -0.13624999999999998 5.763783670033666 1.9758207070707061 6.842516835016834 2.7736616161616126 2.2683712121212194 0.062499999999999556 -0.32291666666666674 0.016666666666666607 -0.7805681818181816 0.17708333333333326 -0.013409090909091037 1.5840530303030294 0.8654040404040431 0.9106313131313126 0.02499999999999991 0.14340909090909038 0.45156565656565684 0.642121212121217 0.8635774410774433 0.41094696969697014 0.5307449494949497 0.5286279461279508 -0.19208333333333327 0.26510101010101506 4.156502525252524 0.08666666666666678 0.37424242424242427 0.6555387205387198 -0.2858333333333334 0.7439183501683497 0.3395833333333333 0.8470833333333285 0.07643939393939408 0.06666666666666732 -0.07916666666666683 4.403867845117847 5.445744949494948 5.1619949494949475 0.28784090909090937 2.233097643097642 0.4969696969696925 -0.21511363636363667 3.2272095959595912 2.199347643097642 1.915000000000005 0.7682070707070721 -0.1941666666666667 0.23083333333333333 15.43604797979798 -0.4415530303030304 4.101515151515153 0.7438636363636315 -1.997521043771049 0.7345664983164957 -0.14250000000000007 0.9639183501683548 1.13953282828283 0.5289393939393989 0.510408249158254 -13.16349326599326 0.15988636363636355 0.009166666666666712 2.0253282828282817 scenario heads-up calling station deals 1000 seed 1592590337 counts 7823 0 0 samples 0.5119023569023619 4.196830808080806 1.7072348484848439 3.3274915824915876 5.964406565656569 2.408333333333333 0.1299999999999999 12.161763468013472 14.02189814814815 0.4690151515151565 0.9703156565656567 13.105088383838387 -0.2716666666666666 8.147828282828275 -0.12208333333333332 -0.16333333333333333 1.0627777777777805 1.1058333333333334 0.5688257575757576 -0.1216666666666667 1.600378787878793 0.2029166666666668 8.761683501683502 12.621553030303028 0.26958333333333323 0.30916666666666676 6.451872895622891 0.3225000000000001 3.1059595959595994 -0.8227946127946073 4.304852693602696 1.133787878787884 9.793813131313133 6.40951178451178 0.5140446127946177 0.2958333333333335 9.826531986531988 1.641355218855218 0.014583333333333504 -0.27541666666666664 0.38333333333333336 1.87049242424242 1.1836069023569074 0.5045791245791248 -0.22708333333333341 0.6691666666666714 3.4413383838383798 18.53204545454546 7.094793771043767 23.74121212121212 1.1433333333333402 0.9375 2.2160101010101 6.5835479797979755 0.5410227272727319 -1.3970833333333337 1.2212962962962932 -0.12916666666666665 0.9866666666666667 10.291666666666663 6.844932659932656 1.6575000000000046 5.196649831649834 1.1146464646464693 4.129318181818182 -0.04083333333333333 0.45515993265993754 6.492070707070702 1.5296548821548814 3.227268518518515 2.068968855218862 0.015833333333333588 4.07010101010101 2.203863636363641 24.892592592592592 -1.5519191919191897 1.6541666666666714 24.881544612794613 1.0591666666666715 -0.05833333333333335 16.926195286195288 25.175366161616164 25.307794612794613 6.330909090909096 2.0576809764309756 0.4245202020201977 2.373977272727274 7.100563973063969 2.9416161616161656 2.961843434343438 -0.004166666666666652 3.258030303030307 12.214562289562293 6.229629629629626 0.03916666666666668 0.09166666666666662 0.24208333333333332 2.447916666666667 2.602243265993265 0.016666666666666607 0.023333333333333206 6.51157407407407 -0.1412500000000001 3.365429292929292 1.3092676767676814 2.9533838383838367 1.0241666666666664 -0.05500000000000005 5.2091666666666665 0.6675000000000046 25.596632996632998 -0.17990740740740652 -0.08625000000000005 0.07250000000000006 6.738055555555558 2.1217550505050498 9.014297138047136 13.911994949494954 0.3204166666666665 7.645328282828288 7.639166666666671 1.931835016835016 0.10291666666666666 -1.4684048821548794 0.655 8.228602693602696 1.7541666666666713 0.42325757575757583 12.02403198653199 7.336228956228961 1.917310606060601 -4.432659932659922 -0.2516666666666668 0.019166666666666665 5.649671717171717 2.3605934343434334 -1.2286574074074004 6.53174242424242 6.210942760942757 0.33541666666666653 2.0830597643097635 8.723968855218855 -0.007083333333333441 1.6292676767676837 12.169907407407415 1.5237121212121165 -0.02499999999999858 -0.08291666666666675 0.9085479797979849 1.7424999999999953 2.2272222222222213 5.9458585858585895 -1.4291666666666645 0.3191666666666666 0.3187500000000002 7.617542087542093 0.020833333333333315 0.7315151515151567 1.381666666666662 23.289646464646466 -0.3179166666666666 0.4447390572390624 10.180833333333334 0.019166666666665222 0.030000000000000027 -0.029166666666667673 0.28125 -0.1233333333333333 1.9014772727272682 0.030000000000000027 1.0749621212121165 0.22499999999999987 0.8760858585858633 2.628219696969697 -0.09708333333333341 13.710963804713808 24.799978956228955 0.5133333333333381 0.2679166666666665 2.65741161616162 4.44363215488216 0.054166666666666696 0.28499999999999986 0.3037500000000001 0.8962499999999998 3.8719318181818174 5.2922222222222235 -0.16416666666666668 1.0905597643097646 2.364898989898994 0.06666666666667354 3.445997474747479 10.000542929292925 12.065909090909095 0.19939393939393935 0.16249999999999998 0.19041666666666668 1.8499621212121165 0.7842297979798032 25.19170454545455 6.4577272727272685 0.002083333333333215 2.1989225589225585 0.8775 2.132828282828285 3.0304208754208743 -0.040000000000000036 3.234027777777782 -1.9771675084175042 0.3770833333333333 0.055597643097638816 -0.03583333333333333 4.99774831649832 1.362394781144781 0.19208333333333333 13.484006734006728 0.6236784511784561 18.82743686868687 6.168034511784508 -3.023303872053864 0.22458333333333347 1.9257196969696924 1.7809848484848438 6.707765151515147 1.350404040404042 -0.008333333333333304 7.619183501683507 -0.07416666666666671 0.25833333333333314 0.041666666666666075 14.804924242424248 9.824217171717171 2.0700000000000003 0.3404166666666668 -0.06625000000000003 0.5782196969696924 -0.13749999999999996 0.33666666666666667 1.0075 8.933564814814815 3.1291414141414178 14.593518518518522 0.2024999999999999 -0.02749999999999997 0.09916666666666651 17.836447811447815 -0.4379166666666666 4.809507575757575 -0.32666666666666666 -0.09499999999999997 -0.15500000000000003 0.9174999999999954 -0.24958333333333338 0.957765151515156 0.04375000000000018 1.5953282828282878 -0.060833333333333295 5.241616161616163 0.6215530303030306 0.24208333333333326 4.621881313131311 -0.03749999999999987 -0.0904166666666667 1.5270833333333382 0.7690193602693556 1.9283333333333386 1.1295833333333334 0.6783333333333381 0.19833333333333325 0.1862499999999998 3.4171717171717133 -0.019999999999999962 3.6099494949494986 3.3671717171717135 8.982744107744114 0.3241666666666667 6.131561447811451 3.4033080808080767 -0.18791666666666673 0.3024873737373738 -2.671064814814809 1.4795833333333381 0.6350000000000047 0.8264015151515107 14.59869528619529 13.492041245791249 3.1891414141414183 6.798952020202016 -0.07666666666666666 3.181641414141418 24.182916666666664 6.156948653198649 1.5554166666666713 14.166296296296302 5.25703282828283 6.521380471380468 -0.14375000000000004 0.33280303030303515 1.9897348484848532 0.7183333333333335 3.3469444444444405 5.791649831649835 10.968602693602696 -0.14375000000000004 1.0967718855218873 4.322226430976436 8.33600589225589 0.7908333333333382 -0.015000000000000013 0.1562500000000001 6.337154882154878 0.08750000000000008 0.03500000000000003 -0.09166666666666656 3.2066414141414112 5.722457912457911 1.3558333333333334 -0.09083333333333332 3.3419444444444406 -2.3925210437710347 0.6600000000000047 7.029545454545455 14.505841750841753 1.2978324915824915 -2.7596801346801305 1.3828409090909162 5.710130471380475 0.22749999999999987 3.1393181818181843 8.201919191919195 0.1362500000000002 0.05624999999999991 2.033745791245797 0.7625000000000022 0.23291666666666677 -0.003333333333333355 13.680387205387209 17.44628787878788 2.088333333333338 0.004633838383838906 1.222537878787884 2.770416666666667 0.5967424242424213 0.30815656565657057 0.6860101010101056 0.6633333333333381 6.929932659932656 0.6245833333333382 -0.6052651515151426 0.1999999999999999 6.355214646464643 0.22291666666666676 -0.08500000000000008 3.555088383838389 0.1883333333333333 15.173316498316503 0.04583333333333317 -0.7219907407407333 2.6104166666666666 3.5627104377104386 0.484225589225594 13.222020202020206 7.028829966329962 5.546153198653203 0.18249999999999994 0.9185227272727319 0.3141666666666666 12.643960437710442 0.10291666666666682 2.1604166666666664 6.165340909090905 -0.13083333333333336 3.1777904040404077 0.3885353535353534 -0.0720833333333335 0.6127441077441123 24.865172558922556 8.410151515151515 0.15208333333333346 22.304983164983167 0.13874999999999976 1.7438720538720587 3.547853535353531 7.803888888888887 0.6313510101010058 0.5133333333333381 4.358863636363637 -0.010000000000000009 10.005126262626263 8.263535353535351 5.673430134680131 9.488371212121212 0.5590909090909139 4.845138888888891 6.553758417508413 3.156843434343438 17.37493686868687 0.9335606060606106 9.427491582491582 0.9868434343434391 0.9691666666666714 0.8332786195286246 4.37444444444445 0.10249999999999998 9.700370370370369 6.458670033670029 6.538320707070711 4.0787878787878835 5.902348484848483 0.25458333333333333 5.1832702020202035 7.4655134680134685 3.2499368686868637 -0.2058333333333333 6.153459595959596 0.4137500000000001 3.2071969696969735 0.6583333333333381 8.751670875420873 0.5492803030303031 1.7937500000000046 -0.0625 0.11327020202020366 2.783775252525252 3.0884595959596 4.0183333333333335 1.7382702020202012 0.4444444444444491 0.8115151515151584 1.4728030303030282 2.3924999999999996 0.12083333333333357 2.8128661616161654 3.248383838383835 0.5258333333333334 2.1762794612794605 18.579924242424248 0.3766666666666669 0.6780555555555572 4.282297979797979 11.520475589225596 0.47026515151515635 3.1431313131313168 1.948585858585854 18.070244107744113 0.34083333333333327 6.766182659932657 3.6175126262626227 6.321077441077437 0.029166666666666563 4.366439393939394 0.507803030303035 0.28208333333333324 2.237222222222221 -0.04166666666666641 -1.0533712121212053 1.535606060606056 0.790833333333338 0.3354377104377151 7.077996632996628 -0.3554166666666668 0.24500000000000016 25.209065656565656 0.03708333333333341 2.6141287878787893 2.6685606060606037 0.14124999999999988 -0.19666666666666677 5.71888888888889 5.994061447811443 8.33477272727272 6.074074074074071 0.8009469696969649 0.3337121212121261 -0.0024999999999999467 5.788143939393942 0.11291666666666678 1.804537037037036 0.2732828282828329 2.9780723905723834 2.497045454545459 4.257234848484849 0.20958333333333345 -1.1621548821548782 0.33333333333333326 3.3240993265993257 0.6482323232323185 1.7010058922558913 5.098547979797983 6.310441919191919 9.930441919191919 1.4766666666666712 2.705050505050504 0.3720833333333333 2.2461700336700305 0.2154166666666668 1.656477272727277 -3.8483375420875436 -0.04416666666666669 15.058480639730638 1.0083333333333333 -0.25166666666666665 0.19833333333333347 7.7846632996633005 3.232916666666671 8.252689393939397 4.572937710437712 -0.05208333333333337 0.5641666666666713 0.907171717171722 1.0358333333333378 -0.21999999999999997 4.639217171717171 -0.1612499999999999 2.4958333333333336 2.2567297979797973 9.79304292929293 0.6838636363636315 0.8127272727272774 -0.0008333333333332971 1.1586405723905688 0.48484848484848986 -1.1649915824915753 9.83176767676768 3.1470833333333372 -0.2645833333333334 0.25833333333333325 -0.2170833333333333 3.415770202020201 0.26041666666666674 1.2584553872053865 0.6541666666666714 0.050000000000000044 0.010340909090906791 6.197832491582489 2.7483333333333335 0.308030303030303 6.690774410774407 0.9316666666666666 1.6363888888888882 9.722083333333334 0.033333333333333326 1.6149957912457906 0.4850757575757624 -0.026666666666666616 2.996868686868691 2.1186616161616154 -0.03958333333333375 0.03416666666666662 6.242340067340063 0.4348484848484804 0.4571254208754256 5.198758417508419 14.031485690235696 0.811784511784517 2.3016287878787827 6.3889898989898946 1.6265151515151468 0.867542087542083 10.47021043771044 5.274797979797983 0.20999999999999985 -0.13583333333333325 0.27708333333333335 -0.028484848484850778 0.3315909090909138 6.618640572390568 -0.004166666666666707 5.603977272727276 0.17583333333333323 0.481212121212126 0.02958333333333335 0.8937500000000046 1.825197811447816 0.5816666666666714 0.2623316498316519 3.451136363636367 0.32333333333333325 3.1521843434343433 0.6585984848484897 2.0970833333333334 14.50156144781145 0.8637500000000048 9.714583333333332 5.808173400673403 0.04166666666666663 1.9631313131313124 3.0955429292929253 0.03749999999999998 3.0944949494949534 -0.05736531986531257 5.85763888888889 9.046734006734004 2.834898989898994 0.2883333333333335 1.567647306397311 4.2502104377104315 -1.4748021885521814 2.2397222222222215 3.984166666666667 0.6166666666666714 -0.125 5.0315025252525265 3.1417171717171755 -0.365 -0.19499999999999995 1.8638888888888874 6.057815656565659 0.6160984848484898 0.030000000000000027 2.1701010101010096 13.69534932659933 0.5535984848484901 8.27209595959596 9.255155723905718 0.6966666666666714 0.5034932659932708 8.799570707070705 1.1403198653198703 0.018333333333333313 0.18541666666666667 0.16874999999999984 0.1841666666666667 1.5595833333333382 10.522087542087537 5.440774410774414 0.7083333333333381 -0.14708333333333334 0.08958333333333313 5.997579966329963 5.5216919191919205 0.060833333333333184 1.150681818181825 11.46386784511785 13.924137205387208 0.9411742424242471 -8.207293771043762 14.636414141414145 6.123232323232319 11.406321548821555 14.746502525252529 0.5166287878787929 23.8108164983165 -0.21750000000000003 -3.3430176767676687 0.2283333333333334 0.40310606060606047 -8.004090909090895 1.7189520202020196 -0.29249999999999987 0.8387499999999999 0.08875000000000005 24.896127946127944 0.31416666666666665 6.633560606060606 1.6576515151515103 2.634255050505052 -0.07750000000000001 6.232289562289558 1.6222727272727324 2.87459595959596 1.6904166666666716 0.18375000000000002 3.3481818181818173 1.882083333333338 0.4787499999999999 3.2037037037037073 15.280542929292931 0.26041666666666663 -6.005374579124563 1.239974747474753 0.03541666666666643 12.830871212121213 2.7460101010101026 0.8519696969697016 1.2362878787878837 0.1404166666666623 4.065492424242425 0.1791666666666667 6.632070707070703 9.692045454545454 4.869078282828284 6.743337542087538 4.840113636363636 0.09750000000000014 3.6688131313131302 2.102521043771043 24.913699494949494 0.23541666666666672 -0.09999999999999987 9.557083333333336 0.31041666666666634 -3.3575715488215407 0.1741666666666666 0.19166666666666665 0.3245833333333332 0.5186363636363682 3.940101010101009 0.7736195286195262 0.27083333333333326 0.18958333333333327 8.478779461279455 3.1885353535353573 3.868392255892258 1.20875 12.43625841750842 -0.15333333333333332 25.114044612794615 19.66059764309765 0.17291666666666666 1.1208333333333331 2.9714393939393986 0.7024999999999954 0.0616666666666667 0.7551262626262624 24.613333333333333 0.12916666666666643 4.808059764309758 -0.1333333333333332 19.300601851851855 0.05624999999999991 8.843665824915824 23.747916666666665 6.367424242424239 0.02083333333333337 1.099166666666674 7.354061447811453 1.0025 4.263636363636363 2.320896464646464 8.17654461279461 0.8579166666666667 0.029166666666660124 0.20791666666666653 11.273110269360274 24.597466329966334 0.3604166666666668 -0.014999999999999958 12.648712121212116 3.9399999999999995 5.848695286195289 0.16791666666666683 24.98299663299663 0.024166666666673775 14.554768518518522 1.6729166666666713 -0.029166666666652574 0.010833333333333361 7.073211279461276 9.84380471380471 24.099208754208753 10.117853535353536 0.2883333333333332 25.18475589225589 0.30255892255892736 0.35784090909090904 12.944339225589232 -0.13416666666666655 0.5162878787878833 3.1184048821548775 25.45123737373737 1.4046212121212172 1.1075000000000002 1.1608333333333334 6.659684343434339 0.12916666666666676 -0.18500000000000005 0.33333333333333304 5.947293771043769 1.8234469696969695 4.919726430976425 0.33791666666666687 5.939377104377101 0.35257575757575743 0.09166666666666667 1.6604166666666718 3.1234848484848463 4.710643939393941 0.06666666666666554 1.6979166666666712 0.8533333333333379 5.636893939393943 0.11250000000000004 -0.27749999999999997 4.665404040404038 12.082567340067346 4.021654040404043 13.430155723905727 0.4254166666666668 5.62638888888889 1.2669318181818152 6.381296296296292 5.753914141414149 22.168329124579124 -0.20666666666666667 0.1949999999999999 0.32916666666666683 1.9104166666666713 0.014166666666666716 1.6601136363636317 1.5758333333333285 3.6887626262626223 3.362058080808077 6.305787037037033 5.347032828282829 -0.05208333333333326 12.76877104377105 1.632083333333338 2.9293686868686906 -0.0724999999999999 1.5687500000000048 4.929166666666665 0.016666666666666607 4.7477777777777765 -0.08208333333333351 5.307630471380471 0.21708333333333346 0.46773989898990376 4.49155303030303 9.320568181818176 5.384726430976435 0.1275 0.9195496632996584 10.142045454545453 0.6763636363636363 3.15883838383838 9.05270202020202 1.5957323232323228 1.5562500000000048 6.049587542087545 1.4662500000000047 -0.1449999999999999 5.437108585858588 0.6235269360269408 17.611628787878786 -0.3025 5.893055555555557 0.5200000000000049 9.290000000000003 5.27136363636364 5.792992424242427 9.9875 1.6709511784511775 4.672159090909089 -0.01416666666666666 0.719772727272732 -0.1379166666666667 0.7158333333333381 0.9780808080808132 3.0652398989898955 17.653425925925927 0.1854166666666665 2.063686868686868 0.16375000000000012 0.01666666666666672 9.502356902356897 0.5863636363636315 7.605984848484851 -0.09750000000000003 12.920265151515158 -0.029166666666666785 0.26333333333333336 7.157386363636364 -0.04458333333333331 -0.7683207070706998 -0.02499999999999325 -0.4016666666666666 0.3095833333333333 1.4850000000000017 -0.595875420875414 4.550340909090908 1.2757070707070728 14.416266835016838 3.9558333333333335 2.634608585858585 4.727449494949493 14.8162962962963 -0.006666666666666654 4.280904882154887 0.012499999999999845 0.015000000000000013 0.4650757575757576 23.345218855218853 0.07625000000000004 -1.4103114478114431 0.0279166666666667 -0.04166666666666674 6.950757575757583 1.9295454545454607 0.9194570707070779 -0.10541666666666671 -0.00833333333333336 6.282483164983161 2.384591750841745 0.02499999999999991 0.6441666666666714 0.6729840067340117 -1.1635690235690173 0.15000000000000013 0.2704166666666666 -0.13954545454544764 0.9083333333333378 13.313446969696972 4.432542087542094 13.759162457912463 7.888661616161616 5.497222222222224 1.005542929292929 3.369827441077441 0.03333333333334565 0.05333333333333329 0.2062500000000001 0.5612500000000048 -0.039583333333333415 0.8558712121212072 2.0185101010101 2.247222222222222 7.04674242424242 4.291439393939393 0.22458333333333347 10.240252525252524 1.2316666666666665 1.8224999999999951 0.17291666666666672 11.877588383838388 16.165593434343435 -0.0024999999999999467 0.4941666666666712 0.6742760942760992 4.010909090909091 1.7688552188552187 -0.06041666666666656 0.28583333333333333 5.128320707070709 1.958409090909086 1.821818181818177 0.36375 5.589541245791239 3.2384595959595917 5.832415824915821 5.088476430976429 3.2017045454545494 0.2575799663299696 -0.1166666666666667 5.012344276094278 0.012500000000000067 3.78819444444444 0.32749999999999985 -0.36291666666666655 8.733345959595958 4.102550505050504 0.02499999999999991 23.45838383838384 0.8695791245791299 0.5254545454545503 6.941691919191914 -1.250669191919186 24.676367845117845 0.5286279461279508 -0.1316666666666667 0.6377525252525302 0.031249999999999112 -0.0008333333333333526 5.811750841750845 -3.2973232323232295 1.854999999999995 8.690446127946126 0.3395833333333333 0.8470833333333285 14.698745791245795 24.200084175084175 -0.07916666666666683 1.889511784511784 5.445744949494948 4.929671717171715 18.62428872053873 6.862727272727269 3.500997474747471 -0.007087542087535148 3.694633838383834 2.199347643097642 1.915000000000005 0.7682070707070721 0.048333333333333284 0.48083333333333333 15.852714646464646 -0.015416666666666745 4.328787878787881 0.733333333333338 -3.8493728956228965 6.788606902356902 0.0024999999999999467 1.083110269360274 4.250643939393938 0.5289393939393989 2.1227819865319857 -0.8724158249158223 0.15988636363636355 0.009166666666666712 3.4142171717171674 +scenario heads-up gto +deals 3000 +seed 1592590337 +counts 15020 13 0 +samples 0.75 0.7248106060606061 0.5176136363636319 1.0909301346801392 0 1.1083333333333334 -1.3104166666666668 0 0.08750000000000746 0.18465909090909083 -0.507449494949495 -3.7618476430976378 0.2617424242424289 -2.9166245791245826 2.439772727272729 0.75 -0.2813131313131252 2.8873737373737436 0 -0.1958333333333333 -0.01325757575757569 0 -35.58712121212121 0.02500000000001279 0 1.1143308080808128 -0.2150799663299634 0 4.847432659932662 -0.19454966329965795 -6.6233375420875475 -2.2308712121212095 0.3767045454545457 5.262394781144784 0 2.770833333333333 -3.366498316498316 0 -0.37342803030302907 -0.18087121212121215 0 0.5535984848484801 -1.466074494949492 -0.4317340067340001 0.01666666666666672 0.75 -0.4368939393939395 -32.195138888888884 -0.11912878787878789 -3.00833333333333 1.5243686868686868 0.75 0.4835227272727276 0 0 -0.7103535353535353 0.4605008417508438 -0.6571969696969696 0.24545454545454515 -0.02430555555555558 -1 0.17605218855219051 0.75 0.75 3.6038089225589234 -0.27500000000000013 -1.758333333333331 -0.004356060606060641 -1.8819865319865299 3.7075547138047167 1.20625 1.2541666666666669 0.7073653198653223 0.8751893939393911 0 0 -0.4249999999999998 0.8616792929292929 0 -1.0840909090909092 0 -0.20296717171717393 0.148442760942761 1.987899831649833 -10.448611111111104 -0.28636363636363904 -4.796548821548827 0.016666666666666163 0.75 -4.1498106060606 -4.160833333333334 -2.1166666666666667 -1.3627946127946124 5.467929292929294 2.2666666666666666 -0.7662878787878789 0 3.5925715488215513 2.2416666666666667 2.6024621212121213 4.187121212121207 0.10416666666666674 0 0 0 -2.608228114478112 0.22916666666666652 2.625 0 -0.4876893939393939 -1 11.218897306397317 -4.438068181818181 -3.1112373737373735 -4.256944444444439 0.019507575757570894 -2.1057449494949463 -5.363215488215484 -2.967992424242424 -0.2821969696969697 -0.15416666666666667 -1 -0.3675505050505051 -0.13750000000000007 0.75 -7.162962962962953 1.3768939393939412 -0.15833333333333344 0 1.4454335016834992 1.0131313131313187 1.6958333333333313 -0.24614898989898992 0.7405303030302981 0.9626893939393986 1.4228956228956253 2.7312079124579243 0 -0.6183712121212073 -0.4666666666666668 0 -0.9567550505050504 -4.101893939393937 1.5562500000000048 12.204061447811458 2.9047348484848436 0 -2.182007575757576 0.5557659932659949 -1 -1.1541666666666668 5.5718223905723985 18.920833333333324 0 0 0.75 0.75 -0.5868686868686868 -0.08396464646464907 2.507765151515149 -0.39564393939393927 0.661489898989899 0.185606060606061 -44.54375 0.75 4.851346801346795 -2.5 0.8214015151515204 0 -0.10833333333333328 0.019318181818186897 0 -1 0.5804924242424241 0.4227062289562309 0 -0.5925126262626261 0.01041666666666674 0.039583333333333415 4.141666666666671 0 0 -0.5972222222222223 1.2871212121212172 3.1428872053872072 1.137310606060606 -0.02708333333333357 -0.04791666666666661 0.12708333333333366 4.452525252525254 9.674999999999997 0.24962121212121202 0 -4.057234848484848 -3.720580808080803 -0.5665824915824915 0 0.015361952861954853 -1.4458333333333333 -5.407260101010095 0 -0.9374999999999973 -0.30827020202020206 0.34185606060606055 0.41369949494949754 0.6191919191919233 -0.35 -1.1157196969696923 0.5112373737373737 0 -6.406292087542089 2.345833333333333 -0.28630050505050497 0 -0.5208964646464647 0.018750000000000044 0.866540404040404 -0.13541666666665986 0 -7.746191077441081 0 0.4492424242424242 0.75 -0.3522727272727273 0.75 -0.18541666666666679 -0.061489898989899094 0.8479797979798003 -0.47935606060606084 -18.07 -3.2898779461279437 -0.15833333333333333 -3.6760101010100956 -0.22878787878787854 0 -0.07310606060605829 -0.7032828282828283 0 0.75 -25.60656565656565 -1.8374999999999977 0 3.416498316498321 0.75 0.33125000000000004 0 -0.48939393939393927 -0.010416666666659635 0.75 0.75 0.75 0.8374999999999955 -1.4715277777777742 0 -0.9350378787878788 0.16003787878787867 -0.017045454545454586 0.008333333333333526 0.7602904040404088 -1 0.6061447811447763 -1.0104166666666643 -5.135185185185183 0 0 0.871338383838383 2.6625 0.75 -0.01041666666666674 0 1.2325757575757574 0.75 -0.20252525252524745 0 22.446780303030316 3.085122053872056 -1.5489898989898963 0.24128787878787872 -3.0403409090909093 1.0604166666666668 0 1.3736742424242472 -0.2354166666666666 -0.15227272727272723 0 -0.5073232323232302 -6.936279461279457 0 -0.7871212121212121 -0.45498737373737375 -0.07272727272727231 0.29583333333333095 2.953787878787886 0.36250000000000004 -1.2287878787878788 -0.2752525252525253 -5.324179292929296 1.1965909090909133 -0.9500631313131289 1.775757575757573 -1.4800294612794618 -0.21079545454545456 5.049909090909095 -2.2278409090909093 -1.508059764309758 1.6186447811447855 1.2112500000000002 -0.6043560606060605 0.75 0 0 0 0.32272727272727253 1.3123737373737372 1.6703493265993272 0 -2.0689393939393943 0.75 0.12083333333333335 0 -0.06458333333333344 -2.6680303030303003 -1.5812499999999976 -0.31117424242423963 38.61609848484848 -1.8437878787878739 0 -0.2825757575757577 1.452398989898992 1.0291666666666668 -0.3773358585858585 0 0.75 3.3833333333333333 -0.014583333333333393 0.75 0 0.017234848484848575 0 1.907828282828274 0.7746212121212119 0.1395833333333334 0.6060606060606015 0.46022727272727293 0.75 0.75 3.5685606060606094 -0.25151515151515147 0.7343644781144829 0 0 -0.8181186868686794 -2.46875 -0.022916666666666696 2.8816077441077463 -1 0.5378787878787878 0 0.9833333333333333 0.75 0 -0.016666666666659058 -2.9997895622895596 0 -2.190340909090909 1.0792297979798002 -0.4039772727272728 9.674999999999997 -0.10833333333333317 1.3902777777777726 5.685816498316497 -0.09166666666666667 0 -0.14166666666666683 -1.643118686868687 0.75 0 -0.061868686868691514 0.09375 -41.313257575757575 -0.611237373737374 0.03623737373737379 0 -6.816203703703711 -0.16799242424242689 -0.6583333333333332 -1.8791666666666642 -1.275 0.75 -11.71727693602693 1.3534722222222186 -0.042276936026936385 -1.2791666666666643 0 -2.513068181818178 -1.8312499999999976 0 0.08503787878787872 -1.2427188552188597 0.75 2.5943181818181844 2.277967171717176 -1.723590067340065 -1.874747474747475 0.033333333333333326 -2.7825000000000033 2.7548484848484858 0.04583333333333983 0 0 0 45.23939393939394 0.02083333333333326 0.919128787878793 -0.11041666666666661 0 -0.16249999999999998 0.75 -0.5773569023569043 0.6543560606060559 -0.030303030303030276 0.10303030303029859 0.0458333333333405 4.524831649831647 -0.44286616161616443 -0.15404040404040842 1.8600378787878764 -4.277377946127941 -0.10416666666666663 -2.364583333333337 1.0208333333333333 0.216161616161624 -0.6924242424242424 -0.7647727272727274 4.844549663299663 -1 -1.2299242424242398 0 5.5805555555555575 -0.05896464646464672 2.5206818181818185 0 1.3527777777777832 -0.23495370370369884 -17.968295454545455 0 0.8287878787878789 0.029166666666667007 1.568939393939394 0.8583333333333332 1.1708333333333356 0.8557449494949516 2.9506313131313155 1.6020833333333309 0.7152146464646436 1.3965909090909137 5.965404040404039 -0.4263257575757575 0.35397727272727253 -1 -2.1251893939393947 -0.42348484848484846 0 -0.8765151515151515 1.053367003366993 -0.020833333333340365 0.22291666666666665 -0.581628787878788 0.918623737373742 0 9.315845959595961 0 2.0602272727272766 0.5893939393939394 2.2229166666666664 10.165972222222223 -0.004166666666666652 0.5635101010100965 -0.125 1.5668560606060558 0.5783670033670059 -0.04562289562290012 -2.408333333333333 -36.088005050505046 1.8958333333333335 -8.395622895622896 0 -0.35450336700336216 -1.0795244107744086 2.5916666666666597 -41.78480218855219 -0.883333333333336 5.336363636363637 -0.33825757575757576 -1.019423400673392 0 0 -1.2461489898989924 -0.662878787878788 2.25 -0.7537878787878789 0.75 2.6416666666666666 18.329292929292933 -0.412962962962957 -0.9719696969696972 0 0.9270833333333334 1.829166666666671 -0.11875000000000002 0 0.75 0.8845328282828326 0.6763257575757577 -0.7922979797979797 1.48106060606061 0.07083333333333353 0 0.75 0.75 -1 0.34090909090909105 5.152588383838384 -0.58646885521885 0.16388888888888875 -2.4645833333333336 0 0 -2.398442760942757 -4.181250000000005 -0.9873526936026955 -2.6083333333333334 0.75 -0.9935606060606057 0 3.862310606060606 -0.12291666666666679 -0.4843434343434344 0.27746212121211844 -3.268750000000001 0 -0.12916666666666665 0.23819444444444438 0.75 0.19374999999999987 0.9357744107744133 0.75 0 -0.26041666666666663 0 -0.419746212121213 0.9004419191919191 0.5051136363636366 -0.02499999999999325 -0.0333333333333401 -0.7896590909090913 1.5152146464646459 0.1812499999999999 0.23756313131313123 0 -0.06584595959595951 0.08124999999999982 -3.014015151515151 -0.6857954545454545 -0.99185606060606 1.6500000000000046 -4.206607744107739 -0.7210227272727273 0.02499999999999991 -1.4354166666666643 -0.3208333333333333 5.702765151515147 0 0.23150252525252524 -0.039583333333333304 0.919810606060611 -0.21283670033669555 -2.479166666666667 0 -0.7491372053872005 -0.7729166666666667 -0.18125000000000036 0 -0.12291666666666656 0.75 -0.07708333333333339 0.75 -0.42165404040404053 0.75 0.75 0.75 -0.01041666666666663 0 -1.3482954545454522 -1.1749999999999998 -2.3574284511784533 0 0.1352441077441071 0.07291666666666652 -1 0.5886363636363656 1.5323021885521935 0 0.19374999999999987 0.75 0.75 2.9567045454545444 0 0 -0.6015782828282829 1.1863636363636412 2.0729419191919276 0.5804924242424243 0.03958333333333308 -0.8434974747474726 -0.012499999999999956 2.470833333333333 -9.032512626262616 0 0.75 0 -4.589962121212118 -5.112521043771042 0.12291666666666679 -1 0.7363005050505051 -0.04583333333333339 1.3240530303030256 -1.3907196969696987 -0.41635101010101017 0 -0.6825126262626262 -1.4247474747474724 1.268160774410784 0 0.10624999999999996 0 -0.5011363636363637 0 0.9653619528619606 1.6479166666666645 5.901893939393946 0 -2.5 -7.463973063973061 0 10.800063131313141 -21.175652356902354 -1.0585227272727298 0.5789983164983217 -0.8458333333333334 -2.0604797979797977 0 0 0.2748106060606086 -0.5621212121212036 0.14747474747474554 -0.10833333333333317 -2.5412457912457938 0 -0.16742424242424248 -0.18125000000000036 0 7.4759048821548735 -2.948758417508415 0 -6.7158038720538675 -1 -0.05833333333333335 0 -0.018750000000000044 1.56907196969697 0 45.20808080808081 2.4458333333333333 -2.34962121212121 0.9871632996633082 1.6544191919191968 -1 -0.033333333333333326 1.19964646464646 0 0.027083333333333126 -0.6131944444444446 0 -4.407891414141418 1.262689393939398 0 -0.5809974747474748 0 -24.1525 0.07916666666666639 -2.5526515151515103 -0.8255681818181748 -2.0549242424242427 0 0.5994318181818182 8.833291245791244 0 -2.3020833333333335 0.22916666666666652 3.228661616161612 -0.04791666666666661 -3.9755892255892205 -0.08655303030303019 -4.31801346801346 0.002083333333333215 0.054166666666666696 -48.85587121212121 -0.545770202020202 0 0.07617845117845667 1.149684343434341 -0.3076136363636359 0.5151094276094303 0.002083333333333437 -1 1.9232954545454537 -1 0.002083333333333437 6.655946969696968 -7.879999999999999 0 0.9104166666666668 1.3732954545454543 1.5693181818181863 0 0.75 1.1057449494949516 -3.906313131313129 -1.208333333333332 -0.40549242424242427 0 0.19166666666666665 3.429882154882155 -14.692487373737363 0 -0.2020833333333334 -3.4340025252525184 -0.09375 -0.07272727272727275 0.18541666666666656 0 -0.0854166666666667 -5.047095959595954 0 -25.42984006734006 0.75 0 0 1.311216329966332 0 -0.42992424242424243 0 4.34520202020202 0.5482954545454499 -1 -5.685795454545452 0.7282196969697017 0 -1.891792929292924 0 1.3958333333333335 -1.3810606060606037 5.896296296296302 -0.21590909090909083 -0.37424242424242427 0 -1 5.800378787878781 -4.440761784511789 0 0.5047979797979818 -0.5607323232323234 0 0 0 0.02651515151515138 -0.6202020202020162 -0.27178030303030587 0 -4.703577441077435 -8.571439393939393 -2.48125 0 1.1240740740740764 0 -0.16066919191919204 0 0 2.4875 -3.737499999999992 0.027083333333340676 2.5399200336700307 0.07083333333333341 0 1.6685606060606062 0.1875 0.75 -0.08074494949495392 0.9907196969696969 -0.6776515151515177 -0.8520833333333311 -0.32354797979797967 2.540556818181823 1.2625 0.7918560606060607 0 0.6193602693602716 3.666645622895625 0 0.11250000000000004 1.9622727272727243 -0.23124999999999996 0.8904671717171764 0.3333754208754245 -0.382954545454548 0 0 -0.8051136363636389 2.0786616161616203 -0.30467171717171726 -0.6729166666666644 3.101809764309761 0.9492213804713832 0.25069444444444433 1.0537878787878787 -3.8133838383838325 1.0998737373737424 1.754755892255897 -0.09166666666666679 0.03125000000000022 0 0.75 -0.14943181818181817 0.75 1.1437500000000043 0.75 -5.632638888888883 0.7888678451178501 0 5.71465909090909 -2.2162457912457887 -0.004187710437708159 3.034301346801349 0 -1.0268939393939396 0.09375 -22.593223905723907 0.12213804713804954 -0.05277777777777792 0 0.11818181818181817 -2.5625 0.75 0 0.943265993265995 0.3604166666666666 0.4556818181818183 -1.0354545454545456 -1 0 -1 -4.0467171717171695 -3.8513888888888785 0 -0.18541666666666667 0.1020833333333333 -0.9443813131313101 2.6973905723905807 0.11041666666666683 0 0.941540404040404 2.5229166666666667 -1.7387415824915822 -0.5604587542087567 0.04791666666666661 1.0785984848484849 -27.034532828282828 -1.6104166666666666 -0.3604166666666666 -1.3378787878787857 0.4670033670033671 1.718560606060608 0 -3.1337121212121235 -1.7258838383838384 -0.0456439393939394 1.4690025252525247 -6.527083333333328 -2.2177188552188527 2.3 -0.8814393939393965 -2.354335016835013 -0.9164772727272752 -0.5157196969696969 0 0 -1 0 -0.10000000000000009 0 -1 -1.5714015151515097 -1 -0.640088383838384 0 6.449999999999998 -1 0 0 -0.5012626262626263 -2.1780303030303036 0 -1.0179924242424219 -0.031249999999999778 2.475 0.07108585858585859 -0.18541666666666679 -0.40896464646464636 0 2.9883333333333333 0.75 1.347537878787879 13.788560606060607 -1.6946338383838349 -0.004166666666666652 3.5247474747474827 0 -1.364646464646464 -0.06875000000000009 1.3270833333333334 -2.5479166666666666 -0.8535984848484826 -10.511510942760935 0.10094696969696493 -1.04375 -3.9441287878787827 1.6265151515151468 -3.37333754208754 -3.0846801346801307 0.8333333333333333 0.062499999999999556 2.29375 0.016666666666666607 0.75 0.19791666666666652 0 0.03333333333333366 -1 10.799515993265999 0 -0.4566287878787879 0 0 0.01666666666666694 0.8945496632996679 0.19791666666666663 -0.04999999999999272 -1 -0.3458333333333333 -1.7240109427609427 0.75 0.75 2.963341750841753 -0.26250000000000007 -0.33352272727273036 -0.3977272727272727 -0.39412878787879246 0 -1 0.8999999999999999 6.83068181818182 -2.505534511784507 -4.58796296296296 0.044570707070707094 2.9000841750841797 -0.826578282828283 -0.11130050505050526 -1.471212121212119 0 1.2664772727272768 -0.0520833333333337 -0.15416666666666667 -2.2083333333333357 -0.40991161616161076 -0.8044823232323233 2.550189393939399 0.3496212121212121 12.79375 -1.1668981481481504 0.008333333333333304 3.5058922558922587 0.9452441077441034 0 0.8502525252525253 0 -5.189941077441075 2.7416666666666667 0.03750000000000009 0 -0.5130681818181844 0.5280303030303031 -0.03958333333333375 4.7829545454545475 0 -2.595833333333333 0 0.6306818181818201 -6.8966750841750795 0 0 -0.1645833333333333 0.75 0.06458333333333321 -19.9138468013468 0 0 0.75 0 -2.520833333333333 -0.08124999999999982 0 -17.388888888888893 0.75 0.13541666666666652 0.75 -0.2440025252525253 -2.1604166666666558 4.777904040404042 -4.25555555555555 -0.09583333333333321 0 -0.29324494949494984 -4.155955387205392 0.75 0.75 -0.957007575757576 1.5813341750841776 17.87420454545454 -0.3740109427609448 0.05429292929292928 0 3.478451178451187 0 0 -2.3864478114478054 0.6571969696969697 5.054608585858587 -0.3964015151515152 -0.17708333333333337 -0.13750000000000007 0.75 -22.1319962121212 1.5883838383838378 0 -1.902083333333331 0.75 -0.050000000000000266 -2.0926136363636365 -0.8730850168350199 0.09078282828282846 0.75 0.7092803030302981 -0.13750000000000007 0 0.09166666666667411 0 2.552083333333333 0.20833333333333326 1.7905303030303084 0.15500000000000014 1.2571338383838433 0.8895833333333334 0 -0.839141414141412 5.143939393939389 1.3335227272727286 1.1204545454545505 1.3333122895622918 -3.8693392255892203 -0.014583333333333393 0.06875000000000009 0.75 -0.9356060606060606 0 0.02083333333333326 -1.8077651515151516 3.735732323232323 -1 0.10473484848484382 0.30505050505050535 0 -3.8704966329966304 12.097735690235695 0.75 -1.9757575757575758 3.7905934343434393 -1 -11.096780303030304 4.41375 0 1.6333333333333384 0 0.75 0.09442340067340305 -0.9782828282828255 -2.7653409090909093 0.060416666666666785 -1.06875 0.7437499999999955 10.507933501683507 1.2270833333333333 0.006250000000000089 0.75 0.7643518518518542 -0.07916666666666661 -0.8772306397306422 -0.5740319865319838 -3.0046085858585743 4.517508417508413 0 1.4572348484848532 -0.05625000000000002 1.386174242424247 -0.08124999999999982 0 -2.39375 -1.2042803030303033 13.517066498316503 0.7075757575757575 1.5151304713804694 -0.4532196969696969 0.5200757575757575 -0.2416666666666667 0 -1 -1 0 0.13672138047138538 -0.014330808080808222 6.285416666666669 -2.489583333333334 4.891224747474751 0 -1.0009090909090905 0 3.726031144781147 3.656249999999995 -5.078724747474745 0 -0.5641203703703734 0.8684343434343478 0.7666877104377128 0.6628787878787907 -22.71231060606061 0 0 -0.014583333333332948 0.41799242424242444 0.876830808080808 -0.3905934343434343 0 1.7175757575757546 0.125 -0.039583333333333526 1.5521885521885577 -1.0592803030303028 -0.002272727272727204 0.7077651515151517 -0.40946969696969693 5.734764309764309 0.38710016835016825 -2.908775252525242 -4.505303030303025 0.027083333333333348 -0.5785984848484875 18.97053872053871 0 0.5043981481481526 0.75 -8.745223063973059 -36.58061868686868 0.75 -2.3625000000000003 -0.2753998316498365 0 0.8054924242424268 0 0.75 0.75 -0.47411616161616166 -4.562647306397304 -19.423611111111093 0 0.18295454545454515 -0.6943181818181816 0.016161616161616044 3.050189393939387 -0.07556818181818192 -0.6052609427609394 -3.591582491582489 -2.7020833333333334 -0.02367424242424243 -2.1375 1.0975378787878811 -2.9634469696969696 10.04854166666667 -1.3640782828282805 0.75 0 0 -1.2765782828282795 0 -4.214583333333334 0 -0.02083333333333348 0 -0.002083333333333326 -2.5083333333333333 0 0.75 -1.192045454545452 6.494276094276093 3.2380681818181842 0.5512626262626259 0.8895833333333334 -1.6282828282828261 -37.68794191919192 1.1251893939393836 -0.27619949494949503 0.058333333333333126 0 0.5478535353535405 0.7020833333333333 0 0.2991498316498329 -21.97573653198654 6.921534090909095 0.75 0 0 0.40984848484848513 -2.2357575757575807 0 0 0.6075336700336729 0.6467803030302983 -0.34791666666666665 0.75 0.5921296296296323 -0.6452651515151515 2.4145833333333337 9.564772727272727 0 1.159583333333333 -0.540909090909095 -2.4338383838383733 0 0.75 0 0.7402777777777778 0.48958333333333337 0.8770833333333333 1.2113636363636366 -1 2.7632996632996676 0.6081439393939441 -0.07083333333333308 0.10625000000000007 -2.4187499999999997 1.3118265993266036 1.8583754208754255 0 -1.1458333333333335 -0.5147727272727272 0.008333333333333304 5.365757575757563 3.1788720538720563 -0.8003787878787878 2.1211489898989875 0 0 0 4.945559764309767 0.75 -1.2876893939393914 0.002083333333333437 0 3.199368686868698 1.7900378787878786 2.7756944444444387 -0.3107954545454521 -0.3861742424242447 -33.833333333333336 -9.965113636363636 -1.3537878787878788 2.4170454545454567 -2.1025252525252527 0.75 1.048400673400678 -1 -0.37916666666666665 3.3290684624017857 -2.5702230639730614 0 4.142992424242419 -0.3645833333333335 -16.169591750841743 0.10208333333334085 -1.8242887205387173 1.791161616161621 0.75 -0.19166666666666687 2.762058080808081 1.4227272727272766 0 -0.7503156565656521 3.492697811447813 0.12708333333333321 -11.1349537037037 -0.44905303030303023 1.5291666666666646 -1.915151515151515 0 -3.29375 -2.470833333333333 0.05625000000000013 -1.0721380471380466 0 -0.3916666666666666 -0.3145833333333333 -2.8839436026936003 3.932260101010103 -0.20833333333333337 0.8032196969696921 2.6912457912457937 0 3.0317760942760965 0.48390151515152 0.19981060606060863 1.8452651515151537 0 0 0.6471590909090907 0 0 -0.16249999999999998 0 -0.3267045454545454 1.40625 0.75 0.75 -0.4869318181818183 1.5604166666666646 15.36590909090908 -0.17499999999999993 -1.2645833333333334 7.232112794612798 0.029545454545454652 -1.6690446127946155 -0.7270833333333309 1.6941287878787878 -2.6033459595959623 -0.15833333333333333 0.9860479797979773 -0.7121212121212122 -0.08125000000000004 0.75 0 0 0.75 -0.48844696969697 2.3577651515151583 0.75 2.9136994949494923 8.276515151515152 0.9335227272727225 -3.8884048821548762 0.75 0 0 0.75 0.34166666666666656 0 -0.6354166666666643 -0.12291666666666656 -11.319318181818181 0.24375000000000002 -6.520538720538715 -2.525 2.6959595959595988 0.31136363636363185 -8.90435606060606 -0.08958333333333335 0 -2.645328282828283 0.38295454545454544 2.3439814814814754 -0.35132575757575735 -0.34242424242424496 0 -1.334890572390572 -1 -1.2333333333333334 1.585606060606061 3.2215488215488266 0 0.3410353535353483 0.8812499999999999 -1.0210227272727253 0.039583333333333304 0.06874999999999987 -0.7066919191919192 -1.217824074074072 -0.1875 0.04583333333333339 0.06041666666666645 -1 44.07242424242424 1.3875000000000002 0 2.930808080808083 0.04583333333333339 -0.03661616161616166 0.9397937710437709 0 0.31811868686868694 -10.251886363636364 -0.37880892255892196 0 -8.2507196969697 0 9.674999999999997 0.75 0.26041666666666674 0 1.0353114478114431 0.008333333333333415 0.75 1.0794191919191876 -1 9.890586419753081 0.0416666666666663 0.9554924242424196 1.6795454545454547 -0.2642045454545454 4.269444444444447 0 -0.15486111111111112 -0.014583333333333393 0.07499999999999984 1.3539772727272696 0.5482954545454546 0 -0.03750000000000009 0.75 -2.439583333333333 7.489078282828277 1.455765993265996 -2.3210858585858576 -1.9623316498316443 5.837920875420878 -2.399431818181816 -13.973716329966319 0.75 -0.12708333333333333 -0.592045454545447 -0.27563131313131306 0 -0.01041666666666674 2.2589646464646442 3.1511363636363683 3.4066708754208754 -2.663341750841747 8.92765151515153 1.1347432659932684 0 -0.3275673400673349 0.9924452861952886 -6.43093434343434 14.655303030303026 -5.5325336700336685 0 -1.3672979797979772 0 -0.44330808080808337 1.0804292929292956 1.257870370370373 5.289962121212122 0.2604166666666665 0.75 0 -0.43421717171717156 -31.325126262626252 -0.054166666666666474 -2.2668139730639694 3.054545454545452 -1.5149621212121187 -0.4626262626262605 0 0 -0.4369318181818207 0.75 -0.16041666666666665 3.3625 0 0 1.5422348484848425 0.75 -0.039583333333333304 -1.8839646464646478 -0.12916666666666665 0 0.18958333333333344 0.85075757575758 0.75 -0.4617424242424242 0 0.7934974747474794 3.71197390572391 -1.4878787878787856 0 -2.0704545454545427 0 0 0 1.6285984848484802 0.04583333333332629 -0.40536616161616346 0 -1.927967171717172 0 -3.1271464646464597 0 -1 -1.1355639730639755 2.4593434343434364 0 1.83125 0.2272727272727273 0.4979166666666667 0 0.5980218855218876 -2.441961279461282 1.5826388888888858 0 1.2 0 -0.9601641414141393 1.4527146464646483 0 -0.030681818181818254 0 -0.3566287878787878 -0.5658459595959595 0.75 0 0.9666666666666668 1.631250000000005 -0.8643939393939419 -0.21561447811448264 -0.15416666666666679 0 0 0.03124999999999989 15.376590909090906 0.11685606060606046 0.004166666666666541 0 1.7499999999999976 0.10416666666666674 -0.06041666666666634 -0.6371843434343378 -0.30827020202020206 0.6765782828282778 0.2785227272727271 -0.20170454545454808 0.7782828282828282 -18.454204545454544 0.75 -0.19026515151515144 -1.825631313131313 1.13125 -0.1596590909090908 1.2797348484848485 0 0.7315025252525252 0.006249999999999978 1.0868055555555571 -0.002083333333333215 -0.24924242424242427 -0.3262836700336649 0.6687500000000001 0.3998106060606017 -0.7176136363636367 -0.010648148148143521 -0.47791666666666677 0.4722727272727285 0.4128787878787836 -0.6219696969696948 -0.8227272727272728 -0.5944654882154858 -11.962310606060596 0.9059132996633041 -0.12104377104376507 0.16628787878787876 -0.0863636363636342 0 0.75 -1.589583333333331 -0.20890151515151523 -5.952899831649837 3.1615951178451196 1.3191287878787827 -0.4486742424242425 0.2316919191919189 0.8102904040404041 0 3.9645833333333336 -0.5663510101010099 -1 -1.8448863636363635 -0.1708333333333334 -14.967891414141418 -0.38901515151515154 0 0 4.950000000000008 0.8712752525252526 0 -1.7142045454545454 -0.07708333333333339 0 -1.2204335016835042 0.003514309764321766 -0.033333333333333215 -1.915712682379354 -0.12291666666666679 3.838888888888893 1.428977272727268 -0.42708333333333337 1.2520833333333334 0.8307870370370418 -0.8782196969696967 0.13541666666666652 -0.1791666666666667 -1 -0.9599537037037069 5.3456818181818155 0.12083333333333313 0.8291666666666666 -5.866414141414142 -0.01458333333333317 -1.9536363636363634 -1.118409090909091 0.22916666666666663 0 0 0.2416666666666667 0 1.4359217171717171 -0.3873316498316477 -3.343939393939396 -46.126620370370375 -4.7265572390572395 -0.08983585858585852 0 0.11994949494949503 0.012500000000000178 0 -2.5270833333333336 0.3185606060606059 0 -1.777083333333331 3.7683712121212176 0.04791666666666683 -0.08333333333333348 0.75 16.061363636363627 0 0.8028409090909134 1.9354166666666712 -1.7020833333333312 0 -0.0650252525252526 18.13914141414141 0 0 1.509617003367008 -0.2617424242424242 2.783333333333333 1.7062500000000047 0.6536195286195357 7.161237373737363 0 8.189667508417523 1.0625000000000004 0 1.2085227272727312 -0.05208333333333337 -1.5032196969696947 -0.10624999999999996 0.6475378787878809 0.041098484848484995 0.029166666666666785 -0.12474747474747461 -0.26079545454545716 0.03333333333333344 -0.2104166666666647 0.8327651515151562 0.75 0.23550084175083574 -2.435416666666667 0.30435606060606046 1.08125 0 0 0.48996212121212124 1.7109217171717168 0.5513257575757575 0.04999999999999316 -0.7752525252525224 1.5109006734006778 -2.5708333333333337 -15.774663299663302 0.07708333333333339 -6.381439393939392 0 0.6287878787878742 0.5810816498316498 1.903156565656559 -1.41875 9.964457070707086 0.75 -0.5910353535353536 0.2850378787878787 3.031691919191923 -0.06041666666666701 4.120475589225592 -40.178261784511776 1.3025252525252573 -1.7768939393939394 0.75 -0.15833333333333333 -0.8354797979797888 1.102651515151517 -1 -4.797348484848484 0.9270833333333333 1.8774200336700329 0.75 -0.737310606060606 -0.15833333333333333 -3.3604166666666666 -1 -0.18958333333333333 -13.336679292929286 0 0.36250000000000004 45.115972222222226 0.4726010101010101 0.75 2.0178872053872077 0.75 -0.01041666666666674 3.0156944444444442 0.6765782828282829 0 5.196843434343436 0.75 0.23655303030303032 -6.410648148148139 0.04583333333333339 0.018750000000000266 0 11.116561447811439 1.0823021885521906 0 0.15467171717171935 -0.5778409090909116 0.8270202020202047 0 -8.49768518518518 0 -0.125 0.022916666666666696 -0.24905303030303028 0 0.756464646464647 0.03541666666666654 1.46875 -0.5621212121212122 0 0.75 -1.6187499999999975 -2.53125 -0.22178030303030305 0 3.941477272727275 -0.04583333333333317 -1.0245159932659913 1.0552398989899112 -6.296064814814816 0.018202861952863802 -1 0 -0.8636363636363638 -1.2686868686868684 -1.8791666666666642 5.654250841750841 -0.5092171717171716 -0.029166666666666674 -0.02499999999999991 -0.0854166666666667 -0.2833333333333332 0 0 -2.1478535353535353 0.75 0 4.019128787878783 0.4143308080808079 0.1573863636363635 -1.2486742424242423 -0.43162878787879033 1.2683712121212174 -0.9343013468013468 -0.38497474747474736 0.75 -2.156481481481479 -0.1499999999999999 0 0.5368265993266015 0 -0.3241792929292928 0 -0.04602272727272716 0.2020833333333334 0.8553030303030303 -2.962563131313126 -0.15833333333333344 -0.03926767676767651 -0.7062710437710462 0.5306818181818136 -1.2625210437710415 2.998068181818182 -1.561616161616164 -1.3999999999999977 -1 -2.8722853535353536 -2.917361111111111 0.34791666666666665 0.30541666666666667 -0.09791666666666643 -0.016666666666666385 0 6.016287878787879 -40.78263888888889 0.08181818181818179 -0.3291666666666667 0 -0.016666666666666607 -2.8548611111111186 -0.12916666666666665 0.5840698653198704 0.31458333333333344 -0.5914141414141414 1.4603030303030358 -0.771590909090909 0 0.18295454545454537 0.23211279461279966 -3.012563131313131 1.7592803030302981 -2.525 0.75 0.49263468013468215 0 -1 1.6426767676767702 -0.6066287878787879 -5.570138888888883 -0.06666666666666643 0.23950757575757575 1.1783249158249107 0.75 -1 0 0.6405934343434344 -1.6666666666666643 -1.6722222222222247 6.877988215488208 -0.4096590909090909 -0.045833333333333615 -0.05000000000000693 0.34374999999999556 0 1.2304924242424242 0.1601430976431002 -9.067824074074055 -0.29595959595959587 0 0.75 0.028093434343434254 0.75 2.6208333333333256 0 -2.223674242424243 5.869204545454545 0 -0.13970959595959842 3.44640151515151 -2.8282828282828247 -0.11628787878787694 -1.0740530303030256 0.75 -0.19583333333333308 2.288446969696972 0.08958333333333324 -1.3757365319865298 -0.35132575757575757 -0.9457702020202021 0.5111742424242425 -0.08678451178450697 0 1.5419612794612851 -3.411300505050505 2.4899831649831676 -0.7178030303030303 -0.023232323232323493 6.238636363636363 -0.15477272727272773 -1.5304713804713783 2.2255050505050527 -0.1479166666666667 14.071299102132425 1.0768939393939394 0 0.8111321548821571 -0.07083333333333353 -2.7327020202020202 -3.806839225589224 -0.14482323232323235 -0.00416666666666643 2.425904882154885 -0.11874999999999991 0.012500000000007283 0.05833333333333335 -1.9491792929292906 -1.1755471380471356 -0.9287878787878787 -4.548947811447802 -6.447083333333337 0.37916666666666665 0.7102272727272727 -0.24703282828282846 1.5791666666666715 0.49981060606060557 1.8528409090909137 -0.21887626262626259 0.75 0 -5.03364898989899 -1.6124999999999976 0.6602272727272775 0.75 0 1.401094276094271 1.1344696969696966 -0.031249999999999778 0 3.9333333333333336 -1.0812499999999998 0 0 -0.700441919191916 0.751136363636359 -1 0 2.152083333333338 0.6041666666666694 0.1437499999999996 0.873611111111111 0.11458333333334014 0.5535984848484816 -0.5979166666666667 -0.3397727272727271 -16.166666666666668 -2.520833333333333 -0.15416666666666667 0 -1.7395833333333308 -2.030765993265991 0 49.09791666666667 1.3 0.8051136363636313 0 0.75 1.0579545454545407 -2.5229166666666667 -0.006250000000000089 0.7113636363636315 0 3.4901515151515103 -2.378367003366998 -0.4159090909090908 0 -38.82087542087542 -0.2714225589225583 0 -13.681439393939389 -0.5266835016835061 0.9720959595959544 -1.3897937710437722 -0.44507575757575757 2.217866161616162 6.145370370370369 9.935101010101016 0.2603535353535351 0.2910984848484848 0.2662878787878785 0.1312500000000001 0 0.5255050505050505 -12.492967171717165 -0.1791666666666667 0.75 -0.9030303030303013 0.09166666666666701 -0.5855429292929293 -0.3916666666666666 -4.835816498316493 0 0 0.60625 -0.20435606060606082 0 0 1.239057239057244 1.2875 -0.17140151515151514 0.18333333333333335 -1.994709595959594 -2.5541666666666663 -2.4020833333333336 0 -3.536847643097635 2.9387836700336725 -0.23371212121212115 16.755008417508403 -2.4604166666666667 0.8729166666666667 0.052504208754208914 4.418038720538717 0.7606060606060605 -1.7645833333333307 -0.4226010101010078 4.25429292929293 -0.4617424242424243 1.3825968013468062 0.6145833333333304 0 0.094949494949495 2.954819023569026 2.803282828282829 0.024999999999992584 3.1419612794612815 0.8708333333333333 0 -0.015277777777777835 0 2.3666666666666667 -2.11344696969697 -1.914583333333331 -0.45587121212121207 0.12897727272727244 -0.6285984848484849 -1.2884469696969674 -0.06262626262626747 -2.4270833333333335 -0.2437499999999999 3.6070707070707093 -0.05625000000000002 -0.14374999999999993 0.07916666666666572 -1.268939393939392 -0.8840909090909093 -2.310416666666667 -0.35890151515151514 0.3569865319865372 0.5790404040404087 1.3095328282828338 2.793244949494947 -0.1812499999999999 2.625803030303029 -2.5541666666666667 -2.2354166666666666 0 0.10416666666667407 -0.1499999999999999 0 4.683838383838374 0.7843434343434392 -0.28125 0.6673611111111112 1.1445707070707065 -2.4556818181818185 -0.5177819865319846 0.7956439393939347 0.060416666666666785 0.23718434343434358 -0.9916666666666645 -2.5041666666666664 0 0 0 -5.588952020202014 0.75 -1 0.9788510101010117 -0.15366161616161844 -0.795770202020202 15.934393939393932 0.383080808080803 -0.035416666666673535 0.002083333333333215 0 1.2354166666666666 2.0358585858585823 -2.043371212121212 -0.4486742424242449 -2.4375 -0.24135101010101023 0.3222853535353538 0.7509469696969651 -2.9229166666666644 0 -11.420412457912445 0 0 1.219949494949495 -0.044128787878788156 -0.3700757575757603 -1.8499999999999979 -1.7937499999999975 1.2524621212121168 -0.00410353535353547 -1.1331439393939393 0 14.529734848484837 -1.7059343434343432 0 -0.90549242424242 3.4937499999999977 0.75 0.75 1.1371212121212173 0.75 -0.15829124579124354 0 -0.4117424242424219 0 0.05625000000000002 2.438257575757569 -0.1333333333333333 1.0125000000000002 -0.08541666666665959 -2.29425505050504 0.7087121212121211 -2.492676767676768 0 0 0.849242424242429 0 0 0.050000000000000044 -1.9898989898989896 -0.15833333333333333 0 -2.5618055555555554 -0.2791666666666667 -0.4148358585858586 0.75 0.0013678451178427142 -0.14166666666666683 -0.645833333333331 0 -0.10000000000000009 -8.694659090909092 1.6448863636363682 -44.93657407407408 -1 0.06357323232323209 -0.5357954545454522 0 -0.33200757575757567 0 2.4020833333333336 0.7333333333333334 -0.7928030303030305 -2.4833333333333334 -1 0.38573232323232265 0.15625 0.3907196969696968 -1 4.5462121212121165 0 0 -44.59057239057239 -0.32832491582491485 0.08749999999999969 0.38005050505050497 -0.8737373737373713 -10.566750841750835 -2.5083333333333337 1.6291666666666715 -1 -0.1687500000000004 0.6746212121212118 3.192647306397304 0 -1.7958333333333307 0 -0.29520202020202024 -1.1425925925925888 1.0817129629629627 2.878661616161616 -1 -0.02708333333333357 0.2653409090909087 0.027083333333333348 -0.01458333333333306 -0.07916666666666683 -1.1356902356902334 1.8522727272727204 0 0.30000000000000004 0 0.75 -0.07916666666666661 0.2475378787878788 -0.08124999999999982 2.335942760942765 -0.06874999999999998 -3.9057870370370367 -1 0 -2.6907828282828286 -0.8748106060606062 -0.6382575757575757 0.42194865319865515 0 0 0.4660774410774424 -1.2875 2.3360900673400673 -4.474221380471375 0 1.223295454545459 0.6279461279461305 0.9062710437710475 0.3748737373737372 0.0699494949494951 -1 0 0.9696759259259311 -0.5513888888888889 -3.227651515151513 0 -1 -3.010113636363637 -1.373190235690236 -2.6177609427609454 -1.57718855218855 1.488295454545454 0.8370580808080827 -1.495833333333331 0.2833333333333332 -0.5556186868686867 0 -0.9737373737373716 -0.29261363636363424 0 0.125 0.23743686868686853 0 0 2.2333333333333334 1.6249999999999978 0 -0.15208333333333335 0 -3.877777777777781 3.924999999999997 -0.30662878787878545 0 0.75 -1.4166666666666643 -1.423211279461277 0 2.812499999999997 0.75 0.120328282828283 -1.8890151515151512 0.5021464646464648 0 -0.6665404040404039 -1.789583333333331 0 -0.11458333333333348 -32.551893939393935 -0.2751893939393939 0.013194444444444398 0 0 0.7895833333333334 0 0 0 -0.09375 -29.045833333333334 -0.34715909090909103 0.7104166666666667 0.5715277777777796 -1.021590909090909 -0.20654461279461556 -1.4797138047138025 0 0.921780303030308 -0.30643939393939656 -3.182386363636364 0 -0.06874999999999998 -0.04583333333333339 -0.39273989898989514 1.618750000000005 -0.03541666666666665 3.3979166666666667 0 -0.4418560606060633 -1.2100378787878814 -0.01041666666666674 -0.18453282828282813 19.342592592592585 0 0 -0.007272727272727764 0.13017676767676778 -0.7053240740740736 -4.683712121212118 -3.4796085858585806 -13.034217171717163 -6.672685185185189 -0.29034090909090915 2.105871212121217 1.639583333333338 -0.7702651515151515 -0.3200126262626264 -0.3770833333333333 0 -0.09004629629629868 -0.2291666666666643 0.687878787878788 0.00208333333333377 -8.774166666666666 -0.012268518518516514 0 0 1.2645202020202069 -0.5916666666666643 -0.4390782828282829 -0.4183712121212122 3.810416666666667 0 1.4295454545454502 -3.148260381593717 -0.07291666666666696 -3.7020833333333334 0.7172979797979798 -1 0.056250000000000355 -1 0 0.75 -1.1791035353535348 -0.16249999999999987 0.05625000000000002 0.01666666666666705 -1 1.217234848484853 -0.039583333333333304 -25.562163299663293 3.72960858585859 3.02348484848484 0.0625 0 0.02083333333333337 -0.3498737373737373 3.767104377104379 2.0522727272727272 -7.925416666666666 5.192234848484851 0.4530303030302987 -0.39583333333333326 1.789583333333338 -3.5708333333333333 23.327546296296298 -15.903556397306394 0.75 1.6979166666666645 0.75 0.05625000000000013 -0.31799242424242435 0.9083333333333286 -0.30972222222222223 -42.76188973063972 0.75 -0.3554924242424242 -1.049705387205385 -1.8343855218855216 0 0.7604166666666666 5.393623737373739 -0.08125000000000027 0.75 -0.29166666666666674 1.0187499999999998 0 0 0 0.75 0 0 -9.434848484848478 0 0.017234848484853238 0 0.2528409090909093 -3.700416666666667 0.05013468013468003 -1 1.1744318181818203 1.620833333333331 -0.13541666666666674 -0.045833333333333615 -0.050000000000000266 42.59950378787878 -1.2903409090909068 -1.2020833333333334 -22.592866161616165 0.6332070707070709 -5.245622895622894 -0.8585858585858539 2.4291666666666667 -0.01666666666666683 0 0.8979166666666667 0 0.9029671717171718 -31.48901515151515 5.383964646464647 -0.2041666666666666 -1.6604166666666642 -1 0.75 0 0.1452651515151515 4.92708333333334 -0.40435606060605545 -3.531586700336703 0.022916666666666474 0.75 0 -0.07916666666666683 0.14438131313131053 0.8416666666666667 -0.5412878787878787 0.018749999999999822 -0.5960227272727294 1.5701599326599354 -0.22916666666666663 1.1869739057239084 0.9621212121212124 -0.33428030303030765 0 3.693560606060613 2.9253787878787882 5.06458333333334 -22.23375420875421 -0.5714015151515152 0.32310606060606073 1.7395833333333308 -6.994760101010094 -1.7645833333333307 45.74819023569024 4.10625 2.5171085858585833 0.9568392255892297 -0.7893308080808081 -1.7458333333333311 0.75 0 2.2583333333333333 -0.37689393939393945 0 0.025340909090909136 0.2583333333333333 0.75 0 -1.8291666666666666 0 -0.6193181818181748 -0.08750000000000013 0.17499999999999982 0.08749999999999969 34.15656565656566 0 0.19999999999999996 0 -0.043749999999999956 0.5356060606060558 0.4900883838383805 3.884722222222226 5.77156986531987 0 0.04962121212121218 0 0 -2.680450336700334 0.2850378787878787 -1.5042297979797956 -1.6928409090909096 0.030744949494945106 -0.5149621212121214 0 -0.1020833333333333 -22.487499999999994 3.131755050505048 0 -0.5669191919191918 -1.6139941077441056 -2.0729166666666643 -0.3958333333333335 -9.090740740740728 0 0 -0.15208333333333335 6.165572390572397 0 -0.8736531986531983 1.4712752525252526 0.441982323232319 0 1.0294191919191917 -0.3988636363636411 0 -0.9760521885521882 0 0.9583333333333334 0.23756313131313123 3.061910774410777 0 -0.07916666666666661 -3.45625 -0.8704335016834994 2.5441708754208845 0 0 -7.2879797979798 0.050694444444444486 0.75 -3.482954545454543 20.450000000000006 -1.5383627946127945 -2.0339015151515154 -1.86875 0.023653198653203367 -0.3929924242424243 0.45189393939393496 3.2780050505050555 -31.12392676767676 -0.3485479797979798 -1.3018308080808123 0 0 0 -0.25271464646464614 0.7979166666666666 0.22916666666666652 -0.06041666666666645 0.12083333333333335 -5.73150252525252 1.1804671717171715 -2.9899831649831614 3.1183712121212097 -1.8062499999999977 0.75 -0.06458333333333344 0 0.3043560606060609 2.9597853535353558 -39.414688552188544 -0.7647937710437684 -7.906628787878785 8.807954545454535 1.103030303030303 0 -4.707112794612792 2.1392887205387234 0.8508207070707094 0.25 0 -43.783333333333324 1.378143939393937 0 1.128030303030298 -0.22499999999999998 0.014499158249156263 0 -0.039583333333333304 -1 0.006249999999999867 1.5343434343434343 1.76344696969697 3.2875 -1.870328282828282 1.0277777777777801 -0.8010942760942741 0 -4.0958333333333306 -1 -0.7546927609427585 -0.2104166666666667 -0.9348274410774415 0.8189393939393892 0.75 -1 -4.0281818181818085 -0.16041666666666665 0.790930134680141 0.46117424242424243 0.9933501683501735 0 0 -1.7647095959595958 2.5312500000000044 0 0 0 0.75 0.22302188552188174 0.5426136363636365 -0.01041666666666674 0.04375000000000706 -1.4052188552188576 0.9437499999999996 -0.3562500000000002 -1 5.4503787878787895 0.4650252525252574 -0.7895833333333333 0.22083333333333321 -0.12083333333333335 0.3603535353535352 2.62310606060606 0.022916666666674246 -2.7867424242424246 0.08124999999999982 0.7812079124579175 0.7507786195286146 -0.8247053872053849 1.7541666666666713 6.402840909090905 0 0.7663510101010101 -0.13510101010101438 0.5486742424242426 14.325168350168346 -0.6899621212121212 2.620833333333331 -39.659701178451165 0.05624999999999991 0.75 -4.279166666666665 0 -4.567697811447806 0 0.12083333333333313 0.8571969696969726 -0.5117424242424242 0.15625 0.2729166666666667 0.7111742424242424 -3.415404040404032 0.75 -4.250757575757573 0 0.75 5.320959595959596 -1 0 4.298926767676747 -1.212121212121212 -0.549452861952862 0 -0.19267676767676767 4.5723905723905744 0.8570496632996623 -0.05833333333333335 -0.5637500000000002 -0.2476641414141414 -7.429692760942752 -0.12083333333333335 0 -0.22619949494949498 0 -0.01458333333333317 -1 -2.190340909090909 -1.3640993265993224 -0.733333333333331 0.031565656565656575 0.32058080808080813 -4.449810606060602 -1.3884048821548758 0.75 1.75 0.41054292929292924 -0.029166666666666785 0.1795454545454569 27.078030303030303 2.43125 -3.19936868686869 -0.22045454545454812 0.31799242424242413 -2.3638257575757535 -4.604987373737372 -5.930029461279455 -0.7396464646464646 1.0437500000000002 -44.42285353535353 -16.324810606060606 0 -1.5134890572390551 0 0 0.17310606060606082 -0.7026515151515129 0.75 -1.8765151515151537 -1.7197601010101011 1.8289562289562311 0.75 0.5619318181818208 0 0 -30.748063973063978 38.25056818181818 -23.36567760942761 -0.9159722222222271 0.26458333333333317 -0.25277777777777777 12.191961279461289 4.97083333333334 -0.8381944444444445 -0.1910353535353535 1.2499999999999998 -0.012689393939394056 -1.6134048821548785 0.669696969696965 0.75 0.75 0.75 0 -0.36525673400673164 -2.0957070707070686 1.4971380471380522 0.643181818181813 0.15643939393939432 -6.760942760942752 2.6937499999999996 0 0 -0.34048821548821073 0.12916666666666665 -0.3485479797979798 0.75 0.75 0 1.1569444444444446 0.75 1.1489478114478135 3.3625210437710398 0 -0.26035353535353534 0.09375 0 0 0.75 0.022916666666666585 0 -0.12645202020202018 0 0 -0.06458333333333344 0.75 2.5145833333333334 -0.002083333333333437 -1.6062499999999975 1.2117424242424242 1.1511363636363687 0 0.41666666666666674 0.75 -0.06666666666666665 3.55625 4.226830808080816 0.19614898989898988 7.855155723905732 0.03125 -46.71176346801347 -0.49577020202020217 -2.3188552188552163 -1.9295454545454545 0.8395622895622943 2.4458333333333333 -0.4122895622895646 0.40909090909090906 1.5416666666666619 -0.8078282828282828 0.24791666666666679 0.75 -0.26988636363636354 -0.6625631313131313 0 0 -12.77161195286195 1.9611321548821572 6.9488846801346815 0.75 -2.4629208754208705 -1 -0.373989898989899 0 7.644760101010087 0 0.1708333333333334 2.8354166666666667 0.75 -0.21666666666666656 -2.6390151515151405 0 -0.8236531986531936 0.06363636363636371 0 -2.6187500000000004 7.7164015151515155 6.192045454545453 1.2786405723905725 0 19.685332491582486 -0.20833333333333337 0.75 0.162815656565657 -47.11666666666667 0 -1.5062499999999976 -0.8388888888888888 2.6604166666666664 0 0 0.6895833333333334 -2.4479166666666665 0.03750000000000009 1.5006734006734057 0 0 -0.008333333333333304 0.10416666666666674 -0.5297348484848463 0 -0.9443181818181794 1.8322601010101134 -2.4541666666666666 0.75 -0.29993686868686864 -0.029166666666666563 6.37291666666667 -2.1931818181818206 -0.6433080808080808 -0.02499999999999991 -2.8638257575757553 -1.4693813131313131 9.617487373737385 0 0.010416666666666519 -1.8443181818181817 0.75 1.0583333333333333 0.5598484848484874 0 -1 0 0 0.06875000000000009 -0.0854166666666667 0 9.251746632996635 -0.10397727272727275 -0.41174242424242435 -1 -0.03333333333333344 0 -0.21250000000000002 -2.0005681818181813 0.044423400673402114 -1.0033459595959573 -1.7497685185185161 0 -0.002083333333333215 2.075568181818182 -1.7937499999999975 -0.006249999999999645 -1 -11.751178451178436 0 0 7.628181818181819 -0.5827230639730592 -1.8666666666666643 -2.978409090909091 0 -0.6956439393939394 0 0.75 -2.404166666666667 0.06931818181818139 6.672530864197529 0 -0.010416666666666963 0 0 -2.990643939393939 0.20734427609427764 1.6493265993265984 0.6129629629629645 -2.1265782828282807 0.75 0 0.27215909090909074 -1.7770833333333313 -0.8288720538720489 0.03749999999999987 -1.789583333333331 0 0.6955176767676741 -3.69375 -0.5346590909090909 -0.34791666666666676 0.75 -3.0153409090909093 5.13125 -0.42354797979797976 0.75 0.75 -5.292403198653195 0.6871001683501636 0.75 0 -7.72819865319865 0 0.95625 0 0 0 0 -39.6243265993266 -4.940677609427604 -0.4230429292929293 0 -0.48710016835016634 0.11458333333333326 0.487752525252525 0 0.22727272727272751 -0.6743686868686869 -1.0816287878787854 -0.23760521885521224 1.6481818181818175 2.889478114478117 2.5183080808080778 0.6159932659932612 -1.2625 0 -1 0.75 -1.0637415824915801 +scenario heads-up gto-small +deals 3000 +seed 1592590337 +counts 15293 14 0 +samples 0.75 0.7248106060606061 0.5176136363636319 1.0909301346801392 0 1.1083333333333334 -1.3104166666666668 0 0.4481902356902405 0.18465909090909083 -0.507449494949495 -2.487436868686869 2.5344696969696967 -2.9166245791245826 2.2882575757575756 0.75 0.12020202020202087 -0.016666666666666607 0 -0.1958333333333333 -0.01325757575757569 0 -34.09469696969697 0.02500000000001279 0 0.8289772727272727 0.16665404040404086 0 3.182449494949495 0.06134259259259567 -13.252125420875425 -1.927840909090909 0.3767045454545457 5.262394781144784 0 2.770833333333333 -3.366498316498316 0 -0.7900946969696934 -1.0899621212121213 0 0.5535984848484801 -1.466074494949492 -0.23308080808080822 0.20606060606060606 0.75 -0.4368939393939395 -23.26205808080808 -0.11912878787878789 -1.9098484848484851 1.5243686868686868 0.75 0.4835227272727276 0 0 10.105303030303023 0.4605008417508438 -0.14583333333333326 0.24545454545454515 -0.02430555555555558 -1 -0.5983585858585859 0.75 0.75 3.299305555555555 -0.27500000000000013 -1.758333333333331 -0.004356060606060641 -1.5823232323232324 3.7075547138047167 1.20625 1.2541666666666669 -0.4264730639730616 0.8751893939393911 0 0 -0.4249999999999998 0.8616792929292929 0 -1.9287878787878787 0 -0.20296717171717393 -1.1150252525252529 1.987899831649833 -5.045412457912461 -0.28636363636363904 -3.892508417508423 0.016666666666666163 0.75 -2.8013257575757575 -4.160833333333334 -2.1166666666666667 -1.3627946127946124 3.993181818181818 2.2666666666666666 1.7337121212121211 0 3.5925715488215513 2.2416666666666667 2.6024621212121213 4.187121212121207 0.10416666666666674 0 0 0 -2.3712752525252525 0.22916666666666652 2.625 0 -0.4876893939393939 -1 11.218897306397317 -4.438068181818181 -3.1137626262626266 -2.4791666666666665 0.019507575757570894 -2.444128787878788 -4.198442760942757 -2.967992424242424 -0.2821969696969697 -0.15416666666666667 -1 -0.3675505050505051 -0.13750000000000007 0.75 -1.349831649831649 -0.0625 -0.15833333333333344 0 0.3368476430976406 0.9310606060606066 8.188257575757575 -0.24614898989898992 0.7405303030302981 0.9626893939393986 1.2709595959596012 3.053177609427619 0 -2.122159090909088 -0.4666666666666668 0 -0.9567550505050504 -1.2458333333333336 1.5562500000000048 12.204061447811458 2.9047348484848436 0 -2.5229166666666667 0.8040824915824907 -1 -1.1541666666666668 5.5718223905723985 16.004166666666666 0 0 0.75 0.75 -0.5868686868686868 -0.08396464646464907 2.0910984848484846 0.002083333333333437 0.661489898989899 0.185606060606061 -44.54375 0.75 4.851346801346795 -2.5 0.6092803030303031 0 -0.10833333333333328 0.34128787878788147 0 -1 0.5804924242424241 -0.18503787878787858 0 -0.5925126262626261 0.01041666666666674 0.039583333333333415 4.141666666666671 0 0 -0.5972222222222223 0.9840909090909091 2.4374999999999996 0.34185606060606055 -1.2770833333333336 -0.04791666666666661 0.12708333333333366 0.8287878787878791 9.674999999999997 0.24962121212121202 0 -2.290568181818182 -3.0640151515151537 -0.07499999999999996 0 0.015361952861954853 -1.4458333333333333 -3.6320075757575756 0 -0.9374999999999973 -0.30827020202020206 0.34185606060606055 -0.5559974747474721 0.5295454545454561 -0.35 -1.1157196969696923 0.5112373737373737 0 -6.406292087542089 2.345833333333333 -0.28630050505050497 0 -0.5208964646464647 0.018750000000000044 0.866540404040404 0.2484217171717218 0 -4.800063131313135 0 0.4492424242424242 0.75 -0.3522727272727273 0.75 -0.18541666666666679 -0.061489898989899094 0.8479797979798003 -0.08541666666666692 -18.07 -2.8866792929292933 -0.15833333333333333 -2.703787878787874 -1.1378787878787877 0 0.19204545454545463 -0.7032828282828283 0 0.75 -17.576262626262626 -1.8374999999999977 0 2.9813131313131316 0.75 0.33125000000000004 0 -0.48939393939393927 0.40625000000000466 0.75 0.75 0.75 0.8374999999999955 -0.330113636363639 0 -0.13958333333333328 0.16003787878787867 -0.017045454545454586 -0.9007575757575756 0.5759469696969697 -1 0.6061447811447763 -1.0104166666666643 1.151641414141415 0 0 0.871338383838383 2.6625 0.75 -0.01041666666666674 0 1.2325757575757574 0.75 0.12828282828283122 0 6.114709595959598 3.085122053872056 -3.6348484848484843 0.24128787878787872 -3.0403409090909093 1.0604166666666668 0 0.38882575757575744 -0.2354166666666666 -0.15227272727272723 0 -0.259848484848485 -6.078535353535352 0 -0.7871212121212121 -0.45498737373737375 -0.8681818181818177 0.29583333333333095 2.6507575757575808 0.36250000000000004 -2.1378787878787877 -1.095959595959596 -5.324179292929296 0.9693181818181813 -0.9500631313131289 0.866666666666662 -1.8091540404040458 -0.21079545454545456 5.049909090909095 -0.06875000000000009 -1.0299452861952814 1.6186447811447855 1.9612500000000002 -0.6498106060606057 0.75 0 0 0 0.32272727272727253 1.3123737373737372 1.4085648148148102 0 -2.0689393939393943 0.75 0.12083333333333335 0 -0.06458333333333344 -2.3460606060606057 -1.5812499999999976 -0.31117424242423963 40.49488636363636 -1.1619696969696922 0 -0.2825757575757577 0.399368686868687 1.0291666666666668 -0.3773358585858585 0 0.75 3.3833333333333333 -0.014583333333333393 0.75 0 -1.2668560606060604 0 1.907828282828274 -0.5890151515151514 0.1395833333333334 0.6060606060606015 0.46022727272727293 0.75 0.75 -0.35820707070706814 -0.25151515151515147 0.7343644781144829 0 0 -1.0214015151515126 -2.46875 -0.5380681818181821 2.8816077441077463 -1 0.5378787878787878 0 0.9833333333333333 0.75 0 0.36948653198653725 -2.6092171717171717 0 0.1960227272727273 1.0792297979798002 -1.3660984848484847 9.674999999999997 -0.10833333333333317 2.1204966329966277 5.685816498316497 -0.09166666666666667 0 -0.14166666666666683 -1.643118686868687 0.75 0 -0.061868686868691514 0.09375 -41.313257575757575 -0.611237373737374 0.03623737373737379 0 -4.154166666666675 -0.16799242424242689 -0.6583333333333332 -1.4625 -1.275 0.75 -6.415509259259265 1.3534722222222186 -0.7350378787878784 -1.2791666666666643 0 -2.024431818181816 -1.8312499999999976 0 0.08503787878787872 -1.2427188552188597 0.75 3.5829545454545455 2.277967171717176 -1.392361111111111 -1.874747474747475 0.033333333333333326 -2.7825000000000033 2.7548484848484858 -6.6065235690235635 0 0 0 45.77474747474748 0.02083333333333326 0.9570075757575758 -0.11041666666666661 0 -0.16249999999999998 0.75 -0.29326599326599756 0.6543560606060559 -0.030303030303030276 0.10303030303029859 0.0458333333333405 -0.6123737373737366 -0.44286616161616443 -0.15404040404040842 1.443371212121212 -2.927209595959596 -0.10416666666666663 -1.7332702020202073 1.0208333333333333 0.14545454545454595 -0.6924242424242424 -1.696590909090907 4.844549663299663 -1 -0.8890151515151512 0 5.5805555555555575 -0.05896464646464672 2.5206818181818185 0 1.0333333333333332 0.022201178451181303 -11.541022727272729 0 0.8287878787878789 0.029166666666667007 1.568939393939394 0.8583333333333332 1.1708333333333356 0.8557449494949516 2.9506313131313155 1.1854166666666666 0.7152146464646436 1.3965909090909137 5.965404040404039 -0.4263257575757575 0.35397727272727253 -1 0.8293560606060606 -0.033333333333333326 0 -2.0734848484848483 1.053367003366993 -0.020833333333340365 0.22291666666666665 0.03958333333333308 0.6926136363636364 0 0.5633207070707087 0 1.7003787878787877 0.5893939393939394 2.2229166666666664 10.165972222222223 -0.004166666666666652 0.5635101010100965 -0.125 1.5668560606060558 0.5783670033670059 -0.04562289562290012 -2.408333333333333 -9.220580808080808 1.8958333333333335 -6.9911616161616195 0 -0.049789562289559885 -0.7470328282828285 2.5916666666666597 -41.78480218855219 -0.883333333333336 5.336363636363637 -0.054166666666666696 0.23226010101010086 0 0 -0.1678661616161663 -0.20833333333333337 2.25 -0.7537878787878789 0.75 2.6416666666666666 18.329292929292933 0.012962962962967284 -0.9719696969696972 0 0.9270833333333334 1.4124999999999999 -0.11875000000000002 0 0.75 -0.16344696969697003 0.6763257575757577 -0.7922979797979797 1.48106060606061 0.07083333333333353 0 0.75 0.75 -1 0.34090909090909105 5.152588383838384 1.7687499999999978 0.16388888888888875 -2.4645833333333336 0 0 -1.9430555555555538 -4.181250000000005 -0.6851641414141458 -2.6083333333333334 0.75 -0.9935606060606057 0 3.0668560606060606 -0.12291666666666679 -0.4843434343434344 0.27746212121211844 -2.6437500000000003 0 -0.12916666666666665 0.23819444444444438 0.75 0.19374999999999987 0.9357744107744133 0.75 0 -0.26041666666666663 0 -0.419746212121213 0.9004419191919191 0.5051136363636366 0.9472222222222282 -0.0333333333333401 -1.3578409090909096 1.5152146464646459 0.1812499999999999 0.23756313131313123 0 -0.06584595959595951 0.08124999999999982 -0.5140151515151512 -0.6857954545454545 -0.99185606060606 1.2333333333333332 -2.9069444444444446 -0.035416666666666874 0.02499999999999991 -1.4354166666666643 -0.3208333333333333 5.27549242424242 0 0.23150252525252524 -0.039583333333333304 1.1470833333333332 0.09187710437710672 0.02083333333333326 0 -0.5727904040404039 -0.7729166666666667 -0.18125000000000036 0 -1.3729166666666666 0.75 -0.07708333333333339 0.75 -0.42165404040404053 0.75 0.75 0.75 -0.01041666666666663 0 -1.0263257575757576 -1.1749999999999998 -1.0661826599326671 0 0.1352441077441071 0.07291666666666652 -1 0.5886363636363656 1.5323021885521935 0 0.19374999999999987 0.75 0.75 2.9567045454545444 0 0 -0.6015782828282829 1.1863636363636412 2.8229419191919276 0.5804924242424243 0.03958333333333308 -0.531628787878788 -0.012499999999999956 2.470833333333333 -4.040088383838384 0 0.75 0 -4.059659090909091 -4.068750000000005 0.12291666666666679 -1 0.7363005050505051 -0.04583333333333339 3.8240530303030256 0.7102904040404014 -0.41635101010101017 0 -0.09665404040404058 -1.4247474747474724 1.268160774410784 0 0.10624999999999996 0 -0.5011363636363637 0 0.9653619528619606 1.23125 5.901893939393946 0 -2.5 -4.6912457912457874 0 11.882765151515155 -21.175652356902354 -1.0585227272727298 -0.3284090909090909 -0.8458333333333334 -1.9645202020202022 0 0 0.42632575757575775 -1.4712121212121188 0.14747474747474554 -0.10833333333333317 -1.1632996632996715 0 -0.16742424242424248 -0.18125000000000036 0 7.4759048821548735 -2.8027146464646466 0 -4.5684974747474705 -1 -0.05833333333333335 0 -0.018750000000000044 1.56907196969697 0 41.127272727272725 2.4458333333333333 -2.046590909090909 0.6205808080808097 0.9814393939393922 -1 -0.033333333333333326 1.19964646464646 0 0.027083333333333126 -0.6131944444444446 0 -3.3582281144781208 0.9028409090909092 0 -0.5481691919191918 0 -20.4025 0.07916666666666639 -1.2294191919191926 0.022916666666666585 0.10416666666666652 0 0.5994318181818182 8.833291245791244 0 0.19791666666666652 0.22916666666666652 3.228661616161612 -0.04791666666666661 -2.6388888888888893 -0.08655303030303019 -3.2351010101010047 0.002083333333333215 0.054166666666666696 -48.85587121212121 -0.545770202020202 0 0.41119528619528967 0.8062499999999955 -0.3682196969696965 0.5151094276094303 0.002083333333333437 -1 1.9232954545454537 -1 -1.0256944444444445 4.45215909090909 2.620000000000001 0 0.9104166666666668 3.61875 1.5693181818181863 0 0.75 1.1057449494949516 -2.334343434343432 -0.3093434343434385 -0.40549242424242427 0 0.19166666666666665 3.429882154882155 -8.813699494949494 0 -0.2020833333333334 -1.9428409090909082 -0.09375 -0.07272727272727275 0.18541666666666656 0 -0.0854166666666667 -3.390530303030303 0 -26.524537037037035 0.75 0 0 1.311216329966332 0 -0.778409090909091 0 4.34520202020202 0.5482954545454499 -1 -0.15549242424242404 0.7282196969697017 0 -0.11780303030303063 0 1.3958333333333335 -1.0212121212121212 3.993939393939393 -0.21590909090909083 -0.37424242424242427 0 -1 5.383712121212117 -3.372579966329973 0 -0.3209595959595939 1.3041666666666665 0 0 0 0.02651515151515138 -0.2767676767676752 -0.27178030303030587 0 -3.1311868686868687 -7.6775 -2.48125 0 1.1240740740740764 0 -0.16066919191919204 0 0 2.4875 -2.2210858585858557 0.44038299663300196 2.5399200336700307 0.07083333333333341 0 1.6685606060606062 0.1875 0.75 -0.08074494949495392 0.9907196969696969 -0.33674242424242906 -0.8520833333333311 -0.32354797979797967 2.540556818181823 1.2625 0.7918560606060607 0 0.6193602693602716 -2.45625 0 0.11250000000000004 -0.49227272727272986 -0.23124999999999996 0.586174242424242 0.16460437710437859 -0.382954545454548 0 0 -0.8051136363636389 0.5593013468013495 -0.30467171717171726 -0.6729166666666644 1.8602272727272724 0.9492213804713832 0.25069444444444433 1.0537878787878787 -2.4901515151515152 0.8909090909090913 1.754755892255897 -0.09166666666666679 0.03125000000000022 0 0.75 -0.14943181818181817 0.75 1.1437500000000043 0.75 -3.8270833333333334 0.7888678451178501 0 5.441931818181818 -1.93510101010101 0.2416035353535353 3.034301346801349 0 -1.0268939393939396 0.09375 -30.025883838383837 0.23156565656565675 -0.05277777777777792 0 0.11818181818181817 -2.5625 0.75 0 0.1621212121212121 0.3604166666666666 0.4556818181818183 -1.0354545454545456 -1 0 -1 1.7196969696969693 -2.1127525252525206 0 -0.18541666666666667 0.1020833333333333 -0.4544823232323214 2.6973905723905807 0.11041666666666683 0 0.941540404040404 2.5229166666666667 -0.9542297979798002 -0.20061026936027426 -1.2020833333333334 1.0785984848484849 -26.933522727272724 -1.6104166666666666 -0.3604166666666666 -1.015909090909091 0.3967171717171718 1.3587121212121214 0 1.0329545454545406 -1.7258838383838384 -0.0456439393939394 1.4690025252525247 -6.527083333333328 -1.920580808080808 2.3 -0.8814393939393965 -2.354335016835013 -0.9164772727272752 -0.5157196969696969 0 0 -1 0 -0.10000000000000009 0 -1 -0.22375841750841374 -1 -0.640088383838384 0 6.449999999999998 -1 0 0 -0.5012626262626263 -2.1780303030303036 0 -0.7452651515151514 -0.031249999999999778 2.475 0.07108585858585859 -0.18541666666666679 -0.40896464646464636 0 2.9883333333333333 0.75 1.347537878787879 13.788560606060607 -0.8789772727272727 -0.004166666666666652 2.3530303030303026 0 -1.364646464646464 -0.06875000000000009 1.3270833333333334 -2.129987373737374 -0.6073863636363637 -5.109154040404043 0.10094696969696493 -1.04375 -3.040088383838385 1.6265151515151468 -1.605660774410778 -3.0846801346801307 0.8333333333333333 0.062499999999999556 2.29375 0.016666666666666607 0.75 0.19791666666666652 0 0.03333333333333366 -1 7.291098484848477 0 -0.4566287878787879 0 0 0.01666666666666694 0.6870580808080813 0.19791666666666663 0.16632996632997088 -1 -0.3458333333333333 -1.3595328282828305 0.75 0.75 2.963341750841753 -0.26250000000000007 -0.6933712121212121 -0.3977272727272727 -0.39412878787879246 0 -1 0.8999999999999999 5.8597222222222225 -1.183985690235691 -3.4305555555555554 0.044570707070707094 2.522979797979798 -0.6573863636363662 -0.11130050505050526 -1.1492424242424244 0 0.9066287878787881 -0.0520833333333337 -0.15416666666666667 -0.3333333333333359 0.8148358585858584 -0.8044823232323233 2.550189393939399 0.3496212121212121 11.135921717171717 -1.1668981481481504 0.008333333333333304 3.880050505050505 0.9452441077441034 0 0.8502525252525253 0 0.22840909090909056 2.7416666666666667 0.03750000000000009 0 -0.5130681818181844 0.5280303030303031 -1.1532196969696973 3.146590909090909 0 -2.595833333333333 0 0.6306818181818201 -5.568392255892256 0 0 -0.1645833333333333 0.75 0.06458333333333321 -13.15669191919192 0 0 0.75 0 -2.520833333333333 -0.08124999999999982 0 -11.400252525252526 0.75 -1.2964015151515165 0.75 -0.2440025252525253 -0.8102483164983116 2.858712121212122 -3.2833333333333288 -0.09583333333333321 0 -0.29324494949494984 1.936216329966328 0.75 0.75 -0.957007575757576 1.5813341750841776 30.904507575757577 -0.052041245791250246 0.05429292929292928 0 3.478451178451187 0 0 -1.539646464646465 0.6571969696969697 4.082386363636366 -0.3964015151515152 -0.17708333333333337 -0.13750000000000007 0.75 -17.727147727272722 1.5883838383838378 0 -1.4854166666666666 0.75 -1.1989898989898975 -2.0926136363636365 -0.44800084175084653 0.09078282828282846 0.75 0.7092803030302981 -0.13750000000000007 0 0.48223905723906224 0 2.552083333333333 0.20833333333333326 1.7905303030303084 0.15500000000000014 1.2571338383838433 0.8895833333333334 0 -3.068939393939394 5.143939393939389 0.06458333333333321 0.8174242424242424 1.3333122895622918 -2.532638888888889 -0.014583333333333393 0.06875000000000009 0.75 -0.9356060606060606 0 0.02083333333333326 -1.8077651515151516 3.735732323232323 -1 0.10473484848484382 0.30505050505050535 0 -3.4243686868686867 10.594368686868682 0.75 0.509090909090909 2.545643939393939 -1 -9.746022727272727 4.41375 0 -0.03333333333333299 0 0.75 0.32758838383838396 -0.5641414141414134 -0.6895833333333334 -0.9926136363636364 -1.06875 0.7437499999999955 8.056755050505052 1.2270833333333333 0.006250000000000089 0.75 0.7643518518518542 -0.07916666666666661 -0.8772306397306422 -0.24743265993266306 -1.506712962962957 3.8230639730639706 0 1.4572348484848532 -0.05625000000000002 1.054734848484848 -0.08124999999999982 0 -2.507386363636363 -1.2042803030303033 11.248547979797983 0.7075757575757575 0.36109006734006543 -0.027083333333333126 0.5200757575757575 -0.2416666666666667 0 -1 -1 0 0.3555765993266016 -0.014330808080808222 5.005113636363636 5.217487373737373 3.87102272727273 0 -1.0009090909090905 0 3.726031144781147 3.656249999999995 -4.433522727272727 0 -0.21226851851852313 0.6992424242424242 0.7666877104377128 0.6628787878787907 -25.88823653198653 0 0 -0.014583333333332948 0.41799242424242444 0.876830808080808 -0.9543560606060606 0 1.7175757575757546 0.125 -0.039583333333333526 2.781144781144781 -1.0592803030303028 -0.002272727272727204 0.7077651515151517 -0.40946969696969693 5.113131313131312 0.38710016835016825 -1.4113005050505003 -3.0356060606060606 0.027083333333333348 -0.2945075757575808 16.065656565656553 0 0.5043981481481526 0.75 1.2101641414141415 -30.330618686868682 0.75 -2.3625000000000003 -0.2753998316498365 0 0.8054924242424268 0 0.75 0.75 -0.47411616161616166 0.9722853535353537 -10.561658249158233 0 0.18295454545454515 -0.6943181818181816 0.016161616161616044 3.050189393939387 2.4812499999999997 -0.6052609427609394 0.682828282828283 -0.2020833333333334 -0.02367424242424243 -2.1375 0.7945075757575757 0.04791666666666661 10.04854166666667 -0.990340909090909 0.75 0 0 -0.584659090909091 0 -4.214583333333334 0 -0.02083333333333348 0 -0.002083333333333326 -2.5083333333333333 0 0.75 -0.8700757575757574 6.494276094276093 3.2380681818181842 0.09166666666666656 0.8895833333333334 -1.6282828282828261 -34.960669191919195 1.1251893939393836 -0.27619949494949503 0.058333333333333126 0 -1.0683080808080807 0.7020833333333333 0 0.2991498316498329 -23.946696127946137 6.921534090909095 0.75 0 0 0.40984848484848513 -2.2357575757575807 0 0 0.6075336700336729 0.6467803030302983 -0.34791666666666665 0.75 0.5921296296296323 -0.6452651515151515 2.4145833333333337 8.314772727272727 0 1.159583333333333 -0.540909090909095 -1.1257575757575708 0 0.75 0 0.7402777777777778 0.48958333333333337 0.8770833333333333 1.2113636363636366 -1 2.279292929292934 0.4566287878787878 -0.07083333333333308 0.10625000000000007 -2.4187499999999997 0.04583333333333317 1.4198232323232325 0 -1.1458333333333335 -0.5147727272727272 0.008333333333333304 4.459191919191916 3.1788720538720563 -0.5162878787878786 1.7044823232323232 0 0 0 0.8378156565656565 0.75 -1.2876893939393914 0.002083333333333437 0 3.5840488215488304 1.7900378787878786 2.7756944444444387 -0.3107954545454521 -0.3861742424242447 -33.833333333333336 -7.192386363636364 -1.3537878787878788 2.4170454545454567 -2.014141414141414 0.75 -0.24116161616161613 -1 -0.37916666666666665 2.858249158249155 -2.304229797979798 0 4.142992424242419 -0.3645833333333335 -14.770601851851847 0.42026515151515653 -1.3865782828282849 1.2810606060606045 0.75 -0.19166666666666687 2.762058080808081 -0.01666666666666683 0 -0.769255050505051 2.150946969696974 0.12708333333333321 -9.42114898989899 -0.44905303030303023 -0.13749999999999996 -2.4833333333333334 0 -3.29375 -2.470833333333333 -0.9841540404040403 -1.0721380471380466 0 -0.3916666666666666 -0.3145833333333333 -4.089330808080808 3.932260101010103 -0.20833333333333337 0.8032196969696921 2.6912457912457937 0 3.0317760942760965 0.48390151515152 0.19981060606060863 1.8452651515151537 0 0 0.6471590909090907 0 0 -0.16249999999999998 0 -0.3267045454545454 1.40625 0.75 0.75 -0.4869318181818183 1.1437500000000003 13.209343434343435 -0.17499999999999993 -1.2645833333333334 6.37941919191919 0.029545454545454652 -1.6690446127946155 -0.7270833333333309 1.6941287878787878 -2.6033459595959623 -0.15833333333333333 0.9860479797979773 -0.7121212121212122 -0.08125000000000004 0.75 0 0 0.75 -0.48844696969697 2.3577651515151583 0.75 2.497032828282828 8.276515151515152 0.9335227272727225 -2.5958964646464646 0.75 0 0 0.75 0.34166666666666656 0 -0.6354166666666643 -0.12291666666666656 -10.29659090909091 0.24375000000000002 -4.961616161616162 -0.02499999999999991 2.5090909090909093 0.31136363636363185 0.6297348484848488 -0.08958333333333335 0 -0.31578282828282855 0.38295454545454544 2.3439814814814754 -0.010416666666666519 -0.34242424242424496 0 -1.334890572390572 -1 -1.2333333333333334 1.585606060606061 3.0161616161616163 0 0.3410353535353483 0.8812499999999999 -1.0210227272727253 0.039583333333333304 0.06874999999999987 -1.580429292929293 -0.9076388888888887 -0.1875 0.04583333333333339 0.06041666666666645 -1 44.79969696969697 1.3875000000000002 0 2.930808080808083 0.04583333333333339 -0.03661616161616166 0.9397937710437709 0 0.31811868686868694 -10.251886363636364 -0.12628367003367114 0 -5.993143939393946 0 9.674999999999997 0.75 0.26041666666666674 0 1.0353114478114431 0.008333333333333415 0.75 1.0794191919191876 -1 8.656018518518518 0.0416666666666663 0.9554924242424196 1.6795454545454547 -0.09375 3.7366161616161597 0 -0.15486111111111112 -0.014583333333333393 0.07499999999999984 0.9941287878787879 0.5482954545454546 0 -0.03750000000000009 0.75 -0.8486742424242424 7.236553030303019 1.455765993265996 -2.3210858585858576 -0.7468434343434343 5.837920875420878 -2.153219696969697 -8.37354797979798 0.75 -0.12708333333333333 -0.8950757575757551 -0.27563131313131306 0 -0.01041666666666674 1.84229797979798 2.014772727272727 3.4066708754208754 -2.233207070707069 10.317382154882164 1.1347432659932684 0 -0.03632154882154626 0.9924452861952886 -6.43093434343434 12.57196969696969 -1.0316919191919145 0 -0.9506313131313129 0 -0.08345959595960095 1.0981060606060655 1.257870370370373 4.380871212121212 0.2604166666666665 0.75 0 -0.43421717171717156 -31.24431818181818 -0.054166666666666474 -1.7886994949494928 2.6378787878787877 -1.5149621212121187 -0.2492424242424245 0 0 -0.4369318181818207 0.75 -0.16041666666666665 3.3625 0 0 0.027083333333326243 0.75 -0.039583333333333304 -1.4306818181818208 -0.12916666666666665 0 0.18958333333333344 0.85075757575758 0.75 -0.4617424242424242 0 0.5914772727272726 1.7607954545454545 -1.4878787878787856 0 -0.44671717171717473 0 0 0 1.6285984848484802 0.04583333333332629 -0.40536616161616346 0 -1.927967171717172 0 -1.3594696969696973 0 -1 -1.1355639730639755 2.225757575757571 0 1.83125 0.2272727272727273 0.4979166666666667 0 -0.41460437710437503 -2.441961279461282 1.5826388888888858 0 1.2 0 -0.1369318181818202 1.4527146464646483 0 -0.030681818181818254 0 -0.3566287878787878 -0.5658459595959595 0.75 0 0.9666666666666668 -0.03541666666666643 -0.8643939393939419 -0.21561447811448264 -0.15416666666666679 0 0 0.03124999999999989 13.090227272727274 0.11685606060606046 0.004166666666666541 0 1.3333333333333335 0.10416666666666674 -0.06041666666666634 -0.23945707070706757 -0.30827020202020206 0.6765782828282778 0.2785227272727271 -0.20170454545454808 0.7782828282828282 -16.131477272727274 0.75 -1.0539015151515156 -1.825631313131313 1.13125 -0.1596590909090908 1.2797348484848485 0 0.7315025252525252 0.006249999999999978 0.8229166666666661 -0.002083333333333215 -0.24924242424242427 -0.0043139730639703 0.6687500000000001 0.3998106060606017 -0.7176136363636367 0.23766835016835208 -0.47791666666666677 0.4722727272727285 0.4128787878787836 -0.3378787878787881 -0.8227272727272728 -0.5944654882154858 -9.693792087542084 -0.060416666666666785 -0.6984848484848487 0.16628787878787876 0.156060606060606 0 0.75 -1.589583333333331 0.5562499999999999 -4.189263468013472 3.1615951178451196 1.3191287878787827 -0.4486742424242425 0.2316919191919189 0.8102904040404041 0 3.9645833333333336 -0.5663510101010099 -1 -1.8448863636363635 -0.1708333333333334 -13.705265151515155 -0.38901515151515154 0 0 4.950000000000008 0.8712752525252526 0 -1.7142045454545454 -0.07708333333333339 0 -0.8037668350168399 -1.5949705387205313 -0.033333333333333215 -1.6053872053872063 -0.12291666666666679 -0.050000000000000266 1.428977272727268 -0.42708333333333337 1.2520833333333334 0.6548611111111113 -0.8782196969696967 -0.877209595959596 -0.1791666666666667 -1 -0.7074284511784561 5.3456818181818155 0.12083333333333313 0.8291666666666666 -5.866414141414142 -0.01458333333333317 -1.9536363636363634 -0.8456818181818184 0.22916666666666663 0 0 0.2416666666666667 0 1.4359217171717171 -0.266540404040404 -3.343939393939396 -36.34547558922559 -3.647011784511785 -0.08983585858585852 0 0.11994949494949503 0.012500000000000178 0 -2.5270833333333336 0.3185606060606059 0 -1.777083333333331 3.4653409090909095 0.04791666666666683 -0.08333333333333348 0.75 11.402272727272727 0 -0.10625000000000018 0.2687499999999998 -1.2854166666666669 0 -1.0599747474747474 18.480050505050496 0 0 1.509617003367008 -0.2617424242424242 2.783333333333333 1.2895833333333333 0.8623737373737419 6.435227272727275 0 9.796569865319874 1.0625000000000004 0 -0.060416666666666785 -0.05208333333333337 -1.1149621212121212 -0.6744318181818183 0.552840909090909 0.041098484848484995 -1.1021464646464645 -1.3343434343434342 -0.26079545454545716 0.03333333333333344 -0.38844696969696924 0.5865530303030302 0.75 0.5574705387205303 -2.435416666666667 0.30435606060606046 1.08125 0 0 0.48996212121212124 1.7109217171717168 0.5513257575757575 0.04999999999999316 -0.42929292929292817 1.5109006734006778 -2.5708333333333337 -15.774663299663302 0.07708333333333339 -5.699621212121213 0 0.6287878787878742 0.4602904040404041 1.903156565656559 -1.41875 9.102504208754215 0.75 -0.28674242424242413 0.2850378787878787 0.0708333333333333 -0.06041666666666701 4.120475589225592 -40.178261784511776 0.33030303030303054 -4.648106060606061 0.75 -0.15833333333333333 -0.35989057239056477 0.8280303030303038 -1 -4.513257575757578 0.9270833333333333 1.8774200336700329 0.75 -0.2979166666666667 -0.15833333333333333 -0.8604166666666666 -1 -0.18958333333333333 -7.615298821548826 0 0.36250000000000004 45.87859848484848 0.4726010101010101 0.75 2.0178872053872077 0.75 -0.01041666666666674 0.922260101010103 0.6765782828282829 0 1.3458333333333334 0.75 0.23655303030303032 -3.6236111111111025 -0.9541666666666666 0.018750000000000266 0 23.54332912457913 1.0823021885521906 0 0.2556818181818161 -0.5778409090909116 0.8270202020202047 0 -5.701388888888884 0 -0.125 0.022916666666666696 -0.24905303030303028 0 0.756464646464647 0.03541666666666654 1.46875 -0.5621212121212122 0 0.75 -1.2020833333333332 -2.53125 -0.22178030303030305 0 3.941477272727275 -0.04583333333333317 -0.7761994949494953 1.5619739057239164 -6.296064814814816 0.4900042087542067 -1 0 -0.20833333333333337 -1.2686868686868684 -1.8791666666666642 5.654250841750841 -0.5092171717171716 -0.029166666666666674 -0.02499999999999991 -0.0854166666666667 -0.2833333333333332 0 0 -2.1049242424242425 0.75 0 4.019128787878783 -0.9114267676767678 0.1573863636363635 -1.8471590909090907 -0.43162878787879033 1.2683712121212174 -0.9343013468013468 -0.38497474747474736 0.75 -1.8694444444444445 -0.1499999999999999 0 0.5368265993266015 0 -0.3241792929292928 0 -0.04602272727272716 0.2020833333333334 0.8553030303030303 -2.962563131313126 -0.15833333333333344 -0.03926767676767651 -0.7062710437710462 0.5306818181818136 -0.9182449494949494 2.998068181818182 -1.1733585858585904 -1.3999999999999977 -1 -4.013699494949495 -2.917361111111111 0.34791666666666665 0.30541666666666667 -0.09791666666666643 -0.016666666666666385 0 1.4708333333333332 -4.8104166666666694 0.08181818181818179 -0.3291666666666667 0 -0.016666666666666607 -2.1604166666666758 -0.12916666666666665 0.05208333333333326 0.31458333333333344 -2.141919191919192 1.4603030303030358 -0.771590909090909 0 0.18295454545454537 -0.4429713804713802 -3.499936868686868 1.7592803030302981 -0.025000000000000022 0.75 3.6416245791245765 0 -1 1.6426767676767702 -0.6066287878787879 -4.597916666666669 -0.06666666666666643 0.23950757575757575 1.1783249158249107 0.75 -1 0 0.6405934343434344 -1.6666666666666643 -1.6722222222222247 6.183543771043765 -0.4096590909090909 -0.045833333333333615 -0.05000000000000693 0.34374999999999556 0 1.2304924242424242 0.3857323232323233 -5.0833964646464604 -0.29595959595959587 0 0.75 0.028093434343434254 0.75 2.6208333333333256 0 0.8445075757575756 5.869204545454545 0 -0.13970959595959842 3.44640151515151 -2.2575757575757556 -0.11628787878787694 -0.6270833333333354 0.75 -0.19583333333333308 2.288446969696972 0.08958333333333324 -2.1265782828282833 19.413825757575758 4.791603535353535 0.8520833333333333 0.17668350168350422 0 1.1917929292929295 -2.8178661616161618 2.4899831649831676 -0.7178030303030303 -1.0055555555555535 4.988636363636363 -0.15477272727272773 -1.2648989898989895 2.2255050505050527 -0.1479166666666667 2.806708754208752 1.0768939393939394 0 0.6057449494949494 -0.07083333333333353 -2.8438131313131314 -4.223505892255888 -0.14482323232323235 -0.00416666666666643 2.425904882154885 -0.11874999999999991 0.012499999999999956 0.05833333333333335 -1.6562499999999976 -0.8910353535353532 1.5712121212121213 -5.798947811447802 0.9748863636363636 0.37916666666666665 0.7102272727272727 -1.1738005050505054 1.5791666666666715 0.49981060606060557 1.6255681818181817 -0.21887626262626259 0.75 0 -5.03364898989899 -1.6124999999999976 0.3193181818181867 0.75 0 1.401094276094271 1.1344696969696966 -0.031249999999999778 0 3.9333333333333336 -1.0812499999999998 0 0 -0.4075126262626245 0.751136363636359 -1 0 2.152083333333338 0.6041666666666694 -0.8688762626262629 0.873611111111111 0.5123106060606106 0.5535984848484816 -0.5979166666666667 1.4708333333333334 -16.166666666666668 -2.520833333333333 -0.15416666666666667 0 -1.7395833333333308 -1.7824494949494951 0 49.09791666666667 1.3 0.8051136363636313 0 0.75 1.0579545454545407 -2.5229166666666667 -0.006250000000000089 0.7113636363636315 0 3.4901515151515103 -1.415404040404041 -1.7416666666666643 0 -39.33013468013468 -0.2714225589225583 0 -8.889772727272724 -0.5266835016835061 0.9720959595959544 -1.0282617845117878 -0.44507575757575757 1.8971590909090894 6.145370370370369 9.935101010101016 0.2603535353535351 0.2910984848484848 0.2662878787878785 0.1312500000000001 0 -0.40126262626262443 -1.862916666666667 -0.1791666666666667 0.75 -0.6606060606060609 0.09166666666666701 -0.5855429292929293 2.1083333333333334 -3.514267676767677 0 0 0.60625 -0.20435606060606082 0 0 0.8775252525252526 1.2875 -0.17140151515151514 0.18333333333333335 -9.549255050505046 -2.5541666666666663 -2.4020833333333336 0 -2.1563762626262597 2.9387836700336725 -0.23371212121212115 12.133796296296293 -2.009659090909091 0.8729166666666667 0.04198232323232309 4.954654882154877 0.7606060606060605 -1.7645833333333307 -0.23068181818181843 2.9411616161616183 -0.4617424242424243 1.3825968013468062 0.6145833333333304 0 0.094949494949495 2.954819023569026 2.803282828282829 0.024999999999992584 3.1419612794612815 0.8708333333333333 0 -0.015277777777777835 0 2.3666666666666667 -2.5395833333333333 -1.914583333333331 -0.45587121212121207 0.12897727272727244 -0.6285984848484849 -0.9001893939393939 -0.06262626262626747 0.07291666666666663 -1.0770833333333332 3.6070707070707093 -0.05625000000000002 -0.14374999999999993 0.07916666666666572 -1.268939393939392 -0.8840909090909093 -2.310416666666667 -0.35890151515151514 0.138131313131313 0.39469696969696955 -0.3394570707070683 2.376578282828283 -0.1812499999999999 2.625803030303029 -2.5541666666666667 -2.2354166666666666 0 -0.5776515151515103 -0.1499999999999999 0 7.401641414141402 0.5924242424242423 -0.28125 0.6673611111111112 0.9242424242424241 -2.4556818181818185 -0.29008838383838387 0.7956439393939347 0.060416666666666785 0.23718434343434358 -0.9916666666666645 -1.2529040404040401 0 0 0 -3.7884469696969694 0.75 -1 0.8096590909090908 -0.37462121212121224 -0.17708333333333337 11.313181818181818 0.383080808080803 -0.035416666666673535 0.002083333333333215 0 1.2354166666666666 2.0358585858585823 -2.043371212121212 -0.4486742424242449 -2.4375 -0.24135101010101023 0.3222853535353538 0.7509469696969651 -0.006250000000000089 0 -6.027735690235685 0 0 1.219949494949495 -0.044128787878788156 -0.3700757575757603 -1.4333333333333333 -1.7937499999999975 1.2524621212121168 -0.00410353535353547 -1.1331439393939393 0 12.527209595959597 -1.7059343434343432 0 -0.90549242424242 3.0770833333333334 0.75 0.75 0.8340909090909092 0.75 0.08749999999999991 0 -0.4117424242424219 0 0.05625000000000002 2.438257575757569 -0.1333333333333333 1.0125000000000002 0.32619949494949974 -0.9777567340067288 0.7087121212121211 -2.492676767676768 0 0 0.849242424242429 0 0 0.050000000000000044 -3.491161616161617 -0.15833333333333333 0 -2.5618055555555554 -0.2791666666666667 -0.4148358585858586 0.75 0.0013678451178427142 -0.14166666666666683 -0.645833333333331 0 -0.10000000000000009 -8.35375 -1.1657196969696968 -36.834722222222226 -1 0.06357323232323209 -0.1721590909090911 0 -0.33200757575757567 0 2.4020833333333336 0.7333333333333334 -1.6109848484848484 -2.4833333333333334 -1 0.38573232323232265 0.15625 0.3907196969696968 -1 4.5462121212121165 0 0 -45.01670875420876 -0.2660353535353508 0.08749999999999969 0.38005050505050497 -0.5643939393939392 -5.511616161616167 -2.5083333333333337 1.2125000000000001 -1 -0.1687500000000004 -0.6890151515151519 3.192647306397304 0 -1.7958333333333307 0 -0.29520202020202024 -0.23181818181818636 1.0817129629629627 2.878661616161616 -1 -0.6861742424242427 0.2653409090909087 0.027083333333333348 -2.067613636363634 -0.07916666666666683 -2.8797979797979796 1.4356060606060561 0 0.30000000000000004 0 0.75 -0.07916666666666661 0.2475378787878788 -0.08124999999999982 0.4689393939393893 -0.06874999999999998 -2.2685816498316544 -1 0 -3.742550505050505 0.6479166666666667 0.5587121212121267 0.34198232323232336 0 0 0.2522727272727241 -1.2875 2.0663089225589193 -2.9169823232323235 0 1.223295454545459 -0.4755892255892231 0.8006313131313183 12.81679292929293 0.0699494949494951 -1 0 0.043749999999999956 -0.5513888888888889 -3.05719696969697 0 -1 -2.3532954545454547 -1.3559343434343436 -1.8601851851851858 -1.2724747474747475 0.3292045454545449 0.8370580808080827 -1.495833333333331 0.2833333333333332 -0.5556186868686867 0 -0.6606060606060606 -0.29261363636363424 0 0.125 0.23743686868686853 0 0 2.2333333333333334 0.4684343434343434 0 -0.15208333333333335 0 -4.850000000000002 3.924999999999997 0.015340909090909127 0 0.75 -1.4166666666666643 -1.0616792929292929 0 2.812499999999997 0.75 -6.978156565656565 -1.8890151515151512 0.5021464646464648 0 -0.6665404040404039 -1.789583333333331 0 -0.11458333333333348 -23.524116161616163 -0.2751893939393939 0.013194444444444398 0 0 0.7895833333333334 0 0 0 -0.09375 -28.477651515151514 -3.9986742424242454 0.7104166666666667 0.5715277777777796 -1.021590909090909 -0.20654461279461556 -1.111868686868687 0 0.921780303030308 -0.30643939393939656 -3.182386363636364 0 -0.06874999999999998 -0.04583333333333339 -0.3876893939393964 1.618750000000005 -0.03541666666666665 3.3979166666666667 0 -0.4418560606060633 -0.6039772727272776 -0.42708333333333104 -0.18453282828282813 19.342592592592585 0 0 0.2932323232323242 0.13017676767676778 -0.7053240740740736 -4.153409090909091 -2.1664772727272728 -13.034217171717163 -4.012079124579129 0.03541666666666665 0.8937499999999998 1.639583333333338 -0.7702651515151515 -0.3200126262626264 -0.3770833333333333 0 -0.09004629629629868 -0.2291666666666643 0.687878787878788 -0.7933712121212115 -8.774166666666666 -0.012268518518516514 0 0 0.7973484848484849 -0.5916666666666643 -0.4390782828282829 -0.4183712121212122 3.810416666666667 0 1.4295454545454502 -1.956481481481477 -0.07291666666666696 -3.7020833333333334 0.7172979797979798 -1 0.2363846801346825 -1 0 0.75 -1.1791035353535348 -1.1624999999999999 0.05625000000000002 0.01666666666666705 -1 0.9426136363636366 -0.039583333333333304 -22.02512626262626 3.72960858585859 3.02348484848484 0.0625 0 0.02083333333333337 -0.3498737373737373 3.4455555555555515 2.0522727272727272 -7.925416666666666 4.121527777777782 0.4530303030302987 -0.39583333333333326 0.12291666666666656 -3.5708333333333333 17.734111952861955 -2.0474957912457916 0.75 0.33175505050505083 0.75 0.05625000000000013 -0.31799242424242435 0.9083333333333286 -0.30972222222222223 -42.76188973063972 0.75 -0.3554924242424242 -3.220580808080808 -1.8343855218855216 0 0.7604166666666666 5.393623737373739 -0.08125000000000027 0.75 -0.29166666666666674 1.0187499999999998 0 0 0 0.75 0 0 -8.098989898989899 0 -0.3615530303030301 0 0.2528409090909093 -2.950416666666667 0.8157070707070675 -1 1.1744318181818203 -0.42420033670033463 -0.13541666666666674 -0.045833333333333615 -0.050000000000000266 42.59950378787878 -1.2903409090909068 -1.2020833333333334 -19.137058080808078 0.6332070707070709 0.4366161616161617 -0.8585858585858539 2.4291666666666667 -1.147979797979798 0 0.8979166666666667 0 0.9029671717171718 -31.48901515151515 5.383964646464647 -0.2041666666666666 -1.24375 -1 0.75 0 0.1452651515151515 4.92708333333334 -0.40435606060605545 -2.8371422558922608 0.022916666666666474 0.75 0 -0.07916666666666683 0.14438131313131053 0.8416666666666667 -1.3859848484848483 0.018749999999999822 -0.27405303030303485 0.007028619528623992 -0.22916666666666663 0.96054292929293 0.9621212121212124 -0.33428030303030765 0 3.693560606060613 2.9253787878787882 5.06458333333334 -18.76153198653199 -0.620643939393942 0.32310606060606073 1.7395833333333308 -4.893750000000001 -1.7645833333333307 46.27849326599326 4.10625 2.5171085858585833 0.9568392255892297 -0.18958333333333338 -1.7458333333333311 0.75 0 2.2583333333333333 -0.9981060606060606 0 0.025340909090909136 0.2583333333333333 0.75 0 -1.8291666666666666 0 -0.9071969696969673 -0.08750000000000013 0.17499999999999982 0.08749999999999969 35.63762626262626 0 0.19999999999999996 0 -0.043749999999999956 0.5356060606060558 0.4900883838383805 -2.0925505050505073 5.388573232323228 0 0.04962121212121218 0 0 -2.4106691919191916 0.2850378787878787 -1.2024621212121214 -1.6928409090909096 0.030744949494945106 -0.5149621212121214 0 -0.1020833333333333 -18.7375 2.5677819865319886 0 -0.5669191919191918 -1.2057449494949497 -2.0729166666666643 -0.3958333333333335 -3.398821548821547 0 0 -0.15208333333333335 5.0948653198653275 0 -0.8736531986531983 1.4712752525252526 0.441982323232319 0 1.0294191919191917 -0.3988636363636411 0 -0.9760521885521882 0 0.9583333333333334 0.20094696969696968 3.061910774410777 0 -0.07916666666666661 -3.45625 -0.6616792929292932 2.2874368686868647 0 0 -5.962222222222223 0.050694444444444486 0.75 -5.975378787878785 17.454629629629633 -1.5383627946127945 0.5797348484848481 -1.86875 -0.1535353535353512 -0.3929924242424243 0.45189393939393496 3.6290151515151523 -22.096148989898992 -1.1465277777777778 -1.3018308080808123 0 0 0 -0.25271464646464614 0.7979166666666666 0.22916666666666652 -0.06041666666666645 0.12083333333333335 -3.9543560606060604 0.14006313131313108 -2.383080808080806 2.7017045454545454 -1.8062499999999977 0.75 -1.072159090909091 0 0.3043560606060609 2.9597853535353558 -39.944991582491575 -0.5720328282828282 -5.065719696969698 7.860984848484844 1.103030303030303 0 -3.8316919191919188 1.2697601010101014 0.8508207070707094 0.25 0 -43.783333333333324 1.378143939393937 0 1.128030303030298 -0.22499999999999998 0.014499158249156263 0 0.3442550505050481 -1 0.006249999999999867 1.5343434343434343 1.76344696969697 3.2875 -1.870328282828282 1.0277777777777801 -0.6070707070707071 0 -4.0958333333333306 -1 -1.585921717171717 -0.2104166666666667 -0.6124368686868715 0.8189393939393892 0.75 -1 -1.0145454545454449 -0.16041666666666665 0.958438552188557 -0.8645833333333308 0.6835858585858585 0 0 -1.7647095959595958 2.5312500000000044 0 0 0 0.75 0.22302188552188174 0.5426136363636365 -0.01041666666666674 0.46041666666667136 -1.4052188552188576 0.9437499999999996 -0.3562500000000002 -1 5.4503787878787895 0.4650252525252574 2.5437499999999953 0.22083333333333321 -0.12083333333333335 0.3603535353535352 0.2534090909090909 1.2493476430976447 0.054166666666666474 -2.41875 0.5947601010101012 0.7507786195286146 -0.5612373737373737 1.7541666666666713 5.1856691919191915 0 0.7663510101010101 -0.13510101010101438 0.5486742424242426 5.7287878787878785 -0.6899621212121212 2.2041666666666666 -39.659701178451165 0.05624999999999991 0.75 -4.279166666666665 0 -3.069381313131313 0 0.12083333333333313 0.8571969696969726 -0.5117424242424242 0.15625 0.2729166666666667 0.7111742424242424 -1.9520202020201998 0.75 -3.815151515151515 0 0.75 4.993939393939389 -1 0 -2.102588383838402 -0.00000000000000005551115123125783 -0.3268097643097647 0 -0.19267676767676767 4.5723905723905744 2.3179082491582506 -1.2174242424242425 -0.5637500000000002 -0.2476641414141414 -7.429692760942752 -0.12083333333333335 0 -0.22619949494949498 0 -0.8100378787878786 -1 -2.190340909090909 -1.0627525252525232 -0.733333333333331 0.031565656565656575 0.32058080808080813 -3.8437499999999973 -0.37998737373737335 0.75 1.75 0.41054292929292924 -0.029166666666666785 0.06590909090909092 27.078030303030303 2.43125 -3.19936868686869 -0.22045454545454812 0.31799242424242413 -1.8979166666666645 -4.128977272727273 -4.576073232323232 -4.468181818181819 1.0437500000000002 -44.3875 -16.324810606060606 0 -1.1065025252525253 0 0 0.17310606060606082 -0.5321969696969697 0.75 -1.4598484848484894 -1.7197601010101011 1.8289562289562311 0.75 0.5619318181818208 0 0 -36.72028619528619 38.50688131313131 -19.89345538720539 -0.9159722222222271 0.26458333333333317 -0.25277777777777777 10.421338383838382 3.9758838383838455 -0.8381944444444445 -0.1910353535353535 1.2499999999999998 -0.012689393939394056 -1.6134048821548785 0.669696969696965 0.75 0.75 0.75 0 -2.64135101010101 -1.8280303030303031 0.45673400673401177 0.643181818181813 0.15643939393939432 -4.30429292929292 2.6937499999999996 0 0 -0.02819865319865089 0.12916666666666665 -0.3485479797979798 0.75 0.75 0 1.1569444444444446 0.75 1.1489478114478135 1.7488846801346778 0 -0.26035353535353534 0.09375 0 0 0.75 0.022916666666666585 0 -0.12645202020202018 0 0 -0.06458333333333344 0.75 2.5145833333333334 -0.002083333333333437 -1.1895833333333332 1.2117424242424242 -0.04583333333333339 0 0.41666666666666674 0.75 -0.06666666666666665 3.55625 4.226830808080816 0.19614898989898988 7.404819023569028 0.03125 -46.790046296296296 -0.49577020202020217 -2.783080808080808 1.8053030303030282 0.6421717171717172 2.4458333333333333 -0.11262626262626707 0.40909090909090906 1.5416666666666619 -0.8255050505050505 0.24791666666666679 0.75 -0.26988636363636354 -0.6625631313131313 0 0 -13.537605218855212 1.9611321548821572 6.9488846801346815 0.75 -1.6001262626262627 -1 -0.373989898989899 0 4.191898148148143 0 -0.7382575757575758 2.8354166666666667 0.75 -0.21666666666666656 -1.1928872053872004 0 -0.8236531986531936 0.06363636363636371 0 -2.6187500000000004 6.79594696969697 6.192045454545453 1.2786405723905725 0 16.822117003367 -0.20833333333333337 0.75 0.162815656565657 -47.11666666666667 0 -1.0895833333333333 2.341666666666667 2.6604166666666664 0 0 0.6895833333333334 -2.4479166666666665 0.03750000000000009 -7.092760942760937 0 0 -0.008333333333333304 0.10416666666666674 -0.15094696969696964 0 -0.614772727272727 2.4101220538720645 -2.4541666666666666 0.75 -0.29993686868686864 -0.029166666666666563 5.283270202020203 -2.1931818181818206 -0.5170454545454546 -0.02499999999999991 -2.6365530303030305 -0.6385732323232349 4.800568181818182 0 0.010416666666666519 -1.8443181818181817 0.75 1.0583333333333333 0.5598484848484874 0 -1 0 0 0.06875000000000009 -0.0854166666666667 0 10.179776936026933 -0.10397727272727275 -0.41174242424242435 -1 -0.03333333333333344 0 -0.21250000000000002 -2.0005681818181813 0.27169612794612696 -0.687689393939394 -3.4307449494949496 0 -0.002083333333333215 2.075568181818182 -1.7937499999999975 -1.200694444444442 -1 -6.355555555555551 0 0 7.628181818181819 -0.018750000000000044 -1.8666666666666643 -2.978409090909091 0 -0.6956439393939394 0 0.75 0.09583333333333344 0.06931818181818139 4.5680134680134605 0 -0.010416666666666963 0 0 -2.369431818181818 0.1383207070707022 1.6493265993265984 0.8764309764309757 -1.7667297979797982 0.75 0 0.27215909090909074 -1.7770833333333313 -0.8288720538720489 0.03749999999999987 -1.789583333333331 0 0.5263257575757576 -3.69375 -0.5346590909090909 -0.34791666666666676 0.75 -3.0153409090909093 5.13125 -0.42354797979797976 0.75 0.75 2.5729166666666665 0.6871001683501636 0.75 0 -6.516919191919191 0 0.95625 0 0 0 0 -40.06624579124579 -3.2883207070707074 -0.4230429292929293 0 -0.7240530303030301 0.11458333333333326 0.487752525252525 0 0.22727272727272751 -0.6743686868686869 -0.7596590909090908 -0.23592171717171695 0.3299999999999996 2.889478114478117 -0.2594696969697008 -0.6340067340067388 -1.2625 0 -1 0.75 -0.7666035353535354 scenario 6-max reg deals 150 seed 1592590337 -counts 1404 18 0 -samples -0.4166666666666667 -0.7651017684351009 0.25 0.16833333333333333 0.17703703703703622 0.09388888888888887 0.49702139639639653 0.8068518518518526 0.21544169169169103 1.66294961628295 -4.824358733733735 0.25 4.017129629629629 0.17993055555555562 5.961437131576024 0 -4.607032588143698 -1.6304799938827739 0 0.09671296296296299 0.09640265265265176 -9.072530655655656 0.5742279779779762 0 0.09663225725725733 1.6128928233789335 0.20390001112223163 1.7393823684795906 -3.778957499165834 -0.4166666666666667 0.5013888888888891 0.13444444444444445 -0.10835064230897502 0.43391370537203716 -0.26834834834834836 0.013433433433432581 -1.474400650650652 0 -11.625282782782783 0.4417867867867867 -0.01958208208208208 0.5 -1.2530555555555547 0 12.468579204204206 -0.25475792922551693 -0.2694969969969978 0.25 0.47002314814814805 0.22166666666666668 0 -0.20232232232232306 0 -0.05173611111111113 -2.6604911161161167 0.040388722055389494 0.1775 -0.35009259259259357 0 1.6006249999999997 -0.11802218885552136 0.5626451451451452 0.17455295573351193 0 0 0.3647222222222222 0.16197197197197197 0 -0.4293866783450125 -0.6106322989656331 -0.4857715354243127 0.6696659159159175 -0.011476059392726853 -0.25 10.638078078078081 -0.20608796296296297 -0.19406406406406326 -2.5175233566900217 0 0.02006944444444292 12.004104938271603 5.918295610425242 2.044761984206425 0.5527777777777777 -1.044986653319986 -0.07902777777777774 0.11416666666666668 0.07633883883883878 0 0 12.435764097430765 0.4578240740740734 13.369399260371482 0.08456706706706707 0.16798194027360455 0 0 -1.2321735624513404 -0.4262556306306314 3.1406110276943626 -0.02402777777777776 0 -0.14144185852519275 0.25 0 0.646488988988989 0.1580555555555556 0.17224724724724727 0.4529335585585586 -0.39671025191858605 -1.601156156156156 0.036704204204204206 0.4002627627627628 0.25 0.011111111111111072 0.15920795795795795 0.0762837837837839 0 -0.31258654487821214 -2.221064814814815 -0.04248623623623623 -1.0050925925925933 -1.1278623067511964 0 0 -4.128552858413971 1.7060648148148119 0.08222472472472471 -8.060321432543653 0.7596196196196204 0.25 -7.75316378878879 0.09333333333333334 0.11888888888888889 0.06741574908241639 0.3744447225002781 0.05003753753753674 0 -0.07624485596707631 -0.10474537037037124 0.033393393393394165 -0.014375000000000767 -0.18333333333333335 13.38699199199199 -0.010377877877878694 0.18299549549549554 -0.15961461461461382 4.200038163163165 0.27545545545545547 0.11412259481703997 +counts 1437 2 0 +samples -0.4166666666666667 0.5311945278611943 0.25 0.16833333333333333 0.17703703703703622 0.09388888888888887 0.49702139639639653 0.8068518518518526 0.21544169169169103 1.66294961628295 1.750821899574473 0.25 4.017129629629629 0.17993055555555562 4.3338651151151195 0 -12.629666332999664 -2.812064356022693 0 0.09671296296296299 0.09640265265265176 -1.933173706113524 0.5742279779779762 0 0.09663225725725733 4.405509514143771 0.20390001112223163 1.7393823684795906 3.7071536119452766 -0.4166666666666667 0.5013888888888891 0.13444444444444445 -0.10835064230897502 0.2116914831498157 -0.26834834834834836 0.013433433433432581 -1.474400650650652 0 -11.625282782782783 0.4417867867867867 -0.01958208208208208 0.5 -1.2530555555555547 0 12.468579204204206 -0.25475792922551693 -0.8991266266266268 0.25 0.47002314814814805 0.22166666666666668 0 -0.20232232232232306 0 -0.05173611111111113 -7.870513638638639 0.040388722055389494 0.1775 -0.35009259259259357 0 1.6006249999999997 -0.11802218885552136 0.5202694361027702 0.17455295573351193 0 0 0.3647222222222222 0.16197197197197197 0 -0.4293866783450125 -0.6106322989656331 -0.4857715354243127 0.6696659159159175 -0.011476059392726853 -0.25 10.638078078078081 -0.6983719135802477 -0.19406406406406326 -2.229457513068623 0 0.02006944444444292 8.801535084467183 -1.1374059244429588 2.044761984206425 0.5527777777777777 -1.044986653319986 -0.07902777777777774 0.11416666666666668 0.07633883883883878 0 0 11.504833166499834 0.4578240740740734 13.369399260371482 0.08456706706706707 0.16798194027360455 0 0 -1.2321735624513404 -0.6963173590256927 4.901747163830501 -0.02402777777777776 0 -0.14144185852519275 0.25 0 0.646488988988989 0.1580555555555556 0.5397814481147806 0.4529335585585586 -0.4300421949727507 -1.601156156156156 0.036704204204204206 0.4002627627627628 0.25 0.011111111111111072 0.15920795795795795 0.0762837837837839 0 -0.31258654487821214 -2.221064814814815 -0.04248623623623623 -1.0050925925925933 -1.1278623067511964 0 0 0.7325582526971388 1.7060648148148119 0.08222472472472471 -8.060321432543653 2.2464397731064394 0.25 -7.75316378878879 0.09333333333333334 0.11888888888888889 0.06741574908241639 0.3744447225002781 -5.374553720387053 0 -0.07624485596707631 -0.10474537037037124 0.033393393393394165 -0.014375000000000767 -0.18333333333333335 9.23144755866978 -0.010377877877878694 -1.4675856411967534 -0.15961461461461382 7.097565319949578 0.27545545545545547 0.11412259481703997 scenario 6-max nit deals 150 seed 1592590337 -counts 1016 5 0 -samples 10.340879004004004 0.5266775108441791 0.25 0.25 0.5 0.25 0.75 0.3547222222222222 0.023819444444444466 0 0.5 0.25 0.9229938271604947 0.25 0.25 0 0.5 -0.6011033950617302 0 0.5 0.34952765265265257 -17.20274461961962 0.2745720720720721 0 0.25 0.5618000639528412 2.0805727950172406 0.5355862112112112 0.5 -0.9194867784451111 1.0836154904904898 0.25 0.15930555555555545 8.83098536036036 0.5 0.25 0.07927083333333333 0 0.6252627627627628 0.38000000000000006 0.25 0.5 0.37138888888888894 0 0.75 11.438350225225227 0.4372222222222222 0.25 0.5 0.3475 0.25 0.9892592592592592 0 0.25 29.53524868618619 0.11254754754754755 0.5 0.5 0 -0.9926614114114115 -0.002777777777777768 0.75 0.25 0.25 0 0.5 0.5 0 -0.18348973973973962 0.5 0.31895833333333173 0.5 0.2577577577577577 0.25 -2.5296133633633633 -0.4607175925925926 0.44747747747747746 0.837258508508507 0 0.25 12.117307932932937 1.6540477977977945 1.1657000750750737 0.5 1.0630714047380725 -0.07013888888888886 0.25 0.75 0.25 0 0.6150975975975976 0.75 10.414493660326993 0.25 0.11300925925925909 0 0 -0.02777777777777783 0.5 0.29383445945945946 0.25 0.25 0.25 0.25 0.25 0.5 0.25 0.5 0.5 0.4395138888888889 -9.40436936936937 0.25 0.75 0.25 0.25 0.75 0.5 0 0.25 0.40913726226226294 -0.2820695695695696 0.3622222222222222 0.25 0 0 0.75 0.6535729479479478 0.25 -12.318781281281282 0.6105555555555555 0.25 0.8348148148148148 0.25 0.25 0.19646146146146148 -1.014351851851852 -0.3891196752307861 0 0.35268518518518516 0.6461111111111112 0.04948948948948952 -0.06715277777777777 0.6871121121121121 -0.018494744744745144 0.75 0.5 -0.11300300300300299 3.4827677677677715 0.5 0.5 +counts 1022 0 0 +samples 10.340879004004004 0.5266775108441791 0.25 0.25 0.5 0.25 0.75 0.3547222222222222 0.023819444444444466 0 0.5 0.25 0.9229938271604947 0.25 0.25 0 0.5 -0.6011033950617302 0 0.5 0.34952765265265257 -12.524900108441777 0.2745720720720721 0 0.25 0.5618000639528412 2.0805727950172406 0.5355862112112112 0.5 -1.6216472722722708 1.0836154904904898 0.25 0.15930555555555545 8.83098536036036 0.5 0.25 0.07927083333333333 0 0.6252627627627628 0.38000000000000006 0.25 0.5 0.37138888888888894 0 0.75 11.438350225225227 0.4372222222222222 0.25 0.5 0.3475 0.25 0.9892592592592592 0 0.25 29.53524868618619 0.11254754754754755 0.5 0.5 0 -0.9926614114114115 -0.002777777777777768 0.75 0.25 0.25 0 0.5 0.5 0 -0.18348973973973962 0.5 0.31895833333333173 0.5 0.2577577577577577 0.25 -2.5296133633633633 -1.3773842592592593 0.44747747747747746 0.837258508508507 0 0.25 12.117307932932937 1.6540477977977945 1.1657000750750737 0.5 1.0630714047380725 -0.07013888888888886 0.25 0.75 0.25 0 0.6150975975975976 0.75 13.686098598598598 0.25 0.11300925925925909 0 0 -0.02777777777777783 0.5 -1.5475225225225226 0.25 0.25 0.25 0.25 0.25 0.5 0.25 0.5 0.5 0.4395138888888889 -9.40436936936937 0.25 0.75 0.25 0.25 0.75 0.5 0 0.25 0.40913726226226294 -0.2820695695695696 0.3622222222222222 0.25 0 0 0.75 0.6535729479479478 0.25 -5.652114614614614 0.6105555555555555 0.25 0.8348148148148148 0.25 0.25 0.19646146146146148 -1.014351851851852 -0.3891196752307861 0 0.35268518518518516 0.6461111111111112 -15.084144144144146 -0.06715277777777777 0.6871121121121121 -0.018494744744745144 0.75 0.5 -0.11300300300300299 3.4827677677677715 0.5 0.5 scenario 6-max maniac deals 150 seed 1592590337 -counts 1281 9 0 -samples -2.8047297297297296 -4.718500375375376 9.064946196196196 -0.22556681681681678 -0.9899474474474474 -0.34274399399399397 -0.4740277777777777 -0.4119644644644647 0.11334834834834744 10.739027777777777 -0.25 -0.9988551051051053 -0.25 -0.5335585585585586 0.09120870870870856 0.2416666666666667 -0.15503628628628627 -1.1204360610610615 -0.10730480480480481 -0.4166666666666667 -2.981436749249246 20.04692192192192 7.161106731731729 -0.10983483483483479 -0.25 -4.939597097097097 -0.7926201201201201 -0.7790465465465465 -1.3563250750750748 -1.469512012012012 -2.1596646646646644 0.4746296296296295 -0.7975694444444444 -1.7039026526526528 -1.0310347847847847 -1.549042792792793 -1.258778153153153 -0.25 -2.3827946696696696 3.8872810310310313 -1.7735135135135132 -0.480374124124124 -3.551208708708709 1.1092235985985983 -0.9600037537537539 12.388124374374378 -0.5045045045045046 -0.25 -0.25 -1.006378253253253 2.4348160660660674 -0.5405255255255254 0.14600225225225225 -0.4092029529529529 -1.858318318318318 -1.4887387387387385 -1.2485416666666664 -0.25 0.04688188188188188 -4.951933183183182 15.405000000000001 -0.25 -11.391512762762764 -1.3060435435435436 0.2988551051051049 0.09281906906907074 15.024651526526526 -0.31681681681681684 -3.4444894894894893 -0.7501689189189191 -2.6005067567567566 -0.5791510260260262 -19.895667125458782 -0.25 -11.878246996996998 -1.7790634384384383 -2.092706456456456 -6.054503253253252 -0.4833051801801802 -2.4276914414414397 42.316498998999 0.5479316816816814 -0.01918918918918866 49.40919502836175 -7.811880630630632 -0.20623873873873885 -0.4960285285285284 -0.4834647147147148 15.743055555555555 -0.18267517517517518 38.769369369369365 15.806041041041041 15.700639389389389 -1.8884534534534538 -0.40093093093093124 -0.11782907907907904 -0.25 -2.2499092147703266 -3.092311061061061 33.6646853103103 -0.5466316316316316 -1.364552052052052 -1.4732670170170168 16.38734984984985 -0.25 -0.31805555555555554 -1.0112587587587583 -0.25 -0.33470658158158156 -1.5000563063063062 -9.073472222222223 -0.25 -0.5030030030030029 -0.25 0.23185685685685678 -0.42957957957957965 -0.25 -0.25 -0.15464214214214209 -1.083614864864865 -2.321208708708709 -1.113776901901902 0.7306045628962278 -0.29003003003003003 -0.3071978228228229 -4.234876126126127 -1.9611036036036038 -0.37053303303303303 29.994169169169158 -0.25 -0.25 -7.677796546546546 -0.6482795295295295 -1.8768518518518522 -0.25 10.412268518518522 -0.34401276276276266 -0.23229104104104106 -0.25 -2.535523023023023 50.935236486486495 -2.934553303303302 -0.7156656656656657 28.398293918918913 22.322118993993996 -0.37061936936936934 -0.07200075075075074 -4.785097597597598 -0.32288288288288286 -0.08208333333333336 +counts 1291 0 0 +samples -7.291466466466467 16.281499624624626 8.03059934934935 -0.22556681681681678 -0.9899474474474474 -0.34274399399399397 -0.4740277777777777 -0.4119644644644647 0.11334834834834744 10.739027777777777 -0.25 -0.9988551051051053 -0.25 -0.5335585585585586 0.09120870870870856 0.2416666666666667 -0.15503628628628627 -1.1204360610610615 -0.10730480480480481 -0.4166666666666667 -2.981436749249246 20.04692192192192 7.161106731731729 -0.10983483483483479 -0.25 -7.074919919919918 -0.7926201201201201 -0.7790465465465465 -1.3563250750750748 -1.469512012012012 -2.1596646646646644 0.4746296296296295 -0.7975694444444444 -1.7039026526526528 -1.0310347847847847 -1.549042792792793 -1.258778153153153 -0.25 -2.3827946696696696 3.8872810310310313 -1.7735135135135132 -0.480374124124124 7.421013513513512 1.1092235985985983 -0.9600037537537539 12.388124374374378 -0.5045045045045046 -0.25 -0.25 -2.7563782532532533 2.4348160660660674 -0.5405255255255254 0.14600225225225225 -0.4092029529529529 -1.858318318318318 -1.4887387387387385 -1.2485416666666664 -0.25 0.04688188188188188 -4.951933183183182 15.405000000000001 -0.25 15.19182057057057 -1.3060435435435436 0.2988551051051049 0.09281906906907074 15.024651526526526 -0.31681681681681684 -3.4444894894894893 -0.7501689189189191 -2.6005067567567566 -0.5791510260260262 29.270999541207885 -0.25 -11.878246996996998 -2.542952327327327 -2.092706456456456 -6.054503253253252 -0.4833051801801802 -2.4276914414414397 42.316498998999 0.5479316816816814 -0.01918918918918866 49.40919502836175 -4.311880630630632 11.959051551551548 -0.4960285285285284 -0.4834647147147148 15.743055555555555 -0.18267517517517518 37.34294294294294 16.525485485485486 15.700639389389389 -1.8884534534534538 -0.40093093093093124 -0.11782907907907904 -0.25 -2.2499092147703266 -3.092311061061061 33.6646853103103 -0.5466316316316316 -3.8820695695695693 -1.4732670170170168 16.38734984984985 -0.25 -0.31805555555555554 -1.0112587587587583 -0.25 -0.33470658158158156 -1.5000563063063062 -9.073472222222223 -0.25 -0.5030030030030029 -0.25 0.23185685685685678 -0.42957957957957965 -0.25 -0.25 -0.15464214214214209 -1.083614864864865 -2.321208708708709 -1.113776901901902 0.7306045628962278 -0.29003003003003003 -0.3071978228228229 -4.234876126126127 -1.9611036036036038 -0.37053303303303303 29.994169169169158 -0.25 -0.25 -11.06743618618619 -0.6482795295295295 3.123148148148148 -0.25 10.412268518518522 -4.60076951951952 -0.23229104104104106 -0.25 -2.535523023023023 50.935236486486495 -2.934553303303302 -0.7156656656656657 28.398293918918913 21.461007882882882 -0.37061936936936934 -0.07200075075075074 -8.535097597597597 -0.32288288288288286 -0.08208333333333336 scenario 6-max fish deals 150 seed 1592590337 -counts 1914 14 0 -samples -12.398426551551552 -0.1904542042042042 3.0803486820153494 -0.2997297297297307 0.057777777777777706 -0.14722222222222228 0.17541666666666664 -0.10454204204204219 0.37444444444444436 0.055003753753753847 -16.71093843843844 0.22996996996996996 -0.027755255255255278 -0.14666666666666675 2.138506006006006 -0.055972222222222166 0.29073198198198186 -0.012365490490490441 -0.13936936936936942 -0.013055555555555542 8.758487654320986 -12.401707957957958 0.39827702702702705 -0.10513888888888885 -13.719024024024025 0.09182620120120129 7.259827327327329 -0.2876876876876877 -1.5972747747747746 0.4466591591591594 -0.17325075075075066 0.018763763763763725 -0.1999774774774774 -1.1839489489489488 0.11814814814814804 27.983442192192186 0.03199324324324319 -0.1762987987987988 -0.3915728228228228 7.540968468468468 -0.6175 -0.09555555555555562 -0.2833083083083083 0.8604166666666669 -0.24619744744744917 -3.4196509009009013 0.3225 0.07222222222222234 -0.395975975975976 -2.0083333333333333 0.22125000000000006 -0.5906944444444443 -0.3659722222222224 -0.2175000000000001 -0.3179579579579574 -2.48743993993994 0.09666666666666668 -0.3646246246246246 0.2877777777777777 -0.5178678678678676 0.2023198198198198 7.331649149149148 0.2988888888888887 0.053978978978979 45.22653069736403 0.8316666666666661 -0.16500000000000004 -0.05388888888888891 0.3566666666666667 -0.4787912912912915 -1.2419444444444443 -0.005185185185185255 0.10107586753420113 17.168435852519192 -0.3212781531531534 0.10652777777777783 -1.075 -0.08387012012012009 -0.10907407407407399 0.31444444444444436 39.696134884884884 -2.2736961961961963 -0.2627852852852852 2.9549624624624613 -0.9294031531531542 51.72401776776777 -0.004722222222222183 18.10763888888889 22.591944444444447 -0.04916666666666666 43.678426343009676 -0.05677177177177182 -2.494675925925926 4.114144144144144 0.07647897897897905 -0.055833333333333325 -0.20356981981981984 -0.5101445195195196 -0.034590840840840985 22.116624749749747 0.008055555555555483 0.2540915915915916 0.26875 2.859354354354355 0.044999999999999964 0.08638888888888892 0.09722222222222228 0.13805555555555532 2.345416666666667 0.02041666666666662 8.705405655655653 -0.17444444444444443 1.6686111111111124 -0.043055555555555514 0.4544444444444444 -0.15287412412412385 -0.9063863863863868 -0.26944444444444443 0.07845345345345361 0.1268055555555555 0.33472222222222214 0.022777777777777786 0.14499999999999993 1.5349699699699688 -0.019444444444444486 0.6001238738738736 -0.3108408408408409 -0.4313888888888888 63.336896896896896 -0.10913663663663671 0.07333333333333336 -0.6038138138138138 -0.03333333333333336 -0.18072822822822823 -0.059557057057057085 0.4404166666666658 0.33541666666666653 -0.005555555555555573 0.4479579579579575 -0.7127777777777777 63.482526276276275 0.029583333333333444 0.02666666666666669 32.070480480480484 4.979842342342343 -0.1580555555555556 9.560958875542209 0.10347222222222226 -0.0788588588588589 63.00087212212213 +counts 1926 0 0 +samples 22.798958333333328 -0.1904542042042042 3.0803486820153494 -0.2997297297297307 0.057777777777777706 -0.14722222222222228 0.17541666666666664 -0.10454204204204219 0.37444444444444436 0.055003753753753847 -16.71093843843844 0.22996996996996996 -0.027755255255255278 -0.14666666666666675 2.138506006006006 -0.055972222222222166 0.29073198198198186 -0.012365490490490441 -0.13936936936936942 -0.013055555555555542 8.758487654320986 -12.401707957957958 0.39827702702702705 -0.10513888888888885 -13.719024024024025 0.09182620120120129 7.259827327327329 -0.2876876876876877 -1.9499774774774785 -0.31722972972972957 -0.17325075075075066 0.018763763763763725 -0.1999774774774774 -1.1839489489489488 0.11814814814814804 27.983442192192186 0.03199324324324319 -0.1762987987987988 -0.3915728228228228 7.540968468468468 -0.6175 -0.09555555555555562 -0.2833083083083083 0.8604166666666669 -13.34200825825826 -3.4196509009009013 0.3225 0.07222222222222234 -0.395975975975976 -2.0083333333333333 0.22125000000000006 -0.5906944444444443 -0.3659722222222224 -0.2175000000000001 28.082042042042037 -2.48743993993994 0.09666666666666668 -0.3646246246246246 0.2877777777777777 -0.5178678678678676 0.2023198198198198 7.331649149149148 0.2988888888888887 0.053978978978979 45.22653069736403 0.8316666666666661 -0.16500000000000004 -0.05388888888888891 0.3566666666666667 -0.4787912912912915 -1.2419444444444443 -0.005185185185185255 0.10107586753420113 17.168435852519192 -0.3212781531531534 0.10652777777777783 -1.075 -0.08387012012012009 -0.10907407407407399 0.31444444444444436 39.696134884884884 -2.2736961961961963 -0.2627852852852852 2.9549624624624613 -0.9294031531531542 51.72401776776777 -0.004722222222222183 18.10763888888889 22.591944444444447 -0.04916666666666666 43.678426343009676 -0.05677177177177182 -2.494675925925926 4.114144144144144 0.07647897897897905 -0.055833333333333325 -0.20356981981981984 -0.5101445195195196 -0.034590840840840985 22.116624749749747 0.008055555555555483 0.2540915915915916 0.26875 2.859354354354355 0.044999999999999964 0.08638888888888892 0.09722222222222228 0.13805555555555532 2.345416666666667 0.02041666666666662 8.705405655655653 -0.17444444444444443 1.6686111111111124 -0.043055555555555514 0.4544444444444444 -0.15287412412412385 -0.9063863863863868 -0.26944444444444443 0.07845345345345361 0.1268055555555555 0.33472222222222214 0.022777777777777786 0.14499999999999993 1.5349699699699688 -0.019444444444444486 0.6001238738738736 -0.3108408408408409 -0.4313888888888888 63.336896896896896 -0.10913663663663671 0.07333333333333336 -0.6038138138138138 -0.03333333333333336 -0.18072822822822823 -0.059557057057057085 0.4404166666666658 0.33541666666666653 -0.005555555555555573 0.4479579579579575 -0.7127777777777777 63.482526276276275 0.029583333333333444 0.02666666666666669 32.070480480480484 4.979842342342343 -0.1580555555555556 9.560958875542209 0.10347222222222226 -0.0788588588588589 63.00087212212213 scenario 6-max calling station deals 150 seed 1592590337 counts 2139 0 0 samples 0.6016666666666668 -0.08347222222222221 0.13222222222222224 -0.03666666666666666 0.057777777777777706 -0.05777777777777782 0.22541666666666652 0.07638888888888877 0.42777777777777776 0.6068055555555555 -3.7752777777777777 0.3380555555555554 0.005277777777777752 -0.048611111111111084 5.243611111111111 -0.019722222222222197 3.753194444444444 8.556944444444445 -0.10333333333333339 -0.013055555555555542 0.11597222222222221 12.95236111111111 0.4823611111111112 -0.10513888888888885 -0.7672222222222222 0.44708333333333344 0.34083333333333304 0.07222222222222215 0.33027777777777795 5.549722222222222 0.02194444444444447 0.09749999999999999 0.5136111111111112 3.2788888888888885 0.4083333333333332 0.3134722222222221 0.4683333333333333 -0.15527777777777776 0.2784722222222223 -0.11569444444444447 -0.061944444444444434 -0.09555555555555562 0.25361111111111106 0.8998611111111113 0.412361111111111 8.801388888888889 0.3225 0.07222222222222234 -0.2255555555555556 0.5848611111111109 0.4281944444444446 0.1731944444444445 0.6340277777777775 0.19916666666666658 8.613055555555556 0.03583333333333346 0.33083333333333337 0.14888888888888893 0.2877777777777777 0.5345833333333335 0.4658333333333333 3.3772222222222226 0.2988888888888887 0.24166666666666678 7.318532282282283 0.031666666666666586 -0.040000000000000056 -0.043055555555555514 0.3566666666666667 0.1458333333333333 0.43861111111111123 0.10583333333333324 0.26402777777777775 0.0011111111111110628 0.8029166666666668 0.18166666666666662 0.19666666666666655 0.02236111111111111 0.048333333333333416 0.31444444444444436 0.8497222222222222 0.29749999999999993 3.0769444444444436 0.3952777777777776 0.46263888888888877 -6.609722222222223 -0.004722222222222183 19.867638888888887 8.925277777777778 -0.027777777777777752 7.079459459459457 0.2705555555555556 3.8809722222222227 5.136666666666667 0.37527777777777777 -0.055833333333333325 0.07055555555555564 8.819444444444445 0.08402777777777763 0.22291666666666674 0.03583333333333327 0.2736111111111112 0.27638888888888885 2.882627627627628 0.044999999999999964 0.08638888888888892 0.09722222222222228 0.13805555555555532 3.6787500000000004 0.02041666666666662 0.728888888888889 -0.11888888888888889 5.219722222222222 0.03388888888888899 0.4544444444444444 0.1036111111111111 -0.044444444444444474 -0.06111111111111108 19.064305555555553 0.1268055555555555 0.6098611111111113 0.10611111111111111 0.2320833333333335 -0.06277777777777784 -0.019444444444444486 0.684583333333333 -0.05333333333333332 0.06861111111111118 12.717777777777778 0.40249999999999986 0.07333333333333336 -0.12333333333333334 -0.02194444444444447 0.04750000000000001 0.21194444444444452 0.6597222222222222 0.5195833333333332 -0.005555555555555573 -0.08777777777777777 -0.15722222222222226 65.62742117117118 0.029583333333333444 0.02666666666666669 8.209343093093093 12.637499999999998 0.03638888888888888 1.0456944444444443 3.8713888888888888 -0.05333333333333338 78.63445570570572 +scenario 6-max gto +deals 150 +seed 1592590337 +counts 1331 1 0 +samples 0 2.3022547547547565 0.12938438438438435 -0.03156719219219221 0.8386805555555554 0.3640740740740755 -1.6324305555555556 0.2308333333333333 -0.1715990990990991 0.5326388888888888 0 -0.09211586586586591 0.45999249249249247 -0.43119119119119115 -3.915197836725611 0 0.3607820320320337 -3.3009336419753077 0 0 -0.33149566232899647 1.7107825186297383 -0.3491666666666662 0 0.13961774274274266 0.6647470387053739 0.7750706956956958 1.5315972222222254 0.47260517461906354 -0.4166666666666667 -5.899988738738739 0.06999999999999999 0.4112268518518503 11.361010802469133 0.09249999999999996 1.8547222222222224 0.4179650483817134 0 0.5419773940607282 0 -0.01958208208208208 0.5 -0.3847585085085085 0 -0.569861111111111 1.4022239600711799 0.16206685852519045 0 -0.6666666666666666 0.1433333333333334 0 -0.2975794544544552 0 -0.05173611111111113 1.1081040762985197 -0.04719844844844845 -0.2961636636636636 0.4340065065065066 0 -0.05079850684017432 -0.19936186186186186 0 0.053217592592592546 0 0 0.9274999999999999 0.40258258258258256 0 -0.39451388888888905 0.3692129629629614 0.4842757340674022 0.08347222222222224 0.8494707207207207 0 -3.3899084084084077 0.2914660493827175 -0.9166666666666666 0.6077677677677661 0 -1.4333101851851853 12.202139709153599 0.6225975975975976 -0.8416424758091433 0 16.3861995328662 -0.07013888888888886 -0.10644894894894892 -0.6666666666666666 0 0 8.924011302969637 0.04028841341341346 7.882682265598933 -0.16972222222222225 0.2763649065732385 0 0 0.32965382048715236 1.9981481481481485 -5.4581481481481475 -0.3251551551551551 0 -0.12567692692692703 0.09743868868868866 0 2.7625961378044717 0.25 0 0 -0.2722243076409751 -2.3763082526971417 0.25 3.7142348598598596 -0.1487612612612612 0.4229166666666666 0.29009884884884884 -0.1391166166166166 0 -2.235439745300857 0.5513888888888893 2.3850000000000002 -0.10833333333333332 0.49625062562562744 -0.09337712712712702 0 1.55375 -0.31712337337337343 0.25 0 0.17736111111111116 0 -0.06999061561561588 0 0 -0.25185685685685694 -1.25 0 0 -0.13851351351351351 -0.5233333333333333 -0.13128003003003 -0.43083333333333335 -0.25508571071071073 0.2884772272272282 -0.12923298298298302 2.141859359359359 -0.2528378378378378 10.513079954954955 0.5 3.8726939439439447 +scenario heads-up gto (blind) +deals 3000 +seed 1592590337 +counts 15020 13 0 +samples 0.75 0.7248106060606061 0.5176136363636319 1.0909301346801392 0 1.1083333333333334 -1.3104166666666668 0 0.08750000000000746 0.18465909090909083 -0.507449494949495 -12.835921717171708 0.2617424242424289 -9.398106060606063 2.439772727272729 0.75 -0.2813131313131252 2.8873737373737436 0 -0.1958333333333333 -0.01325757575757569 0 -35.58712121212121 0.02500000000001279 0 1.1143308080808128 -0.2150799663299634 0 4.847432659932662 -0.19454966329965795 -6.6233375420875475 -2.2308712121212095 0.3767045454545457 5.262394781144784 0 2.770833333333333 -13.366498316498316 0 -0.37342803030302907 -0.18087121212121215 0 0.5535984848484801 -1.466074494949492 -0.4317340067340001 0.01666666666666672 0.75 -0.4368939393939395 -32.195138888888884 -0.11912878787878789 -3.00833333333333 1.5243686868686868 0.75 0.4835227272727276 0 0 -0.7103535353535353 0.4605008417508438 -0.6571969696969696 0.24545454545454515 -0.02430555555555558 -1 0.17605218855219051 0.75 0.75 -0.28507996632996235 -0.27500000000000013 -1.758333333333331 -0.004356060606060641 -1.8819865319865299 3.7075547138047167 1.20625 1.2541666666666669 0.7073653198653223 -1.9025883838383875 0 0 -0.4249999999999998 0.8616792929292929 0 -1.0840909090909092 0 -0.20296717171717393 0.148442760942761 1.987899831649833 -10.448611111111104 -0.28636363636363904 -4.796548821548827 0.016666666666666163 0.75 -4.1498106060606 -4.160833333333334 -2.1166666666666667 -1.3627946127946124 5.467929292929294 2.2666666666666666 -0.7662878787878789 0 3.5925715488215513 2.2416666666666667 2.6024621212121213 4.187121212121207 0.10416666666666674 0 0 0 -2.608228114478112 0.22916666666666652 2.625 0 -0.4876893939393939 -1 11.218897306397317 -0.27140151515151034 1.0554292929292979 -4.256944444444439 0.019507575757570894 -11.179819023569015 -17.02988215488215 -2.967992424242424 -0.2821969696969697 -0.15416666666666667 -1 -0.3675505050505051 -0.13750000000000007 0.75 -7.162962962962953 1.3768939393939412 -0.15833333333333344 0 1.4454335016834992 1.0131313131313187 1.6958333333333313 -0.24614898989898992 0.7405303030302981 0.9626893939393986 1.4228956228956253 -1.157680976430961 0 -0.6183712121212073 -0.4666666666666668 0 -0.9567550505050504 -4.101893939393937 1.5562500000000048 12.204061447811458 2.9047348484848436 0 -2.182007575757576 0.5557659932659949 -1 -1.1541666666666668 5.5718223905723985 18.920833333333324 0 0 0.75 0.75 -0.5868686868686868 -0.08396464646464907 2.507765151515149 -0.39564393939393927 0.661489898989899 0.185606060606061 -44.54375 0.75 4.851346801346795 -2.5 0.8214015151515204 0 -0.10833333333333328 0.019318181818186897 0 -1 0.5804924242424241 0.4227062289562309 0 -0.5925126262626261 0.01041666666666674 0.039583333333333415 4.141666666666671 0 0 -0.5972222222222223 1.2871212121212172 -0.7460016835016785 1.137310606060606 -0.02708333333333357 -0.04791666666666661 0.12708333333333366 4.452525252525254 9.674999999999997 0.24962121212121202 0 -4.057234848484848 -3.720580808080803 -0.5665824915824915 0 0.015361952861954853 -1.4458333333333333 -14.481334175084164 0 -0.9374999999999973 -0.30827020202020206 0.34185606060606055 -3.475189393939388 0.6191919191919233 -0.35 -1.1157196969696923 0.5112373737373737 0 5.16778198653198 2.345833333333333 -0.28630050505050497 0 -0.5208964646464647 0.018750000000000044 0.866540404040404 -0.13541666666665986 0 -7.746191077441081 0 0.4492424242424242 0.75 -0.3522727272727273 0.75 -0.18541666666666679 -0.061489898989899094 0.8479797979798003 -0.47935606060606084 -18.07 -3.2898779461279437 -0.15833333333333333 -3.6760101010100956 -0.22878787878787854 0 -0.07310606060605829 -0.7032828282828283 0 0.75 -25.60656565656565 -1.8374999999999977 0 3.416498316498321 0.75 0.33125000000000004 0 -0.48939393939393927 -0.010416666666659635 0.75 0.75 0.75 0.8374999999999955 -1.4715277777777742 0 -0.9350378787878788 0.16003787878787867 -0.017045454545454586 0.008333333333333526 0.7602904040404088 -1 0.6061447811447763 -1.0104166666666643 -5.135185185185183 0 0 0.871338383838383 2.6625 0.75 -0.01041666666666674 0 1.2325757575757574 0.75 -0.20252525252524745 0 22.446780303030316 3.085122053872056 -1.5489898989898963 0.24128787878787872 -3.0403409090909093 1.0604166666666668 0 1.3736742424242472 -0.2354166666666666 -0.15227272727272723 0 -0.5073232323232302 9.267424242424244 0 -0.7871212121212121 -0.45498737373737375 -0.07272727272727231 0.29583333333333095 2.953787878787886 0.36250000000000004 -1.2287878787878788 -0.2752525252525253 -5.324179292929296 1.1965909090909133 -0.9500631313131289 1.775757575757573 -1.4800294612794618 -0.21079545454545456 5.049909090909095 -2.2278409090909093 -7.989541245791239 1.6186447811447855 1.2112500000000002 -0.6043560606060605 0.75 0 0 0 0.32272727272727253 1.3123737373737372 1.6703493265993272 0 -2.0689393939393943 0.75 0.12083333333333335 0 -0.06458333333333344 -2.6680303030303003 -1.5812499999999976 -0.31117424242423963 38.61609848484848 -1.8437878787878739 0 -0.2825757575757577 1.452398989898992 1.0291666666666668 -0.3773358585858585 0 0.75 3.3833333333333333 -0.014583333333333393 0.75 0 0.017234848484848575 0 1.907828282828274 0.7746212121212119 -1.527083333333331 0.6060606060606015 0.46022727272727293 0.75 0.75 3.5685606060606094 -0.25151515151515147 0.7343644781144829 0 0 -0.8181186868686794 -2.46875 -0.022916666666666696 2.8816077441077463 -1 0.5378787878787878 0 -0.6833333333333309 0.75 0 -0.016666666666659058 -2.9997895622895596 0 -2.190340909090909 1.0792297979798002 -0.4039772727272728 9.674999999999997 -0.10833333333333317 -0.2763888888888917 5.685816498316497 -0.09166666666666667 0 -0.14166666666666683 -1.643118686868687 0.75 0 -0.061868686868691514 0.09375 -41.313257575757575 -0.611237373737374 0.03623737373737379 0 -6.816203703703711 -2.9457702020202055 -0.6583333333333332 -1.8791666666666642 -1.275 0.75 -11.71727693602693 1.3534722222222186 -0.042276936026936385 -1.2791666666666643 0 -8.994549663299658 -1.8312499999999976 0 0.08503787878787872 -1.2427188552188597 0.75 2.5943181818181844 2.277967171717176 -1.723590067340065 -1.874747474747475 0.033333333333333326 -2.7825000000000033 2.7548484848484858 0.04583333333333983 0 0 0 45.23939393939394 0.02083333333333326 0.919128787878793 -1.777083333333331 0 -0.16249999999999998 0.75 -0.5773569023569043 0.6543560606060559 -0.030303030303030276 0.10303030303029859 0.0458333333333405 -4.549242424242429 -0.44286616161616443 -0.15404040404040842 1.8600378787878764 -4.277377946127941 -0.10416666666666663 -2.364583333333337 1.0208333333333333 0.216161616161624 -0.6924242424242424 -0.7647727272727274 4.844549663299663 -1 -1.2299242424242398 0 5.5805555555555575 -0.05896464646464672 2.5206818181818185 0 1.3527777777777832 -0.23495370370369884 -17.968295454545455 0 0.8287878787878789 0.029166666666667007 1.568939393939394 0.8583333333333332 1.1708333333333356 0.8557449494949516 2.9506313131313155 1.6020833333333309 0.7152146464646436 1.3965909090909137 5.965404040404039 -0.4263257575757575 0.35397727272727253 -1 -2.1251893939393947 -0.42348484848484846 0 -0.8765151515151515 1.053367003366993 -2.7986111111111187 0.22291666666666665 -0.581628787878788 0.918623737373742 0 9.315845959595961 0 2.0602272727272766 0.5893939393939394 2.2229166666666664 10.165972222222223 -0.004166666666666652 0.5635101010100965 -0.125 1.5668560606060558 0.5783670033670059 -0.04562289562290012 1.7583333333333382 -36.088005050505046 1.8958333333333335 -8.395622895622896 0 -0.35450336700336216 -1.0795244107744086 2.5916666666666597 -41.78480218855219 -0.883333333333336 5.336363636363637 -0.33825757575757576 -1.019423400673392 0 0 -1.2461489898989924 -0.662878787878788 2.25 -0.7537878787878789 0.75 2.6416666666666666 18.329292929292933 -0.412962962962957 -0.9719696969696972 0 0.9270833333333334 1.829166666666671 -0.11875000000000002 0 0.75 0.8845328282828326 0.6763257575757577 -0.7922979797979797 1.48106060606061 0.07083333333333353 0 0.75 0.75 -1 0.34090909090909105 5.152588383838384 -9.66054292929292 0.16388888888888875 -2.4645833333333336 0 0 -2.398442760942757 -4.181250000000005 -0.9873526936026955 1.5583333333333382 0.75 -0.9935606060606057 0 3.862310606060606 -0.12291666666666679 -0.4843434343434344 -2.50031565656566 -3.268750000000001 0 -0.12916666666666665 0.23819444444444438 0.75 0.19374999999999987 0.9357744107744133 0.75 0 -0.26041666666666663 0 -0.419746212121213 0.9004419191919191 0.5051136363636366 -0.02499999999999325 -0.0333333333333401 -0.7896590909090913 1.5152146464646459 0.1812499999999999 0.23756313131313123 0 -0.06584595959595951 0.08124999999999982 -3.014015151515151 -0.6857954545454545 -0.99185606060606 1.6500000000000046 -13.280681818181808 -0.7210227272727273 0.02499999999999991 -1.4354166666666643 -0.3208333333333333 5.702765151515147 0 0.23150252525252524 -0.039583333333333304 0.919810606060611 -0.21283670033669555 -2.479166666666667 0 -0.7491372053872005 -0.7729166666666667 -0.18125000000000036 0 -0.12291666666666656 0.75 -0.07708333333333339 0.75 -0.42165404040404053 0.75 0.75 0.75 -0.01041666666666663 0 -1.3482954545454522 -1.1749999999999998 -2.3574284511784533 0 -4.494385521885519 0.07291666666666652 -1 -3.30025252525252 1.5323021885521935 0 0.19374999999999987 0.75 0.75 2.9567045454545444 0 0 -0.6015782828282829 1.1863636363636412 -4.927058080808073 0.5804924242424243 0.03958333333333308 -0.8434974747474726 -0.012499999999999956 2.470833333333333 -9.032512626262616 0 0.75 0 -4.589962121212118 1.8319234006734009 0.12291666666666679 -1 0.7363005050505051 -0.04583333333333339 5.4907196969696965 -1.3907196969696987 -0.41635101010101017 0 -0.6825126262626262 -1.4247474747474724 -7.065172558922544 0 0.10624999999999996 0 -0.5011363636363637 0 -3.6642676767676656 1.6479166666666645 5.901893939393946 0 -2.5 -7.463973063973061 0 10.800063131313141 -21.175652356902354 -1.0585227272727298 0.5789983164983217 -0.8458333333333334 -2.0604797979797977 0 0 0.2748106060606086 -0.5621212121212036 0.14747474747474554 -0.10833333333333317 -11.615319865319863 0 -0.16742424242424248 -0.18125000000000036 0 7.4759048821548735 1.2179082491582565 0 -6.7158038720538675 -1 -0.05833333333333335 0 -0.018750000000000044 -0.09759469696969436 0 45.20808080808081 2.4458333333333333 -2.34962121212121 0.9871632996633082 1.6544191919191968 -1 -0.033333333333333326 1.19964646464646 0 0.027083333333333126 -0.6131944444444446 0 -4.407891414141418 1.262689393939398 0 -0.5809974747474748 0 -24.1525 0.07916666666666639 -2.5526515151515103 -0.8255681818181748 -2.0549242424242427 0 0.5994318181818182 8.833291245791244 0 1.864583333333338 0.22916666666666652 3.228661616161612 -0.04791666666666661 -3.9755892255892205 -0.08655303030303019 -4.31801346801346 0.002083333333333215 0.054166666666666696 -48.85587121212121 -0.545770202020202 0 0.07617845117845667 1.149684343434341 -0.3076136363636359 0.5151094276094303 0.002083333333333437 -1 1.9232954545454537 -1 0.002083333333333437 6.655946969696968 9.620000000000001 0 0.9104166666666668 1.3732954545454543 1.5693181818181863 0 0.75 1.1057449494949516 -3.906313131313129 -1.208333333333332 -0.40549242424242427 0 0.19166666666666665 3.429882154882155 -14.692487373737363 0 -0.2020833333333334 -3.4340025252525184 -0.09375 -0.07272727272727275 0.18541666666666656 0 -0.0854166666666667 -5.047095959595954 0 -25.42984006734006 0.75 0 0 -1.466561447811447 0 -0.42992424242424243 0 4.34520202020202 0.5482954545454499 -1 -5.685795454545452 0.7282196969697017 0 -1.891792929292924 0 -0.2708333333333308 -1.3810606060606037 5.896296296296302 -0.21590909090909083 -0.37424242424242427 0 -1 5.800378787878781 -4.440761784511789 0 0.5047979797979818 -0.5607323232323234 0 0 0 0.02651515151515138 -0.6202020202020162 -0.27178030303030587 0 -4.703577441077435 -8.571439393939393 -2.48125 0 -1.6537037037037023 0 -0.16066919191919204 0 0 0.8208333333333355 -3.737499999999992 -3.861805555555545 2.5399200336700307 0.07083333333333341 0 1.6685606060606062 0.1875 0.75 -0.08074494949495392 0.9907196969696969 -4.566540404040404 -0.8520833333333311 -0.32354797979797967 2.540556818181823 1.2625 0.7918560606060607 0 0.6193602693602716 3.666645622895625 0 0.11250000000000004 1.9622727272727243 -0.23124999999999996 0.8904671717171764 -6.1481060606060565 -0.382954545454548 0 0 -3.582891414141417 2.0786616161616203 -0.30467171717171726 -0.6729166666666644 3.101809764309761 0.9492213804713832 0.25069444444444433 1.0537878787878787 -12.8874579124579 1.0998737373737424 1.754755892255897 -0.09166666666666679 0.03125000000000022 0 0.75 -0.14943181818181817 0.75 1.1437500000000043 0.75 -5.632638888888883 0.7888678451178501 0 5.71465909090909 -2.2162457912457887 -0.004187710437708159 3.034301346801349 0 -1.0268939393939396 0.09375 -22.593223905723907 0.12213804713804954 -0.05277777777777792 0 0.11818181818181817 -2.5625 0.75 0 0.943265993265995 -1.3062499999999977 0.4556818181818183 -1.0354545454545456 -1 0 -1 -4.0467171717171695 -3.8513888888888785 0 -0.18541666666666667 0.1020833333333333 -0.9443813131313101 2.6973905723905807 0.11041666666666683 0 0.941540404040404 2.5229166666666667 -1.7387415824915822 -0.5604587542087567 0.04791666666666661 1.0785984848484849 -27.034532828282828 2.556250000000005 -0.3604166666666666 -5.226767676767672 0.4670033670033671 -2.1703282828282777 0 -3.1337121212121235 -1.7258838383838384 -0.0456439393939394 1.4690025252525247 3.1951388888888936 -2.2177188552188527 2.3 -0.8814393939393965 -8.835816498316493 -0.9164772727272752 -0.5157196969696969 0 0 -1 0 -0.10000000000000009 0 -1 -1.5714015151515097 -1 -0.640088383838384 0 6.449999999999998 -1 0 0 -0.5012626262626263 -2.1780303030303036 0 -1.0179924242424219 -0.031249999999999778 2.475 0.07108585858585859 -0.18541666666666679 -0.40896464646464636 0 2.9883333333333333 0.75 1.347537878787879 13.788560606060607 -1.6946338383838349 -0.004166666666666652 3.5247474747474827 0 -1.364646464646464 -0.06875000000000009 1.3270833333333334 -2.5479166666666666 -0.8535984848484826 -10.511510942760935 0.10094696969696493 -1.04375 -15.610795454545446 1.6265151515151468 -3.37333754208754 -9.566161616161612 0.8333333333333333 0.062499999999999556 2.29375 0.016666666666666607 0.75 0.19791666666666652 0 0.03333333333333366 -1 10.799515993265999 0 -0.4566287878787879 0 0 0.01666666666666694 0.8945496632996679 0.19791666666666663 -0.04999999999999272 -1 -0.3458333333333333 -1.7240109427609427 0.75 0.75 2.963341750841753 -0.26250000000000007 -0.33352272727273036 -0.3977272727272727 -0.39412878787879246 0 -1 0.8999999999999999 6.83068181818182 -2.505534511784507 -4.58796296296296 0.044570707070707094 2.9000841750841797 -0.826578282828283 -0.11130050505050526 -5.360101010101005 0 1.2664772727272768 -0.0520833333333337 -0.15416666666666667 -2.2083333333333357 -0.40991161616161076 -0.8044823232323233 2.550189393939399 0.3496212121212121 12.79375 -1.1668981481481504 0.008333333333333304 3.5058922558922587 0.9452441077441034 0 0.8502525252525253 0 4.532281144781146 2.7416666666666667 0.03750000000000009 0 -0.5130681818181844 0.5280303030303031 -0.03958333333333375 4.7829545454545475 0 -2.595833333333333 0 0.6306818181818201 -6.8966750841750795 0 0 -0.1645833333333333 0.75 0.06458333333333321 -41.71940235690236 0 0 0.75 0 -2.520833333333333 -0.08124999999999982 0 -17.388888888888893 0.75 0.13541666666666652 0.75 -0.2440025252525253 -11.234490740740725 4.777904040404042 -4.25555555555555 -0.09583333333333321 0 -0.29324494949494984 -4.155955387205392 0.75 0.75 -0.957007575757576 1.5813341750841776 17.87420454545454 -0.3740109427609448 0.05429292929292928 0 3.478451178451187 0 0 -2.3864478114478054 0.6571969696969697 5.054608585858587 -0.3964015151515152 -0.17708333333333337 -0.13750000000000007 0.75 -22.1319962121212 -0.07828282828282651 0 -1.902083333333331 0.75 -0.050000000000000266 -2.0926136363636365 -7.354566498316501 0.09078282828282846 0.75 0.7092803030302981 -0.13750000000000007 0 0.09166666666667411 0 2.552083333333333 0.20833333333333326 1.7905303030303084 0.15500000000000014 1.2571338383838433 0.8895833333333334 0 -4.728030303030298 5.143939393939389 1.3335227272727286 1.1204545454545505 1.3333122895622918 -12.94341329966329 -0.014583333333333393 0.06875000000000009 0.75 -0.9356060606060606 0 0.02083333333333326 -1.8077651515151516 3.735732323232323 -1 0.10473484848484382 0.30505050505050535 0 -3.8704966329966304 12.097735690235695 0.75 -1.9757575757575758 -5.28348063973063 -1 6.403219696969697 4.41375 0 1.6333333333333384 0 0.75 -3.794465488215483 -0.9782828282828255 -2.7653409090909093 0.060416666666666785 -1.06875 0.7437499999999955 10.507933501683507 1.2270833333333333 0.006250000000000089 0.75 0.7643518518518542 -0.07916666666666661 -0.8772306397306422 -0.5740319865319838 -12.078682659932644 4.517508417508413 0 1.4572348484848532 -0.05625000000000002 1.386174242424247 -0.08124999999999982 0 -2.39375 -1.2042803030303033 13.517066498316503 0.7075757575757575 1.5151304713804694 -0.4532196969696969 0.5200757575757575 -0.2416666666666667 0 -1 -1 0 0.13672138047138538 -0.014330808080808222 6.285416666666669 -2.489583333333334 4.891224747474751 0 -1.0009090909090905 0 3.726031144781147 3.656249999999995 -5.078724747474745 0 -7.045601851851855 0.8684343434343478 0.7666877104377128 0.6628787878787907 -22.71231060606061 0 0 -0.014583333333332948 0.41799242424242444 0.876830808080808 -0.3905934343434343 0 1.7175757575757546 0.125 -0.039583333333333526 1.5521885521885577 -1.0592803030303028 -0.002272727272727204 0.7077651515151517 -0.40946969696969693 5.734764309764309 0.38710016835016825 -11.982849326599311 -13.579377104377095 0.027083333333333348 -0.5785984848484875 18.97053872053871 0 0.5043981481481526 0.75 13.939962121212124 -36.58061868686868 0.75 -2.3625000000000003 -0.2753998316498365 0 0.8054924242424268 0 0.75 0.75 -0.47411616161616166 -4.562647306397304 -19.423611111111093 0 0.18295454545454515 -0.6943181818181816 0.016161616161616044 3.050189393939387 -0.07556818181818192 -0.6052609427609394 -3.591582491582489 1.464583333333338 -0.02367424242424243 2.0291666666666712 1.0975378787878811 -2.9634469696969696 10.04854166666667 -1.3640782828282805 0.75 0 0 -1.2765782828282795 0 -4.214583333333334 0 -0.02083333333333348 0 -0.002083333333333326 -2.5083333333333333 0 0.75 -1.192045454545452 6.494276094276093 3.2380681818181842 0.5512626262626259 0.8895833333333334 -1.6282828282828261 -37.68794191919192 1.1251893939393836 -0.27619949494949503 0.058333333333333126 0 0.5478535353535405 0.7020833333333333 0 -4.330479797979794 -21.97573653198654 6.921534090909095 0.75 0 0 0.40984848484848513 -2.2357575757575807 0 0 0.6075336700336729 0.6467803030302983 -0.34791666666666665 0.75 0.5921296296296323 -0.6452651515151515 2.4145833333333337 9.564772727272727 0 1.159583333333333 -0.540909090909095 -11.507912457912443 0 0.75 0 0.7402777777777778 0.48958333333333337 0.8770833333333333 1.2113636363636366 -1 2.7632996632996676 0.6081439393939441 -0.07083333333333308 0.10625000000000007 -2.4187499999999997 1.3118265993266036 1.8583754208754255 0 -1.1458333333333335 -0.5147727272727272 0.008333333333333304 5.365757575757563 3.1788720538720563 -0.8003787878787878 2.1211489898989875 0 0 0 4.945559764309767 0.75 -1.2876893939393914 0.002083333333333437 0 3.199368686868698 1.7900378787878786 2.7756944444444387 -0.3107954545454521 -0.3861742424242447 -33.833333333333336 -9.965113636363636 -1.3537878787878788 2.4170454545454567 -2.1025252525252527 0.75 1.048400673400678 -1 -0.37916666666666665 3.3290684624017857 -2.5702230639730614 0 4.142992424242419 -0.3645833333333335 0.03411195286195934 0.10208333333334085 -1.8242887205387173 1.791161616161621 0.75 -0.19166666666666687 2.762058080808081 1.4227272727272766 0 -0.7503156565656521 3.492697811447813 0.12708333333333321 -11.1349537037037 -0.44905303030303023 1.5291666666666646 -1.915151515151515 0 -3.29375 1.695833333333338 0.05625000000000013 -1.0721380471380466 0 -0.3916666666666666 -0.3145833333333333 -2.8839436026936003 3.932260101010103 -0.20833333333333337 0.8032196969696921 2.6912457912457937 0 3.0317760942760965 0.48390151515152 0.19981060606060863 1.8452651515151537 0 0 0.6471590909090907 0 0 -0.16249999999999998 0 -0.3267045454545454 1.40625 0.75 0.75 -0.4869318181818183 1.5604166666666646 10.736279461279453 -0.17499999999999993 -1.2645833333333334 7.232112794612798 0.029545454545454652 -1.6690446127946155 -0.7270833333333309 1.6941287878787878 -2.6033459595959623 -0.15833333333333333 0.9860479797979773 -0.7121212121212122 -0.08125000000000004 0.75 0 0 0.75 -0.48844696969697 2.3577651515151583 0.75 2.9136994949494923 8.276515151515152 0.9335227272727225 -3.8884048821548762 0.75 0 0 0.75 0.34166666666666656 0 -0.6354166666666643 -0.12291666666666656 -11.319318181818181 0.24375000000000002 -15.594612794612784 -2.525 -1.192929292929287 0.31136363636363185 8.59564393939394 -0.08958333333333335 0 -2.645328282828283 0.38295454545454544 2.3439814814814754 -0.35132575757575735 -0.34242424242424496 0 -1.334890572390572 -1 0.01666666666666672 1.585606060606061 3.2215488215488266 0 0.3410353535353483 0.8812499999999999 -1.0210227272727253 0.039583333333333304 0.06874999999999987 -0.7066919191919192 -1.217824074074072 -0.1875 0.04583333333333339 0.06041666666666645 -1 44.07242424242424 1.3875000000000002 0 2.930808080808083 0.04583333333333339 -0.03661616161616166 0.9397937710437709 0 0.31811868686868694 18.498113636363634 -0.37880892255892196 0 -8.2507196969697 0 9.674999999999997 0.75 0.26041666666666674 0 1.0353114478114431 0.008333333333333415 0.75 1.0794191919191876 -1 9.890586419753081 0.0416666666666663 0.9554924242424196 1.6795454545454547 -0.2642045454545454 4.269444444444447 0 -0.15486111111111112 -0.014583333333333393 0.07499999999999984 1.3539772727272696 0.5482954545454546 0 -0.03750000000000009 0.75 -2.439583333333333 7.489078282828277 1.455765993265996 -2.3210858585858576 -11.036405723905713 5.837920875420878 -2.399431818181816 -13.973716329966319 0.75 -0.12708333333333333 -0.592045454545447 -0.27563131313131306 0 -0.01041666666666674 2.2589646464646442 3.1511363636363683 3.4066708754208754 -2.663341750841747 -0.14642255892253964 1.1347432659932684 0 -0.3275673400673349 0.9924452861952886 -6.43093434343434 14.655303030303026 1.4119107744107744 0 -1.3672979797979772 0 -0.44330808080808337 1.0804292929292956 1.257870370370373 5.289962121212122 0.2604166666666665 0.75 0 -0.43421717171717156 -31.325126262626252 -0.054166666666666474 -2.2668139730639694 3.054545454545452 -1.5149621212121187 -0.4626262626262605 0 0 -0.4369318181818207 0.75 -0.16041666666666665 3.3625 0 0 1.5422348484848425 0.75 -0.039583333333333304 -1.8839646464646478 -0.12916666666666665 0 0.18958333333333344 0.85075757575758 0.75 -0.4617424242424242 0 0.7934974747474794 3.71197390572391 -1.4878787878787856 0 -2.0704545454545427 0 0 0 1.6285984848484802 0.04583333333332629 -3.183143939393942 0 -1.927967171717172 0 -3.1271464646464597 0 -1 -1.1355639730639755 2.4593434343434364 0 1.83125 0.2272727272727273 0.4979166666666667 0 0.5980218855218876 -2.441961279461282 1.5826388888888858 0 1.2 0 -0.9601641414141393 -2.4361742424242374 0 -0.030681818181818254 0 -0.3566287878787878 -0.5658459595959595 0.75 0 0.9666666666666668 1.631250000000005 -0.8643939393939419 -0.21561447811448264 -0.15416666666666679 0 0 0.03124999999999989 15.376590909090906 0.11685606060606046 0.004166666666666541 0 1.7499999999999976 0.10416666666666674 -0.06041666666666634 -0.6371843434343378 -0.30827020202020206 0.6765782828282778 0.2785227272727271 -0.20170454545454808 0.7782828282828282 16.545795454545456 0.75 -0.19026515151515144 -1.825631313131313 1.13125 -0.1596590909090908 1.2797348484848485 0 0.7315025252525252 0.006249999999999978 1.0868055555555571 -0.002083333333333215 -0.24924242424242427 -0.3262836700336649 0.6687500000000001 0.3998106060606017 -0.7176136363636367 -0.010648148148143521 -0.47791666666666677 0.4722727272727285 0.4128787878787836 -0.6219696969696948 -0.8227272727272728 -0.5944654882154858 -11.962310606060596 0.9059132996633041 -4.009932659932651 0.16628787878787876 -0.0863636363636342 0 0.75 -1.589583333333331 -0.20890151515151523 -5.952899831649837 3.1615951178451196 5.485795454545454 -0.4486742424242425 0.2316919191919189 0.8102904040404041 0 3.9645833333333336 -0.5663510101010099 -1 -1.8448863636363635 -0.1708333333333334 -35.96789141414142 -0.38901515151515154 0 0 4.950000000000008 0.8712752525252526 0 -1.7142045454545454 -0.07708333333333339 0 -1.2204335016835042 0.003514309764321766 -0.033333333333333215 -1.915712682379354 -0.12291666666666679 3.838888888888893 1.428977272727268 -0.42708333333333337 1.2520833333333334 0.8307870370370418 -0.8782196969696967 0.13541666666666652 -0.1791666666666667 -1 -0.9599537037037069 5.3456818181818155 0.12083333333333313 0.8291666666666666 -5.866414141414142 -0.01458333333333317 -1.9536363636363634 -1.118409090909091 0.22916666666666663 0 0 0.2416666666666667 0 1.4359217171717171 -4.276220538720533 3.600505050505047 -46.126620370370375 -4.7265572390572395 -0.08983585858585852 0 0.11994949494949503 0.012500000000000178 0 -2.5270833333333336 0.3185606060606059 0 -1.777083333333331 3.7683712121212176 0.04791666666666683 -0.08333333333333348 0.75 16.061363636363627 0 0.8028409090909134 1.9354166666666712 -1.7020833333333312 0 -0.0650252525252526 18.13914141414141 0 0 1.509617003367008 -0.2617424242424242 2.783333333333333 1.7062500000000047 0.6536195286195357 7.161237373737363 0 -0.8844065656565459 1.0625000000000004 0 1.2085227272727312 -0.05208333333333337 -1.5032196969696947 -0.10624999999999996 -3.241351010101005 0.041098484848484995 0.029166666666666785 -0.12474747474747461 -0.26079545454545716 0.03333333333333344 -0.2104166666666647 0.8327651515151562 0.75 0.23550084175083574 -2.435416666666667 0.30435606060606046 1.08125 0 0 0.48996212121212124 1.7109217171717168 0.5513257575757575 0.04999999999999316 -7.256734006734003 1.5109006734006778 -2.5708333333333337 -15.774663299663302 0.07708333333333339 3.34078282828283 0 0.6287878787878742 0.5810816498316498 1.903156565656559 -1.41875 9.964457070707086 0.75 -0.5910353535353536 0.2850378787878787 3.031691919191923 -0.06041666666666701 4.120475589225592 -40.178261784511776 1.3025252525252573 -1.7768939393939394 0.75 -0.15833333333333333 -7.316961279461269 1.102651515151517 -1 2.1470959595959584 0.9270833333333333 1.8774200336700329 0.75 -0.737310606060606 -0.15833333333333333 0.8062500000000048 -1 -0.18958333333333333 -13.336679292929286 0 0.36250000000000004 45.115972222222226 0.4726010101010101 0.75 2.0178872053872077 0.75 -0.01041666666666674 3.0156944444444442 0.6765782828282829 0 5.196843434343436 0.75 0.23655303030303032 -6.410648148148139 0.04583333333333339 0.018750000000000266 0 11.116561447811439 1.0823021885521906 0 0.15467171717171935 -0.5778409090909116 0.8270202020202047 0 -8.49768518518518 0 -0.125 0.022916666666666696 -0.24905303030303028 0 0.756464646464647 0.03541666666666654 1.46875 -0.5621212121212122 0 0.75 -1.6187499999999975 1.6354166666666716 -0.22178030303030305 0 3.941477272727275 -0.04583333333333317 -1.0245159932659913 -5.426241582491569 5.278009259259253 0.018202861952863802 -1 0 -0.8636363636363638 -1.2686868686868684 -1.8791666666666642 5.654250841750841 -0.5092171717171716 -0.029166666666666674 -0.02499999999999991 -0.0854166666666667 -0.2833333333333332 0 0 -2.1478535353535353 0.75 0 4.019128787878783 0.4143308080808079 0.1573863636363635 -1.2486742424242423 -0.43162878787879033 1.2683712121212174 -0.9343013468013468 -0.38497474747474736 0.75 -2.156481481481479 -0.1499999999999999 0 0.5368265993266015 0 -0.3241792929292928 0 -0.04602272727272716 0.2020833333333334 0.8553030303030303 -2.962563131313126 -0.15833333333333344 -0.03926767676767651 -0.7062710437710462 0.5306818181818136 -1.2625210437710415 2.998068181818182 -1.561616161616164 -1.3999999999999977 -1 -2.8722853535353536 -2.917361111111111 0.34791666666666665 0.30541666666666667 -4.727546296296293 -0.016666666666666385 0 6.016287878787879 -40.78263888888889 0.08181818181818179 -0.3291666666666667 0 -0.016666666666666607 -9.3363425925926 -0.12916666666666665 0.5840698653198704 0.31458333333333344 -0.5914141414141414 1.4603030303030358 -0.771590909090909 0 0.18295454545454537 -4.397516835016827 1.1541035353535403 1.7592803030302981 -2.525 0.75 0.49263468013468215 0 -1 1.6426767676767702 -0.6066287878787879 -5.570138888888883 -0.06666666666666643 0.23950757575757575 1.1783249158249107 0.75 -1 0 0.6405934343434344 -1.6666666666666643 -1.6722222222222247 6.877988215488208 -0.4096590909090909 -0.045833333333333615 -0.05000000000000693 0.34374999999999556 0 1.2304924242424242 0.1601430976431002 -9.067824074074055 -0.29595959595959587 0 0.75 0.028093434343434254 0.75 2.6208333333333256 0 -2.223674242424243 5.869204545454545 0 -0.13970959595959842 3.44640151515151 -9.309764309764304 -0.11628787878787694 -1.0740530303030256 0.75 -0.19583333333333308 2.288446969696972 0.08958333333333324 -1.3757365319865298 -0.35132575757575757 -0.9457702020202021 0.5111742424242425 -3.9756734006733927 0 1.5419612794612851 -3.411300505050505 2.4899831649831676 -0.7178030303030303 -0.023232323232323493 6.238636363636363 -0.15477272727272773 -1.5304713804713783 2.2255050505050527 -0.1479166666666667 14.071299102132425 1.0768939393939394 0 0.8111321548821571 -0.07083333333333353 -2.7327020202020202 -3.806839225589224 -0.14482323232323235 -0.00416666666666643 2.425904882154885 -0.11874999999999991 0.012500000000007283 0.05833333333333335 -1.9491792929292906 -1.1755471380471356 -0.9287878787878787 -4.548947811447802 -6.447083333333337 0.37916666666666665 0.7102272727272727 -0.24703282828282846 -0.08749999999999303 0.49981060606060557 1.8528409090909137 -0.21887626262626259 0.75 0 -5.03364898989899 -1.6124999999999976 0.6602272727272775 0.75 0 1.401094276094271 1.1344696969696966 -0.031249999999999778 0 3.9333333333333336 3.0854166666666716 0 0 -0.700441919191916 0.751136363636359 -1 0 2.152083333333338 0.6041666666666694 0.1437499999999996 0.873611111111111 0.11458333333334014 0.5535984848484816 -0.5979166666666667 -0.3397727272727271 -16.166666666666668 -2.520833333333333 -0.15416666666666667 0 -1.7395833333333308 -2.030765993265991 0 49.09791666666667 1.3 0.8051136363636313 0 0.75 1.0579545454545407 1.6437500000000047 -0.006250000000000089 0.7113636363636315 0 3.4901515151515103 -2.378367003366998 -0.4159090909090908 0 -38.82087542087542 -0.2714225589225583 0 -13.681439393939389 -0.5266835016835061 0.9720959595959544 -1.3897937710437722 -0.44507575757575757 2.217866161616162 6.145370370370369 9.935101010101016 0.2603535353535351 0.2910984848484848 0.2662878787878785 0.1312500000000001 0 0.5255050505050505 -6.567041245791234 -0.1791666666666667 0.75 -0.9030303030303013 0.09166666666666701 -0.5855429292929293 -0.3916666666666666 -13.909890572390562 0 0 -1.0604166666666641 -0.20435606060606082 0 0 1.239057239057244 1.2875 -0.17140151515151514 0.18333333333333335 -1.994709595959594 -2.5541666666666663 -2.4020833333333336 0 -3.536847643097635 2.9387836700336725 -0.23371212121212115 16.755008417508403 -2.4604166666666667 0.8729166666666667 0.052504208754208914 4.418038720538717 0.7606060606060605 -1.7645833333333307 -0.4226010101010078 4.25429292929293 -0.4617424242424243 1.3825968013468062 -2.163194444444448 0 0.094949494949495 2.954819023569026 2.803282828282829 0.024999999999992584 3.1419612794612815 0.8708333333333333 0 -0.015277777777777835 0 2.3666666666666667 -2.11344696969697 -1.914583333333331 -0.45587121212121207 0.12897727272727244 -0.6285984848484849 -1.2884469696969674 -0.06262626262626747 -2.4270833333333335 -0.2437499999999999 3.6070707070707093 -0.05625000000000002 -0.14374999999999993 0.07916666666666572 -1.268939393939392 -0.8840909090909093 1.8562500000000048 -0.35890151515151514 0.3569865319865372 0.5790404040404087 1.3095328282828338 2.793244949494947 -0.1812499999999999 2.625803030303029 1.6125000000000047 -2.2354166666666666 0 -8.969907407407394 -0.1499999999999999 0 4.683838383838374 0.7843434343434392 -0.28125 0.6673611111111112 1.1445707070707065 -2.4556818181818185 -0.5177819865319846 0.7956439393939347 0.060416666666666785 0.23718434343434358 -0.9916666666666645 -2.5041666666666664 0 0 0 -5.588952020202014 0.75 -1 0.9788510101010117 -0.15366161616161844 -0.795770202020202 15.934393939393932 0.383080808080803 -0.035416666666673535 0.002083333333333215 0 1.2354166666666666 2.0358585858585823 -2.043371212121212 -0.4486742424242449 1.7291666666666714 -0.24135101010101023 0.3222853535353538 0.7509469696969651 -2.9229166666666644 0 -11.420412457912445 0 0 1.219949494949495 -0.044128787878788156 -0.3700757575757603 -1.8499999999999979 -1.7937499999999975 1.2524621212121168 -0.00410353535353547 -1.1331439393939393 0 14.529734848484837 -1.7059343434343432 0 -0.90549242424242 3.4937499999999977 0.75 0.75 1.1371212121212173 0.75 -0.15829124579124354 0 -0.4117424242424219 0 0.05625000000000002 2.438257575757569 -0.1333333333333333 1.0125000000000002 -0.08541666666665959 -11.368329124579109 0.7087121212121211 -2.492676767676768 0 0 0.849242424242429 0 0 0.050000000000000044 -1.9898989898989896 -0.15833333333333333 0 -2.5618055555555554 -0.2791666666666667 -0.4148358585858586 0.75 0.0013678451178427142 -0.14166666666666683 -0.645833333333331 0 -0.10000000000000009 -8.694659090909092 1.6448863636363682 -44.93657407407408 -1 0.06357323232323209 -0.5357954545454522 0 -0.33200757575757567 0 2.4020833333333336 0.7333333333333334 -0.7928030303030305 -2.4833333333333334 -1 0.38573232323232265 0.15625 0.3907196969696968 -1 4.5462121212121165 0 0 -44.59057239057239 -0.32832491582491485 0.08749999999999969 0.38005050505050497 -0.8737373737373713 -10.566750841750835 1.6583333333333377 1.6291666666666715 -1 -0.1687500000000004 0.6746212121212118 3.192647306397304 0 -1.7958333333333307 0 -0.29520202020202024 -1.1425925925925888 1.0817129629629627 2.878661616161616 -1 -0.02708333333333357 0.2653409090909087 0.027083333333333348 -0.01458333333333306 -0.07916666666666683 -1.1356902356902334 1.8522727272727204 0 0.30000000000000004 0 0.75 -0.07916666666666661 0.2475378787878788 -0.08124999999999982 2.335942760942765 -0.06874999999999998 -3.9057870370370367 -1 0 -2.6907828282828286 -0.8748106060606062 -0.6382575757575757 0.42194865319865515 0 0 0.4660774410774424 -1.2875 2.3360900673400673 -4.474221380471375 0 1.223295454545459 0.6279461279461305 0.9062710437710475 0.3748737373737372 0.0699494949494951 -1 0 0.9696759259259311 -0.5513888888888889 -3.227651515151513 0 -1 -3.010113636363637 -1.373190235690236 -2.6177609427609454 -1.57718855218855 1.488295454545454 0.8370580808080827 -1.495833333333331 0.2833333333333332 -0.5556186868686867 0 -0.9737373737373716 -0.29261363636363424 0 0.125 0.23743686868686853 0 0 2.2333333333333334 1.6249999999999978 0 -0.15208333333333335 0 -3.877777777777781 3.924999999999997 -0.30662878787878545 0 0.75 -1.4166666666666643 -1.423211279461277 0 2.812499999999997 0.75 0.120328282828283 -1.8890151515151512 0.5021464646464648 0 -0.6665404040404039 -1.789583333333331 0 -0.11458333333333348 -32.551893939393935 -0.2751893939393939 0.013194444444444398 0 0 0.7895833333333334 0 0 0 -0.09375 -29.045833333333334 -0.34715909090909103 0.7104166666666667 0.5715277777777796 -1.021590909090909 -0.20654461279461556 -1.4797138047138025 0 0.921780303030308 -3.0842171717171754 0.9842803030303079 0 -0.06874999999999998 -0.04583333333333339 -6.874221380471376 1.618750000000005 -0.03541666666666665 3.3979166666666667 0 -0.4418560606060633 -1.2100378787878814 -0.01041666666666674 -0.18453282828282813 19.342592592592585 0 0 -0.007272727272727764 0.13017676767676778 -0.7053240740740736 -4.683712121212118 -12.553682659932651 -13.034217171717163 -6.672685185185189 -0.29034090909090915 2.105871212121217 -0.027083333333326243 -0.7702651515151515 -0.3200126262626264 -0.3770833333333333 0 -0.09004629629629868 -0.2291666666666643 0.687878787878788 0.00208333333333377 -4.607499999999995 -4.641898148148143 0 0 1.2645202020202069 -0.5916666666666643 -0.4390782828282829 -0.4183712121212122 3.810416666666667 0 1.4295454545454502 -3.148260381593717 -0.07291666666666696 0.464583333333338 0.7172979797979798 -1 -3.8326388888888854 -1 0 0.75 -1.1791035353535348 -0.16249999999999987 0.05625000000000002 0.01666666666666705 -1 1.217234848484853 -0.039583333333333304 -25.562163299663293 3.72960858585859 3.02348484848484 0.0625 0 0.02083333333333337 -0.3498737373737373 -1.232895622895621 2.0522727272727272 -7.925416666666666 5.192234848484851 0.4530303030302987 -0.39583333333333326 1.789583333333338 -3.5708333333333333 18.69791666666667 -15.903556397306394 0.75 1.6979166666666645 0.75 0.05625000000000013 -0.31799242424242435 0.9083333333333286 -0.30972222222222223 -42.76188973063972 0.75 -0.3554924242424242 -1.049705387205385 -1.8343855218855216 0 0.7604166666666666 5.393623737373739 -0.08125000000000027 0.75 -0.29166666666666674 1.0187499999999998 0 0 0 0.75 0 0 2.1392255892255907 0 0.017234848484853238 0 0.2528409090909093 -3.700416666666667 9.7723569023569 -1 1.1744318181818203 1.620833333333331 -0.13541666666666674 -0.045833333333333615 -0.050000000000000266 42.59950378787878 -1.2903409090909068 -1.2020833333333334 -22.592866161616165 0.6332070707070709 -5.245622895622894 -0.8585858585858539 2.4291666666666667 -0.01666666666666683 0 -0.7687499999999976 0 0.9029671717171718 -31.48901515151515 5.383964646464647 -0.2041666666666666 -5.54930555555555 -1 0.75 0 0.1452651515151515 4.92708333333334 -0.40435606060605545 -3.531586700336703 0.022916666666666474 0.75 0 -0.07916666666666683 -2.6333964646464683 0.8416666666666667 -0.5412878787878787 0.018749999999999822 -0.5960227272727294 1.5701599326599354 -0.22916666666666663 1.1869739057239084 -0.7045454545454519 -0.33428030303030765 0 3.693560606060613 2.9253787878787882 5.06458333333334 -22.23375420875421 -0.5714015151515152 0.32310606060606073 1.7395833333333308 -6.994760101010094 -1.7645833333333307 45.74819023569024 4.10625 2.5171085858585833 0.9568392255892297 -0.7893308080808081 -1.7458333333333311 0.75 0 2.2583333333333333 -0.37689393939393945 0 0.025340909090909136 0.2583333333333333 0.75 0 -1.8291666666666666 0 -0.6193181818181748 -0.08750000000000013 0.17499999999999982 0.08749999999999969 29.526936026936035 0 0.19999999999999996 0 -0.043749999999999956 0.5356060606060558 0.4900883838383805 3.884722222222226 5.77156986531987 0 -1.617045454545452 0 0 -2.680450336700334 0.2850378787878787 -1.5042297979797956 -1.6928409090909096 0.030744949494945106 -0.5149621212121214 0 -0.1020833333333333 -22.487499999999994 3.131755050505048 0 -0.5669191919191918 -1.6139941077441056 -2.0729166666666643 -0.3958333333333335 -9.090740740740728 0 0 -0.15208333333333335 6.165572390572397 0 -0.8736531986531983 1.4712752525252526 0.441982323232319 0 1.0294191919191917 -0.3988636363636411 0 -0.9760521885521882 0 0.9583333333333334 0.23756313131313123 3.061910774410777 0 -0.07916666666666661 -3.45625 -0.8704335016834994 2.5441708754208845 0 0 -7.2879797979798 0.050694444444444486 0.75 -3.482954545454543 13.968518518518525 -1.5383627946127945 -2.0339015151515154 -1.86875 -6.457828282828277 -0.3929924242424243 0.45189393939393496 3.2780050505050555 -31.12392676767676 -0.3485479797979798 -1.3018308080808123 0 0 0 -0.25271464646464614 0.7979166666666666 0.22916666666666652 -0.06041666666666645 0.12083333333333335 -5.73150252525252 1.1804671717171715 -2.9899831649831614 3.1183712121212097 -1.8062499999999977 0.75 -0.06458333333333344 0 0.3043560606060609 2.9597853535353558 -39.414688552188544 -0.7647937710437684 -35.12885101010101 8.807954545454535 1.103030303030303 0 -4.707112794612792 2.1392887205387234 0.8508207070707094 0.25 0 -43.783333333333324 -1.3996338383838416 0 1.128030303030298 -0.22499999999999998 0.014499158249156263 0 -0.039583333333333304 -1 0.006249999999999867 1.5343434343434343 1.76344696969697 3.2875 -4.648106060606061 1.0277777777777801 -0.8010942760942741 0 0.07083333333334063 -1 -0.7546927609427585 -0.2104166666666667 -0.9348274410774415 0.8189393939393892 0.75 -1 -4.0281818181818085 -0.16041666666666665 0.790930134680141 0.46117424242424243 0.9933501683501735 0 0 -1.7647095959595958 2.5312500000000044 0 0 0 0.75 -2.554755892255897 0.5426136363636365 -0.01041666666666674 -3.8451388888888784 -1.4052188552188576 0.9437499999999996 -0.3562500000000002 -1 5.4503787878787895 0.4650252525252574 -0.7895833333333333 0.22083333333333321 -0.12083333333333335 0.3603535353535352 2.62310606060606 -11.643749999999988 -2.7867424242424246 0.08124999999999982 0.7812079124579175 0.7507786195286146 -0.8247053872053849 1.7541666666666713 6.402840909090905 0 0.7663510101010101 -0.13510101010101438 0.5486742424242426 14.325168350168346 -0.6899621212121212 2.620833333333331 -39.659701178451165 0.05624999999999991 0.75 -0.11249999999999294 0 -13.641771885521875 0 0.12083333333333313 0.8571969696969726 -0.5117424242424242 0.15625 0.2729166666666667 0.7111742424242424 -3.415404040404032 0.75 -4.250757575757573 0 0.75 5.320959595959596 -1 0 4.298926767676747 -1.212121212121212 -0.549452861952862 0 -0.19267676767676767 4.5723905723905744 -1.2262836700336663 -0.05833333333333335 -0.5637500000000002 -0.2476641414141414 -7.429692760942752 -0.12083333333333335 0 -0.22619949494949498 0 -0.01458333333333317 -1 -2.190340909090909 -1.3640993265993224 -0.733333333333331 0.031565656565656575 0.32058080808080813 0.4113005050505053 -1.3884048821548758 0.75 1.75 0.41054292929292924 -0.029166666666666785 0.1795454545454569 27.078030303030303 2.43125 -3.19936868686869 -0.22045454545454812 0.31799242424242413 -8.845307239057234 -4.604987373737372 -5.930029461279455 -0.7396464646464646 1.0437500000000002 -44.42285353535353 -16.324810606060606 0 -1.5134890572390551 0 0 0.17310606060606082 -0.7026515151515129 0.75 -5.765404040404039 -1.7197601010101011 1.8289562289562311 0.75 0.5619318181818208 0 0 -38.94250841750842 38.25056818181818 -23.36567760942761 -0.9159722222222271 0.26458333333333317 -0.25277777777777777 10.525294612794625 4.97083333333334 -0.8381944444444445 -0.1910353535353535 1.2499999999999998 -0.012689393939394056 -1.6134048821548785 0.669696969696965 0.75 0.75 0.75 0 -0.36525673400673164 -2.0957070707070686 1.4971380471380522 0.643181818181813 0.15643939393939432 -6.760942760942752 2.6937499999999996 0 0 -0.34048821548821073 0.12916666666666665 -0.3485479797979798 0.75 0.75 0 1.1569444444444446 0.75 1.1489478114478135 3.3625210437710398 0 -0.26035353535353534 0.09375 0 0 0.75 0.022916666666666585 0 -0.12645202020202018 0 0 -0.06458333333333344 0.75 2.5145833333333334 -0.002083333333333437 -1.6062499999999975 1.2117424242424242 1.1511363636363687 0 0.41666666666666674 0.75 -0.06666666666666665 3.55625 4.226830808080816 0.19614898989898988 7.855155723905732 0.03125 -46.71176346801347 -0.49577020202020217 -2.3188552188552163 -1.9295454545454545 0.8395622895622943 2.4458333333333333 -0.4122895622895646 0.40909090909090906 1.5416666666666619 -0.8078282828282828 0.24791666666666679 0.75 -0.26988636363636354 -0.6625631313131313 0 0 -12.77161195286195 1.9611321548821572 6.9488846801346815 0.75 -2.4629208754208705 -1 -0.373989898989899 0 7.644760101010087 0 0.1708333333333334 2.8354166666666667 0.75 -0.21666666666666656 -2.6390151515151405 0 -0.8236531986531936 0.06363636363636371 0 -2.6187500000000004 7.7164015151515155 6.192045454545453 1.2786405723905725 0 19.685332491582486 -0.20833333333333337 0.75 0.162815656565657 -47.11666666666667 0 -1.5062499999999976 -0.8388888888888888 2.6604166666666664 0 0 0.6895833333333334 -2.4479166666666665 0.03750000000000009 1.5006734006734057 0 0 -0.008333333333333304 0.10416666666666674 -4.418623737373732 0 -0.9443181818181794 -4.649221380471368 -2.4541666666666666 0.75 -0.29993686868686864 -0.029166666666666563 6.37291666666667 -2.1931818181818206 -0.6433080808080808 -0.02499999999999991 -2.8638257575757553 -1.4693813131313131 9.617487373737385 0 0.010416666666666519 -1.8443181818181817 0.75 1.0583333333333333 0.5598484848484874 0 -1 0 0 0.06875000000000009 -0.0854166666666667 0 9.251746632996635 -0.10397727272727275 -0.41174242424242435 -1 -0.03333333333333344 0 -0.21250000000000002 -2.0005681818181813 0.044423400673402114 -1.0033459595959573 -1.7497685185185161 0 -0.002083333333333215 2.075568181818182 -1.7937499999999975 -0.006249999999999645 -1 -11.751178451178436 0 0 7.628181818181819 -0.5827230639730592 -1.8666666666666643 -2.978409090909091 0 -0.6956439393939394 0 0.75 -2.404166666666667 0.06931818181818139 6.672530864197529 0 -4.640046296296292 0 0 -2.990643939393939 0.20734427609427764 1.6493265993265984 -3.2759259259259217 -2.1265782828282807 0.75 0 0.27215909090909074 -1.7770833333333313 -0.8288720538720489 0.03749999999999987 -1.789583333333331 0 0.6955176767676741 -3.69375 -0.5346590909090909 -0.34791666666666676 0.75 -3.0153409090909093 5.13125 -0.42354797979797976 0.75 0.75 -5.292403198653195 0.6871001683501636 0.75 0 -7.72819865319865 0 0.95625 0 0 0 0 -39.6243265993266 -14.014751683501673 -0.4230429292929293 0 -0.48710016835016634 0.11458333333333326 0.487752525252525 0 0.22727272727272751 -0.6743686868686869 -4.970517676767671 -0.23760521885521224 1.6481818181818175 2.889478114478117 2.5183080808080778 0.6159932659932612 -1.2625 0 -1 0.75 -1.0637415824915801 +scenario heads-up gto-small (blind) +deals 3000 +seed 1592590337 +counts 15293 14 0 +samples 0.75 0.7248106060606061 0.5176136363636319 1.0909301346801392 0 1.1083333333333334 -1.3104166666666668 0 0.4481902356902405 0.18465909090909083 -0.507449494949495 -7.487436868686869 2.5344696969696967 -7.777735690235696 2.2882575757575756 0.75 0.12020202020202087 -0.016666666666666607 0 -0.1958333333333333 -0.01325757575757569 0 -34.09469696969697 0.02500000000001279 0 0.8289772727272727 0.16665404040404086 0 3.182449494949495 0.06134259259259567 -13.252125420875425 -1.927840909090909 0.3767045454545457 5.262394781144784 0 2.770833333333333 -13.366498316498316 0 -0.7900946969696934 -1.0899621212121213 0 0.5535984848484801 -1.466074494949492 -0.23308080808080822 0.20606060606060606 0.75 -0.4368939393939395 -23.26205808080808 -0.11912878787878789 -1.9098484848484851 1.5243686868686868 0.75 0.4835227272727276 0 0 10.105303030303023 0.4605008417508438 -0.14583333333333326 0.24545454545454515 -0.02430555555555558 -1 -0.5983585858585859 0.75 0.75 0.7993055555555548 -0.27500000000000013 -1.758333333333331 -0.004356060606060641 -1.5823232323232324 3.7075547138047167 1.20625 1.2541666666666669 -0.4264730639730616 -1.2081439393939446 0 0 -0.4249999999999998 0.8616792929292929 0 -1.9287878787878787 0 -0.20296717171717393 -1.1150252525252529 1.987899831649833 -5.045412457912461 -0.28636363636363904 -3.892508417508423 0.016666666666666163 0.75 -2.8013257575757575 -4.160833333333334 -2.1166666666666667 -1.3627946127946124 3.993181818181818 2.2666666666666666 1.7337121212121211 0 3.5925715488215513 2.2416666666666667 2.6024621212121213 4.187121212121207 0.10416666666666674 0 0 0 -2.3712752525252525 0.22916666666666652 2.625 0 -0.4876893939393939 -1 11.218897306397317 -0.6880681818181817 0.6362373737373737 -2.4791666666666665 0.019507575757570894 -7.444128787878788 -11.698442760942758 -2.967992424242424 -0.2821969696969697 -0.15416666666666667 -1 -0.3675505050505051 -0.13750000000000007 0.75 -1.349831649831649 -0.0625 -0.15833333333333344 0 0.3368476430976406 0.9310606060606066 8.188257575757575 -0.24614898989898992 0.7405303030302981 0.9626893939393986 1.2709595959596012 0.5531776094276188 0 -2.122159090909088 -0.4666666666666668 0 -0.9567550505050504 -1.2458333333333336 1.5562500000000048 12.204061447811458 2.9047348484848436 0 -2.5229166666666667 0.8040824915824907 -1 -1.1541666666666668 5.5718223905723985 16.004166666666666 0 0 0.75 0.75 -0.5868686868686868 -0.08396464646464907 2.0910984848484846 0.002083333333333437 0.661489898989899 0.185606060606061 -44.54375 0.75 4.851346801346795 -2.5 0.6092803030303031 0 -0.10833333333333328 0.34128787878788147 0 -1 0.5804924242424241 -0.18503787878787858 0 -0.5925126262626261 0.01041666666666674 0.039583333333333415 4.141666666666671 0 0 -0.5972222222222223 0.9840909090909091 1.1874999999999996 0.34185606060606055 -1.2770833333333336 -0.04791666666666661 0.12708333333333366 0.8287878787878791 9.674999999999997 0.24962121212121202 0 -2.290568181818182 -3.0640151515151537 -0.07499999999999996 0 0.015361952861954853 -1.4458333333333333 -8.632007575757576 0 -0.9374999999999973 -0.30827020202020206 0.34185606060606055 -3.4726641414141364 0.5295454545454561 -0.35 -1.1157196969696923 0.5112373737373737 0 4.0103745791245755 2.345833333333333 -0.28630050505050497 0 -0.5208964646464647 0.018750000000000044 0.866540404040404 0.2484217171717218 0 -4.800063131313135 0 0.4492424242424242 0.75 -0.3522727272727273 0.75 -0.18541666666666679 -0.061489898989899094 0.8479797979798003 -0.08541666666666692 -18.07 -2.8866792929292933 -0.15833333333333333 -2.703787878787874 -1.1378787878787877 0 0.19204545454545463 -0.7032828282828283 0 0.75 -17.576262626262626 -1.8374999999999977 0 2.9813131313131316 0.75 0.33125000000000004 0 -0.48939393939393927 0.40625000000000466 0.75 0.75 0.75 0.8374999999999955 -0.330113636363639 0 -0.13958333333333328 0.16003787878787867 -0.017045454545454586 -0.9007575757575756 0.5759469696969697 -1 0.6061447811447763 -1.0104166666666643 1.151641414141415 0 0 0.871338383838383 2.6625 0.75 -0.01041666666666674 0 1.2325757575757574 0.75 0.12828282828283122 0 6.114709595959598 3.085122053872056 -3.6348484848484843 0.24128787878787872 -3.0403409090909093 1.0604166666666668 0 0.38882575757575744 -0.2354166666666666 -0.15227272727272723 0 -0.259848484848485 6.421464646464648 0 -0.7871212121212121 -0.45498737373737375 -0.8681818181818177 0.29583333333333095 2.6507575757575808 0.36250000000000004 -2.1378787878787877 -1.095959595959596 -5.324179292929296 0.9693181818181813 -0.9500631313131289 0.866666666666662 -1.8091540404040458 -0.21079545454545456 5.049909090909095 -0.06875000000000009 -5.196611952861946 1.6186447811447855 1.9612500000000002 -0.6498106060606057 0.75 0 0 0 0.32272727272727253 1.3123737373737372 1.4085648148148102 0 -2.0689393939393943 0.75 0.12083333333333335 0 -0.06458333333333344 -2.3460606060606057 -1.5812499999999976 -0.31117424242423963 40.49488636363636 -1.1619696969696922 0 -0.2825757575757577 0.399368686868687 1.0291666666666668 -0.3773358585858585 0 0.75 3.3833333333333333 -0.014583333333333393 0.75 0 -1.2668560606060604 0 1.907828282828274 -0.5890151515151514 -1.1104166666666666 0.6060606060606015 0.46022727272727293 0.75 0.75 -0.35820707070706814 -0.25151515151515147 0.7343644781144829 0 0 -1.0214015151515126 -2.46875 -0.5380681818181821 2.8816077441077463 -1 0.5378787878787878 0 -0.2666666666666666 0.75 0 0.36948653198653725 -2.6092171717171717 0 0.1960227272727273 1.0792297979798002 -1.3660984848484847 9.674999999999997 -0.10833333333333317 0.4538299663299634 5.685816498316497 -0.09166666666666667 0 -0.14166666666666683 -1.643118686868687 0.75 0 -0.061868686868691514 0.09375 -41.313257575757575 -0.611237373737374 0.03623737373737379 0 -4.154166666666675 -2.2513257575757626 -0.6583333333333332 -1.4625 -1.275 0.75 -6.415509259259265 1.3534722222222186 -0.7350378787878784 -1.2791666666666643 0 -6.19109848484848 -1.8312499999999976 0 0.08503787878787872 -1.2427188552188597 0.75 3.5829545454545455 2.277967171717176 -1.392361111111111 -1.874747474747475 0.033333333333333326 -2.7825000000000033 2.7548484848484858 -6.6065235690235635 0 0 0 45.77474747474748 0.02083333333333326 0.9570075757575758 -1.3604166666666666 0 -0.16249999999999998 0.75 -0.29326599326599756 0.6543560606060559 -0.030303030303030276 0.10303030303029859 0.0458333333333405 -0.6123737373737366 -0.44286616161616443 -0.15404040404040842 1.443371212121212 -2.927209595959596 -0.10416666666666663 -1.7332702020202073 1.0208333333333333 0.14545454545454595 -0.6924242424242424 -1.696590909090907 4.844549663299663 -1 -0.8890151515151512 0 5.5805555555555575 -0.05896464646464672 2.5206818181818185 0 1.0333333333333332 0.022201178451181303 -11.541022727272729 0 0.8287878787878789 0.029166666666667007 1.568939393939394 0.8583333333333332 1.1708333333333356 0.8557449494949516 2.9506313131313155 1.1854166666666666 0.7152146464646436 1.3965909090909137 5.965404040404039 -0.4263257575757575 0.35397727272727253 -1 0.8293560606060606 -0.033333333333333326 0 -2.0734848484848483 1.053367003366993 -2.104166666666676 0.22291666666666665 0.03958333333333308 0.6926136363636364 0 0.5633207070707087 0 1.7003787878787877 0.5893939393939394 2.2229166666666664 10.165972222222223 -0.004166666666666652 0.5635101010100965 -0.125 1.5668560606060558 0.5783670033670059 -0.04562289562290012 1.3416666666666668 -9.220580808080808 1.8958333333333335 -6.9911616161616195 0 -0.049789562289559885 -0.7470328282828285 2.5916666666666597 -41.78480218855219 -0.883333333333336 5.336363636363637 -0.054166666666666696 0.23226010101010086 0 0 -0.1678661616161663 -0.20833333333333337 2.25 -0.7537878787878789 0.75 2.6416666666666666 18.329292929292933 0.012962962962967284 -0.9719696969696972 0 0.9270833333333334 1.4124999999999999 -0.11875000000000002 0 0.75 -0.16344696969697003 0.6763257575757577 -0.7922979797979797 1.48106060606061 0.07083333333333353 0 0.75 0.75 -1 0.34090909090909105 5.152588383838384 -0.3145833333333381 0.16388888888888875 -2.4645833333333336 0 0 -1.9430555555555538 -4.181250000000005 -0.6851641414141458 1.1416666666666668 0.75 -0.9935606060606057 0 3.0668560606060606 -0.12291666666666679 -0.4843434343434344 -1.8058712121212173 -2.6437500000000003 0 -0.12916666666666665 0.23819444444444438 0.75 0.19374999999999987 0.9357744107744133 0.75 0 -0.26041666666666663 0 -0.419746212121213 0.9004419191919191 0.5051136363636366 0.9472222222222282 -0.0333333333333401 -1.3578409090909096 1.5152146464646459 0.1812499999999999 0.23756313131313123 0 -0.06584595959595951 0.08124999999999982 -0.5140151515151512 -0.6857954545454545 -0.99185606060606 1.2333333333333332 -7.906944444444445 -0.035416666666666874 0.02499999999999991 -1.4354166666666643 -0.3208333333333333 5.27549242424242 0 0.23150252525252524 -0.039583333333333304 1.1470833333333332 0.09187710437710672 0.02083333333333326 0 -0.5727904040404039 -0.7729166666666667 -0.18125000000000036 0 -1.3729166666666666 0.75 -0.07708333333333339 0.75 -0.42165404040404053 0.75 0.75 0.75 -0.01041666666666663 0 -1.0263257575757576 -1.1749999999999998 -1.0661826599326671 0 -3.3369781144781143 0.07291666666666652 -1 -2.3280303030302987 1.5323021885521935 0 0.19374999999999987 0.75 0.75 2.9567045454545444 0 0 -0.6015782828282829 1.1863636363636412 -1.6770580808080728 0.5804924242424243 0.03958333333333308 -0.531628787878788 -0.012499999999999956 2.470833333333333 -4.040088383838384 0 0.75 0 -4.059659090909091 2.181249999999988 0.12291666666666679 -1 0.7363005050505051 -0.04583333333333339 3.8240530303030256 0.7102904040404014 -0.41635101010101017 0 -0.09665404040404058 -1.4247474747474724 -4.981839225589216 0 0.10624999999999996 0 -0.5011363636363637 0 -3.6642676767676656 1.23125 5.901893939393946 0 -2.5 -4.6912457912457874 0 11.882765151515155 -21.175652356902354 -1.0585227272727298 -0.3284090909090909 -0.8458333333333334 -1.9645202020202022 0 0 0.42632575757575775 -1.4712121212121188 0.14747474747474554 -0.10833333333333317 -6.1632996632996715 0 -0.16742424242424248 -0.18125000000000036 0 7.4759048821548735 0.9472853535353536 0 -4.5684974747474705 -1 -0.05833333333333335 0 -0.018750000000000044 0.31907196969696994 0 41.127272727272725 2.4458333333333333 -2.046590909090909 0.6205808080808097 0.9814393939393922 -1 -0.033333333333333326 1.19964646464646 0 0.027083333333333126 -0.6131944444444446 0 -3.3582281144781208 0.9028409090909092 0 -0.5481691919191918 0 -20.4025 0.07916666666666639 -1.2294191919191926 0.022916666666666585 0.10416666666666652 0 0.5994318181818182 8.833291245791244 0 0.19791666666666652 0.22916666666666652 3.228661616161612 -0.04791666666666661 -2.6388888888888893 -0.08655303030303019 -3.2351010101010047 0.002083333333333215 0.054166666666666696 -48.85587121212121 -0.545770202020202 0 0.41119528619528967 -0.44375000000000453 -0.3682196969696965 0.5151094276094303 0.002083333333333437 -1 1.9232954545454537 -1 -1.0256944444444445 4.45215909090909 2.620000000000001 0 0.9104166666666668 3.61875 1.5693181818181863 0 0.75 1.1057449494949516 -2.334343434343432 -0.3093434343434385 -0.40549242424242427 0 0.19166666666666665 3.429882154882155 -8.813699494949494 0 -0.2020833333333334 -1.9428409090909082 -0.09375 -0.07272727272727275 0.18541666666666656 0 -0.0854166666666667 -3.390530303030303 0 -26.524537037037035 0.75 0 0 -0.7721170033670037 0 -0.778409090909091 0 4.34520202020202 0.5482954545454499 -1 -0.15549242424242404 0.7282196969697017 0 -0.11780303030303063 0 0.14583333333333348 -1.0212121212121212 3.993939393939393 -0.21590909090909083 -0.37424242424242427 0 -1 5.383712121212117 -3.372579966329973 0 -0.3209595959595939 1.3041666666666665 0 0 0 0.02651515151515138 -0.2767676767676752 -0.27178030303030587 0 -3.1311868686868687 -7.6775 -2.48125 0 -0.9592592592592595 0 -0.16066919191919204 0 0 1.2374999999999998 -2.2210858585858557 -2.0596170033669985 2.5399200336700307 0.07083333333333341 0 1.6685606060606062 0.1875 0.75 -0.08074494949495392 0.9907196969696969 -2.836742424242429 -0.8520833333333311 -0.32354797979797967 2.540556818181823 1.2625 0.7918560606060607 0 0.6193602693602716 -2.45625 0 0.11250000000000004 -0.49227272727272986 -0.23124999999999996 0.586174242424242 -4.002062289562286 -0.382954545454548 0 0 -2.8884469696969743 0.5593013468013495 -0.30467171717171726 -0.6729166666666644 1.8602272727272724 0.9492213804713832 0.25069444444444433 1.0537878787878787 -7.490151515151515 0.8909090909090913 1.754755892255897 -0.09166666666666679 0.03125000000000022 0 0.75 -0.14943181818181817 0.75 1.1437500000000043 0.75 -3.8270833333333334 0.7888678451178501 0 5.441931818181818 -1.93510101010101 0.2416035353535353 3.034301346801349 0 -1.0268939393939396 0.09375 -30.025883838383837 0.23156565656565675 -0.05277777777777792 0 0.11818181818181817 -2.5625 0.75 0 0.1621212121212121 -0.8895833333333334 0.4556818181818183 -1.0354545454545456 -1 0 -1 1.7196969696969693 -2.1127525252525206 0 -0.18541666666666667 0.1020833333333333 -0.4544823232323214 2.6973905723905807 0.11041666666666683 0 0.941540404040404 2.5229166666666667 -0.9542297979798002 -0.20061026936027426 -1.2020833333333334 1.0785984848484849 -26.933522727272724 2.1395833333333334 -0.3604166666666666 -3.515909090909091 0.3967171717171718 -1.1412878787878786 0 1.0329545454545406 -1.7258838383838384 -0.0456439393939394 1.4690025252525247 2.222916666666672 -1.920580808080808 2.3 -0.8814393939393965 -7.2154461279461195 -0.9164772727272752 -0.5157196969696969 0 0 -1 0 -0.10000000000000009 0 -1 -0.22375841750841374 -1 -0.640088383838384 0 6.449999999999998 -1 0 0 -0.5012626262626263 -2.1780303030303036 0 -0.7452651515151514 -0.031249999999999778 2.475 0.07108585858585859 -0.18541666666666679 -0.40896464646464636 0 2.9883333333333333 0.75 1.347537878787879 13.788560606060607 -0.8789772727272727 -0.004166666666666652 2.3530303030303026 0 -1.364646464646464 -0.06875000000000009 1.3270833333333334 -2.129987373737374 -0.6073863636363637 -5.109154040404043 0.10094696969696493 -1.04375 -10.540088383838384 1.6265151515151468 -1.605660774410778 -7.945791245791238 0.8333333333333333 0.062499999999999556 2.29375 0.016666666666666607 0.75 0.19791666666666652 0 0.03333333333333366 -1 7.291098484848477 0 -0.4566287878787879 0 0 0.01666666666666694 0.6870580808080813 0.19791666666666663 0.16632996632997088 -1 -0.3458333333333333 -1.3595328282828305 0.75 0.75 2.963341750841753 -0.26250000000000007 -0.6933712121212121 -0.3977272727272727 -0.39412878787879246 0 -1 0.8999999999999999 5.8597222222222225 -1.183985690235691 -3.4305555555555554 0.044570707070707094 2.522979797979798 -0.6573863636363662 -0.11130050505050526 -3.6492424242424244 0 0.9066287878787881 -0.0520833333333337 -0.15416666666666667 -0.3333333333333359 0.8148358585858584 -0.8044823232323233 2.550189393939399 0.3496212121212121 11.135921717171717 -1.1668981481481504 0.008333333333333304 3.880050505050505 0.9452441077441034 0 0.8502525252525253 0 0.22840909090909056 2.7416666666666667 0.03750000000000009 0 -0.5130681818181844 0.5280303030303031 -1.1532196969696973 3.146590909090909 0 -2.595833333333333 0 0.6306818181818201 -5.568392255892256 0 0 -0.1645833333333333 0.75 0.06458333333333321 -33.15669191919192 0 0 0.75 0 -2.520833333333333 -0.08124999999999982 0 -11.400252525252526 0.75 -1.2964015151515165 0.75 -0.2440025252525253 -5.810248316498312 2.858712121212122 -3.2833333333333288 -0.09583333333333321 0 -0.29324494949494984 1.936216329966328 0.75 0.75 -0.957007575757576 1.5813341750841776 30.904507575757577 -0.052041245791250246 0.05429292929292928 0 3.478451178451187 0 0 -1.539646464646465 0.6571969696969697 4.082386363636366 -0.3964015151515152 -0.17708333333333337 -0.13750000000000007 0.75 -17.727147727272722 0.3383838383838378 0 -1.4854166666666666 0.75 -1.1989898989898975 -2.0926136363636365 -4.6146675084175115 0.09078282828282846 0.75 0.7092803030302981 -0.13750000000000007 0 0.48223905723906224 0 2.552083333333333 0.20833333333333326 1.7905303030303084 0.15500000000000014 1.2571338383838433 0.8895833333333334 0 -3.068939393939394 5.143939393939389 0.06458333333333321 0.8174242424242424 1.3333122895622918 -7.532638888888888 -0.014583333333333393 0.06875000000000009 0.75 -0.9356060606060606 0 0.02083333333333326 -1.8077651515151516 3.735732323232323 -1 0.10473484848484382 0.30505050505050535 0 -3.4243686868686867 10.594368686868682 0.75 0.509090909090909 -2.454356060606061 -1 3.7539772727272727 4.41375 0 -0.03333333333333299 0 0.75 -2.1724116161616163 -0.5641414141414134 -0.6895833333333334 -0.9926136363636364 -1.06875 0.7437499999999955 8.056755050505052 1.2270833333333333 0.006250000000000089 0.75 0.7643518518518542 -0.07916666666666661 -0.8772306397306422 -0.24743265993266306 -6.506712962962957 3.8230639730639706 0 1.4572348484848532 -0.05625000000000002 1.054734848484848 -0.08124999999999982 0 -2.507386363636363 -1.2042803030303033 11.248547979797983 0.7075757575757575 0.36109006734006543 -0.027083333333333126 0.5200757575757575 -0.2416666666666667 0 -1 -1 0 0.3555765993266016 -0.014330808080808222 5.005113636363636 5.217487373737373 3.87102272727273 0 -1.0009090909090905 0 3.726031144781147 3.656249999999995 -4.433522727272727 0 -4.378935185185187 0.6992424242424242 0.7666877104377128 0.6628787878787907 -25.88823653198653 0 0 -0.014583333333332948 0.41799242424242444 0.876830808080808 -0.9543560606060606 0 1.7175757575757546 0.125 -0.039583333333333526 2.781144781144781 -1.0592803030303028 -0.002272727272727204 0.7077651515151517 -0.40946969696969693 5.113131313131312 0.38710016835016825 -6.411300505050501 -8.03560606060606 0.027083333333333348 -0.2945075757575808 16.065656565656553 0 0.5043981481481526 0.75 1.2101641414141415 -30.330618686868682 0.75 -2.3625000000000003 -0.2753998316498365 0 0.8054924242424268 0 0.75 0.75 -0.47411616161616166 0.9722853535353537 -10.561658249158233 0 0.18295454545454515 -0.6943181818181816 0.016161616161616044 3.050189393939387 2.4812499999999997 -0.6052609427609394 0.682828282828283 -0.2020833333333334 -0.02367424242424243 1.6125 0.7945075757575757 0.04791666666666661 10.04854166666667 -0.990340909090909 0.75 0 0 -0.584659090909091 0 -4.214583333333334 0 -0.02083333333333348 0 -0.002083333333333326 -2.5083333333333333 0 0.75 -0.8700757575757574 6.494276094276093 3.2380681818181842 0.09166666666666656 0.8895833333333334 -1.6282828282828261 -38.29400252525252 1.1251893939393836 -0.27619949494949503 0.058333333333333126 0 -1.0683080808080807 0.7020833333333333 0 -3.173072390572389 -23.946696127946137 6.921534090909095 0.75 0 0 0.40984848484848513 -2.2357575757575807 0 0 0.6075336700336729 0.6467803030302983 -0.34791666666666665 0.75 0.5921296296296323 -0.6452651515151515 2.4145833333333337 8.314772727272727 0 1.159583333333333 -0.540909090909095 -6.125757575757571 0 0.75 0 0.7402777777777778 0.48958333333333337 0.8770833333333333 1.2113636363636366 -1 2.279292929292934 0.4566287878787878 -0.07083333333333308 0.10625000000000007 -2.4187499999999997 0.04583333333333317 1.4198232323232325 0 -1.1458333333333335 -0.5147727272727272 0.008333333333333304 4.459191919191916 3.1788720538720563 -0.5162878787878786 1.7044823232323232 0 0 0 0.8378156565656565 0.75 -1.2876893939393914 0.002083333333333437 0 3.5840488215488304 1.7900378787878786 2.7756944444444387 -0.3107954545454521 -0.3861742424242447 -33.833333333333336 -7.192386363636364 -1.3537878787878788 2.4170454545454567 -2.014141414141414 0.75 -0.24116161616161613 -1 -0.37916666666666665 2.858249158249155 -2.304229797979798 0 4.142992424242419 -0.3645833333333335 -0.18726851851851212 0.42026515151515653 -1.3865782828282849 1.2810606060606045 0.75 -0.19166666666666687 2.762058080808081 -0.01666666666666683 0 -0.769255050505051 2.150946969696974 0.12708333333333321 -9.42114898989899 -0.44905303030303023 -0.13749999999999996 -2.4833333333333334 0 -3.29375 1.2791666666666666 -0.9841540404040403 -1.0721380471380466 0 -0.3916666666666666 -0.3145833333333333 -4.089330808080808 3.932260101010103 -0.20833333333333337 0.8032196969696921 2.6912457912457937 0 3.0317760942760965 0.48390151515152 0.19981060606060863 1.8452651515151537 0 0 0.6471590909090907 0 0 -0.16249999999999998 0 -0.3267045454545454 1.40625 0.75 0.75 -0.4869318181818183 1.1437500000000003 9.737121212121213 -0.17499999999999993 -1.2645833333333334 6.37941919191919 0.029545454545454652 -1.6690446127946155 -0.7270833333333309 1.6941287878787878 -2.6033459595959623 -0.15833333333333333 0.9860479797979773 -0.7121212121212122 -0.08125000000000004 0.75 0 0 0.75 -0.48844696969697 2.3577651515151583 0.75 2.497032828282828 8.276515151515152 0.9335227272727225 -2.5958964646464646 0.75 0 0 0.75 0.34166666666666656 0 -0.6354166666666643 -0.12291666666666656 -10.29659090909091 0.24375000000000002 -9.961616161616162 -0.02499999999999991 0.00909090909090926 0.31136363636363185 0.6297348484848488 -0.08958333333333335 0 -0.31578282828282855 0.38295454545454544 2.3439814814814754 -0.010416666666666519 -0.34242424242424496 0 -1.334890572390572 -1 0.01666666666666672 1.585606060606061 3.0161616161616163 0 0.3410353535353483 0.8812499999999999 -1.0210227272727253 0.039583333333333304 0.06874999999999987 -1.580429292929293 -0.9076388888888887 -0.1875 0.04583333333333339 0.06041666666666645 -1 44.79969696969697 1.3875000000000002 0 2.930808080808083 0.04583333333333339 -0.03661616161616166 0.9397937710437709 0 0.31811868686868694 15.623113636363636 -0.12628367003367114 0 -5.993143939393946 0 9.674999999999997 0.75 0.26041666666666674 0 1.0353114478114431 0.008333333333333415 0.75 1.0794191919191876 -1 8.656018518518518 0.0416666666666663 0.9554924242424196 1.6795454545454547 -1.34375 3.7366161616161597 0 -0.15486111111111112 -0.014583333333333393 0.07499999999999984 0.9941287878787879 0.5482954545454546 0 -0.03750000000000009 0.75 -0.8486742424242424 7.236553030303019 1.455765993265996 -2.3210858585858576 -5.746843434343434 5.837920875420878 -2.153219696969697 -8.37354797979798 0.75 -0.12708333333333333 -0.8950757575757551 -0.27563131313131306 0 -0.01041666666666674 1.84229797979798 2.014772727272727 3.4066708754208754 -2.233207070707069 5.317382154882164 1.1347432659932684 0 -0.03632154882154626 0.9924452861952886 -6.43093434343434 12.57196969696969 -1.0316919191919145 0 -0.9506313131313129 0 -0.08345959595960095 1.0981060606060655 1.257870370370373 4.380871212121212 0.2604166666666665 0.75 0 -0.43421717171717156 -31.24431818181818 -0.054166666666666474 -1.7886994949494928 2.6378787878787877 -1.5149621212121187 -0.2492424242424245 0 0 -0.4369318181818207 0.75 -0.16041666666666665 3.3625 0 0 0.027083333333326243 0.75 -0.039583333333333304 -1.4306818181818208 -0.12916666666666665 0 0.18958333333333344 0.85075757575758 0.75 -0.4617424242424242 0 0.5914772727272726 1.7607954545454545 -1.4878787878787856 0 -0.44671717171717473 0 0 0 1.6285984848484802 0.04583333333332629 -2.488699494949499 0 -1.927967171717172 0 -1.3594696969696973 0 -1 -1.1355639730639755 2.225757575757571 0 1.83125 0.2272727272727273 0.4979166666666667 0 -0.41460437710437503 -2.441961279461282 1.5826388888888858 0 1.2 0 -0.1369318181818202 -1.463952020202016 0 -0.030681818181818254 0 -0.3566287878787878 -0.5658459595959595 0.75 0 0.9666666666666668 -0.03541666666666643 -0.8643939393939419 -0.21561447811448264 -0.15416666666666679 0 0 0.03124999999999989 13.090227272727274 0.11685606060606046 0.004166666666666541 0 1.3333333333333335 0.10416666666666674 -0.06041666666666634 -0.23945707070706757 -0.30827020202020206 0.6765782828282778 0.2785227272727271 -0.20170454545454808 0.7782828282828282 10.868522727272728 0.75 -1.0539015151515156 -1.825631313131313 1.13125 -0.1596590909090908 1.2797348484848485 0 0.7315025252525252 0.006249999999999978 0.8229166666666661 -0.002083333333333215 -0.24924242424242427 -0.0043139730639703 0.6687500000000001 0.3998106060606017 -0.7176136363636367 0.23766835016835208 -0.47791666666666677 0.4722727272727285 0.4128787878787836 -0.3378787878787881 -0.8227272727272728 -0.5944654882154858 -9.693792087542084 -0.060416666666666785 -1.9484848484848487 0.16628787878787876 0.156060606060606 0 0.75 -1.589583333333331 -0.6937500000000001 -4.189263468013472 3.1615951178451196 5.069128787878783 -0.4486742424242425 0.2316919191919189 0.8102904040404041 0 3.9645833333333336 -0.5663510101010099 -1 -1.8448863636363635 -0.1708333333333334 -29.455265151515157 -0.38901515151515154 0 0 4.950000000000008 0.8712752525252526 0 -1.7142045454545454 -0.07708333333333339 0 -0.8037668350168399 -1.5949705387205313 -0.033333333333333215 -1.6053872053872063 -0.12291666666666679 -0.050000000000000266 1.428977272727268 -0.42708333333333337 1.2520833333333334 0.6548611111111113 -0.8782196969696967 -0.877209595959596 -0.1791666666666667 -1 -0.7074284511784561 5.3456818181818155 0.12083333333333313 0.8291666666666666 -5.866414141414142 -0.01458333333333317 -1.9536363636363634 -0.8456818181818184 0.22916666666666663 0 0 0.2416666666666667 0 1.4359217171717171 -2.766540404040404 2.906060606060597 -36.34547558922559 -3.647011784511785 -0.08983585858585852 0 0.11994949494949503 0.012500000000000178 0 -2.5270833333333336 0.3185606060606059 0 -1.777083333333331 3.4653409090909095 0.04791666666666683 -0.08333333333333348 0.75 11.402272727272727 0 -0.10625000000000018 0.2687499999999998 -1.2854166666666669 0 -1.0599747474747474 18.480050505050496 0 0 1.509617003367008 -0.2617424242424242 2.783333333333333 1.2895833333333333 0.8623737373737419 6.435227272727275 0 4.796569865319875 1.0625000000000004 0 -0.060416666666666785 -0.05208333333333337 -1.1149621212121212 -0.6744318181818183 -1.947159090909091 0.041098484848484995 -1.1021464646464645 -1.3343434343434342 -0.26079545454545716 0.03333333333333344 -0.38844696969696924 0.5865530303030302 0.75 0.5574705387205303 -2.435416666666667 0.30435606060606046 1.08125 0 0 0.48996212121212124 1.7109217171717168 0.5513257575757575 0.04999999999999316 -4.595959595959593 1.5109006734006778 -2.5708333333333337 -15.774663299663302 0.07708333333333339 1.8003787878787874 0 0.6287878787878742 0.4602904040404041 1.903156565656559 -1.41875 9.102504208754215 0.75 -0.28674242424242413 0.2850378787878787 0.0708333333333333 -0.06041666666666701 4.120475589225592 -40.178261784511776 0.33030303030303054 2.8518939393939395 0.75 -0.15833333333333333 -4.5265572390572295 0.8280303030303038 -1 1.736742424242415 0.9270833333333333 1.8774200336700329 0.75 -0.2979166666666667 -0.15833333333333333 -0.8604166666666666 -1 -0.18958333333333333 -7.615298821548826 0 0.36250000000000004 45.87859848484848 0.4726010101010101 0.75 2.0178872053872077 0.75 -0.01041666666666674 0.922260101010103 0.6765782828282829 0 1.3458333333333334 0.75 0.23655303030303032 -3.6236111111111025 -0.9541666666666666 0.018750000000000266 0 23.54332912457913 1.0823021885521906 0 0.2556818181818161 -0.5778409090909116 0.8270202020202047 0 -5.701388888888884 0 -0.125 0.022916666666666696 -0.24905303030303028 0 0.756464646464647 0.03541666666666654 1.46875 -0.5621212121212122 0 0.75 -1.2020833333333332 1.2187500000000002 -0.22178030303030305 0 3.941477272727275 -0.04583333333333317 -0.7761994949494953 -2.6046927609427475 4.120601851851848 0.4900042087542067 -1 0 -0.20833333333333337 -1.2686868686868684 -1.8791666666666642 5.654250841750841 -0.5092171717171716 -0.029166666666666674 -0.02499999999999991 -0.0854166666666667 -0.2833333333333332 0 0 -2.1049242424242425 0.75 0 4.019128787878783 -0.9114267676767678 0.1573863636363635 -1.8471590909090907 -0.43162878787879033 1.2683712121212174 -0.9343013468013468 -0.38497474747474736 0.75 -1.8694444444444445 -0.1499999999999999 0 0.5368265993266015 0 -0.3241792929292928 0 -0.04602272727272716 0.2020833333333334 0.8553030303030303 -2.962563131313126 -0.15833333333333344 -0.03926767676767651 -0.7062710437710462 0.5306818181818136 -0.9182449494949494 2.998068181818182 -1.1733585858585904 -1.3999999999999977 -1 -4.013699494949495 -2.917361111111111 0.34791666666666665 0.30541666666666667 -3.570138888888888 -0.016666666666666385 0 1.4708333333333332 -4.8104166666666694 0.08181818181818179 -0.3291666666666667 0 -0.016666666666666607 -6.32708333333334 -0.12916666666666665 0.05208333333333326 0.31458333333333344 -2.141919191919192 1.4603030303030358 -0.771590909090909 0 0.18295454545454537 -3.915193602693602 0.2500631313131314 1.7592803030302981 -0.025000000000000022 0.75 3.6416245791245765 0 -1 1.6426767676767702 -0.6066287878787879 -4.597916666666669 -0.06666666666666643 0.23950757575757575 1.1783249158249107 0.75 -1 0 0.6405934343434344 -1.6666666666666643 -1.6722222222222247 6.183543771043765 -0.4096590909090909 -0.045833333333333615 -0.05000000000000693 0.34374999999999556 0 1.2304924242424242 0.3857323232323233 -5.0833964646464604 -0.29595959595959587 0 0.75 0.028093434343434254 0.75 2.6208333333333256 0 0.8445075757575756 5.869204545454545 0 -0.13970959595959842 3.44640151515151 -6.424242424242419 -0.11628787878787694 -0.6270833333333354 0.75 -0.19583333333333308 2.288446969696972 0.08958333333333324 -2.1265782828282833 19.413825757575758 4.791603535353535 0.8520833333333333 -2.323316498316496 0 1.1917929292929295 -2.8178661616161618 2.4899831649831676 -0.7178030303030303 -1.0055555555555535 4.988636363636363 -0.15477272727272773 -1.2648989898989895 2.2255050505050527 -0.1479166666666667 2.806708754208752 1.0768939393939394 0 0.6057449494949494 -0.07083333333333353 -2.8438131313131314 -4.223505892255888 -0.14482323232323235 -0.00416666666666643 2.425904882154885 -0.11874999999999991 0.012499999999999956 0.05833333333333335 -1.6562499999999976 -0.8910353535353532 1.5712121212121213 -5.798947811447802 0.9748863636363636 0.37916666666666665 0.7102272727272727 -1.1738005050505054 0.3291666666666715 0.49981060606060557 1.6255681818181817 -0.21887626262626259 0.75 0 -5.03364898989899 -1.6124999999999976 0.3193181818181867 0.75 0 1.401094276094271 1.1344696969696966 -0.031249999999999778 0 3.9333333333333336 2.66875 0 0 -0.4075126262626245 0.751136363636359 -1 0 2.152083333333338 0.6041666666666694 -0.8688762626262629 0.873611111111111 0.5123106060606106 0.5535984848484816 -0.5979166666666667 1.4708333333333334 -16.166666666666668 -2.520833333333333 -0.15416666666666667 0 -1.7395833333333308 -1.7824494949494951 0 49.09791666666667 1.3 0.8051136363636313 0 0.75 1.0579545454545407 1.2270833333333333 -0.006250000000000089 0.7113636363636315 0 3.4901515151515103 -1.415404040404041 -1.7416666666666643 0 -39.33013468013468 -0.2714225589225583 0 -8.889772727272724 -0.5266835016835061 0.9720959595959544 -1.0282617845117878 -0.44507575757575757 1.8971590909090894 6.145370370370369 9.935101010101016 0.2603535353535351 0.2910984848484848 0.2662878787878785 0.1312500000000001 0 -0.40126262626262443 -6.862916666666666 -0.1791666666666667 0.75 -0.6606060606060609 0.09166666666666701 -0.5855429292929293 2.1083333333333334 -8.514267676767677 0 0 -0.64375 -0.20435606060606082 0 0 0.8775252525252526 1.2875 -0.17140151515151514 0.18333333333333335 -9.549255050505046 -2.5541666666666663 -2.4020833333333336 0 -2.1563762626262597 2.9387836700336725 -0.23371212121212115 12.133796296296293 -2.009659090909091 0.8729166666666667 0.04198232323232309 4.954654882154877 0.7606060606060605 -1.7645833333333307 -0.23068181818181843 2.9411616161616183 -0.4617424242424243 1.3825968013468062 -1.4687500000000053 0 0.094949494949495 2.954819023569026 2.803282828282829 0.024999999999992584 3.1419612794612815 0.8708333333333333 0 -0.015277777777777835 0 2.3666666666666667 -2.5395833333333333 -1.914583333333331 -0.45587121212121207 0.12897727272727244 -0.6285984848484849 -0.9001893939393939 -0.06262626262626747 0.07291666666666663 -1.0770833333333332 3.6070707070707093 -0.05625000000000002 -0.14374999999999993 0.07916666666666572 -1.268939393939392 -0.8840909090909093 1.4395833333333334 -0.35890151515151514 0.138131313131313 0.39469696969696955 -0.3394570707070683 2.376578282828283 -0.1812499999999999 2.625803030303029 1.1958333333333333 -2.2354166666666666 0 -5.57765151515151 -0.1499999999999999 0 7.401641414141402 0.5924242424242423 -0.28125 0.6673611111111112 0.9242424242424241 -2.4556818181818185 -0.29008838383838387 0.7956439393939347 0.060416666666666785 0.23718434343434358 -0.9916666666666645 -1.2529040404040401 0 0 0 -3.7884469696969694 0.75 -1 0.8096590909090908 -0.37462121212121224 -0.17708333333333337 11.313181818181818 0.383080808080803 -0.035416666666673535 0.002083333333333215 0 1.2354166666666666 2.0358585858585823 -2.043371212121212 -0.4486742424242449 1.3125 -0.24135101010101023 0.3222853535353538 0.7509469696969651 -0.006250000000000089 0 -6.027735690235685 0 0 1.219949494949495 -0.044128787878788156 -0.3700757575757603 -1.4333333333333333 -1.7937499999999975 1.2524621212121168 -0.00410353535353547 -1.1331439393939393 0 12.527209595959597 -1.7059343434343432 0 -0.90549242424242 3.0770833333333334 0.75 0.75 0.8340909090909092 0.75 0.08749999999999991 0 -0.4117424242424219 0 0.05625000000000002 2.438257575757569 -0.1333333333333333 1.0125000000000002 0.32619949494949974 -5.977756734006729 0.7087121212121211 -2.492676767676768 0 0 0.849242424242429 0 0 0.050000000000000044 -3.491161616161617 -0.15833333333333333 0 -2.5618055555555554 -0.2791666666666667 -0.4148358585858586 0.75 0.0013678451178427142 -0.14166666666666683 -0.645833333333331 0 -0.10000000000000009 -8.35375 -1.1657196969696968 -36.834722222222226 -1 0.06357323232323209 -0.1721590909090911 0 -0.33200757575757567 0 2.4020833333333336 0.7333333333333334 -1.6109848484848484 -2.4833333333333334 -1 0.38573232323232265 0.15625 0.3907196969696968 -1 4.5462121212121165 0 0 -45.01670875420876 -0.2660353535353508 0.08749999999999969 0.38005050505050497 -0.5643939393939392 -5.511616161616167 1.2416666666666663 1.2125000000000001 -1 -0.1687500000000004 -0.6890151515151519 3.192647306397304 0 -1.7958333333333307 0 -0.29520202020202024 -0.23181818181818636 1.0817129629629627 2.878661616161616 -1 -0.6861742424242427 0.2653409090909087 0.027083333333333348 -6.234280303030298 -0.07916666666666683 -7.87979797979798 1.4356060606060561 0 0.30000000000000004 0 0.75 -0.07916666666666661 0.2475378787878788 -0.08124999999999982 0.4689393939393893 -0.06874999999999998 -2.2685816498316544 -1 0 -3.742550505050505 0.6479166666666667 0.5587121212121267 0.34198232323232336 0 0 0.2522727272727241 -1.2875 2.0663089225589193 -2.9169823232323235 0 1.223295454545459 -0.4755892255892231 0.8006313131313183 12.81679292929293 0.0699494949494951 -1 0 0.043749999999999956 -0.5513888888888889 -3.05719696969697 0 -1 -2.3532954545454547 -1.3559343434343436 -1.8601851851851858 -1.2724747474747475 0.3292045454545449 0.8370580808080827 -1.495833333333331 0.2833333333333332 -0.5556186868686867 0 -0.6606060606060606 -0.29261363636363424 0 0.125 0.23743686868686853 0 0 2.2333333333333334 0.4684343434343434 0 -0.15208333333333335 0 -4.850000000000002 3.924999999999997 0.015340909090909127 0 0.75 -1.4166666666666643 -1.0616792929292929 0 2.812499999999997 0.75 -6.978156565656565 -1.8890151515151512 0.5021464646464648 0 -0.6665404040404039 -1.789583333333331 0 -0.11458333333333348 -23.524116161616163 -0.2751893939393939 0.013194444444444398 0 0 0.7895833333333334 0 0 0 -0.09375 -28.477651515151514 -3.9986742424242454 0.7104166666666667 0.5715277777777796 -1.021590909090909 -0.20654461279461556 -1.111868686868687 0 0.921780303030308 -2.3897727272727325 0.5676136363636365 0 -0.06874999999999998 -0.04583333333333339 -2.4710227272727323 1.618750000000005 -0.03541666666666665 3.3979166666666667 0 -0.4418560606060633 -0.6039772727272776 -0.42708333333333104 -0.18453282828282813 19.342592592592585 0 0 0.2932323232323242 0.13017676767676778 -0.7053240740740736 -4.153409090909091 -7.166477272727272 -13.034217171717163 -4.012079124579129 0.03541666666666665 0.8937499999999998 0.38958333333333806 -0.7702651515151515 -0.3200126262626264 -0.3770833333333333 0 -0.09004629629629868 -0.2291666666666643 0.687878787878788 -0.7933712121212115 -5.024166666666666 -3.484490740740738 0 0 0.7973484848484849 -0.5916666666666643 -0.4390782828282829 -0.4183712121212122 3.810416666666667 0 1.4295454545454502 -1.956481481481477 -0.07291666666666696 0.04791666666666661 0.7172979797979798 -1 -2.680281986531982 -1 0 0.75 -1.1791035353535348 -1.1624999999999999 0.05625000000000002 0.01666666666666705 -1 0.9426136363636366 -0.039583333333333304 -22.02512626262626 3.72960858585859 3.02348484848484 0.0625 0 0.02083333333333337 -0.3498737373737373 -0.3044444444444485 2.0522727272727272 -7.925416666666666 4.121527777777782 0.4530303030302987 -0.39583333333333326 0.12291666666666656 -3.5708333333333333 14.261889730639734 -2.0474957912457916 0.75 0.33175505050505083 0.75 0.05625000000000013 -0.31799242424242435 0.9083333333333286 -0.30972222222222223 -42.76188973063972 0.75 -0.3554924242424242 -3.220580808080808 -1.8343855218855216 0 0.7604166666666666 5.393623737373739 -0.08125000000000027 0.75 -0.29166666666666674 1.0187499999999998 0 0 0 0.75 0 0 2.3176767676767662 0 -0.3615530303030301 0 0.2528409090909093 -2.950416666666667 8.315707070707067 -1 1.1744318181818203 -0.42420033670033463 -0.13541666666666674 -0.045833333333333615 -0.050000000000000266 42.59950378787878 -1.2903409090909068 -1.2020833333333334 -19.137058080808078 0.6332070707070709 0.4366161616161617 -0.8585858585858539 2.4291666666666667 -1.147979797979798 0 -0.3520833333333333 0 0.9029671717171718 -31.48901515151515 5.383964646464647 -0.2041666666666666 -3.7437500000000004 -1 0.75 0 0.1452651515151515 4.92708333333334 -0.40435606060605545 -2.8371422558922608 0.022916666666666474 0.75 0 -0.07916666666666683 -1.9389520202020252 0.8416666666666667 -1.3859848484848483 0.018749999999999822 -0.27405303030303485 0.007028619528623992 -0.22916666666666663 0.96054292929293 -0.2878787878787876 -0.33428030303030765 0 3.693560606060613 2.9253787878787882 5.06458333333334 -18.76153198653199 -0.620643939393942 0.32310606060606073 1.7395833333333308 -4.893750000000001 -1.7645833333333307 46.27849326599326 4.10625 2.5171085858585833 0.9568392255892297 -0.18958333333333338 -1.7458333333333311 0.75 0 2.2583333333333333 -0.9981060606060606 0 0.025340909090909136 0.2583333333333333 0.75 0 -1.8291666666666666 0 -0.9071969696969673 -0.08750000000000013 0.17499999999999982 0.08749999999999969 32.16540404040404 0 0.19999999999999996 0 -0.043749999999999956 0.5356060606060558 0.4900883838383805 -2.0925505050505073 5.388573232323228 0 -1.2003787878787877 0 0 -2.4106691919191916 0.2850378787878787 -1.2024621212121214 -1.6928409090909096 0.030744949494945106 -0.5149621212121214 0 -0.1020833333333333 -18.7375 2.5677819865319886 0 -0.5669191919191918 -1.2057449494949497 -2.0729166666666643 -0.3958333333333335 -3.398821548821547 0 0 -0.15208333333333335 5.0948653198653275 0 -0.8736531986531983 1.4712752525252526 0.441982323232319 0 1.0294191919191917 -0.3988636363636411 0 -0.9760521885521882 0 0.9583333333333334 0.20094696969696968 3.061910774410777 0 -0.07916666666666661 -3.45625 -0.6616792929292932 2.2874368686868647 0 0 -5.962222222222223 0.050694444444444486 0.75 1.5246212121212146 12.593518518518525 -1.5383627946127945 0.5797348484848481 -1.86875 -4.320202020202015 -0.3929924242424243 0.45189393939393496 3.6290151515151523 -22.096148989898992 -1.1465277777777778 -1.3018308080808123 0 0 0 -0.25271464646464614 0.7979166666666666 0.22916666666666652 -0.06041666666666645 0.12083333333333335 -3.9543560606060604 0.14006313131313108 -2.383080808080806 2.7017045454545454 -1.8062499999999977 0.75 -1.072159090909091 0 0.3043560606060609 2.9597853535353558 -39.944991582491575 -0.5720328282828282 -20.0657196969697 7.860984848484844 1.103030303030303 0 -3.8316919191919188 1.2697601010101014 0.8508207070707094 0.25 0 -43.783333333333324 -0.7051893939393987 0 1.128030303030298 -0.22499999999999998 0.014499158249156263 0 0.3442550505050481 -1 0.006249999999999867 1.5343434343434343 1.76344696969697 3.2875 -4.648106060606061 1.0277777777777801 -0.6070707070707071 0 -0.3458333333333308 -1 -1.585921717171717 -0.2104166666666667 -0.6124368686868715 0.8189393939393892 0.75 -1 -1.0145454545454449 -0.16041666666666665 0.958438552188557 -0.8645833333333308 0.6835858585858585 0 0 -1.7647095959595958 2.5312500000000044 0 0 0 0.75 -1.860311447811454 0.5426136363636365 -0.01041666666666674 -2.0395833333333284 -1.4052188552188576 0.9437499999999996 -0.3562500000000002 -1 5.4503787878787895 0.4650252525252574 2.5437499999999953 0.22083333333333321 -0.12083333333333335 0.3603535353535352 0.2534090909090909 -6.250652356902355 0.054166666666666474 -2.41875 0.5947601010101012 0.7507786195286146 -0.5612373737373737 1.7541666666666713 5.1856691919191915 0 0.7663510101010101 -0.13510101010101438 0.5486742424242426 5.7287878787878785 -0.6899621212121212 2.2041666666666666 -39.659701178451165 0.05624999999999991 0.75 -0.5291666666666643 0 -8.069381313131313 0 0.12083333333333313 0.8571969696969726 -0.5117424242424242 0.15625 0.2729166666666667 0.7111742424242424 -1.9520202020201998 0.75 -3.815151515151515 0 0.75 4.993939393939389 -1 0 -2.102588383838402 -0.00000000000000005551115123125783 -0.3268097643097647 0 -0.19267676767676767 4.5723905723905744 0.23457491582492196 -1.2174242424242425 -0.5637500000000002 -0.2476641414141414 -7.429692760942752 -0.12083333333333335 0 -0.22619949494949498 0 -0.8100378787878786 -1 -2.190340909090909 -1.0627525252525232 -0.733333333333331 0.031565656565656575 0.32058080808080813 0.32291666666666663 -0.37998737373737335 0.75 1.75 0.41054292929292924 -0.029166666666666785 0.06590909090909092 27.078030303030303 2.43125 -3.19936868686869 -0.22045454545454812 0.31799242424242413 -6.064583333333329 -4.128977272727273 -4.576073232323232 3.0318181818181817 1.0437500000000002 -44.3875 -16.324810606060606 0 -1.1065025252525253 0 0 0.17310606060606082 -0.5321969696969697 0.75 -3.9598484848484894 -1.7197601010101011 1.8289562289562311 0.75 0.5619318181818208 0 0 -36.72028619528619 38.50688131313131 -19.89345538720539 -0.9159722222222271 0.26458333333333317 -0.25277777777777777 9.171338383838382 3.9758838383838455 -0.8381944444444445 -0.1910353535353535 1.2499999999999998 -0.012689393939394056 -1.6134048821548785 0.669696969696965 0.75 0.75 0.75 0 -2.64135101010101 -1.8280303030303031 0.45673400673401177 0.643181818181813 0.15643939393939432 -4.30429292929292 2.6937499999999996 0 0 -0.02819865319865089 0.12916666666666665 -0.3485479797979798 0.75 0.75 0 1.1569444444444446 0.75 1.1489478114478135 1.7488846801346778 0 -0.26035353535353534 0.09375 0 0 0.75 0.022916666666666585 0 -0.12645202020202018 0 0 -0.06458333333333344 0.75 2.5145833333333334 -0.002083333333333437 -1.1895833333333332 1.2117424242424242 -0.04583333333333339 0 0.41666666666666674 0.75 -0.06666666666666665 3.55625 4.226830808080816 0.19614898989898988 7.404819023569028 0.03125 -46.790046296296296 -0.49577020202020217 -2.783080808080808 1.8053030303030282 0.6421717171717172 2.4458333333333333 -0.11262626262626707 0.40909090909090906 1.5416666666666619 -0.8255050505050505 0.24791666666666679 0.75 -0.26988636363636354 -0.6625631313131313 0 0 -13.537605218855212 1.9611321548821572 6.9488846801346815 0.75 -1.6001262626262627 -1 -0.373989898989899 0 4.191898148148143 0 -0.7382575757575758 2.8354166666666667 0.75 -0.21666666666666656 -1.1928872053872004 0 -0.8236531986531936 0.06363636363636371 0 -2.6187500000000004 6.79594696969697 6.192045454545453 1.2786405723905725 0 16.822117003367 -0.20833333333333337 0.75 0.162815656565657 -47.11666666666667 0 -1.0895833333333333 2.341666666666667 2.6604166666666664 0 0 0.6895833333333334 -2.4479166666666665 0.03750000000000009 -7.092760942760937 0 0 -0.008333333333333304 0.10416666666666674 -2.6509469696969696 0 -0.614772727272727 -1.7565446127945998 -2.4541666666666666 0.75 -0.29993686868686864 -0.029166666666666563 5.283270202020203 -2.1931818181818206 -0.5170454545454546 -0.02499999999999991 -2.6365530303030305 -0.6385732323232349 4.800568181818182 0 0.010416666666666519 -1.8443181818181817 0.75 1.0583333333333333 0.5598484848484874 0 -1 0 0 0.06875000000000009 -0.0854166666666667 0 10.179776936026933 -0.10397727272727275 -0.41174242424242435 -1 -0.03333333333333344 0 -0.21250000000000002 -2.0005681818181813 0.27169612794612696 -0.687689393939394 -8.43074494949495 0 -0.002083333333333215 2.075568181818182 -1.7937499999999975 -1.200694444444442 -1 -6.355555555555551 0 0 7.628181818181819 -0.018750000000000044 -1.8666666666666643 -2.978409090909091 0 -0.6956439393939394 0 0.75 0.09583333333333344 0.06931818181818139 4.5680134680134605 0 -3.482638888888888 0 0 -2.369431818181818 0.1383207070707022 1.6493265993265984 -1.6235690235690245 -1.7667297979797982 0.75 0 0.27215909090909074 -1.7770833333333313 -0.8288720538720489 0.03749999999999987 -1.789583333333331 0 0.5263257575757576 -3.69375 -0.5346590909090909 -0.34791666666666676 0.75 -3.0153409090909093 5.13125 -0.42354797979797976 0.75 0.75 2.5729166666666665 0.6871001683501636 0.75 0 -6.516919191919191 0 0.95625 0 0 0 0 -40.06624579124579 -8.288320707070707 -0.4230429292929293 0 -0.7240530303030301 0.11458333333333326 0.487752525252525 0 0.22727272727272751 -0.6743686868686869 -3.259659090909091 -0.23592171717171695 0.3299999999999996 2.889478114478117 -0.2594696969697008 -0.6340067340067388 -1.2625 0 -1 0.75 -0.7666035353535354 +scenario heads-up fish (blind) +deals 1000 +seed 1592590337 +counts 7751 16 0 +samples -0.054166666666666585 0.41369949494949076 0.8708712121212139 3.5315319865319896 3.4359217171717242 0.13560606060606095 0.1299999999999999 0.6230429292929318 4.173556397306408 0.9525378787878839 0.7733459595959598 11.918724747474755 3.6329545454545404 1.6663468013467946 -0.173863636363641 -0.20916666666666672 3.2395454545454543 0.7725000000000048 0.3870075757575757 -0.3175 0.24128787878787894 0.2029166666666668 42.64930976430976 -7.8024368686868755 0.2675 0.30916666666666676 0.7356271043771037 0.36 0.4588636363636316 0.14808080808081292 2.4604082491582524 1.133787878787884 0.4253914141414099 1.3202861952861944 0.5140446127946177 0.2958333333333335 2.1335016835016845 0.08579966329966804 -0.43996212121212075 -0.01041666666666674 -0.020707070707068453 -0.031022727272729367 0.2711489898989903 0.5045791245791248 -1.1210227272727202 0.1700000000000001 0.5685606060606014 40.59291077441079 1.0277904040404062 0.8896969696969703 2.3847474747474795 -0.20416666666666672 0.43318181818181545 0.6113257575757526 0.14708333333333323 -39.93844696969698 1.2212962962962932 -0.7863636363636363 0.05212121212121179 0.29166666666666663 -0.03541666666666643 0.26356060606060616 0.1267803030303032 0.12458333333333327 0.3975000000000031 -0.35583333333333345 -1.7234090909090887 0.4289393939393942 0.4505303030302983 2.8413257575757562 0.4023021885521907 0.015833333333333588 2.958989898989903 1.403863636363644 7.337037037037037 -7.299393939393941 -0.012499999999999956 1.5078072390572363 0.059166666666671475 -0.40000000000000013 0.14505050505050504 22.170896464646468 6.523956228956232 12.626868686868686 2.0576809764309756 -0.2926515151515152 -6.560319865319867 2.4709343434343425 -0.47015151515151765 1.1630429292929274 -0.004166666666666652 3.258030303030307 0.8787878787878833 0.5696969696969649 2.2491666666666665 0.7734848484848484 0.24208333333333332 -0.8643728956228951 0.5029166666666666 -0.28636363636363904 -0.404276094276097 0.2531565656565562 2.3587499999999997 4.044621212121213 -0.3573989898989829 0.19833333333333336 2.0116666666666667 2.4450000000000003 0.5424999999999953 -0.13041666666666663 34.4924031986532 -43.30341077441078 -0.08625000000000005 0.07250000000000006 4.838055555555563 0.11670454545454412 3.8666540404040446 32.08967171717172 0.3204166666666665 -0.29015151515151516 -0.27 -2.105892255892257 0.10291666666666666 1.3703156565656598 0.7769696969696972 18.82026936026936 0.08750000000000002 -0.24750000000000005 3.667803030303034 4.535050505050508 -1.1281439393939372 -37.87121212121212 1.4528787878787877 0.6013636363636314 4.455063131313133 0.8050378787878834 10.78255471380472 0.3612878787878787 3.176241582491577 -0.008333333333333526 -1.6812499999999977 1.5661405723905724 0.00416666666666643 1.0559469696969774 11.674957912457918 2.80140151515151 -22.6753367003367 1.694861111111111 0.9085479797979849 -1.859583333333331 0.0050000000000001155 3.244848484848491 6.291666666666663 0.6600757575757574 0.8642045454545456 0.07318181818181801 2.3595833333333336 0.7315151515151567 -0.4435858585858611 -14.11580808080808 -0.3179166666666666 1.0669612794612895 0.8626515151515107 2.5972937710437733 0.5783333333333334 -0.029166666666674335 0.28125 -0.027083333333333126 -1.3712499999999974 -0.18499999999999994 1.6754671717171707 0.31666666666666665 -1.3879671717171693 -0.5990530303030304 -0.09708333333333341 1.4889099326599369 0.46664562289562106 -0.15333333333333332 0.2679166666666665 -4.970197811447803 9.997693602693603 -2.4458333333333333 0.28499999999999986 0.3037500000000001 -0.10375000000000023 6.7229419191919195 0.6395833333333378 -0.04791666666666661 1.1221254208754239 -0.024191919191921762 0.06666666666667354 0.30458333333333354 0.7412836700336654 10.546717171717178 -1.5127272727272705 0.16249999999999998 0.19041666666666668 1.0885942760942748 -0.013749999999999873 22.48806818181819 0.2516666666666666 -1.6645833333333309 0.21868686868686849 0.7987121212121258 -0.5338383838383789 2.689848484848481 -0.09999999999999998 -1.2306186868686844 10.218118686868678 0.3770833333333333 -0.049116161616159726 2.2216666666666667 0.580239898989899 0.5206439393939348 0.19208333333333333 10.183670033670028 0.6236784511784561 13.829793771043775 2.391603535353534 0.8764351851851808 1.260778619528622 0.5923863636363638 0.15003787878787866 0.8074284511784537 2.593472222222229 0.48623737373737375 -0.20272727272727287 1.5398989898989894 0.25833333333333314 2.356481481481475 24.69145622895623 -0.33765151515151504 0.15883838383838755 0.3404166666666668 -1.0010984848484779 0.047916666666659724 2.2375 -4.6964983164983085 -0.5557575757575758 -2.9620580808080774 -1.786994949494947 8.62018518518519 -0.7179545454545456 1.21625 0.44007575757575734 18.71563973063973 -0.09166666666666656 9.995475589225585 -1.300719696969697 -0.062234848484848615 0.14575757575757575 0.9174999999999954 -0.43140151515151515 0.4842803030303029 -0.0958333333333331 0.24356060606060637 -12.919128787878796 1.352727272727277 0.6215530303030306 -0.04166666666666674 2.4465488215488174 -1.7041666666666642 -0.0904166666666667 -0.13958333333333317 0.7690193602693556 3.4582070707070667 1.1295833333333334 -0.2945833333333332 0.19833333333333325 0.1862499999999998 2.0282828282828276 -1.5552651515151537 3.6099494949494986 0.5893939393939349 21.670349326599336 0.945294612794612 3.3376220538720593 0.7905303030302981 -1.0515530303030305 0.5246001683501635 20.963615319865312 1.4795833333333381 -0.32291666666666663 0.37185606060606097 5.517045454545463 3.466452020202032 0.9669191919191895 2.121847643097642 3.7869696969696918 -1.6819949494949473 2.35867424242424 0.4204166666666622 1.5554166666666713 0.20333333333333353 1.2999621212121253 0.95740740740741 -3.4518308080808113 0.050416666666666776 1.227108585858585 0.7183333333333335 -1.0141666666666667 -0.23564393939393946 -3.511666666666663 -0.14375000000000004 0.9937415824915847 0.0802062289562322 4.103076599326596 0.12416666666666676 0.013749999999999929 0.1562500000000001 1.4234343434343457 0.35833333333333334 0.6031818181818135 -0.10429292929293199 3.5265067340067398 0.8251515151515105 0.35583333333333345 1.3967297979797981 3.8419444444444406 -35.4947095959596 -0.1954166666666668 0.42348484848484613 0.14867424242424243 -0.027083333333333126 1.3812499999999996 1.3222348484848556 1.0803114478114457 0.22749999999999987 1.7807323232323191 8.880707070707071 0.1362500000000002 0.05624999999999991 8.222268518518524 -1.5708333333333333 0.23291666666666677 -1.8537499999999976 1.1272727272727325 1.1716666666666615 0.27166666666666667 2.428876262626263 0.6164772727272683 3.6340530303030314 0.42929292929292506 0.2849242424242425 -0.883097643097638 -0.45462121212121476 6.9147811447811405 0.41246212121211867 -2.4200799663299595 -2.3000000000000003 6.355214646464643 0.8687499999999955 -0.08500000000000008 1.5222601010101053 -4.733796296296293 0.06306818181818175 1.8008838383838375 -0.7219907407407333 -0.4918560606060607 -0.05340909090909107 0.484225589225594 3.8095622895622983 23.616035353535356 -0.21260101010101007 0.18249999999999994 0.5988257575757574 0.3141666666666666 11.916687710437714 -1.9993560606060607 8.013110269360268 -2.2351641414141383 -0.22250000000000003 3.1777904040404077 -0.12083333333333357 -0.0720833333333335 0.2158333333333331 -0.027083333333333237 2.410151515151515 0.5712752525252526 -0.05484006734006641 0.13874999999999976 1.7438720538720587 0.7700757575757597 0.9409259259259253 0.00003787878787875343 -0.15333333333333332 1.182878787878788 -0.25625 -0.08378787878787863 8.430202020202016 1.412487373737373 1.5792803030303035 0.025833333333333375 0.5395833333333357 6.167394781144777 -1.824734848484846 0.5113005050505006 0.5459469696969648 5.281868686868689 0.22617424242424244 0.9691666666666714 -0.13305134680134412 3.1979629629629676 0.10249999999999998 1.0744444444444405 4.1438552188552125 10.874852693602705 8.34724747474748 3.4998232323232283 0.25458333333333333 -0.018750000000000044 28.039351851851855 1.1350378787878743 -0.2058333333333333 3.22811868686869 0.4137500000000001 0.005366161616161658 0.20666666666666678 0.8602567340067296 0.5492803030303031 1.1270833333333332 -0.1412878787878833 0.779936868686868 1.4938762626262614 2.747550505050509 10.88095959595961 0.6726136363636315 -0.08258838383837919 1.7762626262626227 -0.2616035353535313 0.07499999999999996 0.12083333333333357 0.09670454545454554 0.47060606060605603 1.4534722222222194 -1.3810606060606032 4.953661616161618 0.7221212121212122 2.3208333333333355 0.4211868686868687 3.8755260942761005 0.31875 -0.0007954545454544881 1.1758585858585908 -23.60164141414141 -0.8106818181818249 2.0986742424242415 0.38518939393939433 0.728484848484851 0.029166666666666563 1.0331060606060654 0.507803030303035 -2.2734722222222192 -0.17375000000000007 -0.061868686868689515 0.27238636363636803 -0.5044191919191894 0.12416666666666665 0.36590909090909096 0.6986952861952882 -0.3554166666666668 0.24500000000000016 0.22371212121212147 0.03708333333333341 0.3919065656565679 1.0902777777777741 0.14124999999999988 0.03958333333333308 1.8300000000000047 5.194061447811446 -35.98589393939393 0.6060606060606015 0.8009469696969649 0.5893939393939394 2.18125 -21.646199494949496 0.29833333333333334 0.5705303030302985 -0.2466666666666667 1.4763888888888859 1.3051262626262603 1.1471338383838385 0.20958333333333345 -28.384848484848483 0.08333333333333326 3.1828535353535314 0.38308080808080336 1.3353493265993257 1.3278829966330012 0.1917550505050506 -29.455079966329954 0.30999999999999983 4.662962962962959 0.3720833333333333 1.5791666666666702 0.4480765993265947 0.3525 -0.018371212121209846 -0.3191666666666667 2.639654882154879 -0.2416666666666667 0.0004166666666667873 0.19833333333333347 -24.796734006734003 2.816250000000002 -0.08973484848484825 3.1865740740740742 -0.05208333333333337 -0.10250000000000015 0.19094696969696967 0.035833333333337825 1.7781060606060606 1.1664015151515201 -0.5021590909090907 1.8089646464646534 0.70117424242424 7.553156565656565 0.13462121212121203 0.26594696969696974 1.6955681818181818 1.1696969696969663 0.08590909090909105 0.40950336700337187 5.048333333333338 -0.13069444444444445 -0.2645833333333334 0.25833333333333325 -0.2170833333333333 2.275366161616161 -0.8607954545454612 0.5623106060606016 -0.015883838383838222 -0.06875000000000009 0.7830681818181866 4.245037878787879 0.9301515151515106 0.7001893939393891 0.596498316498314 -0.4575378787878792 -2.060416666666662 4.982083333333339 -0.1941666666666667 -1.1307954545454615 -0.1196590909090911 -0.060416666666666785 0.3190909090909092 0.4451136363636367 1.8560395622895567 -0.1296590909090909 1.6127104377104369 0.07499999999999307 0.3372601010101009 5.198758417508419 -0.6120429292929224 -0.0333333333333401 0.3682954545454544 0.5849494949494901 0.12875000000000014 -1.6063636363636387 0.5328282828282829 2.919044612794625 0.08124999999999982 2.3641666666666667 0.7352272727272682 6.010239898989898 -0.01666666666666683 3.8038257575757513 -0.1754166666666669 5.603977272727276 0.17583333333333323 -0.3158333333333333 -1.5082954545454568 0.2270833333333332 0.1968308080808081 0.0632954545454546 0.27916666666666656 2.719823232323236 0.32333333333333325 3.55875 2.21415404040404 -0.78170454545455 1.4840530303030346 0.1970833333333334 1.3812499999999979 -0.1725757575757575 -0.1545833333333334 -0.8691119528619553 1.1990782828282847 -1.6364015151515177 -1.4205303030303007 0.24208333333333332 0.3020833333333334 6.675353535353531 -0.461994949494952 0.2883333333333335 1.321856060606059 -0.778409090909093 -19.693657407407432 -0.0887500000000001 -1.7958333333333334 -1.1280303030302987 2.4975799663299716 0.4039772727272726 -0.17393939393939395 0.41492424242424275 -1.699166666666664 1.8638888888888874 1.5211153198653262 0.13124999999999987 -1.8029166666666643 0.6145454545454594 12.028682659932665 0.0687500000000002 1.6054292929292884 2.3418560606060557 -0.12749999999999995 -1.6375757575757555 6.464015151515158 0.26910774410775096 0.32833333333333325 0.4083333333333333 0.16874999999999984 0.3508333333333288 -0.1070833333333332 0.6633207070707022 0.5384175084175133 0.04166666666666674 -3.2278914141414172 0.37241161616161333 0.37215909090909083 0.40553030303030324 0.060833333333333184 1.150681818181825 11.46386784511785 2.331881313131323 2.204734848484848 2.514760101010104 0.16020202020202046 1.493602693602693 24.376136363636363 1.7522264309764357 -0.15988636363636355 1.987584175084173 -0.21750000000000003 0.27364898989899666 0.2283333333333334 6.161944444444444 -33.12664983164983 0.5320833333333334 2.5125 -0.16125000000000012 0.08875000000000005 24.855723905723906 0.31416666666666665 0.8002272727272774 -1.3423484848484826 4.807992424242425 0.013661616161616319 3.5518181818181755 0.14499999999999996 -0.14636363636363647 -1.9016708754208795 0.3441666666666667 1.505757575757578 0.2154166666666667 0.4787499999999999 5.46700336700337 0.14231902356902282 0.26041666666666663 -14.251729797979802 0.3258333333333334 -4.588585858585858 10.879356060606067 -4.788333333333345 -1.3608333333333311 0.02416666666666656 -0.52625 -0.19915404040404017 1.627083333333338 0.2603535353535352 4.860395622895616 -2.3632449494949466 0.7248190235690258 0.12420454545454529 -1.5691666666666642 3.576220538720535 1.028446969696965 0.16268939393939413 0.23541666666666672 -0.09999999999999987 -0.2762500000000001 0.31041666666666634 3.509301346801345 0.1741666666666666 0.19166666666666665 0.3245833333333332 0.8216666666666712 8.43345959595959 0.1253030303030258 -0.004419191919191823 0.18958333333333327 3.7518434343434306 0.05625000000000013 3.868392255892258 0.18046717171717175 11.828682659932664 -0.1512500000000001 0.1921590909090909 -0.2569107744107768 0.17291666666666666 -0.8791666666666668 2.630530303030305 0.7024999999999954 0.0616666666666667 1.105690235690235 0.11333333333333334 1.2746212121212173 1.0235479797979814 12.139814814814825 1.7561574074074129 0.05624999999999991 6.360500841750844 1.8009469696969669 1.4798821548821524 0.02083333333333337 1.5693181818181863 -0.09375000000000022 -0.12249999999999994 0.9303030303030346 1.222411616161615 7.855332491582488 -0.14208333333333345 -0.28648989898990296 0.20791666666666653 6.4047601010101065 22.525143097643102 0.3604166666666668 -0.28625 2.926489898989894 -0.15375000000000005 1.3607828282828325 0.16791666666666683 7.457744107744108 -0.17708333333333337 11.599200336700344 0.006249999999999867 -28.190446127946124 0.8856439393939349 1.0546927609427637 4.446161616161621 9.746944444444448 0.10977272727272724 0.2883333333333332 0.3409848484848485 0.30255892255892736 -0.4603409090909091 -7.5058712121212015 -0.13416666666666655 0.8032196969697014 0.24003787878787897 22.886843434343437 0.5334090909090907 0.8726515151515106 1.1608333333333334 2.0300547138047134 0.12916666666666676 -0.2183333333333335 -0.01666666666666683 1.650315656565656 -0.7523106060606131 4.293295454545449 0.33791666666666687 1.309747474747467 0.35257575757575743 0.09166666666666667 1.6604166666666718 1.1386363636363637 -0.06814393939393948 5.660942760942755 -0.27178030303030587 0.3230303030303029 -0.09040404040403605 0.11250000000000004 -0.27749999999999997 6.213383838383834 10.539537037037045 2.2666035353535383 0.927798821548834 2.242083333333333 0.07083333333333319 -0.6345833333333285 3.6861784511784452 18.1883627946128 3.3560395622895633 -0.20666666666666667 0.1949999999999999 0.988257575757576 0.2437499999999999 0.2391666666666667 -0.016654040404040282 -5.214414983164979 3.597853535353531 0.5842803030303052 -0.1479166666666667 0.59450757575758 -0.3551136363636389 1.283080808080813 -0.034583333333333466 0.6193602693602716 0.04375000000000018 -0.09791666666666665 -0.053333333333333344 0.016666666666666607 -0.34458333333333324 -0.08208333333333351 3.017731481481481 -0.010189393939393776 0.46773989898990376 0.36276515151515154 9.642285353535348 1.4520664983164977 0.1275 0.9195496632996584 0.3636363636363633 -0.5923232323232255 1.334448653198646 0.33148989898989933 -0.2517424242424262 1.6585227272727323 3.3142340067340132 -0.2004166666666667 -0.1449999999999999 0.41185606060606095 -0.040416666666666656 0.02651515151515116 0.048257575757576 4.524305555555557 -0.022499999999999964 -0.23958333333333337 0.7630345117845168 6.459659090909091 8.9875 0.6288636363636316 4.672159090909089 -0.8325547138047136 0.3258333333333333 -0.1379166666666667 -0.04458333333333331 -10.198055555555547 0.2874621212121168 0.33861111111111103 0.1854166666666665 2.040959595959595 0.16375000000000012 -0.019583333333333397 9.502356902356897 0.5863636363636315 5.538901515151518 0.24454545454545007 8.633800505050509 0.39261363636363145 0.3383333333333333 0.1479166666666667 -0.04458333333333331 -4.8174116161616105 -0.02499999999999325 -0.4016666666666666 0.006553030303027896 1.0799494949494965 5.008585858585862 1.2902398989899009 1.0493939393939393 1.3573442760942807 8.519583333333337 2.0128914141414134 1.616338383838379 5.742222222222231 2.568017676767679 -34.71741161616162 -0.2037500000000001 -0.35124999999999995 0.10749999999999993 1.0962289562289613 -0.42374999999999996 -15.269739057239057 2.2817045454545406 -0.04166666666666674 24.289785353535354 0.7224747474747482 0.21945707070708131 -0.10541666666666671 2.2898484848484846 4.065740740740736 0.3882954545454531 0.062499999999992895 -0.22624999999999995 0.6729840067340117 0.37515151515150835 -0.07499999999999996 0.2704166666666666 -0.13742424242424245 0.36249999999999993 -1.2686237373737375 3.4446759259259325 -2.4590909090909063 -0.0469065656565657 0.6083333333333383 -4.1202861952861864 4.640046296296294 21.981649831649836 1.3033333333333332 0.024431818181818277 -0.1054166666666666 -0.039583333333333415 -0.016856060606060597 -0.031249999999999778 6.5625 0.9716582491582514 -0.26375000000000015 0.22458333333333347 0.8917676767676747 -0.018333333333333535 -1.8287499999999977 0.6744318181818183 -4.296317340067337 1.7009469696969703 -0.15500000000000003 -0.1725000000000002 1.0385858585858634 -1.022525252525252 -0.3196969696969697 -0.06041666666666656 0.28583333333333333 0.47049242424242455 3.327095959595961 2.6280092592592554 -1.8029166666666643 4.450147306397302 0.5869318181818133 5.151944444444448 5.211035353535352 2.2683712121212194 0.062499999999999556 2.1770833333333335 0.016666666666666607 -1.0835984848484823 0.17708333333333326 -0.013409090909091037 1.5840530303030294 0.8654040404040431 0.5894191919191938 0.02499999999999991 0.14340909090909038 -1.2151010101010074 0.642121212121217 0.8635774410774433 0.41094696969697014 0.5307449494949497 0.5286279461279508 2.3079166666666664 0.26510101010101506 5.588320707070702 0.08666666666666678 0.37424242424242427 -0.25860269360269106 -1.952499999999998 -0.30321969696970186 0.3395833333333333 0.8470833333333285 0.07643939393939408 -0.7606060606060603 -0.07916666666666683 3.3816456228956273 5.445744949494948 3.828661616161612 0.28784090909090937 2.233097643097635 -0.03333333333334032 -0.21511363636363667 0.9385732323232308 0.8895833333333285 1.915000000000005 1.283358585858585 -0.1941666666666667 0.23083333333333333 13.958775252525255 -0.4415530303030304 3.510606060606063 0.7438636363636315 -1.997521043771049 0.3667213804713758 -0.14250000000000007 0.011393097643105143 1.13953282828283 0.13500000000000023 0.510408249158254 -13.16349326599326 0.15988636363636355 0.009166666666666712 -0.007500000000000062 +scenario heads-up calling station (blind) +deals 1000 +seed 1592590337 +counts 8000 14 0 +samples 0.45773569023569527 7.349726430976429 0.07087121212120961 4.463855218855219 5.964406565656569 1.7012626262626247 0.1299999999999999 6.355366161616169 13.735648148148151 0.9525378787878839 0.7733459595959598 13.105088383838387 -3.3114898989899024 1.6663468013467946 -0.173863636363641 -0.20916666666666672 4.57287878787879 0.7725000000000048 0.5688257575757576 -0.3175 1.600378787878793 0.2029166666666668 -6.838905723905723 14.848825757575757 0.26958333333333323 0.30916666666666676 6.451872895622891 0.3225000000000001 3.2366414141414097 -0.8227946127946073 2.4604082491582524 1.133787878787884 17.092058080808084 6.40951178451178 0.5140446127946177 0.2958333333333335 13.02239057239057 0.08579966329966804 -0.43996212121212075 -0.01041666666666674 -0.020707070707068453 -0.031022727272729367 2.509364478114482 0.5045791245791248 -1.1210227272727202 0.1700000000000001 0.5685606060606014 18.53204545454546 2.4651641414141405 23.74121212121212 0.40191919191919423 0.7958333333333333 0.5493434343434358 0.9976893939393889 0.14708333333333323 2.144886363636366 1.2212962962962932 -0.2749999999999999 4.768030303030303 1.958333333333338 2.186805555555555 1.6575000000000046 11.25135942760943 0.9579166666666619 3.1293181818181823 -0.35583333333333345 -0.8749242424242354 2.2723737373737367 0.4505303030302983 2.8413257575757562 0.4023021885521907 0.015833333333333588 2.958989898989903 2.203863636363641 24.892592592592592 -0.9105050505050541 -0.012499999999999956 24.881544612794613 1.0591666666666715 -0.40000000000000013 10.223333333333333 24.867866161616163 25.307794612794613 4.201279461279463 2.0576809764309756 -0.2926515151515152 8.274158249158242 7.100563973063969 0.1995454545454569 1.1630429292929274 -0.004166666666666652 3.258030303030307 11.695370370370377 0.5696969696969649 -1.9174999999999978 -0.0901515151515152 0.24208333333333332 3.765256734006731 0.5029166666666666 -0.28636363636363904 -0.404276094276097 2.5679713804713726 -1.8079166666666644 6.032601010101006 -0.3573989898989829 0.19833333333333336 2.5116666666666667 -1.7216666666666645 4.7091666666666665 -0.13041666666666663 17.49038299663299 -0.17990740740740652 -0.08625000000000005 0.07250000000000006 7.571388888888894 2.8944823232323227 5.053017676767678 13.911994949494954 0.3204166666666665 7.382828282828288 7.396666666666671 0.00016835016835159422 0.10291666666666666 -1.4684048821548794 -0.2836363636363657 23.034006734006734 0.08750000000000002 0.25249999999999995 13.168813131313131 5.592121212121215 -0.4160227272727204 -4.432659932659922 -0.5546969696969725 0.6013636363636314 4.773244949494951 0.8050378787878834 11.060332491582498 3.688308080808077 4.03987794612794 -0.008333333333333526 -1.6812499999999977 8.723968855218855 0.00416666666666643 1.8559469696969746 11.674957912457918 2.80140151515151 10.34537037037038 -1.749583333333331 0.9085479797979849 -0.6929166666666595 2.2272222222222213 5.9458585858585895 5.825000000000002 0.9252272727272681 0.3187500000000002 24.90718855218855 -1.8070833333333307 0.7315151515151567 2.2624747474747493 23.289646464646466 -0.3179166666666666 2.0002946127946197 13.362651515151525 -9.1257702020202 -0.04249999999999998 -0.029166666666674335 0.28125 -0.027083333333333126 -1.3712499999999974 -0.18499999999999994 2.1481944444444436 0.22499999999999987 -1.0243308080808011 1.9615530303030255 -0.09708333333333341 13.710963804713808 24.799978956228955 0.5133333333333381 0.2679166666666665 -4.970197811447803 8.521073232323236 0.054166666666666696 0.28499999999999986 0.3037500000000001 0.8962499999999998 7.541123737373737 5.528472222222224 -0.04791666666666661 1.0905597643097646 -0.024191919191921762 0.06666666666667354 0.30458333333333354 3.519061447811444 12.065909090909095 -1.467272727272725 0.16249999999999998 0.19041666666666668 5.831860269360265 -0.013749999999999873 25.19170454545455 4.8062121212121145 -1.6645833333333309 3.830639730639735 3.020934343434347 1.7994949494949568 2.689848484848481 -0.09999999999999998 -0.411931818181811 -3.366056397306397 0.3770833333333333 -0.049116161616159726 -1.9449999999999976 1.2856271043771095 0.5206439393939348 0.19208333333333333 10.243265993265988 0.6236784511784561 14.290399831649836 3.5779671717171673 -0.002083333333334103 6.332327441077437 1.9257196969696924 3.4770580808080767 6.707765151515147 4.6152904040404055 -0.02083333333333326 18.84920875420876 1.4794823232323226 0.25833333333333314 2.356481481481475 25.175294612794612 9.665883838383838 -1.3967171717171625 0.3404166666666668 -1.0010984848484779 0.047916666666659724 -1.9291666666666643 -4.6964983164983085 -1.7464141414141494 10.987436868686874 0.09886363636363926 13.760185185185186 0.08886363636363626 -0.033749999999999836 3.4830050505050467 22.46607744107744 -0.09166666666666656 9.995475589225585 0.06291666666666651 14.29399410774411 0.5056060606060557 0.9174999999999954 -0.43140151515151515 0.957765151515156 -0.0958333333333331 1.5953282828282878 8.974810606060602 1.352727272727277 0.6215530303030306 -0.04166666666666674 3.383922558922555 -1.7041666666666642 -0.0904166666666667 1.5270833333333382 0.7690193602693556 3.4582070707070667 1.1295833333333334 -0.2945833333333332 0.19833333333333325 0.1862499999999998 2.0282828282828276 -1.5552651515151537 3.6099494949494986 0.5893939393939349 6.301999158249165 0.945294612794612 6.131561447811451 0.7905303030302981 -0.18791666666666673 0.6735900673400625 6.40300925925926 1.4795833333333381 1.3437500000000049 0.8264015151515107 14.59869528619529 13.492041245791249 2.078030303030304 1.7602314814814806 -3.157474747474751 0.20386363636363924 18.34958333333332 3.198194444444441 1.5554166666666713 14.166296296296302 5.25703282828283 6.521380471380468 -3.1791035353535384 0.7170833333333382 1.227108585858585 0.7183333333333335 0.37472222222221907 5.618733164983168 11.860858585858585 -0.14375000000000004 1.5417213804713799 5.155559764309765 8.33600589225589 0.7908333333333382 0.013749999999999929 0.1562500000000001 6.337154882154878 1.7541666666666715 0.6031818181818135 -0.10429292929293199 4.459840067340069 0.8251515151515105 -0.6441666666666594 -2.0012499999999975 3.8419444444444406 -2.3925210437710347 -0.1954166666666668 7.029545454545455 12.74042508417509 -0.027083333333333126 0.7145833333333353 1.3222348484848556 4.04346380471381 0.22749999999999987 3.114065656565655 9.86858585858586 0.1362500000000002 0.05624999999999991 10.444490740740745 0.7625000000000022 0.23291666666666677 -1.8537499999999976 13.680387205387209 10.133577441077435 0.4216666666666666 2.428876262626263 0.6164772727272683 4.134053030303031 0.42929292929292506 0.2849242424242425 -0.883097643097638 1.4992929292929231 6.929932659932656 0.41246212121211867 1.209549663299667 0.1999999999999999 6.355214646464643 -0.7979166666666688 -0.08500000000000008 3.555088383838389 -4.733796296296293 3.7221590909090945 1.8008838383838375 -0.7219907407407333 4.845265151515152 11.825715488215494 0.484225589225594 13.222020202020206 7.028829966329962 5.546153198653203 0.18249999999999994 0.5988257575757574 0.3141666666666666 12.643960437710442 0.10291666666666682 8.513110269360268 -2.2351641414141383 -0.22250000000000003 3.1777904040404077 -0.12083333333333357 -0.0720833333333335 0.2158333333333331 24.865172558922556 8.410151515151515 0.15208333333333346 11.594991582491588 0.13874999999999976 1.7438720538720587 6.788594276094272 0.0075925925925866 0.00003787878787875343 0.5133333333333381 2.182878787878788 -0.25625 19.068232323232312 8.930202020202016 1.412487373737373 9.488371212121212 0.025833333333333375 4.428472222222222 6.167394781144777 -1.4610984848484825 17.37493686868687 0.5459469696969648 7.248535353535351 0.22617424242424244 0.9691666666666714 -0.13305134680134412 6.85025252525253 0.10249999999999998 10.367037037037033 4.1438552188552125 6.479398148148154 12.409469696969703 3.4998232323232283 0.25458333333333333 5.1832702020202035 21.70813973063973 3.2499368686868637 -0.2058333333333333 5.9372095959595965 0.4137500000000001 6.474221380471376 0.20666666666666678 5.0269234006734 0.5492803030303031 0.12708333333333321 -0.1412878787878833 0.11327020202020366 3.465593434343434 2.482398989898991 12.180959595959607 0.6726136363636315 -0.06188131313131073 2.7762626262626227 1.2535479797979816 1.7416666666666714 0.12083333333333357 2.8128661616161654 0.47060606060605603 -4.565046296296292 -0.9265151515151535 18.579924242424248 0.7971212121212123 3.876388888888893 4.282297979797979 11.520475589225596 0.31875 0.5484469696969649 1.1758585858585908 18.070244107744113 -0.8106818181818249 6.766182659932657 2.228623737373737 2.117373737373737 0.029166666666666563 3.2553282828282866 0.507803030303035 -0.6068055555555478 5.381805555555557 -0.061868686868689515 0.27238636363636803 -3.7451599326599303 0.12416666666666665 0.36590909090909096 6.795496632996628 -0.3554166666666668 0.24500000000000016 25.209065656565656 0.03708333333333341 0.3919065656565679 2.7569444444444384 0.14124999999999988 0.03958333333333308 1.8300000000000047 5.994061447811443 4.625176767676772 0.6060606060606015 0.8009469696969649 1.328030303030308 -1.9854166666666644 5.788143939393942 0.11291666666666678 0.5705303030302985 -0.2466666666666667 1.4763888888888859 -0.028207070707068294 6.078952020202021 0.20958333333333345 7.107878787878786 0.08333333333333326 3.1828535353535314 -2.659848484848493 1.7010058922558913 13.280744949494954 6.310441919191919 15.484313973063976 0.30999999999999983 4.662962962962959 0.3720833333333333 4.2882575757575765 0.4480765993265947 0.21708333333333346 -0.018371212121209846 -0.3191666666666667 15.058480639730638 -1.2416666666666598 0.0004166666666667873 1.8650000000000049 5.451329966329972 2.816250000000002 9.919356060606061 1.2143518518518563 -0.05208333333333337 -0.10250000000000015 0.19094696969696967 1.0358333333333378 0.07356060606060599 1.1664015151515201 -1.8279166666666642 1.8089646464646534 2.2567297979797973 25.060732323232322 0.6838636363636315 0.26594696969696974 0.3213257575757578 1.1696969696969663 0.9571212121212175 0.501675084175089 7.288333333333333 2.035972222222223 -0.2645833333333334 0.25833333333333325 -0.2170833333333333 2.275366161616161 -0.8607954545454612 0.5623106060606016 0.060883838383838595 -0.06875000000000009 1.010340909090914 6.233017676767672 5.096818181818183 0.7001893939393891 2.7471717171717094 1.209128787878785 1.384027777777776 7.222083333333334 -0.1941666666666667 -1.1307954545454615 0.4674621212121257 -0.060416666666666785 1.652424242424238 5.536654040404042 1.8560395622895567 0.0854924242424242 6.242340067340063 0.07499999999999307 0.4571254208754256 5.198758417508419 4.95741161616162 -0.0333333333333401 1.0592045454545505 0.30060606060605577 0.7954166666666715 -1.6063636363636387 10.47021043771044 13.005744949494954 0.08124999999999982 -1.8024999999999975 0.7352272727272682 5.47993686868687 -0.01666666666666683 4.303825757575751 -0.1754166666666669 5.603977272727276 0.17583333333333323 -0.3158333333333333 -1.5082954545454568 0.8937500000000046 1.825197811447816 0.18753787878787886 0.27916666666666656 3.451136363636367 0.32333333333333325 4.05875 2.21415404040404 3.3849621212121215 14.50156144781145 0.1970833333333334 7.214583333333334 4.019006734006739 -0.1545833333333334 0.8026052188552186 1.1990782828282847 -1.6364015151515177 0.05421717171717466 0.24208333333333332 5.85763888888889 6.731919191919188 3.5742003367003283 0.2883333333333335 1.321856060606059 -0.778409090909093 0.8400126262626282 0.46680555555555703 2.870833333333331 1.205303030303037 5.174347643097645 1.1426136363636412 1.4750505050505112 0.7747727272727227 -1.699166666666664 1.8638888888888874 6.057815656565659 0.7979166666666713 -1.8029166666666643 0.6145454545454594 13.69534932659933 0.0687500000000002 6.272095959595959 2.7736742424242373 0.5391666666666715 -1.4557575757575734 8.992500000000003 0.8877946127946177 0.32833333333333325 0.18541666666666667 0.16874999999999984 0.3508333333333288 -0.1070833333333332 9.998337542087537 0.5384175084175133 0.04166666666666674 -3.2278914141414172 -0.17304292929293208 3.41508838383838 5.5216919191919205 0.060833333333333184 1.150681818181825 11.46386784511785 13.924137205387208 2.204734848484848 -4.3648695286195185 5.5623400673400685 6.123232323232319 10.03943602693603 14.746502525252529 0.5166287878787929 16.31081649831649 -0.21750000000000003 2.20243686868687 0.2283333333333334 0.40310606060606047 -3.9973569023568913 0.5320833333333334 -1.6541666666666641 0.5054166666666713 0.08875000000000005 24.896127946127944 0.31416666666666665 4.689116161616163 -0.6756818181818112 4.807992424242425 -1.6681565656565625 3.917474747474741 0.14499999999999996 2.782929292929293 0.4131439393939371 0.18375000000000002 1.2279797979797995 1.882083333333338 0.4787499999999999 6.267003367003367 -0.04791666666666572 0.26041666666666663 4.789238215488221 0.3258333333333334 6.587605218855214 13.588446969696975 2.7460101010101026 -0.9971969696969628 0.02416666666666656 -0.52625 1.8008459595959598 1.627083333333338 4.283922558922553 7.638173400673395 2.1317045454545505 2.1137079124579117 4.840113636363636 -1.5691666666666642 3.462079124579121 1.028446969696965 24.913699494949494 0.23541666666666672 -0.09999999999999987 5.890416666666665 0.31041666666666634 5.438089225589218 0.1741666666666666 0.19166666666666665 0.3245833333333332 0.8216666666666712 8.38085016835016 0.1253030303030258 -0.004419191919191823 0.18958333333333327 3.163964646464645 0.05625000000000013 3.868392255892258 2.1804671717171717 13.769591750841755 -0.1512500000000001 14.743674242424246 19.66059764309765 0.17291666666666666 1.1208333333333331 2.630530303030305 0.7024999999999954 0.0616666666666667 1.105690235690235 25.113333333333333 1.1537878787878837 1.0235479797979814 12.619107744107755 19.300601851851855 0.05624999999999991 6.360500841750844 22.08125 4.052609427609422 0.02083333333333337 1.5693181818181863 3.8187079124579153 1.5441666666666714 3.1525252525252556 2.320896464646464 8.17654461279461 -0.8087499999999976 -0.28648989898990296 0.20791666666666653 6.4047601010101065 24.597466329966334 0.3604166666666668 -0.28625 9.407971380471375 3.012916666666664 14.347988215488218 0.16791666666666683 24.98299663299663 0.48958333333333803 14.181018518518522 0.006249999999999867 -0.029166666666652574 0.8856439393939349 2.44358164983165 5.700707070707073 13.673282828282831 10.117853535353536 0.2883333333333332 25.18475589225589 0.30255892255892736 0.35784090909090904 11.43975168350169 -0.13416666666666655 0.8032196969697014 1.508977272727277 25.45123737373737 1.4046212121212172 1.8726515151515106 1.1608333333333334 6.659684343434339 0.12916666666666676 -0.2183333333333335 -0.01666666666666683 1.650315656565656 -0.7523106060606131 3.2715782828282793 0.33791666666666687 3.6245622895622835 0.35257575757575743 1.7583333333333382 1.6604166666666718 2.2901515151515177 6.377310606060606 5.812457912457905 -0.27178030303030587 1.8836363636363587 5.529393939393943 0.11250000000000004 -0.27749999999999997 6.332070707070702 12.515395622895626 2.607512626262629 13.430155723905727 1.069356060606056 5.62638888888889 0.3654166666666715 4.066481481481476 17.52708333333334 15.02270622895622 -0.20666666666666667 0.1949999999999999 0.17007575757575766 1.9104166666666713 0.2391666666666667 -0.016654040404040282 -5.214414983164979 3.6887626262626223 0.30650252525252686 -0.1479166666666667 1.4581439393939437 -0.3551136363636389 14.435437710437714 -0.034583333333333466 5.059595959595958 0.04375000000000018 -0.09791666666666665 0.6133333333333381 0.016666666666666607 1.8776388888888882 -0.08208333333333351 3.817731481481478 -0.010189393939393776 0.46773989898990376 2.726401515151515 9.320568181818176 2.179339225589225 0.1275 -0.747117003367006 10.142045454545453 -0.5923232323232255 3.6492634680134626 8.522398989898988 0.6664393939393893 1.9539772727272777 6.049587542087545 -0.2004166666666667 -0.1449999999999999 5.437108585858588 0.6262500000000047 17.412878787878785 24.88470538720539 5.524305555555557 -0.022499999999999964 9.760416666666668 0.7630345117845168 7.459659090909091 9.9875 0.6288636363636316 4.672159090909089 -0.8325547138047136 0.3258333333333333 -0.1379166666666667 -0.04458333333333331 -1.013207070707061 0.2874621212121168 17.653425925925927 0.1854166666666665 2.063686868686868 0.16375000000000012 -0.019583333333333397 9.502356902356897 0.5863636363636315 8.338901515151516 4.411212121212121 14.586931818181823 0.39261363636363145 0.26333333333333336 3.373484848484851 -0.04458333333333331 0.8983459595959645 -0.02499999999999325 -0.4016666666666666 0.006553030303027896 1.5390404040404033 1.718939393939396 2.883674242424243 1.219848484848482 12.749600168350174 9.819583333333334 2.0128914141414134 1.616338383838379 14.8162962962963 -5.881056397306393 4.280904882154887 -0.2037500000000001 -0.35124999999999995 0.10749999999999993 13.328383838383843 0.07625000000000004 0.9802609427609568 0.19837121212121211 -0.04166666666666674 23.691300505050506 1.7224747474747482 0.9194570707070779 -0.10541666666666671 -0.17984848484848737 5.7324074074074005 0.3882954545454531 0.062499999999992895 0.44041666666667145 0.6729840067340117 0.8214478114478037 -0.07499999999999996 0.2704166666666666 0.3171212121212166 0.24166666666666636 13.190530303030306 4.406292087542094 12.950336700336702 5.634911616161616 5.497222222222224 -2.7061447811447747 4.640046296296294 9.107407407407415 0.05333333333333329 0.024431818181818277 0.5612500000000048 -0.039583333333333415 0.3104166666666667 5.221275252525254 7.5625 2.4171127946127937 1.9584722222222215 0.22458333333333347 10.240252525252524 1.9816666666666665 -1.3287499999999977 0.08049242424242653 3.939036195286195 9.610037878787878 -0.15500000000000003 0.4941666666666712 1.0385858585858634 2.5229292929292937 0.35471380471380476 -0.06041666666666656 0.28583333333333333 5.128320707070709 3.327095959595961 2.6280092592592554 -1.8029166666666643 5.589541245791239 0.5869318181818133 6.345883838383841 5.211035353535352 3.2017045454545494 -1.3853114478114366 -1.9895833333333308 13.040235690235699 -1.5154166666666642 3.78819444444444 -0.013409090909091037 1.5840530303030294 4.428114478114477 0.5894191919191938 0.02499999999999991 24.125050505050506 -0.32217171717170967 0.5254545454545503 6.941691919191914 -1.5840025252525145 17.42047558922559 0.5286279461279508 -1.8587499999999975 0.2802525252525302 6.576704545454541 0.08666666666666678 5.966750841750845 -0.3082659932660008 -0.7858333333333265 4.865530303030303 0.3395833333333333 0.8470833333333285 25.06911616161616 17.741750841750832 -0.07916666666666683 4.470029461279463 5.445744949494948 5.1619949494949475 24.457622053872058 4.547912457912452 -0.03333333333334032 -1.0549284511784445 3.5113005050505004 0.8895833333333285 1.915000000000005 1.1909343434343427 -0.1941666666666667 0.23083333333333333 15.852714646464646 -0.015416666666666745 4.328787878787881 0.7438636363636315 -3.8493728956228965 4.533388047138047 -0.14250000000000007 1.083110269360274 4.250643939393938 0.13500000000000023 0.5672264309764359 -0.8724158249158223 0.15988636363636355 1.6758333333333382 -0.007500000000000062 +scenario heads-up fish (memory) +deals 1000 +seed 1592590337 +counts 7339 15 0 +samples -0.054166666666666585 0.41369949494949076 0.8708712121212139 3.5315319865319896 3.4359217171717242 0.13560606060606095 0.1299999999999999 0.6230429292929318 4.173556397306408 0.9525378787878839 0.7733459595959598 11.918724747474755 3.4404545454545405 8.147828282828275 -0.12208333333333332 -0.16333333333333333 -0.7604545454545386 1.1058333333333334 0.22791666666666666 -0.1216666666666667 0.24128787878787894 0.2029166666666668 48.2616835016835 -7.802436868686868 0.2675 0.30916666666666676 1.54699074074074 0.36 0.8837373737373784 -1.011010101010096 4.051317340067342 1.133787878787884 0.14734848484848484 1.6031144781144773 0.5140446127946177 0.2958333333333335 13.896700336700343 0.08579966329966804 -0.43996212121212075 -0.27541666666666664 0.38333333333333336 0.5371590909090912 0.2711489898989903 0.5045791245791248 0.545643939393944 0.0025000000000000022 3.4413383838383798 43.61691077441079 1.0277904040404062 1.9533333333333311 2.3847474747474795 -0.0625 0.43318181818181545 6.469911616161611 0.5410227272727319 -46.147083333333335 1.2212962962962932 -0.12916666666666665 -0.013333333333333308 1.0324074074074026 0.8264141414141442 -0.7818939393939394 0.031666666666666676 0.01868686868686864 1.0440909090909094 -0.04083333333333333 0.13967171717171717 1.104865319865322 1.5296548821548814 6.183918350168347 2.068968855218862 0.015833333333333588 4.07010101010101 2.203863636363641 7.337037037037037 1.301616161616162 1.6541666666666714 1.5078072390572363 1.0591666666666715 -0.05833333333333335 0.8479124579124535 19.290517676767667 7.7916329966329965 19.015757575757583 2.0576809764309756 0.2427020202020158 2.862866161616161 2.4709343434343425 0.16484848484848486 2.961843434343438 -0.004166666666666652 3.258030303030307 0.8535353535353611 3.914814814814809 0.03916666666666668 0.09166666666666662 0.24208333333333332 -0.16992845117845534 1.213354377104379 0.016666666666666607 0.4442087542087494 1.8819444444444446 -0.1412500000000001 4.476540404040399 1.3092676767676814 2.9533838383838367 1.0241666666666664 -0.05500000000000005 1.0424999999999953 0.0008333333333332416 49.346632996633 -3.7060016835016834 -0.08625000000000005 0.07250000000000006 4.838055555555563 2.8944823232323227 8.90066077441077 33.529671717171716 0.3204166666666665 0.029166666666666674 -0.027500000000000024 1.8181986531986525 0.10291666666666666 1.3703156565656598 -0.345 4.01486531986532 0.9208333333333286 0.07174242424242427 11.708375420875424 7.151885521885527 0.5385227272727271 -37.87121212121212 -0.2516666666666668 0.45098484848484843 5.331489898989899 2.3605934343434334 3.400972222222226 0.9867087542087568 6.142760942760939 0.33541666666666653 0.6941708754208779 1.5661405723905724 -0.007083333333333441 0.7575505050505098 11.674957912457918 1.5237121212121165 -22.6753367003367 -0.805138888888889 0.9085479797979849 -0.09083333333333332 0.0050000000000001155 5.822121212121216 0.23749999999999982 0.6600757575757574 -1.6130681818181816 -0.0033333333333332993 0.020833333333333315 0.7315151515151567 -0.02691919191919201 1.5964646464646437 -0.3179166666666666 0.4447390572390624 0.8626515151515107 2.1402104377104436 0.030000000000000027 -0.029166666666667673 0.28125 -0.1233333333333333 0.5681439393939396 0.030000000000000027 2.1209217171717163 0.31666666666666665 0.5124494949494951 0.4009469696969696 -0.09708333333333341 1.8000210437710478 1.466645622895621 -0.15333333333333332 0.2679166666666665 0.15236111111111295 5.920252525252528 -2.4458333333333333 0.28499999999999986 0.3037500000000001 0.8962499999999998 3.6446590909090903 1.403333333333338 -0.16416666666666668 1.1221254208754239 -0.008333333333325976 0.06666666666667354 0.4611489898989901 0.7412836700336654 11.487626262626266 0.15393939393939393 0.16249999999999998 0.19041666666666668 0.5807702020202068 0.7842297979798032 24.728068181818184 0.2516666666666666 0.002083333333333215 0.08747474747474737 0.2532575757575757 -0.2005050505050503 3.0304208754208743 -0.040000000000000036 1.0118055555555603 10.218118686868678 0.3770833333333333 0.055597643097638816 -0.03583333333333333 0.580239898989899 1.362394781144781 0.19208333333333333 3.7021885521885483 0.6236784511784561 5.17693181818182 -0.02304292929292928 1.0952146464646528 0.692596801346797 0.5923863636363638 0.0840151515151516 1.151872895622898 3.1180808080808093 0.2452020202020202 -0.015833333333333366 -0.07416666666666671 0.25833333333333314 0.041666666666666075 14.788762626262631 -0.12628787878787873 2.6922222222222274 0.3404166666666668 0.6655681818181864 0.5782196969696924 -0.13749999999999996 0.29424242424242175 -0.25462121212121214 -2.9620580808080774 0.13217171717171716 14.510185185185188 -1.3315909090909093 -0.02749999999999997 0.09916666666666651 18.71563973063973 -0.4379166666666666 4.809507575757575 -0.32666666666666666 -0.15156565656565657 -0.15500000000000003 0.9174999999999954 -0.24958333333333338 0.4842803030303029 0.04375000000000018 0.24356060606060637 -0.6290151515151515 5.241616161616163 0.6215530303030306 0.24208333333333326 4.543598484848483 -0.03749999999999987 -0.0904166666666667 -0.13958333333333317 0.7690193602693556 3.210656565656565 1.1295833333333334 0.011666666666666714 0.19833333333333325 0.1862499999999998 2.0282828282828276 -0.019999999999999962 3.6099494949494986 3.3671717171717135 30.832575757575764 0.8511026936026935 6.123985690235693 2.014419191919191 -1.0515530303030305 0.15349747474747477 3.7895412457912503 1.4795833333333381 -0.03166666666666673 0.37185606060606097 5.517045454545463 4.214936868686878 0.9669191919191966 2.121847643097642 -0.07666666666666666 0.1846717171717171 2.35867424242424 1.2773190235690235 1.5554166666666713 0.20333333333333353 1.2999621212121253 0.95740740740741 -0.030113636363636398 0.19643939393939397 2.7978156565656525 0.7183333333333335 0.31916666666666194 -0.024848484848484897 10.585606060606063 -0.14375000000000004 1.0967718855218873 5.824751683501686 9.827167508417505 0.12416666666666676 -0.015000000000000013 0.1562500000000001 1.4234343434343457 0.35833333333333334 0.03500000000000003 -0.10429292929293199 2.9376178451178423 5.722457912457911 0.35583333333333345 -0.859520202020202 3.8419444444444406 2.255290404040407 -0.00666666666666671 0.9121212121212099 0.24742424242424232 0.9198863636363608 -13.407828282828277 0.4495075757575864 1.0803114478114457 0.22749999999999987 4.502954545454548 9.853434343434344 0.1362500000000002 0.05624999999999991 2.033745791245797 -1.5708333333333333 0.23291666666666677 -0.003333333333333355 1.5272727272727327 1.1716666666666615 0.27166666666666667 1.393522727272732 1.222537878787884 2.770416666666667 0.5967424242424213 0.30815656565657057 0.6860101010101056 -0.0033333333333332993 6.9147811447811405 1.07912878787879 -0.6052651515151426 -2.3000000000000003 6.355214646464643 -0.27708333333333324 -0.08500000000000008 1.5222601010101053 1.8356397306397298 0.7734848484848484 1.8008838383838375 -0.7219907407407333 0.5081439393939392 0.025000000000000022 0.484225589225594 3.9863299663299747 32.353409090909096 -0.21260101010101007 0.18249999999999994 0.9185227272727319 0.3141666666666666 12.30305134680135 -1.9993560606060607 4.225231481481481 1.4104587542087546 -0.13083333333333336 3.1777904040404077 0.014797979797979699 -0.0720833333333335 0.10752525252525236 -0.027083333333333237 2.410151515151515 -1.6219065656565652 -0.4150127946127853 0.13874999999999976 1.7438720538720587 0.7700757575757597 7.337222222222223 0.4268055555555512 -0.15333333333333332 0.09219696969696961 -0.010000000000000009 0.009166666666666656 8.263535353535351 5.446157407407403 1.8974621212121217 0.5590909090909139 0.956250000000005 6.167394781144777 0.1861363636363637 0.5113005050505006 0.9335606060606106 8.427491582491582 0.030277777777777737 0.9691666666666714 0.8332786195286246 4.271414141414148 0.10249999999999998 1.0744444444444405 1.829040404040403 25.809196127946134 5.561111111111114 5.902348484848483 0.25458333333333333 -0.018750000000000044 -31.217819865319857 1.1350378787878743 -0.2058333333333333 6.108005050505051 0.4137500000000001 0.0021464646464647297 -0.008333333333333304 1.807226430976431 0.5492803030303031 1.1270833333333332 -0.24431818181818188 0.779936868686868 1.704987373737373 2.3611868686868727 7.875909090909091 1.7382702020202012 0.4984848484848532 1.4872727272727246 1.3515909090909073 -0.10750000000000004 0.12083333333333357 0.09670454545454554 3.248383838383835 1.02785353535354 1.4187037037037062 4.953661616161618 0.7221212121212122 0.05583333333334406 0.4211868686868687 11.10279882154883 0.47026515151515635 0.4815151515151518 1.1758585858585908 -23.60164141414141 0.7953787878787835 2.0986742424242415 0.38518939393939433 1.6914478114478106 0.029166666666666563 1.0331060606060583 0.507803030303035 0.25178030303030297 0.015000000000000013 -0.061868686868689515 -1.0533712121212053 0.24772727272727268 0.12416666666666665 0.3354377104377151 1.0281649831649853 -0.3554166666666668 0.24500000000000016 0.22371212121212147 0.03708333333333341 2.6141287878787893 -0.020833333333340365 0.14124999999999988 -0.19666666666666677 1.8300000000000047 5.994061447811443 26.761725589225584 1.444444444444444 0.8009469696969649 0.038257575757575824 -0.0024999999999999467 -21.646199494949496 0.29833333333333334 1.804537037037036 0.2732828282828329 2.9780723905723834 0.27482323232323735 1.9937247474747477 0.20958333333333345 -20.64767676767677 0.33333333333333326 3.3240993265993257 0.38308080808080336 1.5666624579124568 0.18103956228956009 0.1917550505050506 -18.45507996632997 1.4766666666666712 4.405387205387205 0.3720833333333333 3.2562710437710436 0.4480765993265947 0.3525 -1.5335227272727339 -0.04416666666666669 2.639654882154879 0.00833333333333336 -0.25166666666666665 0.19833333333333347 -22.463400673400674 3.232916666666671 -0.08973484848484825 4.2118265993266 -0.05208333333333337 -0.10250000000000015 -0.04535353535353537 1.0358333333333378 -0.21999999999999997 4.639217171717171 -0.5021590909090907 0.14229797979798198 0.70117424242424 2.7854671717171717 0.13462121212121203 0.8127272727272774 -0.0008333333333332971 3.8606607744107704 0.13636363636363635 0.40950336700337187 9.83176767676768 -0.13069444444444445 -0.2645833333333334 0.25833333333333325 -0.2170833333333333 2.2120664983164917 0.7907196969696926 1.2584553872053865 0.19911616161616164 0.050000000000000044 1.4497348484848438 5.476620370370371 0.9301515151515106 0.308030303030303 3.463922558922559 0.9316666666666666 -0.4191666666666689 9.722083333333334 0.033333333333333326 0.1293055555555554 -0.1073484848484848 -0.026666666666666616 0.7746464646464694 0.08204545454545459 2.275231481481476 0.17659090909090908 1.6127104377104369 0.07499999999999307 0.3372601010101009 5.198758417508419 8.462031144781154 1.4178451178451197 0.3682954545454544 6.3324242424242385 0.1568181818181818 0.867542087542083 0.5328282828282829 1.6123400673400738 0.20999999999999985 -0.13583333333333325 0.8831439393939349 1.1684848484848485 -0.1759848484848484 6.618640572390568 -0.004166666666666707 5.603977272727276 0.17583333333333323 0.18575757575757568 0.02958333333333335 0.2270833333333332 0.1968308080808081 0.1028787878787879 0.2623316498316519 3.1152777777777816 0.32333333333333325 3.1521843434343433 0.6585984848484897 -0.4029166666666667 1.4840530303030346 0.1970833333333334 -0.28541666666666654 0.007499999999999951 0.04166666666666663 -0.3247474747474748 3.0955429292929253 0.03749999999999998 0.5086363636363638 -0.6309343434343411 0.3020833333333334 8.990168350168348 -0.31358585858585863 0.2883333333333335 1.567647306397311 1.935395622895622 -16.915879629629654 0.01749999999999996 3.984166666666667 0.6166666666666714 -0.14570707070707067 0.4039772727272726 -0.17393939393939395 -0.365 -0.19499999999999995 1.8638888888888874 2.3120244107744172 0.6160984848484898 0.030000000000000027 2.1701010101010096 13.69534932659933 0.5535984848484901 2.27209595959596 9.1869739057239 0.030000000000000027 0.18800505050505045 7.102601010101008 1.9357744107744153 0.018333333333333313 0.4083333333333333 0.16874999999999984 0.3508333333333288 1.5595833333333382 1.1119949494949446 1.811144781144781 0.7083333333333381 -0.14708333333333334 -2.1048611111111137 0.9260311447811471 0.40553030303030324 0.060833333333333184 1.150681818181825 11.46386784511785 4.804608585858593 0.9411742424242471 36.7647601010101 0.16020202020202046 1.493602693602693 45.284772727272724 1.7522264309764357 -0.15988636363636355 1.987584175084173 -0.21750000000000003 -1.928034511784508 0.2283333333333334 0.9096717171717167 -37.133383838383835 1.7189520202020196 -0.29249999999999987 -0.16125000000000012 0.08875000000000005 24.855723905723906 0.31416666666666665 0.8002272727272703 0.32431818181818184 2.4746590909090895 0.12199494949494949 6.097946127946123 0.28704545454545455 -0.05469696969696969 0.02509680134679715 0.3441666666666667 -8.225892255892251 0.2154166666666667 0.4787499999999999 6.650673400673416 -0.2721506734006738 0.26041666666666663 -43.43415404040404 1.239974747474753 16.16777777777778 12.679356060606064 -4.788333333333345 0.4883333333333334 1.2362878787878837 0.1404166666666623 -0.05824494949495129 0.1791666666666667 0.29368686868686855 14.950883838383838 0.28321969696969707 0.7248190235690258 0.12420454545454529 0.09750000000000014 3.6688131313131302 2.102521043771043 0.16268939393939413 0.23541666666666672 -0.09999999999999987 -1.6095833333333358 0.31041666666666634 -1.94258838383838 0.1741666666666666 0.19166666666666665 0.3245833333333332 0.5186363636363682 2.0057575757575776 0.6561111111111065 -0.004419191919191823 0.18958333333333327 10.23332491582491 2.077424242424243 3.868392255892258 0.18046717171717175 13.162015993266 -0.15333333333333332 0.1921590909090909 -0.2569107744107768 0.17291666666666666 0.12083333333333324 2.630530303030305 0.7024999999999954 0.0616666666666667 0.7551262626262624 0.11333333333333334 0.25 4.808059764309758 -0.15404040404040398 1.7561574074074129 0.05624999999999991 8.843665824915824 1.8009469696969669 6.08333333333333 0.02083333333333337 1.099166666666674 -0.09375000000000022 0.0025000000000000577 0.9303030303030275 2.192108585858585 7.997756734006731 -0.14208333333333345 -0.28648989898990296 0.20791666666666653 1.8071170033670159 25.263122895622896 0.3604166666666668 -0.014999999999999958 2.926489898989894 -0.06000000000000005 0.6392676767676745 0.16791666666666683 7.457744107744108 -0.6424999999999976 14.527495791245794 1.6729166666666713 -28.190446127946124 0.374469696969697 1.0546927609427637 9.798350168350163 22.818324915824917 0.10977272727272724 0.2883333333333332 0.3409848484848485 0.30255892255892736 0.13056818181818175 4.2187500000000036 -0.13416666666666655 0.5162878787878833 0.3448358585858591 24.990479797979795 0.5334090909090907 2.539318181818182 1.1608333333333334 2.0300547138047134 0.12916666666666676 -0.18500000000000005 0.33333333333333304 5.947293771043769 1.8234469696969695 6.608110269360266 0.33791666666666687 1.3097474747474742 0.35257575757575743 0.09166666666666667 1.6604166666666718 0.3962121212121186 -0.06814393939393948 4.443771043771038 1.3948863636363655 0.18666666666666654 5.17426767676768 0.11250000000000004 -0.27749999999999997 6.213383838383834 12.082567340067346 3.680744949494952 4.193455387205395 -1.64655303030303 0.07083333333333319 1.2669318181818152 6.261599326599322 6.415193602693607 3.3560395622895633 -0.20666666666666667 0.1949999999999999 -0.011742424242423999 0.2437499999999999 0.014166666666666716 1.3166792929292883 0.2970454545454546 3.597853535353531 0.5842803030302981 3.990972222222216 5.1765782828282845 -0.3551136363636389 1.283080808080813 -0.034583333333333466 -0.047904040404040615 -0.0724999999999999 -0.09791666666666665 0.07361111111111102 0.016666666666666607 -0.029999999999999916 -0.08208333333333351 8.572781986531997 -0.010189393939393776 0.46773989898990376 1.1582196969696943 9.642285353535348 5.043817340067344 0.1275 0.9195496632996584 0.3636363636363633 1.0743434343434388 1.178198653198646 1.9314898989898994 1.0684595959595955 1.6585227272727323 5.968779461279465 1.4662500000000047 -0.1449999999999999 0.41185606060606095 0.06881313131313138 0.2252651515151512 -0.3363383838383838 5.893055555555557 0.14500000000000002 -0.043333333333333335 5.27136363636364 6.459659090909091 9.9875 1.6709511784511775 4.672159090909089 -0.037904040404040384 0.719772727272732 -0.1379166666666667 0.04916666666666669 -3.277474747474738 0.2874621212121168 0.33861111111111103 0.1854166666666665 2.040959595959595 0.16375000000000012 0.01666666666666672 9.502356902356897 0.5863636363636315 7.772651515151515 -0.09750000000000003 14.478345959595964 -0.029166666666666785 0.3383333333333333 0.25 -0.04458333333333331 0.6975883838383888 -0.02499999999999325 -0.4016666666666666 0.3095833333333333 1.4850000000000017 5.008585858585862 1.2902398989899009 0.6221717171717172 1.3573442760942807 3.9558333333333335 2.634608585858585 4.727449494949493 5.742222222222231 0.5872727272727273 -0.04327020202019849 0.012499999999999845 0.015000000000000013 0.4650757575757576 1.4275420875420854 0.07625000000000004 -15.269739057239057 0.0279166666666667 -0.04166666666666674 7.549242424242429 1.9295454545454607 0.21945707070708131 -0.10541666666666671 -0.00833333333333336 6.282483164983161 3.6808880471380427 0.02499999999999991 -0.02250000000000002 0.6729840067340117 3.466060606060609 0.15000000000000013 0.2704166666666666 -0.5940909090909067 1.0291666666666712 0 4.413350168350175 0.2785227272727271 0.3432070707070707 1.6083333333333383 0.43988636363636124 5.9113425925925895 18.35202020202021 0.05333333333333329 0.2062500000000001 -0.1054166666666666 -0.039583333333333415 0.6831439393939345 -0.21886363636363637 2.247222222222222 0.9716582491582514 0.14800505050505042 0.22458333333333347 0.8917676767676747 -0.018333333333333535 -0.010833333333333361 0.6744318181818183 4.777756734006738 3.5746843434343436 -0.0024999999999999467 -0.1725000000000002 1.2045791245791233 0.2927272727272727 -0.3196969696969697 -0.06041666666666656 0.28583333333333333 0.5614015151515155 1.958409090909086 1.333602693602689 -0.13624999999999998 5.763783670033666 3.2384595959595917 6.842516835016834 5.088476430976429 2.2683712121212194 -0.2769318181818182 -0.1166666666666667 -0.3364772727272727 -0.9193181818181817 0.17708333333333326 -0.013409090909091037 1.5840530303030294 1.189154040404043 0.9106313131313126 0.02499999999999991 0.14340909090909038 0.45156565656565684 0.642121212121217 0.8635774410774433 0.41094696969697014 0.5307449494949497 0.5286279461279508 -0.1316666666666667 0.6316919191919241 4.156502525252524 -0.0008333333333333526 -0.029999999999999916 0.6555387205387198 0.021666666666666667 0.7439183501683497 0.3395833333333333 0.8470833333333285 0.07643939393939408 1.0148989898989904 -0.07916666666666683 1.8233501683501676 5.445744949494948 2.939772727272726 0.28784090909090937 2.233097643097642 0.7232196969696925 0.0016666666666665386 3.694633838383834 2.199347643097642 1.915000000000005 0.7682070707070721 0.048333333333333284 0.48083333333333333 15.43604797979798 -0.4415530303030304 4.101515151515153 1.831818181818177 -1.997521043771049 0.7345664983164957 0.0024999999999999467 0.9639183501683548 1.13953282828283 0.5289393939393989 0.510408249158254 -13.16349326599326 0.15988636363636355 0.009166666666666712 3.4142171717171674 +scenario heads-up calling station (memory) +deals 1000 +seed 1592590337 +counts 7826 1 0 +samples 0.45773569023569527 7.349726430976429 0.07087121212120961 4.463855218855219 5.964406565656569 1.7012626262626247 0.1299999999999999 6.355366161616169 13.735648148148151 0.9525378787878839 0.7733459595959598 13.105088383838387 -3.5039898989899023 8.147828282828275 -0.12208333333333332 -0.16333333333333333 1.0627777777777805 1.1058333333333334 0.5688257575757576 -0.1216666666666667 1.600378787878793 0.2029166666666668 8.761683501683502 12.621553030303028 0.26958333333333323 0.30916666666666676 6.451872895622891 0.3225000000000001 3.1059595959595994 -0.8227946127946073 4.304852693602696 1.133787878787884 9.793813131313133 6.40951178451178 0.5140446127946177 0.2958333333333335 9.826531986531988 1.641355218855218 0.014583333333333504 -0.27541666666666664 0.38333333333333336 1.87049242424242 1.1836069023569074 0.5045791245791248 -0.22708333333333341 0.6691666666666714 3.4413383838383798 18.53204545454546 7.094793771043767 23.74121212121212 1.1433333333333402 0.9375 2.2160101010101 6.5835479797979755 0.5410227272727319 -1.3970833333333337 1.2212962962962932 -0.12916666666666665 0.9866666666666667 10.291666666666663 6.844932659932656 1.6575000000000046 5.196649831649834 1.1146464646464693 4.129318181818182 -0.04083333333333333 0.45515993265993754 6.492070707070702 1.5296548821548814 3.227268518518515 2.068968855218862 0.015833333333333588 4.07010101010101 2.203863636363641 24.892592592592592 -1.5519191919191897 1.6541666666666714 24.881544612794613 1.0591666666666715 -0.05833333333333335 16.926195286195288 25.175366161616164 25.307794612794613 6.330909090909096 2.0576809764309756 0.4245202020201977 2.373977272727274 7.100563973063969 2.9416161616161656 2.961843434343438 -0.004166666666666652 3.258030303030307 12.214562289562293 6.229629629629626 0.03916666666666668 0.09166666666666662 0.24208333333333332 2.447916666666667 2.602243265993265 0.016666666666666607 0.023333333333333206 6.51157407407407 -0.1412500000000001 3.365429292929292 1.3092676767676814 2.9533838383838367 1.0241666666666664 -0.05500000000000005 5.2091666666666665 0.6675000000000046 25.596632996632998 -0.17990740740740652 -0.08625000000000005 0.07250000000000006 6.738055555555558 2.1217550505050498 9.014297138047136 13.911994949494954 0.3204166666666665 7.645328282828288 7.639166666666671 1.931835016835016 0.10291666666666666 -1.4684048821548794 0.655 8.228602693602696 1.7541666666666713 0.42325757575757583 12.02403198653199 7.336228956228961 1.917310606060601 -4.432659932659922 -0.2516666666666668 0.019166666666666665 5.649671717171717 2.3605934343434334 -1.2286574074074004 6.53174242424242 6.210942760942757 0.33541666666666653 2.0830597643097635 8.723968855218855 -0.007083333333333441 1.6292676767676837 12.169907407407415 1.5237121212121165 -0.02499999999999858 -0.08291666666666675 0.9085479797979849 1.7424999999999953 2.2272222222222213 5.9458585858585895 -1.4291666666666645 0.3191666666666666 0.3187500000000002 7.617542087542093 0.020833333333333315 0.7315151515151567 1.381666666666662 23.289646464646466 -0.3179166666666666 0.4447390572390624 10.180833333333334 0.019166666666665222 0.030000000000000027 -0.029166666666667673 0.28125 -0.1233333333333333 1.9014772727272682 0.030000000000000027 1.0749621212121165 0.22499999999999987 0.8760858585858633 2.628219696969697 -0.09708333333333341 13.710963804713808 24.799978956228955 0.5133333333333381 0.2679166666666665 2.65741161616162 4.44363215488216 0.054166666666666696 0.28499999999999986 0.3037500000000001 0.8962499999999998 3.8719318181818174 5.2922222222222235 -0.16416666666666668 1.0905597643097646 2.364898989898994 0.06666666666667354 3.445997474747479 10.000542929292925 12.065909090909095 0.19939393939393935 0.16249999999999998 0.19041666666666668 1.8499621212121165 0.7842297979798032 25.19170454545455 6.4577272727272685 0.002083333333333215 2.1989225589225585 0.8775 2.132828282828285 4.141531986531982 -0.040000000000000036 3.234027777777782 -1.9771675084175042 0.3770833333333333 0.055597643097638816 -0.03583333333333333 4.99774831649832 1.362394781144781 0.19208333333333333 13.484006734006728 0.6236784511784561 18.82743686868687 6.168034511784508 -3.023303872053864 0.22458333333333347 1.9257196969696924 1.7809848484848438 6.707765151515147 1.350404040404042 -0.008333333333333304 7.619183501683507 -0.07416666666666671 0.25833333333333314 0.041666666666666075 14.804924242424248 9.824217171717171 2.0700000000000003 0.3404166666666668 -0.06625000000000003 0.5782196969696924 -0.13749999999999996 0.33666666666666667 1.0075 8.933564814814815 3.1291414141414178 14.593518518518522 0.2024999999999999 -0.02749999999999997 0.09916666666666651 17.836447811447815 -0.4379166666666666 4.809507575757575 -0.32666666666666666 -0.09499999999999997 -0.15500000000000003 0.9174999999999954 -0.24958333333333338 0.957765151515156 0.04375000000000018 1.5953282828282878 -0.060833333333333295 5.241616161616163 0.6215530303030306 0.24208333333333326 4.621881313131311 -0.03749999999999987 -0.0904166666666667 1.5270833333333382 0.7690193602693556 1.9283333333333386 1.1295833333333334 0.6783333333333381 0.19833333333333325 0.1862499999999998 2.0282828282828276 -0.019999999999999962 3.6099494949494986 3.3671717171717135 8.982744107744114 0.3241666666666667 6.131561447811451 3.4033080808080767 -0.18791666666666673 0.3024873737373738 -2.671064814814809 1.4795833333333381 0.6350000000000047 0.8264015151515107 14.59869528619529 13.492041245791249 3.1891414141414183 6.798952020202016 -0.07666666666666666 3.181641414141418 24.182916666666664 6.156948653198649 1.5554166666666713 14.166296296296302 5.25703282828283 6.521380471380468 -0.14375000000000004 0.33280303030303515 1.9897348484848532 0.7183333333333335 3.3469444444444405 5.791649831649835 10.968602693602696 -0.14375000000000004 1.0967718855218873 4.322226430976436 8.33600589225589 0.7908333333333382 -0.015000000000000013 0.1562500000000001 6.337154882154878 0.08750000000000008 0.03500000000000003 -0.09166666666666656 3.2066414141414112 5.722457912457911 1.3558333333333334 -0.09083333333333332 3.3419444444444406 -2.3925210437710347 0.6600000000000047 7.029545454545455 14.505841750841753 1.2978324915824915 -2.7596801346801305 1.3828409090909162 5.710130471380475 0.22749999999999987 3.1393181818181843 8.201919191919195 0.1362500000000002 0.05624999999999991 2.033745791245797 0.7625000000000022 0.23291666666666677 -0.003333333333333355 13.680387205387209 17.44628787878788 2.088333333333338 0.004633838383838906 1.222537878787884 2.770416666666667 0.5967424242424213 0.30815656565657057 0.6860101010101056 0.6633333333333381 6.929932659932656 0.6245833333333382 -0.6052651515151426 0.1999999999999999 6.355214646464643 0.22291666666666676 -0.08500000000000008 3.555088383838389 0.1883333333333333 15.173316498316503 0.04583333333333317 -0.7219907407407333 2.6104166666666666 3.5627104377104386 0.484225589225594 13.222020202020206 7.028829966329962 5.546153198653203 0.18249999999999994 0.9185227272727319 0.3141666666666666 12.643960437710442 0.10291666666666682 2.1604166666666664 6.165340909090905 -0.13083333333333336 3.1777904040404077 0.3885353535353534 -0.0720833333333335 0.6127441077441123 24.865172558922556 8.410151515151515 0.15208333333333346 22.304983164983167 0.13874999999999976 1.7438720538720587 3.547853535353531 7.803888888888887 0.6313510101010058 0.5133333333333381 4.358863636363637 -0.010000000000000009 10.005126262626263 8.263535353535351 5.673430134680131 9.488371212121212 0.5590909090909139 4.845138888888891 6.553758417508413 3.156843434343438 17.37493686868687 0.9335606060606106 9.427491582491582 0.9868434343434391 0.9691666666666714 0.8332786195286246 4.37444444444445 0.10249999999999998 9.700370370370369 6.458670033670029 6.538320707070711 4.0787878787878835 5.902348484848483 0.25458333333333333 5.1832702020202035 7.4655134680134685 3.2499368686868637 -0.2058333333333333 6.153459595959596 0.4137500000000001 3.2071969696969735 0.6583333333333381 8.751670875420873 0.5492803030303031 1.7937500000000046 -0.0625 0.11327020202020366 2.783775252525252 3.0884595959596 4.0183333333333335 1.7382702020202012 0.4444444444444491 0.8115151515151584 1.4728030303030282 2.3924999999999996 0.12083333333333357 2.8128661616161654 3.248383838383835 0.5258333333333334 2.1762794612794605 18.579924242424248 0.3766666666666669 0.6780555555555572 4.282297979797979 11.520475589225596 0.47026515151515635 3.1431313131313168 1.948585858585854 18.070244107744113 0.34083333333333327 6.766182659932657 3.6175126262626227 6.321077441077437 0.029166666666666563 4.366439393939394 0.507803030303035 0.28208333333333324 2.237222222222221 -0.04166666666666641 -1.0533712121212053 1.535606060606056 0.790833333333338 0.3354377104377151 7.077996632996628 -0.3554166666666668 0.24500000000000016 25.209065656565656 0.03708333333333341 2.6141287878787893 2.6685606060606037 0.14124999999999988 -0.19666666666666677 5.71888888888889 5.994061447811443 8.33477272727272 6.074074074074071 0.8009469696969649 0.3337121212121261 -0.0024999999999999467 5.788143939393942 0.11291666666666678 1.804537037037036 0.2732828282828329 2.9780723905723834 2.497045454545459 4.257234848484849 0.20958333333333345 -1.1621548821548782 0.33333333333333326 3.3240993265993257 0.6482323232323185 1.7010058922558913 5.098547979797983 6.310441919191919 9.930441919191919 1.4766666666666712 2.705050505050504 0.3720833333333333 2.2461700336700305 0.2154166666666668 1.656477272727277 -3.8483375420875436 -0.04416666666666669 15.058480639730638 1.0083333333333333 -0.25166666666666665 0.19833333333333347 7.7846632996633005 3.232916666666671 8.252689393939397 4.572937710437712 -0.05208333333333337 0.5641666666666713 0.907171717171722 1.0358333333333378 -0.21999999999999997 4.639217171717171 -0.1612499999999999 2.4958333333333336 2.2567297979797973 9.79304292929293 0.6838636363636315 0.8127272727272774 -0.0008333333333332971 1.1586405723905688 0.48484848484848986 -1.1649915824915753 9.83176767676768 3.1470833333333372 -0.2645833333333334 0.25833333333333325 -0.2170833333333333 3.415770202020201 0.26041666666666674 1.2584553872053865 0.6541666666666714 0.050000000000000044 0.010340909090906791 6.197832491582489 2.7483333333333335 0.308030303030303 6.690774410774407 0.9316666666666666 1.6363888888888882 9.722083333333334 0.033333333333333326 1.6149957912457906 0.4850757575757624 -0.026666666666666616 2.996868686868691 2.1186616161616154 -0.03958333333333375 0.03416666666666662 6.242340067340063 0.4348484848484804 0.4571254208754256 5.198758417508419 14.031485690235696 0.811784511784517 2.3016287878787827 6.3889898989898946 1.6265151515151468 0.867542087542083 10.47021043771044 5.274797979797983 0.20999999999999985 -0.13583333333333325 0.27708333333333335 -0.028484848484850778 0.3315909090909138 6.618640572390568 -0.004166666666666707 5.603977272727276 0.17583333333333323 0.481212121212126 0.02958333333333335 0.8937500000000046 1.825197811447816 0.5816666666666714 0.2623316498316519 3.451136363636367 0.32333333333333325 3.1521843434343433 0.6585984848484897 2.0970833333333334 14.50156144781145 0.8637500000000048 9.714583333333332 5.808173400673403 0.04166666666666663 1.9631313131313124 3.0955429292929253 0.03749999999999998 3.0944949494949534 -0.05736531986531257 5.85763888888889 9.046734006734004 2.834898989898994 0.2883333333333335 1.567647306397311 4.2502104377104315 -1.4748021885521814 2.2397222222222215 3.984166666666667 0.6166666666666714 -0.125 5.0315025252525265 3.1417171717171755 -0.365 -0.19499999999999995 1.8638888888888874 6.057815656565659 0.6160984848484898 0.030000000000000027 2.1701010101010096 13.69534932659933 0.5535984848484901 8.27209595959596 9.255155723905718 0.6966666666666714 0.5034932659932708 8.799570707070705 1.1403198653198703 0.018333333333333313 0.18541666666666667 0.16874999999999984 0.1841666666666667 1.5595833333333382 10.522087542087537 5.440774410774414 0.7083333333333381 -0.14708333333333334 0.08958333333333313 5.997579966329963 5.5216919191919205 0.060833333333333184 1.150681818181825 11.46386784511785 13.924137205387208 0.9411742424242471 -8.207293771043762 14.636414141414145 6.123232323232319 11.406321548821555 14.746502525252529 0.5166287878787929 23.8108164983165 -0.21750000000000003 -3.3430176767676687 0.2283333333333334 0.40310606060606047 -8.004090909090895 1.7189520202020196 -0.29249999999999987 0.8387499999999999 0.08875000000000005 24.896127946127944 0.31416666666666665 6.633560606060606 1.6576515151515103 2.634255050505052 -0.07750000000000001 6.232289562289558 1.6222727272727324 2.87459595959596 1.6904166666666716 0.18375000000000002 3.3481818181818173 1.882083333333338 0.4787499999999999 3.2037037037037073 15.280542929292931 0.26041666666666663 -6.005374579124563 1.239974747474753 0.03541666666666643 12.830871212121213 2.7460101010101026 0.8519696969697016 1.2362878787878837 0.1404166666666623 4.065492424242425 0.1791666666666667 6.632070707070703 9.692045454545454 4.869078282828284 6.743337542087538 4.840113636363636 0.09750000000000014 3.6688131313131302 2.102521043771043 24.913699494949494 0.23541666666666672 -0.09999999999999987 9.557083333333336 0.31041666666666634 -3.3575715488215407 0.1741666666666666 0.19166666666666665 0.3245833333333332 0.5186363636363682 3.940101010101009 0.7736195286195262 0.27083333333333326 0.18958333333333327 8.478779461279455 3.1885353535353573 3.868392255892258 1.20875 12.43625841750842 -0.15333333333333332 25.114044612794615 19.66059764309765 0.17291666666666666 1.1208333333333331 2.9714393939393986 1.535833333333338 0.0616666666666667 0.7551262626262624 24.613333333333333 0.12916666666666643 4.808059764309758 -0.1333333333333332 19.300601851851855 0.05624999999999991 8.843665824915824 23.747916666666665 6.367424242424239 0.02083333333333337 1.099166666666674 7.354061447811453 1.0025 4.263636363636363 2.320896464646464 8.17654461279461 0.8579166666666667 0.029166666666660124 0.20791666666666653 11.273110269360274 24.597466329966334 0.3604166666666668 -0.014999999999999958 12.648712121212116 3.9399999999999995 5.848695286195289 0.16791666666666683 24.98299663299663 0.024166666666673775 14.554768518518522 1.6729166666666713 -0.029166666666652574 0.010833333333333361 7.073211279461276 9.84380471380471 24.099208754208753 10.117853535353536 0.2883333333333332 25.18475589225589 0.30255892255892736 0.35784090909090904 12.944339225589232 -0.13416666666666655 0.5162878787878833 3.1184048821548775 25.45123737373737 1.4046212121212172 1.1075000000000002 1.1608333333333334 6.659684343434339 0.12916666666666676 -0.18500000000000005 0.33333333333333304 5.947293771043769 1.8234469696969695 4.919726430976425 0.33791666666666687 5.939377104377101 0.35257575757575743 0.09166666666666667 1.6604166666666718 3.1234848484848463 4.710643939393941 0.06666666666666554 1.6979166666666712 0.8533333333333379 5.636893939393943 0.11250000000000004 -0.27749999999999997 4.665404040404038 12.082567340067346 4.021654040404043 13.430155723905727 0.4254166666666668 5.62638888888889 1.2669318181818152 6.381296296296292 5.753914141414149 22.168329124579124 -0.20666666666666667 0.1949999999999999 0.32916666666666683 1.9104166666666713 0.014166666666666716 1.6601136363636317 1.5758333333333285 3.6887626262626223 3.362058080808077 6.305787037037033 5.347032828282829 -0.05208333333333326 12.76877104377105 1.632083333333338 2.9293686868686906 -0.0724999999999999 1.5687500000000048 4.929166666666665 0.016666666666666607 4.7477777777777765 -0.08208333333333351 5.307630471380471 0.21708333333333346 0.46773989898990376 4.49155303030303 9.320568181818176 5.384726430976435 0.1275 0.9195496632996584 10.142045454545453 0.6763636363636363 3.15883838383838 9.05270202020202 1.5957323232323228 1.5562500000000048 6.049587542087545 1.4662500000000047 -0.1449999999999999 5.437108585858588 0.6235269360269408 17.611628787878786 -0.3025 5.893055555555557 0.5200000000000049 9.290000000000003 5.27136363636364 5.792992424242427 9.9875 1.6709511784511775 4.672159090909089 -0.01416666666666666 0.719772727272732 -0.1379166666666667 0.7158333333333381 0.9780808080808132 3.0652398989898955 17.653425925925927 0.1854166666666665 2.063686868686868 0.16375000000000012 0.01666666666666672 9.502356902356897 0.5863636363636315 7.605984848484851 -0.09750000000000003 12.920265151515158 -0.029166666666666785 0.26333333333333336 7.157386363636364 -0.04458333333333331 -0.7683207070706998 -0.02499999999999325 -0.4016666666666666 0.3095833333333333 1.4850000000000017 -0.595875420875414 4.550340909090908 1.2757070707070728 14.416266835016838 3.9558333333333335 2.634608585858585 4.727449494949493 14.8162962962963 -0.006666666666666654 4.280904882154887 0.012499999999999845 0.015000000000000013 0.4650757575757576 23.345218855218853 0.07625000000000004 -1.4103114478114431 0.0279166666666667 -0.04166666666666674 6.950757575757583 1.9295454545454607 0.9194570707070779 -0.10541666666666671 -0.00833333333333336 6.282483164983161 2.384591750841745 0.02499999999999991 0.6441666666666714 0.6729840067340117 -1.1635690235690173 0.15000000000000013 0.2704166666666666 -0.13954545454544764 0.9083333333333378 13.313446969696972 4.432542087542094 13.759162457912463 7.888661616161616 5.497222222222224 1.005542929292929 3.369827441077441 0.03333333333334565 0.05333333333333329 0.2062500000000001 0.5612500000000048 -0.039583333333333415 0.8558712121212072 2.0185101010101 2.247222222222222 7.04674242424242 4.291439393939393 0.22458333333333347 10.240252525252524 1.2316666666666665 1.8224999999999951 0.17291666666666672 11.877588383838388 16.165593434343435 -0.0024999999999999467 0.4941666666666712 0.6742760942760992 4.010909090909091 1.7688552188552187 -0.06041666666666656 0.28583333333333333 5.128320707070709 1.958409090909086 1.821818181818177 0.36375 5.589541245791239 3.2384595959595917 5.832415824915821 5.088476430976429 3.2017045454545494 0.2575799663299696 -0.1166666666666667 5.012344276094278 0.012500000000000067 3.78819444444444 0.32749999999999985 -0.36291666666666655 8.733345959595958 4.102550505050504 0.02499999999999991 23.45838383838384 0.8695791245791299 0.5254545454545503 6.941691919191914 -1.250669191919186 24.676367845117845 0.5286279461279508 -0.1316666666666667 0.6377525252525302 0.031249999999999112 -0.0008333333333333526 5.811750841750845 -3.2973232323232295 1.854999999999995 8.690446127946126 0.3395833333333333 0.8470833333333285 14.698745791245795 24.200084175084175 -0.07916666666666683 1.889511784511784 5.445744949494948 4.929671717171715 18.62428872053873 6.862727272727269 3.500997474747471 -0.007087542087535148 3.694633838383834 2.199347643097642 1.915000000000005 0.7682070707070721 0.048333333333333284 0.48083333333333333 15.852714646464646 -0.015416666666666745 4.328787878787881 0.733333333333338 -3.8493728956228965 6.788606902356902 0.0024999999999999467 1.083110269360274 4.250643939393938 0.5289393939393989 2.1227819865319857 -0.8724158249158223 0.15988636363636355 0.009166666666666712 3.4142171717171674 diff --git a/benchmarks/replay_baseline.txt b/benchmarks/replay_baseline.txt new file mode 100644 index 00000000..e4f52ae3 --- /dev/null +++ b/benchmarks/replay_baseline.txt @@ -0,0 +1,13 @@ +label 5f68c71+lokal +export coinpoker_cash_2026-11-10 +hands 161 +spots 195 +facing_bet 28 +faithfulness 0.851 +faithfulness_bet 0.679 +foldbet_flop 6 9 +foldbet_turn 3 3 +foldbet_river 2 5 +equity_bias -0.186 n=14 +overfold_bb 7.5 +overcall_bb 3.1 diff --git a/benchmarks/replay_prefloor.txt b/benchmarks/replay_prefloor.txt new file mode 100644 index 00000000..76bbd55b --- /dev/null +++ b/benchmarks/replay_prefloor.txt @@ -0,0 +1,13 @@ +label 5f68c71+lokal +export coinpoker_cash_2026-11-10 +hands 161 +spots 195 +facing_bet 28 +faithfulness 0.882 +faithfulness_bet 0.893 +foldbet_flop 8 7 +foldbet_turn 3 3 +foldbet_river 6 1 +equity_bias -0.221 n=14 +overfold_bb 40.6 +overcall_bb 3.1 diff --git a/betrieb/runner.py b/betrieb/runner.py index a6c292bd..c6e81f8d 100644 --- a/betrieb/runner.py +++ b/betrieb/runner.py @@ -101,6 +101,7 @@ import tischregeln import tischzahlen import dialog import ergebnis +import allin_ev import statistik import strom import tara_ereignisse @@ -140,6 +141,7 @@ ZUSTAND = os.path.join(SCRATCH, "zustand.json") # Wiederaufnahme nach Abstur TAKT_MARKE = os.path.join(SCRATCH, "laeufer_takt") # Herzschlag je Takt (Wache) TISCHARTEN = os.path.join(SCRATCH, "tisch_arten.json") # Gedaechtnis der Tisch-Spielart (betrieb/tischarten.py) SPIELPLAN = os.path.join(SCRATCH, "spielplan.json") # Übung oder Cash und Tischzahl - setzt das Cockpit (betrieb/spielplan.py) +AB_ARM = os.environ.get("COINPOKER_ARM") or None # A/B-Arm-Marke je Hand; leer = inert. Auswertung: lesen/liveabgleich.ab_aus_log(feld="arm") # Du hast Maus/Tastatur benutzt: das Cockpit (mac/) legt die Datei an - nur bei Eingaben, nie # bei Klicks eines Programms (macOS nennt den Absender). Du hast Vorrang, der Läufer wartet. # Deine Eingaben meldet das Cockpit. Kette/Chaos (SCRATCH) haben ihren eigenen Ordner - @@ -571,7 +573,22 @@ def ergebnisse(text, sitzer=None): return 0 neu = 0 aufgedeckt = ergebnis.aufgedeckt(text) # gezeigte Haende (auch der Gegner) fuer Taras Showdown-Reaktion + rechnung = {} + try: # volle Rechnung je Hand fuer die All-in-EV (Board/Reveal) + rechnung = {(r["raum"], r["hand"]): r["daten"] for r in ergebnis.rechnungen(text)} + except Exception: + rechnung = {} for h in ergebnis.haende(text): + if AB_ARM: + h["arm"] = AB_ARM # A/B-Marke dieses Laufs (COINPOKER_ARM); persistiert in haende.jsonl + d = rechnung.get((h["raum"], h["hand"])) # All-in-EV: varianzreduziertes netto_bb_ev (nur Flop/Turn, + if d is not None: # Preflop-Enumeration zu teuer live -> dort roh). Fehler = roh. + try: + ev = allin_ev.aus_daten(d, h["spieler"]) + if ev.get("qualifiziert"): + h["netto_bb_ev"] = ev["netto_ev_bb"] + except Exception: + pass if not BUCH.eintragen([h]): continue neu += 1 @@ -580,6 +597,7 @@ def ergebnisse(text, sitzer=None): schreiben({"zeit": time.strftime("%Y-%m-%d %H:%M:%S"), "ergebnis": h["hand"], "raum": h["raum"], "netto": h["netto"], "bb": h["bb"], "netto_bb": round(h["netto"] / h["bb"], 2) if h.get("bb") else None, + "netto_bb_ev": h.get("netto_bb_ev"), # All-in-EV, falls Flop/Turn-All-in; sonst None "gewonnen": h["gewonnen"], "showdown": h["showdown"], "spielart": h["spielart"]}) wie = "gewonnen" if h["netto"] > 0 else "verloren" if h["netto"] < 0 else "plus minus null" print(f"{time.strftime('%H:%M:%S')} ERGEBNIS {h['raum']} {h['hand']}: {wie} " @@ -607,7 +625,10 @@ def buchen(zeile, kurz, antwort, geklickt=None, hinweis="", gedenkzeit=0.0, bele # damit jede Hand spaeter nachlesbar ist (Owner 7.11.). Das Schattenlog rotiert/ist ephemer. if BUCH is not None: try: - BUCH.zug(handreview.eintrag(eintrag["anfrage"], antwort, raum)) + z = handreview.eintrag(eintrag["anfrage"], antwort, raum) + if AB_ARM: + z["arm"] = AB_ARM # A/B-Marke auch am Zug: Insights je Arm teilbar (lesen/einblick) + BUCH.zug(z) except Exception: pass marke = antwort.get("action", "?") diff --git a/betrieb/statistik.py b/betrieb/statistik.py index e08ce093..6551896f 100644 --- a/betrieb/statistik.py +++ b/betrieb/statistik.py @@ -71,10 +71,13 @@ def _runde(x, stellen=2): def _gruppe(liste): n = len(liste) sd = [h for h in liste if h.get("showdown")] + unten, oben = spanne_bb_pro_100(liste) return { "haende": n, "netto_bb": _runde(sum(h["netto"] / h["bb"] for h in liste if h.get("bb")) if n else None), "bb_pro_100": _runde(bb_pro_100_aus(liste)), + "unten": unten, # 95-%-Spanne um bb/100 (None unter zwei Haenden) + "oben": oben, "gewonnen": rate(sum(1 for h in liste if h.get("gewonnen")), n), "showdown": rate(len(sd), n), "showdown_gewonnen": rate(sum(1 for h in sd if h.get("gewonnen")), len(sd)), @@ -106,11 +109,20 @@ def je_format(haende): je[h.get("format") or UNBEKANNT].append(h) out = [] for fmt, liste in sorted(je.items()): - unten, oben = spanne_bb_pro_100(liste) - out.append(dict(format=fmt, unten=unten, oben=oben, **_gruppe(liste))) + out.append(dict(format=fmt, **_gruppe(liste))) # unten/oben kommen aus _gruppe return out +def je_arm(haende): + """Kennzahlen je A/B-Arm (Feld "arm", im Lauf per COINPOKER_ARM gesetzt); Hände ohne Arm als + "unbekannt". Dies ist die deskriptive Tabelle; den signifikanz-geprüften Vergleich (Welch-Zwei- + Stichproben) liefert lesen/liveabgleich.ab_aus_log(feld="arm").""" + je = collections.defaultdict(list) + for h in haende: + je[h.get("arm") or UNBEKANNT].append(h) + return [dict(arm=a, **_gruppe(liste)) for a, liste in sorted(je.items())] + + def bestes_format(gruppen): """Das Format, dessen 95-%-Spanne ganz über allen anderen liegt - sonst keines, mit Grund. Ein Urteil aus überlappenden Spannen wäre Zufall, nicht Können.""" @@ -180,7 +192,7 @@ def kennzahlen_aus(haende, ereignisse=()): "haende": gesamt["haende"], "von": zeiten[0] if zeiten else None, "bis": zeiten[-1] if zeiten else None, "gesamt": gesamt, "je_stake": je_stake, "je_format": formate, - "bestes_format": bestes_format(formate), + "bestes_format": bestes_format(formate), "je_arm": je_arm(haende), "aktionen": {"anzahl": dict(akt), "anteil": {k: rate(v, summe) for k, v in akt.items()}}, "sitzungen": sitzungen(ereignisse), "auszeiten": auszeiten(ereignisse), "ereignisse": dict(collections.Counter(e.get("art") for e in ereignisse)), @@ -209,6 +221,8 @@ def md_aus(kz, titel="Statistik"): f"Haende: {kz['haende']}" + (f" ({kz['von']} bis {kz['bis']})" if kz["von"] else ""), "", "| Kennzahl | Wert |", "|---|---|", f"| bb/100 | {_zahl(g['bb_pro_100'])} |", + f"| bb/100 95-%-Spanne | " + + (f"{_zahl(g['unten'])} bis {_zahl(g['oben'])}" if g.get("unten") is not None else "-") + " |", f"| Netto (bb) | {_zahl(g['netto_bb'])} |", f"| gewonnene Haende | {_prozent(g['gewonnen'])} |", f"| VPIP | {_prozent(g['vpip'])} |", @@ -231,6 +245,15 @@ def md_aus(kz, titel="Statistik"): z.append(f"| {r['format']} | {r['haende']} | {_zahl(r['bb_pro_100'])} | {spanne} | " f"{_zahl(r['netto_bb'])} | {_prozent(r['vpip'])} | {_prozent(r['pfr'])} |") z += ["", f"Am besten: {b['format'] if b['format'] else 'noch kein Urteil'} - {b['grund']}", ""] + arme = kz.get("je_arm") or [] + if len(arme) > 1 or any(r["arm"] != UNBEKANNT for r in arme): + z += ["### A/B je Arm", "", + "| Arm | Haende | bb/100 | 95-%-Spanne | Netto (bb) | VPIP | PFR |", "|---|---|---|---|---|---|---|"] + for r in arme: + spanne = f"{_zahl(r['unten'])} bis {_zahl(r['oben'])}" if r["unten"] is not None else "-" + z.append(f"| {r['arm']} | {r['haende']} | {_zahl(r['bb_pro_100'])} | {spanne} | " + f"{_zahl(r['netto_bb'])} | {_prozent(r['vpip'])} | {_prozent(r['pfr'])} |") + z += ["", "Signifikanz (Welch): `python3 lesen/liveabgleich.py --ab-log arm`", ""] a = kz["aktionen"] if a["anzahl"]: z += ["### Aktionsverteilung", "", "| Aktion | Anzahl | Anteil |", "|---|---|---|"] diff --git a/betrieb/stufe0.py b/betrieb/stufe0.py new file mode 100644 index 00000000..1633c39c --- /dev/null +++ b/betrieb/stufe0.py @@ -0,0 +1,179 @@ +#!/usr/bin/env python3 +"""Stufe-0-Bericht (Übung): schlägt die Engine live die Null, spielt sie sane, läuft der Loop sauber? + +Liest den Statistik-Speicher einer Übungs-Sitzung (betrieb/statistik.py: haende.jsonl + +ereignisse.jsonl) und - wenn angegeben - das Schattenlog des Läufers (runner: shadow*.jsonl) für +die Loop-Gesundheit. Das Urteil sagt NUR, was die Stichprobe hergibt: + + * live bb/100 mit 95-%-Spanne (statistik.spanne_bb_pro_100): ist die Untergrenze > 0, schlägt die + Engine die Null MIT 95 % Sicherheit. Überlappt die Spanne die Null, ist es Zufall, kein Beweis + (dieselbe Regel wie statistik.bestes_format). + * Spielstil (VPIP/PFR/Showdown): eine degenerierte Engine (VPIP 2 % oder 95 %, PFR > VPIP) fällt + auf, bevor man Micro-Geld riskiert. + * Loop-Gesundheit: Abbrüche (Invariantenbruch), Timeouts (Uhr abgelaufen -> Server-Sitout), + Abstains (der Kern gab keine Aktion). Null Abbrüche und null Timeouts = der Loop trägt. + + python3 betrieb/stufe0.py # STATS_DIR / archiv/lauf + python3 betrieb/stufe0.py --pfad DIR --shadow shadow.jsonl + python3 betrieb/stufe0.py --erwartung 80 300 --json # Sim-to-Real-Band vergleichen + +VARIANZ (ehrlich): live kann KEINE Karten paaren wie die Synthetik-Leiter - jede Hand wird einmal +ausgeteilt, die volle Varianz (σ ≈ 90 bb/100) bleibt. Übung löst darum nur GROBE Dinge auf: +gewinnt es überhaupt, läuft der Loop, ist der Stil sane. Feine A/B-Deltas (1-9 bb/100) brauchen +>100k Hände je Arm und gehören nach Stufe 2 (mit All-in-EV/AIVAT-Varianzreduktion), nicht hierher. +""" +import os as _os, sys as _sys +_w = _os.path.dirname(_os.path.abspath(__file__)) +while _w != "/" and not _os.path.isdir(_os.path.join(_w, "betrieb")): + _w = _os.path.dirname(_w) +WURZEL = _w +for _u in ("lesen", "betrieb"): + _q = _os.path.join(_w, _u) + if _os.path.isdir(_q) and _q not in _sys.path: + _sys.path.insert(0, _q) +import argparse +import json + +import statistik + +# Stil-Band: ausserhalb ist eine Engine degeneriert (nicht spielbar), nicht nur ausbeutbar. +VPIP_MIN, VPIP_MAX = 0.05, 0.90 +SHOWDOWN_MIN = 0.02 + + +def _urteil_null(unten, oben, n): + """Schlägt die Engine die Null? Nur mit der 95-%-Spanne - Überlappung heisst Zufall.""" + if n < 2 or unten is None or oben is None: + return "zu wenig Hände für ein Urteil" + if unten > 0: + return "gewinnt mit 95 % Sicherheit" + if oben < 0: + return "verliert mit 95 % Sicherheit" + return "noch Zufall (die 95-%-Spanne überlappt die Null)" + + +def _stil(gesamt): + """VPIP/PFR/Showdown und ob sie in einem spielbaren Band liegen (PFR <= VPIP, kein Extrem).""" + vpip, pfr, sd = gesamt.get("vpip"), gesamt.get("pfr"), gesamt.get("showdown") + hinweise = [] + if vpip is None: + hinweise.append("keine Hände") + else: + if not (VPIP_MIN <= vpip <= VPIP_MAX): + hinweise.append(f"VPIP {vpip*100:.0f} % ausserhalb {VPIP_MIN*100:.0f}-{VPIP_MAX*100:.0f} %") + if pfr is not None and pfr > vpip + 1e-9: + hinweise.append(f"PFR {pfr*100:.0f} % > VPIP {vpip*100:.0f} % (unmöglich - Lesefehler)") + if sd is not None and sd < SHOWDOWN_MIN: + hinweise.append(f"Showdown {sd*100:.1f} % sehr niedrig") + return {"vpip": vpip, "pfr": pfr, "showdown": sd, "sane": not hinweise, + "hinweise": hinweise} + + +def _loop(ereignisse, shadow): + """Loop-Gesundheit: Abbrüche/Timeouts/Abstains/Sitouts. Abbruch oder Timeout = der Loop hakt.""" + abbruch = sum(1 for e in shadow if e.get("ereignis") == "abbruch") + abstain = sum(1 for e in shadow + if isinstance(e.get("antwort"), dict) + and (e["antwort"].get("action") or "").upper() == "ABSTAIN") + timeouts = (sum(1 for e in ereignisse if e.get("grund") == "timeout") + + sum(1 for e in shadow if e.get("ereignis") == "timeout" + or (e.get("grund") == "timeout"))) + sitouts = sum(1 for e in ereignisse if e.get("art") in statistik.AUSZEIT_ARTEN) + return {"abbruch": abbruch, "timeouts": timeouts, "abstains": abstain, "sitouts": sitouts, + "sauber": abbruch == 0 and timeouts == 0} + + +def _sim_to_real(unten, oben, erwartung): + """Live-Spanne gegen ein erwartetes Band (lo, hi) aus der Synthetik - Überlappung = im Rahmen.""" + if erwartung is None: + return None + lo_e, hi_e = erwartung + if unten is None or oben is None: + urteil = "zu wenig Hände" + elif unten > hi_e: + urteil = "besser als erwartet (live-Spanne über dem Band)" + elif oben < lo_e: + urteil = "schlechter als erwartet (live-Spanne unter dem Band)" + else: + urteil = "im erwarteten Bereich (Spannen überlappen)" + return {"erwartet_unten": lo_e, "erwartet_oben": hi_e, "urteil": urteil} + + +def bericht(haende, ereignisse=(), shadow=(), erwartung=None): + """Der ganze Stufe-0-Bericht als reines dict (JSON-fähig). `erwartung`: (lo, hi) bb/100-Band + aus der Synthetik für den Sim-to-Real-Vergleich, oder None.""" + haende = list(haende) + kz = statistik.kennzahlen_aus(haende, list(ereignisse)) + g = kz["gesamt"] + n = g["haende"] + unten, oben = g.get("unten"), g.get("oben") + return { + "haende": n, + "von": kz["von"], "bis": kz["bis"], + "bb_pro_100": g["bb_pro_100"], "unten": unten, "oben": oben, + "schlaegt_null": bool(unten is not None and unten > 0), + "urteil": _urteil_null(unten, oben, n), + "stil": _stil(g), + "loop": _loop(list(ereignisse), list(shadow)), + "sim_to_real": _sim_to_real(unten, oben, erwartung), + } + + +def _spanne_text(unten, oben): + return f"{unten:.1f} bis {oben:.1f}" if unten is not None else "- (zu wenig Hände)" + + +def text(b): + """Der Bericht als kompakter Text fürs Terminal.""" + z = ["=== Stufe-0-Bericht (Übung) ===", + f"Hände: {b['haende']}" + (f" ({b['von']} bis {b['bis']})" if b["von"] else "")] + bb = "-" if b["bb_pro_100"] is None else f"{b['bb_pro_100']:+.1f}" + z.append(f"bb/100: {bb} 95-%-Spanne: {_spanne_text(b['unten'], b['oben'])}") + z.append(f" -> {b['urteil']}") + s = b["stil"] + def _p(x): + return "-" if x is None else f"{x*100:.0f} %" + z.append(f"Stil: VPIP {_p(s['vpip'])} PFR {_p(s['pfr'])} Showdown {_p(s['showdown'])}" + + (" [sane]" if s["sane"] else " [PROBLEM: " + "; ".join(s["hinweise"]) + "]")) + lp = b["loop"] + z.append(f"Loop: Abbrüche {lp['abbruch']} Timeouts {lp['timeouts']} Abstains {lp['abstains']}" + f" Sitouts {lp['sitouts']} -> " + ("sauber" if lp["sauber"] else "HAKT (Abbruch/Timeout)")) + if b["sim_to_real"]: + st = b["sim_to_real"] + z.append(f"Sim-to-Real: erwartet {st['erwartet_unten']:.0f} bis {st['erwartet_oben']:.0f} bb/100" + f" -> {st['urteil']}") + return "\n".join(z) + + +def _shadow_lesen(pfad): + if not pfad or not _os.path.exists(pfad): + return [] + out = [] + with open(pfad, encoding="utf-8") as f: + for zeile in f: + try: + d = json.loads(zeile) + except ValueError: + continue + if isinstance(d, dict): + out.append(d) + return out + + +def main(argv=None): + p = argparse.ArgumentParser(description="Stufe-0-Bericht (Übung): schlägt es die Null, Loop sauber?") + p.add_argument("--pfad", help="Statistik-Ordner (Vorgabe: STATS_DIR oder archiv/lauf)") + p.add_argument("--shadow", help="Schattenlog des Läufers (shadow*.jsonl) für die Loop-Gesundheit") + p.add_argument("--erwartung", nargs=2, type=float, metavar=("UNTEN", "OBEN"), + help="erwartetes bb/100-Band aus der Synthetik (Sim-to-Real)") + p.add_argument("--json", action="store_true", help="als JSON statt Text") + a = p.parse_args(argv) + st = statistik.Statistik(a.pfad) + b = bericht(st.haende(), st.ereignisse(), _shadow_lesen(a.shadow), + tuple(a.erwartung) if a.erwartung else None) + print(json.dumps(b, indent=1, ensure_ascii=False) if a.json else text(b)) + return 0 + + +if __name__ == "__main__": + _sys.exit(main()) diff --git a/docs/notizen/ARCHITEKTUR-synthetik-labor.md b/docs/notizen/ARCHITEKTUR-synthetik-labor.md new file mode 100644 index 00000000..bdb4fb24 --- /dev/null +++ b/docs/notizen/ARCHITEKTUR-synthetik-labor.md @@ -0,0 +1,134 @@ +# Architektur: das synthetische Gegner-Labor (kalibrierte Population + Liga + EGTA) + +Ziel: Exploitation und Mindgames **synthetisch** messen — tausende Datensätze auf einmal, schnell, +risikolos — statt im langsamen Live-Farm. Der Live-Lauf schrumpft auf seine eine unverzichtbare Rolle: +den finalen Sim-to-Real-Abgleich. + +## Warum die heutige Leiter das nicht kann + +Die Leiter sind **5 feste Karikatur-Bots** (`sim::reader::Style`). Zwei Dinge fehlen, und beide sind +der Grund, warum Exploitation dort unsichtbar ist (und warum der Stage-A-Solver −43 „verlor"): + +1. **Kein verdeckter Typ.** Die Engine bekommt den konvergierten Read schon schlüsselfertig geschenkt + (`sim::reads::opponent_profile` → `ReadMode::Oracle`). Es gibt nichts zu *erschließen* → der + Exploitation-Teil der Engine (`exploit::posterior`) läuft leer. +2. **Keine Reaktion.** Die Bots adaptieren nicht. Image-Aufbau und Sequencing haben nichts zum Beißen + → Mindgames sind nicht messbar. + +## Die Kernidee: Grundwahrheit vs. Beobachtung + +Schon heute gibt es die zwei Ebenen, nur fest verdrahtet: + +- **Grundwahrheit** = `reader::Rules` — 6 Parameter `{call_margin, raise_at, bet_at, open_at, bluff, size}` + (`src/sim/reader.rs:42-55`). Die 5 Styles sind 5 *Punkte* in diesem Raum (`reader.rs:80-89`). +- **Beobachtung** = `exploit::profile::Profile` — 12 HUD-Zahlen (`src/exploit/profile.rs`), die eine + gegebene `Rules` über viele Hände *induziert*. + +**Exploitation-EV = der Abstand zwischen „Engine kennt die Grundwahrheit" und „Engine muss sie aus +Beobachtung erschließen".** Genau diesen Abstand verschenkt die Leiter, indem sie den Oracle-Read +reicht. Das Labor macht ihn sichtbar: Grundwahrheit `θ` aus einer Verteilung ziehen, der Engine nur +den *wachsenden, verrauschten* Read aus beobachteten Aktionen geben (`exploit::posterior`), und messen. + +## Die vier Schichten + +### Schicht 1 — Die Population `P(θ)` + +Nicht 5 feste `Rules`, sondern eine **Verteilung** über `θ` = (`Rules` + Leaks + verdeckte Klasse): + +- `reader::Rules` von festen Konstanten zu einem **gezogenen** Satz machen (neuer Typ `Population` + neben `Style`; `Style::rules()` bleibt als die 5 Anker-Mittelwerte). +- `θ` zieht aus einer **Mischverteilung**: Archetyp-Cluster (Reg/Nit/Maniac/Fish/Reg-balanced) als + Mittelwerte, plus Kovarianz → tausende *individuelle* Gegner, nicht 5 Klone. +- Erweiterte Leak-Achsen, die die 6 Basis-Parameter nicht fassen: Sizing-Tells (Bet-Size korreliert mit + Stärke), Timing-Tells, Street-spezifische Aggression, Position-Blindheit, Tilt-Neigung. +- **Verdeckte Klasse:** jeder gezogene Gegner trägt ein Label, das die Engine NICHT sieht — nur aus + Aktionen erschließbar. Das ist die Schraube, an der Exploitation greift. + +Dateien: Ausbau `src/sim/reader.rs` (+ `population.rs`), gezogen mit `rng::Rng` (deterministisch, Seed). + +### Schicht 2 — Die adaptive Liga (macht Mindgames messbar) + +Statische Population testet Exploitation; **adaptive** Gegner testen Mindgames. Gegner, die ein Modell +des Helden führen und reagieren, in Stufen: + +- **L0 statisch** — die Population aus Schicht 1 (kein Gedächtnis). +- **L1 reaktiv** — passt Schwellen an die beobachtete Hero-Aggression an (einfacher Frequenz-Konter). +- **L2 modellierend** — führt selbst einen Posterior über den Helden, kontert dessen geschätzte Range. +- **L3 Liga** — ein Pool aus Exploitern, früheren Hero-Versionen und L1/L2-Gegnern (AlphaStar/Pluribus- + Muster). Der Held wird gegen die ganze Liga bewertet → Robustheit, kein Overfit auf einen Gegner. + +Bei L1–L3 beißt Image-Aufbau: Variante B baut ein Bild, der Gegner reagiert, B nutzt die Reaktion — +alles synthetisch. Zuteilung **pro Gegner kohärent** (nie pro Hand — das zerstörte den Effekt). + +### Schicht 3 — Der EGTA-Harness (die rigorose Messung) + +*Empirical Game-Theoretic Analysis*: eine Meta-Payoff-Matrix Strategie×Strategie, gefüllt durch +tausende simulierte Matches, dann Best-Response/empirisches Gleichgewicht **über die Population**. + +- **Payoff-Schätzung** je Zelle: varianzreduziert mit `sim::aivat` (bewiesen) + gepaart/gespiegelt. +- **Früh-Stopp/Allokation:** `sim::sequential` (Anytime-CI, bewiesen) als Promote/Kill-Regel; + `exploit::thompson` (bewiesen) teilt Rechenzeit der aussichtsreichsten Variante zu → Dateneffizienz. +- **Exploitability-Wächter:** `sim::exploit_river` → Population-Best-Response; ein Feature darf + Population-EV heben, aber die Exploitability-Schranke nicht reißen (kein Bot-Overfit, kein + Gegen-Exploit). Das ist das Zwillings-Tor, das die alte bb/100-Leiter ersetzt: + **Population-EV hoch UND Exploitability gedeckelt.** + +### Schicht 4 — Kalibrierung an echte Daten (gegen den Sim-to-Real-Gap) + +Synthetik ist nur so gut wie `P(θ)`. Die Daten dafür existieren schon, pro `userId`: + +- die 12 HUD-Zahlen (`lesen/profil.py`, `profil.DURCHGEREICHT`) — dieselben Felder wie `Profile`. +- Sizing-/Timing-Eimer + gezeigte Hände (`lesen/gedaechtnis.py`: `sizing`, `timing`, `gezeigt`). + +**Kalibrierung = fitte `P(θ)` so, dass die von ihr *induzierten* HUD+Sizing/Timing-Verteilungen die +*empirische* Verteilung echter Spieler treffen** (Momentenmethode/MLE auf dem 12-dim-HUD-Vektor plus +Sizing/Timing-Histogrammen). Der Link Grundwahrheit→Beobachtung ist heute schon hand-geeicht +(`sim::reads::opponent_profile`, aus `tests/sim_opponent_stats` gemessen) — das verallgemeinern wir von +„5 Punkte" auf „die gezogene Verteilung". Dazu: **Held-out-Spieler** (nie auf denselben eichen und +testen) und **Worst-Case** über eine Bandbreite von Populationen, nicht nur das Mittel. + +## Der Messpfeiler (was neu sichtbar wird) + +Die eine Änderung, die alles freischaltet: **den Oracle-Read abschalten.** Statt +`ReadMode::Oracle`/`reads::opponent_profile` bekommt die Engine nur den aus Beobachtung wachsenden +Read (`ReadMode::Memory` verallgemeinert auf die Population + `exploit::posterior`). + +``` + Exploitation-Lücke = EV(Engine erschließt+adaptiert | Population) + − EV(Engine spielt GTO/blind | Population) +``` + +Positiv und wachsend mit der Read-Konfidenz = die Engine nutzt wirklich aus. Diese Zahl war auf der +Leiter strukturell 0 (Oracle geschenkt) — deshalb „brachte alles nichts". Im Labor ist sie das +Hauptmaß. + +## Sim-to-Real & die Grenze + +Adaptive synthetische Gegner sind ein *Modell* menschlicher Adaption, kein Mensch. Also: alles +offline messen, was offline messbar ist; der Live-Farm prüft nur den Schluss-Gap. Andockpunkte stehen +(Live-Map): Entscheidung `betrieb/runner.py:3391`, Ergebnis `runner.py:553-562`, Join über +`(raum, hand)`, echte Gegner-ID in `anfrage["_sitze"]` — genug, um reale `(Typ, Aktion, Ausgang)`- +Tupel für die Kalibrierung zu ernten und das finale A/B (grober Schalter: `COINPOKER_KERN`-Binary) zu +fahren. + +**Gebaut + gefahren (Stand jetzt):** Der Outcome-Abgleich steht (`lesen/liveabgleich.py`): er liest +`archiv/lauf/haende.jsonl` und hält das reale bb/100 (−266.75 über 190 Hände, 95% −560…+27) gegen die +Sim-Vorhersage (+43.95). Ergebnis: **KLAFFT, Gap −311** — die behauptete Kante kommt am Tisch nicht an. +Der Gap enthält Population-/Rake-/Betriebs-Confounds; sie trennt erst der kontrollierte An/Aus-Split, +der nur noch Hände unter beiden Armen braucht, keinen neuen Code. `BEFUND-liveabgleich-stufe4-live`. + +## Reihenfolge nach echtem Signalgewinn + +| Stufe | Bau | Erster messbarer Gewinn | +|---|---|---| +| **0 ✓** | Population-Draw (`reader::Rules`→gezogen) **+ Oracle aus, Read via Memory/`posterior`** (`sim::population`, `sim::exploit_pop`, `bin/exploit_gap`) | **GEMESSEN: +18.98 bb/100 ±7.14, signifikant** (fish +46, nit +9, maniac +4, reg −2.5). `BEFUND-exploitation-luecke-population` | +| **1** | Kalibrierung an `profil.py`/`gedaechtnis` | realistische Population; Sim-to-Real auf der statischen Seite geschlossen | +| **2 ✓** | EGTA-Harness + Exploitability-Wächter (`sim::twin_gate`, `bin/twin_gate`) | **GEBAUT, drei Achsen, VOLLBUDGET gemessen:** Offense +43.95 (Lücke +18.98, = Stufe 0), Boden **gto −36.25** (Engine verliert gegen Balancierte — zeigt die Wurzel, die die Oracle-Leiter verbarg), River-Exploitability Mittel 77/Max 146. Budget-robust (CIs ±12–37). `Gate::passes` ersetzt die bb/100-Leiter. `BEFUND-zwillings-tor-stufe2` | +| **3 ✓ (L0–L3)** | Adaptive Liga komplett: L1 reaktiv (`sim::adaptive`), L2 modellierend (`Adapt::Model`, Beta-Posterior + LCB-Gate), L3 Liga (`sim::league`, `bin/league`) | **GEMESSEN:** L1 Tighten −0.59 (n.s.), Loosen +20.03; L2 konfidenz-gegatet (milder, +26 in der Liga); **L3-Liga: Mittel +27.55, Boden Nemesis −258** (stehendes Härte-Mitglied). `BEFUND-adaptive-liga-mindgame-steuer`, `BEFUND-liga-l2-l3` | +| **4 ✓ (beide Hälften gebaut + gefahren)** | HUD-Gap (`sim::simreal`, `bin/simreal`) **+ Outcome-Abgleich** (`lesen/liveabgleich.py`, `tests/liveabgleich_spec.py`) | **HUD:** within-reg-Streuung synth vs real vpip 0.126/0.043, pfr 0.093/0.027, foldToBet 0.056/0.089 — modest, gerichtet (`BEFUND-simreal-stufe4`). **OUTCOME (190 echte Hände):** real **−266.75 bb/100** (95% −560 bis +27) gegen Sim-Vorhersage **+43.95** ⇒ **Gap −310.70, KLAFFT** (Sim-Kante über dem realen Intervall — die behauptete Kante kommt am Tisch nicht an; Confounds: Population/Rake/Betrieb). `BEFUND-liveabgleich-stufe4-live`. **A/B-Test + Pipeline fertig** (`ab_vergleich`/`--ab`, `ab_aus_log`/`--ab-log`, 21 Tests grün). Die Arme trennen sich über die vorhandene Umgebung (`COINPOKER_KERN`-Binary + `STATS_DIR`-Ordner) — **heute lauffähig ohne neuen Code**, genaue Befehlsfolge in `RUNBOOK-liveabgleich-ab.md`. **Offen bleibt nur, den Live-Farm unter beiden Armen zu fahren** — ein geldechter Betriebs-Schritt am Tisch über Zeit. Das Werkzeug wartet auf die Daten. | +| **5 ✓** | Optimizer (Diagonal-CMA-ES, parallel; `sim::optimize`, `bin/nemesis`) | **GEBAUT + validiert** (Sphäre/Rosenbrock/Rauschen). `worst_case_opponent` VOLLBUDGET (1000×14): **Nemesis −414.81 bb/100** gegen einen klebrigen Low-Bluff-Caller (die Engine barrelt in die Station); der 300×8-Lauf fand −642.96 gegen einen loose-aggro Reraiser — zwei Budgets, zwei Klippen ⇒ breites Worst-Case-Tal, kein Artefakt. Der +44-Durchschnitt verbarg beide. Bereit für Engine-Hyperparameter, sobald als Vektor exponiert. `BEFUND-optimizer-nemesis-stufe5` | + +Eiserne Gesetze bleiben, nur das Tor ändert sich: **nie einen Verlierer ausliefern** heißt jetzt +„verliert Population-EV oder reißt die Exploitability-Schranke"; **zuerst messen** heißt „gegen die +kalibrierte Population, nicht gegen 5 Dummies". Stufe 0 ist der Punkt, an dem aus „brachte nichts" zum +ersten Mal eine echte Exploitation-Zahl wird. diff --git a/docs/notizen/BEFUND-adaptive-liga-mindgame-steuer.md b/docs/notizen/BEFUND-adaptive-liga-mindgame-steuer.md new file mode 100644 index 00000000..9c9c13b1 --- /dev/null +++ b/docs/notizen/BEFUND-adaptive-liga-mindgame-steuer.md @@ -0,0 +1,63 @@ +# Befund: die Engine ist gegen Adaption robust — keine Mindgame-Steuer, und ein +20er Geschenk + +Stufe 3 des synthetischen Labors steht: Gegner, die den Helden beobachten und ihr Regelwerk pro Hand +an seine Nach-Flop-Aggression anpassen. Das ist die erste Messung, die Mindgames überhaupt berühren +kann — die feste Leiter und selbst die statische Population (Stufe 0) können es strukturell nicht, weil +dort nichts reagiert. + +## Aufbau + +- `sim::adaptive`: ein `HeroModel` zählt die beobachtete Nach-Flop-Aggression des Helden; `adapt()` + leitet daraus pro Hand ein frisches `Rules` ab, gespielt über den `Opponent::Styled`-Seam aus + Stufe 0 (keine `table.rs`-Änderung nötig). Zwei Reaktionen klammern das realistische Verhalten ein: + - **Tighten** — gibt dem Aggressor kein Spiel: hebt `call_margin` (faltet mehr), senkt `bluff`. + - **Loosen** — der Hero-Caller: senkt `call_margin` (ruft leichter mit, wittert Bluffs). +- Gemessen **gepaart**: derselbe gezogene Gegner, dieselben Austeilungen, einmal statisch + (= die Stufe-0-Memory-Baseline), einmal adaptierend. Der Held erschließt den Gegner die ganze Zeit + aus seinem eigenen Session-Memory (der echte Exploitation-Pfad), er bekommt die Adaption NICHT + geschenkt. Delta = `adaptiv − statisch`, bb/100. + +## Ergebnis (`adaptive_gap`, 48 Gegner × 400 Austeilungen) + +``` + statisch adaptiv DELTA paired anytime + tighten +43.95 +43.36 -0.59 bb/100 ±5.81 ±11.91 n.s. + loosen +43.95 +63.98 +20.03 bb/100 ±5.91 ±12.12 SIGNIFIKANT +``` + +## Was das heißt (ehrlich) + +1. **Der Harness ist exakt validiert.** Die statische Spalte reproduziert die Stufe-0-Memory-Zahl + (+43.95) **auf den Cent**. `Adapt::Static` spielt also bit-genau denselben Pfad wie `exploit_pop` + im Memory-Modus — die gepaarte Kontrolle stimmt, das Delta misst wirklich nur die Adaption. + +2. **Keine Mindgame-Steuer.** Gegen einen Gegner, der auf Aggression hin stark zumacht (bis an die + Nit-Grenze, `call_margin` 0.22→0.57), verliert die Engine **nichts** Messbares (−0.59, n.s.). Ihr + stationärer Read wird von der Reaktion nicht ausgehebelt — das ist die beruhigende Nachricht. + +3. **Loosen ist ein Geschenk, kein Angriff.** Ruft der Gegner als Reaktion leichter mit (Hero-Caller), + wird die Engine **reicher**, nicht ärmer: +44 → +64, +20 bb/100 signifikant. Ein loser Gegner ist + leichter auszubeuten, und die Engine zieht den Wert (dünnere Value-Bets, mehr bezahlt). Exploitation + funktioniert also auch gegen ein *bewegliches* Ziel, nicht nur gegen die fixe Population. + +4. **Die eigentliche Front ist Tighten = 0, nicht Tighten < 0.** Ein *Weltklasse*-Spieler verwandelt + das Zumachen des Gegners in Profit: faltet er zu viel, muss die Blufffrequenz **hoch**. Die Engine + hält den Wert (kein Leck), schöpft das Überfalten aber nicht ab — Delta ≈ 0 statt Delta > 0. Das ist + kein Verlust, sondern liegengelassenes Geld: der nächste Hebel ist aktives Über-Bluffen gegen einen + gemessen überfaltenden Read, genau die Richtung der Krone (λ aus Konfidenz, Frequenz-Exploitation). + +## Grenzen + +- Zwei Reaktionsstile (Tighten/Loosen) bracketen, sind aber kein Modell echter Adaption — das ist L1 + der Liga (reaktiver Frequenz-Konter). L2 (der Gegner führt selbst einen Posterior über den Helden) + und L3 (Liga aus Exploitern + früheren Hero-Versionen, Robustheit) stehen noch aus; erst L2/L3 testen + Sequencing und Gegen-Exploit scharf. +- 48 Gegner, gepoolt über ~19 200 gepaarte Austeilungen je Stil — die Deltas sind belastbar. +- Adaption ist frequenzbasiert (Nach-Flop-Aggression); Sizing-/Timing-getriebene Reaktionen fehlen noch. + +## Einordnung + +Zusammen mit Stufe 0 (+18.98 Exploitation-Lücke) ist das Bild konsistent und ehrlich: die Engine ist +ein solider, nicht ausbeutbarer Exploiter — sie gewinnt gegen die Population und gegen zwei +Adaptionsmoden, ohne sich kontern zu lassen. Der Weltklasse-Rest ist nicht „einen Verlust reparieren", +sondern „das neutrale Tighten-Delta in Profit drehen". Siehe `ARCHITEKTUR-synthetik-labor.md`, Stufe 3. diff --git a/docs/notizen/BEFUND-allin-ev.md b/docs/notizen/BEFUND-allin-ev.md new file mode 100644 index 00000000..66dbeb04 --- /dev/null +++ b/docs/notizen/BEFUND-allin-ev.md @@ -0,0 +1,87 @@ +# Befund: All-in-EV — varianzreduzierte Hand-Bewertung fürs Live-A/B + +**Datum:** 2026-11-12 +**Zweck:** Das Live-A/B (temporal, ein Prozess — siehe `BEFUND-live-ab-einblick.md`) ist durch die +Varianz der All-in-Pötte stark gebremst. Die All-in-EV ersetzt bei einem All-in vor dem River das +realisierte Board-Ergebnis durch seinen Erwartungswert (Equity gegen die aufgedeckten Gegnerkarten). +**Mittelwerttreu:** der Erwartungswert bleibt, nur die Streuung fällt → das A/B wird schneller +signifikant (Tracker-„all-in adjusted winnings"; grob ~60 % weniger Hände für dieselbe Schranke). + +## Was gebaut wurde + +- **`lesen/allin_ev.py`** — Kern + Extraktor. + - `equity(hero, board_bis_allin, [vil])` → exakte Enumeration via `entscheiden/eval7.equity_vs`. + - `ev_netto_bb(eq, sieg, pleite)` = `eq*sieg + (1-eq)*pleite` — die **zwei Beine sind beobachtet** + (Sieger-Netto post-Rake, Verlierer-Netto), also rake-exakt und unverzerrt. + - `aus_daten(daten, held, preflop_ok=False)` — eine Hand aus der vollen Rechnung + (`ergebnis.rechnungen`). **Gated** auf den eindeutigen Fall: Kopf-an-Kopf, EIN Brett (kein + RIT/Doppelbrett/EV-Chop/Bombpot), beide aufgedeckt, All-in vor dem River, gleiche Einsätze (kein + Seiten-Pott). Sonst `qualifiziert=False` + Grund, und `netto_ev_bb` = roh `netto_bb`. + - `aus_text(text, held)` — alle fertigen Hände eines Logtexts (nur Weiterverarbeitung). + +- **Live-Verdrahtung (`betrieb/runner.py::ergebnisse`)**: je fertige Hero-Hand wird über + `ergebnis.rechnungen(text)` die volle Rechnung geholt und `aus_daten` berechnet; qualifiziert → + `h["netto_bb_ev"]` gesetzt (persistiert in `haende.jsonl` **und** im Schattenlog). Defensiv + (try/except → roh bei jedem Fehler). + +- **Auswertung (`lesen/liveabgleich.py`)**: `netto_bb(hand, ev=False)` und + `ab_aus_log(..., ev=False)` nehmen bei `ev=True` den `netto_bb_ev` statt des realisierten. CLI: + `python3 lesen/liveabgleich.py --ab-log arm --ev`. **Roh bleibt Vorgabe** — die EV ist + eine Rausch-Linse fürs A/B, nicht die Buchhaltung. + +## Korrektheit — bewiesen, nicht geglaubt (`tests/allin_ev_spec.py`, 22 Tests) + +- **Mittelwerttreue (Kern-Spezifikation):** 40 000 Sims, `|mean(EV) − mean(realisiert)| < 1.0` und + `var(EV) < 0.5·var(realisiert)`. Ein nicht mittelwerttreuer EV wäre ein **stiller Verlierer** — + darum ist das die Kern-Prüfung. +- **Extraktor deterministisch:** konstruierte `daten`-Dicts (exakt die Parser-Form) mit echten + Equity-Zahlen (AA vs KQ auf K72 = 0.8162; Rolle getauscht = 0.1838; Turn schneidet Board korrekt). + Gating geprüft: EV-Chop/RIT, 3-hand, nicht beide aufgedeckt, River-All-in, Seiten-Pott, kein All-in. + +## Warum NICHT an den Archiv-Rohlogs validiert + +Erster Validierungsversuch gegen `ergebnis.bestand_text()`: 1276 Hände, **0 qualifiziert**, 1273 davon +„kein Held". Grund: die Client-Rohlogs **rotieren in Minuten** (genau darum gibt es die persistenten +`haende.jsonl`/`zuege.jsonl`). Das Rohfenster trug nur 3 Hero-Hände, keine HU-All-in-Hand. Der +Rohtext der historischen All-ins ist weg; `haende.jsonl` trägt kein Board/Reveal. → Validierung über +konstruierte `daten` (dauerhaft, deterministisch, schnell) statt über flüchtige Rohlogs. Der Extraktor +läuft **live** korrekt, weil der Runner am Hand-Ende den frischen Text hat. + +## Preflop-Pfad: seed-deterministischer Monte-Carlo (jetzt live bepreist) + +Preflop-All-ins sind gerade bei Short-Stack/Turnier häufig; die exakte Equity wäre C(48,5) = 1,7M +Runouts (Minuten in reinem Python) — in der heißen Schleife verboten. Lösung: + +- **`entscheiden/eval7.equity_mc(hero, board, vils, laeufe=6000, seed)`** — schätzt dieselbe Equity über + `laeufe` ZUFÄLLIGE (seed-deterministische) Runouts statt aller. **Unverzerrt:** jeder Runout ist eine + gleichverteilte Ziehung aus demselben Raum, den `equity_vs` vollständig mittelt → `E[Schätzung] = + wahre Equity`, nur MC-Rauschen ~0,5/√laeufe (bei 6000: ~0,6 % 1σ). Ein unverzerrter Equity-Schätzer + gibt eine mittelwerttreue EV — die Kern-Eigenschaft bleibt erhalten. +- **`eval7.score7`** — direkter 7-Karten-Wert (ohne die 21-Kombinationen-Schleife von `best7`), nur für + den MC-Pfad; der Ground-Truth `best7`/`score5` bleibt unangetastet. **Bewiesen gleichwertig:** + `score7 == best7` über 60 000 Zufallshände, 0 Abweichungen (`tests/eval7_mc_spec.py`). Mit `score7` + + GC-aus ist der MC linear: **~43 ms/2000, ~100 ms/6000 Läufe** (vorher mit `best7` super-linear, + 3000 Läufe = 1,5 s durch GC-Thrashing). +- **`lesen/allin_ev.equity`** routet Preflop (0 Board-Karten) auf `equity_mc` mit Seed AUS DEN KARTEN + (crc32, prozess-stabil) — dasselbe Matchup → dieselbe Schätzung, auch über A/B-Arme. Flop (990) und + Turn (44) bleiben exakt. Der `preflop_ok`-Guard ist weg; Preflop qualifiziert sich jetzt und wird + live für ~100 ms bepreist (seltenes Ereignis, in der Ergebnis-Schleife tragbar). + +**Nebenbefund (wichtig):** Beim Prüfen kam AA vs KQ preflop als 0,87 heraus — kurz als Evaluator-Bug +verdächtigt (Erinnerung „AA vs KQ ~0,72" war falsch). **Drei unabhängige Evaluatoren** (score7, +best7-Enumeration, ein von Hand geschriebener unabhängiger 5-Karten-Rang) geben übereinstimmend 0,871, +0 Abweichungen. 0,87 ist korrekt: KQo ist schwächer als KK, gewinnt also weniger als dessen 18 %. Der +Ground-Truth-Evaluator ist bestätigt sauber — kein Bug. + +## Status + +Alle betroffenen Specs grün (allin_ev 23, eval7_mc 6, liveabgleich 23, ab_arm 8, einblick 12, +ergebnis 31, statistik 21, handreview 7). Die roten Specs im Gesamtlauf sind vorbestehende Windows/ +macOS-Portabilitätsfehler (AF_UNIX, SIGHUP, 0o600-chmod, /tmp- und Library-Pfade, fehlendes `mcp`), +keiner im Änderungs-Set. **Nicht committet.** Keine Engine-Verhaltensänderung — reine Mess- +Infrastruktur (die Hand-Zeile bekommt ein zusätzliches Feld; roh bleibt Vorgabe überall). + +**Offene Kante (klein):** 6000 MC-Läufe ~100 ms liegen in der Ergebnis-Schleife; bei einem seltenen +Preflop-All-in unkritisch, aber ein Schwung vieler gleichzeitig fertig werdender Preflop-All-ins (etwa +nach einem Reconnect) summiert sich. Wenn das je stört: vorberechnete 2v2-Equity-Tabelle (O(1)) oder +die MC in einen Worker schieben. Heute nicht nötig. diff --git a/docs/notizen/BEFUND-bench-kontrollvariate-beta.md b/docs/notizen/BEFUND-bench-kontrollvariate-beta.md new file mode 100644 index 00000000..a2cf4270 --- /dev/null +++ b/docs/notizen/BEFUND-bench-kontrollvariate-beta.md @@ -0,0 +1,54 @@ +# Befund: die Glückskorrektur des Benchmarks ist schon nahezu optimal — β-Tuning ist ein toter Hebel + +Frage (Marc): *„ist auch dein Bench absolute mathematische Weltklasse?"* — Teilantwort, gemessen. + +Der Benchmark speichert je Austeilung `net − luck`: eine Kontrollvariate mit **fest β = 1** +(`sim::session`). Weil der Glücks-Term Erwartungswert ~0 hat, ist `net − β·luck` für **jedes** β +erwartungstreu, und das varianzminimale β\* = Cov(net, luck)/Var(luck) ist nicht zwingend 1. Die +naheliegende „Weltklasse"-Vermutung: AIVAT (`sim::aivat`) lernt β\* kreuzangepasst und schlägt den +festen Bench. **Gemessen (`src/bin/aivat_bench.rs`, echte Sim-Daten) ist das falsch.** + +## Die Zahlen + +``` + Szenario β* Varianzfaktor CI aivat vs Bench + bench/raw aivat/raw aivat/bench + heads-up gto 1.21 1.65x 1.68x 1.01x +0.7 % + heads-up gto-small 1.08 1.50x 1.47x 0.98x -1.0 % + heads-up fish 1.21 1.32x 1.23x 0.94x -3.3 % + heads-up station 1.99 1.25x 1.36x 1.08x +3.8 % + heads-up reg 0.84 1.41x 1.36x 0.97x -1.6 % +``` + +(Alle drei Schätzer — roh β=0, Bench β=1, AIVAT β\* — stimmen je Szenario innerhalb jeder CI überein: +erwartungstreu bestätigt, wie `E[luck]=0` es verlangt.) + +## Was die Zahlen sagen + +1. **Die *vorhandene* Glückskorrektur ist der echte Gewinn.** `bench/raw` = 1.25–1.65× Varianz: die + feste β=1-Korrektur drückt die Varianz um 25–65 %. Das ist schon ausgeliefert und solide. +2. **Das β-Tuning ist ein Nicht-Gewinn.** `aivat/bench` = 0.94–1.08× — ein Wash, auf drei von fünf + Szenarien sogar minimal schlechter (Kreuzanpassungs-Rauschen bei diesem n). +3. **Warum, obwohl β\* teils weit von 1 liegt (Station β\*=1.99!):** `Var(net − β·luck)` ist quadratisch + in β und **flach am Minimum**. Nur ein grob falsches β (etwa β=0, keine Korrektur) kostet — und das + vermeidet der Bench bereits. Um das Optimum herum ist der Verlust zweiter Ordnung ≈ 0. + +## Konsequenz: NICHT ausliefern + +Kein Einhängen von kreuzangepasstem β in den Bench — es ist eine kosmetische Änderung ohne messbaren +Nutzen, gelegentlich ein kleiner Schaden. Der Diagnose-Binär `aivat_bench` bleibt als dokumentiertes +Audit-Werkzeug (wie `exploit_scan`), `session::deal_net_and_luck` als seine API. + +## Was den Maßstab WIRKLICH Weltklasse machen würde (evidenzbasiert) + +Die Varianzreduktion einer Kontrollvariate ist durch **1 − ρ²** gedeckelt, ρ = corr(net, luck). Der +tote Hebel ist β; der lebende Hebel ist ein **stärkeres Kontrollsignal** (höheres ρ): + +- **Volle AIVAT-Korrektur**, nicht nur All-in-Glück: eine Baseline an **jedem Chance- und Gegnerknoten** + des Baums (per-Street-Equity statt nur Showdown-Glück). Genau das nennt `sim::aivat` selbst als „nicht + umgesetzt". Höheres ρ² → engere CI — *dort* liegt die Weltklasse, nicht im Koeffizienten. +- **Zeituniformer Früh-Stopp** (`sim::sequential`, gebaut + bewiesen): nach jeder Austeilung peeken und + stoppen, sobald entschieden, ohne Optional-Stopping-Verzerrung. +- **Exploitability über River hinaus** + realistische Ranges + **Gegner-Holdout** gegen In-Sample-Overfit. + +Siehe `docs/notizen/ROADMAP-mathematik.md`, Abschnitt Messschicht. diff --git a/docs/notizen/BEFUND-conditioned-fold-barrel.md b/docs/notizen/BEFUND-conditioned-fold-barrel.md new file mode 100644 index 00000000..e4a44fe3 --- /dev/null +++ b/docs/notizen/BEFUND-conditioned-fold-barrel.md @@ -0,0 +1,73 @@ +# Befund: die konditionierte Fold-Equity (Stage B, live) verliert gegen balancierte Gegner + +Erster Versuch, einen Solver-Baustein (`cfr::turn`, Stage B) in den **lebenden** Entscheidungspfad zu +heben, statt ihn nur als Toy-Test zu beweisen. Ergebnis: ein gemessener **Verlierer** auf genau den +Szenarien, die er heilen sollte. Komplett revertiert. + +## Die Idee (theoretisch sauber) + +`cfr::turn` beweist auf abstrakten Buckets: Ein Barrel gegen eine Range, die **vorher schon gecallt +hat**, bucht die *globale* Fold-to-Bet-Quote (`exploit::table_fold`) als Phantom-Gewinn — die Hände, +die gecallt haben, sind die starke committete Fortsetzungs-Range und folden höchstens die +Mindestverteidigungsfrequenz (alpha) auf einen weiteren Einsatz. Gebucht > realisiert, der Barrel +blutet (BEFUND-nit-read-leck). + +Gebaut: `engine::conditioned_fold` — sobald ein lebender Villain **postflop gecallt** hat, wird die +Fold-Equity eines Bluffs/Halbbluffs auf die GTO-Decke `alpha = r/(1+r)` (`r = pressure_ratio`) +gekappt. Erste Einsätze und alle Value-Linien unberührt (Steal/Value-Farming bleibt unangetastet). +Eingehängt an `options.rs:134`. 6 Unit-Tests + 41 Lib-Tests grün. + +## Gemessen (gepaart, 3000-Deal-Leiter, gegen Basislinie 24549fb+lokal) + +``` + heads-up gto -3.76 ± 1.99 bb/100 30 geändert SCHLECHTER (-28.92 -> -32.68) + heads-up gto-small -3.29 ± 1.87 bb/100 31 geändert SCHLECHTER (-17.24 -> -20.54) + heads-up gto (blind) -3.76 ± 1.99 30 geändert SCHLECHTER + heads-up gto-small (blind) -3.29 ± 1.87 31 geändert SCHLECHTER + heads-up fish (blind) +4.45 ± 2.79 27 geändert BESSER + heads-up calling station (blind) +8.34 ± 3.52 40 geändert BESSER + GESAMT -0.14 ± 0.42 234 geändert nicht unterscheidbar +``` + +Alle Farm-Bots (reg/nit/maniac/fish/station, read-given) **gleich oder nicht unterscheidbar** — die +Gates schützen sie wie gebaut. Der Netto-Effekt ist null. Aber die **balancierten Zielszenarien +verlieren signifikant** (Intervall schließt 0 aus). + +## Warum es verliert — die Kernkorrektur + +Der `cfr::turn`-Beweis gilt gegen einen **Über-Folder** (Nit, globale Quote 0.82 ≫ alpha): dort ist +die gebuchte Fold-Equity auf der verengten Range tatsächlich Phantom. Gegen einen **genuin +balancierten** Gegner (gto, foldToBet 0.42 ≈ alpha) ist die Fold-Equity **kein Phantom** — der gto +foldet real auf der Mindestverteidigungsfrequenz, die Barrels waren **+EV** (deckt sich mit Stage 5: +„jeder Aggression-Eimer ist +EV gegen gto"). Die Decke kappt genau diese realen, profitablen Barrels +(und wirft über die `PURE_BLUFF_MIN_FOLD`-Schwelle einige ganz weg) → der Gewinn geht verloren. + +**Also:** Das Over-Barrel-Leck ist **Nit-spezifisch** (Über-Folder, mehrstraßig), kein allgemeines +Leck gegen committete Ranges. Und die Leiter belohnt seine Behebung nicht: Die Engine **farmt Nits +ohnehin** (+38 bb/100), das mehrstraßige Phantom kostet dort real so wenig, dass es im Rauschen liegt, +während dieselbe Kappung die +EV-Barrels gegen den balancierten Gegner wegnimmt. + +## Folge für die Vision (engine-math-vision) + +Die Vision-Annahme „**Stage B = hier stirbt das Over-Barrel-Leck**, der Barrel sieht endlich die +River-Konsequenz" ist gegen **balancierte** Gegner **falsch**: Der Barrel ist dort schon richtig +bepreist. Stage B als pauschale konditionierte Fold-Equity ist kein Leiter-Gewinn. + +Was die Messung dieser Session kumulativ zeigt: +- **Defense gegen gto** (Over-Call): Rest ist Cooler-Varianz, nicht foldbar (Over-Call-Decke inert). +- **Offense gegen gto** (Barrel): konditionierte Fold-Equity verliert — die Barrels sind schon +EV. +- Gegen die **fixen balancierten Bots ist die Heuristik nahe an ihrem erreichbaren EV**; der + −24/−17-Rest ist überwiegend irreduzible Varianz + die strukturelle Realisierungslücke, kein + heuristisch schließbares Leck. + +**Konsequenz:** Der echte Gewinn der Vision (sichere Ausnutzung) zeigt sich **nicht** in bb/100 gegen +diese fixen Near-GTO-Bots — dort ist das Signal cooler-/varianzdominiert. Er zeigt sich gegen +**ausnutzbare** Gegner (die Farm-Bots, schon +100..+350) und, als Unausnutzbarkeits-Beweis, in der +**Postflop-Exploitability gegen eine Best Response** — das eine Maß, das MODULES.md ausdrücklich als +fehlend nennt („Postflop-Exploitability gegen eine Best Response fehlt noch"). Der nächste echte +Schritt ist dieses Maß zu bauen, nicht ein weiterer bb/100-Patch gegen gto. + +## Status + +Revertiert: `engine::conditioned_fold` gelöscht, `options.rs`/`engine/mod.rs` unverändert, `cfr::turn` +bleibt als bewiesener Toy-Baustein liegen. 41 Lib-Tests grün. Kein Fix ausgeliefert. diff --git a/docs/notizen/BEFUND-exploitation-luecke-population.md b/docs/notizen/BEFUND-exploitation-luecke-population.md new file mode 100644 index 00000000..ee37bcc3 --- /dev/null +++ b/docs/notizen/BEFUND-exploitation-luecke-population.md @@ -0,0 +1,59 @@ +# Befund: +19 bb/100 Exploitation-Lücke gegen eine gezogene Population — das Labor zeigt, was die Leiter verbarg + +Stufe 0 des synthetischen Labors steht und liefert die erste **positive, signifikante** Exploitation- +Zahl dieser Arbeit. Gemessen gegen eine gezogene Gegner-Population mit **abgeschaltetem Oracle-Read**: +die Engine muss den Gegner aus beobachteten Aktionen erschließen (`sim::memory` → die 4 HUD-Zahlen), +statt ihn geschenkt zu bekommen. + +## Aufbau + +- `sim::population`: Verteilung über `reader::Rules` (6 Schwellen), Archetyp-Mischung (fish/reg/nit/ + maniac) mit Streuung → tausende *individuelle* Gegner, jeder mit verdecktem Label. +- `sim::exploit_pop`: zieht N Gegner (`Opponent::Styled`, kein Oracle-Profil → `reads` gibt `None`), + spielt die Engine heads-up gegen jeden **einmal blind, einmal mit Session-Memory**, über dieselben + Austeilungen (Kartenglück hebt sich paarweise auf). Lücke = `memory − blind`, bb/100. +- CI gepaart (`sim::paired`) **und** anytime (`sim::sequential`) — Letzteres zum ersten Mal auf echten + schwer-tailed Pokerdaten statt synthetischem Gauß. + +## Ergebnis (`exploit_gap`, 48 Gegner × 400 Austeilungen) + +``` + blind (kein Read) +24.96 bb/100 + memory (erschlossen) +43.95 bb/100 + EXPLOITATION-LÜCKE +18.98 bb/100 paired ±7.14, anytime ±14.64 SIGNIFIKANT POSITIV + + nach verdecktem Archetyp (mittlere Lücke je Gegner): + fish +45.93 (18) <- hier liegt das Geld + nit +8.94 (10) + maniac +4.00 ( 7) + reg -2.53 (13) <- Überadjust gegen Balancierte (richtungsweisend, kleine Stichprobe) +``` + +Selbst die konservative Anytime-CI schließt die 0 aus (18.98 − 14.64 = +4.3 > 0). + +## Was das heißt + +1. **Die These stimmt.** Gegen eine *varied* Population, Oracle aus, verdient das Erschließen des Reads + ~+19 bb/100 über blindes Spiel — fast eine Verdopplung der Winrate (+25 → +44). +2. **Die Leiter verbarg das strukturell.** Dort bekommt die Engine den konvergierten Oracle-Read + (`sim::reads::opponent_profile`) geschenkt → nichts zu erschließen, keine Exploitation messbar. Das + ist der Grund, warum frühere Live-Integrationen auf der Leiter „nichts brachten": das Maß war blind + für genau die Fähigkeit, die zählt. +3. **Der eine negative Wert ist Signal, kein Rauschen allein.** `reg −2.53`: gegen balancierte Gegner + überadjustiert die Engine. Das ist exakt die Motivation der Krone (KL-Vertrauensregion, λ aus + Konfidenz): bei balanciert aussehendem Read nahe GTO bleiben. Nächster Hebel, nicht Zufall. +4. **Die Konfidenzfolge hält auf echten Daten.** Breiter als die feste CI (richtig so — gültig unter + Peeking), konsistent. Die frühere „nur auf Gauß geprüft"-Lücke ist damit geschlossen. + +## Grenzen (ehrlich) + +- 48 Gegner ist eine moderate Stichprobe; die **gepoolte** Lücke (±7.14 über ~19 200 gepaarte + Austeilungen) ist belastbar, die **Pro-Archetyp**-Zahlen (7–18 Gegner) sind richtungsweisend. +- Die Population ist noch der ungeeichte `micro`-Prior. Stufe 1 fittet sie an echte Daten + (`lesen/profil.py`, `gedaechtnis`), erst dann ist die absolute Zahl real; die *Methode* steht. + +## Nächste Stufen + +Stufe 1 Kalibrierung (Population an echte HUD/Sizing-Daten), Stufe 2 EGTA-Harness + Exploitability- +Wächter (Zwillings-Tor; adressiert `reg`), Stufe 3 adaptive Liga (Mindgames). Siehe +`docs/notizen/ARCHITEKTUR-synthetik-labor.md`. diff --git a/docs/notizen/BEFUND-gto-restleck-river-overcall.md b/docs/notizen/BEFUND-gto-restleck-river-overcall.md new file mode 100644 index 00000000..5704be9a --- /dev/null +++ b/docs/notizen/BEFUND-gto-restleck-river-overcall.md @@ -0,0 +1,161 @@ +# Befund: das nächste Leck (River-Über-Call gegen Value) sitzt in der falschen Schicht + +Nach dem MDF-Boden-Fix (BEFUND-gto-ueberdefense, −38.44 → −24.83 bb/100) habe ich den nächsten +Leak gesucht. Ergebnis: ein echter, aber **kleiner und variance-behafteter** Rest, der sich mit der +jetzigen Architektur und Messung **nicht sauber beweisen** lässt. Kein Fix ausgeliefert. + +## Zwei klare Zwischenbefunde + +**1. Es gibt KEIN Fold-Disziplin-Leck.** Über-Fold-Test (`diag_gto`, pro Straße bei gefasstem Bet: +foldet der Hero mit Equity ≥ Break-even?): + +``` + street faced folds folds w/ odds fold% + preflop 1944 244 0 12.6% + flop 335 138 0 41.2% + turn 216 101 0 46.8% + river 167 129 0 77.2% +``` + +**Null Folds mit Odds auf jeder Straße.** Jeder Fold ist modell-korrekt (Equity < Break-even). Die +Fold-Eimer (river −24, preflop −22, turn −12, flop −10 bb/100) sind **Sunk-Cost** aus früherer +Investition, kein Over-Fold. Folden-wir-zu-viel ist widerlegt. + +**2. Der Rest-Leak ist ein Über-Call marginaler Made-Hands gegen Value.** Der River-Call-Eimer +(−25.58 bb/100, 32 Hände) liegt im Band **eq 0.35–0.55** (27 Hände, −12 bis −28 bb/Hand). Beispiele, +womit der Hero callt und verliert: + +``` + Qd 4c board 7h 4h Jc Js 9s eq 0.35 net -25.9 (Zweitpaar / Board-Paar) + 8d 8s board 4d Tc Kd Th 3c eq 0.44 net -28.7 (Unterpaar zu TT/K) + Jc Jd board 4c Kd 6s Ts 6d eq 0.45 net -18.3 (Unterpaar zu K) + 8s 9s board Jd Th 3c 9h Jc eq 0.43 net -53.7 (schwaches Zweitpaar) + 4h 5d board 9h 4d 9c 4s 6s eq 0.48 net -65.4 (Fours-full vs Nines-full = Cooler) + Qc Qd board Th Ah 9c Jc Tc eq 0.52 net -75.6 (Cooler) +``` + +Muster: **schwache Zweitpaare / Unterpaare** bluffcatchen River-Value-Bets. Das Modell bewertet sie +mit 0.35–0.55, weil sein River-Bet-Range-Boden **Top Pair Good Kicker** ist (`BET_RUNG`) — also „über" +dem Single-Pair-Boden der modellierten Betting-Range. Ein balancierter Gegner **bettet aber keine +mittleren Hände** (er checkt sie, gto.rs: „medium hands check"); seine Value-Bets sind stärker. Der +Boden ist zu niedrig → Equity überschätzt → marginaler Call → Verlust. Dazu: mehrere der 27 Hände sind +**Cooler/Varianz** (Fours-full, QQ), nicht systematisch. + +## Warum der naheliegende Fix in der falschen Schicht sitzt + +Der naheliegende Griff — den River-Value-Boden für einen balancierten Regular um eine Sprosse heben +(`street_continuation::river_value_bump`) — habe ich gebaut und gemessen: **exakt null Wirkung** +(−24.83 → −24.83, River-Band bit-identisch). + +Grund: `engine::read_gate::gate_reads` **streicht das Profil** für jeden Stil mit `earned_trust == 0` +— darunter `Regular` (der gto). Das Range-Modell (`range_spec` → `street_continuation`) sieht den gto +also **blind** (`profile: None`), der Bump feuert nie. Das ist **Absicht**: `read_gate` (Zeile 38–44) +schreibt das Gesetz fest — **defensive** Read-Anpassungen („fold more thin value / bluff catchers into +a proven non-bluffer") gehören in den **ungegateten** MDF-Boden-Pfad (`mdf_floor::floor` auf dem +`raw`-Spot), **offensive** werden gegatet. Mein River-Über-Call-Fix ist eine *defensive* Anpassung — +also gehört er NICHT ins (gegatete) Range-Modell, sondern in den ungegateten Defense-Pfad. + +## Der richtige Fix (noch nicht gebaut): eine „Over-Call-Decke" neben dem MDF-Boden + +Spiegelbild des MDF-Bodens, gleiche Bauart (ungegateter Read, nur River, auf Heros Made-Hand): +- **Boden** (existiert): macht gegen einen bewiesenen **Over-Bluffer** aus einem Fold einen MDF-Call. +- **Decke** (fehlt): macht gegen einen bewiesenen **Value-Better / Nicht-Over-Bluffer** aus einem + marginalen Modell-Call einen Fold — denn gegen eine wertlastige Betting-Range schlägt der dünne + Bluffcatcher nur die (zu wenigen) Bluffs. + +Genau die Kronengleichung, defensive Seite: λ = belastbares Read, nur gegen einen *bewiesen* +balancierten/engen Better schärfer folden; Fische/Stations/ungelesen unberührt (dort ist weites +Callen korrekt und bezahlt). + +## Warum jetzt nicht gebaut: die Messung trägt es nicht + +Der Rest-Leak ist **−12 bis −22 bb/100 auf ~27 Händen**, das gto-Szenario hat **±10 bb/100 CI** (1000 +Deals) und enthält sichtbare Cooler. Ein Fix, der die Hälfte zurückholt, landet **im Rauschen** — nicht +beweisbar. Nach der Arbeitsleiste („measure first; never ship a loser; prove on the ladder") ist der +nächste Schritt **nicht** ein blinder Patch, sondern: + +1. **Messung schärfen:** gto-Deals hochdrehen (z. B. 1000 → 5000) und/oder einen zweiten balancierten + Gegner (andere Size/Bluff-Mischung) aufnehmen, damit ein ~10-bb/100-Defense-Fix signifikant wird. +2. **Dann** die Over-Call-Decke bauen und gepaart beweisen; sonst reverten + Befund. + +## Messung geschärft (erledigt — Vorarbeit für die Over-Call-Decke) + +Damit ein ~6–8-bb/100-Defense-Fix überhaupt beweisbar wird: + +- **Deals hoch:** die balancierten Heads-up-Szenarien laufen jetzt mit `BALANCED_DEALS = 3000` statt + 1000 (CI ~1.7× enger). Die Leiter braucht dafür 244 s statt 180 s — vertretbar für eine + Beweis-Leiter. +- **Zweiter balancierter Gegner:** `Style::GtoSmall` (`sim::gto::Shape::SMALL`, Half-Pot, 0.3 Bluffs + pro Value) — ein unabhängiges, wertlastigeres Ziel, damit die Decke generalisieren muss, nicht den + einen `Gto` überanpasst. `sim::gto` ist dazu auf `Shape { bet_size, bluff_per_value }` + parametrisiert; `Gto` = `Shape::BALANCED` ist byte-identisch zu vorher (die −24.83-Messung bleibt + unberührt). +- **Validiert balanciert:** der Engine verliert auch gegen `gto-small` (**−17.24 bb/100** read-given, + −23.46 blind) — ein echter balancierter Gegner, kein schwacher Bot (den der Engine mit +100 + zerlegen würde). + +**Wichtig — warum die Schärfung nötig war:** bei 3000 Deals steht `heads-up gto` auf **−28.92 bb/100**, +auf den 1000 Deals des `diag` dagegen −24.83. Eine ~4-bb/100-Stichprobenschwankung, **größer als der +erwartete Fix-Effekt** — ein auf 1000 Deals „bewiesener" kleiner Fix wäre Rauschen gewesen. + +Neue Basislinie (`benchmarks/baseline.txt`, 19 Szenarien, MDF-Fix drin, noch keine Decke) gespeichert. +`diag_gto` nimmt jetzt Deal-Zahl + Gegner als Argumente (`diag_gto 5000 gto-small`), für schnelle +deterministische In-Sample-Iteration der Decke. + +## Over-Call-Decke gebaut, gemessen, widerlegt, revertiert + +Die Decke wurde **genau wie geplant** gebaut (ungegateter Overlay in `mdf_floor`, nur River, +Spiegelbild des Bodens): + +- `proven_value_bettor(profile)` = `classify ∈ {Regular, Nit}` ∧ `aggression < 0.60` (Spiegel von + `over_bluffs`), `range_is_value_heavy` = **alle** lebenden Villains gelesen und value-heavy. +- `only_beats_bluffs(made)` = `beats_bluffs ∧ made < TopPairWeakKicker` (Underpair/BottomPair/MiddlePair). +- `ceiling(...)`: aus einem Modell-**Call** eines reinen Bluffcatchers gegen einen bewiesenen + Value-Better wird ein **Fold**. 10 Unit-Tests grün, Prädikat verifiziert (`vh=true` auf gto und + gto-small, Boden/Decke schließen sich gegenseitig aus). + +**Gemessen (gepaart, in-sample via `diag_gto`): exakt null Wirkung.** + +``` + vor Decke nach Decke + gto -24.83 -24.83 (byte-identisch, 0 Flips) + gto-small -11.25 -11.25 (byte-identisch, 0 Flips) +``` + +**Warum null:** die Decke feuert nie, weil das Leck, das sie treffen soll, **nicht existiert**. Eine +Instrumentierung aller River-Calls-facing-a-bet (CEIL_DEBUG) zeigt die wahre Verteilung der 32 Hände +im River-Call-Eimer: + +``` + gto (1000 Deals, 32 River-Calls): 30× TwoPair, 1× TopPairWeakKicker, 1× FullHouse + gto-small (400 Deals, 13): 12× TwoPair, 1× FullHouse +``` + +**Kein einziger Underpair / BottomPair / MiddlePair.** Die schwachen Bluffcatcher, die der obige +Equity-0.35–0.55-Dump suggerierte, **foldet der Engine bereits korrekt** (Modell-Fold, 0 Over-Folds — +siehe oben). Die 0.35–0.55-Equity im Dump war die **Modell**-Equity, nicht die Handklasse: ein +kontrafeited TwoPair oder ein Cooler steht beim Modell bei 0.4, ist aber in Wahrheit `TwoPair`. + +**Der Rest-Leak ist also ein Cooler-Leck, kein Over-Call-Leck.** Die verlierenden River-Calls sind +**starke Made-Hands (TwoPair+), die auf gepaarten Boards zweitbest sind** (Villain hat das bessere +Zweitpaar / Trips / Full House). Die kann man gegen eine balancierte Value+Bluff-Range **nicht +profitabel folden**: TwoPair schlägt alle Bluffs und einen Teil des dünnen Values; „alle TwoPair +folden" wäre ein katastrophaler Over-Fold (man foldet das gewinnende Zweitpaar viel öfter als das +verlierende). Der Dump zeigte nur die **Verlierer** des Eimers; über 32 Hände mit ±CI-Rauschen ist der +negative Netto-Saldo nicht als systematisches Leck belegbar. + +**Fazit (Arbeitsleiste: never ship a loser):** kein Fix ausgeliefert, Decke komplett revertiert +(`mdf_floor` trägt wieder nur den bewiesenen MDF-Boden, `decide` unverändert, 41 Lib-Tests grün). Der +−24.83/−11.25-Rest gegen balancierte Gegner ist **primär Cooler-Varianz auf starken Händen + Preflop- +Sunk-Cost**, kein foldbarer River-Over-Call. + +**Die geschärfte Messung hat sich bezahlt gemacht** — nicht durch einen Fix, sondern indem sie die +wahre River-Call-Verteilung (32 Hände, alle TwoPair+) klar zeigte und die plausibel klingende +Over-Call-Hypothese **tötete, bevor** ein inerter Patch ausgeliefert wurde, der dem Prosa-Muster des +Befunds entsprach, aber den Daten nicht. + +## Werkzeug + +`src/bin/diag_gto.rs` erweitert: Über-Fold-Test (facing-a-bet fold-vs-odds pro Straße), Dump der +verlierenden River-Calls (Heros Bluffcatcher mit Board + Modell-Equity), und Argumente für Deal-Zahl +und Gegner. Bleibt als Diagnose. (Die CEIL_DEBUG-Instrumentierung wurde mit der Decke revertiert.) diff --git a/docs/notizen/BEFUND-gto-ueberdefense-read.md b/docs/notizen/BEFUND-gto-ueberdefense-read.md new file mode 100644 index 00000000..a907b052 --- /dev/null +++ b/docs/notizen/BEFUND-gto-ueberdefense-read.md @@ -0,0 +1,125 @@ +# Befund: der GTO-Boden unter dem realistischen Read — Über-Defense durch Breite-als-Bluff-Fehlsignal + +Der Boden des Zwillings-Tors stand bei **gto −36.25 bb/100** (`twin_gate`, Memory-Read — der realistisch +eingesetzte Read, nicht das geschenkte Oracle). Die beiden früheren GTO-Befunde arbeiteten mit dem +**Oracle**-Read (`diag_gto`, −24.83) und schlossen daraus, der Rest sei Cooler-Varianz + Preflop-Sunk-Cost, +kein foldbarer River-Leak (`BEFUND-gto-restleck-river-overcall`). Das stimmt — **für den Oracle-Read**. +Unter dem realistischen Session-Read liegt darunter aber noch ein echtes, lesegetriebenes Leck. + +## Die entscheidende Messung: Oracle ≠ Memory + +Für einen `Regular`/`Gto` ist `earned_trust == 0` (`engine::read_gate`), das Range-Modell spielt ihn also in +**jedem** Lese-Modus blind. Der einzige Hebel, der den gto berührt, ist der **ungegatete MDF-Boden** +(`exploit::mdf_floor`). Eine Sonde (`floor_read`, gto, 800 Austeilungen) zeigt den Lese-Effekt isoliert: + +``` + gto Oracle -27.60 bb/100 (Boden feuert NICHT) + gto Blind -40.04 bb/100 (Boden feuert -> Over-Call) + gto Memory -40.04 bb/100 (Boden feuert -> Over-Call, = Blind!) +``` + +Memory == Blind, obwohl der Read nach 25 Hand Warmup voll steht. Das heißt: der Boden feuert auch **mit** +dem Session-Read. Warum? Weil er den Read als Over-Bluffer liest. + +## Die Wurzel: `over_bluffs` feuerte auf Preflop-**Breite**, nicht auf Bluff-Frequenz + +`mdf_floor::over_bluffs` feuerte bei `classify(profile) == LooseAggressive`. `classify` stuft als +LooseAggressive ein bei **vpip ≥ 0.35 ∧ pfr ≥ 0.20** — also reiner **Range-Breite**. Heads-up spielt ein +korrekt balancierter Gegner eine weite Range (Button opent ~80 %, BB verteidigt ~70 %). Sein **gemessener** +Session-Read ist deshalb breit, obwohl seine Postflop-Aggression maßvoll ist. Direkt gemessen +(`gto_read_probe`, Memory-Read-Endstand): + +``` + Archetyp vpip pfr fold2bet aggr classify over_bluffs(alt) + gto 0.70 0.46 0.50 0.35 LooseAggressive true <- FEHLSIGNAL + maniac 0.93 0.21 0.34 0.49 LooseAggressive true (korrekt) + fish 0.87 0.00 0.21 0.11 CallingStation false + reg 0.49 0.06 0.47 0.31 CallingStation false +``` + +Der balancierte gto (Aggression **0.35**) und der echte Over-Bluffer-Maniac (Aggression **0.49**) sind über +vpip/pfr **nicht unterscheidbar** — beide „LooseAggressive". Das einzige trennende Merkmal ist die +**Postflop-Aggression**. Das Oracle-Read des gto entkam dem nur, weil es per Hand auf ein schmales vpip 0.32 +(< 0.35) gesetzt ist; der Session-Read misst die echten 0.70 und fällt ins Fehlsignal. So kam der +−52-bb/100-Over-Call aus `BEFUND-gto-ueberdefense` unter dem realistischen Read zurück — der dortige Fix +(`under_bluffs` → `over_bluffs`) deckte nur den Oracle-Wert, nicht die Breite-Falle. + +Range-**Breite** ≠ Bluff-**Frequenz**. Wer breit spielt, blufft nicht automatisch zu viel. + +## Der Fix: trust-aware, auf dem direkten Bluff-Signal + +`over_bluffs` feuert jetzt **nur** auf gemessene Postflop-Über-Aggression, der Breite-Term fällt weg: + +```rust +const OVER_BLUFF_AGGRESSION: f64 = 0.45; // war 0.60, jetzt das alleinige Signal +fn over_bluffs(profile: &Profile) -> bool { + profile.aggression.is_some_and(|a| a >= OVER_BLUFF_AGGRESSION) +} +``` + +0.45 liegt zwischen balanciert (gto 0.35/0.40, gto-small darunter) und echtem Over-Bluffer (maniac 0.49/0.50): +der Maniac trippt weiter, der Balancierte nicht mehr. Das ist die Kronengleichung auf der Defensiv-Seite +(λ = belastbares Read): nur ein Read, der „dieser Gegner blufft zu viel" sagt, übersteuert den Modell-Fold — +und „zu viel bluffen" misst man an der Aggression, nicht an der Preflop-Breite. + +## Beweis (gepaart, 95 %-CI) + +**Boden-Achse** (`floor_read`, paired legacy vs neu, Memory, 4000 Austeilungen): + +``` + gto legacy -33.59 -> neu -26.75 | NEU-LEGACY +6.84 ± 6.74 Better (219 geänd.) + gto-small legacy -20.24 -> neu -14.10 | NEU-LEGACY +6.15 ± 4.50 Better (213 geänd.) + maniac legacy +82.57 -> neu +82.57 | NEU-LEGACY +0.00 ± 0.00 Identisch (0 geänd.) +``` + +Beide balancierten Ziele steigen signifikant (Intervall über 0); der Maniac ist **bit-identisch** — die +Über-Bluffer-Verteidigung, von der die Offense lebt, wird **nicht** zurückgegeben. + +**Read-Lücke geschlossen** (`floor_read`, geshippter Code, Oracle/Blind/Memory, 2000 Austeilungen): +nach dem Fix steht Memory wieder bei Oracle statt bei Blind — der Boden feuert nicht mehr fälschlich. + +``` + Oracle Blind Memory + gto -17.80 -26.08 -18.26 (vor dem Fix: Memory = Blind = -40) + gto-small -2.63 -8.21 -2.88 +``` + +(Absolut-Niveau ≠ Zwillings-Tor-Boden −23.93: andere Austeilungen — 2000/SEED hier vs 4000/seed^5 im +Tor, ±23-CI. Die Richtung zählt: Memory ≈ Oracle, der lesegetriebene Over-Call ist weg.) + +**Zwillings-Tor** (`twin_gate`, Vollbudget, Baseline vs Kandidat) — die Accept-Regel: + +``` + Achse Baseline Kandidat Tor-Regel + OFFENSE (pop-EV) +43.95 +44.16 haelt (+0.21) OK + BODEN gto -36.25 -23.93 hoch um +12.32 OK + gto-small -25.93 -21.58 hoch um +4.35 + reg/nit/fish -17.66/+42.92/+126.85 identisch unberuehrt + EXPLOITABILITY 77.03 77.03 identisch OK +``` + +`Gate::passes` = **true**: Population-EV hält, der Boden steigt, Exploitability steigt nicht. Die +Exploitability ist **konstruktiv** unverändert — die River-Batterie läuft mit `villain_profile: None`, und +der Fix berührt nur den Read-Profil-Zweig von `over_bluffs` (ungelesene Gegner feuern weiter über +`is_none_or`). + +## Einordnung und was bleibt + +Der Boden gegen den schlechtesten Balancierten (gto) steigt von −36.25 auf −23.93 bb/100 (Zwillings-Tor) +bzw. gepaart +6.84 ± 6.74 — **signifikant angehoben, ohne Offense oder Exploitability zu brechen**. Das war +der lesegetriebene Anteil, den die Oracle-Diagnose der früheren Befunde strukturell nicht sehen konnte. + +Was **nicht** gelöst ist: der verbleibende Boden (gto −23.93) ist der Oracle-Rest — verteilte GTO-Distanz +(Aggression +97 / Defense −121 im `diag_gto`-Bucket), primär Cooler-Varianz auf starken Händen + Preflop- +Sunk-Cost gegen eine balancierte Range (`BEFUND-gto-restleck-river-overcall`). Den hebt kein Defense-Tweak; +er braucht den opponent-aware, trust-gegateten River-Subgame-Solver (`engine::decide` Kommentar, Stage A→live). +Der **Blind**-Zweig (`range_may_bluff` feuert bei ungelesenem Gegner, −40 vs Balancierte) ist bewusst +unangetastet: er trägt die Offense gegen die ungelesene Mikro-Population und wird vom Zwillings-Tor bewacht; +ihn anzufassen riskiert die +44 Population-EV und gehört in eine eigene, gepaart bewiesene Änderung. + +## Werkzeug + +- `src/bin/gto_read_probe.rs` — zeigt den Memory-Read je Archetyp + `classify` (das Fehlsignal sichtbar). +- `src/bin/floor_read.rs`, `src/bin/offense_proof.rs` — gepaarte legacy-vs-neu-Beweise (Boden- und + Offense-Achse) über einen temporären Mess-Schalter. (Schalter + Beweis-Bins nach Abnahme entfernt; + Reproduktion git-basiert wie die übrigen Befunde.) diff --git a/docs/notizen/BEFUND-gto-ueberdefense.md b/docs/notizen/BEFUND-gto-ueberdefense.md new file mode 100644 index 00000000..9d49a28a --- /dev/null +++ b/docs/notizen/BEFUND-gto-ueberdefense.md @@ -0,0 +1,129 @@ +# Befund: die −38 bb/100 heads-up gegen GTO sind ein Über-Call-Leck, kein Over-Barrel + +**Messung** (`cargo run --release --bin diag_gto`, Szenario `heads-up gto`, 2000 Hände, deal-genau +wie die Leiter, luck-korrigiert). Gesamt **−38.44 bb/100** (≈ **−$77 / 100 Hände** bei $1/$2) — +exakt die Leiterzahl, der Nachbau ist treu. + +## Die Aufschlüsselung nach Straße × letzter Hero-Aktion + +Jede Hand wird ihrer **terminalen** Hero-Entscheidung zugeschlagen (Straße + Aktion). Die +bb/100-Beiträge summieren sich auf die −38.44. + +``` + bucket bb/100 hands bb/hand share% + river call -52.29 92 -11.37 4.6% <-- DAS LECK + preflop fold -21.73 244 -1.78 12.2% + turn fold -12.17 101 -2.41 5.0% + river fold -10.88 69 -3.15 3.5% + flop fold -10.28 138 -1.49 6.9% + river check -4.28 294 -0.29 14.7% + ... + flop raise/bet +5.64 90 +1.25 4.5% + turn raise/bet +23.78 155 +3.07 7.8% + river raise/bet +31.21 153 +4.08 7.7% + preflop raise/bet +36.40 431 +1.69 21.6% +``` + +**Jeder Aggressions-Bucket ist positiv.** Preflop, Flop, Turn, River — wenn der Hero bettet oder +raist, verdient er (zusammen **+97 bb/100**). Das **widerlegt die Over-Barrel-Hypothese für diesen +Gegner**: die Engine barrelt nicht zu viel in genutzte Ranges, ihre Bets machen Geld. Der Verlust +sitzt vollständig auf der **passiven/defensiven** Seite. + +## Die Wurzel: der River-Call + +**−52.29 bb/100 aus nur 92 Händen (−11.37 bb/Hand).** Nach der vom Hero **selbst geschätzten +Equity** beim Call: + +``` + equity band bb/100 hands bb/hand + eq <0.35 -28.33 64 -8.85 <-- die Masse + eq 0.35-0.45 -11.86 20 -11.86 + eq 0.45-0.55 -9.92 7 -28.34 + eq >=0.55 -2.18 1 -43.60 +``` + +**84 von 92 River-Calls macht die Engine mit unter 45 % Equity — nach ihrer eigenen Schätzung +hinten — und verliert in jedem Band.** Sie callt River-Bets, von denen sie weiß, dass sie geschlagen +ist. + +## Mechanismus: der MDF-Boden feuert gegen einen ausbalancierten Gegner + +`exploit::mdf_floor::floor` verwandelt auf dem River einen **modellgetriebenen Fold** einer +verteidigungswürdigen Made-Hand in einen MDF-Call — **es sei denn**, jeder lebende Gegner ist ein +*bestätigter Unter-Bluffer* (`under_bluffs`: Aggression < 0.25 **oder** Nit). + +Das Oracle-Read des GTO-Gegners ist `p(vpip 0.32, pfr 0.22, fold_to_bet 0.42, aggression 0.40)`. +Aggression **0.40 ≥ 0.25**, und `classify` liest ihn als *plain regular*, nicht Nit. Also: +`under_bluffs = false` → `range_may_bluff = true` → **der Boden feuert**. Er überstimmt den korrekten +Modell-Fold und callt mit Unterpaar/Bottom-Pair gegen eine **ausbalancierte, wertlastige +River-Betting-Range**, die den Bluffcatcher schlägt. + +Der Boden ist **auf die Mikro-Over-Folder kalibriert**, gegen die er gebaut wurde (Kommentar im +Modul: "mean equity bias ~−0.22, river fold-to-bet ~86 %" — das ist die Fish/Station-Leiter). Gegen +die verliert Über-Defense nicht, weil die wirklich zu viel bluffen/zu viel folden. Gegen einen +balancierten Werte-Better **zahlt dieselbe Über-Defense Value ab** → −11 bb pro Call. + +## Position + +``` + seat 1 button/SB -12.48 bb/100 + seat 2 BB -25.95 bb/100 <-- out of position blutet doppelt +``` + +Schlimmste Einzelzelle: **BB river call −33.45 bb/100**. Out of position, wo der GTO-Gegner mehr +bettet, über-verteidigt der Boden am meisten. + +## Schlussfolgerung — beantwortet die Methoden-Weiche + +1. **Stage B ist nicht der Fix für die −38.** Stage B (konditionierte Fold-Equity) zähmt das + *Barreln* — die Bet/Raise-Seite, die hier schon **+97 bb/100 Gewinn** macht. Es würde das Leck + nicht berühren und riskiert, die profitable Aggression zu beschneiden. Der Kern bleibt richtig + gebaut und bewiesen (`src/cfr/turn.rs`) für den Gegner, bei dem die Myopie *wirklich* der Leak ist + (Nit/Station, BEFUND-nit-read-leck) — nur nicht für diesen. + +2. **Der Fix liegt auf der Defense-Seite und ist trust-aware** — genau die Kronengleichung + (`max E_belief[EV] − λ·KL`): λ = belastbares Read. Gegen einen **bewiesenen Over-Folder** (Fish/ + Station) hart verteidigen; gegen einen **balancierten/wertlastigen** Better dem Modell-Fold + **trauen**. Konkret: `under_bluffs` / `range_may_bluff` so schärfen, dass ein balancierter Regular + (Aggression ~0.4, fold_to_bet ~0.42, pfr/vpip nah beieinander) den MDF-Boden **nicht** auslöst — + der Boden ist eine Antwort auf *gemessenes* Über-Folden, kein pauschaler Riegel gegen jeden, der + nicht Nit ist. + +## Fix gebaut und gemessen + +Der MDF-Boden feuert jetzt nur noch bei **positivem Over-Bluff-Beleg** (`over_bluffs`: +`classify == LooseAggressive` oder Aggression ≥ 0.60) oder gegen einen **ungelesenen** Gegner — statt +"gegen jeden, der nicht Nit ist". Ein balancierter/enger Regular (gto, reg) löst den Boden nicht mehr +aus; sein Fold wird dem Range-Modell überlassen (λ = belastbares Read). `src/exploit/mdf_floor.rs`: +`under_bluffs` → `over_bluffs`, `range_may_bluff` entsprechend geflippt. +2 Unit-Tests +(balancierter Regular nicht gefloort, Maniac weiter gefloort). + +**Diagnose nach dem Fix** (`diag_gto`): heads-up gto **−38.44 → −24.83 bb/100**. Der River-Call-Eimer +**−52.29 → −25.58 bb/100** (92 → 32 Hände) — die dünnen Bluffcatcher unter 45 % Equity werden jetzt +gefoldet statt zwangsweise gecallt. + +**Gepaarte Leiter** (nur dieser Fix isoliert, 17 Szenarien, PRE-FIX vs POST-FIX): + +``` +heads-up gto +13.61 ± 10.25 bb/100 60 geändert BESSER +6-max gto +7.38 ± 13.43 7 geändert nicht unterscheidbar +heads-up reg +9.20 ± 26.58 73 geändert nicht unterscheidbar +nit/maniac/fish/calling station/alle blind+memory +0.00 gleich (identisch) +GESAMT +0.78 ± 3.03 nicht unterscheidbar +``` + +**Kein Regress.** Die einzige signifikante Änderung ist heads-up gto BESSER (≈ +$27/100 bei $1/$2); +Nit/Maniac/Fish/Station/blind/memory sind bit-genau identisch — der Fix ist chirurgisch. `cargo test +--lib`: 41 grün. + +## Was bleibt + +Die anderen Defense-Lecks sind unberührt und das nächste Arbeitsfeld: **preflop fold** −21.73 +(investieren und dann zum 3-Bet folden), **turn/flop fold** −12 / −10 (Barrel-Fold), und der +River-Check-Eimer. Der dominante Einzel-Leak (River-Über-Call) ist erledigt. + +## Werkzeug + +`src/bin/diag_gto.rs` — spielt das Leiter-Szenario auf dem Trace-Pfad nach und schlüsselt die +bb/100 nach Straße × terminaler Aktion, Position und (für den River-Call) nach eigener Equity auf. +Reproduziert die Leiterzahl deal-genau. Bleibt als Diagnose-Werkzeug. diff --git a/docs/notizen/BEFUND-liga-l2-l3.md b/docs/notizen/BEFUND-liga-l2-l3.md new file mode 100644 index 00000000..606d135f --- /dev/null +++ b/docs/notizen/BEFUND-liga-l2-l3.md @@ -0,0 +1,84 @@ +# Befund: die Liga steht (L2 + L3) — Robustheit gegen einen ganzen Pool, und der Mittelwert verbirgt den Boden + +Die adaptive Liga ist über L1 hinaus vollständig: **L2** (ein modellierender Gegner mit Posterior) und +**L3** (die Liga-Bewertung gegen einen ganzen Pool). Damit ist die synthetische Mess-Methodik komplett; +nur Stufe 4 (der Live-Abgleich) bleibt per Konstruktion dem Live-Farm vorbehalten. + +## L2 — der modellierende Gegner (`Adapt::Model`) + +L1 reagiert auf die rohe Hero-Aggressionsfrequenz — sofort, auch auf Rauschen. L2 führt einen **Beta- +Posterior** über die Bluffrate des Helden (`Beta(1+aggressiv, 1+passiv)`) und kontert nur nach Maßgabe +der **unteren Ein-Sigma-Konfidenzschranke**: `call_margin -= Gain · max(0, LCB − Referenz)`. Ein breiter +Posterior (dünne Stichprobe oder balancierter Held) zieht die Schranke zum Prior, also **keine +Überreaktion**; erst eine *sicher* hohe Bluffrate lockert die Calling-Schwelle. + +Das ist der Gegner-seitige Spiegel genau des Prinzips, das der Engine selbst fehlt (die Krone: λ aus +Read-Konfidenz, KL-Vertrauensregion). Der Test `l2_model_waits_for_confidence_before_it_counters` +beweist es: bei gleicher 70-%-Frequenz kontert L2 die *dicke* Stichprobe strikt stärker als die *dünne*, +während L1 auf beide gleich reagiert. + +Gegen die Population (`adaptive_gap`, 48 Gegner × 400 Austeilungen) gemessen, neben L1: + +``` + tighten Delta -0.59 ±5.81 (n.s.) + loosen Delta +20.03 ±5.91 (signifikant) + model Delta +14.89 ±5.00 (signifikant) <- L2, milder als der naive Loosen +``` + +L2 liegt erwartungsgemäß zwischen Tighten und Loosen: der konfidenz-gegatete Konter lockert weniger als +der rohe Loosen, also schöpft die Engine +14.89 statt +20.03 ab — die Engine beutet auch den +vorsichtigen Gegner aus, nur weniger stark, weil er ihr weniger Angriffsfläche gibt. + +## L3 — die Liga (`sim::league`, `bin/league`) + +Der Held wird gegen einen **Pool** bewertet: Populationszieher (statisch), die L1-Gegner (tighten/ +loosen), der L2-Gegner und — fest verankert — der **Nemesis** aus Stufe 5. Das schlechteste Mitglied ist +der Boden; ein Change darf den Mittelwert heben, aber nicht gegen eine Schicht einbrechen (die +AlphaStar/Pluribus-Lehre: gegen eine Population von Antworten bewerten, nie gegen einen Einzelgegner, dann +überfittet nichts). + +### Ergebnis (`league`, 12 Zieher + L1/L1/L2 + Nemesis, je 400 Austeilungen) + +``` + exploiter:nemesis -258.22 ±134.09 <- BODEN + L1:reg-loosen -44.08 ±87.61 + pop:reg#3 -17.49 ±83.72 + L1:reg-tighten +8.67 ±64.29 + L2:reg-model +26.29 ±84.79 + ... + pop:fish#2 +119.78 ±67.55 + + Liga-Mittel : +27.55 bb/100 + Liga-Boden : nemesis -258.22 bb/100 +``` + +## Was das zeigt (ehrlich) + +1. **Der Mittelwert verbirgt den Boden.** +27.55 im Mittel, aber −258 gegen den Nemesis. Genau der + Zweck der Liga: ein Change, der die Durchschnitts-EV hebt und dabei den Nemesis-Boden tiefer treibt, + ist **nicht** robust — und nur die Liga (nicht die bb/100-Leiter, nicht der Populationsschnitt) sieht + das. +2. **Der Nemesis als stehendes Mitglied.** Er reproduziert seine Klippe bei frischem Seed/Budget (hier + −258 statt −643, breite CI, aber mit Abstand das schlechteste Mitglied). Damit wird **jeder künftige + Change automatisch gegen das schärfste bekannte Leck geprüft** — kein Regress, der dort unbemerkt bleibt. +3. **Die balancierten Mitglieder clustern tief.** L1-loosen −44, pop:reg −17, L1-tighten +9 — dieselbe + GTO-Überdefense-Wurzel wie im Zwillings-Tor, jetzt auch in der Liga sichtbar. +4. **L2 ist milder als ein naiver Konter.** +26.29: der konfidenz-gegatete Gegner lässt der Engine mehr + als ein überreagierender L1, weil er gegen den (teils balanciert wirkenden) Engine-Helden nicht + überadjustiert — die LCB-Schranke wirkt wie beabsichtigt. + +## Grenzen (ehrlich) + +- 400 Austeilungen je Mitglied, einzeln (keine gepaarte Spiegelung über die Stile), daher breite CIs + (±33…±134). Die *Richtung* (Nemesis-Boden, balancierter Cluster tief, ausbeutbares Feld hoch) ist + robust, die Magnituden verrauscht. Ein Produktionslauf hebt die Deal-Zahl und nutzt die AIVAT- + Varianzreduktion. +- L2 modelliert über einen Postflop-Aggregat-Posterior; eine straßen-konditionierte Variante (flop/turn/ + river getrennt) wäre der nächste Verfeinerungsschritt, braucht aber einen straßen-bewussten Gegner-Seam. + +## Einordnung + +Mit L2 + L3 ist die Liga (L0→L3) vollständig und die synthetische Lab-Methodik geschlossen: Population (0), +Kalibrierung (1), Zwillings-Tor (2), Liga L0–L3 (3), Optimizer (5). Die Liga macht „nie einen Verlierer +ausliefern" endgültig robust: **der Liga-Boden hält**, mit dem Nemesis als fest verankertem Härtetest. +Siehe `ARCHITEKTUR-synthetik-labor.md`. diff --git a/docs/notizen/BEFUND-live-ab-einblick.md b/docs/notizen/BEFUND-live-ab-einblick.md new file mode 100644 index 00000000..96a1d845 --- /dev/null +++ b/docs/notizen/BEFUND-live-ab-einblick.md @@ -0,0 +1,80 @@ +# Befund: Live-A/B-Rückgrat + Insight-Aggregator (Stufe 1/2-Werkzeuge) + +**Datum:** 2026-11-12 +**Anlass:** Owner — „hast du schon das A/B testing vorbereitet? dass wir z.B. 12 Tische micro stakes +laufen lassen und extrem viele insights rausziehen können". Antwort: das Mess-Rückgrat (bb/100 + +95-%-CI, Nicht-Überlappung, Stufe-0-Bericht) stand; die A/B-Arm-Verdrahtung und die Insight- +Extraktion fehlten. Beide hier gebaut, pure-Python, auf Archiv bewiesen, **0 Regressionen**. + +## Architektur-Befund (entscheidet die Form des A/B) + +Die Engine wird **in einem Prozess** gerufen: `betrieb/runner.py` → `hand/entscheidung.hole` → +`entscheiden/decide.entscheide` shellt zum `rechner`-Binary (`COINPOKER_KERN`, `decide.py:22`). Ein +Läufer bedient **alle** Tische in **einem** Prozess; die Engine-Toggles (`MEM_PRIOR`, `SIZE_MIX`) +liest der Kern aus der Prozess-Umgebung und friert sie per `OnceLock` **einmalig** ein. + +Folge: **zwei Arme können nicht gleichzeitig laufen** (ein Binary, eine eingefrorene Config). Das ist +kein Verlust — der statistisch **korrekte** Live-A/B ist ohnehin der **zeitliche**: alle Tische einen +Block auf Arm A, dann einen Block auf Arm B, abwechselnd. Gleiche Population über die Zeit, kein +Tisch-/Sitz-Confound. Gleichzeitig-pro-Tisch wäre schlechter (Tischwahl verzerrt). „12 Tische + viele +Insights" bleibt voll erhalten — nur eben zeitlich gearmt. + +## Gebaut + +### 1. A/B-Arm-Rückgrat (die Marke je Hand) +- `betrieb/runner.py`: `AB_ARM = os.environ.get("COINPOKER_ARM")` (leer = inert). In `ergebnisse` + trägt jede Hand `h["arm"]`; in der Zug-Protokollierung trägt jeder Zug `z["arm"]`. Persistiert + automatisch (`statistik.eintragen` schreibt das ganze Dict; `zuege.jsonl` ebenso). +- `betrieb/statistik.py`: `je_arm(haende)` — deskriptive bb/100-Tabelle je Arm (mit 95-%-Spanne), + in `kennzahlen_aus` und in `md_aus` (A/B-Abschnitt nur wenn ein Arm da ist). +- **Das Verdikt** liefert das schon spec-geprüfte `lesen/liveabgleich.ab_aus_log(haende, feld="arm")` + — der **Welch-Zwei-Stichproben-Test** auf bb/100 (ungepaart, korrekt). CLI: + `python3 lesen/liveabgleich.py --ab-log arm`. +- Spec: `tests/ab_arm_spec.py` (8 grün), inkl. End-zu-End Arm→Welch. **Ändert die Engine-Spielweise + nicht** (reines Tagging/Reporting) — kann kein „Verlierer" sein, kein Leiter-Lauf nötig. +- Trockenlauf: 362 echte Archiv-Hände künstlich A/B gesplittet → Welch „kein signifikanter + Unterschied" (korrekt: Zufallssplit gleicher Population, 362 Hände ±200 bb/100). Beweist Pipeline + **und** Varianzrealität. + +### 2. Insight-Aggregator `lesen/einblick.py` (der statistische Leak-Finder) +Aus den schon geloggten Zügen (`zuege.jsonl`: je Zug Lochkarten, Board, Aktion, Handklasse, Equity, +Engine-Grund — `lesen/handreview`). Anders als `betrieb/review.py` (Filter-Sucher) **aggregiert** es: +- `aktionen_je_street` — je Street Aktionsverteilung, Aggressiv-Anteil (BET+RAISE), Fold-Anteil. +- `vorflop_je_position` — Position aus dem Grund geparst ("MP open"→MP), je Position Aggressiv/Fold. +- `klassen_postflop` — je Handklasse (HighCard/Pair/TwoPair/…) die Aktionsverteilung (z. B. Anteil + gecheckter Drillinge). +- `grund_tags` — die Begründungs-Taxonomie des Kerns gefaltet (welche Regel wie oft feuert). +- `bericht(zuege, arm=…)` — mit `arm` nur die Züge **eines A/B-Arms** → Insights je Arm vergleichbar. +- CLI: `python3 lesen/einblick.py [zuege.jsonl] [--arm A] [--tags 20]`. Spec: `tests/einblick_spec.py` + (12 grün). + +Trockenlauf auf 265 echten Zügen hob sofort Auffälligkeiten (im dünnen, alten Cash-Sample — +**kein** Strategie-Urteil): FLOP 0 % vs TURN 60 % aggressiv; RIVER 0 % aggressiv / 47 % Fold; +MP 133 Spots 100 % Fold. Das Werkzeug zieht die Leaks sauber heraus; ob sie echt sind, sagt erst ein +sauberer Micro-Lauf mit Volumen. + +## Runbook — zeitlicher Live-A/B auf Micro + +```bash +# Arm A (z. B. Prior an): einen Block fahren +COINPOKER_ARM=A MEM_PRIOR=1 python3 betrieb/runner.py --act +# Arm B (Baseline): einen Block fahren +COINPOKER_ARM=B MEM_PRIOR=0 python3 betrieb/runner.py --act + +# Verdikt (Welch) + Insights je Arm +python3 lesen/liveabgleich.py --ab-log archiv/lauf/haende.jsonl arm +python3 lesen/einblick.py archiv/lauf/zuege.jsonl --arm A +python3 lesen/einblick.py archiv/lauf/zuege.jsonl --arm B +``` + +## Varianz (die ehrliche Grenze, gilt weiter) +Live keine Kartenpaarung → σ≈90 bb/100; A/B löst nur Δ≳20 bb/100 (Δ=5 bräuchte ~250k/Arm). Die +feinen Synthetik-Deltas sind live **nicht** auflösbar — Live-A/B nur für **grobe strukturelle** Hebel +und Sim-to-Real. Der nächste Hebel, der die A/B-Zahlen schneller signifikant macht: **All-in-EV je +Hand** (~−60 % Varianz). Die Infra ist halb da (`ev_chop`/`rit` je Hand, `equity`-Slot je Zug, +`lesen/evchop.py`), braucht aber Gegner-Showdown-Karten + All-in-Board je Hand zum Equity-Rückrechnen. + +## Offen +- **All-in-EV** je Hand (Varianzreduktion) — nächster Baustein. +- `MEM_PRIOR` (Prior-Verdrahtung in `sim/memory.rs`, uncommitted): Leiter-Verdikt noch ausstehend. +- Alles hier **uncommitted** (Owner entscheidet Commit). diff --git a/docs/notizen/BEFUND-liveabgleich-stufe4-live.md b/docs/notizen/BEFUND-liveabgleich-stufe4-live.md new file mode 100644 index 00000000..d52ec5d8 --- /dev/null +++ b/docs/notizen/BEFUND-liveabgleich-stufe4-live.md @@ -0,0 +1,91 @@ +# Befund: Stufe 4, live-Hälfte — der Abgleich steht, und er feuert sofort: die Sim-Kante kommt am Tisch nicht an + +Die live-Hälfte von Stufe 4 ist gebaut und gefahren: der **Sim-to-Real-OUTCOME-Abgleich** +(`lesen/liveabgleich.py`, Spezifikation `tests/liveabgleich_spec.py`). Er ist der Test, den die +Architektur „den einen unverzichtbaren Live-Test" nennt — und anders als die HUD-Hälfte (die den +Gegner-Fingerabdruck prüft) prüft er das Einzige, das zählt: **ob die vorhergesagte Kante echtes Geld wird.** + +## Aufbau + +Das Labor behauptet eine Kante: das Zwillings-Tor misst Offense **+43.95 bb/100** (die Engine beutet die +gezogene Population aus, Memory-Read). Der Abgleich liest, was der Live-Lauf tatsächlich verdient hat +(`archiv/lauf/haende.jsonl` — je eigener Hand `netto` in Chips, `bb` als Blindgröße, also `netto/bb` +stakes-normiert und addierbar), rechnet bb/100 mit 95-%-Winrate-Intervall und hält die Sim-Vorhersage +dagegen. Reine Funktionen wie die übrigen `lesen/`-Module; 13 Spezifikations-Tests grün. + +## Ergebnis (`liveabgleich`, 190 echte Hände, 2026-10-29 bis 11-05) + +``` +REAL — was der Live-Lauf verdient hat: + gesamt n=190 bb/100 -266.75 95%: -560.44 bis +26.94 + +SIM — Vorhersage des Labors (Offense gegen die gezogene Population): +43.95 bb/100 + +GAP (real - sim): -310.70 bb/100 +Urteil: KLAFFT — die Sim-Kante liegt ÜBER dem realen 95-%-Intervall. +``` + +## Was das zeigt (ehrlich) + +1. **Der Test feuert — genau dafür ist er da.** Die obere Grenze des realen Intervalls (+26.94) liegt + **unter** der Sim-Vorhersage (+43.95). Das heißt: selbst bei der dicken Streuung von nur 190 Händen + überlebt die behauptete +44-Kante nicht bis zum Tisch; der reale Lauf verliert −267 bb/100. Das ist das + wichtigste einzelne Ergebnis des ganzen Labors: die Leiter sagte jahrelang „alles super" (Oracle-Read), + der Live-Abgleich sagt „die Kante kommt nicht an". Der Labor-Zweck — Selbsttäuschung aufdecken — ist erfüllt. + +2. **Der Gap ist eine obere Schranke auf „Strategie", nicht reiner Strategiefehler.** Der Live-Lauf lief + NICHT unter Laborbedingungen. In den −267 stecken, untrennbar ohne den An/Aus-Split: + - **Andere Population.** Die echten Gegner sind nicht das synthetische Feld. Die Engine kann das + synthetische Feld schlagen und am echten trotzdem verlieren. + - **Betrieb.** Verstrichene Züge, AFK/Sitout (79 Auszeiten im Log), Client-Neustarts, AoF-Push/Fold, + Tischregeln, Rake — operative Verluste, keine EV der Entscheidung. Die Stake-Aufschlüsselung in + `archiv/lauf/STATS.md` zeigt das Muster: +372 bb/100 bei 50/100, aber −736 bei 1000/2000 und −402 bei + 250/500. Die großen Minusse sitzen bei den hohen Stakes und wenigen Händen — nach Varianz und + Betrieb riechend, nicht nach einem flachen Strategie-Leck. + - **Varianz.** 190 Hände, Intervall fast 600 bb/100 breit. Das **Vorzeichen** des Gaps (Sim positiv, + real negativ, Sim über dem Intervall) ist belastbar; die **Magnitude** −311 ist grob. + +3. **Die Richtung deckt sich mit den schon gefundenen Lecks.** Dass die Sim-Kante nicht ankommt, ist kein + Widerspruch zum Rest des Labors — es ist dieselbe Geschichte von der Geldseite: das Zwillings-Tor zeigt + den balancierten GTO-Boden (−36), der Nemesis die −415-Klippe (Barrel in die Station). Eine Engine, die + gegen Balancierte und gegen einen klebrigen Caller blutet, verdient an einem echten Feld voller solcher + Gegner ihr +44 nicht. Der Live-Abgleich ist die Außenmessung derselben Wurzel. + +## Der A/B-Test ist fertig gerechnet — er wartet auf Hände, nicht auf Code + +Den Gap in seine Teile zu zerlegen — wie viel Population, wie viel Betrieb, wie viel echte Strategie — +kann nur der **kontrollierte COINPOKER_KERN-An/Aus-Split**: derselbe Farm, dieselben Stakes, abwechselnd +mit und ohne Engine-Kern, und man zählt NUR die bb/100-Differenz der beiden Arme. Das paart die Confounds +weg. + +Die **Rechnung dafür steht fertig und spezifiziert**: `liveabgleich.ab_vergleich(an, aus)` (CLI +`python3 lesen/liveabgleich.py --ab kern-an.jsonl kern-aus.jsonl`) nimmt die zwei Arm-Logs und liefert +die signifikanz-geprüfte bb/100-Differenz (Zwei-Stichproben-Welch-Intervall, Urteil schlägt/verliert/ +unentschieden). An synthetischen Armen verifiziert (18 Tests grün); Demo: + +``` + Kern AN n=5 bb/100 +42.00 95%: -18.85..+102.85 + Kern AUS n=5 bb/100 -126.00 95%: -180.95..-71.05 + Differenz (an - aus): +168.00 bb/100 -> schlägt die Baseline signifikant (95% +86..+250) +``` + +Was fehlt, ist **allein das Laufen des Live-Farms unter beiden Armen** — eine reale, geldechte +Spiel-Session über Zeit, gegen echte Menschen auf CoinPoker. Das entsteht am Tisch, nicht in der +Werkbank: kein Code-Bauteil, sondern ein operativer Schritt, den nur der Betrieb (mit echtem Geld und +echten Gegnern über Stunden) ausführt. + +**Und es braucht dafür keinen neuen Code — die Pipeline steht heute.** Der Schalter ist die Umgebung: +`COINPOKER_KERN` wählt das Engine-Binary (`entscheiden/decide.py:22`), `STATS_DIR` den Ausgabeordner +(`betrieb/statistik.py:258`). Zwei Läufe — Kern-Binary vs Baseline-Binary, je eigener `STATS_DIR` — +erzeugen zwei getrennte `haende.jsonl`, und `--ab arm_an/haende.jsonl arm_aus/haende.jsonl` druckt das +Urteil. Für ein EIN-Log mit Arm-Label gibt es `--ab-log` (Feld `kern`). Die genaue Befehlsfolge steht in +`RUNBOOK-liveabgleich-ab.md`. Das Werkzeug wartet auf die Daten, nicht die Daten auf das Werkzeug. + +## Einordnung + +Stufe 4 ist damit beidseitig gebaut und gefahren: die HUD-Hälfte (`BEFUND-simreal-stufe4`, der +Fingerabdruck-Gap, modest) und die Outcome-Hälfte (hier, der Geld-Gap, −311 und signifikant über dem +Intervall). Was offen bleibt, ist kein Modul, sondern ein kontrolliertes Live-Experiment, das nur Zeit und +Hände braucht. Der Abgleich ist jetzt der scharfe Außenspiegel des Labors — und sein erster Blick sagt +unmissverständlich: die Innen-EV ist noch nicht die Außen-EV. Genau diese Zahl zu schließen ist die Arbeit, +die die Mathematik-Roadmap meint. Siehe `ARCHITEKTUR-synthetik-labor.md`, Stufe 4. diff --git a/docs/notizen/BEFUND-mem-prior-revert.md b/docs/notizen/BEFUND-mem-prior-revert.md new file mode 100644 index 00000000..7c2c0d7a --- /dev/null +++ b/docs/notizen/BEFUND-mem-prior-revert.md @@ -0,0 +1,67 @@ +# Befund: Populations-Prior in sim::memory — gemessener Verlierer, revertet + +**Datum:** 2026-11-12 +**Anlass:** Owner — „pokerintel muss genutzt werden und vor allem unser gedächtnis, wir müssen den +gegner extrem schnell kennen lernen". Idee: den schon gebauten, getesteten, aber unverdrahteten +Bayes-Populations-Prior (`exploit::posterior`, Beta-Bernoulli, PRIOR_STAERKE=10) in +`sim::memory::SessionMemory` einhängen, damit die Engine **ab Hand 1** liest statt 25 Hände blind +(`WARMUP_HANDS=25`). Verdrahtung hinter `MEM_PRIOR`-Schalter (Default an), `read_prior` neben +`read_raw`. Lib kompilierte, 10 sim::memory-Tests grün. + +## Messung (gepaart, arch_read/nemesis_read, D=4000, SEED fix) + +Sanity hält: der **Blind**-Arm ist zwischen `MEM_PRIOR=0` und `=1` bit-identisch (ARCH ++74.07/−13.67/+43.05/+83.03; Nemesis Oracle=Blind unverändert). Der Prior fasst nur den Memory-Arm an. + +**ARCH — gap = Memory − Blind (alt → Prior):** + +| Stil | gap alt | gap Prior | Δ | oracle-classify | +|--------|---------|-----------|----------|-----------------| +| fish | +58.51 | +59.85 | +1.34 | CallingStation | +| reg | +20.66 | +26.27 | **+5.61**| Regular | +| nit | +7.31 | +5.49 | −1.82 | Nit | +| maniac | −13.32 | **−45.46**| **−32.14** | LooseAggressive | + +**NEMESIS — Memory-Arm bb/100 (alt → Prior), Blind zum Vergleich:** + +| Nemesis | Blind | Memory alt | Memory Prior | Δ | +|-----------|---------|------------|--------------|----------| +| nemesis-1 | +80.04 | +77.16 | +67.73 | −9.43 | +| nemesis-2 | +114.16 | +79.25 | **+129.59** | **+50.34** | +| nemesis-3 | −26.41 | +0.29 | −1.46 | −1.75 | + +## Urteil: REVERT + +Kein sauberer Sieg. Große Gewinne (reg +5.61, nemesis-2 +50.34) stehen großen Verlusten gegenüber +(**maniac −32.14**, nemesis-1 −9.43). Der Maniac-Einbruch allein ist disqualifizierend nach dem +eisernen Gesetz „nie einen Verlierer ausliefern". `src/sim/memory.rs` auf HEAD revertet; die +Verdrahtung ist als Patch gesichert (`scratchpad/memory-prior-wip.patch`, 34 KB) für den verfeinerten +zweiten Anlauf. + +## Wurzel (warum hilft er manchen, zerstört er andere?) + +Der **uniforme** Populations-Prior zieht JEDE Lesung zur Median-Mitte (vpip 0.30, pfr 0.18, +fold_to_bet 0.45, **aggr 0.35**). Das ist gut für Gegner, deren wahres Bild nahe der Mitte liegt oder +die der rohe 25-Hand-Warmup früh fehlliest (nemesis-2: roh +79.25 unter Blind +114.16 = −35 +Lese-Leck; der Prior kalibriert schneller → +129.59). Es ist **tödlich für aggressive Extreme**: beim +Maniac/LooseAggressive und nemesis-1 (aggr 0.62) schrumpft der Prior die Aggressions-Lesung Richtung +0.35 — die Engine liest „durchschnittlich", wo in Wahrheit extreme Aggression steht, und unter- +adjustiert in die Ausbeutung hinein. Die Aggressions-Achse ist genau die, wo ein Median-Prior am +meisten schadet, weil die exploitbaren Extreme dort am weitesten von der Mitte weg liegen. + +Zusatz: der rohe Memory-Arm schadet dem Maniac schon ohne Prior (gap −13.32) — ein vorbestehendes +Loch (Memory-Lesung mis-exploitet den Maniac). Der Prior verstärkt es nur. + +## Verfeinerter zweiter Anlauf (Wurzel angreifen, nicht Symptom) + +1. **Prior nur auf die langsam konvergierenden passiven Achsen** (vpip/fold_to_bet), **nicht** auf + aggression — die Aggression roh/unverschoben lassen, damit Extreme sichtbar bleiben. +2. **Varianz des Priors auf der Aggressions-Achse weiten** (kleinere PRIOR_STAERKE nur dort), sodass + wenige aggressive Beobachtungen die Lesung schnell aus der Mitte ziehen. +3. **Stil-/Konfidenz-gated**: den Prior nur einsetzen, solange die rohe Beobachtung dünn ist UND die + frühe Lesung nicht schon ein Extrem andeutet (vgl. [[nemesis-station-mislabel]], confidence-ramp). +4. Erst dann wieder auf der Leiter messen — der Maniac-Arm ist der Gatekeeper. + +## Offen +- Das vorbestehende Maniac-Loch im rohen Memory-Arm (gap −13.32) ist unabhängig vom Prior und bleibt. +- Live-A/B-Rückgrat + Insight-Aggregator stehen separat (`BEFUND-live-ab-einblick.md`), unberührt. diff --git a/docs/notizen/BEFUND-nemesis-soft-trust.md b/docs/notizen/BEFUND-nemesis-soft-trust.md new file mode 100644 index 00000000..7406dd40 --- /dev/null +++ b/docs/notizen/BEFUND-nemesis-soft-trust.md @@ -0,0 +1,171 @@ +# Befund: Konfidenz-gewichtetes Stations-Trust — der Rest-Nemesis an der Klassengrenze + +Nachsuche zu [[BEFUND-nemesis-station-fehllabel]]: der 0.45-Tor-Fix kippte den groben Fehllabel +(−409.86 → +80.73 bb/100), aber die CMA-ES gegen die reparierte Engine fand **Nemesis-2** — denselben +lesegetriebenen Leck-Typ, nur mit einer Aggression **knapp unter** dem Tor: + +``` + Nemesis-2 call_margin 0.173 raise_at 0.579 bet_at 0.748 open_at 0.800 bluff 0.229 size 0.996 + Blind +114.01 bb/100 + Memory -87.63 bb/100 konvergierter Read: vpip 0.65 pfr 0.15 fold2bet 0.56 aggr 0.41 -> CallingStation +``` + +Aggr 0.41 < 0.45 → er rutscht zurück in die **voll getrustete** Station und kassiert denselben Exploit. + +## Warum kein tieferes Tor + +Das Tor von 0.45 auf 0.40 zu senken, um aggr 0.41 zu fangen, quetscht den Reg-Archetyp (gemessene +Aggression 0.31 — nur 0.09 Luft, Memory-Rauschen überlappt), und die CMA-ES findet dann ein Nemesis-3 +bei aggr ~0.33. Das ist Whack-a-Mole. Die Wurzel ist **nicht** die Lage des Tors, sondern seine +**Binärheit**: `earned_trust` gibt 1.0 für CallingStation und 0.0 sonst — ein Gegner direkt an der +Grenze bekommt den vollen Station-Exploit oder gar keinen. `read_gate` nennt das selbst als nächsten +Schritt: „The value is an f64, not a bool, to leave room for a partial, confidence-weighted trust later +without changing this seam." + +## Der Fix: Trust als Konfidenz, nicht als Schalter + +`exploit::style::station_trust(profile) -> f64` — eine Rampe statt eines Sprungs: + +```rust +const STATION_MAX_AGGRESSION: f64 = 0.45; // oberhalb: keine Station (unverändert) +const STATION_FULL_TRUST_AGGRESSION: f64 = 0.20; // unterhalb: echte Station, volles Trust + +pub fn station_trust(profile: &Profile) -> f64 { + if frequency(profile.fold_to_bet).is_some_and(|b| b <= STATION_FOLD_TO_BET) { + return 1.0; // ein echter Nicht-Folder: Nicht-Folden ist das Signal + } + match frequency(profile.aggression) { + None => 1.0, // kein Postflop-Sample: altes Verhalten, nichts regressiert + Some(a) => ((STATION_MAX_AGGRESSION - a) + / (STATION_MAX_AGGRESSION - STATION_FULL_TRUST_AGGRESSION)).clamp(0.0, 1.0), + } +} +``` + +Eine echte passive Station (aggr ≤ 0.20, oder ein Nicht-Folder) bekommt `c = 1.0` und ist +**bit-identisch** zum alten binären Trust. Ein Grenzfall-Gegner bekommt eine Teil-Konfidenz: Nemesis-2 +(aggr 0.41) nur `c = (0.45−0.41)/(0.45−0.20) = 0.16`. + +### Jeder Kanal, der das Stations-Profil liest, wird mit `c` zur Blind-Grundlinie gezogen + +`toward_blind(blind, x, c) = blind + c·(x − blind)` — voller Read bei `c=1`, reine Blind-Decke bei +`c=0`. Die Messung (nicht die Theorie) zeigte **vier** Kanäle, die das getrustete Profil lesen; jeder +einzeln skaliert, jeder bit-identisch bei `c=1`: + +1. **`adjust.rs`** — die Stations-Schwellen-Shifts (`call_margin`, `value_raise`, `range_width`) skalieren + mit `c`: `base + shift·c`. +2. **`style_rung.rs`** — die Made-Hand-Boden-Sprosse: `-(round(c) as i32)` statt fix `-1`. +3. **`range_model.rs`** — der Preflop-Band-Stretch und das `unknown_role_band`-vpip werden per + `toward_blind` zur Blind-Breite gezogen (eine breite vpip-Lesung widert die modellierte Range nur so + weit, wie der Read getrustet ist). +4. **`fold_chance.rs`** — `fold_base` wird zur `DEFAULT_FOLD_TO_BET` (0.45) gezogen: ein fehlgelesenes + aggressives „Station"-fold_to_bet 0.56 trustet hero nur partiell, also **über-barrelt er nicht** in + eine leicht-raisende Range, deren Mehr-Straßen-Kosten die Einzel-Straßen-Bluff-EV nie modelliert. + +## Beweis: die Wiederherstellung + +`bin/nemesis_read` (Memory, 4000 Austeilungen), progressiv je Kanal-Gruppe: + +``` + binäres Trust (nur 0.45-Tor) -87.63 bb/100 + + soft-trust auf adjust / rung / range -54.34 bb/100 + + soft-trust auf fold_chance (Fold-Equity) +83.72 bb/100 (Blind-Decke +114.01) +``` + +Der dominante Kanal war die **Fold-Equity**: hero barrelte Flop/Turn in die vermeintlich foldende +Station und landete auf schlechten Rivern. Von −87.63 auf **+83.72** — hero schlägt den CMA-ES- +Extrempunkt jetzt deutlich auch unter dem realistischen Memory-Read. + +**Der Boden ist unberührt** (`bin/arch_read`, 4000 Austeilungen, gap = Memory − Blind): + +``` + style blind memory gap + fish +74.58 +129.38 +54.81 (echte Station, aggr 0.11 -> c=1.0, bit-identisch) + reg -13.40 +4.00 +17.40 + nit +43.05 +47.75 +4.70 + maniac +82.57 +82.57 +0.00 (bit-identisch) +``` + +Kein Archetyp regressiert — jeder gap ≥ 0. Fish (die echte Station) behält volles Trust und ist +bit-identisch; Maniac ist unberührt. + +## Der Rest: Mehr-Straßen-Kosten, nicht noch ein Schwellen-Tweak + +Die verbleibende Lücke zur Blind-Decke (−30 bb/100) ist im `diag_nemesis which=2` lokalisiert: + +``` + bucket mem blind DELTA mem# blind# + river fold -74.96 -9.61 -65.34 578 336 + turn call -33.45 +6.82 -40.27 210 156 + ... + river call +11.92 -23.00 +34.92 75 362 +``` + +Der Rest ist **River-Fold-Übersteuerung**: hero erreicht den River deutlich öfter (578 vs 336) und +foldet — er floatet/barrelt die Vorstraßen noch etwas zu leicht und zahlt es auf dem River. Das ist +**keine** Trust-Kalibrierung mehr, sondern die bekannte Struktur-Grenze: die Einzel-Straßen-Bluff-EV +bucht fold × pot als Gewinn, ignoriert aber die Mehr-Straßen-Kosten der weiterspielenden (leicht- +raisenden, value-lastigen) Range. Das gehört in den opponent-aware, trust-gegateten River-Subgame- +Solver ([[engine-math-vision]] Stage A→live), nicht in einen weiteren Margin-Tweak. Nemesis-2 ist mit ++83.72 bb/100 kein Katastrophen-Leck mehr — gegen den Extrempunkt des Regelraums, nicht einen typischen +Gegner. + +## Zwillings-Tor (Vollbudget, SEED 0x5EED_0001) — `Gate::passes` = true + +``` + Achse Baseline (efcff2b) soft-trust Tor-Regel + OFFENSE (pop-EV) +44.86 +50.58 haelt (+5.72) OK + BODEN (gto) -23.93 -23.93 bit-identisch OK + gto-small -21.58 -21.58 identisch + nit/maniac/fish +42.92/+45.58/+126.85 identisch unberuehrt + reg -17.66 -10.21 verbessert (nicht Boden) + EXPLOITABILITY 77.03 77.03 bit-identisch OK +``` + +Genau die vorhergesagte Signatur: jeder LooseAggressive/Nit/Maniac/Fish-Boden-Archetyp ist +bit-identisch (keiner klassifiziert als Grenzfall-Station), nur **reg** (der einzige Boden-Archetyp, +dessen Memory-Read an der Grenze als Station liest) und die **Offense** bewegen sich — beide nach oben. +Die Exploitability-Batterie läuft mit `villain_profile: None`, `classify` sieht nie ein echtes Profil → +bit-identisch, wie bei Leck 1. `Gate::passes`: Population hält (+5.72), Boden hält, Exploitability +steigt nicht. + +## CMA-ES-Nachsuche: das lesegetriebene Loch ist zu — der Rest ist read-invariant + +Die CMA-ES (`bin/nemesis`, Fast-Scan 1000×14) gegen die soft-trust-Engine findet ein **Nemesis-3**: + +``` + call_margin 0.396 raise_at 0.769 bet_at 0.615 open_at 0.468 bluff 0.261 size 1.148 + Fast-Scan-EV −52.65 bb/100 (selektions-verzerrt nach unten, wie bei Nemesis-2: Scan fand −173, sauber −87) +``` + +Sauber nachgemessen (`bin/nemesis_read`, 4000) ist es ein **grundlegend anderer Befund**: + +``` + nemesis-3 Oracle −26.59 = Blind −26.59 = Memory −26.59 bb/100 (alle drei identisch) + konvergierter Read: vpip 0.31 pfr 0.30 fold2bet 0.79 aggr 0.47 -> classify Regular +``` + +**Blind ≈ Memory (exakt gleich) = ein echtes Loch, read-invariant** — das Gegenteil der lesegetriebenen +Familie (−414/−87), die dieser Fix schloss. Drei Dinge entscheiden es: + +1. Nemesis-3 klassifiziert **Regular** → er wird ohnehin auf blind gegatet → die soft-trust-Änderung + (die nur CallingStation-Profile berührt) kann ihn **nicht** anfassen. Seine −26.59 sind bit-identisch + auf der pre-soft-trust- UND der pre-classify-Engine. Die CMA-ES brachte ihn nur ans Licht, weil die + lesegetriebenen Katastrophen jetzt zu sind — der Worst-Case wandert auf diesen vorbestehenden Punkt. +2. Die saubere EV ist **−26.59**, nicht −52.65 (Fast-Scan-Verzerrung, wie vorhergesagt). +3. Der Leck-Bucket (identisch in Blind und Memory): **river call −50.74** (117 Hände) gegen einen + tight-aggressiven Overbetter (vpip 0.31 ≈ pfr 0.30, size 1.148×Pot, blufft 0.261). Das ist eine + **Basis-Defense-Schwäche gegen River-Overbets**, keine Trust-Kalibrierung. + +Das Loch-Schrumpfen (−414 → −87 → read-invariante −26.59) ist damit so weit, wie Trust-Kalibrierung es +bringen kann: der Rest ist die exakt vorhergesagte Struktur-Grenze — River-Defense gegen Overbets, +Domäne des opponent-aware River-Subgame-Solvers ([[engine-math-vision]] Stage A→live), **nicht** ein +weiterer Schwellen- oder Trust-Tweak. Das Zwillings-Tor schützt das Geshippte; nemesis-3 ist kein von +diesem Fix erzeugtes oder berührtes Leck. + +## Werkzeug + +- `src/exploit/style.rs::station_trust` — die Trust-Rampe + 4 Regressionstests. +- `src/bin/nemesis_read.rs` — EV je Lese-Modus; zeigt die Wiederherstellung zur Blind-Decke. +- `src/bin/arch_read.rs` — Boden-Archetypen Blind vs Memory; zeigt die Nicht-Regression. +- `src/bin/diag_nemesis.rs which=2` — Memory-vs-Blind-Bucket-Delta; lokalisiert den Rest-Kanal. diff --git a/docs/notizen/BEFUND-nemesis-station-fehllabel.md b/docs/notizen/BEFUND-nemesis-station-fehllabel.md new file mode 100644 index 00000000..2d7321c6 --- /dev/null +++ b/docs/notizen/BEFUND-nemesis-station-fehllabel.md @@ -0,0 +1,183 @@ +# Befund: der Nemesis — ein aggressiver Vielfalter, als Calling Station fehlklassifiziert + +Das zweite Leck des synthetischen Labors: der CMA-ES-Nemesis (`sim::optimize::worst_case_opponent`, +`bin/nemesis`) fand den Gegner, gegen den die Engine am schlechtesten spielt — **−414 bb/100** +(Vollbudget-Lauf; mein Reproduktions-Read misst **−409.86 bb/100**). Der Brief nannte ihn einen +„klebrigen Low-Bluff-Caller, in den die Engine barrelt". Die Messung zeigt das Gegenteil: es ist kein +Over-Barrel und keine klebrige Station, sondern dieselbe Wurzel-Familie wie Leck 1 — **Preflop-Breite +übersteuert einen Read**, hier die gesamte Calling-Station-Klassifikation. + +## Das Nemesis-Regelwerk (festes `Rules`) + +``` +call_margin 0.215 raise_at 0.587 bet_at 0.548 open_at 0.729 bluff 0.068 size 0.441 +``` + +`call_margin` ist die Equity ÜBER den Pot-Odds, die der Gegner zum Callen verlangt (`reader.rs:47`) — +0.215 ≈ Reg (0.22), also **foldet Luft wie ein Reg**, keine Station (Fish 0.02). Zugleich **bettet er +viel** (bet_at 0.548, nahe Maniac 0.55) und **raist leicht** (raise_at 0.587 → raist ~41 % zurück, wenn +man bettet), **blufft aber fast nie** (0.068 ≈ Reg). Ein aggressiver, value-lastiger Vielfalter. + +## Die entscheidende Messung: der Read ist das Gift, nicht die Hand + +`bin/nemesis_read` misst die Engine-EV gegen dieses feste Regelwerk je Lese-Modus (4000 Austeilungen): + +``` + Oracle +81.41 bb/100 (Styled -> kein Oracle-Profil = blind) + Blind +81.41 bb/100 (kein Profil) + Memory -409.86 bb/100 (der Session-Read steht -> Katastrophe) +``` + +**Blind schlägt der Motor den Nemesis um +81.** Erst der aufgebaute Memory-Read kippt ihn auf −410 — +eine Spanne von **491 bb/100**, komplett lesegetrieben. (Coolers sind read-invariant; das hier ist es +nicht.) + +## Die Wurzel: `classify` liest „Station" aus Preflop-Breite, gegen jeden Postflop-Befund + +Der konvergierte Memory-Read des Nemesis (`bin/diag_nemesis`, 2000 Austeilungen): + +``` + vpip 0.53 pfr 0.14 fold2bet 0.65 aggr 0.62 -> classify CallingStation +``` + +`classify` stuft als CallingStation ein über den `loose`-Pfad (`vpip ≥ 0.35`), sobald der Gegner nicht +`LooseAggressive` ist (`pfr < 0.20`) — **egal, was fold_to_bet und aggression sagen**. Der Nemesis ist +breit preflop (vpip 0.53), aber er **foldet 65 %** und ist **hyper-aggressiv (0.62)** — das genaue +Gegenteil einer Station (passiv, foldet nie). Er erreicht „CallingStation" allein über die Breite. + +Damit bekommt er **`earned_trust == 1.0`** (`read_gate`) — das Profil wird NICHT auf blind gegatet, +sondern voll ausgebeutet. Zwei Exploits feuern gegen den falschen Gegner: + +1. **Station-Shift** (`style_shift`, CallingStation: `value_raise −0.04`, „value-bet thinner"): die + Engine value-bettet DÜNNER — in einen Gegner, der leicht zurückraist. Resultat: dünne Value-Bets + werden geraist, die Engine foldet investierte Chips (Terminal-Buckets `turn fold −152`, + `flop fold −153` im Baseline-`diag_nemesis`). +2. **Aggression-getriebener Bluff-Anteil** (`bluff_share::style_factor`): bei vorhandener aggression + gilt `aggression / 0.45`, hier `0.62 / 0.45 = 1.38×` — die Engine modelliert die value-lastige + Betting-Range des Nemesis als **über-durchschnittlich bluffig** und bluff-catcht sie ab. Der Nemesis + blufft 0.068 → die Calls verlieren (`turn call −163`, `river call −40`). + +Beides ist dieselbe Verwechslung wie Leck 1: **Breite ≠ Bluff-Frequenz, und Breite ≠ Station.** Wer +breit spielt, ist nicht automatisch passiv. Nur die Postflop-Aggression trennt eine echte Station +(passiv) von einem aggressiven Vielfalter. + +## Der Fix: eine Station ist loose UND passiv + +`exploit::style::classify` — der `loose → CallingStation`-Pfad bekommt ein Aggressions-Tor: + +```rust +const STATION_MAX_AGGRESSION: f64 = 0.45; // zwischen Reg (gemessen 0.31) und Maniac (~0.49) +let passive = aggr.is_none_or(|a| a < STATION_MAX_AGGRESSION); +... +} else if (loose && passive) || sticky { + Style::CallingStation +``` + +Der Nemesis (aggr 0.62) fällt aus dem `loose`-Pfad, ist nicht `sticky` (fold 0.65 > 0.30), nicht +`tight`, nicht `LooseAggressive` (pfr 0.14) → **Regular**. Regular hat `earned_trust 0` → `read_gate` +gatet ihn auf **blind**, die bewiesen sichere Grundlinie. Beide Fehl-Exploits schalten sich ab: das +Profil wird `None`, der Station-Shift entfällt, und `bluff_share` sieht `None` statt aggression 0.62. + +`STATION_MAX_AGGRESSION = 0.45` liegt bewusst **über** der gemessenen Reg-Aggression (0.31) und der +echten Stations (Fish 0.11, Loose-Passiv-Test 0.0), aber **unter** dem Nemesis (0.62): die echten +Stationen bleiben Stationen, nur der aggressive Vielfalter kippt. Der `sticky`-Pfad (fold ≤ 0.30, ein +echter Nicht-Folder) bleibt aggressions-unabhängig eine Station — Nicht-Folden ist selbst das Signal. + +Unbekannte aggression (`None`, noch kein Postflop-Sample) behält das alte breite Stations-Verhalten +(`is_none_or`), nichts regressiert für Profile ohne Postflop-Stichprobe. + +## Beweis + +**Leck geschlossen** (`bin/nemesis_read`, Memory, 4000 Austeilungen): + +``` + vorher nachher + Memory -409.86 -> +80.73 bb/100 (+490.59, = Blind-Decke +81.41) + classify CallingStation -> Regular +``` + +Die EV springt auf praktisch die Blind-Decke zurück (+80.73 vs. +81.41 blind, Rest −0.68 = Rausch: +der ungegatete MDF-Boden sieht per `raw` weiter aggression 0.62). Im `diag_nemesis` fällt die +Flop-Bet-Frequenz von 61.5 % auf 26.3 % — die Engine hört auf, dünn in die „Station" zu value-betten, +und spielt solides Blind-Poker. + +**Keine Kollateralschäden an den Lese-Tests** (strukturell und gemessen): +- `tests/sim_reads.rs`: alle Oracle-Profile unverändert — CallingStation (aggr 0.02) und Fish (0.08) + bleiben Station, Maniac (pfr 0.42) bleibt LooseAggressive, Reg/Nit unverändert. +- Memory-Reads der Boden-Archetypen unverändert: Reg (aggr 0.31 < 0.45) bleibt Station, Fish (0.11) + bleibt Station, Maniac (pfr 0.21) bleibt LA, gto/gto-small (LA), Nit (tight) — **kein** Boden-Archetyp + kippt. +- 97 Lib-Tests grün (+4 neue `style`-Regressionstests), `exploit_style` 6 grün. + +**Zwillings-Tor** (`twin_gate`, Vollbudget, SEED 0x5EED_0001; Baseline = efcff2b, deterministisch): + +``` + Achse Baseline (efcff2b) Kandidat Tor-Regel + OFFENSE (pop-EV) +44.16 +44.86 haelt (+0.70) OK + BODEN (worst) gto -23.93 gto -23.93 bit-identisch OK + gto-small -21.58 -21.58 identisch + reg/nit/maniac/fish -17.66/+42.92/+45.58/+126.85 identisch unberuehrt + EXPLOITABILITY 77.03 77.03 bit-identisch OK +``` + +`Gate::passes` = **true**: Population-EV hält (sogar +0.70), der Boden ist bit-identisch, die +Exploitability ist bit-identisch. Jeder Boden-Archetyp exakt wie die Baseline — wie strukturell +vorhergesagt: die Exploitability-Batterie läuft mit `villain_profile: None` → `classify` sieht nie ein +echtes Profil → **konstruktiv unverändert** (wie bei Leck 1); die Boden-Archetypen behalten ihre +Memory-Klassifikation → **unverändert**. Nur die Population-EV bewegte sich, und zwar nach oben: der +Fix kippt allein die loose + low-pfr + aggressive Draws (die Leck-Ecke) von Station auf Regular, genau +die Blutung — darum steigt die Offense leicht, statt zu fallen. + +## Einordnung und was bleibt + +Von −409.86 auf +80.73 bb/100 gegen den schlechtesten realistischen Gegner, den die CMA-ES finden +konnte — die Blind-Decke zurückgewonnen, ohne einen Boden- oder Exploitability-Beweis zu brechen. Es +war, wie bei Leck 1, ein lesegetriebenes Breite-als-Signal-Leck, das die Oracle-Diagnose nicht sehen +konnte (Oracle = blind für einen Styled-Gegner). + +Was der Fix NICHT anfasst: der ungegatete MDF-Boden liest per `raw` weiter die rohe aggression 0.62 → +`over_bluffs` (aggression ≥ 0.45, Leck 1) feuert auf dem River, kostet aber nur den ~0.68-bb-Rest +gegen die Blind-Decke — innerhalb des Rauschens, kein eigenes Leck. Die Spannung „aggression hilft vs. +Maniac, schadet vs. aggressivem Value-Better" lebt im River-MDF-Boden und gehört, falls je relevant, in +den opponent-aware, trust-gegateten River-Subgame-Solver ([[engine-math-vision]] Stage A→live), nicht +in einen weiteren Schwellen-Tweak. + +**Leck 3 (Live-Gap −311)** bleibt unberührt: es braucht operative Live-Farm-Daten, keinen +Code-Fix, den das Labor schließen kann. + +## Robustheits-Nachsuche: das Loch schrumpft, der Rest ist die Trust-Struktur + +Der Fix patcht nicht einen Punkt — die CMA-ES (`bin/nemesis`, jetzt mit `[deals] [generations]` +argv) gegen die REPARIERTE Engine neu laufen lassen zeigt, wie weit die kontinuierliche Robustheits- +Lücke zugeht: + +``` + vor dem Fix Nemesis-1 -414 bb/100 (Vollbudget) / -409.86 (Memory, 4000) + nach dem Fix Nemesis-2 -87.63 bb/100 (Memory, 4000; Schnellscan 400x8 fand -173, selektions- + verzerrt nach unten) +``` + +Nemesis-2 (`call_margin 0.173, raise_at 0.579, bet_at 0.748, open_at 0.800, bluff 0.229, size 0.996`) +ist **dasselbe lesegetriebene Leck**: Blind **+114.01**, Memory **−87.63** (`bin/nemesis_read`). Sein +konvergierter Read `vpip 0.65 pfr 0.15 fold2bet 0.56 aggr 0.41` → **classify CallingStation** — die +Aggression 0.41 liegt **knapp unter** dem 0.45-Tor, also rutscht er zurück in die getrustete Station. +Buckets wie bei Nemesis-1 (turn call −109, river/flop fold). + +**Warum kein weiterer Schwellen-Tweak:** das Tor tiefer zu legen (z. B. 0.40), um aggr 0.41 zu fangen, +quetscht den Reg-Archetyp (gemessene Aggression 0.31 — nur 0.10 entfernt, Memory-Rauschen überlappt) +und die CMA-ES findet dann ein Nemesis-3 bei aggr 0.33. Die Wurzel ist das **binäre `earned_trust`** +(1.0 für CallingStation, 0.0 sonst): ein Gegner direkt an der Klassengrenze bekommt den vollen +Station-Exploit oder gar keinen. `read_gate` nennt das selbst als nächsten Schritt — „The value is an +f64, not a bool, to leave room for a partial, confidence-weighted trust later without changing this +seam." Das ist die saubere Lösung: Trust als Konfidenz, die den Exploit skaliert (Grenzfall → partiell), +plus der opponent-aware Range-Posterior, der die value-lastige Betting-Range direkt misst statt sie aus +`aggression/0.45` zu schätzen ([[engine-math-vision]]). Ein 0.01-Margin-Tweak ist das nicht wert — das +Zwillings-Tor schützt das Geshippte, und Nemesis-2 (−87, gegen den EXTREMPUNKT des Regelraums, kein +typischer Gegner) ist kein Katastrophen-Leck mehr, sondern die Struktur-Grenze der Heuristik. + +## Werkzeug + +- `src/bin/diag_nemesis.rs` — konvergierter Memory-Read + classify, Terminal-Bucket-Attribution + (aggressive vs. passive Seite) gegen das feste Nemesis-Regelwerk. +- `src/bin/nemesis_read.rs` — Nemesis-EV je Lese-Modus (Oracle/Blind/Memory): zeigt die Read-Lücke + und die Wiederherstellung auf die Blind-Decke. diff --git a/docs/notizen/BEFUND-nit-read-leck.md b/docs/notizen/BEFUND-nit-read-leck.md new file mode 100644 index 00000000..ddfc9a1a --- /dev/null +++ b/docs/notizen/BEFUND-nit-read-leck.md @@ -0,0 +1,71 @@ +# Befund: das Nit-Voll-Read-Leck ist Ueber-Barreln, nicht Unter-Barreln (Stage 5) + +## Frage +Stage 3/4 liessen eine offene Wurzel: warum verliert selbst der KONSISTENTE volle Nit-Read gegen +blind (nit −50 bb/100), statt mindestens blind zu erreichen? Ein EV-Maximierer mit genauerer Info +sollte nie schlechter sein. Der Verdacht im BEFUND-offensiver-read war die Continue-Range-Schaetzung +(`call_floor`, Perzentil-Abbildung) sei fuer enge Ranges mis-kalibriert. + +## Werkzeug +Ein Entscheidungs-Trace (`sim::table`: `Dec`, `Table::new/run`, `play_hand_traced`) und eine +Diagnose (`tests/sim_blind.rs::diagnose_nit_full_read_leak`): jede Austeilung heads-up gegen den Nit +einmal blind, einmal mit vollem Oracle-Read, gleiche Karten und gleicher Seed, so dass nur HEROs +read-getriebene Linien abweichen und sich das Kartenglueck exakt aufhebt +(`delta = oracle.hero_net − blind.hero_net`). Lokalisiert nach der ERSTEN abweichenden Entscheidung +(Strasse + Zug-Wechsel). + +**Wichtig:** `decide()` gated intern (`read_gate::gate_reads`), also musste der Nit fuer die Messung +voruebergehend auf `earned_trust = 1.0` gesetzt werden, damit der volle Read den Riegel ueberlebt. +Danach zurueckgesetzt. (Ohne Promotion misst die Diagnose nur den defensiven MDF-Boden auf dem +rohen Spot: +1.3 bb/100 — der ausgelieferte, gegatete Zustand ist bereits leicht positiv.) + +## Messung (voller Read, un-gated, 2×1000 Haende, FREE) +Gesamt ≈ −596 bb ueber 2000 Haende ≈ **−30 bb/100** (dieselbe Richtung wie die −50 der Leiter, +anderer Seed/ohne Rake). Nach Zug-Wechsel, schlechteste zuerst: + +| Zug-Wechsel (erste Abweichung) | Haende | bb gesamt | +|---|---:|---:| +| flop: blind check → read **raise** | 140 | **−436.2** | +| flop: blind call → read raise | 9 | −146.7 | +| turn: blind raise → read fold | 1 | −115.0 | +| flop: blind raise → read check | 6 | −104.2 | +| ... (Rest klein) | | | +| flop: blind raise → read **call** (Pot-Control) | 3 | +157.3 | +| turn: blind abstain → read raise | 3 | +80.0 | +| river: blind call → read **fold** | 3 | +64.8 | +| flop: blind call → read fold | 13 | +53.5 | +| preflop: blind call → read fold | 8 | +20.3 | + +Ein einziger Eimer traegt 73 % des Verlusts: **flop check → read raise**. + +## Wurzel (korrigiert die bisherige Erzaehlung) +Der Riegel-Doc behauptete, der Read lasse die Engine "aufhoeren zu barreln und Fold-Equity liegen". +Die Daten zeigen das GEGENTEIL: der Read laesst die Engine **mehr barreln**. Er verwandelt +Flop-CHECKS in Bluff-RAISES, weil `table_fold` jetzt die wahre Nit-Fold-Rate 0.82 sieht und die +EINSTRASSIGE Bluff-EV `fold·Topf + (1−fold)·(called_share·Endtopf − Einsatz)` den Fold-Zweig +`0.82·Topf` als nahezu reinen Gewinn verbucht. Die 18 %, die weiterspielen, halten eine genuttete +Range und bluten ueber Turn und River weiter — ein MEHRSTRASSIGER Preis, den der einstrassige +Called-Zweig nie erfasst. + +Also ist es **nicht** die Continue-Range-Kalibrierung (`call_floor`/Perzentil) — die DEFENSIVE Seite +desselben Reads gewinnt durchweg (mehr folden gegen den bewiesenen Nicht-Bluffer: +53.5, +64.8, ++20.3; Pot-Control statt Raise: +157.3). Nur die OFFENSIVE Seite blutet, und zwar an genau einer +Stelle: einstrassige Fold-Equity treibt Flop-Bluff-Raises, deren Called-Zweig mehrstrassig verliert. + +Das deckt sich mit Stage 4: offensiven Trust auf 1.0 zu zwingen war noch SCHLECHTER (−88), weil das +genau diesen Ueber-Barrel-Hebel voll aufdreht. + +## Schluss +- Der Riegel (Nit → blind fuer die Offense) bleibt gemessen richtig; der Doc-Grund war invertiert und + ist korrigiert. +- Der ausgelieferte, gegatete Zustand gegen den Nit ist leicht positiv (+1.3 bb/100), getragen allein + vom defensiven MDF-Boden. +- Kein Engine-Verhalten geaendert. Geliefert: das Trace-Werkzeug, die Diagnose, der korrigierte Doc. + +## Echter naechster Schritt (zu messen, nicht blind zu bauen) +Der Defekt ist die EINSTRASSIGE Bluff-EV, nicht eine Konstante. Ein sicherer offensiver Read braucht, +dass der Called-Zweig eines Bluff-Barrels auf Flop/Turn den mehrstrassigen Preis sieht, wenn die +Continue-Range eng und stark ist (Nit: hoher Floor, niedriger `continue_share`). Hypothese zum Test: +eine Fortsetzungs-Strafe auf den Called-Zweig von Nicht-River-Bluffs, skaliert mit Enge/Staerke der +Continue-Range. Erfolgskriterium: bringt den vollen Nit-Read auf der Leiter auf ≥ blind, OHNE die +verdienten Stile (Station/Fisch) zu kosten. Sonst: Befund festhalten, Riegel behalten. diff --git a/docs/notizen/BEFUND-offensiver-read.md b/docs/notizen/BEFUND-offensiver-read.md new file mode 100644 index 00000000..88d47544 --- /dev/null +++ b/docs/notizen/BEFUND-offensiver-read.md @@ -0,0 +1,50 @@ +# Befund: der offensive Read laesst sich nicht abspalten (Stage 4) + +## Idee +Stage 3 zeigte: den vollen Read eines starken Spielers zu behalten kostet (nit −50, reg −176 +bb/100 heads-up), weil das Range-Modell seine Continue-Range ueberschaetzt. Vermutung: der WERT +steckt im OFFENSIVEN Teil — ein Nit foldet ~82 % zu Bets (gegen 0.45 blind), also liess die Engine +Fold-Equity liegen. Plan: nur den offensiven Pfad (`table_fold`, `steal_width`) die wahre Fold-Rate +sehen lassen, das Range-Modell blind halten. Die EV-Mathe schien das abzusichern: +`fe*Topf + (1-fe)*(Called-Zweig)`, nur `fe` hoch, der Called-Zweig unveraendert -> scheinbar strikt +mehr +EV-Bluffs. + +## Messung +Offensiver Trust fuer alle Stile auf 1.0, Leiter gegen die blinde Basislinie: + +| Szenario | offensiv-nur gegen blind | Urteil | +|-----------------|-------------------------:|------------| +| heads-up reg | −204.41 | SCHLECHTER | +| heads-up nit | −87.69 | SCHLECHTER | +| heads-up maniac | −78.09 | SCHLECHTER | +| 6-max reg | −72.94 | SCHLECHTER | +| 6-max nit | −35.14 | SCHLECHTER | + +Noch SCHLECHTER als der volle Read (nit −50 in Stage 3). Die Abspaltung schadet aktiv. + +## Wurzel +Fold-Rate und Continue-Range sind ZWEI SEITEN EINER MUENZE. Ein Nit foldet 82 %, WEIL er nur mit +starken Haenden weiterspielt. Nimmt man die hohe Fold-Rate (Offense), muss man die starke, enge +Continue-Range (Defense) mitnehmen. Entkoppelt (hohe Fold-Rate + blinde, weite Continue-Range) baut +man ein INKONSISTENTES, zu optimistisches Modell: die Engine bettet mehr, und die ~18 % der Bets, +die gecallt werden, laufen in eine viel staerkere Range als modelliert — der Called-Zweig verliert +gross, der Fold-Zweig gewinnt nur den Topf. Netto Minus. + +Blind spielt gegen starke Spieler eine MODERATE Aggression, die nahezu optimal ist: ohne die +Fold-Rate zu kennen, bettet sie massvoll, und Upside (Folds) und Downside (starke Continues) heben +sich auf. Es gibt kein freies offensives Mittagessen gegen starke Spieler. + +## Schluss +Zurueckgebaut; kein Code geliefert. Der Riegel (station-only, sonst blind) bleibt gemessen richtig. +Beide naheliegenden Hebel sind nun widerlegt: der volle Read (Stage 3) UND der offensiv abgespaltene +Read (Stage 4) verlieren gegen starke Spieler. Der Exploit hat nur gegen Ueberzahler positiven Rand, +wo die Continues schwach und weit sind. + +## Was bleibt (echter naechster Schritt) +Ein besseres Gegnermodell, nicht ein weiterer Riegel-Hebel. Zwei Richtungen: +1. Pruefen, warum selbst der KONSISTENTE volle Read (hohe Fold-Rate + enge Continues) gegen den Nit + verliert statt mindestens blind zu erreichen — ein EV-maximierendes Modell mit genauerer Info + sollte nie schlechter sein. Verdacht: die Continue-Range-Schaetzung (Perzentil-Abbildung, + `call_floor`) ist fuer enge Ranges mis-kalibriert, die Exploit-Fehler ueberwiegen die Info. +2. Oder die Sitzungsschleife (Stage 1/2) nutzen, um nur dort zu exploiten, wo die Beobachtung einen + klaren, gegen blind gemessenen Rand zeigt — statt eines pauschalen Stil-Reads. diff --git a/docs/notizen/BEFUND-optimizer-nemesis-stufe5.md b/docs/notizen/BEFUND-optimizer-nemesis-stufe5.md new file mode 100644 index 00000000..e54b6cfb --- /dev/null +++ b/docs/notizen/BEFUND-optimizer-nemesis-stufe5.md @@ -0,0 +1,89 @@ +# Befund: der Optimizer steht — und findet sofort eine Klippe: ein realistischer Gegner, gegen den die Engine −643 bb/100 verliert + +Stufe 5 des synthetischen Labors ist gebaut: ein ableitungsfreier **Optimizer** über die Objektiven des +Labors (`sim::optimize`, `bin/nemesis`). Er ist eine Diagonal-Kovarianz-CMA-Evolutionsstrategie (der +separable-CMA-ES-Kern, Ros & Hansen 2008; Konstanten aus Hansens Tutorial 2016, Kovarianz diagonal → kein +Eigenwertzerfall, keine Abhängigkeiten). + +## Validierung (analytisch, deterministisch) + +- Sphäre (4-dim) → f < 1e-6. ✓ +- Rosenbrock → erreicht das Becken des Optimums (f < 2e-2 bei (≈1, ≈1)); die diagonale Variante grindet + das gekrümmte Tal langsam entlang (bekannte sep-CMA-ES-Grenze, ehrlich im Test dokumentiert). ✓ +- Verrauschtes Objektiv → findet die Optimumsregion trotz Wobble. ✓ + +Die λ Kandidaten je Generation sind unabhängig und werden **parallel** ausgewertet (`f: Fn + Sync`); +das Sampling bleibt sequentiell, also ist das Ergebnis trotz Threads deterministisch im Seed. Das war +nötig: das Winrate-Objektiv ist einzel-threadig je Gegner, und die Parallelisierung holt die Kerne +zurück, die die Populationsläufe nutzen (eine einzel-threadige Suche lief >70 min, multi-core ein +Bruchteil). + +## Erste Anwendung: der Nemesis (`nemesis`, 300 Austeilungen × 8 Generationen) + +Statt „schlechtester von sechs Archetypen" (der Boden des Zwillings-Tors) sucht der Optimizer den +schlechtesten Gegner im **ganzen kontinuierlichen 6-dim-Regelraum** — eine empirische beste Antwort in +Gegner-Raum, die tightste Robustheitsprobe. Gefunden: + +``` + Nemesis-Regelwerk: + call_margin 0.147 raise_at 0.597 bet_at 0.616 + open_at 0.817 bluff 0.396 size 0.270 + + Engine-EV gegen den Nemesis: -642.96 bb/100 +``` + +## Was das heißt (ehrlich) + +1. **Es gibt eine Klippe.** Dieselbe Engine, die die ganze Population mit +32 schlägt und Fisch/Maniac mit + +120 zerlegt, **verliert katastrophal** gegen eine bestimmte realistische Konfiguration: einen + loose-aggressiven Small-Ball-Dauer-Reraiser (niedriges `call_margin`, `raise_at` 0.597 fast am + Aggressions-Boden, hoher `bluff` 0.396, kleines `size` 0.270). Er re-raist unablässig klein mit weiter + Range und blufft viel. Der Durchschnitt (+32) verbarg diesen Abgrund völlig — genau der Grund, warum + Worst-Case-Suche nötig ist und der Mittelwert allein trügt. +2. **Richtung sicher, Magnitude verrauscht.** 300 Austeilungen sind wenige, −643 ist aber weit jenseits + jedes Rauschens: die *Existenz* des Lecks ist belastbar, die genaue Zahl nicht. Die Konfiguration + zeigt, wo zu graben ist: die Reaktion der Engine auf relentless kleine Aggression (vermutlich + Überfolden gegen die kleinen Reraises, oder eine Fehlklassifikation des Reads, die den Hebel + invertiert). Das ist der nächste echte Engine-Fix — vom Labor aufgedeckt, nicht erraten. +3. **Der Optimizer ist das Werkzeug, nicht nur für Gegner.** Dieselbe Maschine tunt die Engine-eigenen + Hyperparameter gegen die Population, sobald sie als Vektor exponiert sind — der „Feinschliff, zuletzt" + der Architektur. Sie ist fertig; es fehlt nur dieser Hook. + +## Nachtrag: Vollbudget-Lauf (`nemesis`, 1000 Austeilungen × 14 Generationen) + +Der Demo-Lauf oben (300×8) könnte die Klippe über- oder unterzeichnen. Deshalb nachgefahren bei vollem +Budget — mehr Austeilungen je Auswertung (strafferes EV), mehr Generationen (tiefere CMA-Konvergenz): + +``` + Nemesis-Regelwerk: + call_margin 0.215 raise_at 0.587 bet_at 0.548 + open_at 0.729 bluff 0.068 size 0.441 + + Engine-EV gegen den Nemesis: -414.81 bb/100 +``` + +**Die Klippe ist bestätigt — und das Vollbudget findet eine *andere* Wurzel.** Statt des loose-aggressiven +Reraisers (300×8) konvergiert die tiefere Suche auf einen **klebrigen Low-Bluff-Caller**: hohes +`call_margin` 0.215 (zahlt weit ab), `bluff` 0.068 (fast nie), mittleres `size` 0.441. Die Engine blutet +also **in die Calling-Station hinein** — sie barrelt/blufft gegen einen Gegner, der nie foldet und nie +selbst blufft. Das ist dieselbe Over-Barrel-/Over-Defense-Wurzel, die `BEFUND-gto-restleck-river-overcall` +und das Zwillings-Tor (Boden = balancierter gto) zeigen, hier aus der entgegengesetzten Richtung getroffen. +Dass zwei Budgets zwei verschiedene −400…−640-Klippen finden, heißt: es ist kein 300-Hand-Artefakt, +sondern ein breites Worst-Case-Tal. Die *Existenz und Größenordnung* (mehrere hundert bb/100) ist damit +budget-robust belegt; die genaue Zahl und der genaue Nemesis-Punkt wandern mit Budget/Seed. + +## Grenzen (ehrlich) + +- Das Winrate-Objektiv kostet ~Zehn-ms je Hand; eine Suche mit vielen Austeilungen je Auswertung ist + teuer. Eine Produktionssuche braucht die bewiesene AIVAT-Varianzreduktion (`sim::aivat`), um bei + gleicher Präzision mit weniger Austeilungen je Auswertung auszukommen — der in der Architektur genannte + Hebel. Der Demo-Lauf ist bewusst klein gehalten. +- Der Nemesis ist ein einzelner Punkt; eine robuste Härtung mittelt über mehrere Seeds und prüft, dass + ein Fix die Klippe schließt, ohne die +32-Population-EV oder den Zwillings-Tor-Boden zu brechen. + +## Einordnung + +Stufe 5 schließt das Labor: Population (0), Kalibrierung (1), Zwillings-Tor (2), adaptive Liga L1 (3), +Optimizer (5). Der erste Lauf liefert sofort den schärfsten offenen Engine-Befund dieser Arbeit — eine +realistische Klippe von −643 bb/100 —, den weder die Leiter noch der Populationsdurchschnitt je zeigten. +Siehe `ARCHITEKTUR-synthetik-labor.md`. diff --git a/docs/notizen/BEFUND-postflop-exploitability-river.md b/docs/notizen/BEFUND-postflop-exploitability-river.md new file mode 100644 index 00000000..7827fa4a --- /dev/null +++ b/docs/notizen/BEFUND-postflop-exploitability-river.md @@ -0,0 +1,62 @@ +# Befund: das fehlende Maß ist gebaut — und die Engine ist am River massiv ausnutzbar + +MODULES.md nennt es ausdrücklich als Lücke: *„Postflop-Exploitability gegen eine Best Response fehlt +noch."* Diese Runde ist sie gebaut — und liefert sofort die erste quantitative Zahl dafür, wie weit +die Heuristik vom Gleichgewicht entfernt ist. + +## Was gebaut wurde + +`sim::exploit_river` (Harness) + `src/bin/exploit_scan.rs` (Abtastung). Für ein **River**-Subgame +(die einzige Straße, die exakt ist: Board komplett, Showdown exakt, keine Zukunft): + +1. **Card-exakte Buckets:** jede Combo beider Ranges nach exakter Showdown-Stärke auf dem Board + (`hand::showdown::best`) in eine gemeinsame Stärkeleiter einsortiert; Card Removal zwischen den + Ranges steckt in der gemeinsamen Austeilungstabelle `chance[i·n+j]`. +2. **Gleichgewichtswert v\*:** mit dem geteilten CFR+-Kern gelöst (`cfr::river::tree_with_chance`, neu + freigelegt). +3. **Engine als Held:** an jedem Held-Knoten und Bucket wird die **lebende** Engine befragt + (`engine::decide`, Repräsentant je Bucket) → reine Aktion je Bucket. +4. **Villain antwortet mit Best Response** auf diese feste Politik über die wahren Ranges. + +`exploitability = v* − Wert(Engine | Villain antwortet optimal) ≥ 0`, in bb/100. Validiert durch drei +Tests: eine Nash-Strategie meldet ~0 (Pipeline korrekt), „alles folden" ist ausnutzbar, die lebende +Engine läuft und liefert eine endliche, nicht-negative Zahl. + +## Erste Abtastung (volle OOP-Range gegen volle Range, Topf 6 / Bet 4, 60k Iter) + +``` + Board Belief v* Engine Exploitability + dry ace-high unread -19.4 -94.6 75.2 bb/100 + paired unread -19.5 -51.6 32.1 + wet connected unread -19.9 -63.0 43.0 + monotone unread -20.3 -75.5 55.2 + low dry unread -19.1 -83.5 64.4 + broadway unread -20.2 -98.4 78.3 + dry ace-high gto -19.4 -127.9 108.5 + broadway gto -20.2 -103.2 83.1 +``` + +- **v\* ≈ −19..−20 bb/100**, stabil über alle Texturen und **belief-unabhängig** (korrekt: v* ist das + Gleichgewicht des Baums, nicht der Engine-Glaube) — der Positions-Tax des OOP-Erstaktiven. +- **Die Engine gegen Best Response verliert 32–108 bb/100 mehr als v\***. Der River wird also + **massiv ausgenutzt**, sobald der Gegner optimal antwortet — genau das Leck, das die bb/100-Leiter + gegen die fixen Bots **komplett verdeckt** (die antworten nie optimal). + +## Bedeutung + +Das ist der quantitative Beweis der Vision-These: Die Single-Street-Heuristik ist am Postflop +ausnutzbar, ein echter Solver ist nötig — jetzt mit **Zahl**, nicht Bauchgefühl. Und es ist das Maß, +gegen das sich jede Solver-Stufe ab jetzt beweist (Exploitability runter), unabhängig vom +Cooler-Rauschen der Leiter. + +**Caveat (ehrlich):** Das Subgame „volle Range, OOP, erster Zug" ist härter als ein realistischer, +durch vorheriges Setzen **verengter** Spot — die Zahlen sind eher eine obere Schranke. Nächste +Schritte: (a) verengte Ranges messen (realistische River-Spots), (b) eine echte River-Strategie +(Stage A, lebend) einsetzen und zeigen, dass die Exploitability **sinkt** — zum ersten Mal ein +belegbarer Solver-Gewinn, den die Leiter nicht zeigen konnte. + +## Status + +`src/cfr/river.rs` (Builder freigelegt), `src/sim/exploit_river.rs`, `src/bin/exploit_scan.rs`, +`src/sim/mod.rs`. 44 Lib-Tests grün. Reine Mess-Infrastruktur — ändert keine Spielentscheidung, kann +also nicht „verlieren". Nichts committed. diff --git a/docs/notizen/BEFUND-read-gate-earned-trust.md b/docs/notizen/BEFUND-read-gate-earned-trust.md new file mode 100644 index 00000000..ce54cebe --- /dev/null +++ b/docs/notizen/BEFUND-read-gate-earned-trust.md @@ -0,0 +1,40 @@ +# Befund: der Read-Riegel als Earned-Trust-Tabelle (Stage 3) + +## Frage +Der Riegel (`engine::read_gate`) liess bisher nur die Calling Station durch und spielte jeden +anderen Stil blind. War das zu vorsichtig? Welche Stile haben ihren Read auf der Leiter verdient? + +## Messung +Earned-Trust-Tabelle gebaut (`earned_trust: Style -> f64`), der Riegel ist jetzt `> 0.0` statt ein +fester Fall. Im Experiment jeder Nicht-Ueberzahler auf volle 1.0 gesetzt und die Leiter gegen die +blinde Basislinie (`benchmarks/baseline.txt`, df915b1) gefahren: + +| Szenario | Read gegen blind | Urteil | +|--------------------|-----------------:|-------------------| +| heads-up reg | −176.02 | SCHLECHTER | +| heads-up maniac | −147.57 | SCHLECHTER | +| heads-up nit | −50.44 | SCHLECHTER | +| 6-max reg | −61.79 | SCHLECHTER | +| 6-max nit | −22.39 | nicht unterscheidbar | +| 6-max maniac | +72.54 | nicht unterscheidbar | + +Der Nit macht aus einem blinden +37.73-Gewinner einen Verlierer. Kein starker Stil wird irgendwo +sauber BESSER. + +## Wurzel +Den Profil-Read eines starken Spielers zu behalten laesst das Range-Modell seine Continue-Range +ueberschaetzen -> die Engine hoert auf zu barrelen und verliert ihre Fold-Equity. Der DEFENSIVE +Wert eines starken Reads (duenne Value nicht in einen bewiesenen Nicht-Bluffer zahlen) wird ohnehin +schon vom ungegateten MDF-Boden geerntet (`mdf_floor::floor` auf dem rohen Spot in `engine::decide`). +Der Riegel steuert nur die OFFENSIVEN Anpassungen, und die zahlen sich allein gegen Ueberzahler aus. + +## Schluss +Die Tabelle bleibt beim Ueberzahler (1.0), alle anderen 0.0 — verhalten identisch zur alten +`matches!(CallingStation)`, aber jetzt datengetrieben und je Stil mit Messung belegt. Der konservative +Riegel ist nicht bloss vorsichtig, sondern gemessen richtig. + +## Naechster Schritt +Ein SICHERER offensiver Read gegen starke Spieler: nicht das ganze Profil ins Range-Modell geben, +sondern nur die Teile, die die Leiter als +EV beweist (z. B. Steal-Frequenz gegen den Nit, der 82 % +zu Bets foldet, ohne die Continue-Range zu ueberschaetzen). Dann verdient sich der Nit seinen Platz +in der Tabelle mit einem Wert > 0. diff --git a/docs/notizen/BEFUND-river-gearbox-belief-trust.md b/docs/notizen/BEFUND-river-gearbox-belief-trust.md new file mode 100644 index 00000000..ca483008 --- /dev/null +++ b/docs/notizen/BEFUND-river-gearbox-belief-trust.md @@ -0,0 +1,102 @@ +# Befund: der River-Solver geht live — als defensives Veto, nicht als Ersatz + +Der höchste Hebel der Mathematik-Landkarte ([[ROADMAP-mathematik]], Zeile 1): den bewiesenen, aber +stillgelegten River-Subgame-Solver *sicher* in den Live-Pfad bringen. Stage A bewies ihn unausnutzbar +(0.0 bb/100 gegen korrekte Überzeugung), aber naiv verdrahtet kostete er **−43 bb/100** — er spielte +ausbalanciertes GTO gegen Gegner, die man ausnutzen muss ([[BEFUND-river-solver-balanced-vs-exploitable]]). + +Dieser Befund baute zuerst das volle Getriebe (Belief + Vertrauen), **maß es, verwarf es, und engte es +auf seinen einen bewiesenen Vorteil ein.** Das ist die Eiserne Regel in Aktion: nie einen Verlierer +shippen — erst messen, dann die Form dem Beweis anpassen. + +## Schritt 1 — das volle Getriebe (Belief + Vertrauen): gemessen, verworfen + +Die Idee: statt der Heuristik den **KL-gebundenen Best Response gegen den geglaubten Gegner** über das +kartengenaue River-Subgame spielen — λ aus der Read-Konfidenz, sodass ein starker Read ausnutzt und ein +schwacher zu bewiesenem GTO zusammenfällt. Primitive alle vorhanden (`cfr::kl_br`, `believed_villain`, +`lambda_from_confidence`); 6 Unit-Tests grün; sauber verdrahtet. + +**Die Leiter sagte Nein.** Das volle Getriebe ersetzte Heros ganze River-Entscheidung (Bet/Check **und** +Call/Fold) und verlor genau dort, wo die Heuristik schon gewinnt — die Ausnutzung lockerer Gegner: + +| Nemesis | Blind | Memory (volles Getriebe) | Δ vs Soft-Trust-Boden | +|---|---|---|---| +| nemesis-1 | +81.41 | +71.84 | ≈ −10 | +| nemesis-2 | +114.01 | **+35.21** | **−48** (Boden war +83.72) | + +Die KL-um-GTO-Politik ist **schwächer als die Heuristik** im Angriff: sie kann GTOs Support nur +umgewichten, nie die dünnen Value-Bets und leichten Calls spielen, mit denen die Heuristik+Memory einen +Fisch für +83 ausnimmt. Ein Ersatz dieser Offense durch eine Near-GTO-Linie **blutet** — das −43-Muster, +schlimmer. → Verworfen. + +## Schritt 2 — die Einengung: nur das defensive Veto + +Der **einzige** Ort, an dem das Getriebe ein bewiesener Vorteil ist, ist die **Verteidigung**: die +Single-Street-Heuristik **über-callt unter-gebluffte River-Overbets** (nemesis-3), weil ihr Range-Modell +den GTO-Bluffanteil `s/(P+s)` trägt, den ein tighter Bettor nicht hat. Also lässt der Befund die Offense +der Heuristik unangetastet und fügt genau eine Regel hinzu: + +> **`fold_veto` (nur Cash):** foldet einen heuristischen **Call** gegen eine River-Wette, wenn ein +> **konfidenter** Read sagt, der Gegner **unter-blufft** (der KL-Best-Response gegen den geglaubten +> Gegner callt Heros Bucket an Knoten 4 seltener als `VETO_CALL_FLOOR`=0.5). Nie ein Bet/Check/Raise, +> nie bei dünnem Read, nie bei Turnier-Prämie (`premium > 0` → ICM bleibt in der Heuristik). + +Konstruktiv sicher gegen den −43/−48-Regress: das Veto **kann Heros Offense nicht ändern**, nur einen +vom Read als verlierend bepreisten Call ablehnen. Gegen einen echten Bluffer (hohe `aggression`) glaubt +`believed_villain` eine bluffreiche Wettrange → Veto feuert nicht → die leichten Calls der Heuristik +bleiben. Gegen Stations/Fische (betten ihre ganze Range) feuert es ebenfalls nicht. + +## Beweis (Leiter, gepaart, glückskorrigiert, SEED 0x5EED_0001, 4000 Austeilungen) + +Die Veto-Leiter (`bt9ovdznj`) sagte **Ja.** Das Over-Call-Loch schließt sich, und keine Offense-Kante +regressiert — genau die konstruktive Erwartung: + +| Nemesis | Blind | Memory (Veto) | Ziel | Befund | +|---|---|---|---|---| +| nemesis-1 | +81.41 | +78.34 ±28.0 | ≈ Blind (Offense unberührt) | ✓ Blind−Memory = 3 ≪ CI | +| nemesis-2 | +114.01 | +80.90 ±33.3 | ≈ +83 (Soft-Trust-Boden) | ✓ auf dem Boden | +| nemesis-3 | −26.59 | **+0.62 ±18.4** | > −26.59 (Over-Call-Loch) | ✓ **+27**, Loch zu | + +Archetypen (`arch_read 4000`), Gap = Memory − Blind, kein Regress: + +| Archetyp | Blind | Memory | Gap | +|---|---|---|---| +| fish | +74.58 | +132.37 | **+57.79** (Station-Exploit voll da) | +| reg | −13.40 | +7.52 | +20.92 | +| nit | +43.05 | +49.89 | +6.84 | + +Das Veto berührt **keine** Angriffskante (nemesis-1 −3 innerhalb ±28; nemesis-2 am Soft-Trust-Boden; +alle Archetyp-Gaps positiv) und schließt genau das defensive Loch, für das es gebaut wurde +(nemesis-3 −26.59 → +0.62). Die Eiserne Regel ist erfüllt: **kein Verlierer, bewiesen auf der Leiter.** +Nächster Schritt: Zwillings-Tor, dann (auf ausdrückliche Freigabe) Commit. + +## Was bleibt (nächste Stufen) + +- **Belief-Kalibrierung** (falls die Leiter es verlangt — zwei bestätigte Defekte, Recon + 2026-11-11): (a) **Combo-Masse statt Distinct-Rang** — `believed_villain`'s `rank = c/(n-1)` + (river_subgame.rs:192) ist die Position auf der **deduplizierten** Stärkeleiter (sort+dedup, + river_subgame.rs:148-151), nicht die kumulierte Combo-Masse; die `chance`-Tabelle trägt die + Combo-Zahlen, ist aber vom Fold/Bluff-Schwellwert strukturell getrennt. Auf gepaarten Boards foldet + `fold_to_bet`=0.45 also ~45 % der **Stärke-Ebenen**, nicht der Combos. Fix: Villain-Marginale der + `chance`-Tabelle als Masse-Quantil (`q[vb] = kum_unter + masse/2`). (b) **Doppelte Konditionierung** + — bei Facing-Bet ist die Eingabe-Range schon die *Wett*-Range (`continuations` setzt bei Villain-Bet + einen Value-Boden + `bluff_share`, street_continuation.rs:101-110); `believed_villain`'s `v_check` + filtert sie ein zweites Mal auf Top-40 %-Value. **Für das Veto ist das kein reiner Bug:** der + Zweitfilter entfernt genau die GTO-Bluffs, die `range_spec` einem Under-Bluffer fälschlich lässt + (die Over-Call-Wurzel), und ist per `aggression` selbstkorrigierend (ein echter Bluffer behält seine + Bluffs). Nur die **Höhe** ist unkalibriert — relevant erst, wenn das Veto fehl-feuert (Archetyp- + Regress). Beides wird nur angefasst, wenn die Leiter es verlangt; sonst bleibt v1. +- **Offense-Ausnutzung mathematisch heben**: die KL-um-GTO-Grenze (kann GTOs Nullmengen nicht + erreichen) heißt, dünner Value gegen Stations braucht ein anderes Primitiv (BR mit Support-Boden) + als `kl_best_response`. Die Heuristik hält diese Kante heute; ein mathematischer Ersatz ist ein + eigener, gemessener Schritt — nicht dieser. +- **Stage B** (`cfr::turn`, Turn+River-Subgame): sobald das River-Veto bewiesen live ist. +- **Die λ-Abbildung herleiten** statt `LAMBDA_POT_SCALE`/`CONFIDENCE_FLOOR` zu setzen — + informationstheoretisch ([[ROADMAP-mathematik]] §5), der Optimizer zuletzt. + +## Werkzeug + +- `src/engine/river_subgame.rs` — `believed_villain`, `lambda_from_confidence`, `river_exploit_plan`, + `fold_veto` (+ Unit-Tests inkl. `a_confident_underbluff_read_folds_a_bluff_catcher_facing_a_bet`). +- `src/exploit/profile.rs` / `src/sim/memory.rs` / `src/exploit/sample.rs` — `Profile.confidence`. +- `src/engine/decide.rs` — `fold_veto` nach `mdf_floor::floor` im River-Zweig von `postflop`, cash-gated. diff --git a/docs/notizen/BEFUND-river-gto-leck.md b/docs/notizen/BEFUND-river-gto-leck.md new file mode 100644 index 00000000..39825d8a --- /dev/null +++ b/docs/notizen/BEFUND-river-gto-leck.md @@ -0,0 +1,48 @@ +# Befund Stage A: reines River-GTO schlägt die Exploit-Heuristik nicht + +**Messung** (volle Leiter gegen Basislinie `201a115+lokal`, River-Subgame-Solver für den +Heads-up-River-am-Zug-Slice in `engine::decide` eingespeist): + +``` +GESAMT -73.95 ± 5.25 bb/100 2856 geändert SCHLECHTER +heads-up calling station -240.99 ±24.57 566 geändert SCHLECHTER +heads-up fish -114.94 ±21.51 290 geändert SCHLECHTER +heads-up reg / nit / maniac ~0 (im Rauschen) nicht unterscheidbar +6-max reg / nit / maniac / fish ~0 nicht unterscheidbar +``` + +Der Verlust sitzt **ausschließlich bei den Over-Callern** (Station callt 98 %, Fish 93 %). Gegen +Gegner, die man nicht ausbeuten kann (Reg, Nit), ist reines GTO neutral. + +## Mechanismus + +Reines GTO ist **unausbeutbar, aber nicht ausbeuterisch**. Der River-Solver löst das Gleichgewicht: +beide Seiten optimieren. Gegen einen Station, der nie foldet, ist das falsch an beiden Enden — +- GTO blufft einen ausbalancierten Luft-Anteil hinein, der immer gecallt wird (verbranntes Geld), +- GTO checkt mittlere Hände zurück statt thin zu valuebetten (liegengelassenes Geld). + +Die **ausgelieferte Heuristik beutet genau das aus** (valuebettet thin, blufft Nicht-Folder nie) und +gewinnt gegen Station/Fish zweistellig bis dreistellig. GTO macht diesen Vorsprung kaputt. + +## Schlussfolgerung (bestätigt die Vision) + +1. **Pure GTO ≠ stompen.** Das ist der empirische Beweis für den Kern von [[engine-math-vision]]: + gebraucht wird **Best-Response gegen den _modellierten_ Gegner**, nicht das Gleichgewicht + (Kronengleichung `max E_belief[EV(σ)] − λ·KL(σ‖σ_GTO)`, λ→0 bei belastbarem Read). + +2. **Stage A kann die Leiter auch mit Best-Response nicht gewinnen.** Eine Einzelstraßen-Best-Response + auf dem River ≈ das, was die Heuristik schon rechnet (EV jeder Aktion gegen die modellierte + Fold/Call-Frequenz). Der River ist die Straße, auf der die Einzelstraßen-Heuristik am wenigsten + falsch liegt. Der Gewinn liegt **mehrstraßig** (Stage B: Turn+River), wo die Myopie der Heuristik + der eigentliche Leak ist — der Over-Barrel in genutzte Ranges (siehe BEFUND-nit-read-leck). + +## Was bleibt / was als Nächstes + +- **Reverted:** die `decide`-Einspeisung ist raus; die ausgelieferte Engine ist unverändert + (kein Loser wird ausgeliefert). +- **Behalten als Fundament:** `src/cfr/river.rs` (gegen Lehrbuch-GTO bewiesen: Bluff-Verhältnis + `s/(P+s)`, MDF `P/(P+s)`) und `src/engine/river_subgame.rs` (die Bucketing-Brücke Combos→Stärke + via `judge`). Stage B wiederverwendet beides. +- **Nächster Schritt — Stage B:** Turn+River-Baum mit River-Chance-Knoten, gelöst als Best-Response + gegen die modellierte Gegner-Continuation, damit die Barrel-Entscheidung die River-Konsequenz + sieht. Dort stirbt der Over-Barrel-Leak. diff --git a/docs/notizen/BEFUND-river-solver-balanced-vs-exploitable.md b/docs/notizen/BEFUND-river-solver-balanced-vs-exploitable.md new file mode 100644 index 00000000..78b6e3ed --- /dev/null +++ b/docs/notizen/BEFUND-river-solver-balanced-vs-exploitable.md @@ -0,0 +1,72 @@ +# Befund: der River-Solver live verdrahtet kostet −43 bb/100 — Gleichgewicht gegen Fische ist falsch + +Stage A hat einen card-exakten River-Subgame-Solver gebaut und in `sim::exploit_river` **bewiesen**: +gegen eine korrekte GTO-Überzeugung ist seine Politik exakt unausnutzbar (0.0 bb/100, Engine-Wert = +v\* auf die Nachkommastelle, alle Boards). Dieser Befund hält das Gegenstück fest: **derselbe Solver +in den Live-Pfad (`engine::decide`) gehängt ist ein −43-bb/100-Verlierer** — und warum. + +## Der Versuch + +In `decide::postflop` auf dem Heads-up-River vor der Heuristik-EV-Linie: statt der Einzelstraßen- +Heuristik die card-exakte Subgame-Gleichgewichtsmischung spielen (`river_plan` → `realize`, aus dem +Spot-Seed realisiert). Nur die aufzählbare Heads-up-River-Scheibe greift; alles andere fällt durch. + +## Das Ergebnis (Leiter, integrierter Baum gegen Basislinie `24549fb+lokal`, 1115 s) + +``` + GESAMT -42.97 ± 5.93 bb/100 SCHLECHTER + + heads-up calling station -126.79 ± 18.24 SCHLECHTER (+359 → +232) + heads-up maniac -125.10 ± 62.26 SCHLECHTER + heads-up fish -80.07 ± 29.37 SCHLECHTER + calling station (blind) -125.67 ± 19.77 SCHLECHTER + calling station (memory) -127.36 ± 18.30 SCHLECHTER + fish (blind) -59.25 ± 31.78 SCHLECHTER + fish (memory) -63.57 ± 26.77 SCHLECHTER + 6-max gto -27.63 ± 24.72 SCHLECHTER + + heads-up gto +1.26 ± 10.33 nicht unterscheidbar + heads-up gto-small -3.80 ± 11.14 nicht unterscheidbar + heads-up gto (blind) +11.43 ± 11.71 nicht unterscheidbar + heads-up gto-small (blind) +2.41 ± 11.66 nicht unterscheidbar +``` + +## Die Wurzel: ein symmetrischer Prior spielt ausbalanciert gegen Gegner, die man ausnutzen muss + +Der Schaden teilt sich sauber: + +- **Gegen die balancierten Gegner (gto, gto-small): nicht unterscheidbar.** Dort ist die symmetrische + Gleichgewichtsmischung ungefähr richtig — beide Seiten spielen nahe GTO, der Solver trifft es. +- **Gegen die ausnutzbaren Gegner (calling station, fish, maniac): katastrophal.** `river_plan` setzt + `hero_combos = villain_combos` (symmetrischer Prior) und löst auf das **Gleichgewicht**. Gegen eine + Calling Station ist Gleichgewicht grob falsch: man darf nicht ausbalancieren, sondern setzt jeden + dünnen Value-Bet durch und blufft nie. Der Solver checkt/unterbettet statt maximal Value zu holen — + −127 bb/100. Die Live-Verdrahtung **streift zusätzlich den Read ab**, von dem die ganze Leiter ihre + Kante bezieht. + +Das ist die engine-math-vision-Warnung wörtlich eingetreten: ein GTO-Subgame-Solver ohne gegner- +bewusste Überzeugung spielt ausbalanciertes Poker gegen Spieler, die man schlachten sollte. + +## Die Konsequenz: NIE EINEN VERLIERER AUSLIEFERN → zurückgebaut + +Die Live-Verdrahtung in `decide.rs` ist entfernt (nur ein Kommentar und der Moduleintrag bleiben). +Der Solver bleibt als **bewiesenes Harness-Primitiv** (`sim::exploit_river`, 0.0 vs korrekte +Überzeugung) — er hat im Live-Pfad nichts verloren, bis zwei Dinge stehen: + +1. **Gegnerbewusste Überzeugung** — Posterior (`exploit::posterior`, Beta/Bayes) → Range-Belief, statt + `hero = villain`. Der Solver muss gegen die *vermutete* Gegnerrange lösen, nicht gegen sich selbst. +2. **Vertrauens-Riegel (die Krone)** — `cfr::kl_br`: die ausgespielte Politik in einer KL-Kugel um GTO + halten, Radius λ aus der Read-Konfidenz (`posterior::confidence`). Starker Read → weit ausnutzen; + schwacher Read → nahe GTO. So kann der Solver nie wieder gegen einen Fisch ausbalancieren *und* nie + gegen einen unbekannten Gegner überausnutzen. + +Bis dahin trägt die Heuristik-EV-Linie die Exploit-Kante, die die Leiter misst. + +## Bestätigung (gemessen) + +Nach dem Rückbau neu gemessen (`b3lgn7rq2`, 229 s): **GESAMT +0.00 ± 0.00 bb/100, 0 geändert, +jedes Szenario „gleich"** — die Stichproben sind bit-für-bit identisch zur Basislinie, der Rückbau ist +also vollständig und die Basislinie war sauber (calling station zurück auf +359.20, fish +152.44). +Der Benchmark-Gate ist grün (Exit 0, kein Regress). Nebenbefund: der Live-Solver war auch **5× langsamer** +(1115 s gegen 229 s) — eine 12k-Iterationen-CFR-Lösung je River-Entscheidung ist für den Live-Pfad ohnehin +zu teuer; er gehört in die Offline-/Harness-Schicht, nicht in `decide`. diff --git a/docs/notizen/BEFUND-simreal-stufe4.md b/docs/notizen/BEFUND-simreal-stufe4.md new file mode 100644 index 00000000..58306c49 --- /dev/null +++ b/docs/notizen/BEFUND-simreal-stufe4.md @@ -0,0 +1,56 @@ +# Befund: Stufe 4 offline — der Sim-to-Real-Gap ist messbar und modest; der Rest ist unausweichlich live + +Die offline messbare Hälfte von Stufe 4 steht: der **Sim-to-Real-Gap im HUD-Raum** (`sim::simreal`, +`bin/simreal`). Die Frage, die sie beantwortet, ist die Lebensversicherung des ganzen Labors: *Sieht +unser synthetisches Feld durch ein HUD überhaupt aus wie echte Spieler?* Wenn nicht, ist keine In-Lab-EV +vertrauenswürdig — und das muss man wissen, bevor eine einzige Live-Hand läuft. + +## Aufbau + +Die Wahrheit→Beobachtung-Verknüpfung (`sim::reads`, an `tests/sim_opponent_stats` von den 5 Styles +geeicht) ist hier auf **beliebige gezogene `Rules`** verallgemeinert: `induced_hud(rules, n, seed)` misst +die vier HUD-Zahlen, die ein Regelwerk über viele Zufallshände an denselben kanonischen Spots induziert. +`population_induced_hud` fährt das über eine ganze gezogene Population und berichtet Mittel + Streuung je +Achse — der Fingerabdruck des synthetischen Feldes im beobachtbaren Raum. + +## Ergebnis (`simreal`, 120 Zieher × 2000 Hände) + +``` +Ganzes synthetisches FELD (alle Archetypen): + vpip 0.529 (sd 0.343) pfr 0.110 (sd 0.146) foldToBet 0.613 (sd 0.178) aggression 0.196 (sd 0.138) + +Innerhalb des reg-Clusters — synth. vs real STREUUNG (der faire Vergleich): + Achse synth. real Gap + vpip 0.126 0.043 +0.083 + pfr 0.093 0.027 +0.066 + foldToBet 0.056 0.089 -0.033 +``` + +## Was das zeigt (ehrlich) + +1. **Der faire Vergleich ist der within-Cluster.** Die Feld-Streuung (sd vpip 0.343) ist riesig, weil sie + **über** fish/reg/nit/maniac misst — das ist kein Realismus-Defekt, sondern die gewollte Heterogenität. + Vergleichbar mit den realen Daten (eine Tisch-Momentaufnahme, fast nur regs) ist nur die Streuung + **innerhalb** des reg-Clusters. +2. **Der Gap ist modest, aber real und gerichtet.** Innerhalb reg streut die synthetische Population auf + den Preflop-Achsen **~2–3× zu breit** (vpip +0.083, pfr +0.066) und auf foldToBet **zu schmal** + (−0.033). Heißt: `Spread::DEFAULT` gibt den synthetischen regs mehr Preflop-Varianz und weniger + Fold-to-Bet-Varianz, als der echte Tisch zeigt. Das ist ein konkreter Kalibrier-Hebel (Preflop-sd + runter, die foldToBet-treibenden Parameter streuen lassen) — aber erst mit mehr Daten zu ziehen. +3. **Die Methode steht, die Daten sind dünn.** 10 Spieler, ein Tisch, ein Cluster. Die anderen Archetypen + und echte Mittelwerte je Cluster brauchen mehr Mitschriebe (`lesen/kalibrierung.py a.log b.log …`). + Der Gap-Messer ist bereit; er wird mit jedem Logfile schärfer. + +## Die Grenze, die bleibt (und warum) + +Der **Live-Outcome-Abgleich** — die Engine gegen echte Menschen laufen lassen und Sim-EV gegen +Real-Ergebnis halten (das `COINPOKER_KERN`-A/B über `betrieb/runner.py`: Entscheidung `runner.py:3391`, +Ergebnis `runner.py:553-562`, Join über `(raum, hand)`, Gegner-ID in `anfrage["_sitze"]`) — ist **nicht +offline baubar**. Er braucht den Live-Farm, echte Gegner und echtes Geld über Zeit. Das ist keine +übersprungene Aufgabe, sondern eine Ressourcen-/Infrastruktur-Grenze; die Andockpunkte stehen, der +Schalter liegt beim Live-Betrieb. Alles, was ohne ihn messbar ist, ist jetzt gebaut und gemessen. + +## Einordnung + +Stufe 4 ist damit so weit umgesetzt, wie es synthetisch/offline geht: der HUD-Gap wird gemessen (modest, +gerichtet, datenbegrenzt), nur der unausweichlich-live Teil bleibt. Siehe `ARCHITEKTUR-synthetik-labor.md`. diff --git a/docs/notizen/BEFUND-size-mix-ev-neutral.md b/docs/notizen/BEFUND-size-mix-ev-neutral.md new file mode 100644 index 00000000..396a497f --- /dev/null +++ b/docs/notizen/BEFUND-size-mix-ev-neutral.md @@ -0,0 +1,73 @@ +# Befund: EV-neutrales Size-Mix (gegen den lesbaren Pur-Argmax) + +## Problem + +Das Postflop-Sizing war **vollständig deterministisch**: `engine::postflop::best` nimmt den reinen +EV-Argmax über die drei diskreten Sizes (`FRACTIONS = [1/3, 2/3, 1]` + All-in), bei Gleichstand die +erste (passive-first). Gleicher Spot → immer exakt dieselbe Size. Zwei Kosten: + +1. **Ausnutzbarkeit (der Mathe-Punkt):** Ein Gleichgewicht *mischt* seine Sizes. Ein Pur-Argmax ist im + Prinzip lesbar — ein denkender Gegner clustert „große Size = Value" auf die Hero-Range. +2. **Online-Fingerabdruck:** konstante Size ist ein Muster (das Timing liegt getrennt im `hand/`-Layer). + +Der einzige Zufall in der Engine war die *seeded* Equity-Monte-Carlo (`Rng::seeded(spot.seed)`, +reproduzierbar) — strategisch war nichts randomisiert. + +## Lösung: mischen, aber nur unter EV-gleichwertigen Sizes + +`engine::postflop::mix_size` / `pick_mixed`: nachdem das Abstain-Gate entschieden hat, *ob* geraist wird, +wird die **Size** unter den Raises gewürfelt, deren EV innerhalb eines Bandes des besten liegt: + +``` +error = MIX_BAND * estimate.std_error * final_pot(to) +tied = { raises s : winner.ev - s.ev <= error } +pick = tied[ Rng::seeded(spot.seed ^ MIX_SALT).below(tied.len()) ] +``` + +Eigenschaften, by design: + +- **Nur Raise-Sizes mischen.** check/call/fold bleiben der deterministische Argmax (kein Aktions-Mix — + das wäre eine größere GTO-Änderung mit echtem Risiko). +- **EV-indifferent.** Das Band ist an den Standardfehler der Equity-Schätzung gekoppelt: zwei Sizes + innerhalb sind unter dem Modell nicht unterscheidbar. Darum **EV-neutral by construction** — es kann + gegen die nicht-adaptierenden Fish/Stations (unser EV-Fundament) nichts kosten und auf der Ladder kein + Minus werden. Der Gewinn entsteht nur gegen Gegner, die sonst eine feste Size lesen. +- **Seeded off `spot.seed`** (via `MIX_SALT` dekorreliert von der Equity-MC): reproduzierbar für gepaarte + Messung, aber variabel über Hände/Boards. Nur die gemischten Spots weichen vom deterministischen Lauf ab + — exakt das saubere Paarungssignal (wie bei `TURN_VETO`). +- **Mess-/Sweep-Schalter:** `SIZE_MIX=0` deaktiviert, `SIZE_MIX_BAND=<σ>` regelt die Bandbreite (read-once + OnceLock, Projektstil wie `TURN_LEAF_ITERS`). + +4 Unit-Tests (`size_mix_tests`): mischt nur unter EV-gleichwertigen Sizes, No-op ohne Gleichstand, rührt +einen Nicht-Raise-Gewinner nie an, error=0 ist deterministisch. 128/128 Lib grün. + +## Messung (gepaart vs. deterministische Baseline 24549fb+lokal, luck-korrigiert) + +| Band | GESAMT | ±95% CI | Spots gemischt | Verdikt | +|---|---|---|---|---| +| 1.0σ | −0.56 | ±0.95 | 227 | nicht unterscheidbar | +| **0.5σ** | **−0.23** | **±0.59** | **112** | nicht unterscheidbar | + +**Jede einzelne Zeile** (reg/nit/maniac/fish/station/gto/gto-small, HU + 6-max, blind/memory) ist „nicht +unterscheidbar". Die saubersten High-N-Zeilen — gto / gto-small, genau wo Unlesbarkeit zählt — sind tot +flach (0.5σ: +1.19 ±2.56 / +0.11 ±1.22, je 15 Spots gemischt). + +**Der Punktschätzer ist konstruktionsbedingt leicht negativ**, kein echtes Leck: das Mix weicht nur je +*weg* vom Argmax (nie zu einer höher bewerteten Size), also senkt es den Modell-Erwartungswert um einen +Hauch. Beweis, dass es Band-getrieben ist (nicht Gegner-Signal): das Band zu halbieren halbiert **beides** +— Bias (−0.56→−0.23) und CI (±0.95→±0.59) und Spot-Zahl (227→112). Ein Gegner-spezifisches Leck würde +sich so nicht skalieren. + +## Verdikt: 0.5σ als Default, live + +Besteht den Projekt-Maßstab („nie ein gemessenes Minus shippen"): das luck-korrigierte 95%-CI schließt +Null in jeder Zeile und gesamt ein. 0.5σ ist der Default — der sauberere ≥0-Beweis, der trotzdem in 112 +Spots echt mischt. `MIX_BAND = 0.5` in `engine::postflop`. + +## Grenze / nächste Verfeinerung (optional) + +Der Hart-Band-Uniform-Zug verschenkt per Konstruktion einen Hauch (nie zu einer besseren Size). Die +elegantere Form wäre ein **EV-gewichteter Zug** (Soft-Argmax / QRE-Temperatur über die Sizes): Masse +konzentriert auf die beste, aber auf echte Gleichstände verteilt → Bias → exakt 0, bei gleicher +Unlesbarkeit. Nicht nötig für den Beweis (0.5σ ist bereits ununterscheidbar von 0), aber der natürliche +nächste Schliff, wenn das Size-Grid ohnehin verfeinert wird (Overbet/Block-Bet aus dem Audit). diff --git a/docs/notizen/BEFUND-stage-b-turn-river-solver.md b/docs/notizen/BEFUND-stage-b-turn-river-solver.md new file mode 100644 index 00000000..21c1d36f --- /dev/null +++ b/docs/notizen/BEFUND-stage-b-turn-river-solver.md @@ -0,0 +1,168 @@ +# Befund: Stage B — der Turn+River-Subgame-Solver steht (Live-Veto zurückgenommen) + +Stage A brachte den River-Subgame-Solver (`cfr::river`), bewiesen unausnutzbar, live als defensives +Veto ([[BEFUND-river-gearbox-belief-trust.md]]). Stage B hebt denselben Bau **eine Straße tiefer**: ein +tiefenbegrenzter **Turn+River**-Solver, der den River-Gleichgewichtswert als Blatt einrechnet. Der +CFR-Kern blieb **unverändert** — er ist straßen-agnostisch, `Node::Chance` ist nativ, `Payoff::Pair` +ist eine freie Matrix. Die ganze Arbeit liegt in einem neuen Builder + einem Blatt-Vorrechner. + +## Konstruktion (Option B: tiefenbegrenzter Turn, River-Gleichgewichtswert als Blatt) + +Der Turn ist nicht die letzte Straße — ein Turn-Showdown ist nicht exakt, sein Wert hängt davon ab, +wie der River dann spielt. Also: + +1. **Turn-Baum** = dieselbe 9-Knoten-Form wie der River (`cfr::turn_river::tree_with_leaf`), aber die + drei „erreiche den River"-Terminals tragen eine **Blatt-Wert-Matrix** `V[i][j]` statt eines + statischen Showdowns: Heros erwartete Chips über den *ganzen* River, gegeben die Turn-Buckets (i,j). +2. **Blatt-Wert** `V`: für jede der ~44 River-Karten (`deck::without_in` über das 4-Karten-Turn-Board) + das Heads-up-River-Subgame (`cfr::river`) an den zwei möglichen River-Start-Pots lösen (Turn + durchgecheckt; gecallter Turn-Bet) und seinen **Gleichgewichtswert je River-Bucket-Paar** lesen + (`cfr::turn_river::pair_values`), dann mit Card-Removal auf die **Turn**-Buckets zurückfalten. Zwei + Matrizen: `V_check` (River via Check-Check, Pot p) und `V_bet` (via gecalltem Bet, Pot p+2s). +3. **Turn lösen** (`tree_with_leaf`) und Heros gemischte Aktion für den Bucket seiner echten Turn-Hand + lesen. + +Das ist die DeepStack/Endgame-Konstruktion, eine Straße tiefer als der bewiesene River-Bau. Wenn das +River-Blatt zum reinen Showdown entartet, ist der Turn-Baum **knotengetreu identisch** mit dem +River-Baum (Test `showdown_leaf_reproduces_the_river_tree_exactly`) — der tiefenbegrenzte Solve +degradiert also sauber zum Ein-Straßen-Solve. + +**Die Kern-Invariante (bewiesen im Test):** `pair_values`, mit der `chance`-Tabelle des Baums +gewichtet, reproduziert exakt `value_walk::root_values(Follow, hero)` — der Blatt-Wert stimmt mit dem +eigenen Wert des Solvers überein. Das ist die Korrektheitsgarantie, dass die Eltern-Straße dem Blatt +vertrauen darf. + +## Was gebaut wurde + +- **`src/cfr/turn_river.rs`** (neu): `tree_with_leaf` (Turn-Baum mit Blatt-Matrizen), `pair_values` + (Hero-Wert je Klassenpaar unter einer Strategie, Vorwärts-Walk), `solve_turn`, `TurnSolve`. + 3 Unit-Tests: Showdown-Blatt == River-Baum, pair_values liest das erzwungene Blatt, pair_values × + chance == root_values. +- **`src/engine/turn_subgame.rs`** (neu): `turn_plan`/`turn_mix` (GTO-Baseline-Mix, Mess-Eintritt), + `build_turn` (Ranges → 44-Runout-River-Blätter → Turn-Solve), `turn_exploit_plan`/`turn_exploit_mix` + (opponent-aware Gearbox: `believed_villain` + `kl_best_response`, λ aus Konfidenz — alles aus dem + River wiederverwendet, da die Turn-Knoten `v_bet`/`v_check` dieselbe Bedeutung tragen), und + `turn_fold_veto` (cash-only defensiver Veto). 5 Unit-Tests (Wiring-Guards; die EV beweist die Leiter). +- **`src/engine/river_subgame.rs`**: `believed_villain` + `lambda_from_confidence` auf `pub(crate)` + gehoben (straßen-agnostisch wiederverwendet). +- **`src/engine/decide.rs`**: `turn_fold_veto` nach dem River-Veto eingehängt, cash-gegated + (`premium <= 0`). Jeder Veto ist off-street ein No-op. +- **Mess-Schalter**: `TURN_VETO=0` deaktiviert den Live-Veto ohne Rebuild (gepaarte Messung an/aus). + +123/123 Lib-Tests grün (war 115, +8), keine Regression. + +## Ehrliche Erwartung (Offense-Grenze geerbt) + +Wie beim River kann der KL-um-GTO-Best-Response GTOs Nullmengen nicht erreichen — die dünnen +Value-Bets/leichten Calls, mit denen die Heuristik Fische ausnimmt, bleiben der Heuristik. Darum ist +der erste *live* Edge wieder **defensiv** (`turn_fold_veto`), und der Solver-Kern (`cfr::turn_river` + +`engine::turn_subgame`) ist der eigentliche Stage-B-Gewinn — getestete Infrastruktur, bereit für +Stage C / einen besseren Trigger / eine reichere Belief, **unabhängig davon, ob der Veto live bleibt.** + +## Messung (b8uwhrmvd, 2500 Deals, gepaart Veto an/aus, Memory-Modus) + +| Gegner | Veto ON | Veto OFF | ON−OFF | +|---|---|---|---| +| nemesis-1 | +80.40 | +88.17 | **−7.77** | +| nemesis-2 | +97.73 | +102.99 | **−5.26** | +| nemesis-3 | +18.86 | +3.12 | **+15.74** | +| fish | +138.73 | +137.31 | +1.42 | +| reg | +23.47 | +14.91 | +8.56 | +| nit | +50.56 | +48.93 | +1.63 | +| maniac | +90.91 | +71.42 | **+19.49** | + +Oracle- und Blind-Zeilen sind ON==OFF bit-identisch (der Veto wirkt nur über den Memory-Read) — die +Paarung ist sauber. Netto **+33 bb/100** über alle sieben, auf der realistischen Archetyp-Population +(fish/reg/nit/maniac) sogar **Pareto-positiv** (alle vier besser), größter Einzelgewinn genau dort, wo +der Read-getriebene Over-Call blutet (maniac +19.49, reg +8.56) plus das nemesis-3-Loch (+15.74). + +## Verdikt: Verdrahtung ZURÜCK, Infrastruktur BLEIBT + +Trotz des positiven Mittels **regressiert der Veto die zwei härtesten Nemeses** (−7.77 / −5.26). +Wurzel (im Code lokalisiert): der Veto feuert auf einen konfidenten Under-Bluff-Read, aber +`believed_villain` liest nur `fold_to_bet` + `aggression` (eine *gepoolte* Postflop-Aggression). Bei +nemesis-1/-2 unterschätzt der Memory-Read ihre **Turn**-Aggression → die geglaubte Villain wirkt wie +ein Under-Bluffer → der Veto foldet einen *guten* Call. Das ist exakt die Belief-Lücke aus +[[DESIGN-reichere-belief-gearbox.md]] (keine Per-Street-Aggression, kein Sizing-Signal). + +Eisernes Gesetz, Präzedenz: der River-Veto (Stage A) ging **nur** live, weil er **keine** Nemesis +regressierte („seine eine Kante ohne Kosten"). Dieser Turn-Veto hat Kosten auf den zwei Gegnern, deren +Robustheit am teuersten erkämpft wurde ([[nemesis-station-mislabel]]: −414 → +83). Ein +Populations-Mittelgewinn rechtfertigt keine Nemesis-Regression. Darum: + +- **`decide.rs`-Verdrahtung zurückgenommen** (River-Veto-only wie vor Stage B; die zwei Turn-Zeilen + raus, Kommentar erklärt warum). +- **`cfr::turn_river` + `engine::turn_subgame` bleiben** — getestet (8 Unit-Tests, 123/123 Lib grün), + `pub`, bereit zur Wieder-Verdrahtung. Das ist der eigentliche Stage-B-Gewinn. + +## Was den Live-Turn-Veto freischaltet + +Der Veto wird live, sobald die Belief seinen Misfire auf nemesis-1/-2 verliert — d.h. wenn +`believed_villain` **Turn/River-spezifische Aggression** trägt statt der einen gepoolten (der billigste +erste Schritt aus [[DESIGN-reichere-belief-gearbox.md]]: `river_aggression`/`turn_aggression` als +Profile-Feld, auf dem Memory-Pfad gefüllt). Dann liest der Veto die aggressiven Nemeses korrekt als +Bluffer und foldet ihren Call nicht mehr — die maniac/reg/nemesis-3-Gewinne (+19/+8/+16) sollten +bleiben, die −7/−5-Kosten verschwinden. Das ist die nächste disziplinierte Rung, nicht ein Hack am +Trigger. + +## Nachtrag (2026-11-12): Per-Street-Aggression gebaut, Turn-Veto wieder verdrahtet + +Die freischaltende Rung ist umgesetzt. Die Belief trägt jetzt street-spezifische Aggression: + +- **`Profile`**: zwei neue Felder `turn_aggression` / `river_aggression` (`Option`, Default `None`). +- **`believed_villain`**: Signatur nimmt die effektive Aggression als Parameter statt die gepoolte + `profile.aggression` intern zu lesen. Der Turn-Aufrufer (`turn_subgame`) übergibt + `turn_aggression.or(aggression)`, der River-Aufrufer (`river_subgame`) `river_aggression.or(aggression)`. + `None` → GTO-Default. `fold_to_bet` bleibt gepoolt (ein Signal nach dem anderen). +- **`sim::memory`**: Per-Street-Zähler für Turn/River (aggressiv vs. passiv=call+check, Folds raus wie + beim gepoolten Nenner); `read()` füllt die zwei Felder (`None` bis die Straße eine Aktion sah → der + Fallback greift). Neuer Test `per_street_aggression_splits_the_turn_from_the_pooled_read`: ein + Flop-Checker/Turn-Barreler liest gepoolt 0.5, aber turn_aggression 1.0. +- **Nicht-brechende Pflege**: vier volle `Profile`-Literale ergänzt (`decode_villain` → None, nicht auf + dem Wire; `sample.rs` PRIOR None + `shrink` zieht sie durch; `mark.rs` WEAK_PLAYER None + `with_mark`). +- **`decide.rs`**: Turn-Veto wieder hinter dem River-Veto verdrahtet, cash-only. + +**Hypothese (zu beweisen):** die Per-Street-Aggression liest nemesis-1/-2 als Turn-Barreler → höhere +`bluff_prob` → die geglaubte Villain-Bet-Range wirkt bluffig → hero callt → der Veto foldet den guten +Call *nicht* mehr. Die maniac/reg/nemesis-3-Gewinne sollten bleiben (ihre Over-Call-Blutung ist +read-getrieben, unabhängig vom Aggression-Split). **Achtung Nebenwirkung:** der River-Veto nutzt jetzt +auch `river_aggression` statt der gepoolten — die Messung muss bestätigen, dass nemesis-3 (das +River-Loch) dadurch nicht beschädigt wird. + +### Verdikt (bdl3scmw1, 600 Deals, gepaart Veto an/aus, Memory-Modus) + +Die Hypothese ist **falsifiziert**. Per-Street-Aggression hat den nemesis-1-Misfire **nicht** geheilt — +sie hat ihn verschlimmert: + +| Gegner | ON−OFF (gepoolt, b8uwhrmvd) | ON−OFF (per-street, bdl3scmw1) | +|---|---|---| +| nemesis-1 | −7.77 | **−25.93** (schlechter) | +| nemesis-2 | −5.26 | +2.33 (geheilt) | +| nemesis-3 | +15.74 | +28.62 | + +Per-Street-Aggression heilt **nemesis-2** (der aggressive Turn-Barreler wird jetzt korrekt als Bluffer +gelesen, der Veto foldet seinen Call nicht mehr), aber **nemesis-1 regressiert tiefer**. nemesis-1 ist +*value-heavy* (bluff 0.068, call_margin 0.215): kein Turn-Barreler, sondern ein Gegner, dessen Turn-Bets +echt sind. Dort ist die **Wurzel nicht die Belief-Granularität**, sondern der **draw-BLINDE Turn-Bucket**: +der Veto foldet Bluff-Catcher, deren *River*-Equity die aktuelle-Stärke-Bucketleiter unterschätzt. Ein +defensiver Turn-Fold verwirkt realisierte Equity, die der River-Veto nie verwirkt (der River ist final — +da gibt es keine verworfene Draw-Equity mehr). Das braucht **draw-aware Turn-Bucketing** oder die +Offline-/Value-Function-Form, keinen Live-Fold-Veto. + +### Entscheidung + +- **Turn-Veto-Verdrahtung in `decide.rs` zurückgenommen** (River-Veto-only; Kommentar dokumentiert beide + Messungen und die Draw-Blind-Bucket-Wurzel). Eisernes Gesetz: zwei Messungen sind sich einig, dass + nemesis-1 regressiert → kein Live-Shipping. +- **Per-Street-Belief-Code BLEIBT** (Profile-Felder, `sim::memory`-Zähler, `believed_villain`-Signatur, + `TURN_LEAF_ITERS`-Knopf). Er ist auf der breiten Ladder **bewiesen neutral** (Benchmark busqe4obv: + GESAMT **+0.06 ±0.12 bb/100**, nur 8 Fish-Memory-Entscheidungen angestupst — bit-identisch sonst), also + live-inert ohne den Turn-Veto und schadet dem River-Veto nicht. Er ist getestete Belief-Infrastruktur + für Stage C / die draw-aware Turn-Form. +- **`cfr::turn_river` + `engine::turn_subgame` BLEIBEN** wie zuvor — getestete Stage-B-Infrastruktur. + +**Lehre:** Der Turn-Veto-Misfire hat *zwei* Wurzeln, nicht eine. Die Belief-Granularität (nemesis-2) war +nur die halbe Geschichte; die andere Hälfte (nemesis-1) ist die Nicht-Finalität des Turns + draw-blinde +Buckets. Ein Live-Fold-Veto kann die zweite prinzipiell nicht lösen — nur ein Value-Function-Blatt, das +die verworfene Draw-Equity einpreist, kann das. Darum ist die nächste Turn-Rung Stage C (draw-aware +Bucketing + gesampelte Runouts), nicht ein weiterer Belief-Patch. diff --git a/docs/notizen/BEFUND-stufe0-uebung.md b/docs/notizen/BEFUND-stufe0-uebung.md new file mode 100644 index 00000000..e1ac2268 --- /dev/null +++ b/docs/notizen/BEFUND-stufe0-uebung.md @@ -0,0 +1,99 @@ +# Befund: Stufe 0 — Live-Test auf Übung (Pivot weg von Nur-Synthetik) + +**Datum:** 2026-11-12 +**Anlass:** Owner-Pivot — „vllt hören wir mal auf synthetisch zu testen sondern machen live a/b +tests pro tisch! erstmal übung dann micro stakes?". Die Synthetik-Leiter hat Grenznutzen erreicht +(die letzten drei Änderungen — Size-Mix neutral, Turn-Veto Verlierer, Bluff-Veto neutral), und +fixe Archetypen messen weder die Sim-to-Real-Lücke noch Anti-Exploitation gegen echte Menschen. + +## Kernbefund: der Übung-Loop existiert schon komplett + +Stufe 0 war **kein Bau von Null** — der ganze Live-Loop ist da und spielgeld-sicher: + +- `betrieb/spielplan.py`: `scratch/spielplan.json {"modus":"uebung"}` lässt den Läufer selbst + **Practice-Games**-Tische öffnen (`REITER = {uebung:"Practice Games", cash:"Cash Games"}`), bis + zur Tischzahl auffüllen, und **nie** einen Cash-Tisch mischen (`modus_passt`). +- Harte Spielgeld-Sperre: `spielplan.erzwinge_uebung` + `umgebung.nur_uebung()` zwingen den + wirksamen Modus auf Übung, selbst wenn der Plan auf Cash steht (Vorfall 6.11.). +- `betrieb/runner.py`: liest Zustand → entscheidet über den Rust-Kern (`hand/entscheidung.py` → + `decide`) → protokolliert jeden Zug/jede Hand ins Schattenlog → optional klicken (`--act`); ohne + `--act` läuft er im **Schatten** (sagt an, du klickst). Not-Aus: `scratch/stop`. +- `betrieb/statistik.py`: jede fertige Hand mit `netto_bb` in `haende.jsonl`; bb/100, Raten, + Sitzungen, **95-%-Spannen je Format** (`spanne_bb_pro_100`), und `bestes_format` deklariert einen + Sieger nur, wenn eine 95-%-Spanne ganz über den anderen liegt (Überlappung = Zufall). +- **A/B-Haken für Stufe 2 existiert:** `je_format` gruppiert Hände nach `h["format"]` und vergleicht + die Gruppen mit dem Nicht-Überlappungs-Test. Zwei Arme = zwei `format`-Tags, mehr braucht es für + den Vergleich nicht. + +## Was fehlte und jetzt gebaut ist + +1. **Gesamt-bb/100 mit 95-%-Konfidenzband** (`betrieb/statistik.py`): die Spanne gab es nur je + Format, nicht auf der Kopfzahl „gewinnt die Engine?". `_gruppe` liefert jetzt `unten`/`oben` + (aus `spanne_bb_pro_100`), `md_aus` zeigt die Gesamt-Spanne. Spec: `tests/statistik_spec.py` + (21 grün, Regression ok). + +2. **`betrieb/stufe0.py` — der Übung-Bericht**: liest den Statistik-Speicher (+ optional das + Schattenlog) und urteilt nur, was die Stichprobe hergibt: + - **Schlägt es die Null?** bb/100 mit 95-%-Spanne; `unten > 0` = gewinnt mit 95 %. Überlappt die + Spanne 0, ist es Zufall (dieselbe Regel wie `bestes_format`). + - **Spielstil sane?** VPIP/PFR/Showdown im Band; `PFR > VPIP` oder VPIP-Extrem = degeneriert. + - **Loop-Gesundheit:** Abbrüche (Invariantenbruch), Timeouts (Uhr abgelaufen → Server-Sitout), + Abstains (Kern ohne Aktion). 0 Abbrüche + 0 Timeouts = der Loop trägt. + - **Sim-to-Real** (optional `--erwartung LO HI`): live-Spanne gegen ein Synthetik-Band. + Spec: `tests/stufe0_spec.py` (16 grün). + +## Trockenlauf gegen 190 Archiv-Hände (`archiv/lauf`, Cash) + +``` +Hände: 190 bb/100: -266.8 95-%-Spanne: -560.5 bis +26.9 -> noch Zufall (überlappt 0) +Stil: VPIP 31 % PFR 24 % Showdown 16 % -> sane +Loop: Abbrüche 0 Timeouts 0 Abstains 0 Sitouts 79 -> sauber +Sim-to-Real (80..300): schlechter als erwartet (live-Spanne unter dem Band) +``` + +Lehren: (a) der Bericht funktioniert gegen echte Daten; (b) **190 Hände beweisen nichts** — die +Spanne ist ±290 bb/100; (c) der Stil ist sane (vernünftiger TAG), der Loop sauber. Der +Sim-to-Real-Minus ist hier NICHT belastbar: es sind Cash-Archivhände (kein sauberer Übung-Lauf) +und viel zu wenige. + +## Runbook — so läuft Stufe 0 + +```bash +# 1. Übung-Plan setzen (Spielgeld, 1 Tisch zum Anfang) +echo '{"modus":"uebung","tische":1}' > betrieb/scratch/spielplan.json + +# 2. Läufer starten. Erst im Schatten (sagt an, du klickst), dann mit --act (klickt selbst). +python3 betrieb/runner.py # Schatten +python3 betrieb/runner.py --act # klickt selbst; scratch/stop hält das Klicken an + +# 3. Bericht lesen (jederzeit, auch während des Laufs) +python3 betrieb/stufe0.py --shadow betrieb/scratch/shadow.jsonl +``` + +**Bestanden** = Loop sauber (0 Abbrüche/Timeouts) UND Stil sane. Die bb/100 ist auf Übung +zweitrangig (Spielgeld-Gegner ≠ Micro-Population); sie zählt erst ab Stufe 1 (Micro). + +## Varianz — die ehrliche Grenze (gilt für Stufe 1/2) + +Live kann **keine Karten paaren** wie die Synthetik-Leiter — die volle Varianz (σ ≈ 90 bb/100) +bleibt. Zum Auflösen einer A/B-Differenz Δ auf 95 % (gepaart nicht möglich): + +| Δ bb/100 | Hände je Arm | mit All-in-EV + AIVAT (~−60 %) | +|---|---|---| +| 5 | ~250 000 | ~90 000 | +| 20 | ~15 000 | ~5 500 | +| 50 | ~2 500 | ~900 | + +Folge: die 1–9-bb/100-Deltas der Synthetik sind live **nicht** auflösbar. Stufe 2 (A/B) nur für +**grobe strukturelle** Hebel (Δ≳20), und davor die **All-in-EV/AIVAT-Varianzreduktion** bauen +(die Hand trägt heute nur `netto`, keine All-in-Equity — das ist der nächste Infra-Schritt). + +## Offen / nächste Schritte + +- **Stufe 1 (Micro):** `micro_only` kappt Stakes auf BB 0.10; dann ist die live bb/100 die eigentlich + wertvolle Zahl (gewinnt es echt + Sim-to-Real gegen die Micro-Population). +- **All-in-EV/AIVAT live:** `game.poker_odds`/`lesen/evchop.py` haben die Equity; sie noch nicht in + die Hand-Zeile. Das ist die Varianzreduktion für Stufe 2. +- **A/B-Arm-Verdrahtung:** zwei Engine-Configs pro Tischprozess + `format`-Tag je Hand; der + Vergleich steht schon (`je_format` + Nicht-Überlappung). +- Noch offen aus der Synthetik: `bluff_veto` (neutral, uncommitted in `src/engine/`) → reverten. diff --git a/docs/notizen/BEFUND-turnier-pipeline-steht.md b/docs/notizen/BEFUND-turnier-pipeline-steht.md new file mode 100644 index 00000000..b03c1762 --- /dev/null +++ b/docs/notizen/BEFUND-turnier-pipeline-steht.md @@ -0,0 +1,76 @@ +# Befund: die Turnier-Pipeline steht schon — end-to-end, grün, gemessen + +Auftrag war „Turnier-Pipeline angehen" (nach `AUFTRAG-modi.md`, der sagt *„Code kann beides noch +nicht"*). **Die Prämisse ist überholt.** Zwei Recon-Durchläufe (Rust + Python) und die vorhandenen +Turnier-Spezifikationen zeigen: die Pipeline ist über die ganze Kette gebaut und läuft grün. Nicht +neu bauen — belegen und die echten Restlücken benennen. + +## Die Kette steht (mit Beleg) + +| Glied | Ort | Stand | +|---|---|---| +| Log → Turnierlage lesen (Level/Blinds/Ante/Payout/Feld/Bubble/Late-Reg/Stack) | `lesen/turnier.py:141-222` | **gebaut** | +| `tournament`-Feld der Anfrage bauen | `lesen/turnier.py:260-292` (`kern_feld`) + `lesen/spot_from_log.py:512-513,573` | **gebaut** | +| Wire-Decode → `Turnierlage` | `src/wire/decode_tournament.rs:35-47` | **gebaut** | +| Live-Routing zu ICM | `src/wire/respond.rs:23` (`decide_with(spot, Some(lage))`) | **gebaut** | +| ICM-Engine (Harville, Risikoprämie, Bubble-Verengung) | `src/icm/{lage,harville,risk}.rs` | **gebaut + getestet** | +| Decide-Brücke reicht Feld unverändert durch | `entscheiden/decide.py:90-91` | **gebaut** | +| Klon-Turniermodus (Level/Ante/Late-Reg/Bust/Payout/Bubble/Pause) | `mock/turnier.py` | **gebaut** | +| UI: Modus sichtbar (Level/Blinds/Feld/Bezahlt/Bubble) | `sicht/ansicht.py:85-100` | **gebaut** | +| An-/Abmeldung, Verwaltung, Zeitplan | `lesen/turnier_*.py`, `betrieb/turnierzyklus.py`, `betrieb/turnierplan.py` | **gebaut** | + +## Beleg: die Spezifikationen laufen grün (2026-11-11) + +Rust: `tests/pipeline_tournament.rs`, `tests/icm_bubble.rs` (Bubble enger als Cash, null=Cash +bitgleich, kaputt→invalid, unbepreisbar→ABSTAIN, Feld > Harville-Grenze gesampelt). + +Python (direkt gefahren): + +``` +turnier_anfrage_spec 14 OK (1 skip) turnier_anmeldung_spec 65 OK +turnier_spec 33 OK turnier_verwaltung_spec 13 OK +turnier_cash_only_spec 6 OK turnierliste_spec 7 OK +turnier_info_spec 11 OK turnierplan_spec 20 OK +turnier_phantom_spec 4 OK turnierzyklus_spec 20 OK +turnier_registering_spec 7 OK turniertisch_spec 12 OK +``` + +Nur zwei Dateien nicht grün — **beide aus demselben reinen Windows-Grund**, nicht aus Turnier-Logik: +`turnier_e2e_spec` (12) und `turnier_zug_buehne_spec` (5) brechen an +`AttributeError: module 'socket' has no attribute 'AF_UNIX'` — die Bühnen-Brücke nutzt Unix-Domain- +Sockets, die es unter Windows nicht gibt. Auf Linux (dem Hof) laufen sie. + +Der Brief wird im Code selbst messgestützt widerlegt: `lesen/turnier.py:13-28` zeigt, dass es **kein** +Feld `isTournament` gibt (die 629 Treffer sind `isTournamentPrizePoolOverlay`), die echten Felder +kommen aus `dynamic_lobby_data`/`prize_list`/`rank_list`. + +## Die echten Restlücken (nicht die Pipeline) + +1. **K-Poker-Aktionsausführung** — der **eine** echte offene Bolzen. Die Übersetzung steigt bei einem + Live-K-Poker-Zug ohne gemessenes Menü aus (`lesen/spot_from_log.py:493-496`, „Tastentabelle nicht + gemessen"); `kpokerActions` ist im Bestand immer null. `hand/kpoker.py` hat die Slot-Tabelle aus der + Client-IL abgeleitet (`KPokerBetKeys`/`KPokerActionPanel`, Fold/Check/Call/AllIn/Bet-Slots) und + **korrigiert den Brief**: das Menü bedient man per **Maus-Klick auf Panel-Slots**, nicht per Taste. + Aber die Tabelle ist **nicht in `hand/act.py` verdrahtet** (`ZU_TAT` kennt nur FOLD/CHECK/CALL/RAISE). + Buildbar ist das Scaffold (Slots verdrahten + Übersetzung ein Menü erzeugen lassen); **messen** muss + man die Menü-Struktur an einem echten K-Poker-Tisch, bevor es echtes Geld anfasst (10-s-Uhr). +2. **Turnier-Tischdynamik** (Tischwechsel, Sitzwechsel, `tournamentCurrentStage`) — im Klon nur als + **Annahme** modelliert (`mock/turnier.py:19-24`); kein echter Mitschrieb zum Gegenprüfen. +3. **`spieler_tisch`** (Spieler am eigenen Tisch) aus dem Bestand unauflösbar → immer `None` + (`lesen/turnier.py:40,200`). Klein. + +## Die eigentliche Frontier für „beste Turnier-Engine" + +Nicht die Pipeline — die **Stärke-Messung fehlt.** Cash hat die Nemesis/Archetyp-Leiter; Turnier hat +nur **Korrektheits**-Tests (Bubble enger als Cash), **keine EV-Leiter**, die beweist, dass die ICM-Linie +*gewinnt*. Es gibt kein Rust-Turnier-Sim-Binary (`src/bin/` ist cash/exploit). `entscheiden/turnier_ +benchmark.py` kalibriert die Prämie, misst aber keine Turnier-bb/100 gegen ein Feld. Das ist der +Measure-First-Grundstein, den „Weltklasse im Turnier" braucht — das Gegenstück zur Cash-Leiter. + +## Einordnung + +Für Turniere ist die Engine **operativ bereit** (Standard-NLHE-Turniere: Log→ICM→Entscheidung→Klon→UI +→Anmeldung, grün). Offen sind: K-Poker-Ausführung (ein gemessener Bolzen), Tischdynamik-Gegenprobe +(operativer Mitschrieb) und — am wichtigsten — eine **Turnier-Stärke-Leiter**, ohne die man die +ICM-Linie weder beweisen noch verbessern kann. Der Cash-Live-Gap (−311, [[BEFUND-liveabgleich-stufe4- +live]]) gilt für Turniere genauso: Innen-EV ist noch nicht Außen-EV. diff --git a/docs/notizen/BEFUND-turnier-staerke-leiter.md b/docs/notizen/BEFUND-turnier-staerke-leiter.md new file mode 100644 index 00000000..e817a22b --- /dev/null +++ b/docs/notizen/BEFUND-turnier-staerke-leiter.md @@ -0,0 +1,174 @@ +# Befund: die Turnier-Stärke-Leiter steht — die ICM-Linie GEWINNT in Geld + +Cash hat die Nemesis/Archetyp-Leiter, die jede Live-Änderung in bb/100 beweist. Turnier hatte bisher +nur **Korrektheits**-Tests (Bubble enger als Cash) und keine **EV-Leiter** +([[BEFUND-turnier-pipeline-steht]], „die eigentliche Frontier"). Dieser Befund baut sie und fährt die +ersten Zahlen: **die ICM-Linie schlägt die Chip-EV-Linie in 10 von 11 Spots (bewiesen, gepaart) — und +die Leiter findet sofort das eine LECK**, einen vorbestehenden Kalibrierfehler der Open-Jam-Weitung +(`cover-short` −12.5 ICM$/100), unabhängig vom ICM-Nash-Solver des Repos bestätigt. Genau dafür ist +eine Stärke-Leiter da: beweisen, was gewinnt, und messgenau zeigen, was nicht. + +## Das Instrument (`sim::turnier_leiter`, `bin/turnier_leiter`) + +Turniere werden um **Preise** gespielt, nicht um Chips, und Chips werden **nicht-linear** in +Preis-Equity umgerechnet (Harville/ICM). Eine Linie, die Chips gewinnt, kann an der Bubble Geld +verlieren. Also muss die Messung in **ICM-Geld** werten, nicht in Chips: + +- Ein **Szenario** ist ein Heads-up-Pot (Hero + ein Gegner, beide auf `stack_bb`) eingebettet in ein + Feld fester Fremdstacks unter einer Preisstruktur (Pool = 100). +- Jede Hand wird **zweimal** gespielt, auf denselben Karten und Sitzen: die **ICM-Linie** + (`decide_with(spot, Some(lage))`) und die **Cash-Linie** (Chip-EV, `decide`). Die Chips bewegen sich + nur am Tisch (am Free-Table erhalten); das Feld bepreist die Bewegung per Harville. +- Kennzahl: die **gepaarte Kante** ICM$(an) − ICM$(aus) je 100 Hände. Dieselben Karten für beide + Linien → das Board-Glück hebt sich in der Differenz auf, übrig bleibt die reine Entscheidungs-Kante. +- Urteil pro Szenario: ✓ **gewinnt** (95-%-Intervall ganz > 0), · **neutral** (|Kante| ≤ CI, das + Anker-Ziel), ✗ **Leck** (Intervall ganz < 0 → Eiserne Regel: zurückrollen + Befund). + +**Kein Mischen von Wissen.** Der Chip-Pfad und der ICM-Pfad teilen EINEN Mathe-Kern; nur die +`Turnierlage` schaltet die Preis-Bewertung dazu. Die Cash-Leiter ist bit-identisch unberührt +(`decide_with(spot, None)` == `decide(spot)` — die `lage` hängt nur am privaten `Table`, nicht am +weit konstruierten `HandSetup`). + +## Beweis (SEED 0x5EED_0001, 4000 Austeilungen/Szenario, Pool = 100) + +2500 Austeilungen/Szenario (die Intervalle sind jetzt scharf): + +``` + szenario typ kante ±ci an aus urteil + wta A +0.000 0.000 -1.744 -1.744 · neutral (Anker exakt) + deep-flat A +13.745 4.926 -32.752 -46.497 ✓ gewinnt + soft-bubble B +31.035 7.982 -49.739 -80.774 ✓ gewinnt + hard-bubble B +38.883 11.375 -78.623 -117.506 ✓ gewinnt + hard-bubble-reg B +14.900 5.191 -11.334 -26.234 ✓ gewinnt + final-table B +12.984 4.653 +5.802 -7.182 ✓ gewinnt + jam-vs-nit J +24.030 3.428 +47.878 +23.847 ✓ gewinnt + jam-vs-folder J +20.353 1.497 +63.536 +43.183 ✓ gewinnt + covered-maniac K +32.192 8.182 -100.373 -132.566 ✓ gewinnt (klassischer ICM-Spot) + covered-reg K +12.611 4.367 -3.024 -15.635 ✓ gewinnt + cover-short K -12.468 3.486 -10.350 +2.118 ✗ LECK (Open-Jam-Über-Weitung) +``` + +**Bilanz:** 10 von 11 Szenarien ✓ gewinnen signifikant (die Maniac-Bubbles jetzt klar, `hard-bubble` ++38.9, `soft-bubble` +31.0), der Anker `wta` exakt 0. Die ICM-Linie gewinnt also überall, wo sie soll +— **mit genau einer Ausnahme:** `cover-short` ist ein echtes **LECK** (−12.5 ±3.5, Intervall ganz unter +0). Das ist der Deckel-Fall (Hero deckt als Big Stack, `jam_width_factor` weitet den Open-Jam), und es +ist **kein Zufall** — der ICM-Nash-Solver des Repos zeigt genau dort die Über-Weitung (Jam 68 % vs Nash +65 %, s. u.). Die Leiter tut also, wofür sie gebaut ist: sie hat als Erstes einen realen, vorbestehenden +Kalibrierfehler der Open-Jam-Weitung gefunden und beziffert. + +## Nachtrag (2026-11-12): das Leck ist geschlossen — Tiefen-Gatung + +Schritt #1 unten umgesetzt und auf der Leiter bewiesen. `jam_depth_gate` (risk.rs): volle Open-Jam- +Weitung ≤ `JAM_DEPTH_FULL`=12bb, null ≥ `JAM_DEPTH_NONE`=22bb, linear dazwischen; angewandt auf den +**Überschuss** `1 + (w−1)·gate` in decide.rs. Der Hebel hängt an **Heros effektiver Tiefe**, nicht an +der Prämie — ein tiefer Deckler weitet nicht mehr, ein Kurzstack-Jammer voll. 2500 Austeilungen: + +``` + szenario typ kante ±ci an aus urteil + cover-short K +0.179 0.367 +2.297 +2.118 · neutral (war -12.5 LECK) + cover-6bb K +0.089 0.336 +1.848 +1.758 · neutral + cover-12bb K +0.329 0.407 +1.560 +1.231 · neutral + jam-vs-nit J +24.030 3.428 +47.878 +23.847 ✓ gewinnt (unberührt) + jam-vs-folder J +20.353 1.497 +63.536 +43.183 ✓ gewinnt (unberührt) + covered-maniac K +32.192 8.182 -100.373 -132.566 ✓ gewinnt + covered-reg K +12.611 4.367 -3.024 -15.635 ✓ gewinnt + covered-12bb K +36.383 9.685 -97.064 -133.447 ✓ gewinnt +``` + +- **`cover-short` −12.5 → +0.18 ±0.37 (neutral)**: Leck zu. Auch `cover-6bb`/`cover-12bb` neutral. +- **Keine Regression**: Kurzstack-Jams (`jam-vs-nit/folder`) und gedeckte Kurzstacks (`covered-*`) + bleiben grün — das Gate greift nur an Heros Tiefe, nicht an der Gegenseite. +- **10bb-Nash bit-identisch**: `jam_depth_gate(10)=1.0` per Konstruktion; `turnier_benchmark`-Call- + Verengung 8bb −13, 10/12/15bb ±0 unverändert; Jam ±1. +- **115 Lib-Tests grün** (inkl. `jam_depth_gate_full_when_short_zero_when_deep_and_monotone`). + +Die Leiter hat ihren ersten Leck **gefunden UND dessen Schließung bewiesen** — der volle Mess-Zyklus, +wurzelrichtig und kalibrier-erhaltend. Nichts committed (Freigabe ausstehend). + +## Lesart + +- **Anker halten.** `wta` (winner-take-all): Kante **+0.000 ± 0.000** — ICM-Equity IST der Chip-Anteil, + also berechnet die Engine dort exakt **null** Prämie und weicht nicht ab. Der sauberste Beweis, dass + das Getriebe cash-neutral bleibt, wo es neutral sein muss. +- **Bubble/Final-Table gewinnen.** Wo die Prämie beißen soll, gewinnt sie: gegen einen ausbalancierten + Reg (`hard-bubble-reg`, `final-table`) ist die Kante signifikant > 0 — das ist die **Prämie selbst**, + nicht der Exploit. Die Engine foldet marginale Spots, die Chip-EV callt, und bewahrt Preis-Equity. +- **Jam-Druck gewinnt.** `jam-vs-nit`/`jam-vs-folder`: die Open-Jam-Weitung (`jam_pressure`) stiehlt + breiter, wenn der Deckel an der Bubble enger callen muss — signifikant > 0. +- **Maniac-Bubbles brauchen Masse.** Gegen einen All-in-Maniac ist die Varianz hoch (±30 bei 300); erst + mit 4000 Austeilungen trennt sich das Intervall von der Null. Die Kante zeigt positiv, das CI + bestätigt (oder nicht) — siehe Tabelle. + +## Unabhängige Bestätigung: der ICM-Nash-Solver des Repos + +Es gibt bereits einen **echten ICM-Nash-Push/Fold-Solver** im Baum (`entscheiden/turnier_referenz.py:131-170`, +`nash_icm_push`: fiktives Spiel über 169 Handklassen, in Harville-Geld bewertet; HU 10bb/10bb, Payout +50/30/20, dritter Stack 2/5/9bb). `entscheiden/turnier_benchmark.py` fährt die Engine dagegen. Die +Schwellen stimmen schon **auf ~3pp** überein: + +| dritter Stack | Jam % (Nash / Engine) | BB-Call % (Nash / Engine) | +|---|---|---| +| 2bb | 97 / 99 | 14 / 13 | +| 5bb | 79 / 77 | 18 / 18 | +| 9bb | 65 / **68** | 22 / 22 | + +Das ist die **unabhängige** Bestätigung der neuen Leiter: ein zweites, andersartiges Instrument (ein +Nash-Solver, kein gepaarter EV-Vergleich) sagt dasselbe — die ICM-Linie liegt richtig. **Und beide +zeigen auf dieselbe schwächste Stelle:** bei 9bb jammt die Engine 68 % gegen Nash 65 % — **3pp zu +breit**. Genau das ist das `cover-short`-Szenario der Leiter (Hero deckt als Big Stack, `jam_pressure` +weitet den Open-Jam), das als einziges ein **LECK** ist (−12.5 ±3.5 bei 2500). Zwei Instrumente +treffen dieselbe Diagnose: die **Open-Jam-Weitung (`jam_width_factor`) ist der schwächste Punkt der +ICM-Kalibrierung** — der erste konkrete, messgestützte Angriffspunkt, den die Leiter liefert. (Recon: +`side-session-notes/.../RECON-icm-nash-anker.md`.) + +## Was das (noch) NICHT misst — die ehrlichen Grenzen + +1. **Symmetrische Tischstacks.** Hero und Tischgegner starten beide auf `stack_bb`; die ICM-Spannung + kommt aus dem **Feld**. Echte ICM-Spots leben oft von **asymmetrischen** Tischstacks (Decker vs. + Gedeckter). Das braucht per-Sitz-Stacks im `Table` (heute ein `stack_bb` für alle) — der nächste + Ausbau der Leiter. +2. **Heads-up am Tisch.** Zwei Spieler am Tisch halten die Chip-Erhaltung sauber (hero_net = −opp_net). + Mehrweg-Tische (3+) bewegen mehrere Stacks und brauchen alle Netto-Ergebnisse aus `run()`. +3. **Keine ICM-Glückskorrektur.** Die gepaarte Differenz auf denselben Karten hebt das Board-Glück + schon fast auf; eine AIVAT-artige ICM-Kontrolle (wie `sim::luck` fürs Chip-bb/100) ist der + Varianz-Feinschliff, nicht gebaut. +4. **Innen-EV, nicht Außen-EV.** Wie beim Cash-Live-Gap (−311, [[BEFUND-liveabgleich-stufe4-live]]) + misst die Leiter die Engine gegen ihr eigenes Gegner-Modell. Der Beweis ist „die ICM-Linie schlägt + die Chip-Linie im Modell", nicht „am echten CoinPoker-Tisch". + +## Nächste Schritte (messgestützt, priorisiert) + +1. **✓ ERLEDIGT (s. Nachtrag oben): Open-Jam-Weitung nachkalibriert — die #1-Baustelle, −12.5 → neutral.** + Wurzel-Hypothese: `jam_width_factor` (risk.rs:138) hängt NUR an der ICM-Prämie, **nicht an Heros + absoluter Tiefe**. Im `cover-short`-Spot deckt Hero mit 40bb und riskiert (über `jam_pressure`s + Caller-Logik) ~30bb — wird aber so breit geweitet wie ein 10bb-Jammer. Eine Weitung, die 30bb + riskiert, wird gecallt und bestraft → −12.5 ICM$/100. Der Nash-Abgleich sieht dieselbe Über-Weitung + bei kurzen Stacks (68 vs 65 @ 9bb), ist aber bei 10bb noch sauber. **Darum ist die Tiefen-Gatung die + wurzelrichtige UND kalibrier-erhaltende Lösung:** die Weitung auf kurze effektive Stacks (≤ ~15bb) + begrenzen, sodass die 10bb-Nash-Kalibrierung unberührt bleibt und nur der tiefe Deckler aufhört, + Müll zu jammen. Prüfstand: die Leiter (`cover-short` → ≥ 0, `jam-vs-nit/folder`/`covered-*` bleiben + grün) UND `entscheiden/turnier_benchmark.py` (Jam-% bleibt auf Nash). Ein **eigener, gemessener + Zyklus** auf `src/icm/risk.rs` — nicht in diesem Befund, der das Instrument und den Befund liefert. + Der Tiefen-Sweep (`cover-6/8/12bb`) in der Batterie lokalisiert, ab welcher Tiefe die Gatung greifen + muss. +2. **Den Nash-Solver als Rust-Anker einziehen.** `nash_icm_push` (`entscheiden/turnier_referenz.py`) + liefert eingefrorene Gold-Standard-Schwellen (Jam 97/79/65, Call 14/18/22, ±3pp) für HU 10bb/10bb, + 50/30/20. Ein Rust-Test, der die Engine diese reproduzieren lässt, macht die Kalibrierung + regressionsfest — das Gegenstück zu `tests/cfr_nash.rs` (Chip-Nash) für ICM. +3. **Asymmetrie breiter fahren.** `covered-maniac`/`covered-reg` gewinnen klar; die Deck-Richtung + (`cover-short`) ist die Baustelle. Mehr Decker/Gedeckter-Tiefen (6/12/20bb) kartieren, wo ICM hilft. + +## Einordnung + +Die Turnier-Pipeline war **operativ** fertig ([[BEFUND-turnier-pipeline-steht]]); jetzt ist sie auch +**messbar stark**. Zum ersten Mal gibt es eine Zahl, die beweist, dass die ICM-Linie gewinnt — das +Measure-First-Fundament, ohne das „Weltklasse im Turnier" nur eine Behauptung ist. Die Leiter ist das +Werkzeug, mit dem jede künftige ICM-Änderung (asymmetrische Stacks, Mehrweg, Future-Game, Push/Fold- +Nash) bewiesen wird — wie die Nemesis-Leiter fürs Cash-Spiel. + +## Werkzeug + +- `src/sim/turnier_leiter.rs` — `Szenario`, `TurnierMessung`, `messen`, `lage_of`, `icm_score` + (+ 5 Unit-Tests: Pool-Erhaltung, Bust ~0, ICM-Konkavität, WTA-Anker, Determinismus). +- `src/sim/table.rs` — `play_hand_icm` + `lage` am privaten `Table` (cash-neutral). +- `src/bin/turnier_leiter.rs` — die Szenario-Batterie (Anker / Bubble / Jam-Druck). diff --git a/docs/notizen/BEFUND-zwillings-tor-stufe2.md b/docs/notizen/BEFUND-zwillings-tor-stufe2.md new file mode 100644 index 00000000..59436b94 --- /dev/null +++ b/docs/notizen/BEFUND-zwillings-tor-stufe2.md @@ -0,0 +1,104 @@ +# Befund: das Zwillings-Tor steht — und zeigt sofort, was die Leiter verbarg: die Engine verliert gegen Balancierte + +Stufe 2 des synthetischen Labors ist gebaut: das **Zwillings-Tor** (`sim::twin_gate`, `bin/twin_gate`), +die Accept/Reject-Regel, die die bb/100-Leiter ersetzt. Ein Kandidat darf nur ausliefern, wenn er auf +**drei Achsen gleichzeitig** nicht verliert. + +## Die drei Achsen + +1. **OFFENSE — Population-EV.** Die Memory-Winrate gegen die gezogene Population (`sim::exploit_pop`): + die Engine muss ein *variiertes* Feld weiter ausbeuten. +2. **ROBUSTHEIT — der Boden (ein kleines EGTA).** Ein Populations-Gegner antwortet mit seiner besten + Antwort = er wählt den einen Archetyp, gegen den die Engine am schlechtesten läuft (linear ⇒ das + Minimum über die Archetypen ist die schlechteste Mischung). Die EV gegen diesen Archetyp ist der + Boden; kein Change darf ihn senken. Das ist die Achse, die einen Fix fängt, der Fische zerlegt, aber + gegen Balancierte blutet. +3. **DEFENSE — River-Exploitability.** Ein exakter Best-Response-Abstand auf einer festen Batterie von + River-Subgames (`sim::exploit_river`); kein Change darf ihn heben. Die Achse, die einen Change fängt, + der EV kauft, indem er unbalanciert/ausbeutbar spielt. + +`Gate::passes` ist der reine Vergleicher zwischen Baseline und Kandidat, mit Toleranzen in Rauschgröße. +Damit wird „nie einen Verlierer ausliefern" rigoros und mehrachsig. + +## Erste Messung (`twin_gate`, Population 40×300, Archetypen 1500, River 8000 Iter.) + +``` +OFFENSE Population-EV (Memory) +32.24 bb/100 (Exploitation-Lücke +17.16) + +ROBUSTHEIT EV je Archetyp (Memory): + reg -8.44 ±39.50 + nit +51.06 ±18.06 + maniac +114.27 ±63.26 + fish +123.32 ±34.50 + gto -22.80 ±28.47 + gto-small -35.25 ±30.80 <- BODEN + +DEFENSE River-Exploitability (5 Spots): Mittel 77.03, Max 145.83 bb/100 +``` + +## Was das zeigt (ehrlich) + +1. **Das Tor findet sofort die wahre Schwäche.** In ihrem *realistischen* Modus (Read erschlossen, nicht + Oracle geschenkt) ist die Engine gegen alle drei balancierten/soliden Gegner **im Minus**: reg −8, + gto −23, gto-small −35. Sie verdient ihr Geld bei Fisch/Maniac/Nit (+51 bis +123) und **verliert es + an die Balancierten zurück**. Das ist exakt die dokumentierte Wurzel (`gto-overdefense-root`, + `BEFUND-gto-ueberdefense`, der reg −2.53 aus Stufe 0) — jetzt als harte Bodenachse, nicht als Fußnote. + +2. **Die Leiter verbarg genau das.** Dort laufen die GTO-Szenarien mit **Oracle-Read** + (`benchmark.rs`: `balanced(..., ReadMode::Oracle)`). Mit geschenktem perfektem Read spielt die Engine + gegen Balancierte näher an GTO und das Minus verschwindet. Das Tor nimmt den Oracle weg und macht den + realen Verlust sichtbar: die bb/100-Leiter konnte den gefährlichsten Change — einen, der gegen + Balancierte überadjustiert — gar nicht als Verlierer erkennen. + +3. **Defense ist ein relativer Riegel, keine Absolutzahl.** 77 bb/100 mittlere Exploitability klingt + hoch, ist aber ein Artefakt der absichtlich polaren Batterie mit winzigen 4-Combo-Ranges (ein falscher + Bucket = großer Swing). Der Zweck ist der Vergleich Baseline↔Kandidat auf **derselben** Batterie, nicht + die Behauptung „die Engine ist 77 bb ausbeutbar". Gegen die balancierte GTO-Schwäche ist zu erwarten, + dass ein guter Defensiv-Fix diese Zahl **senkt**. + +## Nachtrag: Vollbudget-Lauf (`TwinBudget::default()` — Population 48×400, Archetypen 4000, River 12000) + +Die erste Messung lief bewusst mager. Nachgefahren bei vollem Produktionsbudget, um den „Rauschen"- +Vorbehalt zu schließen: + +``` +OFFENSE Population-EV (Memory) +43.95 bb/100 (Exploitation-Lücke +18.98) + +ROBUSTHEIT EV je Archetyp (Memory): + reg -17.66 ±23.58 + nit +42.92 ±11.71 + maniac +45.31 ±36.50 + fish +126.85 ±20.67 + gto -36.25 ±19.19 <- BODEN + gto-small -25.93 ±17.55 + +DEFENSE River-Exploitability (5 Spots): Mittel 77.03, Max 145.83 bb/100 +``` + +**Die Schlussfolgerungen sind budget-robust — nicht Artefakte der mageren Erstmessung.** Offense +43.95 +trifft den Stufe-0-Wert (+18.98 Lücke) auf die Kommastelle. Die CIs sind enger (±12–37 statt ±18–63), und +die *Richtung* hält unverändert: alle drei Balancierten im Minus (reg −18, gto −36, gto-small −26), +Fisch/Maniac/Nit stark positiv. Der Boden wandert nur innerhalb des Rauschens von gto-small auf **gto +−36.25** — es bleibt ein balancierter GTO-Spieler, die dokumentierte Over-Defense-Wurzel. Die +River-Exploitability (exakte Best Response, deterministisch) ist bitidentisch (77.03/145.83), wie erwartet, +da nur die Iterzahl stieg und die Batterie fix ist. Der „nimm TwinBudget::default()"-Vorbehalt ist damit +eingelöst: das volle Budget bestätigt das Leck, statt es zu widerlegen. + +## Grenzen (ehrlich) + +- **Rauschen.** Bei 1500 Austeilungen waren die Boden-CIs breit (±28–63); bei vollem Budget (oben) + schrumpfen sie auf ±12–37. Die *Richtung* (balanciert = negativ, ausbeutbar = stark positiv) war schon + mager robust und ist es voll erst recht; die *Magnituden* sind jetzt belastbar. +- **Varianzreduktion fehlt noch.** Das Tor misst heute *absolute* EV je Build; ein regressionsfester + Boden sollte die *Differenz* Kandidat−Baseline mit gemeinsamen Zufallszahlen (common random numbers, + gleicher Seed) messen, damit das Rauschen paart und die Toleranz unter die CI fällt. Nächster Ausbau + der Messachse (das `sim::aivat`-Werkzeug ist dafür bereits bewiesen). +- Die GTO-Archetypen sind solver-getrieben und dominieren die Laufzeit; darum die magere Deal-Zahl. + +## Einordnung + +Das Tor ersetzt die Leiter nicht nur formal — es hätte genau die Fehlmessung verhindert, die diese +Arbeit lange blockierte: ein Change, der auf der Leiter „gewinnt", weil er Dummies überfittet oder weil +der Oracle-Read das Balanciert-Leck zudeckt. „Nie einen Verlierer ausliefern" heißt ab jetzt: **Boden +hält, Exploitability steigt nicht, Population-EV hält** — alle drei. Siehe +`ARCHITEKTUR-synthetik-labor.md`, Stufe 2. diff --git a/docs/notizen/ROADMAP-mathematik.md b/docs/notizen/ROADMAP-mathematik.md new file mode 100644 index 00000000..8bb1bb8e --- /dev/null +++ b/docs/notizen/ROADMAP-mathematik.md @@ -0,0 +1,92 @@ +# Mathematik-Landkarte: Arsenal, Getriebe, Tiefe, Messschicht + +Der Anspruch: beste Engine der Welt für Cash **und** Turnier, durch Forschungs-Mathematik, nicht durch +Heuristik-Schrauben. Diese Karte trennt ehrlich, was **bewiesen** ist, was **verdrahtet** ist und was +**fehlt**. Sie ist der rote Faden; jede Zeile nennt ihren Beweis-Status. + +## Eiserne Gesetze (gelten über allem) + +1. **Nie einen Verlierer ausliefern.** Ein gemessenes Minus → Rückbau + Befund. (Stage A live: −43 → + zurückgebaut, `BEFUND-river-solver-balanced-vs-exploitable`.) +2. **Jede Live-Änderung auf der Leiter beweisen** — gepaart, 95 %, glückskorrigiert. +3. **An der Wurzel angreifen**, nicht am Symptom. +4. **Cash- und Turnierwissen trennen** (ICM/Bubble vs Rake/Deepstack) über einem Mathe-Kern. + +## 1. Das Arsenal — die Primitive (alle als Primitiv bewiesen, `--lib` grün) + +| Primitiv | Modul | Was | Beweis | +|---|---|---|---| +| Bayes-Posterior | `exploit::posterior` | Beta-Posterior je Gegner-Tendenz, Konfidenz | Tests grün | +| Value of Information | `exploit::thompson` | Thompson/Bandit, Gamma-Sampling | Tests grün | +| MaxEnt-Ranges | `exploit::maxent` | Jaynes: unvoreingenommenste Range unter Momenten | Entropie-Maximum-Test | +| QRE / Temperatur | `cfr::qre` | Logit-Gleichgewicht, Temperatur aus Beobachtung | interpoliert uniform↔Nash | +| Krone: KL-Best-Response | `cfr::kl_br` | σ\* ∝ σ_GTO·exp(Q/λ), sichere Ausnutzung | λ-Sweep-Test | +| Kelly-Sizing | `sizing::kelly` | log-Wachstum, fraktioniert | Wachstums-Tests | +| AIVAT-Varianzreduktion | `sim::aivat` | Kontrollvariate, kreuzangepasstes β | 17× auf Testdaten | +| River-Subgame-Solver | `engine::river_subgame` | card-exakt, CFR+ | **0.0 Exploitability** vs korrekte Überzeugung | +| Anytime-Konfidenzfolge | `sim::sequential` | zeituniforme CI, Früh-Stopp | Miscoverage 0.008 ≤ 0.050 unter Peeking | + +**Das Arsenal ist vollständig auf Forschungsniveau.** Was fehlt, ist nicht ein weiteres Primitiv — +sondern das Getriebe, das sie zu **einer** Engine koppelt. + +## 2. Das Getriebe — die Kopplungen (der eigentliche Rückstand) + +Jede Zeile ist eine geschlossene Schleife, die ein Primitiv an den Live-Pfad hängt. **Fast keine ist +verdrahtet** — hier liegt die ganze offene Arbeit. + +| Schleife | von → nach | Zweck | Status | +|---|---|---|---| +| **Belief** | `posterior` → Range-Belief → `river_subgame` | Solver gegen *vermutete* Gegnerrange statt symmetrisch | **fehlt** — die Wurzel des −43-Befunds | +| **Vertrauen (Krone)** | `posterior::confidence` → λ → `kl_br` | starker Read → weit ausnutzen, schwacher → nahe GTO | **fehlt** | +| **Temperatur** | beobachtete Reads → `qre::fit_temperature` → Gegnermodell | Rationalität des Gegners schätzen | **fehlt** | +| **Modus** | Cash/Turnier → Terminalwert-Karte (Rake vs ICM) + `kelly`↔ICM | modusgerechte Endwerte | teilweise (Terminalwerte ja, ICM-Kopplung nein) | +| **Messung: AIVAT (β)** | `aivat` → Live-Benchmark | optimaler Kontrollvariaten-Koeffizient | **gemessen: toter Hebel** — β=1 schon nahe-optimal, β\* ein Wash (`BEFUND-bench-kontrollvariate-beta`) | +| **Messung: AIVAT (Signal)** | per-Node-Baseline → Benchmark | stärkeres ρ, nicht besseres β | **fehlt** — der echte Hebel (volle AIVAT-Korrektur) | +| **Messung: Früh-Stopp** | `sequential` → Benchmark | peeken + stoppen ohne Verzerrung | Primitiv bewiesen; Einhängen offen | + +**Die Belief- und Vertrauens-Schleife ist der höchste Hebel:** sie verwandelt den bewiesenen, aber +stillgelegten River-Solver in echte Live-EV — *sicher*, weil der KL-Riegel ihn nie wieder gegen einen +Fisch ausbalancieren und nie gegen einen Unbekannten überausnutzen lässt. + +## 3. Die Tiefe — gelöste Spielbäume + +| Straße | Status | +|---|---| +| Preflop | **steht**: voll-breiter CFR+ (`cfr::mod`), Push/Fold + Open/3-Bet, 1–4 Defender, Multiway-Abtastung | +| River (Stage A) | **gelöst + bewiesen** (0.0), aber *nicht live* (Belief fehlt) | +| Turn+River (Stage B) | fehlt — card-exaktes Turn→River-Subgame | +| Flop→ (Stage C) | fehlt — volle Postflop-Tiefe mit Abstraktion | +| Multiway postflop | fehlt (preflop gibt es, postflop heads-up-only) | + +## 4. Die Messschicht — ist der Maßstab selbst Weltklasse? + +Heute: gepaarte/antithetische Stichproben + Glückskorrektur (β=1) + 95 %-CI + Regressions-Gate. +**Solide, aber nicht Weltklasse.** Die Weltklasse-Teile sind gebaut, teils noch nicht eingehängt: + +- **AIVAT-β im Gate — gemessen erledigt, toter Hebel.** β=1 ist schon nahe-optimal; kreuzangepasstes + β\* ist ein Wash (±1–4 %, teils schlechter), weil `Var(net−β·luck)` am Minimum flach ist + (`BEFUND-bench-kontrollvariate-beta`). NICHT eingehängt. Der lebende Hebel ist nicht β, sondern ρ: + ein **stärkeres Kontrollsignal** — die volle AIVAT-Baseline an jedem Chance-/Gegnerknoten statt nur + All-in-Glück. Das hebt die Deckelung 1−ρ² und ist noch ungebaut. +- **Zeituniformer Früh-Stopp** — `sim::sequential` steht und ist bewiesen; einhängen heißt: nach jeder + Austeilung peeken, stoppen sobald entschieden → Gate-Zeit drastisch runter bei gültiger Fehlerrate. +- **Exploitability über River hinaus** — heute River-only mit harter Vollrange; fehlen: Turn/Multiway + und realistische (verengte) Ranges, damit die zweite Hälfte der Weltklasse-Bewertung vollständig ist. +- **Gegner-Holdout** — alles gegen feste Bots = in-sample; ein Holdout-Pool gegen Overfit fehlt. + +## 5. Der Optimizer — die späte Schicht + +Für Hyperparameter (Form der λ-Konfidenz-Abbildung, ρ der Konfidenzfolge, Sizing-Gitter): **Bayesian +Optimization / CMA-ES, nicht Genetik.** AIVAT-betrieben (billige, rauscharme Zielfunktion), +exploitability-bewacht (kein Bot-Overfit). Aber: die λ-Abbildung wird **hergeleitet** (Informations- +theorie), nicht gesucht — der Optimizer ist Feinschliff, kein Ersatz für die Herleitung. **Zuletzt.** + +## Reihenfolge nach gemessenem Hebel + +1. **Belief + Vertrauens-Getriebe** (`posterior`→Range→`river_subgame`, `confidence`→λ→`kl_br`): macht + den bewiesenen River-Solver *sicher live*. Der eine Umbau, der −43 in echtes Plus dreht. Höchster Hebel. +2. **Messschicht auf Weltklasse**: `sequential` einhängen (Früh-Stopp) + **volles AIVAT-Signal** (per-Node- + Baseline, nicht β-Tuning — das ist gemessen tot) → schnellerer, engerer Maßstab für alles danach. +3. **Stage B** (Turn+River), sobald Belief/Vertrauen am River bewiesen sind. +4. **Exploitability-Ausbau** (Turn/Multiway/realistische Ranges) + Holdout-Pool. +5. **Optimizer** (BO/CMA-ES) ganz zuletzt. diff --git a/docs/notizen/RUNBOOK-liveabgleich-ab.md b/docs/notizen/RUNBOOK-liveabgleich-ab.md new file mode 100644 index 00000000..0aea9103 --- /dev/null +++ b/docs/notizen/RUNBOOK-liveabgleich-ab.md @@ -0,0 +1,64 @@ +# Runbook: das kontrollierte Live-A/B (COINPOKER_KERN an/aus) fahren + +Dies ist der eine noch offene Schritt von Stufe 4. **Es fehlt kein Code** — Harness, Arm-Trennung und +Signifikanz-Test stehen und sind getestet. Was fehlt, sind **Hände unter beiden Armen**: eine geldechte +Live-Session gegen echte Gegner, die nur der Betrieb am Tisch erzeugt. Dieses Runbook ist die genaue +Befehlsfolge dafür — danach rechnet das Werkzeug das Urteil in einer Zeile. + +## Das Prinzip + +Zwei Arme, sonst alles gleich (derselbe Farm, dieselben Stakes, dieselbe echte Population, abwechselnd): + +- **AN** — mit dem Engine-Kern: `COINPOKER_KERN` zeigt auf `target/release/rechner(.exe)`. +- **AUS** — die Baseline ohne die zu prüfende Änderung: `COINPOKER_KERN` zeigt auf das Baseline-Binary + (z. B. ein Build des Kerns ohne den neuen Read / die neue Stufe, oder der vorige getaggte Kern). + +Jeder Arm schreibt seine Hände in einen EIGENEN Statistik-Ordner über `STATS_DIR` (die Trennung ist +schon da, `betrieb/statistik.py:258`). So entstehen zwei saubere `haende.jsonl`. + +## Die Befehle + +Arm AN (eine Session am Tisch laufen lassen): + +```bash +COINPOKER_KERN="$PWD/target/release/rechner.exe" \ +STATS_DIR="$PWD/archiv/ab/arm_an" \ +python3 betrieb/runner.py # normaler Lauf; so lange spielen, bis genug Hände zusammen sind +``` + +Arm AUS (eigene Session, Baseline-Binary, eigener Ordner): + +```bash +COINPOKER_KERN="$PWD/target/release/rechner_baseline.exe" \ +STATS_DIR="$PWD/archiv/ab/arm_aus" \ +python3 betrieb/runner.py +``` + +Auswerten (sobald beide Arme Hände haben): + +```bash +python3 lesen/liveabgleich.py --ab archiv/ab/arm_an/haende.jsonl archiv/ab/arm_aus/haende.jsonl +``` + +Das druckt bb/100 je Arm mit 95-%-Intervall, die Differenz und das Urteil +(schlägt/verliert/unentschieden, `ab_vergleich`). + +Alternativ, falls beide Arme in EIN Log schreiben und die Hände ein Feld `kern` ("an"/"aus") tragen: + +```bash +python3 lesen/liveabgleich.py --ab-log archiv/ab/haende.jsonl kern +``` + +## Wie viele Hände? + +Die Winrate-Streuung ist groß. Für ein belastbares Urteil bei einer Kante von ~30–50 bb/100 braucht es +grob **einige Tausend Hände je Arm** (das 95-%-Intervall der Differenz schrumpft mit 1/√n). Der reale +190-Hand-Schnappschuss (`archiv/lauf/`) hat allein ein Intervall von fast 600 bb/100 — zu wenig für den +A/B. Das Werkzeug sagt „kein signifikanter Unterschied", bis die Arme dick genug sind; es überzeichnet nie. + +## Warum das hier endet + +Alles bis zu diesem Punkt ist gebaut, getestet und (auf vorhandenen Daten) gefahren. Der letzte Schritt +ist kein Programmier-, sondern ein Betriebsschritt: echtes Geld, echte Gegner, Zeit am Tisch. Den löst der +Mensch im Betrieb aus, nicht die Werkbank. Siehe `BEFUND-liveabgleich-stufe4-live`, +`ARCHITEKTUR-synthetik-labor.md` (Stufe 4). diff --git a/docs/notizen/STAND-und-fahrplan-live.md b/docs/notizen/STAND-und-fahrplan-live.md new file mode 100644 index 00000000..4247cef3 --- /dev/null +++ b/docs/notizen/STAND-und-fahrplan-live.md @@ -0,0 +1,61 @@ +# Stand & Fahrplan: der Weg zum echten Game + +Stand 2026-11-12. Dieser Zettel fasst zusammen, was steht, und den kürzesten sicheren Weg vom jetzigen +Punkt zu Echtgeld am Tisch. Einzelbefunde liegen daneben in `docs/notizen/BEFUND-*.md`. + +## Wo wir stehen + +**Die Maschine läuft live.** Der mechanische Pfad (sitzen → lesen → entscheiden → klicken) ist auf +Windows bewiesen: Hero saß, spielte, gewann **+1320** in einem Live-Lauf. Die Sitz-Reserve-Race (30 s +TTL) ist gefixt und live bestätigt; der Läufer ist von 35–53 s/Loop auf ~Millisekunden runter (nativer +Toolhelp+PEB-Prozessleser statt WMI, echo=False fire-and-forget). +→ `BEFUND`e: Seating-TTL, Winproc-Speedup. + +**Die Engine ist mathematisch dicht.** Die großen Lecks sind gefixt und auf der Synthetik-Leiter +bewiesen (gepaart, 95 %-CI, luck-korrigiert, nie ein Verlierer geshippt): +- GTO-Überverteidigung (MDF-Boden über-defendete gegen Balancierte) — trust-aware über Postflop- + Aggression statt Preflop-Breite. +- Nemesis-Station-Fehllesung (−414 bb/100) — Klassifikation auf Aggression gated + konfidenz- + gewichtetes Stations-Trust. +- River-Overbet-Defense-Loch — River-Subgame-Solver als Cash-only Fold-Veto (nemesis-3 −26,6 → +0,6). +- Dazu: ICM-Turnier-Linie (schlägt Chip-EV), EV-neutrales Size-Mix, Stage-A River-Solver. + +**Das Messwerkzeug ist fertig (dieser Lauf).** Um live schnell zu lernen, nicht zu raten: +- **Live-A/B** temporal (ein-Prozess-Engine verbietet simultan): `COINPOKER_ARM` markiert Hand+Zug, + `statistik.je_arm` + `liveabgleich.ab_aus_log(feld="arm")` geben das Welch-Urteil je Arm. +- **Insights**: `lesen/einblick.py` aggregiert `zuege.jsonl` nach Street/Position/Klasse/Grund, je Arm. +- **All-in-EV** (`lesen/allin_ev.py`): ersetzt bei All-in vor dem River den Board-Wurf durch die + equity-gewichtete EV — mittelwerttreu, Varianz runter, A/B ~60 % schneller signifikant. Preflop über + seed-deterministischen Monte-Carlo (`eval7.equity_mc`/`score7`, bewiesen gleichwertig zum Ground- + Truth). Linse `netto_bb(ev=True)` / CLI `--ev`; roh bleibt überall Vorgabe. + → `BEFUND-allin-ev.md`, `BEFUND-live-ab-einblick.md`. + +**Was fehlt:** der *nachhaltige* 12-Tisch-Live-Lauf. Alles ist einzeln bewiesen, aber noch nie als +Ganzes stundenlang live gelaufen. Das ist der nächste Schritt — kein weiterer Bau. + +## Fahrplan — 3 Stufen zum echten Game + +**Stufe 1 — Übung (Spielgeld), das Gate.** 12 Tische, `TEMPO=schnell`, ein paar Stunden. Zweck: beweisen, +dass der Loop als Ganzes trägt, bevor Geld im Spiel ist. `betrieb/scratch/spielplan.json`: +`{"modus":"uebung","tische":12,...}`, dann `python3 betrieb/runner.py --act`. Urteil: +`python3 betrieb/stufe0.py --shadow archiv/lauf/shadow.jsonl`. **Grün = 0 Abbrüche, 0 Timeouts**, saner +Stil (VPIP/PFR plausibel). Das ist der einzige harte Riegel vor Echtgeld. + +**Stufe 2 — Micro-Echtgeld, gedeckelt.** `spielplan.json`: `modus:"cash"`, `micro_only:true` (kappt die +Stakes auf `MICRO_MAX_BB`), kleines `budget` + Verlustdeckel. Derselbe Runner. `micro_only` ist genau der +„schnell testen ohne Risiko"-Schalter. + +**Stufe 3 — iterieren mit dem Werkzeug.** Live bb/100 mit 95 %-CI verfolgen; `einblick.py` je Arm lesen; +eine Engine-Stellschraube temporal A/B-en (`COINPOKER_ARM`), die All-in-EV (`--ev`) dämpft das Rauschen. +Größtes Leck finden → auf der Leiter beweisen → nur Gewinner shippen. + +## Ehrlich zu Risiko & Tempo + +- **Varianz bei Micro ist brutal.** Live paart keine Karten wie die Synthetik-Leiter; A/B braucht + realistisch Δ≳20 bb/100. Die All-in-EV hilft, ersetzt aber keine Stichprobe → Tage, nicht Stunden, + für belastbare Live-Zahlen. +- **Das Timing-Modell ist nur synthetisch validiert** — VOLL=12 ist die „ruhige Decke", TEMPO=schnell + der Durchsatz-Hebel; der echte 12-Tisch-Lauf ist der erste Realtest. +- **Branch-Lage:** Dieser Zweig ist jetzt `main`. Der Live-Betrieb des Owners läuft aus dem Haupt- + Checkout (`engine/stage0-blind-ladder`, bereits vollständig in diesem Zweig enthalten); um das neue + Werkzeug dort live zu fahren, `main` in diesen Checkout ziehen. diff --git a/entscheiden/eval7.py b/entscheiden/eval7.py new file mode 100644 index 00000000..8d4077d8 --- /dev/null +++ b/entscheiden/eval7.py @@ -0,0 +1,231 @@ +#!/usr/bin/env python3 +"""Unabhaengiger 7-Karten-Evaluator und River/Runout-Equity - der GROUND TRUTH des Replay-Benchmarks. + +Bewusst NICHT die Engine (src/hand): der Benchmark benotet die Engine, also darf der Massstab nicht +aus derselben Quelle stammen. Klein, offensichtlich korrekt, mit Selbsttest (`_selftest`). + + from eval7 import equity_vs, best7, karten +""" +import gc +import itertools +import random +from collections import Counter + +RANG = {r: i for i, r in enumerate("23456789TJQKA", 2)} +FARBEN = "shdc" +VOLLDECK = [(r, s) for r in range(2, 15) for s in FARBEN] + + +def karte(t): + """'As' -> (14, 's'); robust gegen 10/Zehn-Schreibweisen.""" + t = t.strip() + return (RANG[t[0]], t[1]) + + +def karten(s): + """'As Kd' oder Liste -> [(14,'s'),(13,'d')].""" + if isinstance(s, (list, tuple)): + return [karte(x) for x in s] + return [karte(x) for x in s.split()] + + +def score5(cards): + """Vergleichbarer Wert einer 5-Karten-Hand: (Kategorie, Kicker-Liste). Groesser = besser.""" + rks = sorted((c[0] for c in cards), reverse=True) + suits = [c[1] for c in cards] + cnt = Counter(rks) + flush = len(set(suits)) == 1 + dist = sorted(set(rks), reverse=True) + sh = None + if len(dist) == 5: + if dist[0] - dist[4] == 4: + sh = dist[0] + elif dist == [14, 5, 4, 3, 2]: # Wheel A-2-3-4-5 + sh = 5 + # Raenge nach (Anzahl, Rang) ordnen -> Kicker fuer Paare/Drillinge/Full House + seen = [] + for r in sorted(rks, key=lambda r: (cnt[r], r), reverse=True): + if r not in seen: + seen.append(r) + pat = sorted(cnt.values(), reverse=True) + if sh and flush: + return (8, [sh]) + if pat == [4, 1]: + return (7, seen) + if pat == [3, 2]: + return (6, seen) + if flush: + return (5, rks) + if sh: + return (4, [sh]) + if pat == [3, 1, 1]: + return (3, seen) + if pat == [2, 2, 1]: + return (2, seen) + if pat == [2, 1, 1, 1]: + return (1, seen) + return (0, rks) + + +def best7(cards7): + """Beste 5 aus 7 (oder aus 5/6) Karten.""" + if len(cards7) <= 5: + return score5(list(cards7)) + return max(score5(list(c)) for c in itertools.combinations(cards7, 5)) + + +def equity_vs(hero, board, vils): + """Exakte Equity von `hero` (2 Karten) auf `board` (3-5) gegen bekannte Gegnerhaende `vils`. + + Enumeriert ALLE Runouts (kein Monte Carlo): am River exakt der Showdown, am Flop/Turn der + Mittelwert ueber alle Boardvervollstaendigungen. Ties zaehlen anteilig.""" + hero = karten(hero) if not isinstance(hero[0], tuple) else hero + board = karten(board) if board and not isinstance(board[0], tuple) else list(board) + vils = [karten(v) if not isinstance(v[0], tuple) else v for v in vils] + bekannt = set(hero) | set(board) + for v in vils: + bekannt |= set(v) + deck = [c for c in VOLLDECK if c not in bekannt] + miss = 5 - len(board) + won = 0.0 + n = 0 + for extra in itertools.combinations(deck, miss): + full = board + list(extra) + hs = best7(hero + full) + vstr = [best7(v + full) for v in vils] + mx = max(vstr) + if hs > mx: + won += 1.0 + elif hs == mx: + won += 1.0 / (1 + sum(1 for x in vstr if x == hs)) + n += 1 + return won / n if n else 0.0 + + +def _strasse_hoch(vorhanden): + """Hoechste Karte einer Strasse in der Rangmenge `vorhanden` (Set), oder None. Ass zaehlt auch + tief (Wheel A-2-3-4-5 -> 5).""" + if not vorhanden: + return None + r = set(vorhanden) + if 14 in r: + r.add(1) + for hi in range(14, 4, -1): + if hi in r and hi - 1 in r and hi - 2 in r and hi - 3 in r and hi - 4 in r: + return hi + return None + + +def score7(cards7): + """Direkter 7-Karten-Wert - DASSELBE vergleichbare (Kategorie, Kicker)-Tupel wie best7, nur ohne + die 21-Kombinationen-Schleife (fuer equity_mc). Gleichwertig zu best7 (Differenztest _selftest / + tests/eval7_mc_spec), aber ~5x schneller und allokationsarm.""" + cnt = [0] * 15 + farbe = {"s": [], "h": [], "d": [], "c": []} + for r, s in cards7: + cnt[r] += 1 + farbe[s].append(r) + fs = None + for s in farbe: + if len(farbe[s]) >= 5: + fs = s + break + if fs is not None: + sf = _strasse_hoch(set(farbe[fs])) + if sf: + return (8, [sf]) + vier = drei = None + paare = [] + for r in range(14, 1, -1): + c = cnt[r] + if c == 4 and vier is None: + vier = r + elif c == 3: + if drei is None: + drei = r + else: + paare.append(r) # ein zweiter Drilling zaehlt als Paar fuers Full House + elif c == 2: + paare.append(r) + if vier is not None: + kick = max(r for r in range(14, 1, -1) if cnt[r] and r != vier) + return (7, [vier, kick]) + if drei is not None and paare: + return (6, [drei, paare[0]]) + if fs is not None: + return (5, sorted(farbe[fs], reverse=True)[:5]) + sh = _strasse_hoch([r for r in range(2, 15) if cnt[r]]) + if sh: + return (4, [sh]) + if drei is not None: + ks = [r for r in range(14, 1, -1) if cnt[r] and r != drei][:2] + return (3, [drei] + ks) + if len(paare) >= 2: + hp, lp = paare[0], paare[1] + kick = max(r for r in range(14, 1, -1) if cnt[r] and r != hp and r != lp) + return (2, [hp, lp, kick]) + if paare: + p = paare[0] + ks = [r for r in range(14, 1, -1) if cnt[r] and r != p][:3] + return (1, [p] + ks) + return (0, [r for r in range(14, 1, -1) if cnt[r]][:5]) + + +def equity_mc(hero, board, vils, laeufe=6000, seed=0): + """Monte-Carlo-Schaetzung derselben Equity wie equity_vs, aber ueber `laeufe` ZUFAELLIGE + Boardvervollstaendigungen (seed-deterministisch) statt aller. Fuer den Preflop-All-in, wo die + exakte Enumeration C(48,5)=1,7M Runouts (Minuten) zu teuer ist. + + UNVERZERRT: jeder Runout ist eine gleichverteilte Ziehung aus demselben Raum, den equity_vs + vollstaendig mittelt -> E[Schaetzung] = wahre Equity, nur MC-Rauschen ~0.5/sqrt(laeufe) (bei + 6000: ~0.6 % 1-Sigma). Das erhaelt die Mittelwerttreue der All-in-EV (lesen/allin_ev): ein + unverzerrter Equity-Schaetzer gibt einen unverzerrten EV. `seed` macht es je Matchup reproduzierbar + (gleiche Karten -> gleiche Schaetzung, auch ueber A/B-Arme hinweg).""" + hero = karten(hero) if not isinstance(hero[0], tuple) else hero + board = karten(board) if board and not isinstance(board[0], tuple) else list(board) + vils = [karten(v) if not isinstance(v[0], tuple) else v for v in vils] + bekannt = set(hero) | set(board) + for v in vils: + bekannt |= set(v) + deck = [c for c in VOLLDECK if c not in bekannt] + miss = 5 - len(board) + if miss <= 0: + return equity_vs(hero, board, vils) # Board schon komplett -> exakt (ein Showdown) + rng = random.Random(seed) + stich = rng.sample # lokale Namen -> weniger Attributzugriffe je Runout + bewerte = score7 + won = 0.0 + gc.disable() # ohne GC bleibt die Schleife linear (sonst super-linear) + try: + for _ in range(laeufe): + full = board + stich(deck, miss) + hs = bewerte(hero + full) + vstr = [bewerte(v + full) for v in vils] + mx = max(vstr) + if hs > mx: + won += 1.0 + elif hs == mx: + won += 1.0 / (1 + sum(1 for x in vstr if x == hs)) + finally: + gc.enable() + return won / laeufe + + +def _selftest(): + b = karten("Ts Th 5d Tc 8c") + assert best7(b + karten("As 6h")) > best7(b + karten("Ks 4h")) # TTT+A schlaegt TTT+K + assert score5(karten("Ah Kh Qh Jh 9h"))[0] == 5 # Flush + assert score5(karten("Ah Kd Qh Jh Th"))[0] == 4 # Strasse + assert score5(karten("Ah 2d 3h 4h 5h"))[0] == 4 # Wheel + assert score5(karten("Ah Ad Ac Ks Kd"))[0] == 6 # Full House + assert score5(karten("Ah Ad Ac As Kd"))[0] == 7 # Quads + assert equity_vs("Ac Ad", "Kc 7h 2s", ["Kh Qd"]) > 0.78 # AA schlaegt Top Pair KQ klar + assert equity_vs("Kc 7s", karten("Qc 2h Kd 6d 8d"), ["Ad Qh"]) == 1.0 # River: top pair K schlaegt QQ + assert equity_vs("Ac Ad", "2h 3h 4h 5h 9s", ["6h 7h"]) == 0.0 # River: fertiger Flush schlaegt AA + + +_selftest() + +if __name__ == "__main__": + _selftest() + print("eval7 Selbsttest ok") diff --git a/entscheiden/replay.py b/entscheiden/replay.py new file mode 100644 index 00000000..a45ed402 --- /dev/null +++ b/entscheiden/replay.py @@ -0,0 +1,335 @@ +#!/usr/bin/env python3 +"""Replay-Benchmark: der EHRLICHE Postflop-Massstab aus echten Hand-Histories. + +Statt bb/100 gegen selbstgeschriebene Bots (die nur messen, ob wir die EIGENEN Fische schlagen) +treibt dieser Benchmark die ECHTE, AKTUELLE Engine ueber jede Hero-Entscheidung einer realen Session +und benotet sie gegen einen UNABHAENGIGEN Evaluator (`eval7`) auf den tatsaechlich gezeigten +Gegnerkarten. Jeder Hero-Spot wird aus der Hand-History als Wire-Anfrage rekonstruiert (board, pot, +toCall, Stacks, history, Profile) und neu entschieden - so misst der Benchmark FIXES, nicht nur die +alte Session. + +Vier Masse: + * TREUE: reproduziert die Re-Decision die geloggte Linie? (Rekonstruktion korrekt?) + * EV-VERLUST: wo der Gegner zeigt - foldet die Engine +EV-Calls weg / callt sie -EV-Spots? (bb) + * EQUITY-BIAS: Engine-Equity minus WAHRE Equity (negativ = unterschaetzt -> Overfold-Wurzel) + * FOLD/MDF: Fold-gegen-Bet je Street gegen die Minimum-Defense-Frequency + + COINPOKER_EXPORT=/pfad/zur/session.md python3 entscheiden/replay.py + COINPOKER_KERN=.../target/release/rechner.exe # Engine-Binary (Default: target/release/rechner) +""" +import json +import os +import re +import sys +from collections import Counter + +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +import decide +from eval7 import equity_vs, karten + +HERO = "mmintel" +RANG = {"A": "ACE", "K": "KING", "Q": "QUEEN", "J": "JACK", "T": "TEN", "9": "NINE", "8": "EIGHT", + "7": "SEVEN", "6": "SIX", "5": "FIVE", "4": "FOUR", "3": "THREE", "2": "TWO"} +FARBE = {"s": "SPADES", "h": "HEARTS", "d": "DIAMONDS", "c": "CLUBS"} +STREETS = ["PREFLOP", "FLOP", "TURN", "RIVER"] + + +def _wire_card(t): + return {"rank": RANG[t[0]], "suit": FARBE[t[1]]} + + +def _wire_cards(txt): + return [_wire_card(x) for x in txt.split()] + + +def _board_dict(board_cards): + """5-Karten-Board (Textliste) -> Wire-Board-Dict bis zur erreichten Street.""" + d = {} + if len(board_cards) >= 3: + d["FLOP"] = [_wire_card(c) for c in board_cards[:3]] + if len(board_cards) >= 4: + d["TURN"] = [_wire_card(board_cards[3])] + if len(board_cards) >= 5: + d["RIVER"] = [_wire_card(board_cards[4])] + return d + + +# ---------------------------------------------------------------- HH-Parser +ACT_RE = re.compile(r'^(\S+): (posts small blind|posts big blind|posts the ante|folds|checks|' + r'bets|calls|raises)(?: \$?([0-9.]+))?(?: to \$?([0-9.]+))?', re.M) + + +def parse_hand(block): + """MD-Handblock -> dict mit allem fuer die Rekonstruktion, oder None wenn unbrauchbar.""" + hid = block.split(" ", 1)[0].lstrip("#") + mhole = re.search(r'Hero Hole Cards:\*\* `([^`]+)`', block) + mhh = re.search(r'```text\n(.*?)```', block, re.S) + if not mhole or not mhh: + return None + hero_cards = mhole.group(1).split() + hh = mhh.group(1) + + # Engine-Entscheidungen (Street, board, pot, toCall, action) in Dokumentreihenfolge + dec_re = re.compile(r'`(PREFLOP|FLOP|TURN|RIVER)` \| board=`([^`]*)` \| ' + r'pot=\$([0-9.]+) toCall=\$([0-9.]+) \| \*\*([A-Z]+)\*\* \| ' + r'eq=([0-9.]+|None) \| (.*)') + decisions = [{"street": m.group(1), "board": m.group(2).split(), "pot": float(m.group(3)), + "to_call": float(m.group(4)), "action": m.group(5), + "eq": None if m.group(6) == "None" else float(m.group(6)), "reason": m.group(7)} + for m in dec_re.finditer(block)] + if not decisions: + return None + + # VPIP/Hands je Name aus der Players-Zeile + prof = {} + for mm in re.finditer(r'S\d+ (\S+) \(\$[0-9.]+, VPIP (\d+)%/(\d+)h\)', block): + prof[mm.group(1)] = {"vpip": int(mm.group(2)) / 100.0, "hands": int(mm.group(3))} + + # Sitze, Stacks, Button, Blinds, Showdown-Karten aus der HH + seats = {} # name -> seat + stacks = {} # name -> start stack + for mm in re.finditer(r'^Seat (\d+): (\S+) \(\$([0-9.]+) in chips\)', hh, re.M): + seats[mm.group(2)] = int(mm.group(1)) + stacks[mm.group(2)] = float(mm.group(3)) + mb = re.search(r'Seat #(\d+) is the button', hh) + button = int(mb.group(1)) if mb else None + mbb = re.search(r'\(\$([0-9.]+)/\$([0-9.]+)', hh) + sb, bb = (float(mbb.group(1)), float(mbb.group(2))) if mbb else (0.01, 0.02) + shown = {} + for mm in re.finditer(r'^(\S+): shows \[([^\]]+)\]', hh, re.M): + shown[mm.group(1)] = mm.group(2).split() + for mm in re.finditer(r'^Seat \d+: (\S+) showed \[([^\]]+)\]', hh, re.M): + shown.setdefault(mm.group(1), mm.group(2).split()) + + if HERO not in seats: + return None + return {"hid": hid, "hero_cards": hero_cards, "hh": hh, "decisions": decisions, + "prof": prof, "seats": seats, "stacks": stacks, "button": button, + "sb": sb, "bb": bb, "shown": shown} + + +def _seat_name(seats): + return {v: k for k, v in seats.items()} + + +def reconstruct(hand): + """Laeuft die HH-Aktionen durch, baut vor jeder Hero-Aktion den Wire-Spot und paart ihn + mit der naechsten geloggten Entscheidung. Gibt Liste von (spot_dict, decision) zurueck.""" + seats, stacks = hand["seats"], hand["stacks"] + bb = hand["bb"] + hero_seat = seats[HERO] + lines = hand["hh"].splitlines() + street = "PREFLOP" + street_contrib = Counter() + cum = Counter() + folded = set() + history = [] + decisions = iter(hand["decisions"]) + out = [] + + def snapshot(dec): + """Baut die Wire-Anfrage fuer die aktuelle Hero-Entscheidung.""" + board = dec["board"] + to_call = dec["to_call"] + hero_stack = round(stacks[HERO] - cum[HERO], 4) + legal = (["FOLD", "CALL"] + (["RAISE"] if hero_stack > to_call else [])) if to_call > 0 \ + else ["CHECK"] + (["RAISE"] if hero_stack > 0 else []) + vils = [] + for name, seat in seats.items(): + if name == HERO: + continue + v = {"seat": seat, "stack": round(stacks[name] - cum[name], 4), + "folded": seat in folded} + if name in hand["prof"]: + v["profile"] = dict(hand["prof"][name]) + vils.append(v) + req = {"variant": "NLHE", "bigBlind": bb, "seats": len(seats), "heroSeat": hero_seat, + "heroCards": _wire_cards(" ".join(hand["hero_cards"])), + "board": _board_dict(board), "street": dec["street"], + "pot": dec["pot"], "toCall": to_call, "heroStack": max(hero_stack, 0.0), + "legalActions": legal, "allowedSizes": [], + "villains": vils, "history": list(history), + "seed": (int(hand["hid"]) + STREETS.index(dec["street"]) * 7 + len(out)) & 0xFFFFFFFF} + if hand["button"]: + req["buttonSeat"] = hand["button"] + return req + + for ln in lines: + if ln.startswith("*** FLOP"): + street = "FLOP"; street_contrib = Counter() + elif ln.startswith("*** TURN"): + street = "TURN"; street_contrib = Counter() + elif ln.startswith("*** RIVER"): + street = "RIVER"; street_contrib = Counter() + elif ln.startswith("*** SHOW DOWN") or ln.startswith("*** SUMMARY"): + break + m = ACT_RE.match(ln) + if not m: + continue + name, verb, amt, raise_to = m.group(1), m.group(2), m.group(3), m.group(4) + if name not in seats: + continue + seat = seats[name] + + # Vor Heros Aktion: Spot bauen und mit der naechsten Entscheidung paaren + if name == HERO and verb in ("folds", "checks", "calls"): + dec = next(decisions, None) + if dec is not None and dec["street"] == street: + out.append((snapshot(dec), dec)) + + # Aktion auf den Zustand anwenden + history fortschreiben + if verb == "posts small blind": + street_contrib[seat] = float(amt); cum[seat] += float(amt) + history.append({"street": "PREFLOP", "seat": seat, "action": "POST_SB", "amount": float(amt)}) + elif verb == "posts big blind": + street_contrib[seat] = float(amt); cum[seat] += float(amt) + history.append({"street": "PREFLOP", "seat": seat, "action": "POST_BB", "amount": float(amt)}) + elif verb == "posts the ante": + cum[seat] += float(amt) + history.append({"street": "PREFLOP", "seat": seat, "action": "POST_ANTE", "amount": float(amt)}) + elif verb == "folds": + folded.add(seat) + history.append({"street": street, "seat": seat, "action": "FOLD"}) + elif verb == "checks": + history.append({"street": street, "seat": seat, "action": "CHECK"}) + elif verb == "bets": + street_contrib[seat] = float(amt); cum[seat] += float(amt) + history.append({"street": street, "seat": seat, "action": "BET", "amount": float(amt)}) + elif verb == "calls": + street_contrib[seat] += float(amt); cum[seat] += float(amt) + history.append({"street": street, "seat": seat, "action": "CALL", "amount": round(street_contrib[seat], 4)}) + elif verb == "raises": + add = float(raise_to) - street_contrib[seat] + street_contrib[seat] = float(raise_to); cum[seat] += add + history.append({"street": street, "seat": seat, "action": "RAISE", "amount": float(raise_to)}) + return out + + +# ---------------------------------------------------------------- Benчmark +def run(export_path): + md = open(export_path, encoding="utf-8").read() + blocks = re.split(r'^### Hand ', md, flags=re.M)[1:] + hands = [h for h in (parse_hand(b) for b in blocks) if h] + + spots = [] # (hand, spot_dict, logged_decision) + for h in hands: + for spot, dec in reconstruct(h): + spots.append((h, spot, dec)) + + requests = [json.dumps(s[1]) for s in spots] + answers = decide.entscheide(requests) + + # --- Masse sammeln --- + treue = 0; treue_bet = 0; n_bet = 0 + foldbet = Counter(); callbet = Counter() + mdf_rows = [] + bias = [] + overfold_loss = 0.0; overcall_loss = 0.0 + overfolds = [] + for (h, spot, dec), ans in zip(spots, answers): + re_act = ans.get("action", "ABSTAIN") + re_eq = ans.get("equity") + logged = dec["action"] + # ABSTAIN zaehlt fuer die Treue als die Linie, die live gespielt wurde (Aussetzen -> Log) + if re_act == logged: + treue += 1 + facing = dec["street"] != "PREFLOP" and dec["to_call"] > 0 + if facing: + n_bet += 1 + if re_act == logged: + treue_bet += 1 + if re_act == "FOLD": + foldbet[dec["street"]] += 1 + elif re_act == "CALL": + callbet[dec["street"]] += 1 + # Ground Truth: lebende Gegner, die ihre Karten zeigen + board = dec["board"] + live_shown = [] + sn = _seat_name(h["seats"]) + for name, cs in h["shown"].items(): + if name == HERO: + continue + cc = karten(cs) + if all(c not in karten(board) and c not in karten(" ".join(h["hero_cards"])) for c in cc): + live_shown.append(cs) + if live_shown: + te = equity_vs(" ".join(h["hero_cards"]), board, live_shown) + be = dec["to_call"] / (dec["pot"] + dec["to_call"]) + ev_call = te * (dec["pot"] + dec["to_call"]) - dec["to_call"] + if re_eq is not None: + bias.append(re_eq - te) + if re_act == "FOLD" and ev_call > 1e-9: + overfold_loss += ev_call + overfolds.append((h["hid"], dec["street"], " ".join(board), dec["pot"], + dec["to_call"], round(te, 3), round(be, 3), re_eq, + " / ".join(" ".join(cs) for cs in live_shown), ev_call)) + elif re_act == "CALL" and ev_call < -1e-9: + overcall_loss += -ev_call + mdf_rows.append((dec["street"], dec["to_call"] / (dec["pot"] + dec["to_call"]))) + + bb = hands[0]["bb"] if hands else 0.02 + import statistics + return { + "n_hands": len(hands), "n_spots": len(spots), "n_bet": n_bet, + "treue": treue / len(spots) if spots else 0, + "treue_bet": treue_bet / n_bet if n_bet else 0, + "foldbet": dict(foldbet), "callbet": dict(callbet), + "bias_mean": statistics.mean(bias) if bias else 0.0, + "bias_n": len(bias), + "overfold_bb": overfold_loss / bb, "overcall_bb": overcall_loss / bb, + "overfolds": sorted(overfolds, key=lambda x: -x[9]), + "bb": bb, + } + + +def write_baseline(r, path, export_name): + import subprocess + try: + sha = subprocess.run(["git", "rev-parse", "--short", "HEAD"], cwd=os.path.dirname(path) or ".", + capture_output=True, text=True).stdout.strip() or "?" + except Exception: + sha = "?" + lines = [f"label {sha}+lokal", f"export {export_name}", + f"hands {r['n_hands']}", f"spots {r['n_spots']}", f"facing_bet {r['n_bet']}", + f"faithfulness {r['treue']:.3f}", f"faithfulness_bet {r['treue_bet']:.3f}"] + for s in ["FLOP", "TURN", "RIVER"]: + lines.append(f"foldbet_{s.lower()} {r['foldbet'].get(s,0)} {r['callbet'].get(s,0)}") + lines += [f"equity_bias {r['bias_mean']:.3f} n={r['bias_n']}", + f"overfold_bb {r['overfold_bb']:.1f}", f"overcall_bb {r['overcall_bb']:.1f}"] + open(path, "w", encoding="utf-8").write("\n".join(lines) + "\n") + + +def main(): + path = os.environ.get("COINPOKER_EXPORT") or (sys.argv[1] if len(sys.argv) > 1 else None) + if not path or not os.path.exists(path): + print(f"Export nicht gefunden: {path}\nSetze COINPOKER_EXPORT=/pfad/zur/session.md (oder als Argument)") + sys.exit(2) + r = run(path) + print(f"=== Replay-Benchmark ({os.path.basename(path)}) ===") + print(f"Haende {r['n_hands']} | Hero-Entscheidungen rekonstruiert {r['n_spots']} | davon gegen Bet {r['n_bet']}") + print(f"TREUE (Re-Decision == Log): gesamt {100*r['treue']:.0f}% | gegen Bet {100*r['treue_bet']:.0f}%") + print() + print("FOLD gegen Bet je Street (Re-Decision der aktuellen Engine):") + for s in ["FLOP", "TURN", "RIVER"]: + f, c = r["foldbet"].get(s, 0), r["callbet"].get(s, 0) + if f + c: + print(f" {s:5}: fold {f}, call {c} -> {100*f/(f+c):.0f}% Fold-to-bet") + print() + print(f"EQUITY-BIAS (Engine - wahr) ueber {r['bias_n']} Ground-Truth-Spots: {r['bias_mean']:+.3f}" + f" (negativ = unterschaetzt -> Overfold-Wurzel)") + print(f"EV-VERLUST belegt: Overfold {r['overfold_bb']:.1f} bb | Overcall {r['overcall_bb']:.1f} bb") + print() + print("Belegte Overfolds (Gegner gezeigt, wahre Equity machte den Call +EV):") + for o in r["overfolds"][:12]: + hid, st, bd, pot, tc, te, be, eq, vil, ev = o + print(f" #{hid} {st:5} [{bd:14}] pot {pot:.2f} call {tc:.2f} | wahr {te:.2f} vs be {be:.2f} " + f"| Engine {eq} | Gegner {vil} | +EV weg {ev/r['bb']:.1f} bb") + base = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "benchmarks", "replay_baseline.txt") + ename = re.sub(r'_analyse\.md$|\.md$', '', os.path.basename(path)) + write_baseline(r, base, ename) + print(f"\nBaseline geschrieben: {os.path.normpath(base)}") + return r + + +if __name__ == "__main__": + main() diff --git a/examples/diag_bluff.rs b/examples/diag_bluff.rs new file mode 100644 index 00000000..7d9d4e4c --- /dev/null +++ b/examples/diag_bluff.rs @@ -0,0 +1,93 @@ +//! Diagnose: woher kommt der Equity-Bias? Fuer jeden Wire-Spot von stdin wird die MODELLIERTE +//! Gegner-Range gedumpt und Heros Equity dagegen gemessen - einmal wie die Engine sie baut und +//! dann mit hochgedrehtem `bluff_share` je Continuation. Die Kurve zeigt, wie viel des Overfolds +//! an der (zu GTO-balancierten) Bluff-Annahme haengt. +//! +//! cat spots.ndjson | cargo run --release --example diag_bluff + +use std::io::Read; + +use rechner::card::Card; +use rechner::engine::range_combos::{as_ranges, combos}; +use rechner::engine::range_filter::{range_filter, HandFilter}; +use rechner::equity::monte_carlo::estimate; +use rechner::equity::query::Query; +use rechner::exploit::range_model::range_spec; +use rechner::exploit::range_spec::RangeSpec; +use rechner::game::Spot; +use rechner::rng::Rng; + +const TRIALS: u32 = 40_000; // hohe Trials -> Standardfehler ~0.0025, der Bias ist sichtbar + +fn specs(spot: &Spot, bluff: Option) -> Vec { + spot.live_villains() + .map(|v| { + let mut s = range_spec(spot, v); + if let Some(b) = bluff { + for c in s.continues.iter_mut() { + c.bluff_share = b; + } + } + s + }) + .collect() +} + +fn hero_share(spot: &Spot, bluff: Option) -> f64 { + let rules = spot.rules(); + let specs = specs(spot, bluff); + let filters: Vec = specs + .iter() + .map(|s| range_filter(s, rules, spot.variant, &spot.board)) + .collect(); + if filters.is_empty() { + return f64::NAN; + } + let dead: Vec = spot.hero_cards.iter().chain(&spot.board).copied().collect(); + let lists: Vec<_> = filters.iter().map(|f| combos(&rules, f, &dead)).collect(); + let ranges = as_ranges(&filters, &lists); + let query = Query { rules, hero: &spot.hero_cards, board: &spot.board, villains: &ranges, trials: TRIALS }; + estimate(&query, Rng::seeded(spot.seed)).map(|(e, _)| e.share).unwrap_or(f64::NAN) +} + +fn fmt_cards(cs: &[Card]) -> String { + cs.iter().map(|c| format!("{c:?}")).collect::>().join(" ") +} + +fn diagnose(spot: &Spot) { + println!( + "--- {:?} [{}] | hero [{}] | pot {:.2} call {:.2} ---", + spot.street, + fmt_cards(&spot.board), + fmt_cards(&spot.hero_cards), + spot.pot, + spot.to_call + ); + for v in spot.live_villains() { + let s = range_spec(spot, v); + let conts: Vec = s + .continues + .iter() + .map(|c| format!("len{} >={:?} draws={} bluff={:.2}", c.board_len, c.min_made, c.draws_continue, c.bluff_share)) + .collect(); + println!(" villain seat {}: band [{:.2}..{:.2}] {}", v.seat, s.lo, s.hi, conts.join(" | ")); + } + let base = hero_share(spot, None); + println!(" hero equity (Modell wie gebaut): {base:.3}"); + print!(" bei bluff_share ="); + for b in [0.15, 0.30, 0.45, 0.60, 0.75, 0.90] { + print!(" {:.2}->{:.3}", b, hero_share(spot, Some(b))); + } + println!(); +} + +fn main() { + let mut input = String::new(); + std::io::stdin().read_to_string(&mut input).expect("stdin"); + for line in input.lines().map(str::trim).filter(|l| !l.is_empty()) { + match rechner::json::parse(line).and_then(|v| rechner::wire::decode::decode(&v)) { + Ok(spot) => diagnose(&spot), + Err(e) => eprintln!("decode failed: {e} on: {}", &line[..line.len().min(80)]), + } + } +} diff --git a/lesen/allin_ev.py b/lesen/allin_ev.py new file mode 100644 index 00000000..4cf02093 --- /dev/null +++ b/lesen/allin_ev.py @@ -0,0 +1,161 @@ +#!/usr/bin/env python3 +"""All-in-EV: varianzreduzierte Hand-Bewertung. Ist im All-in vor dem River alles Geld drin, haengt +das Ergebnis nur noch am Board-Wurf. Die All-in-EV ersetzt diesen Wurf durch seinen Erwartungswert +(Equity gegen die aufgedeckten Gegnerkarten) - MITTELWERTTREU: der Erwartungswert bleibt, nur die +Varianz faellt. Das ist die klassische "all-in adjusted winnings" der Tracker, die Stufe-2-A/B etwa +60 % schneller signifikant macht (docs/notizen/BEFUND-stufe0-uebung.md: ~15k -> ~5,5k Haende/Arm). + +Dieses Modul ist der KERN (reine Arithmetik + exakte Equity aus entscheiden/eval7). Die Extraktion +der Zutaten aus dem Hand-Text (Board zum All-in, Gegnerkarten, Einsaetze) steht getrennt in +`aus_text` - gated auf den eindeutigen Fall (Kopf-an-Kopf, ein Brett, All-in bis Showdown). + + equity(hero, board_bis_allin, [villain]) -> Hero-Equity zum All-in-Zeitpunkt + ev_netto_bb(eq, netto_bei_sieg_bb, netto_bei_pleite_bb) -> der EV-Netto statt des realisierten + +MITTELWERTTREUE (der Korrektheits-Beweis, tests/allin_ev_spec.py): +Die zwei Beine kommen aus BEOBACHTETEN Netto - `netto_bei_sieg` = was der Sieger real mitnahm +(post-Rake), `netto_bei_pleite` = was der Verlierer real verlor. Realisiert ist genau eines der +beiden; EV = eq*sieg + (1-eq)*pleite = E[realisiert | eq]. Ueber viele Haende ist der Mittelwert des +EV gleich dem des Realisierten (eq ist die wahre Gewinnwahrscheinlichkeit), mit kleinerer Varianz. +Ein nicht mittelwerttreuer EV waere ein STILLER VERLIERER - deshalb ist das die Kern-Spezifikation. +""" +import os +import sys +import zlib + +_HIER = os.path.dirname(os.path.abspath(__file__)) +_WURZEL = os.path.dirname(_HIER) +for _u in ("entscheiden",): + _q = os.path.join(_WURZEL, _u) + if os.path.isdir(_q) and _q not in sys.path: + sys.path.insert(0, _q) +import eval7 + +MC_LAEUFE = 6000 # Preflop-Monte-Carlo-Laeufe: ~100 ms, ~0,6 % 1-Sigma (eval7.score7, gc-aus) + + +def _seed(hero, villains): + """Seed deterministisch AUS DEN KARTEN (crc32, prozess-stabil - nicht Pythons randomisiertes + hash()): dasselbe Matchup gibt dieselbe MC-Schaetzung, auch ueber A/B-Arme hinweg.""" + teile = [str(c) for grp in (hero, *villains) for c in grp] + return zlib.crc32("|".join(teile).encode()) & 0xFFFFFFFF + + +def equity(hero, board_bis_allin, villains, laeufe=MC_LAEUFE): + """Hero-Equity (2 Karten) auf dem Board ZUM ALL-IN-ZEITPUNKT gegen die bekannten Gegnerkarten. + 3/4 Board-Karten -> exakte Enumeration der Runouts (990/44, Millisekunden). PREFLOP (0 Karten) -> + exakt waeren 1,7M Runouts, darum seed-deterministischer Monte-Carlo (eval7.equity_mc, unverzerrt, + ~100 ms). 5 Karten -> deterministisch (Wurf schon gefallen). `villains`: Liste von je 2 Karten.""" + if not hero or not villains: + return None + b = board_bis_allin or [] + if len(b) == 0: + return eval7.equity_mc(hero, b, list(villains), laeufe=laeufe, seed=_seed(hero, villains)) + return eval7.equity_vs(hero, b, list(villains)) + + +def ev_netto_bb(eq, netto_bei_sieg_bb, netto_bei_pleite_bb): + """Der mittelwerttreue EV-Netto in bb: eq*Sieg + (1-eq)*Pleite. Die beiden Netto sind beobachtet + (Sieger-Netto, Verlierer-Netto), also rake-exakt. `eq` in [0,1].""" + return eq * netto_bei_sieg_bb + (1.0 - eq) * netto_bei_pleite_bb + + +# Karten-Teilung des Boards: wie viele liegen je Street. +_STREET_KARTEN = {"PREFLOP": 0, "FLOP": 3, "TURN": 4, "RIVER": 5} + + +def board_bis(board, street): + """Die ersten Karten des (End-)Boards, die zum All-in-Zeitpunkt (`street`) schon lagen. + board = flache Liste ['Tc','7h',...]; street in PREFLOP/FLOP/TURN/RIVER.""" + n = _STREET_KARTEN.get(street, 0) + return list(board or [])[:n] + + +# ------------------------------------------------------- Extraktor aus der Hand-Rechnung +_STREET_NAME = ["PREFLOP", "FLOP", "TURN", "RIVER"] + + +def _allin_street(aktionen): + """Street-Nummer (0..3) des All-in-Zugs in einer Aktionsliste [{street, aktion, betrag}], oder + None. Der frueheste All-in zaehlt (ab da laeuft das Brett nur noch aus).""" + s = None + for a in aktionen or []: + if isinstance(a, dict) and (a.get("aktion") or "").upper() in ("ALL_IN", "ALLIN"): + idx = _STREET_KARTEN_IDX.get(a.get("street")) + if idx is not None: + s = idx if s is None else min(s, idx) + return s + + +_STREET_KARTEN_IDX = {"PREFLOP": 0, "FLOP": 1, "TURN": 2, "RIVER": 3} + + +def aus_daten(daten, held): + """All-in-EV EINER Hand aus der vollen Rechnung (ergebnis.rechnungen). GATED auf den eindeutigen + Fall - Kopf-an-Kopf, EIN Brett (kein RIT/Doppelbrett/EV-Chop/Bombpot), beide aufgedeckt, All-in + VOR dem River, kein Seiten-Pott. Sonst qualifiziert=False mit Grund (dann gilt netto_bb roh). + + Preflop/Flop/Turn werden alle bepreist: Flop (990) und Turn (44) exakt, Preflop ueber seed- + deterministischen Monte-Carlo (~100 ms, eval7.equity_mc) statt der 1,7M-Runout-Enumeration. + + -> {qualifiziert, grund, street, equity, netto_bb, netto_ev_bb, hero, villain, board_allin}. + netto_ev_bb ist mittelwerttreu: eq*Sieger-Netto + (1-eq)*Verlierer-Netto (beide beobachtet).""" + aus = {"qualifiziert": False, "grund": None, "street": None, "equity": None, + "netto_bb": None, "netto_ev_bb": None} + pl = daten.get("plaetze") or {} + bb = daten.get("bb") + if held not in pl or not bb: + aus["grund"] = "kein Held/kein bb" + return aus + hero = pl[held] + aus["netto_bb"] = round(hero["netto"] / bb, 4) + aus["netto_ev_bb"] = aus["netto_bb"] # Vorgabe: roh, bis eine Hand qualifiziert + m = daten.get("merker") or {} + if any(m.get(k) for k in ("rit", "doppelbrett", "ev_chop", "bomb_pot")): + aus["grund"] = "Sonderfall (rit/doppelbrett/evchop/bombpot)" + return aus + if len(pl) != 2: + aus["grund"] = "nicht heads-up" + return aus + villain = pl[next(n for n in pl if n != held)] + reveal = daten.get("reveal") or {} + hero_k = reveal.get(hero["sitz"]) or daten.get("hole") + vill_k = reveal.get(villain["sitz"]) + if not hero_k or not vill_k or len(hero_k) != 2 or len(vill_k) != 2: + aus["grund"] = "nicht beide aufgedeckt" + return aus + paare = [x for x in (_allin_street(hero.get("aktionen")), _allin_street(villain.get("aktionen"))) + if x is not None] + if not paare: + aus["grund"] = "kein All-in" + return aus + s = min(paare) + if s >= 3: + aus["grund"] = "All-in erst am River (keine Varianz)" + return aus + if abs(hero["einsatz"] - villain["einsatz"]) > 0.5 * bb: + aus["grund"] = "ungleiche Einsaetze (Seiten-Pott)" + return aus + board_s = board_bis(daten.get("board") or [], _STREET_NAME[s]) + eq = equity(hero_k, board_s, [vill_k]) + if eq is None: + aus["grund"] = "Equity nicht berechenbar" + return aus + sieger = max(hero["netto"], villain["netto"]) + verlierer = min(hero["netto"], villain["netto"]) + aus.update(qualifiziert=True, street=_STREET_NAME[s], equity=round(eq, 4), + netto_ev_bb=round(ev_netto_bb(eq, sieger, verlierer) / bb, 4), + hero=hero_k, villain=vill_k, board_allin=board_s) + return aus + + +def aus_text(text, held): + """Alle fertigen Haende eines Logtexts, je Hand das aus_daten-Ergebnis (mit raum/hand). Nutzt + ergebnis.rechnungen - Platte nur dort, hier reine Weiterverarbeitung.""" + import ergebnis + out = [] + for r in ergebnis.rechnungen(text): + res = aus_daten(r["daten"], held) + res["raum"], res["hand"] = r["raum"], r["hand"] + out.append(res) + return out diff --git a/lesen/einblick.py b/lesen/einblick.py new file mode 100644 index 00000000..8fddb0fc --- /dev/null +++ b/lesen/einblick.py @@ -0,0 +1,200 @@ +#!/usr/bin/env python3 +"""Einblick: aus den dauerhaft geloggten eigenen Zuegen (archiv/lauf/zuege.jsonl) die Spielweise der +Engine in Zahlen - je Street, je Vorflop-Position, je Postflop-Handklasse, und die Begruendungs- +Taxonomie des Kerns. Rein aus dem, was schon geloggt ist (lesen/handreview): kein neues Logging. + +Anders als betrieb/review.py (Filter-Sucher, listet einzelne Haende) aggregiert dies - der +statistische Leak-Finder: "wie oft checkt die Engine welchen Drilling", "wie aggressiv am River", +"welche Vorflop-Position spielt zu breit". Mit `arm=` nur die Zuege eines A/B-Arms (Feld "arm", +im Lauf per COINPOKER_ARM gesetzt) - so lassen sich die Insights je Arm vergleichen. + +Reine Funktionen (Platte nur in `laden`/`main`); Spezifikation: tests/einblick_spec.py. + + python3 lesen/einblick.py [zuege.jsonl] [--arm A] [--tags 20] +""" +import collections +import json +import os +import sys + +STREETS = ("PREFLOP", "FLOP", "TURN", "RIVER") +# Positionen, wie der Vorflop-Grund des Kerns sie nennt ("MP open", "SB vs limp", "BTN open"). +POSITIONEN = {"UTG", "UTG1", "UTG2", "UTG3", "LJ", "HJ", "MP", "MP1", "MP2", "CO", "BTN", "SB", "BB"} +AGGRESSIV = {"BET", "RAISE"} + + +def nur_arm(zuege, arm): + """Zuege eines A/B-Arms (Feld "arm"). `arm=None` -> alle; sonst exakt dieser Arm.""" + if arm is None: + return list(zuege) + return [z for z in zuege if isinstance(z, dict) and z.get("arm") == arm] + + +def _quote(zaehler, aktionen): + n = sum(zaehler.values()) + return (sum(zaehler.get(a, 0) for a in aktionen) / n) if n else 0.0 + + +def aktionen_je_street(zuege): + """Je Street: Zahl der Zuege, Aktionsverteilung, Aggressiv-Anteil (BET+RAISE), Fold-Anteil.""" + je = {s: collections.Counter() for s in STREETS} + for z in zuege: + if not isinstance(z, dict): + continue + st, ak = z.get("street"), z.get("aktion") + if st in je and ak: + je[st][ak] += 1 + out = [] + for s in STREETS: + c = je[s] + n = sum(c.values()) + if not n: + continue + out.append({"street": s, "zuege": n, "aktionen": dict(c), + "aggressiv": _quote(c, AGGRESSIV), "fold": _quote(c, {"FOLD"})}) + return out + + +def position(grund): + """Die Vorflop-Position aus dem Grund des Kerns (erstes Token), oder None. "MP open" -> "MP".""" + if not grund: + return None + teile = str(grund).strip().split() + return teile[0] if teile and teile[0] in POSITIONEN else None + + +def vorflop_je_position(zuege): + """Vorflop je Position (aus dem Grund): Zuege, Aktionsverteilung, Aggressiv-/Fold-Anteil. + Die Zuege ohne erkennbare Position fallen weg (kein Rate-Spiel).""" + je = collections.defaultdict(collections.Counter) + for z in zuege: + if not isinstance(z, dict) or z.get("street") != "PREFLOP": + continue + p = position(z.get("grund")) + if p is None or not z.get("aktion"): + continue + je[p][z["aktion"]] += 1 + out = [] + for p in sorted(je): + c = je[p] + out.append({"position": p, "zuege": sum(c.values()), "aktionen": dict(c), + "aggressiv": _quote(c, AGGRESSIV), "fold": _quote(c, {"FOLD"})}) + return out + + +def klassen_postflop(zuege): + """Postflop je Handklasse (Feld "klasse": HighCard/Pair/TwoPair/...): Aktionsverteilung und + Aggressiv-Anteil. Das ist der Leak-Finder als Statistik - z. B. der Anteil gecheckter Drillinge.""" + je = collections.defaultdict(collections.Counter) + for z in zuege: + if not isinstance(z, dict) or z.get("street") == "PREFLOP": + continue + k = z.get("klasse") + if not k or not z.get("aktion"): + continue + je[k][z["aktion"]] += 1 + out = [] + for k in sorted(je): + c = je[k] + out.append({"klasse": k, "zuege": sum(c.values()), "aktionen": dict(c), + "aggressiv": _quote(c, AGGRESSIV)}) + return out + + +def _tag(grund): + """Der Begruendungs-Kopf (vor '->', ',' oder ':'): "middle pair on wet board: equity .." -> die + Regel ohne die Zahlen. So faltet sich die Taxonomie des Kerns zu zaehlbaren Tags.""" + if not grund: + return "(leer)" + kopf = str(grund).split("->")[0].split(",")[0].split(":")[0].strip() + return kopf[:48] if kopf else "(leer)" + + +def grund_tags(zuege, n=15): + """Die haeufigsten Begruendungs-Koepfe des Kerns (welche Regel wie oft feuert).""" + c = collections.Counter(_tag(z.get("grund")) for z in zuege if isinstance(z, dict)) + return [{"tag": t, "n": k} for t, k in c.most_common(n)] + + +def bericht(zuege, arm=None, tags=15): + """Der ganze Einblick als JSON-faehiges Dict. Mit `arm` nur die Zuege dieses A/B-Arms.""" + zuege = nur_arm(zuege, arm) + return {"arm": arm, "zuege": len(zuege), + "je_street": aktionen_je_street(zuege), + "je_position": vorflop_je_position(zuege), + "je_klasse": klassen_postflop(zuege), + "grund_tags": grund_tags(zuege, tags)} + + +def _p(x): + return f"{x * 100:4.0f} %" + + +def text(b): + """Der Einblick als lesbarer Bericht.""" + kopf = "=== Einblick: Spielweise aus den Zuegen ===" + if b["arm"] is not None: + kopf += f" (Arm {b['arm']})" + z = [kopf, f"Zuege: {b['zuege']}", ""] + z.append("je Street Zuege aggressiv fold") + for r in b["je_street"]: + z.append(f" {r['street']:<12} {r['zuege']:>5} {_p(r['aggressiv'])} {_p(r['fold'])}") + if b["je_position"]: + z += ["", "Vorflop je Position Zuege aggressiv fold"] + for r in b["je_position"]: + z.append(f" {r['position']:<17} {r['zuege']:>5} {_p(r['aggressiv'])} {_p(r['fold'])}") + if b["je_klasse"]: + z += ["", "Postflop je Handklasse Zuege aggressiv (Aktionen)"] + for r in b["je_klasse"]: + akt = " ".join(f"{k}:{v}" for k, v in sorted(r["aktionen"].items())) + z.append(f" {r['klasse']:<19} {r['zuege']:>5} {_p(r['aggressiv'])} {akt}") + z += ["", "haeufigste Begruendungen des Kerns:"] + for r in b["grund_tags"]: + z.append(f" {r['n']:>4} {r['tag']}") + return "\n".join(z) + "\n" + + +def laden(pfad): + """Zug-Dicts aus einer jsonl-Datei; fehlende/kaputte Datei oder Zeile -> faellt weg.""" + out = [] + try: + with open(pfad, "r", encoding="utf-8", errors="replace") as f: + for zeile in f: + zeile = zeile.strip() + if not zeile: + continue + try: + d = json.loads(zeile) + except ValueError: + continue + if isinstance(d, dict): + out.append(d) + except OSError: + return [] + return out + + +def main(argv): + pfad = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), + "archiv", "lauf", "zuege.jsonl") + arm, tags = None, 15 + i = 0 + while i < len(argv): + if argv[i] == "--arm" and i + 1 < len(argv): + arm = argv[i + 1] + i += 2 + elif argv[i] == "--tags" and i + 1 < len(argv): + try: + tags = int(argv[i + 1]) + except ValueError: + pass + i += 2 + else: + pfad = argv[i] + i += 1 + print(text(bericht(laden(pfad), arm=arm, tags=tags))) + return 0 + + +if __name__ == "__main__": + sys.exit(main(sys.argv[1:])) diff --git a/lesen/ergebnis.py b/lesen/ergebnis.py index 7c59e76d..ab106b17 100644 --- a/lesen/ergebnis.py +++ b/lesen/ergebnis.py @@ -188,6 +188,7 @@ def _rechnung(ereignisse): zeit = None hole = None reveal = {} + brett = [] # flaches Hauptbrett ['Tc','7h',...] (nicht RIT/Doppelbrett) - fuer All-in-EV gewinn = {} zurueck = {} erste_zeile = {} # name -> (chips, betAmout, caption) der ersten Sitzzeile @@ -231,6 +232,12 @@ def _rechnung(ereignisse): # Auch RIT-/Doppelbrett-Bretter zaehlen die Strasse mit, damit keine Zeile verloren geht. for feld in ("dealerCards", "dealerCardsRit", "dealerCardsDoubleBoard"): strasse = max(strasse, _strasse(d.get(feld))) + haupt = d.get("dealerCards") + if isinstance(haupt, dict): # das flache Hauptbrett, fuellstes Vorkommen gewinnt + flach = [k for s in ("FLOP", "TURN", "RIVER") + for k in (karte(c) for c in (haupt.get(s) or [])) if k] + if len(flach) >= len(brett): + brett = flach if _gefuellt(d.get("dealerCardsRit")): merker["rit"] = True if _gefuellt(d.get("dealerCardsDoubleBoard")): @@ -355,7 +362,7 @@ def _rechnung(ereignisse): p["pruefung"] = "stapel" p["abweichung"] = min(abw, key=abs) return {"bb": bb, "sb": sb, "ante": ante or 0.0, "plaetze": plaetze, "reveal": reveal, - "hole": hole, "zeit": zeit, "merker": merker}, None + "hole": hole, "zeit": zeit, "merker": merker, "board": brett}, None def _marke(x): @@ -422,6 +429,19 @@ def haende_aller(text, uebersprungen=None): return _eintraege(text, None, uebersprungen) +def rechnungen(text): + """Die volle Rechnung je fertiger Hand (fuer lesen/allin_ev): Liste von {raum, hand, daten} mit + daten = {bb, sb, ante, plaetze, reveal, hole, board, merker, zeit}. Unfertige/unlesbare Haende + fallen weg. Anders als `haende` (fertige Hero-Zeilen) traegt dies Board, Reveal und alle Sitze.""" + alle, _ = _gelesen(text) + out = [] + for (raum, hand), ev in alle.items(): + daten, _grund = _rechnung(ev) + if daten is not None: + out.append({"raum": raum, "hand": hand, "daten": daten}) + return out + + def aufgedeckt(text): """Siehe `lesen/aufdeckung.py` - dort definiert, hier weitergereicht (Zirkel vermieden).""" return aufdeckung.aufgedeckt(text) diff --git a/lesen/gegnersignal.py b/lesen/gegnersignal.py new file mode 100644 index 00000000..f5122e1e --- /dev/null +++ b/lesen/gegnersignal.py @@ -0,0 +1,135 @@ +#!/usr/bin/env python3 +"""Gegnersignal - aus dem persistenten Datensatz (lesen/gedaechtnis.py) ein kalibriertes Ausnutz-Signal. + +PRODUZENT-Haelfte: rein-funktional, ohne Platte, ohne Rust. Liest NUR, was das Gedaechtnis hat und +der Client nicht liefert (`gezeigt`, `sizing`); die HUD-Zahlen (vpip/pfr/...) fasst es nie an. + +Signal (alle Felder immer da, Zahlen sind float, Zaehler int): + + n_gezeigt int Anzahl auswertbarer gezeigter Haende (Stichprobe) + n_sizing int Summe der Sizing-Eimer + konfidenz float 0..1, n/(n+K_GEZEIGT) - wie sehr das Handsignal zaehlt + konfidenz_sizing float 0..1, min(Sizing-Konfidenz, konfidenz) - sizing_tell braucht BEIDES + range_tightness float 0..1, 0.5 = zufaellige Haende; hoeher = staerkere Showdown-Haende. + Mittel der Handstaerke-Perzentile, zum Prior 0.5 hin geschrumpft + tightness_roh float ungeschrumpftes Mittel (None ohne Haende) + showdown_bluff_rate float 0..1 Anteil "Luft"-Haende (Perzentil < LUFT_GRENZE) unter den gezeigten, + zum Prior PRIOR_LUFT hin geschrumpft + sizing_tell float -1..1; >0: grosse Einsaetze = stark (Value-lastig), <0: grosse Einsaetze + = Bluff/Luft (Gegner over-bluffed mit Groesse). Konfidenz-geschrumpft + +Handstaerke: Vorflop-Heuristik nach Chen (Hoechstkarte, Paar, gleiche Farbe, Luecke), die Punkte +je Kombination (alle 1326) in ein Perzentil gegen eine zufaellige Hand umgerechnet. Brett kennt das +Gedaechtnis nicht - "Luft" heisst daher: Vorflop-Handstaerke unter Zufallsmitte (schwach gehalten +bis zum Showdown). Das ist eine Naeherung, kein Equity-Wert. + +Kalibrierung: Bayes-artige Schrumpfung w = n/(n+K). Ein Wert aus 2 Haenden zaehlt K/(2+K) weniger +als aus 10 (der Gedaechtnis-Deckel). `sizing_tell` ist eine Naeherung: Sizing-Eimer sind nicht +je Hand an `gezeigt` gebunden, also = Gross-minus-Klein-Anteil x Polaritaet der gezeigten Haende. + +Spezifikation: tests/gegnersignal_spec.py. +""" +import itertools + +K_GEZEIGT = 6.0 # Pseudo-Stichprobe: 6 Haende = halbes Vertrauen +K_SIZING = 8.0 # dito fuer Sizing-Zaehler +PRIOR_STRAFFHEIT = 0.5 # Zufall +PRIOR_LUFT = 0.30 +LUFT_GRENZE = 0.35 # Perzentil darunter = Luft +KLEIN = ("mini",) +GROSS = ("pot", "over") # "halb" bleibt neutral + +_RANG = {"2": 2, "3": 3, "4": 4, "5": 5, "6": 6, "7": 7, "8": 8, "9": 9, "T": 10, "J": 11, + "Q": 12, "K": 13, "A": 14} +_PUNKTE = {14: 10.0, 13: 8.0, 12: 7.0, 11: 6.0} + + +def _karte(k): + """(rang, farbe) oder None. Nimmt 'Ah', 'Td', auch '10h'.""" + s = str(k or "").strip() + if s.startswith("10"): + s = "T" + s[2:] + if len(s) != 2 or s[0].upper() not in _RANG: + return None + return _RANG[s[0].upper()], s[1].lower() + + +def _chen(a, b): + """Chen-Punkte zweier (rang, farbe)-Karten.""" + (r1, f1), (r2, f2) = sorted((a, b), key=lambda c: -c[0]) + p = _PUNKTE.get(r1, r1 / 2.0) + if r1 == r2: + return max(5.0, 2 * p) + if f1 == f2: + p += 2 + luecke = r1 - r2 - 1 + p -= (0, 1, 2, 4)[luecke] if luecke < 4 else 5 + if luecke <= 1 and r1 < 12: + p += 1 + return p + + +_TABELLE = None + + +def _punkte_alle(): + global _TABELLE + if _TABELLE is None: + deck = [(r, f) for r in range(2, 15) for f in "shdc"] + _TABELLE = sorted(_chen(a, b) for a, b in itertools.combinations(deck, 2)) + return _TABELLE + + +def staerke(hand): + """Perzentil 0..1 der Hand gegen eine zufaellige Hand (0.5 = Median); None bei ungueltiger Hand.""" + if not isinstance(hand, (list, tuple)) or len(hand) != 2: + return None + a, b = _karte(hand[0]), _karte(hand[1]) + if a is None or b is None or a == b: + return None + p = _chen(a, b) + alle = _punkte_alle() + unter = sum(1 for x in alle if x < p) + gleich = sum(1 for x in alle if x == p) + return (unter + 0.5 * gleich) / len(alle) + + +def _geschrumpft(wert, n, prior, k): + return (n * wert + k * prior) / (n + k) + + +def signal(eintrag): + """Das Ausnutz-Signal (Dict, Felder s. Modulkopf) zu einem Gedaechtnis-Datensatz. + Leerer/None-Datensatz -> neutrale Werte (Prior), Konfidenz 0.""" + eintrag = eintrag or {} + st = [s for s in (staerke(h) for h in eintrag.get("gezeigt") or []) if s is not None] + n = len(st) + konf = n / (n + K_GEZEIGT) + roh = sum(st) / n if n else None + tight = _geschrumpft(roh, n, PRIOR_STRAFFHEIT, K_GEZEIGT) if n else PRIOR_STRAFFHEIT + luft = sum(1 for s in st if s < LUFT_GRENZE) + bluff = _geschrumpft(luft / n, n, PRIOR_LUFT, K_GEZEIGT) if n else PRIOR_LUFT + + z = {k: int(v) for k, v in (eintrag.get("sizing") or {}).items() if isinstance(v, (int, float)) and v > 0} + ns = sum(z.values()) + tell, konf_s = 0.0, 0.0 + if ns and n: + konf_s = min(ns / (ns + K_SIZING), konf) + schief = (sum(z.get(b, 0) for b in GROSS) - sum(z.get(b, 0) for b in KLEIN)) / ns + polar = 2.0 * (roh - 0.5) + tell = max(-1.0, min(1.0, schief * polar * konf_s)) + return {"n_gezeigt": n, "n_sizing": ns, "konfidenz": konf, "konfidenz_sizing": konf_s, + "range_tightness": tight, "tightness_roh": roh, + "showdown_bluff_rate": bluff, "sizing_tell": tell} + + +def signale(speicher): + """{kennung: signal} fuer ein ganzes Gedaechtnis (dict von gedaechtnis.laden).""" + return {str(k): signal(v) for k, v in (speicher or {}).items()} + + +if __name__ == "__main__": + import json + import sys + import gedaechtnis + print(json.dumps(signale(gedaechtnis.laden(sys.argv[1] if len(sys.argv) > 1 else "")), indent=1)) diff --git a/lesen/kalibrierung.py b/lesen/kalibrierung.py new file mode 100644 index 00000000..b29141f5 --- /dev/null +++ b/lesen/kalibrierung.py @@ -0,0 +1,224 @@ +#!/usr/bin/env python3 +"""Stufe 1 des synthetischen Gegner-Labors: die Gegner-POPULATION an echte Spielerdaten eichen. + +Das Labor zieht seine Gegner aus vier Archetypen {fish, reg, nit, maniac}. Je Archetyp gilt der +"eingeschwungene HUD-Read" (src/sim/reads.rs, hier als ARCHETYPEN gespiegelt). Die Feldmischung +im Labor (fish 0.35 / reg 0.30 / nit 0.20 / maniac 0.15, src/sim/population.rs) ist ein +UNGEEICHTER Vorgabewert. Dieses Modul schaetzt die echte Mischung: + + 1. Je echtem Spieler der HUD-Vektor (vpip, pfr, foldToBet, aggression), alle 0..1. + 2. Zuordnung zum naechsten Archetyp (euklidischer Abstand im HUD-Raum). + 3. Zaehlen -> Gewichte (Summe 1); je Haufen Mittel und Streuung (Standardabweichung). + +Fehlende Achsen: `aggression` liefert der Client NICHT (hud_stats kennt sie nicht, sie entsteht +erst aus Nach-Flop-Zuegen, profil.aggression). Fehlt eine Achse, zaehlt der Abstand nur ueber die +vorhandenen - der Vergleich bleibt fair, weil alle Archetypen dieselben Achsen verlieren. +Duenne Profile (profil.stichproben == DUENN, d. h. nach einer Handvoll Haende) fallen heraus. + +Rein-funktional wie lesen/gedaechtnis.py; nur laden/speichern fassen die Platte an. + +WOHER DIE ECHTEN DATEN KOMMEN (Stand: archiv/ hat KEINE fertige Spielerablage - kein +gedaechtnis.json, kein Stats-Verzeichnis je Gegner; das Gedaechtnis speichert HUD-Zahlen +ohnehin bewusst nicht). Echt vorhanden sind nur die hud_stats-Antworten in Mitschrieben, z. B. +archiv/rec-log.log (11 Spieler). Zwei Wege hierher: + + * Log/Mitschrieb: python3 lesen/kalibrierung.py archiv/rec-log.log [weitere.log ...] + * JSON-Datei mit {kennung: {"vpip":..,"pfr":..,"foldToBet":..,"aggression":..}} (0..1): + python3 lesen/kalibrierung.py spieler.json + Schreibt archiv/population.json (mit -o anderer Pfad). Mehr Logs/Sitzungen -> bessere Eichung; + derselbe Spieler (Kennung) in mehreren Quellen zaehlt einmal, die spaetere Angabe gewinnt. + +Spezifikation: tests/kalibrierung_spec.py. +""" +import json +import math +import os +import sys + +_w = os.path.dirname(os.path.abspath(__file__)) +if _w not in sys.path: + sys.path.insert(0, _w) + +import profil + +ACHSEN = ("vpip", "pfr", "foldToBet", "aggression") + +# Gespiegelt aus src/sim/reads.rs - bei Aenderung dort hier nachziehen. +ARCHETYPEN = { + "fish": {"vpip": 0.93, "pfr": 0.01, "foldToBet": 0.40, "aggression": 0.08}, + "reg": {"vpip": 0.31, "pfr": 0.13, "foldToBet": 0.72, "aggression": 0.25}, + "nit": {"vpip": 0.06, "pfr": 0.03, "foldToBet": 0.82, "aggression": 0.12}, + "maniac": {"vpip": 0.76, "pfr": 0.42, "foldToBet": 0.50, "aggression": 0.50}, +} +NAMEN = tuple(ARCHETYPEN) # feste Reihenfolge; bei Gleichstand gewinnt der frühere + +VORGABE_PFAD = os.path.join(os.path.dirname(_w), "archiv", "population.json") + + +def abstand(hud, archetyp): + """Euklidischer Abstand von `hud` zum Archetyp, nur ueber die Achsen, die `hud` hat. + None, wenn gar keine Achse vorhanden ist.""" + quadrate = [(float(hud[a]) - ARCHETYPEN[archetyp][a]) ** 2 + for a in ACHSEN if hud.get(a) is not None] + return math.sqrt(sum(quadrate)) if quadrate else None + + +def klassifizieren(hud): + """Name des naechsten Archetyps - None, wenn `hud` keine einzige Achse traegt.""" + if not isinstance(hud, dict): + return None + beste = None + for name in NAMEN: + d = abstand(hud, name) + if d is None: + return None + if beste is None or d < beste[0]: + beste = (d, name) + return beste[1] + + +def _mittel_streuung(werte): + """(Mittel, Standardabweichung) - Stichproben-Std (n-1); None bei weniger als 2 Werten.""" + if len(werte) < 2: + return None + m = sum(werte) / len(werte) + return m, math.sqrt(sum((x - m) ** 2 for x in werte) / (len(werte) - 1)) + + +def kalibrieren(spieler, quelle="unbekannt"): + """Populationsspezifikation aus `spieler` = {kennung: HUD-Dict}. None ohne brauchbaren Spieler. + + Schema (das die Rust-Seite liest): + {"n_players": int, "weights": {archetyp: anteil}, "spread_hud": {archetyp: {achse: std}}, + "quelle": str} + `spread_hud` nur fuer Haufen mit mindestens 2 Spielern je Achse, fehlt ganz ohne solche Daten. + Das Mittel je Haufen steht bewusst nicht im Schema (es bleibt knapp); `haufen()` liefert es.""" + zugeordnet = {n: [] for n in NAMEN} + for hud in (spieler or {}).values(): + name = klassifizieren(hud) + if name is not None: + zugeordnet[name].append(hud) + n = sum(len(v) for v in zugeordnet.values()) + if n == 0: + return None + spec = {"n_players": n, + "weights": {name: len(zugeordnet[name]) / n for name in NAMEN}} + spread = {} + for name in NAMEN: + je_achse = {} + for a in ACHSEN: + ms = _mittel_streuung([float(h[a]) for h in zugeordnet[name] if h.get(a) is not None]) + if ms is not None: + je_achse[a] = ms[1] + if je_achse: + spread[name] = je_achse + if spread: + spec["spread_hud"] = spread + spec["quelle"] = quelle + return spec + + +def haufen(spieler): + """{archetyp: {"n": int, "mittel": {achse: m}}} - beobachteter HUD-Mittelwert je Haufen.""" + ergebnis = {n: {"n": 0, "mittel": {}} for n in NAMEN} + summen = {n: {} for n in NAMEN} + for hud in (spieler or {}).values(): + name = klassifizieren(hud) + if name is None: + continue + ergebnis[name]["n"] += 1 + for a in ACHSEN: + if hud.get(a) is not None: + s = summen[name].setdefault(a, []) + s.append(float(hud[a])) + for name in NAMEN: + ergebnis[name]["mittel"] = {a: sum(v) / len(v) for a, v in summen[name].items()} + return ergebnis + + +def aus_log(text): + """{kennung: HUD} aus einem Mitschrieb mit hud_stats-Antworten (ueber lesen/profil.py). + + Duenne Profile (nach einer Handvoll Haende, profil.stichproben == DUENN) bleiben draussen. + Nur die Achsen vpip/pfr/foldToBet; aggression fehlt (der Client liefert sie nicht).""" + dicke = profil.stichproben(text) + ergebnis = {} + for kennung, werte in profil.statistiken(text).items(): + if dicke.get(kennung, profil.GLAUBHAFT) <= profil.DUENN: + continue + hud = {a: werte[a] for a in ACHSEN if a in werte} + if hud: + ergebnis[kennung] = hud + return ergebnis + + +def aus_json(daten): + """{kennung: HUD} aus einer geladenen JSON-Struktur {kennung: {achse: wert}}; Muell faellt weg.""" + ergebnis = {} + if not isinstance(daten, dict): + return ergebnis + for kennung, eintrag in daten.items(): + if not isinstance(eintrag, dict): + continue + hud = {} + for a in ACHSEN: + try: + if eintrag.get(a) is not None: + hud[a] = min(max(float(eintrag[a]), 0.0), 1.0) + except (TypeError, ValueError): + pass + if hud: + ergebnis[str(kennung)] = hud + return ergebnis + + +def laden(pfad): + """{kennung: HUD} aus einer Quelle - .json als Spielerablage, sonst als Mitschrieb. + Fehlende/kaputte Datei -> {}, nie eine Ausnahme.""" + try: + if pfad.lower().endswith(".json"): + with open(pfad, "r", encoding="utf-8") as f: + return aus_json(json.load(f)) + with open(pfad, "r", encoding="utf-8", errors="replace") as f: + return aus_log(f.read()) + except (OSError, ValueError): + return {} + + +def speichern(pfad, spec): + """Die Populationsspezifikation atomar schreiben (erst .tmp, dann os.replace).""" + os.makedirs(os.path.dirname(pfad) or ".", exist_ok=True) + tmp = pfad + ".tmp" + with open(tmp, "w", encoding="utf-8") as f: + json.dump(spec, f, ensure_ascii=False, indent=1) + os.replace(tmp, pfad) + + +def main(argv): + ziel = VORGABE_PFAD + quellen = [] + i = 0 + while i < len(argv): + if argv[i] == "-o" and i + 1 < len(argv): + ziel = argv[i + 1] + i += 2 + else: + quellen.append(argv[i]) + i += 1 + if not quellen: + print(__doc__) + return 1 + spieler = {} + for q in quellen: + spieler.update(laden(q)) + spec = kalibrieren(spieler, quelle=", ".join(os.path.basename(q) for q in quellen)) + if spec is None: + print("keine brauchbaren Spieler in den Quellen - nichts geschrieben") + return 1 + speichern(ziel, spec) + print(json.dumps(spec, ensure_ascii=False, indent=1)) + return 0 + + +if __name__ == "__main__": + sys.exit(main(sys.argv[1:])) diff --git a/lesen/liveabgleich.py b/lesen/liveabgleich.py new file mode 100644 index 00000000..14c58c1f --- /dev/null +++ b/lesen/liveabgleich.py @@ -0,0 +1,292 @@ +#!/usr/bin/env python3 +"""Stufe 4 des synthetischen Gegner-Labors (die live-Hälfte): der Sim-to-Real-OUTCOME-Abgleich. + +Das Labor sagt eine Kante voraus (Offense-EV des Zwillings-Tors, `src/sim/twin_gate.rs`: die Engine +beutet die GEZOGENE Population mit +43.95 bb/100 aus). Die Frage, die nur der Tisch beantwortet: +**Kommt diese Kante am echten Geld an?** Dieses Modul liest das, was der Live-Lauf tatsächlich +verdient hat (`archiv/lauf/haende.jsonl`, je eigener Hand `netto` in Chips und `bb` als Blindgröße), +rechnet daraus bb/100 mit 95-%-Intervall und hält es gegen die Sim-Vorhersage. Die Differenz ist der +Sim-to-Real-OUTCOME-Gap - die Zahl, die die Architektur „der eine unverzichtbare Live-Test" nennt. + +Reine Funktionen (Platte nur in `main`/`laden`), wie `lesen/kalibrierung.py` und `lesen/gegnersignal.py`. + +EHRLICHE GRENZE (warum der Gap kein reiner Strategiefehler ist): +Der Live-Lauf lief NICHT unter Laborbedingungen. Er enthält AoF-Push/Fold, Tischregeln, Klick-/UI- +Ausfälle (verstrichene Züge, AFK, Client-Neustarts), Rake, gemischte Stakes und vor allem die ECHTE +Population - nicht die synthetische. Der Gap misst also, wie viel der Sim-Kante bis zur Realität +überlebt, mit all diesen Confounds drin. Sie sauber zu trennen braucht den EINEN noch-live Rest: den +kontrollierten COINPOKER_KERN-An/Aus-Split (`betrieb/runner.py`, grober Schalter), bei dem derselbe +Farm mit und ohne Engine-Kern läuft und NUR die bb/100-Differenz zählt. Dafür fehlen Hände unter +beiden Bedingungen, nicht Code: der Abgleich hier ist gebaut und gefahren, er schärft sich mit Volumen. + +Der A/B-Test selbst ist fertig gerechnet (`ab_vergleich`, CLI `--ab an.jsonl aus.jsonl`): er nimmt die +zwei Arm-Logs und liefert die signifikanz-geprüfte bb/100-Differenz. Was fehlt, ist allein das Laufen +des Live-Farms unter beiden Armen - eine reale, geldechte Spiel-Session über Zeit, die NICHT in dieser +Werkbank entsteht, sondern am Tisch. Das Werkzeug wartet darauf, nicht umgekehrt. + +Spezifikation: tests/liveabgleich_spec.py. +""" +import json +import math +import os +import sys + +# Gespiegelt aus dem Zwillings-Tor-Befund (src/sim/twin_gate.rs, Offense-Achse, Memory-Read gegen die +# gezogene Population). Bei Neumessung dort hier nachziehen. Das ist die Kante, die das Labor behauptet. +SIM_OFFENSE_BB100 = 43.95 + +_w = os.path.dirname(os.path.abspath(__file__)) +VORGABE_PFAD = os.path.join(os.path.dirname(_w), "archiv", "lauf", "haende.jsonl") + +Z = 1.959964 # 95-%-Quantil der Normalverteilung (zweiseitig) + + +def netto_bb(hand, ev=False): + """Nettoergebnis einer Hand in Big Blinds, oder None wenn die Hand die Felder nicht trägt. + + `netto` ist in Chips, `bb` die Blindgröße derselben Hand - netto/bb ist stakes-normiert, also + über verschiedene Stakes hinweg addierbar. Ein `netto_bb`-Feld im Log gewinnt, wenn vorhanden. + + `ev=True`: wenn die Hand ein `netto_bb_ev` trägt (All-in-EV, lesen/allin_ev - varianzreduziert, + mittelwerttreu), gilt dieser statt des realisierten. Nur fürs A/B-Rauschdämpfen, nicht als + Buchhaltung. Ohne das Feld (keine qualifizierte All-in-Hand) fällt es auf netto_bb zurück.""" + if not isinstance(hand, dict): + return None + if ev and isinstance(hand.get("netto_bb_ev"), (int, float)): + return float(hand["netto_bb_ev"]) + if isinstance(hand.get("netto_bb"), (int, float)): + return float(hand["netto_bb"]) + netto, bb = hand.get("netto"), hand.get("bb") + if isinstance(netto, (int, float)) and isinstance(bb, (int, float)) and bb: + return netto / bb + return None + + +def haende_lesen(text): + """Liste der netto_bb-Werte aus einem jsonl-Mitschrieb; kaputte/unvollständige Zeilen fallen weg.""" + werte = [] + for zeile in text.splitlines(): + zeile = zeile.strip() + if not zeile: + continue + try: + hand = json.loads(zeile) + except ValueError: + continue + v = netto_bb(hand) + if v is not None: + werte.append(v) + return werte + + +def bb_pro_100(werte): + """{n, bb100, halb95, tief, hoch, netto_bb} aus netto_bb je Hand. + + bb100 = Mittel je Hand * 100. Das 95-%-Intervall ist das der Winrate (Standardfehler des + Mittels * 100 * z), nicht das der einzelnen Hand - also „wie sicher ist die Kante", nicht „wie + streut eine Hand". Bei weniger als 2 Händen fehlt das Intervall (halb95/tief/hoch = None).""" + n = len(werte) + if n == 0: + return {"n": 0, "bb100": None, "halb95": None, "tief": None, "hoch": None, "netto_bb": 0.0} + summe = sum(werte) + mittel = summe / n + bb100 = mittel * 100.0 + out = {"n": n, "bb100": bb100, "netto_bb": summe, "halb95": None, "tief": None, "hoch": None} + if n >= 2: + var = sum((x - mittel) ** 2 for x in werte) / (n - 1) + halb = Z * math.sqrt(var / n) * 100.0 # Halbbreite des 95-%-Intervalls in bb/100 + out.update({"halb95": halb, "tief": bb100 - halb, "hoch": bb100 + halb}) + return out + + +def abgleich(real, sim_bb100=SIM_OFFENSE_BB100): + """Sim-Vorhersage gegen das reale Ergebnis `real` (aus bb_pro_100). + + Liefert {sim, real, gap, deckt, urteil}: + gap = real.bb100 - sim_bb100 (negativ = die Kante kommt nicht an) + deckt = ob die Sim-Vorhersage im 95-%-Intervall des realen Ergebnisses liegt (None ohne Intervall) + urteil = kurzer Text. „zu dünn" wenn gar keine Hände; sonst passt/klafft je nach `deckt`.""" + if real["n"] == 0: + return {"sim": sim_bb100, "real": None, "gap": None, "deckt": None, + "urteil": "zu dünn - keine Hände"} + gap = real["bb100"] - sim_bb100 + deckt = None + if real["tief"] is not None: + deckt = real["tief"] <= sim_bb100 <= real["hoch"] + if deckt is None: + urteil = "eine Hand - kein Intervall, kein Urteil" + elif deckt: + urteil = "Sim-Vorhersage liegt im realen 95-%-Intervall - kein Widerspruch (bei dieser Streuung)" + else: + lage = "über" if gap < 0 else "unter" + urteil = (f"KLAFFT: die Sim-Kante liegt {lage} dem realen Intervall - " + f"{abs(gap):.0f} bb/100 Differenz kommen am Tisch nicht an") + return {"sim": sim_bb100, "real": real["bb100"], "gap": gap, "deckt": deckt, "urteil": urteil} + + +def ab_vergleich(an, aus): + """Das kontrollierte A/B: Engine-Kern AN vs AUS (COINPOKER_KERN-Split). `an`/`aus` = netto_bb je + Hand des jeweiligen Arms (verschiedene Hände, also ZWEI-Stichproben, nicht gepaart). + + Liefert {an, aus, diff, halb95, tief, hoch, signifikant, urteil}: + diff = an.bb100 - aus.bb100 (positiv = der Engine-Kern verdient mehr als die Baseline) + Intervall der Differenz: Welch-Standardfehler sqrt(se_an² + se_aus²), je se = halb95/z. + signifikant = ob 0 AUSSERHALB des 95-%-Intervalls der Differenz liegt (None ohne Intervall). + + DAS ist der Test, der die Confounds wegpaart: beide Arme sehen denselben Farm, dieselben Stakes, + dieselbe echte Population - nur der Kern wechselt. Was bleibt, ist die reine Kern-Kante. Er braucht + nur Hände unter BEIDEN Armen; die Rechnung steht hier fertig und ist spezifiziert.""" + a = bb_pro_100(an) + b = bb_pro_100(aus) + out = {"an": a, "aus": b, "diff": None, "halb95": None, "tief": None, "hoch": None, + "signifikant": None, "urteil": "zu dünn - beide Arme brauchen je ≥2 Hände"} + if a["n"] < 2 or b["n"] < 2: + return out + diff = a["bb100"] - b["bb100"] + se_an = a["halb95"] / Z # halb95 = z * se * 100 -> se (in bb/100) = halb95 / z + se_aus = b["halb95"] / Z + halb = Z * math.sqrt(se_an ** 2 + se_aus ** 2) + tief, hoch = diff - halb, diff + halb + sig = not (tief <= 0.0 <= hoch) + if not sig: + urteil = "kein signifikanter Unterschied - noch zu wenig Hände (das Intervall umfasst 0)" + elif diff > 0: + urteil = f"der Engine-Kern SCHLÄGT die Baseline signifikant: +{diff:.1f} bb/100 (95% {tief:+.1f}..{hoch:+.1f})" + else: + urteil = f"der Engine-Kern VERLIERT signifikant gegen die Baseline: {diff:.1f} bb/100 (95% {tief:+.1f}..{hoch:+.1f})" + out.update({"diff": diff, "halb95": halb, "tief": tief, "hoch": hoch, + "signifikant": sig, "urteil": urteil}) + return out + + +def ab_aus_log(haende, feld="kern", an_wert=None, aus_wert=None, ev=False): + """A/B aus EINEM gemischten Hand-Log, getrennt am Label `feld` (z. B. je Hand "kern":"an"/"aus"). + + `haende` = Liste von Hand-Dicts (nicht netto_bb-Werte - hier brauchen wir noch das Label). Ohne + gesetzte an_wert/aus_wert werden die zwei häufigsten Werte des Feldes als Arme genommen. So lässt + sich auch ein einziges haende.jsonl auswerten, wenn der Lauf die Hände je Arm markiert hat (sonst + trennt man die Arme über getrennte STATS_DIR-Ordner und nutzt `ab_vergleich` mit zwei Dateien). + + `ev=True`: nutzt den varianzreduzierten All-in-EV (netto_bb_ev) statt des realisierten netto_bb - + gleicher Mittelwert, kleinere Streuung, also schneller signifikant (lesen/allin_ev).""" + marken = {} + for h in haende: + if isinstance(h, dict) and feld in h and netto_bb(h, ev) is not None: + marken.setdefault(h[feld], []).append(netto_bb(h, ev)) + if an_wert is None or aus_wert is None: + haeufig = sorted(marken, key=lambda k: -len(marken[k])) + if len(haeufig) < 2: + return {"an": bb_pro_100([]), "aus": bb_pro_100([]), "diff": None, "halb95": None, + "tief": None, "hoch": None, "signifikant": None, + "urteil": f"nur ein Arm im Feld '{feld}' - getrennte Läufe/STATS_DIR nötig"} + an_wert = an_wert if an_wert is not None else haeufig[0] + aus_wert = aus_wert if aus_wert is not None else haeufig[1] + return ab_vergleich(marken.get(an_wert, []), marken.get(aus_wert, [])) + + +def laden_haende(pfad): + """Rohe Hand-Dicts aus einer jsonl-Datei (für `ab_aus_log`); kaputte Datei -> [].""" + out = [] + try: + with open(pfad, "r", encoding="utf-8", errors="replace") as f: + for zeile in f: + zeile = zeile.strip() + if not zeile: + continue + try: + d = json.loads(zeile) + except ValueError: + continue + if isinstance(d, dict): + out.append(d) + except OSError: + return [] + return out + + +def laden(pfad): + """netto_bb-Werte aus einer jsonl-Datei; fehlende/kaputte Datei -> [], nie eine Ausnahme.""" + try: + with open(pfad, "r", encoding="utf-8", errors="replace") as f: + return haende_lesen(f.read()) + except OSError: + return [] + + +def _zeile(label, b): + iv = "" if b["halb95"] is None else f" 95%: {b['tief']:+.2f} bis {b['hoch']:+.2f}" + wr = "-" if b["bb100"] is None else f"{b['bb100']:+.2f}" + return f" {label:<10} n={b['n']:<4} bb/100 {wr}{iv}" + + +def _ab_main(an_pfad, aus_pfad): + """CLI: das kontrollierte A/B aus zwei Arm-Logs (Kern an / Kern aus).""" + erg = ab_vergleich(laden(an_pfad), laden(aus_pfad)) + print("=== Stufe 4: kontrolliertes A/B (COINPOKER_KERN an vs aus) ===") + print(f"AN : {an_pfad}") + print(f"AUS: {aus_pfad}\n") + print(_zeile("Kern AN", erg["an"])) + print(_zeile("Kern AUS", erg["aus"])) + if erg["diff"] is not None: + print(f"\nDifferenz (an - aus): {erg['diff']:+.2f} bb/100") + print(f"Urteil: {erg['urteil']}") + return 0 + + +def main(argv): + if argv and argv[0] == "--ab": + if len(argv) < 3: + print("Nutzung: liveabgleich.py --ab ") + return 1 + return _ab_main(argv[1], argv[2]) + + if argv and argv[0] == "--ab-log": + if len(argv) < 2: + print("Nutzung: liveabgleich.py --ab-log [feld] [--ev]") + return 1 + ev = "--ev" in argv[2:] # All-in-EV (varianzreduziert) statt realisiert + rest = [a for a in argv[2:] if a != "--ev"] + feld = rest[0] if rest else "kern" + erg = ab_aus_log(laden_haende(argv[1]), feld=feld, ev=ev) + print("=== Stufe 4: A/B aus einem markierten Log ===") + print(f"Quelle: {argv[1]} (Feld '{feld}'{', All-in-EV' if ev else ''})\n") + print(_zeile("Kern AN", erg["an"])) + print(_zeile("Kern AUS", erg["aus"])) + if erg["diff"] is not None: + print(f"\nDifferenz (an - aus): {erg['diff']:+.2f} bb/100") + print(f"Urteil: {erg['urteil']}") + return 0 + + pfad = VORGABE_PFAD + sim = SIM_OFFENSE_BB100 + i = 0 + while i < len(argv): + if argv[i] == "--sim" and i + 1 < len(argv): + try: + sim = float(argv[i + 1]) + except ValueError: + pass + i += 2 + else: + pfad = argv[i] + i += 1 + + werte = laden(pfad) + real = bb_pro_100(werte) + erg = abgleich(real, sim) + + print("=== Stufe 4 (live-Hälfte): Sim-to-Real-OUTCOME-Abgleich ===") + print(f"Quelle: {pfad}\n") + print("REAL - was der Live-Lauf verdient hat:") + print(_zeile("gesamt", real)) + print(f"\nSIM - was das Labor vorhersagt (Offense gegen die gezogene Population): {sim:+.2f} bb/100") + if erg["gap"] is not None: + print(f"\nGAP (real - sim): {erg['gap']:+.2f} bb/100") + print(f"Urteil: {erg['urteil']}") + print("\n(Der Gap enthält Population-, Rake- und Betriebs-Confounds; sie trennt erst der") + print(" kontrollierte COINPOKER_KERN-An/Aus-Split - der eine noch-live Rest. Mehr Hände schärfen.)") + return 0 + + +if __name__ == "__main__": + sys.exit(main(sys.argv[1:])) diff --git a/src/bin/adaptive_gap.rs b/src/bin/adaptive_gap.rs new file mode 100644 index 00000000..896c9335 --- /dev/null +++ b/src/bin/adaptive_gap.rs @@ -0,0 +1,41 @@ +//! Stufe 3 of the synthetic lab: how much does an ADAPTING opponent change the engine's edge? +//! +//! For each drawn opponent, play the engine heads-up (inferring the opponent from session memory, its +//! real exploitation path) over the SAME deals twice: once with the opponent held static (the Stufe-0 +//! memory baseline), once with the opponent adapting its ruleset to the hero's observed aggression. +//! The paired per-deal difference is the bb/100 the engine's *stationary* read is worth against a +//! *moving* target — the first measurement of mind-game pressure in this work. +//! +//! Run: `cargo run --release --bin adaptive_gap`. + +use rechner::sim::adaptive::{adaptive_effect, Adapt, AdaptReport}; +use rechner::sim::population::Population; + +const SEED: u64 = 0x5EED_0001; +const OPPONENTS: usize = 48; +const DEALS: u32 = 400; + +fn line(r: &AdaptReport) { + let decisive = r.delta_bb_per_100.abs() - r.ci95 > 0.0; + println!( + " {:8} static {:+7.2} adaptiv {:+7.2} -> DELTA {:+7.2} bb/100 (paired +-{:.2}, anytime +-{:.2}) {}", + r.style, + r.static_bb_per_100, + r.adaptive_bb_per_100, + r.delta_bb_per_100, + r.ci95, + r.anytime_ci95, + if decisive { "SIGNIFIKANT" } else { "n.s." }, + ); +} + +fn main() { + let pop = Population::micro(); + println!("=== Stufe 3: adaptive Gegner — was kostet der stationaere Read gegen ein bewegliches Ziel? ==="); + println!("{OPPONENTS} Gegner x {DEALS} Austeilungen, heads-up, Engine erschliesst via Memory."); + println!("DELTA = adaptiv - statisch (negativ = die Engine blutet gegen die Reaktion).\n"); + + line(&adaptive_effect(&pop, OPPONENTS, DEALS, SEED, Adapt::Tighten)); + line(&adaptive_effect(&pop, OPPONENTS, DEALS, SEED, Adapt::Loosen)); + line(&adaptive_effect(&pop, OPPONENTS, DEALS, SEED, Adapt::Model)); +} diff --git a/src/bin/aivat_bench.rs b/src/bin/aivat_bench.rs new file mode 100644 index 00000000..a3ffe3f1 --- /dev/null +++ b/src/bin/aivat_bench.rs @@ -0,0 +1,72 @@ +//! Is the benchmark's variance reduction world-class, or just a fixed beta=1 guess? +//! +//! The ladder stores, per deal, hero's net result corrected by a luck control signal: `net - luck` +//! (`sim::session`). That is a control variate with coefficient FIXED at beta = 1. Because the luck +//! signal has expectation ~0, `net - beta*luck` is unbiased for EVERY beta, and the +//! variance-minimising coefficient is beta* = Cov(net, luck) / Var(luck) -- not necessarily 1. +//! AIVAT learns beta* by cross-fitting (`sim::aivat`), so it never beats the raw estimator by less +//! and, when beta* != 1, beats the hard-coded beta = 1 too. +//! +//! This binary MEASURES the gap on real sim data, for the high-variance scenarios the ladder cares +//! about, before any estimator change. Same mean across all three estimators = unbiased; the CI +//! ratios say how much, if anything, cross-fitting buys over the current bench. +//! +//! Run: `cargo run --release --bin aivat_bench`. + +use rechner::sim::aivat::{control_variate, raw}; +use rechner::sim::opponent::Opponent; +use rechner::sim::reader::Style; +use rechner::sim::session::{deal_net_and_luck, ReadMode, Setup}; + +const SEED: u64 = 0x5EED_0001; +const STACK_BB: f64 = 100.0; +const FOLDS: usize = 10; + +fn setup(players: u8, opponent: Opponent, deals: u32, read: ReadMode) -> Setup { + Setup { players, opponent, deals, stack_bb: STACK_BB, seed: SEED, read } +} + +/// A single-run win-rate estimate three ways. `beta = 0` is the raw mean; `beta = 1` is the ladder's +/// current luck-corrected sample; `beta*` is the cross-fitted AIVAT control variate. Units: bb/100. +fn report(name: &str, s: &Setup) { + let (net, luck) = deal_net_and_luck(s); + let n = net.len(); + + // beta = 0: raw net, no correction. + let (m0, h0) = raw(&net); + // beta = 1: the current ladder sample net - luck. + let corrected: Vec = net.iter().zip(&luck).map(|(y, c)| y - c).collect(); + let (m1, h1) = raw(&corrected); + // beta*: cross-fitted optimal coefficient (AIVAT). mu_c = 0 (luck is mean-zero by construction). + let (ms, hs) = control_variate(&net, &luck, 0.0, FOLDS).unwrap(); + + // Empirical beta* on the whole sample, for the record. + let mc = luck.iter().sum::() / n as f64; + let my = net.iter().sum::() / n as f64; + let cov = net.iter().zip(&luck).map(|(y, c)| (y - my) * (c - mc)).sum::() / n as f64; + let varc = luck.iter().map(|c| (c - mc).powi(2)).sum::() / n as f64; + let beta_star = if varc > 1e-12 { cov / varc } else { 0.0 }; + + println!("\n{name} ({n} deals)"); + println!(" mean bb/100 raw(b=0) {:+7.2} bench(b=1) {:+7.2} aivat(b*) {:+7.2}", 100.0 * m0, 100.0 * m1, 100.0 * ms); + println!(" ci95 bb/100 raw(b=0) {:7.2} bench(b=1) {:7.2} aivat(b*) {:7.2}", 100.0 * h0, 100.0 * h1, 100.0 * hs); + println!(" beta* = {beta_star:.3} (bench assumes 1.000)"); + println!( + " variance factor aivat/raw {:.2}x aivat/bench {:.2}x bench/raw {:.2}x", + (h0 / hs).powi(2), + (h1 / hs).powi(2), + (h0 / h1).powi(2) + ); + let drop = 100.0 * (1.0 - hs / h1); + println!(" AIVAT over current bench: CI {drop:+.1} % (positive = narrower)"); +} + +fn main() { + println!("=== Benchmark estimator audit: fixed beta=1 vs cross-fitted beta* (AIVAT) ==="); + println!("Unbiased iff the three means agree within a CI. Narrower aivat CI = world-class upgrade."); + report("heads-up gto", &setup(2, Opponent::Reader(Style::Gto), 3000, ReadMode::Oracle)); + report("heads-up gto-small", &setup(2, Opponent::Reader(Style::GtoSmall), 3000, ReadMode::Oracle)); + report("heads-up fish", &setup(2, Opponent::Reader(Style::Fish), 1000, ReadMode::Oracle)); + report("heads-up calling station", &setup(2, Opponent::CallingStation, 1000, ReadMode::Oracle)); + report("heads-up reg", &setup(2, Opponent::Reader(Style::Reg), 1000, ReadMode::Oracle)); +} diff --git a/src/bin/arch_read.rs b/src/bin/arch_read.rs new file mode 100644 index 00000000..fb5f7390 --- /dev/null +++ b/src/bin/arch_read.rs @@ -0,0 +1,38 @@ +//! Per-archetype Blind vs Memory EV: does acting on the (station) read HELP or HURT each archetype? +//! This decides whether softening the binary CallingStation trust is safe. If Memory ≥ Blind the read +//! is a net gain (keep trust high); if Memory < Blind the station exploit is already costing and +//! softening helps. Prints the gap = Memory − Blind. +//! +//! Run: `cargo run --release --bin arch_read [deals]` (default 4000; fast threshold styles only — +//! gto/gto-small run a per-decision solver and are covered by the twin gate). + +use rechner::exploit::style::classify; +use rechner::sim::opponent::Opponent; +use rechner::sim::reader::Style; +use rechner::sim::reads::opponent_profile; +use rechner::sim::session::{measure, ReadMode, Setup}; + +const SEED: u64 = 0x5EED_0001; +const STACK_BB: f64 = 100.0; + +fn ev(style: Style, read: ReadMode, deals: u32) -> f64 { + let setup = + Setup { players: 2, opponent: Opponent::Reader(style), deals, stack_bb: STACK_BB, seed: SEED, read }; + measure(&setup).bb_per_100 +} + +fn main() { + let deals: u32 = std::env::args().nth(1).and_then(|s| s.parse().ok()).unwrap_or(4000); + println!("=== Archetyp Blind vs Memory, {deals} Austeilungen ==="); + println!("gap = Memory - Blind (>0: Read nuetzt, <0: Station-Exploit kostet schon)\n"); + println!(" {:<8} {:>9} {:>9} {:>9} {}", "style", "blind", "memory", "gap", "oracle-classify"); + for style in [Style::Fish, Style::Reg, Style::Nit, Style::Maniac] { + let blind = ev(style, ReadMode::Blind, deals); + let memory = ev(style, ReadMode::Memory, deals); + let oc = opponent_profile(Opponent::Reader(style)).map(|p| format!("{:?}", classify(&p))); + println!( + " {:<8} {:>+9.2} {:>+9.2} {:>+9.2} {}", + style.name(), blind, memory, memory - blind, oc.unwrap_or_else(|| "-".into()) + ); + } +} diff --git a/src/bin/diag_gto.rs b/src/bin/diag_gto.rs new file mode 100644 index 00000000..0c5353f7 --- /dev/null +++ b/src/bin/diag_gto.rs @@ -0,0 +1,270 @@ +//! Diagnose WHERE the engine bleeds against the near-GTO opponent (`sim::gto`) heads-up. +//! +//! Replays the `heads-up gto` benchmark scenario deal for deal (same seed mixing, deal, hand seed, +//! oracle read, luck correction) but on the traced table path, so every hand carries a `Dec` per +//! hero decision. Attributes each hand's luck-corrected net to the street of hero's terminal +//! decision, the terminal action, and hero's position. The per-bucket contributions sum to the +//! scenario's bb/100 (−38 territory), so the table reads as "this many bb/100 come from here". +//! +//! Run: `cargo run --release --bin diag_gto`. + +use rechner::game::{Choice, Street}; +use rechner::rng::Rng; +use rechner::sim::opponent::Opponent; +use rechner::sim::reader::Style; +use rechner::sim::table::{deal, play_hand_traced, HandRead, HandSetup, TableCost}; +use std::collections::BTreeMap; + +const SEED: u64 = 0x5EED_0001; +const STACK_BB: f64 = 100.0; +const PLAYERS: usize = 2; + +/// Deal count (argv 1, default 1000) and opponent (argv 2: "gto" default, or "gto-small"). +fn config() -> (u32, Opponent, &'static str) { + let args: Vec = std::env::args().collect(); + let deals = args.get(1).and_then(|s| s.parse().ok()).unwrap_or(1000); + let (opponent, name) = match args.get(2).map(String::as_str) { + Some("gto-small") => (Opponent::Reader(Style::GtoSmall), "gto-small"), + _ => (Opponent::Reader(Style::Gto), "gto"), + }; + (deals, opponent, name) +} + +/// `session::mix`, reproduced (it is private there). +fn mix(seed: u64, n: u64) -> u64 { + Rng::seeded(seed ^ n.wrapping_mul(0xD1B5_4A32_D192_ED03)).next_u64().0 +} + +fn street_name(s: Street) -> &'static str { + match s { + Street::Preflop => "preflop", + Street::Flop => "flop", + Street::Turn => "turn", + Street::River => "river", + } +} + +/// The action kind of a terminal hero decision, folded over its size. +fn choice_name(c: Choice) -> &'static str { + match c { + Choice::Fold => "fold", + Choice::Check => "check", + Choice::Call => "call", + Choice::Raise { .. } => "raise/bet", + Choice::Abstain => "abstain", + } +} + +#[derive(Default, Clone, Copy)] +struct Agg { + hands: u32, + net: f64, // sum of luck-corrected net, bb +} + +impl Agg { + fn add(&mut self, net: f64) { + self.hands += 1; + self.net += net; + } +} + +/// bb/100 contribution of a bucket: `100 * sum(net) / total_hands`. These sum to the scenario rate. +fn contrib(net: f64, total_hands: u32) -> f64 { + 100.0 * net / total_hands.max(1) as f64 +} + +fn main() { + let (deals, opponent, opp_name) = config(); + let mut total = Agg::default(); + + // Attribution buckets. + let mut by_terminal: BTreeMap<(Street, &'static str), Agg> = BTreeMap::new(); + let mut by_position: BTreeMap = BTreeMap::new(); + let mut by_street_reached: BTreeMap = BTreeMap::new(); + // Per-street action frequency over ALL hero decisions (not just terminal). + let mut action_counts: BTreeMap<(Street, &'static str), u32> = BTreeMap::new(); + // Per-street: hands whose terminal decision is on that street, split value won vs lost. + let mut pos_terminal: BTreeMap<(u8, Street, &'static str), Agg> = BTreeMap::new(); + // Drill into the dominant leak: river calls bucketed by the equity the engine stated for the call. + let mut eq_bands: BTreeMap<&'static str, Agg> = BTreeMap::new(); + // Over-fold test: when hero FACES a bet (to_call>0), does it fold despite the odds to continue? + // break_even be = to_call/pot (pot already includes the bet). A fold with equity >= be is an + // over-fold by the model's own equity. Slots: [faced, folds, folds_with_odds, folds_eq_unknown]. + let mut facing: BTreeMap = BTreeMap::new(); + // Net of terminal-fold hands that faced a bet, split by whether hero had the odds (eq>=be). + let mut overfold_net: BTreeMap<(Street, &'static str), Agg> = BTreeMap::new(); + // Example losing river calls (what is hero actually bluff-catching with?). + let mut river_call_examples: Vec = Vec::new(); + + for d in 0..deals { + let (cards, _) = deal(PLAYERS, Rng::seeded(mix(SEED, d as u64))); + for hero_seat in 1..=PLAYERS as u8 { + let hand = HandSetup { + deal: &cards, + hero_seat, + opponent, + stack_bb: STACK_BB, + seed: mix(SEED ^ 0xA5A5, (d as u64) << 8 | hero_seat as u64), + read: HandRead::Oracle, + }; + let (res, trace) = play_hand_traced(&hand, TableCost::FREE); + let net = res.hero_net - res.luck; // luck-corrected, matches the ladder + total.add(net); + by_position.entry(hero_seat).or_default().add(net); + + // Every hero decision's action, by street (aggression distribution) + fold discipline + // when facing a bet. + for dec in &trace { + *action_counts.entry((dec.street, choice_name(dec.choice))).or_default() += 1; + if dec.to_call > 0.0 && dec.pot > 0.0 { + let be = dec.to_call / dec.pot; + let slot = facing.entry(dec.street).or_insert([0; 4]); + slot[0] += 1; + if matches!(dec.choice, Choice::Fold) { + slot[1] += 1; + match dec.equity { + Some(e) if e >= be => slot[2] += 1, + Some(_) => {} + None => slot[3] += 1, + } + } + } + } + + // Deepest street hero reached (acted on at all). + let reached = trace.iter().map(|d| d.street).max().unwrap_or(Street::Preflop); + by_street_reached.entry(reached).or_default().add(net); + + // Terminal decision: the last Dec of the hand. + if let Some(last) = trace.last() { + let key = (last.street, choice_name(last.choice)); + by_terminal.entry(key).or_default().add(net); + pos_terminal.entry((hero_seat, last.street, choice_name(last.choice))).or_default().add(net); + if last.street == Street::River && matches!(last.choice, Choice::Call) { + let band = match last.equity { + Some(e) if e < 0.35 => "eq <0.35", + Some(e) if e < 0.45 => "eq 0.35-0.45", + Some(e) if e < 0.55 => "eq 0.45-0.55", + Some(_) => "eq >=0.55", + None => "eq n/a", + }; + eq_bands.entry(band).or_default().add(net); + // Dump a handful of losing marginal river calls to see the bluff-catcher. + if net < -2.0 && river_call_examples.len() < 16 { + let hole = cards.holes[hero_seat as usize - 1]; + let holes = format!("{} {}", hole[0].short(), hole[1].short()); + let board: Vec = cards.board.iter().map(|c| c.short()).collect(); + river_call_examples.push(format!( + " {:<7} board {:<17} pot {:>5.1} call {:>4.1} eq {:>5.2} net {:>+6.1}", + holes, board.join(" "), last.pot, last.to_call, + last.equity.unwrap_or(f64::NAN), net + )); + } + } + if matches!(last.choice, Choice::Fold) && last.to_call > 0.0 && last.pot > 0.0 { + let be = last.to_call / last.pot; + let tag = match last.equity { + Some(e) if e >= be => "had odds (eq>=be)", + Some(_) => "no odds (eq "eq n/a (preflop chart)", + }; + overfold_net.entry((last.street, tag)).or_default().add(net); + } + } + } + } + + let h = total.hands; + println!("=== heads-up {} diagnosis: {} hands, overall {:+.2} bb/100 ===\n", opp_name, h, contrib(total.net, h)); + + println!("-- by hero position (seat 1 = button/SB, seat 2 = BB) --"); + for (seat, a) in &by_position { + let role = if *seat == 1 { "button/SB" } else { "BB" }; + println!( + " seat {} {:<10} {:+8.2} bb/100 {:>5} hands {:+7.3} bb/hand", + seat, role, contrib(a.net, h), a.hands, a.net / a.hands.max(1) as f64 + ); + } + + println!("\n-- by deepest street hero reached --"); + for (s, a) in &by_street_reached { + println!( + " {:<8} {:+8.2} bb/100 {:>5} hands {:+7.3} bb/hand", + street_name(*s), contrib(a.net, h), a.hands, a.net / a.hands.max(1) as f64 + ); + } + + println!("\n-- by terminal decision (street x action of hero's LAST choice) --"); + println!(" {:<18} {:>10} {:>6} {:>10} {:>10}", "bucket", "bb/100", "hands", "bb/hand", "share%"); + let mut rows: Vec<_> = by_terminal.iter().collect(); + rows.sort_by(|a, b| a.1.net.partial_cmp(&b.1.net).unwrap()); + for ((s, act), a) in rows { + println!( + " {:<18} {:>+10.2} {:>6} {:>+10.3} {:>9.1}%", + format!("{} {}", street_name(*s), act), + contrib(a.net, h), a.hands, a.net / a.hands.max(1) as f64, + 100.0 * a.hands as f64 / h as f64 + ); + } + + println!("\n-- terminal decision split by position --"); + println!(" {:<28} {:>10} {:>6} {:>10}", "pos / bucket", "bb/100", "hands", "bb/hand"); + let mut prows: Vec<_> = pos_terminal.iter().collect(); + prows.sort_by(|a, b| a.1.net.partial_cmp(&b.1.net).unwrap()); + for ((seat, s, act), a) in prows.iter().take(12) { + let role = if *seat == 1 { "BTN" } else { "BB" }; + println!( + " {:<28} {:>+10.2} {:>6} {:>+10.3}", + format!("{} {} {}", role, street_name(*s), act), + contrib(a.net, h), a.hands, a.net / a.hands.max(1) as f64 + ); + } + + // Drill: the dominant leak. River calls bucketed by the equity the engine stated for the call. + println!("\n-- river CALL leak: by engine-stated equity at the call --"); + println!(" {:<14} {:>10} {:>6} {:>10}", "equity band", "bb/100", "hands", "bb/hand"); + for (band, a) in &eq_bands { + println!( + " {:<14} {:>+10.2} {:>6} {:>+10.3}", + band, contrib(a.net, h), a.hands, a.net / a.hands.max(1) as f64 + ); + } + + println!("\n-- example losing river calls (hero's bluff-catcher) --"); + for line in &river_call_examples { + println!("{line}"); + } + + println!("\n-- facing a bet: fold discipline per street (be = to_call/pot) --"); + println!(" {:<8} {:>7} {:>7} {:>16} {:>10}", "street", "faced", "folds", "folds w/ odds", "fold%"); + for (s, c) in &facing { + println!( + " {:<8} {:>7} {:>7} {:>16} {:>9.1}%", + street_name(*s), c[0], c[1], c[2], 100.0 * c[1] as f64 / c[0].max(1) as f64 + ); + } + + println!("\n-- terminal folds that faced a bet: net by whether hero had the odds --"); + println!(" {:<30} {:>10} {:>6} {:>10}", "street / odds", "bb/100", "hands", "bb/hand"); + let mut ofrows: Vec<_> = overfold_net.iter().collect(); + ofrows.sort_by(|a, b| a.1.net.partial_cmp(&b.1.net).unwrap()); + for ((s, tag), a) in ofrows { + println!( + " {:<30} {:>+10.2} {:>6} {:>+10.3}", + format!("{} {}", street_name(*s), tag), contrib(a.net, h), a.hands, a.net / a.hands.max(1) as f64 + ); + } + + println!("\n-- hero action frequency per street (all decisions) --"); + let mut street_totals: BTreeMap = BTreeMap::new(); + for ((s, _), c) in &action_counts { + *street_totals.entry(*s).or_default() += c; + } + for ((s, act), c) in &action_counts { + let tot = street_totals[s].max(1); + println!( + " {:<8} {:<10} {:>6} {:>5.1}%", + street_name(*s), act, c, 100.0 * *c as f64 / tot as f64 + ); + } +} diff --git a/src/bin/diag_nemesis.rs b/src/bin/diag_nemesis.rs new file mode 100644 index 00000000..e071dbfb --- /dev/null +++ b/src/bin/diag_nemesis.rs @@ -0,0 +1,195 @@ +//! Diagnose WHERE the engine bleeds against its NEMESIS — the sticky low-bluff calling station the +//! CMA-ES found (`sim::optimize::worst_case_opponent`, −414 bb/100). The nemesis ruleset is a fixed +//! `Rules`: call_margin 0.215 (calls very wide), bluff 0.068 (almost never bluffs), size 0.441. It +//! rarely folds and rarely bluffs, so barreling into it has no fold equity — the engine should check +//! back / give up, not bluff. +//! +//! Mirrors `diag_gto`'s traced attribution, but (a) the opponent is the explicit nemesis `Rules`, +//! (b) the read is the realistic converged Memory snapshot (the lab measures the nemesis under Memory), +//! and (c) the drill is on the AGGRESSIVE side (hero bet/raise buckets, bluff-into-station), because +//! this is the over-barrel mirror of the GTO over-defense leak. +//! +//! Run: `cargo run --release --bin diag_nemesis [deals]`. + +use rechner::exploit::style::classify; +use rechner::game::{Choice, Street}; +use rechner::rng::Rng; +use rechner::sim::memory::SessionMemory; +use rechner::sim::opponent::Opponent; +use rechner::sim::reader::Rules; +use rechner::sim::table::{deal, play_hand_tracked, play_hand_traced, HandRead, HandSetup, TableCost}; +use std::collections::BTreeMap; + +const SEED: u64 = 0x5EED_0001; +const STACK_BB: f64 = 100.0; +const PLAYERS: usize = 2; + +/// The original nemesis ruleset (full-budget run vs the pre-fix engine). +const NEMESIS: Rules = Rules { + call_margin: 0.215, + raise_at: 0.587, + bet_at: 0.548, + open_at: 0.729, + bluff: 0.068, + size: 0.441, +}; + +/// The new worst case the CMA-ES finds against the FIXED engine (fast scan). Also read-driven +/// (Blind +114, Memory −87). +const NEMESIS2: Rules = Rules { + call_margin: 0.173, + raise_at: 0.579, + bet_at: 0.748, + open_at: 0.800, + bluff: 0.229, + size: 0.996, +}; + +/// The worst case the CMA-ES finds against the SOFT-TRUST engine (fast scan, −52.65 bb/100): folds air +/// hard (call_margin 0.396), opens very wide (0.468), rarely raises, overbets (size 1.148). +const NEMESIS3: Rules = Rules { + call_margin: 0.396, + raise_at: 0.769, + bet_at: 0.615, + open_at: 0.468, + bluff: 0.261, + size: 1.148, +}; + +fn mix(seed: u64, n: u64) -> u64 { + Rng::seeded(seed ^ n.wrapping_mul(0xD1B5_4A32_D192_ED03)).next_u64().0 +} + +fn street_name(s: Street) -> &'static str { + match s { + Street::Preflop => "preflop", + Street::Flop => "flop", + Street::Turn => "turn", + Street::River => "river", + } +} + +fn choice_name(c: Choice) -> &'static str { + match c { + Choice::Fold => "fold", + Choice::Check => "check", + Choice::Call => "call", + Choice::Raise { .. } => "raise/bet", + Choice::Abstain => "abstain", + } +} + +#[derive(Default, Clone, Copy)] +struct Agg { + hands: u32, + net: f64, +} +impl Agg { + fn add(&mut self, net: f64) { + self.hands += 1; + self.net += net; + } +} + +fn contrib(net: f64, total_hands: u32) -> f64 { + 100.0 * net / total_hands.max(1) as f64 +} + +/// Trace all deals under one fixed read; return (total, terminal buckets by (street, action)). +fn run(opponent: Opponent, deals: u32, read: Option) + -> (Agg, BTreeMap<(Street, &'static str), Agg>) { + let mut total = Agg::default(); + let mut by_terminal: BTreeMap<(Street, &'static str), Agg> = BTreeMap::new(); + for d in 0..deals { + let (cards, _) = deal(PLAYERS, Rng::seeded(mix(SEED, d as u64))); + for hero_seat in 1..=PLAYERS as u8 { + let hand = HandSetup { + deal: &cards, + hero_seat, + opponent, + stack_bb: STACK_BB, + seed: mix(SEED ^ 0xA5A5, (d as u64) << 8 | hero_seat as u64), + read: HandRead::Given(read), + }; + let (res, trace) = play_hand_traced(&hand, TableCost::FREE); + let net = res.hero_net - res.luck; // luck-corrected + total.add(net); + if let Some(last) = trace.last() { + by_terminal.entry((last.street, choice_name(last.choice))).or_default().add(net); + } + } + } + (total, by_terminal) +} + +fn main() { + let deals: u32 = std::env::args().nth(1).and_then(|s| s.parse().ok()).unwrap_or(2000); + let which: u32 = std::env::args().nth(2).and_then(|s| s.parse().ok()).unwrap_or(1); + let opponent = Opponent::Styled(match which { + 3 => NEMESIS3, + 2 => NEMESIS2, + _ => NEMESIS, + }); + + // --- Pass 1: converge the Memory read exactly as session::deal_samples does. --- + let mut memory = SessionMemory::new(); + for d in 0..deals { + let (cards, _) = deal(PLAYERS, Rng::seeded(mix(SEED, d as u64))); + for hero_seat in 1..=PLAYERS as u8 { + let hand = HandSetup { + deal: &cards, + hero_seat, + opponent, + stack_bb: STACK_BB, + seed: mix(SEED ^ 0xA5A5, (d as u64) << 8 | hero_seat as u64), + read: HandRead::Given(memory.read()), + }; + play_hand_tracked(&hand, TableCost::FREE, Some(&mut memory)); + } + } + let read = memory.read(); + println!("=== Nemesis-Diagnose (Memory vs Blind): {deals} Austeilungen ===\n"); + print!("-- konvergierter Read des Nemesis: "); + match read { + None => println!("kein Read"), + Some(p) => println!( + "vpip {:.2} pfr {:.2} fold2bet {:.2} aggr {:.2} -> classify {:?}", + p.vpip.unwrap_or(f64::NAN), p.pfr.unwrap_or(f64::NAN), + p.fold_to_bet.unwrap_or(f64::NAN), p.aggression.unwrap_or(f64::NAN), classify(&p), + ), + } + + // --- Pass 2+3: same deals under the converged Memory read and under blind (None). --- + let (mem_total, mem_buckets) = run(opponent, deals, read); + let (blind_total, blind_buckets) = run(opponent, deals, None); + let h = mem_total.hands; + + println!( + "\n-- gesamt: Memory {:+.2} vs Blind {:+.2} bb/100 (Delta {:+.2}, {} Haende) --", + contrib(mem_total.net, h), contrib(blind_total.net, h), + contrib(mem_total.net - blind_total.net, h), h + ); + + // Per terminal bucket: Memory, Blind, and the Memory−Blind delta (the leak per bucket), sorted by + // the delta (most-costly read-driven bucket first). + let mut keys: std::collections::BTreeSet<(Street, &'static str)> = std::collections::BTreeSet::new(); + keys.extend(mem_buckets.keys().copied()); + keys.extend(blind_buckets.keys().copied()); + let get = |m: &BTreeMap<(Street, &'static str), Agg>, k: &(Street, &'static str)| { + m.get(k).copied().unwrap_or_default() + }; + let mut rows: Vec<_> = keys.into_iter().map(|k| { + let (m, b) = (get(&mem_buckets, &k), get(&blind_buckets, &k)); + (k, contrib(m.net, h), contrib(b.net, h), contrib(m.net - b.net, h), m.hands, b.hands) + }).collect(); + rows.sort_by(|a, b| a.3.partial_cmp(&b.3).unwrap()); + + println!("\n-- nach terminaler Entscheidung: Memory vs Blind (Delta = Leck je Bucket) --"); + println!(" {:<18} {:>10} {:>10} {:>10} {:>8} {:>8}", "bucket", "mem", "blind", "DELTA", "mem#", "blind#"); + for ((s, act), m, b, delta, mh, bh) in rows { + println!( + " {:<18} {:>+10.2} {:>+10.2} {:>+10.2} {:>8} {:>8}", + format!("{} {}", street_name(s), act), m, b, delta, mh, bh + ); + } +} diff --git a/src/bin/exploit_gap.rs b/src/bin/exploit_gap.rs new file mode 100644 index 00000000..6ddd15e5 --- /dev/null +++ b/src/bin/exploit_gap.rs @@ -0,0 +1,39 @@ +//! Stufe 0 of the synthetic lab: print the exploitation gap over a drawn opponent population. +//! +//! Draws a micro-stakes field, plays the live engine heads-up against each opponent with NO oracle +//! read — once blind, once inferring from session memory — and reports `memory - blind` in bb/100, +//! pooled and per hidden archetype. This is the exploitation number the fixed-bot ladder hides. +//! +//! Run: `cargo run --release --bin exploit_gap`. + +use rechner::sim::exploit_pop::exploitation_gap; +use rechner::sim::population::Population; + +const SEED: u64 = 0x5EED_0001; +const OPPONENTS: usize = 48; +const DEALS: u32 = 400; + +fn main() { + let pop = Population::micro(); + println!("=== Stufe 0: Exploitation-Lücke gegen eine gezogene Population ==="); + println!("{OPPONENTS} Gegner x {DEALS} Austeilungen, heads-up, KEIN Oracle-Read (Engine muss erschließen).\n"); + + let r = exploitation_gap(&pop, OPPONENTS, DEALS, SEED); + + println!("blind (kein Read) {:+8.2} bb/100", r.blind_bb_per_100); + println!("memory (erschlossen) {:+8.2} bb/100", r.memory_bb_per_100); + println!( + "\nEXPLOITATION-LÜCKE {:+8.2} bb/100 (paired +-{:.2}, anytime +-{:.2})", + r.gap_bb_per_100, r.ci95, r.anytime_ci95 + ); + let decisive = r.gap_bb_per_100 - r.ci95 > 0.0; + println!( + " {} bei 95 %\n", + if decisive { "SIGNIFIKANT POSITIV" } else { "noch nicht von 0 trennbar" } + ); + + println!("nach verdecktem Archetyp (mittlere Lücke je Gegner):"); + for (label, (sum, n)) in &r.by_label { + println!(" {label:8} {:+7.2} bb/100 ({n} Gegner)", sum / *n as f64); + } +} diff --git a/src/bin/exploit_scan.rs b/src/bin/exploit_scan.rs new file mode 100644 index 00000000..17dcfaad --- /dev/null +++ b/src/bin/exploit_scan.rs @@ -0,0 +1,85 @@ +//! Scan the LIVE engine's heads-up river exploitability across board textures. +//! +//! The first postflop-exploitability number for this engine (the measure MODULES.md names as missing). +//! For each board, hero and villain hold the FULL remaining range (every unblocked two-card combo); +//! the harness (`sim::exploit_river`) buckets them by exact showdown strength, solves the river +//! subgame for the equilibrium value, plays the engine's real policy as hero, and lets the villain +//! best-respond. Exploitability = v* - value(engine | villain best-responds), in bb/100, always >= 0. +//! +//! Run: `cargo run --release --bin exploit_scan`. Pot and bet default to 6 and 4 bb (two-thirds pot). + +use rechner::card::Card; +use rechner::exploit::profile::Profile; +use rechner::sim::exploit_river::{exploitability_river, RiverSpec}; + +const ITERS: u32 = 60_000; +const SEED: u64 = 0x5EED_0001; +const POT: f64 = 6.0; +const BET: f64 = 4.0; + +/// The 52-card deck minus the board. +fn remaining(board: &[Card]) -> Vec { + (0..52) + .filter_map(Card::from_index) + .filter(|c| !board.contains(c)) + .collect() +} + +/// Every two-card combo from a card list. +fn combos(cards: &[Card]) -> Vec> { + let mut out = Vec::new(); + for i in 0..cards.len() { + for j in (i + 1)..cards.len() { + out.push(vec![cards[i], cards[j]]); + } + } + out +} + +fn scan(label: &str, board_text: &str, profile: Option, profile_label: &str) { + let board = Card::parse_list(board_text).expect("valid board"); + let deck = remaining(&board); + let range = combos(&deck); + let spec = RiverSpec { + board: &board, + hero_range: &range, + villain_range: &range, + villain_profile: profile, + pot: POT, + bet: BET, + }; + match exploitability_river(&spec, ITERS, SEED) { + Some(r) => println!( + "{label:<22} {board_text:<17} {profile_label:<8} buckets {:>3} v* {:>8.1} engine {:>8.1} exploitability {:>7.1} bb/100", + r.buckets, r.gto_value, r.engine_value_vs_br, r.exploitability + ), + None => println!("{label:<22} {board_text:<17} degenerate subgame"), + } +} + +fn main() { + // A representative near-GTO villain belief (reads.rs gto), and the unread default. + let gto = Profile { + vpip: Some(0.32), + pfr: Some(0.22), + fold_to_bet: Some(0.42), + aggression: Some(0.40), + ..Profile::default() + }; + println!("heads-up river exploitability, pot {POT} bet {BET} (two-thirds), {ITERS} solver iters\n"); + let boards = [ + ("dry ace-high", "Ah Kd 7c 2s 9h"), + ("paired board", "Kh Kd 7c 2s 9h"), + ("wet connected", "9h 8h 7c 6s 2h"), + ("monotone", "Ah Jh 8h 3h 2c"), + ("low dry", "7c 4d 2s 9h Js"), + ("broadway", "Ah Ks Qd Jc 2h"), + ]; + for (label, board) in boards { + scan(label, board, None, "unread"); + } + println!(); + for (label, board) in boards { + scan(label, board, Some(gto), "gto"); + } +} diff --git a/src/bin/floor_read.rs b/src/bin/floor_read.rs new file mode 100644 index 00000000..bcf5db12 --- /dev/null +++ b/src/bin/floor_read.rs @@ -0,0 +1,41 @@ +//! The read-driven slice of the GTO robustness floor: gto / gto-small per read mode. +//! +//! For a `Regular`/`Gto` the range model is gated to blind in every read mode (`earned_trust == 0`), so +//! the only lever that touches it is the ungated MDF floor. Before the `over_bluffs` fix the session +//! (Memory) read tagged the balanced heads-up opponent LooseAggressive on preflop width alone, firing +//! the floor to force-call its value bets — so Memory sat with Blind, ~12 bb/100 below Oracle +//! (BEFUND-gto-ueberdefense-read). After the fix the floor keys on measured postflop aggression, which +//! the balanced opponent does not trip, so Memory recovers toward Oracle (the read-gap closes). +//! +//! Run: `cargo run --release --bin floor_read [deals]` (default 4000, twin_gate's archetype budget). + +use rechner::sim::opponent::Opponent; +use rechner::sim::reader::Style; +use rechner::sim::session::{measure, ReadMode, Setup}; + +const SEED: u64 = 0x5EED_0001; +const STACK_BB: f64 = 100.0; + +fn row(style: Style, read: ReadMode, deals: u32) { + let setup = Setup { players: 2, opponent: Opponent::Reader(style), deals, stack_bb: STACK_BB, seed: SEED, read }; + let m = measure(&setup); + println!( + " {:<9} {:<7} {:>+8.2} bb/100 ±{:>5.2}", + style.name(), + format!("{read:?}"), + m.bb_per_100, + m.ci95, + ); +} + +fn main() { + let deals: u32 = std::env::args().nth(1).and_then(|s| s.parse().ok()).unwrap_or(4000); + println!("=== Floor-Read: gto/gto-small je Lese-Modus, {deals} Austeilungen ==="); + println!("Nach dem Fix sollte Memory ~= Oracle sein (Read-Luecke geschlossen), nicht mehr = Blind.\n"); + for style in [Style::Gto, Style::GtoSmall] { + for read in [ReadMode::Oracle, ReadMode::Blind, ReadMode::Memory] { + row(style, read, deals); + } + println!(); + } +} diff --git a/src/bin/gto_read_probe.rs b/src/bin/gto_read_probe.rs new file mode 100644 index 00000000..99eaf836 --- /dev/null +++ b/src/bin/gto_read_probe.rs @@ -0,0 +1,74 @@ +//! Does the session (Memory) read misclassify the balanced heads-up gto as LooseAggressive, tripping +//! the MDF floor's `over_bluffs`? Accumulates `SessionMemory` over a session against the gto exactly as +//! `session::deal_samples` does, and prints the evolving read + `classify` at checkpoints. +//! +//! Run: `cargo run --release --bin gto_read_probe [deals]`. + +use rechner::exploit::style::classify; +use rechner::rng::Rng; +use rechner::sim::memory::SessionMemory; +use rechner::sim::opponent::Opponent; +use rechner::sim::reader::Style; +use rechner::sim::table::{deal, play_hand_tracked, HandRead, HandSetup, TableCost}; + +const SEED: u64 = 0x5EED_0001; +const STACK_BB: f64 = 100.0; +const PLAYERS: usize = 2; + +fn mix(seed: u64, n: u64) -> u64 { + Rng::seeded(seed ^ n.wrapping_mul(0xD1B5_4A32_D192_ED03)).next_u64().0 +} + +/// The shipped `over_bluffs` predicate (mdf_floor): measured postflop aggression ≥ 0.45, NOT preflop +/// width. The old rule (`classify == LooseAggressive || aggr >= 0.60`) misfired on the balanced wide +/// heads-up read; this probe shows why (classify still says LooseAggressive, but aggr stays ~0.35). +fn over_bluffs_now(p: &rechner::exploit::profile::Profile) -> bool { + p.aggression.is_some_and(|a| a >= 0.45) +} + +fn final_read(style: Style, deals: u32) { + let mut memory = SessionMemory::new(); + for d in 0..deals { + let (cards, _) = deal(PLAYERS, Rng::seeded(mix(SEED, d as u64))); + for hero_seat in 1..=PLAYERS as u8 { + let hand = HandSetup { + deal: &cards, + hero_seat, + opponent: Opponent::Reader(style), + stack_bb: STACK_BB, + seed: mix(SEED ^ 0xA5A5, (d as u64) << 8 | hero_seat as u64), + read: HandRead::Given(memory.read()), + }; + play_hand_tracked(&hand, TableCost::FREE, Some(&mut memory)); + } + } + match memory.read() { + None => println!(" {:<10} kein Read", style.name()), + Some(p) => println!( + " {:<10} vpip {:>4.2} pfr {:>4.2} fold2bet {:>4.2} aggr {:>4.2} -> {:<16} over_bluffs={}", + style.name(), + p.vpip.unwrap_or(f64::NAN), + p.pfr.unwrap_or(f64::NAN), + p.fold_to_bet.unwrap_or(f64::NAN), + p.aggression.unwrap_or(f64::NAN), + format!("{:?}", classify(&p)), + over_bluffs_now(&p), + ), + } +} + +fn main() { + let deals: u32 = std::env::args().nth(1).and_then(|s| s.parse().ok()).unwrap_or(3000); + println!("=== Memory-Read je Archetyp (Endstand), {deals} Austeilungen ==="); + println!("over_bluffs (geshippt) = aggression>=0.45 => MDF-Boden feuert (NICHT mehr Preflop-Breite)."); + println!("Balanciert (gto/gto-small) sollte over_bluffs=false sein, Maniac=true.\n"); + // Fast archetypes only here (no solver). `GTO_TOO=1` also runs gto/gto-small (slow solver). + let mut styles = vec![Style::Maniac, Style::Fish, Style::Reg, Style::Nit]; + if std::env::var("GTO_TOO").is_ok() { + styles.push(Style::Gto); + styles.push(Style::GtoSmall); + } + for style in styles { + final_read(style, deals); + } +} diff --git a/src/bin/league.rs b/src/bin/league.rs new file mode 100644 index 00000000..a83afb02 --- /dev/null +++ b/src/bin/league.rs @@ -0,0 +1,33 @@ +//! Stufe 3 / L3 of the synthetic lab: score the engine across the whole LEAGUE. +//! +//! Static field draws + the L1 reactive opponents + the L2 modelling opponent + the Stufe-5 nemesis, +//! all at once. The league mean says how the engine does on average; the WORST member is the +//! robustness floor — the one a change must never cave against. A richer-pool sibling of the twin +//! gate's six-archetype floor. +//! +//! Run: `cargo run --release --bin league`. + +use rechner::sim::league::evaluate; +use rechner::sim::population::Population; + +const SEED: u64 = 0x5EED_0001; +const POP_MEMBERS: usize = 12; +const DEALS: u32 = 400; + +fn main() { + let pop = Population::micro(); + println!("=== Stufe 3 / L3: die Liga — Robustheit gegen einen Pool, kein Overfit ==="); + println!("{POP_MEMBERS} Populationszieher + L1 (tighten/loosen) + L2 (model) + Nemesis, je {DEALS} Austeilungen.\n"); + + let r = evaluate(&pop, POP_MEMBERS, DEALS, SEED); + + let mut members = r.members.clone(); + members.sort_by(|a, b| a.ev_bb_per_100.partial_cmp(&b.ev_bb_per_100).unwrap()); + for m in &members { + let mark = if m.name == r.worst_name { " <- BODEN" } else { "" }; + println!(" {:22} {:+9.2} bb/100 ±{:.2}{}", m.name, m.ev_bb_per_100, m.ci95, mark); + } + println!("\nLiga-Mittel : {:+.2} bb/100", r.mean_bb_per_100); + println!("Liga-Boden : {} {:+.2} bb/100 ±{:.2}", r.worst_name, r.worst_bb_per_100, r.worst_ci95); + println!("\nRobust heisst: der Boden haelt. Der Mittelwert allein genuegt nicht."); +} diff --git a/src/bin/nemesis.rs b/src/bin/nemesis.rs new file mode 100644 index 00000000..d0c99d09 --- /dev/null +++ b/src/bin/nemesis.rs @@ -0,0 +1,33 @@ +//! Stufe 5 of the synthetic lab: find the engine's NEMESIS — the worst-case individual opponent. +//! +//! Runs the diagonal CMA-ES (`sim::optimize`) over the 6-dim ruleset space to find the realistic +//! opponent the engine does worst against, an empirical best response in opponent-space. This is a +//! tighter robustness probe than the twin gate's "worst of six archetypes" floor: it searches the +//! whole continuous neighbourhood. The same optimizer tunes the engine's own hyperparameters once they +//! are exposed as a vector — that is the "polish, last" step the architecture names. +//! +//! Run: `cargo run --release --bin nemesis`. + +use rechner::sim::optimize::worst_case_opponent; + +const SEED: u64 = 0x5EED_0001; +// Higher budget now that the λ-evaluations run in parallel: more deals per evaluation tightens the +// nemesis EV, more generations let the CMA-ES converge further into the worst-case region. Overridable +// from argv (`nemesis [deals] [generations]`) for a fast scan before the full-budget confirmation. +const DEALS: u32 = 1000; +const GENERATIONS: u32 = 14; + +fn main() { + let deals: u32 = std::env::args().nth(1).and_then(|s| s.parse().ok()).unwrap_or(DEALS); + let generations: u32 = std::env::args().nth(2).and_then(|s| s.parse().ok()).unwrap_or(GENERATIONS); + println!("=== Stufe 5: der Nemesis — schlechtester Gegner der Engine (CMA-ES ueber den Regelraum) ==="); + println!("{deals} Austeilungen je Auswertung, {generations} Generationen, Memory-Read.\n"); + + let (r, ev) = worst_case_opponent(deals, generations, SEED); + + println!("Nemesis-Regelwerk (realistische Schranken):"); + println!(" call_margin {:.3} raise_at {:.3} bet_at {:.3}", r.call_margin, r.raise_at, r.bet_at); + println!(" open_at {:.3} bluff {:.3} size {:.3}", r.open_at, r.bluff, r.size); + println!("\nEngine-EV gegen den Nemesis: {ev:+.2} bb/100"); + println!("(> 0 = die Engine schlaegt selbst ihren schlechtesten realistischen Gegner.)"); +} diff --git a/src/bin/nemesis_read.rs b/src/bin/nemesis_read.rs new file mode 100644 index 00000000..39d79a49 --- /dev/null +++ b/src/bin/nemesis_read.rs @@ -0,0 +1,80 @@ +//! Is the nemesis leak read-driven? Measure the engine's EV vs the fixed nemesis ruleset under each +//! read mode. If Blind >> Memory, the catastrophe is the TRUSTED CallingStation read (vpip 0.53 trips +//! the `loose -> CallingStation` path, earned_trust 1.0), and gating the nemesis to blind — by making +//! `classify` require a station to be postflop-passive, so this aggressive frequent-folder reads +//! Regular — recovers it toward the Blind ceiling. +//! +//! Run: `cargo run --release --bin nemesis_read [deals]`. + +use rechner::exploit::style::classify; +use rechner::sim::opponent::Opponent; +use rechner::sim::reader::Rules; +use rechner::sim::session::{measure, ReadMode, Setup}; + +const SEED: u64 = 0x5EED_0001; +const STACK_BB: f64 = 100.0; + +/// The original CMA-ES nemesis (full-budget, vs the pre-fix engine): a reg-tight low-bluff caller +/// that bet a lot and raised light. Fixed via the station-aggression gate (classify reads it Regular). +const NEMESIS: Rules = Rules { + call_margin: 0.215, + raise_at: 0.587, + bet_at: 0.548, + open_at: 0.729, + bluff: 0.068, + size: 0.441, +}; + +/// The NEW worst case the CMA-ES finds against the FIXED engine (fast scan 400x8, −173 bb/100): bets +/// tighter (0.748) but big (size ~pot), raises light (0.579), and actually bluffs (0.229). +const NEMESIS2: Rules = Rules { + call_margin: 0.173, + raise_at: 0.579, + bet_at: 0.748, + open_at: 0.800, + bluff: 0.229, + size: 0.996, +}; + +/// The worst case the CMA-ES finds against the SOFT-TRUST engine (fast scan 1000x14, −52.65 bb/100): +/// a different shape — folds air hard (call_margin 0.396), opens very wide (0.468), rarely raises +/// (0.769), overbets (size 1.148). Probe: is it the same read-driven family or a genuine hole? +const NEMESIS3: Rules = Rules { + call_margin: 0.396, + raise_at: 0.769, + bet_at: 0.615, + open_at: 0.468, + bluff: 0.261, + size: 1.148, +}; + +fn main() { + let deals: u32 = std::env::args().nth(1).and_then(|s| s.parse().ok()).unwrap_or(4000); + println!("=== Nemesis je Lese-Modus, {deals} Austeilungen ==="); + println!("Blind >> Memory => lesegetriebenes Leck (Fehlklassifikation). Blind ~= Memory => echtes Loch.\n"); + for (name, rules) in [("nemesis-1", NEMESIS), ("nemesis-2", NEMESIS2), ("nemesis-3", NEMESIS3)] { + println!("-- {name}: call_margin {:.3} raise_at {:.3} bet_at {:.3} open_at {:.3} bluff {:.3} size {:.3}", + rules.call_margin, rules.raise_at, rules.bet_at, rules.open_at, rules.bluff, rules.size); + for read in [ReadMode::Oracle, ReadMode::Blind, ReadMode::Memory] { + let setup = Setup { + players: 2, + opponent: Opponent::Styled(rules), + deals, + stack_bb: STACK_BB, + seed: SEED, + read, + }; + let m = measure(&setup); + println!(" {:<7} {:>+9.2} bb/100 ±{:>5.2}", format!("{read:?}"), m.bb_per_100, m.ci95); + } + println!(); + } + let p = rechner::exploit::profile::Profile { + vpip: Some(0.53), + pfr: Some(0.14), + fold_to_bet: Some(0.65), + aggression: Some(0.62), + ..Default::default() + }; + println!(" classify(nemesis-1-read vpip0.53 pfr0.14 fold0.65 aggr0.62) = {:?}", classify(&p)); +} diff --git a/src/bin/simreal.rs b/src/bin/simreal.rs new file mode 100644 index 00000000..521c4f92 --- /dev/null +++ b/src/bin/simreal.rs @@ -0,0 +1,50 @@ +//! Stufe 4 (offline half): the sim-to-real HUD gap. +//! +//! Prints the HUD distribution the synthetic population INDUCES (vpip/pfr/fold-to-bet/aggression, mean +//! and spread) so it can be held against the real players' HUD. The real spread below is read from the +//! Stufe-1 calibration (`archiv/population.json`, `lesen/kalibrierung.py`), which today is a single +//! ten-player table snapshot (mostly regs), so only the reg axis has a real comparison — the method is +//! what stands; more logs sharpen it. The remaining gap (live outcomes vs sim) needs the live farm. +//! +//! Run: `cargo run --release --bin simreal`. + +use rechner::sim::population::{Archetype, Population, Spread}; +use rechner::sim::reader::Style; +use rechner::sim::simreal::population_induced_hud; + +const SEED: u64 = 0x5EED_0001; +const DRAWS: usize = 120; +const HANDS_EACH: usize = 2000; + +fn main() { + let pop = Population::micro(); + let field = population_induced_hud(&pop, DRAWS, HANDS_EACH, SEED); + + println!("=== Stufe 4 (offline): Sim-to-Real-Gap im HUD-Raum ==="); + println!("{DRAWS} Zieher x {HANDS_EACH} Haende.\n"); + + println!("Induzierte HUD des ganzen synthetischen FELDES (alle Archetypen):"); + println!(" Achse Mittel Streuung (ueber Archetypen)"); + println!(" vpip {:>7.3} {:>7.3}", field.mean.vpip, field.sd.vpip); + println!(" pfr {:>7.3} {:>7.3}", field.mean.pfr, field.sd.pfr); + println!(" foldToBet {:>7.3} {:>7.3}", field.mean.fold_to_bet, field.sd.fold_to_bet); + println!(" aggression {:>7.3} {:>7.3}", field.mean.aggression, field.sd.aggression); + + // The FAIR comparison: synthetic WITHIN-reg spread vs the real within-reg spread. The real snapshot + // is one table of (mostly) regs, so only this cluster has a real target. Draw reg-only opponents. + let reg_only = Population { + archetypes: vec![Archetype { label: "reg", mean: Style::Reg.rules(), weight: 1.0 }], + spread: Spread::DEFAULT, + }; + let reg = population_induced_hud(®_only, DRAWS, HANDS_EACH, SEED ^ 0x8EED); + + let (real_vpip_sd, real_pfr_sd, real_ftb_sd) = (0.043, 0.027, 0.089); + println!("\nInnerhalb des reg-Clusters — synth. vs real STREUUNG (der faire Vergleich):"); + println!(" Achse synth. real Gap"); + println!(" vpip {:>7.3} {:>7.3} {:>+7.3}", reg.sd.vpip, real_vpip_sd, reg.sd.vpip - real_vpip_sd); + println!(" pfr {:>7.3} {:>7.3} {:>+7.3}", reg.sd.pfr, real_pfr_sd, reg.sd.pfr - real_pfr_sd); + println!(" foldToBet {:>7.3} {:>7.3} {:>+7.3}", reg.sd.fold_to_bet, real_ftb_sd, reg.sd.fold_to_bet - real_ftb_sd); + + println!("\n(Echte Mittel je Archetyp und die anderen Cluster brauchen mehr Mitschriebe als die"); + println!(" eine Tisch-Momentaufnahme. Der Live-Outcome-Abgleich bleibt dem Live-Farm vorbehalten.)"); +} diff --git a/src/bin/turnier_leiter.rs b/src/bin/turnier_leiter.rs new file mode 100644 index 00000000..9e092d1a --- /dev/null +++ b/src/bin/turnier_leiter.rs @@ -0,0 +1,116 @@ +//! Turnier-Stärke-Leiter: beweist (oder widerlegt), dass die ICM-Linie in GELD gewinnt. +//! +//! Das Turnier-Gegenstück zur Nemesis/Archetyp-Leiter. Jedes Szenario ist ein Heads-up-Pot im +//! Feld unter einer Preisstruktur; jede Hand wird in ICM-GELD gewertet (Harville), die ICM-Linie +//! (`decide_with(spot, Some(lage))`) gepaart gegen die Cash-Linie (Chip-EV) auf denselben +//! Austeilungen. Kennzahl: die gepaarte Kante ICM$(an) − ICM$(aus) je 100 Hände, Pool = 100. +//! +//! Anker (WTA, tief & flach): ICM MUSS ~ Cash sein, Kante ~ 0. Bubble/Final-Table: die ICM-Linie +//! soll GEWINNEN (Kante > 0). Eine Kante, deren 95-%-Intervall GANZ unter 0 liegt, ist ein Leck +//! (Eiserne Regel: nie einen Verlierer shippen) — dann zurückrollen und Befund. +//! +//! Run: `cargo run --release --bin turnier_leiter [deals]` (default 2000). + +use rechner::sim::opponent::Opponent; +use rechner::sim::reader::Style; +use rechner::sim::turnier_leiter::{messen, Szenario, TurnierMessung}; + +const SEED: u64 = 0x5EED_0001; + +/// `an` = Reader-style aggressor (bets/jams → hero DEFENDS, call-premium bites); +/// `nit`/`folder` let hero open-jam (jam-pressure widening). Asymmetric scenarios (type K) put +/// hero and the opponent on DIFFERENT stacks — covering vs covered, where ICM bites hardest. +fn szenarien(deals: u32) -> Vec<(Szenario, char)> { + let sym = |name, payouts: &[f64], field: &[f64], opp, stack: f64, level| Szenario { + name, + payouts: payouts.to_vec(), + hero_stack: stack, + opp_stack: stack, + field: field.to_vec(), + opponent: opp, + deals, + seed: SEED, + level, + }; + let asym = |name, payouts: &[f64], hero_stack, opp_stack, field: &[f64], opp, level| Szenario { + name, + payouts: payouts.to_vec(), + hero_stack, + opp_stack, + field: field.to_vec(), + opponent: opp, + deals, + seed: SEED, + level, + }; + vec![ + // --- Anker: ICM muss ~ Cash sein (Kante ~ 0) --- + // Winner-take-all: ICM-Equity IST der Chip-Anteil, keine Prämie. + (sym("wta", &[100.0], &[30.0, 30.0], Opponent::Reader(Style::Maniac), 25.0, 3), 'A'), + // Tief & flach: 120bb, nahezu lineare Payouts → Prämie verschwindet. + (sym("deep-flat", &[30.0, 26.0, 24.0, 20.0], &[120.0, 120.0, 120.0], Opponent::Reader(Style::Maniac), 120.0, 2), 'A'), + // --- Bubble (symmetrisch): die ICM-Linie soll gewinnen (Kante > 0) --- + (sym("soft-bubble", &[34.0, 26.0, 22.0, 18.0], &[18.0, 15.0, 40.0, 12.0], Opponent::Reader(Style::Maniac), 20.0, 6), 'B'), + (sym("hard-bubble", &[50.0, 30.0, 20.0], &[7.0, 5.0, 35.0], Opponent::Reader(Style::Maniac), 18.0, 8), 'B'), + (sym("hard-bubble-reg", &[50.0, 30.0, 20.0], &[7.0, 5.0, 35.0], Opponent::Reader(Style::Reg), 18.0, 8), 'B'), + (sym("final-table", &[60.0, 25.0, 15.0], &[12.0, 45.0], Opponent::Reader(Style::Reg), 15.0, 9), 'B'), + // --- Jam-Druck: Hero first-in, Gegner muss an der Bubble enger callen --- + (sym("jam-vs-nit", &[50.0, 30.0, 20.0], &[6.0, 5.0, 30.0], Opponent::Reader(Style::Nit), 12.0, 8), 'J'), + (sym("jam-vs-folder", &[50.0, 30.0, 20.0], &[6.0, 5.0, 30.0], Opponent::Folder, 12.0, 8), 'J'), + // --- Asymmetrisch (K): Decker vs. Gedeckter, wo ICM am härtesten beißt --- + // Hero GEDECKT (short) gegen großen Aggressor: Call-Prämie hoch (Bust = raus), muss enger + // callen als Chip-EV → bewahrt Equity. + (asym("covered-maniac", &[50.0, 30.0, 20.0], 8.0, 40.0, &[6.0, 30.0], Opponent::Reader(Style::Maniac), 8), 'K'), + (asym("covered-reg", &[50.0, 30.0, 20.0], 10.0, 40.0, &[6.0, 30.0], Opponent::Reader(Style::Reg), 8), 'K'), + // Hero DECKT (big stack) einen Short: kann nicht busten (Prämie ~0), aber der Short muss + // enger callen → Open-Jam-Weitung stiehlt breiter. + (asym("cover-short", &[50.0, 30.0, 20.0], 40.0, 8.0, &[6.0, 30.0], Opponent::Reader(Style::Nit), 8), 'K'), + // --- Tiefen-Sweep um die Deck-Richtung: wo weitet `jam_width_factor` zu breit? --- + // Der Nash-Abgleich (RECON-icm-nash-anker) zeigt die Über-Weitung am größten bei ~9bb + // (Jam 68 vs Nash 65). 6/8/12bb klammern die schwache Stelle ein. + (asym("cover-6bb", &[50.0, 30.0, 20.0], 40.0, 6.0, &[6.0, 30.0], Opponent::Reader(Style::Nit), 8), 'K'), + (asym("cover-12bb", &[50.0, 30.0, 20.0], 40.0, 12.0, &[6.0, 30.0], Opponent::Reader(Style::Nit), 8), 'K'), + // Gedeckte Seite tiefer (12bb): gewinnt der ICM-Vorteil auch, wenn Hero weniger kurz ist? + (asym("covered-12bb", &[50.0, 30.0, 20.0], 12.0, 40.0, &[6.0, 30.0], Opponent::Reader(Style::Maniac), 8), 'K'), + ] +} + +/// Verdict symbol: ✓ ICM proven to win (whole interval > 0); · neutral (|edge| ≤ CI, the anchor +/// target); ✗ LECK — the interval is wholly below 0 (iron law: revert + Befund). +fn mark(m: &TurnierMessung) -> &'static str { + if m.wins() { + "✓ gewinnt" + } else if m.edge_per100 + m.ci95 < 0.0 { + "✗ LECK" + } else { + "· neutral" + } +} + +fn main() { + let deals: u32 = std::env::args().nth(1).and_then(|s| s.parse().ok()).unwrap_or(2000); + println!("=== Turnier-Stärke-Leiter, {deals} Austeilungen/Szenario (Pool = 100) ==="); + println!("Kante = ICM$(an) - ICM$(aus) je 100 Hände, gepaart, 95-%-Intervall."); + println!("A=Anker (Ziel ~0) B=Bubble/FT (Ziel >0) J=Jam-Druck\n"); + println!(" {:<17} {:>3} {:>9} {:>8} {:>9} {:>9} {}", "szenario", "typ", "kante", "±ci", "an", "aus", "urteil"); + let mut leck = false; + for (sz, typ) in szenarien(deals) { + let m = messen(&sz); + if m.invalid > 0 { + println!(" !! {} INVALID {}", sz.name, m.invalid); + } + if m.edge_per100 + m.ci95 < 0.0 { + leck = true; + } + println!( + " {:<17} {:>3} {:>+9.3} {:>8.3} {:>+9.3} {:>+9.3} {}", + sz.name, typ, m.edge_per100, m.ci95, m.icm_on_per100, m.icm_off_per100, mark(&m), + ); + } + println!(); + if leck { + println!(">> LECK gefunden: mindestens ein Szenario verliert ICM-Geld. Zurückrollen + Befund."); + } else { + println!(">> Kein Leck: keine ICM-Linie verliert. Bubble-Kanten > 0 beweisen den ICM-Vorteil."); + } +} diff --git a/src/bin/twin_gate.rs b/src/bin/twin_gate.rs new file mode 100644 index 00000000..68311761 --- /dev/null +++ b/src/bin/twin_gate.rs @@ -0,0 +1,43 @@ +//! Stufe 2 of the synthetic lab: the TWIN GATE — print the three axes that replace the bb/100 ladder. +//! +//! One engine build, scored on: population EV (does it still exploit a varied field), the robustness +//! floor (its EV against the single worst archetype — the balanced players are the overfit catcher), +//! and river exploitability (an exact best-response distance on a fixed battery). "Never ship a loser" +//! becomes: lose no axis. Use `Gate::passes` in a regression harness to compare two builds. +//! +//! Run: `cargo run --release --bin twin_gate`. + +use rechner::sim::population::Population; +use rechner::sim::twin_gate::{evaluate, TwinBudget}; + +const SEED: u64 = 0x5EED_0001; + +fn main() { + let pop = Population::micro(); + // Full budget: tightens the floor CIs the lean run left wide. The two balanced archetypes run a + // solver per decision, so this is the slow run (~1 h) — but it is the production-scale measurement. + let budget = TwinBudget::default(); + + println!("=== Stufe 2: das Zwillings-Tor (ersetzt die bb/100-Leiter) ==="); + println!( + "Population {}x{} Austeilungen, Archetypen {} Austeilungen, River-Batterie {} Iter.\n", + budget.pop_opponents, budget.pop_deals, budget.archetype_deals, budget.river_iters + ); + + let r = evaluate(&pop, budget, SEED); + + println!("OFFENSE — Population-EV (Memory, erschlossen)"); + println!(" {:+.2} bb/100 (Exploitation-Luecke {:+.2})\n", r.population_ev_bb_per_100, r.exploitation_gap_bb_per_100); + + println!("ROBUSTHEIT — EV je Archetyp (Memory), Boden = schlechtester:"); + for (name, ev, ci) in &r.archetypes { + let mark = if *name == r.worst_archetype { " <- BODEN" } else { "" }; + println!(" {name:10} {ev:+8.2} bb/100 +-{ci:.2}{mark}"); + } + println!(" Boden: {} {:+.2} bb/100 +-{:.2}\n", r.worst_archetype, r.worst_ev_bb_per_100, r.worst_ci95); + + println!("DEFENSE — River-Exploitability (exakte Best Response, {} Spots)", r.subgames); + println!(" Mittel {:.2} bb/100, Max {:.2} bb/100 (0 = unausbeutbar)\n", r.mean_exploitability_bb_per_100, r.max_exploitability_bb_per_100); + + println!("Tor-Regel fuer einen Kandidaten: Population-EV haelt UND Boden haelt UND Exploitability steigt nicht."); +} diff --git a/src/cfr/kl_br.rs b/src/cfr/kl_br.rs new file mode 100644 index 00000000..7d5cbac6 --- /dev/null +++ b/src/cfr/kl_br.rs @@ -0,0 +1,199 @@ +//! KL-Trust-Region-Best-Response: sigma* = argmax E[EV vs fester Gegner] - lambda * KL(sigma || gto). +//! +//! Je Infoset (Knoten x Klasse) ist die Loesung der Softmax-Tilt der GTO-Zeile mit den bedingten +//! Aktionswerten: `sigma*(a) ~ gto(a) * exp(Q(a) / lambda)`. Q haengt von sigma* weiter unten ab, +//! darum wird von den Blaettern zur Wurzel gearbeitet (tiefste eigene Knoten zuerst); jeder Knoten +//! sieht dann die schon getiltete Strategie unterhalb, die Rekursion ist damit exakt. +//! +//! `lambda = inf` liefert `gto` unveraendert, `lambda -> 0` den Best Response auf dem Traeger von +//! `gto` (Aktionen mit gto-Wahrscheinlichkeit 0 bleiben 0 - KL ist dort unendlich). +//! +//! Q ist der kontrafaktische Wert aus `value_walk` geteilt durch die Masse (Chance x Gegner-Reach) +//! des Infosets, also der Erwartungswert in Chips gegeben, dass der Infoset erreicht ist; so ist +//! `lambda` in denselben Einheiten wie die Auszahlungen und unabhaengig von der Reichweite. + +use super::strategy::Strategy; +use super::tree::{Node, Tree}; +use super::value_walk::{root_values, Responder}; + +/// Eigene Entscheidungsknoten samt Tiefe, tiefste zuerst. +fn hero_nodes_deepest_first(tree: &Tree, hero: usize) -> Vec<(usize, &'static str)> { + let mut found: Vec<(usize, usize, &'static str)> = Vec::new(); + let mut stack = vec![(tree.root, 0usize)]; + while let Some((node, depth)) = stack.pop() { + match tree.nodes.get(node) { + Some(Node::Decision { player, name, children }) => { + if *player == hero { + found.push((depth, node, name)); + } + stack.extend(children.iter().map(|c| (*c, depth + 1))); + } + Some(Node::Chance(branches)) => stack.extend(branches.iter().map(|(_, c)| (*c, depth + 1))), + _ => {} + } + } + found.sort_by(|a, b| b.0.cmp(&a.0)); + found.into_iter().map(|(_, node, name)| (node, name)).collect() +} + +/// Softmax-Tilt einer Zeile: `base * exp((q - max q) / lambda)`, normalisiert. +fn tilt(base: &[f64], q: &[f64], lambda: f64) -> Vec { + let top = base + .iter() + .zip(q) + .filter(|(b, _)| **b > 0.0) + .map(|(_, q)| *q) + .fold(f64::NEG_INFINITY, f64::max); + if !top.is_finite() { + return base.to_vec(); + } + let weights: Vec = + base.iter().zip(q).map(|(b, q)| if *b > 0.0 { b * ((q - top) / lambda).exp() } else { 0.0 }).collect(); + let total: f64 = weights.iter().sum(); + if total > 0.0 && total.is_finite() { + weights.iter().map(|w| w / total).collect() + } else { + base.to_vec() + } +} + +/// Heros KL-Trust-Region-Strategie gegen die feste Strategie des Gegners (in `opponent`) um `gto`. +/// Nur die Gegnerzeilen von `opponent` zaehlen; Rueckgabe = `gto` mit getilteten Heldenzeilen. +pub fn kl_best_response(tree: &Tree, opponent: &Strategy, gto: &Strategy, hero_player: usize, lambda: f64) -> Strategy { + if !(lambda < f64::INFINITY) || lambda.is_nan() || !tree.is_playable() { + return gto.clone(); + } + let lambda = lambda.max(1e-12); + let n = tree.classes; + let hero = hero_player.min(1); + // Start: Heldenzeilen aus gto, Gegnerzeilen aus `opponent` (nur zum Bewerten). + let mut current = gto.clone(); + for (i, node) in tree.nodes.iter().enumerate() { + if let Node::Decision { player, name, .. } = node { + if *player != hero { + current = current.with_rows(tree, name, |c| opponent.row(i, c).to_vec()).unwrap_or(current); + } + } + } + for (node, name) in hero_nodes_deepest_first(tree, hero) { + // Werte unter `current` (unterhalb schon getiltet, oberhalb egal: Q haengt nicht davon ab). + let mut q: Vec> = Vec::new(); + let mut mass = vec![0.0; n]; + root_values(tree, ¤t, Responder::Follow, hero, &mut |v| { + if v.node == node { + q = v.action_values.to_vec(); + for c in 0..n { + mass[c] = (0..n) + .map(|o| if hero == 0 { tree.chance[c * n + o] } else { tree.chance[o * n + c] } * v.opp[o]) + .sum(); + } + } + }); + if q.is_empty() { + continue; + } + let rows: Vec> = (0..n) + .map(|c| { + let base = gto.row(node, c); + if mass[c] <= 1e-15 { + return base.to_vec(); + } + let cond: Vec = q.iter().map(|a| a[c] / mass[c]).collect(); + tilt(base, &cond, lambda) + }) + .collect(); + current = current.with_rows(tree, name, |c| rows[c].clone()).unwrap_or(current); + } + // Rueckgabe: Heldenzeilen getiltet, Gegnerzeilen wieder wie gto. + for (i, node) in tree.nodes.iter().enumerate() { + if let Node::Decision { player, name, .. } = node { + if *player != hero { + current = current.with_rows(tree, name, |c| gto.row(i, c).to_vec()).unwrap_or(current); + } + } + } + current +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::cfr::exploitability::game_value; + use crate::cfr::river::tree_with_chance; + use crate::cfr::solve::solve; + use crate::rng::Rng; + + /// Polarisierter Fluss: Held Air+Nuts, Gegner reiner Bluffcatcher; Pot 2, Bet 1. + fn setup() -> (Tree, Strategy) { + let n = 3; + let mut chance = vec![0.0; n * n]; + chance[0 * n + 1] = 0.5; + chance[2 * n + 1] = 0.5; + let tree = tree_with_chance(n, chance, 2.0, 1.0); + let gto = solve(&tree, 20_000, Rng::seeded(0x5EED_21AA)).strategy; + (tree, gto) + } + + /// Wert des Gegners gegen Heldenstrategie bei bestem Gegner. + fn villain_br(tree: &Tree, s: &Strategy) -> f64 { + root_values(tree, s, Responder::Best, 1, &mut |_| {}).iter().sum() + } + + fn belief_ev(tree: &Tree, s: &Strategy) -> f64 { + game_value(tree, s) + } + + #[test] + fn lambda_sweep_traces_safety_exploit_tradeoff() { + let (tree, gto) = setup(); + let base_br = villain_br(&tree, >o); + let gto_ev = game_value(&tree, >o); + + // Der feste Gegner: gto, aber in der Realitaet ein Overfolder (belief) waere interessanter; + // hier der geloeste Gegner, der Held hat also nur Rauschen zu gewinnen. Zusaetzlich ein + // exploitierbarer Gegner: ruft nur 40 % (Overfold) statt 2/3. + let weak = gto.with_rows(&tree, "v_bet", |_| vec![0.6, 0.4]).unwrap(); + + let mut prev: Option<(f64, f64)> = None; + println!("lambda, belief_EV(vs overfolder), exploitability"); + for lambda in [1e9, 100.0, 10.0, 1.0, 0.1, 0.01] { + let s = kl_best_response(&tree, &weak, >o, 0, lambda); + let ev = belief_ev(&tree, &s.clone_with_villain(&tree, &weak)); + let expl = villain_br(&tree, &s) - base_br; + println!("{lambda:>8} -> EV {ev:+.5} expl {expl:+.5}"); + if lambda == 1e9 { + let ev_gto = belief_ev(&tree, >o.clone_with_villain(&tree, &weak)); + assert!((ev - ev_gto).abs() < 1e-6, "1e9 != gto: {ev} vs {ev_gto}"); + assert!(expl.abs() < 1e-6, "gto exploitierbar: {expl}"); + assert!((game_value(&tree, &s) - gto_ev).abs() < 1e-6); + } + if let Some((pe, px)) = prev { + assert!(ev >= pe - 1e-9, "EV sinkt bei lambda {lambda}: {pe} -> {ev}"); + assert!(expl >= px - 1e-9, "Exploitability sinkt bei lambda {lambda}: {px} -> {expl}"); + } + prev = Some((ev, expl)); + } + let (ev_end, expl_end) = prev.unwrap(); + let ev_gto = belief_ev(&tree, >o.clone_with_villain(&tree, &weak)); + assert!(ev_end > ev_gto + 0.05, "Exploit gewinnt nichts: {ev_end} vs {ev_gto}"); + assert!(expl_end > 0.01, "Exploit ohne Preis? {expl_end}"); + // lambda = inf exakt gto + assert_eq!(kl_best_response(&tree, &weak, >o, 0, f64::INFINITY), gto); + } + + /// Hilfe: Heldenzeilen aus `self`, Gegnerzeilen aus `villain` (alle Knoten von Spieler 1). + trait CloneWith { + fn clone_with_villain(&self, tree: &Tree, villain: &Strategy) -> Strategy; + } + impl CloneWith for Strategy { + fn clone_with_villain(&self, tree: &Tree, villain: &Strategy) -> Strategy { + let mut out = self.clone(); + for (i, node) in tree.nodes.iter().enumerate() { + if let Node::Decision { player: 1, name, .. } = node { + out = out.with_rows(tree, name, |c| villain.row(i, c).to_vec()).unwrap(); + } + } + out + } + } +} diff --git a/src/cfr/mod.rs b/src/cfr/mod.rs index 318baac9..736de7c0 100644 --- a/src/cfr/mod.rs +++ b/src/cfr/mod.rs @@ -77,6 +77,8 @@ pub mod generated_equity; pub mod generated_equity_short; pub mod hand_class; pub mod iterate; +pub mod kl_br; +pub mod qre; pub mod leaf_value3; pub mod multi_shares; pub mod multi_solve; @@ -92,6 +94,7 @@ pub mod push_fold_game; pub mod regret_matching; pub mod render_charts; pub mod render_equity; +pub mod river; pub mod render_multi; pub mod run_plan; pub mod seat; @@ -104,6 +107,8 @@ pub mod terminal_value; pub mod three_way; pub mod tree3; pub mod tree; +pub mod turn; +pub mod turn_river; pub mod value_walk; pub mod wake_range; pub mod walk3; diff --git a/src/cfr/qre.rs b/src/cfr/qre.rs new file mode 100644 index 00000000..21e5bb2f --- /dev/null +++ b/src/cfr/qre.rs @@ -0,0 +1,286 @@ +//! Logit quantal response equilibrium (QRE): Nash at finite temperature. +//! +//! Every player plays a softmax response to the expected payoffs of its own actions, +//! `sigma(a) ~ exp(beta * Q(a))`, per decision node and hand class, where `Q` is the expected +//! payoff given the class and reaching the node (the counterfactual value divided by the +//! opponent's reach mass). Both players do so against each other: the QRE is the fixed point. +//! +//! - `beta -> inf` (T -> 0): the best response, i.e. a Nash equilibrium of the zero-sum game. +//! - `beta -> 0` (T -> inf): uniform play. +//! - A humans-play-QRE read: fish = small beta, nit / solver = large beta (`fit_temperature`). +//! +//! Solver: the logit flow `d sigma = softmax(beta Q(sigma)) - sigma` integrated with RK4 (plain +//! damped iteration `sigma <- (1-eta) sigma + eta softmax(..)` spirals out at large beta, see +//! `settle`), with beta annealed from 1 up to the target (doubling) so every stage starts at the +//! previous solution (path-following). Step size follows the response gain. Deterministic. + +use super::strategy::Strategy; +use super::tree::Tree; +use super::value_walk::{root_values, Responder, Visit}; + +const TOLERANCE: f64 = 1e-12; +const ETA_MAX: f64 = 0.5; +const ETA_MIN: f64 = 1e-7; + +/// Logit-QRE profile at inverse temperature `beta` (T = 1/beta). `iters` is the iteration cap +/// per annealing stage. +pub fn qre(tree: &Tree, beta: f64, iters: u32) -> Strategy { + let start = Strategy::uniform(tree); + if !tree.is_playable() { + return start; + } + let beta = if beta.is_finite() { beta.max(0.0) } else { 1e6 }; + stages(beta).into_iter().fold(start, |s, b| settle(tree, s, b, iters)) +} + +/// Annealing schedule: `[beta]` up to 1, else 1 and then doublings (geometric) up to `beta`. +fn stages(beta: f64) -> Vec { + if beta <= 1.0 { + return vec![beta]; + } + let n = beta.log2().ceil().max(1.0) as i32; + std::iter::once(1.0).chain((1..=n).map(|k| beta.powf(k as f64 / n as f64))).collect() +} + +type Field = Vec<(usize, Vec>)>; + +/// The logit flow `f(sigma) = softmax(beta Q(sigma)) - sigma`, its residual `max|f|` and the +/// gain scale `spread` (largest `beta * (max Q - min Q)`). +fn flow(tree: &Tree, s: &Strategy, beta: f64) -> (Field, f64, f64) { + let (mut field, spread) = logit_targets(tree, s, beta); + let mut residual = 0.0f64; + for (node, rows) in field.iter_mut() { + for (c, row) in rows.iter_mut().enumerate() { + for (t, o) in row.iter_mut().zip(s.row(*node, c)) { + *t -= o; + residual = residual.max(t.abs()); + } + } + } + (field, residual, spread) +} + +/// `s + sum_k w_k * field_k`, clamped at 0 and renormalised per row. +fn moved(s: &Strategy, fields: &[(&Field, f64)]) -> Strategy { + let nodes = &fields[0].0; + (0..nodes.len()).fold(s.clone(), |acc, i| { + let node = nodes[i].0; + acc.with_node(node, |c| { + let mut row: Vec = s + .row(node, c) + .iter() + .enumerate() + .map(|(a, o)| (o + fields.iter().map(|(f, w)| w * f[i].1[c][a]).sum::()).max(0.0)) + .collect(); + let sum: f64 = row.iter().sum(); + row.iter_mut().for_each(|x| *x /= sum); + row + }) + }) +} + +/// Integrate the logit flow at a fixed beta with classic RK4 until the residual is below +/// tolerance (or `iters` steps). Why not plain damping: the flow's linearisation in a zero-sum +/// game is a spiral (real part about -1, imaginary part about beta x payoff scale), where explicit +/// Euler needs a step ~ 1/beta^2 but RK4 is stable up to ~ 1/beta. Step `h = 2 / (1 + spread / 2)` +/// clamped to `[ETA_MIN, ETA_MAX]`; `spread` follows the current gain, so large beta takes small steps. +fn settle(tree: &Tree, start: Strategy, beta: f64, iters: u32) -> Strategy { + let mut s = start; + for _ in 0..iters { + let (k1, residual, spread) = flow(tree, &s, beta); + if residual < TOLERANCE { + break; + } + let h = (1.5 / (1.0 + 0.5 * spread)).clamp(ETA_MIN, ETA_MAX); + let (k2, _, _) = flow(tree, &moved(&s, &[(&k1, h / 2.0)]), beta); + let (k3, _, _) = flow(tree, &moved(&s, &[(&k2, h / 2.0)]), beta); + let (k4, _, _) = flow(tree, &moved(&s, &[(&k3, h)]), beta); + s = moved(&s, &[(&k1, h / 6.0), (&k2, h / 3.0), (&k3, h / 3.0), (&k4, h / 6.0)]); + } + s +} + +/// Softmax(beta Q) for every decision node of both players against the profile `s`: +/// `(node, row per class)`. A class that cannot reach the node keeps its current row. +fn logit_targets(tree: &Tree, s: &Strategy, beta: f64) -> (Vec<(usize, Vec>)>, f64) { + let n = tree.classes; + let mut out = Vec::new(); + let mut spread = 0.0f64; + for player in 0..2 { + root_values(tree, s, Responder::Follow, player, &mut |v: &Visit| { + let rows = (0..n) + .map(|c| { + let mass: f64 = (0..n) + .map(|o| v.opp[o] * if player == 0 { tree.chance[c * n + o] } else { tree.chance[o * n + c] }) + .sum(); + if mass <= 1e-300 { + return s.row(v.node, c).to_vec(); + } + let q: Vec = v.action_values.iter().map(|a| beta * a[c] / mass).collect(); + let top = q.iter().cloned().fold(f64::NEG_INFINITY, f64::max); + let low = q.iter().cloned().fold(f64::INFINITY, f64::min); + spread = spread.max(top - low); + softmax(&q) + }) + .collect(); + out.push((v.node, rows)); + }); + } + (out, spread) +} + +fn softmax(x: &[f64]) -> Vec { + let top = x.iter().cloned().fold(f64::NEG_INFINITY, f64::max); + let e: Vec = x.iter().map(|v| (v - top).exp()).collect(); + let sum: f64 = e.iter().sum(); + e.iter().map(|v| v / sum).collect() +} + +/// Observed action counts of one class at one decision node. +#[derive(Clone, Debug, PartialEq)] +pub struct Observed { + pub node: usize, + pub class: usize, + /// One count (or frequency weight) per action. + pub counts: Vec, +} + +/// Maximum-likelihood inverse temperature for observed actions: log-grid over +/// `[0.01, 1000]`, then golden-section refinement around the best cell. Likelihood need not be +/// unimodal in general; the grid guards against a poor local pick. +pub fn fit_temperature(observed: &[Observed], tree: &Tree) -> f64 { + let loglik = |beta: f64| -> f64 { + let s = qre(tree, beta, 4000); + observed + .iter() + .map(|o| { + let row = s.row(o.node, o.class); + o.counts.iter().zip(row).map(|(k, p)| k * p.max(1e-12).ln()).sum::() + }) + .sum() + }; + let (lo, hi, steps) = (0.01f64.ln(), 1000f64.ln(), 40); + let grid: Vec = (0..=steps).map(|k| lo + (hi - lo) * k as f64 / steps as f64).collect(); + let scores: Vec = grid.iter().map(|x| loglik(x.exp())).collect(); + let best = (0..grid.len()).fold(0, |b, k| if scores[k] > scores[b] { k } else { b }); + let mut a = grid[best.saturating_sub(1)]; + let mut b = grid[(best + 1).min(grid.len() - 1)]; + let phi = (5f64.sqrt() - 1.0) / 2.0; + for _ in 0..40 { + let (c, d) = (b - phi * (b - a), a + phi * (b - a)); + if loglik(c.exp()) > loglik(d.exp()) { + b = d; + } else { + a = c; + } + } + ((a + b) / 2.0).exp() +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::cfr::exploitability::{exploitability, game_value}; + use crate::cfr::solve::solve; + use crate::cfr::tree::{Node, Payoff}; + use crate::rng::Rng; + + /// Polarised river: hero holds air or the nuts ([0.5, 0, 0.5]), villain a bluff-catcher + /// ([0, 1, 0]); pot 2, bet 1. Classes: 0 air, 1 bluff-catcher, 2 nuts. Payoffs for hero. + fn river() -> Tree { + let n = 3; + let mut chance = vec![0.0; n * n]; + chance[0 * n + 1] = 0.5; + chance[2 * n + 1] = 0.5; + let showdown = |win: f64| Payoff::Pair((0..n * n).map(|k| if k / n == 2 { win } else { -win }).collect()); + let nodes = vec![ + Node::Decision { player: 0, name: "hero", children: vec![1, 2] }, + Node::Terminal(showdown(1.0)), // check: pot 2 split by showdown, +-1 + Node::Decision { player: 1, name: "villain", children: vec![3, 4] }, + Node::Terminal(Payoff::Flat(1.0)), // villain folds + Node::Terminal(showdown(2.0)), // villain calls: +-2 + ]; + Tree { classes: n, chance, nodes, root: 0 } + } + + fn freqs(s: &Strategy, t: &Tree) -> (f64, f64, f64) { + let (h, v) = (t.find("hero").unwrap(), t.find("villain").unwrap()); + (s.probability(h, 0, 1), s.probability(h, 2, 1), s.probability(v, 1, 1)) + } + + #[test] + fn qre_interpolates_between_uniform_and_nash() { + let t = river(); + let nash = solve(&t, 20000, Rng::seeded(1)); + let (nb, nn, nc) = freqs(&nash.strategy, &t); + println!("Nash (CFR+): bluff {nb:.4} nuts-bet {nn:.4} call {nc:.4}"); + assert!((nb - 1.0 / 3.0).abs() < 0.02 && (nc - 2.0 / 3.0).abs() < 0.02); + + let betas = [0.01, 0.1, 0.3, 0.5, 1.0, 2.0, 3.0, 5.0, 10.0, 30.0, 100.0, 300.0, 1000.0]; + println!(" beta bluff(air) bet(nuts) call(BC) exploit value"); + let rows: Vec<(f64, f64, f64, f64)> = betas + .iter() + .map(|&b| { + let s = qre(&t, b, 20000); + let (bl, nu, ca) = freqs(&s, &t); + println!( + "{b:7.2} {bl:.4} {nu:.4} {ca:.4} {:.4} {:.4}", + exploitability(&t, &s), + game_value(&t, &s) + ); + (b, bl, nu, ca) + }) + .collect(); + + // beta -> 0: uniform + let (_, bl, nu, ca) = rows[0]; + assert!((bl - 0.5).abs() < 0.01 && (nu - 0.5).abs() < 0.01 && (ca - 0.5).abs() < 0.01); + // beta -> inf: Nash frequencies + let (_, bl, nu, ca) = *rows.last().unwrap(); + assert!((bl - nb).abs() < 0.03, "bluff {bl} vs nash {nb}"); + assert!((ca - nc).abs() < 0.03, "call {ca} vs nash {nc}"); + assert!(nu > 0.97); + // Monotone approach. Not monotone from beta = 0: a uniform villain over-folds (call 1/2 < + // 2/3), so air profits from betting and the bluff first RISES above 1/2 (peak ~0.52 near + // beta 0.4) before falling to 1/3; the call frequency likewise overshoots 2/3 (peak ~0.70 + // near beta 2) before settling. After the peak both fall monotonically onto Nash. + for w in rows.windows(2) { + assert!(w[1].2 >= w[0].2 - 1e-9, "nuts bet not monotone at beta {}", w[1].0); + if w[0].0 >= 0.5 { + assert!(w[1].1 <= w[0].1 + 1e-9, "bluff not monotone at beta {}", w[1].0); + } + if w[0].0 >= 2.0 { + assert!(w[1].3 <= w[0].3 + 1e-9, "call not monotone at beta {}", w[1].0); + } + if w[0].0 >= 0.3 { + assert!(w[1].0 > 0.0 && (w[1].1 - nb).abs() <= (w[0].1 - nb).abs() + 1e-9); + } + } + assert!(rows.iter().all(|r| r.1 > nb - 1e-3 && r.1 < 0.53)); + } + + #[test] + fn qre_is_a_fixed_point_and_deterministic() { + let t = river(); + let a = qre(&t, 3.0, 20000); + assert_eq!(a, qre(&t, 3.0, 20000)); + let again = settle(&t, a.clone(), 3.0, 1); + let (h, v) = (t.find("hero").unwrap(), t.find("villain").unwrap()); + assert!((again.probability(h, 0, 1) - a.probability(h, 0, 1)).abs() < 1e-9); + assert!((again.probability(v, 1, 1) - a.probability(v, 1, 1)).abs() < 1e-9); + } + + #[test] + fn fit_recovers_temperature() { + let t = river(); + let s = qre(&t, 3.0, 20000); + let (h, v) = (t.find("hero").unwrap(), t.find("villain").unwrap()); + let obs: Vec = [(h, 0), (h, 2), (v, 1)] + .iter() + .map(|&(node, class)| Observed { node, class, counts: s.row(node, class).iter().map(|p| p * 10000.0).collect() }) + .collect(); + let fit = fit_temperature(&obs, &t); + println!("fit beta = {fit:.3} (true 3)"); + assert!((fit - 3.0).abs() < 0.15); + } +} diff --git a/src/cfr/river.rs b/src/cfr/river.rs new file mode 100644 index 00000000..58207acf --- /dev/null +++ b/src/cfr/river.rs @@ -0,0 +1,161 @@ +//! A heads-up river subgame as a `Tree`, solved by the shared CFR+ core (`solve`). +//! +//! The river is terminal: the board is complete, so there are no chance nodes and a showdown is +//! exact. Hands are abstract **strength buckets**, 0 = weakest, `buckets - 1` = strongest, with a +//! monotone showdown (higher bucket wins, equal buckets split). Both players draw from the same +//! bucket set; `chance[i * buckets + j]` is the joint probability that hero (player 0) holds bucket +//! `i` and villain (player 1) holds bucket `j` (independent product of the two range vectors in this +//! first version; card removal between the ranges is a later refinement). +//! +//! Betting (v1): hero acts first, one bet size `s` (chips), no raises. Hero checks or bets; after a +//! check villain checks (showdown) or bets and hero folds or calls; after a bet villain folds or +//! calls. Enough to reproduce the textbook river results (`tests`): with pot `P` and bet `s`, the +//! polarised bettor's bluff-to-value ratio is `s / (P + s)` and the bluff-catcher defends `P / (P + s)` +//! (minimum defence frequency). Sizes and raises come in later versions. +//! +//! Payoffs are hero's net in chips from the river onward, zero-sum (each player is treated as having +//! put `P/2` into the pot). A showdown for total pot `Q` pays hero `+Q/2` when his bucket is higher, +//! `-Q/2` when lower, `0` on a tie. An uncalled bet returns, so a fold just moves the dead pot `±P/2`. + +use super::solve::{solve, Solved}; +use super::tree::{Node, Payoff, Tree}; +use crate::rng::Rng; + +/// A solved heads-up river subgame and the bucket count it was built over. +pub struct RiverSolve { + pub solved: Solved, + pub buckets: usize, +} + +impl RiverSolve { + /// Hero's action probabilities at the root (index 0 = check, 1 = bet) for a hand in `bucket`. + pub fn hero_root(&self, bucket: usize) -> Vec { + self.solved.strategy.row(0, bucket).to_vec() + } + + /// Hero's action probabilities facing a bet after checking (node "hero_vs_bet", index 4: + /// 0 = fold, 1 = call) for a hand in `bucket`. + pub fn hero_vs_bet(&self, bucket: usize) -> Vec { + self.solved.strategy.row(4, bucket).to_vec() + } +} + +/// The monotone showdown payoff for a total pot `q`: `+q/2` when hero's bucket beats villain's, +/// `-q/2` when it loses, `0` on a tie. +fn showdown(buckets: usize, q: f64) -> Payoff { + let mut pair = vec![0.0; buckets * buckets]; + for i in 0..buckets { + for j in 0..buckets { + pair[i * buckets + j] = match i.cmp(&j) { + std::cmp::Ordering::Greater => q / 2.0, + std::cmp::Ordering::Less => -q / 2.0, + std::cmp::Ordering::Equal => 0.0, + }; + } + } + Payoff::Pair(pair) +} + +/// The joint deal table `chance[i * buckets + j] = hero[i] * villain[j]`, normalised to sum 1. +/// Independent product (card removal between the two ranges is a later refinement). Falls back to a +/// uniform table when a range is empty or non-finite, so the tree stays playable. +fn chance(hero: &[f64], villain: &[f64]) -> Vec { + let buckets = hero.len(); + let mut table = vec![0.0; buckets * buckets]; + let mut total = 0.0; + for i in 0..buckets { + for j in 0..buckets { + let w = (hero[i].max(0.0)) * (villain[j].max(0.0)); + let w = if w.is_finite() { w } else { 0.0 }; + table[i * buckets + j] = w; + total += w; + } + } + if total > 0.0 { + table.iter_mut().for_each(|x| *x /= total); + } else { + table.iter_mut().for_each(|x| *x = 1.0 / (buckets * buckets) as f64); + } + table +} + +/// Build the heads-up river tree over `buckets` strength buckets with an explicit joint deal table +/// `chance[i * buckets + j] = P(hero bucket i, villain bucket j)` (card removal already inside), one +/// bet size `s` (chips) into pot `p`, no raises. Node 0 is hero's root decision (check, bet). This is +/// the card-exact entry point: `sim::exploit_river` builds `chance` from real combos on a real board. +pub fn tree_with_chance(buckets: usize, chance: Vec, p: f64, s: f64) -> Tree { + let pot_called = p + 2.0 * s; + // Node indices are wired by hand; see the module doc for the shape. + let nodes = vec![ + Node::Decision { player: 0, name: "hero", children: vec![1, 2] }, // 0: check -> 1, bet -> 2 + Node::Decision { player: 1, name: "v_check", children: vec![3, 4] }, // 1: v check -> 3, v bet -> 4 + Node::Decision { player: 1, name: "v_bet", children: vec![5, 6] }, // 2: v fold -> 5, v call -> 6 + Node::Terminal(showdown(buckets, p)), // 3: check-check showdown + Node::Decision { player: 0, name: "hero_vs_bet", children: vec![7, 8] }, // 4: hero fold -> 7, call -> 8 + Node::Terminal(Payoff::Flat(p / 2.0)), // 5: hero bet, villain folds + Node::Terminal(showdown(buckets, pot_called)), // 6: hero bet, villain calls + Node::Terminal(Payoff::Flat(-p / 2.0)), // 7: hero checks, bets, hero folds + Node::Terminal(showdown(buckets, pot_called)), // 8: hero checks, bets, hero calls + ]; + Tree { classes: buckets, chance, nodes, root: 0 } +} + +/// Build the v1 heads-up river tree: hero first to act, one bet size `s` (chips) into pot `p`, +/// no raises, with the independent-product deal table. Node 0 is hero's root decision (check, bet). +fn tree(hero: &[f64], villain: &[f64], p: f64, s: f64) -> Tree { + tree_with_chance(hero.len(), chance(hero, villain), p, s) +} + +/// Solve the v1 heads-up river subgame: hero (player 0) first to act, one bet size `s` chips into +/// pot `p`, no raises. `hero` / `villain` are strength-bucket weight vectors of equal length +/// (0 = weakest). Runs `iterations` of CFR+. +pub fn solve_river(hero: &[f64], villain: &[f64], p: f64, s: f64, iterations: u32, seed: u64) -> RiverSolve { + let t = tree(hero, villain, p, s); + RiverSolve { solved: solve(&t, iterations, Rng::seeded(seed)), buckets: hero.len() } +} + +#[cfg(test)] +mod tests { + use super::*; + + /// Convergence budget for the toy trees (tiny, so this is plenty). + const ITERS: u32 = 20_000; + const SEED: u64 = 0x5EED_21AA; + + /// Polarised river: hero holds only air (bucket 0) and nuts (bucket 2) in equal weight; + /// villain holds only a bluff-catcher (bucket 1). Pot 2, half-pot bet 1. Textbook GTO: + /// - hero value-bets the nuts ~100 %, + /// - hero bluffs the air at the frequency making bluff-to-value = s/(P+s) = 1/3, i.e. since + /// value = all nuts, the air bets ~1/3 of the time, + /// - the bluff-catcher calls at MDF = P/(P+s) = 2/3. + #[test] + fn polarised_river_matches_textbook_gto() { + let hero = [0.5, 0.0, 0.5]; // air, (unused mid), nuts + let villain = [0.0, 1.0, 0.0]; // pure bluff-catcher + let (p, s) = (2.0, 1.0); + let r = solve_river(&hero, &villain, p, s, ITERS, SEED); + + let nuts_bet = r.hero_root(2)[1]; + let air_bet = r.hero_root(0)[1]; + // Villain calling the bluff-catcher facing hero's bet: node "v_bet" (index 2), action 1 = call. + let villain_call = r.solved.strategy.probability(2, 1, 1); + + assert!(nuts_bet > 0.95, "nuts should value-bet ~always, got {nuts_bet:.3}"); + assert!((air_bet - 1.0 / 3.0).abs() < 0.06, "air bluff freq ~1/3, got {air_bet:.3}"); + assert!((villain_call - 2.0 / 3.0).abs() < 0.06, "bluff-catcher calls ~2/3 (MDF), got {villain_call:.3}"); + } + + /// Quarter-pot bet changes the numbers the same way theory says: bluff-to-value = s/(P+s) and + /// MDF = P/(P+s). Pot 2, bet 0.5: air bluffs ~ (0.5/2.5)=1/5 of the time, villain calls ~ 2/2.5 = 4/5. + #[test] + fn smaller_bet_shifts_frequencies_as_theory_says() { + let hero = [0.5, 0.0, 0.5]; + let villain = [0.0, 1.0, 0.0]; + let (p, s) = (2.0, 0.5); + let r = solve_river(&hero, &villain, p, s, ITERS, SEED); + let air_bet = r.hero_root(0)[1]; + let villain_call = r.solved.strategy.probability(2, 1, 1); + assert!((air_bet - 0.2).abs() < 0.06, "air bluff freq ~1/5, got {air_bet:.3}"); + assert!((villain_call - 0.8).abs() < 0.06, "bluff-catcher calls ~4/5, got {villain_call:.3}"); + } +} diff --git a/src/cfr/strategy.rs b/src/cfr/strategy.rs index fba97494..4dea8f8a 100644 --- a/src/cfr/strategy.rs +++ b/src/cfr/strategy.rs @@ -59,6 +59,11 @@ impl Strategy { Ok(self.replaced(index, |class| rows[class].clone())) } + /// Copy with one node replaced by `row(class)` per class (for solvers outside this module). + pub(crate) fn with_node(&self, index: usize, row: impl Fn(usize) -> Vec) -> Strategy { + self.replaced(index, row) + } + fn replaced(&self, index: usize, row: impl Fn(usize) -> Vec) -> Strategy { let mut probs = self.probs.clone(); probs[index] = (0..self.classes).flat_map(row).collect(); diff --git a/src/cfr/turn.rs b/src/cfr/turn.rs new file mode 100644 index 00000000..723729e5 --- /dev/null +++ b/src/cfr/turn.rs @@ -0,0 +1,175 @@ +//! Two-street (turn → river) best-response barrel value over abstract strength buckets. +//! +//! The single-street `engine::bluff::branches` values a bet as `P(fold)·pot + (1−P(fold))· +//! (called_share·final_pot − to)`, and the engine draws `P(fold)` from the villain's *global* +//! profile stat (`exploit::table_fold`, a HUD fold-to-bet). That is the over-barrel leak +//! (BEFUND-nit-read-leck): after the villain has already called a bet, the range that reaches the +//! next street is the strong, *continuing* subset — it folds far less than the global rate. Booking +//! the global fold equity on the river bluff books phantom profit; the narrowed range calls and the +//! barrel bleeds. +//! +//! The fix is to condition the fold equity on *reaching* the street: the river fold probability is +//! what the **narrowed** range actually folds (minimum-defence against the price), not the global +//! stat. Against that, a double-barrel with air is −EV, so best-response checks instead. This module +//! computes that conditioned value and demonstrates the leak as a test. +//! +//! Buckets are abstract strength ranks (higher = stronger) with a monotone showdown. Strength is +//! **static** across the river card in this v1 (no draws completing / board reshuffle); real board +//! runouts are a later refinement. The point proven here — conditioned vs global fold equity — does +//! not depend on reshuffle, because the leak is range *selection*, not the card. + +/// A villain range as strength-bucket weights (mass still in play); index 0 = weakest. +pub type Range = Vec; + +/// Total probability mass of a range. +fn mass(r: &[f64]) -> f64 { + r.iter().sum() +} + +/// Hero's showdown share against `r`: mass strictly weaker than hero, plus half the ties, over the +/// total. Air (low bucket) against a strong range is ~0; the nuts ~1. Empty range splits (0.5). +fn showdown_share(hero: usize, r: &[f64]) -> f64 { + let total = mass(r); + if total <= 0.0 { + return 0.5; + } + let below: f64 = r.iter().take(hero).sum(); + let tie = r.get(hero).copied().unwrap_or(0.0); + (below + 0.5 * tie) / total +} + +/// Minimum-defence continue fraction against a bet of `bet` into `pot`: GTO defends `pot/(pot+bet)` +/// of the range (folds `alpha = bet/(pot+bet)`). `lean` scales it — a calling station over-defends +/// (`lean > 1`), a nit over-folds (`lean < 1`); `lean = 1` is the GTO defender. Clamped to [0, 1]. +pub fn continue_fraction(bet: f64, pot: f64, lean: f64) -> f64 { + if bet <= 0.0 || pot < 0.0 { + return 1.0; + } + (lean * pot / (pot + bet)).clamp(0.0, 1.0) +} + +/// The range that continues against the bet: the villain keeps its strongest hands up to +/// `continue_fraction` of its mass and folds the weak tail. Returns the narrowed weights (same +/// length), so a later street sees only the hands that actually called. +pub fn narrowed(r: &[f64], bet: f64, pot: f64, lean: f64) -> Range { + let keep = continue_fraction(bet, pot, lean) * mass(r); + let mut out = vec![0.0; r.len()]; + let mut budget = keep; + // Fill from the strong end down; the last bucket may be partially kept. + for i in (0..r.len()).rev() { + if budget <= 0.0 { + break; + } + let take = r[i].min(budget); + out[i] = take; + budget -= take; + } + out +} + +/// Hero's expected chips from the pot if the river checks through to showdown: `share · pot`. +fn check_value(hero: usize, r: &[f64], pot: f64) -> f64 { + showdown_share(hero, r) * pot +} + +/// Hero's expected chips from betting `bet` into pot `pot` on the river, **given** the villain folds +/// with probability `fold_prob` and, when called, holds the narrowed continuing range. Matches the +/// `branches` convention: `fold_prob·pot + (1−fold_prob)·(share·final − bet)`, final pot = `pot+2bet`. +/// +/// Pass `fold_prob` = the conditioned fold (`1 − continue_fraction` of the *current* range) for the +/// true value; pass a global stat to see the booked (phantom) value the single-street heuristic uses. +pub fn river_bet_value(hero: usize, r: &[f64], pot: f64, bet: f64, fold_prob: f64, lean: f64) -> f64 { + let called = narrowed(r, bet, pot, lean); + let share = showdown_share(hero, &called); + fold_prob * pot + (1.0 - fold_prob) * (share * (pot + 2.0 * bet) - bet) +} + +/// Best-response river value for hero: the better of checking and a correctly-priced bet, where the +/// bet's fold equity is **conditioned** on the range that reached the river (minimum defence), not a +/// global stat. This is the value the two-street turn decision should see in its called branch. +pub fn river_best_response(hero: usize, r: &[f64], pot: f64, bet: f64, lean: f64) -> f64 { + let check = check_value(hero, r, pot); + let true_fold = 1.0 - continue_fraction(bet, pot, lean); + let bet_ev = river_bet_value(hero, r, pot, bet, true_fold, lean); + check.max(bet_ev) +} + +/// Best-response value of barrelling the turn (vs folding now), river best-responded: the villain +/// folds the turn at the conditioned rate; when called, the pot grows and hero best-responds on the +/// river against the narrowed range (so an air hand checks rather than booking phantom fold equity). +pub fn turn_barrel_value(hero: usize, r: &[f64], pot: f64, turn_bet: f64, river_bet: f64, lean: f64) -> f64 { + let fold = 1.0 - continue_fraction(turn_bet, pot, lean); + let called_range = narrowed(r, turn_bet, pot, lean); + let pot_river = pot + 2.0 * turn_bet; + let river = river_best_response(hero, &called_range, pot_river, river_bet, lean); + fold * pot + (1.0 - fold) * (river - turn_bet) +} + +#[cfg(test)] +mod tests { + use super::*; + + /// A villain range that is uniform over 10 buckets before any betting. + fn uniform(buckets: usize) -> Range { + vec![1.0 / buckets as f64; buckets] + } + + /// Conditioned fold equity fixes the over-barrel: hero holds air (bucket 0); after a turn-sized + /// river bet the continuing range is strong and folds little, so best-response CHECKS — the river + /// bet is −EV against the hands that got there. + #[test] + fn best_response_checks_air_on_the_river() { + let r = uniform(10); + let pot = 6.0; // a pot already swollen by earlier streets + let bet = 4.0; // two-thirds pot + let lean = 1.0; // GTO defender + let check = check_value(0, &r, pot); + let true_fold = 1.0 - continue_fraction(bet, pot, lean); + let bet_ev = river_bet_value(0, &r, pot, bet, true_fold, lean); + assert!(bet_ev < check, "air river bet {bet_ev:.3} must be worse than checking {check:.3}"); + // Best-response takes the check. + assert!((river_best_response(0, &r, pot, bet, lean) - check).abs() < 1e-9); + } + + /// The leak, reproduced: with the GLOBAL fold stat (a nit's 0.82) the river bluff BOOKS a profit + /// above checking, so the single-street heuristic barrels — but the REALIZED value, using the + /// true conditioned fold of the narrowed range, is below checking. Booked > check > realized. + #[test] + fn global_fold_stat_books_phantom_barrel_profit() { + let r = uniform(10); + let pot = 6.0; + let bet = 4.0; + let lean = 1.0; + let global_fold = 0.82; // the nit's unconditional fold-to-bet (BEFUND-nit-read-leck) + let check = check_value(0, &r, pot); + let booked = river_bet_value(0, &r, pot, bet, global_fold, lean); + let realized = river_bet_value(0, &r, pot, bet, 1.0 - continue_fraction(bet, pot, lean), lean); + assert!(booked > check, "the global stat must book a barrel (booked {booked:.3} > check {check:.3})"); + assert!(realized < check, "but the realized barrel loses (realized {realized:.3} < check {check:.3})"); + } + + /// A value hand does the opposite: the nuts (top bucket) best-responds by betting, because the + /// narrowed calling range still pays off. + #[test] + fn best_response_value_bets_the_nuts() { + let r = uniform(10); + let pot = 6.0; + let bet = 4.0; + let lean = 1.2; // a slightly loose caller, so value gets paid + let check = check_value(9, &r, pot); + let br = river_best_response(9, &r, pot, bet, lean); + assert!(br > check + 1e-9, "the nuts should bet for value: br {br:.3} > check {check:.3}"); + } + + /// Narrowing keeps the strong end and conserves the kept mass. + #[test] + fn narrowing_keeps_the_strong_tail() { + let r = uniform(10); + let pot = 4.0; + let bet = 4.0; // alpha = 1/2, GTO defends half + let n = narrowed(&r, bet, pot, 1.0); + assert!((mass(&n) - 0.5).abs() < 1e-9, "half the mass continues, got {:.3}", mass(&n)); + assert_eq!(n[0], 0.0, "the weakest bucket folds"); + assert!(n[9] > 0.0, "the strongest bucket continues"); + } +} diff --git a/src/cfr/turn_river.rs b/src/cfr/turn_river.rs new file mode 100644 index 00000000..b3e940fa --- /dev/null +++ b/src/cfr/turn_river.rs @@ -0,0 +1,217 @@ +//! A heads-up TURN subgame as a `Tree`, depth-limited to one betting round with the value of the +//! river folded into the leaves. The betting shape is identical to the river tree (`cfr::river`): +//! hero acts first, one bet size, no raises. The difference is the terminal that would be a river +//! showdown: here the turn is NOT the last street, so the three "reach the river" terminals carry a +//! **leaf value matrix** `V[i * buckets + j]` = hero's expected chips over the whole river *given* +//! the turn buckets `(i, j)`, instead of a static showdown. +//! +//! This is the DeepStack/endgame construction: solve only the turn decisions, and evaluate each +//! river-reaching leaf by the equilibrium value of the river subgame it leads to (precomputed by the +//! caller, averaged over the runout, via the existing `cfr::river` solver). Because the CFR core +//! (`solve`, `terminal_value`, `kl_br`, `exploitability`) is street-agnostic and `terminal_value` +//! reads an arbitrary `Payoff::Pair`, no core change is needed — only this builder and the leaf +//! precompute. When the leaf is set to a plain monotone showdown, this tree is byte-identical to +//! `cfr::river::tree_with_chance` (see tests), so the turn solve degrades gracefully to the river one. +//! +//! Buckets are TURN strength classes (0 = weakest), `chance[i * buckets + j]` the joint turn deal +//! table with card removal already inside. Payoffs are hero's (player 0) net in chips, zero-sum, each +//! player treated as having put `p / 2` into the turn pot: a turn fold moves the dead pot `±p/2`; a +//! river-reaching leaf pays the precomputed `V`, which itself nets the river play to hero's chips. + +use super::solve::{solve, Solved}; +use super::strategy::Strategy; +use super::tree::{Node, Payoff, Tree}; +use crate::rng::Rng; + +/// A solved heads-up turn subgame and the turn-bucket count it was built over. +pub struct TurnSolve { + pub solved: Solved, + pub buckets: usize, +} + +impl TurnSolve { + /// Hero's action probabilities at the root (0 = check, 1 = bet) for a hand in turn `bucket`. + pub fn hero_root(&self, bucket: usize) -> Vec { + self.solved.strategy.row(0, bucket).to_vec() + } + + /// Hero's action probabilities facing a turn bet after checking (node "hero_vs_bet", index 4: + /// 0 = fold, 1 = call) for a hand in turn `bucket`. + pub fn hero_vs_bet(&self, bucket: usize) -> Vec { + self.solved.strategy.row(4, bucket).to_vec() + } +} + +/// Build the heads-up turn tree over `buckets` turn-strength buckets with an explicit joint deal +/// table `chance[i * buckets + j] = P(hero turn-bucket i, villain turn-bucket j)` (card removal +/// inside), turn pot `p`, and two river leaf-value matrices (each `buckets * buckets`, hero's net +/// chips over the river): +/// - `leaf_check`: the river reached via a turn CHECK-CHECK (river starts at pot `p`), +/// - `leaf_bet`: the river reached via a CALLED turn bet (river starts at the larger pot). +/// +/// Node 0 is hero's root decision (check, bet). Shape mirrors `cfr::river::tree_with_chance`; the +/// bet size enters only through the leaf matrices the caller computed, so it is not a parameter here. +pub fn tree_with_leaf(buckets: usize, chance: Vec, p: f64, leaf_check: Vec, leaf_bet: Vec) -> Tree { + debug_assert_eq!(chance.len(), buckets * buckets, "chance table must be buckets^2"); + debug_assert_eq!(leaf_check.len(), buckets * buckets, "leaf_check must be buckets^2"); + debug_assert_eq!(leaf_bet.len(), buckets * buckets, "leaf_bet must be buckets^2"); + let nodes = vec![ + Node::Decision { player: 0, name: "hero", children: vec![1, 2] }, // 0: check -> 1, bet -> 2 + Node::Decision { player: 1, name: "v_check", children: vec![3, 4] }, // 1: v check -> 3, v bet -> 4 + Node::Decision { player: 1, name: "v_bet", children: vec![5, 6] }, // 2: v fold -> 5, v call -> 6 + Node::Terminal(Payoff::Pair(leaf_check)), // 3: turn check-check -> river + Node::Decision { player: 0, name: "hero_vs_bet", children: vec![7, 8] }, // 4: hero fold -> 7, call -> 8 + Node::Terminal(Payoff::Flat(p / 2.0)), // 5: hero bet, villain folds (uncalled) + Node::Terminal(Payoff::Pair(leaf_bet.clone())), // 6: hero bet, villain calls -> river + Node::Terminal(Payoff::Flat(-p / 2.0)), // 7: hero checks, villain bets, hero folds + Node::Terminal(Payoff::Pair(leaf_bet)), // 8: hero checks, villain bets, hero calls -> river + ]; + Tree { classes: buckets, chance, nodes, root: 0 } +} + +/// Hero's (player 0) payoff at a terminal for a fixed class pair `(i, j)` — the raw per-deal result, +/// before the chance/opponent-reach weighting the solver applies. +fn hero_payoff(payoff: &Payoff, n: usize, i: usize, j: usize) -> f64 { + match payoff { + Payoff::Flat(c) => *c, + Payoff::Own(v) => v.get(i).copied().unwrap_or(0.0), + Payoff::Pair(m) => m.get(i * n + j).copied().unwrap_or(0.0), + Payoff::Raked { pair, .. } => pair.get(i * n + j).copied().unwrap_or(0.0), + } +} + +/// Hero's expected net chips for every class pair `(i, j)` under a fixed `strategy`: +/// `out[i * classes + j] = E[hero payoff | hero class i, villain class j, both follow `strategy`]`. +/// +/// A forward walk conditioned on the pair (no chance/reach weighting — that is applied outside, by +/// the parent tree's own `chance` table). This is exactly the matrix a depth-limited parent street +/// needs as a `Payoff::Pair` leaf: solve the river subgame, then `pair_values` reads the equilibrium +/// value per river-bucket pair. Invariant (checked in tests): weighting `out` by the tree's `chance` +/// reproduces `value_walk::root_values(Follow, 0)`. +pub fn pair_values(tree: &Tree, strategy: &Strategy) -> Vec { + let n = tree.classes; + let mut out = vec![0.0; n * n]; + for i in 0..n { + for j in 0..n { + out[i * n + j] = eval_pair(tree, strategy, tree.root, i, j); + } + } + out +} + +/// Expected hero payoff from `node` for the fixed class pair `(i, j)` under `strategy`. +fn eval_pair(tree: &Tree, strategy: &Strategy, node: usize, i: usize, j: usize) -> f64 { + match &tree.nodes[node] { + Node::Terminal(payoff) => hero_payoff(payoff, tree.classes, i, j), + Node::Chance(branches) => branches.iter().map(|(p, child)| p * eval_pair(tree, strategy, *child, i, j)).sum(), + Node::Decision { player, children, .. } => { + let class = if *player == 0 { i } else { j }; + children + .iter() + .enumerate() + .map(|(a, child)| strategy.probability(node, class, a) * eval_pair(tree, strategy, *child, i, j)) + .sum() + } + } +} + +/// Solve a heads-up turn subgame built by `tree_with_leaf`. Runs `iterations` of the shared CFR+ core. +pub fn solve_turn(buckets: usize, chance: Vec, p: f64, leaf_check: Vec, leaf_bet: Vec, iterations: u32, seed: u64) -> TurnSolve { + let t = tree_with_leaf(buckets, chance, p, leaf_check, leaf_bet); + TurnSolve { solved: solve(&t, iterations, Rng::seeded(seed)), buckets } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::cfr::river::tree_with_chance; + use crate::cfr::value_walk::{root_values, Responder}; + + const ITERS: u32 = 20_000; + const SEED: u64 = 0x5EED_7117; + + /// A monotone showdown matrix for total pot `q` (the river builder's private `showdown`, inlined). + fn showdown_vec(buckets: usize, q: f64) -> Vec { + let mut pair = vec![0.0; buckets * buckets]; + for i in 0..buckets { + for j in 0..buckets { + pair[i * buckets + j] = match i.cmp(&j) { + std::cmp::Ordering::Greater => q / 2.0, + std::cmp::Ordering::Less => -q / 2.0, + std::cmp::Ordering::Equal => 0.0, + }; + } + } + pair + } + + /// Normalised joint deal table `hero[i] * villain[j]` (the river builder's private `chance`). + fn joint(hero: &[f64], villain: &[f64]) -> Vec { + let n = hero.len(); + let mut t = vec![0.0; n * n]; + let mut total = 0.0; + for i in 0..n { + for j in 0..n { + let w = hero[i].max(0.0) * villain[j].max(0.0); + t[i * n + j] = w; + total += w; + } + } + if total > 0.0 { + t.iter_mut().for_each(|x| *x /= total); + } else { + t.iter_mut().for_each(|x| *x = 1.0 / (n * n) as f64); + } + t + } + + /// With the river folded in as a plain showdown (no river betting), the turn tree is byte-identical + /// to the river tree — `tree_with_leaf` is a faithful generalisation, so the depth-limited solve + /// degrades exactly to the one-street solve. + #[test] + fn showdown_leaf_reproduces_the_river_tree_exactly() { + let buckets = 3; + let (p, s) = (2.0, 1.0); + let chance = joint(&[0.5, 0.0, 0.5], &[0.0, 1.0, 0.0]); + let turn = tree_with_leaf(buckets, chance.clone(), p, showdown_vec(buckets, p), showdown_vec(buckets, p + 2.0 * s)); + let river = tree_with_chance(buckets, chance, p, s); + assert_eq!(turn, river, "a showdown leaf must reproduce the river tree node-for-node"); + } + + /// `pair_values` reads back the exact leaf the pure strategy forces: hero always checks, villain + /// always checks → the check-check leaf, for every pair. + #[test] + fn pair_values_reads_back_the_forced_leaf() { + let buckets = 3; + let p = 2.0; + let leaf_check: Vec = (0..buckets * buckets).map(|k| k as f64 + 1.0).collect(); // arbitrary, distinct + let leaf_bet = vec![-9.0; buckets * buckets]; + let tree = tree_with_leaf(buckets, joint(&[1.0, 1.0, 1.0], &[1.0, 1.0, 1.0]), p, leaf_check.clone(), leaf_bet); + // Pure: hero checks (action 0 at "hero"), villain checks (action 0 at "v_check"). + let pure = Strategy::pure(&tree, |_, _| 0); // every node's action 0: hero check, villain check + let got = pair_values(&tree, &pure); + assert_eq!(got, leaf_check, "check-check must land on the check-check leaf for every pair"); + } + + /// The core invariant tying `pair_values` to the solver's own value: weighting the per-pair matrix + /// by the tree's `chance` reproduces `root_values(Follow, hero)` exactly. This is what lets a parent + /// street trust `pair_values` as its leaf. + #[test] + fn pair_values_weighted_by_chance_equals_root_values() { + let buckets = 3; + let (p, s) = (2.0, 1.0); + let chance = joint(&[0.4, 0.2, 0.4], &[0.1, 0.6, 0.3]); + let turn = tree_with_leaf(buckets, chance.clone(), p, showdown_vec(buckets, p), showdown_vec(buckets, p + 2.0 * s)); + let solved = solve(&turn, ITERS, Rng::seeded(SEED)); + let pv = pair_values(&turn, &solved.strategy); + let rv = root_values(&turn, &solved.strategy, Responder::Follow, 0, &mut |_| {}); + for i in 0..buckets { + let weighted: f64 = (0..buckets).map(|j| chance[i * buckets + j] * pv[i * buckets + j]).sum(); + assert!( + (weighted - rv[i]).abs() < 1e-9, + "class {i}: chance-weighted pair_values {weighted} != root_values {}", + rv[i] + ); + } + } +} diff --git a/src/engine/decide.rs b/src/engine/decide.rs index 4d8869f0..6b356b74 100644 --- a/src/engine/decide.rs +++ b/src/engine/decide.rs @@ -15,7 +15,7 @@ use crate::exploit::thresholds::Thresholds; use crate::game::{Decision, Spot, Street}; use crate::guard::enforce::enforce; use crate::icm::lage::Turnierlage; -use crate::icm::risk::{call_premium, jam_pressure, jam_width_factor, width_factor}; +use crate::icm::risk::{call_premium, jam_depth_gate, jam_pressure, jam_width_factor, width_factor}; use crate::preflop::advise::advise_widened; use crate::preflop::plan::PreflopPlan; use crate::read::hand_read::read; @@ -34,7 +34,7 @@ fn trials(spot: &Spot) -> u32 { /// Postflop: read the hand, model each villain's range, simulate against it and /// against the hands that would call each raise, choose. -fn postflop(spot: &Spot, thresholds: &Thresholds) -> Decision { +fn postflop(spot: &Spot, thresholds: &Thresholds, raw: &Spot, premium: f64) -> Decision { let rules = spot.rules(); let hand_read = match read(&rules, &spot.hero_cards, &spot.board) { Ok(r) => r, @@ -52,6 +52,13 @@ fn postflop(spot: &Spot, thresholds: &Thresholds) -> Decision { } let dead: Vec = spot.hero_cards.iter().chain(&spot.board).copied().collect(); let lists: Vec<_> = filters.iter().map(|f| combos(&rules, f, &dead)).collect(); + // Stage A river-subgame solver is NOT wired here. Proven exactly unexploitable (0.0 bb/100) vs a + // correct GTO belief in `sim::exploit_river`, but with a SYMMETRIC prior it plays balanced poker + // against players who must be exploited: wiring it live cost -43 bb/100 GESAMT, concentrated on + // the calling station / fish / maniac (BEFUND-river-solver-balanced-vs-exploitable). It returns + // to the live path only once the belief is opponent-aware (posterior -> range) and trust-gated + // (crown: KL ball around GTO, lambda from read confidence). Until then the heuristic EV line below + // keeps the exploit edge the whole ladder depends on. let ranges: Vec = as_ranges(&filters, &lists); let query = Query { rules, @@ -62,8 +69,32 @@ fn postflop(spot: &Spot, thresholds: &Thresholds) -> Decision { }; match estimate(&query, Rng::seeded(spot.seed)) { Ok((equity, _)) => { - choose_postflop_with(spot, &equity, &called_equity(spot), thresholds, &hand_read) - .with_equity(equity.share) + // GTO-Boden UEBER dem Modell, aber unter der Exploit-Range: ein modellgetriebener + // River-Fold einer verteidigungswuerdigen Made-Hand wird zum MDF-Call. `raw` traegt die + // UNGEGATETEN Reads - der Boden darf den Gegner-Bluffanteil defensiv lesen (gegen einen + // bewiesenen Nicht-Bluffer mehr folden), was `read_gate` dem Range-Modell verwehrt. + let base = choose_postflop_with(spot, &equity, &called_equity(spot), thresholds, &hand_read); + let floored = crate::exploit::mdf_floor::floor(raw, hand_read.made, base).with_equity(equity.share); + // Defensive river veto (the belief+trust gearbox, CASH ONLY): a confident read that the + // villain UNDER-bluffs its river bet turns a heuristic call into a fold. This is the one + // place the gearbox is a proven edge — the heuristic over-calls under-bluffed overbets + // (nemesis-3); its OFFENSE (thin value, light calls vs real bluffers) stays untouched, + // because replacing that with a KL-GTO line bled EV on the ladder. Never overrides an + // ICM-driven line (premium > 0): chip-EV must not override a tournament fold/call. + // + // The TURN veto (`turn_subgame::turn_fold_veto`, Stage B) stays OUT of the live path. Two + // measurements now agree it regresses the hardest value-heavy nemesis (nemesis-1, bluff + // 0.068): pooled belief -7.77, per-street-aggression belief -25.93 (worse). The root is NOT + // belief granularity — per-street aggression fixed nemesis-2 but made nemesis-1 worse. It is + // the draw-BLIND turn bucket: the veto folds bluff-catchers whose river equity the + // current-strength ladder undervalues, so a defensive turn fold forfeits realized equity the + // river veto never does (the river is final). Fixing it needs draw-aware turn bucketing or + // the offline/value-function form, not a live fold-veto. The turn solver + per-street belief + // stay as tested primitives. See BEFUND-stage-b-turn-river-solver.md. + if premium <= 0.0 { + return super::river_subgame::fold_veto(raw, floored); + } + floored } Err(fault) => Decision::abstain(format!("equity unavailable: {fault}")), } @@ -82,7 +113,7 @@ fn with_premium(thresholds: Thresholds, premium: f64) -> Thresholds { } } -fn think(spot: &Spot, premium: f64, jam_widen: f64) -> Decision { +fn think(spot: &Spot, premium: f64, jam_widen: f64, raw: &Spot) -> Decision { let profiles: Vec = spot.live_villains().filter_map(|v| v.profile).collect(); let thresholds = with_premium(adjust(Thresholds::BASE, &profiles), premium); match spot.street { @@ -93,7 +124,7 @@ fn think(spot: &Spot, premium: f64, jam_widen: f64) -> Decision { let certainty = plan.certainty.max(MIN_CERTAINTY); from_plan(spot, &PreflopPlan { certainty, ..plan }) } - Street::Flop | Street::Turn | Street::River => postflop(spot, &thresholds), + Street::Flop | Street::Turn | Street::River => postflop(spot, &thresholds, raw, premium), } } @@ -110,6 +141,7 @@ pub fn decide_with(spot: &Spot, lage: Option<&Turnierlage>) -> Decision { // Only act on reads we are proven to beat blind play with (`read_gate`); competent and // aggressive opponents are played blind until the exploit logic earns them on the ladder. let gated = super::read_gate::gate_reads(spot); + let raw = spot; // ungated reads, used ONLY by the defensive MDF floor (mdf_floor::floor) let spot = &gated; let premium = match lage.map(|l| call_premium(spot, l)) { None => 0.0, @@ -118,8 +150,14 @@ pub fn decide_with(spot: &Spot, lage: Option<&Turnierlage>) -> Decision { }; // Open-Jam-Weitung an der Bubble (`icm::risk::jam_pressure`): nur bei Turnierlage, sonst neutral. // Unpricebar -> 1.0 (keine Weitung), nie ein Abbruch - der Riegel liegt bei `premium`/Calls. - let jam_widen = lage.and_then(|l| jam_pressure(spot, l)).map(jam_width_factor).unwrap_or(1.0); - let decision = enforce(spot, think(spot, premium, jam_widen)); + // Tiefen-gegated (`jam_depth_gate`): die Weitung ist ein Kurzstack-Hebel; ein tiefer Deckler + // weitet NICHT (sonst oeffnet er Muell aus der Tiefe - gemessen: cover-short -12.5 ICM$/100). + let jam_widen = lage + .and_then(|l| jam_pressure(spot, l)) + .map(jam_width_factor) + .map(|w| 1.0 + (w - 1.0) * jam_depth_gate(spot.hero_stack / spot.big_blind)) + .unwrap_or(1.0); + let decision = enforce(spot, think(spot, premium, jam_widen, raw)); match crate::hand::showdown::best(spot.rules().hole_usage, &spot.hero_cards, &spot.board) { Ok(strength) => decision.with_category(strength.category), Err(_) => decision, diff --git a/src/engine/mod.rs b/src/engine/mod.rs index 00cd9fc1..b7f3d37b 100644 --- a/src/engine/mod.rs +++ b/src/engine/mod.rs @@ -16,9 +16,11 @@ pub mod read_gate; pub mod range_combos; pub mod range_filter; pub mod read_label; +pub mod river_subgame; pub mod run_twice; pub mod semibluff; pub mod size_policy; pub mod texture_stance; pub mod thin_value; +pub mod turn_subgame; pub mod uncertainty; diff --git a/src/engine/postflop.rs b/src/engine/postflop.rs index 1e8ba3fe..c10f8156 100644 --- a/src/engine/postflop.rs +++ b/src/engine/postflop.rs @@ -10,6 +10,7 @@ use crate::exploit::thresholds::Thresholds; use crate::game::{ActionKind, Choice, Decision, Spot}; use crate::odds::{break_even::break_even, ev}; use crate::read::hand_read::HandRead; +use crate::rng::Rng; fn label(choice: Choice, kind: Option) -> String { match (choice, kind) { @@ -29,6 +30,79 @@ fn best(options: &[Scored]) -> Option { }) } +/// EV-indifference band for size mixing: raise sizes within `MIX_BAND` standard errors (in +/// chips) of the best are treated as tied. Half a standard error is a conservative tie — well +/// inside what the equity estimate can resolve. Overridable via `SIZE_MIX_BAND` (read once) for +/// a width sweep. The mix only ever deviates from the argmax (never to a higher-EV size), so a +/// wider band trades a larger by-construction point-estimate bias for more unpredictability: +/// paired ladder (vs the deterministic baseline) measured 1.0σ at −0.56 ±0.95 bb/100 / 227 spots +/// and 0.5σ at −0.23 ±0.59 / 112 spots — both indistinguishable from zero; 0.5σ is the default +/// as the cleaner ≥0 proof that still mixes where sizes are genuinely tied. See +/// BEFUND-size-mix-ev-neutral.md. +const MIX_BAND: f64 = 0.5; + +fn mix_band() -> f64 { + use std::sync::OnceLock; + static BAND: OnceLock = OnceLock::new(); + *BAND.get_or_init(|| { + std::env::var("SIZE_MIX_BAND") + .ok() + .and_then(|v| v.parse::().ok()) + .filter(|&b| b.is_finite() && b >= 0.0) + .unwrap_or(MIX_BAND) + }) +} +/// Decorrelates the size-mix draw from the equity Monte-Carlo stream, which seeds off +/// `spot.seed` directly. Any fixed non-zero salt works. +const MIX_SALT: u64 = 0x5F3B_C1D2_7A49_E6B5; + +/// Measurement toggle (read once): `SIZE_MIX=0` disables size mixing so one run can measure the +/// engine with mixing on vs off on the same deals (paired). Default on. +fn size_mix_enabled() -> bool { + use std::sync::OnceLock; + static ON: OnceLock = OnceLock::new(); + *ON.get_or_init(|| std::env::var("SIZE_MIX").as_deref() != Ok("0")) +} + +/// Among the raise sizes within `error` chips of the winning raise (EV-indistinguishable under +/// the equity estimate), a seeded draw picks one. Pure: the winner is returned unchanged unless +/// it is a raise with two or more tied raise sizes. EV-neutral by construction — it only ever +/// swaps between statistically tied sizes. +fn pick_mixed(options: &[Scored], winner: Scored, error: f64, seed: u64) -> Scored { + if !matches!(winner.choice, Choice::Raise { .. }) || error <= 0.0 { + return winner; + } + let tied: Vec = options + .iter() + .copied() + .filter(|s| matches!(s.choice, Choice::Raise { .. }) && winner.ev - s.ev <= error) + .collect(); + if tied.len() <= 1 { + return winner; + } + let (idx, _) = Rng::seeded(seed).below(tied.len() as u64); + tied[idx as usize] +} + +/// Equilibrium play mixes its bet sizes; a pure argmax over sizes is in principle readable (a +/// thinking villain clusters "big size => value"). Where two or more raise sizes are EV-tied +/// (within one standard error of the equity estimate), hero cannot tell them apart, so it draws +/// one — seeded off `spot.seed`, so paired runs stay reproducible and only the mixed spots +/// differ from the deterministic line. Only raise sizes mix; check/call/fold never do. Because +/// it only swaps between statistically tied sizes it is EV-neutral by construction: safe against +/// the non-adjusting fish/stations the ladder's edge rests on, and it can never be a measured +/// loser. The gain is only against villains who would otherwise read a fixed size. +fn mix_size(spot: &Spot, estimate: &Estimate, options: &[Scored], winner: Scored) -> Scored { + if !size_mix_enabled() { + return winner; + } + let Choice::Raise { to } = winner.choice else { + return winner; + }; + let error = mix_band() * estimate.std_error.max(0.0) * ev::final_pot(spot.pot, spot.to_call, to); + pick_mixed(options, winner, error, spot.seed ^ MIX_SALT) +} + /// EV lead of the winner over the next-best alternative, counting folding (0) and the /// call it passed up. fn lead(spot: &Spot, share: f64, options: &[Scored], winner: Scored) -> f64 { @@ -141,6 +215,9 @@ pub fn choose_postflop_with( } } + // The abstain gate above decided WHETHER to raise on the best size; once committed, mix the + // SIZE among EV-tied raises so the line is not a readable pure argmax (EV-neutral, seeded). + let winner = winner.map(|w| mix_size(spot, estimate, &options, w)); priced(match winner { Some(w) => { let shown = match w.choice { @@ -167,3 +244,54 @@ pub fn choose_postflop_with( }, }) } + +#[cfg(test)] +mod size_mix_tests { + use super::*; + + fn raise(to: f64, ev: f64) -> Scored { + Scored { choice: Choice::Raise { to }, ev, kind: Some(RaiseKind::Value) } + } + + #[test] + fn mix_only_swaps_between_ev_tied_sizes() { + // Top raise 10.0; 9.8 is within the 0.5 band (gap 0.2), 5.0 is well outside. + let options = vec![raise(2.0, 10.0), raise(3.0, 9.8), raise(4.0, 5.0)]; + let winner = raise(2.0, 10.0); + let mut seen: std::collections::BTreeSet = Default::default(); + for seed in 0..64u64 { + let picked = pick_mixed(&options, winner, 0.5, seed); + match picked.choice { + Choice::Raise { to } => { + assert!(to == 2.0 || to == 3.0, "mixed into a non-tied size {to}"); + seen.insert(to.to_bits()); + } + other => panic!("mix changed the action to {other:?}"), + } + } + assert_eq!(seen.len(), 2, "did not draw across both tied sizes"); + } + + #[test] + fn mix_is_a_no_op_without_a_tie() { + let options = vec![raise(2.0, 10.0), raise(3.0, 5.0)]; + let winner = raise(2.0, 10.0); + for seed in 0..16u64 { + assert_eq!(pick_mixed(&options, winner, 0.5, seed).choice, winner.choice); + } + } + + #[test] + fn mix_never_touches_a_non_raise_winner() { + let call = Scored { choice: Choice::Call, ev: 1.0, kind: None }; + let options = vec![call, raise(2.0, 10.0)]; + assert_eq!(pick_mixed(&options, call, 5.0, 7).choice, Choice::Call); + } + + #[test] + fn zero_error_is_deterministic() { + let options = vec![raise(2.0, 10.0), raise(3.0, 10.0)]; + let winner = raise(2.0, 10.0); + assert_eq!(pick_mixed(&options, winner, 0.0, 3).choice, winner.choice); + } +} diff --git a/src/engine/read_gate.rs b/src/engine/read_gate.rs index cf799cd2..50d8c3d0 100644 --- a/src/engine/read_gate.rs +++ b/src/engine/read_gate.rs @@ -1,26 +1,64 @@ //! "Never worse than blind." Measured on the ladder, the exploit logic only beats solid blind play -//! against clearly-weak, over-calling opponents (calling stations / fish). Acting on a read of a -//! competent or aggressive opponent (reg / nit / maniac) makes the engine play WORSE than blind - it -//! bleeds to a heads-up reg (−102 bb/100 with a truthful read). Until the exploit logic earns the -//! right to adjust against them (proven on the ladder, fed by real strong-player data), the engine -//! keeps a read ONLY for the proven-profitable weak class and plays everyone else blind. +//! against opponents whose read it has EARNED. Acting on a read of a competent or aggressive +//! opponent (reg / maniac) makes the engine play WORSE than blind - it bleeds to a heads-up reg +//! (−102 bb/100 with a truthful read). Until a style's read is proven on the ladder (fed by real +//! data), the engine keeps a read ONLY for the earned styles and plays everyone else blind. //! -//! This can never make a read harmful: it only ever acts where acting is known to help, and falls -//! back to the solid baseline everywhere else. Same spirit as the price/commitment floor - a read, -//! like a loose table, may never tip us into a worse decision. +//! The gate is a per-style table (`earned_trust`), not a single hard-coded class: each style is +//! turned on only once its `... (blind)` twin in `sim::benchmark` proves the read never costs. This +//! can never make a read harmful: it only ever acts where acting is known to help, and falls back to +//! the solid baseline everywhere else. Same spirit as the price/commitment floor - a read, like a +//! loose table, may never tip us into a worse decision. use crate::exploit::style::{classify, Style}; use crate::game::{Spot, Villain}; -/// A read is acted on only when it marks a clearly-weak, over-calling opponent - the one class the -/// exploit logic is measured to beat blind play against. Every other style falls back to blind. +/// How much of a read's adjustment each opponent style has EARNED on the ladder — the measured right +/// to deviate from blind play. `1.0` = exploit in full, `0.0` = keep playing blind (the read is +/// dropped at the gate). This generalizes the old CallingStation-only gate into a per-style table, +/// so a style is turned on only once its read is proven never worse than blind (the `... (blind)` +/// twins in `sim::benchmark` / `benchmarks/baseline.txt`). +/// +/// Only `> 0.0` is consumed today (keep-or-drop at the gate); the shift shapes themselves live in +/// `exploit::style_shift` and apply in full to whatever survives the gate. The value is an `f64`, +/// not a bool, to leave room for a partial, confidence-weighted trust later without changing this +/// seam. +pub fn earned_trust(style: Style) -> f64 { + match style { + // Over-callers (fish, station): value-bet thinner, never bluff. Earned since Stage 0 — the + // `heads-up ... (blind)` twins show a large recaptured prize. + Style::CallingStation => 1.0, + // Measured on the ladder (Stage 3, every non-style run at full trust against the blind + // baseline): acting on a strong-player read only ever COSTS. Heads-up, a truthful read is + // worse than blind by reg −176, maniac −148, nit −50 bb/100 — the nit turns a +38 blind + // winner into a loser. The decision-trace diagnostic (Stage 5, `sim_blind:: + // diagnose_nit_full_read_leak`) localized the nit leak: it is not under-barrelling but the + // OPPOSITE — the read turns flop CHECKS into bluff-RAISES (140 hands, −436 of −596 bb total), + // because `table_fold` now sees the nit's true 0.82 fold rate and the single-street bluff-EV + // books `0.82 × pot` as near-pure profit. The 18 % that continue hold a nutted range and + // bleed across turn and river, a multi-street cost the single-street called branch never + // models. The DEFENSIVE adjustments of the same read all GAIN (fold more thin value / bluff + // catchers into a proven non-bluffer) and are already harvested by the ungated MDF floor + // (`mdf_floor::floor` on the raw spot in `engine::decide`); this gate governs only the + // OFFENSIVE adjustments, which over-fire into strong ranges. So every non-over-caller stays + // blind until the bluff-EV models the multi-street cost of a called barrel (BEFUND-nit-read-leck). + Style::Regular => 0.0, + Style::Nit => 0.0, + Style::LooseAggressive => 0.0, + // No usable read. + Style::Unknown => 0.0, + } +} + +/// A read is acted on only when its style has earned trust on the ladder - the classes the exploit +/// logic is measured to beat blind play against. Every other style falls back to blind. pub fn exploit_worthy(style: Style) -> bool { - matches!(style, Style::CallingStation) + earned_trust(style) > 0.0 } /// The spot with every opponent read the engine is not (yet) proven to use profitably dropped to /// `None`, so the decision plays blind against competent and aggressive opponents and only exploits -/// the weak. +/// the earned styles. pub fn gate_reads(spot: &Spot) -> Spot { let villains = spot .villains diff --git a/src/engine/river_subgame.rs b/src/engine/river_subgame.rs new file mode 100644 index 00000000..17d9b8ca --- /dev/null +++ b/src/engine/river_subgame.rs @@ -0,0 +1,641 @@ +//! Engine bridge from a live river spot to the pure CFR river solver (`cfr::river`). +//! +//! This is the Stage-A wiring: it turns the engine's own belief (the villain range model, as built +//! in `engine::decide::postflop`) into strength buckets, solves the heads-up river subgame to +//! equilibrium, and reads back hero's **mixed** action for the bucket its real hand sits in. All +//! poker-specific sourcing lives here; the solver stays a pure game over abstract buckets. +//! +//! # What changed from the first slice (and why it matters for exploitability) +//! +//! The first version solved with hero as a revealed **point mass** (one known hand) and then +//! collapsed the equilibrium mix to its majority action. Both make the line maximally exploitable: +//! a point-mass hero lets the solved villain best-respond to hero's exact strength (no need to +//! balance), and a pure readback cannot bluff or defend at the right frequency. Against a villain +//! that best-responds over hero's TRUE range, that bleeds — which the postflop-exploitability +//! harness (`sim::exploit_river`) measured at 32–108 bb/100. +//! +//! This version models hero with the **same strength distribution as the villain** (a symmetric +//! river prior — both players reach the river with strength spread over the board's quantiles) and +//! returns the equilibrium **mix** for hero's bucket. That is a balanced RANGE strategy: value +//! buckets bet, a calibrated fraction of air bluffs (bluff-to-value `s/(P+s)`), bluff-catchers +//! defend at MDF `P/(P+s)`. Live play realises the mix from the spot seed; the harness reads the +//! frequency directly. +//! +//! # Slice (v1) +//! +//! **Heads-up river**, both hero nodes of the solver's tree: +//! - hero first to act (`to_call == 0`) → check / bet, +//! - hero facing a bet (`to_call > 0`, the pre-bet pot `pot - to_call`, bet `to_call`) → fold / call. +//! +//! Multiway, or a villain range the engine cannot enumerate, returns `None` so the caller keeps the +//! heuristic. The solver equilibrium is the unexploitable baseline; whether wiring it into live play +//! also holds the bb/100 ladder is a measured question, not an assumption. +//! +//! # Named approximations +//! +//! - Hero's river range is modelled as the villain's strength distribution, not hero's true line- +//! consistent range. The closer the two, the lower the residual exploitability. +//! - The villain range is cut into `BUCKETS` equal-count (quantile) buckets, so a higher bucket index +//! always wins the showdown; the quantile cut makes the modelled distribution uniform over buckets. +//! - The solver's action abstraction is one bet size, no raises (`cfr::river` v1). + +use crate::card::Card; +use crate::cfr::kl_br::kl_best_response; +use crate::cfr::river::tree_with_chance; +use crate::cfr::solve::{solve, Solved}; +use crate::cfr::strategy::Strategy; +use crate::cfr::tree::Tree; +use crate::exploit::fold_chance::DEFAULT_FOLD_TO_BET; +use crate::exploit::posterior::DEFAULT_AGGRESSION; +use crate::exploit::profile::Profile; +use crate::game::{Choice, Decision, Spot, Street}; +use crate::hand::showdown::judge; +use crate::hand::strength::Strength; +use crate::rng::Rng; +use crate::sizing::candidates::candidates; + +/// CFR+ iterations per live solve. Enough for the tiny tree (9 nodes) to converge; an +/// under-converged solve is itself exploitable, so this is not shaved. +const ITERS: u32 = 12_000; +/// Target bet size as a fraction of the pot; the nearest legal candidate is used. +const TARGET_BET_FRACTION: f64 = 0.66; + +// --- Belief + trust gearbox (the crown): turn the read into a believed villain strategy and a KL +// trust radius, so the solver EXPLOITS a known opponent instead of balancing against it, bounded by +// how much the read is trusted. λ = ∞ (no read) returns the proven-unexploitable GTO mix. --- + +/// Normalised ladder rank at/above which the believed villain value-bets when checked to (top buckets). +const VALUE_RANK: f64 = 0.60; +/// Normalised ladder rank at/below which the believed villain may bluff when checked to (bottom buckets). +const BLUFF_RANK: f64 = 0.30; +/// Chip-scale of the KL radius at confidence 0.5 (as a fraction of the subgame pot). λ is in payoff +/// (chip) units; tying it to the pot keeps the trust radius scale-free across spot sizes. The map is +/// `λ = LAMBDA_POT_SCALE · pot · (1−c)/c`: c→0 ⇒ λ→∞ (pure GTO), c→1 ⇒ λ→0 (full best response). +const LAMBDA_POT_SCALE: f64 = 1.0; +/// Below this read confidence the gearbox stands down (returns `None`) and the proven heuristic keeps +/// the blind/exploit edge. Rationale: at a weak read λ is huge and the tilt collapses to near-GTO, +/// and GTO river play is itself worse than the heuristic against an unread exploitable field (the −43 +/// revert). So the solver only takes over once the read is strong enough to EXPLOIT, never to balance. +const CONFIDENCE_FLOOR: f64 = 0.25; + +/// Hero's equilibrium mix at the river node the spot sits on. +pub struct RiverPlan { + /// `true` = hero is facing a bet (`mix` is `[fold, call]`); `false` = hero acts first + /// (`mix` is `[check, bet]`). + pub facing: bool, + /// The two action probabilities for hero's bucket, in the order above. + pub mix: [f64; 2], + /// The bet-to total when acting first (the raise size); `0` facing a bet. + pub bet_to: f64, + /// Human reason for the decision log. + pub reason: String, +} + +impl RiverPlan { + /// Probability of the aggressive action (bet, or call facing a bet). + fn forward(&self) -> f64 { + self.mix[1] + } +} + +/// The legal bet-to total nearest `TARGET_BET_FRACTION * pot`, or `None` if nothing is bettable. +fn bet_to(spot: &Spot) -> Option { + let target = TARGET_BET_FRACTION * spot.pot; + candidates(spot) + .into_iter() + .filter(|to| *to > 0.0 && *to <= spot.hero_stack) + .min_by(|a, b| (a - target).abs().total_cmp(&(b - target).abs())) +} + +/// Two hole-card hands can be dealt together only if they share no card. +fn disjoint(a: &[Card], b: &[Card]) -> bool { + a.iter().all(|c| !b.contains(c)) +} + +/// A solved card-exact river subgame plus the shared strength ladder, so hero's real hand can be +/// placed on the same buckets the solve used. The `tree` is kept so the belief/trust gearbox can +/// best-respond to a believed villain (`kl_best_response`) over the same game the GTO solve used. +struct Subgame { + tree: Tree, + solved: Solved, + ladder: Vec, +} + +impl Subgame { + /// The bucket a strength sits in on the shared ladder (its ascending rank, clamped to the top). + fn bucket(&self, s: Strength) -> usize { + self.ladder.partition_point(|d| *d < s).min(self.ladder.len() - 1) + } +} + +/// Build and solve the card-exact heads-up river subgame the engine believes it is in. Hero's range +/// is modelled as the villain's believed range (`hero_combos == villain_combos`, a symmetric river +/// prior); both are bucketed by **exact showdown strength** on one shared ascending ladder, and the +/// joint deal table carries **card removal** between the two ranges — the same construction the +/// exploitability harness uses for the true game. This faithfulness is what lets the equilibrium it +/// plays actually be unexploitable; the coarse symmetric-uniform first cut was not, and measured +/// worse than the heuristic. `None` for fewer than two distinct strengths. +fn subgame(spot: &Spot, hero_combos: &[Vec], villain_combos: &[Vec], pot: f64, bet: f64) -> Option { + let rules = spot.rules(); + let judged = |combos: &[Vec]| -> Vec<(Vec, Strength)> { + combos.iter().filter_map(|c| judge(&rules, c, &spot.board).ok().map(|s| (c.clone(), s))).collect() + }; + let hero = judged(hero_combos); + let villain = judged(villain_combos); + if hero.is_empty() || villain.is_empty() { + return None; + } + let mut ladder: Vec = hero.iter().chain(&villain).map(|(_, s)| *s).collect(); + ladder.sort(); + ladder.dedup(); + let n = ladder.len(); + if n < 2 { + return None; + } + let bucket = |s: Strength| ladder.partition_point(|d| *d < s).min(n - 1); + let mut chance = vec![0.0; n * n]; + for (hc, hs) in &hero { + let hb = bucket(*hs); + for (vc, vs) in &villain { + if disjoint(hc, vc) { + chance[hb * n + bucket(*vs)] += 1.0; + } + } + } + let total: f64 = chance.iter().sum(); + if total <= 0.0 { + return None; + } + chance.iter_mut().for_each(|x| *x /= total); + let tree = tree_with_chance(n, chance, pot, bet); + let solved = solve(&tree, ITERS, Rng::seeded(spot.seed)); + Some(Subgame { tree, solved, ladder }) +} + +/// The believed villain strategy over the river tree, read off the opponent's `Profile`: how this +/// specific opponent plays the two villain nodes, as opposed to the balanced GTO villain the +/// symmetric solve assumes. `kl_best_response` best-responds hero toward this belief, bounded by λ. +/// +/// - **`v_bet` `[fold, call]`** (villain facing hero's bet): folds the weakest `fold_to_bet` fraction +/// of the ladder by rank, calls the rest. A calling station (low fold-to-bet) calls almost +/// everything → hero value-bets thin and never bluffs; an over-folder folds more → hero bluffs. +/// - **`v_check` `[check, bet]`** (villain checked to): value-bets the top buckets, bluffs the bottom +/// buckets at a frequency scaled from the read's `aggression` around the GTO bluff ratio +/// `s/(P+s)`. A tight under-bluffer bets a value-heavy range → hero folds its bluff-catchers (the +/// river-overbet-defense fix); a maniac over-bluffs → hero calls down. +/// +/// `aggression` is passed in by the caller so it can be STREET-SPECIFIC (the turn gearbox feeds turn +/// aggression, the river gearbox river aggression, each falling back to the pooled read). A single +/// pooled aggression under-sells a turn-barreler's turn bluffing and made the defensive veto fold a +/// good call against aggressive opponents; the per-street value fixes that misfire. `None` → the GTO +/// default. Only the two villain rows matter to `kl_best_response` (it keeps hero's GTO rows); the +/// base is a uniform strategy over the same tree, so the node widths line up. +pub(crate) fn believed_villain(tree: &Tree, n: usize, profile: Option<&Profile>, pot: f64, bet: f64, aggression: Option) -> Strategy { + let f = profile.and_then(|p| p.fold_to_bet).filter(|x| !x.is_nan()).unwrap_or(DEFAULT_FOLD_TO_BET).clamp(0.0, 1.0); + let a = aggression.filter(|x| !x.is_nan()).unwrap_or(DEFAULT_AGGRESSION).clamp(0.0, 1.0); + let rank = |c: usize| if n <= 1 { 1.0 } else { c as f64 / (n - 1) as f64 }; + let gto_bluff = if pot + bet > 0.0 { bet / (pot + bet) } else { 0.0 }; + let bluff_prob = if DEFAULT_AGGRESSION > 0.0 { (gto_bluff * a / DEFAULT_AGGRESSION).clamp(0.0, 1.0) } else { 0.0 }; + + let base = Strategy::uniform(tree); + let with_call = base + .with_rows(tree, "v_bet", |c| if rank(c) >= f { vec![0.0, 1.0] } else { vec![1.0, 0.0] }) + .unwrap_or(base); + with_call + .with_rows(tree, "v_check", |c| { + let r = rank(c); + let bet_p = if r >= VALUE_RANK { + 1.0 + } else if r <= BLUFF_RANK { + bluff_prob + } else { + 0.0 + }; + vec![1.0 - bet_p, bet_p] + }) + .unwrap_or(with_call) +} + +/// The KL trust radius from the read's confidence (payoff/chip units). `λ = LAMBDA_POT_SCALE · pot · +/// (1−c)/c`: no confidence (`None`/0) → `∞` → `kl_best_response` returns exact GTO (the proven +/// unexploitable baseline — it can never again balance against a fish it cannot read); confidence → 1 +/// → `λ → 0` → full best response to the believed villain. Monotone decreasing in `c`. +pub(crate) fn lambda_from_confidence(confidence: Option, pot: f64) -> f64 { + let c = confidence.filter(|x| !x.is_nan()).unwrap_or(0.0).clamp(0.0, 0.999); + if c <= 0.0 { + return f64::INFINITY; + } + LAMBDA_POT_SCALE * pot.max(0.0) * (1.0 - c) / c +} + +/// Solve the heads-up river subgame from the engine's belief (`villain_combos`) and return hero's +/// equilibrium mix at the node the spot sits on, or `None` when the v1 slice does not apply (the +/// caller then keeps the heuristic). +pub fn river_plan(spot: &Spot, villain_combos: &[Vec]) -> Option { + if spot.street != Street::River { + return None; + } + if spot.live_villains().count() != 1 || villain_combos.is_empty() { + return None; + } + let rules = spot.rules(); + let hero_strength = judge(&rules, &spot.hero_cards, &spot.board).ok()?; + + if spot.to_call == 0.0 { + let bet = bet_to(spot)?; + let game = subgame(spot, villain_combos, villain_combos, spot.pot, bet)?; + let hb = game.bucket(hero_strength); + let probs = game.solved.strategy.row(0, hb).to_vec(); // [check, bet] + let bet_p = probs.get(1).copied().unwrap_or(0.0); + Some(RiverPlan { + facing: false, + mix: [probs.first().copied().unwrap_or(1.0 - bet_p), bet_p], + bet_to: bet, + reason: format!("river subgame: bucket {hb}/{}, p(bet) {bet_p:.2}", game.ladder.len()), + }) + } else { + // Facing a bet: the solver's pre-bet pot is `pot - to_call`, the bet is `to_call`. + let p = spot.pot - spot.to_call; + let bet = spot.to_call; + if p <= 0.0 || bet <= 0.0 { + return None; + } + let game = subgame(spot, villain_combos, villain_combos, p, bet)?; + let hb = game.bucket(hero_strength); + let row = game.solved.strategy.row(4, hb).to_vec(); // [fold, call] + let call_p = row.get(1).copied().unwrap_or(0.0); + Some(RiverPlan { + facing: true, + mix: [row.first().copied().unwrap_or(1.0 - call_p), call_p], + bet_to: 0.0, + reason: format!("river subgame: bucket {hb}/{} facing bet, p(call) {call_p:.2}", game.ladder.len()), + }) + } +} + +/// The belief + trust version of `river_plan`: solve the subgame for GTO, then tilt hero's strategy +/// toward best-responding to the **believed** villain (`believed_villain`, from `profile`) inside a +/// KL ball of radius λ (`lambda_from_confidence`, from the read's confidence). Returns hero's tilted +/// mix at the node the spot sits on. +/// +/// This is the fix for the −43 "balanced vs a fish" revert: a strong read exploits (value-bets thin, +/// folds under-bluffed overbets), a weak or absent read collapses to the proven-unexploitable GTO +/// mix (λ → ∞). `None` outside the v1 slice, so the caller keeps the heuristic. +pub fn river_exploit_plan(spot: &Spot, villain_combos: &[Vec], profile: Option<&Profile>) -> Option { + if spot.street != Street::River { + return None; + } + if spot.live_villains().count() != 1 || villain_combos.is_empty() { + return None; + } + // Only exploit on a read strong enough to trust; otherwise the heuristic keeps the edge. + if profile.and_then(|p| p.confidence).filter(|c| !c.is_nan()).unwrap_or(0.0) < CONFIDENCE_FLOOR { + return None; + } + let rules = spot.rules(); + let hero_strength = judge(&rules, &spot.hero_cards, &spot.board).ok()?; + + let (pot, bet, facing) = if spot.to_call == 0.0 { + (spot.pot, bet_to(spot)?, false) + } else { + let p = spot.pot - spot.to_call; + if p <= 0.0 || spot.to_call <= 0.0 { + return None; + } + (p, spot.to_call, true) + }; + + let game = subgame(spot, villain_combos, villain_combos, pot, bet)?; + let n = game.ladder.len(); + let opponent = believed_villain(&game.tree, n, profile, pot, bet, profile.and_then(|p| p.river_aggression.or(p.aggression))); + let lambda = lambda_from_confidence(profile.and_then(|p| p.confidence), pot); + let tilted = kl_best_response(&game.tree, &opponent, &game.solved.strategy, 0, lambda); + let hb = game.bucket(hero_strength); + + // Node 0 "hero" [check, bet] when first to act; node 4 "hero_vs_bet" [fold, call] facing a bet. + let node = if facing { 4 } else { 0 }; + let row = tilted.row(node, hb).to_vec(); + let forward = row.get(1).copied().unwrap_or(0.0); + Some(RiverPlan { + facing, + mix: [row.first().copied().unwrap_or(1.0 - forward), forward], + bet_to: if facing { 0.0 } else { bet }, + reason: format!( + "river gearbox: bucket {hb}/{n}{}, λ {:.2}, p(fwd) {forward:.2}", + if facing { " facing bet" } else { "" }, + lambda + ), + }) +} + +/// Below this believed call frequency the defensive veto folds: when the KL-bounded best response to +/// the believed villain calls hero's bucket less than half the time, the believed bet is value-heavy +/// enough that the heuristic's call is −EV. A full 0.5 keeps the veto to clear under-bluff reads. +const VETO_CALL_FLOOR: f64 = 0.5; + +/// Defensive river veto: on a confident read that the villain UNDER-bluffs its bet, fold a heuristic +/// CALL that the belief+trust gearbox would not make. This is the gearbox's one proven edge — the +/// single-street heuristic over-calls under-bluffed river overbets (nemesis-3) because its range model +/// carries the GTO bluff share a tight bettor does not have. Everything else is left to the heuristic: +/// the veto only ever turns a call into a fold facing a bet, never touches a bet/check/raise, and +/// stands down on a thin read (confidence floor) or off the heads-up river slice. +/// +/// Safe by construction against the −43/−48 "balanced vs a fish" regression: it cannot change hero's +/// OFFENSE, only decline a call the read prices as losing. The caller gates it to cash (no ICM premium). +pub fn fold_veto(spot: &Spot, base: Decision) -> Decision { + if base.choice != Choice::Call { + return base; + } + let Some(plan) = river_exploit_mix(spot) else { + return base; + }; + if !plan.facing || plan.mix[1] >= VETO_CALL_FLOOR { + return base; + } + Decision { + choice: Choice::Fold, + reason: format!("defensive veto: {} (heuristic would call)", plan.reason), + ..base + } +} + +/// Realise a `RiverPlan` into a concrete decision, mixing from the spot seed (deterministic per spot, +/// correct frequency across the range of deals). Confidence rises as the mix leaves 50/50. +pub fn realize(spot: &Spot, plan: &RiverPlan) -> Decision { + let (draw, _) = Rng::seeded(spot.seed).unit(); + let aggressive = draw < plan.forward(); + let choice = match (plan.facing, aggressive) { + (false, true) => Choice::Raise { to: plan.bet_to }, + (false, false) => Choice::Check, + (true, true) => Choice::Call, + (true, false) => Choice::Fold, + }; + let confidence = 0.5 + (plan.forward() - 0.5).abs(); + Decision::new(choice, confidence, plan.reason.clone()) +} + +/// Build the villain belief combos the way `decide::postflop` does (gated reads, enumerated range) +/// and return hero's river mix — the measurement entry point for `sim::exploit_river`, faithful to +/// what the live engine would play. `None` when the slice does not apply. +pub fn river_mix(spot: &Spot) -> Option { + if spot.street != Street::River { + return None; + } + let gated = crate::engine::read_gate::gate_reads(spot); + let spot = &gated; + if spot.live_villains().count() != 1 { + return None; + } + let villain = spot.live_villains().next()?; + let rules = spot.rules(); + let filter = crate::engine::range_filter::range_filter( + &crate::exploit::range_model::range_spec(spot, villain), + rules, + spot.variant, + &spot.board, + ); + let dead: Vec = spot.hero_cards.iter().chain(&spot.board).copied().collect(); + let list = crate::engine::range_combos::combos(&rules, &filter, &dead)?; + river_plan(spot, &list) +} + +/// Live entry for the belief + trust gearbox: source the villain belief range from the **raw** +/// (ungated) read and hand the solver the opponent's real `Profile` (tendencies + confidence). The +/// gate that blinds the heuristic is not applied here — the KL trust radius (λ from confidence) is +/// the gearbox's own safety, so it reads the true opponent and the floor keeps it from acting on a +/// thin read. `None` outside the v1 slice or below the confidence floor, so the caller keeps the +/// heuristic. +pub fn river_exploit_mix(spot: &Spot) -> Option { + if spot.street != Street::River { + return None; + } + if spot.live_villains().count() != 1 { + return None; + } + let villain = spot.live_villains().next()?; + let profile = villain.profile.as_ref(); + let rules = spot.rules(); + let filter = crate::engine::range_filter::range_filter( + &crate::exploit::range_model::range_spec(spot, villain), + rules, + spot.variant, + &spot.board, + ); + let dead: Vec = spot.hero_cards.iter().chain(&spot.board).copied().collect(); + let list = crate::engine::range_combos::combos(&rules, &filter, &dead)?; + river_exploit_plan(spot, &list, profile) +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::game::{ActionKind, Villain}; + use crate::variant::Variant; + + /// A heads-up river spot where hero is first to act into `pot` with check or a two-thirds bet. + fn river_to_act(board: &[Card], hero: &str, pot: f64) -> Spot { + Spot { + variant: Variant::Nlhe, + big_blind: 1.0, + seats: 2, + hero_seat: 1, + button_seat: Some(1), + hero_cards: Card::parse_list(hero).unwrap(), + board: board.to_vec(), + street: Street::River, + pot, + to_call: 0.0, + hero_stack: pot * 4.0, + min_raise_to: Some(pot * 0.66), + max_raise_to: Some(pot * 4.0), + legal: vec![ActionKind::Check, ActionKind::Raise], + allowed_sizes: Some(vec![pot * 0.66]), + villains: vec![Villain { seat: 2, stack: pot * 4.0, folded: false, profile: None }], + seed: 0x5EED_B17E, + history: Vec::new(), + } + } + + /// A river spot the slice accepts (heads-up, hero to act) returns a mix, and a strong made hand + /// leans to betting. Guards the wiring, not the exact frequency. + #[test] + fn a_made_hand_to_act_gets_a_river_mix_that_leans_to_bet() { + let board = Card::parse_list("Ah Kd 7c 2s 9h").unwrap(); + let villain: Vec> = ["Ad Jc", "Qh Qd", "Jd Jh", "8c 8d", "6h 6d", "5c 4c", "Td 9c", "Kc Qc"] + .iter() + .map(|c| Card::parse_list(c).unwrap()) + .collect(); + let spot = river_to_act(&board, "Ac As", 6.0); // overpair-strength: top two on this board + let plan = river_plan(&spot, &villain).expect("heads-up river to-act is in slice"); + assert!(!plan.facing); + assert!(plan.bet_to > 0.0); + assert!( + plan.forward() > 0.5, + "a strong made hand should lean to betting, got p(bet) {:.2}", + plan.forward() + ); + } + + // --- belief + trust gearbox --- + + use crate::cfr::river::tree_with_chance; + + fn prof(fold_to_bet: f64, aggression: f64, confidence: f64) -> Profile { + Profile { + fold_to_bet: Some(fold_to_bet), + aggression: Some(aggression), + confidence: Some(confidence), + ..Default::default() + } + } + + fn uniform_tree(n: usize, pot: f64, bet: f64) -> Tree { + tree_with_chance(n, vec![1.0 / (n * n) as f64; n * n], pot, bet) + } + + /// λ is ∞ without a read (⇒ kl_br returns exact GTO), finite with one, and falls as the read + /// strengthens; at confidence 0.5 it is exactly `LAMBDA_POT_SCALE · pot`. + #[test] + fn lambda_falls_as_confidence_rises_and_is_infinite_without_a_read() { + assert!(lambda_from_confidence(None, 6.0).is_infinite()); + assert!(lambda_from_confidence(Some(0.0), 6.0).is_infinite()); + let mid = lambda_from_confidence(Some(0.5), 6.0); + let high = lambda_from_confidence(Some(0.9), 6.0); + assert!(mid.is_finite() && high.is_finite()); + assert!(high < mid, "λ must fall as confidence rises: {high} !< {mid}"); + assert!((mid - LAMBDA_POT_SCALE * 6.0).abs() < 1e-9, "c=0.5 ⇒ λ = pot·scale"); + } + + /// The believed villain facing a bet calls a wider slice of the ladder when it is a low-fold + /// station than when it is a high-fold over-folder. + #[test] + fn a_believed_station_calls_wider_than_a_believed_overfolder() { + let n = 6; + let tree = uniform_tree(n, 2.0, 1.0); + let station = believed_villain(&tree, n, Some(&prof(0.10, 0.35, 0.8)), 2.0, 1.0, Some(0.35)); + let overfolder = believed_villain(&tree, n, Some(&prof(0.80, 0.35, 0.8)), 2.0, 1.0, Some(0.35)); + // node 2 "v_bet", action 1 = call. + let calls = |s: &Strategy| (0..n).filter(|&c| s.probability(2, c, 1) > 0.5).count(); + assert!( + calls(&station) > calls(&overfolder), + "station calls wider: {} vs {}", + calls(&station), + calls(&overfolder) + ); + } + + /// The believed villain bluffs its air (bottom bucket) more when checked to the more aggressive + /// the read — a passive under-bluffer bets a value-heavy range. + #[test] + fn a_believed_aggressive_villain_bluffs_more_when_checked_to() { + let n = 10; + let tree = uniform_tree(n, 2.0, 1.0); + let passive = believed_villain(&tree, n, Some(&prof(0.45, 0.10, 0.8)), 2.0, 1.0, Some(0.10)); + let maniac = believed_villain(&tree, n, Some(&prof(0.45, 0.80, 0.8)), 2.0, 1.0, Some(0.80)); + // node 1 "v_check", bucket 0 = air, action 1 = bet. + assert!( + maniac.probability(1, 0, 1) > passive.probability(1, 0, 1), + "a maniac bluffs its air more: {} !> {}", + maniac.probability(1, 0, 1), + passive.probability(1, 0, 1) + ); + } + + fn river_to_act_vs(board: &[Card], hero: &str, pot: f64, profile: Option) -> Spot { + Spot { + villains: vec![Villain { seat: 2, stack: pot * 4.0, folded: false, profile }], + ..river_to_act(board, hero, pot) + } + } + + fn sample_villain() -> Vec> { + ["Ad Jc", "Qh Qd", "Jd Jh", "8c 8d", "6h 6d", "5c 4c", "Td 9c", "Kc Qc"] + .iter() + .map(|c| Card::parse_list(c).unwrap()) + .collect() + } + + /// Below the confidence floor the gearbox stands down (`None`) so the heuristic keeps the edge. + #[test] + fn the_gearbox_stands_down_below_the_confidence_floor() { + let board = Card::parse_list("Ah Kd 7c 2s 9h").unwrap(); + let villain = sample_villain(); + let thin = river_to_act_vs(&board, "Ac As", 6.0, Some(prof(0.2, 0.3, 0.10))); + assert!( + river_exploit_plan(&thin, &villain, thin.live_villains().next().unwrap().profile.as_ref()).is_none(), + "confidence 0.10 < floor ⇒ no plan" + ); + let confident = river_to_act_vs(&board, "Ac As", 6.0, Some(prof(0.2, 0.3, 0.80))); + assert!( + river_exploit_plan(&confident, &villain, confident.live_villains().next().unwrap().profile.as_ref()).is_some(), + "confidence 0.80 ≥ floor ⇒ a plan" + ); + } + + /// A confident calling-station read makes hero value-bet a strong made hand (exploit, not balance). + #[test] + fn a_confident_station_read_value_bets_a_strong_hand() { + let board = Card::parse_list("Ah Kd 7c 2s 9h").unwrap(); + let villain = sample_villain(); + let spot = river_to_act_vs(&board, "Ac As", 6.0, Some(prof(0.08, 0.15, 0.85))); + let plan = river_exploit_plan(&spot, &villain, spot.live_villains().next().unwrap().profile.as_ref()) + .expect("confident heads-up river to-act is in slice"); + assert!(!plan.facing); + assert!(plan.forward() > 0.5, "value-bet a strong hand into a station, got p(bet) {:.2}", plan.forward()); + } + + /// A heads-up river spot where hero faces a `bet` into the pre-bet pot `pot`, with fold or call. + fn river_vs_bet(board: &[Card], hero: &str, pot: f64, bet: f64, profile: Option) -> Spot { + Spot { + variant: Variant::Nlhe, + big_blind: 1.0, + seats: 2, + hero_seat: 1, + button_seat: Some(1), + hero_cards: Card::parse_list(hero).unwrap(), + board: board.to_vec(), + street: Street::River, + pot: pot + bet, + to_call: bet, + hero_stack: pot * 4.0, + min_raise_to: None, + max_raise_to: None, + legal: vec![ActionKind::Fold, ActionKind::Call], + allowed_sizes: None, + villains: vec![Villain { seat: 2, stack: pot * 4.0, folded: false, profile }], + seed: 0x5EED_B17E, + history: Vec::new(), + } + } + + /// The core nemesis-3 mechanism the defensive veto rides on: a confident read that the villain + /// UNDER-bluffs its river bet (tight, passive) best-responds hero's bluff-catcher toward a FOLD + /// (believed call frequency below the veto floor), where the single-street heuristic would call. + #[test] + fn a_confident_underbluff_read_folds_a_bluff_catcher_facing_a_bet() { + let board = Card::parse_list("Ah Kd 7c 2s 9h").unwrap(); + let villain = sample_villain(); + // Jc Js: a genuine bluff-catcher on this A-K-high board — it loses to the villain's value + // (AJ=aces, KQ=kings, QQ) and beats only the bottom (99, 88, 66, 54). Vs a believed + // UNDER-bluffer the bet is value-heavy, so calling is −EV and the gearbox folds. + let spot = river_vs_bet(&board, "Jc Js", 6.0, 6.0, Some(prof(0.30, 0.06, 0.85))); + let plan = river_exploit_plan(&spot, &villain, spot.live_villains().next().unwrap().profile.as_ref()) + .expect("confident heads-up river vs-bet is in slice"); + assert!(plan.facing, "facing a bet"); + assert!( + plan.mix[1] < VETO_CALL_FLOOR, + "a bluff-catcher vs a believed under-bluffer should fold (p(call) {:.2} < {VETO_CALL_FLOOR})", + plan.mix[1] + ); + } + + /// The veto never touches hero's offense: a base that is not a call is returned unchanged even + /// though a plan exists (guards against the −43/−48 full-replacement regression returning). + #[test] + fn the_veto_leaves_a_non_call_decision_untouched() { + let board = Card::parse_list("Ah Kd 7c 2s 9h").unwrap(); + let spot = river_vs_bet(&board, "Qc Qd", 6.0, 6.0, Some(prof(0.30, 0.06, 0.85))); + let check = Decision::new(Choice::Check, 0.7, "heuristic check"); + assert_eq!(fold_veto(&spot, check.clone()), check, "a non-call base is never vetoed"); + } +} diff --git a/src/engine/turn_subgame.rs b/src/engine/turn_subgame.rs new file mode 100644 index 00000000..ff048957 --- /dev/null +++ b/src/engine/turn_subgame.rs @@ -0,0 +1,596 @@ +//! Engine bridge from a live TURN spot to the depth-limited turn+river CFR solver +//! (`cfr::turn_river`). The turn-street analogue of `engine::river_subgame`, one street deeper. +//! +//! # Construction (Option B: depth-limited turn, river-equilibrium leaf) +//! +//! The turn is NOT the last street, so a turn showdown is not exact — what a turn line is worth +//! depends on how the river then plays. This bridge solves only the turn betting round and evaluates +//! each "reach the river" leaf by the **equilibrium value of the river subgame** it leads to, +//! averaged over the runout: +//! +//! 1. Source the villain belief range (gated reads → `range_spec` → `range_filter` → `combos`), the +//! same pipeline as the river. Hero is modelled with the same range (symmetric prior), as on the +//! river. Bucket both by **turn** strength (`judge` on the 4-card board) into one shared ladder. +//! 2. For every river card (`deck::without_in` over the turn board), solve the heads-up river subgame +//! (`cfr::river`) at the two possible river-start pots (turn checked through, and a called turn +//! bet), and read its equilibrium value per river-bucket pair (`cfr::turn_river::pair_values`). +//! Fold those values back onto the **turn** buckets, weighted by card removal, to get two leaf +//! matrices `V_check[i][j]` and `V_bet[i][j]` (hero's expected river chips given the turn buckets). +//! 3. Build the turn tree (`cfr::turn_river::tree_with_leaf`) with those leaves and solve it. Read +//! hero's mixed action for the bucket its real turn hand sits in. +//! +//! This is the proven river construction lifted one street: the CFR core is unchanged, the leaf is a +//! real equilibrium value (not an equity guess), and when the river leaf degenerates to a showdown +//! the turn tree is identical to the river tree (`cfr::turn_river` tests). Multiway, or a range the +//! engine cannot enumerate, returns `None` and the caller keeps the heuristic. +//! +//! # Named approximations (beyond the river's own) +//! +//! - Hero's turn range is the villain's believed range (symmetric prior), as on the river. +//! - Turn and river buckets are equal-strength quantile cuts; a higher bucket wins the showdown on +//! that street. The leaf averages the river value over runouts at the combo level (card removal of +//! the river card is exact per pair), then aggregates to turn buckets. +//! - River sub-solves use one bet size (`cfr::river` v1) at `TARGET_BET_FRACTION` of the pot; the turn +//! likewise. Raises and multiple sizes are later versions. + +use crate::card::{deck, Card}; +use crate::cfr::kl_br::kl_best_response; +use crate::cfr::river::tree_with_chance; +use crate::cfr::solve::solve; +use crate::cfr::tree::Tree; +use crate::cfr::turn_river::{pair_values, tree_with_leaf}; +use crate::engine::river_subgame::{believed_villain, lambda_from_confidence}; +use crate::exploit::profile::Profile; +use crate::game::{Choice, Decision, Spot, Street}; +use crate::hand::showdown::judge; +use crate::hand::strength::Strength; +use crate::rng::Rng; +use crate::sizing::candidates::candidates; + +/// CFR+ iterations for the turn solve (tiny 9-node tree). +const TURN_SOLVE_ITERS: u32 = 6_000; +/// CFR+ iterations for each river sub-solve that feeds a leaf value. These feed an averaged value, not +/// a live decision, so a lighter budget than the live river solver (12k) is enough. +const RIVER_LEAF_ITERS: u32 = 3_000; +/// Target bet size as a fraction of the pot; the nearest legal candidate is used (turn), the exact +/// fraction is used for the river sub-solves. +const TARGET_BET_FRACTION: f64 = 0.66; +/// Below this read confidence the turn gearbox stands down (the heuristic keeps the edge). Mirrors the +/// river gearbox: at a weak read λ is huge and the tilt collapses to near-GTO, and a balanced turn line +/// is worse than the heuristic against an unread exploitable field. +const CONFIDENCE_FLOOR: f64 = 0.25; +/// Below this believed call frequency the defensive veto folds a heuristic turn call: the believed +/// (KL-bounded) best response calls hero's bucket less than half the time, so the believed turn bet is +/// value-heavy enough that the call is −EV. The turn analogue of the proven river `VETO_CALL_FLOOR`. +const VETO_CALL_FLOOR: f64 = 0.5; + +/// Measurement toggle (read once): `TURN_VETO=0` disables the live turn veto so a single run can +/// measure the engine with the veto on vs off on the same deals (paired). Default on. Not read on the +/// hot path beyond the first call. +fn veto_enabled() -> bool { + use std::sync::OnceLock; + static ON: OnceLock = OnceLock::new(); + *ON.get_or_init(|| std::env::var("TURN_VETO").as_deref() != Ok("0")) +} + +/// CFR+ iterations per river leaf solve, overridable via `TURN_LEAF_ITERS` (read once) for a +/// speed/accuracy sweep — the dominant cost is `~44` of these per turn build. The default +/// `RIVER_LEAF_ITERS` leaves behaviour bit-identical; a lower value trades leaf-value precision for +/// speed. A non-numeric or zero value falls back to the default. +fn river_leaf_iters() -> u32 { + use std::sync::OnceLock; + static ITERS: OnceLock = OnceLock::new(); + *ITERS.get_or_init(|| { + std::env::var("TURN_LEAF_ITERS") + .ok() + .and_then(|v| v.parse::().ok()) + .filter(|&n| n > 0) + .unwrap_or(RIVER_LEAF_ITERS) + }) +} + +/// Hero's equilibrium mix at the turn node the spot sits on. +pub struct TurnPlan { + /// `true` = hero faces a turn bet (`mix` is `[fold, call]`); `false` = hero acts first + /// (`mix` is `[check, bet]`). + pub facing: bool, + /// The two action probabilities for hero's bucket, in the order above. + pub mix: [f64; 2], + /// The bet-to total when acting first; `0` facing a bet. + pub bet_to: f64, + /// Human reason for the decision log. + pub reason: String, +} + +impl TurnPlan { + /// Probability of the aggressive action (bet, or call facing a bet). + pub fn forward(&self) -> f64 { + self.mix[1] + } +} + +/// The legal bet-to total nearest `TARGET_BET_FRACTION * pot`, or `None` if nothing is bettable. +fn bet_to(spot: &Spot) -> Option { + let target = TARGET_BET_FRACTION * spot.pot; + candidates(spot) + .into_iter() + .filter(|to| *to > 0.0 && *to <= spot.hero_stack) + .min_by(|a, b| (a - target).abs().total_cmp(&(b - target).abs())) +} + +/// Two hole-card hands can be dealt together only if they share no card. +fn disjoint(a: &[Card], b: &[Card]) -> bool { + a.iter().all(|c| !b.contains(c)) +} + +/// A solved turn subgame plus the shared turn-strength ladder, so hero's real hand can be placed on +/// the same buckets the solve used. +struct TurnGame { + tree: Tree, + solved: crate::cfr::solve::Solved, + ladder: Vec, +} + +impl TurnGame { + fn bucket(&self, s: Strength) -> usize { + self.ladder.partition_point(|d| *d < s).min(self.ladder.len() - 1) + } +} + +/// Build the two river leaf-value matrices (`V_check`, `V_bet`) over the turn buckets by solving the +/// river subgame for every runout at both river-start pots and folding the equilibrium values back +/// onto the turn buckets with exact card removal. `turn_n` is the turn-bucket count, `turn_bucket` +/// maps a combo's turn strength to its bucket, `p`/`s` the turn pot and bet. +fn river_leaves( + spot: &Spot, + hero: &[(Vec, usize)], // (combo, turn bucket) + villain: &[(Vec, usize)], + turn_n: usize, + p: f64, + s: f64, +) -> Option<(Vec, Vec)> { + let rules = spot.rules(); + let (pot_check, s_check) = (p, TARGET_BET_FRACTION * p); + let pot_bet = p + 2.0 * s; + let s_bet = TARGET_BET_FRACTION * pot_bet; + + let mut leaf_check = vec![0.0; turn_n * turn_n]; + let mut leaf_bet = vec![0.0; turn_n * turn_n]; + let mut counts = vec![0.0; turn_n * turn_n]; + + let rivers = deck::without_in(rules.deck, &spot.board); + for r in &rivers { + let mut board5 = spot.board.clone(); + board5.push(*r); + // River strengths of the combos that can still be dealt with this river out. + let judged = |src: &[(Vec, usize)]| -> Vec<(Vec, usize, Strength)> { + src.iter() + .filter(|(c, _)| !c.contains(r)) + .filter_map(|(c, tb)| judge(&rules, c, &board5).ok().map(|st| (c.clone(), *tb, st))) + .collect() + }; + let rh = judged(hero); + let rv = judged(villain); + if rh.is_empty() || rv.is_empty() { + continue; + } + // Shared river ladder (ascending, deduped) over both ranges on this runout. + let mut rladder: Vec = rh.iter().chain(&rv).map(|(_, _, st)| *st).collect(); + rladder.sort(); + rladder.dedup(); + let m = rladder.len(); + let rbucket = |st: Strength| rladder.partition_point(|d| *d < st).min(m.saturating_sub(1)); + + // A degenerate river (one strength level): the showdown is always a split, river value 0 + // around either pot. Still counts toward the average, contributing 0. + if m < 2 { + for (hc, tbh, _) in &rh { + for (vc, tbv, _) in &rv { + if disjoint(hc, vc) { + counts[tbh * turn_n + tbv] += 1.0; + } + } + } + continue; + } + + // River joint deal table over river buckets, card removal between the two ranges (the river + // card is already removed by construction). + let mut rchance = vec![0.0; m * m]; + for (hc, _, hst) in &rh { + let hb = rbucket(*hst); + for (vc, _, vst) in &rv { + if disjoint(hc, vc) { + rchance[hb * m + rbucket(*vst)] += 1.0; + } + } + } + let total: f64 = rchance.iter().sum(); + if total <= 0.0 { + continue; + } + rchance.iter_mut().for_each(|x| *x /= total); + + // Equilibrium river value per river-bucket pair, at each river-start pot. + let seed = spot.seed ^ u64::from(r.index()); + let tree_check = tree_with_chance(m, rchance.clone(), pot_check, s_check); + let w_check = pair_values(&tree_check, &solve(&tree_check, river_leaf_iters(), Rng::seeded(seed)).strategy); + let tree_bet = tree_with_chance(m, rchance, pot_bet, s_bet); + let w_bet = pair_values(&tree_bet, &solve(&tree_bet, river_leaf_iters(), Rng::seeded(seed)).strategy); + + // Fold the river values onto the turn buckets. + for (hc, tbh, hst) in &rh { + let rbh = rbucket(*hst); + for (vc, tbv, vst) in &rv { + if disjoint(hc, vc) { + let rbv = rbucket(*vst); + let k = tbh * turn_n + tbv; + leaf_check[k] += w_check[rbh * m + rbv]; + leaf_bet[k] += w_bet[rbh * m + rbv]; + counts[k] += 1.0; + } + } + } + } + + // Average per turn-bucket pair. Pairs that never co-occur keep 0 (they carry no chance weight). + for k in 0..turn_n * turn_n { + if counts[k] > 0.0 { + leaf_check[k] /= counts[k]; + leaf_bet[k] /= counts[k]; + } + } + Some((leaf_check, leaf_bet)) +} + +/// Build and solve the turn subgame the engine believes it is in, with the river folded into the +/// leaves. `p`/`s` are the turn pot and bet. `None` when it cannot be built (fewer than two distinct +/// turn strengths, empty ranges). +fn build_turn(spot: &Spot, hero_combos: &[Vec], villain_combos: &[Vec], p: f64, s: f64) -> Option { + let rules = spot.rules(); + let judged = |combos: &[Vec]| -> Vec<(Vec, Strength)> { + combos.iter().filter_map(|c| judge(&rules, c, &spot.board).ok().map(|st| (c.clone(), st))).collect() + }; + let hero = judged(hero_combos); + let villain = judged(villain_combos); + if hero.is_empty() || villain.is_empty() { + return None; + } + let mut ladder: Vec = hero.iter().chain(&villain).map(|(_, st)| *st).collect(); + ladder.sort(); + ladder.dedup(); + let n = ladder.len(); + if n < 2 { + return None; + } + let tb = |st: Strength| ladder.partition_point(|d| *d < st).min(n - 1); + let hero_b: Vec<(Vec, usize)> = hero.iter().map(|(c, st)| (c.clone(), tb(*st))).collect(); + let villain_b: Vec<(Vec, usize)> = villain.iter().map(|(c, st)| (c.clone(), tb(*st))).collect(); + + // Turn joint deal table over turn buckets (card removal between the two ranges). + let mut chance = vec![0.0; n * n]; + for (hc, hb) in &hero_b { + for (vc, vb) in &villain_b { + if disjoint(hc, vc) { + chance[hb * n + vb] += 1.0; + } + } + } + let total: f64 = chance.iter().sum(); + if total <= 0.0 { + return None; + } + chance.iter_mut().for_each(|x| *x /= total); + + let (leaf_check, leaf_bet) = river_leaves(spot, &hero_b, &villain_b, n, p, s)?; + let tree = tree_with_leaf(n, chance, p, leaf_check, leaf_bet); + let solved = solve(&tree, TURN_SOLVE_ITERS, Rng::seeded(spot.seed)); + Some(TurnGame { tree, solved, ladder }) +} + +/// Solve the heads-up turn subgame from the engine's belief and return hero's equilibrium mix at the +/// node the spot sits on, or `None` when the v1 slice does not apply (the caller keeps the heuristic). +pub fn turn_plan(spot: &Spot, villain_combos: &[Vec]) -> Option { + if spot.street != Street::Turn { + return None; + } + if spot.live_villains().count() != 1 || villain_combos.is_empty() { + return None; + } + let rules = spot.rules(); + let hero_strength = judge(&rules, &spot.hero_cards, &spot.board).ok()?; + + if spot.to_call == 0.0 { + let s = bet_to(spot)?; + let game = build_turn(spot, villain_combos, villain_combos, spot.pot, s)?; + let hb = game.bucket(hero_strength); + let probs = game.solved.strategy.row(0, hb).to_vec(); // [check, bet] + let bet_p = probs.get(1).copied().unwrap_or(0.0); + Some(TurnPlan { + facing: false, + mix: [probs.first().copied().unwrap_or(1.0 - bet_p), bet_p], + bet_to: s, + reason: format!("turn subgame: bucket {hb}/{}, p(bet) {bet_p:.2}", game.ladder.len()), + }) + } else { + // Facing a turn bet: the pre-bet pot is `pot - to_call`, the bet is `to_call`. + let p = spot.pot - spot.to_call; + let s = spot.to_call; + if p <= 0.0 || s <= 0.0 { + return None; + } + let game = build_turn(spot, villain_combos, villain_combos, p, s)?; + let hb = game.bucket(hero_strength); + let row = game.solved.strategy.row(4, hb).to_vec(); // [fold, call] + let call_p = row.get(1).copied().unwrap_or(0.0); + Some(TurnPlan { + facing: true, + mix: [row.first().copied().unwrap_or(1.0 - call_p), call_p], + bet_to: 0.0, + reason: format!("turn subgame: bucket {hb}/{} facing bet, p(call) {call_p:.2}", game.ladder.len()), + }) + } +} + +/// Build the villain belief combos the way `decide::postflop` does (gated reads, enumerated range) +/// and return hero's turn mix — the measurement entry point, faithful to what the live engine would +/// play. `None` when the slice does not apply. +pub fn turn_mix(spot: &Spot) -> Option { + if spot.street != Street::Turn { + return None; + } + let gated = crate::engine::read_gate::gate_reads(spot); + let spot = &gated; + if spot.live_villains().count() != 1 { + return None; + } + let villain = spot.live_villains().next()?; + let rules = spot.rules(); + let filter = crate::engine::range_filter::range_filter( + &crate::exploit::range_model::range_spec(spot, villain), + rules, + spot.variant, + &spot.board, + ); + let dead: Vec = spot.hero_cards.iter().chain(&spot.board).copied().collect(); + let list = crate::engine::range_combos::combos(&rules, &filter, &dead)?; + turn_plan(spot, &list) +} + +/// The belief + trust version of `turn_plan`: solve the turn subgame for GTO, then tilt hero toward +/// best-responding to the **believed** villain (`believed_villain`, reused from the river — the turn +/// tree's `v_bet`/`v_check` nodes carry the same meaning) inside a KL ball of radius λ +/// (`lambda_from_confidence`). A strong read exploits; a weak/absent read collapses to the proven +/// GTO mix (λ → ∞). `None` outside the slice or below the confidence floor. +pub fn turn_exploit_plan(spot: &Spot, villain_combos: &[Vec], profile: Option<&Profile>) -> Option { + if spot.street != Street::Turn { + return None; + } + if spot.live_villains().count() != 1 || villain_combos.is_empty() { + return None; + } + if profile.and_then(|p| p.confidence).filter(|c| !c.is_nan()).unwrap_or(0.0) < CONFIDENCE_FLOOR { + return None; + } + let rules = spot.rules(); + let hero_strength = judge(&rules, &spot.hero_cards, &spot.board).ok()?; + + let (p, s, facing) = if spot.to_call == 0.0 { + (spot.pot, bet_to(spot)?, false) + } else { + let p = spot.pot - spot.to_call; + if p <= 0.0 || spot.to_call <= 0.0 { + return None; + } + (p, spot.to_call, true) + }; + + let game = build_turn(spot, villain_combos, villain_combos, p, s)?; + let n = game.ladder.len(); + let opponent = believed_villain(&game.tree, n, profile, p, s, profile.and_then(|pr| pr.turn_aggression.or(pr.aggression))); + let lambda = lambda_from_confidence(profile.and_then(|p| p.confidence), p); + let tilted = kl_best_response(&game.tree, &opponent, &game.solved.strategy, 0, lambda); + let hb = game.bucket(hero_strength); + + let node = if facing { 4 } else { 0 }; + let row = tilted.row(node, hb).to_vec(); + let forward = row.get(1).copied().unwrap_or(0.0); + Some(TurnPlan { + facing, + mix: [row.first().copied().unwrap_or(1.0 - forward), forward], + bet_to: if facing { 0.0 } else { s }, + reason: format!( + "turn gearbox: bucket {hb}/{n}{}, λ {:.2}, p(fwd) {forward:.2}", + if facing { " facing bet" } else { "" }, + lambda + ), + }) +} + +/// Live entry for the turn belief + trust gearbox: source the villain belief from the **raw** read and +/// hand the solver the opponent's real `Profile`. Like the river gearbox, the KL trust radius is its +/// own safety, so it reads the true opponent and the confidence floor keeps it off thin reads. +pub fn turn_exploit_mix(spot: &Spot) -> Option { + if spot.street != Street::Turn { + return None; + } + if spot.live_villains().count() != 1 { + return None; + } + let villain = spot.live_villains().next()?; + let profile = villain.profile.as_ref(); + let rules = spot.rules(); + let filter = crate::engine::range_filter::range_filter( + &crate::exploit::range_model::range_spec(spot, villain), + rules, + spot.variant, + &spot.board, + ); + let dead: Vec = spot.hero_cards.iter().chain(&spot.board).copied().collect(); + let list = crate::engine::range_combos::combos(&rules, &filter, &dead)?; + turn_exploit_plan(spot, &list, profile) +} + +/// Defensive turn veto: on a confident read that the villain UNDER-bluffs its turn bet, fold a heuristic +/// CALL the belief+trust gearbox would not make — the turn analogue of `river_subgame::fold_veto`. It +/// only ever turns a call into a fold facing a bet, never touches a bet/check/raise, and stands down on +/// a thin read or off the heads-up turn slice. The caller gates it to cash (no ICM premium). Builds the +/// (expensive) subgame only when the base is already a Call and the read clears the confidence floor. +pub fn turn_fold_veto(spot: &Spot, base: Decision) -> Decision { + if !veto_enabled() { + return base; + } + if base.choice != Choice::Call { + return base; + } + let Some(plan) = turn_exploit_mix(spot) else { + return base; + }; + if !plan.facing || plan.mix[1] >= VETO_CALL_FLOOR { + return base; + } + Decision { + choice: Choice::Fold, + reason: format!("defensive turn veto: {} (heuristic would call)", plan.reason), + ..base + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::game::{ActionKind, Villain}; + use crate::variant::Variant; + + /// A heads-up turn spot where hero is first to act into `pot` with check or a two-thirds bet. + fn turn_to_act(board: &[Card], hero: &str, pot: f64) -> Spot { + Spot { + variant: Variant::Nlhe, + big_blind: 1.0, + seats: 2, + hero_seat: 1, + button_seat: Some(1), + hero_cards: Card::parse_list(hero).unwrap(), + board: board.to_vec(), + street: Street::Turn, + pot, + to_call: 0.0, + hero_stack: pot * 4.0, + min_raise_to: Some(pot * 0.66), + max_raise_to: Some(pot * 4.0), + legal: vec![ActionKind::Check, ActionKind::Raise], + allowed_sizes: Some(vec![pot * 0.66]), + villains: vec![Villain { seat: 2, stack: pot * 4.0, folded: false, profile: None }], + seed: 0x5EED_B17E, + history: Vec::new(), + } + } + + fn sample_villain() -> Vec> { + ["Ad Jc", "Qh Qd", "Jd Jh", "8c 8d", "6h 6d", "5c 4c", "Td 9c", "Kc Qc"] + .iter() + .map(|c| Card::parse_list(c).unwrap()) + .collect() + } + + /// A heads-up turn spot in the slice returns a mix, and a strong made hand leans to betting. + /// Guards the wiring (range → runout leaves → turn solve → readback), not the exact frequency. + #[test] + fn a_made_hand_to_act_gets_a_turn_mix_that_leans_to_bet() { + let board = Card::parse_list("Ah Kd 7c 2s").unwrap(); // turn: 4 cards + let villain = sample_villain(); + let spot = turn_to_act(&board, "Ac As", 6.0); // top set on this board + let plan = turn_plan(&spot, &villain).expect("heads-up turn to-act is in slice"); + assert!(!plan.facing); + assert!(plan.bet_to > 0.0); + assert!(plan.forward() > 0.5, "a strong made hand should lean to betting, got p(bet) {:.2}", plan.forward()); + } + + /// Off the turn (river) the slice declines, so the caller keeps the heuristic. + #[test] + fn the_slice_declines_off_the_turn() { + let river = Card::parse_list("Ah Kd 7c 2s 9h").unwrap(); // 5 cards = river + let mut spot = turn_to_act(&river[..4], "Ac As", 6.0); + spot.board = river; + spot.street = Street::River; + assert!(turn_plan(&spot, &sample_villain()).is_none(), "river is not the turn slice"); + } + + // --- belief + trust gearbox (L4) --- + + fn prof(fold_to_bet: f64, aggression: f64, confidence: f64) -> Profile { + Profile { + fold_to_bet: Some(fold_to_bet), + aggression: Some(aggression), + confidence: Some(confidence), + ..Default::default() + } + } + + fn turn_to_act_vs(board: &[Card], hero: &str, pot: f64, profile: Option) -> Spot { + Spot { villains: vec![Villain { seat: 2, stack: pot * 4.0, folded: false, profile }], ..turn_to_act(board, hero, pot) } + } + + fn turn_vs_bet(board: &[Card], hero: &str, pot: f64, bet: f64, profile: Option) -> Spot { + Spot { + variant: Variant::Nlhe, + big_blind: 1.0, + seats: 2, + hero_seat: 1, + button_seat: Some(1), + hero_cards: Card::parse_list(hero).unwrap(), + board: board.to_vec(), + street: Street::Turn, + pot: pot + bet, + to_call: bet, + hero_stack: pot * 4.0, + min_raise_to: None, + max_raise_to: None, + legal: vec![ActionKind::Fold, ActionKind::Call], + allowed_sizes: None, + villains: vec![Villain { seat: 2, stack: pot * 4.0, folded: false, profile }], + seed: 0x5EED_B17E, + history: Vec::new(), + } + } + + /// Below the confidence floor the turn gearbox stands down (`None`), so the heuristic keeps the edge. + #[test] + fn the_turn_gearbox_stands_down_below_the_confidence_floor() { + let board = Card::parse_list("Ah Kd 7c 2s").unwrap(); + let villain = sample_villain(); + let thin = turn_to_act_vs(&board, "Ac As", 6.0, Some(prof(0.2, 0.3, 0.10))); + assert!( + turn_exploit_plan(&thin, &villain, thin.live_villains().next().unwrap().profile.as_ref()).is_none(), + "confidence 0.10 < floor ⇒ no plan" + ); + let confident = turn_to_act_vs(&board, "Ac As", 6.0, Some(prof(0.2, 0.3, 0.80))); + assert!( + turn_exploit_plan(&confident, &villain, confident.live_villains().next().unwrap().profile.as_ref()).is_some(), + "confidence 0.80 ≥ floor ⇒ a plan" + ); + } + + /// A confident calling-station read makes hero value-bet a strong made hand on the turn (exploit, + /// not balance) — the offense direction of the gearbox. + #[test] + fn a_confident_station_read_value_bets_a_strong_turn_hand() { + let board = Card::parse_list("Ah Kd 7c 2s").unwrap(); + let villain = sample_villain(); + let spot = turn_to_act_vs(&board, "Ac As", 6.0, Some(prof(0.08, 0.15, 0.85))); + let plan = turn_exploit_plan(&spot, &villain, spot.live_villains().next().unwrap().profile.as_ref()) + .expect("confident heads-up turn to-act is in slice"); + assert!(!plan.facing); + assert!(plan.forward() > 0.5, "value-bet a strong hand into a station, got p(bet) {:.2}", plan.forward()); + } + + /// The veto never touches hero's offense: a base that is not a call is returned unchanged even + /// though a plan exists (guards against a full-replacement regression, as on the river). + #[test] + fn the_turn_veto_leaves_a_non_call_decision_untouched() { + let board = Card::parse_list("Ah Kd 7c 2s").unwrap(); + let spot = turn_vs_bet(&board, "Qc Qd", 6.0, 6.0, Some(prof(0.30, 0.06, 0.85))); + let check = Decision::new(Choice::Check, 0.7, "heuristic check"); + assert_eq!(turn_fold_veto(&spot, check.clone()), check, "a non-call base is never vetoed"); + } +} diff --git a/src/exploit/adjust.rs b/src/exploit/adjust.rs index d36f4ad3..7d15e737 100644 --- a/src/exploit/adjust.rs +++ b/src/exploit/adjust.rs @@ -1,6 +1,6 @@ use super::fold_equity_scale::{MAX_SCALE, MIN_SCALE}; use super::profile::Profile; -use super::style::classify; +use super::style::{classify, station_trust, Style}; use super::style_shift::shift_for; use super::thresholds::Thresholds; @@ -19,13 +19,19 @@ fn bounded(x: f64, (low, high): (f64, f64)) -> f64 { } /// `base` as seen against one profile; `None` when the profile says nothing. +/// +/// A `CallingStation` shift is scaled by `station_trust`: a misclassified aggressive "station" +/// (loose width but postflop-aggressive — nemesis-2) gets a fraction of the value-bet-thinner shift, +/// not all of it. Every other style, and a genuine station (trust 1.0), is bit-identical to before. fn against(base: Thresholds, profile: &Profile) -> Option { - shift_for(classify(profile)).map(|shift| Thresholds { - call_margin: bounded(base.call_margin + shift.call_margin, CALL_MARGIN), - value_raise: bounded(base.value_raise + shift.value_raise, VALUE_RAISE), + let style = classify(profile); + let c = if style == Style::CallingStation { station_trust(profile) } else { 1.0 }; + shift_for(style).map(|shift| Thresholds { + call_margin: bounded(base.call_margin + shift.call_margin * c, CALL_MARGIN), + value_raise: bounded(base.value_raise + shift.value_raise * c, VALUE_RAISE), abstain_band: bounded(base.abstain_band, ABSTAIN_BAND), fold_equity_scale: base.fold_equity_scale.clamp(MIN_SCALE, MAX_SCALE), - range_width_scale: bounded(base.range_width_scale * shift.range_width, RANGE_WIDTH), + range_width_scale: bounded(base.range_width_scale * (1.0 + (shift.range_width - 1.0) * c), RANGE_WIDTH), }) } diff --git a/src/exploit/bluff_share.rs b/src/exploit/bluff_share.rs index 1a2418d4..a1fa9376 100644 --- a/src/exploit/bluff_share.rs +++ b/src/exploit/bluff_share.rs @@ -17,6 +17,12 @@ pub const MAX_BLUFF_SHARE: f64 = 0.6; const AVERAGE_AGGRESSION: f64 = 0.45; const MAX_FACTOR: f64 = 2.0; +/// Populations-Ueber-Bluff-Prior gegen einen UNGELESENEN Gegner: der Micro-Pool c-bettet/barrelt +/// weit ueber GTO-Balance, also bekommt eine unbekannte (auch auf blind gegatete) Range auf +/// Flop/Turn mindestens diesen Bluff-Anteil. River bleibt dem MDF-Boden ueberlassen. +/// Micro-Prior; spaeter stake-skaliert. +const POP_BLUFF_PRIOR: [f64; 4] = [0.0, 0.40, 0.35, 0.0]; // preflop, flop, turn, river + fn street_factor(street: Street) -> f64 { match street { Street::Preflop => 0.0, @@ -45,3 +51,17 @@ pub fn bluff_share(profile: Option<&Profile>, ratio: Option, street: Street let balanced = s / (1.0 + 2.0 * s); (balanced * street_factor(street) * style_factor(profile)).clamp(0.0, MAX_BLUFF_SHARE) } + +/// Lift the population over-bluff prior onto a base bluff share. It applies ONLY to an UNREAD +/// villain (`profile` None - including a read gated to blind) on a FIRST barrel: a sustained +/// multi-street line (`sustained`, the villain already bet/raised an earlier street) is +/// value-weighted even in the micro pool, so it gets no bump. River and preflop carry no prior +/// (the river is the MDF floor's job). Never exceeds `MAX_BLUFF_SHARE`. +pub fn with_pop_prior(profile: Option<&Profile>, street: Street, sustained: bool, base: f64) -> f64 { + let prior = if profile.is_none() && !sustained { + POP_BLUFF_PRIOR[street as usize] + } else { + 0.0 + }; + base.max(prior).min(MAX_BLUFF_SHARE) +} diff --git a/src/exploit/fold_chance.rs b/src/exploit/fold_chance.rs index dbeb8b24..3c523bcd 100644 --- a/src/exploit/fold_chance.rs +++ b/src/exploit/fold_chance.rs @@ -11,7 +11,7 @@ //! (`table_fold::pressure_ratio`). use super::profile::Profile; -use super::style::{classify, Style}; +use super::style::{classify, station_trust, Style}; /// Bet size (pot fraction) at which foldToBet is taken to be measured. pub const REFERENCE_RATIO: f64 = 0.66; @@ -32,13 +32,25 @@ fn style_default(style: Style) -> f64 { } /// The opponent's fold-to-bet at the reference size. +/// +/// A `CallingStation` read is trust-weighted (`station_trust`): a misclassified aggressive "station" +/// (nemesis-2, fold-to-bet 0.56 read, aggr 0.41) only partly trusts its high fold frequency, so hero +/// does not over-barrel into a light-raising range whose multi-street cost the single-street bluff-EV +/// never models. A genuine station (trust 1.0) is bit-identical to the raw read. pub fn fold_base(profile: Option<&Profile>) -> f64 { match profile { None => DEFAULT_FOLD_TO_BET, - Some(p) => match p.fold_to_bet.filter(|f| !f.is_nan()) { - Some(f) => f.clamp(0.0, 1.0), - None => style_default(classify(p)), - }, + Some(p) => { + let raw = match p.fold_to_bet.filter(|f| !f.is_nan()) { + Some(f) => f.clamp(0.0, 1.0), + None => style_default(classify(p)), + }; + if classify(p) == Style::CallingStation { + DEFAULT_FOLD_TO_BET + station_trust(p) * (raw - DEFAULT_FOLD_TO_BET) + } else { + raw + } + } } } diff --git a/src/exploit/mark.rs b/src/exploit/mark.rs index 37d183cf..296e19d1 100644 --- a/src/exploit/mark.rs +++ b/src/exploit/mark.rs @@ -13,6 +13,8 @@ const WEAK_PLAYER: Profile = Profile { pfr: Some(0.10), fold_to_bet: Some(0.25), aggression: Some(0.20), + turn_aggression: None, + river_aggression: None, cbet: None, fold_to_cbet: None, three_bet: None, @@ -21,6 +23,7 @@ const WEAK_PLAYER: Profile = Profile { check_raise: None, wtsd: None, wsd: None, + confidence: None, }; fn prior(mark: &str) -> Option { @@ -38,6 +41,8 @@ pub fn with_mark(measured: Option, mark: &str) -> Option { pfr: known.pfr.or(prior.pfr), fold_to_bet: known.fold_to_bet.or(prior.fold_to_bet), aggression: known.aggression.or(prior.aggression), + turn_aggression: known.turn_aggression.or(prior.turn_aggression), + river_aggression: known.river_aggression.or(prior.river_aggression), cbet: known.cbet.or(prior.cbet), fold_to_cbet: known.fold_to_cbet.or(prior.fold_to_cbet), three_bet: known.three_bet.or(prior.three_bet), @@ -46,5 +51,6 @@ pub fn with_mark(measured: Option, mark: &str) -> Option { check_raise: known.check_raise.or(prior.check_raise), wtsd: known.wtsd.or(prior.wtsd), wsd: known.wsd.or(prior.wsd), + confidence: known.confidence.or(prior.confidence), }) } diff --git a/src/exploit/maxent.rs b/src/exploit/maxent.rs new file mode 100644 index 00000000..7c24494e --- /dev/null +++ b/src/exploit/maxent.rs @@ -0,0 +1,245 @@ +//! Maximum-Entropy-Verteilung (Jaynes): die am wenigsten annehmende Verteilung ueber +//! einen diskreten Traeger (Staerke-Buckets) unter linearen Momentbedingungen +//! Σ p_i·f_k(i) = c_k. Loesung: p_i ∝ exp(Σ_k λ_k·f_k(i)); die λ minimieren das +//! duale, glatte, konvexe g(λ) = ln Z(λ) − λ·c. Newton mit Backtracking, deterministisch. + +const MAX_ITER: usize = 200; +const TOL: f64 = 1e-12; + +/// Ergebnis mit Diagnose. +#[derive(Debug, Clone)] +pub struct MaxEnt { + pub p: Vec, + pub lambda: Vec, + pub iterations: usize, + /// Betrag des Gradienten (max. Momentenabweichung) am Ende. + pub residual: f64, +} + +/// Shannon-Entropie in nats. +pub fn entropy(p: &[f64]) -> f64 { + p.iter().filter(|&&x| x > 0.0).map(|&x| -x * x.ln()).sum() +} + +fn scores(features: &[Vec], lambda: &[f64], n: usize) -> Vec { + (0..n) + .map(|i| features.iter().zip(lambda).map(|(f, l)| l * f[i]).sum()) + .collect() +} + +/// Gibbs-Verteilung zu λ (numerisch stabil, Maximum abgezogen). +fn gibbs(features: &[Vec], lambda: &[f64], n: usize) -> Vec { + let s = scores(features, lambda, n); + let m = s.iter().cloned().fold(f64::NEG_INFINITY, f64::max); + let w: Vec = s.iter().map(|x| (x - m).exp()).collect(); + let z: f64 = w.iter().sum(); + w.into_iter().map(|x| x / z).collect() +} + +/// Duale Zielfunktion ln Z − λ·c (stabil). +fn dual(features: &[Vec], targets: &[f64], lambda: &[f64], n: usize) -> f64 { + let s = scores(features, lambda, n); + let m = s.iter().cloned().fold(f64::NEG_INFINITY, f64::max); + let lz = m + s.iter().map(|x| (x - m).exp()).sum::().ln(); + lz - lambda.iter().zip(targets).map(|(l, c)| l * c).sum::() +} + +/// Loest ein lineares System (Gauss mit Teilpivot); None bei Singularitaet. +fn solve(mut a: Vec>, mut b: Vec) -> Option> { + let k = b.len(); + for c in 0..k { + let piv = (c..k).max_by(|&x, &y| a[x][c].abs().total_cmp(&a[y][c].abs()))?; + if a[piv][c].abs() < 1e-300 { + return None; + } + a.swap(c, piv); + b.swap(c, piv); + for r in c + 1..k { + let f = a[r][c] / a[c][c]; + for j in c..k { + a[r][j] -= f * a[c][j]; + } + b[r] -= f * b[c]; + } + } + let mut x = vec![0.0; k]; + for r in (0..k).rev() { + let s: f64 = (r + 1..k).map(|j| a[r][j] * x[j]).sum(); + x[r] = (b[r] - s) / a[r][r]; + } + Some(x) +} + +/// MaxEnt unter mehreren Momentbedingungen: `features[k][i]` = f_k(i), `targets[k]` = c_k. +/// Ohne Bedingungen: uniform. Ziele muessen im Inneren der konvexen Huelle liegen; +/// sonst bricht Newton nach MAX_ITER ab (siehe `residual`). +pub fn max_entropy_multi(features: &[Vec], targets: &[f64]) -> MaxEnt { + let n = features.first().map_or(0, |f| f.len()); + assert!(features.len() == targets.len() && features.iter().all(|f| f.len() == n)); + let k = features.len(); + let mut lambda = vec![0.0; k]; + let mut it = 0; + let mut res = 0.0; + if n == 0 { + return MaxEnt { p: vec![], lambda, iterations: 0, residual: 0.0 }; + } + while it < MAX_ITER { + let p = gibbs(features, &lambda, n); + let mean: Vec = + features.iter().map(|f| f.iter().zip(&p).map(|(a, b)| a * b).sum()).collect(); + let g: Vec = mean.iter().zip(targets).map(|(m, c)| m - c).collect(); + res = g.iter().fold(0.0, |a: f64, x| a.max(x.abs())); + if res < TOL { + break; + } + // Hesse = Kovarianz der Merkmale unter p (+ kleiner Ridge gegen Singularitaet). + let mut h = vec![vec![0.0; k]; k]; + for a in 0..k { + for b in 0..k { + let e: f64 = (0..n).map(|i| p[i] * features[a][i] * features[b][i]).sum(); + h[a][b] = e - mean[a] * mean[b] + if a == b { 1e-14 } else { 0.0 }; + } + } + let Some(step) = solve(h, g.clone()) else { break }; + // Backtracking auf der dualen Zielfunktion (Armijo). + let f0 = dual(features, targets, &lambda, n); + let slope: f64 = g.iter().zip(&step).map(|(a, b)| a * b).sum(); + let mut t = 1.0; + let mut accepted = false; + for _ in 0..60 { + let cand: Vec = lambda.iter().zip(&step).map(|(l, s)| l - t * s).collect(); + if dual(features, targets, &cand, n) <= f0 - 1e-4 * t * slope { + lambda = cand; + accepted = true; + break; + } + t *= 0.5; + } + it += 1; + if !accepted { + break; // Dual am Rundungsboden; residual meldet die Restabweichung + } + } + let p = gibbs(features, &lambda, n); + let mean: Vec = + features.iter().map(|f| f.iter().zip(&p).map(|(a, b)| a * b).sum()).collect(); + res = mean.iter().zip(targets).fold(res * 0.0, |a, (m, c)| a.max((m - c).abs())); + MaxEnt { p, lambda, iterations: it, residual: res } +} + +/// MaxEnt fuer EINE Mittelwertbedingung Σ p_i·f_i = target. Liegt target (fast) am Rand +/// oder ausserhalb [min f, max f], wird ins Innere geklemmt (1e-9 relativ); die +/// Verteilung ist dann sehr spitz. target == Gleichverteilungsmittel -> uniform. +pub fn max_entropy(support_features: &[f64], target_mean: f64) -> Vec { + let n = support_features.len(); + if n == 0 { + return vec![]; + } + let lo = support_features.iter().cloned().fold(f64::INFINITY, f64::min); + let hi = support_features.iter().cloned().fold(f64::NEG_INFINITY, f64::max); + if hi - lo <= 0.0 { + return vec![1.0 / n as f64; n]; + } + let eps = (hi - lo) * 1e-9; + let c = target_mean.clamp(lo + eps, hi - eps); + max_entropy_multi(&[support_features.to_vec()], &[c]).p +} + +#[cfg(test)] +mod tests { + use super::*; + + fn mean(f: &[f64], p: &[f64]) -> f64 { + f.iter().zip(p).map(|(a, b)| a * b).sum() + } + + fn feats(n: usize) -> Vec { + (0..n).map(|i| i as f64).collect() + } + + #[test] + fn ohne_bedingung_uniform() { + let r = max_entropy_multi(&[], &[]); + assert!(r.p.is_empty()); + let f = feats(10); + // Zielmittel = unbeschraenktes Mittel -> uniform + let p = max_entropy(&f, 4.5); + for x in &p { + assert!((x - 0.1).abs() < 1e-9, "{x}"); + } + assert!((entropy(&p) - 10f64.ln()).abs() < 1e-9); + println!("uniform H={:.6} (ln10={:.6})", entropy(&p), 10f64.ln()); + } + + #[test] + fn mittelwert_und_entropiemaximum() { + let f = feats(10); + for &t in &[2.0, 4.5, 6.5, 8.0] { + let r = max_entropy_multi(&[f.clone()], &[t]); + let p = &r.p; + assert!((p.iter().sum::() - 1.0).abs() < 1e-12); + assert!((mean(&f, p) - t).abs() < 1e-9); + println!( + "target={t} lambda={:.6} iter={} res={:.1e} H={:.6}\n p={:?}", + r.lambda[0], + r.iterations, + r.residual, + entropy(p), + p.iter().map(|x| (x * 1e4).round() / 1e4).collect::>() + ); + // Richtung d ⟂ 1 und ⟂ f (erhaelt die Bedingungen); Entropie muss in beide Richtungen fallen. + let n = f.len() as f64; + let q: Vec = f.iter().map(|x| x * x).collect(); + let (mf, mq) = (f.iter().sum::() / n, q.iter().sum::() / n); + let fc: Vec = f.iter().map(|x| x - mf).collect(); + let qc: Vec = q.iter().map(|x| x - mq).collect(); + let a = qc.iter().zip(&fc).map(|(x, y)| x * y).sum::() + / fc.iter().map(|x| x * x).sum::(); + let d: Vec = qc.iter().zip(&fc).map(|(x, y)| x - a * y).collect(); + let h0 = entropy(p); + let pmin = p.iter().cloned().fold(f64::INFINITY, f64::min); + let dmax = d.iter().fold(0.0f64, |a, x| a.max(x.abs())); + for &e in &[0.5, -0.5, 0.1, -0.1] { + // Schritt relativ zum kleinsten p, damit alles positiv bleibt + let pq: Vec = + p.iter().zip(&d).map(|(a, b)| a + e * pmin * b / dmax).collect(); + assert!(pq.iter().all(|&x| x > 0.0)); + assert!((mean(&f, &pq) - t).abs() < 1e-9, "Bedingung erhalten"); + assert!(entropy(&pq) < h0, "Entropie muss sinken (e={e})"); + } + } + } + + #[test] + fn neigung_monoton() { + let f = feats(8); + let hoch = max_entropy(&f, 5.5); + let tief = max_entropy(&f, 1.5); + assert!(hoch.windows(2).all(|w| w[1] > w[0]), "hoch: steigend"); + assert!(tief.windows(2).all(|w| w[1] < w[0]), "tief: fallend"); + assert!(hoch[7] > 1.0 / 8.0 && tief[0] > 1.0 / 8.0); + println!("hoch={:?} H={:.4}", hoch, entropy(&hoch)); + println!("tief={:?} H={:.4}", tief, entropy(&tief)); + // staerkere Neigung -> weniger Entropie + assert!(entropy(&max_entropy(&f, 6.5)) < entropy(&hoch)); + } + + #[test] + fn zwei_bedingungen() { + let f1 = feats(12); + let f2: Vec = f1.iter().map(|x| x * x).collect(); + let (c1, c2) = (7.0, 60.0); + let r = max_entropy_multi(&[f1.clone(), f2.clone()], &[c1, c2]); + assert!((mean(&f1, &r.p) - c1).abs() < 1e-9); + assert!((mean(&f2, &r.p) - c2).abs() < 1e-9); + println!("2 Bed.: iter={} H={:.6}", r.iterations, entropy(&r.p)); + } + + #[test] + fn rand_und_deterministisch() { + let f = feats(6); + let p = max_entropy(&f, 5.0); // Rand -> geklemmt, spitz + assert!(p[5] > 0.99 && (p.iter().sum::() - 1.0).abs() < 1e-9); + assert_eq!(max_entropy(&f, 3.3), max_entropy(&f, 3.3)); + } +} diff --git a/src/exploit/mdf_floor.rs b/src/exploit/mdf_floor.rs new file mode 100644 index 00000000..35995ce1 --- /dev/null +++ b/src/exploit/mdf_floor.rs @@ -0,0 +1,251 @@ +//! Minimum-defence-frequency floor: on the river, a made hand in the top `1 - alpha` of a +//! defensible range is never folded to a bet, whatever the opponent range model says. +//! +//! This is the GTO floor UNDER the exploit deviation. Facing a bet of break-even `alpha` +//! (`to_call / (pot + to_call)`), a defender who folds more than `1 - alpha` of the hands that +//! beat a bluff lets the bettor print with any air (MDF). The engine's villain range model is +//! measured to be too value-heavy (replay benchmark: mean equity bias ~-0.22, river fold-to-bet +//! ~86 %), so equity-against-the-model folds bluff-catchers that MDF says must defend. This floor +//! reads HERO's own made hand - not the (untrusted) villain range - so it can never be moved by a +//! miscalibrated read: it only ever turns a model-driven fold into the call MDF requires. +//! +//! River only: there the bet is terminal and MDF is exact (no draws, no future streets, realisation +//! 1.0). Flop and turn defence couples with realisation and is left to the equity line. + +use crate::exploit::profile::Profile; +use crate::game::{ActionKind, Choice, Decision, Spot, Street}; +use crate::odds::break_even::break_even; +use crate::read::made::Made; + +/// At or above this observed postflop aggression the bettor bets and raises more than a value range +/// supports, so MDF defence of a bluff-catcher is owed. Set BETWEEN a balanced range player's +/// measured aggression and a genuine over-bluffer's: the near-GTO opponents read ~0.35-0.40 +/// (gto Memory 0.35, Oracle 0.40; gto-small lower), a maniac reads ~0.49-0.50 (Memory 0.49, Oracle +/// 0.50). A threshold of 0.45 trips the maniac and spares the balanced player. +const OVER_BLUFF_AGGRESSION: f64 = 0.45; + +/// Fraction of random hands hero's made class beats by showdown - the MDF yardstick (rough, +/// monotone in `Made`). Not an equity: only its order and rough level matter, to place the hand +/// in hero's range (`strength >= alpha` ⇔ top `1 - alpha`). +fn strength(made: Made) -> f64 { + match made { + Made::Air => 0.15, + Made::BoardOnly => 0.18, + Made::Underpair => 0.42, + Made::BottomPair => 0.50, + Made::MiddlePair => 0.60, + Made::TopPairWeakKicker => 0.70, + Made::TopPairGoodKicker => 0.80, + Made::Overpair => 0.85, + Made::TwoPair => 0.90, + Made::Set | Made::Trips => 0.95, + Made::Straight => 0.97, + Made::Flush => 0.98, + Made::FullHouse => 0.99, + Made::Quads => 0.995, + Made::StraightFlush => 1.0, + } +} + +/// A hand with real showdown value: at least a pair, so it beats a pure bluff. `BoardOnly` +/// (hero plays the board, chops at best) and `Air` are not bluff-catchers and are excluded - +/// their MDF defence, if any, is a raise, never a call. +fn beats_bluffs(made: Made) -> bool { + made >= Made::Underpair +} + +/// Positive, directly observed evidence that this bettor OVER-bluffs, so the range model's fold of a +/// bluff-catcher is wrong and MDF defence is owed: an observed postflop aggression frequency above +/// what a value range supports. This is the DIRECT bluff signal — bets and raises per postflop action +/// — not preflop range WIDTH. +/// +/// Why width is excluded: an earlier version also fired on `classify == LooseAggressive`, which keys on +/// vpip ≥ 0.35 ∧ pfr ≥ 0.20 — preflop range width. Heads-up, a correctly balanced opponent plays a wide +/// range (button opens ~80 %, big blind defends ~70 %), so its MEASURED vpip/pfr read loose-aggressive +/// (gto session read vpip 0.70, pfr 0.46) even though its postflop aggression is only ~0.35 and its +/// bets are value-balanced. That width clause force-called the balanced opponent's value bets — the +/// −52 bb/100 over-call BEFUND-gto-ueberdefense first saw under the oracle read, resurfacing under the +/// realistic session read because the oracle vpip was hand-set to a narrow 0.32 but the session read +/// measures the true 0.70 (BEFUND-gto-ueberdefense-read). Range width ≠ bluff frequency; only measured +/// over-aggression earns the defence. The crown equation's trust region, defensive side: only a read +/// that says "this bettor bluffs too much" overrides the model's fold. +fn over_bluffs(profile: &Profile) -> bool { + profile.aggression.is_some_and(|a| a >= OVER_BLUFF_AGGRESSION) +} + +/// Could the bet be bluff-heavy enough that MDF requires defending our bluff-catcher? Only against an +/// unread villain (the unread micro population bluffs) or a positively-identified over-bluffer. A +/// balanced / tight regular's bets are value-weighted, so the floor defers to the range model's fold +/// instead of force-calling - the floor is a response to *measured* over-bluffing, not a blanket +/// riegel against everyone who is not a nit. +fn range_may_bluff(spot: &Spot) -> bool { + let mut live = spot.villains.iter().filter(|v| !v.folded).peekable(); + live.peek().is_none() + || live.any(|v| v.profile.as_ref().is_none_or(over_bluffs)) +} + +/// True when hero must defend `made` against the bet he faces (never fold): on the river, with +/// a bluff-catcher or better, whose strength puts it in the top `1 - alpha` of the range, and the +/// bettor is not a confirmed under-bluffer. +pub fn defends(spot: &Spot, made: Made) -> bool { + spot.street == Street::River + && spot.to_call > 0.0 + && beats_bluffs(made) + && strength(made) >= break_even(spot.pot, spot.to_call) + && range_may_bluff(spot) +} + +/// Overlay the floor on a finished postflop decision: a model-driven river fold of a defensible +/// made hand becomes the call MDF requires. `spot` must carry the UNGATED villain reads - the +/// floor's defensive use of a read (fold more against a confirmed non-bluffer, never fold a +/// bluff-catcher the model mis-prices) is always safe, unlike the range model that `read_gate` +/// keeps blind. The base decision's EV annotations are kept; anything but a floorable river fold +/// is returned unchanged. +pub fn floor(spot: &Spot, made: Made, decision: Decision) -> Decision { + if decision.choice == Choice::Fold && spot.is_legal(ActionKind::Call) && defends(spot, made) { + let be = break_even(spot.pot, spot.to_call); + return Decision::new( + Choice::Call, + 0.5, + format!("MDF-Boden: Made-Hand verteidigt - Modell-Fold uebersteuert (break-even {be:.2})"), + ) + .with_evs(decision.evs); + } + decision +} + +#[cfg(test)] +mod tests { + use super::*; + + fn river(pot: f64, to_call: f64) -> Spot { + Spot { + variant: crate::variant::Variant::Nlhe, + big_blind: 0.1, + seats: 2, + hero_seat: 1, + button_seat: None, + hero_cards: crate::card::Card::parse_list("Kd 7d").unwrap(), + board: crate::card::Card::parse_list("9c Tc Kc Qd 2h").unwrap(), + street: Street::River, + pot, + to_call, + hero_stack: 100.0, + min_raise_to: None, + max_raise_to: None, + legal: vec![], + allowed_sizes: None, + villains: vec![], + seed: 1, + history: Vec::new(), + } + } + + #[test] + fn top_pair_defends_a_half_pot_river_bet() { + // alpha = 0.26 / 0.83 = 0.31; top pair weak kicker strength 0.70 >= 0.31 -> defend + assert!(defends(&river(0.57, 0.26), Made::TopPairWeakKicker)); + } + + #[test] + fn weak_pair_folds_to_an_overbet() { + // alpha = 15 / 25 = 0.60; underpair strength 0.42 < 0.60 -> no floor + assert!(!defends(&river(10.0, 15.0), Made::Underpair)); + } + + #[test] + fn air_is_never_floored() { + assert!(!defends(&river(10.0, 3.0), Made::Air)); + assert!(!defends(&river(10.0, 3.0), Made::BoardOnly)); + } + + #[test] + fn only_on_the_river() { + let flop = Spot { street: Street::Flop, ..river(10.0, 3.0) }; + assert!(!defends(&flop, Made::TopPairGoodKicker)); + } + + #[test] + fn no_floor_without_a_bet() { + assert!(!defends(&river(10.0, 0.0), Made::Overpair)); + } + + fn villain(profile: Option) -> crate::game::Villain { + crate::game::Villain { seat: 1, stack: 100.0, folded: false, profile } + } + + fn prof(aggression: f64, vpip: f64, fold_to_bet: f64) -> Profile { + Profile { + aggression: Some(aggression), + vpip: Some(vpip), + fold_to_bet: Some(fold_to_bet), + ..Profile::default() + } + } + + #[test] + fn an_aggressive_bettor_is_defended() { + // alpha 0.33, middle pair 0.60 >= 0.33, and the maniac bets bluffs -> defend. + let spot = Spot { villains: vec![villain(Some(prof(0.8, 0.55, 0.35)))], ..river(12.0, 6.0) }; + assert!(defends(&spot, Made::MiddlePair)); + } + + #[test] + fn an_unread_bettor_is_defended() { + // No profile: the unread micro population bluffs, so the floor still holds. + let spot = Spot { villains: vec![villain(None)], ..river(12.0, 6.0) }; + assert!(defends(&spot, Made::MiddlePair)); + } + + #[test] + fn a_balanced_regular_is_not_floored() { + // The near-GTO opponent (reads.rs oracle p(0.32, 0.22, 0.42, 0.40)): moderate aggression 0.40 + // < 0.45 -> no over-bluff evidence, so the model's fold is trusted and a bluff-catcher is NOT + // force-called (BEFUND-gto-ueberdefense: this is the −52 bb/100 river-call leak). + let gto = Profile { pfr: Some(0.22), ..prof(0.40, 0.32, 0.42) }; + let spot = Spot { villains: vec![villain(Some(gto))], ..river(12.0, 6.0) }; + assert!(!defends(&spot, Made::MiddlePair)); + } + + #[test] + fn a_wide_but_balanced_headsup_opponent_is_not_floored() { + // The regression this fix buys: the gto's realistic SESSION read, vpip 0.70 / pfr 0.46 / + // aggression 0.35 (measured heads-up, not the hand-set oracle). classify -> LooseAggressive on + // preflop WIDTH alone, which the old `over_bluffs` fired on and force-called into a balanced + // value range (BEFUND-gto-ueberdefense-read). Aggression 0.35 < 0.45 -> no over-bluff evidence, + // so the floor now stays off and trusts the model's fold. + let wide = Profile { pfr: Some(0.46), ..prof(0.35, 0.70, 0.50) }; + use crate::exploit::style::{classify, Style}; + assert_eq!(classify(&wide), Style::LooseAggressive); + let spot = Spot { villains: vec![villain(Some(wide))], ..river(12.0, 6.0) }; + assert!(!defends(&spot, Made::MiddlePair)); + } + + #[test] + fn a_loose_aggressive_bettor_is_still_floored() { + // The maniac (reads.rs oracle p(0.76, 0.42, 0.50, 0.50); session read aggression ~0.49): its + // measured postflop aggression 0.50 >= 0.45 bets far more than a value range supports, so MDF + // defence against its bluffs is owed and the floor holds — on the direct aggression signal, not + // preflop width (which it shares with the balanced wide opponent above). + let maniac = Profile { pfr: Some(0.42), ..prof(0.50, 0.76, 0.50) }; + let spot = Spot { villains: vec![villain(Some(maniac))], ..river(12.0, 6.0) }; + assert!(defends(&spot, Made::MiddlePair)); + } + + #[test] + fn a_confirmed_under_bluffer_is_not_floored() { + // Low observed aggression (0.0) and a nit: no bluffs to catch, the fold stands. + let honest = Spot { villains: vec![villain(Some(prof(0.0, 0.25, 0.5)))], ..river(12.0, 6.0) }; + assert!(!defends(&honest, Made::MiddlePair)); + let nit = Spot { villains: vec![villain(Some(prof(0.15, 0.11, 0.8)))], ..river(12.0, 6.0) }; + assert!(!defends(&nit, Made::MiddlePair)); + } + + #[test] + fn a_folded_under_bluffer_does_not_suppress_the_live_bettor() { + // The nit folded; the live bettor is unread -> still defended. + let nit = crate::game::Villain { folded: true, ..villain(Some(prof(0.15, 0.11, 0.8))) }; + let spot = Spot { villains: vec![nit, villain(None)], ..river(12.0, 6.0) }; + assert!(defends(&spot, Made::MiddlePair)); + } +} diff --git a/src/exploit/mod.rs b/src/exploit/mod.rs index 5c613619..a1066f17 100644 --- a/src/exploit/mod.rs +++ b/src/exploit/mod.rs @@ -10,6 +10,8 @@ pub mod fold_chance; pub mod fold_equity_scale; pub mod made_ladder; pub mod mark; +pub mod mdf_floor; +pub mod posterior; pub mod pot_trace; pub mod preflop_role; pub mod profile; @@ -28,3 +30,5 @@ pub mod style_rung; pub mod style_shift; pub mod table_fold; pub mod thresholds; +pub mod maxent; +pub mod thompson; diff --git a/src/exploit/posterior.rs b/src/exploit/posterior.rs new file mode 100644 index 00000000..17a9b595 --- /dev/null +++ b/src/exploit/posterior.rs @@ -0,0 +1,251 @@ +//! Bayes-Posterior ueber das Gegnerverhalten: Beta-Bernoulli je Parameter, Update pro Beobachtung. +//! Mittel = Punktschaetzung (fuellt `Profile`), Konzentration = Vertrauen (spaeter fuer das KL-lambda). +//! Eigenstaendig, nicht in die Live-Pipeline verdrahtet. + +use super::band_stretch::DEFAULT_PFR; +use super::fold_chance::DEFAULT_FOLD_TO_BET; +use super::profile::Profile; +use super::range_guess::DEFAULT_VPIP; +use crate::game::{ActionRecord, SeenAction, Street}; + +/// Prior-Mittel der Aggressionsfrequenz (postflop Bet/Raise-Anteil). +pub const DEFAULT_AGGRESSION: f64 = 0.35; +/// Pseudo-Beobachtungen des Priors: so viele Haende braucht es, um ihn zu uebersteuern. +pub const PRIOR_STAERKE: f64 = 10.0; +/// Echte Beobachtungen, bei denen das Vertrauen 0.5 erreicht. +pub const VERTRAUEN_HALB: f64 = 30.0; + +/// Ein Parameter: Beta(alpha, beta) ueber eine Frequenz. +#[derive(Clone, Copy, Debug, PartialEq)] +pub struct Beta { + pub alpha: f64, + pub beta: f64, +} + +impl Beta { + /// Prior mit Mittel `mean` und Staerke `strength` (= alpha + beta). + pub fn prior(mean: f64, strength: f64) -> Beta { + Beta { alpha: mean * strength, beta: (1.0 - mean) * strength } + } + pub fn mean(&self) -> f64 { + self.alpha / (self.alpha + self.beta) + } + pub fn variance(&self) -> f64 { + let n = self.alpha + self.beta; + self.alpha * self.beta / (n * n * (n + 1.0)) + } + /// Echte Beobachtungen (Prior abgezogen). + pub fn beobachtet(&self) -> f64 { + (self.alpha + self.beta - PRIOR_STAERKE).max(0.0) + } + /// 0 ohne Daten, -> 1 mit wachsender Datenmenge. + pub fn vertrauen(&self) -> f64 { + let n = self.beobachtet(); + n / (n + VERTRAUEN_HALB) + } + fn sehe(&mut self, erfolg: bool) { + if erfolg { + self.alpha += 1.0; + } else { + self.beta += 1.0; + } + } +} + +/// Eine Beobachtung; `true` = der Gegner hat die Handlung gewaehlt. +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum Beobachtung { + /// Stand vor einer Wette: Fold (true) oder nicht (false). + FoldGegenWette(bool), + /// Hatte postflop die Option: Bet/Raise (true) oder nicht. + Aggression(bool), + /// Preflop freiwillig Geld im Pot (true) oder nicht. + Vpip(bool), + /// Preflop geraist (true) oder nicht. + Pfr(bool), +} + +#[derive(Clone, Copy, Debug, PartialEq)] +pub struct Posterior { + pub fold_to_bet: Beta, + pub aggression: Beta, + pub vpip: Beta, + pub pfr: Beta, +} + +impl Default for Posterior { + fn default() -> Self { + Posterior::new() + } +} + +impl Posterior { + /// Prior = heutige Default-Annahmen; ohne Daten ist `profile()` ~ heutiges Verhalten. + pub fn new() -> Posterior { + Posterior { + fold_to_bet: Beta::prior(DEFAULT_FOLD_TO_BET, PRIOR_STAERKE), + aggression: Beta::prior(DEFAULT_AGGRESSION, PRIOR_STAERKE), + vpip: Beta::prior(DEFAULT_VPIP, PRIOR_STAERKE), + pfr: Beta::prior(DEFAULT_PFR, PRIOR_STAERKE), + } + } + + /// Konjugates Update: Erfolg bumpt alpha, Misserfolg beta. + pub fn update(&mut self, obs: Beobachtung) { + match obs { + Beobachtung::FoldGegenWette(x) => self.fold_to_bet.sehe(x), + Beobachtung::Aggression(x) => self.aggression.sehe(x), + Beobachtung::Vpip(x) => self.vpip.sehe(x), + Beobachtung::Pfr(x) => self.pfr.sehe(x), + } + } + + /// Liest die Handlungen eines Sitzes aus dem Verlauf, in Reihenfolge. + /// Postflop: "steht vor Wette" = ein anderer Sitz hat auf dieser Strasse gewettet/geraist, seit + /// dieser Sitz zuletzt gehandelt hat. Dann zaehlt Fold fuer fold_to_bet, Raise/AllIn fuer Aggression. + /// Preflop zaehlt je Hand nur die erste freiwillige Handlung (Blinds/Ante ausgenommen) fuer vpip/pfr. + /// Gibt die Zahl der verbuchten Beobachtungen zurueck. + pub fn beobachte_verlauf(&mut self, seat: u8, verlauf: &[ActionRecord]) -> usize { + let mut n = 0; + let mut strasse = None; + let mut vor_wette = false; + let mut preflop_gesehen = false; + for r in verlauf { + if strasse != Some(r.street) { + strasse = Some(r.street); + vor_wette = false; + } + let aggressiv = matches!(r.action, SeenAction::Bet | SeenAction::Raise | SeenAction::AllIn); + if r.seat != seat { + if aggressiv { + vor_wette = true; + } + continue; + } + if matches!(r.action, SeenAction::PostSmallBlind | SeenAction::PostBigBlind | SeenAction::PostAnte) { + continue; + } + if r.street == Street::Preflop { + if !preflop_gesehen { + preflop_gesehen = true; + let freiwillig = matches!(r.action, SeenAction::Call) || aggressiv; + self.update(Beobachtung::Vpip(freiwillig)); + self.update(Beobachtung::Pfr(aggressiv)); + n += 2; + } + } else { + if vor_wette { + self.update(Beobachtung::FoldGegenWette(r.action == SeenAction::Fold)); + n += 1; + } + // Check/Fold/Call/Bet/Raise: Option zu wetten bestand (Fold/Call ohne Wette entfaellt). + if vor_wette || matches!(r.action, SeenAction::Check | SeenAction::Bet) { + self.update(Beobachtung::Aggression(aggressiv)); + n += 1; + } + } + vor_wette = false; + } + n + } + + /// Posterior-Mittel als `Profile` (Felder darunter bleiben `None`). + pub fn profile(&self) -> Profile { + Profile { + vpip: Some(self.vpip.mean()), + pfr: Some(self.pfr.mean()), + fold_to_bet: Some(self.fold_to_bet.mean()), + aggression: Some(self.aggression.mean()), + ..Profile::default() + } + } + + /// Gesamtvertrauen in [0, 1): Mittel der Einzelvertrauen (0 ohne Daten). + pub fn confidence(&self) -> f64 { + (self.fold_to_bet.vertrauen() + self.aggression.vertrauen() + self.vpip.vertrauen() + self.pfr.vertrauen()) + / 4.0 + } +} + +#[cfg(test)] +mod tests { + use super::*; + + /// Kleiner deterministischer LCG, kein RNG-Crate. + struct Lcg(u64); + impl Lcg { + fn next(&mut self) -> f64 { + self.0 = self.0.wrapping_mul(6364136223846793005).wrapping_add(1442695040888963407); + (self.0 >> 11) as f64 / (1u64 << 53) as f64 + } + } + + #[test] + fn prior_ohne_daten_ist_der_default() { + let p = Posterior::new(); + let prof = p.profile(); + assert!((prof.vpip.unwrap() - DEFAULT_VPIP).abs() < 1e-12); + assert!((prof.pfr.unwrap() - DEFAULT_PFR).abs() < 1e-12); + assert!((prof.fold_to_bet.unwrap() - DEFAULT_FOLD_TO_BET).abs() < 1e-12); + assert!((prof.aggression.unwrap() - DEFAULT_AGGRESSION).abs() < 1e-12); + assert_eq!(p.confidence(), 0.0); + } + + #[test] + fn konvergiert_gegen_wahren_wert_und_vertrauen_steigt() { + let (wahr_fold, wahr_aggr) = (0.7, 0.2); + let mut rng = Lcg(42); + let mut p = Posterior::new(); + let mut letzte_konf = p.confidence(); + let mut letzte_var = p.fold_to_bet.variance(); + println!("n, fold_mean, aggr_mean, confidence, fold_var"); + for n in 1..=400 { + p.update(Beobachtung::FoldGegenWette(rng.next() < wahr_fold)); + p.update(Beobachtung::Aggression(rng.next() < wahr_aggr)); + let konf = p.confidence(); + if matches!(n, 1 | 5 | 10 | 25 | 50 | 100 | 200 | 400) { + println!( + "{n:4} {:.4} {:.4} {:.4} {:.6}", + p.fold_to_bet.mean(), + p.aggression.mean(), + konf, + p.fold_to_bet.variance() + ); + } + assert!(konf >= letzte_konf, "Vertrauen faellt bei n={n}"); + letzte_konf = konf; + if n % 50 == 0 { + assert!(p.fold_to_bet.variance() < letzte_var, "Varianz sinkt nicht bei n={n}"); + letzte_var = p.fold_to_bet.variance(); + } + if n == 200 { + assert!((p.fold_to_bet.mean() - wahr_fold).abs() < 0.05); + assert!((p.aggression.mean() - wahr_aggr).abs() < 0.05); + } + } + assert!((p.fold_to_bet.mean() - wahr_fold).abs() < 0.05); + assert!(p.confidence() > 0.4); + } + + #[test] + fn verlauf_wird_je_sitz_zugeordnet() { + let r = |street, seat, action| ActionRecord { street, seat, action, amount: None }; + let verlauf = [ + r(Street::Preflop, 0, SeenAction::PostSmallBlind), + r(Street::Preflop, 1, SeenAction::PostBigBlind), + r(Street::Preflop, 0, SeenAction::Raise), + r(Street::Preflop, 1, SeenAction::Call), + r(Street::Flop, 1, SeenAction::Check), + r(Street::Flop, 0, SeenAction::Bet), + r(Street::Flop, 1, SeenAction::Fold), + ]; + let mut p = Posterior::new(); + let n = p.beobachte_verlauf(1, &verlauf); + // vpip+pfr (2), Flop-Check (aggr), Flop-Fold vor Wette (fold + aggr) = 5 + assert_eq!(n, 5); + assert_eq!(p.fold_to_bet.beobachtet(), 1.0); + assert!(p.fold_to_bet.mean() > DEFAULT_FOLD_TO_BET); + assert!(p.vpip.mean() > DEFAULT_VPIP); + assert!(p.pfr.mean() < DEFAULT_PFR); + } +} diff --git a/src/exploit/profile.rs b/src/exploit/profile.rs index c9e8e99c..f009e1f4 100644 --- a/src/exploit/profile.rs +++ b/src/exploit/profile.rs @@ -18,6 +18,15 @@ pub struct Profile { /// Share of the player's postflop actions that are bets or raises (aggression /// frequency). Steers how much of their betting range is a bluff (`bluff_share`). pub aggression: Option, + /// Aggression frequency on the TURN only (bets+raises over the player's turn actions). `None` + /// until the memory/HUD has turn data. The turn gearbox (`engine::turn_subgame`) prefers it over + /// the pooled `aggression`: a player who barrels turns but checks flops reads as a turn bluffer + /// here, so the defensive veto does not fold a good call against them. + pub turn_aggression: Option, + /// Aggression frequency on the RIVER only. `None` until the memory/HUD has river data. The river + /// gearbox (`engine::river_subgame`) prefers it over the pooled `aggression`, since river bluffing + /// tendency differs from flop/turn barreling. + pub river_aggression: Option, /// How often the player continuation-bets the flop as the preflop aggressor. pub cbet: Option, /// How often the player folds to a continuation bet. @@ -35,4 +44,10 @@ pub struct Profile { pub wtsd: Option, /// Won at showdown: how often the player wins once at showdown. pub wsd: Option, + /// Confidence in this read, in `[0, 1)`: 0 without data, rising with the observed postflop + /// sample (half at `sim::memory::CONFIDENCE_HALF` actions). Not a tendency — it says how far the + /// read may be trusted. The river gearbox (`engine::river_subgame`) turns it into the KL trust + /// radius λ: strong read → exploit far, weak read → stay near GTO. `None` = no confidence signal + /// (treated as 0 by the gearbox). No classify/gate rule reads it; it only scales exploitation. + pub confidence: Option, } diff --git a/src/exploit/range_model.rs b/src/exploit/range_model.rs index 9d6809f5..46f73eec 100644 --- a/src/exploit/range_model.rs +++ b/src/exploit/range_model.rs @@ -5,24 +5,48 @@ use super::range_spec::RangeSpec; use super::role_band::role_band; use super::role_from_history::role_of; use super::street_continuation::continuations; +use super::style::{classify, station_trust, Style}; use crate::game::{Spot, Villain}; use crate::preflop::seat_position::seat_position; -/// Without a readable preflop role the band is the plain vpip share. +/// Confidence weight for how much this villain's read may widen the modeled range: `1.0` for every +/// non-station and every genuine station (bit-identical to the binary gate), a fraction for a +/// misclassified aggressive "station" (loose width but postflop-aggressive — the CMA-ES nemesis-2, +/// aggr 0.41 → 0.16). A wide `vpip` read only widens the modeled betting range as far as the read is +/// trusted, so a wide-preflop-but-TIGHT-betting opponent is no longer modeled as an over-weak range +/// the engine then over-calls. See `station_trust` and BEFUND-nemesis-soft-trust. +fn range_trust(villain: &Villain) -> f64 { + match villain.profile.as_ref() { + Some(p) if classify(p) == Style::CallingStation => station_trust(p), + _ => 1.0, + } +} + +/// Pull a read-driven value `x` toward its blind baseline by trust `c`: full read at `c = 1`, pure +/// blind at `c = 0`. +fn toward_blind(blind: f64, x: f64, c: f64) -> f64 { + blind + c * (x - blind) +} + +/// Without a readable preflop role the band is the plain vpip share — trust-blended toward the +/// default (blind) vpip so a low-trust station does not over-widen the band. fn unknown_role_band(villain: &Villain) -> (f64, f64) { let vpip = villain .profile .and_then(|p| p.vpip) .filter(|v| !v.is_nan()) .map_or(DEFAULT_VPIP, |v| v.clamp(0.02, 1.0)); - (0.0, vpip) + (0.0, toward_blind(DEFAULT_VPIP, vpip, range_trust(villain))) } fn preflop_band(spot: &Spot, villain: &Villain) -> (f64, f64) { match role_of(&spot.history, villain.seat) { Some(role) => { let (lo, hi) = role_band(spot, role, seat_position(spot, villain.seat)); - stretched(lo, hi, stretch(role, villain.profile)) + // The read stretches the band by the villain's looseness; blind stretch is 1.0. Trust + // scales how far the band is stretched, so a misread station's wide vpip barely widens it. + let factor = toward_blind(1.0, stretch(role, villain.profile), range_trust(villain)); + stretched(lo, hi, factor) } None => unknown_role_band(villain), } diff --git a/src/exploit/sample.rs b/src/exploit/sample.rs index 79a6cf93..e0b2bc03 100644 --- a/src/exploit/sample.rs +++ b/src/exploit/sample.rs @@ -22,6 +22,10 @@ pub const PRIOR: Profile = Profile { pfr: Some(0.18), fold_to_bet: Some(0.45), aggression: Some(0.35), + // No population prior for per-street aggression: a missing one lets `shrink` pass the measured + // value through unshrunk. + turn_aggression: None, + river_aggression: None, cbet: None, fold_to_cbet: None, three_bet: None, @@ -30,6 +34,7 @@ pub const PRIOR: Profile = Profile { check_raise: None, wtsd: None, wsd: None, + confidence: None, }; /// Weight of the sample in `[0, 1)`. @@ -55,6 +60,8 @@ pub fn shrink(profile: &Profile, hands: f64) -> Profile { pfr: pull(profile.pfr, PRIOR.pfr, w), fold_to_bet: pull(profile.fold_to_bet, PRIOR.fold_to_bet, w), aggression: pull(profile.aggression, PRIOR.aggression, w), + turn_aggression: pull(profile.turn_aggression, PRIOR.turn_aggression, w), + river_aggression: pull(profile.river_aggression, PRIOR.river_aggression, w), cbet: pull(profile.cbet, PRIOR.cbet, w), fold_to_cbet: pull(profile.fold_to_cbet, PRIOR.fold_to_cbet, w), three_bet: pull(profile.three_bet, PRIOR.three_bet, w), @@ -63,5 +70,9 @@ pub fn shrink(profile: &Profile, hands: f64) -> Profile { check_raise: pull(profile.check_raise, PRIOR.check_raise, w), wtsd: pull(profile.wtsd, PRIOR.wtsd, w), wsd: pull(profile.wsd, PRIOR.wsd, w), + // The sample weight IS the read confidence (same half-life): a client profile with a hand + // count earns the gearbox's trust exactly as a session-memory read does. Keep an explicit + // confidence if one was already set. + confidence: profile.confidence.or(Some(w)), } } diff --git a/src/exploit/street_continuation.rs b/src/exploit/street_continuation.rs index f732c3c0..7e26a62e 100644 --- a/src/exploit/street_continuation.rs +++ b/src/exploit/street_continuation.rs @@ -1,5 +1,5 @@ use super::bet_ratio::bet_ratios; -use super::bluff_share::bluff_share; +use super::bluff_share::{bluff_share, with_pop_prior}; use super::made_ladder::rung; use super::range_spec::Continuation; use super::size_notch::size_notch; @@ -78,6 +78,17 @@ fn merge(a: Option, b: Option) -> Option { } } +/// Did the villain already bet or raise on an earlier postflop street? Such a line is a sustained +/// barrel - value-weighted even in the micro pool - so it earns no population over-bluff prior. +fn aggressed_earlier(history: &[ActionRecord], street: Street, seat: u8) -> bool { + history.iter().any(|r| { + r.seat == seat + && r.street != Street::Preflop + && (r.street as usize) < (street as usize) + && r.action.is_aggressive() + }) +} + /// One continuation for the villain on `street`, if their actions there say anything. fn on_street( spot: &Spot, @@ -86,13 +97,15 @@ fn on_street( street: Street, ) -> Option { let slot = street as usize - 1; + let sustained = aggressed_earlier(&spot.history, street, villain.seat); let made_bet = own_aggression(&spot.history, ratios, street, villain.seat).map(|(lvl, ratio)| { let base = [BET_RUNG, RAISE_RUNG][lvl][slot]; + let bluff = bluff_share(villain.profile.as_ref(), ratio, street); ( rung(base, size_notch(ratio) + style_rung(villain)), DRAWS[slot], - bluff_share(villain.profile.as_ref(), ratio, street), + with_pop_prior(villain.profile.as_ref(), street, sustained, bluff), ) }); let made_call = called_big_bet(&spot.history, ratios, street, villain.seat).then(|| { diff --git a/src/exploit/style.rs b/src/exploit/style.rs index ea7b2629..01d5bb76 100644 --- a/src/exploit/style.rs +++ b/src/exploit/style.rs @@ -24,25 +24,47 @@ const NIT_FOLD_TO_BET: f64 = 0.65; const NIT_MAX_VPIP_WITH_FOLDS: f64 = 0.25; const STATION_FOLD_TO_BET: f64 = 0.30; const STATION_MIN_VPIP: f64 = 0.28; +/// A calling station is loose AND postflop-passive. Above this postflop aggression frequency a +/// loose-but-not-raising player is not a station — it only looks loose preflop. Sits between the +/// reg archetype's measured 0.31 and the maniac's ~0.49; the CMA-ES nemesis measures 0.62. See the +/// `an_aggressive_loose_folder_is_not_a_station` regression test and BEFUND-nemesis-station-fehllabel. +const STATION_MAX_AGGRESSION: f64 = 0.45; +/// At or below this postflop aggression a loose-path station is trusted in FULL (`station_trust` +/// 1.0). Between here and `STATION_MAX_AGGRESSION` the station exploit is scaled down linearly — a +/// confidence ramp, not a cliff. Set above the real stations (fish 0.11, oracle 0.02) so they stay +/// bit-identical, and below the reg archetype (0.31) so a misread aggressive "station" (nemesis-2 +/// aggr 0.41 → trust 0.16) barely exploits. See `station_trust` and BEFUND-nemesis-soft-trust. +const STATION_FULL_TRUST_AGGRESSION: f64 = 0.20; /// A frequency in `[0, 1]`; NaN means "not known". fn frequency(x: Option) -> Option { x.filter(|v| !v.is_nan()).map(|v| v.clamp(0.0, 1.0)) } -/// Thresholds (vpip/pfr/foldToBet are all clamped to `[0, 1]` first, NaN counts as missing): +/// Thresholds (vpip/pfr/foldToBet/aggression are all clamped to `[0, 1]` first, NaN counts as missing): /// - all missing: `Unknown` /// - vpip >= 35 % and pfr >= 20 %: `LooseAggressive` -/// - vpip >= 35 % otherwise, or foldToBet <= 30 % with vpip >= 28 % (or unknown): `CallingStation` +/// - (vpip >= 35 % AND aggression < 45 % or unknown), or foldToBet <= 30 % with vpip >= 28 % (or +/// unknown): `CallingStation` /// - vpip <= 15 %, or foldToBet >= 65 % with vpip <= 25 % (or unknown): `Nit` /// - else `Regular` +/// +/// A station is loose AND passive: the `loose` → `CallingStation` path is gated on postflop +/// aggression (`STATION_MAX_AGGRESSION`) so a loose-preflop but aggression-heavy frequent-folder +/// (the CMA-ES nemesis: vpip 0.53, pfr 0.14, foldToBet 0.65, aggression 0.62) reads `Regular` — gated +/// to blind by `read_gate`, the proven-safe baseline — instead of being handed `earned_trust 1.0` +/// and the station exploit it then bled −448 bb/100 to. The `sticky` path (fold ≤ 30 %) is a real +/// non-folder and stays a station regardless of aggression. pub fn classify(profile: &Profile) -> Style { - let (vpip, pfr, fold) = ( + let (vpip, pfr, fold, aggr) = ( frequency(profile.vpip), frequency(profile.pfr), frequency(profile.fold_to_bet), + frequency(profile.aggression), ); let loose = vpip.is_some_and(|v| v >= LOOSE_VPIP); + // Postflop-passive: a station does not fire back. Unknown aggression keeps the old behaviour. + let passive = aggr.is_none_or(|a| a < STATION_MAX_AGGRESSION); let sticky = fold.is_some_and(|b| b <= STATION_FOLD_TO_BET) && vpip.is_none_or(|v| v >= STATION_MIN_VPIP); let tight = vpip.is_some_and(|v| v <= NIT_VPIP) @@ -52,7 +74,7 @@ pub fn classify(profile: &Profile) -> Style { Style::Unknown } else if loose && pfr.is_some_and(|f| f >= AGGRESSIVE_PFR) { Style::LooseAggressive - } else if loose || sticky { + } else if (loose && passive) || sticky { Style::CallingStation } else if tight { Style::Nit @@ -60,3 +82,114 @@ pub fn classify(profile: &Profile) -> Style { Style::Regular } } + +/// How much to trust a `CallingStation` read, in `[0, 1]` — the confidence-weighted generalization +/// of the binary `earned_trust` gate (`engine::read_gate` keeps a station's profile or drops it; this +/// says HOW MUCH of the station exploit to apply to what it keeps). Only meaningful for a profile +/// that already classifies `CallingStation`; the station-exploit channels (`adjust`'s value shift, +/// `style_rung`'s made-floor rung) scale their deviation from blind by this weight. +/// +/// A station earns full trust on either signal: it does not fold (sticky, `fold_to_bet` ≤ 30 %) — +/// value-betting it thin is always right — OR it is postflop-passive (low `aggression`). The +/// aggression ramp governs only the loose-WIDTH path, where a high `vpip` alone made the old binary +/// gate hand full trust to aggressive frequent-folders (the CMA-ES nemesis-2, aggr 0.41, folds 56 %) +/// that then bled to the over-call. Unknown aggression keeps the old full trust (no postflop sample +/// to doubt). A genuine station (fish, oracle) returns exactly `1.0` → bit-identical to the old gate. +pub fn station_trust(profile: &Profile) -> f64 { + // A real non-folder is a station on the strongest signal; aggression does not weaken that. + if frequency(profile.fold_to_bet).is_some_and(|b| b <= STATION_FOLD_TO_BET) { + return 1.0; + } + match frequency(profile.aggression) { + None => 1.0, + Some(a) => ((STATION_MAX_AGGRESSION - a) + / (STATION_MAX_AGGRESSION - STATION_FULL_TRUST_AGGRESSION)) + .clamp(0.0, 1.0), + } +} + +#[cfg(test)] +mod tests { + use super::*; + + fn profile(vpip: f64, pfr: f64, fold: f64, aggr: f64) -> Profile { + Profile { + vpip: Some(vpip), + pfr: Some(pfr), + fold_to_bet: Some(fold), + aggression: Some(aggr), + ..Profile::default() + } + } + + /// The CMA-ES nemesis read: loose preflop (vpip 0.53) but a hyper-aggressive frequent-folder + /// (aggression 0.62, foldToBet 0.65). Width alone made the old `loose` path label it a station, + /// handing it earned_trust and the station exploit it bled −448 bb/100 to. It must read `Regular` + /// (gated to blind), not `CallingStation`. + #[test] + fn an_aggressive_loose_folder_is_not_a_station() { + let p = profile(0.53, 0.14, 0.65, 0.62); + assert_eq!(classify(&p), Style::Regular); + } + + /// A genuinely loose-passive opponent (low aggression) is still a `CallingStation` — the fix + /// gates on aggression, not on preflop width, so the real station is untouched. + #[test] + fn a_loose_passive_opponent_is_still_a_station() { + let p = profile(0.70, 0.05, 0.25, 0.10); + assert_eq!(classify(&p), Style::CallingStation); + } + + /// A sticky non-folder (foldToBet ≤ 30 %) stays a station regardless of aggression — not folding + /// is itself the station signal; the aggression gate applies only to the `loose` path. + #[test] + fn a_sticky_non_folder_stays_a_station_even_if_aggressive() { + let p = profile(0.40, 0.10, 0.20, 0.60); + assert_eq!(classify(&p), Style::CallingStation); + } + + /// Aggression unknown (not yet measured) keeps the old width-based station read, so nothing + /// regresses for profiles without a postflop sample. + #[test] + fn unknown_aggression_keeps_the_width_based_station() { + let p = Profile { vpip: Some(0.50), pfr: Some(0.10), fold_to_bet: Some(0.45), ..Profile::default() }; + assert_eq!(classify(&p), Style::CallingStation); + } + + /// A genuine passive station (fish: aggr 0.11) and a non-folder earn FULL trust — the soft gate + /// is bit-identical to the old binary gate for the stations that were always right to exploit. + #[test] + fn a_passive_station_earns_full_trust() { + let fish = profile(0.55, 0.08, 0.40, 0.11); // loose path (folds 40 %), very passive + assert_eq!(station_trust(&fish), 1.0); + let non_folder = profile(0.40, 0.10, 0.20, 0.60); // sticky: never folds → full trust despite aggression + assert_eq!(station_trust(&non_folder), 1.0); + } + + /// A misclassified aggressive loose "station" (nemesis-2: loose width, folds 56 %, aggr 0.41) + /// earns only a sliver of trust, so the station exploit barely fires on it. + #[test] + fn a_misread_aggressive_station_earns_little_trust() { + let nemesis2 = profile(0.65, 0.15, 0.56, 0.41); + let c = station_trust(&nemesis2); + assert!(c > 0.0 && c < 0.25, "expected a small trust, got {c}"); + } + + /// Trust falls monotonically as the loose-path station gets more aggressive, reaching 0 at the + /// classify boundary — a smooth handoff to `Regular` (gated blind), no cliff. + #[test] + fn loose_station_trust_ramps_down_with_aggression() { + let at = |a: f64| station_trust(&profile(0.55, 0.10, 0.50, a)); + assert_eq!(at(0.20), 1.0); + assert!((at(0.325) - 0.5).abs() < 1e-9); + assert_eq!(at(0.45), 0.0); + assert!(at(0.25) > at(0.35)); + } + + /// Unknown aggression keeps full trust: no postflop sample is no reason to doubt the read. + #[test] + fn unknown_aggression_keeps_full_station_trust() { + let p = Profile { vpip: Some(0.50), pfr: Some(0.10), fold_to_bet: Some(0.45), ..Profile::default() }; + assert_eq!(station_trust(&p), 1.0); + } +} diff --git a/src/exploit/style_rung.rs b/src/exploit/style_rung.rs index 90fb6e22..1d9973b9 100644 --- a/src/exploit/style_rung.rs +++ b/src/exploit/style_rung.rs @@ -1,12 +1,19 @@ -use super::style::{classify, Style}; +use super::style::{classify, station_trust, Style}; use crate::game::Villain; /// How a villain's style moves a made-hand floor on `made_ladder`: looser styles /// (calling station, loose-aggressive) one rung down, the nit one up. +/// +/// The station's `-1` rung (model its bets one rung weaker → bluff-catch wider) is confidence-gated: +/// it fires only for a genuinely passive station (`station_trust` ≥ 0.5). A misclassified aggressive +/// "station" (nemesis-2, aggr 0.41 → trust 0.16) keeps the blind made-floor and is not over-called. +/// A genuine passive station / non-folder (trust 1.0) rounds to `-1`, bit-identical to before. pub fn style_rung(villain: &Villain) -> i32 { - match villain.profile.map(|p| classify(&p)) { - Some(Style::CallingStation | Style::LooseAggressive) => -1, - Some(Style::Nit) => 1, + let Some(profile) = villain.profile.as_ref() else { return 0 }; + match classify(profile) { + Style::CallingStation => -(station_trust(profile).round() as i32), + Style::LooseAggressive => -1, + Style::Nit => 1, _ => 0, } } diff --git a/src/exploit/thompson.rs b/src/exploit/thompson.rs new file mode 100644 index 00000000..aa6959c7 --- /dev/null +++ b/src/exploit/thompson.rs @@ -0,0 +1,227 @@ +//! Thompson-Sampling: jeder Arm haelt ein Beta(a,b) ueber seine Erfolgsquote. +//! Waehlen = je Arm ziehen, Argmax nehmen; danach konjugiert nachziehen. +//! Eine Aktion hat zwei Renditen: Chips und das, was sie verraet (Explorationswert). + +use crate::rng::split_mix::Rng; + +/// Beta-Glaube; Start Beta(1,1) = gleichverteilt. +#[derive(Clone, Copy, Debug, PartialEq)] +pub struct Posterior { + pub alpha: f64, + pub beta: f64, +} + +impl Posterior { + pub const fn uniform() -> Posterior { + Posterior { alpha: 1.0, beta: 1.0 } + } + + pub const fn new(alpha: f64, beta: f64) -> Posterior { + Posterior { alpha, beta } + } + + pub fn mean(&self) -> f64 { + self.alpha / (self.alpha + self.beta) + } + + /// Konjugiertes Update; `reward` in [0,1] (Bernoulli 0/1 oder Bruchteil). + pub fn update(&mut self, reward: f64) { + let r = reward.clamp(0.0, 1.0); + self.alpha += r; + self.beta += 1.0 - r; + } + + /// Eine Ziehung aus Beta(a,b) ueber Gamma-Verhaeltnis. + pub fn sample(&self, rng: &mut Rng) -> f64 { + let x = gamma(self.alpha, rng); + let y = gamma(self.beta, rng); + let s = x + y; + if s > 0.0 { x / s } else { self.mean() } + } +} + +fn unit_open(rng: &mut Rng) -> f64 { + let (u, next) = rng.unit(); + *rng = next; + u.max(f64::MIN_POSITIVE) +} + +fn normal(rng: &mut Rng) -> f64 { + let u1 = unit_open(rng); + let u2 = unit_open(rng); + (-2.0 * u1.ln()).sqrt() * (std::f64::consts::TAU * u2).cos() +} + +/// Gamma(shape, 1) nach Marsaglia-Tsang; shape < 1 per Boost u^(1/shape). +fn gamma(shape: f64, rng: &mut Rng) -> f64 { + if shape < 1.0 { + let g = gamma(shape + 1.0, rng); + return g * unit_open(rng).powf(1.0 / shape); + } + let d = shape - 1.0 / 3.0; + let c = 1.0 / (9.0 * d).sqrt(); + loop { + let x = normal(rng); + let v = 1.0 + c * x; + if v <= 0.0 { + continue; + } + let v = v * v * v; + let u = unit_open(rng); + if u.ln() < 0.5 * x * x + d - d * v + d * v.ln() { + return d * v; + } + } +} + +/// k Arme mit je einem Posterior. +#[derive(Clone, Debug)] +pub struct Bandit { + pub arms: Vec, +} + +impl Bandit { + pub fn new(k: usize) -> Bandit { + Bandit { arms: vec![Posterior::uniform(); k] } + } + + /// Thompson-Zug: je Arm ziehen, Argmax (erster bei Gleichstand). + pub fn choose(&mut self, rng: &mut Rng) -> usize { + let mut best = 0; + let mut best_v = f64::NEG_INFINITY; + for (i, p) in self.arms.iter().enumerate() { + let v = p.sample(rng); + if v > best_v { + best_v = v; + best = i; + } + } + best + } + + pub fn update(&mut self, arm: usize, reward: f64) { + self.arms[arm].update(reward); + } +} + +#[cfg(test)] +mod tests { + use super::*; + + const MEANS: [f64; 3] = [0.3, 0.5, 0.8]; + const T: usize = 2000; + + fn pull(mean: f64, rng: &mut Rng) -> f64 { + let (u, n) = rng.unit(); + *rng = n; + if u < mean { 1.0 } else { 0.0 } + } + + /// (kumulatives Bedauern, Zuege je Arm, Zuege je Arm in der letzten Haelfte) + fn run_thompson(seed: u64) -> (f64, [usize; 3], [usize; 3]) { + let mut rng = Rng::seeded(seed); + let mut b = Bandit::new(3); + let (mut regret, mut n, mut late) = (0.0, [0; 3], [0; 3]); + for t in 0..T { + let a = b.choose(&mut rng); + b.update(a, pull(MEANS[a], &mut rng)); + regret += 0.8 - MEANS[a]; + n[a] += 1; + if t >= T / 2 { + late[a] += 1; + } + } + (regret, n, late) + } + + /// Basislinie: eps-greedy auf Empirie (eps = 0.1), erst jeden Arm einmal. + fn run_eps_greedy(seed: u64, eps: f64) -> (f64, [usize; 3]) { + let mut rng = Rng::seeded(seed); + let (mut regret, mut n, mut sum) = (0.0, [0usize; 3], [0.0f64; 3]); + for t in 0..T { + let (u, nx) = rng.unit(); + rng = nx; + let a = if t < 3 { + t + } else if u < eps { + let (r, nx) = rng.below(3); + rng = nx; + r as usize + } else { + (0..3) + .max_by(|&i, &j| (sum[i] / n[i] as f64).total_cmp(&(sum[j] / n[j] as f64))) + .unwrap() + }; + sum[a] += pull(MEANS[a], &mut rng); + n[a] += 1; + regret += 0.8 - MEANS[a]; + } + (regret, n) + } + + #[test] + fn beta_sampler_matches_moments() { + let mut rng = Rng::seeded(7); + for &(a, b) in &[(1.0, 1.0), (2.0, 5.0), (0.5, 0.5), (30.0, 10.0)] { + let p = Posterior::new(a, b); + let n = 20000; + let xs: Vec = (0..n).map(|_| p.sample(&mut rng)).collect(); + let m = xs.iter().sum::() / n as f64; + let v = xs.iter().map(|x| (x - m) * (x - m)).sum::() / n as f64; + let tv = a * b / ((a + b) * (a + b) * (a + b + 1.0)); + assert!((m - p.mean()).abs() < 0.01, "mean {a},{b}: {m}"); + assert!((v - tv).abs() < 0.1 * tv + 1e-4, "var {a},{b}: {v} vs {tv}"); + assert!(xs.iter().all(|x| (0.0..=1.0).contains(x))); + } + } + + #[test] + fn update_is_conjugate() { + let mut p = Posterior::uniform(); + p.update(1.0); + p.update(0.0); + p.update(1.0); + assert_eq!((p.alpha, p.beta), (3.0, 2.0)); + } + + #[test] + fn deterministic() { + assert_eq!(run_thompson(5), run_thompson(5)); + } + + #[test] + fn thompson_beats_baseline_regret() { + let seeds = 20u64; + let (mut rt, mut re, mut rg) = (0.0, 0.0, 0.0); + let (mut nt, mut ne) = ([0usize; 3], [0usize; 3]); + let mut late = [0usize; 3]; + for s in 0..seeds { + let (r, n, l) = run_thompson(1000 + s); + rt += r; + for i in 0..3 { + nt[i] += n[i]; + late[i] += l[i]; + } + let (r, n) = run_eps_greedy(1000 + s, 0.1); + re += r; + for i in 0..3 { + ne[i] += n[i]; + } + rg += run_eps_greedy(1000 + s, 0.0).0; + } + let k = seeds as f64; + println!("Regret ueber T={T}, Mittel aus {seeds} Seeds:"); + println!(" Thompson {:.1}", rt / k); + println!(" eps-greedy {:.1} (eps=0.1)", re / k); + println!(" greedy {:.1} (eps=0)", rg / k); + println!("Zuege je Arm (Mittel) Thompson {:?}", nt.map(|x| x / seeds as usize)); + println!("Zuege je Arm (Mittel) eps-greedy {:?}", ne.map(|x| x / seeds as usize)); + let half = (T / 2) as f64 * k; + let share = late[2] as f64 / half; + println!("Thompson Anteil bester Arm, 2. Haelfte: {share:.3}"); + assert!(rt < 0.6 * re, "Thompson {rt} vs eps-greedy {re}"); + assert!(rt < rg, "Thompson {rt} vs greedy {rg}"); + assert!(share > 0.9, "konzentriert nicht: {share}"); + assert!(nt[2] > nt[1] && nt[1] > nt[0]); + } +} diff --git a/src/icm/risk.rs b/src/icm/risk.rs index f46d84e7..f23a2538 100644 --- a/src/icm/risk.rs +++ b/src/icm/risk.rs @@ -139,3 +139,41 @@ pub fn jam_width_factor(pressure: f64) -> f64 { let severity = (pressure / MAX_PREMIUM).clamp(0.0, 1.0); 1.0 + JAM_WIDEN_SPAN * severity.powi(JAM_CONVEXITY) } + +/// Effective depth (big blinds) below which the open-jam widening applies in FULL, and above which +/// it fades to nothing. The ICM open-jam widening is a SHORT-stack lever (push/fold territory): a +/// deep hero that merely COVERS a short should not widen its opening range, or it opens junk from +/// depth that gets called and punished. Measured: the `cover-short` LECK (−12.5 ICM$/100 on the +/// strength ladder, `sim::turnier_leiter`), corroborated by the repo's ICM-Nash solver over-jamming +/// at short stacks. The 10bb push/fold calibration (`entscheiden/turnier_benchmark`) sits BELOW +/// `JAM_DEPTH_FULL`, so the gate leaves it bit-untouched; it only quiets the deep coverer. +pub const JAM_DEPTH_FULL: f64 = 12.0; +pub const JAM_DEPTH_NONE: f64 = 22.0; + +/// Taper in `[0, 1]` on the open-jam widening by hero's effective depth: 1 at/below +/// `JAM_DEPTH_FULL`, 0 at/above `JAM_DEPTH_NONE`, linear between. Apply to the EXCESS of +/// `jam_width_factor` over 1 (`1 + (w - 1) * gate`), so a short jammer widens fully and a deep +/// coverer not at all. +pub fn jam_depth_gate(depth_bb: f64) -> f64 { + ((JAM_DEPTH_NONE - depth_bb) / (JAM_DEPTH_NONE - JAM_DEPTH_FULL)).clamp(0.0, 1.0) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn jam_depth_gate_full_when_short_zero_when_deep_and_monotone() { + // Short stack (push/fold territory incl. the 10bb Nash spot): full widening, unchanged. + assert_eq!(jam_depth_gate(5.0), 1.0); + assert_eq!(jam_depth_gate(10.0), 1.0, "the 10bb Nash calibration stays untouched"); + assert_eq!(jam_depth_gate(JAM_DEPTH_FULL), 1.0); + // Deep coverer (the cover-short LECK): no widening. + assert_eq!(jam_depth_gate(JAM_DEPTH_NONE), 0.0); + assert_eq!(jam_depth_gate(40.0), 0.0); + // Linear, monotone non-increasing between. + let mid = jam_depth_gate(17.0); + assert!(mid > 0.0 && mid < 1.0, "tapers in between: {mid}"); + assert!(jam_depth_gate(13.0) >= jam_depth_gate(18.0)); + } +} diff --git a/src/sim/adaptive.rs b/src/sim/adaptive.rs new file mode 100644 index 00000000..cd93c136 --- /dev/null +++ b/src/sim/adaptive.rs @@ -0,0 +1,360 @@ +//! Stufe 3 of the synthetic lab: ADAPTIVE opponents — the mind-game frontier. +//! +//! The static population (`sim::population`, Stufe 0) measures exploitation: the engine infers a +//! *fixed* hidden type and attacks it. But a real opponent is a moving target — they watch the hero +//! and shift. That is where image, sequencing and mind-games live, and the fixed-bot ladder (and even +//! the static population) cannot touch it. +//! +//! Here the opponent carries a running model of the hero (`HeroModel`: the hero's observed postflop +//! aggression) and re-derives its own ruleset every hand (`adapt`), played through the +//! `Opponent::Styled(Rules)` seam built in Stufe 0 — so NO table change is needed, the opponent is +//! just handed a fresh `Rules` each hand. Two reaction styles bracket the realistic human responses to +//! an aggressor: +//! +//! - `Tighten`: gives the aggressor no action — needs a stronger hand to call, bluffs less. A good +//! engine should *increase* its bluffing against this (they fold too much). +//! - `Loosen`: the hero-caller — suspects bluffs and calls down lighter. A good engine should bluff +//! *less* and value-bet thinner against this. +//! +//! The measurement is paired: the SAME drawn opponent and the SAME deals are played once with the +//! opponent `Static` (the Stufe-0 memory baseline) and once `adapt`ing. The per-deal difference, +//! pooled over the field, is the bb/100 the opponent's adaptation costs (or, if negative for the +//! opponent, earns) the engine — i.e. how much the engine's *stationary* read is worth against a +//! *moving* target. A negative delta is the mind-game tax the engine pays for not tracking the shift; +//! a positive delta means the opponent's reaction opens a leak the engine already exploits. + +use super::memory::SessionMemory; +use super::opponent::Opponent; +use super::paired::compare; +use super::population::Population; +use super::reader::Rules; +use super::sequential::ConfSeq; +use super::table::{deal, play_hand_history, HandRead, HandSetup, TableCost}; +use crate::game::Street; +use crate::rng::Rng; +use std::thread; + +const STACK_BB: f64 = 100.0; +const PLAYERS: u8 = 2; + +/// Hands the opponent watches before it starts adapting: an early, noisy read of the hero would +/// swing the ruleset on nothing. Matches the spirit of the engine's own `memory::WARMUP_HANDS`. +const ADAPT_WARMUP: u32 = 20; +/// The hero aggression the base ruleset is tuned for; the opponent reacts to the deviation from it. +const REF_AGGRESSION: f64 = 0.30; +/// How hard the opponent swings its calling threshold per unit of excess hero aggression. +const ADAPT_GAIN: f64 = 0.7; + +/// How a league opponent reacts to the hero it observes. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum Adapt { + /// Ignores the hero entirely — the Stufe-0 behaviour, the paired control (league L0). + Static, + /// L1 reactive: tightens against an aggressive hero on the raw frequency — raises its calling bar, + /// bluffs less ("he's a maniac, give him nothing"). + Tighten, + /// L1 reactive: loosens against an aggressive hero on the raw frequency — calls down lighter to + /// catch bluffs ("he bluffs too much"). + Loosen, + /// L2 modelling: keeps a Beta posterior over the hero's bluff rate and counters only by how much a + /// one-sigma LOWER confidence bound exceeds the reference. Against a balanced or thinly-sampled hero + /// the posterior is wide, the lower bound stays near the reference, and it does not overadjust — + /// the Bayesian answer to L1's twitchiness, and the opponent-side mirror of the engine's own + /// confidence-gated exploitation. + Model, +} + +impl Adapt { + pub fn name(self) -> &'static str { + match self { + Adapt::Static => "static", + Adapt::Tighten => "tighten", + Adapt::Loosen => "loosen", + Adapt::Model => "model", + } + } +} + +/// The opponent's running model of the hero: postflop aggressive vs passive action counts. +#[derive(Clone, Copy, Debug, Default, PartialEq)] +pub struct HeroModel { + aggressive: u32, + passive: u32, +} + +impl HeroModel { + pub fn new() -> Self { + Self::default() + } + + /// Fold the hero's postflop actions of one finished hand into the model. `hero_seat` is 1-based, + /// matching `ActionRecord::seat`. + pub fn observe(&mut self, history: &[crate::game::ActionRecord], hero_seat: u8) { + for r in history.iter().filter(|r| r.seat == hero_seat && r.street != Street::Preflop) { + if r.action.is_aggressive() { + self.aggressive += 1; + } else if matches!(r.action, crate::game::SeenAction::Call | crate::game::SeenAction::Check) + { + self.passive += 1; + } + } + } + + /// Observed postflop aggression frequency, or the neutral reference before any postflop action. + pub fn aggression(&self) -> f64 { + let n = self.aggressive + self.passive; + if n == 0 { + REF_AGGRESSION + } else { + self.aggressive as f64 / n as f64 + } + } + + /// One-sigma LOWER confidence bound on the hero's bluff (aggression) rate under a Beta(1+aggr, + /// 1+passive) posterior: mean − sqrt(variance). Wide (thin or balanced) posteriors pull this toward + /// the prior, so a counter gated on it does not overreact to noise. Used by `Adapt::Model` (L2). + pub fn bluff_lcb(&self) -> f64 { + let a = 1.0 + self.aggressive as f64; + let b = 1.0 + self.passive as f64; + let s = a + b; + let mean = a / s; + let var = a * b / (s * s * (s + 1.0)); + (mean - var.sqrt()).max(0.0) + } + + pub fn actions_seen(&self) -> u32 { + self.aggressive + self.passive + } +} + +/// Re-derive the opponent's ruleset for the next hand from its model of the hero. `Static` and the +/// warmup both return `base` unchanged, so a `Static` run reproduces the Stufe-0 memory baseline +/// exactly. Only *excess* aggression (above the reference) moves the thresholds — a passive hero gets +/// the base ruleset either way. +pub fn adapt(base: Rules, model: &HeroModel, style: Adapt) -> Rules { + if style == Adapt::Static || model.actions_seen() < ADAPT_WARMUP { + return base; + } + let excess = (model.aggression() - REF_AGGRESSION).max(0.0); + let mut r = base; + match style { + Adapt::Static => {} + Adapt::Tighten => { + r.call_margin = (base.call_margin + ADAPT_GAIN * excess).clamp(0.0, 0.6); + r.bluff = (base.bluff - 0.5 * ADAPT_GAIN * excess).clamp(0.0, 1.0); + } + Adapt::Loosen => { + r.call_margin = (base.call_margin - ADAPT_GAIN * excess).clamp(0.0, 0.6); + } + Adapt::Model => { + // Beta(1+aggr, 1+passive) posterior over the hero's bluff rate; counter by the one-sigma + // LOWER bound's excess over the reference, so uncertainty (a wide posterior) yields no + // move and only a confidently-high bluff rate loosens the calling bar. + let lcb_excess = (model.bluff_lcb() - REF_AGGRESSION).max(0.0); + r.call_margin = (base.call_margin - ADAPT_GAIN * lcb_excess).clamp(0.0, 0.6); + } + } + r +} + +fn mix(seed: u64, n: u64) -> u64 { + Rng::seeded(seed ^ n.wrapping_mul(0xD1B5_4A32_D192_ED03)).next_u64().0 +} + +/// Play one heads-up session against ONE drawn opponent, threading the hero's read (`SessionMemory`, +/// the real inference path) and the opponent's model of the hero across every hand, duplicating each +/// deal over both seats so position and card luck cancel within a sample. Returns the per-deal +/// luck-corrected hero result in bb. With `Adapt::Static` this is exactly the Stufe-0 memory run. +pub fn session_samples(base: Rules, deals: u32, seed: u64, style: Adapt) -> Vec { + let mut hero_mem = SessionMemory::new(); + let mut hero_model = HeroModel::new(); + let mut samples = Vec::with_capacity(deals as usize); + for d in 0..deals { + let (cards, _) = deal(PLAYERS as usize, Rng::seeded(mix(seed, d as u64))); + let mut sum = 0.0; + for hero_seat in 1..=PLAYERS { + let rules = adapt(base, &hero_model, style); + let hand = HandSetup { + deal: &cards, + hero_seat, + opponent: Opponent::Styled(rules), + stack_bb: STACK_BB, + // The hero infers the opponent from its own observed actions, same as memory mode. + read: HandRead::Given(hero_mem.read()), + seed: mix(seed ^ 0xA5A5, (d as u64) << 8 | hero_seat as u64), + }; + let (r, history) = play_hand_history(&hand, TableCost::FREE); + sum += r.hero_net - r.luck; + hero_mem.observe_hand(&history, hero_seat as usize - 1, PLAYERS as usize); + hero_model.observe(&history, hero_seat); + } + samples.push(sum / PLAYERS as f64); + } + samples +} + +#[derive(Clone, Debug)] +pub struct AdaptReport { + pub style: &'static str, + pub opponents: usize, + pub deals_each: u32, + /// Engine win rate against the field with the opponent static (the Stufe-0 memory baseline). + pub static_bb_per_100: f64, + /// Engine win rate against the field with the opponent adapting to the hero. + pub adaptive_bb_per_100: f64, + /// adaptive - static, pooled and paired over the SAME deals (card luck cancels). The mind-game + /// effect on the engine's edge: negative = the engine's stationary read bleeds against the shift. + pub delta_bb_per_100: f64, + /// Paired 95 % half width of the delta (`sim::paired`). + pub ci95: f64, + /// Anytime 95 % half width of the delta (`sim::sequential`) — valid under peeking. + pub anytime_ci95: f64, +} + +struct One { + stat: Vec, + adap: Vec, +} + +fn run_one(pop: &Population, k: usize, deals: u32, seed: u64, style: Adapt) -> One { + let (draw, _) = pop.sample(Rng::seeded(seed ^ (k as u64).wrapping_mul(0x9E37_79B9_7F4A_7C15))); + let base = draw.rules; + let hand_seed = seed ^ (k as u64).wrapping_mul(0xD1B5_4A32_D192_ED03); + One { + stat: session_samples(base, deals, hand_seed, Adapt::Static), + adap: session_samples(base, deals, hand_seed, style), + } +} + +/// Measure how much an `adapt`ing field changes the engine's edge versus the same field held static. +/// Deterministic in `seed`; threaded over opponents. +pub fn adaptive_effect( + pop: &Population, + opponents: usize, + deals: u32, + seed: u64, + style: Adapt, +) -> AdaptReport { + let results: Vec = thread::scope(|scope| { + let handles: Vec<_> = (0..opponents) + .map(|k| scope.spawn(move || run_one(pop, k, deals, seed, style))) + .collect(); + handles.into_iter().map(|h| h.join().expect("an opponent panicked")).collect() + }); + + let mut stat_all = Vec::new(); + let mut adap_all = Vec::new(); + let mut cs = ConfSeq::new(0.05, (opponents as u64 * deals as u64).max(1)); + for one in &results { + for (s, a) in one.stat.iter().zip(&one.adap) { + stat_all.push(*s); + adap_all.push(*a); + cs.push(a - s); + } + } + let cmp = compare(&stat_all, &adap_all).expect("non-empty paired diffs"); + let mean = |v: &[f64]| 100.0 * v.iter().sum::() / v.len().max(1) as f64; + AdaptReport { + style: style.name(), + opponents, + deals_each: deals, + static_bb_per_100: mean(&stat_all), + adaptive_bb_per_100: mean(&adap_all), + delta_bb_per_100: cmp.delta_bb_per_100, + ci95: cmp.ci95, + anytime_ci95: 100.0 * cs.radius(), + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn hero_model_counts_postflop_aggression() { + use crate::game::{ActionRecord, SeenAction}; + let h = |street, seat, action| ActionRecord { street, seat, action, amount: None }; + let history = vec![ + h(Street::Preflop, 1, SeenAction::Raise), // preflop ignored + h(Street::Flop, 1, SeenAction::Bet), // aggressive + h(Street::Turn, 1, SeenAction::Check), // passive + h(Street::River, 1, SeenAction::Bet), // aggressive + h(Street::Flop, 2, SeenAction::Call), // other seat, ignored for hero_seat 1 + ]; + let mut m = HeroModel::new(); + m.observe(&history, 1); + assert_eq!(m.actions_seen(), 3); + assert!((m.aggression() - 2.0 / 3.0).abs() < 1e-9); + } + + #[test] + fn adapt_is_identity_when_static_or_in_warmup() { + let base = crate::sim::reader::Style::Reg.rules(); + let mut model = HeroModel::new(); + model.aggressive = 100; + model.passive = 0; // hyper-aggressive, but... + // static always returns base + assert_eq!(adapt(base, &model, Adapt::Static), base); + // a fresh model is in warmup -> base even under Tighten + let fresh = HeroModel::new(); + assert_eq!(adapt(base, &fresh, Adapt::Tighten), base); + } + + #[test] + fn tighten_raises_the_calling_bar_against_an_aggressor() { + let base = crate::sim::reader::Style::Reg.rules(); + let mut model = HeroModel::new(); + model.aggressive = 80; + model.passive = 20; // 0.8 aggression, well above the 0.30 reference + let t = adapt(base, &model, Adapt::Tighten); + assert!(t.call_margin > base.call_margin, "tighten should fold more"); + assert!(t.bluff <= base.bluff, "tighten should bluff no more"); + let l = adapt(base, &model, Adapt::Loosen); + assert!(l.call_margin < base.call_margin, "loosen should call lighter"); + } + + #[test] + fn a_passive_hero_leaves_the_ruleset_at_base() { + let base = crate::sim::reader::Style::Reg.rules(); + let mut model = HeroModel::new(); + model.aggressive = 5; + model.passive = 95; // below the reference -> no excess -> no change + assert_eq!(adapt(base, &model, Adapt::Tighten), base); + } + + #[test] + fn l2_model_waits_for_confidence_before_it_counters() { + // Same 70 % bluff FREQUENCY, two sample sizes. L1 (Tighten/Loosen) reacts to the frequency + // regardless; L2 (Model) gates on the posterior's lower bound, so the thin sample must not move + // the ruleset while the thick one does. + let base = crate::sim::reader::Style::Reg.rules(); + let mut thin = HeroModel::new(); + thin.aggressive = 21; // past the warmup, but a wide posterior + thin.passive = 9; + let mut thick = HeroModel::new(); + thick.aggressive = 210; // same 0.70 mean, a tight posterior + thick.passive = 90; + assert!((thin.aggression() - thick.aggression()).abs() < 1e-9, "same frequency"); + + // L1 loosens on both (frequency-driven). + assert!(adapt(base, &thin, Adapt::Loosen).call_margin < base.call_margin); + assert!(adapt(base, &thick, Adapt::Loosen).call_margin < base.call_margin); + + // L2 counters harder when confident: the thick sample loosens strictly more than the thin one. + let thin_cm = adapt(base, &thin, Adapt::Model).call_margin; + let thick_cm = adapt(base, &thick, Adapt::Model).call_margin; + assert!(thick_cm < thin_cm, "confident over-bluff must loosen more: thin={thin_cm:.3} thick={thick_cm:.3}"); + assert!(thick_cm < base.call_margin, "confident over-bluff must loosen below base"); + } + + #[test] + fn effect_runs_and_is_finite() { + let pop = Population::micro(); + let r = adaptive_effect(&pop, 4, 25, 0x5EED_0001, Adapt::Tighten); + println!( + "static {:+.1} adaptive {:+.1} delta {:+.2} +-{:.2} (anytime +-{:.2})", + r.static_bb_per_100, r.adaptive_bb_per_100, r.delta_bb_per_100, r.ci95, r.anytime_ci95 + ); + assert!(r.delta_bb_per_100.is_finite() && r.ci95.is_finite()); + } +} diff --git a/src/sim/aivat.rs b/src/sim/aivat.rs new file mode 100644 index 00000000..9ce12f32 --- /dev/null +++ b/src/sim/aivat.rs @@ -0,0 +1,110 @@ +//! AIVAT-artige Varianzreduktion: Kontrollvariate mit BEKANNTEM Erwartungswert (Glueck-Term, +//! z. B. realisierte minus erwartete Equity je Hand). Schaetzer y - beta*(c - mu_c) bleibt +//! erwartungstreu; beta wird per Kreuzanpassung (Faltung) aus den uebrigen Haenden gelernt, +//! damit beta nicht mit der eigenen Hand korreliert (sonst O(1/n)-Verzerrung). +//! Umgesetzt: Kontrollvariate je Hand (Chance-/Showdown-Glueck, Entscheidungs-Baseline). +//! Nicht umgesetzt: volle AIVAT-Korrektur jedes Chance- und Gegnerknotens im Baum. +//! Annahme: c korreliert mit dem Rauschen von y; Reduktion ~ 1 - rho^2. Ohne Korrelation +//! kein Gewinn, aber auch keine Verzerrung. + +const Z95: f64 = 1.96; + +/// (Mittel, 95-%-Halbbreite), beides in den Einheiten der Eingabe. +pub fn raw(y: &[f64]) -> (f64, f64) { + let n = y.len() as f64; + if y.len() < 2 { + return (y.first().copied().unwrap_or(0.0), f64::INFINITY); + } + let m = y.iter().sum::() / n; + let v = y.iter().map(|x| (x - m).powi(2)).sum::() / (n - 1.0); + (m, Z95 * (v / n).sqrt()) +} + +/// Kontrollvariate `c` mit bekanntem Erwartungswert `mu_c`; `folds` >= 2 Kreuzanpassung. +pub fn control_variate(y: &[f64], c: &[f64], mu_c: f64, folds: usize) -> Result<(f64, f64), String> { + let n = y.len(); + if n != c.len() || n < 4 || folds < 2 || folds > n { + return Err(format!("{} Ergebnisse, {} Kontrollwerte, {} Faltungen", n, c.len(), folds)); + } + let mut adj = Vec::with_capacity(n); + for k in 0..folds { + let (mut sy, mut sc, mut syc, mut scc, mut m) = (0.0, 0.0, 0.0, 0.0, 0.0); + for i in (0..n).filter(|i| i % folds != k) { + sy += y[i]; + sc += c[i]; + syc += y[i] * c[i]; + scc += c[i] * c[i]; + m += 1.0; + } + let var_c = scc / m - (sc / m).powi(2); + let beta = if var_c > 1e-12 { (syc / m - sy / m * sc / m) / var_c } else { 0.0 }; + adj.extend((0..n).filter(|i| i % folds == k).map(|i| y[i] - beta * (c[i] - mu_c))); + } + Ok(raw(&adj)) +} + +#[cfg(test)] +mod tests { + use super::*; + + struct Lcg(u64); + impl Lcg { + fn unif(&mut self) -> f64 { + self.0 = self.0.wrapping_mul(6364136223846793005).wrapping_add(1442695040888963407); + ((self.0 >> 11) as f64 + 0.5) / (1u64 << 53) as f64 + } + fn normal(&mut self) -> f64 { + (-2.0 * self.unif().ln()).sqrt() * (6.2831853 * self.unif()).cos() + } + } + + /// Ergebnis = Signal + Glueck (EV-gegen-Realisierung) + Restrauschen; c = Glueck, Mittel 0. + fn daten(n: usize, seed: u64) -> (Vec, Vec) { + let mut r = Lcg(seed); + let (mut y, mut c) = (Vec::new(), Vec::new()); + for _ in 0..n { + let luck = 8.0 * r.normal(); + let rest = 2.0 * r.normal(); + y.push(5.0 + luck + rest); // Signal 5 bb pro Hand + c.push(luck + 0.5 * r.normal()); // verrauschtes, aber korreliertes Glueckmass + } + (y, c) + } + + #[test] + fn kontrollvariate_gleicher_mittelwert_engeres_ci() { + let (y, c) = daten(5000, 42); + let (m0, h0) = raw(&y); + let (m1, h1) = control_variate(&y, &c, 0.0, 10).unwrap(); + println!("roh: mean {:.3} ci95 +-{:.3}", m0, h0); + println!("aivat: mean {:.3} ci95 +-{:.3}", m1, h1); + println!("Varianzfaktor {:.2}x, CI {:.0} % schmaler", (h0 / h1).powi(2), 100.0 * (1.0 - h1 / h0)); + assert!((m1 - m0).abs() < h0, "Mittel verschoben"); + assert!(h1 < 0.7 * h0, "CI nicht >= 30 % schmaler"); + } + + #[test] + fn erwartungstreu_ueber_viele_laeufe() { + // Kleines n, viele Wiederholungen: Mittel der Schaetzer muss das Signal treffen. + let (mut s_raw, mut s_cv, reps) = (0.0, 0.0, 400); + for k in 0..reps { + let (y, c) = daten(40, 1000 + k); + s_raw += raw(&y).0; + s_cv += control_variate(&y, &c, 0.0, 5).unwrap().0; + } + let (a, b) = (s_raw / reps as f64, s_cv / reps as f64); + println!("Signal 5.000 roh {:.3} aivat {:.3}", a, b); + assert!((b - 5.0).abs() < 0.15, "Verzerrung: {}", b); + } + + #[test] + fn unkorreliert_keine_verzerrung_kein_schaden() { + let mut r = Lcg(7); + let y: Vec = (0..3000).map(|_| 1.0 + 5.0 * r.normal()).collect(); + let c: Vec = (0..3000).map(|_| r.normal()).collect(); + let (m0, h0) = raw(&y); + let (m1, h1) = control_variate(&y, &c, 0.0, 10).unwrap(); + println!("unkorreliert roh {:.3}+-{:.3} aivat {:.3}+-{:.3}", m0, h0, m1, h1); + assert!(h1 < 1.05 * h0); + } +} diff --git a/src/sim/benchmark.rs b/src/sim/benchmark.rs index a659e12c..8184d63c 100644 --- a/src/sim/benchmark.rs +++ b/src/sim/benchmark.rs @@ -1,180 +1,221 @@ -//! The benchmark: a fixed set of scenarios, run the same way for every version of the engine, so -//! that two runs can be compared deal by deal (`sim::paired`). The runs in text files; the -//! pure parts are here, the file and clock work in `src/bin/benchmark.rs`. - -use super::opponent::Opponent; -use super::paired::{compare, Comparison, Verdict}; -use super::reader::Style; -use super::session::{deal_samples, Setup}; -use std::thread; - -const SEED: u64 = 0x5EED_0001; -const STACK_BB: f64 = 100.0; -const HEADS_UP_DEALS: u32 = 1000; -const SIX_MAX_DEALS: u32 = 150; - -pub struct Scenario { - pub name: &'static str, - pub setup: Setup, -} - -const fn scenario(name: &'static str, players: u8, opponent: Opponent) -> Scenario { - let deals = if players == 2 { HEADS_UP_DEALS } else { SIX_MAX_DEALS }; - Scenario { name, setup: Setup { players, opponent, deals, stack_bb: STACK_BB, seed: SEED } } -} - -/// Folder and random opponent are left out: the first is saturated at +75, the second's variance -/// would drown the total. `tests/sim_strength.rs` keeps watching both. -pub const SCENARIOS: [Scenario; 10] = [ - scenario("heads-up reg", 2, Opponent::Reader(Style::Reg)), - scenario("heads-up nit", 2, Opponent::Reader(Style::Nit)), - scenario("heads-up maniac", 2, Opponent::Reader(Style::Maniac)), - scenario("heads-up fish", 2, Opponent::Reader(Style::Fish)), - scenario("heads-up calling station", 2, Opponent::CallingStation), - scenario("6-max reg", 6, Opponent::Reader(Style::Reg)), - scenario("6-max nit", 6, Opponent::Reader(Style::Nit)), - scenario("6-max maniac", 6, Opponent::Reader(Style::Maniac)), - scenario("6-max fish", 6, Opponent::Reader(Style::Fish)), - scenario("6-max calling station", 6, Opponent::CallingStation), -]; - -#[derive(Clone, Debug, PartialEq)] -pub struct ScenarioRun { - pub name: String, - pub deals: u32, - pub seed: u64, - pub decisions: u32, - pub abstains: u32, - /// Requests the guard refused: a simulator bug, must stay 0. - pub invalid: u32, - /// Hero's luck-corrected result per deal, bb. - pub samples: Vec, -} - -impl ScenarioRun { - pub fn bb_per_100(&self) -> f64 { - 100.0 * self.samples.iter().sum::() / self.samples.len().max(1) as f64 - } -} - -#[derive(Clone, Debug, PartialEq)] -pub struct Run { - /// Which version this is. - pub label: String, - pub scenarios: Vec, -} - -/// Plays every scenario, one thread each. The result does not depend on the threads. -pub fn run_all(label: &str) -> Run { - let scenarios = thread::scope(|scope| { - let running: Vec<_> = SCENARIOS - .iter() - .map(|s| { - scope.spawn(move || { - let (samples, m) = deal_samples(&s.setup); - ScenarioRun { - name: s.name.to_string(), - deals: s.setup.deals, - seed: s.setup.seed, - decisions: m.decisions, - abstains: m.abstains, - invalid: m.invalid, - samples, - } - }) - }) - .collect(); - running.into_iter().map(|r| r.join().expect("a scenario panicked")).collect() - }); - Run { label: label.to_string(), scenarios } -} - -pub struct Report { - pub scenarios: Vec<(String, Comparison)>, - pub overall: Comparison, - pub invalid: u32, -} - -impl Report { - /// Worse anywhere, even if the total hides it, or a request the guard refused. - pub fn has_regression(&self) -> bool { - self.invalid > 0 - || self.overall.verdict == Verdict::Worse - || self.scenarios.iter().any(|(_, c)| c.verdict == Verdict::Worse) - } -} - -/// The mean of independent scenarios, each counting the same; their variances add. -pub fn overall(comparisons: &[Comparison]) -> Comparison { - let k = comparisons.len().max(1) as f64; - let delta = comparisons.iter().map(|c| c.delta_bb_per_100).sum::() / k; - let ci95 = comparisons.iter().map(|c| c.ci95.powi(2)).sum::().sqrt() / k; - let identical = comparisons.iter().all(|c| c.verdict == Verdict::Identical); - Comparison { - delta_bb_per_100: delta, - ci95, - changed_deals: comparisons.iter().map(|c| c.changed_deals).sum(), - verdict: if identical { Verdict::Identical } else { Verdict::of(delta, ci95) }, - } -} - -/// Compares two runs. Runs under other conditions say nothing about the engine: refused. -pub fn verdict_of_run(base: &Run, new: &Run) -> Result { - if base.scenarios.len() != new.scenarios.len() { - return Err(format!("{} gegen {} Szenarien: Basislinie neu messen", base.scenarios.len(), new.scenarios.len())); - } - let mut scenarios = Vec::with_capacity(base.scenarios.len()); - for (b, n) in base.scenarios.iter().zip(&new.scenarios) { - if b.name != n.name || b.deals != n.deals || b.seed != n.seed { - return Err(format!("andere Bedingungen: „{}“ gegen „{}“: Basislinie neu messen", b.name, n.name)); - } - scenarios.push((b.name.clone(), compare(&b.samples, &n.samples)?)); - } - let all: Vec = scenarios.iter().map(|(_, c)| *c).collect(); - Ok(Report { overall: overall(&all), invalid: new.scenarios.iter().map(|s| s.invalid).sum(), scenarios }) -} - -/// The run as text. Floats are written so that they read back bit for bit. -pub fn render(run: &Run) -> String { - let mut text = format!("label {}\n", run.label); - for s in &run.scenarios { - let samples: Vec = s.samples.iter().map(f64::to_string).collect(); - text += &format!( - "scenario {}\ndeals {}\nseed {}\ncounts {} {} {}\nsamples {}\n", - s.name, s.deals, s.seed, s.decisions, s.abstains, s.invalid, samples.join(" ") - ); - } - text -} - -fn field<'a>(lines: &mut std::str::Lines<'a>, key: &str) -> Result<&'a str, String> { - let line = lines.next().ok_or_else(|| format!("„{key}“ fehlt"))?; - line.strip_prefix(key) - .and_then(|rest| rest.strip_prefix(' ')) - .ok_or_else(|| format!("„{key}“ erwartet, „{line}“ gelesen")) -} - -fn number(text: &str) -> Result { - text.parse().map_err(|_| format!("keine Zahl: „{text}“")) -} - -pub fn parse(text: &str) -> Result { - let mut lines = text.lines(); - let label = field(&mut lines, "label")?.to_string(); - let mut scenarios = Vec::new(); - while lines.clone().next().is_some() { - let name = field(&mut lines, "scenario")?.to_string(); - let deals: u32 = number(field(&mut lines, "deals")?)?; - let seed: u64 = number(field(&mut lines, "seed")?)?; - let counts = field(&mut lines, "counts")?.split(' ').map(number).collect::, _>>()?; - let [decisions, abstains, invalid] = counts[..] else { - return Err(format!("„counts“ von „{name}“ hat {} Werte", counts.len())); - }; - let samples = field(&mut lines, "samples")?.split(' ').map(number).collect::, _>>()?; - if samples.len() != deals as usize { - return Err(format!("„{name}“: {deals} Austeilungen, {} Werte", samples.len())); - } - scenarios.push(ScenarioRun { name, deals, seed, decisions, abstains, invalid, samples }); - } - Ok(Run { label, scenarios }) -} +//! The benchmark: a fixed set of scenarios, run the same way for every version of the engine, so +//! that two runs can be compared deal by deal (`sim::paired`). The runs in text files; the +//! pure parts are here, the file and clock work in `src/bin/benchmark.rs`. + +use super::opponent::Opponent; +use super::paired::{compare, Comparison, Verdict}; +use super::reader::Style; +use super::session::{deal_samples, ReadMode, Setup}; +use std::thread; + +const SEED: u64 = 0x5EED_0001; +const STACK_BB: f64 = 100.0; +const HEADS_UP_DEALS: u32 = 1000; +const SIX_MAX_DEALS: u32 = 150; +/// The balanced opponents (gto, gto-small) run more deals: their leaks are small and concentrated in +/// a few high-variance river pots, so the paired interval must be narrow enough to prove a defensive +/// fix worth a handful of bb/100 (BEFUND-gto-restleck-river-overcall). +const BALANCED_DEALS: u32 = 3000; + +pub struct Scenario { + pub name: &'static str, + pub setup: Setup, +} + +const fn with_read(name: &'static str, players: u8, opponent: Opponent, read: ReadMode) -> Scenario { + let deals = if players == 2 { HEADS_UP_DEALS } else { SIX_MAX_DEALS }; + Scenario { name, setup: Setup { players, opponent, deals, stack_bb: STACK_BB, seed: SEED, read } } +} + +/// Read-given: the engine sees the opponent's converged HUD read (the exploit brain). +const fn scenario(name: &'static str, players: u8, opponent: Opponent) -> Scenario { + with_read(name, players, opponent, ReadMode::Oracle) +} + +/// A heads-up balanced opponent (gto family) at the higher `BALANCED_DEALS` count, in any read mode. +const fn balanced(name: &'static str, opponent: Opponent, read: ReadMode) -> Scenario { + Scenario { name, setup: Setup { players: 2, opponent, deals: BALANCED_DEALS, stack_bb: STACK_BB, seed: SEED, read } } +} + +/// Blind: the read is withheld, the no-read baseline a memory / probe must improve on. The gap to +/// the matching read-given scenario is the measured session payoff of a read (`tests/sim_blind`). +const fn blind(name: &'static str, players: u8, opponent: Opponent) -> Scenario { + with_read(name, players, opponent, ReadMode::Blind) +} + +/// Memory: no handed read; the engine builds one from observed actions over the session +/// (`sim::memory`). Lands between the blind and read-given twins - the share of the prize that +/// observation alone recaptures. +const fn memory(name: &'static str, players: u8, opponent: Opponent) -> Scenario { + with_read(name, players, opponent, ReadMode::Memory) +} + +/// Folder and random opponent are left out: the first is saturated at +75, the second's variance +/// would drown the total. `tests/sim_strength.rs` keeps watching both. +/// +/// The last four are the two opponents the engine can actually exploit today (the calling station +/// and the fish, the classes `exploit::read_gate` lets through), each blind and memory: blind is the +/// no-read baseline, memory is the read built from observation. The ladder thus tracks both the +/// prize of a read and how much of it the session memory earns back. +pub const SCENARIOS: [Scenario; 19] = [ + scenario("heads-up reg", 2, Opponent::Reader(Style::Reg)), + scenario("heads-up nit", 2, Opponent::Reader(Style::Nit)), + scenario("heads-up maniac", 2, Opponent::Reader(Style::Maniac)), + scenario("heads-up fish", 2, Opponent::Reader(Style::Fish)), + scenario("heads-up calling station", 2, Opponent::CallingStation), + balanced("heads-up gto", Opponent::Reader(Style::Gto), ReadMode::Oracle), + balanced("heads-up gto-small", Opponent::Reader(Style::GtoSmall), ReadMode::Oracle), + scenario("6-max reg", 6, Opponent::Reader(Style::Reg)), + scenario("6-max nit", 6, Opponent::Reader(Style::Nit)), + scenario("6-max maniac", 6, Opponent::Reader(Style::Maniac)), + scenario("6-max fish", 6, Opponent::Reader(Style::Fish)), + scenario("6-max calling station", 6, Opponent::CallingStation), + scenario("6-max gto", 6, Opponent::Reader(Style::Gto)), + balanced("heads-up gto (blind)", Opponent::Reader(Style::Gto), ReadMode::Blind), + balanced("heads-up gto-small (blind)", Opponent::Reader(Style::GtoSmall), ReadMode::Blind), + blind("heads-up fish (blind)", 2, Opponent::Reader(Style::Fish)), + blind("heads-up calling station (blind)", 2, Opponent::CallingStation), + memory("heads-up fish (memory)", 2, Opponent::Reader(Style::Fish)), + memory("heads-up calling station (memory)", 2, Opponent::CallingStation), +]; + +#[derive(Clone, Debug, PartialEq)] +pub struct ScenarioRun { + pub name: String, + pub deals: u32, + pub seed: u64, + pub decisions: u32, + pub abstains: u32, + /// Requests the guard refused: a simulator bug, must stay 0. + pub invalid: u32, + /// Hero's luck-corrected result per deal, bb. + pub samples: Vec, +} + +impl ScenarioRun { + pub fn bb_per_100(&self) -> f64 { + 100.0 * self.samples.iter().sum::() / self.samples.len().max(1) as f64 + } +} + +#[derive(Clone, Debug, PartialEq)] +pub struct Run { + /// Which version this is. + pub label: String, + pub scenarios: Vec, +} + +/// Plays every scenario, one thread each. The result does not depend on the threads. +pub fn run_all(label: &str) -> Run { + let scenarios = thread::scope(|scope| { + let running: Vec<_> = SCENARIOS + .iter() + .map(|s| { + scope.spawn(move || { + let (samples, m) = deal_samples(&s.setup); + ScenarioRun { + name: s.name.to_string(), + deals: s.setup.deals, + seed: s.setup.seed, + decisions: m.decisions, + abstains: m.abstains, + invalid: m.invalid, + samples, + } + }) + }) + .collect(); + running.into_iter().map(|r| r.join().expect("a scenario panicked")).collect() + }); + Run { label: label.to_string(), scenarios } +} + +pub struct Report { + pub scenarios: Vec<(String, Comparison)>, + pub overall: Comparison, + pub invalid: u32, +} + +impl Report { + /// Worse anywhere, even if the total hides it, or a request the guard refused. + pub fn has_regression(&self) -> bool { + self.invalid > 0 + || self.overall.verdict == Verdict::Worse + || self.scenarios.iter().any(|(_, c)| c.verdict == Verdict::Worse) + } +} + +/// The mean of independent scenarios, each counting the same; their variances add. +pub fn overall(comparisons: &[Comparison]) -> Comparison { + let k = comparisons.len().max(1) as f64; + let delta = comparisons.iter().map(|c| c.delta_bb_per_100).sum::() / k; + let ci95 = comparisons.iter().map(|c| c.ci95.powi(2)).sum::().sqrt() / k; + let identical = comparisons.iter().all(|c| c.verdict == Verdict::Identical); + Comparison { + delta_bb_per_100: delta, + ci95, + changed_deals: comparisons.iter().map(|c| c.changed_deals).sum(), + verdict: if identical { Verdict::Identical } else { Verdict::of(delta, ci95) }, + } +} + +/// Compares two runs. Runs under other conditions say nothing about the engine: refused. +pub fn verdict_of_run(base: &Run, new: &Run) -> Result { + if base.scenarios.len() != new.scenarios.len() { + return Err(format!("{} gegen {} Szenarien: Basislinie neu messen", base.scenarios.len(), new.scenarios.len())); + } + let mut scenarios = Vec::with_capacity(base.scenarios.len()); + for (b, n) in base.scenarios.iter().zip(&new.scenarios) { + if b.name != n.name || b.deals != n.deals || b.seed != n.seed { + return Err(format!("andere Bedingungen: „{}“ gegen „{}“: Basislinie neu messen", b.name, n.name)); + } + scenarios.push((b.name.clone(), compare(&b.samples, &n.samples)?)); + } + let all: Vec = scenarios.iter().map(|(_, c)| *c).collect(); + Ok(Report { overall: overall(&all), invalid: new.scenarios.iter().map(|s| s.invalid).sum(), scenarios }) +} + +/// The run as text. Floats are written so that they read back bit for bit. +pub fn render(run: &Run) -> String { + let mut text = format!("label {}\n", run.label); + for s in &run.scenarios { + let samples: Vec = s.samples.iter().map(f64::to_string).collect(); + text += &format!( + "scenario {}\ndeals {}\nseed {}\ncounts {} {} {}\nsamples {}\n", + s.name, s.deals, s.seed, s.decisions, s.abstains, s.invalid, samples.join(" ") + ); + } + text +} + +fn field<'a>(lines: &mut std::str::Lines<'a>, key: &str) -> Result<&'a str, String> { + let line = lines.next().ok_or_else(|| format!("„{key}“ fehlt"))?; + line.strip_prefix(key) + .and_then(|rest| rest.strip_prefix(' ')) + .ok_or_else(|| format!("„{key}“ erwartet, „{line}“ gelesen")) +} + +fn number(text: &str) -> Result { + text.parse().map_err(|_| format!("keine Zahl: „{text}“")) +} + +pub fn parse(text: &str) -> Result { + let mut lines = text.lines(); + let label = field(&mut lines, "label")?.to_string(); + let mut scenarios = Vec::new(); + while lines.clone().next().is_some() { + let name = field(&mut lines, "scenario")?.to_string(); + let deals: u32 = number(field(&mut lines, "deals")?)?; + let seed: u64 = number(field(&mut lines, "seed")?)?; + let counts = field(&mut lines, "counts")?.split(' ').map(number).collect::, _>>()?; + let [decisions, abstains, invalid] = counts[..] else { + return Err(format!("„counts“ von „{name}“ hat {} Werte", counts.len())); + }; + let samples = field(&mut lines, "samples")?.split(' ').map(number).collect::, _>>()?; + if samples.len() != deals as usize { + return Err(format!("„{name}“: {deals} Austeilungen, {} Werte", samples.len())); + } + scenarios.push(ScenarioRun { name, deals, seed, decisions, abstains, invalid, samples }); + } + Ok(Run { label, scenarios }) +} diff --git a/src/sim/exploit_pop.rs b/src/sim/exploit_pop.rs new file mode 100644 index 00000000..565e4651 --- /dev/null +++ b/src/sim/exploit_pop.rs @@ -0,0 +1,122 @@ +//! Stufe 0 of the synthetic lab: the EXPLOITATION GAP. +//! +//! Draw opponents from a `Population`, play the engine heads-up against each with NO oracle read +//! (`Opponent::Styled` has no authored profile), once blind and once with session memory. In memory +//! mode the engine must INFER the opponent from its observed actions (`sim::memory` → +//! `exploit::posterior`); blind mode is the same engine with nothing to read. The per-deal paired +//! difference `memory - blind`, over the SAME deals (card luck cancels) and pooled over the whole +//! field, is the bb/100 the engine's inference earns against a realistic population. +//! +//! On the fixed-bot ladder this number is structurally hidden: there the engine is handed the +//! converged oracle read (`sim::reads`), so there is nothing to infer and no exploitation to show. +//! Here the oracle is withheld by construction, so the gap is the real exploitation signal. +//! +//! The pooled paired CI reuses `sim::paired::compare`; an anytime CI from `sim::sequential` is +//! reported alongside — the first run of that confidence sequence on real (heavy-tailed) poker +//! samples instead of synthetic Gaussian ones. + +use super::paired::compare; +use super::population::Population; +use super::sequential::ConfSeq; +use super::session::{deal_samples, ReadMode, Setup}; +use crate::rng::Rng; +use std::collections::BTreeMap; +use std::thread; + +const STACK_BB: f64 = 100.0; +const PLAYERS: u8 = 2; + +#[derive(Clone, Debug)] +pub struct GapReport { + pub opponents: usize, + pub deals_each: u32, + /// Engine win rate against the field with no read. + pub blind_bb_per_100: f64, + /// Engine win rate against the field inferring from session memory. + pub memory_bb_per_100: f64, + /// memory - blind, pooled over all (opponent, deal) pairs. + pub gap_bb_per_100: f64, + /// Paired 95 % half width of the gap (`sim::paired`). + pub ci95: f64, + /// Anytime 95 % half width of the gap (`sim::sequential`) — valid under peeking; sanity cross-check. + pub anytime_ci95: f64, + /// Per hidden archetype: mean per-opponent gap and how many opponents. + pub by_label: BTreeMap, +} + +struct One { + label: &'static str, + blind: Vec, + memory: Vec, +} + +fn run_one(pop: &Population, k: usize, deals: u32, seed: u64) -> One { + let (draw, _) = pop.sample(Rng::seeded(seed ^ (k as u64).wrapping_mul(0x9E37_79B9_7F4A_7C15))); + let hand_seed = seed ^ (k as u64).wrapping_mul(0xD1B5_4A32_D192_ED03); + let blind = Setup { + players: PLAYERS, + opponent: draw.opponent(), + deals, + stack_bb: STACK_BB, + seed: hand_seed, + read: ReadMode::Blind, + }; + let memory = Setup { read: ReadMode::Memory, ..blind }; + One { label: draw.label, blind: deal_samples(&blind).0, memory: deal_samples(&memory).0 } +} + +/// Measure the exploitation gap over `opponents` draws, `deals` deals each. Deterministic in `seed`. +pub fn exploitation_gap(pop: &Population, opponents: usize, deals: u32, seed: u64) -> GapReport { + let results: Vec = thread::scope(|scope| { + let handles: Vec<_> = + (0..opponents).map(|k| scope.spawn(move || run_one(pop, k, deals, seed))).collect(); + handles.into_iter().map(|h| h.join().expect("an opponent panicked")).collect() + }); + + let mut blind_all = Vec::new(); + let mut mem_all = Vec::new(); + let mut cs = ConfSeq::new(0.05, (opponents as u64 * deals as u64).max(1)); + let mut by_label: BTreeMap = BTreeMap::new(); + for one in &results { + let g = 100.0 * (one.memory.iter().sum::() - one.blind.iter().sum::()) + / deals.max(1) as f64; + let e = by_label.entry(one.label.to_string()).or_insert((0.0, 0)); + e.0 += g; + e.1 += 1; + for (b, m) in one.blind.iter().zip(&one.memory) { + blind_all.push(*b); + mem_all.push(*m); + cs.push(m - b); + } + } + let cmp = compare(&blind_all, &mem_all).expect("non-empty paired diffs"); + let mean = |v: &[f64]| 100.0 * v.iter().sum::() / v.len().max(1) as f64; + GapReport { + opponents, + deals_each: deals, + blind_bb_per_100: mean(&blind_all), + memory_bb_per_100: mean(&mem_all), + gap_bb_per_100: cmp.delta_bb_per_100, + ci95: cmp.ci95, + anytime_ci95: 100.0 * cs.radius(), + by_label, + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn gap_runs_and_is_finite() { + // Tiny: this exercises the full engine decision path, so keep it small for `cargo test`. + let pop = Population::micro(); + let r = exploitation_gap(&pop, 4, 25, 0x5EED_0001); + println!( + "blind {:+.1} memory {:+.1} gap {:+.2} +-{:.2} (anytime +-{:.2}) by {:?}", + r.blind_bb_per_100, r.memory_bb_per_100, r.gap_bb_per_100, r.ci95, r.anytime_ci95, r.by_label + ); + assert!(r.gap_bb_per_100.is_finite() && r.ci95.is_finite()); + assert_eq!(r.by_label.values().map(|(_, n)| n).sum::(), 4); + } +} diff --git a/src/sim/exploit_river.rs b/src/sim/exploit_river.rs new file mode 100644 index 00000000..c9b6b36c --- /dev/null +++ b/src/sim/exploit_river.rs @@ -0,0 +1,324 @@ +//! Postflop exploitability of the LIVE engine on a heads-up river subgame. +//! +//! The ladder (`sim::benchmark`) measures bb/100 against fixed card-blind bots; it cannot say how far +//! the engine is from a Nash equilibrium, and against near-GTO bots its signal is cooler-dominated +//! (BEFUND-conditioned-fold-barrel, BEFUND-gto-restleck-river-overcall). MODULES.md names the missing +//! measure outright: "Postflop-Exploitability gegen eine Best Response fehlt noch". This module builds +//! it for the river - the one street where the subgame is exact (board complete, showdown exact, no +//! future chance). +//! +//! # What is measured +//! +//! A heads-up river subgame over real cards: a board, hero's range and villain's range as combo lists. +//! Hands are bucketed by their EXACT showdown strength on the board (`hand::showdown::best`), card +//! removal between the two ranges is baked into the joint deal table, and the betting tree is +//! `cfr::river` (hero first, one bet size, no raises). +//! +//! Hero plays the ENGINE's real policy: at each hero node and bucket the engine is queried +//! (`engine::decide`) for a representative hand of that bucket, giving a pure action per bucket. The +//! villain then BEST-RESPONDS to that fixed policy over the true ranges. Hero's exploitability is +//! +//! ```text +//! exploitability = v* - value(hero | villain best-responds to the engine) +//! ``` +//! +//! where `v*` is hero's value at the solved equilibrium of the same subgame. It is `>= 0` and `0` +//! exactly when the engine already plays the river unexploitably. Units: bb per 100 deals (the pot and +//! bet are given in big blinds, `big_blind = 1`). +//! +//! # Approximations (named) +//! +//! - One representative hand per bucket drives the engine query; hands of equal showdown strength but +//! different blockers can in principle play differently, which this collapses. +//! - The betting tree is the `cfr::river` v1 (one bet size, no raises). A richer action abstraction +//! only grows the villain's best-response power, so this is a LOWER bound on exploitability. +//! - The engine models the villain from the spot's profile, not from the tree's true range; that is +//! the point - the best response knows the engine's policy and the true range, the engine plays its +//! own beliefs. + +use crate::card::Card; +use crate::cfr::exploitability::game_value; +use crate::cfr::river::tree_with_chance; +use crate::cfr::solve::solve; +use crate::cfr::strategy::Strategy; +use crate::cfr::tree::Tree; +use crate::cfr::value_walk::{root_values, Responder}; +use crate::engine::decide::decide; +use crate::engine::river_subgame; +use crate::exploit::profile::Profile; +use crate::game::{ActionKind, Choice, Spot, Street, Villain}; +use crate::hand::showdown::best; +use crate::rng::Rng; +use crate::variant::{rules, Variant}; + +/// A heads-up river subgame over real cards. Pot and bet are in big blinds. +pub struct RiverSpec<'a> { + pub board: &'a [Card], + pub hero_range: &'a [Vec], + pub villain_range: &'a [Vec], + /// The profile the engine sees for the villain (its belief); the best response ignores it. + pub villain_profile: Option, + pub pot: f64, + pub bet: f64, +} + +/// The exploitability of the engine's river play on one subgame, all in bb/100. +#[derive(Clone, Copy, Debug, PartialEq)] +pub struct ExploitReport { + pub buckets: usize, + /// Hero's value at the solved equilibrium of the subgame. + pub gto_value: f64, + /// Hero's value when the villain best-responds to the engine's fixed policy. + pub engine_value_vs_br: f64, + /// `gto_value - engine_value_vs_br`, `>= 0`. + pub exploitability: f64, +} + +/// Strength bucket of each combo on the board, 0 = weakest, plus the shared bucket count. Both ranges +/// share one ascending set of distinct showdown strengths, so a higher bucket always wins the showdown. +struct Buckets { + count: usize, + hero_bucket: Vec, + villain_bucket: Vec, +} + +fn bucketize(board: &[Card], hero: &[Vec], villain: &[Vec]) -> Option { + let usage = rules(Variant::Nlhe).hole_usage; + let strength = |combo: &[Card]| best(usage, combo, board).ok(); + let hero_s: Vec<_> = hero.iter().map(|c| strength(c)).collect(); + let villain_s: Vec<_> = villain.iter().map(|c| strength(c)).collect(); + // One ascending ladder of distinct strengths across both ranges. + let mut distinct: Vec<_> = hero_s.iter().chain(&villain_s).filter_map(|s| *s).collect(); + distinct.sort(); + distinct.dedup(); + if distinct.len() < 2 { + return None; + } + let rank = |s: Option<_>| s.and_then(|v| distinct.iter().position(|d| *d == v)); + let hero_bucket: Vec = hero_s.iter().map(|s| rank(*s).unwrap_or(0)).collect(); + let villain_bucket: Vec = villain_s.iter().map(|s| rank(*s).unwrap_or(0)).collect(); + Some(Buckets { count: distinct.len(), hero_bucket, villain_bucket }) +} + +/// Two hole-card hands can be dealt together only if they share no card. +fn disjoint(a: &[Card], b: &[Card]) -> bool { + a.iter().all(|c| !b.contains(c)) +} + +/// The joint deal table `chance[i * n + j] = P(hero bucket i, villain bucket j)`: uniform over every +/// disjoint (hero combo, villain combo) pair, so card removal between the two ranges is exact. +fn joint_chance(spec: &RiverSpec, b: &Buckets) -> Vec { + let n = b.count; + let mut chance = vec![0.0; n * n]; + for (hi, hcombo) in spec.hero_range.iter().enumerate() { + for (vi, vcombo) in spec.villain_range.iter().enumerate() { + if disjoint(hcombo, vcombo) { + chance[b.hero_bucket[hi] * n + b.villain_bucket[vi]] += 1.0; + } + } + } + let total: f64 = chance.iter().sum(); + if total > 0.0 { + chance.iter_mut().for_each(|x| *x /= total); + } + chance +} + +/// First hero combo in each bucket, to drive the engine query. `None` for a bucket hero never holds. +fn hero_reps<'a>(spec: &'a RiverSpec, b: &Buckets) -> Vec> { + let mut reps: Vec> = vec![None; b.count]; + for (i, combo) in spec.hero_range.iter().enumerate() { + let bucket = b.hero_bucket[i]; + if reps[bucket].is_none() { + reps[bucket] = Some(combo); + } + } + reps +} + +/// Build the river spot the engine faces at a hero node: at the root (`facing_bet = false`) hero is +/// first to act into `pot` with check or a bet to `bet`; facing a bet hero calls `bet` into the pot the +/// villain already grew. +fn hero_spot(spec: &RiverSpec, hand: &[Card], facing_bet: bool) -> Spot { + let (pot, to_call, legal, allowed, min_raise, max_raise) = if facing_bet { + (spec.pot + spec.bet, spec.bet, vec![ActionKind::Fold, ActionKind::Call], None, None, None) + } else { + ( + spec.pot, + 0.0, + vec![ActionKind::Check, ActionKind::Raise], + Some(vec![spec.bet]), + Some(spec.bet), + Some(spec.bet.max(spec.pot) * 4.0), + ) + }; + Spot { + variant: Variant::Nlhe, + big_blind: 1.0, + seats: 2, + hero_seat: 1, + button_seat: Some(1), + hero_cards: hand.to_vec(), + board: spec.board.to_vec(), + street: Street::River, + pot, + to_call, + hero_stack: spec.bet.max(spec.pot) * 4.0, + min_raise_to: min_raise, + max_raise_to: max_raise, + legal, + allowed_sizes: allowed, + villains: vec![Villain { seat: 2, stack: spec.pot * 4.0, folded: false, profile: spec.villain_profile }], + seed: 0x5EED_B17E, + history: Vec::new(), + } +} + +/// The engine's action row at a hero node for a bucket's representative hand, as a probability per +/// action: `[check, bet]` at node "hero", `[fold, call]` at "hero_vs_bet". Where the river solver +/// applies (`river_subgame::river_mix`) the engine MIXES, so the row is its equilibrium frequency — +/// the whole point of Stage A, and the only way a balanced strategy can show as unexploitable. Where +/// the solver declines, the heuristic (`decide`) gives a pure row. A bucket hero never holds maps to +/// the passive action, which its zero chance makes irrelevant. +fn engine_row(spec: &RiverSpec, reps: &[Option<&[Card]>], name: &str, bucket: usize) -> Vec { + let facing = match name { + "hero" => false, + "hero_vs_bet" => true, + _ => return vec![1.0, 0.0], + }; + let Some(hand) = reps.get(bucket).copied().flatten() else { return vec![1.0, 0.0] }; + let spot = hero_spot(spec, hand, facing); + if let Some(plan) = river_subgame::river_mix(&spot) { + if plan.facing == facing { + return vec![plan.mix[0], plan.mix[1]]; + } + } + // Solver declined for this node: fall back to the heuristic's pure action. + let aggressive = match facing { + false => matches!(decide(&spot).choice, Choice::Raise { .. }), + true => matches!(decide(&spot).choice, Choice::Call), + }; + if aggressive { + vec![0.0, 1.0] + } else { + vec![1.0, 0.0] + } +} + +/// Hero's exploitability on the subgame: `v* - value(hero | villain best-responds)`, in bb/100. +/// `iterations` solves the equilibrium reference; `seed` seeds the solver (the engine query is +/// deterministic). Returns `None` for a degenerate subgame (fewer than two buckets, empty ranges). +pub fn exploitability_river(spec: &RiverSpec, iterations: u32, seed: u64) -> Option { + let b = bucketize(spec.board, spec.hero_range, spec.villain_range)?; + let chance = joint_chance(spec, &b); + if chance.iter().sum::() <= 0.0 { + return None; + } + let tree = tree_with_chance(b.count, chance, spec.pot, spec.bet); + let reps = hero_reps(spec, &b); + // The engine's real per-bucket river policy as a (possibly mixed) behaviour strategy at both hero + // nodes; every other node keeps the uniform base (villain nodes are best-responded, not read). + let engine = Strategy::uniform(&tree) + .with_rows(&tree, "hero", |bucket| engine_row(spec, &reps, "hero", bucket)) + .and_then(|s| s.with_rows(&tree, "hero_vs_bet", |bucket| engine_row(spec, &reps, "hero_vs_bet", bucket))) + .unwrap_or_else(|_| Strategy::uniform(&tree)); + Some(report(&tree, &engine, iterations, seed, b.count)) +} + +/// Assemble the report from a built tree and a fixed hero strategy (shared by the engine path and the +/// tests). `v*` is the equilibrium value; the villain best-responds to `hero` for the exploited value. +fn report(tree: &Tree, hero: &Strategy, iterations: u32, seed: u64, buckets: usize) -> ExploitReport { + let solved = solve(tree, iterations, Rng::seeded(seed)); + let gto_value = game_value(tree, &solved.strategy); + // Player 1 best-responds while player 0 follows `hero`; the summed value is the villain's, so hero + // gets its negation (zero-sum). Counterfactual values are per deal; x100 for bb/100. + let villain_br: f64 = root_values(tree, hero, Responder::Best, 1, &mut |_| {}).iter().sum(); + let engine_value_vs_br = -villain_br; + ExploitReport { + buckets, + gto_value: gto_value * 100.0, + engine_value_vs_br: engine_value_vs_br * 100.0, + exploitability: (gto_value - engine_value_vs_br) * 100.0, + } +} + +#[cfg(test)] +mod tests { + use super::*; + + const ITERS: u32 = 20_000; + const SEED: u64 = 0x5EED_E0F1; + + /// A polarised river over abstract buckets built by hand (hero: air + nuts, villain: bluff-catcher) + /// — the same shape `cfr::river` proves against textbook GTO. Feeding the SOLVED strategy as hero's + /// own play must report ~0 exploitability: a Nash strategy is unexploitable, so the harness math + /// (v* + villain best response) cancels. This validates the pipeline independent of the engine. + fn polarised_tree() -> Tree { + // buckets: 0 = air, 1 = bluff-catcher, 2 = nuts. chance = independent product of the ranges. + let hero = [0.5, 0.0, 0.5]; + let villain = [0.0, 1.0, 0.0]; + let n = 3; + let mut chance = vec![0.0; n * n]; + let mut total = 0.0; + for i in 0..n { + for j in 0..n { + let w = hero[i] * villain[j]; + chance[i * n + j] = w; + total += w; + } + } + chance.iter_mut().for_each(|x| *x /= total); + tree_with_chance(n, chance, 2.0, 1.0) + } + + #[test] + fn a_nash_strategy_reports_zero_exploitability() { + let tree = polarised_tree(); + let solved = solve(&tree, ITERS, Rng::seeded(SEED)); + let r = report(&tree, &solved.strategy, ITERS, SEED, 3); + assert!(r.exploitability.abs() < 1.5, "GTO must be ~unexploitable, got {:.3} bb/100", r.exploitability); + } + + #[test] + fn a_fold_everything_strategy_is_exploitable() { + // Hero folds to every bet and never bets: the villain best-responds by always betting, printing + // the pot with any hand. That is strictly worse than the equilibrium, so exploitability > 0. + let tree = polarised_tree(); + let hero = Strategy::pure(&tree, |name, _| match name { + "hero_vs_bet" => 0, // fold + "hero" => 0, // check + _ => 0, + }); + let r = report(&tree, &hero, ITERS, SEED, 3); + assert!(r.exploitability > 5.0, "folding everything must be exploitable, got {:.3}", r.exploitability); + assert!(r.exploitability >= -1e-9, "exploitability is non-negative, got {:.3}", r.exploitability); + } + + #[test] + fn the_live_engine_runs_and_reports_a_finite_number() { + // A real board, a small two-hand range each: the harness must bucketize real cards, query the + // engine and return a finite, non-negative exploitability. (Correctness of the number is the + // math tests above; this guards the live wiring.) + let board = Card::parse_list("Ah Kd 7c 2s 9h").unwrap(); + let hero = [ + Card::parse_list("Ac Qc").unwrap(), // top pair + Card::parse_list("5d 4d").unwrap(), // air + ]; + let villain = [ + Card::parse_list("Ad Jc").unwrap(), // top pair worse kicker + Card::parse_list("6h 6d").unwrap(), // underpair / bluff-catcher + ]; + let spec = RiverSpec { + board: &board, + hero_range: &hero, + villain_range: &villain, + villain_profile: None, + pot: 6.0, + bet: 4.0, + }; + let r = exploitability_river(&spec, 4_000, SEED).expect("non-degenerate subgame"); + assert!(r.exploitability.is_finite()); + assert!(r.exploitability >= -1e-6, "exploitability non-negative, got {:.3}", r.exploitability); + assert!(r.buckets >= 2); + } +} diff --git a/src/sim/gto.rs b/src/sim/gto.rs new file mode 100644 index 00000000..7aa76dc2 --- /dev/null +++ b/src/sim/gto.rs @@ -0,0 +1,380 @@ +//! A near-GTO scripted opponent: the strong measurement target the weak styles cannot be. It plays +//! RANGES, not hand-strength thresholds: every decision first ranks its hand inside its own range +//! (`range_pct`, 0 = best), then plays that rank by balanced frequencies. +//! +//! - Preflop: position charts (open / call / 3-bet value + bluff / 4-bet / jam) on the 169-class +//! percentile; heads-up the button opens ~80 %, the big blind defends ~70 %. +//! - Betting: value from the top of the range, bluffs from the draw / air band at the ratio the bet +//! size asks for (bet 2/3 pot: 0.4 bluff per value, so the caller is indifferent). Medium hands +//! check (showdown value, protected by checking back), the nuts sometimes trap. +//! - Facing a bet: defends the minimum-defence share `pot / (pot + bet)` of its range, no more, no +//! less, narrowed by each earlier street it already paid; raises the very top plus a thin bluff +//! band. Against a big bet it folds more, against a small one it calls more - price decides. +//! - In position it bets thinner than out of position; the preflop aggressor c-bets more than the +//! caller leads; multiway it tightens and stops bluffing. +//! +//! It is not a solver: ranks come from equity against a random hand (draws included), the ranges +//! are fixed charts. But it has no single-street leak a heuristic can farm: it neither over-folds +//! nor over-calls, and its bluffs are as frequent as its value bets allow. + +use super::opponent::{Act, View}; +use crate::card::{deck, Card}; +use crate::game::{ActionRecord, SeenAction, Street}; +use crate::hand::showdown::best; +use crate::preflop::holdem_percentile::holdem_percentile; +use crate::rng::Rng; +use crate::variant::HoleUsage; + +/// Range hands the own hand is ranked against. +const RANGE_SAMPLES: usize = 36; +/// Runouts per range hand when the board is not complete. +const RUNOUTS: usize = 20; +/// Chance a street's call is carried by the narrower range on the next street. +const STREET_REACH: f64 = 0.62; + +/// The betting shape of a balanced opponent: its bet size (pot fraction) and how many bluffs it mixes +/// in per value bet. Several shapes give the ladder independent balanced targets (so a defensive fix +/// must generalise, not overfit one sizing). All shapes stay balanced - the bluff ratio matches the +/// size's minimum-defence indifference - so none has a single-street leak a heuristic can farm. +#[derive(Clone, Copy, Debug, PartialEq)] +pub struct Shape { + pub bet_size: f64, + pub bluff_per_value: f64, +} + +impl Shape { + /// Two-thirds-pot bettor, 0.4 bluffs per value (the original `Gto`). Byte-identical to the + /// constants it replaces, so the existing `heads-up gto` measurement is unchanged. + pub const BALANCED: Shape = Shape { bet_size: 2.0 / 3.0, bluff_per_value: 0.4 }; + /// Small-ball half-pot bettor, value-leaning (0.3 bluffs per value): a tighter, more + /// value-weighted river betting range - the hardest case for a hero that over-calls marginal + /// made hands, and an independent balanced target. + pub const SMALL: Shape = Shape { bet_size: 0.5, bluff_per_value: 0.3 }; +} + +pub struct Ctx<'a> { + pub hole: &'a [Card], + pub board: &'a [Card], + /// Equity against one random hand (the shared `Reading` signal). + pub strength: f64, + /// Whole pot, bets of this street included. + pub pot: f64, + pub own_bet: f64, + pub stack: f64, + /// 0-based seat; 0 is the button. + pub seat: usize, + pub players: usize, + pub live: usize, + /// Acts last among the live players after the flop. + pub in_position: bool, + pub history: &'a [ActionRecord], + pub seed: u64, + /// Bet size and bluff mix of this balanced opponent. + pub shape: Shape, +} + +struct Pre { + /// Raises made before this action (blinds are not raises). + level: usize, + last_raiser: Option, + limpers: usize, + max_bet: f64, +} + +fn preflop_facts(history: &[ActionRecord]) -> Pre { + let mut pre = Pre { level: 0, last_raiser: None, limpers: 0, max_bet: 0.0 }; + for r in history.iter().filter(|r| r.street == Street::Preflop) { + let amount = r.amount.unwrap_or(0.0); + match r.action { + SeenAction::PostAnte => {} + SeenAction::PostSmallBlind | SeenAction::PostBigBlind => pre.max_bet = pre.max_bet.max(amount), + SeenAction::Call if amount <= 1.0 + 1e-9 => pre.limpers += 1, + _ if amount > pre.max_bet + 1e-9 => { + pre.level += 1; + pre.last_raiser = Some(r.seat); + pre.max_bet = amount; + } + _ => {} + } + } + pre +} + +/// Distance behind the button: 0 button, 1 small blind, 2 big blind, then early to late. +fn open_share(ctx: &Ctx) -> f64 { + let n = ctx.players; + let seat = ctx.seat; + if n == 2 { + return if seat == 0 { 0.80 } else { 1.0 }; + } + match seat { + 0 => 0.45, + 1 => 0.40, + 2 => 1.0, + s => match n - s { + 1 => 0.27, + 2 => 0.21, + _ => 0.16, + }, + } +} + +/// Share of hands called against one open, by seat. +fn call_share(ctx: &Ctx) -> f64 { + let n = ctx.players; + match (n, ctx.seat) { + (2, 1) => 0.70, + (_, 2) => 0.50, + (_, 0) => 0.12, + (_, 1) => 0.05, + (_, s) if n - s == 1 => 0.10, + _ => 0.08, + } +} + +fn raise_to(ctx: &Ctx, to: f64) -> Act { + Act::RaiseTo(to.min(ctx.stack + ctx.own_bet)) +} + +fn preflop(view: View, ctx: &Ctx, pre: &Pre, rng: Rng) -> (Act, Rng) { + let q = holdem_percentile(ctx.hole); + let (u, rng) = rng.unit(); + let can_raise = view.min_raise_to.is_some(); + let hu = ctx.players == 2; + let act = match pre.level { + 0 => { + let share = open_share(ctx); + let free = view.to_call <= 0.0; + if free { + // Big blind with the option: iso-raise the top, else check. + if can_raise && pre.limpers > 0 && q <= 0.14 { raise_to(ctx, 3.5 + pre.limpers as f64) } else { Act::Check } + } else if can_raise && pre.limpers > 0 && q <= share * 0.8 { + raise_to(ctx, 3.5 + pre.limpers as f64) + } else if can_raise && pre.limpers == 0 && q <= share { + raise_to(ctx, if ctx.seat == 1 && !hu { 3.0 } else { 2.5 }) + } else if q <= share * 0.5 && view.to_call <= 0.5 + 1e-9 { + Act::Call + } else { + Act::Fold + } + } + 1 => { + let x = pre.max_bet; + let scale = (2.5 / x).clamp(0.3, 1.2); + let value = if hu { 0.09 } else { 0.035 }; + let (lo, hi, p) = if hu { (0.30, 0.50, 0.30) } else { (0.28, 0.42, 0.28) }; + let call = call_share(ctx) * scale; + let three_bet = (if ctx.in_position_preflop() { 3.0 } else { 3.6 }) * x; + if can_raise && q <= value { + raise_to(ctx, three_bet) + } else if can_raise && q >= lo && q <= hi && u < p * scale { + raise_to(ctx, three_bet) + } else if q <= call { + Act::Call + } else { + Act::Fold + } + } + 2 => { + let x = pre.max_bet; + let scale = (8.0 / x).clamp(0.3, 1.3); + let (value, call) = if hu { (0.035, 0.20) } else { (0.02, 0.12) }; + if can_raise && q <= value { + raise_to(ctx, 2.3 * x) + } else if can_raise && q >= 0.15 && q <= 0.30 && u < 0.12 * scale { + raise_to(ctx, 2.3 * x) + } else if q <= call * scale { + Act::Call + } else { + Act::Fold + } + } + _ => { + if q <= 0.02 { + if can_raise && pre.max_bet < ctx.stack * 0.5 { raise_to(ctx, ctx.stack + ctx.own_bet) } else { Act::Call } + } else { + Act::Fold + } + } + }; + (act, rng) +} + +impl Ctx<'_> { + /// Preflop, "in position" over the opener: the button, or a seat after the raiser. Coarse. + fn in_position_preflop(&self) -> bool { + self.seat == 0 || (self.players > 2 && self.seat >= 3 && self.seat + 1 == self.players) + } +} + +/// How often this seat has already paid a postflop bet. +fn prior_calls(ctx: &Ctx, street: Street) -> i32 { + ctx.history + .iter() + .filter(|r| r.street >= Street::Flop && r.street < street && r.seat as usize == ctx.seat + 1 && r.action == SeenAction::Call) + .count() as i32 +} + +/// Share of all hands this seat still holds after its own preflop actions (its range). +fn range_share(ctx: &Ctx, pre: &Pre) -> f64 { + let mine = ctx.seat as u8 + 1; + let last = ctx.history.iter().rev().find(|r| r.street == Street::Preflop && r.seat == mine && !matches!(r.action, SeenAction::PostAnte | SeenAction::PostSmallBlind | SeenAction::PostBigBlind)); + match last.map(|r| r.action) { + Some(SeenAction::Raise | SeenAction::Bet | SeenAction::AllIn) if pre.last_raiser == Some(mine) => { + if pre.level <= 1 { open_share(ctx).min(0.8) } else { 0.07 } + } + Some(SeenAction::Call) => { + if pre.level <= 1 { call_share(ctx).max(0.10) } else { 0.10 } + } + _ => 0.9, + } +} + +fn candidate_equity(cand: &[Card], board: &[Card], rng: Rng) -> (f64, Rng) { + let mut known = cand.to_vec(); + known.extend_from_slice(board); + let pool = deck::without(&known); + let missing = 5 - board.len(); + let mut rng = rng; + let mut won = 0.0; + for _ in 0..RUNOUTS { + let (cards, next) = deck::draw(&pool, 2 + missing, rng).expect("enough cards"); + rng = next; + let mut full = board.to_vec(); + full.extend_from_slice(&cards[2..]); + let mine = best(HoleUsage::BestFiveOfAll, cand, &full).expect("valid cards"); + let theirs = best(HoleUsage::BestFiveOfAll, &cards[..2], &full).expect("valid cards"); + won += match mine.cmp(&theirs) { + std::cmp::Ordering::Greater => 1.0, + std::cmp::Ordering::Equal => 0.5, + std::cmp::Ordering::Less => 0.0, + }; + } + (won / RUNOUTS as f64, rng) +} + +/// Share of the own range (preflop-chart hands) that beats this hand on the current board: +/// 0 is the nuts, 1 the worst. River: exact showdown ranks; earlier streets: equity against a random +/// hand, which counts draws. +fn range_pct(ctx: &Ctx, share: f64, rng: Rng) -> (f64, Rng) { + let mut known = ctx.hole.to_vec(); + known.extend_from_slice(ctx.board); + let pool = deck::without(&known); + let river = ctx.board.len() == 5; + let mine_showdown = river.then(|| best(HoleUsage::BestFiveOfAll, ctx.hole, ctx.board).expect("valid cards")); + let mut rng = rng; + let (mut beaten_by, mut seen) = (0.0, 0usize); + let mut attempts = 0; + while seen < RANGE_SAMPLES && attempts < 600 { + attempts += 1; + let (i, r) = rng.below(pool.len() as u64); + let (mut j, r) = r.below(pool.len() as u64 - 1); + rng = r; + if j >= i { + j += 1; + } + let cand = [pool[i as usize], pool[j as usize]]; + if holdem_percentile(&cand) > share { + continue; + } + seen += 1; + beaten_by += match &mine_showdown { + Some(mine) => { + let theirs = best(HoleUsage::BestFiveOfAll, &cand, ctx.board).expect("valid cards"); + match theirs.cmp(mine) { + std::cmp::Ordering::Greater => 1.0, + std::cmp::Ordering::Equal => 0.5, + std::cmp::Ordering::Less => 0.0, + } + } + None => { + let (eq, r) = candidate_equity(&cand, ctx.board, rng); + rng = r; + if eq > ctx.strength { 1.0 } else if eq == ctx.strength { 0.5 } else { 0.0 } + } + }; + } + ((if seen == 0 { 0.5 } else { beaten_by / seen as f64 }), rng) +} + +fn postflop(view: View, ctx: &Ctx, pre: &Pre, rng: Rng) -> (Act, Rng) { + let street = match ctx.board.len() { + 3 => Street::Flop, + 4 => Street::Turn, + _ => Street::River, + }; + let river = street == Street::River; + let (p, rng) = range_pct(ctx, range_share(ctx, pre), rng); + let (u, rng) = rng.unit(); + let (u2, rng) = rng.unit(); + let can_raise = view.min_raise_to.is_some(); + let multi = ctx.live > 2; + let bet_to = |frac: f64| raise_to(ctx, ctx.own_bet + view.to_call + frac * (ctx.pot + view.to_call)); + let (pool_lo, pool_hi) = if river { (0.72, 1.0) } else { (0.55, 0.92) }; + + if view.to_call <= 0.0 { + if !can_raise { + return (Act::Check, rng); + } + let aggressor = pre.last_raiser == Some(ctx.seat as u8 + 1); + let mut value = match (aggressor, ctx.in_position) { + (true, false) => 0.28, + (true, true) => 0.33, + (false, true) => 0.30, + (false, false) => 0.16, + }; + let mut bluffs = ctx.shape.bluff_per_value * value; + if multi { + value *= 0.6; + bluffs = ctx.shape.bluff_per_value * value * 0.3; + } + let bluff_prob = bluffs / (pool_hi - pool_lo); + let act = if p <= 0.03 && !river && u < 0.25 { + Act::Check + } else if p <= value || (p >= pool_lo && p <= pool_hi && u2 < bluff_prob) { + bet_to(ctx.shape.bet_size) + } else { + Act::Check + }; + return (act, rng); + } + + // Facing a bet or raise: defend the minimum-defence share of the range. + let before = (ctx.pot - view.to_call).max(1e-9); + let mdf = before / ctx.pot; + let reach = STREET_REACH.powi(prior_calls(ctx, street)); + let defend = mdf * reach * if multi { 0.85 } else { 1.0 }; + let faced_raise = ctx.own_bet > 0.0; + let raise_value = if faced_raise { 0.03 } else if river { 0.06 } else { 0.05 }; + let all_in_price = view.to_call >= ctx.stack - 1e-9; + let act = if can_raise && !all_in_price && p <= raise_value && u < 0.9 { + raise_to(ctx, 3.0 * (ctx.own_bet + view.to_call)) + } else if can_raise + && !all_in_price + && !faced_raise + && !multi + && p > defend + && p >= (if river { 0.85 } else { 0.55 }) + && p <= (if river { 1.0 } else { 0.92 }) + && u < 0.07 + { + raise_to(ctx, 3.0 * (ctx.own_bet + view.to_call)) + } else if p <= defend { + Act::Call + } else { + Act::Fold + }; + (act, rng) +} + +pub fn act(view: View, ctx: &Ctx, rng: Rng) -> (Act, Rng) { + let pre = preflop_facts(ctx.history); + if ctx.board.is_empty() { + preflop(view, ctx, &pre, rng) + } else { + // The ranking has its own stream so that it does not depend on the hand's other randomness. + let (act, _) = postflop(view, ctx, &pre, Rng::seeded(ctx.seed)); + let (_, rng) = rng.next_u64(); + (act, rng) + } +} diff --git a/src/sim/league.rs b/src/sim/league.rs new file mode 100644 index 00000000..386f1238 --- /dev/null +++ b/src/sim/league.rs @@ -0,0 +1,142 @@ +//! Stufe 3, tier L3 of the synthetic lab: the LEAGUE. +//! +//! A static population measures exploitation; a single adaptive opponent measures one mind-game. The +//! league measures ROBUSTNESS: the hero is scored against a whole POOL at once — static field draws, +//! the L1 reactive opponents (`Adapt::Tighten`/`Loosen`), the L2 modelling opponent (`Adapt::Model`), +//! and the exploiter the Stufe-5 optimizer dug up (the nemesis ruleset). The pool's *worst* member is +//! the floor that matters: a change may lift the league mean, but if it caves against one tier it is +//! not robust (the AlphaStar / Pluribus lesson — evaluate against a population of responses, never a +//! single opponent, so nothing overfits). +//! +//! This is the richer-pool sibling of the twin gate's six-archetype floor (`sim::twin_gate`): same +//! idea (worst-case over a roster), but the roster now spans the adaptive tiers and the known +//! exploiter, not just the static archetypes. + +use super::adaptive::{session_samples, Adapt}; +use super::population::Population; +use super::reader::{Rules, Style}; +use crate::rng::Rng; +use std::thread; + +/// 95 % two-sided normal quantile. +const Z95: f64 = 1.959_964; + +/// The worst-case individual opponent the Stufe-5 CMA-ES found (`bin/nemesis`): a loose-aggressive +/// small-ball re-raiser the engine bled −643 bb/100 against. Pinned here as a standing league member so +/// every future change is checked against the sharpest known hole. +pub const NEMESIS: Rules = Rules { + call_margin: 0.147, + raise_at: 0.597, + bet_at: 0.616, + open_at: 0.817, + bluff: 0.396, + size: 0.270, +}; + +#[derive(Clone, Debug)] +pub struct MemberResult { + pub name: String, + pub ev_bb_per_100: f64, + pub ci95: f64, +} + +#[derive(Clone, Debug)] +pub struct LeagueReport { + pub members: Vec, + /// Mean of the members' EVs — the league average. + pub mean_bb_per_100: f64, + pub worst_name: String, + pub worst_bb_per_100: f64, + pub worst_ci95: f64, +} + +struct Member { + name: String, + base: Rules, + style: Adapt, +} + +fn rate(samples: &[f64]) -> (f64, f64) { + let n = samples.len().max(1) as f64; + let mean = samples.iter().sum::() / n; + let var = samples.iter().map(|s| (s - mean).powi(2)).sum::() / (n - 1.0).max(1.0); + (100.0 * mean, 100.0 * Z95 * (var / n).sqrt()) +} + +/// Assemble the roster: `pop_members` static draws from the field, the three adaptive tiers on a reg +/// base (L1 tighten, L1 loosen, L2 model), and the pinned nemesis. +fn roster(pop: &Population, pop_members: usize, seed: u64) -> Vec { + let mut members = Vec::new(); + let mut rng = Rng::seeded(seed ^ 0x1EA6_0E11); + for k in 0..pop_members { + let (draw, next) = pop.sample(rng); + rng = next; + members.push(Member { + name: format!("pop:{}#{k}", draw.label), + base: draw.rules, + style: Adapt::Static, + }); + } + let reg = Style::Reg.rules(); + members.push(Member { name: "L1:reg-tighten".into(), base: reg, style: Adapt::Tighten }); + members.push(Member { name: "L1:reg-loosen".into(), base: reg, style: Adapt::Loosen }); + members.push(Member { name: "L2:reg-model".into(), base: reg, style: Adapt::Model }); + members.push(Member { name: "exploiter:nemesis".into(), base: NEMESIS, style: Adapt::Static }); + members +} + +/// Score the hero across the whole league, `deals` deals per member. Deterministic in `seed`; threaded +/// over members. +pub fn evaluate(pop: &Population, pop_members: usize, deals: u32, seed: u64) -> LeagueReport { + let members = roster(pop, pop_members, seed); + let results: Vec = thread::scope(|scope| { + let handles: Vec<_> = members + .iter() + .enumerate() + .map(|(i, m)| { + let seed_m = seed ^ (i as u64 + 1).wrapping_mul(0x9E37_79B9_7F4A_7C15); + scope.spawn(move || { + let samples = session_samples(m.base, deals, seed_m, m.style); + let (ev, ci) = rate(&samples); + MemberResult { name: m.name.clone(), ev_bb_per_100: ev, ci95: ci } + }) + }) + .collect(); + handles.into_iter().map(|h| h.join().expect("a league member panicked")).collect() + }); + + let mean = results.iter().map(|r| r.ev_bb_per_100).sum::() / results.len().max(1) as f64; + let worst = results + .iter() + .min_by(|a, b| a.ev_bb_per_100.partial_cmp(&b.ev_bb_per_100).unwrap()) + .expect("non-empty league"); + LeagueReport { + worst_name: worst.name.clone(), + worst_bb_per_100: worst.ev_bb_per_100, + worst_ci95: worst.ci95, + mean_bb_per_100: mean, + members: results, + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn league_scores_every_tier_and_finds_a_floor() { + // Tiny budget: drives the full engine per member, keep small for `cargo test`. + let pop = Population::micro(); + let r = evaluate(&pop, 3, 25, 0x5EED_0001); + println!("league mean {:+.1}, worst {} {:+.1}", r.mean_bb_per_100, r.worst_name, r.worst_bb_per_100); + for m in &r.members { + println!(" {:20} {:+8.1} ±{:.1}", m.name, m.ev_bb_per_100, m.ci95); + } + // 3 population draws + tighten + loosen + model + nemesis = 7 members. + assert_eq!(r.members.len(), 7); + assert!(r.members.iter().any(|m| m.name == "exploiter:nemesis")); + assert!(r.members.iter().any(|m| m.name == "L2:reg-model")); + assert!(r.mean_bb_per_100.is_finite()); + assert!(r.worst_bb_per_100 <= r.mean_bb_per_100 + 1e-9, "worst must not exceed the mean"); + } +} diff --git a/src/sim/memory.rs b/src/sim/memory.rs new file mode 100644 index 00000000..72427921 --- /dev/null +++ b/src/sim/memory.rs @@ -0,0 +1,299 @@ +//! Session memory (Stage 1): the engine builds its read from the opponent's OBSERVED actions over +//! the hands of a session, instead of being handed the converged HUD read (`sim::reads`) or playing +//! blind. A HUD that only counts - per opponent seat, preflop voluntary money and raises, postflop +//! folds-to-a-bet and aggression - turned into a `Profile` once a warmup of hands is seen, so the +//! first hands play blind and the read converges to the truth over the session. +//! +//! The gap blind -> read-given that `benchmarks/baseline.txt` / `tests/sim_blind` measure is exactly +//! what this must recapture: a `... (memory)` scenario lands between the blind and the read-given +//! twin, the share of the prize that observation alone earns. Every opponent seat is the same fixed +//! archetype, so their counts pool into one read. + +use crate::exploit::profile::Profile; +use crate::game::{ActionRecord, SeenAction, Street}; + +/// Hands to observe before the read is trusted; until then `read` is `None` (the engine plays +/// blind). Keeps an early, noisy sample from steering worse than no read at all. +pub const WARMUP_HANDS: u32 = 25; + +/// Postflop actions at which the read's confidence reaches 0.5 (half-life). Matches the Bayesian +/// posterior's `VERTRAUEN_HALB` so the counts HUD and `exploit::posterior` agree on how fast a read +/// earns trust. The river gearbox turns this confidence into the KL trust radius. +pub const CONFIDENCE_HALF: f64 = 30.0; + +/// Running tallies over the opponent archetype. Preflop opportunities (`hands`) and the voluntary / +/// raise counts drive vpip and pfr; the postflop tallies drive fold-to-bet and aggression. +#[derive(Clone, Copy, Debug, Default, PartialEq)] +struct Counts { + hands: u32, + vpip: u32, + pfr: u32, + folded_to_bet: u32, + passive_call: u32, + passive_check: u32, + aggressive: u32, + // Per-street aggression split (turn and river only — the streets the subgame gearboxes solve). + // `*_passive` is calls plus checks on that street (the aggression denominator, matching the pooled + // one which counts checks); folds are excluded, as in the pooled aggression. + turn_aggressive: u32, + turn_passive: u32, + river_aggressive: u32, + river_passive: u32, +} + +/// The read a HUD accumulates from watching one fixed opponent archetype play a session. +#[derive(Clone, Debug, Default, PartialEq)] +pub struct SessionMemory { + c: Counts, +} + +impl SessionMemory { + pub fn new() -> Self { + Self::default() + } + + /// Fold every opponent seat's actions of one finished hand into the counts. `hero` is the + /// 0-based hero seat; every other of the `players` seats is an opponent of the same archetype. + pub fn observe_hand(&mut self, history: &[ActionRecord], hero: usize, players: usize) { + for seat in 1..=players as u8 { + if seat as usize - 1 != hero { + self.observe_seat(history, seat); + } + } + } + + fn observe_seat(&mut self, history: &[ActionRecord], seat: u8) { + self.c.hands += 1; + let (mut voluntary, mut raised) = (false, false); + for r in history.iter().filter(|r| r.seat == seat) { + if r.street == Street::Preflop { + // Blinds are forced (PostSmallBlind / PostBigBlind); a check is free. Only a call or + // an aggressive action puts money in by choice. + match r.action { + SeenAction::Call | SeenAction::Bet | SeenAction::Raise | SeenAction::AllIn => { + voluntary = true; + } + _ => {} + } + raised |= r.action.is_aggressive(); + } else { + // Postflop a fold or a call only happens facing a bet; a check faces nothing. The + // check still counts as a passive action for aggression (matching how the oracle + // reads are measured, `tests/sim_opponent_stats`): leaving checks out of the + // denominator makes a passive, check-heavy opponent look far more aggressive than it + // is, and `bluff_share` reads aggression directly. + match r.action { + SeenAction::Fold => self.c.folded_to_bet += 1, + SeenAction::Call => { + self.c.passive_call += 1; + self.bump_passive(r.street); + } + SeenAction::Check => { + self.c.passive_check += 1; + self.bump_passive(r.street); + } + a if a.is_aggressive() => { + self.c.aggressive += 1; + self.bump_aggressive(r.street); + } + _ => {} + } + } + } + self.c.vpip += voluntary as u32; + self.c.pfr += raised as u32; + } + + /// A passive postflop action (call or check) on the turn/river, for the per-street aggression + /// denominator. Flop and preflop are not split. + fn bump_passive(&mut self, street: Street) { + match street { + Street::Turn => self.c.turn_passive += 1, + Street::River => self.c.river_passive += 1, + _ => {} + } + } + + /// An aggressive postflop action (bet or raise) on the turn/river, for the per-street numerator. + fn bump_aggressive(&mut self, street: Street) { + match street { + Street::Turn => self.c.turn_aggressive += 1, + Street::River => self.c.river_aggressive += 1, + _ => {} + } + } + + /// The read so far, or `None` during the warmup. vpip / pfr are over hands; fold-to-bet is folds + /// over folds-plus-calls facing a bet; aggression is bets-and-raises over bets-raises-and-calls. + pub fn read(&self) -> Option { + if self.c.hands < WARMUP_HANDS { + return None; + } + let ratio = |num: u32, den: u32| (den > 0).then(|| num as f64 / den as f64); + let facing_bet = self.c.folded_to_bet + self.c.passive_call; + // Aggression frequency: bets and raises over every non-folding postflop action, checks + // included (see `observe_seat`). + let postflop_actions = self.c.aggressive + self.c.passive_call + self.c.passive_check; + // Confidence for the gearbox: the read is only as trustworthy as its weaker postflop sample — + // the facing-a-bet count (drives fold_to_bet / the defense belief) and the total postflop + // count (drives aggression / the betting-polarization belief). Half at CONFIDENCE_HALF. + let conf = |n: u32| n as f64 / (n as f64 + CONFIDENCE_HALF); + let confidence = conf(facing_bet.min(postflop_actions)); + // Per-street aggression: bets/raises over bets-raises-plus-passive on that street (same shape + // as the pooled frequency). `None` until the street has an action, so `believed_villain` falls + // back to the pooled read. + let street_aggr = |aggr: u32, passive: u32| ratio(aggr, aggr + passive); + Some(Profile { + vpip: ratio(self.c.vpip, self.c.hands), + pfr: ratio(self.c.pfr, self.c.hands), + fold_to_bet: ratio(self.c.folded_to_bet, facing_bet), + aggression: ratio(self.c.aggressive, postflop_actions), + turn_aggression: street_aggr(self.c.turn_aggressive, self.c.turn_passive), + river_aggression: street_aggr(self.c.river_aggressive, self.c.river_passive), + confidence: Some(confidence), + ..Profile::default() + }) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::exploit::style::{classify, Style}; + + fn rec(street: Street, seat: u8, action: SeenAction) -> ActionRecord { + ActionRecord { street, seat, action, amount: None } + } + + /// One heads-up hand (hero seat 0 = seat 1, opponent seat 2): the opponent calls hero's preflop + /// raise (voluntary, not a raise), then calls a flop bet and folds the turn (passive, folds to a + /// bet, never aggressive). + fn loose_passive_hand() -> Vec { + vec![ + rec(Street::Preflop, 1, SeenAction::PostSmallBlind), + rec(Street::Preflop, 2, SeenAction::PostBigBlind), + rec(Street::Preflop, 1, SeenAction::Raise), + rec(Street::Preflop, 2, SeenAction::Call), + rec(Street::Flop, 1, SeenAction::Bet), + rec(Street::Flop, 2, SeenAction::Call), + rec(Street::Turn, 1, SeenAction::Bet), + rec(Street::Turn, 2, SeenAction::Fold), + ] + } + + #[test] + fn no_read_before_the_warmup() { + let mut m = SessionMemory::new(); + let h = loose_passive_hand(); + for _ in 0..WARMUP_HANDS - 1 { + m.observe_hand(&h, 0, 2); + } + assert_eq!(m.read(), None); + m.observe_hand(&h, 0, 2); + assert!(m.read().is_some()); + } + + #[test] + fn a_seat_that_only_posts_a_blind_is_not_vpip() { + // Hero seat 0; the opponent (seat 2) is the big blind and checks its option: no voluntary + // money, no raise. + let hand = vec![ + rec(Street::Preflop, 1, SeenAction::PostSmallBlind), + rec(Street::Preflop, 2, SeenAction::PostBigBlind), + rec(Street::Preflop, 1, SeenAction::Call), + rec(Street::Preflop, 2, SeenAction::Check), + ]; + let mut m = SessionMemory::new(); + for _ in 0..WARMUP_HANDS { + m.observe_hand(&hand, 0, 2); + } + let p = m.read().expect("read after warmup"); + assert_eq!(p.vpip, Some(0.0)); + assert_eq!(p.pfr, Some(0.0)); + } + + #[test] + fn the_loose_passive_opponent_reads_as_a_calling_station() { + let mut m = SessionMemory::new(); + let h = loose_passive_hand(); + for _ in 0..40 { + m.observe_hand(&h, 0, 2); + } + let p = m.read().expect("read"); + assert_eq!(p.vpip, Some(1.0)); // calls every preflop + assert_eq!(p.pfr, Some(0.0)); + assert_eq!(p.fold_to_bet, Some(0.5)); // one call, one fold facing a bet + assert_eq!(p.aggression, Some(0.0)); // never bets or raises postflop + assert_eq!(classify(&p), Style::CallingStation); + } + + #[test] + fn checks_count_toward_aggression_so_a_passive_opponent_reads_passive() { + // Seat 2 bets once but checks the flop in every other hand. Aggression must be 1 / (1 bet + + // many checks), near zero - not 1 / 1 from leaving the checks out of the denominator. + let bet = vec![ + rec(Street::Preflop, 1, SeenAction::PostSmallBlind), + rec(Street::Preflop, 2, SeenAction::PostBigBlind), + rec(Street::Preflop, 1, SeenAction::Call), + rec(Street::Preflop, 2, SeenAction::Check), + rec(Street::Flop, 2, SeenAction::Bet), + ]; + let check = vec![ + rec(Street::Preflop, 1, SeenAction::PostSmallBlind), + rec(Street::Preflop, 2, SeenAction::PostBigBlind), + rec(Street::Preflop, 1, SeenAction::Call), + rec(Street::Preflop, 2, SeenAction::Check), + rec(Street::Flop, 2, SeenAction::Check), + ]; + let mut m = SessionMemory::new(); + m.observe_hand(&bet, 0, 2); + for _ in 0..29 { + m.observe_hand(&check, 0, 2); + } + let p = m.read().expect("read"); + assert_eq!(p.aggression, Some(1.0 / 30.0)); // 1 bet, 29 checks + } + + #[test] + fn per_street_aggression_splits_the_turn_from_the_pooled_read() { + // Seat 2 checks the flop (passive) but bets the turn (aggressive), no river action. The pooled + // aggression is 1 bet / (1 bet + 1 check) = 0.5, but the TURN aggression is 1/1 = 1.0, and the + // river stays None. This is exactly the barreler the pooled read under-sells. + let hand = vec![ + rec(Street::Preflop, 1, SeenAction::PostSmallBlind), + rec(Street::Preflop, 2, SeenAction::PostBigBlind), + rec(Street::Preflop, 1, SeenAction::Raise), + rec(Street::Preflop, 2, SeenAction::Call), + rec(Street::Flop, 1, SeenAction::Check), + rec(Street::Flop, 2, SeenAction::Check), + rec(Street::Turn, 1, SeenAction::Check), + rec(Street::Turn, 2, SeenAction::Bet), + ]; + let mut m = SessionMemory::new(); + for _ in 0..40 { + m.observe_hand(&hand, 0, 2); + } + let p = m.read().expect("read"); + assert_eq!(p.aggression, Some(0.5)); // 1 bet, 1 flop check pooled + assert_eq!(p.turn_aggression, Some(1.0)); // bets every turn, never passive on the turn + assert_eq!(p.river_aggression, None); // no river action seen + } + + #[test] + fn a_tight_folding_opponent_reads_as_a_nit() { + // Seat 2 folds preflop every hand: no voluntary money, and (vpip 0) classifies as a nit. + let hand = vec![ + rec(Street::Preflop, 1, SeenAction::PostSmallBlind), + rec(Street::Preflop, 2, SeenAction::PostBigBlind), + rec(Street::Preflop, 1, SeenAction::Raise), + rec(Street::Preflop, 2, SeenAction::Fold), + ]; + let mut m = SessionMemory::new(); + for _ in 0..40 { + m.observe_hand(&hand, 0, 2); + } + let p = m.read().expect("read"); + assert_eq!(p.vpip, Some(0.0)); + assert_eq!(classify(&p), Style::Nit); + } +} diff --git a/src/sim/mod.rs b/src/sim/mod.rs index 6ece4351..182828a0 100644 --- a/src/sim/mod.rs +++ b/src/sim/mod.rs @@ -2,11 +2,24 @@ //! fixed opponents, win rate in bb/100 with a 95 % interval. Pure and deterministic; used by //! `tests/sim_strength.rs`, not by the request pipeline. +pub mod adaptive; +pub mod aivat; pub mod benchmark; +pub mod exploit_pop; +pub mod exploit_river; +pub mod gto; +pub mod league; pub mod luck; +pub mod memory; pub mod opponent; +pub mod optimize; pub mod paired; +pub mod population; pub mod reader; pub mod reads; +pub mod sequential; pub mod session; +pub mod simreal; pub mod table; +pub mod turnier_leiter; +pub mod twin_gate; diff --git a/src/sim/opponent.rs b/src/sim/opponent.rs index b3e8086b..ecd7c6cd 100644 --- a/src/sim/opponent.rs +++ b/src/sim/opponent.rs @@ -1,4 +1,4 @@ -use super::reader::Style; +use super::reader::{Rules, Style}; use crate::rng::Rng; /// What a fixed opponent sees: the price and, if raising is possible, its bounds @@ -18,8 +18,9 @@ pub enum Act { RaiseTo(f64), } -/// Fixed opponents for the strength measurement. Only `Reader` looks at its cards. -#[derive(Clone, Copy, Debug, PartialEq, Eq)] +/// Fixed opponents for the strength measurement. Only `Reader` and `Styled` look at their cards. +/// Not `Eq` because `Styled` carries f64 thresholds; `PartialEq`/`Copy` are enough everywhere it is used. +#[derive(Clone, Copy, Debug, PartialEq)] pub enum Opponent { /// Calls every bet, never raises. CallingStation, @@ -29,6 +30,10 @@ pub enum Opponent { RandomLegal, /// Plays its cards in a fixed style; the table hands it its reading (`Style::act`). Reader(Style), + /// Plays its cards by an explicit drawn ruleset (`sim::population`): one individual opponent, + /// read-driven like `Reader` but with no named style and no authored oracle profile (the engine + /// must infer it). The table hands it its reading (`reader::act_with`). + Styled(Rules), } impl Opponent { @@ -40,6 +45,7 @@ impl Opponent { Opponent::Folder => "folder", Opponent::RandomLegal => "random legal", Opponent::Reader(style) => style.name(), + Opponent::Styled(_) => "drawn", } } @@ -47,8 +53,9 @@ impl Opponent { let facing = view.to_call > 0.0; let passive = if facing { Act::Call } else { Act::Check }; match self { - // Without a reading there is nothing to play on; the table never asks this way. - Opponent::Reader(_) => (if facing { Act::Fold } else { Act::Check }, rng), + // Without a reading there is nothing to play on; the table never asks these this way + // (it routes reading opponents through `Style::act` / `reader::act_with`). + Opponent::Reader(_) | Opponent::Styled(_) => (if facing { Act::Fold } else { Act::Check }, rng), Opponent::CallingStation => (passive, rng), Opponent::Folder => (if facing { Act::Fold } else { Act::Check }, rng), Opponent::RandomLegal => { diff --git a/src/sim/optimize.rs b/src/sim/optimize.rs new file mode 100644 index 00000000..c1f22077 --- /dev/null +++ b/src/sim/optimize.rs @@ -0,0 +1,274 @@ +//! Stufe 5 of the synthetic lab: a derivative-free OPTIMIZER over the lab's objectives. +//! +//! The lab measures; the optimizer searches. It is a diagonal-covariance CMA evolution strategy +//! (the separable CMA-ES core, Ros & Hansen 2008; constants from Hansen's 2016 tutorial, the +//! covariance kept diagonal so no eigendecomposition is needed — pure, no dependencies). CMA-ES is the +//! standard choice for a noisy, black-box, low-dimensional objective, which is exactly what a +//! Monte-Carlo win rate over a few continuous knobs is. +//! +//! Two uses, one engine: +//! - LAST, the polish the architecture names: tune the engine's own hyperparameters against the +//! population once they are exposed as a vector. The optimizer is ready; it needs only that hook. +//! - NOW, a real objective that exists today: `worst_case_opponent` searches the 6-dim ruleset space +//! for the single opponent the engine does WORST against — an empirical best response in +//! opponent-space, within realistic bounds. That is the tightest robustness probe there is, and it +//! feeds the twin gate's defense story (`sim::twin_gate`): not "worst of six archetypes" but "worst +//! of the whole continuous neighbourhood". +//! +//! The ES is validated on analytic functions (sphere, Rosenbrock) in the tests; the opponent search is +//! deterministic in its seed (each ruleset is scored at a fixed measurement seed, so the landscape the +//! ES sees is stable). + +use super::opponent::Opponent; +use super::reader::Rules; +use super::session::{measure, ReadMode, Setup}; +use crate::rng::Rng; +use std::thread; + +/// Result of a run: the best point found, its objective value, and how many evaluations it cost. +#[derive(Clone, Debug)] +pub struct Optimum { + pub x: Vec, + pub f: f64, + pub evals: u32, +} + +/// Minimize `f` from `x0` with initial step `sigma0` for `generations`, seeded by `seed`. Diagonal +/// CMA-ES: samples λ points per generation, recombines the μ best, and adapts the mean, the per-axis +/// step sizes and the global step. `f` may be noisy; it is called λ times per generation. The λ +/// candidates of a generation are independent, so they are evaluated in PARALLEL (`f: Fn + Sync`) — +/// the win rate objective is single-threaded per opponent, and this recovers the cores the population +/// runs use. Sampling stays sequential, so the result is deterministic in `seed` regardless of threads. +pub fn minimize f64 + Sync>( + f: F, + x0: &[f64], + sigma0: f64, + generations: u32, + seed: u64, +) -> Optimum { + let n = x0.len(); + assert!(n >= 1, "need at least one dimension"); + + // --- strategy parameters (Hansen 2016 tutorial) --- + let lambda = 4 + (3.0 * (n as f64).ln()).floor() as usize; + let mu = lambda / 2; + let mut w: Vec = (0..mu).map(|i| ((mu as f64 + 0.5).ln()) - ((i + 1) as f64).ln()).collect(); + let w_sum: f64 = w.iter().sum(); + w.iter_mut().for_each(|x| *x /= w_sum); + let mu_eff = 1.0 / w.iter().map(|x| x * x).sum::(); + let nf = n as f64; + let c_sigma = (mu_eff + 2.0) / (nf + mu_eff + 5.0); + let d_sigma = + 1.0 + 2.0 * (0.0_f64).max(((mu_eff - 1.0) / (nf + 1.0)).sqrt() - 1.0) + c_sigma; + let c_c = (4.0 + mu_eff / nf) / (nf + 4.0 + 2.0 * mu_eff / nf); + let c_1 = 2.0 / ((nf + 1.3).powi(2) + mu_eff); + let c_mu = + (1.0 - c_1).min(2.0 * (mu_eff - 2.0 + 1.0 / mu_eff) / ((nf + 2.0).powi(2) + mu_eff)); + let chi_n = nf.sqrt() * (1.0 - 1.0 / (4.0 * nf) + 1.0 / (21.0 * nf * nf)); + + // --- dynamic state --- + let mut mean = x0.to_vec(); + let mut sigma = sigma0; + let mut diag = vec![1.0_f64; n]; // diagonal of C (per-axis variance) + let mut p_sigma = vec![0.0_f64; n]; + let mut p_c = vec![0.0_f64; n]; + let mut rng = Rng::seeded(seed); + let mut evals = 0u32; + + let (mut best_x, mut best_f) = (mean.clone(), f64::INFINITY); + + for gen in 0..generations { + // Sample λ candidates sequentially (RNG order fixed ⇒ deterministic): x = mean + σ·sqrt(diag)⊙z. + let mut cand: Vec<(Vec, Vec, Vec)> = Vec::with_capacity(lambda); // (x, z, y) + for _ in 0..lambda { + let mut z = vec![0.0; n]; + let mut y = vec![0.0; n]; + let mut x = vec![0.0; n]; + for j in 0..n { + let (zj, next) = gaussian(rng); + rng = next; + z[j] = zj; + y[j] = diag[j].sqrt() * zj; + x[j] = mean[j] + sigma * y[j]; + } + cand.push((x, z, y)); + } + // Evaluate the independent candidates in parallel. + let fs: Vec = thread::scope(|s| { + let handles: Vec<_> = cand.iter().map(|(x, _, _)| s.spawn(|| f(x))).collect(); + handles.into_iter().map(|h| h.join().expect("objective panicked")).collect() + }); + evals += lambda as u32; + // (f, z, y), tracking the best x seen. + let mut pop: Vec<(f64, Vec, Vec)> = Vec::with_capacity(lambda); + for ((x, z, y), fx) in cand.into_iter().zip(fs) { + if fx < best_f { + best_f = fx; + best_x = x; + } + pop.push((fx, z, y)); + } + pop.sort_by(|a, b| a.0.partial_cmp(&b.0).unwrap_or(std::cmp::Ordering::Equal)); + + // Weighted recombination of the μ best, in z- and y-space. + let mut z_w = vec![0.0; n]; + let mut y_w = vec![0.0; n]; + for (i, wi) in w.iter().enumerate() { + for j in 0..n { + z_w[j] += wi * pop[i].1[j]; + y_w[j] += wi * pop[i].2[j]; + } + } + // Move the mean. + for j in 0..n { + mean[j] += sigma * y_w[j]; + } + + // Step-size path and control. With diagonal C, C^{-1/2} y_w = z_w. + let cs = (c_sigma * (2.0 - c_sigma) * mu_eff).sqrt(); + for j in 0..n { + p_sigma[j] = (1.0 - c_sigma) * p_sigma[j] + cs * z_w[j]; + } + let ps_norm = norm(&p_sigma); + sigma *= ((c_sigma / d_sigma) * (ps_norm / chi_n - 1.0)).exp(); + + // Covariance path (Heaviside stall guard) and diagonal update. + let denom = (1.0 - (1.0 - c_sigma).powi(2 * (gen as i32 + 1))).sqrt(); + let h_sigma = + if ps_norm / denom < (1.4 + 2.0 / (nf + 1.0)) * chi_n { 1.0 } else { 0.0 }; + let cc = (c_c * (2.0 - c_c) * mu_eff).sqrt(); + for j in 0..n { + p_c[j] = (1.0 - c_c) * p_c[j] + h_sigma * cc * y_w[j]; + } + let delta_h = (1.0 - h_sigma) * c_c * (2.0 - c_c); + for j in 0..n { + let rank_mu: f64 = w.iter().enumerate().map(|(i, wi)| wi * pop[i].2[j].powi(2)).sum(); + diag[j] = (1.0 - c_1 - c_mu) * diag[j] + + c_1 * (p_c[j].powi(2) + delta_h * diag[j]) + + c_mu * rank_mu; + diag[j] = diag[j].max(1e-12); + } + } + + Optimum { x: best_x, f: best_f, evals } +} + +/// Standard normal via Box-Muller, value-threaded through the project RNG. +fn gaussian(rng: Rng) -> (f64, Rng) { + let (u1, rng) = rng.unit(); + let (u2, rng) = rng.unit(); + let u1 = u1.max(1e-12); + ((-2.0 * u1.ln()).sqrt() * (std::f64::consts::TAU * u2).cos(), rng) +} + +fn norm(v: &[f64]) -> f64 { + v.iter().map(|x| x * x).sum::().sqrt() +} + +fn sigmoid(x: f64) -> f64 { + 1.0 / (1.0 + (-x).exp()) +} + +/// One realistic bound for a ruleset parameter, matching `sim::population`'s clamps. +const BOUNDS: [(f64, f64); 6] = [ + (0.0, 0.45), // call_margin + (0.55, 0.97), // raise_at + (0.45, 0.90), // bet_at + (0.45, 0.85), // open_at + (0.0, 0.60), // bluff + (0.25, 1.30), // size +]; + +/// Map an unbounded search vector to a bounded `Rules` through a sigmoid per axis, so the ES searches +/// freely in R^6 while every candidate is a realistic opponent. +fn to_rules(x: &[f64]) -> Rules { + let p = |i: usize| { + let (lo, hi) = BOUNDS[i]; + lo + (hi - lo) * sigmoid(x[i]) + }; + Rules { + call_margin: p(0), + raise_at: p(1), + bet_at: p(2), + open_at: p(3), + bluff: p(4), + size: p(5), + } +} + +/// The engine's luck-corrected EV (bb/100, Memory mode) against one fixed opponent ruleset, at a fixed +/// measurement seed so the ES sees a stable landscape. +fn engine_ev(rules: Rules, deals: u32, seed: u64) -> f64 { + let setup = Setup { + players: 2, + opponent: Opponent::Styled(rules), + deals, + stack_bb: 100.0, + seed, + read: ReadMode::Memory, + }; + measure(&setup).bb_per_100 +} + +/// The engine's worst-case individual opponent, found by the ES: the realistic ruleset that MINIMIZES +/// the engine's EV. Returns the nemesis ruleset and the EV the engine makes against it (bb/100). +pub fn worst_case_opponent(deals: u32, generations: u32, seed: u64) -> (Rules, f64) { + let objective = |x: &[f64]| engine_ev(to_rules(x), deals, seed ^ 0xA11CE); + // Start at the origin (the centre of every bounded axis) with a wide step. + let opt = minimize(objective, &[0.0; 6], 1.0, generations, seed); + (to_rules(&opt.x), opt.f) +} + +#[cfg(test)] +mod tests { + use super::*; + + /// The sphere: f(x) = Σ x². The ES must drive a 4-dim sphere from a distance down near 0. + #[test] + fn minimizes_the_sphere() { + let f = |x: &[f64]| x.iter().map(|v| v * v).sum::(); + let opt = minimize(f, &[3.0, -2.5, 4.0, 1.0], 1.0, 200, 0xC0FFEE); + assert!(opt.f < 1e-6, "sphere not minimized: f={:.3e}", opt.f); + } + + /// Rosenbrock: a curved valley with the optimum at (1,1), f*=0. The classic ES stress test. + /// NOTE: this is a DIAGONAL (separable) CMA-ES — it adapts a per-axis variance but not a rotation, + /// so on a non-separable valley like Rosenbrock it converges into the optimum's basin but grinds + /// slowly along the curved floor (the known sep-CMA-ES limitation, Ros & Hansen 2008). The test + /// asserts it reaches that basin, not machine zero; the lab's objectives are low-coupling, where + /// the diagonal restriction costs little and buys a dependency-free implementation. + #[test] + fn minimizes_rosenbrock() { + let f = |x: &[f64]| { + let (a, b) = (x[0], x[1]); + (1.0 - a).powi(2) + 100.0 * (b - a * a).powi(2) + }; + let opt = minimize(f, &[-1.2, 1.0], 0.5, 800, 0xBEEF); + assert!(opt.f < 2e-2, "rosenbrock basin not reached: f={:.3e} at {:?}", opt.f, opt.x); + assert!((opt.x[0] - 1.0).abs() < 0.12 && (opt.x[1] - 1.0).abs() < 0.2); + } + + /// The ES on a noisy objective still finds the region of the optimum (averaging over the + /// population tolerates the noise). + #[test] + fn tolerates_noise() { + let f = |x: &[f64]| { + // sphere plus a deterministic-but-rough wobble (stands in for MC noise) + let base: f64 = x.iter().map(|v| v * v).sum(); + let wobble = 0.05 * (x[0] * 17.0).sin() * (x[1] * 13.0).cos(); + base + wobble + }; + let opt = minimize(f, &[2.0, -2.0], 1.0, 300, 0xD00D); + assert!(opt.f < 0.1, "noisy sphere not minimized: f={:.3e}", opt.f); + } + + #[test] + fn worst_case_opponent_runs_and_is_bounded() { + // Tiny: drives the full engine per evaluation, keep small for `cargo test`. + let (rules, ev) = worst_case_opponent(40, 3, 0x5EED_0001); + println!("nemesis {:?} -> engine EV {:+.2} bb/100", rules, ev); + assert!(ev.is_finite()); + assert!((0.0..=0.45).contains(&rules.call_margin)); + assert!((0.25..=1.30).contains(&rules.size)); + } +} diff --git a/src/sim/population.rs b/src/sim/population.rs new file mode 100644 index 00000000..41f94589 --- /dev/null +++ b/src/sim/population.rs @@ -0,0 +1,195 @@ +//! A synthetic opponent population: a distribution over `reader::Rules`, so the lab measures the +//! engine against thousands of INDIVIDUAL opponents drawn around a few archetype means, not five +//! fixed clones. Each draw carries a hidden archetype label the engine never sees — it must infer +//! the type from observed actions (`exploit::posterior`), and that inference is the exploitation +//! signal the fixed-bot ladder structurally hides (it hands over a converged oracle read). +//! +//! Deterministic given a seed. The `micro` prior is a plausible micro-stakes field; Stufe 1 +//! calibrates the archetype weights and spreads to real player data (`lesen/profil.py`, +//! `lesen/gedaechtnis.py`) so the synthetic field matches real humans. + +use super::opponent::Opponent; +use super::reader::{Rules, Style}; +use crate::rng::Rng; + +/// One cluster of the field: a Style's rules as the mean, with a weight (its share of the field). +#[derive(Clone, Copy, Debug)] +pub struct Archetype { + pub label: &'static str, + pub mean: Rules, + pub weight: f64, +} + +/// A drawn opponent: its ruleset plus the hidden archetype it came from. The label is for scoring +/// the engine's inference, never shown to the engine. +#[derive(Clone, Copy, Debug)] +pub struct Draw { + pub rules: Rules, + pub label: &'static str, +} + +impl Draw { + /// The opponent the table plays (read-driven, no authored oracle profile). + pub fn opponent(&self) -> Opponent { + Opponent::Styled(self.rules) + } +} + +/// Per-parameter standard deviation of the within-archetype spread. Kept smaller than the +/// between-archetype distance, so clusters stay distinct but every draw is an individual. +#[derive(Clone, Copy, Debug)] +pub struct Spread { + pub call_margin: f64, + pub raise_at: f64, + pub bet_at: f64, + pub open_at: f64, + pub bluff: f64, + pub size: f64, +} + +impl Spread { + pub const DEFAULT: Spread = Spread { + call_margin: 0.04, + raise_at: 0.05, + bet_at: 0.05, + open_at: 0.05, + bluff: 0.06, + size: 0.12, + }; +} + +#[derive(Clone, Debug)] +pub struct Population { + pub archetypes: Vec, + pub spread: Spread, +} + +impl Population { + /// A plausible micro-stakes field as the starting prior (calibrated later): mostly fish and + /// regs, some nits, a few maniacs. Means are the named `Style` rules. + pub fn micro() -> Population { + Population { + archetypes: vec![ + Archetype { label: "fish", mean: Style::Fish.rules(), weight: 0.35 }, + Archetype { label: "reg", mean: Style::Reg.rules(), weight: 0.30 }, + Archetype { label: "nit", mean: Style::Nit.rules(), weight: 0.20 }, + Archetype { label: "maniac", mean: Style::Maniac.rules(), weight: 0.15 }, + ], + spread: Spread::DEFAULT, + } + } + + /// Draw one opponent: pick an archetype by weight, perturb each threshold by a clamped Gaussian. + pub fn sample(&self, rng: Rng) -> (Draw, Rng) { + let (arch, rng) = self.pick(rng); + let m = arch.mean; + let s = self.spread; + let (call_margin, rng) = jitter(m.call_margin, s.call_margin, 0.0, 0.45, rng); + let (raise_at, rng) = jitter(m.raise_at, s.raise_at, 0.55, 0.97, rng); + let (bet_at, rng) = jitter(m.bet_at, s.bet_at, 0.45, 0.90, rng); + let (open_at, rng) = jitter(m.open_at, s.open_at, 0.45, 0.85, rng); + let (bluff, rng) = jitter(m.bluff, s.bluff, 0.0, 0.60, rng); + let (size, rng) = jitter(m.size, s.size, 0.25, 1.30, rng); + let rules = Rules { call_margin, raise_at, bet_at, open_at, bluff, size }; + (Draw { rules, label: arch.label }, rng) + } + + fn pick(&self, rng: Rng) -> (Archetype, Rng) { + let total: f64 = self.archetypes.iter().map(|a| a.weight).sum::().max(1e-12); + let (u, rng) = rng.unit(); + let mut acc = 0.0; + for a in &self.archetypes { + acc += a.weight / total; + if u <= acc { + return (*a, rng); + } + } + (*self.archetypes.last().expect("non-empty population"), rng) + } +} + +/// A Gaussian jitter around `mean` with sd `sd`, clamped to `[lo, hi]`. Box-Muller from two units. +fn jitter(mean: f64, sd: f64, lo: f64, hi: f64, rng: Rng) -> (f64, Rng) { + let (z, rng) = normal(rng); + ((mean + sd * z).clamp(lo, hi), rng) +} + +fn normal(rng: Rng) -> (f64, Rng) { + let (u1, rng) = rng.unit(); + let (u2, rng) = rng.unit(); + let u1 = u1.max(1e-12); + ((-2.0 * u1.ln()).sqrt() * (std::f64::consts::TAU * u2).cos(), rng) +} + +#[cfg(test)] +mod tests { + use super::*; + + fn draws(pop: &Population, n: usize, seed: u64) -> Vec { + let mut rng = Rng::seeded(seed); + (0..n) + .map(|_| { + let (d, next) = pop.sample(rng); + rng = next; + d + }) + .collect() + } + + #[test] + fn deterministic_given_seed() { + let pop = Population::micro(); + let a = draws(&pop, 100, 7); + let b = draws(&pop, 100, 7); + assert_eq!(a.len(), b.len()); + for (x, y) in a.iter().zip(&b) { + assert_eq!(x.rules, y.rules); + assert_eq!(x.label, y.label); + } + } + + #[test] + fn draws_stay_in_bounds() { + let pop = Population::micro(); + for d in draws(&pop, 5000, 11) { + let r = d.rules; + assert!((0.0..=0.45).contains(&r.call_margin), "{:?}", r); + assert!((0.55..=0.97).contains(&r.raise_at)); + assert!((0.45..=0.90).contains(&r.bet_at)); + assert!((0.45..=0.85).contains(&r.open_at)); + assert!((0.0..=0.60).contains(&r.bluff)); + assert!((0.25..=1.30).contains(&r.size)); + } + } + + #[test] + fn label_frequencies_track_weights() { + let pop = Population::micro(); + let n = 20000; + let ds = draws(&pop, n, 23); + for a in &pop.archetypes { + let share = ds.iter().filter(|d| d.label == a.label).count() as f64 / n as f64; + println!("{}: want {:.2} got {:.3}", a.label, a.weight, share); + assert!((share - a.weight).abs() < 0.03, "{} off: {share:.3}", a.label); + } + } + + #[test] + fn clusters_stay_distinct() { + // Fish call almost anything (tiny call_margin); nits need a big edge. The drawn clusters must + // preserve that ordering on average, else the spread has blurred the archetypes away. + let pop = Population::micro(); + let ds = draws(&pop, 8000, 31); + let mean = |label: &str, f: fn(&Rules) -> f64| { + let v: Vec = ds.iter().filter(|d| d.label == label).map(|d| f(&d.rules)).collect(); + v.iter().sum::() / v.len().max(1) as f64 + }; + let fish_call = mean("fish", |r| r.call_margin); + let nit_call = mean("nit", |r| r.call_margin); + let maniac_bluff = mean("maniac", |r| r.bluff); + let nit_bluff = mean("nit", |r| r.bluff); + println!("call_margin fish {fish_call:.3} < nit {nit_call:.3}; bluff maniac {maniac_bluff:.3} > nit {nit_bluff:.3}"); + assert!(fish_call < nit_call - 0.1, "clusters blurred on call_margin"); + assert!(maniac_bluff > nit_bluff + 0.1, "clusters blurred on bluff"); + } +} diff --git a/src/sim/reader.rs b/src/sim/reader.rs index 52d78746..6f78878d 100644 --- a/src/sim/reader.rs +++ b/src/sim/reader.rs @@ -1,121 +1,148 @@ -//! Opponents that look at their cards: fixed rules on equity against a random hand. Not a model -//! of real players, but they punish what card-blind opponents cannot, such as paying off strong -//! hands or bluffing into a caller. - -use super::opponent::{Act, View}; -use crate::card::{deck, Card}; -use crate::hand::showdown::best; -use crate::rng::Rng; -use crate::variant::HoleUsage; - -/// Boards drawn per strength estimate. -const STRENGTH_SAMPLES: usize = 200; -/// Up to this price (bb) a preflop raise is an open, above it a re-raise. -const OPEN_PRICE: f64 = 1.0; -/// Only hands below this strength bluff. -const BLUFF_BELOW: f64 = 0.45; - -#[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum Style { - Reg, - Nit, - Maniac, - Fish, -} - -/// What the table tells a reading opponent besides the `View`. -#[derive(Clone, Copy, Debug, PartialEq)] -pub struct Reading { - /// Equity against one random hand, 0 to 1. - pub strength: f64, - pub pot: f64, - /// Already in front of it on this street. - pub own_bet: f64, - pub preflop: bool, -} - -struct Rules { - /// Equity it wants above the pot odds to call. - call_margin: f64, - /// Raises a bet from here. - raise_at: f64, - /// Bets when checked to from here. - bet_at: f64, - /// Opens preflop from here. - open_at: f64, - /// How often it bluffs a weak hand when checked to. - bluff: f64, - /// Bet size as a share of the pot after calling. - size: f64, -} - -impl Style { - pub const ALL: [Style; 4] = [Style::Reg, Style::Nit, Style::Maniac, Style::Fish]; - - pub fn name(self) -> &'static str { - match self { - Style::Reg => "reg", - Style::Nit => "nit", - Style::Maniac => "maniac", - Style::Fish => "fish", - } - } - - fn rules(self) -> Rules { - match self { - Style::Reg => Rules { call_margin: 0.22, raise_at: 0.82, bet_at: 0.68, open_at: 0.62, bluff: 0.08, size: 2.0 / 3.0 }, - Style::Nit => Rules { call_margin: 0.32, raise_at: 0.90, bet_at: 0.78, open_at: 0.70, bluff: 0.0, size: 0.5 }, - Style::Maniac => Rules { call_margin: 0.08, raise_at: 0.70, bet_at: 0.55, open_at: 0.52, bluff: 0.35, size: 1.0 }, - Style::Fish => Rules { call_margin: 0.02, raise_at: 0.92, bet_at: 0.80, open_at: 0.78, bluff: 0.02, size: 0.4 }, - } - } - - pub fn act(self, view: View, reading: Reading, rng: Rng) -> (Act, Rng) { - let rules = self.rules(); - let s = reading.strength; - let to_call = view.to_call; - let raise_from = match (reading.preflop && to_call <= OPEN_PRICE, to_call > 0.0) { - (true, _) => rules.open_at, - (false, true) => rules.raise_at, - (false, false) => rules.bet_at, - }; - let raise = Act::RaiseTo(reading.own_bet + to_call + rules.size * (reading.pot + to_call)); - let can_raise = view.min_raise_to.is_some(); - if can_raise && s >= raise_from { - return (raise, rng); - } - if to_call > 0.0 { - let price = to_call / (reading.pot + to_call); - return (if s >= price + rules.call_margin { Act::Call } else { Act::Fold }, rng); - } - if can_raise && !reading.preflop && s < BLUFF_BELOW { - let (u, rng) = rng.unit(); - return (if u < rules.bluff { raise } else { Act::Check }, rng); - } - (Act::Check, rng) - } -} - -/// Equity of `hole` against one random hand, ties counting half; seed-fixed Monte Carlo. -pub fn strength(hole: &[Card], board: &[Card], rng: Rng) -> f64 { - let mut known = hole.to_vec(); - known.extend_from_slice(board); - let pool = deck::without(&known); - let missing = 5 - board.len(); - let mut rng = rng; - let mut won = 0.0; - for _ in 0..STRENGTH_SAMPLES { - let (cards, next) = deck::draw(&pool, 2 + missing, rng).expect("enough cards"); - rng = next; - let mut full = board.to_vec(); - full.extend_from_slice(&cards[2..]); - let mine = best(HoleUsage::BestFiveOfAll, hole, &full).expect("valid cards"); - let theirs = best(HoleUsage::BestFiveOfAll, &cards[..2], &full).expect("valid cards"); - won += match mine.cmp(&theirs) { - std::cmp::Ordering::Greater => 1.0, - std::cmp::Ordering::Equal => 0.5, - std::cmp::Ordering::Less => 0.0, - }; - } - won / STRENGTH_SAMPLES as f64 -} +//! Opponents that look at their cards: fixed rules on equity against a random hand. Not a model +//! of real players, but they punish what card-blind opponents cannot, such as paying off strong +//! hands or bluffing into a caller. + +use super::opponent::{Act, View}; +use crate::card::{deck, Card}; +use crate::hand::showdown::best; +use crate::rng::Rng; +use crate::variant::HoleUsage; + +/// Boards drawn per strength estimate. +const STRENGTH_SAMPLES: usize = 200; +/// Up to this price (bb) a preflop raise is an open, above it a re-raise. +const OPEN_PRICE: f64 = 1.0; +/// Only hands below this strength bluff. +const BLUFF_BELOW: f64 = 0.45; + +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum Style { + Reg, + Nit, + Maniac, + Fish, + /// Near-GTO range player; its real play lives in `sim::gto` (needs the table context). + Gto, + /// A second balanced range player: small-ball, half-pot, value-leaning (`sim::gto`, `Shape::SMALL`). + /// An independent balanced target so a defensive fix must generalise, not overfit the one `Gto`. + GtoSmall, +} + +/// What the table tells a reading opponent besides the `View`. +#[derive(Clone, Copy, Debug, PartialEq)] +pub struct Reading { + /// Equity against one random hand, 0 to 1. + pub strength: f64, + pub pot: f64, + /// Already in front of it on this street. + pub own_bet: f64, + pub preflop: bool, +} + +/// The six thresholds that define a reading opponent's whole play. A named `Style` is one point in +/// this space; the synthetic population (`sim::population`) draws arbitrary points around the style +/// means, so one ruleset = one individual opponent. All fields public so the population can build them. +#[derive(Clone, Copy, Debug, PartialEq)] +pub struct Rules { + /// Equity it wants above the pot odds to call. + pub call_margin: f64, + /// Raises a bet from here. + pub raise_at: f64, + /// Bets when checked to from here. + pub bet_at: f64, + /// Opens preflop from here. + pub open_at: f64, + /// How often it bluffs a weak hand when checked to. + pub bluff: f64, + /// Bet size as a share of the pot after calling. + pub size: f64, +} + +impl Style { + pub const ALL: [Style; 4] = [Style::Reg, Style::Nit, Style::Maniac, Style::Fish]; + + pub fn name(self) -> &'static str { + match self { + Style::Reg => "reg", + Style::Nit => "nit", + Style::Maniac => "maniac", + Style::Fish => "fish", + Style::Gto => "gto", + Style::GtoSmall => "gto-small", + } + } + + /// The betting shape for the two balanced range players, `None` for the threshold styles. + pub fn gto_shape(self) -> Option { + match self { + Style::Gto => Some(super::gto::Shape::BALANCED), + Style::GtoSmall => Some(super::gto::Shape::SMALL), + _ => None, + } + } + + pub fn rules(self) -> Rules { + match self { + Style::Reg => Rules { call_margin: 0.22, raise_at: 0.82, bet_at: 0.68, open_at: 0.62, bluff: 0.08, size: 2.0 / 3.0 }, + Style::Nit => Rules { call_margin: 0.32, raise_at: 0.90, bet_at: 0.78, open_at: 0.70, bluff: 0.0, size: 0.5 }, + Style::Maniac => Rules { call_margin: 0.08, raise_at: 0.70, bet_at: 0.55, open_at: 0.52, bluff: 0.35, size: 1.0 }, + // Stand-in only: the table plays `Gto`/`GtoSmall` through `sim::gto`, not these thresholds. + Style::Gto | Style::GtoSmall => Rules { call_margin: 0.22, raise_at: 0.82, bet_at: 0.68, open_at: 0.62, bluff: 0.08, size: 2.0 / 3.0 }, + Style::Fish => Rules { call_margin: 0.02, raise_at: 0.92, bet_at: 0.80, open_at: 0.78, bluff: 0.02, size: 0.4 }, + } + } + + pub fn act(self, view: View, reading: Reading, rng: Rng) -> (Act, Rng) { + act_with(self.rules(), view, reading, rng) + } +} + +/// Play an explicit ruleset (the behaviour of any drawn opponent, not only a named `Style`). Same +/// threshold logic `Style::act` used; lifted out so the population can drive arbitrary `Rules`. +pub fn act_with(rules: Rules, view: View, reading: Reading, rng: Rng) -> (Act, Rng) { + let s = reading.strength; + let to_call = view.to_call; + let raise_from = match (reading.preflop && to_call <= OPEN_PRICE, to_call > 0.0) { + (true, _) => rules.open_at, + (false, true) => rules.raise_at, + (false, false) => rules.bet_at, + }; + let raise = Act::RaiseTo(reading.own_bet + to_call + rules.size * (reading.pot + to_call)); + let can_raise = view.min_raise_to.is_some(); + if can_raise && s >= raise_from { + return (raise, rng); + } + if to_call > 0.0 { + let price = to_call / (reading.pot + to_call); + return (if s >= price + rules.call_margin { Act::Call } else { Act::Fold }, rng); + } + if can_raise && !reading.preflop && s < BLUFF_BELOW { + let (u, rng) = rng.unit(); + return (if u < rules.bluff { raise } else { Act::Check }, rng); + } + (Act::Check, rng) +} + +/// Equity of `hole` against one random hand, ties counting half; seed-fixed Monte Carlo. +pub fn strength(hole: &[Card], board: &[Card], rng: Rng) -> f64 { + let mut known = hole.to_vec(); + known.extend_from_slice(board); + let pool = deck::without(&known); + let missing = 5 - board.len(); + let mut rng = rng; + let mut won = 0.0; + for _ in 0..STRENGTH_SAMPLES { + let (cards, next) = deck::draw(&pool, 2 + missing, rng).expect("enough cards"); + rng = next; + let mut full = board.to_vec(); + full.extend_from_slice(&cards[2..]); + let mine = best(HoleUsage::BestFiveOfAll, hole, &full).expect("valid cards"); + let theirs = best(HoleUsage::BestFiveOfAll, &cards[..2], &full).expect("valid cards"); + won += match mine.cmp(&theirs) { + std::cmp::Ordering::Greater => 1.0, + std::cmp::Ordering::Equal => 0.5, + std::cmp::Ordering::Less => 0.0, + }; + } + won / STRENGTH_SAMPLES as f64 +} diff --git a/src/sim/reads.rs b/src/sim/reads.rs index 44a14169..acb52fb8 100644 --- a/src/sim/reads.rs +++ b/src/sim/reads.rs @@ -1,37 +1,46 @@ -//! The read a converged HUD would show for each fixed opponent. The ladder plays the engine against -//! behavioural opponents; to measure the EXPLOIT brain the engine must also SEE them, the way it sees -//! vpip/pfr/foldToBet/aggression at a real table. These are representative, stable profiles for each -//! archetype (a long session converges to them, since the sim opponents are fixed-style), so the -//! engine's opponent classification (`exploit::style::classify`) lands on the matching style. -//! -//! `RandomLegal` has no coherent style, so it carries no read (the engine plays it blind). - -use super::opponent::Opponent; -use super::reader::Style; -use crate::exploit::profile::Profile; - -fn p(vpip: f64, pfr: f64, fold_to_bet: f64, aggression: f64) -> Option { - Some(Profile { - vpip: Some(vpip), - pfr: Some(pfr), - fold_to_bet: Some(fold_to_bet), - aggression: Some(aggression), - ..Profile::default() - }) -} - -/// The HUD read the engine is handed for this opponent, or `None` when the opponent has no readable -/// style. The Reader values are MEASURED from the opponents' own play (`tests/sim_opponent_stats`), -/// not guessed, so the ladder feeds the engine the truth: the reg folds a lot and is passive, the -/// nit is very tight, the maniac is loose and aggressive, the fish calls almost everything. -pub fn opponent_profile(opponent: Opponent) -> Option { - match opponent { - Opponent::CallingStation => p(0.98, 0.00, 0.02, 0.02), - Opponent::Folder => p(0.02, 0.00, 0.98, 0.00), - Opponent::RandomLegal => None, - Opponent::Reader(Style::Reg) => p(0.31, 0.13, 0.72, 0.25), - Opponent::Reader(Style::Nit) => p(0.06, 0.03, 0.82, 0.12), - Opponent::Reader(Style::Maniac) => p(0.76, 0.42, 0.50, 0.50), - Opponent::Reader(Style::Fish) => p(0.93, 0.01, 0.40, 0.08), - } -} +//! The read a converged HUD would show for each fixed opponent. The ladder plays the engine against +//! behavioural opponents; to measure the EXPLOIT brain the engine must also SEE them, the way it sees +//! vpip/pfr/foldToBet/aggression at a real table. These are representative, stable profiles for each +//! archetype (a long session converges to them, since the sim opponents are fixed-style), so the +//! engine's opponent classification (`exploit::style::classify`) lands on the matching style. +//! +//! `RandomLegal` has no coherent style, so it carries no read (the engine plays it blind). + +use super::opponent::Opponent; +use super::reader::Style; +use crate::exploit::profile::Profile; + +fn p(vpip: f64, pfr: f64, fold_to_bet: f64, aggression: f64) -> Option { + Some(Profile { + vpip: Some(vpip), + pfr: Some(pfr), + fold_to_bet: Some(fold_to_bet), + aggression: Some(aggression), + ..Profile::default() + }) +} + +/// The HUD read the engine is handed for this opponent, or `None` when the opponent has no readable +/// style. The Reader values are MEASURED from the opponents' own play (`tests/sim_opponent_stats`), +/// not guessed, so the ladder feeds the engine the truth: the reg folds a lot and is passive, the +/// nit is very tight, the maniac is loose and aggressive, the fish calls almost everything. +pub fn opponent_profile(opponent: Opponent) -> Option { + match opponent { + Opponent::CallingStation => p(0.98, 0.00, 0.02, 0.02), + Opponent::Folder => p(0.02, 0.00, 0.98, 0.00), + Opponent::RandomLegal => None, + // A drawn opponent has no authored oracle read on purpose: the lab forces the engine to + // INFER the type from observed actions (that inference IS the exploitation signal). + Opponent::Styled(_) => None, + Opponent::Reader(Style::Reg) => p(0.31, 0.13, 0.72, 0.25), + Opponent::Reader(Style::Nit) => p(0.06, 0.03, 0.82, 0.12), + Opponent::Reader(Style::Maniac) => p(0.76, 0.42, 0.50, 0.50), + Opponent::Reader(Style::Fish) => p(0.93, 0.01, 0.40, 0.08), + // Balanced: folds to a bet about as often as the minimum-defence share allows, bets as often + // as it calls. Reads as a plain regular (the engine's no-exploit class), which is the truth. + Opponent::Reader(Style::Gto) => p(0.32, 0.22, 0.42, 0.40), + // The small-ball balanced twin: a touch tighter and less aggressive (half-pot value lean), + // still a plain regular. Its read, like the Gto's, is gated blind for the range model. + Opponent::Reader(Style::GtoSmall) => p(0.30, 0.22, 0.46, 0.36), + } +} diff --git a/src/sim/sequential.rs b/src/sim/sequential.rs new file mode 100644 index 00000000..5ad0c888 --- /dev/null +++ b/src/sim/sequential.rs @@ -0,0 +1,245 @@ +//! Anytime-valid confidence sequence for a streaming mean, so the ladder can PEEK after every deal +//! and stop the moment a paired difference is decisive -- without the optional-stopping inflation +//! that quietly invalidates a fixed-n 95 % interval the instant you look at it early. +//! +//! # Why not a fixed-n CI, and why not a classic SPRT +//! +//! A fixed-n CI (`sim::paired`) is only valid at the ONE n it was computed for; stop as soon as it +//! looks significant and the true type-I error balloons. Wald's SPRT fixes the peeking but assumes a +//! KNOWN variance and a simple-vs-simple hypothesis -- neither holds for bb-per-deal. The modern, +//! correct instrument is a time-uniform confidence sequence: an interval valid SIMULTANEOUSLY at +//! every n, so you may watch it continuously and stop at any rule you like. +//! +//! # The boundary (derived, not recited) +//! +//! For increments `X_i - mu` with variance proxy `s2`, `M_n(lam) = exp(lam*S_n - lam^2*s2*n/2)` is a +//! supermartingale with mean 1 (`S_n = sum(X_i - mu)`). Mix `lam ~ N(0, 1/(rho*s2))` and integrate: +//! +//! M_n = sqrt( rho/(n+rho) ) * exp( S_n^2 / (2*s2*(n+rho)) ). +//! +//! Ville's inequality gives `P(exists n: M_n >= 1/a) <= a`. Setting `M_n >= 1/a` and solving for S_n: +//! +//! |S_n| < sqrt( 2*s2*(n+rho) * [ ln(1/a) + 0.5*ln((n+rho)/rho) ] ) (each side; use a = alpha/2). +//! +//! Divide by n for the mean. `rho` sets where the boundary is tightest (near `rho` samples); pick it +//! at the expected horizon. With a KNOWN sub-Gaussian `s2` the coverage is exact; we plug in the +//! running sample variance, so the guarantee is asymptotic -- `tests` checks the real miscoverage +//! under optional stopping stays at or below the nominal level. The rigorous fixed-sample-size-free +//! upgrade for unknown variance is the self-normalised (Student) mixture; noted, not yet built. + +/// What a peek concludes. `Continue` = not yet separated from zero; the caller stops on +/// `Better`/`Worse` or when it runs out of deals (then the result is simply unclear). +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum Decision { + /// The whole confidence sequence lies above the threshold. + Better, + /// The whole confidence sequence lies below the threshold. + Worse, + /// Zero (or the threshold) is still inside: keep sampling. + Continue, +} + +/// A running normal-mixture confidence sequence over a stream of per-deal values. +#[derive(Clone, Debug)] +pub struct ConfSeq { + n: u64, + sum: f64, + sumsq: f64, + /// Ville error budget per side; the two-sided sequence holds at level `2*alpha_side`. + alpha_side: f64, + /// Mixture tightness: boundary is sharpest near `rho` samples. + rho: f64, + /// Variance floor, so an all-identical prefix cannot claim a zero-width interval. + var_floor: f64, +} + +impl ConfSeq { + /// Two-sided level `alpha` (e.g. 0.05), boundary tuned to be sharpest near `horizon` samples. + pub fn new(alpha: f64, horizon: u64) -> ConfSeq { + ConfSeq { + n: 0, + sum: 0.0, + sumsq: 0.0, + alpha_side: (alpha / 2.0).clamp(1e-9, 0.5), + rho: (horizon.max(1)) as f64, + var_floor: 1e-9, + } + } + + pub fn push(&mut self, x: f64) { + self.n += 1; + self.sum += x; + self.sumsq += x * x; + } + + pub fn count(&self) -> u64 { + self.n + } + + pub fn mean(&self) -> f64 { + if self.n == 0 { + 0.0 + } else { + self.sum / self.n as f64 + } + } + + /// Unbiased sample variance, floored. + fn var(&self) -> f64 { + if self.n < 2 { + return f64::INFINITY; + } + let n = self.n as f64; + let m = self.sum / n; + ((self.sumsq - n * m * m) / (n - 1.0)).max(self.var_floor) + } + + /// Half-width of the time-uniform interval around the running mean (input units). Infinite until + /// two samples exist. + pub fn radius(&self) -> f64 { + let s2 = self.var(); + if !s2.is_finite() { + return f64::INFINITY; + } + let n = self.n as f64; + let nr = n + self.rho; + let log_term = (1.0 / self.alpha_side).ln() + 0.5 * (nr / self.rho).ln(); + (2.0 * s2 * nr * log_term).sqrt() / n + } + + /// Time-uniform confidence interval for the true mean: holds simultaneously at every `n`. + pub fn interval(&self) -> (f64, f64) { + let (m, r) = (self.mean(), self.radius()); + (m - r, m + r) + } + + /// Decide against a threshold (0.0 for "is the difference positive?"). `Better` once the whole + /// interval sits above `threshold`, `Worse` once wholly below, else `Continue`. + pub fn decide(&self, threshold: f64) -> Decision { + let (lo, hi) = self.interval(); + if !lo.is_finite() { + return Decision::Continue; + } + if lo > threshold { + Decision::Better + } else if hi < threshold { + Decision::Worse + } else { + Decision::Continue + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + + struct Lcg(u64); + impl Lcg { + fn unif(&mut self) -> f64 { + self.0 = self.0.wrapping_mul(6364136223846793005).wrapping_add(1442695040888963407); + ((self.0 >> 11) as f64 + 0.5) / (1u64 << 53) as f64 + } + fn normal(&mut self) -> f64 { + (-2.0 * self.unif().ln()).sqrt() * (6.2831853071 * self.unif()).cos() + } + } + + /// The defining guarantee: under optional stopping the true mean escapes the sequence at MOST a + /// 5 % fraction of runs, no matter how adversarially you peek. We peek after every sample and + /// record the worst-ever excursion over a long horizon. + #[test] + fn time_uniform_coverage_under_peeking() { + let (alpha, runs, horizon) = (0.05, 4000usize, 3000u64); + let (mu, sigma) = (0.3, 10.0); // bb-per-deal-ish: tiny edge, huge spread + let mut escaped = 0; + for k in 0..runs { + let mut r = Lcg(0xC0FFEE + k as u64); + let mut cs = ConfSeq::new(alpha, horizon); + let mut ever_out = false; + for _ in 0..horizon { + cs.push(mu + sigma * r.normal()); + let (lo, hi) = cs.interval(); + if lo.is_finite() && (mu < lo || mu > hi) { + ever_out = true; + break; + } + } + escaped += ever_out as usize; + } + let rate = escaped as f64 / runs as f64; + println!("peeking miscoverage {:.3} (nominal {:.3}) over {runs} runs x {horizon}", rate, alpha); + // Time-uniform: the ALL-TIMES escape rate must not exceed the nominal per-interval level + // (small plug-in slack allowed; the mixture is conservative, so it usually sits well under). + assert!(rate <= alpha * 1.3, "miscoverage {rate:.3} over budget"); + } + + /// Power: on a clear edge the sequence separates from zero, and far inside the horizon. + #[test] + fn stops_early_on_a_clear_edge() { + let (alpha, horizon) = (0.05, 5000u64); + let (mu, sigma) = (2.0, 8.0); + let mut r = Lcg(7); + let mut cs = ConfSeq::new(alpha, horizon); + let mut stopped_at = None; + for i in 1..=horizon { + cs.push(mu + sigma * r.normal()); + if cs.decide(0.0) == Decision::Better { + stopped_at = Some(i); + break; + } + } + let n = stopped_at.expect("never separated from zero"); + println!("separated from 0 after {n} deals (horizon {horizon})"); + assert!(n < horizon, "no early stop"); + } + + /// A true zero edge must NOT be declared better or worse just because we watched a long time. + #[test] + fn null_edge_rarely_fires() { + let (alpha, runs, horizon) = (0.05, 2000usize, 2000u64); + let mut fired = 0; + for k in 0..runs { + let mut r = Lcg(555 + k as u64); + let mut cs = ConfSeq::new(alpha, horizon); + let mut hit = false; + for _ in 0..horizon { + cs.push(7.0 * r.normal()); // mu = 0 exactly + match cs.decide(0.0) { + Decision::Better | Decision::Worse => { + hit = true; + break; + } + Decision::Continue => {} + } + } + fired += hit as usize; + } + let rate = fired as f64 / runs as f64; + println!("false-decision rate under the null {:.3} (nominal {:.3})", rate, alpha); + assert!(rate <= alpha * 1.3, "fires too often under the null: {rate:.3}"); + } + + /// Radius follows a sqrt(log n / n) envelope: it wiggles with the online variance estimate but + /// shrinks decisively over the run. We check the envelope at checkpoints, not per-step monotony + /// (the running s^2 ticks both ways, so a strict per-step drop is the wrong thing to demand). + #[test] + fn radius_follows_shrinking_envelope() { + let mut r = Lcg(99); + let mut cs = ConfSeq::new(0.05, 1000); + let mut at: std::collections::BTreeMap = Default::default(); + for i in 1..=4000u64 { + cs.push(1.0 + 5.0 * r.normal()); + if [100, 500, 2000, 4000].contains(&i) { + at.insert(i, cs.radius()); + } + } + println!("radius: {:?}", at.iter().map(|(n, r)| (n, (r * 1e3).round() / 1e3)).collect::>()); + // Each checkpoint strictly tighter than the last: the envelope wins over the variance wiggle. + assert!(at[&500] < at[&100], "500 vs 100"); + assert!(at[&2000] < at[&500], "2000 vs 500"); + assert!(at[&4000] < at[&2000], "4000 vs 2000"); + // Shape: halving n near-doubles... the radius should fall by a clear factor over 40x data. + assert!(at[&4000] < 0.6 * at[&100], "envelope barely moved"); + } +} diff --git a/src/sim/session.rs b/src/sim/session.rs index 8d6325a0..67766613 100644 --- a/src/sim/session.rs +++ b/src/sim/session.rs @@ -1,11 +1,24 @@ +use super::memory::SessionMemory; use super::opponent::Opponent; -use super::table::{deal, play_hand_at, HandSetup, TableCost}; +use super::table::{deal, play_hand_tracked, HandRead, HandSetup, TableCost}; use crate::rng::Rng; use std::fmt; /// 95 % two-sided normal quantile. const Z95: f64 = 1.959_964; +/// How the engine gets its read on the opponent for a scenario. +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ReadMode { + /// The converged HUD read (`sim::reads`): the exploit brain, the upper bound. + Oracle, + /// No read at all: the no-read baseline a memory / probe must improve on. + Blind, + /// Build the read from the opponent's observed actions over the session (`sim::memory`): starts + /// blind, converges toward the oracle. Lands between `Blind` and `Oracle` on the ladder. + Memory, +} + #[derive(Clone, Copy, Debug, PartialEq)] pub struct Setup { pub players: u8, @@ -14,6 +27,8 @@ pub struct Setup { pub deals: u32, pub stack_bb: f64, pub seed: u64, + /// How the engine is read into the opponent (oracle / blind / memory). See `ReadMode`. + pub read: ReadMode, } #[derive(Clone, Copy, Debug, PartialEq)] @@ -68,16 +83,26 @@ pub fn measure(setup: &Setup) -> Measurement { /// of what `cost` takes. A sample is one deal's mean over the seats, so position and card luck /// cancel within it. pub fn measure_at(setup: &Setup, cost: TableCost) -> Measurement { - deal_samples_at(setup, cost).1 + deal_samples_at(setup, cost).2 } /// Hero's luck-corrected result per deal in bb at the free table, for paired comparisons, with /// the measurement. pub fn deal_samples(setup: &Setup) -> (Vec, Measurement) { - deal_samples_at(setup, TableCost::FREE) + let (corrected, _, m) = deal_samples_at(setup, TableCost::FREE); + (corrected, m) } -fn deal_samples_at(setup: &Setup, cost: TableCost) -> (Vec, Measurement) { +/// Per-deal (net result `y`, luck control signal `c`) at the free table. `c` has expectation ~0, +/// so `y - beta*c` is unbiased for any beta; `y - c` (beta=1) is the sample the ladder stores. +/// For analysing the estimator itself (control-variate / AIVAT): see `src/bin/aivat_bench.rs`. +pub fn deal_net_and_luck(setup: &Setup) -> (Vec, Vec) { + let (corrected, raw, _) = deal_samples_at(setup, TableCost::FREE); + let luck = raw.iter().zip(&corrected).map(|(r, c)| r - c).collect(); + (raw, luck) +} + +fn deal_samples_at(setup: &Setup, cost: TableCost) -> (Vec, Vec, Measurement) { let players = setup.players; let mut samples = Vec::with_capacity(setup.deals as usize); let mut raw_samples = Vec::with_capacity(setup.deals as usize); @@ -93,17 +118,29 @@ fn deal_samples_at(setup: &Setup, cost: TableCost) -> (Vec, Measurement) { rake_bb_per_100: 0.0, }; let mut rake = 0.0; + // The memory accumulates across every hand of the session, in order; unused in the other modes. + let mut memory = SessionMemory::new(); for d in 0..setup.deals { let (cards, _) = deal(players as usize, Rng::seeded(mix(setup.seed, d as u64))); let (mut sum, mut raw) = (0.0, 0.0); for hero_seat in 1..=players { - let r = play_hand_at(&HandSetup { + // The read for this hand: oracle, blind, or the memory's snapshot BEFORE the hand plays. + let read = match setup.read { + ReadMode::Oracle => HandRead::Oracle, + ReadMode::Blind => HandRead::Given(None), + ReadMode::Memory => HandRead::Given(memory.read()), + }; + let hand = HandSetup { deal: &cards, hero_seat, opponent: setup.opponent, stack_bb: setup.stack_bb, seed: mix(setup.seed ^ 0xA5A5, (d as u64) << 8 | hero_seat as u64), - }, cost); + read, + }; + // Only the memory mode feeds the hand back into the accumulator afterwards. + let track = (setup.read == ReadMode::Memory).then_some(&mut memory); + let r = play_hand_tracked(&hand, cost, track); rake += r.rake; sum += r.hero_net - r.luck; raw += r.hero_net; @@ -118,7 +155,7 @@ fn deal_samples_at(setup: &Setup, cost: TableCost) -> (Vec, Measurement) { m.rake_bb_per_100 = 100.0 * rake / m.hands.max(1) as f64; (m.bb_per_100, m.ci95) = rate(&samples); (m.raw_bb_per_100, m.raw_ci95) = rate(&raw_samples); - (samples, m) + (samples, raw_samples, m) } /// Mean and 95 % half width of per-deal results, both in bb/100. diff --git a/src/sim/simreal.rs b/src/sim/simreal.rs new file mode 100644 index 00000000..ab065a61 --- /dev/null +++ b/src/sim/simreal.rs @@ -0,0 +1,167 @@ +//! Stufe 4 of the synthetic lab, the OFFLINE half: the sim-to-real gap in observable space. +//! +//! The lab is only as good as its population `P(θ)`. Stufe 1 fits the population's archetype weights to +//! real players; this module measures the OTHER direction — what HUD distribution the synthetic +//! population *induces*, so it can be held against the real one. The truth→observation link +//! (`sim::reads::opponent_profile`, hand-eyed in `tests/sim_opponent_stats`) is here generalised from +//! "five fixed styles" to "any drawn ruleset", so a whole drawn population can be run through it and its +//! induced vpip / pfr / fold-to-bet / aggression distribution reported. +//! +//! The gap that remains genuinely LIVE — running the engine against real humans and comparing outcomes +//! (the `COINPOKER_KERN` A/B over `betrieb/runner.py`) — needs the live farm and is not buildable here. +//! This module builds everything that can be measured offline: does our synthetic field even *look* +//! like real players through a HUD? If the induced distribution misses the real one, no amount of +//! in-lab EV is trustworthy, and this says so before a single live hand is played. + +use super::population::Population; +use super::reader::{act_with, Reading, Rules}; +use super::opponent::{Act, View}; +use crate::card::{deck, Card}; +use crate::rng::Rng; + +/// The four HUD numbers a ruleset induces over many random hands — the same axes `exploit::profile` +/// and `sim::memory` speak in. +#[derive(Clone, Copy, Debug, PartialEq)] +pub struct Hud { + pub vpip: f64, + pub pfr: f64, + pub fold_to_bet: f64, + pub aggression: f64, +} + +fn hole_and_flop(rng: Rng) -> (Vec, Vec, Rng) { + let (cards, rng) = deck::draw(&deck::full(), 5, rng).expect("deck"); + (cards[..2].to_vec(), cards[2..5].to_vec(), rng) +} + +/// Measure the HUD a ruleset induces, over `n` random hands at the same canonical spots the oracle +/// reads were eyed at (`tests/sim_opponent_stats`): a preflop open, a postflop spot facing a +/// two-thirds bet, and a postflop checked-to spot. +pub fn induced_hud(rules: Rules, n: usize, seed: u64) -> Hud { + let mut rng = Rng::seeded(seed); + let (mut vpip, mut pfr, mut faced, mut folds, mut aggr, mut acts) = + (0u32, 0u32, 0u32, 0u32, 0u32, 0u32); + let preflop_view = View { to_call: 0.5, min_raise_to: Some(2.0), max_raise_to: Some(100.0) }; + let facing_view = View { to_call: 4.0, min_raise_to: Some(8.0), max_raise_to: Some(100.0) }; + let checked_view = View { to_call: 0.0, min_raise_to: Some(4.0), max_raise_to: Some(100.0) }; + for _ in 0..n { + let (hole, flop, next) = hole_and_flop(rng); + rng = next; + let pre = super::reader::strength(&hole, &[], Rng::seeded(rng.below(u64::MAX).0)); + let post = super::reader::strength(&hole, &flop, Rng::seeded(rng.below(u64::MAX).0)); + + let (a, r) = act_with(rules, preflop_view, Reading { strength: pre, pot: 1.0, own_bet: 0.5, preflop: true }, rng); + rng = r; + match a { + Act::RaiseTo(_) => { + vpip += 1; + pfr += 1; + } + Act::Call => vpip += 1, + _ => {} + } + + let (a, r) = act_with(rules, facing_view, Reading { strength: post, pot: 6.0, own_bet: 0.0, preflop: false }, rng); + rng = r; + faced += 1; + match a { + Act::Fold => folds += 1, + Act::RaiseTo(_) => { + aggr += 1; + acts += 1; + } + _ => acts += 1, + } + + let (a, r) = act_with(rules, checked_view, Reading { strength: post, pot: 6.0, own_bet: 0.0, preflop: false }, rng); + rng = r; + match a { + Act::RaiseTo(_) => { + aggr += 1; + acts += 1; + } + _ => acts += 1, + } + } + let f = |x: u32, d: u32| if d == 0 { 0.0 } else { x as f64 / d as f64 }; + Hud { + vpip: f(vpip, n as u32), + pfr: f(pfr, n as u32), + fold_to_bet: f(folds, faced), + aggression: f(aggr, acts), + } +} + +/// Mean and sample sd of each HUD axis across the induced HUDs of `draws` drawn opponents — the +/// synthetic field's fingerprint in observable space. +#[derive(Clone, Debug)] +pub struct HudDistribution { + pub draws: usize, + pub mean: Hud, + pub sd: Hud, +} + +fn mean_sd(v: &[f64]) -> (f64, f64) { + let n = v.len().max(1) as f64; + let m = v.iter().sum::() / n; + let var = v.iter().map(|x| (x - m).powi(2)).sum::() / (n - 1.0).max(1.0); + (m, var.sqrt()) +} + +/// The induced-HUD distribution of a whole drawn population: draw `draws` opponents, measure each +/// one's induced HUD over `hands_each` hands, and report the per-axis mean and spread. +pub fn population_induced_hud( + pop: &Population, + draws: usize, + hands_each: usize, + seed: u64, +) -> HudDistribution { + let mut rng = Rng::seeded(seed); + let (mut vp, mut pf, mut fb, mut ag) = (Vec::new(), Vec::new(), Vec::new(), Vec::new()); + for k in 0..draws { + let (draw, next) = pop.sample(rng); + rng = next; + let h = induced_hud(draw.rules, hands_each, seed ^ (k as u64 + 1).wrapping_mul(0x9E37_79B9)); + vp.push(h.vpip); + pf.push(h.pfr); + fb.push(h.fold_to_bet); + ag.push(h.aggression); + } + let (vpm, vps) = mean_sd(&vp); + let (pfm, pfs) = mean_sd(&pf); + let (fbm, fbs) = mean_sd(&fb); + let (agm, ags) = mean_sd(&ag); + HudDistribution { + draws, + mean: Hud { vpip: vpm, pfr: pfm, fold_to_bet: fbm, aggression: agm }, + sd: Hud { vpip: vps, pfr: pfs, fold_to_bet: fbs, aggression: ags }, + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::sim::reader::Style; + + #[test] + fn induced_hud_orders_the_styles_as_expected() { + // Fish play nearly everything (high vpip); nits almost nothing. The induced HUD must preserve + // that — the truth→observation link is monotone. + let fish = induced_hud(Style::Fish.rules(), 4000, 0x5EED_0001); + let nit = induced_hud(Style::Nit.rules(), 4000, 0x5EED_0001); + println!("fish {:?}\nnit {:?}", fish, nit); + assert!(fish.vpip > nit.vpip + 0.1, "fish should be far looser than a nit"); + assert!((0.0..=1.0).contains(&fish.aggression)); + } + + #[test] + fn population_induced_hud_is_finite_and_bounded() { + let pop = Population::micro(); + let d = population_induced_hud(&pop, 40, 1500, 0x5EED_0001); + println!("induced HUD mean {:?}\n sd {:?}", d.mean, d.sd); + for x in [d.mean.vpip, d.mean.pfr, d.mean.fold_to_bet, d.mean.aggression] { + assert!((0.0..=1.0).contains(&x)); + } + assert!(d.sd.vpip >= 0.0); + } +} diff --git a/src/sim/table.rs b/src/sim/table.rs index 91c497e4..5f65a819 100644 --- a/src/sim/table.rs +++ b/src/sim/table.rs @@ -1,422 +1,562 @@ -//! One hand of No-Limit Hold'em at a table of 2-10 seats: the engine on one seat, a fixed -//! opponent on all others. Seat 1 is the button; heads-up the button posts the small blind. -//! Big blind 1, small blind 0.5, everybody starts with `stack_bb`. Rake and antes come from -//! `TableCost`; `play_hand` is the free table. The rake leaves the table: the players' results -//! then sum to minus the rake. Antes are dead money in the pot and no part of a street's bet. - -use super::luck; -use super::opponent::{Act, Opponent, View}; -use super::reader::{strength, Reading}; -use crate::card::{deck, Card}; -use crate::engine::decide::decide; -use crate::game::{ActionKind, ActionRecord, Choice, SeenAction, Spot, Street, Villain}; -use crate::guard::validate::check; -use crate::hand::showdown::best; -use crate::rake::{split_over_pots, uncalled, HandEnd, RakeRule, MEASURED_ANTE_BB}; -use crate::rng::Rng; -use crate::variant::{HoleUsage, Variant}; - -const SMALL_BLIND: f64 = 0.5; -const BIG_BLIND: f64 = 1.0; -const EPS: f64 = 1e-9; - -/// What a table takes besides the blinds. -#[derive(Clone, Copy, Debug, PartialEq)] -pub struct TableCost { - /// Per player, in big blinds. - pub ante_bb: f64, - pub rake: Option, -} - -impl TableCost { - pub const FREE: TableCost = TableCost { ante_bb: 0.0, rake: None }; - /// The table measured in `rake`: ante 0.16 bb, 5 % capped at 1 bb. - pub const MEASURED: TableCost = TableCost { ante_bb: MEASURED_ANTE_BB, rake: Some(RakeRule::MEASURED_BB) }; -} - -/// Cards for one hand: `holes[seat - 1]` and the full board in deal order. -#[derive(Clone, Debug, PartialEq)] -pub struct Deal { - pub holes: Vec<[Card; 2]>, - pub board: [Card; 5], -} - -pub fn deal(players: usize, rng: Rng) -> (Deal, Rng) { - let (cards, rng) = deck::draw(&deck::full(), 2 * players + 5, rng).expect("at most 10 players"); - let holes = cards.chunks(2).take(players).map(|c| [c[0], c[1]]).collect(); - let board = cards[2 * players..].try_into().expect("five board cards"); - (Deal { holes, board }, rng) -} - -pub struct HandSetup<'a> { - pub deal: &'a Deal, - pub hero_seat: u8, - pub opponent: Opponent, - pub stack_bb: f64, - /// Seeds the opponents' choices and the engine's `seed` field. - pub seed: u64, -} - -#[derive(Clone, Copy, Debug, PartialEq)] -pub struct HandResult { - /// Hero's result in big blinds. - pub hero_net: f64, - pub hero_decisions: u32, - /// Hero answered ABSTAIN; the table then checks, or folds when there is a price. - pub abstains: u32, - /// Requests the guard refused: a simulator bug, must stay 0. - pub invalid: u32, - /// Sum of all players' results plus the rake; must be 0. - pub chips_lost: f64, - /// Rake of the hand, big blinds. - pub rake: f64, - /// What the board cards decided (see `sim::luck`); expectation 0. - pub luck: f64, -} - -struct Table<'a> { - setup: &'a HandSetup<'a>, - cost: TableCost, - hero: usize, - stack: Vec, - bet: Vec, - total: Vec, - folded: Vec, - street: Street, - max_bet: f64, - last_raise: f64, - history: Vec, - rng: Rng, - result: HandResult, -} - -impl Table<'_> { - fn players(&self) -> usize { - self.stack.len() - } - - /// Hero's expected share of the current pot with `cards` board cards known. - fn value(&self, cards: usize) -> f64 { - if self.folded[self.hero] { - return 0.0; - } - let live: Vec = (0..self.players()).filter(|i| !self.folded[*i]).collect(); - let holes: Vec<[Card; 2]> = live.iter().map(|i| self.setup.deal.holes[*i]).collect(); - let hero = live.iter().position(|i| *i == self.hero).expect("hero is live"); - let dead: Vec = self.setup.deal.holes.iter().flatten().copied().collect(); - let rng = Rng::seeded(self.setup.seed ^ 0x1C0C_u64.wrapping_mul(cards as u64 + 1)); - let pot: f64 = self.total.iter().sum(); - pot * luck::share(&holes, hero, &self.setup.deal.board[..cards], &dead, rng) - } - - /// Luck of dealing the cards of `street`: value after them minus its expectation before. - fn luck_of(&mut self, street: Street) { - let before = self.street.board_len(); - self.result.luck += self.value(street.board_len()) - self.value(before); - } - - fn live(&self) -> usize { - self.folded.iter().filter(|f| !**f).count() - } - - fn can_act(&self, i: usize) -> bool { - !self.folded[i] && self.stack[i] > EPS - } - - fn record(&mut self, i: usize, action: SeenAction, amount: Option) { - self.history.push(ActionRecord { street: self.street, seat: i as u8 + 1, action, amount }); - } - - fn put(&mut self, i: usize, amount: f64) { - let amount = amount.min(self.stack[i]); - self.stack[i] -= amount; - self.bet[i] += amount; - self.total[i] += amount; - } - - /// Dead money: in the pot, not in the street's bet. - fn post_ante(&mut self, i: usize, amount: f64) { - let amount = amount.min(self.stack[i]); - self.stack[i] -= amount; - self.total[i] += amount; - self.record(i, SeenAction::PostAnte, Some(amount)); - } - - fn post(&mut self, i: usize, amount: f64, action: SeenAction) { - self.put(i, amount); - self.record(i, action, Some(self.bet[i])); - } - - /// Raise bounds for player `i`, or `None` when raising is impossible or pointless. - fn raise_bounds(&self, i: usize) -> Option<(f64, f64)> { - let to_call = self.max_bet - self.bet[i]; - let others = (0..self.players()).any(|j| j != i && self.can_act(j)); - let max = self.bet[i] + self.stack[i]; - (others && self.stack[i] > to_call + EPS) - .then(|| ((self.max_bet + self.last_raise).min(max), max)) - } - - fn view(&self, i: usize) -> View { - let bounds = self.raise_bounds(i); - View { - to_call: (self.max_bet - self.bet[i]).min(self.stack[i]), - min_raise_to: bounds.map(|b| b.0), - max_raise_to: bounds.map(|b| b.1), - } - } - - fn spot(&self, view: View) -> Spot { - let i = self.hero; - let mut legal = vec![ActionKind::Fold]; - legal.push(if view.to_call > 0.0 { ActionKind::Call } else { ActionKind::Check }); - if view.min_raise_to.is_some() { - legal.push(ActionKind::Raise); - } - // The engine sees the opponents the way a converged HUD would (`sim::reads`), so the ladder - // measures the exploit brain instead of playing it blind. - let read = super::reads::opponent_profile(self.setup.opponent); - let villains = (0..self.players()) - .filter(|j| *j != i) - .map(|j| Villain { seat: j as u8 + 1, stack: self.stack[j], folded: self.folded[j], profile: read }) - .collect(); - let decision_seed = self.setup.seed ^ (self.result.hero_decisions as u64 + 1).wrapping_mul(0x9E37_79B9_7F4A_7C15); - Spot { - variant: Variant::Nlhe, - big_blind: BIG_BLIND, - seats: self.players() as u8, - hero_seat: i as u8 + 1, - button_seat: Some(1), - hero_cards: self.setup.deal.holes[i].to_vec(), - board: self.setup.deal.board[..self.street.board_len()].to_vec(), - street: self.street, - pot: self.total.iter().sum(), - to_call: view.to_call, - hero_stack: self.stack[i], - min_raise_to: view.min_raise_to, - max_raise_to: view.max_raise_to, - legal, - allowed_sizes: None, - villains, - seed: decision_seed, - history: self.history.clone(), - } - } - - fn hero_act(&mut self, view: View) -> Act { - self.result.hero_decisions += 1; - let choice = match check(self.spot(view)) { - Ok(spot) => decide(&spot).choice, - Err(_) => { - self.result.invalid += 1; - Choice::Abstain - } - }; - match choice { - Choice::Fold if view.to_call > 0.0 => Act::Fold, - Choice::Fold | Choice::Check => Act::Check, - Choice::Call => Act::Call, - Choice::Raise { to } => Act::RaiseTo(to), - Choice::Abstain => { - self.result.abstains += 1; - if view.to_call > 0.0 { Act::Fold } else { Act::Check } - } - } - } - - /// What a reading opponent knows. Its own seed, so that it does not depend on hero's play. - fn reading(&self, i: usize) -> Reading { - let board = &self.setup.deal.board[..self.street.board_len()]; - let seed = self.setup.seed ^ ((i as u64 + 1) << 32) ^ (self.street.board_len() as u64 + 1).wrapping_mul(0x51_7CC1); - Reading { - strength: strength(&self.setup.deal.holes[i], board, Rng::seeded(seed)), - pot: self.total.iter().sum(), - own_bet: self.bet[i], - preflop: self.street == Street::Preflop, - } - } - - fn act(&mut self, i: usize) -> bool { - let view = self.view(i); - let act = if i == self.hero { - self.hero_act(view) - } else { - let (act, rng) = match self.setup.opponent { - Opponent::Reader(style) => style.act(view, self.reading(i), self.rng), - blind => blind.act(view, self.rng), - }; - self.rng = rng; - act - }; - match act { - Act::Fold => { - self.folded[i] = true; - self.record(i, SeenAction::Fold, None); - false - } - Act::Check | Act::Call if view.to_call <= 0.0 => { - self.record(i, SeenAction::Check, None); - false - } - Act::Check | Act::Call => { - self.put(i, view.to_call); - let seen = if self.stack[i] <= EPS { SeenAction::AllIn } else { SeenAction::Call }; - self.record(i, seen, Some(self.bet[i])); - false - } - Act::RaiseTo(to) => { - let Some((min, max)) = view.min_raise_to.zip(view.max_raise_to) else { - return self.act_passive(i, view); - }; - let to = to.clamp(min, max); - let increment = to - self.max_bet; - self.put(i, to - self.bet[i]); - self.last_raise = self.last_raise.max(increment); - let opened = self.max_bet <= EPS; - self.max_bet = to; - let seen = match (self.stack[i] <= EPS, opened) { - (true, _) => SeenAction::AllIn, - (false, true) => SeenAction::Bet, - (false, false) => SeenAction::Raise, - }; - self.record(i, seen, Some(self.bet[i])); - true - } - } - } - - /// A raise where none is possible counts as check or call. - fn act_passive(&mut self, i: usize, view: View) -> bool { - if view.to_call > 0.0 { - self.put(i, view.to_call); - let seen = if self.stack[i] <= EPS { SeenAction::AllIn } else { SeenAction::Call }; - self.record(i, seen, Some(self.bet[i])); - } else { - self.record(i, SeenAction::Check, None); - } - false - } - - /// One betting round from `first`. Stops early when only one player is left. - fn round(&mut self, first: usize) { - let n = self.players(); - let actors = (0..n).filter(|i| self.can_act(*i)).count(); - let owes = (0..n).any(|i| self.can_act(i) && self.bet[i] + EPS < self.max_bet); - if actors < 2 && !owes { - return; - } - let mut pending: Vec = (0..n).map(|i| self.can_act(i)).collect(); - let mut i = first; - while self.live() > 1 && pending.iter().any(|p| *p) { - if pending[i] { - pending[i] = false; - if self.act(i) { - for (j, p) in pending.iter_mut().enumerate() { - *p = j != i && !self.folded[j] && self.stack[j] > EPS; - } - } - } - i = (i + 1) % n; - } - } - - fn next_street(&mut self, street: Street) { - self.street = street; - self.bet.iter_mut().for_each(|b| *b = 0.0); - self.max_bet = 0.0; - self.last_raise = BIG_BLIND; - } - - /// Side pots level by level; ties split evenly. Returns everybody's winnings and the rake. - fn showdown(&self) -> (Vec, f64) { - let n = self.players(); - let mut won = vec![0.0; n]; - let mut left = self.total.clone(); - if let Some((top, amount)) = uncalled(&left) { - left[top] -= amount; - won[top] += amount; - } - let strength: Vec<_> = (0..n) - .map(|i| { - (!self.folded[i]).then(|| { - best(HoleUsage::BestFiveOfAll, &self.setup.deal.holes[i], &self.setup.deal.board) - .expect("valid deal") - }) - }) - .collect(); - let mut pots: Vec<(f64, Vec)> = Vec::new(); - loop { - let contenders: Vec = (0..n).filter(|i| !self.folded[*i] && left[*i] > EPS).collect(); - let Some(level) = contenders.iter().map(|i| left[*i]).min_by(f64::total_cmp) else { - break; - }; - let pot: f64 = left.iter_mut().map(|l| { - let part = l.min(level); - *l -= part; - part - }).sum(); - let top = contenders.iter().filter_map(|i| strength[*i]).max().expect("a contender"); - pots.push((pot, contenders.into_iter().filter(|i| strength[*i] == Some(top)).collect())); - } - let sizes: Vec = pots.iter().map(|(pot, _)| *pot).collect(); - let rake = self.rake_of(sizes.iter().sum()); - for ((pot, winners), taken) in pots.iter().zip(split_over_pots(rake, &sizes)) { - for w in winners { - won[*w] += (pot - taken) / winners.len() as f64; - } - } - (won, rake) - } - - fn rake_of(&self, pot: f64) -> f64 { - let end = if self.street == Street::Preflop { HandEnd::NoFlop } else { HandEnd::FlopDealt }; - self.cost.rake.map_or(0.0, |rule| rule.of_hand(pot, self.live(), end)) - } -} - -/// Plays one hand at the free table and reports hero's result. -pub fn play_hand(setup: &HandSetup) -> HandResult { - play_hand_at(setup, TableCost::FREE) -} - -/// Plays one hand to the end at a table with `cost` and reports hero's result. -pub fn play_hand_at(setup: &HandSetup, cost: TableCost) -> HandResult { - let n = setup.deal.holes.len(); - let mut t = Table { - setup, - cost, - hero: setup.hero_seat as usize - 1, - stack: vec![setup.stack_bb; n], - bet: vec![0.0; n], - total: vec![0.0; n], - folded: vec![false; n], - street: Street::Preflop, - max_bet: BIG_BLIND, - last_raise: BIG_BLIND, - history: Vec::new(), - rng: Rng::seeded(setup.seed), - result: HandResult { hero_net: 0.0, hero_decisions: 0, abstains: 0, invalid: 0, chips_lost: 0.0, rake: 0.0, luck: 0.0 }, - }; - if cost.ante_bb > 0.0 { - for i in 0..n { - t.post_ante(i, cost.ante_bb); - } - } - let (sb, bb) = if n == 2 { (0, 1) } else { (1, 2) }; - t.post(sb, SMALL_BLIND, SeenAction::PostSmallBlind); - t.post(bb, BIG_BLIND, SeenAction::PostBigBlind); - t.round((bb + 1) % n); - for street in [Street::Flop, Street::Turn, Street::River] { - if t.live() < 2 { - break; - } - t.luck_of(street); - t.next_street(street); - t.round(1 % n); - } - let (won, rake) = t.showdown(); - let nets: Vec = (0..n).map(|i| t.stack[i] + won[i] - setup.stack_bb).collect(); - t.result.hero_net = nets[t.hero]; - t.result.rake = rake; - t.result.chips_lost = nets.iter().sum::() + rake; - t.result -} +//! One hand of No-Limit Hold'em at a table of 2-10 seats: the engine on one seat, a fixed +//! opponent on all others. Seat 1 is the button; heads-up the button posts the small blind. +//! Big blind 1, small blind 0.5, everybody starts with `stack_bb`. Rake and antes come from +//! `TableCost`; `play_hand` is the free table. The rake leaves the table: the players' results +//! then sum to minus the rake. Antes are dead money in the pot and no part of a street's bet. + +use super::luck; +use super::memory::SessionMemory; +use super::opponent::{Act, Opponent, View}; +use super::gto; +use super::reader::{strength, Reading}; +use crate::card::{deck, Card}; +use crate::engine::decide::decide_with; +use crate::exploit::profile::Profile; +use crate::icm::lage::Turnierlage; +use crate::game::{ActionKind, ActionRecord, Choice, SeenAction, Spot, Street, Villain}; +use crate::guard::validate::check; +use crate::hand::showdown::best; +use crate::rake::{split_over_pots, uncalled, HandEnd, RakeRule, MEASURED_ANTE_BB}; +use crate::rng::Rng; +use crate::variant::{HoleUsage, Variant}; + +const SMALL_BLIND: f64 = 0.5; +const BIG_BLIND: f64 = 1.0; +const EPS: f64 = 1e-9; + +/// What a table takes besides the blinds. +#[derive(Clone, Copy, Debug, PartialEq)] +pub struct TableCost { + /// Per player, in big blinds. + pub ante_bb: f64, + pub rake: Option, +} + +impl TableCost { + pub const FREE: TableCost = TableCost { ante_bb: 0.0, rake: None }; + /// The table measured in `rake`: ante 0.16 bb, 5 % capped at 1 bb. + pub const MEASURED: TableCost = TableCost { ante_bb: MEASURED_ANTE_BB, rake: Some(RakeRule::MEASURED_BB) }; +} + +/// Cards for one hand: `holes[seat - 1]` and the full board in deal order. +#[derive(Clone, Debug, PartialEq)] +pub struct Deal { + pub holes: Vec<[Card; 2]>, + pub board: [Card; 5], +} + +pub fn deal(players: usize, rng: Rng) -> (Deal, Rng) { + let (cards, rng) = deck::draw(&deck::full(), 2 * players + 5, rng).expect("at most 10 players"); + let holes = cards.chunks(2).take(players).map(|c| [c[0], c[1]]).collect(); + let board = cards[2 * players..].try_into().expect("five board cards"); + (Deal { holes, board }, rng) +} + +/// The read handed to the engine for a hand. `Oracle` derives the opponent's converged profile +/// (`sim::reads`); `Given` hands an exact read - `None` is blind, `Some` is the memory's snapshot. +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum HandRead { + Oracle, + Given(Option), +} + +pub struct HandSetup<'a> { + pub deal: &'a Deal, + pub hero_seat: u8, + pub opponent: Opponent, + pub stack_bb: f64, + /// Seeds the opponents' choices and the engine's `seed` field. + pub seed: u64, + /// The read the engine gets for this hand. See `HandRead`. + pub read: HandRead, +} + +#[derive(Clone, Copy, Debug, PartialEq)] +pub struct HandResult { + /// Hero's result in big blinds. + pub hero_net: f64, + pub hero_decisions: u32, + /// Hero answered ABSTAIN; the table then checks, or folds when there is a price. + pub abstains: u32, + /// Requests the guard refused: a simulator bug, must stay 0. + pub invalid: u32, + /// Sum of all players' results plus the rake; must be 0. + pub chips_lost: f64, + /// Rake of the hand, big blinds. + pub rake: f64, + /// What the board cards decided (see `sim::luck`); expectation 0. + pub luck: f64, +} + +/// One hero decision, for diagnostics only (`play_hand_traced`): the spot the engine faced and what +/// it answered. Never recorded on the hot `play_hand_tracked` path (trace `None`). +#[derive(Clone, Copy, Debug, PartialEq)] +pub struct Dec { + pub street: Street, + pub pot: f64, + pub to_call: f64, + pub choice: Choice, + pub equity: Option, +} + +struct Table<'a> { + setup: &'a HandSetup<'a>, + cost: TableCost, + /// The tournament situation the engine is queried under (`decide_with`). `None` = cash + /// (`decide_with(spot, None)` is bit-identical to `decide(spot)`), so the whole cash/exploit + /// ladder is untouched; `Some` routes hero through the ICM line (`icm::risk` premium / jam). + lage: Option<&'a Turnierlage>, + hero: usize, + stack: Vec, + /// Per-seat starting stacks (big blinds), the baseline for each seat's net. Symmetric + /// (`vec![stack_bb; n]`) on the cash/exploit path; the ICM ladder seats asymmetric stacks + /// (covering vs covered) through `play_hand_seated`. + start: Vec, + bet: Vec, + total: Vec, + folded: Vec, + street: Street, + max_bet: f64, + last_raise: f64, + history: Vec, + rng: Rng, + result: HandResult, + /// `Some` only for `play_hand_traced`: one `Dec` per hero decision. + trace: Option>, +} + +impl Table<'_> { + fn players(&self) -> usize { + self.stack.len() + } + + /// Hero's expected share of the current pot with `cards` board cards known. + fn value(&self, cards: usize) -> f64 { + if self.folded[self.hero] { + return 0.0; + } + let live: Vec = (0..self.players()).filter(|i| !self.folded[*i]).collect(); + let holes: Vec<[Card; 2]> = live.iter().map(|i| self.setup.deal.holes[*i]).collect(); + let hero = live.iter().position(|i| *i == self.hero).expect("hero is live"); + let dead: Vec = self.setup.deal.holes.iter().flatten().copied().collect(); + let rng = Rng::seeded(self.setup.seed ^ 0x1C0C_u64.wrapping_mul(cards as u64 + 1)); + let pot: f64 = self.total.iter().sum(); + pot * luck::share(&holes, hero, &self.setup.deal.board[..cards], &dead, rng) + } + + /// Luck of dealing the cards of `street`: value after them minus its expectation before. + fn luck_of(&mut self, street: Street) { + let before = self.street.board_len(); + self.result.luck += self.value(street.board_len()) - self.value(before); + } + + fn live(&self) -> usize { + self.folded.iter().filter(|f| !**f).count() + } + + fn can_act(&self, i: usize) -> bool { + !self.folded[i] && self.stack[i] > EPS + } + + fn record(&mut self, i: usize, action: SeenAction, amount: Option) { + self.history.push(ActionRecord { street: self.street, seat: i as u8 + 1, action, amount }); + } + + fn put(&mut self, i: usize, amount: f64) { + let amount = amount.min(self.stack[i]); + self.stack[i] -= amount; + self.bet[i] += amount; + self.total[i] += amount; + } + + /// Dead money: in the pot, not in the street's bet. + fn post_ante(&mut self, i: usize, amount: f64) { + let amount = amount.min(self.stack[i]); + self.stack[i] -= amount; + self.total[i] += amount; + self.record(i, SeenAction::PostAnte, Some(amount)); + } + + fn post(&mut self, i: usize, amount: f64, action: SeenAction) { + self.put(i, amount); + self.record(i, action, Some(self.bet[i])); + } + + /// Raise bounds for player `i`, or `None` when raising is impossible or pointless. + fn raise_bounds(&self, i: usize) -> Option<(f64, f64)> { + let to_call = self.max_bet - self.bet[i]; + let others = (0..self.players()).any(|j| j != i && self.can_act(j)); + let max = self.bet[i] + self.stack[i]; + (others && self.stack[i] > to_call + EPS) + .then(|| ((self.max_bet + self.last_raise).min(max), max)) + } + + fn view(&self, i: usize) -> View { + let bounds = self.raise_bounds(i); + View { + to_call: (self.max_bet - self.bet[i]).min(self.stack[i]), + min_raise_to: bounds.map(|b| b.0), + max_raise_to: bounds.map(|b| b.1), + } + } + + fn spot(&self, view: View) -> Spot { + let i = self.hero; + let mut legal = vec![ActionKind::Fold]; + legal.push(if view.to_call > 0.0 { ActionKind::Call } else { ActionKind::Check }); + if view.min_raise_to.is_some() { + legal.push(ActionKind::Raise); + } + // The engine sees the opponents the way a converged HUD would (`sim::reads`), so the ladder + // measures the exploit brain instead of playing it blind - unless the scenario hands a + // different read (blind = no profile, or the memory's snapshot). + let read = match self.setup.read { + HandRead::Oracle => super::reads::opponent_profile(self.setup.opponent), + HandRead::Given(p) => p, + }; + let villains = (0..self.players()) + .filter(|j| *j != i) + .map(|j| Villain { seat: j as u8 + 1, stack: self.stack[j], folded: self.folded[j], profile: read }) + .collect(); + let decision_seed = self.setup.seed ^ (self.result.hero_decisions as u64 + 1).wrapping_mul(0x9E37_79B9_7F4A_7C15); + Spot { + variant: Variant::Nlhe, + big_blind: BIG_BLIND, + seats: self.players() as u8, + hero_seat: i as u8 + 1, + button_seat: Some(1), + hero_cards: self.setup.deal.holes[i].to_vec(), + board: self.setup.deal.board[..self.street.board_len()].to_vec(), + street: self.street, + pot: self.total.iter().sum(), + to_call: view.to_call, + hero_stack: self.stack[i], + min_raise_to: view.min_raise_to, + max_raise_to: view.max_raise_to, + legal, + allowed_sizes: None, + villains, + seed: decision_seed, + history: self.history.clone(), + } + } + + fn hero_act(&mut self, view: View) -> Act { + self.result.hero_decisions += 1; + let choice = match check(self.spot(view)) { + Ok(spot) => { + let decision = decide_with(&spot, self.lage); + if let Some(trace) = self.trace.as_mut() { + trace.push(Dec { + street: spot.street, + pot: spot.pot, + to_call: spot.to_call, + choice: decision.choice, + equity: decision.equity, + }); + } + decision.choice + } + Err(_) => { + self.result.invalid += 1; + Choice::Abstain + } + }; + match choice { + Choice::Fold if view.to_call > 0.0 => Act::Fold, + Choice::Fold | Choice::Check => Act::Check, + Choice::Call => Act::Call, + Choice::Raise { to } => Act::RaiseTo(to), + Choice::Abstain => { + self.result.abstains += 1; + if view.to_call > 0.0 { Act::Fold } else { Act::Check } + } + } + } + + /// What a reading opponent knows. Its own seed, so that it does not depend on hero's play. + fn reading(&self, i: usize) -> Reading { + let board = &self.setup.deal.board[..self.street.board_len()]; + let seed = self.setup.seed ^ ((i as u64 + 1) << 32) ^ (self.street.board_len() as u64 + 1).wrapping_mul(0x51_7CC1); + Reading { + strength: strength(&self.setup.deal.holes[i], board, Rng::seeded(seed)), + pot: self.total.iter().sum(), + own_bet: self.bet[i], + preflop: self.street == Street::Preflop, + } + } + + fn act(&mut self, i: usize) -> bool { + let view = self.view(i); + let act = if i == self.hero { + self.hero_act(view) + } else { + let (act, rng) = match self.setup.opponent { + Opponent::Reader(style) if style.gto_shape().is_some() => { + let reading = self.reading(i); + let n = self.players(); + let key = |j: usize| (j + n - 1) % n; + let in_position = (0..n).all(|j| j == i || self.folded[j] || key(j) < key(i)); + let seed = self.setup.seed + ^ ((i as u64 + 1) << 40) + ^ (self.history.len() as u64 + 1).wrapping_mul(0x9E37_79B9_7F4A_7C15) + ^ (self.street.board_len() as u64 + 1).wrapping_mul(0xC2B2_AE3D_27D4_EB4F); + let ctx = gto::Ctx { + hole: &self.setup.deal.holes[i], + board: &self.setup.deal.board[..self.street.board_len()], + strength: reading.strength, + pot: reading.pot, + own_bet: reading.own_bet, + stack: self.stack[i], + seat: i, + players: n, + live: self.live(), + in_position, + history: &self.history, + seed, + shape: style.gto_shape().expect("gto-family style has a shape"), + }; + gto::act(view, &ctx, self.rng) + } + Opponent::Reader(style) => style.act(view, self.reading(i), self.rng), + Opponent::Styled(rules) => super::reader::act_with(rules, view, self.reading(i), self.rng), + blind => blind.act(view, self.rng), + }; + self.rng = rng; + act + }; + match act { + Act::Fold => { + self.folded[i] = true; + self.record(i, SeenAction::Fold, None); + false + } + Act::Check | Act::Call if view.to_call <= 0.0 => { + self.record(i, SeenAction::Check, None); + false + } + Act::Check | Act::Call => { + self.put(i, view.to_call); + let seen = if self.stack[i] <= EPS { SeenAction::AllIn } else { SeenAction::Call }; + self.record(i, seen, Some(self.bet[i])); + false + } + Act::RaiseTo(to) => { + let Some((min, max)) = view.min_raise_to.zip(view.max_raise_to) else { + return self.act_passive(i, view); + }; + let to = to.clamp(min, max); + let increment = to - self.max_bet; + self.put(i, to - self.bet[i]); + self.last_raise = self.last_raise.max(increment); + let opened = self.max_bet <= EPS; + self.max_bet = to; + let seen = match (self.stack[i] <= EPS, opened) { + (true, _) => SeenAction::AllIn, + (false, true) => SeenAction::Bet, + (false, false) => SeenAction::Raise, + }; + self.record(i, seen, Some(self.bet[i])); + true + } + } + } + + /// A raise where none is possible counts as check or call. + fn act_passive(&mut self, i: usize, view: View) -> bool { + if view.to_call > 0.0 { + self.put(i, view.to_call); + let seen = if self.stack[i] <= EPS { SeenAction::AllIn } else { SeenAction::Call }; + self.record(i, seen, Some(self.bet[i])); + } else { + self.record(i, SeenAction::Check, None); + } + false + } + + /// One betting round from `first`. Stops early when only one player is left. + fn round(&mut self, first: usize) { + let n = self.players(); + let actors = (0..n).filter(|i| self.can_act(*i)).count(); + let owes = (0..n).any(|i| self.can_act(i) && self.bet[i] + EPS < self.max_bet); + if actors < 2 && !owes { + return; + } + let mut pending: Vec = (0..n).map(|i| self.can_act(i)).collect(); + let mut i = first; + while self.live() > 1 && pending.iter().any(|p| *p) { + if pending[i] { + pending[i] = false; + if self.act(i) { + for (j, p) in pending.iter_mut().enumerate() { + *p = j != i && !self.folded[j] && self.stack[j] > EPS; + } + } + } + i = (i + 1) % n; + } + } + + fn next_street(&mut self, street: Street) { + self.street = street; + self.bet.iter_mut().for_each(|b| *b = 0.0); + self.max_bet = 0.0; + self.last_raise = BIG_BLIND; + } + + /// Side pots level by level; ties split evenly. Returns everybody's winnings and the rake. + fn showdown(&self) -> (Vec, f64) { + let n = self.players(); + let mut won = vec![0.0; n]; + let mut left = self.total.clone(); + if let Some((top, amount)) = uncalled(&left) { + left[top] -= amount; + won[top] += amount; + } + let strength: Vec<_> = (0..n) + .map(|i| { + (!self.folded[i]).then(|| { + best(HoleUsage::BestFiveOfAll, &self.setup.deal.holes[i], &self.setup.deal.board) + .expect("valid deal") + }) + }) + .collect(); + let mut pots: Vec<(f64, Vec)> = Vec::new(); + loop { + let contenders: Vec = (0..n).filter(|i| !self.folded[*i] && left[*i] > EPS).collect(); + let Some(level) = contenders.iter().map(|i| left[*i]).min_by(f64::total_cmp) else { + break; + }; + let pot: f64 = left.iter_mut().map(|l| { + let part = l.min(level); + *l -= part; + part + }).sum(); + let top = contenders.iter().filter_map(|i| strength[*i]).max().expect("a contender"); + pots.push((pot, contenders.into_iter().filter(|i| strength[*i] == Some(top)).collect())); + } + let sizes: Vec = pots.iter().map(|(pot, _)| *pot).collect(); + let rake = self.rake_of(sizes.iter().sum()); + for ((pot, winners), taken) in pots.iter().zip(split_over_pots(rake, &sizes)) { + for w in winners { + won[*w] += (pot - taken) / winners.len() as f64; + } + } + (won, rake) + } + + fn rake_of(&self, pot: f64) -> f64 { + let end = if self.street == Street::Preflop { HandEnd::NoFlop } else { HandEnd::FlopDealt }; + self.cost.rake.map_or(0.0, |rule| rule.of_hand(pot, self.live(), end)) + } +} + +impl<'a> Table<'a> { + fn new( + setup: &'a HandSetup<'a>, + cost: TableCost, + trace: Option>, + lage: Option<&'a Turnierlage>, + start: Option>, + ) -> Table<'a> { + let n = setup.deal.holes.len(); + let start = start.unwrap_or_else(|| vec![setup.stack_bb; n]); + Table { + setup, + cost, + lage, + hero: setup.hero_seat as usize - 1, + stack: start.clone(), + start, + bet: vec![0.0; n], + total: vec![0.0; n], + folded: vec![false; n], + street: Street::Preflop, + max_bet: BIG_BLIND, + last_raise: BIG_BLIND, + history: Vec::new(), + rng: Rng::seeded(setup.seed), + result: HandResult { hero_net: 0.0, hero_decisions: 0, abstains: 0, invalid: 0, chips_lost: 0.0, rake: 0.0, luck: 0.0 }, + trace, + } + } + + /// Antes, blinds, every betting round, showdown, and hero's net. The whole hand. + fn run(&mut self) { + let n = self.players(); + if self.cost.ante_bb > 0.0 { + for i in 0..n { + self.post_ante(i, self.cost.ante_bb); + } + } + let (sb, bb) = if n == 2 { (0, 1) } else { (1, 2) }; + self.post(sb, SMALL_BLIND, SeenAction::PostSmallBlind); + self.post(bb, BIG_BLIND, SeenAction::PostBigBlind); + self.round((bb + 1) % n); + for street in [Street::Flop, Street::Turn, Street::River] { + if self.live() < 2 { + break; + } + self.luck_of(street); + self.next_street(street); + self.round(1 % n); + } + let (won, rake) = self.showdown(); + let nets: Vec = (0..n).map(|i| self.stack[i] + won[i] - self.start[i]).collect(); + self.result.hero_net = nets[self.hero]; + self.result.rake = rake; + self.result.chips_lost = nets.iter().sum::() + rake; + } +} + +/// Plays one hand at the free table and reports hero's result. +pub fn play_hand(setup: &HandSetup) -> HandResult { + play_hand_at(setup, TableCost::FREE) +} + +/// Plays one hand to the end at a table with `cost` and reports hero's result. +pub fn play_hand_at(setup: &HandSetup, cost: TableCost) -> HandResult { + play_hand_tracked(setup, cost, None) +} + +/// Like `play_hand_at`, but when a `memory` is given the finished hand's opponent actions are folded +/// into it (Stage 1 session memory). The read for THIS hand is already fixed in `setup.read`. +pub fn play_hand_tracked(setup: &HandSetup, cost: TableCost, memory: Option<&mut SessionMemory>) -> HandResult { + let mut t = Table::new(setup, cost, None, None, None); + t.run(); + if let Some(m) = memory { + m.observe_hand(&t.history, t.hero, t.players()); + } + t.result +} + +/// Plays one hand at the free table with explicit per-seat starting stacks and hero on the line +/// `lage` selects: `Some` queries the engine `decide_with(spot, Some(lage))` (the ICM line — risk +/// premium / open-jam widening), `None` the cash chip-EV line at the SAME stacks (a fair paired +/// control). `start[seat]` is the seat's stack in big blinds; its length must match the deal. +/// `lage.stacks` is the field in the same unit (hero at `lage.hero`, the table opponent next); the +/// chips move only at the table, the `Turnierlage` prices them. The strength ladder +/// (`sim::turnier_leiter`) pairs the two lines on identical deals and stacks and scores the chip +/// outcome back into ICM money. +pub fn play_hand_seated(setup: &HandSetup, start: &[f64], lage: Option<&Turnierlage>) -> HandResult { + let mut t = Table::new(setup, TableCost::FREE, None, lage, Some(start.to_vec())); + t.run(); + t.result +} + +/// Diagnostics: plays one hand and returns hero's result together with a `Dec` for every hero +/// decision. For localizing where a read helps or hurts (`tests/sim_blind` leak diagnosis); the +/// benchmark never uses this path. +pub fn play_hand_traced(setup: &HandSetup, cost: TableCost) -> (HandResult, Vec) { + let mut t = Table::new(setup, cost, Some(Vec::new()), None, None); + t.run(); + (t.result, t.trace.unwrap_or_default()) +} + +/// Plays one hand and returns hero's result together with the full action history, so a caller can +/// update BOTH a hero-side read and an opponent-side model of the hero (`sim::adaptive`, Stufe 3). +pub fn play_hand_history(setup: &HandSetup, cost: TableCost) -> (HandResult, Vec) { + let mut t = Table::new(setup, cost, None, None, None); + t.run(); + (t.result, t.history) +} diff --git a/src/sim/turnier_leiter.rs b/src/sim/turnier_leiter.rs new file mode 100644 index 00000000..5c2a98f6 --- /dev/null +++ b/src/sim/turnier_leiter.rs @@ -0,0 +1,303 @@ +//! Turnier-Stärke-Leiter: gewinnt die ICM-Linie in GELD? +//! +//! Die Cash-Leiter (`sim::session`) beweist das Exploit-Hirn in bb/100. Turniere werden aber nicht +//! um Chips gespielt, sondern um PREISE, und Chips werden nicht-linear in Preis-Equity umgerechnet +//! (`icm`). Eine Linie, die Chips gewinnt, kann an der Bubble Geld verlieren. Also wertet das +//! Turnier-Gegenstück jede Hand in ICM-GELD statt in Chips und vergleicht die ICM-Linie +//! (`decide_with(spot, Some(lage))`) gegen die Cash-Linie (Chip-EV, `decide`) auf DENSELBEN +//! Austeilungen. +//! +//! Ein Szenario ist ein Heads-up-Pot zwischen Hero und einem Gegner, beide auf `stack_bb`, +//! eingebettet in ein Feld fester Fremdstacks (`field`) unter einer Preisstruktur (`payouts`). Die +//! Hand bewegt nur die beiden Tischstacks (Chips bleiben am Free-Table erhalten); das Feld bepreist +//! die Bewegung per Harville. Die Kennzahl ist die GEPAARTE Differenz ICM\$(an) − ICM\$(aus): +//! dieselben Karten und Sitze für beide Linien, also hebt sich das Board-Glück in der Differenz auf +//! und übrig bleibt die Entscheidungs-Kante. +//! +//! Kein Mischen von Wissen: der Chip-Pfad und der ICM-Pfad teilen EINEN Mathe-Kern, nur die +//! `Turnierlage` schaltet die Preis-Bewertung dazu. Die Cash-Leiter ist bit-identisch unberührt +//! (`decide_with(spot, None)` == `decide(spot)`). + +use super::opponent::Opponent; +use super::table::{deal, play_hand_seated, HandRead, HandSetup}; +use crate::icm::harville; +use crate::icm::lage::Turnierlage; +use crate::rng::Rng; +use std::fmt; + +/// 95 % two-sided normal quantile. +const Z95: f64 = 1.959_964; +/// A busted stack is clamped to this before Harville (a zero rate never finishes the race). The +/// ICM value of busting out before the money is ~0, which this reproduces. +const BUST_FLOOR: f64 = 1e-9; + +/// One ICM test situation: a heads-up pot (hero + one opponent) inside a fixed field under a pay +/// structure. Hero and the opponent may sit at DIFFERENT stacks (covering vs covered) — the stacks +/// where ICM bites hardest. +#[derive(Clone, Debug, PartialEq)] +pub struct Szenario { + pub name: &'static str, + /// Prize of place 1, 2, ... (paid places only). The battery uses a pool of 100, so the + /// ICM\$/100 reads as "% of pool per 100 hands". + pub payouts: Vec, + /// Hero's stack at the table, in big blinds. + pub hero_stack: f64, + /// The table opponent's stack, in big blinds (= `hero_stack` for a symmetric spot). + pub opp_stack: f64, + /// Other players' stacks (NOT at the table), in big blinds — the rest of the ICM field. + pub field: Vec, + pub opponent: Opponent, + /// Deals; each is played from both seats (duplicate), so hands = deals × 2 per line. + pub deals: u32, + pub seed: u64, + /// Blind level (informational, passed to the engine's `Turnierlage`). + pub level: u32, +} + +/// Result of running one scenario: the ICM money of each line and the paired edge of ICM over cash. +#[derive(Clone, Copy, Debug, PartialEq)] +pub struct TurnierMessung { + pub name: &'static str, + pub hands: u32, + /// ICM money won per 100 hands on the ICM line (pool = 100). + pub icm_on_per100: f64, + /// ... on the cash (chip-EV) line. + pub icm_off_per100: f64, + /// The paired edge of the ICM line: mean(ICM\$on − ICM\$off) per 100 hands. + pub edge_per100: f64, + /// Half width of the 95 % interval on the paired edge. + pub ci95: f64, + pub decisions: u32, + pub abstains: u32, + /// Requests the guard refused on either line: a simulator bug, must stay 0. + pub invalid: u32, +} + +impl TurnierMessung { + /// Lower end of the 95 % interval on the edge. + pub fn lower(&self) -> f64 { + self.edge_per100 - self.ci95 + } + + /// The ICM line is PROVEN to win when the whole interval is above zero. + pub fn wins(&self) -> bool { + self.lower() > 0.0 + } + + /// Proven NOT to lose: the interval does not reach below zero (a correctness anchor, e.g. + /// winner-take-all where ICM must equal cash — edge ~0). + pub fn safe(&self) -> bool { + self.lower() >= -self.ci95 + } +} + +impl fmt::Display for TurnierMessung { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!( + f, + "{:<16} Kante {:+.3} ±{:.3} ICM$/100 (an {:+.3}, aus {:+.3}), {} Hände{}", + self.name, + self.edge_per100, + self.ci95, + self.icm_on_per100, + self.icm_off_per100, + self.hands, + if self.invalid > 0 { format!(" !! {} INVALID", self.invalid) } else { String::new() }, + ) + } +} + +fn mix(seed: u64, n: u64) -> u64 { + Rng::seeded(seed ^ n.wrapping_mul(0xD1B5_4A32_D192_ED03)).next_u64().0 +} + +/// The engine's `Turnierlage` for a scenario: hero at index 0, the table opponent at index 1, +/// then the field. Stacks in the same unit as the table (big blinds). +pub fn lage_of(s: &Szenario) -> Turnierlage { + let mut stacks = vec![s.hero_stack, s.opp_stack]; + stacks.extend_from_slice(&s.field); + Turnierlage { payouts: s.payouts.clone(), stacks, hero: 0, ante: 0.0, level: s.level } +} + +/// Hero's Harville prize equity for a field (busted stacks clamped positive). +fn icm_equity(stacks: &[f64], payouts: &[f64], hero: usize) -> f64 { + let s: Vec = stacks.iter().map(|x| x.max(BUST_FLOOR)).collect(); + harville::equities(&s, payouts)[hero] +} + +/// The ICM money the hand earned hero: his prize equity after the chips moved minus before. +/// Heads-up table: hero (index 0) nets `hero_net`, the table opponent (index 1) the mirror +/// (chips conserved at the free table); the field is untouched. +fn icm_score(lage: &Turnierlage, hero_net: f64) -> f64 { + let before = icm_equity(&lage.stacks, &lage.payouts, lage.hero); + let mut after = lage.stacks.clone(); + after[0] += hero_net; + after[1] -= hero_net; + icm_equity(&after, &lage.payouts, lage.hero) - before +} + +/// Runs one scenario and returns its ICM-money measurement. The ICM line and the cash line see the +/// SAME deals and seats; the per-deal sample is the mean over both seats of ICM\$(on) − ICM\$(off). +pub fn messen(s: &Szenario) -> TurnierMessung { + let lage = lage_of(s); + let mut edge = Vec::with_capacity(s.deals as usize); + let (mut on_tot, mut off_tot) = (0.0, 0.0); + let (mut decisions, mut abstains, mut invalid, mut hands) = (0u32, 0u32, 0u32, 0u32); + for d in 0..s.deals { + let (cards, _) = deal(2, Rng::seeded(mix(s.seed, d as u64))); + let mut e = 0.0; + for hero_seat in 1..=2u8 { + let setup = HandSetup { + deal: &cards, + hero_seat, + opponent: s.opponent, + // Unused on the seated path (explicit `start` below); a sane value for the struct. + stack_bb: s.hero_stack, + seed: mix(s.seed ^ 0xA5A5, (d as u64) << 8 | hero_seat as u64), + // The full read for both lines, so the only thing that differs is the ICM pricing. + read: HandRead::Oracle, + }; + // Seat hero at `hero_stack`, the opponent at `opp_stack`, whichever seat hero drew. + let start = if hero_seat == 1 { [s.hero_stack, s.opp_stack] } else { [s.opp_stack, s.hero_stack] }; + let on = play_hand_seated(&setup, &start, Some(&lage)); + let off = play_hand_seated(&setup, &start, None); + let s_on = icm_score(&lage, on.hero_net); + let s_off = icm_score(&lage, off.hero_net); + e += s_on - s_off; + on_tot += s_on; + off_tot += s_off; + decisions += on.hero_decisions + off.hero_decisions; + abstains += on.abstains + off.abstains; + invalid += on.invalid + off.invalid; + // Per-line paired hands (the denominator of `*_per100`); both lines saw this deal. + hands += 1; + } + edge.push(e / 2.0); + } + let (edge_per100, ci95) = rate(&edge); + let n = f64::from(s.deals.max(1) * 2); + TurnierMessung { + name: s.name, + hands, + icm_on_per100: 100.0 * on_tot / n, + icm_off_per100: 100.0 * off_tot / n, + edge_per100, + ci95, + decisions, + abstains, + invalid, + } +} + +/// Mean and 95 % half width of per-deal samples, both scaled to "per 100 hands". +fn rate(samples: &[f64]) -> (f64, f64) { + let n = samples.len().max(1) as f64; + let mean = samples.iter().sum::() / n; + let var = samples.iter().map(|x| (x - mean).powi(2)).sum::() / (n - 1.0).max(1.0); + (100.0 * mean, 100.0 * Z95 * (var / n).sqrt()) +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::sim::reader::Style; + + fn bubble(opponent: Opponent, deals: u32) -> Szenario { + Szenario { + name: "bubble", + // 3 paid of 5 left, steep ladder; pool 100. + payouts: vec![50.0, 30.0, 20.0], + // hero + table-opp at 20bb each; two short stacks about to bust. + field: vec![6.0, 4.0, 10.0], + opponent, + hero_stack: 20.0, + opp_stack: 20.0, + deals, + seed: 0x5EED_0001, + level: 7, + } + } + + #[test] + fn harville_conserves_the_pool_and_prices_busts_near_zero() { + let payouts = vec![50.0, 30.0, 20.0]; + let stacks = vec![20.0, 20.0, 6.0, 4.0, 10.0]; + let eq = harville::equities(&stacks, &payouts); + let sum: f64 = eq.iter().sum(); + assert!((sum - 100.0).abs() < 1e-6, "ICM money conserves the prize pool: {sum}"); + // A busted hero is worth ~nothing. + let busted = icm_equity(&[BUST_FLOOR, 30.0, 6.0, 4.0, 10.0], &payouts, 0); + assert!(busted < 0.5, "busting before the money is worth ~0, got {busted}"); + } + + #[test] + fn icm_score_is_zero_for_a_flat_hand_and_signed_with_the_chips() { + let lage = lage_of(&bubble(Opponent::Folder, 1)); + assert!(icm_score(&lage, 0.0).abs() < 1e-12, "no chips moved, no ICM change"); + assert!(icm_score(&lage, 5.0) > 0.0, "winning chips raises ICM equity"); + assert!(icm_score(&lage, -5.0) < 0.0, "losing chips lowers ICM equity"); + // ICM is concave: losing the pot hurts more than winning it helps (risk aversion). + assert!( + icm_score(&lage, 5.0) < -icm_score(&lage, -5.0), + "at the bubble the downside outweighs the upside", + ); + } + + #[test] + fn winner_take_all_is_the_cash_anchor_no_icm_edge() { + // One prize: ICM equity is exactly the chip share, so the ICM line must NOT diverge from + // cash — the edge is ~0 and never a loss. (Scoring still runs the whole pipeline.) + let s = Szenario { + name: "wta", + payouts: vec![100.0], + field: vec![30.0, 30.0], + opponent: Opponent::Reader(Style::Maniac), + hero_stack: 25.0, + opp_stack: 25.0, + deals: 200, + seed: 0x5EED_0007, + level: 3, + }; + let m = messen(&s); + assert_eq!(m.invalid, 0, "no invalid requests"); + assert!(m.edge_per100.abs() <= m.ci95 + 1e-9, "WTA: ICM equals cash within noise: {m}"); + } + + #[test] + fn asymmetric_covered_short_is_well_formed_and_chips_conserve() { + // Hero is the SHORT stack, covered by a big opponent at a hard bubble: the call premium is + // high (busting = out of the money). Chips must still conserve (no invalid, finite edge). + let s = Szenario { + name: "covered", + payouts: vec![50.0, 30.0, 20.0], + hero_stack: 8.0, + opp_stack: 40.0, + field: vec![6.0, 30.0], + opponent: Opponent::Reader(Style::Maniac), + deals: 150, + seed: 0x5EED_00AA, + level: 8, + }; + let m = messen(&s); + assert_eq!(m.invalid, 0, "asymmetric stacks: no invalid requests"); + assert_eq!(m.hands, 300); + assert!(m.edge_per100.is_finite() && m.ci95 > 0.0); + // The ICM line must not LOSE money (its lower bound stays out of a clear loss). + assert!(m.edge_per100 + m.ci95 > 0.0 || m.edge_per100.abs() <= m.ci95, "no clear ICM loss: {m}"); + } + + #[test] + fn deterministic() { + let s = bubble(Opponent::Reader(Style::Maniac), 120); + assert_eq!(messen(&s), messen(&s), "same seed, same measurement"); + } + + #[test] + fn a_bubble_run_is_well_formed() { + let m = messen(&bubble(Opponent::Reader(Style::Maniac), 150)); + assert_eq!(m.invalid, 0); + assert_eq!(m.hands, 300); + assert!(m.ci95 > 0.0 && m.ci95.is_finite()); + assert!(m.edge_per100.is_finite()); + } +} diff --git a/src/sim/twin_gate.rs b/src/sim/twin_gate.rs new file mode 100644 index 00000000..92138380 --- /dev/null +++ b/src/sim/twin_gate.rs @@ -0,0 +1,333 @@ +//! Stufe 2 of the synthetic lab: the TWIN GATE — the accept/reject rule that replaces the bb/100 +//! ladder. +//! +//! The ladder asked one question: does the win rate against five fixed bots go up? That is blind to +//! both of the things that matter for a real exploiter — it hides the exploitation signal (oracle read +//! handed over, `BEFUND-exploitation-luecke-population`) and it never checks that a win came from sound +//! play rather than from overfitting a bot (a balanced opponent would punish the overfit, but the +//! ladder's bots never best-respond). +//! +//! The twin gate makes "never ship a loser" rigorous and multi-axis. A change may ship only if it +//! clears THREE axes at once: +//! +//! 1. OFFENSE — population EV. The engine's Memory-mode win rate against a drawn population +//! (`sim::exploit_pop`): it must still exploit a varied field. +//! 2. ROBUSTNESS FLOOR — a tiny EGTA. A population adversary best-responds by picking the single +//! archetype the engine does worst against (linear ⇒ the min over archetypes is the worst mix). +//! The engine's EV against that worst archetype is the floor: no change may lower it. This is the +//! axis that catches a fix that crushes fish but bleeds against the balanced player. +//! 3. DEFENSE CAP — river exploitability. An exact best-response distance on a fixed battery of river +//! subgames (`sim::exploit_river`): no change may raise it. This is the axis that catches a change +//! that buys EV against the field by playing an exploitable, unbalanced strategy. +//! +//! `TwinReport` carries all three for one engine build; `Gate::passes` is the pure comparator between a +//! baseline build and a candidate, with per-axis tolerances. The river battery is a FIXED, hand-built +//! set of canonical polar spots — not all of poker, but the same probe applied to baseline and +//! candidate, which is what a regression gate needs. + +use super::exploit_pop::exploitation_gap; +use super::exploit_river::{exploitability_river, RiverSpec}; +use super::opponent::Opponent; +use super::population::Population; +use super::reader::Style; +use super::session::{measure, ReadMode, Setup}; +use crate::card::Card; + +const STACK_BB: f64 = 100.0; + +/// The archetypes the robustness floor scans: the four threshold styles plus the two balanced range +/// players. The balanced pair is the point of the floor — an exploiter that overfits the threshold +/// bots gets punished here. +const ARCHETYPES: [Style; 6] = + [Style::Reg, Style::Nit, Style::Maniac, Style::Fish, Style::Gto, Style::GtoSmall]; + +#[derive(Clone, Debug)] +pub struct TwinReport { + // --- offense --- + /// Engine Memory-mode win rate against the drawn population, bb/100. + pub population_ev_bb_per_100: f64, + /// memory − blind against the population (the exploitation the read earns), bb/100. + pub exploitation_gap_bb_per_100: f64, + // --- robustness floor (EGTA worst archetype) --- + pub worst_archetype: String, + /// Engine EV against the single worst archetype — the population adversary's best response. + pub worst_ev_bb_per_100: f64, + pub worst_ci95: f64, + /// Every archetype's (name, ev bb/100, ci95), for the full picture. + pub archetypes: Vec<(String, f64, f64)>, + // --- defense cap (river exploitability) --- + /// Mean exact exploitability over the river battery, bb/100 (≥ 0, 0 = unexploitable there). + pub mean_exploitability_bb_per_100: f64, + /// The worst single subgame's exploitability, bb/100. + pub max_exploitability_bb_per_100: f64, + pub subgames: usize, +} + +/// Per-axis tolerances for the gate: a candidate may give up at most this much on each axis before it +/// is a "loser". All in bb/100. +#[derive(Clone, Copy, Debug)] +pub struct Gate { + pub ev_tol: f64, + pub floor_tol: f64, + pub exploit_tol: f64, +} + +impl Default for Gate { + fn default() -> Self { + // Noise-sized slack: a change inside the measurement CI is not a real loss, but anything + // beyond it on any axis is. + Gate { ev_tol: 2.0, floor_tol: 2.0, exploit_tol: 1.0 } + } +} + +impl Gate { + /// The accept rule: the candidate ships only if it loses no axis beyond tolerance — population EV + /// holds, the worst-archetype floor holds, and exploitability does not rise. + pub fn passes(&self, baseline: &TwinReport, candidate: &TwinReport) -> bool { + candidate.population_ev_bb_per_100 >= baseline.population_ev_bb_per_100 - self.ev_tol + && candidate.worst_ev_bb_per_100 >= baseline.worst_ev_bb_per_100 - self.floor_tol + && candidate.mean_exploitability_bb_per_100 + <= baseline.mean_exploitability_bb_per_100 + self.exploit_tol + } + + /// Which axes a candidate fails against a baseline (empty = passes), for a readable verdict. + pub fn failures(&self, baseline: &TwinReport, candidate: &TwinReport) -> Vec<&'static str> { + let mut f = Vec::new(); + if candidate.population_ev_bb_per_100 < baseline.population_ev_bb_per_100 - self.ev_tol { + f.push("population-EV"); + } + if candidate.worst_ev_bb_per_100 < baseline.worst_ev_bb_per_100 - self.floor_tol { + f.push("robustness-floor"); + } + if candidate.mean_exploitability_bb_per_100 + > baseline.mean_exploitability_bb_per_100 + self.exploit_tol + { + f.push("exploitability"); + } + f + } +} + +/// The engine's EV (luck-corrected, bb/100, with 95 % half width) against one archetype, Memory mode +/// — the realistic deployed read, not the handed-over oracle. +fn archetype_ev(style: Style, deals: u32, seed: u64) -> (f64, f64) { + let setup = Setup { + players: 2, + opponent: Opponent::Reader(style), + deals, + stack_bb: STACK_BB, + seed, + read: ReadMode::Memory, + }; + let m = measure(&setup); + (m.bb_per_100, m.ci95) +} + +/// A canonical river spot with owned cards, so a battery of them can be built and borrowed. +struct OwnedSpot { + board: Vec, + hero: Vec>, + villain: Vec>, + pot: f64, + bet: f64, +} + +fn combos(list: &[&str]) -> Vec> { + list.iter().map(|s| Card::parse_list(s).expect("valid combo")).collect() +} + +/// A fixed battery of canonical polar river spots: hero holds nuts + air, villain holds bluff-catchers, +/// across dry / wet / paired textures. Fixed by design — the same probe for baseline and candidate. +fn battery() -> Vec { + let b = |s: &str| Card::parse_list(s).expect("valid board"); + vec![ + // Dry ace-high: polar hero, villain caps at second pair. + OwnedSpot { + board: b("Ah Kd 7c 2s 9h"), + hero: combos(&["Ac Qc", "Ad Jd", "5d 4d", "6c 5c"]), + villain: combos(&["Kh Qs", "7h 7d", "Th 9s", "Qd Jh"]), + pot: 6.0, + bet: 4.5, + }, + // Wet, connected: straights and flushes live, villain has one-pair / weak made hands. + OwnedSpot { + board: b("9h 8h 5c 2d Qs"), + hero: combos(&["Jh Th", "Qh Jc", "7c 6c", "Ah 4h"]), + villain: combos(&["9c 9d", "8d 8c", "Kh Qd", "Th 9s"]), + pot: 8.0, + bet: 6.0, + }, + // Paired board: full houses and trips vs under-pairs. + OwnedSpot { + board: b("Kc Ks 6h 6d 2c"), + hero: combos(&["Kh Qd", "6c 5s", "Ah Jh", "9c 8c"]), + villain: combos(&["Qh Qd", "Jc Js", "Ts 9d", "Ad Tc"]), + pot: 5.0, + bet: 3.5, + }, + // Monotone flush board: made flushes vs non-flush strong hands. + OwnedSpot { + board: b("Qd 9d 4d 7s 2d"), + hero: combos(&["Ad Kc", "Kd Jh", "Ts Tc", "8c 7c"]), + villain: combos(&["Qh Jc", "9c 9s", "Jd Th", "Ac Ah"]), + pot: 7.0, + bet: 5.0, + }, + // Low disconnected: overpairs vs air, a thin-value texture. + OwnedSpot { + board: b("8c 5h 3d Ts 2c"), + hero: combos(&["Ah As", "Td 9d", "Kc Qc", "7h 6h"]), + villain: combos(&["9c 9h", "Jd Jc", "Ac Kd", "6s 4s"]), + pot: 4.0, + bet: 3.0, + }, + ] +} + +/// Mean and max exact river exploitability over the fixed battery, bb/100, and how many subgames were +/// non-degenerate. +fn river_exploitability(iters: u32, seed: u64) -> (f64, f64, usize) { + let spots = battery(); + let mut vals = Vec::new(); + for s in &spots { + let spec = RiverSpec { + board: &s.board, + hero_range: &s.hero, + villain_range: &s.villain, + villain_profile: None, + pot: s.pot, + bet: s.bet, + }; + if let Some(r) = exploitability_river(&spec, iters, seed) { + vals.push(r.exploitability.max(0.0)); + } + } + let n = vals.len(); + let mean = if n == 0 { 0.0 } else { vals.iter().sum::() / n as f64 }; + let max = vals.iter().cloned().fold(0.0_f64, f64::max); + (mean, max, n) +} + +/// How much work each axis does. Keep the ladder-scale defaults for a real run; the tests use tiny ones. +#[derive(Clone, Copy, Debug)] +pub struct TwinBudget { + pub pop_opponents: usize, + pub pop_deals: u32, + pub archetype_deals: u32, + pub river_iters: u32, +} + +impl Default for TwinBudget { + fn default() -> Self { + TwinBudget { pop_opponents: 48, pop_deals: 400, archetype_deals: 4000, river_iters: 12_000 } + } +} + +/// Evaluate one engine build on all three axes. Deterministic in `seed`. +pub fn evaluate(pop: &Population, budget: TwinBudget, seed: u64) -> TwinReport { + let gap = exploitation_gap(pop, budget.pop_opponents, budget.pop_deals, seed); + + let mut archetypes = Vec::new(); + let (mut worst_archetype, mut worst_ev, mut worst_ci) = (String::new(), f64::INFINITY, 0.0); + for (i, style) in ARCHETYPES.iter().enumerate() { + let (ev, ci) = archetype_ev(*style, budget.archetype_deals, seed ^ (i as u64 + 1)); + archetypes.push((style.name().to_string(), ev, ci)); + if ev < worst_ev { + worst_ev = ev; + worst_ci = ci; + worst_archetype = style.name().to_string(); + } + } + + let (mean_expl, max_expl, subgames) = river_exploitability(budget.river_iters, seed); + + TwinReport { + population_ev_bb_per_100: gap.memory_bb_per_100, + exploitation_gap_bb_per_100: gap.gap_bb_per_100, + worst_archetype, + worst_ev_bb_per_100: worst_ev, + worst_ci95: worst_ci, + archetypes, + mean_exploitability_bb_per_100: mean_expl, + max_exploitability_bb_per_100: max_expl, + subgames, + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn evaluate_fills_all_three_axes() { + // Tiny budget: this drives the full engine on every axis, so keep it small for `cargo test`. + let pop = Population::micro(); + let budget = TwinBudget { + pop_opponents: 3, + pop_deals: 20, + archetype_deals: 60, + river_iters: 2_000, + }; + let r = evaluate(&pop, budget, 0x5EED_0001); + println!( + "pop-EV {:+.1} gap {:+.1} | worst {} {:+.1}±{:.1} | expl mean {:.2} max {:.2} ({} spots)", + r.population_ev_bb_per_100, + r.exploitation_gap_bb_per_100, + r.worst_archetype, + r.worst_ev_bb_per_100, + r.worst_ci95, + r.mean_exploitability_bb_per_100, + r.max_exploitability_bb_per_100, + r.subgames, + ); + assert!(r.population_ev_bb_per_100.is_finite()); + assert_eq!(r.archetypes.len(), 6); + assert!(r.worst_ev_bb_per_100.is_finite() && r.worst_ev_bb_per_100 <= f64::INFINITY); + assert!(r.mean_exploitability_bb_per_100 >= 0.0); + assert!(r.subgames >= 1); + } + + fn report(pop_ev: f64, floor: f64, expl: f64) -> TwinReport { + TwinReport { + population_ev_bb_per_100: pop_ev, + exploitation_gap_bb_per_100: 0.0, + worst_archetype: "gto".into(), + worst_ev_bb_per_100: floor, + worst_ci95: 0.0, + archetypes: vec![], + mean_exploitability_bb_per_100: expl, + max_exploitability_bb_per_100: expl, + subgames: 5, + } + } + + #[test] + fn the_gate_accepts_a_strict_improvement_and_rejects_each_regression() { + let gate = Gate::default(); + let base = report(40.0, -3.0, 5.0); + + // Better on every axis -> passes, no failures. + let better = report(45.0, 0.0, 3.0); + assert!(gate.passes(&base, &better)); + assert!(gate.failures(&base, &better).is_empty()); + + // Within tolerance everywhere -> still passes (noise is not a loss). + let noise = report(39.0, -4.0, 5.5); + assert!(gate.passes(&base, &noise)); + + // Loses population EV beyond tolerance -> fails on that axis only. + let ev_loss = report(30.0, 0.0, 3.0); + assert!(!gate.passes(&base, &ev_loss)); + assert_eq!(gate.failures(&base, &ev_loss), vec!["population-EV"]); + + // Buys EV but bleeds the balanced floor -> fails the floor (the overfit catcher). + let overfit = report(60.0, -8.0, 3.0); + assert!(!gate.passes(&base, &overfit)); + assert_eq!(gate.failures(&base, &overfit), vec!["robustness-floor"]); + + // Buys EV by playing exploitably -> fails the defense cap. + let exploitable = report(60.0, 0.0, 9.0); + assert!(!gate.passes(&base, &exploitable)); + assert_eq!(gate.failures(&base, &exploitable), vec!["exploitability"]); + } +} diff --git a/src/sizing/kelly.rs b/src/sizing/kelly.rs new file mode 100644 index 00000000..b3c0a83d --- /dev/null +++ b/src/sizing/kelly.rs @@ -0,0 +1,117 @@ +//! Kelly / log-optimal Wachstumssizing (Bankroll-Schicht, neben `candidates`). +//! +//! Ueber viele Haende ist die EV-maximale Einsatzhoehe nicht die +//! bankroll-optimale: Kelly maximiert das erwartete Log-Wachstum +//! (= Kanalkapazitaet der Wette). Reine Mathe, nicht in `decide` verdrahtet. +//! +//! ICM-Haken (Turnier): `p`/`b` und der Log-Nutzen gelten nur fuer Chip-EV +//! (Cash). Im Turnier ersetzt der Terminalwert aus `crate::icm` (Harville- +//! Equity, `icm::risk`) die Bankroll `ln(W)`: `p` und `b` werden dann aus +//! Equity-Gewinn/-Verlust des Einsatzes abgeleitet (b = dEq_win/dEq_lose). +//! Dieser Anschluss ist hier bewusst nicht implementiert. + +/// Wachstumsoptimaler Anteil f* = (p*(b+1) - 1) / b, auf [0,1] geklemmt; +/// 0 bei Edge <= 0 oder ungueltigen Eingaben. +pub fn kelly_fraction(p: f64, b: f64) -> f64 { + if !(p.is_finite() && b.is_finite()) || b <= 0.0 || p <= 0.0 { + return 0.0; + } + let p = p.min(1.0); + let edge = p * (b + 1.0) - 1.0; + if edge <= 0.0 { + return 0.0; + } + (edge / b).clamp(0.0, 1.0) +} + +/// Erwartetes Log-Wachstum je Wette: p*ln(1+f*b) + (1-p)*ln(1-f). +/// f=1 mit p<1 ergibt -inf (Ruin). +pub fn log_growth(f: f64, p: f64, b: f64) -> f64 { + let loss = if p >= 1.0 { 0.0 } else { (1.0 - p) * (1.0 - f).ln() }; + p * (1.0 + f * b).ln() + loss +} + +/// Bruchteils-Kelly f*·k, k in (0,1] (ausserhalb geklemmt). +pub fn fractional(full_kelly: f64, k: f64) -> f64 { + full_kelly * k.clamp(0.0, 1.0) +} + +#[cfg(test)] +mod tests { + use super::*; + + const CASES: [(f64, f64); 5] = [(0.6, 1.0), (0.55, 1.0), (0.4, 2.0), (0.7, 0.5), (0.3, 4.0)]; + + #[test] + fn kelly_ist_argmax_des_log_wachstums() { + let n = 100_000; + for (p, b) in CASES { + let fs = kelly_fraction(p, b); + let (mut best_f, mut best_g) = (0.0, f64::NEG_INFINITY); + for i in 0..n { + let f = i as f64 / n as f64; + let g = log_growth(f, p, b); + if g > best_g { + best_g = g; + best_f = f; + } + } + println!("p={p} b={b}: f*={fs:.5} grid-argmax={best_f:.5} G*={:.6}", log_growth(fs, p, b)); + assert!((fs - best_f).abs() < 2.0 / n as f64, "argmax weicht ab"); + assert!(log_growth(fs, p, b) >= best_g - 1e-12); + } + } + + #[test] + fn negative_edge_gibt_null() { + assert_eq!(kelly_fraction(0.4, 1.0), 0.0); + assert_eq!(kelly_fraction(0.5, 1.0), 0.0); + assert_eq!(kelly_fraction(0.2, 3.0), 0.0); + assert_eq!(kelly_fraction(0.6, 0.0), 0.0); + assert_eq!(kelly_fraction(f64::NAN, 1.0), 0.0); + assert_eq!(kelly_fraction(1.0, 1.0), 1.0); + } + + #[test] + fn fractional_skaliert() { + assert!((fractional(0.2, 0.5) - 0.1).abs() < 1e-15); + assert_eq!(fractional(0.2, 2.0), 0.2); + } + + /// xorshift64*, deterministisch. + fn rng(state: &mut u64) -> f64 { + *state ^= *state >> 12; + *state ^= *state << 25; + *state ^= *state >> 27; + let x = state.wrapping_mul(0x2545F4914F6CDD1D); + (x >> 11) as f64 / (1u64 << 53) as f64 + } + + /// Realisierte geometrische Wachstumsrate je Runde (ln-Bankroll / N). + fn simuliere(f: f64, p: f64, b: f64, n: usize, seed: u64) -> f64 { + let mut s = seed; + let mut ln_w = 0.0; + for _ in 0..n { + ln_w += if rng(&mut s) < p { (1.0 + f * b).ln() } else { (1.0 - f).ln() }; + } + ln_w / n as f64 + } + + #[test] + fn simulation_kelly_schlaegt_ueber_und_unterwetten() { + let (p, b, n) = (0.6, 1.0, 200_000); + let k = kelly_fraction(p, b); + let (g_k, g_2, g_h) = ( + simuliere(k, p, b, n, 42), + simuliere(2.0 * k, p, b, n, 42), + simuliere(0.5 * k, p, b, n, 42), + ); + println!("f*={k:.3} p={p} b={b} N={n}"); + println!("Kelly (f={:.3}) -> {g_k:.6} /Runde (Theorie {:.6})", k, log_growth(k, p, b)); + println!("2x Kelly (f={:.3}) -> {g_2:.6} /Runde (Theorie {:.6})", 2.0 * k, log_growth(2.0 * k, p, b)); + println!("0.5x Kelly (f={:.3}) -> {g_h:.6} /Runde (Theorie {:.6})", 0.5 * k, log_growth(0.5 * k, p, b)); + assert!(g_k > g_2 && g_k > g_h); + assert!(g_2 < 0.0, "2x Kelly wuerde bei p=.6,b=1 ruinoes"); + assert!((g_k - log_growth(k, p, b)).abs() < 2e-3); + } +} diff --git a/src/sizing/mod.rs b/src/sizing/mod.rs index cbf81def..c8980d6b 100644 --- a/src/sizing/mod.rs +++ b/src/sizing/mod.rs @@ -7,3 +7,4 @@ pub mod candidates; pub mod fit; pub mod pot_fractions; pub mod preflop; +pub mod kelly; diff --git a/src/wire/decode_villain.rs b/src/wire/decode_villain.rs index b7bf8884..a929b24a 100644 --- a/src/wire/decode_villain.rs +++ b/src/wire/decode_villain.rs @@ -17,6 +17,10 @@ fn profile(villain: &Value, path: &str) -> Result, Fault> { pfr: opt_number_member(object, &at_profile, "pfr")?, fold_to_bet: opt_number_member(object, &at_profile, "foldToBet")?, aggression: opt_number_member(object, &at_profile, "aggression")?, + // Per-street aggression is not on the wire yet (the opponent memory derives it); keep it None + // so the engine falls back to the pooled read until the client delivers it. + turn_aggression: None, + river_aggression: None, // HUD extras (lesen/profil.py DURCHGEREICHT): same client names on the wire. cbet: opt_number_member(object, &at_profile, "cbet")?, fold_to_cbet: opt_number_member(object, &at_profile, "foldToCbet")?, @@ -26,6 +30,8 @@ fn profile(villain: &Value, path: &str) -> Result, Fault> { check_raise: opt_number_member(object, &at_profile, "checkRaise")?, wtsd: opt_number_member(object, &at_profile, "wtsd")?, wsd: opt_number_member(object, &at_profile, "wsd")?, + // Not on the wire: confidence is derived from `hands` by `shrink` below (half-life PRIOR_HANDS). + confidence: None, }; // `hands` (extension, exploit::sample): with it, few hands count little Ok(Some(match opt_number_member(object, &at_profile, "hands")? { diff --git a/tests/ab_arm_spec.py b/tests/ab_arm_spec.py new file mode 100644 index 00000000..f6e470ec --- /dev/null +++ b/tests/ab_arm_spec.py @@ -0,0 +1,99 @@ +#!/usr/bin/env python3 +"""Spezifikation des A/B-Arm-Rueckgrats: je Hand eine Arm-Marke (Feld "arm", im Lauf per +COINPOKER_ARM gesetzt), deskriptiv in statistik.je_arm, signifikanz-geprueft in +lesen/liveabgleich.ab_aus_log(feld="arm"). + +Hier wird jede Kennzahl von Hand geprueft, nicht aus derselben Funktion zurueckgelesen. Der +Signifikanz-Test ist der Welch-Zwei-Stichproben-Test aus liveabgleich (nicht die Nicht- +Ueberlappungs-Heuristik) - das ist die korrekte Rechnung fuer zwei ungepaarte Arme. + + python3 tests/ab_arm_spec.py -v +""" +import os +import sys +import unittest + +_w = os.path.dirname(os.path.abspath(__file__)) +while _w != "/" and not os.path.isdir(os.path.join(_w, "betrieb")): + _w = os.path.dirname(_w) +for _u in ("lesen", "betrieb"): + sys.path.append(os.path.join(_w, _u)) +import statistik +import liveabgleich + + +def hand(nr, netto, arm=None, bb=2000.0, vpip=False, pfr=False, showdown=False): + h = {"raum": "R 1", "hand": str(nr), "zeit": "2026-10-28T20:00:00Z", "bb": bb, + "stake": "1000/2000", "spielart": "NLHE", "netto": netto, "gewonnen": netto > 0, + "showdown": showdown, "vpip": vpip, "pfr": pfr, "aktionen": []} + if arm is not None: + h["arm"] = arm + return h + + +class JeArm(unittest.TestCase): + def test_gruppiert_nach_arm(self): + hs = [hand(1, 2000, "A"), hand(2, 4000, "A"), hand(3, -1000, "B")] + g = {r["arm"]: r for r in statistik.je_arm(hs)} + self.assertEqual(set(g), {"A", "B"}) + self.assertEqual(g["A"]["haende"], 2) + self.assertEqual(g["B"]["haende"], 1) + # bb/100 von Arm A: Mittel( (2000+4000)/2000 bb ) *100 = Mittel(1,2) *100 = 150 + self.assertAlmostEqual(g["A"]["bb_pro_100"], 150.0, places=6) + + def test_haende_ohne_arm_sind_unbekannt(self): + g = {r["arm"]: r for r in statistik.je_arm([hand(1, 100), hand(2, 100, "A")])} + self.assertEqual(g["unbekannt"]["haende"], 1) + self.assertEqual(g["A"]["haende"], 1) + + def test_leer(self): + self.assertEqual(statistik.je_arm([]), []) + + def test_in_kennzahlen_und_json(self): + import json + kz = statistik.kennzahlen_aus([hand(1, 100, "A"), hand(2, 200, "B")]) + self.assertIn("je_arm", kz) + self.assertEqual(len(kz["je_arm"]), 2) + json.dumps(kz) # JSON-faehig + + +class MdRendern(unittest.TestCase): + def test_arm_abschnitt_nur_wenn_arme_da(self): + ohne = statistik.md_aus(statistik.kennzahlen_aus([hand(1, 100), hand(2, 100)])) + self.assertNotIn("A/B je Arm", ohne) + mit = statistik.md_aus(statistik.kennzahlen_aus([hand(1, 100, "A"), hand(2, 100, "B")])) + self.assertIn("A/B je Arm", mit) + self.assertIn("liveabgleich.py --ab-log", mit) + + +class SignifikanzUeberArm(unittest.TestCase): + """Die Kette: Hände mit Arm-Marke -> ab_aus_log splittet am Feld 'arm' -> Welch-Test.""" + + def test_klarer_sieger_ist_signifikant(self): + # Arm A eng hoch (+100 bb/100), Arm B eng tief (-100). Grosse n, enge Streuung -> signifikant. + hs = ([hand(i, 2000, "A") for i in range(200)] # +1,0 bb/Hand = +100 bb/100 + + [hand(1000 + i, -2000, "B") for i in range(200)]) + erg = liveabgleich.ab_aus_log(hs, feld="arm", an_wert="A", aus_wert="B") + self.assertEqual(erg["an"]["n"], 200) + self.assertEqual(erg["aus"]["n"], 200) + self.assertAlmostEqual(erg["diff"], 200.0, places=3) # +100 - (-100) + self.assertTrue(erg["signifikant"]) + self.assertIn("SCHLÄGT", erg["urteil"]) + + def test_gleiche_arme_nicht_signifikant(self): + # Beide Arme dieselbe streuende Verteilung -> 0 liegt im Intervall der Differenz. + werte = [20000 if i % 2 else -20000 for i in range(80)] + hs = ([hand(i, werte[i], "A") for i in range(80)] + + [hand(1000 + i, werte[i], "B") for i in range(80)]) + erg = liveabgleich.ab_aus_log(hs, feld="arm", an_wert="A", aus_wert="B") + self.assertAlmostEqual(erg["diff"], 0.0, places=6) + self.assertFalse(erg["signifikant"]) + + def test_ein_arm_allein_kein_vergleich(self): + erg = liveabgleich.ab_aus_log([hand(i, 100, "A") for i in range(10)], feld="arm") + self.assertIsNone(erg["diff"]) + self.assertIn("nur ein Arm", erg["urteil"]) + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/allin_ev_spec.py b/tests/allin_ev_spec.py new file mode 100644 index 00000000..48f88ea3 --- /dev/null +++ b/tests/allin_ev_spec.py @@ -0,0 +1,214 @@ +#!/usr/bin/env python3 +"""Spezifikation lesen/allin_ev.py (Kern) - Equity + mittelwerttreue EV-Bewertung. + +Der zentrale Test ist die MITTELWERTTREUE: ueber viele simulierte All-ins muss der Mittelwert des +EV-Netto dem des realisierten Netto gleichen (bis auf Stichprobenrauschen), bei deutlich kleinerer +Varianz. Waere der EV nicht mittelwerttreu, verschoebe er die Winrate - ein stiller Verlierer. + + python3 tests/allin_ev_spec.py -v +""" +import os +import random +import sys +import unittest + +_w = os.path.dirname(os.path.abspath(__file__)) +while _w != "/" and not os.path.isdir(os.path.join(_w, "lesen")): + _w = os.path.dirname(_w) +sys.path.append(os.path.join(_w, "lesen")) +import allin_ev + + +class Equity(unittest.TestCase): + # Nur Postflop-Boards (3-5 Karten) - schnelle Enumeration. Die Preflop-Korrektheit von + # equity_vs deckt entscheiden/eval7._selftest ab; preflop enumeriert 1,7 Mio. Runouts (langsam). + def test_river_entschieden(self): + # River -> 0 oder 1 (kein Wurf mehr offen): Top Pair K schlaegt QQ. + self.assertEqual(allin_ev.equity("Kc 7s", "Qc 2h Kd 6d 8d", ["Ad Qh"]), 1.0) + + def test_flop_overpair_weit_vorn(self): + # AA (Overpair) gegen Top Pair KQ auf K72 -> klar vorn (eval7._selftest: > 0.78). + eq = allin_ev.equity("Ac Ad", "Kc 7h 2s", ["Kh Qd"]) + self.assertGreater(eq, 0.78) # eval7._selftest: > 0.78 + self.assertLess(eq, 0.90) + + def test_turn_karte_dreht_die_lage(self): + # Eine Karte weiter (Turn Qc) hat der Gegner Zwei Paar KQ -> AA faellt weit zurueck. + eq = allin_ev.equity("Ac Ad", "Kc 7h 2s Qc", ["Kh Qd"]) + self.assertLess(eq, 0.30) # vom klaren Vorsprung (0.82) zum Aussenseiter (0.18) + + def test_ohne_gegner_none(self): + self.assertIsNone(allin_ev.equity("Ah Kh", [], [])) + + +class BoardBis(unittest.TestCase): + def test_schneidet_auf_street(self): + b = ["Tc", "7h", "2s", "Kd", "8c"] + self.assertEqual(allin_ev.board_bis(b, "PREFLOP"), []) + self.assertEqual(allin_ev.board_bis(b, "FLOP"), ["Tc", "7h", "2s"]) + self.assertEqual(allin_ev.board_bis(b, "TURN"), ["Tc", "7h", "2s", "Kd"]) + self.assertEqual(allin_ev.board_bis(b, "RIVER"), b) + + +class EvFormel(unittest.TestCase): + def test_grenzwerte(self): + self.assertEqual(allin_ev.ev_netto_bb(1.0, 50.0, -50.0), 50.0) # sicher gewonnen + self.assertEqual(allin_ev.ev_netto_bb(0.0, 50.0, -50.0), -50.0) # sicher verloren + self.assertEqual(allin_ev.ev_netto_bb(0.5, 50.0, -50.0), 0.0) # Flip -> 0 + + def test_asymmetrische_beine(self): + # Hero riskiert 30 bb, gewinnt 70 bb (Gegner deckt nicht ganz). eq=0.4. + self.assertAlmostEqual(allin_ev.ev_netto_bb(0.4, 70.0, -30.0), 0.4 * 70 - 0.6 * 30) + + +class Mittelwerttreue(unittest.TestCase): + """Der Kern-Beweis: EV ist mittelwerttreu, nur varianzaermer.""" + + def test_gleicher_mittelwert_kleinere_varianz(self): + rng = random.Random(0xA11) + n = 40000 + real, ev = [], [] + for _ in range(n): + eq = rng.random() # wahre Gewinnwahrscheinlichkeit + sieg, pleite = 50.0, -50.0 # symmetrischer All-in (50 bb) + gewann = rng.random() < eq # der Wurf faellt mit Wahrscheinlichkeit eq + real.append(sieg if gewann else pleite) + ev.append(allin_ev.ev_netto_bb(eq, sieg, pleite)) + m_real = sum(real) / n + m_ev = sum(ev) / n + # Mittelwerte gleich (bis auf Stichprobenrauschen ~ sigma/sqrt(n), sigma=50 -> ~0.25). + self.assertLess(abs(m_real - m_ev), 1.0) + # EV hat deutlich kleinere Varianz als das realisierte 0/1-Ergebnis. + def var(xs, m): + return sum((x - m) ** 2 for x in xs) / len(xs) + self.assertLess(var(ev, m_ev), 0.5 * var(real, m_real)) + + def test_bedingter_erwartungswert_pro_hand(self): + # EV_i ist genau E[realisiert_i | eq_i]: fuer eq und (sieg,pleite) exakt eq*sieg+(1-eq)*pleite. + for eq in (0.17, 0.5, 0.83): + erwartet = eq * 80 + (1 - eq) * (-40) + self.assertAlmostEqual(allin_ev.ev_netto_bb(eq, 80.0, -40.0), erwartet) + + +def daten(hero_k, vill_k, board, allin_street, hero_netto, vill_netto, + bb=2.0, einsatz_hero=100.0, einsatz_vill=100.0, merker=None, dritter=False, + beide_auf=True, hero_allin=True): + """Eine Hand in der Form, die ergebnis._rechnung liefert (plaetze/reveal/board/merker).""" + hero_akt = [{"street": allin_street, "aktion": "ALL_IN" if hero_allin else "BET", "betrag": einsatz_hero}] + vill_akt = [{"street": allin_street, "aktion": "CALL", "betrag": einsatz_vill}] + pl = {"hero": {"sitz": 0, "einsatz": einsatz_hero, "netto": hero_netto, "aktionen": hero_akt}, + "gegner": {"sitz": 1, "einsatz": einsatz_vill, "netto": vill_netto, "aktionen": vill_akt}} + if dritter: + pl["dritter"] = {"sitz": 2, "einsatz": 0.0, "netto": 0.0, "aktionen": []} + reveal = {0: hero_k, 1: vill_k} if beide_auf else {0: hero_k} + return {"bb": bb, "plaetze": pl, "reveal": reveal, "hole": hero_k, "board": board, + "merker": merker or {}} + + +# AA vs KQ auf K72 -> eq_AA = 0.8162 (siehe Equity-Tests). Bei +98/-100 (bb=2): +# EV_hero(AA) = 0.8162*98 + 0.1838*(-100) = 61.61 chips -> /2 = 30.80 bb +BOARD = ["Kc", "7h", "2s", "Qc", "3d"] + + +class AusDaten(unittest.TestCase): + def test_qualifiziert_flop_allin_hero_gewinnt(self): + d = daten(["Ac", "Ad"], ["Kh", "Qd"], BOARD, "FLOP", hero_netto=98.0, vill_netto=-100.0) + r = allin_ev.aus_daten(d, "hero") + self.assertTrue(r["qualifiziert"], r["grund"]) + self.assertEqual(r["street"], "FLOP") + self.assertEqual(r["board_allin"], ["Kc", "7h", "2s"]) # nur bis Flop + self.assertAlmostEqual(r["equity"], 0.8162, places=3) + self.assertEqual(r["netto_bb"], 49.0) # realisiert: gewann +98/2 + self.assertAlmostEqual(r["netto_ev_bb"], 30.80, places=1) # EV < realisiert (18 % Gegenchance) + + def test_rolle_getauscht_hero_verliert_gleiche_hand(self): + # Hero hat KQ und verlor; EV nutzt dieselben Beine -> symmetrisch zur Siegversion. + d = daten(["Kh", "Qd"], ["Ac", "Ad"], BOARD, "FLOP", hero_netto=-100.0, vill_netto=98.0) + r = allin_ev.aus_daten(d, "hero") + self.assertTrue(r["qualifiziert"], r["grund"]) + self.assertAlmostEqual(r["equity"], 0.1838, places=3) # KQ-Equity + self.assertEqual(r["netto_bb"], -50.0) + # EV = 0.1838*98 + 0.8162*(-100) = -63.6 -> /2 = -31.8 (weniger schlimm als -50) + self.assertAlmostEqual(r["netto_ev_bb"], -31.8, places=1) + self.assertGreater(r["netto_ev_bb"], r["netto_bb"]) # EV mildert den Ausreisser + + def test_turn_allin_schneidet_board_bis_turn(self): + d = daten(["Ac", "Ad"], ["Kh", "Qd"], BOARD, "TURN", hero_netto=-100.0, vill_netto=98.0) + r = allin_ev.aus_daten(d, "hero") + self.assertEqual(r["board_allin"], ["Kc", "7h", "2s", "Qc"]) # bis Turn + self.assertLess(r["equity"], 0.30) # AA auf K72Q nur noch ~0.18 + + def test_mittelwerttreue_pro_hand(self): + # netto_ev_bb muss exakt eq*Sieger + (1-eq)*Verlierer /bb sein (die Beine beobachtet). + d = daten(["Ac", "Ad"], ["Kh", "Qd"], BOARD, "FLOP", hero_netto=98.0, vill_netto=-100.0) + r = allin_ev.aus_daten(d, "hero") + eq = r["equity"] + erwartet = (eq * 98.0 + (1 - eq) * (-100.0)) / 2.0 + self.assertAlmostEqual(r["netto_ev_bb"], round(erwartet, 4), places=2) + + +class Gating(unittest.TestCase): + def _raw_bleibt(self, d): + r = allin_ev.aus_daten(d, "hero") + self.assertFalse(r["qualifiziert"]) + self.assertEqual(r["netto_ev_bb"], r["netto_bb"]) # roh, wenn nicht qualifiziert + return r + + def test_ev_chop_raus(self): + d = daten(["Ac", "Ad"], ["Kh", "Qd"], BOARD, "FLOP", 98.0, -100.0, merker={"ev_chop": True}) + self.assertIn("Sonderfall", self._raw_bleibt(d)["grund"]) + + def test_rit_raus(self): + d = daten(["Ac", "Ad"], ["Kh", "Qd"], BOARD, "FLOP", 98.0, -100.0, merker={"rit": True}) + self._raw_bleibt(d) + + def test_dreihand_raus(self): + d = daten(["Ac", "Ad"], ["Kh", "Qd"], BOARD, "FLOP", 98.0, -100.0, dritter=True) + self.assertEqual(self._raw_bleibt(d)["grund"], "nicht heads-up") + + def test_nicht_beide_aufgedeckt_raus(self): + d = daten(["Ac", "Ad"], ["Kh", "Qd"], BOARD, "FLOP", 98.0, -100.0, beide_auf=False) + self.assertEqual(self._raw_bleibt(d)["grund"], "nicht beide aufgedeckt") + + def test_river_allin_raus(self): + d = daten(["Ac", "Ad"], ["Kh", "Qd"], BOARD, "RIVER", 98.0, -100.0) + self.assertIn("River", self._raw_bleibt(d)["grund"]) + + def test_seitenpott_raus(self): + d = daten(["Ac", "Ad"], ["Kh", "Qd"], BOARD, "FLOP", 150.0, -100.0, + einsatz_hero=200.0, einsatz_vill=100.0) # ungleiche Einsaetze + self.assertIn("Seiten-Pott", self._raw_bleibt(d)["grund"]) + + def test_preflop_jetzt_bepreist_ueber_mc(self): + # Preflop-All-in wird jetzt bepreist (seed-det. Monte-Carlo statt 1,7M-Enumeration). + # AA vs KQ preflop ~0.87 (KQo schwaecher als KK -> gewinnt weniger als dessen 18 %; drei + # unabhaengige Evaluatoren bestaetigen 0.871). board_bis(PREFLOP)=[] -> MC, realer Runout egal. + d = daten(["Ac", "Ad"], ["Kh", "Qd"], BOARD, "PREFLOP", 98.0, -100.0) + r = allin_ev.aus_daten(d, "hero") + self.assertTrue(r["qualifiziert"], r["grund"]) + self.assertEqual(r["street"], "PREFLOP") + self.assertEqual(r["board_allin"], []) + self.assertGreater(r["equity"], 0.82) # AA klar vorn gegen zwei Unterkarten + self.assertLess(r["equity"], 0.92) + self.assertLess(r["netto_ev_bb"], r["netto_bb"]) # EV < realisierter Sieg (+49) + + def test_preflop_reproduzierbar(self): + # Gleiche Karten -> gleiche MC-Schaetzung (Seed aus den Karten), auch ueber A/B-Arme. + d = daten(["Ac", "Ad"], ["Kh", "Qd"], BOARD, "PREFLOP", 98.0, -100.0) + self.assertEqual(allin_ev.aus_daten(d, "hero")["equity"], + allin_ev.aus_daten(d, "hero")["equity"]) + + def test_kein_allin_raus(self): + d = daten(["Ac", "Ad"], ["Kh", "Qd"], BOARD, "FLOP", 98.0, -100.0, hero_allin=False) + # villain hat nur CALL, hero nur BET -> kein ALL_IN + d["plaetze"]["gegner"]["aktionen"] = [{"street": "FLOP", "aktion": "CALL", "betrag": 100.0}] + self.assertEqual(self._raw_bleibt(d)["grund"], "kein All-in") + + +class AusText(unittest.TestCase): + def test_leerer_text_keine_haende(self): + self.assertEqual(allin_ev.aus_text("", "mmintel"), []) + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/einblick_spec.py b/tests/einblick_spec.py new file mode 100644 index 00000000..79c08585 --- /dev/null +++ b/tests/einblick_spec.py @@ -0,0 +1,113 @@ +#!/usr/bin/env python3 +"""Spezifikation lesen/einblick.py - der statistische Leak-Finder aus den geloggten Zuegen. + +Jede Kennzahl wird hier von Hand nachgerechnet, nicht aus derselben Funktion zurueckgelesen. + + python3 tests/einblick_spec.py -v +""" +import os +import sys +import unittest + +_w = os.path.dirname(os.path.abspath(__file__)) +while _w != "/" and not os.path.isdir(os.path.join(_w, "lesen")): + _w = os.path.dirname(_w) +sys.path.append(os.path.join(_w, "lesen")) +import einblick + + +def zug(street, aktion, grund=None, klasse=None, arm=None): + z = {"street": street, "aktion": aktion, "grund": grund, "klasse": klasse} + if arm is not None: + z["arm"] = arm + return z + + +class JeStreet(unittest.TestCase): + def test_aggressiv_und_fold_anteil(self): + zs = [zug("FLOP", "BET"), zug("FLOP", "RAISE"), zug("FLOP", "CHECK"), zug("FLOP", "FOLD")] + r = {x["street"]: x for x in einblick.aktionen_je_street(zs)}["FLOP"] + self.assertEqual(r["zuege"], 4) + self.assertEqual(r["aggressiv"], 0.5) # BET+RAISE = 2/4 + self.assertEqual(r["fold"], 0.25) # 1/4 + self.assertEqual(r["aktionen"], {"BET": 1, "RAISE": 1, "CHECK": 1, "FOLD": 1}) + + def test_leere_street_faellt_weg(self): + r = einblick.aktionen_je_street([zug("PREFLOP", "FOLD")]) + self.assertEqual([x["street"] for x in r], ["PREFLOP"]) # nur PREFLOP, kein FLOP/TURN/RIVER + + def test_reihenfolge_ist_street_reihenfolge(self): + zs = [zug("RIVER", "CHECK"), zug("PREFLOP", "FOLD"), zug("TURN", "BET")] + self.assertEqual([x["street"] for x in einblick.aktionen_je_street(zs)], + ["PREFLOP", "TURN", "RIVER"]) + + +class Position(unittest.TestCase): + def test_parst_bekannte_position(self): + self.assertEqual(einblick.position("MP open"), "MP") + self.assertEqual(einblick.position("SB vs limp"), "SB") + self.assertEqual(einblick.position("BTN open, 2.5x"), "BTN") + + def test_unbekanntes_ist_none(self): + self.assertIsNone(einblick.position("air on dry board")) + self.assertIsNone(einblick.position("")) + self.assertIsNone(einblick.position(None)) + + def test_je_position_nur_vorflop_mit_position(self): + zs = [zug("PREFLOP", "RAISE", "MP open"), zug("PREFLOP", "FOLD", "MP open"), + zug("PREFLOP", "FOLD", "UTG open"), + zug("FLOP", "BET", "MP cbet")] # postflop -> ignoriert + r = {x["position"]: x for x in einblick.vorflop_je_position(zs)} + self.assertEqual(set(r), {"MP", "UTG"}) + self.assertEqual(r["MP"]["zuege"], 2) + self.assertEqual(r["MP"]["aggressiv"], 0.5) # 1 RAISE / 2 + self.assertEqual(r["MP"]["fold"], 0.5) + + +class KlassenPostflop(unittest.TestCase): + def test_leak_finder_gecheckte_klasse(self): + zs = [zug("FLOP", "CHECK", klasse="ThreeOfAKind"), zug("TURN", "BET", klasse="ThreeOfAKind"), + zug("PREFLOP", "RAISE", klasse="ThreeOfAKind")] # preflop ignoriert + r = {x["klasse"]: x for x in einblick.klassen_postflop(zs)}["ThreeOfAKind"] + self.assertEqual(r["zuege"], 2) + self.assertEqual(r["aktionen"], {"CHECK": 1, "BET": 1}) + self.assertEqual(r["aggressiv"], 0.5) + + def test_ohne_klasse_faellt_weg(self): + self.assertEqual(einblick.klassen_postflop([zug("FLOP", "BET")]), []) + + +class GrundTags(unittest.TestCase): + def test_faltet_zahlen_weg(self): + zs = [zug("FLOP", "BET", "middle pair on wet board: equity 0.62 vs x"), + zug("TURN", "BET", "middle pair on wet board: equity 0.14 vs y"), + zug("FLOP", "CHECK", "air on dry board (2-way), fold")] + t = {x["tag"]: x["n"] for x in einblick.grund_tags(zs)} + self.assertEqual(t["middle pair on wet board"], 2) # beide equity-Varianten gefaltet + self.assertEqual(t["air on dry board (2-way)"], 1) + + +class Arm(unittest.TestCase): + def test_arm_filter(self): + zs = [zug("FLOP", "BET", arm="A"), zug("FLOP", "CHECK", arm="B"), zug("FLOP", "FOLD", arm="A")] + self.assertEqual(einblick.bericht(zs, arm="A")["zuege"], 2) + self.assertEqual(einblick.bericht(zs, arm="B")["zuege"], 1) + self.assertEqual(einblick.bericht(zs)["zuege"], 3) # None = alle + + +class BerichtUndText(unittest.TestCase): + def test_json_faehig_und_text(self): + import json + b = einblick.bericht([zug("PREFLOP", "RAISE", "MP open"), + zug("FLOP", "BET", "cbet", klasse="Pair")]) + json.dumps(b) + t = einblick.text(b) + self.assertIn("Einblick", t) + self.assertIn("je Street", t) + + def test_leer_kein_absturz(self): + einblick.text(einblick.bericht([])) + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/engine_read_gate.rs b/tests/engine_read_gate.rs index 220a2fb0..140a2eab 100644 --- a/tests/engine_read_gate.rs +++ b/tests/engine_read_gate.rs @@ -3,7 +3,7 @@ //! blinde Grundspiel zurueck (Profil -> None). Belegt an der Leiter: mit Read verliert sie dort, //! blind nicht. -use rechner::engine::read_gate::{exploit_worthy, gate_reads}; +use rechner::engine::read_gate::{earned_trust, exploit_worthy, gate_reads}; use rechner::exploit::profile::Profile; use rechner::exploit::style::Style; use rechner::game::{ActionKind, Spot, Street, Villain}; @@ -49,6 +49,21 @@ fn nur_die_calling_station_ist_ausbeutungswuerdig() { assert!(!exploit_worthy(Style::Unknown)); } +#[test] +fn die_earned_trust_tabelle_treibt_den_riegel() { + // Stage 3: der Riegel ist eine Stil-Tabelle, kein fester Fall. Nur der Ueberzahler ist auf der + // Leiter bewiesen (1.0); jeder starke Stil kostete im Experiment und bleibt blind (0.0). Der + // Riegel ist genau "earned_trust > 0". + assert_eq!(earned_trust(Style::CallingStation), 1.0); + assert_eq!(earned_trust(Style::Regular), 0.0); + assert_eq!(earned_trust(Style::Nit), 0.0); + assert_eq!(earned_trust(Style::LooseAggressive), 0.0); + assert_eq!(earned_trust(Style::Unknown), 0.0); + for style in [Style::CallingStation, Style::Regular, Style::Nit, Style::LooseAggressive, Style::Unknown] { + assert_eq!(exploit_worthy(style), earned_trust(style) > 0.0, "{style:?}"); + } +} + #[test] fn der_read_eines_regs_wird_fallen_gelassen() { // Reg (0.26/0.19/0.50/0.50) -> Regular -> blind: Profil weg. diff --git a/tests/eval7_mc_spec.py b/tests/eval7_mc_spec.py new file mode 100644 index 00000000..b1790261 --- /dev/null +++ b/tests/eval7_mc_spec.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python3 +"""Spezifikation entscheiden/eval7: der schnelle 7-Karten-Wert `score7` und die Monte-Carlo-Equity +`equity_mc` (fuer den Preflop-All-in der All-in-EV, lesen/allin_ev). + +Zwei Beweise: + 1) score7 == best7 (Ground Truth) ueber zehntausende Zufallshaende -> der schnelle Pfad ist + beweisbar gleichwertig zur 21-Kombinationen-Enumeration. Ein Unterschied waere ein falscher + Showdown-Gewinner und damit falsche Equity. + 2) equity_mc ist UNVERZERRT: auf einem Board, wo equity_vs exakt bezahlbar ist (Flop/Turn), liegt + der MC-Schaetzer im MC-Rauschen am exakten Wert. Unverzerrte Equity -> mittelwerttreue All-in-EV. + + python3 tests/eval7_mc_spec.py -v +""" +import gc +import os +import random +import sys +import unittest + +_w = os.path.dirname(os.path.abspath(__file__)) +while _w != "/" and not os.path.isdir(os.path.join(_w, "entscheiden")): + _w = os.path.dirname(_w) +sys.path.append(os.path.join(_w, "entscheiden")) +import eval7 + + +class Score7GleichBest7(unittest.TestCase): + def test_zufallshaende_identisch(self): + rng = random.Random(0) + deck = list(eval7.VOLLDECK) + n, bad = 15000, [] + gc.disable() + try: + for _ in range(n): + h = rng.sample(deck, 7) + a, b = eval7.score7(h), eval7.best7(h) + if a != b and len(bad) < 5: + bad.append((h, a, b)) + finally: + gc.enable() + self.assertEqual(bad, [], f"score7 != best7 bei: {bad}") + + def test_strukturierte_kategorien(self): + # je Kategorie eine Hand, bei der die 5 besten aus 7 nicht trivial sind + faelle = [ + "As Ks Qs Js Ts 2h 3d", # Straight Flush + "As Ad Ac Ah Kd 2c 3s", # Vierling + Kicker + "Ac Ad Ks Kh Qd Qc 2s", # drei Paare AA/KK/QQ -> bestes ist zwei Paare AAKK + Q-Kicker + "2h 3h 4h 5h 6h As Kd", # Straight Flush tief (nicht Wheel) + hohe Beikarten + "Ah 2d 3c 4s 5h 9d Kc", # Wheel-Straight + "Ah Kh Qh 2h 7h 3d 4s", # Flush, 5 aus Herz + "Ac Ad 7h 7s Kd Qc 2h", # zwei Paare + Kicker + ] + for f in faelle: + h = eval7.karten(f) + self.assertEqual(eval7.score7(h), eval7.best7(h), f) + + +class EquityMcUnverzerrt(unittest.TestCase): + def test_flop_mc_nahe_exakt(self): + # Flop AA vs KQ auf K72: exakt billig (990 Runouts). MC muss im Rauschen danebenliegen. + board = eval7.karten("Kc 7h 2s") + ex = eval7.equity_vs("Ac Ad", board, ["Kh Qd"]) + mc = eval7.equity_mc("Ac Ad", board, ["Kh Qd"], laeufe=3000, seed=1) + self.assertAlmostEqual(mc, ex, delta=0.03) # 3000 Laeufe -> ~0.9 % 1-Sigma + + def test_board_voll_ist_exakt(self): + # 5 Karten -> kein Wurf mehr offen: equity_mc faellt auf equity_vs zurueck (deterministisch). + self.assertEqual(eval7.equity_mc("Kc 7s", eval7.karten("Qc 2h Kd 6d 8d"), ["Ad Qh"]), 1.0) + + def test_seed_reproduzierbar(self): + a = eval7.equity_mc("Ah Ks", [], ["Qc Jd"], laeufe=1500, seed=42) + b = eval7.equity_mc("Ah Ks", [], ["Qc Jd"], laeufe=1500, seed=42) + self.assertEqual(a, b) # gleicher Seed -> bit-identisch + c = eval7.equity_mc("Ah Ks", [], ["Qc Jd"], laeufe=1500, seed=43) + self.assertNotEqual(a, c) # anderer Seed -> andere Ziehung + + def test_preflop_aa_vs_kk_plausibel(self): + # AA vs KK preflop ~0.82 (Lehrbuch). MC mit 4000 Laeufen muss nah dran sein. + eq = eval7.equity_mc("Ac Ad", [], ["Kc Kh"], laeufe=4000, seed=7) + self.assertGreater(eq, 0.78) + self.assertLess(eq, 0.86) + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/gegnersignal_spec.py b/tests/gegnersignal_spec.py new file mode 100644 index 00000000..0b3d0b67 --- /dev/null +++ b/tests/gegnersignal_spec.py @@ -0,0 +1,125 @@ +#!/usr/bin/env python3 +"""Spezifikation des Gegnersignals (lesen/gegnersignal.py) - Produzent des Ausnutz-Signals. + +Fixtures: ein enger Spieler (nur Premiumhaende), ein lockerer/bluffiger (Muell am Showdown), ein +duenner (2 Haende). Geprueft: Rangfolge, Konfidenz waechst mit der Stichprobe, Schrumpfung zum +Prior, sizing_tell-Vorzeichen, neutrale Werte ohne Daten, Kein-HUD-Doppeln. + + python3 tests/gegnersignal_spec.py -v +""" +import os +import sys +import unittest + +_w = os.path.dirname(os.path.abspath(__file__)) +while _w != "/" and not os.path.isdir(os.path.join(_w, "lesen")): + _w = os.path.dirname(_w) +for _u in ("lesen",): + _q = os.path.join(_w, _u) + if os.path.isdir(_q): + sys.path.append(_q) + +import gedaechtnis +import gegnersignal + +PREMIUM = [["Ah", "Ad"], ["Kc", "Kd"], ["As", "Ks"], ["Qh", "Qd"], ["Ac", "Qc"], + ["Jh", "Jd"], ["Ad", "Kh"], ["Tc", "Td"]] +MUELL = [["7h", "2d"], ["9c", "3s"], ["8d", "4h"], ["Jc", "5s"], ["6h", "2c"], + ["Td", "3h"], ["9s", "4d"], ["7c", "3d"]] + + +def spieler(haende, sizing=()): + e = gedaechtnis.leer() + e = gedaechtnis.ergaenzen(e, gezeigt=haende) + for s in sizing: + e = gedaechtnis.ergaenzen(e, sizing=s) + return e + + +class Staerke(unittest.TestCase): + def test_ordnung(self): + s = gegnersignal.staerke + self.assertGreater(s(["Ah", "Ad"]), s(["Ah", "Kd"])) + self.assertGreater(s(["Ah", "Kh"]), s(["Ah", "Kd"])) # gleiche Farbe + self.assertGreater(s(["Kh", "Qd"]), s(["7h", "2d"])) + self.assertGreater(s(["Ah", "Ad"]), 0.95) + self.assertLess(s(["7h", "2d"]), 0.1) + + def test_ungueltig_ist_none(self): + self.assertIsNone(gegnersignal.staerke(["Ah"])) + self.assertIsNone(gegnersignal.staerke(["Ah", "Ah"])) + self.assertIsNone(gegnersignal.staerke(["Xx", "Kd"])) + + +class Rangfolge(unittest.TestCase): + def setUp(self): + self.eng = gegnersignal.signal(spieler(PREMIUM)) + self.locker = gegnersignal.signal(spieler(MUELL)) + self.duenn = gegnersignal.signal(spieler(PREMIUM[:2])) + + def test_tightness_eng_ueber_locker(self): + self.assertGreater(self.eng["range_tightness"], 0.7) + self.assertLess(self.locker["range_tightness"], 0.35) + + def test_bluffrate_locker_ueber_eng(self): + self.assertGreater(self.locker["showdown_bluff_rate"], 0.6) + self.assertLess(self.eng["showdown_bluff_rate"], 0.2) + + def test_duenn_wird_zum_prior_geschrumpft(self): + # gleiche Premiumhaende, aber nur 2: weniger extrem als mit 8 + self.assertLess(self.duenn["range_tightness"], self.eng["range_tightness"]) + self.assertGreater(self.duenn["range_tightness"], 0.5) + self.assertGreater(self.duenn["tightness_roh"], self.duenn["range_tightness"]) + + def test_konfidenz_waechst_mit_stichprobe(self): + k = [gegnersignal.signal(spieler(PREMIUM[:n]))["konfidenz"] for n in (0, 2, 5, 8)] + self.assertEqual(k[0], 0.0) + self.assertEqual(k, sorted(k)) + self.assertLess(k[1], 0.3) + self.assertGreater(k[3], 0.5) + self.assertEqual(self.duenn["n_gezeigt"], 2) + self.assertEqual(self.eng["n_gezeigt"], 8) + + +class Sizing(unittest.TestCase): + def test_gross_heisst_stark_beim_engen(self): + s = gegnersignal.signal(spieler(PREMIUM, ["pot", "over"] * 6 + ["mini"])) + self.assertGreater(s["sizing_tell"], 0.1) + + def test_gross_heisst_bluff_beim_lockeren(self): + s = gegnersignal.signal(spieler(MUELL, ["pot", "over"] * 6 + ["mini"])) + self.assertLess(s["sizing_tell"], -0.1) + + def test_ohne_daten_kein_tell(self): + self.assertEqual(gegnersignal.signal(spieler(PREMIUM))["sizing_tell"], 0.0) + self.assertEqual(gegnersignal.signal(spieler([], ["pot"] * 10))["sizing_tell"], 0.0) + + def test_duenne_stichprobe_daempft_den_tell(self): + dick = gegnersignal.signal(spieler(PREMIUM, ["over"] * 12))["sizing_tell"] + duenn = gegnersignal.signal(spieler(PREMIUM[:2], ["over"] * 12))["sizing_tell"] + self.assertGreater(abs(dick), abs(duenn)) + + +class Neutral(unittest.TestCase): + def test_leer_und_none_sind_prior_mit_konfidenz_null(self): + for e in (None, {}, gedaechtnis.leer()): + s = gegnersignal.signal(e) + self.assertEqual(s["konfidenz"], 0.0) + self.assertEqual(s["range_tightness"], 0.5) + self.assertEqual(s["n_gezeigt"], 0) + self.assertIsNone(s["tightness_roh"]) + + def test_kein_hud_feld_im_signal(self): + s = gegnersignal.signal(spieler(PREMIUM)) + self.assertTrue(gedaechtnis.VERBOTEN.isdisjoint(s)) + + def test_signale_je_kennung_und_unveraendert(self): + sp = gedaechtnis.merken({}, 7, gezeigt=[["Ah", "Ad"]]) + vorher = repr(sp) + out = gegnersignal.signale(sp) + self.assertEqual(set(out), {"7"}) + self.assertEqual(repr(sp), vorher) + + +if __name__ == "__main__": + unittest.main(verbosity=2) diff --git a/tests/kalibrierung_spec.py b/tests/kalibrierung_spec.py new file mode 100644 index 00000000..c0ed47e4 --- /dev/null +++ b/tests/kalibrierung_spec.py @@ -0,0 +1,142 @@ +#!/usr/bin/env python3 +"""Spezifikation der Populations-Kalibrierung (Stufe 1 des Gegner-Labors). + +Je echtem Spieler der HUD-Vektor -> naechster der vier Archetypen -> Zaehlen -> Gewichte. +Geprueft wird gegen SYNTHETISCHE Spieler mit bekannten HUDs nahe je Archetyp (in der Form, wie +profil/gedaechtnis sie liefern): richtige Zuordnung, richtige Gewichte, Schema des Ergebnisses, +Round-Trip ueber die Platte, fehlende Achse, duenne/kaputte Eingaben und das Lesen aus einem +hud_stats-Mitschrieb. + + python3 tests/kalibrierung_spec.py -v +""" +import json +import os +import sys +import tempfile +import unittest + +_w = os.path.dirname(os.path.abspath(__file__)) +while _w != "/" and not os.path.isdir(os.path.join(_w, "lesen")): + _w = os.path.dirname(_w) +for _u in ("lesen",): + _q = os.path.join(_w, _u) + if os.path.isdir(_q): + sys.path.append(_q) + +import kalibrierung + + +def _nahe(name, versatz=0.0): + """Ein HUD nahe dem Archetyp `name` (um `versatz` verschoben, im Bereich 0..1 gehalten).""" + return {a: min(max(w + versatz, 0.0), 1.0) for a, w in kalibrierung.ARCHETYPEN[name].items()} + + +def _feld(zahlen): + """{kennung: HUD}: `zahlen` = {archetyp: Anzahl}, leicht gestreut (+-0.03).""" + spieler = {} + k = 0 + for name, anzahl in zahlen.items(): + for i in range(anzahl): + spieler[str(1000 + k)] = _nahe(name, (-0.03, 0.0, 0.03)[i % 3]) + k += 1 + return spieler + + +class Zuordnung(unittest.TestCase): + def test_jeder_archetyp_trifft_sich_selbst(self): + for name in kalibrierung.NAMEN: + self.assertEqual(kalibrierung.klassifizieren(_nahe(name)), name) + + def test_gestreute_spieler_landen_im_richtigen_haufen(self): + for name in kalibrierung.NAMEN: + for v in (-0.04, 0.04): + self.assertEqual(kalibrierung.klassifizieren(_nahe(name, v)), name) + + def test_ohne_aggression_zaehlen_die_uebrigen_achsen(self): + hud = _nahe("fish") + del hud["aggression"] + self.assertEqual(kalibrierung.klassifizieren(hud), "fish") + self.assertEqual(kalibrierung.klassifizieren({"vpip": 0.06, "pfr": 0.03}), "nit") + + def test_ohne_jede_achse_keine_zuordnung(self): + self.assertIsNone(kalibrierung.klassifizieren({})) + self.assertIsNone(kalibrierung.klassifizieren({"cbet": 0.5})) + self.assertIsNone(kalibrierung.klassifizieren("quatsch")) + + +class Gewichte(unittest.TestCase): + def test_bekannte_mischung_wird_zurueckgewonnen(self): + spec = kalibrierung.kalibrieren(_feld({"fish": 7, "reg": 6, "nit": 4, "maniac": 3})) + self.assertEqual(spec["n_players"], 20) + w = spec["weights"] + self.assertAlmostEqual(w["fish"], 0.35) + self.assertAlmostEqual(w["reg"], 0.30) + self.assertAlmostEqual(w["nit"], 0.20) + self.assertAlmostEqual(w["maniac"], 0.15) + + def test_gewichte_summieren_zu_eins(self): + spec = kalibrierung.kalibrieren(_feld({"fish": 1, "reg": 5, "maniac": 2})) + self.assertAlmostEqual(sum(spec["weights"].values()), 1.0) + self.assertEqual(spec["weights"]["nit"], 0.0) + + def test_leere_eingabe_gibt_none(self): + self.assertIsNone(kalibrierung.kalibrieren({})) + self.assertIsNone(kalibrierung.kalibrieren(None)) + + +class Schema(unittest.TestCase): + def test_schluessel_und_streuung(self): + spec = kalibrierung.kalibrieren(_feld({"fish": 3, "reg": 3, "nit": 3, "maniac": 3}), quelle="test") + self.assertEqual(set(spec), {"n_players", "weights", "spread_hud", "quelle"}) + self.assertEqual(spec["quelle"], "test") + self.assertEqual(set(spec["weights"]), set(kalibrierung.NAMEN)) + self.assertEqual(set(spec["spread_hud"]["fish"]), set(kalibrierung.ACHSEN)) + # Versatz -0.03/0/+0.03 -> Std 0.03; vpip des fish ist bei 0.93+0.03 auf <=1 gekappt, daher pfr pruefen + self.assertAlmostEqual(spec["spread_hud"]["reg"]["pfr"], 0.03, places=6) + + def test_streuung_fehlt_ohne_zwei_spieler_je_haufen(self): + spec = kalibrierung.kalibrieren({"1": _nahe("reg"), "2": _nahe("nit")}) + self.assertNotIn("spread_hud", spec) + + def test_haufen_mittel(self): + h = kalibrierung.haufen(_feld({"reg": 3})) + self.assertEqual(h["reg"]["n"], 3) + self.assertAlmostEqual(h["reg"]["mittel"]["vpip"], 0.31, places=6) + self.assertEqual(h["fish"]["n"], 0) + + +class Platte(unittest.TestCase): + def test_speichern_und_laden_round_trip(self): + spec = kalibrierung.kalibrieren(_feld({"fish": 2, "reg": 2}), quelle="t") + with tempfile.TemporaryDirectory() as d: + pfad = os.path.join(d, "archiv", "population.json") + kalibrierung.speichern(pfad, spec) + with open(pfad, encoding="utf-8") as f: + self.assertEqual(json.load(f), spec) + + def test_json_quelle_klemmt_und_ignoriert_muell(self): + roh = {"1": {"vpip": 1.4, "pfr": "x"}, "2": "kein dict", "3": {"cbet": 0.5}} + self.assertEqual(kalibrierung.aus_json(roh), {"1": {"vpip": 1.0}}) + + def test_fehlende_quelle_ist_leer(self): + self.assertEqual(kalibrierung.laden("/gibt/es/nicht.json"), {}) + self.assertEqual(kalibrierung.laden("/gibt/es/nicht.log"), {}) + + def test_mitschrieb_wird_gelesen_und_duenne_fallen_raus(self): + def eintrag(kennung, **w): + return {kennung: {"1": w}} + dick = eintrag("11", vpip=93, pfr=1, fta=40, fold=50) + # drei Werte genau 0/100 -> duenn + duenn = eintrag("12", vpip=100, pfr=0, fta=0, fold=50) + text = "" + for e in (dick, duenn): + text += '{"api":"hud_stats","msg":' + json.dumps(e) + "}\n" + hud = kalibrierung.aus_log(text) + self.assertEqual(set(hud), {"11"}) + self.assertAlmostEqual(hud["11"]["vpip"], 0.93) + self.assertAlmostEqual(hud["11"]["foldToBet"], 0.40) + self.assertEqual(kalibrierung.klassifizieren(hud["11"]), "fish") + + +if __name__ == "__main__": + unittest.main(verbosity=2) diff --git a/tests/liveabgleich_spec.py b/tests/liveabgleich_spec.py new file mode 100644 index 00000000..c9bda57b --- /dev/null +++ b/tests/liveabgleich_spec.py @@ -0,0 +1,206 @@ +#!/usr/bin/env python3 +"""Spezifikation des Sim-to-Real-Outcome-Abgleichs (Stufe 4, live-Hälfte, des Gegner-Labors). + +Geprueft wird an SYNTHETISCHEN Hand-Logs mit bekanntem Ergebnis: netto_bb-Ableitung (Chips/bb und das +Vorzug des netto_bb-Felds), bb/100 und sein 95-%-Intervall, das Lesen eines jsonl mit Muellzeilen, und +die Abgleich-Logik (deckt/klafft/zu dünn). Keine echten Daten noetig. + + python3 tests/liveabgleich_spec.py -v +""" +import json +import os +import sys +import tempfile +import unittest + +_w = os.path.dirname(os.path.abspath(__file__)) +while _w != "/" and not os.path.isdir(os.path.join(_w, "lesen")): + _w = os.path.dirname(_w) +for _u in ("lesen",): + _q = os.path.join(_w, _u) + if os.path.isdir(_q): + sys.path.append(_q) + +import liveabgleich + + +class NettoBB(unittest.TestCase): + def test_chips_durch_bb(self): + self.assertAlmostEqual(liveabgleich.netto_bb({"netto": -10320.0, "bb": 2000.0}), -5.16) + + def test_netto_bb_feld_gewinnt(self): + self.assertEqual(liveabgleich.netto_bb({"netto": 1.0, "bb": 1.0, "netto_bb": 7.5}), 7.5) + + def test_unvollstaendig_ist_none(self): + self.assertIsNone(liveabgleich.netto_bb({"netto": 5.0})) # kein bb + self.assertIsNone(liveabgleich.netto_bb({"netto": 5.0, "bb": 0})) # bb=0 + self.assertIsNone(liveabgleich.netto_bb("quatsch")) + + def test_ev_feld_gewinnt_nur_mit_ev_flag(self): + h = {"netto_bb": -50.0, "netto_bb_ev": -31.8} + self.assertEqual(liveabgleich.netto_bb(h), -50.0) # Vorgabe: realisiert + self.assertEqual(liveabgleich.netto_bb(h, ev=True), -31.8) # Linse: All-in-EV + # Ohne EV-Feld faellt ev=True auf netto_bb zurueck: + self.assertEqual(liveabgleich.netto_bb({"netto_bb": -50.0}, ev=True), -50.0) + + +class ABausLogEV(unittest.TestCase): + def test_ab_aus_log_ev_nutzt_ev_werte(self): + # Zwei Arme, je eine qualifizierte All-in-Hand mit abweichendem EV. ev=True muss die EV-Werte + # nehmen (mittelwerttreu, kleinere Streuung), ev=False die realisierten. + haende = [ + {"arm": "A", "netto_bb": 100.0, "netto_bb_ev": 20.0}, + {"arm": "A", "netto_bb": -100.0, "netto_bb_ev": -20.0}, + {"arm": "B", "netto_bb": 100.0, "netto_bb_ev": 10.0}, + {"arm": "B", "netto_bb": -100.0, "netto_bb_ev": -10.0}, + ] + roh = liveabgleich.ab_aus_log(haende, feld="arm", an_wert="A", aus_wert="B") + ev = liveabgleich.ab_aus_log(haende, feld="arm", an_wert="A", aus_wert="B", ev=True) + # Beide Arme symmetrisch -> Mittel 0, diff 0; aber die EV-Streuung ist kleiner (5x). + self.assertAlmostEqual(roh["an"]["bb100"], 0.0, places=6) + self.assertAlmostEqual(ev["an"]["bb100"], 0.0, places=6) + # EV-Werte haben kleinere Spanne -> kleineres Konfidenzintervall (halb95) je Arm: + self.assertLess(ev["an"]["halb95"], roh["an"]["halb95"]) + + +class Rechnung(unittest.TestCase): + def test_bb100_ist_mittel_mal_hundert(self): + # -506.83 bb ueber 190 Haende -> -266.75 bb/100 (die reale STATS.md-Zahl) + werte = [-506.83 / 190] * 190 + b = liveabgleich.bb_pro_100(werte) + self.assertEqual(b["n"], 190) + self.assertAlmostEqual(b["bb100"], -266.75, places=1) + + def test_intervall_umgibt_den_punkt(self): + b = liveabgleich.bb_pro_100([10.0, -10.0, 20.0, -5.0, 15.0]) + self.assertLess(b["tief"], b["bb100"]) + self.assertGreater(b["hoch"], b["bb100"]) + self.assertAlmostEqual(b["bb100"], (b["tief"] + b["hoch"]) / 2, places=6) + + def test_eine_hand_ohne_intervall(self): + b = liveabgleich.bb_pro_100([3.0]) + self.assertEqual(b["n"], 1) + self.assertAlmostEqual(b["bb100"], 300.0) + self.assertIsNone(b["halb95"]) + + def test_leer_ist_null(self): + b = liveabgleich.bb_pro_100([]) + self.assertEqual(b["n"], 0) + self.assertIsNone(b["bb100"]) + + +class Lesen(unittest.TestCase): + def test_jsonl_mit_muellzeilen(self): + text = "\n".join([ + json.dumps({"netto": -2320.0, "bb": 2000.0}), # -1.16 + "kaputte zeile {", + "", + json.dumps({"netto": 4000.0, "bb": 2000.0}), # +2.0 + json.dumps({"kein": "ergebnis"}), + ]) + werte = liveabgleich.haende_lesen(text) + self.assertEqual(len(werte), 2) + self.assertAlmostEqual(sum(werte), 0.84) + + def test_laden_fehlt_ist_leer(self): + self.assertEqual(liveabgleich.laden("/gibt/es/nicht.jsonl"), []) + + def test_round_trip_ueber_platte(self): + with tempfile.TemporaryDirectory() as d: + pfad = os.path.join(d, "haende.jsonl") + with open(pfad, "w", encoding="utf-8") as f: + f.write(json.dumps({"netto": -2000.0, "bb": 1000.0}) + "\n") + f.write(json.dumps({"netto": 3000.0, "bb": 1000.0}) + "\n") + werte = liveabgleich.laden(pfad) + self.assertEqual(sorted(werte), [-2.0, 3.0]) + + +class Abgleich(unittest.TestCase): + def test_sim_im_intervall_deckt(self): + # breit streuende Haende um +40 -> das Intervall umfasst die Sim-Vorhersage + real = liveabgleich.bb_pro_100([200.0, -120.0, 150.0, -80.0, 90.0]) + erg = liveabgleich.abgleich(real, sim_bb100=40.0) + self.assertTrue(erg["deckt"]) + self.assertIn("kein Widerspruch", erg["urteil"]) + + def test_real_tief_negativ_klafft(self): + # eng um -260 -> die positive Sim-Kante liegt klar ueber dem Intervall + real = liveabgleich.bb_pro_100([-260.0 + d for d in (-5, 5, -3, 3, 0)]) + erg = liveabgleich.abgleich(real, sim_bb100=43.95) + self.assertFalse(erg["deckt"]) + self.assertLess(erg["gap"], 0) + self.assertIn("KLAFFT", erg["urteil"]) + + def test_leer_ist_zu_duenn(self): + erg = liveabgleich.abgleich(liveabgleich.bb_pro_100([])) + self.assertIsNone(erg["real"]) + self.assertIn("dünn", erg["urteil"]) + + +class AB(unittest.TestCase): + def test_klarer_vorsprung_ist_signifikant(self): + # Kern AN eng um +50, AUS eng um -50 -> Differenz +100, Intervall weit weg von 0 + an = [50.0 + d for d in (-4, 4, -2, 2, 0) * 8] + aus = [-50.0 + d for d in (-4, 4, -2, 2, 0) * 8] + erg = liveabgleich.ab_vergleich(an, aus) + self.assertTrue(erg["signifikant"]) + self.assertGreater(erg["diff"], 0) + self.assertIn("SCHLÄGT", erg["urteil"]) + + def test_kern_schlechter_meldet_verlust(self): + an = [-60.0 + d for d in (-4, 4, -2, 2, 0) * 8] + aus = [40.0 + d for d in (-4, 4, -2, 2, 0) * 8] + erg = liveabgleich.ab_vergleich(an, aus) + self.assertTrue(erg["signifikant"]) + self.assertLess(erg["diff"], 0) + self.assertIn("VERLIERT", erg["urteil"]) + + def test_ueberlappend_nicht_signifikant(self): + # beide Arme breit und ueberlappend -> 0 liegt im Differenz-Intervall + an = [100.0, -90.0, 80.0, -70.0, 60.0] + aus = [90.0, -80.0, 70.0, -60.0, 50.0] + erg = liveabgleich.ab_vergleich(an, aus) + self.assertFalse(erg["signifikant"]) + self.assertIn("kein signifikanter", erg["urteil"]) + + def test_zu_duenner_arm(self): + erg = liveabgleich.ab_vergleich([5.0], [1.0, 2.0, 3.0]) + self.assertIsNone(erg["signifikant"]) + self.assertIn("dünn", erg["urteil"]) + + def test_differenz_intervall_umgibt_diff(self): + an = [20.0, 10.0, 30.0, 15.0, 25.0] + aus = [-5.0, -15.0, 0.0, -10.0, -8.0] + erg = liveabgleich.ab_vergleich(an, aus) + self.assertAlmostEqual(erg["diff"], (erg["tief"] + erg["hoch"]) / 2, places=6) + self.assertLess(erg["tief"], erg["diff"]) + + +class ABausLog(unittest.TestCase): + def _hand(self, kern, netto): + return {"kern": kern, "netto": netto, "bb": 100.0} + + def test_trennt_am_feld_und_urteilt(self): + haende = ([self._hand("an", v) for v in (120, -40, 90, -20, 60)] + + [self._hand("aus", v) for v in (-110, -200, -50, -180, -90)]) + erg = liveabgleich.ab_aus_log(haende) + self.assertEqual(erg["an"]["n"], 5) + self.assertEqual(erg["aus"]["n"], 5) + self.assertGreater(erg["diff"], 0) + self.assertTrue(erg["signifikant"]) + + def test_nur_ein_arm_meldet_fehlenden_arm(self): + haende = [self._hand("an", 50) for _ in range(4)] + erg = liveabgleich.ab_aus_log(haende) + self.assertIn("ein Arm", erg["urteil"]) + + def test_explizite_armwerte(self): + haende = ([{"arm": "kern", "netto": 30, "bb": 10} for _ in range(3)] + + [{"arm": "basis", "netto": -10, "bb": 10} for _ in range(3)]) + erg = liveabgleich.ab_aus_log(haende, feld="arm", an_wert="kern", aus_wert="basis") + self.assertAlmostEqual(erg["an"]["bb100"], 300.0) + self.assertAlmostEqual(erg["aus"]["bb100"], -100.0) + + +if __name__ == "__main__": + unittest.main(verbosity=2) diff --git a/tests/replay_spec.py b/tests/replay_spec.py new file mode 100644 index 00000000..a984173d --- /dev/null +++ b/tests/replay_spec.py @@ -0,0 +1,128 @@ +#!/usr/bin/env python3 +"""Replay-Benchmark: Evaluator, HH-Parser und Spot-Rekonstruktion. + +Der unabhaengige Evaluator (`eval7`) ist der Ground Truth des Benchmarks - er wird hier gegen +bekannte Haende geprueft. Parser und Rekonstruktion laufen auf einer eingebetteten Mini-Session +(Format wie der echte Export), deterministisch, ohne die Engine. Der Engine-Roundtrip wird nur +geprueft, wenn das Binary schon gebaut ist (sonst uebersprungen - die schnelle Spur baut nicht). + + python3 tests/replay_spec.py -v +""" +import os +import sys +import unittest + +HIER = os.path.dirname(os.path.abspath(__file__)) +WURZEL = os.path.dirname(HIER) +sys.path.insert(0, os.path.join(WURZEL, "entscheiden")) + +import eval7 +import replay + +# Eine Mini-Session im echten Export-Format: eine Hand, in der Hero (mmintel) Bottom Pair + Ass +# gegen eine Bet foldet und der Gegner J-high als Bluff zeigt - der belegte Overfold. +FIXTURE = """# CoinPoker Cash Game Export (Fixture) + +### Hand #999000000001 - 2026-11-10 10:00:00 CET - `Test NL 0.01-0.02` - Net: **-0.06 (-3.0 bb)** + +- **Players (BTN S6):** S1 aha09 ($0.96, VPIP 0%/2h), S2 mmintel ($2.03, VPIP 0%/1h), S3 zambino78 ($0.42, VPIP 28%/82h), S6 Natalensis ($2.11, VPIP 45%/11h) +- **Hero Hole Cards:** `As 2c` +- **Engine Decisions:** + - `PREFLOP` | board=`` | pot=$0.07 toCall=$0.02 | **CALL** | eq=None | BB vs open -> call + - `FLOP` | board=`Kd 5s 2h` | pot=$0.09 toCall=$0.00 | **CHECK** | eq=0.418 | bottom pair + - `FLOP` | board=`Kd 5s 2h` | pot=$0.15 toCall=$0.06 | **FOLD** | eq=0.246 | bottom pair: EV call -0.01 + +```text +PokerStars Hand #999000000001: Hold'em No Limit ($0.01/$0.02 USD) - 2026/11/10 10:00:00 CET +Table 'Test NL 0.01-0.02' 6-max Seat #6 is the button +Seat 1: aha09 ($0.96 in chips) +Seat 2: mmintel ($2.03 in chips) +Seat 3: zambino78 ($0.42 in chips) +Seat 6: Natalensis ($2.11 in chips) +aha09: posts small blind $0.01 +mmintel: posts big blind $0.02 +*** HOLE CARDS *** +Dealt to mmintel [As 2c] +zambino78: raises $0.02 to $0.04 +Natalensis: folds +aha09: folds +mmintel: calls $0.02 +*** FLOP *** [Kd 5s 2h] +mmintel: checks +zambino78: bets $0.06 +mmintel: folds +Uncalled bet ($0.06) returned to zambino78 +zambino78: shows [Jh 9h] +zambino78 collected $0.09 from pot +*** SUMMARY *** +Total pot $0.09 | Rake $0.00 +Board [Kd 5s 2h] +``` +""" + + +class Evaluator(unittest.TestCase): + def test_selbsttest_laeuft_beim_import(self): + eval7._selftest() # wirft bei Fehler + + def test_river_showdown_exakt(self): + # Top Pair Koenige schlaegt Paar Zehnen auf fertigem Board -> Equity 1.0 + self.assertEqual(eval7.equity_vs("Kd 7d", "9c Tc Kc Qd 2h", ["Ah Td"]), 1.0) + + def test_bottom_pair_ass_vs_bluff(self): + # As2c Bottom Pair + Ass gegen Jh9h (J-high) auf Kd5s2h: klar vorn + eq = eval7.equity_vs("As 2c", "Kd 5s 2h", ["Jh 9h"]) + self.assertGreater(eq, 0.6) + + +class Parser(unittest.TestCase): + def setUp(self): + self.blocks = FIXTURE.split("### Hand ")[1:] + self.hand = replay.parse_hand(self.blocks[0]) + + def test_hand_geparst(self): + self.assertIsNotNone(self.hand) + self.assertEqual(self.hand["hero_cards"], ["As", "2c"]) + self.assertEqual(self.hand["seats"]["mmintel"], 2) + self.assertEqual(self.hand["button"], 6) + self.assertEqual(self.hand["shown"]["zambino78"], ["Jh", "9h"]) + self.assertEqual(self.hand["prof"]["zambino78"], {"vpip": 0.28, "hands": 82}) + + def test_rekonstruktion_baut_wohlgeformte_spots(self): + spots = replay.reconstruct(self.hand) + # Drei Hero-Aktionen: Preflop CALL, Flop CHECK, Flop FOLD + self.assertEqual(len(spots), 3) + for req, dec in spots: + for key in ("variant", "bigBlind", "heroSeat", "heroCards", "street", + "pot", "toCall", "heroStack", "legalActions", "villains", "history"): + self.assertIn(key, req) + self.assertGreaterEqual(req["heroStack"], 0.0) + + def test_history_vor_dem_flop_fold(self): + spots = replay.reconstruct(self.hand) + _, _ = spots[0] + flop_fold_req, dec = spots[2] + self.assertEqual(dec["action"], "FOLD") + self.assertEqual(dec["to_call"], 0.06) + # Die History vor dem Fold enthaelt die Bet des Gegners (zambino78 auf Sitz 3) + bet = [h for h in flop_fold_req["history"] if h["action"] == "BET"] + self.assertTrue(bet and bet[0]["seat"] == 3) + # und Profil geht mit auf die Reise + v3 = [v for v in flop_fold_req["villains"] if v["seat"] == 3][0] + self.assertAlmostEqual(v3["profile"]["vpip"], 0.28) + + +class EngineRoundtrip(unittest.TestCase): + def test_engine_entscheidet_rekonstruierten_spot(self): + import decide + if not decide.bereit() or not decide.frisch(): + self.skipTest("Engine-Binary nicht frisch gebaut - schnelle Spur baut nicht") + hand = replay.parse_hand(FIXTURE.split("### Hand ")[1:][0]) + import json + req = json.dumps(replay.reconstruct(hand)[2][0]) + ans = decide.entscheide([req])[0] + self.assertIn(ans.get("action"), {"FOLD", "CALL", "RAISE", "CHECK", "ABSTAIN"}) + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/sim_benchmark.rs b/tests/sim_benchmark.rs index 32102ed8..d46d1cfa 100644 --- a/tests/sim_benchmark.rs +++ b/tests/sim_benchmark.rs @@ -6,7 +6,7 @@ use rechner::sim::benchmark::{overall, parse, render, verdict_of_run, Run, Scena use rechner::sim::opponent::{Act, Opponent, View}; use rechner::sim::paired::{compare, Verdict}; use rechner::sim::reader::{strength, Reading, Style}; -use rechner::sim::session::{deal_samples, measure, Setup}; +use rechner::sim::session::{deal_samples, measure, ReadMode, Setup}; use rechner::card::Card; fn scenario(name: &str, samples: Vec) -> ScenarioRun { @@ -237,7 +237,7 @@ fn a_raise_is_never_offered_when_impossible() { fn reading_opponents_play_legal_hands_and_lose_chips_to_nobody() { for style in Style::ALL { for players in [2u8, 6] { - let s = Setup { players, opponent: Opponent::Reader(style), deals: 4, stack_bb: 100.0, seed: 3 }; + let s = Setup { players, opponent: Opponent::Reader(style), deals: 4, stack_bb: 100.0, seed: 3, read: ReadMode::Oracle }; let m = measure(&s); assert_eq!(m.invalid, 0, "{style:?} {players}"); assert!(m.decisions > 0); @@ -247,7 +247,7 @@ fn reading_opponents_play_legal_hands_and_lose_chips_to_nobody() { #[test] fn a_reading_opponent_does_not_play_like_a_blind_one() { - let s = |opponent| Setup { players: 2, opponent, deals: 40, stack_bb: 100.0, seed: 3 }; + let s = |opponent| Setup { players: 2, opponent, deals: 40, stack_bb: 100.0, seed: 3, read: ReadMode::Oracle }; assert_ne!(deal_samples(&s(Opponent::Reader(Style::Nit))).0, deal_samples(&s(Opponent::Reader(Style::Maniac))).0); } @@ -255,7 +255,7 @@ fn a_reading_opponent_does_not_play_like_a_blind_one() { #[test] fn deal_samples_agree_with_the_measurement() { - let s = Setup { players: 2, opponent: Opponent::RandomLegal, deals: 30, stack_bb: 100.0, seed: 9 }; + let s = Setup { players: 2, opponent: Opponent::RandomLegal, deals: 30, stack_bb: 100.0, seed: 9, read: ReadMode::Oracle }; let (samples, _) = deal_samples(&s); let mean = samples.iter().sum::() / 30.0; assert_eq!(samples.len(), 30); diff --git a/tests/sim_blind.rs b/tests/sim_blind.rs new file mode 100644 index 00000000..83f73a09 --- /dev/null +++ b/tests/sim_blind.rs @@ -0,0 +1,268 @@ +//! Stage 0 + 1: der Preis eines Reads ist messbar, und das Gedaechtnis holt einen Teil zurueck. +//! Derselbe Gegner, dieselben Austeilungen - mit konvergiertem HUD-Read (Oracle, die Exploit-Hirn- +//! Lage), blind (ungelesen, wie Hand 1 einer Sitzung) und mit Gedaechtnis (Read aus Beobachtung +//! aufgebaut, `sim::memory`). Die Luecke blind -> Oracle ist der Sitzungsertrag eines Reads; das +//! Gedaechtnis holt ihn zurueck - beim Fisch sogar ganz und knapp darueber, weil der aus dem Spiel +//! gemessene Read genauer kalibriert ist als die idealisierten HUD-Werte des Oracle. Gemessen gegen +//! die zwei Klassen, die die Engine heute ueberhaupt ausbeuten kann (Calling Station und Fisch, +//! siehe `exploit::read_gate`). + +use rechner::rng::Rng; +use rechner::sim::benchmark::SCENARIOS; +use rechner::sim::memory::SessionMemory; +use rechner::sim::opponent::Opponent; +use rechner::sim::paired::{compare, Verdict}; +use rechner::sim::reader::Style; +use rechner::sim::reads::opponent_profile; +use rechner::sim::session::{deal_samples, ReadMode, Setup}; +use rechner::sim::table::{deal, play_hand_tracked, HandRead, HandSetup, TableCost}; + +const SEED: u64 = 0x5EED_0001; +/// Dieselbe Austeilungszahl wie die Messlatte (heads-up), damit der Preis hier exakt der Luecke der +/// Szenarien `heads-up fish` / `heads-up fish (blind)` entspricht und deterministisch ist. +const DEALS: u32 = 1000; + +fn samples(opponent: Opponent, read: ReadMode) -> Vec { + deal_samples(&Setup { players: 2, opponent, deals: DEALS, stack_bb: 100.0, seed: SEED, read }).0 +} + +/// (blind samples, read-given samples) fuer denselben Gegner und dieselben Austeilungen. +fn paired(opponent: Opponent) -> (Vec, Vec) { + (samples(opponent, ReadMode::Blind), samples(opponent, ReadMode::Oracle)) +} + +// Die zwei Messungen spielen je 2x1000 echte Austeilungen (Minuten, release): nicht im schnellen +// `cargo test`, nur auf Abruf mit `cargo test --release -- --ignored`. Die Zahlen stehen ohnehin +// in `benchmarks/baseline.txt` (die Szenarien `... (blind)` gegen ihre read-given-Zwillinge). +#[test] +#[ignore = "spielt 2x1000 Austeilungen; auf Abruf: cargo test --release -- --ignored"] +fn reading_the_fish_is_worth_a_clear_prize() { + // Blind barrelt die Engine den Fisch zu viel (Populations-Prior) und laesst duenne Value liegen; + // gelesen nicht. Der Preis ist gross und positiv. ~ +53,8 bb/100 bei diesem Seed. + let (blind, read) = paired(Opponent::Reader(Style::Fish)); + let c = compare(&blind, &read).expect("vergleichbar"); + assert_ne!(c.verdict, Verdict::Worse, "{:+.1} ± {:.1} bb/100", c.delta_bb_per_100, c.ci95); + assert!(c.delta_bb_per_100 > 40.0, "Preis nur {:+.1} bb/100", c.delta_bb_per_100); +} + +#[test] +#[ignore = "spielt 2x1000 Austeilungen; auf Abruf: cargo test --release -- --ignored"] +fn reading_the_calling_station_pays_and_never_costs() { + // Die Station ueberbezahlt, also verdient die Engine auch blind gut; der Read bringt trotzdem + // einen positiven Aufschlag und schadet nie. ~ +26,3 bb/100 bei diesem Seed. + let (blind, read) = paired(Opponent::CallingStation); + let c = compare(&blind, &read).expect("vergleichbar"); + assert_ne!(c.verdict, Verdict::Worse, "{:+.1} ± {:.1} bb/100", c.delta_bb_per_100, c.ci95); + assert!(c.delta_bb_per_100 > 10.0, "Preis nur {:+.1} bb/100", c.delta_bb_per_100); +} + +#[test] +#[ignore = "spielt 3x1000 Austeilungen; auf Abruf: cargo test --release -- --ignored"] +fn memory_recaptures_the_read_prize() { + // Gegen den Fisch: das Gedaechtnis baut den Read aus Beobachtung auf. Es darf nie unter blind + // fallen (Warmup schuetzt) und holt den grossen Teil der Luecke zurueck - beim Fisch sogar ganz, + // weil der gemessene Read genauer kalibriert ist als die idealisierten Oracle-Werte und ihn + // knapp uebertrifft (vs_oracle.delta = Oracle - Gedaechtnis, hier leicht negativ). + let blind = samples(Opponent::Reader(Style::Fish), ReadMode::Blind); + let memory = samples(Opponent::Reader(Style::Fish), ReadMode::Memory); + let oracle = samples(Opponent::Reader(Style::Fish), ReadMode::Oracle); + let vs_blind = compare(&blind, &memory).expect("vergleichbar"); + let vs_oracle = compare(&memory, &oracle).expect("vergleichbar"); + assert_ne!(vs_blind.verdict, Verdict::Worse, "Gedaechtnis unter blind: {:+.1} bb/100", vs_blind.delta_bb_per_100); + assert!(vs_blind.delta_bb_per_100 > 40.0, "Gedaechtnis holt nur {:+.1} bb/100 ueber blind", vs_blind.delta_bb_per_100); + // Gedaechtnis darf nicht spuerbar hinter dem Oracle zurueckbleiben; dass es ihn leicht + // uebertrifft (delta < 0) ist erlaubt und erwuenscht. + assert!(vs_oracle.delta_bb_per_100 < 10.0, "Gedaechtnis {:+.1} bb/100 hinter Oracle", vs_oracle.delta_bb_per_100); +} + +/// Diagnose: wie schnell und wohin konvergiert der Fisch-Read? Spiegelt die Session-Schleife +/// (session.rs) exakt und druckt read() an Kontrollpunkten gegen den Oracle. `cargo test --release +/// --test sim_blind diagnose_fish -- --ignored --nocapture`. +#[test] +#[ignore = "Diagnose, --nocapture"] +fn diagnose_fish_memory_convergence() { + fn mix(seed: u64, n: u64) -> u64 { + Rng::seeded(seed ^ n.wrapping_mul(0xD1B5_4A32_D192_ED03)).next_u64().0 + } + let opponent = Opponent::Reader(Style::Fish); + let oracle = opponent_profile(opponent); + println!("oracle fish: {oracle:?}"); + let mut mem = SessionMemory::new(); + let mut hands = 0u32; + let checkpoints = [25, 50, 100, 250, 500, 1000, 2000]; + for d in 0..1000u32 { + let (cards, _) = deal(2, Rng::seeded(mix(SEED, d as u64))); + for hero_seat in 1..=2u8 { + let hand = HandSetup { + deal: &cards, + hero_seat, + opponent, + stack_bb: 100.0, + seed: mix(SEED ^ 0xA5A5, (d as u64) << 8 | hero_seat as u64), + read: HandRead::Given(mem.read()), + }; + play_hand_tracked(&hand, TableCost::FREE, Some(&mut mem)); + hands += 1; + if checkpoints.contains(&hands) { + println!("nach {hands:>4} Haenden: {:?}", mem.read()); + } + } + } +} + +/// Diagnose des Nit-Voll-Read-Lecks (Stage 4/5): spielt jede Austeilung heads-up gegen den Nit +/// einmal blind und einmal mit Oracle-Read, gleiche Karten und gleicher Gegner-Seed, so dass nur +/// HEROs read-getriebene Entscheidungen abweichen. Lokalisiert das Leck nach der Strasse der ERSTEN +/// Abweichung und nach dem Zug-Wechsel. `cargo test --release --test sim_blind diagnose_nit -- +/// --ignored --nocapture`. +#[test] +#[ignore = "Diagnose, --nocapture"] +fn diagnose_nit_full_read_leak() { + use rechner::game::{Choice, Street}; + use rechner::sim::table::play_hand_traced; + use std::collections::BTreeMap; + + fn mix(seed: u64, n: u64) -> u64 { + Rng::seeded(seed ^ n.wrapping_mul(0xD1B5_4A32_D192_ED03)).next_u64().0 + } + fn kind(c: Choice) -> &'static str { + match c { + Choice::Fold => "fold", + Choice::Check => "check", + Choice::Call => "call", + Choice::Raise { .. } => "raise", + Choice::Abstain => "abstain", + } + } + fn street_name(s: Street) -> &'static str { + match s { + Street::Preflop => "preflop", + Street::Flop => "flop", + Street::Turn => "turn", + Street::River => "river", + } + } + + let opponent = Opponent::Reader(Style::Nit); + let deals = DEALS; + let mut by_street: BTreeMap<&str, (u32, f64)> = BTreeMap::new(); + let mut by_move: BTreeMap = BTreeMap::new(); + let (mut total_delta, mut identical) = (0.0, 0u32); + + for d in 0..deals { + let (cards, _) = deal(2, Rng::seeded(mix(SEED, d as u64))); + for hero_seat in 1..=2u8 { + let seed = mix(SEED ^ 0xA5A5, (d as u64) << 8 | hero_seat as u64); + let mk = |read| HandSetup { deal: &cards, hero_seat, opponent, stack_bb: 100.0, seed, read }; + let (blind, bt) = play_hand_traced(&mk(HandRead::Given(None)), TableCost::FREE); + let (oracle, ot) = play_hand_traced(&mk(HandRead::Oracle), TableCost::FREE); + let delta = oracle.hero_net - blind.hero_net; // Luck hebt sich auf (gleiche Karten/Seed) + total_delta += delta; + // Erste Entscheidung, an der sich Read und blind unterscheiden. + let idx = bt.iter().zip(&ot).position(|(b, o)| b.choice != o.choice); + let Some(idx) = idx else { + identical += 1; + continue; + }; + let at = ot.get(idx).or(bt.get(idx)).expect("Abweichung hat eine Entscheidung"); + let s = street_name(at.street); + let e = by_street.entry(s).or_default(); + e.0 += 1; + e.1 += delta; + let label = format!("{s:>7}: blind {} -> read {}", kind(bt[idx].choice), kind(ot[idx].choice)); + let m = by_move.entry(label).or_default(); + m.0 += 1; + m.1 += delta; + } + } + + let hands = (deals * 2) as f64; + println!("\nNit Voll-Read gegen blind: total {:+.1} bb/100 ueber {} Haende, {} identisch", + 100.0 * total_delta / hands, deals * 2, identical); + println!("--- Leck nach Strasse der ERSTEN Abweichung ---"); + for (s, (n, sum)) in &by_street { + println!("{s:>8}: {n:>5} Haende, {sum:+9.1} bb gesamt ({:+.3} bb/Hand)", sum / *n as f64); + } + println!("--- Leck nach Zug-Wechsel (sortiert, schlechteste zuerst) ---"); + let mut moves: Vec<_> = by_move.into_iter().collect(); + moves.sort_by(|a, b| a.1 .1.partial_cmp(&b.1 .1).unwrap()); + for (label, (n, sum)) in moves { + println!("{label:<32}: {n:>5} Haende, {sum:+9.1} bb gesamt"); + } +} + +/// Probe des schlimmsten Eimers (flop: blind check -> read raise): druckt fuer jede solche Hand +/// die VOLLE Read-Entscheidungsfolge (Strasse/Zug/Topf/to_call/Equity) und das Netz, und zaehlt, +/// wie oft der Read-Motor NACH dem Flop-Raise auf Turn/River WEITERBARRELT. Zeigt, ob der Verlust +/// im Flop-Raise selbst steckt oder im mehrstrassigen Nachsetzen. Nur mit promotetem Nit sinnvoll +/// (sonst gated). `cargo test --release --test sim_blind probe_flop_bluff -- --ignored --nocapture`. +#[test] +#[ignore = "Probe, --nocapture, nur mit promotetem Nit"] +fn probe_flop_bluff_raise_trajectory() { + use rechner::game::{Choice, Street}; + use rechner::sim::table::play_hand_traced; + + fn mix(seed: u64, n: u64) -> u64 { + Rng::seeded(seed ^ n.wrapping_mul(0xD1B5_4A32_D192_ED03)).next_u64().0 + } + fn kind(c: Choice) -> String { + match c { + Choice::Fold => "fold".into(), + Choice::Check => "check".into(), + Choice::Call => "call".into(), + Choice::Raise { to } => format!("raise->{to:.1}"), + Choice::Abstain => "abstain".into(), + } + } + fn st(s: Street) -> &'static str { + match s { Street::Preflop => "pf", Street::Flop => "fl", Street::Turn => "tn", Street::River => "rv" } + } + + let opponent = Opponent::Reader(Style::Nit); + let (mut shown, mut n_bucket, mut n_barrel, mut barrel_delta, mut flat_delta) = (0u32, 0u32, 0u32, 0.0, 0.0); + for d in 0..DEALS { + let (cards, _) = deal(2, Rng::seeded(mix(SEED, d as u64))); + for hero_seat in 1..=2u8 { + let seed = mix(SEED ^ 0xA5A5, (d as u64) << 8 | hero_seat as u64); + let mk = |read| HandSetup { deal: &cards, hero_seat, opponent, stack_bb: 100.0, seed, read }; + let (blind, bt) = play_hand_traced(&mk(HandRead::Given(None)), TableCost::FREE); + let (oracle, ot) = play_hand_traced(&mk(HandRead::Oracle), TableCost::FREE); + let delta = oracle.hero_net - blind.hero_net; + let Some(idx) = bt.iter().zip(&ot).position(|(b, o)| b.choice != o.choice) else { continue }; + let first = &ot[idx]; + let is_flop_check_to_raise = first.street == Street::Flop + && matches!(bt[idx].choice, Choice::Check) + && matches!(first.choice, Choice::Raise { .. }); + if !is_flop_check_to_raise { continue; } + n_bucket += 1; + // Barrelt der Read-Motor nach dem Flop-Raise auf Turn/River weiter (noch ein Raise)? + let later_raise = ot[idx + 1..].iter().any(|dd| + matches!(dd.choice, Choice::Raise { .. }) + && matches!(dd.street, Street::Turn | Street::River)); + if later_raise { n_barrel += 1; barrel_delta += delta; } else { flat_delta += delta; } + if shown < 12 { + shown += 1; + let line: Vec = ot.iter().map(|dd| + format!("{}:{}@pot{:.1}/call{:.1}/eq{:.2}", st(dd.street), kind(dd.choice), dd.pot, dd.to_call, + dd.equity.unwrap_or(f64::NAN))).collect(); + println!("#{d}s{hero_seat} delta {delta:+6.1} | read: {}", line.join(" ")); + println!(" blind_net {:+.1} read_net {:+.1}", blind.hero_net, oracle.hero_net); + } + } + } + println!("\nflop check->raise: {n_bucket} Haende; davon barreln {n_barrel} weiter (Turn/River-Raise)"); + println!("barrel-Haende delta gesamt {barrel_delta:+.1} bb; nicht-barrel delta gesamt {flat_delta:+.1} bb"); +} + +#[test] +fn the_ladder_carries_blind_and_memory_scenarios() { + let names = |mode: ReadMode| -> Vec<_> { + SCENARIOS.iter().filter(move |s| s.setup.read == mode).map(|s| s.name).collect() + }; + assert_eq!( + names(ReadMode::Blind), + ["heads-up gto (blind)", "heads-up gto-small (blind)", "heads-up fish (blind)", "heads-up calling station (blind)"] + ); + assert_eq!(names(ReadMode::Memory), ["heads-up fish (memory)", "heads-up calling station (memory)"]); + assert_eq!(names(ReadMode::Oracle).len(), 13); +} diff --git a/tests/sim_strength.rs b/tests/sim_strength.rs index b046ba88..7a777079 100644 --- a/tests/sim_strength.rs +++ b/tests/sim_strength.rs @@ -11,11 +11,11 @@ use rechner::card::Card; use rechner::rng::Rng; use rechner::sim::opponent::{Act, Opponent, View}; -use rechner::sim::session::{measure, measure_at, Measurement, Setup}; -use rechner::sim::table::{deal, play_hand, play_hand_at, Deal, HandSetup, TableCost}; +use rechner::sim::session::{measure, measure_at, Measurement, ReadMode, Setup}; +use rechner::sim::table::{deal, play_hand, play_hand_at, Deal, HandRead, HandSetup, TableCost}; fn setup(players: u8, opponent: Opponent, deals: u32) -> Setup { - Setup { players, opponent, deals, stack_bb: 100.0, seed: 0x5EED_0001 } + Setup { players, opponent, deals, stack_bb: 100.0, seed: 0x5EED_0001, read: ReadMode::Oracle } } fn cards(text: &str) -> Vec { @@ -98,6 +98,7 @@ fn folder_in_the_small_blind_gives_the_big_blind_away() { opponent: Opponent::Folder, stack_bb: 100.0, seed: 1, + read: HandRead::Oracle, }); assert_eq!(r.hero_net, 0.5); assert_eq!(r.hero_decisions, 0); @@ -113,6 +114,7 @@ fn aces_against_a_calling_station_win_the_showdown() { opponent: Opponent::CallingStation, stack_bb: 100.0, seed: 1, + read: HandRead::Oracle, }); assert!(r.hero_net > 1.0, "aces won only {}", r.hero_net); assert!(r.hero_decisions >= 2); @@ -135,6 +137,7 @@ fn every_hand_conserves_chips_and_sends_only_valid_requests() { opponent, stack_bb: 100.0, seed: 5, + read: HandRead::Oracle, }); assert!(r.chips_lost.abs() < 1e-6, "{opponent:?} {players}: {}", r.chips_lost); assert_eq!(r.invalid, 0, "{opponent:?} {players}"); @@ -204,7 +207,7 @@ fn long_run_heads_up_and_six_max() { // -- Rake und Ante -------------------------------------------------------------------------- fn at_measured_table(d: &Deal, hero_seat: u8, opponent: Opponent) -> rechner::sim::table::HandResult { - play_hand_at(&HandSetup { deal: d, hero_seat, opponent, stack_bb: 100.0, seed: 1 }, TableCost::MEASURED) + play_hand_at(&HandSetup { deal: d, hero_seat, opponent, stack_bb: 100.0, seed: 1, read: HandRead::Oracle }, TableCost::MEASURED) } #[test] @@ -220,7 +223,7 @@ fn a_hand_that_ends_before_the_flop_pays_antes_but_no_rake() { #[test] fn a_showdown_pays_rake_and_the_chips_balance() { let d = fixed_deal(&["As Ah", "7c 2d"], "Kd Qc 9s 4h 3c"); - let free = play_hand(&HandSetup { deal: &d, hero_seat: 1, opponent: Opponent::CallingStation, stack_bb: 100.0, seed: 1 }); + let free = play_hand(&HandSetup { deal: &d, hero_seat: 1, opponent: Opponent::CallingStation, stack_bb: 100.0, seed: 1, read: HandRead::Oracle }); let raked = at_measured_table(&d, 1, Opponent::CallingStation); assert!(raked.rake > 0.0 && raked.rake <= 1.0, "{}", raked.rake); assert!(free.hero_net > 0.0); @@ -234,7 +237,7 @@ fn six_handed_random_hands_balance_with_the_rake_within_the_cap() { let (d, _) = deal(6, Rng::seeded(seed)); for hero_seat in 1..=6u8 { let r = play_hand_at( - &HandSetup { deal: &d, hero_seat, opponent: Opponent::RandomLegal, stack_bb: 100.0, seed }, + &HandSetup { deal: &d, hero_seat, opponent: Opponent::RandomLegal, stack_bb: 100.0, seed, read: HandRead::Oracle }, TableCost::MEASURED, ); assert!(r.chips_lost.abs() < 1e-6, "{}", r.chips_lost); diff --git a/tests/stufe0_spec.py b/tests/stufe0_spec.py new file mode 100644 index 00000000..b5025d47 --- /dev/null +++ b/tests/stufe0_spec.py @@ -0,0 +1,135 @@ +#!/usr/bin/env python3 +"""Spezifikation betrieb/stufe0.py - der Übung-Bericht (schlägt die Null / Stil / Loop / Sim-to-Real). + +Jede Kennzahl wird hier von Hand geprüft, nicht aus derselben Funktion zurückgelesen. Das Null- +Urteil folgt der 95-%-Spanne (Überlappung = Zufall), genau wie statistik.bestes_format. + + python3 tests/stufe0_spec.py -v +""" +import os +import sys +import unittest + +_w = os.path.dirname(os.path.abspath(__file__)) +while _w != "/" and not os.path.isdir(os.path.join(_w, "betrieb")): + _w = os.path.dirname(_w) +for _u in ("lesen", "betrieb"): + sys.path.append(os.path.join(_w, _u)) +import stufe0 + + +def hand(nr, netto, bb=2000.0, vpip=False, pfr=False, showdown=False): + return {"raum": "R 1", "hand": str(nr), "zeit": "2026-10-28T20:00:00Z", "bb": bb, + "stake": "1000/2000", "spielart": "NLHE", "netto": netto, "gewonnen": netto > 0, + "showdown": showdown, "vpip": vpip, "pfr": pfr, "aktionen": []} + + +class UrteilNull(unittest.TestCase): + def test_klarer_gewinn_schlaegt_die_null(self): + # enge, hohe Gewinne -> Spanne ganz über 0 + b = stufe0.bericht([hand(i, 4000) for i in range(30)]) + self.assertTrue(b["schlaegt_null"]) + self.assertEqual(b["urteil"], "gewinnt mit 95 % Sicherheit") + self.assertGreater(b["unten"], 0) + + def test_klarer_verlust(self): + b = stufe0.bericht([hand(i, -4000) for i in range(30)]) + self.assertFalse(b["schlaegt_null"]) + self.assertEqual(b["urteil"], "verliert mit 95 % Sicherheit") + self.assertLess(b["oben"], 0) + + def test_grosse_streuung_ist_zufall(self): + # abwechselnd grosse Gewinne/Verluste: Schnitt nahe 0, Spanne überlappt 0 + hs = [hand(i, 20000 if i % 2 else -20000) for i in range(20)] + b = stufe0.bericht(hs) + self.assertFalse(b["schlaegt_null"]) + self.assertIn("Zufall", b["urteil"]) + self.assertLess(b["unten"], 0) + self.assertGreater(b["oben"], 0) + + def test_eine_hand_ist_zu_wenig(self): + b = stufe0.bericht([hand(1, 4000)]) + self.assertEqual(b["urteil"], "zu wenig Hände für ein Urteil") + self.assertIsNone(b["unten"]) + self.assertFalse(b["schlaegt_null"]) + + def test_leer(self): + b = stufe0.bericht([]) + self.assertEqual(b["haende"], 0) + self.assertIsNone(b["bb_pro_100"]) + self.assertEqual(b["urteil"], "zu wenig Hände für ein Urteil") + import json + json.dumps(b) # JSON-fähig + + +class Stil(unittest.TestCase): + def test_sane(self): + hs = [hand(i, 100, vpip=(i < 6), pfr=(i < 4), showdown=(i < 3)) for i in range(20)] + s = stufe0.bericht(hs)["stil"] + self.assertTrue(s["sane"], s["hinweise"]) + self.assertEqual(s["vpip"], 6 / 20) + self.assertEqual(s["pfr"], 4 / 20) + + def test_pfr_groesser_vpip_ist_lesefehler(self): + hs = [hand(i, 100, vpip=(i < 2), pfr=(i < 8)) for i in range(20)] # PFR 40 % > VPIP 10 % + s = stufe0.bericht(hs)["stil"] + self.assertFalse(s["sane"]) + self.assertTrue(any("PFR" in h for h in s["hinweise"])) + + def test_vpip_extrem(self): + hs = [hand(i, 100, vpip=True, pfr=True) for i in range(20)] # VPIP 100 % > Band + s = stufe0.bericht(hs)["stil"] + self.assertFalse(s["sane"]) + self.assertTrue(any("VPIP" in h for h in s["hinweise"])) + + +class Loop(unittest.TestCase): + def test_sauber_ohne_vorfaelle(self): + b = stufe0.bericht([hand(1, 10), hand(2, 20)]) + self.assertTrue(b["loop"]["sauber"]) + self.assertEqual(b["loop"]["abbruch"], 0) + + def test_abbruch_und_timeout_haken(self): + ereignisse = [{"art": "sitout", "grund": "timeout"}, {"art": "auszeit", "grund": "pause"}] + shadow = [{"ereignis": "abbruch", "regel": "x"}, + {"antwort": {"action": "ABSTAIN"}}, {"antwort": {"action": "FOLD"}}] + lp = stufe0.bericht([hand(1, 10)], ereignisse, shadow)["loop"] + self.assertEqual(lp["abbruch"], 1) + self.assertEqual(lp["timeouts"], 1) + self.assertEqual(lp["abstains"], 1) + self.assertEqual(lp["sitouts"], 2) # sitout + auszeit + self.assertFalse(lp["sauber"]) # Abbruch + Timeout + + +class SimToReal(unittest.TestCase): + def test_im_band(self): + b = stufe0.bericht([hand(i, 4000) for i in range(30)], erwartung=(100, 400)) + # bb/100 ~200 bei BB 2000; Spanne liegt im Band 100..400 + self.assertEqual(b["sim_to_real"]["urteil"], "im erwarteten Bereich (Spannen überlappen)") + + def test_besser_als_erwartet(self): + b = stufe0.bericht([hand(i, 4000) for i in range(30)], erwartung=(-50, 10)) + self.assertIn("besser als erwartet", b["sim_to_real"]["urteil"]) + + def test_schlechter_als_erwartet(self): + b = stufe0.bericht([hand(i, -4000) for i in range(30)], erwartung=(100, 400)) + self.assertIn("schlechter als erwartet", b["sim_to_real"]["urteil"]) + + def test_ohne_erwartung_none(self): + self.assertIsNone(stufe0.bericht([hand(1, 10)])["sim_to_real"]) + + +class Text(unittest.TestCase): + def test_text_enthaelt_kernzahlen(self): + t = stufe0.text(stufe0.bericht([hand(i, 4000) for i in range(30)], erwartung=(100, 400))) + self.assertIn("Stufe-0-Bericht", t) + self.assertIn("bb/100", t) + self.assertIn("Loop:", t) + self.assertIn("Sim-to-Real", t) + + def test_leerer_text_kein_absturz(self): + stufe0.text(stufe0.bericht([])) + + +if __name__ == "__main__": + unittest.main()