Skip to content

chore: Harden track state component allocation - #5801

Merged
kodiakhq[bot] merged 4 commits into
acts-project:mainfrom
andiwand:chore/track-state-storage-hardening
Aug 3, 2026
Merged

chore: Harden track state component allocation#5801
kodiakhq[bot] merged 4 commits into
acts-project:mainfrom
andiwand:chore/track-state-storage-hardening

Conversation

@andiwand

Copy link
Copy Markdown
Contributor

Three inconsistencies around addTrackStateComponents:

  • MutableMultiTrajectoryBackend did not require it, even though every fitter
    now calls TrackStateProxy::addComponents(). A third-party backend satisfied
    the concept and only failed at the first instantiation.

  • VectorMultiTrajectory decided whether a component was present from the
    stored allocMask, while the Podio backend uses the component index.
    shareFrom_impl assigns an index without touching allocMask and
    unset_impl clears an index without touching it either, so the two can
    disagree: sharing a component and then adding it replaced the shared index,
    and unsetting a component and then adding it allocated nothing. Decide from
    the index like Podio does, and keep allocMask for the storage this track
    state actually owns, which is what statistics() reports.

  • AnyTrackStateProxy had the handler entry but never surfaced a public
    addComponents().

Covered by a new shared backend test exercising both sequences.

--- END COMMIT MESSAGE ---

Supersedes #5786, which was accidentally opened from a branch in this
repository instead of my fork. Unlike the previous version this is no longer
stacked on #5784 and #5785 — it touches a disjoint set of files and can be
reviewed on its own.

🤖 Generated with Claude Code

Three inconsistencies around `addTrackStateComponents`:

- `MutableMultiTrajectoryBackend` did not require it, even though every
  fitter now calls `TrackStateProxy::addComponents()`. A third-party
  backend satisfied the concept and only failed at the first instantiation.

- `VectorMultiTrajectory` decided whether a component was present from the
  stored `allocMask`, while the Podio backend uses the component index.
  `shareFrom_impl` assigns an index without touching `allocMask` and
  `unset_impl` clears an index without touching it either, so the two can
  disagree: sharing a component and then adding it replaced the shared
  index, and unsetting a component and then adding it allocated nothing.
  Decide from the index like Podio does, and keep `allocMask` for the
  storage this track state actually owns, which is what `statistics()`
  reports.

- `AnyTrackStateProxy` had the handler entry but never surfaced a public
  `addComponents()`.

Covered by a new shared backend test exercising both sequences.
@github-actions github-actions Bot added Component - Core Affects the Core module Component - Plugins Affects one or more Plugins Event Data Model labels Jul 30, 2026
@github-actions github-actions Bot added this to the next milestone Jul 30, 2026
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

📊: Physics performance monitoring for 2a81586

Full contents

physmon summary

❗️: Downstream build failure

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

Comment thread Core/src/EventData/VectorMultiTrajectory.cpp Outdated
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Public API surface diff

+1 added, 0 breaking.

➕ Added public API

New call signatures (incl. defaulted-arg overloads) (1)
  • Acts::AnyTrackStateProxy::addComponents(TrackStatePropMask)

@benjaminhuth benjaminhuth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good, I have only a few minor question out of curiosity

Comment thread Core/include/Acts/EventData/detail/MultiTrajectoryTestsCommon.hpp
Comment thread Core/include/Acts/EventData/AnyTrackStateProxy.hpp
@sonarqubecloud

sonarqubecloud Bot commented Aug 3, 2026

Copy link
Copy Markdown

@kodiakhq
kodiakhq Bot merged commit 1f2d5d1 into acts-project:main Aug 3, 2026
42 checks passed
@github-actions github-actions Bot removed the automerge label Aug 3, 2026
@andiwand
andiwand deleted the chore/track-state-storage-hardening branch August 3, 2026 17:11
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 Component - Plugins Affects one or more Plugins Event Data Model Public API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants