Commit Graph

440 Commits

Author SHA1 Message Date
pedrocarlo
bb9c8dea4f rework interaction generation to only generate possible queries + do less allocations 2025-10-07 02:36:13 -03:00
pedrocarlo
1d1b09dc17 modify query generation to always sample from valid queries 2025-10-07 02:36:13 -03:00
Jussi Saurio
aab7d989df Merge 'Simulator diff print' from Pedro Muniz
I was trying to debug MVCC simulator and database diffs, and this change
makes it much easier to visualize this. This PR is just a small quality
of life upgrade for debugability.

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

Closes #3548
2025-10-05 18:34:26 +03:00
pedrocarlo
25ad94079c print_diff in ReadYourUpdatesBack + TableHasExpectedContent 2025-10-03 11:34:40 -03:00
pedrocarlo
dc0d4e2dcb print diffs in assert tables 2025-10-03 02:01:14 -03:00
bit-aloo
ff381c1036 clippy'ed 2025-10-02 19:30:57 +05:30
bit-aloo
46fab87634 Replaced manual validation in SimulatorCLI::validate with Clap features:
- Added `conflicts_with` for mutually exclusive flags
- Removed redundant default values for bool flags.
- Dropped manual validation checks in favor of Clap's built-in parsing guarantees.
2025-10-02 19:18:38 +05:30
bit-aloo
460b87fdfb Refactor simulator logger initialization
- Changed `init_logger()` to return `anyhow::Result<()>`
- Removed deprecated usage of `with_ansi`
2025-10-02 19:18:33 +05:30
bit-aloo
889ae2cd78 Remove log and env_logger in favor of tracing
- Deleted `log` and `env_logger` from simulator dependencies
- Migrated remaining `log::error!` and `log::trace!` calls to `tracing` macros
2025-10-02 19:09:09 +05:30
Jussi Saurio
d3c9ef3a5c sim: add Profile::SimpleMvcc
- max 2 connections
- max 1 table
- no faults
- no indexes

Makes discovering very basic bugs in MVCC much easier
2025-10-02 10:14:31 +03:00
pedrocarlo
b624e449bc simulator: reopen database with mvcc when necessary 2025-10-01 11:38:11 -03:00
pedrocarlo
9f95499a55 do not count BEGIN, COMMIT, and ROLLBACK queries as interactions in the InteractionPlan, so we can generate more meaningful intereactions without hitting the max cap quickly 2025-09-27 23:52:57 -03:00
pedrocarlo
13764e6b8e in mvcc if creating a ddl statement, first commit all connections 2025-09-27 23:52:57 -03:00
pedrocarlo
dc1b1469a3 write connection index to sql file 2025-09-27 23:52:57 -03:00
pedrocarlo
461c765b7b fix shrinking extensional queries. Now we only keep queries and/or properties that contain a depending table 2025-09-27 23:52:57 -03:00
pedrocarlo
d3c2198a75 keep track of each pending query for the transaction and then apply the queries on commit 2025-09-27 23:52:57 -03:00
pedrocarlo
399f35f73c for each connection keep track of the tables at the start of the
transaction as well
2025-09-27 23:52:57 -03:00
pedrocarlo
9fd73855d2 after we generated all interactions if some connection is still in a transaction, commit 2025-09-27 23:52:57 -03:00
pedrocarlo
ff9599abe1 do not generate non-conccurent transactions with mvcc 2025-09-27 23:52:57 -03:00
pedrocarlo
bbbdd8c1e2 simplify rusqlite execution 2025-09-27 23:52:57 -03:00
pedrocarlo
009a8188e4 correctly shrink transaction statments across connections 2025-09-27 23:52:57 -03:00
pedrocarlo
df420ab815 consolidate SimulatorEnv rollback code 2025-09-27 23:52:57 -03:00
pedrocarlo
026fd9ae9e add ignore_error flag to interaction so that we fail on errors when executing interactions 2025-09-27 23:52:57 -03:00
pedrocarlo
f2d29ffaaf make transactions truly concurrent with mvcc 2025-09-27 23:52:57 -03:00
pedrocarlo
d070c1c184 rollback active transaction in properties that error is acceptable 2025-09-27 23:52:57 -03:00
pedrocarlo
4cbf861699 use a different seed for gen_rng 2025-09-25 01:20:35 -03:00
pedrocarlo
44c08c02d1 do not shadow interactions when generating the next plan, only after the interaction is ran 2025-09-23 21:57:06 -03:00
pedrocarlo
69d09bcf8c modify code to use runtime generation 2025-09-23 21:57:06 -03:00
pedrocarlo
5f83f3bdfe modify plan generation to generate interactions on demand 2025-09-23 21:57:06 -03:00
pedrocarlo
6569d27bdc compare rows order insensitively for differential testing 2025-09-22 15:33:37 -03:00
pedrocarlo
2cd7c68c35 adjust property generation to not panic by always having some property to select from 2025-09-22 15:24:30 -03:00
pedrocarlo
7d1f23dd3a better diffing with similar crate 2025-09-22 15:24:30 -03:00
pedrocarlo
05034e1f9d instead of incrementing interaction counter, just substitue the current state 2025-09-22 15:24:30 -03:00
pedrocarlo
6e2b0c901e remove PanicGenerationContext and instead just pass the connection context directly 2025-09-21 14:16:46 -03:00
pedrocarlo
0e702fbec2 check FaultyQuery depending tables when shrinking 2025-09-20 12:01:07 -03:00
pedrocarlo
021d5d272a refactor shadowing code to take into account snapshot isolation 2025-09-20 12:01:07 -03:00
pedrocarlo
6b0011f477 in shriking remove unnecessary begin commit queries 2025-09-20 11:52:15 -03:00
pedrocarlo
0293c32616 disable integrity check and indexes when using mvcc 2025-09-20 11:52:15 -03:00
pedrocarlo
850dbc75a2 adjust shrinking to keep previous interactions if there are no depending tables 2025-09-20 11:52:15 -03:00
pedrocarlo
c3cdb0e0fd add begin concurrent before each statement with mvcc 2025-09-20 11:52:15 -03:00
pedrocarlo
13f36880f8 adjust generation code to use the context from the current connection index instead of the whole database 2025-09-20 11:52:15 -03:00
pedrocarlo
c4843d6a6e refactor SimulatorEnv to hold committed tables and separate connection tables for snapshot isolation 2025-09-20 11:52:15 -03:00
pedrocarlo
30538e7898 modify Begin struct 2025-09-20 11:52:15 -03:00
pedrocarlo
c072b0314b fix shrinking 2025-09-18 12:00:18 -03:00
pedrocarlo
27a8f019c6 clippy 2025-09-17 10:49:24 -03:00
pedrocarlo
8b05dcba21 add 10 connections to base profiles 2025-09-17 10:49:24 -03:00
pedrocarlo
6039a30222 fix double create failure 2025-09-17 10:49:24 -03:00
pedrocarlo
81cff3e3d7 fix shrinking to use a secondary index that points to the Property that generated the interactions 2025-09-17 10:49:24 -03:00
pedrocarlo
04154bf368 simplify code for doublecheck testing 2025-09-17 10:49:24 -03:00
pedrocarlo
f95ac87f06 simplify code for differential testing 2025-09-17 10:49:24 -03:00