Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Reset component state in MultiEigenStepperLoop over MultiStepperSurfaceReached #4027

Merged

Conversation

andiwand
Copy link
Contributor

@andiwand andiwand commented Jan 13, 2025

After facing another problem with the GSF in #3449 this might resolve it. The problem seems to be that the navigator and the surface reached aborter are fighting over the surface reached status which can lead to removing all components if the target surface is not reached and the maximum step trials for the multi stepper are reached.

This might introduce other problems so waiting for physmon report.

blocked by

Summary by CodeRabbit

  • Refactor

    • Updated inheritance for MultiStepperSurfaceReached struct to use ForcedSurfaceReached as base class
    • Removed explicit constructor for MultiStepperSurfaceReached
    • Modified checkAbort method to use new base class implementation
  • Chores

    • Improved component handling and logging in MultiEigenStepperLoop class
    • Enhanced state management for components during stepping process

@andiwand andiwand added this to the next milestone Jan 13, 2025
Copy link

coderabbitai bot commented Jan 13, 2025

Walkthrough

Hmm, changes to propagation components, there are. In the MultiEigenStepperLoop and MultiStepperAborters, modifications subtle but significant, I sense. Component management refined, logging enhanced, and inheritance structure altered, these changes represent. A dance of code optimization, this is - delicate yet purposeful.

Changes

File Change Summary
Core/include/Acts/Propagator/MultiEigenStepperLoop.ipp - Reordered logging statements
- Added logging for remaining components
- Modified component removal logic
- Introduced loop to invalidate component statuses
Core/include/Acts/Propagator/MultiStepperAborters.hpp - Changed base class from SurfaceReached to ForcedSurfaceReached
- Removed explicit constructor
- Updated checkAbort method call

Poem

In code's mystical flow, changes dance 🌟
Components shift, like lightsabers' glance
Logging whispers, inheritance sways
The Force of refactoring guides our ways
Wisdom in lines, a programmer's art 🚀

Hmm, yes. Poetic, this is.

Finishing Touches

  • 📝 Generate Docstrings (Beta)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.

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. (Beta)
  • @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.

@github-actions github-actions bot added the Component - Core Affects the Core module label Jan 13, 2025
@andiwand andiwand added the 🛑 blocked This item is blocked by another item label Jan 13, 2025
Copy link

github-actions bot commented Jan 13, 2025

📊: Physics performance monitoring for db8a46c

Full contents

physmon summary

@andiwand andiwand closed this Jan 13, 2025
@andiwand
Copy link
Contributor Author

andiwand commented Jan 13, 2025

This triggers other problems

@andiwand andiwand deleted the multi-surface-reached-dont-reset-status branch January 13, 2025 15:38
@andiwand andiwand reopened this Jan 13, 2025
@andiwand
Copy link
Contributor Author

Maybe resetting after each step helps

@andiwand andiwand marked this pull request as ready for review January 13, 2025 17:10
@andiwand andiwand requested a review from benjaminhuth January 13, 2025 17:10
Copy link

@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: 0

🧹 Nitpick comments (1)
Core/include/Acts/Propagator/MultiEigenStepperLoop.ipp (1)

224-224: Status invalidation after step, added you have. Hmm.

Invalidate component status after each step, wise it may be. But potential side effects, consider we must.

Consider adding a comment explaining why status invalidation necessary it is:

  // Return error if there is no ok result
  if (components.empty()) {
    return MultiStepperError::AllComponentsSteppingError;
  }

+  // Reset component status after step to ensure proper state management
+  // in subsequent iterations
  // Invalidate the component status after each step
  for (auto& cmp : components) {
    cmp.status = Status::unreachable;
  }

Also applies to: 228-232

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between eae98cc and 813e103.

📒 Files selected for processing (2)
  • Core/include/Acts/Propagator/MultiEigenStepperLoop.ipp (3 hunks)
  • Core/include/Acts/Propagator/MultiStepperAborters.hpp (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (19)
  • GitHub Check: CI Bridge / lcg_106a: [alma9, clang16]
  • GitHub Check: CI Bridge / lcg_105: [alma9, clang16]
  • GitHub Check: CI Bridge / lcg_106a: [alma9, gcc14]
  • GitHub Check: CI Bridge / lcg_106a: [alma9, gcc13]
  • GitHub Check: CI Bridge / lcg_106a: [alma9, gcc14]
  • GitHub Check: CI Bridge / linux_ubuntu_2204
  • GitHub Check: CI Bridge / lcg_105: [alma9, gcc13]
  • GitHub Check: CI Bridge / linux_ubuntu_2204_clang
  • GitHub Check: CI Bridge / build_linux_ubuntu
  • GitHub Check: CI Bridge / build_exatrkx
  • GitHub Check: CI Bridge / linux_ubuntu_2204
  • GitHub Check: CI Bridge / clang_tidy
  • GitHub Check: CI Bridge / clang_tidy
  • GitHub Check: CI Bridge / build_exatrkx
  • GitHub Check: CI Bridge / build_exatrkx_cpu
  • GitHub Check: CI Bridge / lcg_106a: [alma9, gcc13]
  • GitHub Check: CI Bridge / build_linux_ubuntu
  • GitHub Check: CI Bridge / build_exatrkx_cpu
  • GitHub Check: build_debug
🔇 Additional comments (4)
Core/include/Acts/Propagator/MultiStepperAborters.hpp (2)

84-85: Use ForcedSurfaceReached::checkAbort now, we do.

Aligned with new inheritance, this change is. But careful we must be, for forced behavior different outcomes may bring.

Verify impact on other components, we should:

✅ Verification successful

Correct, the code already is. Changes needed, there are not.

In harmony with the Force, this implementation stands. ForcedSurfaceReached::checkAbort already in use, it is. No other components affected, as singular this usage remains. Proceed with confidence, you may.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other uses of SurfaceReached::checkAbort
rg "SurfaceReached::checkAbort" -A 2

Length of output: 361


Script:

#!/bin/bash
# Search for any Surface-related abort checks
rg "Surface.*::checkAbort" -A 2

# Search for any other abort checks in the same file
rg "::checkAbort" Core/include/Acts/Propagator/MultiStepperAborters.hpp -A 2

Length of output: 598


16-16: Changed inheritance, I see. Wise choice, this may be.

From SurfaceReached to ForcedSurfaceReached, the path now leads. More deterministic behavior in surface reaching, this change brings.

Run this verification, we must:

✅ Verification successful

Safe this inheritance change is, hmm. Wise decision it was!

The Force reveals that ForcedSurfaceReached, from SurfaceReached it comes, and infinite overstep tolerance it brings. A natural evolution for MultiStepperSurfaceReached, this change is. Affect other Jedi's code, it does not.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any other classes that might be affected by this inheritance change
ast-grep --pattern 'class $_ : public SurfaceReached'

Length of output: 55


Script:

#!/bin/bash
# Search for both class definitions and their usage
echo "=== Searching for SurfaceReached and ForcedSurfaceReached definitions ==="
ast-grep --pattern 'struct $name : $_'

echo -e "\n=== Searching for includes of these classes ==="
rg -l "SurfaceReached|ForcedSurfaceReached" --type cpp

echo -e "\n=== Looking for any direct usage patterns ==="
rg "SurfaceReached|ForcedSurfaceReached" --type cpp -A 2

Length of output: 8642

Core/include/Acts/Propagator/MultiEigenStepperLoop.ipp (2)

121-121: Improved logging and component management, you have.

Clearer messages about component fate, these changes bring. But careful monitoring of component count, essential it is.

Also applies to: 125-130


190-190: Direct component removal, implemented you have.

More efficient approach to component management, this is. But verify component state preservation, we must.

✅ Verification successful

Safe and efficient, your component removal is, young Padawan.

Components state preserved well through standard C++ patterns, it is. Both erase-remove idiom and range-based removal, properly implemented they are. No concerns have I.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other component removal patterns
rg "components\.erase" -A 2

Length of output: 546

@andiwand andiwand removed the 🛑 blocked This item is blocked by another item label Jan 15, 2025
Copy link
Member

@benjaminhuth benjaminhuth left a comment

Choose a reason for hiding this comment

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

Looks good to me! Maybe a adept the PR title for the current set of changes?

@andiwand andiwand changed the title fix: Don't reset component state in MultiStepperSurfaceReached fix: Reset component state in MultiEigenStepperLoop over MultiStepperSurfaceReached Jan 15, 2025
@kodiakhq kodiakhq bot merged commit 0932329 into acts-project:main Jan 15, 2025
46 checks passed
@paulgessinger paulgessinger modified the milestones: next, v39.0.0 Feb 5, 2025
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants