Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: stoolap/stoolap
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.2.3
Choose a base ref
...
head repository: stoolap/stoolap
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.2.4
Choose a head ref
  • 13 commits
  • 79 files changed
  • 1 contributor

Commits on Jan 17, 2026

  1. fix: add two-argument form to JSON_TYPE and update JSON docs

    - JSON_TYPE now accepts optional path argument: JSON_TYPE(json, '$.path')
    - JSON_TYPEOF updated to support same signature
    - Added JSON_OBJECT, JSON_ARRAY, JSON_ARRAY_LENGTH to documentation
    - Fixed incorrect limitations section (these functions already exist)
    - Updated introduction and best practices
    semihalev committed Jan 17, 2026
    Configuration menu
    Copy the full SHA
    6fc0a29 View commit details
    Browse the repository at this point in the history
  2. test: add integration tests for JSON functions

    - Add tests for JSON_TYPE with two-argument form (path extraction)
    - Add tests for JSON_TYPE with path on table columns
    - Add tests for JSON_TYPEOF with two arguments
    - Add tests for JSON_TYPE with NULL path argument
    - Add tests for JSON_OBJECT function
    - Add tests for JSON_ARRAY function
    - Add tests for JSON_ARRAY_LENGTH function
    - Add tests for JSON_ARRAY_LENGTH with path (two arguments)
    
    Improves test coverage for codecov patch check.
    semihalev committed Jan 17, 2026
    Configuration menu
    Copy the full SHA
    481fe43 View commit details
    Browse the repository at this point in the history
  3. perf: enable cross-query subquery caching with table-based invalidation

    - Replace per-query cache clearing with table-based invalidation for
      scalar and IN subquery caches
    - Cache entries now track referenced tables for selective invalidation
      on INSERT, UPDATE, DELETE, TRUNCATE
    - Optimize JoinType::parse with zero-allocation byte-level matching
    - Use extend_from_slice instead of extend(iter.copied()) in index code
    
    Nested subquery benchmark: 2390μs → 447μs (5.3x faster)
    semihalev committed Jan 17, 2026
    Configuration menu
    Copy the full SHA
    ce5a7d4 View commit details
    Browse the repository at this point in the history

