Repository navigation
test(ida): declare the alignment each synthetic universal slice offset satisfies - #2706
nikolay-dementiev wants to merge 1 commit into
Conversation
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. |
|
|
Superseded by a0317cf on |
|
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). |
Summary
The synthetic universal Mach-O fixture of
src/ida/IdaWorkspaceThinning.test.tsdeclared 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 onmain. 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
largeUniversalTargetwrote 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 withCannot open artifact: FAT architecture 0 offset is not aligned to 2^14. The failure is in CI onbf34d0d2f: 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 isMath.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
Evidence and regression coverage
src/ida/IdaWorkspaceThinning.test.tsfixture.ded199abc,npm run test:focused -- src/ida/IdaWorkspaceThinning.test.tsfails 1 of 7 withCannot open artifact: FAT architecture 0 offset is not aligned to 2^14; after the change all 7 pass.Validation performed
npm run test:focused -- src/ida/IdaWorkspaceThinning.test.ts- 7 passed (1 failed before)npm run check:fast,npm run check- greenmacOS arm64 only; Linux and Windows were not executed.
Compatibility, safety, and release
Review checklist
type(scope): outcome.