nx_jpeg_tables_gate.nx
buildroot/runtime/nx_jpeg_tables_gate.nx
about
nx_jpeg_tables_gate.nx -- the referee for the decoder's table slots (debt 1789603770, 2026-09-16). T.81 B.2.4.2 names every
DHT and DQT table and a later definition REPLACES it. The decoders appended tables by order of appearance into four slots,
so a progressive file (one DHT per scan: ri_diora_baird_1 carries 7 tables over 6 scans, ri_diora_baird_4 ten over ten)
wrote past the array (ARENA-OVERRUN prev_alloc_size=256 on every real decode) and a redefined table lost to its stale first
definition. In-process teeth on hand-built payloads: slots are keyed by name, a redefinition wins, twelve definitions leave
the slot count at eight, an undefined name reads absent, a class the standard lacks is refused by name and places nothing.
End-to-end teeth on two mirrored progressive stills: the decode agrees with an OUTSIDE decoder (libjpeg-turbo through
OpenCV 5.0.0 on the laptop, 2026-09-16) on the channel means -- the liar-killer no in-process tooth can supply; that
decoder never enters a build or run path, only its numbers do. Values are printed with gv_kv.
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_gate_verdict.nxnx_jpeg_ascii.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 15 | const JT_I64: i64 = 8 |
| 16 | const JT_BYTE: i64 = 255 |
| 17 | const JT_BPP: i64 = 3 |
| 18 | const JT_DHT_HDR: i64 = 17 |
| 19 | const JT_BITS_N: i64 = 16 |
| 20 | const JT_DQT_VALUES: i64 = 64 |
| 21 | const JT_PAYLOAD_B: i64 = 128 |
| 22 | const JT_MEANS_N: i64 = 5 |
| 23 | const JT_ROUNDS: i64 = 3 |
| 24 | const JT_TOL_MEAN: i64 = 4 |
| 25 | const JT_FIX1: *u8 = "knowledge/fetched/ri_diora_baird_1.jpg" |
| 26 | const JT_FIX1_W: i64 = 405 |
| 27 | const JT_FIX1_H: i64 = 500 |
| 28 | const JT_FIX1_R: i64 = 171 |
| 29 | const JT_FIX1_G: i64 = 156 |
| 30 | const JT_FIX1_B: i64 = 146 |
| 31 | const JT_FIX2: *u8 = "knowledge/fetched/ri_diora_baird_4.jpg" |
| 32 | const JT_FIX2_W: i64 = 831 |
| 33 | const JT_FIX2_H: i64 = 1200 |
| 34 | const JT_FIX2_R: i64 = 119 |
| 35 | const JT_FIX2_G: i64 = 117 |
| 36 | const JT_FIX2_B: i64 = 80 |
| 37 | const JT_TC_DC: i64 = 0 |
| 38 | const JT_TC_AC: i64 = 1 |
| 39 | const JT_TC_BAD: i64 = 2 |
| 40 | const JT_TH_NEVER: i64 = 2 |
| 41 | const JT_TQ_A: i64 = 1 |
| 42 | const JT_TQ_NEVER: i64 = 0 |
| 43 | const JT_VAL_A: i64 = 7 |
| 44 | const JT_VAL_B: i64 = 9 |
| 45 | const JT_SYM_A: i64 = 0 |
| 46 | const JT_SYM_B: i64 = 5 |
| 47 | const JT_SYM_B2: i64 = 7 |
| 48 | const JT_SYM_C: i64 = 8 |
| 49 | const JT_E_UNREADABLE: i64 = 0 - 1 |
functions
| 51 | func jt_abs(v: i64) -> i64 { if v < 0 { return 0 - v } return v } called by 1: jt_near |
| 52 | func jt_near(a: i64, b: i64, tol: i64) -> i64 { if jt_abs(a - b) <= tol { return 1 } return 0 } |
| 54 | func jt_dht_table(buf: *u8, o: i64, tc: i64, th: i64, n1: i64, n2: i64, sym0: i64) -> i64 called by 1: main |
| 65 | func jt_dqt_table(buf: *u8, o: i64, tq: i64, value: i64) -> i64 called by 1: main |
| 72 | func jt_decode_means(path: *u8, out: *i64) -> i64 |
| 103 | func main() -> i64 |