Repository navigation
refactor: simplify SDK JSON parsing with simdjson - #314
Conversation
Closes #311. Replace custom scanners and incoming Struct/Value bridges with shared private parsing, preserving protobuf JSON compatibility. Generated with AI assistance.
Use field-result accessors supported across simdjson 3.x. Install development and runtime packages in both tutorial images.
Alpine's development package exports a static CMake target whose archive is provided separately by simdjson-static.
|
@codex review this PR |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f07b8bafc8
ℹ️ 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".
Replace duplicate repeated/message fields instead of merging them and reject duplicates in protobuf fallbacks. Bound cached parser capacity to 1 MiB, add wide parsing benchmark thresholds, and require compatible Linux releases for automatic dependency installation. Extend existing C++ coverage and document the manual dependency installation path.
|
@codex review this again pls |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
LGTM |
Summary
Closes #311. Client and server JSON parsing now shares a private simdjson implementation. It validates complete input, owns padded buffers and parser lifetimes, reuses parsers per thread without a global lock, and preserves original numeric tokens for typed decoding.
Struct/Valueround trips, and the ListTasks/SSE result-replacement paths. Delete the scanner-only tests, benchmarks and thresholds. The SDK sources/headers contain about 540 fewer lines; there are two fewer CTest checks overall.book/src/compatibility/json-parsing.md. Automatic Linux dependency installation requires Ubuntu 24.04+ or Debian 12+; the installation guide provides a manual simdjson prefix for older releases.Release compatibility: development toward v0.6.0 removes
a2a/core/json_value.hand limits general JSON input to 64 MiB / nesting depth 128. The released v0.5.2 behavior is unchanged.Measurements
Same Linux host, GCC 15.3, protobuf 3.21.12, simdjson 3.12.3, Release builds with signing disabled. Candidate
64ea023and baselinebed242dused identical benchmark definitions. Median CPU microseconds, three repetitions, 0.1-second minimum per repetition on a shared host:Warmed C++
new/new[]calls per parse fell from 305 to 10 for small messages, 487 to 25 for cards, 479 to 60 for SSE payloads, and 5,161 to 1,668 for the large payload. These counts exclude directmalloccalls and retained parser buffers. Peak process RSS remained approximately 13 MiB. In-process timings and parser-only results do not establish network latency/throughput improvements; large HTTP+JSON ListTasks processing was nearly unchanged.Authorship and AI usage
Implementation, tests, build/dependency updates and documentation were generated by an AI agent.
Testing
./scripts/verify_changes.shexited 0 before committinge727535, with Ubuntu simdjson 3.6.4, GCC 14.2 and Clang 18.1.8: formatting, Debug/signing-enabled/PostgreSQL build, 804 CTest checks with two expected in-process TLS skips, and all 135 clang-tidy file checks.Changed parser sources compile against simdjson 3.0.1.
Tutorials CI passes at
e727535, including host and Docker tutorial builds. Local tutorial validation also passed with simdjson 3.6.4 during the initial migration. Tutorial images install simdjson development, static and runtime packages; Alpine's CMake export requires the separately packaged static archive.Both signing-enabled Debug and signing-disabled Release configurations build. Installed signing-disabled package consumer builds and runs.
Exact-value compatibility probe for a dynamic protobuf
map<string,int64>passed, including the int64 maximum and an unquoted integer beyond binary64's exact range.Eight ProtoJSON parsing benchmarks pass the scoped Go threshold check, including all five newly covered cases; three repetitions with a 0.1-second minimum. The new limits have roughly 6–13× headroom over measured medians on this host.
Installer dry-run tests accept Ubuntu 24.04 / Debian 12 and reject Ubuntu 22.04 / Debian 11 / unsupported Linux distributions before package installation.
Performance smoke: 54 rows, zero errors, gRPC and HTTP+JSON with the in-memory backend, including wire scenarios.
mdbook build booksucceeds;git diff --checksucceeds.Unmodified upstream TCK
d4d6fae7887f88ef607fb461c13e3b0e1802f19b: gRPC, JSON-RPC and HTTP+JSON with both stores. Each store: 249 passed, 16 conditional skips, zero failed assertions.All seven PR workflows passed at
e727535: main CI, TCK, CodeQL, Tutorials, Docs, Go benchmark runner, and commit messages. Main CI passed all 14 jobs, including Windows, macOS, benchmarks, sanitizers, interoperability, and performance checks.Known validation gaps: upstream reports 80.9% mandatory / 80.0% overall because 25 registered requirements have no executable fixtures. No requirements, test fixtures, filters or reports were weakened. The maintainer explicitly authorized committing with at least 80% TCK compliance. OSV Scanner 2.7.0 was run, but its
api.osv.devquery was blocked by the environment proxy (CONNECT 403); this is not a successful vulnerability scan.Checklist
./scripts/verify_changes.shpassed locally