Skip to content
Merged
30 changes: 28 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ PLAN.md is what's next, in order, and how to pick it up: start there.
`unselect` clears a one-shot selection of its own).
`install --safe-only` writes that entry alone: for a kernel whose own
enclave driver must never bind with a writable store.
`install --safe-masked-only` writes a safe entry whose command line masks
systemd's sleep targets instead (`sleep-drain-safe masked-cmdline`,
`boot <name> --safe-masked`): for a kernel whose sleep driver makes deep
the default, so that only a direct write to `/sys/power/state` suspends.
- `ref-loader`: swaps m1n1's second stage (`/boot/m1n1/boot.bin`) for a bundle
built from another `m1n1.bin` and device trees, and puts the stock one back
(`build`, `verify-recipe`, `recovery-notes`, `install --recovery-checked`,
Expand All @@ -73,7 +77,11 @@ PLAN.md is what's next, in order, and how to pick it up: start there.
safe boot (`check`, `go [SECONDS]`): it needs the safe boot, the S2R driver's
mailbox line in the kernel log and the bound enclave driver's `diag/xart`
reading "disabled", then enables the driver, selects `deep`, saves the log,
arms the PMU RTC and suspends. Not installed by `install.sh`.
arms the PMU RTC and suspends. `ref-sleep --upstream check|go` is the same
for upstream's `sleep.c` driver booted through aura: the masked safe boot,
`/chosen/aurora,s2r-mailbox` and the driver's "boot object resumes" line;
a writable enclave store needs `--xart-writable-ok`. Not installed by
`install.sh`.
- `sleep-drain-safe` and `safe-boot/`: the safe boot for risky experiments
(A5). `pkexec sleep-drain-safe boot` makes the next restart, once, the
regular kernel with its own initramfs, whose `sleepdrain-safe` hook makes
Expand Down Expand Up @@ -239,7 +247,25 @@ PLAN.md is what's next, in order, and how to pick it up: start there.
So: running m1n1 and building a fork of it as it is are use, and fine.
Claude still doesn't open, write, change or draft m1n1 source, and stops if
a build would need a change; replacing the first-stage loader wasn't asked
and isn't OK'd.
and isn't OK'd. On 2026-11-27 Corey took aura (aurora-silicon/aura, the
Aurora project's boot loader, which Omarchy's repository now puts in
m1n1-aurora's place) off the off-limits list: "yes, definitely drop aura
from off limits". Aurora's own rulebook (aurora-silicon/agent-guidelines,
`AGENTS.md`) expects agents in its repositories; it applies to anything
done there. m1n1 (Asahi's, and forks of it) stays as above: that rule
rests on Asahi's policy.
- **This Mac is a test bench.** Corey, 2026-11-27: "this machine is a test
bench mostly. I only use it for the occasional meeting in teams", and
"enclave writes are okay. no worried if we b0rk this computer, you can
save that as a note going forward." So a risk to this Mac itself (the
second-stage loader, the enclave's store writable in a test boot, a hang,
a restore from macOS) doesn't need a fresh OK each time: say what is about
to happen and go on. Still Corey's: what needs them at the machine (the
first-stage loader, 1TR, steps in macOS, a system update) and anything
posted outside this repo.
- **Posts on Aurora's trackers carry no AI attribution**, by its rulebook's
rule 5 (commits, PRs, issues, comments). Corey, 2026-11-27: "taek it out
going forward but no need to edit". Each post still needs Corey's OK.

## Experiments

Expand Down
25 changes: 23 additions & 2 deletions PLAN.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Plan

Last updated 2026-11-27. RESEARCH.md is the lab notebook: what we found. This
Last updated 2026-11-30. RESEARCH.md is the lab notebook: what we found. This
file is what we do next, in order. Update it at the end of every session, in
the PR with that session's work.

## Pick up here (2026-11-27)
## Pick up here (2026-11-30)

Read this first. "Where things stand" below is the long record and its order of work is superseded by
this section where they differ.
Expand Down Expand Up @@ -59,6 +59,27 @@ this section where they differ.
that state, read under the m1n1 hypervisor in both systems, showed 54 words differing (Naeem Malik,
2026-11-16).

**2026-11-30: the next run is upstream's own port** (RESEARCH.md, "Upstream's port, the first try with
aura, and the system update"). olivergreg's draft PR aurora-silicon/linux#3534 sleeps and wakes a J314s
with the stock first stage and aura `main` as the second; the first try here (11-27) used aura's 1.0.0b17
release, which hangs on every wake. This Mac is now on `linux-aurora` 7.3.0.aurora1 with `mesa-aurora`,
still `m1n1-aurora` as the second stage, GRUB as the boot manager. In order:
1. **The PR's head on this Mac:** the kernel at 305ef36c built from the running configuration as a test
kernel (`7.3.0-s2rpr`), aura built unchanged from its nightly source tag of 11-28 (26c1a85, which has
the wake fix) with that kernel's device trees as the second stage (`ref-loader`; the old kept stock file
and its record removed first, since the live stock changed with the update), a safe boot with the sleep
targets masked (`test-kernel install --safe-masked-only`), then `ref-sleep --upstream check`, and
`go` with `--xart-writable-ok` (Corey's OK of 11-27). In
`~/.local/share/sleep-drain/pr3534-20261130/`.
2. **Its row on the PR**, with Corey's OK for the post and no AI attribution: a second J314s, the device
tree rebuilt into the second stage, what the log shows. Then repeats, a lid wake, a longer sleep.
3. **The measurement** (below) on that setup, with the USB-C meter.
4. `install.sh` on the new kernel: which of the older out-of-tree pieces still build on 7.3 isn't known
(the alarm modules, `pmp_sleep_release`, `smc-peek`, `e1_hook`); the kernel now has `rtc-apple-pmu`
built in, which may make the alarm modules unnecessary for the nights.
Not to repeat: a system update handed to Corey without checking what it does to the graphics stack; a
borrowed loader left in place under the regular kernel.

**2026-11-27: the reference sleeps and wakes this Mac** (RESEARCH.md, "The reference on this Mac").
Ante042's kernel branch with their second stage and the *stock* first stage: the mailbox found, one deep
suspend and resume back into the session with the RTC alarm armed for 60 s (about 64 s from the entry's
Expand Down
40 changes: 40 additions & 0 deletions RESEARCH.md
Original file line number Diff line number Diff line change
Expand Up @@ -5426,6 +5426,46 @@ alarm_at=1795002065 try=1`, `12:41:11 finish power-off-asked`. The alarm ended t
the drivers six seconds in (`done: rtc0, wakealarm present, wakeup enabled`), and the clock was right: a
power-off keeps the PMU's RTC, which only a flat battery loses. The setting is back at 25.

### Upstream's port, the first try with aura, and the system update (2026-11-27 to -30)

**The first aura trial (11-27, afternoon), a hand-made mix on the old system.** olivergreg's
`t6000-suspend-to-ram` at 5cad606 as a test kernel (`7.3.0-s2rup`, built from the 7.2.11 configuration, the
GPU's DRM name patched to "asahi", and `sleep_deep` defaulted on, since the branch still marked T6000
untested), aura's release 1.0.0b17 as the second stage with that kernel's device trees, the stock first
stage, a safe boot with the enclave's store writable (Corey's OK of that day).
- It booted twice. `/chosen/aurora,s2r-mailbox` was there and the driver said "deep sleep available, not
the default: boot object resumes 0". So aura's second stage runs behind the stock m1n1 first stage on
this Mac.
- One sleep (`untested_commit` set for it, rtc1 armed for 60 s): the Mac went dark and didn't come back;
Corey powered it off by the button. **The cause is known from the PR since:** "The `1.0.0~b17` release
hangs on every wake"; the fix is aura 3526be04 of 11-25 ("keep DAIF masked and set VBAR_EL2 when
returning from S2R"), a day after that release.
- The next boot of that kernel stopped at the splash. No log (a safe boot); not explained.
- The regular 7.2.11 kernel, booted through either borrowed loader with the newer device trees, logged
`spmi spmi-0: failed to wait for RX FIFO not empty` (and `m1-crumbs` timed out); never through the stock
one. A device-tree mismatch, gone with the stock loader. A reason not to leave a borrowed bundle in place.

**What Omarchy's repository says (11-27).** `aura` replaces `m1n1-aurora` there, with `linux-aurora` 7.3.0,
`uboot-aurora` and `mesa-aurora`; the first stage isn't a package's business. So aura's second stage behind
the stock first stage is what an updated Omarchy Mac runs, and the "mixed chain" suspected that afternoon
is the ordinary one.

**The system update (11-27, `omarchy update`, on Claude's advice) left this Mac without a desktop.** It
brought `linux-aurora` 7.3.0.aurora1, whose GPU driver calls itself "aurora", and the generic `mesa`
26.3.1, which looks for "asahi": the same splash-and-no-desktop the test kernels had shown that morning,
now on the regular system, and foreseeable from it. It did not replace `m1n1-aurora` (1.6.1.aurora3
stays; `update-m1n1` rebuilt `boot.bin` with the new kernel's device trees, 14 MB). Corey got back in on
11-30, with help from macOS, by installing `mesa-aurora`. As it stands: kernel 7.3.0.aurora1
(`CONFIG_APPLE_SOC_SLEEP=y`, no T6000 profile, `mem_sleep` only s2idle), m1n1-aurora's second stage (no
mailbox), GRUB still the boot manager.

**olivergreg's draft PR, aurora-silicon/linux#3534 (11-28):** T6000 suspend-to-RAM enabled on J314s, kernel
only, with the stock first stage, aura `main` (3526be04 or later) as the second stage and the default
command line. Their rows on one J314s: 25 of 25 deep sleeps in one boot at the head; earlier 29 of 29 with
lid wakes; an 8-hour night with a 1% drop of a 57 Wh pack (about 70 mW, at most 140 mW) against 1.8 W in
s2idle. Not yet done there: a run with the device tree rebuilt into the second stage (theirs used a
test-only overlay), a second Mac, external displays. Both of the first two are what a run here would be.

### The reference on this Mac: Ante042's kernel and second stage sleep and wake it, with the stock first stage (2026-11-27)

One deep suspend and resume, back into the running session, with the PMU's RTC alarm armed for 60 s and
Expand Down
Loading