Skip to content

heronin: map math and a small map tile cache - #44

Merged
fizzy-pm[bot] merged 2 commits into
mainfrom
heronin/map-tiles
Nov 12, 2026
Merged

fizzy-pm[bot] merged 2 commits into
mainfrom
heronin/map-tiles

Conversation

@fizzy-windows

@fizzy-windows fizzy-windows Bot commented Nov 12, 2026

Copy link
Copy Markdown

heronin: map math and a small map tile cache

Part of fizzyedit/work#1213

In plain words

This adds the groundwork for showing photo locations on a map. It works out which map pieces are needed and keeps a small set available for reuse.

What changes

  • Map positions and the starting zoom can be calculated from photo locations.
  • Map pieces load two at a time, with room for 64 pieces in memory.
pub const tile_px = 256;
pub const min_zoom = 3;
pub const max_zoom = 16;

What you will notice

Nothing visible: internal groundwork for the map view in a later change.

How we know it works

Three map-math tests check positions, fitting and edge tiles. Two cache tests check request limits, saved image bytes, failed requests, eviction, sign-out and cancellation using an in-process fake. All six requested gates passed.

How this serves fizzy

The platform goal moves forward with reusable map groundwork for photo locations.

For agents: technical summary

Goal

Provide Mercator math and a bounded tile cache for M1b-1.

What changed and why

Exported model.mercator; added a page-allocator-backed cache with 64 entries, 16 wanted keys and at most two concurrent GETs. Failed entries remain cached until eviction. Deinit cancels outstanding jobs and frees retained bodies and URLs.

Budget: 116 ADDED non-test lines; 223 added+deleted lines across the seven implementation/test files. Counts use git diff --numstat HEAD plus line counts for the four untracked new Zig files; *_tests.zig is excluded only from the first count. Handoff documents are outside the implementation diff budget.

How it was verified

  • zig fmt --check build.zig tools tests/check_public model app server: passed.
  • zig build: 55/55 steps succeeded.
  • zig build server: 3/3 steps succeeded.
  • zig build test: 54/54 steps succeeded; latest changed test run reported 61/61 tests passed, with other test artifacts cached.
  • zig build web: 55/55 steps succeeded.
  • zig build check-public: 3/3 steps succeeded.

Not done / follow-ups

Map view integration belongs to M1b-2. No server or build-file changes. No screenshots or socket-based tests added.

Part of fizzyedit/work#1213

Signed-off-by: fizzy foxnne-desktop-codex-2 <slot+foxnne-desktop-codex-2@fizzy.invalid>
@fizzy-pm fizzy-pm Bot added the pm:fixes author fixes the must-fix items label Nov 12, 2026
Signed-off-by: fizzy pop-os-codex-1 <slot+pop-os-codex-1@fizzy.invalid>
@fizzy-publish

fizzy-publish Bot commented Nov 12, 2026

Copy link
Copy Markdown

Rework published.

@fizzy-pm fizzy-pm Bot added pm:fixes author fixes the must-fix items and removed pm:fixes author fixes the must-fix items labels Nov 12, 2026
@fizzy-pm
fizzy-pm Bot merged commit e9d6022 into main Nov 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants