Expanded VLA and Optional support in photon-serde#2492
Open
Bobcat66 wants to merge 46 commits into
Open
Conversation
commit 0a27b16 Author: Jesse Kane <jessekane66@gmail.com> Date: Wed May 13 15:04:11 2026 -0400 linting commit 78d1c5e Author: Jesse Kane <jessekane66@gmail.com> Date: Mon May 11 18:54:51 2026 -0400 fixed ambiguous cases commit f4e64ef Author: Jesse Kane <jessekane66@gmail.com> Date: Sat May 9 16:50:51 2026 -0400 stuff
mcm001
reviewed
May 19, 2026
mcm001
reviewed
May 19, 2026
Comment on lines
+279
to
+285
| if (data.size() > 0) { | ||
| encoder = | ||
| (packet, value) -> { | ||
| ; | ||
| }; | ||
| } else { | ||
| encoder = data.get(0).getSerde()::pack; |
Contributor
There was a problem hiding this comment.
Help me understand the logic here? If data is empty, we call data.get(0)?
Contributor
Author
There was a problem hiding this comment.
That's actually a typo lol, its meant to be if (data.size() < 1) not if (data.size() > 0)
Contributor
There was a problem hiding this comment.
Gotcha. Would be good to get some unit tests of Packet -- our current tests actually aren't very useful and didn't catch this guy
Contributor
Author
There was a problem hiding this comment.
should that be its own issue or can I just tack that onto this PR?
Contributor
There was a problem hiding this comment.
If we're adding new code I'd like our unit tests to hit the new codepaths
… with gradle then set up the workflow
50829f0 to
cb66fe9
Compare
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.
Description
Adds support for Optional WPI structs and VLAs of WPI structs in photon-serde, as well as optional intrinsic types and VLAs of intrinsic types. Also adds an int8 datatype, corresponding to Byte in java and int8_t in C++.
This PR also partially automates photon-serde testing, allowing for the creation of "test messages", which will have a corresponding class automatically generated alongside the serde code, to allow for quick testing and prototyping of new photon-serde features
This has been tested in Java, C++ tests and Python tests are WIP
I ran into a few issues with photonserde while trying to send an optional Transform3ds in #2440 and VLAs of Integers in #2477. #2477 ended up being irrelevant because of #2103, but i'm worried similar issues could come up in the future, especially if GTSAM ends up running on a coprocessor
Meta
Merge checklist: