Documentation guide#

Overview#

eagle uses a two-layer documentation system:

  • Doxygen — parses C++/CUDA headers and generates XML from Doxygen docstrings (/** … */ blocks).

  • Sphinx — builds the HTML site from .rst files, pulling in the Doxygen XML via the Breathe extension.

The documentation source lives in docs/. HTML output goes to docs/_build/html/.

Building the docs#

cd docs/
make doxygen html    # Doxygen XML, then the full Sphinx build
make strict          # same, with -W --keep-going (0 warnings required)
make nbexec          # execute every tutorial/example notebook IN PLACE (uses the GPU when one is visible)
make nbcheck         # refuse the build unless every notebook cell has run
make linkcheck        # crawl every link
make livehtml         # watch + auto-rebuild (requires watchdog)
make clean            # wipe _build/ and _doxybuild/

make linkcheck crawls both internal and external links.

Open _build/html/index.html to view the result. Notebooks under content/userguide/tutorials/, content/userguide/examples/ and content/interop.ipynb are executed locally (make nbexec) and committed with their outputs — the Sphinx build itself never re-executes them (nb_execution_mode = "off" in conf.py); make nbcheck is the gate that catches a notebook committed without having been (re-)run.

The notebook gates, the family skin (font, stylesheets, favicons) and the capability map come from the raptor-docs package; docs/raptor_docs.toml holds this repo’s settings and its list of generated files. python -m raptor_docs.fresh --check (run by CI) fails when one is stale; --write regenerates them. It also fails when a copy of a file the package ships is back in docs/.

Dependencies#

A lightweight conda environment ships as environment-light.yml:

micromamba create -p .envs/eagle_docs -f environment-light.yml -y

Or install with pip (the shared docs tooling, raptor-docs, comes from the landing site; offline, use pip install ./site from a checkout of it):

pip install -r docs/requirements.txt

Doxygen must also be on PATH. Building the Python API reference needs the eagle package importable (pip install -e ./python, see Installation); executing the notebooks additionally needs a CUDA GPU and cupy for the GPU notebooks. make nbcheck also runs every notebook (on the CPU, and on the GPU when one is present), so it needs hawk, ipykernel, matplotlib and torch; the NVIDIA Warp cell of interop.ipynb needs warp-lang and prints a note and carries on without it.

Notebooks#

A notebook declares what it needs in its gate metadata, and the notebook gate (python -m raptor_docs.nb run_gate, run by make nbcheck) reads it:

  • "needs": ["pkg", ...] in the notebook metadata: skip the notebook where a package is not installed.

  • "gpu_only": "reason" in the notebook metadata: skip the whole notebook on the CPU leg.

  • "gpu_only": "reason" in one cell’s metadata: the CPU leg stops before that cell, so a CPU tutorial may end with a GPU-only section.

make nbcheck-hosted runs the notebooks the way a Colab user does (a fresh environment, only the installed packages; it needs uv, Python 3.13 and a C++23 compiler, see docs/Makefile), so a notebook should import the package API, never a path in a checkout.

Writing docstrings#

The project uses /** … */ for documented public symbols. The one sanctioned exception is /// @cond INTERNAL / /// @endcond, used to exclude internal-only code from Breathe’s extraction — see the style specifics in Contributing for where that pattern applies.

Short (single-line) form:

/** @brief Return the raw cudaStream_t handle. */
const cudaStream_t& cuda() const;

Long form (detail block):

/**
 * @brief Re-tune the launch geometry of the instantiated graph.
 *
 * @param size  New logical size (active-sample count) for the replay.
 * @note Does not rebuild the graph; only updates node launch parameters.
 */
void setLogicalSize(const idx_t& size);

Tag order: @brief → @tparam → @param → @return → @throws → @pre / @post → @note → @see.

Hide internal helpers from Breathe with /// @cond INTERNAL / /// @endcond, or place them under a detail/ sub-directory (excluded in Doxyfile.in via EXCLUDE_PATTERNS).

Adding a new page#

  1. Create docs/content/<subfolder>/mypage.rst.

  2. Add to the appropriate toctree in docs/index.rst or the section landing page.

  3. Use relative :doc: paths for cross-folder references:

    :doc:`../api/api_graph`    ← from modules/ to api/
    
  4. Add a .. seealso:: footer if the page has natural neighbours.

  5. Add a .. contents:: local TOC at the top if the page is long.

  6. Run make doxygen html and check for Sphinx warnings.

Breathe directives#

.. doxygennamespace:: eagle::cuda
   :project: EAGLE
   :members:

.. doxygenfile:: typedefs.h
   :project: EAGLE

.. doxygenclass:: eagle::cuda::Graph
   :project: EAGLE
   :members: