Skip to content
Home » News » Wordfish- 4.0.1-260126

Wordfish- 4.0.1-260126

Wordfish

Motivation

  • Ensure the repository uses the exact requested Stockfish NNUE filenames and downloads/validates them robustly.
  • Make the NNUE download/install independent of CWD and fail hard when required tools or validations are missing.
  • Add Revolution-compatible Makefile gating so embedding can be disabled and build prerequisites honor that setting.

Description

  • Update default BIG NNUE macro in src/evaluate.h to nn-c288c895ea92.nnue while keeping the small net macro unchanged.
  • Replace scripts/net.sh with a CWD-independent, fail-fast downloader that auto-detects evaluate.h, requires wget or curl, requires sha256sum/shasum for validation, enforces minimum size thresholds, and creates a symlink into src/ so the build embedding step can find the files. The script validates filename by sha256 prefix and removes invalid downloads.
  • Add Revolution-compatible NNUE gating block to src/Makefile (NNUE_EMBEDDING_OFF ?= no) and set NNUE_TARGET := net or empty when embedding is disabled, and replace net prerequisites with $(NNUE_TARGET) for analyzebuildprofile-build, and config-sanity, keeping the net target as the wrapper that calls ../scripts/net.sh.
  • Adjust engine/network construction in src/engine.cpp to call Networks with EvalFile arguments (matching the Networks constructor signature) instead of trying to construct Network objects inline.
  • Convert compile-time FullThreats LUT initialization into a runtime initializer: declare init_threat_offsets() in src/nnue/features/full_threats.h, implement a lazy init_threat_offsets() in src/nnue/features/full_threats.cpp, and move previously-constexpr LUTs into runtime-initialized arrays to avoid constexpr/ABI issues.
  • Add ValueList::ssize() and include <cstddef> in src/misc.h for signed sizes used by NNUE accumulator code.

Files changed: src/evaluate.hscripts/net.shsrc/Makefilesrc/engine.cppsrc/misc.hsrc/nnue/features/full_threats.hsrc/nnue/features/full_threats.cpp.

Testing

  • make -C src net — succeeded; both nn-c288c895ea92.nnue and nn-37f18f62d772.nnue were validated and placed under src/nnue/ (the script also created src/ symlinks). (PASS)
  • make -C src build — succeeded; build completed and produced src/Wordfish-4.0-230126-sse41popcnt. (PASS)
  • UCI smoke test ./src/Wordfish-4.0-230126-sse41popcnt <<'EOF' ... EOF — succeeded; engine printed id/options and logged that it is using nn-c288c895ea92.nnue and nn-37f18f62d772.nnue, then returned a best move. (PASS)
  • make -C src -n build — dry-run shows the build calls ../scripts/net.sh and the config output; (PASS)
  • make -C src -n build NNUE_EMBEDDING_OFF=yes — dry-run shows -DNNUE_EMBEDDING_OFF present in CXXFLAGS and $(NNUE_TARGET) is empty so net is omitted; (PASS)

All automated steps above completed successfully in the test environment.


Leave a Reply

Your email address will not be published. Required fields are marked *