mirror of
https://github.com/allaunthefox/SilverSight.git
synced 2026-07-31 01:25:21 +00:00
Python port rewritten to match spec: - Added Q0_16, PUSH_Q0, PUSH_BOOL as separate opcodes - Added V6 comparison (lt_q16_v6) - Added floor division (Lean Int.ediv) - Added stack depth limit (AVM_MAX_STACK = 1024) - Added type checking in exec_prim - All 10 tests passing Go AVM port: added test_avm_test.go with 8 test cases Milestone: Python → ✅, Go → 🔄
2.7 KiB
2.7 KiB
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 |
❌ | ❌ | 🔄 |
| 5 | R | — | r/AVMIsa/avm.r |
test_avm.r |
✅ | ✅ |
| 6 | Julia | — | julia/AVMIsa/avm.jl |
test_avm.jl |
✅ | ✅ |
| 7 | Scala | metals |
scala/avm.scala |
❌ | ❌ | 🔄 |
| 8 | Go | — | go/avm.go |
go/avm_test.go |
❌ | 🔄 |
| 9 | C | clangd |
c/avm.c |
❌ | ❌ | 🔄 |
| 10 | C++ | clangd |
cpp/avm.hpp |
❌ | ❌ | 🔄 |
| 11 | Fortran | fortls |
fortran/avm.f90 |
❌ | ❌ | 🔄 |
| 12 | Octave | — | octave/avm.m |
❌ | ❌ | 🔄 |
1:1 Verification Protocol
For each port, run the same test vector through every implementation:
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
- Python — Write
tests/test_avm_python.pywith Lean-cross-validated test vector - Coq — Write
coq/AVMIsa/test_avm.vwithExamplewitnesses - Scala — Write test harness in
scala/src/test/ - Go — Write
go/avm_test.go - C — Write
c/test_avm.c - C++ — Write
cpp/test_avm.cpp - Fortran — Write
fortran/test_avm.f90 - Octave — Write
octave/test_avm.m - CI — Add a GitHub Actions workflow that runs all port tests on every push
- 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
#evalwitnesses for every operation - CI pipeline runs all port tests on push
- Audit report (
docs/avm_ports_audit.md) updated with "1:1" status