Repository navigation
fix(il2cpp): report the exceeded native-link maximum in the public refusal - #10741
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 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".
[Medium impact] The PR appears safe to merge; no actionable defects were found. SummaryThis PR carries budget units from native parsers into IL2CPP resource refusals. It also moves
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"]
Reviews (3) · Last reviewed commit: "refactor(elf): report pointer relocation..." · Reviewed by Greptile |
2743829 to
5549fb9
Compare
Summary
When IL2CPP native linking stops at a fixed budget,
inspect_il2cpp_metadatareturns aresource_constraintrefusal, but itsreported_limitswas{}. #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,bytesorframes), so the ELF dynamic-directory and pointer-workspace budgets reportmaximum_bytes. Resource kind, message and recovery are unchanged.Change and scope
Il2cppBinaryFormatFailureandElfPointerRelocationFailurecapacity overloads require aunit; every throw site passes its own, andIl2cppBinaryImage.openImageStepsforwards 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
ElfPointerRelocationFailureonto 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_limitsgains 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 assertsreportedLimits: { boundary: "native-index-capacity", maximum_entries: 64 }.src/native/metadata/ElfPointerRelocations.test.tsasserts the pointer workspace refusal carriesunit: "bytes".Base reproduction: with the provider change reverted, that test fails (
reportedLimitsis{}).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.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 oxlinton changed files — no errors.npx oxfmt --checkon changed files — clean.npm run docs:check— passed.Compatibility, safety, and release
Author readiness
Human owner:
Before merge
type(scope): outcome.