Papers
Topics
Authors
Recent
Search
2000 character limit reached

Re-Hash Operation Mechanisms

Updated 6 July 2026
  • 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 CH(k,N)CH(k,N) mapping a key kk to one of NN buckets. Two properties characterize the desired behavior: Uniformity, given by Pr[CH(k,N)=b]=1/N\Pr[CH(k,N)=b]=1/N for all b{0N1}b\in\{0\ldots N-1\}, and Monotonicity (minimal disruption), given by the rule that if CH(k,N)CH(k,N+1)CH(k,N)\neq CH(k,N+1), then CH(k,N+1)=NCH(k,N+1)=N (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

X,Y{0,1}:H(X  Y)=H(X)H(Y),\forall\,X,Y\in\{0,1\}^*:\quad H(X\|\;Y)=H(X)\cdot H(Y),

which permits direct update of an existing digest after appending a block PP (Shpilrain, 18 Feb 2025). In HexaMorphHash, the invariant is linearity in Zqn\mathbb Z_q^n: 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 kk0-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

kk1

which is uniform when kk2 is a high-quality 64-bit hash, but unstable under re-sharding. When kk3, the assignment becomes kk4, which, for large kk5, differs from kk6 with probability kk7; 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 kk8-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 kk9 and stops as soon as one falls below NN0. The algorithm consumes two initial 32-bit random values, forms a mask from NN1, explores flagged intervals, and refines candidates within NN2 via geometric sampling. All operations—bit shifts, masks, and modulo NN3—are integer.

The method’s stability guarantee is explicit: when NN4, the only keys that change bucket are those whose new active index is the newly added bucket NN5, so any given key has NN6, which is optimal by the “balanced mapping” lower bound (Ertl, 2024). The time analysis yields

NN7

where NN8 is the number of PRG calls and NN9. By contrast, JumpConsistentHash takes on average Pr[CH(k,N)=b]=1/N\Pr[CH(k,N)=b]=1/N0 random draws and thus Pr[CH(k,N)=b]=1/N\Pr[CH(k,N)=b]=1/N1 time, while rendezvous hashing is monotonic but costs Pr[CH(k,N)=b]=1/N\Pr[CH(k,N)=b]=1/N2 bucket evaluations per key. On Xeon Platinum with splitmix64 PRG and Java 21, benchmarks for Pr[CH(k,N)=b]=1/N\Pr[CH(k,N)=b]=1/N3 up to Pr[CH(k,N)=b]=1/N\Pr[CH(k,N)=b]=1/N4 report Pr[CH(k,N)=b]=1/N\Pr[CH(k,N)=b]=1/N5–Pr[CH(k,N)=b]=1/N\Pr[CH(k,N)=b]=1/N6 ns/op for JumpBackHash, Pr[CH(k,N)=b]=1/N\Pr[CH(k,N)=b]=1/N7–Pr[CH(k,N)=b]=1/N\Pr[CH(k,N)=b]=1/N8 ns/op for JumpConsistentHash, Pr[CH(k,N)=b]=1/N\Pr[CH(k,N)=b]=1/N9 ns/op for modulo, and b{0N1}b\in\{0\ldots N-1\}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

b{0N1}b\in\{0\ldots N-1\}1

for a large prime b{0N1}b\in\{0\ldots N-1\}2, and chooses

b{0N1}b\in\{0\ldots N-1\}3

with b{0N1}b\in\{0\ldots N-1\}4; the paper singles out b{0N1}b\in\{0\ldots N-1\}5 as a good compromise between efficiency and girth (Shpilrain, 18 Feb 2025). The bit b{0N1}b\in\{0\ldots N-1\}6 is associated with b{0N1}b\in\{0\ldots N-1\}7, the bit b{0N1}b\in\{0\ldots N-1\}8 with b{0N1}b\in\{0\ldots N-1\}9, and for CH(k,N)CH(k,N+1)CH(k,N)\neq CH(k,N+1)0,

CH(k,N)CH(k,N+1)CH(k,N)\neq CH(k,N+1)1

If the ambient structure is a group, one may set CH(k,N)CH(k,N+1)CH(k,N)\neq CH(k,N+1)2 for the empty string.

The re-hash operation is a direct consequence of the homomorphic property

CH(k,N)CH(k,N+1)CH(k,N)\neq CH(k,N+1)3

If a document CH(k,N)CH(k,N+1)CH(k,N)\neq CH(k,N+1)4 has already been hashed to CH(k,N)CH(k,N+1)CH(k,N)\neq CH(k,N+1)5 and a new block CH(k,N)CH(k,N+1)CH(k,N)\neq CH(k,N+1)6 is appended or used to amend it, one computes CH(k,N)CH(k,N+1)CH(k,N)\neq CH(k,N+1)7 and updates by

CH(k,N)CH(k,N+1)CH(k,N)\neq CH(k,N+1)8

If one chooses a right-to-left convention instead, the update becomes CH(k,N)CH(k,N+1)CH(k,N)\neq CH(k,N+1)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 CH(k,N+1)=NCH(k,N+1)=N0 is equivalent to the absence of a nontrivial relation of length CH(k,N+1)=NCH(k,N+1)=N1 among CH(k,N+1)=NCH(k,N+1)=N2 in CH(k,N+1)=NCH(k,N+1)=N3. In Cayley-graph language, the girth of the directed Cayley graph of CH(k,N+1)=NCH(k,N+1)=N4 with generators CH(k,N+1)=NCH(k,N+1)=N5 must exceed the maximum message-block length intended without re-randomization (Shpilrain, 18 Feb 2025). If CH(k,N+1)=NCH(k,N+1)=N6 lift to a free semigroup in CH(k,N+1)=NCH(k,N+1)=N7 and have joint spectral radius CH(k,N+1)=NCH(k,N+1)=N8, then

CH(k,N+1)=NCH(k,N+1)=N9

For X,Y{0,1}:H(X  Y)=H(X)H(Y),\forall\,X,Y\in\{0,1\}^*:\quad H(X\|\;Y)=H(X)\cdot H(Y),0, X,Y{0,1}:H(X  Y)=H(X)H(Y),\forall\,X,Y\in\{0,1\}^*:\quad H(X\|\;Y)=H(X)\cdot H(Y),1, and with a 256-bit prime X,Y{0,1}:H(X  Y)=H(X)H(Y),\forall\,X,Y\in\{0,1\}^*:\quad H(X\|\;Y)=H(X)\cdot H(Y),2 the text states that the girth is pushed to X,Y{0,1}:H(X  Y)=H(X)H(Y),\forall\,X,Y\in\{0,1\}^*:\quad H(X\|\;Y)=H(X)\cdot H(Y),3 bits or more, making short collisions infeasible. Performance is characterized by one X,Y{0,1}:H(X  Y)=H(X)H(Y),\forall\,X,Y\in\{0,1\}^*:\quad H(X\|\;Y)=H(X)\cdot H(Y),4-matrix multiply in X,Y{0,1}:H(X  Y)=H(X)H(Y),\forall\,X,Y\in\{0,1\}^*:\quad H(X\|\;Y)=H(X)\cdot H(Y),5 per bit; this is heavier than a single bitwise XOR but perfectly parallelizable, and incremental update for X,Y{0,1}:H(X  Y)=H(X)H(Y),\forall\,X,Y\in\{0,1\}^*:\quad H(X\|\;Y)=H(X)\cdot H(Y),6 costs only X,Y{0,1}:H(X  Y)=H(X)H(Y),\forall\,X,Y\in\{0,1\}^*:\quad H(X\|\;Y)=H(X)\cdot H(Y),7 multiplies plus one final multiply by the old hash X,Y{0,1}:H(X  Y)=H(X)H(Y),\forall\,X,Y\in\{0,1\}^*:\quad H(X\|\;Y)=H(X)\cdot H(Y),8 (Shpilrain, 18 Feb 2025).

4. HexaMorphHash and signed vector re-hash

HexaMorphHash places the re-hash operation in the additive group X,Y{0,1}:H(X  Y)=H(X)H(Y),\forall\,X,Y\in\{0,1\}^*:\quad H(X\|\;Y)=H(X)\cdot H(Y),9, with

PP0

and models the underlying cryptographic hash as an extendable-output function

PP1

whose output is parsed into PP2 limbs of PP3 bits (Das, 1 Jul 2025). The induced map

PP4

defines the digest of an ordered database PP5 by

PP6

where PP7. The digest is then signed as PP8.

The re-hash operation is an additive delta update. For replacement of row PP9’s old value Zqn\mathbb Z_q^n0 with new value Zqn\mathbb Z_q^n1,

Zqn\mathbb Z_q^n2

and the updated digest is

Zqn\mathbb Z_q^n3

For pure insertion of a new element Zqn\mathbb Z_q^n4 at fresh index Zqn\mathbb Z_q^n5,

Zqn\mathbb Z_q^n6

For pure deletion,

Zqn\mathbb Z_q^n7

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 Zqn\mathbb Z_q^n8 satisfy Zqn\mathbb Z_q^n9, then

kk00

Stacking the public vectors kk01 into a matrix kk02, the task becomes finding a short nonzero integer vector kk03 with kk04, which is exactly SIS (Das, 1 Jul 2025). For parameters kk05, the text states that SIS is conjectured infeasible even for quantum adversaries. The implementation discussion gives kk06 work per update for the two vector hashes and coordinate-wise additions or subtractions, one ECDSA sign at approximately kk07 ms, one signature verify at approximately kk08 ms, and a fixed digest of kk09 bits kk10 KB. On a kk11 GHz Haswell, the reported measurements are approximately kk12 ms for publish and approximately kk13 ms to apply kk14 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 kk15. To grow from kk16 to kk17 buckets, the algorithm allocates kk18 new empty buckets alongside the existing ones; the new buckets are marked “new (un-rehashed),” and the table logically has capacity kk19, but no global rehash step is performed.

The old-to-new bucket correspondence is one-to-one. If kk20 is the index of an old bucket, then its corresponding new bucket index kk21 satisfies

kk22

With a power-of-two capacity kk23, bucket indices are computed by masks: kk24

kk25

The parent of a bucket after expansion is obtained by clearing the most significant 1-bit, equivalently

kk26

for the power-of-two case (Malakhov, 2015).

Rehashing is on-demand. An operation first reads the global mask kk27, computes kk28, acquires bucket kk29’s lock, and, if bucket kk30 is still marked NEW, invokes RehashBucket(i). Under the lock on bucket kk31, the algorithm locks the parent bucket, scans its entries, recomputes the new mask destination kk32, moves the entries for which kk33, and then marks bucket kk34 as REHASHED (Malakhov, 2015). A lookup that fails must detect whether a concurrent resize could have moved the key out of bucket kk35; 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 kk36 lookup, insert, and delete, with kk37, worst-case kk38 under pathological collisions, and amortized kk39 extra cost per insert because each key is moved at most once per doubling (Malakhov, 2015). Memory overhead is kk40 buckets at peak, one extra bit or flag per bucket, and optionally a segment table of size kk41. 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 kk42 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

kk43

with fixed bucket size kk44 slots by default. Expansion is triggered when kk45, contraction when kk46, and resizing proceeds in increments of kk47 buckets per epoch (Polak et al., 16 Oct 2025).

The indexing scheme is classical linear hashing. The table maintains a round mask

kk48

and a split pointer kk49. During expansion, kk50 new buckets are allocated and, for each kk51,

kk52

The next mask is

kk53

so the new address is

kk54

equivalently determined by testing the extra high bit against kk55 (Polak et al., 16 Oct 2025). Contraction reverses the procedure with

kk56

Each warp handles one bucket pair kk57. It loads all kk58 entries coalescently, computes a warp-wide move mask using kk59, 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 kk60, and with kk61 constant, a batch of kk62 buckets costs kk63 time. Doubling from kk64 to kk65 buckets requires kk66 batches, hence overall kk67 work and amortized kk68 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 kk69 lanes reading kk70-bit packed key-value words generate at most two kk71-byte L1/L2 cache-line fetches; updates and removals are single CAS operations on kk72-bit words; freeMask is a kk73-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 kk74, kk75–kk76 higher throughput than Slab-Hash, DyCuckoo, and WarpCore under mixed insert-delete-lookup workloads, kk77 billion updates/s, and nearly kk78 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 kk79 fraction of keys when a bucket is added; a Cayley hash can update by group multiplication kk80; HexaMorphHash can update by vector addition kk81; a concurrent table can defer movement to the first operation that touches a NEW bucket; and a GPU table can split or merge only kk82 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 kk83 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.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Re-Hash Operation.