Skip to content

Softplus kernel - #6

Merged
andrewdalpino merged 16 commits into
4.1from
softplus
Oct 7, 2026
Merged

andrewdalpino merged 16 commits into
4.1from
softplus

Conversation

@andrewdalpino

@andrewdalpino andrewdalpino commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

SoftPlus, erf(), rsqrt(), sinh(), and cosh()

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The release version mismatch and missing Special-surface test remain unresolved, along with documented follow-up corrections.

13 open findings
What changed in this PR

Adds rsqrt, stable softplus, erf, sinh, and cosh tensor operations across native kernels, APIs, optimizers, tests, benchmarks, and documentation.

Changes:

  • Adds Vector, Matrix, and ColumnVector operations.
  • Updates Zephir interfaces, generated bindings, and native C kernels.
  • Adds tests, documentation, changelog, and benchmark coverage.
File Summary
tests/​VectorTest.php Tests new vector operations; add coverage confirming the Special interface surface.
tests/​SettingsTest.php Tests rsqrt dispatch.
tests/​MatrixTest.php Tests new matrix operations.
tests/​ColumnVectorTest.php Tests result types and values.
tensor/​vector.zep Adds vector APIs.
tensor/​unary.zep Adds rsqrt and moves sigmoid out of Unary.
tensor/​trigonometric.zep Adds sinh and cosh.
tensor/​special.zep Defines sigmoid, softplus, and erf.
tensor/​matrix.zep Adds matrix APIs.
optimizers/​TensorSoftplusOptimizer.php Adds softplus optimizer; fix spacing in arity diagnostics.
optimizers/​TensorSinhOptimizer.php Adds sinh optimizer; fix spacing in arity diagnostics.
optimizers/​TensorRsqrtOptimizer.php Adds rsqrt optimizer; fix spacing in arity diagnostics.
optimizers/​TensorErfOptimizer.php Adds erf optimizer; fix spacing in arity diagnostics.
optimizers/​TensorCoshOptimizer.php Adds cosh optimizer; fix spacing in arity diagnostics.
ext/​tensor/​vector.zep.h Generated vector declarations.
ext/​tensor/​vector.zep.c Generated vector implementations.
ext/​tensor/​unary.zep.h Generated Unary declarations.
ext/​tensor/​unary.zep.c Generated Unary implementations.
ext/​tensor/​trigonometric.zep.h Generated trigonometric declarations.
ext/​tensor/​trigonometric.zep.c Generated trigonometric implementations.
ext/​tensor/​special.zep.h Generated Special declarations.
ext/​tensor/​special.zep.c Generated Special implementations.
ext/​tensor/​matrix.zep.h Generated Matrix declarations.
ext/​tensor/​matrix.zep.c Generated Matrix implementations.
ext/​include/​unary.h Declares native kernels.
ext/​include/​unary.c Implements and dispatches native kernels.
docs/​Vector.md Documents vector methods; update Special method categorization.
docs/​Matrix.md Documents matrix methods; update Special method categorization.
docs/​interfaces/​unary.md Documents Unary methods; move sigmoid and softplus entries to Special.
docs/​interfaces/​trigonometric.md Documents hyperbolic operations.
docs/​interfaces/​tensor.md Lists inherited methods; update interface grouping.
docs/​interfaces/​special.md Documents Special operations; add missing method sections and correct overview wording.
docs/​index.md Updates the interface index; fix missing spacing in the erf entry.
CHANGELOG.md Records the 4.1.0 release; align the build extension version.
benchmarks/​Unary/​SoftplusMatrixBench.php Benchmarks softplus; move to the Special benchmark area.
Files not reviewed (10)
  • ext/tensor/matrix.zep.c: Generated file
  • ext/tensor/matrix.zep.h: Generated file
  • ext/tensor/special.zep.c: Generated file
  • ext/tensor/special.zep.h: Generated file
  • ext/tensor/trigonometric.zep.c: Generated file
  • ext/tensor/trigonometric.zep.h: Generated file
  • ext/tensor/unary.zep.c: Generated file
  • ext/tensor/unary.zep.h: Generated file
  • ext/tensor/vector.zep.c: Generated file
  • ext/tensor/vector.zep.h: Generated file

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread CHANGELOG.md
Comment thread docs/Matrix.md Outdated
Comment thread docs/Vector.md
Comment thread docs/index.md Outdated
Comment thread docs/interfaces/special.md Outdated
Comment thread optimizers/TensorCoshOptimizer.php
Comment thread optimizers/TensorErfOptimizer.php
Comment thread optimizers/TensorRsqrtOptimizer.php
Comment thread optimizers/TensorSinhOptimizer.php
Comment thread optimizers/TensorSoftplusOptimizer.php
andrewdalpino and others added 10 commits October 7, 2026 13:17
Fix formatting of the description for the Special section.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Clarify the description of the `Special` interface and correct formatting for `erf()`.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@andrewdalpino
andrewdalpino merged commit 27932a2 into 4.1 Oct 7, 2026
5 checks passed
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.

2 participants