Skip to main content

The principle

The library’s implementation works on integer codes. The tests check it against an oracle written separately on exact fractions, straight from the format’s definition, that never sees a code. The two must agree on the result and on the event for every case. Nothing is ever compared with a float tolerance.

What runs when

CI runs the suite on Python 3.10, 3.12 and 3.13 on every push, plus the stage tours. Today: 732 tests per commit.

Running it yourself

SF_TEST_SEED and SF_TEST_RANDOM_PAIRS control the sampled widths. The golden code files under tests/golden/ are regenerated with python tools/make_golden.py only when the format definition itself changes.

Test files

Plugging in a new target

A simulator or the chip is tested the same way: register it as a device, point the device tests at its name, and run. Any difference in a code or an event count is a real disagreement between the hardware and the specification. Plugging in hardware →