Skip to content

fix(engine): an inlined Array#sort no longer stores Int32 elements as doubles - #58

Merged
Kushalkhemka merged 1 commit into
pi-boltfrom
runtime/wk-792
Oct 18, 2026
Merged

Kushalkhemka merged 1 commit into
pi-boltfrom
runtime/wk-792

Conversation

@Kushalkhemka

Copy link
Copy Markdown
Member

oven-sh/WebKit#792, appended to patches/webkit.patch: with the JIT on, the DFG could inline an Array#sort whose comparator does double arithmetic and return the Int32 array's elements out of order, as boxed doubles.

const f = (v, w, x, y) => [v, w, x, y].sort((a, b) => (a + 0.5) - (b + 0.5));
// 200,000 calls of f(17, 8, 1, 1) on 0.9.4's runtime: 125,629 wrong ("8,1,1,17"); with BUN_JSC_useDFGJIT=false: 0

The -jit builds were affected. The default builds were not: tests/aot/sort-comparators.mjs (new, in the default lists of tests/aot/run.sh) passes on 0.9.4's runtime in all three AOT modes, and now guards them.

Runtimes for this commit: the runtime workflow on runtime/wk-792 (run 39165966034).

… doubles

oven-sh/WebKit#792, appended to the WebKit patch series: with the JIT on, a sort
with a comparator doing double arithmetic, inlined by the DFG, could return its
Int32 elements out of order as boxed doubles. tests/aot/sort-comparators.mjs
guards the ahead-of-time builds, which were not affected.
Copilot AI balanced review requested due to automatic review settings October 18, 2026 22:12

@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.

⚠️ Code review skipped — your organization has no extra usage available to pay for this review.

If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.

Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-18T22:16:21.064437Z c7a28eb PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c7a28eb8b6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/aot/run.sh Resolved
@Kushalkhemka
Kushalkhemka merged commit f51fbc8 into pi-bolt Oct 18, 2026
17 checks passed
@Kushalkhemka
Kushalkhemka deleted the runtime/wk-792 branch October 20, 2026 07:38
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.

3 participants