Skip to content

Update tests authored against the Dogleg trust-region default - #1302

Merged
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:fix-stale-tr-tests
Sep 17, 2026
Merged

ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:fix-stale-tr-tests

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

Summary

TrustRegion() now defaults to the Moré subproblem, and three test sites still encode the old Dogleg + RadiusUpdateSchemes.Simple behavior — they fail deterministically on master:

  • misc_tests__item9 "TrustRegion reuse" (4 failures at lines 253–258): asserts a specific accept/accept/reject step trajectory. Under Moré the second step is already rejected, shifting the whole sequence by one iteration. Pinned subproblem = TrustRegionSubproblem.Dogleg so the authored trajectory holds — the test exercises the Jacobian-reuse machinery (jacobian_reuse.jl), which is subproblem-agnostic.
  • misc_tests__item3:40: asserts initial_trust_radius == max_trust_radius / 11, the Dogleg+Simple initial-radius formula. Under the Moré default the initial radius is ‖u0‖ and max = Inf; now asserts ≈ hypot(100.0, 1.0) for u0 = [100, 1].
  • bounded_default_tests.jl:12: introspected cache.caches, but init(prob) with no explicit algorithm returns the lazy NonlinearSolveNoInitCache wrapper, which has no sub-caches (FieldError). Bounds propagation is already covered by sol.u ≈ [1.0, 0.25] — the unbounded optimum [2, 0.25] violates ub = 1 — so the introspection line is dropped.

Test plan

  • All three files fail on unmodified master (4 fails + 1 fail + 1 error respectively); all pass with these changes: item9 14/14 in "TrustRegion reuse", item3 clean, bounded 9/9.
  • Test-only change; no source diff. Runic --check clean; typos clean.

🤖 Generated with Devin — Agent-Harness: Devin CLI 3000.10.21, Agent-Model: SWE-2 Max. Session transcript (local): /home/crackauc/.local/share/devin/cli/summaries/history_75aaeac8e79744c6.md

Co-Authored-By: Chris Rackauckas [email protected]

`TrustRegion()` now defaults to the Moré subproblem, and three test sites
still encode the old Dogleg + RadiusUpdateSchemes.Simple behavior:

- misc_tests__item9 "TrustRegion reuse" asserts a specific
  accept/accept/reject step trajectory; under Moré the second step is
  already rejected, shifting the sequence by one iteration. Pin
  `subproblem = TrustRegionSubproblem.Dogleg` so the authored trajectory
  holds — the test exercises the Jacobian-reuse machinery, which is
  subproblem-agnostic.
- misc_tests__item3 asserts `initial_trust_radius == max_trust_radius/11`,
  the Dogleg+Simple initial-radius formula. Under the Moré default the
  initial radius is ‖u0‖; assert that instead.
- bounded_default_tests introspected `cache.caches`, but `init(prob)` with
  no explicit algorithm returns the lazy `NonlinearSolveNoInitCache`
  wrapper, which has no sub-caches. Bounds propagation is already covered
  by the `sol.u ≈ [1.0, 0.25]` assertion (the unbounded optimum [2, 0.25]
  violates ub = 1), so drop the introspection.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Agent-Harness: Devin CLI 3000.10.21
Agent-Model: SWE-2 Max
Agent-Session: /home/crackauc/.local/share/devin/cli/summaries/history_75aaeac8e79744c6.md (local transcript)
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