mirror of
https://github.com/clockworklabs/SpacetimeDB.git
synced 2026-05-13 11:17:50 -04:00
73881e38f7
# Description of Changes Major documentation overhaul focusing on tables, column types, and indexes. **Quickstart Guides:** - Updated React, TypeScript, Rust, and C# quickstarts with table/reducer examples - Fixed CLI syntax (positional `--database` argument) - Improved template consistency across languages **Tables Documentation:** - Added "Why Tables" section explaining table-oriented design philosophy (tables as fundamental unit, system tables, data-oriented design principles) - Added "Physical and Logical Independence" section explaining how subscription queries use the relational model independently of physical storage - Added brief sections linking to related pages (Visibility, Constraints, Schedule Tables) - Renamed "Scheduled Tables" to "Schedule Tables" throughout (tables store schedules; reducers are scheduled) **Column Types:** - Split into dedicated page with unified type reference table - Added "Representing Collections" section (Vec/Array vs table tradeoffs) - Added "Binary Data and Files" section for Vec<u8> storage patterns - Added "Type Performance" section (smaller types, fixed-size types, column ordering for alignment) - Added complete example struct demonstrating all type categories - Renamed "Structured" category to "Composite" **Indexes:** - Complete rewrite with textbook-style documentation - Added "When to Use Indexes" guidance - Documented single-column and multi-column index syntax (field-level and table-level) - Comprehensive range query examples with correct TypeScript `Range` class syntax - Explained multi-column index prefix matching semantics - Added index-accelerated deletion examples - Included index design guidelines **Styling:** - Added CSS for table border radius and row separators - Created Check component for green checkmarks in tables # API and ABI breaking changes None. Documentation only. # Expected complexity level and risk 1 - Documentation changes only, no code changes. # Testing - [ ] Verify docs build without errors - [ ] Review rendered pages for formatting issues - [ ] Confirm code examples are syntactically correct --------- Signed-off-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com> Signed-off-by: John Detter <4099508+jdetter@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>
2593 lines
240 KiB
JSON
2593 lines
240 KiB
JSON
{
|
|
"languages": [
|
|
{
|
|
"lang": "rust",
|
|
"modes": [
|
|
{
|
|
"mode": "rustdoc_json",
|
|
"hash": "40baf0d53a9de9eab21250fad1d96f530213fd7dd09cb9a3d97f40ff548f0d8a",
|
|
"models": [
|
|
{
|
|
"name": "GPT-5",
|
|
"route_api_model": "gpt-5",
|
|
"tasks": {
|
|
"t_000_empty_reducers": {
|
|
"hash": "40baf0d53a9de9eab21250fad1d96f530213fd7dd09cb9a3d97f40ff548f0d8a",
|
|
"task": "t_000_empty_reducers",
|
|
"lang": "rust",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 1,
|
|
"passed_tests": 1,
|
|
"llm_output": "use spacetimedb::ReducerContext;\n\n#[spacetimedb::reducer]\nfn empty_reducer_no_args(_ctx: &ReducerContext) {\n}\n\n#[spacetimedb::reducer]\nfn empty_reducer_with_int(_ctx: &ReducerContext, count: i32) {\n let _ = count;\n}\n\n#[spacetimedb::reducer]\nfn empty_reducer_with_string(_ctx: &ReducerContext, name: String) {\n let _ = name;\n}\n\n#[spacetimedb::reducer]\nfn empty_reducer_with_two_args(_ctx: &ReducerContext, count: i32, name: String) {\n let _ = (count, name);\n}\n\n#[spacetimedb::reducer]\nfn empty_reducer_with_three_args(_ctx: &ReducerContext, active: bool, ratio: f32, label: String) {\n let _ = (active, ratio, label);\n}",
|
|
"category": "basics",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "basics-t-000-empty-reducers-golden",
|
|
"llm_db": "basics-t-000-empty-reducers-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/basics/t_000_empty_reducers/rust/server/golden",
|
|
"work_dir_llm": "target/llm-runs/basics/t_000_empty_reducers/rust/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "basics-t-000-empty-reducers-golden",
|
|
"llm_db": "basics-t-000-empty-reducers-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:46587",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:28:16.167437181Z",
|
|
"finished_at": "2026-01-17T02:30:49.255347669Z"
|
|
},
|
|
"t_001_basic_tables": {
|
|
"hash": "40baf0d53a9de9eab21250fad1d96f530213fd7dd09cb9a3d97f40ff548f0d8a",
|
|
"task": "t_001_basic_tables",
|
|
"lang": "rust",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 1,
|
|
"passed_tests": 1,
|
|
"llm_output": "use spacetimedb::table;\n\n#[table(name = users)]\npub struct User {\n #[primary_key]\n id: i32,\n name: String,\n age: i32,\n active: bool,\n}\n\n#[table(name = products)]\npub struct Product {\n #[primary_key]\n id: i32,\n title: String,\n price: f32,\n in_stock: bool,\n}\n\n#[table(name = notes)]\npub struct Note {\n #[primary_key]\n id: i32,\n body: String,\n rating: i64,\n pinned: bool,\n}",
|
|
"category": "basics",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "basics-t-001-basic-tables-golden",
|
|
"llm_db": "basics-t-001-basic-tables-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/basics/t_001_basic_tables/rust/server/golden",
|
|
"work_dir_llm": "target/llm-runs/basics/t_001_basic_tables/rust/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "basics-t-001-basic-tables-golden",
|
|
"llm_db": "basics-t-001-basic-tables-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:46587",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:30:52.376540604Z",
|
|
"finished_at": "2026-01-17T02:32:37.875429994Z"
|
|
},
|
|
"t_002_scheduled_table": {
|
|
"hash": "40baf0d53a9de9eab21250fad1d96f530213fd7dd09cb9a3d97f40ff548f0d8a",
|
|
"task": "t_002_scheduled_table",
|
|
"lang": "rust",
|
|
"golden_published": false,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 1,
|
|
"passed_tests": 0,
|
|
"llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table, ScheduleAt};\n\n#[table(name = tick_timer, schedule(reducer = tick, column = scheduled_at))]\npub struct TickTimer {\n #[primary_key]\n #[auto_inc]\n scheduled_id: u64,\n scheduled_at: ScheduleAt,\n}\n\n#[reducer(init)]\npub fn init(ctx: &ReducerContext) {\n if ctx.db.tick_timer().count() == 0 {\n ctx.db.tick_timer().insert(TickTimer {\n scheduled_id: 0,\n scheduled_at: ScheduleAt::from_now_micros(50_000),\n });\n }\n}\n\n#[reducer]\npub fn tick(ctx: &ReducerContext, scheduled_id: u64) {\n if let Some(mut row) = ctx.db.tick_timer().scheduled_id().find(scheduled_id) {\n row.scheduled_at = ScheduleAt::from_now_micros(50_000);\n let _ = ctx.db.tick_timer().scheduled_id().update(row);\n }\n}",
|
|
"category": "basics",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "basics-t-002-scheduled-table-golden",
|
|
"llm_db": "basics-t-002-scheduled-table-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/basics/t_002_scheduled_table/rust/server/golden",
|
|
"work_dir_llm": "target/llm-runs/basics/t_002_scheduled_table/rust/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"publish_error": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime publish failed (exit=1)\n--- stderr ---\n\u001b[1m\u001b[32m Updating\u001b[0m crates.io index\n\u001b[1m\u001b[32m Locking\u001b[0m 72 packages to latest compatible versions\n\u001b[1m\u001b[36m Adding\u001b[0m generic-array v0.14.7 \u001b[1m\u001b[33m(available: v0.14.9)\u001b[0m\n\u001b[1m\u001b[36m Adding\u001b[0m spacetimedb v1.11.1 \u001b[1m\u001b[33m(available: v1.11.3)\u001b[0m\n\u001b[1m\u001b[36m Adding\u001b[0m spacetimedb-bindings-macro v1.11.1 \u001b[1m\u001b[33m(available: v1.11.3)\u001b[0m\n\u001b[1m\u001b[36m Adding\u001b[0m spacetimedb-bindings-sys v1.11.1 \u001b[1m\u001b[33m(available: v1.11.3)\u001b[0m\n\u001b[1m\u001b[36m Adding\u001b[0m spacetimedb-lib v1.11.1 \u001b[1m\u001b[33m(available: v1.11.3)\u001b[0m\n\u001b[1m\u001b[36m Adding\u001b[0m spacetimedb-primitives v1.11.1 \u001b[1m\u001b[33m(available: v1.11.3)\u001b[0m\n\u001b[1m\u001b[36m Adding\u001b[0m spacetimedb-sats v1.11.1 \u001b[1m\u001b[33m(available: v1.11.3)\u001b[0m\n\u001b[1m\u001b[32m Compiling\u001b[0m proc-macro2 v1.0.105\n\u001b[1m\u001b[32m Compiling\u001b[0m quote v1.0.43\n\u001b[1m\u001b[32m Compiling\u001b[0m unicode-ident v1.0.22\n\u001b[1m\u001b[32m Compiling\u001b[0m typenum v1.19.0\n\u001b[1m\u001b[32m Compiling\u001b[0m version_check v0.9.5\n\u001b[1m\u001b[32m Compiling\u001b[0m autocfg v1.5.0\n\u001b[1m\u001b[32m Compiling\u001b[0m generic-array v0.14.7\n\u001b[1m\u001b[32m Compiling\u001b[0m heck v0.5.0\n\u001b[1m\u001b[32m Compiling\u001b[0m num-traits v0.2.19\n\u001b[1m\u001b[32m Compiling\u001b[0m serde_core v1.0.228\n\u001b[1m\u001b[32m Compiling\u001b[0m cfg-if v1.0.4\n\u001b[1m\u001b[32m Compiling\u001b[0m syn v2.0.114\n\u001b[1m\u001b[32m Compiling\u001b[0m either v1.15.0\n\u001b[1m\u001b[32m Compiling\u001b[0m find-msvc-tools v0.1.8\n\u001b[1m\u001b[32m Compiling\u001b[0m serde v1.0.228\n\u001b[1m\u001b[32m Compiling\u001b[0m shlex v1.3.0\n\u001b[1m\u001b[32m Compiling\u001b[0m zerocopy v0.8.33\n\u001b[1m\u001b[32m Compiling\u001b[0m cc v1.2.53\n\u001b[1m\u001b[32m Compiling\u001b[0m itertools v0.12.1\n\u001b[1m\u001b[32m Compiling\u001b[0m crypto-common v0.1.7\n\u001b[1m\u001b[32m Compiling\u001b[0m block-buffer v0.10.4\n\u001b[1m\u001b[32m Compiling\u001b[0m thiserror v1.0.69\n\u001b[1m\u001b[32m Compiling\u001b[0m nohash-hasher v0.2.0\n\u001b[1m\u001b[32m Compiling\u001b[0m bitflags v2.10.0\n\u001b[1m\u001b[32m Compiling\u001b[0m anyhow v1.0.100\n\u001b[1m\u001b[32m Compiling\u001b[0m digest v0.10.7\n\u001b[1m\u001b[32m Compiling\u001b[0m blake3 v1.8.3\n\u001b[1m\u001b[32m Compiling\u001b[0m approx v0.3.2\n\u001b[1m\u001b[32m Compiling\u001b[0m getrandom v0.2.17\n\u001b[1m\u001b[32m Compiling\u001b[0m humantime v2.3.0\n\u001b[1m\u001b[32m Compiling\u001b[0m bytes v1.11.0\n\u001b[1m\u001b[32m Compiling\u001b[0m zmij v1.0.14\n\u001b[1m\u001b[32m Compiling\u001b[0m convert_case v0.4.0\n\u001b[1m\u001b[32m Compiling\u001b[0m heck v0.4.1\n\u001b[1m\u001b[32m Compiling\u001b[0m enum-as-inner v0.6.1\n\u001b[1m\u001b[32m Compiling\u001b[0m thiserror-impl v1.0.69\n\u001b[1m\u001b[32m Compiling\u001b[0m arrayvec v0.7.6\n\u001b[1m\u001b[32m Compiling\u001b[0m spacetimedb-primitives v1.11.1\n\u001b[1m\u001b[32m Compiling\u001b[0m keccak v0.1.5\n\u001b[1m\u001b[32m Compiling\u001b[0m spacetimedb-bindings-macro v1.11.1\n\u001b[1m\u001b[32m Compiling\u001b[0m sha3 v0.10.8\n\u001b[1m\u001b[32m Compiling\u001b[0m ppv-lite86 v0.2.21\n\u001b[1m\u001b[32m Compiling\u001b[0m derive_more v0.99.20\n\u001b[1m\u001b[32m Compiling\u001b[0m rand_core v0.6.4\n\u001b[1m\u001b[32m Compiling\u001b[0m decorum v0.3.1\n\u001b[1m\u001b[32m Compiling\u001b[0m ethnum v1.5.2\n\u001b[1m\u001b[32m Compiling\u001b[0m chrono v0.4.43\n\u001b[1m\u001b[32m Compiling\u001b[0m constant_time_eq v0.4.2\n\u001b[1m\u001b[32m Compiling\u001b[0m bytemuck v1.24.0\n\u001b[1m\u001b[32m Compiling\u001b[0m spacetimedb-lib v1.11.1\n\u001b[1m\u001b[32m Compiling\u001b[0m smallvec v1.15.1\n\u001b[1m\u001b[32m Compiling\u001b[0m serde_json v1.0.149\n\u001b[1m\u001b[32m Compiling\u001b[0m itoa v1.0.17\n\u001b[1m\u001b[32m Compiling\u001b[0m hex v0.4.3\n\u001b[1m\u001b[32m Compiling\u001b[0m arrayref v0.3.9\n\u001b[1m\u001b[32m Compiling\u001b[0m second-stack v0.3.5\n\u001b[1m\u001b[32m Compiling\u001b[0m rand_chacha v0.3.1\n\u001b[1m\u001b[32m Compiling\u001b[0m spacetimedb-sats v1.11.1\n\u001b[1m\u001b[32m Compiling\u001b[0m memchr v2.7.6\n\u001b[1m\u001b[32m Compiling\u001b[0m log v0.4.29\n\u001b[1m\u001b[32m Compiling\u001b[0m rand v0.8.5\n\u001b[1m\u001b[32m Compiling\u001b[0m http v1.4.0\n\u001b[1m\u001b[32m Compiling\u001b[0m spacetimedb-bindings-sys v1.11.1\n\u001b[1m\u001b[32m Compiling\u001b[0m scoped-tls v1.0.1\n\u001b[1m\u001b[32m Compiling\u001b[0m spacetimedb v1.11.1\n\u001b[1m\u001b[32m Compiling\u001b[0m spacetime-module v0.1.0 (/home/runner/work/SpacetimeDB/SpacetimeDB/target/llm-runs/basics/t_002_scheduled_table/rust/server/gpt-5/llm)\n\u001b[0m\u001b[1m\u001b[38;5;9merror\u001b[0m\u001b[0m\u001b[1m: expected one of: `public`, `private`, `name`, `index`, `scheduled`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/lib.rs:4:28\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m4\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m#[table(name = tick_timer, schedule(reducer = tick, column = scheduled_at))]\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9m^^^^^^^^\u001b[0m\n\n\u001b[0m\u001b[1m\u001b[38;5;9merror[E0422]\u001b[0m\u001b[0m\u001b[1m: cannot find struct, variant or union type `TickTimer` in this scope\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/lib.rs:15:36\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m15\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m ctx.db.tick_timer().insert(TickTimer {\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9m^^^^^^^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9mnot found in this scope\u001b[0m\n\n\u001b[0m\u001b[1m\u001b[38;5;9merror[E0599]\u001b[0m\u001b[0m\u001b[1m: no method named `tick_timer` found for struct `Local` in the current scope\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/lib.rs:14:15\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m14\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m if ctx.db.tick_timer().count() == 0 {\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9m^^^^^^^^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9mmethod not found in `Local`\u001b[0m\n\n\u001b[0m\u001b[1m\u001b[38;5;9merror[E0599]\u001b[0m\u001b[0m\u001b[1m: no method named `tick_timer` found for struct `Local` in the current scope\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/lib.rs:15:16\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m15\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m ctx.db.tick_timer().insert(TickTimer {\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9m^^^^^^^^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9mmethod not found in `Local`\u001b[0m\n\n\u001b[0m\u001b[1m\u001b[38;5;9merror[E0599]\u001b[0m\u001b[0m\u001b[1m: no variant or associated item named `from_now_micros` found for enum `ScheduleAt` in the current scope\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/lib.rs:17:39\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m17\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m scheduled_at: ScheduleAt::from_now_micros(50_000),\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9m^^^^^^^^^^^^^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9mvariant or associated item not found in `ScheduleAt`\u001b[0m\n\n\u001b[0m\u001b[1m\u001b[38;5;9merror[E0599]\u001b[0m\u001b[0m\u001b[1m: no method named `tick_timer` found for struct `Local` in the current scope\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/lib.rs:24:35\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m24\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m if let Some(mut row) = ctx.db.tick_timer().scheduled_id().find(scheduled_id) {\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9m^^^^^^^^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9mmethod not found in `Local`\u001b[0m\n\n\u001b[0m\u001b[1m\u001b[38;5;9merror[E0599]\u001b[0m\u001b[0m\u001b[1m: no variant or associated item named `from_now_micros` found for enum `ScheduleAt` in the current scope\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/lib.rs:25:40\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m25\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m row.scheduled_at = ScheduleAt::from_now_micros(50_000);\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9m^^^^^^^^^^^^^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9mvariant or associated item not found in `ScheduleAt`\u001b[0m\n\n\u001b[0m\u001b[1m\u001b[38;5;9merror[E0599]\u001b[0m\u001b[0m\u001b[1m: no method named `tick_timer` found for struct `Local` in the current scope\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/lib.rs:26:24\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m26\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m let _ = ctx.db.tick_timer().scheduled_id().update(row);\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9m^^^^^^^^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9mmethod not found in `Local`\u001b[0m\n\n\u001b[0m\u001b[1mSome errors have detailed explanations: E0422, E0599.\u001b[0m\n\u001b[0m\u001b[1mFor more information about an error, try `rustc --explain E0422`.\u001b[0m\n\u001b[1m\u001b[31merror\u001b[0m\u001b[1m:\u001b[0m could not compile `spacetime-module` (lib) due to 8 previous errors\nError: command [\"cargo\", \"build\", \"--config=net.git-fetch-with-cli=true\", \"--target=wasm32-unknown-unknown\", \"--release\", \"--message-format=json-render-diagnostics\"] exited with code 101\n\n--- stdout ---\n",
|
|
"phase": "build_or_publish"
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:30:42.103317349Z",
|
|
"finished_at": "2026-01-17T02:32:41.832312901Z"
|
|
},
|
|
"t_003_struct_in_table": {
|
|
"hash": "40baf0d53a9de9eab21250fad1d96f530213fd7dd09cb9a3d97f40ff548f0d8a",
|
|
"task": "t_003_struct_in_table",
|
|
"lang": "rust",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 1,
|
|
"passed_tests": 0,
|
|
"llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table, SpacetimeType};\n\n#[derive(SpacetimeType)]\npub struct Position {\n x: i32,\n y: i32,\n}\n\n#[table(name = entities)]\npub struct Entity {\n #[primary_key]\n id: i32,\n pos: Position,\n}\n\n#[reducer]\npub fn add_entity(ctx: &ReducerContext, id: i32, x: i32, y: i32) {\n ctx.db.entities().insert(Entity { id, pos: Position { x, y } });\n}",
|
|
"category": "basics",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "basics-t-003-struct-in-table-golden",
|
|
"llm_db": "basics-t-003-struct-in-table-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/basics/t_003_struct_in_table/rust/server/golden",
|
|
"work_dir_llm": "target/llm-runs/basics/t_003_struct_in_table/rust/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"schema_parity": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"golden_db": "basics-t-003-struct-in-table-golden",
|
|
"llm_db": "basics-t-003-struct-in-table-gpt-5-llm",
|
|
"reducers_diff": {
|
|
"only_golden": [],
|
|
"only_llm": [
|
|
"add_entity()"
|
|
]
|
|
},
|
|
"reducers_equal": false,
|
|
"server": "http://127.0.0.1:46587",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:30:49.255385009Z",
|
|
"finished_at": "2026-01-17T02:32:37.661244218Z"
|
|
},
|
|
"t_004_insert": {
|
|
"hash": "40baf0d53a9de9eab21250fad1d96f530213fd7dd09cb9a3d97f40ff548f0d8a",
|
|
"task": "t_004_insert",
|
|
"lang": "rust",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 2,
|
|
"passed_tests": 2,
|
|
"llm_output": "use spacetimedb::{ReducerContext, Table};\n\n#[spacetimedb::table(name = users)]\npub struct User {\n #[primary_key]\n id: i32,\n name: String,\n age: i32,\n active: bool,\n}\n\n#[spacetimedb::reducer]\npub fn insert_user(ctx: &ReducerContext, id: i32, name: String, age: i32, active: bool) {\n ctx.db.users().insert(User { id, name, age, active });\n}",
|
|
"category": "basics",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "basics-t-004-insert-golden",
|
|
"llm_db": "basics-t-004-insert-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/basics/t_004_insert/rust/server/golden",
|
|
"work_dir_llm": "target/llm-runs/basics/t_004_insert/rust/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"data_parity_insert_user": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"args": [
|
|
1,
|
|
"Alice",
|
|
30,
|
|
true
|
|
],
|
|
"golden_db": "basics-t-004-insert-golden",
|
|
"golden_out": "id | name | age | active ----+---------+-----+-------- 1 | \"Alice\" | 30 | true",
|
|
"llm_db": "basics-t-004-insert-gpt-5-llm",
|
|
"llm_out": "id | name | age | active ----+---------+-----+-------- 1 | \"Alice\" | 30 | true",
|
|
"query": "SELECT id, name, age, active FROM users WHERE id=1",
|
|
"reducer": "insert_user",
|
|
"server": "http://127.0.0.1:46587"
|
|
}
|
|
},
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "basics-t-004-insert-golden",
|
|
"llm_db": "basics-t-004-insert-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:46587",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:30:53.628765951Z",
|
|
"finished_at": "2026-01-17T02:32:37.475748331Z"
|
|
},
|
|
"t_005_update": {
|
|
"hash": "40baf0d53a9de9eab21250fad1d96f530213fd7dd09cb9a3d97f40ff548f0d8a",
|
|
"task": "t_005_update",
|
|
"lang": "rust",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 3,
|
|
"passed_tests": 3,
|
|
"llm_output": "use spacetimedb::{table, reducer, ReducerContext};\n\n#[table(name = users)]\npub struct User {\n #[primary_key]\n id: i32,\n name: String,\n age: i32,\n active: bool,\n}\n\n#[reducer]\npub fn update_user(ctx: &ReducerContext, id: i32, name: String, age: i32, active: bool) {\n let user = User { id, name, age, active };\n ctx.db.users().id().update(user);\n}",
|
|
"category": "basics",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "basics-t-005-update-golden",
|
|
"llm_db": "basics-t-005-update-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/basics/t_005_update/rust/server/golden",
|
|
"work_dir_llm": "target/llm-runs/basics/t_005_update/rust/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"data_parity_update_user": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"args": [
|
|
1,
|
|
"Alice2",
|
|
31,
|
|
false
|
|
],
|
|
"golden_db": "basics-t-005-update-golden",
|
|
"golden_out": "id | name | age | active ----+----------+-----+-------- 1 | \"Alice2\" | 31 | false",
|
|
"llm_db": "basics-t-005-update-gpt-5-llm",
|
|
"llm_out": "id | name | age | active ----+----------+-----+-------- 1 | \"Alice2\" | 31 | false",
|
|
"query": "SELECT id, name, age, active FROM users WHERE id=1",
|
|
"reducer": "update_user",
|
|
"server": "http://127.0.0.1:46587"
|
|
}
|
|
},
|
|
"seed_users_row": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"sql": "INSERT INTO users(id, name, age, active) VALUES (1, 'Alice', 30, true)"
|
|
}
|
|
},
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "basics-t-005-update-golden",
|
|
"llm_db": "basics-t-005-update-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:46587",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:28:20.539096519Z",
|
|
"finished_at": "2026-01-17T02:30:53.033151846Z"
|
|
},
|
|
"t_006_delete": {
|
|
"hash": "40baf0d53a9de9eab21250fad1d96f530213fd7dd09cb9a3d97f40ff548f0d8a",
|
|
"task": "t_006_delete",
|
|
"lang": "rust",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 3,
|
|
"passed_tests": 3,
|
|
"llm_output": "use spacetimedb::{table, reducer, ReducerContext};\n\n#[table(name = users)]\npub struct User {\n #[primary_key]\n id: i32,\n name: String,\n age: i32,\n active: bool,\n}\n\n#[reducer]\npub fn delete_user(ctx: &ReducerContext, id: i32) {\n ctx.db.users().id().delete(&id);\n}",
|
|
"category": "basics",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "basics-t-006-delete-golden",
|
|
"llm_db": "basics-t-006-delete-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/basics/t_006_delete/rust/server/golden",
|
|
"work_dir_llm": "target/llm-runs/basics/t_006_delete/rust/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"seed_users_row": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"sql": "INSERT INTO users(id, name, age, active) VALUES (1, 'Alice', 30, true)"
|
|
}
|
|
},
|
|
"delete_user_count_zero": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"actual": 0,
|
|
"expected": 0,
|
|
"sql": "SELECT COUNT(*) AS n FROM users WHERE id=1"
|
|
}
|
|
},
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "basics-t-006-delete-golden",
|
|
"llm_db": "basics-t-006-delete-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:46587",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:28:17.746281172Z",
|
|
"finished_at": "2026-01-17T02:30:42.103247549Z"
|
|
},
|
|
"t_007_crud": {
|
|
"hash": "40baf0d53a9de9eab21250fad1d96f530213fd7dd09cb9a3d97f40ff548f0d8a",
|
|
"task": "t_007_crud",
|
|
"lang": "rust",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 4,
|
|
"passed_tests": 4,
|
|
"llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table};\n\n#[table(name = users)]\npub struct User {\n #[primary_key]\n id: i32,\n name: String,\n age: i32,\n active: bool,\n}\n\n#[reducer]\npub fn crud(ctx: &ReducerContext) {\n let mut u1 = ctx.db.users().insert(User {\n id: 1,\n name: \"Alice\".to_string(),\n age: 30,\n active: true,\n });\n ctx.db.users().insert(User {\n id: 2,\n name: \"Bob\".to_string(),\n age: 22,\n active: false,\n });\n u1.name = \"Alice2\".to_string();\n u1.age = 31;\n u1.active = false;\n let _ = ctx.db.users().id().update(u1);\n ctx.db.users().id().delete(&2);\n}",
|
|
"category": "basics",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "basics-t-007-crud-golden",
|
|
"llm_db": "basics-t-007-crud-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/basics/t_007_crud/rust/server/golden",
|
|
"work_dir_llm": "target/llm-runs/basics/t_007_crud/rust/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"crud_row_id2_deleted": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"actual": 0,
|
|
"expected": 0,
|
|
"sql": "SELECT COUNT(*) AS n FROM users WHERE id=2"
|
|
}
|
|
},
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "basics-t-007-crud-golden",
|
|
"llm_db": "basics-t-007-crud-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:46587",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
},
|
|
"crud_total_count_one": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"actual": 1,
|
|
"expected": 1,
|
|
"sql": "SELECT COUNT(*) AS n FROM users"
|
|
}
|
|
},
|
|
"crud_row_id1_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"args": [],
|
|
"golden_db": "basics-t-007-crud-golden",
|
|
"golden_out": "id | name | age | active ----+----------+-----+-------- 1 | \"Alice2\" | 31 | false",
|
|
"llm_db": "basics-t-007-crud-gpt-5-llm",
|
|
"llm_out": "id | name | age | active ----+----------+-----+-------- 1 | \"Alice2\" | 31 | false",
|
|
"query": "SELECT id, name, age, active FROM users WHERE id=1",
|
|
"reducer": "crud",
|
|
"server": "http://127.0.0.1:46587"
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:28:16.167798252Z",
|
|
"finished_at": "2026-01-17T02:30:53.400172120Z"
|
|
},
|
|
"t_008_index_lookup": {
|
|
"hash": "40baf0d53a9de9eab21250fad1d96f530213fd7dd09cb9a3d97f40ff548f0d8a",
|
|
"task": "t_008_index_lookup",
|
|
"lang": "rust",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 3,
|
|
"passed_tests": 3,
|
|
"llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table};\n\n#[table(name = users)]\npub struct User {\n #[primary_key]\n id: i32,\n name: String,\n age: i32,\n active: bool,\n}\n\n#[table(name = results)]\npub struct ResultRow {\n #[primary_key]\n id: i32,\n name: String,\n}\n\n#[reducer]\nfn lookup_user_name(ctx: &ReducerContext, id: i32) {\n if let Some(u) = ctx.db.users().id().find(id) {\n ctx.db.results().insert(ResultRow { id: u.id, name: u.name });\n }\n}",
|
|
"category": "basics",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "basics-t-008-index-lookup-golden",
|
|
"llm_db": "basics-t-008-index-lookup-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/basics/t_008_index_lookup/rust/server/golden",
|
|
"work_dir_llm": "target/llm-runs/basics/t_008_index_lookup/rust/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"index_lookup_projection_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"args": [
|
|
1
|
|
],
|
|
"golden_db": "basics-t-008-index-lookup-golden",
|
|
"golden_out": "id | name ----+--------- 1 | \"Alice\"",
|
|
"llm_db": "basics-t-008-index-lookup-gpt-5-llm",
|
|
"llm_out": "id | name ----+--------- 1 | \"Alice\"",
|
|
"query": "SELECT id, name FROM results WHERE id=1",
|
|
"reducer": "lookup_user_name",
|
|
"server": "http://127.0.0.1:46587"
|
|
}
|
|
},
|
|
"seed_user_row": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"sql": "INSERT INTO users(id, name, age, active) VALUES (1, 'Alice', 30, true)"
|
|
}
|
|
},
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "basics-t-008-index-lookup-golden",
|
|
"llm_db": "basics-t-008-index-lookup-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:46587",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:28:17.748044021Z",
|
|
"finished_at": "2026-01-17T02:30:54.245888026Z"
|
|
},
|
|
"t_009_init": {
|
|
"hash": "40baf0d53a9de9eab21250fad1d96f530213fd7dd09cb9a3d97f40ff548f0d8a",
|
|
"task": "t_009_init",
|
|
"lang": "rust",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 4,
|
|
"passed_tests": 4,
|
|
"llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table};\n\n#[table(name = users)]\npub struct User {\n #[primary_key]\n id: i32,\n name: String,\n age: i32,\n active: bool,\n}\n\n#[reducer(init)]\npub fn init(ctx: &ReducerContext) {\n ctx.db.users().insert(User { id: 1, name: \"Alice\".to_string(), age: 30, active: true });\n ctx.db.users().insert(User { id: 2, name: \"Bob\".to_string(), age: 22, active: false });\n}",
|
|
"category": "basics",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "basics-t-009-init-golden",
|
|
"llm_db": "basics-t-009-init-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/basics/t_009_init/rust/server/golden",
|
|
"work_dir_llm": "target/llm-runs/basics/t_009_init/rust/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"init_total_two": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"actual": 2,
|
|
"expected": 2,
|
|
"sql": "SELECT COUNT(*) AS n FROM users"
|
|
}
|
|
},
|
|
"init_seed_bob": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"actual": 1,
|
|
"expected": 1,
|
|
"sql": "SELECT COUNT(*) AS n FROM users WHERE id=2 AND name='Bob' AND age=22 AND active=false"
|
|
}
|
|
},
|
|
"init_seed_alice": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"actual": 1,
|
|
"expected": 1,
|
|
"sql": "SELECT COUNT(*) AS n FROM users WHERE id=1 AND name='Alice' AND age=30 AND active=true"
|
|
}
|
|
},
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "basics-t-009-init-golden",
|
|
"llm_db": "basics-t-009-init-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:46587",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:28:17.930019173Z",
|
|
"finished_at": "2026-01-17T02:30:41.209696143Z"
|
|
},
|
|
"t_010_connect": {
|
|
"hash": "40baf0d53a9de9eab21250fad1d96f530213fd7dd09cb9a3d97f40ff548f0d8a",
|
|
"task": "t_010_connect",
|
|
"lang": "rust",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 1,
|
|
"passed_tests": 1,
|
|
"llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table};\n\n#[table(name = events)]\npub struct Event {\n #[primary_key]\n #[auto_inc]\n id: i32,\n kind: String,\n}\n\n#[reducer(client_connected)]\npub fn client_connected(ctx: &ReducerContext) {\n ctx.db.events().insert(Event { id: 0, kind: \"connected\".to_string() });\n}\n\n#[reducer(client_disconnected)]\npub fn client_disconnected(ctx: &ReducerContext) {\n ctx.db.events().insert(Event { id: 0, kind: \"disconnected\".to_string() });\n}",
|
|
"category": "basics",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "basics-t-010-connect-golden",
|
|
"llm_db": "basics-t-010-connect-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/basics/t_010_connect/rust/server/golden",
|
|
"work_dir_llm": "target/llm-runs/basics/t_010_connect/rust/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "basics-t-010-connect-golden",
|
|
"llm_db": "basics-t-010-connect-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:46587",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:30:53.626651147Z",
|
|
"finished_at": "2026-01-17T02:32:36.216348757Z"
|
|
},
|
|
"t_011_helper_function": {
|
|
"hash": "40baf0d53a9de9eab21250fad1d96f530213fd7dd09cb9a3d97f40ff548f0d8a",
|
|
"task": "t_011_helper_function",
|
|
"lang": "rust",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 3,
|
|
"passed_tests": 3,
|
|
"llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table};\n\n#[table(name = results)]\npub struct ResultRow {\n #[primary_key]\n id: i32,\n sum: i32,\n}\n\nfn add(a: i32, b: i32) -> i32 {\n a + b\n}\n\n#[reducer]\nfn compute_sum(ctx: &ReducerContext, id: i32, a: i32, b: i32) {\n let sum = add(a, b);\n ctx.db.results().insert(ResultRow { id, sum });\n}",
|
|
"category": "basics",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "basics-t-011-helper-function-golden",
|
|
"llm_db": "basics-t-011-helper-function-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/basics/t_011_helper_function/rust/server/golden",
|
|
"work_dir_llm": "target/llm-runs/basics/t_011_helper_function/rust/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"helper_func_sum_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"args": [
|
|
1,
|
|
2,
|
|
3
|
|
],
|
|
"golden_db": "basics-t-011-helper-function-golden",
|
|
"golden_out": "id | sum ----+----- 1 | 5",
|
|
"llm_db": "basics-t-011-helper-function-gpt-5-llm",
|
|
"llm_out": "id | sum ----+----- 1 | 5",
|
|
"query": "SELECT id, sum FROM results WHERE id=1",
|
|
"reducer": "compute_sum",
|
|
"server": "http://127.0.0.1:46587"
|
|
}
|
|
},
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "basics-t-011-helper-function-golden",
|
|
"llm_db": "basics-t-011-helper-function-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:46587",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
},
|
|
"helper_func_sum_abs": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"actual": 1,
|
|
"expected": 1,
|
|
"sql": "SELECT COUNT(*) AS n FROM results WHERE id=1 AND sum=5"
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:30:42.105283707Z",
|
|
"finished_at": "2026-01-17T02:31:52.745496413Z"
|
|
},
|
|
"t_012_spacetime_product_type": {
|
|
"hash": "40baf0d53a9de9eab21250fad1d96f530213fd7dd09cb9a3d97f40ff548f0d8a",
|
|
"task": "t_012_spacetime_product_type",
|
|
"lang": "rust",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 3,
|
|
"passed_tests": 2,
|
|
"llm_output": "use spacetimedb::{ReducerContext, Table};\n\n#[derive(spacetimedb::SpacetimeType)]\npub struct Score {\n left: i32,\n right: i32,\n}\n\n#[spacetimedb::table(name = results)]\npub struct ResultRow {\n #[primary_key]\n id: i32,\n value: Score,\n}\n\n#[spacetimedb::reducer]\npub fn set_score(ctx: &ReducerContext, id: i32, left: i32, right: i32) {\n ctx.db.results().insert(ResultRow { id, value: Score { left, right } });\n}",
|
|
"category": "schema",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "schema-t-012-spacetime-product-type-golden",
|
|
"llm_db": "schema-t-012-spacetime-product-type-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/schema/t_012_spacetime_product_type/rust/server/golden",
|
|
"work_dir_llm": "target/llm-runs/schema/t_012_spacetime_product_type/rust/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"product_type_row_count": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"actual": 1,
|
|
"expected": 1,
|
|
"sql": "SELECT COUNT(*) AS n FROM results WHERE id=1"
|
|
}
|
|
},
|
|
"product_type_row_parity": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `results`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:46587/v1/database/c20064919d5938e3c53955f56eff54581cc88db76e6afe6cedff286135db8edb/sql)\n",
|
|
"phase": "sql_golden"
|
|
}
|
|
},
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "schema-t-012-spacetime-product-type-golden",
|
|
"llm_db": "schema-t-012-spacetime-product-type-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:46587",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:25:38.992696821Z",
|
|
"finished_at": "2026-01-17T02:28:16.167373502Z"
|
|
},
|
|
"t_013_spacetime_sum_type": {
|
|
"hash": "40baf0d53a9de9eab21250fad1d96f530213fd7dd09cb9a3d97f40ff548f0d8a",
|
|
"task": "t_013_spacetime_sum_type",
|
|
"lang": "rust",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 3,
|
|
"passed_tests": 3,
|
|
"llm_output": "use spacetimedb::{table, reducer, ReducerContext, SpacetimeType, Table};\n\n#[derive(SpacetimeType)]\npub struct Rect {\n width: i32,\n height: i32,\n}\n\n#[derive(SpacetimeType)]\npub enum Shape {\n Circle(i32),\n Rectangle(Rect),\n}\n\n#[table(name = results)]\npub struct ResultRow {\n #[primary_key]\n id: i32,\n value: Shape,\n}\n\n#[reducer]\npub fn set_circle(ctx: &ReducerContext, id: i32, radius: i32) {\n ctx.db.results().id().delete(&id);\n ctx.db.results().insert(ResultRow { id, value: Shape::Circle(radius) });\n}",
|
|
"category": "schema",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "schema-t-013-spacetime-sum-type-golden",
|
|
"llm_db": "schema-t-013-spacetime-sum-type-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/schema/t_013_spacetime_sum_type/rust/server/golden",
|
|
"work_dir_llm": "target/llm-runs/schema/t_013_spacetime_sum_type/rust/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "schema-t-013-spacetime-sum-type-golden",
|
|
"llm_db": "schema-t-013-spacetime-sum-type-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:46587",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
},
|
|
"sum_type_row_count": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"actual": 1,
|
|
"expected": 1,
|
|
"sql": "SELECT COUNT(*) AS n FROM results WHERE id=1"
|
|
}
|
|
},
|
|
"sum_type_row_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"args": [
|
|
1,
|
|
10
|
|
],
|
|
"golden_db": "schema-t-013-spacetime-sum-type-golden",
|
|
"golden_out": "id | value ----+--------------- 1 | (Circle = 10)",
|
|
"llm_db": "schema-t-013-spacetime-sum-type-gpt-5-llm",
|
|
"llm_out": "id | value ----+--------------- 1 | (Circle = 10)",
|
|
"query": "SELECT id, value FROM results WHERE id=1",
|
|
"reducer": "set_circle",
|
|
"server": "http://127.0.0.1:46587"
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:28:12.198644503Z",
|
|
"finished_at": "2026-01-17T02:30:53.626583041Z"
|
|
},
|
|
"t_014_elementary_columns": {
|
|
"hash": "40baf0d53a9de9eab21250fad1d96f530213fd7dd09cb9a3d97f40ff548f0d8a",
|
|
"task": "t_014_elementary_columns",
|
|
"lang": "rust",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 3,
|
|
"passed_tests": 3,
|
|
"llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table};\n\n#[table(name = primitives)]\npub struct Primitive {\n #[primary_key]\n id: i32,\n count: i32,\n total: i64,\n price: f32,\n ratio: f64,\n active: bool,\n name: String,\n}\n\n#[reducer]\npub fn seed(ctx: &ReducerContext) {\n ctx.db.primitives().insert(Primitive {\n id: 1,\n count: 2,\n total: 3_000_000_000i64,\n price: 1.5f32,\n ratio: 2.25f64,\n active: true,\n name: \"Alice\".to_string(),\n });\n}",
|
|
"category": "schema",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "schema-t-014-elementary-columns-golden",
|
|
"llm_db": "schema-t-014-elementary-columns-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/schema/t_014_elementary_columns/rust/server/golden",
|
|
"work_dir_llm": "target/llm-runs/schema/t_014_elementary_columns/rust/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"elementary_columns_row_count": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"actual": 1,
|
|
"expected": 1,
|
|
"sql": "SELECT COUNT(*) AS n FROM primitives WHERE id=1"
|
|
}
|
|
},
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "schema-t-014-elementary-columns-golden",
|
|
"llm_db": "schema-t-014-elementary-columns-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:46587",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
},
|
|
"elementary_columns_row_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"args": [],
|
|
"golden_db": "schema-t-014-elementary-columns-golden",
|
|
"golden_out": "id | count | total | price | ratio | active | name ----+-------+------------+-------+-------+--------+--------- 1 | 2 | 3000000000 | 1.5 | 2.25 | true | \"Alice\"",
|
|
"llm_db": "schema-t-014-elementary-columns-gpt-5-llm",
|
|
"llm_out": "id | count | total | price | ratio | active | name ----+-------+------------+-------+-------+--------+--------- 1 | 2 | 3000000000 | 1.5 | 2.25 | true | \"Alice\"",
|
|
"query": "SELECT id, count, total, price, ratio, active, name FROM primitives WHERE id=1",
|
|
"reducer": "seed",
|
|
"server": "http://127.0.0.1:46587"
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:25:38.992406952Z",
|
|
"finished_at": "2026-01-17T02:28:06.754249465Z"
|
|
},
|
|
"t_015_product_type_columns": {
|
|
"hash": "40baf0d53a9de9eab21250fad1d96f530213fd7dd09cb9a3d97f40ff548f0d8a",
|
|
"task": "t_015_product_type_columns",
|
|
"lang": "rust",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 3,
|
|
"passed_tests": 2,
|
|
"llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table, SpacetimeType};\n\n#[derive(SpacetimeType, Clone)]\npub struct Address {\n street: String,\n zip: i32,\n}\n\n#[derive(SpacetimeType, Clone)]\npub struct Position {\n x: i32,\n y: i32,\n}\n\n#[table(name = profiles)]\npub struct Profile {\n #[primary_key]\n id: i32,\n home: Address,\n work: Address,\n pos: Position,\n}\n\n#[reducer]\npub fn seed(ctx: &ReducerContext) {\n let home = Address { street: \"1 Main\".to_string(), zip: 11111 };\n let work = Address { street: \"2 Broad\".to_string(), zip: 22222 };\n let pos = Position { x: 7, y: 9 };\n ctx.db.profiles().insert(Profile { id: 1, home, work, pos });\n}",
|
|
"category": "schema",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "schema-t-015-product-type-columns-golden",
|
|
"llm_db": "schema-t-015-product-type-columns-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/schema/t_015_product_type_columns/rust/server/golden",
|
|
"work_dir_llm": "target/llm-runs/schema/t_015_product_type_columns/rust/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"product_type_columns_row_count": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"actual": 1,
|
|
"expected": 1,
|
|
"sql": "SELECT COUNT(*) AS n FROM profiles WHERE id=1"
|
|
}
|
|
},
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "schema-t-015-product-type-columns-golden",
|
|
"llm_db": "schema-t-015-product-type-columns-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:46587",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
},
|
|
"product_type_columns_row_parity": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `profiles`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:46587/v1/database/c200f79f71d0434e7e09b201e09674fe9fc25e018d5ba8eae68ccedefeafa4b2/sql)\n",
|
|
"phase": "sql_golden"
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:25:38.993007169Z",
|
|
"finished_at": "2026-01-17T02:28:12.198565927Z"
|
|
},
|
|
"t_016_sum_type_columns": {
|
|
"hash": "40baf0d53a9de9eab21250fad1d96f530213fd7dd09cb9a3d97f40ff548f0d8a",
|
|
"task": "t_016_sum_type_columns",
|
|
"lang": "rust",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 3,
|
|
"passed_tests": 3,
|
|
"llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table, SpacetimeType};\n\n#[derive(SpacetimeType)]\npub struct Rect {\n width: i32,\n height: i32,\n}\n\n#[derive(SpacetimeType)]\npub enum Shape {\n Circle(i32),\n Rectangle(Rect),\n}\n\n#[table(name = drawings)]\npub struct Drawing {\n #[primary_key]\n id: i32,\n a: Shape,\n b: Shape,\n}\n\n#[reducer]\npub fn seed(ctx: &ReducerContext) {\n let drawings = ctx.db.drawings();\n if drawings.count() == 0 {\n drawings.insert(Drawing {\n id: 1,\n a: Shape::Circle(10),\n b: Shape::Rectangle(Rect { width: 4, height: 6 }),\n });\n }\n}",
|
|
"category": "schema",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "schema-t-016-sum-type-columns-golden",
|
|
"llm_db": "schema-t-016-sum-type-columns-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/schema/t_016_sum_type_columns/rust/server/golden",
|
|
"work_dir_llm": "target/llm-runs/schema/t_016_sum_type_columns/rust/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "schema-t-016-sum-type-columns-golden",
|
|
"llm_db": "schema-t-016-sum-type-columns-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:46587",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
},
|
|
"sum_type_columns_row_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"args": [],
|
|
"golden_db": "schema-t-016-sum-type-columns-golden",
|
|
"golden_out": "id | a | b ----+---------------+--------------------------------------- 1 | (Circle = 10) | (Rectangle = (width = 4, height = 6))",
|
|
"llm_db": "schema-t-016-sum-type-columns-gpt-5-llm",
|
|
"llm_out": "id | a | b ----+---------------+--------------------------------------- 1 | (Circle = 10) | (Rectangle = (width = 4, height = 6))",
|
|
"query": "SELECT id, a, b FROM drawings WHERE id=1",
|
|
"reducer": "seed",
|
|
"server": "http://127.0.0.1:46587"
|
|
}
|
|
},
|
|
"sum_type_columns_row_count": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"actual": 1,
|
|
"expected": 1,
|
|
"sql": "SELECT COUNT(*) AS n FROM drawings WHERE id=1"
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:28:06.754312132Z",
|
|
"finished_at": "2026-01-17T02:30:52.376483288Z"
|
|
},
|
|
"t_017_scheduled_columns": {
|
|
"hash": "40baf0d53a9de9eab21250fad1d96f530213fd7dd09cb9a3d97f40ff548f0d8a",
|
|
"task": "t_017_scheduled_columns",
|
|
"lang": "rust",
|
|
"golden_published": false,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 2,
|
|
"passed_tests": 0,
|
|
"llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table, ScheduleAt};\n\n#[table(name = tick_timer, schedule(reducer = tick, column = scheduled_at))]\npub struct TickTimer {\n #[primary_key]\n #[auto_inc]\n scheduled_id: u64,\n scheduled_at: ScheduleAt,\n}\n\n#[reducer(init)]\npub fn init(ctx: &ReducerContext) {\n if ctx.db.tick_timer().count() == 0 {\n ctx.db.tick_timer().insert(TickTimer {\n scheduled_id: 0,\n scheduled_at: ScheduleAt::RepeatMicros(50_000),\n });\n }\n}\n\n#[reducer]\npub fn tick(_ctx: &ReducerContext, _row: TickTimer) {\n // Scheduled reducer invoked with the scheduled row.\n}",
|
|
"category": "schema",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "schema-t-017-scheduled-columns-golden",
|
|
"llm_db": "schema-t-017-scheduled-columns-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/schema/t_017_scheduled_columns/rust/server/golden",
|
|
"work_dir_llm": "target/llm-runs/schema/t_017_scheduled_columns/rust/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"publish_error": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime publish failed (exit=1)\n--- stderr ---\n\u001b[1m\u001b[32m Updating\u001b[0m crates.io index\n\u001b[1m\u001b[32m Locking\u001b[0m 72 packages to latest compatible versions\n\u001b[1m\u001b[36m Adding\u001b[0m generic-array v0.14.7 \u001b[1m\u001b[33m(available: v0.14.9)\u001b[0m\n\u001b[1m\u001b[36m Adding\u001b[0m spacetimedb v1.11.1 \u001b[1m\u001b[33m(available: v1.11.3)\u001b[0m\n\u001b[1m\u001b[36m Adding\u001b[0m spacetimedb-bindings-macro v1.11.1 \u001b[1m\u001b[33m(available: v1.11.3)\u001b[0m\n\u001b[1m\u001b[36m Adding\u001b[0m spacetimedb-bindings-sys v1.11.1 \u001b[1m\u001b[33m(available: v1.11.3)\u001b[0m\n\u001b[1m\u001b[36m Adding\u001b[0m spacetimedb-lib v1.11.1 \u001b[1m\u001b[33m(available: v1.11.3)\u001b[0m\n\u001b[1m\u001b[36m Adding\u001b[0m spacetimedb-primitives v1.11.1 \u001b[1m\u001b[33m(available: v1.11.3)\u001b[0m\n\u001b[1m\u001b[36m Adding\u001b[0m spacetimedb-sats v1.11.1 \u001b[1m\u001b[33m(available: v1.11.3)\u001b[0m\n\u001b[1m\u001b[32m Compiling\u001b[0m proc-macro2 v1.0.105\n\u001b[1m\u001b[32m Compiling\u001b[0m quote v1.0.43\n\u001b[1m\u001b[32m Compiling\u001b[0m unicode-ident v1.0.22\n\u001b[1m\u001b[32m Compiling\u001b[0m version_check v0.9.5\n\u001b[1m\u001b[32m Compiling\u001b[0m typenum v1.19.0\n\u001b[1m\u001b[32m Compiling\u001b[0m autocfg v1.5.0\n\u001b[1m\u001b[32m Compiling\u001b[0m generic-array v0.14.7\n\u001b[1m\u001b[32m Compiling\u001b[0m heck v0.5.0\n\u001b[1m\u001b[32m Compiling\u001b[0m num-traits v0.2.19\n\u001b[1m\u001b[32m Compiling\u001b[0m serde_core v1.0.228\n\u001b[1m\u001b[32m Compiling\u001b[0m cfg-if v1.0.4\n\u001b[1m\u001b[32m Compiling\u001b[0m syn v2.0.114\n\u001b[1m\u001b[32m Compiling\u001b[0m shlex v1.3.0\n\u001b[1m\u001b[32m Compiling\u001b[0m serde v1.0.228\n\u001b[1m\u001b[32m Compiling\u001b[0m find-msvc-tools v0.1.8\n\u001b[1m\u001b[32m Compiling\u001b[0m zerocopy v0.8.33\n\u001b[1m\u001b[32m Compiling\u001b[0m either v1.15.0\n\u001b[1m\u001b[32m Compiling\u001b[0m itertools v0.12.1\n\u001b[1m\u001b[32m Compiling\u001b[0m cc v1.2.53\n\u001b[1m\u001b[32m Compiling\u001b[0m crypto-common v0.1.7\n\u001b[1m\u001b[32m Compiling\u001b[0m block-buffer v0.10.4\n\u001b[1m\u001b[32m Compiling\u001b[0m nohash-hasher v0.2.0\n\u001b[1m\u001b[32m Compiling\u001b[0m thiserror v1.0.69\n\u001b[1m\u001b[32m Compiling\u001b[0m bitflags v2.10.0\n\u001b[1m\u001b[32m Compiling\u001b[0m anyhow v1.0.100\n\u001b[1m\u001b[32m Compiling\u001b[0m digest v0.10.7\n\u001b[1m\u001b[32m Compiling\u001b[0m approx v0.3.2\n\u001b[1m\u001b[32m Compiling\u001b[0m getrandom v0.2.17\n\u001b[1m\u001b[32m Compiling\u001b[0m heck v0.4.1\n\u001b[1m\u001b[32m Compiling\u001b[0m humantime v2.3.0\n\u001b[1m\u001b[32m Compiling\u001b[0m blake3 v1.8.3\n\u001b[1m\u001b[32m Compiling\u001b[0m bytes v1.11.0\n\u001b[1m\u001b[32m Compiling\u001b[0m keccak v0.1.5\n\u001b[1m\u001b[32m Compiling\u001b[0m zmij v1.0.14\n\u001b[1m\u001b[32m Compiling\u001b[0m arrayvec v0.7.6\n\u001b[1m\u001b[32m Compiling\u001b[0m convert_case v0.4.0\n\u001b[1m\u001b[32m Compiling\u001b[0m sha3 v0.10.8\n\u001b[1m\u001b[32m Compiling\u001b[0m rand_core v0.6.4\n\u001b[1m\u001b[32m Compiling\u001b[0m enum-as-inner v0.6.1\n\u001b[1m\u001b[32m Compiling\u001b[0m thiserror-impl v1.0.69\n\u001b[1m\u001b[32m Compiling\u001b[0m ppv-lite86 v0.2.21\n\u001b[1m\u001b[32m Compiling\u001b[0m derive_more v0.99.20\n\u001b[1m\u001b[32m Compiling\u001b[0m spacetimedb-primitives v1.11.1\n\u001b[1m\u001b[32m Compiling\u001b[0m spacetimedb-bindings-macro v1.11.1\n\u001b[1m\u001b[32m Compiling\u001b[0m decorum v0.3.1\n\u001b[1m\u001b[32m Compiling\u001b[0m ethnum v1.5.2\n\u001b[1m\u001b[32m Compiling\u001b[0m chrono v0.4.43\n\u001b[1m\u001b[32m Compiling\u001b[0m bytemuck v1.24.0\n\u001b[1m\u001b[32m Compiling\u001b[0m arrayref v0.3.9\n\u001b[1m\u001b[32m Compiling\u001b[0m hex v0.4.3\n\u001b[1m\u001b[32m Compiling\u001b[0m smallvec v1.15.1\n\u001b[1m\u001b[32m Compiling\u001b[0m constant_time_eq v0.4.2\n\u001b[1m\u001b[32m Compiling\u001b[0m serde_json v1.0.149\n\u001b[1m\u001b[32m Compiling\u001b[0m second-stack v0.3.5\n\u001b[1m\u001b[32m Compiling\u001b[0m itoa v1.0.17\n\u001b[1m\u001b[32m Compiling\u001b[0m spacetimedb-lib v1.11.1\n\u001b[1m\u001b[32m Compiling\u001b[0m rand_chacha v0.3.1\n\u001b[1m\u001b[32m Compiling\u001b[0m log v0.4.29\n\u001b[1m\u001b[32m Compiling\u001b[0m spacetimedb-sats v1.11.1\n\u001b[1m\u001b[32m Compiling\u001b[0m memchr v2.7.6\n\u001b[1m\u001b[32m Compiling\u001b[0m rand v0.8.5\n\u001b[1m\u001b[32m Compiling\u001b[0m http v1.4.0\n\u001b[1m\u001b[32m Compiling\u001b[0m spacetimedb-bindings-sys v1.11.1\n\u001b[1m\u001b[32m Compiling\u001b[0m scoped-tls v1.0.1\n\u001b[1m\u001b[32m Compiling\u001b[0m spacetimedb v1.11.1\n\u001b[1m\u001b[32m Compiling\u001b[0m spacetime-module v0.1.0 (/home/runner/work/SpacetimeDB/SpacetimeDB/target/llm-runs/schema/t_017_scheduled_columns/rust/server/gpt-5/llm)\n\u001b[0m\u001b[1m\u001b[38;5;9merror\u001b[0m\u001b[0m\u001b[1m: expected one of: `public`, `private`, `name`, `index`, `scheduled`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/lib.rs:4:28\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m4\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m#[table(name = tick_timer, schedule(reducer = tick, column = scheduled_at))]\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9m^^^^^^^^\u001b[0m\n\n\u001b[0m\u001b[1m\u001b[38;5;9merror[E0422]\u001b[0m\u001b[0m\u001b[1m: cannot find struct, variant or union type `TickTimer` in this scope\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/lib.rs:15:36\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m15\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m ctx.db.tick_timer().insert(TickTimer {\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9m^^^^^^^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9mnot found in this scope\u001b[0m\n\n\u001b[0m\u001b[1m\u001b[38;5;9merror[E0412]\u001b[0m\u001b[0m\u001b[1m: cannot find type `TickTimer` in this scope\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/lib.rs:23:42\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m23\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0mpub fn tick(_ctx: &ReducerContext, _row: TickTimer) {\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9m^^^^^^^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9mnot found in this scope\u001b[0m\n\n\u001b[0m\u001b[1m\u001b[38;5;9merror[E0599]\u001b[0m\u001b[0m\u001b[1m: no method named `tick_timer` found for struct `Local` in the current scope\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/lib.rs:14:15\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m14\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m if ctx.db.tick_timer().count() == 0 {\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9m^^^^^^^^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9mmethod not found in `Local`\u001b[0m\n\n\u001b[0m\u001b[1m\u001b[38;5;9merror[E0599]\u001b[0m\u001b[0m\u001b[1m: no method named `tick_timer` found for struct `Local` in the current scope\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/lib.rs:15:16\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m15\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m ctx.db.tick_timer().insert(TickTimer {\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9m^^^^^^^^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9mmethod not found in `Local`\u001b[0m\n\n\u001b[0m\u001b[1m\u001b[38;5;9merror[E0599]\u001b[0m\u001b[0m\u001b[1m: no variant or associated item named `RepeatMicros` found for enum `ScheduleAt` in the current scope\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/lib.rs:17:39\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m17\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m scheduled_at: ScheduleAt::RepeatMicros(50_000),\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9m^^^^^^^^^^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9mvariant or associated item not found in `ScheduleAt`\u001b[0m\n\n\u001b[0m\u001b[1m\u001b[38;5;9merror[E0277]\u001b[0m\u001b[0m\u001b[1m: invalid reducer signature\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/lib.rs:23:8\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m22\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m#[reducer]\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m----------\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12mrequired by a bound introduced by this call\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m23\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0mpub fn tick(_ctx: &ReducerContext, _row: TickTimer) {\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9m^^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9mthis reducer signature is not valid\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mhelp\u001b[0m\u001b[0m: the trait `Reducer<'_, _>` is not implemented for fn item `for<'a> fn(&'a ReducerContext, {type error}) {tick}`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mnote\u001b[0m\u001b[0m: \u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mnote\u001b[0m\u001b[0m: reducer signatures must match the following pattern:\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mnote\u001b[0m\u001b[0m: `Fn(&ReducerContext, [T1, ...]) [-> Result<(), impl Display>]`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mnote\u001b[0m\u001b[0m: where each `Ti` type implements `SpacetimeType`.\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mnote\u001b[0m\u001b[0m: \u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;10mnote\u001b[0m\u001b[0m: required by a bound in `register_reducer`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0m/home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/spacetimedb-1.11.1/src/rt.rs:746:81\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m746\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0mpub fn register_reducer<'a, A: Args<'a>, I: FnInfo<Invoke = ReducerFn>>(_: impl Reducer<'a, A>) {\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;10m^^^^^^^^^^^^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;10mrequired by this bound in `register_reducer`\u001b[0m\n\n\u001b[0m\u001b[1m\u001b[38;5;9merror[E0277]\u001b[0m\u001b[0m\u001b[1m: invalid reducer signature\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/lib.rs:23:8\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m22\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m#[reducer]\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m----------\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12mrequired by a bound introduced by this call\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m23\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0mpub fn tick(_ctx: &ReducerContext, _row: TickTimer) {\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9m^^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9mthis reducer signature is not valid\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mhelp\u001b[0m\u001b[0m: the trait `Reducer<'_, _>` is not implemented for fn item `for<'a> fn(&'a ReducerContext, {type error}) {tick}`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mnote\u001b[0m\u001b[0m: \u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mnote\u001b[0m\u001b[0m: reducer signatures must match the following pattern:\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mnote\u001b[0m\u001b[0m: `Fn(&ReducerContext, [T1, ...]) [-> Result<(), impl Display>]`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mnote\u001b[0m\u001b[0m: where each `Ti` type implements `SpacetimeType`.\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mnote\u001b[0m\u001b[0m: \u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;10mnote\u001b[0m\u001b[0m: required by a bound in `invoke_reducer`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0m/home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/spacetimedb-1.11.1/src/rt.rs:45:19\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m44\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0mpub fn invoke_reducer<'a, A: Args<'a>>(\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--------------\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12mrequired by a bound in this function\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m45\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m reducer: impl Reducer<'a, A>,\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;10m^^^^^^^^^^^^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;10mrequired by this bound in `invoke_reducer`\u001b[0m\n\n\u001b[0m\u001b[1mSome errors have detailed explanations: E0277, E0412, E0422, E0599.\u001b[0m\n\u001b[0m\u001b[1mFor more information about an error, try `rustc --explain E0277`.\u001b[0m\n\u001b[1m\u001b[31merror\u001b[0m\u001b[1m:\u001b[0m could not compile `spacetime-module` (lib) due to 8 previous errors\nError: command [\"cargo\", \"build\", \"--config=net.git-fetch-with-cli=true\", \"--target=wasm32-unknown-unknown\", \"--release\", \"--message-format=json-render-diagnostics\"] exited with code 101\n\n--- stdout ---\n",
|
|
"phase": "build_or_publish"
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:25:38.991765459Z",
|
|
"finished_at": "2026-01-17T02:28:17.929994467Z"
|
|
},
|
|
"t_018_constraints": {
|
|
"hash": "40baf0d53a9de9eab21250fad1d96f530213fd7dd09cb9a3d97f40ff548f0d8a",
|
|
"task": "t_018_constraints",
|
|
"lang": "rust",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 3,
|
|
"passed_tests": 2,
|
|
"llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table};\n\n#[table(name = accounts, index(name = by_name, btree(columns = [name])))]\npub struct Account {\n #[primary_key]\n id: i32,\n #[unique]\n email: String,\n name: String,\n}\n\n#[reducer]\npub fn seed(ctx: &ReducerContext) {\n let _ = ctx.db.accounts().try_insert(Account {\n id: 1,\n email: \"a@example.com\".to_string(),\n name: \"Alice\".to_string(),\n });\n let _ = ctx.db.accounts().try_insert(Account {\n id: 2,\n email: \"b@example.com\".to_string(),\n name: \"Bob\".to_string(),\n });\n}",
|
|
"category": "schema",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "schema-t-018-constraints-golden",
|
|
"llm_db": "schema-t-018-constraints-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/schema/t_018_constraints/rust/server/golden",
|
|
"work_dir_llm": "target/llm-runs/schema/t_018_constraints/rust/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "schema-t-018-constraints-golden",
|
|
"llm_db": "schema-t-018-constraints-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:46587",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
},
|
|
"constraints_seed_two_rows": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"actual": 1,
|
|
"expected": 1,
|
|
"sql": "SELECT COUNT(*) AS n FROM accounts WHERE id=2"
|
|
}
|
|
},
|
|
"constraints_row_parity_after_seed": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `accounts`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:46587/v1/database/c2007d48b169e0048c4dd9c53c8d47e40c7761a8814064fe65c573b1ce844864/sql)\n",
|
|
"phase": "sql_golden"
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:25:38.991438731Z",
|
|
"finished_at": "2026-01-17T02:28:15.400501818Z"
|
|
},
|
|
"t_019_many_to_many": {
|
|
"hash": "40baf0d53a9de9eab21250fad1d96f530213fd7dd09cb9a3d97f40ff548f0d8a",
|
|
"task": "t_019_many_to_many",
|
|
"lang": "rust",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 5,
|
|
"passed_tests": 5,
|
|
"llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table};\n\n#[table(name = users)]\npub struct User {\n #[primary_key]\n user_id: i32,\n name: String,\n}\n\n#[table(name = groups)]\npub struct Group {\n #[primary_key]\n group_id: i32,\n title: String,\n}\n\n#[table(\n name = memberships,\n index(name = by_user, btree(columns = [user_id])),\n index(name = by_group, btree(columns = [group_id]))\n)]\npub struct Membership {\n #[primary_key]\n id: i32,\n user_id: i32,\n group_id: i32,\n}\n\n#[reducer]\npub fn seed(ctx: &ReducerContext) {\n let users = ctx.db.users();\n users.insert(User { user_id: 1, name: \"Alice\".to_string() });\n users.insert(User { user_id: 2, name: \"Bob\".to_string() });\n\n let groups = ctx.db.groups();\n groups.insert(Group { group_id: 10, title: \"Admin\".to_string() });\n groups.insert(Group { group_id: 20, title: \"Dev\".to_string() });\n\n let memberships = ctx.db.memberships();\n memberships.insert(Membership { id: 1, user_id: 1, group_id: 10 });\n memberships.insert(Membership { id: 2, user_id: 1, group_id: 20 });\n memberships.insert(Membership { id: 3, user_id: 2, group_id: 20 });\n}",
|
|
"category": "schema",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "schema-t-019-many-to-many-golden",
|
|
"llm_db": "schema-t-019-many-to-many-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/schema/t_019_many_to_many/rust/server/golden",
|
|
"work_dir_llm": "target/llm-runs/schema/t_019_many_to_many/rust/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"m2m_has_1_20": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"actual": 1,
|
|
"expected": 1,
|
|
"sql": "SELECT COUNT(*) AS n FROM memberships WHERE user_id=1 AND group_id=20"
|
|
}
|
|
},
|
|
"memberships_three_rows": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"actual": 3,
|
|
"expected": 3,
|
|
"sql": "SELECT COUNT(*) AS n FROM memberships"
|
|
}
|
|
},
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "schema-t-019-many-to-many-golden",
|
|
"llm_db": "schema-t-019-many-to-many-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:46587",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
},
|
|
"m2m_has_1_10": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"actual": 1,
|
|
"expected": 1,
|
|
"sql": "SELECT COUNT(*) AS n FROM memberships WHERE user_id=1 AND group_id=10"
|
|
}
|
|
},
|
|
"m2m_has_2_20": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"actual": 1,
|
|
"expected": 1,
|
|
"sql": "SELECT COUNT(*) AS n FROM memberships WHERE user_id=2 AND group_id=20"
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:25:38.990785156Z",
|
|
"finished_at": "2026-01-17T02:28:17.183262809Z"
|
|
},
|
|
"t_020_ecs": {
|
|
"hash": "40baf0d53a9de9eab21250fad1d96f530213fd7dd09cb9a3d97f40ff548f0d8a",
|
|
"task": "t_020_ecs",
|
|
"lang": "rust",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 5,
|
|
"passed_tests": 5,
|
|
"llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table};\n\n#[table(name = entities)]\npub struct Entity {\n #[primary_key]\n id: i32,\n}\n\n#[table(name = positions)]\npub struct Position {\n #[primary_key]\n entity_id: i32,\n x: i32,\n y: i32,\n}\n\n#[table(name = velocities)]\npub struct Velocity {\n #[primary_key]\n entity_id: i32,\n vx: i32,\n vy: i32,\n}\n\n#[table(name = next_positions)]\npub struct NextPosition {\n #[primary_key]\n entity_id: i32,\n x: i32,\n y: i32,\n}\n\n#[reducer]\npub fn seed(ctx: &ReducerContext) {\n if ctx.db.entities().id().find(1).is_none() {\n let _ = ctx.db.entities().insert(Entity { id: 1 });\n }\n match ctx.db.positions().entity_id().find(1) {\n Some(mut p) => {\n p.x = 0;\n p.y = 0;\n let _ = ctx.db.positions().entity_id().update(p);\n }\n None => {\n let _ = ctx.db.positions().insert(Position { entity_id: 1, x: 0, y: 0 });\n }\n }\n match ctx.db.velocities().entity_id().find(1) {\n Some(mut v) => {\n v.vx = 1;\n v.vy = 0;\n let _ = ctx.db.velocities().entity_id().update(v);\n }\n None => {\n let _ = ctx.db.velocities().insert(Velocity { entity_id: 1, vx: 1, vy: 0 });\n }\n }\n\n if ctx.db.entities().id().find(2).is_none() {\n let _ = ctx.db.entities().insert(Entity { id: 2 });\n }\n match ctx.db.positions().entity_id().find(2) {\n Some(mut p) => {\n p.x = 10;\n p.y = 0;\n let _ = ctx.db.positions().entity_id().update(p);\n }\n None => {\n let _ = ctx.db.positions().insert(Position { entity_id: 2, x: 10, y: 0 });\n }\n }\n match ctx.db.velocities().entity_id().find(2) {\n Some(mut v) => {\n v.vx = -2;\n v.vy = 3;\n let _ = ctx.db.velocities().entity_id().update(v);\n }\n None => {\n let _ = ctx.db.velocities().insert(Velocity { entity_id: 2, vx: -2, vy: 3 });\n }\n }\n}\n\n#[reducer]\npub fn step(ctx: &ReducerContext) {\n for pos in ctx.db.positions().iter() {\n if let Some(vel) = ctx.db.velocities().entity_id().find(pos.entity_id) {\n let nx = pos.x + vel.vx;\n let ny = pos.y + vel.vy;\n match ctx.db.next_positions().entity_id().find(pos.entity_id) {\n Some(mut np) => {\n np.x = nx;\n np.y = ny;\n let _ = ctx.db.next_positions().entity_id().update(np);\n }\n None => {\n let _ = ctx.db.next_positions().insert(NextPosition {\n entity_id: pos.entity_id,\n x: nx,\n y: ny,\n });\n }\n }\n }\n }\n}",
|
|
"category": "schema",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "schema-t-020-ecs-golden",
|
|
"llm_db": "schema-t-020-ecs-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/schema/t_020_ecs/rust/server/golden",
|
|
"work_dir_llm": "target/llm-runs/schema/t_020_ecs/rust/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"ecs_seed_positions_count": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"actual": 2,
|
|
"expected": 2,
|
|
"sql": "SELECT COUNT(*) AS n FROM positions"
|
|
}
|
|
},
|
|
"ecs_next_pos_entity1": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"actual": 1,
|
|
"expected": 1,
|
|
"sql": "SELECT COUNT(*) AS n FROM next_positions WHERE entity_id=1 AND x=1 AND y=0"
|
|
}
|
|
},
|
|
"ecs_next_pos_entity2": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"actual": 1,
|
|
"expected": 1,
|
|
"sql": "SELECT COUNT(*) AS n FROM next_positions WHERE entity_id=2 AND x=8 AND y=3"
|
|
}
|
|
},
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "schema-t-020-ecs-golden",
|
|
"llm_db": "schema-t-020-ecs-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:46587",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
},
|
|
"ecs_step_next_positions_count": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"actual": 2,
|
|
"expected": 2,
|
|
"sql": "SELECT COUNT(*) AS n FROM next_positions"
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:25:38.991130819Z",
|
|
"finished_at": "2026-01-17T02:28:20.539029094Z"
|
|
},
|
|
"t_021_multi_column_index": {
|
|
"hash": "40baf0d53a9de9eab21250fad1d96f530213fd7dd09cb9a3d97f40ff548f0d8a",
|
|
"task": "t_021_multi_column_index",
|
|
"lang": "rust",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 4,
|
|
"passed_tests": 4,
|
|
"llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table};\n\n#[table(name = logs, index(name = by_user_day, btree(columns = [user_id, day])))]\npub struct Log {\n #[primary_key]\n id: i32,\n user_id: i32,\n day: i32,\n message: String,\n}\n\n#[reducer]\npub fn seed(ctx: &ReducerContext) {\n let tbl = ctx.db.logs();\n let ids: Vec<i32> = tbl.iter().map(|r| r.id).collect();\n for id in ids {\n tbl.id().delete(&id);\n }\n\n tbl.insert(Log { id: 1, user_id: 7, day: 1, message: \"a\".to_string() });\n tbl.insert(Log { id: 2, user_id: 7, day: 2, message: \"b\".to_string() });\n tbl.insert(Log { id: 3, user_id: 9, day: 1, message: \"c\".to_string() });\n}",
|
|
"category": "schema",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "schema-t-021-multi-column-index-golden",
|
|
"llm_db": "schema-t-021-multi-column-index-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/schema/t_021_multi_column_index/rust/server/golden",
|
|
"work_dir_llm": "target/llm-runs/schema/t_021_multi_column_index/rust/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "schema-t-021-multi-column-index-golden",
|
|
"llm_db": "schema-t-021-multi-column-index-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:46587",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
},
|
|
"mcindex_lookup_u7_d1": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"actual": 1,
|
|
"expected": 1,
|
|
"sql": "SELECT COUNT(*) AS n FROM logs WHERE user_id=7 AND day=1"
|
|
}
|
|
},
|
|
"mcindex_lookup_u7_d2": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"actual": 1,
|
|
"expected": 1,
|
|
"sql": "SELECT COUNT(*) AS n FROM logs WHERE user_id=7 AND day=2"
|
|
}
|
|
},
|
|
"mcindex_seed_count": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"actual": 3,
|
|
"expected": 3,
|
|
"sql": "SELECT COUNT(*) AS n FROM logs"
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:25:38.992084803Z",
|
|
"finished_at": "2026-01-17T02:28:17.745571962Z"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"golden_answers": {
|
|
"basics/t_000_empty_reducers": {
|
|
"answer": "use spacetimedb::{reducer, ReducerContext};\n\n#[reducer]\npub fn empty_reducer_no_args(ctx: &ReducerContext) -> Result<(), String> {\n Ok(())\n}\n\n#[reducer]\npub fn empty_reducer_with_int(ctx: &ReducerContext, count: i32) -> Result<(), String> {\n Ok(())\n}\n\n#[reducer]\npub fn empty_reducer_with_string(ctx: &ReducerContext, name: String) -> Result<(), String> {\n Ok(())\n}\n\n#[reducer]\npub fn empty_reducer_with_two_args(ctx: &ReducerContext, count: i32, name: String) -> Result<(), String> {\n Ok(())\n}\n\n#[reducer]\npub fn empty_reducer_with_three_args(\n ctx: &ReducerContext,\n active: bool,\n ratio: f32,\n label: String,\n) -> Result<(), String> {\n Ok(())\n}\n",
|
|
"syntax": "rust"
|
|
},
|
|
"basics/t_001_basic_tables": {
|
|
"answer": "use spacetimedb::table;\n\n#[table(name = users)]\npub struct Users {\n #[primary_key]\n pub id: i32,\n pub name: String,\n pub age: i32,\n pub active: bool,\n}\n\n#[table(name = products)]\npub struct Products {\n #[primary_key]\n pub id: i32,\n pub title: String,\n pub price: f32,\n pub in_stock: bool,\n}\n\n#[table(name = notes)]\npub struct Notes {\n #[primary_key]\n pub id: i32,\n pub body: String,\n pub rating: i64,\n pub pinned: bool,\n}\n",
|
|
"syntax": "rust"
|
|
},
|
|
"basics/t_002_scheduled_table": {
|
|
"answer": "use spacetimedb::{reducer, table, ReducerContext, ScheduleAt, Table};\nuse std::time::Duration;\n\n#[table(name = tick_timer, scheduled(tick))]\npub struct TickTimer {\n #[primary_key]\n #[auto_inc]\n scheduled_id: u64,\n scheduled_at: ScheduleAt,\n}\n\n#[reducer]\npub fn tick(_ctx: &ReducerContext, _row: TickTimer) -> Result<(), String> {\n Ok(())\n}\n\n#[reducer(init)]\npub fn init(ctx: &ReducerContext) -> Result<(), String> {\n ctx.db.tick_timer().insert(TickTimer {\n scheduled_id: 0,\n scheduled_at: ScheduleAt::Interval(Duration::from_millis(50).into()),\n });\n Ok(())\n}\n",
|
|
"syntax": "rust"
|
|
},
|
|
"basics/t_003_struct_in_table": {
|
|
"answer": "use spacetimedb::{table, SpacetimeType};\n\n#[derive(SpacetimeType, Clone, Debug)]\npub struct Position {\n pub x: i32,\n pub y: i32,\n}\n\n#[table(name = entities)]\npub struct Entity {\n #[primary_key]\n pub id: i32,\n pub pos: Position,\n}\n\n",
|
|
"syntax": "rust"
|
|
},
|
|
"basics/t_004_insert": {
|
|
"answer": "use spacetimedb::{reducer, table, ReducerContext, Table};\n\n#[table(name = users)]\npub struct Users {\n #[primary_key]\n pub id: i32,\n pub name: String,\n pub age: i32,\n pub active: bool,\n}\n\n#[reducer]\npub fn insert_user(ctx: &ReducerContext, id: i32, name: String, age: i32, active: bool) -> Result<(), String> {\n ctx.db.users().insert(Users { id, name, age, active });\n Ok(())\n}\n",
|
|
"syntax": "rust"
|
|
},
|
|
"basics/t_005_update": {
|
|
"answer": "use spacetimedb::{reducer, table, ReducerContext};\n\n#[table(name = users)]\npub struct User {\n #[primary_key]\n pub id: i32,\n pub name: String,\n pub age: i32,\n pub active: bool,\n}\n\n#[reducer]\npub fn update_user(ctx: &ReducerContext, id: i32, name: String, age: i32, active: bool) {\n ctx.db.users().id().update(User { id, name, age, active });\n}",
|
|
"syntax": "rust"
|
|
},
|
|
"basics/t_006_delete": {
|
|
"answer": "use spacetimedb::{reducer, table, ReducerContext};\n\n#[table(name = users)]\npub struct User {\n #[primary_key]\n pub id: i32,\n pub name: String,\n pub age: i32,\n pub active: bool,\n}\n\n#[reducer]\npub fn delete_user(ctx: &ReducerContext, id: i32) {\n ctx.db.users().id().delete(id);\n}\n",
|
|
"syntax": "rust"
|
|
},
|
|
"basics/t_007_crud": {
|
|
"answer": "use spacetimedb::{reducer, table, ReducerContext, Table};\n\n#[table(name = users)]\npub struct User {\n #[primary_key]\n pub id: i32,\n pub name: String,\n pub age: i32,\n pub active: bool,\n}\n\n#[reducer]\npub fn crud(ctx: &ReducerContext) {\n ctx.db.users().insert(User { id: 1, name: \"Alice\".into(), age: 30, active: true });\n ctx.db.users().insert(User { id: 2, name: \"Bob\".into(), age: 22, active: false });\n ctx.db.users().id().update(User { id: 1, name: \"Alice2\".into(), age: 31, active: false });\n ctx.db.users().id().delete(2);\n}\n",
|
|
"syntax": "rust"
|
|
},
|
|
"basics/t_008_index_lookup": {
|
|
"answer": "use spacetimedb::{reducer, table, ReducerContext, Table};\n\n#[table(name = users)]\npub struct User {\n #[primary_key]\n pub id: i32,\n pub name: String,\n pub age: i32,\n pub active: bool,\n}\n\n#[table(name = results)]\npub struct ResultRow {\n #[primary_key]\n pub id: i32,\n pub name: String,\n}\n\n#[reducer]\npub fn lookup_user_name(ctx: &ReducerContext, id: i32) {\n if let Some(u) = ctx.db.users().id().find(id) {\n ctx.db.results().insert(ResultRow { id: u.id, name: u.name });\n }\n}\n",
|
|
"syntax": "rust"
|
|
},
|
|
"basics/t_009_init": {
|
|
"answer": "use spacetimedb::{reducer, table, ReducerContext, Table};\n\n#[table(name = users)]\npub struct User {\n #[primary_key]\n pub id: i32,\n pub name: String,\n pub age: i32,\n pub active: bool,\n}\n\n#[reducer(init)]\npub fn init(ctx: &ReducerContext) {\n ctx.db.users().insert(User { id: 1, name: \"Alice\".into(), age: 30, active: true });\n ctx.db.users().insert(User { id: 2, name: \"Bob\".into(), age: 22, active: false });\n}\n",
|
|
"syntax": "rust"
|
|
},
|
|
"basics/t_010_connect": {
|
|
"answer": "use spacetimedb::{reducer, table, ReducerContext, Table};\n\n#[table(name = events)]\npub struct Event {\n #[primary_key]\n #[auto_inc]\n pub id: u64,\n pub kind: String,\n}\n\n#[reducer(client_connected)]\npub fn client_connected(ctx: &ReducerContext) {\n ctx.db.events().insert(Event { id: 0, kind: \"connected\".into() });\n}\n\n#[reducer(client_disconnected)]\npub fn client_disconnected(ctx: &ReducerContext) {\n ctx.db.events().insert(Event { id: 0, kind: \"disconnected\".into() });\n}\n",
|
|
"syntax": "rust"
|
|
},
|
|
"basics/t_011_helper_function": {
|
|
"answer": "use spacetimedb::{reducer, table, ReducerContext, Table};\n\n#[table(name = results)]\npub struct ResultRow {\n #[primary_key]\n pub id: i32,\n pub sum: i32,\n}\n\nfn add(a: i32, b: i32) -> i32 { a + b }\n\n#[reducer]\npub fn compute_sum(ctx: &ReducerContext, id: i32, a: i32, b: i32) {\n ctx.db.results().insert(ResultRow { id, sum: add(a, b) });\n}\n",
|
|
"syntax": "rust"
|
|
},
|
|
"schema/t_012_spacetime_product_type": {
|
|
"answer": "use spacetimedb::{reducer, table, ReducerContext, SpacetimeType, Table};\n\n#[derive(SpacetimeType, Clone, Debug)]\npub struct Score {\n pub left: i32,\n pub right: i32,\n}\n\n#[table(name = results)]\npub struct ResultRow {\n #[primary_key]\n pub id: i32,\n pub value: Score,\n}\n\n#[reducer]\npub fn set_score(ctx: &ReducerContext, id: i32, left: i32, right: i32) {\n ctx.db.results().insert(ResultRow { id, value: Score { left, right } });\n}\n",
|
|
"syntax": "rust"
|
|
},
|
|
"schema/t_013_spacetime_sum_type": {
|
|
"answer": "use spacetimedb::{reducer, table, ReducerContext, SpacetimeType, Table};\n\n#[derive(SpacetimeType, Clone, Debug)]\npub struct Rect {\n pub width: i32,\n pub height: i32,\n}\n\n#[derive(SpacetimeType, Clone, Debug)]\npub enum Shape {\n Circle(i32),\n Rectangle(Rect),\n}\n\n#[table(name = results)]\npub struct ResultRow {\n #[primary_key]\n pub id: i32,\n pub value: Shape,\n}\n\n#[reducer]\npub fn set_circle(ctx: &ReducerContext, id: i32, radius: i32) {\n ctx.db.results().insert(ResultRow { id, value: Shape::Circle(radius) });\n}\n",
|
|
"syntax": "rust"
|
|
},
|
|
"schema/t_014_elementary_columns": {
|
|
"answer": "use spacetimedb::{reducer, table, ReducerContext, Table};\n\n#[table(name = primitives)]\npub struct Primitive {\n #[primary_key]\n pub id: i32,\n pub count: i32,\n pub total: i64,\n pub price: f32,\n pub ratio: f64,\n pub active: bool,\n pub name: String,\n}\n\n#[reducer]\npub fn seed(ctx: &ReducerContext) {\n ctx.db.primitives().insert(Primitive {\n id: 1,\n count: 2,\n total: 3_000_000_000,\n price: 1.5,\n ratio: 2.25,\n active: true,\n name: \"Alice\".into(),\n });\n}\n",
|
|
"syntax": "rust"
|
|
},
|
|
"schema/t_015_product_type_columns": {
|
|
"answer": "use spacetimedb::{reducer, table, ReducerContext, SpacetimeType, Table};\n\n#[derive(SpacetimeType, Clone, Debug)]\npub struct Address {\n pub street: String,\n pub zip: i32,\n}\n\n#[derive(SpacetimeType, Clone, Debug)]\npub struct Position {\n pub x: i32,\n pub y: i32,\n}\n\n#[table(name = profiles)]\npub struct Profile {\n #[primary_key]\n pub id: i32,\n pub home: Address,\n pub work: Address,\n pub pos: Position,\n}\n\n#[reducer]\npub fn seed(ctx: &ReducerContext) {\n ctx.db.profiles().insert(Profile {\n id: 1,\n home: Address { street: \"1 Main\".into(), zip: 11111 },\n work: Address { street: \"2 Broad\".into(), zip: 22222 },\n pos: Position { x: 7, y: 9 },\n });\n}\n",
|
|
"syntax": "rust"
|
|
},
|
|
"schema/t_016_sum_type_columns": {
|
|
"answer": "use spacetimedb::{reducer, table, ReducerContext, SpacetimeType, Table};\n\n#[derive(SpacetimeType, Clone, Debug)]\npub struct Rect {\n pub width: i32,\n pub height: i32,\n}\n\n#[derive(SpacetimeType, Clone, Debug)]\npub enum Shape {\n Circle(i32),\n Rectangle(Rect),\n}\n\n#[table(name = drawings)]\npub struct Drawing {\n #[primary_key]\n pub id: i32,\n pub a: Shape,\n pub b: Shape,\n}\n\n#[reducer]\npub fn seed(ctx: &ReducerContext) {\n ctx.db.drawings().insert(Drawing {\n id: 1,\n a: Shape::Circle(10),\n b: Shape::Rectangle(Rect { width: 4, height: 6 }),\n });\n}\n",
|
|
"syntax": "rust"
|
|
},
|
|
"schema/t_017_scheduled_columns": {
|
|
"answer": "use spacetimedb::{reducer, table, ReducerContext, ScheduleAt, Table};\nuse std::time::Duration;\n\n#[table(name = tick_timer, scheduled(tick))]\npub struct TickTimer {\n #[primary_key]\n #[auto_inc]\n pub scheduled_id: u64,\n pub scheduled_at: ScheduleAt,\n}\n\n#[reducer]\npub fn tick(_ctx: &ReducerContext, _schedule: TickTimer) {\n}\n\n#[reducer(init)]\npub fn init(ctx: &ReducerContext) {\n let every_50ms: ScheduleAt = Duration::from_millis(50).into();\n ctx.db.tick_timer().insert(TickTimer {\n scheduled_id: 0,\n scheduled_at: every_50ms,\n });\n}\n",
|
|
"syntax": "rust"
|
|
},
|
|
"schema/t_018_constraints": {
|
|
"answer": "use spacetimedb::{reducer, table, ReducerContext, Table};\n\n#[table(\n name = accounts,\n index(name = by_name, btree(columns = [name]))\n)]\npub struct Account {\n #[primary_key]\n pub id: i32,\n #[unique]\n pub email: String,\n pub name: String,\n}\n\n#[reducer]\npub fn seed(ctx: &ReducerContext) {\n ctx.db.accounts().insert(Account { id: 1, email: \"a@example.com\".into(), name: \"Alice\".into() });\n ctx.db.accounts().insert(Account { id: 2, email: \"b@example.com\".into(), name: \"Bob\".into() });\n}\n",
|
|
"syntax": "rust"
|
|
},
|
|
"schema/t_019_many_to_many": {
|
|
"answer": "use spacetimedb::{reducer, table, ReducerContext, Table};\n\n#[table(name = users)]\npub struct User {\n #[primary_key]\n pub user_id: i32,\n pub name: String,\n}\n\n#[table(name = groups)]\npub struct Group {\n #[primary_key]\n pub group_id: i32,\n pub title: String,\n}\n\n#[table(\n name = memberships,\n index(name = by_user, btree(columns = [user_id])),\n index(name = by_group, btree(columns = [group_id]))\n)]\npub struct Membership {\n #[primary_key]\n pub id: i32,\n pub user_id: i32,\n pub group_id: i32,\n}\n\n#[reducer]\npub fn seed(ctx: &ReducerContext) {\n ctx.db.users().insert(User { user_id: 1, name: \"Alice\".into() });\n ctx.db.users().insert(User { user_id: 2, name: \"Bob\".into() });\n\n ctx.db.groups().insert(Group { group_id: 10, title: \"Admin\".into() });\n ctx.db.groups().insert(Group { group_id: 20, title: \"Dev\".into() });\n\n ctx.db.memberships().insert(Membership { id: 1, user_id: 1, group_id: 10 });\n ctx.db.memberships().insert(Membership { id: 2, user_id: 1, group_id: 20 });\n ctx.db.memberships().insert(Membership { id: 3, user_id: 2, group_id: 20 });\n}\n",
|
|
"syntax": "rust"
|
|
},
|
|
"schema/t_020_ecs": {
|
|
"answer": "use spacetimedb::{reducer, table, ReducerContext, Table};\n\n#[table(name = entities)]\npub struct Entity {\n #[primary_key]\n pub id: i32,\n}\n\n#[table(name = positions)]\npub struct Position {\n #[primary_key]\n pub entity_id: i32,\n pub x: i32,\n pub y: i32,\n}\n\n#[table(name = velocities)]\npub struct Velocity {\n #[primary_key]\n pub entity_id: i32,\n pub vx: i32,\n pub vy: i32,\n}\n\n#[table(name = next_positions)]\npub struct NextPosition {\n #[primary_key]\n pub entity_id: i32,\n pub x: i32,\n pub y: i32,\n}\n\n#[reducer]\npub fn seed(ctx: &ReducerContext) {\n ctx.db.entities().insert(Entity { id: 1 });\n ctx.db.entities().insert(Entity { id: 2 });\n\n ctx.db.positions().insert(Position {\n entity_id: 1,\n x: 1,\n y: 0,\n });\n ctx.db.positions().insert(Position {\n entity_id: 2,\n x: 10,\n y: 0,\n });\n\n ctx.db.velocities().insert(Velocity {\n entity_id: 1,\n vx: 1,\n vy: 0,\n });\n ctx.db.velocities().insert(Velocity {\n entity_id: 2,\n vx: -2,\n vy: 3,\n });\n}\n\n#[spacetimedb::reducer]\npub fn step(ctx: &ReducerContext) {\n for p in ctx.db.positions().iter() {\n if let Some(v) = ctx.db.velocities().entity_id().find(p.entity_id) {\n let np = NextPosition {\n entity_id: p.entity_id,\n x: p.x + v.vx,\n y: p.y + v.vy,\n };\n\n if ctx.db.next_positions().entity_id().find(p.entity_id).is_some() {\n ctx.db.next_positions().entity_id().update(np);\n } else {\n ctx.db.next_positions().insert(np);\n }\n }\n }\n}\n",
|
|
"syntax": "rust"
|
|
},
|
|
"schema/t_021_multi_column_index": {
|
|
"answer": "use spacetimedb::{reducer, table, ReducerContext, Table};\n\n#[table(\n name = logs,\n index(name = by_user_day, btree(columns = [user_id, day]))\n)]\npub struct Log {\n #[primary_key]\n pub id: i32,\n pub user_id: i32,\n pub day: i32,\n pub message: String,\n}\n\n#[reducer]\npub fn seed(ctx: &ReducerContext) {\n ctx.db.logs().insert(Log { id: 1, user_id: 7, day: 1, message: \"a\".into() });\n ctx.db.logs().insert(Log { id: 2, user_id: 7, day: 2, message: \"b\".into() });\n ctx.db.logs().insert(Log { id: 3, user_id: 9, day: 1, message: \"c\".into() });\n}\n",
|
|
"syntax": "rust"
|
|
},
|
|
"t_000_empty_reducers": {
|
|
"answer": "use spacetimedb::{reducer, ReducerContext};\n\n#[reducer]\npub fn empty_reducer_no_args(ctx: &ReducerContext) -> Result<(), String> {\n Ok(())\n}\n\n#[reducer]\npub fn empty_reducer_with_int(ctx: &ReducerContext, count: i32) -> Result<(), String> {\n Ok(())\n}\n\n#[reducer]\npub fn empty_reducer_with_string(ctx: &ReducerContext, name: String) -> Result<(), String> {\n Ok(())\n}\n\n#[reducer]\npub fn empty_reducer_with_two_args(ctx: &ReducerContext, count: i32, name: String) -> Result<(), String> {\n Ok(())\n}\n\n#[reducer]\npub fn empty_reducer_with_three_args(\n ctx: &ReducerContext,\n active: bool,\n ratio: f32,\n label: String,\n) -> Result<(), String> {\n Ok(())\n}\n",
|
|
"syntax": "rust"
|
|
},
|
|
"t_001_basic_tables": {
|
|
"answer": "use spacetimedb::table;\n\n#[table(name = users)]\npub struct Users {\n #[primary_key]\n pub id: i32,\n pub name: String,\n pub age: i32,\n pub active: bool,\n}\n\n#[table(name = products)]\npub struct Products {\n #[primary_key]\n pub id: i32,\n pub title: String,\n pub price: f32,\n pub in_stock: bool,\n}\n\n#[table(name = notes)]\npub struct Notes {\n #[primary_key]\n pub id: i32,\n pub body: String,\n pub rating: i64,\n pub pinned: bool,\n}\n",
|
|
"syntax": "rust"
|
|
},
|
|
"t_002_scheduled_table": {
|
|
"answer": "use spacetimedb::{reducer, table, ReducerContext, ScheduleAt, Table};\nuse std::time::Duration;\n\n#[table(name = tick_timer, scheduled(tick))]\npub struct TickTimer {\n #[primary_key]\n #[auto_inc]\n scheduled_id: u64,\n scheduled_at: ScheduleAt,\n}\n\n#[reducer]\npub fn tick(_ctx: &ReducerContext, _row: TickTimer) -> Result<(), String> {\n Ok(())\n}\n\n#[reducer(init)]\npub fn init(ctx: &ReducerContext) -> Result<(), String> {\n ctx.db.tick_timer().insert(TickTimer {\n scheduled_id: 0,\n scheduled_at: ScheduleAt::Interval(Duration::from_millis(50).into()),\n });\n Ok(())\n}\n",
|
|
"syntax": "rust"
|
|
},
|
|
"t_003_struct_in_table": {
|
|
"answer": "use spacetimedb::{table, SpacetimeType};\n\n#[derive(SpacetimeType, Clone, Debug)]\npub struct Position {\n pub x: i32,\n pub y: i32,\n}\n\n#[table(name = entities)]\npub struct Entity {\n #[primary_key]\n pub id: i32,\n pub pos: Position,\n}\n\n",
|
|
"syntax": "rust"
|
|
},
|
|
"t_004_insert": {
|
|
"answer": "use spacetimedb::{reducer, table, ReducerContext, Table};\n\n#[table(name = users)]\npub struct Users {\n #[primary_key]\n pub id: i32,\n pub name: String,\n pub age: i32,\n pub active: bool,\n}\n\n#[reducer]\npub fn insert_user(ctx: &ReducerContext, id: i32, name: String, age: i32, active: bool) -> Result<(), String> {\n ctx.db.users().insert(Users { id, name, age, active });\n Ok(())\n}\n",
|
|
"syntax": "rust"
|
|
},
|
|
"t_005_update": {
|
|
"answer": "use spacetimedb::{reducer, table, ReducerContext};\n\n#[table(name = users)]\npub struct User {\n #[primary_key]\n pub id: i32,\n pub name: String,\n pub age: i32,\n pub active: bool,\n}\n\n#[reducer]\npub fn update_user(ctx: &ReducerContext, id: i32, name: String, age: i32, active: bool) {\n ctx.db.users().id().update(User { id, name, age, active });\n}",
|
|
"syntax": "rust"
|
|
},
|
|
"t_006_delete": {
|
|
"answer": "use spacetimedb::{reducer, table, ReducerContext};\n\n#[table(name = users)]\npub struct User {\n #[primary_key]\n pub id: i32,\n pub name: String,\n pub age: i32,\n pub active: bool,\n}\n\n#[reducer]\npub fn delete_user(ctx: &ReducerContext, id: i32) {\n ctx.db.users().id().delete(id);\n}\n",
|
|
"syntax": "rust"
|
|
},
|
|
"t_007_crud": {
|
|
"answer": "use spacetimedb::{reducer, table, ReducerContext, Table};\n\n#[table(name = users)]\npub struct User {\n #[primary_key]\n pub id: i32,\n pub name: String,\n pub age: i32,\n pub active: bool,\n}\n\n#[reducer]\npub fn crud(ctx: &ReducerContext) {\n ctx.db.users().insert(User { id: 1, name: \"Alice\".into(), age: 30, active: true });\n ctx.db.users().insert(User { id: 2, name: \"Bob\".into(), age: 22, active: false });\n ctx.db.users().id().update(User { id: 1, name: \"Alice2\".into(), age: 31, active: false });\n ctx.db.users().id().delete(2);\n}\n",
|
|
"syntax": "rust"
|
|
},
|
|
"t_008_index_lookup": {
|
|
"answer": "use spacetimedb::{reducer, table, ReducerContext, Table};\n\n#[table(name = users)]\npub struct User {\n #[primary_key]\n pub id: i32,\n pub name: String,\n pub age: i32,\n pub active: bool,\n}\n\n#[table(name = results)]\npub struct ResultRow {\n #[primary_key]\n pub id: i32,\n pub name: String,\n}\n\n#[reducer]\npub fn lookup_user_name(ctx: &ReducerContext, id: i32) {\n if let Some(u) = ctx.db.users().id().find(id) {\n ctx.db.results().insert(ResultRow { id: u.id, name: u.name });\n }\n}\n",
|
|
"syntax": "rust"
|
|
},
|
|
"t_009_init": {
|
|
"answer": "use spacetimedb::{reducer, table, ReducerContext, Table};\n\n#[table(name = users)]\npub struct User {\n #[primary_key]\n pub id: i32,\n pub name: String,\n pub age: i32,\n pub active: bool,\n}\n\n#[reducer(init)]\npub fn init(ctx: &ReducerContext) {\n ctx.db.users().insert(User { id: 1, name: \"Alice\".into(), age: 30, active: true });\n ctx.db.users().insert(User { id: 2, name: \"Bob\".into(), age: 22, active: false });\n}\n",
|
|
"syntax": "rust"
|
|
},
|
|
"t_010_connect": {
|
|
"answer": "use spacetimedb::{reducer, table, ReducerContext, Table};\n\n#[table(name = events)]\npub struct Event {\n #[primary_key]\n #[auto_inc]\n pub id: u64,\n pub kind: String,\n}\n\n#[reducer(client_connected)]\npub fn client_connected(ctx: &ReducerContext) {\n ctx.db.events().insert(Event { id: 0, kind: \"connected\".into() });\n}\n\n#[reducer(client_disconnected)]\npub fn client_disconnected(ctx: &ReducerContext) {\n ctx.db.events().insert(Event { id: 0, kind: \"disconnected\".into() });\n}\n",
|
|
"syntax": "rust"
|
|
},
|
|
"t_011_helper_function": {
|
|
"answer": "use spacetimedb::{reducer, table, ReducerContext, Table};\n\n#[table(name = results)]\npub struct ResultRow {\n #[primary_key]\n pub id: i32,\n pub sum: i32,\n}\n\nfn add(a: i32, b: i32) -> i32 { a + b }\n\n#[reducer]\npub fn compute_sum(ctx: &ReducerContext, id: i32, a: i32, b: i32) {\n ctx.db.results().insert(ResultRow { id, sum: add(a, b) });\n}\n",
|
|
"syntax": "rust"
|
|
},
|
|
"t_012_spacetime_product_type": {
|
|
"answer": "use spacetimedb::{reducer, table, ReducerContext, SpacetimeType, Table};\n\n#[derive(SpacetimeType, Clone, Debug)]\npub struct Score {\n pub left: i32,\n pub right: i32,\n}\n\n#[table(name = results)]\npub struct ResultRow {\n #[primary_key]\n pub id: i32,\n pub value: Score,\n}\n\n#[reducer]\npub fn set_score(ctx: &ReducerContext, id: i32, left: i32, right: i32) {\n ctx.db.results().insert(ResultRow { id, value: Score { left, right } });\n}\n",
|
|
"syntax": "rust"
|
|
},
|
|
"t_013_spacetime_sum_type": {
|
|
"answer": "use spacetimedb::{reducer, table, ReducerContext, SpacetimeType, Table};\n\n#[derive(SpacetimeType, Clone, Debug)]\npub struct Rect {\n pub width: i32,\n pub height: i32,\n}\n\n#[derive(SpacetimeType, Clone, Debug)]\npub enum Shape {\n Circle(i32),\n Rectangle(Rect),\n}\n\n#[table(name = results)]\npub struct ResultRow {\n #[primary_key]\n pub id: i32,\n pub value: Shape,\n}\n\n#[reducer]\npub fn set_circle(ctx: &ReducerContext, id: i32, radius: i32) {\n ctx.db.results().insert(ResultRow { id, value: Shape::Circle(radius) });\n}\n",
|
|
"syntax": "rust"
|
|
},
|
|
"t_014_elementary_columns": {
|
|
"answer": "use spacetimedb::{reducer, table, ReducerContext, Table};\n\n#[table(name = primitives)]\npub struct Primitive {\n #[primary_key]\n pub id: i32,\n pub count: i32,\n pub total: i64,\n pub price: f32,\n pub ratio: f64,\n pub active: bool,\n pub name: String,\n}\n\n#[reducer]\npub fn seed(ctx: &ReducerContext) {\n ctx.db.primitives().insert(Primitive {\n id: 1,\n count: 2,\n total: 3_000_000_000,\n price: 1.5,\n ratio: 2.25,\n active: true,\n name: \"Alice\".into(),\n });\n}\n",
|
|
"syntax": "rust"
|
|
},
|
|
"t_015_product_type_columns": {
|
|
"answer": "use spacetimedb::{reducer, table, ReducerContext, SpacetimeType, Table};\n\n#[derive(SpacetimeType, Clone, Debug)]\npub struct Address {\n pub street: String,\n pub zip: i32,\n}\n\n#[derive(SpacetimeType, Clone, Debug)]\npub struct Position {\n pub x: i32,\n pub y: i32,\n}\n\n#[table(name = profiles)]\npub struct Profile {\n #[primary_key]\n pub id: i32,\n pub home: Address,\n pub work: Address,\n pub pos: Position,\n}\n\n#[reducer]\npub fn seed(ctx: &ReducerContext) {\n ctx.db.profiles().insert(Profile {\n id: 1,\n home: Address { street: \"1 Main\".into(), zip: 11111 },\n work: Address { street: \"2 Broad\".into(), zip: 22222 },\n pos: Position { x: 7, y: 9 },\n });\n}\n",
|
|
"syntax": "rust"
|
|
},
|
|
"t_016_sum_type_columns": {
|
|
"answer": "use spacetimedb::{reducer, table, ReducerContext, SpacetimeType, Table};\n\n#[derive(SpacetimeType, Clone, Debug)]\npub struct Rect {\n pub width: i32,\n pub height: i32,\n}\n\n#[derive(SpacetimeType, Clone, Debug)]\npub enum Shape {\n Circle(i32),\n Rectangle(Rect),\n}\n\n#[table(name = drawings)]\npub struct Drawing {\n #[primary_key]\n pub id: i32,\n pub a: Shape,\n pub b: Shape,\n}\n\n#[reducer]\npub fn seed(ctx: &ReducerContext) {\n ctx.db.drawings().insert(Drawing {\n id: 1,\n a: Shape::Circle(10),\n b: Shape::Rectangle(Rect { width: 4, height: 6 }),\n });\n}\n",
|
|
"syntax": "rust"
|
|
},
|
|
"t_017_scheduled_columns": {
|
|
"answer": "use spacetimedb::{reducer, table, ReducerContext, ScheduleAt, Table};\nuse std::time::Duration;\n\n#[table(name = tick_timer, scheduled(tick))]\npub struct TickTimer {\n #[primary_key]\n #[auto_inc]\n pub scheduled_id: u64,\n pub scheduled_at: ScheduleAt,\n}\n\n#[reducer]\npub fn tick(_ctx: &ReducerContext, _schedule: TickTimer) {\n}\n\n#[reducer(init)]\npub fn init(ctx: &ReducerContext) {\n let every_50ms: ScheduleAt = Duration::from_millis(50).into();\n ctx.db.tick_timer().insert(TickTimer {\n scheduled_id: 0,\n scheduled_at: every_50ms,\n });\n}\n",
|
|
"syntax": "rust"
|
|
},
|
|
"t_018_constraints": {
|
|
"answer": "use spacetimedb::{reducer, table, ReducerContext, Table};\n\n#[table(\n name = accounts,\n index(name = by_name, btree(columns = [name]))\n)]\npub struct Account {\n #[primary_key]\n pub id: i32,\n #[unique]\n pub email: String,\n pub name: String,\n}\n\n#[reducer]\npub fn seed(ctx: &ReducerContext) {\n ctx.db.accounts().insert(Account { id: 1, email: \"a@example.com\".into(), name: \"Alice\".into() });\n ctx.db.accounts().insert(Account { id: 2, email: \"b@example.com\".into(), name: \"Bob\".into() });\n}\n",
|
|
"syntax": "rust"
|
|
},
|
|
"t_019_many_to_many": {
|
|
"answer": "use spacetimedb::{reducer, table, ReducerContext, Table};\n\n#[table(name = users)]\npub struct User {\n #[primary_key]\n pub user_id: i32,\n pub name: String,\n}\n\n#[table(name = groups)]\npub struct Group {\n #[primary_key]\n pub group_id: i32,\n pub title: String,\n}\n\n#[table(\n name = memberships,\n index(name = by_user, btree(columns = [user_id])),\n index(name = by_group, btree(columns = [group_id]))\n)]\npub struct Membership {\n #[primary_key]\n pub id: i32,\n pub user_id: i32,\n pub group_id: i32,\n}\n\n#[reducer]\npub fn seed(ctx: &ReducerContext) {\n ctx.db.users().insert(User { user_id: 1, name: \"Alice\".into() });\n ctx.db.users().insert(User { user_id: 2, name: \"Bob\".into() });\n\n ctx.db.groups().insert(Group { group_id: 10, title: \"Admin\".into() });\n ctx.db.groups().insert(Group { group_id: 20, title: \"Dev\".into() });\n\n ctx.db.memberships().insert(Membership { id: 1, user_id: 1, group_id: 10 });\n ctx.db.memberships().insert(Membership { id: 2, user_id: 1, group_id: 20 });\n ctx.db.memberships().insert(Membership { id: 3, user_id: 2, group_id: 20 });\n}\n",
|
|
"syntax": "rust"
|
|
},
|
|
"t_020_ecs": {
|
|
"answer": "use spacetimedb::{reducer, table, ReducerContext, Table};\n\n#[table(name = entities)]\npub struct Entity {\n #[primary_key]\n pub id: i32,\n}\n\n#[table(name = positions)]\npub struct Position {\n #[primary_key]\n pub entity_id: i32,\n pub x: i32,\n pub y: i32,\n}\n\n#[table(name = velocities)]\npub struct Velocity {\n #[primary_key]\n pub entity_id: i32,\n pub vx: i32,\n pub vy: i32,\n}\n\n#[table(name = next_positions)]\npub struct NextPosition {\n #[primary_key]\n pub entity_id: i32,\n pub x: i32,\n pub y: i32,\n}\n\n#[reducer]\npub fn seed(ctx: &ReducerContext) {\n ctx.db.entities().insert(Entity { id: 1 });\n ctx.db.entities().insert(Entity { id: 2 });\n\n ctx.db.positions().insert(Position {\n entity_id: 1,\n x: 1,\n y: 0,\n });\n ctx.db.positions().insert(Position {\n entity_id: 2,\n x: 10,\n y: 0,\n });\n\n ctx.db.velocities().insert(Velocity {\n entity_id: 1,\n vx: 1,\n vy: 0,\n });\n ctx.db.velocities().insert(Velocity {\n entity_id: 2,\n vx: -2,\n vy: 3,\n });\n}\n\n#[spacetimedb::reducer]\npub fn step(ctx: &ReducerContext) {\n for p in ctx.db.positions().iter() {\n if let Some(v) = ctx.db.velocities().entity_id().find(p.entity_id) {\n let np = NextPosition {\n entity_id: p.entity_id,\n x: p.x + v.vx,\n y: p.y + v.vy,\n };\n\n if ctx.db.next_positions().entity_id().find(p.entity_id).is_some() {\n ctx.db.next_positions().entity_id().update(np);\n } else {\n ctx.db.next_positions().insert(np);\n }\n }\n }\n}\n",
|
|
"syntax": "rust"
|
|
},
|
|
"t_021_multi_column_index": {
|
|
"answer": "use spacetimedb::{reducer, table, ReducerContext, Table};\n\n#[table(\n name = logs,\n index(name = by_user_day, btree(columns = [user_id, day]))\n)]\npub struct Log {\n #[primary_key]\n pub id: i32,\n pub user_id: i32,\n pub day: i32,\n pub message: String,\n}\n\n#[reducer]\npub fn seed(ctx: &ReducerContext) {\n ctx.db.logs().insert(Log { id: 1, user_id: 7, day: 1, message: \"a\".into() });\n ctx.db.logs().insert(Log { id: 2, user_id: 7, day: 2, message: \"b\".into() });\n ctx.db.logs().insert(Log { id: 3, user_id: 9, day: 1, message: \"c\".into() });\n}\n",
|
|
"syntax": "rust"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"lang": "csharp",
|
|
"modes": [
|
|
{
|
|
"mode": "docs",
|
|
"hash": "7bd1056c239ec41df56d3be0edd5b7aac1c433acc3efbac0fe6f3b2a79ca2f1f",
|
|
"models": [
|
|
{
|
|
"name": "GPT-5",
|
|
"route_api_model": "gpt-5",
|
|
"tasks": {
|
|
"t_000_empty_reducers": {
|
|
"hash": "7bd1056c239ec41df56d3be0edd5b7aac1c433acc3efbac0fe6f3b2a79ca2f1f",
|
|
"task": "t_000_empty_reducers",
|
|
"lang": "csharp",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 1,
|
|
"passed_tests": 1,
|
|
"llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Reducer]\n public static void EmptyReducer_NoArgs(ReducerContext ctx)\n {\n }\n\n [SpacetimeDB.Reducer]\n public static void EmptyReducer_WithInt(ReducerContext ctx, int count)\n {\n }\n\n [SpacetimeDB.Reducer]\n public static void EmptyReducer_WithString(ReducerContext ctx, string name)\n {\n }\n\n [SpacetimeDB.Reducer]\n public static void EmptyReducer_WithTwoArgs(ReducerContext ctx, int count, string name)\n {\n }\n\n [SpacetimeDB.Reducer]\n public static void EmptyReducer_WithThreeArgs(ReducerContext ctx, bool active, float ratio, string label)\n {\n }\n}",
|
|
"category": "basics",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "basics-t-000-empty-reducers-golden",
|
|
"llm_db": "basics-t-000-empty-reducers-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/basics/t_000_empty_reducers/csharp/server/golden",
|
|
"work_dir_llm": "target/llm-runs/basics/t_000_empty_reducers/csharp/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "basics-t-000-empty-reducers-golden",
|
|
"llm_db": "basics-t-000-empty-reducers-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:35677",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:40:24.282055723Z",
|
|
"finished_at": "2026-01-17T02:40:56.269475914Z"
|
|
},
|
|
"t_001_basic_tables": {
|
|
"hash": "7bd1056c239ec41df56d3be0edd5b7aac1c433acc3efbac0fe6f3b2a79ca2f1f",
|
|
"task": "t_001_basic_tables",
|
|
"lang": "csharp",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 1,
|
|
"passed_tests": 1,
|
|
"llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table]\n public partial struct User\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public string Name;\n public int Age;\n public bool Active;\n }\n\n [SpacetimeDB.Table]\n public partial struct Product\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public string Title;\n public float Price;\n public bool InStock;\n }\n\n [SpacetimeDB.Table]\n public partial struct Note\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public string Body;\n public long Rating;\n public bool Pinned;\n }\n}",
|
|
"category": "basics",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "basics-t-001-basic-tables-golden",
|
|
"llm_db": "basics-t-001-basic-tables-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/basics/t_001_basic_tables/csharp/server/golden",
|
|
"work_dir_llm": "target/llm-runs/basics/t_001_basic_tables/csharp/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "basics-t-001-basic-tables-golden",
|
|
"llm_db": "basics-t-001-basic-tables-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:35677",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:43:28.640515207Z",
|
|
"finished_at": "2026-01-17T02:43:58.187104574Z"
|
|
},
|
|
"t_002_scheduled_table": {
|
|
"hash": "7bd1056c239ec41df56d3be0edd5b7aac1c433acc3efbac0fe6f3b2a79ca2f1f",
|
|
"task": "t_002_scheduled_table",
|
|
"lang": "csharp",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 1,
|
|
"passed_tests": 1,
|
|
"llm_output": "using System;\nusing SpacetimeDB;\n\npublic static partial class Module\n{\n [Table(Name = \"TickTimer\", Scheduled = nameof(Tick), ScheduledAt = nameof(ScheduledAt))]\n public partial struct TickTimer\n {\n [PrimaryKey, AutoInc]\n public ulong ScheduledId;\n public ScheduleAt ScheduledAt;\n }\n\n [Reducer(ReducerKind.Init)]\n public static void Init(ReducerContext ctx)\n {\n ctx.Db.TickTimer.Insert(new TickTimer\n {\n ScheduledAt = new ScheduleAt.Interval(TimeSpan.FromMilliseconds(50))\n });\n }\n\n [Reducer]\n public static void Tick(ReducerContext ctx, TickTimer timer)\n {\n }\n}",
|
|
"category": "basics",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "basics-t-002-scheduled-table-golden",
|
|
"llm_db": "basics-t-002-scheduled-table-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/basics/t_002_scheduled_table/csharp/server/golden",
|
|
"work_dir_llm": "target/llm-runs/basics/t_002_scheduled_table/csharp/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "basics-t-002-scheduled-table-golden",
|
|
"llm_db": "basics-t-002-scheduled-table-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:35677",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:42:25.159472748Z",
|
|
"finished_at": "2026-01-17T02:43:07.893721504Z"
|
|
},
|
|
"t_003_struct_in_table": {
|
|
"hash": "7bd1056c239ec41df56d3be0edd5b7aac1c433acc3efbac0fe6f3b2a79ca2f1f",
|
|
"task": "t_003_struct_in_table",
|
|
"lang": "csharp",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 1,
|
|
"passed_tests": 1,
|
|
"llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Type]\n public partial struct Position\n {\n public int X;\n public int Y;\n }\n\n [SpacetimeDB.Table(Name = \"Entity\", Public = true)]\n public partial struct Entity\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public Position Pos;\n }\n}",
|
|
"category": "basics",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "basics-t-003-struct-in-table-golden",
|
|
"llm_db": "basics-t-003-struct-in-table-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/basics/t_003_struct_in_table/csharp/server/golden",
|
|
"work_dir_llm": "target/llm-runs/basics/t_003_struct_in_table/csharp/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "basics-t-003-struct-in-table-golden",
|
|
"llm_db": "basics-t-003-struct-in-table-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:35677",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:43:07.893755608Z",
|
|
"finished_at": "2026-01-17T02:43:39.643821282Z"
|
|
},
|
|
"t_004_insert": {
|
|
"hash": "7bd1056c239ec41df56d3be0edd5b7aac1c433acc3efbac0fe6f3b2a79ca2f1f",
|
|
"task": "t_004_insert",
|
|
"lang": "csharp",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 2,
|
|
"passed_tests": 1,
|
|
"llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table(Name = \"User\", Public = true)]\n public partial struct User\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public string Name;\n public int Age;\n public bool Active;\n }\n\n [SpacetimeDB.Reducer]\n public static void InsertUser(ReducerContext ctx, int id, string name, int age, bool active)\n {\n ctx.Db.User.Insert(new User\n {\n Id = id,\n Name = name,\n Age = age,\n Active = active\n });\n }\n}",
|
|
"category": "basics",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "basics-t-004-insert-golden",
|
|
"llm_db": "basics-t-004-insert-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/basics/t_004_insert/csharp/server/golden",
|
|
"work_dir_llm": "target/llm-runs/basics/t_004_insert/csharp/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"data_parity_insert_user": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `users`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:35677/v1/database/c200933266559154a4d1e8adf441af2b283882c3206ed34f5c4ef907d29de6a7/sql)\n",
|
|
"phase": "sql_golden"
|
|
}
|
|
},
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "basics-t-004-insert-golden",
|
|
"llm_db": "basics-t-004-insert-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:35677",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:43:58.187152683Z",
|
|
"finished_at": "2026-01-17T02:44:26.839511728Z"
|
|
},
|
|
"t_005_update": {
|
|
"hash": "7bd1056c239ec41df56d3be0edd5b7aac1c433acc3efbac0fe6f3b2a79ca2f1f",
|
|
"task": "t_005_update",
|
|
"lang": "csharp",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 3,
|
|
"passed_tests": 1,
|
|
"llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table(Name = \"User\", Public = true)]\n public partial struct User\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public string Name;\n public int Age;\n public bool Active;\n }\n\n [SpacetimeDB.Reducer]\n public static void UpdateUser(ReducerContext ctx, int id, string name, int age, bool active)\n {\n if (ctx.Db.User.Id.Find(id) is User user)\n {\n user.Id = id;\n user.Name = name;\n user.Age = age;\n user.Active = active;\n ctx.Db.User.Id.Update(user);\n }\n }\n}",
|
|
"category": "basics",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "basics-t-005-update-golden",
|
|
"llm_db": "basics-t-005-update-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/basics/t_005_update/csharp/server/golden",
|
|
"work_dir_llm": "target/llm-runs/basics/t_005_update/csharp/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"data_parity_update_user": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime call failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: Response text: SpacetimeDB.NoSuchRowException: The row was not found, e.g., in an update call\n at SpacetimeDB.Internal.FFI.CheckedStatus.Marshaller.ConvertToManaged(Errno )\n at SpacetimeDB.Internal.FFI.datastore_update_bsatn(TableId , IndexId , Span`1 , UInt32& )\n at SpacetimeDB.Internal.UniqueIndex`4[[SpacetimeDB.Internal.TableHandles.User, StdbModule, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Module.User, StdbModule, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[System.Int32, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[SpacetimeDB.BSATN.I32, SpacetimeDB.BSATN.Runtime, Version=1.6.0.0, Culture=neutral, PublicKeyToken=null]].DoUpdate(User )\n at SpacetimeDB.Internal.TableHandles.User.IdUniqueIndex.Update(User )\n at Module.UpdateUser(ReducerContext , Int32 , String , Int32 , Boolean )\n at ModuleRegistration.UpdateUser.Invoke(BinaryReader , IReducerContext )\n at SpacetimeDB.Internal.Module.__call_reducer__(UInt32 id, UInt64 sender_0, UInt64 sender_1, UInt64 sender_2, UInt64 sender_3, UInt64 conn_id_0, UInt64 conn_id_1, Timestamp timestamp, BytesSource args, BytesSink error)\n\nCaused by:\n HTTP status server error (530 <none>) for url (http://127.0.0.1:35677/v1/database/c200523e08ccb74ff8d13ab66f492b457bb8aeee5e4fdafc5d1fec7431a9b4e9/call/UpdateUser)\n",
|
|
"phase": "call_reducer_golden"
|
|
}
|
|
},
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "basics-t-005-update-golden",
|
|
"llm_db": "basics-t-005-update-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:35677",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
},
|
|
"seed_users_row": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `users`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:35677/v1/database/c200523e08ccb74ff8d13ab66f492b457bb8aeee5e4fdafc5d1fec7431a9b4e9/sql)\n",
|
|
"phase": "sql_golden",
|
|
"sql": "INSERT INTO users(Id, Name, Age, Active) VALUES (1, 'Alice', 30, true)"
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:42:19.102421878Z",
|
|
"finished_at": "2026-01-17T02:42:52.237316726Z"
|
|
},
|
|
"t_006_delete": {
|
|
"hash": "7bd1056c239ec41df56d3be0edd5b7aac1c433acc3efbac0fe6f3b2a79ca2f1f",
|
|
"task": "t_006_delete",
|
|
"lang": "csharp",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 3,
|
|
"passed_tests": 1,
|
|
"llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table(Name = \"User\")]\n public partial struct User\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public string Name;\n public int Age;\n public bool Active;\n }\n\n [SpacetimeDB.Reducer]\n public static void DeleteUser(ReducerContext ctx, int id)\n {\n ctx.Db.User.Id.Delete(id);\n }\n}",
|
|
"category": "basics",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "basics-t-006-delete-golden",
|
|
"llm_db": "basics-t-006-delete-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/basics/t_006_delete/csharp/server/golden",
|
|
"work_dir_llm": "target/llm-runs/basics/t_006_delete/csharp/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "basics-t-006-delete-golden",
|
|
"llm_db": "basics-t-006-delete-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:35677",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
},
|
|
"delete_user_count_zero": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `users`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:35677/v1/database/c2004b74d3be00407c2d02282ee08b25e5e8242063995dea613d8fc1467ef09e/sql)\n",
|
|
"phase": "sql"
|
|
}
|
|
},
|
|
"seed_users_row": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `users`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:35677/v1/database/c200052ec3b2af2555b2766443d690ff70a4d07ffd410be917b433381552b936/sql)\n",
|
|
"phase": "sql_golden",
|
|
"sql": "INSERT INTO users(Id, Name, Age, Active) VALUES (1, 'Alice', 30, true)"
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:40:56.269507302Z",
|
|
"finished_at": "2026-01-17T02:41:28.991775660Z"
|
|
},
|
|
"t_007_crud": {
|
|
"hash": "7bd1056c239ec41df56d3be0edd5b7aac1c433acc3efbac0fe6f3b2a79ca2f1f",
|
|
"task": "t_007_crud",
|
|
"lang": "csharp",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 4,
|
|
"passed_tests": 1,
|
|
"llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table(Name = \"User\", Public = true)]\n public partial struct User\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public string Name;\n public int Age;\n public bool Active;\n }\n\n [SpacetimeDB.Reducer]\n public static void Crud(ReducerContext ctx)\n {\n ctx.Db.User.Insert(new User { Id = 1, Name = \"Alice\", Age = 30, Active = true });\n ctx.Db.User.Insert(new User { Id = 2, Name = \"Bob\", Age = 22, Active = false });\n\n if (ctx.Db.User.Id.Find(1) is User user)\n {\n user.Name = \"Alice2\";\n user.Age = 31;\n user.Active = false;\n ctx.Db.User.Id.Update(user);\n }\n\n ctx.Db.User.Id.Delete(2);\n }\n}",
|
|
"category": "basics",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "basics-t-007-crud-golden",
|
|
"llm_db": "basics-t-007-crud-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/basics/t_007_crud/csharp/server/golden",
|
|
"work_dir_llm": "target/llm-runs/basics/t_007_crud/csharp/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"crud_row_id1_parity": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `users`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:35677/v1/database/c2006b22042e3fba4f36b1b44b80a07da826122ccc12419c53c511830a0c78f9/sql)\n",
|
|
"phase": "sql_golden"
|
|
}
|
|
},
|
|
"crud_row_id2_deleted": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `users`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:35677/v1/database/c2003c5aaa4b9c829e64c505f35cb7241f299a733d0f5a89da64241c5e052096/sql)\n",
|
|
"phase": "sql"
|
|
}
|
|
},
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "basics-t-007-crud-golden",
|
|
"llm_db": "basics-t-007-crud-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:35677",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
},
|
|
"crud_total_count_one": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `users`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:35677/v1/database/c2003c5aaa4b9c829e64c505f35cb7241f299a733d0f5a89da64241c5e052096/sql)\n",
|
|
"phase": "sql"
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:40:51.462439194Z",
|
|
"finished_at": "2026-01-17T02:41:35.805469514Z"
|
|
},
|
|
"t_008_index_lookup": {
|
|
"hash": "7bd1056c239ec41df56d3be0edd5b7aac1c433acc3efbac0fe6f3b2a79ca2f1f",
|
|
"task": "t_008_index_lookup",
|
|
"lang": "csharp",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 3,
|
|
"passed_tests": 1,
|
|
"llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table(Name = \"User\", Public = true)]\n public partial struct User\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public string Name;\n public int Age;\n public bool Active;\n }\n\n [SpacetimeDB.Table(Name = \"Result\", Public = true)]\n public partial struct Result\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public string Name;\n }\n\n [SpacetimeDB.Reducer]\n public static void LookupUserName(ReducerContext ctx, int id)\n {\n if (ctx.Db.User.Id.Find(id) is User user)\n {\n ctx.Db.Result.Insert(new Result\n {\n Id = user.Id,\n Name = user.Name\n });\n }\n }\n}",
|
|
"category": "basics",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "basics-t-008-index-lookup-golden",
|
|
"llm_db": "basics-t-008-index-lookup-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/basics/t_008_index_lookup/csharp/server/golden",
|
|
"work_dir_llm": "target/llm-runs/basics/t_008_index_lookup/csharp/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "basics-t-008-index-lookup-golden",
|
|
"llm_db": "basics-t-008-index-lookup-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:35677",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
},
|
|
"seed_user_row": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `users`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:35677/v1/database/c2009fb018392f6be9608948e77d6c1cbdd60e04fc795fc595009cb76a175394/sql)\n",
|
|
"phase": "sql_golden",
|
|
"sql": "INSERT INTO users(Id, Name, Age, Active) VALUES (1, 'Alice', 30, true)"
|
|
}
|
|
},
|
|
"index_lookup_projection_parity": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `results`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:35677/v1/database/c2009fb018392f6be9608948e77d6c1cbdd60e04fc795fc595009cb76a175394/sql)\n",
|
|
"phase": "sql_golden"
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:41:28.991836824Z",
|
|
"finished_at": "2026-01-17T02:42:19.102358640Z"
|
|
},
|
|
"t_009_init": {
|
|
"hash": "7bd1056c239ec41df56d3be0edd5b7aac1c433acc3efbac0fe6f3b2a79ca2f1f",
|
|
"task": "t_009_init",
|
|
"lang": "csharp",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 4,
|
|
"passed_tests": 1,
|
|
"llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table(Name = \"User\", Public = true)]\n public partial struct User\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public string Name;\n public int Age;\n public bool Active;\n }\n\n [SpacetimeDB.Reducer(ReducerKind.Init)]\n public static void Init(ReducerContext ctx)\n {\n ctx.Db.User.Insert(new User { Id = 1, Name = \"Alice\", Age = 30, Active = true });\n ctx.Db.User.Insert(new User { Id = 2, Name = \"Bob\", Age = 22, Active = false });\n }\n}",
|
|
"category": "basics",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "basics-t-009-init-golden",
|
|
"llm_db": "basics-t-009-init-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/basics/t_009_init/csharp/server/golden",
|
|
"work_dir_llm": "target/llm-runs/basics/t_009_init/csharp/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"init_seed_bob": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `users`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:35677/v1/database/c20058e57001dda166048aa4be9fd4471b9b37f134fd7481e1ada013429df130/sql)\n",
|
|
"phase": "sql"
|
|
}
|
|
},
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "basics-t-009-init-golden",
|
|
"llm_db": "basics-t-009-init-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:35677",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
},
|
|
"init_seed_alice": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `users`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:35677/v1/database/c20058e57001dda166048aa4be9fd4471b9b37f134fd7481e1ada013429df130/sql)\n",
|
|
"phase": "sql"
|
|
}
|
|
},
|
|
"init_total_two": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `users`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:35677/v1/database/c20058e57001dda166048aa4be9fd4471b9b37f134fd7481e1ada013429df130/sql)\n",
|
|
"phase": "sql"
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:41:35.805507675Z",
|
|
"finished_at": "2026-01-17T02:42:25.159425259Z"
|
|
},
|
|
"t_010_connect": {
|
|
"hash": "7bd1056c239ec41df56d3be0edd5b7aac1c433acc3efbac0fe6f3b2a79ca2f1f",
|
|
"task": "t_010_connect",
|
|
"lang": "csharp",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 1,
|
|
"passed_tests": 1,
|
|
"llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table(Name = \"Event\")]\n public partial struct Event\n {\n [SpacetimeDB.PrimaryKey]\n [SpacetimeDB.AutoInc]\n public int Id;\n public string Kind;\n }\n\n [Reducer(ReducerKind.ClientConnected)]\n public static void ClientConnected(ReducerContext ctx)\n {\n ctx.Db.Event.Insert(new Event\n {\n Id = 0,\n Kind = \"connected\",\n });\n }\n\n [Reducer(ReducerKind.ClientDisconnected)]\n public static void ClientDisconnected(ReducerContext ctx)\n {\n ctx.Db.Event.Insert(new Event\n {\n Id = 0,\n Kind = \"disconnected\",\n });\n }\n}",
|
|
"category": "basics",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "basics-t-010-connect-golden",
|
|
"llm_db": "basics-t-010-connect-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/basics/t_010_connect/csharp/server/golden",
|
|
"work_dir_llm": "target/llm-runs/basics/t_010_connect/csharp/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "basics-t-010-connect-golden",
|
|
"llm_db": "basics-t-010-connect-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:35677",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:43:39.643859323Z",
|
|
"finished_at": "2026-01-17T02:44:14.452325815Z"
|
|
},
|
|
"t_011_helper_function": {
|
|
"hash": "7bd1056c239ec41df56d3be0edd5b7aac1c433acc3efbac0fe6f3b2a79ca2f1f",
|
|
"task": "t_011_helper_function",
|
|
"lang": "csharp",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 3,
|
|
"passed_tests": 1,
|
|
"llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table(Name = \"Result\", Public = true)]\n public partial struct Result\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public int Sum;\n }\n\n public static int Add(int a, int b)\n {\n return a + b;\n }\n\n [SpacetimeDB.Reducer]\n public static void ComputeSum(ReducerContext ctx, int id, int a, int b)\n {\n ctx.Db.Result.Insert(new Result\n {\n Id = id,\n Sum = Add(a, b)\n });\n }\n}",
|
|
"category": "basics",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "basics-t-011-helper-function-golden",
|
|
"llm_db": "basics-t-011-helper-function-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/basics/t_011_helper_function/csharp/server/golden",
|
|
"work_dir_llm": "target/llm-runs/basics/t_011_helper_function/csharp/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"helper_func_sum_abs": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `results`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:35677/v1/database/c200bacfa9e399c2f18f42a36dcfe8479e933d44e6e749cbcc699afdf2cd855d/sql)\n",
|
|
"phase": "sql"
|
|
}
|
|
},
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "basics-t-011-helper-function-golden",
|
|
"llm_db": "basics-t-011-helper-function-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:35677",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
},
|
|
"helper_func_sum_parity": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `results`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:35677/v1/database/c200b67e605283bc59b71366b2f40ab582a2bbbfc946e2c8510ce84f55424a14/sql)\n",
|
|
"phase": "sql_golden"
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:42:52.237342945Z",
|
|
"finished_at": "2026-01-17T02:43:28.640296252Z"
|
|
},
|
|
"t_012_spacetime_product_type": {
|
|
"hash": "7bd1056c239ec41df56d3be0edd5b7aac1c433acc3efbac0fe6f3b2a79ca2f1f",
|
|
"task": "t_012_spacetime_product_type",
|
|
"lang": "csharp",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 3,
|
|
"passed_tests": 1,
|
|
"llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Type]\n public partial struct Score\n {\n public int Left;\n public int Right;\n }\n\n [SpacetimeDB.Table(Name = \"Result\", Public = true)]\n public partial struct Result\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public Score Value;\n }\n\n [SpacetimeDB.Reducer]\n public static void SetScore(ReducerContext ctx, int id, int left, int right)\n {\n ctx.Db.Result.Insert(new Result\n {\n Id = id,\n Value = new Score { Left = left, Right = right }\n });\n }\n}",
|
|
"category": "schema",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "schema-t-012-spacetime-product-type-golden",
|
|
"llm_db": "schema-t-012-spacetime-product-type-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/schema/t_012_spacetime_product_type/csharp/server/golden",
|
|
"work_dir_llm": "target/llm-runs/schema/t_012_spacetime_product_type/csharp/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "schema-t-012-spacetime-product-type-golden",
|
|
"llm_db": "schema-t-012-spacetime-product-type-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:35677",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
},
|
|
"product_type_row_parity": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `results`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:35677/v1/database/c200000593a1c1f41d9a7ca9ff85b3f10b7eb54ba57159f084fd8b1d4196e453/sql)\n",
|
|
"phase": "sql_golden"
|
|
}
|
|
},
|
|
"product_type_row_count": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `results`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:35677/v1/database/c200773151fae81e0c0863ae9d0a4534b2934c3b4023363ffb2b7c1930309b46/sql)\n",
|
|
"phase": "sql"
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:38:56.019269384Z",
|
|
"finished_at": "2026-01-17T02:39:27.502611490Z"
|
|
},
|
|
"t_013_spacetime_sum_type": {
|
|
"hash": "7bd1056c239ec41df56d3be0edd5b7aac1c433acc3efbac0fe6f3b2a79ca2f1f",
|
|
"task": "t_013_spacetime_sum_type",
|
|
"lang": "csharp",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 3,
|
|
"passed_tests": 1,
|
|
"llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Type]\n public partial struct Circle\n {\n public int Radius;\n }\n\n [SpacetimeDB.Type]\n public partial struct Rectangle\n {\n public int Width;\n public int Height;\n }\n\n [SpacetimeDB.Type]\n public partial record Shape : TaggedEnum<(Circle Circle, Rectangle Rectangle)> { }\n\n [SpacetimeDB.Table(Name = \"Result\")]\n public partial struct Result\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public Shape Value;\n }\n\n [SpacetimeDB.Reducer]\n public static void SetCircle(SpacetimeDB.ReducerContext ctx, int id, int radius)\n {\n var circle = new Circle { Radius = radius };\n var shape = new Shape.Circle(circle);\n ctx.Db.Result.Insert(new Result { Id = id, Value = shape });\n }\n}",
|
|
"category": "schema",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "schema-t-013-spacetime-sum-type-golden",
|
|
"llm_db": "schema-t-013-spacetime-sum-type-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/schema/t_013_spacetime_sum_type/csharp/server/golden",
|
|
"work_dir_llm": "target/llm-runs/schema/t_013_spacetime_sum_type/csharp/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"sum_type_row_count": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `results`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:35677/v1/database/c2009a86be1f0f78642d2ade147db198738ef88aa551d11bb76e42c1c8900e9a/sql)\n",
|
|
"phase": "sql"
|
|
}
|
|
},
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "schema-t-013-spacetime-sum-type-golden",
|
|
"llm_db": "schema-t-013-spacetime-sum-type-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:35677",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
},
|
|
"sum_type_row_parity": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `results`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:35677/v1/database/c200d82761d2c72dc9a864fd786af31b4c9ef43bb79b633450e8e561c3eea2ce/sql)\n",
|
|
"phase": "sql_golden"
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:40:02.303793183Z",
|
|
"finished_at": "2026-01-17T02:40:51.462059047Z"
|
|
},
|
|
"t_014_elementary_columns": {
|
|
"hash": "7bd1056c239ec41df56d3be0edd5b7aac1c433acc3efbac0fe6f3b2a79ca2f1f",
|
|
"task": "t_014_elementary_columns",
|
|
"lang": "csharp",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 3,
|
|
"passed_tests": 1,
|
|
"llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table(Name = \"Primitive\", Public = true)]\n public partial struct Primitive\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public int Count;\n public long Total;\n public float Price;\n public double Ratio;\n public bool Active;\n public string Name;\n }\n\n [SpacetimeDB.Reducer]\n public static void Seed(ReducerContext ctx)\n {\n ctx.Db.Primitive.Insert(new Primitive\n {\n Id = 1,\n Count = 2,\n Total = 3000000000L,\n Price = 1.5f,\n Ratio = 2.25,\n Active = true,\n Name = \"Alice\"\n });\n }\n}",
|
|
"category": "schema",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "schema-t-014-elementary-columns-golden",
|
|
"llm_db": "schema-t-014-elementary-columns-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/schema/t_014_elementary_columns/csharp/server/golden",
|
|
"work_dir_llm": "target/llm-runs/schema/t_014_elementary_columns/csharp/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"elementary_columns_row_parity": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `primitives`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:35677/v1/database/c2003f9c20afc908b6f3fae929b8555ec0e90cf407b107f224de84971189e7b3/sql)\n",
|
|
"phase": "sql_golden"
|
|
}
|
|
},
|
|
"elementary_columns_row_count": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `primitives`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:35677/v1/database/c2009b868c8501f40d75f3046c80b4fa8bc7018d8baf65ff12c991bbab6d605a/sql)\n",
|
|
"phase": "sql"
|
|
}
|
|
},
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "schema-t-014-elementary-columns-golden",
|
|
"llm_db": "schema-t-014-elementary-columns-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:35677",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:38:36.670677504Z",
|
|
"finished_at": "2026-01-17T02:39:15.092747325Z"
|
|
},
|
|
"t_015_product_type_columns": {
|
|
"hash": "7bd1056c239ec41df56d3be0edd5b7aac1c433acc3efbac0fe6f3b2a79ca2f1f",
|
|
"task": "t_015_product_type_columns",
|
|
"lang": "csharp",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 3,
|
|
"passed_tests": 1,
|
|
"llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Type]\n public partial struct Address\n {\n public string Street;\n public int Zip;\n }\n\n [SpacetimeDB.Type]\n public partial struct Position\n {\n public int X;\n public int Y;\n }\n\n [SpacetimeDB.Table(Name = \"Profile\", Public = true)]\n public partial struct Profile\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public Address Home;\n public Address Work;\n public Position Pos;\n }\n\n [SpacetimeDB.Reducer]\n public static void Seed(ReducerContext ctx)\n {\n ctx.Db.Profile.Insert(new Profile\n {\n Id = 1,\n Home = new Address { Street = \"1 Main\", Zip = 11111 },\n Work = new Address { Street = \"2 Broad\", Zip = 22222 },\n Pos = new Position { X = 7, Y = 9 }\n });\n }\n}",
|
|
"category": "schema",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "schema-t-015-product-type-columns-golden",
|
|
"llm_db": "schema-t-015-product-type-columns-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/schema/t_015_product_type_columns/csharp/server/golden",
|
|
"work_dir_llm": "target/llm-runs/schema/t_015_product_type_columns/csharp/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "schema-t-015-product-type-columns-golden",
|
|
"llm_db": "schema-t-015-product-type-columns-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:35677",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
},
|
|
"product_type_columns_row_count": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `profiles`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:35677/v1/database/c2007bfa13561ce0c8cb477e4e11171bc3733d8ba01683aecd94ed2d3f231319/sql)\n",
|
|
"phase": "sql"
|
|
}
|
|
},
|
|
"product_type_columns_row_parity": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `profiles`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:35677/v1/database/c200e5ea78db1095b274afeafb8041e139a0d7f11834b194b863882d4a7c3328/sql)\n",
|
|
"phase": "sql_golden"
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:39:15.092804541Z",
|
|
"finished_at": "2026-01-17T02:40:02.303741426Z"
|
|
},
|
|
"t_016_sum_type_columns": {
|
|
"hash": "7bd1056c239ec41df56d3be0edd5b7aac1c433acc3efbac0fe6f3b2a79ca2f1f",
|
|
"task": "t_016_sum_type_columns",
|
|
"lang": "csharp",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 3,
|
|
"passed_tests": 1,
|
|
"llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Type]\n public partial struct Circle\n {\n public int Radius;\n }\n\n [SpacetimeDB.Type]\n public partial struct Rectangle\n {\n public int Width;\n public int Height;\n }\n\n [SpacetimeDB.Type]\n public partial record Shape : TaggedEnum<(Circle Circle, Rectangle Rectangle)> { }\n\n [SpacetimeDB.Table(Name = \"Drawing\")]\n public partial struct Drawing\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public Shape A;\n public Shape B;\n }\n\n [SpacetimeDB.Reducer]\n public static void Seed(ReducerContext ctx)\n {\n ctx.Db.Drawing.Insert(new Drawing\n {\n Id = 1,\n A = new Shape.Circle(new Circle { Radius = 10 }),\n B = new Shape.Rectangle(new Rectangle { Width = 4, Height = 6 })\n });\n }\n}",
|
|
"category": "schema",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "schema-t-016-sum-type-columns-golden",
|
|
"llm_db": "schema-t-016-sum-type-columns-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/schema/t_016_sum_type_columns/csharp/server/golden",
|
|
"work_dir_llm": "target/llm-runs/schema/t_016_sum_type_columns/csharp/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"sum_type_columns_row_parity": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `drawings`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:35677/v1/database/c2004da484f449e95616d5eb1c6832e7e06faf68e5ebbe454e63475d86740e6c/sql)\n",
|
|
"phase": "sql_golden"
|
|
}
|
|
},
|
|
"sum_type_columns_row_count": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `drawings`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:35677/v1/database/c2008ad55b1dba50ea8bb36552e0bc9480b27d8060b57d8ed5e9e4d86cb6b5f8/sql)\n",
|
|
"phase": "sql"
|
|
}
|
|
},
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "schema-t-016-sum-type-columns-golden",
|
|
"llm_db": "schema-t-016-sum-type-columns-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:35677",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:39:27.502655041Z",
|
|
"finished_at": "2026-01-17T02:40:24.282007063Z"
|
|
},
|
|
"t_017_scheduled_columns": {
|
|
"hash": "7bd1056c239ec41df56d3be0edd5b7aac1c433acc3efbac0fe6f3b2a79ca2f1f",
|
|
"task": "t_017_scheduled_columns",
|
|
"lang": "csharp",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 2,
|
|
"passed_tests": 1,
|
|
"llm_output": "using System;\nusing SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table(Name = \"TickTimer\", Scheduled = nameof(Tick), ScheduledAt = nameof(ScheduledAt))]\n public partial struct TickTimer\n {\n [SpacetimeDB.PrimaryKey]\n [SpacetimeDB.AutoInc]\n public ulong ScheduledId;\n public ScheduleAt ScheduledAt;\n }\n\n [SpacetimeDB.Reducer]\n public static void Tick(ReducerContext ctx, TickTimer _timer)\n {\n }\n\n [SpacetimeDB.Reducer(ReducerKind.Init)]\n public static void Init(ReducerContext ctx)\n {\n ctx.Db.TickTimer.Insert(new TickTimer\n {\n ScheduledAt = new ScheduleAt.Interval(TimeSpan.FromMilliseconds(50))\n });\n }\n}",
|
|
"category": "schema",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "schema-t-017-scheduled-columns-golden",
|
|
"llm_db": "schema-t-017-scheduled-columns-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/schema/t_017_scheduled_columns/csharp/server/golden",
|
|
"work_dir_llm": "target/llm-runs/schema/t_017_scheduled_columns/csharp/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"scheduled_seeded_one_row": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `tick_timer`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:35677/v1/database/c20024b2c639ed44059f68c872d4ae8686e43def045ff88fb49f452645a17338/sql)\n",
|
|
"phase": "sql"
|
|
}
|
|
},
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "schema-t-017-scheduled-columns-golden",
|
|
"llm_db": "schema-t-017-scheduled-columns-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:35677",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:38:01.497464655Z",
|
|
"finished_at": "2026-01-17T02:38:36.670468145Z"
|
|
},
|
|
"t_018_constraints": {
|
|
"hash": "7bd1056c239ec41df56d3be0edd5b7aac1c433acc3efbac0fe6f3b2a79ca2f1f",
|
|
"task": "t_018_constraints",
|
|
"lang": "csharp",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 3,
|
|
"passed_tests": 1,
|
|
"llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table(Name = \"Account\")]\n [SpacetimeDB.Index.BTree(Name = \"by_name\", Columns = [\"Name\"])]\n public partial struct Account\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n [SpacetimeDB.Unique]\n public string Email;\n public string Name;\n }\n\n [SpacetimeDB.Reducer]\n public static void Seed(ReducerContext ctx)\n {\n ctx.Db.Account.Insert(new Account { Id = 1, Email = \"a@example.com\", Name = \"Alice\" });\n ctx.Db.Account.Insert(new Account { Id = 2, Email = \"b@example.com\", Name = \"Bob\" });\n }\n}",
|
|
"category": "schema",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "schema-t-018-constraints-golden",
|
|
"llm_db": "schema-t-018-constraints-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/schema/t_018_constraints/csharp/server/golden",
|
|
"work_dir_llm": "target/llm-runs/schema/t_018_constraints/csharp/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "schema-t-018-constraints-golden",
|
|
"llm_db": "schema-t-018-constraints-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:35677",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
},
|
|
"constraints_row_parity_after_seed": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `accounts`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:35677/v1/database/c200db49191274d7a3a7263567507f9945c4e802cb3173928c835966c8331803/sql)\n",
|
|
"phase": "sql_golden"
|
|
}
|
|
},
|
|
"constraints_seed_two_rows": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `accounts`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:35677/v1/database/c20025629920e94d036ee70c22a88bf38265ab06fbb5cfc2c505e147018ad40c/sql)\n",
|
|
"phase": "sql"
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:37:43.947065043Z",
|
|
"finished_at": "2026-01-17T02:38:24.847760366Z"
|
|
},
|
|
"t_019_many_to_many": {
|
|
"hash": "7bd1056c239ec41df56d3be0edd5b7aac1c433acc3efbac0fe6f3b2a79ca2f1f",
|
|
"task": "t_019_many_to_many",
|
|
"lang": "csharp",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 5,
|
|
"passed_tests": 1,
|
|
"llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table(Name = \"User\")]\n public partial struct User\n {\n [SpacetimeDB.PrimaryKey]\n public int UserId;\n public string Name;\n }\n\n [SpacetimeDB.Table(Name = \"Group\")]\n public partial struct Group\n {\n [SpacetimeDB.PrimaryKey]\n public int GroupId;\n public string Title;\n }\n\n [SpacetimeDB.Table(Name = \"Membership\")]\n [SpacetimeDB.Index.BTree(Name = \"by_user\", Columns = new[] { \"UserId\" })]\n [SpacetimeDB.Index.BTree(Name = \"by_group\", Columns = new[] { \"GroupId\" })]\n public partial struct Membership\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public int UserId;\n public int GroupId;\n }\n\n [SpacetimeDB.Reducer]\n public static void Seed(ReducerContext ctx)\n {\n ctx.Db.User.Insert(new User { UserId = 1, Name = \"Alice\" });\n ctx.Db.User.Insert(new User { UserId = 2, Name = \"Bob\" });\n\n ctx.Db.Group.Insert(new Group { GroupId = 10, Title = \"Admin\" });\n ctx.Db.Group.Insert(new Group { GroupId = 20, Title = \"Dev\" });\n\n ctx.Db.Membership.Insert(new Membership { Id = 1, UserId = 1, GroupId = 10 });\n ctx.Db.Membership.Insert(new Membership { Id = 2, UserId = 1, GroupId = 20 });\n ctx.Db.Membership.Insert(new Membership { Id = 3, UserId = 2, GroupId = 20 });\n }\n}",
|
|
"category": "schema",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "schema-t-019-many-to-many-golden",
|
|
"llm_db": "schema-t-019-many-to-many-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/schema/t_019_many_to_many/csharp/server/golden",
|
|
"work_dir_llm": "target/llm-runs/schema/t_019_many_to_many/csharp/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"m2m_has_1_20": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `memberships`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:35677/v1/database/c2008ea9cb58625a6494cb7b2f3998b558db44fc3308f07f5e48fe0a03dee66e/sql)\n",
|
|
"phase": "sql"
|
|
}
|
|
},
|
|
"m2m_has_2_20": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `memberships`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:35677/v1/database/c2008ea9cb58625a6494cb7b2f3998b558db44fc3308f07f5e48fe0a03dee66e/sql)\n",
|
|
"phase": "sql"
|
|
}
|
|
},
|
|
"memberships_three_rows": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `memberships`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:35677/v1/database/c2008ea9cb58625a6494cb7b2f3998b558db44fc3308f07f5e48fe0a03dee66e/sql)\n",
|
|
"phase": "sql"
|
|
}
|
|
},
|
|
"m2m_has_1_10": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `memberships`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:35677/v1/database/c2008ea9cb58625a6494cb7b2f3998b558db44fc3308f07f5e48fe0a03dee66e/sql)\n",
|
|
"phase": "sql"
|
|
}
|
|
},
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "schema-t-019-many-to-many-golden",
|
|
"llm_db": "schema-t-019-many-to-many-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:35677",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:36:42.262573385Z",
|
|
"finished_at": "2026-01-17T02:37:43.946992007Z"
|
|
},
|
|
"t_020_ecs": {
|
|
"hash": "7bd1056c239ec41df56d3be0edd5b7aac1c433acc3efbac0fe6f3b2a79ca2f1f",
|
|
"task": "t_020_ecs",
|
|
"lang": "csharp",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 5,
|
|
"passed_tests": 1,
|
|
"llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table(Name = \"Entity\")]\n public partial struct Entity\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n }\n\n [SpacetimeDB.Table(Name = \"Position\")]\n public partial struct Position\n {\n [SpacetimeDB.PrimaryKey]\n public int EntityId;\n public int X;\n public int Y;\n }\n\n [SpacetimeDB.Table(Name = \"Velocity\")]\n public partial struct Velocity\n {\n [SpacetimeDB.PrimaryKey]\n public int EntityId;\n public int VX;\n public int VY;\n }\n\n [SpacetimeDB.Table(Name = \"NextPosition\")]\n public partial struct NextPosition\n {\n [SpacetimeDB.PrimaryKey]\n public int EntityId;\n public int X;\n public int Y;\n }\n\n [SpacetimeDB.Reducer]\n public static void Seed(ReducerContext ctx)\n {\n // Entity 1\n ctx.Db.Entity.Insert(new Entity { Id = 1 });\n ctx.Db.Position.Insert(new Position { EntityId = 1, X = 0, Y = 0 });\n ctx.Db.Velocity.Insert(new Velocity { EntityId = 1, VX = 1, VY = 0 });\n\n // Entity 2\n ctx.Db.Entity.Insert(new Entity { Id = 2 });\n ctx.Db.Position.Insert(new Position { EntityId = 2, X = 10, Y = 0 });\n ctx.Db.Velocity.Insert(new Velocity { EntityId = 2, VX = -2, VY = 3 });\n }\n\n [SpacetimeDB.Reducer]\n public static void Step(ReducerContext ctx)\n {\n foreach (var pos in ctx.Db.Position.Iter())\n {\n var vel = ctx.Db.Velocity.EntityId.Find(pos.EntityId);\n if (vel == null)\n {\n continue;\n }\n\n var nx = pos.X + vel.Value.VX;\n var ny = pos.Y + vel.Value.VY;\n\n var existing = ctx.Db.NextPosition.EntityId.Find(pos.EntityId);\n if (existing != null)\n {\n var row = existing.Value;\n row.X = nx;\n row.Y = ny;\n ctx.Db.NextPosition.EntityId.Update(row);\n }\n else\n {\n ctx.Db.NextPosition.Insert(new NextPosition\n {\n EntityId = pos.EntityId,\n X = nx,\n Y = ny\n });\n }\n }\n }\n}",
|
|
"category": "schema",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "schema-t-020-ecs-golden",
|
|
"llm_db": "schema-t-020-ecs-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/schema/t_020_ecs/csharp/server/golden",
|
|
"work_dir_llm": "target/llm-runs/schema/t_020_ecs/csharp/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"ecs_step_next_positions_count": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `next_positions`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:35677/v1/database/c20091a11c03f51be06cd18ee4b36dc6b1e87d93f9897c479cb76452564e3605/sql)\n",
|
|
"phase": "sql"
|
|
}
|
|
},
|
|
"ecs_seed_positions_count": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `positions`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:35677/v1/database/c20091a11c03f51be06cd18ee4b36dc6b1e87d93f9897c479cb76452564e3605/sql)\n",
|
|
"phase": "sql"
|
|
}
|
|
},
|
|
"ecs_next_pos_entity2": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `next_positions`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:35677/v1/database/c20091a11c03f51be06cd18ee4b36dc6b1e87d93f9897c479cb76452564e3605/sql)\n",
|
|
"phase": "sql"
|
|
}
|
|
},
|
|
"ecs_next_pos_entity1": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `next_positions`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:35677/v1/database/c20091a11c03f51be06cd18ee4b36dc6b1e87d93f9897c479cb76452564e3605/sql)\n",
|
|
"phase": "sql"
|
|
}
|
|
},
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "schema-t-020-ecs-golden",
|
|
"llm_db": "schema-t-020-ecs-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:35677",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:36:42.266606487Z",
|
|
"finished_at": "2026-01-17T02:38:01.497277347Z"
|
|
},
|
|
"t_021_multi_column_index": {
|
|
"hash": "7bd1056c239ec41df56d3be0edd5b7aac1c433acc3efbac0fe6f3b2a79ca2f1f",
|
|
"task": "t_021_multi_column_index",
|
|
"lang": "csharp",
|
|
"golden_published": true,
|
|
"model_name": "GPT-5",
|
|
"total_tests": 4,
|
|
"passed_tests": 1,
|
|
"llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table(Name = \"Log\", Public = true)]\n [SpacetimeDB.Index.BTree(Name = \"by_user_day\", Columns = new[] { \"UserId\", \"Day\" })]\n public partial struct Log\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public int UserId;\n public int Day;\n public string Message;\n }\n\n [SpacetimeDB.Reducer]\n public static void Seed(ReducerContext ctx)\n {\n ctx.Db.Log.Insert(new Log { Id = 1, UserId = 7, Day = 1, Message = \"a\" });\n ctx.Db.Log.Insert(new Log { Id = 2, UserId = 7, Day = 2, Message = \"b\" });\n ctx.Db.Log.Insert(new Log { Id = 3, UserId = 9, Day = 1, Message = \"c\" });\n }\n}",
|
|
"category": "schema",
|
|
"route_api_model": "gpt-5",
|
|
"golden_db": "schema-t-021-multi-column-index-golden",
|
|
"llm_db": "schema-t-021-multi-column-index-gpt-5-llm",
|
|
"work_dir_golden": "target/llm-runs/schema/t_021_multi_column_index/csharp/server/golden",
|
|
"work_dir_llm": "target/llm-runs/schema/t_021_multi_column_index/csharp/server/gpt-5/llm",
|
|
"scorer_details": {
|
|
"mcindex_lookup_u7_d1": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `logs`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:35677/v1/database/c200d69219860461311e299808a41ebae9617218c9ae2e796bc344b6340cc257/sql)\n",
|
|
"phase": "sql"
|
|
}
|
|
},
|
|
"mcindex_seed_count": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `logs`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:35677/v1/database/c200d69219860461311e299808a41ebae9617218c9ae2e796bc344b6340cc257/sql)\n",
|
|
"phase": "sql"
|
|
}
|
|
},
|
|
"schema_parity": {
|
|
"pass": true,
|
|
"partial": 1.0,
|
|
"notes": {
|
|
"golden_db": "schema-t-021-multi-column-index-golden",
|
|
"llm_db": "schema-t-021-multi-column-index-gpt-5-llm",
|
|
"reducers_diff": null,
|
|
"reducers_equal": true,
|
|
"server": "http://127.0.0.1:35677",
|
|
"tables_diff": null,
|
|
"tables_equal": true
|
|
}
|
|
},
|
|
"mcindex_lookup_u7_d2": {
|
|
"pass": false,
|
|
"partial": 0.0,
|
|
"notes": {
|
|
"error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `logs`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:35677/v1/database/c200d69219860461311e299808a41ebae9617218c9ae2e796bc344b6340cc257/sql)\n",
|
|
"phase": "sql"
|
|
}
|
|
}
|
|
},
|
|
"vendor": "openai",
|
|
"started_at": "2026-01-17T02:38:24.847804258Z",
|
|
"finished_at": "2026-01-17T02:38:56.019226354Z"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"golden_answers": {
|
|
"basics/t_000_empty_reducers": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Reducer]\n public static void EmptyReducer_NoArgs(ReducerContext ctx) { }\n\n [Reducer]\n public static void EmptyReducer_WithInt(ReducerContext ctx, int count) { }\n\n [Reducer]\n public static void EmptyReducer_WithString(ReducerContext ctx, string name) { }\n\n [Reducer]\n public static void EmptyReducer_WithTwoArgs(ReducerContext ctx, int count, string name) { }\n\n [Reducer]\n public static void EmptyReducer_WithThreeArgs(ReducerContext ctx, bool active, float ratio, string label) { }\n}",
|
|
"syntax": "csharp"
|
|
},
|
|
"basics/t_001_basic_tables": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Table(Name = \"users\")]\n public partial struct Users\n {\n [PrimaryKey] public int Id;\n public string Name;\n public int Age;\n public bool Active;\n }\n\n [Table(Name = \"products\")]\n public partial struct Products\n {\n [PrimaryKey] public int Id;\n public string Title;\n public float Price;\n public bool InStock;\n }\n\n [Table(Name = \"notes\")]\n public partial struct Notes\n {\n [PrimaryKey] public int Id;\n public string Body;\n public long Rating;\n public bool Pinned;\n }\n}\n",
|
|
"syntax": "csharp"
|
|
},
|
|
"basics/t_002_scheduled_table": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Table(Name = \"tick_timer\", Scheduled = nameof(Tick), ScheduledAt = nameof(TickTimer.ScheduledAt))]\n public partial struct TickTimer\n {\n [PrimaryKey, AutoInc] public ulong ScheduledId;\n public ScheduleAt ScheduledAt;\n }\n\n [Reducer]\n public static void Tick(ReducerContext ctx, TickTimer timer) { }\n\n [Reducer(ReducerKind.Init)]\n public static void Init(ReducerContext ctx)\n {\n var interval = new TimeDuration { Microseconds = 50_000 };\n ctx.Db.tick_timer.Insert(new TickTimer\n {\n ScheduledAt = new ScheduleAt.Interval(interval)\n });\n }\n}",
|
|
"syntax": "csharp"
|
|
},
|
|
"basics/t_003_struct_in_table": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Type]\n public partial struct Position\n {\n public int X;\n public int Y;\n }\n\n [Table(Name = \"entities\")]\n public partial struct Entity\n {\n [PrimaryKey] public int Id;\n public Position Pos;\n }\n}\n",
|
|
"syntax": "csharp"
|
|
},
|
|
"basics/t_004_insert": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Table(Name = \"users\")]\n public partial struct User\n {\n [PrimaryKey] public int Id;\n public string Name;\n public int Age;\n public bool Active;\n }\n\n [Reducer]\n public static void InsertUser(ReducerContext ctx, int id, string name, int age, bool active)\n {\n ctx.Db.users.Insert(new User { Id = id, Name = name, Age = age, Active = active });\n }\n}\n",
|
|
"syntax": "csharp"
|
|
},
|
|
"basics/t_005_update": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Table(Name = \"users\")]\n public partial struct User\n {\n [PrimaryKey] public int Id;\n public string Name;\n public int Age;\n public bool Active;\n }\n\n [Reducer]\n public static void UpdateUser(ReducerContext ctx, int id, string name, int age, bool active)\n {\n ctx.Db.users.Id.Update(new User { Id = id, Name = name, Age = age, Active = active });\n }\n}\n",
|
|
"syntax": "csharp"
|
|
},
|
|
"basics/t_006_delete": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Table(Name = \"users\")]\n public partial struct User\n {\n [PrimaryKey] public int Id;\n public string Name;\n public int Age;\n public bool Active;\n }\n\n [Reducer]\n public static void DeleteUser(ReducerContext ctx, int id)\n {\n ctx.Db.users.Id.Delete(id);\n }\n}\n",
|
|
"syntax": "csharp"
|
|
},
|
|
"basics/t_007_crud": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Table(Name = \"users\")]\n public partial struct User\n {\n [PrimaryKey] public int Id;\n public string Name;\n public int Age;\n public bool Active;\n }\n\n [Reducer]\n public static void Crud(ReducerContext ctx)\n {\n ctx.Db.users.Insert(new User { Id = 1, Name = \"Alice\", Age = 30, Active = true });\n ctx.Db.users.Insert(new User { Id = 2, Name = \"Bob\", Age = 22, Active = false });\n ctx.Db.users.Id.Update(new User { Id = 1, Name = \"Alice2\", Age = 31, Active = false });\n ctx.Db.users.Id.Delete(2);\n }\n}\n",
|
|
"syntax": "csharp"
|
|
},
|
|
"basics/t_008_index_lookup": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Table(Name = \"users\")]\n public partial struct User\n {\n [PrimaryKey] public int Id;\n public string Name;\n public int Age;\n public bool Active;\n }\n\n [Table(Name = \"results\")]\n public partial struct Result\n {\n [PrimaryKey] public int Id;\n public string Name;\n }\n\n [Reducer]\n public static void LookupUserName(ReducerContext ctx, int id)\n {\n var u = ctx.Db.users.Id.Find(id);\n if (u.HasValue)\n {\n var row = u.Value;\n ctx.Db.results.Insert(new Result { Id = row.Id, Name = row.Name });\n }\n }\n}\n",
|
|
"syntax": "csharp"
|
|
},
|
|
"basics/t_009_init": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Table(Name = \"users\")]\n public partial struct User\n {\n [PrimaryKey] public int Id;\n public string Name;\n public int Age;\n public bool Active;\n }\n\n [Reducer(ReducerKind.Init)]\n public static void Init(ReducerContext ctx)\n {\n ctx.Db.users.Insert(new User { Id = 1, Name = \"Alice\", Age = 30, Active = true });\n ctx.Db.users.Insert(new User { Id = 2, Name = \"Bob\", Age = 22, Active = false });\n }\n}\n",
|
|
"syntax": "csharp"
|
|
},
|
|
"basics/t_010_connect": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Table(Name = \"events\")]\n public partial struct Event\n {\n [PrimaryKey, AutoInc] public int Id;\n public string Kind;\n }\n\n [Reducer(ReducerKind.ClientConnected)]\n public static void ClientConnected(ReducerContext ctx)\n {\n ctx.Db.events.Insert(new Event { Kind = \"connected\" });\n }\n\n [Reducer(ReducerKind.ClientDisconnected)]\n public static void ClientDisconnected(ReducerContext ctx)\n {\n ctx.Db.events.Insert(new Event { Kind = \"disconnected\" });\n }\n}\n",
|
|
"syntax": "csharp"
|
|
},
|
|
"basics/t_011_helper_function": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Table(Name = \"results\")]\n public partial struct Result\n {\n [PrimaryKey] public int Id;\n public int Sum;\n }\n\n static int Add(int a, int b) => a + b;\n\n [Reducer]\n public static void ComputeSum(ReducerContext ctx, int id, int a, int b)\n {\n ctx.Db.results.Insert(new Result { Id = id, Sum = Add(a, b) });\n }\n}\n",
|
|
"syntax": "csharp"
|
|
},
|
|
"schema/t_012_spacetime_product_type": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Type]\n public partial struct Score\n {\n public int Left;\n public int Right;\n }\n\n [Table(Name = \"results\")]\n public partial struct Result\n {\n [PrimaryKey] public int Id;\n public Score Value;\n }\n\n [Reducer]\n public static void SetScore(ReducerContext ctx, int id, int left, int right)\n {\n ctx.Db.results.Insert(new Result { Id = id, Value = new Score { Left = left, Right = right } });\n }\n}\n",
|
|
"syntax": "csharp"
|
|
},
|
|
"schema/t_013_spacetime_sum_type": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Type]\n public partial struct Circle { public int Radius; }\n\n [Type]\n public partial struct Rectangle { public int Width; public int Height; }\n\n [Type]\n public partial record Shape : TaggedEnum<(Circle Circle, Rectangle Rectangle)> {}\n\n [Table(Name = \"results\")]\n public partial struct Result\n {\n [PrimaryKey] public int Id;\n public Shape Value;\n }\n\n [Reducer]\n public static void SetCircle(ReducerContext ctx, int id, int radius)\n {\n ctx.Db.results.Insert(new Result { Id = id, Value = new Shape.Circle(new Circle { Radius = radius }) });\n }\n}\n",
|
|
"syntax": "csharp"
|
|
},
|
|
"schema/t_014_elementary_columns": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Table(Name = \"primitives\")]\n public partial struct Primitive\n {\n [PrimaryKey] public int Id;\n public int Count;\n public long Total;\n public float Price;\n public double Ratio;\n public bool Active;\n public string Name;\n }\n\n [Reducer]\n public static void Seed(ReducerContext ctx)\n {\n ctx.Db.primitives.Insert(new Primitive {\n Id = 1,\n Count = 2,\n Total = 3000000000,\n Price = 1.5f,\n Ratio = 2.25,\n Active = true,\n Name = \"Alice\"\n });\n }\n}\n",
|
|
"syntax": "csharp"
|
|
},
|
|
"schema/t_015_product_type_columns": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Type]\n public partial struct Address\n {\n public string Street;\n public int Zip;\n }\n\n [Type]\n public partial struct Position\n {\n public int X;\n public int Y;\n }\n\n [Table(Name = \"profiles\")]\n public partial struct Profile\n {\n [PrimaryKey] public int Id;\n public Address Home;\n public Address Work;\n public Position Pos;\n }\n\n [Reducer]\n public static void Seed(ReducerContext ctx)\n {\n ctx.Db.profiles.Insert(new Profile {\n Id = 1,\n Home = new Address { Street = \"1 Main\", Zip = 11111 },\n Work = new Address { Street = \"2 Broad\", Zip = 22222 },\n Pos = new Position { X = 7, Y = 9 }\n });\n }\n}\n",
|
|
"syntax": "csharp"
|
|
},
|
|
"schema/t_016_sum_type_columns": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Type]\n public partial struct Circle { public int Radius; }\n\n [Type]\n public partial struct Rectangle { public int Width; public int Height; }\n\n [Type]\n public partial record Shape : TaggedEnum<(Circle Circle, Rectangle Rectangle)> {}\n\n [Table(Name = \"drawings\")]\n public partial struct Drawing\n {\n [PrimaryKey] public int Id;\n public Shape A;\n public Shape B;\n }\n\n [Reducer]\n public static void Seed(ReducerContext ctx)\n {\n ctx.Db.drawings.Insert(new Drawing {\n Id = 1,\n A = new Shape.Circle(new Circle { Radius = 10 }),\n B = new Shape.Rectangle(new Rectangle { Width = 4, Height = 6 })\n });\n }\n}\n",
|
|
"syntax": "csharp"
|
|
},
|
|
"schema/t_017_scheduled_columns": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Table(Name = \"tick_timer\", Scheduled = nameof(Tick), ScheduledAt = nameof(ScheduledAt))]\n public partial struct TickTimer\n {\n [PrimaryKey, AutoInc] public ulong ScheduledId;\n public ScheduleAt ScheduledAt;\n }\n\n [Reducer]\n public static void Tick(ReducerContext ctx, TickTimer schedule) { }\n\n [Reducer(ReducerKind.Init)]\n public static void Init(ReducerContext ctx)\n {\n var interval = new TimeDuration { Microseconds = 50_000 };\n ctx.Db.tick_timer.Insert(new TickTimer\n {\n ScheduledId = 0,\n ScheduledAt = new ScheduleAt.Interval(interval)\n });\n }\n}\n",
|
|
"syntax": "csharp"
|
|
},
|
|
"schema/t_018_constraints": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table(Name = \"accounts\", Public = true)]\n [SpacetimeDB.Index.BTree(Name = \"by_name\", Columns = [nameof(Name)])]\n public partial struct Account\n {\n [SpacetimeDB.PrimaryKey] public int Id;\n [SpacetimeDB.Unique] public string Email;\n public string Name;\n }\n\n [SpacetimeDB.Reducer]\n public static void Seed(ReducerContext ctx)\n {\n ctx.Db.accounts.Insert(new Account { Id = 1, Email = \"a@example.com\", Name = \"Alice\" });\n ctx.Db.accounts.Insert(new Account { Id = 2, Email = \"b@example.com\", Name = \"Bob\" });\n }\n}",
|
|
"syntax": "csharp"
|
|
},
|
|
"schema/t_019_many_to_many": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Table(Name = \"users\")]\n public partial struct User\n {\n [PrimaryKey] public int UserId;\n public string Name;\n }\n\n [Table(Name = \"groups\")]\n public partial struct Group\n {\n [PrimaryKey] public int GroupId;\n public string Title;\n }\n\n [Table(Name = \"memberships\")]\n [SpacetimeDB.Index.BTree(Name = \"by_user\", Columns = new[] { nameof(UserId) })]\n [SpacetimeDB.Index.BTree(Name = \"by_group\", Columns = new[] { nameof(GroupId) })]\n public partial struct Membership\n {\n [PrimaryKey] public int Id;\n public int UserId;\n public int GroupId;\n }\n\n [Reducer]\n public static void Seed(ReducerContext ctx)\n {\n ctx.Db.users.Insert(new User { UserId = 1, Name = \"Alice\" });\n ctx.Db.users.Insert(new User { UserId = 2, Name = \"Bob\" });\n\n ctx.Db.groups.Insert(new Group { GroupId = 10, Title = \"Admin\" });\n ctx.Db.groups.Insert(new Group { GroupId = 20, Title = \"Dev\" });\n\n ctx.Db.memberships.Insert(new Membership { Id = 1, UserId = 1, GroupId = 10 });\n ctx.Db.memberships.Insert(new Membership { Id = 2, UserId = 1, GroupId = 20 });\n ctx.Db.memberships.Insert(new Membership { Id = 3, UserId = 2, GroupId = 20 });\n }\n}\n",
|
|
"syntax": "csharp"
|
|
},
|
|
"schema/t_020_ecs": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Table(Name = \"entities\")]\n public partial struct Entity { [PrimaryKey] public int Id; }\n\n [Table(Name = \"positions\")]\n public partial struct Position\n {\n [PrimaryKey] public int EntityId;\n public int X;\n public int Y;\n }\n\n [Table(Name = \"velocities\")]\n public partial struct Velocity\n {\n [PrimaryKey] public int EntityId;\n public int VX;\n public int VY;\n }\n\n [Table(Name = \"next_positions\")]\n public partial struct NextPosition\n {\n [PrimaryKey] public int EntityId;\n public int X;\n public int Y;\n }\n\n [Reducer]\n public static void Seed(ReducerContext ctx)\n {\n ctx.Db.entities.Insert(new Entity { Id = 1 });\n ctx.Db.entities.Insert(new Entity { Id = 2 });\n\n ctx.Db.positions.Insert(new Position { EntityId = 1, X = 0, Y = 0 });\n ctx.Db.positions.Insert(new Position { EntityId = 2, X = 10, Y = 0 });\n\n ctx.Db.velocities.Insert(new Velocity { EntityId = 1, VX = 1, VY = 0 });\n ctx.Db.velocities.Insert(new Velocity { EntityId = 2, VX = -2, VY = 3 });\n }\n\n [Reducer]\n public static void Step(ReducerContext ctx)\n {\n foreach (var p in ctx.Db.positions.Iter())\n {\n var velOpt = ctx.Db.velocities.EntityId.Find(p.EntityId);\n if (!velOpt.HasValue) continue;\n\n var np = new NextPosition {\n EntityId = p.EntityId,\n X = p.X + velOpt.Value.VX,\n Y = p.Y + velOpt.Value.VY\n };\n\n if (ctx.Db.next_positions.EntityId.Find(p.EntityId).HasValue)\n ctx.Db.next_positions.EntityId.Update(np);\n else\n ctx.Db.next_positions.Insert(np);\n }\n }\n}\n",
|
|
"syntax": "csharp"
|
|
},
|
|
"schema/t_021_multi_column_index": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Table(Name = \"logs\")]\n [SpacetimeDB.Index.BTree(Name = \"by_user_day\", Columns = new[] { nameof(UserId), nameof(Day) })]\n public partial struct Log\n {\n [PrimaryKey] public int Id;\n public int UserId;\n public int Day;\n public string Message;\n }\n\n [Reducer]\n public static void Seed(ReducerContext ctx)\n {\n ctx.Db.logs.Insert(new Log { Id = 1, UserId = 7, Day = 1, Message = \"a\" });\n ctx.Db.logs.Insert(new Log { Id = 2, UserId = 7, Day = 2, Message = \"b\" });\n ctx.Db.logs.Insert(new Log { Id = 3, UserId = 9, Day = 1, Message = \"c\" });\n }\n}\n",
|
|
"syntax": "csharp"
|
|
},
|
|
"t_000_empty_reducers": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Reducer]\n public static void EmptyReducer_NoArgs(ReducerContext ctx) { }\n\n [Reducer]\n public static void EmptyReducer_WithInt(ReducerContext ctx, int count) { }\n\n [Reducer]\n public static void EmptyReducer_WithString(ReducerContext ctx, string name) { }\n\n [Reducer]\n public static void EmptyReducer_WithTwoArgs(ReducerContext ctx, int count, string name) { }\n\n [Reducer]\n public static void EmptyReducer_WithThreeArgs(ReducerContext ctx, bool active, float ratio, string label) { }\n}",
|
|
"syntax": "csharp"
|
|
},
|
|
"t_001_basic_tables": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Table(Name = \"User\")]\n public partial struct User\n {\n [PrimaryKey] public int Id;\n public string Name;\n public int Age;\n public bool Active;\n }\n\n [Table(Name = \"Product\")]\n public partial struct Product\n {\n [PrimaryKey] public int Id;\n public string Title;\n public float Price;\n public bool InStock;\n }\n\n [Table(Name = \"Note\")]\n public partial struct Note\n {\n [PrimaryKey] public int Id;\n public string Body;\n public long Rating;\n public bool Pinned;\n }\n}\n",
|
|
"syntax": "csharp"
|
|
},
|
|
"t_002_scheduled_table": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Table(Name = \"TickTimer\", Scheduled = nameof(Tick), ScheduledAt = nameof(TickTimer.ScheduledAt))]\n public partial struct TickTimer\n {\n [PrimaryKey, AutoInc] public ulong ScheduledId;\n public ScheduleAt ScheduledAt;\n }\n\n [Reducer]\n public static void Tick(ReducerContext ctx, TickTimer timer) { }\n\n [Reducer(ReducerKind.Init)]\n public static void Init(ReducerContext ctx)\n {\n var interval = new TimeDuration { Microseconds = 50_000 };\n ctx.Db.TickTimer.Insert(new TickTimer\n {\n ScheduledAt = new ScheduleAt.Interval(interval)\n });\n }\n}\n",
|
|
"syntax": "csharp"
|
|
},
|
|
"t_003_struct_in_table": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Type]\n public partial struct Position\n {\n public int X;\n public int Y;\n }\n\n [Table(Name = \"Entity\")]\n public partial struct Entity\n {\n [PrimaryKey] public int Id;\n public Position Pos;\n }\n}\n",
|
|
"syntax": "csharp"
|
|
},
|
|
"t_004_insert": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Table(Name = \"User\")]\n public partial struct User\n {\n [PrimaryKey] public int Id;\n public string Name;\n public int Age;\n public bool Active;\n }\n\n [Reducer]\n public static void InsertUser(ReducerContext ctx, int id, string name, int age, bool active)\n {\n ctx.Db.User.Insert(new User { Id = id, Name = name, Age = age, Active = active });\n }\n}\n",
|
|
"syntax": "csharp"
|
|
},
|
|
"t_005_update": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Table(Name = \"User\")]\n public partial struct User\n {\n [PrimaryKey] public int Id;\n public string Name;\n public int Age;\n public bool Active;\n }\n\n [Reducer]\n public static void UpdateUser(ReducerContext ctx, int id, string name, int age, bool active)\n {\n ctx.Db.User.Id.Update(new User { Id = id, Name = name, Age = age, Active = active });\n }\n}\n",
|
|
"syntax": "csharp"
|
|
},
|
|
"t_006_delete": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Table(Name = \"User\")]\n public partial struct User\n {\n [PrimaryKey] public int Id;\n public string Name;\n public int Age;\n public bool Active;\n }\n\n [Reducer]\n public static void DeleteUser(ReducerContext ctx, int id)\n {\n ctx.Db.User.Id.Delete(id);\n }\n}\n",
|
|
"syntax": "csharp"
|
|
},
|
|
"t_007_crud": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Table(Name = \"User\")]\n public partial struct User\n {\n [PrimaryKey] public int Id;\n public string Name;\n public int Age;\n public bool Active;\n }\n\n [Reducer]\n public static void Crud(ReducerContext ctx)\n {\n ctx.Db.User.Insert(new User { Id = 1, Name = \"Alice\", Age = 30, Active = true });\n ctx.Db.User.Insert(new User { Id = 2, Name = \"Bob\", Age = 22, Active = false });\n ctx.Db.User.Id.Update(new User { Id = 1, Name = \"Alice2\", Age = 31, Active = false });\n ctx.Db.User.Id.Delete(2);\n }\n}\n",
|
|
"syntax": "csharp"
|
|
},
|
|
"t_008_index_lookup": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Table(Name = \"User\")]\n public partial struct User\n {\n [PrimaryKey] public int Id;\n public string Name;\n public int Age;\n public bool Active;\n }\n\n [Table(Name = \"Result\")]\n public partial struct Result\n {\n [PrimaryKey] public int Id;\n public string Name;\n }\n\n [Reducer]\n public static void LookupUserName(ReducerContext ctx, int id)\n {\n var u = ctx.Db.User.Id.Find(id);\n if (u.HasValue)\n {\n var row = u.Value;\n ctx.Db.Result.Insert(new Result { Id = row.Id, Name = row.Name });\n }\n }\n}\n",
|
|
"syntax": "csharp"
|
|
},
|
|
"t_009_init": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Table(Name = \"User\")]\n public partial struct User\n {\n [PrimaryKey] public int Id;\n public string Name;\n public int Age;\n public bool Active;\n }\n\n [Reducer(ReducerKind.Init)]\n public static void Init(ReducerContext ctx)\n {\n ctx.Db.User.Insert(new User { Id = 1, Name = \"Alice\", Age = 30, Active = true });\n ctx.Db.User.Insert(new User { Id = 2, Name = \"Bob\", Age = 22, Active = false });\n }\n}\n",
|
|
"syntax": "csharp"
|
|
},
|
|
"t_010_connect": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Table(Name = \"Event\")]\n public partial struct Event\n {\n [PrimaryKey, AutoInc] public int Id;\n public string Kind;\n }\n\n [Reducer(ReducerKind.ClientConnected)]\n public static void ClientConnected(ReducerContext ctx)\n {\n ctx.Db.Event.Insert(new Event { Kind = \"connected\" });\n }\n\n [Reducer(ReducerKind.ClientDisconnected)]\n public static void ClientDisconnected(ReducerContext ctx)\n {\n ctx.Db.Event.Insert(new Event { Kind = \"disconnected\" });\n }\n}\n",
|
|
"syntax": "csharp"
|
|
},
|
|
"t_011_helper_function": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Table(Name = \"Result\")]\n public partial struct Result\n {\n [PrimaryKey] public int Id;\n public int Sum;\n }\n\n static int Add(int a, int b) => a + b;\n\n [Reducer]\n public static void ComputeSum(ReducerContext ctx, int id, int a, int b)\n {\n ctx.Db.Result.Insert(new Result { Id = id, Sum = Add(a, b) });\n }\n}\n",
|
|
"syntax": "csharp"
|
|
},
|
|
"t_012_spacetime_product_type": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Type]\n public partial struct Score\n {\n public int Left;\n public int Right;\n }\n\n [Table(Name = \"Result\")]\n public partial struct Result\n {\n [PrimaryKey] public int Id;\n public Score Value;\n }\n\n [Reducer]\n public static void SetScore(ReducerContext ctx, int id, int left, int right)\n {\n ctx.Db.Result.Insert(new Result { Id = id, Value = new Score { Left = left, Right = right } });\n }\n}\n",
|
|
"syntax": "csharp"
|
|
},
|
|
"t_013_spacetime_sum_type": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Type]\n public partial struct Circle { public int Radius; }\n\n [Type]\n public partial struct Rectangle { public int Width; public int Height; }\n\n [Type]\n public partial record Shape : TaggedEnum<(Circle Circle, Rectangle Rectangle)> {}\n\n [Table(Name = \"Result\")]\n public partial struct Result\n {\n [PrimaryKey] public int Id;\n public Shape Value;\n }\n\n [Reducer]\n public static void SetCircle(ReducerContext ctx, int id, int radius)\n {\n ctx.Db.Result.Insert(new Result { Id = id, Value = new Shape.Circle(new Circle { Radius = radius }) });\n }\n}\n",
|
|
"syntax": "csharp"
|
|
},
|
|
"t_014_elementary_columns": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Table(Name = \"Primitive\")]\n public partial struct Primitive\n {\n [PrimaryKey] public int Id;\n public int Count;\n public long Total;\n public float Price;\n public double Ratio;\n public bool Active;\n public string Name;\n }\n\n [Reducer]\n public static void Seed(ReducerContext ctx)\n {\n ctx.Db.Primitive.Insert(new Primitive {\n Id = 1,\n Count = 2,\n Total = 3000000000,\n Price = 1.5f,\n Ratio = 2.25,\n Active = true,\n Name = \"Alice\"\n });\n }\n}\n",
|
|
"syntax": "csharp"
|
|
},
|
|
"t_015_product_type_columns": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Type]\n public partial struct Address\n {\n public string Street;\n public int Zip;\n }\n\n [Type]\n public partial struct Position\n {\n public int X;\n public int Y;\n }\n\n [Table(Name = \"Profile\")]\n public partial struct Profile\n {\n [PrimaryKey] public int Id;\n public Address Home;\n public Address Work;\n public Position Pos;\n }\n\n [Reducer]\n public static void Seed(ReducerContext ctx)\n {\n ctx.Db.Profile.Insert(new Profile {\n Id = 1,\n Home = new Address { Street = \"1 Main\", Zip = 11111 },\n Work = new Address { Street = \"2 Broad\", Zip = 22222 },\n Pos = new Position { X = 7, Y = 9 }\n });\n }\n}\n",
|
|
"syntax": "csharp"
|
|
},
|
|
"t_016_sum_type_columns": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Type]\n public partial struct Circle { public int Radius; }\n\n [Type]\n public partial struct Rectangle { public int Width; public int Height; }\n\n [Type]\n public partial record Shape : TaggedEnum<(Circle Circle, Rectangle Rectangle)> {}\n\n [Table(Name = \"Drawing\")]\n public partial struct Drawing\n {\n [PrimaryKey] public int Id;\n public Shape A;\n public Shape B;\n }\n\n [Reducer]\n public static void Seed(ReducerContext ctx)\n {\n ctx.Db.Drawing.Insert(new Drawing {\n Id = 1,\n A = new Shape.Circle(new Circle { Radius = 10 }),\n B = new Shape.Rectangle(new Rectangle { Width = 4, Height = 6 })\n });\n }\n}\n",
|
|
"syntax": "csharp"
|
|
},
|
|
"t_017_scheduled_columns": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Table(Name = \"TickTimer\", Scheduled = nameof(Tick), ScheduledAt = nameof(ScheduledAt))]\n public partial struct TickTimer\n {\n [PrimaryKey, AutoInc] public ulong ScheduledId;\n public ScheduleAt ScheduledAt;\n }\n\n [Reducer]\n public static void Tick(ReducerContext ctx, TickTimer schedule) { }\n\n [Reducer(ReducerKind.Init)]\n public static void Init(ReducerContext ctx)\n {\n var interval = new TimeDuration { Microseconds = 50_000 };\n ctx.Db.TickTimer.Insert(new TickTimer\n {\n ScheduledId = 0,\n ScheduledAt = new ScheduleAt.Interval(interval)\n });\n }\n}\n",
|
|
"syntax": "csharp"
|
|
},
|
|
"t_018_constraints": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table(Name = \"Account\", Public = true)]\n [SpacetimeDB.Index.BTree(Name = \"by_name\", Columns = [nameof(Name)])]\n public partial struct Account\n {\n [SpacetimeDB.PrimaryKey] public int Id;\n [SpacetimeDB.Unique] public string Email;\n public string Name;\n }\n\n [SpacetimeDB.Reducer]\n public static void Seed(ReducerContext ctx)\n {\n ctx.Db.Account.Insert(new Account { Id = 1, Email = \"a@example.com\", Name = \"Alice\" });\n ctx.Db.Account.Insert(new Account { Id = 2, Email = \"b@example.com\", Name = \"Bob\" });\n }\n}\n",
|
|
"syntax": "csharp"
|
|
},
|
|
"t_019_many_to_many": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Table(Name = \"User\")]\n public partial struct User\n {\n [PrimaryKey] public int UserId;\n public string Name;\n }\n\n [Table(Name = \"Group\")]\n public partial struct Group\n {\n [PrimaryKey] public int GroupId;\n public string Title;\n }\n\n [Table(Name = \"Membership\")]\n [SpacetimeDB.Index.BTree(Name = \"by_user\", Columns = new[] { nameof(UserId) })]\n [SpacetimeDB.Index.BTree(Name = \"by_group\", Columns = new[] { nameof(GroupId) })]\n public partial struct Membership\n {\n [PrimaryKey] public int Id;\n public int UserId;\n public int GroupId;\n }\n\n [Reducer]\n public static void Seed(ReducerContext ctx)\n {\n ctx.Db.User.Insert(new User { UserId = 1, Name = \"Alice\" });\n ctx.Db.User.Insert(new User { UserId = 2, Name = \"Bob\" });\n\n ctx.Db.Group.Insert(new Group { GroupId = 10, Title = \"Admin\" });\n ctx.Db.Group.Insert(new Group { GroupId = 20, Title = \"Dev\" });\n\n ctx.Db.Membership.Insert(new Membership { Id = 1, UserId = 1, GroupId = 10 });\n ctx.Db.Membership.Insert(new Membership { Id = 2, UserId = 1, GroupId = 20 });\n ctx.Db.Membership.Insert(new Membership { Id = 3, UserId = 2, GroupId = 20 });\n }\n}\n",
|
|
"syntax": "csharp"
|
|
},
|
|
"t_020_ecs": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Table(Name = \"Entity\")]\n public partial struct Entity { [PrimaryKey] public int Id; }\n\n [Table(Name = \"Position\")]\n public partial struct Position\n {\n [PrimaryKey] public int EntityId;\n public int X;\n public int Y;\n }\n\n [Table(Name = \"Velocity\")]\n public partial struct Velocity\n {\n [PrimaryKey] public int EntityId;\n public int VX;\n public int VY;\n }\n\n [Table(Name = \"NextPosition\")]\n public partial struct NextPosition\n {\n [PrimaryKey] public int EntityId;\n public int X;\n public int Y;\n }\n\n [Reducer]\n public static void Seed(ReducerContext ctx)\n {\n ctx.Db.Entity.Insert(new Entity { Id = 1 });\n ctx.Db.Entity.Insert(new Entity { Id = 2 });\n\n ctx.Db.Position.Insert(new Position { EntityId = 1, X = 0, Y = 0 });\n ctx.Db.Position.Insert(new Position { EntityId = 2, X = 10, Y = 0 });\n\n ctx.Db.Velocity.Insert(new Velocity { EntityId = 1, VX = 1, VY = 0 });\n ctx.Db.Velocity.Insert(new Velocity { EntityId = 2, VX = -2, VY = 3 });\n }\n\n [Reducer]\n public static void Step(ReducerContext ctx)\n {\n foreach (var p in ctx.Db.Position.Iter())\n {\n var velOpt = ctx.Db.Velocity.EntityId.Find(p.EntityId);\n if (!velOpt.HasValue) continue;\n\n var np = new NextPosition {\n EntityId = p.EntityId,\n X = p.X + velOpt.Value.VX,\n Y = p.Y + velOpt.Value.VY\n };\n\n if (ctx.Db.NextPosition.EntityId.Find(p.EntityId).HasValue)\n ctx.Db.NextPosition.EntityId.Update(np);\n else\n ctx.Db.NextPosition.Insert(np);\n }\n }\n}\n",
|
|
"syntax": "csharp"
|
|
},
|
|
"t_021_multi_column_index": {
|
|
"answer": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [Table(Name = \"Log\")]\n [SpacetimeDB.Index.BTree(Name = \"by_user_day\", Columns = new[] { nameof(UserId), nameof(Day) })]\n public partial struct Log\n {\n [PrimaryKey] public int Id;\n public int UserId;\n public int Day;\n public string Message;\n }\n\n [Reducer]\n public static void Seed(ReducerContext ctx)\n {\n ctx.Db.Log.Insert(new Log { Id = 1, UserId = 7, Day = 1, Message = \"a\" });\n ctx.Db.Log.Insert(new Log { Id = 2, UserId = 7, Day = 2, Message = \"b\" });\n ctx.Db.Log.Insert(new Log { Id = 3, UserId = 9, Day = 1, Message = \"c\" });\n }\n}\n",
|
|
"syntax": "csharp"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|