Guide › Engines

Engines

The Engines page is the engine library: the list on the left, the card of the engine chosen on the right.

Adding and checking engines

Add… registers a UCI executable. The engine is started once to read its name, author and options. Options are edited in a table: modified values are highlighted, and only values that differ from the engine default are sent with setoption at the start of every game. Threads and Hash come first.

  • Duplicate makes a second entry for the same binary, with other options (a different Hash, a skill level, a different network file…). Entries are named after the UCI id name when first added and can be renamed.
  • Check starts the engine, measures how fast it answers uci and isready, and has it play one move; then it runs fastchess’ UCI compliance steps (id name and id author, positions from a FEN and with moves, go with each clock, info lines with an integer score…), up to the first that fails. The result (✓ or the error) stays next to the engine with its date, and UCI compliance report lists the steps, with what the engine wrote after a failed one. An engine spoken to in xboard only gets the first part.
  • Console… talks to the engine, outside any tournament: it is started with the library’s program, arguments and working directory, and a UCI engine gets uci and then the library’s option values. Lines typed are sent as they are (Enter; Up and Down bring the earlier ones back), and the log shows every line with its time, those sent marked > and the error output !. Buttons send the usual commands (isready, position startpos, go depth 10, go infinite, stop…; WinBoard’s for a WinBoard engine, spoken to in its own protocol unless Through the adapter is ticked) and the position of the Board page. Copy and Save… keep the log. The console shows in place of the engine’s settings (Settings goes back to them, the console staying open); Close ends the engine. While a tournament runs, what the engine searches takes cores from its games: the console says so. Its engine is not one of the tournament’s processes: the end of a tournament does not end it.
  • Quick test plays a short match against the engine itself or another one: 10 games at 10+0.1 from 5 positions (one with an en passant capture), through the same code as a tournament, shown in its workspace while it plays. The result stays next to the engine: its score, its losses on time, crashes and illegal moves, and the share of its clock it used, which tells an engine that plays far too fast or too close to the flag. Its mate PVs are checked (see Check the mate PVs in PGN and misc). Only the last quick test is kept, in tests/ in the profile (with the engine logs of its games that ended badly).

A large library

  • Groups: free labels separated by commas (pool A, list 40/15…). The list can be filtered by group or searched, and a group can be added to a tournament in one click. Notes: anything to remember about the engine. Logo: a picture shown beside its name in Live and on the big screen when the logos are on, and on the broadcast web page (see Appearance).
  • Search and filters: every engine search (the library, and the engine lists of the other pages) finds a name, the name the engine reports, its author, its program path or its notes; the state filter shows the engines that work, failed or changed, were never checked, have lost their program, speak WinBoard, or are inactive. Ctrl or Shift click selects several engines: Check (one after the other, never while a tournament plays), Add to a group…, Remove…. More… checks those never checked (Check those not checked) and removes the missing programs. A string option holding a file or a folder (EvalFile, SyzygyPath…) has a … button.
  • Inactive (on the card, or from the right click for all the engines selected): the engine stays in the library, greyed, but is left out of the engine pickers (setup, suites, quick test, relaunch, adding an engine to a running tournament) and of Check those not checked. A tournament or a setup that has it already keeps it.
  • Uses a GPU (on the card): a network engine that plays on a graphics card, such as Lc0. No more such engines play at once than the GPUs of Settings, in a tournament and across tournaments (see Several tournaments at once); from the next tournament it joins.
  • Reference Elo: the engine’s rating on a list you trust. A tournament or the rating list can be anchored on it, and the games of a tournament carry it in their WhiteElo and BlackElo tags (copied when the engine joins). Import… > A rating list, for the reference Elo… sets it for many engines at once (see Importing engines and ratings).

Popular engines…, beside Add…, lists the strongest engines whose authors publish builds for Linux, Windows and macOS on GitHub (Gaia, Stockfish, Triumviratus, Reckless, PlentyChess, pawnocchio, Coda, Cinder, Stormphrax, Viridithas), each at its latest version, with the file this processor runs (the fastest of its builds that the processor supports: AVX2, BMI2, AVX-512, a build made for its Zen generation…), its size and its licence. Add downloads it from its author’s release, checks it against the SHA-256 hash GitHub publishes, takes it out of its archive, starts it once (uci) and adds it to the library, each version in a folder of its own in the profile’s engines folder; a file that does not start is replaced by the next build. Cancel stops a download, and the next try goes on from where it stopped. The list comes from a catalogue kept in RookStudio’s repository, read again once a day, the program’s own copy otherwise. What leaves the machine: the catalogue, a request to api.github.com per engine (kept a day), and the file chosen; only while the page is open or an engine is added.

An engine added this way follows its new versions: they are looked for once a day when the Engines page opens (or only when Popular engines… opens, in Settings), and shown above the list with Update. The new version goes in a folder of its own and the engine takes it once it has answered uci; Keep … too keeps the version before as an engine of its own, for a match between them. A tournament that is not over keeps the files it started with; the version before is deleted once the tournaments that play it are over (see An engine’s versions).

Where an engine is first needed (the Board page’s analysis, its questions and its review) and the library has none, a card offers Gaia, downloaded with a click (or Enter) and made the engine of the analysis and of the assistant; the other popular engines and an engine from the disk are a click away there too.

An engine’s versions

Each version of an engine taken from Popular engines… stays in a folder of its own in the profile’s engines folder. Once an update has replaced a version in the library, its folder is deleted when no tournament that is not over (playing, paused or stopped) plays it: at once when none does, else at the end of the last one, as RookStudio looks again at the end of each tournament. A notice at the window’s corner says so: Gaia 4.4.3 deleted: “Night Gaia” is over · 118 MB freed, with The engine’s card.

When the engine has more than its library’s version on the disk, its card lists them under Its versions on the disk, each with its state:

  • the library’s: the one the analysis, new tournaments, the bot and the service for Lichess take;
  • one a tournament not over plays, with that tournament and where it is (playing, game 212 of 400), deleted at its end when an update replaced it; Keep … too keeps it for good, as an engine of its own;
  • one kept on purpose (Keep … too, here or in the update), never deleted; Stop keeping it (a second click) takes its engine out of the library, and its folder goes once no tournament that is not over plays it;
  • one left from before, never replaced by an update since: kept until Delete it (a second click);
  • one deleted that a tournament not over asks for again (resumed from a folder RookStudio did not look in): Download it again takes it from its release on GitHub, checked against the hash it had, at the same place.

Starting engines

  • Reading the options never blocks a start. Resume starts at once: a tournament plays the engines copied in its folder. Start, the queue and the quick test wait only for the read of an engine they play, read first; any other read or check is interrupted and done again later. A start that waits says so on its button (Waiting for …, with Cancel), and another start is refused meanwhile. A start also waits for a running test suite, and a test suite does not start while the quick test runs or a start waits. Reads, checks and test suites run beside the tournaments, which play in processes of their own. A queued engine can be read next from its menu.
  • Restart the engine for every game starts a new process for each game instead of reusing it. Otherwise a tournament keeps one waiting process per engine that still has games to play, up to 32 (plus two per game being played), and closes an engine after its last game: in a knockout as soon as its match is lost, in a Swiss once it has no game left in the last round.
  • Start timeout (s) (60 by default) is the time an engine is given to answer uciok when it starts and isready at the start of each game; a slow starter (a large network to load) needs more. An engine that fails to start is tried again three times, 10 s apart, with the same timeout; a pause holds the tries, without using them up. Then its games are set aside and the others go on (see An engine that cannot start). A tournament created afterwards copies the timeout into its participants.

Rebuilt programs

  • Moved or rebuilt programs: the library remembers each program (size, date, CRC32). A program that is no longer there is marked ! with Locate…, and a tournament does not start with it. A program that changed (a new build, or another file under the same path) has its options read again automatically.
  • What a new build changed: when the new read differs from the one before, the engine is marked Δ and its card lists the differences until Dismiss: its new id name (with Rename it when the engine was named after the old one) and author, each option whose default, bounds or choices changed (before and now), the options new and gone, and your value of each (the value of a gone option is dropped; one the new build no longer accepts is in orange). For an option whose default changed, or whose value no longer fits, choose Keep my value (or Keep the old default where you had none: it plays as before) or Use the new default; Keep my values and Use the new defaults choose for all. The notice goes once every choice is made, unless it has more to tell. Several builds before it is dismissed make one notice, against the read before the first. Failed or changed in the state filter shows these engines too, and the command palette has What changed, Keep my values, Use the new defaults and Dismiss what changed for each.
  • The programs of the tournaments: each tournament records the programs it was started with. The setup’s summary warns of an engine whose program changed since its last tournament (the newest one of the tournaments folder that played this program), with What changed when its card has a notice. Resuming a tournament with a program rebuilt or missing since says so in its header, with Continue (the notice closes) and Pause; the tournament does not stop by itself.

Importing engines and ratings

Import… > An engine list… reads the engine list of another program: ChessGUI (ChsGUI_Eng.TXT, with the options of ChsGUI_Cfg.ini next to it), cutechess and Banksia (engines.json), Arena (ArenaENG.cfg, in Arena’s folder: each engine’s program, arguments, protocol and, for UCI engines, the option values set in Arena) and other INI style lists. A list that gives no engine says so, with the formats read and Every engine of a folder… to try instead.

Every engine of a folder… takes every program found in a folder, and remembers the folder: Refresh: the new engines of the folder then offers only the engines added to it since. The engines found are listed first, to untick those to leave out; engines already in the library (same program and arguments) are skipped; the options of the others are read; WinBoard engines are imported too.

Import… > A rating list, for the reference Elo… reads a rating list, pasted or opened: a rating list’s text version or its web page (saved or copied), Ordo’s output (text or CSV), or a CSV of name,elo lines. A name of the list is a library engine with the same name, or the only one whose name is the same letter case and spaces aside (as for the players of imported PGN files, see Ratings). The preview shows each engine’s reference Elo, old and new, ticked to be set, and the names of the list that are no library engine. The names of a list often carry their build (64-bit 4CPU): rename the engines to match them if needed.

WinBoard engines

WinBoard engines (xboard protocol, CECP) are played like the others. The Protocol of an engine is found out when it is added (Automatic), or chosen: UCI or WinBoard. fastchess only speaks UCI: a WinBoard engine is started through a translation built into RookStudio (rookstudio --wb2uci ENGINE [ARGS], which fastchess starts in place of the engine), and its options, memory, cores and Syzygy path become UCI options. It drives the engine the way WinBoard does: protocol 2 features, or protocol 1 for engines that send none; positions with setboard, or edit mode; moves in coordinates or SAN; level, time/otim, st, sd, nps; thinking output, resignation. Engines marked ↔ in the list are WinBoard engines.

  • An engine of protocol 1 without setboard nor edit mode (TSCP, for instance) can only start from the initial position: give it openings as moves (a PGN book), not as positions (EPD).
  • Chess960 for an engine with the fischerandom variant: variant fischerandom, positions in X-FEN, castling as O-O/O-O-O, as WinBoard sends them.
  • Scores from White’s side, among the engine’s options: for the old engines that give their scores from White’s point of view rather than the side to move’s, as the protocol asks; their scores as Black are reversed.
  • An engine that asks to be started again for every game (feature reuse=0) gets Restart the engine for every game ticked when it is added.
  • FCG_WB2UCI_LOG=FILE in the environment writes every line exchanged with WinBoard engines to FILE.

A Lichess bot

