[PR #2706] [CLOSED] test(ida): declare the alignment each synthetic universal slice offset satisfies #5330

Closed
opened 2026-10-31 01:05:47 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2706
Author: @nikolay-dementiev
Created: 10/13/2026
Status: ❌ Closed

Base: main ← Head: test/ida-thinning-slice-alignment


📝 Commits (1)

  • ddf9f3a test(ida): declare the alignment each synthetic universal slice offset satisfies

📊 Changes

1 file changed (+2 additions, -1 deletions)

View changed files

📝 src/ida/IdaWorkspaceThinning.test.ts (+2 -1)

📄 Description

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.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/2706 **Author:** [@nikolay-dementiev](https://github.com/nikolay-dementiev) **Created:** 10/13/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `test/ida-thinning-slice-alignment` --- ### 📝 Commits (1) - [`ddf9f3a`](https://github.com/morluto/rea/commit/ddf9f3a70e43381187059beeace9a04c01513ae7) test(ida): declare the alignment each synthetic universal slice offset satisfies ### 📊 Changes **1 file changed** (+2 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/ida/IdaWorkspaceThinning.test.ts` (+2 -1) </details> ### 📄 Description ## 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. - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] 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 - [x] The change addresses a concrete problem, not an unscoped refactor. - [x] The PR has one focused outcome, and the title follows `type(scope): outcome`. - [x] Related issue is linked. - [x] Tests cover changed behavior and failure paths. - [x] Owning docs, contracts, and generated metadata are updated. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:05:47 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#5330
No description provided.