I can indeed remember this bug. I really had to write special cases in my
system to handle this.
So... is there an easy fix? And if there is an easy fix -we should be aware
that we will break all the systems that have already worked around this
bug, such that some 3rd party systems will be broken if we fix these. I'm
not sure that's a lot of systems though.
-Øystein
And here is a snippet from my code:
/* Oh! Horrible fixup */
if ( strncmp( buffer, "board:", 6 ) == 0 )
cubedata_fixup_gnubg_external( cd, board_get_turn(board) );
søn. 18. okt. 2026 kl. 17:32 skrev Matthias Hollatz <
[email protected]>:
> Hello,
>
> in the external socket interface (gnubg 1.08.003, also seen with the
> Windows build 1.08.003-mingw), move and cube requests sent as board:
> lines appear to be evaluated with the match score swapped.
>
> In external.c, ExtFIBSBoard() (lines 424–425 and 435–437):
>
> anScore[0] = processedBoard.nScore;
> anScore[1] = processedBoard.nScoreOpp;
> ...
> fTurn = 1;
> SetCubeInfo(&ci, ..., fTurn, processedBoard.nMatchTo, anScore, ...);
>
> With fTurn = 1 the player on roll is index 1, so anScore[1] should be
> the external player’s own score (nScore). The debug branch in the same
> file (lines 727–728) does it that way round:
>
> anScore[0] = processedBoard.nScoreOpp;
> anScore[1] = processedBoard.nScore;
>
> and its Match ID shows the correct score, while the move/cube decision
> uses the opposite one.
>
> Test: I compared board: answers with gnubg’s own hint on the same
> positions with unequal score (0-ply). Cube decisions agreed in 76 of 105
> positions as sent, and in 105 of 105 when I sent the score swapped.
> Moves agreed in 145 of 170 as sent, and in 167 of 170 swapped (the rest
> were equal-equity choices). Take decisions (doubled = 1) were correct in
> 115 of 115, since that path swaps the board with SwapSides(), which
> compensates.
>
> Suggested fix: swap the two assignments in ExtFIBSBoard() for the
> non-doubled case, and keep the doubled (take) case as it is.
> ExtEvaluation() (lines 374–375) uses the same order with fMove = 1, so
> it is probably affected as well. I have not tested it.
>
> Best regards,
> Matthias
>
> --
> Mit freundlichen Grüßen
>
> Matthias
> [email protected]
>
>
>