diff options
| author | Scott Gasch <[email protected]> | 2026-10-05 22:21:15 -0700 |
|---|---|---|
| committer | Scott Gasch <[email protected]> | 2026-10-05 22:21:15 -0700 |
| commit | a8308030473f56f84a9a8c7179fe029524c68b3a (patch) | |
| tree | 484d50b7858c57e06a066943b5cf24ede0ef403b | |
| parent | c03e7de56b316f83592ec39ce098a204628009cf (diff) | |
Fix stale pawn-hash comments (size, lock claim)
PAWN_HASH_TABLE_SIZE's "5.5Mb" comment predates iBishopColorScore
growing PAWN_HASH_ENTRY to 80 bytes (131072 * 80 == 10Mb, not 5.5Mb).
PawnHashLookup's "multi-probing scheme...to remove contention on MP
machines" doesn't describe the code: it's a single direct-indexed
probe into ctx->rgPawnHash, which is embedded per-thread inside
SEARCHER_THREAD_CONTEXT, so there's no cross-thread contention to
avoid in the first place.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
| -rwxr-xr-x | src/chess.h | 2 | ||||
| -rw-r--r-- | src/pawnhash.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/chess.h b/src/chess.h index b0be749..7125cc7 100755 --- a/src/chess.h +++ b/src/chess.h @@ -1736,7 +1736,7 @@ typedef struct _PLY_INFO } PLY_INFO; -#define PAWN_HASH_TABLE_SIZE (131072) // 5.5Mb (per thread) +#define PAWN_HASH_TABLE_SIZE (131072) // 10Mb (per thread; sizeof(PAWN_HASH_ENTRY) == 80) typedef struct _PAWN_HASH_ENTRY { UINT64 u64Key; diff --git a/src/pawnhash.c b/src/pawnhash.c index 8af2138..23c0cb0 100644 --- a/src/pawnhash.c +++ b/src/pawnhash.c @@ -34,8 +34,10 @@ Routine description: POSITION. If so, "check out" that entry and return a pointer to it. - Note: there is a multi-probing scheme in place to remove - contention on MP machines. + Note: a single direct-indexed probe, no multi-probing scheme -- + ctx->rgPawnHash is embedded per-thread inside SEARCHER_THREAD_ + CONTEXT (chess.h), so there's no cross-thread contention to + avoid here in the first place. Parameters: |
