test(rust): cover the v2 float encodings with synthetics - #1606
test(rust): cover the v2 float encodings with synthetics#1606CommanderStorm wants to merge 3 commits into
Conversation
Performance ComparisonPerformance Comparison
|
| zoom | tiles | prev_total | curr_total | delta_total | avg_delta | pct | best | worst |
|---|---|---|---|---|---|---|---|---|
| 0 | 1 | 71471 | 71471 | 0 | 0.0 | 0.0 | ||
| 1 | 4 | 220986 | 220986 | 0 | 0.0 | 0.0 | ||
| 2 | 16 | 615003 | 615003 | 0 | 0.0 | 0.0 | ||
| 3 | 64 | 1653851 | 1653851 | 0 | 0.0 | 0.0 | ||
| 4 | 256 | 3828904 | 3828904 | 0 | 0.0 | 0.0 | ||
| 5 | 1024 | 9716821 | 9716821 | 0 | 0.0 | 0.0 | ||
| 6 | 4096 | 32401914 | 32401914 | 0 | 0.0 | 0.0 | ||
| ALL | 5461 | 48508950 | 48508950 | 0 | 0.0 | 0.0 |
Top 3 improvements
Top 3 degradations
3db9132 to
5fe2d73
Compare
5fe2d73 to
920add0
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## stack-v2-float-alp #1606 +/- ##
=====================================================
Coverage 67.58% 67.58%
Complexity 1261 1261
=====================================================
Files 154 154
Lines 10912 10912
Branches 2688 2688
=====================================================
Hits 7375 7375
Misses 2393 2393
Partials 1144 1144 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
920add0 to
d3429a7
Compare
There was a problem hiding this comment.
Pull request overview
This PR expands the Rust synthetic fixture suite to explicitly cover the v2-only float encodings (Dict and ALP) for both f32 and f64, and adds encoder plumbing to pin float encodings via ExplicitEncoder so the synthetics generator can force specific float layouts.
Changes:
- Add new synthetic GeoJSON fixtures for v2 float dictionary/ALP encodings (plus corresponding v1 “raw” siblings) across
f32/f64, optional/non-optional, and key edge cases (distinct/repeated/zeros/NaN/decimals/whole). - Introduce
FloatEncodingandExplicitEncoder::get_float_encodingto allow pinning float logical encoding during encoding (v2 only). - Refactor float codec selection to accept a
StreamCtxand honor pinned float encodings; add a dedicated error when no ALP parameters can reproduce the column.
Reviewed changes
Copilot reviewed 44 out of 76 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/synthetic/0x02/prop_f64_dict.json | Adds v2 reference GeoJSON for f64 dict encoding with optional presence. |
| test/synthetic/0x02/prop_f64_dict_zeros_np.json | Adds v2 reference GeoJSON for f64 dict encoding with ±0.0 values (non-optional). |
| test/synthetic/0x02/prop_f64_dict_np.json | Adds v2 reference GeoJSON for f64 dict encoding (non-optional). |
| test/synthetic/0x02/prop_f64_dict_nan_np.json | Adds v2 reference GeoJSON for f64 dict encoding with NaN repeats (non-optional). |
| test/synthetic/0x02/prop_f64_dict_distinct_np.json | Adds v2 reference GeoJSON for f64 dict encoding with all-distinct values (non-optional). |
| test/synthetic/0x02/prop_f64_alp.json | Adds v2 reference GeoJSON for f64 ALP encoding with optional presence. |
| test/synthetic/0x02/prop_f64_alp_whole_np.json | Adds v2 reference GeoJSON for f64 ALP encoding of whole numbers (non-optional). |
| test/synthetic/0x02/prop_f64_alp_np.json | Adds v2 reference GeoJSON for f64 ALP encoding of decimal steps (non-optional). |
| test/synthetic/0x02/prop_f32_dict.json | Adds v2 reference GeoJSON for f32 dict encoding with optional presence. |
| test/synthetic/0x02/prop_f32_dict_zeros_np.json | Adds v2 reference GeoJSON for f32 dict encoding with ±0.0 values (non-optional). |
| test/synthetic/0x02/prop_f32_dict_np.json | Adds v2 reference GeoJSON for f32 dict encoding (non-optional). |
| test/synthetic/0x02/prop_f32_dict_nan_np.json | Adds v2 reference GeoJSON for f32 dict encoding with NaN repeats (non-optional). |
| test/synthetic/0x02/prop_f32_dict_distinct_np.json | Adds v2 reference GeoJSON for f32 dict encoding with all-distinct values (non-optional). |
| test/synthetic/0x02/prop_f32_alp.json | Adds v2 reference GeoJSON for f32 ALP encoding with optional presence. |
| test/synthetic/0x02/prop_f32_alp_whole_np.json | Adds v2 reference GeoJSON for f32 ALP encoding of whole numbers (non-optional). |
| test/synthetic/0x02/prop_f32_alp_np.json | Adds v2 reference GeoJSON for f32 ALP encoding of decimal steps (non-optional). |
| test/synthetic/0x01-rust/prop_f64_zeros_np.json | Adds v1 Rust-only “raw” sibling GeoJSON for ±0.0 coverage. |
| test/synthetic/0x01-rust/prop_f64_whole_np.json | Adds v1 Rust-only “raw” sibling GeoJSON for whole-number coverage. |
| test/synthetic/0x01-rust/prop_f64_repeated.json | Adds v1 Rust-only “raw” sibling GeoJSON for optional presence with repeats. |
| test/synthetic/0x01-rust/prop_f64_repeated_np.json | Adds v1 Rust-only “raw” sibling GeoJSON for repeated values (non-optional). |
| test/synthetic/0x01-rust/prop_f64_nan_repeated_np.json | Adds v1 Rust-only “raw” sibling GeoJSON for NaN repeats (non-optional). |
| test/synthetic/0x01-rust/prop_f64_distinct_np.json | Adds v1 Rust-only “raw” sibling GeoJSON for all-distinct values (non-optional). |
| test/synthetic/0x01-rust/prop_f64_decimals.json | Adds v1 Rust-only “raw” sibling GeoJSON for optional decimal values. |
| test/synthetic/0x01-rust/prop_f64_decimals_np.json | Adds v1 Rust-only “raw” sibling GeoJSON for decimal steps (non-optional). |
| test/synthetic/0x01-rust/prop_f32_zeros_np.json | Adds v1 Rust-only “raw” sibling GeoJSON for ±0.0 coverage. |
| test/synthetic/0x01-rust/prop_f32_whole_np.json | Adds v1 Rust-only “raw” sibling GeoJSON for whole-number coverage. |
| test/synthetic/0x01-rust/prop_f32_repeated.json | Adds v1 Rust-only “raw” sibling GeoJSON for optional presence with repeats. |
| test/synthetic/0x01-rust/prop_f32_repeated_np.json | Adds v1 Rust-only “raw” sibling GeoJSON for repeated values (non-optional). |
| test/synthetic/0x01-rust/prop_f32_nan_repeated_np.json | Adds v1 Rust-only “raw” sibling GeoJSON for NaN repeats (non-optional). |
| test/synthetic/0x01-rust/prop_f32_distinct_np.json | Adds v1 Rust-only “raw” sibling GeoJSON for all-distinct values (non-optional). |
| test/synthetic/0x01-rust/prop_f32_decimals.json | Adds v1 Rust-only “raw” sibling GeoJSON for optional decimal values. |
| test/synthetic/0x01-rust/prop_f32_decimals_np.json | Adds v1 Rust-only “raw” sibling GeoJSON for decimal steps (non-optional). |
| rust/mlt-synthetics/src/main.rs | Adds float codec fixture generation and a points() helper; wires float coverage into synthetic generation. |
| rust/mlt-synthetics/src/layer.rs | Adds PropConfig::Float and Layer::add_prop_float; provides explicit float encoding callback for encoder. |
| rust/mlt-core/src/errors.rs | Adds MltError::NoAlpParameters for pinned ALP when no exact parameters exist. |
| rust/mlt-core/src/encoder/writer.rs | Adds Encoder::override_float_enc to query ExplicitEncoder for pinned float encodings. |
| rust/mlt-core/src/encoder/tests.rs | Updates ExplicitEncoder test helper to initialize get_float_encoding. |
| rust/mlt-core/src/encoder/stream/float_dict.rs | Adjusts float dictionary builder to always build (even all-distinct) and return MltResult for pinned encoding usage. |
| rust/mlt-core/src/encoder/stream/float_alp.rs | Splits ALP selection into smallest() vs worth_building() so pinned ALP can be requested without “must beat raw” filtering. |
| rust/mlt-core/src/encoder/stream/codecs.rs | Refactors float stream writer to accept StreamCtx and honor pinned float encodings for v2. |
| rust/mlt-core/src/encoder/property/encode.rs | Updates float column encoding to call write_float_stream with StreamCtx::prop_data. |
| rust/mlt-core/src/encoder/model.rs | Introduces FloatEncoding and extends ExplicitEncoder with get_float_encoding. |
| rust/mlt-core/src/encoder/mod.rs | Re-exports FloatEncoding consistently for tests and __private usage. |
| rust/mlt-core/src/encoder/encode02.rs | Updates v2 property encoding to call write_float_stream with StreamCtx::prop_data. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
3cedf57 to
f67d129
Compare
364d45b to
d4b42a3
Compare
d4b42a3 to
c32fd9b
Compare
cd7e9e4 to
fa79401
Compare
426028a to
f0ffaac
Compare
a98e2d9 to
8f1246a
Compare
8f1246a to
4334754
Compare
4334754 to
670aba3
Compare
670aba3 to
5d80501
Compare
5d80501 to
10faee6
Compare
Code Coverage OverviewLanguages: TypeScript, Java TypeScript / code-coverage/vitestThe overall line coverage in commit 4b5fe53 in the Java / code-coverage/jacocoThe overall line coverage in commit 4b5fe53 in the Show a line coverage summary of the most covered files.
Updated |
e975830 to
3f73f40
Compare
Generated by rust/scripts/hexdump_stack.py. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
for more information, see https://pre-commit.ci
3f73f40 to
4b5fe53
Compare
Adds synthetic coverage for float dicsts and ALP