Development¶
How to build, test and change bucket-graph-spprc. The README covers using the library, the CLI, the benchmarks and running the tests; this page is for working on it.
Build and gate¶
The local gate is the three blocks under ## Build & Test in
CLAUDE.md:
clean, build (Ninja when installed) and the full ctest suite. The pre-push
hook in .githooks/ runs them in a fresh worktree of the pushed commit, after
checking for a review receipt; configuring the build once points
core.hooksPath at .githooks. CLAUDE.md also covers the compilers, the lint
tests (label lint), the Python tools in .venv
(uv venv && uv pip install -r requirements-dev.txt) and the review receipt.
Documentation site¶
The site at https://spoorendonk.dk/bucket-graph-spprc/ is built with Sphinx
from docs/: docs/index.md includes the README, and beside it are this page,
the internals (docs/internals.md) and a C++ reference (Doxygen XML of the
user-facing headers, rendered by Breathe; CPP_HEADERS in docs/conf.py
lists them). It also writes llms.txt and llms-full.txt, the latter with
the README and those headers appended. Build it with doxygen on PATH:
uv run --only-group docs sphinx-build -W -b html docs build/docs/html
-W turns warnings into errors; the build is warning-free. The Sphinx packages
are the docs dependency group of pyproject.toml, which holds nothing else:
uv run --only-group docs installs them into .venv, beside the tools from
requirements-dev.txt. Don’t uv sync, which removes those. In a linked
worktree, run it from the main checkout, or install the group there with
uv pip install --group docs: uv run would make the worktree a .venv of
its own with the docs group alone, and configure, which takes the worktree’s
.venv before the main checkout’s, would then find no pytest there.
The gate keeps the build warning-free: the ctest test docs_build (label
docs) runs it, into the build directory’s docs/html, when configure finds
doxygen and the .venv Python has the docs group. Without either,
configure warns and the test is not registered. A push that changes only the
README or files under docs/ still runs the gate (the ci-code block in
CLAUDE.md).
The docs workflow (.github/workflows/docs.yml) builds the site and deploys
it to GitHub Pages. It runs on a release tag (v and a digit) or by hand
(gh workflow run docs.yml), never on a push to a branch or a pull request:
the local gate is the CI. The sidebar and llms.txt name the version the site
was built from, read from git describe over the release tags: the tag for a
tag deploy, or main (after v0.2.0, abc1234) for a build from main.
The accent colour is set in docs/conf.py. The landing page’s figure, the
link-preview card, the sidebar logos and the favicon in docs/figures/ are
drawn from the library’s own bucket graph: bucket_graph.cpp solves a small
SPPRC and dumps its buckets, bucket arcs and optimal path, and
make_bucket_graph.py checks the dump against the problem data and draws it:
cmake --build build --target docs_bucket_graph
python3 docs/figures/make_bucket_graph.py build/docs_bucket_graph
The script needs Python 3.10 or later, and draws the card, a PNG, with cairosvg
through uvx.
The ctest test docs_figure (label docs) fails when the committed SVGs are
not what the script draws, so run it after a change that moves the bucket graph.