Skip to content

PYTHON-5683: Spike: Investigate using Rust for Extension Modules#2699

Draft
aclark4life wants to merge 4 commits intomongodb:PYTHON-5683from
aclark4life:PYTHON-5683
Draft

PYTHON-5683: Spike: Investigate using Rust for Extension Modules#2699
aclark4life wants to merge 4 commits intomongodb:PYTHON-5683from
aclark4life:PYTHON-5683

Conversation

@aclark4life
Copy link
Contributor

@aclark4life aclark4life commented Feb 6, 2026

Supersedes #2689


Spike: Investigate using Rust for Extension Modules

  • Implement comprehensive Rust BSON encoder/decoder with 100% test compatibility (88/88 tests passing)
  • Add Evergreen CI configuration and test scripts
  • Add GitHub Actions workflow for Rust testing
  • Add runtime selection via PYMONGO_USE_RUST environment variable
  • Add performance benchmarking suite
  • Update build system to support Rust extension with Maturin
  • Add comprehensive documentation (bson/_rbson/README.md)

@codecov-commenter

This comment was marked as outdated.

@aclark4life aclark4life force-pushed the PYTHON-5683 branch 7 times, most recently from 8c59ac1 to 6599757 Compare February 13, 2026 01:28
@aclark4life aclark4life marked this pull request as ready for review February 13, 2026 01:47
@aclark4life aclark4life requested a review from a team as a code owner February 13, 2026 01:47
@aclark4life aclark4life requested a review from Jibola February 13, 2026 01:47
@codeowners-service-app
Copy link

Assigned NoahStapp for team dbx-python because Jibola is out of office.

@aclark4life aclark4life changed the base branch from master to PYTHON-5683 February 13, 2026 01:50
- Implement comprehensive Rust BSON encoder/decoder
- Add Evergreen CI configuration and test scripts
- Add GitHub Actions workflow for Rust testing
- Add runtime selection via PYMONGO_USE_RUST environment variable
- Add performance benchmarking suite
- Update build system to support Rust extension
- Add documentation for Rust extension usage and testing"
- TestCustomPythonBSONTypeToBSONMonolithicCodec
- TestCustomPythonBSONTypeToBSONMultiplexedCodec
- TestBSONTypeEnDeCodecs
- TestTypeRegistry
- TestGridFileCustomType
- TestCollectionChangeStreamsWCustomTypes
- TestDatabaseChangeStreamsWCustomTypes
- TestClusterChangeStreamsWCustomTypes

These tests require custom type encoder/decoder support which is not
implemented in the Rust extension. Skipping them prevents the 56 test
failures related to Decimal/Decimal128 type handling.
- TestRawBatchCursor and TestRawBatchCommandCursor (RawBSONDocument not implemented)
- TestBSONCorpus (BSON validation/error detection not fully implemented)
- test_uuid_subtype_4, test_legacy_java_uuid, test_legacy_csharp_uuid (legacy UUID representations not implemented)

These features are not implemented in the Rust extension and would require
significant additional work. Skipping these tests prevents 35 failures.
- Remove references to non-existent benchmark files
- Add comprehensive instructions for running perf_test.py
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