Skip to content

props: a filter alone must agree with the same filter plus (if:1) - #288

Open
cldellow wants to merge 1 commit into
bench-toolsfrom
props-if-one
Open

cldellow wants to merge 1 commit into
bench-toolsfrom
props-if-one

Conversation

@cldellow

Copy link
Copy Markdown
Owner

Change

A new property for bench/props/props.py: a filter alone must give the same result as the same filter with (if:1) added.

A statement whose only clause is a filter (way(bn.n), node(bbox), rel(id:...), ...) runs as that filter's own statement (Recurse_Statement, Bbox_Query_Statement, ...). With a second clause, it becomes a query statement and the filter runs as a constraint instead (Recurse_Constraint, ...), which is separate code. (if:1) keeps every element and adds no ranges or keys, so t F; and t F(if:1); must return the same elements. A difference is a bug in one of the two implementations.

  • bench/props/standalone.py generates the pairs for every filter that has its own statement, with each element type it parses with (probed against upstream/master): ids, a single id, bbox, poly:, around a point and a set, area, pivot, uid, user, relation members with and without a role, bn (way, rel, wr; with a role way, rel), bw, br, w, and newer (rel only; it can't stand alone for other types, and changed can't at all). Filters valid for all seven types run with three of them per seed, chosen at random.
  • History: with --history-import-bin, the same checks run at three of the history dates.
  • props.py runs them through the existing run_pairs, as i… (current) and hi… (history) checks. Own random streams, so other checks of a seed are unchanged.
  • bench/README.md describes the check.

Results

10 seeds with history (1,600 pairs, 95 s):

  • upstream/master 60bb094 (as the candidate, no baseline): fails every seed on wr(bn.n) against wr(bn.n)(if:1), current and past dates: the constraint bug fixed by recurse: handle wr(bn) in the query constraint #193. It also fails 3 seeds on node(pivot.a). On its own, that statement returns the area's relation; Pivot_Statement::execute ignores the element type. On a Nova Scotia extract, area(3609092218)->.a; node(pivot.a); out ids; returns relation 9092218, while node(pivot.a)(if:1) returns nothing (way, rel, nwr and nw agree in both forms).
  • recurse: handle wr(bn) in the query constraint #193 against upstream/master: no new failures; the 40 wr(bn) differences count as fixed, and the 3 pivot failures as shared with the baseline.

Every other filter and type agrees.


Generated by Claude Code

A statement whose only clause is a filter (way(bn.n), node(bbox), ...) runs as
that filter's own statement; with a second clause, the filter runs as a
constraint of a query statement instead, which is separate code. (if:1) keeps
every element and adds no ranges or keys, so t F; and t F(if:1); must return
the same elements.

The new standalone.py generates these pairs for every filter that has its
own statement and each element type it parses with, on the current and the
history database. On upstream/master it catches the wr(bn) constraint bug
(every seed) and finds that node(pivot.a) alone returns the area's relation.

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