Commit graph

56 commits

Author SHA1 Message Date
Pekka Enberg
90c1e3fc06 Switch Connection to use Arc instead of Rc
Connection needs to be Arc so that bindings can wrap it with `Mutex` for
multi-threading.
2025-06-16 10:43:19 +03:00
pedrocarlo
83d72db901 better error messages + cleaner printing of file stats + tracing
instrumentation in `execute_interaction`
2025-06-11 11:32:45 -03:00
pedrocarlo
e19fa9f951 add additional cli options to disable other properties 2025-06-11 11:32:45 -03:00
pedrocarlo
edc1c6fbc6 force predicate in SelectSelectOptimizer to evaluate to a boolean value 2025-06-11 11:32:45 -03:00
pedrocarlo
9f601ccb18 add cli option to disable select optimizer 2025-06-11 11:32:45 -03:00
pedrocarlo
6b58c4a33f migrate to using limbo_core::Value inside Simulator 2025-06-11 11:32:18 -03:00
pedrocarlo
f3ef60e1f1 use anyhow in simulator for lazily evaluated error context instead of eager evaluation with .or 2025-06-10 10:50:39 -03:00
Pekka Enberg
9f17be8162 Merge 'simulator: log the interaction about to be executed with INFO' from Jussi Saurio
I think this is useful to see, without having to drop down to DEBUG and
seeing all the other stuff.

Closes #1655
2025-06-04 10:20:54 +03:00
Jussi Saurio
e53ac59532 Fix assertion failing on 100 != 99.99999999999999999999 2025-06-04 09:28:26 +03:00
Jussi Saurio
5680326881 sim: add CREATE INDEX to interactions 2025-06-04 09:21:59 +03:00
pedrocarlo
1c424818aa simulator options to disable certain query types 2025-06-03 22:21:40 -03:00
Jussi Saurio
e260a72447 sim: log the interaction about to be executed with INFO
I think this is useful to see, without having to drop down to DEBUG
and seeing all the other stuff.
2025-06-03 15:50:34 +03:00
Jussi Saurio
51e3a04668 simulator: add option to disable BugBase 2025-06-02 12:14:35 +03:00
Pere Diaz Bou
8ec7e616b4 simulator: switch to tracing, run io.run_once and add update queries
* Without tracing crate we cannot log anything that happens in
limbo_core
* IO never ran in step loop inside simulator.
* Added update queries (which currently loop forever for some reason I'm
debugging).
2025-05-30 10:57:13 +02:00
Pekka Enberg
05df548b10 core/io: Add wait_for_completion() to I/O dispatcher 2025-05-27 13:47:40 +03:00
Pekka Enberg
eca9a5b703 core/io: Switch to Arc<Completion> 2025-05-27 11:28:49 +03:00
Diego Reis
d9bf383507 core/io: Untie MemoryIO's lifetime of the IO layer 2025-04-13 11:10:06 -03:00
Diego Reis
79f8b83cbe Fix dumb clippy errors 2025-04-13 11:10:06 -03:00
alpaylan
e13b5bc698 fix min/max-tests bug 2025-04-11 15:33:32 -04:00
alpaylan
9d08693e8f add simulator subcommands 2025-04-11 14:10:12 -04:00
alpaylan
d4707fe391 add non-zero exit code in case of failures, remove the interactive initalization option in bug base for now, fix bugs in differential mode, add detailed information regarding runs to the bug base 2025-04-11 11:23:03 -04:00
alpaylan
64c2917e81 add bug base, refactor 2025-04-08 17:48:16 -04:00
Avinash Sajjanshetty
3543e83b91 Impl Clock trait in bindings 2025-04-06 23:34:15 +05:30
Pekka Enberg
8caa234df3 simulator: Reduce info-level logging
Make the simulator less noisy for casual runs.
2025-03-28 08:10:57 +02:00
Pekka Enberg
96175cccf7 cli: Add --experimental-mvcc option to enable MVCC 2025-03-06 10:16:42 +02:00
Pere Diaz Bou
8daf7666d1 Make database Sync + Send 2025-03-05 14:07:48 +01:00
alpaylan
babf33bafa fix formatting 2025-02-11 14:15:00 -05:00
alpaylan
c133bbdd29 add differential testing against rusqlite 2025-02-11 14:13:14 -05:00
Pekka Enberg
4c064790b2 Merge 'simulator: add DROP TABLE <t> support' from Alperen Keleş
I wanted to assist the current development in an up-to-date fashion,
this PR adds drop table(which is being implemented currently in
https://github.com/tursodatabase/limbo/pull/897) testing support to the
generator.
Unfortunately, we don't have feature flags in the simulator yet, so the
users should manually fix the generation probability in
`simulator/generation/plan.rs#L644` and
`simulator/generation/property.rs#L629`.

Closes #949
2025-02-11 17:44:49 +02:00
Pekka Enberg
0638550be7 Merge 'Remove unnecessary reference counting from completion I/O callbacks' from Preston Thorpe
I am on a bit of a mission to revisit a lot of the ref counting, this
was an easy first win.
It seems to be a linear path of function calls or hashmaps which can own
the completions directly, no cloning needed.

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

Closes #912
2025-02-10 12:11:30 +02:00
Aarni Koskela
eaea02c567 Fix a handful of typos 2025-02-09 18:08:29 +02:00
alpaylan
6f567bd2ef fix formatting 2025-02-09 09:34:32 -05:00
alpaylan
47420db16f - implement DROP TABLE support, toggled off from generation for now
- clean up the query generation/printing by separating it into different files and removing duplications
2025-02-09 09:28:33 -05:00
alpaylan
6308ce4544 fix the shrinking file and poison errors 2025-02-08 09:34:51 -05:00
PThorpe92
75898027a0
Remove unnecessary reference counting from completion io callbacks 2025-02-08 08:20:19 -05:00
Pekka Enberg
0d0906dce4 Merge 'simulator: implement --load and --watch flags' from Alperen Keleş
The current status of the PR is halfway. The new framing of simulation
runner where `setup_simulation` is separated from `run_simulation`
allows for injecting custom plans easily. The PR is currently missing
the functionality to update the `SimulatorEnv` ad hoc from the plan, as
the environment tables were typically created during the planning phase.
The next steps will be to implement a function `fn
mk_env(InteractionPlan, SimulatorEnv) -> SimulatorEnv`, add `--load`
flag to the CLI for loading a serialized plan file, making a
corresponding environment and running the simulation.
We can optionally combine this with a `--save` option, in which we keep
a seed-vault as part of limbo simulator, corresponding each seed with
its generated plan and save the time to regenerate existing seeds by
just loading them into memory. I am curious to hear thoughts on this?
Would the maintainers be open to adding such a seed-vault? Do you think
the saved time would be worth the complexity of the approach?

Reviewed-by: Pere Diaz Bou <pere-altea@homail.com>

Closes #720
2025-01-26 08:52:58 +02:00
alpaylan
e476b9f697 implement watch mode
- add `--watch` flag
- start saving seeds in persistent storage
- make a separate version of execution functions that use `vector of interaction` instead of `InteractionPlan`
2025-01-18 23:54:03 +03:00
Jorge López
e5faa3273a
syntactic changes: remove unused self dependency to appease to our Clippy overlord... 2025-01-18 19:36:32 +01:00
Jorge López
f160206cdd
syntactic changes: replace unwrap() with ? in functions that return Result<...> 2025-01-18 18:33:43 +01:00
Jorge López
86a4714711
syntactic changes: remove unneeded paths when the type is already imported 2025-01-18 18:29:12 +01:00
alpaylan
c30e2757b4 - implement '--load <PATH>' flag that loads an interaction plan and executes it instead of generating one from scratch
- save a json serialization of the generated plans to `<tempdir>/simulator.plan.json`
2025-01-17 22:04:55 +03:00
alpaylan
28cde537a8 this commit;
- makes interaction plans serializable
- fixes the shadowing bug where non-created tables were assumed to be created in the shadow tables map
- makes small changes to make clippy happy
- reorganizes simulation running flow to remove unnecessary plan regenerations while shrinking and double checking
2025-01-17 01:30:46 +03:00
Pekka Enberg
4fafaba607 simulator: Reduce generated sequence size defaults
...otherwise the simulator runs forever...
2025-01-15 18:32:03 +02:00
alpaylan
ecb0f782ac Merge branch 'main' of https://github.com/tursodatabase/limbo 2025-01-15 10:59:46 +03:00
Pekka Enberg
a9ffa72151 simulator: Replace println() calls with log::info() 2025-01-14 18:40:03 +02:00
Pekka Enberg
e1f5fa875e simulator: Make simulator runs longer by default 2025-01-14 17:37:53 +02:00
Pekka Enberg
14ec057a34 simulator: Make stats printout prettier
```
op           calls   faults
--------- -------- --------
pread            3        0
pwrite           1        0
sync             0        0
--------- -------- --------
total            4        0
```
2025-01-14 17:32:31 +02:00
Pekka Enberg
5b4c7ec7f5 simulator: Rename stats in SimulatorFile 2025-01-14 17:24:14 +02:00
alpaylan
fb937eff7b fix non-determinism bug arising from a call to thread_rng while picking
which row to check existence for in the result of the select query
2025-01-13 17:26:23 +03:00
alpaylan
82fcc27a58 this commit fixes query generation;
- previous query generation method was faulty, producing wrong assertions
- this commit adds a new arbitrary_from implementation for predicates
- new implementation takes a table and a row, and produces a predicate that would evaluate to true for the row
this commit makes small changes to the main for increasing readability
2025-01-13 02:31:19 +03:00