1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
//! Incremental checkpoint: per-group topology, timestamp and property shards
//! plus segment statistics and a manifest.
//!
//! Layout of one edge-table directory (edge-directory layout, distinct from
//! the per-group CSR payload markers 8/9 bound in `edge_table::persistence`):
//! - `meta.bin`: header section only (label ids, schema, next edge id), with
//! the manifest commit tail appended so metadata and manifest share one
//! atomic unit.
//! - `groups_manifest.bin`: address width plus existing out/in group id lists.
//! Missing groups read as empty and never produce files.
//! - `out_g{gid}.bin` / `in_g{gid}.bin`: one page-compressed base payload per
//! existing group, each self-validated by its row header on load. Topology
//! columns persist through the integer column path with per-column
//! bit-packing or run-length encoding and a plain fallback. Rewritten
//! only for groups carrying delete dirt (base merges) or missing files.
//! - `out_g{gid}.append.bin` / `in_g{gid}.append.bin`: committed append-log
//! sidecars holding the write-through delta since the group base rewrite.
//! Insert-only groups checkpoint by persisting the sidecar alone, so
//! flushed bytes stay proportional to the dirty regions instead of the
//! group size. The sidecar carries only the address width and is rejected
//! on mismatch; it is cumulative across append-only flushes and deleted by
//! the base merge that absorbs it.
//! - `ts_g{gid}.bin`: authoritative timestamps for the owning group's edges,
//! falling with the same dirt as the group. Small timestamp writes rewrite
//! only dirty owners, never the whole table.
//! - `props_g{gid}.bin`: property rows for the owning group's edges, falling
//! with the same dirt as the group. Small property writes rewrite only
//! dirty owners, never the whole table.
//! - `segment_stats.bin`: per-group segment statistics collected at the
//! checkpoint for scan pruning, persisted alongside the shards and
//! restored on load.
//!
//! Commit protocol: group bases, sidecars, timestamp shards, property shards
//! and the segment-statistics snapshot are written first (all through atomic
//! shadow files), then the metadata file carrying the manifest tail, and the
//! manifest file is published last as the snapshot commit point. Loading trusts
//! the manifest tail embedded in `meta.bin` when it differs from
//! `groups_manifest.bin`: metadata is published before the manifest, so a torn
//! commit holds new metadata plus the previous manifest file, and the embedded
//! tail already describes the durable group files. A missing tail still means
//! file damage and the load is rejected. The manifest
//! epoch is the snapshot epoch: shadow (`.tmp`) files written before the
//! manifest commit are discardable uncommitted state reclaimed at startup by
//! the shadow cleanup. Only groups holding uncheckpointed writes are written;
//! clean groups are skipped, so flushed bytes stay proportional to dirty
//! groups rather than the table size.
//!
//! Organization (`checkpoint/`):
//! - `layout`: file names, paths and group-file parsing
//! - `snapshot_cache`: frozen snapshot_cache-file sidecar cache
//! - `topology`: group base payloads plus append-log sidecars
//! - `timestamps`: per-group timestamp shards
//! - `properties`: property dirty tracking plus per-group property shards
//! - `segment_stats`: per-group segment statistics snapshot
//! - `commit`: metadata file plus manifest publish
//! - `orphans`: orphan group-file collection
//! - `flush`: incremental flush orchestration and metrics
//! - `load`: incremental load orchestration with torn-commit recovery
pub use ;