Skip to content

[codex] Fix retrieval semantics and prepared search caching#17

Draft
brodieacc wants to merge 1 commit into
masterfrom
codex/retrieval-semantics-fixes
Draft

[codex] Fix retrieval semantics and prepared search caching#17
brodieacc wants to merge 1 commit into
masterfrom
codex/retrieval-semantics-fixes

Conversation

@brodieacc
Copy link
Copy Markdown
Contributor

What changed

  • restore exact fast=True retrieval semantics across discrete, sparse, segmented, and matrix-style spaces
  • cache prepared search state for repeated ItemStore and AssocStore queries, with invalidation when the shared codebook changes
  • fix complex-space detection in AttentionResonatorCleanup
  • add regression coverage for score parity, top-k parity, and cache invalidation

Why

The previous fast retrieval path could return the wrong neighbors for several non-cosine models, and it rebuilt static search state on every query. This PR makes the fast path exact again and removes the repeated setup overhead without introducing any native code.

Validation

  • uv run --extra dev pytest tests/test_attention_resonator.py tests/test_decode_and_retrieval.py -q
  • uv run --extra dev pytest --no-cov
  • uv run --extra dev mypy holovec
  • uv run --extra dev ruff check holovec tests

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