Bad Bishop question

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

MOBMAT
Posts: 385
Joined: Sat Feb 04, 2017 11:57 pm
Location: USA

Bad Bishop question

Post by MOBMAT »

Bad Bishop: If you have one bishop, it is better to have your pawns on squares on the opposition color than that of the lone bishop.

That is how I understand the definition.

Now comes the more complicated part. That definition works best if the opponent doesn't have a bishop, but what if the opponent has one, or even two bishops?

If the opponent has one bishop of the opposite color, then it is a win/win to have more pawns on the opposite color of our bishop since that interferes with the opponents bishop.

But what if the opponent has 2 bishops? now we have the decision about which is best, helping our self, which indirectly helps the opponent, or is it a wash since we can't help our self without helping the opponent. and what if we have the two bishops and the opponent has only one. should be try to punish the opponent, which hurts one of our bishops, but really helps the remaining one?

the third option is what to do if both sides have one bishop, both on the same color. that is it a very direct situation of helping us, helps them.

there are a lot of what ifs. I haven't seen a good write up on this, but i'm sure there must be one out there somewhere.
i7-6700K @ 4.00Ghz 32Gb, Win 10 Home, EGTBs on PCI SSD
Benchmark: Stockfish15.1 NNUE x64 bmi2 (nps): 1277K
User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

Re: Bad Bishop question

Post by xr_a_y »

I do that, don't know if that's good :

Code: Select all

      // wpws : number of white pawns on white squares
      // wpbs : number of white panws on black squares
      // ...
      // wbw : white player has white bishop
      // wbb : white player has black bishop
      // ...
      // badBishopMalus is < 0
      if (wpws > wpbs && wpws > 3 && wbw) malusBadBishop += Definitions::evalBonus.badBishopMalus;
      if (wpws < wpbs && wpbs > 3 && wbb) malusBadBishop += Definitions::evalBonus.badBishopMalus;
      if (bpws > bpbs && bpws > 3 && bbw) malusBadBishop -= Definitions::evalBonus.badBishopMalus;
      if (bpws < bpbs && bpbs > 3 && bbb) malusBadBishop -= Definitions::evalBonus.badBishopMalus;
It is worth around 30 elo.
MOBMAT
Posts: 385
Joined: Sat Feb 04, 2017 11:57 pm
Location: USA

Re: Bad Bishop question

Post by MOBMAT »

Thanks for your explanation.
Upon further thought, I see two possibilities though.
1. "We" have one bishop, and the goal is to make it easier for it to move around, so we want more of our pawns on the opposite color. we can't control what the opponent does.
2. if we have zero or 2 pawns, then moving around pawns doesn't help our bishops, but, it can punish the opponent's single bishop if we move our pawns to the color it is on, thus restricting it's mobility. Granted, it restricts mobility of one of our bishops, but the gain is in punishing the opponent's single bishop.

I'm not applying a "score" to these conditions, rather I'm collecting features for machine learning. I'll run the math on the two cases to see if they have a different worth and report back on this thread.
i7-6700K @ 4.00Ghz 32Gb, Win 10 Home, EGTBs on PCI SSD
Benchmark: Stockfish15.1 NNUE x64 bmi2 (nps): 1277K
MOBMAT
Posts: 385
Joined: Sat Feb 04, 2017 11:57 pm
Location: USA

Re: Bad Bishop question

Post by MOBMAT »

1. "We" have one bishop, and the goal is to make it easier for it to move around, so we want more of our pawns on the opposite color. we can't control what the opponent does.
2. if we have zero or 2 pawns, then moving around pawns doesn't help our bishops, but, it can punish the opponent's single bishop if we move our pawns to the color it is on, thus restricting it's mobility. Granted, it restricts mobility of one of our bishops, but the gain is in punishing the opponent's single bishop.
I ran a test for both 1. and 2. using about 1.5M positions with 27-29 pieces remaining.
the data was the difference between the number of pawns, corrected for the color of the single bishop. so, if we had a lone bishop on a dark square, the difference would be (white pawn count - black pawn count) of our own pawns.
of course this process is done for both white and black and THAT difference is the one that is used.

1. regression (50+ features) gave a value of 3cp. this value would be multiplied by the difference between w/b counts.
2. this one appears to be a wash, with a value of .3cp.

I made another run with 13-15 pieces remaining and the results were very close.

so, the moral of the story is, not all ideas pan out! i'l keep #1 and probably toss #2 since the logic to test for it is more complicated. I'm guessing that #2's value near zero is partially because even though we are punishing the opponent, we are also tilting the balance of our pawns which is going to hurt one of our bishops.

no idea what ELO change this represents since my overall code isn't stable enough to endure that kind of rigorous testing.

has anyone else seen similar results?
i7-6700K @ 4.00Ghz 32Gb, Win 10 Home, EGTBs on PCI SSD
Benchmark: Stockfish15.1 NNUE x64 bmi2 (nps): 1277K