Skip to content

docs(openspec): plan #1928 Rank the embedding benchmark with numpy - #5140

Closed
devops-cli-service[bot] wants to merge 2 commits into
mainfrom
refactor/1928-rank-the-benchmark-with-numpy-and
Closed

devops-cli-service[bot] wants to merge 2 commits into
mainfrom
refactor/1928-rank-the-benchmark-with-numpy-and

Conversation

@devops-cli-service

Copy link
Copy Markdown
Contributor

Plans #1928

Replace the pairwise cosine loop of the embedding benchmark with one numpy matrix product over row-normalized vectors, and take recall at 1, 3 and 5, MRR and nDCG at 5 from pytrec_eval. Remove compute_ndcg_at_k and the C901 suppression. Declare numpy and pytrec-eval-terrier, and import both in the Service Image smoke test on linux/amd64. On the #481 fixture the ranking falls from 57 seconds to under one second; corpus embedding still dominates a full run.

Change: openspec/changes/1928-rank-the-benchmark-with-numpy-and/

@devops-cli-service devops-cli-service Bot added type/docs Type docs: a change to the documents scope/openspec OpenSpec changes, specs and their checks labels Nov 12, 2026
@devops-cli-service
devops-cli-service Bot force-pushed the refactor/1928-rank-the-benchmark-with-numpy-and branch from c7e671d to 8a680ff Compare November 12, 2026 16:47
@devops-cli-service
devops-cli-service Bot force-pushed the refactor/1928-rank-the-benchmark-with-numpy-and branch from 8a680ff to 014de80 Compare November 12, 2026 16:52
@dan-petty

Copy link
Copy Markdown
Owner

Closed with no merge: the typing decision of the plan breaks a quality ceiling.

Task 1.2 adds a second [[tool.mypy.overrides]] entry (module pytrec_eval.*) to pyproject.toml. The ceiling is 1 (tests/invariants/test_architectural_invariants.py:143). CI fails only test_suppressions_stay_under_their_ceilings with "[[tool.mypy.overrides]]: 2 > ceiling 1 in [pyproject.toml]" (job 131340584400, Tests & Coverage shard 3 of 4; job 131342060289, Service Image Tests shard 3 of 6). All other checks pass. A higher ceiling lowers a quality threshold, and only the owner can allow that.

The fix is a stub, not an override. Add typings/pytrec_eval.pyi, as typings/jq.pyi does for jq (pyproject.toml sets mypy_path = "typings"). Name the stub in group 1, and add no [[tool.mypy.overrides]] entry. Also add the requirement "Dependencies declared" of the issue to the spec delta: declare numpy and pytrec-eval-terrier in pyproject.toml and resolve both in uv.lock.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/openspec OpenSpec changes, specs and their checks type/docs Type docs: a change to the documents

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant