Commit graph

5 commits

Author SHA1 Message Date
cb18b24627 fix(julia): swap a/b operands in DIV_SAT_Q16 to match Lean spec 2026-06-30 18:12:34 -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
1ae311c63f fix(avm-ports): add Q0_16 support to Julia and R ports
Julia port:
- Extended type tracking from Bool (is_q16) to Int8 tri-state (TYPE_BOOL/Q16/Q0)
- Added ADD_SAT_Q0 / SUB_SAT_Q0 primitive handling
- Added avm_q0_clamp for symmetric Q0_16 range [-32767, 32767]

R port:
- Added PRIM_ADD_Q0 / PRIM_SUB_Q0 primitives
- Added push_q0 instruction, make_q0 / is_q0 helpers
- Added avm_q0_clamp for symmetric Q0_16 range
- Fixed LOAD to preserve type tag on restore

All three ports now support the full AVM ISA type universe (Q0_16, Q16_16, Bool).
2026-06-30 17:39:06 -05:00
aeb87d86c8 fix(avm-ports): align all 3 ports with Lean reference
Fixes applied to Rust, Julia, and R AVM ISA ports:

1. Division rounding: use floor division (matching Lean Int.ediv)
2. Clamp range: symmetric [-2147483647, 2147483647] for Q16_16,
   [-32767, 32767] for Q0_16 (preserves negation involution)
3. V6 sign-decomposition comparison for ltQ16
4. Stack depth limit: maxStackDepth = 1024 with StackOverflow error
5. Added AVM-specific constants and helpers to each port

All three ports now match the Lean reference specification.
2026-06-30 17:37:01 -05:00
ae56141a9f feat(wolfram): add Wolfram Alpha MCP server + SOPS-encrypted API key 2026-06-30 17:28:22 -05:00