Sting SF is to help detect, impossible to find or time consuming for engines, sacrifices.
Unfortunately, but just Stockfish is very weak to find difficult sacrifices and thus is not a good tool to make any analysis.
Sting SF project should very help you to get a reliable result in analysis.
Sting SF uses the option : “Sacrifice detection” (0 – 8, 8 = default, 0 = disabled).
BTW. I tested a strength (Sacrifice detection = 8). Sting seems to be stronger than Stockfish.
I ask Jim Ablett to compile my project and to make it available for all (thanks in advance!):
www.free.of.pl/c/ccintorun/g/sting.rar
The difference in the code - my idea - is below:
Code: Select all
// Step extra (after step 7) - detection of good sacrifices.
if ( depth >= 8 * ONE_PLY
&& SacrificeDetection // default option = 8
&& !ss->skipSacrificeDetection
&& pos.captured_piece_type() != PIECE_TYPE_NONE
&& !Root
&& beta < VALUE_KNOWN_WIN)
{
Value q;
if ((ss-1)->captureValue != VALUE_NONE) q = -(ss-1)->captureValue;
else if (tte && tte->depth() >= 8 * ONE_PLY) q = ss->eval;
else q = ss->eval = qsearch<PV>(pos, ss, -VALUE_INFINITE, VALUE_INFINITE, DEPTH_ZERO));
TT.store(posKey, VALUE_NONE, VALUE_TYPE_NONE, DEPTH_NONE, ttMove, ss->eval, ss->evalMargin);
Depth d = depth - depth/10;
int i = 0;
Value step = PawnValueMidgame / SacrificeDetection;
Value v = q;
while (true)
{
ss->captureValue = v;
Value rAlpha = Min(alpha, v + step);
if (rAlpha == alpha && d <= depth) break;
if (d >= depth + depth/10) rAlpha = alpha;
Value rBeta = rAlpha == alpha ? beta : rAlpha + 1;
ss->skipSacrificeDetection = true;
v = search<PvNode>(pos, ss, rAlpha, rBeta, d);
ss->skipSacrificeDetection = false;
i++;
if (v > rAlpha && d >= depth)
{
if (v > alpha) return v;
if (v >= PawnValueMidgame + step)
{
Value bonus = Min(QueenValueMidgame, (v - q) / step * (i * i * SacrificeDetection));
if (v + bonus > alpha)
{
TT.store(posKey, VALUE_NONE, VALUE_TYPE_NONE, DEPTH_NONE, ss->bestMove, ss->eval, ss->evalMargin);
return v + bonus;
}
}
}
if (v <= rAlpha) return v;
d = d + ONE_PLY;
}
}