Skip to content

Support engine execution for KCL commands#1711

Open
adamchalmers wants to merge 2 commits into
mainfrom
achalmers/export-remote
Open

Support engine execution for KCL commands#1711
adamchalmers wants to merge 2 commits into
mainfrom
achalmers/export-remote

Conversation

@adamchalmers

@adamchalmers adamchalmers commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Setting $ENGINE_EXECUTION to any non-empty string will execute KCL on the engine instead of locally.

This produces a significant speedup:

engine_exec_speedup
  • Engine execution takes 26 seconds
  • Local execution which takes 101 seconds
  • This means engine execution is 4x as fast!
  • Also incidentally uses 5x less memory (which wasn't part of the motivation, but is nice)

@adamchalmers adamchalmers force-pushed the achalmers/export-remote branch from aacdcd2 to 938b7cc Compare July 7, 2026 01:43
@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 37.66938% with 230 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.02%. Comparing base (290825a) to head (41ff23f).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/context.rs 4.95% 230 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1711      +/-   ##
==========================================
- Coverage   65.21%   64.02%   -1.19%     
==========================================
  Files          44       45       +1     
  Lines        8219     8587     +368     
==========================================
+ Hits         5360     5498     +138     
- Misses       2859     3089     +230     
Flag Coverage Δ
unittests 64.02% <37.66%> (-1.19%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@adamchalmers adamchalmers marked this pull request as ready for review July 7, 2026 03:43
@adamchalmers adamchalmers requested a review from jessfraz as a code owner July 7, 2026 03:43
Comment thread src/cmd_kcl.rs
let units: UnitLength = meta_settings.default_length_units.to_kcmc();
let output_format = get_output_format(&self.output_format, units, self.deterministic);

if crate::context::Context::use_server_kcl_execution() {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Export is a weird case. All the other commands use a nice general utility function, "execute this KCL then run these commands as a follow-up", but not export. So it has its own explicit logic for engine execution here. Will fix this up in a followup PR.

@adamchalmers adamchalmers changed the title Achalmers/export remote Support engine execution for KCL commands Jul 7, 2026
Comment thread Cargo.toml Outdated
@adamchalmers adamchalmers force-pushed the achalmers/export-remote branch 2 times, most recently from 5de827e to b12f305 Compare July 7, 2026 20:32
This is around 20x faster on large models.
Set ENGINE_EXECUTION to any nonempty string to activate.
Off by default.
@adamchalmers adamchalmers force-pushed the achalmers/export-remote branch from b12f305 to 688efbe Compare July 7, 2026 20:39
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