add native cosine fallback#826
Conversation
rwmjhb
left a comment
There was a problem hiding this comment.
PR #826 Review: add native cosine fallback
Verdict: REQUEST-CHANGES | 7 rounds completed | Value: 74% | Size: MEDIUM | Author: TurboTheTurtle
Value Assessment
Problem: AVX-only Linux x64 users can hit SIGILL crashes when LanceDB executes native cosine vector search, making the plugin unstable on CPUs that otherwise meet the documented AVX requirement. The PR adds an opt-in escape hatch to avoid LanceDB native cosine and rerank candidates with JavaScript cosine similarity.
| Dimension | Assessment |
|---|---|
| Value Score | 74% |
| Value Verdict | priority-review |
| Issue Linked | true |
| Project Aligned | true |
| Duplicate | false |
| AI Slop Score | 0/6 |
| User Impact | high |
| Urgency | urgent |
Open Questions:
- Because the base is marked stale, confirm the issue has not already been fixed or superseded on current main.
- Validate on an actual AVX-only Linux x64 host that vectorSearch without distanceType("cosine") does not still enter the SIGILL path.
- Confirm recall and ranking quality are acceptable when fallback candidate fetch uses LanceDB's default distance before JS cosine reranking.
Summary
AVX-only Linux x64 users can hit SIGILL crashes when LanceDB executes native cosine vector search, making the plugin unstable on CPUs that otherwise meet the documented AVX requirement. The PR adds an opt-in escape hatch to avoid LanceDB native cosine and rerank candidates with JavaScript cosine similarity.
Evaluation Signals
| Signal | Value |
|---|---|
| Blockers | 0 |
| Warnings | 0 |
| PR Size | MEDIUM |
| Verdict Floor | approve |
| Risk Level | high |
| Value Model | codex |
| Primary Model | codex |
| Adversarial Model | claude |
Must Fix
- F1: JS cosine fallback rejects LanceDB vectors
- MR1: Disabling only distanceType("cosine") may not actually avoid the SIGILL crash the PR targets
Nice to Have
- F2: Fallback can miss cosine-nearest rows before reranking
- MR2: Regression test is structurally incapable of catching the real bug, making the PASS signal misleading
Recommended Action
Good direction — problem is worth solving. Author should address must-fix findings, then this is ready to merge.
Reviewed at 2026-05-26T05:22:03Z | 7 rounds | Value: codex | Primary: codex | Adversarial: claude
0238ab7 to
85e2b94
Compare
|
Thanks for the review. I pushed
Fresh validation on the current head: |
rwmjhb
left a comment
There was a problem hiding this comment.
PR #826 Review: add native cosine fallback
Verdict: APPROVE | 6 rounds completed | Value: 77% | Size: MEDIUM | Author: TurboTheTurtle
Value Assessment
Problem: AVX-only Linux x64 users can hit SIGILL crashes when LanceDB native vector search executes cosine search, causing OpenClaw to repeatedly crash despite the documented AVX requirement. The PR adds an opt-in path to avoid native cosine and rank scoped rows in JavaScript.
| Dimension | Assessment |
|---|---|
| Value Score | 77% |
| Value Verdict | priority-review |
| Issue Linked | true |
| Project Aligned | true |
| Duplicate | false |
| AI Slop Score | 0/6 |
| User Impact | high |
| Urgency | urgent |
Open Questions:
- The PR context marks the base as stale; confirm current main has not already fixed or superseded #644.
- Validate on an actual AVX-only Linux x64 host that the query().select() scan path does not still enter a LanceDB native code path that can SIGILL.
- Confirm the full scoped scan performance is acceptable for large stores when the fallback is enabled.
Summary
AVX-only Linux x64 users can hit SIGILL crashes when LanceDB native vector search executes cosine search, causing OpenClaw to repeatedly crash despite the documented AVX requirement. The PR adds an opt-in path to avoid native cosine and rank scoped rows in JavaScript.
Evaluation Signals
| Signal | Value |
|---|---|
| Blockers | 0 |
| Warnings | 0 |
| PR Size | MEDIUM |
| Verdict Floor | approve |
| Risk Level | high |
| Value Model | codex |
| Primary Model | codex |
| Adversarial Model | claude |
Nice to Have
- F1: Fallback materializes every scoped vector at once
- MR1: New vector-length guard silently drops rows on the DEFAULT native path, not just the fallback
- MR2: Returned entry.vector for the native path changed from raw LanceDB value to an Array.from copy
- MR3: Fallback warning uses raw console.warn instead of the plugin's logger/callback pattern
Recommended Action
Ready to merge.
Reviewed at 2026-05-26T06:35:02Z | 6 rounds | Value: codex | Primary: codex | Adversarial: claude
Summary
Closes #644.
Validation