Add Lossless Data Product Compression Components#5235
Open
kubiak-jpl wants to merge 64 commits into
Open
Conversation
…k the container size
LeStarch
previously approved these changes
Jun 9, 2026
Collaborator
|
#5319 - looks like the TestUtils/Optional was moved/modified in |
thomas-bc
reviewed
Jul 6, 2026
thomas-bc
approved these changes
Jul 6, 2026
thomas-bc
left a comment
Collaborator
There was a problem hiding this comment.
LGTM - one comment on CI testing
| std::numeric_limits<uInt>::max()); | ||
| return CompressionAlgorithm::UNCOMPRESSED; | ||
| } | ||
|
|
| static_cast<FwAssertArgType>(buffer.getSize()), static_cast<FwAssertArgType>(write_offset), | ||
| static_cast<FwAssertArgType>(ctx.compression_buffer.getSize())); | ||
|
|
||
| std::memcpy(buffer.getData() + write_offset, ctx.compression_buffer.getData(), |
|
|
||
| if (alg != CompressionAlgorithm::UNCOMPRESSED) { | ||
| // Compression completed and the size is <= min size | ||
| // Copy the compressed data into the original buffer |
| if (ctx.zlib_alloc_buffer.getSize() == 0) { | ||
| log_WARNING_LO_ZLibAllocBadBuffer(zlib_alloc_size); | ||
|
|
||
| cleanupContext(ctx); |
|
|
||
| ctx.compression_buffer = bufferCompressionGet_out(0, min_compression); | ||
| if (ctx.compression_buffer.getSize() == 0) { | ||
| log_WARNING_LO_ZLibCompressionBadBuffer(min_compression); |
| container.deserializeHeader(); | ||
|
|
||
| FwSizeType prm_chunk_size = paramGet_CHUNK_SIZE(param_valid); | ||
| FW_ASSERT((param_valid == Fw::ParamValid::DEFAULT) || (param_valid == Fw::ParamValid::VALID), param_valid); |
| FW_ASSERT(ok == Fw::FW_SERIALIZE_OK, ok); | ||
| ok = serializer.serializeFrom(metadata); | ||
| FW_ASSERT(ok == Fw::FW_SERIALIZE_OK, ok); | ||
| } |
| ok = serializer.serializeFrom(record_id); | ||
| FW_ASSERT(ok == Fw::FW_SERIALIZE_OK, ok); | ||
| ok = serializer.serializeFrom( | ||
| static_cast<FwSizeStoreType>(compressed_payload_size + CompressionMetadata::SERIALIZED_SIZE)); |
| ok = serializer.serializeFrom(record_id); | ||
| FW_ASSERT(ok == Fw::FW_SERIALIZE_OK, ok); | ||
| ok = serializer.serializeFrom( | ||
| static_cast<FwSizeStoreType>(compressed_payload_size + CompressionMetadata::SERIALIZED_SIZE)); |
| FW_ASSERT(this->getBuffAddr()); | ||
| // copy buffer to our buffer | ||
| (void)memcpy(&this->getBuffAddr()[this->m_serLoc], buff, static_cast<size_t>(length)); | ||
| (void)memmove(&this->getBuffAddr()[this->m_serLoc], buff, static_cast<size_t>(length)); |
thomas-bc
approved these changes
Jul 8, 2026
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.
Change Description
This PR makes the following changes
memmoveinstead ofmemcpyserializeFrommethod calls which make the algorithm to re-write the data product cleaner. However, I can also revert this change and modify my code to usememmovedirectlyRationale
Implements lossless compressible data products seamlessly into the F Prime Data Product subsystem
Testing/Review Recommendations
The algorithm to modify the data product in place is non-trivial. I believe I have sufficiently thought through the state machine and have unit tests to cover all the cases. But it could use thorough review.
I had this integrated into the Ref deployment before that was moved.
Future Work
AI Usage (see policy)
N/A