Skip to content

The (crate, feature) matrix has never been built: 100 of 430 selections do not compile, all of them unreachable from any default set #3262

Description

@noahgift

Measurement

A full sweep of every (crate, feature) pair in the workspace — 430 pairs across 45 crates, each built as cargo check -p <crate> --no-default-features --features <one feature> — finished with 100 pairs RED.

None of them are reachable from any crate's default set. That is the whole finding: a feature is declared in Cargo.toml, code is gated on it, and nothing in CI ever selects it, so the declaration and the code drifted apart with no gate to notice. cargo check --workspace stays green throughout because feature unification hands every crate whatever its siblings happened to enable.

Broken pairs by crate, as measured:

crate pairs root causes
aprender-train 31 tui declared in Cargo.toml, never applied in code; pre_warm_realizador_gemm re-export gated more loosely than its definition
aprender-distribute 24 tokio used unconditionally; and num_cpus, which only the cpu feature pulls
apr-cli 19 8 sites where a definition is #[cfg(feature = "inference")] and its caller is not
aprender-orchestrate 7 apr_serve gated native but needs realizar+libc; rag TUI gated on the dep-feature, not the composite
aprender-simulate 5 CB-081 removed axum/jsonschema/z3 and left the gated code behind
aprender-serve 2 cuda supplies neither gpu, server nor cli, all of which its code uses
aprender-data 2 cli needs local + shuffle and declares neither
aprender-core 1 showcase-profile needs renacer, a DEV-dependency here (circular)
aprender 1 wgpu did not enable entrenar/gpu
aprender-zram-core / aprender-zram 2 trueno_gpu::driver::PinnedBuffer and the async pinned-copy API do not exist post-APR-MONO (#3179)
aprender-viz 1 gpu-wasm — shared_instance/gpu_backends gated all(gpu, not(wasm32)) while their caller is not
aprender-test-cli 1 ChatRequest initializer missing stream_options
aprender-present-lib 1 wgpu::RenderPassColorAttachment initializer missing depth_slice
aprender-profile-core 1 otlp = [] — an empty feature whose code needs opentelemetry
aprender-mcp 1 pmcp-dispatcher needs native
aprender-rag-cli 1 EvalAction missing the Clone/Debug its parent enum requires

Why it matters now

The night lane's feature-matrix job sweeps these 430 pairs. Born against this tree it would be red on 100 of them on its first run — a gate that is red before it has ever been green teaches people to ignore it.

Remaining after PR #3263

PR #3263 fixes 9 crates. Four things are deliberately not in it:

  1. aprender-distribute (24 pairs) — owned by open PR fix(distribute): tokio behind an optional feature, used unconditionally — 43 errors under --no-default-features #3257, which gates on feature = "tokio". That is necessary but not sufficient: executor/cpu.rs also uses num_cpus, which only the cpu feature pulls, so checkpoint, microvm, remote, remote-tls, serverless, tokio and tui stay red after it. Reported on that PR rather than duplicated here.
  2. aprender-zram-core / aprender-zram cuda — aprender-zram-core's cuda feature has never compiled: unresolved trueno_gpu imports in library code, dark since before v0.66.0 #3179. PinnedBuffer plus GpuBuffer::copy_{from,to}_pinned_async are an entire host-pinned-memory API that does not exist in the in-tree aprender-gpu. Restoring it or rewriting the batch path on pageable memory is a driver-API decision, not a feature-declaration fix.
  3. aprender-present-lib gpu — wgpu::RenderPassColorAttachment gained a depth_slice field; the initializer was never updated because nothing builds it. Mechanical, but it is a wgpu-version question, not a gate.
  4. aprender-test-cli llm — ChatRequest gained stream_options; same shape.

Two features are declared but cannot be built by construction, and PR #3263 makes them say so with one compile_error! naming the exact edit that would enable them, instead of a cascade of unresolved imports:

  • aprender-simulate/z3-proofs — CB-081 removed z3; unlike axum and jsonschema it is not already in Cargo.lock and needs the libz3 system library, so re-adding it is a real cost and a real decision.
  • aprender-core/showcase-profile — renacer is a dev-dependency because renacer depends on aprender. Breaking that cycle is a prerequisite.

Reproduce

cargo metadata --no-deps --format-version 1 \
  | python3 -c 'import json,sys;[print(p["name"],f) for p in json.load(sys.stdin)["packages"] for f in p["features"] if f!="default"]' \
  | while read -r c f; do
      cargo check -q -p "$c" --no-default-features --features "$f" 2>&1 | grep -qE 'error(\[|:)' && echo "$c $f"
    done

no-close: this is the umbrella measurement; it stays open until the four items above are green. PR #3263 closes none of it on its own.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0Critical prioritybugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions