Files
Strata/engine/include
Saatvik Viniak bd90b8c526 drafting: a run config's own DFlash2 pack and tap; --draft-tap block-input
A run config may now name its own DFlash2 drafter instead of the pinned
incoai/Flash-Next packs: "draft_model": "<path>", or
"dflash2": {"pack": ..., "family": ..., "tap": "block-input"}.

- supported_model() takes a config-named pack and lifts the model-family
  gate for that config only; pack_ready()/drafter_ready() check that exact
  file (a whole DF2P v1 pack: magic, version, an index whose tensors lie
  inside the file, and its own size + SHA-256 kept in a .ok marker); nothing
  is fetched, tuned, converted or replaced for it.  Decision.pack reaches
  decide()/apply() and an explicit --draft-model in user_args is the same
  assertion.  A config without the keys keeps the pinned flow byte-identical.
- "tap": "block-input" (or "draft_tap") adds the engine's new
  --draft-tap block-input.  The pinned packs read each target layer's
  completed output (mean of the hc streams); the RadixArk/Qwen4-DFlash2
  checkpoint and SGLang's DFLASH taps read the NEXT layer's input, after the
  hyper-connection mix and per-stream norm, before attention (vLLM captures
  it at layer+1).
- engine: core/tap_plan.hpp maps a pack's target ids to the tapped layer for
  both styles (count, per-stage share of a layer split, slot0), with a
  CPU-only test.  Verifier::set_taps(layers, block_input) captures the block
  input from the window's mixed buffer in pre() and keeps the completed-output
  tap unchanged in post(); generate.cpp parses --draft-tap output|block-input,
  refuses block-input on Metal (its window writes output taps), and ends a
  start whose pack cannot be served in block-input style rather than let the
  drafter read a short tap row.  Default unchanged.

Tests: terminal/tests/terminal/test_drafting_custom_pack.py (new),
test_drafting_pin.py now uses a whole DF2P pack, engine tap_plan_test.
Engine built with -DCMAKE_CUDA_ARCHITECTURES=70 -DSTRATA_GEOMETRY=q4_lite
(sm_70, CUDA 12.6).
2026-12-04 00:39:17 -06:00
..