Contributing#

The manifesto behind How we build:

Bloat is future technical debt.
Excessive abstraction hides reality.
Focus and clear boundaries promote flexibility and seamless integration.
Efficiency safeguards portability and scale.
Performance unlocks capabilities.
Rigor earns trust.
Simplicity enables discovery.

Read How we build first: the twelve rules every pull request in the family is read against, plus the style, release and license terms.

This repo: turns your Python into fast kernels. It traces a function, emits C++ built on aether, compiles it, and differentiates it. Running a device artifact is eagle’s job.

Build and run the gate#

hawk has a compiled half (hawk._core) and builds against two sibling checkouts. Clone aether, eagle and hawk side by side, then:

pip install ../aether/dsc               # aether's sealed header payload, first
pip install -e .[test]                  # builds hawk._core; $HAWK_AETHER_INCLUDE / $HAWK_EAGLE_INCLUDE override the sibling paths
python -m pytest tests -q -m "not gpu"  # the gate (.github/workflows/ci.yml)

Most tests also need eagle installed as a Python package to run traced kernels. Without it, host artifacts still run through hawk.load and hawk.run. The free-threading rows run with python -m pytest tests -m ft -W error::RuntimeWarning.

The embedded-C rows (tests/test_embedded_*.py) compile the emitted C and run cppcheck’s MISRA addon over it, so they need a C compiler and cppcheck (brew install cppcheck, or apt-get install cppcheck). Without them the rows fail rather than skip: a skipped check certifies nothing. $HAWK_CC names the C compiler and $HAWK_CPPCHECK the cppcheck binary when they are not on PATH.

Docs (cd docs): pip install -r requirements.txt (it pulls the shared raptor-docs package; offline, pip install ./site from a checkout of the landing site). make strict (zero warnings), make linkcheck, and for notebooks make nbexec then make nbcheck. Keep a new notebook under a minute with small committed outputs. make nbcheck-hosted runs them as a Colab user would; the comments above the target in docs/Makefile say what it needs. Settings for these tools are in docs/raptor_docs.toml; python -m raptor_docs.fresh --check tells whether the generated numbers and the capability map are current (--write regenerates).

What a PR here must show#

  • Generated code mirrors the user’s Python. The emitted C++ keeps the user’s names and structure, so it reads beside their source. A change to emit shows the generated code before and after for a small kernel.

  • A new native function touches six files in two repos. Follow Add a native function; the gate (tests/test_math_namespace.py) fails if a step is missed.

  • Limits. What hawk cannot spell is stated once, with the way out, in when hawk can’t spell it.

  • Derivatives and host/device. A new op has a derivative rule and runs on host and device.

  • The family checklist from How we build, nothing more.

Style specifics#

ruff as configured in pyproject.toml (line length 88, pep257 docstrings). Run ruff check . before pushing.

Release#

Every pull request to main carries one label: release:patch, release:minor, release:major, release:rc, or release:none for a docs-only change. The version is the latest vX.Y.Z git tag plus that label; nothing in the tree holds it. The pull request body is the release note. The whole flow is in RELEASING.md.

How-to#