@@ -99,7 +99,6 @@ namespace {
99
99
void id_loop (Position& pos);
100
100
Value value_to_tt (Value v, int ply);
101
101
Value value_from_tt (Value v, int ply);
102
- bool check_is_dangerous (const Position& pos, Move move, Value futilityBase, Value beta);
103
102
bool allows (const Position& pos, Move first, Move second);
104
103
bool refutes (const Position& pos, Move first, Move second);
105
104
string uci_pv (const Position& pos, int depth, Value alpha, Value beta);
@@ -1267,16 +1266,6 @@ namespace {
1267
1266
&& pos.see_sign (move) < 0 )
1268
1267
continue ;
1269
1268
1270
- // Don't search useless checks
1271
- if ( !PvNode
1272
- && !InCheck
1273
- && givesCheck
1274
- && move != ttMove
1275
- && !pos.is_capture_or_promotion (move)
1276
- && ss->staticEval + PawnValueMg / 4 < beta
1277
- && !check_is_dangerous (pos, move, futilityBase, beta))
1278
- continue ;
1279
-
1280
1269
// Check for legality only before to do the move
1281
1270
if (!pos.pl_move_is_legal (move, ci.pinned ))
1282
1271
continue ;
@@ -1354,42 +1343,6 @@ namespace {
1354
1343
}
1355
1344
1356
1345
1357
- // check_is_dangerous() tests if a checking move can be pruned in qsearch()
1358
-
1359
- bool check_is_dangerous (const Position& pos, Move move, Value futilityBase, Value beta)
1360
- {
1361
- Piece pc = pos.piece_moved (move);
1362
- Square from = from_sq (move);
1363
- Square to = to_sq (move);
1364
- Color them = ~pos.side_to_move ();
1365
- Square ksq = pos.king_square (them);
1366
- Bitboard enemies = pos.pieces (them);
1367
- Bitboard kingAtt = pos.attacks_from <KING>(ksq);
1368
- Bitboard occ = pos.pieces () ^ from ^ ksq;
1369
- Bitboard oldAtt = pos.attacks_from (pc, from, occ);
1370
- Bitboard newAtt = pos.attacks_from (pc, to, occ);
1371
-
1372
- // Checks which give opponent's king at most one escape square are dangerous
1373
- if (!more_than_one (kingAtt & ~(enemies | newAtt | to)))
1374
- return true ;
1375
-
1376
- // Queen contact check is very dangerous
1377
- if (type_of (pc) == QUEEN && (kingAtt & to))
1378
- return true ;
1379
-
1380
- // Creating new double threats with checks is dangerous
1381
- Bitboard b = (enemies ^ ksq) & newAtt & ~oldAtt;
1382
- while (b)
1383
- {
1384
- // Note that here we generate illegal "double move"!
1385
- if (futilityBase + PieceValue[EG][pos.piece_on (pop_lsb (&b))] >= beta)
1386
- return true ;
1387
- }
1388
-
1389
- return false ;
1390
- }
1391
-
1392
-
1393
1346
// allows() tests whether the 'first' move at previous ply somehow makes the
1394
1347
// 'second' move possible, for instance if the moving piece is the same in
1395
1348
// both moves. Normally the second move is the threat (the best move returned
0 commit comments