Contributing¶
Development setup¶
Requirements: Python 3.10+, a C++17 compiler (MSVC 2019+, GCC 9+, Clang 10+), and uv. CMake and Ninja are fetched automatically if missing.
uv sync # environment + editable build of the extension
uv run pre-commit install # ruff, clang-format and hygiene hooks on commit
make check # lint, format check, mypy + stubtest, tests
After editing C++ or CMake files, rebuild with make build. Build options go through
CMAKE_ARGS, for example CMAKE_ARGS="-DFASTGOERTZEL_WERROR=ON" make build to compile with
warnings as errors the way CI does.
Other targets: make cpp-test (doctest suite for the header-only core), make tidy
(clang-tidy, needs it on PATH), make bench / make latency (benchmarks),
make readme-tables (re-render the README tables from bench.json), make docs
(documentation site), make kernel-bench (standalone C++ kernel micro-benchmark).
Layout¶
Path |
Contents |
|---|---|
|
Header-only core: recurrence, finishes, streaming filter. No Python. |
|
Hot loops; compiled twice ( |
|
Runtime selection of the kernel build ( |
|
pybind11 layer: validation, work decomposition, OpenMP, GIL. |
|
Python package, type stubs ( |
|
pytest suite; |
|
Benchmark harness, table renderer, C++ micro-benchmark. |
Rules that the tests enforce and that pull requests must keep:
No input may abort the interpreter: validate before releasing the GIL and before any OpenMP region; nothing inside a parallel region may throw.
Results must not depend on the thread count or on which kernel build is selected beyond rounding (
tests/test_kernels.pychecks both).Anything new in the hot loops must be reachable only through
kernels::Api, so the two instruction-set builds cannot be merged by the linker.Every public function has a stub in
_core.pyi;stubtestruns in CI.
Documentation¶
The site under docs/ is Sphinx with Markdown sources (MyST) and is published to GitHub
Pages by .github/workflows/docs.yml on every push to master; CI builds it with
warnings as errors on every branch. The API page is generated from the docstrings in
cpp/bindings.cpp, with the signatures taken from src/fastgoertzel/_core.pyi, so a new
or changed parameter is documented by editing those two files. The >>> examples in the
docstrings and the python blocks in README.md are executed by tests/test_docs.py.
The changelog and this file are included in the site as they are.
Benchmarks and performance claims¶
Run make bench, which writes bench.json, and make readme-tables to refresh the README
tables from it. Quote a speed-up only together with its baseline, the thread count, and the
machine; the harness prints all three. tests/test_performance.py guards against large
regressions with ratio checks that are machine independent.
Release checklist¶
Update
CHANGELOG.mdby hand: change the heading of the unreleased section to## [X.Y.Z] - YYYY-MM-DD. Re-render the README performance tables from a fresh run (make bench,make readme-tables) if the kernels changed, with nothing else running.Bump the version in
pyproject.tomlwith bumpver, which commits:uv run bumpver update --tag final(dev → release) or--patch/--minor/--major. Thenuv lockand commit the lockfile, otherwiseuv sync --lockedfails at the tag.Push the branch, open a pull request, wait for CI (matrix, sanitizers, C++ tests, clang-tidy, docs, wheel smoke) to pass, merge.
Tag the merge commit
vX.Y.Z(thevmatters: the publish workflow triggers onv*tags only) and push it:git tag -a vX.Y.Z -m "fastgoertzel X.Y.Z",git push upstream vX.Y.Z. The publish workflow builds the sdist and all wheels, runs the test suite inside each wheel build and once more under QEMU with a pre-AVX CPU, then uploads with PyPI trusted publishing.After the upload, create the GitHub Release from the existing tag with the CHANGELOG section as notes. Creating a Release does not re-run the publish workflow. The documentation site is rebuilt and deployed by the merge to
master.