From 6a28879bd56354483fe940c0c80d511eccb89983 Mon Sep 17 00:00:00 2001 From: eunhhu Date: Fri, 25 Sep 2026 09:33:43 +0100 Subject: Add selected single-file persistent tree store store-tree.c keeps every document in one append-only file as a persistent B-tree of byte extents, with the key catalog in the same structure. A splice writes only the changed leaf and path; unchanged extents are shared between versions, readers take no lock, and two alternating head slots publish a commit after its nodes are durable. Compaction rewrites reachable nodes. On the recorded ext4 host a durable 1-byte middle insert into a 1 MiB document took 8.58 ms against 78.51 ms for the default store, and the real TUI's Ctrl+S after typing took 16.60 ms against 84.59 ms. check-tree runs the store's crash/oracle tests and the unchanged runtime, splice, async and real-PTY editor checks on it. It stays opt-in: linked code is 12.7 KB larger and contiguous multi-leaf reads copy. --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 75698e6..2ae94db 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,18 @@ page-store assertions plus a 1 MiB native CLI edit and stale-revision check. Physical-disk durability, Linux x86_64 CI and macOS remain unverified; the default core and storage path are unchanged. +The [selected single-file persistent tree](docs/research/073-single-file-persistent-tree.md) +questions the one-contiguous-file-per-document model instead. All documents +share one append-only file of immutable extents. An insert, delete or append +writes only the changed leaf and path, and unchanged extents are shared +between versions. On the same ext4 host, a durable 1-byte middle insert into a +1 MiB document took 8.58 ms against 78.51 ms for the default store. The real +TUI's Ctrl+S after typing one character took 16.60 ms against 84.59 ms. The +unchanged runtime, splice, async and real-PTY TUI checks pass on it +(`make -C prototypes/connections check-tree`). Its linked CLI is 12,710 B +larger, contiguous reads of multi-leaf documents copy, and space is reclaimed +only by compaction, so it remains an opt-in profile. + The current execution profile has separate `core`, `fixed-editor`, `editor`, and `server` build targets. `make all` produces the core and the parser-free CLI from the build-time prepared `editor.pure`; it also builds a compiler tool that -- cgit v1.2.3