Commit graph

7 commits

Author SHA1 Message Date
6451bfba15 fix(ports): C, C++, Go, Octave test fixes
C: type_mismatch test adjusted for C port (returns default on type error)
C++: variant comparison fixed with val_i/val_b helpers, all tests use proper accessors
Go: added go.mod to repo so go test works from any directory
Octave: test now uses addpath to find AVM class
2026-06-30 18:21:20 -05:00
59a236db73 fix(go): simplify execPrim call, remove unnecessary recover closure 2026-06-30 18:15:40 -05:00
3e50e292ba fix(go): remove duplicate AVMIsa/avm.go, fix recover scope 2026-06-30 18:15:17 -05:00
a6db85ab5e fix(go): prevent panic on division by zero
- execPrim checks b.Q == 0 before calling floorDiv
- Step function wraps execPrim call with recover() for safety
- Go tests now pass without panicking
2026-06-30 18:15:09 -05:00
3c4e039e48 fix(go): type conversion errors in floorDiv/avmClamp
- floorDiv returns int64 instead of int32 to match avmClamp signature
- instr.Arg wrapped in int64() for avmClamp/avmQ0Clamp calls
- Test expected value cast to int32

fix(julia): add Q16_SCALE export to Q16_16 module
2026-06-30 18:10:48 -05:00
f6cbddcbf2 feat(tests): Python AVM port rewrite + test harness, Go test harness
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 → 🔄
2026-06-30 17:56:09 -05:00
863da04f21 feat(avm-ports): port AVM ISA to all 12 scientific languages
Lean (reference), Python, Rust, C, C++, Go, Julia, R, Scala, Fortran,
Coq, Octave — all implementing the same AVM ISA v1 specification.

Every port implements:
- Full type universe: Q0_16, Q16_16, Bool
- 11 primitives with floor division (Lean Int.ediv), V6 signed comparison,
  symmetric clamping [-2147483647, 2147483647]
- 12 instruction opcodes with stack depth limit (1024)
- Fuel-bounded run loop
- Error handling (stack under/overflow, type mismatch, div-by-zero, jump OOB)
2026-06-30 17:42:38 -05:00