max amount of moves from a position?

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
Eelco de Groot
Posts: 4561
Joined: Sun Mar 12, 2006 2:40 am
Full name:   

Re: max amount of moves from a position?

Post by Eelco de Groot »

mcostalba wrote:
Arpad Rusz wrote: The max. number of captures for one side in a legal position (T.Marlow, W.Cross, 1967)

[D]r1n1n1b1/1P1P1P1P/1N1N1N2/2RnQrRq/2pKp3/3BNQbQ/k7/4Bq2 w - - 0 1

(74 white captures)
This position is interesting because is able to blow up your qsearch() !

Try it on your favorite engine ;-)
Position is not ever going to matter in a game so IMO not worthy of repair. We've had a similar discussion in the past with similar position. There are literally millions of positions that need to be addressed first :shock: IMO There was no need to be rude to Uri Marco, because he never means to criticize, this is just Uri.

Anyway I was posting here mainly because think I might have just found a very tiny improvement for the quiescence search by double pass filtering but it is not going to solve this artificial position. Is there any interest from the Stockfish team to try it out because we have to beat the cloud... 8-) Are you all by yourself Marco? Joona has not posted in a while and neither has Tord in the last two weeks...

Eelco
Debugging is twice as hard as writing the code in the first
place. Therefore, if you write the code as cleverly as possible, you
are, by definition, not smart enough to debug it.
-- Brian W. Kernighan
mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 9:17 pm

Re: max amount of moves from a position?

Post by mcostalba »

Eelco de Groot wrote:IMO There was no need to be rude to Uri Marco, because he never means to criticize, this is just Uri.
And I am just myself !

I didn't mean to be rude with him, it is just that I really hate sentences like "it is like this, it is like that" even more when totally untested and even even more when the possible test would just take few minutes: so it is not that I wanted to criticize Uri, it is just that I've read an escalation of things that I don't like, one right after the other in a quick shotgun fire :-) It just happened to be Uri that wrote that, but if it is was someone else the reaction would have been the same, perhaps even worst because with Uri we have exchanged many interesting posts in the past and I hope to continue like that also in the future.

BTW if Uri has no problems to write "this and that" I think he should have no problems in accepting a strong reply, I have no problems to read strong sentences against me or what I have done....it is just that I don't keep quiet ;-)
sluijten
Posts: 44
Joined: Wed Apr 13, 2011 12:43 pm

Re: max amount of moves from a position?

Post by sluijten »

How about captures & promotions, what is the maximum number for any position?
Dann Corbit
Posts: 12538
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: max amount of moves from a position?

Post by Dann Corbit »

sluijten wrote:How about captures & promotions, what is the maximum number for any position?
You get quite a few from this, which I call "King in a Can":
[d]rnbq1bnr/PPPPPPPP/8/3ppp2/3pkp2/3NpN2/4K3/8 w - -

I assumed that you are restricting captures to promotion captures.

If you assume 255 as maximum for any move type from any legal board position, I don't think you could go wrong.

218 is the largest number of legal moves of any type from one position that I have seen.

Of course, examples are not proofs of any kind. It is possible that more than 256 are possible. It's just that nobody has ever proven it one way or the other.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: max amount of moves from a position?

Post by sje »

[D]rnbq1bnr/PPPPPPPP/8/3ppp2/3pkp2/3NpN2/4K3/8 w - - 0 1

Only 71 moves:

Kd1 Ke1 Kf1 Nb2 Nb4 Nc1 Nc5# Nd2+ Nde1 Ndxe5 Nf2+ Nfe1 Nfxe5 Ng1 Ng5# Nh2 Nh4 Nxd4 Nxf4 axb8=B axb8=N axb8=Q axb8=R bxa8=B bxa8=N bxa8=Q bxa8=R bxc8=B bxc8=N bxc8=Q bxc8=R cxb8=B cxb8=N cxb8=Q cxb8=R cxd8=B cxd8=N cxd8=Q cxd8=R dxc8=B dxc8=N dxc8=Q dxc8=R e8=B e8=N e8=Q e8=R exd8=B exd8=N exd8=Q exd8=R exf8=B exf8=N exf8=Q exf8=R fxg8=B fxg8=N fxg8=Q fxg8=R gxf8=B gxf8=N gxf8=Q gxf8=R gxh8=B gxh8=N gxh8=Q gxh8=R hxg8=B hxg8=N hxg8=Q hxg8=R
Edmund
Posts: 670
Joined: Mon Dec 03, 2007 3:01 pm
Location: Barcelona, Spain

Re: max amount of moves from a position?

Post by Edmund »

Dann Corbit wrote:
sluijten wrote:How about captures & promotions, what is the maximum number for any position?
You get quite a few from this, which I call "King in a Can"
Move one of the rooks to e8 and you get 4 more moves.
Uri Blass
Posts: 10268
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: max amount of moves from a position?

Post by Uri Blass »

Eelco de Groot wrote:
mcostalba wrote:
Arpad Rusz wrote: The max. number of captures for one side in a legal position (T.Marlow, W.Cross, 1967)

[D]r1n1n1b1/1P1P1P1P/1N1N1N2/2RnQrRq/2pKp3/3BNQbQ/k7/4Bq2 w - - 0 1

(74 white captures)
This position is interesting because is able to blow up your qsearch() !

Try it on your favorite engine ;-)
Position is not ever going to matter in a game so IMO not worthy of repair. We've had a similar discussion in the past with similar position. There are literally millions of positions that need to be addressed first :shock: IMO There was no need to be rude to Uri Marco, because he never means to criticize, this is just Uri.

Anyway I was posting here mainly because think I might have just found a very tiny improvement for the quiescence search by double pass filtering but it is not going to solve this artificial position. Is there any interest from the Stockfish team to try it out because we have to beat the cloud... 8-) Are you all by yourself Marco? Joona has not posted in a while and neither has Tord in the last two weeks...

Eelco
Thanks for your support.

Note that I disagree with the idea that
"Position is not ever going to matter in a game so IMO not worthy of repair."

I think that it is a good idea to care about the worst case
and I believe that the position is only a symptom of a problem that can also happen in some positions of practical games(in less extreme cases) even if in games the qsearch does not explode but only has too many nodes that cause the program to be slower in achieving a big depth.
Dann Corbit
Posts: 12538
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: max amount of moves from a position?

Post by Dann Corbit »

Sure, but I think it would be difficult to generate a lot more promotion choices than that setup.
jwes
Posts: 778
Joined: Sat Jul 01, 2006 7:11 am

Re: max amount of moves from a position?

Post by jwes »

Dann Corbit wrote:Sure, but I think it would be difficult to generate a lot more promotion choices than that setup.
You can certainly add a few.
[D]rnbqqbnr/PPPPPPPP/8/3ppp2/3pkp2/3N1N2/4K3/8 w - - 0 1
JVMerlino
Posts: 1357
Joined: Wed Mar 08, 2006 10:15 pm
Location: San Francisco, California

Re: max amount of moves from a position?

Post by JVMerlino »

jwes wrote:
Dann Corbit wrote:Sure, but I think it would be difficult to generate a lot more promotion choices than that setup.
You can certainly add a few.
[D]rnbqqbnr/PPPPPPPP/8/3ppp2/3pkp2/3N1N2/4K3/8 w - - 0 1
If the goal is to test your move generator, then no problem. If the goal is to try to blow up your search, change the two white Knights to Rooks, as the current position is Mate in 1 (Nf2).

[D]rnbqqbnr/PPPPPPPP/8/3ppp2/3pkp2/3R1R2/4K3/8 w - - 0 1

I let Stockfish think for three minutes (on a very slow machine, relatively) and it still couldn't find mate, although the score is +51.75.

jm