Skip to content

Conversation

@vondele
Copy link
Member

@vondele vondele commented Feb 24, 2020

fixes an error reported earlier as #2404 by @AndyGrant.

MultiPV at root shouldn't write to the TT for later lines, as that is neither the eval nor the bestmove for that position.
Fixing this error doesn't matter for playing games (http://tests.stockfishchess.org/tests/view/5dcdbd810ebc590256324a11).

However, it can lead to wrong mate announcements as reported by @uriblass. In particular the following testcase gives
wrong results for the second search, prior to this patch:

setoption name MultiPV value 2
position fen 5R2/2kB2p1/p2bR3/8/3p1B2/8/PPP5/2K5 b - - 0 49
go depth 40
position fen 2B2R2/3r2p1/p1kbR3/8/3p1B2/8/PPP5/2K5 b - - 8 48
go depth 40

fixes #2561

Only affects MultiPV search.

Bench: 4705960

fixes an error reported earlier as official-stockfish#2404 by @AndyGrant.

MultiPV at root shouldn't write to the TT for later lines, as that is neither the eval nor the bestmove for that position.
Fixing this error doesn't matter for playing games (http://tests.stockfishchess.org/tests/view/5dcdbd810ebc590256324a11).

However, it can lead to wrong mate announcements as reported by @uriblass. In particular the following testcase gives
wrong results for the second search, prior to this patch:

```
setoption name MultiPV value 2
position fen 5R2/2kB2p1/p2bR3/8/3p1B2/8/PPP5/2K5 b - - 0 49
go depth 40
position fen 2B2R2/3r2p1/p1kbR3/8/3p1B2/8/PPP5/2K5 b - - 8 48
go depth 40
```

fixes official-stockfish#2561

Only affects MultiPV search.

Bench: 4705960
@joergoster
Copy link
Contributor

Does this also work reliably with multiple Threads? Different Threads may be searching different PV lines as first pv (pvIdx == 0). No?

@vondele
Copy link
Member Author

vondele commented Feb 25, 2020

@joergoster yes, I think this is fine in the case of threading as well. Even if threads have a different line a first PV, they will not find/store a mate depth that is wrong. The test case is yielding the right results.

@vondele vondele closed this in 2e1369d Feb 25, 2020
joergoster pushed a commit to joergoster/Stockfish that referenced this pull request Sep 11, 2022
fixes an error reported earlier as official-stockfish#2404 by @AndyGrant.

MultiPV at root shouldn't write to the TT for later lines, as that is neither the eval nor the bestmove for that position.
Fixing this error doesn't matter for playing games (http://tests.stockfishchess.org/tests/view/5dcdbd810ebc590256324a11).

However, it can lead to wrong mate announcements as reported by @uriblass. In particular the following testcase gives
wrong results for the second search, prior to this patch:

```
setoption name MultiPV value 2
position fen 5R2/2kB2p1/p2bR3/8/3p1B2/8/PPP5/2K5 b - - 0 49
go depth 40
position fen 2B2R2/3r2p1/p1kbR3/8/3p1B2/8/PPP5/2K5 b - - 8 48
go depth 40
```

fixes official-stockfish#2561
closes official-stockfish#2562

Only affects MultiPV search.

Bench: 4697493
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

more incorrect mates ?

2 participants