Fix NNUE compatibility check to validate king count (#932)
authorFabian Fichter <ianfab@users.noreply.github.com>
Mon, 10 Nov 2025 16:34:09 +0000 (17:34 +0100)
committerGitHub <noreply@github.com>
Mon, 10 Nov 2025 16:34:09 +0000 (17:34 +0100)
commite79af634b602e55ad9d141a0fa73bd130a4a3264
treea4152bc7cbcc2dc7a2a07238605691eaad1463a3
parentea52328217918f1d42c759ad1c73693bdd17474c
Fix NNUE compatibility check to validate king count (#932)

Add safeguard in nnue_applicable() to ensure that when nnueKing is set,
both WHITE and BLACK have exactly one king of that piece type. This prevents
NNUE from being used in positions where the king count doesn't match the
expected configuration, which could lead to incorrect evaluations.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
src/position.h