Skip to content

perf: Reduce number of redundant calls in strip seeding#5239

Merged
paulgessinger merged 9 commits intoacts-project:mainfrom
mvessell96:makaylaLRTSeeding
Mar 17, 2026
Merged

perf: Reduce number of redundant calls in strip seeding#5239
paulgessinger merged 9 commits intoacts-project:mainfrom
mvessell96:makaylaLRTSeeding

Conversation

@mvessell96
Copy link
Copy Markdown
Contributor

Reduce number of redundant calls in strip seeding

--- END COMMIT MESSAGE ---

Profiling indicates that strip seeding spends an unreasonably long amount of time inside of the check for compatibility with the sensor geometry, which is individually called for each bottom/middle/top sp in the triple triplet formation loop.

We can make this a bit better behaved by noting strip geometry vectors for the middle and bottoms sps are invariant across the top-doublet loop and cleverly load the vectors once and precompute some cross products w/ the scalar triple product identity, which eliminates two cross products per iteration for each bottom/middle sp.

Since the top sps change every iteration, precomputing the cross products could be a waste because the first check might reject the candidate immediately, so instead we can overload the coordinate check to only compute the additional cross products if needed.

Lastly, we can eliminate unnecessary sqrt calls by noting that the middle check only cares about the ratios s1/bd1 and s0/bd1, sqrt (1+A0^2) is just a multiplicative factor, so can compute it only if the ratios are within tolerance and the check passes.

This appears to reduce the total CPU time taken in the ATLAS LRT strip seeding by ~40% in single-threaded (on 5 events of LLP signal sample -- so take with a grain of salt) and should theoretically be numerically identical

@github-actions github-actions bot added this to the next milestone Mar 13, 2026
@github-actions github-actions bot added Component - Core Affects the Core module Seeding labels Mar 13, 2026
@andiwand andiwand changed the title fix: Reduce number of redundant calls in strip seeding perf: Reduce number of redundant calls in strip seeding Mar 13, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 14, 2026

📊: Physics performance monitoring for 356be33

Full contents

physmon summary

Copy link
Copy Markdown
Contributor

@andiwand andiwand left a comment

Choose a reason for hiding this comment

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

This is great! Thank you for adding this @mvessell96 !!

I only have a two minor comments.

As an alternative to the POD + free functions approach it might be possible to have a small helper class that holds some state for our use case: check middle -> bottom -> top. And the SP filling functions and checks become member functions. But I don't think we really benefit from that in any way

andiwand
andiwand previously approved these changes Mar 14, 2026
@andiwand andiwand marked this pull request as ready for review March 14, 2026 22:35
@andiwand
Copy link
Copy Markdown
Contributor

/ci-bridge-run

@andiwand
Copy link
Copy Markdown
Contributor

ah sorry - @mvessell96 there are some formatting errors https://github.com/acts-project/acts/actions/runs/23097825688/job/67093276148?pr=5239 can you have a look?

@andiwand
Copy link
Copy Markdown
Contributor

/ci-bridge-run

@sonarqubecloud
Copy link
Copy Markdown

@paulgessinger paulgessinger merged commit a6050aa into acts-project:main Mar 17, 2026
45 of 46 checks passed
@andiwand andiwand modified the milestones: next, v46.0.0 Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component - Core Affects the Core module Seeding

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants