Rewrite docs for the module-owned stage graph

README, DESIGN and CONTRACTS now describe stages, ordering, fusion, activation,
outputs and diagnostics, and drop the removed modifier and planner types.
This commit is contained in:
piexel committed 2026-10-05 17:24:51 +02:00
1 parent d78a66772a
commit e918cd44a8
3 files changed
+285 -419

No files matched your search

+35 -28
View File
@@ -1,40 +1,47 @@
# Migration requirements
# Contracts
The authoritative design is [DESIGN.md](DESIGN.md). This replaces the earlier deferred-contract
backlog after the decision to establish the API first and modularize Iris afterwards.
[DESIGN.md](DESIGN.md) is the authoritative description. This file maps requirements to the
types that carry them and lists what the Iris adapter still owes.
## Adopted seams
| Requirement | Current contract |
| Requirement | Contract |
| --- | --- |
| Annotated configuration and construction | `IrisFeature`, `FeatureRegistry`, typed factories, `OptionsMetadata` |
| Registered feature catalog and ordering | `ModuleRegistry`, `FeatureCatalog`, `GenerationPlan`, `PlacementPipeline` |
| Block states, predicates and palettes | `BlockState`, `BlockRegistry`, `BlockPalette` |
| Module identity and composition | `IrisModule`, `ModuleInfo`, `StageGraph` |
| Module-owned work and ordering | `Stage`, `StageRef`, stage definitions, `requires`/`softAfter`/`softBefore` |
| Activation by configuration | `when(settingsType)`, host `ConfiguredSettings` |
| Typed results between modules | stage outputs, `StageContext.output` |
| Per-block work with single-pass cost | `BlockStage`, fused block passes |
| Pack-load validation and diagnostics | host `StageGraphBuilder`, `ResolvedGraph`, `LoadedModules` |
| Reference execution | host `PlacementRunner`, `ChunkRunner` |
| Annotated settings | `IrisFeature`, `@Feature`, config annotations, `OptionsMetadata` |
| Geometry and mantle registration | `FeatureRegistry`, host `ModuleRegistry`, `FeatureCatalog` |
| Block states and palettes | `BlockState`, `BlockRegistry`, `BlockPalette` |
| Pack-scoped resolution | `ResourceId`, `ResourceKey<T>`, `PackResources` |
| Terrain, biome and effective feature sampling | `TerrainSampler`, `BiomeSample`, `TerrainSample`, `FeatureSettings` |
| Dense local output | `Hunk<T>`, reference `ArrayHunk<T>` |
| Sparse procedural geometry | `ObjectGenerator`, `GeneratedObject`, `ObjectBlock`, `ObjectMarker` |
| Host-owned transforms | `ObjectTransform`, `ObjectTransformer` |
| World-space placement and hooks | `PlacementRequest`, `PlacementPlan`, `PlacementModifier` |
| Buffered placement writes | `PlacementAccess`, host-owned `PlacementEdit` |
| Typed persistent/generation storage | existing `mantle/` contracts |
| Terrain and settings sampling | `TerrainSampler`, `BiomeSample`, `TerrainSample`, `FeatureSettings` |
| Dense chunk output | `Hunk<T>`, `GenerationContext.hunk`, reference `ArrayHunk<T>` |
| Sparse geometry and transforms | `ObjectGenerator`, `GeneratedObject`, `ObjectTransform`, `ObjectTransformer` |
| Buffered placement writes | `PlacementRequest`, `PlacementAccess`, host-owned `PlacementEdit` |
| Typed generation and persistent storage | `mantle` package |
Dense output, sparse geometry and world-space placement remain distinct. Configured modifiers
hold read-only snapshots; temporary state is carried by contexts and immutable results.
Stage bodies hold no invocation state. Everything per placement or chunk travels through the
context, outputs and accumulators.
## Requirements for the Iris adapter
- Preserve pack field names/defaults and explicit target-specific inheritance/combination rules.
- Preserve seed derivation, random consumption, coordinate conventions and iteration order.
- Bridge current engine ordering, including planned Mantle work, insertion and finishing steps.
- Prepare full read/write areas and predecessor work; never silently clip requested reach.
- Provide atomic generation-storage edits across blocks, block entities, markers and mantle.
- Preserve unknown persisted layers or fail explicitly; provide codecs for platform values.
- Handle chunk publication, native structure integration, cleanup and reload lifetimes in the host.
- Port the engine as ordinary modules. Keep `iris:*` stage ids stable once packs or addons
depend on them, because soft references and diagnostics use them.
- Build `ConfiguredSettings` per placement and per chunk from decoded pack JSON, with explicit
precedence between dimension, region, biome and placement declarations.
- Preserve pack field names and defaults, seed derivation, RNG draw order, coordinate
conventions and iteration order where existing worlds must not change.
- Prepare the full area a placement or chunk may read or write, including neighbors. Never clip.
- Make placement edits atomic across blocks, block entities, markers and mantle in generation
storage. Abort chunk publication when any stage fails.
- Preserve unknown persisted mantle layers or fail explicitly.
## Later extension families
## Open
Terrain/biome providers, pack transformations, structure assembly/import controls and runtime
spawning/effects/drop/tree/lifecycle contracts are designed as separate extension families in
DESIGN.md. They require feature ports to settle their exact Java methods. They must not be
implemented by exposing Engine, IrisData, Bukkit or native mutable handles.
- Per-stage reach declarations, replacing the removed modifier radii.
- Per-stage RNG streams, so adding a module does not shift other modules' random draws.
- Terrain/biome providers, pack transformations, structure assembly and the runtime family.