feat(doctor): surface missing AES-NI / AVX2 instead of mining silently slow - #339
Merged
Conversation
…y slow (#338) RandomX without AES-NI falls back to XMRig's soft-AES path, roughly 4x slower, and nothing anywhere said why — the last undelivered acceptance criterion from #1 ("unsupported hardware is surfaced rather than silently failing"). setup/apply now warn at configure time when the CPU flags lack aes (and, advisory, avx2 — that one only slows dataset init), and doctor counts a missing AES-NI as an issue. Judged only when an x86-style flags line exists in /proc/cpuinfo (same CPUINFO override util/proposed-grub.sh already uses); macOS, ARM and stubbed sandboxes read as unknown, and unknown never manufactures an issue — the #333 lockdown stance. Never aborts: a knowingly-old rig is a valid choice. Closes #338 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
5 tasks
VijitSingh97
added a commit
that referenced
this pull request
Aug 2, 2026
…y slow (#339) * feat(doctor): surface missing AES-NI / AVX2 instead of mining silently slow (#338) RandomX without AES-NI falls back to XMRig's soft-AES path, roughly 4x slower, and nothing anywhere said why — the last undelivered acceptance criterion from #1 ("unsupported hardware is surfaced rather than silently failing"). setup/apply now warn at configure time when the CPU flags lack aes (and, advisory, avx2 — that one only slows dataset init), and doctor counts a missing AES-NI as an issue. Judged only when an x86-style flags line exists in /proc/cpuinfo (same CPUINFO override util/proposed-grub.sh already uses); macOS, ARM and stubbed sandboxes read as unknown, and unknown never manufactures an issue — the #333 lockdown stance. Never aborts: a knowingly-old rig is a valid choice. Closes #338 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * refactor: collapse one-arm case blocks to [[ ]] guards (ponytail-review) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #338
Problem
RandomX leans on AES-NI; without it XMRig silently falls back to soft AES, roughly 4x slower. A rig on such hardware "works" at a mysteriously bad rate and nothing anywhere says why — the last undelivered acceptance criterion from #1 ("AVX2 / unsupported hardware is surfaced rather than silently failing"). Missing AVX2 is milder: only dataset init slows.
Fix
One pure helper (
_cpu_missing_isa) reads the kernel's CPU flags — via the sameCPUINFOoverrideutil/proposed-grub.shalready uses for its pdpe1gb probe, so the test harness's no-hardware isolation covers it for free — and two consumers surface the result:setup/apply(generate_xmrig_config): warns at configure time. Never aborts — XMRig still runs, and a knowingly-old rig is a valid choice.doctor: missing AES-NI is a counted issue; missing AVX2 is advisory; a present AES-NI gets an ok line.Judged only when an x86-style
flagsline exists: macOS (no/proc), ARM (Features), and stubbed sandboxes read as unknown, and unknown never manufactures an issue — the #333 lockdown stance.grep -wso neighbor flags (vaes) can't satisfy the match.Tests
Helper exercised directly on six cpuinfo shapes (incl. the
vaes-but-no-aesword-boundary trap and the ARM shape); doctor asserted for counted/advisory/ok/silent; config-gen asserted to warn on both, stay quiet on a capable CPU, and still emit the config either way.bash tests/run.sh: 1629 passed, 0 failed.shellcheck -S warning rigforge.sh+shfmt -d: clean.🤖 Generated with Claude Code