architecture/network/slab

Slab Packing / Structure‑of‑Arrays Backend (Educational Module)

Packs per‑connection data into parallel typed arrays (SoA) to accelerate forward passes and to illustrate memory/layout optimizations.

Why SoA?

Key Arrays (logical length = used): weights | from | to | flags | (optional) gain | (optional) plastic. Adjacency (CSR style): outStart (nodeCount+1), outOrder (per‑source permutation) enabling fast fan‑out.

On‑Demand & Omission:

Capacity Strategy: geometric growth (1.25x browser / 1.75x Node) amortizes realloc cost. Pooling (config gated) reuses typed arrays (see getSlabAllocationStats).

Rebuild Steps (sync): reindex nodes → grow/allocate if needed → single pass populate → optional slabs → version++. Async variant slices the population loop into microtasks to reduce long main‑thread blocks.

Example (inspection):

const slab = net.getConnectionSlab();
console.log('Edges', slab.used, 'Version', slab.version, 'Cap', slab.capacity);
console.log('First weight from->to', slab.weights[0], slab.from[0], slab.to[0]);

architecture/network/slab/network.slab.utils.types.ts

BuildAdjacencyContext

Shared immutable inputs used across the adjacency build pipeline.

ConnectionInternals

Internal Connection properties accessed during slab operations.

ConnectionSlabView

Shape returned by getConnectionSlab describing the packed SoA view.

FanOutCollectionContext

Context for fan-out collection: build inputs plus the output count buffer.

FastSlabNodeRuntime

Node shape required by fast slab activation kernels.

NetworkActivationRuntime

Runtime activation contract used by slab-based execution paths.

NetworkSlabProps

Internal Network properties for slab operations.

NetworkTopoRuntime

Runtime topology contract used to lazily rebuild topological order.

OutgoingOrderBuildContext

Context for constructing source-grouped outgoing connection order.

PoolKeyMetrics

Per-pool-key allocation & reuse counters (educational / diagnostics).

PublishAdjacencyContext

Context for publishing fully built adjacency slabs to internal network state.

SLAB_DEFAULT_ASYNC_CHUNK_SIZE

Default async slab rebuild chunk size when no override is provided.

SLAB_GROWTH_FACTOR_BROWSER

Capacity growth factor for browser slab allocations.

SLAB_GROWTH_FACTOR_NODE

Capacity growth factor for Node.js slab allocations.

SLAB_ONE

Numeric one sentinel used for neutral gain defaults and index math.

SLAB_ZERO

Numeric zero sentinel used across slab orchestration and helper pipelines.

SlabBuildContext

Immutable inputs required to build or grow connection slab buffers.

SlabPopulateResult

Result of scanning and populating optional gain/plastic slab arrays.

SlabWriteArrays

Writable slab arrays targeted during connection serialization.

StartIndicesBuildContext

Context for constructing CSR start offsets from precomputed fan-out counts.

TypedArray

Union of slab typed array element container types.

TypedArrayConstructor

Constructor type for typed arrays used in slabs.

architecture/network/slab/network.slab.utils.ts

canUseFastSlab

canUseFastSlab(
  training: boolean,
): boolean

Public convenience wrapper exposing fast path eligibility. Mirrors _canUseFastSlab internal predicate.

Parameters:

Returns: True when slab fast path predicates hold.

ConnectionSlabView

Shape returned by getConnectionSlab describing the packed SoA view.

fastSlabActivate

fastSlabActivate(
  input: number[],
): number[]

High‑performance forward pass using packed slabs + CSR adjacency.

Fallback Conditions (auto‑detected):

Implementation Notes:

Parameters:

Returns: Output activations (detached plain array) of length network.output.

getConnectionSlab

getConnectionSlab(): ConnectionSlabView

Obtain (and lazily rebuild if dirty) the current packed SoA view of connections.

Gain Omission: If the internal gain slab is absent (all gains neutral) a synthetic neutral array is created and returned (NOT retained) to keep external educational tooling branch‑free while preserving omission memory savings internally.

Returns: Read‑only style view (do not mutate) containing typed arrays + metadata.

getSlabAllocationStats

getSlabAllocationStats(): { pool: { [x: string]: PoolKeyMetrics; }; fresh: number; pooled: number; }

Allocation statistics snapshot for slab typed arrays.

Includes:

NOTE: Stats are cumulative (not auto‑reset); callers may diff successive snapshots.

