Skip to content

Added plan for fast field calculation. - #32

Merged
DavidSagan merged 2 commits into
mainfrom
dev/27
Jul 3, 2026
Merged

DavidSagan merged 2 commits into
mainfrom
dev/27

Conversation

@DavidSagan

Copy link
Copy Markdown
Member

No description provided.

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
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
DavidSagan merged commit fb1af65 into main Jul 3, 2026
5 checks passed
@DavidSagan
DavidSagan deleted the dev/27 branch July 3, 2026 19:33
github-actions Bot added a commit that referenced this pull request Jul 3, 2026
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.
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