Skip to content

fuzz.py, props.py: accept wr(bn...) differences that match the baseline's way + relation answer - #245

Merged
cldellow merged 1 commit into
bench-toolsfrom
wr-bn-allow-list
Nov 26, 2026
Merged

cldellow merged 1 commit into
bench-toolsfrom
wr-bn-allow-list

Conversation

@cldellow

Copy link
Copy Markdown
Owner

Fixes #244.

Change

New bench/wr_union.py: wr_as_union(query) rewrites each top-level wr...(bn...)... statement as its way and relation halves, both reading the same _:

._->.wrbnin; way(bn.s)[f]->.wrbnway; .wrbnin->._; rel(bn.s)[f]->.wrbnrel; .wrbnin->._; (.wrbnway; .wrbnrel;)->TARGET

wr is defined as way plus relation with the same filters, and master answers way(bn) and rel(bn) correctly; only its wr(bn) form is wrong (#192). The save and restore of _ matter: inside a plain union, the second statement would read the first's result.

  • fuzz.py: a DIFFERENT query 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 is expected-wr-bn instead of DIFFERENT. The workflows count it like any other verdict and fail only on DIFFERENT (exit status).
  • props.py: run_checks, run_pairs and run_output_checks count such a difference as fixed.

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-changes a71b7e3 against upstream/master a9d8f15:

Workflow Before With this branch (tools_ref)
fuzz, seed 1, 6,000 queries 20 of 30 shards failed passed: 0 DIFFERENT, 38 expected-wr-bn, 14 skipped (baseline timeouts, as before)
history, seed 1, 2,000 queries 10 of 20 shards failed passed: 0 DIFFERENT, 11 expected-wr-bn, 1 skipped
props (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) 29 failures no new failures; the wr(bn) checks count as fixed

The first tools_ref run (before the } handling) still had 3 differences, all wr(bn...) statements right after a complete(...) { ... } 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;, master returns 0 ways and the candidate 13,759, which is master's answer to the rewritten query; likewise for node[highway=traffic_signals]; wr(bn)[highway]; (implicit _) and wr.y(bn.n) in the Halifax bbox.

test_fuzz.py's "timeouts are not cached" check fails on this branch and identically on bench-tools without it (a timing-dependent test, run on a loaded VM); unrelated.

Limitations

  • The props workflow always uses bench-tools, so its CI result is only visible after merge.
  • Accepted queries cost one extra baseline run each.

Generated by Claude Code

…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
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.

2 participants