Commit Graph
5317 Commits
Author SHA1 Message Date
piexel 81934654ed Pin the flags studio offers for disabledComponents, CARVED included 2026-10-08 12:49:37 +02:00
piexel c0e8b5e7e1 Buffer module mantle edits and remove short-lived module layers on mantle cleanup
Mantle.edit() is bridged: an edit buffers sets and removals across layers per block, its reads and
visits see them over the unchanged mantle, and commit() publishes them all, or none when a chunk it
touches was not prepared; the edit can then only be closed. While an edit is open the view itself only
reads, a second edit is refused and edits do not nest.

Module layers registered with the GENERATION lifetime are now removed when Iris cleans a generated
mantle chunk, in both the covered cleanup and the pregenerator's forced cleanup, as Iris deletes its own
transient slices (GenerationLayers). Persistent layers and layers no loaded module registers stay,
retaining ModuleLayerValues keeps them all, and a pack whose modules fail to load keeps its layers.
2026-10-08 12:49:00 +02:00
piexel 847dba8212 Port Iris's object, floating object and structure mantle components to built-in mantle stages
The three mantle components become per-runtime workers constructed from the engine, like CaveCarving:
ObjectPlacing, FloatingObjectPlacing and StructurePlacing, each with place(writer, x, z, context) and
reach(). New built-in mantle stages run them: iris:objects/place (after the caves), iris:floating/objects
(after objects) and iris:structure/place (after objects and floating objects). Each works out its reach
from the pack when it loads, as the component's radius used to be.

CarveModule no longer checks disabledComponents itself: Iris disables the cave stage's pass by its
CARVED flag like any other. Studio's disabledComponents list offers the flags of Iris's own mantle
stages, CARVED included again.
2026-10-08 12:44:43 +02:00
piexel 0a06d5ff29 Run every mantle stage as a mantle pass of its own, ordered by the stage graph
ModuleMantleComponent now runs one mantle stage. IrisEngineMantle builds one component per stage of the
pack's mantle graph, in resolved order, each its own pass, when first needed after a load or hotload,
so a pack mantle stage can order itself after Iris's objects and structures. A stage's radius is its
reach, worked out from the pack (IrisPackSettings: the dimension, its regions and biomes). Iris's own
stages keep the flags of the components they replace (CARVED, OBJECT, FLOATING_OBJECT, JIGSAW), so
disabledComponents keeps working; pack stages get custom flags in order (MantleStageFlags).

There is one mantle path now: the separately registered object, floating object and structure
components, IrisMantleComponent, the ComponentFlag annotation, registerComponent and
getObjectComponent are gone. Engine.getObjectsAt asks the runtime's ObjectPlacing.
2026-10-08 12:44:43 +02:00
piexel 50f51db8b2 Run each mantle stage as its own pass and let mantle stages work out their reach per pack
MantleRunner.generate(stage, inputs, seed) runs one mantle stage for one chunk. The host runs every
mantle stage as its own pass in resolved order, so a stage sees what earlier stages wrote into the
chunks around it. Activation still follows requires(...): the runner collects the settings of the stage
and of everything it requires, and only those. Because the stages of one chunk now run in different
invocations, mantle stages have no output (Stage.mantle declares Void) and pass data on through
mantle layers.

A mantle stage whose reach depends on the pack declares reach(PackReach). The host works it out once
per pack load from PackSettings, every entry the dimension and its regions and biomes declare, with
ResolvedStage.reachBlocks(settings); a negative result fails naming the stage. Placement and chunk
stages may not declare one, and ResolvedGraph.reach() throws for a mantle pipeline that has one.
VeinModule now sizes its reach from the pack's longest vein.
2026-10-08 12:35:04 +02:00
piexel a77a097baf Generate every world through built-in module stages and remove the world modes
The overworld pipeline becomes ten built-in modules with typed ordering: biome, terrain, carve, post,
floating, deposit, matter, decorant, perfection and custom. The world modes and the dimension's mode
setting are gone; a pack's mode key now gets the unknown-key warning.

iris:biome, iris:deposit and the cave planning of iris:carve are full ports. Deposits are settings of
their own (iris:deposit, written as "deposits": [...]) that stack: a chunk gets the dimension's, the
region's and the biome's at its centre column. Cave planning is a mantle stage with a reach of one
block, its work done by CaveCarving. The other stages wrap the existing actuators and modifiers.
Perfection no longer checks for an overworld.
2026-10-08 12:02:38 +02:00
piexel 0f63a3c59a Replace world modes with one generation path through the module pipelines
EngineGeneration replaces the engine mode: it generates the mantle around a chunk, then runs the
pack's chunk graph, Iris's built-in stages included, and keeps the per-runtime state built-in stages
need. IrisChunk carries the biome hunk and multicore flag, IrisMantleChunk gives built-in mantle stages
Iris's mantle writer, and the module mantle component now runs as the first pass, where carving ran.
Built-in modules are loaded with Iris's pack object model as host types.
2026-10-08 12:02:38 +02:00
piexel fb348d26c8 Run the pack's mantle pipeline as one mantle component and bridge the mantle to modules
ModuleMantleComponent runs the mantle stages of every chunk the mantle prepares, after Iris's own
components, with a radius of the pipeline's declared reach; it is disabled while the pack has no mantle
stages. IrisModuleMantle gives stages Iris's mantle in world coordinates: every module layer of a block
is kept in one ModuleLayerValues slice, encoded with the layer's codec, and layers no loaded module
registers keep their bytes. Chunk stages read their own chunk's mantle.
2026-10-08 11:48:11 +02:00
piexel efa6cb4b4a Read module settings per column with every level as its own entry
Chunk stages now run where any column of the chunk configures their settings, and every level
(dimension, region, surface biome, placement) is its own entry: the most-specific-wins merge is gone.
Settings with one option accept a bare JSON value, Iris's pack object classes in built-in settings are
read with the pack's own Gson, and studio renders both: the shorthand as an alternative form and Iris
classes with Iris's own definitions.
2026-10-08 11:38:27 +02:00
piexel 97ac2a2982 Read settings per column with every level as its own entry, add the mantle pipeline, host types and the one-option shorthand
Settings no longer resolve to one value per type. FeatureSettings.at(type, x, z) returns one entry per
level that declares the type at that column (dimension, region, surface biome, placement), each with
its level, source and value; levels stack and a module decides what several mean. Conditional stage
bodies receive every configured entry. Chunk and mantle runners collect a chunk's settings themselves,
so a stage runs when any column of the chunk configures it.

Work that writes the mantle or reaches beyond its chunk moves to a new MANTLE pipeline (Stage.mantle,
MantleRunner) that the host runs around a chunk before it generates. Chunk stages may no longer declare
a reach or mantle writes and see the mantle read-only.

Built-in settings may hold host types the host describes itself (ModuleHost.describingHostTypesIn,
ValueKind.HostKind); pack modules cannot. FeatureSchema.shorthand() names the only option of settings
packs may write as a bare value.
2026-10-08 11:31:03 +02:00
piexel 70a69fadad Describe the ported built-in modules in the README 2026-10-08 08:53:17 +02:00
piexel 5f30e27485 Cover an object's declared size in its placement area
Boring and terrain bends cover the object's declared size, which can be
larger than the bounds of its blocks, so the placement area now reaches
whichever of the two is farther from the anchor.
2026-10-08 08:52:44 +02:00
piexel 90f5181a88 Port perfection to an IrisApi chunk module
- iris:perfection/surface does what IrisPerfectionModifier did on
  overworld chunks: hide ores when the dimension asks, then remove
  decorations whose block below cannot hold them until none is left.
- It runs in the pack's chunk graph on Iris's block hunk, after the
  world mode's stages, so it now follows the custom block stage instead
  of preceding it. ModeOverworld no longer registers it and
  IrisPerfectionModifier is deleted.
- The passes run on the generating thread instead of fanning columns out
  to the burst executor.
2026-10-08 08:50:51 +02:00
piexel f052960e2f Run built-in chunk modules on Iris's own block hunk
- IrisChunk gives Iris's built-in chunk stages the engine, Iris's block
  hunk and the chunk context, bound on the generating thread while the
  pack's chunk graph runs.
- iris:perfection joins the built-in modules every pack loads.
- PerfectionModuleTest runs it through the chunk graph.
2026-10-08 08:50:51 +02:00
piexel 2aab5ae9a3 Show pack modules' settings in studio and reload them when their jars change
- SchemaBuilder renders the settings the pack's modules add: each
  feature at a dimension, region, biome or object placement becomes a
  property under its id and, for built-ins, its alias, with a constraint
  that an object holds only one of the two. Each settings class is one
  definition; options carry their kind, bounds, defaults and
  descriptions, and references complete from the same lists Iris's own
  fields use.
- The code workspace writes a schema for each module snippet type under
  snippet/<name>/.
- A pack whose modules fail to load gets no workspace; the error is
  logged instead of writing schemas without the modules.
- PackModuleSet forgets loaded or failed modules once the jars in
  <pack>/modules change, and the workspace then reloads the pack data, so
  studio picks up rebuilt module jars. The studio hotload watcher now
  also reacts to .jar files.
- Placement tests name Iris's built-in states by their own keys, since
  those resolve once per JVM with whichever platform a test bound first.
2026-10-08 08:44:18 +02:00
piexel 529d70b14a Place objects by running the pack's placement graph
- IrisObject.place runs the pack's resolved placement graph, Iris's
  built-in placement modules included, with IrisApi's PlacementRunner
  (ModuleObjectPlacement). The engine runtime no longer resolves
  placement lifecycle plans.
- Writes go to an ObjectPlacerEdit, a buffer over the Iris object placer
  that reads its own writes and reaches the placer only on commit: blocks,
  then tile data and iris:marker markers, then the caller's listener. A
  rejected placement writes nothing.
- The placement area is every column the object reaches in any rotation,
  moved by its translation and surface warp, widened by one block and the
  pipeline's reach, at any height.
- Each placement's seed mixes the world seed with the object key and the
  requested position. Without an engine one draw from the caller's random
  stands in for the world seed.
- Built-in stages read Iris's own placement inputs from IrisPlacement,
  bound on the placing thread while the graph runs.
- Gson decodes the module settings of every object placement in pack
  JSON, snippet placements included.
- Platform keys without a namespace read as Minecraft's.
- The built-in API package moved to the default module's source tree.
2026-10-08 08:33:48 +02:00
piexel 522a9c85b6 Port object placement onto IrisApi modules and delete the lifecycle
- The built-in placement is now eight IrisApi modules: iris:prepare,
  iris:anchor, iris:validate, iris:bore, iris:blocks, iris:stilt,
  iris:vacuum and iris:snow. Their stage constants and output types live
  in art.arcane.iris.builtin, which packs see, the stage bodies beside
  the placement settings they read.
- The modes stay in ObjectPlaceMode, which now names how each mode
  samples its height and which stilt it grows; one graph serves them all.
- The block stages share one pass: the object's blocks are written and
  the stilt layers found together. Snow and the vacuum bend read the
  written blocks from the write stage's output.
- PlacementLifecycle, its builder, plans, stages and state, the
  PlacementModule classes, ObjectBlockPass, IrisObjectPlacementRunner and
  ObjectMarkerPlacement are deleted.
- IrisObject caches its geometry as IrisApi blocks and forgets it with
  its other derived shapes whenever its blocks change.
- IrisObjectPlacement carries the module settings decoded with it.
- The vacuum radius is capped at the 128 blocks its settings allow, the
  reach the vacuum stage declares.
2026-10-08 08:33:42 +02:00
piexel da71e0e921 Run the pack's chunk graph inside Iris's chunk generation
- After the world mode's stages, ModuleChunkGeneration runs the pack's
  resolved chunk graph with IrisApi's ChunkRunner on the chunk's block hunk.
- Stages are active where the chunk's dimension, region or biome at its
  center configures their settings; per settings type the most specific
  declaration wins (biome over region over dimension).
- The block hunk is Iris's chunk hunk seen as IrisApi block states: unset
  blocks read as air, a write beyond the chunk fails instead of clipping.
- Terrain samples come from Iris's height, slope and biome streams, bounded
  by the chunk widened by the pipeline's reach. Pack dimensions, regions and
  biomes become ResourceIds under the pack folder's name.
- The invocation seed mixes the world seed with the chunk position.
- Mantle access and pack resources are not bridged yet and fail with an
  error that says so.
2026-10-06 14:31:35 +02:00
piexel 72cc04e20f Apply Iris's Lombok settings to these sources
Lombok looks for lombok.config upward from each source file and never
reaches ../Iris, so these classes were compiled with getter-based
equals/hashCode/toString. IrisBiome's then linked against org.bukkit and
failed the Bukkit purity gate once it was recompiled.
2026-10-06 14:17:54 +02:00
piexel 88ddf66e6e Load each pack's modules with IrisApi and decode their settings
- IrisModuleHost builds the one ModuleHost: no built-ins yet, the
  art.arcane.iris.builtin package exposed to packs, Iris's own dimension,
  region, biome and object placement fields reserved, the iris namespace
  reserved, jar copies under the plugin cache and the load log routed to
  IrisLogging.
- IrisData owns a PackModuleSet that loads the pack's modules on first use,
  reports a failed load once and closes with the data on hotload or unload.
- Dimension, region and biome loading decodes module settings under their
  id or built-in alias into IrisRegistrant.moduleSettings, failing a file
  that sets both, and the unknown-key warning accepts module keys.
2026-10-06 14:17:54 +02:00
piexel 1e6c09c66e Recompile core when the default module's lombok.config changes 2026-10-06 14:17:54 +02:00
piexel d80dd66588 Compile core against IrisApi from the sibling checkout
gradle/irisapi-resolution.settings.gradle includes the IrisApi checkout as
a composite build, like VolmLib, and fails clearly when there is none.
Core uses it compileOnly and in tests: how the API reaches a server is
undecided, so it is not shaded and a built jar cannot load packs yet.
2026-10-06 14:17:54 +02:00
piexel 09df1af88e Add BlockState.parse, the inverse of key(), for hosts that read block states from JSON 2026-10-06 14:07:32 +02:00
piexel c5a54558fa Let the host choose the jar copy directory and the logger of pack loads
ModuleHost.copyingJarsTo(directory) and loggingTo(logger) replace the fixed
java.io.tmpdir and System.getLogger. A System.LoggerFinder would not work
for a plugin, whose classes are not on the system class loader.
2026-10-06 14:04:11 +02:00
piexel a325640d5d Key settings by feature id, order options as declared and declare stage reach
- Packs write settings under the feature id. @Feature(field) becomes an
  optional alias that only built-in modules may set, so existing pack JSON
  keeps loading; a pack module setting one fails the load. Reserved host
  fields now only constrain aliases. FeatureSchema exposes key and alias.
- Pack snippet names live under their module's folder
  (snippet/<namespace>/<path>/...); snippet names are folder paths.
- OptionsMetadata lists options in declaration order, read from the class
  file, a superclass's first.
- @Ref(PACK_BIOME|PACK_REGION|PACK_OBJECT) fits String only.
- Stage definitions declare reach(blocks) and writesMantle(layers);
  ResolvedGraph.reach() collects the pipeline and per-layer maximum, and
  the load fails on an unregistered or mistyped layer.
2026-10-06 13:59:28 +02:00
piexel 05ab5ba0cf Baseline IrisModule before the IrisApi port 2026-10-06 13:46:55 +02:00
piexel b12e7a8c49 Document how modules describe settings for studio and what the host renders 2026-10-06 12:17:04 +02:00
piexel 3465f8d390 Describe module settings for studio as LoadedPack.schema()
PackSchema (com.volmit.host.schema) is a JSON-free description of every catalogued
settings type: features with their module, JSON field and targets, every reachable
class once by name (cycles end at the name), options with value kind, description,
required, bounds, defaults read from a no-argument instance and @Ref references,
plus object generator settings and snippets. Everything is in a fixed order.

