Skip to main content

TranspositionTable

Struct TranspositionTable 

Source
pub struct TranspositionTable { /* private fields */ }

Implementations§

Source§

impl TranspositionTable

Source

pub fn new(bucket_count_pow2: u32) -> Self

bucket_count_pow2: 버킷 수 = 2^N. 예: 16 → 65 536 버킷 = 2 MB.

Source

pub fn clear(&mut self)

모든 슬롯 비우기 (탐색 시작 시). 카운터는 보존 — search() 호출 누적.

Source

pub fn reset_stats(&self)

진단 카운터 리셋 (한 search() 단위 측정 시작 시).

Source

pub fn stats(&self) -> TtStats

Source

pub fn occupancy(&self) -> (usize, usize, usize)

Bucket 점유율 — (non-empty depth_pref 수, non-empty always_replace 수, 총 bucket 수). search 끝난 직후 호출하면 saturation 측정 가능.

Source

pub fn probe(&self, key: u64) -> Option<TtEntry>

Lookup. 키 일치하는 entry 있으면 반환.

Source

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” 역할을 함.

Source

pub fn capacity(&self) -> usize

Source

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.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.