Repository navigation
Decode tiled ASTC snapshots seen on iOS 26 and 27 - #2887
Conversation
SplashBoard snapshot KTX files on an iOS 27.2 extraction hold their ASTC 4x4 blocks in 32x32-block tiles, Morton ordered inside each tile, on a surface padded to whole tiles plus one block. The reader passed them to the decoder in raster order, so all 324 snapshots in that extraction rendered as streaks or a single flat colour. KTX_reader now returns AAPL texture data in raster order. The block count decides the layout; HEAD word 12, 1 in every tiled file and 0 in every linear file observed, is read only when the counts cannot tell them apart. Linear files are returned unchanged. Checked on one iOS 27.2 and two older extractions: 324 tiled and 368 linear snapshots, plus 41 linear widget snapshots, decode with no ASTC error blocks and agree with texture2ddecoder as an independent decoder. App Snapshots still reports 324 rows on iOS 27.2. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks for this one. I ran it against our corpus and it fixes more than iOS 27.2. iPhone 14 and iPhone 15 Pro images on iOS 26.3 and 26.5 have the same tiled layout, and their snapshots now decode correctly. iOS 18 images pass through unchanged. Could you update the title, the description and the One thing that is out of scope here: an iPhone 11 image on iOS 26.2.1 uses the same tiles with the Morton x and y bits swapped, so its snapshots with visible content are still scrambled, as they were before. I haven't found a field in the file that says which order applies, so I'll handle that in a separate PR after this one merges. |
Review found the same tiled layout on iOS 26.3 and 26.5 images, so the docstring and tests no longer tie it to iOS 27.2. The docstring also states the Morton bit order and names the swapped-bit variant reported on an iOS 26.2.1 image, which this change does not handle. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks for running it against the corpus. Updated:
|
Review of abrignoni/iLEAPP#2887 found the tiled layout on iOS 26.3 and 26.5 images, and a variant with the Morton x and y bits swapped on an iOS 26.2.1 image that the fix does not handle. - Retitle the post and rename its slug and image folder so they no longer tie the layout to iOS 27. - Say the version alone does not decide the layout, and name the swapped-bit variant as not handled. - Limit the re-run advice to snapshots in the tiled layout. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
A correction to the description above, for anyone reading it later. It says every snapshot in the iOS 27.2 extraction "rendered as horizontal streaks or a single flat colour (324 of 324)". That is literally true, but it reads as if all 324 were broken, and they were not. Decoding every snapshot before and after this change and comparing them pixel for pixel:
The 193 single-colour snapshots are plain launch and placeholder screens, and iLEAPP was already showing them correctly: a one-colour picture looks the same whatever order its blocks are in. Only the 131 with real content were broken, and those are what this PR fixed. The code and its verification are unaffected. The leapps.org post (abrignoni/leapps-website#331) has been corrected to match. |
Explains why App Snapshots rendered as streaks or flat colour on an iOS 27.2 extraction (ASTC blocks in 32x32-block Morton-ordered tiles on a padded surface) and how iLEAPP now reads both layouts (abrignoni/iLEAPP#2887). Includes a diagram of the block order. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Problem
On an iOS 27.2 full file system extraction, every SplashBoard snapshot in App Snapshots rendered as horizontal streaks or a single flat colour (324 of 324).
The tiled layout is not specific to that release. In review it was also seen on iPhone 14 and iPhone 15 Pro images on iOS 26.3 and 26.5, which this change decodes correctly; iOS 18 images pass through unchanged. The iOS 27.2 extraction below is the one this PR was built and measured against.
The
AAPLmagic, the HEAD layout, ASTC 4x4 and the pixel sizes are unchanged. Two things did change:HEAD,FILL(136 bytes),LZFS,END, with LZFSE-compressed data starting at 0x100. The iOS 27.2 ones carryHEAD,FILL(16,264 bytes),astc,END, with uncompressed data starting at 0x4000. The reader already handled both chunk types, so this needed no change.KTX_readerpassed the data to the decoder in raster order.Change
KTX_reader.untile_astc_4x4(inscripts/ktx/ios_ktx2png.py) returns AAPL texture data in raster order, so App Snapshots, Widgets and the Messages preview artifact all pick it up.Verification
Data-proven on three local extractions, with
texture2ddecoderas an independent second decoder:After the fix, 193 of the iOS 27.2 snapshots are a single colour in both decoders (plain launch screens). Before it, only the iLEAPP decoder showed them flat, so that is a property of the files, not of the decode.
A run of iLEAPP with only App Snapshots against the iOS 27.2 zip reports 324 rows, with correct images.
admin/test/scripts/test_ktx_tiled_layout.pyround-trips synthetic block data through the tiled layout (portrait, landscape, tile-aligned with the HEAD word) and asserts linear data passes through untouched.Not covered:
admin/image_manifest.jsonwere available locally, so the recordedsample_datacounts were not re-run.🤖 Generated with Claude Code