nx_budget_alloc_test.nx
buildroot/runtime/nx_budget_alloc_test.nx
about
nx_budget_alloc_test.nx -- smoke for sovereign ceiling enforcement.
Exercises:
1. Allocations within budget succeed; ram_used increments correctly
2. Allocation that WOULD exceed ceiling returns NULL; ram_used
unchanged (refusal BEFORE sys_mmap)
3. Verdict-returning variant distinguishes OVER vs BAD_KIND vs OK
4. release_logical decrements ram_used; subsequent allocations
succeed up to fresh headroom
5. Multiple kinds enforce independently (RAM ceiling does not
block VRAM allocation and vice versa)
6. Bad-input gates: null budget, zero size, negative size
7. Sealed-enum verdict gate
8. headroom() reflects state across allocations + releases
Pure substrate: no /sys/fs/cgroup, no kernel cgroups, no Linux-
only assumptions. Same code path runs on every host.
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_budget.nxnx_budget_alloc.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
| none |
functions
| 23 | func main() -> i64 |