Sashité for Developers
  1. Sashité for Developers
  2. Rules
  3. Chess

Chess

Rule System for Western Chess built on the Game Protocol.

Chess on Sashité follows standard FIDE rules. Check, checkmate, stalemate, castling, promotion (the player chooses a Queen, Rook, Bishop, or Knight), en passant, and the threefold-repetition draw are exactly as in FIDE. Captured pieces are modelled as an inert hand for position-identity purposes; this has no effect on play, since Chess has no drops.


1. Board

8×8 grid encoded in CELL.

Valid coordinates: a1h8

FEEN serialization: rank 8 → rank 1, file a → file h, / between ranks.


2. Style

Style SIN Side
Western W first (White)
Western w second (Black)

3. Pieces

All pieces encoded in EPIN. The +/- prefixes below are transient board-state markers, maintained by the canonicalizer after every move and stripped at capture. No chess piece ever carries a + prefix to indicate promotion: promotion replaces the Pawn token outright.

EPIN Name State
K^ King Royal piece, not in check
-K^ King Currently in check (transient, re-evaluated each move)
Q Queen  
+R Rook Castling immediately performable (rights intact, path clear, transit safe)
-R Rook Castling right retained but temporarily blocked (path obstructed or transit attacked)
R Rook No castling rights (it or its King has moved)
B Bishop  
N Knight  
+P Pawn On its starting rank, eligible for the double step
-P Pawn Just double-stepped, legally capturable en passant (one turn only)
P Pawn Has moved; no double step

Second-player (Black) pieces use the same tokens in lowercase (k^, -k^, q, +r, …).

Capture mutation: none. A captured piece enters the capturing player’s hand with its type and case preserved. The case is not flipped, so every captured piece sits in the opponent’s camp inside the capturer’s hand — permanently inert under the universal drop rule (a piece is droppable only if its EPIN side matches the dropping player’s side). The hand is write-only, yet it is part of the canonical position (see §8.4).

Hand canonicalization: a piece in hand never carries a +/- marker (+PP, -RR). This is a recomposition of the position, like the check marker — not a mutation of the capture — so it is never written in the PMN of the capturing move (§6).


4. Initial Position

Encoded in FEEN:

-rnbqk^bn-r/+p+p+p+p+p+p+p+p/8/8/8/8/+P+P+P+P+P+P+P+P/-RNBQK^BN-R / W/w

Two state markers are present from move one:


5. Movements

All pseudo-legal moves encoded in GGN. Patterns shown are representative; full GGN enumerates all source/destination pairs.

5.1 King

{
  "W:K^": {
    "e4": {
      "d3": [{ "must": { "d3": "empty" } }, { "must": { "d3": "enemy" } }],
      "d4": [{ "must": { "d4": "empty" } }, { "must": { "d4": "enemy" } }],
      "d5": [{ "must": { "d5": "empty" } }, { "must": { "d5": "enemy" } }],
      "e3": [{ "must": { "e3": "empty" } }, { "must": { "e3": "enemy" } }],
      "e5": [{ "must": { "e5": "empty" } }, { "must": { "e5": "enemy" } }],
      "f3": [{ "must": { "f3": "empty" } }, { "must": { "f3": "enemy" } }],
      "f4": [{ "must": { "f4": "empty" } }, { "must": { "f4": "enemy" } }],
      "f5": [{ "must": { "f5": "empty" } }, { "must": { "f5": "enemy" } }]
    }
  }
}

One square in any of the 8 directions. When the King moves, every Rook that was eligible to castle with it (+R/-R) becomes ineligible (R).

5.2 Queen

Any number of squares orthogonally or diagonally. Path must be clear.

5.3 Rook

Any number of squares orthogonally. Path must be clear. State mutation on move: +RR, -RR.

5.4 Bishop

Any number of squares diagonally. Path must be clear.

5.5 Knight

L-shape (2+1 or 1+2), all 8 directions. Jumps over pieces.

5.6 Pawn

{
  "W:+P": {
    "e2": {
      "e3": [{ "must": { "e3": "empty" } }],
      "e4": [{ "must": { "e3": "empty", "e4": "empty" } }],
      "d3": [{ "must": { "d3": "enemy" } }],
      "f3": [{ "must": { "f3": "enemy" } }]
    }
  },
  "W:P": {
    "e3": {
      "e4": [{ "must": { "e4": "empty" } }],
      "d4": [{ "must": { "d4": "enemy" } }],
      "f4": [{ "must": { "f4": "enemy" } }]
    }
  }
}

Moves one square straight forward; captures one square diagonally forward. The double step (two squares forward, both empty, never a capture) requires the +P token — a Pawn that has moved is plain P and has lost it. Black Pawns mirror toward rank 1. Reaching the last rank: mandatory promotion to Queen, Rook, Bishop, or Knight — the player’s choice; the move is incomplete until the choice is specified.

5.7 Castling

{
  "W:K^": {
    "e1": {
      "g1": [{ "must": { "f1": "empty", "g1": "empty", "h1": "W:+R" } }],
      "c1": [{ "must": { "d1": "empty", "c1": "empty", "b1": "empty", "a1": "W:+R" } }]
    }
  }
}

Standard FIDE castling: the King moves two squares toward the Rook, the Rook lands on the square the King crossed. Only a +R Rook (castling immediately performable) participates. Black mirrors on rank 8 (w:k^, w:+r). After castling, both of the mover’s Rooks become plain R.

5.8 En passant

{
  "W:P": {
    "e5": {
      "d6": [{ "must": { "d5": "w:-p", "d6": "empty" } }],
      "f6": [{ "must": { "f5": "w:-p", "f6": "empty" } }]
    }
  }
}

Captures a Pawn marked -P/-p (just double-stepped) by moving diagonally onto the skipped square, on the immediately following turn only.

Canonicality condition: the -P flag is set only if the en passant capture is actually legal — an enemy Pawn is adjacent on the arrival rank and the capture would not leave the capturer’s own King in check. Otherwise the Pawn stays plain P, so canonically equal positions always produce equal FEEN strings.


6. Special Move Notation

Encoded in PMN.

Move PMN Description
Kingside castling (White) e1~g1 King e1→g1, Rook h1→f1
Queenside castling (White) e1~c1 King e1→c1, Rook a1→d1
Kingside castling (Black) e8~g8 King e8→g8, Rook h8→f8
Queenside castling (Black) e8~c8 King e8→c8, Rook a8→d8
En passant (White) e5~f6 Pawn e5→f6, captures pawn on f5
En passant (Black) e4~f3 Pawn e4→f3, captures pawn on f4
Promotion e7-e8=Q Pawn e7→e8, promotes to Queen (= names the piece the actor becomes)

PMN writes the tokens as they stand at the moment of the move; the transient +/- markers are recomposed afterwards and never appear in a move. A capture carries a / suffix only when the captured piece’s letter or case changes on entering the hand — never in Chess, whose capture mutation is empty (§3): the en passant capture of a -p is written e5~f6, the capture of a +p is d4+e5.


7. Termination

Status values from CGSN with game-specific interpretation. A game has exactly one of three results — 1–0, ½–½, or 0–1; there are no partial results.

7.1 Decisive

CGSN Status Result
checkmate The player to move is in check with no legal escape — they lose. The King is never actually captured.
resignation Resigning player loses

7.2 Draw

CGSN Status Condition
nomove The player to move has no pseudo-legal move at all — the pseudo-legal set (GGN) is empty. Tested before checkmate and stalemate, and takes precedence even if the King is in check (CGSN §9.1)
stalemate No legal move, not in check
insufficient Dead position, material-only detection: K vs K · K+B vs K · K+N vs K · Kings and Bishops only (any number, either side) with all Bishops on same-colour squares. Pieces in hand are ignored (the hand is inert).
repetition The same canonical position occurs a third time (see §8.4)
movelimit 50 full moves by each player (100 half-moves) with no capture and no Pawn move
agreement Mutual agreement

Dead positions that depend on arrangement rather than material (e.g. fully blocked Pawn walls) are not detected; they reach a draw through repetition or movelimit. The criterion for a dead position is possibility, not forceability — K+2N vs K is not dead.

Illegal moves are not a termination cause: a move rejected as illegal is simply refused — the player keeps the turn. Time controls are out of scope of this rule system: loss on time is an application-level concern.


8. Constraints

Rules transforming pseudo-legal moves (GGN) into legal moves.

8.1 Check constraint

A move is illegal if it leaves the active player’s King in check — whether it creates a new check (moving a pinned piece, stepping onto an attacked square) or fails to resolve an existing one. A King in check carries the transient -K^ marker.

8.2 Castling constraints

Castling is illegal if the King is in check, passes through an attacked square, or lands on one. The Rook state already encodes executability: +R means castling is performable this turn; -R means the right is preserved but temporarily blocked.

8.3 En passant timing

The -P/-p flag expires at the start of the next move of the player who double-stepped, whether or not the capture was taken.

8.4 Position identity (threefold repetition)

Two positions are the same iff their canonical FEEN strings are equal:

8.5 Rook state transitions

After each move the canonicalizer recalculates: a Rook that moves → R; a King that moves turns all its +R/-R Rooks → R; a Rook with preserved rights is +R when castling is immediately performable and -R when blocked (occupied path or attacked transit/landing square).


9. Reference


10. License

Open Web Foundation Agreement 1.0 (OWFa 1.0) — OWFa 1.0