Mate in 24

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

Jouni
Posts: 3612
Joined: Wed Mar 08, 2006 8:15 pm
Full name: Jouni Uski

Re: Mate in 24

Post by Jouni »

Or not :) . This is fixed nodes. NNUE gets 2,5x more time!
Jouni
User avatar
RubiChess
Posts: 639
Joined: Fri Mar 30, 2018 7:20 am
Full name: Andreas Matthies

Re: Mate in 24

Post by RubiChess »

Uri Blass wrote: Thu Nov 23, 2023 11:16 am again this stupid thing use more time for other moves only after failing high on the right move and I do not understand the logic behind this behaviour of stockfish.

...
107/4 00:09 8,630k 951k 0.00 Kb6xb5+ Kg1-g2 Kb5-a6
108/29+ 00:42 42,797k 998k +0.03 Kb6xb5+
108/29 32:19 1,937,224k 999k +M13 Kb6xb5+ Kg1-g2 Kb5-c5 Kg2-g1 Kc5xc4+ Kg1-g2 Kc4-d4 Kg2-g1 Kd4-d3+ Kg1-g2 Kd3-e3 Kg2-g1 Ke3-e2+ Kg1-g2 Rf6-b6 Kg2-g1 Rb6-d6+ Kg1-g2 Rd6-d4 Kg2-g1 Rd4-d3+ Kg1-g2 Rd3-e3 Kg2-g1 Re3xg3+
Why do you think "this stupid thing" spends a single node "for other moves"?
It seems to me that you haven't understood how alpha-beta works or how to read the output of an engine.

Regards, Andreas
Uri Blass
Posts: 10771
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: Mate in 24

Post by Uri Blass »

RubiChess wrote: Thu Nov 23, 2023 8:48 pm
Uri Blass wrote: Thu Nov 23, 2023 11:16 am again this stupid thing use more time for other moves only after failing high on the right move and I do not understand the logic behind this behaviour of stockfish.

...
107/4 00:09 8,630k 951k 0.00 Kb6xb5+ Kg1-g2 Kb5-a6
108/29+ 00:42 42,797k 998k +0.03 Kb6xb5+
108/29 32:19 1,937,224k 999k +M13 Kb6xb5+ Kg1-g2 Kb5-c5 Kg2-g1 Kc5xc4+ Kg1-g2 Kc4-d4 Kg2-g1 Kd4-d3+ Kg1-g2 Kd3-e3 Kg2-g1 Ke3-e2+ Kg1-g2 Rf6-b6 Kg2-g1 Rb6-d6+ Kg1-g2 Rd6-d4 Kg2-g1 Rd4-d3+ Kg1-g2 Rd3-e3 Kg2-g1 Re3xg3+
Why do you think "this stupid thing" spends a single node "for other moves"?
It seems to me that you haven't understood how alpha-beta works or how to read the output of an engine.

Regards, Andreas
The strange thing is not using time for other moves but almost not using time for other moves when the evaluation was 0.00 and suddenly using a lot of time for other moves when the evaluation goes up to 0.03

Having a big branching factor after fail low is a normal behaviour of engines based on my experience with chess engines.
Having a big branching factor after fail high only because of considering other moves is not a normal behaviour of engines(and I can see the move that stockfish considers during the analysis in the interface because stockfish gives this output).
User avatar
RubiChess
Posts: 639
Joined: Fri Mar 30, 2018 7:20 am
Full name: Andreas Matthies

Re: Mate in 24

Post by RubiChess »

Uri Blass wrote: Thu Nov 23, 2023 10:42 pm
RubiChess wrote: Thu Nov 23, 2023 8:48 pm
Uri Blass wrote: Thu Nov 23, 2023 11:16 am again this stupid thing use more time for other moves only after failing high on the right move and I do not understand the logic behind this behaviour of stockfish.

...
107/4 00:09 8,630k 951k 0.00 Kb6xb5+ Kg1-g2 Kb5-a6
108/29+ 00:42 42,797k 998k +0.03 Kb6xb5+
108/29 32:19 1,937,224k 999k +M13 Kb6xb5+ Kg1-g2 Kb5-c5 Kg2-g1 Kc5xc4+ Kg1-g2 Kc4-d4 Kg2-g1 Kd4-d3+ Kg1-g2 Kd3-e3 Kg2-g1 Ke3-e2+ Kg1-g2 Rf6-b6 Kg2-g1 Rb6-d6+ Kg1-g2 Rd6-d4 Kg2-g1 Rd4-d3+ Kg1-g2 Rd3-e3 Kg2-g1 Re3xg3+
Why do you think "this stupid thing" spends a single node "for other moves"?
It seems to me that you haven't understood how alpha-beta works or how to read the output of an engine.

