Skip to content

linux: drop the never-shipped LUT kernel and stop Nix builds compiling the benchmarks - #108

Merged
ajbarryiii merged 2 commits into
mainfrom
cleanup/linux-lut-kernel
Nov 3, 2026
Merged

ajbarryiii merged 2 commits into
mainfrom
cleanup/linux-lut-kernel

Conversation

@ajbarryiii

@ajbarryiii ajbarryiii commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

Summary

The speech-kernel crate lf-cpu, which ships in the daemon, still carried benchmark-only code:

  • gemm_lut: the exact-FP32 lookup-table GEMM from October.
    • It missed its speed bar: about 1.1× i8x3 on long inputs, slower on short ones, and well behind i8x2.
    • It was never wired into lf-asr.
    • It runs only on AVX-512 with ternary weights, so it can't run kea-b, the recommended model.
  • peak: register-only throughput probes that only lf-gemm-bench --peak calls.

Separately, the Nix package builds only -p lf-daemon, but its check phase ran cargo test --workspace. Every nix build therefore also compiled and tested the benchmark tools.

The changes:

  • Delete lf-cpu/src/gemm_lut.rs, and the test-only avx512_pool helper in lib.rs that only its tests used. Its measurements stay in git history.
  • lf-gemm-bench loses the lut variant and the --lut-* options. f32 and i8x1–3, --export (paired timing across exports), --synthetic, --accuracy, --peak and the memory table are unchanged.
  • peak.rs moves into lf-bench as a private module of lf-gemm-bench, without its LUT probes.
    • The VNNI/FMA (AVX-512) and AVX-VNNI/maddubs/FMA (AVX2) probes are unchanged.
    • The moved file keeps lf-cpu's deny(clippy::undocumented_unsafe_blocks, clippy::missing_safety_doc).
  • linux/flake.nix: cargoTestFlags = [ "--workspace" "--exclude" "lf-bench" ], with the comment updated. CI still tests the whole workspace.
    • I didn't add default-members to linux/Cargo.toml. linux/ is a virtual workspace, so it would silently shrink what CI's cargo clippy --all-targets and cargo test cover.

Tests removed: gemm_lut's own unit tests, together with the kernel they pinned. No other test changed.

Not changed: linux/CHANGELOG.md, because nothing user-visible changes. linux/PLAN.md and the READMEs are left alone; the docs cleanup PR handles them. The nixpkgs derivation (nixpkgs PR 579077, localflow 0.1.0) is separate and could take the same --exclude lf-bench at its next version bump.

Verification

Proof: AGENTS.md's three cargo commands with the private integration suites included, a sandboxed nix build, and smoke runs of every remaining lf-gemm-bench mode.

  • fmt, clippy, test (nix develop ./linux, no LF_SKIP_* set): fmt is clean and clippy has no warnings.
    • Tests: 50 suites, 583 passed, 0 failed, 2 ignored (a subprocess helper and real_model).
    • The private D-Bus, PipeWire and headless sway suites ran in full.
  • nix build ./linux -L, before and after:
    • On main, the check hook ran --workspace, compiled lf-bench, and ran 50 suites (592 passed).
    • On this branch it ran --workspace --exclude lf-bench and never compiled lf-bench: 46 suites, 567 passed, 0 failed, 2 ignored.
    • The difference is exactly lf-bench's 16 tests plus gemm_lut's 9.
  • lf-gemm-bench smoke runs (Zen 5 host):
    • --peak works at both tiers (LOCALFLOW_CPU_TIER=avx2 for the AVX2 probes).
    • --synthetic ternary|binary --accuracy works, as does a paired run over two kea-b exports.
    • --variants lut and --lut-panel are now rejected as unknown.
  • nixfmt --check linux/flake.nix and git diff --check pass.
  • make check was not run locally (it needs macOS); CI runs it. This PR touches no Swift.

Risk and privacy

  • Linux-only. No privacy, permission, storage, provider, signing or workflow changes.
  • No AGENTS.md high-risk area is touched. The flake change affects only the package's check phase: the installed localflowd and localflowctl are built exactly as before.
  • Unsafe code: peak.rs's inline-asm probes moved crates unchanged, with their // SAFETY: comments, and the lint that enforces those comments came with them.

Reconciled with #105–#112. Every pair, and the full set, merge onto main without conflicts, so they can merge in any order. All eight merged together pass make check and git diff --check on the Mac. The seven other than #112 also pass make -C iOS check together; #112 changes no file the iOS build compiles.

Created with Claude Opus 5.5 in T3 Code.

Sol Loop: 1 rounds, 0 fixes (0 high, 0 medium, 0 low, 0 rejected)

@ajbarryiii
ajbarryiii marked this pull request as ready for review November 3, 2026 01:21
@ajbarryiii
ajbarryiii merged commit 14e966a into main Nov 3, 2026
4 checks passed
@ajbarryiii
ajbarryiii deleted the cleanup/linux-lut-kernel branch November 3, 2026 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant