Skip to content

0.2.15 - #35

Merged
AnOversizedMooseWithSocks merged 44 commits into
mainfrom
0.2.11
Aug 17, 2026
Merged

0.2.15#35
AnOversizedMooseWithSocks merged 44 commits into
mainfrom
0.2.11

Conversation

@AnOversizedMooseWithSocks

Copy link
Copy Markdown
Owner

No description provided.

…PIPELINE_MAP, FACULTY_MAP, DOC_MAP) [skip ci]
…PIPELINE_MAP, FACULTY_MAP, DOC_MAP) [skip ci]
…x N)

The term-major postings loop probed every (term, doc) pair whether or not
the term occurs in the doc. On real prose vocab grows with N, so the build
was effectively superlinear in corpus size: at BEIR NQ scale (2,681,468
docs, vocab 821,276 under this file's own tokenize) that is 2.2e12 probes
and the build does not complete. The doc-major reorder -- one pass over
each doc's term counts, appending to per-term lists -- is O(total tokens)
and finished NQ in 309.8 s including tokenization.

The postings are identical by construction: same idf, same per-(term, doc)
weight expression with the same operands (same IEEE bits), same ascending
doc order per term. tests/test_bm25_docmajor_build.py rebuilds the postings
with the original term-major loop verbatim and asserts np.array_equal on
every term's index and weight arrays, plus scores() == _scores_reference().
The existing _selftest's bit-identity assertion passes unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…eak-free input cannot lose facts

chunk_text's docstring names the failure mode it exists to avoid -- a fact
split across two chunks is retrievable from neither -- but the fallback for
one oversized paragraph was plain p[:max_chars] windows: fixed and
non-overlapping. Input with no blank lines at all (a pasted log, a minified
file, a NIAH haystack) is ONE runaway paragraph, so the whole document took
that path, and any fact straddling a max_chars boundary survived in no
chunk. Measured (600-char chunks, 86 needle offsets, production harness):
blob input lost 8/86 offsets (9%); the same prose with paragraph breaks
lost 0/86.

Fix: the degenerate path now strides max_chars - overlap (overlap clamped
to max_chars // 2 so the stride stays positive), which makes any fact
shorter than overlap unloseable. The paragraph path is byte-identical to
before; overlap=0 restores the old windows exactly.

tests/test_knowledgestore_chunk_overlap.py sweeps a needle across 86
offsets in the same text presented as blob and as paragraphs, asserts zero
losses on both arms, pins the paragraph path's independence from overlap,
and keeps the old failure reproducible at overlap=0 so the sweep can never
go soft.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…PIPELINE_MAP, FACULTY_MAP, DOC_MAP) [skip ci]
…08-14

Two measured fixes (O(tokens) BM25 build, chunk_text overlap) + bench-campaign findings
…PIPELINE_MAP, FACULTY_MAP, DOC_MAP) [skip ci]
…PIPELINE_MAP, FACULTY_MAP, DOC_MAP) [skip ci]
…PIPELINE_MAP, FACULTY_MAP, DOC_MAP) [skip ci]
…PIPELINE_MAP, FACULTY_MAP, DOC_MAP) [skip ci]
…PIPELINE_MAP, FACULTY_MAP, DOC_MAP) [skip ci]
…PIPELINE_MAP, FACULTY_MAP, DOC_MAP) [skip ci]
…PIPELINE_MAP, FACULTY_MAP, DOC_MAP) [skip ci]
@AnOversizedMooseWithSocks
AnOversizedMooseWithSocks merged commit 4c835fc into main Aug 17, 2026
8 checks passed
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.

4 participants