Skip to content

flashkern backbone/prefill/Depthformer: finish FIFO leaves and remove pass-time fallback #174

Description

@sydneyrenee

Problem

Backbone decode has the healthiest Flashkern stage topology, but it still bypasses assembly for byte movement and depends on intrinsics debt. Prefill contains a full C++ numerical FIR stage and pass-time scalar selection. Depthformer has correct cooperative phase advancement but chains nineteen phases through broad planes.

Decode debt

  • C++ K/V cache append in ST_AT_PREP;
  • C++ hidden-plane zeroing for audio embedding;
  • attention, RMSNorm, activation, add, and conversions remain in architecture intrinsics TUs;
  • AArch64 has assembly RNE GEMV leaves while x86_64 uses C++ intrinsics despite the assembly TU claiming no twin is needed.

Prefill debt

  • prefill_conv_fir_stage implements FIR, gate, carry recurrence, and BF16 rounding in C++;
  • prefill_linear/run_gemm can select scalar GEMM per pass when SIMD is unavailable;
  • this fallback is linked into the product archive instead of failing readiness.

Depthformer debt

  • nineteen generations materialize QKV, K/V, attention, FFN, logits, and projection planes;
  • V append uses C++ memcpy;
  • projection bands use C++ std::fill;
  • phase boundaries follow plane boundaries rather than per-codebook register liveness.

Required work

  1. Replace decode K/V publication and plane clearing with assembly destination leaves.
  2. Provide paired AArch64/x86_64 implementations for every mounted decode leaf.
  3. Move prefill FIR/gate/carry/rounding into a fused row-group assembly leaf preserving causal order.
  4. Resolve ISA specialization once at readiness; remove all pass-time scalar fallback.
  5. Re-cut Depthformer around per-codebook row-owned chains:
    • norm → projection → mixer → residual;
    • FFN norm → gate/up → activation → down → residual;
    • logits → cooperative sampler → direct feedback embedding.
  6. Materialize only persistent KV/recurrence, true collective partials, or fan-out values.
  7. Preserve exact KV, ShortConv, cursor, sampler, PRNG, and codebook update order.

Acceptance

  • No C++ numerical loop, payload copy/fill, or pass-time ISA branch remains in these paths.
  • Unsupported ISA/configuration fails before model readiness.
  • AArch64 and x86_64 use paired assembly semantics.
  • Prefill and decode produce identical hidden/logit/state traces.
  • Depthformer full layer/codebook/code traces pass.
  • Consecutive turns preserve KV/ShortConv/PRNG/cursor exactly.
  • No post-readiness allocation or weight materialization.
  • Real-checkpoint typed, audio, retained-context, and audio-only gates pass.

Related

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