Stockfish eval#1
Open
ContradNamiseb wants to merge 16 commits into
Open
Conversation
- New StockfishEvaluator class with fork/exec for bidirectional UCI protocol - CLI options: -stockfish <path> and -sf-depth <N> - Evaluates each position using Stockfish and converts centipawns to Q-value - Cross-platform: POSIX (Linux/Mac) uses fork/exec, Windows uses popen Usage: ./trainingdata-tool -stockfish /path/to/sf -sf-depth 15 games.pgn Made with Gemini and Claude
- Removed outdated Boost dependency - Added comprehensive options table - Added Stockfish evaluation examples - Updated build instructions Made with Gemini and Claude
- Added select() with 100ms timeout before blocking read() - Prevents timeout during UCI initialization - Added sys/select.h include Made with Gemini and Claude
- Prints 'TrainingData Tool v1.1 (Stockfish Arg Fix)' on startup - Helps confirm correct binary is running Made with Gemini and Claude
- Adds case-insensitive check for .pgn extension - Prevents processing of binary files or other non-PGN inputs - Adds cross-platform compatibility for strcasecmp Made with Gemini and Claude
- Prevents tool from hanging if Stockfish doesn't respond - Returns 0 (draw eval) on timeout with error message - Critical for robustness with large/problematic PGN files Made with Gemini and Claude
…lues, and MLH verification - Implement move-by-move position feeding to Stockfish (position startpos moves ...) - Add poly_move_to_uci for correct UCI string generation - Return StockfishResult struct with score_cp, best_move, nodes - Differentiate root_q (played move eval) from best_q (best move eval) - Post-process chunks: root_q = -next_chunk.best_q - Add setPositionMoves to StockfishEvaluator interface - Update verify_chunks.py with PliesLeft (MLH) reverse increment - Rename chunks to moves in verification output
- Implement StaticEvaluator with material balance (P=100, N=320, B=330, R=500, Q=900) - Add piece-square tables for all piece types with MG/EG king tables - Implement pawn structure analysis (doubled, isolated, passed pawns) - Add simplified mobility scoring - Use tapered evaluation (MG/EG interpolation based on game phase) - Integrate into PGNGame for non-Lichess mode - Use sigmoid function for cp-to-Q conversion
…NNIndex - Validate all MoveToNNIndex results before indexing probabilities array - Check legal moves loop indices - Check played_idx before writing probabilities[played_idx] = 1.0 - Check best_idx before storing in result.best_idx - Fallback to 0 or played_idx when index >= 1858 - Add debug warning for invalid indices Fixes crash on Windows where MSVC uninitialized memory (0xCCCC = 52428) exceeds array bounds (1858 elements).
Root cause of Windows crash: move_from() and move_to() return polyglot 0x88 format square indices, but lczero::Square::FromIdx() expects 0-63. - Added square_to_64() conversion before creating lczero::Square - This was causing garbage indices (0xCCCC) and assertion failures - Fixes: move 'e4' now correctly outputs as 'e2e4' (was showing 'b8a4')
Lc0's internal board representation is always from white's perspective. After ApplyMove(), Position::Mirror() is called to switch perspective. The move passed to PositionHistory::Append() must use absolute board squares, not flipped coordinates. Fixes: assertion failure 'ourpieces.intersects(BitBoard::FromSquare(move.from()))' in board.cc:597
- Added is_black_move parameter to poly_move_to_lc0_move() function - Regular moves for black are now flipped to match LC0's white perspective - Castling moves are left unflipped as they use perspective-independent file representation - Prevents assertion failure when applying black's moves to LC0 board Fixes issue where training data tool crashed when processing games with black moves.
Removed the release job from the CI workflow.
Restores the release job that creates pre-release on each push to master.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Just to compare