Repository navigation
fuzz.py, props.py: accept wr(bn...) differences that match the baseline's way + relation answer - #245
Merged
Merged
Conversation
…ne's way + relation answer The baseline (upstream master) gets wr(bn.s) with filters wrong (issue #192): it returns nothing at the current date, unrelated relations at past dates, or fails with "Filters too weak". #193 fixes it on all-changes, so every such query showed up as a difference. wr_union.py rewrites each top-level wr...(bn...) statement as its way and relation halves, both reading the same _, which the baseline answers correctly. A difference is accepted only if the candidate's output equals the baseline's for the rewritten query, so a regression in the candidate's wr(bn) still fails. fuzz.py reports such queries as verdict expected-wr-bn; props.py counts them as fixed. Statements inside unions, differences or blocks are not rewritten, and neither is any query that has one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01736kJTiuJPoCWZs7RtFYjm
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.
Fixes #244.
Change
New
bench/wr_union.py:wr_as_union(query)rewrites each top-levelwr...(bn...)...statement as its way and relation halves, both reading the same_:wris defined as way plus relation with the same filters, andmasteranswersway(bn)andrel(bn)correctly; only itswr(bn)form is wrong (#192). The save and restore of_matter: inside a plain union, the second statement would read the first's result.DIFFERENTquery whose rewrite differs from it is run once more on the baseline, rewritten; if the candidate's status and digest equal that run's, the verdict isexpected-wr-bninstead ofDIFFERENT. The workflows count it like any other verdict and fail only onDIFFERENT(exit status).run_checks,run_pairsandrun_output_checkscount such a difference asfixed.So a difference is accepted only when the candidate gives exactly the baseline's way + relation answer; a regression in the candidate's
wr(bn)still fails. Statements inside unions, differences or blocks aren't rewritten, and neither is any query that has one (all or nothing); a statement after a block's closing}counts as top level.bench/test_wr_union.py: 8 unit tests (no build needed).Testing
all-changesa71b7e3 againstupstream/mastera9d8f15:tools_ref)fuzz, seed 1, 6,000 queriesDIFFERENT, 38expected-wr-bn, 14 skipped (baseline timeouts, as before)history, seed 1, 2,000 queriesDIFFERENT, 11expected-wr-bn, 1 skippedprops(local, the 20 seeds that failed: 3, 4, 6, 8, 9, 14, 16, 17, 20, 22, 25, 26, 29, 30, 31, 33, 34, 37, 38, 40)wr(bn)checks count as fixedThe first
tools_refrun (before the}handling) still had 3 differences, allwr(bn...)statements right after acomplete(...) { ... }block; the fix is in this commit.Directly against both builds on the Geofabrik Nova Scotia extract: for the regression-suite query
[bbox:44.703329,-63.574712,44.754166,-63.273851]; node->.s1; wr(bn.s1)["direction"!~"forward"]->.s4; .s4 out count;,masterreturns 0 ways and the candidate 13,759, which ismaster's answer to the rewritten query; likewise fornode[highway=traffic_signals]; wr(bn)[highway];(implicit_) andwr.y(bn.n)in the Halifax bbox.test_fuzz.py's "timeouts are not cached" check fails on this branch and identically onbench-toolswithout it (a timing-dependent test, run on a loaded VM); unrelated.Limitations
propsworkflow always usesbench-tools, so its CI result is only visible after merge.Generated by Claude Code