Case study

Kyndill

Timeout-safe Rust game AI for the AI Fundamentals Challenge

A reliability-first Rust Tablut player for the University of Bologna AI Fundamentals Tablut Challenge, centered on protocol safety, legal move generation, strict deadlines, compact board state, and deterministic alpha-beta search.

  • University challenge project
  • Completed
  • Rust
  • Game AI
  • Alpha-beta
  • Heuristics
  • Protocols

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

01

Referee framed JSON

TCP payload with a 4-byte big-endian length prefix.

02

Protocol adapter

Decode role, board, turn, and deadline inputs.

03

Typed state

Convert external state into checked local structures.

04

Local rule engine

Generate only legal Ashton Tablut moves.

05

Compact search state

Use occupancy masks, packed moves, and hashing.

06

Iterative deepening

Search completed depths with alpha-beta pruning.

07

Candidate move

Keep the best fully completed legal result.

08

Final guard

Recheck legality and deadline pressure before send.

09

Framed JSON action

Return one validated move to the referee.

State model

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
Deadline behavior

Fallback before timeout

  1. Budget opens

    The turn starts with a fixed response window.

  2. Depths complete

    Iterative deepening stores only completed legal results.

  3. Abort pressure

    Deeper work stops as the deadline approaches.

  4. 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

  1. Decode

    Read the framed JSON payload and convert it into trusted local state.

    protocol
  2. Generate

    Build legal Ashton Tablut moves from the local rule engine.

    rules
  3. Search

    Run completed iterative-deepening alpha-beta depths inside the move budget.

    engine
  4. 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.