From fbb138cc1dd13da2f30129206cdcd3d128344f54 Mon Sep 17 00:00:00 2001 From: Scott Gasch Date: Tue, 8 Sep 2026 16:50:55 -0700 Subject: Retire asm GetAttacks, recogn.c/fen.c bugfixes, misc bugfixes verified at parity Confirmed self-play regression traced to a stale test_vs_head.sh reference binary (typhoon_allbitboards/550ea81, deleted): every "vs head" comparison since 92fc412 (Sep 4) was checking new work against that fixed Sep-4 snapshot, never against real HEAD or the working tree. Rebuilt clean reference binaries directly from git and re-verified everything from scratch. This commit lands only the pieces confirmed safe against clean 434fa04 (fast st1 match, ~30-40 games, score ~0.44-0.55, consistent with parity; plus a DEBUG-build smoke test pass): - recogn.c, fen.c: real bugfixes - data.c, draw.c, ics.c: whitespace only - x64.asm: retires the asm GetAttacks implementation now that chess.h's GetAttacks macro unconditionally selects the already-verified-faster _GetAttacksBB bitboard version instead of a three-way build-flag toggle (GETATTACKS_BITBOARD/CROUTINES/asm default) - see.c, testsee.c: SEE/test-harness updates supporting that default - root.c: per-tier eval-exit reporting (super-lazy counters currently always read 0 -- accurate, since no super-lazy exit exists yet) - main.c: startup banner update, InitEval() call, TestRecogn() added to the #ifdef TEST self-test sequence - command.c: InitEval() DNA-reload hook, new qsearchfutility diagnostic - dynamic.c: minor changes - chess.h: the GetAttacks default change above, three FUTILITY_BASE_MARGIN_* compatibility aliases (all still equal to the original flat FUTILITY_BASE_MARGIN -- search.c has not been split into per-tier margins here), placeholder super-lazy counters, and an EvalPasserRaces -> _EvalPasserRacesAgainstLoneKings rename (confirmed byte-identical body) to match recogn.c's call site - eval.c: the same rename, plus a no-op InitEval() stub (nothing to initialize until the ROOK_FULL_HALF_OPEN_BONUS cache below exists) Deliberately NOT included: the full eval.c overhaul (~1770 lines) and search.c's qsearch-futility rework (~650 lines), including yesterday's loosened SUPER_LAZY_MARGIN_BY_ARMY/FUTILITY_BASE_MARGIN_BY_SOURCE tables. Reverting just those two tables while keeping the rest of the eval.c overhaul still lost badly to 434fa04 (0.20 over 10 games), so the regression isn't fully explained by the margins alone -- the eval.c overhaul needs careful, incremental re-verification against this commit as the new baseline, not a bulk re-apply. Full original work preserved in git stash (stash@{0} as of this commit) for that follow-up. Note: two pre-existing, position/state-dependent assertion crashes were found during this verification (util.c:1093 WalkPV, recogn.c:1359 _SanityCheckRecognizers), both reproducing on unmodified 434fa04 -- not introduced by anything here, not yet root-caused. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01Ka9o3S2eKqh4jNfmxVZ6fH --- src/draw.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/draw.c') diff --git a/src/draw.c b/src/draw.c index 7b2b1d5..7df10b4 100755 --- a/src/draw.c +++ b/src/draw.c @@ -29,10 +29,10 @@ IsDraw(SEARCHER_THREAD_CONTEXT *ctx) { ULONG uPly; UINT64 u64CurrentSig; - + // // Recognize 50-moves w/o progress draw rule - // + // if (ctx->sPosition.uFifty >= 100) { return(TRUE); @@ -40,7 +40,7 @@ IsDraw(SEARCHER_THREAD_CONTEXT *ctx) // // Check for repeated positions if needed. - // + // if (ctx->sPosition.uFifty < 4) { return(FALSE); @@ -52,7 +52,7 @@ IsDraw(SEARCHER_THREAD_CONTEXT *ctx) while(uPly < MAX_PLY_PER_SEARCH) { #ifdef DEBUG - if ((GET_COLOR(ctx->sPlyInfo[uPly].mv.pMoved) != + if ((GET_COLOR(ctx->sPlyInfo[uPly].mv.pMoved) != ctx->sPosition.uToMove) && (ctx->sPlyInfo[uPly].mv.uMove != 0)) { @@ -65,7 +65,7 @@ IsDraw(SEARCHER_THREAD_CONTEXT *ctx) { return(TRUE); } - + if (IS_PAWN(ctx->sPlyInfo[uPly].mv.pMoved) || (ctx->sPlyInfo[uPly].mv.pCaptured)) { @@ -73,7 +73,7 @@ IsDraw(SEARCHER_THREAD_CONTEXT *ctx) } uPly -= 2; } - + // // Keep looking in the official game record. // -- cgit v1.3