Repository navigation
Conversation
Use three rounds of [random sign flip, fast Walsh-Hadamard transform per power-of-two block, random permutation] instead of the dense random orthogonal matrix. The block is the largest power of two dividing the dimension, capped at 1024; dimensions whose block would be under 64 keep the dense rotation, generated from the same RNG stream as before. * Add TurboQuantRotation, which owns either the dense matrix or the signs and permutations, generated portably from the existing seed with 64-bit arithmetic only. The transform is a plain scalar loop. * The fitted state schema number is now the rotation kind: schema 1 (dense) is byte-for-byte the previous format; schema 2 stores the actual signs and permutations. Loading validates everything before replacing state. * Size the components memory estimate for the rotation actually allocated. * Add tests for the block rule, an independent reference, norm and inner product preservation, orthonormality, seed determinism, encode/query consistency, save/load round trips, legacy dense loads and corrupt input. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dor-forer
force-pushed
the
codex/tq23-rabitq-draft
branch
from
November 15, 2026 12:57
204ac18 to
bc5ed80
Compare
dor-forer
force-pushed
the
dor-forer-tq-hadamard-rotation
branch
from
November 15, 2026 12:58
75b4a38 to
04a42eb
Compare
This was referenced Nov 15, 2026
Collaborator
Author
|
Moved to RediSearch/RediSearch#12353, since VecSim now lives in RediSearch under |
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.
Describe the changes in the pull request
Stacked on #1108. This replaces the dense random rotation in TQ2/TQ3 with a block Hadamard rotation. Each of three rounds applies a random sign flip, then a fast Walsh-Hadamard transform (FWHT) on each power-of-two block, then a random permutation.
mt19937_64output and 64-bit arithmetic.Benchmark: dense is #1108 at
bc5ed800and block Hadamard is this PR at04a42eb8, with the same benchmark source for both.Tests
test_hnsw_turboquantpasses 29/29 on dorer-intel and dorer-arm-big in Release, and on dorer-arm-big in Debug.Open items
Which issues this PR fixes
Main objects this PR modified
src/VecSim/quantization/turboquant_rotation.h(new),turboquant.handturboquant_components.h(memory estimate).tests/unit/test_hnsw_turboquant.cpp.Mark if applicable
Serialization: the TQ fitted-state schema number is now the rotation kind.
🤖 Generated with Claude Code