# Benchmarks

Channel: development; package: 2.0.0rc1; source: 2c32b7cf79b796fae825bfa08fc73d9914e61723

Page: https://remilab.ai/rfx/guide/benchmarks/
Source: https://github.com/bk-squared/rfx/blob/2c32b7cf79b796fae825bfa08fc73d9914e61723/docs/public/guide/benchmarks.mdx

This page lists the comparisons between rfx and other solvers that ship with the
repository. For each one it says what is compared, against which reference,
what the committed run shows, and how to reproduce it. For how these fit with
the analytic tests and your own checks, read
[Cross-Validation and Accuracy](https://remilab.ai/rfx/guide/validation/).

  Each case checks one geometry, mesh, band, port and observable. A pass says
  rfx agrees with the reference there. It does not validate other geometries,
  meshes or a whole port family.

## Reference cases

Each comparison is a test under `tests/crossval/`. It solves the structure in
rfx and compares the result with a reference record frozen in the repository,
so you do not need the other solver to re-check rfx. The records say which
solver, version and mesh produced them.

### Probe-fed patch on RT/Duroid 5880

| | |
|---|---|
| Structure | A 39.7 × 49.25 mm patch on 3.175 mm RT/Duroid 5880 (εr 2.2, tan δ 0.001) over a 55.6 × 65.1 mm ground, fed by a 50 Ω probe 8.73 mm off centre. |
| Reference | openEMS, the same board on three meshes, judged against its finest one. |
| rfx meshes | a uniform ladder at h/4, h/8 and h/12 (4, 8 and 12 cells through the substrate). The board is drawn so all three rungs realize the same patch, and the test refuses a rung that does not. |
| Judged | the TM010 resonance (where Re(Z_in) peaks) within 1 %, and the input resistance there within 2 %, on the finest rung; the last two rungs must agree within 1 % (mesh statement), and the record must ring down to −40 dB. |
| Reported, not judged | the `\|S11\|` dip frequency and depth, the reactance at resonance and the −10 dB band edges. Neither solver declares a probe radius, so each feed cell sets the probe's series reactance, and that moves the dip. |
| Result | pending for 2.0 (tracker 1471): the case is being re-measured under the current settling check, which judges each frequency bin a result reads; no agreement figure is quoted until that run is in the repository. The case was added in [bk-squared/rfx#1315](https://github.com/bk-squared/rfx/pull/1315). |
| Test | `tests/crossval/rt5880_patch/test_rt5880_patch.py` |

The case judges the resonance and the input resistance, not the `|S11|`
curve, because the two solvers' probe models differ. It says the cavity, its
fringing and its radiation loss agree with openEMS on this board. It does not
say a patch on a different board or mesh is within 1 %.

  [Real and imaginary parts of the input impedance of the RT/Duroid 5880 probe-fed patch from rfx and from openEMS on its finest mesh, 2.0 to 2.9 GHz](https://remilab.cnu.ac.kr/share/7c02ad43c580/forward-patch/forward_curves_rt5880_patch_site.png)

  Input impedance of the RT/Duroid 5880 patch, rfx and openEMS on the same board. [The forward model, next to openEMS →](https://remilab.ai/rfx/showcase/forward-checks/)

## More comparisons

The other comparisons under `tests/crossval/`. Most are long and marked `gpu`
or `slow`.

| Structure | Compared with | Test |
|---|---|---|
| Microstrip open-stub notch filter, `\|S21\|` | openEMS tutorial result and Palace FEM | `tests/crossval/msl_notch_filter/` |

The notch filter is pending for 2.0 (tracker 1471): it is being re-measured
under the current settling check, and its uniform-mesh ladder is not yet shown
to converge on the drawn 600 µm line. No agreement figure is quoted until that
run is in the repository.

  [|S21| and |S11| of the microstrip open-stub notch filter from rfx and from openEMS on its finest mesh, 2 to 7 GHz](https://remilab.cnu.ac.kr/share/7c02ad43c580/forward-notch/forward_curves_msl_notch_filter_site.png)

  |S21| and |S11| of the microstrip open-stub notch filter, rfx and openEMS on the same board. [The forward model, next to openEMS →](https://remilab.ai/rfx/showcase/forward-checks/)

Structures with a closed form are checked against that closed form, not
against another solver. Those tests are in `tests/oracle/`.

## Reproduce

The comparisons are pytest tests. The long ladders are marked `gpu` and
`slow`, so the pull-request suite never runs them. From a source checkout:

```bash
# The fast checks: build each board, check what it realizes, read the records.
pytest tests/crossval/rt5880_patch

# The full ladder (a GPU; the h/12 rung is about 53 M cells).
pytest tests/crossval/rt5880_patch -m gpu
```

`RFX_RT5880_PATCH_RUNGS=793.75e-6` runs only the coarsest rung. That is a
diagnostic, not the case's verdict, because the mesh statement needs the
ladder.

## Limits

- **One board is not every patch.** The patch case covers one board and one
  probe feed. For your own patch, run a convergence study and compare with a
  reference, as in [Your First Patch Antenna](https://remilab.ai/rfx/examples/first-patch/).
- **Magnitude comparisons do not cover phase.** The two filter cases compare
  `|S21|` only. On the notch filter, rfx also runs shorter feed lines than the
  reference, which moves the phase but not the magnitude.
- **Scripts under `validation/research/` are not reference cases.** They are
  research checks for features outside the documented scope.