Returns: Plain object copy (safe to serialize) of current allocator counters.

getSlabVersion

getSlabVersion(): number

Retrieve current monotonic slab version (increments on each successful rebuild).

Returns: Non‑negative integer (0 if slab never built yet).

rebuildConnectionSlab

rebuildConnectionSlab(
  force: boolean,
): void

Build (or refresh) the packed connection slabs for the network synchronously.

ACTIONS

  1. Optionally reindex nodes if structural mutations invalidated indices.
  2. Grow (geometric) or reuse existing typed arrays to ensure capacity >= active connections.
  3. Populate the logical slice [0, connectionCount) with weight/from/to/flag data.
  4. Lazily allocate gain & plastic slabs only on first non‑neutral / plastic encounter; omit otherwise.
  5. Release previously allocated optional slabs when they revert to neutral / unused (omission optimization).
  6. Update internal bookkeeping: logical count, dirty flags, version counter.

PERFORMANCE

O(C) over active connections with amortized allocation cost due to geometric growth.

Parameters:

rebuildConnectionSlabAsync

rebuildConnectionSlabAsync(
  chunkSize: number,
): Promise<void>

Cooperative asynchronous slab rebuild (Browser only).

Strategy:

Metrics: Increments _slabAsyncBuilds for observability. Fallback: On Node (no window) defers to synchronous rebuild for simplicity.

Parameters:

Returns: Promise resolving once rebuild completes.

architecture/network/slab/network.slab.pool.utils.ts

Internal slab pool/stat helpers extracted from network.slab.utils.ts.

_acquireTA

_acquireTA(
  kind: string,
  ctor: TypedArrayConstructor,
  length: number,
  bytesPerElement: number,
): TypedArray

Acquires a typed array from pool or allocates a fresh one.

Parameters:

Returns: Acquired typed array.

_getSlabAllocationStatsSnapshot

_getSlabAllocationStatsSnapshot(): { pool: { [x: string]: PoolKeyMetrics; }; fresh: number; pooled: number; }

Returns allocation stats snapshot for slab typed arrays.

Returns: Serializable snapshot of fresh, pooled, and per-key metrics.

_poolKey

_poolKey(
  kind: string,
  bytes: number,
  length: number,
): string

Creates a stable pool key from kind, element width, and length.

Parameters:

Returns: Stable pool key.

_releaseTA

_releaseTA(
  kind: string,
  bytesPerElement: number,
  arr: TypedArray,
): void

Releases a typed array back to bounded per-key pool.

Parameters:

Returns: Nothing.

_slabPoolCap

_slabPoolCap(): number

Computes retention cap per key.

Returns: Non-negative max retained arrays per key.

architecture/network/slab/network.slab.view.utils.ts

_createConnectionSlabView

_createConnectionSlabView(
  network: default,
): ConnectionSlabView

Creates a read-oriented packed slab view from current network internals.

Parameters:

Returns: Packed connection slab view.

_readSlabVersion

_readSlabVersion(
  network: default,
): number

Reads the current monotonic slab version from network internals.

Parameters:

Returns: Non-negative slab version counter.

_resolveConnectionGainView

_resolveConnectionGainView(
  internalNet: NetworkSlabProps,
  capacity: number,
): Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike> | null

Resolves gain slab view, synthesizing neutral gain values when omitted.

Parameters:

Returns: Gain array view.

_resolveConnectionSlabCapacity

_resolveConnectionSlabCapacity(
  internalNet: NetworkSlabProps,
): number

Resolves effective slab capacity using explicit capacity first.

Parameters:

Returns: Effective capacity value.

architecture/network/slab/network.slab.setup.utils.ts

_prepareSlabBuildPreconditions

_prepareSlabBuildPreconditions(
  buildContext: SlabBuildContext,
): void

Applies prerequisite normalization for slab rebuild passes.

Parameters:

Returns: Nothing.

architecture/network/slab/network.slab.activate.utils.ts

_activateFastSlab

_activateFastSlab(
  network: default,
  input: number[],
): number[]

Executes fast slab activation once slab and adjacency prerequisites are prepared.

Parameters:

Returns: Output activation array.

architecture/network/slab/network.slab.shared.helpers.utils.ts

_reindexNodes

_reindexNodes(
  network: default,
): void

Assigns sequential node indices used by slab packing and fast-path traversal.

Parameters:

Returns: Nothing.

architecture/network/slab/network.slab.rebuild.helpers.utils.ts

Internal slab rebuild helper functions extracted from network.slab.utils.ts.

_allocateCoreSlabArrays

_allocateCoreSlabArrays(
  buildContext: SlabBuildContext,
): void

Allocates core slab arrays (weights/from/to/flags).

Parameters:

Returns: Nothing.

_allocateGainSlabForAsync

_allocateGainSlabForAsync(
  buildContext: SlabBuildContext,
): void

Allocates gain slab for async pass prefill strategy.

Parameters:

Returns: Nothing.

_applyGainOmissionPolicy

_applyGainOmissionPolicy(
  buildContext: SlabBuildContext,
  populateResult: SlabPopulateResult,
): void

Applies gain omission rule by releasing neutral gain slab.

Parameters:

Returns: Nothing.

_applyPlasticPolicyAsync

_applyPlasticPolicyAsync(
  buildContext: SlabBuildContext,
  populateResult: SlabPopulateResult,
): void

Applies async plastic slab allocation/release policy.

Parameters:

Returns: Nothing.

_applyPlasticPolicySync

_applyPlasticPolicySync(
  buildContext: SlabBuildContext,
  populateResult: SlabPopulateResult,
): void

Applies sync plastic slab allocation/release policy.

Parameters:

Returns: Nothing.

_createInitialSlabPopulateResult

_createInitialSlabPopulateResult(
  internalNet: NetworkSlabProps,
): SlabPopulateResult

Creates initial populate result from current optional slab state.

Parameters:

Returns: Initial populate result.

_createSlabBuildContext

_createSlabBuildContext(
  network: default,
  growthFactor: number,
): SlabBuildContext

Creates immutable slab build context for one rebuild pass.

Parameters:

Returns: Build context.

_createSlabWriteArrays

_createSlabWriteArrays(
  buildContext: SlabBuildContext,
): SlabWriteArrays

Creates strongly typed write-array bundle for connection population.

Parameters:

Returns: Write-array bundle.

_ensureGainArrayExistsForIndex

_ensureGainArrayExistsForIndex(
  buildContext: SlabBuildContext,
  populateResult: SlabPopulateResult,
  connectionIndex: number,
): void

Ensures gain slab exists before writing non-neutral value.

Parameters:

Returns: Nothing.

_ensureSlabCapacityAsync

_ensureSlabCapacityAsync(
  buildContext: SlabBuildContext,
): void

Ensures async rebuild has enough slab capacity.

Parameters:

Returns: Nothing.

_ensureSlabCapacitySync

_ensureSlabCapacitySync(
  buildContext: SlabBuildContext,
): void

Ensures sync rebuild has enough slab capacity.

Parameters:

Returns: Nothing.

_expandSlabCapacity

_expandSlabCapacity(
  currentCapacity: number,
  requiredCapacity: number,
  growthFactor: number,
): number

Computes next capacity satisfying required size using geometric growth.

Parameters:

Returns: Expanded capacity.

_fillPlasticityRates

_fillPlasticityRates(
  network: default,
  plasticArray: Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike>,
  connectionCount: number,
): void

Fills plastic slab values from connection plasticity rates.

Parameters:

Returns: Nothing.

_finalizeAsyncSlabRebuild

_finalizeAsyncSlabRebuild(
  buildContext: SlabBuildContext,
): void

Finalizes async rebuild bookkeeping fields.

Parameters:

Returns: Nothing.

_finalizeSharedSlabState

_finalizeSharedSlabState(
  internalNet: NetworkSlabProps,
  connectionCount: number,
): void

Finalizes shared rebuild bookkeeping fields.

Parameters:

Returns: Nothing.

_finalizeSyncSlabRebuild

_finalizeSyncSlabRebuild(
  buildContext: SlabBuildContext,
): void

Finalizes sync rebuild bookkeeping fields.

Parameters:

Returns: Nothing.

_populateAsyncChunkRange

_populateAsyncChunkRange(
  buildContext: SlabBuildContext,
  writeArrays: SlabWriteArrays,
  populateResult: SlabPopulateResult,
  startIndex: number,
  endIndex: number,
): void

Populates one inclusive-exclusive chunk range for async rebuild.

Parameters:

Returns: Nothing.

_populateSlabConnectionsAsync

_populateSlabConnectionsAsync(
  buildContext: SlabBuildContext,
  chunkSize: number,
): Promise<SlabPopulateResult>

Populates core slab arrays in cooperative async chunks.

