Conversation
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.
Validation status: the full-test prerequisite in CONTRIBUTING remains unmet. The bounded CPU recovery attempt is closed with incomplete coverage; this draft is not ready for review.
Default collection on this head: 1,021 nodes. The evidence accounts for 669 passed (617 in the new attempt plus 52 preserved checks on unchanged final source), 2 interrupted, and 350 unrun. No completed failing-node outcome was recorded. Interrupted nodes were not counted as passes; coordinator-held files did not start tests.
A single unchanged pristine
test_adjoint.py::test_againstcontrol one950aa2also exited 137 before completing, after 382.093 s, with a native maximum RSS of 3,222,860 KiB. No cancellation signal was sent. The kill cause is unproven; host-wide OOM counters do not identify a per-process cause. This control establishes neither baseline equivalence nor a full-suite pass. The scoped correctness results below remain separate from this unresolved prerequisite.Problem
Backward solves normalise time internally, but
Eventcondition functions currently receive that normalised time. For example, integratingy' = t,y(2) = 2backwards from 2 to 0 with the conditiont - 0.9misses the event entirely and returns at 0. A boolean condition such ast < 1can instead terminate immediately at the wrong initial time.Backward integration is a supported
diffeqsolveoperation. Event callbacks need to observe the physical problem at initialisation, after each step, and during event root finding.Change
Wrap each condition with an Equinox callable module that restores physical time and the original
terms,t0,t1,dt0,SaveAt, and step-size controller. Restoringtermstogether withtis important: a condition that callssolver.func(terms, t, y, args)would otherwise transform time twice. Explicit PyTree fields keep traced dependencies visible to custom differentiation, includingImplicitAdjoint.The regression cases cover continuous/boolean conditions, root finding, forward controls, callback problem data, condition PyTrees, mixed-direction
vmap, initial events, equal initial/final times, callable Equinox conditions, condition/term parameter gradients, and legacy discrete/steady-state callbacks.Validation
On pristine upstream
e950aa2cf1974c02816c1542f20beabf7cca496b, the 23 new regression cases produce 15 failed, 8 passed. The corrected code produces 23 passed.Local CPU validation, Python 3.12.14 / JAX 0.11.2:
pytest test/test_backward_event.py -q: 23 passedpytest test/test_event.py -q: 42 passed, on pristine and corrected sourcepytest test/test_adjoint.py -q -m 'not slow': 10 passed, 1 deselected_misc.py:175on pristine and corrected sourceAn independent SciPy
solve_ivpcheck and the exact solutiony(t) = t**2 / 2both give event time 0.9, event state 0.405, and sensitivitiesdT/dthreshold = 1,dY/dthreshold = 0.9. Corrected Diffrax matches these values and centred finite differences. Pristine Diffrax misses the event and returns time/state/sensitivities approximately zero.The slow adjoint comparison and full project test suite have not completed locally. An earlier multi-file process was killed before completion. Accelerator execution has not been tested, and no runtime or training-quality improvement is claimed.