~/bend-docscommunity

kernel_cost.bend checks

raw source on the hub · import stelliferous@0.0.4.0/kernel_cost.bend as Kernel_cost

Prediction parameters, not machine bounds or correctness certificates. The worker count is not a profile value: callers pass the runtime's pool size.

1 import
import Base

Types

type Configuration source · line 9 · raw

Data

The prices a plan is estimated with. A cell counts rows, vector instructions of eight lanes with its tile loads and stores among them, and steps, scalar instructions. A target cell of a moving operation also pays one move through a view, and a block copy pays its bytes.

Definitions

def cell_ns source · line 13 · raw

@+rows:F32 -> @+steps:F32 -> @config:Configuration -> F32

One cell's work from its counts.

def moved_ns source · line 18 · raw

@+rows:F32 -> @+steps:F32 -> @config:Configuration -> F32

One target cell of a moving operation: its move and its own rows and steps.

def copy_ns source · line 23 · raw

@+bytes:F32 -> @config:Configuration -> F32

The bytes a block copy writes into a new buffer.

def region_ns source · line 33 · raw

@+workers:U32 -> @+leaves:U32 -> @+span:F32 -> F32

The official runtime grows fork tasks and queues fork-free tasks for its work round (monk_step, row_grow, cube_run). No fixed number of leaves can be subtracted as already completed by growth. Price complete waves of at most workers leaves, using the largest path (including clones) per wave. This is a conservative scheduling estimate, not a bound on the runtime's static ring distribution. Callers charge the two wake rounds separately.