Install

ToleranceArena installs as one command line tool, arena. The offline demo needs no API key, no GPU and no network once the tool is installed. On a machine with Ubuntu 24.04 and nothing but curl, the first demo output appears 104 s after install.sh starts (measured, see Measured times).

Pick one route:

RouteNeedsUse it when
1. install.shcurl or wgetYou want one command and a check at the end.
2. uvxuv, gitYou want to try it and leave nothing behind.
3. uv tool install from a taguv, gitYou already use uv.
4. Wheel built from sourcegit, uvYou want a wheel file with a checksum. No wheel is published for 0.1.0.
5. Containerpodman or dockerYou do not want to touch the host Python or libraries.
6. From sourceuv, git, Node.js for the viewerYou want to change the code or run the viewer.

Requirements

ItemRequirementVerified
OSLinux, glibc 2.28 or newerUbuntu 22.04.5 and 24.04.5 and Fedora 45, each as a clean container (2026-12-03); Ubuntu 26.04 on the build machine
macOSWheels exist for Apple silicon and Intelnot verified: no Mac was available
WindowsA wheel exists for win_amd64. install.sh is POSIX sh and does not run there.not verified
CPUx86_64x86_64 only. uv.lock lists a manylinux_2_28_aarch64 wheel of the CAD kernel, and nothing was run on aarch64.
libcglibcAlpine (musl) fails: the CAD kernel has no musl wheel. See Troubleshooting.
Python3.12 only (requires-python = ">=3.12,<3.13")uv downloads and manages it: you need no Python.
System librarieslibGL.so.1, libX11.so.6, libexpat.so.1Present on a desktop system. Missing from the minimal Ubuntu and Fedora container images, where arena prints the fix. No GPU is involved: the CAD kernel only links the libraries.
DiskAbout 1.9 GiB on first install887 MiB tool environment, 874 MiB uv cache (removable with uv cache clean), 110 MiB for Python 3.12. The container image is 1.35 GB.
RAMAbout 1 GiB freearena peaks at 404 MiB resident (/usr/bin/time, arena --help) and the supervised CAD worker at 407 to 462 MiB (measurement.worker_peak_rss_mib of arena doctor), two processes in all. With a 2 GB virtual-memory limit the worker fails to start; see Troubleshooting.
NetworkAt install time: GitHub, PyPI and, when uv is missing, astral.shAfter install, nothing: the demo ran in a container started with --network none.
API keyNoneOnly the AI analyst needs a Groq key. It lives in the optional agents dependency group, which none of these routes install.

1. install.sh: one command

curl -fsSLO https://raw.githubusercontent.com/vladimirrott/tolerance-arena/v0.1.0/install.sh
sh install.sh

The script is about 200 lines of POSIX sh. Read it first if you like. It uses no sudo and writes only under your home directory. A second run reinstalls the same ref and works the same way.

  1. If uv is missing, it prints what it would run and asks: it downloads https://astral.sh/uv/install.sh to a temporary file and runs that file with sh. The uv installer puts uv in ~/.local/bin and adds that directory to your shell profile (UV_NO_MODIFY_PATH=1 skips the profile edit). --yes answers for you. Without --yes and without a terminal, the script stops.
  2. It runs uv tool install --force --python 3.12 --from git+https://github.com/vladimirrott/tolerance-arena@v0.1.0 tolerance-arena. Without git on the machine it installs the source archive of the same ref instead.
  3. It runs arena doctor and prints the first command to try.
FlagEffect
--ref REFInstall this tag, branch or commit instead of v0.1.0.
--yes, -yDo not ask before downloading uv.
--uninstallRemove the tool. uv stays.
--help, --versionPrint the usage or the installer version.

TOLERANCE_ARENA_SOURCE replaces the repository URL (a mirror, or file:///path/to/clone).

2. Try it without installing: uvx

uvx --from git+https://github.com/vladimirrott/tolerance-arena@v0.1.0 arena doctor

uv builds the tool in a cache, runs arena doctor and leaves no installed command. Replace doctor with any arena command. Install uv first with curl -LsSf https://astral.sh/uv/install.sh | sh if you do not have it.

3. Install from a git tag

uv tool install git+https://github.com/vladimirrott/tolerance-arena@v0.1.0
arena doctor

The package name is tolerance-arena and the command is arena. uv tool install --from . arena fails with Package name (`tolerance-arena` provided with `--from` does not match install request (`arena`): write --from . tolerance-arena, or pass the directory alone (uv tool install .).

4. Wheel built from source

The first release publishes no wheel on GitHub. To get one, build it from a checkout of the tag:

git clone --branch v0.1.0 https://github.com/vladimirrott/tolerance-arena && cd tolerance-arena
scripts/build-release.sh          # writes dist/ with the wheel, the source archive and SHA256SUMS
uv tool install dist/tolerance_arena-0.1.0-py3-none-any.whl

This route builds locally and needs git and uv. The wheel holds the package only: the prompts and every file the code reads at run time (tests/test_install_wheel.py checks the file list). Two builds of one tree give byte-identical files.

5. Container

git clone https://github.com/vladimirrott/tolerance-arena && cd tolerance-arena
podman build -t tolerance-arena -f Containerfile .
podman run --rm tolerance-arena
podman run --rm tolerance-arena sweep --angles-deg 0,30,45,60,90 --offsets-mm=-1.2

docker accepts the same commands. The image builds from uv.lock, so the dependency versions match the tested set. It runs as user 10001 and its default command is arena doctor. The base is python:3.12-slim-bookworm (digest sha256:1475c4f5... on 2026-12-03, recorded in the Containerfile). To work on files from the host, mount a directory:

podman run --rm -v "$PWD:/work" tolerance-arena fixture rotating-pin --output spec
podman run --rm -v "$PWD:/work" tolerance-arena search --spec spec/mechanism.yaml --budget 12 --seed 42 --output bundle

Rootless podman maps the host user to root inside the container, so the files come back owned by you. With docker, add --user "$(id -u):$(id -g)".

6. From source

git clone https://github.com/vladimirrott/tolerance-arena && cd tolerance-arena
uv sync --locked
.venv/bin/arena doctor
bash scripts/check-fast.sh

uv sync --locked installs the exact versions of uv.lock, plus the dev group (pytest, ruff, mypy). Add --group agents for the AI analyst, which needs your own Groq key. The gates are local scripts, and no CI service runs them (scripts/check-fast.sh, check-geometry.sh, check-agents.sh). scripts/check-install.sh proves the install routes with real tools and takes minutes; the pre-push hook does not run it.

The web viewer

The built viewer is not in any package. It needs a source checkout and Node.js (22.20.0 with npm 11.12.1 was used; npm ci took 8.6 s and npm run build 21 s, and web/dist is 3.6 MiB):

cd web && npm ci && npm run build && cd ..
.venv/bin/arena serve

npm run build writes web/dist. arena serve binds 127.0.0.1:8765 and serves the local API under /api/v1/ plus the files of web/dist. It looks for web/dist beside the checkout it runs from. A tool installed with routes 1 to 5 has no web/dist, so arena serve serves the API only and prints how to build the viewer. --web-dir DIR points it at any build.

What arena doctor prints

arena doctor checks each capability by doing it once. It exits 0 when all work and 2 when one is missing. This is the output of the image built from the Containerfile (Debian 12, glibc 2.36, 2026-12-03, load average about 20):

ToleranceArena doctor
os: Linux-7.0.0-44-generic-x86_64-with-glibc2.36
python: 3.12.16
build123d: 0.13.0
cadquery-ocp-novtk: 8.0.1.1.0
ocp: 8.0.1.1
occt: not exposed by OCP
tolerance-arena: 0.1.0
worker_start_method: spawn
worker_limits: deadline_s=10.0 terminate_grace_s=2.0 kill_wait_s=2.0
capability.kernel_distance_query: ok (gap 2 mm at 45 deg and 0 mm, oracle 2 mm, difference 0 mm)
capability.failed_query_reporting: ok (an empty shape and an invalid shape raise NativeQueryError)
capability.worker_round_trip: ok (gap 0.8 mm from process 25, oracle 0.8 mm, difference 2.11e-15 mm)
capability.worker_recovery: ok (fresh process 51 answered correctly after SIGKILL of 25)
measurement.worker_startup_s: 3.94842
measurement.worker_query_ms: 11.3206
measurement.worker_peak_rss_mib: 407.5
relation_policy: separated only; touching, overlap and inclusion report unknown; an invalid shape is a failed query
not_advertised: pairs_other_than_pin_obstacle, intersection_and_containment_classification
doctor: ok

A missing system library stops arena before any command runs. The message names the library, the cause and the fix (Ubuntu 24.04 container without libgl1, exit status 2):

arena: the CAD kernel could not load a system library.
  libGL.so.1: cannot open shared object file: No such file or directory
Cause: the wheel of the CAD kernel (cadquery-ocp-novtk) links libGL, libX11 and libexpat. Desktop
systems have them. Minimal server and container images often do not.
Fix, then run `arena doctor` again:
  Debian, Ubuntu: sudo apt-get install -y libgl1 libx11-6 libexpat1
  Fedora, RHEL:   sudo dnf install -y mesa-libGL libX11 expat
  As root (a container), leave out sudo.
Details: https://github.com/vladimirrott/tolerance-arena/blob/main/docs/install.md#troubleshooting

A capability that fails prints MISSING with the cause, and the last line says so. This run set ulimit -v 2000000 (2 GB of virtual memory), which leaves the supervised worker no room to start:

capability.kernel_distance_query: ok (gap 2 mm at 45 deg and 0 mm, oracle 2 mm, difference 0 mm)
capability.failed_query_reporting: ok (an empty shape and an invalid shape raise NativeQueryError)
capability.worker_round_trip: MISSING (RuntimeError: can't start new thread)
capability.worker_recovery: MISSING (RuntimeError: can't start new thread)
doctor: capability missing

Try it

arena sweep --angles-deg 0,30,60,90 --offsets-mm=-1.2     # no_failure_found, exit 0
arena sweep --angles-deg 0,30,45,60,90 --offsets-mm=-1.2  # failure_found, 0.8 mm at 45 degrees, exit 1

The first sweep checked four angles and says so. The second adds 45 degrees and finds the gap. Write a negative value after an equals sign (--offsets-mm=-1.2). Exit status 1 means a violation was found, which is the point of the demo; 2 means something went wrong. Run the whole story from any directory:

arena fixture rotating-pin --output spec
arena search --spec spec/mechanism.yaml --budget 12 --seed 42 --output bundle
arena replay bundle     # replay: match, scenario-bddcb450a86a...

The STEP sample assemblies (fixtures/assembly/, assets/step-samples/) are in the repository and not in the wheel. Clone the repository to try arena assembly on them.

Upgrade, uninstall, offline use

  • Upgrade. uv tool upgrade tolerance-arena stays on the ref you installed and prints Nothing to upgrade (run against a tag). To move to a new tag, run sh install.sh --ref v0.2.0, or uv tool install --force git+https://github.com/vladimirrott/tolerance-arena@v0.2.0.
  • Uninstall. sh install.sh --uninstall or uv tool uninstall tolerance-arena. This removes the tool environment and the arena command. uv cache clean frees the 874 MiB cache, and uv self uninstall removes uv.
  • Offline use. After install, every command in Try it runs without a network. The AI analyst is the only part that needs one, and it needs your own key. To install without a network, run uv tool install --offline ./tolerance_arena-0.1.0-py3-none-any.whl on a machine whose uv cache already holds the dependencies (verified with a warm cache), or use the container image.
  • Where files go. The tool environment is ~/.local/share/uv/tools/tolerance-arena (uv tool dir) and the command is ~/.local/bin/arena (uv tool dir --bin). uv keeps downloads in ~/.cache/uv and its Pythons in ~/.local/share/uv/python. arena writes only to paths you give it (--output), except arena serve, which defaults to runs/api in the current directory.

Troubleshooting

What you seeCauseFix
ImportError: libGL.so.1: cannot open shared object file (arena prints the fix, see above)A minimal image lacks the libraries that the CAD kernel wheel linksDebian, Ubuntu: sudo apt-get install -y libgl1 libx11-6 libexpat1. Fedora: sudo dnf install -y mesa-libGL libX11 expat.
cadquery-ocp-novtk==8.0.1.1.0 has no wheels with a matching platform tag (e.g., musllinux_1_2_x86_64)Alpine and other musl systemsNone: the kernel wheels exist for manylinux_2_28 x86_64 and aarch64, macOS (arm64, x86_64) and Windows (x86_64) only. Use the container on such a host.
You require CPython 3.15 (cp315), but we only found wheels ... cp311, cp312, cp313, cp314uv picked its newest Python for a source archive. This happens on a machine with no PythonAdd --python 3.12: uv tool install --python 3.12 .... install.sh does this itself.
Package name (`tolerance-arena`) provided with `--from` does not match install request (`arena`)arena is the command, tolerance-arena is the packageuv tool install --from . tolerance-arena
arena: command not found after install~/.local/bin is not on PATHuv tool update-shell, then open a new shell.
git: command not found with a git+https:// URLThe git routes need gitInstall git, or use route 1 (it falls back to the source archive) or route 4.
arena --help takes 6 s, the first run 17 sEvery command imports the CAD kernel (about 3.5 s) and the first run compiles bytecode. Measured on a machine at load average 15 to 25None needed.
OpenBLAS error: Memory allocation still failed or worker_round_trip: MISSING (RuntimeError: can't start new thread)A virtual-memory limit (ulimit -v) below about 2 GBLift the limit; plan for 1 GiB of free RAM.
arena serve answers 404 at / and prints serves the API onlyNo web/dist: the viewer is not part of the installed toolBuild it from a checkout, see The web viewer, or pass --web-dir.
uv tool install ends with install failed from install.sh and no other causeNo network, or the ref does not existRead the uv lines above the message. Check the ref with git ls-remote https://github.com/vladimirrott/tolerance-arena.

Measured times

Every container started from the stock image with curl and ca-certificates only (no Python, no uv), ran install.sh against a tagged snapshot of the working tree through a file:// source, then the demo sweep. The build machine was at load average 12 to 25 and every package came over the network. The times are one run each (2026-12-03).

ImageRoute insideinstall.sh start to arena doctor: okDemo sweepNotes
ubuntu:24.04, libraries installed firstsource archive (no git)96 s8 s104 s from the first command to the first demo output
ubuntu:24.04source archive (no git)99 s, stopped at the missing libraries11 safter the printed apt-get fix and a second install.sh run: 143 s, 154 s in all
ubuntu:22.04git tag82 s, stopped at the missing libraries12 safter the fix and a second run: 153 s, 165 s in all
fedora:latest (Fedora 45)git tag87 s, stopped at the missing libraries10 safter the fix and a second run: 156 s, 166 s in all

In the two containers with git (ubuntu:22.04 and fedora) the script also ran uvx --from git+file:///repo@TAG arena doctor, with no --python flag, and it printed doctor: ok. A manual run in ubuntu:24.04 gave the same result with and without --python 3.12. The Containerfile builds in 207 s (first build) and 484 s (rebuild with the library layer) on the same machine, and podman run of the image prints doctor: ok in 19 s.

Maintainers: cut a release

scripts/build-release.sh builds dist/ (gitignored), writes dist/SHA256SUMS and prints the commands to run. It uploads nothing, and refuses a dirty tree, a tag on another commit, and an install.sh that names another version than pyproject.toml.