Skip to content

fix(il2cpp): report the exceeded native-link maximum in the public refusal - #10741

Merged
morluto merged 3 commits into
mainfrom
fix/il2cpp-limit-public-maximum
Nov 15, 2026
Merged

morluto merged 3 commits into
mainfrom
fix/il2cpp-limit-public-maximum

Conversation

@morluto

@morluto morluto commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Summary

When IL2CPP native linking stops at a fixed budget, inspect_il2cpp_metadata returns a resource_constraint refusal, but its reported_limits was {}. #10701 made each capacity failure carry its exceeded maximum internally; this PR puts that maximum in the public refusal, under a name that states its unit.

Problem and expected behavior

Trigger: link a binary whose fallback module-array search finds more than 64 candidate arrays (or exceeds the 65,536-entry name index, the 64-frame type rendering depth, or the 64 MiB rendered type text workspace).

Before: AnalysisResourceConstraintError { resource: "capacity", reportedLimits: {} }. The budget only appeared in message text.

After: reportedLimits: { boundary: "native-index-capacity", maximum_entries: 64 }. Each producing site declares what its maximum counts (entries, bytes or frames), so the ELF dynamic-directory and pointer-workspace budgets report maximum_bytes. Resource kind, message and recovery are unchanged.

Change and scope

  • Il2cppBinaryFormatFailure and ElfPointerRelocationFailure capacity overloads require a unit; every throw site passes its own, and Il2cppBinaryImage.openImageSteps forwards it.
  • src/il2cpp/Il2cppMetadataProvider.ts: the refusal reports { boundary: reason, maximum_<unit>: failure.limit.maximum }.
  • docs/il2cpp-metadata.md: names the three reported limits.

Not included: migrating ElfPointerRelocationFailure onto ParseFailure (separate follow-up).

Contribution scope: ordinary fix within an existing boundary; not applicable.

Contract and boundary impact

  • Semantic owner and earliest changed stage: Il2cppBinaryFormatFailure (from refactor(il2cpp): report format failures through ParseFailure #10701) owns the maximum; the provider's refusal projection is the only changed stage.

  • Contribution scope fit and linked maintainer decision: W7 part 6 follow-up "IL2CPP capacity maximum in public details".

  • CLI and MCP/tool-catalog contract: reported_limits gains one field on IL2CPP native-link capacity refusals; no schema change.

  • Provider, bridge, target-format, or platform compatibility: none.

  • Evidence, artifact, provenance, or reconstruction contract: none.

  • Target selection, authority, upstream behavior, and cleanup details: not applicable.

  • Generated metadata, package, or installation impact: none.

  • Read existing files or captured data.

  • Launch or attach to a process.

  • Inject instrumentation or run scripts/code.

  • Change process memory, registers, files, or configuration.

  • Contact network services.

  • Recover protected code or work around protections.

  • Documentation or usability only; no target interaction.

  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added: tests/boundary/il2cpp/il2cppMetadataProvider.test.ts "reports the exceeded native-link maximum in the public refusal" drives the provider with a crafted x86-64 Mach-O carrying 80 candidate module arrays and asserts reportedLimits: { boundary: "native-index-capacity", maximum_entries: 64 }. src/native/metadata/ElfPointerRelocations.test.ts asserts the pointer workspace refusal carries unit: "bytes".

  • Base reproduction: with the provider change reverted, that test fails (reportedLimits is {}).

  • Remaining proof gaps: the 1 GiB IL2CPP ELF pointer budget is not reachable in a fixture, so the byte unit is checked at the producer, not through the provider.

  • Other gaps: the type-nesting and type-text names are covered by the shared table, not by their own provider-level test (their binary-level tests are in il2cppBinaryFile.test.ts).

  • Observed, derived, and inferred claims remain distinguishable.

  • Artifact identity, source provenance, and failed attempts remain preserved.

  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • npm run test:focused -- tests/boundary/il2cpp/il2cppMetadataProvider.test.ts — 34 passed; the new test fails with the provider change reverted.
  • After review (5549fb9, rebased on main after refactor(il2cpp): report format failures through ParseFailure #10701 merged): npm run test:focused -- tests/boundary/il2cpp/il2cppMetadataProvider.test.ts tests/boundary/il2cpp/il2cppBinaryFile.test.ts tests/boundary/filesystem/nativeInitializers.test.ts tests/boundary/android/androidJniLibrary.test.ts — 258 passed; npm run test:local -- src/native/metadata/ElfPointerRelocations.test.ts — 24 passed; typecheck, oxlint, architecture guards — clean.
  • npm run typecheck — passed. npx oxlint on changed files — no errors. npx oxfmt --check on changed files — clean. npm run docs:check — passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none; additive field.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: none.

Author readiness

Human owner:

  • 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.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-15T04:35:10.025216Z 56e952d New commits
ℹ️ 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 chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2743829329

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/il2cpp/Il2cppMetadataProvider.ts Resolved
@greptile-apps

greptile-apps Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] The PR appears safe to merge; no actionable defects were found.

Summary

This PR carries budget units from native parsers into IL2CPP resource refusals. It also moves ElfPointerRelocationFailure onto ParseFailureError and updates its callers.

  • IL2CPP refusals show the exceeded native limit and its unit.
  • ELF pointer limits keep their maximum through native readers.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A["Budget producer: maximum + unit"] --> B["Typed limit failure"]
  B --> C["openImageSteps preserves both"]
  C --> D["Il2cppMetadataProvider"]
  D --> E["reported_limits: boundary + maximum_unit"]
Loading

Reviews (3) · Last reviewed commit: "refactor(elf): report pointer relocation..." · Reviewed by Greptile

Comment thread src/il2cpp/Il2cppMetadataProvider.ts Resolved
Base automatically changed from refactor/il2cpp-parse-failure to main November 15, 2026 02:11
@morluto
morluto merged commit a090fa7 into main Nov 15, 2026
52 checks passed
@morluto
morluto deleted the fix/il2cpp-limit-public-maximum branch November 15, 2026 05:44
@morluto morluto added area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior bug Something isn't working provider: il2cpp Analysis provider / engine: il2cpp labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior bug Something isn't working provider: il2cpp Analysis provider / engine: il2cpp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant