Stupid Extension Problem/Question

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
User avatar
JVMerlino
Posts: 1003
Joined: Wed Mar 08, 2006 9:15 pm
Location: San Francisco, California

Stupid Extension Problem/Question

Post by JVMerlino » Wed Dec 23, 2009 10:34 pm

Hi All,

Here's an amusing one for you all. WAC 299:

[D]1n2rr2/1pk3pp/pNn2p2/2N1p3/8/6P1/PP2PPKP/2RR4 w - -

The best move is Nca4. However, due to full ply extensions for check and singular reply (which are the standard, as far as I can tell), and due to move ordering, my STUPID engine thinks that Na8+ is best!

This is because Myrddin chooses the line:

Na8+ (check, full ply extension), Kc8 (singular reply, full ply extension), Nb6+ (check), Kc7 (singular reply),

...which brings us back to the initial position...

and THEN Nca4, which gets the appropriate high score.

So, because of these extensions, and because Na8+ is checked first at depth 1 and gets a high score, it will always be checked before Nca4 on subsequent depths, meaning my engine never gets WAC 299 correct.

The only ways I can think of solving this are:
-- limit the total number of extensions to < 4 (the current value hovers between 6-10, depending on how testing goes and my mood)
-- implement partial extensions and give check and/or singular replies less than a full ply extension (which is non-standard),
-- (probably best, but feels clumsy) limit the number of extensions based on the current depth, so that < 4 extensions are allowed at depth 1.

Thoughts? Amused? ROFLing? Should I even care about scoring one more point on WAC? :wink:

Happy Holidays!

jm

User avatar
hgm
Posts: 23714
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Stupid Extension Problem/Question

Post by hgm » Wed Dec 23, 2009 10:44 pm

If you return to the initial position, it should get a zero score, not? Repeats are draws in Chess, and if you thin you can get a high score by first wasting a few moves to return to an earlier position, you are just fooling yourself. This invites very bad horizon effects, even without any extensions.

The general problem, that you can reach the same good position through a short and a long path, and prefers the long path because for some reason it happened to see that first (e.g. because of a hash graft, or because the time-wasting move seemed good at low depth, and then strikes out, like you have here) is a fundamental short-cming in alpha-beta, and is generally solved by a delayed-loss bonus, as implemented in micro-Max.

krazyken

Re: Stupid Extension Problem/Question

Post by krazyken » Wed Dec 23, 2009 10:45 pm

a repetition of a position should be scored as a draw value.

Will Singleton
Posts: 128
Joined: Thu Mar 09, 2006 4:14 pm
Location: Los Angeles, CA

Re: Stupid Extension Problem/Question

Post by Will Singleton » Thu Dec 24, 2009 3:54 am

hgm wrote:If you return to the initial position, it should get a zero score, not? Repeats are draws in Chess, and if you thin you can get a high score by first wasting a few moves to return to an earlier position, you are just fooling yourself. This invites very bad horizon effects, even without any extensions.

The general problem, that you can reach the same good position through a short and a long path, and prefers the long path because for some reason it happened to see that first (e.g. because of a hash graft, or because the time-wasting move seemed good at low depth, and then strikes out, like you have here) is a fundamental short-cming in alpha-beta, and is generally solved by a delayed-loss bonus, as implemented in micro-Max.
You say that repeats are draws. I don't know about that, I wonder how often folks do it that way or the "right" way. One repeat does not a draw make. I might try it your way to see what happens to various positions.

Will

bob
Posts: 20550
Joined: Mon Feb 27, 2006 6:30 pm
Location: Birmingham, AL

Re: Stupid Extension Problem/Question

Post by bob » Thu Dec 24, 2009 7:09 pm

Will Singleton wrote:
hgm wrote:If you return to the initial position, it should get a zero score, not? Repeats are draws in Chess, and if you thin you can get a high score by first wasting a few moves to return to an earlier position, you are just fooling yourself. This invites very bad horizon effects, even without any extensions.

The general problem, that you can reach the same good position through a short and a long path, and prefers the long path because for some reason it happened to see that first (e.g. because of a hash graft, or because the time-wasting move seemed good at low depth, and then strikes out, like you have here) is a fundamental short-cming in alpha-beta, and is generally solved by a delayed-loss bonus, as implemented in micro-Max.
You say that repeats are draws. I don't know about that, I wonder how often folks do it that way or the "right" way. One repeat does not a draw make. I might try it your way to see what happens to various positions.

Will
Easy proof. Take any position P. If you take a path that goes thru P' and then back to P before moving on to Q, you can treat the first repeat as a draw, because if you can avoid the draw, you can go directly from P to Q, rather than first going P-P'-P-Q.

Most everybody does it that way. In the real board position, you don't _claim_ the draw until the 3rd repetition, but in the search, counting the second as a draw works fine...

User avatar
JVMerlino
Posts: 1003
Joined: Wed Mar 08, 2006 9:15 pm
Location: San Francisco, California

Re: Stupid Extension Problem/Question

Post by JVMerlino » Thu Dec 24, 2009 7:33 pm

Eureka!

Thanks to everybody who replied. The answer was pretty simple. Myrddin has no problem detecting draws, and does return a draw score after it sees one repetition.

But it wasn't checking against the initial position! :roll:

Fixed....

jm

Post Reply