Skip to content

deps: V8: cherry-pick 5cbd9b7e4f96 - #68017

Open
sxa wants to merge 1 commit into
nodejs:v27.x-stagingfrom
sxa:v27.x-rvvbackport
Open

sxa wants to merge 1 commit into
nodejs:v27.x-stagingfrom
sxa:v27.x-rvvbackport

Conversation

@sxa

@sxa sxa commented Dec 4, 2026

Copy link
Copy Markdown
Member

FYI @nodejs/v8 I will do a separate backport PR to node 26 for V8 14.6. Due to some refactoring the patch will be a bit different but I do already got a version which works. This fixes a number of problems with Node on RISC-V machines with vector support (as it happens more than just when vlen=1024!)

Original commit message:

[riscv] Allow vlen=1024

This resolves the remaining crashes observed in Node.js at
https://github.com/nodejs/node/issues/64538 allowing execution on
systems with vlen=1024 such as the K3's A100 cores including raising
kMaxRvvVLEN from 512 to 1024.  the code has a refactored helper
function to abstract out some of the changes across the SetSimd*
functions.  The changes to the tests allow them to pass successfully in
vlen=1024 environment with functionality for lower vlen's unaffected.

Test: Run the code snippet from
https://github.com/nodejs/node/issues/64538#issuecomment-5328340054 -
it will give an illegal exception on a system with a vlen of 1024
without this patch.  If someone else can test it on other systems that
would be good as I have only verified it on the K3's vlen=256 and
vlen=1024 cores (and also by building Node.js with these changes and
verifying that npm no longer crashes).

The main functional piece of the patch is quite small, but there have
been a number of changes to the unit tests required to support this
which are included in this CL.  The updated tests have been executed on
vlen sizes of 256 and 1024 and pass.

This patch was assisted by cursor AI.

R=yahan@iscas.ac.cn

Signed-off-by: Stewart Addison <sxa@ibm.com>
Change-Id: I752f9ae23d3e605dbcf5bd8d97d104b0a788e5c6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8585179
Reviewed-by: Ji Qiu <qiuji@iscas.ac.cn>
Reviewed-by: Yahan Lu (LuYahan) <yahan@iscas.ac.cn>
Commit-Queue: Ji Qiu <qiuji@iscas.ac.cn>
Cr-Commit-Position: refs/heads/main@{#111579}

Refs: v8/v8@5cbd9b7

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/gyp
  • @nodejs/security-wg
  • @nodejs/v8-update

@nodejs-github-bot nodejs-github-bot added build Issues and PRs related to Node.js builds or CI infrastructure. needs-ci PRs that need a full CI run. v27.x Issues that can be reproduced on v27.x or PRs targeting the v27.x-staging branch. v8 engine Issues and PRs related to the V8 dependency. labels Dec 4, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@legendecas legendecas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There are .orig and .rej files committed.

Original commit message:

    [riscv] Allow vlen=1024

    This resolves the remaining crashes observed in Node.js at
    nodejs#64538 allowing execution on
    systems with vlen=1024 such as the K3's A100 cores including raising
    kMaxRvvVLEN from 512 to 1024.  the code has a refactored helper
    function to abstract out some of the changes across the SetSimd*
    functions.  The changes to the tests allow them to pass successfully in
    vlen=1024 environment with functionality for lower vlen's unaffected.

    Test: Run the code snippet from
    nodejs#64538 (comment) -
    it will give an illegal exception on a system with a vlen of 1024
    without this patch.  If someone else can test it on other systems that
    would be good as I have only verified it on the K3's vlen=256 and
    vlen=1024 cores (and also by building Node.js with these changes and
    verifying that npm no longer crashes).

    The main functional piece of the patch is quite small, but there have
    been a number of changes to the unit tests required to support this
    which are included in this CL.  The updated tests have been executed on
    vlen sizes of 256 and 1024 and pass.

    This patch was assisted by cursor AI.

    R=yahan@iscas.ac.cn

    Signed-off-by: Stewart Addison <sxa@ibm.com>
    Change-Id: I752f9ae23d3e605dbcf5bd8d97d104b0a788e5c6
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8585179
    Reviewed-by: Ji Qiu <qiuji@iscas.ac.cn>
    Reviewed-by: Yahan Lu (LuYahan) <yahan@iscas.ac.cn>
    Commit-Queue: Ji Qiu <qiuji@iscas.ac.cn>
    Cr-Commit-Position: refs/heads/main@{#111579}

Refs: v8/v8@5cbd9b7
@sxa
sxa force-pushed the v27.x-rvvbackport branch from ea74181 to 16d8ccc Compare December 4, 2026 17:49
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Issues and PRs related to Node.js builds or CI infrastructure. needs-ci PRs that need a full CI run. v8 engine Issues and PRs related to the V8 dependency. v27.x Issues that can be reproduced on v27.x or PRs targeting the v27.x-staging branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants