110 Commits
Author SHA1 Message Date
Pavlo Ratushnyi 1259c38dcf Serve host: static dispatch over the expert pool instead of dyn OriginalServePool
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
2026-11-23 11:51:56 +01:00
Pavlo Ratushnyi af48f165a2 Merge branch 'claude/debt-hot-engine' into HEAD
# Conflicts:
#	architecture-baseline.json
2026-11-23 01:28:37 +01:00
Pavlo Ratushnyi f246cb9951 Merge branch 'claude/debt-hot-control' into HEAD
# Conflicts:
#	architecture-baseline.json
#	docs/architecture/tech-debt.md
2026-11-23 01:27:52 +01:00
Pavlo Ratushnyi decc5ffd18 Merge branch 'claude/debt-hot-low' into HEAD
# Conflicts:
#	architecture-baseline.json
#	architecture.json
#	docs/architecture/tech-debt.md
2026-11-23 01:27:17 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 2b75a037d2 hot path (not for main before the identity run): the prefill GEMM loan and the profile drain are generics, not trait objects (engine dyn 9 -> 3)
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>
2026-11-14 22:28:15 +01:00
Pavlo Ratushnyi 7df1a4b473 Merge main (engine stage 10) into claude/debt-rename; rename script rerun, old-names marker for the rename table, baseline regenerated 2026-11-14 22:17:24 +01:00
Pavlo Ratushnyi ed781797ed Merge main into claude/debt-rename; rename script rerun over what the engine and low-level branches added; baseline regenerated 2026-11-14 21:47:45 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 5b84cd2cf8 engine crates: dyn closures and sinks become generics (engine-core 18 -> 2, engine 53 -> 9 outside the Box<dyn Backend> process boundary), load laps on the Clock port, named exceptions for what must stay, real headers for the last generated ones
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-14 21:44:58 +01:00
Pavlo Ratushnyi 4d7ad096dd Merge main into claude/debt-hot-low 2026-11-14 21:42:40 +01:00
Pavlo Ratushnyi 9254bb3129 Merge main into claude/debt-engine 2026-11-14 21:23:57 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 f62f1762e2 engine crates: open_cache_steps split off open_phase_steps, rustfmt, engine-core without #[allow(unused_imports)], baselines lowered (glob 70 -> 0, allow 166 -> 0 in the engine, 18 -> 0 in engine-core)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-14 21:23:09 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 d027790278 cuda-driver and CPU expert pool (hot path, awaiting the identity gate): head_dispatch compiled once (shared module, no glob, no #[path]), copy_ring_layer split in two with explicit imports, measurement-timer comments, exceptions for the dyn, Instant::now and process-global sites that stay
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-14 21:20:07 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 dce1676baf cuda-driver (hot path, awaiting the identity gate): 22 OnceLock<bool> env switches become EnvSwitch entries of the settings catalogue; &dyn ArenaMap and &mut dyn Write parameters become generics
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-14 21:04:14 +01:00
Pavlo Ratushnyi 1f917f3714 Merge claude/debt-rename into claude/debt-hot-control, baseline regenerated 2026-11-14 20:56:30 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 a3ad1e2380 tech-debt.md (f): the Strata names of our own code (stage 9), baseline key order
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-14 20:51:14 +01:00
Pavlo Ratushnyi da9e4367ae Merge main into claude/debt-rename 2026-11-14 20:36:02 +01:00
Pavlo Ratushnyi 94592f4fa0 wip: rename strata-next/strata-control/strata-desktop-core (to be squashed in the final rename commit) 2026-11-14 20:30:41 +01:00
Pavlo Ratushnyi 03ea6b1f16 Merge main into claude/debt-low (npu-service: keeps the other agent's env_settings.rs; exceptions and baseline merged) 2026-11-14 20:21:02 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 96b947248c Low-level crates: dyn and Instant::now reduced to named exceptions (port boundaries, measurement timers with a comment), generics for the callbacks, memory settings reader; baseline lowered
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-14 20:10:43 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 a354533a85 Low-level crates: the process environment is read in one settings module per crate (typed values for cpu-worker, tokenizer, gptoss-npu, gpu-npu-worker, igpu, npu-service, memory, gptoss, model-format), named exceptions for readers that must stay; baseline lowered
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-14 19:59:23 +01:00
Pavlo Ratushnyi 8fe23f043f Merge branch 'main' into claude/debt-control 2026-11-14 19:40:25 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 5bda5596a2 Architecture gate: exceptions for the readers, ports, adapters and singletons of the control side, baseline lowered; explicit_imports.py FORCE_FILES, wsl-cargo.sh debug=0
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-14 19:40:21 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 623f9a015f Low-level crates: #[path] modules become ordinary modules (cuda-driver 118 -> 0 counted, model-format 12 -> 0, native-cpu-expert 2 -> 0; 500 files moved to the place their module name gives); gate: a cfg(test) mod declaration with #[path] is test code; ptx! macro for the sealed assets table
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-14 19:38:37 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 ec39c481ff engine-qwen35-cuda: #[path] modules become ordinary modules (397 files moved to the place their module name gives; path-include 100 -> 1)
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>
2026-11-14 18:51:54 +01:00
Pavlo Ratushnyi fd64c607e4 Merge main (claude/arch-names-high) into claude/arch-names-low: keep the other side's names where both renamed (context rope setup, experimental-ref cvec reading), both tool families (explicit_imports_lowlevel.py, rename_module_map.py next to theirs), regenerated baseline 2026-11-14 18:06:15 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 7557dcb0f9 Limits and architecture baseline: width fixes, copy_ring_layer stays a glob at the line limit, baselines lowered (glob-super-import 674 -> 3, allow-unused-imports 1097 -> 552, env-read 122 -> 28 in the low-level crates)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-14 17:46:15 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 3498bab1c6 Explicit imports: desktop-core binary root; debt register numbers
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-14 15:30:42 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 c0c6b6f2f1 Explicit imports in the engine crate (tool-verified per round; full check pending), two at-the-limit files stay globs, baselines lowered
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-14 14:32:11 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 e03bedc3b1 Debt rework: doc headers everywhere, two import ratchets with the baseline, process-global counts uses and not import lists, 400-line fixes, docs
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-13 19:48:44 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 51b45b82d8 leleka-memory loses libc and windows-sys: PageLocking and ProcSource ports, OS adapters in the new L3 crate leleka-memory-os
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>
2026-11-13 17:46:38 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 0ac612d2df CPU expert pool: per-phase thread timers behind LELEKA_POOL_TIMING=layers (wake, last, busy, tasks, task times) and a pool-layer engine-log line per layer window; offline report script; instant-now baseline lowered 30 -> 27
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-12 16:45:16 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 781f2afb97 chore: tighten architecture baseline after merging the three lines
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 01:20:35 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 b686f6ab75 STRA-338: rename the 854 mechanically named modules (impl_*, *_fn, *_<N>) after what they hold; mechanical_names census 854 -> 0
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>
2026-11-08 13:43:56 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 8f38a5fc91 STRA-338 params: split three files over 400 lines, regenerate architecture and limits baselines (params census 1149 -> 108)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 03:31:21 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 ac60df040f STRA-338: architecture gate forbids new mechanical file names (impl_*, *_fn, numbered), baseline lists the 964 existing; rustsplit names modules after what they hold
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 00:50:17 +01:00
Pavlo Ratushnyi 40896ba217 STRA-338 S24: peel the pure host-side models out of cuda-driver into leleka-cuda-model
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.
2026-11-07 17:40:24 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 34a454ffe1 STRA-338: libc-shim keeps its process-global count (statics stay function-local); baselines tightened
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 09:52:53 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 4293f419a9 Merge origin/claude/hexagonal-size-gw into claude/size4-g (allowlist merged by key)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 09:22:00 +01:00
Pavlo Ratushnyi 34c7f74e25 Merge remote-tracking branch 'origin/claude/hexagonal-integ' into claude/hexagonal-s23 2026-11-06 23:37:56 +01:00
Pavlo Ratushnyi 2d25958e42 STRA-338 size2: merge of the 14 function-size slices; seven files over 400 lines split again, baselines regenerated (dyn-trait ratchet raised by helper parameters that repeat an existing &dyn seam, allowlist gets the legacy functions the splitter moved) 2026-11-06 23:36:21 +01:00
Pavlo Ratushnyi bacae2b062 STRA-338 S23: LiveDecoder and AtEndDecoder, one generation ends once, no preview work when nobody watches
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).
2026-11-06 22:27:06 +01:00
Pavlo Ratushnyi 8ade00af06 Merge branch 'claude/hexagonal-integ' into claude/hexagonal-size-gw 2026-11-06 22:14:54 +01:00
Pavlo Ratushnyi f1723b582d STRA-338 size-fn2: allowlist 133 -> 1 entry, baselines tightened, cpu-sys attention test helpers moved to tests/attention/kernel_checks.rs (file back under 400 lines, test ids unchanged), size-fn record of pass 2
Census of these crates: production fn>30 17 -> 2 (igpu gemm WGSL, OpenVino::load FFI table), cx>10 11 -> 0, wide 449 -> 38
(33 USAGE lines of the deploy --help text, 5 WGSL lines); test fn>30 122 -> 0, cx>10 3 -> 0, nesting>4 4 -> 0, wide 150 -> 0.
2026-11-06 21:52:37 +01:00
Pavlo Ratushnyi 8b5d5cb281 STRA-338 S23: remove the readers OutputDecoder replaced, move their tests, document the output flow
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).
2026-11-06 21:18:35 +01:00
Pavlo Ratushnyi b8765786b7 STRA-338 size-fn: fetch_steps within the limits, allowlist 429 -> 133 entries (fixed functions dropped, 18 unfinished desktop-core functions recorded), baselines tightened, size-fn record 2026-11-06 19:16:24 +01:00
Pavlo Ratushnyi a9ec61606a STRA-338 size: baselines after merging engine a-m round three 2026-11-06 17:11:49 +01:00
Pavlo Ratushnyi 5e6e440faf STRA-338 size: backend-api lib.rs split (756 -> 338): the repo has no .rs file over 400 lines; baselines tightened 2026-11-06 17:10:34 +01:00
Pavlo Ratushnyi 0c594d351f STRA-338 size-rest: split record, render_request_with entry within 30 lines, allowlist of functions moved verbatim, baselines re-run
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.
2026-11-06 16:33:36 +01:00
Pavlo Ratushnyi 2ae8d47a00 Merge branch 'claude/size-eng-nz2' into claude/hexagonal-integ 2026-11-06 16:10:41 +01:00
Pavlo Ratushnyi 25d5066d66 STRA-338 size: engine generate_mtp tile_parts split, wide lines wrapped, baselines tightened 2026-11-06 16:10:17 +01:00