-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix: Find VeloxType singletons for CustomType when embedded in OpaqueType objects #15829
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
AshishCbMisra
wants to merge
2
commits into
facebookincubator:main
Choose a base branch
from
AshishCbMisra:export-D89564769
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
fix: Find VeloxType singletons for CustomType when embedded in OpaqueType objects #15829
AshishCbMisra
wants to merge
2
commits into
facebookincubator:main
from
AshishCbMisra:export-D89564769
+232
−13
Conversation
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
✅ Deploy Preview for meta-velox canceled.
|
|
@AshishCbMisra has exported this pull request. If you are a Meta employee, you can view the originating Diff in D89564769. |
c88f314 to
24a3f15
Compare
AshishCbMisra
pushed a commit
to AshishCbMisra/velox
that referenced
this pull request
Dec 22, 2025
…Type objects (facebookincubator#15829) Summary: ## Background - This diff is to fix a bug in the Types::create() method for CustomType. - The bug manifests in the SignatureBinder.bind() operation failing to match for a CustomType argument. - The CustomType is basically an OpaqueType object. - The root cause is that two different registries store OpaqueType objects. - Custom Type Registry → VeloxType singleton (correct name()) - OpaqueSerdeRegistry → Base OpaqueType (name() = "OPAQUE") - When deserializing the custom type in Type::create() method, the code does not find VeloxType singleton, hence created an OpaqueType. - The CustomType returns its name in its custom name in the name() and toString() methods, whereas the OpaqueType returns "OPAQUE<demangled-name>" in its name/toString() methods. ## In this Diff - The primary problem is that the CustomType has a Velox singleton for its type. However, type is serialized and deserialized, the type produced is an Opaque type, with custom type inside. - In this diff, the velox deserialization correctly finds and produces the VeloxType singleton. ## Implementation Changes - Types.cpp - Implemented searching and deserializing CustomType within OpaqueTypes in Type::create() method. ## Testing Changes - OpaqueCustomTypesTest.cpp - Added test to serialize/deserialize a CustomType and confirm that VeloxType singleton is returned. Differential Revision: D89564769
24a3f15 to
4a97d0d
Compare
AshishCbMisra
pushed a commit
to AshishCbMisra/velox
that referenced
this pull request
Dec 22, 2025
…Type objects (facebookincubator#15829) Summary: ## Background - This diff is to fix a bug in the Types::create() method for CustomType. - The bug manifests in the SignatureBinder.bind() operation failing to match for a CustomType argument. - The CustomType is basically an OpaqueType object. - The root cause is that two different registries store OpaqueType objects. - Custom Type Registry → VeloxType singleton (correct name()) - OpaqueSerdeRegistry → Base OpaqueType (name() = "OPAQUE") - When deserializing the custom type in Type::create() method, the code does not find VeloxType singleton, hence created an OpaqueType. - The CustomType returns its name in its custom name in the name() and toString() methods, whereas the OpaqueType returns "OPAQUE<demangled-name>" in its name/toString() methods. ## In this Diff - The primary problem is that the CustomType has a Velox singleton for its type. However, type is serialized and deserialized, the type produced is an Opaque type, with custom type inside. - In this diff, the velox deserialization correctly finds and produces the VeloxType singleton. ## Implementation Changes - Types.cpp - Implemented searching and deserializing CustomType within OpaqueTypes in Type::create() method. ## Testing Changes - OpaqueCustomTypesTest.cpp - Added test to serialize/deserialize a CustomType and confirm that VeloxType singleton is returned. Differential Revision: D89564769
4a97d0d to
208aa00
Compare
AshishCbMisra
pushed a commit
to AshishCbMisra/velox
that referenced
this pull request
Dec 22, 2025
…Type objects (facebookincubator#15829) Summary: ## Background - This diff is to fix a bug in the Types::create() method for CustomType. - The bug manifests in the SignatureBinder.bind() operation failing to match for a CustomType argument. - The CustomType is basically an OpaqueType object. - The root cause is that two different registries store OpaqueType objects. - Custom Type Registry → VeloxType singleton (correct name()) - OpaqueSerdeRegistry → Base OpaqueType (name() = "OPAQUE") - When deserializing the custom type in Type::create() method, the code does not find VeloxType singleton, hence created an OpaqueType. - The CustomType returns its name in its custom name in the name() and toString() methods, whereas the OpaqueType returns "OPAQUE<demangled-name>" in its name/toString() methods. ## In this Diff - The primary problem is that the CustomType has a Velox singleton for its type. However, type is serialized and deserialized, the type produced is an Opaque type, with custom type inside. - In this diff, the velox deserialization correctly finds and produces the VeloxType singleton. ## Implementation Changes - Types.cpp - Implemented searching and deserializing CustomType within OpaqueTypes in Type::create() method. ## Testing Changes - OpaqueCustomTypesTest.cpp - Added test to serialize/deserialize a CustomType and confirm that VeloxType singleton is returned. Differential Revision: D89564769
AshishCbMisra
pushed a commit
to AshishCbMisra/velox
that referenced
this pull request
Dec 22, 2025
…Type objects (facebookincubator#15829) Summary: ## Background - This diff is to fix a bug in the Types::create() method for CustomType. - The bug manifests in the SignatureBinder.bind() operation failing to match for a CustomType argument. - The CustomType is basically an OpaqueType object. - The root cause is that two different registries store OpaqueType objects. - Custom Type Registry → VeloxType singleton (correct name()) - OpaqueSerdeRegistry → Base OpaqueType (name() = "OPAQUE") - When deserializing the custom type in Type::create() method, the code does not find VeloxType singleton, hence created an OpaqueType. - The CustomType returns its name in its custom name in the name() and toString() methods, whereas the OpaqueType returns "OPAQUE<demangled-name>" in its name/toString() methods. ## In this Diff - The primary problem is that the CustomType has a Velox singleton for its type. However, type is serialized and deserialized, the type produced is an Opaque type, with custom type inside. - In this diff, the velox deserialization correctly finds and produces the VeloxType singleton. ## Implementation Changes - Types.cpp - Implemented searching and deserializing CustomType within OpaqueTypes in Type::create() method. ## Testing Changes - OpaqueCustomTypesTest.cpp - Added test to serialize/deserialize a CustomType and confirm that VeloxType singleton is returned. Differential Revision: D89564769
208aa00 to
2fb34e4
Compare
AshishCbMisra
pushed a commit
to AshishCbMisra/velox
that referenced
this pull request
Dec 22, 2025
…Type objects (facebookincubator#15829) Summary: ## Background - This diff is to fix a bug in the Types::create() method for CustomType. - The bug manifests in the SignatureBinder.bind() operation failing to match for a CustomType argument. - The CustomType is basically an OpaqueType object. - The root cause is that two different registries store OpaqueType objects. - Custom Type Registry → VeloxType singleton (correct name()) - OpaqueSerdeRegistry → Base OpaqueType (name() = "OPAQUE") - When deserializing the custom type in Type::create() method, the code does not find VeloxType singleton, hence created an OpaqueType. - The CustomType returns its name in its custom name in the name() and toString() methods, whereas the OpaqueType returns "OPAQUE<demangled-name>" in its name/toString() methods. ## In this Diff - The primary problem is that the CustomType has a Velox singleton for its type. However, type is serialized and deserialized, the type produced is an Opaque type, with custom type inside. - In this diff, the velox deserialization correctly finds and produces the VeloxType singleton. ## Implementation Changes - Types.cpp - Implemented searching and deserializing CustomType within OpaqueTypes in Type::create() method. ## Testing Changes - OpaqueCustomTypesTest.cpp - Added test to serialize/deserialize a CustomType and confirm that VeloxType singleton is returned. Differential Revision: D89564769
2fb34e4 to
d155261
Compare
AshishCbMisra
pushed a commit
to AshishCbMisra/velox
that referenced
this pull request
Dec 22, 2025
…Type objects (facebookincubator#15829) Summary: ## Background - This diff is to fix a bug in the Types::create() method for CustomType. - The bug manifests in the SignatureBinder.bind() operation failing to match for a CustomType argument. - The CustomType is basically an OpaqueType object. - The root cause is that two different registries store OpaqueType objects. - Custom Type Registry → VeloxType singleton (correct name()) - OpaqueSerdeRegistry → Base OpaqueType (name() = "OPAQUE") - When deserializing the custom type in Type::create() method, the code does not find VeloxType singleton, hence created an OpaqueType. - The CustomType returns its name in its custom name in the name() and toString() methods, whereas the OpaqueType returns "OPAQUE<demangled-name>" in its name/toString() methods. ## In this Diff - The primary problem is that the CustomType has a Velox singleton for its type. However, type is serialized and deserialized, the type produced is an Opaque type, with custom type inside. - In this diff, the velox deserialization correctly finds and produces the VeloxType singleton. ## Implementation Changes - Types.cpp - Implemented searching and deserializing CustomType within OpaqueTypes in Type::create() method. ## Testing Changes - OpaqueCustomTypesTest.cpp - Added test to serialize/deserialize a CustomType and confirm that VeloxType singleton is returned. Differential Revision: D89564769
d155261 to
0187735
Compare
AshishCbMisra
pushed a commit
to AshishCbMisra/velox
that referenced
this pull request
Dec 23, 2025
…Type objects (facebookincubator#15829) Summary: ## Background - This diff is to fix a bug in the Types::create() method for CustomType. - The bug manifests in the SignatureBinder.bind() operation failing to match for a CustomType argument. - The CustomType is basically an OpaqueType object. - The root cause is that two different registries store OpaqueType objects. - Custom Type Registry → VeloxType singleton (correct name()) - OpaqueSerdeRegistry → Base OpaqueType (name() = "OPAQUE") - When deserializing the custom type in Type::create() method, the code does not find VeloxType singleton, hence created an OpaqueType. - The CustomType returns its name in its custom name in the name() and toString() methods, whereas the OpaqueType returns "OPAQUE<demangled-name>" in its name/toString() methods. ## In this Diff - The primary problem is that the CustomType has a Velox singleton for its type. However, type is serialized and deserialized, the type produced is an Opaque type, with custom type inside. - In this diff, the velox deserialization correctly finds and produces the VeloxType singleton. ## Implementation Changes - Types.cpp - Implemented searching and deserializing CustomType within OpaqueTypes in Type::create() method. ## Testing Changes - OpaqueCustomTypesTest.cpp - Added test to serialize/deserialize a CustomType and confirm that VeloxType singleton is returned. Differential Revision: D89564769
0187735 to
674a89e
Compare
…rialization for OpaqueCustomType (facebookincubator#15843) Summary: ## Background. - Today, a CustomType (inner type) may be wrapped by an OpaqueType (outer type), forming a OpaqueCustomType. - When an OpaqueCustomType is defined, it needs to be registered in two place. - Custom Type Registry - a mapping from type name to an instance of CustomTypeFactory that provides an instance of the type - OpaqueSerdeRegistry - a mapping from type name to functions that serialize and deserialize opaque type values - Today, this requires two separate calls to the API. These separate calls are inconvenient and error prone. ## Implementation - OpaqueCustomTypes.h - This PR changes the OpaqueCustomTypeRegister::registerType() function to accept optional serialization/deserialization functions, thus eliminating the need for a separate API call. - By keep the function arguments optional, it provides backward compatibility with existing code. - Implemented the VeloxType::serialize() function - Cleared SerializationRegistry of the serialization/deserialization functions provided in the registerType() function. - Types.cpp - Implemented OpaqueType::clearSerializationRegistry() method. ## Testing Changes - OpaqueCustomTypesTest.cpp - Implements unit-tests that ensure that value serialization/deserialization functions can be provided in the registerType function optionally. - Implements checking for type-serialization/deserialization. - TypesTest.cpp Differential Revision: D89686612
…Type objects (facebookincubator#15829) Summary: ## Background - This diff is to fix a bug in the Types::create() method for CustomType. - The bug manifests in the SignatureBinder.bind() operation failing to match for a CustomType argument. - The CustomType is basically an OpaqueType object. - The root cause is that two different registries store OpaqueType objects. - Custom Type Registry → VeloxType singleton (correct name()) - OpaqueSerdeRegistry → Base OpaqueType (name() = "OPAQUE") - When deserializing the custom type in Type::create() method, the code does not find VeloxType singleton, hence created an OpaqueType. - The CustomType returns its name in its custom name in the name() and toString() methods, whereas the OpaqueType returns "OPAQUE<demangled-name>" in its name/toString() methods. ## In this Diff - The primary problem is that the CustomType has a Velox singleton for its type. However, type is serialized and deserialized, the type produced is an Opaque type, with custom type inside. - In this diff, the velox deserialization correctly finds and produces the VeloxType singleton. ## Implementation Changes - Types.cpp - Implemented searching and deserializing CustomType within OpaqueTypes in Type::create() method. ## Testing Changes - OpaqueCustomTypesTest.cpp - Added test to serialize/deserialize a CustomType and confirm that VeloxType singleton is returned. Differential Revision: D89564769
674a89e to
79e4a6d
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
fb-exported
meta-exported
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:
Background
This diff is to fix a bug in the Types::create() method for CustomType.
The bug manifests in the SignatureBinder.bind() operation failing to match for a CustomType argument.
The CustomType is basically an OpaqueType object.
The root cause is that two different registries store OpaqueType objects.
When deserializing the custom type in Type::create() method, the code does not find VeloxType singleton, hence created an OpaqueType.
The CustomType returns its name in its custom name in the name() and toString() methods, whereas the OpaqueType returns "OPAQUE" in its name/toString() methods.
In this Diff
However, type is serialized and deserialized, the type produced is an Opaque type, with custom type inside.
Implementation Changes
Testing Changes
Differential Revision: D89564769