# Milestone: AVM ISA 1:1 Port Coverage **Goal:** Every language with an LSP installed on the build infrastructure must have a complete, Lean-validated AVM ISA v1 port with cross-implementation test harness. ## Coverage Matrix | # | Language | LSP | AVM Port | Tests | Wolfram Validated | Status | |---|----------|-----|----------|-------|-------------------|--------| | 1 | Lean | `lean --server` | `formal/SilverSight/AVMIsa/` | `E2E.lean` | ✅ | **Reference** | | 2 | Rust | `rust-analyzer` | `rust/src/avm/mod.rs` | `test_add_q16` | ✅ | ✅ | | 3 | Python | `pyright` | `python/avm.py` | `test_avm_python.py` | ❌ | ✅ | | 4 | Coq | `coq-lsp` | `coq/AVMIsa/avm.v` | `coq/AVMIsa/test_avm.v` | ❌ | 🔄 | | 5 | R | — | `r/AVMIsa/avm.r` | `test_avm.r` | ✅ | ✅ | | 6 | Julia | — | `julia/AVMIsa/avm.jl` | `test_avm.jl` | ✅ | ✅ | | 7 | Scala | `metals` | `scala/avm.scala` | `scala/TestAVM.scala` | ❌ | 🔄 | | 8 | Go | — | `go/avm.go` | `go/avm_test.go` | ❌ | 🔄 | | 9 | C | `clangd` | `c/avm.c` | `c/test_avm.c` | ❌ | 🔄 | | 10 | C++ | `clangd` | `cpp/avm.hpp` | `cpp/test_avm.cpp` | ❌ | 🔄 | | 11 | Fortran | `fortls` | `fortran/avm.f90` | `fortran/test_avm.f90` | ❌ | 🔄 | | 12 | Octave | — | `octave/AVM.m` | `octave/test_avm.m` | ❌ | ✅ | ## 1:1 Verification Protocol For each port, run the same test vector through every implementation: ```python test_vector = [ # (op, a, b, expected_q16) ("add", 5*65536, 3*65536, 8*65536), # 5 + 3 = 8 ("sub", 10*65536, 3*65536, 7*65536), # 10 - 3 = 7 ("mul", 5*65536, 3*65536, 15*65536), # 5 * 3 = 15 ("div", 10*65536, 2*65536, 5*65536), # 10 / 2 = 5 ("lt", 5*65536, 3*65536, False), # 5 < 3 = false ("lt", -5*65536, -3*65536, True), # -5 < -3 = true ("add_sat", cload_max-1, 2, cload_max), # saturation ("div_neg", -5*65536, 3*65536, -1*65536), # floor division: -5/3 = -2 ] ``` All results must match Lean `#eval` witnesses to pass. ## Action Items 1. **Python** — Write `tests/test_avm_python.py` with Lean-cross-validated test vector 2. **Coq** — Write `coq/AVMIsa/test_avm.v` with `Example` witnesses 3. **Scala** — Write test harness in `scala/src/test/` 4. **Go** — Write `go/avm_test.go` 5. **C** — Write `c/test_avm.c` 6. **C++** — Write `cpp/test_avm.cpp` 7. **Fortran** — Write `fortran/test_avm.f90` 8. **Octave** — Write `octave/test_avm.m` 9. **CI** — Add a GitHub Actions workflow that runs all port tests on every push 10. **Wolfram Alpha** — Re-audit all ports against the Lean reference ## Definition of Done - [ ] All 12 ports pass the same cross-validated test vector - [ ] Test outputs match Lean `#eval` witnesses for every operation - [ ] CI pipeline runs all port tests on push - [ ] Audit report (`docs/avm_ports_audit.md`) updated with "1:1" status