Skip to content

Cleanup and stability release#125

Merged
aarne merged 8 commits intomainfrom
unify_wires
Mar 13, 2026
Merged

Cleanup and stability release#125
aarne merged 8 commits intomainfrom
unify_wires

Conversation

@aarne
Copy link
Contributor

@aarne aarne commented Mar 10, 2026

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Mar 10, 2026

🦋 Changeset detected

Latest commit: f49d30f

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-compiler Patch
@stackables/bridge-parser Patch
@stackables/bridge-core Patch
@stackables/bridge Patch
@stackables/bridge-graphql 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 10, 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 f49d30f Commit Preview URL

Branch Preview URL
Mar 13 2026, 12:33 PM

@github-actions
Copy link
Contributor

github-actions bot commented Mar 10, 2026

🐰 Bencher Report

Branchunify_wires
Testbedubuntu-latest

🚨 12 Alerts

BenchmarkMeasure
Units
ViewBenchmark Result
(Result Δ%)
Upper Boundary
(Limit %)
compiled: chained 3-tool fan-outLatency
nanoseconds (ns)
📈 plot
🚷 threshold
🚨 alert (🔔)
0.01 ns
(+21.95%)Baseline: 0.00 ns
0.00 ns
(108.20%)

compiled: flat array 10 itemsLatency
nanoseconds (ns)
📈 plot
🚷 threshold
🚨 alert (🔔)
0.01 ns
(+17.89%)Baseline: 0.01 ns
0.01 ns
(100.17%)

exec: absolute baseline (passthrough, no tools)Latency
nanoseconds (ns)
📈 plot
🚷 threshold
🚨 alert (🔔)
0.01 ns
(+58.14%)Baseline: 0.00 ns
0.00 ns
(110.73%)

exec: chained 3-tool fan-outLatency
nanoseconds (ns)
📈 plot
🚷 threshold
🚨 alert (🔔)
0.06 ns
(+168.84%)Baseline: 0.02 ns
0.05 ns
(105.67%)

exec: flat array 10 itemsLatency
nanoseconds (ns)
📈 plot
🚷 threshold
🚨 alert (🔔)
0.02 ns
(+41.48%)Baseline: 0.01 ns
0.02 ns
(111.06%)

exec: flat array 100 itemsLatency
nanoseconds (ns)
📈 plot
🚷 threshold
🚨 alert (🔔)
0.11 ns
(+36.75%)Baseline: 0.08 ns
0.09 ns
(110.78%)

exec: flat array 1000 itemsLatency
nanoseconds (ns)
📈 plot
🚷 threshold
🚨 alert (🔔)
0.93 ns
(+32.40%)Baseline: 0.70 ns
0.87 ns
(106.86%)

exec: nested array 10x10Latency
nanoseconds (ns)
📈 plot
🚷 threshold
🚨 alert (🔔)
0.16 ns
(+28.01%)Baseline: 0.13 ns
0.15 ns
(106.95%)

exec: nested array 20x10Latency
nanoseconds (ns)
📈 plot
🚷 threshold
🚨 alert (🔔)
0.30 ns
(+25.22%)Baseline: 0.24 ns
0.29 ns
(105.22%)

exec: nested array 5x5Latency
nanoseconds (ns)
📈 plot
🚷 threshold
🚨 alert (🔔)
0.06 ns
(+31.05%)Baseline: 0.05 ns
0.06 ns
(108.80%)

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

exec: simple chain (1 tool)Latency
nanoseconds (ns)
📈 plot
🚷 threshold
🚨 alert (🔔)
0.01 ns
(+68.02%)Baseline: 0.01 ns
0.01 ns
(114.92%)

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
0.00 ns
(+3.55%)Baseline: 0.00 ns
0.00 ns
(94.70%)
compiled: array + SYNC tool-per-element 10📈 view plot
🚷 view threshold
0.01 ns
(+6.19%)Baseline: 0.01 ns
0.01 ns
(91.40%)
compiled: array + SYNC tool-per-element 100📈 view plot
🚷 view threshold
0.02 ns
(+4.55%)Baseline: 0.02 ns
0.03 ns
(77.49%)
compiled: array + tool-per-element 10📈 view plot
🚷 view threshold
0.01 ns
(+14.96%)Baseline: 0.01 ns
0.01 ns
(95.64%)
compiled: array + tool-per-element 100📈 view plot
🚷 view threshold
0.04 ns
(+19.33%)Baseline: 0.04 ns
0.05 ns
(92.55%)
compiled: chained 3-tool fan-out📈 view plot
🚷 view threshold
🚨 view alert (🔔)
0.01 ns
(+21.95%)Baseline: 0.00 ns
0.00 ns
(108.20%)

compiled: flat array 10 items📈 view plot
🚷 view threshold
🚨 view alert (🔔)
0.01 ns
(+17.89%)Baseline: 0.01 ns
0.01 ns
(100.17%)

compiled: flat array 100 items📈 view plot
🚷 view threshold
0.02 ns
(+32.15%)Baseline: 0.01 ns
0.02 ns
(87.86%)
compiled: flat array 1000 items📈 view plot
🚷 view threshold
0.12 ns
(+43.66%)Baseline: 0.08 ns
0.15 ns
(81.77%)
compiled: nested array 10x10📈 view plot
🚷 view threshold
0.03 ns
(+24.82%)Baseline: 0.02 ns
0.03 ns
(92.23%)
compiled: nested array 20x10📈 view plot
🚷 view threshold
0.05 ns
(+26.83%)Baseline: 0.04 ns
0.05 ns
(91.31%)
compiled: nested array 5x5📈 view plot
🚷 view threshold
0.01 ns
(+18.30%)Baseline: 0.01 ns
0.01 ns
(95.44%)
compiled: short-circuit (overdefinition bypass)📈 view plot
🚷 view threshold
0.00 ns
(+3.75%)Baseline: 0.00 ns
0.00 ns
(94.95%)
compiled: simple chain (1 tool)📈 view plot
🚷 view threshold
0.00 ns
(+9.17%)Baseline: 0.00 ns
0.00 ns
(99.82%)
exec: absolute baseline (passthrough, no tools)📈 view plot
🚷 view threshold
🚨 view alert (🔔)
0.01 ns
(+58.14%)Baseline: 0.00 ns
0.00 ns
(110.73%)

exec: array + SYNC tool-per-element 10📈 view plot
🚷 view threshold
0.11 ns
(+11.30%)Baseline: 0.10 ns
0.13 ns
(81.06%)
exec: array + SYNC tool-per-element 100📈 view plot
🚷 view threshold
0.95 ns
(+8.40%)Baseline: 0.87 ns
1.20 ns
(78.79%)
exec: array + tool-per-element 10📈 view plot
🚷 view threshold
0.12 ns
(+48.04%)Baseline: 0.08 ns
0.13 ns
(98.75%)
exec: array + tool-per-element 100📈 view plot
🚷 view threshold
1.09 ns
(+45.56%)Baseline: 0.75 ns
1.13 ns
(96.76%)
exec: chained 3-tool fan-out📈 view plot
🚷 view threshold
🚨 view alert (🔔)
0.06 ns
(+168.84%)Baseline: 0.02 ns
0.05 ns
(105.67%)

exec: flat array 10 items📈 view plot
🚷 view threshold
🚨 view alert (🔔)
0.02 ns
(+41.48%)Baseline: 0.01 ns
0.02 ns
(111.06%)

exec: flat array 100 items📈 view plot
🚷 view threshold
🚨 view alert (🔔)
0.11 ns
(+36.75%)Baseline: 0.08 ns
0.09 ns
(110.78%)

exec: flat array 1000 items📈 view plot
🚷 view threshold
🚨 view alert (🔔)
0.93 ns
(+32.40%)Baseline: 0.70 ns
0.87 ns
(106.86%)

exec: nested array 10x10📈 view plot
🚷 view threshold
🚨 view alert (🔔)
0.16 ns
(+28.01%)Baseline: 0.13 ns
0.15 ns
(106.95%)

exec: nested array 20x10📈 view plot
🚷 view threshold
🚨 view alert (🔔)
0.30 ns
(+25.22%)Baseline: 0.24 ns
0.29 ns
(105.22%)

exec: nested array 5x5📈 view plot
🚷 view threshold
🚨 view alert (🔔)
0.06 ns
(+31.05%)Baseline: 0.05 ns
0.06 ns
(108.80%)

exec: short-circuit (overdefinition bypass)📈 view plot
🚷 view threshold
🚨 view alert (🔔)
0.01 ns
(+91.31%)Baseline: 0.00 ns
0.01 ns
(120.00%)

exec: simple chain (1 tool)📈 view plot
🚷 view threshold
🚨 view alert (🔔)
0.01 ns
(+68.02%)Baseline: 0.01 ns
0.01 ns
(114.92%)

parse: large bridge (20 handles x 5 wires)📈 view plot
🚷 view threshold
1.34 ns
(+21.77%)Baseline: 1.10 ns
1.55 ns
(86.25%)
parse: simple bridge📈 view plot
🚷 view threshold
0.04 ns
(+5.78%)Baseline: 0.03 ns
0.05 ns
(77.23%)
🐰 View full continuous benchmarking report in Bencher

@aarne aarne linked an issue Mar 10, 2026 that may be closed by this pull request
aarne and others added 2 commits March 10, 2026 16:26
* New test harness

* AI is fucking useless here

* Testing with AI is pure agony

* Migrate bridge e2e tests from forEachEngine to regressionTest harness (#126)

* Initial plan

* Migrate fallback-bug.test.ts from forEachEngine to regressionTest

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

* Migrate chained.test.ts from forEachEngine to regressionTest

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

* Migrate string-interpolation.test.ts and interpolation-universal.test.ts to regressionTest

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

* Migrate prototype-pollution.test.ts from forEachEngine

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

* Migrate ternary.test.ts from forEachEngine to regressionTest (partial - 2 trace assertions need engine-specific handling)

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

* Fix ternary refFallback trace assertion: runtime lazy vs compiler eager

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

* refactor: migrate expressions.test.ts from forEachEngine to regressionTest

Migrated the following test groups to the regressionTest harness:
- expressions: execution (arithmetic, comparisons, tool source, chained)
- expressions: operator precedence
- boolean logic: not prefix
- parenthesized arithmetic
- safe flag propagation in expressions (with allowDowngrade)
- safe navigation with sync tool (with allowDowngrade)

Tests that cannot be migrated due to compiler limitations remain as
forEachEngine blocks:
- String literal comparison (serializer strips quotes)
- Array mapping with expressions (serializer bug)
- catch error fallback (compiler doesn't downgrade)
- and/or boolean logic (compiler generates broken __and/__or)
- Parenthesized boolean expressions (contain and/or)
- condAnd/condOr without safe navigation
- Safe flag on right operand of and/or

Side-effect tests (short-circuit behavior) moved to
test/legacy/expressions.test.ts per migration guidelines.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* refactor: migrate force-wire tests to regressionTest harness

- Tests 1,2,4,5 migrated to regressionTest with test.multitool
- Tests 3 (timing) and 6 (runtime-skip) moved to legacy/force-wire.test.ts
- All 6 original test scenarios preserved

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Move remaining forEachEngine tests to legacy/ with README.md of action items

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

* Migrate infinite-loop-protection.test.ts to regressionTest (partial)

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

* Fix infinite-loop-protection.test.ts: fix traversal coverage and graphql replay failures

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

* Fix serializer: support expressions, ternary, coalesce, string interpolation in tool self-wires

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

* test: migrate tool-self-wires-runtime to regressionTest harness

Move test/legacy/tool-self-wires-runtime.test.ts to
test/tool-self-wires-runtime.test.ts using the regressionTest pattern
with test.multitool from bridge-tools.ts.

All 9 test cases are consolidated into a single regressionTest block
with shared const declarations and per-scenario assertions. The
compiler handles all cases natively so allowDowngrade is not needed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* feat: migrate native-batching tests to regressionTest harness

- Migrate all 3 tests from forEachEngine to regressionTest pattern
- Fix serializer bug: loop-scoped tool handles now round-trip correctly
  - Add element property to HandleBinding type for tool handles
  - Mark element-scoped tools in parser (processLocalToolBindings)
  - Serializer skips element handles in header, emits inside array blocks
  - Serializer correctly identifies element-scoped tool wires
- Delete legacy/native-batching.test.ts

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update legacy README with migration patterns and remove migrated files

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

* New tsc setup

* Fix build

* feat: add bridge-types dependency to bridge-compiler and update pnpm-lock

* feat: refactor multitool functions for improved error handling and cleanup

* Fix graphql control flog bug

* Control flow tests are migrated

* Test structure

* feat: more compiler coverage

* feat: enhance error handling and add new regression tests for expressions

* fix: fuzzer

* Tests

* Some progress

* Move back to legacy

* fix tests

* fix: update tools type to Record<string, unknown> in buildAotFn and compileAndRun

* Hallukad jalle

* Test stability

* Broke a bunch of things

* Fixed some stuff

* Broke some stuff/ fixed some more stuff

* Fixed more stuff

* Broke some stuff again

* Did not really mnage to fix all

* Half fixes

* Now to graphql

* graphql tessts

---------

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: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Aarne Laur <aarne.laur@gmail.com>

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: aarne <82001+aarne@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@aarne aarne marked this pull request as ready for review March 13, 2026 12:35
@aarne aarne merged commit b6baad7 into main Mar 13, 2026
7 of 8 checks passed
@aarne aarne deleted the unify_wires branch March 13, 2026 12:36
@github-actions github-actions bot mentioned this pull request Mar 13, 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.

Unify all Wire types

1 participant