code wiki / _hdl_build / nx_vram_gov.nx
nx_vram_gov.nx
buildroot/runtime/_hdl_build/nx_vram_gov.nx
about
nx_vram_gov.nx -- sovereign VRAM COEXISTENCE GOVERNOR (V-RAM-001, hardware resource rule #21). The RTX 5080's
16 GB is SHARED across services (image-gen, companion-LLM, game-engine); without a governor they OOM each other
and crash a generation. This governs the shared budget: each tenant reserves VRAM, admission REJECTS anything
that would exceed the budget (never-OOM BY CONSTRUCTION), and a higher-priority request can EVICT lower-priority
tenants to fit. Composes nx_vram_budget's sizing (a tenant's size_mb = vram_config_mb). Pure state logic.
gov[*i64]: [0]=budget_mb [1]=used_mb [2]=ntenants ; tenant i at [3 + i*3] = {id, size_mb, priority}. license_tier: ORIGINAL
dependencies 0 imports · 1 importers
imports: none
imported by: nx_vram_gov_gate.nx
structs
| none |
consts
| none |
functions
| 8 | func vg_init(gov: *i64, budget_mb: i64) -> i64 { gov[0] = budget_mb; gov[1] = 0; gov[2] = 0; return 0 } called by 1: main |
| 9 | func vg_used(gov: *i64) -> i64 { return gov[1] } called by 1: main |
| 10 | func vg_free(gov: *i64) -> i64 { return gov[0] - gov[1] } |
| 11 | func vg_count(gov: *i64) -> i64 { return gov[2] } called by 1: main |
| 12 | func vg_find(gov: *i64, id: i64) -> i64 |
| 18 | func vg_admit(gov: *i64, maxt: i64, id: i64, size_mb: i64, prio: i64) -> i64 |
| 28 | func vg_release(gov: *i64, id: i64) -> i64 |
| 42 | func vg_admit_evict(gov: *i64, maxt: i64, id: i64, size_mb: i64, prio: i64) -> i64 |