The pack load fails, naming class, field and module, on unsupported field types,
@Ref on fields that are not text, classes without a working no-argument constructor
and snippet names that are not folder names or are used twice. GrassSettings.block
becomes a BlockState, a block reference without @Ref.
2026-10-06 12:14:34 +02:00
piexel 93c755ffe4 Add FeatureRegistry.registerSettings and the @Ref annotation for value references
Modules register settings types that no stage names in when(...) explicitly; the
id must be the module's id or below it, and repeating it or also naming the type
in when(...) changes nothing. A type its owner registered may be named by any
module. OptionsMetadata.Option now carries its field and @Ref reference.
2026-10-06 12:06:46 +02:00
piexel 8b7accd19d Add WorldRandom.pick and shuffle so stages need no JDK random APIs
pick(items) is items.get(nextInt(items.size())) and throws on an empty
list. shuffle(items) is Fisher-Yates from the last index down, swapping
i with nextInt(i + 1). RandomAccess lists swap through List.set; other
lists are shuffled in an array copy and written back through their
ListIterator, with the same result. Both are pinned to the Python
reference, including draw counts.
2026-10-06 11:48:44 +02:00
piexel 525c372fc5 Document WorldRandom, id ownership for feature ids and mantle keys, and accumulating ModuleHost
DESIGN describes WorldRandom's algorithms per method, why it does not
implement RandomGenerator, why StrictMath suffices for the gaussian and how
the pinned values are produced. README and CONTRACTS name it as the
generator stages and object generators see. The namespace rule now reads
that feature ids and mantle keys are the module id or below it, with the
new error text, and ModuleHost's methods are documented to accumulate.
2026-10-06 11:37:24 +02:00
piexel 1ce0a19abb Give stages WorldRandom, a SplitMix64 generator whose every method IrisApi defines
java.util.Random fixes only some of its methods; the ranged RandomGenerator
defaults module authors reach for are left to the JDK, so an update could
change existing worlds. WorldRandom does not implement RandomGenerator and
exposes a curated set (ints, longs, ranges, booleans, floats, doubles,
gaussian, chance) with Lemire bounds and the polar gaussian on StrictMath.
StageContext, ObjectGenerationContext and BlockPalette now use it.

StageRandom becomes StageStreams; the seed derivation is unchanged. Every
method is pinned to values from an independent Python reference in
src/test/reference.
2026-10-06 11:36:13 +02:00
piexel d5aad57ad9 Require object feature ids, mantle keys and settings ids to be the owning module's id or below it
Object feature ids and mantle keys a module registers must now equal its
module id or start with it and '/', the rule stage ids already follow,
instead of only sharing its namespace. A settings type named in when(...)
needs a feature id that at least one module naming it owns in the same
sense, so another module may still condition on it, as moss can on
iris:snow. ModuleInfo.ownsId states the rule; stageIdPrefix becomes
idPrefix since it now prefixes more than stages. Errors name the module
and its origin and suggest an owned id.
2026-10-05 22:15:59 +02:00
piexel 77e4ab4710 Make ModuleHost.reservingFields add to earlier reservations and check field names when built
reservingFields replaced the reserved fields, unlike exposing and
reservingNamespaces, which add. It now merges the given names per
attachment target with those reserved before, so every ModuleHost method
accumulates. Blank field names now fail when the host configuration is
built, like invalid packages and namespaces, instead of at the first
pack load.
2026-10-05 22:14:06 +02:00
piexel 1df8bb3808 Document per-stage random streams, namespace ownership, LoadedPack and jar copies
README, DESIGN and CONTRACTS now describe: the per-stage random stream
contract and why java.util.Random; module-prefixed stage ids, module ids
without '/', reserved namespaces and settings/registration namespaces;
info() read once; LoadedPack and ModuleHost as the host entry point; and
loading from temporary jar copies with stale-copy cleanup.
2026-10-05 21:40:37 +02:00
piexel 333e2f6459 Load pack modules from temporary copies so the original jars stay unlocked
PackModules copies the pack's jars into a fresh iris-pack-modules-*
directory and reads, checks and defines classes from the copies only, so
a load sees one consistent snapshot and the pack class loader never holds
the originals open (on Windows that locked them against rebuilding).
Copies are deleted when the pack closes (after its loader) and on any
load failure. Messages and origins keep naming modules/<jar>, including
an entry class found in another jar of the pack.

Each copy directory holds an owner file with the creating process id. A
later load removes directories whose owner process has exited and that
hold only that file and jars; everything else is left alone.
2026-10-05 21:38:54 +02:00
piexel fe51496ab0 Add LoadedPack and ModuleHost as the host's single entry point for a pack
ModuleHost holds what the host passes to every pack load: built-in
modules (info read once), exposed host packages, reserved JSON fields and
reserved namespaces, validated when built. LoadedPack.load(packRoot, host)
loads the pack's jars, installs them with the built-ins and resolves both
pipelines; on any failure it closes the pack before rethrowing, and
close() releases the pack's class loader. PackModules and LoadedModules
stay available as the lower-level pieces.
2026-10-05 21:35:52 +02:00
piexel 307e488d1a Give every stage its own random stream derived from the invocation seed and stage id
Stages no longer share one RandomGenerator. StageContext.random() is the
running stage's own stream: java.util.Random seeded with
mix(mix(invocationSeed) ^ fnv1a64(utf8(stageId))), mix being the
SplitMix64 finalizer. Adding, removing or reordering modules, or how much
other stages draw, no longer changes a stage's draws. A block stage keeps
one stream across the blocks of its pass.

The host passes a long invocation seed to PlacementRunner.place and
ChunkRunner.generate instead of a RandomGenerator on the inputs;
InvocationContext loses random(), so stages cannot reach a shared stream.
ObjectGenerationContext keeps its own random() for geometry generators.
StageRandom documents the derivation, and a test pins it to values
computed from the specification.
2026-10-05 21:34:19 +02:00
piexel 4cb718f706 Enforce namespace ownership: reserved namespaces and module-prefixed stage ids
- LoadedModules.load takes the host's reserved namespaces (such as iris);
  a pack module whose id uses one fails, naming its jar and the namespace.
- A module defines only stages whose ids start with its own id and '/'.
  Module ids may no longer contain '/', so ids cannot nest and every
  stage id has exactly one possible owner.
- Object feature ids and mantle keys must use the registering module's
  namespace; ModuleRegistry.register(DiscoveredModule) scopes registration.
- A settings type named in when(...) needs a feature id in the namespace
  of some module naming it, so modules can still condition on another
  module's settings.
2026-10-05 21:31:55 +02:00
piexel 6263075ecd Read module info once at discovery and keep it in DiscoveredModule
DiscoveredModule is now a final class holding the module, the ModuleInfo
read when the module was found (pack jar or builtIn) and its origin.
Graph install, load errors, the pack summary and optional-package
filtering use only that stored value.
2026-10-05 21:26:35 +02:00
piexel f5cf4b3ab6 Document the non-exported JDK package error and sun.misc.Unsafe
DESIGN gains the export row at the top of the class check table, why it
comes first, how --add-exports ...=ALL-UNNAMED is honoured and that
qualified exports do not count. CONTRACTS and README name sun.misc.Unsafe
from jdk.unsupported as the supported route, README shows the new error
group and the addExportsTest task.
2026-10-05 21:11:44 +02:00
piexel f6b08a0303 Fail the load when a module uses a JDK package that is not exported to it
A class such as jdk.internal.misc.Unsafe passed the reference check,
because the platform loader finds it, but java.base does not export
jdk.internal.misc to unnamed modules, so the module failed with an
IllegalAccessError once the code ran. It is now a load error with its
own group:

  Module jar modules/user.jar uses classes of JDK packages that are not exported to modules:
    pack.user.User -> jdk.internal.misc.Unsafe (package jdk.internal.misc of java.base is not exported)
  Use the supported alternative where there is one, such as sun.misc.Unsafe from jdk.unsupported
  instead of jdk.internal.misc.Unsafe. Otherwise the server must be started with
  --add-exports <module>/<package>=ALL-UNNAMED.

NonExportedJdkPackages asks the boot layer's platform and boot loader
modules whether they export each package to an unnamed module that no
export names, so qualified exports do not count and a server started
with --add-exports <module>/<package>=ALL-UNNAMED passes, as it would at
run time. Nothing is loaded. sun.misc (jdk.unsupported) and java.lang
stay usable. The check runs first among classes outside the pack: the
module decides access whichever loader finds the class.

The --add-exports case runs in its own JVM, the addExportsTest task
(tag jdk-add-exports), which check depends on; the other tests run
without the flag. TestModuleJar can pass --add-exports to javac.
2026-10-05 21:10:53 +02:00
piexel e34acf2fbb Document optional packages and the unavailable-JDK-module error
README, DESIGN and CONTRACTS describe how a module declares optional
packages in info() (with an example), that they cover only its own jar
and never excuse a load error, why missingClasses() drops excused
classes, and the new error for classes of JDK modules outside the
platform class loader, including the check order and that one error
groups every kind of unusable class.
2026-10-05 21:01:34 +02:00
piexel ec80683aa1 Report JDK classes that modules cannot see as their own load error
A reference to a class of a JDK module outside the platform class
loader, such as jdk.compiler's com.sun.source.tree.Tree, was reported as
"exists in Iris but is hidden", because the host loader (the application
loader in tests) has it. It now has its own category, listed with the
module:

  Module jar modules/user.jar uses classes of JDK modules that are not available to modules:
    pack.user.User -> com.sun.source.tree.Tree (JDK module jdk.compiler)
  Modules can use only the JDK modules of the platform class loader, ...

UnavailableJdkModules maps the packages of every system module that the
boot layer does not define to the boot or platform loader, from module
descriptors only, so nothing is loaded. Classes the platform loader
provides (java.sql, java.compiler) still resolve.
2026-10-05 20:59:45 +02:00
piexel 57774fade0 Let modules declare optional packages that need no missing-class warning
A module whose bundled library references optional integrations got a
WARNING on every pack load, with no way to say the classes are expected
to be absent. ModuleInfo now carries optionalPackages, set with
withOptionalPackages("org.slf4j", ...); ModuleInfo.of(id, name, version)
still declares none. Each package covers its subpackages.

Missing classes of a jar inside its own module's optional packages are
dropped from the warning and from PackModules.missingClasses(); other
jars are unaffected. The declaration comes from info(), so it is applied
after the entry classes exist. Load errors (hidden Iris classes, classes
missing from exposed packages) are decided before that and never depend
on it.

Package-name validation and whole-package matching move from
ExposedPackages to a new API value, PackageName, used by both.
2026-10-05 20:58:38 +02:00
piexel 3873894a22 Document exposed host packages and optional pack dependencies
README, DESIGN and CONTRACTS now say that modules may use any library
they ship in the pack but never Iris's copy, that classes nobody has
only warn, how each missing reference is classified, and that the host
chooses which packages besides the always-exposed API pack modules can
see, meant for built-in modules' stage constants.
2026-10-05 20:32:14 +02:00
piexel 13a9300ab4 Let the host expose extra packages, such as built-in modules, to packs
A single API_PACKAGE_PREFIX made built-in modules in Iris packages
(art.arcane.iris...) invisible, so pack jars could not require their
stages. ExposedPackages now holds the packages packs may use: always
the API (IrisModule's package), plus what the host passes to the new
PackModules.load(packRoot, exposedHostPackages). Names must be package
names (trailing dot accepted) and match whole packages only.

ApiAndJdkClassLoader becomes ExposedHostClassLoader and routes classes
and resources of every exposed package to the host loader. A jar that
ships a class of any exposed package fails; the compileOnly API hint
stays for the API, other packages get their own message. That check
moves from ModuleJar to PackClassCheck. A reference missing from any
exposed package is the "different build" error.

Tests use a built-in module in example.builtin, outside com.volmit.,
which a pack jar can require only when that package is exposed.
2026-10-05 20:30:20 +02:00
piexel 98bd9a9c12 Let pack jars use classes nobody has, as optional dependencies
The class check was stricter than the JVM: a bundled library that
references optional integrations failed the whole pack, although that
code only runs when the classes exist. Each missing reference is now
classified:

- the host has the class but hides it (Iris internals, Iris's copy of
  a library): load error, saying modules cannot use Iris's classes;
- missing from the API: load error, as before (different Iris build);
- nobody has it: the pack loads. PackModules.missingClasses() lists
  the classes per jar and the load logs one capped WARNING per pack,
  formatted by MissingClassesWarning.

Reference resolution moves from PackClassCheck to PackReferenceCheck.
2026-10-05 20:27:24 +02:00
piexel b7b3993a8d Document what pack modules can see and the class checks
Modules compile against the API compileOnly, never ship it, and can use
only the API, the JDK and their own pack's jars. Describe the pack
loader's parent, the resource rule, the reserved com.volmit. prefix, the
load-time class reference check and its limits, and the new errors.
2026-10-05 18:26:27 +02:00
piexel 1553959cf4 Limit pack modules to the API, the JDK and their own pack
The pack class loader's parent is now ApiAndJdkClassLoader: com.volmit.
classes and resources come from the API's loader, everything else from
the platform loader, so modules no longer see Iris internals or the
libraries Iris bundles.

Before any class is defined, a pack load now fails when a jar holds a
com.volmit. class, and when a class references a class that is not in
the API, the JDK or a jar of the pack (read with java.lang.classfile).
Linkage errors while installing name the module's jar. ModuleInfo names
and versions reject line breaks and other control characters.
2026-10-05 18:24:53 +02:00