Parameters:

Returns: Population result flags and optional slabs.

_populateSlabConnectionsSync

_populateSlabConnectionsSync(
  buildContext: SlabBuildContext,
): SlabPopulateResult

Populates core slab arrays in synchronous single pass.

Parameters:

Returns: Population result flags and optional slabs.

_releaseExistingSlabArrays

_releaseExistingSlabArrays(
  buildContext: SlabBuildContext,
): void

Releases all currently allocated slab arrays back to pool.

Parameters:

Returns: Nothing.

_resetOptionalSlabArraysAfterSyncAllocate

_resetOptionalSlabArraysAfterSyncAllocate(
  internalNet: NetworkSlabProps,
): void

Resets optional slabs after sync allocation to keep omission semantics.

Parameters:

Returns: Nothing.

_resolveAsyncChunkSize

_resolveAsyncChunkSize(
  totalConnections: number,
  requestedChunkSize: number,
): number

Resolves effective async chunk size using adaptive heuristics.

Parameters:

Returns: Effective chunk size.

_shouldSkipSlabRebuild

_shouldSkipSlabRebuild(
  internalNet: NetworkSlabProps,
  force: boolean,
): boolean

Determines whether slab rebuild can be skipped.

Parameters:

Returns: True when rebuild can be skipped.

_updatePlasticPresence

_updatePlasticPresence(
  populateResult: SlabPopulateResult,
  connection: ConnectionInternals,
): void

Updates plastic-presence flag from connection bitfield.

Parameters:

Returns: Nothing.

_weightArrayCtor

_weightArrayCtor(
  useFloat32Weights: boolean | undefined,
): Float32ArrayConstructor | Float64ArrayConstructor

Resolves typed-array constructor for weight slabs.

Parameters:

Returns: Matching typed-array constructor.

_weightByteWidth

_weightByteWidth(
  useFloat32Weights: boolean | undefined,
): number

Resolves byte width for weight slab arrays.

Parameters:

Returns: Byte width for weight elements.

_writeConnectionCoreFields

_writeConnectionCoreFields(
  writeArrays: SlabWriteArrays,
  connection: ConnectionInternals,
  connectionIndex: number,
): void

Writes core fields for one connection into slab arrays.

Parameters:

Returns: Nothing.

_writeConnectionGainField

_writeConnectionGainField(
  buildContext: SlabBuildContext,
  populateResult: SlabPopulateResult,
  connection: ConnectionInternals,
  connectionIndex: number,
): void

Writes gain field for one connection and updates gain flags.

Parameters:

Returns: Nothing.

architecture/network/slab/network.slab.adjacency.helpers.utils.ts

Internal slab adjacency helpers extracted from network.slab.utils.ts.

_buildAdjacency

_buildAdjacency(
  network: default,
): void

Build or refresh CSR-style adjacency (outStart + outOrder) for fast fan-out traversal.

Parameters:

Returns: Nothing.

asNetworkSlabProps

asNetworkSlabProps(
  network: default,
): NetworkSlabProps

Cast network instance into internal slab-backed shape.

Parameters:

Returns: Internal slab-backed network representation.

buildOutgoingOrder

buildOutgoingOrder(
  outgoingOrderBuildContext: OutgoingOrderBuildContext,
): Uint32Array<ArrayBufferLike>

Build source-grouped outgoing order using CSR start offsets.

Parameters:

Returns: Ordered outgoing connection indices.

buildOutgoingStartIndices

buildOutgoingStartIndices(
  startIndicesBuildContext: StartIndicesBuildContext,
): Uint32Array<ArrayBufferLike>

Build CSR start offsets from fan-out counts.

Parameters:

Returns: Outgoing start indices slab.

collectFanOutCounts

collectFanOutCounts(
  buildContext: BuildAdjacencyContext,
): Uint32Array<ArrayBufferLike>

Collect fan-out counts for each source node.

Parameters:

Returns: Fan-out counts per node.

createBuildAdjacencyContext

createBuildAdjacencyContext(
  network: default,
): BuildAdjacencyContext | null

Build adjacency context when required slabs are available.

Parameters:

Returns: Build context or null when adjacency cannot be built yet.

createFanOutCollectionContext

createFanOutCollectionContext(
  buildContext: BuildAdjacencyContext,
): FanOutCollectionContext

Build fan-out collection context.

Parameters:

Returns: Fan-out collection context.

createFanOutCountsBuffer

