code wiki / _hdl_build / nx_clock_edf_gate.nx
nx_clock_edf_gate.nx
buildroot/runtime/_hdl_build/nx_clock_edf_gate.nx
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
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
structs
| none |
consts
| 21 | const G_N: i64 = 8 |
functions
| 23 | func gw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 24 | func gn(v: i64) -> i64 |
| 33 | func row(name: *u8, ok: i64, pass: *i64, total: *i64) -> i64 |
| 40 | func main() -> i64 |