Ruview/python/tests
Dragan Spiridonov bc0e8fd031 test(python): close the three parity-review findings (native anchor in CI, NaN, cosine)
A cross-vendor review of the parity rework (2febbb81) found three issues; all
verified and fixed here.

1. HIGH — the native≈golden half never ran in CI, so a binding marshalling bug
   could pass. The golden vectors were regenerated through the Python binding,
   and only pytest (binding vs that golden) runs in CI — the native reference
   tests in `python/tests/aether_parity.rs` link against the PyO3 crate and no
   workflow runs them. A stable PyO3 conversion defect present at regeneration
   would therefore be baked into the golden and go undetected.

   Fix: a real native parity test IN the `wifi-densepose-aether` crate
   (`tests/golden_parity.rs`), which is std-only and a member of the v2
   workspace, so it runs under the existing `cargo test --workspace`. It
   recomputes the embedding with no PyO3/marshalling and asserts it matches the
   SAME committed golden within tolerance. Now native≈golden AND binding≈golden
   both run in CI ⇒ binding≈native, and a binding-specific artifact in the
   golden surfaces here as a native mismatch. serde_json added as a
   dev-dependency only (test-only; never linked into the lib or the wheel, so
   the crate stays runtime-dependency-free).

   Independently proven at this commit: native output equals the committed
   golden BIT-FOR-BIT (128/128 exact bits, Δ=0) for both base and loaded — the
   golden is native-faithful today; this test keeps it that way.

2. MEDIUM — the Python parity helper passed non-finite output. `abs(nan - b) >
   tol` is False, so an all-NaN embedding slipped through. Now every element
   must be `math.isfinite` first. Proven: an all-NaN vector is rejected
   ("element 0 is not finite (nan)"); the Rust helpers already caught it via
   `<=`.

3. LOW — a coherent shift inside the per-element tolerance could move the whole
   vector undetected. Added a whole-vector cosine-similarity bound (≥ 1 - 1e-6)
   alongside the per-element check.

Verified on aarch64/macOS: `test_aether` 13, full `python/tests/` suite 227
passed against a `--features sota` build; the new native test passes
(2/2) run standalone (the in-worktree `cargo test -p` only failed on an
un-checked-out submodule; ci.yml checks out submodules recursively).

Co-Authored-By: Ruflo & AQE
2026-07-24 12:29:23 +02:00
..
golden fix(python): ship SOTA bindings in release wheels; make parity tests arch-portable 2026-07-24 10:45:00 +02:00
aether_parity.rs fix(python): ship SOTA bindings in release wheels; make parity tests arch-portable 2026-07-24 10:45:00 +02:00
aether_weights_parity.rs fix(python): ship SOTA bindings in release wheels; make parity tests arch-portable 2026-07-24 10:45:00 +02:00
mat_parity.rs feat(adr-185): P3 MAT bindings (wifi_densepose.mat) + parity harness 2026-07-21 16:49:49 -07:00
meridian_parity.rs feat(adr-185): P2 MERIDIAN bindings (wifi_densepose.meridian) + parity harness 2026-07-21 16:38:17 -07:00
test_aether.py test(python): close the three parity-review findings (native anchor in CI, NaN, cosine) 2026-07-24 12:29:23 +02:00
test_bfld.py feat(adr-117): pip wifi-densepose modernization (PIP-PHOENIX) + ruview sibling release (#786) 2026-05-24 13:00:38 -04:00
test_client_ha.py feat(adr-117): pip wifi-densepose modernization (PIP-PHOENIX) + ruview sibling release (#786) 2026-05-24 13:00:38 -04:00
test_client_mqtt.py feat(adr-117): pip wifi-densepose modernization (PIP-PHOENIX) + ruview sibling release (#786) 2026-05-24 13:00:38 -04:00
test_client_primitives.py feat(adr-117): pip wifi-densepose modernization (PIP-PHOENIX) + ruview sibling release (#786) 2026-05-24 13:00:38 -04:00
test_client_ws.py fix(client): send Authorization bearer token on WS upgrade (closes #1395) 2026-07-22 07:20:32 -07:00
test_keypoint.py feat(adr-117): pip wifi-densepose modernization (PIP-PHOENIX) + ruview sibling release (#786) 2026-05-24 13:00:38 -04:00
test_mat.py fix(python): ship SOTA bindings in release wheels; make parity tests arch-portable 2026-07-24 10:45:00 +02:00
test_meridian.py fix(python): ship SOTA bindings in release wheels; make parity tests arch-portable 2026-07-24 10:45:00 +02:00
test_pose.py feat(adr-117): pip wifi-densepose modernization (PIP-PHOENIX) + ruview sibling release (#786) 2026-05-24 13:00:38 -04:00
test_security.py feat(adr-117): pip wifi-densepose modernization (PIP-PHOENIX) + ruview sibling release (#786) 2026-05-24 13:00:38 -04:00
test_smoke.py feat(adr-117): pip wifi-densepose modernization (PIP-PHOENIX) + ruview sibling release (#786) 2026-05-24 13:00:38 -04:00
test_vitals.py fix: rename HeartRateExtractor.extract() weights param to phases 2026-07-18 17:26:16 -04:00