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

Improve equality and interning semantics for source ref and spec #6778

Open
hannes-ucsc opened this issue Dec 20, 2024 · 0 comments
Open

Improve equality and interning semantics for source ref and spec #6778

hannes-ucsc opened this issue Dec 20, 2024 · 0 comments
Labels
- [priority] Medium debt [type] A defect incurring continued engineering cost enh [type] New feature or request groomed [process] Issue was recently looked at during backlog grooming orange [process] Done by the Azul team

Comments

@hannes-ucsc
Copy link
Member

hannes-ucsc commented Dec 20, 2024

Supersedes #3250

From #6765 (comment):

Two SourceRef instances should be equal if and only if their .id is equal. There should be no two SourceRef instances with equal .id and unequal .spec. I'm unsure if this should be enforced via interning or in the __eq__ override. The enforcement via interning would be deterministic. Detecting a discrepancy in the __eq__ override would be probabilistic. However, the interning involves a lock which could limit concurrency. I also doubt that the memory savings obtained by interning are significant. More thought and/or experimentation needs to go into this.

Two SourceSpec instances should be equal if an only if they're of the same class and and equal in the value of all of their attributes. Instead of having an optional prefix in the SourceSpec base class, there should be a decorator class called SourcePartition with a mandatory prefix attribute, and another attribute called spec for the SourceSpec instance that it decorates. I'm not sure if SourcePartition would be a subclass of SourceSpec or not. If not, the SOURCE_SPEC type parameter to the SourceRef type would not have a bound. But either way, a SourcePartition instance would never be equal to another SourceSpec instance that is not a SourcePartition. That's what would make the .id indirection in the fix for #67651 redundant.

@hannes-ucsc hannes-ucsc added the orange [process] Done by the Azul team label Dec 20, 2024
nadove-ucsc added a commit that referenced this issue Dec 21, 2024
nadove-ucsc added a commit that referenced this issue Jan 2, 2025
@hannes-ucsc hannes-ucsc added debt [type] A defect incurring continued engineering cost enh [type] New feature or request - [priority] Medium groomed [process] Issue was recently looked at during backlog grooming labels Jan 7, 2025
@hannes-ucsc hannes-ucsc removed their assignment Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- [priority] Medium debt [type] A defect incurring continued engineering cost enh [type] New feature or request groomed [process] Issue was recently looked at during backlog grooming orange [process] Done by the Azul team
Projects
None yet
Development

No branches or pull requests

1 participant