Repository navigation
test(ida): align the multi-slice thinning fixture to its declared slices - #2703
kaoru0822-kitauji wants to merge 1 commit into
Conversation
`copies exactly the selected slice when later slices follow it across read boundaries` (#2291) wrote a FAT container whose first slice starts at 4096 while every architecture declares 2^14 alignment. Universal target resolution validates physical slice alignment, so parseBinaryTarget rejects the fixture ("FAT architecture 0 offset is not aligned to 2^14") before IDA thinning runs, and the test fails on main. Place the slices at 16384, 32768 and 81920. The selected arm64 slice still crosses the 64 KiB read boundary with another slice after it, so the test still checks that no trailing bytes are copied. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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. |
|
| // slice still crosses the 64 KiB read boundary. | ||
| { cpu: 0x01000007, offset: 16384, size: 8480 }, | ||
| { cpu: 0x0100000c, offset: 32768, size: 33464 }, | ||
| { cpu: 0x00000007, offset: 81920, size: 33464 }, |
There was a problem hiding this comment.
Later reads lose test coverage
The new fixture no longer tests a read that starts entirely after the selected slice. The slice ends at 66232 and the file ends at 115384, so both 64 KiB reads overlap the slice. That leaves the end > start guard in copyInput untested here. This guard prevents later bytes from being copied through a negative subarray bound.
Move the final slice to an aligned offset such as 131072 to keep that case covered.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/ida/IdaWorkspaceThinning.test.ts
Line: 129
Comment:
**Later reads lose test coverage**
The new fixture no longer tests a read that starts entirely after the selected slice. The slice ends at 66232 and the file ends at 115384, so both 64 KiB reads overlap the slice. That leaves the `end > start` guard in `copyInput` untested here. This guard prevents later bytes from being copied through a negative `subarray` bound.
Move the final slice to an aligned offset such as 131072 to keep that case covered.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.|
Superseded by a0317cf, which fixes the same IdaWorkspaceThinning fixture by declaring the 4 KiB slice's real alignment instead of moving the slices. Closing. |
|
Thanks, @kaoru0822-kitauji, for spotting that the multi-slice fixture moved data instead of declaring the 4 KiB slice's actual alignment. Main now fixes the fixture metadata and keeps the thinning scenario intact (main). |
Problem
src/ida/IdaWorkspaceThinning.test.ts > copies exactly the selected slice when later slices follow it across read boundaries(from #2291) fails on main. That is one of the two red checks on every current PR, together with jscpd, which #2691 addresses.The fixture writes three FAT slices that each declare
align = 14, but puts the first at offset 4096. Universal target resolution validates physical slice alignment (src/domain/apple/machoContainer.ts), so the fixture is rejected before IDA thinning runs. The product check is correct: a real FAT container can't place a slice there.Fix
Only test data changes. The slices move to 16384, 32768 and 81920. The selected arm64 slice (32768–66232) still crosses the 64 KiB read boundary and is still followed by another slice, so the test still checks that no trailing bytes reach the private IDA input.
Validation
origin/main,npm run test:local -- src/ida/IdaWorkspaceThinning.test.tsgives 7 passed (was 1 failed, 6 passed).format:checkandcheck:fastpass.🤖 Generated with Claude Code