Repository navigation
Tier 7: Query System — Views, Pipeline, Allocation Optimization - #140
Merged
Merged
Conversation
Fix checkpoint snapshotting pages mid-OLC mutation via ActiveChunkWriters protocol Fix BitmapL3 counter desync on Grow(), ghost bits in SetL1, missing dirty mark in ClearL0 Fix DirtyCounter inflation in WAL mode (ReleaseExcessDirtyMarks caps at 1) Fix segment growth CRC failures with RequestPageEpochUnchecked Fix page cache backpressure deadlock (demand-driven checkpoint flush, 100ms seqlock skip) Switch ChunkAccessor dirty tracking from lazy to eager (MarkSlotDirty + deferred ACW) Add BitmapL3 ReconcileState() self-healing and L0-only fallback mode Add BTreeBase abstract class, KeyToLong, selectivity estimation (histogram + basic) Add WAL writer diagnostics logging and segment read-sharing Extend Shell with custom command dispatch and enhanced diagnostics Added ARPG.Shell with new commands to use in tsh to generate data
…e, bounds validation - VSBS: re-fetch ref rh after slot-evicting ops in AddElement/AddElements/DeleteElement/DeleteBuffer/BufferRelease/BufferAddRef - ChunkAccessor: add chunkId bounds validation in GetChunkAddress (defense-in-depth) - ChunkAccessor: add WarmSiblingAccessorCache (thread-local rent/return for sibling CA) - ChunkBasedSegment: add RentWarmSiblingAccessor/ReturnWarmSiblingAccessor infrastructure - BTree: two-CA split — primary CA for vertical descent, sibling CA for horizontal navigation - BTree.Insert: pass sibAccessor through InsertArguments to SplitRight/SpillRight - BTree.Remove: pass sibAccessor through RemoveArguments to MergeLeft/BorrowLeft/BorrowRight - BTree.Move: rent/return sibAccessor in MovePessimistic/MoveValuePessimistic - BTree.NodeWrapper: add sibAccessor overloads for HandleOverflow/HandleUnderflow/HandleChildMerge - L16/L32/L64/String64BTree: wire sibAccessor through AllocNode and concrete split/merge/borrow - PagedMMF: add SlotRefCount to prevent page eviction while CA slot holds it - PagedMMF.PageInfo: add FilePageIndex validation on slot access - PagedMMF.Metrics: add SlotRefCount tracking - EpochManager/EpochThreadRegistry: add epoch re-stamp support - Transaction: refresh warm cache epochs on commit to bound stale working set - Shell: add echo command with --short/--ms/--us/--full timestamp formats - Shell: set page cache to 1 GiB (128K pages), add comments on int overflow limit - DiagnosticCommandExecutor: minor updates for cache diagnostics
…nowal Engine: - VSBS stale-ref hardening: re-fetch ref rh after slot-evicting ops in AddElement/AddElements/DeleteElement/DeleteBuffer/BufferRelease - ChunkAccessor bounds validation on chunkId before page access - BTree: use SiblingAccessor for VSBS buffer ops to avoid CA slot eviction - PagedMMF: CRC computation on SavePages (CP-07 consistency), infinite wait for IncrementDirty/EnsureDirtyAtLeast (nanosecond hold time) - WAL ring buffer default increased from 4MB to 8MB Shell: - Add db-stats command: file page capacity, per-component segment breakdown (chunk size, used/cap, fill%, pages, data size), totals - Add --nowal flag to bypass WAL for benchmarking/debugging Tests: - Updated ResourceOptionsTests for 8MB ring buffer default
More accurate GenerateItems command.
… stack allocator + in metadata L0 free chunk bitmap. Easier, way faster.
…mark scan, DeferredReclaim batching - VSBS.LockBuffer: TryEnterExclusiveAccess before WaitContext creation, skip timestamp syscall when uncontended - ComputeMinActiveEpoch: scan _highWaterMark slots instead of all 256 - BTree.DeferredReclaim: batch every 64 mutations instead of every insert - Deferred TAIL writes: lazy backfill on first mutation via EnsureTailPopulated
…arm CommitChanges Eliminate per-entity ChunkAccessor create/dispose and warm accessor CommitChanges calls during Transaction.Commit by hoisting accessor creation to per-component-type level and adding batch mode to warm caches.
Removed staled pointers detection in ChunkAccessor (redundant)
…angeSet Move List<int> deferred eviction queue from ChunkAccessor struct to ChangeSet class, keeping the struct blittable for JIT inlining. Remove bounds check from GetChunkAddress.
- ChunkBasedSegment: replace Treiber stack with lock-free forward linked list, to solve high contention issues. - Fixed small bug in B+Tree split. - Unit tests are now more reliable, many bug fixes dues to exception being thrown in threads, an AssemblyWarmup type exec first to JIT all the code ahead of tests execution.
- PipelineExecutor: caller-provided result collections (HashSet/List) instead of internal allocation; Views reuse _entityIds directly, eliminating intermediate HashSet + O(n) copy on RefreshFull - PipelineExecutor: dedicated Count<T> path with zero-collection counting, including fused secondary index streaming (no intermediate List) - ViewDeltaRingBuffer: single PinnedMemoryBlock allocation via IMemoryAllocator (was 5 separate NativeMemory), deltaTSN int→long fixing overflow on long-running views, DefaultCapacity 8192→4096 - ViewRegistry: DeregisterView now removes all registrations per view (multi-tag fix) - PlanBuilder: insertion sort replaces Array.Sort delegate, eliminating closure allocation - CollectPKsTyped: List pre-sized from plan estimates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #60 — Complete Query System implementation including persistent Views with microsecond-level incremental refresh.
Core Query/View Infrastructure (#121–#126)
Query Pipeline (#127)
Allocation Optimization (final pass)
_entityIdsdirectly on RefreshFull (zero intermediate allocation + copy)Ancillary Work
Test plan
🤖 Generated with Claude Code