Skip to content

feat: default compatible mode for native serialization#3742

Merged
chaokunyang merged 7 commits into
apache:mainfrom
chaokunyang:set_compatible_mode_all_true_by_default
Jun 5, 2026
Merged

feat: default compatible mode for native serialization#3742
chaokunyang merged 7 commits into
apache:mainfrom
chaokunyang:set_compatible_mode_all_true_by_default

Conversation

@chaokunyang
Copy link
Copy Markdown
Collaborator

@chaokunyang chaokunyang commented Jun 5, 2026

Why?

Native-mode Fory instances previously defaulted to schema-consistent mode while xlang instances defaulted to compatible mode. That made the default less robust for schema evolution and left docs/tests dependent on implicit mode behavior.

What does this PR do?

  • Makes compatible mode the default construction path, including native-mode builders, while keeping explicit compatible=false available for same-schema workloads that need faster serialization and smaller size.
  • Updates Java, Python, Rust, Go, C++, and related integration tests so Fory creation sites set compatibility explicitly where the test depends on a specific mode.
  • Updates benchmark Fory construction to make the measured compatibility mode explicit.
  • Cleans language guides, READMEs, compiler docs, benchmark docs, and xlang specs so compatible mode guidance is consistent across languages.
  • Clarifies when compatible=false is appropriate: only when every reader and writer uses the same schema, or when xlang schemas are verified across languages or generated from Fory schema IDL.
  • Removes stale/confusing wording such as old native-mode defaults, misleading runtime phrasing, and examples that configured unrelated options in configuration sections.

Related issues

None.

AI Contribution Checklist

  • Substantial AI assistance was used in this PR: yes / no
  • If yes, I included a completed AI Contribution Checklist in this PR description and the required AI Usage Disclosure.
  • If yes, my PR description includes the required ai_review summary and screenshot evidence of the final clean AI review results from both fresh reviewers on the current PR diff or current HEAD after the latest code changes.

AI Usage Disclosure

This PR used AI assistance to audit cross-language docs, update compatible-mode guidance, add explicit compatibility settings in tests and benchmarks, and iterate on CI failures. The author reviewed the generated changes, ran focused local verification, and monitored GitHub Actions to green.

ai_review

  • Fresh review rounds were run during the docs cleanup and CI-fix loop.
  • The final gpt-5.5 high review of the CI-fix diff reported: No actionable findings.
  • GitHub Actions for the latest PR head completed successfully after the final commit.
  • Screenshot evidence is not attached in this PR body.

Does this PR introduce any user-facing change?

Yes. Compatible mode is now the default for Fory construction, including native mode. Users who always serialize and deserialize with the same schema can set compatible=false explicitly for faster serialization and smaller size.

  • Does this PR introduce any public API change?
  • Does this PR introduce any binary protocol compatibility change?

Benchmark

No benchmark result changes are included. Benchmark setup code was updated so Fory compatibility mode is explicit after the default change.

@chaokunyang chaokunyang force-pushed the set_compatible_mode_all_true_by_default branch from 38c1a49 to 356174f Compare June 5, 2026 09:04
@chaokunyang chaokunyang merged commit 793e9ab into apache:main Jun 5, 2026
77 checks passed
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