Image Image Image




Post new topic Reply to topic  [ 399 posts ]  Go to page 1, 2, 3, 4, 5 ... 20  Next
Author Message
 Post subject: 7-card Poker Hand Evaluators
PostPosted: Thu Sep 06, 2007 11:49 pm 
Offline
PokerAI fellow
User avatar

Posts: 7731
Favourite Bot: V12
This is a contest for 7-card HoldEm Java Hand Evaluators.
This OP will always be updated with the latest results, and a download with the benchmarked code.

Download

The code you can download --->>> here <<<---.
All source code in this archive is provided under GPL v2 (or later), except otherwise indicated, i.e. there are several exceptions that are listed in the LICENSE.TXT included in the distribution.

Related threads

For Omaha evaluators, checkout *Official* Omaha Hi/Lo Hand Evaluator Thread

Results

Image

(1) Spears adaptation of RayW LUT hand evaluator, http://pokerai.org/pf3, http://forumserver.twoplustwo.com
--- Hands per second: 142779680, hands 133784560, checksum 1528972275512, total time: 937
Remark-1: There is one time evaluation tables loading for 1.547 seconds
Remark-2: Using about ~128Mb of memory, and works for Holdem 7-cards evaluations only
Remark-3: The two remarks above are not algorithmic limitations, but limitations of what we currently have compiled as a source code.
Everyone is encouraged to modify and improve this further (and post back their work!)
Remark-4: Still not fast enough? Read the thread, where Adrian20XX claimed 450m+evaluatons per second with his port to C. To be eventually included in the distribution (See here).

(2) Steve Brecher HandEval with partial state generation
--- Hands per second: 37707035, hands 133784560, checksum 3895822421317564, total time: 3548
Remark-1: No heavy memory usage, compact implementation and support of other poker variants
Remark-2: There is a bug in the 6-card hand evaluation (5 and 7 hands works OK). The fix still has to be integrated, look at the todo section below how to fix this yourself.
About Steve Brecher: http://pokerai.org/wiki/index.php/Steve_Brecher

(3) Steve Brecher HandEval, http://www.stevebrecher.com/Software/software.html
--- Hands per second: 34659212, hands 133784560, checksum 3895822421317564, total time: 3860

(3') Poker Eval's Hand_EVAL_N() in C - Approximated, unofficial!
--- Hands per second: 37467856

(4) Spears adaptation of 2+2 404url's port to Java of RayW LUT hand evaluator, also using Cactus Kev code
--- Hands per second: 23783922, hands 133784560, checksum 450334402748, total time: 5625

(5) Pokerstove (Andrew Prock's) jpoker, http://www.pokerstove.com/download/jpoker.tar.gz
--- Hands per second: 8031732, hands 133784560, checksum 4270106005454684, total time: 16657

(6) Indiana-3, 2007, http://pokerai.org/pf3
--- Hands per second: 1902700, hands 133784560, checksum 370104423538356, total time: 70313

(7) Indiana-1, 2006, http://pokerai.org/pf3
--- Hands per second: 1607134, hands 133784560, checksum 1046856166695396, total time: 83234

(8) University of Alberta, 2000, http://spaz.ca/poker
--- Hands per second: 1165716, hands 133784560, checksum 87759130835620, total time: 114766

(9) Spears port of Kevin Suffecool's C evaluator, http://pokerai.org/pf3
--- Hands per second: 874317, hands 133784560, checksum 547965983972, total time: 153016

Beyond coding?

You can follow the discussion in this thread, or you check out this overview of hand evaluators, arguably the best summary on hand evaluators state of affairs in the internets.

To benchmark

(a) n3m3sys C++ evaluatior (prepared in OP-benchmark format):

Attachment:
hashRank.zip [133.82 KB]
Downloaded 468 times

n3m3sys wrote:
for random hands (i.e, if you are not enumerating it in sequence), it is faster than RayW's method (I think that one starts incurring cache miss penalties). pokersource and steve brecher's evaluators are also faster than rayW's evaluator for random hands.


Other TODOs
(1)
Steve Brecher's evaluator has some pending bug for 6 cards hands (it was verified to work correctly for 5 an 7 cards hands): http://pokerai.org/pf3/viewtopic.php?p=10603#p10603
Steve pointed me to a fix for that, which I have to integrate: http://pokerai.org/pf3/viewtopic.php?p=10820#p10820
(2)
plexiq posted optimization for spears2p2, that cuts the load/save time by half: viewtopic.php?p=11639#p11639
(3)
C# port of RayW: viewtopic.php?p=13375#p13375
Others to benchmark:
http://www.clever-coding.com/myfiles/pokereval.rar
(4)
Packages (twoplustwo vs spears2p2 are misleading which is what, add it to OP)
(5)
Benchmark supersonic's evaluator: http://pokerai.org/pf3/viewtopic.php?p=15760#p15760
(6)
Checkout Avaron's improvements of Paul Sneezes Hand Evaluator: http://pokerai.org/pf3/viewtopic.php?p=21190#p21190
(7)
Supersonic's patches: http://pokerai.org/pf3/viewtopic.php?p=22038#p22038
(8)
Klaatu bot: http://pokerai.org/pf3/viewtopic.php?p=22731#p22731

_________________
indiana


Top
 Profile E-mail  
 
 Post subject: Re: 7-card Hand Evaluators
PostPosted: Sat Sep 08, 2007 7:48 pm 
Offline
PokerAI fellow
User avatar

Posts: 7731
Favourite Bot: V12
I know there is a huge thread on 2+2 on that (with links):
http://forumserver.twoplustwo.com/showf ... er=8513906

You also may have a look at the following references:
http://www.codeproject.com/csharp/pokerhandevaldoc.asp
http://www.codeproject.com/csharp/MoreT ... lysis1.asp

And some classic ones:
http://www.suffecool.net/poker/evaluator.html
http://spaz.ca/poker/

Still I would like to host a comparison between 7 card hand evaluators. I'll try to get some of the above running in the testbet environment as a start.
My current 7-card hand evaluator (Java) can do about 1.2 million hands/sec. It's very simple, just one class 100 lines of code, no lookup tables whatsoever (I use lookup tables beyond that, once I pre-calculate key matchup values that I need).

If someone has a hand valuator that you would like to submit for testing then PM me, or e-mail me at findbg AT gmail.com. The conditions are:
1) It's better if it's Java
2) Please submit source code only
3) Self contained, clean and and moderately short source code, easy to get it running.

Best is if you agree to publish the source code later. This can be in some of the restricted forums, not necessarily here.

I will also at some point publish in here the best intermediate solutions.

Here comes a sample, which you can already download.

HandEvaluators:

(1) Indiana, 2006, http://pokerai.org
--- Hands per second: 1227605

(2) University of Alberta, 2000, http://spaz.ca/poker
--- Hands per second: 728797

Once I do the following
a) integrate Cactus Kev / Lookup table implementation in the benchmark
b) integrate pokersource Java porting in the benchmark
c) come up with final benchmark (TestIt.java is what was tested for the above results. This wasn't done biased, but is NOT a good benchmark currently for several reasons).
d) stabalize somewhat the hardware setup

=> I'll publish the final results.

For now, you can get all of the above here:
http://pokerai.org/pj2/code/eval.zip

_________________
indiana


Top
 Profile E-mail  
 
 Post subject: Re: 7-card Hand Evaluators
PostPosted: Wed Feb 06, 2008 4:35 pm 
Offline
PokerAI fellow
User avatar

Posts: 7731
Favourite Bot: V12
Benchmarked Spear's evaluator from this thread.

(3) Spears' port of Kevin Suffecool's C evaluator, http://pokerai.org/pf3
--- Hands per second: 851831

For this evaluator I modified a bit the package structure, and added few methors, to optimize the initialization of things. If you tried to get it running, you also know that you have to adjust the relative path:
Code:
   private static final String ranksPath = ".\\scr-public\\pokerai\\game\\eval\\spears\\ranks";
in SixCardEvaluator.java to where you unzipped the stuff.

I'ts faster than Alberta's one, and slower that mine.
OK, I'm still not sure that my benchmark is good one (and almost forgot how I benchmark since I started. Anyone feel free to look at the source - TestIt.java and propose stuff). Also initializations in Spears code might further be optimized, I did that to some extend but not fully.

I have updated
http://pokerai.org/pj2/code/eval.zip

_________________
indiana


Top
 Profile E-mail  
 
 Post subject: Re: 7-card Hand Evaluators
PostPosted: Wed Feb 06, 2008 7:11 pm 
Offline
PokerAI fellow
User avatar

Posts: 686
Location: Midwest, USA
Favourite Bot: N/A
Here are my results on a Core2 Duo running at 2.4GHz. I also added poker eval into the mix. :D

I'm attaching the C++ function I used to test poker eval, I tried to follow your enumeration method exactly, indiana.

Quote:
(1) Indiana, 2006, http://pokerai.org
--- Hands per second: 1,000,779

(2) University of Alberta, 2000, http://spaz.ca/poker
--- Hands per second: 1,040,004

(3) Spear's port of Kevin Suffecool's C evaluator
--- Hands per second: 650,628

(4) Poker Eval's Hand_EVAL_N() in C
49353408 hands in 1.31722 second
--- Hands per second: 37,467,856


Just to put that in perspective:
Poker Eval = 100%
Alberta = 2.8%
Indiana = 2.7%
Spears = 1.7%


It's interesting that I found Alberta's code slightly faster than your code, where you found yours much faster than Alberta's. What processor are you using?

Honestly, I don't see how you guys can get by this slow. You really should be calling a faster DLL. :P

EDIT: I've found that I can get roughly 33 million evaluations a second in practice. For example I can do a preflop through showdown simulation (simulating all boards vs all opponents' hands, about 2.1 billion evaluations) in about a minute.


Attachments:
PokerEvalSpeed.zip [672 Bytes]
Downloaded 249 times
Top
 Profile  
 
 Post subject: Re: 7-card Hand Evaluators
PostPosted: Wed Feb 06, 2008 7:46 pm 
Offline
PokerAI fellow
User avatar

Posts: 7731
Favourite Bot: V12
Just reran it. Alberta is not faster :) I tried on Q6600, 2.4Ghz, that should somewhat match yours, as it's single threaded stuff. I also paste JVM options etc. But it's kind of volatile. I wouldn't spend a lot of energy into exact comparison into stable environment and so on, order of magnitude faster is what matters ...

Code:
C:\jdk1.6.0\bin\java -Xmx1024M -Xmx1024M -Didea.launcher.port=7534 "-Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA 7.0.1\bin" -Dfile.encoding=windows-1252 -classpath "C:\jdk1.6.0\jre\lib\charsets.jar;C:\jdk1.6.0\jre\lib\jce.jar;C:\jdk1.6.0\jre\lib\jsse.jar;C:\jdk1.6.0\jre\lib\management-agent.jar;C:\jdk1.6.0\jre\lib\resources.jar;C:\jdk1.6.0\jre\lib\rt.jar;C:\jdk1.6.0\jre\lib\ext\dnsns.jar;C:\jdk1.6.0\jre\lib\ext\localedata.jar;C:\jdk1.6.0\jre\lib\ext\sunjce_provider.jar;C:\develop\prototypes\classes;C:\develop\prototypes\classes\meerkat-api.jar;C:\develop\prototypes\classes\javamail.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 7.0.1\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain pokerai.game.eval.TestIt test
138579506116864
(1) Indiana, 2006, http://pokerai.org
--- Hands per second: 1232387.145104502

32082009393864
(2) University of Alberta, 2000, http://spaz.ca/poker
--- Hands per second: 943713.9415262826

198121954064
(3) Spear's port of Kevin Suffecool's C evaluator
--- Hands per second: 855537.7814758958


OK, now to the more interesting question ...

I expected pokereval to be faster I recall a codeproject project that was claiming 40m evaluations per second. But honestly I didn't expected to reproduce really x25 speed improvement. And although I have higher level caches in many places, still the speed of hand evals matters in many places in my work.

I don't believe however that pokereval is 25 faster just because it's C. I'll give a try and translate my evaluator to C for comparison. Wow.

I tried once to get running the Java wrappers of pokersource, but wasn't successfull with that. I really love java - it's ultra productive, IntelliJidea is much better than VC, btu when it come to performance, or win32 programming it sucks.

_________________
indiana


Top
 Profile E-mail  
 
 Post subject: Re: 7-card Hand Evaluators
PostPosted: Wed Feb 06, 2008 8:51 pm 
Offline
PokerAI fellow
User avatar

Posts: 7731
Favourite Bot: V12
OK. Translated my handEvaluator to C, and guess what - it works with the same speed as the one in Java.
I attach source code + executable + compile.bat.

This now means one of 3 things (I exclude the option that you have a bug in the usage of pokereval):
1) Pokereval is compiled with some very nice optimizations
2) MinGW (which I used) compiles very slow executable
3) Mine + Alberta's + Spears implementation sucks algorithmically vs. PokerSource implementation

Attachment:
HandEvaluator.rar [7.7 KB]
Downloaded 283 times

_________________
indiana


Top
 Profile E-mail  
 
 Post subject: Re: 7-card Hand Evaluators
PostPosted: Thu Feb 07, 2008 12:12 am 
Offline
PokerAI fellow
User avatar

Posts: 1239
Favourite Bot: my bot
1.7% ... Gulp.

Respect to Kevin Suffecool. He wrote a great 5 card evaluator, which I've used to build a (slow) 6 and 7 card evaluator.

I've just read the big 2 + 2 thread again. Seems Ray Wooton's state table code in C ran at 266 M evals/sec when ordered nicely, and 2 M evals/sec when random ordered. There is mention of other C evaluators running at 30 M evals/sec. I don't think random ordering of hands is realistic.

I'm using a seven year old machine, so my times are very much slower than indianas by a factor of about 13.
I just tried the Java version of Ray Wooton's state table code with random ordered hands and that would give about 1.9 M evals/sec on a modern machine. (There is definitely some room for improvement in the code wrapping the core in this case) With ordered hands it would run at 208 M evals/sec on a modern machine. Its a real memory hog though and takes 2 minutes to initialise on my machine.

http://forumserver.twoplustwo.com/showthreaded.php?Cat=0&Number=9765615&page=0&vc=1
http://forumserver.twoplustwo.com/showthreaded.php?Cat=0&Number=9774228&page=0&vc=1


Top
 Profile E-mail  
 
 Post subject: Re: 7-card Hand Evaluators
PostPosted: Thu Feb 07, 2008 12:31 am 
Offline
PokerAI fellow
User avatar

Posts: 7731
Favourite Bot: V12
Can you attache the Java code that you used for the benchmarking? The 2+2 threads don't have all the Java files, I guess you took them from Cactus C impl? What do you mean by "ordered" hand - is it "sorted"?

_________________
indiana


Top
 Profile E-mail  
 
 Post subject: Re: 7-card Hand Evaluators
PostPosted: Thu Feb 07, 2008 1:12 am 
Offline
PokerAI fellow
User avatar

Posts: 686
Location: Midwest, USA
Favourite Bot: N/A
indiana wrote:
This now means one of 3 things (I exclude the option that you have a bug in the usage of pokereval):
1) Pokereval is compiled with some very nice optimizations
2) MinGW (which I used) compiles very slow executable
3) Mine + Alberta's + Spears implementation sucks algorithmically vs. PokerSource implementation

0) If I have a bug in my test, it is not effecting the speed. I assure you that I can do real enumerations at about the same rate, and check the results for accuracy.
1) I didn't know you could find Pokereval pre-compiled. I compiled mine from source with MinGW, optimizations turned off, IIRC. I can assure you though, the source code is very optimized. They use many macros to avoid all calling overhead, etc.
2) I assure you that MinGW is high quality. It's just a windows port of the GNU GCC. Again, it's what I compiled the pokereval library and my test with.
3) No offense, but I'm guessing that's the biggest issue. Have you profiled the code to see what lines/loops are the bottleneck?

BTW, I compiled your C code and it ran slower than your java code.

