Commit Graph

33 Commits

Author SHA1 Message Date
Noa 742303ca49 Bump rust-toolchain to rust 1.88 (#2749)
Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>
2025-07-15 17:39:41 +00:00
Mazdak Farrokhzad 0c3635188d Auto-migrate: Allow adding new variants at the tail (#2874) 2025-06-27 17:29:31 +00:00
Mazdak Farrokhzad 373e47db39 PagePool::{default -> new_for_test} + temporary hack for IN_MEMORY_CONFIG / test_index_scans (#2707) 2025-05-12 13:15:07 +00:00
Mazdak Farrokhzad eb589728c6 Allocate pages using a mult-tenant lock-free pool (#2587) 2025-04-28 17:35:19 +00:00
Noa 483a9488e2 Update rand (#2568) 2025-04-11 17:39:41 +00:00
Mazdak Farrokhzad b50b6841f1 Add direct indices to datastore (#2221) 2025-02-07 01:06:38 +00:00
Mazdak Farrokhzad 6f20597600 Make check_and_insert & find_old_row and friends do less checks (#2192) 2025-01-31 15:00:19 +00:00
Noa 293aebaef9 Bump to Rust 1.84 (#2001) 2025-01-28 23:11:29 +00:00
Mazdak Farrokhzad 6f428f3afb Make the key of Table.indexes be IndexId (#2124) 2025-01-17 18:42:54 +00:00
Mazdak Farrokhzad e103971e29 Avoid a multimap when the index is unique (#2044) 2024-12-09 22:53:04 +00:00
Mazdak Farrokhzad 03cf2f4b4b Add Static(Bsatn)Layout::deserialize_row_into (#2032) 2024-12-03 16:06:31 +00:00
Mazdak Farrokhzad bc71e25ad8 Add Layout.fixed: bool for a fast path in eq_row_in_page & row_type_visitor (#2025) 2024-12-03 15:07:26 +00:00
james gilles c657b4f088 Rip useless names out of RawDef (#1918) 2024-11-20 21:02:00 +00:00
james gilles c32f297c47 Update TableSchema & system tables to resemble ABI V9 (#1697) 2024-09-25 20:03:22 +00:00
james gilles 2be42156b2 Allow converting new ModuleDef to old TableSchema (#1630) 2024-08-29 18:17:29 +00:00
Mazdak Farrokhzad 3340ceea8a SATS: Flatten AlgebraicType, getting rid of BuiltinType (#1559)
Signed-off-by: Mazdak Farrokhzad <twingoow@gmail.com>
Signed-off-by: joshua-spacetime <josh@clockworklabs.io>
Co-authored-by: joshua-spacetime <josh@clockworklabs.io>
2024-08-06 18:15:19 +00:00
james gilles 45b2ceee9a Move schemas to schema crate, rename Def to RawDefV8 (#1498) 2024-07-24 17:38:30 +00:00
james gilles f81f2a7492 Move db module from spacetimedb_sats to spacetimedb_lib (#1479) 2024-07-17 20:59:44 +00:00
Shubham Mishra cf4b9aa282 metric for table size (#1319)
* table size metric

* feld blob_store_bytes in table

* address comments

* NumBlobBytes type

* table size metrics: adjust comments, visibility + harden test

---------

Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>
2024-05-31 17:44:12 +00:00
Mazdak Farrokhzad ebc921849e privatize Table::row_layout + related BTreeIndex refactoring (#1262) 2024-05-20 18:44:04 +00:00
Mazdak Farrokhzad e109385c1e remove BTreeIndex::name again (#1251) 2024-05-20 15:52:57 +00:00
Noa 3b754f10b1 Bump to Rust 1.78 (#1205)
* Bump to rust 1.78

* Fix lints
2024-05-08 14:20:12 +00:00
Phoebe Goldman 484ba824ba Make Page always fully init (#1193)
* Make `Page` always fully init

Per discussion on the snapshotting proposal,
this PR changes the type of `Page.row_data` to `[u8; _]`,
where previously it was `[MaybeUninit<u8>; _]`.

This turns out to be shockingly easy,
as our serialization codepaths never write padding bytes into a page.
The only place pages ever became `poison` was the initial allocation;
changing this to `alloc_zeroed` causes the `row_data` to always be valid at `[u8; _]`.

The majority of this diff is replacing `MaybeUninit`-specific operators
with their initialized equivalents,
and updating comments and documentation to reflect the new requirements.

This change also revealed a bug in the benchmarks
introduced when we swapped the order of sum tags and payloads
( https://github.com/clockworklabs/SpacetimeDB/pull/1063 ),
where benchmarks used a hardcoded offset for the tag which had not been updated.

* Update blake3

Blake3 only supports running under Miri as of 1.15.1, the latest version.
Prior versions hard-depended on SIMD intrinsics which Miri doesn't support.

* Address Mazdak's review.

Still pending his agreeing with me that `poison` is a better name than `uninit`.

* "Poison" -> "uninit"

Against my best wishes, for consistency with the broader Rust community's poor choices.

* Remove unnecessary `unsafe` blocks

* More unnecessary `unsafe`; remove forgotten SAFETY comments
2024-05-02 23:15:48 +00:00
Mazdak Farrokhzad e526c8c113 Fix soundness hole in Table::delete + don't make & immedately drop PVs in the method (#1162)
* impl Eq + Hash for RelValue

* Use Hash for RelValue in incr-eval

* naming: spell out pv, rv, and tro

* fix soundness hole in Table::delete + don't make + drop PVs

* Clarify `Table::delete`'s callback `before`

Co-authored-by: Phoebe Goldman <phoebe@clockworklabs.io>
Signed-off-by: Mazdak Farrokhzad <twingoow@gmail.com>

---------

Signed-off-by: Mazdak Farrokhzad <twingoow@gmail.com>
Co-authored-by: Phoebe Goldman <phoebe@clockworklabs.io>
2024-04-30 22:30:50 +00:00
Mazdak Farrokhzad fd44242e99 1. Add Hash for RowRef + make it consistent with PV. (#1163)
2. Make `RowRef::row_hash` use the above.
3. Make `Table::insert` return a `RowRef`.
4. Use less unsafe because of 1-3.
5. Use `second-stack` to reuse temporary allocations in hashing and serialization.
2024-04-30 17:59:58 +00:00
Mazdak Farrokhzad f560101551 Make Table::clone_structure cheaper by: (#1090)
- Arcing `TableSchema`, and this has benefits elsewhere too.
- Arc<[_]>ing the visitor program instructions.

The data behind the Arcs very rarely change,
which is the perfect case for an Arc.
2024-04-16 19:07:36 +00:00
Mazdak Farrokhzad d6815ebf9c Shrink AV and AT to 24 & 16 bytes respectively, and also friends. (#1047) 2024-04-13 16:51:18 +00:00
james gilles 1611d10713 Remove perfcnt for now (#941) 2024-03-07 21:16:58 +00:00
Mazdak Farrokhzad 913801e22a - Make RelValue into a cow-like structure. (#869)
- Move it and friends from sats to vm.
- MemTable now stores a Vec<PV>.
- Other related improvements.

Co-authored-by: Phoebe Goldman <phoebe@goldman-tribe.org>
2024-02-21 20:07:39 +00:00
Noa e6cef1b627 Fix bench errors and include in CI (#855) 2024-02-16 19:15:13 +00:00
Noa a7a707c0f2 Fix build errors in spacetimedb_table benches (#787) 2024-02-07 21:20:10 +00:00
Tyler Cloutier ecd366e266 Fixed issue with perfcnt not working on certain platforms and architectures (#768)
* Fixed issue with perfcnt not working on certain platforms and architectures

* Update var_len_visitor.rs
2024-01-27 10:06:52 +00:00
Mazdak Farrokhzad 343e8ec5f1 Add the spacetimedb_table crate (#763)
* add spacetimedb-table crate

* pacify clippy
2024-01-26 17:05:04 +00:00