Documentation ¶
Index ¶
- Constants
- Variables
- type DebugTableEntry
- type DebugTranspositionTable
- type FakeLock
- type PVLine
- type Solver
- func (s *Solver) ClearKillers()
- func (s *Solver) Game() *game.Game
- func (s *Solver) Init(m movegen.MoveGenerator, game *game.Game) error
- func (s *Solver) QuickAndDirtySolve(ctx context.Context, plies, thread int) (int16, []*move.Move, error)
- func (s *Solver) SetFirstWinOptim(w bool)
- func (s *Solver) SetIterativeDeepening(id bool)
- func (s *Solver) SetKillerPlayOptim(k bool)
- func (s *Solver) SetThreads(threads int)
- func (s *Solver) SetTranspositionTable(tt *TranspositionTable)
- func (s *Solver) SetTranspositionTableOptim(tt bool)
- func (s *Solver) SetZobrist(z *zobrist.Zobrist)
- func (s *Solver) Solve(ctx context.Context, plies int) (int16, []*move.Move, error)
- type TableEntry
- type TableLock
- type TinyMove
- type TranspositionTable
Constants ¶
View Source
const ( TTExact = 0x01 TTLower = 0x02 TTUpper = 0x03 )
View Source
const BlanksBitMask = 127 << 12
View Source
const ColBitMask = 0b00111110
View Source
const EarlyPassOffset = 21000
View Source
const HashMoveOffset = 6000
View Source
const HugeNumber = int16(32767)
View Source
const Killer0Offset = 20000
View Source
const Killer1Offset = 19000
View Source
const MaxKillers = 2
View Source
const MaxLazySMPThreads = 6
View Source
const MaxVariantLength = 25
View Source
const RowBitMask = 0b00000111_11000000
Variables ¶
View Source
var (
ErrNoEndgameSolution = errors.New("no endgame solution found")
)
View Source
var TBitMasks = [7]uint64{63 << 20, 63 << 26, 63 << 32, 63 << 38, 63 << 44, 63 << 50, 63 << 56}
Functions ¶
This section is empty.
Types ¶
type DebugTableEntry ¶
type DebugTableEntry struct {
// contains filtered or unexported fields
}
type DebugTranspositionTable ¶
type DebugTranspositionTable struct {
// contains filtered or unexported fields
}
type PVLine ¶
Credit: MIT-licensed https://github.com/algerbrex/blunder/blob/main/engine/search.go
type Solver ¶
type Solver struct {
// contains filtered or unexported fields
}
func (*Solver) QuickAndDirtySolve ¶
func (s *Solver) QuickAndDirtySolve(ctx context.Context, plies, thread int) (int16, []*move.Move, error)
QuickAndDirtySolve is meant for a pre-endgame engine to call this function without having to initialize everything. The caller is responsible for initializations of data structures. It is single-threaded as well.
func (*Solver) SetFirstWinOptim ¶
func (*Solver) SetIterativeDeepening ¶
func (*Solver) SetKillerPlayOptim ¶
func (*Solver) SetThreads ¶
func (*Solver) SetTranspositionTable ¶
func (s *Solver) SetTranspositionTable(tt *TranspositionTable)
func (*Solver) SetTranspositionTableOptim ¶
func (*Solver) SetZobrist ¶
type TableEntry ¶
type TableEntry struct {
// contains filtered or unexported fields
}
16 bytes (entrySize)
type TinyMove ¶ added in v0.7.1
type TinyMove uint64
TinyMove is a 64-bit representation of a move. We can probably make it smaller at the cost of higher decoding. It is made to be as small as possible to fit it in a transposition table.
type TranspositionTable ¶
type TranspositionTable struct { TableLock // contains filtered or unexported fields }
func (*TranspositionTable) Reset ¶
func (t *TranspositionTable) Reset(fractionOfMemory float64)
func (*TranspositionTable) SetMultiThreadedMode ¶
func (t *TranspositionTable) SetMultiThreadedMode()
func (*TranspositionTable) SetSingleThreadedMode ¶
func (t *TranspositionTable) SetSingleThreadedMode()
Click to show internal directories.
Click to hide internal directories.