From 65386f68fb53e5a9a20a284b06afd872172c30eb Mon Sep 17 00:00:00 2001 From: eunhhu Date: Fri, 25 Sep 2026 09:34:34 +0100 Subject: Let the runtime own working versions as drafts state.h gives any app a runtime-owned working version of a stored value on the tree store. A draft shares unchanged extents with the stored version, edits in memory by path copying, lends ordered extents without copying, and commits only its new nodes when the key is still at its base revision. A failed commit changes neither the draft nor the store; a draft whose file was replaced by compaction copies its stored extents on commit. Unreachable arena nodes are reclaimed once they outweigh max(reachable, 32 KiB). Typing into the middle of a 1 MiB document and saving each character peaked at about 1,660 KiB RSS with a draft against about 4,480 KiB for an app copy compared with storage on save; saves were only 1-2 ms faster. This corrects 073, which had attributed the TUI's remaining 8 ms to that comparison. Drafts are not yet charged to the runtime budget or visible to .pure definitions. --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 2ae94db..4516cce 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,15 @@ unchanged runtime, splice, async and real-PTY TUI checks pass on it larger, contiguous reads of multi-leaf documents copy, and space is reclaimed only by compaction, so it remains an opt-in profile. +On that store the runtime can own an app's working version +([drafts](docs/research/074-runtime-owned-drafts.md), `state.h`). A draft +shares unchanged extents with the stored version, lends ordered extents +without copying, and commits only its new nodes. Typing into the middle of a +1 MiB document and saving each character peaked at 1,648–1,664 KiB RSS with +drafts. An app copy that is compared with storage on save peaked at +4,464–4,496 KiB. Saves were only about 1–2 ms faster; drafts are not yet +exposed to `.pure` definitions or charged to the runtime budget. + 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