Commit Graph

3186 Commits

Author SHA1 Message Date
Zeke Foppa 72ae889c94 templates/basic-rs properly uses workspace versions (#4170)
# Description of Changes

Replaced the specific versions in `templates/basic-rs` with relative
paths into the repo.

This was split out of
https://github.com/clockworklabs/SpacetimeDB/pull/4102.

# API and ABI breaking changes

None

# Expected complexity level and risk

1

# Testing

- [x] Upgrade version check still passes

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2026-01-30 23:32:08 +00:00
Alessandro Asoni 80c7544748 Explain maincloud in context (#4168)
# Description of Changes

Update ai rules general mdc file to explain deployment and maincloud

# API and ABI breaking changes

No

# Expected complexity level and risk

1

# Testing

Ran with claudecode
2026-01-30 21:40:01 +00:00
KirstenWF 8265b92b2c add connection log category [Unreal] (#4157)
# Description of Changes
use own LogSpacetimeDb_Connection log cateogory to configure & control
log level

# API and ABI breaking changes
-

# Expected complexity level and risk
1

# Testing
-

Co-authored-by: Jason Larabie <jason@clockworklabs.io>
2026-01-30 21:09:13 +00:00
Ryan 9a8b603565 Adding Abort to C# Websocket (#3352)
# Description of Changes

The implementation of a solution to #3044 , this adds an `Abort`
function to the `WebSocket`, which runs if `Disconnect` is called when
the `WebSocket` is not connected.

# API and ABI breaking changes

Not API breaking.

# Expected complexity level and risk

1

# Testing

- [X] Test locally with a C# CLI test client. 
**Note**: Before change (either on Rust of C# server), server would see
4 `Debug` log entries about connecting, but not see the `Info` log about
the client connection ending like would normally be seen in a
disconnect. After change, server shows no log entries at all, because
connection is properly aborted.
- [x] Test locally with a C# WebGL test client.

---------

Signed-off-by: rekhoff <r.ekhoff@clockworklabs.io>
Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com>
2026-01-30 18:32:53 +00:00
Zeke Foppa 6772f0c171 Make global.json global again (#4166)
# Description of Changes

We have had several `global.json` files introduced that aren't symlinks
to the root `global.json`.

This PR fixes that drift, and adds a CI check.

# API and ABI breaking changes

None.

# Expected complexity level and risk

2

# Testing

- [x] `cargo ci global-json-policy` succeeds
- [x] `cargo ci global-json-policy` fails if you add a new `global.json`
file somewhere
- [x] Rest of CI passes, confirming that templates are still working
properly

---------

Signed-off-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2026-01-30 18:24:26 +00:00
Noa 143295f4d0 Fix occasional panic when client disconnects (#4162)
# Description of Changes

Replaces the `unreachable!()` with a log.

# Expected complexity level and risk

1

# Testing

<!-- Describe any testing you've done, and any testing you'd like your
reviewers to do,
so that you're confident that all the changes work as expected! -->

- [ ] <!-- maybe a test you want to do -->
- [ ] <!-- maybe a test you want a reviewer to do, so they can check it
off when they're satisfied. -->
2026-01-30 12:32:44 +00:00
Kim Altintop 46f572b7a2 Organizations (#4087)
Implements the client-api changes for the organizations feature.

The interesting part of this PR are the `teams` smoketests.
There is one subtlety with deletion.
Note that I haven't (yet) covered the interaction between collaborators
and organization existing for the same database.
2026-01-30 09:04:49 +00:00
Ryan 3fec144086 Added query-with-index C# regression tests (#4123)
# Description of Changes

Adds C# regression tests for Query with Indexes.

# API and ABI breaking changes

No. Regression tests only, does not touch backend code.

# Expected complexity level and risk

1

# Testing

- [X] Built and ran regression tests locally, confirming that new
regression test asserts pass.

---------

Signed-off-by: Ryan <r.ekhoff@clockworklabs.io>
2026-01-30 01:45:56 +00:00
clockwork-tien 806447d718 feat: create Svelte framework integration (#4063)
# Description of Changes

The PR implements the following updates:

- Create Svelte framework sdk/integration
- Add Svelte Quickstart Docs
- Create `svelte-ts` template

<!-- Please describe your change, mention any related tickets, and so on
here. -->

# Screenshots
- `svelte-ts` template

<img width="1511" height="863" alt="Screenshot1"
src="https://github.com/user-attachments/assets/f266dc63-228c-4bff-96f6-b780ce53167f"
/>

- Svelte Quickstart Docs

<img width="1451" height="893" alt="Screenshot2"
src="https://github.com/user-attachments/assets/3456a60b-60d7-4232-94fc-152a020f675b"
/>



# API and ABI breaking changes

<!-- If this is an API or ABI breaking change, please apply the
corresponding GitHub label. -->

# Expected complexity level and risk

<!--
How complicated do you think these changes are? Grade on a scale from 1
to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex
change.

This complexity rating applies not only to the complexity apparent in
the diff,
but also to its interactions with existing and future code.

If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning
ways. -->

# Testing

<!-- Describe any testing you've done, and any testing you'd like your
reviewers to do,
so that you're confident that all the changes work as expected! -->

- [ ] <!-- maybe a test you want to do -->
- [ ] <!-- maybe a test you want a reviewer to do, so they can check it
off when they're satisfied. -->

---------

Co-authored-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>
2026-01-29 23:16:01 +00:00
KirstenWF 71029724ae add missing category specifier [Unreal] (#4156)
# Description of Changes
add missing UPROPERTY category to fix compile issue

# API and ABI breaking changes
-

# Expected complexity level and risk
1

# Testing
-
2026-01-29 21:48:51 +00:00
Kim Altintop ffc2ccf4e3 core: Add a method to query the replica ids managed by the host controller (#4160)
Just a view on the `Hosts` map's keys.
2026-01-29 18:22:57 +00:00
Mazdak Farrokhzad 3d3c99f8db Shrink JsWorkerRequest & use the right HashMap/Set (#4150)
# Description of Changes

This PR shrinks `JsWorkerRequest` so that it is (almost) as small as the
call reducer request.
To do that, a bunch of trivial changes had to be done to auth code, that
mostly revolves around `String` -> `Box<str>`.
This should help the auth code, but that is incidental.
The main goal was to improve throughput through the request tx/rx
channel for V8, which is taking quite a bit of time in flamegraphs.

I also noticed while making this change that the wrong hash map was
being used in a bunch of places, so I fixed all of those.

A follow up PR will shrink the reply side to fit within a cache line.
Yet another follow up PR will change the channel to replace flume with
`fibre::spsc`.

# API and ABI breaking changes

None

# Expected complexity level and risk

2, fairly trivial changes.

# Testing

Covered by existing tests.
2026-01-29 08:46:09 +00:00
Shubham Mishra bd3748b5f0 RLS section in RawModuleDefV10. (#4149)
# Description of Changes
Keep RLS in `RawModuleDefV10` for now, revisit replacing it with Views
before 2.0 release.

<!-- Please describe your change, mention any related tickets, and so on
here. -->

# API and ABI breaking changes
NA

# Expected complexity level and risk1
1
2026-01-29 04:01:10 +00:00
Zeke Foppa 65718da1bc Add spacetime login --no-browser (#4142)
# Description of Changes

Addresses https://github.com/clockworklabs/SpacetimeDB/issues/4131.

I did not thread the new option into other commands such as `spacetime
init` (they just retain the previous behavior). I think this is a
relatively niche use case, and it's easy to work around either way (by
just using `spacetime login` first) so I'd wait until someone asks us to
thread it through to other places.

# API and ABI breaking changes

None

# Expected complexity level and risk

1

# Testing

- [x] Ran `spacetime login --no-browser` and saw that it didn't open a
browser
- [x] Ran `spacetime login` and saw that it still opened a browser

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
Co-authored-by: clockwork-labs-bot <clockwork-labs-bot@users.noreply.github.com>
2026-01-29 00:44:37 +00:00
Zeke Foppa b337e0014c Skip LLM check for now (#4152)
# Description of Changes

Skip the LLM check because it's causing headaches for getting PRs
merged.

# API and ABI breaking changes

CI only

# Expected complexity level and risk

1

# Testing

- [x] It didn't run on this PR.

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2026-01-28 22:21:44 +00:00
Zeke Foppa cd71963efd Revert "Upgrade version to 1.12.0 (#4084)" (#4147)
# Description of Changes

This reverts the version bump, since it seems to be causing test
flakiness somehow.

# API and ABI breaking changes

None

# Expected complexity level and risk

1

# Testing

- [ ] CI passes

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com>
2026-01-28 17:47:24 +00:00
Mazdak Farrokhzad 2fdbb3128f Shrink JsWorkerReply to 48, making replies fit in a cache line (#4151)
# Description of Changes

See tin.
This helps out with throughput for the V8 reply rx/tx channel.

# API and ABI breaking changes

None

# Expected complexity level and risk

1

# Testing

Covered by existing tests.
2026-01-28 17:26:11 +00:00
Shubham Mishra fd3cdb3d0b [2/3] [Rust] Host changes for RawModuleDefV10 (#4105)
# Description of Changes

Host side changes for Wasm to work with `RawModuleDefV10` along with
prior versions.
Based on #https://github.com/clockworklabs/SpacetimeDB/pull/4098

# API and ABI breaking changes
NA

# Expected complexity level and risk
1.5

# Testing
Existing test will cover for any regression.
Not yet functional for  `RawModuleDefV10`, so can not be tested now.
2026-01-28 15:10:57 +00:00
Shubham Mishra 0b904ad9cf [1/3] RawModuleDefV10 definition and validation. (#4098)
# Description of Changes

Patch:
1. `crates/lib/src/db/raw_def/v10.rs` - a definition as per
https://github.com/clockworklabs/SpacetimeDBPrivate/issues/2412.
2. Refactors `RawModuleDefV9` validation code to dedup some of the core
validation logic, No functionality should change there.
3. Validation logic for new `RawModuleDefV10`.
4. Modify `crates::schema::def::ModuleDef` :
     - To include `raw_module_def_version` 
     -  `visibility` field to existing `RedcuerDef` and `ProcedureDef`
5. It deprecates RLS in favour of Views, If anyoine feel otherwise, let
me know.

Lot of code is duplicated from `RawModuleDefV9` includng tests.

# API and ABI breaking changes
NA, `RawModuleDefV10` is not yet exported by modules.


# Expected complexity level and risk
3? close analyses of structure is important to ensure future
extensibility.


# Testing
For code motion in `RawModuleDefV9` validation: Existing unit tests
seems to cover any functionality change.
For `RawModuleDefV10`: V9 test has been repeated with more `assert`s to
check on `visibility`
2026-01-28 12:30:52 +00:00
Ryan 4f0a21f948 C# client typed query builder (#3982)
# Description of Changes
This PR implements the C# client-side typed query builder, as assigned
in https://github.com/clockworklabs/SpacetimeDB/issues/3759.

Key pieces:
* Added a small C# runtime query-builder surface in the client SDK
(`sdks/csharp/src/QueryBuilder.cs`):
  * `Query` (wraps the generated SQL string)
* `Table<TRow, TCols, TIxCols>` (entry point for `All()` / `Where(...)`)
* `Col<TRow, TValue>` and `IxCol<TRow, TValue>` (typed column
references)
  * `BoolExpr` (typed boolean expression composition)
  * SQL identifier quoting + literal formatting helpers (`SqlFormat`)
  * `Join(...)` with `WhereLeft(...)` / `WhereRight(...)`
* `LeftSemijoin(...)` / `RightSemijoin(...)` with `Where(...)` chaining
* Extended C# client bindings codegen (`crates/codegen/src/csharp.rs`)
to generate:
* Per-table/view `*Cols` and `*IxCols` helper classes used by the typed
query builder.
* A generated per-module `QueryBuilder` with a `From` accessor for each
table/view, producing `Table<...>` values.
* A generated `TypedSubscriptionBuilder` which collects
`Query<TRow>.Sql` values and calls the existing subscription API.
* An `AddQuery(Func<QueryBuilder, Query> build)` entry point off
`SubscriptionBuilder`, mirroring the proposal’s Rust API.
* Fixed a codegen naming collision found during regression testing:
* `*Cols`/`*IxCols` helpers are now named after the table/view accessor
name (PascalCase) instead of the row type, since multiple tables/views
can share the same row type (e.g. alias tables / views returning an
existing product type).
* Kept `Cols`/`IxCols` off the public surface:
* `Table.Cols` and `Table.IxCols` are internal, so consumers only access
columns via the `Where(...)`/join predicate lambdas.

C# usage examples (mirroring the proposal’s Rust examples)
1) Typed subscription flow (no raw SQL)
```csharp
void Subscribe(SpacetimeDB.Types.DbConnection conn)
{
conn.SubscriptionBuilder()
    .OnApplied(ctx => { /* ... */ })
    .OnError((ctx, err) => { /* ... */ })
    .AddQuery(qb => qb.From.Users().Build())
    .AddQuery(qb => qb.From.Players().Build())
    .Subscribe();
}
```
2) Typed `WHERE` filters and boolean composition
```csharp
conn.SubscriptionBuilder()
    .OnApplied(ctx => { /* ... */ })
    .OnError((ctx, err) => { /* ... */ })
    .AddQuery(qb => qb.From.Players().Where(p => p.Name.Eq("alice").And(p.IsOnline.Eq(true))).Build())
    .Subscribe();
```
3) “Admin can see all, otherwise only self” (proposal’s “player” view
logic, but client-side)
```csharp
Identity self = /* ... */;

conn.SubscriptionBuilder()
    .AddQuery(qb =>
        qb.From.Players().Where(p =>
            p.Identity.Eq(self)
        )
    )
    .Subscribe();
```
4) Index-column access for query construction (IxCols)
```csharp
conn.SubscriptionBuilder()
    .AddQuery(qb =>
        qb.From.Players().Where(
            qb.From.Players().IxCols.Identity.Eq(self)
        )
    )
    .Subscribe();
```
# API and ABI breaking changes
None.
* Additive client SDK runtime types.
* Additive client bindings codegen output.
* No wire-format changes.
# Expected complexity level and risk
2 - Low to moderate
* Mostly additive code + codegen.
* The main risk is correctness/compat of generated SQL strings and
name/casing conventions across languages; this is mitigated by targeted
unit tests + full C# regression test runs.
# Testing
- [X] Ran run-regression-tests.sh successfully after regenerating C#
bindings.
- [X] Ran C# unit tests using `dotnet test
sdks/csharp/tests~/tests.csproj -c Release`
- [X] Added a new unit test suite
(`sdks/csharp/tests~/QueryBuilderTests.cs`) validating:
  * Identifier quoting / escaping
* Literal formatting (including `Identity`/`ConnectionId`/`Uuid` hex
literals; `U128` integer literal)
  * null + enum unsupported behavior throws
  * Boolean expression parenthesization (`And`/`Or`/`Not`)
  * `Where(...)` overloads including `IxCols`-based predicates
  * left/right semijoin SQL formatting and predicate chaining
2026-01-28 02:12:59 +00:00
Mazdak Farrokhzad d6bc325244 Define TableName and ReducerName backed by EcoString (#4137)
# Description of Changes

The first commit defines a type `TableName` that is used in e.g.,
`TxData` and where determined profitable and necessary to do this
change.
`TableName` is backed by
[`ecow::EcoString`](https://docs.rs/ecow/0.2.6/ecow/string/struct.EcoString.html)
which affords O(1) clones and 15 bytes of inline storage and
`mem::size_of::<EcoString>() == 16`.

The second commit does the same for `ReducerName`. This is also used in
reducer execution.

Together, these commits increase TPS by around 5-7k TPS.

# API and ABI breaking changes

None

# Expected complexity level and risk

1

# Testing

Covered by existing tests.
2026-01-27 23:20:30 +00:00
Tyler Cloutier 504b13ba4a Small docs improvement (#4071)
# Description of Changes

  Two documentation improvements:

1. **Reducers documentation**: Clarified that using global/static
variables in reducers is **undefined behavior**, not just "values won't
persist". Added six specific reasons why this is undefined:
     - Fresh execution environments
     - Module updates
     - Concurrent execution
     - Crash recovery
     - Non-transactional updates
     - Replay safety

2. **Access permissions documentation**: Replaced the "Combining Both
Techniques" example that used indexes on Option fields (which
SpacetimeDB doesn't support) with a working example that filters by a
required `department` field instead.

  # API and ABI breaking changes

  None. Documentation only.

  # Expected complexity level and risk

  1 - Documentation changes only.

  # Testing

  - [ ] Verify the reducers warning is clear and accurate
  - [ ] Verify the access permissions example compiles and makes sense

---------

Signed-off-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>
Co-authored-by: clockwork-labs-bot <clockwork-labs-bot@users.noreply.github.com>
Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2026-01-27 21:37:11 +00:00
Mazdak Farrokhzad 91b33a7c6c Optimize TxData + DatabaseUpdate for fast construction (#4138)
# Description of Changes

Rework `TxData` to:
- store all information for a table together in a single type
`TxDataTableEntry` rather than having several different maps.
- be constructed as fast as possible.
- fit every entry within a single cache line, i.e., `(TableId,
TxDataTableEntry)` takes up 64 bytes.
- fit a single table entry inline to optimize for small transactions.
- expose methods `{inserts, deletes}_for_table` to make `DeltaTx`
faster.

Rework `DatabaseUpdate` to:
- store a single `DatabaseTableUpdate` inline
- make `from_writes` profit from the changes to `TxData`, avoiding the
temporary hash map and allocating the necessary capacity from the start.

# API and ABI breaking changes

None

# Expected complexity level and risk

3? Fairly simple changes, but in important places.

# Testing

Existing tests are changed to match the changes to `TxData`.
2026-01-27 20:48:14 +00:00
Noa b181061453 [TS] Implement ctx.random() (#3907)
# Description of Changes

Uses the xoroshiro128+ implementation from the `pure-rand` package.

# Expected complexity level and risk

1 - this API is "userspace" only.

# Testing

<!-- Describe any testing you've done, and any testing you'd like your
reviewers to do,
so that you're confident that all the changes work as expected! -->

- [x] Verified that the pcg32 implementation is correct and matches the
rust version it's based off of
- [ ] Add a test using `ctx.random()`
2026-01-27 20:27:45 +00:00
John Detter 2044a536b0 Upgrade version to 1.12.0 (#4084)
# Description of Changes

<!-- Please describe your change, mention any related tickets, and so on
here. -->

Version upgrade to `v1.12.0`.

# API and ABI breaking changes

<!-- If this is an API or ABI breaking change, please apply the
corresponding GitHub label. -->

None

# Expected complexity level and risk

1 - this is just a version upgrade

<!--
How complicated do you think these changes are? Grade on a scale from 1
to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex
change.

This complexity rating applies not only to the complexity apparent in
the diff,
but also to its interactions with existing and future code.

If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning
ways. -->

# Testing

<!-- Describe any testing you've done, and any testing you'd like your
reviewers to do,
so that you're confident that all the changes work as expected! -->

The testsuite failures are fixed by
https://github.com/clockworklabs/SpacetimeDB/pull/4120

- [x] License has been properly updated including version number and
date
- [x] CI passes

---------

Co-authored-by: rekhoff <r.ekhoff@clockworklabs.io>
Co-authored-by: clockwork-labs-bot <clockwork-labs-bot@users.noreply.github.com>
2026-01-27 18:15:36 +00:00
Mazdak Farrokhzad 8348151915 define SmallHashMap in spacetimedb_data_structures (#4136)
# Description of Changes

Defines `SmallHashMap` in `spacetimedb_data_structures`.
The data structure is a hybrid map that is backed by a vector and linear
scan for the first `M` elements.
Then it falls back into a normal hash map.
For the first `N` elements, where `N < M`, the vector is stored inline.
That is, the vector is a `SmallVec<[(K, V); N>`.
The structure is optimized for access patterns where the keys and values
are accessed together,
therefore, keys and values are not stored separately.

# API and ABI breaking changes

None, just additive.

# Expected complexity level and risk

1

# Testing

A comprehensive proptest suite is added for the datastructure.
2026-01-27 15:15:23 +00:00
Mazdak Farrokhzad cf33ad9c41 optimize view_for_update to do nothing when there are no views (#4134)
# Description of Changes

Skip more work in `MutTxId::view_for_update` when there are no views.
This is a gain of a few kTPS and results in `view_for_update`
disappearing from flamegraphs.

# API and ABI breaking changes

None

# Expected complexity level and risk

1

# Testing

Covered by existing tests.
2026-01-27 12:05:28 +00:00
Mazdak Farrokhzad ccd5532774 eval_updates_sequential: comment out tracing (#4132)
# Description of Changes

Comment out tracing for `eval_updates_sequential`.
This alone results in a net gain of a 9k TPS.

# API and ABI breaking changes

None

# Expected complexity level and risk

1

# Testing

No semantic changes.
2026-01-27 12:01:18 +00:00
Mazdak Farrokhzad 36418160f3 optimize datastore by using ty.layout.fixed more (#4133)
# Description of Changes

Exploit `(ty: RowTypeLayout).layout.fixed` to avoid some work involving
var-len stuff:
- skip `required_var_len_granules_for_row` for only-fixed-len layouts.
- skip `write_large_blobs` for only-fixed-len layouts.
- add a fast path in `has_space_for_row` for only-fixed-len layouts.

This resulted in these methods disappearing in flamegraphs.

# API and ABI breaking changes

None

# Expected complexity level and risk

2, core datastore, but fairly trivial.

# Testing

Covered by existing tests.
2026-01-27 11:59:50 +00:00
John Detter c3848d53db CI: Fix of C# tests failures (#4121)
# Description of Changes

(jdetter): Github marked Ryan's PR as merged because I rebased it
without updating the base branch first - my bad.
Original PR: https://github.com/clockworklabs/SpacetimeDB/pull/4120

This PR fixes C#-related CI failures when testing against `v1.12.0`
before the corresponding NuGet packages are available on nuget.org.

* CI: Ensure local C# NuGet packages are used consistently
* Pack `crates/bindings-csharp/{BSATN.Runtime,Runtime}` with `-c
Release` so the configured local package sources (`bin/Release`)
actually contain the `.nupkg`s.
* Run `./sdks/csharp/tools~/write-nuget-config.sh` in CI to generate a
`NuGet.Config` that maps `SpacetimeDB.BSATN.Runtime` /
`SpacetimeDB.Runtime` to those local sources (with `nuget.org` as
fallback for non-SpacetimeDB dependencies).
* Add an explicit `dotnet restore --configfile NuGet.Config` step before
tests, and `run dotnet test --no-restore`, so restore always uses the
intended config and does not “accidentally” restore from `nuget.org`.
* `write-nuget-config.sh`: Make NuGet config discovery + mapping
deterministic
* Write `NuGet.Config` (capitalized) and include `<clear />` + an
explicit `nuget.org` source to avoid inherited sources and to keep
`PackageSourceMapping` functional.
* Also write a repo-root `NuGet.Config` so `dotnet publish/pack` invoked
from templates (outside `sdks/csharp/`) still discovers the same
override behavior.
* Smoketests quickstart: avoid `PackageSourceMapping` restore failures
* Ensure smoketest helper packing uses `Release`, and when repo-root
`NuGet.Config` exists, perform `dotnet restore --configfile ...` +
`dotnet pack --no-restore` so pack/restore are evaluated with the same
sources/mapping.
* When editing configs, prefer `NuGet.Config` casing for Linux discovery
and ensure `nuget.org` exists as a source for the fallback mapping.

# API and ABI breaking changes

No changes

# Expected complexity level and risk

1

# Testing

- [X] Locally tested concept after simulating local repro.
- [x] Confirmed CI passes in this branch

---------

Co-authored-by: rekhoff <r.ekhoff@clockworklabs.io>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2026-01-27 05:22:47 +00:00
John Detter 7e202db606 Fix the upgrade version tool (#4085)
# Description of Changes

<!-- Please describe your change, mention any related tickets, and so on
here. -->

This fixes 2 issues with the upgrade version tool:
1. The typescript bindings need to be updated otherwise the typescript
test in CI will fail
2. The snapshots need to be updated

When the version upgrade tool check in CI runs, snapshot changes are
accepted automatically via the `--accept-snapshots` cli argument. When
you are running this tool locally without `--accept-snapshots` you will
be asked to manually review the snapshot changes before doing a final
test to make sure the snapshots are correct.

# API and ABI breaking changes

<!-- If this is an API or ABI breaking change, please apply the
corresponding GitHub label. -->

None

# Expected complexity level and risk

1 - this just updates the version upgrade tool

<!--
How complicated do you think these changes are? Grade on a scale from 1
to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex
change.

This complexity rating applies not only to the complexity apparent in
the diff,
but also to its interactions with existing and future code.

If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning
ways. -->

# Testing

<!-- Describe any testing you've done, and any testing you'd like your
reviewers to do,
so that you're confident that all the changes work as expected! -->

- [x] Version bump 1.12.0 worked:
https://github.com/clockworklabs/SpacetimeDB/pull/4084
- [x] CI passes

---------

Signed-off-by: John Detter <4099508+jdetter@users.noreply.github.com>
Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
2026-01-27 03:28:10 +00:00
Zeke Foppa a6f2ba29b7 Hide LLM benchmark files in git diffs (#4111)
# Description of Changes

Marked the llm benchmark files as autogenerated so they are marked as
"autogenerated" in github diffs.

# API and ABI breaking changes

None

# Expected complexity level and risk

1

# Testing

- [x] They are marked correctly as autogenerated if I push a change to
those files

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2026-01-26 22:18:16 +00:00
Noa 2dce720738 Allow setting custom v8 flags (#4126)
# Description of Changes

As on the tin.

# Expected complexity level and risk

1

# Testing

n/a
2026-01-26 20:33:21 +00:00
clockwork-tien f7a22018d0 feat: create Vue framework sdk (#4037)
# Description of Changes

The PR implements the following updates:
- Create Vue framework sdk
- Add Vue Quickstart Docs
- Create `vue-ts` template

# Screenshots
- `vue-ts` template
<img width="1512" height="862" alt="Screenshot"
src="https://github.com/user-attachments/assets/15c8209b-ec7f-4f4a-a5b4-5174ddd068be"
/>

- Vue Quickstart Docs
<img width="1392" height="854" alt="image"
src="https://github.com/user-attachments/assets/57650232-81fa-43d3-be5a-135aa1799f05"
/>


<!-- Please describe your change, mention any related tickets, and so on
here. -->

# API and ABI breaking changes

<!-- If this is an API or ABI breaking change, please apply the
corresponding GitHub label. -->

# Expected complexity level and risk

<!--
How complicated do you think these changes are? Grade on a scale from 1
to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex
change.

This complexity rating applies not only to the complexity apparent in
the diff,
but also to its interactions with existing and future code.

If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning
ways. -->

# Testing

<!-- Describe any testing you've done, and any testing you'd like your
reviewers to do,
so that you're confident that all the changes work as expected! -->

- [ ] <!-- maybe a test you want to do -->
- [ ] <!-- maybe a test you want a reviewer to do, so they can check it
off when they're satisfied. -->

---------

Co-authored-by: clockwork-labs-bot <clockwork-labs-bot@users.noreply.github.com>
2026-01-26 16:41:18 +00:00
Mazdak Farrokhzad 7138defc6e Make all VmMetrics for the reducers and views of a module in InstanceCommon::new (#4106)
# Description of Changes

With this PR, all `VmMetrics` for all the reducers and views of a module
are made in `InstanceCommon::new`
so that they are never made in `call_{reducer/view}_with_tx`.

Here's a flamegraph before this PR, zooming in on the smaller
`call_reducer_with_tx`

<img width="1877" height="617" alt="image"
src="https://github.com/user-attachments/assets/9751c066-2bf0-4ded-a091-afa7d3b5dd75"
/>

And after, for the same `call_reducer_with_tx`:

<img width="1883" height="610" alt="image"
src="https://github.com/user-attachments/assets/27083acd-d4c9-4b69-94c7-c26c7f1e7cef"
/>

Here are the performance numbers:
```
wasm, index=hash, branch=master, commit = af4d3f39e4
ran for 10.097515999 seconds
completed 1310720
throughput was 129806.18204812016 TPS

wasm, index=hash, branch=master, commit = bac3d2a5a928af896d315fcfdf709d42e3577b66
ran for 10.842949063 seconds
completed 1474560
throughput was 135992.52301495385 TPS
```

As you can see, this is a gain of about 6k TPS on the phoenix_nap
machine.

The second commit also adds the `d3-flamegraph-base.html` and stuff to
`.gitignore` to facilitate taking flamegraphs.

# API and ABI breaking changes

None

# Expected complexity level and risk

1, trivial changes that are not load bearing.
2026-01-26 10:18:08 +00:00
Zeke Foppa 7f6fd18018 Re-run the LLM benchmarks update (#4110)
# Description of Changes

Try fixing this again? It seems to pass on PRs if re-run.

# API and ABI breaking changes

None.

# Expected complexity level and risk

1

# Testing

- [x] It passes on this PR now 🤷

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
Co-authored-by: clockwork-labs-bot <clockwork-labs-bot@users.noreply.github.com>
2026-01-23 22:58:10 +00:00
Ryan 0f0a867d90 Removing1.5.0 DLLs (#4100)
# Description of Changes

Removes 1.5.0 DLLs from repo

# API and ABI breaking changes

Unity will complain locally until you regenerate the DLLs

# Expected complexity level and risk

1 - Trivial

# Testing

- [x] Confirm CI pass
- [X] Local tests are passing

---------

Signed-off-by: Ryan <r.ekhoff@clockworklabs.io>
Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com>
Co-authored-by: clockwork-labs-bot <clockwork-labs-bot@users.noreply.github.com>
2026-01-23 21:28:24 +00:00
kormann e06d916023 fix cross reducer call TS reference (#4104)
the TS reference was slightly missing. you need assign a variable to the
reducer to call it cross context

# Description of Changes

slight reference fix

Signed-off-by: kormann <49917710+DKormann@users.noreply.github.com>
2026-01-23 19:23:01 +00:00
Piotr Sarnacki cd1ec90d16 Templates naming standarization (#4042)
# Description of Changes

This PR renames the templates to always use shorthand for the language,
specify a framework (or console) if necessary, and shorten the naming in
general

# Expected complexity level and risk

1

# Testing

I've tested generating templates manually

---------

Co-authored-by: clockwork-labs-bot <clockwork-labs-bot@users.noreply.github.com>
2026-01-23 16:08:23 +00:00
Mazdak Farrokhzad 07a95187dc Add HashMapBlobStore::merge_from (#4091)
# Description of Changes

See tin.

Will be used in a follow up PR to optimize merge.

# API and ABI breaking changes

None

# Expected complexity level and risk

1

# Testing

Exercised in a follow up PR.
2026-01-23 13:52:13 +00:00
Noa 825b451294 Bump to v8 145 (#4073)
# Description of Changes

This release has a couple of patches I've been waiting on for a bit:

* https://github.com/denoland/rusty_v8/pull/1868, which mean we no
longer have to use high slot indexes.
* https://github.com/denoland/rusty_v8/pull/1886, which allows us to
lazily parse sourcemaps.
* I also bumped `sourcemap` to get
https://github.com/getsentry/rust-sourcemap/pull/137, so that we no
longer have to have our hack to work around that.
* https://github.com/denoland/rusty_v8/pull/1892, which allows us to
re-enable `run_timeout_and_cb_every` (though I haven't done that in this
PR)

# Expected complexity level and risk

2: v8 is a very big and important dependency, but also very stable.

# Testing

- [x] No change to behavior; automated testing is sufficient.

---------

Signed-off-by: Noa <coolreader18@gmail.com>
Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>
2026-01-23 13:49:34 +00:00
John Detter d8d63e2d29 Reduce Test Suite test concurrency to reduce test flakes (#3979)
# Description of Changes

<!-- Please describe your change, mention any related tickets, and so on
here. -->

This PR started as an experiment to see if restricting the amount of
test job threads would reduce the flakiness in the `Test Suite` CI job.
I have tested several values here (`1`, `2` and `10`) and I believe 2 is
very stable. I'm also very confused with this change because it seems
like somehow the `Test Suite` CI job is now faster than it was before:

Before:

<img width="502" height="57" alt="image"
src="https://github.com/user-attachments/assets/d944041c-8ccc-4382-a8a7-06e7ff5cba12"
/>

After:

<img width="481" height="46" alt="image"
src="https://github.com/user-attachments/assets/49b89143-b201-4a1a-820c-13e5b3feda76"
/>

It's possible that having less test threads means less cpu contention on
the github runners, but I'm not completely sure. It could also somehow
be less lock contention in SpacetimeDB. I have looked at the output of
the `Test Suite` job and it does appear that all tests are running.

# API and ABI breaking changes

<!-- If this is an API or ABI breaking change, please apply the
corresponding GitHub label. -->

None

# Expected complexity level and risk

0 - this only updates our workflow and has no impact on the code.

<!--
How complicated do you think these changes are? Grade on a scale from 1
to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex
change.

This complexity rating applies not only to the complexity apparent in
the diff,
but also to its interactions with existing and future code.

If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning
ways. -->

# Testing

<!-- Describe any testing you've done, and any testing you'd like your
reviewers to do,
so that you're confident that all the changes work as expected! -->

- [x] CI is passing and `Test Suite` is less flakey

---------

Signed-off-by: John Detter <4099508+jdetter@users.noreply.github.com>
2026-01-23 10:30:57 +00:00
Kilian Strunz af4d3f39e4 Make new Uuid type Filterable (#3991)
# Description of Changes

`Uuid` addad in the last update is not filterable even though it is
`Copy` and (imo) obviously _very_ suited to filter.
Promote it to a special `FilterableValue` in the same way as `Identity`
and adjust the docs.

# API and ABI breaking changes

None

# Expected complexity level and risk

1. Only copies the same strategy as `Identity` which is also a newtype
wrapper around a integer like `Uuid`

# Testing

Tested on my project.

After the change:
<img width="586" height="298" alt="image"
src="https://github.com/user-attachments/assets/98e97c16-906b-4e66-b132-676ece40462e"
/>

Before the change:
<img width="1495" height="547" alt="image"
src="https://github.com/user-attachments/assets/da74e49a-1dbd-43ae-9b13-39dcc39c81dc"
/>


You can also test this yourself when adding:
`spacetimedb = { version = "1.11.2", git =
"https://github.com/kistz/SpacetimeDB.git", branch = "uuid-as-filter" }`
to your cargo.toml project

- [x] Tested before and after. Before it was a compiler error afterwards
not.
2026-01-23 00:37:19 +00:00
Mazdak Farrokhzad 011c2fdbc9 Add PointerMap::{iter, merge_from} (#4092)
# Description of Changes

See tin.

Will be used to optimize merge.

# API and ABI breaking changes

None

# Expected complexity level and risk

1

# Testing

Exercised in follow up.
2026-01-22 20:27:27 +00:00
Mazdak Farrokhzad 79558ea082 copy_filter & co: make blob handling more flexible (#4096)
# Description of Changes

Makes `Pages::copy_filter` more flexible by allowing passing in no blob
store (policy) so that the in a follow PR, blob stores can be merged
wholesale instead, so that transaction merging can be optimized.

# API and ABI breaking changes

None

# Expected complexity level and risk

1

# Testing

`copy_filter` and friends are currently unused but will be used in
follow ups.
2026-01-22 18:37:06 +00:00
Ryan 1fd3394972 Add cargo ci dlls command for building C# DLLs and NuGet packages (#4033)
# Description of Changes
* Added a new `cargo ci dlls` subcommand to build/pack the in-repo C#
NuGet packages and the C# SDK.
* `cargo ci dlls` restores `sdks/csharp/SpacetimeDB.ClientSDK.csproj`
using the freshly built local package outputs as to populate
`sdks/csharp/packages/**`.
* Added a Unity `.meta` skeleton under
`sdks/csharp/unity-meta-skeleton~/**` and overlays those `.meta` files
onto the latest restored versioned package directory to keep Unity GUIDs
stable and import settings consistent.
* Unity-specific import fixes are captured in the skeleton overlay
(notably: preventing Unity from importing incompatible TFMs like
`net8.0`, and marking analyzer DLLs with the `RoslynAnalyzer` label so
Unity can recognize them).
# How to use (local)
```bash
# Build/pack + restore local packages into sdks/csharp/packages/**
cargo ci dlls
```
# API and ABI breaking changes
N/A
# Expected complexity level and risk
2 - Local developer tooling + file overlay into restore output; no
runtime/SDK API behavior changes.
# Testing
- [x] `cargo check -p ci`
- [x] Ran `cargo ci dlls` and verified the output under
`sdks/csharp/packages/**` and the various NuGet package locations.
- [x] Tested a Unity project importing the SpacetimeDB SDK after
generating output and confirmed no errors.

---------

Signed-off-by: Ryan <r.ekhoff@clockworklabs.io>
Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com>
2026-01-22 18:26:55 +00:00
doug e0b7e32fc1 Fix test failure in fresh checkout of repository (#4056)
# Description of Changes

Use relative import `'../src'` in serde.test.ts to match all other test
files.

This is a consistency fix. The `'spacetimedb'` import works in CI (build
runs first, enabling package self-reference), but all other tests use
`'../src'`.

# API and ABI breaking changes

None

# Expected complexity level and risk

1
2026-01-22 17:48:07 +00:00
Tyler Cloutier 35cf7f9a09 Pass --yes flag from dev command to generate command (#4069)
# Description of Changes

When `--yes` is passed to `spacetime dev`, the flag is now also passed
through to the internal `spacetime generate` call. This ensures that
generate skips its interactive prompts when running in non-interactive
mode.

  # API and ABI breaking changes

  None.

  # Expected complexity level and risk

1 - Trivial change. Adds a conditional argument to an internal command
invocation.

  # Testing

- [x] Run `spacetime dev --yes` and verify generate does not prompt for
confirmation
- [x] Run `spacetime dev` (without --yes) and verify generate still
prompts as expected

---------

Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com>
2026-01-22 17:23:55 +00:00
Shubham Mishra 2560846f22 Rust: client query builder (#4003)
# Description of Changes
Client Query builder for rust, as per proposal -
https://github.com/clockworklabs/SpacetimeDBPrivate/pull/2356.

1. Pach moves query builder to its separate crate, so that it can be
shared between module and sdk.
2. Implements `TypedSubscriptionBuilder` in `sdks/rust` as mentioned in
proposal
3. Modify codegen to extend types to support query builder as mentioned
in proposal
4. a test

# API and ABI breaking changes
NA, additive changes.

# Expected complexity level and risk
2

# Testing
Added a test.

---------

Signed-off-by: Shubham Mishra <shivam828787@gmail.com>
Co-authored-by: joshua-spacetime <josh@clockworklabs.io>
2026-01-22 15:37:22 +00:00
John Detter 2a03818d1b Do not block CI on llm benchmarks (#4095)
# Description of Changes

<!-- Please describe your change, mention any related tickets, and so on
here. -->

@cloutiertyler when you fix the llm benchmarks feel free to revert this
PR.

# API and ABI breaking changes

<!-- If this is an API or ABI breaking change, please apply the
corresponding GitHub label. -->

None

# Expected complexity level and risk

0

<!--
How complicated do you think these changes are? Grade on a scale from 1
to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex
change.

This complexity rating applies not only to the complexity apparent in
the diff,
but also to its interactions with existing and future code.

If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning
ways. -->

# Testing

<!-- Describe any testing you've done, and any testing you'd like your
reviewers to do,
so that you're confident that all the changes work as expected! -->

- [x] CI runs even if llm benchmark fails
2026-01-22 10:09:28 +00:00