Urgent.News

What's breaking now, across hundreds of outlets.

Tech

A legal FEN is not a game: state identity in a browser chess extension

Same FEN, different game If you key a chess overlay on FEN alone, two different games can look identical. Rematches are where this shows up. The starting position is the same string, the player knows it's a new game, and an old arrow can come back if you never stored anything else. Lichess does issue a new game id. In the recorder that's an explicit rematch boundary: a new siteGameId / session…

A chess extension for browsers that uses the same FEN string can display different games. The state of the game is determined by more than just the FEN string, including factors like the Chrome controls, Resign, hint, undo, and the live move list. World Chess a browser chess extension that can host more than one legal FEN, ensuring that there is only one primary game board visible at any given time.

Each site has a checklist to verify that a game can be hosted on the page, including conditions like the presence of a visible board, a game ID, and the start of the game. The DOM may not settle in a single mutation, causing updates to the board node and controls to occur in different frames. The result that gets displayed must match the board being looked at, including factors like the FEN, board epoch, config revision, and job ID.

The engine, Stockfish 18, runs on the device, computing live position, engine lines, and captions locally. The wording of captions next to moves is built from the position, recommended move, continuation, and detected motifs, ensuring that the information is accurate and helpful.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

🥇The Real Value of Event-Driven Architecture Isn't Technology. It's Cost Reduction.

👋 Hi dev community! I originally published this on my LinkedIn Newsletter, but wanted to share it with the dev community here to get your thoughts on how your engineering teams handle infrastructure…

  • Traditional Request-Driven Architecture struggles with integration complexity and rising costs.
  • Event-Driven Architecture (EDA) slashes costs, accelerates delivery, and enhances scalability.

More from Saturday 12 September →