code wiki / (root) / nx_enginelab_analysis.nx

nx_enginelab_analysis.nx

buildroot/runtime/nx_enginelab_analysis.nx

13310 B311 linesdepth 4pulls 6 transitivereach 1 importersview sourcekind librarytopic enginelab
docsdependenciesstructsconstsfunctions

about

nx_enginelab_analysis.nx -- EL2 replay, EL4 shader binding, EL5 stack sampling, EL6 call tree. WHY A FOURTH MODULE AND NOT MORE OF THE SPINE. Two lanes built the same rung inside one hour today and the collision was caught by the LINKER rather than by either lane looking first. The cheap structural answer is that a lane writes in files it owns and declares what it is taking BEFORE it writes: these four rungs are declared to the sibling lane, and event kinds 9 and 10 are claimed explicitly, because a silently reused KIND value is worse than a duplicate name -- the linker cannot catch it, and every analyzer would read the record as a valid one of the wrong type. EVERYTHING HERE IS PURE BUFFER. No path, no descriptor, no syscall beyond allocation. The spine stays adoptable by a wasm world and so does this. license_tier: ORIGINAL No hardware writes (Rule 26).

dependencies 2 imports · 1 importers

nx_syscalls.nx nx_enginelab_lib.nx nx_enginelab_analysis.nx nx_enginelab_analysis_gate.nx

imports: nx_syscalls.nxnx_enginelab_lib.nx

imported by: nx_enginelab_analysis_gate.nx

structs

none

consts

17const EL_K_BIND: i64 = 9 // EL_F_A = shader id, EL_F_B = pipeline stage
18const EL_K_SAMPLE: i64 = 10 // a periodic stack sample: EL_F_TS is the only thing that matters
26const EL_RP_DIGEST: i64 = 0
27const EL_RP_DRAWS: i64 = 1
28const EL_RP_SLOTS: i64 = 2
134const EL_SM_INTERVAL_US_DEFAULT: i64 = 1000
135const EL_SM_ATTRIB: i64 = 0
136const EL_SM_TOTAL: i64 = 1
137const EL_SM_UNZONED: i64 = 2 // samples that landed in no zone at all -- reported, never dropped
138const EL_SM_INTERVAL: i64 = 3
139const EL_SM_HORIZON: i64 = 4 // anything shorter than this can be missed entirely
140const EL_SM_SLOTS: i64 = 5
197const EL_FL_ROOTINCL: i64 = 0
198const EL_FL_ALLSELF: i64 = 1
199const EL_FL_NODES: i64 = 2
200const EL_FL_ROOTS: i64 = 3
201const EL_FL_OPEN: i64 = 4
202const EL_FL_SLOTS: i64 = 5
264const EL_FL_MAXDEPTH: i64 = EL_STACK_MAX
265const EL_FL_SEMI: i64 = 59
266const EL_FL_SPACE: i64 = 32
267const EL_FL_NEWLINE: i64 = 10

functions

30func ela_fold(h: i64, v: i64) -> i64 { return (h * EL_HASH_MUL + v) % EL_HASH_MOD }
called by 1: ela_draw_digest
32func ela_draw_digest(st: *i64, r: i64, h: i64) -> i64
39func el_replay(st: *i64, out: *i64) -> i64
58func el_replay_diverge(a: *i64, b: *i64, out: *i64) -> i64
87func el_bind_shader(st: *i64, ts: i64, tid: i64, shader: i64, stage: i64) -> i64
called by 1: main calls 1: el_push
94func el_shader_dump(st: *i64, ord: i64, stage: i64, out: *i64) -> i64
called by 1: main calls 2: el_draw_nthel_get
142func el_sample_stack(st: *i64, ts: i64, tid: i64) -> i64
called by 1: main calls 1: el_push
148func ela_innermost(st: *i64, ts: i64, tid: i64) -> i64
called by 1: el_sample_attribute calls 1: el_get
172func el_sample_attribute(st: *i64, name: i64, interval_us: i64, out: *i64) -> i64
called by 1: main calls 2: el_getela_innermost
204func el_flame_totals(st: *i64, out: *i64) -> i64
called by 1: main calls 2: el_getel_zone_is_root
233func ela_parent(st: *i64, idx: i64) -> i64
called by 1: el_flame_emit calls 1: el_get
272func el_flame_emit(st: *i64, buf: *u8, cap: i64) -> i64