Skip to content

Fix Rust and C++ bridge release verification - #4117

Merged
codeshaunted merged 2 commits into
canaryfrom
codex/investigate-cpp-bridge-nightly-29874397753
Jul 22, 2026
Merged

codeshaunted merged 2 commits into
canaryfrom
codex/investigate-cpp-bridge-nightly-29874397753

Conversation

@codeshaunted

@codeshaunted codeshaunted commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • update the C++ bridge core smoke for the shared call_state introduced by async calls
  • run the core consumer smoke in normal C++ SDK presubmit setup, reusing the already-built dev bridge
  • switch Rust release version verification to the canonical public C/C++ ABI smoke that replaced the deleted legacy script

Production bridge code is unchanged, so this has no runtime performance impact.

Testing

  • full sdk_test_cpp nextest suite: 12 passed
  • bridge_cpp core consumer smoke passed
  • public C and C++ ABI smoke passed
  • actionlint, bash syntax, clang-format, and diff checks passed

Fixes the bridge failures in https://github.com/BoundaryML/baml/actions/runs/29874397753

Summary by CodeRabbit

  • Bug Fixes
    • Improved C++ SDK runtime discovery and loading across macOS, Windows, and Linux.
    • Added stronger validation and clear failure behavior when the required runtime library can’t be found.
    • Enhanced reliability of C++ smoke tests by waiting for call completion before assertions.
  • Tests
    • Strengthened Rust SDK verification to validate the downloaded ABI/dylib using the appropriate test harness and working directory.
    • Strengthened C++ SDK smoke testing with optional externally provided runtime path support.

@vercel

vercel Bot commented Jul 22, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
beps Ready Ready Preview, Comment Jul 22, 2026 1:53am
promptfiddle Ready Ready Preview, Comment Jul 22, 2026 1:53am
promptfiddle2 Ready Ready Preview, Comment Jul 22, 2026 1:53am

Request Review

@coderabbitai

coderabbitai Bot commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The Rust workflow now uses the ABI smoke harness from baml_language. C++ smoke tests support platform-specific runtime paths, build missing libraries, validate resolved paths, and wait for call-state completion before reading results.

Changes

SDK smoke-test integration

Layer / File(s) Summary
ABI version verification
.github/workflows/verify-rust-sdk.reusable.yaml
The version-triple check runs run_abi_smoke.py from the baml_language working directory while retaining canonical version comparisons.
C++ runtime path plumbing
baml_language/sdk_tests/crates/cpp/setup.sh, baml_language/sdks/cpp/bridge_cpp/tests/run.sh
Setup selects the platform runtime filename and passes it through BAML_RUNTIME_PATH; the test runner supports overrides, builds missing libraries, validates the path, and forwards it to runtime_smoke.
Call registry completion wait
baml_language/sdks/cpp/bridge_cpp/tests/runtime_smoke.cc
The round-trip test waits for state readiness with a one-second deadline before retrieving the payload.

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

Sequence Diagram(s)

sequenceDiagram
  participant Setup as C++ setup
  participant BridgeRun as bridge_cpp run.sh
  participant BridgeCffi as bridge_cffi
  participant Smoke as runtime_smoke
  Setup->>BridgeCffi: Build dev-profile runtime
  Setup->>BridgeRun: Set BAML_RUNTIME_PATH
  BridgeRun->>Smoke: Pass resolved runtime path
  Smoke->>BridgeCffi: Load runtime and execute smoke test
Loading

Possibly related PRs

Poem

A bunny checks the runtime glow,
Across .so, .dll, and .dylib flow.
Calls wait calmly, states turn bright,
ABI versions match just right—
Hop, smoke tests, into the night!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: fixing Rust and C++ bridge release verification.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/investigate-cpp-bridge-nightly-29874397753

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@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.

@vercel
vercel Bot temporarily deployed to Preview – beps July 22, 2026 01:22 Inactive

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@baml_language/sdks/cpp/bridge_cpp/tests/run.sh`:
- Around line 18-20: Update the library-existence check in run.sh to resolve the
platform-specific runtime_lib name first, then guard the cargo build with [[ -f
"$libdir/$runtime_lib" ]]. Remove the combined ls glob check so an unmatched
alternate library name cannot trigger an unnecessary rebuild.

In `@baml_language/sdks/cpp/bridge_cpp/tests/runtime_smoke.cc`:
- Around line 42-45: Replace the assert(ready) check in the runtime smoke test
with an explicit timeout failure path that remains active under NDEBUG,
returning a nonzero exit code or aborting before calling started.state->wait()
when ready is false.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: f8ec8f74-625b-44ee-8aa8-1ea9147ec357

📥 Commits

Reviewing files that changed from the base of the PR and between 2c888e4 and 572dc13.

📒 Files selected for processing (4)
  • .github/workflows/verify-rust-sdk.reusable.yaml
  • baml_language/sdk_tests/crates/cpp/setup.sh
  • baml_language/sdks/cpp/bridge_cpp/tests/run.sh
  • baml_language/sdks/cpp/bridge_cpp/tests/runtime_smoke.cc

Comment thread baml_language/sdks/cpp/bridge_cpp/tests/run.sh Outdated
Comment thread baml_language/sdks/cpp/bridge_cpp/tests/runtime_smoke.cc Outdated
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 July 22, 2026 01:29 Inactive
@github-actions

github-actions Bot commented Jul 22, 2026 •

Copy link
Copy Markdown

Binary size checks passed

✅ 7 passed

Artifact Platform File Gzip Gated on Baseline Delta Status
✅ baml-cli Linux 🔒 25.6 MB 10.8 MB file 25.3 MB +274.9 KB (+1.1%) OK
✅ packed-program Linux 🔒 17.2 MB 7.1 MB file 17.0 MB +153.1 KB (+0.9%) OK
✅ baml-cli macOS 🔒 19.8 MB 9.4 MB file 19.6 MB +231.5 KB (+1.2%) OK
✅ packed-program macOS 🔒 13.4 MB 6.2 MB file 13.2 MB +198.3 KB (+1.5%) OK
✅ baml-cli Windows 🔒 21.3 MB 9.7 MB file 21.1 MB +230.9 KB (+1.1%) OK
✅ packed-program Windows 🔒 14.3 MB 6.3 MB file 14.2 MB +146.4 KB (+1.0%) OK
✅ bridge_wasm WASM 16.3 MB 🔒 4.4 MB gzip 4.4 MB +19.4 KB (+0.4%) OK

🔒 = 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.


Generated by cargo size-gate · workflow run

@vercel
vercel Bot temporarily deployed to Preview – beps July 22, 2026 01:32 Inactive

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
baml_language/sdks/cpp/bridge_cpp/tests/run.sh (1)

51-51: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Preserve the BAML_LIBRARY_PATH override.

If callers set only BAML_LIBRARY_PATH, this assignment adds the script’s default BAML_RUNTIME_PATH; the loader then raises BAML_RUNTIME_CONFIG_CONFLICT because the values differ. Include BAML_LIBRARY_PATH in runtime-path selection and avoid injecting a conflicting value here.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@baml_language/sdks/cpp/bridge_cpp/tests/run.sh` at line 51, Update the
runtime invocation in run.sh to honor an existing BAML_LIBRARY_PATH override
when selecting the runtime path, rather than always injecting the script’s
default BAML_RUNTIME_PATH. Ensure callers setting only BAML_LIBRARY_PATH do not
receive a conflicting BAML_RUNTIME_PATH value, while retaining the default
runtime path when no override is provided.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@baml_language/sdks/cpp/bridge_cpp/tests/run.sh`:
- Line 51: Update the runtime invocation in run.sh to honor an existing
BAML_LIBRARY_PATH override when selecting the runtime path, rather than always
injecting the script’s default BAML_RUNTIME_PATH. Ensure callers setting only
BAML_LIBRARY_PATH do not receive a conflicting BAML_RUNTIME_PATH value, while
retaining the default runtime path when no override is provided.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 2649fcf5-c80e-4e3a-814e-776fdf67b9d7

📥 Commits

Reviewing files that changed from the base of the PR and between 572dc13 and 9372bed.

📒 Files selected for processing (2)
  • baml_language/sdks/cpp/bridge_cpp/tests/run.sh
  • baml_language/sdks/cpp/bridge_cpp/tests/runtime_smoke.cc
🚧 Files skipped from review as they are similar to previous changes (1)
  • baml_language/sdks/cpp/bridge_cpp/tests/runtime_smoke.cc

@codeshaunted
codeshaunted enabled auto-merge July 22, 2026 01:36
@codeshaunted
codeshaunted added this pull request to the merge queue Jul 22, 2026
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 July 22, 2026 01:41 Inactive
Merged via the queue into canary with commit f706d55 Jul 22, 2026
64 of 65 checks passed
@codeshaunted
codeshaunted deleted the codex/investigate-cpp-bridge-nightly-29874397753 branch July 22, 2026 01:49
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle July 22, 2026 01:53 Inactive
@coderabbitai coderabbitai Bot mentioned this pull request Aug 7, 2026
8 tasks done

This branch was previously deployed

3 inactive deployments
Preview – promptfiddle — 9372bedc Deployed Jul 22, 2026 by vercel[bot]
Preview – promptfiddle2 — 9372bedc Deployed Jul 22, 2026 by vercel[bot]
Preview – beps — 9372bedc Deployed Jul 22, 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