Skip to content

Add PrecompileTools workload for faster startup#60

Merged
ChrisRackauckas merged 1 commit intoSciML:masterfrom
ChrisRackauckas-Claude:precompile-improvements-20251229-142258
Dec 29, 2025
Merged

Add PrecompileTools workload for faster startup#60
ChrisRackauckas merged 1 commit intoSciML:masterfrom
ChrisRackauckas-Claude:precompile-improvements-20251229-142258

Conversation

@ChrisRackauckas-Claude
Copy link
Copy Markdown
Contributor

Summary

  • Add PrecompileTools.jl as a dependency
  • Add @setup_workload/@compile_workload block that precompiles:
    • Algorithm struct instantiations (ode23, ode45, etc.)
    • buildDEStats function with typical MATLAB stats dictionaries

Context

This package is a thin wrapper around MATLAB's ODE solvers via MATLAB.jl. Most of the heavy compilation work is done by dependencies (DiffEqBase, ModelingToolkit) which already have their own precompilation workloads.

However, we can still precompile the lightweight Julia parts of this package:

  1. The algorithm struct constructors
  2. The buildDEStats helper function that processes MATLAB solver statistics

Limitations

The main solve functionality requires MATLAB to be installed and cannot be precompiled without it. The precompilation workload focuses on what can be precompiled without MATLAB being available.

Test plan

  • Syntax verified
  • Dependencies resolve correctly
  • CI passes (requires MATLAB for full tests, but PrecompileTools workload should run during precompilation)

cc @ChrisRackauckas

🤖 Generated with Claude Code

- Add PrecompileTools.jl as a dependency
- Add @setup_workload/@compile_workload block that precompiles:
  - Algorithm struct instantiations (ode23, ode45, etc.)
  - buildDEStats function with typical MATLAB stats dictionaries

This precompiles the lightweight Julia parts of the package.
The main solve functionality requires MATLAB to be installed
and cannot be precompiled without it.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ChrisRackauckas ChrisRackauckas merged commit 4003555 into SciML:master Dec 29, 2025
1 of 2 checks passed
@ChrisRackauckas-Claude
Copy link
Copy Markdown
Contributor Author

CI Failure Analysis

The CI failure is not caused by this PR's changes. Looking at recent CI runs, all Downgrade workflow runs have been failing, including:

  • Master merge (docs-improvements): failed in 52s
  • Master merge (fix-issue-57): failed in 1m56s
  • Previous PRs and master merges: all failed

The failure occurs in the julia-runtest step, which tries to run the actual tests. The tests in test/runtests.jl require MATLAB to be installed (they call solve(prob, MATLABDiffEq.ode45()) which uses MATLAB.jl to communicate with MATLAB), but MATLAB is not installed in the CI environment.

This is a pre-existing CI configuration issue where the test workflow runs without MATLAB being available.

The changes in this PR (adding PrecompileTools workload) are sound:

  • ✅ Syntax is valid
  • ✅ Dependencies resolve correctly
  • ✅ PrecompileTools is already a transitive dependency
  • ✅ The precompilation workload only exercises lightweight Julia code (struct instantiation, buildDEStats function)

cc @ChrisRackauckas

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