Skip to content

Implement native Gen9 GLK primitives and physical target baseline - #5

Draft
NiSeullent wants to merge 3 commits into
mainfrom
codex/mellowgpu-remake
Draft

NiSeullent wants to merge 3 commits into
mainfrom
codex/mellowgpu-remake

Conversation

@NiSeullent

@NiSeullent NiSeullent commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

The physical 15IGL7/N4120 target (Intel 8086:3185 rev 06, subsystem 17aa:3e77, macOS 15.8.1 24H32) boots through IONDRVFramebuffer and exposes no Metal device. This branch implements the Gen9 GLK native driver units and links them into the real x86_64 kext target. Nothing activates them: the main Info.plist has no GLK personality, and qualified GPU profiles stay at zero.

Native units (20 GLK translation units in the Mellow target)

  • Formats and primitives:
    • GGTT/PPGTT and PAT encoding.
    • BCS MI command construction.
    • LRC/ELSP/CSB formats.
    • Panel-power sequencing.
    • 39-bit private IOKit DMA backing.
  • Producers and adapters:
    • Gen9 forcewake core and MMIO adapter.
    • Gen8+ interrupt decode with an IOFilterInterruptEventSource/work-loop lifetime adapter.
    • GGTT publication with readback, invalidation and quarantine. It requires a held awake-engines callback.
    • BCS0 execlists engine with stop-proof handling.
    • PCI/PM physical owner with epochs, OSObject lifetime anchors and revocation drain.
    • RCS0 render workaround producers and a held-operation topology adapter.
    • Bounded VBT parser and GLK eDP profile, including the pinned pre-191 PPS0 fallback.
    • OpRegion snapshot adapter.
    • Read-only passive PCI/PM observer.
  • The offline Mesa-based Gen9 compute compiler (Userspace/NativeGlkCompiler, Mesa pin f5cb8ee0) and the device-lab Metal bench/probe tools are included. The compiler's ISA has never executed.

Each component keeps its provenance, retained MIT notices, Claude/Codex authorship and canonical adaptations in porting/native-glk-implementation.json.

The real kext build exposed three composition defects, now fixed:

  • The owner and OpRegion adapters used SDK 15.5-only KPIs that the target's MacKernelSDK lacks: setBusLeadEnable and IOMallocData/IOFreeData. The fixes are behavior-preserving.
  • The BCS runner now uses the canonical Gen9CommandEncoding.cpp.

Standalone passive probe
Tools/build-glk-passive-probe.py builds the passive observer as com.NiSeullent.MellowGPU.Probe 0.1.0. It uses SDK 15.5 kernel headers, kernel code-model flags, Darwin ld -kext with libkmod.a, and no Lilu. It audits the result for MH_KEXT_BUNDLE, KMOD identity, a strict ad-hoc signature and user-space imports. From the clean source commit it reproduces the bundle installed on the target byte-for-byte (binary 45b9c2b3…, UUID 20E448C7…), and all 304/304 imports are statically eligible. validate-macho.py keeps its strict MellowGPU defaults; new regression tests cover the explicit identity keywords. The probe is a diagnostic, not an accelerator.

Validation

  • 43 hosted suites pass with unchanged compiler-reported inputs, up from 31.
  • Each component runner was re-run in the canonical tree:
    • interrupt: 388 checks
    • GGTT: 857+476 checks, 13/13 mutants
    • BCS: 547+112 checks, 7 mutants
    • owner: 330 checks, 21 mutants
    • render-WA: 688+98 checks
    • VBT: 735 checks
    • OpRegion: 35/35 mutants
    • Forcewake: 18+7 mutants
  • Fatal ASan/UBSan, pinned-source oracles and SDK 15.5 kernel objects are included where the runners provide them.
  • A clean-commit Xcode compile/link/ad-hoc-sign build at e049abb passes structural validation: binary 88d6fe69…, UUID 50625F6C….
  • The Tools/tahoe-abi.py parser finds 448/448 imports statically eligible against the 24H32 Boot/System kernel collections and the target's Lilu 1.7.3. The collection hashes were re-read on the live target in the same boot. Static eligibility is not a runtime load.

Actual target
Observations used unprivileged, read-only SSH in boot C5BBABA0…, plus earlier root-run public-Metal enumeration.

  • Public-Metal enumeration returns no device (exit 3) on three runs.
  • The device-lab bench, hash-verified on the target, passes its native host gate, then finds 0 Metal devices and exits 3 on all three runs.
  • Boot session and WindowServer were unchanged across runs. There is no IOAccelerator.
  • No benchmark numbers exist.

Not done

  • Compute, render, blit, present, GPU WindowServer, apps and games were not run.
  • No GPU command, MMIO, DMA, interrupt, forcewake or GGTT write has executed on hardware.
  • There is no captured VBT/OpRegion, fuse read or engine-PM observer.
  • NoMapper/D0 is not a durable PM/DMA lease.
  • PPGTT producer integration is pending.
  • The main kext was not installed. It must not load alongside the standalone probe, because both define the shared observer class.
  • Full Metal 3, WindowServer, app and game support remain incomplete.
  • Existing release assets remain immutable. Evidence is in spec/evidence/15igl7-glk-integration-20261016.json.

🤖 Generated with Claude Code

NiSeullent and others added 3 commits October 16, 2026 14:13
Copy the hash-verified frozen Forcewake, passive probe, interrupt, GGTT,
BCS, physical owner, render workaround/topology, VBT and OpRegion units
into the Mellow kext target (20 GLK translation units), plus the device
lab tools and the offline Mesa-based Gen9 compiler sources. Nothing
starts these units: the main Info.plist has no GLK personality and
qualified GPU profiles remain zero.

Canonical composition fixes found by the real Xcode build:
- GlkPhysicalOwnerIOKit: SDK-neutral bus-lead helper; MacKernelSDK lacks
  kIOPCICommandBusLead/setBusLeadEnable (same 0x4 command bit).
- GlkOpRegionIOKit: declare IOMallocData/IOFreeData for the MacKernelSDK
  build, identical to the SDK 15.5 IOLib.h declarations.
- BCS runner uses the canonical Gen9CommandEncoding.cpp name.

Add Tools/build-glk-passive-probe.py, which rebuilds the installed
standalone passive probe byte-identically and audits it (MH_KEXT_BUNDLE,
KMOD identity, strict ad-hoc signature, no Lilu, optional paired KC
import eligibility). validate-macho keeps strict MellowGPU defaults;
explicit identity keywords are covered by new regression tests.

Host suites: 43/43 pass. Component runners re-run in canonical. No GPU
execution; Metal 3, WindowServer, apps and games remain incomplete.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Clean-commit e049abb kext and standalone probe build receipts, static
24H32/Lilu 1.7.3 import eligibility, read-only target identity and the
device-lab bench result (0 Metal devices, exit 3). No GPU work ran.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant