Skip to main content

python Checked with mypy Ruff linting: pylint Tests pytorch Pyright

Chipiron

Chipiron is a Python framework for game-playing agents, generic tree search and learned state evaluators. It supports chess, Morpion Solitaire (5T), checkers and integer reduction. Game-specific code lives under src/chipiron/environments/; Morpion's evaluator/training/bootstrap implementation is under its morpion/ subdirectory.

The proposed canonical line is maintenance/chipiron-canonicalization, intended to become main after review. GitHub's current main is historical until that PR is merged. The integration preserves all generic-game history and the cleaned September evaluator work; see the ancestry and audit.

Store new experiments, models, datasets and run logs outside this checkout, using configuration-driven paths. See artifact policy, dependency provenance, and the small maintenance backlog. The dependency document also records the unpublished Coral prerequisite that currently blocks release.

Acknowledgments

Play Online against Chipiron

Play at this website !


Chipiron integrates and builds upon other personal repositories:


Quickstart

git clone https://github.com/victorgabillon/chipiron.git
cd chipiron
git switch maintenance/chipiron-canonicalization  # until its reviewed merge into main
cp .env.example .env  # optional local path overrides; never commit this file
make init
python3 -m chipiron.scripts.main_chipiron

Requirements

  • Python 3.13
  • pip
  • curl
  • tkinter
  • make
  • libxcb-cursor0
  • zstd (for decompressing Lichess PGN databases)
  • cc (or else to build some rust dependencies)

Optional:

  • Stockfish chess engine (can be installed with make stockfish)

Installation

Using Make

This will install Python dependencies, download syzygy tables, retrieve datasets, and GUI images:

make init

Optional: Install Stockfish Chess Engine

If you want to use the integrated Stockfish player for stronger AI opponents:

make stockfish

This downloads and installs Stockfish 16 (~40MB) to the correct location for chipiron integration.

(Optional) Using Conda

Click here for detailed instructions with conda
git clone https://github.com/victorgabillon/chipiron.git
cd chipiron
conda create --name chipiron3.13 python==3.13
conda activate chipiron3.13
conda install -c conda-forge tk=*=xft_* # to fix graphical problems with tkinter
make init

Docker

The Chipiron Docker image is published to Docker Hub.

Simply pull the image

docker pull victorgabillon/chipiron:latest

Or, build the Docker image:

docker build -t chipiron-x11 .

To run the Docker container with GUI:

sudo docker run --rm \
  -e DISPLAY=$DISPLAY \
  -v /tmp/.X11-unix:/tmp/.X11-unix \
  --network=host \
  -u $(id -u):$(id -g) \
  <image_name>

Usage

Every script should be run via main_chipiron.py and run from the ROOT_FOLDER. The type of script can be specified via the argument --script_name. Yaml config file can be specified via --config_file_name.

Base case with a GUI to play against chipiron or watch it play

Starts a gui to choose your options of play.

python3 -m chipiron.scripts.main_chipiron

Other Scripts:

One match:

This allows to play a match between two players.

python3 -m chipiron.scripts.main_chipiron --script_name one_match --config_file_name src/chipiron/scripts/one_match/inputs/base/exp_options.yaml

League

This allows to run a league of selected players and compute their Elo ratings.

python3 -m chipiron.scripts.main_chipiron --script_name league

Lean a NN from a labelled dataset

This learns Neural Networks from a database of labelled boards.

python3 -m chipiron.scripts.main_chipiron --script_name learn_nn --config_file_name src/chipiron/scripts/learn_nn_supervised/exp_options.yaml

Documentation

Full documentation is available at chipiron.readthedocs.io.

To build and view the documentation locally:

cd docs
make clean
make html
xdg-open _build/html/index.html

Testing

The canonical quality gate is tox. It builds and installs the wheel with published dependencies, verifies installed import paths and evaluator/checkpoint contracts, selects tests without the integration or external_data markers, and checks repository-wide Ruff format/lint. Pylint, mypy and Pyright report inherited debt; the static-analysis ratchet fails on new diagnostics or baseline growth. A ratchet pass does not mean zero static-analysis errors.

tox

If tox is not installed in your active Python 3.13 environment:

python -m pip install -e '.[dev]'

Useful focused runs:

tox -e tooling
tox -e py313
tox -e ruff
tox -e static
# Optional strict reports, which still fail on inherited debt:
tox -e lint
tox -e typecheck

Tool versions for Ruff, Pylint, mypy, Pyright, tox, Black, build, and pre-commit are pinned in pyproject.toml. tox -e tooling checks that CI and pre-commit stay aligned with those pins.

For local IDEs, pre-commit, or manual commands outside tox, install the same development extras into your active Python 3.13 environment:

python -m pip install -e '.[test,lint,typecheck,dev]'

Then you can run the normal fast test selection directly:

python -m pytest -m "not integration and not external_data"

Ruff does not auto-fix in the default quality gates. To rewrite files intentionally, run explicit fix commands:

python -m ruff check --fix src/chipiron tests
python -m ruff format src/chipiron tests

Coverage

Some integration tests spawn subprocesses, including full Chipiron runs. To ensure coverage is collected from those processes, coverage is configured in pyproject.toml with patch = ["subprocess"].

The pytest defaults already enable coverage. To spell out the same command:

python -m pytest --cov=chipiron --cov-config=pyproject.toml --cov-report=term-missing

If coverage appears empty, ensure:

  • tests are not bypassing Python execution
  • subprocesses are standard Python processes

Integration Testing

For complete end-to-end validation, use the integration test scripts that test the entire installation process in a clean environment:

# Python version (comprehensive logging and reporting)
python scripts/integration_test.py

# Shell version (lightweight and fast)
./scripts/integration_test.sh

# Test with custom repository
python scripts/integration_test.py --repo-url https://github.com/your-fork/chipiron.git

# Keep temporary files for debugging
python scripts/integration_test.py --keep-temp --verbose

These scripts:

  • Create a temporary conda environment
  • Clone the repository fresh
  • Run complete makefile installation
  • Test all components (Stockfish, Syzygy tables, GUI, chess functionality)
  • Generate detailed reports

See scripts/README.md for detailed documentation.


Contributing

Please open issues or pull requests on GitHub.

Development Requirements:

For development and testing, use the extras declared in pyproject.toml:

python -m pip install -e '.[test,lint,typecheck,dev]'

This includes tools for:

  • Type checking (mypy)
  • Linting (pylint, ruff)
  • Testing (pytest, tox)
  • Documentation building (sphinx)
  • Code formatting and development tools

The pre-commit hooks use the pinned Ruff from your active Python environment, so install the development extras before installing the hooks:

pre-commit install

License

This project is licensed under the GPL-3.0 License - see the LICENSE file for details.


Contact

For questions or support, please open an issue.

Metadata

Release files for chipiron 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for chipiron 0.2.3
File Size Uploaded
chipiron-0.2.3.tar.gz 751.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for chipiron 0.2.3
File Interpreter ABI Platform
chipiron-0.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 1.7 MB

Release files / chipiron-0.2.3.tar.gz

Download URL chipiron-0.2.3.tar.gz
Size 751.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7b2f4c0e3b2175605bbe3faa2fba8deaa0b7bfd1cc75cf7a78d8ae87588b2b38
BLAKE2b-256 checksum
How to use checksums
b23e7c11bed263748e8bd5427e35265d5b6be397a63b406e91f89e2a1c195fbc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 21, 2026.

Transparency log

Release files / chipiron-0.2.3-py3-none-any.whl

Download URL chipiron-0.2.3-py3-none-any.whl
Size 946.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3c692c3eba500f13984c309c63975ecc289dca0c024e6964e801b40ab009fa9d
BLAKE2b-256 checksum
How to use checksums
29007d1cf1af28e805606cd6f4495646a8ecd550cff07b48fcc3f8117b8654c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 21, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.4

2 release files

This release

0.2.3 This release

2 release files

0.2.2

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page