Skip to content

fix: resolve and suggest Portuguese addresses as they are usually written - #231

Merged
Mokto merged 1 commit into
mainfrom
fix/portugal-native-address-forms
Oct 20, 2026
Merged

Mokto merged 1 commit into
mainfrom
fix/portugal-native-address-forms

Conversation

@Mokto

@Mokto Mokto commented Oct 20, 2026 •

Copy link
Copy Markdown
Owner

Summary

Follow-up to #224 for #222. Portuguese addresses written the native way (Rua da República, 15, 5370-347 Mirandela, Rua José Relvas nº 13, …, often with no country) now resolve in SearchAddress and complete in SuggestAddress. On seven native forms of each passing panel group, SearchAddress went from 75/133 to 131/133 and SuggestAddress from 12/133 to 131/133.

Changes

  • Without a stated country, a postcode written NNNN-NNN now enables the Portuguese register spelling (Rua dos Farias to R FARIAS) in both search and SuggestAddress. No other country writes postcodes this way. A town alone or an ambiguous postcode like 50667 implies nothing: the resolver retries without the country, and a country-scoped spelling found that way would override a stated one (this broke two authored synthetic guards in a first version).
  • SuggestAddress reads a house number written as its own comma part (Rua X, 12, …; up to four digits and an optional letter, so never a postcode).
  • SuggestAddress skips nº, n.º and n° marks.
  • SuggestAddress splits a comma-less part before a known postcode that follows the number (Rua dos Farias 12 2955-243 Pinhal Novo).
  • A postcode with no town after it now scopes the house too.

Not handled: B.º for Bairro (2 queries). Results, the open no-country case and the source-coverage note are in docs/evaluation/triage/portugal.md.

Review focus

The portuguese_postcode gate in Index::streets and the no-country branch in suggest.rs; the rest is mechanical.

Checked locally on the full index against main: held-out native forms (28 queries, scored only) went from 16/28 to 28/28 in search and 4/28 to 28/28 in suggest. The 21,282-case gold diff, run twice, left SearchAddress unchanged and gave SuggestAddress +34 (31 Dutch no-comma queries, 2 Spanish and 1 Italian with the number as its own part) with nothing newly failing or worse. cargo fmt --check, clippy -D warnings and cargo test pass, as do the synthetic tests run separately. --include-ignored hangs locally in resolve_follows_the_authored_facts on main too. Local speed was not measurable (host load swung widely), so CI gold-speed needs reading. tests/rpc.rs was not rerun.

Rebased onto 37b3237 after the first CI gold run could not start (the gateway began requiring the chart sources that #232 sends). On the rebased commit, CI gold-full and gold-speed pass: SearchAddress unchanged, SuggestAddress +34 (same 31 NL / 2 ES / 1 IT cases), no regressions, no slowdown over 10%.

Refs #222

@codspeed

codspeed Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 8 untouched benchmarks
⏩ 2 skipped benchmarks1


Comparing fix/portugal-native-address-forms (b7cb9c5) with main (a0da3e0)

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

…tten

Comma-separated and nº house numbers, no commas before the postcode, and no country: a postcode written NNNN-NNN lets the register spelling apply. Native forms of the PT panel's passing groups: search 75 -> 131/133 (held-out 16 -> 28/28), suggest 12 -> 131/133 (held-out 4 -> 28/28). Full gold: search unchanged, suggest +34 (31 NL, 2 ES, 1 IT), none lost. Refs #222.
@Mokto
Mokto force-pushed the fix/portugal-native-address-forms branch from ca010e0 to b7cb9c5 Compare October 20, 2026 11:45
@github-actions

Copy link
Copy Markdown

Speed, full index: no slowdown over 10%

Details

SearchAddress

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

Total p50 p90 p99 Max
base 5010.3 1.8 4.6 14.6 21.1
head 4988.1 1.7 4.6 13.3 22.7
change -0% -1% +1% -8% +8%

SuggestAddress

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

Total p50 p90 p99 Max
base 2179.5 0.9 1.7 3.4 12.1
head 2172.1 0.9 1.7 3.3 10.7
change -0% -0% +1% -5% -12%

ReverseGeocode

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

Total p50 p90 p99 Max
base 1512.1 0.7 1.0 3.0 5.6
head 1520.2 0.7 1.0 3.0 5.8
change +1% +1% +0% -2% +3%

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

Base 37b3237 → b7cb9c5, one after the other in one pod on the same node and index.

@github-actions

Copy link
Copy Markdown

Gold check, full index: no regressions

RPC Checked Pass base Pass head Change Results changed
SearchAddress 21203 16921 16921 0 0
SuggestAddress 21287 15098 15132 +34 (+0.2%) 34
ResolveRegion 3341 3322 3322 0 0
ReverseGeocode 20881 20755 20755 0 0

Pass rate by country

Passing checks out of those checked, baseline → candidate, for the 3 expected countries 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 %
Netherlands 1355 / 1378 98.3% 1094 → 1125 / 1258 (+31) 87.0% → 89.4% 1375 / 1376 99.9% 32 / 33 97.0%
Spain 1195 / 1909 62.6% 812 → 814 / 1777 (+2) 45.7% → 45.8% 1904 / 1906 99.9% 36 / 36 100.0%
Italy 122 / 133 91.7% 139 → 140 / 152 (+1) 91.4% → 92.1% 127 / 130 97.7% 30 / 30 100.0%
Runs
  • baseline: base, backend overture-index data index a5e6bf47af65, consumer binary 8eacdc6e38ba models 2de098b5667f
  • candidate: head, backend overture-index data index a5e6bf47af65, consumer binary 596e6f6c106c models 2de098b5667f

SuggestAddress

Check Checked Pass base Pass head Change ranked_low missing unexpected error
full 20333 14298 14332 +34 0 6001 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) (34)
  • nl_degraded-neerijnen-54-3772er-barneveld-netherlands suggest full missing -> pass: "Neerijnen 54 3772ER Barneveld Netherlands" -> rank 1 (want <= 5); first address 54, Neerijnen, Barneveld, Barneveld, Gelderland, Netherlands [nl]
  • nl_degraded-julianalaan-13-3417gj-montfoort-netherlands suggest full missing -> pass: "Julianalaan 13 3417GJ Montfoort Netherlands" -> rank 1 (want <= 5); first address 13, Julianalaan, Montfoort, Montfoort, Utrecht, Netherlands [nl]
  • nl_degraded-chopinstraat-51-5481lp-schijndel-netherlands suggest full missing -> pass: "Chopinstraat 51 5481LP Schijndel Netherlands" -> rank 1 (want <= 5); first address 51, Chopinstraat, Schijndel, Meierijstad, North Brabant, Net [nl]
  • address-via-bernardo-clesio-5-38122-trento-italy suggest full missing -> pass: "Via Bernardo Clesio, 5, 38122 Trento, Italy" -> rank 1 (want <= 5); first address 5, Via Cardinale Bernardo Clesio, Trento, Autonoma di Trento [it]
  • address-alkolea-7-20012-san-sebasti-n-spain suggest full missing -> pass: "Alkolea, 7, 20012 San Sebastián, Spain" -> rank 1 (want <= 5); first address 7, CALLE ALKOLEA, San Sebastián, Gipuzkoa, Autonomous Commun [es]
  • address-calle-santa-mar-a-la-rica-3-28801-alcal-de-henar suggest full missing -> pass: "Calle Santa María La Rica, 3, 28801 Alcalá de Henares, Spain" -> rank 1 (want <= 5); first address 3, CALLE SANTA MARIA LA RICA, Alcalá de Henares, Community o [es]
  • nl_degraded-hoogstraat-51a-8861ae-harlingen-netherlands suggest full missing -> pass: "Hoogstraat 51A 8861AE Harlingen Netherlands" -> rank 1 (want <= 5); first address 51a, Hoogstraat, Harlingen, Harlingen, Frisia, Netherlands [nl]
  • nl_degraded-kiryat-onoplein-47-9203ks-drachten-netherlands suggest full missing -> pass: "Kiryat-Onoplein 47 9203KS Drachten Netherlands" -> rank 1 (want <= 5); first address 47, Kiryat-Onoplein, Drachten, Smallingerland, Frisia, Nethe [nl]
  • nl_degraded-grotestraat-94a-7607cv-almelo-netherlands suggest full missing -> pass: "Grotestraat 94a 7607CV Almelo Netherlands" -> rank 1 (want <= 5); first address 94a, Grotestraat, Almelo, Almelo, Overijssel, Netherlands [nl]
  • nl_degraded-hyacinthstraat-48-7572bc-oldenzaal-netherlands suggest full missing -> pass: "Hyacinthstraat 48 7572BC Oldenzaal Netherlands" -> rank 1 (want <= 5); first address 48, Hyacinthstraat, Oldenzaal, Oldenzaal, Overijssel, Nether [nl]
  • nl_degraded-wilhelminastraat-9-3861ka-nijkerk-netherlands suggest full missing -> pass: "Wilhelminastraat 9 3861KA Nijkerk Netherlands" -> rank 1 (want <= 5); first address 9, Wilhelminastraat, Nijkerk, Nijkerk, Gelderland, Netherlan [nl]
  • nl_degraded-mari-ndaal-4-6891at-rozendaal-netherlands suggest full missing -> pass: "Mariëndaal 4 6891AT Rozendaal Netherlands" -> rank 1 (want <= 5); first address 4, Mariëndaal, Rozendaal, Rozendaal, Gelderland, Netherlands [nl]
  • nl_degraded-tak-van-poortvlietstraat-20-7204mv-zutphen-nethe suggest full missing -> pass: "Tak van Poortvlietstraat 20 7204MV Zutphen Netherlands" -> rank 1 (want <= 5); first address 20, Tak van Poortvlietstraat, Zutphen, Zutphen, Gelderland, [nl]
  • nl_degraded-veldpoortstraat-6a-3961bl-wijk-bij-duurstede-net suggest full missing -> pass: "Veldpoortstraat 6a 3961BL Wijk bij Duurstede Netherlands" -> rank 1 (want <= 5); first address 6a, Veldpoortstraat, Wijk bij Duurstede, Wijk bij Duurstede, [nl]
  • nl_degraded-dompvloedslaan-9a-2051na-overveen-netherlands suggest full missing -> pass: "Dompvloedslaan 9a 2051NA Overveen Netherlands" -> rank 1 (want <= 5); first address 9a, Dompvloedslaan, Overveen, Bloemendaal, North Holland, Ne [nl]
  • nl_degraded-anne-franklaan-383-1443hl-purmerend-netherlands suggest full missing -> pass: "Anne Franklaan 383 1443HL Purmerend Netherlands" -> rank 1 (want <= 5); first address 383, Anne Franklaan, Purmerend, Purmerend, North Holland, Ne [nl]
  • nl_degraded-achterweg-57-1424pp-de-kwakel-netherlands suggest full missing -> pass: "Achterweg 57 1424PP De Kwakel Netherlands" -> rank 1 (want <= 5); first address 57, Achterweg, De Kwakel, Uithoorn, North Holland, Netherlan [nl]
  • nl_degraded-prins-bernhardstraat-25-4205bh-gorinchem-netherl suggest full missing -> pass: "Prins Bernhardstraat 25 4205BH Gorinchem Netherlands" -> rank 1 (want <= 5); first address 25, Prins Bernhardstraat, Gorinchem, Gorinchem, South Hollan [nl]
  • nl_degraded-papenhoeflaan-49-15-3421xn-oudewater-netherlands suggest full missing -> pass: "Papenhoeflaan 49-15 3421XN Oudewater Netherlands" -> rank 1 (want <= 5); first address 49-15, Papenhoeflaan, Oudewater, Oudewater, Utrecht, Netherl [nl]
  • nl_degraded-nieuwe-maasstraat-91-3114th-schiedam-netherlands suggest full missing -> pass: "Nieuwe Maasstraat 91 3114TH Schiedam Netherlands" -> rank 1 (want <= 5); first address 91, Nieuwe Maasstraat, Schiedam, Schiedam, South Holland, Ne [nl]
  • nl_degraded-jan-van-galenstraat-20-4535bx-terneuzen-netherla suggest full missing -> pass: "Jan van Galenstraat 20 4535BX Terneuzen Netherlands" -> rank 1 (want <= 5); first address 20, Jan van Galenstraat, Terneuzen, Terneuzen, Zeeland, Neth [nl]
  • nl_degraded-adriatischezeestraat-5-4388gk-oost-souburg-nethe suggest full missing -> pass: "Adriatischezeestraat 5 4388GK Oost-Souburg Netherlands" -> rank 1 (want <= 5); first address 5, Adriatischezeestraat, Oost-Souburg, Vlissingen, Zeeland, [nl]
  • nl_degraded-den-dries-29-5126ec-gilze-netherlands suggest full missing -> pass: "Den Dries 29 5126EC Gilze Netherlands" -> rank 1 (want <= 5); first address 29, Den Dries, Gilze, Gilze en Rijen, North Brabant, Netherl [nl]
  • nl_degraded-st-barbarastraat-4-5688tm-oirschot-netherlands suggest full missing -> pass: "St. Barbarastraat 4 5688TM Oirschot Netherlands" -> rank 1 (want <= 5); first address 4, Sint Barbarastraat, Oirschot, Oirschot, North Brabant, Ne [nl]
  • nl_degraded-heems-weer-18-1151et-broek-in-waterland-netherla suggest full missing -> pass: "Heems Weer 18 1151ET Broek in Waterland Netherlands" -> rank 1 (want <= 5); first address 18, Heems Weer, Broek in Waterland, Waterland, North Holland [nl]
  • nl_degraded-marktstraat-187-6431lp-hoensbroek-netherlands suggest full missing -> pass: "Marktstraat 187 6431LP Hoensbroek Netherlands" -> rank 1 (want <= 5); first address 187, Marktstraat, Hoensbroek, Heerlen, Limburg, Netherlands [nl]
  • nl_degraded-ceresstraat-86-6291xx-vaals-netherlands suggest full missing -> pass: "Ceresstraat 86 6291XX Vaals Netherlands" -> rank 1 (want <= 5); first address 86, Ceresstraat, Vaals, Vaals, Limburg, Netherlands [nl]
  • nl_degraded-van-oosthuyselaan-47-3971pe-driebergen-rijsenbur suggest full missing -> pass: "van Oosthuyselaan 47 3971PE Driebergen-Rijsenburg Netherlands" -> rank 1 (want <= 5); first address 47, van Oosthuyselaan, Driebergen-Rijsenburg, Utrechtse Heuv [nl]
  • nl_degraded-zaagmolen-13-4301nk-zierikzee-netherlands suggest full missing -> pass: "Zaagmolen 13 4301NK Zierikzee Netherlands" -> rank 1 (want <= 5); first address 13, Zaagmolen, Zierikzee, Schouwen-Duiveland, Zeeland, Nethe [nl]
  • nl_degraded-gelrestraat-53-6101ev-echt-netherlands suggest full missing -> pass: "Gelrestraat 53 6101EV Echt Netherlands" -> rank 1 (want <= 5); first address 53, Gelrestraat, Echt, Echt-Susteren, Limburg, Netherlands [nl]
  • nl_degraded-de-savornin-lohmanstraat-30-6662aj-elst-netherla suggest full missing -> pass: "De Savornin Lohmanstraat 30 6662AJ Elst Netherlands" -> rank 1 (want <= 5); first address 30, De Savornin Lohmanstraat, Elst, Overbetuwe, Gelderland, [nl]
  • nl_degraded-bellefleur-61-2635ml-den-hoorn-netherlands suggest full missing -> pass: "Bellefleur 61 2635ML Den Hoorn Netherlands" -> rank 1 (want <= 5); first address 61, Bellefleur, Den Hoorn, Midden-Delfland, South Holland, N [nl]
  • nl_degraded-heerengracht-22-8061hw-hasselt-netherlands suggest full missing -> pass: "Heerengracht 22 8061HW Hasselt Netherlands" -> rank 1 (want <= 5); first address 22, Heerengracht, Hasselt, Zwartewaterland, Overijssel, Neth [nl]
  • nl_degraded-ommegang-39-9951lh-winsum-netherlands suggest full missing -> pass: "Ommegang 39 9951LH Winsum Netherlands" -> rank 1 (want <= 5); first address 39, Ommegang, Winsum, Het Hogeland, Groningen, Netherlands [nl]

Landmark checks (head)

Check Cohort pass ranked_low missing unexpected error
full suggest_landmark 53 0 18 0 0
off suggest_landmark 71 0 0 0 0
Check Cohort pass empty wrong_place wrong_region wrong_country
--- --- ---: ---: ---: ---: ---:

@Mokto
Mokto merged commit 43cc3e8 into main Oct 20, 2026
11 checks passed
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