insufficient mating material

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
zenpawn
Posts: 296
Joined: Sat Aug 06, 2016 6:31 pm
Location: United States

insufficient mating material

Post by zenpawn » Mon May 29, 2017 11:42 am

In some recent gauntlets using cutechesscli, I noticed the following losses due to invalid draw claims. Some of these surprised me more than others, but I guess I'll have to correct them all regardless. This is mostly a heads up thread for others to check the insufficient mating material rules in their engines. Hope it helps.

[d]7n/8/8/4k3/2K5/8/8/6n1 w - - 0 69
Though forced mate is not possible, the lone king can still blunder into a self-mate in the corner.

[d]8/8/8/3b2k1/8/6K1/5B2/8 w - - 0 106
This fails the test because the bishops are of opposite color. If they were the same, the draw claim would be correct.

[d]8/8/7k/5K2/7b/5N2/8/8 w - - 0 150
Initially most surprising, but indeed, mates are possible in the corners opposite the bishop's color.

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

Re: insufficient mating material

Post by hgm » Mon May 29, 2017 12:06 pm

Indeed, these are not claimable under FIDE rules. Engines should also not try to 'outsmart the GUI' by claiming a draw because of a 'positionally dead' game, like

[d]4k3/8/8/p2p2p1/P2P2P1/8/8/4K3 w

GUIs cannot really play Chess (that is the engine's task), and although counting material is easily added, these kind of draws are beyond their comprehension of the game. So they would likely flag a draw claim as invalid.

zenpawn
Posts: 296
Joined: Sat Aug 06, 2016 6:31 pm
Location: United States

Re: insufficient mating material

Post by zenpawn » Mon May 29, 2017 12:09 pm

Definitely wasn't intended as an outsmart, just a misinterpretation and/or faulty implementation of the rules. :)

zenpawn
Posts: 296
Joined: Sat Aug 06, 2016 6:31 pm
Location: United States

Re: insufficient mating material

Post by zenpawn » Mon May 29, 2017 5:25 pm

So, the way I was handling this rule was to declare it a draw if both sides had insufficient mating material. However, the presence of enemy pieces that can box in their own king makes this an invalid assumption. Perhaps this is better suited to a lookup.

zenpawn
Posts: 296
Joined: Sat Aug 06, 2016 6:31 pm
Location: United States

Re: insufficient mating material

Post by zenpawn » Mon May 29, 2017 6:03 pm

zenpawn wrote: [d]8/8/7k/5K2/7b/5N2/8/8 w - - 0 150
Initially most surprising, but indeed, mates are possible in the corners opposite the bishop's color.
And vice-versa, i.e., the knight can mate in corners opposite the bishop's color and the bishop can mate in corners of its own color.

jwes
Posts: 778
Joined: Sat Jul 01, 2006 5:11 am

Re: insufficient mating material

Post by jwes » Mon May 29, 2017 7:02 pm

zenpawn wrote:So, the way I was handling this rule was to declare it a draw if both sides had insufficient mating material. However, the presence of enemy pieces that can box in their own king makes this an invalid assumption. Perhaps this is better suited to a lookup.
A lookup doesn't help much either. You can offer a draw, but if that is not accepted, just move very fast and wait for the 50 move rule.

User avatar
pedrox
Posts: 992
Joined: Fri Mar 10, 2006 5:07 am
Location: Basque Country (Spain)
Contact:

Re: insufficient mating material

Post by pedrox » Mon May 29, 2017 7:05 pm

When white and black have a knight, I think draw can not be claimed either, mate is possible.
Last edited by pedrox on Mon May 29, 2017 7:06 pm, edited 1 time in total.

zenpawn
Posts: 296
Joined: Sat Aug 06, 2016 6:31 pm
Location: United States

Re: insufficient mating material

Post by zenpawn » Mon May 29, 2017 7:06 pm

jwes wrote:
zenpawn wrote:So, the way I was handling this rule was to declare it a draw if both sides had insufficient mating material. However, the presence of enemy pieces that can box in their own king makes this an invalid assumption. Perhaps this is better suited to a lookup.
A lookup doesn't help much either. You can offer a draw, but if that is not accepted, just move very fast and wait for the 50 move rule.
I think I've solved it without a lookup. Probably offering a draw for the ones that aren't legally insufficient material is a nice thing to do, but alas, I haven't added that.

zenpawn
Posts: 296
Joined: Sat Aug 06, 2016 6:31 pm
Location: United States

Re: insufficient mating material

Post by zenpawn » Mon May 29, 2017 7:08 pm

pedrox wrote:When white and black have a knight, I think draw can not be claimed either, mate is possible.
Indeed.

[d]6nk/5N2/6K1/8/8/8/8/8 b - - 0 0

Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 10:41 am

Re: insufficient mating material

Post by Lyudmil Tsvetkov » Tue May 30, 2017 7:52 am

knight against rook is also sometimes not drawn:

[d]6rk/5N2/7K/8/8/8/8/8 b - - 0 1

Post Reply