feat(shader-driver): migrate FingerprintColumns.cycle to Vsa16kF32 carrier (PR B)#256
Conversation
…rrier - Change FingerprintColumns.cycle from Box<[u64]> (Binary16K, 256 words/row) to Box<[f32]> (Vsa16kF32, 16_384 floats/row = 64 KB per row) - Add FLOATS_PER_VSA = 16_384 constant alongside WORDS_PER_FP/WIDTH_BITS - Add set_cycle(&[f32]) for direct f32 writes - Add set_cycle_from_bits(&[u64; 256]) adapter using binary16k_to_vsa16k_bipolar - cycle_row() now returns &[f32]; write_cycle_fingerprint() API unchanged - byte_footprint() updated: 3 u64 planes + 1 f32 plane = 71_774 bytes/row - Update all bindspace tests; add set_cycle_direct_f32 test - Update end_to_end.rs to check bipolar round-trip instead of raw u64 equality - Board hygiene: note cycle migration in LATEST_STATE.md https://claude.ai/code/session_01SbYsmmbPf9YQuYbHZN52Zh
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 72663523b3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let vsa = binary16k_to_vsa16k_bipolar(bits); | ||
| self.cycle[row * FLOATS_PER_VSA..(row + 1) * FLOATS_PER_VSA] | ||
| .copy_from_slice(&*vsa); |
There was a problem hiding this comment.
Avoid per-row heap allocation in cycle projection
set_cycle_from_bits currently calls binary16k_to_vsa16k_bipolar(bits), which allocates a new 16,384-f32 Box and then immediately copies it into the preallocated row buffer. Because write_cycle_fingerprint routes every persisted cycle through this path, this introduces allocator churn and an extra 64 KB copy per row in a hot path, which can materially degrade throughput/latency under sustained dispatch workloads.
Useful? React with 👍 / 👎.
Confirmed LF-21/22/90 are not in my queue (no conflict). Answered: - Settings governance is branch-only, not merged to main yet - Vsa16kF32 carrier landed (PR #256); role catalogue still 10K-dim; VSA_DIMS resize needed; proposed split: SMB plans band layout, lance-graph session does the infrastructure - LF-3 UNKNOWN-3/UNKNOWN-4 remain parked (need user direction) - Next on-deck if session continues: TD-INT-5, TD-INT-8 https://claude.ai/code/session_01SbYsmmbPf9YQuYbHZN52Zh
Summary
FingerprintColumns.cyclefromBox<[u64]>(Binary16K, 256 × u64 per row) toBox<[f32]>(Vsa16kF32 carrier, 16,384 × f32 per row = 64 KB).CrystalFingerprint::Vsa16kF32variant + 6 algebra primitives (vsa16k_zero,binary16k_to_vsa16k_bipolar,vsa16k_to_binary16k_threshold,vsa16k_bind,vsa16k_bundle,vsa16k_cosine).write_cycle_fingerprint()still takes&[u64; 256]; the bipolar projection happens internally viabinary16k_to_vsa16k_bipolar. Downstream readers get&[f32]for direct VSA algebra.What changed
crates/cognitive-shader-driver/src/bindspace.rscycle: Box<[u64]>→Box<[f32]>; newFLOATS_PER_VSA = 16_384const;set_cycle(&[f32]),set_cycle_from_bits(&[u64; 256]),cycle_row() -> &[f32];byte_footprint()now 71,774 for 1 rowcrates/cognitive-shader-driver/tests/end_to_end.rsvsa16k_to_binary16k_threshold.claude/board/LATEST_STATE.mdWhy
Expansion-list item #1: the
Vsa16kF32carrier type exists (PR #253), but the BindSpace column it was designed for still used Binary16K. This PR closes that gap —FingerprintColumns.cyclenow carries the 64 KB f32 carrier, enabling future operations (MarkovBundler, Trajectory, vsa_permute) to do VSA algebra directly on the cycle column instead of converting at every call site.Test plan
cargo test -p cognitive-shader-driver --lib— 40 pass, 0 failcargo test -p lance-graph-contract --lib— no regressionsbyte_footprint()for 1 row = 71,774 bytes (3 × 256 × u64 + 16,384 × f32 + qualia + meta + edge + temporal + expert)https://claude.ai/code/session_01SbYsmmbPf9YQuYbHZN52Zh
Generated by Claude Code