Regards, Andreas
The strange thing is not using time for other moves but almost not using time for other moves when the evaluation was 0.00 and suddenly using a lot of time for other moves when the evaluation goes up to 0.03

Having a big branching factor after fail low is a normal behaviour of engines based on my experience with chess engines.
Having a big branching factor after fail high only because of considering other moves is not a normal behaviour of engines(and I can see the move that stockfish considers during the analysis in the interface because stockfish gives this output).
Again: It doesn't use a single node for other moves (other than Kb6xb5+ to make it precise). Prove me wrong. Have you seen a single currmovenumber 2 or higher? My own tests don't show a single currmovenumber 2 when fail high kicks in.
Spending lots of time at (this) fail high can have a lot of reasons, one reason may be an almost empty TT at this time because seldepth was 4 in depth 107 but is has nothing to do with "spending time on other moves".
And a branching factor usually isn't calculated for a single iteration but for many thousands of games/moves/iterations at least.
And again: SF isn't made for finding best mate in best time, it is made for winning games. Just use a different engine if you are interested in finding mates.

Regards, Andreas
Uri Blass
Posts: 10771
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: Mate in 24

Post by Uri Blass »

RubiChess wrote: Fri Nov 24, 2023 6:33 am
Uri Blass wrote: Thu Nov 23, 2023 10:42 pm
RubiChess wrote: Thu Nov 23, 2023 8:48 pm
Uri Blass wrote: Thu Nov 23, 2023 11:16 am again this stupid thing use more time for other moves only after failing high on the right move and I do not understand the logic behind this behaviour of stockfish.

...
107/4 00:09 8,630k 951k 0.00 Kb6xb5+ Kg1-g2 Kb5-a6
108/29+ 00:42 42,797k 998k +0.03 Kb6xb5+
108/29 32:19 1,937,224k 999k +M13 Kb6xb5+ Kg1-g2 Kb5-c5 Kg2-g1 Kc5xc4+ Kg1-g2 Kc4-d4 Kg2-g1 Kd4-d3+ Kg1-g2 Kd3-e3 Kg2-g1 Ke3-e2+ Kg1-g2 Rf6-b6 Kg2-g1 Rb6-d6+ Kg1-g2 Rd6-d4 Kg2-g1 Rd4-d3+ Kg1-g2 Rd3-e3 Kg2-g1 Re3xg3+
Why do you think "this stupid thing" spends a single node "for other moves"?
It seems to me that you haven't understood how alpha-beta works or how to read the output of an engine.

Regards, Andreas
The strange thing is not using time for other moves but almost not using time for other moves when the evaluation was 0.00 and suddenly using a lot of time for other moves when the evaluation goes up to 0.03

Having a big branching factor after fail low is a normal behaviour of engines based on my experience with chess engines.
Having a big branching factor after fail high only because of considering other moves is not a normal behaviour of engines(and I can see the move that stockfish considers during the analysis in the interface because stockfish gives this output).
Again: It doesn't use a single node for other moves (other than Kb6xb5+ to make it precise). Why do you think so?
Spending lots of time at (this) fail high can have a lot of reasons, one reason may be an almost empty TT at this time because seldepth was 4 in depth 107 but is has nothing to do with "spending time on other moves".
And a branching factor usually isn't calculated for a single iteration but for many thousands of games/moves/iterations at least.
And again: SF isn't made for finding best mate in best time, it is made for winning games. Just use a different engine if you are interested in finding mates.

Regards, Andreas
I did not expect stockfish to use a single node for other moves.

The problem is that stockfish used less than 42 seconds for all moves at the first 107 iterations and when it failed high at iteration 108(that I expect to encourage pruning other moves it suddenly use more than 30 minutes for other moves at iteration 108.

Spending a lot of time to solve the fail high at iteration 108 is normal but this is not what happened.
Stockfish spent a lot of time to search other moves and not to solve the fail high.
User avatar
RubiChess
Posts: 639
Joined: Fri Mar 30, 2018 7:20 am
Full name: Andreas Matthies

Re: Mate in 24

Post by RubiChess »

I must admit that after updating my local SF to latest master (used a version 202309... before) I also see these "other moves".
So ... @Uri: Sorry for not believing what you posted.
SF lowered the depth, going back to depth 117 after fail high happened at depth 118.
This lowering the depth after a fail high is in SF for a long time, it was proven to gain Elo. And this is probably the reason why we see all moves again.

Regards, Andreas
Uri Blass
Posts: 10771
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: Mate in 24

Post by Uri Blass »

RubiChess wrote: Fri Nov 24, 2023 7:01 am I must admit that after updating my local SF to latest master (used a version 202309... before) I also see these "other moves".
So ... @Uri: Sorry for not believing what you posted.
SF lowered the depth, going back to depth 117 after fail high happened at depth 118.
This lowering the depth after a fail high is in SF for a long time, it was proven to gain Elo. And this is probably the reason why we see all moves again.

Regards, Andreas
The question is why lowering the depth can cause stockfish to use a lot of time for other moves.
lowering the depth after fail high is logical but in this case it is logical also not to search other moves in the iteration you lowered the depth.

I tried stockfish again with the following setting(so other can reproduce my results):
1)using 4096 mbytes hash no tablebases.
2)copying the following game
[Event "Computer chess game"]
[Site "DESKTOP-7QE6S12"]
[Date "2023.11.24"]
[Round "?"]
[White "àåøé"]
[Black "Stockfish_23112018_x64_avx2"]
[Result "*"]
[BlackElo "2000"]
[Time "08:10:59"]
[WhiteElo "2000"]
[TimeControl "300+10"]
[SetUp "1"]
[FEN "8/8/p2B1R2/Pp2K3/1Pp3pp/2P3pq/4P1kp/7b w - - 0 1"]
[Termination "unterminated"]
[PlyCount "22"]
[WhiteType "program"]
[BlackType "human"]

1. Bb8 Kg1 2. Ba7+ Kg2 3. e3 Kg1 4. e4+ Kg2 5. Kd4 Kg1 6. Kd5+ Kg2 7. Kc5
Kg1 8. Kc6+ Kg2 9. Kb6 Kg1 10. Kxa6+ Kg2 11. Kb6 Kg1 *

3)analyzing the position after 11...Kg1

a)I found that stockfish considered 12.Kxb5 in the first 10 minutes but started to analyze other moves later(and because the iteration needed more than 30 minutes it means that stockfish spent more than 20 minutes on other moves.

b)I made the move Kxb5 as soon as I saw stockfish started to analyze other moves and stockfish saw immediatly a mate score so I suspect stockfish already had a mate score when I analyzed other moves but the arena interface did not show me the mate score.
Uri Blass
Posts: 10771
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: Mate in 24

Post by Uri Blass »

I suspect maybe stockfish stop pruning after seeing mate score and it is the reason for what I see

Here is the analysis after making Kxb5 as soon as stockfish started to consider other moves.
I am not sure if it is a bug in arena or a bug in stockfish but arena did not show me mate score before I made Kxb5 on the board.

FEN: 8/B7/5R2/PK6/1Pp1P1pp/2P3pq/7p/6kb b - - 0 12

Stockfish_23112018_x64_avx2:
NNUE evaluation using nn-0000000000a0.nnue
1/1 00:00 1 1k -M12 Kg1-g2
2/2 00:00 4 4k -M12 Kg1-g2 Kb5-c5
3/3 00:00 9 9k -M12 Kg1-g2 Kb5-c5 Kg2-g1
4/4 00:00 14 14k -M12 Kg1-g2 Kb5-c5 Kg2-g1 Kc5xc4+ Kg1-g2
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kg2-g1
21/24 00:00 518 259k -M12 Kg1-g2 Kb5-c5 Kg2-g1 Kc5xc4+ Kg1-g2 Kc4-d4 Kg2-g1 Kd4-d3+ Kg1-g2 Kd3-e3 Kg2-g1 Ke3-e2+ Kg1-g2 Rf6-b6 Kg2-g1 Rb6-d6+ Kg1-g2 Rd6-d4 Kg2-g1 Rd4-d3+ Kg1-g2 Rd3-e3 Kg2-g1 Re3xg3+
22/25 00:00 582 291k -M12 Kg1-g2 Kb5-c5 Kg2-g1 Kc5xc4+ Kg1-g2 Kc4-d4 Kg2-g1 Kd4-d3+ Kg1-g2 Kd3-e3 Kg2-g1 Ke3-e2+ Kg1-g2 Rf6-b6 Kg2-g1 Rb6-d6+ Kg1-g2 Rd6-d4 Kg2-g1 Rd4-d3+ Kg1-g2 Rd3-e3 Kg2-g1 Re3xg3+
Uri Blass
Posts: 10771
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: Mate in 24

Post by Uri Blass »

I want to make clear one point.

I wrote:

"lowering the depth after fail high is logical but in this case it is logical also not to search other moves in the iteration you lowered the depth. "

I mean not searching other moves unless you have a fail low.

The logic is that if you know at iteration 107 that other moves are not better than a draw and you lower the depth at iteration 108 then you can prune by hash tables unless you have a fail low and the score of the pv move is worse than a draw.