feat(official-bots): implement king-relative (HalfKP) encoding in NNUE (NCS-109) #82
Reference in New Issue
Block a user
Delete Branch "feat/NCS-109-king-relative-encoding"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Replace absolute 768-feature encoding with dual-perspective king-relative
encoding (HalfKP style): each piece is encoded from both the white king's
and the black king's reference frame, yielding 98304 input features
(2 × 64 king-squares × 12 piece-types × 64 squares).
Key changes:
pushAccumulator now accepts childBoard and recomputes on king moves
(castle or normal king move) instead of using stale incremental state;
non-king moves update both perspectives incrementally (~4 column ops).
NNUE model input size updated to INPUT_SIZE (98304); DEFAULT_HIDDEN_SIZES
reduced to [512, 256, 128] appropriate for sparse high-dim input.
tests compile and run; replace with a retrained model via Colab notebook.
Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com
Pull request closed