diff --git a/.gitignore b/.gitignore index c1a169c2..1ee1c50e 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,11 @@ build/ # `make tsan` builds here so that build/ -- which the gate reads -- is # never clobbered. It is scratch, exactly as build/ is. build-tsan/ +# Any other BUILD= the Makefile is handed, which is how a sanitiser or a +# bisecting build is kept out of build/. build-asan/ arrived this way and was +# untracked but NOT ignored, which is one `git add -A` away from committing a +# few hundred object files. +build-*/ dist/ *.o *.d diff --git a/Makefile b/Makefile index f377b07c..df9bb789 100644 --- a/Makefile +++ b/Makefile @@ -172,16 +172,43 @@ selftest: $(BUILD)/tests/harness/selftest_outcomes # accesses, which survive -O2, and an instrumented build that tests different # code from the one that ships answers a question nobody asked. # -# Two suites are excluded, and must stay excluded: test_model and -# test_expected_counts_accounting link with -Wl,--wrap=malloc, while TSan -# replaces the allocator itself, so the wrapper and the sanitiser contend for -# one symbol. Both test allocation failure rather than parallelism, so nothing -# about threads is lost with them out. -LLVM_VER ?= 19 +# FOUR suites are excluded, and must stay excluded. All four are about the +# allocator, which is the one thing TSan replaces wholesale: +# +# test_model and test_expected_counts_accounting link with +# -Wl,--wrap=malloc, so the wrapper and the sanitiser contend for one +# symbol. Both test allocation failure rather than parallelism. +# +# test_allocator_linkage and test_allocator_policy assert on glibc's mmap +# threshold and on resident memory. TSan does not honour mallopt and maps +# shadow memory several times the heap, so under instrumentation they +# measure the sanitiser: run anyway, they failed at "the allocator policy +# did not reach this binary" and "resident memory is many times the model's +# own size". A suite that cannot pass instrumented has to be excluded +# rather than left to fail, or the run grows two failures everyone learns +# to scroll past. verification/tests/test_tsan.py derives this set from the +# sources, so a new suite of either kind is caught rather than assumed. +# +# -mavx IS NOT AN OPTIMISATION. src/native/math/vtrig.c passes a 32-byte +# vector by value to a static helper, which clang reports as changing the ABI +# when AVX is off. With target_clones in play that was a hard ERROR -- the +# default clone cannot satisfy it, and __attribute__((always_inline)) does not +# help because the check is in the frontend, before inlining -- and it was the +# reason this flag went in. BEAM_TSAN now turns the clones off, which demotes +# it to a -Wpsabi warning, so the flag is no longer what makes the build +# compile. It stays for two smaller reasons: it keeps that call's vector ABI +# the same as the shipping build's, and it keeps two warnings per build out of +# a log where a new warning should stand out. AVX, not AVX2: the minimum the +# ABI asks for, and on every x86-64 part since 2011. +# +# The version defaults to the one verified here. Archer ships in libomp-19-dev +# as well; `make tsan LLVM_VER=19` uses it. +LLVM_VER ?= 21 LLVM_DIR ?= /usr/lib/llvm-$(LLVM_VER) TSAN_CC ?= $(LLVM_DIR)/bin/clang TSAN_ARCHER ?= $(LLVM_DIR)/lib/libarcher.so -TSAN_EXCLUDE := test_model test_expected_counts_accounting +TSAN_EXCLUDE := test_model test_expected_counts_accounting \ + test_allocator_linkage test_allocator_policy TSAN_SUITES ?= $(filter-out $(TSAN_EXCLUDE),\ $(patsubst tests/native/%.c,%,$(TEST_SRCS))) @@ -197,7 +224,7 @@ tsan: @test -x "$(TSAN_CC)" || { \ echo "make tsan: no clang at $(TSAN_CC)."; \ echo " Install it: sudo apt install clang-$(LLVM_VER) libomp-$(LLVM_VER)-dev"; \ - echo " Or point at another one: make tsan LLVM_VER=21"; \ + echo " Or point at another one: make tsan LLVM_VER=19"; \ echo " GCC is NOT a fallback -- see the comment above this target."; \ exit 1; } @test -f "$(TSAN_ARCHER)" || { \ @@ -206,9 +233,15 @@ tsan: echo " Without Archer every barrier reads as a race."; \ exit 1; } @$(MAKE) --no-print-directory BUILD=build-tsan CC="$(TSAN_CC)" \ - SANFLAGS="-fsanitize=thread -g -fno-omit-frame-pointer" \ + SANFLAGS="-fsanitize=thread -g -fno-omit-frame-pointer -mavx" \ OMPFLAG=-fopenmp=libomp \ $(addprefix build-tsan/tests/native/,$(TSAN_SUITES)) + @echo + @echo "Built $(words $(TSAN_SUITES)) instrumented suite(s) in build-tsan/." + @echo "Run them: tools/qa/run c --tsan" + @echo " (which loads Archer and sets the TSAN_OPTIONS the run needs;" + @echo " running the binaries bare reports hundreds of races that are" + @echo " not there -- see verification/tests/test_tsan.py)" clean: rm -rf $(BUILD) diff --git a/src/native/core/threads.c b/src/native/core/threads.c index a0866d1f..928040c5 100644 --- a/src/native/core/threads.c +++ b/src/native/core/threads.c @@ -109,6 +109,39 @@ int beam_plan_enter_default(void) { int beam_threads(void) { #ifdef _OPENMP + /* + * Already inside an active team: whatever region this thread opens next + * is a NESTED one, and one thread is the only answer that cannot + * multiply. It comes first because the alternative is not that the plan + * gets multiplied -- it is that the plan is not consulted at all. The + * inner pragmas are encountered by the outer team's workers, and a worker + * holds no plan (it is thread-local, deliberately: see + * beam_plan_enter's neighbours and test_a_plan_does_not_reach_another_thread), + * so it fell through to threads_cap() -- omp_get_max_threads() with no + * configured cap. An 8-thread plan opened eight teams of sixteen. + * Measured on one entropy() call with the plan pinned at 8: 117 threads + * against 9 with nesting off. + * + * Nesting is off by default, so this changes nothing until a caller sets + * OMP_MAX_ACTIVE_LEVELS, which nothing here can prevent: pinning it would + * mean omp_set_max_active_levels, process-global state that two BEAM calls + * on two Python threads would fight over. The thread's own level is the + * one thing that is always true locally. + * + * ACTIVE level, not level. A team of one is an inactive region; it + * multiplies nothing, and treating it as nested would throw away the + * parallelism inside a single-length sweep for no gain. + * test_an_inactive_region_does_not_lose_the_plan pins that. + * + * Safe for the scratch sizing too, and in the direction that matters. + * A resolved count both sizes buffers and sets num_threads, so the + * dangerous disagreement is a buffer smaller than its team. This can only + * shrink the answer as the nesting deepens, and a region entered at this + * level or deeper is sized by a read at this level or deeper, never by a + * shallower one. math/spectrum.c's per-thread scratch, allocated inside a + * nested call, was being sized for omp_get_max_threads() and used by one. + */ + if (omp_get_active_level() > 0) return 1; if (tl_plan > 0) return tl_plan; return threads_cap(); #else diff --git a/src/native/dp/jet.c b/src/native/dp/jet.c index 656cb85e..12e63fab 100644 --- a/src/native/dp/jet.c +++ b/src/native/dp/jet.c @@ -1042,7 +1042,7 @@ static inline void line_store_body(uint32_t T, const double *restrict are, * agree to the bit. On AVX2 without AVX-512 the tile runs line_edge_body4, * the same arithmetic per lane with fewer lanes in flight * (`line_narrow_pick`). */ -#if defined(__x86_64__) && defined(__ELF__) && defined(__GNUC__) +#if defined(__x86_64__) && defined(__ELF__) && defined(__GNUC__) && !BEAM_TSAN #define BEAM_EDGE_CLONES __attribute__((target_clones("avx512f", "avx2", "default"))) #else #define BEAM_EDGE_CLONES diff --git a/src/native/internal/beam/internal.h b/src/native/internal/beam/internal.h index 4c90ab8d..f498a960 100644 --- a/src/native/internal/beam/internal.h +++ b/src/native/internal/beam/internal.h @@ -60,6 +60,40 @@ #include #endif +/* + * BEAM_TSAN -- 1 when this translation unit is being compiled with + * ThreadSanitizer instrumentation, 0 otherwise. Zero in every shipped build, + * so nothing downstream of it changes a byte of what users get; `make tsan` + * is the only consumer. + * + * It exists because function multiversioning and TSan cannot coexist. + * `__attribute__((target_clones(...)))` makes the compiler emit an IFUNC + * resolver, and the dynamic loader calls that resolver during startup + * relocation -- before the sanitiser runtime has initialised. Clang + * instruments the resolver like any other function, so `__tsan_func_entry` + * runs against uninitialised state and the process dies inside ld.so, before + * main, having printed nothing. Nine of the 35 instrumented suites died that + * way: exit 139, empty log, no message to search for. + * + * So the three multiversioned functions compile single-versioned under + * instrumentation. The cost is that the instrumented build runs the baseline + * copy rather than the one the CPU would have picked, which is the right + * trade for a race detector: it changes how fast the arithmetic runs, not + * which threads touch which bytes. The copies are bit-identical by + * construction anyway -- each lane is its own sum with no fused + * multiply-add -- so nothing about a result depends on which one ran. + */ +#if defined(__SANITIZE_THREAD__) +#define BEAM_TSAN 1 +#elif defined(__has_feature) +#if __has_feature(thread_sanitizer) +#define BEAM_TSAN 1 +#endif +#endif +#ifndef BEAM_TSAN +#define BEAM_TSAN 0 +#endif + /* * The former contents of this header, split by responsibility. They are * included here in their original order so that every translation unit still diff --git a/src/native/internal/beam/plan.h b/src/native/internal/beam/plan.h index 54792439..4fb28730 100644 --- a/src/native/internal/beam/plan.h +++ b/src/native/internal/beam/plan.h @@ -166,9 +166,15 @@ int beam_plan_enter_default(void); void beam_plan_leave(int token); /** - * Threads the next parallel region should use: the plan in force on this - * thread if there is one, otherwise the cap from `beam_model_set_threads`, - * otherwise the OpenMP runtime's own maximum. Always 1 without OpenMP. + * Threads the next parallel region should use: ONE if this thread is already + * inside an active team, since the region it opens next is a nested one and + * any other answer multiplies; otherwise the plan in force on this thread if + * there is one; otherwise the cap from `beam_model_set_threads`; otherwise the + * OpenMP runtime's own maximum. Always 1 without OpenMP. + * + * The nested case is first, and `threads.c` records what it is holding back: + * a worker holds no plan, so before this it fell through to the cap, and an + * 8-thread plan opened eight teams of sixteen under OMP_MAX_ACTIVE_LEVELS=2. * * Every `omp parallel` in the implementation carries `num_threads(...)`, * naming either this directly (64 regions) or a count already resolved from diff --git a/src/native/math/spectrum.c b/src/native/math/spectrum.c index 228149fb..ffe5f374 100644 --- a/src/native/math/spectrum.c +++ b/src/native/math/spectrum.c @@ -200,7 +200,7 @@ static inline void spec_move(double *dst, const double *src, int64_t k, /* The CPU picks, at load time, a copy compiled for AVX-512, for AVX2 or for * the baseline; each lane is its own sum, with no fused multiply-add * (contraction is off under -std=c11), so the copies agree to the bit. */ -#if defined(__x86_64__) && defined(__ELF__) && defined(__GNUC__) +#if defined(__x86_64__) && defined(__ELF__) && defined(__GNUC__) && !BEAM_TSAN #define SPEC_CLONES __attribute__((target_clones("avx512f", "avx2", "default"))) #else #define SPEC_CLONES diff --git a/src/native/math/vtrig.c b/src/native/math/vtrig.c index d0d9c08d..34b817c5 100644 --- a/src/native/math/vtrig.c +++ b/src/native/math/vtrig.c @@ -87,7 +87,7 @@ static inline void vt_sincos4(vt_v4d x, vt_v4d *s_out, vt_v4d *c_out) { *c_out = (vt_v4d)(ci ^ (cneg & sign)); } -#if defined(__x86_64__) && defined(__ELF__) && defined(__GNUC__) +#if defined(__x86_64__) && defined(__ELF__) && defined(__GNUC__) && !BEAM_TSAN #define VT_CLONES __attribute__((target_clones("avx2", "default"))) #else #define VT_CLONES diff --git a/tests/native/test_plan.c b/tests/native/test_plan.c index 6f27df2b..3a137701 100644 --- a/tests/native/test_plan.c +++ b/tests/native/test_plan.c @@ -630,8 +630,116 @@ static void test_a_plan_does_not_reach_another_thread(void) { ASSERT_MSG(want != 7, "the plan must differ from the cap for this to test"); ASSERT_MSG(master_saw == want, "the thread that entered the scope must see the plan"); - ASSERT_MSG(worker_saw == 7, - "a worker must fall back to the cap, 7, not inherit the plan"); + /* + * This asserted `worker_saw == 7` -- the cap -- until the nesting hazard + * below was measured. The property being pinned is unchanged and is in + * the name: the plan does not reach another thread, so 4 must not appear + * here. What changed is the fallback. A worker is by definition inside an + * active team, so the region it would open next is a nested one, and + * beam_threads() now answers 1 rather than the cap. The cap was how an + * 8-thread plan opened eight teams of sixteen. + * + * The cap of 7 is still set above, and still has to differ from the plan, + * because this test would otherwise pass on a day when they coincided. + */ + ASSERT_MSG(worker_saw != want, + "a worker must not inherit the plan"); + ASSERT_MSG(worker_saw == 1, + "a worker is inside an active team, so its next region would " + "be nested: it must ask for one thread, not the cap"); + PASS(); +#else + BEAM_SKIP("no OpenMP in this build"); +#endif +} + +/* ── Nested regions ──────────────────────────────────────────── */ + +/* + * The hazard these two pin, measured before they were written. + * + * BEAM enters nested regions at depth 2 -- `entropy` is one, math/diversity.c + * line 306 parallel-for into expected_raw, which has regions of its own at + * :207 and :232. Nesting is off by default, so an inner region's request is + * ignored and its team is 1, and none of this shows. Nothing in the library + * pins that default: no omp_set_max_active_levels, no omp_set_nested, because + * both are process-global state and two BEAM calls on two Python threads + * would fight over them. So OMP_MAX_ACTIVE_LEVELS=2 in the caller's + * environment turns nesting on. + * + * What happened then was not that the plan multiplied. It was ignored. The + * inner pragma is encountered by the OUTER TEAM'S WORKERS, and + * test_a_plan_does_not_reach_another_thread above pins that a worker has no + * plan -- it fell back to the cap, which with no configured cap is + * omp_get_max_threads(), 16 on the box this was measured on. So an 8-thread + * plan opened eight teams of sixteen. Measured on one entropy() call with the + * plan pinned at 8: 117 threads in the process against 9 with nesting off, + * and the call went from under a millisecond to 240 ms. Phase 0 measured that + * class of oversubscription at 301x to 2275x worse than serial on a loaded + * cluster node. + * + * Hence: inside an ACTIVE region, the next region this thread opens is a + * nested one, and one thread is the only answer that cannot multiply. The + * check is on the active level and not the level, which the second test + * pins: a team of one is an inactive region, it multiplies nothing, and + * serialising the work inside it would cost parallelism for no gain. + */ + +static void test_a_nested_region_is_planned_at_one_thread(void) { +#ifdef _OPENMP + if (omp_get_max_threads() < 2) BEAM_SKIP("needs at least two OpenMP threads"); + BeamPlanIn in = base(); + in.available = 16; + const int token = beam_plan_enter(&in); + const int outside = beam_threads(); + int master_inside = -1, worker_inside = -1, team = -1; + #pragma omp parallel num_threads(2) + { + if (omp_get_thread_num() == 0) { + team = omp_get_num_threads(); + master_inside = beam_threads(); + } else { + worker_inside = beam_threads(); + } + } + beam_plan_leave(token); + ASSERT_MSG(outside > 1, + "the fixture must plan more than one thread, or this test " + "cannot tell the plan from the nested answer"); + ASSERT_MSG(team == 2, + "the runtime gave no team of two, so nothing was nested"); + ASSERT_MSG(master_inside == 1, + "the thread holding the plan must still ask for one thread " + "inside an active region: its next region would be nested"); + ASSERT_MSG(worker_inside == 1, + "a worker must ask for one thread, not the cap -- the cap is " + "how an 8-thread plan opened eight teams of sixteen"); + PASS(); +#else + BEAM_SKIP("no OpenMP in this build"); +#endif +} + +static void test_an_inactive_region_does_not_lose_the_plan(void) { +#ifdef _OPENMP + BeamPlanIn in = base(); + in.available = 16; + const int want = beam_plan_threads(&in); + const int token = beam_plan_enter(&in); + int inside = -1, team = -1; + #pragma omp parallel num_threads(1) + { + team = omp_get_num_threads(); + inside = beam_threads(); + } + beam_plan_leave(token); + ASSERT_MSG(want > 1, "the fixture must plan more than one thread"); + ASSERT_MSG(team == 1, "num_threads(1) must give a team of one"); + ASSERT_MSG(inside == want, + "a team of one is an INACTIVE region: it multiplies nothing, " + "so the plan still applies. Testing omp_get_level() here " + "instead of omp_get_active_level() would read 1 and throw " + "away the parallelism inside a single-length sweep"); PASS(); #else BEAM_SKIP("no OpenMP in this build"); @@ -857,6 +965,8 @@ int main(int argc, char **argv) { RUN_TEST(test_effective_threads_reports_the_cap_not_the_plan); RUN_TEST(test_budget_concurrency_follows_the_active_plan); RUN_TEST(test_a_plan_does_not_reach_another_thread); + RUN_TEST(test_a_nested_region_is_planned_at_one_thread); + RUN_TEST(test_an_inactive_region_does_not_lose_the_plan); RUN_TEST(test_the_default_scope_plans_from_the_pinned_availability); RUN_TEST(test_the_default_scope_stops_at_the_ceiling); diff --git a/tests/suites/model/test_runtime.py b/tests/suites/model/test_runtime.py index d0c8762a..8da43d8d 100644 --- a/tests/suites/model/test_runtime.py +++ b/tests/suites/model/test_runtime.py @@ -347,3 +347,88 @@ def test_the_fork_warning_survives_warnings_as_errors(capfd): err = capfd.readouterr().err assert "fork" in err assert "spawn" in err + + +# Nesting +# +# BEAM enters nested parallel regions at depth 2 and pins nothing about +# nesting, because the only way to pin it is omp_set_max_active_levels, which +# is process-global state two calls on two Python threads would fight over. +# So the caller's environment decides, and this is what keeps that decision +# from costing the plan. +# ════════════════════════════════════════════════════════════════════════ + +_NESTING_CHILD = """ +import json, random, sys, threading, time +import BEAM +from BEAM import BeamModel + +def watch(stop, out): + hi = 0 + while not stop.is_set(): + try: + with open("/proc/self/status", encoding="utf-8") as f: + for line in f: + if line.startswith("Threads:"): + hi = max(hi, int(line.split()[1])) + break + except OSError: + pass + time.sleep(0.001) + out.append(hi) + +rng = random.Random(7) +seqs = ["TG" + "".join(rng.choice("ACGT") for _ in range(rng.randint(2, 20))) + + "C" for _ in range(800)] +m = BeamModel(seqs, abundances=[rng.randint(1, 40) for _ in seqs], + alphabet="nt", order=3, max_length=24) +plan = BEAM.parallel_plan()["plan"] + +stop, out = threading.Event(), [] +t = threading.Thread(target=watch, args=(stop, out), daemon=True) +t.start() +time.sleep(0.05) +with open("/proc/self/status", encoding="utf-8") as f: + before = next(int(l.split()[1]) for l in f if l.startswith("Threads:")) +h = m.entropy() +stop.set() +t.join(timeout=5) +print(json.dumps({"plan": plan, "before": before, + "peak": out[0] if out else -1, "entropy": h})) +""" + + +@pytest.mark.skipif(not os.path.exists("/proc/self/status"), + reason="needs /proc to count the process's own threads") +def test_a_nesting_environment_does_not_multiply_the_planned_width(): + """`entropy` nests: math/diversity.c:306 parallel-for into expected_raw, + which has regions of its own. With OMP_MAX_ACTIVE_LEVELS=2 the inner ones + become real teams, and they are encountered by the OUTER team's workers -- + which hold no plan, the plan being thread-local, so before + `beam_threads()` answered the nested case they fell through to the cap. + Measured on this call with the plan pinned at 8: 117 threads in the + process against 9 with nesting off, and 0.24 s against under a + millisecond. + + Counted from `/proc/self/status`, which is the process's own thread table + rather than anything BEAM reports about itself: libgomp keeps its teams as + real threads, so a team that was created is a thread that exists. One of + the threads above `before` is this child's own sampler. + """ + import json + import subprocess + import sys + + env = dict(os.environ, OMP_MAX_ACTIVE_LEVELS="2", + BEAM_AVAILABLE_CORES="16") + env.pop("OMP_NUM_THREADS", None) # or the policy stands aside entirely + r = subprocess.run([sys.executable, "-c", _NESTING_CHILD], + capture_output=True, text=True, encoding="utf-8", + timeout=900, env=env) + assert r.returncode == 0, r.stderr[-3000:] + got = json.loads(r.stdout.strip().splitlines()[-1]) + + if got["plan"] < 2: + pytest.skip(f"a plan of {got['plan']} cannot be multiplied") + assert got["peak"] - got["before"] <= got["plan"], ( + f"nesting widened the process past its plan: {got}") diff --git a/tools/qa/run b/tools/qa/run index e7175103..1559ac8d 100755 --- a/tools/qa/run +++ b/tools/qa/run @@ -19,12 +19,20 @@ The thread cap is applied as an environment variable and never as an in-process call. src/native/core/threads.c:24-26 records that BEAM does not edit global OpenMP state, and a runner that did would be deciding something the library deliberately leaves to the caller. + +`--tsan` runs the instrumented suites that `make tsan` builds. It exists +because running them by hand is wrong in three ways at once -- no Archer, no +TSAN_OPTIONS, and the address-space ceiling that TSan refuses to start under +-- and each one of those turns a clean run into hundreds of reports about +barriers. See verification/tests/test_tsan.py for what each setting is +holding back. """ from __future__ import annotations import argparse import json import os +import re import subprocess import sys import tempfile @@ -51,6 +59,19 @@ DEFAULT_THREADS = 2 TIMEOUT_CODES = {124, 137, 143} BOUNDED_REFUSED = 3 # bounded could not set the address-space ceiling +# ThreadSanitizer's own exit code when it reported anything. Distinct from an +# assertion failure (1) on purpose: a suite whose test cases all pass and +# whose library raced needs a different person looking at it than a suite +# with a broken expectation. +TSAN_RACE = 66 +TSAN_REPORT = "WARNING: ThreadSanitizer" +# Archer supplies the happens-before edges that libomp does not carry: it has +# no sanitiser annotations, so without the tool TSan sees no synchronisation +# between any two OpenMP threads and every barrier reads as a race. Measured +# on test_distance at 8 threads: 783 reports without it, 0 with it. +ARCHER_GLOB = "llvm-*/lib/libarcher.so" +ARCHER_ROOT = Path("/usr/lib") + def discover(bin_dir: Path) -> list[Path]: return sorted(p for p in bin_dir.glob("test_*") @@ -67,20 +88,76 @@ def classify(code: int) -> str: return "fail" -def run_one(binary: Path, *, threads: int, timeout: int, mem_gb: int) -> dict: +def classify_tsan(code: int, reports: int) -> str: + """A race is its own outcome, not a failure. + + A suite whose cases all pass and whose library raced, and a suite with a + broken expectation, need different people looking at them. Reports are + counted as well as trusted to the exit code, because TSAN_OPTIONS can be + told to exit zero and then a race would read as a pass.""" + if reports > 0 or code == TSAN_RACE: + return "races" + return classify(code) + + +def find_archer() -> Path | None: + """The newest installed Archer. Which LLVM version built the suites is + not knowable from here -- `make tsan` takes LLVM_VER -- and both 19 and + 21 ship a working one, so this prefers the newest and `--archer` settles + any case where that is wrong.""" + found = sorted(ARCHER_ROOT.glob(ARCHER_GLOB), + key=lambda p: [int(n) if n.isdigit() else n + for n in re.split(r"(\d+)", p.parts[-3])]) + return found[-1] if found else None + + +def tsan_options(mem_gb: int) -> str: + """The sanitiser settings the instrumented run cannot do without. + + `ignore_noninstrumented_modules` is what Archer itself asks for on + startup: without it the uninstrumented runtime's own internals report. + The allocator pair replaces the address-space ceiling that this run has + to do without -- TSan refuses to start under `ulimit -v` -- so that a + request BEAM cannot afford still fails inside the process that made it + rather than in whatever the OOM killer picks. + + The caller's own TSAN_OPTIONS go last, because later settings win in the + sanitiser's parser: a suppressions file or a deeper history can be added + from outside without losing any of these.""" + return " ".join(x for x in ( + "ignore_noninstrumented_modules=1", + "allocator_may_return_null=1", + f"max_allocation_size_mb={mem_gb * 1024}", + os.environ.get("TSAN_OPTIONS", ""), + ) if x) + + +def run_one(binary: Path, *, threads: int, timeout: int, mem_gb: int, + tsan: bool = False, archer: Path | None = None) -> dict: env = dict(os.environ) env["OMP_NUM_THREADS"] = str(threads) + if tsan: + env["OMP_TOOL_LIBRARIES"] = str(archer) + env["TSAN_OPTIONS"] = tsan_options(mem_gb) # An exit code cannot say how many tests ran, so the loop this replaces # could not tell 390 passes from 300. The harness writes its outcomes, # their durations and its own conditions; a binary built before the # harness, or one that died early, writes nothing, and that is reported # rather than quietly lowering the total. + # The instrumented run cannot go through `bounded`: it sets `ulimit -v`, + # and TSan maps shadow memory across the address space, so it refuses to + # start at all ("Program is run with limited virtual address space, which + # wouldn't work with ThreadSanitizer ... setrlimit() failed 22"). The + # wall-clock half of the wrapper is kept; the ceiling moves into + # TSAN_OPTIONS above. + wrapper = (["timeout", "--signal=TERM", "--kill-after=30", str(timeout)] + if tsan else + [str(BOUNDED), "-m", str(mem_gb), "-t", str(timeout), "--"]) with tempfile.TemporaryDirectory(prefix="beam-qa-") as scratch: results = Path(scratch) / f"{binary.name}.json" started = time.monotonic() proc = subprocess.run( - [str(BOUNDED), "-m", str(mem_gb), "-t", str(timeout), "--", - str(binary), "--json", str(results)], + [*wrapper, str(binary), "--json", str(results)], capture_output=True, text=True, encoding="utf-8", errors="replace", env=env) seconds = time.monotonic() - started @@ -90,12 +167,18 @@ def run_one(binary: Path, *, threads: int, timeout: int, mem_gb: int) -> dict: tests = json.loads(results.read_text(encoding="utf-8")) except json.JSONDecodeError as exc: tests = {"error": f"unreadable results: {exc}"} - return {"name": binary.name, "exit": proc.returncode, - "status": classify(proc.returncode), "seconds": round(seconds, 2), - "output": proc.stdout + proc.stderr, "tests": tests} - - -def conditions(*, threads: int, jobs: int, timeout: int, mem_gb: int) -> dict: + output = proc.stdout + proc.stderr + suite = {"name": binary.name, "exit": proc.returncode, + "status": classify(proc.returncode), "seconds": round(seconds, 2), + "output": output, "tests": tests} + if tsan: + suite["reports"] = output.count(TSAN_REPORT) + suite["status"] = classify_tsan(proc.returncode, suite["reports"]) + return suite + + +def conditions(*, threads: int, jobs: int, timeout: int, mem_gb: int, + tsan: bool = False) -> dict: """What the durations below mean nothing without. The same suite took 3.4 minutes on an idle box and 106 minutes at load @@ -109,16 +192,19 @@ def conditions(*, threads: int, jobs: int, timeout: int, mem_gb: int) -> dict: load = [-1.0, -1.0, -1.0] return {"threads": threads, "jobs": jobs, "cores": os.cpu_count() or 1, "loadavg": load, "timeout_seconds": timeout, "mem_gb": mem_gb, + "tsan": tsan, "started": time.strftime("%Y-%m-%dT%H:%M:%S%z")} def report(suite: dict, *, show_output: bool) -> None: if show_output and suite["output"]: print(suite["output"].rstrip("\n")) - tag = {"pass": "pass ", "fail": "FAIL ", + tag = {"pass": "pass ", "fail": "FAIL ", "races": "RACES ", "timeout": "TIMEOUT", "error": "ERROR "}[suite["status"]] note = "" - if suite["status"] == "fail": + if suite["status"] == "races": + note = f" ({suite.get('reports', 0)} report(s), exit {suite['exit']})" + elif suite["status"] == "fail": note = f" (exit {suite['exit']})" elif suite["status"] == "timeout": note = f" (killed after {suite['seconds']:.0f} s)" @@ -130,8 +216,14 @@ def report(suite: dict, *, show_output: bool) -> None: def main(argv: list[str] | None = None) -> int: p = argparse.ArgumentParser(prog="tools/qa/run", description=__doc__) p.add_argument("kind", choices=["c"], help="which half of the suite to run") - p.add_argument("--bin-dir", type=Path, - default=ROOT / "build" / "tests" / "native") + p.add_argument("--bin-dir", type=Path, default=None) + p.add_argument("--tsan", action="store_true", + help="run the instrumented suites from build-tsan under " + "Archer. Without this the binaries there report " + "hundreds of races that are not there.") + p.add_argument("--archer", type=Path, default=None, + help="the Archer OMPT tool; default is the newest " + "/usr/lib/llvm-*/lib/libarcher.so") p.add_argument("--jobs", type=int, default=0, help="suites at once; default fills the cores at the cap") p.add_argument("--threads", type=int, default=DEFAULT_THREADS, @@ -147,14 +239,39 @@ def main(argv: list[str] | None = None) -> int: "output of suites that passed") a = p.parse_args(argv) + build = "build-tsan" if a.tsan else "build" + how = "make tsan" if a.tsan else "make test" + if a.bin_dir is None: + a.bin_dir = ROOT / build / "tests" / "native" + + archer = None + if a.tsan: + archer = a.archer if a.archer is not None else find_archer() + # Refusing is the whole point. libomp carries no sanitiser + # annotations, so with no tool loaded TSan has no happens-before edge + # between any two OpenMP threads and every barrier reads as a race: + # 783 reports on one suite, all of them artifacts. A log like that is + # worse than no log, because somebody reads it. + if archer is None or not archer.is_file(): + print(f"{p.prog}: no Archer at " + f"{archer or ARCHER_ROOT / ARCHER_GLOB}, so nothing was " + f"run.", file=sys.stderr) + print(" Install it: sudo apt install libomp-21-dev", + file=sys.stderr) + print(" Or name one: --archer /path/to/libarcher.so", + file=sys.stderr) + print(" Without it every implicit barrier reads as a data race.", + file=sys.stderr) + return 2 + if not a.bin_dir.is_dir(): print(f"{p.prog}: no such directory: {a.bin_dir}\n" - f"Build the suites first: make test", file=sys.stderr) + f"Build the suites first: {how}", file=sys.stderr) return 2 found = discover(a.bin_dir) if not found: print(f"{p.prog}: no executable test_* under {a.bin_dir}\n" - f"Build the suites first: make test", file=sys.stderr) + f"Build the suites first: {how}", file=sys.stderr) return 2 if a.suite: @@ -177,7 +294,9 @@ def main(argv: list[str] | None = None) -> int: probe = subprocess.run([str(BOUNDED), "-m", str(a.mem_gb), "-t", "10", "--", "true"], capture_output=True, text=True, encoding="utf-8") - if probe.returncode == BOUNDED_REFUSED: + if a.tsan: + probe = None # the instrumented run never uses the wrapper + if probe is not None and probe.returncode == BOUNDED_REFUSED: print(f"{p.prog}: this environment refuses an address-space ceiling " f"of {a.mem_gb} GB, so nothing was run.", file=sys.stderr) print(f" {probe.stderr.strip()}", file=sys.stderr) @@ -193,15 +312,18 @@ def main(argv: list[str] | None = None) -> int: jobs = a.jobs if a.jobs > 0 else max(1, (os.cpu_count() or 1) // threads) jobs = min(jobs, len(found)) cond = conditions(threads=threads, jobs=jobs, timeout=a.timeout, - mem_gb=a.mem_gb) + mem_gb=a.mem_gb, tsan=a.tsan) print(f"{len(found)} suite(s), {jobs} at a time x {threads} thread(s) " f"on {cond['cores']} cores, load {cond['loadavg'][0]}") + if a.tsan: + print(f"ThreadSanitizer, Archer at {archer}") started = time.monotonic() results: list[dict] = [] with ThreadPoolExecutor(max_workers=jobs) as pool: futures = [pool.submit(run_one, b, threads=threads, timeout=a.timeout, - mem_gb=a.mem_gb) for b in found] + mem_gb=a.mem_gb, tsan=a.tsan, archer=archer) + for b in found] for f in futures: suite = f.result() results.append(suite) @@ -219,7 +341,7 @@ def main(argv: list[str] | None = None) -> int: print(s["output"].rstrip("\n")) counts = {k: sum(1 for s in results if s["status"] == k) - for k in ("pass", "fail", "timeout", "error")} + for k in ("pass", "fail", "races", "timeout", "error")} reported = [s["tests"] for s in results if isinstance(s.get("tests"), dict) and "total" in s["tests"]] @@ -238,7 +360,8 @@ def main(argv: list[str] | None = None) -> int: if silent: print(f"{len(silent)} suite(s) wrote no results, so their tests are " f"not counted above: {', '.join(silent)}") - print(f"\n{len(results)} suites, {counts['fail']} failed, " + races = f"{counts['races']} with races, " if a.tsan else "" + print(f"\n{len(results)} suites, {races}{counts['fail']} failed, " f"{counts['timeout']} timed out, {counts['error']} not run, " f"in {elapsed:.1f} s " f"(jobs {jobs} x {threads} threads on {cond['cores']} cores, " @@ -251,6 +374,8 @@ def main(argv: list[str] | None = None) -> int: "suites": [{k: v for k, v in s.items() if k != "output"} for s in sorted(results, key=lambda s: s["name"])], "totals": {"suites": len(results), "failed": counts["fail"], + "with_races": counts["races"], + "reports": sum(s.get("reports", 0) for s in results), "timed_out": counts["timeout"], "not_run": counts["error"], "seconds": round(elapsed, 2)}}, diff --git a/verification/README.md b/verification/README.md index e78df087..84b01981 100644 --- a/verification/README.md +++ b/verification/README.md @@ -44,6 +44,33 @@ anything the guard does not anticipate fails inside the process that asked rather than on the machine around it. Use it for one-liners too. That is where it went wrong both times. +## Looking for data races + +```bash +make tsan # clang + libomp + Archer, into build-tsan/ +tools/qa/run c --tsan # 33 suites, Archer loaded, TSAN_OPTIONS set +``` + +Nothing in CI runs this; it needs a clang toolchain +(`sudo apt install clang-21 libomp-21-dev`) and it is a developer's tool. Run +it after anything that changes a parallel region. + +Run the binaries in `build-tsan/` any other way and the answer is noise. +`libomp` carries no sanitiser annotations, so without Archer loaded as an OMPT +tool ThreadSanitizer has no happens-before edge between any two OpenMP +threads: every implicit barrier is invisible and every region whose result +somebody later reads is reported as a race. On one suite at 8 threads that is +783 reports with Archer off and 0 with it on; under GCC and `libgomp`, where +there is no Archer at all, it was 1186. `--tsan` is the mode that gets all +three settings right -- the tool, `ignore_noninstrumented_modules=1`, and no +`ulimit -v`, which TSan refuses to start under. + +Four suites are not instrumented, all four about the allocator, which is the +one thing TSan replaces wholesale. `verification/tests/test_tsan.py` derives +that set from the sources rather than listing it, and its last test is the one +that matters: it runs a suite with Archer off and checks the reports appear, +because a clean run is only evidence if a dirty one is reachable. + ## Running the gate ```bash @@ -55,7 +82,7 @@ make clean && make test # 439 C tests The last line is the suite that guards the checks themselves -- the comparison logic, the record selector, the inventory readers, the GIL-region and -thread-count scans. It lives outside `tests/` because CI copies `tests/` +thread-count scans, and the race detector's settings. It lives outside `tests/` because CI copies `tests/` elsewhere and runs it against the installed package, so a test that imports this repository's tooling cannot live under it. It runs in CI as `Verification tooling`; until that job existed it ran only by hand. diff --git a/verification/baseline/RERECORDED.md b/verification/baseline/RERECORDED.md index 99540e4b..f800bb2a 100644 --- a/verification/baseline/RERECORDED.md +++ b/verification/baseline/RERECORDED.md @@ -3665,3 +3665,68 @@ Previous versions kept as `c_cases.measuredflag.txt`, only: `beam_plan_threads()` does not read it and must not, since a plan that behaved differently depending on whether the estimate was measured would make the fallback a second policy. + +## Amended 2026-11-15, for the nesting hazard + +`beam_threads()` now answers 1 when `omp_get_active_level() > 0`, before it +consults the plan or the cap. Two files moved, both inventory. **No recorded +NUMBER changed**, and the gate's own run says so in full: `numeric`, `math +values`, `saved-model bytes`, `thread independence` and all 416 `exact against +enumeration` quantities were OK in the same run that failed these two. So was +`thread counts (93 parallel regions, every one names a permitted thread +count)`, which is the check this change might have been expected to disturb +and does not: the clauses are untouched, only what one of them evaluates to on +a thread that is already inside a team. + +### `c_cases.txt`: 452 -> 454 + +- `test_a_nested_region_is_planned_at_one_thread` +- `test_an_inactive_region_does_not_lose_the_plan` + +The first is the fix. The second pins the choice of `omp_get_active_level()` +over `omp_get_level()`: a team of one is an inactive region, it multiplies +nothing, and reading the plain level there would serialise the work inside a +single-length sweep for no gain. Written before the fix; the first failed, the +second passed, which is why both are here -- the second is a guard against a +later simplification, not a demonstration. + +### `pytest_cases.txt`: 1244 -> 1245 + +- `tests/suites/model/test_runtime.py::test_a_nesting_environment_does_not_multiply_the_planned_width` + +Mutated against the real build, since it was written after the fix and would +otherwise prove nothing. With the one line commented out and the extension +rebuilt (`touch` first -- a preserved mtime makes `make` judge the object +current and the "restored" run still exercises the mutant), it fails: 3.74 s +and a process 109 threads above its plan. Restored, it passes in 0.35 s. + +### One existing assertion changed, which is the part to scrutinise + +`tests/native/test_plan.c`, in `test_a_plan_does_not_reach_another_thread`: + +```c +- ASSERT_MSG(worker_saw == 7, +- "a worker must fall back to the cap, 7, not inherit the plan"); ++ ASSERT_MSG(worker_saw != want, "a worker must not inherit the plan"); ++ ASSERT_MSG(worker_saw == 1, ...); +``` + +The test keeps its name and its property -- the plan is thread-local and does +not reach another thread, so the plan's value must not appear there -- and the +cap of 7 is still configured, still required to differ from the plan, so the +test still cannot pass by the two coinciding. What changed is the fallback, +deliberately. That fallback was the defect: a worker holds no plan, so the +nested pragmas it encounters were asking for `threads_cap()`, which with no +configured cap is `omp_get_max_threads()`. An 8-thread plan opened eight teams +of sixteen. + +Measured on one `entropy()` call with the plan pinned at 8, nesting enabled +from the environment with `OMP_MAX_ACTIVE_LEVELS=2`: **117 threads in the +process against 9 with nesting off, 0.24 s against under a millisecond**. +After the fix, 9 either way, and the entropy is 17.6075259553 in all four +runs. Phase 0 measured that class of oversubscription at 301x to 2275x worse +than serial on a loaded cluster node, which is what makes this worth a +behaviour change rather than a note in the documentation. + +Previous versions kept as `c_cases.prenesting.txt` and +`pytest_cases.prenesting.txt`. diff --git a/verification/baseline/c_cases.prenesting.txt b/verification/baseline/c_cases.prenesting.txt new file mode 100644 index 00000000..16e9d5c3 --- /dev/null +++ b/verification/baseline/c_cases.prenesting.txt @@ -0,0 +1,452 @@ +test_N_is_a_residue_and_other_codes_are_not +test_a_bad_shape_is_refused_at_construction +test_a_banded_logo_is_a_filtered_sum_over_the_support +test_a_bin_aligned_band_is_the_spectrum_over_those_bins +test_a_budget_too_small_refuses_and_says_why +test_a_budget_too_small_refuses_both_sweeps +test_a_ceiling_of_one_refuses_rather_than_undercounts +test_a_character_outside_the_alphabet_is_malformed_input +test_a_compacted_model_cannot_report_depth_occupancy +test_a_config_past_its_alphabets_ceiling_is_refused_by_name +test_a_conserved_position_is_dominated_but_not_one_hot +test_a_constrained_probability_matches_enumeration +test_a_constraint_over_the_wrong_alphabet_is_refused +test_a_count_probability_matches_enumeration +test_a_count_range_that_cannot_be_met_accepts_nothing +test_a_degenerate_range_yields_nothing +test_a_dense_model_finalizes_eagerly_to_the_same_bits +test_a_depth_bucket_with_no_rows_matches_the_definition +test_a_deterministic_dependency_carries_one_bit_as_the_prior_vanishes +test_a_dominant_rejected_path_cannot_collapse_the_answer +test_a_dropped_member_leaves_the_single_member_profile +test_a_finite_top_edge_still_measures_the_whole_grid +test_a_format_11_file_says_upgrade_beam +test_a_fraction_of_a_core_rounds_towards_contention +test_a_fractional_exponent_is_the_mellin_transform +test_a_functional_the_engine_cannot_sum_is_refused +test_a_grid_over_budget_is_refused +test_a_grid_too_coarse_is_refused_on_request +test_a_header_length_past_the_arrays_is_corrupt +test_a_k_way_product_is_the_mellin_transform_at_k +test_a_language_and_its_complement_partition_the_mass +test_a_layer_indexed_automaton_answers_a_disjunction +test_a_length_spelled_once_has_no_entropy_as_the_prior_vanishes +test_a_length_the_model_never_generates_is_refused +test_a_line_is_one_stretch_wherever_it_fits +test_a_loaded_model_keeps_no_count_directory +test_a_long_model_is_written_as_format_10 +test_a_matched_motif_cannot_be_un_matched +test_a_mismatched_automaton_is_refused_and_still_consumed +test_a_model_against_itself_has_coefficient_one +test_a_model_against_itself_is_one_over_its_hill_number +test_a_model_longer_than_the_old_ceiling_builds_and_scores +test_a_model_reports_the_alphabet_it_was_built_with +test_a_moment_sweep_is_cheaper_than_a_posterior +test_a_motif_conditional_matches_enumeration +test_a_motif_probability_matches_enumeration +test_a_motif_that_cannot_fit_is_refused +test_a_motif_the_corpus_never_spells_is_improbable_but_possible +test_a_narrow_budget_finalizes_to_the_same_bits +test_a_negative_tilt_does_not_overflow_the_sweeps +test_a_new_constraint_admits_every_residue +test_a_nonsense_pin_is_ignored_rather_than_obeyed +test_a_nucleotide_file_relabelled_as_amino_acid_is_rejected +test_a_nucleotide_model_builds_and_scores +test_a_nucleotide_model_past_the_byte_ceiling_builds_and_scores +test_a_nucleotide_model_round_trips_through_a_file +test_a_null_input_plans_one_thread +test_a_pair_joint_is_a_distribution_with_the_right_marginals +test_a_pin_above_the_cores_present_is_clamped +test_a_pinned_estimate_overrides_the_measurement +test_a_pinned_layer_is_estimated_cheaper_than_a_free_one +test_a_pinned_position_reproduces_a_clamp +test_a_pinned_probability_reproduces_log_clamp_probability +test_a_plan_does_not_reach_another_thread +test_a_plane_major_table_refuses_the_row_pointer +test_a_pooled_row_is_still_the_prior_of_its_counts +test_a_position_past_the_end_is_refused_by_name +test_a_product_past_the_state_ceiling_is_refused +test_a_query_length_past_the_old_ceiling_meets_the_budget +test_a_rare_but_certain_event_has_moments +test_a_reading_that_moves_backwards_resets_rather_than_underflows +test_a_refused_run_leaves_the_constraint_untouched +test_a_reserved_partition_never_grows +test_a_reserved_table_holds_what_a_grown_one_holds +test_a_residue_outside_the_alphabet_is_refused_by_name +test_a_run_applies_as_a_prefix_and_as_a_suffix +test_a_run_near_the_integer_ceiling_does_not_wrap +test_a_saturated_machine_cannot_report_more_than_it_has +test_a_saturated_machine_plans_one_thread +test_a_set_conditions_as_the_mixture_of_its_members +test_a_set_probability_is_the_sum_over_its_members +test_a_short_model_is_still_written_as_format_9 +test_a_short_window_leaves_the_baseline_to_age +test_a_sink_below_the_grid_origin_still_reports_its_mass +test_a_source_at_the_length_ceiling_is_handled +test_a_source_the_model_cannot_score_is_refused +test_a_table_numbered_out_of_order_is_refused +test_a_threads_first_reading_is_only_a_baseline +test_a_top_k_search_cannot_split_its_way_past_the_budget +test_a_transposed_table_holds_the_prior_of_its_counts +test_a_transposed_table_reads_back_identically +test_a_universal_automaton_reproduces_the_mask_sweep +test_a_window_too_short_to_mean_anything_is_unknown +test_a_zero_exponent_drops_its_member +test_a_zero_forward_weight_leaves_no_nan_edge_weights +test_a_zeroed_config_still_means_amino_acid +test_accumulate_bins_and_conserves_mass +test_accumulator_max_ignores_an_earlier_threads_error +test_accumulator_max_is_not_the_surprisal +test_add_equals_counting_together +test_add_then_subtract_is_identity +test_all_ones_exponents_are_the_plain_inner_product +test_alphabet_names_are_distinct +test_ambiguity_beyond_N_is_still_rejected +test_an_amino_acid_ceiling_is_not_the_nucleotide_one +test_an_automaton_makes_a_constraint_not_free +test_an_empty_band_is_refused_not_answered +test_an_expected_count_is_the_column_of_marginals +test_an_explicit_cap_does_not_override_the_memory_cap +test_an_explicit_cap_is_honoured_exactly +test_an_explicit_cap_sizes_memory_for_itself +test_an_idle_machine_reports_only_ourselves +test_an_illegal_row_count_is_not_blamed_on_the_budget +test_an_impossible_constraint_has_probability_zero +test_an_impossible_neighbourhood_still_reports_its_odds +test_an_inconsistent_sample_is_not_negative_competition +test_an_indicator_expectation_is_the_marginal +test_an_omp_env_setting_is_not_overridden +test_an_omp_env_setting_sizes_memory_for_itself +test_an_over_length_sequence_scores_minus_infinity +test_an_over_length_source_is_probability_zero_up_to_the_buffer +test_an_unconstrained_query_reproduces_the_marginals +test_an_unfinalized_member_is_refused +test_an_unknown_alphabet_in_a_file_is_refused +test_an_unknown_core_count_still_covers_the_plan +test_an_unreadable_cpu_max_is_reported_as_unknown +test_an_unreadable_loadavg_is_reported_as_unknown +test_and_or_and_not_are_the_boolean_combinations +test_attaching_an_automaton_intersects +test_auto_plans_the_free_cores_up_to_the_scaling_ceiling +test_availability_above_the_core_count_is_clamped +test_backward_context_from_state_matches_the_sequence +test_backward_context_packing +test_backward_wide_context_matches_the_sequence +test_bad_exponents_are_refused +test_batch_matches_scalar +test_beam_threads_is_stable_inside_a_plan_scope +test_beyond_the_ceiling_more_free_cores_buy_nothing +test_beyond_the_reduction_range +test_bits_do_not_depend_on_the_call_size +test_both_accessors_agree +test_both_crc_paths_match_the_polynomial +test_both_formats_load +test_both_union_entry_points_enforce_the_same_ceiling +test_budget_concurrency_follows_the_active_plan +test_budget_refusal_does_not_poison_the_model +test_builders_commute +test_builders_intersect_rather_than_replace +test_c_anchor_penalises_a_bad_terminus +test_case_folded_input_does_not_multiply_the_neighbours +test_clamped_marginals_survive_a_wide_dynamic_range +test_combining_incompatible_automata_is_refused +test_compact_keeps_scores +test_company_threads_and_budget_do_not_change_the_bits +test_competitors_are_counted_in_whole_cores +test_conditioning_on_the_impossible_is_refused +test_construction_refuses_an_unknown_alphabet +test_contradictory_builders_leave_an_empty_position +test_corrupt_file_is_rejected +test_crc32c_table_matches_the_polynomial +test_cumulants_follow_from_moments +test_de_morgan_holds_over_the_whole_language +test_defaults_are_the_measured_ones +test_defaults_refuse_an_unknown_alphabet +test_defaults_sit_inside_their_own_ceilings +test_degenerate_input_is_defined +test_deletion_neighbours_collapse_runs +test_dense_best_completion_never_exceeds_the_total +test_dense_matches_the_definition +test_dense_sweeps_each_compute_their_own_semiring +test_depth_occupancy_sums_to_the_nonzero_cells +test_descriptors_are_internally_consistent +test_double_negation_is_the_identity +test_dropping_an_aliased_cache_frees_each_list_once +test_each_neighbour_is_attributed_to_its_leftmost_gap +test_effective_threads_reports_the_cap_not_the_plan +test_either_storage_layout_is_a_valid_configuration +test_entropy_matches_enumeration +test_entropy_reproduces_the_models_own_surprisal_moments +test_every_byte_maps_exactly_as_specified +test_every_cell_is_still_the_prior_of_its_counts +test_every_config_refusal_names_its_own_rule +test_every_descriptor_fits_the_length_constants +test_every_entry_point_refuses_the_impossible +test_every_layer_of_a_real_model_aliases +test_every_legal_pair_accepts_exactly_up_to_its_own_bound +test_every_lifecycle_operation_survives_frozen_counts +test_every_nucleotide_order_finalizes_and_scores +test_every_order_is_its_single_order_value_bitwise +test_every_position_agrees_on_the_band_mass +test_every_route_matches_the_reference_bit_for_bit +test_every_tier_boundary +test_exp_bits_do_not_depend_on_the_call_size +test_exp_is_exact_at_zero_and_flushes_below_the_normals +test_exp_within_two_ulp +test_explain_reconstructs_the_score +test_failures_carry_a_message +test_finalize_picks_the_representation_per_table +test_finalize_rolls_back_on_allocation_failure +test_finalize_transposes_only_the_backward_top_table +test_fingerprint_partition_matches_sequence_enumeration +test_fingerprint_refusals_and_root_only +test_forward_context_packing +test_fractional_counts_round_trip +test_free_cores_is_never_below_one_or_above_what_is_allowed +test_free_cores_is_what_is_allowed_minus_what_is_running +test_generation_emits_only_this_alphabet +test_grouped_accumulation_matches_independent_rows +test_growth_overshoots_and_reallocates +test_hill_matches_mellin +test_hill_numbers +test_identical_members_have_one_members_support +test_independent_positions_share_no_information_as_the_prior_vanishes +test_index_and_character_round_trip +test_information_refuses_what_it_cannot_answer +test_inserting_then_deleting_returns_the_source +test_insertion_neighbours_are_the_distinct_strings +test_integer_counts_round_trip +test_interning_changes_no_row +test_invalid_inputs_are_reported +test_it_refuses_only_where_one_order_would_not_fit +test_large_orders_stay_finite_and_in_bounds +test_layer_max_is_unchanged_after_sealing +test_layer_weights_reproduce_the_scorer +test_lazy_and_eager_finalize_agree +test_leaving_a_default_scope_restores_the_previous_count +test_leaving_a_plan_scope_restores_the_previous_value +test_legacy_format_files_are_refused_by_name +test_legal_rows_with_real_memory_demand_get_the_budget_answer +test_length_derivatives_mix_to_the_pooled_moments +test_length_marginals_decompose +test_length_prior_normalises +test_lifting_masks_preserves_the_language +test_line_agrees_with_the_general_form +test_line_bits_depend_on_the_line_alone +test_line_plans_cover_the_line_within_the_budget +test_live_cache_is_dropped_by_every_mutation +test_live_cache_respects_the_memory_bound +test_live_cache_returns_identical_answers +test_live_frontier_invariants_hold_at_every_order +test_local_distance_different_maximum_lengths +test_local_distance_disjoint_length_support +test_local_distance_matches_enumeration_all_widths +test_local_distance_refusals +test_local_distance_tie_order +test_local_distance_topk_symmetry_identity_and_threads +test_log_mellin_endpoints +test_log_z_splits_across_its_layers +test_lower_case_scores_as_upper_case +test_lower_case_trains_as_upper_case +test_many_rare_paths_still_mix_into_an_entropy +test_marginal_rows_sum_to_one_under_a_constraint +test_masks_and_an_automaton_compose +test_matches_exhaustive_sequence_law +test_matches_the_enumerated_sum +test_max_length_is_free_up_to_the_ceiling +test_members_of_different_shapes_are_refused +test_members_trained_apart_match_the_enumeration +test_model_algebra_refuses_across_alphabets +test_moments_match_enumeration_under_a_constraint +test_moments_match_the_reference_pmf +test_moments_of_an_impossible_constraint_do_not_exist +test_moments_respect_an_automaton +test_more_competitors_never_frees_more_cores +test_more_free_cores_never_plans_fewer_threads +test_multiplicity_accounts_for_every_edit_exactly_once +test_narrow_window_fails_loudly +test_near_multiples_of_half_pi +test_neighbourhoods_at_the_short_extreme +test_no_cgroup_limit_is_reported_as_unknown +test_no_character_encodes_to_the_sentinel +test_no_dense_sweep_loses_a_state +test_no_more_threads_than_work_items +test_no_sparse_sweep_loses_a_state +test_no_threads_plans_as_one_thread +test_nucleotides_fold_case_and_amino_acids_do_not +test_observe_counts_and_rejects +test_one_band_over_everything_is_the_exact_marginal +test_one_band_over_the_grid_is_exact +test_one_block_can_be_released_before_the_rest +test_one_member_sums_to_one +test_only_an_unreadable_sequence_scores_minus_infinity +test_order_four_rows_are_normalized_and_log_consistent +test_our_own_threads_are_not_competition +test_packed_matches_scalar_and_refuses_bad_offsets +test_partition_normalises +test_per_alphabet_defaults_come_from_the_descriptor +test_pgf_inverts_to_the_reference_pmf +test_plan_scopes_nest +test_posterior_counts_round_trip +test_posterior_of_a_model_with_itself_keeps_its_scores +test_posterior_shrinks_towards_the_prior +test_prior_strengths_past_the_order_are_ignored +test_provenance_is_recorded_and_aggregated +test_random_angles_within_two_ulp +test_real_axis_and_conjugates +test_real_plans_cover_the_orders_within_the_budget +test_refining_the_grid_does_not_move_a_band +test_rejects_bad_arguments +test_rejects_unusable_sequences +test_resident_memory_stays_near_the_model_size +test_residue_indices_are_dense +test_results_do_not_depend_on_the_thread_count +test_rows_are_identified_the_cheaper_way +test_rows_that_differ_are_kept_apart +test_sampling +test_sampling_is_reproducible +test_save_load_round_trip +test_saving_a_frozen_model_writes_the_same_bytes +test_scores_are_bit_identical_after_sealing +test_scores_are_bit_identical_with_planes +test_scores_are_finite_and_ordered +test_scores_are_those_of_the_dense_model +test_scores_are_those_of_the_dense_model +test_sealing_changes_no_row +test_single_anchor_weights_are_accepted +test_slot0_counts_the_rows_before_it +test_sparse_best_completion_never_exceeds_the_total +test_sparse_combined_max_is_over_the_marked_rows +test_sparse_growth_failure_is_atomic +test_sparse_matches_dense_bit_for_bit +test_sparse_order_2_matches_the_definition +test_sparse_order_4_matches_the_definition +test_sparse_rows_boundaries_and_erase +test_sparse_sweeps_each_compute_their_own_semiring +test_spectra_by_length_equal_one_at_a_time +test_spectrum_pair_equals_two_spectra +test_spectrum_totals_and_identity +test_subtract_is_the_additive_inverse +test_subtract_refuses_to_empty_the_model +test_subtract_restores_the_sequence_counters +test_summed_position_entropies_never_undercut_the_sequence +test_support_is_all_of_sequence_space +test_surprisal_mean_is_the_entropy +test_surprisal_moments_by_enumeration +test_surprisal_range_by_enumeration +test_the_accumulators_refuse_and_say_it_was_the_budget +test_the_alias_is_taken_exactly_when_the_lists_agree +test_the_allocator_policy_is_applied +test_the_alphabets_overlap_with_different_indices +test_the_amino_acid_defaults_are_unchanged +test_the_analytics_match_enumeration_for_nucleotides +test_the_automaton_allocation_respects_the_memory_budget +test_the_band_masses_account_for_the_whole_spectrum +test_the_banding_matches_brute_force_on_a_tiny_model +test_the_bands_recombine_into_the_unconditional_marginal +test_the_bhattacharyya_coefficient_matches_the_enumeration +test_the_byte_count_drops_by_the_aliased_lists +test_the_calling_contract +test_the_calling_contract +test_the_cgroup_quota_is_read_as_whole_cores +test_the_compaction_report_matches_what_the_table_became +test_the_company_an_order_keeps_does_not_change_it +test_the_cost_estimate_precedes_the_sweep +test_the_count_automaton_is_exactly_a_tally +test_the_count_automaton_uses_no_more_states_than_it_needs +test_the_cursor_matches_the_predicate_when_direct +test_the_cursor_matches_the_predicate_when_sealed +test_the_default_prior_leaves_no_position_certain_and_no_dependency_exact +test_the_default_scope_honours_an_explicit_cap +test_the_default_scope_plans_from_the_pinned_availability +test_the_default_scope_stands_aside_for_omp_num_threads +test_the_default_scope_stops_at_the_ceiling +test_the_dictionary_holds_each_value_once +test_the_dissimilarity_profile_sums_to_a_nonnegative_distance +test_the_doubling_paths_refuse_too +test_the_driver_and_the_sweep_agree_on_the_size +test_the_estimate_does_not_exceed_the_cores_present +test_the_estimate_grows_with_the_automaton +test_the_estimate_matches_what_the_sweep_allocates +test_the_estimate_reports_whether_it_measured +test_the_fine_grid_loses_mass_off_its_top +test_the_gram_matrix_matches_the_pairs_one_at_a_time +test_the_guard_divides_exactly_as_the_operator_does +test_the_guard_notices_a_value_that_vanishes +test_the_information_cost_reports_the_whole_job +test_the_information_matrix_matches_enumeration +test_the_layout_count_covers_the_team_with_no_plan_active +test_the_layout_count_holds_still_as_the_machine_fills +test_the_layout_count_ignores_how_busy_the_machine_is +test_the_layout_count_never_undercuts_the_plan +test_the_machine_reports_a_usable_estimate +test_the_matrix_agrees_with_the_pair_joints +test_the_matrix_obeys_the_identities_information_must +test_the_matrix_under_a_constraint_matches_enumeration +test_the_memory_cap_is_never_exceeded +test_the_mixture_sweep_loses_nothing_either +test_the_moment_sweep_agrees_about_the_partition +test_the_motif_automaton_is_exactly_substring_search +test_the_odds_are_the_scores_they_claim_to_be +test_the_order_bound_is_the_alphabet_s_own +test_the_order_ceiling_keeps_context_counts_in_range +test_the_partition_normalises_above_order_four +test_the_partition_normalises_over_nucleotides +test_the_per_length_terms_sum_to_the_total +test_the_per_position_terms_sum_to_the_total +test_the_plan_never_drops_below_one +test_the_policy_applies_without_being_named +test_the_positional_profile_does_not_depend_on_member_order +test_the_positional_split_leaves_the_total_bit_identical +test_the_positional_total_agrees_with_the_by_length_vector +test_the_posterior_ranks_the_insertions_the_corpus_prefers +test_the_posterior_survives_a_neighbourhood_that_underflows +test_the_power_gram_matches_the_pairs_one_at_a_time +test_the_probability_of_everything_is_exactly_one +test_the_recovered_mean_surprisal_is_unbiased +test_the_reference_alphabet_sets_the_ceiling +test_the_registry_refuses_what_it_does_not_know +test_the_registry_resolves_ids_and_names +test_the_reported_figure_tracks_the_work +test_the_reported_working_set_covers_every_allocation +test_the_reported_working_set_is_not_a_meaningless_ceiling +test_the_runnable_count_is_read_from_the_fourth_field +test_the_same_input_always_plans_the_same_count +test_the_sampled_estimate_tracks_competitors_over_the_window +test_the_selfcheck_passes_on_an_aliased_cache +test_the_shipped_budget_answers_and_every_block_is_whole +test_the_stack_identities_hold +test_the_state_ceiling_admits_what_it_says_it_does +test_the_state_is_exactly_one_context_wide +test_the_streaming_log_sum_exp_matches_a_two_pass_reference +test_the_sweep_and_the_accumulators_share_one_budget +test_the_table_accessors_refuse_what_they_cannot_read +test_the_top_k_merge_buffer_is_refused_before_it_is_taken +test_the_transpose_actually_moves_the_cells +test_the_two_alphabets_do_not_interfere +test_the_two_spellings_of_the_estimate_agree +test_the_unconditional_logo_is_a_direct_sum_over_the_support +test_the_union_ceiling_binds_only_the_union +test_the_union_never_exceeds_the_pooled_model +test_the_union_of_any_members_is_the_whole_space +test_the_whole_engine_on_a_nucleotide_model +test_threads_and_budget_do_not_change_an_order +test_threads_setting_round_trips +test_top_k_by_enumeration +test_top_sequence_attains_the_minimum_surprisal +test_truncation_discards_the_far_tail +test_two_bands_recombine_into_the_exact_logo +test_union_obeys_inclusion_exclusion +test_unknown_contention_falls_back_to_the_headroom_rule +test_validation_refuses_an_unknown_alphabet +test_variance_survives_a_large_constant_offset +test_variance_survives_an_offset_that_squares_to_infinity +test_what_a_malformed_band_gets +test_what_a_malformed_request_gets +test_what_cannot_be_interned_is_left_alone +test_what_cannot_be_packed_is_left_alone +test_what_cannot_be_sealed_is_left_alone +test_what_cannot_be_transposed_is_left_alone +test_what_reserve_refuses_and_ignores +test_with_no_plan_active_nothing_changes +test_zero_is_exact diff --git a/verification/baseline/c_cases.txt b/verification/baseline/c_cases.txt index 16e9d5c3..2ffdd979 100644 --- a/verification/baseline/c_cases.txt +++ b/verification/baseline/c_cases.txt @@ -48,6 +48,7 @@ test_a_motif_that_cannot_fit_is_refused test_a_motif_the_corpus_never_spells_is_improbable_but_possible test_a_narrow_budget_finalizes_to_the_same_bits test_a_negative_tilt_does_not_overflow_the_sweeps +test_a_nested_region_is_planned_at_one_thread test_a_new_constraint_admits_every_residue test_a_nonsense_pin_is_ignored_rather_than_obeyed test_a_nucleotide_file_relabelled_as_amino_acid_is_rejected @@ -113,6 +114,7 @@ test_an_idle_machine_reports_only_ourselves test_an_illegal_row_count_is_not_blamed_on_the_budget test_an_impossible_constraint_has_probability_zero test_an_impossible_neighbourhood_still_reports_its_odds +test_an_inactive_region_does_not_lose_the_plan test_an_inconsistent_sample_is_not_negative_competition test_an_indicator_expectation_is_the_marginal test_an_omp_env_setting_is_not_overridden diff --git a/verification/baseline/pytest_cases.prenesting.txt b/verification/baseline/pytest_cases.prenesting.txt new file mode 100644 index 00000000..721c5edc --- /dev/null +++ b/verification/baseline/pytest_cases.prenesting.txt @@ -0,0 +1,1244 @@ +tests/_engineering/test_imports_are_explicit.py::test_no_fixture_path_depends_on_nesting_depth +tests/_engineering/test_imports_are_explicit.py::test_no_test_imports_a_bare_helper_module +tests/_engineering/test_imports_are_explicit.py::test_the_fixture_directory_is_the_one_holding_the_irreplaceable_files +tests/oracles/test_oracles_are_independent.py::test_no_oracle_imports_another_oracle +tests/oracles/test_oracles_are_independent.py::test_no_oracle_imports_the_shared_engineering +tests/oracles/test_oracles_are_independent.py::test_the_c_harness_header_no_longer_carries_an_oracle +tests/oracles/test_oracles_are_independent.py::test_the_c_prior_reference_reads_counts_and_computes_the_rest_itself +tests/oracles/test_oracles_are_independent.py::test_the_reference_model_imports_only_the_standard_library_and_numpy +tests/suites/analytics/test_calibration.py::test_calibration_flags_an_implausible_sequence +tests/suites/analytics/test_calibration.py::test_calibration_pools_over_lengths_for_an_uncovered_one +tests/suites/analytics/test_calibration.py::test_calibration_pvalues_are_uniform_under_its_own_null +tests/suites/analytics/test_calibration.py::test_calibration_quantiles_are_monotone +tests/suites/analytics/test_calibration.py::test_calibration_resolution_floor_is_reported +tests/suites/analytics/test_calibration.py::test_calibration_survival_is_a_valid_tail +tests/suites/analytics/test_calibration.py::test_calibration_takes_no_modelling_parameters +tests/suites/analytics/test_calibration.py::test_calibration_unknown_length_is_conservative +tests/suites/analytics/test_calibration.py::test_robust_method_keeps_its_historical_definition +tests/suites/analytics/test_calibration.py::test_scale_methods_rank_identically_within_a_length +tests/suites/analytics/test_calibration.py::test_scale_score_is_a_false_positive_rate +tests/suites/analytics/test_calibration.py::test_scale_score_is_length_normalised +tests/suites/analytics/test_calibration.py::test_scale_score_matches_the_calibration_arithmetic +tests/suites/analytics/test_calibration.py::test_scale_score_ranks_an_implausible_sequence_above_a_drawn_one +tests/suites/analytics/test_calibration.py::test_scale_score_rate_is_flat_across_lengths +tests/suites/analytics/test_calibration.py::test_scale_score_rejects_a_foreign_calibration +tests/suites/analytics/test_distance.py::test_bridge_cannot_merge_contradictions_or_opposite_directions_or_lengths +tests/suites/analytics/test_distance.py::test_complete_consensus_probability_is_a_separate_event +tests/suites/analytics/test_distance.py::test_complete_sequence_oracle[2-1-weights1] +tests/suites/analytics/test_distance.py::test_complete_sequence_oracle[2-2-weights2] +tests/suites/analytics/test_distance.py::test_complete_sequence_oracle[2-None-weights0] +tests/suites/analytics/test_distance.py::test_complete_sequence_oracle[4-None-weights3] +tests/suites/analytics/test_distance.py::test_deterministic_tie_order +tests/suites/analytics/test_distance.py::test_direction_rule_separates_compatible_overlapping_words +tests/suites/analytics/test_distance.py::test_distinct_live_length_support_and_different_maximum_lengths +tests/suites/analytics/test_distance.py::test_duplicate_coordinates_refused_in_grouping +tests/suites/analytics/test_distance.py::test_empty_explanation_stays_empty +tests/suites/analytics/test_distance.py::test_five_overlapping_windows_form_one_consensus_without_changing_accounting +tests/suites/analytics/test_distance.py::test_global_top_k_leaves_full_distance_unchanged[0] +tests/suites/analytics/test_distance.py::test_global_top_k_leaves_full_distance_unchanged[10000] +tests/suites/analytics/test_distance.py::test_global_top_k_leaves_full_distance_unchanged[1] +tests/suites/analytics/test_distance.py::test_global_top_k_leaves_full_distance_unchanged[7] +tests/suites/analytics/test_distance.py::test_group_probability_unsupported_length_is_not_a_defined_conditional +tests/suites/analytics/test_distance.py::test_identity_swap_thread_invariance_and_reconstruction +tests/suites/analytics/test_distance.py::test_incompatible_models_refused +tests/suites/analytics/test_distance.py::test_invalid_options_refused[kwargs0] +tests/suites/analytics/test_distance.py::test_invalid_options_refused[kwargs1] +tests/suites/analytics/test_distance.py::test_invalid_options_refused[kwargs2] +tests/suites/analytics/test_distance.py::test_invalid_options_refused[kwargs3] +tests/suites/analytics/test_distance.py::test_invalid_options_refused[kwargs4] +tests/suites/analytics/test_distance.py::test_invalid_options_refused[kwargs5] +tests/suites/analytics/test_distance.py::test_invalid_options_refused[kwargs6] +tests/suites/analytics/test_distance.py::test_invalid_options_refused[kwargs7] +tests/suites/analytics/test_distance.py::test_invalid_options_refused[kwargs8] +tests/suites/analytics/test_distance.py::test_invalid_overlap_threshold_refused[0-ValueError] +tests/suites/analytics/test_distance.py::test_invalid_overlap_threshold_refused[1.5-TypeError] +tests/suites/analytics/test_distance.py::test_invalid_overlap_threshold_refused[4-ValueError] +tests/suites/analytics/test_distance.py::test_invalid_overlap_threshold_refused[True-TypeError] +tests/suites/analytics/test_distance.py::test_late_compatible_bridge_merges_previously_separate_groups +tests/suites/analytics/test_distance.py::test_member_enrichment_does_not_imply_complete_consensus_enrichment +tests/suites/analytics/test_distance.py::test_memory_budget_refusal +tests/suites/analytics/test_distance.py::test_overlap_threshold_changes_only_grouping +tests/suites/analytics/test_distance.py::test_single_position_width_does_not_claim_full_sequence_separation +tests/suites/analytics/test_dynamic_programming.py::test_accumulator_max_bounds_the_grid +tests/suites/analytics/test_dynamic_programming.py::test_entropy_matches_brute_force +tests/suites/analytics/test_dynamic_programming.py::test_hill_number_one_is_exp_entropy +tests/suites/analytics/test_dynamic_programming.py::test_hill_number_one_matches_the_limit_from_either_side +tests/suites/analytics/test_dynamic_programming.py::test_hill_number_takes_its_order_as_q +tests/suites/analytics/test_dynamic_programming.py::test_hill_numbers_are_ordered +tests/suites/analytics/test_dynamic_programming.py::test_length_prior_normalises +tests/suites/analytics/test_dynamic_programming.py::test_partition_normalises_by_enumeration +tests/suites/analytics/test_dynamic_programming.py::test_spectrum_identity +tests/suites/analytics/test_dynamic_programming.py::test_spectrum_mean_is_exact_but_the_shape_is_not +tests/suites/analytics/test_dynamic_programming.py::test_spectrum_per_length_sums_to_pooled +tests/suites/analytics/test_dynamic_programming.py::test_spectrum_totals +tests/suites/analytics/test_dynamic_programming.py::test_support_is_all_of_sequence_space +tests/suites/analytics/test_exact_occupancy.py::test_a_batch_builds_no_more_lines_than_one_depth_at_a_time[aa] +tests/suites/analytics/test_exact_occupancy.py::test_a_batch_builds_no_more_lines_than_one_depth_at_a_time[nt] +tests/suites/analytics/test_exact_occupancy.py::test_a_fresh_batch_below_its_rounding_floor_builds_at_most_two_lines[aa] +tests/suites/analytics/test_exact_occupancy.py::test_a_fresh_batch_below_its_rounding_floor_builds_at_most_two_lines[nt] +tests/suites/analytics/test_exact_occupancy.py::test_a_line_carries_its_own_real_power_sum[aa] +tests/suites/analytics/test_exact_occupancy.py::test_a_line_carries_its_own_real_power_sum[nt] +tests/suites/analytics/test_exact_occupancy.py::test_a_lines_file_without_power_sums_still_loads[aa] +tests/suites/analytics/test_exact_occupancy.py::test_a_lines_file_without_power_sums_still_loads[nt] +tests/suites/analytics/test_exact_occupancy.py::test_a_value_below_its_rounding_floor_builds_at_most_one_new_line[aa] +tests/suites/analytics/test_exact_occupancy.py::test_a_value_below_its_rounding_floor_builds_at_most_one_new_line[nt] +tests/suites/analytics/test_exact_occupancy.py::test_a_value_no_allowed_q_can_resolve_builds_no_line[aa] +tests/suites/analytics/test_exact_occupancy.py::test_a_value_no_allowed_q_can_resolve_builds_no_line[nt] +tests/suites/analytics/test_exact_occupancy.py::test_a_value_no_line_can_resolve_stops_the_planner[aa] +tests/suites/analytics/test_exact_occupancy.py::test_a_value_no_line_can_resolve_stops_the_planner[nt] +tests/suites/analytics/test_exact_occupancy.py::test_an_extended_line_matches_a_computed_one[aa] +tests/suites/analytics/test_exact_occupancy.py::test_an_extended_line_matches_a_computed_one[nt] +tests/suites/analytics/test_exact_occupancy.py::test_bounded_value_does_not_pass_for_a_float[aa] +tests/suites/analytics/test_exact_occupancy.py::test_bounded_value_does_not_pass_for_a_float[nt] +tests/suites/analytics/test_exact_occupancy.py::test_deficit_kernel_matches_a_high_precision_reference +tests/suites/analytics/test_exact_occupancy.py::test_equal_depth_cohort[aa] +tests/suites/analytics/test_exact_occupancy.py::test_equal_depth_cohort[nt] +tests/suites/analytics/test_exact_occupancy.py::test_every_line_computed_is_logged[aa] +tests/suites/analytics/test_exact_occupancy.py::test_every_line_computed_is_logged[nt] +tests/suites/analytics/test_exact_occupancy.py::test_frequencies_add_up_to_richness[aa] +tests/suites/analytics/test_exact_occupancy.py::test_frequencies_add_up_to_richness[nt] +tests/suites/analytics/test_exact_occupancy.py::test_frequency[aa] +tests/suites/analytics/test_exact_occupancy.py::test_frequency[nt] +tests/suites/analytics/test_exact_occupancy.py::test_lines_are_reused[aa] +tests/suites/analytics/test_exact_occupancy.py::test_lines_are_reused[nt] +tests/suites/analytics/test_exact_occupancy.py::test_lines_survive_a_round_trip_and_refuse_another_model[aa] +tests/suites/analytics/test_exact_occupancy.py::test_lines_survive_a_round_trip_and_refuse_another_model[nt] +tests/suites/analytics/test_exact_occupancy.py::test_loading_a_longer_line_replaces_the_shorter[aa] +tests/suites/analytics/test_exact_occupancy.py::test_loading_a_longer_line_replaces_the_shorter[nt] +tests/suites/analytics/test_exact_occupancy.py::test_novelty[aa] +tests/suites/analytics/test_exact_occupancy.py::test_novelty[nt] +tests/suites/analytics/test_exact_occupancy.py::test_novelty_below_the_smallest_double_is_zero_and_says_so[aa] +tests/suites/analytics/test_exact_occupancy.py::test_novelty_below_the_smallest_double_is_zero_and_says_so[nt] +tests/suites/analytics/test_exact_occupancy.py::test_novelty_short_of_its_tolerance_still_tells_the_truth[aa] +tests/suites/analytics/test_exact_occupancy.py::test_novelty_short_of_its_tolerance_still_tells_the_truth[nt] +tests/suites/analytics/test_exact_occupancy.py::test_one_draw_or_none_has_no_spread[aa] +tests/suites/analytics/test_exact_occupancy.py::test_one_draw_or_none_has_no_spread[nt] +tests/suites/analytics/test_exact_occupancy.py::test_poisson_richness[aa] +tests/suites/analytics/test_exact_occupancy.py::test_poisson_richness[nt] +tests/suites/analytics/test_exact_occupancy.py::test_power_sums_saved_with_the_lines_are_not_swept_again[aa] +tests/suites/analytics/test_exact_occupancy.py::test_power_sums_saved_with_the_lines_are_not_swept_again[nt] +tests/suites/analytics/test_exact_occupancy.py::test_private_at_depth[aa] +tests/suites/analytics/test_exact_occupancy.py::test_private_at_depth[nt] +tests/suites/analytics/test_exact_occupancy.py::test_private_in_a_cohort[aa] +tests/suites/analytics/test_exact_occupancy.py::test_private_in_a_cohort[nt] +tests/suites/analytics/test_exact_occupancy.py::test_private_in_a_small_cohort[aa] +tests/suites/analytics/test_exact_occupancy.py::test_private_in_a_small_cohort[nt] +tests/suites/analytics/test_exact_occupancy.py::test_rejects_bad_depths[aa] +tests/suites/analytics/test_exact_occupancy.py::test_rejects_bad_depths[nt] +tests/suites/analytics/test_exact_occupancy.py::test_richness[aa] +tests/suites/analytics/test_exact_occupancy.py::test_richness[nt] +tests/suites/analytics/test_exact_occupancy.py::test_richness_corners[aa] +tests/suites/analytics/test_exact_occupancy.py::test_richness_corners[nt] +tests/suites/analytics/test_exact_occupancy.py::test_richness_difference_keeps_its_digits[aa] +tests/suites/analytics/test_exact_occupancy.py::test_richness_difference_keeps_its_digits[nt] +tests/suites/analytics/test_exact_occupancy.py::test_richness_many_depths_at_once[aa] +tests/suites/analytics/test_exact_occupancy.py::test_richness_many_depths_at_once[nt] +tests/suites/analytics/test_exact_occupancy.py::test_richness_many_is_vectorised_and_agrees_with_one_at_a_time[aa] +tests/suites/analytics/test_exact_occupancy.py::test_richness_many_is_vectorised_and_agrees_with_one_at_a_time[nt] +tests/suites/analytics/test_exact_occupancy.py::test_richness_sd_is_the_square_root_with_its_own_bound[aa] +tests/suites/analytics/test_exact_occupancy.py::test_richness_sd_is_the_square_root_with_its_own_bound[nt] +tests/suites/analytics/test_exact_occupancy.py::test_richness_variance[aa-1000000] +tests/suites/analytics/test_exact_occupancy.py::test_richness_variance[aa-100000] +tests/suites/analytics/test_exact_occupancy.py::test_richness_variance[aa-10000] +tests/suites/analytics/test_exact_occupancy.py::test_richness_variance[aa-1000] +tests/suites/analytics/test_exact_occupancy.py::test_richness_variance[aa-2] +tests/suites/analytics/test_exact_occupancy.py::test_richness_variance[aa-60] +tests/suites/analytics/test_exact_occupancy.py::test_richness_variance[aa-7] +tests/suites/analytics/test_exact_occupancy.py::test_richness_variance[nt-1000000] +tests/suites/analytics/test_exact_occupancy.py::test_richness_variance[nt-100000] +tests/suites/analytics/test_exact_occupancy.py::test_richness_variance[nt-10000] +tests/suites/analytics/test_exact_occupancy.py::test_richness_variance[nt-1000] +tests/suites/analytics/test_exact_occupancy.py::test_richness_variance[nt-2] +tests/suites/analytics/test_exact_occupancy.py::test_richness_variance[nt-60] +tests/suites/analytics/test_exact_occupancy.py::test_richness_variance[nt-7] +tests/suites/analytics/test_exact_occupancy.py::test_richness_variance_needs_a_whole_number_of_draws[aa] +tests/suites/analytics/test_exact_occupancy.py::test_richness_variance_needs_a_whole_number_of_draws[nt] +tests/suites/analytics/test_exact_occupancy.py::test_sampling_deficit[aa-0.3] +tests/suites/analytics/test_exact_occupancy.py::test_sampling_deficit[aa-1.0] +tests/suites/analytics/test_exact_occupancy.py::test_sampling_deficit[aa-1000.0] +tests/suites/analytics/test_exact_occupancy.py::test_sampling_deficit[aa-10000.0] +tests/suites/analytics/test_exact_occupancy.py::test_sampling_deficit[aa-60.0] +tests/suites/analytics/test_exact_occupancy.py::test_sampling_deficit[aa-7.0] +tests/suites/analytics/test_exact_occupancy.py::test_sampling_deficit[nt-0.3] +tests/suites/analytics/test_exact_occupancy.py::test_sampling_deficit[nt-1.0] +tests/suites/analytics/test_exact_occupancy.py::test_sampling_deficit[nt-1000.0] +tests/suites/analytics/test_exact_occupancy.py::test_sampling_deficit[nt-10000.0] +tests/suites/analytics/test_exact_occupancy.py::test_sampling_deficit[nt-60.0] +tests/suites/analytics/test_exact_occupancy.py::test_sampling_deficit[nt-7.0] +tests/suites/analytics/test_exact_occupancy.py::test_sampling_deficit_deep_in_n_is_resolved_absolutely[aa] +tests/suites/analytics/test_exact_occupancy.py::test_sampling_deficit_deep_in_n_is_resolved_absolutely[nt] +tests/suites/analytics/test_exact_occupancy.py::test_saving_keeps_the_lines_another_process_saved[aa] +tests/suites/analytics/test_exact_occupancy.py::test_saving_keeps_the_lines_another_process_saved[nt] +tests/suites/analytics/test_exact_occupancy.py::test_saving_over_another_models_lines_refuses[aa] +tests/suites/analytics/test_exact_occupancy.py::test_saving_over_another_models_lines_refuses[nt] +tests/suites/analytics/test_exact_occupancy.py::test_series_power_sums_are_taken_only_when_a_series_needs_them[aa] +tests/suites/analytics/test_exact_occupancy.py::test_series_power_sums_are_taken_only_when_a_series_needs_them[nt] +tests/suites/analytics/test_exact_occupancy.py::test_sharing[aa] +tests/suites/analytics/test_exact_occupancy.py::test_sharing[nt] +tests/suites/analytics/test_exact_occupancy.py::test_the_cache_lock_uses_windows_locking_where_there_is_no_flock +tests/suites/analytics/test_exact_occupancy.py::test_the_cohort_private_sums_agree_with_the_taylor_form[aa] +tests/suites/analytics/test_exact_occupancy.py::test_the_cohort_private_sums_agree_with_the_taylor_form[nt] +tests/suites/analytics/test_exact_occupancy.py::test_the_fingerprint_is_taken_once[aa] +tests/suites/analytics/test_exact_occupancy.py::test_the_fingerprint_is_taken_once[nt] +tests/suites/analytics/test_exact_occupancy.py::test_the_fused_contour_sums_agree_with_the_matrix_form[aa] +tests/suites/analytics/test_exact_occupancy.py::test_the_fused_contour_sums_agree_with_the_matrix_form[nt] +tests/suites/analytics/test_exact_occupancy.py::test_the_power_sums_every_use_needs_are_one_sweep[aa] +tests/suites/analytics/test_exact_occupancy.py::test_the_power_sums_every_use_needs_are_one_sweep[nt] +tests/suites/analytics/test_exact_occupancy.py::test_the_reference_variance_is_the_defining_pair_sum +tests/suites/analytics/test_expected_counts_memory.py::test_a_budget_below_the_working_set_refuses_rather_than_allocating +tests/suites/analytics/test_expected_counts_memory.py::test_the_refusal_is_a_memory_error +tests/suites/analytics/test_expected_counts_memory.py::test_the_working_set_covers_the_answer_it_returned +tests/suites/analytics/test_expected_counts_memory.py::test_the_working_set_does_not_move_with_the_budget +tests/suites/analytics/test_expected_counts_memory.py::test_the_working_set_is_reported_and_is_not_zero +tests/suites/analytics/test_expected_counts_memory.py::test_the_working_set_tracks_the_work +tests/suites/analytics/test_fingerprint.py::test_budget_refusal_precedes_cache_allocation +tests/suites/analytics/test_fingerprint.py::test_cached_probabilities_against_scoring_and_masked_queries[2-weights0] +tests/suites/analytics/test_fingerprint.py::test_cached_probabilities_against_scoring_and_masked_queries[2-weights1] +tests/suites/analytics/test_fingerprint.py::test_cached_probabilities_against_scoring_and_masked_queries[4-weights2] +tests/suites/analytics/test_fingerprint.py::test_hidden_gapped_and_three_way_combinations[3-active1-2-3] +tests/suites/analytics/test_fingerprint.py::test_hidden_gapped_and_three_way_combinations[5-active0-4-2] +tests/suites/analytics/test_fingerprint.py::test_identity_swap_threads_and_unsearched_lengths +tests/suites/analytics/test_fingerprint.py::test_invalid_budgets_refused[kw0] +tests/suites/analytics/test_fingerprint.py::test_invalid_budgets_refused[kw1] +tests/suites/analytics/test_fingerprint.py::test_invalid_budgets_refused[kw2] +tests/suites/analytics/test_fingerprint.py::test_invalid_budgets_refused[kw3] +tests/suites/analytics/test_fingerprint.py::test_invalid_budgets_refused[kw4] +tests/suites/analytics/test_fingerprint.py::test_invalid_budgets_refused[kw5] +tests/suites/analytics/test_fingerprint.py::test_invalid_budgets_refused[kw6] +tests/suites/analytics/test_fingerprint.py::test_invalid_budgets_refused[kw7] +tests/suites/analytics/test_fingerprint.py::test_invalid_budgets_refused[kw8] +tests/suites/analytics/test_fingerprint.py::test_length_only_and_unsupported_observations +tests/suites/analytics/test_fingerprint.py::test_query_budget_and_zero_depth +tests/suites/analytics/test_fingerprint.py::test_shipped_order_amino_acid_gaps +tests/suites/analytics/test_fingerprint.py::test_single_residue_length_with_long_context +tests/suites/analytics/test_liveness.py::test_live_cache_does_not_survive_a_save_and_load +tests/suites/analytics/test_liveness.py::test_live_structure_does_not_depend_on_the_thread_count[1] +tests/suites/analytics/test_liveness.py::test_live_structure_does_not_depend_on_the_thread_count[4] +tests/suites/analytics/test_liveness.py::test_live_structure_does_not_depend_on_the_thread_count[8] +tests/suites/analytics/test_liveness.py::test_live_structure_is_identical_on_every_repeat_call[2] +tests/suites/analytics/test_liveness.py::test_live_structure_is_identical_on_every_repeat_call[3] +tests/suites/analytics/test_liveness.py::test_live_structure_is_identical_on_every_repeat_call[4] +tests/suites/analytics/test_liveness.py::test_live_structure_is_rebuilt_after_every_mutation[2] +tests/suites/analytics/test_liveness.py::test_live_structure_is_rebuilt_after_every_mutation[3] +tests/suites/analytics/test_liveness.py::test_live_structure_is_rebuilt_after_every_mutation[4] +tests/suites/analytics/test_liveness.py::test_topology_matches_an_enumerated_trellis +tests/suites/analytics/test_log_gamma_ratio.py::test_agrees_with_the_numpy_form_it_replaces +tests/suites/analytics/test_log_gamma_ratio.py::test_matches_thirty_digits_everywhere_it_is_used +tests/suites/analytics/test_log_gamma_ratio.py::test_the_shifted_ratio_keeps_its_digits +tests/suites/analytics/test_log_gamma_ratio.py::test_the_shifted_ratio_refuses_a_small_shifted_argument +tests/suites/analytics/test_log_gamma_ratio.py::test_zero_is_zero +tests/suites/analytics/test_memory_budget.py::test_a_reduced_budget_changes_no_answer +tests/suites/analytics/test_memory_budget.py::test_a_refusal_can_be_repeated_without_growing[cgf_jet] +tests/suites/analytics/test_memory_budget.py::test_a_refusal_can_be_repeated_without_growing[entropy] +tests/suites/analytics/test_memory_budget.py::test_a_refusal_can_be_repeated_without_growing[hill_number] +tests/suites/analytics/test_memory_budget.py::test_a_refusal_can_be_repeated_without_growing[length_derivatives] +tests/suites/analytics/test_memory_budget.py::test_a_refusal_can_be_repeated_without_growing[length_marginals] +tests/suites/analytics/test_memory_budget.py::test_a_refusal_can_be_repeated_without_growing[log_mellin] +tests/suites/analytics/test_memory_budget.py::test_a_refusal_can_be_repeated_without_growing[surprisal_moments] +tests/suites/analytics/test_memory_budget.py::test_a_refusal_does_not_move_with_the_machines_load +tests/suites/analytics/test_memory_budget.py::test_every_heavy_entry_point_refuses_under_a_starved_budget[cgf_jet] +tests/suites/analytics/test_memory_budget.py::test_every_heavy_entry_point_refuses_under_a_starved_budget[entropy] +tests/suites/analytics/test_memory_budget.py::test_every_heavy_entry_point_refuses_under_a_starved_budget[hill_number] +tests/suites/analytics/test_memory_budget.py::test_every_heavy_entry_point_refuses_under_a_starved_budget[log_mellin] +tests/suites/analytics/test_memory_budget.py::test_every_heavy_entry_point_refuses_under_a_starved_budget[path_count] +tests/suites/analytics/test_memory_budget.py::test_every_heavy_entry_point_refuses_under_a_starved_budget[path_count_total] +tests/suites/analytics/test_memory_budget.py::test_every_heavy_entry_point_refuses_under_a_starved_budget[positional_marginals] +tests/suites/analytics/test_memory_budget.py::test_every_heavy_entry_point_refuses_under_a_starved_budget[sample] +tests/suites/analytics/test_memory_budget.py::test_every_heavy_entry_point_refuses_under_a_starved_budget[spectrum] +tests/suites/analytics/test_memory_budget.py::test_every_heavy_entry_point_refuses_under_a_starved_budget[surprisal_cumulants] +tests/suites/analytics/test_memory_budget.py::test_every_heavy_entry_point_refuses_under_a_starved_budget[surprisal_moments] +tests/suites/analytics/test_memory_budget.py::test_every_heavy_entry_point_refuses_under_a_starved_budget[surprisal_range] +tests/suites/analytics/test_memory_budget.py::test_every_heavy_entry_point_refuses_under_a_starved_budget[top_k_sequences] +tests/suites/analytics/test_memory_budget.py::test_every_heavy_entry_point_refuses_under_a_starved_budget[topology] +tests/suites/analytics/test_memory_budget.py::test_scoring_one_sequence_is_not_budgeted +tests/suites/analytics/test_memory_budget.py::test_the_refusal_reports_a_figure_in_a_useful_unit +tests/suites/analytics/test_memory_budget.py::test_the_reported_figure_matches_an_independent_calculation +tests/suites/analytics/test_positional_banded.py::test_a_band_differs_from_the_pooled_marginal +tests/suites/analytics/test_positional_banded.py::test_a_length_outside_the_model_is_refused +tests/suites/analytics/test_positional_banded.py::test_a_malformed_band_is_refused_by_name[edges0-ascend strictly] +tests/suites/analytics/test_positional_banded.py::test_a_malformed_band_is_refused_by_name[edges1-ascend strictly] +tests/suites/analytics/test_positional_banded.py::test_a_malformed_band_is_refused_by_name[edges2-define no band] +tests/suites/analytics/test_positional_banded.py::test_a_malformed_band_is_refused_by_name[edges3-must be finite] +tests/suites/analytics/test_positional_banded.py::test_a_malformed_band_is_refused_by_name[edges4-must be finite] +tests/suites/analytics/test_positional_banded.py::test_an_empty_band_is_reported_rather_than_refused +tests/suites/analytics/test_positional_banded.py::test_bands_partition_the_mass +tests/suites/analytics/test_positional_banded.py::test_descending_edges_say_what_a_probability_user_did_wrong +tests/suites/analytics/test_positional_banded.py::test_one_band_over_everything_is_the_pooled_marginal +tests/suites/analytics/test_positional_banded.py::test_resolution_error_reports_a_resolved_grid_as_resolved +tests/suites/analytics/test_positional_banded.py::test_rows_sum_to_one_and_mass_is_reported_per_position +tests/suites/analytics/test_positional_banded.py::test_the_bands_match_a_direct_sum_over_the_support +tests/suites/analytics/test_positional_banded.py::test_the_bands_recombine_into_the_pooled_marginal +tests/suites/analytics/test_positional_banded.py::test_the_counting_measure_counts_the_support +tests/suites/analytics/test_positional_marginals.py::test_a_clamp_outside_the_alphabet_is_refused +tests/suites/analytics/test_positional_marginals.py::test_a_clamp_outside_the_sequence_is_refused +tests/suites/analytics/test_positional_marginals.py::test_a_clamp_the_corpus_never_saw_is_possible_not_an_error +tests/suites/analytics/test_positional_marginals.py::test_a_clamped_position_is_one_hot +tests/suites/analytics/test_positional_marginals.py::test_a_contradictory_clamp_is_refused +tests/suites/analytics/test_positional_marginals.py::test_a_fractional_clamp_position_is_refused +tests/suites/analytics/test_positional_marginals.py::test_a_length_outside_the_model_fails_loudly +tests/suites/analytics/test_positional_marginals.py::test_a_row_absent_from_the_answer_is_exactly_zero +tests/suites/analytics/test_positional_marginals.py::test_an_empty_clamp_is_the_unclamped_answer +tests/suites/analytics/test_positional_marginals.py::test_an_oversized_sweep_is_refused_before_it_allocates +tests/suites/analytics/test_positional_marginals.py::test_asking_for_marginals_does_not_disturb_the_model +tests/suites/analytics/test_positional_marginals.py::test_both_answers_are_bit_identical_across_thread_counts +tests/suites/analytics/test_positional_marginals.py::test_both_answers_stay_exact_at_every_order[2] +tests/suites/analytics/test_positional_marginals.py::test_both_answers_stay_exact_at_every_order[3] +tests/suites/analytics/test_positional_marginals.py::test_both_answers_stay_exact_at_every_order[4] +tests/suites/analytics/test_positional_marginals.py::test_clamp_accepts_residue_indices_as_well_as_characters +tests/suites/analytics/test_positional_marginals.py::test_clamp_probability_matches_the_enumerated_mass +tests/suites/analytics/test_positional_marginals.py::test_clamped_marginals_match_the_conditional_sum[0] +tests/suites/analytics/test_positional_marginals.py::test_clamped_marginals_match_the_conditional_sum[1] +tests/suites/analytics/test_positional_marginals.py::test_clamped_marginals_match_the_conditional_sum[2] +tests/suites/analytics/test_positional_marginals.py::test_clamped_marginals_match_the_conditional_sum[4] +tests/suites/analytics/test_positional_marginals.py::test_clamped_marginals_match_the_conditional_sum[5] +tests/suites/analytics/test_positional_marginals.py::test_clamping_every_position_recovers_that_sequence +tests/suites/analytics/test_positional_marginals.py::test_clamping_several_positions_at_once +tests/suites/analytics/test_positional_marginals.py::test_every_block_sums_to_the_expected_length +tests/suites/analytics/test_positional_marginals.py::test_every_row_sums_to_one_at_every_producible_length +tests/suites/analytics/test_positional_marginals.py::test_expected_counts_match_a_direct_sum_over_the_whole_support +tests/suites/analytics/test_positional_marginals.py::test_expected_counts_reach_every_cell_a_sequence_can_address +tests/suites/analytics/test_positional_marginals.py::test_expected_counts_refuse_a_length_outside_the_model +tests/suites/analytics/test_positional_marginals.py::test_marginals_agree_with_the_nucleotide_alphabet +tests/suites/analytics/test_positional_marginals.py::test_marginals_match_a_direct_sum_over_the_whole_support +tests/suites/analytics/test_positional_marginals.py::test_no_cell_is_zero_and_each_matches_to_its_own_size +tests/suites/analytics/test_positional_marginals.py::test_pooled_expected_counts_sum_to_the_mean_length +tests/suites/analytics/test_positional_marginals.py::test_rows_still_sum_to_one_under_a_clamp +tests/suites/analytics/test_positional_marginals.py::test_the_decoded_columns_rebuild_every_row_index +tests/suites/analytics/test_positional_marginals.py::test_the_marginal_of_a_conserved_position_is_nearly_a_point_mass +tests/suites/analytics/test_positional_marginals.py::test_the_marginals_reproduce_the_partition_function +tests/suites/analytics/test_rules.py::test_a_planted_rule_surfaces_on_a_nucleotide_model +tests/suites/analytics/test_rules.py::test_a_rule_beyond_the_model_order_is_not_representable +tests/suites/analytics/test_rules.py::test_canonicalise_collapses_and_infers_end_anchor +tests/suites/analytics/test_rules.py::test_canonicalise_infers_start_anchor +tests/suites/analytics/test_rules.py::test_canonicalise_keeps_the_per_length_profile +tests/suites/analytics/test_rules.py::test_finds_a_planted_rule +tests/suites/analytics/test_rules.py::test_passenger_position_caps_the_score +tests/suites/analytics/test_rules.py::test_probability_matches_a_fresh_clamp +tests/suites/analytics/test_rules.py::test_rejects_order_below_two +tests/suites/analytics/test_rules.py::test_reproducible_drops_absent_rules +tests/suites/analytics/test_rules.py::test_reproducible_drops_disagreement +tests/suites/analytics/test_rules.py::test_rule_geometry_round_trips +tests/suites/analytics/test_rules.py::test_single_length_rule_is_not_assigned_an_anchor +tests/suites/analytics/test_sample_accounting.py::test_the_charge_counts_the_representation_not_just_the_buffer +tests/suites/analytics/test_sample_accounting.py::test_the_charge_covers_the_true_peak[14-10] +tests/suites/analytics/test_sample_accounting.py::test_the_charge_covers_the_true_peak[27-20] +tests/suites/analytics/test_sample_budget.py::test_a_draw_far_past_the_budget_is_refused +tests/suites/analytics/test_sample_budget.py::test_a_draw_that_fits_still_works +tests/suites/analytics/test_sample_budget.py::test_a_small_draw_survives_a_small_budget +tests/suites/analytics/test_sample_budget.py::test_the_refusal_is_not_a_bare_memory_error +tests/suites/analytics/test_sample_budget.py::test_the_refusal_tracks_the_budget +tests/suites/analytics/test_scale.py::test_a_corruption_raises_the_neighbourhood_ratio +tests/suites/analytics/test_scale.py::test_anchor_profile_is_indexed_on_gaps +tests/suites/analytics/test_scale.py::test_attribute_reports_spellability +tests/suites/analytics/test_scale.py::test_attribution_localises_far_better_than_chance +tests/suites/analytics/test_scale.py::test_channels_are_valid_probabilities +tests/suites/analytics/test_scale.py::test_clean_sequences_have_no_dipole +tests/suites/analytics/test_scale.py::test_index_is_infinite_exactly_when_unspellable +tests/suites/analytics/test_scale.py::test_index_threshold_is_a_false_positive_rate +tests/suites/analytics/test_scale.py::test_profiles_reconstruct_the_score +tests/suites/analytics/test_scale.py::test_two_anchors_remove_the_single_anchor_bias +tests/suites/analytics/test_scale.py::test_uncovered_length_contributes_no_evidence +tests/suites/analytics/test_spectrum.py::test_a_budget_below_one_sweep_is_refused +tests/suites/analytics/test_spectrum.py::test_a_reduced_budget_changes_the_schedule_and_not_the_answer +tests/suites/analytics/test_spectrum.py::test_histogram_pair_populates_the_single_measure_cache +tests/suites/analytics/test_spectrum.py::test_histograms_by_length_match_the_single_length_route +tests/suites/analytics/test_spectrum.py::test_memory_budget_zero_restores_the_default +tests/suites/analytics/test_spectrum.py::test_spectra_by_length_rows_are_bit_identical +tests/suites/analytics/test_spectrum.py::test_spectrum_pair_at_one_length_is_bit_identical +tests/suites/analytics/test_spectrum.py::test_spectrum_pair_auto_spacing_matches_the_single_call +tests/suites/analytics/test_spectrum.py::test_spectrum_pair_is_bit_identical_to_two_calls +tests/suites/analytics/test_spectrum.py::test_spectrum_rejects_a_length_above_max_length +tests/suites/analytics/test_spectrum.py::test_spectrum_rejects_an_unknown_measure +tests/suites/analytics/test_spectrum.py::test_spectrum_rejects_bins_below_two +tests/suites/analytics/test_topology.py::test_topology_counts_live_structure +tests/suites/analytics/test_topology.py::test_topology_edges_bound_the_paths +tests/suites/analytics/test_topology.py::test_topology_is_the_complete_trellis +tests/suites/diversity/test_depth_matched.py::test_an_unseeded_run_records_the_seed_that_reproduces_it +tests/suites/diversity/test_depth_matched.py::test_bad_abundances_are_refused[abundances0-non-integer] +tests/suites/diversity/test_depth_matched.py::test_bad_abundances_are_refused[abundances1-not positive] +tests/suites/diversity/test_depth_matched.py::test_bad_abundances_are_refused[abundances2-non-finite] +tests/suites/diversity/test_depth_matched.py::test_bad_abundances_are_refused[abundances3-shape] +tests/suites/diversity/test_depth_matched.py::test_bad_abundances_are_refused[abundances4-2 repertoires] +tests/suites/diversity/test_depth_matched.py::test_bad_arguments_are_refused +tests/suites/diversity/test_depth_matched.py::test_gate1_the_draws_are_the_reference_draws +tests/suites/diversity/test_depth_matched.py::test_gate2_profiles_are_a_serial_refit_bit_for_bit[abundance] +tests/suites/diversity/test_depth_matched.py::test_gate2_profiles_are_a_serial_refit_bit_for_bit[presence] +tests/suites/diversity/test_depth_matched.py::test_gate3_profiles_match_hill_numbers_to_machine_precision +tests/suites/diversity/test_depth_matched.py::test_no_abundances_means_one_template_per_sequence +tests/suites/diversity/test_depth_matched.py::test_nucleotide_repertoires_work +tests/suites/diversity/test_depth_matched.py::test_one_repertoire_is_a_resample_at_its_own_depth +tests/suites/diversity/test_depth_matched.py::test_sequences_a_fit_would_skip_are_refused[seqs0-more than once] +tests/suites/diversity/test_depth_matched.py::test_sequences_a_fit_would_skip_are_refused[seqs1-longer than max_length] +tests/suites/diversity/test_depth_matched.py::test_sequences_a_fit_would_skip_are_refused[seqs2-does not accept] +tests/suites/diversity/test_depth_matched.py::test_sequences_a_fit_would_skip_are_refused[seqs3-empty] +tests/suites/diversity/test_depth_matched.py::test_the_band_is_named_and_described_as_what_it_is +tests/suites/diversity/test_depth_matched.py::test_the_depth_is_templates_not_distinct_sequences +tests/suites/diversity/test_depth_matched.py::test_the_result_is_frozen_and_is_not_a_number +tests/suites/diversity/test_depth_matched.py::test_the_thread_cap_is_restored_even_when_a_fit_fails +tests/suites/diversity/test_depth_matched.py::test_workers_times_threads_stays_within_the_budget +tests/suites/insights/test_logo.py::test_a_band_differs_from_the_pooled_logo +tests/suites/insights/test_logo.py::test_a_length_the_model_cannot_produce_is_refused +tests/suites/insights/test_logo.py::test_a_malformed_request_is_refused_by_name[kw0-between 0 and 1] +tests/suites/insights/test_logo.py::test_a_malformed_request_is_refused_by_name[kw1-never negative] +tests/suites/insights/test_logo.py::test_a_malformed_request_is_refused_by_name[kw2-finite number of nats] +tests/suites/insights/test_logo.py::test_a_malformed_request_is_refused_by_name[kw3-between 0 and 1] +tests/suites/insights/test_logo.py::test_a_malformed_request_is_refused_by_name[kw4-ascend strictly] +tests/suites/insights/test_logo.py::test_a_malformed_request_is_refused_by_name[kw5-NaN] +tests/suites/insights/test_logo.py::test_a_malformed_request_is_refused_by_name[kw6-never negative] +tests/suites/insights/test_logo.py::test_a_malformed_request_is_refused_by_name[kw7-define no band] +tests/suites/insights/test_logo.py::test_a_malformed_request_is_refused_by_name[kw8-reference_residues] +tests/suites/insights/test_logo.py::test_a_set_reports_its_grid_and_its_shortfall +tests/suites/insights/test_logo.py::test_a_single_band_over_everything_is_still_exact +tests/suites/insights/test_logo.py::test_an_empty_band_is_refused_rather_than_reported_as_conserved +tests/suites/insights/test_logo.py::test_as_dict_is_keyed_by_residue_and_matches_the_heights +tests/suites/insights/test_logo.py::test_asking_for_one_logo_from_several_bands_is_refused +tests/suites/insights/test_logo.py::test_consensus_reads_out_as_a_sequence +tests/suites/insights/test_logo.py::test_edges_in_nats_need_no_conversion +tests/suites/insights/test_logo.py::test_information_is_the_ceiling_less_the_entropy +tests/suites/insights/test_logo.py::test_pseq_above_and_below_are_complementary +tests/suites/insights/test_logo.py::test_surprisal_keywords_select_the_same_sequences_as_the_pseq_ones +tests/suites/insights/test_logo.py::test_the_bands_recombine_into_the_pooled_logo +tests/suites/insights/test_logo.py::test_the_cost_is_reported_before_the_sweep_and_scales_with_bins +tests/suites/insights/test_logo.py::test_the_nucleotide_ceiling_is_log2_of_five_unless_asked_otherwise +tests/suites/insights/test_logo.py::test_the_stack_sums_to_the_information +tests/suites/insights/test_logo.py::test_the_unconditional_logo_is_the_exact_marginal +tests/suites/insights/test_logo.py::test_the_unconditional_set_has_no_grid_at_all +tests/suites/insights/test_logo.py::test_two_conditions_at_once_are_refused[kw0] +tests/suites/insights/test_logo.py::test_two_conditions_at_once_are_refused[kw1] +tests/suites/insights/test_logo.py::test_two_conditions_at_once_are_refused[kw2] +tests/suites/io/test_arrow_scoring.py::test_a_chunked_column +tests/suites/io/test_arrow_scoring.py::test_a_slice_that_starts_mid_buffer +tests/suites/io/test_arrow_scoring.py::test_bit_identical_to_the_string_path[kind0] +tests/suites/io/test_arrow_scoring.py::test_bit_identical_to_the_string_path[kind1] +tests/suites/io/test_arrow_scoring.py::test_log_pseq_parquet_is_the_string_path_over_the_column +tests/suites/io/test_arrow_scoring.py::test_nulls_score_nan +tests/suites/io/test_parquet_streaming.py::test_streaming_and_eager_reads_return_the_same_rows +tests/suites/io/test_parquet_streaming.py::test_the_eager_reader_does_grow_with_the_file +tests/suites/io/test_parquet_streaming.py::test_the_memory_a_read_holds_does_not_grow_with_the_file +tests/suites/io/test_parquet_streaming.py::test_the_opener_asks_for_no_pre_buffering_when_it_can +tests/suites/io/test_parquet_streaming.py::test_the_opener_falls_back_when_pre_buffer_is_unknown +tests/suites/io/test_parquet_streaming.py::test_the_streaming_reader_holds_less_than_the_eager_one +tests/suites/likelihood/test_abundance_spectrum.py::test_a_clone_size_the_model_all_but_forbids_gets_no_z +tests/suites/likelihood/test_abundance_spectrum.py::test_a_count_no_sequence_reached_is_reported_when_asked +tests/suites/likelihood/test_abundance_spectrum.py::test_every_seen_sequence_has_some_count +tests/suites/likelihood/test_abundance_spectrum.py::test_it_agrees_with_an_enumerated_model +tests/suites/likelihood/test_abundance_spectrum.py::test_matches_the_definition_sequence_by_sequence +tests/suites/likelihood/test_abundance_spectrum.py::test_the_counts_add_up_to_the_expected_read_total +tests/suites/likelihood/test_abundance_spectrum.py::test_the_observed_counts_are_the_repertoire +tests/suites/likelihood/test_abundance_spectrum.py::test_the_z_scores_say_where_the_model_is_wrong +tests/suites/likelihood/test_fixed_total.py::test_a_total_at_the_edge_of_the_pattern_is_exact[lams0-edges0-F0-19] +tests/suites/likelihood/test_fixed_total.py::test_a_total_at_the_edge_of_the_pattern_is_exact[lams1-edges1-F1-15] +tests/suites/likelihood/test_fixed_total.py::test_a_total_at_the_edge_of_the_pattern_is_exact[lams2-edges2-F2-17] +tests/suites/likelihood/test_fixed_total.py::test_all_singletons_leave_nothing_to_explain_after_the_set +tests/suites/likelihood/test_fixed_total.py::test_all_singletons_matches_exact_convolution +tests/suites/likelihood/test_fixed_total.py::test_an_unreliable_split_says_so +tests/suites/likelihood/test_fixed_total.py::test_automatic_bins_are_the_default_and_are_reported +tests/suites/likelihood/test_fixed_total.py::test_automatic_bins_rescue_a_repertoire_fixed_bins_cannot_split[20000-big0-1e-07] +tests/suites/likelihood/test_fixed_total.py::test_automatic_bins_rescue_a_repertoire_fixed_bins_cannot_split[50000-big1-1e-09] +tests/suites/likelihood/test_fixed_total.py::test_automatic_bins_rescue_a_repertoire_fixed_bins_cannot_split[60000-big2-1e-08] +tests/suites/likelihood/test_fixed_total.py::test_automatic_bins_rescue_a_repertoire_fixed_bins_cannot_split[80000-big3-1e-10] +tests/suites/likelihood/test_fixed_total.py::test_present_and_reads_matches_exact_convolution[12-10-12] +tests/suites/likelihood/test_fixed_total.py::test_present_and_reads_matches_exact_convolution[12-12-18] +tests/suites/likelihood/test_fixed_total.py::test_present_and_reads_matches_exact_convolution[12-8-13] +tests/suites/likelihood/test_fixed_total.py::test_present_and_reads_matches_exact_convolution[25-14-30] +tests/suites/likelihood/test_fixed_total.py::test_present_and_reads_matches_exact_convolution[25-20-25] +tests/suites/likelihood/test_fixed_total.py::test_present_and_reads_matches_exact_convolution[25-22-22] +tests/suites/likelihood/test_fixed_total.py::test_profile_and_reads_matches_exact_convolution[F0-16] +tests/suites/likelihood/test_fixed_total.py::test_profile_and_reads_matches_exact_convolution[F1-12] +tests/suites/likelihood/test_fixed_total.py::test_profile_and_reads_matches_exact_convolution[F2-20] +tests/suites/likelihood/test_fixed_total.py::test_profile_and_reads_matches_exact_convolution[F3-8] +tests/suites/likelihood/test_fixed_total.py::test_reads_given_set_matches_exact_convolution[11] +tests/suites/likelihood/test_fixed_total.py::test_reads_given_set_matches_exact_convolution[16] +tests/suites/likelihood/test_fixed_total.py::test_reads_given_set_matches_exact_convolution[30] +tests/suites/likelihood/test_fixed_total.py::test_reads_given_set_matches_exact_convolution[8] +tests/suites/likelihood/test_fixed_total.py::test_real_multiplicities_are_repeated_units +tests/suites/likelihood/test_fixed_total.py::test_the_binning_error_is_measured_or_said_to_be_missing +tests/suites/likelihood/test_fixed_total.py::test_the_fixed_N_pieces_multiply_to_the_multinomial +tests/suites/likelihood/test_fixed_total.py::test_the_richness_piece_is_P_n_given_N +tests/suites/likelihood/test_lattice.py::test_a_count_no_unit_can_reach_is_impossible +tests/suites/likelihood/test_lattice.py::test_a_huge_implied_rest_keeps_the_small_counts +tests/suites/likelihood/test_lattice.py::test_a_nearly_unreachable_category_matches_exact_convolution[key0] +tests/suites/likelihood/test_lattice.py::test_a_nearly_unreachable_category_matches_exact_convolution[key1] +tests/suites/likelihood/test_lattice.py::test_a_nearly_unreachable_category_matches_exact_convolution[key2] +tests/suites/likelihood/test_lattice.py::test_a_poisson_binomial_matches_exact_convolution +tests/suites/likelihood/test_lattice.py::test_an_empty_category_is_conditioned_on_exactly +tests/suites/likelihood/test_lattice.py::test_an_implied_rest_agrees_with_an_explicit_one +tests/suites/likelihood/test_lattice.py::test_every_unit_in_one_category_is_exact +tests/suites/likelihood/test_lattice.py::test_real_multiplicities_behave_like_repeated_units +tests/suites/likelihood/test_lattice.py::test_the_counts_must_account_for_every_unit +tests/suites/likelihood/test_lattice.py::test_three_categories_match_exact_convolution +tests/suites/likelihood/test_lattice.py::test_two_nearly_fixed_categories_match_exact_convolution +tests/suites/likelihood/test_repertoire.py::test_a_pattern_that_fixes_the_total_is_conditioned_on_exactly +tests/suites/likelihood/test_repertoire.py::test_a_piece_that_cannot_be_computed_is_a_beam_error +tests/suites/likelihood/test_repertoire.py::test_a_sequence_the_model_cannot_represent_makes_it_impossible +tests/suites/likelihood/test_repertoire.py::test_counts_must_be_positive_integers[-1] +tests/suites/likelihood/test_repertoire.py::test_counts_must_be_positive_integers[0] +tests/suites/likelihood/test_repertoire.py::test_counts_must_be_positive_integers[1.5] +tests/suites/likelihood/test_repertoire.py::test_counts_must_be_positive_integers[nan] +tests/suites/likelihood/test_repertoire.py::test_exactness_is_labelled_on_every_piece +tests/suites/likelihood/test_repertoire.py::test_pair_counts_split_into_shared_and_private +tests/suites/likelihood/test_repertoire.py::test_pair_pieces_sum_to_both_poisson_fields +tests/suites/likelihood/test_repertoire.py::test_pair_sharing_is_counted_and_expected_exactly +tests/suites/likelihood/test_repertoire.py::test_pair_totals_are_the_two_single_totals +tests/suites/likelihood/test_repertoire.py::test_pair_with_a_sequence_it_cannot_represent_is_impossible +tests/suites/likelihood/test_repertoire.py::test_repeated_sequences_are_one_sequence_with_their_reads_added +tests/suites/likelihood/test_repertoire.py::test_richness_and_identity_make_the_presence_probability +tests/suites/likelihood/test_repertoire.py::test_richness_survives_a_spectrum_of_1e24_sequences +tests/suites/likelihood/test_repertoire.py::test_spectrum_atoms_can_be_passed_in +tests/suites/likelihood/test_repertoire.py::test_the_binning_error_vanishes_with_finer_bins +tests/suites/likelihood/test_repertoire.py::test_the_default_profile_bins +tests/suites/likelihood/test_repertoire.py::test_the_entry_points_are_exported_at_the_top_level +tests/suites/likelihood/test_repertoire.py::test_the_enumeration_is_the_whole_support +tests/suites/likelihood/test_repertoire.py::test_the_expected_profile_tightens_with_more_sequences +tests/suites/likelihood/test_repertoire.py::test_the_expected_richness_is_the_direct_sum +tests/suites/likelihood/test_repertoire.py::test_the_likelihood_is_the_multinomial +tests/suites/likelihood/test_repertoire.py::test_the_pieces_multiply_to_the_multinomial +tests/suites/likelihood/test_repertoire.py::test_the_profile_edges_must_start_at_one_and_rise +tests/suites/likelihood/test_repertoire.py::test_the_profile_piece_is_P_F_given_S_and_N +tests/suites/likelihood/test_repertoire.py::test_the_result_is_not_a_number +tests/suites/likelihood/test_repertoire.py::test_the_result_records_the_bins_it_used +tests/suites/likelihood/test_repertoire.py::test_the_two_totals_differ_by_the_chance_of_exactly_n_reads +tests/suites/likelihood/test_ztp_moments.py::test_a_disallowed_bin_takes_no_mass +tests/suites/likelihood/test_ztp_moments.py::test_one_sequence_is_a_distribution +tests/suites/likelihood/test_ztp_moments.py::test_the_expected_bins_match_numpy +tests/suites/likelihood/test_ztp_moments.py::test_the_reductions_match_numpy_with_a_tilt[edges0] +tests/suites/likelihood/test_ztp_moments.py::test_the_reductions_match_numpy_with_a_tilt[edges1] +tests/suites/likelihood/test_ztp_moments.py::test_the_reductions_match_numpy_without_a_tilt_on_the_bins[-1.3-edges0] +tests/suites/likelihood/test_ztp_moments.py::test_the_reductions_match_numpy_without_a_tilt_on_the_bins[-1.3-edges1] +tests/suites/likelihood/test_ztp_moments.py::test_the_reductions_match_numpy_without_a_tilt_on_the_bins[-1.3-edges2] +tests/suites/likelihood/test_ztp_moments.py::test_the_reductions_match_numpy_without_a_tilt_on_the_bins[-1.3-edges3] +tests/suites/likelihood/test_ztp_moments.py::test_the_reductions_match_numpy_without_a_tilt_on_the_bins[0.0-edges0] +tests/suites/likelihood/test_ztp_moments.py::test_the_reductions_match_numpy_without_a_tilt_on_the_bins[0.0-edges1] +tests/suites/likelihood/test_ztp_moments.py::test_the_reductions_match_numpy_without_a_tilt_on_the_bins[0.0-edges2] +tests/suites/likelihood/test_ztp_moments.py::test_the_reductions_match_numpy_without_a_tilt_on_the_bins[0.0-edges3] +tests/suites/likelihood/test_ztp_moments.py::test_the_reductions_match_numpy_without_a_tilt_on_the_bins[0.7-edges0] +tests/suites/likelihood/test_ztp_moments.py::test_the_reductions_match_numpy_without_a_tilt_on_the_bins[0.7-edges1] +tests/suites/likelihood/test_ztp_moments.py::test_the_reductions_match_numpy_without_a_tilt_on_the_bins[0.7-edges2] +tests/suites/likelihood/test_ztp_moments.py::test_the_reductions_match_numpy_without_a_tilt_on_the_bins[0.7-edges3] +tests/suites/math/test_hill_profile.py::test_entropy_base_is_keyword_only +tests/suites/math/test_hill_profile.py::test_entropy_rejects_a_degenerate_base +tests/suites/math/test_hill_profile.py::test_hill_profile_agrees_with_hill_numbers_to_machine_precision[aa] +tests/suites/math/test_hill_profile.py::test_hill_profile_agrees_with_hill_numbers_to_machine_precision[nt] +tests/suites/math/test_hill_profile.py::test_log_mellin_many_is_log_mellin_bit_for_bit[aa] +tests/suites/math/test_hill_profile.py::test_log_mellin_many_is_log_mellin_bit_for_bit[nt] +tests/suites/math/test_hill_profile.py::test_near_one_the_difference_is_conditioning_not_disagreement[aa] +tests/suites/math/test_hill_profile.py::test_near_one_the_difference_is_conditioning_not_disagreement[nt] +tests/suites/math/test_hill_profile.py::test_no_schedule_and_no_company_moves_a_bit[aa] +tests/suites/math/test_hill_profile.py::test_no_schedule_and_no_company_moves_a_bit[nt] +tests/suites/math/test_hill_profile.py::test_orders_are_checked_before_anything_runs[aa] +tests/suites/math/test_hill_profile.py::test_orders_are_checked_before_anything_runs[nt] +tests/suites/math/test_hill_profile.py::test_the_callers_array_is_not_what_the_c_reads[aa] +tests/suites/math/test_hill_profile.py::test_the_callers_array_is_not_what_the_c_reads[nt] +tests/suites/math/test_hill_profile.py::test_the_corners_are_hill_number_bit_for_bit[aa] +tests/suites/math/test_hill_profile.py::test_the_corners_are_hill_number_bit_for_bit[nt] +tests/suites/math/test_hill_profile.py::test_the_profile_is_non_increasing[aa] +tests/suites/math/test_hill_profile.py::test_the_profile_is_non_increasing[nt] +tests/suites/math/test_length_marginals.py::test_length_marginals_decompose_the_totals +tests/suites/math/test_length_marginals.py::test_length_marginals_generated_is_the_length_prior +tests/suites/math/test_length_marginals.py::test_length_mean_surprisal_matches_sampling +tests/suites/math/test_length_marginals.py::test_length_mean_surprisal_reconstructs_the_entropy +tests/suites/math/test_mellin.py::test_derivatives_at_q_zero_is_the_support +tests/suites/math/test_mellin.py::test_derivatives_recover_the_mass_and_the_entropy +tests/suites/math/test_mellin.py::test_diversity_profile_is_ordered +tests/suites/math/test_mellin.py::test_edge_thresholding_is_not_applicable +tests/suites/math/test_mellin.py::test_hill_curve_shape +tests/suites/math/test_mellin.py::test_hill_number_matches_mellin +tests/suites/math/test_mellin.py::test_length_derivatives_q0_is_the_per_length_support +tests/suites/math/test_mellin.py::test_length_derivatives_q1_decomposes_mass_and_entropy +tests/suites/math/test_mellin.py::test_length_derivatives_sum_to_the_pooled_mellin[0.0-0] +tests/suites/math/test_mellin.py::test_length_derivatives_sum_to_the_pooled_mellin[0.5-3] +tests/suites/math/test_mellin.py::test_length_derivatives_sum_to_the_pooled_mellin[1.0-4] +tests/suites/math/test_mellin.py::test_length_derivatives_sum_to_the_pooled_mellin[2.0-2] +tests/suites/math/test_mellin.py::test_length_marginals_are_keyed_by_length +tests/suites/math/test_mellin.py::test_log_mellin_at_one_is_zero +tests/suites/math/test_mellin.py::test_log_mellin_at_zero_is_the_support +tests/suites/math/test_mellin.py::test_log_mellin_many_rejects_a_string +tests/suites/math/test_mellin.py::test_log_mellin_many_rejects_a_two_dimensional_argument +tests/suites/math/test_mellin.py::test_log_mellin_many_rejects_non_finite_orders +tests/suites/math/test_mellin.py::test_log_mellin_matches_brute_force +tests/suites/math/test_mellin.py::test_mellin_matches_log_mellin +tests/suites/math/test_mellin.py::test_moments_mean_is_the_entropy +tests/suites/math/test_mellin.py::test_power_sum_matches_log_mellin +tests/suites/math/test_mellin_complex.py::test_accepts_python_and_numpy_scalars_and_real_input[aa] +tests/suites/math/test_mellin_complex.py::test_accepts_python_and_numpy_scalars_and_real_input[nt] +tests/suites/math/test_mellin_complex.py::test_batch_is_bit_identical_to_single_calls[aa] +tests/suites/math/test_mellin_complex.py::test_batch_is_bit_identical_to_single_calls[nt] +tests/suites/math/test_mellin_complex.py::test_conjugate_order_gives_conjugate_value[aa] +tests/suites/math/test_mellin_complex.py::test_conjugate_order_gives_conjugate_value[nt] +tests/suites/math/test_mellin_complex.py::test_empty_input_gives_empty_output[aa] +tests/suites/math/test_mellin_complex.py::test_empty_input_gives_empty_output[nt] +tests/suites/math/test_mellin_complex.py::test_log_mellin_complex_matches_brute_force[aa] +tests/suites/math/test_mellin_complex.py::test_log_mellin_complex_matches_brute_force[nt] +tests/suites/math/test_mellin_complex.py::test_mellin_barnes_richness_from_complex_orders +tests/suites/math/test_mellin_complex.py::test_order_zero_counts_the_support[aa] +tests/suites/math/test_mellin_complex.py::test_order_zero_counts_the_support[nt] +tests/suites/math/test_mellin_complex.py::test_real_orders_agree_with_the_real_transform[aa] +tests/suites/math/test_mellin_complex.py::test_real_orders_agree_with_the_real_transform[nt] +tests/suites/math/test_mellin_complex.py::test_rejects_non_finite_orders[aa] +tests/suites/math/test_mellin_complex.py::test_rejects_non_finite_orders[nt] +tests/suites/math/test_mellin_complex.py::test_thread_count_does_not_change_the_bits[aa] +tests/suites/math/test_mellin_complex.py::test_thread_count_does_not_change_the_bits[nt] +tests/suites/math/test_mellin_line.py::test_agrees_with_the_exact_reference[aa] +tests/suites/math/test_mellin_line.py::test_agrees_with_the_exact_reference[nt] +tests/suites/math/test_mellin_line.py::test_an_order_does_not_depend_on_the_length_of_the_line[aa] +tests/suites/math/test_mellin_line.py::test_an_order_does_not_depend_on_the_length_of_the_line[nt] +tests/suites/math/test_mellin_line.py::test_calling_contract[aa] +tests/suites/math/test_mellin_line.py::test_calling_contract[nt] +tests/suites/math/test_mellin_line.py::test_matches_brute_force[aa] +tests/suites/math/test_mellin_line.py::test_matches_brute_force[nt] +tests/suites/math/test_mellin_line.py::test_mellin_barnes_richness_on_the_line +tests/suites/math/test_mellin_line.py::test_order_zero_on_the_line_is_the_real_transform[aa] +tests/suites/math/test_mellin_line.py::test_order_zero_on_the_line_is_the_real_transform[nt] +tests/suites/math/test_mellin_line.py::test_threads_and_budget_do_not_change_the_bits[aa] +tests/suites/math/test_mellin_line.py::test_threads_and_budget_do_not_change_the_bits[nt] +tests/suites/math/test_moments.py::test_cgf_derivative_at_zero_is_minus_entropy +tests/suites/math/test_moments.py::test_cgf_is_the_shifted_mellin +tests/suites/math/test_moments.py::test_length_derivatives_q0_still_is_the_per_length_support +tests/suites/math/test_moments.py::test_length_derivatives_q1_still_decomposes_the_entropy +tests/suites/math/test_moments.py::test_length_moments_conditional_mean_matches_length_marginals +tests/suites/math/test_moments.py::test_length_moments_mix_to_the_pooled_moments[0.0] +tests/suites/math/test_moments.py::test_length_moments_mix_to_the_pooled_moments[0.5] +tests/suites/math/test_moments.py::test_length_moments_mix_to_the_pooled_moments[1.0] +tests/suites/math/test_moments.py::test_length_moments_mix_to_the_pooled_moments[2.0] +tests/suites/math/test_moments.py::test_length_moments_share_at_q_one_is_the_length_prior +tests/suites/math/test_moments.py::test_length_moments_share_is_zero_only_at_length_zero +tests/suites/math/test_moments.py::test_surprisal_cumulants_match_moments +tests/suites/math/test_moments.py::test_surprisal_mean_is_the_entropy +tests/suites/math/test_moments.py::test_surprisal_moments_match_brute_force +tests/suites/math/test_moments.py::test_surprisal_variance_matches_sampling +tests/suites/math/test_saddlepoint.py::test_cgf_jet_matches_the_separate_routes +tests/suites/math/test_saddlepoint.py::test_saddlepoint_agrees_with_sampling +tests/suites/math/test_saddlepoint.py::test_saddlepoint_cdf_is_monotone_and_bracketed +tests/suites/math/test_saddlepoint.py::test_saddlepoint_is_exactly_zero_outside_the_support +tests/suites/math/test_saddlepoint.py::test_saddlepoint_reports_non_convergence +tests/suites/math/test_saddlepoint.py::test_saddlepoint_solves_the_right_equation +tests/suites/math/test_saddlepoint.py::test_surprisal_cdf_is_a_distribution +tests/suites/math/test_saddlepoint.py::test_surprisal_distribution_components +tests/suites/math/test_surprisal.py::test_dynamic_range_is_positive +tests/suites/math/test_surprisal.py::test_surprisal_by_depth_finds_the_junction +tests/suites/math/test_surprisal.py::test_surprisal_by_depth_reconstructs_the_mean +tests/suites/math/test_surprisal.py::test_surprisal_range_brackets_every_sequence +tests/suites/math/test_surprisal.py::test_top_sequence_attains_the_minimum_surprisal +tests/suites/mixture/test_brute_force.py::test_entropy_bounds_bracket_the_true_entropy +tests/suites/mixture/test_brute_force.py::test_hill_number_at_q0_matches_the_enumerated_union +tests/suites/mixture/test_brute_force.py::test_hill_numbers_match_direct_summation[weights0-2] +tests/suites/mixture/test_brute_force.py::test_hill_numbers_match_direct_summation[weights0-3] +tests/suites/mixture/test_brute_force.py::test_hill_numbers_match_direct_summation[weights0-4] +tests/suites/mixture/test_brute_force.py::test_hill_numbers_match_direct_summation[weights1-2] +tests/suites/mixture/test_brute_force.py::test_hill_numbers_match_direct_summation[weights1-3] +tests/suites/mixture/test_brute_force.py::test_hill_numbers_match_direct_summation[weights1-4] +tests/suites/mixture/test_brute_force.py::test_inner_product_matches_direct_summation +tests/suites/mixture/test_brute_force.py::test_length_distribution_matches_direct_summation +tests/suites/mixture/test_brute_force.py::test_log_pseq_batch_agrees_with_the_scalar_form +tests/suites/mixture/test_brute_force.py::test_log_pseq_matches_direct_summation[weights0] +tests/suites/mixture/test_brute_force.py::test_log_pseq_matches_direct_summation[weights1] +tests/suites/mixture/test_brute_force.py::test_log_pseq_matches_direct_summation[weights2] +tests/suites/mixture/test_brute_force.py::test_member_weights_within_a_length_match_direct_summation +tests/suites/mixture/test_brute_force.py::test_the_entropy_estimator_converges_on_the_true_value +tests/suites/mixture/test_brute_force.py::test_the_enumeration_is_the_whole_support +tests/suites/mixture/test_brute_force.py::test_the_mixture_pmf_is_a_distribution +tests/suites/mixture/test_brute_force.py::test_three_member_hill_matches_direct_summation +tests/suites/mixture/test_brute_force.py::test_three_way_inner_product_matches_direct_summation +tests/suites/mixture/test_errors.py::test_a_batch_of_all_unspellable_sequences_is_all_minus_infinity +tests/suites/mixture/test_errors.py::test_a_cap_that_is_not_a_power_of_two_still_counts_correctly +tests/suites/mixture/test_errors.py::test_a_ceiling_of_one_is_honoured_rather_than_quietly_raised +tests/suites/mixture/test_errors.py::test_a_length_no_member_produces_has_no_within_length_weights +tests/suites/mixture/test_errors.py::test_a_list_containing_q_equals_one_raises_rather_than_dropping_it +tests/suites/mixture/test_errors.py::test_a_member_index_out_of_range_is_refused[-1] +tests/suites/mixture/test_errors.py::test_a_member_index_out_of_range_is_refused[2] +tests/suites/mixture/test_errors.py::test_a_member_index_out_of_range_is_refused[99] +tests/suites/mixture/test_errors.py::test_a_non_model_member_is_refused_by_position +tests/suites/mixture/test_errors.py::test_a_sample_count_below_two_has_no_standard_error +tests/suites/mixture/test_errors.py::test_a_sequence_outside_the_space_scores_minus_infinity +tests/suites/mixture/test_errors.py::test_a_zero_weight_member_is_allowed_and_contributes_nothing +tests/suites/mixture/test_errors.py::test_a_zero_weight_member_leaves_the_other_members_score_intact +tests/suites/mixture/test_errors.py::test_an_empty_mixture_is_refused +tests/suites/mixture/test_errors.py::test_an_incompatible_mixture_is_catchable_the_broad_ways_too +tests/suites/mixture/test_errors.py::test_every_inexact_order_raises[-1.0] +tests/suites/mixture/test_errors.py::test_every_inexact_order_raises[-2.0] +tests/suites/mixture/test_errors.py::test_every_inexact_order_raises[0.5] +tests/suites/mixture/test_errors.py::test_every_inexact_order_raises[1.0] +tests/suites/mixture/test_errors.py::test_every_inexact_order_raises[1.5] +tests/suites/mixture/test_errors.py::test_every_inexact_order_raises[2.5] +tests/suites/mixture/test_errors.py::test_incompatible_members_are_refused_at_construction[differs0] +tests/suites/mixture/test_errors.py::test_incompatible_members_are_refused_at_construction[differs1] +tests/suites/mixture/test_errors.py::test_incompatible_members_are_refused_at_construction[differs2] +tests/suites/mixture/test_errors.py::test_log_power_sum_refuses_q_zero +tests/suites/mixture/test_errors.py::test_negative_weights_are_refused +tests/suites/mixture/test_errors.py::test_non_finite_weights_are_refused +tests/suites/mixture/test_errors.py::test_q_equals_one_raises_and_names_the_two_honest_paths +tests/suites/mixture/test_errors.py::test_sampling_at_an_exactly_computable_order_is_refused +tests/suites/mixture/test_errors.py::test_the_budget_refusal_is_catchable_the_broad_way_too +tests/suites/mixture/test_errors.py::test_the_classes_are_exported_from_the_package_root +tests/suites/mixture/test_errors.py::test_the_wrong_number_of_weights_is_refused +tests/suites/mixture/test_errors.py::test_there_is_no_flag_that_softens_the_refusal +tests/suites/mixture/test_errors.py::test_weights_are_a_copy +tests/suites/mixture/test_errors.py::test_weights_that_do_not_sum_to_one_are_refused +tests/suites/mixture/test_identities.py::test_a_model_mixed_with_itself_has_the_entropy_it_had +tests/suites/mixture/test_identities.py::test_a_model_mixed_with_itself_reproduces_it[0.0-weights0] +tests/suites/mixture/test_identities.py::test_a_model_mixed_with_itself_reproduces_it[0.0-weights1] +tests/suites/mixture/test_identities.py::test_a_model_mixed_with_itself_reproduces_it[0.0-weights2] +tests/suites/mixture/test_identities.py::test_a_model_mixed_with_itself_reproduces_it[2.0-weights0] +tests/suites/mixture/test_identities.py::test_a_model_mixed_with_itself_reproduces_it[2.0-weights1] +tests/suites/mixture/test_identities.py::test_a_model_mixed_with_itself_reproduces_it[2.0-weights2] +tests/suites/mixture/test_identities.py::test_a_model_mixed_with_itself_reproduces_it[3.0-weights0] +tests/suites/mixture/test_identities.py::test_a_model_mixed_with_itself_reproduces_it[3.0-weights1] +tests/suites/mixture/test_identities.py::test_a_model_mixed_with_itself_reproduces_it[3.0-weights2] +tests/suites/mixture/test_identities.py::test_a_model_mixed_with_itself_reproduces_its_scores +tests/suites/mixture/test_identities.py::test_alpha_is_the_power_mean_of_order_one_minus_q[0.0-arithmetic] +tests/suites/mixture/test_identities.py::test_alpha_is_the_power_mean_of_order_one_minus_q[1.0-geometric] +tests/suites/mixture/test_identities.py::test_alpha_is_the_power_mean_of_order_one_minus_q[2.0-harmonic] +tests/suites/mixture/test_identities.py::test_every_mixture_has_beta_equal_to_one_at_q0 +tests/suites/mixture/test_identities.py::test_far_members_give_beta_equal_to_M_at_q1 +tests/suites/mixture/test_identities.py::test_far_members_give_beta_equal_to_M_at_q2 +tests/suites/mixture/test_identities.py::test_far_members_have_a_tiny_but_real_inner_product +tests/suites/mixture/test_identities.py::test_identical_members_give_beta_equal_to_one[0.0] +tests/suites/mixture/test_identities.py::test_identical_members_give_beta_equal_to_one[2.0] +tests/suites/mixture/test_identities.py::test_identical_members_give_beta_equal_to_one[3.0] +tests/suites/mixture/test_identities.py::test_identical_members_give_beta_equal_to_one_at_q1 +tests/suites/mixture/test_identities.py::test_the_far_fixtures_share_every_string_but_almost_no_mass +tests/suites/mixture/test_identities.py::test_the_naive_arithmetic_mean_would_understate_beta +tests/suites/mixture/test_identities.py::test_three_far_members_give_beta_equal_to_three +tests/suites/mixture/test_kernel.py::test_a_k_way_product_of_one_model_is_its_own_mellin_transform[2] +tests/suites/mixture/test_kernel.py::test_a_k_way_product_of_one_model_is_its_own_mellin_transform[3] +tests/suites/mixture/test_kernel.py::test_a_k_way_product_of_one_model_is_its_own_mellin_transform[4] +tests/suites/mixture/test_kernel.py::test_a_k_way_product_of_one_model_is_its_own_mellin_transform[5] +tests/suites/mixture/test_kernel.py::test_a_k_way_product_of_one_model_is_its_own_mellin_transform[6] +tests/suites/mixture/test_kernel.py::test_a_k_way_product_of_one_model_is_its_own_mellin_transform[7] +tests/suites/mixture/test_kernel.py::test_a_k_way_product_of_one_model_is_its_own_mellin_transform[8] +tests/suites/mixture/test_kernel.py::test_a_tiny_overlap_survives_the_rescaling +tests/suites/mixture/test_kernel.py::test_one_member_sums_to_one +tests/suites/mixture/test_kernel.py::test_self_inner_product_is_one_over_d2_at_order_three +tests/suites/mixture/test_kernel.py::test_self_inner_product_is_one_over_d2_on_the_foundation +tests/suites/mixture/test_kernel.py::test_self_inner_product_is_one_over_d2_on_the_shared_fixture +tests/suites/mixture/test_kernel.py::test_self_inner_product_is_one_over_d2_tiny +tests/suites/mixture/test_kernel.py::test_the_gram_matrix_is_exactly_symmetric +tests/suites/mixture/test_kernel.py::test_the_total_is_the_log_sum_of_the_per_length_terms +tests/suites/mixture/test_many_members.py::test_a_far_pair_reads_as_finite_in_the_log_gram +tests/suites/mixture/test_many_members.py::test_a_mixture_larger_than_the_union_ceiling_still_builds +tests/suites/mixture/test_many_members.py::test_alpha_and_the_entropy_bounds_work_beyond_the_ceiling +tests/suites/mixture/test_many_members.py::test_integer_orders_work_beyond_the_union_ceiling[2.0] +tests/suites/mixture/test_many_members.py::test_integer_orders_work_beyond_the_union_ceiling[3.0] +tests/suites/mixture/test_many_members.py::test_q2_through_the_driver_matches_the_q_tuple_expansion +tests/suites/mixture/test_many_members.py::test_sixty_four_members_still_have_an_exact_union +tests/suites/mixture/test_many_members.py::test_the_exact_union_still_refuses_above_sixty_four +tests/suites/mixture/test_many_members.py::test_the_gram_matrix_equals_the_pairwise_assembly +tests/suites/mixture/test_many_members.py::test_the_gram_matrix_is_exactly_symmetric +tests/suites/mixture/test_many_members.py::test_the_gram_matrix_populates_the_cache +tests/suites/mixture/test_many_members.py::test_the_union_bounds_are_available_at_any_size +tests/suites/mixture/test_power_product.py::test_a_length_below_one_is_refused +tests/suites/mixture/test_power_product.py::test_a_negative_exponent_is_refused +tests/suites/mixture/test_power_product.py::test_a_non_finite_exponent_is_refused +tests/suites/mixture/test_power_product.py::test_a_pair_list_of_the_wrong_shape_is_refused +tests/suites/mixture/test_power_product.py::test_a_pair_naming_a_missing_member_is_refused +tests/suites/mixture/test_power_product.py::test_a_pair_naming_one_member_twice_is_one +tests/suites/mixture/test_power_product.py::test_a_self_pair_has_an_identically_zero_profile +tests/suites/mixture/test_power_product.py::test_a_wrong_number_of_exponents_is_refused +tests/suites/mixture/test_power_product.py::test_a_zero_exponent_drops_the_member_rather_than_zeroing_the_product +tests/suites/mixture/test_power_product.py::test_all_ones_reproduces_the_inner_product_exactly[idx0] +tests/suites/mixture/test_power_product.py::test_all_ones_reproduces_the_inner_product_exactly[idx1] +tests/suites/mixture/test_power_product.py::test_all_ones_reproduces_the_inner_product_exactly[idx2] +tests/suites/mixture/test_power_product.py::test_all_zero_exponents_are_refused +tests/suites/mixture/test_power_product.py::test_an_empty_pair_list_returns_nothing +tests/suites/mixture/test_power_product.py::test_bhattacharyya_is_at_least_the_inner_product +tests/suites/mixture/test_power_product.py::test_bhattacharyya_is_bounded_by_one +tests/suites/mixture/test_power_product.py::test_bhattacharyya_matches_direct_summation +tests/suites/mixture/test_power_product.py::test_bhattacharyya_matrix_fills_the_cache +tests/suites/mixture/test_power_product.py::test_bhattacharyya_matrix_matches_the_pairwise_calls +tests/suites/mixture/test_power_product.py::test_bhattacharyya_of_a_model_with_itself_is_one +tests/suites/mixture/test_power_product.py::test_bhattacharyya_of_a_real_model_with_itself_is_one +tests/suites/mixture/test_power_product.py::test_by_length_matches_direct_summation_within_each_length +tests/suites/mixture/test_power_product.py::test_by_length_sums_to_the_total +tests/suites/mixture/test_power_product.py::test_by_position_sums_to_the_total +tests/suites/mixture/test_power_product.py::test_by_position_total_matches_direct_summation +tests/suites/mixture/test_power_product.py::test_by_position_total_matches_the_by_length_entry +tests/suites/mixture/test_power_product.py::test_exponent_one_is_the_normalisation +tests/suites/mixture/test_power_product.py::test_exponents_are_positional_by_naming_not_by_member_index +tests/suites/mixture/test_power_product.py::test_exponents_default_to_one +tests/suites/mixture/test_power_product.py::test_hellinger_is_a_metric_on_three_models +tests/suites/mixture/test_power_product.py::test_hellinger_of_near_disjoint_models_approaches_one +tests/suites/mixture/test_power_product.py::test_named_pairs_fill_the_cache +tests/suites/mixture/test_power_product.py::test_named_pairs_match_the_matrix +tests/suites/mixture/test_power_product.py::test_one_member_matches_log_mellin[0.25] +tests/suites/mixture/test_power_product.py::test_one_member_matches_log_mellin[0.5] +tests/suites/mixture/test_power_product.py::test_one_member_matches_log_mellin[0.75] +tests/suites/mixture/test_power_product.py::test_one_member_matches_log_mellin[1.5] +tests/suites/mixture/test_power_product.py::test_one_member_matches_log_mellin[2.0] +tests/suites/mixture/test_power_product.py::test_one_member_matches_log_mellin[3.0] +tests/suites/mixture/test_power_product.py::test_one_member_matches_log_mellin_at_order_three[0.5] +tests/suites/mixture/test_power_product.py::test_one_member_matches_log_mellin_at_order_three[1.5] +tests/suites/mixture/test_power_product.py::test_one_member_matches_log_mellin_at_order_three[2.5] +tests/suites/mixture/test_power_product.py::test_pair_matches_direct_summation[exponents0] +tests/suites/mixture/test_power_product.py::test_pair_matches_direct_summation[exponents1] +tests/suites/mixture/test_power_product.py::test_pair_matches_direct_summation[exponents2] +tests/suites/mixture/test_power_product.py::test_pair_matches_direct_summation[exponents3] +tests/suites/mixture/test_power_product.py::test_pair_matches_direct_summation[exponents4] +tests/suites/mixture/test_power_product.py::test_the_dissimilarity_profile_sums_to_a_nonnegative_distance +tests/suites/mixture/test_power_product.py::test_the_profile_does_not_depend_on_member_order +tests/suites/mixture/test_power_product.py::test_triple_matches_direct_summation[exponents0] +tests/suites/mixture/test_power_product.py::test_triple_matches_direct_summation[exponents1] +tests/suites/mixture/test_power_product.py::test_triple_matches_direct_summation[exponents2] +tests/suites/mixture/test_support.py::test_a_member_that_never_made_a_length_keeps_only_its_prior_share +tests/suites/mixture/test_support.py::test_an_impossible_cap_is_refused_and_not_degraded +tests/suites/mixture/test_support.py::test_bounds_only_costs_nothing_and_says_so +tests/suites/mixture/test_support.py::test_d0_cannot_tell_the_pooled_model_from_the_mixture +tests/suites/mixture/test_support.py::test_growing_the_table_gives_the_same_count_as_not_growing +tests/suites/mixture/test_support.py::test_hill_number_at_q0_is_the_union +tests/suites/mixture/test_support.py::test_identical_members_attain_the_lower_bound +tests/suites/mixture/test_support.py::test_members_that_share_almost_no_mass_still_share_every_string +tests/suites/mixture/test_support.py::test_the_growth_path_runs_on_a_model_that_needs_it +tests/suites/mixture/test_support.py::test_the_peak_population_is_reported +tests/suites/mixture/test_support.py::test_the_pooled_model_is_not_any_mixture_of_its_members +tests/suites/mixture/test_support.py::test_the_union_is_what_enumeration_says_it_is +tests/suites/mixture/test_support.py::test_the_union_sits_inside_its_own_bounds +tests/suites/mixture/test_support.py::test_three_member_union_is_what_enumeration_says_it_is +tests/suites/model/test_algebra.py::test_add_accumulates_bookkeeping +tests/suites/model/test_algebra.py::test_add_is_the_inverse_of_subtract +tests/suites/model/test_algebra.py::test_compact_disables_the_count_operations +tests/suites/model/test_algebra.py::test_copy_is_independent +tests/suites/model/test_algebra.py::test_merged_does_not_mutate_either_operand +tests/suites/model/test_algebra.py::test_operand_must_be_a_distinct_edge +tests/suites/model/test_algebra.py::test_subtract_is_additive_inverse +tests/suites/model/test_algebra.py::test_subtract_restores_the_sequence_count +tests/suites/model/test_algebra.py::test_subtract_restores_the_total_weight +tests/suites/model/test_algebra.py::test_without_a_model_equals_an_explicit_subtract +tests/suites/model/test_algebra.py::test_without_rejects_abundances_for_a_model_operand +tests/suites/model/test_algebra.py::test_without_sequences_builds_the_matching_operand +tests/suites/model/test_algebra.py::test_without_sequences_keeps_a_nucleotide_models_alphabet +tests/suites/model/test_build.py::test_a_two_residue_model_exercises_both_position_kinds +tests/suites/model/test_build.py::test_all_identical_sequences_normalise +tests/suites/model/test_build.py::test_degenerate_corpus_matches_the_reference[2] +tests/suites/model/test_build.py::test_degenerate_corpus_matches_the_reference[3] +tests/suites/model/test_build.py::test_degenerate_corpus_matches_the_reference[4] +tests/suites/model/test_build.py::test_length_one_sequences_normalise +tests/suites/model/test_build.py::test_one_length_carries_a_single_sequence +tests/suites/model/test_build.py::test_single_training_sequence_normalises +tests/suites/model/test_cache_accounting.py::test_an_analytic_fills_the_cache_and_memory_bytes_does_not_move +tests/suites/model/test_cache_accounting.py::test_drop_caches_changes_no_result +tests/suites/model/test_cache_accounting.py::test_drop_caches_releases_it +tests/suites/model/test_cache_accounting.py::test_dropping_before_any_analytic_is_safe +tests/suites/model/test_cache_accounting.py::test_dropping_twice_is_safe +tests/suites/model/test_cache_accounting.py::test_the_cache_is_empty_until_an_analytic_runs +tests/suites/model/test_configuration.py::test_a_length_one_model_builds +tests/suites/model/test_configuration.py::test_a_long_model_can_still_be_copied +tests/suites/model/test_configuration.py::test_a_long_model_scores_identically_at_every_thread_count[1] +tests/suites/model/test_configuration.py::test_a_long_model_scores_identically_at_every_thread_count[2] +tests/suites/model/test_configuration.py::test_a_long_model_scores_identically_at_every_thread_count[8] +tests/suites/model/test_configuration.py::test_a_long_nucleotide_model_builds_through_the_facade +tests/suites/model/test_configuration.py::test_an_amino_acid_model_is_still_capped_at_255 +tests/suites/model/test_configuration.py::test_an_unreadable_sequence_is_an_invalid_sequence +tests/suites/model/test_configuration.py::test_c_and_python_defaults_describe_the_same_model +tests/suites/model/test_configuration.py::test_calibration_median_converges_with_the_grid +tests/suites/model/test_configuration.py::test_compact_frees_counts +tests/suites/model/test_configuration.py::test_diversity_profile_carries_entropy_nats +tests/suites/model/test_configuration.py::test_explain_calls_an_unseen_length_producible +tests/suites/model/test_configuration.py::test_explain_reports_the_reason_it_refuses +tests/suites/model/test_configuration.py::test_length_distribution_is_the_prior +tests/suites/model/test_configuration.py::test_log_base_is_range_checked +tests/suites/model/test_configuration.py::test_max_length_can_be_taken_from_the_data +tests/suites/model/test_configuration.py::test_max_length_from_the_data_ignores_sequences_that_would_be_skipped +tests/suites/model/test_configuration.py::test_max_length_from_the_data_reaches_from_dataframe +tests/suites/model/test_configuration.py::test_max_length_from_the_data_stops_at_its_alphabets_ceiling +tests/suites/model/test_configuration.py::test_moment_order_is_range_checked +tests/suites/model/test_configuration.py::test_n_sequences_is_the_ingested_weight +tests/suites/model/test_configuration.py::test_negative_counts_are_refused +tests/suites/model/test_configuration.py::test_out_of_range_configuration_is_refused[kwargs0-order] +tests/suites/model/test_configuration.py::test_out_of_range_configuration_is_refused[kwargs1-order] +tests/suites/model/test_configuration.py::test_out_of_range_configuration_is_refused[kwargs2-max_length] +tests/suites/model/test_configuration.py::test_out_of_range_configuration_is_refused[kwargs3-max_length] +tests/suites/model/test_configuration.py::test_out_of_range_length_is_refused +tests/suites/model/test_configuration.py::test_pgen_diagnostics_measures_properness +tests/suites/model/test_configuration.py::test_pvalue_never_exceeds_one +tests/suites/model/test_configuration.py::test_rejects_bad_order +tests/suites/model/test_configuration.py::test_requires_sequences +tests/suites/model/test_configuration.py::test_scalar_arguments_return_scalars +tests/suites/model/test_configuration.py::test_single_anchor_weights_are_accepted +tests/suites/model/test_configuration.py::test_skips_unusable_sequences +tests/suites/model/test_configuration.py::test_spectrum_bin_floor_is_explained +tests/suites/model/test_configuration.py::test_streaming_builds_refuse_max_length_from_the_data +tests/suites/model/test_configuration.py::test_topology_refuses_length_zero_and_describes_an_unseen_length +tests/suites/model/test_configuration.py::test_unusable_corpus_says_why +tests/suites/model/test_error_reporting.py::test_a_budget_refusal_reports_a_figure_in_a_readable_unit +tests/suites/model/test_error_reporting.py::test_a_build_parameter_too_large_is_refused_not_wrapped +tests/suites/model/test_error_reporting.py::test_a_good_file_that_exceeds_the_budget_is_not_called_corrupt +tests/suites/model/test_error_reporting.py::test_a_write_failure_does_not_report_an_earlier_unrelated_error +tests/suites/model/test_error_reporting.py::test_an_out_of_range_length_is_refused_before_anything_is_sized +tests/suites/model/test_error_reporting.py::test_load_distinguishes_its_failures +tests/suites/model/test_error_reporting.py::test_path_count_total_refuses_an_unfinalized_model +tests/suites/model/test_error_reporting.py::test_the_length_accessors_separate_an_error_from_an_answer +tests/suites/model/test_file_inputs.py::test_atom_mass_is_exactly_one_where_exp_surprisal_is_not +tests/suites/model/test_file_inputs.py::test_atoms_at_one_length_carry_that_length_s_mass +tests/suites/model/test_file_inputs.py::test_coverage_matches_exhaustive_enumeration +tests/suites/model/test_file_inputs.py::test_discovery_curve_evaluates_many_depths_at_once +tests/suites/model/test_file_inputs.py::test_discovery_curve_matches_exhaustive_enumeration +tests/suites/model/test_file_inputs.py::test_discovery_curve_refines_with_the_grid +tests/suites/model/test_file_inputs.py::test_expected_frequency_partitions_the_support +tests/suites/model/test_file_inputs.py::test_expected_richness_at_one_draw_is_the_mass +tests/suites/model/test_file_inputs.py::test_expected_richness_is_monotone_and_bounded +tests/suites/model/test_file_inputs.py::test_histogram_is_cached_not_rebuilt +tests/suites/model/test_file_inputs.py::test_histogram_mean_is_the_entropy +tests/suites/model/test_file_inputs.py::test_histogram_pair_shares_one_grid_and_hits_its_totals +tests/suites/model/test_file_inputs.py::test_histograms_by_length_decompose_the_pooled_spectrum +tests/suites/model/test_file_inputs.py::test_histograms_by_length_respects_max_length +tests/suites/model/test_file_inputs.py::test_log_pseq_chunks_reassembles_the_batch +tests/suites/model/test_file_inputs.py::test_log_pseq_file_fills_a_preallocated_array +tests/suites/model/test_file_inputs.py::test_log_pseq_file_matches_the_batch +tests/suites/model/test_file_inputs.py::test_log_pseq_file_rejects_a_wrong_sized_out +tests/suites/model/test_file_inputs.py::test_log_pseq_parquet_preserves_row_order +tests/suites/model/test_file_inputs.py::test_novelty_is_the_richness_increment +tests/suites/model/test_file_inputs.py::test_pseq_accepts_a_list_and_a_log_flag +tests/suites/model/test_format_compatibility.py::test_a_current_file_round_trips +tests/suites/model/test_format_compatibility.py::test_a_format_9_file_from_the_previous_build_still_loads +tests/suites/model/test_format_compatibility.py::test_a_format_9_file_is_saved_back_byte_for_byte +tests/suites/model/test_format_compatibility.py::test_a_newer_file_asks_for_a_newer_beam +tests/suites/model/test_format_compatibility.py::test_a_short_model_is_still_saved_as_format_9 +tests/suites/model/test_format_compatibility.py::test_an_older_development_file_is_refused_with_the_remedy +tests/suites/model/test_format_compatibility.py::test_not_a_model_file_says_so +tests/suites/model/test_format_compatibility.py::test_the_format_word_decides_before_the_checksum +tests/suites/model/test_generation.py::test_sample_fixed_length +tests/suites/model/test_generation.py::test_sample_frequencies_match_probabilities +tests/suites/model/test_generation.py::test_sample_is_reproducible +tests/suites/model/test_generation.py::test_sample_respects_the_model +tests/suites/model/test_generation.py::test_simulate_is_reproducible +tests/suites/model/test_generation.py::test_simulate_returns_a_simulation_result +tests/suites/model/test_hierarchical_prior.py::test_a_strength_must_be_finite_and_positive[-1.0] +tests/suites/model/test_hierarchical_prior.py::test_a_strength_must_be_finite_and_positive[0.0] +tests/suites/model/test_hierarchical_prior.py::test_a_strength_must_be_finite_and_positive[inf] +tests/suites/model/test_hierarchical_prior.py::test_a_strength_must_be_finite_and_positive[nan] +tests/suites/model/test_hierarchical_prior.py::test_an_unseen_context_in_a_tempered_model_is_tempered_too +tests/suites/model/test_hierarchical_prior.py::test_auto_hands_a_fixed_model_back_to_the_data +tests/suites/model/test_hierarchical_prior.py::test_estimated_strengths_survive_save_and_load +tests/suites/model/test_hierarchical_prior.py::test_every_sequence_is_possible_and_the_total_is_one[False] +tests/suites/model/test_hierarchical_prior.py::test_every_sequence_is_possible_and_the_total_is_one[True] +tests/suites/model/test_hierarchical_prior.py::test_fit_alpha_against_another_repertoire +tests/suites/model/test_hierarchical_prior.py::test_fit_alpha_improves_the_held_out_likelihood +tests/suites/model/test_hierarchical_prior.py::test_fit_alpha_is_repeatable_by_seed +tests/suites/model/test_hierarchical_prior.py::test_fixed_strengths_are_kept_and_reported_as_fixed +tests/suites/model/test_hierarchical_prior.py::test_junk_is_far_less_likely_than_a_cdr3 +tests/suites/model/test_hierarchical_prior.py::test_one_number_sets_every_level +tests/suites/model/test_hierarchical_prior.py::test_one_strength_per_level_or_none +tests/suites/model/test_hierarchical_prior.py::test_set_alpha_is_building_with_that_alpha +tests/suites/model/test_hierarchical_prior.py::test_set_alpha_refuses_without_changing_the_model +tests/suites/model/test_hierarchical_prior.py::test_sparse_and_dense_are_the_same_model_bit_for_bit +tests/suites/model/test_hierarchical_prior.py::test_the_estimate_does_not_depend_on_the_thread_count +tests/suites/model/test_hierarchical_prior.py::test_the_estimated_strengths_maximise_the_evidence +tests/suites/model/test_hierarchical_prior.py::test_the_length_prior_is_the_rule_over_lengths +tests/suites/model/test_hierarchical_prior.py::test_the_strengths_survive_save_and_load +tests/suites/model/test_hierarchical_prior.py::test_the_tables_are_the_rule_applied_to_the_counts[backward] +tests/suites/model/test_hierarchical_prior.py::test_the_tables_are_the_rule_applied_to_the_counts[forward] +tests/suites/model/test_hierarchical_prior.py::test_thinning_needs_integer_read_counts +tests/suites/model/test_hierarchical_prior.py::test_without_alpha_the_strengths_come_from_the_counts +tests/suites/model/test_metadata.py::test_a_caller_s_own_refinalize_still_counts +tests/suites/model/test_metadata.py::test_a_streaming_snapshot_reports_the_time_it_spent +tests/suites/model/test_metadata.py::test_adding_sequences_through_add_carries_their_build_time +tests/suites/model/test_metadata.py::test_build_time_aggregates_across_observe_calls +tests/suites/model/test_metadata.py::test_cells_observed_may_not_be_summed_over_lengths +tests/suites/model/test_metadata.py::test_coverage_grows_with_length_while_the_data_does +tests/suites/model/test_metadata.py::test_coverage_is_a_fraction_and_rows_bound_cells +tests/suites/model/test_metadata.py::test_coverage_is_unavailable_on_a_compacted_model +tests/suites/model/test_metadata.py::test_coverage_measures_observation_not_finiteness +tests/suites/model/test_metadata.py::test_lengths_can_be_skipped +tests/suites/model/test_metadata.py::test_metadata_describes_a_compacted_model +tests/suites/model/test_metadata.py::test_metadata_reports_a_real_creation_time +tests/suites/model/test_metadata.py::test_provenance_is_the_only_thing_two_identical_builds_disagree_on +tests/suites/model/test_metadata.py::test_provenance_survives_a_round_trip +tests/suites/model/test_metadata.py::test_shares_sum_to_one +tests/suites/model/test_metadata.py::test_size_agrees_with_the_accessors +tests/suites/model/test_metadata.py::test_support_is_off_by_default_and_exact_when_asked +tests/suites/model/test_metadata.py::test_the_possible_cell_count_is_what_brute_force_occupies[2] +tests/suites/model/test_metadata.py::test_the_possible_cell_count_is_what_brute_force_occupies[3] +tests/suites/model/test_metadata.py::test_the_possible_cell_count_is_what_brute_force_occupies[4] +tests/suites/model/test_metadata.py::test_the_possible_row_count_is_what_a_sequence_can_reach +tests/suites/model/test_nucleotide.py::test_N_is_a_residue_and_other_iupac_codes_are_not +tests/suites/model/test_nucleotide.py::test_a_configuration_larger_than_the_budget_is_refused +tests/suites/model/test_nucleotide.py::test_a_nucleotide_model_round_trips_through_a_file +tests/suites/model/test_nucleotide.py::test_a_nucleotide_model_trains_and_scores +tests/suites/model/test_nucleotide.py::test_a_smoothed_nucleotide_model_is_still_a_distribution +tests/suites/model/test_nucleotide.py::test_an_amino_acid_model_is_unaffected_by_a_nucleotide_one +tests/suites/model/test_nucleotide.py::test_an_amino_acid_sequence_is_refused_by_a_nucleotide_model +tests/suites/model/test_nucleotide.py::test_an_unknown_alphabet_is_refused_by_name +tests/suites/model/test_nucleotide.py::test_case_is_folded_end_to_end +tests/suites/model/test_nucleotide.py::test_every_order_builds_under_the_prior[4] +tests/suites/model/test_nucleotide.py::test_every_order_builds_under_the_prior[5] +tests/suites/model/test_nucleotide.py::test_every_order_builds_under_the_prior[6] +tests/suites/model/test_nucleotide.py::test_every_order_builds_under_the_prior[7] +tests/suites/model/test_nucleotide.py::test_generation_emits_only_nucleotides +tests/suites/model/test_nucleotide.py::test_python_and_c_resolve_the_same_defaults[aa] +tests/suites/model/test_nucleotide.py::test_python_and_c_resolve_the_same_defaults[nt] +tests/suites/model/test_nucleotide.py::test_the_amino_acid_defaults_did_not_move +tests/suites/model/test_nucleotide.py::test_the_analytics_run_and_agree_with_each_other +tests/suites/model/test_nucleotide.py::test_the_builder_takes_the_alphabet_too +tests/suites/model/test_nucleotide.py::test_the_ceiling_order_builds +tests/suites/model/test_nucleotide.py::test_the_default_order_builds_and_prices_the_unseen +tests/suites/model/test_nucleotide.py::test_the_refusal_names_the_alphabet_it_belongs_to +tests/suites/model/test_nucleotide.py::test_the_refusal_says_what_it_needs_and_what_it_has +tests/suites/model/test_nucleotide.py::test_the_registry_is_served_from_the_c_descriptor +tests/suites/model/test_nucleotide.py::test_the_sequence_column_defaults_to_the_alphabets_own +tests/suites/model/test_nucleotide.py::test_the_two_alphabets_cannot_be_combined +tests/suites/model/test_nucleotide.py::test_top_k_returns_scoreable_sequences +tests/suites/model/test_partition_by_layer.py::test_a_length_the_model_never_saw +tests/suites/model/test_partition_by_layer.py::test_an_empty_sequence_is_refused +tests/suites/model/test_partition_by_layer.py::test_an_unseen_residue_is_finite_and_charged_where_it_sits +tests/suites/model/test_partition_by_layer.py::test_it_agrees_with_a_second_model_of_the_same_corpus +tests/suites/model/test_partition_by_layer.py::test_it_refuses_what_it_cannot_answer +tests/suites/model/test_partition_by_layer.py::test_stacking_k_models_gives_the_matrix +tests/suites/model/test_partition_by_layer.py::test_the_last_entry_is_log_partition_bit_for_bit +tests/suites/model/test_partition_by_layer.py::test_the_shares_sum_back_to_log_z +tests/suites/model/test_partition_by_layer.py::test_the_split_is_not_the_uniform_one +tests/suites/model/test_partition_by_layer.py::test_the_vector_sums_to_log_pseq +tests/suites/model/test_persistence.py::test_a_file_without_the_flag_still_reestimates +tests/suites/model/test_persistence.py::test_a_finalized_model_loads_under_its_stored_strengths +tests/suites/model/test_persistence.py::test_a_long_model_round_trips_with_identical_scores +tests/suites/model/test_persistence.py::test_a_reload_refinalizes_under_the_stored_prior +tests/suites/model/test_persistence.py::test_corrupt_file_is_rejected +tests/suites/model/test_persistence.py::test_round_trip +tests/suites/model/test_posterior.py::test_posterior_at_kappa_zero_is_a_no_op +tests/suites/model/test_posterior.py::test_posterior_closes_on_the_prior_but_never_reaches_it +tests/suites/model/test_posterior.py::test_posterior_leaves_the_model_scoreable +tests/suites/model/test_posterior.py::test_posterior_leaves_the_sequence_counters_alone +tests/suites/model/test_posterior.py::test_posterior_moves_the_model_toward_the_prior +tests/suites/model/test_posterior.py::test_posterior_rejects_bad_operands +tests/suites/model/test_posterior.py::test_with_prior_does_not_mutate_either_operand +tests/suites/model/test_reference_agreement.py::test_nucleotide_partition_matches_reference[2] +tests/suites/model/test_reference_agreement.py::test_nucleotide_partition_matches_reference[3] +tests/suites/model/test_reference_agreement.py::test_nucleotide_partition_matches_reference[4] +tests/suites/model/test_reference_agreement.py::test_nucleotide_path_count_matches_reference +tests/suites/model/test_reference_agreement.py::test_nucleotide_scores_match_reference[2] +tests/suites/model/test_reference_agreement.py::test_nucleotide_scores_match_reference[3] +tests/suites/model/test_reference_agreement.py::test_nucleotide_scores_match_reference[4] +tests/suites/model/test_reference_agreement.py::test_partition_matches_reference[2] +tests/suites/model/test_reference_agreement.py::test_partition_matches_reference[3] +tests/suites/model/test_reference_agreement.py::test_partition_matches_reference[4] +tests/suites/model/test_reference_agreement.py::test_path_count_matches_reference +tests/suites/model/test_reference_agreement.py::test_scores_match_reference[2] +tests/suites/model/test_reference_agreement.py::test_scores_match_reference[3] +tests/suites/model/test_reference_agreement.py::test_scores_match_reference[4] +tests/suites/model/test_runtime.py::test_a_fork_with_nothing_running_is_silent +tests/suites/model/test_runtime.py::test_a_pinned_availability_is_visible_in_the_plan +tests/suites/model/test_runtime.py::test_a_real_fork_after_parallel_work_warns_in_the_child +tests/suites/model/test_runtime.py::test_an_explicit_cap_is_what_the_plan_reports +tests/suites/model/test_runtime.py::test_an_unreadable_thread_count_is_one_rather_than_a_guess +tests/suites/model/test_runtime.py::test_atoms_feed_the_publicness_model +tests/suites/model/test_runtime.py::test_available_cores_never_exceeds_the_cores_present +tests/suites/model/test_runtime.py::test_results_do_not_depend_on_the_thread_count +tests/suites/model/test_runtime.py::test_the_estimate_says_whether_it_measured_the_machine +tests/suites/model/test_runtime.py::test_the_fork_warning_names_the_hang_and_the_remedy +tests/suites/model/test_runtime.py::test_the_fork_warning_survives_warnings_as_errors +tests/suites/model/test_runtime.py::test_the_plan_is_capped_by_the_scaling_ceiling +tests/suites/model/test_runtime.py::test_the_plan_reports_every_input_it_used +tests/suites/model/test_runtime.py::test_thread_cap_round_trips +tests/suites/model/test_runtime.py::test_thread_cap_treats_negative_as_default +tests/suites/model/test_scoring.py::test_abundance_is_replication +tests/suites/model/test_scoring.py::test_an_unobserved_length_takes_its_share_of_the_length_prior +tests/suites/model/test_scoring.py::test_an_unseen_sequence_is_possible_and_ranked_below_what_was_seen +tests/suites/model/test_scoring.py::test_batch_matches_scalar +tests/suites/model/test_scoring.py::test_c_terminus_expert_is_doing_work +tests/suites/model/test_scoring.py::test_explain_returns_each_residues_combined_factor +tests/suites/model/test_scoring.py::test_explain_sums_to_the_score +tests/suites/model/test_scoring.py::test_rejects_non_amino_acid +tests/suites/model/test_scoring.py::test_the_support_is_every_string_whatever_the_data +tests/suites/model/test_sparse.py::test_backward_hoist_is_correct_at_every_order[2] +tests/suites/model/test_sparse.py::test_backward_hoist_is_correct_at_every_order[3] +tests/suites/model/test_sparse.py::test_backward_hoist_is_correct_at_every_order[4] +tests/suites/model/test_sparse.py::test_sparse_add_posterior_without_and_compact_match_dense +tests/suites/model/test_sparse.py::test_sparse_is_bit_identical_to_dense[2-None] +tests/suites/model/test_sparse.py::test_sparse_is_bit_identical_to_dense[3-abundances1] +tests/suites/model/test_sparse.py::test_sparse_is_bit_identical_to_dense[4-abundances2] +tests/suites/model/test_sparse.py::test_sparse_is_the_default_and_dense_is_on_request +tests/suites/model/test_sparse.py::test_sparse_results_are_thread_count_independent +tests/suites/model/test_sparse.py::test_sparse_save_load_and_crc +tests/suites/model/test_sparse.py::test_sparse_single_sequence_occupies_one_cell_per_position +tests/suites/model/test_sparse.py::test_sparse_subtract_shrinks_and_copy_is_independent +tests/suites/model/test_streaming.py::test_builder_carries_the_prior_strengths +tests/suites/model/test_streaming.py::test_builder_is_byte_identical_to_a_one_shot_build +tests/suites/model/test_streaming.py::test_builder_is_spent_after_build +tests/suites/model/test_streaming.py::test_builder_rejects_mismatched_abundances +tests/suites/model/test_streaming.py::test_builder_snapshot_is_independent_of_later_batches +tests/suites/model/test_streaming.py::test_builder_tracks_its_running_totals +tests/suites/model/test_streaming.py::test_from_dataframe_matches_a_direct_build +tests/suites/model/test_streaming.py::test_from_dataframe_names_the_missing_column +tests/suites/model/test_streaming.py::test_from_parquet_matches_a_direct_build +tests/suites/model/test_streaming.py::test_from_sequence_file_matches_a_direct_build +tests/suites/model/test_streaming.py::test_from_sequence_file_skips_a_header +tests/suites/model/test_streaming.py::test_from_sequence_file_without_weights +tests/suites/model/test_tempering.py::test_raising_the_exponent_lowers_the_entropy +tests/suites/model/test_tempering.py::test_tempering_at_one_is_the_identity +tests/suites/model/test_tempering.py::test_tempering_reweights_the_support_without_widening_it +tests/suites/model/test_tempering.py::test_the_defining_identity +tests/suites/model/test_tempering.py::test_the_entropy_follows_the_mellin_derivative +tests/suites/model/test_tempering.py::test_the_identity_holds_for_both_storages[False] +tests/suites/model/test_tempering.py::test_the_identity_holds_for_both_storages[True] +tests/suites/model/test_tempering.py::test_the_length_prior_is_the_tilted_share +tests/suites/model/test_tempering.py::test_the_original_is_untouched +tests/suites/model/test_tempering.py::test_the_result_has_no_counts_left +tests/suites/model/test_tempering.py::test_the_support_is_what_the_model_counts +tests/suites/model/test_tempering.py::test_the_tempered_mellin_transform_is_the_original_reparametrised +tests/suites/model/test_tempering.py::test_the_tempered_model_is_a_distribution +tests/suites/model/test_tempering.py::test_what_tempering_refuses +tests/suites/model/test_tempering.py::test_within_one_length_the_ranking_survives +tests/suites/model/test_top_k.py::test_top_k_at_a_fixed_length +tests/suites/model/test_top_k.py::test_top_k_beats_random_draws +tests/suites/model/test_top_k.py::test_top_k_is_exact_against_exhaustive_enumeration +tests/suites/model/test_top_k.py::test_top_k_is_sorted_and_scores_correctly +tests/suites/model/test_top_k.py::test_top_k_more_than_exists +tests/suites/model/test_transition_rows.py::test_budget_refusal_is_diagnosable_and_does_not_change_the_model +tests/suites/model/test_transition_rows.py::test_every_row_matches_the_enumerated_final_law[2-weights0-True-lengths0] +tests/suites/model/test_transition_rows.py::test_every_row_matches_the_enumerated_final_law[2-weights1-False-lengths1] +tests/suites/model/test_transition_rows.py::test_every_row_matches_the_enumerated_final_law[4-weights2-True-lengths2] +tests/suites/model/test_transition_rows.py::test_invalid_indices_are_refused_before_narrowing[-1-0-length] +tests/suites/model/test_transition_rows.py::test_invalid_indices_are_refused_before_narrowing[0-0-length] +tests/suites/model/test_transition_rows.py::test_invalid_indices_are_refused_before_narrowing[1267650600228229401496703205376-0-length] +tests/suites/model/test_transition_rows.py::test_invalid_indices_are_refused_before_narrowing[5--1-position] +tests/suites/model/test_transition_rows.py::test_invalid_indices_are_refused_before_narrowing[5-1267650600228229401496703205376-position] +tests/suites/model/test_transition_rows.py::test_invalid_indices_are_refused_before_narrowing[5-5-position] +tests/suites/model/test_transition_rows.py::test_invalid_indices_are_refused_before_narrowing[5-position8-position] +tests/suites/model/test_transition_rows.py::test_invalid_indices_are_refused_before_narrowing[6-0-length] +tests/suites/model/test_transition_rows.py::test_invalid_indices_are_refused_before_narrowing[length4-0-length] +tests/suites/model/test_transition_rows.py::test_noninteger_indices_are_not_truncated[length-2.0] +tests/suites/model/test_transition_rows.py::test_noninteger_indices_are_not_truncated[length-2.5] +tests/suites/model/test_transition_rows.py::test_noninteger_indices_are_not_truncated[length-2] +tests/suites/model/test_transition_rows.py::test_noninteger_indices_are_not_truncated[length-None] +tests/suites/model/test_transition_rows.py::test_noninteger_indices_are_not_truncated[length-inf] +tests/suites/model/test_transition_rows.py::test_noninteger_indices_are_not_truncated[length-nan] +tests/suites/model/test_transition_rows.py::test_noninteger_indices_are_not_truncated[position-2.0] +tests/suites/model/test_transition_rows.py::test_noninteger_indices_are_not_truncated[position-2.5] +tests/suites/model/test_transition_rows.py::test_noninteger_indices_are_not_truncated[position-2] +tests/suites/model/test_transition_rows.py::test_noninteger_indices_are_not_truncated[position-None] +tests/suites/model/test_transition_rows.py::test_noninteger_indices_are_not_truncated[position-inf] +tests/suites/model/test_transition_rows.py::test_noninteger_indices_are_not_truncated[position-nan] +tests/suites/model/test_transition_rows.py::test_numpy_integer_indices_and_returned_array_ownership +tests/suites/model/test_transition_rows.py::test_shipped_order_aa_rows_match_conditioned_mask_sweeps[2-CA] +tests/suites/model/test_transition_rows.py::test_shipped_order_aa_rows_match_conditioned_mask_sweeps[5-WYAC] +tests/suites/model/test_transition_rows.py::test_streaming_blocks_match_independent_masked_queries +tests/suites/model/test_warnings.py::test_a_default_length_model_does_not_warn +tests/suites/model/test_warnings.py::test_a_long_model_warns_about_the_quadratic_before_building +tests/suites/model/test_warnings.py::test_a_rebuilt_model_does_not_re_warn +tests/suites/model/test_warnings.py::test_data_length_clamps_at_the_cap_and_counts_what_it_dropped +tests/suites/model/test_warnings.py::test_every_way_to_reach_a_long_model_warns[builder] +tests/suites/model/test_warnings.py::test_every_way_to_reach_a_long_model_warns[from_file] +tests/suites/model/test_warnings.py::test_every_way_to_reach_a_long_model_warns[from_sequence_file] +tests/suites/model/test_warnings.py::test_the_warning_is_a_user_warning +tests/suites/model/test_warnings.py::test_the_warning_points_at_the_callers_own_line +tests/suites/model/test_weight_buffers.py::test_a_float64_array_builds_the_same_model_as_a_list +tests/suites/model/test_weight_buffers.py::test_a_list_of_python_floats_is_unchanged +tests/suites/model/test_weight_buffers.py::test_a_memoryview_builds_the_same_model +tests/suites/model/test_weight_buffers.py::test_a_mismatched_buffer_length_is_still_refused +tests/suites/model/test_weight_buffers.py::test_a_non_contiguous_array_still_builds_the_same_model +tests/suites/model/test_weight_buffers.py::test_other_dtypes_still_build_the_same_model[float32] +tests/suites/model/test_weight_buffers.py::test_other_dtypes_still_build_the_same_model[int32] +tests/suites/model/test_weight_buffers.py::test_other_dtypes_still_build_the_same_model[int64] +tests/suites/model/test_weight_buffers.py::test_the_buffer_path_is_actually_taken +tests/suites/pretrained/test_pretrained.py::test_cache_lives_in_local_app_data_on_windows +tests/suites/pretrained/test_pretrained.py::test_damaged_cache_is_fetched_again +tests/suites/pretrained/test_pretrained.py::test_falls_back_to_the_next_mirror +tests/suites/pretrained/test_pretrained.py::test_listed +tests/suites/pretrained/test_pretrained.py::test_loads_exactly_the_published_model +tests/suites/pretrained/test_pretrained.py::test_model_format_matches_what_save_writes +tests/suites/pretrained/test_pretrained.py::test_newer_format_asks_for_an_upgrade +tests/suites/pretrained/test_pretrained.py::test_second_load_needs_no_network +tests/suites/pretrained/test_pretrained.py::test_shipped_registry_is_readable +tests/suites/pretrained/test_pretrained.py::test_the_registry_is_read_as_utf8 +tests/suites/pretrained/test_pretrained.py::test_unknown_name_lists_what_exists +tests/suites/pretrained/test_pretrained.py::test_wrong_bytes_are_refused_and_not_kept +tests/suites/publicness/test_publicness.py::test_aggregate_is_the_multiplicity_weighted_sum_of_atoms +tests/suites/publicness/test_publicness.py::test_closed_form_moments_match_the_pmf +tests/suites/publicness/test_publicness.py::test_depth_binning_is_exact_below_the_bin_count +tests/suites/publicness/test_publicness.py::test_equal_depths_reduce_to_a_binomial +tests/suites/publicness/test_publicness.py::test_explicit_and_integer_bin_edges +tests/suites/publicness/test_publicness.py::test_far_tail_does_not_floor_under_huge_multiplicities +tests/suites/publicness/test_publicness.py::test_grouped_counts_match_independent_calls_including_tiny_atoms +tests/suites/publicness/test_publicness.py::test_grouped_counts_validate_groups +tests/suites/publicness/test_publicness.py::test_mass_check_fails_loudly_when_the_window_is_too_narrow +tests/suites/publicness/test_publicness.py::test_matches_bruteforce_dp_convolution[0.0001] +tests/suites/publicness/test_publicness.py::test_matches_bruteforce_dp_convolution[0.001] +tests/suites/publicness/test_publicness.py::test_matches_bruteforce_dp_convolution[0.01] +tests/suites/publicness/test_publicness.py::test_matches_bruteforce_dp_convolution[0.0] +tests/suites/publicness/test_publicness.py::test_matches_bruteforce_dp_convolution[0.1] +tests/suites/publicness/test_publicness.py::test_matches_bruteforce_dp_convolution[0.5] +tests/suites/publicness/test_publicness.py::test_matches_bruteforce_dp_convolution[0.9] +tests/suites/publicness/test_publicness.py::test_matches_bruteforce_dp_convolution[1.0] +tests/suites/publicness/test_publicness.py::test_matches_bruteforce_dp_convolution[1e-06] +tests/suites/publicness/test_publicness.py::test_matches_bruteforce_dp_convolution[1e-09] +tests/suites/publicness/test_publicness.py::test_moments_are_vectorised +tests/suites/publicness/test_publicness.py::test_pickle_path_survives_the_module_split +tests/suites/publicness/test_publicness.py::test_pmf_is_normalised +tests/suites/publicness/test_publicness.py::test_probability_zero_and_one_are_deltas +tests/suites/publicness/test_publicness.py::test_publicness_accepts_coarse_levels +tests/suites/publicness/test_publicness.py::test_publicness_conserves_the_spectrum +tests/suites/publicness/test_publicness.py::test_publicness_matches_a_direct_atom_sum +tests/suites/publicness/test_publicness.py::test_publicness_rises_with_depth +tests/suites/publicness/test_publicness.py::test_rejects_a_transform_too_short_to_hold_the_cohort +tests/suites/publicness/test_publicness.py::test_rejects_bad_bin_edges +tests/suites/publicness/test_publicness.py::test_rejects_bad_depths[depths0-at least one repertoire] +tests/suites/publicness/test_publicness.py::test_rejects_bad_depths[depths1-non-negative] +tests/suites/publicness/test_publicness.py::test_rejects_bad_depths[depths2-finite] +tests/suites/publicness/test_publicness.py::test_rejects_bad_spectra +tests/suites/publicness/test_publicness.py::test_repr_reports_the_cohort +tests/suites/publicness/test_publicness.py::test_single_repertoire +tests/suites/publicness/test_publicness.py::test_tiny_and_transform_paths_agree_at_the_crossover +tests/suites/publicness/test_publicness.py::test_tiny_atom_level_one_is_not_halved +tests/suites/publicness/test_publicness.py::test_tiny_atoms_do_not_comb_across_odd_levels +tests/suites/publicness/test_publicness.py::test_truncation_survives_a_broad_probability_range +tests/suites/publicness/test_publicness.py::test_zero_depth_repertoires_never_detect +tests/suites/publicness/test_publicness.py::test_zero_multiplicity_atoms_are_dropped +tests/suites/query/test_query.py::test_a_condition_over_the_wrong_alphabet_is_refused +tests/suites/query/test_query.py::test_a_condition_refuses_what_it_cannot_express +tests/suites/query/test_query.py::test_a_condition_that_pins_a_position_is_told_by_that_position +tests/suites/query/test_query.py::test_a_constant_condition_carries_no_information +tests/suites/query/test_query.py::test_a_fresh_condition_selects_everything +tests/suites/query/test_query.py::test_a_functional_of_the_wrong_shape_is_refused +tests/suites/query/test_query.py::test_a_neighbourhood_says_when_the_length_prior_rules_it_out +tests/suites/query/test_query.py::test_a_non_finite_functional_is_refused +tests/suites/query/test_query.py::test_a_query_over_the_memory_budget_is_refused +tests/suites/query/test_query.py::test_a_run_collapses_its_aliases +tests/suites/query/test_query.py::test_an_indicator_expectation_is_the_marginal +tests/suites/query/test_query.py::test_boolean_algebra_matches_enumeration +tests/suites/query/test_query.py::test_builders_narrow_and_do_not_mutate +tests/suites/query/test_query.py::test_conditional_entropy_matches_the_matrix_route +tests/suites/query/test_query.py::test_conditioning_on_the_impossible_is_refused +tests/suites/query/test_query.py::test_conditions_of_different_shape_do_not_combine +tests/suites/query/test_query.py::test_cost_reports_the_ladder +tests/suites/query/test_query.py::test_expected_count_is_the_summed_marginals +tests/suites/query/test_query.py::test_insertions_and_deletions_round_trip +tests/suites/query/test_query.py::test_marginals_and_entropy_match_enumeration +tests/suites/query/test_query.py::test_multiplicity_recovers_the_per_edit_convention +tests/suites/query/test_query.py::test_pair_joint_agrees_with_the_marginals +tests/suites/query/test_query.py::test_position_information_matches_enumeration +tests/suites/query/test_query.py::test_position_information_obeys_its_bounds +tests/suites/query/test_query.py::test_probability_matches_enumeration +tests/suites/query/test_query.py::test_the_automaton_tier_is_visible +tests/suites/query/test_query.py::test_the_information_matrix_obeys_its_identities +tests/suites/query/test_query.py::test_total_correlation_is_the_gap_the_pairs_do_not_see +tests/suites/test_binding_guards.py::test_a_float_order_is_refused_rather_than_truncated +tests/suites/test_binding_guards.py::test_a_negative_order_is_refused +tests/suites/test_binding_guards.py::test_an_order_above_the_domain_is_refused +tests/suites/test_binding_guards.py::test_an_order_past_the_word_is_refused_not_wrapped[18446744073709551616] +tests/suites/test_binding_guards.py::test_an_order_past_the_word_is_refused_not_wrapped[4294967296] +tests/suites/test_binding_guards.py::test_an_order_past_the_word_is_refused_not_wrapped[4294967298] +tests/suites/test_binding_guards.py::test_an_order_past_the_word_is_refused_not_wrapped[8589934592] +tests/suites/test_binding_guards.py::test_an_order_that_fits_is_still_answered +tests/suites/test_binding_guards.py::test_the_facade_bounds_magnitude_not_only_sign +tests/suites/test_binding_guards.py::test_the_top_k_refusal_tracks_the_budget +tests/suites/test_binding_guards.py::test_top_k_refuses_what_will_not_fit +tests/suites/test_binding_guards.py::test_top_k_that_fits_still_runs +tests/suites/test_error_contract.py::test_a_load_failure_is_not_always_an_OSError +tests/suites/test_error_contract.py::test_no_allocation_failure_escapes_the_hierarchy +tests/suites/test_error_contract.py::test_the_guarded_sites_now_say_what_went_wrong +tests/suites/test_error_contract.py::test_the_observed_exception_class_is_unchanged[build over budget] +tests/suites/test_error_contract.py::test_the_observed_exception_class_is_unchanged[entropy on an unfinalized model] +tests/suites/test_error_contract.py::test_the_observed_exception_class_is_unchanged[explain an unreadable sequence] +tests/suites/test_error_contract.py::test_the_observed_exception_class_is_unchanged[facade explain, same input] +tests/suites/test_error_contract.py::test_the_observed_exception_class_is_unchanged[finalize with nothing observed] +tests/suites/test_error_contract.py::test_the_observed_exception_class_is_unchanged[load a file with a bad checksum] +tests/suites/test_error_contract.py::test_the_observed_exception_class_is_unchanged[load a missing file] +tests/suites/test_error_contract.py::test_the_observed_exception_class_is_unchanged[load a non-model file] +tests/suites/test_error_contract.py::test_the_observed_exception_class_is_unchanged[load a truncated file] +tests/suites/test_error_contract.py::test_the_observed_exception_class_is_unchanged[load an unknown format] +tests/suites/test_error_contract.py::test_the_observed_exception_class_is_unchanged[load over budget] +tests/suites/test_error_contract.py::test_the_observed_exception_class_is_unchanged[path_count_total on an unfinalized model] +tests/suites/test_error_contract.py::test_the_observed_exception_class_is_unchanged[positional_marginals over budget] +tests/suites/test_error_contract.py::test_the_observed_exception_class_is_unchanged[sample length not generated] +tests/suites/test_error_contract.py::test_the_observed_exception_class_is_unchanged[save to a full device] +tests/suites/test_error_contract.py::test_the_observed_exception_class_is_unchanged[subtract across alphabets] +tests/suites/test_error_contract.py::test_the_observed_exception_class_is_unchanged[topology length out of range] +tests/suites/test_error_contract.py::test_the_query_facade_narrows_builtins_to_its_own_classes diff --git a/verification/baseline/pytest_cases.txt b/verification/baseline/pytest_cases.txt index 721c5edc..8b60b827 100644 --- a/verification/baseline/pytest_cases.txt +++ b/verification/baseline/pytest_cases.txt @@ -1014,6 +1014,7 @@ tests/suites/model/test_reference_agreement.py::test_scores_match_reference[2] tests/suites/model/test_reference_agreement.py::test_scores_match_reference[3] tests/suites/model/test_reference_agreement.py::test_scores_match_reference[4] tests/suites/model/test_runtime.py::test_a_fork_with_nothing_running_is_silent +tests/suites/model/test_runtime.py::test_a_nesting_environment_does_not_multiply_the_planned_width tests/suites/model/test_runtime.py::test_a_pinned_availability_is_visible_in_the_plan tests/suites/model/test_runtime.py::test_a_real_fork_after_parallel_work_warns_in_the_child tests/suites/model/test_runtime.py::test_an_explicit_cap_is_what_the_plan_reports diff --git a/verification/tests/test_tsan.py b/verification/tests/test_tsan.py new file mode 100644 index 00000000..ddca8baa --- /dev/null +++ b/verification/tests/test_tsan.py @@ -0,0 +1,297 @@ +"""The race detector, and the three settings without which it reports noise. + +`make tsan` builds the suites instrumented; nothing ran them until now, and +running them wrong is worse than not running them. Three settings are +mandatory and none is obvious: + + * Archer must be loaded as an OMPT tool. libomp carries no sanitiser + annotations, so without it TSan sees no happens-before edge between any + two OpenMP threads: every implicit barrier is invisible and every region + whose result somebody later reads reports as a race. Measured on + test_distance alone at 8 threads: 783 reports with Archer off, 0 with it + on. Under GCC/libgomp the same suite gave 1186. A thousand false reports + is worse than no tool. + + * `ignore_noninstrumented_modules=1`, which Archer itself asks for on + startup. Without it the uninstrumented runtime's own internals report. + + * No address-space ceiling. TSan maps shadow memory across the address + space, so under `ulimit -v` it refuses outright: "Program is run with + limited virtual address space, which wouldn't work with ThreadSanitizer + ... setrlimit() failed 22". `verification/bounded` sets exactly that + ceiling, so the instrumented run cannot go through it, and TSan's own + `max_allocation_size_mb` takes over the job the ceiling was there to do. + +The last test here is the one that matters: it proves the detector has teeth +by running a real suite with Archer off and watching the reports appear. A +clean run is only evidence if a dirty one is reachable. +""" +import json +import re +import subprocess +import sys +from pathlib import Path + +import pytest + +ROOT = Path(__file__).resolve().parents[1].parent +RUNNER = ROOT / "tools" / "qa" / "run" +SUITE_DIR = ROOT / "tests" / "native" +TSAN_BINS = ROOT / "build-tsan" / "tests" / "native" + + +def _fake(tmp_path, name="test_env", exit_code=0): + """A stand-in suite that prints the two environment variables and the + address-space limit it was actually given. Printing what the child sees + is the only honest check: a test that read the runner's source would pass + on a runner that built the environment and then dropped it.""" + d = tmp_path / "bin" + d.mkdir(exist_ok=True) + p = d / name + p.write_text("#!/bin/bash\n" + 'echo "TOOL=$OMP_TOOL_LIBRARIES"\n' + 'echo "TSAN_OPTIONS=$TSAN_OPTIONS"\n' + 'echo "ULIMIT_V=$(ulimit -v)"\n' + f"exit {exit_code}\n", encoding="utf-8") + p.chmod(0o755) + return d + + +def _archer(tmp_path): + """A stand-in Archer. The runner only has to find and pass it; loading it + is libomp's business, and a real one would make these tests depend on a + clang install.""" + lib = tmp_path / "libarcher.so" + lib.write_bytes(b"") + return lib + + +def _run(bin_dir, *args): + return subprocess.run([sys.executable, str(RUNNER), "c", + "--bin-dir", str(bin_dir), *args], + capture_output=True, text=True, encoding="utf-8", + cwd=ROOT) + + +def test_the_tsan_mode_loads_archer(tmp_path): + """Without this the run is 783 false reports on one suite.""" + d = _fake(tmp_path) + r = _run(d, "--tsan", "--archer", str(_archer(tmp_path)), "--jobs", "1") + assert f"TOOL={_archer(tmp_path)}" in r.stdout, r.stdout + + +def test_the_tsan_mode_silences_the_uninstrumented_runtime(tmp_path): + """Archer prints this request itself on startup; the runner should not + make someone read the startup banner to learn it.""" + d = _fake(tmp_path) + r = _run(d, "--tsan", "--archer", str(_archer(tmp_path)), "--jobs", "1") + line = next(x for x in r.stdout.splitlines() + if x.startswith("TSAN_OPTIONS=")) + assert "ignore_noninstrumented_modules=1" in line, line + + +def test_the_tsan_mode_does_not_impose_an_address_space_ceiling(tmp_path): + """TSan refuses to start under `ulimit -v`, so the wrapper that every + other run goes through has to be out of this one's way.""" + d = _fake(tmp_path) + r = _run(d, "--tsan", "--archer", str(_archer(tmp_path)), "--jobs", "1") + assert "ULIMIT_V=unlimited" in r.stdout, r.stdout + + +def test_the_tsan_mode_keeps_a_ceiling_on_the_allocator_instead(tmp_path): + """The ceiling exists because BEAM can be asked for tables of hundreds of + GB and Linux grants them lazily, so the failure lands on whatever the OOM + killer picks. Dropping `ulimit -v` without putting anything in its place + would hand that hazard back.""" + d = _fake(tmp_path) + r = _run(d, "--tsan", "--archer", str(_archer(tmp_path)), + "--jobs", "1", "--mem-gb", "7") + line = next(x for x in r.stdout.splitlines() + if x.startswith("TSAN_OPTIONS=")) + assert "max_allocation_size_mb=7168" in line, line + assert "allocator_may_return_null=1" in line, line + + +def test_the_normal_mode_still_imposes_the_ceiling(tmp_path): + """The complement of the two above: the escape is for the instrumented + run only, and a refactor that widened it would be invisible otherwise.""" + d = _fake(tmp_path) + r = _run(d, "--jobs", "1", "--mem-gb", "7") + assert "ULIMIT_V=7340032" in r.stdout, r.stdout + + +def test_the_tsan_mode_refuses_without_archer(tmp_path): + """A missing Archer must stop the run, not start one whose every report + is a barrier artifact. The failure mode this guards is a readable log + full of races that are not there -- which is how a week gets spent.""" + d = _fake(tmp_path) + r = _run(d, "--tsan", "--archer", str(tmp_path / "absent.so"), + "--jobs", "1") + assert r.returncode == 2, f"exit {r.returncode}\n{r.stdout}{r.stderr}" + # A phrase the runner prints, not one argparse would: "unrecognized + # arguments: --archer /tmp/.../absent.so" also contains "archer", so + # matching that word would make this test pass before the mode exists. + assert "no Archer at" in (r.stdout + r.stderr), r.stdout + r.stderr + assert "TOOL=" not in r.stdout, "the suite ran anyway" + + +def test_a_race_report_is_not_reported_as_a_failed_assertion(tmp_path): + """TSan exits 66 when it reported something. An assertion failure exits + 1. Calling both "failed" sends someone hunting a broken test case when + the test case is fine and the library is not.""" + d = _fake(tmp_path, exit_code=66) + r = _run(d, "--tsan", "--archer", str(_archer(tmp_path)), "--jobs", "1") + assert r.returncode != 0 + assert "RACES" in r.stdout, r.stdout + assert "1 with races" in r.stdout or "races: 1" in r.stdout, r.stdout + + +def test_the_json_counts_the_reports_per_suite(tmp_path): + """A count per suite is what makes a second run comparable. The headline + number of this work is 783 -> 0 on one suite; that only means something + because both were counted the same way.""" + d = _fake(tmp_path, exit_code=66) + out = tmp_path / "results.json" + r = _run(d, "--tsan", "--archer", str(_archer(tmp_path)), "--jobs", "1", + "--json", str(out)) + assert out.exists(), r.stdout + r.stderr + data = json.loads(out.read_text(encoding="utf-8")) + assert data["conditions"]["tsan"] is True + assert "reports" in data["suites"][0], data["suites"][0] + + +def test_the_instrumented_build_enables_avx(): + """-mavx is not an optimisation. src/native/math/vtrig.c passes a 32-byte + vector by value to a static helper, which clang reports as an ABI change + when AVX is off. While target_clones was in play that was a hard error -- + the default clone cannot satisfy it, and __attribute__((always_inline)) + does not help, the check being in the frontend before inlining -- and it + is why the flag went in. Now that BEAM_TSAN turns the clones off it is a + -Wpsabi warning instead, so the flag is kept for two smaller reasons: the + instrumented build makes that call with the same vector ABI as the + shipping build, and two warnings per build stay out of a log where a new + warning should stand out.""" + makefile = re.sub(r"\\\n\s*", " ", + (ROOT / "Makefile").read_text(encoding="utf-8")) + recipe = re.search(r"^tsan:.*?(?=^\w|\Z)", makefile, + re.MULTILINE | re.DOTALL) + assert recipe, "no tsan target in the Makefile" + assert re.search(r"SANFLAGS=\"[^\"]*-mavx", recipe.group(0)), \ + "the tsan recipe does not pass -mavx; vtrig.c will not compile" + + +def _makefile() -> str: + return re.sub(r"\\\n\s*", " ", + (ROOT / "Makefile").read_text(encoding="utf-8")) + + +def _tsan_excluded() -> set[str]: + line = re.search(r"TSAN_EXCLUDE\s*:?=([^\n]*)", _makefile()) + assert line, "no TSAN_EXCLUDE in the Makefile" + return set(line.group(1).split()) + + +def test_multiversioned_code_is_single_versioned_under_the_sanitiser(): + """`target_clones` makes the compiler emit an IFUNC resolver, and the + dynamic loader calls it during startup relocation -- before the TSan + runtime has initialised. Clang instruments the resolver too, so + __tsan_func_entry runs against uninitialised state and the process dies + inside ld.so, before main, printing nothing and exiting 139. + + Nine of the 35 suites died exactly that way, and the empty log is what + makes this worth a tripwire: there is no message to search for, no stack + without a debugger, and the next person to add a multiversioned function + would meet it again from scratch. The guard belongs on the attribute, so + it travels with the thing that causes it.""" + offenders = [] + for source in sorted((ROOT / "src").rglob("*.c")): + lines = source.read_text(encoding="utf-8").splitlines() + for n, line in enumerate(lines): + if "target_clones" not in line: + continue + guard = next((lines[m] for m in range(n - 1, max(-1, n - 8), -1) + if lines[m].lstrip().startswith("#if")), "") + if "BEAM_TSAN" not in guard: + offenders.append(f"{source.relative_to(ROOT)}:{n + 1} " + f"guarded by {guard.strip() or '(nothing)'}") + assert not offenders, \ + "these will crash the instrumented build inside ld.so:\n " + \ + "\n ".join(offenders) + + +def test_suites_that_measure_the_allocator_are_not_instrumented(): + """TSan replaces the allocator and maps shadow memory several times the + heap, so an assertion about resident memory or about glibc's mmap + threshold measures the sanitiser rather than BEAM. Both allocator suites + do precisely that -- one failed at "resident memory is many times the + model's own size", the other at "the allocator policy did not reach this + binary" -- and a suite that cannot pass under instrumentation has to be + excluded rather than left to fail, or the run grows a failure everyone + learns to skip over. + + Derived from the sources, not listed here, so a new suite of this kind + forces its own exclusion.""" + excluded = _tsan_excluded() + for source in sorted(SUITE_DIR.glob("test_*.c")): + text = source.read_text(encoding="utf-8") + if re.search(r"statm|VmRSS|mallopt|M_MMAP_THRESHOLD" + r"|beam_applied_mmap_threshold", text): + assert source.stem in excluded, \ + f"{source.name} measures the allocator but is instrumented" + + +@pytest.mark.skipif(not TSAN_BINS.is_dir(), + reason="no build-tsan; run `make tsan` first") +def test_every_instrumented_suite_gets_as_far_as_its_own_main(): + """The cheapest possible check, and the one that caught the IFUNC crash: + `--list` prints the suite's test names and exits, so it costs + milliseconds while still going through the dynamic relocation where a + load-time crash happens. A suite that cannot reach main reports no + races -- which reads, in a summary, exactly like a suite that has none. + """ + built = sorted(p for p in TSAN_BINS.glob("test_*") if p.is_file()) + assert built, "build-tsan exists but holds no suites" + dead = [] + for binary in built: + r = subprocess.run([str(binary), "--list"], capture_output=True, + text=True, encoding="utf-8", errors="replace", + timeout=120) + if r.returncode != 0: + dead.append(f"{binary.name} exit {r.returncode} " + f"({len(r.stdout)} bytes of output)") + assert not dead, "instrumented suites that never reach main:\n " + \ + "\n ".join(dead) + + +@pytest.mark.skipif(not TSAN_BINS.is_dir(), + reason="no build-tsan; run `make tsan` first") +def test_archer_is_what_makes_a_clean_run_mean_anything(): + """The teeth of every other test here. A clean instrumented run proves + nothing unless a dirty one is reachable from the same binary, and the + only difference between the two is whether Archer was loaded. An idle + machine and a dead code path produce identical output; so do a race-free + library and a detector that was never attached.""" + suite = next((p for p in sorted(TSAN_BINS.glob("test_*")) + if p.name == "test_distance"), None) + if suite is None: + pytest.skip("test_distance not among the instrumented suites") + + def reports(archer: bool) -> int: + env = {"OMP_NUM_THREADS": "8", "PATH": "/usr/bin:/bin", + "TSAN_OPTIONS": "ignore_noninstrumented_modules=1"} + if archer: + found = sorted(Path("/usr/lib").glob("llvm-*/lib/libarcher.so")) + if not found: + pytest.skip("no libarcher.so installed") + env["OMP_TOOL_LIBRARIES"] = str(found[-1]) + r = subprocess.run([str(suite)], capture_output=True, text=True, + encoding="utf-8", errors="replace", env=env, + timeout=900) + return len(re.findall(r"WARNING: ThreadSanitizer", r.stdout + r.stderr)) + + without = reports(archer=False) + assert without > 0, \ + "with Archer off this suite reported nothing, so a clean run with " \ + "Archer on is not evidence of anything" + assert reports(archer=True) == 0, \ + "the instrumented suite reports a race with Archer loaded"