test+docs(simulation): address PR #159 review (T-1032)

- Hoshe: body_without_system_row test inserted a NULL system_id, impossible
  under production schema (system_id NOT NULL REFERENCES star_systems). Rewrite
  as body_with_orphan_system_id_* — non-NULL system_id with no matching
  star_systems row (the real case the LEFT JOIN guards) + NOT NULL in the test
  schema + corrected comment.
- Tyre: cascade.rs PERF/TODO comment said the region path 'defers to T-1032';
  T-1032 IS this PR, so production dispatch is now live. Update to track T-1028
  only and note the cost is live in production.

No production logic change. cargo test body_params_reader 7 pass, clippy clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-08 12:50:35 +02:00
co-authored by Claude Opus 4.8
parent 1887c886ef
commit 0a8933fbcc
2 changed files with 16 additions and 10 deletions
+5 -4
View File
@@ -216,11 +216,12 @@ pub fn run_cascade_from_heightmap(
// result nor the TerrainAnalysis is stored on Layer1Output, so we re-run both
// here. Pure → determinism preserved, but the drainage re-run is NOT free at
// the ~6 000-regions/body working scale (D-203).
// PERF/TODO(T-1028/T-1032): cache TerrainAnalysis on Layer1Output to drop this
// PERF/TODO(T-1028): cache TerrainAnalysis on Layer1Output to drop this
// redundant drainage pass, and validate the combined cost against the D-239 §10
// ~45 ms/body budget in the T-1031 verification harness. Latent for now — this
// path only runs when body_params is Some, which production defers to T-1032.
// If body_params is None, the region layer is skipped (e.g. unit tests without DB).
// ~45 ms/body budget in the T-1031 verification harness. This is now a LIVE
// production cost: T-1032 wired the real body_params read, so every analyzed
// body runs this path. If body_params is None, the region layer is skipped
// (e.g. unit tests without DB).
if up_to >= CascadeLayer::RegionProfile {
if let Some(params) = body_params {
use crate::atlas::drainage;