From 130123f64830f61d3f359233ac1165d045557ac1 Mon Sep 17 00:00:00 2001 From: Transaction Science Date: Sat, 17 Oct 2026 16:55:07 -0400 Subject: [PATCH] jouleclaw-omni: declare 23 modules that were compiled by nothing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Twenty-five source files in this crate were named by no `mod` line, so they were not in the build at all: ~19,000 lines that nothing type-checked, tested or linted. `scripts/check-orphan-sources.py` pinned them as a baseline so the count could only fall, and this is that fall: 25 -> 1. Declaring them costs almost nothing, which is the surprise. Twenty-three compile clean, and the two that do not are blocked by facts outside the code: video_decode.rs wants `ffmpeg_next`, which is not a dependency (`extern crate ffmpeg_next` -> E0463). That is a system library and a licensing choice, so it stays undeclared, and the baseline now holds it alone, with the reason written beside it. fusion.rs has every one of its `use` lines behind `#[cfg(feature = "metal")]` while the items that need those types do not, so a default build loses the imports and keeps the code: 31 unresolved types. It only ever compiled with that feature on. The module is now gated the same way, as `gpu_ops` and the sana_wm draft already are. sana_wm_gpu_dispatchers_draft.rs is gated likewise: it imports `crate::hal::metal`, which is `#[cfg(feature = "metal")]`. Measured on the build host, with --keep-going so an early error cannot hide what is behind it: `cargo check` 0 errors, `cargo clippy --all-targets` 0 errors, 44 tests pass, the whole jouleclaw workspace still checks, and the orphan guard passes on the new baseline, its planted-orphan self-test included. ⚠️ Separately, and not from this change: `--features metal` does not compile on main at all -- 3063 errors, concentrated in files that were already declared (hunyuan3d.rs 300, audiogen.rs 269, trellis.rs 213). Measured on origin/main before this change, so it is pre-existing. No CI job builds that feature. Co-Authored-By: Claude Opus 5 --- .../jouleclaw-omni/src/inference/mod.rs | 32 +++++++++++++++++++ .../crates/jouleclaw-omni/src/runtime/mod.rs | 2 ++ .../crates/jouleclaw-omni/src/server/mod.rs | 3 ++ scripts/check-orphan-sources.py | 28 +++------------- 4 files changed, 41 insertions(+), 24 deletions(-) diff --git a/jouleclaw/jouleclaw-rs/crates/jouleclaw-omni/src/inference/mod.rs b/jouleclaw/jouleclaw-rs/crates/jouleclaw-omni/src/inference/mod.rs index dc67ab6e8..bd5214220 100644 --- a/jouleclaw/jouleclaw-rs/crates/jouleclaw-omni/src/inference/mod.rs +++ b/jouleclaw/jouleclaw-rs/crates/jouleclaw-omni/src/inference/mod.rs @@ -67,6 +67,15 @@ pub mod tokenizer; pub mod formats; #[cfg(feature = "metal")] pub mod gpu_ops; +// Declared 2026-10-17, as above. +pub mod expert_cache; +// Every `use` in fusion.rs is `#[cfg(feature = "metal")]` while the items that +// need them are not, so it only ever compiled with that feature on: gate the +// module the same way rather than leave 31 unresolved types in a default build. +#[cfg(feature = "metal")] +pub mod fusion; +pub mod gpv; + /// Model architecture implementations. pub mod architecture { pub mod unet; @@ -93,6 +102,29 @@ pub mod architecture { pub mod controlnet_forward; pub mod worldmirror_forward; pub mod sharp; + + // Declared 2026-10-17: these compiled unreferenced for want of a + // `mod` line, so nothing type-checked or linted them. Alphabetical. + pub mod bark; + pub mod canary; + pub mod chatterbox; + pub mod depth_anything; + pub mod esrgan; + pub mod fibo; + pub mod jamba; + pub mod kokoro; + pub mod mamba2; + pub mod mimo; + pub mod mochi; + pub mod moonshine; + pub mod nemotron; + pub mod parler_tts; + pub mod sam2; + pub mod sd3; + pub mod sesame_csm; + // `hal::metal` is behind the `metal` feature, so this is too. + #[cfg(feature = "metal")] + pub mod sana_wm_gpu_dispatchers_draft; } // Core engine diff --git a/jouleclaw/jouleclaw-rs/crates/jouleclaw-omni/src/runtime/mod.rs b/jouleclaw/jouleclaw-rs/crates/jouleclaw-omni/src/runtime/mod.rs index a01fa4ac0..6c3cd46fa 100644 --- a/jouleclaw/jouleclaw-rs/crates/jouleclaw-omni/src/runtime/mod.rs +++ b/jouleclaw/jouleclaw-rs/crates/jouleclaw-omni/src/runtime/mod.rs @@ -11,6 +11,8 @@ pub mod stream; mod scheduler; mod memory_manager; pub mod monitor; +// Declared 2026-10-17, as above. +pub mod energy; pub use executor::Executor; pub use stream::{StreamingOutput, StreamHandle, StreamSender, StreamBuilder}; diff --git a/jouleclaw/jouleclaw-rs/crates/jouleclaw-omni/src/server/mod.rs b/jouleclaw/jouleclaw-rs/crates/jouleclaw-omni/src/server/mod.rs index bc5a03a36..a58ffbea2 100644 --- a/jouleclaw/jouleclaw-rs/crates/jouleclaw-omni/src/server/mod.rs +++ b/jouleclaw/jouleclaw-rs/crates/jouleclaw-omni/src/server/mod.rs @@ -7,6 +7,9 @@ //! - Health checks and metrics pub mod model_fetch; +// Declared 2026-10-17, as above. +pub mod model_library; +pub mod worker; // `model_library` and `worker` are dev-only scaffolding; they reference // AppState fields and crates not present in this build. Re-enable when the // branch stabilises. diff --git a/scripts/check-orphan-sources.py b/scripts/check-orphan-sources.py index 49143bf55..2f3354881 100755 --- a/scripts/check-orphan-sources.py +++ b/scripts/check-orphan-sources.py @@ -55,31 +55,11 @@ import sys # a real meter with a per-rail liveness gate lives in `jouleclaw-energy`, and a # reader who wires this one in instead gets a fabricated figure. BASELINE = { - "jouleclaw/jouleclaw-rs/crates/jouleclaw-omni/src/inference/architecture/bark.rs", - "jouleclaw/jouleclaw-rs/crates/jouleclaw-omni/src/inference/architecture/canary.rs", - "jouleclaw/jouleclaw-rs/crates/jouleclaw-omni/src/inference/architecture/chatterbox.rs", - "jouleclaw/jouleclaw-rs/crates/jouleclaw-omni/src/inference/architecture/depth_anything.rs", - "jouleclaw/jouleclaw-rs/crates/jouleclaw-omni/src/inference/architecture/esrgan.rs", - "jouleclaw/jouleclaw-rs/crates/jouleclaw-omni/src/inference/architecture/fibo.rs", - "jouleclaw/jouleclaw-rs/crates/jouleclaw-omni/src/inference/architecture/jamba.rs", - "jouleclaw/jouleclaw-rs/crates/jouleclaw-omni/src/inference/architecture/kokoro.rs", - "jouleclaw/jouleclaw-rs/crates/jouleclaw-omni/src/inference/architecture/mamba2.rs", - "jouleclaw/jouleclaw-rs/crates/jouleclaw-omni/src/inference/architecture/mimo.rs", - "jouleclaw/jouleclaw-rs/crates/jouleclaw-omni/src/inference/architecture/mochi.rs", - "jouleclaw/jouleclaw-rs/crates/jouleclaw-omni/src/inference/architecture/moonshine.rs", - "jouleclaw/jouleclaw-rs/crates/jouleclaw-omni/src/inference/architecture/nemotron.rs", - "jouleclaw/jouleclaw-rs/crates/jouleclaw-omni/src/inference/architecture/parler_tts.rs", - "jouleclaw/jouleclaw-rs/crates/jouleclaw-omni/src/inference/architecture/sam2.rs", - "jouleclaw/jouleclaw-rs/crates/jouleclaw-omni/src/inference/architecture/sana_wm_gpu_dispatchers_draft.rs", - "jouleclaw/jouleclaw-rs/crates/jouleclaw-omni/src/inference/architecture/sd3.rs", - "jouleclaw/jouleclaw-rs/crates/jouleclaw-omni/src/inference/architecture/sesame_csm.rs", - "jouleclaw/jouleclaw-rs/crates/jouleclaw-omni/src/inference/expert_cache.rs", - "jouleclaw/jouleclaw-rs/crates/jouleclaw-omni/src/inference/fusion.rs", - "jouleclaw/jouleclaw-rs/crates/jouleclaw-omni/src/inference/gpv.rs", + # Wants an `ffmpeg_next` dependency it does not have + # (`extern crate ffmpeg_next` -> E0463): a system library and a licensing + # choice, so it stays undeclared until that is decided. Every other file + # that was here on 2026-10-17 is now declared and type-checked. "jouleclaw/jouleclaw-rs/crates/jouleclaw-omni/src/inference/video_decode.rs", - "jouleclaw/jouleclaw-rs/crates/jouleclaw-omni/src/runtime/energy.rs", - "jouleclaw/jouleclaw-rs/crates/jouleclaw-omni/src/server/model_library.rs", - "jouleclaw/jouleclaw-rs/crates/jouleclaw-omni/src/server/worker.rs", } ENTRY = {"lib", "main", "mod", "build"} -- 2.54.0 (Apple Git-157)