![]() |
| If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|||||||
| Tags: good, move, ordering |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Hello!
I am writing a (simple) chess program and I think it is rather slow, i.e. it would not search very deep (only a few plies) in a short period of time. I thought one reason might be a poor move ordering (I use alpha-beta with iterativ deepening). So I read some posts in this group to get informations how to make it faster. Robert Hyatt suggested to test the move order quality by computing a number that divides all cutoffs happening at the first move at a certain node by all occuring cutoffs. If that number was about 0.9 it would be good. Well - I get 0.9 most of the time (hoping that I compute the number right). On the other hand I tried the following: In my evaluation function I did the usual computions, but instead returning the computed value I always returned 0. This - I thought - would give perfect cutoff scenarios, while everything else of the algorithmus would not be affected (as opposed to directly returning 0, which is of course additionally faster as _no_ evaluation is done at the nodes). However, comparing the usual response time (with seemingly good move ordering) to the one obtained when eventually returning 0, the latter one was _much, much_ faster, especially when searching deeper! So I am confused now. It would be great, if anyone could help me. Thanks in advance, -delphi- |
| Ads |
|
#2
|
|||
|
|||
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1 Delphi wrote: On the other hand I tried the following: In my evaluation function I did the usual computions, but instead returning the computed value I always returned 0. ... comparing the usual response time (with seemingly good move ordering) to the one obtained when eventually returning 0, the latter one was _much, much_ faster Random thought - does your compiler avoid generating code for stuff that is never used? Thus returning zero might optimise out some or all of your evaluation computations. Sometimes these computers are too damn clever. -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE/Pl/kGFXfHI9FVgYRAmGHAJ9lhNvs7275vUm4ZahwcSaLN3iImQCgg gb1 ASy1wSSSR+NPLGsud/Dn3JM= =eIV1 -----END PGP SIGNATURE----- |
|
#3
|
|||
|
|||
|
Simon Waters wrote in message ...
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Delphi wrote: On the other hand I tried the following: In my evaluation function I did the usual computions, but instead returning the computed value I always returned 0. ... comparing the usual response time (with seemingly good move ordering) to the one obtained when eventually returning 0, the latter one was _much, much_ faster Random thought - does your compiler avoid generating code for stuff that is never used? Thus returning zero might optimise out some or all of your evaluation computations. Sometimes these computers are too damn clever. -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE/Pl/kGFXfHI9FVgYRAmGHAJ9lhNvs7275vUm4ZahwcSaLN3iImQCgg gb1 ASy1wSSSR+NPLGsud/Dn3JM= =eIV1 -----END PGP SIGNATURE----- Oh - I did not think of something like that! Anyway, I changed the value 0 to a computation that yields also a constant value but only if a certain condition is fulfilled (which is true in the first moves), so I think this could not be optimized. The result is the same: approx. 10 times faster response than without a constant value, while immediately returning 0 is yet faster (which also means, that it can't be a compiler optimization issue (is vc6++, by the way). thanks anyway, -delphi- |
|
#4
|
|||
|
|||
|
|
| Thread Tools | |
| Display Modes | |
|
|