code wiki / (root) / nx_glsl_tokdiff_gate.nx

nx_glsl_tokdiff_gate.nx

buildroot/runtime/nx_glsl_tokdiff_gate.nx

15112 B185 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_glsl_tokdiff_gate.nx -- referee for THE SHADER TOKEN RULER (nx_glsl_tok_lib), driven IN-PROCESS over planted strings, both directions: every normalisation the ruler claims (whitespace, comments, numeric spelling, compound assignment over ident / swizzle / index lvalues -- and, since S12c-2, THE CANONICAL FORM: precedence re-parenthesisation, multi-declarator splitting, brace insertion, else-if nesting, counted-loop lowering, comparison inversion under not) must read IDENTICAL, and every real difference (an operator, a constant, an identifier, an extra token, a parenthesis that CHANGES precedence) must read DIFFERS naming the first differing token index -- plus the tokenizer's own arithmetic on a string whose token count is known by hand, an unreadable input REFUSED by name, and the real subject (the hand MVS on the board) canonicalising to itself with parentheses ADDED. Every number asserted AND emitted. STATEMENT fixtures are wrapped in braces: module scope is copied token for token by design (a function HEADER `float hsh(float s)` is `IDENT IDENT (` and must not be read as a declaration), so a statement-level normalisation is only reachable inside a block -- exactly where every statement of a real shader lives. The first run of this gate measured that (T9/T10/T12/T13 read DIFFERS at module scope, 35/40): the fixtures were wrong, the ruler was not. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 2 imports · 0 importers

nx_glsl_tok_lib.nx nx_gate_verdict.nx nx_glsl_tokdiff_gate.nx

imports: nx_glsl_tok_lib.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

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

main gv_ctr 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 ↻

structs

none

consts

17const C_TILDE: i64 = 126

functions

19func g_diff(a: *u8, b: *u8, r: *i64) -> i64 { return gt_diff(a, gt_slen(a), b, gt_slen(b), r) }
calls 2: gt_diffgt_slen
20func g_cdiff(a: *u8, b: *u8, r: *i64) -> i64 { return gt_diff_canon(a, gt_slen(a), b, gt_slen(b), r) }
23func g_bang(s: *u8) -> *u8
calls 1: gt_slen
37func main() -> i64
calls 1: gv_ctr