Skip to content

Update C++ module bindings to RawModuleDefV10#4461

Merged
clockwork-labs-bot merged 5 commits intomasterfrom
jlarabie/cpp-v10
Feb 28, 2026
Merged

Update C++ module bindings to RawModuleDefV10#4461
clockwork-labs-bot merged 5 commits intomasterfrom
jlarabie/cpp-v10

Conversation

@JasonAtClockwork
Copy link
Contributor

@JasonAtClockwork JasonAtClockwork commented Feb 25, 2026

Description of Changes

  • Migrated the C++ module-definition assembly path to V10-first internals:
    • Added v10_builder and module_type_registration systems.
    • Switched Module::describe_module to serialize RawModuleDef with V10 payload.
    • Updated macro registration pipeline to register through V10
  • Added explicit naming support across macro surface (*_NAMED variants for reducer/procedure/
    view and field/index macros).
  • Reworked multi-column index macros (FIELD_MultiColumnIndex, FIELD_MultiColumnIndex_NAMED) with
    migration alias.
  • Added SPACETIMEDB_SETTING_CASE_CONVERSION(...) to support case conversion policy
  • Error-path hardening by adding explicit constraint-registration error tracking and preinit validation
  • Codegen updates:
    • Updated C++ moduledef regen to V10 builder types.
    • Adjusted C++ codegen duplicate-variant wrapper generation to emit proper product-type
      wrappers.
  • Test/harness updates:
    • type-isolation-test runner now defaults to focused V10 regression checks; --v9 runs broader
      legacy/full suite.
    • Added focused modules for positive/negative V10 checks:
      • test_multicolumn_index_valid
      • error_multicolumn_missing_field
      • error_default_missing_field
  • Re-enabled C++ paths in sdks/rust/tests/test.rs procedure/view/test suites.

API and ABI breaking changes

  • Refactor of the underlying module definition
  • New *_NAMED variant macros for explicit canonical naming
  • FIELD_NamedMultiColumnIndex renamed to FIELD_MultiColumnIndex

Expected complexity level and risk

3 - Large set of changes moving over to V10 with underlying changes to make future updates a little easier

Testing

  • Ran the type isolation test and expanded it
  • Ran the spacetimedb-sdk test framework to confirm no more drift between C++ and other module languages
  • Ran Unreal test suite though not really applicable
  • New app creation with spacetime init --template basic-cpp
  • Ran describe module tests against Rust + C# matching with C++ on the /modules/sdk-test* modules to find any possible mis-alignment

Review

  • Another look at the new features with C++
  • Thoughts on *_NAMED macros, I couldn't come up with a better solution with C++20

@JasonAtClockwork JasonAtClockwork marked this pull request as ready for review February 26, 2026 23:52
Copy link
Contributor

@rekhoff rekhoff left a comment

Choose a reason for hiding this comment

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

This looks good overall, with a few minor items. In response to the specific Reviewer questions:

  • This looks to cover the V10 code paths and lines up with the work I had done in C#.
  • As for the *_NAMED macros, I can't think of a better solution with C++20.

Copy link
Contributor

@rekhoff rekhoff left a comment

Choose a reason for hiding this comment

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

Changes look good. All reviewer items addressed, marking my approval.

@clockwork-labs-bot clockwork-labs-bot added this pull request to the merge queue Feb 28, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 28, 2026
@clockwork-labs-bot clockwork-labs-bot added this pull request to the merge queue Feb 28, 2026
Merged via the queue into master with commit 14f7991 Feb 28, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants