Skip to content

props: accept around radius 0 dropping one-unit neighbours - #263

Merged
cldellow merged 1 commit into
bench-toolsfrom
props-around0-both
Nov 28, 2026
Merged

cldellow merged 1 commit into
bench-toolsfrom
props-around0-both

Conversation

@cldellow

Copy link
Copy Markdown
Owner

Lets props accept both answers for around with radius 0 between nodes one storage unit apart, until upstream settles the semantics (#261). Needed for #262's props run to pass. Targets bench-tools, where the props workflow takes props.py from.

Change

bench/props/props.py gets around0_agrees(data, query, cand, base), used next to wr_bn_agrees in run_checks and run_pairs. A candidate/baseline difference counts as fixed (not a failure) when all of these hold:

  • the query contains around with radius 0 (around:0 or around.SET:0);
  • both builds exit with status 0;
  • the candidate's result is a strict subset of the baseline's;
  • every element only the baseline returns has a position next to another node exactly one unit (1e-7°) away, in latitude, longitude or both. An element's positions are its own (nodes), its nodes' (ways), or its member nodes' and member ways' nodes' (relations), in any version for the history data.

Anything else, including a candidate that adds results, still fails. The helper element_positions reads both the plain Data and the History model. One file, +50/−1.

Why

On upstream/master 555f744, around:0 matches a node one unit from an input point only when the candidate lies inside an input way's box: there the 1e-8 box pre-check is skipped, and is_inside's < 1e-7 test lets the neighbour through. #262 makes radius 0 compare stored positions (tolerance 0.5e-7), so it never matches them. The synthetic sets put nodes on a 1e-7 lattice, so props flagged 164 checks on #262 (see the explanation on #262). Real data rarely hits this: #262's fuzz run (6,000 queries) and history run (2,000) show no differences.

Testing

Locally, 4-core VM, --history-import-bin pointing at a better-imports build:

  • around: test input points through the tile index, not every point's bbox #262 (around-bbox-points) against upstream/master 555f744, seeds 1–60: no new failures. The around:0 differences are reported as fixed, for example "date around rel = around members (nodes)" 109 and "(ways)" 34. Failures shared with the baseline are unchanged.
  • Negative check: upstream/master a9d8f15 against 555f744, seeds 1–10. a9d8f15 does match one-unit neighbours, so its results are supersets. That gives 31 new failures, all around checks: the subset guard holds.

Limitations

  • Temporary. Remove it once upstream decides how radius 0 should behave, or once around: test input points through the tile index, not every point's bbox #262 or an equivalent lands upstream and becomes the baseline.
  • Generous by design. It doesn't check that the removed element matched only through the one-unit neighbour, just that such a neighbour exists. Restricting it to around radius 0, strict subsets and lattice neighbours keeps that from hiding other kinds of regression.

Generated by Claude Code

The baseline (upstream/master) counts nodes one storage unit (1e-7 degrees)
apart as coincident under around radius 0 in some cases: when the candidate
lies inside an input way's box, its 1e-8 box pre-check is skipped and
is_inside's 1e-7 test matches the neighbour. PR #262 makes radius 0 compare
stored positions, so it never matches them, and props reported every such
case as a difference from the baseline.

Treat a difference as fixed when the query has around radius 0, both builds
succeed, the candidate's result is a strict subset of the baseline's, and
each element only the baseline returns has a position (its own, its nodes',
or its members') next to another node one unit away. Remove this once
upstream settles the radius-0 semantics (#261).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01736kJUqyDw9zM3Bkh2W2QT
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