position fen 8/2Nb4/pp6/4rp1p/1Pp1pPkP/PpPpR3/1B1P2N1/1K6 w - -
go mate 5
info string no mate in 1 found
info string no mate in 2 found
info string no mate in 3 found
info string no mate in 4 found
info depth 9 seldepth 9 multipv 1 score mate 5 nodes 2282138 nps 3143440 tbhits 0 time 726 pv b1c1 d7a4 c1d1 a6a5 d1e1 a5b4 e1f2 b4c3 e3g3
bestmove b1c1 ponder d7a4
position fen 1K1N1b2/RPp1pr2/1kP5/2p5/P7/4B1P1/4p1b1/6n1 w - -
go mate 6
info string no mate in 1 found
info string no mate in 2 found
info string no mate in 3 found
info string no mate in 4 found
info string no mate in 5 found
info depth 11 currmove a7a5 currmovenumber 4
info depth 11 currmove e3d4 currmovenumber 5
info depth 11 currmove a7a8 currmovenumber 6
info depth 11 currmove b8c8 currmovenumber 7
info depth 11 seldepth 11 multipv 1 score mate 6 nodes 30712883 nps 3368009 hashfull 0 tbhits 0 time 9119 pv b8c8 g2h3 g3g4 h3g4 c8b8 g4d7 c6d7 c7c6 b8a8 b6c7 b7b8q
bestmove b8c8 ponder g2h3
position fen 1N1K1b1r/P3pPp1/4k1P1/rp1pB1RN/q4RP1/8/p2pB1p1/1b6 w - -
go mate 6
info string no mate in 1 found
info string no mate in 2 found
info string no mate in 3 found
info string no mate in 4 found
info depth 9 currmove e5d6 currmovenumber 4
info depth 9 currmove e5f6 currmovenumber 5
info depth 9 currmove f4f5 currmovenumber 6
info depth 9 currmove g5f5 currmovenumber 7
info depth 9 currmove h5g7 currmovenumber 8
info depth 9 currmove e5g7 currmovenumber 9
info depth 9 currmove b8c6 currmovenumber 10
info depth 9 currmove e2c4 currmovenumber 11
info depth 9 currmove e5d4 currmovenumber 12
info depth 9 currmove e5c7 currmovenumber 13
info depth 9 currmove f4c4 currmovenumber 14
info depth 9 currmove f4d4 currmovenumber 15
info depth 9 currmove f4e4 currmovenumber 16
info depth 9 currmove d8c7 currmovenumber 17
info depth 9 currmove d8e8 currmovenumber 18
info depth 9 currmove d8c8 currmovenumber 19
info depth 9 currmove e2b5 currmovenumber 20
info depth 9 currmove h5g3 currmovenumber 21
info depth 9 currmove e2d3 currmovenumber 22
info depth 9 currmove e2f3 currmovenumber 23
info depth 9 currmove e5c3 currmovenumber 24
info depth 9 currmove f4f3 currmovenumber 25
info depth 9 currmove f4b4 currmovenumber 26
info depth 9 currmove a7a8q currmovenumber 27
info depth 9 currmove a7a8r currmovenumber 28
info depth 9 currmove a7a8b currmovenumber 29
info depth 9 currmove a7a8n currmovenumber 30
info depth 9 currmove f4a4 currmovenumber 31
info depth 9 currmove b8a6 currmovenumber 32
info depth 9 currmove e5b2 currmovenumber 33
info depth 9 currmove f4f2 currmovenumber 34
info depth 9 currmove e2d1 currmovenumber 35
info depth 9 currmove e2f1 currmovenumber 36
info depth 9 currmove e5a1 currmovenumber 37
info depth 9 currmove f4f1 currmovenumber 38
info string no mate in 5 found
info depth 11 currmove f4f6 currmovenumber 1
info depth 11 currmove h5f6 currmovenumber 2
info depth 11 currmove b8d7 currmovenumber 3
info depth 11 seldepth 11 multipv 1 score mate 6 nodes 299839182 nps 3194127 hashfull 0 tbhits 0 time 93872 pv b8d7 g2g1q e5c7 a2a1q e2f3 b1e4 f4f5 e4f3 f5e5 a1e5 g5e5
bestmove b8d7 ponder g2g1q
position fen 1K1N1b2/RPp1pr2/1kP5/2p5/P7/4B1P1/4p1b1/6n1 w - -
go mate 6
info string no mate in 1 found
info string no mate in 2 found
info string no mate in 3 found
info string no mate in 4 found
info string no mate in 5 found
info depth 11 currmove e3d4 currmovenumber 5
info depth 11 currmove a7a8 currmovenumber 6
info depth 11 currmove b8c8 currmovenumber 7
info depth 11 seldepth 11 multipv 1 score mate 6 nodes 7058743 nps 1022709 hashfull 0 tbhits 0 time 6902 pv b8c8 g2h3 g3g4 h3g4 c8b8 g4d7 c6d7 c7c6 b8a8 b6c7 b7b8q
bestmove b8c8 ponder g2h3
position fen 1N1K1b1r/P3pPp1/4k1P1/rp1pB1RN/q4RP1/8/p2pB1p1/1b6 w - -
go mate 6
info string no mate in 1 found
info string no mate in 2 found
info string no mate in 3 found
info string no mate in 4 found
info depth 9 currmove e5d6 currmovenumber 4
info depth 9 currmove e5f6 currmovenumber 5
info depth 9 currmove f4f5 currmovenumber 6
info depth 9 currmove g5f5 currmovenumber 7
info depth 9 currmove h5g7 currmovenumber 8
info depth 9 currmove e5g7 currmovenumber 9
info depth 9 currmove b8c6 currmovenumber 10
info depth 9 currmove e2c4 currmovenumber 11
info depth 9 currmove e5d4 currmovenumber 12
info depth 9 currmove e5c7 currmovenumber 13
info depth 9 currmove f4c4 currmovenumber 14
info depth 9 currmove f4d4 currmovenumber 15
info depth 9 currmove f4e4 currmovenumber 16
info depth 9 currmove d8e8 currmovenumber 17
info depth 9 currmove d8c8 currmovenumber 18
info depth 9 currmove e2b5 currmovenumber 19
info depth 9 currmove h5g3 currmovenumber 20
info depth 9 currmove e2d3 currmovenumber 21
info depth 9 currmove e2f3 currmovenumber 22
info depth 9 currmove e5c3 currmovenumber 23
info depth 9 currmove f4f3 currmovenumber 24
info depth 9 currmove f4b4 currmovenumber 25
info depth 9 currmove a7a8q currmovenumber 26
info depth 9 currmove a7a8r currmovenumber 27
info depth 9 currmove a7a8b currmovenumber 28
info depth 9 currmove a7a8n currmovenumber 29
info depth 9 currmove f4a4 currmovenumber 30
info depth 9 currmove b8a6 currmovenumber 31
info depth 9 currmove e5b2 currmovenumber 32
info depth 9 currmove f4f2 currmovenumber 33
info depth 9 currmove e2d1 currmovenumber 34
info depth 9 currmove e2f1 currmovenumber 35
info depth 9 currmove e5a1 currmovenumber 36
info depth 9 currmove f4f1 currmovenumber 37
info depth 9 currmove d8c7 currmovenumber 38
info string no mate in 5 found
info depth 11 currmove f4f6 currmovenumber 1
info depth 11 currmove h5f6 currmovenumber 2
info depth 11 currmove b8d7 currmovenumber 3
info depth 11 seldepth 11 multipv 1 score mate 6 nodes 77304335 nps 1084775 hashfull 0 tbhits 0 time 71263 pv b8d7 g2g1q e5c7 a2a1q e2f3 b1e4 f4f5 e4f3 f5e5 a1e5 g5e5
bestmove b8d7 ponder g2g1q
position fen 1N1K1b1r/P3pPp1/4k1P1/rp1pB1RN/q4RP1/8/p2pB1p1/1b6 w - -
go mate 6
info string FEN: 1N1K1b1r/P3pPp1/4k1P1/rp1pB1RN/q4RP1/8/p2pB1p1/1b6 w - - (11+13)
info string Stellungs-Analyse: C0/R0/K1/P9/X34 W:8/38
info string Problem in Datenbank gefunden: #6; 00:01;
info string Suche nach Matt in 10 ... (Hash=64MB)
info depth 6 currmovenumber 11 currmove b8d7
info depth 6 time 238 score mate 6 pv b8d7
info depth 6 seldepth 6 currmovenumber 38 currmove d8c7 hashfull 42 nodes 610291 nps 692725
info string Suche abgeschlossen ... (Zeit=0.88s)
info string Matt in 6 gefunden ! (1 L÷sung in 00:00)
info depth 6 seldepth 6 time 881 score mate 6 multipv 1 pv b8d7 g2g1q e5c7 a2a1q e2f3 d2d1q f4d4 g1d4 g5e5 d4e5 d7c5
bestmove b8d7
position fen 1N1K1b1r/P3pPp1/4k1P1/rp1pB1RN/q4RP1/8/p2pB1p1/1b6 w - -
go mate 6
info string No mate in 1 found
info string No mate in 2 found
info string No mate in 3 found
info string No mate in 4 found
info depth 9 currmove e2c4 currmovenumber 17
info depth 9 currmove e5d4 currmovenumber 18
info depth 9 currmove f4b4 currmovenumber 19
info depth 9 currmove f4c4 currmovenumber 20
info depth 9 currmove f4d4 currmovenumber 21
info depth 9 currmove f4e4 currmovenumber 22
info depth 9 currmove h5g3 currmovenumber 23
info depth 9 currmove e2d3 currmovenumber 24
info depth 9 currmove e2f3 currmovenumber 25
info depth 9 currmove e5c3 currmovenumber 26
info depth 9 currmove f4f3 currmovenumber 27
info depth 9 currmove e5b2 currmovenumber 28
info depth 9 currmove f4f2 currmovenumber 29
info depth 9 currmove e2d1 currmovenumber 30
info depth 9 currmove e2f1 currmovenumber 31
info depth 9 currmove e5a1 currmovenumber 32
info depth 9 currmove f4f1 currmovenumber 33
info depth 9 currmove d8c8 currmovenumber 34
info depth 9 currmove d8e8 currmovenumber 35
info depth 9 currmove h5g7 currmovenumber 36
info depth 9 currmove e5g7 currmovenumber 37
info depth 9 currmove d8c7 currmovenumber 38
info string No mate in 5 found
info depth 11 currmove f4f6 currmovenumber 1
info depth 11 currmove e2b5 currmovenumber 2
info depth 11 currmove f4a4 currmovenumber 3
info depth 11 currmove a7a8q currmovenumber 4
info depth 11 currmove a7a8r currmovenumber 5
info depth 11 currmove a7a8b currmovenumber 6
info depth 11 currmove a7a8n currmovenumber 7
info depth 11 currmove b8d7 currmovenumber 8
info string Success! Mate in 6 found!
info depth 11 seldepth 11 multipv 1 score mate 6 nodes 27548385 nps 1062372 hashfull 0 tbhits 0 time 25931 pv b8d7 g2g1q e5c7 a2a1q e2f3 d2d1q f4d4 a1d4 d7c5 d4c5 g5e5
bestmove b8d7 ponder g2g1q
// Plain alpha-beta search function in negamax style,
// fail-soft framework.
Value search_mate(Position& pos, BasicStack* ss, Value alpha, Value beta, Depth depth) {
StateInfo st;
Value bestValue, value;
bool inCheck = !!pos.checkers();
int moveCount;
Color us = pos.side_to_move();
assert(alpha < beta);
// Start with a fresh pv
ss->pv.clear();
// At the leaf, we simply either return a mate score
// or zero. No evaluation needed!
if (depth == 0)
{
if (inCheck && !MoveList<LEGAL>(pos).size())
return mated_in(ss->ply);
else
return VALUE_DRAW;
}
// Check for draw by repetition and 50-move rule
if (pos.is_draw(ss->ply))
return VALUE_DRAW;
// TODO: Tablebase probe
// For the root color we can immediately return on
// TB draws or losses
bestValue = -VALUE_INFINITE;
moveCount = 0;
auto rankThisMove = 0;
// Search all legal moves
std::vector<RankedMove> legalMoves;
legalMoves.reserve(64); // avoid reallocations
auto king = pos.square<KING>(~us); // Square of the opponent's king
for (const auto& m : MoveList<LEGAL>(pos))
{
if (pos.gives_check(m))
rankThisMove += 2000 - 100 * distance(king, to_sq(m)); // Top priority!
else if (pos.capture(m))
rankThisMove += 200; // TODO MVV/LVA
else
rankThisMove += 20 * relative_rank(us, to_sq(m));
// Add this ranked move
legalMoves.emplace_back(RankedMove(m, rankThisMove));
rankThisMove = 0; // Reset for the next move
}
std::stable_sort(legalMoves.begin(), legalMoves.end(),
[](const RankedMove &rm1, const RankedMove &rm2) { return rm1.rank > rm2.rank; });
for (auto& rm : legalMoves)
{
moveCount++;
// At frontier nodes we can skip all non-checking moves
if ( depth == 1
&& rm.rank < 1000)
break;
pos.do_move(rm.move, st);
value = -search_mate(pos, ss+1, -beta, -alpha, depth-1);
pos.undo_move(rm.move);
// Do we have a new best value?
if (value > bestValue)
{
// Beta-cutoff?
if (value >= beta)
return value;
bestValue = value;
if (value > alpha)
{
// Update alpha
alpha = value;
// Reset PV and insert current best move
ss->pv.clear();
ss->pv.push_back(rm.move);
// Append child pv
for (auto& m : (ss+1)->pv)
ss->pv.push_back(m);
}
}
}
if (Threads.stop.load(std::memory_order_relaxed))
return VALUE_ZERO;
// No moves? Must be Mate or Stalemate!
if (!moveCount)
bestValue = inCheck ? mated_in(ss->ply) // Checkmate!
: VALUE_DRAW; // Stalemate!
assert(-VALUE_INFINITE < bestValue && bestValue < VALUE_INFINITE);
return bestValue;
}
struct BasicStack {
BasicStack() {
pv.reserve(8);
ply = 0;
}
std::vector<Move> pv;
int ply;
};
struct RankedMove {
RankedMove(Move m, int r) : move(m), rank(r) {}
Move move;
int rank;
};
> d.h. es ist wichtig dass der beste Zug an den Anfang kommt.
> Irrtum: Deine Aussage gilt für eine heuristische suche bei der es nicht um perfekte Ergebisse geht, sondern nur darum einen möglichst guten Zug zu finden.
Using ./huntsman with 1000000 nodes
Total fens: 6566
Found mates: 5147
Best mates: 3725
Using ./matefish with 1000000 nodes
Total fens: 6566
Found mates: 702
Best mates: 702
Powered by mwForum 2.29.3 © 1999-2014 Markus Wichitill