This document describes the TNFR test suite. Only π (phase wrap) and ξ_C ∝ 1/√λ₂ are genuine structural scales; every other parameter is derived from the nodal dynamics or is a free operational parameter. Tests validate the nodal equation, structural fields, grammar U1-U6, and the 13 operators.
Pass --math-backend=<name> to pytest (or set TNFR_TEST_MATH_BACKEND) to exercise the suite under a specific numerical adapter. The flag sets TNFR_MATH_BACKEND before modules import and clears cached backend instances, ensuring that optional dependencies such as JAX or PyTorch are only used when explicitly requested.
PYTHONPATH=src pytest tests/mathematics --math-backend=torchWhen the requested backend is unavailable, pytest will skip the backend-specific tests while the remainder of the suite continues to run under NumPy.
Tests that previously covered warning cache pruning and warn-once limits were removed to reduce maintenance overhead.
performance/ – covers the NumPy-accelerated ΔNFR pipeline, alias caches, and trigonometric metrics to guard against performance regressions. The tests are marked slow and are excluded by default via the addopts setting in pyproject.toml.
pytest -m slow tests/performanceThe suite requires NumPy for the vectorized branches; pytest will skip the affected checks automatically when the dependency is missing.
Benchmark helpers remain available behind the benchmarks marker. To run them explicitly use:
pytest benchmarks --benchmark-onlyThis command complements the default --benchmark-skip flag defined in pyproject.toml.