Skip to content

Commit e5e2ad6

Browse files
committed
feat(perf): add cache prefetch auto-tuning to the reranker
1 parent 618574b commit e5e2ad6

7 files changed

Lines changed: 543 additions & 352 deletions

File tree

‎AGENTS.md‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,27 @@ cd python/
9292
uv run pytest
9393
```
9494

95+
96+
## Verification Workflow
97+
98+
The Python extension (`deglib_cpp`) compiles the header-only C++ library, so a single Python build both **catches C++ compile errors** and **exercises behavior** via `pytest`. Prefer it as the primary gate during iteration instead of running a separate C++ test build plus a Python build.
99+
100+
1. **Primary gate (one build):** rebuild the extension and run the Python tests.
101+
```bash
102+
cd python/
103+
uv pip install -e . --no-build-isolation
104+
uv run pytest
105+
```
106+
2. **If the Python build fails:** drop to a targeted C++ build for fast, incremental diagnosis of the affected header/template (recompiles only the changed TU, faster than the full monolithic binding TU):
107+
```bash
108+
cd cpp/
109+
cmake --build --preset windows-msvc-avx2-release --target <test_target>
110+
ctest --preset windows-msvc-avx2-release -R <regex> --output-on-failure
111+
```
112+
3. **C++ unit tests are not redundant:** they cover edge cases the Python suite does not (span/typed `rerank` overloads, null/throw paths, specific `QuantT` x `RefinerT` template combinations, prefetch `optimize()` tuning). Run the relevant C++ test targets before finalizing a change to the C++ library, and whenever a code path is not reachable from Python.
113+
114+
Note: the Python build recompiles the entire `deglib_cpp.cpp` translation unit (~2-3 min) on every header change, so it saves build *steps*, not necessarily wall-clock time versus an incremental C++ build.
115+
95116
### Code Formatting (C++ & Python)
96117

97118
```bash

0 commit comments

Comments
 (0)