git diff (all uncommitted changes)git status (staged deletions: mutation_core.rs, prefix_helpers.rs)rg scans across all src/persistent_artrie_char/docs/design/slice3-l33c-execution-plan-2026-06-09.mdmod.rs:425 — self.root: RwLock<CharTrieRoot<V>> fieldmod.rs:1666-1707 — owned checkpoint block (capture_snapshot call)mod.rs:578 — Debug impl .field("root", ...)mmap_ctor.rs:6 sites — root: RwLock::new(CharTrieRoot::Empty) from constructorsio_uring_ctor.rs:2 sites — same root field initializationf5_loader.rs:~85 — *self.root.get_mut() = CharTrieRoot::Empty;query_api.rs:~44 — owned_try_contains()query_api.rs:~68 — owned_get()query_api.rs:~101 — owned_try_get()prefix_api.rs:~22-144 — owned_iter_prefix(), owned_iter_prefix_with_values(), owned-tree branchesatomic_ops.rs:~117 — try_increment_impl_no_wal()persist.rs:~244 — persist_to_disk()persist.rs:~254 — persist_to_disk_tracked()persist.rs:~275 — capture_snapshot() (123 LOC)mutation_core.rs — ENTIRE FILE (STAGED FOR DELETION)prefix_helpers.rs — ENTIRE FILE (STAGED FOR DELETION)mod.rs — module declarations for mutation_core and prefix_helpersSharedCharARTrie::root() (mod.rs:1371)fn from_trie<S: BlockStorage>(trie: &PersistentARTrieChar<V, S>) -> Self {
let faulter: Option<*const dyn CharNodeFaulter<V>> =
Some(trie as &dyn CharNodeFaulter<V> as *const dyn CharNodeFaulter<V>);
let root_node_ptr: Option<*const CharTrieNodeInner<V>> = {
let guard = trie.root.read(); // ← LINE 999: ERROR — field deleted
match &*guard {
types::CharTrieRoot::Empty => None,
types::CharTrieRoot::Node(node) => Some(node.as_ref() as *const _),
}
};
...
}
from_trie; collapse SharedCharARTrie::root() to overlay-only (§2.1)transition() and edges() (lines 1179, 1185, 1217, 1245+)SharedCharARTrie::root() (now deleted owned arm)from_trie is deletednode: Option<*const CharTrieNodeInner<V>> — owned arm (LIVE in transition/edges)is_root: bool — owned arm (LIVE in transition/edges line 1164)root_empty: bool — owned arm (LIVE in transition/edges line 1164, 1206)faulter: Option<*const dyn CharNodeFaulter<V>> — owned arm (LIVE in transition line 1170+)pin: Option<Arc<CharWalkGuard>> — used by both arms (KEEP)transition(), edges(), Debug impl; keep overlay armEmpty, Node(Box<CharTrieNodeInner<V>>)from_trie() match (line 1000-1002)char_append_term_by_term_with_owned_checks (lines ~2400-2580)trie.owned_try_contains(t) (lines 2420, 2522, 2523, 2560)if self.root_empty {
return None;
}
let ptr = self.node?;
let node_ref = unsafe { &*ptr };
match self.faulter { ... } // fault child or resident lookup
transition() — faults children from owned nodepub fn root(&self) -> PersistentARTrieCharNode<V> {
if self.route_overlay() {
return Self::overlay_root(...); // ← OVERLAY ARM
}
// OWNED ARM (below) — MUST DELETE
let guard = self.read();
let pin = Arc::new(CharWalkGuard { ... });
let mut node = PersistentARTrieCharNode::from_trie(&guard);
node.pin = Some(Arc::clone(&pin));
node
}
Status: ✓ SAFE TO DELETE
apply_core_recovered_operation_no_wal is NOT DEFINED in char crate (only a comment at mmap_ctor.rs:1101)try_increment_impl_no_wal deletion is SAFEStatus: ✗ NOT YET ADDRESSED
load_root_from_disk (line 36)resolve_swizzled_ptr* (lines 1123, 1213) — UNSAFE rows 4-10load_char_node_from_disk* (lines 401, 744, 852) — all except lazy (508)Status: ✗ NOT YET ADDRESSED
trie.owned_try_contains() (deleted from query_api.rs)Status: ✓ VERIFIED
mutation_core or prefix_helperschar-disk-swizzled-pointer-resolutionchar-disk-node-map-resolutionchar-disk-box-ownershipchar-walk-guard-faulter-traversalchar-public-node-traversalchar-mutation-core-traversalchar-mutation-core-unique-borrowchar-disk-page-alignment etc.char-public-node-send-syncSharedCharARTrie::root() to overlay-only (delete from_trie/CharWalkGuard call)from_trie, from_ptr, CharWalkGuardtransition() and edges()CharTrieRoot enumget_or_create_child, remove_child from types.rsload_root_from_disk, resolve_swizzled_ptr*, load_char_node_from_disk* (except lazy)owned_try_contains (persist.rs ~2420-2560)PersistentARTrieCharNode (Debug impl, etc.)cargo check --all-features — verify: ZERO errors, dead-code warnings match KEEP listnextest run — all tests passverify-formal-correspondence.sh — ZERO errorsverify-unsafe-boundary-inventory.sh — DELTA matches rows 4-16,19-20 + 7 tagsLocation: from_trie function, line 999
Error: trie.root — field does not exist
Cascade:
root deleted from struct definition (mod.rs:425)from_trie (line 983) still tries to read itfrom_trie called by SharedCharARTrie::root() (line 1371)SharedCharARTrie::root() is the public API for creating root handlesFix (§2.1 of plan):
SharedCharARTrie::root() to return overlay node onlyfrom_trie, from_ptr, CharWalkGuardmod.rs (line 1355-1375)from_trie, from_ptr, CharWalkGuard become unused → dead-code warningsmod.rs (transition/edges)disk_io.rsload_root_from_disk (36), resolve_swizzled_ptr* (1123, 1213), load_char_node_from_disk* (401, 744, 852)load_char_node_from_disk_lazy (508), load_overlay_node_from_disk (625)types.rsCharTrieRoot (753), get_or_create_child (680), remove_child (717)persist.rschar_append_term_by_term_with_owned_checks (or rewrite for overlay)formal-verification/UNSAFE_INVENTORY.tsv, UNSAFE_CONTRACTS.tsvTotal lines to DELETE (estimated):
Owned-arm survivor (currently LIVE, post-C2 cleanup):
Execute in strict order:
SharedCharARTrie::root() (let compiler flag next errors)This approach ensures the compiler acts as a fail-closed safety net: if any live caller was missed, the build fails immediately.
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |