Skip to content

Document multi-GPU CLI flags and add README examples#5

Merged
arkadianet merged 2 commits intomainfrom
codex/add-documentation-for-multi-gpu-cli-flags
Jan 1, 2026
Merged

Document multi-GPU CLI flags and add README examples#5
arkadianet merged 2 commits intomainfrom
codex/add-documentation-for-multi-gpu-cli-flags

Conversation

@arkadianet
Copy link
Owner

@arkadianet arkadianet commented Jan 1, 2026

Motivation

  • The README was missing documentation and examples for recently added multi‑GPU CLI flags and usage patterns.
  • CLI help and runtime behavior referenced options like device selection and duration that were not documented for users.
  • Docstrings and in-source comments for multi‑GPU coordination code were sparse and needed better coverage for maintainability.

Description

  • Updated README.md to document --list-devices, --devices <list>, and --duration-secs <N> and renamed the -n option to --max-results in the options table and examples, and added multi‑GPU usage examples including --devices all and comma lists.
  • Added brief doc comments in crates/erg-vanity-cli/src/main.rs for parse_device_list, print_result, the WorkerMessage enum variants, and the MultiGpuRunner struct to explain their roles in multi‑GPU execution.
  • Kept behavior unchanged; these changes are documentation and inline comments only and do not modify runtime logic.

Testing

  • No automated tests were executed for this change because it is documentation and docstring only.
  • Existing unit tests and CI configuration were not modified by this PR.

Codex Task

Summary by CodeRabbit

  • New Features

    • Added --list-devices to show available devices.
    • Added --devices <list> to target specific devices for searches.
    • Added --duration-secs <N> to limit search runtime.
  • Documentation

    • Renamed CLI option --num to --max-results.
    • Updated examples to demonstrate device selection and duration usage.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 1, 2026

📝 Walkthrough

Walkthrough

Adds multi-GPU CLI options and README examples; implements device-list parsing, formatted result printing, worker message variants, and a new MultiGpuRunner to coordinate per-device vanity searches with optional duration limits.

Changes

Cohort / File(s) Summary
Documentation Updates
README.md
Renamed -n, --num-n, --max-results; added --list-devices, --devices <list>, and --duration-secs <N> options; expanded examples showing multiple devices and time-limited runs.
Multi-GPU Coordination Logic
crates/erg-vanity-cli/src/main.rs
Added parse_device_list() to parse/validate/deduplicate device indices (supports all and comma lists); added print_result() to format/output matches; extended WorkerMessage enum with Hit(device_index, VanityResult), Error(device_index, String), and Stats(device_index, hits_dropped_total); introduced MultiGpuRunner to coordinate per-device searches, patterns, max results, and optional duration.

Sequence Diagram(s)

sequenceDiagram
    participant CLI as CLI (main.rs)
    participant Runner as MultiGpuRunner
    participant Worker as GPU Worker (per-device)
    participant Out as Output/STDOUT

    CLI->>Runner: parse args (devices, patterns, max-results, duration)
    Runner->>Worker: spawn per-device workers (device_index, pattern)
    loop search
        Worker->>Runner: WorkerMessage::Hit / Error / Stats
        Runner-->>Out: print_result() for Hit, log Error/Stats
    end
    alt duration reached or max-results met
        Runner->>Worker: signal stop
        Worker->>Runner: final Stats
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Poem

🐰 I nibble args and parse the list,
GPUs hum while I hop and twist,
Hits print tidy, devices align,
Time-bound searches, patterns shine—
A rabbit's dance with vanity fine! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'Document multi-GPU CLI flags and add README examples' accurately reflects the main changes: documentation updates in README.md and inline comments in main.rs for multi-GPU features.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3143097 and 0437a0f.

📒 Files selected for processing (1)
  • crates/erg-vanity-cli/src/main.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/erg-vanity-cli/src/main.rs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Test

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@arkadianet arkadianet merged commit fd8ffc5 into main Jan 1, 2026
5 checks passed
@arkadianet arkadianet deleted the codex/add-documentation-for-multi-gpu-cli-flags branch January 1, 2026 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant