Skip to content

feat(doctor): surface missing AES-NI / AVX2 instead of mining silently slow - #339

Merged
VijitSingh97 merged 2 commits into
developfrom
fix/338-isa-preflight
Aug 2, 2026
Merged

feat(doctor): surface missing AES-NI / AVX2 instead of mining silently slow#339
VijitSingh97 merged 2 commits into
developfrom
fix/338-isa-preflight

Conversation

@VijitSingh97

Copy link
Copy Markdown
Contributor

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 same CPUINFO override util/proposed-grub.sh already 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 flags line exists: macOS (no /proc), ARM (Features), and stubbed sandboxes read as unknown, and unknown never manufactures an issue — the #333 lockdown stance. grep -w so neighbor flags (vaes) can't satisfy the match.

Tests

Helper exercised directly on six cpuinfo shapes (incl. the vaes-but-no-aes word-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

VijitSingh97 and others added 2 commits August 2, 2026 11:12
…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>
@VijitSingh97
VijitSingh97 merged commit c96ff74 into develop Aug 2, 2026
9 checks passed
@VijitSingh97
VijitSingh97 deleted the fix/338-isa-preflight branch August 2, 2026 16:24
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>
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.

Surface missing AES-NI / AVX2 instead of mining silently slow (from #1)

1 participant