Faster green test suite

- Removed the core processResources skip that fired on test-only invocations, which packaged a core jar with no generation kernel catalog and made all 10 probe and bukkit-plugin tests that reach GenerationKernelRegistry fail on every ./gradlew test
- Set maxParallelForks on :core:test to half the available processors, overridable with -PtestForks, and left the small modules single-forked so they do not re-pay the Minecraft bootstrap per fork or steal worker leases from core
- Resolved B.registries() per bound platform instead of latching the first one for the JVM lifetime, keeping the previous unbound behaviour, so a test that binds its own platform no longer reads a foreign platform's block states
- Resolved IrisObject.States per bound platform through accessors instead of static finals fixed at class-init, removing the NoClassDefFoundError and null material-key failures that appeared whenever class partitioning changed
- Bound an explicit platform in EngineMantleCoverageTest and IrisDimensionStackActuatorMetadataTest so they no longer depend on another class leaking a binding first
- Gated BukkitSpiConformanceTest registry probes on a live RegistryAccess and restored the IrisPlatforms binding it leaked, which was silently swallowing the stderr two SettingsHotloadWatchTest assertions read
- Initialised org.bukkit.Registry and Biome inside the RegistryAccess mock scope in ObjectStudioGeometryTest so Mockito no longer instruments Registry mid-clinit
- Replaced the SettingsHotloadWatchTest fixed 1200ms diagnostic window with a 10ms condition poll bounded at 4s
- Replaced the IrisCaveCarver3DNearParityTest wall-clock speedup benchmark with a deterministic density-sample count, cutting 28 carves to 2
- Cut HydrologyPlannerTest cold-owner parity from 12 tile plans to 4 and shared the immutable baseline plan across the early-owner tests
- Built one prototype project or staged history per class in the jigsaw studio and world replacement tests and copied it per test, replacing repeated fsync-bound fixture construction
- Replaced Mockito block-state fixtures with concrete implementations in the object IO, deposit modifier and nearest-block-index tests, removing about 2.5 million interceptions
- Replaced Thread.sleep with bounded condition polling in HydrologyTileCacheTest
- Deleted 19 test classes and 60 further test methods that asserted on production .java source text rather than behaviour, and removed the 19 now-unread iris.*Source system properties that fed them
This commit is contained in:
Brian Neumann-Fopiano committed 2026-09-07 19:59:22 -04:00
1 parent d3245aa1c2
commit 266fe0d71c
66 files changed
+1481 -3238

No files matched your search

@@ -25,6 +25,8 @@ import art.arcane.iris.core.loader.IrisRegistrant;
import art.arcane.iris.engine.data.cache.AtomicCache;
import art.arcane.iris.platform.bukkit.BukkitBlockState;
import art.arcane.iris.spi.IrisLogging;
import art.arcane.iris.spi.IrisPlatform;
import art.arcane.iris.spi.IrisPlatforms;
import art.arcane.iris.spi.PlatformBlockState;
import art.arcane.iris.util.common.data.B;
import art.arcane.iris.util.common.data.VectorMap;
@@ -68,11 +70,54 @@ import java.util.function.BiConsumer;
public class IrisObject extends IrisRegistrant {
protected static final IrisVector HALF = new IrisVector(0.5, 0.5, 0.5);
static final class States {
static final PlatformBlockState AIR = B.getState("CAVE_AIR");
static final PlatformBlockState STONE = B.getState("STONE");
static final PlatformBlockState VAIR = B.getState("VOID_AIR");
static final PlatformBlockState VAIR_DEBUG = B.getState("COBWEB");
static final PlatformBlockState[] SNOW_LAYERS = new PlatformBlockState[]{B.getState("minecraft:snow[layers=1]"), B.getState("minecraft:snow[layers=2]"), B.getState("minecraft:snow[layers=3]"), B.getState("minecraft:snow[layers=4]"), B.getState("minecraft:snow[layers=5]"), B.getState("minecraft:snow[layers=6]"), B.getState("minecraft:snow[layers=7]"), B.getState("minecraft:snow[layers=8]")};
private static volatile Bound bound;
private record Bound(
IrisPlatform platform,
PlatformBlockState air,
PlatformBlockState stone,
PlatformBlockState vair,
PlatformBlockState vairDebug,
PlatformBlockState[] snowLayers) {
}
private static Bound bound() {
IrisPlatform platform = IrisPlatforms.get();
Bound current = bound;
if (current != null && current.platform() == platform) {
return current;
}
Bound resolved = new Bound(
platform,
B.getState("CAVE_AIR"),
B.getState("STONE"),
B.getState("VOID_AIR"),
B.getState("COBWEB"),
new PlatformBlockState[]{B.getState("minecraft:snow[layers=1]"), B.getState("minecraft:snow[layers=2]"), B.getState("minecraft:snow[layers=3]"), B.getState("minecraft:snow[layers=4]"), B.getState("minecraft:snow[layers=5]"), B.getState("minecraft:snow[layers=6]"), B.getState("minecraft:snow[layers=7]"), B.getState("minecraft:snow[layers=8]")});
bound = resolved;
return resolved;
}
static PlatformBlockState air() {
return bound().air();
}
static PlatformBlockState stone() {
return bound().stone();
}
static PlatformBlockState vair() {
return bound().vair();
}
static PlatformBlockState vairDebug() {
return bound().vairDebug();
}
static PlatformBlockState snowLayer(int layerIndex) {
return bound().snowLayers()[layerIndex];
}
}
protected transient final Lock readLock;
protected transient final Lock writeLock;
@@ -354,7 +399,7 @@ public class IrisObject extends IrisRegistrant {
readLock.lock();
try {
for (IrisBlockVector i : blocks.keys()) {
at.clone().add(getCenter().getX(), getCenter().getY(), getCenter().getZ()).add(i.getX(), i.getY(), i.getZ()).getBlock().setBlockData((BlockData) States.AIR.nativeHandle(), false);
at.clone().add(getCenter().getX(), getCenter().getY(), getCenter().getZ()).add(i.getX(), i.getY(), i.getZ()).getBlock().setBlockData((BlockData) States.air().nativeHandle(), false);
}
} finally {
readLock.unlock();
@@ -389,7 +389,7 @@ final class IrisObjectPlacementRunner {
for (int i = worldBounds.minX(); i <= worldBounds.maxX(); i++) {
for (int j = worldBounds.minY() - config.getBoreExtendMinY(); j <= worldBounds.maxY() + config.getBoreExtendMaxY(); j++) {
for (int k = worldBounds.minZ(); k <= worldBounds.maxZ(); k++) {
placer.set(i, j, k, IrisObject.States.AIR);
placer.set(i, j, k, IrisObject.States.air());
}
}
}
@@ -472,16 +472,16 @@ final class IrisObjectPlacementRunner {
} catch (Throwable e) {
IrisLogging.reportError(e);
IrisLogging.warn("Failed to read block node " + g.getBlockX() + "," + g.getBlockY() + "," + g.getBlockZ() + " in object " + self.getLoadKey() + " (cme)");
d = IrisObject.States.AIR;
d = IrisObject.States.air();
}
if (d == null) {
IrisLogging.warn("Failed to read block node " + g.getBlockX() + "," + g.getBlockY() + "," + g.getBlockZ() + " in object " + self.getLoadKey() + " (null)");
d = IrisObject.States.AIR;
d = IrisObject.States.air();
}
if (placer.isDebugSmartBore() && IrisObject.States.VAIR.equals(d)) {
d = IrisObject.States.VAIR_DEBUG;
if (placer.isDebugSmartBore() && IrisObject.States.vair().equals(d)) {
d = IrisObject.States.vairDebug();
}
PlatformBlockState data = d;
@@ -660,12 +660,12 @@ final class IrisObjectPlacementRunner {
} catch (Throwable e) {
IrisLogging.reportError(e);
IrisLogging.warn("Failed to read block node " + g.getBlockX() + "," + g.getBlockY() + "," + g.getBlockZ() + " in object " + self.getLoadKey() + " (stilt cme)");
sourceData = IrisObject.States.AIR;
sourceData = IrisObject.States.air();
}
if (sourceData == null) {
IrisLogging.warn("Failed to read block node " + g.getBlockX() + "," + g.getBlockY() + "," + g.getBlockZ() + " in object " + self.getLoadKey() + " (stilt null)");
sourceData = IrisObject.States.AIR;
sourceData = IrisObject.States.air();
}
if (!IrisObjectShaping.shouldStilt(sourceData)) {
@@ -852,7 +852,7 @@ final class IrisObjectPlacementRunner {
if (config.getSnow() > 0) {
int height = rngx.i(0, (int) (config.getSnow() * 7));
placer.set(vx, vy + 1, vz, IrisObject.States.SNOW_LAYERS[Math.max(Math.min(height, 7), 0)]);
placer.set(vx, vy + 1, vz, IrisObject.States.snowLayer(Math.max(Math.min(height, 7), 0)));
}
}
}
@@ -1096,7 +1096,7 @@ final class IrisObjectPlacementRunner {
if (targetY > origY) {
PlatformBlockState fill = complex != null ? complex.getRockStream().get(cx, cz) : null;
if (B.isAir(fill)) {
fill = IrisObject.States.STONE;
fill = IrisObject.States.stone();
}
for (int yy = origY + 1; yy <= targetY; yy++) {
placer.set(cx, yy, cz, fill);
@@ -1105,7 +1105,7 @@ final class IrisObjectPlacementRunner {
boolean inside = IrisObjectVacuum.outset(dx, lowX, highX) == 0 && IrisObjectVacuum.outset(dz, lowZ, highZ) == 0;
int carveFloor = IrisObjectVacuum.carveFloorY(targetY, topY, inside);
for (int yy = origY; yy >= carveFloor; yy--) {
placer.set(cx, yy, cz, IrisObject.States.AIR);
placer.set(cx, yy, cz, IrisObject.States.air());
}
}
}
@@ -54,7 +54,7 @@ final class IrisObjectShaping {
private static void ensureSmartBoredLocked(IrisObject self) {
PrecisionStopwatch p = PrecisionStopwatch.start();
PlatformBlockState vair = IrisObject.States.VAIR;
PlatformBlockState vair = IrisObject.States.vair();
int applied = 0;
IrisBlockVector max = new IrisBlockVector(Integer.MIN_VALUE, Integer.MIN_VALUE, Integer.MIN_VALUE);
IrisBlockVector min = new IrisBlockVector(Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE);
@@ -286,7 +286,7 @@ final class IrisObjectTransforms {
}) >= 0.5) {
b.put(new IrisBlockVector(x, y, z), nearestBlockData(v, nearestBlocks, x, y, z));
} else {
b.put(new IrisBlockVector(x, y, z), IrisObject.States.AIR);
b.put(new IrisBlockVector(x, y, z), IrisObject.States.air());
}
}
}
@@ -323,7 +323,7 @@ final class IrisObjectTransforms {
}) >= 0.5) {
b.put(new IrisBlockVector(x, y, z), nearestBlockData(v, nearestBlocks, x, y, z));
} else {
b.put(new IrisBlockVector(x, y, z), IrisObject.States.AIR);
b.put(new IrisBlockVector(x, y, z), IrisObject.States.air());
}
}
}
@@ -364,7 +364,7 @@ final class IrisObjectTransforms {
}, tension, bias) >= 0.5) {
b.put(new IrisBlockVector(x, y, z), nearestBlockData(v, nearestBlocks, x, y, z));
} else {
b.put(new IrisBlockVector(x, y, z), IrisObject.States.AIR);
b.put(new IrisBlockVector(x, y, z), IrisObject.States.air());
}
}
}
@@ -168,7 +168,7 @@ public final class IrisStaticObjectLayer {
@Override
public PlatformBlockState get(int x, int y, int z) {
Block block = block(x, y, z);
return block == null ? IrisObject.States.AIR : block.state();
return block == null ? IrisObject.States.air() : block.state();
}
@Override
@@ -1,12 +1,16 @@
package art.arcane.iris.util.common.data;
import art.arcane.iris.spi.IrisPlatform;
import art.arcane.iris.spi.IrisPlatforms;
import art.arcane.iris.spi.PlatformBlockState;
import art.arcane.iris.spi.PlatformRegistries;
import art.arcane.volmlib.util.collection.KList;
public class B {
private static volatile PlatformRegistries registries;
private static volatile BoundRegistries bound;
private record BoundRegistries(IrisPlatform platform, PlatformRegistries registries) {
}
public static PlatformBlockState getState(String bdxf) {
return registries().block(bdxf);
@@ -117,13 +121,18 @@ public class B {
}
private static PlatformRegistries registries() {
PlatformRegistries cached = registries;
if (cached != null) {
return cached;
BoundRegistries cached = bound;
if (cached != null && !IrisPlatforms.isBound()) {
return cached.registries();
}
PlatformRegistries resolved = IrisPlatforms.get().registries();
registries = resolved;
return resolved;
IrisPlatform platform = IrisPlatforms.get();
if (cached != null && cached.platform() == platform) {
return cached.registries();
}
BoundRegistries resolved = new BoundRegistries(platform, platform.registries());
bound = resolved;
return resolved.registries();
}
}