createFanOutCountsBuffer(
  nodeCount: number,
): Uint32Array<ArrayBufferLike>

Allocate fan-out counts buffer.

Parameters:

Returns: Zero-initialized fan-out counts.

createInsertionCursor

createInsertionCursor(
  outgoingStartIndices: Uint32Array<ArrayBufferLike>,
): Uint32Array<ArrayBufferLike>

Create insertion cursor copy from outgoing start indices.

Parameters:

Returns: Mutable insertion cursor.

createOutgoingOrderBuffer

createOutgoingOrderBuffer(
  connectionCount: number,
): Uint32Array<ArrayBufferLike>

Allocate outgoing order buffer.

Parameters:

Returns: Outgoing order buffer.

createOutgoingStartIndicesBuffer

createOutgoingStartIndicesBuffer(
  nodeCount: number,
): Uint32Array<ArrayBufferLike>

Allocate outgoing start indices buffer with terminal slot.

Parameters:

Returns: Outgoing start indices buffer.

hasRequiredConnectionSlabs

hasRequiredConnectionSlabs(
  internalNet: NetworkSlabProps,
): boolean

Check whether required connection slabs exist.

Parameters:

Returns: True when adjacency build prerequisites are present.

incrementFanOutCountAtSource

incrementFanOutCountAtSource(
  context: { fanOutCounts: Uint32Array<ArrayBufferLike>; connectionFromSlab: Uint32Array<ArrayBufferLike>; connectionIndex: number; },
): void

Increment fan-out count for one connection source index.

Parameters:

Returns: Nothing.

insertConnectionIntoOutgoingOrder

insertConnectionIntoOutgoingOrder(
  context: { connectionIndex: number; connectionFromSlab: Uint32Array<ArrayBufferLike>; outgoingOrder: Uint32Array<ArrayBufferLike>; insertionCursor: Uint32Array<ArrayBufferLike>; },
): void

Insert one connection index into the proper source-grouped slot.

Parameters:

Returns: Nothing.

iterateConnectionIndices

iterateConnectionIndices(
  connectionCount: number,
  visitor: (connectionIndex: number) => void,
): void

Iterate all connection indices.

Parameters:

Returns: Nothing.

iterateNodeIndices

iterateNodeIndices(
  nodeCount: number,
  visitor: (nodeIndex: number) => void,
): void

Iterate all node indices.

Parameters:

Returns: Nothing.

populateFanOutCounts

populateFanOutCounts(
  fanOutCollectionContext: FanOutCollectionContext,
): void

Populate fan-out counts from the connection source slab.

Parameters:

Returns: Nothing.

populateOutgoingOrder

populateOutgoingOrder(
  context: { connectionCount: number; connectionFromSlab: Uint32Array<ArrayBufferLike>; outgoingOrder: Uint32Array<ArrayBufferLike>; insertionCursor: Uint32Array<ArrayBufferLike>; },
): void

Populate outgoing order by source-grouped insertion.

Parameters:

Returns: Nothing.

populateOutgoingStartIndices

populateOutgoingStartIndices(
  context: { fanOutCounts: Uint32Array<ArrayBufferLike>; outgoingStartIndices: Uint32Array<ArrayBufferLike>; },
): number

Populate outgoing start indices and return terminal offset.

Parameters:

Returns: Terminal running offset after the last node.

publishAdjacency

publishAdjacency(
  publishAdjacencyContext: PublishAdjacencyContext,
): void

Publish adjacency slabs and clear dirty flag.

Parameters:

Returns: Nothing.

setTerminalOutgoingStartOffset

setTerminalOutgoingStartOffset(
  context: { nodeCount: number; outgoingStartIndices: Uint32Array<ArrayBufferLike>; terminalRunningOffset: number; },
): void

Set terminal outgoing start offset at the tail slot.

Parameters:

Returns: Nothing.

architecture/network/slab/network.slab.fast-path.helpers.utils.ts

Internal fast slab activation helpers extracted from network.slab.utils.ts.

_activateThroughLegacyPath

_activateThroughLegacyPath(
  network: default,
  input: number[],
): number[]

Executes legacy network activation fallback.

Parameters:

Returns: Legacy activation output.

_canUseFastSlab

_canUseFastSlab(
  training: boolean,
): boolean

Predicate gating usage of high-performance slab forward pass.

Parameters:

Returns: True if fast path can be safely used.

_collectFastSlabOutput