As far as evaluators in general. I really really doubt I'll ever find any evaluator better than Pokereval. Sure you can grab a few 100 megs of memory to create lookup tables and beat the speed, but I want to run this on a tiny VM machine. When I want to run hard calculations, I just Monte-Carlo simulate anyway.

Indiana, I think what Spears means by ordered is that if you call the evaluator for hands in a certain order, it doesn't have to jump around memory so far, and will run faster because of caching. I don't see any problem with this. In the real world all enumerations are ordered, and Monte-Carlo speed isn't so critical.

Why don't you java folks just call a DLL? I have several high level functions in a static C++ library, I could probably make it a DLL pretty easily if anyone wants. I have functions for evaluating to showdown vs all opponents, etc. Pretty easy and basic interface. Anyone interested?


Top
 Profile  
 
 Post subject: Re: 7-card Hand Evaluators
PostPosted: Thu Feb 07, 2008 8:12 am 
Offline
PokerAI fellow
User avatar

Posts: 7731
Favourite Bot: V12
I profiled it, nothing spectacular. I think I had an optimized version which was doing better, I'll try to find out this one, this version was optimizing on the sorting parts, don't full recall. I'll try to find that out. I tried once to compile this one version, which already contains Java wrappers with more functionallity - so it contains both eval and SAIE fucntions, but haven't succeeded.

_________________
indiana


Top
 Profile E-mail  
 
 Post subject: Re: 7-card Hand Evaluators
PostPosted: Thu Feb 07, 2008 10:45 am 
Offline
PokerAI fellow
User avatar

Posts: 1239
Favourite Bot: my bot
indiana wrote:
Can you attache the Java code that you used for the benchmarking? The 2+2 threads don't have all the Java files, I guess you took them from Cactus C impl?


I don't remember exactly where all this code comes from, but it uses Ray Wootons state table idea and most of his code. Sorry it's not all that pretty, and right now I'm pushed for time to clean it up. Shouldn't take long to get it running though. Also can't upload the huge handRanks file, so could you generate it your end using main() in StateTableEvaluator?
Attachment:
statetableevaluator.zip [53.62 KB]
Downloaded 221 times


indiana wrote:
What do you mean by "ordered" hand - is it "sorted"?


Timmy wrote:
I think what Spears means by ordered is that if you call the evaluator for hands in a certain order, it doesn't have to jump around memory so far, and will run faster because of caching. I don't see any problem with this. In the real world all enumerations are ordered, and Monte-Carlo speed isn't so critical.
Exactly, each hand isn't ordered itself, but the hands are ordered. It's actually easier to see in the code than to say in English!


Top
 Profile E-mail  
 
 Post subject: Re: 7-card Hand Evaluators
PostPosted: Thu Feb 07, 2008 10:54 am 
Offline
PokerAI fellow
User avatar

Posts: 1239
Favourite Bot: my bot
Timmy wrote:
Why don't you java folks just call a DLL? I have several high level functions in a static C++ library, I could probably make it a DLL pretty easily if anyone wants. I have functions for evaluating to showdown vs all opponents, etc. Pretty easy and basic interface. Anyone interested?
Very. It's a kind offer, but I can't give it much attention at present because I'm overcommitted elsewhere.


Top
 Profile E-mail  
 
 Post subject: Re: 7-card Hand Evaluators
PostPosted: Thu Feb 07, 2008 4:25 pm 
Offline
PokerAI fellow
User avatar

Posts: 7731
Favourite Bot: V12
indiana wrote:
I profiled it, nothing spectacular. I think I had an optimized version which was doing better, I'll try to find out this one, this version was optimizing on the sorting parts, don't full recall. I'll try to find that out. I tried once to compile this one version, which already contains Java wrappers with more functionallity - so it contains both eval and SAIE fucntions, but haven't succeeded.

OK. I found my optimized version, and it runs at about 2+ million hands/second. This is only extrapolated to match the above results (i.e. the machine I am on now and found it is different, so I reran it here and the optimized version runs 1.6578 faster, so I just multiplied that by 1232387 and got the 2+ million number). As far as I can see the optimizaitons are getting the flushes and straights calculation centrally + reducing the internal function calls:

Attachment:
HandEvaluator3.rar [1.81 KB]
Downloaded 183 times

