Skip to content

Remove mallocs and pass single buffer in run_op_integration#542

Merged
felixhekhorn merged 9 commits into
masterfrom
fix/rm-malloc
Jun 26, 2026
Merged

Remove mallocs and pass single buffer in run_op_integration#542
felixhekhorn merged 9 commits into
masterfrom
fix/rm-malloc

Conversation

@AkshatRai07

Copy link
Copy Markdown
Collaborator

A pre-requisite for #537 and part of #518

  • Removed all mallocs from spacelike.rs and cache.rs files with necessary changes in eko/src/lib.rs.
  • Passed only one buffer for the whole integration operation.
  • Removed some minor loops on the Python side.

Copilot AI review requested due to automatic review settings June 24, 2026 14:56

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@felixhekhorn felixhekhorn added refactor Refactor code gsoc26 labels Jun 24, 2026

@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.

We need to disentangle the integers on the tensors. For that we need to define two constants const MAX_ORDER_QCD : usize = 4 and MAX_ORDER_QED=2 and then use them in the appropriate places. In particular, while the inner most dimensions of the tensors are typically given by (flavor) algebra, the outer are given by our current knowledge. This constants will also help with the potential helper functions #537 . Be careful that the size is usually MAX_ORDER, but in the QED case it is shifted by one since we fill a matrix. The physics statement is: in eko order refers to the power of the coupling (e.g. as1 is $a_s^1$).

We must clearly document the new behaviour: since this concerns all functions it might be clever to do this in a central location (e.g. crates/ekore/lib.rs) and then add a single sentence to each function docstring that the buffer has to follow blub. The documentation e.g. needs to explain that we only fill the slots the function has been asked for, which yields undefined behaviour for the remaining entries

Comment thread crates/ekore/src/harmonics/cache.rs Outdated
Comment thread crates/ekore/src/harmonics/cache.rs Outdated
Comment thread crates/eko/src/lib.rs Outdated
Comment thread crates/ekore/src/anomalous_dimensions/polarized/spacelike.rs
Comment thread crates/eko/src/lib.rs 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.

Can you please check why the benchmarks are running now on commit, when they should not?

push:
branches-ignore:
- "*"

Any way, once all tests pass, this is good for merge

@felixhekhorn

Copy link
Copy Markdown
Collaborator

Actually: maybe you want to add a section to the performance document and maybe also adjust the architecture file?

@AkshatRai07

AkshatRai07 commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator Author

Can you please check why the benchmarks are running now on commit, when they should not?

GitHub does not match "*" with a "/", which is a part of this branch name.
Got to replace them "**".

Actually: maybe you want to add a section to the performance document and maybe also adjust the architecture file?

No need to adjust the architecture file, it doesn't go deep as to what we are passing around.
I'll update the performance doc with the data I had provided in #518 (here)

@felixhekhorn felixhekhorn merged commit b372afb into master Jun 26, 2026
6 checks passed
@felixhekhorn felixhekhorn deleted the fix/rm-malloc branch June 26, 2026 11:31
This was referenced Jun 30, 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