Skip to content

test(rust): Add Rust <-> C++ differential decoder fuzzer#1471

Open
CommanderStorm wants to merge 3 commits into
maplibre:mainfrom
CommanderStorm:differential-fuzzer
Open

test(rust): Add Rust <-> C++ differential decoder fuzzer#1471
CommanderStorm wants to merge 3 commits into
maplibre:mainfrom
CommanderStorm:differential-fuzzer

Conversation

@CommanderStorm

@CommanderStorm CommanderStorm commented Jun 24, 2026

Copy link
Copy Markdown
Member

a diff fuzzer for rust and cpp.

Currently not wired into CI, because it finds issues 🎉

Copilot AI review requested due to automatic review settings June 24, 2026 15:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@CommanderStorm CommanderStorm changed the title Add Rust↔C++ differential decoder fuzzer Add Rust <-> C++ differential decoder fuzzer Jun 24, 2026
Removed comments related to the differential fuzzer and its usage.
@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor
Performance Comparison

Performance Comparison maindifferential-fuzzer

Total Elapsed Time: 2.39s → 2.33s (-2.6%)
CPU Baseline: 82.53µs → 81.47µs (-1.3%)
Benchmark ID: mlt-convert

timing - Function execution time metrics.

+--------------------------------------+------------------------------+--------------------------------+--------------------------------+--------------------------------+------------------------------+
| Function                             | Calls                        | Avg                            | P95                            | Total                          | % Total                      |
+--------------------------------------+------------------------------+--------------------------------+--------------------------------+--------------------------------+------------------------------+
| optimizer::encode                    | 14092 → 14092 (+0.0%)        | 566.65µs → 552.38µs (-2.5%)    | 2.48ms → 2.32ms (-6.5%)        | 7.99s → 7.78s (-2.6%)          | 333.69% → 333.97% (+0.1%)    |
+--------------------------------------+------------------------------+--------------------------------+--------------------------------+--------------------------------+------------------------------+
| optimizer::encode_into               | 28188 → 28188 (+0.0%)        | 179.66µs → 175.03µs (-2.6%)    | 786.43µs → 778.75µs (-1.0%)    | 5.06s → 4.93s (-2.6%)          | 211.63% → 211.67% (+0.0%)    |
+--------------------------------------+------------------------------+--------------------------------+--------------------------------+--------------------------------+------------------------------+
| encode::write_to                     | 28190 → 28192 (+0.0%)        | 139.41µs → 135.91µs (-2.5%)    | 681.98µs → 676.86µs (-0.8%)    | 3.93s → 3.83s (-2.5%)          | 164.23% → 164.39% (+0.1%)    |
+--------------------------------------+------------------------------+--------------------------------+--------------------------------+--------------------------------+------------------------------+
| writer::with                         | 2197192 → 2197152 (-0.0%)    | 1.28µs → 1.25µs (-2.3%)        | 1.69µs → 1.68µs (-0.6%)        | 2.81s → 2.74s (-2.5%)          | 117.42% → 117.58% (+0.1%)    |
+--------------------------------------+------------------------------+--------------------------------+--------------------------------+--------------------------------+------------------------------+
| mlt::main                            | 1 → 1 (+0.0%)                | 2.39s → 2.33s (-2.5%)          | 2.39s → 2.33s (-2.5%)          | 2.39s → 2.33s (-2.5%)          | 100.00% → 100.00% (+0.0%)    |
+--------------------------------------+------------------------------+--------------------------------+--------------------------------+--------------------------------+------------------------------+
| optimizer::analyze                   | 14096 → 14096 (+0.0%)        | 134.85µs → 131.37µs (-2.6%)    | 699.90µs → 704.51µs (+0.7%)    | 1.90s → 1.85s (-2.6%)          | 79.44% → 79.45% (+0.0%)      |
+--------------------------------------+------------------------------+--------------------------------+--------------------------------+--------------------------------+------------------------------+
| shared_dict::group_string_properties | 14096 → 14096 (+0.0%)        | 130.00µs → 126.54µs (-2.7%)    | 681.47µs → 678.40µs (-0.5%)    | 1.83s → 1.78s (-2.7%)          | 76.58% → 76.53% (-0.1%)      |
+--------------------------------------+------------------------------+--------------------------------+--------------------------------+--------------------------------+------------------------------+
| encode::dict_may_be_beneficial       | 28190 → 28192 (+0.0%)        | 49.62µs → 48.14µs (-3.0%)      | 223.23µs → 223.87µs (+0.3%)    | 1.40s → 1.36s (-2.9%)          | 58.46% → 58.23% (-0.4%)      |
+--------------------------------------+------------------------------+--------------------------------+--------------------------------+--------------------------------+------------------------------+
| encode::write_properties             | 28188 → 28188 (+0.0%)        | 37.51µs → 36.33µs (-3.1%)      | 143.23µs → 142.21µs (-0.7%)    | 1.06s → 1.02s (-3.8%)          | 44.18% → 43.93% (-0.6%)      |
+--------------------------------------+------------------------------+--------------------------------+--------------------------------+--------------------------------+------------------------------+
| encode::write_prop                   | 116566 → 116564 (-0.0%)      | 8.99µs → 8.69µs (-3.3%)        | 18.08µs → 18.13µs (+0.3%)      | 1.05s → 1.01s (-3.8%)          | 43.77% → 43.45% (-0.7%)      |
+--------------------------------------+------------------------------+--------------------------------+--------------------------------+--------------------------------+------------------------------+
| shared_dict::write_shared_dict       | 24001 → 24000 (-0.0%)        | 26.59µs → 25.75µs (-3.2%)      | 54.69µs → 54.21µs (-0.9%)      | 638.27ms → 618.07ms (-3.2%)    | 26.67% → 26.52% (-0.6%)      |
+--------------------------------------+------------------------------+--------------------------------+--------------------------------+--------------------------------+------------------------------+
| tile::from_tile                      | 28192 → 28192 (+0.0%)        | 20.95µs → 20.59µs (-1.7%)      | 88.51µs → 86.72µs (-2.0%)      | 590.48ms → 580.35ms (-1.7%)    | 24.68% → 24.90% (+0.9%)      |
+--------------------------------------+------------------------------+--------------------------------+--------------------------------+--------------------------------+------------------------------+
| strings::write_str_col               | 57067 → 57064 (-0.0%)        | 6.12µs → 5.92µs (-3.3%)        | 11.54µs → 11.52µs (-0.2%)      | 349.45ms → 338.08ms (-3.3%)    | 14.60% → 14.50% (-0.7%)      |
+--------------------------------------+------------------------------+--------------------------------+--------------------------------+--------------------------------+------------------------------+
| sort::curve_params                   | 14096 → 14096 (+0.0%)        | 17.30µs → 16.95µs (-2.0%)      | 77.25µs → 76.93µs (-0.4%)      | 243.89ms → 238.98ms (-2.0%)    | 10.19% → 10.25% (+0.6%)      |
+--------------------------------------+------------------------------+--------------------------------+--------------------------------+--------------------------------+------------------------------+
| strings::fsst_try_train              | 40536 → 40536 (+0.0%)        | 5.08µs → 4.95µs (-2.6%)        | 71.00ns → 71.00ns (+0.0%)      | 206.07ms → 200.83ms (-2.5%)    | 8.61% → 8.62% (+0.1%)        |
+--------------------------------------+------------------------------+--------------------------------+--------------------------------+--------------------------------+------------------------------+

alloc-bytes - Exclusive allocation bytes by each function (excluding nested calls).

+--------------------------------------+------------------------------+------------------------------+--------------------------------+--------------------------------+----------------------------+
| Function                             | Calls                        | Avg                          | P95                            | Total                          | % Total                    |
+--------------------------------------+------------------------------+------------------------------+--------------------------------+--------------------------------+----------------------------+
| tile::from_tile                      | 28192 → 28192 (+0.0%)        | 44.2 KB → 44.2 KB (+0.0%)    | 239.2 KB → 239.2 KB (+0.0%)    | 1.2 GB → 1.2 GB (+0.0%)        | 24.43% → 24.43% (+0.0%)    |
+--------------------------------------+------------------------------+------------------------------+--------------------------------+--------------------------------+----------------------------+
| optimizer::encode                    | 14092 → 14092 (+0.0%)        | 86.2 KB → 86.2 KB (+0.0%)    | 159.2 KB → 159.2 KB (+0.0%)    | 1.2 GB → 1.2 GB (+0.0%)        | 23.84% → 23.84% (+0.0%)    |
+--------------------------------------+------------------------------+------------------------------+--------------------------------+--------------------------------+----------------------------+
| writer::with                         | 2197192 → 2197152 (-0.0%)    | 518 B → 518 B (+0.0%)        | 20.3 KB → 20.3 KB (+0.0%)      | 1.1 GB → 1.1 GB (+0.0%)        | 21.84% → 21.84% (+0.0%)    |
+--------------------------------------+------------------------------+------------------------------+--------------------------------+--------------------------------+----------------------------+
| strings::fsst_try_train              | 40536 → 40536 (+0.0%)        | 16.8 KB → 16.8 KB (+0.0%)    | 3.6 MB → 3.6 MB (+0.0%)        | 664.5 MB → 664.5 MB (+0.0%)    | 13.35% → 13.35% (+0.0%)    |
+--------------------------------------+------------------------------+------------------------------+--------------------------------+--------------------------------+----------------------------+
| shared_dict::group_string_properties | 14096 → 14096 (+0.0%)        | 30.1 KB → 30.1 KB (+0.0%)    | 167.5 KB → 167.5 KB (+0.0%)    | 414.1 MB → 414.1 MB (+0.0%)    | 8.32% → 8.32% (+0.0%)      |
+--------------------------------------+------------------------------+------------------------------+--------------------------------+--------------------------------+----------------------------+
| encode::write_to                     | 28190 → 28192 (+0.0%)        | 7.4 KB → 7.4 KB (+0.0%)      | 35.7 KB → 35.7 KB (+0.0%)      | 204.9 MB → 204.9 MB (+0.0%)    | 4.12% → 4.12% (+0.0%)      |
+--------------------------------------+------------------------------+------------------------------+--------------------------------+--------------------------------+----------------------------+
| shared_dict::write_shared_dict       | 24001 → 24000 (-0.0%)        | 3.4 KB → 3.4 KB (+0.0%)      | 11.5 KB → 11.5 KB (+0.0%)      | 80.2 MB → 80.2 MB (+0.0%)      | 1.61% → 1.61% (+0.0%)      |
+--------------------------------------+------------------------------+------------------------------+--------------------------------+--------------------------------+----------------------------+
| strings::write_str_col               | 57067 → 57064 (-0.0%)        | 893 B → 893 B (+0.0%)        | 3.5 KB → 3.5 KB (+0.0%)        | 48.6 MB → 48.6 MB (+0.0%)      | 0.98% → 0.98% (+0.0%)      |
+--------------------------------------+------------------------------+------------------------------+--------------------------------+--------------------------------+----------------------------+
| encode::build_morton_dict            | 362 → 362 (+0.0%)            | 44.6 KB → 44.6 KB (+0.0%)    | 89.9 KB → 89.9 KB (+0.0%)      | 15.8 MB → 15.8 MB (+0.0%)      | 0.32% → 0.32% (+0.0%)      |
+--------------------------------------+------------------------------+------------------------------+--------------------------------+--------------------------------+----------------------------+
| strings::write_raw_str_data          | 137740 → 137731 (-0.0%)      | 117 B → 117 B (+0.0%)        | 10.8 KB → 10.8 KB (+0.0%)      | 15.4 MB → 15.4 MB (+0.0%)      | 0.31% → 0.31% (+0.0%)      |
+--------------------------------------+------------------------------+------------------------------+--------------------------------+--------------------------------+----------------------------+
| optimizer::analyze                   | 14096 → 14096 (+0.0%)        | 1.0 KB → 1.0 KB (+0.0%)      | 6.5 KB → 6.5 KB (+0.0%)        | 14.0 MB → 14.0 MB (+0.0%)      | 0.28% → 0.28% (+0.0%)      |
+--------------------------------------+------------------------------+------------------------------+--------------------------------+--------------------------------+----------------------------+
| encode::build_hilbert_dict           | 362 → 362 (+0.0%)            | 25.9 KB → 25.9 KB (+0.0%)    | 90.7 KB → 90.7 KB (+0.0%)      | 9.2 MB → 9.2 MB (+0.0%)        | 0.18% → 0.18% (+0.0%)      |
+--------------------------------------+------------------------------+------------------------------+--------------------------------+--------------------------------+----------------------------+
| encode::dict_may_be_beneficial       | 28190 → 28192 (+0.0%)        | 256 B → 256 B (+0.0%)        | 256 B → 256 B (+0.0%)          | 6.9 MB → 6.9 MB (+0.0%)        | 0.14% → 0.14% (+0.0%)      |
+--------------------------------------+------------------------------+------------------------------+--------------------------------+--------------------------------+----------------------------+
| encode::write_prop                   | 116566 → 116564 (-0.0%)      | 41 B → 41 B (+0.0%)          | 400 B → 400 B (+0.0%)          | 4.6 MB → 4.6 MB (+0.0%)        | 0.09% → 0.09% (+0.0%)      |
+--------------------------------------+------------------------------+------------------------------+--------------------------------+--------------------------------+----------------------------+
| strings::write_str_plain             | 57068 → 57065 (-0.0%)        | 69 B → 69 B (+0.0%)          | 240 B → 240 B (+0.0%)          | 3.8 MB → 3.8 MB (+0.0%)        | 0.08% → 0.08% (+0.0%)      |
+--------------------------------------+------------------------------+------------------------------+--------------------------------+--------------------------------+----------------------------+

Threads

No threads to compare


Generated with hotpath-rs

Per-tile encoded size diff
zoom tiles prev_total curr_total delta_total avg_delta pct best worst
0 1 71471 71471 0 0.0 0.0
1 4 220990 220990 0 0.0 0.0
2 16 615018 615018 0 0.0 0.0
3 64 1653881 1653881 0 0.0 0.0
4 256 3828995 3828995 0 0.0 0.0
5 1024 9716961 9716961 0 0.0 0.0
6 4096 32402309 32402309 0 0.0 0.0
ALL 5461 48509625 48509625 0 0.0 0.0

Top 3 improvements

Top 3 degradations

@CommanderStorm CommanderStorm changed the title Add Rust <-> C++ differential decoder fuzzer test(rust): Add Rust <-> C++ differential decoder fuzzer Jun 24, 2026
@codecov-commenter

codecov-commenter commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.78%. Comparing base (a35ba6d) to head (313d642).

Files with missing lines Patch % Lines
rust/mlt-core/src/encoder/fuzzing.rs 0.00% 10 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1471       +/-   ##
===========================================
- Coverage   95.78%   62.78%   -33.00%     
===========================================
  Files          68       94       +26     
  Lines        4908    15327    +10419     
  Branches      760        0      -760     
===========================================
+ Hits         4701     9623     +4922     
- Misses        192     5704     +5512     
+ Partials       15        0       -15     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants