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

chore: update to newest traccc+detray+friends #4068

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

asalzburger
Copy link
Contributor

@asalzburger asalzburger commented Feb 3, 2025

This PR updates to the latest traccc versions and adapts the client code.

It also adapts the Covfie pytests to the new array return type.

--- END COMMIT MESSAGE ---

Thanks @stephenswat for the traccc talk.

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

  • Chores
    • Upgraded external dependencies and updated resource integrity checks for improved stability.
  • New Features
    • Introduced a specialized detector integration in the Python interface.
    • Enhanced the declareCovfieField function to support different scalar types and added a new array class for element access.
  • Refactor
    • Streamlined the propagation configuration and adjusted type definitions for enhanced modularity and clarity.
  • Bug Fixes
    • Improved type checks for detector features, enhancing the conversion process.
    • Enhanced clarity of assertions and field access in tests.

@asalzburger asalzburger added this to the next milestone Feb 3, 2025
Copy link

coderabbitai bot commented Feb 3, 2025

Walkthrough

Updated, the project has been. Multiple dependency versions in CMakeLists.txt are incremented. In addition, header includes and class definitions in the Detray modules have been refined. The execution flow in the DetrayPropagator has been restructured with a new context and configuration. Python bindings now reference a specialized detector class. Type aliases and trait checks in the plugins have also been modified, and external source SHA256 hashes are updated. Factual these changes are, improved clarity and consistency they bring.

Changes

File(s) Change Summary
CMakeLists.txt Dependency versions updated: _acts_detray 0.75.3 → 0.87.0, _acts_traccc 0.16.0 → 0.19.0, _acts_covfie 0.10.0 → 0.11.0, _acts_vecmem 1.4.0 → 1.13.0, _acts_algebraplugins 0.22.0 → 0.26.2
Examples/Algorithms/Traccc/.../DetrayPropagator.hpp Added include for propagation_config.hpp; updated include path for material_validation_utils.hpp; restructured execution configuration in the execute method
Examples/Python/src/Detray.cpp Added include for DetrayConversionUtils.hpp; class binding updated from generic detector to DetrayHostDetector
Plugins/Detray/.../DetrayConversionUtils.hpp Added includes for algebra and default metadata; updated type alias for DetrayHostDetector to use new DetrayMetaData; defined alias for DetrayMetaData
Plugins/Detray/.../DetrayConverter.hpp Modified type trait checks from detail-based to concept-based (has_homogeneous_material and has_material_maps)
cmake/ActsExternSources.cmake SHA256 hash values updated for ACTS sources: vecmem, algebraplugins, covfie, detray, and traccc

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant DP as DetrayPropagator
    participant PC as Propagator
    U->>DP: Call execute()
    DP->>DP: Create context (dCtx) and config (dCfg)
    DP->>PC: Instantiate Propagator with dCfg
    PC-->>DP: Return state/result
    DP->>U: Return propagation result
Loading

Suggested labels

Component - Core, automerge, Changes Performance

Suggested reviewers

  • andiwand

Poem

In code’s vast galaxy, updates gleam bright,
Dependencies shifted, a forceful light.
New paths and contexts, in logic they unite,
With changes refined, our code takes flight.
Celebrate now we must, with joy in the night!
Hmmm, strong in the update, the future is, yes.
Code and force, together they might.

Tip

🌐 Web search-backed reviews and chat
  • We have enabled web search-based reviews and chat for all users. This feature allows CodeRabbit to access the latest documentation and information on the web.
  • You can disable this feature by setting web_search: false in the knowledge_base settings.
  • Please share any feedback in the Discord discussion.

📜 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 e57bbb3 and 3d63ac1.

📒 Files selected for processing (3)
  • Examples/Python/src/Covfie.cpp (1 hunks)
  • Examples/Python/tests/test_covfie.py (2 hunks)
  • Plugins/Detray/include/Acts/Plugins/Detray/DetrayConverter.hpp (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • Plugins/Detray/include/Acts/Plugins/Detray/DetrayConverter.hpp
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: merge-sentinel
  • GitHub Check: macos
🔇 Additional comments (5)
Examples/Python/tests/test_covfie.py (2)

16-20: Approve these changes, I do. Clearer field access, they bring.

More explicit and readable, the new field access pattern is. Through proper array indexing, safer access we achieve.


57-61: Hmmmm. Better variable naming and field access, this is.

From 'val' to 'rfield', a more descriptive name we have gained. The new field access pattern, consistency it brings.

Examples/Python/src/Covfie.cpp (3)

23-32: Wise addition of template parameter, this is. More flexible, the code becomes.

Through scalar_type template parameter, greater type safety we achieve. The Force flows stronger through properly typed code.


39-44: A new array class emerges, proper access it provides.

Safe element access through the 'at' method, wisdom in implementation it shows. Protected from the Dark Side of buffer overflows, we are.


45-48: Updated field declarations, consistency they bring.

With float type explicitly specified, clearer intentions become. In harmony with the new template parameter, these changes are.

✨ 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 Infrastructure Changes to build tools, continous integration, ... Component - Examples Affects the Examples module Component - Plugins Affects one or more Plugins labels Feb 3, 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 (1)
Examples/Algorithms/Traccc/include/ActsExamples/Traccc/DetrayPropagator.hpp (1)

114-124: Refactor duplicate configuration setup, we should!

Similar code in sterile and non-sterile paths, I see. Extract common configuration setup to a helper function, we must.

 template <typename stepper_t, typename detray_store_t>
 class DetrayPropagator : public PropagatorInterface {
+  private:
+    template<typename Propagator>
+    typename Propagator::state createPropagationState(
+        const detray::free_track_parameters<DetrayAlgebraType>& track) const {
+      using Context = typename Propagator::state::context_type;
+      Context dCtx{};
+      using Config = detray::propagation::config;
+      Config dCfg{};
+      
+      return typename Propagator::state(track, m_cfg.detrayStore->detector, dCtx);
+    }

Also applies to: 169-179

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 2c23141 and 666d876.

📒 Files selected for processing (6)
  • CMakeLists.txt (1 hunks)
  • Examples/Algorithms/Traccc/include/ActsExamples/Traccc/DetrayPropagator.hpp (3 hunks)
  • Examples/Python/src/Detray.cpp (2 hunks)
  • Plugins/Detray/include/Acts/Plugins/Detray/DetrayConversionUtils.hpp (2 hunks)
  • Plugins/Detray/include/Acts/Plugins/Detray/DetrayConverter.hpp (2 hunks)
  • cmake/ActsExternSources.cmake (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (13)
  • GitHub Check: merge-sentinel
  • GitHub Check: CI Bridge / build_gnn_tensorrt
  • GitHub Check: CI Bridge / build_linux_ubuntu
  • GitHub Check: CI Bridge / build_exatrkx
  • GitHub Check: CI Bridge / build_exatrkx_cpu
  • GitHub Check: CI Bridge / clang_tidy
  • GitHub Check: unused_files
  • GitHub Check: macos
  • GitHub Check: missing_includes
  • GitHub Check: linux_ubuntu_extra (ubuntu2204, 20, clang++)
  • GitHub Check: linux_ubuntu_extra (ubuntu2204, 20, g++)
  • GitHub Check: linux_ubuntu
  • GitHub Check: build_debug
🔇 Additional comments (6)
Plugins/Detray/include/Acts/Plugins/Detray/DetrayConverter.hpp (1)

72-72: Wise choice, using concepts instead of type traits, it is!

From implementation details to clear concepts, moved we have. Clearer intent and better error messages, this change brings. Approve this modification, I do.

Examples/Python/src/Detray.cpp (1)

10-10: Approve the specialization of detector class, I do!

From generic template to specific DetrayHostDetector, the change moves. Clarity and type safety, this brings to our code.

Also applies to: 36-37

cmake/ActsExternSources.cmake (1)

9-9: Verify the integrity of new dependency versions, we must!

Updated SHA256 hashes for multiple dependencies, I see. Ensure their correctness, we should.

Also applies to: 16-16, 23-23, 30-30, 37-37

Plugins/Detray/include/Acts/Plugins/Detray/DetrayConversionUtils.hpp (1)

18-20: Improved type safety through explicit metadata handling, I sense!

Using array for metadata, more precise our types become. A wise choice, this is.

Also applies to: 29-31

Examples/Algorithms/Traccc/include/ActsExamples/Traccc/DetrayPropagator.hpp (1)

21-21: Updated includes, clarity they bring!

Proper organization of headers, maintain we must.

Also applies to: 24-24

CMakeLists.txt (1)

272-276: Updated dependency versions, they are!
Your changes update the versions for _acts_detray, _acts_traccc, _acts_covfie, _acts_vecmem, and _acts_algebraplugins to the latest values. Ensure you have verified that the updated SHA256 hashes in the external sources file match these versions, and that all dependent modules remain compatible, you must.

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 (1)
Examples/Algorithms/Traccc/include/ActsExamples/Traccc/DetrayPropagator.hpp (1)

114-124: Consider configuration customization, you must!

Empty configuration object created, I see. Opportunity for customization missed, it is. Properties like step size limits or navigation tolerances, configure you should.

 DetrayConfig dCfg{};
+// Configure propagation properties
+dCfg.navigation_tolerance = 1e-5;
+dCfg.step_size_limit = 100.;  // Example value in mm
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 666d876 and 7065d65.

📒 Files selected for processing (1)
  • Examples/Algorithms/Traccc/include/ActsExamples/Traccc/DetrayPropagator.hpp (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (18)
  • GitHub Check: CI Bridge / lcg_106a: [alma9, gcc13]
  • GitHub Check: CI Bridge / lcg_105: [alma9, clang16]
  • GitHub Check: CI Bridge / lcg_105: [alma9, gcc13]
  • GitHub Check: CI Bridge / linux_ubuntu_2204_clang
  • GitHub Check: CI Bridge / linux_ubuntu_2204
  • GitHub Check: CI Bridge / build_linux_ubuntu
  • GitHub Check: CI Bridge / build_exatrkx
  • GitHub Check: CI Bridge / build_exatrkx_cpu
  • GitHub Check: merge-sentinel
  • GitHub Check: unused_files
  • GitHub Check: missing_includes
  • GitHub Check: CI Bridge / clang_tidy
  • GitHub Check: build_debug
  • GitHub Check: CI Bridge / build_gnn_tensorrt
  • GitHub Check: linux_ubuntu_extra (ubuntu2204, 20, clang++)
  • GitHub Check: macos
  • GitHub Check: linux_ubuntu_extra (ubuntu2204, 20, g++)
  • GitHub Check: linux_ubuntu
🔇 Additional comments (1)
Examples/Algorithms/Traccc/include/ActsExamples/Traccc/DetrayPropagator.hpp (1)

21-21: Approve these changes, I do!

Wise additions these includes are. Support the new configuration structure, they do.

Also applies to: 24-24

Copy link

github-actions bot commented Feb 3, 2025

📊: Physics performance monitoring for 0c3c530

Full contents

physmon summary

@asalzburger
Copy link
Contributor Author

Hey @stephenswat @niermann999 - there seems to be building problems coming form both detray and traccc in one (> one) build configurations of our CI matrix. Can you have a look please?

stephenswat added a commit to stephenswat/traccc that referenced this pull request Feb 4, 2025
acts-project/acts#4068 exposes a mistake in our
sanity checks, revealing that there are some missing typename keywords.
This commit fixes those errors by adding the necessary keywords.
stephenswat added a commit to stephenswat/traccc that referenced this pull request Feb 4, 2025
acts-project/acts#4068 exposes a mistake in our
sanity checks, revealing that there are some missing typename keywords.
This commit fixes those errors by adding the necessary keywords.
Copy link

sonarqubecloud bot commented Feb 4, 2025

@paulgessinger
Copy link
Member

paulgessinger commented Feb 5, 2025

There's a compilation error on clang 14:

__w/acts/acts/build/_deps/detray-src/core/include/detray/utils/bit_encoder.hpp:47:30: error: cannot take address of consteval function 'extract_shift' outside of an immediate invocation
        return (v & mask) >> extract_shift(mask);
                             ^
/__w/acts/acts/build/_deps/detray-src/core/include/detray/utils/bit_encoder.hpp:63:26: note: declared here
    static consteval int extract_shift(value_t mask) noexcept {
                         ^
/__w/acts/acts/build/_deps/detray-src/core/include/detray/utils/bit_encoder.hpp:55:35: error: cannot take address of consteval function 'extract_shift' outside of an immediate invocation
        v = (v & ~mask) | ((id << extract_shift(mask)) & mask);
                                  ^
/__w/acts/acts/build/_deps/detray-src/core/include/detray/utils/bit_encoder.hpp:63:26: note: declared here
    static consteval int extract_shift(value_t mask) noexcept {
                         ^
2 errors generated.

Is there a clang14 build over on detray? @asalzburger @niermann999

@niermann999
Copy link
Contributor

There's a compilation error on clang 14:

__w/acts/acts/build/_deps/detray-src/core/include/detray/utils/bit_encoder.hpp:47:30: error: cannot take address of consteval function 'extract_shift' outside of an immediate invocation
        return (v & mask) >> extract_shift(mask);
                             ^
/__w/acts/acts/build/_deps/detray-src/core/include/detray/utils/bit_encoder.hpp:63:26: note: declared here
    static consteval int extract_shift(value_t mask) noexcept {
                         ^
/__w/acts/acts/build/_deps/detray-src/core/include/detray/utils/bit_encoder.hpp:55:35: error: cannot take address of consteval function 'extract_shift' outside of an immediate invocation
        v = (v & ~mask) | ((id << extract_shift(mask)) & mask);
                                  ^
/__w/acts/acts/build/_deps/detray-src/core/include/detray/utils/bit_encoder.hpp:63:26: note: declared here
    static consteval int extract_shift(value_t mask) noexcept {
                         ^
2 errors generated.

Is there a clang14 build over on detray? @asalzburger @niermann999

I think what we check is AppleClang 15

@paulgessinger
Copy link
Member

@niermann999 it's not that obvious what this maps to. We should probably actually add a non-Apple clang build to detray CI at some point.

@asalzburger
Copy link
Contributor Author

@niermann999 it's not that obvious what this maps to. We should probably actually add a non-Apple clang build to detray CI at some point.

The new detray version should have a fix for that though, right?

@niermann999
Copy link
Contributor

@niermann999 it's not that obvious what this maps to. We should probably actually add a non-Apple clang build to detray CI at some point.

The new detray version should have a fix for that though, right?

I hope so, but I think Paul right, if ACTS checks it, detray should, too. Otherwise, this story will continue to repeat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component - Examples Affects the Examples module Component - Plugins Affects one or more Plugins Infrastructure Changes to build tools, continous integration, ...
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants