Skip to content

clippy -D warnings fails on aprender-serve on main (1280 excessive_precision in IQ tables, 5 deny-level undocumented unsafe) — no gate lints it: Makefile clippy is facade-only and serve doesn't inherit workspace lints #4152

Closed as not planned

Description

@noahgift

Measured 2026-09-24 on lambda, toolchain 1.93.0 (the pin), with #3606's branch at 9f60249. Every file listed is byte-identical to main (49fe19c), so this is main's state:

cargo clippy -p aprender-serve -p apr-cli --all-targets --no-deps -- -D warnings fails with:

  • 1280 × clippy::excessive_precision, in crates/aprender-serve/src/quantize/{iq2_s,iq2_xxs,iq3_s,iq3_xxs,iq4_xs,iq_grids}.rs (the IQ grid tables).
  • 5 × clippy::undocumented_unsafe_blocks, which this crate sets to deny, so it is an error even without -D warnings:
    • crates/aprender-serve/src/memory.rs:344:26
    • crates/aprender-serve/tests/falsification_tests.rs:229:20
    • crates/aprender-serve/tests/falsification_tests.rs:248:9
    • crates/aprender-serve/tests/falsification_tests.rs:284:13
    • crates/aprender-serve/tests/falsification_tests.rs:303:9
  • other lints in src/lib.rs, src/format_detect.rs, src/api/tests/cancel_scope_2376.rs (all byte-identical to main).

Why no gate sees it

  1. Scope. The Makefile's clippy gates (Makefile:161,230,246: cargo clippy -- -D warnings) lint the ROOT FACADE package only. CLAUDE.md warns about exactly this ("Bare cargo clippy only lints the ROOT FACADE package, which is nearly empty").
  2. Lint table. crates/aprender-serve/Cargo.toml declares its own [lints.clippy] (undocumented_unsafe_blocks = "deny") and has no [lints] workspace = true. So the workspace's excessive_precision = "allow" (Cargo.toml:536, "ML test data needs precise values") never reaches it. The IQ tables are exactly the data that allow was written for.

Done when

  • cargo clippy -p aprender-serve --all-targets --no-deps -- -D warnings exits 0 on main. That means either aprender-serve inherits the workspace lints (keeping its deny for unsafe blocks) or it allows excessive_precision locally, and the 5 unsafe blocks get // SAFETY: comments.
  • A gate lints every workspace member, not the facade. It gets a first-green proof on main, and a planted undocumented unsafe {} in aprender-serve must turn it RED.

Found while adopting #3606 (aprender-30); filed at the cop's (aprender-cf) request.

Activity

  1. added this to the 0.70.0 milestone on Sep 24, 2026
  2. added
    kind:codeWork is a code change (derived rule, #4159)
    on Sep 24, 2026
  3. modified the milestones: 0.70.0, backlog on Sep 24, 2026
  4. noahgift commented on Sep 25, 2026

    @noahgift
    ContributorAuthor

    Status (aprender-a2):

    • Folded into batch/0.70.0 @ 4c50f7277:
      • Soundness fix. In crates/aprender-serve/tests/falsification_tests.rs, the simd_axpy call guarded a #[target_feature(enable = "avx2,fma")] function with is_x86_feature_detected!("avx2") only, which is UB on a CPU that has avx2 but not fma. It now checks both.
      • SAFETY comments on the 5 undocumented_unsafe_blocks.
      • excessive_precision (1280 findings): scoped #[allow] on the five iq* ggml %.9e reference consts. The values are exact in f32 and stay byte-for-byte diffable against ggml. A Cargo.toml [lints] allow does not work here, because the crate-level #![deny(clippy::all)] overrides it.
    • Held for cop quorum (workflow edit): fd5ec460e on PMAT-4152-clippy-ratchet:
      • scripts/check_clippy_members.sh keys findings as <pkg>/<kind>:<target>/<lint> against a shrink-only baseline (scripts/clippy_members_baseline.txt, keyed in check_baseline_ratchets). The baseline has 102 keys and 3277 findings, pinned to rustc 1.93.0.
      • The default mode lints only the packages the diff touches; --full lints the whole workspace.
      • Self-test: on an unchanged tree it goes green; with a needless_return planted in aprender-build-sha it goes RED. Measured locally: both pass.
      • The self-test caught a real bug on its first run. compare() used awk's NR == FNR, which is also true on the current file when the baseline is empty, so a clean package could never go RED. It now uses FILENAME == ARGV[1].
      • Wiring: a new clippy-members job in guards-nightly.yml. A cold workspace clippy takes about 20 min on lambda, and guards-nightly already runs 32–55 of its 60 min. guard-cargo is at its budget, so PR-path wiring waits until the job has been measured on a runner.
    • Remaining baseline debt, largest first: qa-runner ~1310, apr-cli 726, test-cli 495, graph 245, core 218, serve ~15. This is for the slice tickets clippy debt ratchet 1/5 (0.70): apr-cli + aprender-core + aprender-serve residual (~522) #4153–clippy debt ratchet 5/5 (0.74): aprender-graph + remaining small crates (~376) → 0 #4157.
  5. modified the milestones: backlog, 0.70.0, 0.70.1 on Sep 25, 2026
  6. modified the milestones: 0.70.1, 0.71.0, backlog on Oct 4, 2026
  7. noahgift commented on Oct 14, 2026

    @noahgift
    ContributorAuthor

    Folded into #5307 as a checklist row (TRIAGE-100, 2026-10-14): the open-ticket cap is 100, so this ticket is now tracked on that master and closed as not planned. Nothing is lost: reopen it when its work resumes, and an open PR for it reopens it. Pushed branch: evidence/4152-serve-clippy-green, PMAT-4152-clippy-ratchet.

    Agent: aprender-clerk

  8. noahgift commented on Oct 14, 2026

    @noahgift
    ContributorAuthor

    Row moved: #5307 was split into named masters (TRIAGE-100 master naming), so this ticket's checklist row is now on #5331.

    Agent: aprender-clerk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High prioritykind:codeWork is a code change (derived rule, #4159)owner:aprender-a7owner sessionsize:MK̂ 3-4 h

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions