Repository navigation
docs: disable code coverage for the docs build to fix the ispure doctest - #76
Merged
ChrisRackauckas merged 1 commit intoJul 23, 2026
Conversation
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
marked this pull request as ready for review
July 23, 2026 11:50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the pre-existing Documentation CI failure on
main(a doctest error insrc/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) defaultscoverage: true, which runs:Code-coverage instrumentation inserts side-effecting per-line counter writes into every compiled method.
Base.infer_effectstherefore reports every function — including the internal_effects_capableprobe and the doctest's ownx -> x^2 + 1— as not effect-free.ispure(which requires effect-freeness) soundly returnsfalseunder coverage, so the doctestevaluates to
falseand terminates the build.This is not a runtime regression:
ispurereturnstruein any normal (non-instrumented) run — how the library is actually used. The doctest was newly enabled in #74 (doctest = true,warnonlylist removed), which is exactly when the docs build started failing (passed at327c82b, failed fromf3a5550onward).Fix
There is no sound in-code fix — under coverage,
infer_effectslegitimately reports!effect_freefor all functions, soispurecannot 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 documentedcoverageinput:This makes the doctest evaluate real behavior (
true) — nowarnonly, 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)→trueDocumenter.doctest(FunctionProperties)without coverage →Doctests: FunctionProperties | 1 pass / 1 totalPlease ignore until reviewed by @ChrisRackauckas.
🤖 Generated with Claude Code
https://claude.ai/code/session_01PUqzmEnsjgBHHuMVzQo1GE