Skip to content

Shashin Framework

amchess edited this page Mar 5, 2026 · 1 revision

The Shashin Framework: Universal Chess Theory

The framework developed by physicist and chess theorist Alexander Shashin in his book "Best Play: A New Method for Discovering the Strongest Move" is not merely a collection of chess principles, but an attempt to apply physical and thermodynamic laws to the chessboard.

Book Covers

1. Introduction: The Physics of Chess

The central concept is that a chess game is a dynamic system oscillating between states of equilibrium and chaos. The goal of the engine is not to find the "best" move in an abstract sense, but to identify which algorithm to apply based on the current state of the system.

Shashin identifies three fundamental algorithms, personified by three World Champions with archetypal styles:

  1. Tal (Attack / Expansion / Entropy)
  2. Capablanca (Strategy / Equilibrium / Conservation)
  3. Petrosian (Defense / Contraction / Density)

2. The Three Fundamental Algorithms

Shashin decomposes the position into mathematical ratios based on fundamental factors: Material, Mobility, Safety, and Space.

A. The Tal Algorithm (Attack)

Tal

  • Physical Principle: Increase in entropy, expansion, release of kinetic energy.
  • Condition: When the system presents a significant dynamic advantage ($\Delta K > 0$).
  • Goal: Checkmate or decisive material gain.
  • Engine Behavior: Search for forcing lines, sacrifices ($m > 1$ to gain $t > 1$), and disable pruning filters to avoid discarding "absurd" but winning moves. This is the core of the Gold Digger mode.

B. The Capablanca Algorithm (Strategy)

Capablanca

  • Physical Principle: Conservation of energy, dynamic equilibrium, principle of least action.
  • Condition: When the position is balanced ($\Delta K = 0$).
  • Goal: Improve piece placement (Makogonov Principle), accumulate small advantages.
  • Engine Behavior: "Safety First". Prophylaxis, centralization, solid pawn structures. Aggressive pruning is allowed here to calculate main lines deeper.

C. The Petrosian Algorithm (Defense)

Petrosian

  • Physical Principle: Contraction, density, increase in stability to resist external pressure.
  • Condition: When under attack or at a disadvantage ($\Delta K < 0$).
  • Goal: Neutralize the opponent's initiative, build "fortresses".
  • Engine Behavior: Over-protection, restriction of opponent's mobility. The engine accepts passive positions if they are solid.

3. The "Drift Chart" and Delta Kappa ($\Delta K$)

The mathematical heart of the system is the Drift Chart, which maps every position onto a continuous spectrum.

Drift Chart

  • Conceptual Formula: $K = \frac{Attack + Maneuver}{Defense}$
  • $\Delta K$ (Delta Kappa): Represents the deviation from equilibrium.
Zone Value State Required Action
Tal Zone $\Delta K > 0$ Chaos / Dynamic Violent Attack
Capablanca Zone $\Delta K = 0$ Stable / Static Strategic Maneuver
Petrosian Zone $\Delta K < 0$ Critical Immediate Defense

4. Implementation in ShashChess

ShashChess translates these philosophical labels into C++ code by modifying the behavior of the Stockfish architecture.

A. WDL Mapping -> Shashin Zones

Instead of manually calculating physical parameters, ShashChess uses the NNUE Win/Draw/Loss (WDL) probabilities to approximate the state of the system.

Win Probability Shashin Zone Engine Behavior
96-100% High Tal Total Attack, Pruning disabled
88-95% High-Middle Tal Dominance, search for decisive blow
51-75% Chaos: Capa-Tal Initiative, transition to attack
50% Capablanca Pure strategy, aggressive pruning
25-49% Chaos: Capa-Petrosian Opponent pressure, prudence
0-15% High Petrosian Desperate defense, fortress building

B. Search Modifications (search.cpp)

The engine dynamically alters search parameters based on the detected zone:

  • Aspiration Window: Widened in Tal zones (expecting large score swings/sacrifices); reduced in Capablanca zones (expecting stability).
  • LMR (Late Move Reductions):
    • Tal: Lower reduction. The engine "trusts less" the static ordering and searches deeper for potential tactical brilliancies.
    • Capablanca: Higher reduction. Moves that look bad are discarded quickly to save time.
  • Null Move Pruning (NMP): In Gold Digger mode, NMP is disabled if the position is "NodeHot" (danger of mate or hanging pieces), preventing the engine from missing tactical shots due to pruning.

C. Move Selection (movepick.cpp)

  • Capablanca Zone: Bonus (+30) for bringing pieces to safe squares.
  • Tactical Zone: Bonus (+25) for evasion or creating direct threats.

5. Conclusion: A Three-Headed Engine

ShashChess 41 is not simply a stronger clone of Stockfish. It is an engine that changes personality dynamically:

  1. It becomes a Tactical Monster (Tal) when it smells blood.
  2. It becomes a Boa Constrictor (Petrosian) when it is on the ropes.
  3. It becomes a Positional Grandmaster (Capablanca) when the position is calm.

Clone this wiki locally