bob wrote:There are lots of things that can cause this. You are doing a search, which is a problematic way to look at this. If you flip the board, you alter move ordering since the moves are now generated in a different order thanks to bit board first one / last one operations. If you search moves in different orders, then you will reduce them differently. Giving different results.
First test is to set up the position and use the "score" (or whatever stockfish uses) to display the static score. Then flip the colors and type score again. It ought to be the same except with the sign reversed. Make sure that when you flip the position you also flip the side to move as well.
In the past I know Stockfish (and is some cases Komodo) took shortcuts. I recently wrote code to flip the board around the line between ranks 4 and 5. It converted white to black pieces, adjusted castling rights, hash keys, etc. The I have Komodo run through the eval, first as whatever color was moving, then with the flipped board. It can find evaluation unsymmetries.
One I found was a term that was propagating orthogonal attacks through a pawn. In this case, a pawn on say e4, had a queen on e5, a bishop on e6 and a rook on e7. The code masked off the squares e4, e5, e6, e6 and e8, and confirmed at least one rook or queen was there. The function worked with the position flipped one way, but not the other. Bit scan functions fine the first set bit, but depending on the instruction you use, could find the rook or the queen first. If it finds the rook, then the program did not propagate the attack, because the rook blocked it. With the board flipped, it finds the queen first, and see the attack. Best practice would be to check every possible R/Q behind that pawn, but that takes more time. BTW, I fixed this. But such minor bug fixes rarely amount to many elo.
I do recall something similar in Stockfish at one time. It was a while ago and I do not remember the details. But it is sometimes done to save time, when scoring something more than once is not worth it.