Skip to content

enhancement(core): add dataspaces for decoupled, cross-process state#1178

Merged
tobz merged 12 commits intomainfrom
tobz/runtime-system-state-mgmt-primitives
Apr 9, 2026
Merged

enhancement(core): add dataspaces for decoupled, cross-process state#1178
tobz merged 12 commits intomainfrom
tobz/runtime-system-state-mgmt-primitives

Conversation

@tobz
Copy link
Copy Markdown
Member

@tobz tobz commented Feb 9, 2026

Summary

This PR introduces support for dataspaces, a process-centric approach for eventually consistent sharing of data.

Preface

Dataspaces are a novel approach to communicating between processes in an actor system. While pure message passing is simple and generally straightforward to understand, it falls down in a number of areas: of note, specificity (what part of the "conversation" a process cares about), discoverability (joining the conversation as a late comer), and context (knowing what has already been said prior to joining). In the literature, dataspaces make up the foundation of what the author calls "conversational concurrency." In Saluki, we very much intend for it to provide much of the same thing: message passing without message passing.

In saluki-core, we have a burgeoning runtime system that, if you squint, looks a lot like Erlang/OTP, but importantly: we are not Erlang. Rust does not, and never will, have the requisite parts -- language and VM -- to elegantly provide an actor system, including message passing. Attempts to build actor systems in Rust generally stumble (IMO) when it comes to the message passing/coordination bit because it looks weird, and requires a lot of contortions to get around the fact that the language and runtime are just not designed for message passing actors. We still have a need for processes to coordinate with each other, though.

What are dataspaces?

Dataspaces are a way to meet our message passing-style needs in the runtime system. In simple terms, dataspaces represent a collection of tuples -- owner, identifier, data -- that are pushed into the dataspace by processes and then queried by other processes. There are a number of specific terms, features, and constraints of dataspaces that make them particularly powerful:

  • all data in the dataspace is strongly typed (multiple types are supported)
  • processes assert (add) data into the dataspace with an associated identifier (string or integer)
  • only the process that owns an assertion can retract (remove) that assertion
  • assertions can be overwritten, but again, only by the owning process
  • assertions are automatically retracted when the process dies (either gracefully or non-gracefully)
  • processes subscribe to assertions/retractions in a pub/sub-style fashion
  • subscriptions can "filter" for specific assertions by matching a single identifier, or matching identifiers in a glob-style approach ("give me assertion 1", or "give me assertions api-routes-*", etc)

A real example: dynamic API routes

This has all been a bit theoretical, so let's ground dataspaces in a concrete use case: dynamic API routes. This is actually something that upstack PRs add support for, but let's chat about it briefly here.

ADP has API endpoints which expose routes tied to various subsystems: memory bounds/allocation tracking, health status, DSD stats tracking, and more. These API routes need to be registered when we're setting up the process very early on, and have no way to be changed later on. This means we have to often expose specific bits of data from subsystems deep in the program just to be able to properly attach their API routes, leading to a more fragile design than necessary. This doesn't change even if we reverse the flow from collecting all API routes and adding them at process start to pushing the API route add logic down to all the places that care about it. Additionally, we would also need to add in all of the synchronization for handling concurrent calls to add/remove API routes, as well as consider how to handle scenarios where a component that added API routes has gone away and is no longer able to handle those API calls.

Dataspaces allow us to elegantly solve this problem:

  • we create a new shared type designed explicitly for defining dynamic API routes (this essentially becomes the API boundary)
  • subsystem processes assert/retract their API routes as they come into and go out of existence
  • API server processes subscribe to assertions/retractions of the new dynamic API route type, and update their route tables as those assertions/retractions come in

At no point do the API server processes or the subsystem processes have to know (or care) about where the other one lives, or how to get to them: they communicate through the dataspace, and all of the comings and goings are tracked there. They don't need to build their own signaling mechanisms for handling failure. Additionally, we now also get a new side benefit: if the API server processes die, and get restarted, they can subscribe and immediately get a snapshot of the current state of the world in terms of asserted API routes, and almost immediately recover.

Decoupled, eventually consistent, simple.

Change Type

  • Bug fix
  • New feature
  • Non-functional (chore, refactoring, docs)
  • Performance

