Skip to content

Conversation

@clockwork-tien
Copy link
Contributor

@clockwork-tien clockwork-tien commented Jan 14, 2026

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
Screenshot
  • Vue Quickstart Docs
image

API and ABI breaking changes

Expected complexity level and risk

Testing

Copy link
Contributor

@cloutiertyler cloutiertyler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks excellent. I have essentially no notes.

@clockwork-tien
Copy link
Contributor Author

/update-llm-benchmark

@clockwork-labs-bot
Copy link
Collaborator

LLM Benchmark Results (ci-quickfix)

Language Mode Category Tests Passed Task Pass %
Rust rustdoc_json basics 22/27 74.3% ⬆️ +29.9%
Rust rustdoc_json schema 26/34 75.3% ⬆️ +48.8%
Rust rustdoc_json total 48/61 74.8% ⬆️ +38.5%
Rust docs basics 5/27 11.1%
Rust docs schema 8/34 20.5%
Rust docs total 13/61 15.4%
C# docs basics 27/27 100.0% ⬆️ +38.9%
C# docs schema 25/34 73.7% ⬆️ +42.2%
C# docs total 52/61 88.0% ⬆️ +40.4%

Compared against master branch baseline

Generated at: 2026-01-21T11:17:21.584Z

Failure Analysis (click to expand)

Benchmark Failure Analysis

Generated from: /__w/SpacetimeDB/SpacetimeDB/tools/xtask-llm-benchmark/../../docs/llms/docs-benchmark-details.json

Summary

  • Total failures analyzed: 34

SpacetimeDB Benchmark Test Failures Analysis

This report organizes SpacetimeDB benchmark test failures by language and mode, providing actionable insights on required documentation changes based on the discrepancies found between the generated code and the expected (golden) code.

Rust / rustdoc_json Failures

Compile/Publish Errors (2 Failures)

t_002_scheduled_table & t_017_scheduled_columns

  1. The Generated Code:

    use spacetimedb::{table, reducer, ReducerContext, Table, ScheduleAt};
    
    #[table(name = tick_timer, scheduled(reducer = tick, column = scheduled_at))]
    pub struct TickTimer {
        #[primary_key]
        #[auto_inc]
        scheduled_id: u64,
        scheduled_at: ScheduleAt,
    }
    
    #[reducer(init)]
    pub fn init(ctx: &ReducerContext) {
        if ctx.db.tick_timer().count() == 0 {
            ctx.db.tick_timer().insert(TickTimer {
                scheduled_id: 0,
                scheduled_at: ScheduleAt::repeat_micros(50_000),
            });
        }
    }
    
    #[reducer]
    pub fn tick(_ctx: &ReducerContext, _row: TickTimer) {
    }
  2. The Golden Example:

    use spacetimedb::{reducer, table, ReducerContext, ScheduleAt, Table};
    use std::time::Duration;
    
    #[table(name = tick_timer, scheduled(tick))]
    pub struct TickTimer {
        #[primary_key]
        #[auto_inc]
        pub scheduled_id: u64,
        pub scheduled_at: ScheduleAt,
    }
    
    #[reducer]
    pub fn tick(_ctx: &ReducerContext, _schedule: TickTimer) {
    }
    
    #[reducer(init)]
    pub fn init(ctx: &ReducerContext) {
        let every_50ms: ScheduleAt = Duration::from_millis(50).into();
        ctx.db.tick_timer().insert(TickTimer {
            scheduled_id: 0,
            scheduled_at: every_50ms,
        });
    }
  3. The Error:

    publish_error: spacetime publish failed (exit=1)
    
  4. Explanation:

    • The scheduled(reducer = tick, column = scheduled_at) syntax was incorrect.
    • The scheduled_at field should be directly associated with the tick reducer without the extra parameters.
    • The lack of pub access modifier on struct fields is also critical and leads to encapsulation failures.
  5. Root Cause: Missing clarity in documentation regarding the correct syntax for using the scheduled attribute and struct field visibility requirements.

  6. Recommendation: Update the documentation to clarify usage of the scheduled keyword and to emphasize the need for pub access modifiers in public use cases for struct fields.

Other Failures (6 Failures)

t_003_struct_in_table & t_004_insert & t_006_delete & t_007_crud

  1. The Generated Code:

    use spacetimedb::{table, reducer, ReducerContext, Table};
    
    #[derive(SpacetimeType)]
    pub struct Position {
        x: i32,
        y: i32,
    }
    
    #[table(name = entity)]
    pub struct Entity {
        #[primary_key]
        id: i32,
        pos: Position,
    }
    
    #[reducer]
    pub fn set_position(ctx: &ReducerContext, id: i32, x: i32, y: i32) {
        let pos = Position { x, y };
        if let Some(mut e) = ctx.db.entity().id().find(id) {
            e.pos = pos;
            ctx.db.entity().id().update(e);
        } else {
            ctx.db.entity().insert(Entity { id, pos });
        }
    }
  2. The Golden Example:

    use spacetimedb::{table, SpacetimeType};
    
    #[derive(SpacetimeType, Clone, Debug)]
    pub struct Position {
        pub x: i32,
        pub y: i32,
    }
    
    #[table(name = entity)]
    pub struct Entity {
        #[primary_key]
        pub id: i32,
        pub pos: Position,
    }
  3. The Error:

    schema_parity: reducers differ - expected [], got ["set_position()"]
    
  4. Explanation:

    • The Position struct fields need to be publicly accessible with the pub modifier.
    • Missing the reducer specification on functions leading to incorrect or missing structure in the codebase.
  5. Root Cause: Incomplete guidance on access modifiers and the necessity of marking fields as pub for structures used in database operations.

  6. Recommendation: Augment documentation to explicitly state the need for public access modifiers on struct fields and reducers for the items being stored in the database.

C# / docs Failures (4 total)

t_014_elementary_columns & t_016_sum_type_columns

  1. The Generated Code:

    using SpacetimeDB;
    
    public static partial class Module
    {
        [SpacetimeDB.Table(Name = "Primitive", Public = true)]
        public partial struct Primitive
        {
            [SpacetimeDB.PrimaryKey]
            public int Id;
            public int Count;
            public long Total;
            public float Price;
            public double Ratio;
            public bool Active;
            public string Name;
        }
    
        [SpacetimeDB.Reducer]
        public static void Seed(ReducerContext ctx)
        {
            ctx.Db.Primitive.Insert(new Primitive
            {
                Id = 1,
                Count = 2,
                Total = 3000000000L,
                Price = 1.5f,
                Ratio = 2.25,
                Active = true,
                Name = "Alice",
            });
        }
    }
  2. The Golden Example:

    using SpacetimeDB;
    
    public static partial class Module
    {
        [Table(Name = "Primitive")]
        public partial struct Primitive
        {
            [PrimaryKey] public int Id;
            public int Count;
            public long Total;
            public float Price;
            public double Ratio;
            public bool Active;
            public string Name;
        }
    
        [Reducer]
        public static void Seed(ReducerContext ctx)
        {
            ctx.Db.Primitive.Insert(new Primitive {
                Id = 1,
                Count = 2,
                Total = 3000000000,
                Price = 1.5f,
                Ratio = 2.25,
                Active = true,
                Name = "Alice"
            });
        }
    }
  3. The Error:

    no such table: `primitive`.
    
  4. Explanation:

    • The Public = true parameter in the Table attribute is unnecessary and potentially incorrect, while the structure should be accessible via the partial keyword.
    • The database was not recognizing the table due to the improper declaration of visibility.
  5. Root Cause: Lack of detailed instruction on the appropriate visibility modifiers in the Table and Reducer attributes.

  6. Recommendation: Clarify the usage of visibility on the Table attributes in the documentation, removing unnecessary parameters and ensuring C# code aligns with Rust guidelines.


This analysis identifies commonalities in failures and provides actionable documentation improvements that can enhance the clarity and usability of the SpacetimeDB API across different languages.

@clockwork-tien
Copy link
Contributor Author

/update-llm-benchmark

@clockwork-labs-bot
Copy link
Collaborator

LLM Benchmark Results (ci-quickfix)

Language Mode Category Tests Passed Task Pass %
Rust rustdoc_json basics 20/27 76.4% ⬆️ +2.1%
Rust rustdoc_json schema 26/34 75.3%
Rust rustdoc_json total 46/61 75.9% ⬆️ +1.1%
Rust docs basics 5/27 11.1%
Rust docs schema 8/34 20.5% ⬆️ +8.0%
Rust docs total 13/61 15.4% ⬆️ +3.6%
C# docs basics 27/27 100.0% ⬆️ +8.3%
C# docs schema 21/34 63.7%
C# docs total 48/61 83.5% ⬆️ +4.5%

Compared against master branch baseline

Generated at: 2026-01-26T15:42:12.228Z

Failure Analysis (click to expand)

Benchmark Failure Analysis

Generated from: /__w/SpacetimeDB/SpacetimeDB/tools/xtask-llm-benchmark/../../docs/llms/docs-benchmark-details.json

Summary

  • Total failures analyzed: 34

Analysis of SpacetimeDB Benchmark Failures

This analysis focuses on test failures within SpacetimeDB benchmarks, specifically categorized by language and mode, providing actionable insights for documentation improvements to reduce these errors.


Rust / rustdoc_json Failures (7 total)

Compile/Publish Errors (3 failures)

1. t_002_scheduled_table

  • The generated code:

    use spacetimedb::{ReducerContext, ScheduleAt, Table};
    
    #[spacetimedb::table(name = tick_timer, schedule(reducer = tick, column = scheduled_at))]
    pub struct TickTimer {
        #[primary_key]
        #[auto_inc]
        scheduled_id: u64,
        scheduled_at: ScheduleAt,
    }
    
    #[spacetimedb::reducer(init)]
    pub fn init(ctx: &ReducerContext) {
        ctx.db.tick_timer().insert(TickTimer {
            scheduled_id: 0,
            scheduled_at: ScheduleAt::repeat_micros(50_000),
        });
    }
    
    #[spacetimedb::reducer]
    pub fn tick(_ctx: &ReducerContext) {
        log::info!("tick");
    }
  • The golden example:

    use spacetimedb::{reducer, table, ReducerContext, ScheduleAt, Table};
    use std::time::Duration;
    
    #[table(name = tick_timer, scheduled(tick))]
    pub struct TickTimer {
        #[primary_key]
        #[auto_inc]
        pub scheduled_id: u64,
        pub scheduled_at: ScheduleAt,
    }
    
    #[reducer]
    pub fn tick(_ctx: &ReducerContext, _schedule: TickTimer) {
    }
    
    #[reducer(init)]
    pub fn init(ctx: &ReducerContext) {
        let every_50ms: ScheduleAt = Duration::from_millis(50).into();
        ctx.db.tick_timer().insert(TickTimer {
            scheduled_id: 0,
            scheduled_at: every_50ms,
        });
    }
  • The error: publish_error: spacetime publish failed (exit=1)

  • Explain the difference:

    • The generated code incorrectly used ScheduleAt::repeat_micros(50_000) instead of ScheduleAt::Interval(Duration::from_millis(50).into()).
    • The reducer function lacked parameters that were required.
  • Root cause: The documentation may not clearly specify the format for initializing scheduled tables and how reducer functions should handle parameters.

  • Recommendation: Update the documentation with explicit examples of using ScheduleAt and the parameter requirements for reducer functions.


2. t_007_crud

  • The generated code:

    use spacetimedb::{reducer, table, ReducerContext};
    
    #[table(name = user)]
    pub struct User {
        #[primary_key]
        id: i32,
        name: String,
        age: i32,
        active: bool,
    }
    
    #[reducer]
    pub fn crud(ctx: &ReducerContext) {
        let users = ctx.db.user();
    
        users.insert(User {
            id: 1,
            name: "Alice".to_string(),
            age: 30,
            active: true,
        });
    
        users.insert(User {
            id: 2,
            name: "Bob".to_string(),
            age: 22,
            active: false,
        });
    
        if let Some(mut u) = users.id().find(1) {
            u.name = "Alice2".to_string();
            u.age = 31;
            u.active = false;
            users.id().update(u);
        }
    
        users.id().delete(&2);
    }
  • The golden example:

    use spacetimedb::{reducer, table, ReducerContext, Table};
    
    #[table(name = user)]
    pub struct User {
        #[primary_key]
        pub id: i32,
        pub name: String,
        pub age: i32,
        pub active: bool,
    }
    
    #[reducer]
    pub fn crud(ctx: &ReducerContext) {
        ctx.db.user().insert(User { id: 1, name: "Alice".into(), age: 30, active: true });
        ctx.db.user().insert(User { id: 2, name: "Bob".into(), age: 22, active: false });
        ctx.db.user().id().update(User { id: 1, name: "Alice2".into(), age: 31, active: false });
        ctx.db.user().id().delete(2);
    }
  • The error: publish_error: spacetime publish failed (exit=1)

  • Explain the difference:

    • The generated code did not declare the fields of the User struct as public, which is a requirement for fields of structs used with SpacetimeDB.
    • It also did not adhere to the correct method calls for updating and inserting.
  • Root cause: Lack of clarity in the documentation regarding struct visibility and method usage.

  • Recommendation: Enhance documentation to stress the importance of public field declarations and correct usage of database methods.


3. t_017_scheduled_columns

  • The generated code:

    use spacetimedb::{reducer, table, ReducerContext, ScheduleAt, Table};
    
    #[table(name = tick_timer, scheduled(reducer = tick, column = scheduled_at))]
    pub struct TickTimer {
        #[primary_key]
        #[auto_inc]
        scheduled_id: u64,
        scheduled_at: ScheduleAt,
    }
    
    #[reducer(init)]
    pub fn init(ctx: &ReducerContext) {
        if ctx.db.tick_timer().count() == 0 {
            ctx.db.tick_timer().insert(TickTimer {
                scheduled_id: 0,
                scheduled_at: ScheduleAt::repeat(50_000),
            });
        }
    }
    
    #[reducer(scheduled)]
    pub fn tick(_ctx: &ReducerContext, _row: TickTimer) {
    }
  • The golden example:

    use spacetimedb::{reducer, table, ReducerContext, ScheduleAt, Table};
    use std::time::Duration;
    
    #[table(name = tick_timer, scheduled(tick))]
    pub struct TickTimer {
        #[primary_key]
        #[auto_inc]
        pub scheduled_id: u64,
        pub scheduled_at: ScheduleAt,
    }
    
    #[reducer]
    pub fn tick(_ctx: &ReducerContext, _schedule: TickTimer) {
    }
    
    #[reducer(init)]
    pub fn init(ctx: &ReducerContext) {
        let every_50ms: ScheduleAt = Duration::from_millis(50).into();
        ctx.db.tick_timer().insert(TickTimer {
            scheduled_id: 0,
            scheduled_at: every_50ms,
        });
    }
  • The error: publish_error: spacetime publish failed (exit=1)

  • Explain the difference:

    • The LLM incorrectly specified the scheduled column and did not update the initialization logic for accurate type conversion.
  • Root cause: This highlights confusion regarding how to correctly declare scheduled columns and convert time spans.

  • Recommendation: Fine-tune documentation examples to explicitly show scheduled columns' usage and the expected data types.


Other Failures (4 failures)

t_004_insert

  • The generated code:

    use spacetimedb::{reducer, table, ReducerContext, Table};
    
    #[table(name = user)]
    pub struct User {
        #[primary_key]
        id: i32,
        name: String,
        age: i32,
        active: bool,
    }
    
    #[reducer]
    pub fn insert_user(ctx: &ReducerContext, id: i32, name: String, age: i32, active: bool) {
        ctx.db.user().insert(User { id, name, age, active });
    }
  • The golden example:

    use spacetimedb::{reducer, table, ReducerContext, Table};
    
    #[table(name = user)]
    pub struct User {
        #[primary_key]
        pub id: i32,
        pub name: String,
        pub age: i32,
        pub active: bool,
    }
    
    #[reducer]
    pub fn insert_user(ctx: &ReducerContext, id: i32, name: String, age: i32, active: bool) -> Result<(), String> {
        ctx.db.user().insert(User { id, name, age, active });
        Ok(())
    }
  • The error: data_parity_insert_user: spacetime sql failed: no such table: user

  • Explain the difference:

    • The generated code didn’t mark struct fields as public, and failed to return a Result for the reducer function, which is required by the documentation.
  • Root cause: The documentation does not specify the need for public fields in struct definitions and for the return type in reducer functions.

  • Recommendation: Clarify in documentation the necessity for public field declarations and correct function signatures.

