Skip to content

Vector range() and linspace() optimizations - #7

Merged
andrewdalpino merged 2 commits into
masterfrom
vector-factories
Oct 7, 2026
Merged

andrewdalpino merged 2 commits into
masterfrom
vector-factories

Conversation

@andrewdalpino

@andrewdalpino andrewdalpino commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

This brings linspace and range operations into C kernels.

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

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.

Comment thread ext/include/factories.c
Comment thread tensor/vector.zep
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@andrewdalpino
andrewdalpino merged commit 66c81b1 into master Oct 7, 2026
5 checks passed
@andrewdalpino
andrewdalpino deleted the vector-factories branch October 9, 2026 03:14
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