Skip to content

Cover the branches the machine decided - #80

Merged
drametwally merged 8 commits into
mainfrom
test-coverage
Sep 22, 2026
Merged

drametwally merged 8 commits into
mainfrom
test-coverage

Conversation

@drametwally

Copy link
Copy Markdown
Collaborator

Raises branch coverage from 88.5% to 92.1%, leaving 163 uncovered of 2055.

Most of what this covers was unreachable rather than untested. The architecture
predicates, the processor topology, the platform a native binary is carried for,
and the thread count a loaded BLAS binary retains are all read from the machine
the tests run on, so one branch of each was dead wherever they ran. Each now has
a seam: a function of what it derives from, a folder a test may point at a tree
it wrote, or the hook the rest of the class already used.

The rest are contracts nothing exercised: equality between configurations, the
three record types and which arrays tell them apart, the bound a partially
scanned Ruzicka pair can still reach and every argument it refuses, the search
thread paths taken without a ticket and while cancelled, and the bounds
admission refuses.

Adds MemoryFootprintTest, BaseRuzickaComparatorTest, and 39 tests.

Three production seams, no behaviour change:

  • Utils takes the architecture string, OpenBlas takes the four platform
    predicates, both delegated to from the existing no-argument methods.
  • ProcessorTopology reads a folder held in a field rather than a constant.
  • OpenBlas reads the thread count through a hook, as it already writes it.

Remaining: 115 reachable branches, and 48 in CudaMatrixDotProductScorer that
need a GPU.

The architecture predicates and the processor topology read the machine they
run on, so one branch of each was unreachable wherever the tests ran. Both now
have a seam: the predicates take the architecture string, and the topology reads
a folder a test may point at a tree it wrote.

Adds the rejection cases for the bound a partially scanned Ruzicka pair can
still reach, one per argument it refuses.
…tracts

Equality decides whether a namespace may be reused, and a record's type decides
which comparators can read it, so each field and each array they are told apart
by now has a case.

Adds the search thread paths a search reaches without taking a ticket of its
own, with no work to divide, and while cancelled, and the bounds admission
refuses.
…dget

The platform a native binary is carried for and the thread count the loaded
binary retains are both read from the machine, so one entry of each table was
unreachable wherever the tests ran. The platform table is now a function of the
four it is derived from, and the thread count is read through the hook the rest
of this class already uses.

Adds the budget paths where the allowance has not moved and where nothing is
attached to suspend.
An interrupted wait abandoned the work unit it was waiting on and moved to the
next, so a search cancelled while its work units were outstanding could return
while one of them still read a structure the read lock its caller held is no
longer protecting. That is the invariant waiting for every work unit exists to
hold.

The cancellation is recorded and the wait resumed, so every work unit is
finished before the caller returns.
The scorer that reads the matrix rather than copying it never runs where a
native library loads, so the paths that score from the chunks it kept were
unreachable. Making the native probe fail reaches them.

Adds the metadata filtering strategy a blank parameter leaves and a name no
strategy has, the filters an index treats as none, the minimum similarity a
dense index refuses, and the candidate a matrix does not hold.
Resizing reaches a pool that exists, and a test that shut one down in teardown
had none, so the pool was created at the allowance instead and a test needing
two threads could deadlock where the allowance was one.
Position filtering prunes from a partial scan and length filtering prunes on a
record's unilateral value, so each rejects arguments that do not describe one.
Adds a case per rejected argument, and the searches an inverted index answers
with nothing.
Nothing reached the process-wide structures with a live search against them: a
search cancelled partway, the allowance lowered while searches run, the search
pool shut down under load, or a second namespace built in the same process.

Searches run against a scan index, which divides its rows into work units and
dispatches them, since a dense matrix reaches a native library that batches
instead and submits no work unit for a shutdown to reach.
@drametwally
drametwally merged commit 8fb7c97 into main Sep 22, 2026
3 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.

1 participant