code wiki / _hdl_build / nx_clock_edf_gate.nx

nx_clock_edf_gate.nx

buildroot/runtime/_hdl_build/nx_clock_edf_gate.nx

7437 B135 linesdepth 6pulls 7 transitivereach 0 importersview sourcekind gate/prooftopic clock
docsdependenciesstructsconstsfunctions

about

nx_clock_edf_gate.nx -- GATE for the wall-clock/EDF scheduler (debt 1785872141, operator 2026-08-04 "get the clock to sota"). Proves the SOTA properties on the PURE decision functions, so a 6-HOUR period is verified in MILLISECONDS with fabricated clock values instead of by waiting 6 hours. T1 EDF ORDER: the most-overdue job is picked FIRST (earliest deadline), not registry order. T2 NOT-DUE: nothing overdue -> pick returns -1 (a scheduler must not invent work). T3 CATCH-UP WITHOUT RUNAWAY: re-arming a job 5 periods late lands STRICTLY past now, exactly once. T4 MISSED PERIODS ARE COUNTED, NOT HIDDEN: a job 3 periods late reports 3. T5 THE REGRESSION ITSELF (the whole reason this exists): simulate a window where dispatching costs real time. Under the OLD model (logical tick advanced by SLEEP ONLY) a 21600s job is still not due after a full real day. Under the NEW model (wall-clock deadlines) it fires on time. This is a NEGATIVE CONTROL: the old algorithm MUST fail the same assertion the new one passes, or the tooth proves nothing. T6 MIGRATION IS EXACT: legacy logical-tick deadlines convert; genuine epochs are left ALONE. T7 STARVATION IS BOUNDED: with EDF + re-arm, every job in a saturated set fires within its own period once the backlog drains -- no job is passed over forever. expect_exit: 0 license_tier: ORIGINAL Read-only. No hw writes (Rule 26).

dependencies 2 imports · 0 importers

nx_clock_sched.nx nx_syscalls.nx nx_clock_edf_gate.nx

imports: nx_clock_sched.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main gw sys_write sys_mmap clk_edf_pick gn gw ↻ sys_mmap ↻ sys_write ↻ row gw ↻ clk_edf_rearm clk_edf_missed clk_edf_migrate sys_exit

structs

none

consts

21const G_N: i64 = 8

functions

23func gw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 3: gnrowmain calls 1: sys_write
24func gn(v: i64) -> i64
called by 1: main calls 3: gwsys_mmapsys_write
33func row(name: *u8, ok: i64, pass: *i64, total: *i64) -> i64
called by 1: main calls 1: gw
40func main() -> i64