Skip to content

refactor: Some internal GSF refactorings II#4194

Draft
benjaminhuth wants to merge 5 commits intoacts-project:mainfrom
benjaminhuth:refactor/gsf-refactor-some-stuff-2
Draft

refactor: Some internal GSF refactorings II#4194
benjaminhuth wants to merge 5 commits intoacts-project:mainfrom
benjaminhuth:refactor/gsf-refactor-some-stuff-2

Conversation

@benjaminhuth
Copy link
Copy Markdown
Member

@benjaminhuth benjaminhuth commented Apr 7, 2025

Pulled out of #2697 to disentangle changes

--- END COMMIT MESSAGE ---

Any further description goes here, @-mentions are ok here!

  • Use a conventional commits prefix: quick summary
    • We mostly use feat, fix, refactor, docs, chore and build types.
  • A milestone will be assigned by one of the maintainers

Summary by CodeRabbit

  • Refactor
    • Streamlined the internal process for updating components by filtering out lower-impact elements.
    • Enhanced flexibility in handling a broader range of inputs for more efficient processing.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 7, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Changed, the code has been. In the GsfActor structure, the act method now filters components based on a weight cutoff before calling a refactored updateStepper. Accept additional parameters — a Surface reference, component range, and projection function — the new updateStepper does. The old implementation using TemporaryStates has been removed. Clear this refactoring is, focusing on new parameter versatility for processing input, it does.

Changes

File(s) Change Summary
Core/include/Acts/…/GsfActor.hpp - Refactored updateStepper to accept a Surface, a range, and a projection function instead of TemporaryStates.
- Modified act to filter tmpStates.tips using a weight cutoff before invoking updateStepper.

Sequence Diagram(s)

sequenceDiagram
    participant A as GsfActor (act)
    participant T as TemporaryStates
    participant S as Stepper
    participant Surf as Surface
    participant R as Range
    participant P as ProjFunction

    A->>T: Retrieve tips
    T-->>A: Provide component tips
    A->>A: Filter tips by weight cutoff
    A->>S: Call updateStepper with Surf, R, and P
    S-->>A: Return updated state
Loading

Poem

Code refactored, a path anew we see,
In tips trimmed, wisdom there must be.
With Surface and Range, guidance in our hand,
The stepper dances at our command.
Changes embraced, forward we stride,
In the force of code, our hearts abide.
Hmmm, celebrate we must, side by side.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@benjaminhuth benjaminhuth added this to the next milestone Apr 7, 2025
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🔭 Outside diff range comments (1)
Core/include/Acts/TrackFitting/detail/GsfActor.hpp (1)

491-524: 🛠️ Refactor suggestion

Variable overshadowing and reweighting overhead, I sense.

  1. Within the loop at lines 499-500, overshadowed cmp becomes redefined also at line 508. Confusion, that can cause. Rename the loop variable to avoid confusion, you should:
-for (const auto& cmp : range) {
-  const auto& [weight, pars, cov] = proj(cmp);
+for (const auto& component : range) {
+  const auto& [weight, pars, cov] = proj(component);
  1. A second TODO about avoiding extra reweighting is noted at line 519. The code calls reweightComponents at line 523, yes. Possibly unify the reweighting steps or ensure it is needed, you should.
🧹 Nitpick comments (2)
Core/include/Acts/TrackFitting/detail/GsfActor.hpp (2)

321-322: A trivial projector, this is.

A pass-through lambda introduced at lines 321-322, it simply returns the same component with no transformation. Potentially you may omit the lambda or rename it for clarity, but needed for flexible usage in updateStepper, it might be.


489-490: Not the stepper function's final resting place, hmmm.

A TODO to move updateStepper into the stepper itself, declared here is. Good it may be to track this in an issue, so break the code later, you do not. Assist with that, I can.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 848f61b and 5352d76.

📒 Files selected for processing (1)
  • Core/include/Acts/TrackFitting/detail/GsfActor.hpp (4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: merge-sentinel

Comment thread Core/include/Acts/TrackFitting/detail/GsfActor.hpp
@github-actions github-actions Bot added Component - Core Affects the Core module Track Fitting labels Apr 7, 2025
@benjaminhuth benjaminhuth changed the title refactor: Some internal GSF refactorings II refactor: Some internal GSF refactorings II Apr 7, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 7, 2025

📊: Physics performance monitoring for 122a901

Full contents

physmon summary

❗️: Downstream build failure

  • eic-shell (cc @acts-project/epic-contacts)

@benjaminhuth benjaminhuth marked this pull request as draft April 8, 2025 08:15
@github-actions github-actions Bot added the Stale label May 8, 2025
@benjaminhuth benjaminhuth removed the Stale label Sep 1, 2025
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Sep 1, 2025

@github-actions github-actions Bot added the Stale label Oct 1, 2025
@github-actions github-actions Bot removed the Stale label Mar 25, 2026
@github-actions github-actions Bot added the Stale label Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant