Skip to content

experiment(context): amortized/deferred mutable view over tag set filtering (#1293 cherry pick)#1295

Closed
tobz wants to merge 2 commits intomainfrom
tobz/rayz/tagfilter-implementation-tagset-mut-view
Closed

experiment(context): amortized/deferred mutable view over tag set filtering (#1293 cherry pick)#1295
tobz wants to merge 2 commits intomainfrom
tobz/rayz/tagfilter-implementation-tagset-mut-view

Conversation

@tobz
Copy link
Copy Markdown
Member

@tobz tobz commented Apr 1, 2026

Summary

Cherry-pick of #1292 on top of #1296 to test the performance improvements (or, hopefully not: regressions) of the mutable view stuff on top of the tag_filterlist transform.

Change Type

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

How did you test this PR?

References

@dd-octo-sts dd-octo-sts bot added area/core Core functionality, event model, etc. area/components Sources, transforms, and destinations. transform/host-tags Host Tags synchronous transform. labels Apr 1, 2026
@tobz tobz force-pushed the tobz/rayz/tagfilter-implementation-tagset-mut-view branch from 3c90a52 to f7bbb1a Compare April 1, 2026 18:02
@dd-octo-sts dd-octo-sts bot added area/test All things testing: unit/integration, correctness, SMP regression, etc. and removed area/components Sources, transforms, and destinations. transform/host-tags Host Tags synchronous transform. labels Apr 1, 2026
@tobz tobz changed the base branch from main to rayz/tagfilter-smp April 1, 2026 18:02
Copilot AI review requested due to automatic review settings April 1, 2026 19:35
@dd-octo-sts dd-octo-sts bot removed the area/test All things testing: unit/integration, correctness, SMP regression, etc. label Apr 1, 2026
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

This is a cherry-pick of PR #1292 that implements a lazy copy-on-write mutable view pattern for tag set filtering operations. The feature defers expensive operations like Arc clones and context key recomputation until mutations are actually recorded, potentially improving performance when filtering metrics.

Changes:

  • Add collect_removals and apply_removals methods to TagSet to support deferred mutation
  • Create TagSetMutView and TagSetMutViewState to implement lazy copy-on-write semantics
  • Refactor tag_filterlist component to use the new mutable view API and store reusable state
  • Update all tests to pass the new required parameter

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
lib/saluki-context/src/tags/tagset/owned.rs Adds two new methods for collecting and applying tag removal indices in a deferred manner
lib/saluki-context/src/lib.rs Exports new public types TagSetMutView and TagSetMutViewState
lib/saluki-context/src/context.rs Implements TagSetMutViewState for scratch space and TagSetMutView for lazy copy-on-write tag mutations
bin/agent-data-plane/src/components/tag_filterlist/mod.rs Refactors filtering logic to use the new mutable view pattern, removing the has_removable_tags function and updating all test calls

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

@tobz tobz force-pushed the tobz/rayz/tagfilter-implementation-tagset-mut-view branch from 0e89ca2 to 1bfb364 Compare April 2, 2026 13:38
@tobz tobz force-pushed the rayz/tagfilter-smp branch from b7b1fb4 to 66cf0eb Compare April 2, 2026 13:38
Copy link
Copy Markdown
Member Author

tobz commented Apr 2, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

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 3 out of 4 changed files in this pull request and generated no new comments.


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

@tobz tobz force-pushed the rayz/tagfilter-smp branch from 03c4224 to e3d1eb4 Compare April 3, 2026 14:44
@tobz tobz force-pushed the tobz/rayz/tagfilter-implementation-tagset-mut-view branch from b8b7477 to 3bd63f3 Compare April 3, 2026 14:44
@tobz tobz force-pushed the rayz/tagfilter-smp branch from 2607741 to f867a73 Compare April 6, 2026 16:29
@rayz rayz force-pushed the rayz/tagfilter-smp branch from f867a73 to b36eee1 Compare April 6, 2026 19:05
@rayz rayz force-pushed the tobz/rayz/tagfilter-implementation-tagset-mut-view branch from 3bd63f3 to 7a3fd5e Compare April 7, 2026 19:11
@dd-octo-sts dd-octo-sts bot added the area/components Sources, transforms, and destinations. label Apr 7, 2026
@dd-octo-sts dd-octo-sts bot added area/ci CI/CD, automated testing, etc. area/test All things testing: unit/integration, correctness, SMP regression, etc. labels Apr 7, 2026
@rayz rayz changed the base branch from rayz/tagfilter-smp to main April 7, 2026 19:12
@pr-commenter
Copy link
Copy Markdown

pr-commenter bot commented Apr 7, 2026

Binary Size Analysis (Agent Data Plane)

Target: 3e775e7 (baseline) vs 6866597 (comparison) diff
Analysis Type: Stripped binaries (debug symbols excluded)
Baseline Size: 26.47 MiB
Comparison Size: 26.46 MiB
Size Change: -3.74 KiB (-0.01%)
Pass/Fail Threshold: +5%
Result: PASSED ✅

Changes by Module

Module File Size Symbols
agent_data_plane::components::tag_filterlist -8.41 KiB 5
core +3.78 KiB 68
saluki_context::tags::tagset +1.36 KiB 5
[Unmapped] +1.32 KiB 1
smallvec -960 B 1
hashbrown -650 B 7
saluki_context::tags::Tag -420 B 1
saluki_context::context::TagSetMutView +311 B 1
alloc +207 B 107
[sections] -189 B 6
idna -77 B 1
axum -66 B 1
unicode_segmentation +8 B 1
ddsketch::agent::sketch +5 B 1
std -4 B 25
serde_yaml +2 B 5
protobuf -1 B 2
agent_data_plane::cli::run +1 B 1
saluki_core::data_model::event +0 B 2
hickory_proto +0 B 18

Detailed Symbol Changes

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  [NEW] +27.2Ki  [NEW] +27.0Ki    _<agent_data_plane::components::tag_filterlist::TagFilterlist as saluki_core::components::transforms::Transform>::run::_{{closure}}::h743d6c09bd780764
  [NEW] +10.6Ki  [NEW] +10.5Ki    <saluki_core::data_model::event::Event as core::clone::Clone>::clone.9926
  [NEW] +5.52Ki  [NEW] +5.38Ki    <hickory_proto::rr::record_data::RData as core::clone::Clone>::clone.8377
  [NEW] +5.13Ki  [NEW] +5.00Ki    <hickory_proto::rr::record_data::RData as core::clone::Clone>::clone.11165
  +0.3% +4.71Ki  +0.3% +3.14Ki    [469 Others]
  [NEW] +4.71Ki  [NEW] +4.59Ki    <rustls::error::Error as core::clone::Clone>::clone.9904
  [NEW] +4.71Ki  [NEW] +4.59Ki    <rustls::error::Error as core::clone::Clone>::clone.11180
  [NEW] +3.83Ki  [NEW] +3.71Ki    <webpki::error::Error as core::fmt::Debug>::fmt.11358
  [NEW] +3.66Ki  [NEW] +3.54Ki    <rustls::error::Error as core::fmt::Debug>::fmt.9533
  [NEW] +3.57Ki  [NEW] +3.45Ki    <rustls::error::Error as core::fmt::Debug>::fmt.11181
  [NEW] +2.81Ki  [NEW] +2.69Ki    <figment::error::Error as core::clone::Clone>::clone.7763
  [DEL] -2.81Ki  [DEL] -2.69Ki    <figment::error::Error as core::clone::Clone>::clone.7801
  [DEL] -3.57Ki  [DEL] -3.45Ki    <rustls::error::Error as core::fmt::Debug>::fmt.11217
  [DEL] -3.66Ki  [DEL] -3.54Ki    <rustls::error::Error as core::fmt::Debug>::fmt.9571
  [DEL] -3.83Ki  [DEL] -3.71Ki    <webpki::error::Error as core::fmt::Debug>::fmt.11394
  [DEL] -4.71Ki  [DEL] -4.59Ki    <rustls::error::Error as core::clone::Clone>::clone.11216
  [DEL] -4.71Ki  [DEL] -4.59Ki    <rustls::error::Error as core::clone::Clone>::clone.9946
  [DEL] -5.13Ki  [DEL] -5.00Ki    <hickory_proto::rr::record_data::RData as core::clone::Clone>::clone.11201
  [DEL] -5.52Ki  [DEL] -5.38Ki    <hickory_proto::rr::record_data::RData as core::clone::Clone>::clone.8415
  [DEL] -10.6Ki  [DEL] -10.5Ki    <saluki_core::data_model::event::Event as core::clone::Clone>::clone.9968
  [DEL] -35.7Ki  [DEL] -35.5Ki    _<agent_data_plane::components::tag_filterlist::TagFilterlist as saluki_core::components::transforms::Transform>::run::_{{closure}}::h468c85120b3a918a
  -0.0% -3.74Ki  -0.0% -5.32Ki    TOTAL

@pr-commenter
Copy link
Copy Markdown

pr-commenter bot commented Apr 7, 2026

Regression Detector (Agent Data Plane)

Regression Detector Results

Run ID: e251b62d-4bd3-4124-843f-fd8a0d3f7fb1

Baseline: 3e775e7
Comparison: 6866597
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 +4.03 [+3.62, +4.44] 1 (metrics) (profiles) (logs)
otlp_ingest_logs_5mb_cpu % cpu utilization +1.56 [-3.07, +6.19] 1 (metrics) (profiles) (logs)
otlp_ingest_logs_5mb_throughput ingress throughput -0.01 [-0.13, +0.11] 1 (metrics) (profiles) (logs)

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
dsd_uds_512kb_3k_contexts_cpu % cpu utilization +7.40 [-52.51, +67.31] 1 (metrics) (profiles) (logs)
otlp_ingest_logs_5mb_memory memory utilization +4.03 [+3.62, +4.44] 1 (metrics) (profiles) (logs)
otlp_ingest_traces_ottl_filtering_5mb_cpu % cpu utilization +2.07 [-0.55, +4.69] 1 (metrics) (profiles) (logs)
otlp_ingest_logs_5mb_cpu % cpu utilization +1.56 [-3.07, +6.19] 1 (metrics) (profiles) (logs)
otlp_ingest_traces_ottl_transform_5mb_cpu % cpu utilization +0.48 [-1.66, +2.62] 1 (metrics) (profiles) (logs)
otlp_ingest_metrics_5mb_memory memory utilization +0.43 [+0.23, +0.64] 1 (metrics) (profiles) (logs)
otlp_ingest_traces_5mb_memory memory utilization +0.29 [+0.05, +0.54] 1 (metrics) (profiles) (logs)
dsd_uds_500mb_3k_contexts_cpu % cpu utilization +0.29 [-1.06, +1.65] 1 (metrics) (profiles) (logs)
dsd_uds_512kb_3k_contexts_memory memory utilization +0.24 [+0.07, +0.41] 1 (metrics) (profiles) (logs)
quality_gates_rss_dsd_medium memory utilization +0.23 [+0.04, +0.42] 1 (metrics) (profiles) (logs)
otlp_ingest_traces_ottl_filtering_5mb_memory memory utilization +0.19 [-0.14, +0.51] 1 (metrics) (profiles) (logs)
dsd_uds_500mb_3k_contexts_memory memory utilization +0.15 [-0.02, +0.32] 1 (metrics) (profiles) (logs)
quality_gates_rss_dsd_low memory utilization +0.11 [-0.08, +0.30] 1 (metrics) (profiles) (logs)
quality_gates_rss_dsd_ultraheavy memory utilization +0.08 [-0.05, +0.21] 1 (metrics) (profiles) (logs)
otlp_ingest_metrics_5mb_throughput ingress throughput +0.05 [-0.07, +0.18] 1 (metrics) (profiles) (logs)
dsd_uds_10mb_3k_contexts_memory memory utilization +0.03 [-0.16, +0.21] 1 (metrics) (profiles) (logs)
dsd_uds_100mb_3k_contexts_throughput ingress throughput +0.01 [-0.02, +0.04] 1 (metrics) (profiles) (logs)
dsd_uds_10mb_3k_contexts_throughput ingress throughput +0.01 [-0.13, +0.15] 1 (metrics) (profiles) (logs)
otlp_ingest_traces_ottl_transform_5mb_throughput ingress throughput +0.00 [-0.02, +0.02] 1 (metrics) (profiles) (logs)
dsd_uds_1mb_3k_contexts_throughput ingress throughput +0.00 [-0.05, +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_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.05, +0.05] 1 (metrics) (profiles) (logs)
otlp_ingest_logs_5mb_throughput ingress throughput -0.01 [-0.13, +0.11] 1 (metrics) (profiles) (logs)
quality_gates_rss_dsd_heavy memory utilization -0.05 [-0.19, +0.10] 1 (metrics) (profiles) (logs)
quality_gates_rss_idle memory utilization -0.10 [-0.13, -0.07] 1 (metrics) (profiles) (logs)
dsd_uds_1mb_3k_contexts_memory memory utilization -0.11 [-0.27, +0.06] 1 (metrics) (profiles) (logs)
dsd_uds_500mb_3k_contexts_throughput ingress throughput -0.50 [-0.63, -0.36] 1 (metrics) (profiles) (logs)
dsd_uds_100mb_3k_contexts_memory memory utilization -0.52 [-0.70, -0.35] 1 (metrics) (profiles) (logs)
otlp_ingest_metrics_5mb_cpu % cpu utilization -0.58 [-8.39, +7.23] 1 (metrics) (profiles) (logs)
otlp_ingest_traces_ottl_transform_5mb_memory memory utilization -0.68 [-0.93, -0.44] 1 (metrics) (profiles) (logs)
otlp_ingest_traces_5mb_cpu % cpu utilization -0.84 [-3.07, +1.39] 1 (metrics) (profiles) (logs)
dsd_uds_10mb_3k_contexts_cpu % cpu utilization -1.63 [-32.73, +29.47] 1 (metrics) (profiles) (logs)
dsd_uds_100mb_3k_contexts_cpu % cpu utilization -3.70 [-10.01, +2.61] 1 (metrics) (profiles) (logs)
dsd_uds_1mb_3k_contexts_cpu % cpu utilization -5.80 [-57.79, +46.19] 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 115.57MiB ≤ 140MiB (metrics) (profiles) (logs)
quality_gates_rss_dsd_low memory_usage 10/10 34.20MiB ≤ 50MiB (metrics) (profiles) (logs)
quality_gates_rss_dsd_medium memory_usage 10/10 54.15MiB ≤ 75MiB (metrics) (profiles) (logs)
quality_gates_rss_dsd_ultraheavy memory_usage 10/10 170.70MiB ≤ 200MiB (metrics) (profiles) (logs)
quality_gates_rss_idle memory_usage 10/10 21.45MiB ≤ 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".

@dd-octo-sts dd-octo-sts bot removed area/components Sources, transforms, and destinations. area/ci CI/CD, automated testing, etc. area/test All things testing: unit/integration, correctness, SMP regression, etc. labels Apr 7, 2026
@tobz tobz closed this Apr 9, 2026
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants