Skip to content

Tier 1: Core numeric operators and math functions#31

Merged
kavanaghpatrick merged 17 commits intomainfrom
feat/tier1-numeric-ops
Mar 8, 2026
Merged

Tier 1: Core numeric operators and math functions#31
kavanaghpatrick merged 17 commits intomainfrom
feat/tier1-numeric-ops

Conversation

@kavanaghpatrick
Copy link
Copy Markdown
Owner

Summary

  • Add 9 new math opcodes (POW, SQRT, SIN, COS, EXP, LOG, ABS, MIN, MAX) wired through full pipeline: opcodes β†’ VM β†’ bytecode β†’ Metal kernel β†’ GPU glue β†’ C compiler
  • Transpiler support for ** operator, math.sqrt/sin/cos/exp/log(), abs()/min()/max() builtins, math.pi/math.e constants
  • random.uniform(a, b) and random.gauss(mu, sigma) via inline expansion
  • Chained comparisons (a < b < c)
  • 778 tests passing (63+ new tests added)

Closes #27

Test plan

  • All 9 opcodes work in VM with correct results
  • Transpiler handles **, math.*, builtins, constants, chained comparisons
  • random.uniform returns values in range, random.gauss returns float
  • Bytecode encoding for all 9 new ops
  • Metal kernel compiles with all new dispatch cases
  • C compiler emits correct math.h calls
  • Full regression: 778 tests, 0 failures

πŸ€– Generated with Claude Code

claude added 17 commits March 8, 2026 11:17
Spec artifacts:
- research.md: feasibility analysis and codebase exploration
- requirements.md: user stories and acceptance criteria
- design.md: architecture and technical decisions
- tasks.md: POC-first implementation plan (18 tasks, 4 phases)

Ready for implementation.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
749 tests pass, zero failures. All 9 math opcodes (POW, SQRT, SIN, COS,
EXP, LOG, ABS, MIN, MAX) working end-to-end through VM and transpiler.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@kavanaghpatrick kavanaghpatrick merged commit 6312443 into main Mar 8, 2026
4 checks passed
@kavanaghpatrick kavanaghpatrick deleted the feat/tier1-numeric-ops branch March 8, 2026 03:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tier 1: Core numeric operators and math functions

2 participants