Fix TS_2DIFF float/double page compatibility#796
Merged
Conversation
…idation. Align C++ float/double TS_2DIFF flush/read behavior with Java overflow-page layout, and prevent 0-byte/corrupt googletest archives from being treated as successful downloads during test configuration.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #796 +/- ##
===========================================
+ Coverage 61.49% 61.58% +0.08%
===========================================
Files 731 731
Lines 45581 45874 +293
Branches 6787 6880 +93
===========================================
+ Hits 28029 28250 +221
- Misses 16560 16613 +53
- Partials 992 1011 +19 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Add optional TSFILE_OPTIMIZATION_FLAGS overrides in project/examples CMake while removing hardcoded optimization settings so library builds follow common CMake integration behavior.
Use Java-compatible default maxPoint handling for float/double TS_2DIFF encode/decode while preserving legacy raw-block compatibility, and add a byte-level regression test for the documented float/NaN hex sequence.
Use the actual time chunk encoding instead of global default when building time decoders in table read paths, preventing wrong TS_2DIFF decoding on PLAIN time chunks.
Drop nonessential explanatory comments in TS_2DIFF codec changes and remove unused defaultTimeDecoder from AbstractChunkReader to keep the PR focused for review.
Merge upstream/develop into fix/cpp-ts2diff and resolve CMake conflicts. Use configured time encoding when reading non-time chunks, keep chunk header encoding for aligned/table time chunks, and align test writers with the encoders they use.
Mirror TestFloatJavaDefaultHexCompatibility with the same overflow-page inputs so C++ double encoder output stays byte-for-byte compatible with Java.
jt2594838
approved these changes
Jun 4, 2026
Comment on lines
+541
to
+544
| constexpr uint32_t kJavaOverflowMagic = | ||
| 2147483647u; // Integer.MAX_VALUE | ||
| constexpr uint32_t kJavaValueOverflowMagic = | ||
| 2147483646u; // Integer.MAX_VALUE - 1 |
Contributor
There was a problem hiding this comment.
kJavaOverflowMagic -> FLAG_SCALED_VALUE_OVERFLOW
kJavaValueOverflowMagic -> FLAG_ORIGINAL_VALUE_OVERFLOW
Contributor
Author
There was a problem hiding this comment.
Renamed as suggested
Comment on lines
+604
to
+607
| std::vector<uint8_t> underflow_bitmap( | ||
| static_cast<size_t>(num_values / 8 + 1), 0); | ||
| std::vector<uint8_t> value_overflow_bitmap( | ||
| static_cast<size_t>(num_values / 8 + 1), 0); |
Contributor
There was a problem hiding this comment.
May use overflow/underflow consistently.
Apply review feedback: FLAG_SCALED_VALUE_OVERFLOW / FLAG_ORIGINAL_VALUE_OVERFLOW, and consistent underflow/overflow bitmap names in encoder and decoder.
jt2594838
approved these changes
Jun 4, 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.
Summary
Encoding Layout
Legacy raw block (old C++ path):
[ TS_2DIFF inner block ]
Java-compatible overflow page (fixed C++ path):
[ outer_magic(varint=2147483646) ]
[ count(varint) ]
[ bitmap_under ]
[ bitmap_over ]
[ inner_max_point(varint=2) ]
[ TS_2DIFF inner block payload ]
Test Input
Float values:
3.123456768E20f,NaNExpected encoded hex (Java baseline):
FE FF FF FF 07 02 00 03 02 00 00 00 01 00 00 00 00 1E 38 8A AA 61 87 75 56Verification