Commit Graph
569 Commits
Author SHA1 Message Date
Pavlo Ratushnyi f51d2d2e8b docs+scripts(memory): leak soak jobs and offline slope fit (queued) 2026-10-23 19:39:39 +02:00
Pavlo Ratushnyi e70a05b9d1 docs(memory): job 914 results, CRM session analysis, leak jobs 2026-10-23 16:20:54 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 904ac58d3a fix(cuda-driver): fence the staged residual rows (cuStreamSynchronize(0)) before the draft graph reads them; budget: reserve 2 GiB, admit floor soft+reserve, resident fixed footprint measured, plan-vs-actual check; leak scenario, slope fit, heap stats
- stage_first_residual_direct: cuMemcpy D2D is ordered on the legacy stream only; the draft graph runs on a non-blocking stream. The copies are now followed by a legacy-stream
  synchronize (not a context synchronize). Model-free ordering tests.
- memory budget from the real Codex CRM session (e2e job 945): plan constant for the resident bank corrected (+1.1 GiB), reserve 2 GiB, prefix insertions stop at soft+reserve,
  note_post_load compares the plan with the host after the stack opened.
- smoke: leak scenario (30 s RSS anon/file/shmem, meminfo, VRAM, prefix store, mallinfo2) with OLS and Theil-Sen slopes; LELEKA_MEMORY_NO_TRIM A/B knob.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-23 16:17:44 +02:00
Pavlo Ratushnyi 4f7c4618d3 Merge branch 'claude/quality-gate' into claude/port-gpu-bringup 2026-10-18 05:30:48 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 f779694a77 docs: pointer from model-assets to the quality gate; pending jobs noted
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 05:30:29 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 71320722f2 chore: lockfile entry for leleka-memory after the merges
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 05:09:56 +02:00
Pavlo Ratushnyi 0790ba6ec9 Merge branch 'claude/memory-safety' into claude/port-gpu-bringup 2026-10-18 05:09:13 +02:00
Pavlo Ratushnyi 7b17d50bdc docs(memory): queued job 914 2026-10-18 05:08:21 +02:00
Pavlo Ratushnyi 8896b458b4 docs(memory): inventory, tests and laptop results; soak session length bounded by the context 2026-10-18 04:47:02 +02:00
Pavlo Ratushnyi 55fdf1635f Merge branch 'claude/e2e' into claude/port-gpu-bringup 2026-10-18 04:38:38 +02:00
Pavlo Ratushnyi 6389188d7a e2e: job 943b 2026-10-18 04:38:06 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 505f3ee70f fix(runtime): output cap 4096 -> 32768 (one shared constant); /v1/status omits a null prefix_cache
The Codex tic-tac-toe run (job 943) ended after 4 minutes: the model wrote the whole index.html in one tool call, hit the
runtime's 4096-token output cap three times (tool call unterminated -> response.failed 'tool parameter is incomplete', then
'incomplete: max_output_tokens' -> turn.failed -> Codex exit 1). The Original server has no such cap (max_tokens 0 = the rest
of the context). RuntimeServer, the engine request check, strata-next's runtime default, the leleka-deploy generated config
and the examples now use leleka_backend_api::MAX_OUTPUT_TOKENS = 32768. /v1/status keeps the Python server's key set when no
prefix cache exists (http_surface golden regressed with the prefix-cache merge).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 04:36:37 +02:00
Pavlo Ratushnyi 4f796d2d80 docs(memory): knobs and mapped-bank reserve 2026-10-18 04:08:27 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 f53d54d122 test(control-plane): http_surface golden ignores the Rust-only status keys prefix_cache and memory; docs results
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 04:04:37 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 82d7734dde test(memory): reader scenario decodes a fixed number of tokens and lasts until the reader has streamed its volume
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 03:57:43 +02:00
Pavlo Ratushnyi d20c2a67af chore(memory): shed2 job script 2026-10-18 03:55:05 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 e345a7fe56 test(memory): shed smoke re-centres the floors before the recovery phase
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 03:50:33 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 cbb7b5392c test(quality): retrieval section of the analysis
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 03:27:03 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 faa572bd1e docs(quality): quality gate result, envelope, tolerances, verdicts
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 03:26:37 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 052a2fcc22 feat(memory): reserve the hot part of a file-mapped expert bank out of the elastic budget; measured fixed-footprint constant
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 03:12:02 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 157887eed9 docs: LF endings, staging hazards, layer layout fix
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 02:49:11 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 4effc72ad5 docs: roofline model (measured 5090 ceilings, per-step tables) and schedule design; microbench h2d2
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 02:48:00 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 1255374c2a fix(memory): PSI only counts while available memory is below 3x the soft floor (a page-cache reader raised PSI full to 5.2% with 68 GiB free in job 910)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 02:42:00 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 e4f4e1e9a9 fix(control-plane): chat completions keeps Retry-After on a memory_pressure 503; gate test covers chat and messages
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 02:35:27 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 0b10800141 fix(control-plane): memory_view test deadlocked on its own read guard
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 02:33:29 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 51c82250f1 feat(memory): inventory totals separate file-mapped bytes from RAM; swap-out and PSI thresholds are tunable (LELEKA_MEMORY_SWAPOUT_PAGES_PER_S, _PSI_SOME_SHED, _PSI_FULL_REJECT)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 02:19:52 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 97227d8c8e fix(serve): the Original serve path stops on <|endoftext|> as the Original does; quality-gate retrieval and ladder jobs
generate.cpp stops on {248044, 248046}; the GGUF eos_token_id is only 248046, so the port ran on
past an <|endoftext|> (up to max_new, emitting <|im_start|> loops). The stop set is now the model's EOS
plus <|endoftext|> in the serve backend, the smokes and the laptop probe.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 02:12:54 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 3c41ee0646 tools/microbench: model-free roofline microbenchmarks, offline model, holder jobs; docs/schedule-design.md draft
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 02:05:18 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 c38042e8e3 chore(memory): job scripts and laptop runner under scripts/memory
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 02:03:09 +02:00
Pavlo Ratushnyi ed389d4de8 Merge branch 'claude/memory-safety-unsafe' into claude/memory-safety 2026-10-18 02:03:00 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 6413c9a3dd docs(memory-safety): unsafe and host-buffer lifetime review
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 02:01:05 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 95475335be docs(native-cpu-expert): SAFETY invariants, bounds asserts at the unsafe leaves, pool lifecycle tests
Documents the epoch-claim protocol behind the Shared Send/Sync impls, adds row-length, destination and alignment
asserts at the SIMD leaves and quantize_raw/float_dot/convert_bf16, and tests pool Drop joining and idle-gap stability.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 02:01:05 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 218afcda94 docs(cuda-driver): SAFETY invariants for FFI, mapped-host owners, file maps; checked_add in index import; audit tests
Comments only, plus: CUDA_MEMCPY2D layout asserts, checked_add in OriginalQsaResidentIndex::import span validation,
and model-free tests (mapped_audit_*, Records bounds, stager copy-job and file-map bounds, arena bounds, resident
span bounds after truncation).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 02:01:05 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 74f4ee07dd fix(cuda-driver): fence the cuMemsetD8 of the full-forward scratch before the first launch
cuMemsetD8_v2 is asynchronous with respect to the host and only ordered on the legacy default stream; the original=false
construction path had no later synchronous copy, so a kernel on a non-blocking stream could race the zeroing.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 02:01:04 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 3d9af8a0eb fix(cuda-driver): store-buffering races in the expert stager stop and MMQ host-stage finish, bound host-stage wait
stop/finish stored 'head' then loaded 'active' while a worker raised 'active' then claimed from 'head'; on x86 the
fence could return while a worker still copied from a source the caller then released. SeqCst on the four accesses.
HostStage::finish also let a helper waiting on 'released' overwrite a ring buffer still being read (re-check head after
the wait), and wait() now refuses a length beyond the bytes the job copied (page-locked buffers are uninitialised).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 02:01:04 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 0af0bfaed4 feat(memory): return evicted heap to the OS after a shed, planned-vs-measured column in the inventory table, docs draft
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 01:57:55 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 b3f2e85ea9 test(memory): prefix serve shed/restore and a churn test under random shed directives (exact resumes, store inside its budget)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 01:53:11 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 713235d8ed feat(memory): residency guard on its own thread, read-only remap of the archive, dead-sampler recovery, cgroup v1, swap A/B tool, lint fixes
- guard_archive maps a private read-only reopen of the descriptor (a write-sealed memfd refuses a shared mapping that could become writable on
  kernels up to 5.15); the residency read runs on its own thread; the sampler survives a panic and a stale level is re-evaluated by the
  requests themselves; cgroup v1 memory controller limits (WSL2 hybrid, old container hosts) are honoured.
- examples/swap_ab + scripts/memory/swap_ab.sh: A/B (unlocked, heal, mlock) of the memfd under real pressure fenced into one cgroup.
- Miri: procfs/host/plan/pressure/inventory/census/ledger/governor run clean (61 tests).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 01:51:29 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 eead818051 feat(memory): real-model memory smoke (inventory, soak, shed, reader), deploy profiles carry the memory budget
- backend_original_serve_memory_smoke.rs: scenarios inventory / soak / shed / reader and a model-free archive guard probe; floors
  moved next to the memory the host has now so the shed path runs far from the real limit; abort guard at 15 GiB.
- Governor::set_floors; stack prefix_bytes / prefix_budget_bytes accessors.
- leleka-deploy: Profile.memory (prefix_cache_mib, floors, reserve, share, lock, heal, resident budget) -> engine args and
  LELEKA_MEMORY_* environment; built-in profiles carry it; tests.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 01:40:43 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 5ebd939b6f feat(memory): wire the governor into the runtime, the gRPC status and the control plane
- leleka-runtime: memory_governor glue (startup plan with refusal, KAR memfd lock/residency guard, VRAM check, load-ledger stages,
  inventory classes), prefix budget from the governor (auto/explicit clamped), shed directive applied per request and per prefill chunk,
  engine-side admission (503 memory_pressure text), page-cache release of the shards after the resident bank load, cgroup-aware
  available_memory.
- backend-api: Backend::memory_report (default None) and ScriptedEngine support; proto Snapshot.memory_json; desktop-core runtime_rpc and
  runtime-client carry it.
- control-plane: MemoryView, /v1/status `memory`, /metrics `memory`, 503 memory_pressure + Retry-After gate before queueing, engine-side
  refusal text mapped to the same 503; tests incl. a 600-request model-free soak (threads/fds/RSS flat).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 01:33:34 +02:00
Pavlo Ratushnyi 0e7e621cfe e2e: CRM prompt phase 2 (long refactor-and-extend) and replay job template 2026-10-18 01:28:54 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 2ecfd42001 e2e: engine request capture (LELEKA_CAPTURE_DIR), offline replay smoke, session analysis headline, CUPTI trigger helper
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 01:28:02 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 7da6a63e61 feat(memory): leleka-memory crate: procfs/cgroup/PSI facts, inventory, load ledger, budget planner, pressure monitor, governor, memfd lock/residency guard, census
Model-free and CUDA-free. 64 unit tests (parsers, planner refusals with numbers, shed order and hysteresis, admission, sampler thread,
mlock/mincore/madvise over a descriptor, flatness check).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 01:20:21 +02:00
Pavlo Ratushnyi 50cd95fdbb e2e: browser checker serves the game over local http (ES modules are blocked on file://) 2026-10-18 01:08:53 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 29cfd8378e e2e: session analysis, status writer, CUPTI hook, timestamps, Codex job scripts; merge of 7330ddb
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 01:08:04 +02:00
Pavlo Ratushnyi 1cd52bc388 Merge branch 'claude/port-gpu-bringup' into claude/e2e 2026-10-18 00:59:49 +02:00
Pavlo Ratushnyi 7330ddb6d5 Merge branch 'claude/prefix-cache' into claude/port-gpu-bringup 2026-10-18 00:57:29 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 44e57ee30e docs(prefix-cache): final-policy agent trace (job 927), measured restore costs
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 00:07:02 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 25538a8300 docs(prefix-cache): design, protocol, knobs, results (5090 jobs 921-926, laptop), remaining; 180k policy simulation; port-status row
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 23:54:47 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 d3962493b7 test(quality): LF endings for the job scripts, batched-prompt job renamed
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 22:30:07 +02:00