code wiki / (root) / nx_checkpoint.nx

nx_checkpoint.nx

buildroot/runtime/nx_checkpoint.nx

4498 B149 linesdepth 5pulls 6 transitivereach 20 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_checkpoint.nx -- atomic high-water-mark file for resumable jobs. Persists a single "last completed id" via .tmp + renameat. genealogy_id: chandy_lamport_1985_snapshots + spark_checkpointing lineage_id: resumable_state

dependencies 4 imports · 3 importers

nx_syscalls.nx nx_tier.nx nx_str.nx nx_strconv.nx nx_checkpoint.nx nx_checkpoint_test.nx nx_ingest_runner.nx nx_ingest_runner_test.nx

imports: nx_syscalls.nxnx_tier.nxnx_str.nxnx_strconv.nx

imported by: nx_checkpoint_test.nxnx_ingest_runner.nxnx_ingest_runner_test.nx

structs

30struct NxCheckpoint

consts

19const NX_CHECKPOINT_FRESH: nx_int = -1
20const NX_CHECKPOINT_WRITE_FAIL: nx_int = -2
21const NX_CHECKPOINT_RENAME_FAIL: nx_int = -3
28const SYS_RENAMEAT_LOCAL: nx_int = 276 // renameat2 (RV64)
38const NX_CHECKPOINT_STRUCT_BYTES: nx_size = 48
39const NX_CHECKPOINT_PATH_CAP: nx_size = 512

functions

41func nx_ckpt_make_tmp(orig: *u8, out: *u8) -> nx_size
54func nx_ckpt_parse_i64(buf: *u8, n: nx_int) -> nx_int
called by 1: nx_checkpoint_open
74func nx_checkpoint_open(path: *u8) -> *NxCheckpoint
100func nx_checkpoint_close(cp: *NxCheckpoint) -> nx_int
105func nx_checkpoint_get(cp: *NxCheckpoint) -> nx_int
109func nx_checkpoint_set(cp: *NxCheckpoint, id: nx_int) -> nx_int
144func nx_checkpoint_n_writes(cp: *NxCheckpoint) -> nx_int { return cp.n_writes }
called by 1: main
145func nx_checkpoint_n_write_fail(cp: *NxCheckpoint) -> nx_int { return cp.n_write_fail }
called by 1: main
146func nx_checkpoint_is_fresh(cp: *NxCheckpoint) -> nx_int
called by 1: main