Skip to content

test(ida): declare the alignment each synthetic universal slice offset satisfies - #2706

Closed
nikolay-dementiev wants to merge 1 commit into
morluto:mainfrom
nikolay-dementiev:test/ida-thinning-slice-alignment
Closed

nikolay-dementiev wants to merge 1 commit into
morluto:mainfrom
nikolay-dementiev:test/ida-thinning-slice-alignment

Conversation

@nikolay-dementiev

Copy link
Copy Markdown
Contributor

Summary

The synthetic universal Mach-O fixture of src/ida/IdaWorkspaceThinning.test.ts declared an alignment of 2^14 for every slice, including a slice at offset 4096. Since FAT alignment is validated when the target is opened, "copies exactly the selected slice when later slices follow it across read boundaries" fails on main. The fixture now declares the largest power of two each offset is aligned to.

Follow-up to #2291, which added this fixture.

Problem and expected behavior

largeUniversalTarget wrote the value 14 into the alignment field of every architecture entry. The layout of the first test (x86_64 at 4096, arm64 at 16384, a third slice at 65536) therefore declared 2^14 for an offset of 4096, and opening the file fails with Cannot open artifact: FAT architecture 0 offset is not aligned to 2^14. The failure is in CI on bf34d0d2f: https://github.com/morluto/rea/actions/runs/38361298003 (Test shard 1/6, src/ida/IdaWorkspaceThinning.test.ts). It is a defect of the fixture, not of the copy code: the product behavior under test is unchanged.

Expected: the fixture is a valid universal file, so the test exercises the copy of the selected slice across read boundaries.

Change and scope

  • src/ida/IdaWorkspaceThinning.test.ts: the alignment written for a slice is Math.log2(offset & -offset), the largest power of two its offset is aligned to (12 for 4096, 14 for 16384, 16 for 65536).

Intentionally not included: no change to the validation, the copy code or any other test.

Contract and boundary impact

  • Semantic owner and earliest changed stage: test fixture of the IDA workspace input copy.
  • CLI and MCP/tool-catalog contract: none.
  • Provider, bridge, target-format, or platform compatibility: none; test only.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Process execution, authorization, cleanup, or containment impact: none.
  • Generated metadata/package/installation impact: none.

Evidence and regression coverage

  • Tests added or updated: the existing src/ida/IdaWorkspaceThinning.test.ts fixture.
  • Base reproduction or other evidence: on ded199abc, npm run test:focused -- src/ida/IdaWorkspaceThinning.test.ts fails 1 of 7 with Cannot open artifact: FAT architecture 0 offset is not aligned to 2^14; after the change all 7 pass.
  • Remaining proof gaps: none beyond the platforms listed below.
  • 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 -- src/ida/IdaWorkspaceThinning.test.ts - 7 passed (1 failed before)
  • npm run check:fast, npm run check - green

macOS arm64 only; Linux and Windows were not executed.

Compatibility, safety, and release

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

Review checklist

  • The change addresses a concrete problem, not an unscoped refactor.
  • The PR has one focused outcome, and the title follows type(scope): outcome.
  • Related issue is linked.
  • Tests cover changed behavior and failure paths.
  • Owning docs, contracts, and generated metadata are updated.
  • 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 Oct 13, 2026 •

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 ✅ Completed 2026-10-13T08:13:47.512217Z ddf9f3a PR opened
ℹ️ 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.

@greptile-apps

greptile-apps Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Low impact] This test-only fix appears safe to merge.

Summary

Corrects the alignment declared by the synthetic Mach-O slices in src/ida/IdaWorkspaceThinning.test.ts.

  • Synthetic Mach-O slices now declare alignment that matches their offsets.

Reviews (1) · Last reviewed commit: "test(ida): declare the alignment each sy..." · Reviewed by Greptile

@nikolay-dementiev

Copy link
Copy Markdown
Contributor Author

Superseded by a0317cf on main, which aligns the FAT fixtures in src/ida/IdaWorkspaceThinning.test.ts (and brings duplication back under the jscpd threshold). Closing.

@morluto morluto added area: tests Test suite and verification area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior labels Oct 14, 2026
@morluto

morluto commented Oct 15, 2026

Copy link
Copy Markdown
Owner

Thanks @nikolay-dementiev for spotting that the universal Mach-O fixture claimed an alignment its slice offset could not satisfy. Main now gives each synthetic slice a valid declared alignment so the thinning test reaches the behavior it intends to cover (main).

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 area: tests Test suite and verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants