No reviewers
Labels
No labels
blocked
claude-wip
map-report
map:is
map:se
needs-review
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
art/ismap!145
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue-144-tile-tool-cleanup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #144
#144: tile tool cleanup — the #142 review's non-blocking items
All eight items from the #142 review (comment 1643), each confirmed still open
in main's
importer/tiles.gobefore this branch.The items
--size-layer <name>— comma-separated, likeimport --layer. Filtersthe layers
runTileSizeprocesses and composes with--size-zooms(verified:tiles --size --size-layer cover --size-zooms 3-5 conf/semap.yamlruns onelayer over the window in ~1.5 s). Unknown names error before any DB work,
mirroring
selectedLayers(--size-layer bogus→ exit 1).the same evidence budget
probeTilealready sampled, via one shared const(
sampleRows). The weight ranking is a heuristic; the cap is documented incode and in
docs/importer-cli.md. Before:tiles --size conf/semap.yamlwalked Sweden's 5.4M-row z13 cover partition whole. After: a full cover pass
(z3–z13) is ~12 s.
sizeOneZoomcounts fetcherrors (
fetch_errorsin the JSON;-- N candidate fetch(es) failed; not rankedin the table) instead of appendingmeasured{0,0}and letting thetop-N sort discard it silently. The
--checkMISSING pattern, applied to--size.make tile-benchadded one per run. Fix chosen: commit combo summaries,keep per-tile detail local. New
--bench-summaryflag omits the per-tiletilesarrays (combo summaries keep total/avg bytes and the latencypercentiles);
make tile-benchpasses it; the oversized committed file isremoved and replaced by a fresh summary-form record (12,391 B for both
funcs — back at the repo's 1–2 kB record convention). The per-tile
z/x/y/bytes/ms rows remain available from a direct
importer tiles --bench conf/ismap.yaml > file.jsonrun (475,916 B, 81tiles × 20 combos × 2 funcs). Justification: the committed record's job is
the weight/latency trend per combo; one run's per-tile dump is analysis
material that should not churn the repo on every bench run.
strconv.Atoiafter trimming thesurrounding whitespace Sscanf's
%dtolerated.--size-zooms 5xerrors(exit 1,
invalid syntax) instead of silently meaning 5.tileTarget.tableAtZoom— the inline re-derivationof the same prefix is gone; one code path for the probe-table name.
tileTargetsskipsl.Static != nilwith a comment: a static layer is one table, no cascade,no
zxy_function (swapSQLskipsmvtFuncfor it), so neither--checknor
--sizeapplies, and a naive zoom-suffixed probe table would not existand report a silent EMPTY. Latent (no config declares one today) but now
impossible to hit silently. Unit-tested (
TestTileTargetsSkipsStatic).decodeMVTTile's error path is real:mvtFieldsreturnserrors for malformed varints (previously an unterminated varint looped
forever:
uvarintreturned 0,0 and the walk never advanced), payload spanspast the end of the buffer, and unknown wire types — the three call sites'
checks now do real work.
probeTileno longer computes annits formatstring never referenced. The Sweden whole-country bench combo is
sweden-whole-country, matching the<country>-whole-countryconvention.Verification
make build,go vet ./importer,make test— clean; new unit tests:parseIntStrict(trailing garbage, whitespace, negatives),parseTileSizeZooms(
5x/5-/-5/9-3/0-25errors),parseTileSizeLayers(empty → all,unknown → error, duplicates),
tableAtZoom, static-layer skip,decoder malformed-input errors (4 cases + truncated layer), bench summary
omitempty.
importer tiles --check conf/ismap.yaml— all 34 results PASS (unchangedfrom before the branch; R121 semantics untouched).
importer tiles --size --size-layer cover conf/semap.yaml— one layer,~12 s (was minutes).
importer tiles --size conf/ismap.yaml --size-zooms 5-6— full pass overthe window in ~1.9 s, empty layers reported as
(no candidates).importer tiles --bench conf/ismap.yamlvs--bench --bench-summary conf/ismap.yaml— 475,916 B (per-tile detail)vs 12,391 B (summaries only); both parse.
importer tiles --size --size-zooms 5x conf/ismap.yamland--size-layer bogus conf/ismap.yaml— exit 1 with a clear message.importer help tilesdocuments--size-layerand--bench-summary.No acceptance tests were added or changed: every fix here is CLI parsing,
filtering or reporting — behavior covered by the Go unit tests above. None of
it is a SQL verdict against the database (the R121 check's semantics are
untouched, and it is already an acceptance test), so the SQL acceptance-test
mechanism has nothing to gain here.