Daniel Shawul wrote:Wesley you are a genius !!
Indeed that is weird. How can it avoid all hanging piece situations with mobility eval ?? The _root move ordering _ must some how persist thorught where they are sorted by Qsearch, captures first etc ...
I changed the order of captures and non-captures in root.c, and set value = 0 for Qsearch . I also set skill = 0 in eval. I did this by removing the part of the code in eval.c because it doesn't allow you to set skill 0.
First, it doesn't avoid losing material at ply=2. Tried it an hour ago and it hung pieces right and left. _IF_ you use skill=1 _AND_ you compile with -DSKILL.
Root moves are ordered by calling Quiesce(). Which returns, as we know, purely random evaluations. If you want to see them, just type "disp ply1" and then either "go" or enter a move. Here is an example. I set sd=2, typed "display ply1" and then "e4". Here is the ply-1 move list as it is sorted, with the scores returned by quiesce():
move score
e5 -2
Nf6 -9
e6 -11
d6 -12
a6 -16
f5 -21
f6 -28
c5 -30
Na6 -35
c6 -41
g6 -47
d5 -51
b5 -60
a5 -64
Nc6 -66
b6 -66
h5 -78
Nh6 -82
g5 -88
h6 -98
Notice the move f5? Hangs a pawn. Not first. Yet that is what it played here with sd=2:
time surplus 0.00 time limit 30.00 (+0.00) (3:00)
depth time score variation (1)
2-> 0.14 0.90 1. ... f5 2. Be2
time=0.14 mat=0 n=488 fh=5% nps=3K
extensions=3 qchecks=2 reduced=0 pruned=0
predicted=0 evals=429 50move=0 EGTBprobes=0 hits=0
SMP-> splits=0 aborts=0 data=0/128 elap=0.14
Black(1): f5
Notice the ply1 move list has negative scores between -100 and 0. Because when I call quiesce, it negates the numbers since the side to move is reversed.
I don't know what you are seeing, or what you are getting, but if you do skill=1 and sd=2, it will _not_ play well. It hangs pieces right and left. Whatever you are talking about above, I have no idea. You _will_ get crap moves with sd=2. And skill 1. But if you use something like st=1, you will not. Note that this _must_ be done with 23.2... 23.3 has a time waster loop that at st=1 reduces the nps to under 5000 which will make it play poorly. You can comment that loop out (first reference to SKILL in evaluate.c, or else use 23.2 to avoid using the new version that seems to solve the strong skill=1 play.
So first, let's get on the right version, which is 23.2. Second, make sure it is compiled with -DSKILL and run with st=1 or so and skill=1. And see how often it hangs material. It still will, but very infrequently. If you do the test properly.
If you insist on using 23.3, you have to comment out the loop at the top of evaluate.c so it won't slow down and reach very shallow depths which ruins the mobility effect...
More once you are clear on what you actually tested... BTW root move ordering simply makes each root move, calls Quiesce() and saves the returned value. The moves are then sorted based on these values, from high to low. No captures first or any other such thing. Once you get to iteration 2, moves are sorted by node counts which with this kind of evaluation is also very random.
And look what i got on my first try.. Crap game that i get from scorpio_random... I don't want to be excited about this as I don't know internals of crafty very well and could have made mistake somewhere , but if this is really turns out as the culprit then the Beal effect bla bla crap savings material smartly through mobility is utter crap..
Code: Select all
[Event "?"]
[Site "?"]
[Date "2010.07.22"]
[Round "2"]
[White "XboardEngine"]
[Black "Crafty-23.1"]
[Result "1-0"]
[PlyCount "73"]
[TimeControl "40/30+1"]
1. e4 {book} c5 {book} 2. Nf3 {book} e6 {book} 3. d4 {book} cxd4 {book}
4. Nxd4 {book} Nc6 {book} 5. Nb5 {book} Nf6 {book} 6. N1c3 {book} d6 {book}
7. Bf4 {book} e5 {book} 8. Bg5 {book} a6 {book} 9. Na3 {book} b5 {book}
10. Bxf6 {book} gxf6 {book} 11. Nd5 {book} f5 {book} 12. c3 {book} Bg7 {book}
13. exf5 {book} Bxf5 {book} 14. Be2 {+0.35/4 1.4s} Be4 {+0.56/8 2.3s}
15. Bf3 {+0.43/5 1.4s} Qh4 {+0.54/8 2.3s} 16. Nc7+ {+2.43/5 1.4s}
Kd7 {+0.57/9 2.3s} 17. Nxa8 {+2.43/5 1.4s} Nd4 {+0.56/8 2.4s}
18. Nb6+ {+5.82/5 1.4s} Ke7 {+0.55/8 2.3s} 19. cxd4 {+6.93/5 1.4s}
Kf8 {+0.60/8 4.6s} 20. dxe5 {+8.30/5 1.4s} Bxe5 {+0.56/8 2.0s}
21. Nd7+ {+8.07/5 1.3s} Kg7 {+0.61/10 2.2s} 22. Nxe5 {+8.40/5 1.3s}
b4 {+0.67/9 3.2s} 23. g3 {+11.49/5 1.3s} Qe7 {+0.68/8 1.6s}
24. Bxe4 {+11.39/5 1.3s} Qg5 {+0.77/9 2.0s} 25. f4 {+14.77/5 1.3s}
Re8 {+0.88/9 2.3s} 26. fxg5 {+18.51/5 1.3s} Rxe5 {+0.97/10 1.6s}
27. Nc2 {+18.40/5 1.3s} Rxe4+ {+0.95/10 2.2s} 28. Kf2 {+18.86/5 1.3s}
b3 {+0.93/9 1.5s} 29. axb3 {+19.65/5 1.3s} Kg8 {+0.96/9 1.8s}
30. Qxd6 {+20.77/5 1.3s} Re8 {+0.99/10 1.5s} 31. Rxa6 {+20.87/4 1.2s}
Rc8 {+327.53/10 1.7s} 32. Qd3 {+21.08/4 1.2s} Re8 {+0.98/10 1.7s}
33. Rh6 {+22.31/4 1.2s} Kf8 {+327.55/10 1.6s} 34. Rxh7 {+22.46/4 1.2s}
Kg8 {+327.57/10 1.6s} 35. g6 {+23.06/4 1.2s} Kf8 {+327.59/8 1.6s}
36. Qd6+ {+30.31/4 1.2s} Kg8 {+327.61/9 1.7s} 37. gxf7+ {+32.13/4 1.2s}
{Black resigns} 1-0