Skip to content

build(just): add a book recipe so the book gate can be run locally - #836

Merged
nihalpasham merged 2 commits into
NVIDIA:mainfrom
vyncint:build/just-book-recipe
Aug 12, 2026
Merged

nihalpasham merged 2 commits into
NVIDIA:mainfrom
vyncint:build/just-book-recipe

Conversation

@vyncint

@vyncint vyncint commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

The book gate is strict — sphinx-build -W --keep-going, so every warning is an
error — and it had no local counterpart. Nothing in CONTRIBUTING or the
book's own README says how to build it, so a contributor editing a page could
only find out by pushing.

Why it matters more than it sounds

That gate is easy to trip in ways the rendered page does not reveal. A markdown
[text](#some-heading) link fails it, because the book sets
heading_anchors=0 — even though the emitted HTML contains both the href and a
matching id and works fine in a browser. I hit exactly that on #794 and only
caught it because I happened to be building the book by hand.

The recipe's comment records that trap, since it is worth knowing before
writing a link.

What it does

Mirrors the CI job exactly — the same
pip install -r cuda-oxide-book/requirements.txt, the same
sphinx-build -W --keep-going -b html. The virtualenv is created once under
cuda-oxide-book/_build/ and reused on later runs.

Not wired into check: it is the only gate needing a Python virtualenv, and
check otherwise needs none. check's comment already lists the book as
CI-only, which stays accurate for that recipe.

Verification

  • cold run creates the venv and reports build succeeded, exit 0;
  • warm run reuses it;
  • git status afterwards shows only the Justfile change.

(I started to also add cuda-oxide-book/_build/ to the root .gitignore, then
found cuda-oxide-book/.gitignore already carries _build/ — so that edit was
redundant and I dropped it. The recipe relies on the existing rule.)

The book gate is strict -- `sphinx-build -W --keep-going`, so every warning
is an error -- and it had no local counterpart. Nothing in CONTRIBUTING or
the book's own README says how to build it, so a contributor editing a page
could only find out by pushing.

That gate is easy to trip in ways the rendered page does not reveal. A
markdown `[text](#some-heading)` link fails it, because the book sets
`heading_anchors=0`, even though the emitted HTML contains both the href
and a matching id and works in a browser. The recipe's comment says so,
since that is the trap worth knowing before writing a link rather than
after.

`just book` mirrors the CI job exactly: the same
`pip install -r cuda-oxide-book/requirements.txt` and the same
`sphinx-build -W --keep-going -b html`. The virtualenv is created once
under `cuda-oxide-book/_build/` and reused, and that directory is already
covered by `cuda-oxide-book/.gitignore`, so a build leaves the tree clean.

Deliberately not wired into `check`: it is the only gate needing a Python
virtualenv, and `check` otherwise needs none. `check`'s comment already
lists the book as CI-only, which stays accurate for that recipe.

Verified: cold run creates the venv and reports `build succeeded`; warm run
reuses it; `git status` afterwards shows only this Justfile change.

Signed-off-by: Vyncint Ng <[email protected]>
@nihalpasham nihalpasham added build-related Build scripts, toolchain discovery, or compilation setup QoL-improvement Quality-of-life improvement; not a correctness fix labels Aug 12, 2026
@nihalpasham

Copy link
Copy Markdown
Collaborator

Gist: the missing local mirror for the book gate: the recipe's sphinx-build line is character-identical to book.yml's, with a one-time venv. Two comment-level fixes pushed (ef68eb4): conf.py sets no heading-anchor option at all (MyST anchors are off by default, which is why bare #fragment links fail the -W build), and the venv reset for a stale sentinel is now documented (rm -rf cuda-oxide-book/_build/venv).

Verified here:

  • cold run: venv created, build succeeded, exit 0 (16.6s); warm run reuses the venv (0.46s);
  • tree clean after both runs; _build/ already gitignored;
  • build flags match the CI gate byte-for-byte.

Landing once CI is green.

@nihalpasham
nihalpasham merged commit 615ea85 into NVIDIA:main Aug 12, 2026
42 checks passed
nihalpasham pushed a commit that referenced this pull request Aug 13, 2026
unit-tests.yml runs three gates over the generated intrinsic catalog -- `check`
that the checked-in generated sources are current, `probe --all` that every
route still lowers to the recorded PTX, and `check-abi-history` that the
append-only ABI ledger was not rewritten -- and nothing local ran any of them.
A catalog edit could pass `just check` and still fail CI, and the catalog is the
majority of the intrinsic surface: 986 entries across 35 generated files, beside
7 hand-written op modules.

The three cost ~13s together and need no CUDA toolkit, so they join `check`
rather than sitting beside it. `--skip-terminal` is CI's own flag for runners
without the recorded CUDA 13.3 ptxas; llc comes from the pinned toolchain.

`base_ref` defaults to `HEAD^`, matching CI's own fallback for pushes, and takes
a branch point for longer branches (`just check-intrinsics upstream/main`).

Also corrects the `check` docstring, which listed the book build as CI-only
after #836 gave it a local mirror: `just book` is excluded from `check`
deliberately, as the one gate needing a Python virtualenv, not for want of a
recipe.

Verified: `just check-intrinsics` passes on a clean tree (986 routes probed, 986
ledger entries preserved), the default and an explicit `base_ref` both dry-run
correctly, and `just --list` shows the recipe with its default.

Signed-off-by: Vyncint Ng <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build-related Build scripts, toolchain discovery, or compilation setup QoL-improvement Quality-of-life improvement; not a correctness fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants