Problem
pegainfer-qwen3/src/lib.rs unconditionally exports pub mod kernel_bench, making a report-only harness part of the production library API.
At 69c4e149, src/kernel_bench.rs is 1,505 lines with 55 functions and roughly 68 public items spanning decode attention, batched and single prefill attention, dense operators, L2 cache clearing, device bandwidth, and cuBLASLt tuning.
The consumers are the two kernel-report feature-gated binaries:
qwen3_kernel_report
qwen3_model_report
Production Qwen3 users do not need this API. A core CSR builder is also re-exported through kernel_bench even though the model report can import it from pegainfer_core directly.
Direction
Make the report harness bin-owned and private. Remove the library-level public surface instead of preserving it through a compatibility wrapper.
A shared private report-support module can be included by both binaries. Split it by cohesive benchmark domain where that reduces the amount of code a maintainer must understand; avoid thin files that only forward names.
Acceptance criteria
pegainfer-qwen3 no longer exposes pub mod kernel_bench.
- The normal library build does not compile report-only benchmark harness code.
qwen3_kernel_report and qwen3_model_report still compile under kernel-report.
- The model report imports shared production primitives such as
build_split_kv_csr from their owning crate rather than through a report re-export.
- Report-only types and helpers are private to the binary targets.
- The existing report CLI flags and output schemas are unchanged.
- Qwen3 all-target check and Clippy pass with
kernel-report enabled.
- No performance claim is required; this issue changes ownership and public surface only.
Do not add a new public report-support crate unless a third independent consumer establishes that boundary.
Contributor guardrails
- The PR description must show the public surface before and after, list the two real consumers, and explain where each moved domain is now owned.
- Do not leave a deprecated/public compatibility module, add a public report-support crate, or replace the module with re-export wrappers.
- Do not duplicate the 1,505-line harness into both binaries. Shared code stays in one private bin-owned module.
- Do not add source-grep, string-count, or module-existence tests. Compiling the two real binaries and the production library is the relevant integration evidence.
- Do not change report schemas, CLI behavior, benchmark cases, numeric policy, or kernel selection. Such changes need separate motivation and measurement.
- Include exact
cargo check and Clippy commands/results for the production library and both kernel-report binaries. Unrelated cleanup is out of scope.
Problem
pegainfer-qwen3/src/lib.rsunconditionally exportspub mod kernel_bench, making a report-only harness part of the production library API.At
69c4e149,src/kernel_bench.rsis 1,505 lines with 55 functions and roughly 68 public items spanning decode attention, batched and single prefill attention, dense operators, L2 cache clearing, device bandwidth, and cuBLASLt tuning.The consumers are the two
kernel-reportfeature-gated binaries:qwen3_kernel_reportqwen3_model_reportProduction Qwen3 users do not need this API. A core CSR builder is also re-exported through
kernel_bencheven though the model report can import it frompegainfer_coredirectly.Direction
Make the report harness bin-owned and private. Remove the library-level public surface instead of preserving it through a compatibility wrapper.
A shared private report-support module can be included by both binaries. Split it by cohesive benchmark domain where that reduces the amount of code a maintainer must understand; avoid thin files that only forward names.
Acceptance criteria
pegainfer-qwen3no longer exposespub mod kernel_bench.qwen3_kernel_reportandqwen3_model_reportstill compile underkernel-report.build_split_kv_csrfrom their owning crate rather than through a report re-export.kernel-reportenabled.Do not add a new public report-support crate unless a third independent consumer establishes that boundary.
Contributor guardrails
cargo checkand Clippy commands/results for the production library and bothkernel-reportbinaries. Unrelated cleanup is out of scope.