Skip to content

fix: suggest Canadian houses whose source omits the street direction, and reject the opposite one - #515

Merged
Mokto merged 1 commit into
mainfrom
fix/ca-suggest-retries
Nov 3, 2026
Merged

Mokto merged 1 commit into
mainfrom
fix/ca-suggest-retries

Conversation

@Mokto

@Mokto Mokto commented Nov 3, 2026

Copy link
Copy Markdown
Owner

Summary

Canadian mailing forms such as 31 THATCHER DR E, MOOSE JAW, SK S6J 1L8 now get a house suggestion when the source writes the street without its direction (Thatcher Drive). Search already handled these; suggestions did not. The existing search retry also had a defect: it could answer a road with the opposite direction, so 870 6e Rue Est returned 6e Rue O as a good match. Both now reject a road whose direction the query does not state.

Changes

  • SuggestAddress retries without the street direction when no address was suggested, for Canada or no country filter only. The postcode stays in the text, so a suggested house must carry the stated postcode, and only Canadian houses with the exact requested number (and suffix) are kept.
  • New ca::other_street_direction rejects a road that has a direction the query's street part lacks. Ouest, O and W count as the same direction. A source that omits the direction is not a conflict. Applied to both the search and suggest retries.
  • Adds a synthetic Canadian street (Thistle Bend Drive) with search and suggest checks, including wrong or missing postcode, missing number or suffix, opposite direction and a US country filter, plus a unit test for the direction check.

Review focus

Check other_street_direction for how it treats the query's street part (text before the first comma) and the road's direction words.

@codspeed

codspeed Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 8 untouched benchmarks
⏩ 2 skipped benchmarks1


Comparing fix/ca-suggest-retries (97e8866) with main (62cd2e5)

Open in CodSpeed

Footnotes

  1. 2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@Mokto
Mokto force-pushed the fix/ca-suggest-retries branch from 0773029 to 97e8866 Compare November 3, 2026 16:14
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

Speed, full index: no slowdown over 15%

Details

SearchAddress

Time in ms over 1993 cases, each the fastest of 3 requests.

Total p50 p90 p99 Max
base 5173.5 1.6 4.9 17.1 31.2
head 4813.7 1.5 4.3 15.7 30.1
change -7% -6% -13% -8% -3%

SuggestAddress

Time in ms over 2136 checks, each the fastest of 3 requests.

Total p50 p90 p99 Max
base 2409.0 0.9 1.6 5.2 18.4
head 2330.3 0.9 1.5 4.8 18.9
change -3% -1% -5% -9% +3%

ReverseGeocode

Time in ms over 1990 cases, each the fastest of 3 requests.

Total p50 p90 p99 Max
base 1569.4 0.7 1.0 2.2 5.5
head 1540.1 0.7 1.0 2.3 6.5
change -2% -2% +0% +3% +19%

Fails when the total, p50, p90 or p99 of any table is more than 15% slower. Runs of one binary differ by up to 5%; the max is one request and only reported.

Base 62cd2e5 → 97e8866, one after the other in one pod on the same node and index.

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

Gold check, full index: no regressions

RPC Checked Pass base Pass head Change Results changed
SearchAddress 46184 39876 39876 0 0
SuggestAddress 49720 41469 41477 +8 (+0.0%) 8
ResolveRegion 8037 7849 7849 0 0
ReverseGeocode 45806 40160 40160 0 0
ReverseGeocode offset 39416 37607 37607 0 0

Pass rate by country

Passing checks out of those checked, baseline → candidate, for the 1 expected country where any RPC changed. A case that expects several countries has its own row. Counts are checks, not independent locations.

Country SearchAddress % SuggestAddress % ReverseGeocode % ResolveRegion %
Canada 611 / 693 88.2% 624 → 632 / 717 (+8) 87.0% → 88.1% 1036 / 1338 77.4% 42 / 42 100.0%
Runs
  • baseline: base, backend overture-index data index 0074563b582a, consumer binary 31aadb0bd529 models 2de098b5667f
  • candidate: head, backend overture-index data index 0074563b582a, consumer binary 0f88c0bde62f models 2de098b5667f

SuggestAddress

Check Checked Pass base Pass head Change ranked_low missing unexpected error
full 45455 38883 38891 +8 0 6564 0 0

full types the query; name types the place's name alone, which must come no later than the places of that name with more population. off requires no landmarks with the flag false. The last four columns count the head's failures.

Newly passing (verify before relabelling) (8)
  • ca_direction-161-wishart-point-rd-e-tabusintac-nb-e9h-1k2-can suggest full missing -> pass: "161 WISHART POINT RD E, TABUSINTAC, NB E9H 1K2, Canada" -> rank 1 (want <= 5); first address 161, Wishart Point Road, Alnwick Parish, Municipality of Aln [ca]
  • ca_direction-1235-gulf-shore-pky-e-stanhope-pe-c0a-1p0-canada suggest full missing -> pass: "1235 GULF SHORE PKY E, STANHOPE, PE C0A 1P0, Canada" -> rank 1 (want <= 5); first address 1235, Gulf Shore PKY, Stanhope, Rural Municipality of North [ca]
  • ca_direction-31-thatcher-dr-e-moose-jaw-sk-s6j-1l8-canada suggest full missing -> pass: "31 THATCHER DR E, MOOSE JAW, SK S6J 1L8, Canada" -> rank 1 (want <= 5); first address 31, Thatcher Drive, Moose Jaw, Saskatchewan, Canada [ca]
  • ca_suffix-716e-douglas-park-cres-e-regina-sk-s4n-2s2-canad suggest full missing -> pass: "716E DOUGLAS PARK CRES E, REGINA, SK S4N 2S2, Canada" -> rank 1 (want <= 5); first address 716e, Douglas Park Crescent, Regina, Regina, Saskatchewan, C [ca]
  • ca_suffix-1602e-hannon-bay-e-regina-sk-s4v-0s8-canada suggest full missing -> pass: "1602E HANNON BAY E, REGINA, SK S4V 0S8, Canada" -> rank 1 (want <= 5); first address 1602e, Hannon Bay, Regina, Regina, Saskatchewan, Canada [ca]
  • ca_suffix-1926e-truesdale-dr-e-regina-sk-s4v-0m4-canada suggest full missing -> pass: "1926E TRUESDALE DR E, REGINA, SK S4V 0M4, Canada" -> rank 1 (want <= 5); first address 1926e, Truesdale Drive, Regina, Regina, Saskatchewan, Canada [ca]
  • ca_direction-162-klondike-hwy-n-whitehorse-yt-y1a-5w5-canada suggest full missing -> pass: "162 KLONDIKE HWY N, WHITEHORSE, YT Y1A 5W5, Canada" -> rank 1 (want <= 5); first address 162, Klondike Highway, Whitehorse, Yukon, Canada [ca]
  • ca_direction-162-north-klondike-hwy-whitehorse-yt-y1a-5w5-can suggest full missing -> pass: "162 North Klondike HWY, Whitehorse, YT Y1A 5W5, Canada" -> rank 1 (want <= 5); first address 162, Klondike Highway, Whitehorse, Yukon, Canada [ca]

@Mokto
Mokto merged commit 9f5030e into main Nov 3, 2026
20 checks passed
@Mokto
Mokto deleted the fix/ca-suggest-retries branch November 3, 2026 17:26
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.

1 participant