Debugging guide for tursodb covering bytecode diffs, tracing logs, ThreadSanitizer, seeded simulation, stack measurement, and corruption analysis.

skills.sh installs
1.3K
GitHub stars
25.3K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers EXPLAIN bytecode comparison against SQLite, RUST_LOG tracing, ThreadSanitizer runs, seeded simulator replays, and stack usage measurement
  • Includes scripts/stack/ helpers (frame-sizes.sh, min-stack.sh, stack-profile.sh) and scripts/corruption-debug-tools/ for WAL and integrity failures
  • Notes that make test sets RUST_LOG=off, so logs require cargo run or cargo test instead
  • Designed for Turso developers isolating whether a mismatch lies in code generation, the VM, or the storage layer

Install

$ npx -y skills add tursodatabase/turso --skill debugging -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Debugging Guide

Bytecode Comparison

When Turso and SQLite give different results, run EXPLAIN on both:

sqlite3 :memory: "EXPLAIN SELECT 1 + 1;"
cargo run --bin tursodb :memory: "EXPLAIN SELECT 1 + 1;"

Different bytecode means a bug in code generation (core/translate/). Same bytecode with different results means a bug in the VM or storage layer.

Logging

tursodb logs with tracing. It reads RUST_LOG (default level: warn) and writes to stderr, or to a file with -t <file> (--tracing-output).

RUST_LOG=turso_core=trace cargo run --bin tursodb -- -t /tmp/turso.log :memory: 'SELECT 1;'

Logs can reach megabytes. make test sets RUST_LOG=off, so use cargo run or cargo test to get logs.

Threading Issues

Run the stress test under ThreadSanitizer. It needs a nightly toolchain with the rust-src component, and --target set to the host target (x86_64-unknown-linux-gnu on Linux, aarch64-apple-darwin on Apple Silicon):

RUSTFLAGS="-Zsanitizer=thread" cargo +nightly run -Zbuild-std --target x86_64-unknown-linux-gnu \
  -p turso_stress -- --vfs syscall --nr-threads 4 --nr-iterations 1000

Details

Repository
github.com/tursodatabase/turso
Categories
Debugging, Rust, Databases
First seen
May 16, 2026

More from tursodatabase/turso

All 7

Similar to Debugging

More Debugging