code wiki / _hdl_build / _ttt_test_trace.nx

_ttt_test_trace.nx

buildroot/runtime/_hdl_build/_ttt_test_trace.nx

8383 B183 linesdepth 4pulls 4 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_tictactoe_test.nx -- C0 substrate smoke. 12 deterministic assertions covering: 1. new game has X to move + outcome ongoing 2. 9 legal moves on a fresh board 3. apply X to cell 4 -> board[4]=X, turn=O, 8 legal moves left 4. illegal-move (occupied cell) is no-op 5. illegal-move (out-of-range) is no-op 6. horizontal-row win is detected (top row XXX) 7. diagonal win is detected (0-4-8 XXX) 8. draw is detected after 9 non-winning moves 9. state-hash is deterministic for same state 10. perfect-vs-perfect always ends in draw (game-theory invariant) 11. perfect-vs-random never loses (perfect's score never negative) 12. evaluate updates only the OUTCOME and WINNER cells (does not mutate board) Each failed assertion exits with a distinct non-zero code so the smoke harness identifies which check fired. Composes [[feedback-bug-class-prevention-additive-not-restrictive]] + ยง22 bug-class table entry "move-applies-to-wrong-cell" (the tic-tac-toe equivalent of the W/S inversion class).

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_tier.nx nx_tictactoe.nx nx_prng.nx _ttt_test_trace.nx

imports: nx_syscalls.nxnx_tier.nxnx_tictactoe.nxnx_prng.nx

imported by: nobody (leaf or entry point)

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

main nx_ttt_new sys_mmap nx_ttt_turn nx_ttt_outcome nx_ttt_winner nx_ttt_legal_count nx_ttt_try_apply nx_ttt_is_legal nx_ttt_other nx_ttt_evaluate nx_ttt_cell nx_ttt_state_hash tt_puts sys_write tt_putn sys_mmap ↻ sys_write ↻ nx_ttt_pick_perfect nx_ttt_try_apply ↻ nx_ttt_minimax nx_ttt_try_apply ↻ nx_ttt_minimax ↻ nx_ttt_undo nx_ttt_undo ↻ nx_prng_init nx_ttt_pick_easy nx_ttt_legal_count ↻ nx_prng_range nx_prng_next nx_ttt_evaluate ↻

structs

none

consts

none

functions

29func tt_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 1: main calls 1: sys_write
30func tt_putn(v: i64) -> i64 { let bb: *u8 = sys_mmap(28); var m: i64=v; if m<0 {m=0-m;sys_write(1,"-" 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); m=m/10; k=k+1}; var i: i64=0; while i<k {bb[i]=t[k-1-i]; i=i+1}; sys_write(1, bb, k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
32func main() -> nx_int