architecture/network/window

architecture/network/window/network.window.utils.ts

appendForwardWindowOutputs

appendForwardWindowOutputs(
  forwardWindowContext: ForwardWindowContext,
  windowOutputs: number[][],
): void

Append one emitted window to the collected result matrix when collection is enabled.

Parameters:

Returns: Nothing.

assertForwardWindowInputsCollection

assertForwardWindowInputsCollection(
  inputs: number[][],
): void

Validate that the windowed input collection is an array of input vectors.

Parameters:

Returns: Nothing.

assertForwardWindowInputSize

assertForwardWindowInputSize(
  inputVector: number[],
  expectedInputSize: number,
  inputIndex: number,
): void

Validate one input vector width for windowed activation.

Parameters:

Returns: Nothing.

clearForwardWindowBuffer

clearForwardWindowBuffer(
  windowBuffer: (number[] | undefined)[],
  windowRowCount: number,
): void

Release bounded buffer references once one emitted window has been handled.

Parameters:

Returns: Nothing.

collectForwardWindowOutputs

collectForwardWindowOutputs(
  forwardWindowContext: ForwardWindowContext,
  onWindow: ((chunk: NetworkForwardWindowChunk) => void) | undefined,
): number[][]

Advance one input sequence in explicit windows and collect ordered outputs.

Parameters:

Returns: Output vectors aligned to the input order.

collectForwardWindowOutputsAsync

collectForwardWindowOutputsAsync(
  forwardWindowContext: ForwardWindowContext,
  onWindow: ((chunk: NetworkForwardWindowChunk) => void | Promise<void>) | undefined,
  yieldAfterWindows: number,
  yieldControl: ForwardWindowYieldControl | undefined,
): Promise<number[][]>

Advance one input sequence in explicit windows while yielding between browser-sized slices.

Parameters:

Returns: Output vectors aligned to the input order.

createForwardWindowChunk

createForwardWindowChunk(
  windowBuffer: (number[] | undefined)[],
  windowRowCount: number,
  windowIndex: number,
  startIndex: number,
  endIndexExclusive: number,
  done: boolean,
): NetworkForwardWindowChunk

Create one emitted window chunk from the reusable buffer.

Parameters:

Returns: One stable window chunk for callbacks and collectors.

createForwardWindowContext

createForwardWindowContext(
  network: default,
  inputs: number[][],
  options: NetworkForwardWindowOptions,
  environment: MemoryManagerEnvironment,
): ForwardWindowContext

Create the shared state used by sync and async windowed activation.

Parameters:

Returns: Shared forward-window activation context.

formatInputLengthForMessage

formatInputLengthForMessage(
  inputVector: number[],
): string

Convert one input length into a display-safe string for error messages.

Parameters:

Returns: Numeric length as text or the shared undefined marker.

forwardWindowed

forwardWindowed(
  inputs: number[][],
  options: NetworkForwardWindowOptions,
): number[][]

Advance one input sequence in bounded windows while preserving carried recurrent state.

This is the first common-path Phase 9 surface: it keeps the same activation semantics as repeated activate() calls, but it advances the sequence in explicit windows so later browser and low-memory follow-up work has one stable orchestration boundary.

Parameters:

Returns: Output vectors aligned to the input order.

forwardWindowedAsync

forwardWindowedAsync(
  inputs: number[][],
  options: NetworkForwardWindowAsyncOptions,
): Promise<number[][]>

Advance one input sequence in bounded windows while yielding between browser-sized slices.

This keeps the same recurrent semantics as forwardWindowed(), but it can cooperatively yield after a configurable number of completed windows so long browser sequences do not monopolize the main thread.

Parameters:

Returns: Output vectors aligned to the input order.

normalizeForwardWindowSize

normalizeForwardWindowSize(
  windowSize: number | undefined,
  environment: MemoryManagerEnvironment,
): number

Normalize the requested forward-window size to a positive integer.

Parameters:

Returns: Positive integer window size.

normalizeYieldAfterWindows

normalizeYieldAfterWindows(
  yieldAfterWindows: number | undefined,
  environment: MemoryManagerEnvironment,
): number

Normalize the requested async yield cadence to a positive integer or infinity.

Parameters:

Returns: Positive integer yield cadence or infinity when yielding is disabled.

resolveDefaultForwardWindowSize

resolveDefaultForwardWindowSize(
  environment: MemoryManagerEnvironment,
): number

Resolve the default forward-window size for the active runtime.

Parameters:

Returns: Default bounded window size.

resolveDefaultForwardWindowYieldControl

resolveDefaultForwardWindowYieldControl(
  environment: MemoryManagerEnvironment,
): ForwardWindowYieldControl | undefined

Resolve the default async yield hook for the active runtime.

Parameters:

Returns: Promise-based yield hook when the runtime exposes one.

resolveForwardWindowEnvironment

resolveForwardWindowEnvironment(): MemoryManagerEnvironment

Resolve the current runtime environment through the shared memory owner.

Returns: Active runtime environment label.

shouldYieldAfterCompletedWindow

shouldYieldAfterCompletedWindow(
  completedWindowCount: number,
  isLastInput: boolean,
  yieldAfterWindows: number,
  yieldControl: ForwardWindowYieldControl | undefined,
): boolean

Determine whether the async path should yield after one completed window.

Parameters:

Returns: Whether the async path should yield now.

Generated from source JSDoc • GitHub