feat: bundle rquickjs compatibility facade - #22
Closed
huacnlee wants to merge 1 commit into
Closed
Conversation
Co-authored-by: Codex <codex@openai.com>
Merged
8 tasks
huacnlee
added a commit
to longbridge/gpui-kit
that referenced
this pull request
Sep 9, 2026
#2903) ## Summary Run GPUI Shell through `quickjs-jit` 0.12.7, preserving the existing QuickJS binding API and sharing one VM with LLRT. Pin the bindings, runtime, and upstream `rquickjs` compatibility facade to `9a83a7f9cdc178a0ab5d7b29c3c9227b0dcb8620`; remove the compatibility crate previously maintained in this repository. The bundled facade is introduced by longbridge/quickjs-jit#22. Production runtimes enable automatic JIT. Debug runtimes remain interpreter-only. Defer JIT profiling during prelude/module evaluation, construction, initialization, and the first render; warm eligible functions can compile afterward. Cached frames still replay Rust snapshots without rerunning JavaScript. The benchmarks compare automatic JIT with a true interpreter runtime, check snapshot parity and native entry, and expose categorized compilation/fallback metrics. The current mixed-workload regression remains unresolved; this PR is not evidence that default JIT is ready to merge. ## Performance evidence The 0.12.7 release-tag retest on Apple M3 used release builds, 30 independent processes per version/mode/workload, interleaved serial execution, 64 warmup renders, and 200 measured renders per process. Values below are medians across processes; the P99 column is the median of per-process P99s. Timings include snapshot validation. The interpreter baseline is the same quickjs-jit release with JIT disabled, not a separate upstream rquickjs build. | workload | interpreter steady | automatic JIT steady | JIT speed relative to interpreter | interpreter / JIT P99 | | --- | ---: | ---: | ---: | ---: | | UI panel | 0.8518 ms | 0.8472 ms | 1.01x, approximately equal | 0.9575 / 0.9316 ms | | numeric layout | 0.1458 ms | 0.0159 ms | 9.19x | 0.1767 / 0.0177 ms | | mixed market | 0.2156 ms | 0.4548 ms | 0.47x | 0.3018 / 0.6050 ms | The panel entered no native code. The mixed workload fell back in 22/30 automatic samples; the other eight samples each recorded four rejected invalid artifacts. Snapshot checksums matched across all 360 samples. The zero-fallback mixed-workload assertion failed in 4/10 independent repeat runs. These findings supersede the earlier blanket acceptance conclusion; no cross-platform or memory/binary-size conclusions are drawn from this run. ## Test Plan - [x] `git diff --check`. - [x] `cargo tree --locked -p gpui-shell -i quickjs-jit-core`: one shared binding core; all six QuickJS/facade packages use the pinned revision. - [x] Release build from the pinned Git source. - [ ] `cargo test -p gpui-shell --release tests::benchmark -- --include-ignored --nocapture --test-threads=1`: **10 passed, 1 failed**. The failure is the existing `mixed_market_panel_matches_interpreter_and_enters_native_code` zero-fallback assertion, also reproduced before the facade migration. - [x] Cached-frame assertions passed through 8,403 nodes with zero additional script renders. - No fresh Windows/Linux validation was run for this migration. ## Checklist - [x] Reviewed the AI-assisted dependency migration and benchmark findings. - [x] Keep all QuickJS packages on one upstream revision; no sibling-checkout paths are committed. - [ ] Resolve mixed-workload fallback and nondeterministic performance before treating automatic JIT as merge-ready. --------- Co-authored-by: Codex <codex@openai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Dependencies such as LLRT still request the
rquickjspackage, forcing applications usingquickjs-jitto maintain their own forwarding crate. Bundle that unpublished compatibility facade incompat/rquickjsso a consuming workspace can patchrquickjsto this repository and share the same binding types and VM.Forward the existing compatibility features, document the required root-level Cargo patch and consistent Git revision, and add the crate to the workspace. GPUI Kit PR longbridge/gpui-kit#2903 will consume this facade and remove its local copy. This change does not modify JIT execution or address the mixed-workload performance issue.
Test Plan
cargo check -p rquickjs --features macro,loader,half,futures,parallel,properties,classes,array-buffer(passes; upstream deprecated-feature warnings).git diff --check.