perf: stabilize mixed workloads and reduce JIT overhead - #24
Merged
Conversation
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
Preserve the existing helper, GC, reentry and OSR assertions while yielding to the compiler worker until native helpers run, bounded by a 30s deadline. Co-authored-by: Codex <codex@openai.com>
Coverage instrumentation can leave the compiler worker pending after all 128 replay rounds. Use the configured elapsed-time budget and yield briefly between rounds while preserving native-entry and zero-fallback requirements. Include the case report in failed integration assertions. 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
Stabilize GPUI Shell mixed workloads by retaining bounded shared object shapes, preserving rooted receivers across leaf property guards, and demoting repeatedly failing optimized code when no replacement is pending. Skip inactive interpreter feedback and reduce repeated feedback, runtime lookup, and metrics-publication work.
Also fix ARM64 floating-point truthiness lowering and ignore unused high bits in Int32/Bool payloads. Regression coverage includes shape mutation and GC, borrowed-root ownership, feedback reentry, exact metrics, and native recursion with stack-limit recovery. The first-invocation OSR helper test yields while its compiler worker is pending, with a bounded deadline, so sanitizer scheduling cannot exhaust its fixed loop before OSR starts.
Apple M3 release, 30 interleaved independent processes per configuration, 2,000 timed renders per process, compared with upstream rquickjs 0.12.2 using the same unpatched QuickJS-ng sources:
All 90 candidate processes (180,000 timed renders) have matching snapshot checksums, zero fallbacks, zero deopts, and zero invalid artifacts. These are warmed snapshot construction and validation timings, not FPS. The earlier 200-render comparison found a 4.4% mixed speed improvement over the initial PR candidate. The longer run confirms mixed and UI steady-state gains; mixed P99 is statistically tied with upstream (4.8% slower to 12.8% faster), while UI P99 is 3.4% faster (0.6–10.6% faster). First-window speed is statistically tied for all three workloads.
Known tradeoff: mixed hot reload remains 5.8% slower (median 0.207 ms upstream vs 0.219 ms candidate, about 0.013 ms extra). Compute hot reload is also slower; UI hot reload is 1.6% faster. The separate startup phase diagnostic found extra first-snapshot interpreter work, so these results do not claim that every cold operation improves.
Evidence and raw samples are included under
benchmarks/results/m3-market-tail2000-*(long-run validation),m3-market-profitability-fx-*(200-render comparison) andm3-market-cold-object-probes-*(initial PR candidate), with upstream provenance and startup phase diagnostics. Shape retention is bounded to 64 entries and 16 KiB per context; repeated-deopt demotion waits while a replacement is queued or compiling.Test Plan
cbbf0ad, including the previously failing forced Tier2 Test262 case: CI job.cbbf0adin CI run 34122734368.-D warnings.cargo fmt --all -- --check.cargo clippy --all --all-targets --features full-async,bindgen.The forced-tier Test262 harness now waits within the configured time budget instead of exhausting a fixed replay count before an instrumented compiler worker is ready. Failure assertions include the complete case report. Linux ARM coverage instrumentation with one CPU reproduced the old failure on run 4 (30,534 Tier1 entries, zero Tier2 entries); the change passed 30 consecutive runs. The 4 host Test262 integration tests, formatting, and workspace clippy also pass. Native x86 coverage and all three sanitizer stages subsequently passed on the same commit.
Final CI: run 34122734368 completed successfully on
cbbf0ad326f081a33a2b5357d396ec716fe4fae9: 41 checks passed; only the conditional update-bindings job was skipped. The sanitizer logs confirm both previously failing OSR and forced-Tier2 tests pass under MSAN, ASAN, and TSAN. Runtime performance code is unchanged from the archived 2,000-render benchmark candidate; subsequent changes are benchmark evidence and test harness fixes.