Repository navigation
Vector range() and linspace() optimizations - #7
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Range semantics and non-finite-input validation need correction, and the new exceptions require documentation.
2 open findings
What changed in this PR
This PR moves Vector::range() and Vector::linspace() generation into native C kernels.
Changes:
- Adds C kernels, Zephir optimizers, validation, tests, and benchmarks.
- Regenerates extension bindings.
- Review blockers remain around range semantics, non-finite inputs, and API documentation.
| File | Summary |
|---|---|
tests/VectorTest.php |
Adds range and linspace coverage. |
tensor/vector.zep |
Adds validation and kernel-backed factories. |
optimizers/TensorRangeOptimizer.php |
Optimizes range calls. |
optimizers/TensorLinspaceOptimizer.php |
Optimizes linspace calls. |
ext/tensor/vector.zep.c |
Regenerated vector bindings. |
ext/tensor/tensorbuffer.zep.c |
Regenerated bindings. |
ext/tensor/reductions/rref.zep.c |
Regenerated bindings. |
ext/tensor/reductions/ref.zep.c |
Regenerated bindings. |
ext/tensor/matrix.zep.c |
Regenerated bindings. |
ext/tensor/decompositions/svd.zep.c |
Regenerated bindings. |
ext/tensor/decompositions/lu.zep.c |
Regenerated bindings. |
ext/tensor/decompositions/eigen.zep.c |
Regenerated bindings. |
ext/tensor/decompositions/cholesky.zep.c |
Regenerated bindings. |
ext/include/factories.h |
Declares range and linspace kernels. |
ext/include/factories.c |
Implements range and linspace kernels. |
benchmarks/Factories/VectorRangeBench.php |
Benchmarks range generation. |
benchmarks/Factories/VectorLinspaceBench.php |
Benchmarks linspace generation. |
Files not reviewed (9)
- ext/tensor/decompositions/cholesky.zep.c: Generated file
- ext/tensor/decompositions/eigen.zep.c: Generated file
- ext/tensor/decompositions/lu.zep.c: Generated file
- ext/tensor/decompositions/svd.zep.c: Generated file
- ext/tensor/matrix.zep.c: Generated file
- ext/tensor/reductions/ref.zep.c: Generated file
- ext/tensor/reductions/rref.zep.c: Generated file
- ext/tensor/tensorbuffer.zep.c: Generated file
- ext/tensor/vector.zep.c: 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.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This brings linspace and range operations into C kernels.