Commit Graph
16 Commits
Author SHA1 Message Date
Anees Iqbal b270aa3611 📝 Quote Graft 0.2.0's client states and its provider matching [ci skip]
Graft 0.2.0 reports a bound consumer as waiting for "a provider of personality
<names>" or with its "activation gate open on a provider of personality
<name>", where 0.1.0 named the device and its nub. It finds ReimsGraphics among
the placed kexts by its manifest, opens the gate on each nub a personality's
provider matching matches, and on arm64e starts the libraries the manifest
declares. The design doc, prebuilt.py's comment on the staged personalities
and the lane gate's comment on graft-bind now say so; the lane gate's check
already matches the new wording.
2026-11-11 04:55:49 -08:00
Anees Iqbal 76a7ad4d7b ⬆️ Take Graft 0.1.0, its first public release
Graft 0.1.0 (commit bb884fe, release zip sha256 2bea380e) is Graft's first
public release: bundle id ai.aneesiqbal.graft, serving only
ai.aneesiqbal.ReimsGraphics and ai.aneesiqbal.RgfxGate, with a C++17 SDK tool,
graft-kext, that consumer.mk builds from source with Xcode's clang++ in place
of the Python SDK. Its zip, copied by its own tools/vendor.py with the record
of all 156 files, puts Graft's source tree, the two kexts and the SDK in
guest/graft; the kexts sit at guest/graft/Graft.kext and Graft-arm64e.kext,
with no built/ any more, so the set's staging, its Graft check and the lane
gate read them there. The only binaries are the two kexts. AGENTS.md now says
guest/graft is Graft's release as vendor.py copies it.

RgfxGate depends on ai.aneesiqbal.graft 0.1.0, Graft's compatible version.
Graft hands an arm64e route's original back as a void * holds a function
pointer, discriminator 0, so RgfxGate keeps each AMFI original in a void * and
converts it to its mpo type at the call, which re-signs it; a typed variable
written through a void ** would authenticate with the type's discriminator and
fault. The static_asserts on the wrappers' discriminators stay. Graft's kernel
side refuses by name where it could have panicked, among them an arm64e AMFI
slot not signed with its operation's discriminator and a donor table that
differs from the live vtable.

set-check checks the prelinked collection with graft-kext check-prelinked,
which takes prelink.py's arguments and exit codes. Graft reports a bound
consumer as "bound: imports and vtables committed;" and either waiting for the
device or "activation gate open on the device nub"; the lane gate's graft-bind
passes only on the open gate, since only then does IOKit start ReimsGraphics.
Graft's own id moves in stage-config.py and docs/qemu.md, check-boot marks a
panic report naming ai.aneesiqbal as ours, and msi-appload posts its
measurement notification under the new prefix.

The prebuilt sets are rebuilt from these sources in their own commit.
2026-11-10 00:35:01 -08:00
Anees Iqbal f2d97498df 🎨 Name our kexts and Metal bundle under ai.aneesiqbal
The owner moves our reverse-DNS names from com.steelbrain to ai.aneesiqbal,
keeping each name's last part: ReimsGraphics, RgfxGate and the Metal bundle
(reims-graphics) take the new prefix. Graft 0.1.0 pins these new consumer ids
and refuses the old ones, so this lands with its adoption. What the guest sees
changes with it: the kexts' bundle ids, the Graft gate property
(ai.aneesiqbal.ReimsGraphics.graft-bound) and the registry root's
GraftClient.ai.aneesiqbal.* keys. The boot checks match the new names.

The prebuilt sets are rebuilt in the adoption batch, on Graft 0.1.0.
2026-11-10 00:34:34 -08:00
Anees Iqbal f122d7a14b ✅ Fail a kext set that leaves one of our own symbols undefined
24b9b4ca2's arm64e ReimsGraphics called ReimsGraphics::timingFor, which is
compiled for x86-64 alone. A kext links with its undefined symbols left to the
boot linker, so the set built, staged and passed prebuilt-check, and Ambrosia
then stopped every arm64 guest before the kernel: "boot failed:
NoSymbol(__ZN13ReimsGraphics9timingForERK8RgfxModePNS_6TimingE)".

Staging a set and prebuilt-check now read each kext's symbol table and fail
where a kext leaves a symbol of ours undefined (a name with ReimsGraphics,
Rgfx, rgfx, RGFX, Graft or graft in it) that no kext before it in the set
defines: RgfxGate's imports of Graft's client API stay allowed, since Graft
comes first. The reader is Python alone, so prebuilt-check still runs on any
host. On 24b9b4ca2's sets it names that one symbol, in the arm64e
ReimsGraphics; ae4f88215's sets have none.

prebuilt.py is one of the sets' recorded sources, so both sets are stale
until the next commit's fix rebuilds them.
2026-11-09 10:07:41 -08:00
Anees Iqbal cd4016b7b3 📦 Place the arm64e kext set from macOS 14, not 13
arm64 macOS 11 to 13 are not supported for now (owner, 2026-11-09): macOS
13.6 offers the reims-graphics device no MSI, and the kexts have no INTx
path to build. The arm64e set's MinKernel goes from 22.0.0 to 23.0.0 at its
source, guest/tools/prebuilt.py, and the Makefiles' comments say the arm64
guests are macOS 14 and later; the arm64e builds keep their 13.0 deployment
target, so the kexts are unchanged.

Both sets were rebuilt on a Mac (Xcode 27.2): every kext, Info.plist and
the x86 set.toml are byte-identical to the previous sets; the arm64e
set.toml's MinKernel lines and both sources.toml records of the changed
sources are all that differ. prebuilt-check passes for both sets.
2026-11-09 05:06:23 -08:00
Anees Iqbal 3f683a0986 🐛 Fail set-check on any weak import, which OpenCore cannot bind absent
set-check let a weak import through when OpenCore bound it to 0, but 0 at link
time is not 0 at run time: the kernel rebases the word by the collection's
slide, and the kext read the result as a definition and called it on 11.7.11.
No word tells an absent weak import from a present one under OpenCore, so the
check now fails on any weak import in the set; a name some release lacks is
bound through Graft, which binds it to gOSKextUnresolved. The lessons entry
says so, and that set-check proves a kext links and injects, not that it runs.
2026-11-09 02:01:02 -08:00
Anees Iqbal 49b18ef438 🆕 List Graft's arm64e build first in the arm64e kext set
guest/graft now carries Graft-arm64e.kext, so the arm64e set takes it as
the x86-64 set takes Graft.kext: staged first, before RgfxGate, which
names com.steelbrain.Graft, and checked against the vendored binary.
Ambrosia's config bundle takes it as GRAFT=. The docs that said the set
lists no Graft yet now say what it lists, and what a pass still needs:
Graft 1.3.0's IOMobileFramebuffer synthesis for the display's bind.
2026-11-08 23:59:56 -08:00
Anees Iqbal 624ce770ca 🐛 Reach the weak page count only through a pointer in data
OpenCore's linker binds an unresolved weak import to 0, and the kext's
direct call to IOMemoryDescriptor::getPageCounts's three-count form is
relative to the instruction, so it cannot reach 0: on the Boot KCs of
11.7.11, 13.7.8 and 15.8.2 the linker reported "RIP-relative overflow ...
target=0x0" and left ReimsGraphics out of the kernel collection, which
would boot those guests with no display driver (make -C guest set-check
with OpenCore's TestKextInject; 26.7.2's links, the symbol resolved).

The function is now reached only through a volatile function pointer in
data, whose whole address the linker binds, 0 or gOSKextUnresolved where
it is absent, and the code reads that word, never the symbol.

make -C guest set-check now passes a weak import the linker bound to 0,
where the kext was injected, and names it; any other import bound to 0
fails as before. docs/lessons.md records the trap.
2026-11-08 22:59:17 -08:00
Anees Iqbal ab53a4b949 🆕 Build the guest's kext set for arm64 guests too
The arm64 macOS 13 and later guests Ambrosia boots get a set of their own,
guest/prebuilt-arm64e: ReimsGraphics and RgfxGate for arm64e, the Metal bundle
inside RgfxGate for arm64e (system processes such as WindowServer) and arm64
(apps). `make -C guest set-arm64e` builds it and `prebuilt-arm64e` writes it with
its own sources.toml; prebuilt-check, which cargo xtask check runs, now checks
both sets.

The build picks per-architecture files with ARCH_NAME. An arm64 kernel collection
has neither AppleGraphicsDeviceControl nor IOAcceleratorFamily2, so the arm64e
kext has its own Graft declaration (src/graft-arm64e.json: IOFramebuffer and
IOAccelerator, both from IOGraphicsFamily) and its own Info.plist
(src/Info-arm64e.plist: no device control, no library of either). It leaves
RgfxDeviceControl out and references no IOAccelMemoryMap function. Graft's
consumer rules read src/Info.plist only, so the kext Makefile replaces that one
recipe for arm64e until Graft's rules take the path; make says so with a warning.
RgfxGate packs the guest's slice's cdhash, arm64e for this set.

The x86-64 set's kexts build byte for byte as before; only its record of the
sources changes. The arm64e set does not list Graft yet: it takes Graft's arm64e
build once guest/graft carries one. Its ReimsGraphics' imports all resolve in the
kernel collections of macOS 13.6, 14.6.1, 15.6.1, 26.6.2 and 27.0.1; RgfxGate's
install still calls VNOP functions an arm64 collection does not export.
2026-11-08 20:34:15 -08:00
Anees Iqbal cde8daab29 🐛 Expect Graft 1.1.0's gated personalities in the dormant kext
Graft 1.1.0's staging keeps ReimsGraphics' personalities, each gated by an
IOPropertyMatch on the property Graft sets on the device nub once it has
bound the kext. The set's stager refused any personality, as 1.0.0 staged
none; it now requires each to carry that gate.
2026-11-08 18:00:12 -08:00
Anees Iqbal c950214aec 🆕 Give guests on macOS 11 to 13 the reims-graphics kext set
OpenCore now injects Graft, ReimsGraphics and RgfxGate from Darwin 20
(macOS 11) instead of Darwin 23 (macOS 14). x86-64 guests on macOS 11, 12
and 13 now get our set, so their display and Metal run on the reims-graphics
device. Before this commit OpenCore left these guests without the set.

These releases' x86-64 matrix rows now pass in full. Graft 1.0.0 binds what
each release's kernel has. The set chooses the completion words each
release's family exports. The HEVC search finds the frame description in
each release's layout. With pin 22, the library compiles 11's Core Image
metallibs.

The bound's comment in guest/tools/prebuilt.py and the design doc now say
macOS 11. The set is regenerated with it: set.toml's MinKernel, and
sources.toml's record of prebuilt.py.
2026-11-08 12:13:20 -08:00
Anees Iqbal a656ba31d1 ⬆️ Take Graft 1.0.0 from its release tag
Graft 1.0.0 is its first release. It reorganizes the repository: the built
kext moves from dist/ to built/, and the header, start glue and build rules
move under sdk/. It also binds an absent weak import to the pointer
gOSKextUnresolved holds, and verifies an imports-only provider through an
anchor class, which kextvers needs for macOS 11 and 12.

Point the guest build, the OpenCore link check, the lane gate and the
design doc at the new paths, and rebuild guest/prebuilt from them.
2026-11-08 05:15:44 -08:00
Anees Iqbal 370933b618 🎨 Inject the Graft set from macOS 14, where its matrix rows pass
On 11 to 13 the set would load where nothing of ours loads today, and those
releases are not ready: 12 crash-loops WindowServer on the display pipe's
completion layout, 13.7.8 draws a black wallpaper, and on 11 the host refuses
Metal libraries. OpenCore now injects Graft, ReimsGraphics and RgfxGate from
Darwin 23 on, so 11 to 13 boot plain, as they do today.

MIN_KERNEL in guest/tools/prebuilt.py is the one place that decides it, and
each older release joins in its own commit once its row passes. Graft itself
still checks no version.
2026-11-08 03:00:32 -08:00
Anees Iqbal 64786f293f 🆕 Build the guest kext set on Graft, with no Lilu or loader
The set was Lilu, ReimsGraphicsLoader, two generated shim kexts, ReimsGraphics
and RgfxGate, gated to macOS 26.4 to 26.x: the loader's tables held one
ReimsGraphics build's site offsets and one KDK's class layouts, so any kext
change needed a new loader, and no other release could bind.

Now the set is Graft, ReimsGraphics and RgfxGate, with no kernel range:
- ReimsGraphics builds for macOS 11 with Graft's consumer rules. Its build
  embeds a manifest of every System-KC site and parent class, so Graft binds
  it by name against the running libraries and checks their layouts, and a
  kext change never needs a new Graft.
- RgfxGate is a Graft client built against the SDK's Kernel.framework and
  Graft's header and start glue; Lilu's headers and MacKernelSDK are no
  longer fetched.
- guest/loader, both shims, the KDK tables and fetch-lilu.sh are deleted; the
  prebuilt set needs no KDK.
- prebuilt-check also verifies guest/graft against its record, and records
  inputs git does not track yet. set-check links the set with OpenCore's
  linker and checks with Graft's prelink.py that ReimsGraphics stays bindable;
  it replaces the kext's own shim-based link check.

The set check passes on all ten matrix releases' Boot KCs (11.7.10 to 26.7.2).
2026-11-08 02:58:39 -08:00
Anees Iqbal 6fb33ecd27 🎨 Rename the reims-graphics crate to reims-vgpu-graphics
The crate that holds the reims-graphics device's wire and transport now
carries the library's prefix, as reims-vgpu-video does: its directory is
crates/reims-vgpu-graphics, its package reims-vgpu-graphics, and its Rust
path and log target reims_vgpu_graphics. The guest's, the option ROM's and
Ambrosia's Makefiles include the wire header from the new directory, and the
prebuilt records name it there.

Nothing changes for the guest or the host. The device keeps its name
(reims-graphics, QEMU's reims-graphics-pci, PCI 1234:5247), and the wire
header keeps its file name and RGFX_ symbols. The C API header is unchanged,
and the prebuilt kexts and option ROM are byte-identical; only the records'
paths and source hashes move. A log filter names the crate's lines by its
new target (REIMS_VGPU_LOG=info,reims_vgpu_graphics=trace), a diagnostic.
2026-11-08 01:37:50 -08:00
Anees Iqbal a6843ce70f 🆕 Build the guest's OpenCore kext set with one make target
An x86-64 guest's OpenCore image needs, after Lilu, the loader, its two
shims, ReimsGraphics staged without personalities, and RgfxGate with the
bundle as its payload, all from one build: the loader binds only the
ReimsGraphics it was made from. `make -C guest set KDK=...` builds each part
in build/set-work and writes the set and set.toml, its Kernel > Add entries
in order with their bounds (25.4.0 to 25.99.99), which reims-ctl reads.
`make prebuilt` builds it afresh into guest/prebuilt with sources.toml, the
SHA-256 of every source it was built from and of every file it wrote, and
`make prebuilt-check` fails when either differs; it only hashes, so it runs
on Linux too. `make set-check` links Lilu and the set into a Boot KC with
OpenCore's linker and checks every name resolves and every site of
ReimsGraphics holds its shim's placeholder, which is what the loader checks
at boot. `make test` runs the parts' own tests.

The Lilu deps are fetched before the parts build, since rgfxgate's objects
do not wait for its own fetch under -j, and the parts' Makefiles get no
variable of the top-level command line, whose OUT and KDK would set theirs.
2026-11-05 22:55:55 -08:00