Update 00250-zen-of-spacetimedb.md#4145
Conversation
Signed-off-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>
JulienLavocat
left a comment
There was a problem hiding this comment.
I like the "samsung-given bandwidth" :D
|
/update-llm-benchmark |
LLM Benchmark Results (ci-quickfix)
Compared against master branch baseline Generated at: 2026-01-27T22:07:18.787Z Failure Analysis (click to expand)Benchmark Failure AnalysisGenerated from: Summary
Analysis of SpacetimeDB Benchmark Test FailuresRust / Rustdoc_JSON FailuresCompile/Publish Errors (4 failures)Failure Group: Scheduled Functions1. Code Examples LLM Output: #[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::Interval(Duration::from_micros(50_000).into()),
});
}
#[spacetimedb::reducer]
pub fn tick(_ctx: &ReducerContext, _row: TickTimer) {
}Expected (golden): #[table(name = tick_timer, scheduled(tick))]
pub struct TickTimer {
#[primary_key]
#[auto_inc]
pub scheduled_id: u64,
pub scheduled_at: ScheduleAt,
}
#[reducer(init)]
pub fn init(ctx: &ReducerContext) -> Result<(), String> {
ctx.db.tick_timer().insert(TickTimer {
scheduled_id: 0,
scheduled_at: ScheduleAt::Interval(Duration::from_millis(50).into()),
});
Ok(())
}
#[reducer]
pub fn tick(_ctx: &ReducerContext, _row: TickTimer) -> Result<(), String> {
Ok(())
}2. Error: 3. Differences:
4. Root Cause: 5. Recommendation:
Failure Group: Structs in Tables1. Code Examples LLM Output: #[derive(SpacetimeType)]
pub struct Position {
x: i32,
y: i32,
}
#[table(name = entity)]
pub struct Entity {
#[primary_key]
id: i32,
pos: Position,
}Expected (golden): #[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,
}2. Error: 3. Differences:
4. Root Cause: 5. Recommendation:
Other Failures (4 failures)Failure Group: Incomplete Functions and Missing Return Types1. Code Examples LLM Output: #[spacetimedb::reducer]
pub fn empty_reducer_no_args(_ctx: &ReducerContext) { }
#[spacetimedb::reducer]
pub fn empty_reducer_with_int(_ctx: &ReducerContext, count: i32) { }Expected (golden): #[reducer]
pub fn empty_reducer_no_args(ctx: &ReducerContext) -> Result<(), String> {
Ok(())
}
#[reducer]
pub fn empty_reducer_with_int(ctx: &ReducerContext, count: i32) -> Result<(), String> {
Ok(())
}2. Error: 3. Differences:
4. Root Cause: 5. Recommendation:
C# / Docs FailuresOther Failures (4 failures)Failure Group: Table Not Found Errors1. Code Examples LLM Output: [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"
});
}Expected (golden): [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"
});
}2. Error: 3. Differences:
4. Root Cause: 5. Recommendation:
This analysis highlights common patterns in the failures, including issues with function return types, public access modifiers, and correct syntax for API functions in both Rust and C#. The recommendations aim to enhance clarity and ensure adherence to SpacetimeDB’s requirements. |
|
/update-llm-benchmark |
# Description of Changes Small rewording of the Zen document, fixed some typos. --------- Signed-off-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com> Co-authored-by: clockwork-labs-bot <clockwork-labs-bot@users.noreply.github.com>
Description of Changes
Small rewording of the Zen document, fixed some typos.