Repository navigation
refactor!: remove dead code found by dead-code scan (supersedes #222–#283) - #284
Merged
Merged
Conversation
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Brooooooklyn
force-pushed
the
devin/1792073519-dead-code-cleanup
branch
2 times, most recently
from
October 16, 2026 10:52
6e09ce6 to
397bc9d
Compare
Co-Authored-By: Brooklyn <[email protected]>
Co-Authored-By: Brooklyn <[email protected]>
Co-Authored-By: Brooklyn <[email protected]>
Co-Authored-By: Brooklyn <[email protected]>
Co-Authored-By: Brooklyn <[email protected]>
…compute_gradients, mlx_compute_gradients) Co-Authored-By: Brooklyn <[email protected]>
Drop qwen3_forward_functional, qwen3_forward_hidden_states and qwen3_forward_hidden_states_chunked plus chunked_forward_tests; none had production callers. Retarget forward_pass_equivalence_tests at forward_functional_dispatch(ModelType::Qwen3) so they cover the live GRPO/SFT autograd path. Co-Authored-By: Brooklyn <[email protected]>
Co-Authored-By: Brooklyn <[email protected]>
Co-Authored-By: Brooklyn <[email protected]>
Its only consumer (packages/agent gdn-checkpoint-capacity test against the pi subagent MAX_CONCURRENCY) was deleted with the pi runtime in eadfc42. BREAKING CHANGE: @mlx-node/core no longer exports gdnPrefixCheckpointLimit(). Co-Authored-By: Brooklyn <[email protected]>
Production code uses the zero-copy key_cache_array_raw/value_cache_array_raw views; the raw Buffer accessors are only called from the in-file test module. Co-Authored-By: Brooklyn <[email protected]>
…-tooltip Co-Authored-By: Brooklyn <[email protected]>
Co-Authored-By: Brooklyn <[email protected]>
…PR titles Co-Authored-By: Brooklyn <[email protected]>
Co-Authored-By: Brooklyn <[email protected]>
Co-Authored-By: Brooklyn <[email protected]>
Co-Authored-By: Brooklyn <[email protected]>
…lateOptions types Co-Authored-By: Brooklyn <[email protected]>
Drop is_last_block_full, free_slots_in_last_block and blocks_needed, which were only exercised by block_table's own unit test. Co-Authored-By: Brooklyn <[email protected]>
…timizer helpers Co-Authored-By: Brooklyn <[email protected]>
Delete grpo/entropy.rs (get_high_entropy_mask, compute_entropy), GroupStats / compute_group_stats / normalize_rewards in grpo/advantages.rs, compute_importance_ratios in grpo/loss.rs (plus the to_f32_vec test helper only its tests used), and __test__/trainers/grpo-truncation.test.ts, which only tested helpers defined in the test file itself. Production grpo_loss and compute_advantages inline this logic; none of it was reachable from the engine or the NAPI surface. Co-Authored-By: Brooklyn <[email protected]>
Co-Authored-By: Brooklyn <[email protected]>
…V3 formatElement Co-Authored-By: Brooklyn <[email protected]>
…layer accessors Co-Authored-By: Brooklyn <[email protected]>
…y-losses' into devin/1792073519-dead-code-cleanup
…i' into devin/1792073519-dead-code-cleanup
…t-utils' into devin/1792073519-dead-code-cleanup
…-manager' into devin/1792073519-dead-code-cleanup
…ol-calls-from-text' into devin/1792073519-dead-code-cleanup
…odel-stubs' into devin/1792073519-dead-code-cleanup
…ecar-ops' into devin/1792073519-dead-code-cleanup
…liding-restore-suppression' into devin/1792073519-dead-code-cleanup
…-sequences' into devin/1792073519-dead-code-cleanup
…used-api' into devin/1792073519-dead-code-cleanup
…ktop-endpoint' into devin/1792073519-dead-code-cleanup
…lidate-parameters' into devin/1792073519-dead-code-cleanup
…-path' into devin/1792073519-dead-code-cleanup
…pressed-settle' into devin/1792073519-dead-code-cleanup
…-only' into devin/1792073519-dead-code-cleanup
…obench' into devin/1792073519-dead-code-cleanup
…put-channels' into devin/1792073519-dead-code-cleanup
…on-body' into devin/1792073519-dead-code-cleanup
…est' into devin/1792073519-dead-code-cleanup
…has-inf' into devin/1792073519-dead-code-cleanup
…lass' into devin/1792073519-dead-code-cleanup
…-wrappers' into devin/1792073519-dead-code-cleanup
…helpers' into devin/1792073519-dead-code-cleanup
…suppressed' into devin/1792073519-dead-code-cleanup
…ntier' into devin/1792073519-dead-code-cleanup
Co-Authored-By: Brooklyn <[email protected]>
a1bf3ba removed inner_mut/into_inner as dead test code, but the macOS-gated spec_paged_substrate_tests::gemma4_coordinator_is_lawful_under_the_permissive_checker calls into_inner — invisible to the Linux-VM dead-code scan that dropped it. inner_mut stays removed (no callers). Co-Authored-By: Brooklyn <[email protected]>
Brooooooklyn
force-pushed
the
devin/1792073519-dead-code-cleanup
branch
from
October 16, 2026 12:12
397bc9d to
3f43bf7
Compare
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.
Summary
This PR removes the dead code reported by the dead-code scan of
mlx-node/mlx-node. It replaces the 62 single-finding PRs #222–#283, which are closed and had their CI cancelled. Each of those branches is merged here as-is, in PR-number order, sogit log --first-parentlists every removal under its original PR title. Of the scan's 79 open findings, 78 are covered here. The remaining one,Qwen4ExpModel.residencyInfo(), was dismissed as a false positive because it is a documented diagnostics API.Totals: 159 files changed, about 16k lines deleted and about 440 added. Most of the added lines are helpers moved into
#[cfg(test)]modules, plus doc and comment updates.Biggest removals:
crates/mlx-core/src/gradients/(the legacyGradientsAPI) and the RustAdam/SGD/RMSprop/LRScheduleroptimizers. AdamW stays.copy_blocksMetal kernel, the test-onlyKvScaleManagerFP8 calibration API (the FP8 scales are now always1.0, as in production), and the test-onlyprofile_runauto-sizer.mlx-sysFFI wrappers, the unusedmlx-dbAPI (AsyncDb,DbConfig, run-lifecycle/log writers), and unusedOutputStorequeries.MLX_GEMMA4_MAX_SLIDING_RESTORE_TOKENS), and the cold-tierrestore_suppressedcounter, which production never incremented. The dashboard trace index dropscold_sidecar_restore_suppressed, andSCHEMA_VERSIONgoes from 7 to 8, so the index rebuilds from JSONL.example-tools.js, theexperiments/flashqla/int8-recovery/fragments, 16 unused__test__/test-utils.tshelpers, and the dashboardtooltipcomponent together with@radix-ui/react-tooltip.Two merges needed conflict resolution, and both kept the removals from each side:
crates/mlx-paged-attn/src/metal/mod.rs: chore(paged-attn): remove never-dispatched copy_blocks kernel #255 (copy_blocks) against refactor(paged-attn): remove test-only KvScaleManager FP8 calibration API #262 (kv_scale).crates/mlx-core/src/tools/mod.rs: refactor(mlx-core): remove unused has_tool_calls/has_thinking helpers #246 against refactor(core)!: remove unused parseToolCallsFromText NAPI export #263.Breaking changes (public
@mlx-node/*surface)@mlx-node/core:Tensorclass and theparseToolCallsFromText()/ParseToolCallsResult,gdnPrefixCheckpointLimit(), andquantizedQmvMicrobench()/QmvQuantizedMicrobenchResultexports.MxArraymethods:tan,sinh,cosh,arcsin,arccos,arctan,evalAsync,getBatchSeqLen, andgetBatchSeqHidden.OutputStore.getRecentGenerations,getGenerationsByReward,getGenerationsByFinishReason,exportJsonl, andqueryRaw.Qwen3Model.validateParameters,MuseGlimmerModel.autoEnablesMtp, and the always-erroringSftTrainingEngine.getModel.@mlx-node/core/@mlx-node/vlm: removedTextDetModel.detectCrop()andTextRecModel.recognizeCrop(). Usedetect()/recognize()with an encoded image instead.@mlx-node/lm: removed theChatMessageWithToolsandApplyChatTemplateOptionstypes.@mlx-node/server: removedreadDesktopEndpoint.healthandload.Verification
mlx-corelib tests passed (3,947 passed, 0 failed), along with integration, other crates, and Clippy.gemma4_coordinator_is_lawful_under_the_permissive_checkerstill callsNoDurableSettleInCycle::into_inner, so 31fd05e brings that helper back. Code gated bycfg(target_os = "macos")was searched for any other references to removed symbols, and none were found.Link to Devin session: https://app.devin.ai/sessions/62a7b98e3d054aaca83c94c609273d7b
Open in Devin Desktop: https://app.devin.ai/desktop/session/62a7b98e3d054aaca83c94c609273d7b?variant=devin
Requested by: @Brooooooklyn