Outposts not producing any improvement

Discussion of chess software programming and technical issues.

Moderator: Ras

jmcd
Posts: 58
Joined: Wed Mar 18, 2020 10:00 pm
Full name: Jonathan McDermid

Outposts not producing any improvement

Post by jmcd »

I've tried to add outposts in my evaluation a few times, but have never managed to get it to work. I've tried all the tests I can, and looked at all the definitions of outposts that I can find and it seems to me like my implementation is correct. Despite that, I am not gaining any strength from adding outposts. Can anybody spot where I've gone wrong?

these are the tuned values I get for outposts (knight, bishop) (middlegame, endgame). they seem to be reasonable values.

Code: Select all

        Score outpost_bonus[2] = { Score(25, 5), Score(28, 0), };
this is how the bonus is applied

Code: Select all

			if (pt == KNIGHT || pt == BISHOP)
                        {
                            if (outpost(pos.piece_bitboard[make_piece(PAWN, them)], pos.piece_bitboard[make_piece(PAWN, us)], sq, us))
                                score[us] += outpost_bonus[pt % KNIGHT];
                        }
this is the function for determining whether or not a piece is on an outpost square. it checks for protecting pawns by using the other teams pawn attacks for whatever square the bishop/knight is occupying, and uses the passed pawn masks for determining if there are any enemy pawns that can attack.

Code: Select all

	// outpost stockfish description:
        // Outpost[knight/bishop] contains bonuses for each knight or bishop occupying a
        // pawn protected square on rank 4 to 6 which is also safe from a pawn attack.

        //this is an old attempt at knight outpost conditions that did not produce an improvement
        bool outpost(Bitboard enemy_pawns, Bitboard friendly_pawns, Square sq, Colour side) {
            return (pawn_attacks[other_side(side)][sq] & friendly_pawns) && (outpost_masks[side] & sq) && !(enemy_pawns & passed_masks[side][sq]);
        }
this is the bitboard for outpost_masks[WHITE]

edit: it looks like the posts are formatted to trim repeating spaces, so these are a bit difficult to read. still it should be rather clear what they are.

+---+---+---+---+---+---+---+---+
| | | | | | | | |8
+---+---+---+---+---+---+---+---+
| | | | | | | | |7
+---+---+---+---+---+---+---+---+
| X | X | X | X | X | X | X | X |6
+---+---+---+---+---+---+---+---+
| X | X | X | X | X | X | X | X |5
+---+---+---+---+---+---+---+---+
| X | X | X | X | X | X | X | X |4
+---+---+---+---+---+---+---+---+
| | | | | | | | |3
+---+---+---+---+---+---+---+---+
| | | | | | | | |2
+---+---+---+---+---+---+---+---+
| | | | | | | | |1
+---+---+---+---+---+---+---+---+
a b c d e f g h

this is the bitboard for outpost_masks[BLACK]

+---+---+---+---+---+---+---+---+
| | | | | | | | |8
+---+---+---+---+---+---+---+---+
| | | | | | | | |7
+---+---+---+---+---+---+---+---+
| | | | | | | | |6
+---+---+---+---+---+---+---+---+
| X | X | X | X | X | X | X | X |5
+---+---+---+---+---+---+---+---+
| X | X | X | X | X | X | X | X |4
+---+---+---+---+---+---+---+---+
| X | X | X | X | X | X | X | X |3
+---+---+---+---+---+---+---+---+
| | | | | | | | |2
+---+---+---+---+---+---+---+---+
| | | | | | | | |1
+---+---+---+---+---+---+---+---+
a b c d e f g h

this is the bitboard for passed_masks[WHITE][E5]

+---+---+---+---+---+---+---+---+
| | | | X | X | X | | |8
+---+---+---+---+---+---+---+---+
| | | | X | X | X | | |7
+---+---+---+---+---+---+---+---+
| | | | X | X | X | | |6
+---+---+---+---+---+---+---+---+
| | | | | | | | |5
+---+---+---+---+---+---+---+---+
| | | | | | | | |4
+---+---+---+---+---+---+---+---+
| | | | | | | | |3
+---+---+---+---+---+---+---+---+
| | | | | | | | |2
+---+---+---+---+---+---+---+---+
| | | | | | | | |1
+---+---+---+---+---+---+---+---+
a b c d e f g h
Clovis GitHub
jmcd
Posts: 58
Joined: Wed Mar 18, 2020 10:00 pm
Full name: Jonathan McDermid

Re: Outposts not producing any improvement

Post by jmcd »

I should also note that outposts seem to lose about 20 elo for me, and interestingly- black tends to win more games than white. I think this is probably an indication that the bonus is being applied improperly for one of the sides.
Clovis GitHub
jmcd
Posts: 58
Joined: Wed Mar 18, 2020 10:00 pm
Full name: Jonathan McDermid

Re: Outposts not producing any improvement

Post by jmcd »

Ok I think I actually found it. The passed masks I'm using arent exactly right because unlike a passed pawn, it doesnt matter if an enemy pawn is on the same file as the knight/bishop.
Clovis GitHub