code wiki / (root) / nx_langsem_lib.nx

nx_langsem_lib.nx

buildroot/runtime/nx_langsem_lib.nx

1814 B29 linesdepth 2pulls 2 transitivereach 1 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_langsem_lib.nx -- the OTHER MODULE for nx_langsem_gate. It exists so the gate can ask a question no single-file test can ask: when an importer assigns a static declared HERE, does THIS module see the same storage, or did each module get its own copy? That question was answered by accident on 2026-08-28 while extracting nx_worldpipe_core: the extraction only works because nx_worldpipe's wp_init still assigns WP_SEED, WP_TEMP_BIAS, WP_CONT_BIAS and WP_MOUNT_SCALE from OUTSIDE the module that declares them. It compiled and ran, so the semantics hold -- but nothing in the estate ASSERTED it, which means the whole shared-core/base-class pattern rested on a fact no gate protected. This lib is the other half of that assertion. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 1 imports · 1 importers

nx_syscalls.nx nx_langsem_lib.nx nx_langsem_gate.nx

imports: nx_syscalls.nx

imported by: nx_langsem_gate.nx

structs

none

consts

15const LS_CONST_ANSWER: i64 = 424242

functions

22func ls_get() -> i64 { return LS_SHARED }
called by 1: main
24func ls_set(v: i64) -> i64 { LS_SHARED = v; return 0 }
called by 1: main
26func ls_untouched() -> i64 { return LS_UNTOUCHED }
called by 1: main
29func ls_divmod_probe(a: i64, b: i64) -> i64 { return (a/b)*100 + (a%b) }
called by 1: main