Skip to content

Releases

v1.1.0 - Improved Broadcasting & Slicing

Choose a tag to compare

@c2akula c2akula released this 19 Oct 21:45

✨ Feature Release

This release addresses two major limitations from v1.0.0 and enhances core tensor operations.

🔧 Fixed

Broadcasting Gradient Reduction - Fixed incorrect gradient computation when broadcasting occurs in forward pass:

  • add_backward(): Now correctly reduces gradients when shapes differ (e.g., [3,1] + [3,4])
  • mul_backward(): Now correctly reduces gradients when shapes differ (e.g., [3,1] * [3,4])
  • matmul_backward(): Fixed two critical bugs:
    • Transpose now only swaps matrix dimensions (last 2), not batch dimensions
    • Added gradient reduction for batch broadcasting (e.g., [1,3,4] @ [2,4,5])
  • Added reduce_grad_for_broadcast() helper function

⭐ Added

Enhanced Slice Functionality - Full NumPy-compatible slicing with reverse support:

  • tofu_tensor_arange(): Now supports negative steps for reverse slicing
  • tofu_tensor_rearange(): Now supports negative steps for reverse slicing
  • Examples:
    • arange(10, 0, -1) → [10, 9, 8, ..., 1] ✅
    • arange(5, 5, 1) → NULL (empty range) ✅
    • arange(0, 10, -1) → NULL (incompatible step) ✅

Comprehensive Test Suites:

  • test/standalone/test_broadcast_gradient.c: 5 broadcast gradient tests
  • test/standalone/test_arange_enhanced.c: 6 test categories with 18+ tests

📊 Testing

  • ✅ All 66 unit tests pass
  • ✅ Phase 1 validation (gradient correctness)
  • ✅ Phase 2 validation (architecture)
  • ✅ Phase 3 validation (classification & regression)
  • ✅ 23+ new tests for enhanced functionality

🚀 Performance

  • No performance regressions
  • Minimal overhead for gradient reduction (only when broadcasting occurs)

📚 Documentation

  • Updated README with v1.1.0 announcement
  • Enhanced mdBook user guide with reverse slicing examples
  • Updated Doxygen API comments for arange/rearange functions
  • Comprehensive CHANGELOG entry

🔗 Links


Upgrade Note: This release is fully backward compatible with v1.0.0. No breaking changes.

v1.0.0 - First Stable Release 🎉

Choose a tag to compare

@c2akula c2akula released this 19 Oct 17:19

This is the first stable release of Tofu with a frozen public API.

🔒 API Stability Guarantee

All public tofu_* functions are now FROZEN and follow strict semantic versioning:

  • MAJOR version: Breaking API changes only
  • MINOR version: Backward-compatible additions
  • PATCH version: Backward-compatible bug fixes

See API_STABILITY.md for full stability guarantees and deprecation policy.


✨ What's Included in v1.0.0

14 Core Operations

  • Matrix operations: matmul, add, mul
  • Activations: relu, softmax
  • Normalization: layer_norm
  • Shape ops: reshape, transpose
  • Reductions: mean, sum
  • Loss functions: MSE, cross-entropy

3 Optimizers

  • SGD (stochastic gradient descent)
  • SGD with momentum
  • Adam

Quality Assurance ✅

  • 70+ functions with comprehensive Doxygen documentation
  • 13/13 validation tests passing
  • 100% accuracy on CNN and ResNet examples
  • Memory safe (AddressSanitizer verified, no leaks)
  • CI/CD on Linux and macOS
  • ESP32 cross-compilation support

⚠️ Known Limitations

These will be addressed in future releases:

  • Performance benchmarks not yet established (planned for v1.1.0)
  • Some broadcasting edge cases documented with TODOs
  • Limited slice functionality (start < stop only)

🔄 Migration from v0.9.0

No breaking changes - v0.9.0 code works with v1.0.0 without modification.


🚀 What's Next

  • v1.1.0: Performance benchmarks and optimizations
  • v1.2.0+: Enhanced documentation (mdBook user guide and tutorials)

See CHANGELOG.md for detailed release notes.