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

feat: add recoverable CKF error for surfaces without expected measurements. #4120

Conversation

goetzgaycken
Copy link
Contributor

@goetzgaycken goetzgaycken commented Mar 4, 2025

Added recoverable CKF error to handle surfaces without expected measurements. The latter may occur if the underlying detector element of a sensitive surface is defect or if a trajectory passes the sensor outside the sensitive region. The CKF will not count such cases as holes. Also introduced a specific state flag to distinguish such states from pure material states.

--- END COMMIT MESSAGE ---

Summary by CodeRabbit

  • New Features

    • Added an additional tracking state to indicate scenarios where no measurement is expected.
    • Introduced a new error code to support graceful recovery from recoverable measurement issues.
  • Refactor

    • Streamlined the error handling flow during track state creation, allowing processes to continue under specific non-critical error conditions.
    • Updated method signature to enhance flexibility in track state creation.

Copy link

coderabbitai bot commented Mar 4, 2025

Walkthrough

Changed, the code has been. In the TrackStateFlag enum, a new flag, NoExpectedHitFlag, added it is, with the count updated from 6 to 7. Modified error handling in the Kalman filter, the control flow now checks for recoverable errors and continues processing if needed. Additionally, a new error enumerator, NoMeasurementExpected, in the Kalman filter error enum appears. Hmmm, expanded state representation and refined error control, these changes bring.

Changes

File(s) Summary
Core/include/Acts/EventData/.../TrackStateType.hpp Added NoExpectedHitFlag to the TrackStateFlag enum and updated NumTrackStateFlags from 6 to 7.
Core/include/Acts/TrackFinding/.../CombinatorialKalmanFilter.hpp
Core/include/Acts/TrackFinding/.../CombinatorialKalmanFilterError.hpp
Revised error handling in track state creation; updated addNonSourcelinkState method signature to include expectMeasurements; added NoMeasurementExpected enumerator to the error enum.

Suggested labels

Changes Performance

Suggested reviewers

  • paulgessinger

Poem

In code deep, a new flag shines bright,
NoExpectedHitFlag emerges in the night.
Error flows twist and bend, they do,
With recoverable checks to carry us through.
A steady path, our Kalman filter takes,
Changes profound, the force in our code awakes.
Hmmm, celebrate we must, in wisdom anew.

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.

📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 75858bc and 06c9437.

