Tessero 0.2.0
Current stable · released 2026-09-26
Added
- Native extension
ext-tessero(Tessero\Ext\NDArray,Engine,Operand):- Arrays: operators
+ - * / ** %, slicing via$a['…'], boolean masks and integer-list indexing,foreach(native iterator),count(),clone,==. - Serialisation:
json_encode/toJson()(byte-identical tojson_encodewithJSON_PRESERVE_ZERO_FRACTION),serialize(). - Maths: reductions along one axis,
matmul,sort,where. Engine:linprog,milp, MDP solvers, FFT and NumPy-identicalrandom/normal/integers.- INI settings
tessero.threads,tessero.memory_budget,tessero.epsilon, re-applied at every request start. - Kernel symbols are kept private (visibility + linker version script), so the extension coexists with the FFI library.
- Arrays: operators
- Linear and mixed-integer programming in C:
Optimize\LinearProgramming::linprog/milpwith SciPy conventions (bounds, status codes, marginals),LinprogResult,MilpResult::gap(). - Markov decision processes in C:
Mdp\MarkovDecisionProcesswithfromDense,fromSparse,fromTransitions,valueIteration,policyIteration(exact or modified),evaluate,qValues,finiteHorizon,simulate. - OpenMP threads for large element-wise kernels and MDP sweeps
(
Tessero::setThreads,Engine::setMaxThreads). Results are identical for any thread count. tsr_arraymetadata in the ABI with a C slice parser, broadcasting helpers and a JSON writer.NDArray::sliceNative(),toJson(),meta(),__serialize/__unserialize.tsr_reduce_mid(fast reductions along non-last axes),tsr_cumulative,tsr_pcg64_shuffle, error codes -6, -7, -8.- Laravel package
tessero/laravel: service provider,Tesserofacade,AsNDArray/TensorCastEloquent casts (JSON or exact binary),NumericArrayvalidation rule,response()->ndarray(),tessero:doctor, settings re-applied per Octane request/task and queued job. tessero info --json.tessero doctorreports the kernel, SIMD, OpenMP and the extension.- Documentation site (MkDocs): user guide, operations manual (deployment,
configuration, memory and threads, monitoring, troubleshooting, runbooks,
security, upgrading, Docker), architecture (kernel, memory model, bindings,
numerical methods, solvers, testing, 8 ADRs), generated API reference, C ABI
and error codes.
tests/docs/examples.phpchecks the numbers in the guides. - Project files:
CONTRIBUTING.md,GOVERNANCE.md,CODE_OF_CONDUCT.md,SECURITY.md,RELEASING.md,MAINTAINERS.md. - Reference Docker image (
docker/Dockerfile). - Benchmarks for
linprogand MDP solvers.
Changed
NDArrayextendsTessero\Internal\OperandBase, which isTessero\Ext\Operandwhen the extension is loaded, so FFI arrays gain operators.NDArrayconstructor-promoted properties are no longerreadonly(needed by__unserialize).- LP/MILP workspaces are allocated with
tsr_allocand count against the memory budget. - MILP reports status 1 (limit) instead of pruning a subtree whose relaxation hit the iteration limit or numerical trouble, and stops with an error on out-of-memory instead of pruning.
Fixed
- Signed integer overflow in int cumulative products, sums, products and int64 matmul is now defined two's-complement wrap-around (was UB, flagged by UBSan).
- Nelder-Mead produced wrong iterates under
opcache.jit=function(PHP JIT miscompile; the loop counter now lives in a property; seedocs/project/upstream-bugs.md, issue 4). - Stacked
Linalg::det/slogdetcould return a wrong value underopcache.jit=tracingafter a long warm-up (PHP JIT defect, not yet isolated). LAPACK pivots are now copied out ofCDatain one call (issue 5).
Security
- LP/MILP reject NaN/±INF in
c,A,b(and NaN bounds) instead of returning undefined results. - MDP constructors and extension solvers reject non-finite rewards and
probabilities and malformed CSR input (
indptrnot starting at 0, decreasing, or pointing past the data), which could previously read out of bounds in the extension.
Removed
- The operator-only extension
tessero_ops(replaced byext-tessero).
Verification record
Run on the reference machine (Linux x86-64, 2 cores, AVX-512, GCC, PHP 8.4.21 NTS, NumPy 2.4.4, SciPy 1.17.1):
- C: 173 checks, optimised and under ASan + UBSan.
- FFI package: unit, numerics, solvers, parity (258 cases) and fuzz (300)
suites, with the JIT off,
functionandtracing. - Extension: 10 phpt files and the extension parity suite (439 run, 26 FFI-only skipped), also under ASan + UBSan.
- Laravel bridge tests on both backends. Documentation examples. FPM preload e2e.
- Not run here (no network access to GitHub/Packagist, no container daemon): the CI matrix on other platforms and PHP versions, the service provider inside a real Laravel application, and the Docker image build.