LittlePlyModel + harness

Chapter 03 / The harness

How does an idea become a move on the clock?

Reuse work, coordinate tools, and act before the deadline.

The model is only part of the program

A chess agent must keep the correct board, handle events, plan within a clock, and submit a move that still belongs to the current turn. The harness owns that work.

Its tools are explicit: chess rules, caches, bounded Stockfish assistance and telemetry. A helper-selected move is not a model-only prediction.

Three kinds of reusable work

Inference cache

Reuse policy and WDL for a matching model and history.

KV cache

Reuse Transformer attention computations for a compatible prefix.

Search tree

Retain explored continuations when the actual move follows one of them.

None of these changes the model’s learned weights. Two identical-looking boards can differ in repetition and draw history. Position-only reuse may therefore be unsafe.

Thinking on the opponent’s clock

Pondering explores likely replies before they happen. A hit can carry useful work into the next turn. A miss means some speculative work cannot be reused.

Useful work, not just elapsed time

Ten seconds on our turn plus five on theirs is at most fifteen seconds of opportunity. The real benefit depends on prediction hits, branch coverage, cache validity and contention.

The asynchronous GPU design being tested gives urgent own-turn requests priority over speculative work and keeps game histories isolated. Cross-game batching can improve utilization, but excessive concurrency can reduce depth per game or miss deadlines. It must be measured.

Safe execution is a search feature

Time remaining and increment set the budget. Time must be reserved for queuing, fallback and submission. The harness checks that every result is legal, belongs to the expected history and is still timely.

Crashes, stale results and hangs need bounded recovery. Logs should explain why the move was selected: model, search or helper; time used; cache hit or miss; search stopping reason; and any fallback.

What would convince us the async harness works?

Real-model numerical parity; cache isolation; crash and hang recovery; legal play; measured queue and full-move latency; useful ponder hits; search-depth distributions; and complete-game audits under increasing concurrency.

Clocks and execution →