Skip to content

MultiPV support - #418

Merged
TheRealGioviok merged 4 commits into
official-clockwork:mainfrom
Ciekce:multipv
Jul 21, 2026
Merged

MultiPV support#418
TheRealGioviok merged 4 commits into
official-clockwork:mainfrom
Ciekce:multipv

Conversation

@Ciekce

@Ciekce Ciekce commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Design essentially ported from Stormphrax. Behaviour matches SP's exactly (barring any bugs I've missed).

Marked as draft because no test has been run, and there are implementation decisions from SP that I am unsure are wanted in CW:

  • when the UCI option MultiPV is set to 1 (i.e. multipv disabled), the multipv N output in info strings is suppressed
  • In the (ideally impossible) scenario that a root move could not be found, std::terminate() is called
Test  | multipv
Elo   | -1.43 +- 1.12 (95%)
SPRT  | 8.0+0.08s Threads=1 Hash=16MB
LLR   | -2.97 (-2.94, 2.94) [-3.00, 0.00]
Games | N: 123120 W: 31899 L: 32404 D: 58817
Penta | [1485, 14854, 29314, 14495, 1412]

https://ob.cwchess.org/test/1528/

Almost all the machinery for a future working TB implementation is also present. The root move implementation allows for some other cleanup (notably moving node counts from the enormous table into root moves), but that is out of the scope of this PR. "Verbose MultiPV" as I call it (printing info lines after every single PV is searched, after a delay) is also omitted, as it requires some somewhat involved refactoring of how/when info lines are printed.

A side effect of this implementation is that partial depths are now accepted (safely) if search stops mid-iteration.

Ciekce added 4 commits July 19, 2026 12:41
Bench: 12898941
Bench: 12898941
@TheRealGioviok

Copy link
Copy Markdown
Contributor
* when the UCI option `MultiPV` is set to 1 (i.e. multipv disabled), the `multipv N` output in info strings is suppressed

* In the (ideally impossible) scenario that a root move could not be found, `std::terminate()` is called

lgtm, first one probably good to avoid problems with some guis

@Ciekce
Ciekce marked this pull request as ready for review July 21, 2026 19:29
@Aethdv

Aethdv commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

lgtm

@TheRealGioviok
TheRealGioviok merged commit 58213c2 into official-clockwork:main Jul 21, 2026
28 checks passed
@Ciekce
Ciekce deleted the multipv branch July 21, 2026 21:40
@Ciekce Ciekce mentioned this pull request Aug 6, 2026
TheRealGioviok pushed a commit that referenced this pull request Aug 6, 2026
Implemented syzygy tablebase support via Pyrrhic.

Implementation is essentially ported (as with #418) from stormphrax, complete with correct multipv handling and handling for repetition edge cases.

Bitboard attacks with sliders based on jw's implementation in [akimbo](https://github.com/jw1912/akimbo) are also included. This will need to be adressed to reclaim some speed.
The need of inclusion of pyrrhic wholly in the vendor folder (rather than a lazy download when building) is due to the problem with importing the bb attacks headers (which we purposefully left in the main repository, so that we might use them in eval in the future).

Also identified a TODO in uci.cpp, as SyzygyPath currently does not accept values with spaces

Passed STC with 6-Man:
```
Test  | tb
Elo   | 16.62 +- 5.82 (95%)
SPRT  | 8.0+0.08s Threads=1 Hash=16MB
LLR   | 2.97 (-2.94, 2.94) [0.00, 3.00]
Games | N: 4226 W: 1217 L: 1015 D: 1994
Penta | [32, 404, 1063, 558, 56]
```
https://ob.cwchess.org/test/1551/

Passed LTC with 6-Man:
```
Test  | tb
Elo   | 18.18 +- 5.70 (95%)
SPRT  | 40.0+0.40s Threads=1 Hash=64MB
LLR   | 2.96 (-2.94, 2.94) [0.00, 3.00]
Games | N: 3366 W: 896 L: 720 D: 1750
Penta | [12, 263, 961, 431, 16]
```
https://ob.cwchess.org/test/1552/

Bench: 13841007
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.

3 participants