Files
turso/core/Cargo.toml
Sushant Dinesh e0d40b9d70 core/mvcc: annotate and instrument logical-log durability invariants
Capture the logical-log and MVCC crash-recovery durability invariants as
opt-in aristo-instr accessors a fault-injection conformance harness needs
to observe private LogicalLog state:

  logical_log_header_publish_after_fsync            write_header
  logical_log_inmemory_offset_advances_after_durable_write
                                                    advance_offset_after_success
  logical_log_pending_crc_cleared_on_abort          discard_pending_log_write
  logical_log_shadow_offset_matches_durable         Storage::truncate
  logical_log_truncate_crc_reseed_after_completion  LogicalLog::truncate
  mvcc_recovered_schema_record_wellformed           sqlite_schema_btree_identity
  mvcc_recovery_total_on_committed_log              recover_process_frame

The annotations are natural-language behavioral specs (five bind to the
aretta canon). The instrumentation — Inspect projections for
LogicalLog.header / pending_running_crc, a read_logicallog_offset_crc
accessor, and expose_pub(new_for_test) on LogRecord::new — lives behind a
new aristo-instr cargo feature, off by default, so production builds carry
zero instrumentation.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-20 09:20:00 +00:00

267 lines
7.0 KiB
TOML

# Copyright 2023-2025 the Turso authors. All rights reserved. MIT license.
[package]
name = "turso_core"
version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
description = "The Turso database library"
[lints]
workspace = true
[lib]
name = "turso_core"
path = "lib.rs"
[features]
default = ["fs", "uuid", "time", "json", "series", "encryption", "percentile"]
tracing_release = ["tracing/release_max_level_info"]
conn_raw_api = []
# Harness-side observability: turns on aristo's instrument surface so the
# logical-log conformance DTs can read private LogicalLog state (header
# version, pending running CRC) and construct LogRecords. Off by default;
# production builds carry zero instrumentation.
aristo-instr = ["aristo/aristo_instrument"]
fs = ["turso_ext/vfs"]
json = []
uuid = ["dep:uuid"]
io_uring = ["dep:io-uring", "rustix/io_uring"]
experimental_win_iocp = []
time = []
fuzz = []
omit_autovacuum = []
simulator = ["fuzz", "serde", "io_memory_yield", "allocation_metric"]
allocation_metric = []
# Test only: exposed to testing/stress and the simulator, never to regular library users.
io_memory_yield = []
serde = ["dep:serde"]
series = []
encryption = []
pure-rust-crypto = ["aegis/pure-rust"]
checksum = []
cli_only = []
test_helper = []
bench = []
nanosecond-bench = ["bench"]
fts = ["dep:tantivy"]
codspeed = ["bench"]
optimizer_params = ["serde", "dep:serde_json"]
stacker = ["dep:stacker"]
percentile = []
[target.'cfg(target_os = "windows")'.dependencies]
windows-sys = { version = "0.61.2", features = [
"Win32_System_IO",
"Win32_System_Memory",
"Win32_System_SystemInformation",
"Win32_System_Threading",
"Win32_Storage_FileSystem",
"Win32_Security",
"Win32_System_Diagnostics_Debug",
] }
[target.'cfg(target_os = "linux")'.dependencies]
io-uring = { version = "0.7.5", optional = true }
libc = { version = "0.2.172" }
[target.'cfg(target_family = "unix")'.dependencies]
polling = "3.7.4"
rustix = { version = "1.0.5", features = ["fs"] }
libc = { version = "0.2.172" }
[target.'cfg(not(target_family = "wasm"))'.dependencies]
libloading = "0.8.6"
tantivy = { version = "0.26.0", optional = true }
[dependencies]
# aristo SDK from crates.io (0.4.x — latest; also carries the aristo::instrument
# surface behind the `aristo_instrument` feature, for future state-exposure
# accessors). Was a local sibling path (../../aristo) pre-OSS; the conformance
# harness resolves aristo + aristo-macros from crates.io, so no vendored mount
# / path-rewrite is needed.
aristo = "0.4"
turso_ext = { workspace = true, features = ["core_only"] }
cfg_block = "0.1.1"
fallible-iterator = { workspace = true }
allocator-api2 = { workspace = true }
hex = { workspace = true }
icu_collator = "2.2.0"
icu_locale = "2.2.0"
thiserror = { workspace = true }
regex = { workspace = true }
regex-syntax = { workspace = true, default-features = false, features = [
"unicode",
] }
chrono = { workspace = true, default-features = false, features = ["clock"] }
rand = { workspace = true }
libm = "0.2"
turso_macros = { workspace = true }
miette = { workspace = true }
strum = { workspace = true }
parking_lot = { workspace = true, features = ["arc_lock"] }
crossbeam-epoch = "0.9.18"
crossbeam-utils = "0.8.21"
tracing = { workspace = true }
ryu = "1.0.19"
uncased = "0.9.10"
strum_macros = { workspace = true }
bitflags = { workspace = true }
serde = { workspace = true, optional = true, features = ["derive"] }
serde_json = { workspace = true, optional = true }
pastey = "0.2.1"
uuid = { version = "1.11.0", features = ["v4", "v5", "v7"], optional = true }
tempfile = { workspace = true }
pack1 = { version = "1.0.0", features = ["bytemuck"] }
bytemuck = "1.23.1"
aes-gcm = { version = "0.10.3" }
aes = { version = "0.8.4" }
turso_parser = { workspace = true }
twox-hash = "2.1.1"
intrusive-collections = "0.9.7"
roaring = "0.11.2"
arc-swap = "1.7"
rustc-hash = "2.0"
either = { workspace = true }
tracing-subscriber.workspace = true
rapidhash = "4.1.1"
branches = { version = "0.4.3", default-features = false }
bumpalo = { version = "3", features = ["collections"] }
smallvec = "1.15.1"
fastbloom = { version = "0.14.1", default-features = false }
crc32c = "0.6.8"
bigdecimal = "0.4"
num-bigint = "0.4"
num-traits = "0.2"
stacker = { version = "0.1", optional = true }
[target.'cfg(not(any(target_family = "wasm", all(target_os = "windows", target_arch = "aarch64"))))'.dependencies]
simsimd = "6.5.3"
[target.'cfg(antithesis)'.dependencies]
antithesis_sdk = { workspace = true, features = ["full"] }
serde_json = { workspace = true }
[target.'cfg(loom)'.dependencies]
loom = { workspace = true }
[target.'cfg(shuttle)'.dependencies]
shuttle = { workspace = true }
# Use pure-rust for Android and MacOS to avoid C cross-compilation issues.
# Other targets can opt in via the `pure-rust-crypto` feature.
[target.'cfg(any(target_os = "android", target_os = "macos"))'.dependencies]
aegis = { version = "0.9.8", features = ["pure-rust"] }
[target.'cfg(not(any(target_os = "android", target_os = "macos")))'.dependencies]
aegis = { version = "0.9.8" }
[build-dependencies]
cfg_aliases = "0.2.1"
[target.'cfg(not(target_family = "windows"))'.dev-dependencies]
pprof = { version = "0.14.0", features = ["criterion", "flamegraph"] }
[dev-dependencies]
memory-stats = "1.2.0"
serde_json = { workspace = true }
criterion = { workspace = true, features = [
"html_reports",
"async",
"async_futures",
] }
codspeed-criterion-compat = { workspace = true, features = [
"html_reports",
"async",
"async_futures",
] }
rstest = "0.18.2"
rusqlite = { workspace = true, features = ["series"] }
quickcheck = { version = "1.0", default-features = false }
quickcheck_macros = { version = "1.0", default-features = false }
rand_chacha = { workspace = true }
env_logger = { workspace = true }
test-log = { version = "0.2.17", features = ["trace"] }
sorted-vec = "0.8.6"
mimalloc = { workspace = true, default-features = false }
divan.workspace = true
[[bench]]
name = "benchmark"
harness = false
[[bench]]
name = "count_benchmark"
harness = false
[[bench]]
name = "mvcc_benchmark"
harness = false
[[bench]]
name = "mvcc_recovery_benchmark"
harness = false
[[bench]]
name = "logical_log_serialization"
harness = false
required-features = ["bench"]
[[bench]]
name = "json_benchmark"
harness = false
[[bench]]
name = "tpc_h_benchmark"
harness = false
[[bench]]
name = "sql_functions"
harness = false
required-features = ["bench"]
[[bench]]
name = "alloc_collections"
harness = false
[[bench]]
name = "hash_spill_benchmark"
harness = false
required-features = ["bench"]
[[bench]]
name = "write_perf_benchmark"
harness = false
[[bench]]
name = "create_index_benchmark"
harness = false
[[bench]]
name = "fts_benchmark"
harness = false
required-features = ["fts"]
[[bench]]
name = "graph_queries_benchmark"
harness = false
[[bench]]
name = "triggers"
harness = false
[[bench]]
name = "struct_union_benchmark"
harness = false
[[bench]]
name = "struct_union_profile"
harness = false
[[bench]]
name = "prepare_params_benchmark"
harness = false