An engine’s card has a line On Lichess, as a bot: Make it a Lichess bot… sets the engine up to play on Lichess under a bot account, through Lichess’s Bot API (where engines are allowed), accepting the challenges you choose while RookStudio is open. The line becomes a part of the card, which leads through the steps below.

  • The bot’s account is a second Lichess account, apart from yours: new, with a name of its own, and with no game played. RookStudio does not create accounts: Create the account on lichess.org opens Lichess’s page. Link the bot’s account… opens Lichess’s page asking for one permission, play as a bot (bot:play): log in there with the bot’s account, not yours (a private window of the browser avoids logging you out). Or paste a token of the bot’s account made on lichess.org (Make a token on lichess.org opens the page with that permission ticked) and Check it. Your own account stays linked apart, for the rest of RookStudio; the bot has its own token, kept in the profile’s lichess-bot.json, readable by you alone.
  • The checks, before anything is asked that changes the account: its name and when it was created, the games it played (none), whether it is a bot already (then it serves as it is), and that it is not your own linked account. Your own account is never kept (the token RookStudio got for it is revoked at once); a closed account, or a token without the permission, neither. An account that has played is refused, as Lichess would: create a new one, play nothing on it, then link it (Link another account…, Unlink this one).
  • Make it a bot… cannot be undone: the account never plays as a person again, Lichess marks it BOT, and it plays challenges only (no lobby, no tournaments but the arenas open to bots). The step says so and asks for the account’s name: Make it a bot lights up once the name typed is its own (Escape cancels). What leaves the machine: that request, with the bot’s token. A refusal is said with Lichess’s words; without an answer, nothing changed: try again.
  • The challenges it accepts, on the card: the speeds (bullet, blitz, rapid, classical, correspondence; never UltraBullet, which Lichess does not let bots play), rated games or casual only, people and bots, a rating range for the challenger (0: no bound), Chess960 when the engine knows it (UCI_Chess960), one game at a time. At first: casual only, blitz and rapid, as Lichess asks bots to play casual while they are tested; widen them afterwards. A rated challenge from your own account is declined (Lichess forbids rated games between one person’s accounts); a casual one is played. The other challenges are declined politely, with the reason Lichess shows the challenger: too fast, too slow, not this clock, casual only, standard chess only, not this variant, no bots, bots only, or later while it plays, goes offline, or a tournament needs the cores.
  • Its play: the engine with its options of the library (its Threads and Hash counted in the machine’s core budget while it plays), a Polyglot book of your library played while it has a move, the tournaments’ tables (SyzygyPath, for an engine that has the option and no path of its own), and no thinking on the opponent’s time. Its clock comes from Lichess at each move, less a margin for the network (a tenth of its time left, from 0.2 to 1 second); before both sides have moved, it plays within the time Lichess gives for the first move; by correspondence, it thinks 15 seconds a move. It takes a draw offered when the engine stands clearly worse, or no better late in the game, declines a takeback, and claims the victory when its opponent left long enough. Its words, said in the players’ chat at the start and the end, are yours to choose (empty: nothing said). An engine that cannot start or stops resigns the game (aborts it before both sides moved), and the card says why.
  • Put online (Enter) opens the bot’s own event stream (Lichess keeps one per token): the challenges come, answered at once by its rules. Online, the card shows the bot’s day (games won, drawn and lost, challenges declined), its game on a small board with the engine’s evaluation, On the Board, its last games and the challenges declined, Its page on lichess.org and Put offline: no new challenge, the game in progress plays on to its end, then the stream closes. A correspondence game waits on Lichess while the bot is offline; it comes back when the bot is online again. The bot plays only while RookStudio is open: closing RookStudio during one of its live games asks first (Stay · Escape, Put it offline, Close anyway), as the game would be lost on time.
  • Its game on the Board: followed move by move, the bot’s side below, the players’ ratings and clocks in their strips, and over the column its card: what the game is, whose move it is, the engine’s search (its evaluation, depth and expected line: its own, as it plays the game), Open on lichess.org, Resign for it… (a second click) and Put offline. The moves on the board are the bot’s alone. At its end, the game comes into the database Lichess · its name, made when missing.
  • Where it shows: online, the bot shows where what runs shows: on the Home page under In progress, and on the Tournaments page, with its game, On the Board, Its card and Put offline.
  • A tournament first: a challenge is declined later while a tournament playing on this computer needs the cores the bot’s engine would take. A game of the bot’s already playing when a tournament starts goes on to its end, its engine’s threads counted in the core budget as the Board page’s engines are; no new challenge is taken meanwhile.
  • Fair play: the bot’s games are not yours, and they do not lock your aids. During your own live game on Lichess, the bot’s search is not shown on its card nor on the Board (the card says why); its games go on.
  • Unlink the bot… (a second click) revokes its token at Lichess and deletes it here; the account stays a bot.
  • What leaves the machine: the engine’s moves, its words in the chat, its answers to the challenges, with the bot’s token; nothing of your account. Its profile (name, description) is set on lichess.org. Its choices and its last games are kept in the profile’s bot/bot.json.

The command palette has Put the Lichess bot online, Put the Lichess bot offline, The Lichess bot’s game on the Board and The Lichess bot’s card, and on the Engines page Make … a Lichess bot….

Your engine on lichess.org

An engine’s card has a line On lichess.org, for the analysis: Offer to Lichess… offers the engine to lichess.org’s analysis board, through Lichess’s external engine API. It computes here, on your machine, and its lines show there, for your account only, in the analysis board’s engine menu, while RookStudio is open. Lichess’s API for it is still in alpha.

  • What it is offered as: its name at Lichess (3 to 200 characters; Gaia 4.4.4 (RookStudio) by default), the machine (this computer, or a remote machine of Settings > Machines where the engine has its path, by SSH, with its own threads), the threads at most (Lichess asks for 1 to that many for each request) and the memory at most. Lichess runs such an engine in the Chess960 mode (UCI_Chess960) for every game: an engine without it cannot be offered, and its line says so instead of Offer to Lichess….
  • The first time, Lichess asks for two more permissions, engine:read and engine:write (to register an engine for your account, read it, withdraw it): Allow on Lichess… (Enter) opens Lichess’s page; your account stays linked, and the token it replaces is revoked. Without a linked account, the card says so, with Link the account….
  • Then, without asking anything more, RookStudio registers the engine with your account (one request, with your token) and a secret drawn here, which Lichess never shows again; RookStudio keeps it in the profile’s lichess-engines.json, readable by you alone, and never shows nor logs it. It then waits for work at engine.lichess.ovh with that secret alone, without your token: a long wait, renewed while the service runs. When your analysis board asks, a request comes with the position (a starting position and moves), the threads, the memory, 1 to 5 lines and a time, a depth or nodes: the engine is set (the Chess960 mode, UCI_AnalyseMode when it has it, its options of the library), and its lines (depth, multipv, score, nodes, time, pv) go to Lichess as it finds them, then its best move. When you move on, Lichess closes the request, and the engine stops.
  • In service, the card shows the request being answered (its lines, threads, memory, depth and speed), today’s requests and minutes of analysis, the position asked with the engine’s best move, Open Lichess’s analysis board and Stop the service. The Lichess page lists the engines offered (Your engines on lichess.org); the Home page (under In progress) and the Tournaments page show those in service, and the cores’ bar their threads.
  • The tournament first: the service takes only the threads the tournaments playing on its machine leave free (the cores of Settings), the Lichess bot’s game first too (see A Lichess bot); with none left, it pauses and says so, Lichess’s requests waiting. A request under way when a tournament needs its threads is stopped there.
  • Fair play: during your own live game on Lichess, the service pauses until the game ends (the requests stay unanswered), then resumes by itself. The positions of your correspondence games are never analysed: a request on one of them, on a line through it or one move before it (compared by the men and the side to move, as the lock of Fair play does) gets an empty answer. Lichess itself offers an external engine on its analysis pages only, never during a game.
  • Stop the service: RookStudio no longer waits for work; the engine stays registered at Lichess, without answering; Resume (Enter) serves it again. Change… registers it again with another name, machine or limits. Withdraw from Lichess deletes the registration (one request), and its secret is no longer used; Offer to Lichess… makes it again. RookStudio closed, the engine stays in Lichess’s list without answering; at the next start, the service resumes if it was in service when you closed.
  • When something goes wrong: Lichess refusing the secret (401: the registration was withdrawn on lichess.org, or the secret changed) stops the service, with Register again (a new secret); an answer of Lichess that RookStudio does not read (the API is in alpha) stops it rather than answer wrongly, and says so, with See whether a version of RookStudio follows it; offline, the service waits for the network and resumes by itself (after too many requests, Lichess’s minute).
  • What leaves the machine: at the registration, the name, the limits and the secret, with your token; then the engine’s lines for the positions Lichess sends. Those positions come from your own browser, through Lichess, which sees the lines. Nothing else of your machine.

The command palette has Offer … to lichess.org… on the Engines page, Stop the service of … on lichess.org and Resume the service of … on lichess.org.

In RookStudio, F1 opens this guide beside the page, at the section of what is under the mouse.