Skip to content

Remove dynamic dispatch from field API methods#53

Merged
SebastianM-C merged 4 commits into
masterfrom
claude/remove-dynamic-dispatch-011CUJwoj6txR9t2cRfxL6np
Oct 21, 2025
Merged

Remove dynamic dispatch from field API methods#53
SebastianM-C merged 4 commits into
masterfrom
claude/remove-dynamic-dispatch-011CUJwoj6txR9t2cRfxL6np

Conversation

@SebastianM-C

Copy link
Copy Markdown
Owner

This removes the Symbol to Val conversion methods that were causing dynamic dispatch in E(), B(), and EB() functions. Now only Val{:real} and Val{:complex} are accepted, which eliminates the performance regression from dynamic dispatch.

Breaking change: Users must now call these functions with Val(:real) or Val(:complex) instead of :real or :complex symbols.

Changes:

  • Remove E(r, t, laser, symbol::Symbol) method
  • Remove B(r, t, laser, symbol::Symbol) method
  • Remove EB(r, t, laser, symbol::Symbol) method
  • Update internal calls to use Val(:real) and Val(:complex)

🤖 Generated with Claude Code

This removes the Symbol to Val conversion methods that were causing
dynamic dispatch in E(), B(), and EB() functions. Now only Val{:real}
and Val{:complex} are accepted, which eliminates the performance
regression from dynamic dispatch.

Breaking change: Users must now call these functions with Val(:real)
or Val(:complex) instead of :real or :complex symbols.

Changes:
- Remove E(r, t, laser, symbol::Symbol) method
- Remove B(r, t, laser, symbol::Symbol) method
- Remove EB(r, t, laser, symbol::Symbol) method
- Update internal calls to use Val(:real) and Val(:complex)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Added comprehensive JET tests for all field API methods (E, B, EB) with
both Val(:real) and Val(:complex) for GaussLaser and LaguerreGaussLaser.
This ensures we maintain type stability and catch any performance
regressions from dynamic dispatch.

Changes:
- Add JET to test dependencies in Project.toml
- Create test/qa.jl with @test_opt for all field methods
- Add QA test suite to runtests.jl

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Changes:
- Replace 'nightly' with 'pre' in Julia version matrix
- Upgrade julia-actions/setup-julia from v1 to v2 in both test and docs jobs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Breaking changes in this release:
- Removed Symbol to Val conversion methods for E(), B(), and EB()
- Users must now use Val(:real) or Val(:complex) explicitly

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@SebastianM-C SebastianM-C merged commit 7e06f1c into master Oct 21, 2025
14 checks passed
@SebastianM-C SebastianM-C deleted the claude/remove-dynamic-dispatch-011CUJwoj6txR9t2cRfxL6np branch October 21, 2025 13:01
@SebastianM-C

Copy link
Copy Markdown
Owner Author

@JuliaRegistrator register release_notes="""

Breaking Changes

  • Removed dynamic dispatch from field API methods (E, B, EB)
  • Users must now use Val(:real) or Val(:complex) instead of bare symbols :real or :complex
  • Example: E(r, t, laser, Val(:real)) instead of E(r, t, laser, :real)
  • The default 3-argument form E(r, t, laser) continues to work

Performance Improvements

  • Eliminated dynamic dispatch overhead - all field calls are now type-stable
    """

@JuliaRegistrator

Copy link
Copy Markdown

Comments on pull requests will not trigger Registrator, as it is disabled. Please try commenting on a commit or issue.

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.

3 participants