Skip to content

Fix Rosenbrock N=4 regression seed for Julia 1.13 RNG stream#104

Merged
ChrisRackauckas merged 1 commit into
SciML:mainfrom
ChrisRackauckas-Claude:fix-n4-rng-seed-julia113
Jun 23, 2026
Merged

Fix Rosenbrock N=4 regression seed for Julia 1.13 RNG stream#104
ChrisRackauckas merged 1 commit into
SciML:mainfrom
ChrisRackauckas-Claude:fix-n4-rng-seed-julia113

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Contributor

Summary

Fixes the failing tests / Core (julia pre) job on main. The julia pre channel is currently Julia 1.13.0-rc1, and the Rosenbrock test dimension N = 4 testset fails there: @test sol.objective < 2.0e-3 (SerialPSO) reports 3.70 instead of ~1e-12.

Root cause

Julia 1.13 changed the default RNG stream, so Random.seed!(123) now produces a different particle population. For the non-convex N=4 Rosenbrock, the 1.13 stream from seed 123 lands the swarm in a bad local basin. This is a seed-sensitivity artifact, not a package regression.

Evidence (all run locally):

  • SerialPSO is deterministic given the RNG. On 1.13.0-rc1, seed 123 gives 3.70; increasing maxiters 1000 -> 10000 does not escape the basin (still 3.70), so it is not an "under-iterated" problem.
  • Across 10 seeds on 1.13.0-rc1 (1, 2, 3, 42, 100, 123, 200, 321, 777, 1234), 9 converge to <1e-9; only seed 123 fails. The algorithm is healthy.
  • On Julia 1.12, seed 123 happens to be lucky (2.98e-13), which is why the failure only appears on the pre channel.

Fix

Switch the N=4 testset to Random.seed!(1), which converges to <1e-11 on both Julia 1.12 (7.46e-12) and 1.13.0-rc1 (7.12e-12). The tight < 2.0e-3 / < 3.0e-2 tolerances are left unchanged — the test still verifies genuine convergence, just from a seed that is robust across RNG-stream generations. No tolerance loosening, no skips.

Local verification

Ran the full N=4 testset (every SerialPSO / ParallelPSOKernel / ParallelSyncPSOKernel assertion) with Random.seed!(1):

  • Julia 1.13.0-rc1 (+pre): all assertions PASS (SerialPSO 7.12e-12, bounded/unbounded variants <1e-9).
  • Julia 1.12: all assertions PASS (SerialPSO 7.46e-12).

Julia 1.10 (lts) shares the pre-1.13 Xoshiro stream with 1.12, so seed 1's robust convergence carries over; lts is currently green in CI.

Scope

This PR only touches the julia pre (1.13) Core failure. The separate Downgrade / Downgrade Tests failure (DiffEqGPU 3.9 floor) is handled by #103. The CUDA Tests (Julia 1) failure is a self-hosted-runner infra error (could not lock config file .../.gitconfig: File exists, exit 255 in the post-test/codecov step) — not a code issue.

Please ignore until reviewed by @ChrisRackauckas.

The Core test group's `julia pre` (1.13.0-rc1) job failed on the
`Rosenbrock test dimension N = 4` testset: `sol.objective < 2.0e-3`
(SerialPSO) reported 3.70 instead of ~1e-12.

Root cause: Julia 1.13 changed the default RNG stream, so the same
`Random.seed!(123)` produces a different particle population. For this
non-convex N=4 problem, the 1.13 stream from seed 123 lands the swarm in
a bad local basin. This is purely a seed-sensitivity artifact, not a
package regression: the SerialPSO solver is deterministic given the RNG,
and increasing maxiters to 10000 does not escape the basin (still 3.70).

Verified locally that the algorithm is healthy: on 1.13.0-rc1, 9 of 10
tested seeds (1, 2, 3, 42, 100, 200, 321, 777, 1234) converge to <1e-9;
only seed 123 fails. Switching the N=4 testset to seed 1 converges to
<1e-11 on Julia 1.12 (7.46e-12) and 1.13.0-rc1 (7.12e-12), and the full
N=4 testset (all SerialPSO/ParallelPSOKernel/ParallelSyncPSOKernel
assertions) passes on both. The tight `< 2.0e-3` / `< 3.0e-2` tolerances
are left unchanged, so the test still verifies genuine convergence.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ChrisRackauckas ChrisRackauckas marked this pull request as ready for review June 23, 2026 01:04
@ChrisRackauckas ChrisRackauckas merged commit f35fa87 into SciML:main Jun 23, 2026
9 of 11 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.

2 participants