code wiki / (root) / nx_race_timing.nx

nx_race_timing.nx

buildroot/runtime/nx_race_timing.nx

6636 B153 linesdepth 0pulls 0 transitivereach 8 importersview sourcekind librarytopic race
docsdependenciesstructsconstsfunctions

about

nx_race_timing.nx -- sealed-enum race timing mode + helpers. User directive 2026-05-16: "i want visualization with a manual and scheduled and automatic capbility flag so we can race when we want and do all three aka manual event driven scheduled and whatever other is s class timing" Four-pillar discipline for the racing crew's HOW-IT-FIRES question: HAVE -- every race today fires manually via bench/*.sh FIX -- this file: sealed-enum 8 timing modes PREVENTION -- .race_telemetry.tsv gains timing_mode column; nx_race_visualizer.nx surfaces unused modes ADDITIVE -- MANUAL stays the default; 7 other modes ADD options without removing manual The eight S-class racing-timing modes: MANUAL -- user invokes via CLI; ad-hoc, on-demand EVENT -- filesystem watch, git commit hook, IPC signal (reactive to external state change) SCHEDULED -- cron-style time trigger; runs at named clock positions (e.g., daily at 02:00) CONTINUOUS -- every tick of a fixed period (e.g., every 60s) -- the "always-on" streaming mode IDLE -- fires when system is otherwise idle; lowest priority; never preempts user work THRESHOLD -- fires when a metric crosses a configured bound (latency p99 > X, error rate > Y, ...) PROBABILISTIC -- samples a fraction of race-opportunities; used when full-rate races would be too expensive QUORUM -- fires only when N out of M graders agree a race is currently warranted; used to dampen thrash from any single grader Each mode is a distinct discipline. This file enumerates them as a SEALED ENUM (NX_RACE_TIMING_N is the count). Callers (bench scripts, daemons, the ICL) pick a mode + record it in .race_telemetry.tsv so the visualizer can show which modes are

dependencies 0 imports · 3 importers

nx_race_timing.nx nx_cron.nx nx_race_timing_test.nx nx_race_visualizer.nx

imports: none

imported by: nx_cron.nxnx_race_timing_test.nxnx_race_visualizer.nx

structs

none

consts

60const NX_RACE_MANUAL: i64 = 0
61const NX_RACE_EVENT: i64 = 1
62const NX_RACE_SCHEDULED: i64 = 2
63const NX_RACE_CONTINUOUS: i64 = 3
64const NX_RACE_IDLE: i64 = 4
65const NX_RACE_THRESHOLD: i64 = 5
66const NX_RACE_PROBABILISTIC: i64 = 6
67const NX_RACE_QUORUM: i64 = 7
68const NX_RACE_TIMING_N: i64 = 8

functions

70func nx_race_timing_is_valid(t: i64) -> i64
78func nx_race_timing_name(t: i64) -> *u8
91func nx_race_timing_name_len(t: i64) -> i64
106func nx_race_timing_parse(buf: *u8, n: i64) -> i64
133func nx_race_timing_is_reactive(t: i64) -> i64
called by 1: main
146func nx_race_timing_needs_config(t: i64) -> i64
called by 1: main