Commits on Jan 18, 2026

  1. perf: optimize hash maps and bound thread-local caches

    - Add I64Set with custom pre-mixing hash for i64 keys
    - Use WyMix pre-mixing in Value::hash for better FxHash distribution
    - Add StringMap/StringSet type aliases (AHash-backed) for String keys
    - Convert unbounded thread-local caches to LRU-bounded:
      - Scalar/IN subquery caches: 128 entries
      - Semi-join cache: 256 entries
      - Regex caches: 128 entries
    - Add DDL cache invalidation for DROP TABLE/VIEW and ALTER TABLE
    - Switch Value-keyed maps from AHash to FxHash (with WyMix pre-mixing)
    semihalev committed Jan 18, 2026
    Configuration menu
    Copy the full SHA
    dd55afd View commit details
    Browse the repository at this point in the history
  2. refactor: migrate Value-keyed maps to AHash for HashDoS resistance

    - Add ValueMap<V> and ValueSet type aliases using AHash in core/mod.rs
    - Migrate FxHashMap<Value, _> and FxHashSet<Value> to ValueMap/ValueSet:
      - executor/context.rs: semi-join cache, batch aggregate cache
      - executor/subquery.rs: IN expression sets, batch aggregates
      - executor/aggregation.rs: single-column GROUP BY
      - executor/dml.rs: UPDATE precomputed values
      - executor/expression/*: IN operation types and compilation
      - executor/cte.rs: distinct value tracking
      - executor/index_optimizer.rs: hash set extraction
      - parser/ast.rs: InHashSetExpression
      - functions/aggregate/mod.rs: DistinctTracker
    - Add GroupKeyMap<V> type alias in version_store.rs for GroupKey maps
    - Migrate bitmap_index.rs to AHash for CompactArc<Value> keys
    - Keep FxHash for Vec<Value> GROUP BY (raw_entry_mut compatibility)
    - Use AHash for (Value, Value) tuple GROUP BY
    
    AHash provides HashDoS resistance via randomized seeds, important for
    user-controlled data like GROUP BY columns and indexed values. Value::hash()
    retains WyMix pre-mixing for universal hasher compatibility.
    semihalev committed Jan 18, 2026
    Configuration menu
    Copy the full SHA
    46ae8a4 View commit details
    Browse the repository at this point in the history

Commits on Jan 19, 2026

  1. refactor: simplify Row storage and fix transaction isolation bugs

    Storage Simplification:
    - Remove per-value CompactArc wrapper from Row storage
    - Simplify from 3 variants (Shared/Inline/Owned) to 2 (Shared/Owned)
    - Store Arc<[Value]> directly instead of Arc<[CompactArc<Value>]>
    - Add CompactVec::extend_clone() for optimized slice extension
    - String sharing preserved via SmartString::from_string_shared()
    
    Bug Fixes:
    - Fix dirty read vulnerability: Database::clone() now creates independent
      executor with its own transaction state instead of sharing
    - Fix join projection column ordering: use ColumnSource enum to preserve
      SELECT order regardless of join swap optimization
    - Fix ORDER BY + LIMIT with Hash index: return None when index doesn't
      support ordered iteration to fall back to regular query path
    - Fix FULL OUTER JOIN null row handling in nested loop join
    
    Parser Improvements:
    - Better error messages for NULL bytes in string literals
    - Integer overflow now falls back to float parsing
    - Handle Error tokens gracefully in expression parser
    
    Performance:
    - Reduced memory overhead by removing per-value Arc wrapper (~16 bytes/value)
    - extend_clone() is 7x faster than extend(iter().cloned())
    semihalev committed Jan 19, 2026
    Configuration menu
    Copy the full SHA
    8c0418e View commit details
    Browse the repository at this point in the history

Commits on Jan 20, 2026

  1. perf: reduce Value size from 24 to 16 bytes via niche optimization

    Major refactor achieving 33% memory reduction for Value type through
    sophisticated niche optimization techniques.
    
    Key changes:
    
    SmartString (24→16 bytes):
    - Redesigned from enum to packed struct with tag byte
    - Tag values 0-16 used, leaving 17-255 as niches for Value discriminant
    - Inline capacity reduced from 22 to 15 bytes (tradeoff for size)
    
    CompactArc DST support:
    - Extended to support str and [T] with thin pointers (8 bytes)
    - Unified Header with dropper function pointer for type-erased cleanup
    - 50% smaller than std::Arc for DSTs
    
    Value (24→16 bytes):
    - Now uses CompactArc<str> for Json instead of Arc<str>
    - Niche optimization places discriminant in SmartString's unused tag values
    - Option<Value> also 16 bytes (no discriminant overhead)
    
    Performance fixes:
    - row.rs: Use into_vec() instead of to_vec() to avoid cloning Values
    - Index constructors now accept expected_rows for pre-allocation
    
    Panic safety fixes in CompactVec:
    - clone(): Added CloneGuard RAII for proper cleanup on T::clone() panic
    - extend(): Added ExtendGuard RAII for iterator panic safety
    - extend_clone(): Added ExtendCloneGuard RAII for clone panic safety
    - from_iter(): Added FromIterGuard RAII for iterator panic safety
    - Added comprehensive panic safety tests for all fixed methods
    semihalev committed Jan 20, 2026
    Configuration menu
    Copy the full SHA
    bc47351 View commit details
    Browse the repository at this point in the history
  2. perf: add CowBTree for O(1) MVCC snapshots and lock-free reads

    - Introduce Copy-on-Write B+ tree with structural sharing for version store
    - Replace RwLock<BTreeMap> with CowBTreeMap enabling O(1) snapshot cloning
    - Readers clone tree root (atomic increment) then iterate without holding locks
    - Add metadata storage to CompactArc header for O(1) tree size tracking
    - Add extend_copy to CompactVec for fast bulk memcpy of Copy types
    - Optimize transaction commit to avoid Vec<Box<dyn Table>> for read-only txns
    - Rename int_maps → maps and Int64Map → I64Map for consistency
    semihalev committed Jan 20, 2026
    Configuration menu
    Copy the full SHA
    3520bbf View commit details
    Browse the repository at this point in the history

Commits on Jan 21, 2026

  1. refactor: rewrite CowBTree with dual refcount and SAFETY docs

    CowBTree improvements:
    - Introduce dual refcount system (CompactArc count + drop_count) for
      correct concurrent drop coordination
    - Add drop_count (AtomicU32) to NodeHeader for thread-safe V drops
    - Implement rightmost split optimization for sequential inserts
    - Add Entry API with O(1) get via cached path
    - Improve panic safety in deep_clone with incremental set_len
    - Add comprehensive SAFETY comments to all unsafe blocks
    
    Performance optimizations:
    - Remove unnecessary .clone() after versions.read() in VersionStore
    - CowBTree supports lock-free reads without cloning
    
    Documentation:
    - Add SAFETY comments to compact_arc.rs, compact_vec.rs, i64_map.rs
    - Document thread safety, memory layout, and lifetime guarantees
    semihalev committed Jan 21, 2026
    Configuration menu
    Copy the full SHA
    428c9a9 View commit details
    Browse the repository at this point in the history
  2. fix: prevent double-free in CowBTree internal node merge

    Fixed a bug in merge_with_left where moving children out of an internal
    node via ptr::read would still cause Drop to try dropping child 0
    (since for internal nodes, children = len + 1, so len=0 means 1 child).
    
    The fix sets drop_count to 2 before the node is dropped, causing
    NodePtr::drop to skip content dropping entirely.
    
    Also added 14 new tests for internal node borrow/merge operations,
    increasing line coverage from 93% to 96%.
    semihalev committed Jan 21, 2026
    Configuration menu
    Copy the full SHA
    83c34b3 View commit details
    Browse the repository at this point in the history
  3. test: add tests for separator key updates and internal node splits

    - test_update_separator_keys: triggers Ok(i) path when updating keys
      that match separator keys in internal nodes
    - test_reverse_insert_internal_node_split: ensures split_internal()
      is called via reverse order inserts
    semihalev committed Jan 21, 2026
    Configuration menu
    Copy the full SHA
    0610631 View commit details
    Browse the repository at this point in the history

Commits on Jan 22, 2026

  1. perf: reduce MVCC memory footprint via niche optimizations

    - Remove row_id from RowVersion (8 bytes saved per version)
      Row ID is now passed separately where needed
    - Remove chain_depth from VersionChainEntry (8 bytes saved)
      Depth is computed on-demand via O(k) traversal (k <= 254)
    - Use NonZeroU64/NonZeroUsize for arena indices enabling niche opt
      RowIndex reduced from 24 to 16 bytes (33% smaller)
    - Add V2 persistence format without redundant row_id field
      Maintains backward compatibility with V1 format via magic bytes
    - Reuse existing Arc keys in bitmap/btree indexes
      Avoids allocation when value already exists in index
    - Add CompactArc::from_compact_vec for zero-copy Row conversion
      Avoids intermediate Vec allocation in Row::into_arc
    semihalev committed Jan 22, 2026
    Configuration menu
    Copy the full SHA
    6ffad6a View commit details
    Browse the repository at this point in the history

Commits on Jan 24, 2026

  1. chore: release v0.2.4

    - Version bump to 0.2.4
    - Fix import path for ConcurrentI64Map
    semihalev committed Jan 24, 2026
    Configuration menu
    Copy the full SHA
    f358c8b View commit details
    Browse the repository at this point in the history
Loading