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.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.generate_sliding_moves_magicMethod

Generate pseudo-legal moves for a sliding piece using magic bitboards.

  • bb_piece: bitboard of the moving piece
  • masktable, attacktable, magic_table: precomputed tables
  • friendlypieces, enemypieces: arrays of piece indices
source
OrbisChessEngine.king_squareMethod

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

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.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.piece_square_valueMethod

Return the PSQT value of a piece on a given square.

  • piece: Piece.WPAWN..Piece.BKING
  • square: 0..63 (a1=0, h8=63)
  • phase: Float64 in [0.0, 1.0], where 1.0 = opening, 0.0 = endgame
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