Repository navigation
conformance: add curated files of known-trap inputs - #159
Merged
Merged
Conversation
Seeded sampling gives coverage density but is blind to the specific inputs that have broken implementations. Six curated files hold such inputs by hand, each in exactly its group's record type so the existing runners pick them up by directory with no new code: the indexes the reference's command-line tests and test applications single out, the reference's checked-in compact and multipolygon cell lists, and the polygons from its reported-issue and transmeridian tests. The README lists every subject with its provenance; the generator holds them as tables and draws nothing for them. The regions id becomes a name for these rows, the sets id is curated:<name>, and the traversal subject is now the origin and target pair because curated origins repeat. A fill of no cells now writes an empty multiPolygon sequence rather than the reference's single structure with no loops, which the sampled files never produced. The files found two things. The reference's gridDistance to a target whose unused digits are not 7 returns 0, and one of its own gridPathCells fixtures gets a distance of 81 with no path; both are recorded as the reference's answers and pure Go matches them. Its classic polygonToCells fails with E_FAILED on the polar band its tests use, by design, because the size estimate is too small for a polygon that wide near the pole, while pure Go allocates dynamically and returns the cells. That is a deliberate difference, so the polar band is not in the file and is noted in the README's discussion instead. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Coverage Report for CI Build 37543826666Coverage remained the same at 100.0%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
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
Seeded sampling gives coverage density but is blind to the specific inputs that have broken implementations. This adds six curated files of such inputs, 79 rows, each in exactly its group's record type so the existing runners pick them up by directory with no new runner code:
inspection/curated.jsonlhierarchy/curated.jsonlcellToChildrenfixtures, a res 15 cell, pentagons at res 0 to 2traversal/curated.jsonlgridPathCellsandgridDistancefixtures, including an invalid target and a resolution mismatchlocalij/curated.jsonl[25, 13]pair, the upstreamcellToLocalIjfixtures, pentagon origins, an invalid originsets/curated.jsonlcompact_test1andmultipolygon_test3/4/5cell lists, the six children of a pentagon, all 122 res 0 cellsregions/curated.jsonlThe README lists every subject with its provenance (
cli,tests,inputfilesorhand) and is the specification; the generator holds the same lists as tables and draws nothing for them.Three small format consequences: the regions
idis a name for these rows and the setsidiscurated:<name>; the traversal subject is now the origin and target pair, since curated origins repeat; and a fill of no cells writes an emptymultiPolygonsequence rather than the reference's single structure with no loops, which no sampled row had produced.What the files found
85283473fffffffto85283472fffffff, whose digit 6 is not7and whichisValidCellrejects. Pure Go does the same, so it is recorded as the reference's answer.8411b61ffffffffto84016d3ffffffffthe reference'sgridDistanceis 81 butgridPathCellsfails withE_FAILED. Also matched.polygonToCellsfails by design on the polar band. The reference's own test assertsE_FAILEDfor the 85 to 89.9 degree band spanning 179 degrees of longitude, becausemaxPolygonToCellsSizeunderestimates the fill and the algorithm gives up when its buffer fills. Pure Go has no fixed buffer and returns the 260 cells at res 4. That is the better answer and a deliberate difference, so the polygon is not in the file; the README's regions section records why.Every file outside the six new ones is byte-identical to before; the manifest changes only by the six new entries.
Test plan
go test -count=1 -race -cover ./x/h3go/conformance/passes at 100% coveragegolangci-lint run ./x/h3go/conformance/...cleangenerate.sh;diff -ragainst the previous testdata shows only the new files and the manifest🤖 Generated with Claude Code