Verification
BetterSPICE sorts its devices into two classes, exact and approximate, and says which class every part is in, in reports and in the library's level badges (a group shows a badge only when it's not exact). Exact and approximate explains what the classes mean. This chapter is how they are checked.
58.1The verification set
438 circuits in verification/circuits each come with an expected result. Run the check yourself:
bspice verify verification/circuits --html verification/report.html
It runs every circuit in both engines, compares every signal and writes an HTML report with overlay plots: BetterSPICE solid, ngspice dashed. The logic parts are part of those ngspice runs, and an inductor's current is compared with its parallel Rp and Cp included. It exits with 1 if any circuit fails. --failures lists only failures, --json writes machine-readable results.
| Set (0.8.0) | Circuits | Analyses | Signals | Result |
|---|---|---|---|---|
verification/circuits | 438 | 791 | 4,892 | all pass: 3,797 against ngspice, 1,095 against a closed form or a datasheet window |
verification/params (datasheet parameters) | 74 | 117 | 417 | all pass |
bspice verify examples --all | 193 of the 715 examples compared point by point | 3,415 | all pass. The rest hold approximate-class parts or vendor models and are skipped or measured as approximate, with the parts named. |
Not comparable is not a failure. A comparison with ngspice fails only when ngspice has the function, a model or element for the part, and the results disagree. Parts ngspice cannot simulate, such as the microcontroller, ctrl scripts and behavioural blocks with no ngspice element, are checked on BetterSPICE's own result against a closed form or a datasheet window instead. 162 of the 438 circuits are checked that way, and the run notes closed-form checks on bs-engine's result (no ngspice reference for these parts). A run that compares nothing says SKIP with the reason and exits with 1, never 0 / 0 pass. A circuit with vendor models is compared with the deck Simulate runs, and a switching one is measured by its steady state (the means of the last quarter, the switching frequency and the duty).
58.2The beta test suite
One runner checks a build before a release: python tools/test/run_tier.py quick, prerelease or weekly. Its entries cover verify and the parameter circuits, the live view against Simulate (about 6,350 checks) and the native engine against WebAssembly bit for bit, about 1,100 checks in the real app with 84 screenshot baselines and 25 import fixtures, edge cases and fuzzers for the command line, MCP and the file readers, the update path on a mock server, Linux in WSL, and the Rust and UI test suites. A skip is never counted as a pass, and a failing check of a known bug names the bug. tools/test/README.md describes the tiers and how to run one entry.
58.3The model catalogue
Every model in the library was run before it was listed. The model catalogue explains how: each model is placed in a test circuit for its kind, run in ngspice (or PSpice for encrypted models), and checked for sensible behaviour. Models that can't run in any engine aren't in the app.
58.4Robustness against ngspice and LTspice
docs/ROBUSTNESS.md counts how often each simulator reads a netlist and runs it to the end. The same netlists, 1,061 analyses from 271 verification circuits and 193 example circuits, went through BetterSPICE and ngspice 47 on 16 November 2026. BetterSPICE ran 1,060 of them to the end with its convergence rescue switched off (bspice --rescue off), which is the same footing as ngspice and LTspice, and all 1,061 with it on: the rescue fired once. ngspice did not finish 8. LTspice 26.1.1 was not run again for this release. Its column holds the runs of 8 November 2026 for the 678 analyses whose netlist is byte for byte the same as then, and it could not read 3 of them, because they use ngspice-only parameters.
| BetterSPICE (rescue off) | BetterSPICE (default) | ngspice | LTspice (8 November 2026) | |
|---|---|---|---|---|
| Netlist read (1,061 analyses) | 1,061 | 1,061 | 1,061 | 675 of 678 |
| Ran to the end | 1,060 | 1,061 | 1,053 | 675 of 678 |
| Within the strict verify tolerances of ngspice | 929 of 1,052 | 930 of 1,053 | reference | 420 of 672 |
| Median time per run | 0.06 s | 0.06 s | 0.08 s | 0.51 s |
The agreement row uses a strict point-by-point rule, stricter than bspice verify, which passes every one of its signals, so 929 of 1,052 is not a contradiction. LTspice differs more because its device models differ from ngspice's. Method, failure messages and limits are in the page.
58.5The numbers
| What | Number |
|---|---|
| Models in the library search | 169 551 |
| Example circuits | 715 in 40 categories |
| Part Wizard templates | 137 |
| Engine verification circuits | 438 |