pub enum ExecMode {
Dev,
Prod,
}Expand description
The dev/prod execution mode (NS-A4, docs/stdlib-spec.md §4b, ruled
2026-07-18): the knob that decides WHERE execution stops on an unordered
comparand — never WHAT values are fabricated.
The split is fenced to placement: it exists only where the prod
behavior is defined, total, and fabricates no data. Ordering contexts
qualify (sort/sorted/min/max; A7 adds heap_push): every element
is preserved, the order is deterministic, saves/replay are safe.
Fabrication never qualifies — int("potato"), OOB indexing stay
always-fault in both modes. Effect rows are mode-independent (the checker
doesn’t know modes exist).
Dev(the default — the Rust dev-profile analogy, like debug-build overflow checks): a float NaN comparand in an ordering context is a turn-terminatingRuntimeError::UnorderedComparandfault, surfacing the upstream bug at its first ordering consumption.Prod: the pinned non-fabricating total order applies — ordinary IEEE order with-0 == +0as a tie, NaN greater than everything, NaN-vs-NaN ties (deliberately NOT IEEEtotalOrder, whose-0 < +0would split ordering from==on clean data). Execution keeps moving.
On NaN-free data the modes agree exactly and cohere with </==.
The knob’s home is project config (brink.toml profile) with a
host-API override (ruled 2026-07-19; tooling wires the config side).
This runtime mechanism is the host-API leg: set it via
[Story::set_exec_mode] / [FlowInstance::set_exec_mode]. The mode is
a host/build knob, not story state — it is never embedded in .inkb
(mirroring dialect/types) and never persisted in saves.
Variants§
Dev
Fault on unordered comparands (NaN) in ordering contexts.
Prod
Keep moving: place NaN by the pinned non-fabricating total order.