Skip to content

macOS: detect AVX at runtime instead of assuming every Mac has it#292

Open
tobocop2 wants to merge 1 commit into
oven-sh:mainfrom
tobocop2:claude/darwin-avx-runtime-detection
Open

macOS: detect AVX at runtime instead of assuming every Mac has it#292
tobocop2 wants to merge 1 commit into
oven-sh:mainfrom
tobocop2:claude/darwin-avx-runtime-detection

Conversation

@tobocop2

@tobocop2 tobocop2 commented Jul 15, 2026

Copy link
Copy Markdown

Problem

JSC assumes every x86_64 Mac has AVX in two places, so it emits VEX-encoded instructions on CPUs that cannot decode them.

1. Feature detection. collectCPUFeatures() never asks the CPU on Darwin:

#if OS(DARWIN)
        s_avxCheckState = CPUIDCheckState::Set;   // never checks the CPU
#else
        // CPUID.1:ECX.AVX[28] + OSXSAVE[27] + XCR0[2:1] == 11b
#endif

supportsAVX() then returns true and the ~10 VEX codegen sites in MacroAssemblerX86_64.h emit AVX once code tiers up.

2. The probe trampoline. Darwin defines only a vmovaps trampoline and probe() selects it without consulting supportsAVX():

#if OS(DARWIN)
// On macOS, all x86_64 CPUs support AVX. Use vmovaps unconditionally.

This one is reachable from WebAssembly, not just from debug paths — WasmBBQJIT.cpp:3470 (loop OSR entry), WasmBBQJIT.cpp:3623 (tier-up), and WasmOMGIRGenerator.cpp:1529 (catch prologue) all call probe() with no option guard.

#198 fixed the first bug for Linux/Windows and guarded the new code with #if !OS(DARWIN), leaving Darwin on the old assumption.

The assumption holds for every Mac Apple shipped with a supported macOS — Sandy Bridge (2011) and later all have AVX. It does not hold on a pre-AVX Mac running current macOS via OpenCore, nor under Rosetta 2.

This is independent of the missing baseline macOS WebKit (#290, oven-sh/bun#32511). AVX2 on Darwin is already detected correctly via sysctlbyname("hw.optional.avx2_0") — only AVX is assumed, so Sandy/Ivy Bridge Macs are unaffected. Together the two changes are what make a pre-Haswell Mac work: #290 fixes startup, this fixes the JIT.

3. AVX2 was ungated. Darwin took AVX2 straight from sysctlbyname("hw.optional.avx2_0") without gating it on AVX, unlike the non-Darwin path. That was harmless while AVX was hardcoded Set; making AVX a runtime check is what makes avx=Clear, avx2=Set reachable, and AVX2 is VEX-encoded too.

Fix

Delete the Darwin special-cases and use the code that already exists for every other platform: the CPUID + OSXSAVE + XCR0 check, the dual-trampoline selection, and the same AVX2 gating. Un-gate readXCR0() so Darwin can call it. 16 insertions, 22 deletions — it removes more than it adds.

readXCR0() executes xgetbv, only reachable when OSXSAVE is set — exactly when xgetbv is architecturally legal. That gate is unchanged from the Linux/Windows path.

Verification

1. Non-Darwin is provably untouched

For !OS(DARWIN) the preprocessor selected this same code before the change and selects it after. Preprocessed output of the whole file, before vs after:

before: b35baacc2321f9c9736331b499161a96be4f9f569c6ab622cedf699068314457
after : b35baacc2321f9c9736331b499161a96be4f9f569c6ab622cedf699068314457

Byte-identical. This cannot regress Linux or Windows. After the patch, the preprocessed Darwin output differs from Linux only in the sysctlbyname block for BMI1/AVX2, which is legitimately Darwin-specific.

2. On an AVX CPU the new check agrees with the old hardcode

The patch's exact logic, run on AVX hardware (Intel Xeon @ 2.20GHz):

CPUID.1:ECX AVX[28]=1 OSXSAVE[27]=1
XCR0=0x7
OLD Darwin hardcode would give : Set
NEW runtime check gives        : Set

So on every Mac that actually has AVX, supportsAVX() is unchanged, the AVX trampoline is still selected, and codegen is identical. Only machines that crash today behave differently. The added cost is one CPUID + one xgetbv, once per process, inside the existing std::call_once.

3. It fixes the crash

Built bun-webkit-macos-amd64-baseline from this branch (MACOS_ARCH=x86_64 MARCH_FLAG=-march=nehalem), then bun darwin-x64 --baseline=true against it. The archive now exports both trampolines (ctiMasmProbeTrampolineAVX is present on Darwin for the first time); libJavaScriptCore.a disassembles to 0 %ymm (still a true baseline) with the xgetbv check present.

Tested under Rosetta 2 on an Apple M1 (macOS 14.6.1), which reports no AVX — the same condition as a Westmere Mac:

test unpatched AVX detection only this PR
bun --version rc=0 rc=0 rc=0
JIT-heavy loop 132 rc=0 rc=0
WebAssembly hot loop 132 132 rc=0
opencode --version 132 rc=0 rc=0

Measured CPU state on that machine, confirming it is a genuine no-AVX target: CPUID.1:ECX gives AVX[28]=0 OSXSAVE[27]=0, and hw.optional.avx1_0 / avx2_0 / bmi1 / bmi2 all report 0.

The middle column is why the trampoline fix is required rather than optional: fixing only collectCPUFeatures() leaves WebAssembly crashing, because probe() still routes to the vmovaps trampoline.

A 14-case suite covering the YarrJIT SIMD regex paths this gates (alternation, char-class, backtracking, unicode, lookbehind), plus strings/UTF-8, JSON, DFG/FTL tier-up and typed arrays: all pass on the patched build; the unpatched build SIGILLs partway through the same suite on the same machine.

The binaries behind that table, for anyone who wants to reproduce it or has a pre-AVX Mac to test on — a bun built from this branch, plus an opencode compiled against it: https://github.com/tobocop2/opencode-bun-pre-avx2-mac/releases/latest

4. Blast radius

Ordering: s_avxCheckState is computed from CPUID(0x1) in the block above the sysctl block that now reads it, so the AVX2 gate sees a settled value.

readXCR0, s_avxCheckState, s_avx2CheckState, ctiMasmProbeTrampolineAVX and the PROBE_XMM_* macros have no consumers outside this file. supportsAVX() has three: the codegen sites in MacroAssemblerX86_64.h, YarrJIT.cpp:6126/:6404, and CPU.cpp:149. The YarrJIT sites already degrade gracefully (if (!supportsAVX()) return std::nullopt;), so a correct false selects the existing non-SIMD path.

ctiMasmProbeTrampoline changes meaning on Darwin — it becomes the movaps variant, with the AVX variant selected at runtime, matching every other platform. No code outside this file references either symbol (the other hits are ARMv7/ARM64's own same-named trampolines and static_assert text).

Credit

The trampoline half was caught by @coderabbitai in review on the first revision of this PR, which fixed only collectCPUFeatures(). I had assumed probe() was debug-only; it is not — the WebAssembly paths above reach it, and the WASM test SIGILLed until the trampolines were fixed too. The AVX2 gate was also caught in that review.

Found and diagnosed by @WolfgangFahl on a Mac Pro 5,1 (Xeon X5690, Westmere, no AVX, macOS 14.7.8), in anomalyco/opencode#8345. A bun built entirely from source with --baseline=true --webkit=local still died under JIT load while BUN_JSC_useJIT=0 ran fine — which isolated it to runtime codegen rather than build flags. @lumik0 independently flagged collectCPUFeatures() as the suspect area in oven-sh/bun#26872.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

tobocop2 added a commit to tobocop2/opencode-bun-pre-avx2-mac that referenced this pull request Jul 15, 2026
The previous release fixed the startup SIGILL (Nehalem WebKit) but still
crashed once code tiered up, because JSC hardcodes AVX as present on macOS
instead of checking the CPU. Rebuilt against oven-sh/WebKit#292.

Verified on a real Mac Pro 5,1 (Xeon X5690, Westmere) and on an M1 under
Rosetta 2, which also reports no AVX.
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4d46b261-2acd-48ef-a3e9-74d14e3abe36

📥 Commits

Reviewing files that changed from the base of the PR and between 4895f45 and 384b31c.

📒 Files selected for processing (1)
  • Source/JavaScriptCore/assembler/MacroAssemblerX86_64.cpp

Walkthrough

Changes

The x86_64 assembler now uses runtime AVX usability checks on Darwin and selects SSE or AVX probe trampolines consistently across platforms. Darwin AVX2 enablement is gated by validated AVX support.

Cross-platform AVX probing

Layer / File(s) Summary
Probe trampoline support
Source/JavaScriptCore/assembler/MacroAssemblerX86_64.cpp
SSE and AVX probe trampolines and their save/restore macros are compiled on all platforms, with trampoline selection based on supportsAVX().
Runtime AVX validation
Source/JavaScriptCore/assembler/MacroAssemblerX86_64.cpp
readXCR0() is available on Darwin; AVX support now requires CPUID AVX/OSXSAVE bits and the SSE|AVX XCR0 state, and Darwin AVX2 detection is gated on that result.

Possibly related issues

  • oven-sh/bun issue 34215 — Covers the same Darwin AVX detection and probe-trampoline runtime gating changes.
🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is thorough, but it does not follow the required template: it lacks a bug/commit-message header, Bugzilla link, and reviewed-by line. Add the template's header, Bugzilla reference, reviewed-by line, and file/change bullets, or confirm the repo accepts this alternate format.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: runtime AVX detection on macOS instead of assuming support.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
Source/JavaScriptCore/assembler/MacroAssemblerX86_64.cpp (1)

407-419: 🩺 Stability & Availability | 🔴 Critical | ⚡ Quick win

Remove compile-time AVX hardcoding for JIT probes on Darwin. The explicit goal of this PR is to avoid SIGILL on non-AVX Darwin systems (like Rosetta 2) by dynamically checking for AVX support. However, the JIT probe infrastructure still hardcodes AVX usage for Darwin at compile time. If a probe is inserted during execution on a non-AVX CPU, it will unconditionally execute vmovaps and crash.

Remove the OS(DARWIN) branches entirely so that Darwin utilizes the exact same dual-trampoline and fallback logic as Windows and Linux:

  • Source/JavaScriptCore/assembler/MacroAssemblerX86_64.cpp#L407-L419: Remove the #if OS(DARWIN) branch and unconditionally use the #else block to generate both ctiMasmProbeTrampoline (SSE) and ctiMasmProbeTrampolineAVX (AVX).
  • Source/JavaScriptCore/assembler/MacroAssemblerX86_64.cpp#L43-L46: Remove the #if !OS(DARWIN) guard so ctiMasmProbeTrampolineAVX is declared on all platforms.
  • Source/JavaScriptCore/assembler/MacroAssemblerX86_64.cpp#L196-L232: Remove the #if !OS(DARWIN) guard so the SSE movaps save/restore macros are available for the fallback trampoline.
  • Source/JavaScriptCore/assembler/MacroAssemblerX86_64.cpp#L467-L474: Remove the #if OS(DARWIN) branch so that MacroAssembler::probe() dynamically selects the trampoline via supportsAVX() instead of assuming AVX.
🛠️ Proposed fix to remove AVX hardcoding for probes
--- a/Source/JavaScriptCore/assembler/MacroAssemblerX86_64.cpp
+++ b/Source/JavaScriptCore/assembler/MacroAssemblerX86_64.cpp
@@ -40,9 +40,7 @@
 
 JSC_DECLARE_NOEXCEPT_JIT_OPERATION(ctiMasmProbeTrampoline, void, ());
 JSC_ANNOTATE_JIT_OPERATION_PROBE(ctiMasmProbeTrampoline);
-#if !OS(DARWIN)
 JSC_DECLARE_NOEXCEPT_JIT_OPERATION(ctiMasmProbeTrampolineAVX, void, ());
 JSC_ANNOTATE_JIT_OPERATION_PROBE(ctiMasmProbeTrampolineAVX);
-#endif
 
 // The following are offsets for Probe::State fields accessed by the ctiMasmProbeTrampoline stub.
@@ -193,9 +191,7 @@
     "vmovaps " STRINGIZE_VALUE_OF(PROBE_CPU_XMM14_VECTOR_OFFSET) "(%rbp), %xmm14" "\n" \
     "vmovaps " STRINGIZE_VALUE_OF(PROBE_CPU_XMM15_VECTOR_OFFSET) "(%rbp), %xmm15" "\n"
 
-#if !OS(DARWIN)
 `#define` PROBE_XMM_SAVE_MOVAPS \
     "movaps %xmm0,  " STRINGIZE_VALUE_OF(PROBE_CPU_XMM0_VECTOR_OFFSET) "(%rsp)" "\n" \
     "movaps %xmm1,  " STRINGIZE_VALUE_OF(PROBE_CPU_XMM1_VECTOR_OFFSET) "(%rsp)" "\n" \
@@ -228,7 +224,6 @@
     "movaps " STRINGIZE_VALUE_OF(PROBE_CPU_XMM13_VECTOR_OFFSET) "(%rbp), %xmm13" "\n" \
     "movaps " STRINGIZE_VALUE_OF(PROBE_CPU_XMM14_VECTOR_OFFSET) "(%rbp), %xmm14" "\n" \
     "movaps " STRINGIZE_VALUE_OF(PROBE_CPU_XMM15_VECTOR_OFFSET) "(%rbp), %xmm15" "\n"
-#endif // !OS(DARWIN)
 
 `#if` COMPILER(MSVC)
 `#define` ASM_PREVIOUS_SECTION
@@ -404,17 +399,11 @@
     ASM_PREVIOUS_SECTION \
 );
 
-#if OS(DARWIN)
-// On macOS, all x86_64 CPUs support AVX. Use vmovaps unconditionally.
-DEFINE_PROBE_TRAMPOLINE(ctiMasmProbeTrampoline, PROBE_XMM_SAVE_VMOVAPS, PROBE_XMM_RESTORE_VMOVAPS,
-    ctiMasmProbeTrampolineCopyLoop, ctiMasmProbeTrampolineProbeStateIsSafe, ctiMasmProbeTrampolineRestoreRegisters)
-#else
-// On Linux/Windows, AVX may not be available. Provide two trampolines:
 // - ctiMasmProbeTrampoline: uses movaps (SSE, always available on x86_64)
 // - ctiMasmProbeTrampolineAVX: uses vmovaps (requires AVX)
 DEFINE_PROBE_TRAMPOLINE(ctiMasmProbeTrampoline, PROBE_XMM_SAVE_MOVAPS, PROBE_XMM_RESTORE_MOVAPS,
     ctiMasmProbeTrampolineCopyLoop, ctiMasmProbeTrampolineProbeStateIsSafe, ctiMasmProbeTrampolineRestoreRegisters)
 DEFINE_PROBE_TRAMPOLINE(ctiMasmProbeTrampolineAVX, PROBE_XMM_SAVE_VMOVAPS, PROBE_XMM_RESTORE_VMOVAPS,
     ctiMasmProbeTrampolineAVXCopyLoop, ctiMasmProbeTrampolineAVXProbeStateIsSafe, ctiMasmProbeTrampolineAVXRestoreRegisters)
-#endif
 
 // What code is emitted for the probe?
@@ -464,15 +453,11 @@
     push(RegisterID::eax);
 
-#if OS(DARWIN)
-    move(TrustedImmPtr(reinterpret_cast<void*>(ctiMasmProbeTrampoline)), RegisterID::eax);
-#else
     if (supportsAVX())
         move(TrustedImmPtr(reinterpret_cast<void*>(ctiMasmProbeTrampolineAVX)), RegisterID::eax);
     else
         move(TrustedImmPtr(reinterpret_cast<void*>(ctiMasmProbeTrampoline)), RegisterID::eax);
-#endif
 
     push(RegisterID::edx);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Source/JavaScriptCore/assembler/MacroAssemblerX86_64.cpp` around lines 407 -
419, Remove Darwin-specific AVX hardcoding in MacroAssemblerX86_64.cpp: at lines
407-419, generate both ctiMasmProbeTrampoline and ctiMasmProbeTrampolineAVX
unconditionally; at lines 43-46, declare the AVX trampoline on all platforms; at
lines 196-232, expose the SSE movaps save/restore macros universally; and at
lines 467-474, make MacroAssembler::probe() use supportsAVX() to select the SSE
or AVX trampoline dynamically.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@Source/JavaScriptCore/assembler/MacroAssemblerX86_64.cpp`:
- Around line 407-419: Remove Darwin-specific AVX hardcoding in
MacroAssemblerX86_64.cpp: at lines 407-419, generate both ctiMasmProbeTrampoline
and ctiMasmProbeTrampolineAVX unconditionally; at lines 43-46, declare the AVX
trampoline on all platforms; at lines 196-232, expose the SSE movaps
save/restore macros universally; and at lines 467-474, make
MacroAssembler::probe() use supportsAVX() to select the SSE or AVX trampoline
dynamically.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0752f870-b085-4b08-8fe9-6586493e7157

📥 Commits

Reviewing files that changed from the base of the PR and between 4895f45 and 8c7838b.

📒 Files selected for processing (1)
  • Source/JavaScriptCore/assembler/MacroAssemblerX86_64.cpp

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Source/JavaScriptCore/assembler/MacroAssemblerX86_64.cpp`:
- Around line 525-538: Update ctiMasmProbeTrampoline and its probe-selection
logic to remove the OS(DARWIN) special cases: do not emit or invoke the
vmovaps-based trampoline unconditionally on Darwin, and use the existing
standard fallback versus AVX dual-trampoline selection based on runtime AVX
support on every platform. Ensure probes on non-AVX Darwin systems use the
fallback trampoline.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 936fcb3a-dae8-47cc-a854-9d792e3d0d88

📥 Commits

Reviewing files that changed from the base of the PR and between 8c7838b and 49fdeac.

📒 Files selected for processing (1)
  • Source/JavaScriptCore/assembler/MacroAssemblerX86_64.cpp

Comment thread Source/JavaScriptCore/assembler/MacroAssemblerX86_64.cpp
@tobocop2
tobocop2 force-pushed the claude/darwin-avx-runtime-detection branch from 49fdeac to d73fe09 Compare July 15, 2026 17:04
tobocop2 added a commit to tobocop2/opencode-bun-pre-avx2-mac that referenced this pull request Jul 15, 2026
JSC assumed AVX on macOS in two places, not one. Fixing only the feature
detection left the probe trampoline emitting vmovaps unconditionally, which
WebAssembly reaches via BBQ loop OSR entry and tier-up — so WASM still SIGILLd.
Caught in review on oven-sh/WebKit#292.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Source/JavaScriptCore/assembler/MacroAssemblerX86_64.cpp`:
- Around line 511-524: Update Darwin’s s_avx2CheckState detection to require
s_avxCheckState is Set before accepting the hw.optional.avx2_0 sysctl result.
Match the existing non-Darwin gating logic while preserving the current fallback
when AVX2 or OS-enabled YMM state is unavailable.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: c730b687-9bbc-4455-b091-569032d90dd2

📥 Commits

Reviewing files that changed from the base of the PR and between 49fdeac and d73fe09.

📒 Files selected for processing (1)
  • Source/JavaScriptCore/assembler/MacroAssemblerX86_64.cpp

Comment thread Source/JavaScriptCore/assembler/MacroAssemblerX86_64.cpp
JSC assumed every x86_64 Mac has AVX in two places, so it emitted VEX-encoded
instructions on CPUs that cannot decode them and died with SIGILL:

  - collectCPUFeatures() hardcoded s_avxCheckState = Set on Darwin, so
    supportsAVX() reported true and the ~10 VEX codegen sites in
    MacroAssemblerX86_64.h emitted AVX once code tiered up.
  - The probe trampoline used vmovaps unconditionally on Darwin, and probe()
    selected it without consulting supportsAVX(). This is reachable from
    WebAssembly (WasmBBQJIT loop OSR entry and tier-up, WasmOMGIRGenerator's
    catch prologue), not only from the debug-gated OSR-exit paths.

oven-sh#198 fixed the first bug for Linux/Windows and guarded the new code with
#if !OS(DARWIN), leaving Darwin on the old assumption. Use the same runtime
checks and the same dual-trampoline selection on Darwin, and un-gate readXCR0()
so it is available there.

Also gate Darwin's AVX2 detection on the AVX result, matching the non-Darwin
path. AVX2 is VEX-encoded and needs OS-enabled YMM state, so now that AVX is a
runtime check the two must not be able to disagree.

The assumption holds for every Mac Apple shipped with a supported macOS (Sandy
Bridge, 2011, and later). It does not hold on an older Mac running current macOS
via OpenCore, nor under Rosetta 2, which reports no AVX.

Non-Darwin is unaffected: the preprocessed output of this file for
!OS(DARWIN) is byte-identical before and after.

Reported by Wolfgang Fahl on a Xeon X5690 (Westmere, no AVX).
@tobocop2
tobocop2 force-pushed the claude/darwin-avx-runtime-detection branch from d73fe09 to 384b31c Compare July 15, 2026 17:22
@tobocop2

Copy link
Copy Markdown
Author

On the Description check — I think this one is a false positive, and I'd rather say so than reformat into something this fork doesn't use.

.github/pull_request_template.md is inherited from upstream WebKit: it points at bugs.webkit.org, Tools/Scripts/git-webkit, and "The WebKit project". oven-sh/WebKit doesn't follow it. Of the last 20 merged PRs here:

count
use Reviewed by 0 / 20
link Bugzilla 3 / 20 — and all three are Upgrade to upstream WebKit <sha>, i.e. upstream syncs that legitimately cite upstream bugs

The convention this repo actually uses is a ## Problem section with prose and tables — see #289, #285, #275. That's what this PR does.

There's also no Bugzilla bug to link: this is a Darwin-only bug in oven-sh's fork, introduced by the #if !OS(DARWIN) guard added in #198, which is not an upstream WebKit change. Filing it upstream would point at code upstream doesn't have. It's tracked in oven-sh/bun#34215 instead, which is linked in the description.

Happy to add a Reviewed by line if a maintainer wants one, but per the 0/20 above it doesn't look like the convention here.

@tobocop2

Copy link
Copy Markdown
Author

@coderabbitai full review

The last review covered d73fe09. 384b31c since then adds the AVX2 gating you flagged — please re-check the whole file, including anything outside the diff.

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

@tobocop2 Thanks for the detailed breakdown — the data on Reviewed by usage (0/20) and Bugzilla links only appearing in upstream sync PRs makes sense, and the Darwin-fork-specific nature of this bug (no upstream equivalent) is a reasonable explanation for skipping a Bugzilla link. I won't flag the description format going forward for this repo's convention.

I'll kick off a full review of the PR, paying particular attention to Source/JavaScriptCore/assembler/MacroAssemblerX86_64.cpp in its entirety (not just the diff since d73fe09), including the AVX2 gating added in 384b31c.


✏️ Learnings added
Learnt from: tobocop2
URL: https://github.com/oven-sh/WebKit/pull/292

Timestamp: 2026-07-15T18:21:10.523Z
Learning: Repository oven-sh/WebKit (fork of WebKit) does not follow the inherited `.github/pull_request_template.md` conventions from upstream WebKit (which reference bugs.webkit.org, Tools/Scripts/git-webkit, "Reviewed by" lines). Based on analysis of the last 20 merged PRs, 0/20 used a "Reviewed by" line, and Bugzilla links only appear in "Upgrade to upstream WebKit <sha>" sync PRs. This fork's actual convention is a `## Problem` section with prose and tables (see PRs `#289`, `#285`, `#275`). Do not flag PR descriptions in this repo for missing "Reviewed by" lines or Bugzilla links unless the PR is an upstream sync PR.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

✅ Action performed

Full review finished.

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