From f71d0ecb92095892a048290973dc78e7287b34c2 Mon Sep 17 00:00:00 2001 From: thomas Date: Sat, 14 Nov 2026 09:34:47 +0200 Subject: [PATCH 1/6] Build an instrumented library without overwriting the real one `build/` was spelled into the Makefile fifteen times, so there was nowhere to put a second build. That matters for a sanitiser: `build/libbeam.a` and the suites beside it are what `verification/check.py` reads, rebuilding them costs about an hour on a loaded box, and an instrumented archive left at that path would be handed to the gate as though it were the shipping library. `BUILD` is now a variable, `make clean` honours it, and `make tsan` sets it to `build-tsan`. `SANFLAGS` is appended to both the compile and the link rather than replacing CFLAGS, because a sanitiser build that restates the flags is how `-mpopcnt` or `-Isrc/native/internal` goes missing from one of them -- and that failure arrives as a wrong answer rather than as a compile error. The optimisation level is deliberately not lowered either: TSan instruments memory accesses, which survive -O2, and an instrumented build that tests different code from the one that ships answers a question nobody asked. `make tsan` requires clang, libomp and Archer, and refuses rather than falling back to GCC. That is not a preference. libgomp carries no sanitiser annotations -- `nm -D libgomp.so.1` finds no `__tsan_*` and no `Annotate*` symbol -- so TSan sees no happens-before edge between any two OpenMP threads, every implicit barrier is invisible, and every region that writes a result somebody later reads is reported as a race. Measured on `test_distance` alone at 8 threads: 1186 reports. 1184 were main-thread-against-worker. The other two were worker-against-worker and were also barrier artifacts, between pool threads reused across different regions -- `advance._omp_fn.0` against `advance._omp_fn.2`. There is no filter that separates a real intra-region race from a barrier-separated one when the tool has no edges at all, so none is shipped here, and the target fails with the apt line that fixes it instead of producing a log that cannot be read. Two suites stay out of the instrumented set: `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. `tests-only` builds every suite without running one, which neither `test` nor `list-tests` does. The wrap-link guard read the literal target `build/tests/native/` out of the Makefile and now reads `$(BUILD)/tests/native/`. The invariant it checks is unchanged; only the spelling moved. --- Makefile | 118 ++++++++++++++++++--- verification/tests/test_wrap_link_guard.py | 5 +- 2 files changed, 107 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index 40f1d18..9c735b9 100644 --- a/Makefile +++ b/Makefile @@ -10,15 +10,34 @@ # wildcards. See build_support/native_sources.txt for why. CC ?= gcc + +# Where objects and binaries land. A variable, not a constant: an instrumented +# build must not overwrite the ordinary one. $(BUILD)/libbeam.a and the suites +# beside it are what verification/check.py reads, rebuilding them costs about +# an hour on a loaded box, and a ThreadSanitizer archive left at that path +# would be handed to the gate as though it were the shipping library. The +# `tsan` target sets this to build-tsan for that reason alone. +BUILD ?= build + +# Appended to both the compile and the link, and empty for an ordinary build. +# A sanitiser needs the same flag in both places. It is a separate variable +# rather than an override of CFLAGS so that an instrumented build ADDS to the +# shipping flags instead of restating them -- restating is how -mpopcnt or +# -Isrc/native/internal goes missing from one build, and that failure arrives +# as a wrong answer rather than as a compile error. +SANFLAGS ?= + +# gcc spells it -fopenmp; clang against libomp needs -fopenmp=libomp. +OMPFLAG ?= -fopenmp CFLAGS = -O2 -Wall -Wextra -std=c11 -mpopcnt -Iinclude -Isrc/native/internal -CFLAGS += -fopenmp -LDLIBS = -lm -fopenmp +CFLAGS += $(OMPFLAG) $(SANFLAGS) +LDLIBS = -lm $(OMPFLAG) $(SANFLAGS) # Strip comments and blank lines from the manifests. read_manifest = $(shell sed -e 's/#.*//' -e '/^[[:space:]]*$$/d' $(1)) SRCS := $(call read_manifest,build_support/native_sources.txt) -OBJS := $(SRCS:%.c=build/%.o) +OBJS := $(SRCS:%.c=$(BUILD)/%.o) DEPS := $(OBJS:.o=.d) # Fail loudly if the manifest names a file that is not there, rather than @@ -28,9 +47,9 @@ ifneq ($(MISSING),) $(error source manifest lists missing file(s): $(MISSING)) endif -all: build/libbeam.a +all: $(BUILD)/libbeam.a -build/libbeam.a: $(OBJS) +$(BUILD)/libbeam.a: $(OBJS) @mkdir -p $(@D) # Deleted before it is created, because `ar rcs` ADDS to an existing archive # rather than replacing it. A source removed from the manifest leaves its @@ -44,13 +63,13 @@ build/libbeam.a: $(OBJS) # The target directory is created per object, so nested source layouts need no # hard-coded directory list here. -build/%.o: %.c +$(BUILD)/%.o: %.c @mkdir -p $(@D) $(CC) $(CFLAGS) -MMD -MP -c $< -o $@ # ── C unit tests ──────────────────────────────────────────────────────────── TEST_SRCS := $(wildcard tests/native/test_*.c) -TEST_BINS := $(TEST_SRCS:tests/native/%.c=build/tests/native/%) +TEST_BINS := $(TEST_SRCS:tests/native/%.c=$(BUILD)/tests/native/%) # tools/qa/run reports every suite and continues past a failure. The loop # this replaces was `for t in $(TEST_BINS); do ./$$t || exit 1; done`, which @@ -74,13 +93,13 @@ list-tests: $(TEST_BINS) # target-specific and must stay that way: --wrap redirects EVERY malloc in the # linked objects to __wrap_malloc, so applying it to a binary that does not # define that symbol fails to link. -build/tests/native/test_model: LDEXTRA = -Wl,--wrap=malloc +$(BUILD)/tests/native/test_model: LDEXTRA = -Wl,--wrap=malloc # The same mechanism used to MEASURE rather than to fail: this test sums what # the allocator actually handed out during one analytic and checks the figure # that analytic reports against it. Nothing else can catch an allocation that # is simply never charged, because the account is otherwise the only witness. -build/tests/native/test_expected_counts_accounting: \ +$(BUILD)/tests/native/test_expected_counts_accounting: \ LDEXTRA = -Wl,--wrap=malloc -Wl,--wrap=calloc -Wl,--wrap=realloc \ -Wl,--wrap=free @@ -105,22 +124,91 @@ HARNESS_SRC := tests/harness/beam_test.c TEST_HDRS := $(wildcard tests/native/*.h tests/harness/*.h \ tests/harness/oracles/*.h) -build/tests/native/%: tests/native/%.c $(HARNESS_SRC) $(TEST_HDRS) build/libbeam.a +$(BUILD)/tests/native/%: tests/native/%.c $(HARNESS_SRC) $(TEST_HDRS) $(BUILD)/libbeam.a @mkdir -p $(@D) $(CC) $(CFLAGS) -Itests/native -Itests/harness $< $(HARNESS_SRC) \ - build/libbeam.a $(LDLIBS) $(LDEXTRA) -o $@ + $(BUILD)/libbeam.a $(LDLIBS) $(LDEXTRA) -o $@ # The harness's own self-test. It fails on purpose, so it is deliberately not # a dependency of `test`, and it lives outside tests/native so that neither # TEST_SRCS nor the gate's inventory can see it. -build/tests/harness/%: tests/harness/%.c $(HARNESS_SRC) $(TEST_HDRS) +$(BUILD)/tests/harness/%: tests/harness/%.c $(HARNESS_SRC) $(TEST_HDRS) @mkdir -p $(@D) $(CC) $(CFLAGS) -Itests/harness $< $(HARNESS_SRC) $(LDLIBS) -o $@ -selftest: build/tests/harness/selftest_outcomes +selftest: $(BUILD)/tests/harness/selftest_outcomes + + +# ── ThreadSanitizer ───────────────────────────────────────────────────────── +# +# `make tsan` builds the library and the suites instrumented, into build-tsan/, +# leaving build/ untouched -- build/libbeam.a is what verification/check.py +# reads, and an instrumented archive left at that path would be handed to the +# gate as though it were the shipping library. +# +# IT MUST BE CLANG, AND libomp, AND ARCHER. This is not a preference, and the +# GCC path was tried first and measured, so that nobody has to try it again: +# +# libgomp carries no sanitiser annotations (`nm -D libgomp.so.1` finds no +# __tsan_* and no Annotate* symbol). TSan therefore sees NO happens-before +# edge between any two OpenMP threads, so every implicit barrier is +# invisible and every region that writes a result someone later reads is +# reported as a race. Measured on test_distance alone, at 8 threads: 1186 +# reports, of which 1184 were main-thread-against-worker and 2 were +# worker-against-worker -- and both of those two were ALSO barrier +# artifacts, between pool threads reused across different regions +# (advance._omp_fn.0 against advance._omp_fn.2). There is no filter that +# separates a real intra-region race from a barrier-separated one when the +# tool has no edges at all, which is why no such filter is shipped here. +# +# Archer is an OMPT tool that inserts exactly those edges. It is in Ubuntu's +# libomp-N-dev (/usr/lib/llvm-N/lib/libarcher.so), so this needs +# `apt install clang-N libomp-N-dev` and nothing built by hand. +# +# The optimisation level is deliberately NOT lowered. TSan instruments memory +# 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 +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_SUITES ?= $(filter-out $(TSAN_EXCLUDE),\ + $(patsubst tests/native/%.c,%,$(TEST_SRCS))) + +# Builds every suite without running one, which `test` and `list-tests` both +# do. The tsan target needs it, and so does anyone bisecting a compile error. +tests-only: $(TEST_BINS) + +# Refuses rather than producing a log that cannot be read. A GCC-built +# instrumented binary runs perfectly well and reports a thousand races that +# are not there; failing here is the difference between no answer and a wrong +# one. +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 " GCC is NOT a fallback -- see the comment above this target."; \ + exit 1; } + @test -f "$(TSAN_ARCHER)" || { \ + echo "make tsan: clang is present but Archer is not ($(TSAN_ARCHER))."; \ + echo " Install it: sudo apt install libomp-$(LLVM_VER)-dev"; \ + 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" \ + OMPFLAG=-fopenmp=libomp \ + $(addprefix build-tsan/tests/native/,$(TSAN_SUITES)) clean: - rm -rf build + rm -rf $(BUILD) -.PHONY: all clean test list-tests selftest +.PHONY: all clean test list-tests selftest tests-only tsan -include $(DEPS) diff --git a/verification/tests/test_wrap_link_guard.py b/verification/tests/test_wrap_link_guard.py index 8329915..1fa8c99 100644 --- a/verification/tests/test_wrap_link_guard.py +++ b/verification/tests/test_wrap_link_guard.py @@ -44,7 +44,10 @@ def test_every_wrapping_suite_names_its_flag_in_the_makefile(): makefile = re.sub(r"\\\n\s*", " ", (ROOT / "Makefile").read_text(encoding="utf-8")) for source, wrapped in _wrap_sources(): - target = f"build/tests/native/{source.stem}" + # Spelled with $(BUILD), not `build`: the directory became a + # variable so that `make tsan` can build instrumented binaries + # without overwriting the ones the gate reads. + target = f"$(BUILD)/tests/native/{source.stem}" block = re.search(re.escape(target) + r":[^\n]*?LDEXTRA([^\n]*)", makefile) assert block, f"{source.name} wraps {sorted(wrapped)} but no "\ From 48eef68f1fd2c304f4ddf80bb5dd94309a2239ec Mon Sep 17 00:00:00 2001 From: thomas Date: Sat, 14 Nov 2026 09:35:02 +0200 Subject: [PATCH 2/6] Count every region that drops the GIL, not just the analytics ones On a clean tree the wiring check printed OK thread plan wiring (29 analytics regions planned, no escapes) A reader takes that for a statement about the library. It was a statement about two files, `analytics_bindings.c` and `common.c`, named in a `PLANNED_BINDINGS` tuple. There are fourteen binding files, and the other twelve hold 40 regions that drop the GIL and resolve no thread plan, so `beam_threads()` falls through to `threads_cap()` -- with no cap set, that is `omp_get_max_threads()`: one thread per core, the default plan.h exists to stop asking for. On this 16-core box with 15 free, `BEAM.parallel_plan()` reports a plan of 8 while `effective_threads()` is 16, so an analytics call runs 8 and `py_observe` runs 16. On the saturated 48-core node it asks for 48, which the design notes measure at 301x worse than serial at half that. `model_bindings.c`'s 14 are the expensive half of the library: observe, finalize, build, load, save, temper, posterior, set_prior, subtract, add and four introspection calls. That is a deferral and not a defect -- decision 9 reads "Query-time calls only, for now; fitting keeps today's behaviour until it is profiled" -- so the 40 are recorded rather than failed. Recording buys what a printed count cannot: a NEW unplanned region fails the gate, so the deferral cannot quietly grow, and wiring one up prints a note asking to be re-recorded. The lesson behind that is `c_symbols.txt`, a baseline with no recorder at all, which drifted by thirty symbols across four merges. Regions are identified by function rather than by line, because a line-numbered baseline churns on every unrelated edit above it and teaches its reader to re-record without reading. The count is 40 and not 41. The scan is a text search, and `mixture_bindings.c` opens with a doc comment explaining what holds across "the `Py_BEGIN_ALLOW_THREADS` region". That sentence counted as a 41st region, attributed to no function at all because it sits above the first one -- the same mistake `public_text_names` already records in this file, where `jet_sweep` matched a prose comment and was counted as public API. Comments are now stripped, tracking `/* */` across lines, before anything is matched. Five mutations against the real gate, each caught by the intended branch: a new unplanned region fails; a planned region that stops planning fails; a properly wired region prints a note and does not fail; an unbalanced BEGIN/END fails naming its own function; a clean tree passes. The last of those is why `unbalanced` is returned separately -- the first attempt left the scanner inside a region for the rest of the file, so every later `return` became an escape, and the mutation printed 87 escape lines without ever saying the macro was unbalanced. A missing baseline fails the gate unless this is the run recording it, the same exemption and the same bound as `math_values`. --- verification/README.md | 1 + verification/baseline/RERECORDED.md | 97 +++++++++++ verification/baseline/gil_regions.txt | 69 ++++++++ verification/check.py | 145 +++++++++++----- verification/check_lib.py | 125 +++++++++++++- verification/tests/test_gil_regions.py | 190 +++++++++++++++++++++ verification/tests/test_record_selector.py | 2 +- 7 files changed, 586 insertions(+), 43 deletions(-) create mode 100644 verification/baseline/gil_regions.txt create mode 100644 verification/tests/test_gil_regions.py diff --git a/verification/README.md b/verification/README.md index f01c9a9..039612d 100644 --- a/verification/README.md +++ b/verification/README.md @@ -61,6 +61,7 @@ make clean && make test # 331 C tests | Python public API | a moved default, a renamed keyword, a method that stopped being public | | pytest inventory | a test that stopped being collected -- a subset of a passing suite also passes | | C test inventory | the same for `RUN_TEST` cases | +| thread plan wiring | a region that drops the GIL and resolves no thread plan, an unbalanced plan macro, or a path that escapes one | | numeric | 78 quantities, order 2/3/4 x default/uneven prior, as hex floats | | saved-model bytes | the sha256 of a written model | | thread independence | results at 1, 4 and 16 threads | diff --git a/verification/baseline/RERECORDED.md b/verification/baseline/RERECORDED.md index e322edb..d3ca49c 100644 --- a/verification/baseline/RERECORDED.md +++ b/verification/baseline/RERECORDED.md @@ -3265,3 +3265,100 @@ No recorded NUMBER. On the rebuilt extension the gate reports OK for `numeric` `thread independence` and `exact against enumeration` (416 quantities), and `C public symbols` is unchanged. The two notes this section exists to silence are gone from the gate's output, which now has no `note` lines at all. + +## 2026-11-14: `gil_regions.txt` — a new baseline, nothing re-recorded + +`--record preforkguard --only pytest_cases,gil_regions` wrote +`gil_regions.txt` for the first time. **No recorded number moved on that +run:** `numeric.json` (78 keys), `math_values.json` (58 quantities), the +saved-model sha256, the thread-independence table at 1/4/16 threads and +`exact` (416 quantities) all compared equal, `python_api.txt` is +byte-identical at 381 signature lines, and `c_cases.txt` is unchanged at 439. +The only other baseline written is `pytest_cases.txt`, in its own section +below. The forced rebuild that preceded the run produced a byte-identical +extension, `sha256 227a5fb3931208cfc4b6d9f91d43b2dd06dca6e915b171ecfa54f0c470d4f6b0`, +so nothing in `src/native/` changed. + +69 lines, one per region that drops the GIL, each +`::[#N] planned|unplanned`: + +| file | planned | unplanned | +|---|---|---| +| `algorithm_bindings.c` | 0 | 2 | +| `analytics_bindings.c` | 28 | 0 | +| `common.c` | 1 | 0 | +| `distance_bindings.c` | 0 | 1 | +| `fingerprint_bindings.c` | 0 | 1 | +| `insights_bindings.c` | 0 | 1 | +| `mixture_bindings.c` | 0 | 7 | +| `model_bindings.c` | 0 | 14 | +| `publicness_bindings.c` | 0 | 4 | +| `query_bindings.c` | 0 | 8 | +| `scoring_bindings.c` | 0 | 2 | +| **total** | **29** | **40** | + +### Why it exists + +The check this replaces read TWO of the fourteen binding files, named in a +`PLANNED_BINDINGS` tuple, and on a clean tree printed + + OK thread plan wiring (29 analytics regions planned, no escapes) + +A reader takes that for a statement about the library. It was a statement +about `analytics_bindings.c` and `common.c`. The other twelve files hold 40 +regions that drop the GIL and resolve no thread plan, so `beam_threads()` +falls through to `threads_cap()` — with no cap set, `omp_get_max_threads()`, +which is one thread per core: the default `plan.h` exists to stop asking for. +Measured on this 16-core box with 15 cores free, `BEAM.parallel_plan()` +reports `plan: 8` while `effective_threads()` is 16, so an analytics call runs +8 and `py_observe` runs 16. On the saturated 48-core node it asks for 48, +which `.private/parallelism` measures at 301x worse than serial at half that. + +`model_bindings.c`'s 14 are the expensive half of the library: `py_observe`, +`py_finalize`, `py_build`, `py_load`, `py_save`, `py_temper`, `py_posterior`, +`py_set_prior`, `py_subtract`, `py_add`, `py_depth_occupancy`, +`py_path_count_total`, `py_accumulator_max`, `py_log_partition_by_layer`. + +That is a DEFERRAL and not a defect. DESIGN.md decision 9 reads: *"Does the +adaptive default apply to fitting? No. Query-time calls only, for now; +fitting keeps today's behaviour until it is profiled."* So the 40 are +recorded rather than failed. What recording buys is what a printed count +cannot: a **new** unplanned region fails the gate, so the deferral cannot +quietly grow, and wiring one up prints a note asking to be re-recorded. The +lesson behind that is `c_symbols.txt` two sections above — a baseline with no +recorder at all, which drifted by thirty symbols across four merges. + +Identified by function rather than by line, because a line-numbered baseline +churns on every unrelated edit above it and teaches its reader to re-record +without reading. + +### The count is 40, not 41 + +Worth recording because the first version of this file said 41. The scan is a +text search, and `mixture_bindings.c` opens with a doc comment explaining +what holds across "the `Py_BEGIN_ALLOW_THREADS` region". That sentence was +counted as a 41st unplanned region, attributed to no function at all because +it sits above the first one — the same mistake `public_text_names` records +near the top of `check.py`, where `jet_sweep` matched a prose comment and was +counted as public API. `check_lib._strip_c_comments` now removes comments, +tracking `/* */` across lines, before anything is matched, and +`verification/tests/test_gil_regions.py` pins it with +`test_a_region_named_only_in_a_comment_is_not_a_region`. The `::?` guard in +that file is what found it. + +### How it was proved to work + +Five mutations against the real gate, each caught by the intended branch: + +| mutation | result | +|---|---| +| clean tree | `OK ... 29 of 69 ... 40 unplanned by decision 9, none new` | +| a second `Py_BEGIN_ALLOW_THREADS` added to `scoring_bindings.c` | FAIL, 1 new region | +| a `BEAM_PY_PLANNED_BEGIN` in `analytics_bindings.c` turned back into `Py_BEGIN_ALLOW_THREADS` | FAIL, 1 region stopped planning | +| `py_observe` wired with a matched BEGIN/END pair | note, "now resolve a thread plan", no failure | +| `BEAM_PY_PLANNED_BEGIN` with no matching END | FAIL, one line naming `py_observe` | + +The last of those is why `gil_regions` returns `unbalanced` separately. The +first attempt left the scanner inside a region for the rest of the FILE, so +every later `return` became an escape: that mutation printed **87** escape +lines and never said the macro was unbalanced. diff --git a/verification/baseline/gil_regions.txt b/verification/baseline/gil_regions.txt new file mode 100644 index 0000000..e4fc9c8 --- /dev/null +++ b/verification/baseline/gil_regions.txt @@ -0,0 +1,69 @@ +algorithm_bindings.c::py_sample unplanned +algorithm_bindings.c::py_top_k unplanned +analytics_bindings.c::py_beta_contour_sums planned +analytics_bindings.c::py_beta_contour_tail planned +analytics_bindings.c::py_cohort_private_sums planned +analytics_bindings.c::py_entropy planned +analytics_bindings.c::py_expected_counts planned +analytics_bindings.c::py_hill_number planned +analytics_bindings.c::py_length_derivatives planned +analytics_bindings.c::py_length_marginals planned +analytics_bindings.c::py_log_gamma_ratio planned +analytics_bindings.c::py_log_gamma_ratio_shift planned +analytics_bindings.c::py_log_mellin planned +analytics_bindings.c::py_log_mellin_complex planned +analytics_bindings.c::py_log_mellin_line planned +analytics_bindings.c::py_log_mellin_many planned +analytics_bindings.c::py_path_count planned +analytics_bindings.c::py_positional_banded planned +analytics_bindings.c::py_positional_marginals planned +analytics_bindings.c::py_spectra_by_length planned +analytics_bindings.c::py_spectrum planned +analytics_bindings.c::py_spectrum_pair planned +analytics_bindings.c::py_surprisal_by_depth planned +analytics_bindings.c::py_surprisal_range planned +analytics_bindings.c::py_surprisal_tilt planned +analytics_bindings.c::py_topology planned +analytics_bindings.c::py_transition_rows planned +analytics_bindings.c::py_ztp_bin_expect planned +analytics_bindings.c::py_ztp_bin_reduce planned +analytics_bindings.c::py_ztp_count_spectrum planned +common.c::edge_moment_list planned +distance_bindings.c::py_local_distance unplanned +fingerprint_bindings.c::py_fingerprint_search unplanned +insights_bindings.c::py_insights_logos unplanned +mixture_bindings.c::py_mixture_gram unplanned +mixture_bindings.c::py_mixture_inner_product unplanned +mixture_bindings.c::py_mixture_power_gram unplanned +mixture_bindings.c::py_mixture_power_pairs unplanned +mixture_bindings.c::py_mixture_power_position unplanned +mixture_bindings.c::py_mixture_power_product unplanned +mixture_bindings.c::py_mixture_support_union unplanned +model_bindings.c::py_accumulator_max unplanned +model_bindings.c::py_add unplanned +model_bindings.c::py_build unplanned +model_bindings.c::py_depth_occupancy unplanned +model_bindings.c::py_finalize unplanned +model_bindings.c::py_load unplanned +model_bindings.c::py_log_partition_by_layer unplanned +model_bindings.c::py_observe unplanned +model_bindings.c::py_path_count_total unplanned +model_bindings.c::py_posterior unplanned +model_bindings.c::py_save unplanned +model_bindings.c::py_set_prior unplanned +model_bindings.c::py_subtract unplanned +model_bindings.c::py_temper unplanned +publicness_bindings.c::py_publicness_accumulate unplanned +publicness_bindings.c::py_publicness_accumulate_grouped unplanned +publicness_bindings.c::py_publicness_moments unplanned +publicness_bindings.c::py_publicness_pgf unplanned +query_bindings.c::py_query_entropy unplanned +query_bindings.c::py_query_expect unplanned +query_bindings.c::py_query_information_matrix unplanned +query_bindings.c::py_query_marginals unplanned +query_bindings.c::py_query_neighbours unplanned +query_bindings.c::py_query_pair_joint unplanned +query_bindings.c::py_query_position_entropy unplanned +query_bindings.c::py_query_probability unplanned +scoring_bindings.c::py_log_pseq_batch unplanned +scoring_bindings.c::py_log_pseq_packed unplanned diff --git a/verification/check.py b/verification/check.py index e9c472c..b778e92 100644 --- a/verification/check.py +++ b/verification/check.py @@ -19,7 +19,7 @@ import BEAM sys.path.insert(0, str(Path(__file__).resolve().parent)) -from check_lib import (c_inventory, collect_ids, compare, +from check_lib import (c_inventory, collect_ids, compare, gil_regions, inventory_difference, missing_baseline_is_fatal, python_collect_argv, python_inventory, record_targets, refuse_short_c_inventory) @@ -349,48 +349,109 @@ def _api_snapshot(): check("C test inventory", c_got, c_want) # ── The thread plan is actually in force ─────────────────────────────────── -# Every analytics binding must resolve a thread plan for its call. The wiring -# is a macro around the GIL-release region, so "did all of them get it" is a -# question about SOURCE, and a static answer is stronger than a timing test: -# it cannot be passed by a lucky machine, and it fails on the next region -# somebody adds without the macro. +# Every region that drops the GIL is accounted for: either it resolves a +# thread plan, or it is one of the regions DESIGN.md decision 9 deliberately +# left on the old behaviour ("Query-time calls only, for now; fitting keeps +# today's behaviour until it is profiled"). check_lib.gil_regions says why +# this reads all fourteen binding files and not the two it used to. # -# Two things are checked, because each catches what the other cannot. A -# remaining `Py_BEGIN_ALLOW_THREADS` is a region that plans nothing. A `return` -# or `goto` inside a planned region is a path that skips the leave, which would -# apply one call's thread count to the next, unrelated call -- the macro's -# safety rests on there being no such path, so that is verified and not assumed. -PLANNED_BINDINGS = ("analytics_bindings.c", "common.c") -_bind = ROOT / "src" / "native" / "bindings" / "python" -_unplanned, _escapes, _regions = [], [], 0 -for _name in PLANNED_BINDINGS: - _lines = (_bind / _name).read_text(encoding="utf-8").splitlines() - _depth = 0 - for _i, _ln in enumerate(_lines, 1): - if "Py_BEGIN_ALLOW_THREADS" in _ln: - _unplanned.append(f"{_name}:{_i}") - if "BEAM_PY_PLANNED_BEGIN" in _ln: - _depth, _regions = 1, _regions + 1 - continue - if "BEAM_PY_PLANNED_END" in _ln: - _depth = 0 - continue - if _depth and ("return" in _ln.split("/*")[0].split("//")[0] - or "goto" in _ln.split("/*")[0].split("//")[0]): - _escapes.append(f"{_name}:{_i}: {_ln.strip()}") -if _unplanned: - fail.append("unplanned analytics region") - print(f" FAIL {len(_unplanned)} analytics region(s) resolve no thread plan: " - f"{', '.join(_unplanned)}") -elif _escapes: - fail.append("escape from a planned region") - print(f" FAIL {len(_escapes)} path(s) leave a planned region without " - f"restoring the plan:") - for _e in _escapes: - print(f" {_e}") +# The wiring is a macro around the GIL-release region, so this is a question +# about SOURCE, and a static answer is stronger than a timing test: it cannot +# be passed by a lucky machine, and it fails on the next region somebody adds +# without the macro. +_regions, _escapes, _unbalanced = gil_regions(ROOT) +_gil_path = B / "gil_regions.txt" +if not _gil_path.exists(): + # Same exemption, and the same bound, as math_values above: only the run + # that writes a new baseline may find it absent. Without the bound a tree + # where this file was never checked out reports a clean gate with the + # whole comparison gone, which is the one failure a recorded baseline + # exists to prevent. + _want_regions = None + if missing_baseline_is_fatal("gil_regions", sys.argv): + fail.append("thread plan wiring") + print(f" FAIL thread plan wiring: no baseline at {_gil_path.name} " + f"(record it with --only gil_regions)") + else: + print(" note thread plan wiring: no baseline yet, recording it now") +else: + _want_regions = [l for l in _gil_path.read_text( + encoding="utf-8").splitlines() if l.strip()] + +if _want_regions is None: + _escapes_only = True # nothing to compare; the notes above stand + if _unbalanced: + fail.append("unbalanced planned region") + print(f" FAIL {len(_unbalanced)} planned region(s) are not balanced:") + for _u in _unbalanced: + print(f" {_u}") + elif _escapes: + fail.append("escape from a planned region") + print(f" FAIL {len(_escapes)} path(s) leave a planned region " + f"without restoring the plan:") + for _e in _escapes: + print(f" {_e}") else: - print(f" OK thread plan wiring ({_regions} analytics regions planned, " - f"no escapes)") + _got_set, _want_set = set(_regions), set(_want_regions) + _unplanned = {r.rsplit(" ", 1)[0] for r in _regions if r.endswith("unplanned")} + _was_unplanned = {r.rsplit(" ", 1)[0] for r in _want_regions + if r.endswith("unplanned")} + _was_planned = {r.rsplit(" ", 1)[0] for r in _want_regions + if r.endswith("planned") and not r.endswith("unplanned")} + _new_unplanned = sorted(_unplanned - _was_unplanned - _was_planned) + _regressed = sorted(_unplanned & _was_planned) + _wired = sorted(_was_unplanned - _unplanned + - {r.rsplit(" ", 1)[0] for r in _regions} ) + _now_planned = sorted({r.rsplit(" ", 1)[0] for r in _regions + if not r.endswith("unplanned")} & _was_unplanned) + _n_planned = sum(1 for r in _regions if not r.endswith("unplanned")) + + if _unbalanced: + # Reported before the escapes, because an unbalanced macro is what makes + # the escape count meaningless rather than a finding of its own. + fail.append("unbalanced planned region") + print(f" FAIL {len(_unbalanced)} planned region(s) are not balanced:") + for _u in _unbalanced: + print(f" {_u}") + elif _escapes: + fail.append("escape from a planned region") + print(f" FAIL {len(_escapes)} path(s) leave a planned region without " + f"restoring the plan:") + for _e in _escapes: + print(f" {_e}") + elif _regressed: + fail.append("planned region stopped planning") + print(f" FAIL {len(_regressed)} region(s) that resolved a thread plan " + f"no longer do:") + for _r in _regressed: + print(f" {_r}") + elif _new_unplanned: + # The one that matters most. A region added without the macro runs at + # omp_get_max_threads(), which is one thread per core -- between 1.7x and + # 3814x the optimum by the measurements in .private/parallelism, and + # bimodal, so it is unpredictable as well as slow. + fail.append("new unplanned GIL region") + print(f" FAIL {len(_new_unplanned)} new region(s) drop the GIL and " + f"resolve no thread plan:") + for _r in _new_unplanned: + print(f" {_r}") + print(" Wrap it in BEAM_PY_PLANNED_BEGIN/END, or record the " + "deferral with --record TAG --only gil_regions.") + elif _now_planned: + print(f" note {len(_now_planned)} region(s) now resolve a thread plan " + f"that did not: {', '.join(_now_planned)}") + print(" Progress. Re-record with --only gil_regions.") + elif _got_set != _want_set: + fail.append("GIL region inventory") + print(" FAIL the set of GIL-releasing regions moved") + for _r in sorted(_got_set - _want_set): + print(f" + {_r}") + for _r in sorted(_want_set - _got_set): + print(f" - {_r}") + else: + print(f" OK thread plan wiring ({_n_planned} of {len(_regions)} " + f"GIL-releasing regions resolve a thread plan; " + f"{len(_unplanned)} unplanned by decision 9, none new; no escapes)") # ── Numerical contract ───────────────────────────────────────────────────── c = json.loads((B / "corpus.json").read_text()) @@ -611,6 +672,8 @@ def _write(name, text): _write("pytest_cases.txt", "\n".join(sorted(py_got_lines)) + "\n") if "c_cases" in _targets: _write("c_cases.txt", "\n".join(sorted(c_got)) + "\n") + if "gil_regions" in _targets: + _write("gil_regions.txt", "\n".join(_regions) + "\n") if "numeric" in _targets: _num = dict(got) _num["fixture_sha256"] = digest diff --git a/verification/check_lib.py b/verification/check_lib.py index be3b393..93636c5 100644 --- a/verification/check_lib.py +++ b/verification/check_lib.py @@ -6,6 +6,7 @@ """ from __future__ import annotations +import re import subprocess import sys from collections import Counter @@ -154,9 +155,131 @@ def python_inventory(want_text: str, collected_text: str) -> tuple[list[str], li return collect_ids(want_text), collect_ids(collected_text) +def _strip_c_comments(line: str, in_block: bool) -> tuple[str, bool]: + """The code on one line, with comments removed, tracking `/* */` across lines. + + Needed because the region scan is a text search, and this file's own + history says why a raw text search is not enough: a prose mention of + `Py_BEGIN_ALLOW_THREADS` in the doc comment at the top of + mixture_bindings.c was counted as a region that drops the GIL, exactly as + `jet_sweep` once matched a comment and was recorded as public API. + """ + out, i = [], 0 + while i < len(line): + if in_block: + j = line.find("*/", i) + if j < 0: + return "".join(out), True + in_block, i = False, j + 2 + continue + j, k = line.find("/*", i), line.find("//", i) + if j < 0 and k < 0: + out.append(line[i:]) + break + if k >= 0 and (j < 0 or k < j): + out.append(line[i:k]) + break + out.append(line[i:j]) + i, in_block = j + 2, True + return "".join(out), in_block + + +#: Lines at column 0 that define a function. `#define FOO(x)` is excluded by +#: the leading-# test at the call site; `static PyMethodDef x[] = {` cannot +#: match because the regex requires `(` immediately after the name. +_C_FUNC = re.compile(r"^(?:static\s+)?[A-Za-z_][\w\s\*]*?\**\s*([A-Za-z_]\w*)\s*\(") + + +def gil_regions(root: Path) -> tuple[list[str], list[str]]: + """Every region that drops the GIL, and whether it resolves a thread plan. + + Returns (regions, escapes, unbalanced). Each region is one line, + `::[#N] `, and the pair is what the + baseline holds. + + WHY THIS READS ALL FOURTEEN BINDING FILES. It used to read two, named in + a `PLANNED_BINDINGS` tuple, and print `29 analytics regions planned, no + escapes` -- a sentence a reader takes for a statement about the library. + It was a statement about analytics_bindings.c and common.c. The other + twelve files hold 41 regions that drop the GIL and plan nothing, so + `beam_threads()` falls through to `threads_cap()`, which with no cap set + is `omp_get_max_threads()`: one thread per core, the default plan.h + exists to stop asking for. Measured on a 16-core box with 15 free, an + analytics call plans 8 and `py_observe` runs 16; on the saturated + 48-core node it asks for 48, which the design notes measure at 301x + worse than serial at half that. + + That is a DEFERRAL, not a defect -- DESIGN.md decision 9 reads "No. + Query-time calls only, for now; fitting keeps today's behaviour until it + is profiled" -- so the 41 are recorded rather than failed. What the + recording buys is the thing a count alone cannot: a NEW unplanned region + fails, so the deferral cannot quietly grow, and wiring one up shows as a + note that asks to be re-recorded. The lesson is c_symbols.txt, which had + no recorder at all and drifted by thirty symbols across four merges. + + Identified by function rather than by line, because a line-numbered + baseline churns on every unrelated edit above it and teaches its reader + to re-record without reading. + """ + bind = root / "src" / "native" / "bindings" / "python" + regions: list[str] = [] + escapes: list[str] = [] + unbalanced: list[str] = [] + for path in sorted(bind.glob("*.c")): + func, seen = "?", {} + open_at, open_in = None, "" # line and function of an unclosed BEGIN + in_block = False + for i, raw in enumerate(path.read_text(encoding="utf-8").splitlines(), 1): + # Everything below reads `code`, never the raw line. + code, in_block = _strip_c_comments(raw, in_block) + if code[:1] not in ("", " ", "\t", "#", "}"): + m = _C_FUNC.match(code) + if m: + # A region still open at the next function's definition is + # never closed. Reported here, and `open_at` cleared, so + # that one unbalanced macro implicates its own function + # rather than every `return` in the rest of the file -- a + # mutation of exactly this shape produced 87 escape lines + # and no statement of the actual fault. + if open_at is not None: + unbalanced.append( + f"{path.name}:{open_at}: planned region in " + f"{open_in} is never closed") + open_at = None + func = m.group(1) + if "BEAM_PY_PLANNED_BEGIN" in code or "Py_BEGIN_ALLOW_THREADS" in code: + planned = ("planned" if "BEAM_PY_PLANNED_BEGIN" in code + else "unplanned") + n = seen.get(func, 0) + seen[func] = n + 1 + regions.append(f"{path.name}::{func}{f'#{n}' if n else ''} {planned}") + if planned == "planned": + if open_at is not None: + unbalanced.append( + f"{path.name}:{open_at}: planned region in " + f"{open_in} is never closed") + open_at, open_in = i, func + continue + if "BEAM_PY_PLANNED_END" in code: + if open_at is None: + unbalanced.append(f"{path.name}:{i}: a planned region is " + f"closed in {func} without being opened") + open_at = None + continue + # A `return` or `goto` out of a planned region skips the leave, + # which would apply one call's thread count to the next, unrelated + # call. The macro's safety rests on there being no such path. + if open_at is not None and ("return" in code or "goto" in code): + escapes.append(f"{path.name}:{i}: {code.strip()}") + if open_at is not None: + unbalanced.append(f"{path.name}:{open_at}: planned region in " + f"{open_in} is never closed") + return sorted(regions), escapes, unbalanced + #: Every baseline `--record` can write, by the name `--only` accepts. RECORDABLE = frozenset({"python_api", "pytest_cases", "c_cases", - "numeric", "threads", "math_values"}) + "numeric", "threads", "math_values", "gil_regions", + }) def missing_baseline_is_fatal(name: str, argv: list[str]) -> bool: diff --git a/verification/tests/test_gil_regions.py b/verification/tests/test_gil_regions.py new file mode 100644 index 0000000..e704d2a --- /dev/null +++ b/verification/tests/test_gil_regions.py @@ -0,0 +1,190 @@ +"""Every region that drops the GIL, and whether it resolves a thread plan. + +The gate's wiring check used to read two of the fourteen binding files and +print `29 analytics regions planned, no escapes` -- a sentence its reader +takes for a statement about the library, while it was a statement about +`analytics_bindings.c` and `common.c`. The other twelve hold 41 regions that +drop the GIL and plan nothing. + +These tests pin the reading that covers all fourteen, and they pin it on +synthetic sources rather than only on the real tree: the real counts move +whenever someone wires a region up, which is the point, so a test that only +asserted them would have to be edited every time it did its job. +""" +from pathlib import Path + +import pytest + +import check_lib + +ROOT = Path(__file__).resolve().parents[2] + + +def _tree(tmp_path: Path, name: str, body: str) -> Path: + """A root containing one binding file, laid out where gil_regions looks.""" + d = tmp_path / "src" / "native" / "bindings" / "python" + d.mkdir(parents=True, exist_ok=True) + (d / name).write_text(body, encoding="utf-8") + return tmp_path + + +# The real tree +# ════════════════════════════════════════════════════════════════════════ + + +def test_the_recorded_baseline_matches_the_source(): + """The baseline is what the gate compares against, so it must be current. + + This is the test that fails when someone adds a GIL-releasing region and + does not record it -- the same failure the gate reports, caught here + without a full gate run. + """ + regions, escapes, unbalanced = check_lib.gil_regions(ROOT) + recorded = [l for l in (ROOT / "verification" / "baseline" / + "gil_regions.txt").read_text( + encoding="utf-8").splitlines() if l.strip()] + assert escapes == [] + assert unbalanced == [] + assert regions == sorted(recorded) + + +def test_no_region_is_attributed_to_an_unknown_function(): + """`?` means the function-definition scanner lost its place. + + Every identifier in the baseline is `::`, and a `?` there + would make two unrelated regions share one name -- so one could be + deleted without the comparison noticing. + """ + regions, _, _ = check_lib.gil_regions(ROOT) + assert regions, "no regions found at all; the layout must have moved" + assert [r for r in regions if "::?" in r] == [] + + +# The parsing rules +# ════════════════════════════════════════════════════════════════════════ + + +def test_a_planned_and_an_unplanned_region_are_told_apart(tmp_path): + root = _tree(tmp_path, "a.c", """ +PyObject *py_planned(PyObject *self) { + BEAM_PY_PLANNED_BEGIN + work(); + BEAM_PY_PLANNED_END +} +PyObject *py_bare(PyObject *self) { + Py_BEGIN_ALLOW_THREADS + work(); + Py_END_ALLOW_THREADS +} +""") + regions, escapes, unbalanced = check_lib.gil_regions(root) + assert regions == ["a.c::py_bare unplanned", "a.c::py_planned planned"] + assert escapes == [] and unbalanced == [] + + +def test_a_second_region_in_one_function_gets_its_own_identifier(tmp_path): + """Otherwise two regions collapse into one entry and either can vanish.""" + root = _tree(tmp_path, "a.c", """ +PyObject *py_twice(PyObject *self) { + Py_BEGIN_ALLOW_THREADS + first(); + Py_END_ALLOW_THREADS + Py_BEGIN_ALLOW_THREADS + second(); + Py_END_ALLOW_THREADS +} +""") + regions, _, _ = check_lib.gil_regions(root) + assert regions == ["a.c::py_twice unplanned", "a.c::py_twice#1 unplanned"] + + +def test_a_return_inside_a_planned_region_is_an_escape(tmp_path): + """A path that skips the leave applies this call's plan to the next one.""" + root = _tree(tmp_path, "a.c", """ +PyObject *py_leaky(PyObject *self) { + BEAM_PY_PLANNED_BEGIN + if (bad) return NULL; + BEAM_PY_PLANNED_END +} +""") + _, escapes, unbalanced = check_lib.gil_regions(root) + assert len(escapes) == 1 + assert "return NULL" in escapes[0] + assert unbalanced == [] + + +def test_a_commented_return_is_not_an_escape(tmp_path): + root = _tree(tmp_path, "a.c", """ +PyObject *py_fine(PyObject *self) { + BEAM_PY_PLANNED_BEGIN + work(); /* no return here */ + // nor goto here + BEAM_PY_PLANNED_END +} +""") + _, escapes, _ = check_lib.gil_regions(root) + assert escapes == [] + + +def test_an_unclosed_region_is_reported_once_and_blames_its_own_function( + tmp_path): + """The regression this test exists for. + + An unbalanced BEGIN used to leave the scanner inside a region for the + rest of the FILE, so every later `return` became an escape: one mutation + produced 87 escape lines and never said the macro was unbalanced. The + fault is one line, and it belongs to the function that opened it. + """ + root = _tree(tmp_path, "a.c", """ +PyObject *py_unclosed(PyObject *self) { + BEAM_PY_PLANNED_BEGIN + work(); +} +PyObject *py_innocent(PyObject *self) { + if (a) return NULL; + if (b) return NULL; + goto out; +} +""") + _, escapes, unbalanced = check_lib.gil_regions(root) + assert len(unbalanced) == 1 + assert "py_unclosed" in unbalanced[0] + assert "never closed" in unbalanced[0] + assert escapes == [], f"a later function was blamed: {escapes}" + + +def test_an_end_without_a_begin_is_reported(tmp_path): + root = _tree(tmp_path, "a.c", """ +PyObject *py_stray(PyObject *self) { + work(); + BEAM_PY_PLANNED_END +} +""") + _, _, unbalanced = check_lib.gil_regions(root) + assert len(unbalanced) == 1 + assert "without being opened" in unbalanced[0] + +def test_a_region_named_only_in_a_comment_is_not_a_region(tmp_path): + """The bug this guard exists for, found by the `::?` test above. + + `mixture_bindings.c` opens with a doc comment that explains what happens + across "the `Py_BEGIN_ALLOW_THREADS` region". A raw text search counted + that sentence as a 41st unplanned region, attributed to no function at + all because it sits above the first one -- the same mistake that once + recorded `jet_sweep` as public API because a comment mentioned it. + """ + root = _tree(tmp_path, "a.c", """ +/** + * Prose about the `Py_BEGIN_ALLOW_THREADS` region, and about + * BEAM_PY_PLANNED_BEGIN as well, spanning several lines. + */ +PyObject *py_real(PyObject *self) { + Py_BEGIN_ALLOW_THREADS /* the only real one */ + work(); + Py_END_ALLOW_THREADS +} +// Py_BEGIN_ALLOW_THREADS in a line comment is not one either. +""") + regions, escapes, unbalanced = check_lib.gil_regions(root) + assert regions == ["a.c::py_real unplanned"] + assert escapes == [] and unbalanced == [] diff --git a/verification/tests/test_record_selector.py b/verification/tests/test_record_selector.py index 9dfc94d..19aca74 100644 --- a/verification/tests/test_record_selector.py +++ b/verification/tests/test_record_selector.py @@ -11,7 +11,7 @@ import pytest ALL = {"python_api", "pytest_cases", "c_cases", "numeric", "threads", - "math_values"} + "math_values", "gil_regions"} def test_no_only_flag_means_every_baseline(): From ffeb41f705442c3661dad7a8c909f067fde585cd Mon Sep 17 00:00:00 2001 From: thomas Date: Sat, 14 Nov 2026 09:35:16 +0200 Subject: [PATCH 3/6] Say why a forked worker hangs, in the child that is about to An OpenMP thread pool does not survive `fork`. Only the thread that called it exists in the child, so the child waits at its first parallel computation on workers that were never copied: no exception, no traceback, no exit. That is the worst failure mode a library has, and the documentation that says to use spawn gets read after the hang rather than before it. So the child says so on the way past. The condition is "this process had more than one native thread when it forked", read from `/proc/self/status` because an OpenMP worker is not a Python thread and `threading.active_count()` cannot see it. Verified both ways: a fresh import reports one thread, and building a model under `set_threads(4)` reports four, so the predicate is off for a fork that is safe and on for the one that is not. The condition is deliberately broader than "BEAM had a pool" -- another library's threads satisfy it too, and this will occasionally warn a child that would have been fine. Forking a multithreaded process is the hazard whoever started the threads, the warning is suppressible by category, and a guard that stays quiet through the case it exists for is worth less than one that is sometimes early. An unreadable thread count reports one rather than guessing high, which makes the guard silent on a platform without /proc instead of warning on every fork there. Four tests, and one of them was wrong until it was mutation-tested. `test_a_fork_with_nothing_running_is_silent` used `simplefilter("error")`, which `_after_fork_in_child` swallows on purpose, so it passed against a guard mutated to warn on every fork; it now asserts on the recorded warning list. Removing the `os.register_at_fork` call is caught by the end-to-end fork test and by none of the other three, which is why an end-to-end fork test is there at all. Dropping "spawn" from the message, and guessing high on an unreadable count, are each caught by their own test. The reference page recommended spawn without saying what happens otherwise, so the recommendation had nothing behind it. It now states the consequence, and that a fork before any computation is safe. Every name added is underscore-private, so BEAM's declared surface is unchanged: `python_api.txt` is byte-identical at 381 signature lines. --- docs/src/content/docs/reference/runtime.md | 12 +- src/BEAM/runtime.py | 74 +- tests/suites/model/test_runtime.py | 107 ++ verification/baseline/RERECORDED.md | 40 + .../baseline/pytest_cases.preforkguard.txt | 1238 +++++++++++++++++ verification/baseline/pytest_cases.txt | 4 + 6 files changed, 1472 insertions(+), 3 deletions(-) create mode 100644 verification/baseline/pytest_cases.preforkguard.txt diff --git a/docs/src/content/docs/reference/runtime.md b/docs/src/content/docs/reference/runtime.md index 5ea8398..916f5d6 100644 --- a/docs/src/content/docs/reference/runtime.md +++ b/docs/src/content/docs/reference/runtime.md @@ -49,8 +49,16 @@ models in parallel and combine them from one thread. Start worker processes with **spawn**, for example `multiprocessing.get_context("spawn").Pool(...)`, and call `BEAM.set_threads(T)` in each worker -so that workers × `T` fits the machine. Models are not pickled: pass each worker the model's -file path and load it there with `BeamModel.from_file`. +so that workers × `T` fits the machine. + +Spawn rather than fork, because an OpenMP thread pool does not survive `fork`: only the thread +that called it exists in the child, so the child waits at its first parallel computation instead +of raising. BEAM warns in the child when it is forked from a process that had worker threads +running, which is the signal to switch start methods — but spawn avoids it altogether. A fork +before any computation has run is safe, and is not warned about. + +Models are not pickled: pass each worker the model's file path and load it there with +`BeamModel.from_file`. ```python import multiprocessing as mp diff --git a/src/BEAM/runtime.py b/src/BEAM/runtime.py index 3fea72f..1a6e6e7 100644 --- a/src/BEAM/runtime.py +++ b/src/BEAM/runtime.py @@ -2,7 +2,8 @@ """ from __future__ import annotations - +import os +import warnings from . import _cbeam as _c from ._simulation_result import SimulationResult @@ -123,3 +124,74 @@ def file_provenance_span() -> tuple[int, int]: """ off, nbytes = _c.file_provenance_span() return int(off), int(nbytes) + + +# ── Forking ──────────────────────────────────────────────────────────────── +# +# BEAM's OpenMP runtime does not survive `fork`. Once any parallel region has +# run, the runtime holds a pool of worker threads, and `fork` copies only the +# thread that called it: the child's first parallel computation then waits on +# workers that do not exist there and hangs -- no exception, no traceback, no +# exit. That is the worst failure mode a library has, and the documentation +# that says to use `spawn` gets read after the hang rather than before it. +# +# So the child says so itself, on the way past. The condition is "this process +# had more than one native thread when it forked", read from /proc rather than +# from `threading.active_count()`, which cannot see an OpenMP worker because +# it is not a Python thread. +# +# That condition is deliberately broader than "BEAM had a pool": another +# library's threads satisfy it too, and this will occasionally warn a child +# that would have been fine. Forking a multithreaded process is the hazard +# whoever started the threads, the warning is suppressible by category, and a +# guard that stays quiet through the case it exists for is worth less than one +# that is sometimes early. +_FORK_THREADS = 1 + +_FORK_WARNING = ( + "this process forked while {n} native threads were running. BEAM's " + "OpenMP runtime does not survive fork: the first parallel computation in " + "this child will hang, with no error raised. Start workers with " + 'multiprocessing.get_context("spawn") and call BEAM.set_threads(T) in ' + "each one." +) + + +def _native_thread_count() -> int: + """Threads in this process, including the ones Python cannot see. + + 1 when the count cannot be read, which makes the fork warning silent on a + platform without /proc rather than wrong about it. + """ + try: + with open("/proc/self/status", encoding="utf-8") as fh: + for line in fh: + if line.startswith("Threads:"): + return int(line.split()[1]) + except (OSError, ValueError, IndexError): + pass + return 1 + + +def _before_fork() -> None: + # Read in the parent: by the time the child runs it has one thread, so the + # count that matters is gone. + global _FORK_THREADS + _FORK_THREADS = _native_thread_count() + + +def _after_fork_in_child() -> None: + if _FORK_THREADS > 1: + # Wrapped, because a child that cannot warn must still run. The point + # is to explain a hang, never to become a different failure. + try: + warnings.warn(_FORK_WARNING.format(n=_FORK_THREADS), + RuntimeWarning, stacklevel=2) + except Exception: # pragma: no cover + pass + + +# Unix only: Windows has no fork, and no register_at_fork to hang it on. +if hasattr(os, "register_at_fork"): + os.register_at_fork(before=_before_fork, + after_in_child=_after_fork_in_child) diff --git a/tests/suites/model/test_runtime.py b/tests/suites/model/test_runtime.py index a50a81a..24d0fb6 100644 --- a/tests/suites/model/test_runtime.py +++ b/tests/suites/model/test_runtime.py @@ -4,7 +4,9 @@ import importlib.util import math +import os import random +import warnings import numpy as np import pytest @@ -163,3 +165,108 @@ def test_available_cores_never_exceeds_the_cores_present(): import BEAM assert 1 <= BEAM.available_cores() <= BEAM.parallel_plan()["cores"] + + +# Forking +# +# The guard exists because the failure it reports is a hang: no exception, no +# traceback, nothing for a user to search for. These tests never let a child +# reach a parallel region, which is the thing that would hang -- each one +# exits immediately after reading what the handler did. +# ════════════════════════════════════════════════════════════════════════ + + +def test_the_fork_warning_names_the_hang_and_the_remedy(): + """The message has to answer "why has my program stopped" by itself. + + Asserted on content rather than on being non-empty: a warning that fires + in the right place and does not say `spawn` leaves the reader exactly + where they were. + """ + from BEAM import runtime + before = runtime._FORK_THREADS + runtime._FORK_THREADS = 8 + try: + with pytest.warns(RuntimeWarning) as caught: + runtime._after_fork_in_child() + finally: + runtime._FORK_THREADS = before + message = str(caught[0].message) + assert "hang" in message + assert "spawn" in message + assert "set_threads" in message + assert "8" in message # the count it actually observed + + +def test_a_fork_with_nothing_running_is_silent(): + """A fork before any parallel work is safe, and must not be warned about. + + This is what keeps the guard usable: a library that warns on every fork + teaches people to filter the category, which silences it for the case it + was written for. + """ + from BEAM import runtime + before = runtime._FORK_THREADS + runtime._FORK_THREADS = 1 + try: + with warnings.catch_warnings(record=True) as caught: + warnings.simplefilter("always") + runtime._after_fork_in_child() + finally: + runtime._FORK_THREADS = before + # Asserted on the RECORDED list, not by turning warnings into errors: + # `_after_fork_in_child` swallows exceptions on purpose, so an error + # raised by a filter would be caught there and this test would pass + # against a guard that warns on every fork. Mutating the predicate to + # `> 0` is what showed it. + assert caught == [], f"warned with nothing running: {[str(c.message) for c in caught]}" + + +def test_an_unreadable_thread_count_is_one_rather_than_a_guess(monkeypatch): + """Reporting 1 makes the guard silent on a platform without /proc. + + The alternative -- assuming the worst -- would warn on every fork of every + process on such a platform, which is the failure above. + """ + from BEAM import runtime + + def _no_proc(*a, **k): + raise OSError("no /proc here") + + monkeypatch.setattr("builtins.open", _no_proc) + assert runtime._native_thread_count() == 1 + + +@pytest.mark.skipif(not hasattr(os, "fork"), reason="no fork on this platform") +def test_a_real_fork_after_parallel_work_warns_in_the_child(model, + restore_threads): + """End to end, which is the only way to prove the handler is REGISTERED. + + The three tests above call `_after_fork_in_child` directly, so all of them + would still pass if `os.register_at_fork` were never reached -- and that + one line is the whole mechanism. + """ + from BEAM import runtime, set_threads + set_threads(4) + model.entropy() # any analytic starts a team, which is the hazard + if runtime._native_thread_count() < 2: + pytest.skip("no worker pool on this build, so there is nothing to warn " + "about and the test would pass without testing anything") + + read_fd, write_fd = os.pipe() + with warnings.catch_warnings(record=True) as caught: + warnings.simplefilter("always") + pid = os.fork() + if pid == 0: + # Forked from a threaded process: anything that takes a lock may + # deadlock here, so this does one syscall and leaves. It never + # returns into pytest. + try: + os.write(write_fd, b"1" if caught else b"0") + finally: + os._exit(0) + os.close(write_fd) + answer = os.read(read_fd, 1) + os.waitpid(pid, 0) + os.close(read_fd) + assert answer == b"1", "the child was not warned that it had forked" diff --git a/verification/baseline/RERECORDED.md b/verification/baseline/RERECORDED.md index d3ca49c..4e62c5c 100644 --- a/verification/baseline/RERECORDED.md +++ b/verification/baseline/RERECORDED.md @@ -3362,3 +3362,43 @@ The last of those is why `gil_regions` returns `unbalanced` separately. The first attempt left the scanner inside a region for the rest of the FILE, so every later `return` became an escape: that mutation printed **87** escape lines and never said the macro was unbalanced. + +## 2026-11-14: `pytest_cases` 1238 -> 1242, four ids added by the fork guard + +Four added, **none removed** — the whole diff is additions: + +``` +tests/suites/model/test_runtime.py::test_a_fork_with_nothing_running_is_silent +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_unreadable_thread_count_is_one_rather_than_a_guess +tests/suites/model/test_runtime.py::test_the_fork_warning_names_the_hang_and_the_remedy +``` + +They cover `BEAM.runtime`'s new at-fork guard. An OpenMP thread pool does not +survive `fork`: only the calling thread exists in the child, so the child +waits at its first parallel computation and hangs — no exception, no +traceback, nothing to search for. The documentation said to use `spawn` and +did not say what happens otherwise, so the advice was read after the hang +rather than before it. The guard warns in the child when the process had more +than one native thread at fork time, read from `/proc/self/status` because an +OpenMP worker is not a Python thread and `threading.active_count()` cannot +see it. A fork before any computation is safe and is not warned about — +verified: a fresh import reports 1 thread, and building a model under +`set_threads(4)` reports 4. + +All four were mutation-tested, and one of them was wrong until that was done. +`test_a_fork_with_nothing_running_is_silent` originally used +`simplefilter("error")`, which `_after_fork_in_child` swallows on purpose, so +it passed against a guard mutated to warn on **every** fork. It now asserts +on the recorded warning list. + +| mutation | caught by | +|---|---| +| `os.register_at_fork` call removed | only `test_a_real_fork_...` (the other three pass — which is why an end-to-end fork test is there at all) | +| predicate `> 1` relaxed to `> 0` | `test_a_fork_with_nothing_running_is_silent`, after it was fixed | +| `"spawn"` dropped from the message | `test_the_fork_warning_names_the_hang_and_the_remedy` | +| unreadable thread count guesses 99 instead of 1 | `test_an_unreadable_thread_count_is_one_rather_than_a_guess` | + +No other baseline moved: `python_api.txt` is byte-identical, which is the +check that matters here — every added name is underscore-private, so BEAM's +declared surface is unchanged. diff --git a/verification/baseline/pytest_cases.preforkguard.txt b/verification/baseline/pytest_cases.preforkguard.txt new file mode 100644 index 0000000..8d40c2d --- /dev/null +++ b/verification/baseline/pytest_cases.preforkguard.txt @@ -0,0 +1,1238 @@ +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_pinned_availability_is_visible_in_the_plan +tests/suites/model/test_runtime.py::test_an_explicit_cap_is_what_the_plan_reports +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_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 8d40c2d..e9154bd 100644 --- a/verification/baseline/pytest_cases.txt +++ b/verification/baseline/pytest_cases.txt @@ -1013,11 +1013,15 @@ tests/suites/model/test_reference_agreement.py::test_path_count_matches_referenc 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_fork_warning_names_the_hang_and_the_remedy 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 From 6eb1525f74e3bebe02013efd66753a86b403c0e0 Mon Sep 17 00:00:00 2001 From: thomas Date: Sat, 14 Nov 2026 10:00:47 +0200 Subject: [PATCH 4/6] Plan a thread count for fitting too, now that fitting is profiled Decision 9 left fitting on the old behaviour "until it is profiled". This is that profile, and the wiring it supports. Matched-sample sweep, five processes per thread count, median of medians, 16-core desktop at load 2.8-6.5: order 2 order 3 1 thr 189.0 ms 1.00x 630.8 ms 1.00x 3 thr 159.7 ms 1.18x 405.6 ms 1.56x 6 thr 169.1 ms 1.12x 378.7 ms 1.67x 8 thr 171.2 ms 1.10x 397.7 ms 1.59x 12 thr 215.2 ms 0.88x 509.9 ms 1.24x 16 thr 410.7 ms 0.46x 693.4 ms 0.91x Fitting parallelises weakly and degrades past eight. The behaviour decision 9 preserved asked `omp_get_max_threads()`, which on this box is sixteen -- the worst point on both curves, and 2.2x worse than serial at order 2. Measured again in auto mode after wiring: order 2 410.7 -> 178.1 ms, order 3 693.4 -> 405.2 ms, with the plan reporting eight. A fitting-specific ceiling of four to six was considered and rejected. It buys about 7% at order 2 and 5% at order 3 over the existing ceiling, which does not pay for a second measured constant that has to stay correct on machines nobody has measured. The ceiling is a cap, and both workload classes now measured -- analytics, which scales to eight, and fitting, which peaks at three to six -- are better served by any value at or below eight than by one thread per core. The other 26 of the 40 are query-time calls that decision 9's own rule already covered and that Task 4 did not reach: mixture, query, publicness, scoring, distance, fingerprint, insights, sample and top_k. The analytics ceiling was measured on that workload class, so they need no separate profile. Mechanical, and checked before any edit: all 40 regions sit in files that already include python_bindings.h, none contains a `return` or `goto`, and none lacks a matching Py_END_ALLOW_THREADS. The macro is a drop-in. The replacement was made comment-aware so that mixture_bindings.c's doc comment was not silently rewritten; it is corrected by hand instead, because the region it describes is no longer spelled that way. No recorded number moved, across 40 entry points whose thread count changed: 78 numeric keys, 58 math values bit for bit, the saved-model sha256, thread independence at 1/4/16 and 416 quantities against enumeration all compared equal. That is the reduction design earning its keep -- no floating-point sum reduction anywhere, and the sums that exist split into a fixed 256 chunks summed in index order. The extension's hash did change, since this is the first commit in the series to edit C. The baseline is kept although nothing is exempt any more: a region added later without the macro is a failure against it, which is why this check stopped being a printed number. Its line now reads "all 69 ... resolve a thread plan", phrased without the word "unplanned" -- "0 unplanned" is a sentence a reader parses twice to learn that nothing is wrong. Not answered here: why fitting degrades at all. A 2.2x penalty at sixteen threads points at barrier or contention cost in the per-length regions rather than at a thread count being wrong, which would be an optimisation and possibly a larger one. And this is one idle desktop; the loaded 48-core node, where auto mode asked for 48, still needs its own run. --- .../bindings/python/algorithm_bindings.c | 8 +- .../bindings/python/distance_bindings.c | 4 +- .../bindings/python/fingerprint_bindings.c | 4 +- .../bindings/python/insights_bindings.c | 4 +- src/native/bindings/python/mixture_bindings.c | 30 +++---- src/native/bindings/python/model_bindings.c | 56 ++++++------- .../bindings/python/publicness_bindings.c | 16 ++-- src/native/bindings/python/query_bindings.c | 32 ++++---- src/native/bindings/python/scoring_bindings.c | 8 +- verification/baseline/RERECORDED.md | 79 ++++++++++++++++++ verification/baseline/gil_regions.txt | 80 +++++++++---------- .../baseline/gil_regions.wiredfitting.txt | 69 ++++++++++++++++ verification/check.py | 18 +++-- verification/check_lib.py | 33 ++++---- 14 files changed, 299 insertions(+), 142 deletions(-) create mode 100644 verification/baseline/gil_regions.wiredfitting.txt diff --git a/src/native/bindings/python/algorithm_bindings.c b/src/native/bindings/python/algorithm_bindings.c index 4802dd1..4f0ea14 100644 --- a/src/native/bindings/python/algorithm_bindings.c +++ b/src/native/bindings/python/algorithm_bindings.c @@ -49,9 +49,9 @@ PyObject *py_sample(PyObject *self, PyObject *args) { BeamRng rng; beam_rng_seed(&rng, (uint64_t)seed); BeamError err; - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN err = beam_model_sample(m, n, length, &rng, buf, NULL); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END if (err != BEAM_OK) { PyMem_Free(buf); return set_beam_error(err); } PyObject *list = PyList_New(n); @@ -89,9 +89,9 @@ PyObject *py_top_k(PyObject *self, PyObject *args) { + (uint64_t)k * sizeof(double)); } uint32_t n = 0; BeamError err; - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN err = beam_model_top_k(m, k, length, buf, lp, &n); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END if (err != BEAM_OK) { PyMem_Free(buf); PyMem_Free(lp); return set_beam_error(err); } PyObject *seqs = PyList_New(n), *probs = PyList_New(n); diff --git a/src/native/bindings/python/distance_bindings.c b/src/native/bindings/python/distance_bindings.c index 868e68a..b476b2c 100644 --- a/src/native/bindings/python/distance_bindings.c +++ b/src/native/bindings/python/distance_bindings.c @@ -15,9 +15,9 @@ PyObject *py_local_distance(PyObject *self, PyObject *args) { if (!p || !q) return NULL; BeamLocalDistanceResult *r=NULL; BeamError err; - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN err=beam_local_distance(p,q,&config,&r); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END if (err!=BEAM_OK) return set_beam_error(err); /* Native scratch has been freed. Reserve retained native output plus the * raw lists/tuples/scalars AND the Python facade's result objects, attribute diff --git a/src/native/bindings/python/fingerprint_bindings.c b/src/native/bindings/python/fingerprint_bindings.c index 7517c02..0d68534 100644 --- a/src/native/bindings/python/fingerprint_bindings.c +++ b/src/native/bindings/python/fingerprint_bindings.c @@ -20,9 +20,9 @@ PyObject *py_fingerprint_search(PyObject *self, PyObject *args) { if (!p || !q) return NULL; BeamFingerprintResult *r = NULL; BeamError err; - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN err = beam_fingerprint_search(p,q,L,&cfg,&r); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END if (err != BEAM_OK) return set_beam_error(err); PyObject *indices = PyBytes_FromStringAndSize(NULL,(Py_ssize_t)r->n_nodes*6*sizeof(int32_t)); PyObject *masses = PyBytes_FromStringAndSize(NULL,(Py_ssize_t)r->n_nodes*2*sizeof(double)); diff --git a/src/native/bindings/python/insights_bindings.c b/src/native/bindings/python/insights_bindings.c index 8c1d317..c189a0c 100644 --- a/src/native/bindings/python/insights_bindings.c +++ b/src/native/bindings/python/insights_bindings.c @@ -93,9 +93,9 @@ PyObject *py_insights_logos(PyObject *self, PyObject *args) { BeamLogoSet set; BeamError err; - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN err = beam_insights_logos(m, &req, &set); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END if (err != BEAM_OK) return set_beam_error(err); PyObject *logos = PyList_New((Py_ssize_t)set.n_logos); diff --git a/src/native/bindings/python/mixture_bindings.c b/src/native/bindings/python/mixture_bindings.c index f7f8c3e..5d62045 100644 --- a/src/native/bindings/python/mixture_bindings.c +++ b/src/native/bindings/python/mixture_bindings.c @@ -6,7 +6,7 @@ * the only structural difference from the rest of the bindings. The borrowed * pointer array is built once per call and the models are kept alive by the * caller's own references for the duration, which the GIL guarantees across - * the `Py_BEGIN_ALLOW_THREADS` region: the Python `Mixture` object holds the + * the planned region: the Python `Mixture` object holds the * models it was built from, so nothing can collect one mid-sweep. */ #define PY_SSIZE_T_CLEAN @@ -102,9 +102,9 @@ PyObject *py_mixture_inner_product(PyObject *self, PyObject *args) { double total = 0.0; BeamError err; - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN err = beam_mixture_log_inner_product_by_length(v, n, by, &total); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END PyMem_Free(v); if (err != BEAM_OK) { PyMem_Free(by); return set_beam_error(err); } @@ -175,11 +175,11 @@ PyObject *py_mixture_power_position(PyObject *self, PyObject *args) { double total = 0.0, sink = 0.0, konst = 0.0; BeamError err; - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN err = beam_mixture_log_power_product_by_position(v, a, n, (uint32_t)len, by, &sink, &konst, &total); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END PyMem_Free(v); PyMem_Free(a); if (err != BEAM_OK) { PyMem_Free(by); return set_beam_error(err); } @@ -208,9 +208,9 @@ PyObject *py_mixture_power_product(PyObject *self, PyObject *args) { double total = 0.0; BeamError err; - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN err = beam_mixture_log_power_product_by_length(v, a, n, by, &total); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END PyMem_Free(v); PyMem_Free(a); if (err != BEAM_OK) { PyMem_Free(by); return set_beam_error(err); } @@ -234,9 +234,9 @@ PyObject *py_mixture_power_gram(PyObject *self, PyObject *args) { if (!g) { PyMem_Free(v); return NULL; } BeamError err; - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN err = beam_mixture_power_gram(v, n, a, g); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END PyMem_Free(v); if (err != BEAM_OK) { PyMem_Free(g); return set_beam_error(err); } @@ -275,10 +275,10 @@ PyObject *py_mixture_power_pairs(PyObject *self, PyObject *args) { if (!out) { PyMem_Free(v); PyBuffer_Release(&pb); return NULL; } BeamError err; - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN err = beam_mixture_power_pairs(v, n, a, (const uint32_t *)pb.buf, n_pairs, out); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END PyMem_Free(v); PyBuffer_Release(&pb); if (err != BEAM_OK) { PyMem_Free(out); return set_beam_error(err); } @@ -306,10 +306,10 @@ PyObject *py_mixture_support_union(PyObject *self, PyObject *args) { double total = 0.0; uint64_t peak = 0; BeamError err; - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN err = beam_mixture_support_union_by_length(v, n, (uint64_t)cap, by, &total, &peak); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END PyMem_Free(v); if (err != BEAM_OK) { PyMem_Free(by); return set_beam_error(err); } @@ -334,9 +334,9 @@ PyObject *py_mixture_gram(PyObject *self, PyObject *args) { if (!g) { PyMem_Free(v); return NULL; } BeamError err; - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN err = beam_mixture_gram(v, n, g); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END PyMem_Free(v); if (err != BEAM_OK) { PyMem_Free(g); return set_beam_error(err); } diff --git a/src/native/bindings/python/model_bindings.c b/src/native/bindings/python/model_bindings.c index 31a1f86..2031a96 100644 --- a/src/native/bindings/python/model_bindings.c +++ b/src/native/bindings/python/model_bindings.c @@ -51,9 +51,9 @@ PyObject *py_observe(PyObject *self, PyObject *args) { if (!ok) { PyMem_Free(v); return NULL; } BeamError err; - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN err = beam_model_observe(m, v, w, (uint32_t)n); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END PyMem_Free(v); PyMem_Free(w); if (err != BEAM_OK) return set_beam_error(err); Py_RETURN_NONE; @@ -70,9 +70,9 @@ PyObject *py_finalize(PyObject *self, PyObject *arg) { BeamModel *m = edge_from_capsule(arg); if (!m) return NULL; BeamError err; - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN err = beam_model_finalize(m); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END if (err != BEAM_OK) return set_beam_error(err); Py_RETURN_NONE; } @@ -102,10 +102,10 @@ PyObject *py_build(PyObject *self, PyObject *args) { } BeamError err; - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN err = beam_model_observe(m, v, w, (uint32_t)n); if (err == BEAM_OK) err = beam_model_finalize(m); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END PyMem_Free(v); PyMem_Free(w); if (err != BEAM_OK) { beam_model_destroy(m); return set_beam_error(err); } return PyCapsule_New(m, BEAM_CAPSULE_NAME, capsule_destructor); @@ -115,9 +115,9 @@ PyObject *py_load(PyObject *self, PyObject *arg) { const char *path = PyUnicode_AsUTF8(arg); if (!path) return NULL; BeamModel *m; - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN m = beam_model_load(path); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END if (!m) { if (beam_last_error() != BEAM_OK) { /* @@ -145,9 +145,9 @@ PyObject *py_save(PyObject *self, PyObject *args) { BeamModel *m = edge_from_capsule(cap); if (!m) return NULL; BeamError err; - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN err = beam_model_save(m, path); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END if (err != BEAM_OK) return set_beam_error(err); Py_RETURN_NONE; } @@ -236,9 +236,9 @@ PyObject *py_temper(PyObject *self, PyObject *args) { BeamModel *m = edge_from_capsule(cap); if (!m) return NULL; BeamError err; - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN err = beam_model_temper(m, t); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END if (err != BEAM_OK) return set_beam_error(err); Py_RETURN_NONE; } @@ -250,10 +250,10 @@ PyObject *py_posterior(PyObject *self, PyObject *args) { BeamModel *p = edge_from_capsule(prior_cap); if (!m || !p) return NULL; BeamError err; - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN err = beam_model_posterior(m, p, kappa); if (err == BEAM_OK) err = beam_model_finalize(m); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END if (err != BEAM_OK) return set_beam_error(err); Py_RETURN_NONE; } @@ -288,10 +288,10 @@ PyObject *py_set_prior(PyObject *self, PyObject *args) { Py_DECREF(fast); } BeamError err; - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN err = beam_model_set_prior(m, alpha_obj == Py_None ? NULL : alpha, (uint32_t)n, alpha_length); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END if (err != BEAM_OK) return set_beam_error(err); Py_RETURN_NONE; } @@ -303,10 +303,10 @@ PyObject *py_subtract(PyObject *self, PyObject *args) { BeamModel *o = edge_from_capsule(other_cap); if (!m || !o) return NULL; BeamError err; - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN err = beam_model_subtract(m, o); if (err == BEAM_OK) err = beam_model_finalize(m); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END if (err != BEAM_OK) return set_beam_error(err); Py_RETURN_NONE; } @@ -318,10 +318,10 @@ PyObject *py_add(PyObject *self, PyObject *args) { BeamModel *o = edge_from_capsule(other_cap); if (!m || !o) return NULL; BeamError err; - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN err = beam_model_add(m, o); if (err == BEAM_OK) err = beam_model_finalize(m); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END if (err != BEAM_OK) return set_beam_error(err); Py_RETURN_NONE; } @@ -439,9 +439,9 @@ PyObject *py_depth_occupancy(PyObject *self, PyObject *arg) { (uint64_t)2u * n * sizeof(uint64_t)); } BeamError err; - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN err = beam_model_depth_occupancy(m, rows, cells); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END if (err != BEAM_OK) { free(rows); free(cells); return set_beam_error(err); } PyObject *lr = PyList_New((Py_ssize_t)n), *lc = PyList_New((Py_ssize_t)n); if (!lr || !lc) { Py_XDECREF(lr); Py_XDECREF(lc); free(rows); free(cells); @@ -467,9 +467,9 @@ PyObject *py_path_count_total(PyObject *self, PyObject *arg) { BeamModel *m = edge_from_capsule(arg); if (!m) return NULL; double v; - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN v = beam_model_path_count_total(m); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END if (beam_last_error() != BEAM_OK) return set_beam_error(beam_last_error()); return PyFloat_FromDouble(v); } @@ -488,9 +488,9 @@ PyObject *py_accumulator_max(PyObject *self, PyObject *arg) { BeamModel *m = edge_from_capsule(arg); if (!m) return NULL; double v; - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN v = beam_model_accumulator_max(m); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END if (beam_last_error() != BEAM_OK) return set_beam_error(beam_last_error()); return PyFloat_FromDouble(v); } @@ -533,9 +533,9 @@ PyObject *py_log_partition_by_layer(PyObject *self, PyObject *args) { if (!buf) return beam_py_nomem("the per-layer partition buffer", (uint64_t)L * sizeof(double)); BeamError err; - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN err = beam_model_log_partition_by_layer(m, L, buf); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END if (err != BEAM_OK) { PyMem_Free(buf); return set_beam_error(err); } PyObject *out = PyList_New((Py_ssize_t)L); if (!out) { PyMem_Free(buf); return NULL; } diff --git a/src/native/bindings/python/publicness_bindings.c b/src/native/bindings/python/publicness_bindings.c index e7f19b0..f04da2c 100644 --- a/src/native/bindings/python/publicness_bindings.c +++ b/src/native/bindings/python/publicness_bindings.c @@ -52,7 +52,7 @@ PyObject *py_publicness_moments(PyObject *self, PyObject *args) { return NULL; } - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN err = beam_publicness_moments((const double *)views[0].buf, (uint32_t)n_atoms, (const double *)views[1].buf, @@ -60,7 +60,7 @@ PyObject *py_publicness_moments(PyObject *self, PyObject *args) { (uint32_t)n_groups, (double *)views[3].buf, (double *)views[4].buf); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END release_f64_buffers(views, 5); if (err != BEAM_OK) return set_beam_error(err); @@ -105,13 +105,13 @@ PyObject *py_publicness_pgf(PyObject *self, PyObject *args) { /* Release the GIL: this is n_atoms * n_groups * k_fft/2 complex powers, * which reaches tens of seconds on a foundation-scale cohort. */ - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN err = beam_publicness_pgf((const double *)views[0].buf, (uint32_t)n_atoms, (const double *)views[1].buf, (const double *)views[2].buf, (uint32_t)n_groups, (uint32_t)k_fft, (double *)views[3].buf); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END release_f64_buffers(views, 4); if (err != BEAM_OK) return set_beam_error(err); @@ -160,7 +160,7 @@ PyObject *py_publicness_accumulate(PyObject *self, PyObject *args) { return NULL; } - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN err = beam_publicness_accumulate((const double *)views[0].buf, (uint32_t)n_atoms, (uint32_t)k_fft, (const double *)views[1].buf, @@ -171,7 +171,7 @@ PyObject *py_publicness_accumulate(PyObject *self, PyObject *args) { tail_sigma, tail_floor, mass_tol, (double *)views[5].buf, (double *)views[6].buf); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END release_f64_buffers(views, 7); if (err != BEAM_OK) return set_beam_error(err); @@ -233,7 +233,7 @@ PyObject *py_publicness_accumulate_grouped( return NULL; } - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN err = beam_publicness_accumulate_grouped( (const double *)views[0].buf, (uint32_t)n_atoms, (uint32_t)k_fft, @@ -244,7 +244,7 @@ PyObject *py_publicness_accumulate_grouped( (const double *)views[4].buf, (uint32_t)n_bins, tail_sigma, tail_floor, mass_tol, (double *)views[5].buf, (double *)views[6].buf); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END PyBuffer_Release(&group_view); release_f64_buffers(views, 7); diff --git a/src/native/bindings/python/query_bindings.c b/src/native/bindings/python/query_bindings.c index 0379451..e4003f7 100644 --- a/src/native/bindings/python/query_bindings.c +++ b/src/native/bindings/python/query_bindings.c @@ -185,9 +185,9 @@ PyObject *py_query_probability(PyObject *self, PyObject *args) { QUERY_PROLOGUE(args, "OIOO"); double lp = 0.0; BeamError err; - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN err = beam_query_log_probability(m, c, &lp); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END beam_query_constraint_free(c); if (err != BEAM_OK) return set_beam_error(err); return PyFloat_FromDouble(lp); @@ -203,9 +203,9 @@ PyObject *py_query_marginals(PyObject *self, PyObject *args) { return beam_py_nomem("the query result", (uint64_t)length * R * sizeof(double)); } double logz = 0.0; BeamError err; - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN err = beam_query_marginals(m, c, out, &logz); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END beam_query_constraint_free(c); if (err != BEAM_OK) { PyMem_Free(out); return set_beam_error(err); } PyObject *b = edge_doubles_to_bytes(out, (size_t)length * R); @@ -220,9 +220,9 @@ PyObject *py_query_entropy(PyObject *self, PyObject *args) { QUERY_PROLOGUE(args, "OIOO"); double h = 0.0, v = 0.0; BeamError err; - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN err = beam_query_entropy(m, c, &h, &v); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END beam_query_constraint_free(c); if (err != BEAM_OK) return set_beam_error(err); return Py_BuildValue("(dd)", h, v); @@ -255,9 +255,9 @@ PyObject *py_query_expect(PyObject *self, PyObject *args) { } BeamQueryMoments mo; BeamError err; - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN err = beam_query_expect(m, c, &f, &mo); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END beam_query_constraint_free(c); PyMem_Free(tab); if (err != BEAM_OK) return set_beam_error(err); @@ -272,9 +272,9 @@ PyObject *py_query_position_entropy(PyObject *self, PyObject *args) { if (!out) { beam_query_constraint_free(c); return beam_py_nomem("the query result", (uint64_t)length * sizeof(double)); } BeamError err; - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN err = beam_query_position_entropy(m, c, out); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END beam_query_constraint_free(c); if (err != BEAM_OK) { PyMem_Free(out); return set_beam_error(err); } PyObject *b = edge_doubles_to_bytes(out, length); @@ -292,9 +292,9 @@ PyObject *py_query_pair_joint(PyObject *self, PyObject *args) { if (!out) { beam_query_constraint_free(c); return beam_py_nomem("the query result", (uint64_t)R * R * sizeof(double)); } BeamError err; - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN err = beam_query_pair_joint(m, c, i, j, out); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END beam_query_constraint_free(c); if (err != BEAM_OK) { PyMem_Free(out); return set_beam_error(err); } PyObject *b = edge_doubles_to_bytes(out, (size_t)R * R); @@ -312,9 +312,9 @@ PyObject *py_query_information_matrix(PyObject *self, PyObject *args) { if (!out) { beam_query_constraint_free(c); return beam_py_nomem("the query result", (uint64_t)length * length * sizeof(double)); } BeamError err; - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN err = beam_query_information_matrix(m, c, out); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END beam_query_constraint_free(c); if (err != BEAM_OK) { PyMem_Free(out); return set_beam_error(err); } PyObject *b = edge_doubles_to_bytes(out, (size_t)length * length); @@ -350,10 +350,10 @@ PyObject *py_query_neighbours(PyObject *self, PyObject *args) { BeamNeighbourhood nb; BeamError err; - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN err = deletions ? beam_query_deletions(m, seq, &nb) : beam_query_insertions(m, seq, &nb); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END if (err != BEAM_OK) return set_beam_error(err); PyObject *list = PyList_New(nb.n); diff --git a/src/native/bindings/python/scoring_bindings.c b/src/native/bindings/python/scoring_bindings.c index 4d1dfef..a3f3c68 100644 --- a/src/native/bindings/python/scoring_bindings.c +++ b/src/native/bindings/python/scoring_bindings.c @@ -44,9 +44,9 @@ PyObject *py_log_pseq_batch(PyObject *self, PyObject *args) { (uint64_t)n * sizeof(double)); } BeamError err; - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN err = beam_model_log_pseq_batch(m, v, (uint32_t)n, out); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END PyMem_Free(v); if (err != BEAM_OK) { PyMem_Free(out); return set_beam_error(err); } @@ -112,11 +112,11 @@ PyObject *py_log_pseq_packed(PyObject *self, PyObject *args) { } BeamError err; - Py_BEGIN_ALLOW_THREADS + BEAM_PY_PLANNED_BEGIN err = beam_model_log_pseq_packed(m, have_data ? (const char *)data.buf : NULL, have_data ? (uint64_t)data.len : 0u, (const int64_t *)off.buf, n, (double *)out.buf); - Py_END_ALLOW_THREADS + BEAM_PY_PLANNED_END PyBuffer_Release(&out); PyBuffer_Release(&off); if (have_data) PyBuffer_Release(&data); if (err != BEAM_OK) return set_beam_error(err); diff --git a/verification/baseline/RERECORDED.md b/verification/baseline/RERECORDED.md index 4e62c5c..e65c9da 100644 --- a/verification/baseline/RERECORDED.md +++ b/verification/baseline/RERECORDED.md @@ -3402,3 +3402,82 @@ on the recorded warning list. No other baseline moved: `python_api.txt` is byte-identical, which is the check that matters here — every added name is underscore-private, so BEAM's declared surface is unchanged. + +## 2026-11-14: `gil_regions` 29 planned of 69 -> all 69, fitting wired once profiled + +`--record wiredfitting --only gil_regions`. **No recorded number moved**, and +that is the result worth stating plainly: this change alters the thread count +of 40 entry points, the whole model-building path among them, and +`numeric.json` (78 keys), `math_values.json` (58 quantities, bit-identical), +the saved-model sha256, the thread-independence table at 1/4/16 and `exact` +(416 quantities) all compared equal on the run that recorded it. +`python_api.txt` is byte-identical at 381 lines; `pytest_cases.txt` is +unchanged at 1242 and `c_cases.txt` at 439. The Python suite is 1240 passed / +2 skipped and the C suite 439/439. + +The extension's sha256 DID change, `227a5fb3...` -> `4dc81355...`, because +this is the first change in the series that edits C. Numbers surviving a new +binary is the point of the numeric baselines, not a contradiction of them. + +### What decision 9 asked for, and what the profile said + +> | 9 | Does the adaptive default apply to fitting? | **No. Query-time calls +> only**, for now; fitting keeps today's behaviour until it is profiled. | + +Matched-sample sweep, 5 processes per thread count, median of medians, on the +16-core desktop at load 2.8-6.5 (`.private/parallelism/fitting/`): + +| threads | order 2 | order 3 | +|---|---|---| +| 1 | 189.0 ms 1.00x | 630.8 ms 1.00x | +| 3 | 159.7 ms **1.18x** | 405.6 ms 1.56x | +| 6 | 169.1 ms 1.12x | 378.7 ms **1.67x** | +| 8 | 171.2 ms 1.10x | 397.7 ms 1.59x | +| 12 | 215.2 ms 0.88x | 509.9 ms 1.24x | +| 16 | 410.7 ms **0.46x** | 693.4 ms 0.91x | + +Fitting parallelises weakly and degrades past 8. The behaviour decision 9 +preserved asked `omp_get_max_threads()`, which on this box is 16 -- the WORST +point on both curves, and 2.2x worse than serial at order 2. Measured again +in auto mode after wiring: order 2 410.7 -> 178.1 ms (2.31x), order 3 +693.4 -> 405.2 ms (1.71x), with `parallel_plan()` reporting 8. + +A fitting-specific ceiling of 4-6 was considered and rejected: it adds ~7% +(order 2) and ~5% (order 3) over the existing ceiling, which does not pay for +a second measured constant that has to stay correct on machines nobody has +measured. The ceiling is a cap, and both workload classes now measured -- +analytics, which scales to 8, and fitting, which peaks at 3-6 -- are better +served by any value at or below 8 than by one thread per core. + +### Why the wiring was mechanical + +Checked before any edit, across all 40 regions: every one sits in a file that +already includes `python_bindings.h`, **none** contains a `return` or `goto`, +and **none** lacks a matching `Py_END_ALLOW_THREADS`. `BEAM_PY_PLANNED_BEGIN` +is `Py_BEGIN_ALLOW_THREADS` plus `beam_plan_enter_default()`, and `_END` is +`beam_plan_leave(token)` plus `Py_END_ALLOW_THREADS`, so it is a drop-in. The +replacement was made comment-aware rather than textual, so +`mixture_bindings.c`'s doc comment was not silently rewritten -- it was +corrected by hand, because the region it describes is no longer spelled that +way. + +### The baseline is kept although nothing is exempt + +69 lines, all `planned`. The record is not about today's count: a region added +later without the macro is a FAILURE against it, which is the whole reason +this check stopped being a printed number. The gate's line now reads `all 69 +GIL-releasing regions resolve a thread plan; no escapes` -- phrased without +the word "unplanned", because "0 unplanned" is a sentence a reader parses +twice to learn that nothing is wrong. + +### Still open + +Why fitting degrades at all. A 2.2x penalty at sixteen threads points at +barrier or contention cost in the per-length regions rather than at a thread +count being wrong; `omp critical(beam_live_cache)` and the per-length regions' +small bodies are the candidates. That is an optimisation, possibly a larger +one than choosing a thread count. And this is one idle-ish desktop: on the +saturated 48-core node auto mode asked for 48, further past the degradation +point than 16 is here, so the direction is robust and only the magnitude +needs ig05. + diff --git a/verification/baseline/gil_regions.txt b/verification/baseline/gil_regions.txt index e4fc9c8..c420c02 100644 --- a/verification/baseline/gil_regions.txt +++ b/verification/baseline/gil_regions.txt @@ -1,5 +1,5 @@ -algorithm_bindings.c::py_sample unplanned -algorithm_bindings.c::py_top_k unplanned +algorithm_bindings.c::py_sample planned +algorithm_bindings.c::py_top_k planned analytics_bindings.c::py_beta_contour_sums planned analytics_bindings.c::py_beta_contour_tail planned analytics_bindings.c::py_cohort_private_sums planned @@ -29,41 +29,41 @@ analytics_bindings.c::py_ztp_bin_expect planned analytics_bindings.c::py_ztp_bin_reduce planned analytics_bindings.c::py_ztp_count_spectrum planned common.c::edge_moment_list planned -distance_bindings.c::py_local_distance unplanned -fingerprint_bindings.c::py_fingerprint_search unplanned -insights_bindings.c::py_insights_logos unplanned -mixture_bindings.c::py_mixture_gram unplanned -mixture_bindings.c::py_mixture_inner_product unplanned -mixture_bindings.c::py_mixture_power_gram unplanned -mixture_bindings.c::py_mixture_power_pairs unplanned -mixture_bindings.c::py_mixture_power_position unplanned -mixture_bindings.c::py_mixture_power_product unplanned -mixture_bindings.c::py_mixture_support_union unplanned -model_bindings.c::py_accumulator_max unplanned -model_bindings.c::py_add unplanned -model_bindings.c::py_build unplanned -model_bindings.c::py_depth_occupancy unplanned -model_bindings.c::py_finalize unplanned -model_bindings.c::py_load unplanned -model_bindings.c::py_log_partition_by_layer unplanned -model_bindings.c::py_observe unplanned -model_bindings.c::py_path_count_total unplanned -model_bindings.c::py_posterior unplanned -model_bindings.c::py_save unplanned -model_bindings.c::py_set_prior unplanned -model_bindings.c::py_subtract unplanned -model_bindings.c::py_temper unplanned -publicness_bindings.c::py_publicness_accumulate unplanned -publicness_bindings.c::py_publicness_accumulate_grouped unplanned -publicness_bindings.c::py_publicness_moments unplanned -publicness_bindings.c::py_publicness_pgf unplanned -query_bindings.c::py_query_entropy unplanned -query_bindings.c::py_query_expect unplanned -query_bindings.c::py_query_information_matrix unplanned -query_bindings.c::py_query_marginals unplanned -query_bindings.c::py_query_neighbours unplanned -query_bindings.c::py_query_pair_joint unplanned -query_bindings.c::py_query_position_entropy unplanned -query_bindings.c::py_query_probability unplanned -scoring_bindings.c::py_log_pseq_batch unplanned -scoring_bindings.c::py_log_pseq_packed unplanned +distance_bindings.c::py_local_distance planned +fingerprint_bindings.c::py_fingerprint_search planned +insights_bindings.c::py_insights_logos planned +mixture_bindings.c::py_mixture_gram planned +mixture_bindings.c::py_mixture_inner_product planned +mixture_bindings.c::py_mixture_power_gram planned +mixture_bindings.c::py_mixture_power_pairs planned +mixture_bindings.c::py_mixture_power_position planned +mixture_bindings.c::py_mixture_power_product planned +mixture_bindings.c::py_mixture_support_union planned +model_bindings.c::py_accumulator_max planned +model_bindings.c::py_add planned +model_bindings.c::py_build planned +model_bindings.c::py_depth_occupancy planned +model_bindings.c::py_finalize planned +model_bindings.c::py_load planned +model_bindings.c::py_log_partition_by_layer planned +model_bindings.c::py_observe planned +model_bindings.c::py_path_count_total planned +model_bindings.c::py_posterior planned +model_bindings.c::py_save planned +model_bindings.c::py_set_prior planned +model_bindings.c::py_subtract planned +model_bindings.c::py_temper planned +publicness_bindings.c::py_publicness_accumulate planned +publicness_bindings.c::py_publicness_accumulate_grouped planned +publicness_bindings.c::py_publicness_moments planned +publicness_bindings.c::py_publicness_pgf planned +query_bindings.c::py_query_entropy planned +query_bindings.c::py_query_expect planned +query_bindings.c::py_query_information_matrix planned +query_bindings.c::py_query_marginals planned +query_bindings.c::py_query_neighbours planned +query_bindings.c::py_query_pair_joint planned +query_bindings.c::py_query_position_entropy planned +query_bindings.c::py_query_probability planned +scoring_bindings.c::py_log_pseq_batch planned +scoring_bindings.c::py_log_pseq_packed planned diff --git a/verification/baseline/gil_regions.wiredfitting.txt b/verification/baseline/gil_regions.wiredfitting.txt new file mode 100644 index 0000000..e4fc9c8 --- /dev/null +++ b/verification/baseline/gil_regions.wiredfitting.txt @@ -0,0 +1,69 @@ +algorithm_bindings.c::py_sample unplanned +algorithm_bindings.c::py_top_k unplanned +analytics_bindings.c::py_beta_contour_sums planned +analytics_bindings.c::py_beta_contour_tail planned +analytics_bindings.c::py_cohort_private_sums planned +analytics_bindings.c::py_entropy planned +analytics_bindings.c::py_expected_counts planned +analytics_bindings.c::py_hill_number planned +analytics_bindings.c::py_length_derivatives planned +analytics_bindings.c::py_length_marginals planned +analytics_bindings.c::py_log_gamma_ratio planned +analytics_bindings.c::py_log_gamma_ratio_shift planned +analytics_bindings.c::py_log_mellin planned +analytics_bindings.c::py_log_mellin_complex planned +analytics_bindings.c::py_log_mellin_line planned +analytics_bindings.c::py_log_mellin_many planned +analytics_bindings.c::py_path_count planned +analytics_bindings.c::py_positional_banded planned +analytics_bindings.c::py_positional_marginals planned +analytics_bindings.c::py_spectra_by_length planned +analytics_bindings.c::py_spectrum planned +analytics_bindings.c::py_spectrum_pair planned +analytics_bindings.c::py_surprisal_by_depth planned +analytics_bindings.c::py_surprisal_range planned +analytics_bindings.c::py_surprisal_tilt planned +analytics_bindings.c::py_topology planned +analytics_bindings.c::py_transition_rows planned +analytics_bindings.c::py_ztp_bin_expect planned +analytics_bindings.c::py_ztp_bin_reduce planned +analytics_bindings.c::py_ztp_count_spectrum planned +common.c::edge_moment_list planned +distance_bindings.c::py_local_distance unplanned +fingerprint_bindings.c::py_fingerprint_search unplanned +insights_bindings.c::py_insights_logos unplanned +mixture_bindings.c::py_mixture_gram unplanned +mixture_bindings.c::py_mixture_inner_product unplanned +mixture_bindings.c::py_mixture_power_gram unplanned +mixture_bindings.c::py_mixture_power_pairs unplanned +mixture_bindings.c::py_mixture_power_position unplanned +mixture_bindings.c::py_mixture_power_product unplanned +mixture_bindings.c::py_mixture_support_union unplanned +model_bindings.c::py_accumulator_max unplanned +model_bindings.c::py_add unplanned +model_bindings.c::py_build unplanned +model_bindings.c::py_depth_occupancy unplanned +model_bindings.c::py_finalize unplanned +model_bindings.c::py_load unplanned +model_bindings.c::py_log_partition_by_layer unplanned +model_bindings.c::py_observe unplanned +model_bindings.c::py_path_count_total unplanned +model_bindings.c::py_posterior unplanned +model_bindings.c::py_save unplanned +model_bindings.c::py_set_prior unplanned +model_bindings.c::py_subtract unplanned +model_bindings.c::py_temper unplanned +publicness_bindings.c::py_publicness_accumulate unplanned +publicness_bindings.c::py_publicness_accumulate_grouped unplanned +publicness_bindings.c::py_publicness_moments unplanned +publicness_bindings.c::py_publicness_pgf unplanned +query_bindings.c::py_query_entropy unplanned +query_bindings.c::py_query_expect unplanned +query_bindings.c::py_query_information_matrix unplanned +query_bindings.c::py_query_marginals unplanned +query_bindings.c::py_query_neighbours unplanned +query_bindings.c::py_query_pair_joint unplanned +query_bindings.c::py_query_position_entropy unplanned +query_bindings.c::py_query_probability unplanned +scoring_bindings.c::py_log_pseq_batch unplanned +scoring_bindings.c::py_log_pseq_packed unplanned diff --git a/verification/check.py b/verification/check.py index b778e92..f667ddb 100644 --- a/verification/check.py +++ b/verification/check.py @@ -349,11 +349,11 @@ def _api_snapshot(): check("C test inventory", c_got, c_want) # ── The thread plan is actually in force ─────────────────────────────────── -# Every region that drops the GIL is accounted for: either it resolves a -# thread plan, or it is one of the regions DESIGN.md decision 9 deliberately -# left on the old behaviour ("Query-time calls only, for now; fitting keeps -# today's behaviour until it is profiled"). check_lib.gil_regions says why -# this reads all fourteen binding files and not the two it used to. +# Every region that drops the GIL is accounted for, and all 69 of them now +# resolve a thread plan. The baseline is kept anyway: it is what makes a NEW +# region added without the macro a failure rather than a note nobody reads, +# which is the shape this check was in when it covered two of the fourteen +# binding files. check_lib.gil_regions has the history and the measurements. # # The wiring is a macro around the GIL-release region, so this is a question # about SOURCE, and a static answer is stronger than a timing test: it cannot @@ -448,10 +448,16 @@ def _api_snapshot(): print(f" + {_r}") for _r in sorted(_want_set - _got_set): print(f" - {_r}") - else: + elif _unplanned: print(f" OK thread plan wiring ({_n_planned} of {len(_regions)} " f"GIL-releasing regions resolve a thread plan; " f"{len(_unplanned)} unplanned by decision 9, none new; no escapes)") + else: + # Every one of them, which is the state decision 9 deferred reaching. + # Phrased without the word "unplanned" on purpose: "0 unplanned" is a + # sentence a reader has to parse twice to learn that nothing is wrong. + print(f" OK thread plan wiring (all {len(_regions)} GIL-releasing " + f"regions resolve a thread plan; no escapes)") # ── Numerical contract ───────────────────────────────────────────────────── c = json.loads((B / "corpus.json").read_text()) diff --git a/verification/check_lib.py b/verification/check_lib.py index 93636c5..85adb62 100644 --- a/verification/check_lib.py +++ b/verification/check_lib.py @@ -201,21 +201,24 @@ def gil_regions(root: Path) -> tuple[list[str], list[str]]: a `PLANNED_BINDINGS` tuple, and print `29 analytics regions planned, no escapes` -- a sentence a reader takes for a statement about the library. It was a statement about analytics_bindings.c and common.c. The other - twelve files hold 41 regions that drop the GIL and plan nothing, so - `beam_threads()` falls through to `threads_cap()`, which with no cap set - is `omp_get_max_threads()`: one thread per core, the default plan.h - exists to stop asking for. Measured on a 16-core box with 15 free, an - analytics call plans 8 and `py_observe` runs 16; on the saturated - 48-core node it asks for 48, which the design notes measure at 301x - worse than serial at half that. - - That is a DEFERRAL, not a defect -- DESIGN.md decision 9 reads "No. - Query-time calls only, for now; fitting keeps today's behaviour until it - is profiled" -- so the 41 are recorded rather than failed. What the - recording buys is the thing a count alone cannot: a NEW unplanned region - fails, so the deferral cannot quietly grow, and wiring one up shows as a - note that asks to be re-recorded. The lesson is c_symbols.txt, which had - no recorder at all and drifted by thirty symbols across four merges. + twelve files held 40 regions that dropped the GIL and planned nothing, + so `beam_threads()` fell through to `threads_cap()`, which with no cap + set is `omp_get_max_threads()`: one thread per core, the default plan.h + exists to stop asking for. + + All 69 now resolve a plan. The 40 were wired once fitting had been + profiled, which is what DESIGN.md decision 9 asked for ("Query-time + calls only, for now; fitting keeps today's behaviour until it is + profiled"): fitting peaks at 1.18x on 3 threads at order 2 and 1.67x on + 6 at order 3, and DEGRADES past 8 -- 0.46x and 0.91x at sixteen -- so + the old default of one thread per core was the worst point on both + curves. See .private/parallelism/fitting/. + + The baseline stays because the check is not about today's count: a NEW + unplanned region fails, so a future entry point cannot quietly skip the + macro, and the record says which regions were ever exempt. The lesson is + c_symbols.txt, which had no recorder at all and drifted by thirty + symbols across four merges. Identified by function rather than by line, because a line-numbered baseline churns on every unrelated edit above it and teaches its reader From 7f3717ef2606375365c495ee470b39ecca795225 Mon Sep 17 00:00:00 2001 From: thomas Date: Sat, 14 Nov 2026 10:47:57 +0200 Subject: [PATCH 5/6] Check that every region names its thread count, not just that it was planned A review of this branch found the gate certifying something it does not check. It printed OK thread plan wiring (all 69 GIL-releasing regions resolve a thread plan) under the heading "The thread plan is actually in force". The macro scan proves a plan is RESOLVED at the Python boundary; it cannot prove the region underneath NAMES it. One did not: `src/native/occupancy/poisson_binomial/pgf.c` carried no `num_threads` clause at all, the only such region in src/native. `py_publicness_pgf` is one of the entry points wrapped three commits ago and the wrap did nothing there -- measured at sixteen native threads after `set_threads(1)`. Wrapping an entry point and applying a plan are different things: a plan is applied by naming it in the clause. That is the same fault as the thirty drifting symbols and the 372-difference API check, reproduced while fixing them: a green line that asserts more than it verifies. plan.h carried the matching overstatement -- "Every `omp parallel` in the implementation carries `num_threads(...)` with this" -- which was untrue twice over, since 29 regions name a budget-derived local rather than `beam_threads()` and one named nothing. `check_lib.thread_count_clauses` is the check the parallel policy plan specified as Task 5 and that was never built. It joins backslash continuations, strips comments, finds every `#pragma omp parallel` and paren-matches the `num_threads(...)` expression. Matched rather than pattern-captured on purpose: `conc ? (int)conc : 1` contains parentheses, and a regex stopping at the first `)` reads it as `conc ? (int` and calls it forbidden. The plan asked for brace matching for the same reason, having already produced one wrong finding with a grep. It fails on a region naming no count and on a count outside `_PERMITTED_THREAD_COUNTS`. That set is a tripwire in source rather than a recorded baseline: adding a name is a decision someone makes in review, and the question it forces is what resolves that count. The seven in the tree are `beam_threads()` (64), `conc` (14), `nth` (10), `team` (2), `conc_e`, `conc_z` and `conc ? conc : 1`. What it exists to reject is `omp_get_max_threads()`, `omp_get_num_procs()` and any literal -- each of which asks for one thread per core behind the caller's back. `#pragma omp for` and `omp critical` are deliberately not matched: an `omp for` inside an enclosing `parallel` takes no `num_threads`, and requiring one would be a demand the language rejects. Both failure paths were mutated against the real gate, not only unit-tested. Stripping the clause from math/moments.c gives "1 parallel region(s) name no thread count"; changing it to `omp_get_max_threads()` gives "1 region(s) name a thread count that is not a permitted form". Eleven unit tests cover the parsing rules, including the four forbidden forms above. Two build faults from the same review. `make test` ran `tools/qa/run c` with no `--bin-dir`, so `make test BUILD=elsewhere` linked into elsewhere/ and then ran build/, reporting a pass for binaries it had not built. And build-tsan/ was not ignored, so `make tsan` left the tree dirty and `make clean` did not remove it. No recorded number moved, although this edits C and the extension's hash did. --- .gitignore | 3 + Makefile | 5 +- src/native/internal/beam/plan.h | 12 +- src/native/occupancy/poisson_binomial/pgf.c | 9 +- verification/check.py | 35 +++++ verification/check_lib.py | 108 ++++++++++++++- verification/tests/test_thread_counts.py | 143 ++++++++++++++++++++ 7 files changed, 309 insertions(+), 6 deletions(-) create mode 100644 verification/tests/test_thread_counts.py diff --git a/.gitignore b/.gitignore index 0ae3f28..c1a169c 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,9 @@ # Build artifacts build/ +# `make tsan` builds here so that build/ -- which the gate reads -- is +# never clobbered. It is scratch, exactly as build/ is. +build-tsan/ dist/ *.o *.d diff --git a/Makefile b/Makefile index 9c735b9..f377b07 100644 --- a/Makefile +++ b/Makefile @@ -78,7 +78,10 @@ TEST_BINS := $(TEST_SRCS:tests/native/%.c=$(BUILD)/tests/native/%) # parallelism. The runner caps threads per suite and runs several suites at # once instead. test: $(TEST_BINS) - @tools/qa/run c +# --bin-dir, because BUILD is a variable now: without it `make test +# BUILD=elsewhere` linked into elsewhere/ and then ran build/, reporting +# a pass for binaries it had not just built. + @tools/qa/run c --bin-dir $(BUILD)/tests/native # verification/check.py reads the C test inventory by asking each binary what # it runs, rather than by grepping RUN_TEST out of these sources -- see diff --git a/src/native/internal/beam/plan.h b/src/native/internal/beam/plan.h index 532e404..0e84712 100644 --- a/src/native/internal/beam/plan.h +++ b/src/native/internal/beam/plan.h @@ -163,9 +163,15 @@ void beam_plan_leave(int token); * thread if there is one, otherwise the cap from `beam_model_set_threads`, * otherwise the OpenMP runtime's own maximum. Always 1 without OpenMP. * - * Every `omp parallel` in the implementation carries `num_threads(...)` with - * this, so the cap is a hard cap rather than a hint and one stray region - * cannot go wide behind the caller's back. + * Every `omp parallel` in the implementation carries `num_threads(...)`, + * naming either this directly (64 regions) or a count already resolved from + * it and the memory budget -- `conc`, `nth`, `team` (29). So the cap is a + * hard cap rather than a hint and one stray region cannot go wide behind the + * caller's back. That is verified rather than asserted: + * `check_lib.thread_count_clauses` fails the gate on a region that names no + * count, and on one that names an expression outside the permitted set. It + * was written because `occupancy/poisson_binomial/pgf.c` was exactly such a + * stray region, and nothing noticed. * * This is NOT `beam_model_effective_threads()`, which is public API and * answers the different question "what is configured". Conflating the two diff --git a/src/native/occupancy/poisson_binomial/pgf.c b/src/native/occupancy/poisson_binomial/pgf.c index 74734a7..cf01461 100644 --- a/src/native/occupancy/poisson_binomial/pgf.c +++ b/src/native/occupancy/poisson_binomial/pgf.c @@ -127,7 +127,14 @@ BeamError beam_publicness_pgf(const double *p, uint32_t n_atoms, } #ifdef _OPENMP -#pragma omp parallel for schedule(static) if(n_atoms >= 4u) +/* The only parallel region in src/native that carried no `num_threads`, which + * meant it ran at the OpenMP default -- one thread per core -- however narrow + * a team the caller's plan had resolved. Wrapping the entry point in + * BEAM_PY_PLANNED_BEGIN could not fix that: the plan is applied by NAMING it + * here, not by being in scope. `beam_threads()` is already visible through + * beam/budget.h. */ +#pragma omp parallel for schedule(static) if(n_atoms >= 4u) \ + num_threads(beam_threads()) #endif for (uint32_t a = 0; a < n_atoms; a++) { double *row = out + (size_t)a * 2u * (size_t)k_fft; diff --git a/verification/check.py b/verification/check.py index f667ddb..f035403 100644 --- a/verification/check.py +++ b/verification/check.py @@ -19,7 +19,9 @@ import BEAM sys.path.insert(0, str(Path(__file__).resolve().parent)) +import check_lib from check_lib import (c_inventory, collect_ids, compare, gil_regions, + thread_count_clauses, inventory_difference, missing_baseline_is_fatal, python_collect_argv, python_inventory, record_targets, refuse_short_c_inventory) @@ -459,6 +461,38 @@ def _api_snapshot(): print(f" OK thread plan wiring (all {len(_regions)} GIL-releasing " f"regions resolve a thread plan; no escapes)") +# ── Every region names a thread count, and names a permitted one ─────────── +# The other half of the check above, and the half that was missing. The macro +# scan proves a plan is RESOLVED at the Python boundary. It cannot prove the +# region underneath NAMES it -- and one region did not: pgf.c carried no +# `num_threads` at all, so py_publicness_pgf ran at one thread per core +# however narrow a team the plan had resolved, while this gate reported the +# plan "in force". Wrapping an entry point and applying a plan are different +# things; a plan is applied by naming it in the clause. +# +# Specified in the parallel policy plan as a brace-matched check rather than a +# grep, because the pragmas are multi-line and a naive grep already produced +# one wrong finding in that design's own notes. +_tc_missing, _tc_forbidden, _tc_n = thread_count_clauses(ROOT) +if _tc_missing: + fail.append("region without a thread count") + print(f" FAIL {len(_tc_missing)} parallel region(s) name no thread " + f"count, so they run at the OpenMP default:") + for _m in _tc_missing: + print(f" {_m}") +elif _tc_forbidden: + fail.append("forbidden thread count") + print(f" FAIL {len(_tc_forbidden)} region(s) name a thread count that " + f"is not a permitted form:") + for _f in _tc_forbidden: + print(f" {_f}") + print(" Permitted: " + f"{', '.join(sorted(check_lib._PERMITTED_THREAD_COUNTS))}.") + print(" Add a name there only when you can say what resolves it.") +else: + print(f" OK thread counts ({_tc_n} parallel regions, every one names " + f"a permitted thread count)") + # ── Numerical contract ───────────────────────────────────────────────────── c = json.loads((B / "corpus.json").read_text()) seqs, ab = c["seqs"], c["ab"] @@ -606,6 +640,7 @@ def _close(a, b): # a defect that predates the baseline. Three such defects were found that way, # all inside quantities the baseline already pinned. sys.path.insert(0, str(Path(__file__).resolve().parent)) +import check_lib import exact # noqa: E402 if exact.run(): diff --git a/verification/check_lib.py b/verification/check_lib.py index 85adb62..9307464 100644 --- a/verification/check_lib.py +++ b/verification/check_lib.py @@ -190,7 +190,7 @@ def _strip_c_comments(line: str, in_block: bool) -> tuple[str, bool]: _C_FUNC = re.compile(r"^(?:static\s+)?[A-Za-z_][\w\s\*]*?\**\s*([A-Za-z_]\w*)\s*\(") -def gil_regions(root: Path) -> tuple[list[str], list[str]]: +def gil_regions(root: Path) -> tuple[list[str], list[str], list[str]]: """Every region that drops the GIL, and whether it resolves a thread plan. Returns (regions, escapes, unbalanced). Each region is one line, @@ -279,6 +279,112 @@ def gil_regions(root: Path) -> tuple[list[str], list[str]]: f"{open_in} is never closed") return sorted(regions), escapes, unbalanced +#: A C cast, so that `num_threads((int)conc)` and `num_threads(conc)` are one +#: form rather than two. +_C_CAST = re.compile(r"\((?:unsigned\s+)?(?:int|long|short|char|size_t|u?int\d+_t)\)") + +#: Every expression a `num_threads(...)` clause may name, normalised. This is +#: a tripwire, not a recording: a NEW name here is a deliberate decision that +#: someone has to make in review, and the question it forces is "where does +#: that count come from". +#: +#: beam_threads() the plan in force on this thread +#: conc, conc_e, conc_z budget concurrency, already narrowed by the plan +#: nth, team a count resolved once for the call and held +#: conc ? conc : 1 the same, floored at one (model/finalize.c) +#: +#: What it exists to reject: `omp_get_max_threads()`, `omp_get_num_procs()`, +#: and any literal -- each of which asks for one thread per core behind the +#: caller's back, which is the whole failure plan.h was written to stop. +_PERMITTED_THREAD_COUNTS = frozenset({ + "beam_threads()", "conc", "conc_e", "conc_z", "nth", "team", + "conc ? conc : 1", +}) + + +def _logical_lines(path: Path) -> list[str]: + r"""Comment-free lines with `\` continuations joined. + + Both are required to read a pragma: `num_threads` is routinely on the + continuation line, and a prose mention of one in a comment is not a + clause. A naive grep over the raw text already produced one wrong finding + in the parallel design's own notes. + """ + inb, out, buf = False, [], "" + for raw in path.read_text(encoding="utf-8").splitlines(): + code, inb = _strip_c_comments(raw, inb) + if code.rstrip().endswith("\\"): + buf += code.rstrip()[:-1] + " " + continue + out.append(buf + code) + buf = "" + if buf: + out.append(buf) + return out + + +def _paren_expr(text: str, after: int) -> str | None: + """The text inside the parentheses starting at or after `after`. + + Matched rather than pattern-captured, because the expression may itself + contain parentheses -- `num_threads((int)conc)` and + `num_threads(conc ? (int)conc : 1)` both do, and a regex that stops at + the first `)` truncates them. + """ + try: + i = text.index("(", after) + except ValueError: + return None + depth = 0 + for j in range(i, len(text)): + if text[j] == "(": + depth += 1 + elif text[j] == ")": + depth -= 1 + if depth == 0: + return text[i + 1:j] + return None + + +def thread_count_clauses(root: Path) -> tuple[list[str], list[str], int]: + """Where every parallel region gets its thread count. + + Returns (missing, forbidden, n_clauses). + + This is the other half of `gil_regions`, and the half that was missing. + `gil_regions` proves the plan is RESOLVED at the Python boundary; it says + nothing about whether the region underneath names it. One region did not: + `occupancy/poisson_binomial/pgf.c` carried no `num_threads` at all, so + `py_publicness_pgf` ran at one thread per core however narrow a team the + caller's plan had resolved -- and the gate reported the plan "in force" + the whole time, because wrapping an entry point and applying a plan are + different things. A plan is applied by NAMING it in the clause. + + `#pragma omp for` and `#pragma omp critical` are not matched and must not + be: an `omp for` inside an enclosing `parallel` takes no `num_threads`, + and requiring one would be a demand the language rejects. + """ + missing: list[str] = [] + forbidden: list[str] = [] + n = 0 + for path in sorted(root.joinpath("src", "native").rglob("*.[ch]")): + for ln in _logical_lines(path): + stripped = ln.strip() + if not stripped.startswith("#pragma omp parallel"): + continue + rel = path.relative_to(root) + k = stripped.find("num_threads") + if k < 0: + missing.append(f"{rel}: {stripped[:72]}") + continue + n += 1 + raw = _paren_expr(stripped, k) + norm = re.sub(r"\s+", " ", _C_CAST.sub("", raw or "")).strip() + if norm not in _PERMITTED_THREAD_COUNTS: + forbidden.append(f"{rel}: num_threads({raw}) -> {norm!r}") + return missing, forbidden, n + + #: Every baseline `--record` can write, by the name `--only` accepts. RECORDABLE = frozenset({"python_api", "pytest_cases", "c_cases", "numeric", "threads", "math_values", "gil_regions", diff --git a/verification/tests/test_thread_counts.py b/verification/tests/test_thread_counts.py new file mode 100644 index 0000000..be1b966 --- /dev/null +++ b/verification/tests/test_thread_counts.py @@ -0,0 +1,143 @@ +"""Where every parallel region gets its thread count. + +`gil_regions` proves a plan is RESOLVED at the Python boundary. It cannot +prove the region underneath NAMES it, and one region did not: +`occupancy/poisson_binomial/pgf.c` carried no `num_threads` clause at all, so +`py_publicness_pgf` ran at one thread per core however narrow a team the +caller's plan had resolved -- while the gate reported the plan "in force" the +whole time. Wrapping an entry point and applying a plan are different things. + +These tests pin the half that was missing, on synthetic sources, because the +real tree's counts move whenever a region is added. +""" +from pathlib import Path + +import pytest + +import check_lib + +ROOT = Path(__file__).resolve().parents[2] + + +def _tree(tmp_path: Path, body: str, name: str = "a.c") -> Path: + d = tmp_path / "src" / "native" + d.mkdir(parents=True, exist_ok=True) + (d / name).write_text(body, encoding="utf-8") + return tmp_path + + +# The real tree +# ════════════════════════════════════════════════════════════════════════ + + +def test_every_real_region_names_a_permitted_count(): + missing, forbidden, n = check_lib.thread_count_clauses(ROOT) + assert missing == [], f"regions with no thread count: {missing}" + assert forbidden == [], f"regions naming something else: {forbidden}" + assert n > 80, f"only {n} clauses found; the scan must have lost its way" + + +# The rules +# ════════════════════════════════════════════════════════════════════════ + + +def test_a_region_with_no_clause_is_reported(tmp_path): + """pgf.c's defect, which nothing caught for as long as it existed.""" + root = _tree(tmp_path, """ +void f(void) { + #pragma omp parallel for schedule(static) if(n >= 4u) + for (int i = 0; i < n; ++i) work(i); +} +""") + missing, forbidden, n = check_lib.thread_count_clauses(root) + assert len(missing) == 1 and "a.c" in missing[0] + assert forbidden == [] and n == 0 + + +def test_a_clause_on_the_continuation_line_is_found(tmp_path): + """Most of them are: a regex over raw lines would call these missing.""" + root = _tree(tmp_path, """ +void f(void) { + #pragma omp parallel for schedule(dynamic, 1) reduction(max:failed) \\ + num_threads(beam_threads()) + for (int i = 0; i < n; ++i) work(i); +} +""") + missing, forbidden, n = check_lib.thread_count_clauses(root) + assert missing == [] and forbidden == [] and n == 1 + + +def test_a_cast_does_not_make_a_new_form(tmp_path): + root = _tree(tmp_path, """ +void f(void) { + #pragma omp parallel for num_threads((int)conc) + for (int i = 0; i < n; ++i) work(i); + #pragma omp parallel for num_threads(conc) + for (int i = 0; i < n; ++i) work(i); +} +""") + missing, forbidden, n = check_lib.thread_count_clauses(root) + assert missing == [] and forbidden == [] and n == 2 + + +def test_a_nested_parenthesis_is_not_truncated(tmp_path): + """`conc ? (int)conc : 1` contains parens; a regex stopping at the first + `)` reads it as `conc ? (int` and reports a forbidden form.""" + root = _tree(tmp_path, """ +void f(void) { + #pragma omp parallel num_threads(conc ? (int)conc : 1) + { work(); } +} +""") + missing, forbidden, n = check_lib.thread_count_clauses(root) + assert missing == [] and forbidden == [] and n == 1 + + +@pytest.mark.parametrize("expr", ["omp_get_max_threads()", + "omp_get_num_procs()", + "16", + "cores / 2"]) +def test_asking_the_machine_directly_is_forbidden(tmp_path, expr): + """The whole failure plan.h exists to stop: measured between 1.7x and + 3814x the optimum, and bimodal, so unpredictable as well as slow.""" + root = _tree(tmp_path, """ +void f(void) { + #pragma omp parallel for num_threads(%s) + for (int i = 0; i < n; ++i) work(i); +} +""" % expr) + missing, forbidden, n = check_lib.thread_count_clauses(root) + assert missing == [] + assert len(forbidden) == 1 and n == 1 + + +def test_an_omp_for_inside_a_parallel_is_not_asked_for_a_clause(tmp_path): + """`#pragma omp for` takes no num_threads -- the language rejects it.""" + root = _tree(tmp_path, """ +void f(void) { + #pragma omp parallel num_threads(beam_threads()) + { + #pragma omp for schedule(static) + for (int i = 0; i < n; ++i) work(i); + } + #pragma omp critical(x) + { tally(); } + #pragma omp atomic + total += 1; +} +""") + missing, forbidden, n = check_lib.thread_count_clauses(root) + assert missing == [] and forbidden == [] and n == 1 + + +def test_a_pragma_named_only_in_a_comment_is_not_a_region(tmp_path): + root = _tree(tmp_path, """ +/* This explains the #pragma omp parallel for region below, which has no + * num_threads in this sentence. */ +void f(void) { + #pragma omp parallel for num_threads(nth) + for (int i = 0; i < n; ++i) work(i); +} +""") + missing, forbidden, n = check_lib.thread_count_clauses(root) + assert missing == [] and forbidden == [] and n == 1 From a39074cb959486127a1de7e188bb9755ef4891c2 Mon Sep 17 00:00:00 2001 From: thomas Date: Sat, 14 Nov 2026 10:48:09 +0200 Subject: [PATCH 6/6] Make the fork guard speak when warnings are errors The same review found the guard added two commits ago mute in the one configuration that asks to hear about warnings most loudly. Under `-W error`, or a pytest `filterwarnings = error`, `warnings.warn` RAISES rather than printing -- and the `except Exception: pass` that existed so a child which cannot warn still runs caught that and threw it away. Measured: with warnings as errors, a child forked after a BEAM computation hung and printed nothing at all. There is now an `os.write(2, ...)` fallback of a constant built at import, which is the most that can safely be done in a child forked from a threaded process, where anything that allocates or takes a lock may not come back. It degrades to a stderr line rather than an exception on purpose: an exception raised from an at-fork handler has nowhere to go. The new test uses `capfd` rather than `capsys`, since the fallback writes to the file descriptor and never passes through `sys.stderr`, and it fails when the fallback is removed. The message also stated a hang as fact on a deliberately broad predicate. The condition is "this process had more than one native thread", which a Jupyter kernel or another library's pool satisfies with BEAM never having run, so "the first parallel computation in this child will hang" was wrong for those children. It now says an OpenMP pool does not survive fork and that IF this child uses BEAM its first parallel computation MAY hang. The reference page said "A fork before any computation has run is safe, and is not warned about", which was false for any multithreaded process. It now says what the check actually is, that another library's threads can trigger it, that the category can be filtered, and that a fork from a single-threaded process is not warned about. `gil_regions` was annotated as returning a 2-tuple and has returned a 3-tuple since the unbalanced-region branch was added; the docstring was updated at the time and the annotation was not. pytest_cases 1242 -> 1243, one id added and none removed. No other baseline moved. --- docs/src/content/docs/reference/runtime.md | 9 +- src/BEAM/runtime.py | 43 +- tests/suites/model/test_runtime.py | 25 + verification/baseline/RERECORDED.md | 78 ++ .../baseline/pytest_cases.forkerrfallback.txt | 1242 +++++++++++++++++ verification/baseline/pytest_cases.txt | 1 + 6 files changed, 1387 insertions(+), 11 deletions(-) create mode 100644 verification/baseline/pytest_cases.forkerrfallback.txt diff --git a/docs/src/content/docs/reference/runtime.md b/docs/src/content/docs/reference/runtime.md index 916f5d6..27735ca 100644 --- a/docs/src/content/docs/reference/runtime.md +++ b/docs/src/content/docs/reference/runtime.md @@ -54,8 +54,13 @@ so that workers × `T` fits the machine. Spawn rather than fork, because an OpenMP thread pool does not survive `fork`: only the thread that called it exists in the child, so the child waits at its first parallel computation instead of raising. BEAM warns in the child when it is forked from a process that had worker threads -running, which is the signal to switch start methods — but spawn avoids it altogether. A fork -before any computation has run is safe, and is not warned about. +running, which is the signal to switch start methods — but spawn avoids it altogether. + +The check is whether *any* native thread was running at the fork, not whether BEAM itself had +started one, so another library's threads can trigger it even when BEAM has not run. That is +deliberate — forking a multithreaded process is the hazard whoever started the threads — and the +warning is a `RuntimeWarning`, so it can be filtered by category. A fork from a single-threaded +process is not warned about. Models are not pickled: pass each worker the model's file path and load it there with `BeamModel.from_file`. diff --git a/src/BEAM/runtime.py b/src/BEAM/runtime.py index 1a6e6e7..3144357 100644 --- a/src/BEAM/runtime.py +++ b/src/BEAM/runtime.py @@ -149,13 +149,23 @@ def file_provenance_span() -> tuple[int, int]: _FORK_THREADS = 1 _FORK_WARNING = ( - "this process forked while {n} native threads were running. BEAM's " - "OpenMP runtime does not survive fork: the first parallel computation in " - "this child will hang, with no error raised. Start workers with " + "this process forked while {n} native threads were running. An OpenMP " + "thread pool does not survive fork, so if this child uses BEAM its first " + "parallel computation may hang, with no error raised. Start workers with " 'multiprocessing.get_context("spawn") and call BEAM.set_threads(T) in ' "each one." ) +#: The same thing, pre-encoded, for the one path that cannot use `warnings`. +#: Built once at import: the fallback runs in a child forked from a threaded +#: process, where anything that allocates or takes a lock may not come back. +_FORK_WARNING_BYTES = ( + b"RuntimeWarning: BEAM: this process forked while native threads were " + b"running. An OpenMP thread pool does not survive fork, so if this child " + b"uses BEAM its first parallel computation may hang. Start workers with " + b'multiprocessing.get_context("spawn").\n' +) + def _native_thread_count() -> int: """Threads in this process, including the ones Python cannot see. @@ -181,13 +191,28 @@ def _before_fork() -> None: def _after_fork_in_child() -> None: - if _FORK_THREADS > 1: - # Wrapped, because a child that cannot warn must still run. The point - # is to explain a hang, never to become a different failure. + if _FORK_THREADS <= 1: + return + # Wrapped, because a child that cannot warn must still run: the point is + # to explain a hang, never to become a different failure. + # + # The except branch is NOT a silent pass, and that was a real defect once. + # Under `-W error` -- or a pytest `filterwarnings = error` -- `warn` RAISES + # the warning, so a bare `except: pass` turned the guard off in exactly + # the configuration that asked to be told about warnings most loudly. It + # was measured: the child hung and printed nothing. The fallback is a + # single `write` of a constant built at import, which is the most that can + # safely be done in a child forked from a threaded process. + # + # It degrades to a stderr line rather than an exception on purpose: an + # exception raised from an at-fork handler has nowhere to go. + try: + warnings.warn(_FORK_WARNING.format(n=_FORK_THREADS), + RuntimeWarning, stacklevel=2) + except Exception: try: - warnings.warn(_FORK_WARNING.format(n=_FORK_THREADS), - RuntimeWarning, stacklevel=2) - except Exception: # pragma: no cover + os.write(2, _FORK_WARNING_BYTES) + except OSError: # pragma: no cover pass diff --git a/tests/suites/model/test_runtime.py b/tests/suites/model/test_runtime.py index 24d0fb6..924c4db 100644 --- a/tests/suites/model/test_runtime.py +++ b/tests/suites/model/test_runtime.py @@ -270,3 +270,28 @@ def test_a_real_fork_after_parallel_work_warns_in_the_child(model, os.waitpid(pid, 0) os.close(read_fd) assert answer == b"1", "the child was not warned that it had forked" + +def test_the_fork_warning_survives_warnings_as_errors(capfd): + """The guard must speak when warnings are errors, which is where it was mute. + + `_after_fork_in_child` wraps `warnings.warn` so that a child which cannot + warn still runs. Under `-W error`, or a pytest `filterwarnings = error`, + `warn` RAISES instead of printing -- so the wrapper turned the guard off + in exactly the configuration that asked to hear about warnings most + loudly. Measured before the fix: the child hung and printed nothing. + + `capfd` and not `capsys`: the fallback is `os.write(2, ...)`, which goes + to the file descriptor and never passes through `sys.stderr`. + """ + from BEAM import runtime + before = runtime._FORK_THREADS + runtime._FORK_THREADS = 8 + try: + with warnings.catch_warnings(): + warnings.simplefilter("error") + runtime._after_fork_in_child() # must not raise + finally: + runtime._FORK_THREADS = before + err = capfd.readouterr().err + assert "fork" in err + assert "spawn" in err diff --git a/verification/baseline/RERECORDED.md b/verification/baseline/RERECORDED.md index e65c9da..05c6977 100644 --- a/verification/baseline/RERECORDED.md +++ b/verification/baseline/RERECORDED.md @@ -3481,3 +3481,81 @@ saturated 48-core node auto mode asked for 48, further past the degradation point than 16 is here, so the direction is robust and only the magnitude needs ig05. +## 2026-11-14: `pytest_cases` 1242 -> 1243, and the check that should have existed first + +`--record forkerrfallback --only pytest_cases`. One id added, none removed: + +``` +tests/suites/model/test_runtime.py::test_the_fork_warning_survives_warnings_as_errors +``` + +No other baseline moved. `gil_regions.txt` is byte-identical at 69, +`c_cases.txt` at 439, `python_api.txt` at 381 lines, and `numeric.json` (78 +keys), `math_values.json` (58 bit-identical), the saved-model sha256, thread +independence and `exact` (416 quantities) all compared equal -- although this +change edits C and the extension's sha256 moved +`4dc81355...` -> `a2cc902b...`. + +### Why: the gate was certifying something it did not check + +An independent review of the branch found it. The gate printed + + OK thread plan wiring (all 69 GIL-releasing regions resolve a thread plan; no escapes) + +under the heading "The thread plan is actually in force". The scan proves the +macro is present at the Python boundary. It cannot prove the region +underneath NAMES the plan -- and **one did not**: +`src/native/occupancy/poisson_binomial/pgf.c` carried no `num_threads` clause +at all, the only such region in `src/native`. So `py_publicness_pgf` ran at +one thread per core however narrow a team the caller's plan had resolved, +measured at 16 native threads after `set_threads(1)`. Wrapping an entry point +and applying a plan are different things: a plan is applied by NAMING it in +the clause. + +This is the same fault the `c_symbols` and `python_api` sections above +record -- a green line that asserts more than it verifies -- reproduced while +fixing it. `plan.h` carried the matching overstatement ("Every `omp parallel` +... carries `num_threads(...)` with this"), untrue twice over: 29 regions name +a budget-derived local rather than `beam_threads()`, and one named nothing. + +### What now holds it + +`check_lib.thread_count_clauses`, the brace-matched check the parallel policy +plan specified as Task 5 and that was never built. It joins `\` +continuations, strips comments, finds every `#pragma omp parallel`, and +paren-matches the `num_threads(...)` expression -- matched and not +pattern-captured, because `conc ? (int)conc : 1` contains parentheses and a +regex stopping at the first `)` truncates it. Two failures: a region naming no +count, and a count outside `_PERMITTED_THREAD_COUNTS`. + +That set is a tripwire in source rather than a recorded baseline: adding a +name to it is a decision someone makes in review, and the question it forces +is "what resolves that count". The seven forms in the tree are +`beam_threads()` (64), `conc` (14), `nth` (10), `team` (2), `conc_e`, +`conc_z` and `conc ? conc : 1`. What it rejects is +`omp_get_max_threads()`, `omp_get_num_procs()` and any literal. + +`#pragma omp for` and `omp critical` are deliberately not matched: an +`omp for` inside an enclosing `parallel` takes no `num_threads`, and +demanding one would be a demand the language rejects. + +Both failure paths were mutated against the real gate, not only unit-tested: +stripping the clause from `math/moments.c` gives `FAIL 1 parallel region(s) +name no thread count`, and changing it to `omp_get_max_threads()` gives +`FAIL 1 region(s) name a thread count that is not a permitted form`. 11 unit +tests in `verification/tests/test_thread_counts.py`. + +### The recorded id + +The same review found the fork guard mute under `-W error`: `warnings.warn` +RAISES there, and the `except Exception: pass` that existed so a child which +cannot warn still runs had turned the guard off in exactly the configuration +that asked to hear about warnings most loudly. Measured: the child hung and +printed nothing. There is now an `os.write(2, ...)` fallback of a constant +built at import -- the most that can safely be done in a child forked from a +threaded process -- and it degrades to a stderr line rather than an exception +because an exception raised from an at-fork handler has nowhere to go. The +new test uses `capfd` and not `capsys`, since the fallback writes to the file +descriptor and never passes through `sys.stderr`; it fails when the fallback +is removed. + diff --git a/verification/baseline/pytest_cases.forkerrfallback.txt b/verification/baseline/pytest_cases.forkerrfallback.txt new file mode 100644 index 0000000..e9154bd --- /dev/null +++ b/verification/baseline/pytest_cases.forkerrfallback.txt @@ -0,0 +1,1242 @@ +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_fork_warning_names_the_hang_and_the_remedy +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 e9154bd..6cc9b27 100644 --- a/verification/baseline/pytest_cases.txt +++ b/verification/baseline/pytest_cases.txt @@ -1022,6 +1022,7 @@ 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_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