Skip to content

KCL: Send version when connecting to engine - #13920

Merged
adamchalmers merged 4 commits into
mainfrom
achalmers/send-kcl-version
Sep 22, 2026
Merged

adamchalmers merged 4 commits into
mainfrom
achalmers/send-kcl-version

Conversation

@adamchalmers

@adamchalmers adamchalmers commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Closes #11526

@vercel

vercel Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
modeling-app Ready Ready Preview Sep 22, 2026 8:52pm UTC

Request Review

@codspeed

codspeed Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Merging this PR will degrade performance by 20.49%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

❌ 1 regressed benchmark
✅ 158 untouched benchmarks
⏩ 129 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
❌ no_engine_mock_execute_mike_stress_test[3000] 8.7 s 11 s -20.49%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing achalmers/send-kcl-version (31b5d24) with main (0b6e129)2

Open in CodSpeed

Footnotes

  1. 129 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

  2. No successful run was found on main (3185633) during the generation of this report, so 0b6e129 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

Comment thread rust/kcl-lib/tests/bad_units_in_annotation/execution_error.snap Outdated
Adam: When creating a WebSocket connection to the engine, either in native Rust (via Tungstenite) or in the browser's WebSocket, we need to send the KCL Version being used, in the `CommandsWsParams` struct that is serialized into the WebSocket URL's query string.
I'd like one centralized place that we can read the KCL version from. Currently this is just the annotations of the KCL entrypoint (the first file executed).
We need some place for the KCL version to be read by both the KCL runtime itself (which needs to know the version to know what KCL language behaviour to do) and by the frontend (which needs to connect to the engine and send the KCL version in its connection URL). Both KCL and the frontend will need to know the KCL version before execution begins.

Implemented: the frontend sends kcl_version using the shared Rust/Wasm resolver and reconnects when the entrypoint version changes.
Legacy runtime behavior is preserved.
Now the KCL `@settings` header is parsed early, to get the KCL version
before connecting to engine. This means errors in the `@settings` block,
like putting `nm` as the units (we do not support nanometers), get
checked earlier before establishing connection.

Sim test artifact change reflects this.
@adamchalmers
adamchalmers merged commit 96a171d into main Sep 22, 2026
76 of 79 checks passed
@adamchalmers
adamchalmers deleted the achalmers/send-kcl-version branch September 22, 2026 21:16

This branch was successfully deployed

1 active deployment
Preview — 31b5d244 Deployed Sep 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.

Send KCL version to the engine

2 participants