How did you test this PR?

A slew of new unit tests.

References

AGTMETRICS-400

This comment was marked as outdated.

@tobz tobz force-pushed the tobz/runtime-system-state-mgmt-primitives branch from e8b5919 to 52f0a8a Compare February 11, 2026 16:24
@tobz tobz force-pushed the tobz/control-plane-tls-early-init branch from b284244 to 75a8e2c Compare February 11, 2026 16:24
@pr-commenter
Copy link
Copy Markdown

pr-commenter bot commented Feb 11, 2026

Binary Size Analysis (Agent Data Plane)

Target: ddb45ed (baseline) vs d8bbc70 (comparison) diff
Analysis Type: Stripped binaries (debug symbols excluded)
Baseline Size: 26.46 MiB
Comparison Size: 26.48 MiB
Size Change: +19.45 KiB (+0.07%)
Pass/Fail Threshold: +5%
Result: PASSED ✅

Changes by Module

Module File Size Symbols
core +8.06 KiB 107
saluki_core::runtime::state +5.71 KiB 3
saluki_core::runtime::supervisor +2.39 KiB 10
memory_accounting::allocator::AllocationGroupRegistry +2.28 KiB 1
[Unmapped] +1.93 KiB 1
saluki_core::runtime::process -1.52 KiB 9
[sections] +453 B 8
tokio +377 B 29
alloc +295 B 113
agent_data_plane::cli::run -152 B 1
saluki_core::observability::metrics -120 B 1
std -114 B 27
saluki_context::resolver::ContextResolverBuilder +95 B 1
unicode_segmentation +88 B 1
saluki_common::cache::Telemetry -80 B 1
saluki_context::resolver::Telemetry -80 B 1
saluki_core::pooling::PoolMetrics -60 B 1
saluki_core::topology::interconnect -59 B 2
stats_mutexes_node -48 B 1
url +44 B 3

Detailed Symbol Changes

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  [NEW] +10.7Ki  [NEW] +10.6Ki    std::sys::backtrace::__rust_begin_short_backtrace::h548b3772a163180a
  [NEW] +10.6Ki  [NEW] +10.5Ki    <saluki_core::data_model::event::Event as core::clone::Clone>::clone.9951
  +0.7% +10.4Ki  +0.5% +5.35Ki    [568 Others]
  [NEW] +9.28Ki  [NEW] +9.15Ki    saluki_core::runtime::supervisor::Supervisor::run_inner::_{{closure}}::hda4922d194f52fe3
  [NEW] +5.52Ki  [NEW] +5.38Ki    <hickory_proto::rr::record_data::RData as core::clone::Clone>::clone.8398
  [NEW] +5.13Ki  [NEW] +5.00Ki    <hickory_proto::rr::record_data::RData as core::clone::Clone>::clone.11202
  [NEW] +4.85Ki  [NEW] +4.72Ki    saluki_core::runtime::state::dataspace::DataspaceRegistry::retract_all_for_process::h0f5ee79d3ecb5ce2
  [NEW] +4.71Ki  [NEW] +4.59Ki    <rustls::error::Error as core::clone::Clone>::clone.9929
  [NEW] +4.71Ki  [NEW] +4.59Ki    <rustls::error::Error as core::clone::Clone>::clone.11217
  [NEW] +4.62Ki  [NEW] +4.48Ki    saluki_core::runtime::supervisor::Supervisor::run_with_process_shutdown::_{{closure}}::h35f81bdadcdc76de
  [NEW] +3.83Ki  [NEW] +3.71Ki    <webpki::error::Error as core::fmt::Debug>::fmt.11395
  [NEW] +3.66Ki  [NEW] +3.54Ki    <rustls::error::Error as core::fmt::Debug>::fmt.9554
  [DEL] -3.66Ki  [DEL] -3.54Ki    <rustls::error::Error as core::fmt::Debug>::fmt.9534
  [DEL] -3.83Ki  [DEL] -3.71Ki    <webpki::error::Error as core::fmt::Debug>::fmt.11365
  [DEL] -4.71Ki  [DEL] -4.59Ki    <rustls::error::Error as core::clone::Clone>::clone.11187
  [DEL] -4.71Ki  [DEL] -4.59Ki    <rustls::error::Error as core::clone::Clone>::clone.9909
  [DEL] -5.13Ki  [DEL] -5.00Ki    <hickory_proto::rr::record_data::RData as core::clone::Clone>::clone.11172
  [DEL] -5.52Ki  [DEL] -5.38Ki    <hickory_proto::rr::record_data::RData as core::clone::Clone>::clone.8378
  [DEL] -9.47Ki  [DEL] -9.34Ki    saluki_core::runtime::supervisor::Supervisor::run_inner::_{{closure}}::h0938ec543ef1cbd3
  [DEL] -10.6Ki  [DEL] -10.5Ki    <saluki_core::data_model::event::Event as core::clone::Clone>::clone.9931
  [DEL] -11.0Ki  [DEL] -10.9Ki    std::sys::backtrace::__rust_begin_short_backtrace::h80c871e1f134c750
  +0.1% +19.4Ki  +0.1% +14.1Ki    TOTAL

@pr-commenter
Copy link
Copy Markdown

pr-commenter bot commented Feb 11, 2026

Regression Detector (Agent Data Plane)

Regression Detector Results

Run ID: faf45b67-4ff7-4625-b4b3-ca34d3719981

Baseline: ddb45ed
Comparison: d8bbc70
Diff

Optimization Goals: ✅ No significant changes detected

Experiments ignored for regressions

Regressions in experiments with settings containing erratic: true are ignored.

perf experiment goal Δ mean % Δ mean % CI trials links
otlp_ingest_logs_5mb_memory memory utilization +3.13 [+2.91, +3.34] 1 (metrics) (profiles) (logs)
otlp_ingest_logs_5mb_cpu % cpu utilization +0.93 [-3.48, +5.35] 1 (metrics) (profiles) (logs)
otlp_ingest_logs_5mb_throughput ingress throughput -0.03 [-0.15, +0.09] 1 (metrics) (profiles) (logs)

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
dsd_uds_1mb_3k_contexts_cpu % cpu utilization +3.81 [-51.56, +59.17] 1 (metrics) (profiles) (logs)
otlp_ingest_metrics_5mb_memory memory utilization +3.16 [+2.92, +3.39] 1 (metrics) (profiles) (logs)
dsd_uds_100mb_3k_contexts_cpu % cpu utilization +3.13 [-2.97, +9.23] 1 (metrics) (profiles) (logs)
otlp_ingest_logs_5mb_memory memory utilization +3.13 [+2.91, +3.34] 1 (metrics) (profiles) (logs)
otlp_ingest_traces_ottl_transform_5mb_cpu % cpu utilization +3.03 [+0.84, +5.22] 1 (metrics) (profiles) (logs)
dsd_uds_10mb_3k_contexts_cpu % cpu utilization +2.77 [-28.29, +33.82] 1 (metrics) (profiles) (logs)
otlp_ingest_metrics_5mb_cpu % cpu utilization +1.56 [-4.98, +8.10] 1 (metrics) (profiles) (logs)
otlp_ingest_logs_5mb_cpu % cpu utilization +0.93 [-3.48, +5.35] 1 (metrics) (profiles) (logs)
quality_gates_rss_dsd_medium memory utilization +0.47 [+0.28, +0.66] 1 (metrics) (profiles) (logs)
dsd_uds_500mb_3k_contexts_throughput ingress throughput +0.41 [+0.29, +0.54] 1 (metrics) (profiles) (logs)
otlp_ingest_traces_ottl_filtering_5mb_memory memory utilization +0.24 [-0.10, +0.58] 1 (metrics) (profiles) (logs)
otlp_ingest_traces_ottl_transform_5mb_memory memory utilization +0.19 [-0.06, +0.43] 1 (metrics) (profiles) (logs)
dsd_uds_10mb_3k_contexts_memory memory utilization +0.17 [-0.01, +0.36] 1 (metrics) (profiles) (logs)
otlp_ingest_traces_5mb_memory memory utilization +0.13 [-0.12, +0.38] 1 (metrics) (profiles) (logs)
quality_gates_rss_dsd_low memory utilization +0.08 [-0.11, +0.27] 1 (metrics) (profiles) (logs)
dsd_uds_512kb_3k_contexts_memory memory utilization +0.03 [-0.14, +0.20] 1 (metrics) (profiles) (logs)
dsd_uds_10mb_3k_contexts_throughput ingress throughput +0.00 [-0.14, +0.15] 1 (metrics) (profiles) (logs)
otlp_ingest_metrics_5mb_throughput ingress throughput +0.00 [-0.13, +0.13] 1 (metrics) (profiles) (logs)
dsd_uds_1mb_3k_contexts_throughput ingress throughput +0.00 [-0.06, +0.06] 1 (metrics) (profiles) (logs)
otlp_ingest_traces_ottl_filtering_5mb_throughput ingress throughput +0.00 [-0.02, +0.02] 1 (metrics) (profiles) (logs)
otlp_ingest_traces_ottl_transform_5mb_throughput ingress throughput +0.00 [-0.02, +0.02] 1 (metrics) (profiles) (logs)
otlp_ingest_traces_5mb_throughput ingress throughput -0.00 [-0.02, +0.02] 1 (metrics) (profiles) (logs)
dsd_uds_512kb_3k_contexts_throughput ingress throughput -0.00 [-0.06, +0.05] 1 (metrics) (profiles) (logs)
dsd_uds_1mb_3k_contexts_memory memory utilization -0.01 [-0.17, +0.16] 1 (metrics) (profiles) (logs)
dsd_uds_100mb_3k_contexts_throughput ingress throughput -0.01 [-0.04, +0.02] 1 (metrics) (profiles) (logs)
quality_gates_rss_dsd_ultraheavy memory utilization -0.02 [-0.16, +0.12] 1 (metrics) (profiles) (logs)
otlp_ingest_logs_5mb_throughput ingress throughput -0.03 [-0.15, +0.09] 1 (metrics) (profiles) (logs)
dsd_uds_100mb_3k_contexts_memory memory utilization -0.06 [-0.24, +0.12] 1 (metrics) (profiles) (logs)
quality_gates_rss_idle memory utilization -0.12 [-0.16, -0.09] 1 (metrics) (profiles) (logs)
quality_gates_rss_dsd_heavy memory utilization -0.19 [-0.32, -0.06] 1 (metrics) (profiles) (logs)
dsd_uds_500mb_3k_contexts_cpu % cpu utilization -0.26 [-1.78, +1.25] 1 (metrics) (profiles) (logs)
dsd_uds_500mb_3k_contexts_memory memory utilization -0.52 [-0.69, -0.36] 1 (metrics) (profiles) (logs)
otlp_ingest_traces_5mb_cpu % cpu utilization -1.02 [-3.22, +1.17] 1 (metrics) (profiles) (logs)
otlp_ingest_traces_ottl_filtering_5mb_cpu % cpu utilization -1.15 [-3.46, +1.16] 1 (metrics) (profiles) (logs)
dsd_uds_512kb_3k_contexts_cpu % cpu utilization -3.92 [-60.06, +52.22] 1 (metrics) (profiles) (logs)

Bounds Checks: ✅ Passed

perf experiment bounds_check_name replicates_passed observed_value links
quality_gates_rss_dsd_heavy memory_usage 10/10 113.95MiB ≤ 140MiB (metrics) (profiles) (logs)
quality_gates_rss_dsd_low memory_usage 10/10 34.23MiB ≤ 50MiB (metrics) (profiles) (logs)
quality_gates_rss_dsd_medium memory_usage 10/10 55.97MiB ≤ 75MiB (metrics) (profiles) (logs)
quality_gates_rss_dsd_ultraheavy memory_usage 10/10 171.49MiB ≤ 200MiB (metrics) (profiles) (logs)
quality_gates_rss_idle memory_usage 10/10 21.28MiB ≤ 40MiB (metrics) (profiles) (logs)

Explanation

Confidence level: 90.00%
Effect size tolerance: |Δ mean %| ≥ 5.00%

Performance changes are noted in the perf column of each table:

  • ✅ = significantly better comparison variant performance
  • ❌ = significantly worse comparison variant performance
  • ➖ = no significant change in performance

A regression test is an A/B test of target performance in a repeatable rig, where "performance" is measured as "comparison variant minus baseline variant" for an optimization goal (e.g., ingress throughput). Due to intrinsic variability in measuring that goal, we can only estimate its mean value for each experiment; we report uncertainty in that value as a 90.00% confidence interval denoted "Δ mean % CI".

For each experiment, we decide whether a change in performance is a "regression" -- a change worth investigating further -- if all of the following criteria are true:

  1. Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.

  2. Its 90.00% confidence interval "Δ mean % CI" does not contain zero, indicating that if our statistical model is accurate, there is at least a 90.00% chance there is a difference in performance between baseline and comparison variants.

  3. Its configuration does not mark it "erratic".

Copilot AI review requested due to automatic review settings February 20, 2026 04:26
@tobz tobz force-pushed the tobz/control-plane-tls-early-init branch from 75a8e2c to cc926a0 Compare February 20, 2026 04:26
@tobz tobz force-pushed the tobz/runtime-system-state-mgmt-primitives branch from 52f0a8a to 97b3a4d Compare February 20, 2026 04:27

This comment was marked as outdated.

@tobz tobz force-pushed the tobz/control-plane-tls-early-init branch from cc926a0 to 2eacb9c Compare February 20, 2026 04:39
@tobz tobz force-pushed the tobz/runtime-system-state-mgmt-primitives branch from 97b3a4d to 90a9af1 Compare February 20, 2026 04:39
Copilot AI review requested due to automatic review settings February 20, 2026 05:20
@tobz tobz force-pushed the tobz/runtime-system-state-mgmt-primitives branch from 90a9af1 to 8a17cac Compare February 20, 2026 05:20
@tobz tobz force-pushed the tobz/control-plane-tls-early-init branch from 2eacb9c to 32b6e9b Compare February 20, 2026 05:20

This comment was marked as outdated.

@tobz tobz force-pushed the tobz/control-plane-tls-early-init branch from 32b6e9b to 999e501 Compare February 21, 2026 19:52
@tobz tobz force-pushed the tobz/runtime-system-state-mgmt-primitives branch from 8a17cac to 46ef9d0 Compare February 21, 2026 19:52
Copilot AI review requested due to automatic review settings February 25, 2026 03:25
@tobz tobz force-pushed the tobz/runtime-system-state-mgmt-primitives branch from 46ef9d0 to b24c86d Compare February 25, 2026 03:25
Base automatically changed from tobz/control-plane-tls-early-init to main April 6, 2026 13:50
@tobz tobz force-pushed the tobz/runtime-system-state-mgmt-primitives branch from 1aef500 to 0c296be Compare April 6, 2026 17:23
@tobz tobz requested a review from Copilot April 7, 2026 14:56
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tobz tobz changed the title enhancement(runtime): add resource/pubsub registry for generalized state management in processes enhancement(runtime): add dataspaces for decoupled, cross-process state Apr 7, 2026
@tobz tobz added the type/enhancement An enhancement in functionality or support. label Apr 7, 2026
@tobz tobz marked this pull request as ready for review April 7, 2026 16:55
@tobz tobz requested a review from a team as a code owner April 7, 2026 16:55
@tobz tobz force-pushed the tobz/runtime-system-state-mgmt-primitives branch from 7654fa2 to c6d3919 Compare April 7, 2026 17:49
Copy link
Copy Markdown
Contributor

@webern webern left a comment

Choose a reason for hiding this comment

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

Neat 😎

@tobz tobz force-pushed the tobz/runtime-system-state-mgmt-primitives branch 2 times, most recently from 7379960 to 217c8d0 Compare April 9, 2026 13:14
@tobz tobz force-pushed the tobz/runtime-system-state-mgmt-primitives branch from 217c8d0 to d8bbc70 Compare April 9, 2026 20:28
@tobz tobz changed the title enhancement(runtime): add dataspaces for decoupled, cross-process state enhancement(core): add dataspaces for decoupled, cross-process state Apr 9, 2026
@tobz tobz merged commit 40ae02c into main Apr 9, 2026
59 of 60 checks passed
@tobz tobz deleted the tobz/runtime-system-state-mgmt-primitives branch April 9, 2026 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core Core functionality, event model, etc. type/enhancement An enhancement in functionality or support.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants