# Joint hidden-wave and distance test

This module tests whether a wave-reconstructed coordinate predicts separately measured distances under an explicit metric and instrument model. All newly generated data here are synthetic. Read `JOINT_GEOMETRY.md` before interpreting the outputs.

## What is fitted

`joint_decoder.fit_metric` receives calibrated visible positions `q` with shape time × markers × 3, reconstructed hidden coordinates `h` with shape time × markers, selected calibration pairs and frames, instrument-A ranges, and known range-noise standard deviation. It fits relative signs and one common squared scale. It does not receive the true hidden trajectory or reserved ranges.

`joint_decoder.evaluate_reserved` receives independent instrument-B ranges and evaluates the frozen fit. The conditional p-value tests exact flat-3D ranges with unbiased independent Gaussian ranging errors, given exact visible positions. It is not a probability that a spatial dimension exists.

The pilot uses eight markers and exhaustively searches 128 sign assignments. The implementation caps the exhaustive search at 12 markers; it is not a scalable general sign-synchronization algorithm. Unknown equilibrium offsets and arbitrary per-marker unit conversions are outside the fitted family.

## Critical ambiguity

An ordinary-space instrument response can be defined that produces exactly the same ranges as the proposed 4D metric. The shared-bias control verifies this identity. Independent random noise in two instruments does not establish independence of their systematic errors. An independently constrained interaction and calibration model is needed to interpret the recovered coordinate spatially.

## Reproduce

From the archive root:

```bash
OPENBLAS_NUM_THREADS=1 python geometry_v4/run_joint.py
python geometry_v4/bias_sensitivity.py
OPENBLAS_NUM_THREADS=1 python geometry_v4/plot_joint.py
python geometry_v4/make_report.py
```

No downloads are required. Both the joint decoder and reused wave identifier are hash-checked. The primary results have not been tuned after execution. `bias_sensitivity.py` is a declared post-benchmark analytic calculation for the predetermined ensemble-0 example.