_collectFastSlabOutput(
  network: default,
  activationBuffer: Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike>,
  nodeCount: number,
): number[]

Collects output activations into detached number array.

Parameters:

Returns: Output activation array.

_createFastActivationBuffer

_createFastActivationBuffer(
  useFloat32Activation: boolean,
  nodeCount: number,
): Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike>

Creates typed fast activation/state buffer.

Parameters:

Returns: New typed buffer.

_ensureFastSlabBuffers

_ensureFastSlabBuffers(
  internalNet: NetworkSlabProps,
  nodeCount: number,
): void

Ensures fast activation/state buffers are allocated and shape-compatible.

Parameters:

Returns: Nothing.

_hasFastSlabPrerequisites

_hasFastSlabPrerequisites(
  internalNet: NetworkSlabProps,
): boolean

Checks whether core slab prerequisites are available.

Parameters:

Returns: True when all required slabs/adjacency arrays exist.

_maybeActivateNonInputNode

_maybeActivateNonInputNode(
  network: default,
  node: FastSlabNodeRuntime,
  nodeIndex: number,
  stateBuffer: Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike>,
  activationBuffer: Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike>,
): void

Activates one non-input node when required.

Parameters:

Returns: Nothing.

_needsFastBufferReplacement

_needsFastBufferReplacement(
  buffer: Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike> | undefined,
  nodeCount: number,
  useFloat32Activation: boolean,
): boolean

Checks whether a fast buffer requires replacement.

Parameters:

Returns: True when replacement is needed.

_prepareFastSlabRuntime

_prepareFastSlabRuntime(
  network: default,
  internalNet: NetworkSlabProps,
  reindexNodes: (network: default) => void,
): void

Prepares topology and indices for fast slab pass.

Parameters:

Returns: Nothing.

_propagateFastSlabActivations

_propagateFastSlabActivations(
  network: default,
  internalNet: NetworkSlabProps,
  topoOrder: FastSlabNodeRuntime[],
  activationBuffer: Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike>,
  stateBuffer: Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike>,
): void

Propagates activations through topology using slab arrays.

Parameters:

Returns: Nothing.

_propagateNodeOutgoingEdges

_propagateNodeOutgoingEdges(
  internalNet: NetworkSlabProps,
  nodeIndex: number,
  activationBuffer: Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike>,
  stateBuffer: Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike>,
  weightArray: Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike>,
  toIndexArray: Uint32Array<ArrayBufferLike>,
  outgoingOrder: Uint32Array<ArrayBufferLike>,
  outgoingStartIndices: Uint32Array<ArrayBufferLike>,
): void

Propagates one node activation over all outgoing slab edges.

Parameters:

Returns: Nothing.

_recomputeTopologyOrder

_recomputeTopologyOrder(
  network: default,
): void

Recomputes topological order on demand.

Parameters:

Returns: Nothing.

_resolveFastTopoOrder

_resolveFastTopoOrder(
  network: default,
  internalNet: NetworkSlabProps,
): FastSlabNodeRuntime[]

Resolves topological iteration order for fast slab pass.

Parameters:

Returns: Topological node order.

_resolveWeightedConnectionValue

_resolveWeightedConnectionValue(
  internalNet: NetworkSlabProps,
  weightArray: Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike>,
  connectionIndex: number,
): number

Resolves effective connection weight including optional gain.

Parameters:

Returns: Effective weighted value.

_seedFastInputLayer

_seedFastInputLayer(
  network: default,
  input: number[],
  activationBuffer: Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike>,
): void

Seeds input-layer activations for fast slab pass.

Parameters:

Returns: Nothing.

_tryFastSlabFallbackForGating

_tryFastSlabFallbackForGating(
  network: default,
  input: number[],
): number[] | null

Falls back to legacy activation when gating is present.

Parameters:

Returns: Legacy output or null when fast path may continue.

_tryFastSlabFallbackForMissingPrerequisites

_tryFastSlabFallbackForMissingPrerequisites(
  network: default,
  internalNet: NetworkSlabProps,
  input: number[],
): number[] | null

Falls back to legacy activation when slab prerequisites are missing.

Parameters:

Returns: Legacy output or null when fast path may continue.

_writeInputNodeRuntime

_writeInputNodeRuntime(
  node: default,
  inputValue: number,
): void

Writes runtime activation/state for one input node.

Parameters:

Returns: Nothing.

Generated from source JSDoc • GitHub