LoopyFish is a strategic, uncertainty-aware bot developed for the ReconChess AI framework. Unlike traditional chess engines that operate with full board visibility, LoopyFish was designed to thrive in environments of partial observability where hidden information and uncertainty dominate.
At its core, LoopyFish maintains a dynamic belief set—a collection of possible board states consistent with all sensed information to date. By combining tactical strength (powered by Stockfish) with probabilistic reasoning and custom decision heuristics, LoopyFish makes informed decisions both in sensing and move selection phases.
Key design goals of LoopyFish include:
- Robust Uncertainty Management: Making safe but effective moves even when the true board state is ambiguous.
- High-Information Sensing: Choosing sense actions that maximize the reduction of uncertainty.
- Smarter King Capture Logic: Avoiding wasted turns chasing phantom kings by using belief-set voting and thresholding.
- Scalability: Sampling techniques to manage large belief state explosion while retaining board diversity.
LoopyFish was evaluated against multiple baseline agents in a double round-robin tournament, showing strong performance and a high win rate across both colors.
To install the reconchess package, run:
pip install reconchessIf installation is successful, test it by running:
python -m reconchess.scripts.bot_match reconchess.bots.random_bot reconchess.bots.random_botIf this works, but rc-bot-match doesn't, add the Scripts folder to your PATH.
Scripts folder looks something like this: C:\Users\luker\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\Scripts
- Find the installation path by running:
python -c "import sysconfig; print(sysconfig.get_path('scripts'))" - Add this path to the Environment Variables:
- Press
Win + R, typesysdm.cpl, and hit Enter. - Go to the Advanced tab → Click Environment Variables.
- Under User variables, edit Path and add the folder.
- Restart the terminal and try running
rc-bot-matchagain.
- Press
- Download Stockfish from https://stockfishchess.org/download/.
- Extract it to a known location, e.g.,
C:\stockfish. - Locate the executable inside the extracted folder, e.g.,
C:\stockfish\stockfish-windows-x86-64-avx2.exe.
$env:STOCKFISH_EXECUTABLE = "C:\stockfish\stockfish-windows-x86-64-avx2.exe"This works only in the current terminal session.
- Press
Win + R, type sysdm.cpl, and hit Enter. - Go to the Advanced tab → Click Environment Variables.
- Under User variables, click New:
- Variable Name:
STOCKFISH_EXECUTABLE - Variable Value:
C:\stockfish\stockfish-windows-x86-64-avx2.exe
- Variable Name:
- Click OK, close all windows, and restart your PC.
[System.Environment]::SetEnvironmentVariable("STOCKFISH_EXECUTABLE", "C:\stockfish\stockfish-windows-x86-64-avx2.exe", [System.EnvironmentVariableTarget]::User)Restart your terminal for changes to take effect.
Run these commands:
echo $env:STOCKFISH_EXECUTABLE
python -c "import os; print(os.getenv('STOCKFISH_EXECUTABLE'))"Both should return:
C:\stockfish\stockfish-windows-x86-64-avx2.exe
If they return None, restart your system and try again.
Test TroutBot by running:
rc-bot-match reconchess.bots.trout_bot reconchess.bots.random_botIf you get KeyError: 'TroutBot requires an environment variable...', ensure the STOCKFISH_EXECUTABLE variable is properly set.
- Run
python -m reconchess.scripts.bot_match reconchess.bots.random_bot reconchess.bots.random_bot. - If it works, add the
Scriptsfolder to your PATH (see Section 2).
- Make sure
STOCKFISH_EXECUTABLEis set permanently (see Section 4). - Restart the terminal or PC.
- Check if Python recognizes it:
python -c "import os; print(os.getenv('STOCKFISH_EXECUTABLE'))".
Now, you should be able to run TroutBot with Stockfish successfully! 🚀