Skip to content

Fix main's CI and widen dependency compat - #446

Merged
seabbs merged 4 commits into
mainfrom
fix/main-ci
Nov 25, 2026
Merged

seabbs merged 4 commits into
mainfrom
fix/main-ci

Conversation

@seabbs-bot

@seabbs-bot seabbs-bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

What this does

Gets main green again and lets its dependencies move to their latest releases, so #430 can be tested against a working main.

  • Catalyst extension: it used NamedDist, which DynamicPPL 0.42.14 removed, so every test job, the docs build and coverage failed on the Catalyst items.
    DynamicPPL names a sampled variable after the literal left-hand side of ~, and the extension's names (β, S, ...) come from the Catalyst system at run time.
    So _named_tilde!! makes the calls ~ itself makes under a VarName{s.name}(): a fixed value is returned, a conditioned one is scored, and anything else is drawn.
    The flat variable names and conditioning by name are unchanged, and new tests cover conditioning, fixing and prefixing.
  • ReverseDiff: the renewal window update called hcat(::Matrix{TrackedReal}, ::TrackedArray), which is ambiguous between ReverseDiff and SparseArrays once both are loaded, failing ad / ReverseDiff (tape) and (compiled).
    It is now cat(...; dims = 2).
  • Enzyme on mixed renewal modifiers: a renewal with a modifier that draws parameters and one that draws none (Renewal+ImportedCases) failed Enzyme's type analysis.
    The resolved modifiers are now passed down the recursion rather than splatted back up.
  • Enzyme on partially missing observations: scoring a partially missing series built a Vector{Any} and narrowed it to Vector{Union{Missing, T}}, which Enzyme rejected in both modes.
    The returned series is the data as given, so it now comes from _restore_missing, which the Enzyme extension marks inactive.
    DirectInfections+PartiallyMissing passes under Enzyme forward and reverse, so its Enzyme reverse broken entry is removed.
    The scenario's log density is about 5 times faster (1.1–1.3 µs to 245 ns) and its Mooncake gradient about 6 times faster (21 µs to 3.6 µs).
  • Compat: folds in the widening from chore(deps): bump the julia-isolated group across 3 directories with 16 updates #441 and chore(deps): bump the julia group across 1 directory with 7 updates #443: Turing 0.49, Catalyst 17, FlexiChains 0.7, DocStringExtensions 0.10, MCMCChains 8, CSV 1.3, and stdlib compat for the test and docs environments.
    The Runic bumps are left out, because Runic is pinned exactly in the managed formatter environment.

Checks

  • Full test suite, Julia 1.12.7, resolved to the newest allowed versions (Catalyst 17.0.3, ModelingToolkit 11.46.1, ForwardDiff 1.5.0): 2517 passed, 6 broken, no failures or errors; the observation and missing-data items pass again after the last change (380).
  • ad / ReverseDiff (tape) on Julia 1.13.4: 987 passed, 1 broken.
  • ad / Enzyme reverse and ad / Enzyme forward on Julia 1.13.4 with Enzyme 0.13.221 no longer abort. In CI on 4cfd9e5 they gave 924 passed / 2 errored and 904 passed / 3 errored; 1d3b573 clears DirectInfections+PartiallyMissing, leaving the two scenarios below.

Not fixed here

  • Two Enzyme scenarios, Renewal+UncertainLatentDelay and Renewal+UncertainGenInterval, still fail in both modes.
    Their delay parameters are a product_distribution of differently typed priors, a Vector{Distribution}, and Enzyme rejects the union in Bijectors' product transform for it.
    That is upstream (Bijectors and Enzyme). Distributions has no tuple product to avoid it here.
  • Turing stays at 0.46. Turing 0.47 and 0.49 cap CensoredDistributions at 0.2.5, and the package needs 0.2.22, so the resolver keeps 0.46 until Turing widens that cap. The 0.49 compat entry is untested until then.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WwC7iygGpznktvYSbjCqxZ

The Catalyst extension used `NamedDist`, which DynamicPPL removed; it
now samples each species and rate under its own name through the calls
`~` makes, keeping the flat names and conditioning.
The renewal window update uses `cat`, as ReverseDiff's tracked `hcat`
is ambiguous with SparseArrays' once both are loaded.
Compat now admits Turing 0.49, Catalyst 17, FlexiChains 0.7,
DocStringExtensions 0.10, MCMCChains 8 and CSV 1.3, with stdlib compat
entries for the test and docs environments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WwC7iygGpznktvYSbjCqxZ
seabbs-review-bot[bot]

This comment was marked as resolved.

@seabbs-review-bot seabbs-review-bot Bot added the llm-reviewed Reviewed by seabbs-review-bot label Nov 23, 2026
…difiers

Conditioning, fixing and prefixing a Catalyst-named variable are now
tested.
A renewal mixing a modifier that draws parameters with one that draws
none failed Enzyme reverse; the resolved modifiers are now passed down
the recursion rather than splatted back up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WwC7iygGpznktvYSbjCqxZ
@github-actions

Copy link
Copy Markdown
Contributor

Try this Pull Request!

Option 1: Julia Package Manager

Open Julia and type:

import Pkg
Pkg.activate(temp=true)
Pkg.add(url="https://github.com/EpiAware/ComposableTuringIDModels.jl", rev="fix/main-ci")
using ComposableTuringIDModels

Option 2: Local Checkout

If you have the repo locally:

git checkout fix/main-ci
julia --project=. -e "using Pkg; Pkg.instantiate()"

@codecov

codecov Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
ad-forwarddiff 62.75% <100.00%> (-0.14%) ⬇️
ad-mooncake-forward 62.75% <100.00%> (-0.14%) ⬇️
ad-mooncake-reverse 62.75% <100.00%> (-0.14%) ⬇️
ad-reversediff 62.86% <100.00%> (-1.22%) ⬇️
ad-reversediff-compiled 62.86% <100.00%> (-1.22%) ⬇️
unit 93.96% <100.00%> (+0.17%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
ext/ComposableTuringIDModelsEnzymeExt.jl 58.82% <ø> (ø)
...servation_models/ObservationErrorModels/methods.jl 100.00% <100.00%> (ø)
src/steps/RenewalStep.jl 91.07% <100.00%> (-1.92%) ⬇️
src/steps/RenewalSteps.jl 100.00% <100.00%> (ø)

... and 19 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Collaborator Author

ad / Enzyme reverse on 4cfd9e5: 924 passed, 2 errored, 2 broken.
The two errors are the scenarios listed under "Not fixed here", Renewal+UncertainLatentDelay and Renewal+UncertainGenInterval.
Enzyme rejects the union in Bijectors' product transform for a product_distribution of differently typed priors, which is upstream.
On main the whole job aborted on Julia 1.13.4; with Enzyme 0.13.221 it runs, and Renewal+ImportedCases passes after this PR's modifier fix.


Generated by Claude Code

Copy link
Copy Markdown
Collaborator Author

ad / Enzyme forward on 4cfd9e5: 904 passed, 3 errored, 1 broken. On main this job aborted on Julia 1.13.4, so these are the first results it has given.

  • Renewal+UncertainLatentDelay and Renewal+UncertainGenInterval: the same upstream Bijectors/Enzyme product-of-mixed-priors failure as under Enzyme reverse.
  • DirectInfections+PartiallyMissing: Enzyme's type analysis rejects the Vector{Union{Missing, Float64}} that marginalising a partially missing series rebuilds (_score_missing_observations!!).
    ADFixtures already lists this scenario as broken for Enzyme reverse, for the same reason, but not for Enzyme forward.

I haven't added it to the forward broken list, since that would mark a failing test as expected.
If you'd like it listed there too, alongside the reverse entry, say so and I'll add it.
Otherwise the fix is to avoid the Union{Missing, T} rebuild in that scoring path, which is a change to the observation code rather than to CI.


Generated by Claude Code

… path

Scoring a partially missing series built a `Vector{Any}` and narrowed it
to `Vector{Union{Missing, T}}`, which Enzyme's type analysis rejected in
forward and reverse mode.
The returned series is the data as given, so it comes from
`_restore_missing`, which the Enzyme extension marks inactive.
The scenario passes under both Enzyme modes, so its Enzyme reverse
broken entry goes; the log density and Mooncake gradient are about five
times faster.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WwC7iygGpznktvYSbjCqxZ

Copy link
Copy Markdown
Collaborator Author

The PartiallyMissing question is settled in 1d3b573, so no broken-list entry is needed.
The scoring path no longer builds the Union{Missing, T} vector inside the differentiated code: it returns the data through _restore_missing, which the Enzyme extension marks inactive.
The scenario now passes under Enzyme forward and reverse on Julia 1.13.4, so its existing Enzyme reverse broken entry is removed too.
It's also faster: log density about 5 times (1.1–1.3 µs to 245 ns) and Mooncake gradient about 6 times (21 µs to 3.6 µs).
The observation and missing-data unit tests pass (380).


Generated by Claude Code

`@nolebase/vitepress-plugin-enhanced-readabilities` 2.21 needs VitePress
2.0 alpha, so `^2.14.0` now fails `npm install` against the docs'
VitePress 1.6; 2.18.2 is the last release that supports both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WwC7iygGpznktvYSbjCqxZ

Copy link
Copy Markdown
Collaborator Author

Documenter / Documentation on 4cfd9e5 ran every example, including the Catalyst tutorial, but failed at npm install for the VitePress site (ERESOLVE).
@nolebase/vitepress-plugin-enhanced-readabilities 2.21, released in October, needs VitePress 2.0 alpha, and docs/package.json asked for ^2.14.0 against VitePress ^1.6.3.
That breaks the docs build on main too; main just failed earlier on Catalyst.
ef4f855 pins the plugin to ~2.18.2, the last release supporting VitePress 1. npm install resolves with the pin and fails with ERESOLVE without it.
If the kit's template owns docs/package.json, the same pin belongs there.


Generated by Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

📖 Documentation preview is ready!

View the docs for this PR at: https://EpiAware.github.io/ComposableTuringIDModels.jl/previews/PR446/

This preview will be updated automatically when you push new commits.

Copy link
Copy Markdown
Collaborator Author

CI on ef4f855 is green apart from the expected failures.

  • Every test job on Julia 1, pre and 1.11 passes (1.11 macOS is still running), as do the docs build, coverage, pre-commit, registrability and the benchmarks.
  • ForwardDiff, ReverseDiff (tape and compiled), Mooncake reverse and Mooncake forward pass.
  • Enzyme reverse (945 passed, 2 errored) and Enzyme forward (925 passed, 2 errored) fail only on Renewal+UncertainLatentDelay and Renewal+UncertainGenInterval, the Bijectors product-transform issue described above.
  • Downgrade Compat was cancelled about 45 minutes in, while the test suite was still running and with no test failure in the log. It is a shared workflow, and on main it has also failed or been cancelled on recent runs, so this PR does not change it.

Generated by Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

Benchmark comparison vs base

Minimum time per call. Buckets are PR time as a % of base, so lower is faster (🟢 faster, ⚪ within 5%, 🔴 slower). Counts of benchmarks per bucket:

Group 🟢 <50% 🟢 50–75% 🟢 75–95% ⚪ 95–105% 🔴 105–125% 🔴 125–150% 🔴 >150%
Evaluation · 1 8 · · · ·
ForwardDiff · · 2 · · · ·
ReverseDiff (tape) · 1 1 · · · ·
Mooncake reverse · · 2 · · · ·
Enzyme reverse · · · · 1 · ·
Evaluation — 9 benchmarks (by time change)
Benchmark base PR time memory
Model evaluation / RandomWalk latent / rand 287.0 ns 210.0 ns 🟢 0.73× ⚪ 1.0×
Model evaluation / RandomWalk latent / forward 261.0 ns 200.0 ns 🟢 0.77× ⚪ 1.0×
Model evaluation / Renewal+NegativeBinomial / forward 3.11 μs 2.44 μs 🟢 0.78× ⚪ 1.0×
Model evaluation / DirectInfections+Poisson / rand 405.0 ns 330.0 ns 🟢 0.81× ⚪ 1.0×
Model evaluation / AR latent / rand 387.0 ns 320.0 ns 🟢 0.83× ⚪ 1.0×
Model evaluation / DirectInfections+Poisson / forward 667.0 ns 571.0 ns 🟢 0.86× ⚪ 1.0×
Model evaluation / AR latent / forward 325.0 ns 280.0 ns 🟢 0.86× ⚪ 1.0×
Model evaluation / Renewal+NegativeBinomial / rand 1.35 μs 1.19 μs 🟢 0.88× ⚪ 1.0×
Sampling / NUTS (DirectInfections+Poisson, 50 draws) 65.11 ms 58.53 ms 🟢 0.9× ⚪ 1.0×
AD gradients — 7 benchmarks (by time change)
Benchmark base PR time memory
AD gradients / DirectInfections+Poisson posterior / ReverseDiff (tape) 65.97 μs 49.22 μs 🟢 0.75× ⚪ 1.0×
AD gradients / AR latent logjoint / Mooncake reverse 3.27 μs 2.5 μs 🟢 0.77× ⚪ 1.0×
AD gradients / AR latent logjoint / ReverseDiff (tape) 29.56 μs 22.66 μs 🟢 0.77× ⚪ 1.0×
AD gradients / DirectInfections+Poisson posterior / Mooncake reverse 4.39 μs 3.5 μs 🟢 0.8× ⚪ 1.0×
AD gradients / DirectInfections+Poisson posterior / Enzyme reverse 1.14 μs 1.34 μs 🔴 1.18× ⚪ 1.0×
AD gradients / DirectInfections+Poisson posterior / ForwardDiff 10.88 μs 8.96 μs 🟢 0.82× ⚪ 1.0×
AD gradients / AR latent logjoint / ForwardDiff 4.84 μs 4.31 μs 🟢 0.89× ⚪ 1.0×

@seabbs
seabbs merged commit ad0815d into main Nov 25, 2026
27 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

llm-reviewed Reviewed by seabbs-review-bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants