Repository navigation
fix(managed): index attribute constructor owners once per layout - #1943
Merged
Merged
Conversation
Each CustomAttribute whose constructor is a local MethodDef scanned the TypeDef table to find the declaring type, so inspect_managed_artifact did O(attributes x types) row decoding. A 584 KB assembly with 16,000 types and 16,000 such attributes blocked for about 38 s. Build a first-match owner index once per metadata layout. Already-owned list positions are skipped, so overlapping malformed method lists keep their previous first-match owner in near-linear time. The index is charged to the decode budget, and a build failure is cached like the member pointer lookup. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis 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. |
3 tasks done
This was referenced Oct 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1940
Behavior
inspect_managed_artifactresolved each local attribute constructor's declaring type by scanning the TypeDef table from row 1, so the work was O(attributes × TypeDefs). After #1897, repeated row cursors no longer charge the decode budget, so nothing bounded that work (raised as a P1 by Codex on #1897).This PR builds a first-match owner index (
methodOwnerRows) once per metadata layout and looks each constructor up in it. Already-owned method-list positions are skipped, so overlapping or unordered (malformed) method lists keep the previous first-match owner in near-linear time. Names are still read throughreadMetadataStringper attribute, so the per-attribute representation charge is unchanged. The index arrays are reserved in the decode budget, and a build failure is cached likememberListRowLookup's.d802304c5Open PR #1706 includes a similar index as part of a feature. That PR conflicts with main, predates pointer-table ownership (#1886), and still scans per attribute when method lists are unordered.
Validation
src/dotnet/ManagedArtifactInspector.test.ts. It fails on main (36.4 s against the 2 s bound) and passes here; all 170src/dotnettests pass.npm run lint,npm run typecheck,npm run format:check: pass.npm test: 8,261 passed, 12 failed. The same 12 failures occur on a clean origin/main worktree on this Mac. They are environmental: ibtool NIB tests (Command Line Tools only), the hdiutil verify refusal, and JS runtime discovery path tests in/private/vartemp directories. None of them touch managed code.🤖 Generated with Claude Code