Skip to content

perf: stabilize mixed workloads and reduce JIT overhead - #24

Merged
huacnlee merged 6 commits into
mainfrom
perf-gpui-mixed-workloads
Sep 7, 2026
Merged

perf: stabilize mixed workloads and reduce JIT overhead#24
huacnlee merged 6 commits into
mainfrom
perf-gpui-mixed-workloads

Conversation

@huacnlee

@huacnlee huacnlee commented Sep 7, 2026

Copy link
Copy Markdown
Member

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:

Workload Paired speed relative to upstream 95% bootstrap interval
Compute 8.92x 8.55–9.04x
Mixed market 6.9% faster 5.8–9.1% faster
UI panel 2.2% faster 0.7–3.1% faster

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) and m3-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

  • 272 macOS release tests: runtime unit tests plus optimized, lifecycle, native boundary, helpers, background, runtime feedback, property specialization, and GPUI Shell surface suites.
  • 11 patch application, source fingerprint, and manifest tests.
  • Native Linux x86 coverage on cbbf0ad, including the previously failing forced Tier2 Test262 case: CI job.
  • 14 OSR tests under native ARM Linux ASAN with Docker restricted to one CPU; the complete native x86 MSAN, ASAN, and TSAN stages also passed on cbbf0ad in CI run 34122734368.
  • 258 native ARM64 Linux ASAN tests in Docker, plus 30 native-boundary tests including stack-limit recovery; source mounted read-only.
  • 31 compiler-disabled unit tests, the required-feature gate test, and a compiler-disabled build with -D warnings.
  • cargo fmt --all -- --check.
  • cargo clippy --all --all-targets --features full-async,bindgen.
  • 30-process paired upstream/automatic/interpreter benchmark matrix with five warmup processes per workload/configuration; 200-render comparison followed by 2,000-render tail validation.

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.

huacnlee and others added 6 commits September 7, 2026 19:17
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>
@huacnlee
huacnlee merged commit 07535b1 into main Sep 7, 2026
42 checks passed
@huacnlee
huacnlee deleted the perf-gpui-mixed-workloads branch September 7, 2026 13:56
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