Stockfish mate 1

It seems stockfish gets from depth 127 before the beta update to depth 245 now just from calculating mate in 1, it just takes too much time, why didnt it just stop at depth 1 knowing its mate 1 already. see the pic below it calculated the same move from depth 1.

Greetings! That’s a good question. Part of that I’d need to ask the Stockfish team (“Why doesn’t Stockfish simply stop early when it finds a mate-in-1?”) NCM tells Stockfish explicitly to calcluate for however many seconds you set (e.g., “go movetime 15000”) so I’m guessing Stockfish has it’s reasons to be true to that. But I’m curious what exactly it’s doing during that time.

But there shouldn’t be any difference between the old site and the beta with respect to calculations. They both use the exact same backend servers. The both use basically the exact same code exception for minor differences to support Multi-PV. So there should be no differences in depth reached.

Can you let me know which position you were calculating for and I’ll try and figure out what’s going on?

I didn’t saved the position but it always does that in every mate 1, you can check even with the fool’s mate, same move from depth 1 to depth 245, move time is set to 1sec.

PGN: 1. f4 e6 2. g4 Qh4#

Interestingly enabling multi-pv returns the calculated moves at exactly the move time showing the best move as mate 1.

Aye! Yes. I think I figured a few things out:

When MultiPV=1, the engine output is showing “time” as 8ms, so it looks like Stockfish is indeed returning the mate-in-one nearly instantly. I think that delay you’re seeing is the result of NCM sending the depth+nps for each line to the browser individually. That’s got to be the bottleneck. We can fix that!

And, when MultiPV=2 or more, Stockfish needs to legitimately calculate the second-best PV, so I bet that’s why it’s executing for the full search time.

And then for depth 127 vs depth 245, it looks like, for the PGN you supplied, Stockfish 10 is calculating out to 127, and the latest dev build is calculating out to 245 regardless of beta site vs old site. So I think that’s the difference.

So I think the takeaway here is that we need to be smarter about sending out the real-time depth/nps stats because there can be a lot of them in a very short amount of time in the case of a mate-in-1. (And probably other conditions too.)

Thank you for reporting this, and I’ll make sure NCM doesn’t become the bottleneck in these situations so the result comes back to the browser ASAP!

1 Like