Skip to content

Remold v0.2.3

Choose a tag to compare

@github-actions github-actions released this 06 Nov 13:37
· 530 commits to main since this release

Remold v0.2.3 Release Notes

This release hardens the Mixin hot-swap main path, fixes a silent baseline corruption in the
entity profiler, adds L0 initializer-drift detection, and backs the result with real-environment
end-to-end probes for both Fabric 1.21.1 and Forge 1.21.1 (ModLauncher).


Highlights

  1. Mixin main path is no longer silently broken by baseline re-weaving

    • The external-redefine / baseline-capture channel used to feed the already-woven classfileBuffer
      back into the Mixin bridge, appending hash-mangled duplicate @Unique fields.
    • Those duplicates were written into the baseline cache; the next real hot-swap was then rejected by
      LayoutGate as field(s) removed, and the edit silently stopped taking effect.
    • Baseline capture now uses the JVM input bytes directly and never re-weaves them.
  2. Entity-probe toggle no longer pollutes the hot-swap baseline

    • DynamicProfilerAPI.toggleEntityProbe retransforms loaded subclasses; for Mixin targets that went
      through the same external channel and double-wove them.
    • The retransform now runs inside RemoldAgent.enterInternalRetransform (exitInternalRedefine in
      finally): the profiler still instruments and un-instruments, but AnnotationTransformer leaves
      the class and caches untouched.
  3. Real-environment end-to-end verification

    • Fabric 1.21.1 (KnotServer + real -javaagent): add a method, add a field, two no-op rounds,
      and edit the Mixin class itself (MixinHotSwap) — RESULT PASS, zero [INIT-DRIFT].
    • Forge 1.21.1 (ModLauncher / ForgeGradle 7): the hot-swapped class is also a real Mixin target;
      @Unique / @Inject survive the cross-ClassLoader re-weave and InitFix patches the live instance.
    • Evidence and probe sources live under tests/fabric-mixin-probe/.

Fixed

  • Mixin baseline double-weave (duplicate @Unique fields -> LAYOUT-REJECT on the next edit).
  • Entity-probe retransform corrupting the baseline cache.
  • redefineDynamic without bytecodeCache: baseline now falls back
    bytecodeCache -> fetchOriginalBytecode -> sourceBytecodeCache, and fails closed when all are missing.
  • No-op redefineDynamic is now visible: the "runtime bytes equal baseline, return true but nothing
    was redefined" branch logs an explicit [DYNAMIC-REDEFINE] no-op line instead of being DEBUG-gated.
  • Retry bookkeeping / inject-conflict false positives: per-class retry bookkeeping moved out of the
    redefine catch; injectNewClass verifies already-loaded bytes before treating a LinkageError as success.
  • Source baseline rollback and raw-byte fingerprints: classes that did not actually apply roll back
    sourceBytecodeCache; disk fingerprints now hash the raw Files.readAllBytes output, not aligned/woven bytes.
  • Offset drift: inherited fields of descendants are detected; drift bindings dedup by
    declaringClass#field; LayoutPredictor normalizes dot/slash class names.
  • L0 warning hygiene: runs only for classes that actually reached the JVM, drops the @OnReload
    recommendation, skips instance enumeration when aggregating more than five classes, and warns separately
    when an inherited field has a parent @RemoldReinit.
  • Fabric plugin agent-arg split: split only on the platform path separator.

Added

  • L0 initializer-drift detection: InitializerDrift compares <init> slices per existing field and
    reports INIT-DRIFT when a field is still present but its initializer changed. Includes an instance gate,
    inherited-field wording, aggregated warnings, and INSTANCE_ENUMERATIONS diagnostics.
  • Regression tests: Mixin bridge call counting (baseline capture / internal retransform must not call
    the bridge, a real source redefine must), entity-probe internal-retransform context, L0 drift,
    inherited offset drift, redefineDynamic no-op and fail-closed cases.

Verification

  • JUnit: 446 tests, 0 skipped, 0 failures, 0 errors.
  • Probes: initFixOracle 350/0, doubleBraceProbe 80/0, retryBookkeepingProbe 15/0,
    injectConflictProbe 8/0, fingerprintDiskHashProbe 18/0, redefineDynamicNoBaselineProbe 13/0,
    pendingAlignedMultiLoaderProbe 5/0, retransformBaselineProbe 10/0.
  • MixinProbe exit-code assertion: exit 0 with the fix, exit 3 against the pre-fix agent.

Full Changelog: v0.2.2...v0.2.3