At a glance
What matters first
- What it is
- Rust Ashton Tablut player for the University of Bologna AI Fundamentals Tablut Challenge.
- My role
- Built the protocol adapter, local rule engine, compact state model, deadline-aware search, and final guard.
- Core stack
- Rust, framed JSON over TCP, u128 occupancy masks, packed moves, alpha-beta, transposition table.
- Best evidence
- Engine-flow visual from framed JSON input to validated action output under a fixed deadline.
Engine Flow
Kyndill is a Rust player for a strict referee protocol and deadline. Each turn arrives as framed JSON over TCP with a 4-byte big-endian length prefix. The adapter decodes that payload into typed local state before the engine searches.
The local rule engine mirrors Ashton Tablut rules for a 9 x 9 board. It owns move generation, capture checks, king escape conditions, and legal children, so the search code never constructs protocol actions directly.
Engine flow
From referee state to legal action
Referee framed JSON
TCP payload with a 4-byte big-endian length prefix.
Protocol adapter
Decode role, board, turn, and deadline inputs.
Typed state
Convert external state into checked local structures.
Local rule engine
Generate only legal Ashton Tablut moves.
Compact search state
Use occupancy masks, packed moves, and hashing.
Iterative deepening
Search completed depths with alpha-beta pruning.
Candidate move
Keep the best fully completed legal result.
Final guard
Recheck legality and deadline pressure before send.
Framed JSON action
Return one validated move to the referee.
Compact board state
The search core works from a small trusted state instead of repeatedly interpreting referee payloads.
- Board
- 9 x 9 Ashton Tablut state
- Masks
- u128 occupancy bitsets
- Moves
- Packed move representation
- Table
- Transposition table entries
Fallback before timeout
- Budget opens
The turn starts with a fixed response window.
- Depths complete
Iterative deepening stores only completed legal results.
- Abort pressure
Deeper work stops as the deadline approaches.
- Legal fallback
The player sends the last completed result or a deterministic prevalidated fallback.
Search Under Deadline
The engine uses deterministic iterative-deepening alpha-beta search. A completed depth stores a legal best result before the engine attempts the next depth, which keeps useful work available under deadline pressure.
The search path uses compact u128 occupancy masks, packed moves, incremental hashing, a bounded transposition table, and killer and history ordering.
Safety Guard
The last step before writing a response is a legality and time guard. If deeper search cannot finish safely, Kyndill keeps the last completed iterative-deepening result or sends a deterministic prevalidated fallback.
Safety boundary
- Decode
Read the framed JSON payload and convert it into trusted local state.
protocol - Generate
Build legal Ashton Tablut moves from the local rule engine.
rules - Search
Run completed iterative-deepening alpha-beta depths inside the move budget.
engine - Guard
Send only a currently legal move, or use the deterministic fallback before timeout pressure wins.
deadline
Implementation Notes
- V4 is the default runtime profile.
- White uses static installed weights tuned offline.
- Black stays frozen as a manually tuned asymmetric path.
- Runtime play uses installed static profiles only.
- The engine-flow visual traces the path from protocol input to validated action output.