Skip to content

unityz 0.1.5

Choose a tag to compare

@github-actions github-actions released this 05 Sep 05:47
· 148 commits to main since this release
fe08154

Changed

  • Object writer/verify: rewrites now preserve an original object's
    alignment-padding bytes and nonzero true bool bytes. Unity leaves
    struct memory in padding and stores a bool as any nonzero byte, so
    zero-padded rewrites differed from the original in those meaningless
    bytes and verify reported correct decodes as failures. verify
    passes the original buffer through (writeObjectPreserving); edits
    still write normalized zero pads. Class-114 verify round trips after
    the fix: The Forest 324→20, Green Hell 2617→1698, Stranded Deep
    540→386, Raft sharedassets0 354→74, Raft level0 25→21.
  • Verify: NaN payloads no longer count as differences. An f32 NaN
    widened to the value tree's f64 and cast back cannot reproduce the
    original payload, and Unity's data holds quiet NaNs whose exact bits
    no rewrite preserves (Raft's TMPro font gradients). After this,
    verify's bytes-differ count is zero across every test game; the
    remaining failures are all read failures from older class layouts.
  • managed --trees matches more of Unity's MonoBehaviour serialization:
    [HideInInspector] publics serialize, [NonSerialized] (via the
    fdNotSerialized field flag) does not, delegates never do, bools and
    nested-record byte/char/short fields occupy their own 4-byte cells
    while top-level byte/char/short runs pack, strings inside arrays pad
    per element, native engine structs (LayerMask, Hash128) use their
    fixed layouts, and generic/cross-assembly base chains resolve
    (TypeSpec extends, one name index over all assemblies).
    Every class-114 object that reads now round-trips byte-exactly
    (bytes-differ zero across all five test games). The remaining
    failures are read failures from data authored by older class layouts
    (documented in features.md).
  • Object reader/writer: strings inside arrays are each 4-aligned, not
    packed into one run. A string[] whose payload is not a multiple of 4
    misread every following element (an out-of-bounds read on Green Hell's
    ConstructionSlot.m_MatchingItems). Round trips: Green Hell class-114
    3546→2594, Raft level0 35→23, The Forest 527→478.
  • Library: the typed views that build variable-length lists (GameObject,
    Font, ComputeShader, the audio mixer and animator families) take the
    caller's allocator and return Allocator.Error!T; they allocated through
    a hard-coded page allocator that was never freed and swallowed
    out-of-memory. Every typed view now carries a doc comment, the library
    root's status paragraph reflects the current module set, and
    asset_extensions includes .resource.