GeoffW wrote:Hi
Law 1Take an idea that works for everyone else, implement it in your program and it will never work first time or ever !
I have just tried the late move reductions that Tord and Stuart had been talking about recently
- Code: Select all
if ((depth > 1) && !disablePruning && !weAreInCheck && (!(gen_dat[i].m.b.bits & (CAPTURE_MOVE | PROMOTE_MOVE))) &&
history[gen_dat[i].m.b.from][gen_dat[i].m.b.to].count == 0 && !checkingMove(gen_dat[i].m) )
{
if (legalMoveCount > 3)
reduction = 1;
else
reduction = 0;
}
/* history[].count is a measure of moves where score > alpha, =depth squared to be precise */
This looked promising at first as it reduced node counts drastically but made the program play significantly worse.
Any ideas what I could do to improve that bit of code ? I have added history array variables to count nodes that score > alpha, and score>beta, but so far no other experiments have helped
Law 2If you discover a bug that has been in your program for several months, fixing the bug is guaranteed to make it play worse!
I fixed a couple of typos while I was adding mobility code, didnt seem to help me at all. From reading the other messages here today, sounds like Naum has fell foul of this law too
Still testing, but my simple mobility code is not doing much to help either
Regards Geoff
Tord also said that it would work best in simple-eval programs.
Is your program a simple-eval program?
My program was at the time of adding it and it produced a 1-2%
improvement in basic test suite score, improved branching factor,
and greater depth. My program then did only material + pcsq.
As my eval gets more complex, I'll watch late move reduction
with and without to ensure it doesn't go the opposite side too much.
Since late move reduction I added passed pawns and doubled pawns
at terminal nodes (no file/rank multipliers for though yet, but
a game stage multiplier), queen foraging in opening penalty,
basic king castling, and mobility.
I went back and ran a test for the purposes of this post.
The first two results are with late move reduction at 1 second per
position on wac (revised) and Dann Corbit's ecmgcp.epd) and
then without late move reduction at the same time control for the same tests:
$ ./td_testshort
time 1 wac.epd
+ 7.06/18.88 81% 243/300 bf=2.30 ha=34.29% pha=96.04% 244.46 29659060 98864/1/121325 44961/74622/385188/983312/6086660/1
46079
- 7.22/20.45 19% 35/183 bf=2.62 ha=29.31% pha=97.06% 182.81 20108780 109884/1/109999 23477/52305/27428/471522/5670896/47
576
Stuart Cracraft@CRACRAFT ~/src/td
$ ./td_testshort
time 1 wac.epd
+ 6.07/18.79 80% 241/300 bf=3.06 ha=31.80% pha=95.96% 245.81 37070824 123569/1/150808 52641/82607/226060/1035093/1016172
0/240549
- 5.94/20.03 17% 32/183 bf=3.86 ha=27.91% pha=96.97% 183.66 24156228 132001/1/131525 23947/52399/38485/440327/8880315/46
771
bf (branching factor) improved measureably while test results very
slightly improved.
This result is good enough for me.
The evaluation in the former pair above (late move reduction) is
the default version of the present "TeeDee" program and has only
these at terminal nodes:
material
pcsq all (based on fruit, but hard-transition not smoothed yet)
doubled pawns penalty
passed pawns bonus
mobility
queen foraging in opening penalty
king presently in castled position bonus
Specifically:
material 1000.0000 3000.0000 3100.0000 5000.0000 9000.0000
params[2311] passed pawn = 100.000000 for each passed pawn
without respect to file or rank but multiplied by game stage 1-10
params[2312] doubled pawn = -100.000000 for each doubled pawn
without respect to file or rank but multiplied by game stage 1-10
params[2313] mobility = 100.000000 for each pseudo-legal move
there is not variance per piece-type for mobility granted nor for
any other aspect (game stage, centrality, etc.)
params[2314] queen_foraging = -100.000000
a penalty applied if the queen is seen off its opening square in
the opening of the game without respect to development before
the first third of material is traded off
params[2315] king castled = 100.000000
king and rook must be on their castled square queen or kingside
Sorry for the format of the above. It is a side-effect of the program's
research design goals still underway.
Stuart