pub struct TranspositionTable { /* private fields */ }Implementations§
Source§impl TranspositionTable
impl TranspositionTable
Sourcepub fn new(bucket_count_pow2: u32) -> Self
pub fn new(bucket_count_pow2: u32) -> Self
bucket_count_pow2: 버킷 수 = 2^N. 예: 16 → 65 536 버킷 = 2 MB.
Sourcepub fn reset_stats(&self)
pub fn reset_stats(&self)
진단 카운터 리셋 (한 search() 단위 측정 시작 시).
pub fn stats(&self) -> TtStats
Sourcepub fn occupancy(&self) -> (usize, usize, usize)
pub fn occupancy(&self) -> (usize, usize, usize)
Bucket 점유율 — (non-empty depth_pref 수, non-empty always_replace 수, 총 bucket 수).
search 끝난 직후 호출하면 saturation 측정 가능.
Sourcepub fn store(
&mut self,
key: u64,
score: i32,
depth: u8,
bound: Bound,
best_move: Option<Move>,
)
pub fn store( &mut self, key: u64, score: i32, depth: u8, bound: Bound, best_move: Option<Move>, )
Store. depth-preferred slot에 더 깊거나 같으면 저장, 아니면 always-replace slot으로.
Push-down 정책 (0.6.2~): depth_pref에 새 entry가 들어가야 할 때 기존 entry가 비어있지 않으면 그걸 always-replace로 밀어낸다. 이전 정책은 displaced된 entry를 그냥 버려서 always-replace slot이 거의 비어있는 채로 활용 안 됨 (진단 2026-04-27: always 사용률 2.1%). Push-down 후엔 always-replace가 “두 번째로 좋은 entry” 역할을 함.
pub fn capacity(&self) -> usize
Sourcepub fn prefetch(&self, key: u64)
pub fn prefetch(&self, key: u64)
Prefetch the bucket for key into L1 cache. Hides ~50-100 ns of
memory-load latency before the actual probe() lands. Call this
in the search loop as soon as you know the next zobrist key
(e.g. via current_zob ^ stone_key ^ ZOBRIST_SIDE) but before
committing the move + recursing.
_MM_HINT_T0 = “load into all cache levels” (most aggressive).
Spurious prefetches are harmless on x86_64; on non-x86 the call
is a no-op.