Skip to content

Remold v0.2.8

Latest

Choose a tag to compare

@github-actions github-actions released this 12 Nov 15:58
· 187 commits to main since this release

v0.2.8 Release Notes

Status: released 2026-11-12 (v0.2.8, GitHub release published; tag f18851e).
Previous release: v0.2.7 (0852506).

Summary (plain language)

What a regular mod developer will notice:

  • More "incompatible edit" cases are refused before the reload. Annotation default values, Record
    components, method/field staticness flips, deleted constructors, enum reordering or constant
    add/remove, and deletion of members that still have outside readers now fail closed with a message
    naming the member — instead of reporting success and crashing later.
  • Three silent lambda mistakes are closed. Removed lambdas no longer return null/0 to old call
    sites (non-void orphans keep the previous round's return value); ambiguous fallback pairing now warns
    and refuses instead of silently binding the wrong body; and classes compiled without -g (no
    LocalVariableTable) now warn that captured-lambda reordering is undecidable, with an opt-in strict
    mode that rejects the reload.
  • Still fewer "read 0/null" moments during hot reload. New/changed fields could briefly expose their
    default value to other threads; that window is now also closed on the single-class dynamic path — the
    route Mixin uses when a target gains a new @Unique field read by an @Inject handler on the next tick.
  • Signature drift is no longer silent. Parameter-annotation and generic-signature changes now emit a
    member-level [SIG-DRIFT] warning.
  • Logs are English-only, so GBK consoles and log collectors no longer garble hot-swap diagnostics.
  • The Gradle plugin is less surprising. The agent jar now carries its version; the plugin compares it
    with the configured remold.version and replaces a stale local jar. A new cleanRemoldCache task
    clears project-level caches after a version change.
  • Scope of this release: v0.2.8 is a safety-and-stability release. It contains the full batch of
    compatibility gates merged after the v0.2.7 tag (annotation defaults, Record/staticness/constructors,
    enum, signature drift, three lambda cases) plus two hot-reload reliability features (orphan lambda body
    retention, two-phase dynamic redefine). The large Mixin feature set shipped in v0.2.7.

New Features

  • Two-phase dynamic redefine (redefineDynamic). The single-class entry point now consumes
    InitFix.requiresTwoPhase and runs stage A (new shape + old method bodies) → instance patch → stage C
    synchronously inside the same call, so callers still see the final state and the public return
    contract is unchanged. Stage C reuses the already generated runtimeBytes (no second transformer
    bridge pass, no second InitFix.transform). Method-body-only edits keep the single-redefine fast
    path. Covered by DynamicTwoPhaseRedefineTest (2/2, recorded Instrumentation asserts the call order
    and bytes; mutation twoPhase=false turns it red) and by the real-DCEVM
    redefineDynamicNoBaselineProbe (13/0, log two-phase: A -> patch -> C, existing instance b=42).
  • Orphan lambda body retention (non-void, on by default). A removed lambda's ghost stub now keeps
    the previous round's method body (frames and exception table included) when a liveness gate proves the
    body only references members that still exist; otherwise it falls back to the default stub and reports
    why. void orphans stay no-op by default (-Dremold.agent.orphan_retain_void=true opts in). Retention
    logs once on first real execution and survives multiple rounds. Spec:
    docs/topology/11-orphan-lambda-body-retention.md; tests OrphanBodyRetentionTest 6/6.
  • Gradle plugin: agent version reconciliation + cleanRemoldCache. remold-agent.jar now writes
    Remold-Version/Implementation-Version into its manifest; the plugin refuses to start a stale
    auto-discovered agent, re-resolves by the configured version and overwrites the local copy (naming the
    ignored file), while an explicit agentJar is only warned about. cleanRemoldCache clears the
    project's resolved agent/plugin copies and generated launch scripts; the cross-project shared download
    cache is kept unless --global is passed. It is deliberately not wired into clean.
  • JDK-internal packages opened by the agent. ModuleOpener uses Instrumentation.redefineModule in
    premain/agentmain to export/open nine JDK-internal packages to every unnamed module, so users no
    longer need --add-exports/--add-opens. An EVERYONE_MODULE fallback covers loaders created after
    premain, and plugin initialization opens them once more for host loaders that did not exist at premain.

Safety & Compatibility Changes

  • Annotation default drift fails closed. Changing, removing or adding an annotation member default is
    refused by default (already-loaded consumers keep the old default; a redefine cannot backfill them):
    the batch path aborts the whole round, the dynamic path refuses with a named reason. The explicit
    -Dremold.agent.annotation_default_change=allow escape hatch still warns loudly.
  • Enum gates consolidated. Enum declaration reorder is now detected (CHANGED_ENUM_ORDER, switch
    cascades included); enum constant add/remove is diffed (addedEnumConstants/removedEnumConstants)
    and refused with ENUM_CONSTANT_SET_CHANGED; and the rejection reason names the measured blockers
    (already JIT-compiled readers holding the old constant table until deopt, $SwitchMap$/$SWITCH_TABLE$
    holders that cannot gain new cases, existing EnumMap/EnumSet instances that cannot be resized).
    The Mixin member aligner no longer swallows enum reorders by treating $VALUES and other JVM/javac
    synthetics as Mixin-generated members; enum classes get no field-table reordering or tombstoning.
    Backed by 30 independent-JVM probes (tests/enum-append-probe/),
    docs/topology/10-enum-constant-append-infeasibility.md and D-ENUM-1.
  • Lambda fallback pairing fails closed. When an old call site has no deterministic owner, the aligner
    no longer silently binds it to a new body: it warns and refuses the pairing. Gate-state self-reporting,
    permanent regression guards and a larger corpus (N=37) were added.
  • Strict mode for captured lambdas without -g. Without a LocalVariableTable, captured parameter
    names are unavailable and reorder detection silently degrades. The aligner now warns explicitly and
    records missingLvtLambdas; -Dremold.agent.lambda_strict=true throws
    LambdaAlignmentStrictException ([HOTSWAP-REJECT], transaction rolled back so the class keeps its old
    version). Covered by LambdaLvtStrictGateTest 6/6.
  • Member-metadata drift is named. Parameter-annotation and generic-signature changes emit a
    member-level [SIG-DRIFT] warning (derived-class eviction range widened); class-level generic
    signatures remain a known uncovered boundary. Covered by ParameterAnnotationDriftTest and
    :tests:metadataDriftWarnProbe (wired into :tests:check).
  • Staticness flips, deleted constructors and environment-flag overrides are gated. A static ↔
    instance flip is detected and refused (old call instructions would throw IncompatibleClassChangeError);
    deleted constructors are checked against out-of-batch readers; -D environment-flag overrides are
    detected by the same gate. Covered by MemberStaticnessAndConstructorScanTest (7/7, 8/8).
  • Record components and @RemoldReinit extractability. Adding a Record component with live instances
    is refused; @RemoldReinit authorization now verifies that the initializer slice is actually
    extractable (Record component, constructor parameter self-assignment, or no legal initializer ⇒
    LAYOUT-REJECT) before allowing the overwrite. Covered by
    RecordAndReinitExtractabilityGateTest 5/5.
  • @RemoldReinit contract tightened. -Dremold.agent.force_reinit is now a real escape hatch
    (default false), a per-field [REINIT] @RemoldReinit trigger on <class> line explains why a field was
    replayed, an inherited-scope gate refuses INCLUDE_SUBCLASSES when a registered subclass writes the
    same inherited field (scope = SELF is not blocked), and the Javadoc documents the "does not do" list
    and the exact CONDITIONAL semantics.
  • Removed-member reader scan no longer fails closed on unrelated JDK references. Only provably
    unrelated references are skipped (constructor owner mismatch; platform-prefix owners for non-platform
    fields/static/private). Virtual instance methods stay fail-closed; rejection logs name the first three
    reader classes.
  • Plain classes are no longer reordered as if they were Mixin output. The member aligner previously
    restored baseline member order for ordinary classes too; that false positive is fixed, and the
    two-phase trigger now only considers fields that would actually be written with non-zero values.
  • Runtime logs are English-only (17 CJK literals across 6 files translated). A new
    ./gradlew :tests:verifyLogLanguage guard (wired into check) fails on CJK/full-width punctuation in
    main-source string literals.
  • Release-coordinate self-check is now case-sensitive. verifyReleaseCoordinates no longer only
    asserts that POM files exist (case-insensitive filesystems hid spelling drift); it validates
    <groupId>/<artifactId>/<version> as case-sensitive literals for both coordinate families. The
    eight JitPack publications and all templates/docs use the real account casing
    com.github.I-hope1.Remold (matching git remote I-hope1). Verified: 16/16 coordinates resolve from
    mavenLocal, and both templates resolve gradle-plugin:v0.2.8 via help --offline.

Fixes

  • Linux aarch64 native library (UnsatisfiedLinkError). The platform matrix mapped Linux aarch64 to
    the Android NDK artifact (bionic ABI), which cannot load under glibc. NativeLibraryName now resolves a
    dedicated glibc-2.17 libtoolaarch64.so shipped with the repo; CI validates its ABI instead of building
    it (NativeLibraryNameTest locks the matrix).
  • CI native-build noise. The aarch64 artifact is no longer built on the CI runner (zig's internal
    libc++ build ignored -w and produced thousands of annotations); probes that intentionally call
    JDK-removal APIs now carry @SuppressWarnings.
  • Test-fixture debug level. The :tests SemAssert fixtures now always compile with full -g
    (source,lines,vars), matching a user project's Gradle default; a narrowed level dropped the
    LocalVariableTable and made captured-lambda identity undecidable.

Upgrading

  • remoldVersion / remold.version is 0.2.8 in gradle.properties, the remold.gradle(.kts)
    shims, both templates, and the Gradle-plugin examples. Both coordinate families are published for this
    version: io.github.i-hope1.remold:*:0.2.8 and com.github.I-hope1.Remold:*:v0.2.8.
  • No configuration changes are required. @HotswapInit (T4) remains design-only; use
    @RemoldReinit for field-level overrides.
  • The external IDE/JDWP redefine channel still performs a single-phase redefine (the JVM hands the
    already-redefined class to the post-callback and provides no second-redefine trigger). This is the only
    remaining read-through window and is tracked as a known residual in docs/status.md risk 9.

Verification

  • ./gradlew check — 820 JUnit tests, 0 failed, 0 skipped; verifyLogLanguage,
    verifyDocStatusMarkers, and :gradle-plugin:validatePlugins green.
  • Real DCEVM (JBR 21.0.9): liveDcevmTest 44/0; redefineDynamicNoBaselineProbe 13/0.
  • publishToMavenLocal + verifyReleaseCoordinates: all 8 modules under both coordinate families;
    a scratch consumer resolved 16/16 coordinates from mavenLocal; both templates pass help --offline.