Commit graph

5420 commits

Author SHA1 Message Date
Pere Diaz Bou
0ee7e9d02c integrity_check: add row count check for indexes
Some checks failed
Run long fuzz tests on Btree / simple-stress-test (push) Has been cancelled
Run long fuzz tests on Btree / run-long-tests (push) Has been cancelled
2025-06-25 12:41:46 +02:00
Pekka Enberg
f01516378b Merge 'Add Pedro to email recipients for antithesis' from Pedro Muniz
Some checks are pending
Go Tests / test (push) Waiting to run
Java Tests / test (push) Waiting to run
Run long fuzz tests on Btree / run-long-tests (push) Waiting to run
Run long fuzz tests on Btree / simple-stress-test (push) Waiting to run
JavaScript / stable - aarch64-apple-darwin - node@20 (push) Waiting to run
JavaScript / stable - x86_64-apple-darwin - node@20 (push) Waiting to run
JavaScript / stable - x86_64-pc-windows-msvc - node@20 (push) Waiting to run
JavaScript / stable - x86_64-unknown-linux-gnu - node@20 (push) Waiting to run
JavaScript / Test bindings on x86_64-apple-darwin - node@20 (push) Blocked by required conditions
JavaScript / Test bindings on Linux-x64-gnu - node@20 (push) Blocked by required conditions
JavaScript / Build universal macOS binary (push) Blocked by required conditions
JavaScript / Publish (push) Blocked by required conditions
Python / configure-strategy (push) Waiting to run
Python / test (push) Blocked by required conditions
Python / lint (push) Waiting to run
Python / linux (x86_64) (push) Waiting to run
Python / macos-x86_64 (x86_64) (push) Waiting to run
Python / macos-arm64 (aarch64) (push) Waiting to run
Python / sdist (push) Waiting to run
Python / Release (push) Blocked by required conditions
Rust / cargo-fmt-check (push) Waiting to run
Rust / build-native (blacksmith-4vcpu-ubuntu-2404) (push) Waiting to run
Rust / build-native (macos-latest) (push) Waiting to run
Rust / build-native (windows-latest) (push) Waiting to run
Rust / clippy (push) Waiting to run
Rust / build-wasm (push) Waiting to run
Rust / test-limbo (push) Waiting to run
Rust / test-sqlite (push) Waiting to run
Rust Benchmarks+Nyrkiö / bench (push) Waiting to run
Rust Benchmarks+Nyrkiö / clickbench (push) Waiting to run
I want to be notified on Antithesis test stuff. I want to understand
more how their stuff works and what fails and how in their platform.

Closes #1785
2025-06-24 16:12:31 +03:00
Pekka Enberg
2313c33015 Merge 'bindings/rust: Implement Debug for Connection' from Charlie
A simple change to implement the `Debug` trait for the `Connection`,
similar to how it is implemented for `Database`.  This should help users
in their application code with wrapping the connection.

Closes #1798
2025-06-24 16:11:54 +03:00
Pekka Enberg
b1cd7229c7 Merge 'sim: when loading bug, dont panic if there are no runs' from Jussi Saurio
Closes #1820
2025-06-24 16:07:52 +03:00
Pekka Enberg
69d8162e61 Merge 'sim: fix singlequote escaping and unescaping' from Jussi Saurio
Fixes https://github.com/tursodatabase/limbo/issues/1801 by preventing
the generation of strings like `'foo''` that contain an improper
unescaped sequence of quotes

Closes #1819
2025-06-24 16:07:43 +03:00
Pekka Enberg
28c2d24931 antithesis: Relax connect failure check
We also want to just ignore this under Antithesis:

``´
limbo.DatabaseError: Failed to open database: LockingError("Failed locking file. File is locked by another process")
```
2025-06-24 15:47:21 +03:00
Jussi Saurio
73db450b8b sim: when loading bug, dont panic if there are no runs 2025-06-24 15:46:15 +03:00
Jussi Saurio
cff96964df Fix singlequote escaping and unescaping 2025-06-24 14:58:25 +03:00
Pekka Enberg
6c8aa4e043 antithesis: Run experiment for 60 minutes 2025-06-24 14:16:09 +03:00
Pekka Enberg
f8c2c7387f antithesis: Reduce number of stress iterations
...currently takes a very long time to run.
2025-06-24 14:15:46 +03:00
Jussi Saurio
0a94ee5572 Merge 'Fix btree balance and seek after overwritten cell overflows' from Jussi Saurio
Closes #1809
Closes #1810
Closes #1811
Closes #1812
Closes #1813
Closes #1814
Closes #1815
and probably Closes #1805

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

Closes #1816
2025-06-24 13:29:53 +03:00
Jussi Saurio
27b2c2530b test/stress: only do integrity_check every 100 queries 2025-06-24 13:13:31 +03:00
Jussi Saurio
bdfbb8fe54 Fix erroneous early return 2025-06-24 11:26:00 +03:00
Jussi Saurio
5878724d0e fix/btree: balance and seek after overwritten cell overflows 2025-06-24 11:08:22 +03:00
Pekka Enberg
a99833ba8d Merge 'Bring back some merge conflicts code' from Pedro Muniz
Some checks are pending
Build and push limbo-sim image / deploy (push) Waiting to run
Go Tests / test (push) Waiting to run
Java Tests / test (push) Waiting to run
JavaScript / stable - aarch64-apple-darwin - node@20 (push) Waiting to run
JavaScript / stable - x86_64-apple-darwin - node@20 (push) Waiting to run
JavaScript / stable - x86_64-pc-windows-msvc - node@20 (push) Waiting to run
JavaScript / stable - x86_64-unknown-linux-gnu - node@20 (push) Waiting to run
JavaScript / Test bindings on x86_64-apple-darwin - node@20 (push) Blocked by required conditions
JavaScript / Test bindings on Linux-x64-gnu - node@20 (push) Blocked by required conditions
JavaScript / Build universal macOS binary (push) Blocked by required conditions
JavaScript / Publish (push) Blocked by required conditions
Python / configure-strategy (push) Waiting to run
Python / test (push) Blocked by required conditions
Python / lint (push) Waiting to run
Python / linux (x86_64) (push) Waiting to run
Python / macos-x86_64 (x86_64) (push) Waiting to run
Python / macos-arm64 (aarch64) (push) Waiting to run
Python / sdist (push) Waiting to run
Python / Release (push) Blocked by required conditions
Rust / cargo-fmt-check (push) Waiting to run
Rust / build-native (blacksmith-4vcpu-ubuntu-2404) (push) Waiting to run
Rust / build-native (macos-latest) (push) Waiting to run
Rust / build-native (windows-latest) (push) Waiting to run
Rust / clippy (push) Waiting to run
Rust / build-wasm (push) Waiting to run
Rust / test-limbo (push) Waiting to run
Rust / test-sqlite (push) Waiting to run
Rust Benchmarks+Nyrkiö / bench (push) Waiting to run
Rust Benchmarks+Nyrkiö / clickbench (push) Waiting to run
Due to some merge conflicts, some recent code from stress testing was
lost. Bringing it back here

Closes #1808
2025-06-24 09:07:32 +03:00
pedrocarlo
13a55948d5 bring back some merge conflicts code 2025-06-23 23:01:28 -03:00
Jussi Saurio
e2d8d11738 Merge 'chore: fix clippy warnings' from Nils Koch
Some checks are pending
Go Tests / test (push) Waiting to run
Java Tests / test (push) Waiting to run
Run long fuzz tests on Btree / run-long-tests (push) Waiting to run
Run long fuzz tests on Btree / simple-stress-test (push) Waiting to run
JavaScript / stable - aarch64-apple-darwin - node@20 (push) Waiting to run
JavaScript / stable - x86_64-apple-darwin - node@20 (push) Waiting to run
JavaScript / stable - x86_64-pc-windows-msvc - node@20 (push) Waiting to run
JavaScript / stable - x86_64-unknown-linux-gnu - node@20 (push) Waiting to run
JavaScript / Test bindings on x86_64-apple-darwin - node@20 (push) Blocked by required conditions
JavaScript / Test bindings on Linux-x64-gnu - node@20 (push) Blocked by required conditions
JavaScript / Build universal macOS binary (push) Blocked by required conditions
JavaScript / Publish (push) Blocked by required conditions
Python / configure-strategy (push) Waiting to run
Python / test (push) Blocked by required conditions
Python / lint (push) Waiting to run
Python / linux (x86_64) (push) Waiting to run
Python / macos-x86_64 (x86_64) (push) Waiting to run
Python / macos-arm64 (aarch64) (push) Waiting to run
Python / sdist (push) Waiting to run
Python / Release (push) Blocked by required conditions
Rust / cargo-fmt-check (push) Waiting to run
Rust / build-native (blacksmith-4vcpu-ubuntu-2404) (push) Waiting to run
Rust / build-native (macos-latest) (push) Waiting to run
Rust / build-native (windows-latest) (push) Waiting to run
Rust / clippy (push) Waiting to run
Rust / build-wasm (push) Waiting to run
Rust / test-limbo (push) Waiting to run
Rust / test-sqlite (push) Waiting to run
Rust Benchmarks+Nyrkiö / bench (push) Waiting to run
Rust Benchmarks+Nyrkiö / clickbench (push) Waiting to run
There are a many clippy warnings in the main branch. This PR addresses
some of them.
I will fix the rest of the warnings in follow up PRs. Furthermore, the
clippy CI check is not working. I can look into that after I fixed the
rest of the clippy warnings. After that, I think it would make sense to
migrate to the latest Rust version. Does that work for you?
EDIT: This PR resolves all Clippy warnings and enables the CI to run all
Clippy checks. The CI has extra checks for the `limbo-wasm` module. This
module still has some Clippy warnings that need attention.

Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>
Reviewed-by: Pere Diaz Bou <pere-altea@homail.com>

Closes #1742
2025-06-23 23:22:21 +03:00
Nils Koch
4c7fcafe77
ci: fail on all clippy warnings 2025-06-23 19:52:13 +01:00
Nils Koch
2827b86917
chore: fix clippy warnings 2025-06-23 19:52:13 +01:00
Pekka Enberg
1a0d4f500f Merge 'simulator: integrity check per query' from Pedro Muniz
Now that we have our own integrity check, we can also execute it per
query to catch bugs earlier. We could use `Sqlite`s integrity check
instead of the one @pereman2 implemented, but I think this could also
help us battle test the integrity check he wrote.
Motivation for this PR came from this issue #1781 . I wanted to find a
minimal repo for that problem, so I introduced this check per query. The
nice thing is that we get some shrinking as well by using the simulator
instead of `limbo_stress`.
The following command will allow you to find the failing seed I posted
in the issue:
`cargo run -p limbo_sim -- --minimum-tests 10 --maximum-tests 100
--disable-create-index --seed 17321136847878547364`

Closes #1802
2025-06-23 20:17:32 +03:00
Pekka Enberg
8686d9bb49 Merge 'don't emit Delete for UPDATE statement' from Pere Diaz Bou
Previously we implemented update as a simple `Delete` + `Insert`
procedure which seemed okay for the moment but it wasn't. `Delete` can
trigger balance and a post balance `seek` which will leave cursor
pointing to an invalid page which `Insert` will try to insert to.
We solve this by removing `Delete` from the execution plan and rely on
`Insert` to properly overwrite the cell where the rowid is the same as
the one we are inserting.

Closes #1803
2025-06-23 20:16:16 +03:00
Pere Diaz Bou
404b5fad8a clippy 2025-06-23 18:19:44 +02:00
Pere Diaz Bou
b7fd4f1e18 update nchanges on op_insert 2025-06-23 18:11:58 +02:00
Pekka Enberg
43d8799f55 Merge 'stress: Improve progress reporting' from Pekka Enberg
A stress run can take a long time. Improve progress reporting to improve
DX.

Closes #1796
2025-06-23 17:48:55 +03:00
Pekka Enberg
c0fd559f92 Merge 'Fix: add uv sync to all packages for pytest github action' from Pedro Muniz
Hopefully, this solves the problem in main branch.

Closes #1800
2025-06-23 17:48:44 +03:00
Pekka Enberg
963d7b7daf stress: Improve progress reporting
A stress run can take a long time. Improve progress reporting to improve
DX.
2025-06-23 17:25:38 +03:00
Pere Diaz Bou
c7e9b3a546 don't emit Delete for UPDATE statement
Previously we implemented update as a simple `Delete` + `Insert`
procedure which seemed okay for the moment but it wasn't. `Delete` can
trigger balance and a post balance `seek` which will leave cursor
pointing to an invalid page which `Insert` will try to insert to.

We solve this by removing `Delete` from the execution plan and rely on
`Insert` to properly overwrite the cell where the rowid is the same as
the one we are inserting.
2025-06-23 15:44:34 +02:00
pedrocarlo
c9b11dd173 simulator integrity check per query 2025-06-22 21:47:17 -03:00
pedrocarlo
efc1516d7b add uv sync to all packages 2025-06-22 15:45:07 -03:00
CM-IV
3bb0374401 impl Debug for Connection 2025-06-22 11:41:07 -05:00
Pekka Enberg
b07e95b892 Merge 'Fix CI errors' from Piotr Rżysko
Some checks failed
Rust / test-limbo (push) Has been cancelled
Build and push limbo-sim image / deploy (push) Has been cancelled
Go Tests / test (push) Has been cancelled
Java Tests / test (push) Has been cancelled
JavaScript / stable - aarch64-apple-darwin - node@20 (push) Has been cancelled
JavaScript / stable - x86_64-apple-darwin - node@20 (push) Has been cancelled
JavaScript / stable - x86_64-pc-windows-msvc - node@20 (push) Has been cancelled
JavaScript / stable - x86_64-unknown-linux-gnu - node@20 (push) Has been cancelled
Python / configure-strategy (push) Has been cancelled
Python / lint (push) Has been cancelled
Python / linux (x86_64) (push) Has been cancelled
Python / macos-x86_64 (x86_64) (push) Has been cancelled
Python / macos-arm64 (aarch64) (push) Has been cancelled
Python / sdist (push) Has been cancelled
Rust / cargo-fmt-check (push) Has been cancelled
Rust / build-native (blacksmith-4vcpu-ubuntu-2404) (push) Has been cancelled
Rust / build-native (macos-latest) (push) Has been cancelled
Rust / build-native (windows-latest) (push) Has been cancelled
Rust / clippy (push) Has been cancelled
Rust / build-wasm (push) Has been cancelled
Rust / test-sqlite (push) Has been cancelled
Rust Benchmarks+Nyrkiö / bench (push) Has been cancelled
Rust Benchmarks+Nyrkiö / clickbench (push) Has been cancelled
JavaScript / Test bindings on x86_64-apple-darwin - node@20 (push) Has been cancelled
JavaScript / Test bindings on Linux-x64-gnu - node@20 (push) Has been cancelled
JavaScript / Build universal macOS binary (push) Has been cancelled
JavaScript / Publish (push) Has been cancelled
Python / test (push) Has been cancelled
Python / Release (push) Has been cancelled
Fix CI errors caused by https://github.com/tursodatabase/limbo/pull/1741

Closes #1794
2025-06-22 09:24:12 +03:00
Piotr Rzysko
ddd5417978 Add sqlite_test_ext to Dockerfile.antithesis 2025-06-21 20:07:26 +02:00
Piotr Rzysko
0f3efe2fbb Copy sqlite_test_ext to Dockerfile.simulator 2025-06-21 19:51:11 +02:00
Piotr Rzysko
dda1ee86e2 Fix ruff errors 2025-06-21 19:32:16 +02:00
Jussi Saurio
d0f9df1f97 Merge 'Improve extension compatibility testing' from Piotr Rżysko
Some checks failed
Go Tests / test (push) Waiting to run
Java Tests / test (push) Waiting to run
JavaScript / stable - aarch64-apple-darwin - node@20 (push) Waiting to run
JavaScript / stable - x86_64-apple-darwin - node@20 (push) Waiting to run
JavaScript / stable - x86_64-pc-windows-msvc - node@20 (push) Waiting to run
JavaScript / stable - x86_64-unknown-linux-gnu - node@20 (push) Waiting to run
JavaScript / Test bindings on x86_64-apple-darwin - node@20 (push) Blocked by required conditions
JavaScript / Test bindings on Linux-x64-gnu - node@20 (push) Blocked by required conditions
JavaScript / Build universal macOS binary (push) Blocked by required conditions
JavaScript / Publish (push) Blocked by required conditions
Python / configure-strategy (push) Waiting to run
Python / test (push) Blocked by required conditions
Python / lint (push) Waiting to run
Python / linux (x86_64) (push) Waiting to run
Python / macos-x86_64 (x86_64) (push) Waiting to run
Python / macos-arm64 (aarch64) (push) Waiting to run
Python / sdist (push) Waiting to run
Python / Release (push) Blocked by required conditions
Rust / test-sqlite (push) Waiting to run
Rust / cargo-fmt-check (push) Waiting to run
Rust / build-native (blacksmith-4vcpu-ubuntu-2404) (push) Waiting to run
Rust / build-native (macos-latest) (push) Waiting to run
Rust / build-native (windows-latest) (push) Waiting to run
Rust / clippy (push) Waiting to run
Rust / build-wasm (push) Waiting to run
Rust / test-limbo (push) Waiting to run
Rust Benchmarks+Nyrkiö / bench (push) Waiting to run
Rust Benchmarks+Nyrkiö / clickbench (push) Waiting to run
Run long fuzz tests on Btree / run-long-tests (push) Has been cancelled
Run long fuzz tests on Btree / simple-stress-test (push) Has been cancelled
Extracted from https://github.com/tursodatabase/limbo/pull/1727.

Reviewed-by: Preston Thorpe (@PThorpe92)

Closes #1741
2025-06-21 19:09:33 +03:00
Jussi Saurio
a549f2971d Merge 'Ephemeral Table in Update' from Pedro Muniz
Closes #1713. Adds ephemeral table when a rowid_alias is being updated.

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

Closes #1726
2025-06-21 19:07:32 +03:00
Jussi Saurio
cac23d5b31 Merge 'Fix infinite aggregation loop when sorting is not required' from Piotr Rżysko
Previously, with the `index_experimental` feature enabled, the query in
the added test would enter an infinite loop. This happened because
`label_grouping_agg_step` pointed to a constant argument that was moved
to the end of the program. As a result, the aggregation loop would jump
to the constant, then return to the start of the main loop, rewind the
index, and re-enter the aggregation loop - causing it to repeat
indefinitely.

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

Closes #1792
2025-06-21 19:06:44 +03:00
Piotr Rzysko
64b83a45e8 Fix infinite aggregation loop when sorting is not required
Previously, with the `index_experimental` feature enabled, the query in
the added test would enter an infinite loop. This happened because
`label_grouping_agg_step` pointed to a constant argument that was moved
to the end of the program. As a result, the aggregation loop would jump
to the constant, then return to the start of the main loop, rewind the
index, and re-enter the aggregation loop—causing it to repeat
indefinitely.
2025-06-21 10:03:10 +02:00
pedrocarlo
9ae4f6ec40 fix merge conflict problems 2025-06-20 16:38:10 -03:00
pedrocarlo
6596ee28a8 introduce EphemeralTable query destination 2025-06-20 16:30:21 -03:00
pedrocarlo
e53a290a48 move ephemeral table logic to update plan and reuse select logic for ephemeral index 2025-06-20 16:30:21 -03:00
pedrocarlo
b3351dc709 tests + adjustment to halt error message 2025-06-20 16:29:10 -03:00
pedrocarlo
9048ad398b modify loop functions to accomodate for ephemeral tables 2025-06-20 16:29:10 -03:00
pedrocarlo
eda9d20a0b tests 2025-06-20 16:28:10 -03:00
pedrocarlo
74beac5ea8 ephemeral table for update when rowid is being update 2025-06-20 16:28:10 -03:00
Jussi Saurio
edc6eb9a36 Merge 'Use UV more in python related scripts and actions' from Pedro Muniz
Some checks are pending
Build and push limbo-sim image / deploy (push) Waiting to run
Go Tests / test (push) Waiting to run
Java Tests / test (push) Waiting to run
JavaScript / Publish (push) Blocked by required conditions
JavaScript / stable - aarch64-apple-darwin - node@20 (push) Waiting to run
JavaScript / stable - x86_64-apple-darwin - node@20 (push) Waiting to run
JavaScript / stable - x86_64-pc-windows-msvc - node@20 (push) Waiting to run
JavaScript / stable - x86_64-unknown-linux-gnu - node@20 (push) Waiting to run
Python / macos-x86_64 (x86_64) (push) Waiting to run
Python / macos-arm64 (aarch64) (push) Waiting to run
Python / sdist (push) Waiting to run
Python / Release (push) Blocked by required conditions
Rust / cargo-fmt-check (push) Waiting to run
Rust / test-sqlite (push) Waiting to run
Rust / build-native (blacksmith-4vcpu-ubuntu-2404) (push) Waiting to run
Rust / build-native (macos-latest) (push) Waiting to run
Rust / build-native (windows-latest) (push) Waiting to run
Rust / clippy (push) Waiting to run
Rust / build-wasm (push) Waiting to run
Rust / test-limbo (push) Waiting to run
Rust Benchmarks+Nyrkiö / bench (push) Waiting to run
Rust Benchmarks+Nyrkiö / clickbench (push) Waiting to run
JavaScript / Test bindings on x86_64-apple-darwin - node@20 (push) Blocked by required conditions
JavaScript / Test bindings on Linux-x64-gnu - node@20 (push) Blocked by required conditions
JavaScript / Build universal macOS binary (push) Blocked by required conditions
Python / lint (push) Waiting to run
Python / configure-strategy (push) Waiting to run
Python / test (push) Blocked by required conditions
Python / linux (x86_64) (push) Waiting to run
This PR initializes an UV project in `antithesis_tests` so that we can
have an easier time to track dependencies and build pylimbo
automatically for our environment. Consequently, making it easier to
create new antithesis tests in the future with better IDE support.
Also modified our Github actions to check python linting with Ruff, and
removed unnecessary Python jobs. With that, I applied the Ruff fixes
which is the cause of the many file changes.

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

Closes #1782
2025-06-20 22:04:56 +03:00
Jussi Saurio
f396528d53 Merge 'Fix DELETE not emitting constant WhereTerms' from Pedro Muniz
Fixes DELETE not emitting conditional jumps at all if the associated
WhereTerm is a constant, e.g.
```sql
limbo> create table t(x);
limbo> explain DELETE FROM t WHERE 5-5;
addr  opcode             p1    p2    p3    p4             p5  comment
----  -----------------  ----  ----  ----  -------------  --  -------
0     Init               0     7     0                    0   Start at 7
1     OpenWrite          0     2     0                    0   root=2; t
2     Rewind             0     6     0                    0   Rewind table t
3       RowId            0     1     0                    0   r[1]=t.rowid
4       Delete           0     0     0                    0
5     Next               0     3     0                    0
6     Halt               0     0     0                    0
7     Transaction        0     1     0                    0   write=true
8     Goto               0     1     0                    0
```
I was adding more stuff to the simulator in a Branch of mine, and I
caught this error with delete. Upstreaming the fix here. As we do with
Update, I added the translation step for the `WhereTerms` of the query.
Edit: Closes #1732. Closes #1733. Closes #1734. Closes #1735. Closes
#1736. Closes #1738. Closes #1739. Closes #1740.
Edit: Also pushes constant where term translation to `init_loop` for
Update and Select as well.

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

Closes #1746
2025-06-20 22:00:32 +03:00
pedrocarlo
8b8f43334e remove python makefile as it is obsolete with UV 2025-06-20 15:59:03 -03:00
pedrocarlo
80ccca8827 ruff lint fix 2025-06-20 15:59:03 -03:00
pedrocarlo
50c8b2ca2e extract ruff lint rules to workspace 2025-06-20 15:59:03 -03:00