Skip to content

Commit 8eade1b

Browse files
add CONVOLVE builtin + image drawing ops
Add CONVOLVE(x, kernel) for N-D tensors with replicate padding and INT/FLT support (updates spec accordingly) Extend image extension with POLYGON, ELLIPSE (center tensor + legacy form), and REPLACE_COLOR, including alpha blending helpers Add/expand stdlib image helpers (RECT/RECTANGLE/FILL_RECT/SQUARE/CIRCLE/FILL_ELLIPSE) and broaden image tests Performance work: cache tensor strides + speed up tensor mapping/flip paths, optimize call resolution for module-qualified functions, and tighten lexer hot loops
1 parent c2f41c5 commit 8eade1b

File tree

7 files changed

+877
-128
lines changed

7 files changed

+877
-128
lines changed

SPECIFICATION.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@
403403
- `TFLIP(TNS: obj, INT: dim):TNS` — Returns a new `TNS` with the elements along 1-based dimension `dim` reversed. Errors if `dim` is out of range.
404404
- `FILL(TNS: tensor, ANY: value):TNS` — Returns a new tensor with the same shape as `tensor`, filled with `value`. The supplied value`s type must match the existing element type at every position.
405405
- `TNS(TNS: shape, ANY: value):TNS` Creates a new `TNS` with the shape described by a 1D `TNS` of positive `INT` lengths, filled with `value`.
406+
- `CONVOLVE(TNS: x, TNS: kernel):TNS` N-dimensional discrete convolution producing an output tensor with the same shape as `x`. The `kernel` must have the same rank as `x` and each kernel dimension length must be odd (so the kernel has a well-defined center). At the boundaries, out-of-range sample coordinates are clamped to the nearest valid index (replicate padding). Both tensors must contain only `INT` or only `FLT` elements (no mixed element types within a tensor). If both tensors are `INT`-valued, the output is an `INT` tensor; otherwise the output is a `FLT` tensor.
406407
- `MADD/MSUB/MMUL/MDIV(TNS: x, TNS: y):TNS` Elementwise addition, subtraction, multiplication, and division. Shapes must match; all elements must be `INT` or all `FLT` (no mixing). Division by zero is an error.
407408
- `MSUM(TNS: t1, ..., TNS: tN):TNS` Elementwise sum across tensors. Shapes must match; elements must be all `INT` or all `FLT` (no mixing).
408409
- `MPROD(TNS: t1, ..., TNS: tN):TNS` Elementwise product across tensors. Shapes must match; elements must be all `INT` or all `FLT` (no mixing).

asm-lang.exe

8.61 KB
Binary file not shown.

0 commit comments

Comments
 (0)