Skip to content

Save requested times across jump gaps - #800

Open
salma2vec wants to merge 1 commit into
patrick-kidger:mainfrom
salma2vec:codex/save-times-across-jump-gaps
Open

salma2vec wants to merge 1 commit into
patrick-kidger:mainfrom
salma2vec:codex/save-times-across-jump-gaps

Conversation

@salma2vec

Copy link
Copy Markdown

Fixes #791.

ClipStepSizeController can accept a step ending just before a jump at t1, then advance the next start across that jump. The requested-time save loop only checked the solver endpoint. The solve could therefore finish successfully with the final SaveAt(ts=...) entry still set to inf.

Consume requested saves through the accepted controller time. For times in the skipped interval, save the accepted state carried across the jump; within the actual solver step, use its interpolator. This follows the existing SaveAt(steps=True) behavior and keeps the requested timestamp for custom save callbacks.

The issue's rotation example now saves [0.7316888, 0.68163913] at the terminal jump, close to [cos(0.75), sin(0.75)], with the same 108 accepted and 45 rejected steps as before. The broader controller/stage semantics proposed in #794 remain separate.

Regressions cover real and complex single-precision states, forward and backward integration, complete analytic trajectories, real terminal Jacobians, a save callback that records its timestamp, and requested times immediately before/at/after an interior jump. Both terminal real-state cases include rejected steps.

Validation against main e950aa2c on local macOS CPU:

  • Python 3.11.15 / JAX 0.10.2 and Python 3.13.16 / JAX 0.12.0.1: the exact regression file gives four failures and one passing control on the base; all five pass with the fix.
  • Complete native uv run python -m test runner: 1,003 passed, 0 failed, 0 skipped on each Python version, covering all 22 test modules, including slow tests.
  • Python 3.11: all native pre-commit hooks pass. Python 3.13: lint/format hooks pass; Pyright reports the same eight diagnostics on the base and candidate under JAX 0.12.0.1.
  • Documentation builds pass on both versions.

Fork CI was blocked before either job started by an account billing lock. No hosted test or accelerator result is claimed.

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.

ClipStepSizeController: last SaveAt(ts=...) value is inf when a jump time equals t1 (float32)

1 participant