Repository navigation
accel/ane: accept H17 programs from Apple's zin_ane_compiler 10.205 (on #1790) - #1882
Merged
DjDeveloperr merged 2 commits intoNov 14, 2026
Conversation
Apple's current H17 compiler opens the task stream of its matmul and add programs with the u32 1 that H16 uses, where the linked MobileNetV1 program opens with 0. The gate demanded 0 for every H17 program, so H16_LOAD refused the first form with ENOEXEC and no further reason. Take the prologue from the stream for subtype 9: 0 stays accepted, 1 is accepted, any other value is refused. The reserved bytes, the task walk and every other check are unchanged. H16 still requires 1. The selftest section builder takes the same two openings for subtype 9. KUnit: program_h17_hwx_test now loads the MobileNet program with an opening word of 1 and refuses 2; ane_h17_prologue_test and the H16 cases still pass. program_add128_slots_test fails on the base commit with and without this change. The hardware run of a prologue-1 program is not yet done; until then the only device evidence is for prologue 0. Signed-off-by: Joshua Warren <[email protected]> Assisted-by: LLM Signed-off-by: Joshua Warren <[email protected]>
H16_LOAD refused, with ENOEXEC and no further reason, every H17 program that the ANECompiler of macOS 27.2 (zin_ane_compiler v10.205.4, TargetArchitecture H17G) writes. camera-denoise's low-light network compiled this way for J815 never reached the firmware. That compiler differs from the MobileNet and open H16G programs the validator was written against in five places. None of them names an address the kernel maps or the firmware binds: - __TEXT is not SG_NORELOC beside a __DATA scratch segment: its relocations against __KERN_0 are walked by the relocation check. - The surfaces and the kernel fill BAR slots 5, 6, 7 (descriptor +0x60) instead of 6, 7, 8 (+0x70). The run must stay in order and consecutive, with nothing after it; the operation section's bindings are checked against the same qwords as before. - An LC_NOTE "rt.version" carries the runtime version inline (offset 40 into the command, 4 bytes, zero padding). - Stabs N_GSYM/N_LSYM records describe the tensor and element types, with no section and value 0. - The empty per-core kernel objects (K..._ne_N) sit at the end of __kern_0. Accept each form on subtype 9 only; H16 keeps the exact old rules. KUnit: hwx_h17_zin_test covers each form alone and all together, with its malformed variants and the H16 refusal; it fails on the base commit. The other HWX cases are unchanged. Both 960x540 and 640x360 programs of the network validate in a host build of this parser; the hardware run is next. Assisted-by: Claude Opus 5.5 Signed-off-by: Nick <[email protected]>
DjDeveloperr
approved these changes
Nov 14, 2026
DjDeveloperr
left a comment
Contributor
There was a problem hiding this comment.
Reviewed together with #1790, which this carries: merging this lands #1790's commit too. Every relaxation is subtype 9 only, and H16 keeps the exact old rules:
- The opening word may be 0 or 1. Anything else is still refused.
- The BAR run may start at +0x60 on H17. Each slot must still equal a parsed section VM, and the rest of the descriptor is still byte-compared against the zeroed template, so nothing can follow the run.
- An LC_NOTE must be exactly the 48-byte
rt.versionform. - Stabs N_GSYM/N_LSYM records need no section and value 0, and their strings are still checked.
- A symbol may sit at its section's end.
__TEXTmay be without SG_NORELOC beside scratch, with its relocations walked.
None of these lets a program name an address outside its own sections. Programs that loaded before are accepted exactly as before.
host-tests is green on this head. Base drift doesn't touch the ANE files. Approving and merging.
DjDeveloperr
merged commit Nov 14, 2026
a421efe
into
aurora-silicon:integration/aurora
1 check passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #1790 (the H17 task stream that opens with 1); the net change is the last commit: m0d16l14n1/linux@37796b7...m0d16l14n1:linux:j815/ane-h17-zin-hwx
H16_LOADrefused, with ENOEXEC and no further reason, every H17 program that the ANECompiler of macOS 27.2 (zin_ane_compiler v10.205.4,TargetArchitectureH17G) writes. It differs from the MobileNet and open H16G programs the validator was written against in five places, none of which names an address the kernel maps or the firmware binds:__TEXTis not SG_NORELOC beside a__DATAscratch segment: it carries relocations against__KERN_0, which the relocation check walks.+0x10 * (slot + 1), and the host-built section binds 3, 5, 6, 7).LC_NOTE"rt.version" with the runtime version inline (offset 40 into the command, 4 bytes, zero padding).N_GSYM/N_LSYMrecords describing the tensor and element types: no section, value 0, the stabs type number inn_desc.K…_ne_N) at the end of__kern_0.Each form is accepted on subtype 9 only; H16 keeps the exact old rules.
KUnit:
hwx_h17_zin_testcovers each form alone and all together, malformed variants and the H16 refusal (26 checks); it fails on #1790 at its positive checks. The other HWX cases are unchanged and pass.Tested on J815 (7.3.0, integration/aurora + #1790 + this + the T8142 ANE series): camera-denoise's open low-light network, compiled by this Mac's macOS at 640x360 and 960x540, now validates; the 640x360 program loads on the M5 firmware and its process is created and torn down (
H17 LOAD,CREATE,TERMINATE and UNLOADall status 0). Before this change both programs were refused atH16_LOAD. checkpatch --strict clean.Part of the J815 (MacBook Air 15-inch, M5, T8142) bring-up: board results are summarised in discussion #135.
Assisted-by: Claude Opus 5.5