code wiki / (root) / sketch_markov_vs_uniform_bench.nx

sketch_markov_vs_uniform_bench.nx

buildroot/runtime/sketch_markov_vs_uniform_bench.nx

2890 B91 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind benchtopic sketch
docsdependenciesstructsconstsfunctions

about

sketch_markov_vs_uniform_bench.nx -- transition prediction bench. CLAIM: Markov chain learns state transition probabilities; predicts next-state better than uniform random when transitions have structure. WORKLOAD: 4-state chain. Transitions strongly biased: 0 -> 1 (80%) / 0 -> 2 (20%) 1 -> 2 (80%) / 1 -> 3 (20%) 2 -> 3 (80%) / 2 -> 0 (20%) 3 -> 0 (80%) / 3 -> 1 (20%) Train 1000 steps, then test 200 transitions.

dependencies 4 imports · 0 importers

syscalls.nx sketch_markov.nx sketch_comparator.nx sketch_types.nx sketch_markov_vs_uniform_bench

imports: syscalls.nxsketch_markov.nxsketch_comparator.nxsketch_types.nx

imported by: nobody (leaf or entry point)

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

main nx_markov_alloc next_state nx_markov_observe nx_markov_cell_idx nx_markov_predict nx_markov_count nx_markov_cell_idx ↻ nx_cmp_accuracy nx_cmp_iabs

structs

none

consts

18const NX_MKB_LCG_A: i64 = 1103515245
19const NX_MKB_LCG_C: i64 = 12345
20const NX_MKB_LCG_MOD: i64 = 0x7FFFFFFF

functions

22func next_state(cur: i64, sim_ptr: *i64) -> i64
called by 1: main
42func main() -> i64