# RMO-71: local MHD diagnosis from anonymous state pairs

Date: 2026-09-06. Scope: four frozen synthetic pairs, one planar discontinuity per pair.

## Result in one sentence

A new diagnostic procedure, given complete states and a front speed without a
family label, supports a fast shock, a slow shock, a contact and a rotational
discontinuity for the four corresponding saved examples; separate arithmetic
checks agree.

This is the first local diagnostic demonstration in this continuation. It is
not a new full Riemann solver, an observational classification, a blind external
benchmark or a calibrated accuracy estimate. QuickLook remains version 0.4.3;
this module has not been connected to its inputs.

## Inputs and separation of labels

`inputs/A17.json`, `A42.json`, `A63.json` and `A88.json` contain only anonymous
identifiers, two states, the local orthonormal basis, the common frame, front
speed, gamma, model, normalized units and an exact-synthetic uncertainty flag.
Density and pressure are positive; each velocity and field has three components.
The normal is oriented from the left region to the right region. Normal/tangential
components are already expressed in that basis.

The function `diagnose(request)` uses only that request. It has no production
solver or benchmark imports, reference-file access, fixture-name dispatch or
family argument. The verifier calls it for all four cases before reading the
separate `scoring_reference.json`. Changing the anonymous ID does not change the
family. An injected `expected_family` field is rejected.

These are **known known test fixtures**, not held-out observations or an
experiment in which the developer was blinded. In particular, B04/B05 downstream
states were originally generated by the production shock-branch code, whose
benchmark selected a root using the expected family. This historical selection
is disclosed and is not repeated by the new diagnostic. The scoring labels
therefore are not an independent external reference. Independent conservation
and characteristic arithmetic provides a second check, with the limits below.

## Nominal results

| Anonymous input | Computed local class | Transition | Density ratio downstream/upstream | Tangential field ratio | Front-frame scaled RH residual |
| --- | --- | --- | ---: | ---: | ---: |
| A63 | fast shock | 1 → 2 | 2.4239556300003606 | 2.610791431789725 | 5.942e-15 |
| A17 | slow shock | 3 → 4 | 2.0675716281885492 | 0.7973808545780512 | 7.240e-16 |
| A42 | contact | No mass-flow ordering | — | — | 0.000e+00 |
| A88 | rotational discontinuity | boundary → boundary | 1.0 | 1.0 | 0.000e+00 |

For A42 the density values are 1.0 and 0.5. Both normal velocities equal the
front speed 0.2; there is no upstream/downstream mass-flow ordering. Pressure,
velocity and field are continuous. For A88 the field rotates by 90 degrees,
density and pressure stay fixed, and the velocity change is Alfvenic. Its speed
is 1.0 in the supplied frame. Both shock examples have front speed S = 0.
All values here are normalized; they are not solar km/s, gauss or densities.

## Why the shock labels follow

The evaluation uses a stationary-front frame and removes a common tangential
velocity for numerical conditioning. It checks all seven conservation equations,
shared normal field, the mass-flow direction, entropy and characteristic ordering.
The four ordinary local classes are evaluated together. A failed calculation or
an unimplemented branch does not receive EXCLUDED.

The regular fast/slow transitions used here are 1 → 2 and 3 → 4, respectively;
characteristic boundaries and intermediate transitions require separate treatment.
These definitions and the ideal-MHD equations are given in Section 2 of
[Takahashi & Yamada, exact MHD Riemann solver](https://arxiv.org/pdf/1310.2330).

| Case/side | Plasma speed relative to front | Slow speed | Normal Alfven speed | Fast speed |
| --- | ---: | ---: | ---: | ---: |
| A63 upstream | 3.200000 | 0.487428 | 0.700000 | 1.436111 |
| A63 downstream | 1.320156 | 0.334331 | 0.449610 | 2.301556 |
| A17 upstream | 0.973773 | 0.539929 | 1.695594 | 1.821205 |
| A17 downstream | 0.470974 | 0.733800 | 1.179211 | 1.260854 |

A63 crosses the fast characteristic while its downstream flow stays above the
normal Alfven speed. A17 crosses the slow characteristic and remains below the
normal Alfven speed. Both compress the plasma and increase entropy. Their
transverse-field changes agree with these local classifications. The field ratio
alone was not used as a classification rule.

For these exact state/speed pairs, the other three implemented local classes
fail their required conditions. This statement applies to the specified single
discontinuity model. Full-fan alternatives, unresolved compound structures,
smooth waves and image-formation explanations have not been excluded.

## Independent checks and fixed controls

The existing `verification/decimal_checks.py` evaluates the seven conserved-flux
jumps in the original inertial frame using 60-digit Decimal arithmetic. It
imports no production RMO package and does not call the new diagnostic. Its
characteristic speeds agree with the diagnostic's binary64 speeds within 1e-12.
Separately counted incoming characteristics give the fast and slow transitions;
Decimal entropy changes have the required sign.

Higher arithmetic precision does not increase the precision of the supplied
saved states. These two implementations share ideal-MHD equations, so agreement
does not remove shared model assumptions or provide third-party certification.
The exact contact and rotation fixtures provide analytic controls.

**63 assertions pass** in the fixed verification script. They cover the four
nominal cases, independent residual/speed arithmetic, historical-reference
comparison, incoming-characteristic and entropy checks, identifier changes,
normal reversal with side relabelling, a three-component Galilean boost,
tangential-basis rotation and consistent MHD similarity scaling. The scaling
check is not a physical-unit import feature.

Deterministic negative controls include a 1% pressure change, a front-speed
error of 0.01, missing normal field, missing front speed, unknown covariance,
time-reversed entropy-decreasing shocks, vanishing normal field, equal states,
label injection, inconsistent normal fields and negative pressure. They produce
no supported shock label where the declared prerequisites fail. Their statuses
remain different: missing data, inconsistent exact states, degenerate domain,
unimplemented uncertainty and unresolved other structures are not one condition.

These controls are **not uncertainty propagation**. Perturbed exact states were
checked against exact conservation; we have not asked whether noisy measurements
could be fitted within their errors. No Monte Carlo run, coverage estimate,
false-positive rate or B13 uncertainty calibration result is claimed.

## Domain and next dependency

Implemented: exact-synthetic, normalized, ideal-gas ideal MHD, positive density
and pressure, a common known frame and front speed, a supplied right-handed
normal basis, and an ordinary finite single discontinuity with nonzero normal
field. Fast/slow shocks must avoid characteristic coincidences and switch limits.
The contact and rotational invariants are tested explicitly.

The frozen conservation tolerance is 1e-10, normal-field tolerance 1e-12,
state-comparison tolerance 5e-9, speed-boundary tolerance 1e-9 and entropy allowance
-1e-10. Residual scaling and frame are recorded in each output. No old tolerance
or solver policy was relaxed.

Intermediate shocks, switch limits, tangential discontinuities at B_n = 0,
compound structures, full Riemann fans, observational errors, covariance and
imaging operators require further work. Their absence from this implementation
cannot establish a unique global solution or reject an observed interpretation.

The next scientific dependency is a separately scoped uncertainty-aware test:
propagate a declared joint error model, test false exclusions and retained
alternatives, and then select a solar case by the measurements it actually
provides. EUV intensity alone does not supply the two full states used here.
No mandatory IRIS or stereoscopic input has been introduced.

## Reproduce and inspect

From the project root:

```sh
python3 local_diagnosis/diagnose.py local_diagnosis/inputs/A63.json
python3 local_diagnosis/verify_diagnosis.py
python3 local_diagnosis/plot_results.py
```

The classifier uses the Python standard library. The figure script uses
Matplotlib and reads checked outputs only; no scoring labels are used to draw
its data or choose the displayed class. The PDF was rendered and visually
inspected. It is a speed-ordering comparison, not a full fan or a continuous
map of all MHD branches.

These local-diagnostic input files use their own documented schema. They are
not literature drafts for the existing QuickLook file-import control.

No production numerical core or current HTML was changed.  The earlier project history and the HTML comparison are retained.
