Skip to content

Commit baeb7d4

Browse files
matte1782claude
andcommitted
fix(w47): R3 hostile review minors — file size, gitignore glob, dead branch
- m1: Fix stale 147,456,000 → 153,600,000 in WEEKLY_TASK_PLAN.md - m2: Expand gitignore to `tests/data/embeddings_*.bin` (covers fallback model) - m3: Remove dead if/else branch in generate_embeddings.py save_embeddings() R3 hostile review: GO (0C/0M/4m, all addressed) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 28e7796 commit baeb7d4

3 files changed

Lines changed: 4 additions & 6 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,5 @@ CLAUDE.md
7373

7474
# Playwright MCP test screenshots
7575
.playwright-mcp/
76-
tests/data/embeddings_768d_50k.bin
76+
# Large embedding binaries (generated by tests/data/generate_embeddings.py)
77+
tests/data/embeddings_*.bin

docs/planning/weeks/week_47/WEEKLY_TASK_PLAN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Track D (Recall — Days 4-5):
105105
| ID | Task | Owner | Est. Hours | Verification | Acceptance Criteria |
106106
|:---|:-----|:------|:-----------|:-------------|:--------------------|
107107
| W47.0a | Push 6 pending commits to origin/main | PLANNER | 0.25h | Git | `git push` succeeds; `git log --oneline origin/main..HEAD` returns empty |
108-
| W47.1a | Generate real embedding dataset with Python/sentence-transformers | BENCHMARK_SCIENTIST | 2h | File + Verify | `tests/data/embeddings_768d_50k.bin` exists; contains 50,000 vectors x 768 dims x f32 = 147,456,000 bytes; model: `all-mpnet-base-v2`; corpus: first 50K sentences from MTEB STS benchmark or English Wikipedia (fallback: any English text corpus with 50K+ sentences); includes `tests/data/generate_embeddings.py` script for reproducibility. **Verification:** `python -c "import numpy as np; d=np.fromfile('tests/data/embeddings_768d_50k.bin', dtype='float32').reshape(-1, 768); assert d.shape == (50000, 768); assert np.all(np.isfinite(d))"` passes. File added to `.gitignore` (too large for git); script is committed instead |
108+
| W47.1a | Generate real embedding dataset with Python/sentence-transformers | BENCHMARK_SCIENTIST | 2h | File + Verify | `tests/data/embeddings_768d_50k.bin` exists; contains 50,000 vectors x 768 dims x f32 = 153,600,000 bytes; model: `all-mpnet-base-v2`; corpus: first 50K sentences from MTEB STS benchmark or English Wikipedia (fallback: any English text corpus with 50K+ sentences); includes `tests/data/generate_embeddings.py` script for reproducibility. **Verification:** `python -c "import numpy as np; d=np.fromfile('tests/data/embeddings_768d_50k.bin', dtype='float32').reshape(-1, 768); assert d.shape == (50000, 768); assert np.all(np.isfinite(d))"` passes. File added to `.gitignore` (too large for git); script is committed instead |
109109
| W47.1b | Implement PQ WASM exports in `src/wasm/mod.rs` | WASM_SPECIALIST | 4h | Compile + Unit | Three `#[wasm_bindgen]` functions added: (1) `train_pq(data: &[f32], dims: u32, m: u32, ksub: u32, max_iters: u32) -> Result<JsValue, JsValue>` returning opaque codebook handle, (2) `encode_pq(codebook_handle: &JsValue, vector: &[f32]) -> Result<Uint8Array, JsValue>` returning M-byte PQ code, (3) `pq_search(codebook_handle: &JsValue, codes: &[u8], num_codes: u32, query: &[f32], k: u32) -> Result<JsValue, JsValue>` returning top-k results. Follow existing handle pattern from `EdgeVecIndex`. `cargo check --target wasm32-unknown-unknown` succeeds |
110110
| W47.1c | Add PQ WASM integration tests | TEST_ENGINEER | 1.5h | Unit + WASM | Two test levels: (1) **Native-side tests** (`cargo test`): at least 3 tests verifying the WASM wrapper logic calls through to PQ correctly — `test_wasm_pq_train_returns_handle`, `test_wasm_pq_encode_returns_codes`, `test_wasm_pq_search_returns_results`. (2) **WASM-side smoke test** (`wasm-pack test --node` or via Playwright on Day 2): verify `train_pq()` callable from JS and returns non-null. Native tests pass with `cargo test`; WASM smoke test deferred to W47.2c Playwright verification |
111111
| W47.1d | Regression: `cargo test --lib` + `cargo clippy -- -D warnings` + `cargo check --target wasm32-unknown-unknown` | TEST_ENGINEER | 0.5h | Full suite | 1013+ lib tests pass, 0 clippy warnings, WASM build succeeds |

tests/data/generate_embeddings.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,7 @@ def verify_embeddings(embeddings: np.ndarray, expected_dim: int) -> bool:
175175

176176
def save_embeddings(embeddings: np.ndarray, dim: int) -> Path:
177177
"""Save embeddings as raw f32 binary file."""
178-
if dim == EXPECTED_DIM:
179-
filename = f"embeddings_{dim}d_50k.bin"
180-
else:
181-
filename = f"embeddings_{dim}d_50k.bin"
178+
filename = f"embeddings_{dim}d_50k.bin"
182179

183180
output_path = OUTPUT_DIR / filename
184181
embeddings.tofile(str(output_path))

0 commit comments

Comments
 (0)