Repository navigation
Conversation
lipo names an arm64e slice with its pointer-auth ABI version (arm64e.v1), while dwarfdump reports the CPU-family name for the slice it was asked about, and the slice tools are already invoked with the version stripped. Only the row comparison used string equality, so a correct (arm64e) row never matched an arm64e.v1 selection and successful Evidence carried a false "no row" limitation. Compare family names by stripping a trailing pointer-auth version. Other variants (arm64e.x1) are distinct subtypes and still match only exactly. Fixes morluto#4195
[Low impact] The test-only changes appear safe to merge. SummaryThe current PR adds five tests for Mach-O UUID row selection. It changes no production code.
Reviews (2) · Last reviewed commit: "Merge origin/main into fix/macho-arm64e-..." · Reviewed by Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a1c9235e76
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| dwarfdumpArchitectureName(architecture) === | ||
| dwarfdumpArchitectureName(selectedArchitecture), |
There was a problem hiding this comment.
Match the family fallback without collapsing row versions
When captured output contains an explicit (arm64e.v2) row but the selected slice is arm64e.v1, normalizing both operands turns that contradictory row into a match. reconcileObservations can then use the other slice's UUID when LC_UUID is absent or malformed, or report a false UUID conflict when it differs. The invocation path already derives the unversioned dwarfdump name in toolArchitectureName; compare the source row against either the exact selection or that derived family name instead of adding a second normalizer that erases version identity.
AGENTS.md reference: AGENTS.md:L25-L27
Useful? React with 👍 / 👎.
| it("matches a dwarfdump row to an arm64e.v1 selection", () => { | ||
| // lipo names the slice arm64e.v1; dwarfdump reports the CPU-family name. | ||
| expect( | ||
| reconcile(`UUID: ${validUuid} (arm64e) ${path}\n`, "arm64e.v1"), |
There was a problem hiding this comment.
Exercise the family row through the inspection boundary
In the universal arm64e.v1 scenario, this direct parser call bypasses the production selection and reconciliation path. tests/boundary/providers/native/nativeSelectedArchitecture.test.ts:90-157 already exercises that workflow, but line 136 still fabricates an (arm64e.v1) row, so it passes before this fix and does not cover the observed (arm64e) producer output. Drive the family row through that boundary case, retaining module tests only for parser-specific edge cases.
AGENTS.md reference: AGENTS.md:L79-L79
Useful? React with 👍 / 👎.
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. |
Carry the selected slice name and the existing tool owner's dwarfdump spelling separately. Compare observed row labels exactly, preserving explicit ABI versions and uncertainty for missing rows. Correct the production-boundary fixture and retain wrong-version and mixed-row controls. Real Apple multi-version selection behavior remains unverified. Refs: #4195, #4288 Co-authored-by: Henglie <[email protected]>
Main (2f6b9ec) fixed the same arm64e.v1 dwarfdump row match at the inspection owner: NativeMachoInspection maps lipo's slice name to the dwarfdump spelling once, and reconcileMachoUuid matches that mapped name. Take main's parser and keep this PR's parser coverage on the new { name, dwarfdumpName } selection, so the name is not normalized twice. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Resolved the conflict with main (8fc8cc8). Main's 2f6b9ec, co-authored from this PR, already fixes the arm64e.v1 row match at the inspection owner: |
|
CI after the conflict resolution: the only failures are main's red browser tests, |
|
Closing as superseded: upstream commit 2f6b9ec ("fix(native): preserve slice identity when selecting UUID rows") landed the same fix on main and did it better than mine — it derives the dwarfdump family name at the call site and compares the row against that name, so an explicit versioned row from another slice keeps its identity instead of being normalized into a match. My branch now has no changes main does not already carry. Thanks to the reviewers for pointing out the version-collapsing flaw in my normalizer; that was a real bug in this PR. |
Summary
inspect-machoreported a falsedwarfdump --uuid returned no row for selected architecture arm64e.v1limitation when it selected anarm64e.v1slice of auniversal Mach-O. The UUID itself was correct, so successful Evidence carried
uncertainty metadata it had not earned.
Row selection compared the dwarfdump architecture label with string equality,
while the slice tools are invoked with the CPU-family name. This makes the
comparison use the same family name the tool was asked about.
Fixes #4195.
Problem and expected behavior
liponames an arm64e slice with its pointer-auth ABI version (arm64e.v1).dwarfdump --uuidreports the CPU-family name for the slice it was asked about(
(arm64e)), and REA already invokes it with the version stripped:toolArchitectureNameinNativeMachoInspection.tsstrips a trailing.vNfor every tool except
dyld_info.Only the row comparison was left asymmetric. It filtered rows with
architecture === selectedArchitecture, so a correct(arm64e)row nevermatched the
arm64e.v1selection, and the parser reported "no row" even thoughthe row was present and the UUID agreed with
LC_UUID.Expected: a versioned selection finds its row, and a row that is genuinely
absent is still reported as absent.
Change and scope
src/native/parsers/machoUuid.ts: adddwarfdumpArchitectureName, whichstrips a trailing pointer-auth ABI version (
.vN), and use it on both sidesof the row comparison in
selectDwarfdumpRow.match exactly.
arm64e.x1is a distinct subtype that the tools address onlyby its exact name, and I did not assume
dwarfdumpcollapses it toarm64e;a test pins that behaviour so the fix cannot silently widen into a guess.
existing UUID reconciliation boundary, so no maintainer scope decision is
required ("not applicable").
Contract and boundary impact
slice tool output is captured. No tool is invoked differently.
within existing boundaries.
observable difference is that a false
limitationsentry is no longerreported for
arm64e.v1selections, and the returned UUID comes from thematching
dwarfdumprow rather than falling back toLC_UUID— the samevalue, with the unfounded uncertainty removed.
portable; the tools involved remain macOS-only as before, and the tests need
no macOS host.
observations are still recorded and a disagreement is still reported.
applicable; no execution, no writes.
Expected effects:
Evidence and regression coverage
src/native/parsers/machoUuid.test.ts(new, 5 tests): thearm64e.v1row now matches; an exact name still matches;arm64e.x1staysunmatched; a genuinely absent row is still reported as absent; two rows of the
same family are still reported as a conflict rather than silently reduced to
one.
the five fail —
matches a dwarfdump row to an arm64e.v1 selectionandreports a conflict between two rows of the same family— and restoring itmakes all five pass. I ran both directions.
lipo,dwarfdumpand an arm64e toolchain, because none are available here; theregression is at the parser boundary the report identifies, and the issue's
own reproduction shows the same
(arm64e)row. Thearm64e.x1behaviour isasserted from the documented tool semantics already recorded in
NativeMachoInspection.ts, not observed on hardware.For evidence-bearing changes:
Validation performed
npm run test:focused -- src/native/parsers/machoUuid.test.ts— 5 passed;2 of the 5 fail when the fix is reverted.
npm run test:focused -- src/native/NativeMachoInspection.test.ts— 19passed, unchanged by this fix.
npx tsc --noEmit— no errors in the changed files.npx oxlint src/native/parsers/— 0 errors.npx oxfmt <changed files>— applied.Not run, and not claimed as passing:
npm run check:fast(itsdeps:checkpre-step fails in this environment) and
npm run test:acceptance(requires abuild). Expected to be covered by CI.
Compatibility, safety, and release
used, which is recorded above as a proof gap.
output only; no execution, no mutation.
Author readiness
Human owner: @Henglie
Before merge
type(scope): outcome.