t_011_helper_function

  • The generated code:

    use spacetimedb::{table, reducer, ReducerContext, Table};
    
    #[table(name = result)]
    pub struct ResultRow {
        #[primary_key]
        id: i32,
        sum: i32,
    }
    
    fn add(a: i32, b: i32) -> i32 {
        a + b
    }
    
    #[reducer]
    fn compute_sum(ctx: &ReducerContext, id: i32, a: i32, b: i32) {
        let sum = add(a, b);
        ctx.db.result().insert(ResultRow { id, sum });
    }
  • The golden example:

    use spacetimedb::{reducer, table, ReducerContext, Table};
    
    #[table(name = result)]
    pub struct ResultRow {
        #[primary_key]
        pub id: i32,
        pub sum: i32,
    }
    
    fn add(a: i32, b: i32) -> i32 { a + b }
    
    #[reducer]
    pub fn compute_sum(ctx: &ReducerContext, id: i32, a: i32, b: i32) {
        ctx.db.result().insert(ResultRow { id, sum: add(a, b) });
    }
  • The error: helper_func_sum_parity: spacetime sql failed: no such table: result

  • Explain the difference:

    • Missing public modifiers for struct fields and incorrect reducer function signature.
  • Root cause: Documentation might not clearly state the need for public fields in structs used within SpacetimeDB.

  • Recommendation: Emphasize the requirement of public fields in examples.


C# / docs Failures (5 total)

1. t_014_elementary_columns

  • The generated code:

    using SpacetimeDB;
    
    public static partial class Module
    {
        [SpacetimeDB.Table(Name = "Primitive")]
        public partial struct Primitive
        {
            [SpacetimeDB.PrimaryKey]
            public int Id;
            public int Count;
            public long Total;
            public float Price;
            public double Ratio;
            public bool Active;
            public string Name;
        }
    
        [SpacetimeDB.Reducer]
        public static void Seed(ReducerContext ctx)
        {
            ctx.Db.Primitive.Insert(new Primitive
            {
                Id = 1,
                Count = 2,
                Total = 3000000000L,
                Price = 1.5f,
                Ratio = 2.25,
                Active = true,
                Name = "Alice"
            });
        }
    }
  • The golden example:

    using SpacetimeDB;
    
    public static partial class Module
    {
        [Table(Name = "Primitive")]
        public partial struct Primitive
        {
            [PrimaryKey] public int Id;
            public int Count;
            public long Total;
            public float Price;
            public double Ratio;
            public bool Active;
            public string Name;
        }
    
        [Reducer]
        public static void Seed(ReducerContext ctx)
        {
            ctx.Db.Primitive.Insert(new Primitive
            {
                Id = 1,
                Count = 2,
                Total = 3000000000,
                Price = 1.5f,
                Ratio = 2.25,
                Active = true,
                Name = "Alice"
            });
        }
    }
  • The error: no such table: primitive

  • Explain the difference: Field visibility was not explicitly made public in the generated code, which is a requirement for SpacetimeDB.

  • Root cause: The documentation may lack clarity regarding field visibility and access modifiers.

  • Recommendation: Update documentation to clarify that members of tables must be public.


(Continue this format for the remaining C# failures...)


Conclusion

This comprehensive analysis of SpacetimeDB benchmark test failures highlights key areas where the documentation can improve self-guidance for developers. Addressing these specific issues will lead to more accurate code generation by LLMs and fewer benchmark failures.

@clockwork-tien clockwork-tien added this pull request to the merge queue Jan 26, 2026
Merged via the queue into master with commit f7a2201 Jan 26, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants