Skip to content

Precompile trace eqs#455

Merged
henry2004y merged 2 commits intomasterfrom
precompilation-eqs
Feb 8, 2026
Merged

Precompile trace eqs#455
henry2004y merged 2 commits intomasterfrom
precompilation-eqs

Conversation

@henry2004y
Copy link
Owner

Add trace equations to the precompilation workflow without invoking DifferentialEquations' solve.

@gemini-code-assist
Copy link

Summary of Changes

Hello @henry2004y, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the application's startup performance by integrating a wide array of particle tracing functionalities into the precompilation process. By explicitly calling these methods during precompilation, the system ensures that the necessary code is compiled and ready for execution, which will lead to a smoother and faster user experience when these tracing operations are first invoked.

Highlights

  • Precompilation of Trace Functions: Added explicit calls to various particle tracing functions within the precompilation workflow to ensure their methods are compiled ahead of time.
  • Comprehensive Coverage: Included both in-place (e.g., trace!) and out-of-place (e.g., trace) versions for non-relativistic, relativistic, normalized, relativistic normalized, guiding center, and field line tracing methods.
  • Performance Improvement: The goal is to reduce the latency associated with the first-time execution of these tracing functions by precompiling them, thereby improving overall application responsiveness.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • src/precompile.jl
    • Added calls to trace, trace!, trace_relativistic, trace_relativistic!, trace_normalized, trace_normalized!, trace_relativistic_normalized, trace_relativistic_normalized! to the precompilation block.
    • Included precompilation calls for trace_gc, trace_gc!, trace_fieldline, and trace_fieldline! methods.
Activity
  • No human activity has been recorded on this pull request since its creation.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds several trace equations to the precompilation workload, which is a good step towards improving startup time. The implementation is straightforward. I've suggested a minor improvement to avoid repeated memory allocations for the in-place function calls by pre-allocating and reusing the output arrays. This is a good practice, even within precompilation scripts.

@codecov
Copy link

codecov bot commented Feb 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.23%. Comparing base (5fb4303) to head (f75bcda).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #455   +/-   ##
=======================================
  Coverage   81.23%   81.23%           
=======================================
  Files          21       21           
  Lines        2025     2025           
=======================================
  Hits         1645     1645           
  Misses        380      380           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 2026

Benchmark Results (Julia v1)

Time benchmarks
master f75bcda... master / f75bcda...
interpolation/cartesian 0.12 ± 0.01 μs 0.12 ± 0.001 μs 1 ± 0.084
interpolation/spherical 0.421 ± 0.01 μs 0.411 ± 0.001 μs 1.02 ± 0.024
interpolation/time-dependent 3.52 ± 0.63 μs 3.67 ± 0.63 μs 0.959 ± 0.24
trace/GC/DiffEq Vern6 5.73 ± 1.5 μs 5.8 ± 1.4 μs 0.988 ± 0.34
trace/GC/Native RK4 0.136 ± 0.00017 s 0.136 ± 0.0002 s 1 ± 0.0019
trace/GC/Native RK45 3.4 ± 0.13 μs 3.36 ± 0.15 μs 1.01 ± 0.06
trace/Hybrid/Sheared 3.42 ± 0.1 μs 3.42 ± 0.11 μs 1 ± 0.043
trace/analytic field/in place 0.0611 ± 0.034 ms 0.0619 ± 0.035 ms 0.988 ± 0.79
trace/analytic field/in place relativistic 0.086 ± 0.034 ms 0.0789 ± 0.032 ms 1.09 ± 0.62
trace/analytic field/out of place 0.0454 ± 0.033 ms 0.0453 ± 0.032 ms 1 ± 1
trace/normalized/out of place 15.7 ± 8 μs 16.1 ± 8.2 μs 0.976 ± 0.7
trace/numerical field/Adaptive Boris 4.24 ± 0.074 ms 4.2 ± 0.075 ms 1.01 ± 0.025
trace/numerical field/Boris 7.36 ± 0.089 μs 7.33 ± 0.06 μs 1 ± 0.015
trace/numerical field/Boris ensemble 14.6 ± 0.16 μs 14.6 ± 0.16 μs 1 ± 0.015
trace/numerical field/Boris kernel 9.5 ± 0.16 μs 9.51 ± 0.16 μs 0.999 ± 0.024
trace/numerical field/Boris with fields 7.99 ± 0.069 μs 7.97 ± 0.07 μs 1 ± 0.012
trace/numerical field/Multistep Boris 10.9 ± 0.079 μs 11 ± 0.07 μs 0.996 ± 0.0096
trace/numerical field/in place 27.2 ± 4.8 μs 27.2 ± 4.7 μs 1 ± 0.25
trace/numerical field/out of place 19.3 ± 4.9 μs 19 ± 4.6 μs 1.02 ± 0.36
trace/time-dependent field/in place 0.136 ± 0.0045 ms 0.138 ± 0.0044 ms 0.991 ± 0.045
trace/time-dependent field/out of place 0.109 ± 0.0042 ms 0.11 ± 0.0081 ms 0.994 ± 0.083
time_to_load 2.18 ± 0.017 s 2.2 ± 0.022 s 0.994 ± 0.012
Memory benchmarks
master f75bcda... master / f75bcda...
interpolation/cartesian 2 allocs: 0.234 kB 2 allocs: 0.234 kB 1
interpolation/spherical 2 allocs: 0.203 kB 2 allocs: 0.203 kB 1
interpolation/time-dependent 0.044 k allocs: 9.62 kB 0.044 k allocs: 9.62 kB 1
trace/GC/DiffEq Vern6 0.177 k allocs: 12.2 kB 0.177 k allocs: 12.2 kB 1
trace/GC/Native RK4 13 allocs: 0.382 MB 13 allocs: 0.382 MB 1
trace/GC/Native RK45 16 allocs: 2.44 kB 16 allocs: 2.44 kB 1
trace/Hybrid/Sheared 8 allocs: 2.98 kB 8 allocs: 2.98 kB 1
trace/analytic field/in place 2.07 k allocs: 0.0883 MB 2.07 k allocs: 0.0883 MB 1
trace/analytic field/in place relativistic 2.07 k allocs: 0.0883 MB 2.07 k allocs: 0.0883 MB 1
trace/analytic field/out of place 2.03 k allocs: 0.0866 MB 2.03 k allocs: 0.0866 MB 1
trace/normalized/out of place 0.753 k allocs: 0.0321 MB 0.753 k allocs: 0.0321 MB 1
trace/numerical field/Adaptive Boris 27 allocs: 1.5 MB 27 allocs: 1.5 MB 1
trace/numerical field/Boris 6 allocs: 1.16 kB 6 allocs: 1.16 kB 1
trace/numerical field/Boris ensemble 10 allocs: 2.28 kB 10 allocs: 2.28 kB 1
trace/numerical field/Boris kernel 0.038 k allocs: 2.12 kB 0.038 k allocs: 2.12 kB 1
trace/numerical field/Boris with fields 6 allocs: 1.52 kB 6 allocs: 1.52 kB 1
trace/numerical field/Multistep Boris 6 allocs: 1.16 kB 6 allocs: 1.16 kB 1
trace/numerical field/in place 0.432 k allocs: 20.8 kB 0.432 k allocs: 20.8 kB 1
trace/numerical field/out of place 0.393 k allocs: 18.6 kB 0.393 k allocs: 18.6 kB 1
trace/time-dependent field/in place 3.97 k allocs: 0.177 MB 3.97 k allocs: 0.177 MB 1
trace/time-dependent field/out of place 3.93 k allocs: 0.175 MB 3.93 k allocs: 0.175 MB 1
time_to_load 0.145 k allocs: 11 kB 0.145 k allocs: 11 kB 1

@henry2004y henry2004y merged commit 9ab1a7a into master Feb 8, 2026
8 checks passed
@henry2004y henry2004y deleted the precompilation-eqs branch February 8, 2026 03:03
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

Comments