📒 Files selected for processing (2)
  • Core/include/Acts/EventData/TrackStateType.hpp (1 hunks)
  • Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp (5 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • Core/include/Acts/EventData/TrackStateType.hpp
  • Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp
⏰ Context from checks skipped due to timeout of 90000ms (23)
  • GitHub Check: merge-sentinel
  • GitHub Check: CI Bridge / lcg_107: [alma9, gcc13]
  • GitHub Check: CI Bridge / lcg_107: [alma9, gcc14]
  • GitHub Check: CI Bridge / lcg_107: [alma9, clang19]
  • GitHub Check: CI Bridge / build_exatrkx
  • GitHub Check: CI Bridge / lcg_105: [alma9, clang16]
  • GitHub Check: CI Bridge / lcg_106a: [alma9, clang16]
  • GitHub Check: CI Bridge / lcg_106a: [alma9, gcc13]
  • GitHub Check: CI Bridge / linux_ubuntu_2204_clang
  • GitHub Check: CI Bridge / lcg_106a: [alma9, gcc14]
  • GitHub Check: CI Bridge / lcg_105: [alma9, gcc13]
  • GitHub Check: CI Bridge / linux_ubuntu_2204
  • GitHub Check: CI Bridge / build_exatrkx_cpu
  • GitHub Check: CI Bridge / build_linux_ubuntu
  • GitHub Check: CI Bridge / clang_tidy
  • GitHub Check: build_debug
  • GitHub Check: linux_ubuntu_extra (ubuntu2204, 20, g++)
  • GitHub Check: macos
  • GitHub Check: unused_files
  • GitHub Check: linux_ubuntu_extra (ubuntu2204, 20, clang++)
  • GitHub Check: missing_includes
  • GitHub Check: linux_ubuntu
  • GitHub Check: docs

🪧 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.
  • @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 this to the next milestone Mar 4, 2025
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: 1

🧹 Nitpick comments (4)
Core/include/Acts/TrackFinding/CombinatorialKalmanFilterError.hpp (1)

23-23: Add doc comment for this new enumerator, hmmm.
Helpful to future maintainers it will be, if reason for “NoMeasurementExpected” they know.

Core/include/Acts/EventData/TrackStateType.hpp (1)

31-32: Expanding track state flags, done you have.
Add guiding comment for NoExpectedHitFlag, yes? Clarity in docs, it shall bring.

Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp (2)

477-479: See an extraneous line, I do.
*tsRes; leftover from debugging, remove it you should.


697-702: Consistent naming, preserve clarity we must.
Use the exact enumerator name (“NoExpectedHitFlag”) in this message, wise it would be.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between ce581ba and cfe6241.

📒 Files selected for processing (3)
  • Core/include/Acts/EventData/TrackStateType.hpp (1 hunks)
  • Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp (5 hunks)
  • Core/include/Acts/TrackFinding/CombinatorialKalmanFilterError.hpp (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp (2)
Learnt from: goetzgaycken
PR: acts-project/acts#3825
File: Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp:933-938
Timestamp: 2024-12-02T14:13:24.820Z
Learning: In `Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp`, the overloading of `findTracks` functions is intentional for convenience and not considered code duplication.
Learnt from: goetzgaycken
PR: acts-project/acts#3825
File: Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp:460-467
Timestamp: 2024-12-05T10:58:53.433Z
Learning: In the `Acts` project, within `Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp`, the cache `result.trackStateCandidates` is expected to be empty before calling `createTrackStates` in the function `filter` of `CombinatorialKalmanFilter`.
🪛 GitHub Actions: Docs
Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp

[error] 679-679: Doxygen documentation error: The parameter 'expectMeasurements' of Acts::CombinatorialKalmanFilter::Actor::addNonSourcelinkState is not documented.

⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: unused_files
  • GitHub Check: macos
  • GitHub Check: missing_includes
  • GitHub Check: linux_ubuntu
  • GitHub Check: build_debug
🔇 Additional comments (1)
Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp (1)

502-513: Recoverable error path, tested must it be.
A scenario for NoMeasurementExpected, confirm coverage with tests, you should.

Copy link

github-actions bot commented Mar 4, 2025

📊: Physics performance monitoring for 06c9437

Full contents

physmon summary

Introduce an additional flag for states without associated measurement,
and for which no measurement is expected.
@goetzgaycken goetzgaycken force-pushed the feat_handle_surfaces_without_expected_measurement branch from cfe6241 to 75858bc Compare March 4, 2025 15:23
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/TrackFinding/CombinatorialKalmanFilter.hpp (1)

477-479: Simplify your pointer usage, you could.
The expression (*tsRes).empty() can be replaced by tsRes->empty() for improved readability.

- if (tsRes.ok() && !(*tsRes).empty()) {
+ if (tsRes.ok() && !tsRes->empty()) {
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between cfe6241 and 75858bc.

📒 Files selected for processing (2)
  • Core/include/Acts/EventData/TrackStateType.hpp (1 hunks)
  • Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp (5 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • Core/include/Acts/EventData/TrackStateType.hpp
🧰 Additional context used
🧠 Learnings (1)
Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp (2)
Learnt from: goetzgaycken
PR: acts-project/acts#3825
File: Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp:933-938
Timestamp: 2024-12-02T14:13:24.820Z
Learning: In `Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp`, the overloading of `findTracks` functions is intentional for convenience and not considered code duplication.
Learnt from: goetzgaycken
PR: acts-project/acts#3825
File: Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp:460-467
Timestamp: 2024-12-05T10:58:53.433Z
Learning: In the `Acts` project, within `Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp`, the cache `result.trackStateCandidates` is expected to be empty before calling `createTrackStates` in the function `filter` of `CombinatorialKalmanFilter`.
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: unused_files
  • GitHub Check: linux_ubuntu_extra (ubuntu2204, 20, clang++)
  • GitHub Check: missing_includes
  • GitHub Check: linux_ubuntu_extra (ubuntu2204, 20, g++)
  • GitHub Check: macos
  • GitHub Check: linux_ubuntu
  • GitHub Check: docs
  • GitHub Check: build_debug
🔇 Additional comments (4)
Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp (4)

502-514: Robust, your error handling for recoverable states is.
No further recommendations needed, appear there are none.


523-525: Nicely integrated, these lines are, with the new parameter.
Adding the non-source link state flow is consistent.


697-703: Helpful, these verbose logs are.
Eases debugging when analyzing “Hole” vs “noMeasurementExpected” states, it does.


722-723: Consistent naming, see I do.
The usage of NoExpectedHitFlag aligns with expectMeasurements.

@kodiakhq kodiakhq bot merged commit ec45abd into acts-project:main Mar 14, 2025
45 checks passed
@andiwand andiwand modified the milestones: next, v40.0.0 Mar 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants