Skip to content

Improve docstrings and build docs with checkdocs=:all - #312

Draft
ChrisRackauckas-Claude wants to merge 3 commits into
masterfrom
agent/138-/tmp/task-138.md
Draft

ChrisRackauckas-Claude wants to merge 3 commits into
masterfrom
agent/138-/tmp/task-138.md

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

🚧 UNREVIEWED — awaiting review by @ChrisRackauckas. Filed by an AI agent running as @ChrisRackauckas; Chris has not seen this.
Harness: Muse CLI Code · Model: muse-wonder-full-1.0
Conversation: local job 138-muse (no session URL)

Closes #138

What changed and why

The warnonly = [:missing_docs, :docs_block] line named in the issue is already gone on master, but docs/make.jl still only used checkdocs = :exports, so documented internal names that never appear in the manual were invisible to the docs build. This PR improves those docstrings (accurate signatures, # Arguments, # Returns; this fixes two wrong signature lines — arnoldi_step! was documented as a Lanczos step with arguments in the wrong order, and lanczos_step! listed arguments it does not take), adds a module docstring for ExponentialUtilities, renders all 15 previously unlisted docstrings on a new Internal API page (docs/src/internal.md, marked as carrying no stability guarantee), and builds the docs with checkdocs = :all, warnonly = false so a docstring missing from the manual fails the build instead of passing silently. .factory-pre-push.json declares the repository's existing Runic formatter for the worker pre-push gate, which blocked the first push attempt for lack of a declaration; it only restates the julia --project=@runic -m Runic --check command from AGENTS.md.

No executable code changes: every src/ edit is inside a docstring.

Verification

Before, on the unmodified tree, a docs build with checkdocs = :all, warnonly = false failed:

┌ Error: 15 docstrings not included in the manual:
│
│     ExponentialUtilities.arnoldi_step! :: Union{...}
│     ExponentialUtilities.coeff :: Union{...}
│     ExponentialUtilities._phi_almohy_generic :: Tuple{AbstractMatrix, Integer}
│     ExponentialUtilities.@diagview :: Union{Tuple{Any}, Tuple{Any, Integer}}
│     ExponentialUtilities.firststep! :: Tuple{KrylovSubspace, Vararg{Any, 7}}
│     ExponentialUtilities.firststep! :: Tuple{KrylovSubspace, Any, Any, Any}
│     ExponentialUtilities.expT! :: Union{...}
│     ExponentialUtilities.lanczos_step! :: Union{...}
│     ExponentialUtilities.symtridiag_eigen! :: Union{...}
│     ExponentialUtilities._phi_almohy! :: Tuple{...}
│     ExponentialUtilities.realview :: Union{...}
│     ExponentialUtilities.phiv_dense :: Tuple{Any, Any, Any}
│     ExponentialUtilities.phiv_dense! :: Union{...}
│     ExponentialUtilities.get_expcache! :: Union{...}
│     ExponentialUtilities.pade_order_for_type :: Union{...}
│
│ These are docstrings in the checked modules (configured with the modules keyword)
│ that are not included in canonical @docs or @autodocs blocks.
└ @ Documenter ...
ERROR: LoadError: `makedocs` encountered an error [:missing_docs] -- terminating build before rendering.

After, julia --project=docs docs/make.jl (now itself checkdocs = :all, warnonly = false) exits 0:

[ Info: SetupBuildDirectory: setting up build directory.
[ Info: Doctest: running doctests.
[ Info: ExpandTemplates: expanding markdown templates.
[ Info: CrossReferences: building cross-references.
[ Info: CheckDocument: running document checks.
[ Info: Populate: populating indices.
[ Info: RenderDocument: rendering document.
[ Info: HTMLWriter: rendering HTML pages.

GROUP=Core julia --project -e 'using Pkg; Pkg.test()':

Test Summary:      | Pass  Broken  Total     Time
Core/basictests.jl | 1139       1   1140  5m21.8s
     Testing ExponentialUtilities tests passed

GROUP=QA julia --project -e 'using Pkg; Pkg.test()':

Test Summary: | Pass  Broken  Total     Time
QA/qa.jl      |   28       2     30  2m23.9s
     Testing ExponentialUtilities tests passed

(The broken markers are the pre-existing AllocCheck expectations in test/qa/qa.jl and one pre-existing Core broken test; both test files are untouched.)

Also run and passing: julia --project=@runic -m Runic --check on every changed .jl file, typos src ext test docs, and a signature audit printing methods(...) for every internal name whose docstring signature line changed, confirming the documented argument order matches the definitions.

What was not verified

  • GROUP=GPU (needs CUDA hardware); no executable code changed.
  • Docs deployment (deploydocs); the local build stops at rendering, as without CI credentials it cannot deploy. linkcheck = true was active in the local build.
  • The StaticArrays extension's own expv method docstring in ext/ is not part of the modules = [ExponentialUtilities] docs build (StaticArrays is not in the docs environment), so checkdocs = :all does not cover it; it is unchanged.

What a reviewer should push back on

  • Whether internal names belong in the rendered manual at all. The alternative that also passes checkdocs = :all is deleting those docstrings or demoting them to comments; this PR instead documents them on a clearly-labelled Internal API page. If that page is unwanted, keeping checkdocs = :exports and only the docstring-text fixes is the smaller change.
  • checkdocs = :all is stricter than the issue strictly requires now that warnonly is gone: any future internal docstring must be added to docs/src/internal.md or the docs build fails. That is the intended guard, but it is a recurring maintenance step.
  • .factory-pre-push.json is worker-gate metadata, not package functionality. Drop that commit if it should not live in this repository; the docs change does not depend on it.
  • Factual claims in the rewritten docstrings were checked against the implementations (method tables, call sites, return values), but the descriptions of the augmented-system arguments (n, p, t, mu, l) deserve a read from someone who uses that path.

Risk assessment

  • Risk: low (documentation-only diff; the checkdocs strictness increase can only fail future docs builds, not library code)
  • Blast radius: no executable code, public API, or test changes. Downstream packages are unaffected. The docs CI job becomes stricter.
  • Evidence: before/after docs builds and Core/QA test summaries above, all run locally on this branch.
  • Independent review: none yet; awaiting review.
  • Merge: needs human review — the Internal API page and checkdocs = :all are policy choices a maintainer should confirm.

🤖 Posted by an AI agent — harness: Muse CLI Code · model: muse-wonder-full-1.0
Conversation: local job 138-muse (no session URL)

ChrisRackauckas and others added 3 commits November 10, 2026 06:23
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Muse <noreply@meta.com>
Agent-Harness: Muse CLI Code
Agent-Model: muse-wonder-full-1.0
Agent-Session: local job 138-muse (no session URL)
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Muse <noreply@meta.com>
Agent-Harness: Muse CLI Code
Agent-Model: muse-wonder-full-1.0
Agent-Session: local job 138-muse (no session URL)
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Muse <noreply@meta.com>
Agent-Harness: Muse CLI Code
Agent-Model: muse-wonder-full-1.0
Agent-Session: local job 138-muse (no session URL)
@ChrisRackauckas

Copy link
Copy Markdown
Member

🤖 Automated comment from an AI agent running as @ChrisRackauckas — not written or reviewed by Chris.

Independent review (Codex CLI v0.164.0 / gpt-6.1-sol), reviewer session 01a1c56a-29ac-7743-8ebd-c05c8f38948e, reviewed head 1b573d0

  • Verdict: CHANGES
  • Risk assessment: low (L1: docstrings, manual coverage and strict docs-build configuration; no executable numerical changes).
  • Round / slot: 1 / 1

This is a blind code-only review by a session other than the PR author's, copied below from the reviewer's report with only the grading metadata removed. The posting agent did not re-run the reviewer's commands. A MERGE verdict is advice; merging is left to the maintainers.

Risk

low (L1: docstrings, manual coverage and strict docs-build configuration; no executable numerical changes).

Blocking findings

  • Verdict: CHANGES
  • Round: 1
  • Blocking priorities: P2, P2
  • Deferred P2 issues: None supplied.
  1. [P2] src/arnoldi.jl:285 — Document the supported augmented starting-vector shape. The new text advertises a matrix and a selectable column l, but firststep! derives the physical dimension from length(b), so a multi-column matrix cannot satisfy the normalization assignment. Confirmed by running firststep!(K, V, H, [3. 1.; 4. 2.; 0. 3.], zeros(2), 0.25, 1.0, 2) with adequately sized storage: DimensionMismatch: array could not be broadcast to match destination. A single-column (3,1) input succeeds. Restrict the documented shape and column index to what the implementation supports; do not advertise arbitrary matrix columns. This requests a documentation correction, not an algorithm change.

  2. [P2] src/phi_almohy.jl:479 — Narrow the numerical-failure guarantee to failures actually detected. The new return contract says numerical failure fills the outputs with NaN and sets a nonzero cache.info[], but recovery overflow bypasses that reporting. Confirmed with A = fill(710.0, 1, 1), p = 2, matching PhiPadeCache and three preallocated outputs: _phi_almohy! returns [Inf, 3.1464715016365602e305, 4.431650002305015e302] with cache.info[] == 0; input 1000.0 returns [Inf, Inf, Inf] with the same zero code. Document the detected Padé-solve/nonfinite-solve failures specifically, and state that recovery overflow can leave nonfinite outputs with a zero code. The implementation is unchanged; the new blanket contract is inaccurate.

Non-blocking findings

  • src/ExponentialUtilities.jl:54 — The expanded @diagview documentation still describes arbitrary diagonal offsets, while the existing implementation only matches conventional diagonals for the offsets used by this package. Confirmed on A = reshape(collect(1:16), 4, 4): offset 2 gives [6,11,16] instead of diag(A,2) == [9,14]; offset -2 gives [3,8,13] instead of [3,8]. This behavior and the broad diagonal claim predate the PR. Consider documenting the supported offsets explicitly when publishing the new internal manual page.

What I ran

All Julia package operations, generated manifests, builds and probes ran in scratch/head, an exact HEAD archive with local Git metadata added for Documenter's source links. The reviewed checkout was unchanged. TMPDIR was set to the requested job directory before commands, and the supplied layered JULIA_DEPOT_PATH was preserved. Test jobs used four Julia threads and memory-capped scopes.

  • Read the root AGENTS.md (no root CLAUDE.md exists), git diff origin/master...HEAD, affected implementations/tests and the supplied risk criteria. Recorded independent risk before reading any author rating; no PR body, comments, other reviews or author rating were consulted.
  • julia --version: julia version 1.13.2. There is no committed Julia manifest or interpreter-version lock. Resolved the declared Project.toml constraints in scratch; selected dependencies included LinearSolve 5.18.3, StaticArrays 1.9.24 and SciMLTesting 2.13.3.
  • GROUP=Core julia --project -e 'using Pkg; Pkg.test()': exit 0; 1139 passed, 1 broken, 1140 total. The existing skip at test/basictests.jl:651 is unchanged.
  • GROUP=QA julia --project -e 'using Pkg; Pkg.test()': exit 0; 28 passed, 2 broken, 30 total. Both broken assertions already exist in test/qa/qa.jl.
  • Developed the scratch package into its docs environment, then ran julia --project=docs docs/make.jl with Documenter 1.20.0: exit 0, including checkdocs = :all, strict warnings and link checking. Deployment was automatically skipped outside CI. The first archive-only attempt failed because Documenter requires Git metadata; the completed rerun used local metadata and the unmodified build script.
  • julia --project=@runic -m Runic --check on all nine changed Julia files: exit 0. typos src ext test docs: exit 0.
  • julia --startup-file=no scratch/astcheck.jl: 7/7 assertions passed; all changed source files have identical parsed executable syntax to origin/master after stripping docstrings and line metadata.
  • julia --project=scratch/head scratch/probes.jl: 92/92 assertions passed. Independent references included exact nilpotent phi series, known Arnoldi/Lanczos coefficients, eigendecomposition residuals/orthogonality and Julia's matrix exponential. Covered Float32, Float64 and complex dense phi evaluation, tridiagonal sizes 0/1/2/8, real-view aliasing and cache-return aliasing. One initial reviewer assertion used exact equality for floating-point normalization; it was corrected to a precision-derived 4eps(Float64) relative tolerance before the passing run.
  • scratch/probes.jl and scratch/contracts.jl additionally logged the concrete contract counterexamples above, plus nonfinite inputs (NaN/Inf correctly produced info = -1 and NaN outputs) and finite negative scalar inputs through magnitude 1e300.
  • Requested uv run --locked python --version: printed Python 3.15.0 and warned that --locked has no effect outside a project. No uv.lock or pyproject.toml exists in this Julia checkout; this does not establish a project-locked Python interpreter, and no Python verification relied on it.
  • Final git diff --exit-code, cached diff and status were clean; HEAD matched the requested full SHA. All started commands completed before this report was finalized.

What I did not verify

GPU execution, other Julia versions/platforms, downstream packages and actual documentation deployment. No GPU/AD implementation changed. No project-locked Python environment is supplied. The requested corrections above are supported by executed probes; no speculative numerical regression is alleged.


🤖 Posted by an AI agent — harness: Claude Code 2.1.322 · model: claude-sonnet-5-5
Conversation: local session 3878b54e-28f2-4a01-a176-a8f5468d1997 (no session URL)

This branch has not been deployed

No deployments
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.

Improve docstrings

2 participants