Skip to content

feat: bundle rquickjs compatibility facade - #22

Closed
huacnlee wants to merge 1 commit into
mainfrom
rquickjs-compat
Closed

feat: bundle rquickjs compatibility facade#22
huacnlee wants to merge 1 commit into
mainfrom
rquickjs-compat

Conversation

@huacnlee

@huacnlee huacnlee commented Sep 7, 2026

Copy link
Copy Markdown
Member

Summary

Dependencies such as LLRT still request the rquickjs package, forcing applications using quickjs-jit to maintain their own forwarding crate. Bundle that unpublished compatibility facade in compat/rquickjs so a consuming workspace can patch rquickjs to 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.
  • Added changelog entry and reviewed the AI-assisted migration.
  • GPUI Kit integration validation is recorded in its consumer PR.

Co-authored-by: Codex <codex@openai.com>
@huacnlee huacnlee closed this Sep 7, 2026
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>
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