Skip to content

ci: build the Apple drivers and run their KUnit suites - #2995

Open
Alyx-ML wants to merge 1 commit into
aurora-silicon:mainfrom
Alyx-ML:aurora/ci-apple-kunit
Open

Alyx-ML wants to merge 1 commit into
aurora-silicon:mainfrom
Alyx-ML:aurora/ci-apple-kunit

Conversation

@Alyx-ML

@Alyx-ML Alyx-ML commented Nov 23, 2026 •

Copy link
Copy Markdown

Part of the #2755 split.

Summary

apple-build   defconfig + asahi.config, LLVM=1, Rust 1.96.0
              fail if any Apple driver dropped out of .config
              compile every Apple driver directory + splice/ksm/madvise/vma_exec
kunit         one arm64 QEMU run per suite (15), fail-fast off
triggers      pull_request and push on integration/aurora, same paths filter
new configs   drivers/mfd/macsmc.kunitconfig, security/keys/trusted-keys/tests/.kunitconfig

Not repeated here, because another workflow or kunitconfig already runs them:
sep, mt7932, apple-drm-kunit.yml, pmgr-pwrstate-kunit.yml, ANE
transport.kunitconfig and avd-pm.kunitconfig.

Evidence

  • Before: CI compiled only apple-sep.o and the DWC3 object, and ran two kunitconfigs.
  • After: on 377060f3688a (the current integration/aurora), in the fork:
    Apple build and KUnit passed (16 of 16 jobs), Host tests passed.
    The fork branch differs from this PR only by a test-only commit that adds ci/** to the
    push triggers and drops the push paths filter, so the push always runs.
  • Upstream CI on this PR needs a maintainer to approve the fork's workflows.

Merge Danger

Door: two-way

Blast Radius: CI minutes

16 jobs on PRs and merges that touch Apple drivers. No kernel code changes.

Assisted-by: LLM (Claude:Opus 5.5)

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Formal §1–§6 pre-PR checklist and GitHub Actions security/correctness review at 2b305b3025e1f6fdf558786f7e10eddfafdba9e9.

What looks good

  • GitHub Actions security: Uses pull_request (not pull_request_target), least-privilege permissions: contents: read, concurrency with cancel-in-progress: true, explicit timeout-minutes (120 / 60), max-parallel: 4, fail-fast: false, no untrusted ${{ github.event.* }} interpolation into run: commands, and actions/checkout@v4 matching the other workflows in this repo. RUST_VERSION: '1.96.0' matches host-tests.yml, LIBCLANG_PATH: /usr/lib/llvm-18/lib matches sep-source.yml, and tools/aurora-bindgen/build.py verifies source/patch/Cargo.lock SHA-256 digests.
  • New .kunitconfig files: Both drivers/mfd/macsmc.kunitconfig and security/keys/trusted-keys/tests/.kunitconfig are well-formed and exercised real suites in the fork run (macsmc: 34 tests, 33 passed; trusted-keys: 9 tests, 8 passed, 1 expected built-in skip trusted_source_after_mark_readonly).
  • §1–§4, §6: Pass (no model gating, no runtime hacks, clean human commit identity and Signed-off-by with Assisted-by: in PR body, naming clean).

Blockers

  1. Upstream CI has not run/passed on aurora-silicon/linux#2995:

    • Both Apple build and KUnit (45207739249) and Host tests (45207739460) are in action_required (fork PR pending maintainer workflow approval; statusCheckRollup is empty).
    • While fork run Alyx-ML/linux#45197403929 passed all 18 jobs on 409ae02ff724 (whose only diff from 2b305b3025e1 is dropping 'ci/**' from on.push.branches), Host tests has not run at all for this head, and integration/aurora has advanced by 4 commits since base 160ca431b325 including #2974 (drivers/media/platform/apple/ave/Kconfig, Makefile, and AVE KUnit tests). Maintainer-approved upstream CI needs to pass on the PR before merge.
  2. Unfiltered on.push on integration/aurora spawns 18 runners on every commit:

    • .github/workflows/apple-build-kunit.yml:43-44 triggers push: branches: [integration/aurora] with no paths: filter, unlike on.pull_request above it and unlike dt-checks.yml (which mirrors its paths: filter onto push:).
    • Every unrelated merge to integration/aurora (docs, DTS, non-Apple subsystems) will launch all 18 jobs (~100 runner-minutes / ~34.5 min wall-clock per push), and cancel-in-progress: true on github.ref will churn runners on back-to-back merges. Mirror the paths: filter onto push: (or drop push: if PR + workflow_dispatch is sufficient).
  3. Duplicate KUnit matrix entries running the exact same suites twice:

    • ane-boot (drivers/accel/ane/boot.kunitconfig) and ane-transport (drivers/accel/ane/transport.kunitconfig) both enable CONFIG_DRM_ACCEL_ANE_FW_KUNIT_TEST=y and executed the exact same 256 tests across the same 13 suites in the fork run (~15m13s combined), differing only in UBSAN_SHIFT vs. KASAN_INLINE.
    • avd (drivers/media/platform/apple/avd/tests/.kunitconfig) and avd-pm (drivers/media/platform/apple/avd/avd-pm.kunitconfig) both enable CONFIG_VIDEO_APPLE_AVD_KUNIT_TEST=y and executed the exact same 81 tests (apple-avd-{variant,h264,queue,pm,hevc,job,vp9}); CONFIG_PM_SLEEP is not referenced by any C source under drivers/media/platform/apple/avd/.
    • Deduplicate these (or explain in the workflow comment if two distinct sanitizer/PM configs are deliberately required).

Non-blocking notes

  • make LLVM=1 ARCH=arm64 <dir>/ compiles both =y and =m .o objects (including RUSTC [M] for asahi_core.o, aop.o, sep.o, pmp.o), which is fast (~6.5m) and catches compile/type errors, though it skips modpost/.ko linking (so missing EXPORT_SYMBOL or MODULE_DESCRIPTION/MODULE_LICENSE in =m modules is not checked here).
  • The header comment (apple-build-kunit.yml:12-14) and commit message mention only sep-source.yml and mt7932-kunit.yml, whereas integration/aurora also has apple-drm-kunit.yml (display.kunitconfig) and pmgr-pwrstate-kunit.yml (.kunitconfig.pmgr-pwrstate) — neither is duplicated in the matrix, so there is no overlap.

Assisted-by: LLM (Gemini 4 Neon)

CI compiled only apple-sep.o and the DWC3 object. It ran only
sep.kunitconfig and mt7932.kunitconfig. Most Apple drivers and their
kunitconfig files had no CI at all. A change that broke them was only
found on hardware.

The new workflow has two jobs:

- apple-build: arm64 defconfig plus asahi.config with LLVM=1 and Rust
  1.96.0 (the host-tests pin), with the tree's own bindgen. It checks
  that every Apple driver is still in .config, so a driver that drops
  out cannot pass by building nothing. Then it compiles the Apple driver
  directories and the core files the user4k and KSM work touches.
- kunit: one arm64 QEMU run per suite (ANE boot and PM; DCP fabric and
  topology; asahi; spi-hid; AVD; AVE; ISP; JPEG; ProRes; scaler;
  macsmc; CLPC; trusted keys). fail-fast is off.

Suites that already have their own workflow are not repeated: sep,
mt7932, the Apple display suite (apple-drm-kunit.yml) and pmgr-pwrstate.
Two kunitconfigs are left out because another one runs the same suites:
ane transport.kunitconfig (boot.kunitconfig also sets UBSAN_SHIFT, and
KASAN_INLINE is the default) and avd-pm.kunitconfig (PM_SLEEP is on by
default on arm64).

push on integration/aurora uses the same paths filter as pull_request,
as dt-checks.yml does, so an unrelated merge does not start the jobs.

Two suites had no kunitconfig, so add them:

- drivers/mfd/macsmc.kunitconfig runs the macsmc MFD and macsmc-power
  KUnit tests.
- security/keys/trusted-keys/tests/.kunitconfig runs trusted_source,
  the tests for trust sources registered at runtime.

PR aurora-silicon#2697 adds the AVE host harnesses to host-tests. This does not
overlap with it.

Verified: the YAML parses, every matrix kunitconfig exists in this
tree, and the push and pull_request paths lists are the same.

Signed-off-by: Alyx-ML <256263590+Alyx-ML@users.noreply.github.com>
@Alyx-ML
Alyx-ML force-pushed the aurora/ci-apple-kunit branch from 2b305b3 to e7daf69 Compare November 23, 2026 18:36
@Alyx-ML

Alyx-ML commented Nov 23, 2026

Copy link
Copy Markdown
Author

Thanks for the review. I have pushed a new version, rebased on 377060f3688a.

  1. Upstream CI. The branch is now on the current integration/aurora, so it includes
    media: apple: ave: run command KUnit suites with the module #2974 and media: apple: avd: repair the VP9 host control fixture #2972. On the fork, at that base: Apple build and KUnit passed (16 of 16 jobs)
    (https://github.com/Alyx-ML/linux/actions/runs/45235399937), and Host tests passed (https://github.com/Alyx-ML/linux/actions/runs/45235400352). The fork branch adds only a
    test-only commit that adds ci/** to the push triggers. Upstream CI on this PR still
    needs a maintainer to approve the workflows, as it comes from a fork.
  2. push with no paths filter. push now has the same paths: list as
    pull_request, as dt-checks.yml does.
  3. Duplicate suites. Removed ane-transport and avd-pm:
    • boot.kunitconfig runs the same ANE suites as transport.kunitconfig. It also sets
      UBSAN_SHIFT, and KASAN_INLINE is the default instrumentation, so it covers both.
    • avd-pm.kunitconfig runs the same AVD suites as tests/.kunitconfig. PM_SLEEP
      defaults to on for arm64 (SUSPEND defaults to y and ARCH_SUSPEND_POSSIBLE is y),
      so the PM ops are already built in the plain config.
      A comment in the matrix says why each one is left out. The matrix is now 15 suites.

On the notes:

  • The header comment and the commit message now name apple-drm-kunit.yml and
    pmgr-pwrstate-kunit.yml too.
  • Right, the directory build does not run modpost, so a missing EXPORT_SYMBOL or
    MODULE_LICENSE is not caught. A full make modules would catch it but adds a lot of
    build time. I have left it out of this PR. I can add it if you would like that check
    here.

Assisted-by: LLM (Claude:Opus 5.5)

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Formal Pre-PR Checklist Re-Review (§1–§6) — REQUEST_CHANGES

Re-reviewed commit e7daf694732bf91042481030c7447c74be4b4d64 (rebased onto 377060f3688a, interdiff 2b305b3025e1..e7daf694732b) against all three Wave 83 blockers.


Resolved Wave 83 Blockers

  • Blocker 2 (on.push paths: filter) — RESOLVED: .github/workflows/apple-build-kunit.yml:46-71 now mirrors all 23 paths: patterns from on.pull_request onto on.push (matching dt-checks.yml), preventing unrelated merges to integration/aurora from spawning the 16 jobs.
  • Blocker 3 (duplicate KUnit matrix entries) — RESOLVED: ane-transport and avd-pm are removed with clear inline rationale (boot.kunitconfig is a strict superset of transport.kunitconfig with UBSAN_SHIFT=y and default KASAN_INLINE; PM_SLEEP is already enabled by default on arm64 for avd). Verified all 15 matrix kunitconfig paths exist on 377060f3688a or are added by this PR (drivers/mfd/macsmc.kunitconfig, security/keys/trusted-keys/tests/.kunitconfig), and header comments / commit message now accurately reference apple-drm-kunit.yml and pmgr-pwrstate-kunit.yml.
  • Fork verification & security check: Verified fork runs Alyx-ML/linux 45235399937 (16/16 jobs passed) and 45235400352 (Host tests passed) on 27ad5f56718d, whose only diff vs. e7daf694732b is the test-only branch/path trigger adjustment. GitHub Actions security remains clean (pull_request only, permissions: contents: read, concurrency with cancel-in-progress: true, explicit timeout-minutes, max-parallel: 4, fail-fast: false, no untrusted ${{ github.event.* }} interpolation into run:).

Remaining Blocker

  1. Upstream CI on aurora-silicon/linux#2995 has not yet run/passed (Wave 83 Blocker 1):
    • Both upstream workflow runs for e7daf694732bf91042481030c7447c74be4b4d64 — Apple build and KUnit (45240184287) and Host tests (45240184162) — are still in action_required awaiting human maintainer workflow approval (statusCheckRollup is empty, mergeStateStatus: UNSTABLE).
    • No code changes are needed. Once a human maintainer approves the fork workflow runs on aurora-silicon/linux#2995 and both Apple build and KUnit and Host tests finish green on e7daf694732bf91042481030c7447c74be4b4d64, this PR is ready to approve and merge.

Pre-PR Checklist Summary (§1–§6)

  • §1 No model gating: PASS.
  • §2 Production-ready, no hacks: PASS (workflow & kunitconfig structure clean; all Wave 83 technical findings resolved).
  • §3 Safety: PASS (GitHub Actions security audited clean; least-privilege contents: read).
  • §4 Clean-room & attribution: PASS — commit e7daf694732bf91042481030c7447c74be4b4d64 carries human author/committer (Alyx-ML) and human Signed-off-by: only, zero AI trailers in commit, Assisted-by: disclosed in PR body.
  • §5 Evidence: BLOCKED on live upstream CI execution (action_required on 45240184287 and 45240184162; fork runs passed 16/16 + Host tests).
  • §6 Naming: PASS.

Assisted-by: LLM (Gemini 4 Neon)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants