From 3dbc4d62eb2dfa2b9fc18eaa109521035ec8758b Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Sat, 31 Oct 2026 16:39:49 +1100 Subject: [PATCH] Recognise the GPU kernel module under its Aurora name The GPU kernel driver is now aurora.ko, with /sys/module/aurora and log lines prefixed "aurora". The runners only looked at /sys/module/asahi, so records from a new kernel would have had no kernel_module at all, and the performance gate would have refused them. The runners now record whichever of aurora or asahi is loaded, the kernel log filters match both, and the gate accepts either name. Older kernels keep working. Co-Authored-By: Claude Opus 5.5 --- records/SCHEMA.md | 2 +- rt/tools/run-record.sh | 12 +++++++----- stress/README.md | 2 +- stress/src/klog.c | 2 +- tools/compare.py | 2 +- tools/performance-gate.py | 5 +++-- tools/run-linux.sh | 17 +++++++++-------- tools/tests/test_performance_gate.py | 9 +++++++++ 8 files changed, 32 insertions(+), 19 deletions(-) diff --git a/records/SCHEMA.md b/records/SCHEMA.md index fed28b1..0148369 100644 --- a/records/SCHEMA.md +++ b/records/SCHEMA.md @@ -27,7 +27,7 @@ records///-/ | `os_version` | string | `/etc/os-release` PRETTY_NAME, or `sw_vers` product version | | `os_build` | string | macOS build (`sw_vers -buildVersion`), `null` on Linux | | `kernel` | string | `uname -r` (Linux), `uname -v` (macOS) | -| `kernel_module` | object | Linux: `{"name": "asahi", "build_id": "...", "srcversion": "...", "params": {...}}` | +| `kernel_module` | object | Linux: `{"name": "aurora", "build_id": "...", "srcversion": "...", "params": {...}}` (`asahi` on kernels before the rename) | | `driver` | object | from the executor `--info`: `name`, `info` (driver info string), `version`, `api_version`, `mesa_sha` (Linux) | | `gpu` | object | `name`, `cores` when known, `family` | | `firmware` | string | GPU firmware version when visible, else `null` | diff --git a/rt/tools/run-record.sh b/rt/tools/run-record.sh index 7879f83..96cb8dd 100755 --- a/rt/tools/run-record.sh +++ b/rt/tools/run-record.sh @@ -73,11 +73,13 @@ ENVJ=$(env | grep -E '^(VK_DRIVER_FILES|VK_ICD_FILENAMES|MESA_|HK_|AGX_|ASAHI_)' if [ "$OS" = macos ]; then KMOD=null; HEALTH=null; FW=null else - bid=$(modinfo -F srcversion asahi 2>/dev/null); par="" - for f in /sys/module/asahi/parameters/*; do [ -r "$f" ] && par="$par${par:+,}\"$(basename "$f")\":\"$(cat "$f" 2>/dev/null)\""; done - bidf=$(readelf -n "$(modinfo -n asahi 2>/dev/null)" 2>/dev/null | awk '/Build ID/ { print $3; exit }') - KMOD="{\"name\":\"asahi\",\"build_id\":\"$bidf\",\"srcversion\":\"$bid\",\"params\":{$par}}" - KL=$(journalctl -k -b --since "@$T0" 2>/dev/null | grep -i -E 'asahi|agx|gpu|drm|fault|timeout' | tail -40 | esc) + # The GPU kernel module: aurora, or asahi on kernels before the rename. + km=aurora; [ -d /sys/module/aurora ] || km=asahi + bid=$(modinfo -F srcversion $km 2>/dev/null); par="" + for f in /sys/module/$km/parameters/*; do [ -r "$f" ] && par="$par${par:+,}\"$(basename "$f")\":\"$(cat "$f" 2>/dev/null)\""; done + bidf=$(readelf -n "$(modinfo -n $km 2>/dev/null)" 2>/dev/null | awk '/Build ID/ { print $3; exit }') + KMOD="{\"name\":\"$km\",\"build_id\":\"$bidf\",\"srcversion\":\"$bid\",\"params\":{$par}}" + KL=$(journalctl -k -b --since "@$T0" 2>/dev/null | grep -i -E 'aurora|asahi|agx|gpu|drm|fault|timeout' | tail -40 | esc) alive=false; pgrep -x Hyprland > /dev/null && alive=true HEALTH="{\"kernel_log\":\"$KL\",\"desktop_alive\":$alive}" FW=null diff --git a/stress/README.md b/stress/README.md index b33b6b1..1707bda 100644 --- a/stress/README.md +++ b/stress/README.md @@ -117,7 +117,7 @@ the run exits with status 2. The default patterns are generic for Linux DRM driv ``` \b(gpu|drm)\b.*(hang|hung|time ?out|timed out|reset|recover|lost|crash|fault|wedged) \[drm(:[^]]*)?\] \*error\* -\b(amdgpu|radeon|i915|xe|nouveau|msm|freedreno|panfrost|panthor|lima|v3d|vc4|etnaviv|powervr|asahi)\b.*(error|fail|fault|time ?out|timed out|hang|reset|lost|crash) +\b(amdgpu|radeon|i915|xe|nouveau|msm|freedreno|panfrost|panthor|lima|v3d|vc4|etnaviv|powervr|aurora|asahi)\b.*(error|fail|fault|time ?out|timed out|hang|reset|lost|crash) firmware.*(crash|hang|time ?out|timed out) \b(etimedout|device lost)\b \b(oops|kernel bug|bug:|unable to handle kernel|general protection fault|use-after-free|kasan) diff --git a/stress/src/klog.c b/stress/src/klog.c index 93cdee4..44e115d 100644 --- a/stress/src/klog.c +++ b/stress/src/klog.c @@ -17,7 +17,7 @@ static const char *const default_patterns[] = { "\\b(gpu|drm)\\b.*(hang|hung|time ?out|timed out|reset|recover|lost|crash|fault|wedged)", "\\[drm(:[^]]*)?\\] \\*error\\*", - "\\b(amdgpu|radeon|i915|xe|nouveau|msm|freedreno|panfrost|panthor|lima|v3d|vc4|etnaviv|powervr|asahi)\\b.*" + "\\b(amdgpu|radeon|i915|xe|nouveau|msm|freedreno|panfrost|panthor|lima|v3d|vc4|etnaviv|powervr|aurora|asahi)\\b.*" "(error|fail|fault|time ?out|timed out|hang|reset|lost|crash)", "firmware.*(crash|hang|time ?out|timed out)", "\\b(etimedout|device lost)\\b", diff --git a/tools/compare.py b/tools/compare.py index 59ab905..aea33dc 100755 --- a/tools/compare.py +++ b/tools/compare.py @@ -124,7 +124,7 @@ def describe(meta, label): bits = [meta.get("device", "?"), meta.get("os", "?"), meta.get("os_version", "")] if meta.get("os") == "linux": km = meta.get("kernel_module") or {} - bits += [f"kernel {meta.get('kernel')}", f"asahi.ko {str(km.get('build_id') or '?')[:12]}", + bits += [f"kernel {meta.get('kernel')}", f"{km.get('name') or 'asahi'}.ko {str(km.get('build_id') or '?')[:12]}", f"Mesa {meta.get('mesa_sha')}"] else: bits += [f"build {meta.get('os_build')}"] diff --git a/tools/performance-gate.py b/tools/performance-gate.py index 646715d..a5cbea7 100755 --- a/tools/performance-gate.py +++ b/tools/performance-gate.py @@ -244,8 +244,9 @@ def qualification_errors(record): digest = lambda value: isinstance(value, str) and re.fullmatch(r'[0-9a-f]{64}', value) if not isinstance(module_id, str) or not re.fullmatch(r'[0-9a-f]{40}', module_id): errors.append('Linux module build ID is missing or malformed') - if not isinstance(module, dict) or module.get('name') != 'asahi': - errors.append('Linux stack does not identify the asahi module') + # The GPU module is aurora, or asahi on kernels before the rename. + if not isinstance(module, dict) or module.get('name') not in ('aurora', 'asahi'): + errors.append('Linux stack does not identify the GPU kernel module (aurora)') if not commit(meta.get('mesa_sha')) or not digest(meta.get('mesa_sha256')): errors.append('Linux Mesa source/library identity is missing or malformed') assets = meta.get('assets_manifest') diff --git a/tools/run-linux.sh b/tools/run-linux.sh index df66e48..07eaffa 100755 --- a/tools/run-linux.sh +++ b/tools/run-linux.sh @@ -63,12 +63,13 @@ state_json() { printf '},"loadavg":%s}' "$(jstr "$(cat /proc/loadavg)")" } -module_json() { - local m=/sys/module/asahi f bid="" first=1 +module_json() { # the GPU kernel module: aurora, or asahi on kernels before the rename + local m=/sys/module/aurora f bid="" first=1 + [ -d "$m" ] || m=/sys/module/asahi [ -d "$m" ] || { printf null; return; } f=$m/notes/.note.gnu.build-id bid=$( (cat "$f" 2>/dev/null || sudo -n cat "$f" 2>/dev/null) | od -An -tx1 -v | tr -d ' \n' | tail -c 40) - printf '{"name":"asahi","build_id":%s,"srcversion":%s,"params":{' "$(jstr_or_null "$bid")" \ + printf '{"name":"%s","build_id":%s,"srcversion":%s,"params":{' "${m##*/}" "$(jstr_or_null "$bid")" \ "$(jstr_or_null "$(cat $m/srcversion 2>/dev/null)")" for f in $m/parameters/*; do [ -r "$f" ] || continue @@ -80,13 +81,13 @@ module_json() { gpu_log() { # kernel log lines since the run started that point at GPU trouble journalctl -k --since "@$T0" --no-pager -q 2>/dev/null | - grep -iE 'asahi|agx|drm' | grep -iE 'GPU fault|page fault|crashed|runtime stopped|client failed|timed out|timeout|still draining|queued-failure|hang|recover' || true + grep -iE 'aurora|asahi|agx|drm' | grep -iE 'GPU fault|page fault|crashed|runtime stopped|client failed|timed out|timeout|still draining|queued-failure|hang|recover' || true } -gpu_notes() { # other asahi lines worth keeping with the record (do not stop the run) - journalctl -k --since "@$T0" --no-pager -q 2>/dev/null | grep -iE 'asahi|agx' | +gpu_notes() { # other GPU driver lines worth keeping with the record (do not stop the run) + journalctl -k --since "@$T0" --no-pager -q 2>/dev/null | grep -iE 'aurora|asahi|agx' | grep -viE 'GPU fault|page fault|crashed|runtime stopped|client failed|timed out|timeout|still draining|queued-failure|hang|recover' | - sed -E 's/^.*(asahi|agx)/\1/I; s/[0-9]{4,}/N/g' | sort | uniq -c | sort -rn | head -20 || true + sed -E 's/^.*(aurora|asahi|agx)/\1/I; s/[0-9]{4,}/N/g' | sort | uniq -c | sort -rn | head -20 || true } desktop_alive() { @@ -125,7 +126,7 @@ for c in $SEL; do fi done STATE_AFTER=$(state_json) -FW=$(journalctl -k -b --no-pager -q 2>/dev/null | grep -iE 'asahi.*(firmware|fw).*version|firmware version' | tail -1 | sed 's/.*\(irmware\|fw\)[^0-9]*//I' | cut -c1-40) +FW=$(journalctl -k -b --no-pager -q 2>/dev/null | grep -iE '(aurora|asahi).*(firmware|fw).*version|firmware version' | tail -1 | sed 's/.*\(irmware\|fw\)[^0-9]*//I' | cut -c1-40) OSV=$(. /etc/os-release 2>/dev/null; echo "${PRETTY_NAME:-linux}") GPU_NAME=$(printf '%s' "$INFO" | sed -n 's/.*"device_name":"\([^"]*\)".*/\1/p') SUITE_SHA=$(cat "$BIN/SUITE_SHA" 2>/dev/null || git -C "$ROOT" describe --always --dirty=+dirty --abbrev=7 2>/dev/null || echo unknown) diff --git a/tools/tests/test_performance_gate.py b/tools/tests/test_performance_gate.py index 2ea0515..28b6a79 100755 --- a/tools/tests/test_performance_gate.py +++ b/tools/tests/test_performance_gate.py @@ -184,6 +184,15 @@ def test_numeric_comparison_does_not_claim_unknown_or_failed_stack_eligible(self self.assertFalse(ledger['qualification_eligible']) self.assertFalse(ledger['passed']) + def test_both_gpu_module_names_identify_the_stack(self): + for name, eligible in (('aurora', True), ('asahi', True), ('panfrost', False)): + with self.subTest(name=name): + meta = metadata('linux') + meta['kernel_module'].update(name=name) + candidate = gate.load_record(self.record([result(9)], meta=meta), 'linux') + errors = gate.qualification_errors(candidate) + self.assertEqual(not any('GPU kernel module' in e for e in errors), eligible) + def test_retained_evidence_contradictions_block_eligibility(self): for name, data in [('assets-manifest.json', '{}'), ('new-faults.txt', 'GPU fault'), ('commands.jsonl', '{"rc":1}\n')]: