Repository navigation
Conversation
dellaert
marked this pull request as draft
October 14, 2026 17:46
Member
Author
|
Still making changes on this |
dellaert
marked this pull request as ready for review
October 14, 2026 18:54
Member
Author
|
This pretends to implement what you wanted in the other PR. This took several prompts and I even looked at the code a bit :-). Please let me know what you think. I'll kick off a copilot review in parallel. |
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Cross-library C++ ABI and Boost isolation require human review, and a blocking finding remains unresolved.
1 open finding
What changed in this PR
Adds an opt-in shared serialization owner for Python extensions, addressing #211 without downstream-specific changes.
Changes:
- Generates centralized Boost registrations and typed save/load functions.
- Connects managed bindings through CMake and a generated manifest.
- Adds documentation and cross-platform runtime validation.
| File | Description |
|---|---|
| tests/test_serialization_runtime.py | Validates runtime behavior, installation, and exports. |
| tests/test_serialization_library.py | Checks generated API and registrations. |
| tests/test_serialization_discovery.py | Tests selection and identifier collisions. |
| tests/test_serialization_bindings.py | Tests managed and legacy bindings. |
| tests/fixtures/serialization_library/windows_static_boost_exports.txt | Lists permitted Windows helper exports. |
| tests/fixtures/serialization_library/unrelated.cpp | Exercises independent Boost runtime isolation. |
| tests/fixtures/serialization_library/types.i | Declares serializable fixture types. |
| tests/fixtures/serialization_library/types.h | Implements polymorphic fixture types. |
| tests/fixtures/serialization_library/module.tpl | Provides the fixture binding template. |
| tests/fixtures/serialization_library/legacy.cpp | Tests legacy archive compatibility. |
| tests/fixtures/serialization_library/consumer_b.i | Defines the second consumer. |
| tests/fixtures/serialization_library/consumer_a.i | Defines the first consumer. |
| tests/fixtures/serialization_library/CMakeLists.txt | Builds and installs integration fixtures. |
| tests/fixtures/serialization_library/check.py | Checks installed consumers and archive exchange. |
| scripts/pybind_wrap.py | Accepts serialization manifests. |
| scripts/pybind_serialization.py | Adds the owner-generation command. |
| gtwrap/serialization.py | Discovers serialization declarations. |
| gtwrap/serialization_library.py | Generates the archive owner and API. |
| gtwrap/pybind_wrapper.py | Routes managed bindings through the owner. |
| DOCS.md | Documents integration and migration requirements. |
| CMakeLists.txt | Installs the generator and adds test targets. |
| cmake/PybindWrap.cmake | Adds owner and consumer integration. |
| cmake/gtwrapConfig.cmake.in | Configures installed generator paths. |
| .github/workflows/serialization.yml | Adds platform and Boost-linkage coverage. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| library_id = hashlib.sha256(name.encode()).hexdigest()[:16] | ||
| macro = f'GTWRAP_SERIALIZATION_{library_id.upper()}_API' | ||
| building = macro + '_BUILDING' | ||
| api_name = name + '.h' |
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.

Adds an opt-in shared library that owns Boost registrations and text-archive operations for multiple Python extensions, with static or shared Boost. Existing wrapping stays unchanged. Part of #211; no GTSAM-specific code or downstream changes.
Reviewing guide — start with these three files
.serialize(),.deserialize(), and pickle bindings call the owner and suppress local registrations, while unselected types retain existing behavior.pybind_add_serialization_library, the trailingSERIALIZATION_LIBRARYoption, private Boost linkage, generation dependencies, and source-tree/installed-package paths.Contract
Consumers supply the complete polymorphic serialization domain, use compatible C++ ABIs/runtimes, and own installation and runtime search paths. Legacy archive identifiers and pickle's one-element tuple are preserved.
Windows static-Boost exception: precompiled MSVC libraries force some helper exports. CI permits only 28 exact reviewed names for this configuration; they are unsupported implementation details. Unknown exports and missing entry points still fail, and isolation from an unrelated Boost runtime remains mandatory. Other configurations require exactly the generated entry points.
Validation
py312: 143 tests + 9 subtests pass, including existing Python/MATLAB generation tests.No MATLAB runtime or GTSAM extension build was performed.