Skip to content

v0.2.7 · Mixin 热更与对齐子系统收口

Choose a tag to compare

@I-hope1 I-hope1 released this 11 Nov 12:54
· 276 commits to main since this release

v0.2.7 Release Notes

Status: released 2026-11-11 (v0.2.7, GitHub release published; tag 0852506).
Previous release: v0.2.6 (2159d21).

Highlights

  • A Mixin-generated anonymous class may never change its member schema in place. The generated
    Target$Anonymous$<uuid> class carries its captured variables as synthetic fields, so a changed
    capture list changes the field table and the <init> descriptors. On a JBR-21 DCEVM host that is
    not a local edit: redefineClasses makes the VM re-lay-out instances and rewrites unrelated heaps.
    Measured on a real client ([观测]): one such redefine wiped
    LootContextPredicate.combinedCondition on 230 of 244 instances
    ([HEAPWATCH-DIFF] null{before=0 after=230 newlyNull=230}, both channels agree=1220 conflict=0),
    and it did so even when the synthetic class had zero instances on the heap
    (live{raw=0 reachable=0}) — so the trigger is "member schema differs", not "an old instance exists".
    The gate therefore refuses any schema change (fieldTableChanged, computed from the live class's
    reflection table including isStatic/isSynthetic) and reports it as gateRejected. Body-only edits
    keep the fast in-place path.
  • The synthetic class and its host target now fail or commit together. Refusing the synthetic class
    while still redefining the target is a split state: the target would call a <init> the VM never got,
    and the next tick throws NoSuchMethodError. A new BytecodeTransformerBridge.Abort signal carries
    "do not redefine this class in this round" through the bridge chain: applyTransformerBridges
    rethrows it, redefineDynamic returns failure without calling redefineClasses, and the batch
    path drops the class. Neither the newly woven bytes nor the un-woven source bytes are ever handed to
    the VM (the first keeps the split state, the second washes out the mixin hooks). The log now says
    was NOT redefined … metrics: … instead of blaming the layout gate.
  • Same-session self-healing, and one refusal per candidate. A refused candidate is remembered by the
    hash of the bytes that would have been installed — never by the target class's own source bytes,
    which do not change when a mixin is edited (that mistake locked a session permanently: restoring the
    capture list still read "stays aborted"). Repeating the identical candidate is suppressed without
    double-counting; changing the capture structure is evaluated again and refused again; restoring the
    capture list to match the live class clears the record and the body edit goes through. BLOCKED is
    cleared per round, so a session recovers without a restart.
  • Reload structure contracts broken open. @Mixin(priority) (a final field inside a TreeSet),
    @Mixin(targets) (in-place metadata migration across four indexes with snapshot rollback instead of
    detach + re-register, which now trips MixinTargetAlreadyLoadedException) and interfaces (two-way
    alignment; superclass changes still rejected, interface add/remove allowed on JBR/DCEVM) no longer
    require a restart.
  • New mixins admitted at runtime, from wherever the IDE puts them. A four-level byte-source chain
    (registered memory → every watch directory → batch cache → host provider) plus a MixinBytecodeOverlay
    that also swaps each MixinConfig's start-up-captured service, plus a pendingUnresolvedMixins relay
    (TTL + retry budget) for "mixins.json saved first, .class compiled seconds later". A pure-IDEA
    out/production/classes layout now hot-swaps without a second output directory and without a restart.
  • Access levels only ever move up. AccessAlign aligns a re-woven product against the JVM's loaded
    bytes (public/protected must not narrow, stripped ACC_FINAL must stay stripped) behind a
    fail-closed [ACCESS-GATE] self-check, and readOriginalBytes replays the loader's pre-Mixin
    transforms (PackageAccessFixer, AccessWidener, AccessTransformer). Before this, one hot-swap of
    MobEntity.isInAttackRange sent 112 members back to protected and the VM answered
    VerifyError: Bad access to protected data → InternalError.
  • A Mixin subsystem documentation set. docs/mixin/01..08 now mirrors docs/topology/: invariants
    and classloader authority, admission and the bytecode overlay, the re-weave pipeline and member
    alignment (including why baseline synthetic methods and @Unique fields may only be tombstoned, never
    deleted), the three reload structure contracts, the synthetic-class single exit, end-to-end
    walkthroughs, runtime gates and the two-channel heap sentinel, and the decision/evidence ledger.

Fixes

  • Read-through NullPointerException between redefineClasses and InitFix: closed on the internal
    batch path by the two-phase redefine (stage A = new structure + old bodies, then instance patches, then
    stage C = new bodies). -Dremold.agent.two_phase=false restores the single-phase behaviour.
  • Mixin handler's first anonymous class: Error loading class: Outer$1 (ClassNotFoundException) followed
    by innerClass is null — the new bytes are offered to Mixin's own provider before reloadMixin, and
    the upstream negative ClassInfo cache entries are evicted.
  • Body-only edit of an already-loaded generated inner class: used to end in a silent
    [DYNAMIC-REDEFINE] no-op while the old body kept running; the synthetic class is now redefined in
    place and the trailing target no-op line is explained in the log.
  • NoSuchMethodError: <Target>$Anonymous$<hash>.<init>(…) on a retarget round trip: the tombstone stub
    and field policy keeps baseline synthetic members in place, and ClassInfo.cache is re-anchored to
    MixinInfo.getClassInfo() after every reload/registration so transformSingleDescriptor keeps
    remapping this$0.
  • NoClassDefFoundError: LoadedTargetSuppressor under a plugin/core version skew: the suppressor now
    crosses the core boundary as plain JDK Function/Consumer method references.
  • Same-shape anonymous-class ambiguity: decided by body-structure similarity, then by a whole-group
    zero-live-instance fallback; the orphan warning names the holder fields (proven by assignment flow, or
    listed as supertype/interface candidates) and the @RemoldReinit escape hatch.
  • A field whose initializer allocates a Mixin-generated anonymous class was refused
    (Nest scan incomplete / cannot determine protected status of constructor); synthetic bytes can now
    be registered in BytecodeSources, and the diagnostic names the weaving-generated class.
  • A mixin name removed from *.mixins.json could be silently re-registered when its class file was
    rewritten; the removal now holds until the name is re-added (Forge/NeoForge included, via
    ModLauncherClassTrackerSpoof inside the prepare() window).
  • Batch stall watchdog: previously covered only the debounce batch; now arms through a scoped
    enter/exit API covering the manual triggerHotswap() entry and retransformLoaded as well.
  • Gradle plugin: agent JVM arguments were injected only into the loader client container, so
    ./gradlew runServer and the gametest runs started without -javaagent; all run containers now get
    the same arguments, and auto-deploy wires runServer.
  • Release tooling: JitPack publications published the bare version while the packaged shims and both
    templates request …:v<version>; publications now use the v-prefixed version and the real account
    casing (com.github.I-Hope1.Remold).

Added

  • api: BytecodeTransformerBridge.Abort (the "abandon this class for this round" signal),
    HotswapBatchReport / HotswapBatchListener.afterInternalBatchReport(), HotswapPlugin.isHostReady().
  • core: BytecodeSources, BatchReportScope, BatchWatchdog, StartupGate, ClassCopySelector,
    AccessAlign, MixinMemberAlign, HeapFieldWatch, ReflectionCacheManager SPIs.
  • plugin-mixin: MixinBytecodeOverlay, MixinNewMixinBytes, MixinClassByteSources,
    MixinClassBaseline (premain (loader, dotName) recorder), MixinInnerClassHotSwap single exit,
    SyntheticAbortLedger, MixinSyntheticSchema schema views, MixinRetarget, MixinReloadPolicy.
  • docs/mixin/01..08 plus docs/topology/04/07/08 additions (Tier 3.5 body-token disambiguation,
    Tier 4.5 whole-group zero-scan pairing, findHoldingFields holder naming).
  • :tests:verifyTestCount baseline raised to 718 (from 405) — the guard fails the build when a run
    silently loses cases or starts skipping.

Verification

  • JUnit: 718 tests, 0 skipped, 0 failures (./gradlew :tests:test; the CI Test Matrix leg reports
    the same JUnit 测试数 = 718, skipped = 0; release window 2026-11-11), plus :tests:initFixOracle
    ALL ASSERTIONS PASSED.
  • CI (run 43026871337): Test Matrix (javac 8/11/17/21/25), Test on DCEVM (JBR 21),
    P0.5 Probe (JBR 21) and (JBR 17), and the native-library build all green.
  • Gate / ledger suites: MixinSyntheticGateTest 8, MixinSyntheticLivenessTest 4,
    MixinSyntheticRetryAndFlagsTest 4, MixinSyntheticSchemaTest 4, MixinHotSwapWiringTest 3,
    BridgeAbortTransactionTest 2.
  • Mutation checks in this cycle's campaign ledger: schema-gate ordering, candidate-signature suppression,
    apply() accounting, flag comparison and host abort — each turned the named case red and was restored
    (mut-20261111101423-6dd7, mut-20261111103512-cd37, mut-20261111040924-1e27). One mutant
    ("suppression never fires") is an equivalent mutant: the gate already refuses unconditionally, so
    the ledger only changes the log wording.
  • MixinSyntheticGateProbe on JBR-21 (-XX:+AllowEnhancedClassRedefinition):
    RESULT PASS cases=4 pass=4 skip(non-jbr)=0 enhanced=true — P1 body-only redefine keeps the live
    instance's field values and swaps the body (desc=v2:7:payload), P2 shrink refused, P3 enhanced-shrink
    negative control, P4a live{raw=1} refused, P4b reachable=0 still refused with the class untouched.
  • Real client, one session, no restart ([观测]): refusal path A1–A5 — fieldTableChanged and
    gateRejected 1→2→3→4→5 (one per round), executed=0, host was NOT redefined with metrics:,
    newlyNull=0; Adup re-sending the identical bytes adds 0/0. Self-healing path B1–B5 —
    executed 1→2→3→4→5 with redefined in place; metrics: every round, fieldTableChanged /
    gateRejected unchanged, v1-restored…v5-restored all taking effect at runtime, 25 cuts
    nullCount=0 / newlyNull=0, both channels agree=6100 conflict=0 unavailable=0, zero crashes.

Known limits / manual acceptance

  • <Target>$Anonymous$<hash> still cannot change its capture list in place. Restore the capture
    list, keep it stable (@RemoldReinit, or move the state into a lambda), or restart. The value-type
    histogram of the 230 wiped fields is [观测] (230 named record values vs 14 surviving hidden-class
    lambda values); the underlying ModifyInstances mechanism and the classloader/branch attribution stay
    [推断].
  • Fact ③ is closed as "not pursued", not as solved. In db74eec a 3-arg <init> existed and the VM
    still threw NoSuchMethodError; no further work is planned on it.
  • P2 is an unvalidated [假设]. Naming a new synthetic class by schemaHash (load it with
    defineClass, then only body-redefine the host) is pre-registered with the criterion "new class loaded
    • host body-only redefine → newlyNull=0"; not implemented, not measured.
  • F6 four-way split (append / shrink / type-change / unchanged) is still partial. The 52830a0 logs
    only support executed=12/12, skipped: not observed (the skip line was DEBUG-gated), rejected=0;
    the new loaded=/fresh=/flags lines allow the split on the next real-machine run.
  • The captured LivingEntity byte pair is manual-only. MixinMemberAlignTest's captured regression
    is a hand-run entry point (manualCapturedLivingEntityBaselineRestore) because those two ~140 KB
    client classes are intentionally not in the repository and verifyTestCount hard-fails on skips.
  • AnonClassAligner's Tier 4 layout gate still only "does not pair"; the host keeps redefining. The
    mixin synthetic path is stricter on purpose (the host aborts with it). Do not extrapolate one to the
    other.
  • Real client GUI acceptance of the toast/batch report remains manual; container probes cover dedicated
    servers only.

Artifacts

  • remold-agent.jar — md5 7778f4ae0ad4b06de886d22e36315985
  • remold-plugin-mixin-0.2.7.jar — md5 51b965ea3dfd50bf8392e4043c304a2a