Skip to content

agx: one chip table instead of chip lists typed across the driver (no behaviour change) - #588

Merged
DjDeveloperr merged 13 commits into
aurora-silicon:aurora-wipfrom
jgoyvaerts:pr/agx-chip-info-table
Nov 21, 2026
Merged

DjDeveloperr merged 13 commits into
aurora-silicon:aurora-wipfrom
jgoyvaerts:pr/agx-chip-info-table

Conversation

@jgoyvaerts

@jgoyvaerts jgoyvaerts commented Nov 21, 2026 •

Copy link
Copy Markdown

This replaces the chip lists typed out across the driver with one table that has one row per chip. It is meant to change nothing: every predicate, allowlist and converted comparison gives the same answer as before for all 19 chips and AGX_CHIP_UNKNOWN.

The series is on aurora-wip b8762aa (rebased in review round 3; see "Rebase onto b8762aa" below).

Hardware rows in the comments: the first-round head 0d0eab5 on M1 Pro (G13S), M2 (G14G), M4 Max (G17P), M5 Max (G17C) and M5 Ultra (G17D, with #362 on top); tree 31451cda (b0476f8 .. 2a799a5) on G17P (T6040, T6041, T8140) and T8132, no behaviour change. The rebased head 06b56e0 has run on G17P (M4 Pro) only. M6 (G18G) and M5 Pro (G17S) are still open.

Why

On aurora-wip b8762aa the driver has 1,053 raw == AGX_CHIP_* / != AGX_CHIP_* / case AGX_CHIP_* comparisons outside tests and agx_chip.[ch], although agx_chip.h says chip identity is never tested at the call site. The same facts are written several times and have started to drift:

  • the per-chip generation tables exist four times (inline arrays in agx_chip.h, _reference switches in agx_chip.c, a copy in decode.c, a copy in the gallium descriptor header);
  • 31 per-record *_supported(chip) allowlists retype the same 12-chip list, 10 times with G18G and 5 times without;
  • "runs an AGX3 path" is written as three different chip sets, in 35 spellings;
  • agx_native_graphics(dev) and agx_chip_native_agx3(dev->chip) are the same test under two names.

Adding a chip today means finding every copy.

What changes

Commits What
04ea12aa7 A truth table test: every predicate, allowlist, selector and the decoder's identity mapping against every chip value (823 checks at the head), with the expected values printed by the code at afcc08b. It passes before and after every later commit.
2ed0cf8c2 struct agx_chip_info, one row per chip. Existing predicates keep their names and read the row. The duplicate tables go.
1fad7d2c1, 9f630958d, d5a4e4b7c decode.c, the gallium descriptor header and the per-record allowlists read the table.
7a6073086 .. 966f8febe Call sites that an existing or newly named predicate answers exactly are converted, one commit per directory.
f96db0541 .. c6898ead1 agx_native_graphics() is removed; agx_chip_native_agx3() is the one spelling.
06b56e082 The Ioto and PPP payload generations move into the table (a list that was typed seven times). Last commit, can be dropped on its own.

Raw comparisons, counted as above, go from 1,053 to 544. What is left is mostly single-chip identity (G18G, G17P, and G17A in hk_cdm_caches_pending()) and is deliberately not touched.

Where today's lists disagree

Nothing is merged. Where two lists differ today, or mean different things, both are kept and named:

  • "Runs an AGX3 path" is three sets, now three predicates. agx_chip_native_or_m5 (no G18G) is called on 121 lines, agx_chip_agx3_path (native, M5 and G18G) on 40, agx_chip_native_or_g18g (no M5) on 13. These names say which chips, not why. Whether each agx_chip_native_or_m5 site means to leave G18G out is a question for someone with M6 hardware.
  • agx_chip_m5_paths (takes the M5 driver paths) and agx_chip_hal300_records (HAL300 records witnessed by a native capture) are both G17G and G18G today. They are separate bits in the table, each with its own truth-table row, so one can change without the other.
  • G18G is still accepted by VDM state, PPP state, barrier, stream terminate, the CDM launches and CDM barrier, and still refused by VDM stream link, tessellate, direct Index List, CDM stream link, link padding, substream barrier and Ioto profile control. Each record has its own bit in the table.
  • agx_isa_is_agx3 (AGX3B, AGX3C) and agx_encoding_is_agx3 (also AGX3D) both stay.
  • The decoder still accepts device variant 'X' with chip id 0x6041 as G17P, which device open stopped accepting in b45e4ec. Kept as is, and now pinned by the truth table.
  • One visible difference, not reachable: the decoder's own chip-name helper said "unknown" for the AGX2 chips and agx_chip_name() names them. All five call sites are on AGX3-only paths.

Rebase onto b8762aa

  • Conflict in hk_shader.c: fa9a676 (asahi, borealis: AGX3 compute shader vectorization, op_timings register-cache hints, unary bitop wait folding, and group_count upload cache #413) moved the storage-result-select test into agx3_ssbo_vec, which also gates SSBO vectorization before lowering. That structure is kept, and agx3_ssbo_vec is now agx_chip_g17p_or_m5(): the same set, read from the table.
  • Raw chip sets the merges since 7ba2957 added (RyanTheTide's list):
    • hk_device.h:566 hk_cdm_memory_scope_form() (G17P or M5) was already agx_chip_g17p_or_m5() in this series, which converts the line it came from.
    • hk_shader.c:3252 (G17P or M5) is agx_chip_g17p_or_m5(), as above.
    • test-agx3-g17p-task-kernel-shared.c: the encoding is agx_chip_isa_encoding() of the chip it compiles as (G17G for G18G, as agx_gather_device_key() does): AGX3B for G17P, AGX3C for G17G and G18G, as before. Its g18g stays: identity, like the device key's.
    • hk_device.h:577 hk_cdm_caches_pending() (== AGX_CHIP_G17A) stays: single-chip identity, next to the G18G and G17P ones.
    • No new predicate, so no new truth-table row. The series' rewrite script finds no other chain to convert in the directories it covers. Run over all of src/asahi, it also finds asahi_clc.c:95 (native or M5, from 10-15, outside those directories); left as it is.
  • Semantic conflict: asahi: set the render-start USC cache invalidate wherever the kernel admits it #567 gave agx_vdm_barrier_core_word() a kernel_admits_inval argument. The truth-table row now asks agx_vdm_barrier_core_word(c, false), the chip-dependent fallback, with the same expected row (plain word on G15S, G15C and G16G).
  • Commit messages: base, suite counts and test results updated. Apart from the new base, these are the only code changes since tree 31451cda.

Testing (rebased head 06b56e0 against base b8762aa)

MacBook Pro 16" M4 Pro (J616s, T6040, G17P), kernel 7.3.0-m4.177, release builds with the options below, 2026-11-21:

Every one of the 13 commits builds (Vulkan and gallium), asahi meson suite 216/216, truth table green (761 .. 823 checks, the same counts per commit as before the rebase), precompiled libagx kernels byte-identical to the base
Head meson --suite asahi --suite vulkan 219/219, truth table 823 checks
drm-shim, all 17 ASAHI_SHIM_CHIP profiles, base vs head vulkaninfo --json identical apart from build UUID and driver info
drm-shim, 258 dEQP-VK cases per profile 8,047 submits compared on kernel command buffers and a hash of every mapped BO: 0 differ (one case varies run to run and matches on its stable lines)
drm-shim, offscreen GLES 3.1 program identical submitted bytes on all 17 profiles
drm-shim, the 22 registered tests that submit 17 identical (177 submits), 4 identical on every line that is stable between runs, hk-g17p-cross-queue not comparable (it times out under the shim on base and head alike, and most of its dump lines vary between runs of one build)
G17P hardware, dEQP-VK compute / SSBO / GLSL, 37,339 cases 18,884 Pass / 18,455 NotSupported, 0 differ from the stored aurora-wip fa9a676 baseline, 0 GPU recoveries
G17P hardware, offscreen GL, 7 frames pixel-identical to the base build

Since b8762aa, the gallium registered tests submit different shader bytes from two build trees of the same commit (one bit in the first instruction of each shader), so base and head were compared built one after the other in the same tree. Built in two trees, plain aurora-wip already differs from itself. The 24,262-case graphics sample and the CPU benchmark below were not rerun after the rebase.

Testing before the rebase

MacBook Pro 16" M4 Pro (J616s, T6040, G17P), head b0476f8 against base 7ba2957:

Every one of the 13 commits builds (Vulkan and gallium), asahi meson suite 208/208, truth table green, precompiled libagx kernels byte-identical to the base
drm-shim, all 17 ASAHI_SHIM_CHIP profiles, before vs after vulkaninfo --json identical apart from build UUID and driver info
drm-shim, 258 dEQP-VK cases per profile 8,047 submits compared on kernel command buffers and a hash of every mapped BO: 0 differ
drm-shim, offscreen GLES 3.1 program identical submitted bytes on all 17 profiles
drm-shim, the 21 registered tests that submit identical, 177 submits
G17P hardware, dEQP-VK compute / SSBO / GLSL, 37,339 cases 0 differ from the stored baseline, 0 GPU recoveries
G17P hardware, dEQP-VK pipeline, shader object, transform feedback, tessellation, clipping, geometry, 24,262 cases (every 20th passing case of the stored baseline) 0 differ, 0 GPU recoveries
G17P hardware, offscreen GL, 7 frames pixel-identical to the base build and to the installed driver

The shim has no shader-binary dump, so shaders are compared through the BO contents at submit; a shader that never reaches a submit is covered only by the case status being equal. The hardware Vulkan runs are samples of two stored lists, not a full CTS pass.

Hardware benchmark (base against proposed)

Result: no measurable change. The median time per draw of hk-cpu-upload-bench moves by +0.08%, -0.39% and -0.08% in its three workloads, against a run-to-run standard deviation of 1 to 5%.

Hardware: Apple MacBook Pro 16-inch, M4 Pro (J616s, T6040), which the driver runs as G17P. One machine; no other chip ran the benchmark.

Software: Arch Linux ARM, kernel 7.3.0-m4.177 (aarch64), GCC 16.1.1 20260430, meson 1.12.1, ninja 1.13.2. Both trees built with the same options: -Dbuildtype=release -Dgallium-drivers=asahi -Dvulkan-drivers=asahi -Dplatforms=x11,wayland -Dbuild-tests=true -Dtools=drm-shim -Dllvm=enabled -Dmesa-clc=enabled -Dprecomp-compiler=enabled.

Mesa commits: base 7ba2957236186a832843b7fd9badf00462c10a9b (aurora-wip), proposed b0476f89f48f4c4b3e2f028e48a665fc6c525b05 (head of this PR).

Benchmark: src/asahi/vulkan/tests/hk_cpu_upload_bench.c (documented in src/asahi/vulkan/tests/README.cpu-uploads.md), git blob 2a4b30c07de94fe4b10dafef48f45d8f0db3433c, the same file in both trees. It is host-only: it runs the driver's descriptor-bind and upload code for a G17P device against preallocated command-buffer storage, creates no device and submits nothing. So it measures CPU time on the M4 Pro and not GPU work. Three workloads of 16 draws per simulated command buffer: descriptor offsets and draw parameters identical, changed every four draws, changed every draw.

Command and settings: per run, pinned to one performance core (cpu13, 4.512 GHz maximum, schedutil governor):

ASAHI_MESA_DEBUG=perf taskset -c 13 hk-cpu-upload-bench 200000

200,000 command buffers, 3.2 million draws per workload per run. 30 runs of each build, alternating base and head, with the first build of each pair alternating too (bench.sh below).

Measurements: nanoseconds per simulated draw, lower is better.

workload base median head median change base mean ± sd head mean ± sd change base range head range
identical 42.16 42.19 +0.08% 42.50 ± 2.21 42.59 ± 1.94 +0.20% 40.47–52.63 40.50–49.41
change_every_4 45.81 45.64 -0.39% 45.75 ± 0.72 45.81 ± 0.79 +0.14% 44.61–47.23 44.54–47.21
change_every_draw 65.03 64.98 -0.08% 64.87 ± 0.67 65.03 ± 0.79 +0.24% 63.34–66.03 63.55–66.88

Variability: the standard deviation over the 30 runs is 0.7 to 2.2 ns (1 to 5%). The machine was not idle: the load average was 16 at the start and 11 at the end, from other builds. The outliers of the identical workload (52.63 ns on base, 49.41 ns on head) come from that. The medians of the two builds differ by at most 0.39%, well inside the spread, in both directions. No regression.

The benchmark runs code this series changes, on both builds:

  • hk_cmd_buffer_upload_root(), hk_cmd_upload_constants(), hk_cmd_upload_draw_params() and hk_cmd_upload_draw_id() each test agx_chip_native_agx3(), which the series now expands from the chip table. Both builds compile it to the same test of the chip against a bit mask of the five native chips (mov #0x24e0; lsr; tbz on base, the inverted mask on head).
  • hk_cmd_buffer_upload_root() tests agx_chip_g17_m5() on every root upload. On base that is a range comparison (sub w0, w0, #0xf; cmp w0, #0x2). On head it is a bounded load from the chip table (cmp/csel against 19, row address, ldr w1, [x0, #12]), the kind of read the review asked about.
  • That path ran the same number of times on both builds. Each run reports 200,000, 800,000 and 3,200,000 root uploads for the three workloads, and the benchmark checks these counts itself. All upload counters are identical in all 60 runs.

Limits: this is the upload and bind path only. The benchmark does not build full draw state, compile shaders or submit, so the many converted predicates in hk_cmd_draw.c and hk_shader.c are not timed by it.

Raw results, all 60 runs

Every run also prints the upload counters; they are identical in all 60 runs.

date: 2026-11-21T04:16:42Z
machine: Apple MacBook Pro (16-inch, M4 Pro) (apple,j616s apple,t6040 apple,arm-platform )
kernel: Linux 7.3.0-m4.177 aarch64
cpu: pinned to cpu13, max 4512000 kHz, governor schedutil
compiler: cc (GCC) 16.1.1 20260430
base: 7ba2957236186a832843b7fd9badf00462c10a9b  sha256 5e1897a4ce4b363b
head: b0476f89f48f4c4b3e2f028e48a665fc6c525b05  sha256 c0590d85213f46a8
benchmark: src/asahi/vulkan/tests/hk_cpu_upload_bench.c, blob 2a4b30c07de94fe4b10dafef48f45d8f0db3433c in both trees
command: ASAHI_MESA_DEBUG=perf taskset -c 13 bench/bin/<build>/hk-cpu-upload-bench 200000
runs: 30 per build, alternating, the first build of each pair alternating too
load at start: 16.00 11.19 10.31 3/1604 1530855
load at end: 11.06 10.46 10.09 2/1607 1531872
date end: 2026-11-21T04:17:12Z

run       identical  change_every_4  change_every_draw   (ns per draw)
base-01       41.98           46.26              65.31
head-01       40.55           44.55              63.55
base-02       40.76           44.72              65.63
head-02       41.90           45.68              64.38
base-03       40.84           44.74              63.34
head-03       41.29           45.12              65.17
base-04       41.49           45.47              65.19
head-04       41.56           44.54              64.27
base-05       40.47           44.65              63.55
head-05       41.85           45.54              64.85
base-06       41.19           45.47              64.64
head-06       40.50           44.77              64.19
base-07       42.57           47.23              66.03
head-07       42.14           46.97              66.88
base-08       41.01           45.42              64.54
head-08       43.00           46.05              64.67
base-09       41.40           45.59              63.65
head-09       40.81           45.21              64.04
base-10       40.85           44.86              64.58
head-10       42.22           46.46              65.22
base-11       41.66           45.36              64.04
head-11       41.38           45.36              64.59
base-12       40.80           44.84              63.80
head-12       41.34           44.79              64.59
base-13       43.05           46.57              65.39
head-13       41.15           45.36              64.45
base-14       41.73           45.76              65.38
head-14       41.14           45.44              65.47
base-15       41.98           46.31              65.06
head-15       49.41           45.38              64.79
base-16       41.83           44.61              64.64
head-16       42.44           45.64              64.80
base-17       42.51           46.29              65.16
head-17       42.77           45.52              65.13
base-18       43.06           46.20              65.05
head-18       42.16           47.19              65.88
base-19       43.18           47.06              64.91
head-19       41.88           45.63              64.78
base-20       45.87           45.10              64.82
head-20       42.38           46.36              65.31
base-21       42.04           46.15              65.52
head-21       42.29           45.67              65.71
base-22       42.40           45.34              65.24
head-22       43.58           47.03              66.36
base-23       42.27           45.87              64.59
head-23       42.09           45.62              64.27
base-24       42.74           45.94              64.52
head-24       42.45           46.73              65.70
base-25       42.61           46.19              65.60
head-25       42.83           46.25              65.48
base-26       52.63           46.43              65.17
head-26       42.70           46.36              65.12
base-27       43.21           46.37              65.02
head-27       47.28           46.08              63.92
base-28       42.78           46.16              65.82
head-28       46.32           47.21              66.80
base-29       43.69           46.34              65.05
head-29       42.39           44.97              65.29
base-30       42.35           45.17              64.83
head-30       43.75           46.97              65.13
bench.sh and bench_summary.py
#!/bin/sh
# bench.sh: hk-cpu-upload-bench, base build against head build, alternating
# runs on one performance core. Host-only: the benchmark creates no device and
# submits nothing. Raw output of every run goes to bench/raw/.
#   RUNS (default 30)       runs per build
#   BATCHES (default 200000) simulated command buffers per run, 16 draws each
#   CPU (default 13)        the core the runs are pinned to (a P core)
cd $ROOT || exit 1
B=$PWD/bench
RUNS=${RUNS:-30}; BATCHES=${BATCHES:-200000}; CPU=${CPU:-13}
[ -x $B/bin/base/hk-cpu-upload-bench ] && [ -x $B/bin/head/hk-cpu-upload-bench ] || { echo "no benchmark binaries in $B/bin"; exit 1; }
[ -e $B/raw ] && { echo "$B/raw exists: move it away first"; exit 1; }
mkdir -p $B/raw
{
   echo "date: $(date -u +%FT%TZ)"
   echo "machine: $(tr -d '\0' < /proc/device-tree/model) ($(tr '\0' ' ' < /proc/device-tree/compatible))"
   echo "kernel: $(uname -srm)"
   echo "cpu: pinned to cpu$CPU, max $(cat /sys/devices/system/cpu/cpu$CPU/cpufreq/cpuinfo_max_freq) kHz, governor $(cat /sys/devices/system/cpu/cpu$CPU/cpufreq/scaling_governor)"
   echo "compiler: $(cc --version | head -1)"
   echo "base: $(cat $B/bin/base/COMMIT)  sha256 $(sha256sum < $B/bin/base/hk-cpu-upload-bench | cut -c1-16)"
   echo "head: $(cat $B/bin/head/COMMIT)  sha256 $(sha256sum < $B/bin/head/hk-cpu-upload-bench | cut -c1-16)"
   echo "benchmark: src/asahi/vulkan/tests/hk_cpu_upload_bench.c, blob $(git -C mesa rev-parse HEAD:src/asahi/vulkan/tests/hk_cpu_upload_bench.c) in both trees"
   echo "command: ASAHI_MESA_DEBUG=perf taskset -c $CPU bench/bin/<build>/hk-cpu-upload-bench $BATCHES"
   echo "runs: $RUNS per build, alternating, the first build of each pair alternating too"
   echo "load at start: $(cat /proc/loadavg)"
} | tee $B/raw/ENV.txt
one() { # build index
   ASAHI_MESA_DEBUG=perf taskset -c $CPU $B/bin/$1/hk-cpu-upload-bench $BATCHES > $B/raw/$1-$2.txt 2>&1 || { echo "$1 run $2 failed"; exit 1; }
}
# One discarded run of each to fault the binaries in.
ASAHI_MESA_DEBUG=perf taskset -c $CPU $B/bin/base/hk-cpu-upload-bench 1000 > /dev/null 2>&1
ASAHI_MESA_DEBUG=perf taskset -c $CPU $B/bin/head/hk-cpu-upload-bench 1000 > /dev/null 2>&1
i=1
while [ $i -le $RUNS ]; do
   n=$(printf %02d $i)
   if [ $((i % 2)) = 1 ]; then one base $n; one head $n; else one head $n; one base $n; fi
   i=$((i + 1))
done
echo "load at end: $(cat /proc/loadavg)" | tee -a $B/raw/ENV.txt
echo "date end: $(date -u +%FT%TZ)" | tee -a $B/raw/ENV.txt
python3 tools/bench_summary.py
#!/usr/bin/env python3
"""Summarise bench/raw/{base,head}-NN.txt into bench/SUMMARY.md: per workload
the median, mean, standard deviation and range of ns_per_draw for each build,
and the change of the median and of the mean."""
import glob, re, statistics as st, os
B = '$ROOT/bench'
W = ['identical', 'change_every_4', 'change_every_draw']
def load(build):
    runs = {w: [] for w in W}
    counters = set()
    files = sorted(glob.glob(f'{B}/raw/{build}-*.txt'))
    for f in files:
        text = open(f).read()
        for w in W:
            m = re.search(rf'^{w} batches=(\d+) draws=(\d+) ns_per_draw=([\d.]+)$', text, re.M)
            runs[w].append(float(m.group(3)))
        # everything except the timings must be the same in every run
        counters.add(re.sub(r'ns_per_draw=[\d.]+', '', text))
    return runs, len(files), counters
base, nb, cb = load('base')
head, nh, ch = load('head')
env = open(f'{B}/raw/ENV.txt').read().strip()
def row(w, a, b):
    ma, mb = st.median(a), st.median(b)
    return (f'| {w} | {ma:.2f} | {mb:.2f} | {100 * (mb - ma) / ma:+.2f}% | '
            f'{st.mean(a):.2f} ± {st.stdev(a):.2f} | {st.mean(b):.2f} ± {st.stdev(b):.2f} | '
            f'{100 * (st.mean(b) - st.mean(a)) / st.mean(a):+.2f}% | '
            f'{min(a):.2f}–{max(a):.2f} | {min(b):.2f}–{max(b):.2f} |')
out = ['## Benchmark: hk-cpu-upload-bench, base against head', '',
       '```', env, '```', '',
       f'{nb} runs of the base build and {nh} of the head build. Unit: nanoseconds per simulated draw (lower is better).', '',
       '| workload | base median | head median | change | base mean ± sd | head mean ± sd | change | base range | head range |',
       '|---|---|---|---|---|---|---|---|---|']
out += [row(w, base[w], head[w]) for w in W]
same = cb == ch and len(cb) == 1
out += ['', ('The upload counters the benchmark prints (uploads, reuses, bytes) are identical in every run of both builds.'
             if same else 'THE UPLOAD COUNTERS DIFFER BETWEEN RUNS OR BUILDS.'), '']
open(f'{B}/SUMMARY.table.md', 'w').write('\n'.join(out))
print('\n'.join(out))

Changes since the first review

git range-diff afcc08b71..0d0eab53d 7ba295723..b0476f89f: 10 files, +238 / -53, most of it new truth-table rows.

  • agx_chip_m5_paths() is back as its own table bit. The two compute-dispatch gates in agx3_compute_program_core.c use it again instead of the native-capture record bit.
  • The four raw G17G || G18G checks are converted to whichever of the two they mean: hk_agx3_ioto_program_core.c (the G17G-form Ioto program G18G runs re-encoded) and both sites in agx_batch.c (the one-dispatch-per-submission contract, and a diagnostic of the M5 paths) to agx_chip_m5_paths(); hk_agx3_vdm_decode.c (the vertex program words of the VDM state update) to agx_chip_hal300_records().
  • New truth-table rows: the decoder's identity mapping including 'X' with 0x6041, the shader binary version class, and the Ioto encoding the preshader, state and program codecs select.
  • hk_cs_init_graphics(): the two tests spelled with a local g18g are agx_chip_native_or_g18g() and agx_chip_agx3_path().
  • AGX_CHIP_ROW_TEST takes the chip and the test as arguments. Comments: agx_chip_cdm_wide_visibility() and AGX_RECORD_CDM_BARRIER_WIDE_VISIBILITY differ on G16G, and the header says Borealis.
  • Not taken: .emit_agx3d = (encoding == AGX3D) in agx_gather_device_key(). The function swaps G18G to G17G before it reads the encoding, so the key's encoding is AGX3C there and the test would be false on G18G.
  • Rebased onto 7ba2957 for the CI fix of the asahi-egl-priority-* tests.

Not in this PR

  • A dev->backend selector and per-backend files.
  • Making record packers infallible.
  • How G18G reaches the compiler (emit_agx3d).
  • Renaming hk_g17p_* / hk_m5_* functions that serve other chips.
  • Turning the chip-set predicates into capability fields (an encoding property behind agx_chip_native_or_m5, cs_generation behind agx_chip_hal300_path, per-feature bits behind agx_chip_g17p_or_m5).
  • The chip lists in agx3_pack.c, and the ones compiled into libagx kernels where a rewrite changes the kernel bytes (agx_vdm_index_list_direct_is_hal300_inline, agx_vdm_barrier_core_word and the other switches in libagx_dgc.h). The agx_vdm_barrier allowlist in libagx_dgc.h does read its record bit now; the kernels are byte-identical.

Notes for review

  • The table is static const in agx_chip.h, because the decoder library and about twenty unit tests build without agx_chip.c. A reviewer measured about 16 KB for it in the Vulkan driver at -O1.
  • A libagx kernel must not index the table: asahi_clc then does not terminate (stopped after 11 minutes at 14.8 GB). The header says so, and no OpenCL-callable predicate reads the table.
  • test-chip.c includes asahi/vulkan/hk_agx3_vdm_decode.h (header-only) for the shader-binary-version row.

Assisted-by: LLM (Claude:Fable 5.2)

@DjDeveloperr

Copy link
Copy Markdown

@jgoyvaerts, Dj likes this change and asked us to test it across the board. In progress:

  • Hardware A/B rows, base afcc08b vs head 0d0eab5, same boot:

    • vulkaninfo --json identical apart from driverInfo and UUIDs;
    • dEQP-VK fleet smoke (every 100th case of vk-default) with per-case status identical;
    • deqp-gles31 every 50th, identical;
    • gpubench quick within ±2%;
    • 0 GPU faults.
  • Machines asked:

    • ours: the M5 Pro (J714s, T6050) and the Neo (T8140) after its Edge alpha.2 gate;
    • Ryan's lab: M1 Pro, J413 and J713, and an M3 if any M3's GPU runs;
    • Axxzy: J616C (T6041);
    • Joshua: M1 and M2 Max.

    The M4 mini (T8132) can't run it yet, because its GPU doesn't take a job on 27.2.

  • An independent review: for each converted call site, the old chip set vs the new predicate's set, the table rows against the four duplicate tables they replace, and the truth-table test's coverage.

I'll post one consolidated review here when the rows are in. Nobody has offered G18G (M6) hardware yet. If you know who has one, the 123 agx_chip_native_or_m5 sites are the place to check.

Assisted-by: Claude Opus 5.5

@AxxzyWasTaken

Copy link
Copy Markdown

J616C row (M4 Max, T6041, G17P, 25G83). Base aurora-wip afcc08b and head 0d0eab5, built side by side in private prefixes with the same options as the Max's host Mesa. Both ran on one boot through pinned ICDs (VK_DRIVER_FILES), with the installed driver untouched. Kernel: 7.3.0-j616c-ia33 with linux#2612, plus the #2607 test rule.

  • vulkaninfo --json: identical, 6,468 lines each, with 0 differing lines once driverInfo, driverVersion and the UUIDs are masked.
  • dEQP-VK, every 100th case of mustpass/main/vk-default.txt (16,935 cases, neo-cts-kit-base2-v8 cts-vk4, VK-GL-CTS 1.4.7.1): base and head both give 8,994 Pass, 7,941 NotSupported, 0 Fail/Crash/Timeout. Per-case status is identical: 0 of 16,935 cases differ.
  • deqp-gles31: not run. The kit has no GLES binary.
  • gpubench c36cbbe, depth 1, 3 interleaved passes, gpu_us medians:
row base head
compute.light 3.79 3.33 -0.46 us; a 3 us dispatch is at timer noise
compute.heavy alu 177.17 177.21 +0.02 %
compute.heavy bw 494.17 490.42 -0.76 %
render.light 529.08 528.98 -0.02 %
render.heavy 722.00 721.12 -0.12 %
rt.scene medium 3101.71 3103.25 +0.05 %
rt.rays incoherent 148.50 147.90 -0.40 %
  • GPU faults, recoveries, timeouts and lost devices: 0 in dmesg across the whole run.

So it's no behaviour change on T6041.

Disclosure: prepared with an AI tool; tested as described.

@satchlj

satchlj commented Nov 21, 2026

Copy link
Copy Markdown
Member

Claude Opus 5.5 on @satchlj's behalf.

M5 Max (J775c, "lobata") row for this PR: no behaviour change found. Base afcc08b71 (aurora-wip) against head 0d0eab53, an A/B on the same boot.

Setup.

  • Kernel: lobata's default 7.3.0-lobata-j775c+, unchanged. The system Mesa (mesa-aurora/vulkan-aurora c4916e90072) wasn't touched; I checked it before and after.
  • Builds: each in a private prefix, with the package's meson options. Each tree has its own host tools (mesa_clc, vtn_bindgen2, asahi_clc), since this PR changes the compiler asahi_clc contains.
  • Selected per process: Vulkan by VK_DRIVER_FILES, GL by LD_LIBRARY_PATH plus the glvnd EGL vendor file.
  • Driver identity: Vulkan reports Mesa 26.3.0-devel (git-afcc08b710), Borealis and (git-0d0eab53dd). GLES reports OpenGL ES 3.2 Mesa 26.3.0-devel (git-afcc08b710) and (git-0d0eab53dd). Device: Apple M5 Max (G17C B1).
Check Result
vulkaninfo --json identical: 0 differences, excluding driverInfo, driverVersion, UUIDs and LUIDs
dEQP-VK, every 100th case of vk-default (neo-cts-kit-base2-v8 cts-vk4, deqp-vk md5 2aef6f14dd40): 32,152 cases base and head both Pass 17,668, NotSupported 14,482, DeviceLost 2; per-case status differences: 0
dEQP-GLES31, every 50th case of gles31-main (757 cases) base and head both Pass 738, NotSupported 7, Fail 10, Crash 2; per-case status differences: 0
GPU faults or recoveries (kernel log, whole run) 0

The 2 VK DeviceLost cases (pipeline.shader_object_unlinked_binary.render_to_image.{core,dedicated_allocation}.cube_array.mipmap.r32g32b32a32_sfloat_s8_uint) and the 12 GLES31 Fail/Crash cases are the same on both builds, so they predate this PR on M5 Max.

gpubench. There's no fixed "quick" set in the tree, so I used submit.empty, compute.light, compute.heavy, render.light, render.heavy, copy.bw and mem.buffer at depths 1 and 8.

  • First pass (A B A B, 2 runs per build): everything within ±2% except three host-side metrics:

    • render.heavy d1 us_per_submit: one bimodal head run;
    • compute.light d8 us_per_submit: −14% for head;
    • mem.buffer alloc_us: one low base run.

    GPU time was equal in every case.

  • Rerun of those three, ABBA ×4, 8 runs per build:

Test Metric Base median (range) Head median (range) Δ
render.heavy d1 us_per_submit 297.62 (297.27–297.62) 297.44 (296.91–297.62) −0.06%
render.heavy d1 gpu_us 474.96 478.90 +0.83%
render.heavy d8 gpu_us 64.29 64.29 0.00%
compute.light d1 us_per_submit 140.77 143.07 +1.64%
compute.light d8 us_per_submit 17.36 (15.80–17.49) 17.77 (17.60–17.90) +2.35%
compute.light d8 gpu_us 138.58 138.73 +0.11%
mem.buffer d1 alloc_us 4.08 (3.67–5.04) 4.53 (3.67–5.04) +10.9%
  • Reading:
    • The only metric outside ±2% after the rerun is host us_per_submit on compute.light d8. It went the other way (−14%) in the first pass, and its GPU time is unchanged, so I read it as host noise.
    • mem.buffer alloc_us has the same range on both builds; the median shift is quantization on a ~4 µs host call.
    • This is one machine on one boot.

@RyanTheTide

Copy link
Copy Markdown

M1 Pro (G13S) and M2 (G14G) rows: no behaviour change found. Base afcc08b71 (aurora-wip) against head 0d0eab53, an A/B on the same boot of each Mac.

Setup. Both Macs ran our default kernel and system Mesa, untouched and checked after. Base and head were built with identical options (release with asserts, Vulkan and gallium, each tree's own mesa_clc/vtn_bindgen2/asahi_clc). They ran as private per-process overlays (VK_DRIVER_FILES, LD_LIBRARY_PATH). I confirmed each arm's libraries were the ones loaded.

M2 (G14G B0) M1 Pro (G13S C0)
vulkaninfo --json identical apart from pipelineCacheUUID, shaderBinaryUUID, driverUUID same
dEQP-VK 1.4.7.1, every 100th case of vk-default (31,778) 9,930 Pass / 21,848 NotSupported / 0 Fail on both, 0 cases differ same counts, 0 differ
dEQP-GLES31, every 50th case of the main list (757, surfaceless) 750 Pass / 7 NotSupported on both, 0 differ same, 0 differ
gpubench-vk, 13 rows, 3 alternating reps + 6-rep recheck flat within ±2 % apart from two rows that scatter as widely in base every depth ≥ 4 row within ±2 %; depth-1 rows scatter equally in both
GPU faults / recoveries / kernel errors 0 / 0 / 0 0 / 0 / 0

So the AGX2 path (G13/G14) behaves as before, which matches the table rows: path AGX2, no records, no quirks.

I also checked the claim separately from the PR's own test. I compiled agx_chip.c and the record codecs from both trees and dumped 58 predicates, allowlists and payload headers for chip values -1 to 21. Base and head output is byte-identical. I also read every converted call site in the four chip-set commits and the agx_native_graphics() rename. Each old spelling maps exactly to its new name.

On the table and the remaining gates. One row per chip is a clear improvement over the copied lists. Some of the new predicates still name chip sets rather than what the hardware has, and several could be fields in the row. Suggestions, roughly in order of reach (none is needed for this PR, which is right to change nothing):

  1. agx_chip_native_or_m5 (123 sites) is "AGX3 path with an AGX3B/AGX3C encoder". G18G is left out because its AGX3D encoder is partial, which is a property of the encoding, so it could come from encoding or a codegen_complete field. agx_isa_is_agx3 is the same test under a name that suggests something else.
  2. agx_chip_hal300_path (27 sites) equals cs_generation == HAL300 for every row. The path column also carries admission policy, so testing cs_generation would be the cleaner axis. The PPP Gen6/Gen7 choice in the viewport and W-clamp payloads could read a PPP generation column instead of the driver path.
  3. agx_chip_native_or_g18g (12 sites) groups unrelated things. The attachment-hint sites in hk_queue.c (439, 463, 2431) can key on the kernel's max_attachments parameter, which the same functions already clamp to (443, 467). The custom border colour sites in agx_state.c (2973, 5531) want a sampler capability bit.
  4. agx_chip_g17p_or_m5 (46 sites) reads as "validated on these parts". Per-feature bits (lossless compression, RT and so on) would let another AGX3B part pick them up.
  5. AGX_RECORD_HAL300_NATIVE_CAPTURE describes where captures exist rather than a record format, yet it now gates dispatch. Four raw G17G || G18G checks give the same answer and weren't converted: hk_agx3_ioto_program_core.c:557, hk_agx3_vdm_decode.c:161, agx_batch.c:1861 and :2324.
  6. .emit_agx3d = <chip is G18G> in agx_device.c:1961 can test encoding == AGX3D, which is set just above it.

These look like identity that should stay as it is: chip identification and the decoder's 'X' alias, names, deviceID/UUIDs, the shader binary version, and SoC admission.

Smaller notes
  • AGX_CHIP_ROW_TEST uses the enclosing function's chip and record variables implicitly, so it breaks quietly if they are renamed. Passing them as macro arguments would be safer.
  • agx_chip_cdm_wide_visibility() (G15 only) and AGX_RECORD_CDM_BARRIER_WIDE_VISIBILITY (G15 and G16G) share a name but give different answers. This predates the PR, so a one-line comment would do.
  • The PR body says the libagx_dgc.h lists are untouched, but the agx_vdm_barrier list now reads the record bit. The kernels are byte-identical, so only the description needs updating.
  • Each translation unit gets its own copy of the static const table (about 70 KB per library). One shared .c file linked by both would avoid that.
  • A comment near the top of agx_chip.h still uses the Vulkan driver's old name. It is Borealis now.
gpubench-vk, median over reps, M2
row                                                                  base       head      head%
submit.empty  queue d1 [us_per_submit]                               1.29       1.28      -0.6%
submit.empty  queue d8 [us_per_submit]                               1.28       1.27      -0.9%
compute.light  queue d1 [us_per_submit]                            144.01     149.34      +3.7%
compute.light  queue d4 [us_per_submit]                             47.16      47.50      +0.7%
compute.light  queue d16 [us_per_submit]                            32.17      32.69      +1.6%
render.light kind=tri queue d1 [us_per_submit]                     251.26     244.86      -2.5%
render.light kind=tri queue d4 [us_per_submit]                      80.70      79.29      -1.7%
render.light kind=tri queue d16 [us_per_submit]                     61.85      60.74      -1.8%
copy.bw kind=buf2buf queue d1 [us_per_submit]                     2066.12    2173.91      +5.2%
copy.bw kind=buf2buf queue d4 [us_per_submit]                     1851.85    1953.12      +5.5%
copy.bw kind=buf2img queue d1 [us_per_submit]                     1436.78    1436.78      +0.0%
copy.bw kind=buf2img queue d4 [us_per_submit]                     1207.73    1213.59      +0.5%
copy.bw kind=fill queue d1 [us_per_submit]                         996.02    1000.00      +0.4%
copy.bw kind=fill queue d4 [us_per_submit]                         793.65     791.14      -0.3%
sync.signal kind=host,work=compute.light queue d1 [latency_us]     125.90     125.06      -0.7%
compute.heavy kind=alu queue d1 [us_per_submit]                   1106.19    1111.11      +0.4%
compute.heavy kind=alu queue d4 [us_per_submit]                    899.28     899.28      +0.0%
compute.heavy kind=alu queue d16 [us_per_submit]                   899.28     899.28      +0.0%
compute.heavy kind=bw queue d1 [us_per_submit]                    2032.52    2032.52      +0.0%
compute.heavy kind=bw queue d4 [us_per_submit]                    1811.59    1811.59      +0.0%
render.heavy kind=fill,res=1080p queue d1 [us_per_submit]         1008.06    1028.81      +2.1%
render.heavy kind=fill,res=1080p queue d4 [us_per_submit]          651.04     651.04      +0.0%
render.heavy kind=fill,res=2160p queue d4 [us_per_submit]         2450.98    2450.98      +0.0%
query kind=timestamp queue d1 [overhead_us]                          5.14       5.41      +5.2%
query kind=timestamp queue d16 [overhead_us]                         0.05       0.05      +4.0%

Of the rows outside ±2 % here, buf2buf, fill and the light rows are back within ±2 % in a 6-rep recheck. The two that stay out scatter just as much in base: render.heavy 1080p d1 ranges 896-1136 µs in both arms (recheck median -4.8 %, head faster). query timestamp overhead_us is the difference of two submit times, each of which alternates between about 140 and 220 µs, so it ranges from -12 to +110 µs in both arms.

gpubench-vk, median over reps, M1 Pro
row                                                                  base       head      head%
submit.empty  queue d1 [us_per_submit]                               1.55       1.57      +1.3%
submit.empty  queue d8 [us_per_submit]                               1.47       1.48      +0.9%
compute.light  queue d1 [us_per_submit]                            217.39     146.97     -32.4%
compute.light  queue d4 [us_per_submit]                             41.62      41.69      +0.2%
compute.light  queue d16 [us_per_submit]                            24.16      24.29      +0.6%
render.light kind=tri queue d1 [us_per_submit]                     296.91     381.68     +28.5%
render.light kind=tri queue d4 [us_per_submit]                      64.90      65.98      +1.7%
render.light kind=tri queue d16 [us_per_submit]                     50.24      50.00      -0.5%
copy.bw kind=buf2buf queue d1 [us_per_submit]                     1225.49    1250.00      +2.0%
copy.bw kind=buf2buf queue d4 [us_per_submit]                      750.75     750.75      +0.0%
copy.bw kind=buf2img queue d1 [us_per_submit]                     1461.99    1453.49      -0.6%
copy.bw kind=buf2img queue d4 [us_per_submit]                      494.07     490.20      -0.8%
copy.bw kind=fill queue d1 [us_per_submit]                        1068.38    1068.38      +0.0%
copy.bw kind=fill queue d4 [us_per_submit]                         411.86     411.18      -0.2%
sync.signal kind=host,work=compute.light queue d1 [latency_us]     244.88     220.71      -9.9%
compute.heavy kind=alu queue d1 [us_per_submit]                   1373.63    1366.12      -0.5%
compute.heavy kind=alu queue d4 [us_per_submit]                    500.00     504.03      +0.8%
compute.heavy kind=alu queue d16 [us_per_submit]                   501.00     502.01      +0.2%
compute.heavy kind=bw queue d1 [us_per_submit]                    1231.53    1201.92      -2.4%
compute.heavy kind=bw queue d4 [us_per_submit]                     750.75     750.75      +0.0%
render.heavy kind=fill,res=1080p queue d1 [us_per_submit]         1633.99    1633.99      +0.0%
render.heavy kind=fill,res=1080p queue d4 [us_per_submit]          391.85     393.08      +0.3%
render.heavy kind=fill,res=2160p queue d4 [us_per_submit]         1396.65    1396.65      +0.0%
query kind=timestamp queue d1 [overhead_us]                          1.70      13.18    +673.6%
query kind=timestamp queue d16 [overhead_us]                         0.04      -0.01    -115.8%

The depth-1 rows alternate between two GPU clock states in both arms. compute.light d1 takes about 137 or about 220 µs, with the fast state in 6 of 9 reps on each arm. Its median was -32 % in the first run and +29 % in the recheck, so these rows can't resolve ±2 %. Every depth-4 and depth-16 row is within ±2 %.

Method
  • Build: cross-built for aarch64 against a Fedora 45 sysroot with clang. Each tree builds its own host tools, and the meson options are the same for both arms. LLVM is off because the fc45 libLLVM needs a newer glibc than the Fedora 44 M2 has. libvulkan_asahi.so is byte-identical with and without it.
  • dEQP-VK list: every 100th line of the vk-default mustpass gives 32,152 cases. I dropped 374 .wsi./.wayland. cases because they time out with the panel off. Run with 3 parallel processes.
  • dEQP-GLES31 list: every 50th line of the aosp main mustpass. Run surfaceless at 256x256 with rgba8888d24s8ms0.
  • gpubench-vk: 13 rows (submit, compute light/heavy, render light/heavy, copies, host signal, timestamp query). Base and head alternate in each rep.

@funkzy

funkzy commented Nov 21, 2026

Copy link
Copy Markdown

Tested on the M5 Ultra (G17D, Mac Studio), with #362's five G17D commits rebased onto this branch. The rebase was mechanical: every conflict was a chip list this PR folds into the table, so G17D needed only its row (G17C's), case 'D' in agx_chip_from_identity(), and a column in the truth table.

No change for G17D. Same kernel, firmware and boot for both trees; "before" is aurora-wip afcc08b with the same five commits:

before with #588
truth table, G17D column 90 rows the same 90 rows unedited; the nine new rows give G17D = G17C
meson test --suite asahi 209 / 209 209 / 209, same names
precompiled libagx byte-identical
vkcompute, vkchain, vktimestamp, 46-client burst pass pass
render CTS subset (628 cases) 571 Pass, 57 NotSupported same
compute CTS subset (119 cases) 104 Pass, 13 NotSupported same

No GPU fault, recovery or lost device in either tree.

The agx_chip_native_or_g18g() sites on G17D. We also enabled each of the twelve sites for G17D one at a time, with a test-only switch, on the same boot:

  • Fragment attachment spans (asahi_append_fragment_attachments() together with the capture in hk_cs_init_graphics()): a real fix on the M5 Ultra. Two processes drawing disjoint rows of one image that share a tile row go from 1, 1 and 0 of 1000 rounds exact to 1000 of 1000 in three runs, with the client on either die. The render subset is unchanged, and render.light and render.heavy submit times are flat on both dies. We'll send that change ourselves (last paragraph).
  • Compute attachment spans: no change and no refusals in a copy, fill, query and sparse-buffer sample (854 cases), the compute subset or the quick set. Left off: nothing to gain.
  • hk_pack_attachment_limit(): not reached on G17D, which never packs submissions.
  • The combined-sampler site in hk_shader.c: no change in a texture filtering, shadow and anisotropy sample (451 cases), and no measurable gain in render.heavy kind=texture on either die (85.3 against 85.6 us per submit at depth 8). Left off.
  • decode.c: can't be reached on M5 yet. With ASAHI_MESA_DEBUG=trace, agxdecode_drm_cmdbuf() asserts on the M5 command type before it gets there, with and without this PR.
  • The seven Gallium sites: no change in the GLES lists we ran on G17D with Gallium forced on for the test (layered geometry, border clamp, texture units, geometry shading, transform feedback, and a 1038-case GLES3 sample for the three sites G17D never reaches). The M5 Ultra runs GL on zink, though, so these say nothing for the M5 Pro and Max, which need their own rows.

All results validated compatible with the firmware on the hardware.

Two notes for whichever of #588 and #362 lands second. Nothing here needs work from you; a look at note 1 is all we'd ask.

  1. hk_cs_init_graphics() still spells two sets out with a local g18g: the fragment-span capture tests agx_chip_native_agx3() || g18g, which is the capture half of asahi_append_fragment_attachments()'s agx_chip_native_or_g18g(), and the test below it, agx_chip_native_or_m5() || g18g, is agx_chip_agx3_path(). Our follow-up below replaces the first with its own predicate.
  2. The truth table gains a 21st column for G17D (the count assertion, the print format's sixth G17 character and the G17D chip case). We're happy to carry that in asahi: admit the M5 Ultra (G17D) as one row of the chip table, so Vulkan runs on the Mac Studio's GPU instead of failing at device open #362's rebase if agx: one chip table instead of chip lists typed across the driver (no behaviour change) #588 goes in first.

We'll send the fragment-span change ourselves as a follow-up once #588 and #362 are in: borealis: send fragment attachment spans on the M5 Ultra, so two processes drawing one image keep each other's rows. It adds agx_chip_fragment_attachment_spans() (native AGX3, G18G and G17D) and uses it where the spans are recorded and where they are submitted. It is limited to G17D until the other M5 parts have rows of their own; a test on any of them is welcome.

@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.

Interim review: no behaviour change found, on hardware or in code

@jgoyvaerts, thanks. Dj asked us to test this across the board, and so far everything agrees with "no behaviour change". This is an interim review: I'll approve once the remaining rows (M6 G18G, M5 Pro G17S, Neo T8140) are in.

Hardware A/B rows: base afcc08b vs head 0d0eab5, same boot

Chip Mac By vulkaninfo dEQP-VK smoke GLES31 sample gpubench Faults
G13S M1 Pro Ryan identical 31,778 cases, 0 differ 757, 0 differ within ±2 % 0
G14G M2 (J413) Ryan identical 31,778, 0 differ 757, 0 differ within ±2 % 0
G17P, T6041 M4 Max (J616C) Axxzy identical 16,935, 0 differ not run within ±0.8 % 0
G17C M5 Max (J775c) satchlj identical 32,152, 0 differ 757, 0 differ GPU time within ±2 % 0
G17D M5 Ultra funkzy n/a render 628 + compute 119, identical n/a n/a 0
G17P, T6040 M4 Pro (J616s) you identical 61.6k, 0 differ GL pixel-identical n/a 0

The M5 Ultra row ran with #362's five G17D commits rebased on top, and only needed a table row. Ryan also dumped 58 predicates from both trees for chip values −1 to 21 and got byte-identical output. Both are in the comments above.

Still to come: Joshua's M6 (G18G), which matters most for the 123 agx_chip_native_or_m5 sites; our M5 Pro (J714s, G17S); and our Neo (T8140). Joshua's M1 13" and M2 Max follow on Saturday. The M4 Air/mini (T8132) and M3s can't run until their GPUs come up on 27.2.

Independent code check

Separately from your truth table:

  • Changed regions: I extracted every changed region from the diff (539 outside test-chip), compiled the old text against afcc08b and the new text against 0d0eab5, and evaluated both for chip values 0–21 and 255. No differences.
  • Shared functions: the 48 agx_chip.[ch] functions match for every value, out-of-range ones included.
  • Parameter mapping: agx_chip_from_params and agx_params_* agree on 2.4 M parameter sets. The decoder mapping, including 'X'/0x6041, agrees on 774k identities.
  • Codec gates: every record allowlist and Ioto/PPP selector matches when the base and head codec functions are called directly.
  • Truth table: your new table, compiled against the base tree, passes all 392 checks.
  • Build and suite: the asahi suite passes before and after, and the precompiled libagx kernels are byte-identical. The header table costs about 16 KB in the Vulkan driver at -O1, under your ~70 KB estimate. It has internal linkage, nothing takes its address, and no OpenCL-callable path indexes it.

Notes, all small

  1. decode.c: the removed agxdecode_chip_name() returned "unknown" for the AGX2 chips. All five call sites (639, 689, 698, 922, 999) are on AGX3-only paths, so nothing visible changes. Still, it's the one place where the old and new helpers disagree.
  2. agx3_compute_program_core.c:290/361: agx_chip_m5_paths() → agx_chip_hal300_records() covers the same chips (G17G, G18G), but it merges two predicates with different meanings. If another chip ever gets the native-capture record bit, the G17G compute-dispatch gate widens with it. Consider a record bit of its own, or keeping the separate predicate.
  3. Coverage: the decoder mapping (agxdecode_chip_from_params, including 'X'/0x6041), hk_shader_binary_version() and the Ioto preshader/state/program selectors have no truth-table rows. Adding them would pin down the rest of what this PR rewrites.
  4. Repo policy: .github/aurora/AGENTS.md asks agent-authored Mesa PRs for a before/after hardware benchmark. The table reads sit on per-draw predicates, so one G17P CPU-overhead run would cover it; hk-cpu-upload-bench is in the tree.

Also worth folding in, as non-blocking follow-ups:

  • Ryan's list of predicates that name chip sets and could become capability fields, such as agx_chip_native_or_m5 → an encoding property and agx_chip_hal300_path → cs_generation;
  • funkzy's note on the leftover local g18g in hk_cs_init_graphics().

Assisted-by: Claude Opus 5.5

@jgoyvaerts
jgoyvaerts force-pushed the pr/agx-chip-info-table branch from 0d0eab5 to b0476f8 Compare November 21, 2026 04:20
@jgoyvaerts

Copy link
Copy Markdown
Author

Thanks, all, for the rows and the reading. The amended series is head b0476f8, rebased onto 7ba2957 (the CI fix only). Against 0d0eab5 the range-diff is 10 files, +238 / −53, most of it new truth-table rows. The description is updated.

Interim review

  1. decode.c names: confirmed, all five call sites are on AGX3-only paths. The commit message of b81db63 now states the difference and why an AGX2 chip cannot reach it.
  2. Compute-dispatch gate: agx_chip_m5_paths() is back as its own table bit, and the two gates in agx3_compute_program_core.c use it again. It and agx_chip_hal300_records() each have their own truth-table row.
  3. Coverage: rows added for the decoder mapping including 'X' with 0x6041, the shader binary version class, and the Ioto encoding the preshader, state and program codecs select. 823 checks at the head. agxdecode_chip_from_params() is no longer static so the test can call it.
  4. Benchmark: hk-cpu-upload-bench, 30 alternating runs per build on the M4 Pro. The medians move by +0.08%, −0.39% and −0.08% against a 1 to 5% run-to-run spread. Method, all 60 raw results and the scripts are in the description. It times the upload and bind path only.

Ryan's notes

  • AGX_CHIP_ROW_TEST takes the chip and the test as arguments; there is a comment at both wide-visibility names; the header says Borealis; the description is corrected about libagx_dgc.h.
  • The four raw G17G || G18G checks are converted by what each means: hk_agx3_ioto_program_core.c and both sites in agx_batch.c to agx_chip_m5_paths(), hk_agx3_vdm_decode.c to agx_chip_hal300_records().
  • Suggestion 6 is not taken: agx_gather_device_key() swaps G18G to G17G before it reads the encoding, so .encoding is AGX3C there and encoding == AGX3D would be false on G18G.
  • Suggestions 1 to 4 (capability fields) and one shared .c for the table: agreed, that is the next step. I kept them out so this PR stays a no-behaviour-change one; they are listed under "Not in this PR".

M5 Ultra notes: both tests in hk_cs_init_graphics() now use agx_chip_native_or_g18g() and agx_chip_agx3_path(), and the local g18g is gone. Carrying the G17D column in #362's rebase works for me if this goes in first.

Hardware: the rows posted so far are for 0d0eab5. The amended head has run on the M4 Pro only, with the same checks as before and 0 differences. Whether the earlier rows carry over to the range-diff above is your call.

CI: the new head passes on my fork, 213 of 213: https://github.com/jgoyvaerts/mesa/actions/runs/44865621725

@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.

Re-review of b0476f8: no behaviour change holds on every chip

@jgoyvaerts, thanks for the amended series. I re-ran the harness against b0476f8.

  • Range-diff onto 7ba2957: the code changes are the ones your comment lists:

    • agx_chip_m5_paths() is its own bit, used by both agx3_compute_program_core.c gates;
    • the four raw G17G || G18G checks are converted, and hk_cs_init_graphics() is updated;
    • agxdecode_chip_from_params() is exported through decode.h;
    • the 823-check truth table is added.

    The AGX_CHIPS(X, ...) forwarding and two comment-only changes also come in. The commit-message edits in 9 of the 13 commits are all descriptive.

  • Per-chip evaluation, over the whole enum G13G..G18G plus UNKNOWN and out-of-range values:

    • every hand conversion gives the same value as the raw check it replaces;
    • across the whole PR, 545 regions outside test-chip.c show no difference;
    • agx_chip_from_params and friends agree on 2,433,024 parameter sets;
    • the decoder mapping agrees on 774,145 identities;
    • all 36 codec allowlist and Ioto/PPP gates match.
  • Machine code (12 TUs, clang and gcc -O3): the untouched TUs are identical. The differences are confined to the touched functions, and .c reverts alone restore 0d0eab5's code exactly, so the header rework emits nothing new. agx3_cdm_barrier_pack matches on all 22,528 inputs, and the seven compute-dispatch entry points match over 2.8M calls. libagx's precompiled kernels are byte-identical.

  • Truth table: your new test-chip.c, built against afcc08b with the old chains standing in, passes all 823 checks. Each of five bit mutations fails its own row: M5_PATHS moved, native-capture moved, G18G gaining VDM_STREAM_LINK, G16G losing inexact FMA, and G17C Ioto GPU1→0.

  • Suggestion 6: your reason holds. agx_gather_device_key() maps G18G to G17G before reading .encoding (agx_device.c:1950-1961). Testing agx_chip_isa_encoding(dev->chip) == AGX_ISA_ENCODING_AGX3D would be the behaviour-neutral form for a follow-up.

  • CI: your fork run 44865621725 on b0476f8, 213/213.

Hardware: the 0d0eab5 rows carry over, because the converted sites give the same answers on every chip. That covers Ryan's G13S and G14G, Axxzy's G17P T6041, satchlj's G17C and your G17P T6040. funkzy's G17D row ran with #362 on top.

Before merge, commit metadata only. Aurora's pre-PR checklist (https://github.com/aurora-silicon/agent-guidelines/blob/main/pre-pr-checklist.md) has been in force since today, and two of its hard rules apply:

  1. Attribution (item 4): commits carry human identity only. Drop the Assisted-by: LLM trailer from all 13 commits and keep your Signed-off-by. The PR body's last line should be Assisted-by: LLM (<Vendor>:<Model>), in place of the "Generated with" line.
  2. Naming (item 6): 30b4406 and 38fa7ab use hk: and say Honeykrisp in their messages. Use borealis: and Borealis. Code identifiers are unaffected.

With only messages changing, the tree should stay identical to b0476f8. I'll re-check that and approve.

For #362's rebase: every AGX_CHIPS row now has to end in __VA_ARGS__, so its G17D row needs it.

Assisted-by: LLM (Claude:Opus 5.5)

@jgoyvaerts
jgoyvaerts force-pushed the pr/agx-chip-info-table branch from b0476f8 to 5a78b7f Compare November 21, 2026 06:14
@jgoyvaerts

Copy link
Copy Markdown
Author

Commit messages only, for the pre-PR checklist: the commits no longer carry Assisted-by (item 4), and the disclosure is now the PR body's last line. Subjects that started with hk now start with borealis (item 6). The tree is identical to b0476f89f4 (git diff b0476f89f4 5a78b7fbd6 is empty). New head 5a78b7fbd6.

Assisted-by: LLM (Claude:Opus 5.5)

@DjDeveloperr

Copy link
Copy Markdown

Thanks. I checked 5a78b7f: the tree is byte-identical to b0476f8 (31451cda), no commit carries Assisted-by or Co-Authored-By, the hk: subjects are gone, and the body ends with the disclosure line.

Two prose mentions of the old name are left, and item 6 of the checklist is a hard rule:

  • ff0d3a0: "162 comparison chains in Honeykrisp become the predicate with the same answer"
  • 2164981: "This is the Honeykrisp half: 123 calls, rewritten by script"

Please make both "Borealis". With the tree unchanged again, I'll approve straight away. The code review and the carried-over hardware rows stand.

Assisted-by: LLM (Claude:Opus 5.5)

@DjDeveloperr

Copy link
Copy Markdown

T8140 (MacBook Neo J700, A18 Pro, G17P B1) row: no behaviour change.

Setup:

  • Tested b0476f89. Its tree 31451cda is identical to the current head 5a78b7fb.
  • Base: aurora-wip 7ba29572.
  • Both arms on one boot, kernel 7.3.0-41.fc44.aurora.aarch64, private prefixes. Fedora 44 aarch64 build with the distribution package's Meson options.
check base #588
vulkaninfo (UUIDs and the live budget masked) identical
dEQP-VK 1.4.7.1, vk-default every 100th, minus WSI/swapchain/display (31,749) 15,545 Pass / 16,204 NotSupported 0 case differences
dEQP-GLES31, every 50th of gles31-main (757) 750 Pass / 7 NotSupported 0 case differences
AGX3 shader binaries over 2,829 shader-heavy cases 13,449 binaries, 2,734 unique identical multiset
pipeline compile time (2,931 pipeline.* cases, cache off), median of 6 5.33 s 5.34 s (+0.3 %)
gpubench, 32 rows, 2 rounds 0 rows beyond noise
kernel GPU errors 0 0

Assisted-by: LLM (Claude:Opus 5.5)

@DjDeveloperr

DjDeveloperr commented Nov 21, 2026 •

Copy link
Copy Markdown

J773g (M4 Mac mini, macOS 27.2 firmware 26B123, Linux 7.3.0-ARCH-m4drv8 010c3eb7) row for mesa#588

  • Vulkan CTS (vk-588-vk100), kernel 010c3eb7 + the m4b aurora.ko kit (m4b-b9a02e44, 5b91354d), one boot for both arms: 31,749 cases, identical in base and head (Pass 11,753 / NotSupported 19,996); status differs 0, new Fail/Crash/Timeout in head 0, fixed 0.
  • gpubench core-a/core-b/core-c (base, head, base, head on one boot), kernel 010c3eb7 + the default aurora.ko kit (tsq-74ce8416, 3297fab4), thermal gate before each run: 59 rows, equal 58, worse 1; geomean head/base (better-adjusted, > 1 = head better) 0.9982. Verdict rule: |change| > max(2 %, 2 x run-to-run noise) and both head runs on the same side of both base runs.
    • The one worse row: render.heavy kind=fill res=720p, queue, depth 1, us_per_submit 556.8 -> 572.7 us (-2.9 %, noise 0.7 %).
  • GLES (gles31-588-gl50): no data. All 757 cases are NotInBinary in both arms (a case-list / glcts binary mismatch); to be redone.

Assisted-by: LLM (Claude:Opus 5.5)

@jgoyvaerts

Copy link
Copy Markdown
Author

Both prose mentions now say "Borealis" (87fd4df and e37050a, previously ff0d3a0 and 2164981). Commit messages only: the head 2a799a5 has tree 31451cda, the same as 5a78b7f and b0476f8.

The PR also conflicts with aurora-wip fa9a6766c in src/asahi/vulkan/hk_shader.c since today's merges. I left the rebase out of this push so the tree stays the one you reviewed and tested; I can rebase whenever you want it in the train.

@RyanTheTide

Copy link
Copy Markdown

No blockers.

The no-behaviour-change claim is well covered: the 823-check truth table passes against the old code, there are independent per-chip evaluations, and same-boot rows on G13S, G14G, G17P (T6040, T6041, T8140), G17C, G17D and T8132 are on tree 31451cda, which the head 2a799a5 still carries. The naming and attribution fixes are in. I have nothing to add on the converted sites. One thing to handle in the rebase the PR now needs:

  1. The branch conflicts with aurora-wip in src/asahi/vulkan/hk_shader.c, and the 35 commits merged since its base add new raw chip sets of exactly the kind this PR removes. On aurora-wip: src/asahi/vulkan/hk_device.h:566 (chip == AGX_CHIP_G17P || agx_chip_g17_m5(chip)), hk_device.h:577 (chip == AGX_CHIP_G17A), hk_shader.c:3252 (the same G17P-or-M5 set again), and the per-chip g18g/encoding selection in the new compiler test. When rebasing, either express these through the table (G17P-or-M5 looks like an existing predicate or one new bit), or list them as intentionally untouched next to the other single-chip identities, and add a truth-table row for any new predicate. Otherwise the drift this series fixes is back on the day it lands. Re-run the suite and the truth table on the rebased head. The hardware rows carry over as long as the table rows are unchanged.

It can leave draft once rebased. The G18G and G17S rows are still missing. G18G matters most for the agx_chip_native_or_m5 sites, but the same-answer proof already covers them, so they need not block.

HW row: after rebase, G18G (M6) and G17S (J714s) same-boot A/B: vulkaninfo identical, dEQP-VK every-100th 0 case differences, 0 GPU faults/recoveries.

Assisted-by: LLM (Claude:Opus 5.5)

@jgoyvaerts

Copy link
Copy Markdown
Author

Rebased onto aurora-wip b8762aa. New head is 06b56e0, tree a3261d51; the PR is out of draft.

@DjDeveloperr, your rows were on tree 31451cda. The code changes since that tree are the rebase and the four items below. The truth table has the same rows and the same per-commit counts (761 .. 823), so whether to rerun is your call.

Results on M4 Pro (G17P), m4.177:

  • All 13 commits build (Vulkan + gallium). Each passes asahi 216/216 with the truth table green, and the libagx kernels are byte-identical to b8762aa. The head passes asahi+vulkan 219/219.
  • Shim, 17 profiles: vulkaninfo identical; the 258-case corpus differs in 0 of 8,047 submits; the GLES program is identical.
  • Registered tests: 17 identical and 4 identical on their stable lines. hk-g17p-cross-queue times out under the shim on base too and isn't comparable. Base and head were built in the same tree, because since b8762aa the gallium tests' shader bytes differ between two build trees of the same commit.
  • GPU (gpu-run, 0 recoveries): dq-fast 37,339 cases, 18,884 Pass / 18,455 NS, 0 differ from the aurora-wip fa9a676 baseline. Offscreen GL is pixel-identical to base.

Not rerun after the rebase: the 24,262-case graphics sample and the CPU benchmark. G18G and G17S rows are still open.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide RyanTheTide 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.

No blockers. Re-checked at 06b56e0 (rebase onto b8762aa).

  1. The rebase point from my last comment is resolved. git range-diff 7ba295723..2a799a516 b8762aab9..06b56e082 shows only what the reply lists. agx3_ssbo_vec in hk_shader.c is agx_chip_g17p_or_m5(), which is the same set as the G17P || agx_chip_g17_m5() that #413 wrote. hk_device.h:566 reads the same predicate. hk_device.h:577 (G17A) is listed as identity. The compiler test takes its encoding from agx_chip_isa_encoding() (AGX3B for G17P, AGX3C for G17G and G18G, as before). The truth-table row for agx_vdm_barrier_core_word(c, false) keeps its expected string. Apart from that, every commit differs from the reviewed tree 31451cda only in its message.
  2. aurora-wip has 11 more commits since b8762aa (up to ce4db96). The PR merges into it without conflicts. Those commits add no chip comparisons in the directories this series converts, and nothing calls agx_native_graphics() or the removed _reference tables. The only new chip list is the shader-binary-version assert in test-hk-execution-allowance.c (43 -> 44 from d56b317). That is identity, and the truth table reads the HK_*_SHADER_BINARY_VERSION constants by name, so the bump does not affect it.
  3. On the table's direction: the header comment above the chip-set predicates (agx_chip.h:835) says they name chips and not reasons, and that a new site should get a predicate named for its reason. Together with the "Not in this PR" list, that keeps the table from becoming the place to add new gates. Small nit for the follow-up: agx_chip_native_or_g18g() and agx_chip_g17p_or_m5() still compare chip == directly instead of reading a row bit. The answer is the same, and they would be the first ones to turn into capability fields.

The hardware rows on 31451cda still apply because the table rows did not change. G18G and G17S remain the open rows and need not block.

HW row: M1 Pro (G13S) and M2 (G14G), after it lands in the train: same-boot base/head vulkaninfo --json identical and dEQP-VK every-100th with 0 case differences, 0 GPU faults. This only confirms the rebase, since the conflict was in AGX3-only code.

Assisted-by: LLM (Claude:Opus 5.5)

@DjDeveloperr

Copy link
Copy Markdown

J714s hardware A/B row (Apple M5 Pro, T6050, G17S B1, AGX3C, kernel 7.3.0-m5-sship7, same boot) on rebased head 06b56e082ea2 (tree a3261d51) vs base b8762aab9bdf (both built with identical release options into private prefixes; system driver untouched):

  • Unit tests (asserts on):
  • vulkaninfo (Borealis): --json profile has 0 diffs (UUID/LUID/driverInfo/date masked); full text has 0 diffs apart from UUID/LUID/driverInfo and live heap budget.
  • dEQP-VK 1.4.7.1 (vk-default every 100th minus WSI/swapchain/display = 31,425 cases): base and head both 17,801 Pass / 13,624 Skip / 0 Fail / 0 Crash / 0 Timeout (0 case diffs).
  • dEQP-VK 1.4.7.1 targeted SSBO / robustness2 storage-buffer sample (2,000 cases exercising agx3_ssbo_vec / storage_result_select): base and head both 1,360 Pass / 640 Skip / 0 Fail / 0 Crash / 0 Timeout (0 case diffs).
  • AGX3C shader-binary identity (AGX_MESA_DEBUG=binaries,internal across 4,805 shader-heavy + SSBO/storage-buffer cases): 14,444 compiled binaries (3,982 distinct SHA-256 hashes), 100% multiset-identical between base and head (0 hashes unique to either build). libagx.cpp and libagx.h are byte-identical.
  • dEQP-GLES31 1.4.7.1 (gles31-main every 50th = 757 cases, surfaceless): base and head both 747 Pass / 7 Skip / 1 Warn / 2 Fail (same 2 pre-existing integer builtin fails) — 0 case diffs.
  • gpubench A/B (B H B H, 10 workloads): geomean −0.31%; 9/10 rows within −0.94% to +1.25% of base; compute.light d1 −2.66% (within base's own +4.71% r1/r2 scatter of 158.3 / 151.2 µs).
  • Kernel & GPU stability: 0 GPU faults, recoveries, timeouts, or kernel trouble lines; GPU live before and after.

@DjDeveloperr

Copy link
Copy Markdown

@jgoyvaerts With the fresh J714s 06b56e082 row + green 221/221 asahi CI (44949493749) in and @RyanTheTide's no-blockers check on 06b56e082, this is ready to merge as soon as it rebases cleanly onto current aurora-wip (ee3abd081e43). Only one file conflicts after #603 merged: src/asahi/lib/tests/test-chip.cpp.

The chip tables are about to move into one row per chip. Before that, record
what the code answers today: tests/test-chip.c gets one row for every chip
predicate and table accessor in agx_chip.h and agx_chip.c and for every
per-record allowlist in lib/*_core.[ch] and genxml/agx3_cmdstream.h, with its
value for all 19 chips and AGX_CHIP_UNKNOWN. A value outside the enum must
answer as UNKNOWN does. The expected strings were printed by this code, at
aurora-wip 7ba2957, and not written by hand.

The rows show where today's lists disagree, which the refactor has to keep:

- agx_isa_is_agx3 is false for AGX3D, agx_encoding_is_agx3 is true.
- The VDM stream link, tessellate and direct Index List records, the CDM
  stream link, link padding and substream barrier, and the Ioto target and
  profile control refuse G18G. The VDM stream terminate, barrier, PPP state
  and vertex pipeline pair and the CDM launches and barrier accept it.
- agx_chip_hal300_records is G17G and G18G; agx_chip_g17_m5 is G17G, G17S
  and G17C.

Three things outside agx_chip.[ch] that the series also rewrites get rows:

- The chip the command-stream decoder takes a kernel identity as. decode.c
  has its own mapping: it has no cluster-count check, and it takes variant
  'X' with chip id 0x6041 on the G17 runtime as G17P, which device open
  refuses. agxdecode_chip_from_params() is declared in decode.h so the test
  can call it, and test_decoder_identity() checks every identity, the M4 Pro
  and M4 Max ones and the 'X' cases against both mappings.
- The shader binary version hk_shader_binary_version() gives a chip, as one
  of its three classes. test-hk-execution-allowance.c already asserts it for
  the 19 chips, but not for AGX_CHIP_UNKNOWN, and a release build compiles
  its asserts out.
- The Ioto encoding the preshader, state and program codecs select. Their
  selectors are static, so the rows read it from what each codec packs or
  accepts.

The test now links libasahi_lib, which holds the record cores. The checks
that only restated single cells of the table are gone from test-chip.c and
test-chip.cpp. The kernel identity mapping, the per-SoC parameter contracts
and the G16G compute launch bytes stay, and so does test-chip-admission.c.

Tested on J616s (M4 Pro, T6040): the asahi suite passes, 216 of 216. This is
CPU-only code; no other machine has run it.

Signed-off-by: Jonathan Goyvaerts <jonathan.goyvaerts@gmail.com>
agx_chip.h said what a chip is in several places: three positional arrays for
the command-stream, descriptor and sampler generations, with a static_assert
on the enumerator order, a *_reference switch for each in agx_chip.c that only
the test read, switches for the instruction set, encoding, submission model
and name, and a chip list in each predicate. The five native chips were typed
three times.

Put it in one row per chip. AGX_CHIPS() is an X-macro that enum agx_chip and
agx_chip_infos[] are both expanded from, so the enum and the table cannot fall
out of step. A row has the name, instruction set, encoding, command-stream,
descriptor and sampler generation, submission model, path (AGX2, native AGX3,
HAL300 or none), the records the chip is witnessed to take and one named bit
per quirk predicate. The table is initialised by position because the C++
units that include the header reject designators.

The OpenCL units get the rows but not the table. The precompiled libagx
kernels take the chip as a run-time argument, and asahi_clc does not finish
compiling a kernel that indexes a table (stopped after 11 minutes and 14.8
GiB). So the predicates those units can call, agx_chip_native_agx3() and
agx_chip_has_record(), expand AGX_CHIPS() into the comparisons of the chips
whose row passes, which is what the hand-written lists compiled to. They do
so in C and C++ as well, so the test covers what the kernels run. AGX_CHIPS()
passes its extra arguments on to the row macro, which is how that expansion
is given the chip and the test.

Every predicate keeps its name, signature and answers and now reads the row,
so no call site changes. agx_chip_isa(), agx_chip_isa_encoding(),
agx_chip_submission_model() and agx_chip_name() become inline row reads.
Predicates that were derived from other predicates stay derived. The record
bits are in the rows already; the record allowlists start reading them in the
next commit, and until then the test checks each bit against its allowlist.

agx_chip_m5_paths() and agx_chip_hal300_records() had the same body, G17G or
G18G, and do not mean the same: one says which paths the driver runs, the
other which record layouts native captures witness. They stay two predicates
and each reads a bit of its own, so a chip that gains one does not get the
other.

Removed as dead: the *_reference switches, the positional arrays and their
static_assert. The three chip ids of the G17P SoCs get names.

Comments only: agx_chip_cdm_wide_visibility() and the record bit
AGX_RECORD_CDM_BARRIER_WIDE_VISIBILITY say that they differ on G16G, as they
did before, and the header's opening comment calls the Vulkan driver
Borealis.

Two lists that look alike and are not stay apart: agx_isa_is_agx3() is AGX3B
and AGX3C, agx_encoding_is_agx3() also AGX3D.

No behaviour change is intended for any chip. The truth table passes with its
rows unedited (a path row is new), and the precompiled libagx kernels are
byte-identical to those built from b8762aa.

Tested on J616s (M4 Pro, T6040): the asahi suite passes, 216 of 216. No
hardware has run this commit and no other machine has built it.

Signed-off-by: Jonathan Goyvaerts <jonathan.goyvaerts@gmail.com>
decode.c had its own copy of agx_chip_from_params(), because the decoder
library does not link agx_chip.c, plus a list of the AGX3 chips and a chip
name table. Move the generation/variant switch into an inline,
agx_chip_from_identity(), that both use. agx_chip_from_params() is that plus
its cluster-count check. The decoder's AGX3 list was every chip whose
instruction set is AGX3, so it asks agx_chip_isa().

The copy had diverged, and the differences are kept:

- It maps gpu_generation 16, variant 'X', chip id 0x6041 on the G17 runtime
  to G17P. agx_chip_from_params() accepted 'X' in 53b30c6 and dropped it
  three days later in b45e4ec ("drop legacy T6041 X and upstream UAPI
  compatibility"), with a test that 'X' is unknown. cea3f4d then added 'X'
  to the decoder, and its message says agx_chip_from_params() maps "variant C
  or X", which was no longer true. So device open is right to refuse 'X', and
  the decoder still accepts it: a trace from a kernel that names the M4 Max
  that way decodes as G17P. Whether it should is a separate change.
- It has no cluster-count check and takes NULL parameters as unknown.

Old and new mapping agree on 184,320 identities (generation 11-20, every
7-bit variant, six chip ids, USC 2/3, three HAL generations, four cluster
counts), and on NULL.

The truth table's decoder row and test_decoder_identity() pass unedited.

One difference between the removed helpers and the shared ones cannot be
reached. agxdecode_chip_name() said "unknown" for G13G, G13X, G14G, G14X and
G15P, and agx_chip_name() names them. All five calls print the chip in a
message of an AGX3 decoder:

- agxdecode_cdm_agx3() (two calls) and agxdecode_vdm_agx3(), which
  agxdecode_cdm() and agxdecode_vdm() enter only when the chip's instruction
  set is AGX3;
- agxdecode_ppp_agx3(), which only agxdecode_vdm_agx3() calls;
- agxdecode_ioto(), the pipeline decoder of those two and of
  agxdecode_drm_cmd_render() for a native AGX3 chip or G18G.

Those five chips execute AGX2, so none of them gets to a call and no output
changes. AGX_CHIP_UNKNOWN is "unknown" under both names.

Tested on J616s (M4 Pro, T6040): the asahi suite passes, 216 of 216. No
hardware has run this commit and no other machine has built it.

Signed-off-by: Jonathan Goyvaerts <jonathan.goyvaerts@gmail.com>
agx_gallium_descriptor_generation() was a fourth copy of the per-chip
descriptor generation, with the same answer as
agx_chip_descriptor_generation() for all 19 chips and AGX_CHIP_UNKNOWN. Its
sixteen callers use the shared accessor.

Tested on J616s (M4 Pro, T6040): the asahi suite passes, 216 of 216, and the
gallium driver builds. No hardware has run this commit and no other machine
has built it.

Signed-off-by: Jonathan Goyvaerts <jonathan.goyvaerts@gmail.com>
Twenty record codecs in lib/*_core.[ch] and genxml/agx3_cmdstream.h each
carried the list of chips they accept: the same twelve chips ten times, and
five times the same list without G18G. Each now reads its own bit of the
chip's row through agx_chip_has_record().

The lists that disagree keep disagreeing, because every record has its own
bit. For G18G the VDM stream link, tessellate and direct Index List records,
the CDM stream link, link padding and substream barrier and the Ioto profile
control stay refused, as the truth table in tests/test-chip.c shows row by
row. Whether G18G should take them is for someone with the hardware.

agx_vdm_index_list_direct_target_supported_inline() is compiled into the
libagx kernels. Under OpenCL C agx_chip_has_record() expands to the
comparisons of the chips that have the bit, and the precompiled kernels are
byte-identical to those built from b8762aa.

Left as they are: agx_ppp_viewport_payload_core_supported() and
agx_ioto_target_supported(), which answer through a layout or encoding
selector and have no list of their own, and
agx_ppp_legacy_payload_supported() and
agx_ppp_hal200_graphics_core_supported(), which already ask a chip predicate.

The test that checked each bit against its allowlist goes; the truth table
rows are unedited.

Tested on J616s (M4 Pro, T6040): the asahi suite passes, 216 of 216. No
hardware has run this commit and no other machine has built it.

Signed-off-by: Jonathan Goyvaerts <jonathan.goyvaerts@gmail.com>
Call sites spell out which chips they mean, and "runs an AGX3 path" is
written with different chips left out: native or M5 (123 times in the tree),
native or M5 or G18G (36), native or G18G (12). The sets are not the same, so
each gets its own predicate and every site keeps the set it had:

  agx_chip_agx3_path()       native AGX3, M5 or G18G
  agx_chip_native_or_m5()    not G18G
  agx_chip_native_or_g18g()  not M5
  agx_chip_hal300_path()     M5 or G18G
  agx_chip_g17p_or_m5()      G17P or M5

They name which chips, not why. Which of the sites that leave G18G or M5 out
mean to is not decided here.

Convert src/asahi/lib, genxml and libagx. A chain is replaced only when it
has the same answer as the predicate for all 19 chips and AGX_CHIP_UNKNOWN:
each chain was compiled against agx_chip.h and evaluated for every chip
before it was rewritten, and a chain that already asks a capability by name
(agx_chip_native_preamble() || agx_chip_g17_m5()) keeps its words.
tests/test-chip.c has a row for each new predicate and checks it against the
chain it replaces.

Also here, each with the same answers as before:
- Three local "is HAL300" helpers go: the Ioto profile one was
  agx_chip_g17_m5(), the VDM decode and state update ones
  agx_chip_hal300_path().
- agx3_cdm_direct_g15x_bit31_allowed() asks for the G15 command-stream
  generation instead of listing G15G/S/C/D.
- agx3_cdm_barrier_flags_grounded() had the same flags for G18G and for the
  default case.
- libagx's agx_vdm_barrier() repeated the VDM barrier allowlist; it asks
  agx_chip_has_record().

Not converted: agx_vdm_index_list_direct_is_hal300_inline() stays a
comparison chain. It is compiled into the libagx kernels, and written as
agx_chip_g17_m5() the kernels come out different. With this commit they are
byte-identical to those built from b8762aa.

Tested on J616s (M4 Pro, T6040): the asahi suite passes, 216 of 216. No
hardware has run this commit and no other machine has built it.

Signed-off-by: Jonathan Goyvaerts <jonathan.goyvaerts@gmail.com>
Five comparison chains in the compiler become the predicate with the same
answer for all 19 chips and AGX_CHIP_UNKNOWN: !agx_chip_native_or_m5() in
agx3_graphics_program.c, and agx_chip_g17p_or_m5() in the register allocator
and the spiller. Each chain was compiled against agx_chip.h and evaluated for
every chip before it was rewritten.

test-agx3-g17p-task-kernel-shared.c takes its encoding from the chip table:
agx_chip_isa_encoding() of the chip it compiles as, G17G for G18G, as
agx_gather_device_key() does. That is AGX3B for G17P and AGX3C for G17G and
G18G, the three chips it runs, as before.

The single-chip comparisons stay: they are chip identity. So do the
per-encoding chip lists of agx3_pack.c, which are not the encoding column of
the chip table (they omit chips).

Tested on J616s (M4 Pro, T6040): the asahi suite passes, 216 of 216. No
hardware has run this commit and no other machine has built it.

Signed-off-by: Jonathan Goyvaerts <jonathan.goyvaerts@gmail.com>
162 comparison chains in Borealis become the predicate with the same answer
for all 19 chips and AGX_CHIP_UNKNOWN. Most are "native or M5", spelled
agx_native_graphics(&dev->dev) || agx_chip_g17_m5(dev->dev.chip), and
"G17P or M5". Each chain was compiled against agx_chip.h and evaluated for
every chip before it was rewritten; one in hk_cmd_meta.c, whose two terms
named the same chip differently, was done by hand.

hk_shader_binary_version() listed the AGX2 chips and G17P plus M5. It asks
agx_chip_isa() and agx_chip_g17p_or_m5(), with the same three answers.

Four more sites are converted by hand, each to a predicate with the same
answers:

- hk_cs_init_graphics() spelled two sets through a local `g18g`. The
  fragment-span capture tested native or G18G, which is
  agx_chip_native_or_g18g(), and the context selector native, M5 or G18G,
  which is agx_chip_agx3_path().
- Two gates were written "G17G or G18G", the chips of both
  agx_chip_m5_paths() and agx_chip_hal300_records().
  hk_agx3_g17g_basic_graphics_program_generate() builds the G17G-form Ioto
  program, which G18G runs re-encoded: that is a path the driver takes, so
  agx_chip_m5_paths(), whose comment now names it.
  hk_agx3_g17g_vertex_program_info() admits the vertex program words of the
  VDM state update and holds G17G to the layouts its captures witness: that
  is agx_chip_hal300_records().

Every site keeps its set. In particular the 102 "native or M5" sites still
leave G18G out, and the five "native or G18G" ones still leave M5 out.
Chains that ask a capability by name (agx_chip_sampler_has_lod_bias(),
agx_chip_native_preamble()) and single-chip comparisons are unchanged.

Tested on J616s (M4 Pro, T6040): the asahi suite passes, 216 of 216. No
hardware has run this commit and no other machine has built it.

Signed-off-by: Jonathan Goyvaerts <jonathan.goyvaerts@gmail.com>
46 comparison chains in the Gallium driver become the predicate with the same
answer for all 19 chips and AGX_CHIP_UNKNOWN: agx_chip_hal300_path() for "M5
or G18G", agx_chip_agx3_path(), agx_chip_native_or_m5() and
agx_chip_native_or_g18g(). Each chain was compiled against agx_chip.h and
evaluated for every chip before it was rewritten.

Two more in agx_batch.c were written "G17G or G18G" and become
agx_chip_m5_paths(), by hand. One splits a compute prepass into a submission
per dispatch, which is the M5 kernel contract that G18G's bring-up path
follows. The other logs a batch that lists a BO another active batch writes,
a diagnostic of the Gallium M5 paths. Neither is about which record layouts
captures witness, so neither is agx_chip_hal300_records(), which has the same
chips.

Every site keeps its set: the seven "native or G18G" sites still leave M5
out. Single-chip comparisons are unchanged.

Tested on J616s (M4 Pro, T6040): the asahi suite passes, 216 of 216, and the
Gallium driver builds. No hardware has run this commit and no other machine
has built it.

Signed-off-by: Jonathan Goyvaerts <jonathan.goyvaerts@gmail.com>
agx_native_graphics(dev) is agx_chip_native_agx3(dev->chip) and nothing else
(agx_device.h), so the tree had two names for one predicate. Keep the one
that needs only a chip, which the compiler, the record codecs and asahi_clc
can also call. This is the Borealis half: 123 calls, rewritten by script
from agx_native_graphics(&x) to agx_chip_native_agx3(x.chip). The lines that
grew past 80 columns are re-wrapped.

Tested on J616s (M4 Pro, T6040): the asahi suite passes, 216 of 216. No
hardware has run this commit and no other machine has built it.

Signed-off-by: Jonathan Goyvaerts <jonathan.goyvaerts@gmail.com>
The Gallium half of the previous commit: 66 calls of
agx_native_graphics(dev) become agx_chip_native_agx3(dev->chip), rewritten by
script. The lines that grew past 80 columns are re-wrapped.

Tested on J616s (M4 Pro, T6040): the asahi suite passes, 216 of 216, and the
Gallium driver builds. No hardware has run this commit and no other machine
has built it.

Signed-off-by: Jonathan Goyvaerts <jonathan.goyvaerts@gmail.com>
Its last callers now call agx_chip_native_agx3(), which it wrapped. A
comment in agx_compile.h that named it names the predicate.

Tested on J616s (M4 Pro, T6040): the asahi suite passes, 216 of 216, and the
Vulkan and Gallium drivers build. No hardware has run this commit and no
other machine has built it.

Signed-off-by: Jonathan Goyvaerts <jonathan.goyvaerts@gmail.com>
After the allowlists, one chip list was still typed seven times in lib: G15G,
G15S, G15C, G15D, G16G, G16S, G16C and G17P select the GPU0 Ioto encoding in
agx_ioto_core.c, agx_ioto_load_core.c, agx_ioto_preshader_core.c,
agx_ioto_state_core.c and agx_ioto_program_core.c, and the PPPEncoderGen6
header in the viewport and W-clamp/cull2 payload codecs. The M5 parts select
GPU1 five times.

The Ioto encoding follows the instruction set generation, as the comment in
the preshader codec says, so it becomes a column of the chip table:
agx_chip_ioto_generation() is GPU0, GPU1 or none, and each codec maps it to
its own enum. G16P, G17A and G18G stay refused.

The two PPP payloads get a record bit each, like the other record codecs,
and pick the Gen7 header on the HAL300 path and Gen6 otherwise. That is the
split they had: G17G, G17S, G17C and G18G are Gen7.

tests/test-chip.c gets a row for the Ioto generation and one for the
generation each PPP payload codec packs. The two payload rows were printed by
the old switches before they were removed. The rows for the encoding the
preshader, state and program codecs select pass unedited.

No behaviour change is intended for any chip. Tested on J616s (M4 Pro,
T6040): the asahi suite passes, 216 of 216, which includes the Ioto load,
preshader and program codec tests, and the precompiled libagx kernels are
byte-identical to those built from b8762aa.

This is the last commit of the chip table series, and the series was checked
as a whole at this commit, against b8762aa:

- Under the no-op DRM shim, for all 17 ASAHI_SHIM_CHIP profiles: vulkaninfo
  is the same apart from the build UUIDs. 258 dEQP-VK cases per profile
  (glsl, compute, tessellation, geometry, draw, ubo, ssbo, texture, SPIR-V
  and others) submit the same kernel command buffers and the same bytes in
  every mapped BO, 8,047 submits in all. One case differs between two runs of
  the same build and was compared on its stable lines. An offscreen GLES 3.1
  program submits the same bytes on every profile (the compile-only G17G one
  submits nothing). The registered tests that submit through the shim, base
  and head built in the same tree, submit the same bytes (17), or the same on
  every line that is stable between runs (4); hk-g17p-cross-queue times out
  under the shim on both and is not comparable.
- On hardware, J616s only (G17P): 37,339 dEQP-VK compute, SSBO and GLSL
  cases give the results stored for aurora-wip fa9a676, with no GPU
  recovery, and the offscreen GLES program renders the same pixels as on
  b8762aa. Before the rebase, 24,262 passing pipeline, shader object,
  transform feedback, tessellation, clipping and geometry cases also gave the
  results stored for aurora-wip 4596393.

This version of the series has run on J616s only: G13, G14, G15, G16G, the
M5 parts and G18G are covered by the shim comparison and the unit tests, and
no other machine has built it.

Signed-off-by: Jonathan Goyvaerts <jonathan.goyvaerts@gmail.com>
@DjDeveloperr
DjDeveloperr force-pushed the pr/agx-chip-info-table branch from 06b56e0 to 2a31495 Compare November 21, 2026 21:47
@DjDeveloperr

Copy link
Copy Markdown

Rebased onto aurora-wip (ee3abd081e43) at 2a31495fae671c154b78d6cd3107b43b043ec381 (preserving authorship and commit messages):

@DjDeveloperr
DjDeveloperr merged commit 2eef32a into aurora-silicon:aurora-wip Nov 21, 2026

@RyanTheTide RyanTheTide 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.

No blockers. Re-checked the rebase onto aurora-wip ee3abd0 (06b56e0 to 2a31495).

  1. git range-diff b8762aab9..06b56e082 ee3abd081..2a31495fa shows only rebase changes. Commits 3-9, 11 and 12 are unchanged. In commit 1, the test-chip.cpp conflict with #603 keeps the new TextureDescriptorSpareWordIsM5Gen10 test. In commit 10, the new supports_gs_main_cdm site that aurora-wip added in hk_shader.c is converted from agx_native_graphics(&dev->dev) to agx_chip_native_agx3(), the same mapping as the rest of that commit. Commit 12 then removes agx_native_graphics() without leaving a caller behind.
  2. A new chip comparison arrived with the base. agx_chip_texture_descriptor_spare_word() (agx_chip.h:944-949) is descriptor_generation == GEN10 && chip != AGX_CHIP_G18G. It is not from this series and has its own test, so it does not block. Please add it to the "Not in this PR" / identity list in the body, or turn it into a table bit in the follow-up along with agx_chip_native_or_g18g() and agx_chip_g17p_or_m5() (my earlier nit, still open).
  3. No suite or truth-table result has been posted for 2a31495 yet. Please post asahi+vulkan and the 823-check truth table on this head before it goes in the train. The hardware rows carry over, since the table rows are unchanged.

HW row: none new. The rebase only touches a test and one call site that is already proven equivalent. The G18G row is still open and need not block.

Assisted-by: LLM (Claude:Opus 5.5)

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.

6 participants