Skip to content

fix(xla): clear the clippy finding in xla_worker_tests - #2991

Merged
inureyes merged 2 commits into
lablup:mainfrom
Jaeyeong-CHOI:fix/xla-worker-tests-clippy
Nov 15, 2026
Merged

inureyes merged 2 commits into
lablup:mainfrom
Jaeyeong-CHOI:fix/xla-worker-tests-clippy

Conversation

@Jaeyeong-CHOI

Copy link
Copy Markdown
Contributor

Summary

cargo clippy --features cuda,xla-iree --all-targets -- -D warnings stops at one finding, field_reassign_with_default in src/server/batch/xla_worker_tests.rs. That module is compiled only with xla-iree, which the clippy job does not enable, so nothing reported it. This writes the two statements as one struct literal. With it clippy passes on the three OpenXLA feature sets.

Related issues

No issue filed; the report is this description. The two lines came in with #2848.

Type of change

  • fix — bug fix (a lint failure in test code; no behavior changes)

Before / after

cargo clippy --locked --keep-going <features> --all-targets -- -D warnings on a DGX Spark (GB10). The three-feature baseline survey ran at local commit 62b6010c7: ce6855bc8 plus the unrelated CUDA cache-default test isolation (only native_env_tests.rs and its new integration test differ). The affected xla_worker_tests.rs blob is identical to clean ce6855bc8. The fix is independently based on ce6855bc8; the 19-test before/after comparison below starts from clean ce6855bc8.

Features Baseline survey (62b6010c7) This PR
--features cuda,xla-iree 1 finding, mlxcel (lib test) does not compile passes
--no-default-features --features xla-diagnostics the same 1 finding passes
--features cuda,xla-reference-diagnostics the same 1 finding passes
error: field assignment outside of initializer for an instance created with Default::default()
    --> src/server/batch/xla_worker_tests.rs:1417:5
     |
1417 |     config.context_size = 8_192;
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     = note: `-D clippy::field-reassign-with-default` implied by `-D warnings`

--keep-going and --all-targets are there so that one failing target cannot hide another: this is the only finding on any of the three.

Test plan

Run on this PR's commit (89093d179, one commit on ce6855bc8) on a DGX Spark (GB10).

  • cargo fmt --all -- --check
  • The three clippy invocations of the table: all exit 0 with no finding
  • cargo clippy --workspace --all-targets --features cuda -- -D warnings (the Linux spelling of the template's line), and cargo clippy -p mlxcel --lib --tests -- -D warnings with default features, the clippy job a fork PR does not get: both pass
  • cargo test --profile test-fast --features cuda,xla-iree --lib server::batch::xla_worker -- --test-threads=1: 19 passed, as on main, a_budget_wider_than_the_shape_is_clamped_instead_of_refused among them
  • cargo check --features cuda,xla-iree --all-targets and cargo check --no-default-features --features xla-diagnostics --all-targets, the two xla-compile steps: pass
  • scripts/insert_apache_header.py --check, scripts/ci/check_cross_repo_refs.py: OK
  • make verify-test-cuda: not run. The file is compiled only with xla-iree, which that gate does not enable
  • Validated with a real checkpoint: not applicable, test code only
  • cargo deny check: not run and not applicable
  • Metal: not built or run here

Notes for reviewers

  • CI does not lint these feature sets. clippy runs -p mlxcel --lib --tests with default features, and xla-compile runs cargo check, which does not run clippy's lints. Swapping cargo check for cargo clippy ... -- -D warnings in the two xla-compile steps would cover it; I have not touched the workflow.
  • Implemented and validated with AI assistance (Claude) driving the GB10 host.

Checklist

  • PR title uses a Conventional Commits prefix
  • One logical change per PR
  • Updated docs/: no user-facing behavior or supported-model change
  • Updated // Used by: ... comments: no shared function is modified
  • No secrets, credentials, or .env files committed

`cargo clippy --features cuda,xla-iree --all-targets -- -D warnings` stops
at `field_reassign_with_default` in
`a_budget_wider_than_the_shape_is_clamped_instead_of_refused` (lablup#2848). The
module is compiled only with `xla-iree`, and CI lints the default feature
set, so nothing reported it.

It is the only finding on the three OpenXLA feature sets (`cuda,xla-iree`,
`xla-diagnostics`, `cuda,xla-reference-diagnostics`). With it gone clippy
passes on all three.
@inureyes inureyes added priority:medium Medium priority status:review Under review type:bug Bug fixes, error corrections, or issue resolutions labels Nov 15, 2026
Main independently adopted a struct initializer for this test. Retain the explicit ServerConfig default spelling while integrating the current base so the original PR can merge cleanly.

Validated the changed Rust file with rustfmt; the equivalent initializer is included in the CUDA integration build.

Refs lablup#2991
@inureyes

Copy link
Copy Markdown
Member

Implementation hardening for PR #2991. The current base independently fixed the same clippy finding. Merged main and resolved the single conflict by retaining the explicit ServerConfig default initializer (79bfe84). rustfmt --edition 2024 --check src/server/batch/xla_worker_tests.rs passed. The remaining diff is an equivalent default spelling; test behavior and production behavior are unchanged.

Security review found no new credential, injection or untrusted execution path. Performance review found no hot-path behavior change. Hosted checks must pass on the updated head before merge.

@inureyes
inureyes merged commit 4ec11b7 into lablup:main Nov 15, 2026
31 checks passed
@inureyes inureyes added status:done Completed and removed status:review Under review labels Nov 15, 2026
@inureyes inureyes added this to the 0.9 milestone Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority:medium Medium priority status:done Completed type:bug Bug fixes, error corrections, or issue resolutions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants