Repository navigation
tacuda v0.9.0
0.9.0 — 2026-11-14
Fused portfolio batches and CUDA Graph support. The C ABI is unchanged;
the minor-version bump reflects improved numerical behavior on the fused path.
Added:
- One kernel for an entire supported batch, on host and device APIs, for MFI,
ATR, RSI, ADOSC, STDDEV, BBANDS, SUM, OBV, AD, STOCHASTIC, SMA, MIN, MAX,
EMA, WMA, NATR and EMA MACD. Direct windows are bounded to small periods;
recurrences use one thread per series whenseriesLen <= 4*numSeries. TACUDA_BATCH_FUSED=auto|0|1: automatic selection, per-series dispatch,
or forced supported fused execution. Window/work limits still apply in
forced mode.maxConcurrencyis ignored on the fused path.- Supported fused device calls capture as exactly one CUDA kernel node,
without scratch allocations. All device batch families support graph
capture on a non-null caller stream, including the fallback dispatcher.
Changed:
- Fused recurrences follow TA-Lib's double-precision operation order and round
only at public float32 outputs. ATR, RSI, NATR, EMA and MACD can differ in
their last bits from 0.8. Existing streaming handles retain their rounding
contract. Fused rows are independent of row order, batch size and future
bars; crossing an automatic fallback boundary can change final bits. - Use
1to keep supported fused arithmetic at every batch size, or0
for the original per-series dispatcher. The independent correctness fixes
below still apply with0; it does not reproduce old nondeterministic bits. - Direct windows isolate NaNs to their own row and recover when a NaN leaves
the window. STOCHASTIC retains the previous float arithmetic.
Fixed:
- Device calls on user streams no longer synchronize through Thrust or
host-read recurrence seeds. Scratch uses stream-ordered allocation, with
graph-owned memory during capture; the memory pool remains bounded under
queued batched work. This fixes CUDA Graph capture for every batch family. - Long-series MFI, AD, ADOSC and STDDEV use fixed-tree floating-point scans,
removing scheduling-dependent output changes between eager runs and graph
replays. This improves reproducibility, not the conditioning limit of
long-prefix variance differences. - EMA period 1 copies the input, including NaNs and extreme changes. NATR
period 1 returns unnormalized TRANGE like TA-Lib on both dispatchers.
ATR/NATR period 1 uses independent true ranges after a NaN bar in full,
batched and streaming APIs. NATR streaming no longer normalizes period 1. - MFI re-sums a flow window if prefix subtraction or rolling cancellation
produces a negative total. This removes tiny negative outputs on positive
prices/volumes without clamping legitimate signed-volume calculations.
Measured during preparation on RTX 3090 Ti, CUDA 12.8, GPU-resident float32,
median synchronized wall time without transfers: the issue #6 pass of 13
calls on 4000 series x 234 bars fell from 431.09 ms on the earlier per-series
dispatcher to 2.615 ms (165x); graph replay took 2.527 ms with 13 kernel nodes.
20000x234: 2151.44 to 13.60 ms; 100000x64: 10613.90 to 23.28 ms. These are
workload-specific GPU-dispatch comparisons. See docs/PERFORMANCE.md.
The release also carries the following corrections from the unpublished
0.8.1 candidate:
Fixed — *_ex / *_ex_d precision paths (every pair except float32/float32),
which also serve dtype= in the Python wrappers:
- RSI ran a separate kernel: a flat series returned 100 instead of 0 and an
interior NaN was treated as zero change. It now runsRSIT<T>, the
implementation the plain path uses. - MACD never produced a finite signal or histogram, and seeded the fast EMA at
fastPeriod-1instead ofslowPeriod-1, so fixing the NaN alone would have
given finite but wrong values. Float compute now runs MACDEXT, double compute
a kernel with the same seeds;macdalso stays NaN until the signal lookback. fastPeriod > sizewrote and read outside a device buffer. Periods are now
normalized before launch and reversed fast/slow behave like TA-Lib.period <= 0returned success without writing the output for RSI and EMA.
All six families now returnCT_STATUS_INVALID_ARGUMENT.maTypewas silently ignored. Float compute honours it; float64 compute
returnsCT_STATUS_UNSUPPORTEDfor anything but EMA.
Fixed — batch streams:
resetafter a GPU append followed by a CPU append restored the old state
from the device.- Failed GPU transfers are now checked. A failure before the kernel can be
retried; from the kernel onwards the handle refuses work untilreset. See
"Error contract" indocs/STREAMING_API.md. - Growing the I/O buffers no longer loses the existing set when allocation
fails. A handle used from another GPU is rejected instead of dereferencing
foreign pointers; the internal batch stream pool is now per device.
Changed — behaviour callers can observe:
- SMA (period >= 96), WMA on its prefix path and BBANDS keep window semantics
for NaN/Inf: only windows containing the value are affected. Previously one
NaN turned every later output into NaN, so an SMA over warm-up NaNs of another
indicator returned nothing. Seedocs/IMPLEMENTATION_NOTES.md. - Python:
device_uploadderivescountfrom the array and rejects a count
beyond it before the native call; single-series functions reject anything but
1D input (use*_batch); dtype arguments accept enums, names and NumPy types,
fixing theNameErrorin*_ex. Context::stddevappliesnbdev;Context::bbandsrejectsmatype != 0.- Short
SMAT<double>/EMAT<double>outputs are fully initialized. - Optimizer: ISO timestamps honour UTC offsets and reject trailing text and
impossible dates; rows must be strictly increasing in time; OHLC geometry,
negative volume and values outside float32 are rejected with file:line.
Portfolios no longer fall back to positional alignment over damaged or mixed
time axes. Non-finite configuration values and fitness results are errors. - Optimizer metrics: drawdown and Sharpe/Sortino of a ranged segment count from
the funded capital, so a first-bar loss is visible. Runs that start flat keep
their previous numbers.
Benchmarks: benchmark_vector_math.py gives LN/LOG10/SQRT the same positive
input on the device as on the CPU (the device used to get roughly half
negative values) and refuses to time a case whose status or NaN mask disagrees.
benchmark_device_api.py runs on Linux, checks every status and reports its
output scope; --download all is now the default comparison with the Host API.
Release checks now reject stale versions in either root npm lockfile entry.
A late-loading Compute Sanitizer harness covers the MACD short-buffer host
and device precision paths without the linked test binary's initialization
failure; the previous native serves as an out-of-bounds negative control.
Optimizer parameter validation
- Reject invalid swing-history counts in `exp03_var_zones` and
`exp01_sr_levels`, including direct signal calls; prevent empty-history
access and division by zero.
- Avoid signed index overflow for large support/resistance pivot strengths.
Valid values outside the suggested search grid remain supported.
- Reject non-finite grid/set values and unsafe integer conversions; stop
terminal grid ranges and reject steps that cannot advance. Preserve
nearest-integer rounding and use it for the affected indicator periods.
8e94e697e151347dede5bb7805d572f8a28605feb07b320cb75095883c29f635 libtacuda.so
4fe146b0b33e65256f2237e6c08c2fa4055aed217d2e59ab24200fada032468a tacuda.dll