Today I looked at my program playing against fairymax under xboard. Usually I let it battle via HGM's server. I then noticed that sometimes it does very very bad moves. Like giving away the queen, something that can be noticed in 1 ply.
So I looked through the trace-log of my program I noticed something odd.
Sometimes, this happens not very often, it goes into an infinite loop in the aspiration windowsize code until it timeouts.
I use -32767 / +32767 for infinite.
I use -10000 / +10000 for check mate.
The evaluation is the simples possible where pawn is e.g. 100.
For the window size I use 100. I could maybe reduce that to half a pawn but first I want to make sure the code itself is fine.
Code: Select all
current id depth: 1
F5-G4 [regular] (1537 with [-32767,32767])
current id depth: 2
A3-A1 [regular] (1597 with [1437,1637])
current id depth: 3
F5-G4 [regular] (1597 with [1497,1697])
current id depth: 4
A3-A1 [regular] (1697 with [1497,1697])
current id depth: 4
C3-C2 [regular] (2056 with [1497,32767])
current id depth: 5
F5-D3 [regular] (2156 with [1956,2156])
current id depth: 5
F5-D3 [regular] (9995 with [1956,32767])
checkmate detected at 5
current id depth: 6
F5-D3 [regular] (32767 with [9895,10095])
checkmate detected at 6
current id depth: 6
F5-D3 [regular] (32767 with [9895,32767])
checkmate detected at 6
current id depth: 6
F5-D3 [regular] (32767 with [9895,32767])
First question (this is a sanity check): a search can (in bug free code) return infinite, right?
So I enlarge the window a bit: 9895...10095. This is beyond the maximum check mate score (of 10k). Second question: is this valid? Those values (e.g. > 10k) can never happen so setting it larger is silly?
After the larger window, it still returns infinite (32767). The window cannot be set larger so when it retries, it keeps returning that 32767 value and so it loops forever.
regards
