Skip to content

fix: harden low-level codec boundaries - #3987

Merged
chaokunyang merged 21 commits into
apache:mainfrom
chaokunyang:low-level-codec-hardening
Aug 27, 2026
Merged

fix: harden low-level codec boundaries#3987
chaokunyang merged 21 commits into
apache:mainfrom
chaokunyang:low-level-codec-hardening

Conversation

@chaokunyang

Copy link
Copy Markdown
Collaborator

Summary

  • harden low-level buffer growth, cursor, copy, and native memory access boundaries across Java,
    C++, Python, Go, Rust, Swift, Dart, and JavaScript
  • correct 36-bit string-header encoding at the six-byte boundary and guard oversized headers before
    they can drive unsafe reads or disproportionate growth
  • preserve runtime-specific hot paths through owner-local unchecked operations only after capacity
    or range has already been proven
  • document the JDK 25 VarHandle bounds owner and the MemoryAllocator successful-growth contract
  • retain controlled temporal and native-carrier conversions without adding write-side depth checks

Validation

  • affected runtime unit, formatting, lint, build, and integration suites pass
  • Java 21 nine-module clean reactor passes
  • Java 25 core multi-release build and overlay tests pass
  • all affected-language serialization benchmark metrics are below the 1% regression threshold

@chaokunyang
chaokunyang merged commit 74b7134 into apache:main Aug 27, 2026
97 checks passed
chaokunyang added a commit that referenced this pull request Aug 27, 2026
## Why?



## What does this PR do?



## Related issues

#3987 

## AI Contribution Checklist



- [ ] Substantial AI assistance was used in this PR: `yes` / `no`
- [ ] If `yes`, I included a completed [AI Contribution
Checklist](https://github.com/apache/fory/blob/main/AI_POLICY.md#9-contributor-checklist-for-ai-assisted-prs)
in this PR description and the required `AI Usage Disclosure`.
- [ ] If `yes`, my PR description includes the required `ai_review`
summary and screenshot evidence or equivalent persisted links of the
final clean AI review results from both fresh reviewers described in
`AI_POLICY.md`, the Fory-guided reviewer and the independent general
reviewer, on the current PR diff or current HEAD after the latest code
changes.



## Does this PR introduce any user-facing change?



- [ ] Does this PR introduce any public API change?
- [ ] Does this PR introduce any binary protocol compatibility change?

## Benchmark

---------

Co-authored-by: Release Validation Test <dev@fory.apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants