Skip to content

lint: qdot's activation helpers imported only where the AVX2 paths use them - #688

Merged
juliankang4 merged 2 commits into
midagedev:mainfrom
juliankang4:fix-clippy-main-warnings
Oct 22, 2026
Merged

juliankang4 merged 2 commits into
midagedev:mainfrom
juliankang4:fix-clippy-main-warnings

Conversation

@juliankang4

Copy link
Copy Markdown
Collaborator

qdot의 aarch64 unused imports 경고를 없애는 clippy 정리 PR입니다.

What and why

On aarch64, just lint on main reports an unused imports warning in crates/qdot/src/lib.rs. f32_to_f16_bits, non_finite_activation and q80_inverse are used only by the x86_64 AVX2 quantizers, so the import now carries the same #[cfg(target_arch = "x86_64")]. x86_64 imports all three as before. The doc link on quantize_q8k_block names gguf::quant::non_finite_activation in full so rustdoc still resolves it on aarch64. No behavior change.

The warning came in with f956b65. The x86_64 lint enables the cfg that uses these imports, which is why it never showed there.

Release notes: internal: clears an aarch64-only clippy warning.

Code shape

  • No second copy. No new function or constant; the import still points at the gguf::quant owners.
  • Model code holds only architecture facts. No model code touched.
  • Dead code is gone. Nothing left unused on aarch64.
  • No silent failure. No runtime path changed.
  • Comments state what is true now. One doc link path changed, nothing added.
  • No relaxed gate. No allow added and no lint moved; the import is gated on the condition of its callers.
  • cargo fmt and cargo clippy are clean on what I touched; the lint count did not go up.

Duplication found or removed (path:line), or "none": none.

What I ran

  • just lint on main, aarch64: 8 ^warning: lines, including the qdot unused imports warning.
  • just lint with this change, aarch64: the qdot warning is gone. The two other warnings (crates/model-hf/src/arch/qwen35moe/folder.rs and crates/refset/src/arch/qwen4exp/mtp.rs) are left to ci: lint every pull request against the clippy ratchet #685.
  • cargo fmt --check: clean.
  • Tokenizer test tier: 38 tests, 0 red.
  • x86_64 lint: not run. I checked by reading that every use of the three helpers (quantize_q8k_block_avx2, quantize_q8_block_avx2, quantize_q8f0_col_avx2) sits under the same cfg.

Hardware (if the change is for a machine)

aarch64 only (DGX Spark, GB10). No GPU path is involved.

What I ran into

This does not block the PR. I did not run the x86_64 lint on this head. The other two aarch64 warnings are still open on main until #685 lands.

AI help

AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.

…e them

On aarch64 the three helpers imported at crates/qdot/src/lib.rs:71 have no user, so clippy warns about unused imports there; the x86_64 lint does not see it. The import moves under the same cfg as its callers.
@github-actions github-actions Bot added the host Host crates: qdot, threads, engram, engram-lab, runtime, sampler, levers, decision, vision, refset label Oct 22, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: MUST_FIX: Two scalar documentation links lose their targets on aarch64.

Must fix

1. Qualify the remaining scalar documentation links

crates/qdot/src/lib.rs:73 removes the helper names from scope on aarch64. The ungated quantize_q8f0_col still links to both short names at crates/qdot/src/lib.rs:3700. Generating private documentation on that architecture produces unresolved intra-doc links. This is a kind B broken-comment defect.

Fixing both links now takes two lines and avoids a separate documentation repair. Replace lines 3700–3701 with:

/// even (mainline's F16C conversion, [`gguf::quant::f32_to_f16_bits`] here), codes
/// `round_half_even(v * id)` with [`gguf::quant::q80_inverse`]'s `id`.

Checked

Duplicates: 0 new functions, types or constants; dryer reported 0 candidate pairs.
Complexity: crapper flagged no functions; no function body changed.
Silent failure: 0 changed sites; executable helper uses retain matching x86_64 guards.
Tests: no tests changed; mutation checking is not applicable.
Gates: no gates, thresholds or lint levels changed.
Escape catalog: no patterns matched.

Notes

Static review only; no builds or tests run here. The PR reports aarch64 lint and formatting checks; x86_64 lint was not run.

🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)

quantize_q8f0_col is built on every architecture, so its doc links to f32_to_f16_bits and q80_inverse name the gguf::quant paths now that the short names are imported only on x86_64.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the last review: must-fix 1 is fixed. Both scalar links now use full paths at crates/qdot/src/lib.rs:3700.

Verdict: CLEAN: The earlier aarch64 documentation defect is fixed.

Checked

Duplicates: 0 new items; dryer reported 0 candidate pairs.
Complexity: crapper flagged no functions; no function body changed.
Silent failure: 0 changed sites; this increment changes only two documentation links.
Tests: no tests changed; mutation checking is not applicable.
Gates: no gates, thresholds or lint levels changed.
Links: both target functions and their module are public and available on aarch64 and x86_64.
Escape catalog: no patterns matched.

Notes

Static review only; rustdoc, builds and tests were not run here.

🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)

@juliankang4

Copy link
Copy Markdown
Collaborator Author

The review is done and the contribution check passed, so I'm merging this.

@juliankang4
juliankang4 merged commit 1f7be07 into midagedev:main Oct 22, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

host Host crates: qdot, threads, engram, engram-lab, runtime, sampler, levers, decision, vision, refset

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant