Internal API Reference

OrbisChessEngine.TTEntryType

Transposition table entry.

  • key: Zobrist hash of the position (for collision checking)
  • value: evaluation score
  • depth: search depth at which this value was computed
  • node_type: type of node (EXACT, LOWERBOUND, UPPERBOUND)
  • best_move: best move found from this position
source
OrbisChessEngine._filter_legal_moves!Method
_filter_legal_moves!(board, pseudo, start, stop, moves, n_moves)

Filters pseudo-legal moves into legal moves, avoiding full make/undo for moves that clearly cannot expose the king.

source
OrbisChessEngine.find_magicMethod

Try to find a magic number for a given square.

  • sq: square index 0–63
  • masks: precomputed mask table (bishop or rook)
  • attack_fn: function (sq, occ) → attacks
  • tries: number of random candidates to attempt
source
OrbisChessEngine.flip_tableMethod

Flip a piece-square table vertically (white → black perspective). Input is a 64-element vector (row-major, starting at A8). Returns a new 64-element vector with ranks mirrored.

source
OrbisChessEngine.king_squareMethod
king_square(board::Board, side::Side) -> Int

Get the square index of the king for the given side

  • board: Board struct
  • side: Side (WHITE or BLACK)

Returns: Int (square index 0..63)

source
OrbisChessEngine.move_ordering_scoreMethod
move_ordering_score(board::Board, m::Move, ply::Int)

Heuristic to score moves for ordering:

  • Promotions are prioritized highest.
  • Captures are prioritized higher.
  • Moves giving check are prioritized.
  • Quiet moves get a lower score.
source
OrbisChessEngine.next_squareMethod
next_square(sq::Int, dir::Tuple{Int,Int}) -> Union{Int,Nothing}

Returns the next square index in direction dir = (df, dr) from sq. Returns nothing if it goes off-board.

source
OrbisChessEngine.piece_from_symbolMethod
piece_from_symbol(c::AbstractChar, side::Symbol)

Return the piece constant corresponding to promotion symbol c and the moving side (:white or :black).

source
OrbisChessEngine.ray_betweenMethod
ray_between(board, king_sq::Int, from_sq::Int) -> Bool

Returns true if moving a piece from from_sq could open a sliding attack (rook, bishop, queen) towards the king at king_sq.

source
OrbisChessEngine.square_attackedMethod
square_attacked(board, sq, attacker) -> Bool

Check if a square is attacked by the given side.

  • board: Board struct
  • sq: Int (square index 0..63)
  • attacker: Side (WHITE or BLACK)

Returns: Bool

source
OrbisChessEngine.tt_probeMethod

Look up a position in the transposition table.

  • hash: Zobrist hash of the position
  • depth: current search depth
  • α: alpha value
  • β: beta value

Returns a tuple (value, best_move, hit) where hit is true if a valid entry was found.

source