Skip to content

Stable hash()#1895

Merged
lionel- merged 10 commits intomainfrom
stable-hash
Apr 17, 2026
Merged

Stable hash()#1895
lionel- merged 10 commits intomainfrom
stable-hash

Conversation

@lionel-
Copy link
Copy Markdown
Member

@lionel- lionel- commented Apr 16, 2026

Branched from #1894

Closes #1681

@lionel- lionel- requested a review from DavisVaughan April 16, 2026 13:15
Base automatically changed from c-format to main April 16, 2026 14:01
Comment thread tests/testthat/test-hash.R
Comment thread R/hash.R
Comment thread src/internal/hash.c
Comment on lines +82 to +83
r_ssize n = r_length(x);
hash_feed_ssize(ctx->p_state, n);
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.

Why include the size?

I get including the type so INTSXP and LGLSXP look different, but why size?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

To bound the object, otherwise this introduces ambiguity with the next object we hash if it matches a type hash?

Comment thread src/internal/hash.c
Comment thread src/internal/hash.c Outdated
Comment thread src/internal/hash.c
Comment thread tests/testthat/test-hash.R
Comment thread tests/testthat/test-hash.R
Comment thread tests/testthat/test-hash.R
Comment thread tests/testthat/test-hash.R
@lionel- lionel- merged commit 229db81 into main Apr 17, 2026
13 checks passed
@lionel- lionel- deleted the stable-hash branch April 17, 2026 10:36
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.

hash generates different results on identical objects (even with same memory address)

2 participants