feat: complete file-based heightmap migration — tEXt sea_level, client relief, drop BLOB (#963)

- heightmap.rs: read sea_level from the PNG tEXt chunk (bake writes it),
  default-fallback param; new test reads_sea_level_from_text_chunk.
- client atlas_viewer.gd: load reliefmap.png (color display) instead of
  heightmap.png (now 16-bit grayscale elevation, cascade-only).
- drop atlas_body_heightmaps: removed from systems-schema.sql; DROP TABLE in
  import_economics MIGRATION_SQL (the PNG is the store now).
- D-202 amendment: implementation-status note (consumer + producer done),
  resolving the review's 'reads done but producer pending' point.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-23 08:23:23 +02:00
co-authored by Claude Opus 4.7
parent 3b2cd6914e
commit b71f339996
5 changed files with 50 additions and 29 deletions
+4 -12
View File
@@ -462,17 +462,10 @@ CREATE INDEX IF NOT EXISTS idx_atlas_pois_kind ON atlas_pois(kind);
CREATE INDEX IF NOT EXISTS idx_atlas_rivers_body ON atlas_rivers(body_id);
CREATE INDEX IF NOT EXISTS idx_atlas_oceans_body ON atlas_oceans(body_id);
CREATE INDEX IF NOT EXISTS idx_atlas_mountain_ranges_body ON atlas_mountain_ranges(body_id);
-- Heightmap BLOB storage — float32 LE, row-major (D-202, #901)
-- Only inhabited bodies receive rows at build time; uninhabited bodies are
-- generated on-demand by the runtime-background tier.
CREATE TABLE IF NOT EXISTS atlas_body_heightmaps (
body_id TEXT PRIMARY KEY REFERENCES bodies(body_id) ON DELETE CASCADE,
width INTEGER NOT NULL DEFAULT 512,
height INTEGER NOT NULL DEFAULT 256,
data BLOB NOT NULL, -- float32 LE, row-major, width×height values
sea_level REAL NOT NULL DEFAULT 0.0,
imported_at TEXT NOT NULL DEFAULT (datetime('now'))
);
-- Heightmap BLOB storage REMOVED (D-202 amended, #963): canonical elevation is
-- now a per-body 16-bit grayscale heightmap.png file (sea_level in a tEXt
-- chunk), not a systems.db BLOB. The atlas_body_heightmaps table is dropped via
-- MIGRATION_SQL in import_economics.py.
-- City name reservations — replaces authored city positions in markers.json (D-207, #902)
-- Position is generated by the city placement algorithm; name is authored or LLM-generated.
@@ -521,7 +514,6 @@ CREATE TABLE IF NOT EXISTS atlas_city_positions (
score REAL NOT NULL -- match quality [0.0, 1.0]
);
CREATE INDEX IF NOT EXISTS idx_atlas_body_heightmaps_body ON atlas_body_heightmaps(body_id);
CREATE INDEX IF NOT EXISTS idx_atlas_city_names_body ON atlas_city_names(body_id);
CREATE INDEX IF NOT EXISTS idx_atlas_city_names_kind ON atlas_city_names(kind);
CREATE INDEX IF NOT EXISTS idx_atlas_city_names_corp ON atlas_city_names(corp_id);