mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-27 00:04:42 +00:00
Replace fixed placement hooks with a module-owned stage graph
Modules now define every stage themselves through IrisModule.install(StageGraph): typed stage constants, hard requires(...) on other modules' constants, soft ordering by id, when(...) activation and typed outputs. Placement and chunk generation resolve on the same machinery; adjacent per-block stages fuse into one block pass. The host-defined PlacementModifier hooks, string Dependencies, GenerationPlan, PlacementPipeline, DependencyOrder and OccurrenceOrder are removed.
This commit is contained in:
1 parent
9043d93fbd
commit
eeb5486098
76 files changed
+2717
-1567
No files matched your search
@@ -0,0 +1,34 @@
|
||||
package com.volmit.host;
|
||||
|
||||
import com.volmit.FeatureAttachment;
|
||||
import com.volmit.IrisModule;
|
||||
import com.volmit.stage.Pipeline;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
/** Everything one pack load derives from its modules: the frozen feature catalog (including the
|
||||
* settings types stages are conditioned on) and one resolved graph per pipeline.
|
||||
*/
|
||||
public record LoadedModules(FeatureCatalog catalog, ResolvedGraph placement, ResolvedGraph chunk) {
|
||||
public LoadedModules {
|
||||
Objects.requireNonNull(catalog, "catalog");
|
||||
Objects.requireNonNull(placement, "placement");
|
||||
Objects.requireNonNull(chunk, "chunk");
|
||||
}
|
||||
|
||||
/** Module discovery and version gating stay host work; pass the accepted modules here. */
|
||||
public static LoadedModules load(
|
||||
List<? extends IrisModule> modules,
|
||||
Map<FeatureAttachment.Target, Set<String>> reservedHostFields) {
|
||||
var registry = new ModuleRegistry(reservedHostFields);
|
||||
var stages = new StageGraphBuilder();
|
||||
for (var module : modules) {
|
||||
stages.install(module);
|
||||
module.register(registry);
|
||||
}
|
||||
stages.settingsTypes().forEach(registry::registerSettings);
|
||||
return new LoadedModules(registry.freeze(), stages.resolve(Pipeline.PLACEMENT), stages.resolve(Pipeline.CHUNK));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user