Add JAX typography, xector primitives, deferred effect chains, and GPU streaming
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m28s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m28s
- Add JAX text rendering with font atlas, styled text placement, and typography primitives - Add xector (element-wise/reduction) operations library and sexp effects - Add deferred effect chain fusion for JIT-compiled effect pipelines - Expand drawing primitives with font management, alignment, shadow, and outline - Add interpreter support for function-style define and require - Add GPU persistence mode and hardware decode support to streaming - Add new sexp effects: cell_pattern, halftone, mosaic, and derived definitions - Add path registry for asset resolution - Add integration, primitives, and xector tests Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -797,31 +797,63 @@ def prim_tan(x: float) -> float:
|
||||
return math.tan(x)
|
||||
|
||||
|
||||
def prim_atan2(y: float, x: float) -> float:
|
||||
def prim_atan2(y, x):
|
||||
if hasattr(y, '_data'): # Xector
|
||||
from sexp_effects.primitive_libs.xector import Xector
|
||||
return Xector(np.arctan2(y._data, x._data if hasattr(x, '_data') else x), y._shape)
|
||||
return math.atan2(y, x)
|
||||
|
||||
|
||||
def prim_sqrt(x: float) -> float:
|
||||
def prim_sqrt(x):
|
||||
if hasattr(x, '_data'): # Xector
|
||||
from sexp_effects.primitive_libs.xector import Xector
|
||||
return Xector(np.sqrt(np.maximum(0, x._data)), x._shape)
|
||||
if isinstance(x, np.ndarray):
|
||||
return np.sqrt(np.maximum(0, x))
|
||||
return math.sqrt(max(0, x))
|
||||
|
||||
|
||||
def prim_pow(x: float, y: float) -> float:
|
||||
def prim_pow(x, y):
|
||||
if hasattr(x, '_data'): # Xector
|
||||
from sexp_effects.primitive_libs.xector import Xector
|
||||
y_data = y._data if hasattr(y, '_data') else y
|
||||
return Xector(np.power(x._data, y_data), x._shape)
|
||||
return math.pow(x, y)
|
||||
|
||||
|
||||
def prim_abs(x: float) -> float:
|
||||
def prim_abs(x):
|
||||
if hasattr(x, '_data'): # Xector
|
||||
from sexp_effects.primitive_libs.xector import Xector
|
||||
return Xector(np.abs(x._data), x._shape)
|
||||
if isinstance(x, np.ndarray):
|
||||
return np.abs(x)
|
||||
return abs(x)
|
||||
|
||||
|
||||
def prim_floor(x: float) -> int:
|
||||
def prim_floor(x):
|
||||
if hasattr(x, '_data'): # Xector
|
||||
from sexp_effects.primitive_libs.xector import Xector
|
||||
return Xector(np.floor(x._data), x._shape)
|
||||
if isinstance(x, np.ndarray):
|
||||
return np.floor(x)
|
||||
return int(math.floor(x))
|
||||
|
||||
|
||||
def prim_ceil(x: float) -> int:
|
||||
def prim_ceil(x):
|
||||
if hasattr(x, '_data'): # Xector
|
||||
from sexp_effects.primitive_libs.xector import Xector
|
||||
return Xector(np.ceil(x._data), x._shape)
|
||||
if isinstance(x, np.ndarray):
|
||||
return np.ceil(x)
|
||||
return int(math.ceil(x))
|
||||
|
||||
|
||||
def prim_round(x: float) -> int:
|
||||
def prim_round(x):
|
||||
if hasattr(x, '_data'): # Xector
|
||||
from sexp_effects.primitive_libs.xector import Xector
|
||||
return Xector(np.round(x._data), x._shape)
|
||||
if isinstance(x, np.ndarray):
|
||||
return np.round(x)
|
||||
return int(round(x))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user