Skip to main content

Crate kernel

Crate kernel 

Source

Re-exports§

pub use page::FORMAT_VERSION;

Modules§

btree
A B+tree over the buffer pool.
budget
Shared reservation arithmetic. Currently the page arena uses this ledger; it is not a whole-process RSS cap. Constrained stores additionally bound WAL/record sizes and allocator bookkeeping counts through ResourceLimits. Exhaustion is fallible, including arithmetic overflow.
bulk
Building a large tree by repeated insertion means one descent and one random write per key. Sorting first and packing bottom-up means one sequential pass.
geomath
2i: PostGIS-geography math, ported from e1 (already calibrated equal to PostGIS to float precision there). Distances = Vincenty’s inverse formula on the WGS84 ellipsoid, in METRES; areas = spherical excess on the authalic sphere, in SQUARE METRES; point-in-polygon = planar even-odd crossing in coordinate space (the named subset deviation: correct away from poles/antimeridian; geography-PostGIS itself offers ST_Covers for the sphere-true predicate). Functions take (lat, lon) – PostGIS textual order; GeoJSON stores [lon, lat] and converters own the flip. Rings use the internal [[lat, lon], …] layout.
graph
The graph: a key discipline over the phase-1 store. No structure of its own.
io
All operating-system contact lives here. Everything above this module is arithmetic over byte arrays and is platform-neutral by construction.
keys
The keyspaces. Extensibility = new tags, never new structures.
limits
Explicit limits for the constrained entry writer. Stored in both checked metadata publications. Ordinary stores keep their existing WAL commit mode.
meta
Page 0: the superblock. Roots of every tree, and the format version.
nav
2k: the vector navigation tier (FACT-02’s graph stage).
page
One page format for the whole file.
pool
A fixed array of frames, allocated once and never grown.
readers
2n: the reader table – how the writer learns the oldest generation any live snapshot reader still needs, so page recycling never pulls a page out from under one.
recover
Recovery primitives and source-preserving salvage.
score
2l: hybrid scoring – the kernel primitive SGQL’s ScoreExpr lowers onto.
spatial
2i: space as a key discipline (FACT-04, D31).
store
The store ties the pool, the log and the tree together and owns the two orderings that durability depends on.
text
2h: full-text search as key discipline (FACT-03).
vecquant
2g: data-oblivious vector fingerprints (TurboQuant-style, arXiv 2504.19874).
verify
Structural verification. verify_published_tree is public so a live database’s shape can be proven after a graft; the rest stays internal. Independent verification for replacement trees.
wal
Write-ahead log. Frame layout, little-endian: 0 len u32 payload length 4 lsn u64 12 kind u8 13 pad u8 x3 16 crc32c u32 over the 16-byte header with crc zeroed, then payload 20 payload

Enums§

Error

Functions§

bench_edges
The gate’s edge formula, shared so e3 and the SQLite harness traverse the IDENTICAL logical graph: per src, 2 near edges (locality) + 2 far (cross).

Type Aliases§

Result