Skip to content

Add Doxygen/Sphinx documentation with test-sourced how-to guides, and publish to GitHub Pages - #5

Merged
bfierz merged 6 commits into
mainfrom
feature/documentation-setup
Oct 17, 2026
Merged

bfierz merged 6 commits into
mainfrom
feature/documentation-setup

Conversation

@bfierz

@bfierz bfierz commented Sep 19, 2026

Copy link
Copy Markdown
Contributor
  • Sets up a Doxygen → Breathe → Sphinx documentation pipeline behind a new WEAVER_BUILD_DOCS CMake option.
  • Adds 13 how-to guides under doc/sphinx/howto.rst, each backed by a real, compiled, executed Catch2 test in doc/snippets/ (tagged [doc]).
    • Scalar ops: add, select (branchless max), sqrt, rcp/rsqrt, sgn, tolerance-based equal, any-reduction, dot.
    • Eigen integration: vector arithmetic, squaredNorm, cross, branchless select over an Eigen::Matrix, AlignedBox::merged
  • doc/tools/extract_asm.py disassembles each example's dedicated *_asm.cpp function (compiled in isolation in the new weaver_doc_asm OBJECT library) via objdump, strips the CET landing pad and inter-function alignment padding, and prepends a comment documenting which register holds which parameter.
  • Adds .github/workflows/docs.yml: builds the docs on every push/PR to main, and deploys the result to GitHub Pages on pushes to main (gated so PRs only validate, never publish).

…ippets

Doc examples live as tagged Catch2 tests under doc/snippets/, compiled and
run as part of weaver_tests, so a how-to guide can't silently drift out of
sync with the API it demonstrates -- a broken literalinclude reference fails
the Sphinx build (run with -W). Wired up as an opt-in WEAVER_BUILD_DOCS
CMake target and a separate CI workflow.
doc/snippets/float8_asm.cpp adds a small function whose only job is to be
compiled in isolation and disassembled, so the how-to guide can show the
actual vector instruction the compiler emits instead of just asserting
FloatWeaver is vectorized. Its operands are taken as parameters rather than
literals; literal operands let the compiler constant-fold the addition
away, leaving no vector instruction to show.

doc/tools/extract_asm.py pulls one function's disassembly out of the object
file (objdump -d -C), and a new weaver-asm Sphinx directive (conf.py) embeds
it, mirroring how WEAVER_DOXYGEN_XML_DIR already feeds Breathe.
…p the extracted listings

Adds sqrt/rcp/rsqrt/sgn/tolerance-compare/any/dot guides plus a new
Eigen-integration section (vector arithmetic, squaredNorm, cross,
branchless select, AlignedBox merge), each with real compiled-and-
disassembled asm like the existing add/select guides. Also trims the
CET landing pad and inter-function alignment padding that were
cluttering every listing, and annotates each one with which register
holds which parameter (hand-verified against the real System V AMD64
disassembly, the only calling convention WEAVER_BUILD_DOCS targets).
Adds a deploy job (gated to main pushes, so PRs still only build and
validate) that uploads the Sphinx output as a Pages artifact and
publishes it via actions/deploy-pages.
…n convention

The arm-linux-gnueabihf/QEMU CI leg failed: NEON has no native sqrt
instruction, so weaver::sqrt there is built from an approximate rsqrt
(see intrinsics_neon.cpp), not bit-exact like the x86 vsqrtps path.
The guide's REQUIRE used exact `==`, which happened to round-trip on
every other backend but missed by an ULP here. Switched to
weaver::equal(..., tol) with 1e-5f, the same tolerance the library's
own "Sqrt FloatN" test (src/tests/simd.cpp) already uses for the same
reason.
@bfierz
bfierz force-pushed the feature/documentation-setup branch from 33df614 to ab648f2 Compare September 20, 2026 19:17
@bfierz
bfierz merged commit 90bf12b into main Oct 17, 2026
28 checks passed
@bfierz
bfierz deleted the feature/documentation-setup branch October 17, 2026 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant