Cover the branches the machine decided - #80
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Utilstakes the architecture string,OpenBlastakes the four platformpredicates, both delegated to from the existing no-argument methods.
ProcessorTopologyreads a folder held in a field rather than a constant.OpenBlasreads the thread count through a hook, as it already writes it.Remaining: 115 reachable branches, and 48 in
CudaMatrixDotProductScorerthatneed a GPU.