Stockfish: Difference between revisions
More actions
HollowLeaf (talk | contribs) No edit summary Tag: Reverted |
HollowLeaf (talk | contribs) |
||
(37 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
'''Available in:''' Builder, Library, Practice, Tools | '''Available in:''' Builder, Library, Practice, Tools | ||
== Stockfish Card == | == Stockfish Card == | ||
[[File:AnalyticsCards-Stockfish.png|thumb| | [[File:AnalyticsCards-Stockfish.png|thumb|380px]] | ||
The '''Stockfish''' card shows evaluations for the current board position, giving you instant insight into the engine’s best moves. It is powered by '''Stockfish.js 17.1''', the web-enabled version of Stockfish, allowing you to run advanced engine analysis directly in your browser without any external setup. | The '''Stockfish''' card shows evaluations for the current board position, giving you instant insight into the engine’s best moves. It is powered by '''Stockfish.js 17.1''', the web-enabled version of Stockfish, allowing you to run advanced engine analysis directly in your browser without any external setup. | ||
Line 11: | Line 11: | ||
You can interact directly with the move list: | You can interact directly with the move list: | ||
<ul style="list-style:none; padding-left:1.5em; margin:0;"> | |||
<li style="text-indent:-1.1em; padding-left:1.1em;"> | |||
<span style="display:inline-block; width:0.9em; text-align:center; font-weight:bold;">◦</span> | |||
Reuse existing repertoire annotations within your library items | |||
</li> | |||
<li style="text-indent:-1.1em; padding-left:1.1em;"> | |||
<span style="display:inline-block; width:0.9em; text-align:center; font-weight:bold;">◦</span> | |||
Maintain consistency between your repertoire and library | |||
</li> | |||
<li style="text-indent:-1.1em; padding-left:1.1em;"> | |||
<span style="display:inline-block; width:0.9em; text-align:center; font-weight:bold;">◦</span> | |||
Speed up the process of analyzing and commenting on positions | |||
</li> | |||
<li style="text-indent:-1.1em; padding-left:1.1em;"> | |||
<span style="display:inline-block; width:0.9em; text-align:center; font-weight:bold;">◦</span> | |||
Instantly copy repertoire annotations into your current game or analysis | |||
</li> | |||
</ul> | |||
This feature helps you: | This feature helps you: | ||
<ul style="list-style:none; padding-left:1.5em; margin:0;"> | |||
<li style="text-indent:-1.1em; padding-left:1.1em;"> | |||
<span style="display:inline-block; width:0.9em; text-align:center; font-weight:bold;">+</span> | |||
Analyze any position quickly with Stockfish’s strongest available evaluations | |||
</li> | |||
<li style="text-indent:-1.1em; padding-left:1.1em;"> | |||
<span style="display:inline-block; width:0.9em; text-align:center; font-weight:bold;">+</span> | |||
View real-time depth and performance (MNps) as the engine searches | |||
</li> | |||
<li style="text-indent:-1.1em; padding-left:1.1em;"> | |||
<span style="display:inline-block; width:0.9em; text-align:center; font-weight:bold;">+</span> | |||
Expand and explore entire engine lines interactively | |||
</li> | |||
<li style="text-indent:-1.1em; padding-left:1.1em;"> | |||
<span style="display:inline-block; width:0.9em; text-align:center; font-weight:bold;">+</span> | |||
Add engine-recommended moves and analysis directly into your repertoire or library | |||
</li> | |||
<li style="text-indent:-1.1em; padding-left:1.1em;"> | |||
<span style="display:inline-block; width:0.9em; text-align:center; font-weight:bold;">+</span> | |||
Instantly revisit cached positions without re-running the engine | |||
</li> | |||
<li style="text-indent:-1.1em; padding-left:1.1em;"> | |||
<span style="display:inline-block; width:0.9em; text-align:center; font-weight:bold;">+</span> | |||
Control the depth and detail of analysis for efficient study | |||
</li> | |||
</ul> | |||
== Setting Up Local Stockfish == | == Setting Up Local Stockfish == | ||
[[File:AnalyticsCards-Stockfish- | [[File:AnalyticsCards-Stockfish-LocalStockfishSettings.png|thumb|380px]] | ||
To leverage the full power of your own computer, you can connect Chessboard Magic to a locally running chess engine. While the built-in Stockfish.js engine provides excellent performance, using your own hardware gives you an extra boost in speed, depth, and consistency — especially for large or detailed repertoire analyses. | To leverage the full power of your own computer, you can connect Chessboard Magic to a locally running chess engine. While the built-in Stockfish.js engine provides excellent performance, using your own hardware gives you an extra boost in speed, depth, and consistency — especially for large or detailed repertoire analyses. | ||
Line 36: | Line 72: | ||
=== Requirements === | === Requirements === | ||
<ul style="list-style:none; padding-left:1.5em; margin:0;"> | |||
<li style="text-indent:-1.1em; padding-left:1.1em;"> | |||
<span style="display:inline-block; width:0.9em; text-align:center; font-weight:bold;">◦</span> | |||
<b>Python 3.9+</b> installed on your system | |||
</li> | |||
<li style="text-indent:-1.1em; padding-left:1.1em;"> | |||
<span style="display:inline-block; width:0.9em; text-align:center; font-weight:bold;">◦</span> | |||
A UCI-compatible engine binary, such as: | |||
<ul style="list-style:none; padding-left:1.5em; margin:0.3em 0 0 0;"> | |||
<li style="text-indent:-1.1em; padding-left:1.1em;"> | |||
<span style="display:inline-block; width:0.9em; text-align:center; font-weight:bold;">◦</span> | |||
Stockfish | |||
</li> | |||
<li style="text-indent:-1.1em; padding-left:1.1em;"> | |||
<span style="display:inline-block; width:0.9em; text-align:center; font-weight:bold;">◦</span> | |||
Berserk | |||
</li> | |||
<li style="text-indent:-1.1em; padding-left:1.1em;"> | |||
<span style="display:inline-block; width:0.9em; text-align:center; font-weight:bold;">◦</span> | |||
Komodo | |||
</li> | |||
</ul> | |||
</li> | |||
</ul> | |||
=== Setup Instructions === | === Setup Instructions === | ||
<ol style="list-style-type:decimal;padding-left:0.5em; margin:1em;"> | |||
<li>Install <b>Python 3.9+</b> and make sure the command <code>python</code> (or <code>python3</code> on macOS/Linux) is available in your terminal.</li> | |||
<li>Download the files <b>CBMEngineProxy.py</b> and <b>config.json</b> from the [https://github.com/HollowLeaf1981/CBMEngineProxy GitHub repository].</li> | |||
<li>Save both files together in the same folder.</li> | |||
<li>Open a terminal in that folder and install the required dependency: <code>pip install websockets</code></li> | |||
<li>Edit <b>config.json</b> to point to your engine binary and configuration.</li> | |||
</ol> | |||
'''Windows Example:''' | '''Windows Example:''' | ||
Line 72: | Line 130: | ||
</pre> | </pre> | ||
{{Notice|Note|<b>engine_path:</b> Full path to your UCI engine binary (<code>.exe</code> on Windows, no extension on macOS/Linux). <b>host:</b> Usually leave as <code>127.0.0.1</code>. port:</b> Must match the connection port used by Chessboard Magic. <b>logging:</b> Set to <code>true</code> for debugging output, or <code>false</code> for silent mode}} | |||
=== Running the Proxy === | === Running the Proxy === | ||
Start the proxy by running: | Start the proxy by running: | ||
<pre> | <pre> | ||
python CBMEngineProxy.py | python CBMEngineProxy.py | ||
Line 91: | Line 144: | ||
=== Using with Chessboard Magic === | === Using with Chessboard Magic === | ||
<ol style="list-style-type:decimal; padding-left:1.5em; margin:1em;"> | |||
<li style="margin-left:0; text-indent:0;"> | |||
Launch Chessboard Magic in your browser. | |||
</li> | |||
<li style="margin-left:0; text-indent:0;"> | |||
Open the <b>Stockfish</b> card. | |||
</li> | |||
<li style="margin-left:0; text-indent:0;"> | |||
Click on the <b>Stockfish</b> label and select <b>Local Stockfish</b>. | |||
</li> | |||
<li style="margin-left:0; text-indent:0;"> | |||
Configure the following parameters: | |||
<ul style="list-style:none; padding-left:1.3em; margin:0.3em 0 0 0;"> | |||
<li style="text-indent:-1.1em; padding-left:1.1em;"> | |||
<span style="display:inline-block; width:0.9em; text-align:center; font-weight:bold;">◦</span> | |||
<b>URL:</b> <code>http://127.0.0.1:9480</code> — normally this does not need to change. | |||
</li> | |||
<li style="text-indent:-1.1em; padding-left:1.1em;"> | |||
<span style="display:inline-block; width:0.9em; text-align:center; font-weight:bold;">◦</span> | |||
<b>Hash (MB):</b> <code>4096</code> — sets how much memory the engine can use. | |||
</li> | |||
<li style="text-indent:-1.1em; padding-left:1.1em;"> | |||
<span style="display:inline-block; width:0.9em; text-align:center; font-weight:bold;">◦</span> | |||
<b>Threads:</b> <code>12</code> — defines how many CPU threads are used. | |||
</li> | |||
<li style="text-indent:-1.1em; padding-left:1.1em;"> | |||
<span style="display:inline-block; width:0.9em; text-align:center; font-weight:bold;">◦</span> | |||
<b>Syzygy Path:</b> If you have tablebases installed, set this to the directory path of your Syzygy files. | |||
</li> | |||
</ul> | |||
</li> | |||
</ol> | |||
Line 129: | Line 206: | ||
</pre> | </pre> | ||
Once configured, Chessboard Magic will communicate seamlessly with your local engine, giving you faster, more flexible, and fully offline Stockfish evaluations. | Once configured, Chessboard Magic will communicate seamlessly with your local engine, giving you faster, more flexible, and fully offline Stockfish evaluations. | ||
{{DocNav | |||
| prev = Space Visualisation | |||
| prev_label = Space Visualisation | |||
| next = Transpositions | |||
| next_label = Transpositions | |||
}} |
Latest revision as of 10:07, 15 October 2025
Available in: Builder, Library, Practice, Tools
Stockfish Card

The Stockfish card shows evaluations for the current board position, giving you instant insight into the engine’s best moves. It is powered by Stockfish.js 17.1, the web-enabled version of Stockfish, allowing you to run advanced engine analysis directly in your browser without any external setup.
You can select both the desired analysis depth and the number of principal variations (PVs) returned by Stockfish, letting you control how detailed or broad the engine’s output is. As Stockfish runs, the depth and MNps (million nodes per second) update in real time, providing a live view of the engine’s search progress and speed. Analyzed positions are also cached locally in your browser, allowing you to revisit any previously analyzed position instantly without needing to rerun the engine.
Each row displays only the first few moves of a variation; clicking the ▼ (down arrow) on the right expands the full line for deeper inspection.
You can interact directly with the move list:
- ◦ Reuse existing repertoire annotations within your library items
- ◦ Maintain consistency between your repertoire and library
- ◦ Speed up the process of analyzing and commenting on positions
- ◦ Instantly copy repertoire annotations into your current game or analysis
This feature helps you:
- + Analyze any position quickly with Stockfish’s strongest available evaluations
- + View real-time depth and performance (MNps) as the engine searches
- + Expand and explore entire engine lines interactively
- + Add engine-recommended moves and analysis directly into your repertoire or library
- + Instantly revisit cached positions without re-running the engine
- + Control the depth and detail of analysis for efficient study
Setting Up Local Stockfish

To leverage the full power of your own computer, you can connect Chessboard Magic to a locally running chess engine. While the built-in Stockfish.js engine provides excellent performance, using your own hardware gives you an extra boost in speed, depth, and consistency — especially for large or detailed repertoire analyses.
Overview
To allow the Repertoire Builder (and other tools) to communicate with a local UCI engine, you will need to install a lightweight proxy application that bridges your browser and engine. The CBM Engine Proxy is a WebSocket bridge that connects Chessboard Magic directly to any UCI-compatible chess engine such as Stockfish, Berserk, or Komodo.
This allows Chessboard Magic to run a local chess engine on your computer and communicate with it through the browser in real time.
Requirements
- ◦ Python 3.9+ installed on your system
-
◦
A UCI-compatible engine binary, such as:
- ◦ Stockfish
- ◦ Berserk
- ◦ Komodo
Setup Instructions
- Install Python 3.9+ and make sure the command
python
(orpython3
on macOS/Linux) is available in your terminal. - Download the files CBMEngineProxy.py and config.json from the GitHub repository.
- Save both files together in the same folder.
- Open a terminal in that folder and install the required dependency:
pip install websockets
- Edit config.json to point to your engine binary and configuration.
Windows Example:
{ "engine_path": "C:/Users/USERNAME/Downloads/stockfish/stockfish.exe", "host": "127.0.0.1", "port": 9480, "logging": true }
macOS Example:
{ "engine_path": "/Users/USERNAME/Downloads/stockfish/stockfish", "host": "127.0.0.1", "port": 9480, "logging": true }
.exe
on Windows, no extension on macOS/Linux). host: Usually leave as 127.0.0.1
. port: Must match the connection port used by Chessboard Magic. logging: Set to true
for debugging output, or false
for silent modeRunning the Proxy
Start the proxy by running:
python CBMEngineProxy.py
If successful, you will see:
✅ Engine Proxy running on ws://127.0.0.1:9480
Using with Chessboard Magic
- Launch Chessboard Magic in your browser.
- Open the Stockfish card.
- Click on the Stockfish label and select Local Stockfish.
-
Configure the following parameters:
-
◦
URL:
http://127.0.0.1:9480
— normally this does not need to change. -
◦
Hash (MB):
4096
— sets how much memory the engine can use. -
◦
Threads:
12
— defines how many CPU threads are used. - ◦ Syzygy Path: If you have tablebases installed, set this to the directory path of your Syzygy files.
-
◦
URL:
Once connected, Chessboard Magic will use your local engine for analysis, with results appearing directly in the Stockfish card.
Stopping the Proxy
Press Ctrl + C
in the terminal window to stop the proxy server.
Building a Standalone Executable (Optional)
You can package the proxy into a standalone executable so it runs without requiring Python to be installed.
Windows
pip install pyinstaller pyinstaller --onefile CBMEngineProxy.py
The executable will appear in the `dist/` folder as `CBMEngineProxy.exe`. Place `config.json` in the same folder and double-click to run it.
macOS
pip install pyinstaller pyinstaller --onefile CBMEngineProxy.py
The standalone app will appear in the `dist/` folder as `CBMEngineProxy`. Place `config.json` alongside it and run:
./CBMEngineProxy
Once configured, Chessboard Magic will communicate seamlessly with your local engine, giving you faster, more flexible, and fully offline Stockfish evaluations.