Conversation
tisonkun
marked this pull request as draft
September 15, 2026 08:06
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
Cache::open_with_handle(path, config, handle)withCache::open(path, config).Design Notes
Opening and closing each use a short-lived lifecycle thread and an AsyncBand channel with capacity one. Close still fences admission immediately and completes even if its returned future is never polled or is dropped. The bounded channel keeps the completion handoff visible to ThreadSanitizer; AsyncBand 0.7's oneshot uses atomic fences, which ThreadSanitizer does not support.
A shared
async-io::Timerpreserves read admission deadlines, I/O cancellation grace periods, and FIFO admission. These waits bound existing operations; no request-path retries are introduced. Lifecycle thread stacks and timer infrastructure remain outside the managed-memory budget. Using an independent timer addsasync-ioand its transitive dependencies.Tokio remains in tests and benchmarks, and
crc-fastremains only as an independent test reference. Tests cover driverless open/read/recovery/close, cache use after its opening executor is dropped, deadline wakeups and capacity reclamation, lifecycle cancellation and panics, and CRC compatibility for fragmented records and pages.Validation:
cargo x check,cargo x lint --fix(including packaging and dependency policy checks),cargo +1.98.0 x test(including extended tests),cargo +1.98.0 test --workspace --release --all-features, and benchmark compilation passed locally. Normal/build dependency trees on macOS and Linux contain neither Tokio norcrc-fast.Local benchmark: Apple M4 Max, macOS 26.6.2, Rust 1.98.0; five alternating-order pairs comparing
03d4fdewith3f875e3. The existingcachebenchmark used 32,768 entries of 16 KiB, 1 GiB L2, 256 MiB L1, buffered POSIX I/O, four read workers, and statistics disabled. Each L2 phase reads every entry once; the resident L1 phase performs 262,144 reads. Immediate uses four L2 clients; Wait uses eight clients, a 100 ms admission timeout, and capacity for 16 waiters. Medians:The L2 throughput regression remains a review tradeoff for removing runtime coupling. In the same Immediate/Wait runs, put-plus-drain throughput changed by -5.8%/+2.0%, resident L1 by +4.5%/-0.6%, and warm-close time by 126→145 ms / 131→139 ms. All runs passed value/tier validation and L2 reads reported no errors. Percentiles are log2 histogram upper bounds. These short warm-page-cache runs are local preflight evidence, not Linux/NVMe qualification or proof of equivalent performance.