Skip to content

Tests: keep the RAG query-packing test on vec0 while the in-memory cache builds in the background - #16013

Merged
danielhanchen merged 1 commit into
mainfrom
tests-rag-dense-pack-without-vec-cache
Oct 29, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
tests-rag-dense-pack-without-vec-cache

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

studio/backend/tests/test_rag_store.py::test_dense_packs_float32_rows_without_struct_and_the_query_once (from #15859) fails now and then since #15961, on PRs that do not touch RAG (seen on the (Python 3.13, g-r) shard for #15900):

tests/test_rag_store.py:619: in test_dense_packs_float32_rows_without_struct_and_the_query_once
    assert ranked == as_list and ranked[0][1] > 0.99
E   At index 4 diff: ('d1:2', 0.7071067988872528) != ('d1:2', 0.7071067690849304)

The test runs search_dense twice (numpy query, then the same query as a list) and expects identical results. Since #15961 the first search finds no in-memory matrix for the scope and queues a build on the rag-vec-cache background thread. If that build lands before the second search, the second answer comes from the numpy matrix instead of vec0, and the two backends' cosine scores differ in the last few ulps. Reproduced on main by pausing 1 s between the two calls: it fails every time. What the test is about (the query is packed once, numpy and list inputs answer alike) does not depend on the cache.

What changed

The test sets RAG_VEC_CACHE=0 through monkeypatch, so both searches go through vec0 regardless of timing.

Verification

  • Main with a 1 s pause between the two searches: fails with the diff above. Same pause with this change: passes.
  • tests/test_rag_store.py and tests/test_rag_vec_cache.py: 45 passed.
  • With _search_dense packing the query per scope instead of once, the test fails with assert 4 == 1, so the guard it was written for still bites.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-29T17:22:21.735090Z e5e196e Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: e5e196e379

ℹ️ 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".

@danielhanchen
danielhanchen merged commit 86be805 into main Oct 29, 2026
0 of 38 checks passed
@danielhanchen
danielhanchen deleted the tests-rag-dense-pack-without-vec-cache branch October 29, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant