fix: remove dead halftone code + fix docstrings + switch to from_hf()#87
Merged
Merged
Conversation
7 fixes from code review:
REMOVED (dead code producing wrong results if called):
1. HALFTONE_POS + HALFTONE_TO_BIN consts — only used by dead function
2. project_row_bf16_strided() — halftone version with interpolated odd bins.
Production uses project_1row_bf16_strided (all 17 real bins).
Same-ish name, wrong results = trap.
3. read_tensor_bf16_raw() — loads full tensor as Vec<u16>.
Replaced by inline chunked reads. OOM on 10.7 GB expert tensors.
4. test_halftone_positions_coverage — tested dead const
5. SCOUT_SHARD_SIZES — no longer needed (from_hf gets exact sizes)
FIXED:
6. project_tensor_bf16_simd docstring: "9 halftone bins" → "17 bins",
"9 zmm" → "17 zmm", "171 vaddpd" → "323 vaddpd"
7. test_strided_vs_full_agreement: compared dead project_row_bf16_strided
→ now compares project_1row_bf16_strided (production path)
FIXED (hardcoded URLs):
8. run_llama4_shard: hardcoded URL → HttpRangeReader::from_hf(repo, filename)
9. Maverick test: hardcoded URL → HttpRangeReader::from_hf(repo, filename)
Gets exact CDN URLs, exact sizes, benefits from re-resolve on token expiry.
OK (production path verified correct):
- project_8rows_bf16_simd: all 17 bins, SIMD gather, correct
- project_1row_bf16_strided: all 17 bins, scalar fallback, correct
- stream_index_gguf_bf16_with_header: chunked 128 MB, correct
20 tests pass, 8 ignored (network-dependent).
https://claude.ai/code/session_019RzHP8tpJu55ESTxhfUy1A
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.
Summary
Remove dead halftone code + fix docstrings + switch to
from_hf(). -121 lines.Removed (dead code producing wrong results if called)
HALFTONE_POS+HALFTONE_TO_BIN— dead constsproject_row_bf16_strided()— halftone (9/17 bins, interpolated odds). Trap: same-ish name as productionproject_1row_bf16_strided(all 17 bins).read_tensor_bf16_raw()— OOM on large tensors. Replaced by chunked reads.test_halftone_positions_coverage— tested dead constSCOUT_SHARD_SIZES— replaced byfrom_hf()exact sizesFixed
project_1row_bf16_stridedHttpRangeReader::from_hf(repo, filename)20 tests pass, 8 ignored (network).
https://claude.ai/code/session_019RzHP8tpJu55ESTxhfUy1A