Skip to content

fix: resolve dead code and unused import warnings across 9 crates#155

Merged
powderluv merged 10 commits intoROCm:mainfrom
shiv-tyagi:fix/spur-cli-dead-code-warnings
May 6, 2026
Merged

fix: resolve dead code and unused import warnings across 9 crates#155
powderluv merged 10 commits intoROCm:mainfrom
shiv-tyagi:fix/spur-cli-dead-code-warnings

Conversation

@shiv-tyagi
Copy link
Copy Markdown
Member

@shiv-tyagi shiv-tyagi commented May 5, 2026

Summary

Systematic cleanup of Rust compiler warnings (dead code, unused imports, unused variables) across the spur codebase. Each crate is addressed in a separate commit.

What was fixed

Crate Commit What changed
spur-cli 5f75e37 Add missing symlink dispatch for exec, image, net commands + remove unused import
spur-net 13ce8fd Remove unused import and variable in oci.rs
spur-ffi 0118a88 Remove unused std::ptr import
spur-sched c39db07 Remove unused partitions parameter from find_suitable_nodes
spur-spank 7e8a102 Remove unused imports, log plugin path in hook invocations
spur-core 022b1ef Remove unused QosLimits and JobState imports from qos.rs
spur-k8s 4017a04 Use gpu_request_to_gres in CRD conversion (was duplicating logic), default GPU type to "any"
spurrestd 64ff2a1 Wire the state query param into the get_jobs filter — it was deserialized but silently ignored
spurdbd ec7de77 Remove redundant effective_priority wrapper that just delegated to spur_sched::priority::effective_priority, drop unused spur-sched dep

Warning status after this branch

Crate Warnings Notes
spur-cli 0 Clean
spur-net 0 Clean
spur-ffi 0 Clean
spur-sched 0 Clean
spur-spank 0 Clean
spur-core 0 Clean
spur-k8s 0 Clean
spurrestd 0 Clean
spurdbd 2 compute_fairshare + period_start — planned code awaiting wiring
spurd 23 Not yet addressed
spurctld 25 Not yet addressed
spur-tests 3 Not yet addressed

Deferred to follow-up

  • spurdbd (2 warnings): compute_fairshare and UsageRecord.period_start are scaffolded for fair-share scheduling but not wired yet. The wiring work is on feat/fairshare-wiring and will be revisited separately.
  • spurd (23), spurctld (25), spur-tests (3): Will be addressed in a follow-up PR.

shiv-tyagi and others added 10 commits May 4, 2026 23:23
These three subcommands were missing from the argv[0] symlink dispatch
block, making their main() wrappers dead code. Also removes an unused
std::io::Read import in image.rs.
Drop unused `std::io::Read` import in credential parsing and remove
a `media_type` clone that was never consumed (the actual check reads
directly from the manifest).

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…e_nodes

Co-authored-by: Cursor <cursoragent@cursor.com>
…vocations

Remove unused CString and tracing::error imports. Include plugin .so
path in debug/warn log lines so operators can identify the source file
when a hook fails or is missing.

Co-authored-by: Cursor <cursoragent@cursor.com>
Move QosLimits import into the test module where it is actually used.
JobState was entirely unused.

Co-authored-by: Cursor <cursoragent@cursor.com>
…e to "any"

The inline gres formatting in to_core_job_spec already defaulted to
"any" when no GPU type was specified. Align gpu_request_to_gres with
this behavior so the scheduler always receives a typed gres string
(e.g. "gpu:any:4" instead of "gpu:4"), which avoids ambiguity during
GRES matching on nodes that advertise typed GPU resources.

Co-authored-by: Cursor <cursoragent@cursor.com>
The state field on JobsQuery was deserialized but never used, causing a
dead_code warning. Parse the comma-separated state parameter into
JobState values and pass them to the gRPC request so the filter works.

Co-authored-by: Cursor <cursoragent@cursor.com>
The effective_priority function in fairshare.rs was a pass-through to
spur_sched::priority::effective_priority with no added logic. Remove it
and drop the now-unused spur-sched dependency from spurdbd.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add debug_fail helper and cluster baseline preamble so CI logs capture
node states, queue, and daemon logs when tests fail.

Co-authored-by: Cursor <cursoragent@cursor.com>
@shiv-tyagi shiv-tyagi changed the title fix(spur-cli): add symlink dispatch for exec, image, and net commands fix: resolve dead code and unused import warnings across 9 crates May 5, 2026
@shiv-tyagi shiv-tyagi force-pushed the fix/spur-cli-dead-code-warnings branch from 05bceeb to a2e5362 Compare May 5, 2026 12:10
@shiv-tyagi shiv-tyagi requested a review from powderluv May 6, 2026 03:29
@powderluv powderluv merged commit 1364191 into ROCm:main May 6, 2026
11 of 12 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.

2 participants