Repository navigation
Conversation
Version bump v1.6 -> v1.7 across codebase: - CMakeLists.txt project version - README.md version history (v1.6 release notes added) - Arena config, docs, and source references - VTune analysis script Texel Tuning Phase 0 (steps 0.1-0.4): - Update PLAN_Texel_Tuning.md to v1.3: mark Phase 0 complete, fix eval perspective bug in code snippet (WHITE check, not BLACK) - Create PLAN_Texel_Tuning_Progress.md phase progress tracker
Steps 1.1-1.4 of Texel Tuning Phase 1:
1.1 - Directory structure:
- src/common/pgn/ (PGN parser library)
- src/tuning/extractor/, src/tuning/optimizer/ (placeholders for Phase 2)
- Updated CMake globs for common/pgn/ in src and test
1.2 - PGN parser (PgnParser.h/.cpp):
- Extracted and generalized from OpeningBook::readGamesPgn()
- Streaming API (game-by-game callback) and batch API
- parseFromLines() for OpeningBook integration path
- Multi-tag-per-line support, header tag parsing with PGN escapes
- cleanUpMoveSection() with constexpr lookup tables (no C <cctype>)
- Fixed size_t underflow in result-removal loop
1.3 - PgnTypes.h (GameResult enum, conversion functions), PgnGame.h
(structured game with headers, moves, result)
1.4 - Comprehensive PgnParserTest (30+ test cases):
- Type round-trips, cleanUpMoveSection, tag parsing, streaming vs batch,
parseFromLines, edge cases, large file tests (8moves_v3, superbook)
- headerEscapedQuotes test uses raw string literal (escape WIP)
Step 1.5 - Refactor OpeningBook::readGamesPgn(): - Replace readGamesPgn/readOneGamePgn (~140 lines) with PgnParser call (~30 lines) - Use PgnParser::parseFromLines() for game parsing - Parallelize addGameToBook() calls via std::async - Delegate cleanUpPgnMoveSection to PgnParser::cleanUpMoveSection (inline) - Add PgnParser.h include and pgn namespace alias Step 1.6 - All OpeningBookTest tests pass: - pgnCleanUpTest, initPgn, 8movesPgn, initPgnLarge, initPgnXLLarge - serializationLarge (cache round-trip) - All other SIMPLE/SAN format tests unaffected Phase 1 complete: PGN parser library extracted, OpeningBook migrated.
- Create ExtractorMain.cpp with full CLI (Boost.program_options): --input, --output, --min-move, --min-pieces, --skip-captures, --skip-promotions, --qsearch-filter, --qsearch-threshold, --verbose - Create TunerMain.cpp with full CLI: --dataset, --output, --threads, --test-split, --resume, --max-passes, --verbose - Add FrankyCPP_v1.7_Extractor and FrankyCPP_v1.7_Tuner CMake targets guarded by if(NOT FRANKYCPP_PRODUCTION) - Create src/tuning/README.md module documentation - Remove .gitkeep.md placeholders (replaced by real source files) - Update plan and progress documents to mark Phase 2 complete
- Add dataset source URL txt file with download instructions - Update .gitignore to exclude large .epd and .epd.gz tuning data files - Dataset: quiet-labeled.v7.epd.gz (~7.2M positions from CCRL games)
…sets/tuning/ - test/testsets/ is consistent with existing EPD test data location - results/ is reserved for engine output (matches, benchmarks, etc.)
- Corrected volume in plan, progress doc, and dataset source txt file - Updated Option 4 mixed dataset table to reflect actual Zurichess volume - Updated deliverable filename to match actual file: quiet-labeled.epd - Self-play data will supplement to reach 3-5M target
- Arena config: tc=10+0.3 (depth 8-11 for eval-driven play), Threads=1, concurrency=12, 50k rounds, 8moves_v3.pgn openings - Output: test/testsets/tuning/selfplay_v1.7_50k.pgn - Expected: ~1.5M extractable positions over ~3 days - Add .pgn to tuning gitignore (self-play output too large for git)
…ime test - Update PLAN_Texel_Tuning.md with working cutechess-cli self-play command (st=0.5, timemargin=200) - Add Filter 0 (time-loss games) and Filter 6 (score-vs-result contradiction) - Add ExtractionStats struct and comprehensive summary output format - Instrument extraction pseudocode with per-filter stat counters - Add moveTimeCompliance test in SearchTest (100 positions, 500ms budget) - Add Release/FrankyCPP_v1.7.zip
- Add PositionExtractor class with 6 position filters: - Filter 1: Early moves (< 16 half-moves) - Filter 2: In-check positions - Filter 3: Captures and promotions - Filter 4: Endgame positions (< 6 pieces) - Filter 5: Qsearch filter (static eval differs from qsearch) - Filter 6: Score contradiction filter (PGN score vs game result) - Implement standalone quiescence search for tactical filtering - Add parseSearchScore() with locale-independent decimal parsing - Wire up ExtractorMain.cpp with full CLI (--qsearch-filter, --score-filter) - Add TUNING_LOG logger to Logging.h - Add PgnGame::moveComments for score extraction - Add PgnParser::parseComment() for cutechess-cli format - 25 unit tests covering all filters, parsing, and integration - Validated on 17k games (2.6M positions) - extracts 1.5M positions Phase 4 of Texel Tuning plan complete.
- Add tunableOptions() query to ConfigRegistry (mirrors uciOptions/yamlOptions pattern) - Mark .tunable = true on 88 eval weight entries (82 scalar Int + 6 IntArray) - Excluded: bool USE_* toggles, EVAL_CONFIG_SOURCE, PAWN_TT_SIZE_MB, USE_GAMEPHASE_VALUE - Add 7 unit tests: count pinned at 88, domain/type validation, exclusion checks, spot-checks - Update progress tracker and plan status
… train/test split - TuningDataset: dual-format loader (FrankyCPP [result] + EPD c9), auto-detection per line, deterministic train/test split, load stats, FEN validation via reusable Position object, maxEntries limit, iterator support - TuningEntry: FEN + result + activeParamGroups bitset (for Phase 6.5 incremental MSE) - Position::initializeBoard: use std::ranges::fill, remove unnecessary historyState zeroing (guarded by historyCounter), add psqEndValue reset - 25 unit tests covering both formats, Zurichess 1.4M EPD dataset, edge cases, split ordering, reload semantics, load statistics - test/CMakeLists.txt: add tuning optimizer sources for test build - Progress tracker updated: Phase 6.1 complete
- TuningParameter struct with MonotonicityConstraint enum - buildFromRegistry() static factory: scalar Int -> 1 param, IntArray -> 1 per element - Uses ConfigDef getter/setter lambdas (no raw pointers into config structs) - applyToConfig()/readFromConfig() round-trip through registry interface - 13 param groups by eval category, monotonicity on 6 known arrays - countTunableValues() without allocating vector - 20 unit tests all passing
- TexelTuner class with sigmoid(), computeMSE(), tuneK() - Single-threaded MSE: FEN → setFromFen → evaluate → White-relative → sigmoid → squared error - Ternary search K-tuning on [0.5, 2.0] with 50 iterations - setupEvalOverrides(): disable lazy eval/pawn TT, enable space/coordination - Eval perspective: negate when Black to move (verified identical MSE both sides) - Dev dataset (1000 pos): K=0.52, MSE=0.071 - 18 unit tests (sigmoid, MSE, K-tuning, dev dataset integration)
- Add computeMSEParallel(): partitions dataset across ThreadPool workers, each with own Evaluator + stack-local Position. Sorted partial-sum reduction for deterministic FP (matches single-threaded within 1 ULP). - Add createEvaluators(N): creates N Evaluator instances + thread pool, clamped to [1, hardware_concurrency]. - Add tuneParameters(): coordinate descent optimizer — tries +/-delta per param, keeps best direction, repeats until convergence or maxPasses. Logs per-pass summary (train/test MSE, params changed, biggest mover). - tuneK() auto-selects parallel MSE when multi-threaded. - Mutable config access via applyOverrides() (no const_cast). - Dev dataset (5K pos, 122 params, 4 threads): 95/122 params improved, MSE 0.1200->0.1178 in 1 pass, 1.05s. - 12 new tests (30/30 total pass): parallel MSE correctness, determinism, coordinate descent convergence, edge cases.
- Add cachedSquaredError field to TuningEntry for per-entry error caching. - Add computeActivationFlags(): board-state analysis sets per-entry activeParamGroups bitset (13 groups). Parallel via ThreadPool. Group distribution on quiet-labeled.epd: bishop-pair 35%, knight 62%, queen 58%, coordination 59%, tempo/king-safety 100%. - Add computeAndCacheErrors(): full eval pass populating cache + totalSSE. - Add computeMSEIncremental(): accumulates deltaSSE for active entries only, returns (totalSSE + deltaSSE) / N. Matches full MSE within 2.8e-17 on 1K positions. Does NOT modify cache. - Add updateCacheForGroup(): refreshes cache + adjusts totalSSE after committed parameter changes. - tuneParameters() now uses incremental MSE: activation flags + cache before loop, incremental trials per param, cache update on commit. Produces identical optimization results to Sprint 6.4 full-MSE path. - Speedup on quiet-labeled.epd (100K pos, 4 threads): knight group (61.5% active) 1.45x faster. Bishop-pair (35.2%) expected ~2.5x. - 12 new tests (42/42 total pass): 5 activation flags, 4 incremental MSE correctness, 1 cache consistency, 1 integration, 1 speedup bench.
- Extract 4.57M positions from 50k self-play PGN (score+qsearch filters) - Add --verbose progress reporting to extractor (every 5000 games) - Add extraction-commands.md with regeneration commands and summary - Update .gitignore for large extracted dataset files - Mark Phase 3 complete in plan docs (combined ~6.0M positions available)
- Add enforceMonotonicity() to TexelTuner: clamps array elements to neighbor bounds (NON_DECREASING/NON_INCREASING) after coordinate descent steps - Integrate into tuneParameters(): called after +/-delta trials and keep-best - Only the modified element is clamped (no cascading) to ensure convergence - 11 new tests: clamping behavior, edge cases, real registry arrays, integration test verifying ordering after 2 passes (all 6 arrays) - All 52 TexelTunerTest tests pass (1 speed test skipped in bulk)
- Add TuningState struct with YAML checkpoint persistence (yaml-cpp) - captureFromParams() / restoreToParams() for snapshotting/restoring param vectors (name-based matching with warnings for mismatches) - saveToYaml() / loadFromYaml() with format version marker (FrankyCPP_TuningCheckpoint_v1) - Stores: completedPasses, K, bestTrainMSE, bestTestMSE, datasetPath, timestamp, all param name->value pairs - Integrate into tuneParameters(): optional checkpointPath + datasetPath + startPass params — saves after each pass, supports resume - 15 new tests: capture/restore, missing/extra params, YAML round-trip, negative values, empty params, error handling (missing file, invalid YAML, wrong format, bad path), human-readable check, real registry round-trip, coordinate descent integration - Update progress docs: mark 6.7 complete, next step 6.8
…dicators - Replace Phase 6 TODO stub with end-to-end tuning pipeline: load dataset -> split train/test -> eval overrides -> create evaluators -> build params from registry -> resume from checkpoint -> tune K -> coordinate descent -> final summary with top-20 movers table - Map all CLI args: --dataset, --output, --threads, --test-split, --max-passes, --resume, --verbose - Add setK() to TexelTuner for clean checkpoint resume (avoids degenerate tuneK workaround) - Add progress indicators to eliminate silent gaps: - Dataset loading: progress every 250K lines (carriage-return overwrite) - K tuning: per-10-iteration progress with current K, range, and MSE - Activation flags + initial cache: stdout messages before/after - Within-pass: param counter every 20 params (carriage-return overwrite) - Per-pass summary: duplicated to stdout alongside spdlog - Fix UTF-8 delta char (garbled on Windows console) -> ASCII 'd' - TUNING_LOG level set to debug when --verbose, info otherwise - Checkpoint path auto-derived from output path stem - Verified end-to-end: 1.43M Zurichess positions, 8 threads, 2 passes, MSE 0.0725 -> 0.0701, 104/122 params changed, 7 min total
- Add TuningOutput class (TuningOutput.h/.cpp):
- writeParamsYaml(): flat-key format matching config/eval.yaml, array
elements coalesced into comma-separated values (e.g., KING_SAFETY_TABLE:
0,5,15,...). Header with timestamp and K value.
- writeComparisonReport(): side-by-side table with original, tuned, delta,
change%. Statistics: total/changed/unchanged/sign-flipped/zeroed-out.
Flags: SIGN-FLIP for polarity reversal, ->ZERO for removal candidates.
- printComparisonSummary(): console summary with top-N movers
- generateParamsYaml() / generateComparisonReport(): string variants for
testing
- Integrate into TunerMain.cpp: generates <output>.yaml and
<output>_comparison.txt after tuning, prints console summary. Replaces
inline top-movers code with TuningOutput calls. Fix duplicate outPath
variable.
- Fix UTF-8 em dash in report header (garbled on Windows console)
- 18 new tests (TuningOutputTest.cpp):
- YAML: header content, scalar params, array coalescing, empty params,
file creation, bad path error
- Report: header, statistics, all params present, delta values, sign-flip
flag, zero flag, unchanged flag, file creation, bad path
- Registry: real param YAML generation, real param comparison report
- Edge cases: all unchanged, percentage calculation, from-zero percentage
- Verified end-to-end: 49K dataset, output YAML loadable format, comparison
report with correct statistics and flags
- Update progress docs: mark 6.9 complete, next step 6.10
- 37 new edge-case tests across all Phase 6 components (196 total pass): TuningDatasetTest (+7): duplicate FENs accepted, maxEntries limit, maxEntries=0 unlimited, out-of-range results rejected, only-comments file, single-entry split, reserve no-op. TuningParameterTest (+8): applyToConfig beyond max bounds, negative beyond min, delta default=1, expanded count pinned at 122, single-element array contract, array index/size validation, originalValue matches currentValue on fresh build. TexelTunerTest (+10): setupEvalOverrides verification (lazy eval/pawn TT disabled, space/coordination enabled), setK/getK round-trip, near-zero MSE for perfect prediction, all-draws dataset, all-white-wins dataset, eval perspective with known material advantage, single-parameter convergence, tuneK parallel vs single-thread consistency, hasEvaluator state tracking, end-to-end integration test (tuneK -> coordinate descent -> checkpoint -> YAML output -> comparison report -> verify all files valid). TuningStateTest (+6): captureFromParams empty vector, restoreToParams empty state, parameter order preserved through save/load, partial checkpoint with missing K field, large param vector (122) round-trip, extreme values (INT_MAX/INT_MIN). TuningOutputTest (+6): single-element array coalescing, all-params- changed report, large negative delta with sign-flip flag, mixed scalars and arrays in YAML. - Update progress docs: mark 6.10 complete, finalize Phase 6 code
- Reorganize results/: move Manual_Tracking.md and eval_timings.txt to results/misc/, add output.txt and tsan_output.txt - Remove stale matchesv1.5_vs_v1.4_300s_TTbuckets.pgn - Add baseline tuning results for 3 datasets (results/tuning/): zurichess_1 (1.43M pos), dev_49k, selfplay_4 - YAML outputs, checkpoints, and comparison reports - Update PLAN_Texel_Tuning.md: Phase 7 real tuning details - Update PLAN_Texel_Tuning_Progress.md: Phase 6 complete status - .gitignore cleanup
- Wrap tuning source/test file discovery in test/CMakeLists.txt with 'if (NOT FRANKYCPP_PRODUCTION)' guard, matching src/CMakeLists.txt which already excludes tuner/extractor executables from PROD builds - In PROD mode, CONFIG_CONST members are static constexpr and cannot be assigned to; tuning code (TexelTuner::setupEvalOverrides, TuningParameterTest CONFIG_OVERRIDE calls) requires mutable config - Fix constexpr std::vector in TuningOutputTest.cpp (MSVC rejects it)
…r extractor and optimizer components, and clarify production build exclusions
Add ExePath utility (common/ExePath.h/.cpp) providing getExecutableDir() and resolvePathRelativeToExe() using platform APIs (GetModuleFileNameW on Windows, readlink /proc/self/exe on Linux) with CWD fallback. Apply exe-relative resolution to: - Config YAML paths (ConfigPaths.h) - Log file paths (Logging.h) - Opening book path (Search.cpp) - CLI config file (main.cpp) - Arena engine dir= for cutechess-cli (MatchRunner.cpp) This ensures the engine loads its own config/books/logs regardless of how it is launched (cutechess-cli, GUI, different shell directory). Update ConfigAutoInitTests to use explicit paths instead of ScopedCwd since CWD manipulation no longer affects config resolution.
Add uci_log_lvl option to Logger::init() — UCI protocol file logging level is now configurable via CLI (--uci_log_lvl) and config file (uci_log_lvl=warn) instead of hardcoded trace. Default remains trace for backward compatibility. Minor cleanups: - UciHandler.cpp: remove redundant engine:: namespace qualifiers - PositionExtractor: remove unused lambda capture, simplify parens - PositionExtractor.h: expand output format documentation - TuningDataset.h: add format rationale and method documentation - TuningDataset.cpp: remove redundant parens in ternary - TuningParameter.cpp: add ReSharper disable annotations
Apply converged Texel tuning results from 50-pass coordinate descent on 4.57M selfplay positions (K=1.009, MSE 0.0918 -> 0.0878, -4.4%). Key parameter changes: - TEMPO: 34 -> 4 (largest single change, -88%) - BISHOP_PAIR: 30/45 -> 52/66 (strong increase) - Threats: large increases across all tiers (most underweighted) - QUEEN_MOBILITY_END: 1 -> 11, QUEEN_TROPISM_END: 1 -> 20 - ROOK_OPEN_FILE_MID: 10 -> 24, ROOK_7TH_RANK_MID: 15 -> 41 - KNIGHT_OUTPOST_SUPPORTED_MID: 20 -> 39 - CONNECTED_ROOKS re-enabled (END=46, MID zeroed: sign-flip) - MINOR_CONNECTIVITY re-enabled (MID=1, END=5) Sign-flipped params zeroed per review: - SPACE_BONUS (confirmed dead in all 3 datasets) - BAD_BISHOP_PER_PAWN (zeroed in all 3 datasets) - Several low-mobility penalties (zeroed by tuner) - KING_SHIELD_MID, KING_SEMIOPEN_FILE, SAFE_CHECK_BISHOP (zeroed) All USE_* toggles now explicit in eval.yaml (not relying on defaults). Arena config: bump gauntlet rounds to 200, benchmarks to threads=1. Test suite results: 65.0% overall (STS 62.8%, WAC 94.0%).
Gauntlet match: v1.7 (tuned) vs v1.6, 300s+0, 200 rounds Test suite JSONs (8 suites): STS 62.8%, WAC 94.0%, overall 65.0% Tuning review: selfplay 4.57M parameter analysis and recommendations Tuning output: full 50-pass console log for provenance
Add ConfigManager::resetToHardcodedDefaults() that resets to pure .h struct defaults (fallbackSearch_/fallbackEval_), ignoring YAML loaded at startup. This gives tests a clean baseline independent of tuning. EvaluatorTest: call resetToHardcodedDefaults() at the start of set_eval_config() so all numeric eval weights start from header defaults. Fixes 9 failing tests caused by tuned YAML values zeroing out penalties (bad bishop, pawn storm, king open file, space eval) or inverting orderings (rook file bonuses). ConfigAutoInitTests: replace hardcoded tunable values (TEMPO=34, TT_SIZE_MB=256) with stable assertions: - DefaultPathsLoadWhenPresent: check CONFIG_SOURCE markers instead - ResetReturnsToInitiallyLoadedDefaults: capture-then-compare pattern TexelTunerTest: minor cleanup (unused variable, std::ranges::sort).
…700) Match results: - v1.7 vs v1.6: 88W/65D/47L, +72.2 ELO (200 games) - v1.7 vs Stockfish 18 @2700: 101W/37D/62L, +68.6 ELO (200 games) - Test suites: 1939/2984 (64.98%), +56 positions vs v1.6 Updated plan/progress documents to mark Phase 7 complete. Added match PGNs and JSON result files.
….h defaults, adjust deactivation list, and outline re-tuning process
Sprint 8.1b — Deactivate removal candidates: - ConfigRegistry.cpp: Set tunable=false on 10 dead weight entries: SPACE_BONUS_MID/END, BAD_BISHOP_PER_PAWN_MID/END, KNIGHT_LOW_MOBILITY_LEQ2_MID/END, BISHOP_LOW_MOBILITY_LEQ3_MID, ROOK_LOW_MOBILITY_LEQ3_MID/END, SAFE_CHECK_BISHOP_MID - TexelTuner.cpp: Remove 3 redundant overrides from setupEvalOverrides() (USE_SPACE_EVAL, USE_CONNECTED_ROOKS, USE_MINOR_CONNECTIVITY — defaults already correct after 8.1a sync) Sprint 8.2 — Update test expectations: - ConfigRegistryTest: tunable count 88 -> 78, remove SPACE_BONUS_MID from mustBeTunable list - TuningParameterTest: expanded count 122 -> 112 - TexelTunerTest: USE_SPACE_EVAL expectation true -> false - TuningStateTest: synthetic param count 122 -> 112 (cosmetic) ROOK_MOBILITY_MID_PER_MOVE kept tunable — tuner converged to 2 (not dead). Revised scope: 6 features / 10 entries (was 7/11 in original plan).
- Added Release/FrankyCPP_v1.7_phase7.zip as phase 7 baseline reference - Updated Release/FrankyCPP_v1.7.zip with current build - Updated PLAN_Texel_Tuning_Progress.md with phase 8 analysis - Added phase 8 retune results (yaml, checkpoint, comparison, output) - Fixed TunerMain.cpp hard-coded output to use actual config values
Set start_dir to the engine's parent directory when launching UCI engine subprocesses so engines can find their local config files (e.g., config/FrankyCPP.cfg). This mirrors cutechess-cli's dir= parameter behavior. v1.7+ engines use ExePath.h and don't need this, but older engines do.
Eval defaults updated to Phase 8 retune values (4.57M selfplay positions): - EvalConfigData.h: updated compiled-in defaults - eval.yaml: mirrors new defaults (commented out) - ConfigRegistry.cpp: mark 3 dead-weight params as non-tunable (DOUBLED_PAWN_MID_WEIGHT, CONNECTED_ROOKS_MID_BONUS, THREAT_BY_MINOR_ROOK_END) Match results: - v1.7 Phase 8 vs Phase 7 (300+0): 100 rounds - v1.7 Phase 8 vs v1.6 (300+0): 100 rounds - Stockfish 2700 match skipped (stopped) Test suite results (v1.7, 2026-03-29): - franky_tests, mate_test_suite, wac, STS1-STS15, crafty_test, ecm98, kaufman, eigenmann-rapid-engine Tests updated: tunable count 78->75, expanded count 112->109, TEMPO default 4->3, arena.yaml match configs.
Search timing improvements: - Measure wall time from timer-triggered stop to sendResult (join helpers, select best thread, build result) via EMA (30/70 smoothing, 10ms floor, 200ms cap) - Timer fires early by measuredPostStopOverheadMs so bestmove arrives within the allocated time budget - Extra time cap now also considers remaining clock time minus overhead, preventing overshooting in fast games where MAX_EXTRA_TIME_FACTOR * base could exceed actual remaining time - Reorder run() post-search: move logging/cleanup before sendResult to minimize latency between result-ready and bestmove output Arena integration: - Add timeMargin config (default 200ms) for cutechess-cli -timemargin flag to compensate for GUI-side time accounting overhead - MatchRunner passes -timemargin to cutechess-cli command line Tests: - extraTimeClockCap: verifies clock-based cap is tighter than factor cap - startTimerWithOverhead: verifies timer fires early by overhead amount - Existing tests updated with explicit clock/overhead values to isolate the feature under test Also: fix duplicated timerStopTime/stoppedByTimer assignment in timer, fix FEN missing move counters in SearchTest.
Arena: - Fix cutechess timemargin: use per-engine 'timemargin=N' in -each block instead of invalid global '-timemargin N' flag - Add timeMargin, recover, draw/resign adjudication config fields to ArenaConfig with Fishtest/OpenBench defaults - Update arena.yaml: TC gauntlet matches use self-play v1.7 vs v1.7_B with Threads=4, Hash=256 (default), OwnBook=false Results (2,204 games, zero time forfeits): - 1+0.01: 500g, depth 8, 7 min, 21% draws - 2+0.02: 500g, depth 10, 16 min, 34% draws - 5+0.05: 500g, depth 12, 41 min, 39% draws - 10+0.1: 500g, depth 14, 81 min, 47% draws - 60+0.6: 204g, depth 19, 3h30m, 55% draws Docs: - Add RESEARCH_Testing_Framework_Settings.md (Fishtest/OpenBench conventions, recommended FrankyCPP dev TCs, threading guidance) - Add TC_gauntlet_results.md with full analysis
Remove 14 eval parameters/features zeroed or sign-flipped across all tuning datasets and confirmed dead through Phase 8 gauntlets (+77.7 ELO vs v1.6 maintained, -6.9 ELO vs Phase 7 = neutral). Removed features: - Space eval: evaluateSpace(), USE_SPACE_EVAL, SPACE_BONUS_MID/END - Bad bishop: BAD_BISHOP_PER_PAWN_MID/END - Knight low mobility: KNIGHT_LOW_MOBILITY_LEQ2_MID/END - Bishop low mobility MID: BISHOP_LOW_MOBILITY_LEQ3_MID (keep END: -26) - Rook low mobility: ROOK_LOW_MOBILITY_LEQ3_MID/END - Safe check bishop MID: SAFE_CHECK_BISHOP_MID - Doubled pawn MID: DOUBLED_PAWN_MID_WEIGHT (keep END) - Connected rooks MID: CONNECTED_ROOKS_MID_BONUS (keep END) - Threat by minor rook END: THREAT_BY_MINOR_ROOK_END (keep MID) - Pinned at 0: PAWN_STORM_MID_PENALTY[0], PAWN_ADVANCE_END_BONUS[0] Partial removals include comments explaining why the other phase is absent (Texel tuning evidence). Stats: -503 lines deleted, +199 added across 18 files. NPS: 2,514,316 (1T, d12) = +3.5% vs v1.6, +0.6% vs Phase 8. All unit tests pass. Smoke test OK.
Phase 10 gauntlet results: - Gauntlet D (v1.7 vs v1.7_B, 10+0.1, 500 games): -16 ELO (neutral) - Gauntlet E-2 (v1.7 vs v1.6, 300+0, 100 games): +59.6 ELO (confirmed) Stalled connection investigation and workaround: Initial Gauntlet E (10+0.1, 500 games) showed -96.2 ELO — entirely an artifact. 211/500 games (42%) ended by stalled connection, all v1.7 losses. Root cause: cutechess-cli with timemargin=200 sends negative wtime/btime when an engine slightly overshoots its clock. UciHandler::readSearchLimits() rejected go commands with wtime/btime <= 0 (including opponent's clock) without sending bestmove, causing the GUI to declare stalled connection. UciHandler.cpp workaround: - Own time <= 0: log uciError, clamp to 1ms, continue search - Opponent time <= 0: log warning, set to 0ms, continue search - Engine always responds with bestmove (never silently drops go) - Fix copy-paste typo: 'time for white' -> 'time for black' ArenaConfig.h: timeMargin default 200 -> 0 (strict by default) arena.yaml: explicit timeMargin: 200 on all multi-threaded match templates. Documentation updated. Re-ran Gauntlet E at 300+0 to avoid issue with unfixed v1.6 binary. Result: +59.6 ELO, consistent with Phase 7 (+72) and Phase 8 (+78) within the confidence interval for 100 games.
10.3: eval.yaml header updated to reflect final v1.7 state (Phase 9 cleanup, 14 params removed/pinned). All values commented out — EvalConfigData.h compiled-in defaults are the single source of truth. 10.4: Documentation updated: - README.md: v1.7 description 'Texel Tuning & Eval Cleanup (+60-78 ELO vs v1.6)' - src/tuning/README.md: all 11 phases marked complete - PLAN_Texel_Tuning.md: status updated to Complete 10.5: Progress document updated with final status for steps 10.3-10.5, gate passed. Only 10.6 (tag and release) remains.
…ions for WSL builds
Texel Tuning plans finalized and archived: - Mark Phase 10.6 (tag and release) as complete - Move PLAN_Texel_Tuning.md and Progress.md to docs/archive/ - Update all cross-references (5 files) V1 roadmap documents condensed (~75% smaller): - V1_ENGINE_ENHANCEMENT_PLAN.md: 1120 -> ~280 lines - V1_ENGINE_STRENGTH_ROADMAP.md: 1147 -> ~280 lines - Completed phases summarized to 2-5 lines each - Open items (Phase 4/6 partial, Phase 8 NNUE, Phase 9 CPU) retain details - Added v1.6 (+81 ELO) and v1.7 (+60-78 ELO) results - Updated cumulative ELO to ~+400-470 vs v1.1 General docs updated to reflect v1.7 state: - Architecture.md: added common/pgn/, tuning/ modules, build targets v1.7 - FrankyCPP_Codebase_Review.md: added v1.6/v1.7 cycles, updated eval table (Texel-tuned), marked 6 suggestions as done, added E11-E14 tasks - INDEX.md: consolidated archived specs, added Texel tuning references, updated documentation status
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.
Pull Request:
dev_1.7.0→masterTitle
v1.7.0 — Texel Tuning & Eval Cleanup (+60–78 ELO vs v1.6)
Description
This release implements Texel Tuning (Peter Österlund's method) for FrankyCPP's classical hand-crafted evaluation. All ~85 eval weight parameters were optimized simultaneously via coordinate descent against 4.57M self-play positions, followed by a full eval cleanup removing 14 dead features confirmed by the tuner.
Headline result: +60–78 ELO over v1.6, +3.5% NPS improvement, 503 lines of dead eval code removed.
Major Features
🎯 Texel Tuning Infrastructure (Phases 1–6)
src/common/pgn/): Extracted and generalized from OpeningBook — streaming + batch APIs, full PGN spec support, 30+ unit testssrc/tuning/extractor/): CLI tool with 6 configurable filters (early moves, checks, captures, endgame, qsearch, score contradiction)src/tuning/optimizer/): Multi-threaded coordinate descent with sigmoid MSE, automatic K-tuning, incremental MSE via activation flags, monotonicity constraints for array params, YAML checkpoint/resume, comparison reports📊 Tuning Results (Phase 7)
🧹 Eval Cleanup (Phases 8–9)
🔧 Engine Improvements
gocommand — engine always responds withbestmove--uci_log_lvlCLI optionGauntlet Results Summary
Test Suite: 1939/2984 (65.0%), +56 positions vs v1.6
Commits Since v1.6.0
Texel Tuning Infrastructure:
d3e4e14Phase 1.1-1.4: PGN parser library, types, and unit testsca82be9Phase 1.5-1.6: Migrate OpeningBook to use PgnParser9b92596Phase 2: Add tuning build targets (Extractor + Tuner scaffolding)e430c5aPhase 4: Position Extractor with qsearch and score filters7374140Phase 5: Mark 88 eval weight params as tunable for Texel tuningbcae348Phase 6.1: TuningDataset loader with FEN+result parsingde52c32Phase 6.2: TuningParameter mapping (registry → flat param vector)c91bc40Phase 6.3: TexelTuner core — sigmoid, MSE, K-tuning67dce28Phase 6.4: Parallel MSE + coordinate descent loopc23f2fdPhase 6.5: Incremental MSE with activation flagsaffe417Phase 6.6: Monotonicity constraint enforcement for arrays9910883Phase 6.7: TuningState checkpoint save/load (YAML)1aa4ceePhase 6.8: Wire up TunerMain.cpp with full CLI pipeline2aea588Phase 6.9: Tuned parameters YAML output + comparison report1a3ab5ePhase 6.10: Comprehensive unit tests (196 total pass)Tuning & Eval Optimization:
3073a96Apply Texel-tuned eval params (selfplay 4.57M, 50-pass)03e34a2Phase 7 complete: +72 ELO vs v1.6, +69 vs SF@2700635020cPhase 8.1b+8.2: Deactivate 10 dead eval featuresc6bc5daPhase 8: Texel retune eval defaults + match resultsda52812Phase 9: Remove 14 dead eval features (−503 lines)5ffd12aPhase 10: Final gauntlet validation (+59.6 ELO confirmed)3bb00c7Phase 10.3-10.5: Final documentation and eval.yaml updatesEngine Features & Fixes:
081cd0dResolve config/book/log paths relative to executable directory7069357Add configurable UCI log level + minor cleanups8796523Dynamic post-stop overhead measurement and adaptive time management5ffd12aFix stalled connection: clamp negative wtime/btime, always send bestmoveef4c9faFix UCIEngine to set working directory to engine's parent path3b64a7eMake evaluator/config tests independent of YAML config valuesa1f92cbTC Gauntlet calibration + cutechess timemargin fix8b6739bFix PROD build: exclude tuning tests from production executablef209e17Consistent type casting for time calculations (WSL builds)