The Original serve host and its decode round no longer call the routed-expert pool through a trait object. OriginalServeHost and HostOwners take the pool as a type parameter, the serve step chooses the pool type once per request (the GPU share over the CPU pool, or the CPU pool alone) and runs one generic body over it, so every window group and every round is a direct call. The decode view is split so the pool can borrow the view's tier while the serve body uses the rest; the order of every call, the ownership of the pool until the teardown and the log lines are unchanged. The dyn-trait ratchet of leleka-engine-qwen35-cuda falls from 3 to 0 and the architecture baseline is regenerated.
- serve_over_pool.rs: ServeJob, ServeParts and the generic serve_over, with the host and env builders moved from decode_steps.rs
- decode_steps.rs: serve picks the pool type and hands over
- serve_request_step.rs, original_serve_host*: generic over the pool
PrefillLoans<'a, 'ctx, G: GdnGemm> and the GDN and MoE prefill stage functions take the loaned GEMM by type; prefill_profile::span takes the
Context itself (it was the only implementer of Drain). The same calls in the same order; static instead of dynamic dispatch.
Not run on a GPU: needs the laptop two-binary identity gate.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
scripts/dev/path_to_modules.py moves each module declared with #[path] to the file the compiler looks for without the attribute, moves the
children of a path-loaded file with it (such a file owns its directory like mod.rs) and rewrites include_str!/include_bytes! paths. Only the
two declarations that point into the crate's tests/ directory keep their attribute. No code changes: parent files lose attribute lines.
Gates that quote source paths follow: smoke-groups.json (directory patterns for runtime-gr/gdn/moe/qsa/ple/mtp; 7 real-model smokes now classify as
model-assets, 3 fallback smokes now sit in their runtime group), docs/gpu-bringup.md table, docs and the qsa oracle pin path.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The two baselined forbidden-dep violations are gone. FdMapping keeps the bounds checks and lock bookkeeping as safe Rust over plain addresses;
mmap/mlock/mincore/madvise/munmap/setrlimit are LinuxPageLocking, the Win32 host facts are WindowsProc, the glibc heap trim moved verbatim.
Governor::real is replaced by leleka_memory_os::real_governor (the page-locking adapter is part of it). No behaviour change.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
git mv of the files and of the module directories next to them, mod declarations, #[path] attributes and
the paths that name the modules, rewritten by scripts/dev/rename_mechanical.py from a reviewed name table.
Two files lost one to two lines so the 400-line limit holds again (qsa_prompt_index, original_verify_expert_probe).
limits-baseline.json: test fn_lines 0 -> 1 is --allow-increase for crates/deploy builtin_profiles.rs:149 (37 lines,
the speed-vs-strata session's file, not touched here); the prod params census falls 108 -> 1 (w_launch, extern C ABI).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
New L1 crate crates/cuda-model (leleka-cuda-model, forbid(unsafe_code), depends on leleka-context only) holds:
Error/Result with Display, DenseFormat, RoutedFormat, ProjectionKind (+ layout/alignment/required_modes), ProjectionSpec,
the Bf16/Q5K/Q6K projection shapes, bringup_trace_enabled, and the modules serving_context, host_profile, command_profile,
original_mtp_loader, original_prefill_schedule, qsa_prompt_attention_select, original_expert_slots, native_flash_attn,
s_gemv_legacy, device_arena, mmq_original_prefill_misc (moved with git mv; code unchanged apart from pub visibility and
#[inline] on the tiny cached-switch readers, host_profile::add split into an inlined gate and a cold body).
leleka-cuda-driver re-exports every item at its old path, so no use path in the driver, engine-qwen35-cuda or
native-parity-bench changes. Tests moved with their modules; they read the .cu sources and oracle fixtures of the driver
through driver_source!; the one loader test that needs the driver's session geometry stays in the driver.
Housekeeping: workspace members/default-members, Cargo.lock, architecture.json (L1), hexagonal.md, ci-coverage.json,
check-local.sh, port.yml, linux-tests/run.sh, AGENTS.md. architecture-baseline.json: the source ratchets of the moved code
change crate key (dyn-trait driver 56 to 49 + model 3, env-read 72 to 67 + 5, process-global 110 to 99 + 11), regenerated
with --allow-increase for the new keys only; per-pattern totals do not rise. limits-baseline.json is unchanged: no moved
function is over a limit.
OutputDecoder split into two types over the shared Bytes, so what one reading offers cannot be asked of the other:
LiveDecoder (raw_text, notes) and AtEndDecoder (notes, accepted_call_in_reasoning, split_text) replace the enum with its
mode-specific accessors that returned None or false in the wrong mode. TextCodec gets live_decoder and at_end_decoder.
LiveDecoder::finish now hands the Harmony tail to the reader, so a live reading of gpt-oss would lose nothing.
push and finish after the generation ended return a decode error. AtEndPlan.preview: the non-stream answer no longer runs
the reasoning previewer. The two expect calls of the buffered stream are a response.failed path (DECODER_GONE).
TokenDecoder, QwenDecoder, decode_all and TextCodec::decoder are gone (HarmonyDecoder has push and finish of its own;
its tests drive it directly). AtEndReader::finish is split: Generation::split (split.rs) cuts the bytes and counts the
tokens, the plan flush, the debug copy, the events and the answer reading are functions of their own; the rule 'an
answer has one text event, empty if nothing else' is ensure_text. Names: decode_lossy, convert_segments, build_item,
wrap_reasoning_delta, finish_generation, BufferedRun::build (one result, the initial events are a field).
drain_utf8 is private to the output module (its test reads through the live decoder). The </think> marker search and
hold-back live in think_marker.rs, used by the previewer, the at-end split and the reasoning budget.
Unit tests added: keep_raw/raw_text/split_text, the no-preview plan, finishing twice, a cut character at the end.
Proof: the golden recorded on 08afbf216 (130 cases, 260 captures) passes unchanged; strata-control lib 315 and
gateway-domain 32 tests pass; architecture-baseline.json tightened (dyn-trait gateway-domain 4 to 2, strata-control 12
to 11).
Removed: decode_generation_noted and DecodedGeneration (gateway-domain), decode_generation_with / decoded_items /
decode_generation (strata-control), ReasoningStream and the drain_utf8 copy (their code lives in output/). The test ids are
kept: reasoning_marker_and_unicode_split_at_every_byte and the unclosed-reasoning test now read through the output decoder,
the utf8 test calls the domain drain_utf8; two unit tests of the moved pieces are added to gateway-domain.
docs/architecture/output-event.md: how output flows for each family, every site that asked for the family (before and after),
the canonical type, the identity proof, the behaviours kept on purpose and what is not done and why; hexagonal.md and
tech-debt.md point to it. architecture-baseline.json tightened with --update-baseline (dyn-trait: gateway-domain 5 to 4,
strata-control 14 to 12; nothing raised).
docs/architecture/size-split-rest.md records the mapping of the 24 oversize files and the test-id parity (27 crates, 0
missing / 0 new / 0 outcome changes on Linux). render_request_with now delegates the template call to render_messages
(gateway-domain fn>30 16 -> 15, cx>10 13 -> 12). limits-allowlist.json gains 80 entries (owner STRA-338, reason "moved
verbatim ... not yet decomposed"); limits-baseline.json and architecture-baseline.json re-run with --update-baseline
(no total raised). Oversize files in the crates of this batch: 0.