Skip to content

Add mil-hwx-compiler, the Apple Neural Engine compiler - #747

Merged
maralcbr merged 2 commits into
omacom:masterfrom
joshuaswarren:add-mil-hwx-compiler
Oct 2, 2026
Merged

maralcbr merged 2 commits into
omacom:masterfrom
joshuaswarren:add-mil-hwx-compiler

Conversation

@joshuaswarren

@joshuaswarren joshuaswarren commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This adds mil-hwx-compiler. It installs mil-hwxc, the compiler that turns textual MIL into ANEC and HWX programs for the Apple Neural Engine. The source is the published v0.1.0 release of joshuaswarren/mil-hwx-compiler (commit 0a92228). The package is aarch64 only, publishes to edge only, and carries the omarchy-platform-apple-silicon group.

Contents

  • /usr/bin/mil-hwxc, with RUNPATH=/usr/lib/mil-hwx-compiler/lib.
  • /usr/lib/mil-hwx-compiler/lib: libobjc.so (libobjc2), libgnustep-base.so.1.31.1, and the gnustep-base resources.
  • Licenses: MIT (compiler, libobjc2) and LGPL-2.1-or-later (gnustep-base).

The compiler is Objective-C++ with ARC. It needs the libobjc2 runtime and a gnustep-base built for it. Arch's gnustep-base links gcc's libobjc, so it cannot run this code. The recipe builds libobjc2, gnustep-make and gnustep-base from the commits that the release's scripts/bootstrap-linux-toolchain.sh pins. prepare() stops the build if a release moves those pins and the recipe does not. Only the runtime libraries ship. There are no headers and no gnustep-make, so nothing collides with Arch's GNUstep packages.

depends are the libraries the shipped files link: gcc-libs glibc icu libffi libxml2 zlib. robin-map in makedepends keeps libobjc2's CMake from fetching it at build time. check() runs the release's Linux verifier: software-tests, emit and hygiene.

Upstream watch

github: joshuaswarren/mil-hwx-compiler, pattern v<version>, min_release_age: 24h. No auto_merge, so every bump is a reviewed PR.

Source

The v0.1.0 release is published (not a draft or a prerelease). The first sha256sums entry is the checksum of the downloaded GitHub archive archive/refs/tags/v0.1.0.tar.gz: 9aa57921…1772. The three GNUstep sources are pinned git commits with makepkg git checksums.

Verification

In an Arch Linux ARM aarch64 rootfs under qemu-user, makepkg -f as a normal user (clang 22.1.8, lld 22.1.8, cmake 4.4.3, robin-map 1.4.1):

  • makepkg downloaded the release archive and cloned the three GNUstep repositories. All four checksums passed.
  • build() finished: libobjc2, gnustep-make 2.9.3, gnustep-base 1.31.1 and mil-hwxc.
  • check(): operation graph, HWX object writer, program composition, HWX inspection, H13 encoding, the H13 MIL CLI and the split CLI passed. Then test_h13_layout_cli.py hit its 60 s subprocess timeout on slice-encoder-bias. qemu-user is too slow for that limit; the PR build runs natively on ubuntu-24.04-arm, where I expect it to pass, but no run has proven that.
  • On the same build tree, with only that test's timeouts raised 10x (original restored, hash checked): verify-linux-compiler.sh software-tests PASS (all 17 H13 CLI suites, the conv templates, HWX inspection), emit PASS, hygiene PASS.
  • Package built from that tree (makepkg -R): 686 files, installed size 12.49 MiB, Depends On: gcc-libs glibc icu libffi libxml2 zlib, RUNPATH /usr/lib/mil-hwx-compiler/lib. No shipped file names the build directory.
  • Installed /usr/bin/mil-hwxc under env -i PATH=/usr/bin: H13 ANEC, H13 HWX and H16G conv_relu compile. Every output file is byte-identical to the build-tree binary's output. research/inspect_anec.py and research/inspect_hwx.py read them. pacman -R removes /usr/bin/mil-hwxc and /usr/lib/mil-hwx-compiler.
  • helpers/upstream-watch.py check: already current (0.1.0). With --min-age 86400, minimum release age.

No Mac ran this package.

Build approval

The author is not in .github/VOUCHED.td. A maintainer must apply build-approved for the builds to run. The source release now exists.

The package builds mil-hwxc from a joshuaswarren/mil-hwx-compiler
release. It compiles textual MIL into ANEC and HWX programs for the
Apple Neural Engine. aarch64 and edge only.

The compiler needs the libobjc2 runtime and a gnustep-base built for
it. Arch's gnustep-base uses gcc's libobjc, so the recipe builds both
from the commits the release pins and ships their runtime libraries in
/usr/lib/mil-hwx-compiler. mil-hwxc finds them through its RUNPATH.
check() runs the release's Linux verifier.

The watch follows published GitHub releases after 24 hours, on the
reviewed lane.
@maralcbr maralcbr added the build-approved Maintainer approved this PR to build on the self-hosted pool label Oct 2, 2026
@maralcbr

maralcbr commented Oct 2, 2026

Copy link
Copy Markdown
Member

Started CI (build-approved). I'll merge once result is green. If you have the M1 build log, please paste it here too (the body says no Mac ran this package).

Non-blocking follow-up: add "rebuild_on": ["icu"] to .omarchy/package.json. The private gnustep-base links ICU's soname, so an ICU bump in Arch breaks mil-hwxc until it's rebuilt.

@maralcbr maralcbr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI green on native aarch64, full check() passes. Merging.

@maralcbr
maralcbr merged commit 282bc1c into omacom:master Oct 2, 2026
8 of 10 checks passed
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Publish succeeded → live

Packages: mil-hwx-compiler (aarch64, PR artifact)

  • edge/aarch64: mil-hwx-compiler-0.1.0-1-aarch64

Commit 282bc1c · run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build-approved Maintainer approved this PR to build on the self-hosted pool

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants