Skip to content

docs: disable code coverage for the docs build to fix the ispure doctest - #76

Merged
ChrisRackauckas merged 1 commit into
SciML:mainfrom
ChrisRackauckas-Claude:fix-docs-doctest-coverage
Jul 23, 2026
Merged

ChrisRackauckas merged 1 commit into
SciML:mainfrom
ChrisRackauckas-Claude:fix-docs-doctest-coverage

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

Summary

Fixes the pre-existing Documentation CI failure on main (a doctest error in src/effects.jl:43-48). This is independent of the QA fix in #75.

Root cause

The SciML reusable docs workflow (SciML/.github/.github/workflows/documentation.yml@v1) defaults coverage: true, which runs:

julia --project=docs --code-coverage=user docs/make.jl

Code-coverage instrumentation inserts side-effecting per-line counter writes into every compiled method. Base.infer_effects therefore reports every function — including the internal _effects_capable probe and the doctest's own x -> x^2 + 1 — as not effect-free. ispure (which requires effect-freeness) soundly returns false under coverage, so the doctest

julia> ispure(x -> x^2 + 1, 2.0)
true

evaluates to false and terminates the build.

This is not a runtime regression: ispure returns true in any normal (non-instrumented) run — how the library is actually used. The doctest was newly enabled in #74 (doctest = true, warnonly list removed), which is exactly when the docs build started failing (passed at 327c82b, failed from f3a5550 onward).

Fix

There is no sound in-code fix — under coverage, infer_effects legitimately reports !effect_free for all functions, so ispure cannot certify purity there without becoming unsound. Coverage collected from a doctest-only build is meaningless anyway, so disable it for the docs job via the reusable workflow's documented coverage input:

    with:
      coverage: false

This makes the doctest evaluate real behavior (true) — no warnonly, no doctest edit, no test skipping.

Verification (local)

  • julia --code-coverage=user ... ispure(x -> x^2 + 1, 2.0) → false (reproduces CI)
  • julia ... ispure(x -> x^2 + 1, 2.0) → true
  • Documenter.doctest(FunctionProperties) without coverage → Doctests: FunctionProperties | 1 pass / 1 total

Please ignore until reviewed by @ChrisRackauckas.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PUqzmEnsjgBHHuMVzQo1GE

The SciML reusable docs workflow defaults `coverage: true`, which runs
`julia --project=docs --code-coverage=user docs/make.jl`. Coverage
instrumentation inserts side-effecting per-line counter writes into every
compiled method, so `Base.infer_effects` reports every function -- including
the `_effects_capable` probe and the doctest's `x -> x^2 + 1` -- as not
effect-free. `ispure` therefore soundly returns `false` under coverage, which
fails the `ispure(x -> x^2 + 1, 2.0) == true` doctest in src/effects.jl and
terminates the docs build.

This is not a runtime regression: `ispure` returns `true` in any normal
(non-instrumented) run, which is how the library is actually used. The doctest
was newly enabled in SciML#74 (doctest = true), which is when the docs build began
failing. Coverage from a doctest-only build is meaningless, so turn it off for
the docs job; the doctest then evaluates real behavior and passes without any
warnonly/skip.

Verified locally: with --code-coverage=user, `ispure(x -> x^2 + 1, 2.0)`
returns false; without it, Documenter `doctest(FunctionProperties)` passes 1/1.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review July 23, 2026 11:50
@ChrisRackauckas
ChrisRackauckas merged commit 94c4f0a into SciML:main Jul 23, 2026
10 of 11 checks passed
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.

2 participants