Skip to content

deps: update simdjson to 4.4.0#62257

Closed
nodejs-github-bot wants to merge 1 commit intomainfrom
actions/tools-update-simdjson
Closed

deps: update simdjson to 4.4.0#62257
nodejs-github-bot wants to merge 1 commit intomainfrom
actions/tools-update-simdjson

Conversation

@nodejs-github-bot
Copy link
Collaborator

This is an automated update of simdjson to 4.4.0.

@nodejs-github-bot nodejs-github-bot added the dependencies Pull requests that update a dependency file. label Mar 15, 2026
@nodejs-github-bot
Copy link
Collaborator Author

Review requested:

  • @nodejs/security-wg

@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Mar 15, 2026
@aduh95 aduh95 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Mar 15, 2026
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Mar 15, 2026
@nodejs-github-bot
Copy link
Collaborator Author

@nodejs-github-bot
Copy link
Collaborator Author

@nodejs-github-bot
Copy link
Collaborator Author

@nodejs-github-bot
Copy link
Collaborator Author

@nodejs-github-bot
Copy link
Collaborator Author

@richardlau
Copy link
Member

CI: https://ci.nodejs.org/job/node-test-pull-request/71806/

The AIX failure is real:
e.g.

14:47:40 In file included from ../deps/simdjson/simdjson.h:41859,
14:47:40                  from ../src/inspector_profiler.h:13,
14:47:40                  from ../src/env.h:30,
14:47:40                  from ../src/env-inl.h:29,
14:47:40                  from ../src/base_object-inl.h:28,
14:47:40                  from ../src/async_wrap-inl.h:28,
14:47:40                  from ../src/api/callback.cc:2:
14:47:40 /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/12/include/altivec.h:34:2: error: #error Use the "-maltivec" flag to enable PowerPC AltiVec support
14:47:40    34 | #error Use the "-maltivec" flag to enable PowerPC AltiVec support
14:47:40       |  ^~~~~

FWIW I am separately testing a PR to update the CPU target for V8 on AIX to Power 9. I think (based on gcc -Q --help=target output) that that turns on -maltivec, so I could also add that to node.gypi for building Node.js (and not just V8) on AIX. But simdjson might need to detect whether altivec is enabled on Power for general use because without a -mcpu setting GCC 12 (which we currently use) on AIX doesn't enable -maltivec by default.

cc @lemire

@nodejs-github-bot
Copy link
Collaborator Author

@lemire
Copy link
Member

lemire commented Mar 16, 2026

@richardlau

Here is the internal logic in simdjson:

// other code here
#elif defined(__PPC64__) || defined(_M_PPC64)
#define SIMDJSON_IS_PPC64 1
#if defined(__ALTIVEC__)
#define SIMDJSON_IS_PPC64_VMX 1
#endif // defined(__ALTIVEC__)

and this is used as follows...

#define SIMDJSON_IMPLEMENTATION_PPC64 (SIMDJSON_IS_PPC64 && SIMDJSON_IS_PPC64_VMX)

So we should only enable altivec when __ALTIVEC__ is defined.

Unfortunately, I do not have access to an AIX system. If you do, can you verify whether __ALTIVEC__ is defined?

Note that we can just disable the whole thing by passing SIMDJSON_IMPLEMENTATION_PPC64=0 at build time.

@lemire
Copy link
Member

lemire commented Mar 16, 2026

@richardlau To be clearer, there is no runtime dispatching when building simdjson on POWER systems. We only enable the optimized kernel when __ALTIVEC__ is defined (at compile time). Otherwise we use our non-optimized kernel.

@aduh95 aduh95 removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 16, 2026
@richardlau
Copy link
Member

@richardlau To be clearer, there is no runtime dispatching when building simdjson on POWER systems. We only enable the optimized kernel when __ALTIVEC__ is defined (at compile time). Otherwise we use our non-optimized kernel.

@lemire

bash-5.3# cat test.cpp
#include <iostream>

int main() {
  std::cout << __ALTIVEC__ << std::endl;
  return 0;
}
bash-5.3# g++-12 --version
g++-12 (GCC) 12.3.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

bash-5.3# g++-12 -o test test.cpp && ./test # default no mcpu specified
test.cpp: In function 'int main()':
test.cpp:4:16: error: '__ALTIVEC__' was not declared in this scope; did you mean '__LINE__'?
    4 |   std::cout << __ALTIVEC__ << std::endl;
      |                ^~~~~~~~~~~
      |                __LINE__
bash-5.3# g++-12 -o test -mcpu=power9 test.cpp && ./test
1
bash-5.3#

Node.js currently doesn't set mcpu for stuff outside of V8, so from e.g. https://ci.nodejs.org/job/node-test-commit-aix/61470/nodes=aix72-power9/console we end up with a command line

18:32:05   g++-12 -o /home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-power9/out/Release/obj.target/libnode/src/api/callback.o ../src/api/callback.cc '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_FILE_OFFSET_BITS=64' '-DNODE_OPENSSL_CONF_NAME=nodejs_conf' '-DICU_NO_USER_DATA_OVERRIDE' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DNODE_ARCH="ppc64"' '-DNODE_PLATFORM="aix"' '-DNODE_WANT_INTERNALS=1' '-DNAPI_EXPERIMENTAL=1' '-DNODE_API_EXPERIMENTAL_NO_WARNING=1' '-DV8_DEPRECATION_WARNINGS=1' '-DNODE_OPENSSL_SYSTEM_CERT_PATH=""' '-DSQLITE_ENABLE_SESSION' '-DNODE_USE_NODE_CODE_CACHE=1' '-DHAVE_INSPECTOR=1' '-D__POSIX__' '-DNODE_USE_V8_PLATFORM=1' '-DNODE_HAVE_I18N_SUPPORT=1' '-DNODE_BUNDLED_ZLIB' '-DNODE_BUNDLED_ZSTD' '-D_LINUX_SOURCE_COMPAT' '-DHAVE_OPENSSL=1' '-DOPENSSL_API_COMPAT=0x10100000L' '-DHAVE_AMARO=1' '-DHAVE_SQLITE=1' '-DHAVE_QUIC=0' '-DXXH_NAMESPACE=ZSTD_' '-DZSTD_MULTITHREAD' '-DZSTD_DISABLE_ASM' '-DUCONFIG_NO_SERVICE=1' '-DU_ENABLE_DYLOAD=0' '-DU_STATIC_IMPLEMENTATION=1' '-DU_HAVE_STD_STRING=1' '-DUCONFIG_NO_BREAK_ITERATION=0' '-D_LARGEFILE_SOURCE' '-DNGHTTP2_STATICLIB' '-DNDEBUG' '-DB_ENDIAN' '-DOPENSSL_BUILDING_OPENSSL' '-DAES_ASM' '-DECP_NISTZ256_ASM' '-DKECCAK1600_ASM' '-DOPENSSL_BN_ASM_MONT' '-DOPENSSL_CPUID_OBJ' '-DPOLY1305_ASM' '-DSHA1_ASM' '-DSHA256_ASM' '-DSHA512_ASM' '-DVPAES_ASM' '-DX25519_ASM' '-DOPENSSL_PIC' -I../src -I../deps/postject -I/home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-power9/out/Release/obj/gen -I/home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-power9/out/Release/obj/gen/include -I/home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-power9/out/Release/obj/gen/src -I../deps/v8/third_party/abseil-cpp -I../deps/googletest/include -I../deps/histogram/src -I../deps/histogram/include -I../deps/nbytes/include -I../deps/inspector_protocol -I/home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-power9/out/Release/obj/gen/inspector-generated-output-root/include -I../deps/ncrypto -I../deps/v8/include -I../deps/icu-small/source/i18n -I../deps/icu-small/source/common -I../deps/zlib -I../deps/llhttp/include -I../deps/cares/include -I../deps/uv/include -I../deps/uvwasi/include -I../deps/nghttp2/lib/includes -I../deps/ada -I../deps/merve -I../deps/simdjson -I../deps/v8/third_party/simdutf -I../deps/brotli/c/include -I../deps/sqlite -I../deps/zstd/lib -I../deps/openssl/openssl/include -I../deps/openssl/openssl/crypto/include -I../deps/openssl/config/archs/aix64-gcc-as/asm_avx2/include -I../deps/openssl/config/archs/aix64-gcc-as/asm_avx2  -Wall -Wextra -Wno-unused-parameter -Wno-restrict -pthread -Wall -Wextra -Wno-unused-parameter -maix64 -Wno-attributes -Werror=unused-result -Wno-error=deprecated-declarations -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -fno-strict-aliasing -std=gnu++20 -MMD -MF /home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-power9/out/Release/.deps//home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-power9/out/Release/obj.target/libnode/src/api/callback.o.d.raw   -c
...
18:32:06 In file included from ../deps/simdjson/simdjson.h:41859,
18:32:06                  from ../src/inspector_profiler.h:13,
18:32:06                  from ../src/env.h:30,
18:32:06                  from ../src/env-inl.h:29,
18:32:06                  from ../src/base_object-inl.h:28,
18:32:06                  from ../src/async_wrap-inl.h:28,
18:32:06                  from ../src/api/callback.cc:2:
18:32:06 /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/12/include/altivec.h:34:2: error: #error Use the "-maltivec" flag to enable PowerPC AltiVec support
18:32:06    34 | #error Use the "-maltivec" flag to enable PowerPC AltiVec support
18:32:06       |  ^~~~~

I've opened #62296 to set -mcpu=power9 for Node.js, this will fix the builds on AIX. But it looks like something isn't working in the default case where __ALTIVEC__ is not defined.

@richardlau
Copy link
Member

@richardlau To be clearer, there is no runtime dispatching when building simdjson on POWER systems. We only enable the optimized kernel when __ALTIVEC__ is defined (at compile time). Otherwise we use our non-optimized kernel.

@lemire, I'm looking at https://github.com/simdjson/simdjson/blob/2922822622d8fe2d8b2673b29d0818543e07e328/include/simdjson/generic/builder/json_string_builder-inl.h and I'm not seeing any __ALTIVEC__ guards.

@lemire
Copy link
Member

lemire commented Mar 17, 2026

@richardlau Ah Ah!!!

lemire added a commit to simdjson/simdjson that referenced this pull request Mar 17, 2026
lemire added a commit to simdjson/simdjson that referenced this pull request Mar 17, 2026
@lemire
Copy link
Member

lemire commented Mar 17, 2026

Release 4.4.1 should fix this issue. Thanks to @richardlau for identifying the issue.

I am going to close this PR as it should not be merged.

@lemire lemire closed this Mar 17, 2026
@aduh95 aduh95 deleted the actions/tools-update-simdjson branch March 17, 2026 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants