Skip to content

feat(flist): add Adaptive Radix Tree backend behind art feature - #2493

Merged
oferchen merged 1 commit into
masterfrom
feat/flist-art
Feb 26, 2026
Merged

oferchen merged 1 commit into
masterfrom
feat/flist-art

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Adds optional ART-backed data structures (rart 0.3.1) to the flist crate behind the art feature flag
  • New ArtFileList type provides O(k) sorted insertion, prefix range queries, and ordered iteration without explicit sort passes
  • New sort.rs strategy dispatch module centralizes ART-vs-sort logic (Strategy Pattern), eliminating 4 duplicated #[cfg] blocks in parallel.rs and 2 in file_list_walker.rs
  • ART-backed BatchedStatCache using VersionedAdaptiveRadixTree with Mutex for thread-safe metadata caching
  • ART-backed visited set in FileListWalker for symlink cycle detection
  • All keys use null-terminated VectorKey (via path_to_art_key) to satisfy the ART prefix-free key invariant

Design Patterns Applied

  • Strategy Pattern: sort.rs dispatches between ART insertion sort and sort_unstable at compile time via feature flags
  • Dependency Inversion: Callers depend on sort::sort_file_entries() abstraction, not on rart types directly
  • Single Responsibility: art_file_list.rs owns the ART file list type, sort.rs owns the sorting strategy dispatch

Test plan

  • cargo fmt --all -- --check
  • cargo clippy -p flist --all-targets --all-features --no-deps -D warnings
  • cargo clippy -p flist --all-targets --no-default-features --no-deps -D warnings
  • cargo clippy -p flist --all-targets --features art --no-deps -D warnings
  • cargo nextest run -p flist --no-default-features (469 tests)
  • cargo nextest run -p flist --features art (475 tests)
  • cargo nextest run -p flist --features art,parallel (522 tests)
  • cargo nextest run -p flist --all-features (522 tests)

Add optional ART-backed data structures (rart 0.3.1) to the flist crate
for O(k) sorted insertion and prefix range queries on file lists.

- New art_file_list.rs: ArtFileList type with insert, get, iter,
  prefix_range, into_sorted_vec, FromIterator impl
- New sort.rs: strategy dispatch module centralizing ART-vs-sort choice
  so callers use a single function instead of duplicated cfg blocks
- batched_stat.rs: ART-backed BatchedStatCache using
  VersionedAdaptiveRadixTree with null-terminated keys
- file_list_walker.rs: ART-backed visited set and directory sorting
- parallel.rs: 4 sort sites simplified to sort::sort_file_entries()
  and sort::sort_dir_entries() calls

All paths use null-terminated VectorKeys (via path_to_art_key) to
satisfy the ART prefix-free key invariant. All 4 feature combinations
(none, art, parallel, art+parallel) pass fmt, clippy, and 469-522 tests.
@github-actions github-actions Bot added the enhancement New feature or request label Feb 26, 2026
@oferchen
oferchen merged commit 126dbf6 into master Feb 26, 2026
31 checks passed
@oferchen
oferchen deleted the feat/flist-art branch February 26, 2026 13:18
oferchen added a commit that referenced this pull request May 1, 2026
Add optional ART-backed data structures (rart 0.3.1) to the flist crate
for O(k) sorted insertion and prefix range queries on file lists.

- New art_file_list.rs: ArtFileList type with insert, get, iter,
  prefix_range, into_sorted_vec, FromIterator impl
- New sort.rs: strategy dispatch module centralizing ART-vs-sort choice
  so callers use a single function instead of duplicated cfg blocks
- batched_stat.rs: ART-backed BatchedStatCache using
  VersionedAdaptiveRadixTree with null-terminated keys
- file_list_walker.rs: ART-backed visited set and directory sorting
- parallel.rs: 4 sort sites simplified to sort::sort_file_entries()
  and sort::sort_dir_entries() calls

All paths use null-terminated VectorKeys (via path_to_art_key) to
satisfy the ART prefix-free key invariant. All 4 feature combinations
(none, art, parallel, art+parallel) pass fmt, clippy, and 469-522 tests.
oferchen added a commit that referenced this pull request May 5, 2026
Add optional ART-backed data structures (rart 0.3.1) to the flist crate
for O(k) sorted insertion and prefix range queries on file lists.

- New art_file_list.rs: ArtFileList type with insert, get, iter,
  prefix_range, into_sorted_vec, FromIterator impl
- New sort.rs: strategy dispatch module centralizing ART-vs-sort choice
  so callers use a single function instead of duplicated cfg blocks
- batched_stat.rs: ART-backed BatchedStatCache using
  VersionedAdaptiveRadixTree with null-terminated keys
- file_list_walker.rs: ART-backed visited set and directory sorting
- parallel.rs: 4 sort sites simplified to sort::sort_file_entries()
  and sort::sort_dir_entries() calls

All paths use null-terminated VectorKeys (via path_to_art_key) to
satisfy the ART prefix-free key invariant. All 4 feature combinations
(none, art, parallel, art+parallel) pass fmt, clippy, and 469-522 tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant