Repository navigation
test(engine): cover OSM multipolygon ring losses - #2412
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
| gpx(r#"<trk><trkseg><trkpt lat="1" lon="1"/><trkpt lat="2" lon="2"/></trkseg><trkseg><trkpt lat="3" lon="3"/></trkseg></trk>"#), | ||
| Silent("the segment is left out of the track's line"), | ||
| ), | ||
| // OSM PBF: keep the outer polygon while one inner member is lost. |
There was a problem hiding this comment.
Quality (test coverage): the OSM cases don't check the geometry they describe. read() returns only notices and whether a layer was added, and a Silent case passes whenever the lossy file adds a layer with no new notice. So if the reader stopped assigning the inner role, or dropped every hole, the clean file and all four lossy files would still import one layer with no notice. All five cases would pass while the corpus stopped covering rings at all. The PR's own probe (clean = one polygon with two rings, each variant one ring) is not in the test suite. Suggested fix: a small dedicated test that reads hole-clean and each lossy file through layer.addData and asserts the ring count per polygon (2 for clean, 1 for each lossy file), so the fixtures' claims are enforced. Confidence: high that the harness can't catch this; the fix is outside this diff's small scope, so the author can decide whether to add it here.
There was a problem hiding this comment.
The harness checks import success and notices, so it does not enforce ring counts. Before submission, the native-reader probe confirmed one polygon with two rings for the clean file and one ring for each of the four variants, with zero skipped features and no messages. The extra persistent geometry assertions are left for the release quality pass.
Code reviewChecked: the five new OSM PBF fixtures and their OSM.md notes, the four new Bugs: none found. I traced the reader against each fixture's description. Clean input yields two rings. Each lossy variant drops the inner ring with no notice. The Security: none found. The change adds only test data and test code. Performance: none found. Quality:
AGENTS.md: no violations found. The ATTRIBUTION row, the ROADMAP wording, the Not verified: the SHA-256 checksums in OSM.md. I have no hashing tool in this session, so I could not confirm them. The total size (1,041 bytes) matches the five file sizes in Already raised earlier: 0 concerns. There were no prior threads. Change sizeCompared: the whole PR against main (merge base 6a22581 to PR head 3d5d61d).
|
|
The PR body now explains why the independently encoded bytes are committed: these malformed cases stay fixed and reproducible without running a fixture generator or external writer in the tests. All five documented SHA-256 checksums match the committed files (1,041 bytes total). The geometry-assertion coverage is deferred as explained inline; consolidating the fixture notes into README.md is also left for the release quality pass. |
📖 Docs preview
GitHub Pages takes a minute or two to publish a new commit. Newer commits from the fork aren't published until a maintainer adds the |
Summary
The reader-loss command corpus had no OSM PBF cases. Add a complete triangular polygon with one hole and four variants: a missing inner member way, a missing node, an unclosed inner ring, and an inner ring outside the outer ring. The native reader currently imports the complete file with two rings and each variant with one, without a notice. Record these existing bugs as
Silentso reader fixes must update the corpus.Five independently encoded, made-up PBF files total 1,041 bytes. Their exact contents, schema reference and checksums are documented and attributed. The committed bytes keep these independently encoded malformed cases fixed and reproducible without a fixture generator or external writer in the tests. The roadmap retains the known reader bugs and narrows missing corpus formats to Shapefile and spreadsheets. No production reader behavior changes.
Surfaces: native
layer.addDataexercises the shared engine import used by desktop, CLI, Python and native Assistant/MCP calls. Browser uploads and phone controls are not exercised; their code, ribbon/shortcuts/search, plugin interfaces, saved formats and Undo behavior do not change.Testing
UI evidence
No visible UI change.
Related issue
Follows #2404; continues ROADMAP.md → Correct results: the reader-loss corpus.
Summary by CodeRabbit