summaryrefslogtreecommitdiff
path: root/src/searchsup.c
diff options
context:
space:
mode:
authorScott Gasch <[email protected]>2026-08-30 12:48:34 -0700
committerScott Gasch <[email protected]>2026-08-30 12:48:34 -0700
commit3eac7f469add78edb9dd7dced36bde5427346321 (patch)
tree7b32f67728ee7973aa046df18423c6f6efbbd7a0 /src/searchsup.c
parent0eb79a56c9174397050535bbfdc3f1e767ba9ffc (diff)
Replace bishop/knight/rook/queen mobility jump tables with inline switch dispatch.
The per-square mobility ray-walk called through a function pointer for every square visited (piece type varies square to square, so the CPU's indirect-branch predictor couldn't learn it), and nearly every handler reduced to a couple of constant increments and a stop/continue flag. Replaced each PMOBILITY_HELPER table with a small case-tag table and an inlined switch, dropping all now-dead handler functions and the PMOBILITY_HELPER typedef. Also hoisted the ray-invariant rank/file direction test (rook's "connected" bonus, queen's bishop/rook xray cases) out of the per-square switch to compute once per ray instead. Verified semantics-preserving: node counts, solve/fail sets, and PVs are byte-for-byte identical to head_reference across all three curated ECM suites (ringers/confident_quick/hard_quick) at sd 10. bench shows a consistent ~6-7% NPS improvement over two back-to-back runs. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_012Q8wbZABsyG7PZQUd9WBAw
Diffstat (limited to 'src/searchsup.c')
0 files changed, 0 insertions, 0 deletions