Skip to content

Preserve PyTrees in interpolation increments - #799

Open
resonance-null wants to merge 1 commit into
patrick-kidger:mainfrom
resonance-null:lezo50-pytree-interpolation-increments-20261104
Open

resonance-null wants to merge 1 commit into
patrick-kidger:mainfrom
resonance-null:lezo50-pytree-interpolation-increments-20261104

Conversation

@resonance-null

Copy link
Copy Markdown

Interpolation point evaluation supports PyTrees, but eight increment branches subtract the complete endpoint containers. A valid dictionary control therefore raises TypeError before a controlled solve's first step; dense Solution.evaluate(t0, t1) similarly fails for PyTree states.

Use the existing Equinox omega leafwise subtraction in global linear/cubic/dense interpolation and the affected local polynomial/solver interpolators. Keep endpoint selection, left, integration direction, coefficients, point formulas and solver state unchanged. These sites share one missing PyTree operation.

Validation on JAX/JAXlib 0.12.0.1 CPU:

  • New native regressions: BASE 17 failures/1 control pass → candidate 18 passes. With 17 existing selected controls, the focused candidate run passes 35 tests. The larger existing dense/dense-vmap solver matrix was not run.
  • A separate NumPy polynomial/constant-field oracle passes 80 configurations, versus 64 base PyTree failures and 16 passing array controls.
  • Independent review passes 128 configurations (BASE 86 failures), reaching all eight branches. It covers public deterministic PyTree CDEs and dense exponential/logistic ODE increments, eager/JIT, first-order time/parameter AD, global real/complex precision, and reversed/zero intervals. Tested point values/structures are preserved.
  • Configured Ruff 0.13.0 lint/format and Pyright 1.1.405 checks pass for all seven changed files. The full configured Pyright run retains the same 2 errors/1 warning on base and candidate in this environment; it is not a clean full-project check. Imported source and mapped native bytes were bound before/after execution.

Local interpolation admission checks use float64. Existing Dopri8 float32 roundoff, KenCarp3 strict-float32 promotion errors, some empty/custom solver-buffer arrangements and backward one-sided knot behavior remain outside this repair. The full suite, GPU/sharding, higher-order AD and performance were not tested.

I directed this work and take responsibility for the contribution and its follow-up. AI assistance was used in producing the change.

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.

1 participant