Derive new magics from existing sliders dynamically
authorH.G.Muller <hgm@hgm-xboard.(none)>
Sat, 3 Jan 2026 20:39:15 +0000 (21:39 +0100)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Sun, 4 Jan 2026 08:03:14 +0000 (09:03 +0100)
commit32795fb239fea9f2e78b8c53b77315b3c5138137
treec93438ab33c29ceeca4969c02238d09e3fbbb556
parent22b88407fee5056cfb0a2bb505028853c776f4a4
Derive new magics from existing sliders dynamically

The infra-structure is provided for adding new magic attack getters from
those for Rook and Bishop. These use the same attacks tables as the one
they are copied from, but mask away some squares from teh original masks.
  This is controlled by the 16 high-order bits of the range code passed
from the Betza parser to the bitboard-creating routines, which then do
for the masks what the 16 low-order bits do for the pseudoAttacks:
remove those squares from the slider path for which the corresponding bit
was set.
  This is a memory-efficient way for creating new types of rides in the 8
principal directions, such as Dabbaba- or Alfilrider, or even those with
still larger strides, such as the Threeleaperrider (HH). It can in principle
also be used for defining (non-lame) ski-sliders or a Panda.
src/bitboard.cpp
src/types.h