code wiki / _hdl_build / nx_hmac_alloc_ab.nx

nx_hmac_alloc_ab.nx

buildroot/runtime/_hdl_build/nx_hmac_alloc_ab.nx

5232 B119 linesdepth 4pulls 4 transitivereach 0 importersview sourcekind tooltopic hmac
docsdependenciesstructsconstsfunctions

about

nx_hmac_alloc_ab.nx -- WITHIN-SUBJECT A/B: does hoisting HMAC's scratch change anything MEASURABLE? ⚠THIS EXISTS BECAUSE MY PREVIOUS ATTEMPT WAS INVALID. I compared `nx_pbkdf2_sha1` (fixed) against `pbkdf2_sha1` (untouched) -- but those bind DIFFERENT HASH CORES (nx_sha1.nx vs sha1.nx), so the comparison changed TWO variables and its 52.7s-vs-3.6s gap is uninterpretable. ★★★★★A CONTROL THAT CHANGES THE MODULE UNDER TEST IS NOT A CONTROL. I applied this correctly to the HKDF triangulation hours earlier (the SHA-256 arm held fixed as an arm that MUST NOT MOVE) and then broke it. DESIGN: ONE process, ONE hash core (nx_sha1.nx), ONE input, TWO loops of identical count: A: hmac_sha1(...) -- allocates 4 buffers per call (original) B: hmac_sha1_into(...) -- allocates ZERO per call (the fix) Everything else is held constant, so any difference is attributable to the single changed variable. ★A WITHIN-SUBJECT DESIGN REMOVES THE CONFOUND THAT A BETWEEN-BINARY DESIGN INVITES. ⚠AND IT REPORTS RSS *DELTAS PER PHASE*, NOT maxresident. maxresident was shown to be useless here: it read 4,800,000k for BOTH 100k and 200k iterations, with pagefault counts differing by ONE -- i.e. it was reporting a FIXED RUNTIME ARENA, not consumption. ★★★★★A NUMBER IDENTICAL ACROSS TWO DIFFERENT WORKLOADS IS MEASURING THE HARNESS, NOT THE WORKLOAD. If the statm reader fails, this probe says UNMEASURED rather than printing a flattering 0. license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_hmac_sha1.nx nx_hmac_alloc_ab.nx

imports: nx_syscalls.nxnx_hmac_sha1.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main w sys_write nn w ↻ sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ sys_write ↻ sys_mmap ↻ rss_pages sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close sys_now_ms sys_mmap ↻ sys_clock_gettime_mono hmac_sha1 sys_mmap ↻ sha1 sys_mmap ↻ sha1_process_block if_ge

structs

none

consts

23const K_MAGIC_50000: i64 = 50000

functions

25func w(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 2: nnmain calls 1: sys_write
27func nn(v: i64) -> i64
called by 1: main calls 3: wsys_mmapsys_write
42func rss_pages() -> i64
called by 1: main calls 2: sys_mmapsys_read_file
67func main() -> i64