Skip to content

gpu-gates: drop the dead feature-off stub main from the 112 bins that declare required-features - #99

Merged
midagedev merged 1 commit into
midagedev:mainfrom
avlp12:gpu-gates-dead-stubs
Oct 13, 2026
Merged

midagedev merged 1 commit into
midagedev:mainfrom
avlp12:gpu-gates-dead-stubs

Conversation

@avlp12

@avlp12 avlp12 commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Requested by Alis

What and why

112 bins in crates/gpu-gates/src/bin/ on current main (the issue counted 99) carry a #[cfg(not(...))] fn main() that prints a hint and exits 2. Each of them has a [[bin]] entry whose required-features turn on the feature the stub tests, so cargo never builds the bin without it and the stub can never run.

For each bin I closed its required-features over the [features] implications (for example, deepseek41 turns on gpu, and glm5next turns on deepseek41) and evaluated the stub's cfg. It is false for all 112, including:

  • gate_mimo2_serve's all(mimo2, glm5next) and gate_routed_legs' all(glm5next, mimo2);
  • gate_clef_serve's and gate_lev_serve's all(deepseek41, clef);
  • bloomery_serve_qwen38 and gate_qwen38_serve, which test gpu but require deepseek41.

This removes the 112 stubs (818 lines, nothing added). The real main's positive #[cfg(feature = ...)], and the gated use and mod items, are left as they were, so behaviour is identical. They are now redundant; I can remove them in a follow-up if you want.

Left alone: the nine bins with no stub (exact_ref, gate_block, gate_deepseek41_plan, gate_dspark_read, gate_nvtier, gate_serve_start, kld_diff, oxart_ptx, probe_nvread), and the other cfg(not(feature = "vision")) items (fns, a mod, statements), which are not stub mains.

Closes #12.

Code shape

  • No second copy.
  • Model code holds only architecture facts. No model code touched.
  • Dead code is gone. This is the change.
  • No silent failure.
  • Comments state what is true now.
  • No relaxed gate.
  • cargo fmt and cargo clippy are clean on what I touched; the lint count did not go up.

Duplication found or removed (path:line): none.

What I ran

On a Mac with the pinned toolchain (rustc 1.100.0-nightly (e457a7b0d 2026-08-27)) and the static tier's environment file, on this branch (one commit on main at f382b474):

$ just mac-check
mac-check: check rc 0
mac-check: combos rc 0; 41 shapes run, 0 red
$ just mac-lint
mac-check: lint ^warning: 41 = the ratchet 41 in tools/lint-ratchet.txt

cargo fmt --all --check and bash tools/check-comments.sh are clean at this commit too. just mac-check's workspace check builds bloomery-gpu-gates with gpu, deepseek41, vision, glm5next, mimo2 and clef, the features every touched bin needs.

Earlier, on 1cba9707 (then 108 stubs), just mac-static passed fmt-check, lint and combos; its check-recipes step was red on this Mac, and it was red on that base commit too, from the same narrow-scan and q38-3090-server self-tests. One run also failed depth-serve.sh --self-test, which passed on a rerun on both the branch and the base. I did not rerun check-recipes at f382b474. The ptx-scan comparison with the base is yours, as the issue says.

Hardware (if the change is for a machine)

Not hardware-specific. Mac Studio, Apple M3 Ultra, 512 GB, macOS 26.

🤖 Generated with Claude Code

@midagedev

Copy link
Copy Markdown
Owner

Merged via #133. Thank you!

This comment was written by the bloomery AI assistant on behalf of the maintainer.

… declare required-features (midagedev#12)

Each of these bins has a [[bin]] entry whose required-features turn on the
feature its `#[cfg(not(...))] fn main()` stub tests (deepseek41 and
glm5next pull in gpu; all(mimo2, glm5next) is covered by the three
features gate_mimo2_serve requires), so cargo never builds the bin
without them and the stub that printed a hint and exited 2 could not be
reached. The real `main` keeps its positive cfg.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@midagedev
midagedev force-pushed the gpu-gates-dead-stubs branch from 66afd0c to bc303f1 Compare October 13, 2026 22:38
@midagedev
midagedev merged commit f1a3e9e into midagedev:main Oct 13, 2026
5 checks passed

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: CLEAN: Cargo's unchanged required-features make all 112 removed stubs unreachable, and every enabled binary retains its real main.

Checked

Duplicates: 0 new items; no duplicate owner introduced. Dryer pairs were unavailable.
Complexity: crapper flagged no function; only feature-off stub functions were deleted.
Silent failure: 112 deleted exit paths checked; Cargo prevents entry into each.
Tests: no tests changed; mutation review is not applicable. Static cfg checks of all 64 feature selections across 112 binaries confirm that enabled targets retain main.
Gates: no pins, assertions, tests or reachable gate cases removed.
Escape catalog: C1–C4 do not match this diff.

Notes

Dryer did not run. Its stated reason, no changed Rust files under crates/, contradicts the 112 changed Rust files.
The PR reports Mac static results. Base/head PTX comparisons and card gate evidence are absent; validation used source checks only.

Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/bloomery_chat.rs, crates/gpu-gates/src/bin/bloomery_serve.rs, crates/gpu-gates/src/bin/bloomery_serve_ds41.rs … and carries no gate run on a card (CONTRIBUTING's evidence list); a maintainer adds gpu-verified after one.

🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)

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

Labels

gpu The card engine: crates/gpu*, crates/app needs-gpu Changes code a card must check, and carries no gate run on a card

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gpu-gates: required-features 뒤의 죽은 stub main 정리

2 participants