SMC migration to 1.12 with modern packages - #24
Merged
Merged
Conversation
…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
requested review from
e1ena02 and
mpham8
and removed request for
Copilot
June 29, 2026 21:56
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
approved these changes
Jul 2, 2026
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.
CI / dependencies
build.yml: Julia 1.5 -> 1.12build-1.1.yml(Julia 1.1 is no longer a target;@timedthere returnsa plain tuple, breaking
runtests.jl).Project.toml: widen[compat]for the modern stack; declareBenchmarkToolsas a test dep.
Test infrastructure
run_benchmarks-gated) and consolidated intolabeled
@benchmarkblocks with per-test timing/memory output -- they nolonger run (or leak on) in CI.
modelsetup.jl: addas_mvnormal, which rebuilds anMvNormalfrom theopaque
JLD2.ReconstructedMutableyou get when the installedDistributions/PDMats layout differs from when a fixture was written; wrapped
at the relevant load sites.
Random.seed!(42)(not@everywhere, which doesn't pinthe task-local RNG the draws use in a single process);
smc.jln_mh_steps1 -> 3 to mix the weakest-identified equation with margin.
References
1126reference tier (Julia 1.7+ switched the defaultRNG to a per-Task
Xoshiro256++, so seeded draws no longer match150).Deterministic references (reshape/reduce, ESS, proposal densities,
solve_adaptive_ϕ) stay version-independent on the150/111tier.eps()to10*eps()forcross-version stability.
Source
smc_main.jl: fix the@everywhere mutation_closurepositional-arg order tomatch the local closure /
mutation(), and broaden thesendtoset for theworker path.
initialization.jl:sendtoregime_switching/toggleto workers ininitial_draw!/initialize_likelihoods!.Benchmarks
1.12 appears to be significantly faster across the board; also anecdotally, compilation seems to be quicker as well.

:)