Skip to content

qdot: NVFP4_OFFSET is x86_64-only like its readers, so other targets build without dead_code - #798

Merged
juliankang4 merged 1 commit into
midagedev:mainfrom
juliankang4:fix-qdot-offset-cfg
Oct 24, 2026
Merged

juliankang4 merged 1 commit into
midagedev:mainfrom
juliankang4:fix-qdot-offset-cfg

Conversation

@juliankang4

@juliankang4 juliankang4 commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

x86_64가 아닌 target에서 cargo clippy -D warnings가 실패하던 NVFP4_OFFSET 상수의 dead_code 오류를 고칩니다.

What and why

NVFP4_OFFSET in crates/qdot/src/lib.rs is read only by x86_64 code (the nvfp4_prep_avx2 path), but the constant itself has no cfg. On any other target, such as aarch64, nothing reads it, so cargo clippy -p bloomery-qdot --all-targets -- -D warnings stops with error: constant NVFP4_OFFSET is never used. This adds #[cfg(target_arch = "x86_64")] to the constant, as its x86_64-only neighbours already carry. Its value and its readers are unchanged, so x86_64 builds behave as before.

Release notes: Fixed: bloomery-qdot builds without a dead_code error on targets other than x86_64.

Code shape

  • No second copy. One attribute on one constant.
  • Model code holds only architecture facts. No model code changes.
  • Dead code is gone. The constant is no longer compiled where nothing reads it.
  • No silent failure. Not applicable, no runtime behavior changes.
  • Comments state what is true now. No comment added or changed.
  • No relaxed gate. The lint is not weakened; no allow or expect is added.
  • cargo fmt and cargo clippy are clean on what I touched; the lint count did not go up.

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

What I ran

On an aarch64 Mac, on upstream main:

cargo clippy -p bloomery-qdot --all-targets -- -D warnings
error: constant `NVFP4_OFFSET` is never used
error: could not compile `bloomery-qdot` (lib) due to 1 previous error

On this branch:

cargo clippy -p bloomery-qdot --all-targets -- -D warnings
Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.06s
cargo fmt -p bloomery-qdot --check

cargo fmt prints nothing.

I did not build or run tests on an x86_64 machine. The change only removes the constant from non-x86_64 builds, and every reader of it is already x86_64-only.

Hardware (if the change is for a machine)

Not a machine change. It touches no device path and needs no GPU.

AI help

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

@github-actions github-actions Bot added the host Host crates: qdot, threads, engram, engram-lab, runtime, sampler, levers, decision, vision, refset label Oct 24, 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: CLEAN: The constant now has the same architecture guard as its only executable reader, preserving x86_64 behavior.

Checked

Duplicates: 0 new items; dryer reported 0 candidate pairs.
Complexity: crapper flagged no functions; no function body changed.
Silent failure: 0 changed sites.
Tests: no tests changed; test mutation analysis does not apply. The author reports aarch64 clippy failing before the change and passing afterward.
Gates: no pins, thresholds, tests or lint levels moved.
Architecture: lib.rs:9094 matches the reader's guard at lib.rs:9137; documentation references also belong to guarded items.
Escape catalog: no patterns matched.

Notes

Static review only. Builds and gates were not run during this review.

🔨 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 a0ace7a into midagedev:main Oct 24, 2026
7 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