Files
settled-reach/tooling
jpmschweitzerandClaude Opus 5.5 76e3f3ec96 feat(assets): biome and terrain as two maps, and the bake that writes them (T-1295)
D-258 rulings 5 and 6: the pre-seed biome input is class ids only, on two
maps, because compute_biome was already computing them apart and throwing
one away. It gave every land pixel its Whittaker (climate) class, then painted
terrain over it (ocean bands, ice, altitude snow, mountain rock, lava and ash,
the dry, lunar and ferric ground).

planet_simulation:
- compute_biome_layers returns (biome, terrain). Each rule declares the layer
  it writes, by RULE not by class: ice from the cold climate box is biome,
  altitude snow is terrain with the lowland biome kept beneath. Rules that
  place life (thermophiles, mats, crust, the oasis rings) write the biome and
  clear the terrain under them.
- 255 means "nothing on this layer", not 0, because class 0 is ocean_deep,
  itself terrain. Ids stay literal.
- compute_biome is now compose_layers() of the pair, so the renderers are
  untouched. Proven byte-identical, dtype included, on 65 real bodies: every
  8th standard-atmosphere body plus every thin, thick, reducing and trace one,
  captured before the edit and compared after it.
- simulate() carries both maps as biome_layer / terrain_layer.

reach atlas planet bake-biome [--body --limit --dry-run --check]:
- Writes biomemap.png + terrainmap.png (8-bit, 1024x512, tEXt: layer, none,
  classes, decision) beside each heightmap. Scope is the heightmap bake set
  with an atmosphere (257 bodies; airless are deferred, per D-258).
- Pre-seed by construction: simulate() is keyed on the body frontmatter's
  seed, and no world seed is accepted anywhere.
- --check re-simulates and compares DECODED PIXELS, never bytes, since PNG
  encoding drifts across Pillow/zlib versions (T-1291) and a check that trips
  on that gets muted. Mutation-proven: one flipped pixel exits 1 and names
  the file; the restored file exits 0.
- import_heightmaps' body lookup is extracted as body_def_for and shared,
  not copied.

Tests (make test-tooling): rock keeps its biome beneath, thin-atmosphere
ground is terrain with only scattered life, water is terrain only, no pixel is
empty on both maps, and stacking equals the rendered grid. Routing rock
through the biome map fails two of them by name. The router drift test covers
the new verb.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 15:55:47 +02:00
..