code wiki / (root) / nx_editstack_gate.nx

nx_editstack_gate.nx

buildroot/runtime/nx_editstack_gate.nx

13358 B224 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_editstack_gate.nx -- the gate for nx_editstack_lib (/compare/dcc DC1 and DC2). THE CLAIM UNDER TEST is the one no float DCC can make: replaying the operation log from the base reproduces the state BIT-IDENTICALLY, and re-evaluating a parameter at depth equals building the whole log again from scratch with that parameter. Both are asserted on a DIGEST OF THE STATE, never on a return code, because a leaking or no-op implementation answers identical return codes. ANTI-VACUITY IS EXPLICIT, in three places, because "replay equals live" is trivially true for a stack that does nothing at all: - the digest is proven to DISCRIMINATE (three different states must give three different digests); a constant digest function would otherwise pass every other tooth on this gate. - undo is proven to reach an EARLIER state, so replay cannot be a no-op: it must genuinely reset to the base and re-apply a PREFIX of the log. - re-evaluation is proven equal to an INDEPENDENTLY BUILT stack, not merely different from before. Every refusal cell is a gv_bite: it must fire on the bad input AND stay silent on the good one. 100% sovereign. No hardware writes (Rule 26). license_tier: ORIGINAL expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_editstack_lib.nx nx_editstack_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_editstack_lib.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 ↻ gv_head gv_puts sys_write ↻ eg_seed es_new sys_mmap ↻ es_words_for es_base_set es_live_off eg_base gv_check gv_puts ↻ eg_ne es_digest es_live_off ↻ es_push es_apply es_live_off ↻ es_record es_ops_off eg_eq es_count es_head

structs

none

consts

20const EG_NCELL: i64 = 6
21const EG_CAP: i64 = 8
22const EG_SMALLCAP: i64 = 2
28const EG_BASE0: i64 = 10
29const EG_BASE_STEP: i64 = 10
32const EG_TGT_ADD: i64 = 0
33const EG_TGT_SCALE: i64 = 1
35const EG_TGT_THIRD: i64 = 2
39const EG_PROG_OPS: i64 = 3
42const EG_TRUNC_SURVIVORS: i64 = 2
44const EG_ADD0: i64 = 5
45const EG_ADD0_ALT: i64 = 9
46const EG_SCALE_NUM: i64 = 3
47const EG_SCALE_DEN: i64 = 2
48const EG_RADD_LO: i64 = 2
49const EG_RADD_HI: i64 = 5
50const EG_RADD_AMT: i64 = 7
51const EG_UNUSED: i64 = 0

functions

53func eg_eq(a: i64, b: i64) -> i64 { if a == b { return 1 } return 0 }
called by 1: main
54func eg_ne(a: i64, b: i64) -> i64 { if a != b { return 1 } return 0 }
called by 1: main
58func eg_base(i: i64) -> i64 { return EG_BASE0 + i * EG_BASE_STEP }
called by 2: eg_seedmain
62func eg_seed(cap: i64) -> *i64
called by 1: main calls 3: es_newes_base_seteg_base
72func eg_program(st: *i64, add0: i64) -> i64
called by 1: main calls 1: es_push
79func main(argc: i64, argv: *i64) -> i64