Files
SpacetimeDB/docs/llms/docs-benchmark-analysis.md
Tyler Cloutier 73881e38f7 Further misc docs changes (#4029)
# 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>
2026-01-17 17:44:58 +00:00

4.0 KiB
Raw Permalink Blame History

Benchmark Failure Analysis

Generated from: C:\Users\Tyler\Developer\SpacetimeDB\tools\xtask-llm-benchmark\../../docs/llms/docs-benchmark-details.json

Summary

  • Total failures analyzed: 26

Analysis

SpacetimeDB Benchmark Test Failures Analysis

Rust Failures

1. Root Causes

  • Compile/Publish Errors (3 failures):

    • The primary issue across the failures is related to the use of ScheduleAt::every_micros versus ScheduleAt::RepeatMicros, which indicates a lack of clarity in the documentation about the correct method of using scheduled types.
    • Another issue is the incorrect implementation of pub for some fields and missing #[derive(SpacetimeType)] for structs, which has led to schema mismatches.
  • Other Failures (1 failure):

    • The test t_003_struct_in_table has a mismatch where the expected reducer setup differs from what's provided. This highlights insufficient documentation around initial setup requirements for reducers.

2. Recommendations

  • Documentation Updates:

    • Scheduled Types Documentation: Enhance the section on scheduled types in the documentation to clarify the use of ScheduleAt::every_micros and ScheduleAt::RepeatMicros. Example for addition:

      ### Scheduled Types
      - Use `ScheduleAt::every_micros(interval)` for non-repeating intervals.
      - Use `ScheduleAt::RepeatMicros(interval)` for repeating intervals. Ensure proper usage to avoid publishing errors.
      
    • Section on Structs and Reducers: Update the section dealing with struct fields to illustrate the necessity of using pub where it applies and clarifying how reducers must align:

      ### Struct Definitions
      - Struct fields must be marked as `pub` to ensure they are accessible within the SpacetimeDB context.
      - Reducers must be defined properly; ensure that each reducer matches expected configurations in your schemas.
      
  • Example Code Alignment: Revise example code throughout documentation to align with the latest syntax and ensure that all required attributes are included.

3. Priority

  • High Impact Fixes:
    1. Scheduled Types Documentation (to prevent compile errors).
    2. Structs and Reducers Section (to ensure schema and function alignment).

C# Failures

1. Root Causes

  • Table Naming Issues (19 failures):

    • The primary issue causing the failures is the inconsistency in the use of table names (e.g., entities vs. Entity). Lack of clear guidelines on naming conventions has led to widespread discrepancies.
  • Timeout Issues (3 failures):

    • Additionally, the timeout failures indicate that certain processes arent being documented well in terms of what expectations exist for execution time and potential pitfalls leading to these issues.

2. Recommendations

  • Documentation Updates:
    • Table Naming Conventions: Introduce a comprehensive section specifying the naming conventions for tables. Example for addition:

      ### Table Naming Conventions
      - Table names should be singular and PascalCase (e.g., `User` instead of `users`).
      - Ensure that when creating and querying tables, the names are consistently used to avoid schema parity issues.
      
    • Timeout Handling Guidance: Provide clearer information on how to handle potential timeout issues within operations:

      ### Handling Timeouts
      - If encountering timeout errors during transactions, consider optimizing the initial data load or query processes.
      - Implement logging to help identify which part of your transaction is leading to the timeout.
      

3. Priority

  • High Impact Fixes:
    1. Table Naming Conventions (most immediate to fix widespread errors).
    2. Timeout Handling Guidance (to improve performance and reliability in operations).

This structured approach will help improve the accessibility and clarity of the SpacetimeDB documentation, directly addressing the root causes of current benchmark test failures.