Machine learning
Models, autograd, losses, optimizers, metrics, and reinforcement learning.
Examples
Functions
Load a native OA .oam checkpoint into existing matching owners. The complete file, section hashes, tensor metadata, module paths, shapes, dtypes, and optimizer payload are validated before any live handle changes. engine remains the sole owner of newly uploaded storage. Errors Returns crate::ErrorKind::CheckpointCorrupt for malformed, truncated, or integrity-invalid .oam data. Returns another error for a valid file that does not match the destination model/optimizer, or for allocation/runtime and filesystem failures.
Save a module and its complete optimizer state in the native OA .oam format. Registration-derived parameter paths become the Weights index. Persistent module buffers become the State index; non-persistent buffers are excluded. This is an explicit host-observation boundary. The completed file is durably written to a sibling temporary path and atomically renamed. Errors Returns an error for ambiguous module ownership, optimizer/model mismatch, unsupported Matrix metadata, readback failure, arithmetic overflow, or a filesystem failure.
Types
3 members
Environment-neutral discrete actor/critic behavior. PPO depends on this contract rather than a concrete network architecture.
Source13 members
Adam optimizer over stable Parameter handles.
Source13 members
Decoupled-weight-decay Adam optimizer over stable Parameter handles.
Source15 members
Deterministic byte-pair encoder compatible with OA’s oa_bpe_v1 files.
Source22 members
Default two-tower categorical actor/critic MLP. Policy and value paths are independent Linear -> ReLU -> Linear -> ReLU -> Linear towers, matching OA C++.
12 members
Stateful checkpoint selection and bounded incremental-retention policy.
Source0 members
Optimizer with a complete native .oam save-and-restore contract. This capability is sealed because persistence must remain synchronized with OA’s versioned model-file codec. Custom optimizers can implement Optimizer for eager training without claiming wire compatibility.
Source8 members
Replayable reset/step/observation contract for one Environment. Implementations must keep every replay-visible piece of episode state in device-resident matrices: the captured plans bind those buffers once and replay the identical command sequence, so no host-computed value may differ across replays. Deterministic per-episode variation belongs in on-device counters (as CartPole’s episode_index does) or in the cursor words above.
Source0 members
One bounded continuous action and its differentiable policy statistics.
Source0 members
15 members
Checked shape, dtype, and range contract for one environment field. shape excludes the leading environment-batch dimension. An empty shape therefore represents one scalar per environment.
Source11 members
Complete single-agent environment schema shared by native and adapter paths.
Source6 members
One batched environment step result preserving termination and truncation.
Source5 members
Thread-affine reverse-mode recording scope. Constructing a tape selects it for operations on the current thread. GradientTape::backward closes the recording scope and records the corresponding backward operations into the originating engine’s eager batch.
Source1 members
Registers an explicitly included MCP view over an existing training session. The server borrows session through its handlers and must be closed or destroyed first. oa/ml deliberately does not opt applications into the network control surface. Rebuild and preview remain absent until their checkpoint and completion contracts are admitted. Donor: oa::McpTraining.
Source15 members
Stateful neural-network component with one registered ownership tree.
Source0 members
Private architecture metadata carried by an optimizer-free module artifact.
Source7 members
Constructor-owned structural registry for one Module. Registration requires &mut self, so a module’s parameter/buffer/child tree is fixed before the module is shared through Rc.
Source13 members
Muon optimizer with Nesterov momentum and rank-two NS5 orthogonalization. Rank-two parameters use the donor Muon matrix pipeline. Other ranks use its fused momentum update; OA never silently delegates them to AdamW.
Source2 members
Owned dotted path and host scalar that participates in module persistence. Scalar state is intended for small algorithmic counters and flags whose value affects the next device operation but does not belong in a Matrix buffer. It is traversed and checkpointed with the same deterministic module tree as parameters and buffers.
Source10 members
Optimizer for externally authored parameter updates. NoOpOptimizer lets callers use crate::ml::ItTraining for cadence, metrics, and callbacks while the step body owns all parameter mutation.
Source6 members
Common behavior exposed by an OA optimizer to training policy. This contract deliberately excludes captured-program and persistence internals. Those capabilities depend on optimizer-specific state and are admitted separately only when their complete implementation exists.
Source7 members
Named trainable FP32 matrix with one live accumulated gradient.
Source4 members
A GPU-resident weight stored in OA’s native Q4 or Q8 block encoding. Constructed by quantize; the packed payload and scale planes are private implementation detail and never exposed as public matrix values.
Source7 members
Device-resident replay values, optionally including sampled source indices.
Source10 members
Circular fixed-capacity owner for off-policy transitions. Batched append and deterministic uniform sampling are recorded on the one owning engine. Cursor and size are host control metadata and never require a Matrix readback.
Source8 members
One batch of transitions to append to a ReplayBuffer.
Source11 members
Time-major matrices retained by one RolloutBuffer.
Source11 members
Stateful fixed-capacity owner for one categorical on-policy rollout. Appends, validity reset, and final GAE are recorded on the owning engine; host observation remains the explicit submit-and-wait boundary. Storage is allocated once and overwritten in place across completed collection cycles.
Source3 members
Environment-neutral categorical collector over borrowed owners. Collection records one complete transaction and returns its exact Event without waiting. It owns no environment, model, rollout storage, Engine, or queue.
Source10 members
One vector-environment transition whose values remain device-resident.
Source5 members
Validated, host-owned SafeTensors source used by explicit model translators.
Source12 members
Enums
OA native block quantization selector. Both formats share one 32-value block layout and one Float32 scale per block. Q4 stores a biased 4-bit index per value (16 bytes per block); Q8 stores one signed byte per value (32 bytes per block).
Q4 · Q8
Functions
Compute generalized advantage estimates over a fixed rollout. Termination disables value bootstrap. Termination and truncation both stop the reverse trace, while truncation deliberately retains one-step bootstrap. Errors Returns an error unless all inputs share one engine and one nonempty [time, environments] shape, values are F32, boundary masks are U8, both discounts are finite in [0, 1], and GPU recording succeeds.
Record generalized advantage estimation into caller-owned output storage. This is the allocation-free form used by fixed-capacity rollout storage. It has the same semantic identity and numerical contract as gae. Errors Returns the errors from gae, and rejects output matrices that do not match the rollout’s engine, F32 dtype, and shape or alias any input/each other.
Standardize a nonempty FP32 advantage tensor over all elements. The result is (advantage - mean) / sqrt(variance + epsilon). The operation remains device-resident and differentiable, and records one semantic identity over its composite Matrix lowering. Errors Returns an error when advantage is empty or not FP32, epsilon is not positive and finite, a size exceeds the admitted shader ABI, allocation fails, or composite lowering fails.
Types
Functions
Greedily decode one byte from each FP32 logit row. This is an explicit submission, completion, and compact host-read boundary. Errors Returns an error unless logits are rank-one [256] or rank-two [N, 256] FP32, or execution/readback fails.
Greedily decode logits and require exact UTF-8 output. Errors Returns the errors from decode or crate::ErrorKind::DataLoss when the decoded byte stream is not UTF-8.
Upload raw bytes as a rank-one U8 Matrix on this thread’s default engine. Errors Returns an error when the default engine cannot be initialized or when allocation or upload fails.
Upload raw bytes as one batched U8 sequence [1, S] on this thread’s default engine. Errors Returns an error when the default engine cannot be initialized or when allocation or upload fails.
Upload raw bytes as one batched U8 sequence [1, S] on a particular engine. Errors Returns an error when allocation or upload fails.
Upload raw bytes as a rank-one U8 Matrix on a particular engine. Errors Returns an error when allocation or upload fails.
Upload UTF-8 text without tokenization or normalization on this thread’s default engine. Errors Returns an error when the default engine cannot be initialized or when allocation or upload fails.
Upload UTF-8 text without tokenization or normalization on a particular engine. Errors Returns an error when allocation or upload fails.
Sample one byte from each FP32 logit row. Errors Returns an error for an invalid 256-class logit contract, sampling contract, execution, or readback failure.
Constants & Variables
Functions
Clip FP32 rewards to an inclusive finite range. Errors Returns an error for an empty/non-FP32 input, unordered/non-finite bounds, or Matrix/composite lowering failure.
Normalize and symmetrically clip FP32 observations. Computes clamp((observation - mean) / (stddev + epsilon), -clip, clip) through differentiable Core Matrix operations under one Environment semantic identity. Errors Returns an error for empty/non-FP32 inputs, invalid epsilon/clip, incompatible broadcasting or ownership, or composite lowering failure.
Affinely map FP32 actions between two finite ranges. Errors Returns an error for an empty/non-FP32 input, unordered/non-finite bounds, or Matrix/composite lowering failure.
Types
8 members
Replayable reset/step/observation contract for one Environment. Implementations must keep every replay-visible piece of episode state in device-resident matrices: the captured plans bind those buffers once and replay the identical command sequence, so no host-computed value may differ across replays. Deterministic per-episode variation belongs in on-device counters (as CartPole’s episode_index does) or in the cursor words above.
Source20 members
Stateful native vector-environment behavior. Implementations own semantic environment state and embed exactly one EnvironmentExecution. Public default methods own transaction state, validation boundaries, submission, and rollback; implementations only author reset/step/reset-completed commands and transactional host metadata.
5 members
Private command transaction and exact completion state for one environment. Native environments embed this value and expose it through Environment. It borrows the canonical Engine recorder for each active transaction; it does not own another queue, allocator, scheduler, or execution graph.
Source15 members
Checked shape, dtype, and range contract for one environment field. shape excludes the leading environment-batch dimension. An empty shape therefore represents one scalar per environment.
Source11 members
Complete single-agent environment schema shared by native and adapter paths.
Source6 members
One batched environment step result preserving termination and truncation.
Source2 members
Optional event-aligned visible depth and native mark. No interpolation.
Source30 members
Device-resident trading dynamics over one Engine and the canonical lifecycle. Observations append signed exposure, equity/capital, peak/capital, drawdown, remaining horizon, unrealized PnL/capital, position age/horizon and peak unrealized position PnL/capital.
5 members
Per-instrument sizing, costs, initial/maintenance margin and IOC policy. Defaults preserve the original continuous, unlevered next-open simulator.
Source3 members
One piecewise-linear margin tier. Rates are fractions of marked notional.
Source2 members
Closed-bar inputs for one contiguous instrument segment, within one split.
Source4 members
Versioned complete analytical lane state, bound to source tables/config. Snapshot only at exact completion; consumers persist this alongside model, optimizer, PPO action cursor and their own source-receipt identity.
SourceEnums
Constants & Variables
Functions
Deterministically evaluate a categorical policy and return compact telemetry. The complete horizon is recorded and submitted once, followed by one exact wait and three compact rollout readbacks. Greedy action selection uses the donor temperature-zero route. The environment remains open and idle. Errors Returns an error for zero horizon/lanes, a non-discrete environment, model ownership mismatch, environment/model/policy/rollout recording failure, submission/wait failure, readback failure, or counter overflow.
Types
Functions
Advance one explicit Euler step: state + velocity * delta_time. Errors Returns an error unless state and velocity are matching nonempty same-engine F32 matrices, delta_time is finite, and recording succeeds.
Construct x(t) = clean + t * (noise - clean) and v = noise - clean. A rank-one time vector matching the batch dimension expands across every non-batch axis. Scalars and ordinarily broadcastable time shapes are also accepted. Errors Returns an error unless every input is same-engine F32, clean and noise are matching and nonempty, time broadcasts to them, and recording succeeds.
Compute mean squared error over broadcast-selected valid elements. The mask contributes its values to the denominator. An all-zero mask returns exact zero by clamping the denominator to one. Target and mask are detached; reverse mode differentiates only prediction. Errors Returns an error unless prediction and target are matching nonempty same-engine F32 matrices, mask is same-engine F32 and broadcastable to prediction, and recording succeeds.
Types
Functions
Compute mean binary cross entropy over matching FP32 probability matrices. Predictions use the donor’s [1e-7, 1 - 1e-7] numerical clamp. Targets are treated as detached; reverse mode differentiates only the prediction. Errors Returns an error for empty, mismatched, non-FP32, or cross-engine inputs, or when allocation or runtime recording fails.
Compute mean cross-entropy over rank-two FP32 logits and U32 or I32 class targets. logits has shape [N, C], targets has shape [N], and the returned matrix is an FP32 scalar. I32 targets must be non-negative; any negative or out-of-range target produces NaN without an out-of-bounds access. Errors Returns an error when ranks, shapes, dtypes, ownership, allocation, or runtime recording are invalid.
Compute mean cross-entropy over the rows selected by a floating FP32 mask. logits has shape [N, C]; targets and mask have shape [N]. A zero mask value excludes its row and produces an exact-zero logits adjoint. valid_count is the caller-provided normalization denominator and must be in 1..=N; it is not read back or recomputed from device storage. Reverse mode differentiates only logits. Errors Returns an error when ranks, shapes, dtypes, ownership, valid_count, allocation, or runtime recording are invalid.
Compose the donor DQN selected-action and detached Bellman-target loss. Termination suppresses next-state bootstrap. Truncation deliberately keeps bootstrap because it ends only the current trace, not the underlying task. Reverse mode therefore connects loss and selected_q only to q. Errors Returns an error unless Q and next-Q are same-engine nonempty F32 [B,A] matrices with A > 1, action is I32 [B], reward is F32 [B], boundary masks are U8 [B], all fields share one engine, extents fit the shader ABI, and discount is finite in [0, 1].
Compute mean absolute error for matching FP32 matrices. The target is treated as detached; reverse mode differentiates only the prediction. Equal prediction and target values use the zero subgradient. Errors Returns an error for empty, mismatched, non-FP32, or cross-engine inputs, or when allocation or runtime recording fails.
Compute mean squared error for matching FP32 matrices. The target is treated as detached; reverse mode differentiates only the prediction. Errors Returns an error for empty, mismatched, non-FP32, or cross-engine inputs, or when allocation or runtime recording fails.
Compose PPO policy, value, entropy, and total losses. All four outputs are FP32 scalars under one semantic PPO operation. Old log probability, advantage, and target return remain detached by their child operation contracts. Errors Returns an error unless all rollout fields are matching nonempty same-engine FP32 matrices and every coefficient is valid.
Compute the mean negative clipped PPO surrogate objective. Errors Returns an error unless all inputs are matching nonempty same-engine FP32 matrices and clip_epsilon is finite in (0, 1).
Compute the explicit clipped-policy adjoint for new log probability. Errors Returns the same validation and runtime errors as ppo_clipped_policy.
Compute the donor entropy-regularized SAC actor objective. The scalar result is mean(alpha * log_probability - min(q1, q2)) and is differentiable through all three inputs. Errors Returns an error unless inputs are matching nonempty same-engine F32 vectors, entropy coefficient is finite and non-negative, and lowering succeeds.
Compose the donor twin-critic SAC objective. The target is reward + discount * (min(next_q1, next_q2) - alpha * next_log_probability) outside terminal states. Truncation retains that bootstrap. All next-state target fields are detached from reverse mode. Errors Returns an error unless all numerical fields are matching nonempty same-engine F32 vectors, both boundary masks are matching U8 vectors, discount is finite in [0, 1], entropy coefficient is non-negative and finite, the batch fits the shader ABI, and lowering succeeds.
Compute mean unit-beta Smooth L1 loss for matching FP32 matrices. The target is treated as detached; reverse mode differentiates only the prediction. Errors Returns an error for empty, mismatched, non-FP32, or cross-engine inputs, or when allocation or runtime recording fails.
Types
Functions
Adaptively average-pool an NCHW Matrix to an exact spatial extent. Each output bin independently uses floor/ceiling boundaries along height and width. This supports rectangular and non-divisible geometry without approximating the operation as a square fixed-window pool. Errors Returns an error unless the input is nonempty rank-four F32, both output extents are nonzero, all geometry fits the shader ABI, or recording fails.
Apply two-dimensional average pooling to an NCHW Matrix. Padding positions do not contribute to either the sum or divisor. The output spatial extent is floor((input + 2 * padding - kernel_size) / stride) + 1, matching the OA C++ operation. Errors Returns an error unless input is a nonempty rank-four F32 Matrix, kernel_size and stride are nonzero, the kernel fits the padded input, every shader extent is representable, or runtime recording fails.
Normalize an NCHW Matrix using statistics computed from the current batch. Errors Returns an error unless input is nonempty rank-four F32, weight and bias are same-engine F32 channel vectors, epsilon is finite and positive, or runtime recording fails.
Normalize an NCHW Matrix using explicit per-channel statistics. This is the stateless inference form used by crate::ml::nn::BatchNorm2d in evaluation mode. Errors Returns an error unless every value is same-engine F32, the channel-vector shapes match the input, epsilon is finite and positive, or runtime recording fails.
Multiply corresponding matrices in rank-three batches. Computes [N, M, K] @ [N, K, P] -> [N, M, P]. Errors Returns an error unless inputs are compatible nonempty same-engine F32 matrices, shape arithmetic fits the shader ABI, or runtime recording fails.
Multiply rank-three batches with right-transposed storage. Computes [N, M, K] @ [N, P, K]^T -> [N, M, P]. Errors Returns an error unless inputs are compatible nonempty same-engine F32 matrices, shape arithmetic fits the shader ABI, or runtime recording fails.
Multiply rank-three batches with left-transposed storage. Computes [N, K, M]^T @ [N, K, P] -> [N, M, P]. Errors Returns an error unless inputs are compatible nonempty same-engine F32 matrices, shape arithmetic fits the shader ABI, or runtime recording fails.
Causal kernel-trick attention on raw Q/K/V [BH,S,Dh]. Uses phi(x) = x+1 for nonnegative x and exp(x) otherwise, with max(dot(phi(Q), prefix_sum(phi(K))), epsilon) normalization. Values are not feature-mapped. The fused provider admits 1 <= Dh <= 64; sequence length has no provider cap. It saves Q/K/V, context and one denominator per row for deterministic prefix/suffix reverse mode, never a KV prefix history. Errors Returns an error for unequal/empty shapes, non-F32 or mixed-engine values, head dimension above 64, nonpositive/nonfinite epsilon, shader ABI overflow, allocation or recording failure.
Normalize the channel axis of a nonempty FP32 [B, C, T] Matrix. Errors Returns an error unless the affine vectors match C, all values belong to one Engine, epsilon is finite and positive, C <= 1024, or recording fails.
Compute complete explicit channel-normalization adjoints. Errors Returns an error when the forward contract or output gradient is invalid, or runtime recording fails.
Normalize the channel axis of [B, C, T] and fuse the following ReLU. Errors Returns an error under the same conditions as channel_norm, or when runtime recording fails.
Compute complete adjoints of fused channel normalization and ReLU. Errors Returns an error when saved output or gradient does not match the forward contract, or runtime recording fails.
Apply one-dimensional convolution to an NCL Matrix through im2col and GEMM. weight uses [output_channels, input_channels, kernel] layout and bias uses [output_channels]. Dilation applies within each kernel window. Errors Returns an error unless all inputs are nonempty same-engine F32 matrices, shapes agree, stride and dilation are nonzero, the effective kernel fits the padded input, every extent fits the shader ABI, or recording fails.
Apply grouped two-dimensional convolution to an NCHW Matrix. weight uses [output_channels, input_channels / groups, kernel, kernel] layout and bias uses [output_channels]. The output spatial extent is floor((input + 2 * padding - kernel) / stride) + 1. Errors Returns an error unless all inputs are same-engine F32 matrices, shapes and group divisibility agree, the square kernel fits the padded input, every extent fits the shader ABI, or runtime recording fails.
Apply bias-free one-dimensional transposed convolution to an NCL Matrix. weight uses [input_channels, output_channels, kernel] layout. The output length is (input_length - 1) * stride - 2 * padding + effective_kernel. Errors Returns an error unless both inputs are nonempty same-engine F32 matrices, channel geometry agrees, stride and dilation are nonzero, the output extent is positive and fits the shader ABI, or runtime recording fails.
Apply two-dimensional transposed convolution to an NCHW Matrix. weight uses [input_channels, output_channels, kernel, kernel] layout and bias uses [output_channels]. Each output spatial extent is (input_extent - 1) * stride - 2 * padding + kernel. Errors Returns an error unless all inputs are nonempty same-engine F32 matrices, channel and square-kernel geometry agree, stride is nonzero, output extents are positive and fit the shader ABI, or runtime recording fails.
Materialize a Float32 matrix with the logical shape retained by input. Errors Returns an error for an empty weight, oversized element counts, or allocation/recording failure.
Return a zero-copy stop-gradient view. The returned Matrix shares storage and forward values with input, but owns a fresh semantic identity with no reverse-mode edge to input. Errors Returns an error only if the input’s existing shape metadata is invalid.
Apply the exponential linear unit elementwise. Errors Returns an error unless input is F32 or runtime recording fails.
Apply the explicit causal Flash provider to [BH,S,Dh] values. This compatibility entry point retains the same semantic scaled-dot-product attention identity as scaled_dot_product_attention. It materializes only the output and one FP32 log-sum-exp value per query row. Errors Returns an error unless Q, K, and V are equal nonempty same-engine F32 matrices, the sequence length is at most 1024, or runtime recording fails.
Apply the tanh-approximate Gaussian error linear unit elementwise. Errors Returns an error unless input is F32 or runtime recording fails.
Apply one bias-free projection per expert to expert-major packed rows. input is F32 [R, K], weight is F32 [E, N, K], and offsets is the U32 [E+1] boundary output from crate::matrix::moe_expert_plan. The result is F32 [R, N]. Errors Returns an error for incompatible shapes, dtypes, engine ownership, shader ABI overflow, allocation failure, or runtime recording failure.
Apply one affine projection per expert to expert-major packed rows. input is F32 [R, K], weight is F32 [E, N, K], bias is F32 [E, N], and offsets is the U32 [E+1] boundary output from crate::matrix::moe_expert_plan. The result is F32 [R, N]. Errors Returns an error for incompatible shapes, dtypes, engine ownership, shader ABI overflow, allocation failure, or runtime recording failure.
Apply one GRU cell update to a caller-supplied hidden state. gates_i has shape [batch, 3 * hidden], hidden has [batch, hidden], weight_hh has [3 * hidden, hidden], and an optional recurrent bias has [3 * hidden]. Errors Returns an error unless all values are nonempty same-engine F32 matrices, shapes agree, hidden size is at most 1024, or runtime recording fails.
Run a whole-sequence GRU recurrence from a zero hidden state. gates_i has shape [batch, sequence, 3 * hidden], weight_hh has [3 * hidden, hidden], and an optional bias_hh has [3 * hidden]. Gate order is reset, update, candidate. Errors Returns an error unless all values are nonempty same-engine F32 matrices, shapes agree, hidden size is at most 1024, or runtime recording fails.
Apply Leaky ReLU elementwise with the requested negative slope. Errors Returns an error unless input is F32 or runtime recording fails.
Run the shared-state Mamba-3 MIMO selective scan. C/B use [B,L,R*G,N]; the three MIMO projections use [H,R,P]; the output-normalization weight always uses [H,P] and is consumed only when config.has_output_norm is true. The remaining layouts match mamba3_siso. Errors Returns an error for mismatched geometry, rank outside 1..=8, unsupported dimensions, shape overflow, or failed runtime recording.
Compute all fifteen explicit Mamba-3 MIMO adjoints. The implementation records the donor’s deterministic prepare, post, reverse-core, inverse-rotation, and reduction stages as one semantic operation. Errors Returns an error for mismatched geometry, unsupported dimensions, shape overflow, or failed runtime recording.
Advance one Mamba-3 MIMO token and update four explicit recurrent states. State layouts are SSM [B,H,P,N], angle [B,H,A], key [B,H,R,N], and value [B,H,R,P]. Errors Returns an error unless config.sequence_length == 1, every operand and state matches the configured same-engine F32 layout, or recording fails.
Split and transform one packed Mamba-3 input projection. projected has shape [rows, projected_width], where `projected_width = 2inner_size + 2num_groupsmimo_rankstate_size 3*num_heads + num_rope_angles. dt_bias` has one element per head. The operation records one semantic node and one physical dispatch. Errors Returns an error for invalid configuration, incompatible shape, dtype or Engine ownership, arithmetic overflow, or failed runtime recording.
Compute the packed projection and dt-bias adjoints for Mamba-3 preprocess. output_gradients follows the exact eight shapes returned by mamba3_preprocess. Its dt-bias reduction is ordered by increasing row. Errors Returns an error for invalid configuration, incompatible gradients, shape, dtype or Engine ownership, arithmetic overflow, or failed runtime recording.
Run the Mamba-3 SISO selective-state recurrence. Operand layouts are C/B [B,L,G,N], x/z/output [B,L,H,P], A-times-dt/dt/trap [B,L,H], angle [B,L,A], C/B bias [H,N], and D [H]. All operands are same-engine F32 matrices. Errors Returns an error for mismatched geometry, unsupported dimensions, shape overflow, or failed runtime recording.
Compute all explicit Mamba-3 SISO adjoints. The initial OARS physical route is the donor short-training route and accepts L <= 16, P <= 16, N <= 32, and A <= 8. Errors Returns an error for mismatched inputs, a shape outside the admitted short route, overflow, or failed runtime recording.
Advance one Mamba-3 SISO token and update four explicit recurrent states. Operand layouts are the length-one forms accepted by mamba3_siso. State layouts are SSM [B,H,P,N], cumulative angle [B,H,A], previous key [B,H,N], and previous value [B,H,P]. The states are mutated only after the complete operation has been validated and recorded. Errors Returns an error unless config.sequence_length == 1, every operand and state has the configured same-engine F32 shape, or recording fails.
Multiply [..., K] Float32 activations by a quantized [N, K] weight without materializing a Float32 weight matrix. The result shape is [..., N]. Errors Returns an error unless the weight has rank 2, the input has rank at least 2 with a matching last dimension, all planes are contiguous base storage on one engine, the flattened dimensions fit the u32 kernel ABI, or allocation/recording fails.
Apply two-dimensional max pooling to an NCHW Matrix. Equal maxima select the first valid input in row-major window order. The returned U32 argmax indices are explicit because they are part of the donor operation contract and make the deterministic adjoint reusable. Errors Returns an error under the same geometry and runtime conditions as avg_pool_2d.
Invert split_heads into contiguous [B*S, H*(D/H)] storage. The one-head case is a zero-copy differentiable view. Errors Returns an error unless input is nonempty F32 [B*H, S, D/H] with the supplied nonzero dimensions, or runtime recording fails.
Apply Mish elementwise. Errors Returns an error unless input is F32 or runtime recording fails.
Combine expert-major packed rows into token-major output using route gates. packed is F32 [T*K, D], route_gate is F32 [T, K], and the U32 maps come from crate::matrix::moe_expert_plan. Errors Returns an error for incompatible shapes, dtypes, engine ownership, shader ABI overflow, allocation failure, or runtime recording failure.
Pack token rows into stable expert-major route order. input is F32 [T, D]; packed_token and inverse are the U32 [T*K] maps produced by crate::matrix::moe_expert_plan. inverse is retained for the deterministic reverse pass and is not read by the forward kernel. Errors Returns an error for incompatible shapes, dtypes, engine ownership, shader ABI overflow, allocation failure, or runtime recording failure.
Normalize probabilities over the selected experts for each token. probabilities is F32 [T, E]; expert_indices is I32 [T, K] with 1 <= K <= E. The routing decision is detached from reverse mode, while gradients propagate to the selected probability entries. Errors Returns an error for incompatible shapes, dtypes, engine ownership, shader ABI overflow, allocation failure, or runtime recording failure.
Quantize Float32 storage into one native OA Q4 or Q8 weight value. The returned value retains the source shape; its physical planes remain private. Errors Returns an error unless the input is a non-empty Float32 matrix whose element byte offsets fit the u32 kernel ABI, or allocation/recording fails.
Apply the rectified linear unit elementwise. Errors Returns an error unless input is F32 or runtime recording fails.
Apply weighted root-mean-square normalization over the final dimension. Errors Returns an error unless input is a nonempty F32 Matrix, weight is a same-engine F32 vector matching its final dimension, epsilon is finite and positive, or runtime recording fails.
Apply per-row RMS normalization, a cyclic broadcast affine, and a SiLU gate. Normalization is over the final input dimension. The affine value may have one or more leading groups; those groups repeat over the flattened input rows. An optional bias must exactly match weight. Errors Returns an error for incompatible shape, dtype, Engine ownership or epsilon, or when runtime recording fails.
Compute all gated RMS normalization adjoints explicitly. Errors Returns an error for an incompatible output gradient or forward contract, or when runtime recording fails.
Apply one Elman RNN cell update to a caller-supplied hidden state. gates_i and hidden have shape [batch, hidden], weight_hh has [hidden, hidden], and an optional recurrent bias has [hidden]. Errors Returns an error unless all values are nonempty same-engine F32 matrices, shapes agree, hidden size is at most 1024, or runtime recording fails.
Run a whole-sequence Elman recurrence from a zero hidden state. gates_i has shape [batch, sequence, hidden], weight_hh has [hidden, hidden], and an optional recurrent bias has [hidden]. Errors Returns an error unless all values are nonempty same-engine F32 matrices, shapes agree, hidden size is at most 1024, or runtime recording fails.
Apply split-half rotary position embeddings to [tokens, heads * head_dim]. position_offset selects the first absolute position, making the same operation usable for full sequences and future KV-cache extension. Errors Returns an error unless the input is nonempty F32, head_dim is even, the final width matches num_heads * head_dim, and theta_base is finite and positive.
Apply standard scaled dot-product attention to [B*H, S, D/H] values. additive_mask, when present, is detached F32 [B*H*S, S] storage. Causal visibility is applied without materializing another mask. Errors Returns an error unless Q, K, and V are equal nonempty same-engine F32 rank-three matrices, the optional mask matches their flattened score rows, or runtime recording fails.
Apply multi-head causal scaled dot-product attention to packed [B*S, D] values. Errors Returns an error unless Q, K, and V are equal nonempty same-engine F32 matrices, their row count is divisible by sequence_length, their width is divisible by num_heads, or runtime recording fails.
Apply the logistic sigmoid elementwise. Errors Returns an error unless input is F32 or runtime recording fails.
Apply the sigmoid linear unit elementwise. Errors Returns an error unless input is F32 or runtime recording fails.
Apply SiLU(gate) * up to concatenated halves of the final input axis. Errors Returns an error unless input is F32 with final extent exactly twice the nonzero intermediate_size, or runtime recording fails.
Compute softmax(scores * scale + mask) over the final axis. The additive mask is detached from reverse mode. Errors Returns an error unless both values are equal-shape, nonempty, same-engine F32 matrices, or runtime recording fails.
Apply the overflow-safe Softplus formulation elementwise. Errors Returns an error unless input is F32 or runtime recording fails.
Permute contiguous [B*S, D] storage into [B*H, S, D/H] heads. The one-head case is a zero-copy differentiable view. Errors Returns an error unless input is nonempty F32 [B*S, D], all dimensions are nonzero, D is divisible by num_heads, or runtime recording fails.
Apply SiLU(gate) * up elementwise. Errors Returns an error unless both inputs are equal-shape F32 on the same engine, or runtime recording fails.
Apply hyperbolic tangent elementwise. Errors Returns an error unless input is F32 or runtime recording fails.
Upsample an FP32 NCHW Matrix by a positive integer scale factor. Errors Returns an error unless the input is nonempty rank-four F32, the scale factor is positive, all output geometry is representable, or runtime recording fails.
Assign every FP32 latent row to its nearest FP32 codebook row. Squared L2 distance is used and equal-distance ties select the lower code index, matching OA C++. The hard assignment is detached from reverse mode. Errors Returns an error unless inputs are nonempty same-engine FP32 [N,D] and [K,D] matrices or recording/allocation fails.
Produce the next VQ EMA state without mutating input Matrix values. This preserves the donor update equations, optional unit-RMS codebook normalization, and exact dead-code revival hash. The owning module installs the returned values into its stable persistent buffer handles. Errors Returns an error for incompatible shapes, dtypes, engines, invalid numerical options, ABI overflow, allocation failure, or runtime recording failure.
Gather codebook rows selected by I32 token indices. Invalid indices yield zero rows without an out-of-bounds read. This pure decode operation is detached from reverse mode because EMA owns codebook learning. Errors Returns an error unless the codebook is FP32 [K,D], indices are I32 [N], both belong to one engine, or recording/allocation fails.
Types
0 members
0 members
The fifteen explicit adjoints of mamba3_mimo.
Source0 members
4 members
A GPU-resident weight stored in OA’s native Q4 or Q8 block encoding. Constructed by quantize; the packed payload and scale planes are private implementation detail and never exposed as public matrix values.
Source0 members
Complete adjoints of broadcast-affine gated RMS normalization.
Source0 members
The eleven explicit adjoints of mamba3_siso.
SourceEnums
OA native block quantization selector. Both formats share one 32-value block layout and one Float32 scale per block. Q4 stores a biased 4-bit index per value (16 bytes per block); Q8 stores one signed byte per value (32 bytes per block).
Q4 · Q8
Types
1 members
Registers an explicitly included MCP view over an existing training session. The server borrows session through its handlers and must be closed or destroyed first. oa/ml deliberately does not opt applications into the network control surface. Rebuild and preview remain absent until their checkpoint and completion contracts are admitted. Donor: oa::McpTraining.
SourceFunctions
Compute last-axis categorical accuracy as a fraction in [0, 1]. Argmax and counting execute on the owning device. Only the resulting U32 scalar crosses the host boundary; this function then waits for that scalar. Equal maximum logits select the first class, matching the OA C++ contract. Errors Returns an error when matrix::categorical_accuracy_count rejects the logits or labels, or submission, completion, or scalar readback fails.
Read one scalar FP32 loss value. This is an explicit host-observation boundary: pending work is submitted and the producing event is awaited before the value is returned. Errors Returns an error unless loss contains exactly one F32 value, or submission, completion, or readback fails.
Types
20 members
3 members
Caller-owned incremental-decode key/value cache for MultiHeadAttention. Each MultiHeadAttention::step call appends one [B*H, 1, D/H] key/value pair and attends over every cached position. The cache binds to the constructing module instance; presenting it to another attention module fails closed.
Source21 members
29 members
Trainable FP32 BatchNorm over channels of NCHW matrices.
Construct BatchNorm2d with epsilon 1e-5 and momentum 0.1. Errors Returns an error when num_features is zero or state allocation fails.
21 members
Fixed 256-row trainable embedding for packed U8 or U32 byte IDs.
21 members
Trainable affine output head from hidden rows to 256 byte logits.
29 members
Multi-head linear attention over packed [B*S, D] values. Uses the Katharopoulos (2020) ELU+1 kernel rather than softmax. Causal heads up to 64 use fused forward and recomputed prefix/suffix adjoints. Saved projections/context scale as O(BHSd), with bounded O(d²) scan state per head. Larger heads retain the compositional path, whose training tape saves O(BHSd²) prefixes. Bidirectional mode uses the global KV composition. Standard attention stores S² probabilities; Flash recomputes them and does not store a global S² score matrix. Parameter layout Four biased projections (q_proj, k_proj, v_proj, out_proj) with the same names and seed stride as MultiHeadAttention, so checkpoints are transferable between the two modules.
Construct four biased projections with causal visibility. Errors Returns an error unless dimensions are positive, model_width is divisible by num_heads, or child construction/registration fails.
Construct four biased projections with causal visibility. Errors Returns an error unless dimensions are positive, model_width is divisible by num_heads, or child construction/registration fails.
Construct four biased projections with causal visibility. Errors Returns an error unless dimensions are positive, model_width is divisible by num_heads, or child construction/registration fails.
Construct four biased projections with causal visibility. Errors Returns an error unless dimensions are positive, model_width is divisible by num_heads, or child construction/registration fails.
Construct four biased projections with causal visibility. Errors Returns an error unless dimensions are positive, model_width is divisible by num_heads, or child construction/registration fails.
28 members
Trainable FP32 one-dimensional convolution over NCL matrices.
Construct a deterministically initialized Conv1d layer. Forward preserves OA’s im2col plus tiled-GEMM route. Weight uses a fan-in-scaled symmetric uniform initializer and bias starts at zero. Errors Returns an error when dimensions, stride, or dilation are zero, shape arithmetic overflows, or allocation/upload fails.
28 members
Trainable grouped FP32 two-dimensional convolution over NCHW matrices.
Construct a deterministically initialized grouped Conv2d layer. The weight initializer is symmetric uniform with bound 1 / sqrt((input_channels / groups) * kernel_size²); bias starts at zero. Errors Returns an error when dimensions are zero, channels are not divisible by groups, shape arithmetic overflows, or allocation/upload fails.
26 members
Trainable bias-free FP32 one-dimensional transposed convolution over NCL matrices.
Construct a deterministically initialized ConvTranspose1d layer. Weight uses the donor [input_channels, output_channels, kernel] layout, a fan-in-scaled symmetric uniform initializer, and no bias parameter. Errors Returns an error when channels, kernel size, or stride are zero, shape arithmetic overflows, or parameter allocation/upload fails.
27 members
Trainable FP32 two-dimensional transposed convolution over NCHW matrices.
Construct a deterministically initialized ConvTranspose2d layer. Weight uses [input_channels, output_channels, kernel, kernel] layout, a fan-in-scaled symmetric uniform initializer, and zero channel bias. Errors Returns an error when channels, kernel size, or stride are zero, shape arithmetic overflows, or parameter allocation/upload fails.
19 members
23 members
Trainable FP32 lookup table indexed by an arbitrary-shape U8, U32, or I32 matrix.
Construct a deterministically initialized embedding table. Errors Returns an error when either dimension is zero, shape arithmetic overflows, or allocation/upload fails.
Construct a deterministically initialized embedding table. Errors Returns an error when either dimension is zero, shape arithmetic overflows, or allocation/upload fails.
Construct a deterministically initialized embedding table. Errors Returns an error when either dimension is zero, shape arithmetic overflows, or allocation/upload fails.
Construct a deterministically initialized embedding table. Errors Returns an error when either dimension is zero, shape arithmetic overflows, or allocation/upload fails.
24 members
OA’s embedding-plus-hybrid-Mamba core with one canonical Rust execution path. The stack interleaves Mamba-3 blocks with evenly spaced causal self-attention blocks (Nemotron-style), each followed by a dense or routed-expert feed-forward tail. Whole-sequence forward runs through the module graph; single-token decode threads caller-owned EmpyrealmState through step/step_embedded.
4 members
Layer schedule and widths for the hybrid Empyrealm stack. attention_every interleaves one causal self-attention block after every attention_every - 1 Mamba-3 blocks, at positions k * attention_every - 1; zero produces a pure Mamba-3 stack. Every block owns a pre-normalized residual mixer plus a dense or routed-expert feed- forward tail, and the stack ends in a final RMSNorm.
Source2 members
Caller-owned per-block decode state for Empyrealm. Entries mirror the block schedule one to one: Mamba-3 blocks own a Mamba3State and attention blocks own an AttentionCache. Obtaining it through Empyrealm::new_state binds it to that module instance and keeps every child owner check intact.
Source21 members
Pre-normalized SwiGLU feed-forward network with a residual connection. The module preserves the OA donor structure: RMSNorm -> (gate, up) -> SwiGLU -> down -> residual add.
20 members
Flatten an inclusive range of Matrix dimensions into one dimension. Negative dimensions are resolved from the end at call time. The donor default (1, -1) preserves a leading batch dimension.
24 members
Trainable flow/diffusion denoiser with optional condition features and CFG.
Construct a deterministic dense or MoE denoiser. Errors Returns an error for invalid model/time/dropout geometry or failed child, parameter, and buffer construction.
Construct a deterministic dense or MoE denoiser. Errors Returns an error for invalid model/time/dropout geometry or failed child, parameter, and buffer construction.
Construct a deterministic dense or MoE denoiser. Errors Returns an error for invalid model/time/dropout geometry or failed child, parameter, and buffer construction.
Construct a deterministic dense or MoE denoiser. Errors Returns an error for invalid model/time/dropout geometry or failed child, parameter, and buffer construction.
4 members
Configuration for a modality-independent flow/diffusion denoiser.
Source21 members
GPU sinusoidal embedding for normalized continuous flow time.
25 members
Reusable bidirectional Transformer backbone for flow/diffusion denoisers.
Construct a deterministic dense or dropless-MoE flow Transformer. Errors Returns an error for invalid geometry, expert routing, epsilon, or failed child construction and registration.
Construct a deterministic dense or dropless-MoE flow Transformer. Errors Returns an error for invalid geometry, expert routing, epsilon, or failed child construction and registration.
Construct a deterministic dense or dropless-MoE flow Transformer. Errors Returns an error for invalid geometry, expert routing, epsilon, or failed child construction and registration.
Construct a deterministic dense or dropless-MoE flow Transformer. Errors Returns an error for invalid geometry, expert routing, epsilon, or failed child construction and registration.
4 members
Configuration for a bidirectional flow/diffusion Transformer backbone.
Source18 members
26 members
Stacked batch-first gated recurrent unit using whole-sequence GPU scans. Input uses [batch, sequence, input]; output uses [batch, sequence, hidden]. Every layer starts from a zero hidden state.
25 members
One gated recurrent unit cell with an explicit caller-owned hidden state.
18 members
26 members
Trainable FP32 LayerNorm over the final input dimension.
28 members
Trainable FP32 affine projection using [output, input] weight layout.
Construct a deterministically initialized linear layer. seed controls an independent SplitMix64 Xavier-uniform initializer. Errors Returns an error when either feature count is zero, shape arithmetic overflows, or parameter allocation/upload fails.
19 members
25 members
Parameter-owning Mamba-3 selective state-space block.
Construct a deterministically initialized Mamba-3 block. The module preserves the donor parameter layout and complete projection → preprocess → SISO scan → optional gated per-head RMSNorm → output-projection path. seed owns an independent deterministic initializer stream. Errors Returns an error for invalid or overflowing geometry, invalid numerical bounds, or failed allocation/registration.
4 members
Construction contract for the donor-backed Mamba-3 block.
Source1 members
Explicit recurrent cache for one Mamba3 module and batch size. The cache owns the selective state, cumulative rotary angle, previous key, and previous value buffers. It is deliberately separate from the module so independent decoding streams never share hidden mutable state.
Source21 members
45 members
Sparse top-k mixture-of-experts feed-forward module. The implementation preserves OA’s expert-major route plan and stacked parameter layout. Routing decisions remain detached while gradients flow through selected gate magnitudes, expert projections, RMSNorm, and the residual input.
Construct a deterministically initialized sparse MoE. experts_per_token is clamped to 1..=num_experts, matching OA C++. The current GPU route planner admits at most 256 experts. Errors Returns an error for zero dimensions, more than 256 experts, invalid epsilon, shape overflow, allocation failure, or registration failure.
8 members
Reduced host telemetry for the latest MoE routing decision.
Source36 members
Multi-head self-attention over packed [B*S, D] values.
Construct four biased projections with causal visibility and automatic backend policy. Errors Returns an error unless dimensions are positive and model_width is divisible by num_heads, or child construction/registration fails.
Construct four biased projections with causal visibility and automatic backend policy. Errors Returns an error unless dimensions are positive and model_width is divisible by num_heads, or child construction/registration fails.
Construct four biased projections with causal visibility and automatic backend policy. Errors Returns an error unless dimensions are positive and model_width is divisible by num_heads, or child construction/registration fails.
Construct four biased projections with causal visibility and automatic backend policy. Errors Returns an error unless dimensions are positive and model_width is divisible by num_heads, or child construction/registration fails.
Construct four biased projections with causal visibility and automatic backend policy. Errors Returns an error unless dimensions are positive and model_width is divisible by num_heads, or child construction/registration fails.
18 members
25 members
Stack of independently EMA-trained residual vector quantizers.
Construct num_levels deterministically initialized quantizers. Errors Returns an error when the level count or configuration is invalid, child state allocation fails, or module registration fails.
23 members
Trainable FP32 RMSNorm over the final input dimension.
28 members
Stacked batch-first Elman recurrent network using whole-sequence GPU scans. Input uses [batch, sequence, input]; output uses [batch, sequence, hidden]. Every layer starts from a zero hidden state.
Construct a deterministically initialized stacked RNN with biases. Errors Returns an error when a dimension or layer count is zero, hidden size exceeds the 1024-element scan limit, arithmetic overflows, or parameter allocation and registration fail.
25 members
One Elman recurrent cell with an explicit caller-owned hidden state.
20 members
22 members
18 members
19 members
21 members
Donor-compatible SwiGLU MLP with optional projection biases.
28 members
Ready-to-train causal Transformer language model. This is the idiomatic Rust spelling of donor oa::NnTransformer: token and position embeddings, registered Transformer blocks, final normalization, and a vocabulary projection.
Construct a deterministic causal language model. Errors Returns an error unless all dimensions are positive, the model width is divisible by the head count, positions fit U32, and every child can be constructed and registered.
Construct a deterministic causal language model. Errors Returns an error unless all dimensions are positive, the model width is divisible by the head count, positions fit U32, and every child can be constructed and registered.
Construct a deterministic causal language model. Errors Returns an error unless all dimensions are positive, the model width is divisible by the head count, positions fit U32, and every child can be constructed and registered.
Construct a deterministic causal language model. Errors Returns an error unless all dimensions are positive, the model width is divisible by the head count, positions fit U32, and every child can be constructed and registered.
Construct a deterministic causal language model. Errors Returns an error unless all dimensions are positive, the model width is divisible by the head count, positions fit U32, and every child can be constructed and registered.
Construct a deterministic causal language model. Errors Returns an error unless all dimensions are positive, the model width is divisible by the head count, positions fit U32, and every child can be constructed and registered.
38 members
One pre-normalized causal Transformer block.
Construct the canonical pre-norm attention and GELU feed-forward block. Errors Returns an error for invalid dimensions or failed child construction.
Construct the canonical pre-norm attention and GELU feed-forward block. Errors Returns an error for invalid dimensions or failed child construction.
Construct the canonical pre-norm attention and GELU feed-forward block. Errors Returns an error for invalid dimensions or failed child construction.
Construct the canonical pre-norm attention and GELU feed-forward block. Errors Returns an error for invalid dimensions or failed child construction.
Construct the canonical pre-norm attention and GELU feed-forward block. Errors Returns an error for invalid dimensions or failed child construction.
Construct the canonical pre-norm attention and GELU feed-forward block. Errors Returns an error for invalid dimensions or failed child construction.
20 members
26 members
EMA-trained vector quantizer with persistent, non-gradient codebook state.
Construct a deterministically initialized quantizer. Errors Returns an error for an invalid configuration, shape overflow, or failed state allocation/upload.
4 members
Configuration for one EMA-trained vector-quantization codebook.
SourceEnums
Execution policy for scaled dot-product attention. Auto selects only a route proven by device-specific performance evidence. It currently preserves the compositional AttentionBackend::Standard provider on every device.
Auto · Standard · Flash · Linear
Functions
Clip the combined L2 norm of nonempty FP32 gradients in place. The operation records one GPU reduction followed by one GPU scaling pass. It does not read gradients back to the CPU or wait for completion. Empty matrices are ignored; at most sixteen nonempty gradients are admitted. Errors Returns an error when max_norm is negative or non-finite, more than sixteen nonempty gradients are supplied, gradients do not share one engine, a gradient is not FP32, storage is duplicated, a size exceeds the shader ABI, or allocation and runtime recording fail.
Types
13 members
Adam optimizer over stable Parameter handles.
Source13 members
Decoupled-weight-decay Adam optimizer over stable Parameter handles.
Source0 members
Optimizer with a complete native .oam save-and-restore contract. This capability is sealed because persistence must remain synchronized with OA’s versioned model-file codec. Custom optimizers can implement Optimizer for eager training without claiming wire compatibility.
Source13 members
Muon optimizer with Nesterov momentum and rank-two NS5 orthogonalization. Rank-two parameters use the donor Muon matrix pipeline. Other ranks use its fused momentum update; OA never silently delegates them to AdamW.
Source10 members
Optimizer for externally authored parameter updates. NoOpOptimizer lets callers use crate::ml::ItTraining for cadence, metrics, and callbacks while the step body owns all parameter mutation.
Source6 members
Common behavior exposed by an OA optimizer to training policy. This contract deliberately excludes captured-program and persistence internals. Those capabilities depend on optimizer-specific state and are admitted separately only when their complete implementation exists.
Source12 members
Functions
Differentiably evaluate stored categorical actions. Gradients flow through logits, log_probability, and entropy; action indices remain discrete. action and value are zero-copy semantic output aliases, matching OA C++. Errors Returns an error when logits are not FP32 [E,A] with E > 0 and A > 1, actions are not I32 [E], values are not FP32 [E], inputs do not share one engine, or composite lowering fails.
Differentiably evaluate a stored pre-tanh normal action. Log standard deviation is clamped to [-20, 2]. Actions are mapped from [-1, 1] into [minimum, maximum]; log probability includes the donor tanh Jacobian correction, while entropy is the unsquashed diagonal-normal value. raw_action and value are zero-copy semantic output aliases. Errors Returns an error when mean, log-standard-deviation, and raw-action are not matching nonempty FP32 [E,A] matrices, value is not FP32 [E], inputs do not share one engine, bounds/epsilon are invalid, a size exceeds the shader ABI, or composite lowering fails.
Sample and evaluate one categorical action per environment. A nonzero seed is deterministic. Seed zero follows the process-local OA RNG convention. The action is sampled from the same logits used for returned log probabilities and entropy. Errors Returns an error when logits are not FP32 [E,A] with E > 0 and A > 1, values are not FP32 [E] on the same engine, or composite lowering fails.
Sample a reparameterized tanh-normal policy. The returned raw action is mean + exp(clamped_log_stddev) * noise, so gradients flow through both distribution parameters while Philox noise stays detached. A nonzero seed is deterministic; seed zero follows OA’s process-local RNG convention. Errors Returns an error when mean/log-standard-deviation are not matching nonempty FP32 [E,A] matrices, value is not FP32 [E] on the same engine, bounds/epsilon are invalid, a size exceeds the shader ABI, or composite lowering fails.
Types
Types
7 members
Device-resident replay values, optionally including sampled source indices.
Source10 members
Circular fixed-capacity owner for off-policy transitions. Batched append and deterministic uniform sampling are recorded on the one owning engine. Cursor and size are host control metadata and never require a Matrix readback.
Source8 members
One batch of transitions to append to a ReplayBuffer.
SourceTypes
11 members
Time-major matrices retained by one RolloutBuffer.
Source11 members
Stateful fixed-capacity owner for one categorical on-policy rollout. Appends, validity reset, and final GAE are recorded on the owning engine; host observation remains the explicit submit-and-wait boundary. Storage is allocated once and overwritten in place across completed collection cycles.
Source10 members
One vector-environment transition whose values remain device-resident.
SourceTypes
Types
0 members
OA C++ compatibility spelling for Checkpoint.
Source0 members
OA C++ compatibility spelling for CsvLogger.
Source0 members
OA C++ compatibility spelling for EarlyStopping.
Source0 members
OA C++ compatibility spelling for LearningRateScheduler.
Source0 members
OA C++ compatibility spelling for PhaseSchedule.
Source0 members
OA C++ compatibility spelling for ProgressBar.
Source0 members
OA C++ compatibility spelling for TrainingSummary.
Source0 members
OA C++ compatibility spelling for Validation.
Source11 members
Epoch, interval, best-model, and restore-best checkpoint policy.
Source6 members
Reusable compiled collection owner: captured reset/step/GAE plans plus replay accounting.
Source7 members
Buffered one-row-per-completed-step CSV logger. File creation, writes, and close-time flushing happen only at explicit callback boundaries. Abandoning the callback discards any unflushed host buffer; Drop does not hide an I/O failure.
Source10 members
Stateful DQN training coordinator over caller-owned components. The online module, target module, optimizer, replay storage, and engine remain caller-owned and must outlive this coordinator. Dropping the trainer does not submit, wait, synchronize targets, or fire terminal callbacks; use DqnTrainer::finish for the explicit terminal boundary.
Source12 members
Cooperative epoch-boundary early stopping.
Source4 members
Aggregate device time for completed, timestamped training steps.
Source14 members
Coordinator for alternating fixed-capacity collection and optimizer phases.
Source26 members
Exact eager or captured training-step lifecycle. The loop borrows the engine, optimizer, metrics, and callbacks. Call ItTraining::begin_step before authoring each body, then finish it with ItTraining::complete_step or ItTraining::complete_program_step. ItTraining::finish is the explicit fallible terminal boundary.
Construct a training lifecycle around one engine and optimizer. Errors Returns an error when source-unit accounting is non-finite or overflows, or the variable epoch schedule overflows.
Construct a training lifecycle around one engine and optimizer. Errors Returns an error when source-unit accounting is non-finite or overflows, or the variable epoch schedule overflows.
Construct a training lifecycle around one engine and optimizer. Errors Returns an error when source-unit accounting is non-finite or overflows, or the variable epoch schedule overflows.
Construct a training lifecycle around one engine and optimizer. Errors Returns an error when source-unit accounting is non-finite or overflows, or the variable epoch schedule overflows.
Construct a training lifecycle around one engine and optimizer. Errors Returns an error when source-unit accounting is non-finite or overflows, or the variable epoch schedule overflows.
Construct a training lifecycle around one engine and optimizer. Errors Returns an error when source-unit accounting is non-finite or overflows, or the variable epoch schedule overflows.
6 members
Applies a learning-rate schedule after every completed optimizer step.
Source14 members
Consecutive phase policy over one super::super::ItTraining lifecycle. The phase schedule does not own another iterator. Its epoch/step totals must exactly match the iterator configuration, and its optional transition hook receives restricted mutable access to the iterator’s existing optimizer.
Source24 members
Complete caller-driven categorical PPO lifecycle. The Engine, model, and optimizer remain caller-owned. The trainer owns only its fixed-capacity rollout and lifecycle state. Drop performs no submission, waiting, or terminal callbacks; call PpoTrainer::finish explicitly.
4 members
Scalar results from the last completed PPO update epoch.
Source5 members
Reusable fixed-geometry PPO backward and AdamW programs. Retain this value across trainers when checkpointing between rollouts. Each minibatch reuses one bounded tape’s storage, accumulating sample-weighted gradients before exactly one AdamW step per epoch. Tail shapes compile once. Drop never submits or waits. Different models/configurations are rejected.
Source9 members
Throttled Keras/tqdm-style wall-throughput progress display.
Source10 members
Stateful fixed-temperature SAC coordinator over caller-owned components.
Source3 members
Fixed-geometry trading reset, policy/step/append and GAE replay programs. Retain alongside the same environment and PpoUpdateProgram across rollouts. Seven cursor words are uploaded once per chunk and advance on device; tables refresh at explicit completed rollout boundaries. Drop never executes or waits.
Source5 members
Restricted mutable services available to one callback invocation.
Source3 members
One command submitted by a session client.
Source7 members
Immutable evidence for one training-program compilation stage.
Source0 members
Compatibility alias for the pre-ItTraining Rust prototype spelling.
Source0 members
Compatibility alias for the pre-ItTrainingConfig Rust prototype spelling.
Source18 members
Fixed-shape forward, backward, and AdamW program captured for Vulkan replay. The first capture records semantic work without executing it. Replays use one cached command buffer and graph-resident optimizer state; no forward, autograd, or optimizer graph is rebuilt on the host.
20 members
Cloneable, thread-safe command and observation handle for one training loop. Attach it to exactly one super::ItTraining instance. Clones may enqueue commands and read bounded evidence from UI, viewer, or service threads.
3 members
Bounded live-control snapshot published by an attached iterator.
Source28 members
9 members
Final loss, wall-time, device-time, throughput, and run summary.
Source9 members
Runs application-owned inference validation at completed lifecycle boundaries. Epoch-based training evaluates once at every epoch end. Step-only training evaluates at each non-zero configured interval and once at train end when the final step was not already evaluated. Evaluation wall time is excluded from training throughput and the callback never submits work on its own.
Source4 members
Cloneable observation handle for the latest completed validation loss. Clones share one thread-affine value so checkpoint, summary, and early-stop callbacks can observe the result without owning or rerunning validation.
SourceEnums
Kind of command applied at a training safe point.
Pause · Resume · Stop · Checkpoint · Evaluate · SetParameter · RequestRecapture · RequestRebuild
Ordered compilation stage for a captured training program.
SemanticValidation · ReplaySafety · Decomposition · Fusion · Placement · Precision · KernelSelection · LoweringValidation · MemoryPlanning · SynchronizationPlanning · CommandRecording
Outcome of one training-program compilation stage.
NotRun · Inherited · Analyzed · Applied · Failed
Live state of an attached training lifecycle.
Running · Paused · Stopping · Completed · Failed
Typed value carried by a command or exposed parameter.
Empty · Boolean(bool) · Integer(i64) · Float(f64) · String(String)
Types
43 members
Complete Animation Language Model ownership and persistence boundary. The tokenizer and prior remain independently trainable children, while this module gives checkpoints one unambiguous tokenizer.* / prior.* tree and exposes their composed tokenization and generation paths.
Construct the complete ALM with deterministic child seeds. Errors Returns an error unless the tokenizer and prior vocabulary contracts agree, or when either child or the ownership tree cannot be constructed.
Construct the complete ALM with deterministic child seeds. Errors Returns an error unless the tokenizer and prior vocabulary contracts agree, or when either child or the ownership tree cannot be constructed.
4 members
Product-level ALM architecture configuration.
Source30 members
Decoder-only ALM motion-token prior. The permanent backbone is causal attention. Its feed-forward policy may be dense, MoE, or hybrid without changing tokenization, conditioning, generation, or the registered persistence tree.
Construct a deterministic ALM prior. Errors Returns an error for inconsistent vocabulary, dimensions, routing policy, generation policy, failed allocation, or child registration.
6 members
29 members
Temporal Conv1d VQ-VAE used by ALM to map motion frames to discrete tokens. The model accepts [batch, frames, input_dim], downsamples time by 2^downsample_stages, performs one level of normalized EMA vector quantization, and reconstructs the original rank-three shape.
Construct the tokenizer with the donor’s deterministic 0xC0FFEE continuous Glorot stream. Errors Returns an error for invalid geometry or quantizer policy, arithmetic overflow, failed allocation/upload, or module-registration failure.
4 members
Architecture and quantization policy for the ALM temporal VQ-VAE tokenizer.
Source3 members
Summary of one external CLIP SafeTensors translation.
Source27 members
Exact frozen CLIP text-with-projection tower used by conditioned ALM.
Translate the published CLIP ViT-L/14 SafeTensors image into native .oam. The translator admits every and only text-tower FP32 tensor, validates exact shapes, ignores unrelated vision/logit-scale tensors, and rejects unknown names below the text namespaces. No Vulkan Engine is needed for this host conversion. Errors Returns an error for malformed SafeTensors data, a missing/unexpected text tensor, dtype or shape mismatch, arithmetic overflow, or output failure.
Translate the published CLIP ViT-L/14 SafeTensors image into native .oam. The translator admits every and only text-tower FP32 tensor, validates exact shapes, ignores unrelated vision/logit-scale tensors, and rejects unknown names below the text namespaces. No Vulkan Engine is needed for this host conversion. Errors Returns an error for malformed SafeTensors data, a missing/unexpected text tensor, dtype or shape mismatch, arithmetic overflow, or output failure.
Translate the published CLIP ViT-L/14 SafeTensors image into native .oam. The translator admits every and only text-tower FP32 tensor, validates exact shapes, ignores unrelated vision/logit-scale tensors, and rejects unknown names below the text namespaces. No Vulkan Engine is needed for this host conversion. Errors Returns an error for malformed SafeTensors data, a missing/unexpected text tensor, dtype or shape mismatch, arithmetic overflow, or output failure.
Translate the published CLIP ViT-L/14 SafeTensors image into native .oam. The translator admits every and only text-tower FP32 tensor, validates exact shapes, ignores unrelated vision/logit-scale tensors, and rejects unknown names below the text namespaces. No Vulkan Engine is needed for this host conversion. Errors Returns an error for malformed SafeTensors data, a missing/unexpected text tensor, dtype or shape mismatch, arithmetic overflow, or output failure.
Translate the published CLIP ViT-L/14 SafeTensors image into native .oam. The translator admits every and only text-tower FP32 tensor, validates exact shapes, ignores unrelated vision/logit-scale tensors, and rejects unknown names below the text namespaces. No Vulkan Engine is needed for this host conversion. Errors Returns an error for malformed SafeTensors data, a missing/unexpected text tensor, dtype or shape mismatch, arithmetic overflow, or output failure.
Translate the published CLIP ViT-L/14 SafeTensors image into native .oam. The translator admits every and only text-tower FP32 tensor, validates exact shapes, ignores unrelated vision/logit-scale tensors, and rejects unknown names below the text namespaces. No Vulkan Engine is needed for this host conversion. Errors Returns an error for malformed SafeTensors data, a missing/unexpected text tensor, dtype or shape mismatch, arithmetic overflow, or output failure.
4 members
Frozen CLIP text-tower architecture consumed by conditioned ALM.
Source3 members
Host token batch consumed by super::ClipText::forward_tokens.
Source9 members
Native OpenAI CLIP byte-BPE tokenizer. The merges input is the canonical bpe_simple_vocab_16e6 text format. It remains an explicit host asset rather than being hidden inside model state.
SourceEnums
Functions
Build tokenizer windows from a loaded HumanML3D dataset. Errors Returns the same errors as build_tokenizer_windows.
Build true-boundary next-token windows for every motion-token sequence. A short sequence produces one padded window. A long sequence produces one full window for every valid start position and never fabricates SOM or EOM at an interior boundary. Errors Returns an error when window_len is zero, sequence length arithmetic overflows, or the inventory exceeds addressable host memory.
Build the donor tokenizer windows: 50% overlap and one exact tail window. Clips shorter than sequence_len do not produce a window. The returned order is stable: clip order, then ascending frame offset. Shuffling remains an explicit training-policy concern. Errors Returns an error when sequence_len is zero or the number of windows overflows addressable host memory.
Evaluate an ALM prior over true-boundary held-out token windows. Conditioned validation uses the first cached caption feature for each sequence, matching the donor rather than the epoch-rotating training rule. Errors Returns an error for incompatible model, sequence, conditioning, or batch geometry, empty validation data, allocation, inference, synchronization, or compact metric readback failure.
Evaluate a tokenizer over one standardized HumanML3D validation split. Errors Returns an error for incompatible model/dataset geometry, empty validation inventory, invalid batching, allocation, inference, synchronization, readback, denormalization, or HumanML3D diagnostic failure.
Gather a cyclic fixed-size prior batch with true-boundary padding. Errors Returns an error for empty windows, zero geometry, invalid window descriptors, invalid motion token IDs, or allocation overflow.
Gather a cyclic fixed-size tokenizer batch from normalized dataset clips. Errors Returns an error for an empty window inventory, zero batch size, mismatched sequence geometry, invalid window, or allocation overflow.
Gather a cyclic tokenizer batch from row-major normalized motion clips. Errors Returns an error for zero geometry, malformed clips, empty or invalid windows, cursor/allocation overflow, or a window outside its source clip.
Tokenize every eligible normalized dataset clip with one trained tokenizer. Clips shorter than one downsample interval are rejected because silently dropping a dataset row would break caption/conditioning alignment. Errors Returns an error for feature-width mismatch, a short/malformed clip, allocation, tokenizer execution, synchronization, or readback failure.
Train tokenizer and prior stages over one HumanML3D dataset, then compose the independently trainable children into one product-level ALM model. A prior with text_feature_dim == 0 is unconditional. A conditioned prior requires the dataset’s validated oa_clip_text_v1 rows and preserves the manifest model identity in the resulting bundle. Errors Returns an error from either stage, token-corpus construction, cached text contract validation, product ownership composition, or count overflow.
Train both ALM stages with native frozen CLIP caption features and embed the text tower plus exact BPE merge asset in the resulting product bundle. Caption features are baked in memory in deterministic dataset/caption order, so this route does not require a pre-existing text_feats cache. Optional held-out data uses the identical frozen encoder and tokenizer asset. Errors Returns the same errors as train_alm_with_validation, plus CLIP model, merge-table, caption tokenization/encoding, projection-width, or native product-composition failures.
Train both ALM stages while evaluating a held-out HumanML3D split at every completed stage epoch. Tokenizer validation observes motion reconstruction directly. After that stage is complete, the same frozen tokenizer creates both train and held-out token corpora so prior validation cannot drift to a different vocabulary. Errors Returns the same errors as train_alm, plus held-out split, tokenization, conditioning, evaluation, or callback failures.
Train an ALM prior with true-boundary token windows and the shared OA iterator/callback lifecycle. This path deliberately uses the eager iterator mode because a padded batch’s valid_count is a host scalar that can change between steps. Replaying a fixed captured push constant would silently apply the wrong normalization. Once dynamic executable-graph scalars are admitted, this restriction can be removed without changing the public training contract. Errors Returns an error for invalid configuration, token or conditioning data, model/configuration mismatch, allocation, autograd, optimizer, runtime, timing, metric, or callback failure. A non-finite completed loss is rejected.
Train the prior and evaluate one held-out corpus at every epoch end. This is the same training implementation as train_prior; the extra argument only attaches OA’s shared Validation callback. Errors Returns the same errors as train_prior, plus held-out evaluation or callback failures.
Train the temporal ALM VQ-VAE over normalized row-major motion clips. The optimized objective combines reconstruction Smooth L1, velocity Smooth L1, and the configured VQ commitment loss. The iterator’s primary loss remains reconstruction, matching the donor trainalm progress/checkpoint contract. Codebook updates use EMA and are not AdamW parameters. Errors Returns an error for invalid configuration/corpus geometry, allocation, model, autograd, EMA, optimizer, runtime, timing, metric, or callback failure. A non-finite completed reconstruction loss is rejected.
Train the tokenizer and evaluate one held-out split at every epoch end. This is the same training implementation as train_tokenizer; the extra argument only attaches OA’s shared Validation callback. Errors Returns the same errors as train_tokenizer, plus held-out evaluation or callback failures.
Types
4 members
Stage policies for one complete tokenizer-then-prior ALM run.
Source0 members
Evidence and resulting product model from one complete ALM run.
Source1 members
Borrowed held-out dataset and per-stage evaluation policy.
Source3 members
Owned host batch for one ALM prior training or validation step.
Source2 members
Frozen text features associated with each motion-token sequence. Each entry of by_sequence is a row-major collection of one or more feature_dim caption embeddings. Training selects captions with the donor’s deterministic (seed + epoch + sequence) % caption_count rule.
Source4 members
Complete optimizer and iteration policy for train_prior.
Source3 members
Final evidence from one ALM prior training run.
Source1 members
Borrowed held-out corpus evaluated at every completed prior epoch.
Source5 members
Complete held-out prior diagnostics.
Source3 members
One true-boundary next-token window used to train the ALM prior.
Source4 members
Native .oam persistence policy for one ALM training stage.
Source4 members
Complete optimizer and iteration policy for train_tokenizer.
Source3 members
Final evidence from one ALM tokenizer training run.
Source1 members
Borrowed held-out split evaluated at every completed tokenizer epoch.
Source5 members
Complete held-out tokenizer diagnostics.
SourceFunctions
Fraction of correct predictions over [N, classes] logits and [N] U32/I32 targets. Errors Returns an error from the underlying accuracy operation or readback.
TF-tutorial-mirrored command classifier. Conv2d(1→8, 3×3) → ReLU → MaxPool → Conv2d(8→16, 3×3) → ReLU → MaxPool → Flatten → Linear(→64) → ReLU → Dropout(0.25) → Linear(→classes), returned as a Sequential so parameter registration and train/eval propagation are uniform with every other nn workload. mel_bands/mel_frames are the unpooled feature extents; two stride-2 pools quarter each spatial axis before the flatten. Errors Returns an error when dimensions are zero or a layer fails to build.
Construct the commands CNN on an explicit engine. Errors Returns an error when dimensions are zero or a layer fails to build.
Mean and reciprocal standard deviation over a host feature batch. Returns (mean, 1/(std + 1e-6)); callers apply the pair to both training and evaluation features — the host-side equivalent of the TF tutorial’s Normalization layer.
Apply (v - mean) * inv_std to every feature in place.
Types
2 members
One decoded clip: mono FP32 samples padded or trimmed to SAMPLES_PER_CLIP, plus its command class index.
Source6 members
Ordered speech-commands dataset backed by <dir>/<label>/*.wav files.
Load and decode every clip under <dir>/<label>/. Clips are sorted per label for deterministic ordering, decoded to mono, resampled to CLIP_SAMPLE_RATE when needed, and zero-padded or trimmed to SAMPLES_PER_CLIP. Errors Returns an error when a label directory is missing, a clip fails to decode, or the dataset is empty.
Load and decode every clip under <dir>/<label>/. Clips are sorted per label for deterministic ordering, decoded to mono, resampled to CLIP_SAMPLE_RATE when needed, and zero-padded or trimmed to SAMPLES_PER_CLIP. Errors Returns an error when a label directory is missing, a clip fails to decode, or the dataset is empty.
Load and decode every clip under <dir>/<label>/. Clips are sorted per label for deterministic ordering, decoded to mono, resampled to CLIP_SAMPLE_RATE when needed, and zero-padded or trimmed to SAMPLES_PER_CLIP. Errors Returns an error when a label directory is missing, a clip fails to decode, or the dataset is empty.
Constants & Variables
pub const BATCH_SIZE: usize = 8;Source pub const CLIP_SAMPLE_RATE: u32 = 16_000;Source pub const COMMANDS_FINAL_LOSS: f32 = 0.622_496;Source pub const COMMANDS_TEST_ACCURACY: f32 = 0.0;Source pub const COMMAND_LABELS: [&str; 8];Source pub const MEL_BANDS: u32 = 40;Source pub const MEL_CHUNK_CLIPS: usize = 512;Source pub const MEL_FFT_SIZE: u32 = 1_024;Source pub const MEL_HOP_SIZE: u32 = 256;Source pub const RNG_SEED: u64 = 20_260_818;Source pub const SAMPLES_PER_CLIP: usize = 16_000;Source pub const TRAINING_EPOCHS: usize = 10;Source Functions
Compute all-position argmax accuracy as a fraction in [0, 1]. This is an explicit host-observation boundary. Errors Returns an error unless logits are F32 [N, C], targets contain N U32 values, or readback fails.
Decode canonical character tokens.
Decode one canonical character token. Invalid values decode to space.
Encode text into canonical character tokens.
Encode one character using the canonical a-z plus space vocabulary.
Greedily generate BPE tokens until byte_count decoded source bytes. The decoded result is truncated to prompt.len() + byte_count, matching the donor when the last learned token crosses the requested byte boundary. Errors Returns an error for an empty prompt, invalid model output/token IDs, byte accounting overflow, or failed execution/readback.
Greedily generate exact bytes with the canonical left-filled/sliding window. Errors Returns an error for an empty prompt, invalid model output, or failed execution/readback.
Greedily generate characters with the canonical left-filled/sliding window. Errors Returns an error for an empty prompt, when model execution/readback fails, or if the model violates its declared output shape.
Types
18 members
Canonical BPE language model: Embedding → GRU → Linear.
18 members
Canonical BPE Mamba-3 language model with a flat residual head.
18 members
Canonical BPE Transformer with four sparse top-two experts.
18 members
Canonical BPE language model: Embedding → Elman RNN → Linear.
7 members
Deterministic dense all-position sampler over canonical BPE tokens.
18 members
Canonical BPE Transformer language model over the shared NN owner.
18 members
Canonical byte language model using the hybrid Empyrealm ownership tree.
18 members
Canonical byte language model: ByteEmbedding → GRU → ByteHead.
18 members
Canonical raw-byte Mamba-3 language model with a flat residual head.
18 members
Canonical byte Transformer with four sparse top-two experts.
18 members
Canonical byte language model: ByteEmbedding → Elman RNN → ByteHead.
4 members
18 members
Canonical byte Transformer language model over the shared NN owner.
18 members
Canonical character language model: Embedding → GRU → Linear.
19 members
Canonical character Mamba-3 language model with a flat residual head.
19 members
Canonical character Transformer with four sparse top-two experts.
18 members
Canonical character language model: Embedding → Elman RNN → Linear.
4 members
18 members
Canonical 10,875-parameter character Transformer language model.
Constants & Variables
pub const BATCH_SIZE: usize = 64;Source pub const BPE_GRU_ACCURACY: f32 = 0.988_281;Source pub const BPE_GRU_FINAL_LOSS: f32 = 0.021_224;Source pub const BPE_GRU_REFERENCE_GENERATION: &[u8] = b"to bee arms against a sea of troubles and by opposing end them to be or not to be tha";Source pub const BPE_MAMBA3_ACCURACY: f32 = 0.989_258;Source pub const BPE_MAMBA3_FINAL_LOSS: f32 = 0.019_415;Source pub const BPE_MAMBA3_REFERENCE_GENERATION: &[u8] = b"to beion wher tis nobler in the mind to suffer the slings and arrows of outrageous fo";Source pub const BPE_MERGES: usize = _; // 64usizeSource pub const BPE_MOE_ACCURACY: f32 = 0.988_281;Source pub const BPE_MOE_FINAL_LOSS: f32 = 0.019_962;Source pub const BPE_MOE_REFERENCE_GENERATION: &[u8] = b"to bee or not to be that is the question whether tis nobler in the mind to suffer the";Source pub const BPE_RNN_ACCURACY: f32 = 0.988_281;Source pub const BPE_RNN_FINAL_LOSS: f32 = 0.020_861;Source pub const BPE_RNN_REFERENCE_GENERATION: &[u8] = b"to be not to be that is the question whether tis nobler in the mind to suffer the sli";Source pub const BPE_TRANSFORMER_ACCURACY: f32 = 0.989_258;Source pub const BPE_TRANSFORMER_FINAL_LOSS: f32 = 0.020_028;Source pub const BPE_TRANSFORMER_REFERENCE_GENERATION: &[u8] = b"to be end them to be or not to be that is the question whether tis nobler in the mind";Source pub const BPE_VOCAB_SIZE: usize = 320;Source pub const BYTE_EMPYREALM_ACCURACY: f32 = 0.929_688;Source pub const BYTE_EMPYREALM_FINAL_LOSS: f32 = 0.179_619;Source pub const BYTE_EMPYREALM_REFERENCE_GENERATION: &[u8] = b"to be that is the question whether tis nobler in the mind to suffer the slings and ar";Source pub const BYTE_GRU_ACCURACY: f32 = 0.926_758;Source pub const BYTE_GRU_FINAL_LOSS: f32 = 0.176_505;Source pub const BYTE_GRU_REFERENCE_GENERATION: &[u8] = b"to be that is the question whether tis nobler in the mind to suffer the slings and ar";Source pub const BYTE_MAMBA3_ACCURACY: f32 = 0.929_688;Source pub const BYTE_MAMBA3_FINAL_LOSS: f32 = 0.207_903;Source pub const BYTE_MAMBA3_REFERENCE_GENERATION: &[u8] = b"to be that is the question whether tis nobler in the mind to suffer the slings and ar";Source pub const BYTE_MOE_ACCURACY: f32 = 0.925_781;Source pub const BYTE_MOE_FINAL_LOSS: f32 = 0.193_275;Source pub const BYTE_MOE_FINAL_LOSS_TOLERANCE: f32 = 0.005;Source pub const BYTE_MOE_REFERENCE_GENERATION: &[u8] = b"to be that is the question whether tis nobler in the mind to suffer the slings and ar";Source pub const BYTE_RNN_ACCURACY: f32 = 0.921_875;Source pub const BYTE_RNN_FINAL_LOSS: f32 = 0.186_080;Source pub const BYTE_RNN_REFERENCE_GENERATION: &[u8] = b"to be that is the question whether tis nobler in the mind to suffer the slings and ar";Source pub const BYTE_TRANSFORMER_ACCURACY: f32 = 0.928_711;Source pub const BYTE_TRANSFORMER_FINAL_LOSS: f32 = 0.190_565;Source pub const BYTE_TRANSFORMER_REFERENCE_GENERATION: &[u8] = b"to be that is the question whether tis nobler in the mind to suffer the slings and ar";Source pub const CHAR_GRU_ACCURACY: f32 = 0.927_734;Source pub const CHAR_GRU_FINAL_LOSS: f32 = 0.179_721;Source pub const CHAR_GRU_REFERENCE_GENERATION: &str = "to be or not to be that is the question whether tis nobler in the mind to suffer the ";Source pub const CHAR_MAMBA3_ACCURACY: f32 = 0.929_688;Source pub const CHAR_MAMBA3_FINAL_LOSS: f32 = 0.190_578;Source pub const CHAR_MAMBA3_REFERENCE_GENERATION: &str = "to be that is the question whether tis nobler in the mind to suffer the slings and ar";Source pub const CHAR_MOE_TRANSFORMER_CPP_ACCURACY: f32 = 0.932;Source pub const CHAR_MOE_TRANSFORMER_CPP_FINAL_LOSS: f32 = 0.190_7;Source pub const CHAR_MOE_TRANSFORMER_REFERENCE_GENERATION: &str = "to be that is the question whether tis nobler in the mind to suffer the slings and ar";Source pub const CHAR_RNN_REFERENCE_GENERATION: &str = "to be that is the question whether tis nobler in the mind to suffer the slings and ar";Source pub const CHAR_TRANSFORMER_CPP_ACCURACY: f32 = 0.927;Source pub const CHAR_TRANSFORMER_CPP_FINAL_LOSS: f32 = 0.190_238;Source pub const CHAR_TRANSFORMER_REFERENCE_GENERATION: &str = "to be or not to be that is the question whether tis nobler in the mind to suffer the ";Source pub const CHAR_VOCAB_SIZE: usize = 27;Source pub const CONTEXT_LENGTH: usize = 16;Source pub const CORPUS: &str = "to be or not to be that is the question whether tis nobler in the mind to suffer the slings and arrows of outrageous fortune or to take arms against a sea of troubles and by opposing end them to be or not to be that is the question whether tis nobler in the mind to suffer the slings and arrows of outrageous fortune or to take arms against a sea of troubles and by opposing end them to be or not to be that is the question whether tis nobler in the mind to suffer the slings and arrows of outrageous fortune or to take arms against a sea of troubles and by opposing end them ";Source pub const GENERATION_LENGTH: usize = 80;Source pub const GENERATION_PROMPT: &str = "to be";Source pub const HIDDEN_WIDTH: usize = 64;Source pub const MODEL_WIDTH: usize = 32;Source pub const MOE_EXPERTS_PER_TOKEN: usize = 2;Source pub const MOE_EXPERT_HIDDEN_WIDTH: usize = 16;Source pub const MOE_NUM_EXPERTS: usize = 4;Source pub const RNG_SEED: u64 = 20_260_714;Source pub const TRAINING_STEPS: usize = 300;Source Functions
Record, submit, and wait for one complete Lunar PPO rollout. Errors Returns an error from environment reset/recording/submission or PPO collection. A rejected recording rewinds both owners transactionally.
Evaluate episode zero of a fresh flat vector environment with greedy TopK. Completed lanes are not reset. Bounded rollout chunks retain action, value, reward, and boundary history without a per-step host synchronization. Errors Returns an error for invalid dimensions, ownership/model/environment/runtime failure, malformed device results, or inconsistent final telemetry.
Pretrain only the categorical policy tower from the scripted scalar oracle. The temporary optimizer has independent moment state. A caller-created PPO optimizer therefore remains at step zero for a clean critic warm-up. Errors Returns an error for an invalid curriculum, teacher/evaluator seed overlap, scalar simulation failure, upload/model/loss/autograd failure, or incomplete optimizer accounting.
Types
33 members
5 members
Versioned dynamics and vector-lane policy for CartPole-v1.
Source5 members
Bounded contact-solver evidence for one policy step.
Source21 members
4 members
Complete first-episode Lunar policy evidence.
Source6 members
4 members
Compact synchronized host telemetry for one vector lane.
Source5 members
34 members
4 members
Vector-lane count, reset seed, and versioned environment behavior.
Source4 members
Result and actuator accounting from one scalar integration step.
Source6 members
Decomposed reward evidence for one completed environment transition.
Source14 members
4 members
Deterministic flat-terrain scripted-teacher curriculum.
Source4 members
Completed scripted-teacher dataset and optimization evidence.
Source16 members
Immutable checked Lunar Lander height field.
Source5 members
Checked rectangular terrain-generation contract.
Source4 members
Exact height and normal returned for one terrain coordinate.
Source4 members
One scalar environment transition and its diagnostic evidence.
SourceEnums
Discrete control selected for one simulation step.
Coast = 0 · MainEngine = 1 · PitchPositive = 2 · PitchNegative = 3 · RollPositive = 4 · RollNegative = 5 · YawPositive = 6 · YawNegative = 7
Terminal or truncation cause for one episode.
None = 0 · SafeLanding = 1 · BodyImpact = 2 · HardFootImpact = 3 · OutOfBounds = 4 · NumericalFailure = 5 · TimeLimit = 6 · ExternalStop = 7 · InvalidAction = 8
Independent deterministic random domain within one episode.
Terrain = 6_072_350_185_815_100_977 · Spawn = 6_003_370_146_514_612_273 · Domain = 4_922_237_860_537_315_377
Constants & Variables
pub const LUNAR_ENVIRONMENT_VERSION: u32 = 1;Source pub const LUNAR_OBSERVATION_SIZE: usize = 33;Source pub const LUNAR_OBSERVATION_VERSION: u32 = 1;Source pub const LUNAR_PHYSICS_VERSION: u32 = 1;Source pub const LUNAR_RANDOM_VERSION: u32 = 1;Source pub const LUNAR_REWARD_VERSION: u32 = 1;Source pub const LUNAR_TERRAIN_VERSION: u32 = 1;Source Functions
Record, submit, and wait for one complete Lunar PPO rollout. Errors Returns an error from environment reset/recording/submission or PPO collection. A rejected recording rewinds both owners transactionally.
Evaluate episode zero of a fresh flat vector environment with greedy TopK. Completed lanes are not reset. Bounded rollout chunks retain action, value, reward, and boundary history without a per-step host synchronization. Errors Returns an error for invalid dimensions, ownership/model/environment/runtime failure, malformed device results, or inconsistent final telemetry.
Advance one scalar state with the donor’s fixed-order semi-implicit solver. Errors Returns an error for invalid configuration, mismatched terrain, invalid input state, or non-finite integration/contact output. The state may have been partially advanced when a numerical output failure is reported.
Produce the frozen 33-value normalized observation layout.
Return the bounded donor potential used by reward shaping.
Pretrain only the categorical policy tower from the scripted scalar oracle. The temporary optimizer has independent moment state. A caller-created PPO optimizer therefore remains at step zero for a clean critic warm-up. Errors Returns an error for an invalid curriculum, teacher/evaluator seed overlap, scalar simulation failure, upload/model/loss/autograd failure, or incomplete optimizer accounting.
Deterministic scalar controller used by the donor solvability oracle.
Return a support’s world-space center.
Types
5 members
Bounded contact-solver evidence for one policy step.
Source21 members
4 members
Complete first-episode Lunar policy evidence.
Source6 members
4 members
Compact synchronized host telemetry for one vector lane.
Source5 members
34 members
4 members
Vector-lane count, reset seed, and versioned environment behavior.
Source4 members
Result and actuator accounting from one scalar integration step.
Source6 members
Decomposed reward evidence for one completed environment transition.
Source14 members
4 members
Deterministic flat-terrain scripted-teacher curriculum.
Source4 members
Completed scripted-teacher dataset and optimization evidence.
Source16 members
Immutable checked Lunar Lander height field.
Source5 members
Checked rectangular terrain-generation contract.
Source4 members
Exact height and normal returned for one terrain coordinate.
Source4 members
One scalar environment transition and its diagnostic evidence.
SourceEnums
Discrete control selected for one simulation step.
Coast = 0 · MainEngine = 1 · PitchPositive = 2 · PitchNegative = 3 · RollPositive = 4 · RollNegative = 5 · YawPositive = 6 · YawNegative = 7
Terminal or truncation cause for one episode.
None = 0 · SafeLanding = 1 · BodyImpact = 2 · HardFootImpact = 3 · OutOfBounds = 4 · NumericalFailure = 5 · TimeLimit = 6 · ExternalStop = 7 · InvalidAction = 8
Independent deterministic random domain within one episode.
Terrain = 6_072_350_185_815_100_977 · Spawn = 6_003_370_146_514_612_273 · Domain = 4_922_237_860_537_315_377
Constants & Variables
pub const LUNAR_ENVIRONMENT_VERSION: u32 = 1;Source pub const LUNAR_OBSERVATION_SIZE: usize = 33;Source pub const LUNAR_OBSERVATION_VERSION: u32 = 1;Source pub const LUNAR_PHYSICS_VERSION: u32 = 1;Source pub const LUNAR_RANDOM_VERSION: u32 = 1;Source pub const LUNAR_REWARD_VERSION: u32 = 1;Source pub const LUNAR_TERRAIN_VERSION: u32 = 1;Source pub const LUNAR_VECTOR_CONFIG_LAYOUT_VERSION: u32 = 1;Source pub const LUNAR_VECTOR_STATE_LAYOUT_VERSION: u32 = 1;Source