Docs / nablatensor-core / com.nablatensor.engine

abstract class

HostAadExecutable

The half of an engine that a host (CPU) replay shares with every other host replay: a worker pool, and the split of a path range across those workers.

Scenarios are the only parallel axis available — the tape is a chain of dependent scalar operations, so it cannot be split — which means every host engine wants exactly the same thing: contiguous, disjoint path ranges, one per worker, each with its own scratch and its own AadTotals, summed at the end. The scalar interpreter, the generated-bytecode kernel and the vector sweeps differ only in what they do inside a range, so that is all a subclass supplies. A subclass that walks the tape node by node reads it through a FlatTape; the one that generates a kernel from it does not need one.

The accelerator counterpart is DeviceAadExecutable: same base, same chunking, but the parallelism is the device grid rather than a pool.

Public only so the engine modules can extend it; not part of the supported API. Implement AadEngine / AadExecutable directly instead.

Constructors

protected HostAadExecutable(AadTape tape, AadOptions options, String threadName)

Fields

protected final int threads

Resolved worker count; 1 means the calling thread does the work.

Methods

protected AadTotals newTotals()

Empty sums shaped for this tape.

protected AadTotals runRanges(long paths, long pathOffset, long alignment, Range range)

Runs paths scenarios from pathOffset across the workers and sums their totals. alignment is the scenario granularity a worker cannot split below — one for a scalar sweep, the batch width for a vector one — so only the last worker can be handed a partial unit.

protected long beginReplay(long paths)

Guards the common preconditions of a dispatch and returns its start time.

void close()