Cross-language conformance test suite for the Conservation Spectral SDK — verifies that Python, C, JavaScript, and Rust implementations produce identical spectral results.
- Reference test vectors — Precomputed adjacency matrix with expected eigenvalues, eigenvectors, conservation ratios, spectral gap, and Cheeger constant
- Four language runners — Automated comparison against Python, C (gcc), JavaScript (Node), and Rust implementations
- Configurable tolerances — Eigenvalue (1e-6), eigenvector (1e-4), conservation ratio (1e-4), and scalar (1e-6) tolerances
- Pass/fail summary — Clear ✅/❌ output per implementation with per-value detail
# Run conformance tests against all implementations
python run_conformance.pyOutput:
╔══════════════════════════════════════════════════════════════╗
║ Conservation Spectral SDK — Cross-Language Conformance ║
╚══════════════════════════════════════════════════════════════╝
📊 CONFORMANCE SUMMARY
Python ✅ PASS
C ✅ PASS
JS ✅ PASS
Rust ✅ PASS
🎉 ALL IMPLEMENTATIONS CONFORM
- Loads
expected_results.json— reference vectors computed bycompute_reference.py - For each language, builds the same 5-vertex chord-progression graph
- Runs Laplacian construction → eigendecomposition → conservation analysis
- Compares results against reference within tolerance
- Reports per-value agreement and overall pass/fail
| File | Purpose |
|---|---|
expected_results.json |
Reference eigenvalues, eigenvectors, ratios, scalars |
test_vectors.json |
Input adjacency matrix and attributes |
compute_reference.py |
Generate reference results from the Python SDK |
run_conformance.py |
Main conformance runner (Python, C, JS, Rust) |
This is the conformance layer for the conservation spectral ecosystem:
- Rust: conservation-spectral
- Python: conservation-spectral-python
- TypeScript: conservation-spectral-js
- Ada: conservation-spectral-ada
All implementations must pass this suite before release.
- Python ≥ 3.10 with
numpy,scipy, and theconservation-spectralpackage installed gccfor C testsnodefor JavaScript testscargofor Rust tests
MIT