Skip to content

Add checkpointed plasma gradients and constrained optimization examples - #42

Closed
rogeriojorge wants to merge 12 commits into
mainfrom
agent/checkpointed-plasma-control
Closed

rogeriojorge wants to merge 12 commits into
mainfrom
agent/checkpointed-plasma-control

Conversation

@rogeriojorge

@rogeriojorge rogeriojorge commented Sep 12, 2026 •

Copy link
Copy Markdown
Member

Add simulation_final: a fixed-RK4 final-state solve composable with ordinary JAX objectives and value_and_grad, JVP and VJP. SOLVAX segmented replay avoids retaining the full trajectory; an optional Diffrax checkpoint budget bounds retained time states. Both differentiate the same discrete RK4 steps. State/workspace memory still grows with phase-space resolution.

This PR now contains only the reusable solver API, shared RHS argument extraction, dependency declarations and focused tests. Exploratory examples, benchmarks, raw data, figures and research notes were removed from the review diff. The single application example and publication evidence are being consolidated in #43.

Validation: replay/taped/fixed-budget gradient agreement, independent Dopri8 convergence, directional finite differences, and analytic streamed-integral/time derivatives (five CPU tests passed). Historical benchmark evidence remains pinned to commit 23102ab0c7c2874811106998bcc6e8f290cd43ca.

Keep this PR open for collaborator review; no author/admin merge. SOLVAX #103 is merged, but the demonstrated dependency remains released SOLVAX 0.20.0.

@codecov

codecov Bot commented Sep 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.75362% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
spectrax/_autodiff.py 92.30% 3 Missing and 2 partials ⚠️
Files with missing lines Coverage Δ
spectrax/__init__.py 100.00% <100.00%> (ø)
spectrax/_simulation.py 100.00% <100.00%> (ø)
spectrax/_autodiff.py 92.30% <92.30%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rogeriojorge rogeriojorge changed the title Add checkpointed terminal solves and phase-only plasma control Add checkpointed plasma gradients and time-window control Sep 12, 2026
@rogeriojorge rogeriojorge changed the title Add checkpointed plasma gradients and time-window control Add checkpointed plasma gradients and constrained optimization examples Sep 12, 2026
@rogeriojorge

Copy link
Copy Markdown
Member Author

Superseded by #44. There, gradients come from differentiating the existing simulation through Diffrax's checkpointed discrete adjoint: 9 library lines, no new solver or dependency. The PR adds measured memory bounds and an Orszag–Tang inverse-design example validated up to 128²×6³. The review that led to this choice is in this comment on #43, and the #44 description is the handoff. Closing without merging; the branch is kept for reference.

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