Skip to content

SMC migration to 1.12 with modern packages - #24

Merged
e1ena02 merged 9 commits into
integrationfrom
mariaamysmc
Jul 2, 2026
Merged

e1ena02 merged 9 commits into
integrationfrom
mariaamysmc

Conversation

@gargparthb

Copy link
Copy Markdown
Contributor

CI / dependencies

  • build.yml: Julia 1.5 -> 1.12
  • Drop build-1.1.yml (Julia 1.1 is no longer a target; @timed there returns
    a plain tuple, breaking runtests.jl).
  • Project.toml: widen [compat] for the modern stack; declare BenchmarkTools
    as a test dep.

Test infrastructure

  • Benchmarks are now opt-in (run_benchmarks-gated) and consolidated into
    labeled @benchmark blocks with per-test timing/memory output -- they no
    longer run (or leak on) in CI.
  • modelsetup.jl: add as_mvnormal, which rebuilds an MvNormal from the
    opaque JLD2.ReconstructedMutable you get when the installed
    Distributions/PDMats layout differs from when a fixture was written; wrapped
    at the relevant load sites.
  • Seeding uses plain Random.seed!(42) (not @everywhere, which doesn't pin
    the task-local RNG the draws use in a single process); smc.jl n_mh_steps
    1 -> 3 to mix the weakest-identified equation with margin.

References

  • Add an RNG-dependent 1126 reference tier (Julia 1.7+ switched the default
    RNG to a per-Task Xoshiro256++, so seeded draws no longer match 150).
    Deterministic references (reshape/reduce, ESS, proposal densities,
    solve_adaptive_ϕ) stay version-independent on the 150/111 tier.
  • Loosen the MvNormal-mixture-draw tolerance from eps() to 10*eps() for
    cross-version stability.

Source

  • smc_main.jl: fix the @everywhere mutation_closure positional-arg order to
    match the local closure / mutation(), and broaden the sendto set for the
    worker path.
  • initialization.jl: sendto regime_switching/toggle to workers in
    initial_draw! / initialize_likelihoods!.

Benchmarks

1.12 appears to be significantly faster across the board; also anecdotally, compilation seems to be quicker as well.
image
:)

mariabst and others added 6 commits June 25, 2026 13:32
…Everywhere Random.seed!() function for Julia 1.7+ because RNG is now per task
Tests:
- modelsetup.jl: as_mvnormal shim rebuilds MvNormal/PDMat that JLD2 deserializes
  as ReconstructedMutable when the installed Distributions/PDMats layout differs
  from when the fixture was written; wrapped at the load sites that feed it.
- Add an RNG-dependent "1126" reference tier (Julia 1.7+ switched the default RNG
  to a per-Task Xoshiro256++, so seeded draws no longer match the "150" data);
  deterministic refs keep the version-independent "150"/"111" tier.
- Plain Random.seed!(42) instead of @Everywhere (the latter does not reliably pin
  the task-local RNG the draws use in a single process); smc.jl n_mh_steps 1 -> 3
  to mix the weakest-identified equation with margin.
- Gate parallel test paths so they only run with real workers.
- runtests.jl runs all files to completion, collects failures, prints a summary,
  and cds to the test dir so relative reference paths resolve from any launch dir.
- Consolidate scattered @Btime calls (util.jl, particle.jl) into labeled,
  aligned @benchmark blocks; fix a latent wrong-splat in the scalar/vector_reduce
  benchmark.

Source:
- smc_main.jl: fix the @Everywhere mutation_closure positional-arg order to match
  the local closure / mutation(), and broaden the sendto set for the worker path.
- initialization.jl: sendto regime_switching/toggle to workers in initial_draw!
  and initialize_likelihoods!.

Project.toml: declare BenchmarkTools as a test dependency.

Regenerated the 1126 references and refreshed the deterministic 150 fixtures to
the current JLD2 format. Suite green on 1.12.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The suite targets Julia 1.12 + modern deps, but the workflows still ran the
old stack: build-1.1.yml (Julia 1.1, where @timed returns a plain tuple so
runtests.jl's result.time fails) and build.yml (Julia 1.5 + the stale
registered ModelConstructors, whose DegenerateMvNormal predates the stdev
kwarg used in src/helpers.jl).

- Drop build-1.1.yml.
- build.yml: Julia 1.5 -> 1.12, and add ModelConstructors from its integration
  branch (the migrated, stdev-capable version is not registered yet).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…in CI

The test files share one scope under runtests.jl, and each guards its
benchmark with `if !@isdefined(run_benchmarks); run_benchmarks = <default>; end`.
Defaults disagree (util.jl defaults true), so the first file to define it leaks
the value onto every later file — which turned benchmarks on in CI and ran
regime_switching_smc.jl's 8-minute @Btime smc(...) block (BoundsError on the
re-run) and smc.jl's. Define run_benchmarks = false before the include loop so
all files see it; standalone include("<file>.jl") runs still honor their own default.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
gargparthb and others added 3 commits June 30, 2026 15:03
Bring in integration's non-conflicting improvements (BenchmarkTools test dep,
run-all-test-files-to-completion in runtests, modelsetup/add_parameters_to_cloud
edits). All conflicts resolved in favor of mariaamysmc — the validated Julia
1.12 branch — keeping its test files, dver/ver reference tiering, and the
1.12-regenerated references (including the 4 refs integration regenerated
separately, reverted to ours for a consistent ref set). Ported integration's
one genuine addition on top: $(@__DIR__) anchoring of the reference paths in
test/helpers.jl (works from any cwd). Kept the Julia 1.1 CI job deleted. Suite
green on 1.12.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@e1ena02 e1ena02 closed this Jul 2, 2026
@e1ena02 e1ena02 reopened this Jul 2, 2026
@e1ena02
e1ena02 merged commit e3d48f0 into integration Jul 2, 2026
5 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.

3 participants