1013 B
1013 B
2026-02-27 Session Notes
Predictor Bug Fix: Reject Mismatched candidate_features
Nicholai implemented a fix to eliminate silent data corruption in packages/predictor/src/main.rs (line 79). The code previously silently replaced mismatched candidate_features vectors with all-zero values when their length didn't match candidate_ids. This masked upstream bugs and degraded ranking quality without signaling the problem.
The fix changed the logic to:
- If
candidate_featuresis empty → zero-fill (correct, feature not provided) - If length matches
candidate_ids→ use as-is (correct, provided correctly) - If provided but length mismatches → return explicit error (fixed from silent zero-fill)
This brings consistency with how candidate_embeddings and candidate_texts already handle the same scenario (returning explicit length-mismatch errors). The change was applied via Edit tool and preserves the empty-features fallback behavior while fixing the dangerous silent-corruption case.