Skip to content

asahi: admit T8122 HAL200 on the carried G15G foundation - #163

Merged
RyanTheTide merged 12 commits into
aurora-wipfrom
satchlj/t8122-hal200-foundation-20261104
Nov 9, 2026
Merged

RyanTheTide merged 12 commits into
aurora-wipfrom
satchlj/t8122-hal200-foundation-20261104

Conversation

@satchlj

@satchlj satchlj commented Nov 5, 2026

Copy link
Copy Markdown
Member

Admit exact T8122 C0 HAL200 identities while retaining G15 records, Gen4 samplers and native sampler heaps. Report and enforce the same VM limits in the DRM shim.

Port of omacom#30.

This carries @scottjones's G15G native-admission foundation from omacom/mesa unaltered, because Aurora doesn't have it yet and this change builds on it. @scottjones @RyanTheTide: if you'd rather land the foundation separately or differently, say so and I'll rework this.

Carried commits, in original source order (source SHAs):

  • 5746729c3a3 — Reject the incompatible legacy kernel ABI before native device setup — by Chris Kearney, carried unaltered from omacom/mesa.
  • 9ba7a8c6e34 — asahi/clc: build the internal programs for G15G — by Scott Jones, carried unaltered from omacom/mesa.
  • 986104dd697 — asahi: keep G15G allocations out of the T8122 runtime reservations — by Scott Jones, carried unaltered from omacom/mesa.
  • 0163e7fa96f — asahi: admit G15G on the native path behind ASAHI_M3_EXPERIMENTAL — by Scott Jones, carried unaltered from omacom/mesa.
  • 44fe9cab321 — Merge Scott Jones T8122 Mesa runtime support behind its experimental opt-in — by Chris Kearney, carried unaltered from omacom/mesa.
  • 7010da29611 — Admit the Air runtime actual feature contract without requiring G15 prior barriers — by Chris Kearney, carried unaltered from omacom/mesa.
  • b1bcfaf3d04 — Exercise experimental Air device setup and refusal paths with drm-shim — by Chris Kearney, carried unaltered from omacom/mesa.
  • aefe5c2dd15 — Enable supported T8122 Air GPUs by default without a Mesa environment opt-in — by Chris Kearney, carried unaltered from omacom/mesa.

The replay preserves original author and committer identities, both dates, and full commit messages, including existing trailers. New commit IDs reflect the Aurora base.

This targets aurora-wip directly. Neither #161 nor #162 is a functional prerequisite; context cleanup and priority reporting remain independent changes. The carried history includes three Scott commits plus five required integration/admission commits by Chris Kearney, attributed above.

Port conflict resolution retains Aurora's newer M4/M5 paths. A separate integration commit keeps the new kernel-contract gate specific to T8122, retains M4 admission tests, and includes G15G in the wide-barrier packing fixture. The historical exact-opt-in helper change 14bcf0e is omitted because aefe5c2 removes that helper entirely; the broad 2df99f4 policy/tooling change and historical hardware report 1c651fb are not runtime prerequisites.

Interface facts in the HAL200 changes are private-informed; the implementation carried here is public code, with no isolated-author claim. Prior hardware reports concern different combined trees. This port still needs owner-attended J613 qualification before merge.

Validation: native aarch64 Asahi Gallium and Honeykrisp builds passed at -j4. Ten registered tests passed (chip admission, packing, legacy/HAL200 VM limits, G13G/G17P submissions, G15S/G15C vertex/query cases). Four additional G15G vertex/query shim runs passed across legacy and HAL200 interfaces. These are CPU/shim results, not hardware qualification. The carried broader Vulkan setup/mapping probe fails its first G13G placed-memory-map assertion, before T8122; a privileged rerun also fails. The placed-mapping implementation is unchanged by this port, but this probe is not passing and no Vulkan mapping/runtime qualification is claimed.

@satchlj

satchlj commented Nov 5, 2026

Copy link
Copy Markdown
Member Author

@DjDeveloperr @RyanTheTide ready for your regression testing. It hasn't been boot-tested on J613 with 7.3 yet; I'll post the result here when I have it. It conflicts with the latest base branch right now; I'm merging that in and will push the update shortly.

@satchlj

satchlj commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

J613 result with this Mesa (aurora-wip 4371cf86 + #161–#163 merged), 2026-11-05:

  • On Aurora 7.3, DRM driver aurora: GL and Vulkan on Apple M3 (G15G), glmark2 1113, vkcube OK, no GPU errors.
  • On 7.2.11 (asahi driver name): also works, with no regression seen.
  • Tests: 129/129 asahi tests pass. hk_query_copy needs the memory-overcommit setting, the same as on base.

@satchlj

satchlj commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

@DjDeveloperr @RyanTheTide this is the one the M3 Air needs most: it admits T8122 (HAL200), so without it the stock alarm-aurora Mesa doesn't drive the M3 GPU. It now conflicts with aurora-wip. I can rebase it if that helps, just say.

chriskearney and others added 12 commits November 6, 2026 13:39
G15G (T8122, M3) shares the agx3b encoding with G15S but needs explicit
scheduling stalls (agx_chip_needs_scheduling_stalls), so the G15S build
of the precompiled programs is not usable on it. Add a g15g target.
Nothing selects it yet.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Scott Jones <scottajones@gmail.com>
The T8122 kernel runtime reserves four ranges in every VM: its USC base
at 0x1000000000, the top half of the 2^40 USC window, 0x1074000000 and
0x7000000000 up to 0x8000000000. Binds that touch them fail with EINVAL.
The native AGX3 layout puts the internal programs at the top of the
window, the sparse alias of the heap across 0x7000000000, and compact
VDM aliases at 0x1000800000.

On G15G, use the lower half of the window, cap the heap and its sparse
alias below 0x7000000000 (agx_va_user_limit: heap [0x4000000000,
0x5000000000), alias up to 0x6000000000, below the 2^39 bound of the
absolute USC Texture/Sampler field), and keep the compact alias heap out
of the runtime USC base. The 0x1074000000 range already falls inside the
alias heap's reserved span. The constants mirror the kernel's
Runtime::new_vm by hand. Nothing admits G15G yet.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Scott Jones <scottajones@gmail.com>
Run the M3 (T8122, G15G) on the native AGX3 path with the G15S profile
(G15 records, Gen4 samplers, classic queues), with its own build of the
internal programs and its scheduling stalls, against the kernel's T8122
runtime on the 14.8.3 firmware. G15G is admitted only for chip 0x8122,
one die and one cluster, AGX3 and the legacy firmware interface, and the
device opens it only with ASAHI_M3_EXPERIMENTAL=1, the switch mesa-m3
already uses (with mesa-m3's warning line), through
agx_chip_experimental_admitted(). Without it the driver says so instead
of reporting an unknown command stream. The chip admission test covers
G15G's identity, the gate (unset, 0 and 1) and the G15G heap layout
against the runtime's reservations and the 2^39 bound.

On a J613 (MacBook Air 13-inch, M3) with the T8122 runtime, an earlier
version of this series, with the heap above the USC window, passed
compute-check and a GLES draw with readback through zink on honeykrisp
and on the Gallium driver. This layout has not run on hardware yet.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Scott Jones <scottajones@gmail.com>
…opt-in

Merge aurora-silicon/mesa PR 71 at 0163e7f, retaining original commits and authors. Preserve SiliconForest kernel-ABI checks and M4 exclusions alongside G15G admission and address-layout tests. The revised G15G address layout is not hardware-qualified; ASAHI_M3_EXPERIMENTAL remains required.

Generated-by: LLM
…rior barriers

The pinned Aurora kernel m3/m3_drm.rs Backend::feature_flags reports VM_STATUS and SCHEDULED_QUEUES for T8122, with optional compute/fragment capabilities. Require that baseline for G15G, preserving exact chip/firmware identity and explicit experimental opt-in. Other native profiles still require the unified PER_COMMAND_INPUT_SYNCS and EXACT_PRIOR_BARRIERS bits. Cover missing baseline bits and optional capabilities in the production admission test.

Generated-by: LLM
Add a synthetic G15G identity using the pinned T8122 runtime feature baseline and reject binds into its four reserved VA ranges. Extend the existing no-submit Vulkan device/pipeline/mapping probe to opt-in G15G and explicit refusal for unset/0 Air opt-in and unqualified M4. These host probes do not model firmware execution or prove hardware support.

Generated-by: LLM
… opt-in

Remove the extra ASAHI_M3_EXPERIMENTAL device-open gate at the owner request. Keep exact T8122 topology, legacy firmware, runtime feature and VA reservation checks. Exercise the real device-open path with the obsolete variable unset, 0 and 1, and retain M4 refusal with it set. This does not change kernel Kconfig, boot flags or package pins; hardware qualification of the revised Air layout remains pending.

Generated-by: LLM
Keep T8122 G15 command streams, Gen4 samplers and the native sampler heap
for both firmware interfaces. The HAL200 profile checks C0 identity and
the reported enabled-core mask without changing physical chip selection.

Keep the scheduled queue feature contract and compiler requirements. Test
profile axes and malformed identities, and allow the no-op shim to present
the additional interface for offline compiler and device-open coverage.

Signed-off-by: Satya Benson <satya@benson.earth>
The G15G HAL200 interface consumes sampler state from the native stream.
Leave the optional firmware-command sampler fields zero in both Gallium
and Honeykrisp while preserving the native heap and shader lowering.

Signed-off-by: Satya Benson <satya@benson.earth>
Signed-off-by: Satya Benson <satya@benson.earth>
…ndation

Limit the carried kernel-contract admission check to T8122 and use Aurora feature assignments. Keep Aurora M4 admission and its M5 address windows and shader targets. Match the packing fixture to native G15G wide barriers without importing unrelated repository policy changes.

Keep the carried no-submit probe consistent with Aurora M4 admission. Include its unchanged SPIR-V vertex fixture from the public omacom/mesa b1bcfaf tree, originally supplied by Chris Kearney in 3cca5b3.
@satchlj
satchlj force-pushed the satchlj/t8122-hal200-foundation-20261104 branch from c63840d to f0833b7 Compare November 6, 2026 19:56
@satchlj

satchlj commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

Rebased onto aurora-wip 3d7e4883c9 (includes #161 and #177). Head is now f0833b7524. Conflict resolution only, no other changes.

  • Still 12 commits, with the same authors, sign-offs and messages. The old "Merge branch 'aurora-wip'" commit is gone: it only resolved the Bring up T6041 M4 Max on G17P #85 overlap, and that resolution now sits in the first commit (agx_params_native_kernel_abi_supported before agx_params_fixup_upstream_uapi, as before).
  • Conflicts were with the new M5/G18G code; each resolution keeps both sides:
    • asahi_clc.c: the target list has both g15g and g18g, and the G18G omit list is unchanged.
    • agx_device.c: the G15G gate, admission condition and libagx selection sit alongside the m5 / g18g_bringup paths, and G15G's agx_va_user_limit() is used in the non-M5/G18G branch of user_limit.
    • agx_chip.h: the branch's declarations go next to the new M5/G18G ones.
    • test-chip-admission.c: the T6041/upstream-UAPI blocks stay where the previous merge put them, and the new M5 tests are kept.
  • One semantic conflict: the new test-chip.c (from the G18G commit) asserted !agx_chip_driver_supported(AGX_CHIP_G15G). I flipped it to agx_chip_driver_supported(AGX_CHIP_G15G) in the commit that admits G15G, the same commit that drops the matching assertion in test-chip-admission.c.

Build/test on an aarch64 Arch sysroot (meson, asahi Gallium + Vulkan + drm-shim, -Dbuild-tests=true):

  • Builds cleanly.
  • meson test: 194 pass, 31 fail. The same 31 fail on aurora-wip 3d7e4883c9 without this PR in the same build tree, so this PR adds no failures. The pre-existing ones: shim tests whose runner can't find its binaries, three G17G half-saturate agx_tests, asahi-native-descriptor, hk_query_copy, glcpp and glsl warnings.
  • asahi-agx-chip, asahi-chip-admission, asahi-agx3-packing and both asahi-vm-limits pass.
  • drm-shim on G15G with HAL200, under kernel driver names asahi and aurora: GLES draws, Vulkan pipeline compiles and the submission checks all pass, with the renderer reported as "Apple M3 (G15G C0)".

@satchlj

satchlj commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

CTS attempt on J613 / Apple M3 G15G, 2026-11-06: stopped on a kernel GPU fault during GLES2 after ~110 seconds. This is not a CTS pass.

Setup:

Suite Pass Fail Skip / not supported Crash Timeout Status
GLES2 3,639 10 22 0 observed 0 observed Aborted; 3,671 / 19,825 cases completed
GLES3 — — — — — Not run: safety stop
GLES31 — — — — — Not run: safety stop
EGL — — — — — Not run: safety stop
Vulkan — — — — — Not run: safety stop

Count caveat: the kernel guard terminated deqp-runner before final CSV generation. The table is reconstructed from completed first-attempt observations in the eight saved process logs; the counts exactly match their printed totals. The 179 completed retry-QPA observations cover repeated test names and are excluded. There are 16,154 GLES2 cases without a completed first-attempt result. Forced guard termination is not counted as testcase crash/timeout; this is not a finalized runner/conformance report.

At 15:05:16 EST, the kernel reported:

M3 failed work owner: VM=17 process deqp-gles2 pid 2179 ... (error EIO, 1 commands in flight)
M3: first GPU failure: EIO (GPU work pending: true)
M3 G15G verdict: job-faulted (EIO): the firmware crashed, reported an error, or the GPU reported a fault while the job ran
M3 fault render VM=17 slot=9 root=0x1009c304000 draw=23325 batch=1

The failed-owner process log has DRM_IOCTL_ASAHI_SUBMIT render failed: Input/output error while running dEQP-GLES2.performance.shader.operator.binary_operator.sub.vertex.mediump_vec4. With eight concurrent jobs, this does not uniquely identify the triggering testcase.

Failures group entirely under dEQP-GLES2.performance.shader.operator.binary_operator:

Operation family ResourceError InternalError Total
add 3 2 5
sub 4 0 4
div 1 0 1

The eight ResourceErrors report GL_OUT_OF_MEMORY during buffer upload, accompanied by sticky VM EIO / failed BO creation following the GPU submission fault. They look like fallout from that failure, rather than eight independent allocation defects. The two InternalErrors (add.vertex.lowp_float, add.vertex.mediump_vec3) report inability to obtain sensible timing estimates; their relationship to the fault is unresolved.

None of the ten failed names occurs in a73's asahi-agx2-fails.txt; its flake list is empty. Those CI profiles target M1/M2 and selected mustpass lists, so absence there does not establish an M3 regression. #163 makes the HAL200/T8122 G15G path reachable, but this single a73 run cannot isolate admission logic from the carried G15G foundation or C13m kernel/firmware behavior. There is no comparative CTS evidence or CTS result for the rebased head. Earlier glmark2 1113 / vkcube smoke results remain smoke results.

All test processes were stopped. Dmesg before/at/after the fault, the kernel journal, process logs, failure QPAs and reconstructed CSVs were saved. No devcoredump entry was present. No reboot or recovery testing was attempted; further GPU testing is left to the owner. Build containers/images and test/monitor jobs have been cleaned up.

@satchlj

satchlj commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

Corrected ARM64 CTS run on rubra / J613 / Apple M3 G15G, 2026-11-06: all planned suites completed; not a clean CTS pass. Vulkan is a sampled mustpass run. No kernel GPU fault occurred in this corrected campaign.

Setup:

Suite Pass Fail Skip Warn Crash Timeout Flake Coverage
EGL 1,926 1 1,848 0 14 0 0 3,789 selected cases
Vulkan 124,209 1 200,542 1 0 0 0 324,753 selected cases, fraction 1/10
GLES2 17,517 0 116 5 0 0 0 17,638 selected cases
GLES3 51,035 0 196 34 0 1 0 51,266 selected cases
GLES31 41,600 3 287 13 0 0 0 41,903 selected cases

All 439,349 results come from finalized corrected-build CSVs, with no duplicated test names. Vulkan includes 76 UnexpectedImprovement(Pass) and two UnexpectedImprovement(Skip) in Pass/Skip; no ExpectedFail classifications. Warn is separate.

Exact mustpass inputs, relative to GLES/EGL external/openglcts/data/gl_cts/data/mustpass/:

  • EGL: egl/aosp_mustpass/main/egl-main.txt.
  • GLES2: gles/aosp_mustpass/main/gles2-main.txt + gles/khronos_mustpass/main/gles2-khr-main.txt.
  • GLES3: gles/aosp_mustpass/main/gles3-main.txt + gles/khronos_mustpass/main/gles3-khr-main.txt.
  • GLES31: gles/aosp_mustpass/main/gles31-main.txt + gles/khronos_mustpass/main/gles31-khr-main.txt.
  • Vulkan: external/vulkancts/mustpass/main/vk-default.txt and every referenced file in CTS 1.4.6.2. Excluded 26 ray_query.stress cases from 3,247,552 source entries. All 3,247,526 eligible entries covered by 14 disjoint source slices: 100,000, twelve × 250,000, then 147,526. Each slice used --fraction 10, independently after deterministic runner shuffling; 324,753 unique selected cases. No performance/stress groups were run.

Failures and crash triage:

  • EGL: 14 real Mesa/Asahi userspace SIGABRTs, each reproduced on both attempts: six color_clears and eight render .other configurations. Zero are missing-display/platform-init crashes; zero match the supplied baseline (including x11-/wayland-prefixed EGL names). All 28 logs reach the real driver render/compile path and show:

    MESA: error: asahi: the end-of-tile shader did not compile for this chip
    MESA: error: asahi: G17P background shader is unproven: op 3, 0 pushed halves, txf=0, preamble=0, rodata=0, gprs=0, 2 samples, binary 0 B (bound 1024), main 0@0
    MESA: error: asahi: background shader has no proven native descriptor encoding on G15G
    exit status: signal: 6 (SIGABRT) (core dumped)
    

    In tested a73, op 3 = AGX_EOT_STORE (agx_bg_eot.h:50–55): the internal compute-stage agx_eot two-sample end-of-tile store shader, using nir_image_store_block_agx. Compilation returns no binary; agx_state.c:5447–5463 reaches agx_native_descriptor_rejected(), whose guard explicitly calls abort() at lines 735–741. “G17P background shader” is shared diagnostic wording on this G15G path. This is source correlation plus retained signal/log evidence; no coredumps/backtraces remained available.

Each EGL crash, all classified as driver SIGABRT (prefix dEQP-EGL.functional.)
Case suffix Classification
color_clears.multi_context.gles2.other Driver SIGABRT
color_clears.multi_context.gles3.other Driver SIGABRT
color_clears.multi_thread.gles2.other Driver SIGABRT
color_clears.multi_thread.gles3.other Driver SIGABRT
color_clears.single_context.gles2.other Driver SIGABRT
color_clears.single_context.gles3.other Driver SIGABRT
render.multi_context.gles2.other Driver SIGABRT
render.multi_context.gles2_gles3.other Driver SIGABRT
render.multi_context.gles3.other Driver SIGABRT
render.multi_thread.gles2.other Driver SIGABRT
render.multi_thread.gles2_gles3.other Driver SIGABRT
render.multi_thread.gles3.other Driver SIGABRT
render.single_context.gles2.other Driver SIGABRT
render.single_context.gles3.other Driver SIGABRT
  • GLES31 vertex atomic counters: KHR-GLES31.core.shader_atomic_counters.basic-usage-vs fails twice; counter remains 0 instead of 7, with GL_INVALID_OPERATION. The decisive driver line is the AGX backend cannot encode this VS shader for G15G; draws and dispatches using it will be skipped: AGX3 binary packer refused st_vary at line 9552 [main] (.../agx_compile.c:10664). This identifies a vertex-output st_vary encode refusal, not direct evidence of an atomic-instruction encoding failure. It and the EGL aborts both expose incomplete G15G shader support, but a common instruction-level root cause is not established: the EGL logs identify EOT_STORE and empty binary, not the packer's refused opcode. No extra GPU replay was started after owner YIELD.
  • GLES31 depth-border gather: dEQP-GLES31.functional.texture.border_clamp.depth_compare_mode.depth32f_stencil8.gather_size_{pot,npot}: two repeatable image-verification failures, including infinite border-depth comparisons; saved QPAs report invalid pixels.
  • EGL negative API: dEQP-EGL.functional.negative_api.create_pixmap_surface: expected EGL_BAD_CONFIG or EGL_BAD_PARAMETER for an invalid config, got EGL_BAD_NATIVE_PIXMAP. Separate headless/native-pixmap error-validation limitation; not one of the 14 crashes.
  • Vulkan dynamic-rendering resolve: dEQP-VK.renderpasses.dynamic_rendering.primary_cmd_buff.suballocation.multisample_resolve.r32g32_uint.max_attachments_8_samples_2: repeatable Fail, saved QPA/logs.
  • GLES3 LOD bias: KHR-GLES3.texture_lod_bias.texture_lod_bias_all: both attempts reach the 60-second timeout; no kernel fault. GLES2 has no failures/crashes/timeouts.
  • Warnings: GLES2 flush/finish (2), rasterization interpolation (3); GLES3 FBO completeness (1), rasterization (9), shader builtins (24); GLES31 shader builtins (13); Vulkan allocation-callback-failure test (1).

None of the five Fail cases, 14 Crash cases or one Timeout matches the supplied a73 fails/flakes/skips, including native-EGL prefixes. Those CI expectations are M1/M2 profiles, not a controlled M3 comparison. The shader rejections directly concern the carried G15G path made reachable by T8122/HAL200 admission; they do not isolate an admission change from the existing compiler/descriptor foundation. The depth-gather/resolve/LOD findings need driver-level investigation; no evidence here specifically ties them to HAL200 admission. This a73-only campaign does not qualify the rebased head.

An earlier pass was discarded for DE_CPU misconfiguration (legacy CTS defaulted an unspecified CPU by pointer width); it is archived as superseded and contributes no counts above.

The earlier stop was a kernel-side render-cache-pressure GPU fault on our M3 kernel, not attributed to #163; this corrected run used the diagnostic cache8 module and four jobs.

Raw CSVs, failures, logs and failure QPAs are archived on alba under artifacts/cts-20261106/results-r2/corrected-arm64/; compact provenance, scripts, list hashes and per-case crash triage are retained in the owner’s notes repo. rubra is released with no CTS/guard/tmux/container processes left running.

@RyanTheTide
RyanTheTide merged commit 856cbcc into aurora-wip Nov 9, 2026
@RyanTheTide
RyanTheTide deleted the satchlj/t8122-hal200-foundation-20261104 branch November 16, 2026 05:17
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.

4 participants