Commit Graph
8 Commits
Author SHA1 Message Date
Algent 8294240659 test: characterize TCuboidPart
Freezes the observable behavior of TCuboidPart, JCuboidPart and the
TCuboidPart$class bridge before the Java port, per the test-first gate in
JAVA_MIGRATION.md. All cases pass against the untouched Scala.

Records two asymmetries worth preserving: getSubParts wraps the bounds in
an IndexedCuboid6, whose copy constructor makes it a copy carrying a boxed
Integer 0 as data, while getCollisionBoxes aliases the bounds instance
itself. Cuboid6 has no equals, so geometry is compared component-wise.

Also adds a frozen Scala consumer compiled with 2.11.5 against the
reference dev jar at 246daff. Its forwarders call all four $class statics,
so it detects the linkage break that a freshly recompiled test would miss.
ForgeRelocationFMP, OpenComputers, ProjRed and ProjectBlue all depend on
those descriptors.

One case exists specifically to guard the port: TMultiPart supplies empty
getSubParts and getCollisionBoxes, and on the JVM a superclass method beats
an interface default, so a Java interface cannot reproduce Scala trait
linearization on its own.
2026-08-14 20:03:33 +02:00
Algent 246dafffda refactor: drop unused IDWriter and JPartialOcclusion Scala bridges
The downstream ABI inventory scanned 240 mod jars in GTNH daily
2026-08-14+678 and found no consumer of either bridge. Both were written
speculatively, before the inventory existed.

IDWriter had no downstream reference at all, so its four Scala function
accessors are removed and the class now selects a carrier width directly.
That also removes the Integer boxing and Function1/Function2 allocation
per read and write that the first port had preserved. Calling write or
read before setMax now throws IllegalStateException rather than
NullPointerException; no caller reaches that state.

JPartialOcclusion$class had no downstream reference either. The two
consumers that touch JPartialOcclusion only call getPartialOcclusionBoxes,
and the two jars that implement the interface emit no call to the helper.
The interface and both of its method descriptors are unchanged. The
ReferenceScalaPartialOcclusion fixture is removed with the helper it
existed to verify.

Validated with 27 plain-JVM tests, a clean checkstyleTest build with
Spotless re-enabled, and the Java 8 Forge dedicated-server suite.
2026-08-14 19:52:28 +02:00
Algent 5c087c50b5 run spotless 2026-08-14 19:44:56 +02:00
Algent a0428b9994 refactor: port partial occlusion to Java
Keep the Scala trait helper so reference-compiled implementations remain linkable.
2026-08-14 18:24:59 +02:00
Algent 60818853e3 test: freeze Scala partial-occlusion ABI
Load a reference-compiled consumer so the Java bridge must retain the Scala trait helper.
2026-08-14 18:19:18 +02:00
Algent 07530d93bf test: characterize partial occlusion
Freeze voxel ownership and visibility rules before the Java port.
2026-08-14 17:46:30 +02:00
Algent a69f846775 test: characterize normal occlusion
Freeze contact tolerance and partial-box delegation before the Java port.
2026-08-14 17:38:53 +02:00
Algent e33d3b2493 Add first characterization tests 2026-08-14 16:52:22 +02:00