Skip to content

docs: build docs on Julia 1.12 to avoid Enzyme BLAS segfault - #218

Closed
ChrisRackauckas-Claude wants to merge 4 commits into
SciML:mainfrom
ChrisRackauckas-Claude:docs/headless-plots-gkswstype
Closed

ChrisRackauckas-Claude wants to merge 4 commits into
SciML:mainfrom
ChrisRackauckas-Claude:docs/headless-plots-gkswstype

Conversation

@ChrisRackauckas-Claude

@ChrisRackauckas-Claude ChrisRackauckas-Claude commented Sep 17, 2026 •

Copy link
Copy Markdown
Member

Please ignore until reviewed by @ChrisRackauckas.

What changed and why

The Documentation workflow segfaults (Segmentation fault, exit 139, no Julia stack trace) during ExpandTemplates, on main and on this branch. Root cause: the reusable docs workflow's julia-version: 1 moved from Julia 1.12.7 (last green docs run, 2026-09-07: https://github.com/SciML/DifferenceEquations.jl/actions/runs/34149654236) to Julia 1.13.0 (first red run, 2026-09-11: https://github.com/SciML/DifferenceEquations.jl/actions/runs/34655435993), and on Julia 1.13 Enzyme v0.13 cannot differentiate stdlib BLAS/LAPACK. The repo already documents this in test/test_groups.toml: "pre" (Julia 1.13-rc): Enzyme cannot differentiate stdlib BLAS/LAPACK (gemv!/dot/potrf! -> ijl_lazy_load_and_lookup / LLVM verification errors).

Documenter debug logging on CI pinpoints the crash: on docs/src/advanced/enzyme_ad.md (expanded first, alphabetically) the joint-likelihood @example block completes, then the second block — reverse-mode autodiff(Reverse, kf_loglik, …) through KalmanFilter — segfaults 13 s after it starts. That path calls cholesky!!/potrf! and BLAS gemm.

The fix pins the docs build to Julia 1.12 (julia-version: "1.12"), the version the package's Enzyme AD suite is documented to pass on and on which the Sep 7 docs run was green. All @example blocks still execute. The earlier GKSwstype = "100" change (and the temporary JULIA_DEBUG diagnostic) is reverted: the crash is in Enzyme AD, not GR, and GR already falls back to headless mode on its own (GKS: cannot open display - headless operation mode active). The diff against main is now just the workflow pin.

Verification (local, Julia 1.12.4)

Full docs build, julia --project=docs docs/make.jl from the repo root (after julia --project=docs -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()') exits 0 with 0 failed @example blocks:

GKS: cannot open display - headless operation mode active
[ Info: SetupBuildDirectory: setting up build directory.
[ Info: Doctest: running doctests.
[ Info: ExpandTemplates: expanding markdown templates.
[ Info: ExtCrossReferences: building external (DocumenterInterLinks) cross-references.
[ Info: CrossReferences: building cross-references.
[ Info: CheckDocument: running document checks.
[ Info: Populate: populating indices.
[ Info: RenderDocument: rendering document.
[ Info: HTMLWriter: rendering HTML pages.
...
[ Info: Automatic `version="1.1.5"` for inventory from ../Project.toml
┌ Warning: Documenter could not auto-detect the building environment. Skipping deployment.

julia -e 'using Runic; Runic.main(["--check", "docs/make.jl"])' exits 0.

CI evidence for the version change: run 34149654236 (green, julia version 1.12.7) precedes run 34655435993 (exit 139, julia version 1.13.0); the three failing main runs all segfault in ExpandTemplates.

Not verified

  • The new Documentation run with julia-version: "1.12" was still pending when this body was updated.
  • The segfault could not be reproduced locally: the full docs build and the extracted Enzyme blocks pass on this machine under both Julia 1.12.4 and 1.13.0 (with and without --code-coverage=user), so the failure is specific to the CI runner's BLAS/CPU. The version-change correlation and the repo's own documented Enzyme/1.13 limitation are the basis for the pin.
  • Root cause is upstream (Julia 1.13 + Enzyme v0.13 stdlib-LAPACK differentiation); nothing upstream is changed here. A maintainer may prefer a different supported-Julia pin or to revisit once Enzyme supports 1.13.

🤖 Generated with OpenCode (model: muse-spark-1.3-contributor-free); no public session URL (local session at /home/crackauc/sandbox/tmp_20260917_040834_91074).

Set GKSwstype=100 before building the docs so the Plots.jl tutorial
figures render without touching display state. CI docs builds
segfault (exit 139) inside ExpandTemplates while running the Plots
tutorials on headless runners; same pattern as EasyModelAnalysis.jl,
which sets this for the same reason.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Agent-Harness: OpenCode
Agent-Model: muse-spark-1.3-contributor-free
Agent-Session: local session at /home/crackauc/sandbox/tmp_20260917_040834_91074 (no public conversation URL)
The comment claimed plots only "throw a bunch of warnings / errors"; the
actual CI failure is a hard SIGSEGV (exit 139) with no Julia stack trace
while GR probes for a display during ExpandTemplates. State that, so the
override is not mistaken for cosmetic warning suppression.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Agent-Harness: OpenCode
Agent-Model: muse-spark-1.3-contributor-free
Agent-Session: local session at /home/crackauc/sandbox/tmp_20260917_040834_91074 (no public conversation URL)
Diagnostic-only; will be reverted before this PR is ready.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Agent-Harness: OpenCode
Agent-Model: muse-spark-1.3-contributor-free
Agent-Session: local session at /home/crackauc/sandbox/tmp_20260917_040834_91074 (no public conversation URL)
The Documentation job uses the reusable workflow's `julia-version: 1`, which
moved from Julia 1.12.7 to 1.13.0 between the green 2026-09-07 run and the
first red run on 2026-09-11. On Julia 1.13, Enzyme cannot differentiate
stdlib BLAS/LAPACK (`potrf!`/`gemv!`), as test/test_groups.toml already
documents, and the Enzyme reverse-mode block in
docs/src/advanced/enzyme_ad.md segfaults during ExpandTemplates (exit 139,
no Julia stack trace). Pin the docs build to Julia 1.12, the version the
package's Enzyme AD suite and the full local docs build pass on.

This also reverts the earlier `GKSwstype=100` change: the segfault is in
the Enzyme AD page, not GR, and GR already falls back to headless mode on
its own ("GKS: cannot open display").

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Agent-Harness: OpenCode
Agent-Model: muse-spark-1.3-contributor-free
Agent-Session: local session at /home/crackauc/sandbox/tmp_20260917_040834_91074 (no public conversation URL)
@ChrisRackauckas-Claude ChrisRackauckas-Claude changed the title docs: force headless GR backend for tutorial plots docs: build docs on Julia 1.12 to avoid Enzyme BLAS segfault Sep 18, 2026
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