Files
aevolution/docs/engineering/ENVIRONMENTAL_SLICE_QUALIFICATION.md
T

106 lines
6.2 KiB
Markdown

# M6.8 integrated environmental qualification
Scope: one closed synthetic habitat, two explicitly opened accounts, rules 2,
community envelope 2, coupled resources 1, fields 1, terrain's existing nested
codec and scheduling adapter 1 (ADRs 0054-0057). No version or biological rule
changes. This is an experiment, not live-world population initialization.
## Acceptance protocol
Extend the existing environmental qualification executable with independent
episodes. Each starts with empty actors and prepaid environmental resources.
Capture funds growth; finite N/P becomes limiting; a scheduled bite transfers
producer inventory into a consumer. A trusted terminal fact kills that consumer,
bounded decay returns N/P, and the surviving producer can grow again. Later a
terminal fact stops the producer. No episode resurrects an account or imports
resources into a running world. Opening a fresh episode is a new experiment.
Run 16 explicit seeds in each of five regimes: baseline, source off, no nitrogen,
temperature blocked, and zero decay. Randomness varies openings, terminal timing,
later source/temperature inputs and scheduler batch widths. The initial cycle is
controlled so baseline nutrient-fed regrowth is testable, not merely probable.
Zero-decay must retain the corpse and prevent post-death regrowth; other failures
must remain distinct from resource-conservation success.
Compare direct per-tick execution with bounded scheduled execution restored at
batch boundaries. Compare reports and complete canonical snapshots, audit checked
energy/C/N/P/other sums, and separately audit total water (not interchangeable with
organic other). Check source/growth/efficiency residual ranges. Capture snapshots
before/after terminal events and while decay is partial, including history eviction.
Retried committed inputs must not alter bytes. Aggregate hashes are diagnostics;
per-episode equality and biological-path assertions are the actual tests.
CTest uses a short ensemble; --long uses more independent episodes. Cost samples
time only scheduled execution of prepared 128-tick full-cycle episodes, excluding
opening allocation, plus separate snapshot and restore timings. Report fixed owner,
resource and scheduler output sizes separately from RSS. No timing threshold or
R730xd capacity claim. Native and Linux evidence are recorded separately below.
## Limits
Finite incident energy eventually exhausts. Two actors with no reproduction cannot
sustain an ecosystem, and terminal facts are imposed rather than inferred mortality.
Carbon is prepaid organic carbon; waste is not mineralized by M6.6. Death, nutrient
return and regrowth demonstrate integration, not ecological stability, evolutionary
fitness, complete chemistry, offline fairness or durable crash recovery. M7 must
provide publication and ownership; these tests verify in-memory canonical restore.
## Reproduce and observed results (2026-09-27)
Run tools/windows-check.ps1 -Preset release -Action check, then
build/release/evo-environmental-qualification.exe --long. Linux uses the same
executable without .exe. No new dependencies or simulation rules were introduced.
Version bundle: rules/envelope 2, coupled resources 1, fields 1, terrain snapshot 1,
coordinate/generator/material versions 1, interval adapter 1.
CTest includes 80 episodes (16 per regime), 10240 logical ticks plus comparison
execution. --long includes 5120 episodes, 655360 logical ticks and 1310720
direct/scheduled advances. Each episode lasts 128 ticks: many independent full
cycles, not one long-lived ecosystem. Each seed index uses seed+16*episode, with
episode=0..63 in --long. Every batch restores and retries its last input without
changing bytes. Reports compare at every tick; inventory audits run at every
reference tick and scheduled batch boundary. Terminal cuts force partial-corpse
snapshots, including before and after deaths and after history eviction.
| Regime (1024 episodes each) | Captured pJ | Growth | Assimilated N fg | Returned N fg | Regrowth | Hash fold |
|---|---:|---:|---:|---:|---:|---|
| Baseline | 308892 | 7672 | 2048 | 7672 | 2048 | 4c58e2ba79a59273 |
| Source off | 0 | 0 | 0 | 0 | 0 | bf6841cdf42d515d |
| No nitrogen | 308892 | 0 | 0 | 0 | 0 | 1d3c84ddeaeb67c8 |
| Temperature blocked | 0 | 0 | 0 | 0 | 0 | 89eda7740985eb00 |
| Zero decay | 308892 | 5624 | 2048 | 0 | 0 | 7d5a6f958dcf2018 |
Returned N includes consumer and later producer decay. It counts transfers, so the
same conserved nitrogen can return more than once after regrowth. No-N captures
energy but cannot grow. Source-off/temperature-blocked actors stay empty until
trusted terminal events; no starvation death is inferred. Zero decay retains
biomass. Baseline asserts exactly two post-consumer-death growth units per episode.
Integrated validation took 51.596947 seconds, including codec/replay and checks.
The existing v1 long qualification passed too: 2097152 advances and unchanged
93a9f9b296caac36 fingerprint. These diagnostics are not new frozen goldens.
## Cost evidence
Windows x64, MSVC 19.44 Release, Ryzen 7 9800X3D, 8 cores/16 logical CPUs. This is
the M6.5 developer host. Analysis/ASan jobs overlapped the run; timings are noisy
local observations, not isolated throughput or deployment sizing. Each sample
executes 100 prepared baseline episodes using two 64-tick calls each. Opening
allocation and codec measurements are outside the execution timer.
| Sample | 12800 ticks (s) | Mean snapshot (ms) | Mean restore/replay (ms) |
|---|---:|---:|---:|
| 0 | 0.003182 | 0.088524 | 0.200919 |
| 1 | 0.003200 | 0.087795 | 0.199767 |
| 2 | 0.003212 | 0.087607 | 0.200362 |
Final v2 envelope: 37367 bytes; accounted resources: 390216; owner: 20152;
reserved process/resource scratch: 131072; combined admitted budget: 541440.
Scheduler result: 14888 caller-owned bytes, separately charged. Resource residency
stays constant per episode. These are accounting/sizeof values, not RSS; allocator
overhead, caller input/results, OS and snapshot buffers are excluded. No performance
optimization or production capacity claim follows from these measurements.
Native results are recorded in VALIDATION.md. Linux CI, R730xd execution and durable
worker recovery remain separate evidence. Next: M7.1 durability/state-closure design.