Batch A from /whats-next — finishes the D-243 region tier on top of the just-landed re-scale (T-1077) and Region→Chunk→Voxel wiring (T-1046).
T-1078 — Region climate stack (D-243 §3/§4)
New region_profile.rs: region (~205 km) climate tier above the DistrictProfile carrier — RegionProfile/RegionClock, derive_region_baseline_c (latitude lerp + greenhouse, D-240 class-envelope, no orbit/star inputs), and region_baseline_at_district — the D-243 §4 edge-fuzz warp-perturbed bilinear blend so the ~205 km grid is invisible.
District temperature split (D-243 §3): derive_district_temperature_c now modulates the region baseline with elevation lapse only. build_district_profile takes an Option<f32> baseline; None preserves the legacy path (existing call sites unchanged). derive_cover consumes the post-refactor value — no signature change.
Region clock scaffolded; transient tick callbacks deferred to Q-105 per the two-phase convention.
Replaces the single-DistrictProfile walking-skeleton restriction so continuous terrain params no longer step at the 2 km district pitch. ChunkContext gains secondary: Option<DistrictProfile> + blend_weight; derive_voxel_column integer-blends elev_q/moisture_q before material selection, reusing the warp offset so the seam can't align with a chunk edge.
Morphology FAMILY selection is never blended — stays sharp per D-239 §7. Interior chunks take a Cow fast-path → bit-identical, golden seed unchanged.
The two are independent mechanisms (climate seam 205 km vs terrain seam 2 km) — they do not share the blend field.
Verification
cargo test (full): 1547 lib + 37 harness + all integration — 0 failures.
Batch A from /whats-next — finishes the D-243 region tier on top of the just-landed re-scale (T-1077) and Region→Chunk→Voxel wiring (T-1046).
## T-1078 — Region climate stack (D-243 §3/§4)
- New `region_profile.rs`: region (~205 km) climate tier above the DistrictProfile carrier — `RegionProfile`/`RegionClock`, `derive_region_baseline_c` (latitude lerp + greenhouse, D-240 class-envelope, no orbit/star inputs), and `region_baseline_at_district` — the D-243 §4 edge-fuzz warp-perturbed bilinear blend so the ~205 km grid is invisible.
- District temperature split (D-243 §3): `derive_district_temperature_c` now modulates the region baseline with elevation lapse only. `build_district_profile` takes an `Option<f32>` baseline; `None` preserves the legacy path (existing call sites unchanged). `derive_cover` consumes the post-refactor value — no signature change.
- Region clock scaffolded; transient tick callbacks deferred to Q-105 per the two-phase convention.
## T-1042 — Cross-district parameter blending (D-239 §4/§7/§8)
- Replaces the single-DistrictProfile walking-skeleton restriction so continuous terrain params no longer step at the 2 km district pitch. `ChunkContext` gains `secondary: Option<DistrictProfile>` + `blend_weight`; `derive_voxel_column` integer-blends `elev_q`/`moisture_q` before material selection, reusing the warp offset so the seam can't align with a chunk edge.
- Morphology FAMILY selection is never blended — stays sharp per D-239 §7. Interior chunks take a Cow fast-path → bit-identical, golden seed unchanged.
The two are independent mechanisms (climate seam 205 km vs terrain seam 2 km) — they do not share the blend field.
## Verification
- `cargo test` (full): 1547 lib + 37 harness + all integration — 0 failures.
- New tests: 14 region_profile, 5 district_modulation, 2 cross_district harness (seam-step-reduces + family-stays-sharp).
- clippy `--all-targets -D warnings` clean; fmt clean.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
First phase of the D-243 re-scale. Adds server/src/atlas/scale.rs as the
single source of truth for the metric containment ladder (voxel 1m -> chunk
64m -> block 128m -> quarter 512m -> district 2048m -> region 204.8km), the
fixed integer addressing (ChunkPos -> DistrictPos -> RegionPos), and the
elastic seam regions_per_equator(R). Compile-time const asserts enforce the
nesting so the rungs cannot silently drift again — the structural fix for the
Q-110 failure mode (three files, three different region sizes).
Wires body_radius_km (D-204) through BodyParams + the reader: the single
body-specific input to the elastic seam.
No behavior change — foundation only. The rename/re-scale of the carrier
(RegionProfile -> DistrictProfile) and on-demand district derivation follow.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Phase 2 of the D-243 re-scale. The ~1km carrier is renamed and re-scaled to
the 2km district, and every consumer reads scale from the canonical scale.rs
instead of a local literal.
- region_profile.rs -> district_profile.rs; RegionProfile -> DistrictProfile,
RegionPos -> DistrictPos (re-exported from scale::DistrictPos), derive_*_regions
-> derive_*_districts, across all 10 consumers + the derivation harness.
- chunk_context now references scale:: for the carrier cell: district 1024m -> 2048m,
shift 4 -> 5 (CHUNK_DISTRICT_SHIFT). This caught a real latent bug: the seed-district
index used a literal '>> 4' while the anchor used the constant, so same-district
chunks could derive different anchors — now both use scale::CHUNK_DISTRICT_SHIFT.
- derivation_harness scale literals ('>> 4', '* 1024', '0..16') converted to
scale:: constants (the same drift the canonical source eliminates). Believability
tests pass at 2km; the voxel determinism golden re-pinned (anchors moved with the
re-scale — deterministic, intended).
Full suite + clippy --all-targets -D warnings green. The district DERIVATION still
tiles the heightmap at 8 cells (the old coarse path); replacing it with on-demand
heightmap interpolation + detail-scatter is phase 3.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Phase 3 of the D-243 re-scale — the corrected 2km carrier and its 'stretch
magic'.
- detail_scatter.rs: the mid-scale terrain (2-40km) invented between coarse
heightmap samples. Locked character (T-1077): ADAPTIVE (ruggedness follows
local slope/morphology -> gentle flats, rugged highs) + ENVELOPE+MODULATION
(heightmap relief caps amplitude; morphology flavors within). Deterministic
seed+position value-noise (D-227/D-010); C1-continuous, no lattice creases.
- derive_district(): the on-demand 2km carrier. Maps the district to a
fractional heightmap pixel via body_radius_km (the elastic seam, D-204),
bilinearly interpolates the L1 envelope, composes the scatter, derives the
profile. body_radius None falls back to direct indexing (tiny test bodies).
- Factored build_district_profile() (climate+morphology tail) shared by the
cell-aggregate and interpolation paths.
5 scatter tests + 5 derive_district tests (determinism, latitude->climate via
the seam, the envelope rule, radius fallback). Full suite + clippy -D warnings
green; existing goldens untouched (additive).
Scope: T-1077 delivers the corrected on-demand 2km derivation + scatter. The
eager-grid -> on-demand region/district production + Atlas surfacing (decision
A) is T-1046's chartered job (derive_all_districts stays the coarse Atlas grid
for now, documented).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Server half of wiring the derived tier into production. The D-225 proxy
(AtlasLayerResponse) carried only Layer1Output, so the Atlas could not show the
DistrictProfile tier that the cascade derives. Adds DistrictGridLayer (cols/rows
+ row-major MorphologyZone discriminants + elev_q for relief shading) and
build_district_grid(), populated on a cache hit. Because the response is
rmp_serde msgpack end-to-end, the new field reaches the client automatically.
This is the planetary-scale coarse grid (the Atlas map view); the on-demand 2km
derive_district (T-1077) is for in-world Phase 5, not the map. MorphologyZone
gains Copy (fieldless repr(u8) enum; additive).
Next: client decode (protocol.gd) + the D-226 generation overlay in the Atlas
viewer.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Client half — the cascade's district tier is now visible in the Atlas map.
- protocol.gd: decode the district_grid field from AtlasLayerResponse.
- atlas_viewer.gd: a gen_district ('MRPH') toggle in OVERLAY_DEFS + the
district-grid generation state (set/get) + wire it from the Ready response.
- atlas_marker_overlay.gd: _draw_gen_district() paints the coarse cols×rows grid,
each cell coloured by its MorphologyZone discriminant (D-239 §6, 17-zone
palette), semi-transparent under the Layer-1 line overlays. Planetary map view
(not the 2km on-demand districts — those are Phase 5 in-world).
gdUnit4 test: overlay registered + district grid round-trips through the viewer
and the protocol decode. Visual tuning of the palette can follow once eyeballed
in the running Atlas.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
/whats-next batch activation for the D-243 region-tier finish.
Refinement briefs (Si pass) appended to T-1042 and T-1078 reconciling
their 2026-06-12 scope against the post-T-1077 tree. T-1046 (Region→
Chunk→Voxel wiring) flipped to done — already committed in cfd5e18d0.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Introduces the region (~205 km) climate tier per D-243 §3/§4, above the
DistrictProfile carrier. New region_profile.rs: RegionProfile/RegionClock,
derive_region_baseline_c (latitude lerp + greenhouse, D-240 class-envelope,
no orbit/star inputs), and region_baseline_at_district — the D-243 §4
edge-fuzz warp-perturbed bilinear blend of surrounding region baselines so
the ~205 km grid is invisible in the output.
Splits district temperature (D-243 §3): derive_district_temperature_c now
modulates the region baseline with elevation lapse only, replacing the
from-scratch per-district derivation. build_district_profile takes an
Option<f32> region baseline; None preserves the legacy single-phase path
(existing call sites unchanged). derive_cover (voxel.rs) consumes the
post-refactor value with no signature change.
Region clock (season/weather) scaffolded; transient tick callbacks deferred
to Q-105 per the two-phase convention. 14 region_profile + 5 district
modulation tests added.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replaces the single-DistrictProfile walking-skeleton restriction so
continuous terrain parameters no longer step at the 2 km district pitch
(D-239 §4/§7/§8). ChunkContext gains secondary: Option<DistrictProfile> +
blend_weight: u8; derive_chunk_context detects a chunk within one chunk of
a district border, looks up the adjacent profile, and integer-blends
meander/channel params on the context. derive_voxel_column integer-blends
elev_q/moisture_q before material selection, reusing the same warp offset so
the seam cannot align with the chunk edge (Cow fast-path keeps interior
chunks bit-identical — golden seed unchanged).
Morphology FAMILY selection is never blended — stays sharp per D-239 §7
(family dispatch reads the primary district only). Climate feathering is the
separate T-1078 path. Adds cross_district_elevation_blend_reduces_seam_step
and cross_district_morphology_family_seams_stay_sharp to the derivation
harness.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
PR #167 Review — region-climate-district-blend → main (code)
Reviewers: Hoshe (code quality) + Tyre (architecture), both on the branch via git show.
Verdict: CHANGES REQUESTED (all comments actionable per review policy).
Strengths: integer blend lerp is overflow-safe and symmetric; the Cow interior fast-path preserves far-from-border determinism bit-for-bit; the two-phase temperature split is correct; D-240 class-envelope anchoring is enforced (no orbit/star inputs); morphology family seams stay sharp (D-239 §7); integer discipline (D-010) maintained.
Documented invariant "same (seed, body_id, tile_pos) → same column" is no longer unconditionally true — the cache key omits chunk/blend context, so a boundary tile derives a blended column while the key doesn't capture it. Safe today (cache is test-only; blend weight is deterministic per position), but the invariant is false and will mislead Phase-5 render-loop callers. Add an explicit precondition note.
Comment says the secondary phase proxy is "position-independent", but the formula adds primary_meander_phase / 2, which varies with the primary district's per-position seed (biases the blend toward primary by ~25% at w=128). Cosmetic (boundary meander phase only), but the comment is actively misleading — fix the comment or drop the term.
No test exercises VoxelCache.get_or_derive with a blended boundary chunk (secondary=Some(...), blend_weight=128). The harness T-1042 tests call derive_voxel_column directly, bypassing the cache. Add a test that caches a boundary tile twice and asserts identical blended elevation — guards against future cache-key drift and exercises the Cow::Owned path through the cache.
Region tier not wired into production. Both live paths pass region_baseline_c: None, so region_baseline_at_district (the D-243 §4 edge-fuzz blend) is never consulted by any cascade path (cascade.rs has 0 references) — district temperature is still derived from scratch, not as a modulation of the region baseline (D-243 §3's core deliverable). The Option<f32> seam and region_baseline_at_district exist but are dead in production. Either thread the region cache through now, or file a tracked ticket (status ready/in_progress) and reference its ID in the None comments so the wiring isn't deferred indefinitely as T-1078 closes.
Same spot as H2. The blended secondary phase is a "plausible" rather than correct blend — asymmetric (A→B ≠ B→A), undocumented as an approximation, untested. Either derive the real secondary-seeded phase (the secondary district position is knowable from chunk position + direction), or name it explicitly as a known bounded approximation with a tracking ticket.
BodyParams.district_latitude_deg is repurposed to mean the region centre latitude — a call-site trap on the pubderive_region_baseline_c (field name says "district"). Rename the field to latitude_deg, introduce a RegionParams newtype, or at minimum add a precondition/# Panics doc on the callee.
Disposition to follow.
## PR #167 Review — `region-climate-district-blend` → main (code)
Reviewers: **Hoshe** (code quality) + **Tyre** (architecture), both on the branch via `git show`.
**Verdict: CHANGES REQUESTED** (all comments actionable per review policy).
Strengths: integer blend lerp is overflow-safe and symmetric; the Cow interior fast-path preserves far-from-border determinism bit-for-bit; the two-phase temperature split is correct; D-240 class-envelope anchoring is enforced (no orbit/star inputs); morphology family seams stay sharp (D-239 §7); integer discipline (D-010) maintained.
### Hoshe (Code Quality) — REQUEST_CHANGES
| # | File / location | Issue |
|---|-----------------|-------|
| H1 | `server/src/atlas/voxel.rs` — `VoxelCache` doc + `get_or_derive` | Documented invariant *"same (seed, body_id, tile_pos) → same column"* is no longer unconditionally true — the cache key omits chunk/blend context, so a boundary tile derives a blended column while the key doesn't capture it. Safe today (cache is test-only; blend weight is deterministic per position), but the invariant is false and will mislead Phase-5 render-loop callers. Add an explicit precondition note. |
| H2 | `server/src/atlas/chunk_context.rs` — `sec_phase` (~L302) | Comment says the secondary phase proxy is "position-independent", but the formula adds `primary_meander_phase / 2`, which varies with the primary district's per-position seed (biases the blend toward primary by ~25% at w=128). Cosmetic (boundary meander phase only), but the comment is actively misleading — fix the comment or drop the term. |
| H3 | `server/src/atlas/voxel.rs` tests / `derivation_harness.rs` | No test exercises `VoxelCache.get_or_derive` with a blended boundary chunk (`secondary=Some(...)`, `blend_weight=128`). The harness T-1042 tests call `derive_voxel_column` directly, bypassing the cache. Add a test that caches a boundary tile twice and asserts identical blended elevation — guards against future cache-key drift and exercises the Cow::Owned path through the cache. |
### Tyre (Architecture) — REQUEST_CHANGES
| # | File / location | Issue |
|---|-----------------|-------|
| **T1** | `server/src/atlas/district_profile.rs` — `derive_district_profile` (~L1038) & `derive_district` (~L1220) | **Region tier not wired into production.** Both live paths pass `region_baseline_c: None`, so `region_baseline_at_district` (the D-243 §4 edge-fuzz blend) is never consulted by any cascade path (`cascade.rs` has 0 references) — district temperature is still derived from scratch, not as a modulation of the region baseline (D-243 §3's core deliverable). The `Option<f32>` seam and `region_baseline_at_district` exist but are dead in production. Either thread the region cache through now, or file a tracked ticket (status ready/in_progress) and reference its ID in the `None` comments so the wiring isn't deferred indefinitely as T-1078 closes. |
| T2 | `server/src/atlas/chunk_context.rs` — `sec_phase` (~L302) | Same spot as H2. The blended secondary phase is a "plausible" rather than correct blend — asymmetric (A→B ≠ B→A), undocumented as an approximation, untested. Either derive the real secondary-seeded phase (the secondary district position is knowable from chunk position + direction), or name it explicitly as a known bounded approximation with a tracking ticket. |
| T3 | `server/src/atlas/region_profile.rs` — `derive_region_baseline_c` / `build_region_profile` | `BodyParams.district_latitude_deg` is repurposed to mean the *region centre* latitude — a call-site trap on the `pub` `derive_region_baseline_c` (field name says "district"). Rename the field to `latitude_deg`, introduce a `RegionParams` newtype, or at minimum add a precondition/`# Panics` doc on the callee. |
Disposition to follow.
Addresses PR #167 review (Tyre T1, T3).
T1 — the region climate tier was built but no live path consulted it: both
derive_district_profile (cascade) and derive_district (on-demand) passed
region_baseline_c: None, so the D-243 §4 edge-fuzz blend was dead in production
and district temperature was still derived from scratch. Now both paths compute
region_baseline_at_district(...) and pass it through build_district_profile so
the two-phase modulation (D-243 §3) actually runs. The cascade path
(derive_all_districts) builds a BTreeMap<RegionPos, RegionProfile> covering all
district positions + their +/-1 neighbours once per body and looks up from it;
the on-demand path derives the four surrounding region baselines on the fly.
No production path passes None except genuinely airless bodies (no planet_class).
T3 — renamed BodyParams.district_latitude_deg -> latitude_deg (it is the region
centre latitude in the region fns, a call-site trap under the old name);
dual-scale doc; propagated to body_params_reader.rs and all literal sites.
Golden fixtures are unaffected (they construct districts directly via make_region,
bypassing build_district_profile) — derivation_harness 37/37 green, no re-pin.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Addresses PR #167 review (Hoshe H1/H2/H3, Tyre T2).
H1 — the VoxelCache 'same (seed, body_id, tile_pos) -> same column' invariant
is no longer unconditional after the T-1042 blend (the key omits blend_weight/
secondary). Replaced with an explicit precondition on the struct + get_or_derive:
the caller must pass the ChunkContext of the chunk that contains the tile.
H2/T2 — sec_phase claimed to be 'position-independent' but mixed in
primary_meander_phase/2 (the primary's per-position seed), making the secondary
phase proxy asymmetric and primary-contaminated. Dropped that term; sec_phase is
now the secondary's own morphology scalars (slope_q + moisture_q), with a comment
honestly naming it a bounded cosmetic approximation and where to thread the real
secondary seed if needed.
H3 — added cache_boundary_tile_blend_is_stable: derives a boundary ChunkContext
(blend_weight=128, secondary=Some), calls get_or_derive twice, asserts a cache
hit + identical blended elevation + that the Cow::Owned blend path actually ran.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
All six findings resolved (commits d974cf42b T-1078, ff5e7ee94 T-1042). Full gate re-run green: cargo test 1548 lib + 37 harness + all integration (0 failures), clippy --all-targets -D warnings clean, fmt clean.
#
Finding
Resolution
T1
Region tier unwired in production
Wired.derive_district_profile (cascade) and derive_district (on-demand) now compute region_baseline_at_district(...) and pass it to build_district_profile, so the two-phase modulation (D-243 §3) + edge-fuzz blend (§4) run live. Cascade builds a BTreeMap<RegionPos, RegionProfile> (all district positions + ±1 neighbours) once per body; on-demand derives the 4 surrounding baselines on the fly. None only for genuinely airless bodies.
H1
VoxelCache invariant false
Replaced with an explicit precondition on the struct doc + get_or_derive: caller must pass the ChunkContext of the chunk that contains the tile.
H2 / T2
sec_phase misleading / primary-contaminated
Dropped the + primary_meander_phase/2 term; sec_phase is now the secondary's own morphology scalars (slope_q + moisture_q). Comment rewritten to name it a bounded cosmetic approximation and where to thread the real secondary seed.
H3
No cache-through-blend test
Added cache_boundary_tile_blend_is_stable — boundary ChunkContext (blend_weight=128, secondary=Some), two get_or_derive calls, asserts cache hit + identical blended elevation + that the Cow::Owned path ran.
T3
district_latitude_deg call-site trap
Renamed BodyParams.district_latitude_deg → latitude_deg (dual-scale), propagated to all sites.
Note on the golden fixture: no re-pin needed — the harness golden constructs districts directly via make_region (explicit temperatures), bypassing build_district_profile, so the production temperature change doesn't reach it. 37/37 harness green.
## Review findings addressed — `ff5e7ee94`
All six findings resolved (commits `d974cf42b` T-1078, `ff5e7ee94` T-1042). Full gate re-run green: `cargo test` 1548 lib + 37 harness + all integration (0 failures), clippy `--all-targets -D warnings` clean, fmt clean.
| # | Finding | Resolution |
|---|---------|------------|
| **T1** | Region tier unwired in production | **Wired.** `derive_district_profile` (cascade) and `derive_district` (on-demand) now compute `region_baseline_at_district(...)` and pass it to `build_district_profile`, so the two-phase modulation (D-243 §3) + edge-fuzz blend (§4) run live. Cascade builds a `BTreeMap<RegionPos, RegionProfile>` (all district positions + ±1 neighbours) once per body; on-demand derives the 4 surrounding baselines on the fly. `None` only for genuinely airless bodies. |
| H1 | VoxelCache invariant false | Replaced with an explicit precondition on the struct doc + `get_or_derive`: caller must pass the `ChunkContext` of the chunk that contains the tile. |
| H2 / T2 | `sec_phase` misleading / primary-contaminated | Dropped the `+ primary_meander_phase/2` term; `sec_phase` is now the secondary's own morphology scalars (`slope_q + moisture_q`). Comment rewritten to name it a bounded cosmetic approximation and where to thread the real secondary seed. |
| H3 | No cache-through-blend test | Added `cache_boundary_tile_blend_is_stable` — boundary `ChunkContext` (`blend_weight=128`, `secondary=Some`), two `get_or_derive` calls, asserts cache hit + identical blended elevation + that the `Cow::Owned` path ran. |
| T3 | `district_latitude_deg` call-site trap | Renamed `BodyParams.district_latitude_deg → latitude_deg` (dual-scale), propagated to all sites. |
Note on the golden fixture: no re-pin needed — the harness golden constructs districts directly via `make_region` (explicit temperatures), bypassing `build_district_profile`, so the production temperature change doesn't reach it. 37/37 harness green.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Batch A from /whats-next — finishes the D-243 region tier on top of the just-landed re-scale (T-1077) and Region→Chunk→Voxel wiring (T-1046).
T-1078 — Region climate stack (D-243 §3/§4)
region_profile.rs: region (~205 km) climate tier above the DistrictProfile carrier —RegionProfile/RegionClock,derive_region_baseline_c(latitude lerp + greenhouse, D-240 class-envelope, no orbit/star inputs), andregion_baseline_at_district— the D-243 §4 edge-fuzz warp-perturbed bilinear blend so the ~205 km grid is invisible.derive_district_temperature_cnow modulates the region baseline with elevation lapse only.build_district_profiletakes anOption<f32>baseline;Nonepreserves the legacy path (existing call sites unchanged).derive_coverconsumes the post-refactor value — no signature change.T-1042 — Cross-district parameter blending (D-239 §4/§7/§8)
ChunkContextgainssecondary: Option<DistrictProfile>+blend_weight;derive_voxel_columninteger-blendselev_q/moisture_qbefore material selection, reusing the warp offset so the seam can't align with a chunk edge.The two are independent mechanisms (climate seam 205 km vs terrain seam 2 km) — they do not share the blend field.
Verification
cargo test(full): 1547 lib + 37 harness + all integration — 0 failures.--all-targets -D warningsclean; fmt clean.🤖 Generated with Claude Code
Phase 2 of the D-243 re-scale. The ~1km carrier is renamed and re-scaled to the 2km district, and every consumer reads scale from the canonical scale.rs instead of a local literal. - region_profile.rs -> district_profile.rs; RegionProfile -> DistrictProfile, RegionPos -> DistrictPos (re-exported from scale::DistrictPos), derive_*_regions -> derive_*_districts, across all 10 consumers + the derivation harness. - chunk_context now references scale:: for the carrier cell: district 1024m -> 2048m, shift 4 -> 5 (CHUNK_DISTRICT_SHIFT). This caught a real latent bug: the seed-district index used a literal '>> 4' while the anchor used the constant, so same-district chunks could derive different anchors — now both use scale::CHUNK_DISTRICT_SHIFT. - derivation_harness scale literals ('>> 4', '* 1024', '0..16') converted to scale:: constants (the same drift the canonical source eliminates). Believability tests pass at 2km; the voxel determinism golden re-pinned (anchors moved with the re-scale — deterministic, intended). Full suite + clippy --all-targets -D warnings green. The district DERIVATION still tiles the heightmap at 8 cells (the old coarse path); replacing it with on-demand heightmap interpolation + detail-scatter is phase 3. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>Client half — the cascade's district tier is now visible in the Atlas map. - protocol.gd: decode the district_grid field from AtlasLayerResponse. - atlas_viewer.gd: a gen_district ('MRPH') toggle in OVERLAY_DEFS + the district-grid generation state (set/get) + wire it from the Ready response. - atlas_marker_overlay.gd: _draw_gen_district() paints the coarse cols×rows grid, each cell coloured by its MorphologyZone discriminant (D-239 §6, 17-zone palette), semi-transparent under the Layer-1 line overlays. Planetary map view (not the 2km on-demand districts — those are Phase 5 in-world). gdUnit4 test: overlay registered + district grid round-trips through the viewer and the protocol decode. Visual tuning of the palette can follow once eyeballed in the running Atlas. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>PR #167 Review —
region-climate-district-blend→ main (code)Reviewers: Hoshe (code quality) + Tyre (architecture), both on the branch via
git show.Verdict: CHANGES REQUESTED (all comments actionable per review policy).
Strengths: integer blend lerp is overflow-safe and symmetric; the Cow interior fast-path preserves far-from-border determinism bit-for-bit; the two-phase temperature split is correct; D-240 class-envelope anchoring is enforced (no orbit/star inputs); morphology family seams stay sharp (D-239 §7); integer discipline (D-010) maintained.
Hoshe (Code Quality) — REQUEST_CHANGES
server/src/atlas/voxel.rs—VoxelCachedoc +get_or_deriveserver/src/atlas/chunk_context.rs—sec_phase(~L302)primary_meander_phase / 2, which varies with the primary district's per-position seed (biases the blend toward primary by ~25% at w=128). Cosmetic (boundary meander phase only), but the comment is actively misleading — fix the comment or drop the term.server/src/atlas/voxel.rstests /derivation_harness.rsVoxelCache.get_or_derivewith a blended boundary chunk (secondary=Some(...),blend_weight=128). The harness T-1042 tests callderive_voxel_columndirectly, bypassing the cache. Add a test that caches a boundary tile twice and asserts identical blended elevation — guards against future cache-key drift and exercises the Cow::Owned path through the cache.Tyre (Architecture) — REQUEST_CHANGES
server/src/atlas/district_profile.rs—derive_district_profile(~L1038) &derive_district(~L1220)region_baseline_c: None, soregion_baseline_at_district(the D-243 §4 edge-fuzz blend) is never consulted by any cascade path (cascade.rshas 0 references) — district temperature is still derived from scratch, not as a modulation of the region baseline (D-243 §3's core deliverable). TheOption<f32>seam andregion_baseline_at_districtexist but are dead in production. Either thread the region cache through now, or file a tracked ticket (status ready/in_progress) and reference its ID in theNonecomments so the wiring isn't deferred indefinitely as T-1078 closes.server/src/atlas/chunk_context.rs—sec_phase(~L302)server/src/atlas/region_profile.rs—derive_region_baseline_c/build_region_profileBodyParams.district_latitude_degis repurposed to mean the region centre latitude — a call-site trap on thepubderive_region_baseline_c(field name says "district"). Rename the field tolatitude_deg, introduce aRegionParamsnewtype, or at minimum add a precondition/# Panicsdoc on the callee.Disposition to follow.
Review findings addressed —
ff5e7ee94All six findings resolved (commits
d974cf42bT-1078,ff5e7ee94T-1042). Full gate re-run green:cargo test1548 lib + 37 harness + all integration (0 failures), clippy--all-targets -D warningsclean, fmt clean.derive_district_profile(cascade) andderive_district(on-demand) now computeregion_baseline_at_district(...)and pass it tobuild_district_profile, so the two-phase modulation (D-243 §3) + edge-fuzz blend (§4) run live. Cascade builds aBTreeMap<RegionPos, RegionProfile>(all district positions + ±1 neighbours) once per body; on-demand derives the 4 surrounding baselines on the fly.Noneonly for genuinely airless bodies.get_or_derive: caller must pass theChunkContextof the chunk that contains the tile.sec_phasemisleading / primary-contaminated+ primary_meander_phase/2term;sec_phaseis now the secondary's own morphology scalars (slope_q + moisture_q). Comment rewritten to name it a bounded cosmetic approximation and where to thread the real secondary seed.cache_boundary_tile_blend_is_stable— boundaryChunkContext(blend_weight=128,secondary=Some), twoget_or_derivecalls, asserts cache hit + identical blended elevation + that theCow::Ownedpath ran.district_latitude_degcall-site trapBodyParams.district_latitude_deg → latitude_deg(dual-scale), propagated to all sites.Note on the golden fixture: no re-pin needed — the harness golden constructs districts directly via
make_region(explicit temperatures), bypassingbuild_district_profile, so the production temperature change doesn't reach it. 37/37 harness green.Pull request closed