Skip to content

Canonicalize PointStamp representation #458

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

Merged

Conversation

frankmcsherry
Copy link
Member

PointStamp represents an infinite vector of T elements, extending a maintained vector with T::minimum(). This allows multiple representations of the same vector when the vector is allowed to end with T::minimum(), which was documented as acceptable. However, it does mean that e.g. the derived Eq implementation, among others, would report two logically identical pointstamps as different, and imo the position that there can be multiple unequal representations of the same state is untenable.

This PR removes that ability, short of direct manipulation by users, through an enforce method that is called by a constructor, and use of that constructor whenever we mint new PointStamps. Demonstration uses that manipulate vector directly are followed by enforce calls.

We could go further and make the field private, and prevent direct manipulation and require clones (or at least into_vec and from_vec patterns). That might increase confidence even further.

cc: @antiguru

Copy link
Member

@antiguru antiguru left a comment

Choose a reason for hiding this comment

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

Thanks, looks good!

@frankmcsherry frankmcsherry merged commit 2895164 into TimelyDataflow:master Jan 30, 2024
@frankmcsherry frankmcsherry deleted the canonicalize_pointstamp branch January 30, 2024 22:06
frankmcsherry added a commit to MaterializeInc/differential-dataflow that referenced this pull request Feb 2, 2024
Canonicalize `PointStamp` representation (TimelyDataflow#458)
This was referenced Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants