feat(hash): port mumbo to Starlark (hash.mumbo) - #257
Merged
Conversation
Port the default 64-bit hash mumbo::GetHash64 to hash.bzl next to dumbo/fnv1a: the kSecret bank, the seed absorb, the small-key (<=16) loader, the 16-byte MUM chain, the 8-lane 128-byte bulk tier, and the two-multiply finalizer - all as masked 64-bit Starlark arithmetic. Its default seed is the library-wide kDefaultSeed (5381), unlike dumbo (0) and fnv1a (offset basis). Verified byte-for-byte against the C++ prime via hash_bzl_vs_cpp_mumbo_test (hash_tool already registered mumbo), across lengths 0..300 spanning all three tiers and every tail size. Only the one-shot 64-bit form is ported; the native 128-bit jumbo and streaming stay C++-only. Updates the Algorithm-overview Starlark column and documents each port's canonical default seed.
# Conflicts: # CHANGELOG.md # mbo/hash/README.md
… in by git add -A); file kept on disk
helly25
enabled auto-merge (squash)
July 13, 2026 18:13
Fab-Cat
approved these changes
Jul 13, 2026
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.
Adds
hash.mumboto the Starlark ports in//mbo/hash:hash.bzl, next tohash.dumbo/hash.fnv1a, as requested.What
mumbo::GetHash64(the default 64-bit hash) to Starlark: thekSecretbank, seed absorb, the<=16-byte small-key loader, the 16-byte MUM chain, the 8-lane 128-byte bulk tier, and the two-multiply finalizer — all as masked 64-bit arithmetic (Starlark has nowhile, so the loops are bounded ranges with the same break condition, matching the existing dumbo port).jumboand streaming stay C++-only.hash.mumbo's default seed is the library-widekDefaultSeed(5381) — distinct from dumbo (0) and fnv1a (the FNV offset basis). Documented in the README along with how to pass a seed (optional second arg)._FNS+ defaultalgos);hash_toolalready registeredmumbo. Update the Algorithm-overviewStarlarkcolumn.Verification
//mbo/hash:hash_bzl_vs_cpp_mumbo_testpasses: the Starlark output is byte-for-byte identical to thehash_toolC++ prime across lengths0..300(small<=16, medium17..127, and bulk>=128tiers, plus every tail size) and the extra strings. dumbo/fnv1a still pass.quality --checkgreen); the only overview-table change is mumbo'sStarlarkflag.Independent of #256 (touches
hash.bzl+ README, not the measurements package).