Commit Graph
11 Commits
Author SHA1 Message Date
Pavlo Ratushnyi a3a63a0ec0 STRA-338 size: model-format: row read tests split into phase helpers, baseline follows (test width 727->716) 2026-11-06 14:33:13 +01:00
Pavlo Ratushnyi 4ca6f9b65d STRA-338 size: model-format: kar row read tests in their own file (kar.rs 411->255 lines), generic closures instead of dyn 2026-11-06 14:21:34 +01:00
Pavlo Ratushnyi c49205423f STRA-338 size: model-format: wrap long comments and format strings to 120 columns (width 69->0) 2026-11-06 14:19:05 +01:00
Pavlo Ratushnyi d2e94e255c STRA-338 size: model-format: ple reader open/issue/collect/run and bulk read setup split into helpers (fn_lines 72->30, complexity 15->10) 2026-11-06 14:12:33 +01:00
Pavlo Ratushnyi cdfec56460 STRA-338 size: the engine crates are rustfmt-clean at 120 columns (per-crate rustfmt.toml: max_width 120, Max heuristics); width violations 6869 -> 2862 prod, 1273 -> 717 test; files that grew are re-split. Reasons for the raised census numbers: fn_lines +119 and complexity +14 are functions that cross 30 lines / 10 branches only because rustfmt put their one-line bodies on several lines (nothing was added); test lists identical (1793), 800 tests pass, the same 5 known failures; bring-up print gate lookback 20 -> 30 lines for the same reason 2026-11-06 13:03:51 +01:00
Pavlo Ratushnyi adf65a53b9 STRA-338 size: 28 oversize test files of the engine crates split by topic with scripts/dev/split_tests.py (tests keep their names, gain a topic module; 1793 tests listed before and after, same leaf names; baseline tightened: 121 -> 98 oversize files) 2026-11-06 12:41:45 +01:00
Pavlo Ratushnyi 6b5fcd242e STRA-338 S12b: fns and impl blocks of 59 cold oversize modules move into child modules (model-format, gateway, desktop-core, leaf libraries)
scripts/dev/split_module.py (lexer-based, with 16 self-tests) moves the top-level fn and impl items of 59 oversize module files in control-plane, desktop-core, model-format, gateway-text, leleka-memory, experimental-ref, context, serving-policy, tokenizer, backend-api, quant-core, harmony, igpu, libc-shim, npu-service and runtime-client into foo/<name>.rs groups of about 250 lines; types, constants, macros, nested modules and tests stay, every path stays valid through pub use re-exports, restricted visibilities keep their scope one level down, include paths and super:: paths are shifted. Not touched: leleka-runtime, cuda-driver, native-cpu-expert, sampler-ref and cpu-* (hot path, next wave) and the files kar-off-ab edits.

The baseline drops from 311 to 263 oversize files and from 273,600 to about 233,000 lines; the path-include ratchet ignores dir/name.rs child declarations.
2026-11-05 15:29:39 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 03e891cd72 ple_reader: a source that panics is a failed read, not a ticket that waits for ever
The failed-read path of the reader itself already releases every ticket (upstream ebe3383a does not apply: the worker keeps running, issue after a failure queues nothing, collect reports the error), now pinned by tests with several tickets in flight at io_threads 0/1/2/default. The one remaining way to leave a ticket pending was a panic in PageSource::read_at: the worker thread died with the job's ticket still counted and the caller's collect blocked for ever. run() now turns a panic into the same sticky read error.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 03:34:19 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 c159a7fdee Tests: PLE rows are matched by row, never by position (plan 0.4; upstream 36381540)
Upstream's gather_batch compared its prefetch list with the batch by position and re-read reordered or duplicated rows. Our reader
has no such matching (tickets own their output slots, the row cache and the KAR GPU cache are keyed by row id); the tests pin it with
the upstream cases and with chunks that are permuted, shifted, repeated or partly new.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-26 17:11:24 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 b3bd6a0936 feat(runtime): read the 16 PLE rows of a token through the async reader
Issue the rows before the embedding read, collect before layer 1, decode
exactly as ple_row does. Reader opens lazily with the original defaults
(1M-row cache, 64 in flight, SSD keep-alive), an O_DIRECT handle on Linux
accepted only after an inode check and aligned probe read, and falls back
to the synchronous path when unavailable. Invalid LELEKA_PLE_* values are
refused.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:34:05 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 195b0a99af feat(model-format): add async PLE row reader with page dedup and row cache
Port of ngram/ple_reader: issue/collect tickets, 4 KiB page dedup and
offset-sorted reads over positional reads and worker threads, 8-way
round-robin row cache, sticky errors, injected delay, keep-alive.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:30:18 +02:00