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

TrackStateType is easy to get wrong #3439

Open
andiwand opened this issue Jul 24, 2024 · 3 comments
Open

TrackStateType is easy to get wrong #3439

andiwand opened this issue Jul 24, 2024 · 3 comments
Labels

Comments

@andiwand
Copy link
Contributor

andiwand commented Jul 24, 2024

I feel like TrackStateType is easy to get wrong in recent work here #3413 and here #3438.

The flags sound exclusive and are use that way in various places looking at the diff here https://github.com/acts-project/acts/pull/3438/files.

I would propose to replace at least parts of the combinations with an enum to enumerate a few common easy and exclusive cases

  • Measurement
  • Hole
  • Outlier

Potentially Material could also be an enum value or handled with a flag. Similar with SharedHit and Parameters. While I am not sure if we really rely on Parameters anywhere.

Orthogonally to this I would prefer to have this as a copied value type that can be get from or set to the track state because the type name does not indicate that it is a proxy.

@paulgessinger
Copy link
Member

paulgessinger commented Jul 25, 2024

It needed to become a proxy, because the underlying storage needed to cast it back and forth between a trivial memory representation in the backend. With an enum, assignment would have to change to a setter so it can be converted to the underlying representation, if you want to get rid of the proxy type.

Copy link

This issue/PR has been automatically marked as stale because it has not had recent activity. The stale label will be removed if any interaction occurs.

@github-actions github-actions bot added the Stale label Aug 24, 2024
@AJPfleger AJPfleger removed the Stale label Aug 27, 2024
Copy link

This issue/PR has been automatically marked as stale because it has not had recent activity. The stale label will be removed if any interaction occurs.

@github-actions github-actions bot added the Stale label Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants