Skip to content

Split ev_op/init and ev_op/ome - #531

Merged
felixhekhorn merged 5 commits into
masterfrom
split-quad-ker
Jun 23, 2026
Merged

Split ev_op/init and ev_op/ome#531
felixhekhorn merged 5 commits into
masterfrom
split-quad-ker

Conversation

@AkshatRai07

Copy link
Copy Markdown
Collaborator

A step for #518
In this PR, we:

  • Move all quad_ker_* functions to quad_ker.py.
  • Update patch file such that all 3 cfuncs are a part of the patch file and do not contribute to dead code.

Copilot AI review requested due to automatic review settings June 16, 2026 12:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR continues the refactor to separate evolution-operator integration kernels (quad_ker*) from operator-matrix-element logic, and updates the “rustify” patch workflow so the low-level (numba.cfunc) callbacks live only in patch files (avoiding dead code in the normal Python sources).

Changes:

  • Moved build_ome (and related OME quad kernel plumbing) into src/eko/evolution_operator/quad_ker.py and updated the OME tests to import from the new location.
  • Added/updated quad_ker.py.patch and adjusted rustify.sh to apply it, consolidating the 3 callback cfuncs into the patch flow.
  • Updated the patch files for __init__.py and operator_matrix_element.py to match the new split.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
tests/eko/evolution_operator/test_ome.py Switches build_ome import to come from quad_ker after the move.
src/eko/evolution_operator/quad_ker.py Hosts build_ome and OME/evolution integration kernels after the split; docstrings updated/need cleanup.
src/eko/evolution_operator/quad_ker.py.patch New rustify patch that injects the numba.cfunc callbacks for QCD/QED/OME; currently contains invalid sv.exponentiated/sv.expanded references.
src/eko/evolution_operator/operator_matrix_element.py Removes local OME quad-kernel/build helpers and imports them from quad_ker.
src/eko/evolution_operator/operator_matrix_element.py.patch Updates the rustify patch for the OME operator module to use the callback approach.
src/eko/evolution_operator/init.py Drops duplicated kernel code and delegates to quad_ker for integration kernels.
src/eko/evolution_operator/init.py.patch Updates rustify patch to use low-level callbacks for integration.
rustify.sh Applies the new quad_ker.py.patch in addition to the existing patches.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/eko/evolution_operator/quad_ker.py
Comment thread src/eko/evolution_operator/quad_ker.py
Comment thread src/eko/evolution_operator/quad_ker.py.patch Outdated
Comment thread src/eko/evolution_operator/quad_ker.py.patch Outdated
Comment thread src/eko/evolution_operator/quad_ker.py.patch Outdated
Comment thread src/eko/evolution_operator/quad_ker.py.patch Outdated
Comment thread src/eko/evolution_operator/quad_ker.py.patch Outdated
Comment thread src/eko/evolution_operator/quad_ker.py Outdated
Comment thread src/eko/evolution_operator/quad_ker.py Outdated
Comment thread src/eko/evolution_operator/quad_ker.py Outdated
@AkshatRai07

Copy link
Copy Markdown
Collaborator Author

@felixhekhorn most of copilot's suggestions are about doc changes. Should we do that in this PR or leave it for some another day?

@felixhekhorn

Copy link
Copy Markdown
Collaborator

@felixhekhorn most of copilot's suggestions are about doc changes. Should we do that in this PR or leave it for some another day?

Let's fix them while we are on it

@felixhekhorn felixhekhorn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

main comment is to reduce the patch file to the minimal amount possible - since that is a dirty hack in the first place, let's keep it minimal. This can be achieved by trivially harmonizing the variable names and copy docstrings/comments

Comment thread src/eko/evolution_operator/quad_ker.py Outdated
Comment thread src/eko/evolution_operator/quad_ker.py.patch Outdated
Comment thread src/eko/evolution_operator/quad_ker.py.patch Outdated
Comment thread src/eko/evolution_operator/quad_ker.py.patch Outdated
Comment thread src/eko/evolution_operator/quad_ker.py.patch Outdated
Comment thread src/eko/evolution_operator/quad_ker.py.patch Outdated
Comment thread src/eko/evolution_operator/quad_ker.py.patch Outdated
Comment thread src/eko/evolution_operator/quad_ker.py.patch Outdated
Comment thread src/eko/evolution_operator/quad_ker.py.patch Outdated
Comment thread rustify.sh Outdated

@felixhekhorn felixhekhorn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

apart from the pyproject.toml.patch hickup this is fine

the additional patch file is not pretty, I admit, but we still reduce the number of lines by ~500 ...

@felixhekhorn
felixhekhorn merged commit 510534b into master Jun 23, 2026
6 checks passed
@felixhekhorn
felixhekhorn deleted the split-quad-ker branch June 23, 2026 08:19
@felixhekhorn felixhekhorn mentioned this pull request Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gsoc26 refactor Refactor code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants