Hash functions and CountHashTab#727
Open
lekcyjna123 wants to merge 5 commits intokuznia-rdzeni:masterfrom
Open
Hash functions and CountHashTab#727lekcyjna123 wants to merge 5 commits intokuznia-rdzeni:masterfrom
lekcyjna123 wants to merge 5 commits intokuznia-rdzeni:masterfrom
Conversation
Member
We're not supposed to implement some dreamed up hash functions, but some existing ones with established properties. The only thing to test is to compare a hardware implementation to a software one. |
tilk
reviewed
Sep 4, 2024
Comment on lines
+183
to
+185
| # Check if there is at least as many elements as we put inside (can be more because of aliasing) | ||
| assert count["count"] >= sum(map(lambda x: 1, filter(lambda x: x == in_val, input))) | ||
| assert count["count"] in self.table_snapshots[-1] |
Member
There was a problem hiding this comment.
This is a very weak test. I believe a constant table which is filled with maximum values would satisfy it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi,
Here is a pull request which adds hash tables. In particularly:
-- Lookup3 (http://www.burtleburtle.net/bob/hash/doobs.html)
-- SipHash (https://eprint.iacr.org/2012/351.pdf)
I am not sure how to test them, so comments are welcome.
Hash functions I test using statistical test to check if they hash into uniform distribution, but sadly for small input data (from range [0,1023]) there is some bias and statistical tests fails... Whats more I am not sure if we want to have tests based on statistics, because this can cause instability.