summaryrefslogtreecommitdiff
path: root/src/chess.h
diff options
context:
space:
mode:
authorScott Gasch <[email protected]>2026-09-08 16:50:55 -0700
committerScott Gasch <[email protected]>2026-09-08 16:50:55 -0700
commitfbb138cc1dd13da2f30129206cdcd3d128344f54 (patch)
tree7055d2344a378c5f9f064490f6b25822166518b6 /src/chess.h
parent434fa0406e1b01395a2b7f0aa481ca5dc367fa09 (diff)
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 <[email protected]> Claude-Session: https://claude.ai/code/session_01Ka9o3S2eKqh4jNfmxVZ6fH
Diffstat (limited to 'src/chess.h')
-rwxr-xr-xsrc/chess.h43
1 files changed, 31 insertions, 12 deletions
diff --git a/src/chess.h b/src/chess.h
index 8d16837..7d01e64 100755
--- a/src/chess.h
+++ b/src/chess.h
@@ -945,6 +945,16 @@ typedef struct _COUNTERS
UINT64 u64EvalHashHits;
UINT64 u64LazyEvals;
UINT64 u64FullEvals;
+ // Placeholder counters for root.c's per-tier eval-exit
+ // reporting -- eval.c's super-lazy exit itself hasn't been
+ // re-applied yet (see stash), so these always read 0 for now;
+ // that's accurate, not a stub bug, since no super-lazy exit
+ // exists in this build to increment them.
+ UINT64 u64SuperLazyEvals;
+ UINT64 u64CyclesSuperLazyExit;
+ UINT64 u64CyclesLazyExit;
+ UINT64 u64CyclesFullEvalExit;
+ UINT64 u64CyclesEvalSuperLazy;
UINT64 u64CyclesInEval;
//
@@ -2812,6 +2822,13 @@ IsDraw(SEARCHER_THREAD_CONTEXT *ctx);
//
#define QPLIES_OF_NON_CAPTURE_CHECKS (2)
#define FUTILITY_BASE_MARGIN (50)
+// Compatibility aliases for root.c/main.c's per-tier reporting, which
+// expects these three names -- search.c hasn't been split into
+// per-tier margins yet (still one flat FUTILITY_BASE_MARGIN), so all
+// three alias the same value until that split is re-applied.
+#define FUTILITY_BASE_MARGIN_FULL FUTILITY_BASE_MARGIN
+#define FUTILITY_BASE_MARGIN_LAZY FUTILITY_BASE_MARGIN
+#define FUTILITY_BASE_MARGIN_SUPERLAZY FUTILITY_BASE_MARGIN
// Measured: disabling this entirely (see lmr_testing/RESULTS.md) is a
// clear net loss across ringers/confident_quick/hard_quick, so IID itself
// is load-bearing. The "is the top move crappy" gate in search.c's DO_IID
@@ -3146,7 +3163,14 @@ PawnHashLookup(SEARCHER_THREAD_CONTEXT *ctx);
extern const int g_iAhead[2];
extern const int g_iBehind[2];
-ULONG
+// No-op placeholder: eval.c's ROOK_FULL_HALF_OPEN_BONUS static cache
+// (the thing InitEval() is meant to (re)build, called at startup and
+// after every DNA reload) hasn't been re-applied yet -- see stash.
+// Nothing to initialize until that cache exists.
+void
+InitEval(void);
+
+ULONG
DNABufferSizeBytes();
char *
@@ -3167,7 +3191,7 @@ SCORE
Eval(SEARCHER_THREAD_CONTEXT *, SCORE, SCORE, SCORE *);
FLAG
-EvalPasserRaces(POSITION *,
+_EvalPasserRacesAgainstLoneKings(POSITION *,
PAWN_HASH_ENTRY *);
ULONG
@@ -3362,17 +3386,12 @@ _WhoAttacksSquareBB(POSITION *pos,
ULONG uSide,
BITBOARD bbOccupied);
-// Three-way choice for which GetAttacks implementation is actually
-// live -- see MIGRATION.md section 6:
-// GETATTACKS_BITBOARD defined -> _GetAttacksBB (bitboard, new)
-// else CROUTINES defined -> SlowGetAttacks (C mailbox)
-// else (default) -> GetAttacks (asm x86/x64 mailbox,
-// the literal function declared above)
-#if defined(GETATTACKS_BITBOARD)
+// _GetAttacksBB is the only implementation as of 2026-09-06 (see
+// MIGRATION.md section 6) -- verified correct and faster than the old
+// asm/CROUTINES mailbox versions (SlowGetAttacks, asm GetAttacks),
+// which have been retired. Every call site written against the name
+// "GetAttacks" didn't need touching when the default changed.
#define GetAttacks _GetAttacksBB
-#elif defined(CROUTINES)
-#define GetAttacks SlowGetAttacks
-#endif
#ifdef _X86_
//