code wiki / _hdl_build / nx_pattern_emit14.nx
nx_pattern_emit14.nx
buildroot/runtime/_hdl_build/nx_pattern_emit14.nx
about
nx_pattern_emit14.nx -- PATTERN EMITTER: PERMIL_VERDICT (shape 20, the LOG_SCAN scoreboard core).
The MISSING HALF of a data-driven scorecard: nx_census_run already SCANS+COUNTS (data-driven);
this shape bakes permil = count*1000/total + an ordered verdict-band ladder from a DATA table,
so the team authors scorecard/census-verdict organs HANDS-OFF (author=emitter). The first NEW
shape the team gains beyond 11/12/13/18 -- the emitter-of-emitters bootstrap's first fruit.
spec[0]=total (>0) spec[1]=nbands (1..16)
spec[2 + 2*i]=threshold_permil_i (0..1000, strictly ascending) spec[3 + 2*i]=verdict_code_i
Authored fn (bands BAKED as flat ifs, highest threshold first -- rule 22, no runtime table):
<name>_verdict(count) -> verdict_code; -1 if count<0 or permil below the lowest band.
EMIT-TIME RAILS: total<=0, nbands outside 1..16, thresholds out of 0..1000 or not strictly
ascending -> spec REFUSED, nothing written. KATs computed BY THE EMITTER from the same table.
LAWS: struct-free, integer-only, flat ifs, no &&/||, <=6 args per func. license_tier: ORIGINAL
dependencies 1 imports · 3 importers
imports: nx_syscalls.nx
imported by: _pe14_probe.nxnx_auto_builder.nxnx_auto_builder_s20.nx
structs
| none |
consts
| none |
functions
| 15 | func p14_w(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd, s, n); return 0 } |
| 16 | func p14_wn(fd: i64, v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m; sys_write(fd,"-" as *u8,1)}; let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48;k=1}; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1}; var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(fd,bb,k); return 0 } |
| 19 | func p14_spec_ok(spec: *i64) -> i64 called by 1: pe14_author_permil_verdict |
| 39 | func p14_expect(spec: *i64, permil: i64) -> i64 |
| 50 | func pe14_emit_permil_verdict(fd: i64, name: *u8, spec: *i64) -> i64 |
| 68 | func pe14_emit_permil_verdict_test(fd: i64, name: *u8, spec: *i64) -> i64 |
| 86 | func pe14_author_permil_verdict(name: *u8, modpath: *u8, testpath: *u8, spec: *i64) -> i64 |