Repository navigation
Added plan for fast field calculation. - #32
Merged
Merged
Conversation
Contributor
|
📖 Documentation preview for this PR: https://bmad-sim.github.io/GeneralizedGradients.jl/previews/PR32/ Rebuilt on every push; removed automatically when the PR closes. |
DavidSagan
added a commit
that referenced
this pull request
Jul 3, 2026
…val. This branch had a broken merge (conflict markers in gg_eval.jl, missing the GGEvalPlan machinery). Sync src/ and test/ to the optimized fast-eval code from main (PR #32) and re-apply the per-call allocation reduction (single fused scratch buffer via views, element-wise dA build instead of the boxing matrix literal): 24 -> 9 allocations per evaluation. Add `potential_evaluate_at(fit, x, y, s) -> (A, dA)`, which reuses the shared `_eval_scratch` helper but skips the three B-field component evaluations. For tracking only A and dA are needed, and B is ~53% of the monomial-term work, so this is ~1.78x faster per field evaluation and ~1.5x faster end-to-end for the BeamTracking example's track! (which now uses it). A and dA are bit-identical to the full evaluator; verified over interior/boundary/extrapolation points. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
DavidSagan
added a commit
that referenced
this pull request
Jul 3, 2026
dev/28 branched before PR #32 and re-introduced the fast-eval work on an older base, so it conflicts with main on GitHub. HEAD already contains main's optimized code plus the potential_evaluate_at addition (git diff origin/main..HEAD touches only those 5 files), so record main as merged while keeping this tree. Resolves the PR #33 conflicts.
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.
No description provided.