Skip to content

docs(il2cpp): explain ambiguous universal slice selection - #6243

Closed
ShuaixinHuang wants to merge 2 commits into
morluto:mainfrom
ShuaixinHuang:codex/docs-il2cpp-ambiguous-slice
Closed

ShuaixinHuang wants to merge 2 commits into
morluto:mainfrom
ShuaixinHuang:codex/docs-il2cpp-ambiguous-slice

Conversation

@ShuaixinHuang

@ShuaixinHuang ShuaixinHuang commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #5752. The IL2CPP guide lists architecture selection requirements but omits the existing refusal when multiple universal Mach-O slices map to the same architecture. Explain unique selection, exact-subtype thinning and its limits, and add ambiguous-slice-selection to the unsupported-reason table.

Change and scope

One documentation file, 10 additions and 1 deletion. No parser, selector, schema, provider, evidence, package or generated-file changes. Scope decision: not applicable; documentation only.

  • Documentation or usability only; no target interaction.

Validation performed

Synchronized with upstream 2bcd7e6d, head ece75479; Windows x64, pinned Node 24.22.1 and locked dependencies:

  • npm run check: all six tasks, module boundaries and architecture guards passed.
  • npm run docs:check: all six tasks and five README consistency tests passed.
  • npm run test:focused -- tests/boundary/il2cpp/il2cppBinaryFile.test.ts: all 50 tests passed, including ambiguous FAT architecture refusal.
  • Oxfmt, git diff --check, commit hook and push-hook typecheck/lint passed.
  • Source inspection confirms ambiguity remains unsupported and thin binaries reject an architecture selector. No new tests were added for this prose-only change.
  • No local macOS/lipo or real Unity native-linking run. Exact-subtype example and recovery limits are supported by [Docs] IL2CPP native-linking guide omits ambiguous universal-slice refusal #5752's independent macOS reproduction; the synthetic existing test qualifies only REA's selection behavior.
  • Conflict resolved while preserving upstream's new invalid-method-token explanation and the original ambiguity/recovery guidance. Fresh online CI is pending; earlier-head results do not qualify this revision.

Author readiness

Human owner: @ShuaixinHuang

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

@ShuaixinHuang
ShuaixinHuang marked this pull request as ready for review October 22, 2026 04:12
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-22T04:12:18.734173Z
We couldn’t complete this review. Comment @codex review to try again.
6a5b25a Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@greptile-apps

greptile-apps Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] This documentation-only PR appears safe to merge.

Summary

Updates docs/il2cpp-metadata.md to explain ambiguous universal Mach-O selection.

  • The IL2CPP guide explains how to handle ambiguous universal slices.

Reviews (2) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile

@baron baron 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.

AI-assisted review matched the documented ambiguity/refusal and recovery to the existing coarse-architecture selector. The review exercised exact arm64e thinning with generated Apple object files; this validates command mechanics, not real Unity linking or pointer support. Original inputs remain untouched and the thin output must be inspected without the universal-architecture selector.

No blocking content finding, but the PR currently conflicts with main. Approval is withheld until conflicts are resolved and the new revision is validated. Existing successful CI applies to this head, not an untested resolution. No local real IL2CPP/provider run is claimed.

…iguous-slice

# Conflicts:
#	docs/il2cpp-metadata.md

Copy link
Copy Markdown
Contributor Author

@baron Thank you for checking the guidance and thinning command. Resolved the main conflict in ece7547, retaining upstream's new invalid-method-token explanation alongside the ambiguity row and exact-subtype recovery guidance. Net diff remains one documentation file. On pinned Node 24.22.1, npm run check, npm run docs:check and all 50 existing IL2CPP binary-reader tests passed. No local macOS/lipo or real Unity linking run is claimed. Fresh CI must qualify this head; could you please re-review and approve/merge once the current required checks pass? @morluto

@CassieFox23 CassieFox23 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

TL;DR: Main's IL2CPP guide still leaves out the ambiguous-slice-selection refusal from issue #5752. This docs-only PR adds it, and what it says matches the code I read. One sentence about arm64 and arm64e reads the wrong way round for REA's own selector.

Findings

Should fix

  • One sentence can mislead. Lines 198 to 199 say this: "A coarse arm64 name does not select an arm64e subtype". In issue #5752 this describes lipo -thin arm64, which finds no exact arm64 slice. In the guide it follows the lines about binary_architecture, so a reader will take it as a rule about REA's selector. The code does not work that way. selectImage names each slice by CPU type only (MACHO_CPU) and never reads the subtype. So arm64 refuses a file with two ARM slices, like the arm64e and arm64e.x1 pair in the issue. By my reading, it would take a file with one arm64e slice and no other ARM slice. I read this and did not run it. Please name the tool: "lipo -thin arm64 does not select an arm64e slice", and say that REA counts every 64-bit ARM subtype as arm64.
  • The body does not keep the repo template as written. Please restore the template text. Four headings are there: Summary, Change and scope, Validation performed and Author readiness. What is missing:
    • Five headings are gone: Problem and expected behavior, Contract and boundary impact, Evidence and regression coverage, Compatibility, safety, and release and Before merge. That drops their fields and boxes. These are the contract lines, the test and evidence fields, and the eight merge boxes.
    • In "Change and scope", the "Follow the contribution scope" link is replaced, and so is the paragraph under it. The new text is one line, "Scope decision: not applicable; documentation only."
    • Under Expected effects, only the documentation-only box is left. The template allows that box on its own. The two lines above the boxes are gone.
    • The "Author readiness" owner line and its three boxes are as written. The Validate author declaration check passed on this head.

Worth a look

  • The review by baron was on an older head, 6a5b25a76. It found no blocking content problem and held approval because the PR conflicted with main. The author merged main in ece7547. The compare API shows the same one file (10 added, 1 removed), and GitHub says the PR is mergeable now. The check results on this head are new, so that review does not cover them.
  • Iyanuoluwa007 wrote on the issue on 21 Oct that a fix branch was ready and that a PR would follow (comment). A search on #5752 finds only this PR, so I found no competing PR. I did not read their branch.
  • Nit: lipo comes with the Apple command-line tools. A reader on Linux or Windows may not know that. A few words ("from Xcode's command-line tools") would help. For comparison, docs/go-binaries.md line 120 says REA reads the universal table for Go binaries "without lipo".

Looks good

  • Main (169512a) has no docs text for this refusal yet. A search of docs/ for ambiguous-slice-selection finds nothing. The code has it at Il2cppBinaryImage.ts line 55 to 59, and the test at il2cppBinaryFile.test.ts line 642 covers it.
  • The new table row matches the code. The reason is in the unsupported group, as the row says. Its text matches the error multiple universal slices declare ... no slice was selected.
  • The new text says "The selector must identify exactly one slice". That is the point of issue #5752, and it fits how the code counts matching slices.
  • The line Thinning resolves selection ambiguity only is honest. The thin file still faces metadata and binary matching. Unsupported pointer encodings still apply to it too.
  • A thin file without a selector goes straight through. The code returns the bytes when the file is not a universal Mach-O and no architecture was given. The same branch rejects an architecture, which the existing slice-not-found row already says.
  • It is one file, 11 changed lines by the compare API. CI is green on ece7547. CI required, Portable tests, Docs Generation and Static checks passed. The title check passed too, and so did the author-declaration check. Source tests and the Windows lanes were skipped, as expected for a docs change.
  • The body is clear about gaps: no local macOS lipo run, no real Unity linking. I take the lipo behaviour from the issue's own macOS reproduction and baron's check, not from a run of mine.

Not run

  • No checkout, no build, no tests, no npm run docs:check.
  • I did not run lipo or REA on any universal file.
  • I did not read the Iyanuoluwa007 branch.
  • I did not read the body's Windows validation results, or confirm them.

Thanks, ShuaixinHuang, for the clear text and for resolving the conflict. Thanks also to coygeek for the issue with a real macOS reproduction.

Test setup
  • Box: Nobara 44 (Fedora 44 base), Linux 7.2.11
  • Head / base: ece7547 / 2bcd7e6 (merge base); main was 169512a

🤖 Written with Claude Code (Sonnet 5.5, verified by Opus 5.5), posted with my OK 🦊

@morluto

morluto commented Oct 23, 2026

Copy link
Copy Markdown
Owner

Closing as superseded by current main. The complete one-file guide scope is covered: unique universal-slice selection, ambiguous-slice-selection reason-table row, exact-subtype lipo thinning, omission of architecture for the resulting thin file, and limits of that recovery.

Main implementation: dab18c1.

Verification: Inspected il2cpp-metadata.md:149-157 and :318 plus il2cppBinaryFile.test.ts:707-712 ambiguous-FAT regression. No tests or real macOS/lipo runs performed; PR adds no tests and changes documentation only. The complete PR diff contains no remaining unique behavior, tests, documentation, or provider-qualification work.

@morluto morluto closed this Oct 23, 2026
@morluto morluto added documentation Improvements or additions to documentation provider: il2cpp Analysis provider / engine: il2cpp labels Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation provider: il2cpp Analysis provider / engine: il2cpp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Docs] IL2CPP native-linking guide omits ambiguous universal-slice refusal

4 participants