Sashité for Developers
  1. Sashité for Developers
  2. Specifications
  3. CGSN
  4. 1.0.0

Chess Game State Notation (CGSN) v1.0.0


Overview

CGSN defines a finite list of game state status values for two-player, turn-based abstract strategy board games implemented on top of the Sashité Game Protocol.

A game state status (or simply status) is:

CGSN does not define:

Those choices belong entirely to the Rule System or to competition rules.


Terminology and layering

All capitalized terms used here (Game, Rule System, Match, Game State, Position, Terminal Piece, Terminal Piece Status, Protocol-Valid Move, Pseudo-Legal Move, Legal Move, etc.) are defined in the:

CGSN adds:

CGSN is designed to be used together with:


Status categories

CGSN divides game state statuses into two categories:

Position-inferable statuses

A status is position-inferable if, for a given Rule System:

knowing the current Position (for example, via a FEEN string) and the rules of the Game is sufficient to decide whether this status applies to the current Game State, without needing any additional information (history, clocks, explicit declarations, etc.).

In other words:

Explicit-only statuses

A status is explicit-only if, even with:

it is not possible to decide whether this status applies, because extra information is required (for example: move history, clocks, or a player’s declaration).

In other words:

CGSN does not mandate how statuses are stored or transported (that is the role of match notations or APIs), but every CGSN status value is classified as either position-inferable or explicit-only.


List of CGSN status values

CGSN v1.0.0 defines the following status identifiers:

Status Position-inferable
check Yes
stale Yes
checkmate Yes
stalemate Yes
nomove Yes
bareking Yes
mareking Yes
insufficient Yes
resignation No
illegalmove No
timelimit No
movelimit No
repetition No
agreement No

Column definition:

CGSN does not prevent implementations from defining additional, non-standard statuses, but:


Status definitions (position-inferable)

This section defines the semantics of position-inferable statuses. All definitions are understood relative to a fixed Rule System and the current Position.

Let:


check

A Terminal Piece of the active player’s side is in check.

Formal condition:

A Terminal Piece T is in check if, in the current Position, there exists at least one Pseudo-Legal Move for the opposing side whose result includes T being captured by an Action (typically a Board → Hand displacement) according to the opponent’s movement capabilities.

Key points:

CGSN does not say whether:


stale

A Terminal Piece of the active player’s side is stale (i.e., not in check).

Formal condition:

A Terminal Piece T is stale if, in the current Position, there exists no Pseudo-Legal Move for the opposing side whose result includes T being captured by an Action (typically a Board → Hand displacement) according to the opponent’s movement capabilities.

Key points:

Note that for a given Terminal Piece, stale and check are mutually exclusive:

CGSN does not attach any particular significance to stale beyond indicating absence of threat.


checkmate

A Terminal Piece of the active player’s side is in check, and every Pseudo-Legal Move for the active player keeps that Terminal Piece in check.

Formal conditions:

  1. A Terminal Piece T is in check.
  2. There exists at least one Pseudo-Legal Move for the active player.
  3. For every such Pseudo-Legal Move m, in the resulting Position:
    • T (if it remains on the Board) is still in check.

Intuition:

CGSN does not define how a Rule System interprets checkmate (win, loss, or otherwise).


stalemate

A Terminal Piece of the active player’s side is stale (not in check), but every Pseudo-Legal Move for the active player would result in that Terminal Piece being in check.

Formal conditions:

  1. A Terminal Piece T is stale (not in check) in the current Position.
  2. There exists at least one Pseudo-Legal Move for the active player.
  3. For every such Pseudo-Legal Move m, in the resulting Position:
    • T is in check.

Intuition:

CGSN does not specify how a Rule System interprets stalemate (draw, loss, or otherwise).


nomove

The active player has no Pseudo-Legal Moves in the current Position.

Formal condition:

nomove is purely mechanical / geometric:

A Rule System may combine nomove with other information (e.g. Terminal Piece statuses) to define its own outcomes, but that logic is outside CGSN.


bareking

One side has only its Terminal Pieces remaining on the Board; all its non-terminal Pieces have been removed from the Board.

Formal condition:

This generalizes the notion of “bare king” to games where:

CGSN does not assume any particular consequence of bareking.


mareking

All Terminal Pieces of at least one side have been removed from the Board.

Formal condition:

Captured Terminal Pieces are usually held in Hands or otherwise off-board; CGSN simply checks whether they are absent from the Board.

Again, CGSN does not define how a Rule System should treat this situation.


insufficient

Neither player has sufficient material (and, if relevant, positional resources) to force a decisive result under the Rule System.

This status is position-inferable once the Rule System is fixed, but its concrete evaluation is Game-specific.

High-level condition (informal):

CGSN only provides the name insufficient; the Rule System must specify:


Status definitions (explicit-only)

These statuses cannot be determined from Position + Rule System alone. They require additional information, such as:

CGSN describes what they mean, but not how they affect results.


resignation

A player explicitly resigns the Match according to the conventions in use (verbal, written, UI action, etc.).

CGSN does not encode which player resigned or which result is assigned. Those details belong to the Rule System or to the surrounding notation.


illegalmove

A move that was actually played is recognized as not a Legal Move under the combination of:

This status does not distinguish the reason:

It simply records the fact that a move was deemed Illegal.

How the Match proceeds (loss, rewind, correction, etc.) is not defined by CGSN.


timelimit

A player exceeds the allotted time defined by the current time control.

CGSN does not specify which player lost time or what consequence follows.


movelimit

The Match reaches a move-count limit defined by the rules or competition regulation.

Examples (Game-dependent):

Because move-count policies and counting methods are Game-specific and depend on the History, movelimit cannot be deduced from Position + Rule System alone.

CGSN merely names the condition once some external logic decides it is met.


repetition

The same Position (under a given definition of equality) occurs a specific number of times during the Match, as defined by the Rule System’s repetition policy.

This status depends on:

CGSN does not fix:

It only provides a name to indicate that “the repetition policy has been triggered”.


agreement

Both players mutually agree to end the Match.

How such agreements are handled (allowed or not, form of agreement, outcome) is determined externally.


Extensibility

Implementations MAY introduce additional status values beyond those defined by CGSN, provided that:

CGSN itself does not reserve a namespace for extensions; naming schemes are left to implementations and higher-level specifications.


Examples

See CGSN Examples for practical implementation guidance.


Reference Implementations

Ruby