Stockfish 1.9 code - evaluation

Discussion of chess software programming and technical issues.

Moderator: Ras

lech
Posts: 1169
Joined: Sun Feb 14, 2010 10:02 pm

Re: Stockfish 1.9 code - evaluation

Post by lech »

mcostalba wrote:
lech wrote:
mcostalba wrote: The correct solution (no hacks!)
:wink:
I understand that you reject possibility to add a level (e.g. Phase(64))
and Stockfish will be test opposite bishops on such a high level of material. :?
How to name it? Speculation? :lol:
No, this is a good idea and I will test it.

What I don't plan to do is to move opposite bishops evaluation from evaluate() to material.
I think that there is a possibility to solve the problem of opposite colored bishops.
These bishops are danger when there is a potential material to attack kings, thus, in this case,
a decreased factor should not be applied.
Stockfish knows and applies such a specific material:
count of Q > 0 and non-pawn material >= Q + R middle game value.
It gives possibility to check (in the main material function) a basic part of conditions of opposite colored bishops.
It means:
count of bishops = 1 and not (count of Q > 0 and non-pawn material >= Q + R middle game value) for both sides.
There is a good possibility to return it (if true) by new factor (e.g.): POSSIBLE_OPPOSITE_COLORED_BISHOPS = 254.
This factor can be quickly tested (in the main evaluation function) directly without any phase and time-consuming function.
This leaves (only if true) one logical condition to test:
whether is true one of: evaluated bishop attacks and white squares for both sides.
If not, to set the factor value to default.
Maybe, it is not a nice solution :( but it can give an unquestionable profit :D .
Am I sure?