Skip to content

Share one metadata walk between Mono and IL2CPP - #145

Merged
CryZe merged 2 commits into
LiveSplit:masterfrom
ero-qt:managed-walk
Sep 15, 2026
Merged

CryZe merged 2 commits into
LiveSplit:masterfrom
ero-qt:managed-walk

Conversation

@ero-qt

@ero-qt ero-qt commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Part of #141.

Moves the Mono and IL2CPP metadata walks into one private managed module. On master the two walks are near copies. field.rs is the same file on both sides, the two pointer.rs files share 160 lines apart from one dereference, and class and field lookup match line for line. The real differences sit behind a Runtime enum that is matched exhaustively, so a new runtime is a compile error at every point where the runtimes differ. The public API stays the same on both sides.

Only the last two commits are new. The parity tests land first. They are hand-laid images of both runtimes' structures at real builds' offsets, and they pin behavior before any code moves.

The internal field lookup returns the declaring class, which nothing uses yet. A follow-up resolves inherited statics against the right static table, and I shaped the seam once. The field entry size is named stride, one name for Mono's alignment and IL2CPP's struct_size.

Two doc links to Image that never resolved are fixed.

cargo test --all-features runs the suite. The new tests cover image, class, field and static lookup, pointer paths, and field climbs on both runtimes.

@CryZe

CryZe commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Can you rebase this pull request so we can continue reviewing?

@CryZe CryZe left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The shared managed walk preserves the public Mono and IL2CPP behavior, with the runtime-specific differences kept explicit and parity fixtures covering image, class, field, static-table, and pointer-path traversal. I also built the Lunistice autosplitter in release mode against this exact head. The controlled WASM comparison grew by 1,626 bytes (48,234 to 49,860), which is acceptable for this refactor but worth tracking as the known-version path is optimized later. All local and CI tests pass.

@CryZe
CryZe merged commit 691da03 into LiveSplit:master Sep 15, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants