code wiki / _hdl_build / nx_vram_gov.nx

nx_vram_gov.nx

buildroot/runtime/_hdl_build/nx_vram_gov.nx

2746 B54 linesdepth 0pulls 0 transitivereach 1 importersview sourcekind librarytopic vram
docsdependenciesstructsconstsfunctions

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

nx_vram_gov.nx nx_vram_gov_gate.nx

imports: none

imported by: nx_vram_gov_gate.nx

structs

none

consts

none

functions

8func vg_init(gov: *i64, budget_mb: i64) -> i64 { gov[0] = budget_mb; gov[1] = 0; gov[2] = 0; return 0 }
called by 1: main
9func vg_used(gov: *i64) -> i64 { return gov[1] }
called by 1: main
10func vg_free(gov: *i64) -> i64 { return gov[0] - gov[1] }
11func vg_count(gov: *i64) -> i64 { return gov[2] }
called by 1: main
12func vg_find(gov: *i64, id: i64) -> i64
called by 2: vg_releasemain
18func vg_admit(gov: *i64, maxt: i64, id: i64, size_mb: i64, prio: i64) -> i64
called by 2: vg_admit_evictmain
28func vg_release(gov: *i64, id: i64) -> i64
called by 2: vg_admit_evictmain calls 1: vg_find
42func vg_admit_evict(gov: *i64, maxt: i64, id: i64, size_mb: i64, prio: i64) -> i64
called by 1: main calls 2: vg_releasevg_admit