But apart from that, well, it's still 20 times slower than pokereval measurement, and I would love to manage to get the pokersource running for the purpose of SAIE, which is a primary usecase for handeval.

Spears, thanks for the additonal sources. I will try to get this running, or assemble it with the 2+2 coding. This is another "Cactus Kev's" porting which I found some time ago (in won't compile directly on your site due to some internal imports):
Attachment:
handeval5.rar [46.3 KB]
Downloaded 180 times

_________________
indiana


Last edited by indiana on Thu Feb 07, 2008 4:34 pm, edited 2 times in total.
Added another Cactus Kev porting


Top
 Profile E-mail  
 
 Post subject: Re: 7-card Hand Evaluators
PostPosted: Thu Feb 07, 2008 6:02 pm 
Offline
PokerAI fellow
User avatar

Posts: 1239
Favourite Bot: my bot
indiana wrote:
Spears, thanks for the additonal sources. I will try to get this running, or assemble it with the 2+2 coding. This is another "Cactus Kev's" porting which I found some time ago (in won't compile directly on your site due to some internal imports):


I'm not 100% sure but I think I posted the only dependencies previously. If this is not the case tell me and I'll tidy up.


Top
 Profile E-mail  
 
 Post subject: Re: 7-card Hand Evaluators
PostPosted: Thu Feb 07, 2008 6:08 pm 
Offline
PokerAI fellow
User avatar

Posts: 7731
Favourite Bot: V12
I got it running, and it ran with > 10 million hands/sec!

I got this running pretty much in haste so I have to doublecheck if it calculates everything correctly. As you wrote, it takes some memory (125+Mb serialized on the file system), si it's not very nive for embedded bot but if the speed is like 10m hands/sec and it works correctly it could be of good help ...

_________________
indiana


Top
 Profile E-mail  
 
 Post subject: Re: 7-card Hand Evaluators
PostPosted: Thu Feb 07, 2008 7:02 pm 
Offline
PokerAI fellow
User avatar

Posts: 1239
Favourite Bot: my bot
indiana wrote:
I got it running, and it ran with > 10 million hands/sec!


I'm glad you got that mess going. The ordered test does 14.7 M h/s on my 7 year old machine. I would guess 200 M h/s on yours. At this speed the speed of the calling code becomes a very important consideration.

You have the ordered test. It looks like this:
Code:
      long startTimer = System.currentTimeMillis();
      

      for (c0 = 1; c0 < 53; c0++) {
          u0 = handRanks[53 + c0];
          for (c1 = c0 + 1; c1 < 53; c1++) {
              u1 = handRanks[u0 + c1];
              for (c2 = c1 + 1; c2 < 53; c2++) {
                  u2 = handRanks[u1 + c2];
                  for (c3 = c2 + 1; c3 < 53; c3++) {
                      u3 = handRanks[u2 + c3];
                      for (c4 = c3 + 1; c4 < 53; c4++) {
                          u4 = handRanks[u3 + c4];
                          for (c5 = c4 + 1; c5 < 53; c5++) {
                              u5 = handRanks[u4 + c5];
                              for (c6 = c5 + 1; c6 < 53; c6++) {
                                 handRank = handRanks[u5 + c6];
                                 handEnumerations[handRank >>> 12]++;
                                 equivalencyEnumerations[handRank >>> 12][handRank & 0xFFF]++;
                                 numHands++;
                              }
                          }
                      }
                  }
              }
          }
      }
      
     
      long stopTimer = System.currentTimeMillis();


Top
 Profile E-mail  
 
 Post subject: Re: 7-card Hand Evaluators
PostPosted: Fri Feb 08, 2008 5:38 pm 
Offline
PokerAI fellow
User avatar

Posts: 7731
Favourite Bot: V12
OK,

Did a retest. Spears 2+2 port runs 23m/sec, i'll do some more tests for if it isn't buggy.

(1) Spears port of 2+2 evaluator, http://pokerai.org/pf3
--- Hands per second: 23401331, hands 49353408


(2) Indiana-3, 2007, http://pokerai.org/pf3
--- Hands per second: 1750866, hands 49353408

(3) Indiana-1, 2006, http://pokerai.org/pf3
--- Hands per second: 1258438, hands 49353408

(4) University of Alberta, 2000, http://spaz.ca/poker
--- Hands per second: 1083952, hands 49353408

(5) Spears port of Kevin Suffecool's C evaluator, http://pokerai.org/pf3
--- Hands per second: 929005, hands 49353408

Updated the upload, everything is available here: http://pokerai.org/pj2/code/eval.zip

_________________
indiana


Top
 Profile E-mail  
 
 Post subject: Re: 7-card Hand Evaluators
PostPosted: Fri Feb 08, 2008 6:28 pm 
Offline
PokerAI fellow
User avatar

Posts: 7731
Favourite Bot: V12
Spears,

Not only your code works ultra-fast, but while trying to check if it's buggy I found a bug in my Hand Evaluator (two pairs were always quallified equal, no matter of the high card). So it works perfectly correct, and I fixed my evaluator (I updated now the download zip, and also included correctness test in TestIt.java).

I guess all cheers go to your porting of the 2+2 hand eval, at least until I introduce more tests. The only drawback is the additional memory used (about 200Mb) and first slow startup (for generating the values, which is about 130Mb file in your C:\).

_________________
indiana


Top
 Profile E-mail  
 
 Post subject: Re: 7-card Hand Evaluators
PostPosted: Sat Feb 09, 2008 4:23 am 
Offline
PokerAI fellow
User avatar

Posts: 686
Location: Midwest, USA
Favourite Bot: N/A
spears wrote:
Timmy wrote:
Why don't you java folks just call a DLL? I have several high level functions in a static C++ library, I could probably make it a DLL pretty easily if anyone wants. I have functions for evaluating to showdown vs all opponents, etc. Pretty easy and basic interface. Anyone interested?
Very. It's a kind offer, but I can't give it much attention at present because I'm overcommitted elsewhere.

Well, I went ahead and made it a DLL. The thread is here.

The interface is by far the biggest thing I've done in java (and by that I mean the only thing), so I hope I didn't mess it up to bad. Anyway, there is a sample java test and it does seem to work.

indiana wrote:
The only drawback is the additional memory used (about 200Mb) and first slow startup (for generating the values, which is about 130Mb file in your C:\).
While the speeds you guys are getting is impressive, there's something about imagining all that memory usage on VMs...


Top
 Profile  
 
 Post subject: Re: 7-card Hand Evaluators
PostPosted: Sat Feb 09, 2008 7:06 am 
Offline
PokerAI fellow
User avatar

Posts: 686
Location: Midwest, USA
Favourite Bot: N/A
Here's another run on my computer. (E6600)

(1) Indiana-1, 2006, http://pokerai.org/pf3
--- Hands per second: 997,563, hands 4,9353,408, checksum 138581329346584

(2) Indiana-3, 2007, http://pokerai.org/pf3
--- Hands per second: 1,713,065, hands 49,353,408, checksum 138581329346584

(3) University of Alberta, 2000, http://spaz.ca/poker
--- Hands per second: 1,073,484, hands 49,353,408, checksum 32082009393864

(4) Spears port of Kevin Suffecool's C evaluator, http://pokerai.org/pf3
--- Hands per second: 641,678, hands 49,353,408, checksum 198121954064

(5) Spears port of 2+2 evaluator, http://pokerai.org/pf3
--- Hands per second: 15,722,653, hands 49,353,408, checksum 139477642848

(6) Spears port of 2+2 evaluator ordered test
--- Hands per second: 110,657,204, hands 133,784,560

(7) Timmy's PSim library (poker-eval wrapper) (The enumeration is quite different, but this is a real world test.)
Now we will benchmark with the hand: Ah 9s
We took 63.768 seconds to do 2,099,692,386 evaluations.
--- Hands per second: 32,927,054


UofA is still beating Indiana-1. :lol:


EDIT: added in the data for number 6, which I couldn't figure out before.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 399 posts ]  Go to page 1, 2, 3, 4, 5 ... 20  Next


Who is online

Users browsing this forum: Google and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: