Datasets:
expected_failures list | expected_to_pass_all_laws bool | file string | n_ports int64 | name string | note string | physically_realizable bool | sha256 string | tags list | z0_ohm float64 |
|---|---|---|---|---|---|---|---|---|---|
[] | true | passive_line.s2p | 2 | passive_line | Lossy 20 ps delay line, 0.5 dB insertion loss. The baseline sane case. | true | 74d631c14f5c18e9e9cf06bde2579628ff15820fc4b652035cd09d2809f4166d | [
"passive",
"2port"
] | 50 |
[] | true | passive_resonator.s2p | 2 | passive_resonator | Shunt resonator, Q=30 at 20 GHz. Sharp phase slope near resonance -- the case where a group-delay check without phase unwrapping fails. | true | 1a4b1e2f9f873fcdc03327dababdccce6fc3d6ab0a0968ac70b2f03a803c3f39 | [
"passive",
"2port",
"sharp_phase"
] | 50 |
[] | true | passive_attenuator.s2p | 2 | passive_attenuator | Ideal 10 dB matched attenuator. | true | ee4b89263c942825af357be7f0273716d62ea984da5d441bcaf204c70f59963d | [
"passive",
"2port"
] | 50 |
[] | true | matched_load.s2p | 2 | matched_load | All-zero S: perfectly matched, fully absorbing. A degenerate but legal network; checkers that divide by |S| must not blow up. | true | 7a60bff097406dfcb7cab59bcc837935353727634161806c53eae99ba865470b | [
"passive",
"2port",
"degenerate"
] | 50 |
[] | true | marginal_lossless.s2p | 2 | marginal_lossless | Lossless line with sigma_max = 1 - 1e-12. Sits on the passivity boundary; a checker with a too-tight tolerance false-alarms here. | true | 2dc0808d30a664b78cc263f06a9a46b48f7920bb3e9a132d56dfe4364d9179b4 | [
"passive",
"2port",
"boundary"
] | 50 |
[] | true | passive_4port.s4p | 4 | passive_4port | Four-port with two independent thru paths. Exercises N>2 handling. | true | 1c24a1157c72806fa771c2e592eb8751724c8ba5cae446dc7b798dd8b0302f17 | [
"passive",
"4port"
] | 50 |
[
"energy_conservation",
"passivity"
] | false | active_gain.s2p | 2 | active_gain | Delay line with 3x through-path gain. Creates energy: fails both the spectral-norm and the row-power tests. | false | 3f78dfcd6598f6734633a65a37e30edc8c4486c89d0c2e29cc52720780f22c32 | [
"nonphysical",
"2port"
] | 50 |
[
"energy_conservation",
"passivity"
] | false | energy_row_violation.s2p | 2 | energy_row_violation | Row power > 1 when port 1 is driven. | false | 05e30904110032dc75777b11b96dbde5398ae9e922ab64a89704f9675db7ae83 | [
"nonphysical",
"2port"
] | 50 |
[
"energy_conservation",
"passivity",
"positive_real_z0"
] | false | negative_resistance.s2p | 2 | negative_resistance | |S11| > 1 gives Re(Z_in) < 0: negative resistance at the port. It unavoidably breaks energy conservation too -- a reflection coefficient above unity returns more power than arrives -- so this case cannot isolate a single law, and the label says so. | false | 2eb111856d1bfcdfb53e93f873704073f21af7926cb2ed18f5b2ef5b3114fdcc | [
"nonphysical",
"2port"
] | 50 |
[
"group_delay_nonneg"
] | false | noncausal_advance.s2p | 2 | noncausal_advance | Phase advances with frequency: the output precedes the input. Passive and reciprocal, so ONLY the causality check should fire. | false | ede95a08f616205688b97eac8c7665b2491ce4a038767614ebc69ad0730ffe5c | [
"nonphysical",
"2port",
"isolates_one_law"
] | 50 |
[
"reciprocity"
] | false | ferrite_isolator.s2p | 2 | ferrite_isolator | A ferrite isolator. NON-RECIPROCAL BY DESIGN and entirely realizable -- the medium is not reciprocal. The reciprocity check correctly fires, and that is a true positive for the law but NOT a defect in the device. Any tool reporting this must let the user say so. | true | 574d727015c7c3bb436bf1f9723098ac12a73e0392d3e2045a1b356c53e57f30 | [
"physical",
"2port",
"expected_law_failure"
] | 50 |
- Why this exists
- 30-second quickstart
- Baseline
- The metric, and why it is not one number
- Contents
- The case worth arguing about
- Ground truth is verified, not asserted
- Scope, honestly
- A worked example: scoring a checker you just wrote
- Troubleshooting
- Files
- The rest of the toolkit
- Licence
- Related
- Contributing
- Citation
sparam-conformance
π Documentation site β the portfolio narrative, the concepts, a full walkthrough, and what all of this proves (and does not).
A labelled corpus of S-parameter networks with ground-truth physical verdicts β and a scorer that grades any checker against it.
Why this exists
There is no public dataset of physically invalid S-parameter files. Everyone building an RF validation tool tests it on files that happen to be lying around, which means nobody knows whether their checker catches the cases that matter.
This corpus is 11 networks, each synthesised from a closed-form model, so
every label is derived from construction rather than from some other tool's
opinion. We know active_gain is non-passive because we built 3Γ gain into it.
30-second quickstart
git clone https://github.com/nickharris808/sparam-conformance.git && cd sparam-conformance
python score.py --checker mypackage.mychecker:run # grade your checker
python generate.py # optional: rebuild the corpus
The corpus is committed, so scoring needs nothing installed beyond your own
checker. generate.py is only needed if you want to prove the files came from
the generator β it rebuilds them byte-identically, and CI checks that it does.
Adapter contract β five lines:
from sparam_lint import read_touchstone, run_battery
def check(path: str) -> dict[str, bool]:
net = read_touchstone(path)
return {r.name: r.passed for r in run_battery(net.s, net.freq_hz, net.z0)}
Baseline
$ python score.py --checker sparam_lint_adapter:check
sparam-conformance v1.0.0 11 cases x 5 laws
[ OK ] passive_line
[ OK ] passive_resonator
...
[ OK ] ferrite_isolator
false passes : 0 <- must be 0
false fails : 0
errors : 0
verdict : CONFORMING
The metric, and why it is not one number
A checker has two independent ways to be wrong, with very different costs:
| Meaning | Cost | |
|---|---|---|
| False pass | admits a non-physical network | the model ships |
| False fail | rejects a realizable network | annoying, erodes trust, harms nothing |
So both are reported, per law, and the verdict requires zero false passes. False fails are reported but do not fail the verdict.
There is a third state, because there is a third way to be wrong. A checker that never reports a law has not passed it β it did not look. That is neither a false pass nor a false fail, and calling it CONFORMING would be a verdict the corpus did not earn, so it gets its own name:
| Verdict | Meaning | Exit |
|---|---|---|
CONFORMING |
every law reported on every case, zero false passes | 0 |
INCOMPLETE |
zero false passes, but at least one law was never reported | 1 |
NOT CONFORMING |
a false pass, or the adapter raised | 1 |
That asymmetry is deliberate and it has a consequence worth stating plainly: a checker that rejects everything conforms. It has no false passes. It is also useless β which is why the false-fail count sits beside the verdict, and why you should read both. Optimising either number alone produces a bad tool.
Contents
| Case | Ports | Physical? | Expected failures |
|---|---|---|---|
passive_line |
2 | β | β |
passive_resonator |
2 | β | β |
passive_attenuator |
2 | β | β |
matched_load |
2 | β | β |
marginal_lossless |
2 | β | β |
passive_4port |
4 | β | β |
active_gain |
2 | β | passivity, energy |
energy_row_violation |
2 | β | passivity, energy |
negative_resistance |
2 | β | passivity, energy, positive-real Zβ |
noncausal_advance |
2 | β | group delay |
ferrite_isolator |
2 | β | reciprocity |
Several cases exist to catch specific checker bugs:
passive_resonatorβ sharp phase slope at resonance. A group-delay check that differences phase without unwrapping reports spurious negative delay here.marginal_losslessβ Ο_max = 1 β 1e-12. A checker with a too-tight tolerance false-alarms on a perfectly legal lossless line.matched_loadβ all-zero S. Checkers that normalise by βSβ divide by zero.passive_4portβ exercises N>2, where Touchstone switches from column-major to row-major ordering.
The case worth arguing about
ferrite_isolator is physically realizable and fails reciprocity.
A ferrite isolator is a real, buyable component. Its medium is non-reciprocal, so
S β Sα΅ is correct behaviour, not a defect. The reciprocity check firing here is
a true positive for the law and a false alarm for the device.
The corpus keeps it because any honest tool has to handle this: a checker that treats every law failure as a defect will reject legitimate hardware, and a checker that suppresses reciprocity to avoid the noise goes blind to genuine transpose bugs. The right answer is for the user to declare non-reciprocity expected β and the corpus exists partly to force that design decision.
Ground truth is verified, not asserted
Every label in manifest.json is re-derived from the network itself in the test
suite, by independent linear algebra β singular values for passivity, Frobenius
asymmetry for reciprocity, row power for energy. A corpus whose ground truth is
wrong is worse than no corpus, because every checker scored against it inherits
the error.
That check earned its place: it caught three wrong labels during development.
The "passive" resonator had Ο_max = 1.2441 and was not passive at all; a case
meant to isolate energy was also non-reciprocal; and negative_resistance
unavoidably breaks energy conservation too, which the original label denied.
That 1.2441 is the one figure on this page you cannot reproduce from the committed corpus β it belonged to a superseded generator revision, and the resonator that ships today has Ο_max β€ 1, which the test suite asserts. It is recorded because "we found bugs in our own ground truth" is worth more with a number attached than without one.
Generation is deterministic, files are SHA-256 pinned in the manifest, and both properties are tested.
Scope, honestly
These are synthetic closed-form networks, not measured devices. They exercise the laws and the specific bugs listed above; they are not a sample of what comes out of a real VNA, and passing this corpus does not mean a checker is correct on measured data with noise, drift and de-embedding artefacts.
11 cases is small. It is meant to be a conformance floor β a checker that fails here is definitely broken; one that passes is merely not-obviously-broken.
Contributions of new pathological cases are the most useful thing you can send.
A worked example: scoring a checker you just wrote
The corpus is committed, so this needs nothing installed except your checker.
1 β write the adapter. It maps your checker onto one dict per file: law name to boolean.
# mychecker_adapter.py
import mychecker
def check(path: str) -> dict[str, bool]:
verdicts = mychecker.analyse(path)
return {
"passivity": verdicts.passive,
"reciprocity": verdicts.reciprocal,
"energy_conservation": verdicts.energy_ok,
"positive_real_z0": verdicts.z0_ok,
"group_delay_nonneg": verdicts.causal,
}
Names must match the corpus's law names β laws at the top of
data/manifest.json is the list. A law you do not implement is absent from the
dict, which the scorer reports as not reported and which makes the verdict
INCOMPLETE. It is never silently counted as a pass.
2 β score it.
$ python score.py --checker mychecker_adapter:check
3 β read the two numbers separately. False passes must be zero: each one is a non-physical network your checker admitted, and admitting them is how a bad model ships. False fails do not fail the verdict but they are not free β a checker that rejects everything has zero false passes and no value.
The cases that most often catch a new checker, and what each one is testing:
| If you fail on | The bug is almost certainly |
|---|---|
passive_resonator |
differencing phase without unwrapping, so the sharp slope at resonance reads as negative group delay |
marginal_lossless |
a passivity tolerance too tight for Ο_max = 1 β 1e-12 |
matched_load |
dividing by βSβ, which is zero for an all-zero S-matrix |
passive_4port |
assuming column-major everywhere; N β₯ 3 is row-major |
ferrite_isolator |
treating every reciprocity failure as a defect |
That last row is the judgement call rather than a bug, and it is why the corpus keeps a physically-real device that legitimately fails a law.
Troubleshooting
errors: 11 and every case failed β the adapter raised. score.py reports
an error per case rather than crashing, so the message is in the output; the
usual cause is a checker that expects an open file object rather than a path.
false fails is high on the passive cases β your tolerances are tighter than
floating point. Look at marginal_lossless first: it sits 1e-12 below the
passivity limit precisely to catch this.
Verdict INCOMPLETE β your adapter did not report every law. Usually the
dict keys do not match the corpus's names, which are listed once at the top of
data/manifest.json under laws and per case under expect. The reference
adapter in sparam_lint_adapter.py is five lines long and gets them right.
INCOMPLETE exits 1: an unreported law was not checked, and this corpus
cannot certify what it never saw.
generate.py changes the files β it should not; regeneration is
byte-identical and CI checks it. If your run differs, you have a different numpy
version doing different rounding, which is worth reporting.
Scoring passes but your tool still ships bad models β expected. Eleven cases is a conformance floor: failing here means definitely broken, passing means not-obviously-broken. It is not a sample of what comes out of a real VNA.
Files
generate.py deterministic corpus generator
score.py scorer + adapter contract
sparam_lint_adapter.py reference adapter (5 lines)
data/*.s2p, *.s4p the corpus
data/manifest.json labels, tags, SHA-256 digests
data/index.jsonl the manifest flattened one-row-per-case, so the
Hub viewer can render it (generated by build_index.py)
build_index.py regenerates index.jsonl from the manifest
tests/ label verification + scorer tests
The rest of the toolkit
Eight artifacts that answer one question in different places: is this model physically possible? Each is a grader β it can tell you a model is wrong; none can tell you one is right.
sparam-lint |
Is an S-parameter model physically possible? Five laws + a negative control. |
maxwell-lint |
Does a coupling extractor predict impossible physics? Screening ceiling k β€ 1. |
abstain-bench |
Does a model know when to shut up? Abstention recall, never pooled with accuracy. |
sparam-conformance β you are here |
11 labelled networks with verified ground truth. Grades the graders. |
screening-ceiling |
A certified impossibility result + 27 counterexamples. Zero-dependency verifier. |
physics-lint-action |
The same checks, in your CI. |
physics-lint-mcp |
A physics oracle your AI agent can call. |
| Try it in your browser | All three checks, no install, runs client-side. |
These tools grade a model. Producing one that is passive by construction β so it cannot fail these laws whatever its parameters β and accurate at speed in the many-body regime, with calibrated abstention and a fail-closed signoff certificate, is the commercial core: ChipletOS.
Licence
CC-BY-4.0 β see LICENSE. Attribution: ChipletOS / Genesis contributors.
The corpus is synthetic and contains no proprietary or measured data.
Related
sparam-lintβ the reference checker (Apache-2.0)- ChipletOS β scattering synthesis that is passive by construction, so it cannot fail these laws whatever its parameters
Contributing
One non-negotiable rule here: every label must be derived from construction, never from another tool's opinion β and re-verified independently in the test suite. CONTRIBUTING.md has the detail. Each sibling repository states its own, and they differ β that is deliberate, and it is why each is trustworthy on its own terms.
Citation
CITATION.cff is machine-readable; GitHub renders a βCite this repositoryβ button from it.
- Downloads last month
- -