| Crates.io | viriformat |
| lib.rs | viriformat |
| version | 2.0.1 |
| created_at | 2025-03-23 20:18:03.773946+00 |
| updated_at | 2025-09-21 16:37:03.842031+00 |
| description | A library for the data-representation used by the viridithas chess engine. |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1603008 |
| size | 3,278,032 |
viriformat is a crate for the game data representation used by the viridithas chess engine.
All integers in viriformat are little-endian.
The square indexing used represents A1=0, H1=7, A8=56, H8=63.
A viriformat file consists of one or more Games concatenated together.
A Game consists of a marlinformat PackedBoard followed by zero or more Move and Score pairs, terminated by four zero bytes.
A PackedBoard is a structure of:
ith entry corresponds to the ith least-significant set bit in the occupied-piece bitboard.
Score for the position.
A Move is a structure packed into a 16-bit integer:
A Score is a signed 16-bit integer representing a white-relative score for said Move.
00000000: ffff 0000 0000 ffff ; occupancy: startpos layout
00000008: 6124 5216 0000 0000 8888 8888 e9ac da9e ; pieces: startpos layout
00000018: 40 ; side to move: white
; en-passant: none
00000019: 00 ; halfmove clock: 0
0000001a: 0100 ; fullmove counter: 1
0000001c: 0000 ; position score: 0 cp
0000001e: 02 ; game result: white win
0000001f: 00 ; extra byte
00000020: 0c07 0a00 ; 1. e4 +10cp
00000024: 3409 1400 ; 1. ... e5 +20cp
00000028: c309 e2ff ; 2. Qh5 -30cp
0000002c: 3c0d ff7f ; 2. ... Ke7 +32767cp
00000030: 2709 ff7f ; 3. Qxe5# +32767cp
00000034: 0000 0000 ; terminator