Re-Hash Operation Mechanisms
- Re-hash operations are incremental update mechanisms that adjust hash-derived state to maintain invariants like uniformity, monotonicity, and collision resistance.
- They include methods from consistent key reassignment and homomorphic digest updates to vector-based techniques for efficient insertions, deletions, and state maintenance.
- Implementations span CPU-based O(1) amortized rehashing, deferred concurrent bucket reassignments, and GPU-accelerated resizing, optimizing performance under dynamic workloads.
A re-hash operation denotes a family of update procedures that modify a hash-derived state after a change in input data, bucket count, or table capacity. In the cited literature, the term covers several technically distinct mechanisms: consistent reassignment of keys when the number of buckets changes; homomorphic digest updates under document amendment or row replacement; deferred movement of entries during concurrent table growth; and incremental split-or-merge procedures during GPU resizing (Ertl, 2024, Shpilrain, 18 Feb 2025, Das, 1 Jul 2025, Malakhov, 2015, Polak et al., 16 Oct 2025). The common objective is to avoid a full recomputation while preserving the invariants required by the underlying scheme, such as uniformity and monotonicity, homomorphic correctness, collision resistance, or lock-free progress.
1. Definitions and invariants
In distributed key assignment, the relevant object is a consistent hash function mapping a key to one of buckets. Two properties characterize the desired behavior: Uniformity, given by for all , and Monotonicity (minimal disruption), given by the rule that if , then (Ertl, 2024). These properties formalize balanced placement together with minimal remapping when capacity increases.
In incremental cryptographic hashing, the invariant is homomorphic compatibility with concatenation or dataset deltas. For Cayley hashing, the defining relation is
which permits direct update of an existing digest after appending a block (Shpilrain, 18 Feb 2025). In HexaMorphHash, the invariant is linearity in : the digest is a modular vector sum over encoded rows, so insertion, deletion, and replacement are realized by coordinate-wise addition and subtraction (Das, 1 Jul 2025).
In extensible hash tables, the invariant is structural correctness during resizing without a global pause. Anton Malakhov’s per-bucket concurrent rehashing algorithm separates resizing and rehashing so that they neither invalidate existing buckets nor block any concurrent operations; Hive adopts an analogous avoidance of global rehash on GPUs through incremental linear hashing in 0-bucket batches (Malakhov, 2015, Polak et al., 16 Oct 2025). This suggests that “re-hash operation” is context-dependent: in some settings it is a digest update, in others a controlled relocation of entries, and in others a reassignment function that minimizes disruption.
2. Consistent reassignment under changing bucket counts
The simplest bucket-selection rule is
1
which is uniform when 2 is a high-quality 64-bit hash, but unstable under re-sharding. When 3, the assignment becomes 4, which, for large 5, differs from 6 with probability 7; in practice, nearly all keys “jump,” causing massive data-movement storms, including cache-miss spikes and network bursts (Ertl, 2024). Modulo hashing is therefore uniform but not monotonic.
"JumpBackHash: Say Goodbye to the Modulo Operation to Distribute Keys Uniformly to Buckets" introduces an 8-expected-time consistent hash using only integer arithmetic and a single PRNG (Ertl, 2024). Its construction is based on “active indices,” defined as bucket indices that currently hold the minimum random number seen so far. Rather than scanning all possible indices, the method generates only the needed active indices in descending order from an upper power-of-two bound 9 and stops as soon as one falls below 0. The algorithm consumes two initial 32-bit random values, forms a mask from 1, explores flagged intervals, and refines candidates within 2 via geometric sampling. All operations—bit shifts, masks, and modulo 3—are integer.
The method’s stability guarantee is explicit: when 4, the only keys that change bucket are those whose new active index is the newly added bucket 5, so any given key has 6, which is optimal by the “balanced mapping” lower bound (Ertl, 2024). The time analysis yields
7
where 8 is the number of PRG calls and 9. By contrast, JumpConsistentHash takes on average 0 random draws and thus 1 time, while rendezvous hashing is monotonic but costs 2 bucket evaluations per key. On Xeon Platinum with splitmix64 PRG and Java 21, benchmarks for 3 up to 4 report 5–6 ns/op for JumpBackHash, 7–8 ns/op for JumpConsistentHash, 9 ns/op for modulo, and 0 ns/op for naive rendezvous (Ertl, 2024).
3. Homomorphic re-hash in Cayley hash functions
Cayley hash functions encode a bit string as a product of generators in a semigroup or group. The surveyed construction takes
1
for a large prime 2, and chooses
3
with 4; the paper singles out 5 as a good compromise between efficiency and girth (Shpilrain, 18 Feb 2025). The bit 6 is associated with 7, the bit 8 with 9, and for 0,
1
If the ambient structure is a group, one may set 2 for the empty string.
The re-hash operation is a direct consequence of the homomorphic property
3
If a document 4 has already been hashed to 5 and a new block 6 is appended or used to amend it, one computes 7 and updates by
8
If one chooses a right-to-left convention instead, the update becomes 9; the choice of left- or right-multiplication is explicitly described as a matter of convention (Shpilrain, 18 Feb 2025).
The security constraints are expressed through girth and joint spectral radius. Collision resistance up to length 0 is equivalent to the absence of a nontrivial relation of length 1 among 2 in 3. In Cayley-graph language, the girth of the directed Cayley graph of 4 with generators 5 must exceed the maximum message-block length intended without re-randomization (Shpilrain, 18 Feb 2025). If 6 lift to a free semigroup in 7 and have joint spectral radius 8, then
9
For 0, 1, and with a 256-bit prime 2 the text states that the girth is pushed to 3 bits or more, making short collisions infeasible. Performance is characterized by one 4-matrix multiply in 5 per bit; this is heavier than a single bitwise XOR but perfectly parallelizable, and incremental update for 6 costs only 7 multiplies plus one final multiply by the old hash 8 (Shpilrain, 18 Feb 2025).
4. HexaMorphHash and signed vector re-hash
HexaMorphHash places the re-hash operation in the additive group 9, with
0
and models the underlying cryptographic hash as an extendable-output function
1
whose output is parsed into 2 limbs of 3 bits (Das, 1 Jul 2025). The induced map
4
defines the digest of an ordered database 5 by
6
where 7. The digest is then signed as 8.
The re-hash operation is an additive delta update. For replacement of row 9’s old value 0 with new value 1,
2
and the updated digest is
3
For pure insertion of a new element 4 at fresh index 5,
6
For pure deletion,
7
After the update, the distributor re-signs and the subscriber applies the same vector additions or subtractions locally, followed by one signature verification (Das, 1 Jul 2025).
Collision resistance is reduced to the Short Integer Solutions problem. If two distinct datasets 8 satisfy 9, then
00
Stacking the public vectors 01 into a matrix 02, the task becomes finding a short nonzero integer vector 03 with 04, which is exactly SIS (Das, 1 Jul 2025). For parameters 05, the text states that SIS is conjectured infeasible even for quantum adversaries. The implementation discussion gives 06 work per update for the two vector hashes and coordinate-wise additions or subtractions, one ECDSA sign at approximately 07 ms, one signature verify at approximately 08 ms, and a fixed digest of 09 bits 10 KB. On a 11 GHz Haswell, the reported measurements are approximately 12 ms for publish and approximately 13 ms to apply 14 updates and one signature verify; a single distributor is said to handle tens of thousands of updates per second (Das, 1 Jul 2025).
5. Deferred and concurrent rehashing in extensible hash tables
Anton Malakhov’s per-bucket concurrent rehashing algorithm addresses a different form of re-hash operation: redistribution of entries during table growth without a global stop-the-world pass (Malakhov, 2015). The table consists of an array of buckets of current capacity 15. To grow from 16 to 17 buckets, the algorithm allocates 18 new empty buckets alongside the existing ones; the new buckets are marked “new (un-rehashed),” and the table logically has capacity 19, but no global rehash step is performed.
The old-to-new bucket correspondence is one-to-one. If 20 is the index of an old bucket, then its corresponding new bucket index 21 satisfies
22
With a power-of-two capacity 23, bucket indices are computed by masks: 24
25
The parent of a bucket after expansion is obtained by clearing the most significant 1-bit, equivalently
26
for the power-of-two case (Malakhov, 2015).
Rehashing is on-demand. An operation first reads the global mask 27, computes 28, acquires bucket 29’s lock, and, if bucket 30 is still marked NEW, invokes RehashBucket(i). Under the lock on bucket 31, the algorithm locks the parent bucket, scans its entries, recomputes the new mask destination 32, moves the entries for which 33, and then marks bucket 34 as REHASHED (Malakhov, 2015). A lookup that fails must detect whether a concurrent resize could have moved the key out of bucket 35; this is handled by re-reading the mask and evaluating candidate child buckets, restarting only if a race is detected. The design uses bucket-level synchronization only, allows a race condition between lookup and moving operations in different threads, and resolves it by detection and restart rather than explicit synchronization across the table.
The complexity discussion states average-case 36 lookup, insert, and delete, with 37, worst-case 38 under pathological collisions, and amortized 39 extra cost per insert because each key is moved at most once per doubling (Malakhov, 2015). Memory overhead is 40 buckets at peak, one extra bit or flag per bucket, and optionally a segment table of size 41. Micro-benchmarks on a 24-core Xeon X7460 compare the method with tbb::concurrent_hash_map and tbb::concurrent_unordered_map: the per-bucket rehashing implementation matches or exceeds the split-ordered list across all reported insertion rates, scales nearly linearly to approximately 42 threads, and produces only negligible restart counts—tens of restarts over millions of operations (Malakhov, 2015).
6. Warp-cooperative GPU resizing
Hive hash table transfers the re-hash problem to the GPU and frames it as warp-parallel dynamic resizing without global rehashing (Polak et al., 16 Oct 2025). The load factor is defined as
43
with fixed bucket size 44 slots by default. Expansion is triggered when 45, contraction when 46, and resizing proceeds in increments of 47 buckets per epoch (Polak et al., 16 Oct 2025).
The indexing scheme is classical linear hashing. The table maintains a round mask
48
and a split pointer 49. During expansion, 50 new buckets are allocated and, for each 51,
52
The next mask is
53
so the new address is
54
equivalently determined by testing the extra high bit against 55 (Polak et al., 16 Oct 2025). Contraction reverses the procedure with
56
Each warp handles one bucket pair 57. It loads all 58 entries coalescently, computes a warp-wide move mask using 59, compacts movers by prefix-popcount rank, writes moved entries into the destination bucket, clears source slots, and updates bucket-local freeMask words through atomic operations (Polak et al., 16 Oct 2025). Per split or merge the work is 60, and with 61 constant, a batch of 62 buckets costs 63 time. Doubling from 64 to 65 buckets requires 66 batches, hence overall 67 work and amortized 68 rehash cost per insertion. The design explicitly avoids a single, table-wide rehash loop, global locks, and host-device synchronization.
The GPU-centric optimization strategy is hardware-aware: buckets are aligned so that 69 lanes reading 70-bit packed key-value words generate at most two 71-byte L1/L2 cache-line fetches; updates and removals are single CAS operations on 72-bit words; freeMask is a 73-bit word per bucket; and warp-synchronous “claim” and “match” protocols reduce contention to one atomic per warp (Polak et al., 16 Oct 2025). Experimental evaluation on an NVIDIA RTX 4090 reports sustained load factors up to 74, 75–76 higher throughput than Slab-Hash, DyCuckoo, and WarpCore under mixed insert-delete-lookup workloads, 77 billion updates/s, and nearly 78 billion lookups/s on balanced workload (Polak et al., 16 Oct 2025).
7. Comparative interpretation and common misconceptions
A common misconception is that re-hash necessarily means rescanning all existing data. The cited constructions provide several counterexamples: a consistent reassignment function can limit remapping to a 79 fraction of keys when a bucket is added; a Cayley hash can update by group multiplication 80; HexaMorphHash can update by vector addition 81; a concurrent table can defer movement to the first operation that touches a NEW bucket; and a GPU table can split or merge only 82 buckets in one epoch (Ertl, 2024, Shpilrain, 18 Feb 2025, Das, 1 Jul 2025, Malakhov, 2015, Polak et al., 16 Oct 2025).
A second misconception is that avoiding full rehash removes hard correctness constraints. In fact, each scheme replaces full recomputation with a different invariant. In JumpBackHash the invariant is uniformity plus monotonicity; in Cayley hashing it is the concatenation homomorphism and a girth bound large enough to preclude short relations; in HexaMorphHash it is linearity in 83 together with a reduction from collisions to SIS; in Malakhov’s algorithm it is bucket-local synchronization plus race detection and restart; and in Hive it is linear-hashing correctness under warp-synchronous movement and atomic freeMask maintenance (Ertl, 2024, Shpilrain, 18 Feb 2025, Das, 1 Jul 2025, Malakhov, 2015, Polak et al., 16 Oct 2025).
A plausible implication is that “re-hash operation” should be interpreted operationally rather than syntactically. The operation is not defined by repeating a hash computation from scratch; it is defined by the admissible state transition after a change. In cryptographic settings that transition is algebraic and must preserve collision, preimage, or second-preimage resistance. In data-structure settings it is structural and must preserve load balance, lookup correctness, or concurrency properties. The literature therefore treats re-hash not as a singular algorithmic primitive, but as a design pattern for incremental state maintenance under change.