Skip to content

fix(csharp): repair release ABI verification and prepare 0.22.2 - #5239

Merged
rossirpaulo merged 1 commit into
canaryfrom
fix/csharp-release-0.22.2
Oct 13, 2026
Merged

rossirpaulo merged 1 commit into
canaryfrom
fix/csharp-release-0.22.2

Conversation

@rossirpaulo

@rossirpaulo rossirpaulo commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

The 0.22.1 release fails C# artifact verification because AbiLifetimeProbe still expects ABI 2 and the old invocation/cancellation behavior. Update it to ABI 4, send the required invocation envelope, release unused call allocations, and test cancellation through the existing throws_test.SleepMs fixture. Cancellation assertions now require baml.panics.Cancelled, so an unknown function or malformed invocation cannot pass as cancellation.

Run the same lifetime probe in the normal C# SDK suite on PRs, with bytecode and the native library built from that source. Keep the packaged release gate and its buffer/handle ownership checks. This addresses the stale-probe failure also discussed in #5146 while retaining verification coverage.

Bump the language and SDK release metadata to 0.22.2, regenerate the Node bridge, and refresh the Cargo/Python lockfiles. The wrapper stays at 0.2.5. A new patch is required because 0.22.1's packages and channel manifest were already published. After merge, successful post-merge CI triggers the canary release.

Validation: reproduced the original failure against the exact 0.22.1 release artifacts, then passed the repaired probe against those artifacts on macOS arm64. All 23 release-script tests, release-version consistency, and the eight-platform C# release contract pass. The full local C# SDK suite passes against the 0.22.2 source at this PR commit: 16 passed, including the new release ABI test, with one existing skipped test. Normal commit hooks, including formatting and workspace Clippy, pass.

Summary by CodeRabbit

  • Release
    • Updated BAML to version 0.22.2 across supported SDKs, bridges, and the VS Code extension.
  • Tests
    • Expanded C# compatibility checks for ABI lifetimes, cancellation, media handling, and invocation protocols.

@vercel

vercel Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
developer-docs Ready Ready Preview Oct 13, 2026 1:38am UTC

Request Review

@github-actions

Copy link
Copy Markdown

⏭️ Performance benchmarks were skipped

Perf benchmarks (CodSpeed) are opt-in on pull requests — they no longer run on every push. They always run automatically after merge to canary/main.

To run them on this PR, do any of the following, then push a commit (or re-run CI):

  • Add RUN_CODSPEED=1 to the PR description, or
  • Include run-perf or /perf in the PR title or any commit message.

@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 07c620bd-8099-4900-b2cd-b604e974dc6c
📥 Commits

Reviewing files that changed from the base of the PR and between 4c21adc and ce712a3.

⛔ Files ignored due to path filters (3)
  • baml_language/Cargo.lock is excluded by !**/*.lock
  • baml_language/sdks/python/uv.lock is excluded by !**/*.lock
  • baml_language/sdks/typescript/bridge_typescript/dist/native.js is excluded by !**/dist/**
📒 Files selected for processing (23)
  • baml_language/crates/baml_version/src/lib.rs
  • baml_language/release.toml
  • baml_language/sdk_tests/crates/csharp/Cargo.toml
  • baml_language/sdk_tests/crates/csharp/setup.ps1
  • baml_language/sdk_tests/crates/csharp/setup.sh
  • baml_language/sdk_tests/crates/csharp/src/lib.rs
  • baml_language/sdks/cpp/bridge_cpp/include/baml/version.h
  • baml_language/sdks/csharp/bridge_csharp/src/Baml.Bridge.csproj
  • baml_language/sdks/csharp/bridge_csharp/src/RuntimeIdentity.cs
  • baml_language/sdks/csharp/bridge_csharp/tests/Baml.Bridge.AbiLifetimeProbe/Program.cs
  • baml_language/sdks/go/baml_go/version.go
  • baml_language/sdks/java/baml_bridge/src/main/java/baml_bridge/BamlVersion.java
  • baml_language/sdks/python/pyproject.toml
  • baml_language/sdks/python/src/baml_bridge/__init__.py
  • baml_language/sdks/ruby/bridge_ruby/lib/baml/bridge/version.rb
  • baml_language/sdks/rust/bridge_rust/Cargo.toml
  • baml_language/sdks/rust/bridge_rust/src/version.rs
  • baml_language/sdks/swift/Sources/BamlBridge/RuntimeIdentity.swift
  • baml_language/sdks/typescript/bridge_typescript/package.json
  • baml_language/sdks/typescript/bridge_typescript/src/version.rs
  • baml_language/sdks/typescript/bridge_typescript_web/package.json
  • baml_language/sdks/typescript/bridge_typescript_web/src/version.rs
  • typescript2/app-vscode-ext/package.json

Included review availability: This review used your included allowance. 9 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 10 reviews per hour.

📝 Walkthrough

The release version changes from 0.22.1 to 0.22.2 across release metadata and SDKs. The C# ABI lifetime probe setup and checks are expanded to cover additional ABI functions, call release behavior, and cancellation results.

Changes: Release version and ABI validation

Layer / File(s) Summary
Version alignment
baml_language/crates/baml_version/src/lib.rs, baml_language/release.toml, baml_language/sdks/cpp/..., baml_language/sdks/csharp/..., baml_language/sdks/go/..., baml_language/sdks/java/..., baml_language/sdks/python/..., baml_language/sdks/ruby/..., baml_language/sdks/rust/..., baml_language/sdks/swift/..., baml_language/sdks/typescript/..., typescript2/app-vscode-ext/package.json
Release, package, toolchain, and bridge runtime version declarations change from 0.22.1 to 0.22.2.
C# ABI lifetime probe
baml_language/sdk_tests/crates/csharp/*, baml_language/sdks/csharp/bridge_csharp/tests/Baml.Bridge.AbiLifetimeProbe/Program.cs
The setup scripts generate probe bytecode and build the ABI lifetime probe. The probe checks expanded API function requirements, call release results, and structured cancellation errors. The test runner invokes the probe and checks its output markers.

Priority: ⬆️ High

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Suggested reviewers: sxlijin, hellovai

Merge Risk: ⚪ Minimal · up to ce712

No actionable merge-blocking issue was identified; the change is mergeable after normal checks.

Security architecture risk: ⚪ Minimal · up to ce712

The patch repairs release verification and aligns SDK versions. The native ABI and ownership rules are unchanged, while cancellation and allocation-release checks become stricter. No introduced or materially worsened security risk was identified in the reviewed changes.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The added execution path is a local SDK test process loading the native library already built by C# setup and source-generated fixture bytecode. It does not introduce a remotely callable entrypoint or an additional production privilege boundary.

Trust Boundaries and Controls

  • observed — The probe checks ABI revision and minimum table size before validating function pointers. Cancellation verification now requires the precise cancellation class, preventing an unknown-function or other unrelated failure from satisfying that check.

Resilience and Maintainability Implications

  • observed — The unchanged native allocation table pins the original runtime, serializes lifecycle operations, permits only one submission, rejects caller release after submission, and retires submitted allocations through their lease. Existing tests exercise repeated cancellation, preparation failure, exact-once release, and cancellation racing completion.
Pre-merge checks · Passed 4 · Failed 1

Failed Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 15.79% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 19 functions across 14 files. (9 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks (4 passed)
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly summarizes both main changes: repairing C# release ABI verification and preparing version 0.22.2.
Full details: Docstring Coverage

Explanation

Docstring coverage is 15.79% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 19 functions across 14 files. (9 skipped: 9 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks the version line,
Then hops through probes in measured time.
New call fields join the ABI,
Release and cancel tests reply.
The bridge now wears a newer sign.

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

Binary size checks failed

❌ 2 violations · ✅ 1 passed

⚠️ Please fix the size gate issues or acknowledge them by updating baselines.

Artifact Platform File Gzip Gated on Baseline Delta Status
✅ baml-cli Linux 🔒 61.0 MB 26.0 MB file 73.1 MB -12.1 MB (-16.6%) OK
❌ packed-program Linux 🔒 39.2 MB 16.0 MB file 29.2 MB +10.1 MB (+34.6%) FAIL
❌ bridge_wasm WASM 25.8 MB 🔒 7.6 MB gzip 5.7 MB +1.9 MB (+33.8%) FAIL

🔒 = the size this artifact is GATED on (ceiling + delta). Binaries gate on file size (installed binary); WASM gates on gzip (download size). The other size is shown for information only.

Details & how to fix

Violations:

  • packed-program (Linux) file_bytes: 39.2 MB exceeds limit of 30.1 MB (exceeded by +9.2 MB, policy: max_file_bytes)
  • packed-program (Linux) file_delta_pct: +34.6% exceeds limit of 3.0% (exceeded by +31.6pp, policy: max_delta_pct)
  • bridge_wasm (WASM) gzip_bytes: 7.6 MB exceeds limit of 5.9 MB (exceeded by +1.7 MB, policy: max_gzip_bytes)
  • bridge_wasm (WASM) gzip_delta_pct: +33.8% exceeds limit of 3.0% (exceeded by +30.8pp, policy: max_delta_pct)

Add/update baselines:

.ci/size-gate/wasm32-unknown-unknown.toml:

[artifacts.bridge_wasm]
file_bytes = 25820103
gzip_bytes = 7575609

.ci/size-gate/x86_64-unknown-linux-gnu.toml:

[artifacts.packed-program]
file_bytes = 39246816
gzip_bytes = 16039578

Generated by cargo size-gate · workflow run

@rossirpaulo
rossirpaulo added this pull request to the merge queue Oct 13, 2026
Merged via the queue into canary with commit 01f5c41 Oct 13, 2026
97 of 100 checks passed
@rossirpaulo
rossirpaulo deleted the fix/csharp-release-0.22.2 branch October 13, 2026 05:23

This branch was successfully deployed

1 active deployment
Preview – developer-docs — ce712a3f Deployed Oct 13, 2026 by vercel[bot]
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.

1 participant