summaryrefslogtreecommitdiff
path: root/src/chess.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/chess.h')
-rwxr-xr-xsrc/chess.h32
1 files changed, 21 insertions, 11 deletions
diff --git a/src/chess.h b/src/chess.h
index 2e9189a..305c681 100755
--- a/src/chess.h
+++ b/src/chess.h
@@ -716,19 +716,29 @@ typedef struct _POSITION
// bbRookAttacks/bbQueenAttacks that will retire the rest of it.
BITBOARD bbPawnAttacks[2];
- // First mover of the bbMinorAttacks pair (knight only for now --
- // bishop is a separate, later step; see board_representation/
- // EVAL.md section 2). "Which squares does this side's knight(s)
- // attack" -- computed via g_KnightAttacksBB[c] and OR'd in per
- // knight, Eval()-scoped scratch like bbPawnAttacks above, cleared
- // once per Eval() call in _ClearAttackTables since (unlike
- // bbPawnAttacks) it's accumulated across multiple pieces via |=,
- // not assigned wholesale. Bishop still writes its own minor-bit
- // contribution into the old rgSquare[c|8].bvAttacks structure for
- // now -- every consumer that needs "any minor's attack," not just
- // knight's, ORs both sources together until bishop converts too.
+ // "Which squares does this side's knight(s) or bishop(s) attack" --
+ // knight ORs in g_KnightAttacksBB[c] directly (no per-square
+ // bit-scan needed); bishop ORs in _BishopAttacksBB(c,
+ // pos->bbOccupied), generate.c's magic-bitboard slider lookup.
+ // Eval()-scoped scratch like bbPawnAttacks above, cleared once per
+ // Eval() call in _ClearAttackTables since (unlike bbPawnAttacks)
+ // it's accumulated across multiple pieces via |=, not assigned
+ // wholesale. Rook/queen/king are not converted yet and still write
+ // their own bits into the old rgSquare[c|8].bvAttacks structure --
+ // see _IsSquareAttackedByMinor (eval.c), the transitional helper
+ // every consumer goes through until they convert too.
BITBOARD bbMinorAttacks[2];
+ // Squares seen *through* a friendly bishop/queen battery partner
+ // or an x-rayable enemy rook/queen/king, for bishops only (knights
+ // never x-ray) -- see _EvalBishop's mobility loop. Same lifetime/
+ // clearing discipline as bbMinorAttacks above. Nothing else writes
+ // this yet (rook/queen have their own xray bits still living in
+ // the old bvAttacks structure), so unlike bbMinorAttacks' direct-
+ // bit case there's no old-structure fallback to combine with --
+ // see _IsSquareXrayedByMinor.
+ BITBOARD bbMinorXrayAttacks[2];
+
ULONG uWhiteSqBishopCount[2]; // num bishops on white squares
SCORE iMaterialBalance[2]; // material balance