Skip to content

GH-50901: [C++] Replace RapidJSON with simdjson in tensor extension types - #50874

Merged
pitrou merged 12 commits into
apache:mainfrom
Reranko05:gh-35460-extension
Aug 25, 2026
Merged

GH-50901: [C++] Replace RapidJSON with simdjson in tensor extension types#50874
pitrou merged 12 commits into
apache:mainfrom
Reranko05:gh-35460-extension

Conversation

@Reranko05

@Reranko05 Reranko05 commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

Rationale for this change

This PR continues the simdjson migration by replacing RapidJSON usage in the FixedShapeTensorType and VariableShapeTensorType extension types with simdjson's DOM API.

Changes

  • Replace RapidJSON parsing in FixedShapeTensorType::Deserialize with simdjson.
  • Replace RapidJSON parsing in VariableShapeTensorType::Deserialize with simdjson.
  • Centralize the reusable simdjson DOM helpers in arrow/util/simdjson_internal.h.
  • Add helpers for parsing JSON objects, retrieving optional fields, and validating JSON arrays and their element types.
  • Remove the obsolete RapidJSON-specific helpers and includes from the tensor extension utilities.
  • Preserve existing deserialization behavior and error validation, including the ordering of metadata-level validation errors.
  • Update deserialization tests to match simdjson JSON type names.

@github-actions

Copy link
Copy Markdown

Thanks for opening a pull request!

This pull request has been automatically converted to a draft because its title doesn't match Arrow's required format.

If this is not a minor PR. Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose

Opening GitHub issues ahead of time contributes to the Openness of the Apache Arrow project.

Then could you also rename the pull request title in the following format?

GH-${GITHUB_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}

or

MINOR: [${COMPONENT}] ${SUMMARY}

After updating the title, you can mark the pull request as ready for review.

See also:

@Reranko05 Reranko05 added the CI: Extra: C++ Run extra C++ CI label Aug 15, 2026
@Reranko05 Reranko05 changed the title [WIP] GH-50873: [C++] Migrate FixedShapeTensorType deserialization to simdjson GH-50901: [C++] Replace RapidJSON with simdjson in tensor extension types Aug 18, 2026
@Reranko05
Reranko05 marked this pull request as ready for review August 18, 2026 10:57
@Reranko05
Reranko05 requested a review from pitrou as a code owner August 18, 2026 10:57
Copilot AI lite review requested due to automatic review settings August 18, 2026 10:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

@Reranko05
Reranko05 requested review from kou and rok August 18, 2026 10:57
Copilot AI review requested due to automatic review settings August 18, 2026 18:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread cpp/src/arrow/extension/fixed_shape_tensor.cc Outdated
@github-actions github-actions Bot added awaiting changes Awaiting changes and removed awaiting review Awaiting review labels Aug 18, 2026
Copilot AI review requested due to automatic review settings August 19, 2026 07:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Aug 19, 2026
@Reranko05
Reranko05 requested a review from kou August 19, 2026 07:49
Comment thread cpp/src/arrow/extension/tensor_extension_array_test.cc
@github-actions github-actions Bot added awaiting changes Awaiting changes and removed awaiting change review Awaiting change review labels Aug 19, 2026
Comment thread cpp/src/arrow/extension/fixed_shape_tensor.cc Outdated
Comment thread cpp/src/arrow/extension/tensor_extension_array_test.cc
Copilot AI review requested due to automatic review settings August 20, 2026 08:32
@github-actions github-actions Bot added the awaiting change review Awaiting change review label Aug 24, 2026
@rok
rok requested a balanced review from Copilot August 24, 2026 18:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread cpp/src/arrow/util/simdjson_internal.h
Copilot AI review requested due to automatic review settings August 24, 2026 18:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

@Reranko05
Reranko05 requested a review from pitrou August 24, 2026 18:57

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

This looks much better now!

Comment thread cpp/src/arrow/util/simdjson_internal.h Outdated
@pitrou

pitrou commented Aug 25, 2026

Copy link
Copy Markdown
Member

@HuaHuaY @rok Do you want to give this another look?

Co-authored-by: Antoine Pitrou <pitrou@free.fr>
Copilot AI review requested due to automatic review settings August 25, 2026 10:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread cpp/src/arrow/util/simdjson_internal.h Outdated

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

Other then the BIGINT - LGTM!

@github-actions github-actions Bot added awaiting changes Awaiting changes awaiting merge Awaiting merge and removed awaiting change review Awaiting change review awaiting changes Awaiting changes labels Aug 25, 2026

@HuaHuaY HuaHuaY left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me.

Comment thread cpp/src/arrow/extension/variable_shape_tensor.cc
@github-actions github-actions Bot removed the awaiting merge Awaiting merge label Aug 25, 2026
@pitrou

pitrou commented Aug 25, 2026

Copy link
Copy Markdown
Member

@github-actions crossbow submit -g cpp

@github-actions

Copy link
Copy Markdown

Revision: 6614716

Submitted crossbow builds: ursacomputing/crossbow @ actions-f28d5d23af

Task Status
example-cpp-minimal-build-static GitHub Actions
example-cpp-minimal-build-static-system-dependency GitHub Actions
example-cpp-tutorial GitHub Actions
test-build-cpp-fuzz GitHub Actions
test-conda-cpp GitHub Actions
test-conda-cpp-valgrind GitHub Actions
test-debian-13-cpp-amd64 GitHub Actions
test-debian-13-cpp-i386 GitHub Actions
test-debian-experimental-cpp-gcc-15 GitHub Actions
test-fedora-42-cpp GitHub Actions
test-ubuntu-22.04-cpp GitHub Actions
test-ubuntu-22.04-cpp-bundled GitHub Actions
test-ubuntu-22.04-cpp-emscripten GitHub Actions
test-ubuntu-22.04-cpp-no-threading GitHub Actions
test-ubuntu-24.04-cpp GitHub Actions
test-ubuntu-24.04-cpp-bundled-offline GitHub Actions
test-ubuntu-24.04-cpp-gcc-13-bundled GitHub Actions
test-ubuntu-24.04-cpp-gcc-14 GitHub Actions
test-ubuntu-24.04-cpp-minimal-with-formats GitHub Actions
test-ubuntu-24.04-cpp-thread-sanitizer GitHub Actions

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

@pitrou

pitrou commented Aug 25, 2026

Copy link
Copy Markdown
Member

CI failures are unrelated - except for example-cpp-tutorial which was already failing.

@rok

rok commented Aug 25, 2026

Copy link
Copy Markdown
Member

CI failures are unrelated - except for example-cpp-tutorial which was already failing.

pinged #35460 (comment)

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants