Commit Graph

436 Commits

Author SHA1 Message Date
Pekka Enberg
f72600431b Turso 0.2.0-pre.8 2025-09-24 09:08:34 +03:00
Jussi Saurio
04d364d2d0 Merge 'Differential testing fixes' from Pedro Muniz
- Fixed some incorrect code when running interactions in differential
testing. Instead of replacing the state that was used for running the
interaction, I naively just incremented the interaction pointer.
- adjusted the comparison to check returned values without considering
the order of the rows returned
- added differential testing to run in CI
Closes #3235

Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>

Closes #3255
2025-09-22 22:58:03 +03:00
pedrocarlo
7d1f23dd3a better diffing with similar crate 2025-09-22 15:24:30 -03:00
Pekka Enberg
f6e3beda45 Turso 0.2.0-pre.7 2025-09-22 20:44:08 +03:00
Jussi Saurio
127bc471ff Merge 'Enhancement to Sim Snapshot isolation code' from Pedro Muniz
- Made the code around snapshot isolation more ergonomic with each
connections having its own transaction state. Also when shadowing, we
pass a ShadowTablesMut object that dynamically uses the committed tables
or the connection tables depending on the transaction state.
- added begin concurrent transaction before every property when mvcc is
enabled (this is just so we can have some mvcc code be tested using the
simulator under Begin Concurrent, I have not yet implemented the logic
to have concurrent transactions in the simulator)
- some small enhancements to shrinking
TODOs
- have proper logic to have concurrent transactions without WriteWrite
conflicts. This means when generating the plans we need to make sure
that we do not generate rows that will conflict with rows in other
transactions. This is slightly more powerful than what we do in the
fuzzer, as we just have `WriteWriteConflict` as an acceptable error
there. By baking this `NoConflict` approach to the simulator, we can
continuously test the what does not trigger a WriteWriteConflict and
snapshot isolation.

Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>

Closes #3226
2025-09-22 12:48:36 +03:00
Pekka Enberg
26f90257a6 Turso 0.2.0-pre.6 2025-09-22 11:44:21 +03:00
Pekka Enberg
f4b0fb17f7 Turso 0.2.0-pre.5 2025-09-22 11:34:22 +03:00
Pekka Enberg
fbad158213 Turso 0.2.0-pre.4 2025-09-22 09:15:55 +03:00
Pekka Enberg
6280cfc59d Merge branch 'main' into sync-improvements 2025-09-22 07:35:39 +03:00
Avinash Sajjanshetty
0597ea722a Add encryption throughput test 2025-09-20 21:56:58 +05:30
pedrocarlo
c3cdb0e0fd add begin concurrent before each statement with mvcc 2025-09-20 11:52:15 -03:00
Nikita Sivukhin
7049f3ddae fix clock implementation for OPFS IO 2025-09-19 13:21:00 +04:00
Nikita Sivukhin
66de28d84b wip 2025-09-19 13:19:30 +04:00
Avinash Sajjanshetty
10137ffaa4 run whopper with encryption if arg is passed 2025-09-17 21:58:27 +05:30
pedrocarlo
3c91ae206b move as many dependencies as possible to workspace to avoid multiple versions of the same dependency 2025-09-15 17:19:36 -03:00
Jussi Saurio
26c0d72c25 perf/thrpt: add tracing 2025-09-15 14:25:18 +03:00
pedrocarlo
cc48fa233b add perf/throughput/rusqlite to workspace 2025-09-14 18:29:03 -03:00
pedrocarlo
01a99f84a6 add perf/throughput/turso to workspace 2025-09-14 16:19:34 -03:00
Avinash Sajjanshetty
1536f65f07 move test helper run_query to common module 2025-09-13 11:00:39 +05:30
Avinash Sajjanshetty
3f72de3623 Add checksum module 2025-09-13 11:00:37 +05:30
Pekka Enberg
5df05e05f8 Turso 0.2.0-pre.3 2025-09-12 18:40:06 +03:00
Pekka Enberg
2651b597c6 Turso 0.2.0-pre.2 2025-09-12 17:38:30 +03:00
Jussi Saurio
4f7ffa0e62 Commit uncommitted whopper lockfile 2025-09-12 08:43:59 +03:00
Pekka Enberg
7d8a1a0d5f Merge 'whopper: A new DST with concurrency' from Pekka Enberg
Our simulator is currently limited to concurrency of one. This
introduces a much less sophisticated DST with focus on finding
concurrency bugs.

Closes #2985
2025-09-11 18:42:45 +03:00
Jussi Saurio
7ac18a6952 Merge 'Remove some traces in super hot paths in btree' from Preston Thorpe
Particularly we were tracing `ImmutableRecord` / `BTreeKey` which would
then trace the bytes of records. These are super super hot paths and I
think we can probably remove even more to under debug assertions so we
dont eat those atomics/branches all the time.
This PR also introduces the `tracing_release` feature, which turns all
`trace!` and `debug!` macro invocations to noops at compile time, and
makes that feature available for all bindings.
it also removes the unused `lru` dependency, and cleans up the makefile
a bit

Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>

Closes #2995
2025-09-11 13:33:25 +03:00
Pekka Enberg
ae3c1fc2a6 Turso 0.2.0-pre.1 2025-09-11 11:44:42 +03:00
Pekka Enberg
89d1c9a421 whopper: Switch to mmap2 crate to fix Windows build 2025-09-11 08:35:18 +03:00
Pekka Enberg
a9694c87b1 whopper: A new DST with concurrency
This is a new deterministic simulator for Turso that focuses on finding
concurrency bugs.

You can run whopper with:

```console
penberg@vonneumann turso % SEED=1234 ./whopper/bin/run
   Compiling turso_whopper v0.1.5-pre.3 (/Users/penberg/src/tursodatabase/turso/whopper)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 2.22s
seed = 1234
       .             I/U/D/C
       .             44/19/11/2
       .             68/33/21/2
       |             104/51/29/3
       |             121/69/41/3
      ╱|╲            150/84/51/3
     ╱╲|╱╲           184/97/59/3
    ╱╲╱|╲╱╲          199/105/64/4
   ╱╲╱╲|╱╲╱╲         206/115/69/5
  ╱╲╱╲╱|╲╱╲╱╲        234/138/82/6
 ╱╲╱╲╱╲|╱╲╱╲╱╲       269/164/91/7
```
2025-09-11 08:35:18 +03:00
PThorpe92
f117b2c966 Remove unused lru dependency 2025-09-10 09:55:04 -04:00
Pekka Enberg
e04938eaf5 Turso 0.1.5 2025-09-10 13:30:18 +03:00
Pekka Enberg
1d34122414 Turso 0.1.5-pre.5 2025-09-10 11:40:21 +03:00
Pekka Enberg
77e5190113 Turso 0.1.5-pre.4 2025-09-09 19:57:31 +03:00
Nikita Sivukhin
96a595069c add browser-specific OPFS file system and few other helpers 2025-09-09 11:32:38 +04:00
pedrocarlo
5f24ff6e45 fix non determinism by using IndexSet for order preserving iteration 2025-09-05 02:00:18 -03:00
Pekka Enberg
1511ad354b Turso 0.1.5-pre.3 2025-09-04 11:40:51 +03:00
TcMits
53d239ad1e resolve conflict 2025-09-02 18:46:41 +07:00
Pekka Enberg
3f3125c4f4 Merge 'remove turso_sqlite3_parser from turso_parser' from Lâm Hoàng Phúc
Closes #2888
2025-09-02 14:20:39 +03:00
TcMits
d298480e4a Merge branch 'main' into perf-3 2025-09-02 18:13:58 +07:00
TcMits
07feacbc76 remove turso_sqlite3_parser from turso_parser 2025-09-02 18:10:28 +07:00
Pekka Enberg
6591b66c3d Merge 'Simulate I/O in memory' from Pedro Muniz
Revives the `MemorySim` PR and fixes a page cache issue where we could
have a unlocked and unloaded page in the page cache after a FaultyQuery.
The page would continue in the cache and could affect other queries as
the `page_cache` is at the `Connection` level.
Depends on #2785

Closes #2693
2025-09-02 13:28:48 +03:00
Pekka Enberg
6c7936a016 Turso 0.1.5-pre.2 2025-09-02 12:45:41 +03:00
pedrocarlo
40de4c0606 initial impl for MemorySim 2025-09-01 11:11:25 -03:00
pedrocarlo
c01449e71b add parking_lot to simulator 2025-09-01 11:11:25 -03:00
pedrocarlo
8c7da3a704 impl SimIO for SimulatorIO 2025-09-01 11:11:03 -03:00
Pekka Enberg
d6543ac25c Merge 'Simulator Profiles' from Pedro Muniz
## Changes
- Refactor sql generation to always accept a `Context` trait object so
we can query the current Generation `Opts`. This change allows us to be
more granular in generating our sql statements. It also opens
opportunities for us to add even more knobs to tweak generation as
needed. I tried to make this as generic as possible as I believe this
library can be useful for fuzz testing outside the simulator.
- Introduce `Profile` struct that aggregates the different
configurations needed to execute the simulator. With this Profile struct
we can bias sql generation towards different statements and create
predefined profiles.
`WriteHeavy` Profile:
```rust
Profile {
            query: QueryProfile {
                gen_opts: Opts {
                    // TODO: in the future tweak blob size for bigger inserts
                    // TODO: increase number of rows as well
                    table: TableOpts {
                        large_table: LargeTableOpts {
                            large_table_prob: 0.4,
                            ..Default::default()
                        },
                        ..Default::default()
                    },
                    query: QueryOpts {
                        insert: InsertOpts {
                            min_rows: NonZeroU32::new(5).unwrap(),
                            max_rows: NonZeroU32::new(11).unwrap(),
                        },
                        ..Default::default()
                    },
                    ..Default::default()
                },
                select_weight: 30,
                insert_weight: 70,
                delete_weight: 0,
                update_weight: 0,
                ..Default::default()
            },
            ..Default::default()
        };
```
As you can see we disable the `delete` and `update` weights, decrease
`select` and increase `insert` weights. This means that we disable
updates and deletes in favor of inserting more data and checking the
validity of the database with fewer select statements.
- `Profile` and `Opts` are validated with `garde` and can generate json
schemas with `schemars` so that we can have editor integration when
creating new profiles to play with.
- Added some docs in the README explaining how you can add LSP
integration for the Json config by generating a `JsonSchema` file

Closes #2852
2025-09-01 10:26:33 +03:00
TcMits
73c6070e96 Merge branch 'main' into perf-3 2025-08-31 14:35:58 +07:00
TcMits
190e9bcc95 add match_ignore_ascii_case macro 2025-08-31 14:35:03 +07:00
Pekka Enberg
3c9dbfb09e Turso 0.1.5-pre.1 2025-08-30 18:28:38 +03:00
pedrocarlo
962666831b read Profile file from path or use predefined profiles 2025-08-30 11:31:52 -03:00
pedrocarlo
a1407869d4 add serde, schemars and garde to profiles and options 2025-08-30 11:31:52 -03:00