kcode-k1-kmap-selection 0.2.0

Weighted frontier selection for K1 Kmap traversal
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Public API

`score(edge_weight, inherited_strength)` returns `edge_weight * inherited_strength` in constant work.

`choose(candidates, temperature, random)` returns an index within a nonempty candidate slice. Each
candidate is `(frontier_index, effective_score, attention_cost)`; selection reads only the score.
Callers provide finite positive scores and a finite nonnegative temperature. Zero temperature chooses
uniformly among maximum-score ties. Positive temperature samples weights proportional to
`score^(1 / temperature)`. The supplied random operation is invoked once and must return a finite
value in `[0, 1)`. Selection is linear in candidates and uses temporary memory linear in candidate
count; callback completion has no finite wall-clock bound.

`os_random_unit()` returns a uniformly constructed `f64` in `[0, 1)` from one operating-system
entropy fill. Entropy failures retain their complete child message. OS completion has no finite
wall-clock bound.