From 917bf1260ae217bdcbdbc11c2c37cdb5d3a8eae9 Mon Sep 17 00:00:00 2001 From: Scott Gasch Date: Sat, 29 Aug 2026 00:30:53 -0700 Subject: Switch to Crafty-style killer ordering; fix mvNullmoveRefutations type-mixing bug and add a quiet-refutation killer backfill. Killer tiers now try both of this ply's own killers before either ply-2-back one, matching Crafty's ordering. Two earlier attempts at this same swap were reverted for regressing; this pass lands on top of NumLeftoverMovesToSelect (more SelectBestWithHistory budget to reach these lower-tier slots) and a real bug fix below, and beats interleaved order head-to-head on solves, node count, and first-move beta cutoff across the three curated suites. The bug: mvNullmoveRefutations's empty-killer-slot backfill could only ever contain a capturing move (TryNullmovePruning only wrote it inside the capture-refutation branch), but IS_SAME_MOVE's mask includes the pCaptured bits, so that backfilled value could never match a real quiet candidate -- the backfill was silently dead code. Fixed by recording genuinely quiet null-move refutations into a new, separate mvNullmoveQuietRefutations array (kept separate so it can't clobber the capture history mvNullmoveRefutations still needs for the Botvinnik-Markoff same-piece-two-squares extension check) and backfilling the regular killer table from that instead. The check-evasion killer table intentionally does *not* get this backfill: a null-move refutation can never legitimately be an escaping-check move (null moves can't deliver check), so backfilling there risks IS_SAME_MOVE cross-context false positives instead of the old guaranteed-inert no-op. Measured at sd10 across ecm_ringers/ecm_confident_quick/ecm_hard_quick against head_reference (commit d11e973): 115/191 solves (vs. 116 baseline), 924.36M total nodes (vs. 933.23M), first-move beta cutoff within 0.1-0.9 points of baseline on all three suites -- and clearly better than the same fix under interleaved order (113/191 solves, 963.10M nodes), which loses to head_reference on every metric. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01EortUUkDVpsfrbqshBJYJg --- src/CLAUDE.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'src/CLAUDE.md') diff --git a/src/CLAUDE.md b/src/CLAUDE.md index e286cd9..c7c7e4a 100644 --- a/src/CLAUDE.md +++ b/src/CLAUDE.md @@ -4,6 +4,20 @@ A chess engine by Scott Gasch (scott.gasch@gmail.com), originally started 2004. Previously named "monsoon" -- any old references to that name mean this same codebase. Speaks the xboard/WinBoard protocol. FreeBSD host, 64-bit. +## Scratch files and logs + +**Put ad-hoc test/debug output under `/tmp/typhoon/`, not loose in `src/` or +loose in `/tmp` itself.** Past sessions repeatedly dropped one-off ECM run +logs, build logs, bisect binaries, and gprof output directly into `src/` +(`ecm_v17_sn4m.stdout`, `lmr_A.log`, stray `typhoon_*` binaries, etc.) and +directly into `/tmp` (`build6.log`, `nn_ringers.log`, `typhoon_pool_test3/`, +multi-hundred-MB `typhoon_gprof.txt`, etc.), both of which build up +uncommitted clutter that's easy to mistake for something meaningful and +tedious to clean up later. Anything that isn't a deliberately-kept +comparison baseline (`head_reference/`, the curated suites in `tests/`, +`eval_tune/`'s pipeline scripts and `.dna` outputs) is scratch and belongs +under `/tmp/typhoon/`. + ## Building `build.sh`'s OS detection (`expr $OSTYPE = "darwin"`) is broken in this shell @@ -67,6 +81,26 @@ Not a config issue; the fix is downloading the missing 6-man `.rtbw` files. `sd 10` (or similar) holds search effort constant so a solve-rate difference is actually attributable to the eval change being tested. +**Invocation**, matching what `test.sh` and `head_reference/logs/` use -- +piping commands over stdin does not reliably run a `script` command to +completion; use `--batch --command` instead, with the opening book pointed +at a nonexistent path so early moves aren't book lookups (see the +`match_play.py` bugs below for why that matters) and explicit `--hash`/ +`--cpus` rather than the tiny memset-zero defaults: + +```sh +./typhoon --cpus 1 --hash 256m --logfile /tmp/typhoon//sd10_.log \ + --batch --command "force; book name /nonexistent.book.bin; sd 10; script ../tests/.ep_" +``` + +**Run these in the background and use Monitor to wait, don't block the +foreground on them.** Each curated suite takes on the order of minutes at +`sd 10`; a `wait` in a synchronous Bash call routinely exceeds a 2-minute +tool timeout even though the run itself is fine. Launch with +`run_in_background: true` (or equivalent), then use Monitor (or just +continue the conversation -- a background command notifies on completion) +rather than polling/sleeping in a loop. + Current baseline (`lastrun.log`, `st 1`, unmodified eval constants): **606/879 solved.** A first full DNA-tuning pass against 600k TWIC positions raised this to **622/879** (see `eval_tune/`). -- cgit v1.3