dsfb_gpu_debug_demo/lib.rs
1//! Library target for `dsfb-gpu-debug-demo`.
2//!
3//! WHY THIS LIB EXISTS (for the future engineer reading cold):
4//!
5//! The demo crate is primarily a bin (`dsfb-gpu-debug` at
6//! `src/main.rs`), but the `cli::ingest` module — which parses the
7//! `# residual-projection v2` TSV format and lowers cells into
8//! deterministic `TraceEvent[]` — is useful from integration
9//! tests too (the S-REAL saturation bench needs to feed real TSV
10//! events into the same dispatcher path S-PERF.16.a measures).
11//!
12//! Rust's integration-test target (under `tests/`) can only import
13//! public items from a CRATE LIBRARY, not from a `[[bin]]`. So we
14//! expose `cli` as a library here; `main.rs` consumes it via
15//! `use dsfb_gpu_debug_demo::cli;`. The bin and the lib share the
16//! same source tree under `src/`; only the entry shape differs.
17//!
18//! Nothing else changes — every cli subcommand's existing logic
19//! continues to live in `src/cli/*.rs`, and the only consumer
20//! today (besides main.rs) is `tests/s_real_saturation_bench.rs`.
21//!
22//! Clippy posture: the cli modules below are bin-style helpers
23//! (process-exit consumers, one-shot fixture-failure unwraps in
24//! their inline test scaffolding). Exposing them as a library
25//! surfaces lints that are appropriate for library APIs but not
26//! for bin-style code. The allows below restore the bin posture:
27//!
28//! - `must_use_candidate`: cli subcommand entrypoints return
29//! `ExitCode`/`u8` that the bin always consumes; the cli
30//! helpers return scalars the bin always reads. Annotating
31//! ~20 helpers with `#[must_use]` is noise without callers
32//! that would benefit from the warning.
33//! - `expect_used` / `unwrap_used`: only the inline `#[cfg(test)]`
34//! scaffolding in cli modules uses them, and only on
35//! panic-on-fixture-failure paths where a loud abort is the
36//! correct test posture.
37
38#![allow(
39 clippy::must_use_candidate,
40 clippy::expect_used,
41 clippy::unwrap_used,
42 // The cli modules are bin-style helpers; pub-item docs are
43 // not required because no external library consumer reads
44 // them (the only library consumer is the in-tree integration
45 // test). Forcing them would either require ~100 single-line
46 // doc comments on bin-style fields or a wide rustdoc-noise
47 // pass; neither matches the panel-locked "lib is a delivery
48 // vehicle for the integration test, not a public surface"
49 // posture stated above.
50 missing_docs
51)]
52
53pub mod cli;