Skip to content

feat: add opt-in execution plans with full backend test coverage - #2982

Merged
chaliy merged 3 commits into
mainfrom
feat/experimental-execution-plan
Nov 23, 2026
Merged

chaliy merged 3 commits into
mainfrom
feat/experimental-execution-plan

Conversation

@chaliy

@chaliy chaliy commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

What changed

Add the disabled-by-default experimental_execution_plan Cargo feature, forwarded by the CLI, ScriptedTool, C ABI, Python, JavaScript and browser crates. Existing Bash scripts can execute supported scalar arithmetic, assignments, branches and loops as execution-owned instructions; other syntax and dynamic contexts retain interpreter execution.

Run the full CI test slices with the feature both disabled and enabled, including binding artifacts, browser/Windows suites, strict host-tool oracles, serialized failpoint unit/security tests and proptest. Discover all fuzz targets from the manifest for bounded PR smoke runs and scheduled campaigns in both modes. Add a compiler/AST differential fuzzer and real-Bash scalar-loop properties; native tests assert eligibility so fallback cannot make the backend tests pass silently. Coverage, ASan, Miri and tenant soaks also cover both modes.

Why

Reduce allocation, copying and repeated arithmetic interpretation without introducing new shell syntax, persistent compiler state or a shared compilation cache.

Before / After

The isolated Linux experiment removed the previous short-script penalty and measured 12% less time for straight arithmetic and 26–63% less for supported loops. Pipelines were approximately flat; substitutions remain 4% slower in separate builds, so the feature stays off by default. Historical source, raw samples and reproduction instructions: https://github.com/everruns/bashkit/tree/41591e58/experiments/script-execution-plan.

Shipping hardening adds layout-based admission for tokenizer/op-vector growth, exact command-vector capacity, reservation/future-drop refunds, literal-only variable admission, and resource fault injection through native execution. These address failures observed by new regression tests.

Validation

  • All PR checks are green: full Rust/optional-runtime slices, strict host-tool oracles, bindings, browser and Windows suites with the feature disabled and enabled.
  • Manually dispatched nightly checks passed: ASan, Miri admission/lifetime checks, Python/TypeScript tenant soaks and security audits, including both execution modes.
  • Every manifest-discovered fuzz smoke combination passed: 23 existing targets in both modes plus the new compiler/AST differential target (47 combinations).
  • Local just pre-pr, just test, all-feature Clippy, feature-enabled workspace docs/embedding tests, and serialized compiler/failpoint tests passed (3,160 unit + 19 security failpoint tests). Python tooling: 277 tests with four existing skips; Python lint passed.
  • The CLI matched real Bash on a mixed arithmetic/branch/function/pipeline/substitution script in both modes. Non-publishing release benchmark checks passed all 96 cases with 100% output agreement; parallel-execution comparisons through 1,000 sessions completed. Timing samples are exploratory, not a new performance claim.

The local live SSH oracle reports network unreachable; the unchanged required gate passed in CI. Full local cargo deny check reports existing unmaintained chrono/chrono-tz advisories (RUSTSEC-2026-0543/0555); bans, licenses and sources passed, and dependency/audit policy files are unchanged.

Risk

Medium: this is an experimental backend with conservative fallback. Compilation consumes request work and memory, so tighter budgets can reject earlier. Default builds retain the interpreter. No new unsafe code or shared compiler cache is introduced.

Checklist

  • Tests added or updated
  • Backward compatibility considered

Get evidence
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

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
bashkit 74cc32d Commit Preview URL

Branch Preview URL
Nov 23 2026, 05:40 PM

@chaliy
chaliy merged commit abc42a7 into main Nov 23, 2026
115 checks passed
@chaliy
chaliy deleted the feat/experimental-execution-plan branch November 23, 2026 18:22
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