Skip to content

feat: auto-detect hardware when HELIX_HARDWARE is not set#10

Merged
amrit110 merged 4 commits into
mainfrom
feat/hardware-detection
Mar 29, 2026
Merged

feat: auto-detect hardware when HELIX_HARDWARE is not set#10
amrit110 merged 4 commits into
mainfrom
feat/hardware-detection

Conversation

@amrit110
Copy link
Copy Markdown
Member

Closes #9

Summary

  • Adds src/helix/hardware.py with detect_hardware() — a clean fallback chain:
    1. nvidia-smi → GPU name(s), deduplicated
    2. sysctl -n machdep.cpu.brand_string on macOS → Apple Silicon chip name
    3. platform.processor()platform.machine()"unknown"
  • HelixRunner.run() calls it at session start and writes the result to HELIX_HARDWARE only if the env var isn't already set — explicit overrides always win
  • 16 unit tests covering every path: GPU detection, Apple Silicon, all fallbacks, timeouts, empty output, and env var precedence

Test plan

  • uv run pytest tests/test_hardware.py — 16 passed
  • uv run pre-commit run --all-files — all checks passed
  • Run helix run locally without HELIX_HARDWARE set — startup panel shows detected hardware instead of "unknown"

- Add detect_hardware() in src/helix/hardware.py
  - Probes nvidia-smi for GPU name(s)
  - Falls back to sysctl on macOS for Apple Silicon
  - Falls back to platform.processor() / platform.machine()
- HelixRunner.run() sets HELIX_HARDWARE from detect_hardware() if unset;
  explicit env var always takes precedence
- 16 unit tests covering all paths and edge cases
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.07%. Comparing base (7a252a6) to head (a0a9355).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #10      +/-   ##
==========================================
+ Coverage   99.03%   99.07%   +0.03%     
==========================================
  Files           9       10       +1     
  Lines         624      647      +23     
==========================================
+ Hits          618      641      +23     
  Misses          6        6              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@amrit110 amrit110 merged commit 03cd306 into main Mar 29, 2026
2 checks passed
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.

Auto-detect hardware when HELIX_HARDWARE env var is not set

1 participant