@MARattigan
Earlier I conjectured that Stockfish might have both a game mode and an analysis mode.
It turns out that's correct. Regardless of what terminology we use.
In the game mode - then it appears that castling will be legal by default - provided the onboard position doesn't disqualify somehow.
But in Contrast - if its in an analysis mode caused by 'clear board' then that's different and it will assign castling as illegal by default !!
Which is a radical step. And should be fixed.
And yes I also conjectured that maybe in such modes - it might actually do some 'work' and find a position 'couldn't get there'.
When playing games it wouldn't do that - (it was stated that would 'lose')
but that wouldn't happen anyway - since its got a record of the game and the game positions are generated move by move anyway.
Anyway - 'game mode' castling okay maybe - but in clear board mode - No.
Chess will never be solved, here's why


@Elroch
The FEN code tells Stockfish whether castling is legal or not -
but that doesn't determine how it gets that way in the first place.
REPEAT
You know how it got that way: you setup the position from an empty board and the software assumed castling was illegal.
I didn't say I didn't know how it got there.
Its like saying you know whether it rained yesterday so you must be right about the weather on Mars.
Castling being illegal because of 'clear board' came Later.
Got it yet? Need more repetitions?
Stop worrying about what was said. Its 'poorly motivated'.

For some reason playerafar still doesn't know whether tygxc's position is legal. Here's a proof game which demonstrates that it's legal.

@playerafar, if you start from the initial position in a game, or when analysing a game, it will infer castling rights at every move.
If you start a game or an analysis from a non-standard position, it will take the castling rights from the initial position and infer thereafter.

s
For some reason playerafar still doesn't know whether tygxc's position is legal. Here's a proof game which demonstrates that it's legal.
s
I didn't say I didn't trust that you've found it to be legal.
Your post about your game came about the same time I was remarking on the position to @tygxc.
And I found there has to have been at least one promotion which means there couldn't have been five captures of pawns.
No need to worry about the precise timing of posts.
Progress is made nonetheless.

@playerafar, if you start from the initial position in a game, or when analysing a game, it will infer castling rights at every move.
If you start a game or an analysis from a non-standard position, it will take the castling rights from the initial position and infer thereafter.
The first point looks obvious.
The second point might represent some more progress.
But looks kind of obvious too.
The main point here - Was (emphasize past tense) was that it was not brought out right away that 'clear board' eliminates castling by default.
Was. Not stated.
How many times does that have to be repeated?
More progress would become possible if we now discuss 'should'.
We can't control what the site management does.
But 'should' castling be illegal by default - after using the 'clear board' feature.
I say no. It should not be. It should be more user friendly than that.
Anybody care to venture an opinion on that - instead of going back over the precise timing of posts ?
#1690
This is conclusive proof that this position without excess promotions is indeed legal.
It is also conclusive proof, that this position without excess promotions cannot result from a reasonable game with reasonable moves and thus not from an ideal game with optimal moves.
Here is another one from the 10,000 samples without excess promotions:
Legal?
Proof game?

@n9531l1
And the game you posted has the promotion that I said must be there.
Only one it seems.
And it also seems that game illustrates something @tygxc has often mentioned.
'reasonable' moves.
Many moves in that game are not 'reasonable'.
Yes I know - its only meant to be a 'proof of legality' game.

@tygxc - I forgot what you meant by 'excess' underpromotions.
Or 'excess' promotions.
Could you please post those again and I'll post in my home page notes?
@MARattigan
Earlier I conjectured that Stockfish might have both a game mode and an analysis mode.
It turns out that's correct. Regardless of what terminology we use.
...
I didn't say that's correct.
So far as I understand the function, when you say you're playing SF you're actually playing the GUI. The GUI asks SF to analyse the position following one of your moves and at some later time asks SF for a best move according to it's analysis. That is the move the GUI plays against you.
#1696
excess promotion = promotion to a piece not yet captured = promotion to a piece that must be borrowed from another box of 32 chess men
underpromotion = promotion to another piece than a queen = promotion to R, B, or N

@MARattigan
from your post:
"I didn't say that's correct."
I'm saying it is. It is correct. Regardless of semantics.
Whether its argued that its 'SF' or 'GUI plus SF' or 'GUI plus SF plus FEN/Pgn code'.
However you 'slice it'.
It may be and probably is good to know about these distinctions though !
And - we could have a side-discussion about 'computer buzz-language' too.
Like 'API'. or Distributed Link Transaction Coordinator service in Windows.
That's one of the windows services I haven't figured out yet !
But - may be too removed from the forum topic.
There's also the Immortal 'Delete Browser Cache' ... which yes - can mean different things.

#1696
excess promotion = promotion to a piece not yet captured = promotion to a piece that must be borrowed from another box of 32 chess men
underpromotion = promotion to another piece than a queen = promotion to R, B, or N
Okay - I'll paste the first half of that to my notes.
We could discuss that further too.
Why the word 'excess' refers to more physical chess pieces needed.
Because it isn't a true 'excess'.
Its rather arbitrary. A promotion is 'excess' because you're not replacing a piece that was lost? That has little pertinence to 'reasonablness of move'.
But that's okay.
Apparently they wanted some way to classify promotions.
Maybe a much better way of defining 'excess' could be devised.
@MARattigan
from your post:
"I didn't say that's correct."
I'm saying it is. It is correct. Regardless of semantics.
Well, sorry, I don't think you're correct when you say it's correct, at any rate, not if you're using the UCI interface. I think SF always works in analysis mode.
#1700
3.7.5.1
When a player, having the move, plays a pawn to the rank furthest from its starting position, he must exchange that pawn as part of the same move for a new queen, rook, bishop or knight of the same colour on the intended square of arrival. This is called the square of ‘promotion’.
3.7.5.2
The player's choice is not restricted to pieces that have been captured previously.
https://handbook.fide.com/chapter/E012018
Excess promotion = promotion to a piece not captured previously

#1700
3.7.5.1
When a player, having the move, plays a pawn to the rank furthest from its starting position, he must exchange that pawn as part of the same move for a new queen, rook, bishop or knight of the same colour on the intended square of arrival. This is called the square of ‘promotion’.
3.7.5.2
The player's choice is not restricted to pieces that have been captured previously.
https://handbook.fide.com/chapter/E012018
Excess promotion = promotion to a piece not captured previously
Yes - that's all obvious.
But a better terminology could be devised.
The actual rationale for 'excess' could be -
any position in which at least one side has more of a certain piece type than players do in the initial opening position of all chess games.
Two queens or three knights or whatever -
Note that 'excess' as it is now - would not cover two bishops for one side moving on the same color squares.
Two queens for one side - by the way - comes up a lot.
Usually the game doesn't go on for a long time - but it does come up.
Two Queens each - that happens too.
Again it doesn't usually last long - but it could.
#1703
Yes, that is right.
As said there is an upper bound of 4*10^37 positions without excess promotions.
There would be less than 2*10^38 positions with 3 queens.
There would be less than 5*10^38 positions with 4 queens.
That gives a total of less than 7*10^38 positions without excess promotions, or with 3 queens, or with 4 queens.
The question remains how many of these can be reached by a reasonable game with reasonable moves.
Tromp has conjectured that only 1 in 10^6 could be reached by a reasonable game with reasonable moves.
That would leave at most 7*10^32 positions.
If 1% of the 10,000 sampled positions without excess promotions could be reached by a reasonable game with reasonable moves, then that would lead to 7*10^36 positions.
Hence 10^36 positions is plausible.

@MARattigan
from your post:
"I didn't say that's correct."
I'm saying it is. It is correct. Regardless of semantics.
Well, sorry, I don't think you're correct when you say it's correct, at any rate, not if you're using the UCI interface. I think SF always works in analysis mode.
That's okay. Absolutely no need to apologize. Especially not on that !
There's different ways to get to 'analysis' on this website.
However you get there - it seems that if its in 'game mode' (regardless of what they actually call it or what its called) - then castling is preserved -
but if the 'clear board' function is used (and therefore or thereby its not 'game mode') then castling will be 'illegal by default'. Apparently.
If its not actually that way - or if there's more 'qualifications' to be made on that - then maybe those will come out. Whether in this forum or elsewhere.
Should it be that way ? No. Is what I say.
Should they modify that and make the various routes to 'setup position' and the chessboard button in these 'editors' perform in a more user-friendly way?
Yes !
But that's an opinion based on both experience and a lot of observation.
As for the programming 'vicissitudes' of that - I'm not claiming to know.
I can almost see the 'screaming' if somebody misunderstood !
"Hey !! We've been doing this chess programming for Years !
We know all about it !! Don't tell us we're not doing it well enough !"
But - that's not how things actually work out.
The owner of the site has often acted on suggestions to improve the features on the site.
Whether they come in as suggestions or bug reports or whatever.
And to do that right - people on Dev teams improve and do whatever they were doing 'better'. Often starts with the Customer.
We're the Customers.

@playerafar, if you start from the initial position in a game, or when analysing a game, it will infer castling rights at every move.
If you start a game or an analysis from a non-standard position, it will take the castling rights from the initial position and infer thereafter.
The first point looks obvious.
The second point might represent some more progress.
But looks kind of obvious too.
The main point here - Was (emphasize past tense) was that it was not brought out right away that 'clear board' eliminates castling by default.
Yes. While I might guess that a position constructed from a blank board would have no castling rights, it was necessary to apply the scientific method and determine this empirically. From observation, it seems that Stockfish analyses a position essentially identically to when it is playing, except for the termination criterion. This is as I would expect.
@Elroch
The FEN code tells Stockfish whether castling is legal or not -
but that doesn't determine how it gets that way in the first place.
REPEAT
You know how it got that way: you setup the position from an empty board and the software assumed castling was illegal.