Skip to content

Sparse fields as part of executeBridge api#82

Merged
aarne merged 3 commits intomainfrom
sparse_fieldsets
Mar 4, 2026
Merged

Sparse fields as part of executeBridge api#82
aarne merged 3 commits intomainfrom
sparse_fieldsets

Conversation

@aarne
Copy link
Contributor

@aarne aarne commented Mar 4, 2026

No description provided.

…on engines (#81)

* Initial plan

* feat: add requestedFields (sparse fieldsets) to both runtime and compiler engines

- Add requestedFields option to ExecuteBridgeOptions in bridge-core and bridge-compiler
- Implement matchesRequestedFields utility with dot-separated path and wildcard support
- Runtime: filter output fields in ExecutionTree.run() and resolveNestedField()
- Compiler: filter output wires and use backward reachability for dead code elimination
- Update compiler cache key to include sorted requestedFields
- Add 20 shared parity tests covering field filtering, tool skipping, A||B→C chains, wildcards

Co-authored-by: aarne <82001+aarne@users.noreply.github.com>

* docs: add sparse fieldsets documentation and changeset

Co-authored-by: aarne <82001+aarne@users.noreply.github.com>

* refactor: address code review feedback (validation, perf, docs)

Co-authored-by: aarne <82001+aarne@users.noreply.github.com>

* Lint & build

* Move graphql tests

* refactor: remove check exports script and related commands

* Reorder and update CI steps in test workflow

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: aarne <82001+aarne@users.noreply.github.com>
Co-authored-by: Aarne Laur <aarne.laur@gmail.com>
@changeset-bot
Copy link

changeset-bot bot commented Mar 4, 2026

🦋 Changeset detected

Latest commit: 0cd0017

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@stackables/bridge-core Minor
@stackables/bridge-compiler Minor
@stackables/bridge-graphql Patch
@stackables/bridge-parser Patch
@stackables/bridge Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 4, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
bridge 0cd0017 Commit Preview URL

Branch Preview URL
Mar 04 2026, 04:45 PM

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

🐰 Bencher Report

Branchsparse_fieldsets
Testbedubuntu-latest

🚨 3 Alerts

BenchmarkMeasure
Units
ViewBenchmark Result
(Result Δ%)
Upper Boundary
(Limit %)
compiled: absolute baseline (passthrough, no tools)Latency
nanoseconds (ns)
📈 plot
🚷 threshold
🚨 alert (🔔)
0.00 ns
(+2.38%)Baseline: 0.00 ns
0.00 ns
(100.43%)

compiled: nested array 5x5Latency
nanoseconds (ns)
📈 plot
🚷 threshold
🚨 alert (🔔)
0.01 ns
(+2.78%)Baseline: 0.01 ns
0.01 ns
(100.51%)

exec: short-circuit (overdefinition bypass)Latency
nanoseconds (ns)
📈 plot
🚷 threshold
🚨 alert (🔔)
0.00 ns
(+12.99%)Baseline: 0.00 ns
0.00 ns
(106.84%)

Click to view all benchmark results
BenchmarkLatencyBenchmark Result
nanoseconds (ns)
(Result Δ%)
Upper Boundary
nanoseconds (ns)
(Limit %)
compiled: absolute baseline (passthrough, no tools)📈 view plot
🚷 view threshold
🚨 view alert (🔔)
0.00 ns
(+2.38%)Baseline: 0.00 ns
0.00 ns
(100.43%)

compiled: array + tool-per-element 10📈 view plot
🚷 view threshold
0.01 ns
(+1.23%)Baseline: 0.01 ns
0.01 ns
(99.21%)
compiled: array + tool-per-element 100📈 view plot
🚷 view threshold
0.03 ns
(-0.98%)Baseline: 0.03 ns
0.04 ns
(91.02%)
compiled: chained 3-tool fan-out📈 view plot
🚷 view threshold
0.00 ns
(+1.59%)Baseline: 0.00 ns
0.00 ns
(98.91%)
compiled: flat array 10 items📈 view plot
🚷 view threshold
0.01 ns
(+2.09%)Baseline: 0.00 ns
0.01 ns
(99.88%)
compiled: flat array 100 items📈 view plot
🚷 view threshold
0.01 ns
(+1.75%)Baseline: 0.01 ns
0.01 ns
(98.79%)
compiled: flat array 1000 items📈 view plot
🚷 view threshold
0.07 ns
(+2.05%)Baseline: 0.07 ns
0.07 ns
(97.88%)
compiled: nested array 10x10📈 view plot
🚷 view threshold
0.02 ns
(+1.26%)Baseline: 0.02 ns
0.02 ns
(98.90%)
compiled: nested array 20x10📈 view plot
🚷 view threshold
0.03 ns
(+0.51%)Baseline: 0.03 ns
0.03 ns
(98.15%)
compiled: nested array 5x5📈 view plot
🚷 view threshold
🚨 view alert (🔔)
0.01 ns
(+2.78%)Baseline: 0.01 ns
0.01 ns
(100.51%)

compiled: short-circuit (overdefinition bypass)📈 view plot
🚷 view threshold
0.00 ns
(+2.17%)Baseline: 0.00 ns
0.00 ns
(99.82%)
compiled: simple chain (1 tool)📈 view plot
🚷 view threshold
0.00 ns
(+1.96%)Baseline: 0.00 ns
0.00 ns
(98.84%)
exec: absolute baseline (passthrough, no tools)📈 view plot
🚷 view threshold
0.00 ns
(+8.14%)Baseline: 0.00 ns
0.00 ns
(87.35%)
exec: array + tool-per-element 10📈 view plot
🚷 view threshold
0.08 ns
(+4.95%)Baseline: 0.07 ns
0.10 ns
(75.28%)
exec: array + tool-per-element 100📈 view plot
🚷 view threshold
0.68 ns
(+1.00%)Baseline: 0.67 ns
0.97 ns
(70.13%)
exec: chained 3-tool fan-out📈 view plot
🚷 view threshold
0.02 ns
(+21.73%)Baseline: 0.01 ns
0.02 ns
(88.10%)
exec: flat array 10 items📈 view plot
🚷 view threshold
0.01 ns
(-7.77%)Baseline: 0.02 ns
0.04 ns
(37.81%)
exec: flat array 100 items📈 view plot
🚷 view threshold
0.08 ns
(-24.48%)Baseline: 0.11 ns
0.36 ns
(22.00%)
exec: flat array 1000 items📈 view plot
🚷 view threshold
0.79 ns
(-27.94%)Baseline: 1.10 ns
4.46 ns
(17.74%)
exec: nested array 10x10📈 view plot
🚷 view threshold
0.15 ns
(-5.44%)Baseline: 0.16 ns
0.44 ns
(33.51%)
exec: nested array 20x10📈 view plot
🚷 view threshold
0.27 ns
(-11.23%)Baseline: 0.31 ns
0.90 ns
(30.39%)
exec: nested array 5x5📈 view plot
🚷 view threshold
0.06 ns
(+8.55%)Baseline: 0.05 ns
0.12 ns
(49.01%)
exec: short-circuit (overdefinition bypass)📈 view plot
🚷 view threshold
🚨 view alert (🔔)
0.00 ns
(+12.99%)Baseline: 0.00 ns
0.00 ns
(106.84%)

exec: simple chain (1 tool)📈 view plot
🚷 view threshold
0.01 ns
(+19.67%)Baseline: 0.01 ns
0.01 ns
(91.23%)
parse: large bridge (20 handles x 5 wires)📈 view plot
🚷 view threshold
1.19 ns
(+24.99%)Baseline: 0.95 ns
1.28 ns
(92.72%)
parse: simple bridge📈 view plot
🚷 view threshold
0.04 ns
(+34.38%)Baseline: 0.03 ns
0.04 ns
(96.15%)
🐰 View full continuous benchmarking report in Bencher

@aarne aarne merged commit cf5cd2e into main Mar 4, 2026
7 of 8 checks passed
@aarne aarne deleted the sparse_fieldsets branch March 4, 2026 17:03
@github-actions github-actions bot mentioned this pull request Mar 4, 2026
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.

2 participants