Phase 11: close BigInt, depth, and exception safety gaps - #38
Merged
Conversation
- require Go and native rejection above depth 1024 - isolate maximum-depth malformed replay in a child process
- reject depths above 1024 before native selection or allocation - share one native ceiling across replay and materialization
- document zero or 1 through 1024 as the accepted range - regenerate the public header from the Rust declarations
- cover malformed suffixes including embedded NUL bytes - preserve exact valid roots and nested values across delimiters
- validate delimiters before every BigInt early return - fail builds on guarded-branch parity drift across architectures
- cover positive and negative root suffix corruption - cover nested array and object token boundaries
- add sorted reject expectations for four token suffix fixtures - preserve every existing oracle expectation and valid BigInt control
- Extend the hidden exception seam with fixed test selectors - Cover runtime_error, bad_alloc, and unsupported selectors - Prove bad_alloc returns 127 before the mapper fix
- Align trapped bad_alloc with the normative exception status - Preserve returned MEMALLOC and internal error mappings - Keep both production catch macros on the shared mapper
- Run selector 3 in an exact-filter child process - Require exact status 97, one child test, and a success marker - Fail on child termination, wrong status, or missing evidence
- Record a fixed allocation-safe diagnostic before status mapping - Route selector 3 through the production parser-aware catch macro - Fail closed if the private helper mutates its output sentinel
Tasks completed: 1/1 - Contain parser-aware bad_alloc and prove survival through the production catch macro SUMMARY: .planning/phases/11-upstream-simdjson-refresh-bigint-and-diagnostics/11-18-SUMMARY.md
PR Benchmark - no regressionsThreshold: >= 5.00% slower and p < 0.050. This check is advisory; the PR is not blocked. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 11: Upstream simdjson refresh, exact big integers, and production diagnostics
Goal: Establish the v0.2 compatibility foundation with audited simdjson v4.6.4 behavior, exact oversized-integer text, safe parser controls, and truthful diagnostics.
Status: Verified ✓
This follow-up closes the safety and validation gaps found after the initial ABI 1.2 shipment. It bounds every parser-owned recursive path, rejects malformed BigInt suffixes across all generated architecture implementations, contains C++ allocation exceptions at the Rust boundary, and records complete phase verification and Nyquist evidence.
Changes
Plan 15: Maximum-depth diagnostic safety
Key files:
parser_options.go,parser_options_test.go,src/native/simdjson_bridge.cpp,tests/rust_shim_limits.rs,tests/rust_shim_diagnostics.rs,include/pure_simdjson.h,docs/ffi-contract.mdPlan 16: BigInt token-boundary validation
Key files:
patches/simdjson-v4.6.4-positive-bigint.patch,build.rs,tests/rust_shim_bigint.rs,testdata/jsontestsuite/expectations.tsvPlan 17: C++ exception status contract
simdjson::MEMALLOCand explicit internal failures on status 127.Key files:
src/native/simdjson_bridge.{h,cpp},src/runtime/mod.rs,src/lib.rs,tests/rust_shim_minimal.rsPlan 18: Parser-aware
bad_alloccontainmentKey files:
src/native/simdjson_bridge.cpp,tests/rust_shim_minimal.rsPhase closeout
Requirements Addressed
TypeBigInt/GetBigIntbehavior.Verification
passed— 104/104 must-haves.make verify-contract— 91 Rust tests, deterministic header generation, 25 ABI audits, and C layout compile.make verify-docs.go test ./... -race -count=1 -timeout=180s— all four Go packages.Key Decisions
0x00010002, public symbols, layouts, dependencies, and release behavior remain unchanged.Shipping