debugging

tursodatabase/turso · updated Apr 8, 2026

$npx skills add https://github.com/tursodatabase/turso --skill debugging
0 commentsdiscussion
summary

Debugging tools for Turso database using bytecode comparison, logging, and deterministic simulation.

  • Bytecode comparison workflow identifies whether behavior differences stem from code generation bugs or VM/storage layer issues by comparing SQLite and Turso EXPLAIN output
  • Logging via RUST_LOG environment variable captures detailed traces from turso_core and simulator components during test runs
  • ThreadSanitizer stress tests detect threading issues across configurable thread counts and
skill.md

Debugging Guide

Bytecode Comparison Flow

Turso aims for SQLite compatibility. When behavior differs:

1. EXPLAIN query in sqlite3
2. EXPLAIN query in tursodb
3. Compare bytecode
   ├─ Different → bug in code generation
   └─ Same but results differ → bug in VM or storage layer

Example

# SQLite
sqlite3 :memory: "EXPLAIN SELECT 1 + 1;"

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

Manual Query Inspection

cargo run --bin tursodb :memory: 'SELECT * FROM foo;'
cargo run --bin tursodb :memory: 'EXPLAIN SELECT * FROM foo;'

Logging

# Trace core during tests
RUST_LOG=none,turso_core=trace make test

# Output goes to testing/test.log
# Warning: can be megabytes per test run

Threading Issues

Use stress tests with ThreadSanitizer:

rustup toolchain install nightly
rustup override set nightly
cargo run -Zbuild-std --target x86_64-unknown-linux-gnu \
  -p turso_stress -- --vfs syscall --nr-threads 4 --nr-iterations 1000

Deterministic Simulation

Reproduce bugs with seed. Note: simulator uses legacy "limbo" naming.

# Simulator
RUST_LOG=limbo_sim=debug cargo run --bin limbo_sim -- -s <seed>

# Whopper (concurrent DST)
SEED=1234 ./testing/concurrent-simulator/bin/run

Architecture Reference

  • Parser → AST from SQL strings
  • Code generator → bytecode from AST
  • Virtual machine → executes SQLite-compatible bytecode
  • Storage layer → B-tree operations, paging

Corruption Debugging

For WAL corruption and database integrity issues, use the corruption debug tools in scripts.

See references/CORRUPTION-TOOLS.md for detailed usage.

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.848 reviews
  • Diya Diallo· Dec 24, 2024

    Solid pick for teams standardizing on skills: debugging is focused, and the summary matches what you get after install.

  • Diya Abbas· Dec 12, 2024

    debugging fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • Xiao Martin· Dec 12, 2024

    debugging is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Diya Dixit· Nov 7, 2024

    I recommend debugging for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Mia Khanna· Nov 3, 2024

    We added debugging from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • Kwame Ghosh· Nov 3, 2024

    Useful defaults in debugging — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • Diya Martin· Oct 26, 2024

    Solid pick for teams standardizing on skills: debugging is focused, and the summary matches what you get after install.

  • Diego Harris· Oct 22, 2024

    Keeps context tight: debugging is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Min Verma· Oct 22, 2024

    Registry listing for debugging matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Sophia Harris· Sep 17, 2024

    Registry listing for debugging matched our evaluation — installs cleanly and behaves as described in the markdown.

showing 1-10 of 48

1 / 5