Repair lint coverage, patch advisories, fix pipeline dtype corruption - #1
Open
anbeckham wants to merge 1 commit into
Open
Repair lint coverage, patch advisories, fix pipeline dtype corruption#1anbeckham wants to merge 1 commit into
anbeckham wants to merge 1 commit into
Conversation
…ption CI lint coverage Clippy ran without --all-targets, so nothing under #[cfg(test)] was ever linted. Enabling it immediately surfaced an error-level lint that had been invisible to CI. Fixes that lint plus 3 useless_conversion warnings. Mesh pipeline dtype corruption (correctness) TensorDtype::to_u8/from_u8 mapped F16=>0, F32=>1, but MeshPipelineHandler — the only consumer of those functions — defines 0=F32, 1=F16. Every pipeline hop therefore swapped F16 and F32 in both directions, so a receiving stage decoded F32 activations at 2 bytes per element and produced garbage. PipelineInitiator compounded this by hardcoding TensorDtype::F16 on the wire message while discarding the dtype the engine actually returned, and saved checkpoints under the same wrong dtype. These functions are not part of the wire format (TensorDtype travels as a serde enum), so realigning them to the handler's tag space is safe. Adds regression tests asserting the literal tags rather than only the round-trip, and documents the tag space on the trait so the two sides cannot drift again. Security advisories Patches 5 real advisories rather than ignoring them, including RUSTSEC-2026-0185, a remote memory-exhaustion DoS in quinn-proto — the QUIC transport the mesh runs on. Also rustls-webpki (3), crossbeam-epoch, and a rand unsoundness. Rewrites deny.toml's ignore list: several entries carried wrong justifications (2024-0370 was labelled "bincode", it is proc-macro-error; 2024-0436 was labelled "fxhash", it is paste). The two remaining quick-xml vulnerabilities are blocked by upstream semver pins and are documented with their actual exposure. CLI hang risk reqwest::Client::new() applies no timeout, so any coordinator call could hang a command indefinitely with no output — including share_benchmark_result, documented as "never blocks". Routes all 8 call sites through a shared client with connect/request timeouts. The cloud inference client is deliberately left alone, since it streams. CI runtime deprecation Bumps pinned actions to Node 24 runtimes ahead of the 2026-09-16 removal of Node 20 from GitHub runners. Verified: fmt, clippy --all-targets, 331 tests, cargo-deny advisories+licenses. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Clippy ran without
--all-targets, so nothing under#[cfg(test)]was ever linted. Turning it on immediately surfaced an error-level lint CI could not see. Pulling that thread led to a correctness bug in the distributed pipeline.The dtype bug (most important part of this PR)
TensorDtype::to_u8/from_u8mappedF16 => 0, F32 => 1.MeshPipelineHandler— the only consumer of those functions — defines0 = F32, 1 = F16.TensorDtype(before)forward_layersSo every pipeline hop swapped F16 and F32, in both directions:
worker.rs:169sendsdtype.to_u8()intoforward_layers, which decodes it with the other table.worker.rs:210decodes the handler's returned tag with the mesh table.A stage receiving F32 activations labelled F16 decodes them at 2 bytes per element instead of 4 — garbage activations, silently.
PipelineInitiatorcompounded it by hardcodingTensorDtype::F16on the wire message while discarding the dtype the engine actually returned, and by saving checkpoints under that same wrong dtype (so recovery resumed on garbage too).These functions are not part of the wire format —
TensorDtypetravels between peers as a serde enum, andto_u8/from_u8are used in exactly two places, both at the handler boundary. Realigning them is therefore safe. The tag space is now documented on the trait, and tests assert the literal tags rather than only the round-trip, since a round-trip test passes happily while both sides are consistently wrong.Security
Patches 5 advisories rather than ignoring them — notably RUSTSEC-2026-0185, a remote memory-exhaustion DoS in
quinn-proto, the QUIC transport the mesh runs on. Alsorustls-webpki(x3),crossbeam-epoch, and arandunsoundness.deny.toml's ignore list is rewritten. Several entries had wrong justifications:RUSTSEC-2024-0370was labelled "bincode: crafted input DoS" but is actually proc-macro-error unmaintained;2024-0436was labelled "fxhash" but is paste. Every remaining entry was re-verified against the advisory DB. The twoquick-xmlvulnerabilities cannot be patched —self_update 0.42pins^0.37andplist 1.8(via Tauri) pins^0.38— so their actual exposure is documented instead.CLI hang risk
reqwest::Client::new()applies no timeout.share_benchmark_result, documented as "best-effort, never blocks", could block forever. All 8 call sites now use a shared client with connect/request timeouts. The cloud inference client is deliberately left alone — it streams, and a blanket request timeout would truncate long generations.Also
Verification
cargo fmt --check,cargo clippy --workspace --exclude hivebear-web --all-targets -- -D warnings, 331 tests passing,cargo deny check advisories licensesclean, plus-p hivebear-inference --no-default-featuresas CI does.release.ymlandmobile.ymlaction bumps includedownload-artifactv4→v8, which changes digest-mismatch from warn to error. I could not exercise a release build here — worth aworkflow_dispatchrun before the next tagged release.🤖 Generated with Claude Code