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

RFC: Simpler array hashing #26022

Merged
merged 8 commits into from
Aug 2, 2018
Merged

RFC: Simpler array hashing #26022

merged 8 commits into from
Aug 2, 2018

Commits on Jul 9, 2018

  1. Configuration menu
    Copy the full SHA
    a3c1024 View commit details
    Browse the repository at this point in the history

Commits on Jul 10, 2018

  1. Configuration menu
    Copy the full SHA
    5aae6ff View commit details
    Browse the repository at this point in the history

Commits on Jul 11, 2018

  1. New design: interleave fibonacci skips with finding non-repeating ele…

    …ments
    
        Goal: Hash approximately log(N) entries with a higher density of hashed elements
        weighted towards the end and special consideration for repeated values. Colliding
        hashes will often subsequently be compared by equality -- and equality between arrays
        works elementwise forwards and is short-circuiting. This means that a collision
        between arrays that differ by elements at the beginning is cheaper than one where the
        difference is towards the end. Furthermore, blindly choosing log(N) entries from a
        sparse array will likely only choose the same element repeatedly (zero in this case).
    
        To achieve this, we work backwards, starting by hashing the last element of the
        array. After hashing each element, we skip the next `fibskip` elements, where
        `fibskip` is pulled from the Fibonacci sequence -- Fibonacci was chosen as a simple
        ~O(log(N)) algorithm that ensures we don't hit a common divisor of a dimension and
        only end up hashing one slice of the array (as might happen with powers of two).
        Finally, we find the next distinct value from the one we just hashed.
    mbauman committed Jul 11, 2018
    Configuration menu
    Copy the full SHA
    f16326f View commit details
    Browse the repository at this point in the history

Commits on Jul 13, 2018

  1. Configuration menu
    Copy the full SHA
    0d72578 View commit details
    Browse the repository at this point in the history

Commits on Jul 26, 2018

  1. Add tests

    Fixes #27865 and fixes #26011.
    mbauman committed Jul 26, 2018
    Configuration menu
    Copy the full SHA
    0e97f65 View commit details
    Browse the repository at this point in the history
  2. Use rem instead of mod

    mbauman committed Jul 26, 2018
    Configuration menu
    Copy the full SHA
    42c8ea9 View commit details
    Browse the repository at this point in the history
  3. Also add test for #26034

    Fixes #26034
    mbauman committed Jul 26, 2018
    Configuration menu
    Copy the full SHA
    3d62fba View commit details
    Browse the repository at this point in the history

Commits on Jul 27, 2018

  1. Configuration menu
    Copy the full SHA
    5a99f4b View commit details
    Browse the repository at this point in the history