Skip to content

Split qwen3_ssm/trait_layer.rs below the 500-LoC cap #18

Closed

Description

@andrew-vogulkin

Tracking issue required by the file-size-cap allow-list policy (added in PR #17).

crates/spark-model/src/layers/qwen3_ssm/trait_layer.rs is 670 LoC on feat/qwen4exp-serve. It is the single impl TransformerLayer for Qwen3SsmLayer block: every method body already lives in a trait_*.rs sibling as an *_inner fn, so the remaining LoC is trait-mandated signatures plus one-call delegation — and Rust does not allow one trait impl to span files.

Candidate reductions when someone owns this properly:

  • collapse multi-line arg-forwarding via a macro (delegate!-style) — saves ~150 LoC but hides signatures;
  • narrow the TransformerLayer trait itself (the tracked follow-up on traits/model.rs / transformer_layer.rs — same disease, same cure): pulling the SSM-prefill-phase methods into a sibling supertrait would let this impl split legitimately.

🤖 Generated with Claude Code

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions