fix: rewrite zeckbf17 — golden-step traversal, i16 base, L1 distance#21
Merged
AdaWorldAPI merged 1 commit intomainfrom Mar 21, 2026
Merged
fix: rewrite zeckbf17 — golden-step traversal, i16 base, L1 distance#21AdaWorldAPI merged 1 commit intomainfrom
AdaWorldAPI merged 1 commit intomainfrom
Conversation
Critical fixes from PR review:
1. MATH BUG: Fibonacci mod 17 visits only 13 of 17 residues (missing
{6,7,10,11}). Replaced with golden-ratio STEP (step=11, gcd(11,17)=1)
which visits ALL 17. The architectural reasoning (prime base, X-Trans
aperiodic sampling) was correct — only the traversal generator was wrong.
2. BF16 → i16: Base pattern now stores i16 fixed-point (×256) instead of
BF16. Same 34 bytes, 256× finer quantization. i16 captures sub-unit
averages that BF16's 7-bit mantissa destroys. Native SIMD width.
3. BF16 Hamming → L1: Distance metric now uses L1 (Manhattan) on i16 base
patterns, matching the production ZeckF64 pipeline (BitVec Hamming →
quantile → L1 on bytes). Added zeckf64_from_base() that produces a
full ZeckF64 u64 from two ZeckBF17 edges.
4. Removed unused deps: hound, half (code rolled its own BF16 which is
now replaced by i16 fixed-point).
5. Improved synthetic data: 70/30 signal/noise ratio with per-node
deterministic base patterns, better testing rank correlation.
643 lines (was 712). All BF16 helpers removed. Zero floating-point in
the distance path — pure integer L1.
AdaWorldAPI
pushed a commit
that referenced
this pull request
Apr 30, 2026
…ached_dtos + cohort_similarity_z SmbStack assembled facade closes the last review-open item from PR #21 (96fb069 + bb3df0b on smb-office-rs claude/review-csharp-rust-transcode-9ygcR). 27 smb-realtime tests pass, clippy clean. REQUEST: three upstream improvements to retire copy-pasted consumer caches in medcare-rs + smb-office-rs: 1. &'static Ontology factories (LazyLock-once, not allocate-per-call) 2. OntologyDto::cached_dtos -> CachedOntologyDtos { de, en } 3. lance_graph_contract::distance::cohort_similarity_z<F: Distance> Both consumers (medcare PR #73, smb PR #22) invented identical caches locally; promoting upstream eliminates the drift class.
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.
Critical fixes from PR review:
MATH BUG: Fibonacci mod 17 visits only 13 of 17 residues (missing
{6,7,10,11}). Replaced with golden-ratio STEP (step=11, gcd(11,17)=1)
which visits ALL 17. The architectural reasoning (prime base, X-Trans
aperiodic sampling) was correct — only the traversal generator was wrong.
BF16 → i16: Base pattern now stores i16 fixed-point (×256) instead of
BF16. Same 34 bytes, 256× finer quantization. i16 captures sub-unit
averages that BF16's 7-bit mantissa destroys. Native SIMD width.
BF16 Hamming → L1: Distance metric now uses L1 (Manhattan) on i16 base
patterns, matching the production ZeckF64 pipeline (BitVec Hamming →
quantile → L1 on bytes). Added zeckf64_from_base() that produces a
full ZeckF64 u64 from two ZeckBF17 edges.
Removed unused deps: hound, half (code rolled its own BF16 which is
now replaced by i16 fixed-point).
Improved synthetic data: 70/30 signal/noise ratio with per-node
deterministic base patterns, better testing rank correlation.
643 lines (was 712). All BF16 helpers removed. Zero floating-point in
the distance path — pure integer L1.