Commit Graph
903 Commits
Author SHA1 Message Date
Pavlo RatushnyiandClaude Sonnet 5.5 c97ffd03d7 docs/laptop-vs-vanilla.md: correct the default vanilla wall times in section 11
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 23:57:50 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 621d35276d laptop profile and workstation preset: ship the measured defaults (chunk 6144, grid 6144, tail prompt, context 262144), clamp the chunk to the GPU budget
Paired 256k sessions on this laptop (docs/laptop-vs-vanilla.md sections 4, 10, 11, 12): prefill 110 -> 176-290 tok/s, TTFT sum about
2,100 s -> 998-1,083 s. Gates: 6144 changes the rounding order of the prompt path and has NO quality gate yet (q_pair / residual-hash arms
2048 vs 6144 not run); the tail mode and the context move no number. prefill_capacity_for_budget lowers the chunk when the budget cannot
lend it (14+ GiB 8192, 13 6144, 12 3072, else 2048). Tests updated; leleka-deploy 120 unit + e2e pass. Also: section 11 (vanilla with
STRATA_ROUTE_TAIL_SKIP=0: 9.0-13.0 tok/s, wall 1,417 s).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 23:57:39 +01:00
Pavlo Ratushnyi daa6a4f144 Merge remote-tracking branch 'origin/main' into claude/laptop-vs-vanilla 2026-10-27 23:44:44 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 66cc34f850 rtx5090-32g profile: prefill chunk and prefix-cache grid 8192 by default
Linux / keyless-cuda-gate (push) Skipped
Rust port / port-fast (push) Failing after 16s
Rust port / port-typecheck (push) Failing after 19s
Linux / verify (push) Failing after 33s
Linux / keyless-cuda (push) Skipped
Linux / static-cuda-package (push) Skipped
Linux / hosted-cuda-package (push) Skipped
Linux / linux-static-cli (push) Skipped
Linux / linux-cli-container (push) Skipped
Linux / release-cli (push) Skipped
Rust port / port-oracles (push) Failing after 24s
Rust port / port-linux-tests (push) Failing after 28s
The shipped profile left both at 2048. Paired 256k session on the 5090 (same text, 5 turns): TTFT sum 131 s at 2048, 55-60 s at 8192
(night5 / night6 / rest-full / tune-A), decode unchanged. Tests and docs follow the new default.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 23:44:13 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 1d9899c5c9 docs/laptop-vs-vanilla.md: run A3 (adaptive prefetch policy), GPU power-limited from turn 3
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 23:24:06 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 df6f35a57e prefetch policy: a status line every 64 groups
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 22:59:00 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 824f3c3842 CPU misses: choose the page-touch pass by measurement (adaptive policy), on top of skip-by-default
Per-expert cost of both modes as moving averages; start with the pass (cold cache), compare after 16 samples each, switch on a 3 % margin,
probe the other mode every 16th group. LELEKA_CPU_PREFETCH=on|off stay hard overrides; Linux keeps the pass. Seven model-free unit tests.
Not run on the GPU (power cap).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 22:56:10 +01:00
Pavlo Ratushnyi 6cec7a92cf Merge remote-tracking branch 'origin/main' into claude/laptop-vs-vanilla 2026-10-27 22:51:56 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 c240e38605 docs/laptop-vs-vanilla.md: run A2 stopped by the power cap; cold-cache decode is slower without the prefetch pass
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 22:51:17 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 d84d465ff9 scripts/profile: h2d_max_probe (PCIe 5.0 x16 host-to-device ceiling: streams, copy size, source kind, SM copy kernel)
Linux / keyless-cuda-gate (push) Skipped
Rust port / port-fast (push) Failing after 9s
Rust port / port-typecheck (push) Failing after 9s
Rust port / port-oracles (push) Failing after 14s
Rust port / port-linux-tests (push) Failing after 18s
Linux / verify (push) Failing after 21s
Linux / keyless-cuda (push) Skipped
Linux / static-cuda-package (push) Skipped
Linux / hosted-cuda-package (push) Skipped
Linux / linux-static-cli (push) Skipped
Linux / linux-cli-container (push) Skipped
Linux / release-cli (push) Skipped
Measured on the 5090: 51.0 GB/s cudaHostAlloc 8-64 MiB, 51.8 GB/s THP + register 8 MiB, extra streams add nothing.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 22:35:56 +01:00
Pavlo Ratushnyi 83822b0857 Merge claude/laptop-vs-vanilla (decode: skip the page-touch prefetch pass on Windows) into main 2026-10-27 22:35:52 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 9e33932c5d CPU misses: skip the page-touch prefetch pass by default on Windows (+21.6 % decode at 233k context, interleaved A/B)
The pass (PrefetchVirtualMemory on 3 ranges per missed expert, then a touching phase) ran before the compute and took 70-75 ms of a
165 ms window; the compute faults the pages in itself, overlapped with its work. LELEKA_CPU_PREFETCH=on|off, and
LELEKA_CPU_PREFETCH_OFF_FILE / LELEKA_NO_TRIM_FILE for A/B inside one engine. scripts/e2e/decode_ab.py: decode-only A/B at depth.
docs/laptop-vs-vanilla.md section 7.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 22:35:31 +01:00
Pavlo Ratushnyi 387f5cbd63 Merge claude/upstream-rest into main
Linux / keyless-cuda-gate (push) Skipped
Rust port / port-typecheck (push) Failing after 9s
Rust port / port-oracles (push) Failing after 13s
Rust port / port-linux-tests (push) Failing after 16s
Rust port / port-fast (push) Failing after 9s
Linux / verify (push) Failing after 18s
Linux / keyless-cuda (push) Skipped
Linux / static-cuda-package (push) Skipped
Linux / hosted-cuda-package (push) Skipped
Linux / linux-static-cli (push) Skipped
Linux / linux-cli-container (push) Skipped
Linux / release-cli (push) Skipped
2026-10-27 22:11:02 +01:00
Pavlo Ratushnyi 4b4de25c13 Merge claude/tail-keep into main 2026-10-27 22:11:01 +01:00
Pavlo Ratushnyi 71aafce399 Merge claude/laptop-vs-vanilla into main 2026-10-27 22:10:59 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 54360c0c5f docs/upstream-port-plan.md: quality gate Q of the 256k change set (PASS against the run-to-run control)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 22:04:35 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 b7b8d98132 docs/upstream-port-plan.md: e2e before/after at 256k with all defaults (decode +28 %, TTFT -5 %), the sync mistake, night7 comparison
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 21:53:09 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 a0eda0f703 serve: log the CPU kernel family per kind of logical CPU and the kernel set per CUDA device at start-up
cpu_kernel_report probes every logical CPU (pinned thread, cpuid/xgetbv), groups identical ones and names the family chosen for the
process plus the STRATA_* switches that changed it, with a warning when cores differ in AVX-512. gpu_kernel_report lists every CUDA device
with compute capability, SM count, memory and the kernel set it loads (sealed sm_120, pinned sm_86 companions, or none) and the MMQ
launch policy. Logging only.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 21:39:02 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 16a2b527bd docs/laptop-vs-vanilla.md: run A, 256k session on the final build (TTFT sum 998 s, wall 1,226 s)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 21:38:06 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 f1634e1034 serve: log the CPU kernel family per kind of logical CPU and the kernel set per CUDA device at start-up
cpu_kernel_report probes every logical CPU (pinned thread, cpuid/xgetbv), groups identical ones and names the family chosen for the
process plus the STRATA_* switches that changed it, with a warning when cores differ in AVX-512. gpu_kernel_report lists every CUDA device
with compute capability, SM count, memory and the kernel set it loads (sealed sm_120, pinned sm_86 companions, or none) and the MMQ
launch policy. Logging only.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 21:37:28 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 2cb26cc333 prefix cache: the decode-end checkpoint leaves its request's prompt-end checkpoint standing
A client that resends the history without the reply's reasoning continues from the prompt end; superseding it by the decode-end tail made
every such turn resume from the last grid point and re-read up to a block of tokens (4.8k-5.6k per turn in the 256k session).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 21:13:23 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 85fd803396 prefix cache: the decode-end checkpoint leaves its request's prompt-end checkpoint standing
A client that resends the history without the reply's reasoning continues from the prompt end; superseding it by the decode-end tail made
every such turn resume from the last grid point and re-read up to a block of tokens (4.8k-5.6k per turn in the 256k session).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 20:59:05 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 31d1657cbf docs/upstream-port-plan.md: results of rows 2.4/2.5 and the 256k gap to vanilla (per-layer slot sizing, decode +17 %); scripts/upstream-rest/turns.py
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 20:56:15 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 f998c13bbf log the chosen QSA top-k kernels once
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 20:38:05 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 cb32ebdd01 docs/laptop-vs-vanilla.md: gap ranking, measurements so far, quality state
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 20:23:44 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 d833654b3d replay: arm flags !sized / !uniform for the per-layer cache plan
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 20:18:03 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 b66484a470 runtime: per-layer expert cache with each layer's own blob size (the Original's #369 plan) instead of slots of the largest blob; cluster decode top-k, wide prompt top-k and the no-store GDN output norm on by default
Per-layer cache: 48 x quota slots of each layer's blob (1.94 MiB average) where the uniform plan gave slots of the largest blob (2.54 MiB): same VRAM, about 30 % more
resident experts (night5: 8,702 slots in 21.58 GiB; vanilla Strata 12,575 in 23.87 GiB). LELEKA_ORIGINAL_SERVE_PER_LAYER_SIZED=0 keeps the uniform plan.
Defaults flipped after gate I (7 arms, 1,502 forced rows with zero deviation, prefill chunk hashes equal up to the cache cut) and gate R (QSA stage -4..-6 %, decode window
-8..-10 % per round, replay of night5-long-256k): LELEKA_QSA_CLUSTER=0, LELEKA_QSA_TOPK=fast, LELEKA_PREFILL_GDN_NOSTORE=0 switch them off.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 20:13:16 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 73c67a694d Prompt staging: low memory priority for the first layers' expert pages (LELEKA_STAGE_PRIORITY, opt-in, Windows)
Keeps the last layers' pages cached across chunks of a cyclic scan; only which pages the cache keeps changes.
docs/laptop-vs-vanilla.md: first draft.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 20:13:11 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 449b7a1784 deploy: CPU workers never exceed the physical cores but the host's (Windows)
The workstation preset counted logical processors: 12 workers on the 8-core laptop, 5 spinning unpinned. Now 7 (as vanilla).
The 16-core server stays at 15.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 20:13:10 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 3461b8629a libc-shim: ReOpenFile (own file object) and thread memory priority
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 20:13:10 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 ee4cb597da PLE rows: read ahead of the chunk on handles of their own (Windows)
The KAR PLE rows of a chunk (16 per token, three random 4 KiB reads each) were read before the chunk started, through
clones of one synchronous handle, which the I/O manager runs one request at a time: 5-12 s of every 6144-token chunk.
Rows now read on independent file objects (ReOpenFile) and the next chunk's rows are fetched on a thread while this
chunk computes. Packets are a function of the archive bytes only; LELEKA_PLE_AHEAD_VERIFY=1 compares each with a direct
read (0 mismatches in 2 live turns). Default on for Windows, LELEKA_PLE_AHEAD=on|off.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 20:13:10 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 e96c6332c1 docs/upstream-port-plan.md: Project Maya analysis (ranked candidates, CPU tier status)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 09:40:08 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 6d75dcddd9 tests: wide top-k selection rule, cluster asset pin, decode-shaped identity cases down to the identity branch, decode scores timing; scripts/upstream-rest/arm_prof.py; plan analysis of rows 2.4/2.5
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 09:20:23 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 a28b85f798 cuda-driver: GDN output norm without the dead FP32 store (row 2.4), per-arm overrides for the new kernels, replay arm flags
leleka_prefill_gdn_out_norm_y16 writes the same y16 and status words as leleka_prefill_gdn_out_norm and leaves y alone (nothing reads it after the launch);
LELEKA_PREFILL_GDN_NOSTORE. Overrides for paired passes in one process: set_prefill_gdn_override (sealed / kh / two-barrier recurrence), set_qsa_topk_override,
set_qsa_cluster_override, set_prefill_gdn_nostore_override; replay arm flags !orig !kh !rec !wide !fast !cluster !nocluster !nostore !store.
sm_86 companions regenerated (prefill_stage, qsa_late; qsa_cluster is sm_90+ and documented as not built).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 09:02:13 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 4ace54b773 cuda-driver: wide top-k for long prompt tiles and a decode top-k on a thread-block cluster (upstream 586367cb, d05d26e9, row 2.5), both opt-in
leleka_qsa_topk_wide (also _sample/_wide_failed, measured and not used) in qsa_late.cu; leleka_qsa_topk_cluster in the new sealed asset qsa_cluster.cu (sm_90+,
no sm_86 companion); cuLaunchKernelEx plumbing for KernelModule and the verifier window (Launch.cluster); policy.qsa.cluster_topk. Same ids as qsa_topk_ref in
every model-free case (continuous, heavy tailed, tied, all equal; prompt tiles of 256 rows and decode calls of 1..5 rows up to 261,500 tokens).
LELEKA_QSA_TOPK=wide (prompt, from 10,000 blocks) and LELEKA_QSA_CLUSTER=1 (decode window) switch them on; defaults off until their R gate.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 08:52:15 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 68fbd99346 cuda-driver: GDN prompt recurrence with one thread for the three value heads of a key head (upstream gdn_rec_kh_kernel, row 2.4), opt-in LELEKA_PREFILL_GDN_KH=1
Bit-identical to the Original's gdn_rec_cols_pipe (state, readout, witness; model-free probe, t = 1..8192, non-finite variants). The state witness is read
from the final state of leleka_prefill_gdn_rec and _kh (a non-finite value never heals), which removes 96 integer ops per thread and token.
On the 5090: 4.04 ms against 4.31 ms (original) and 3.91 ms (two-barrier rec) per 8192 tokens and layer: the recurrence is latency bound there.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 08:52:14 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 13c342eef7 gpu-bringup: reseal_own.py re-seals one of our own already-sealed PTX assets after its .cu changed (seal_pins.py refuses a pinned asset)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 08:52:14 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 3bedec6107 test: mcp unknown-block text keeps key order (serde_json preserve_order via leleka-harmony)
Linux / keyless-cuda-gate (push) Skipped
Rust port / port-typecheck (push) Failing after 9s
Rust port / port-oracles (push) Failing after 10s
Rust port / port-linux-tests (push) Failing after 15s
Rust port / port-fast (push) Failing after 9s
Linux / verify (push) Failing after 18s
Linux / keyless-cuda (push) Skipped
Linux / static-cuda-package (push) Skipped
Linux / hosted-cuda-package (push) Skipped
Linux / linux-static-cli (push) Skipped
Linux / linux-cli-container (push) Skipped
Linux / release-cli (push) Skipped
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 08:36:02 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 b3274c1130 Merge claude/port-gpu-bringup (CUDA runtime port, upstream sync) into main
Linux / keyless-cuda-gate (push) Skipped
Rust port / port-typecheck (push) Failing after 8s
Desktop foundation / core (ubuntu-latest) (push) Failing after 11s
Rust port / port-oracles (push) Failing after 11s
Rust port / port-linux-tests (push) Failing after 14s
Rust port / port-fast (push) Failing after 9s
Linux / verify (push) Failing after 17s
Linux / keyless-cuda (push) Skipped
Linux / static-cuda-package (push) Skipped
Linux / hosted-cuda-package (push) Skipped
Linux / linux-static-cli (push) Skipped
Linux / linux-cli-container (push) Skipped
Linux / release-cli (push) Skipped
Brings the Rust/CUDA port of the Strata mode17 serve path together with the
CPU/iGPU/NPU gpt-oss runtime that main gained meanwhile.

Control plane: the Qwen tokenizer is the implementation behind the Qwen35
variant of codec::TextCodec (qwen(), encode_prompt() widen the trait; QwenCodec
derefs to the tokenizer), so control-token marks, images, chat template, the
runtime backend and vision keep their behavior, while the gpt-oss/Harmony path
and the worker pool keep main's. Config carries the union of fields; extra_workers
is rejected together with runtime, lazy_load, idle_unload_s and vision; the
gpt-oss family refuses top_k/min_p/penalties (its GEN line has no such keys).
leleka-kar-codec takes f16_bits_to_f32 from leleka-quant-core (identical code).
Workspace members and default-members are the union of both sides.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 08:32:33 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 c40531f071 e2e: long_session cuts the last file of a turn to the budget (a whole file overshot the 256k context)
Rust port / port-fast (push) Failing after 12s
Rust port / port-typecheck (push) Failing after 12s
Rust port / port-oracles (push) Failing after 13s
Rust port / port-linux-tests (push) Failing after 18s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 06:04:19 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 f8f4fbbec6 docs/windows.md: PCIe tier on the laptop (root cause of the CUDA 700, whether PCIe beats the CPU, paired A/B); pcie_copy_gpu_bandwidth
* The batch-copy fault: bisect in the engine, the model-free matrix, the fix, how to repeat the check on a new driver.
* Why it is not STRA-235 (different fault, different path) and the 5-minute negative result of the registered-file-mapping DMA stress
  (205,235 copies, 27,248 working-set trims, 0 wrong bytes).
* Plain PCIe shares are slower than the CPU pool over the pageable bank (profile: pool.publish_plan 10-11 s of 27-31 s); locked-only shares
  are about +8 % in a 3-rep paired A/B (unset 6.73/6.79, 0.45 5.02/4.79, 0.6 locked-only 7.51/7.14 decode tok/s, prefill unchanged);
  recommendation: keep the default, do not change the preset.
* pcie_copy_gpu_bandwidth (ignored GPU test, prints a measurement): pageable 8.1-8.9 GB/s with the call being the copy, page-locked
  11.6-12.4 GB/s at 4 us per call.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 06:03:20 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 2a7e80a390 cuda-driver: model-free stress of DMA out of a registered read-only file mapping under working-set trimming (STRA-235 hypothesis, Windows)
mapped_file_dma_under_working_set_trimming_is_exact maps a 2 GiB file read-only, page-locks the first GiB in place with
cuMemHostRegister(READ_ONLY) (what pin_resident does), copies random pieces out of the registered and the pageable halves to the device
while K32EmptyWorkingSet runs every 5 ms (the governor's relieve_working_set) and another thread churns the pages, and checks every byte
against the file's content function. 20 s on the laptop: 18,825 copies, 1,764 trims, 0 mismatches. #[ignore]d GPU test, no model.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 04:16:37 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 d54f10161c PCIe tier: LELEKA_PCIE_LOCKED_ONLY keeps the PCIe share to page-locked experts over a pageable bank (opt-in)
With the batch copy gone (previous commit) a PCIe share works on the 3080 laptop, but it is SLOWER than the CPU pool over the pageable
file-mapped bank: the DMA of a pageable expert is staged by the driver on the calling thread, the thread that also drives the window
(profile, 200 tokens at 2k depth, share 0.45: pool.publish_plan 10-11 s of a 27-31 s decode, against 0.0 s without a share).
Only the experts whose pages pin_resident locked (4,242 experts / 8 GiB on the workstation preset) are copied without that stall.

* MappedExpertBank::locked_experts(): layer*512+expert -> all three pieces inside a pin_resident range (sorted ranges, binary search);
  empty for a registered bank (every expert qualifies).
* split_group_pcie(): split_group_tail with an eligibility predicate for the PCIe share (the share is still nmiss*pcie_num>>8 of ALL misses,
  capped by the eligible ones, last eligible misses in routing order); split_group_tail is the same call with `|_| true` (test: unchanged).
* GpuExpertPool::pcie_locked, filled under LELEKA_PCIE_LOCKED_ONLY=on|1 only when a share is set; default off, no change to any default.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 04:16:36 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 7218a4f2c1 PCIe tier on Windows: no cuMemcpyBatchAsync for the window's expert copies (fixes CUDA 700 in the first decode window)
Every request that staged a PCIe share (LELEKA_ORIGINAL_SERVE_PCIE_FRAC set on the workstation preset) failed deterministically in the first
decode window of the RTX 3080 laptop's native engine: CUDA_ERROR_ILLEGAL_ADDRESS at the first cuMemcpyHtoDAsync after the graph launch.
The window's DMA arm gives the whole group's pieces to one cuMemcpyBatchAsync_v2; on this driver (617.42, WDDM) that call faults for any
page-locked host source: a single 16-byte piece, every source access order, every registration flag. The same pieces copied one call each
are exact, and pageable sources are exact either way. LELEKA_PCIE_DMA_BATCH=off alone removes the failure in the engine (the old WSL2
default, now also native Windows). LELEKA_PCIE_DMA_BATCH=on still forces the call.

* original_verify_gpu_plan.rs: dma_options_for(wsl, windows, env) decides the three DMA options; the batch copy is off by default on
  Windows and WSL2, the stream write of flag B stays on for native Windows (it passed in the engine runs); unit test.
* original_pcie_copy_gpu_smoke.rs: model-free GPU smoke of the copy (pageable / page-locked / mixed sources, one call per piece and the
  batch, 200 rounds with real piece sizes, every byte checked). production_* cases pass; raw_batch_page_locked / raw_batch_mixed fail
  with error 700 on this laptop (the check to repeat on a new driver).
* cuda_trace.rs: the tracer wraps cuMemcpyBatchAsync_v2 ("batch-async copies N ...") so the operation is named in a failure listing.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 02:54:06 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 b4896c164b Merge NaN guard live fix (plan row 1.2): discard the refused window's engine state before the retry
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 01:40:47 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 a75d3902ed NaN guard heals on the live stack: take the refused window back before the retry (plan 1.2)
The retry of a refused verify window failed on the RTX 5090 with Failed(InvalidDimension): a window that completed and was never
committed keeps the driver verifier's window_ready flag (run refuses the next window with InvalidQwenShape) and its armed QSA journal.
A rerun that only cleared that completed but differed from the refused window, deterministically: the window also advances the PLE
history row by row (only the commit graph sets it) and overwrites the index tails and the spare pooled row.

OriginalSpecEngine::discard_window (port, OriginalVerifier::discard_window, OriginalVerifyQsaJournal::discard_window) runs after the
two checkpoint restores; the journal writes back the index state and the PLE history it read when the window began
(set_window_snapshots, only when the guard has retries). The fake engine refuses a window while a completed one is outstanding, so
the retry tests fail without the take-back. Live, guard on, deterministic arm: G1/G2 equal G0 in all 546 window blocks and 711 forced
rows, every rerun bit-equal to the refused window; default tier: all runs rc=0. Default stays off.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 01:40:17 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 b145a3d261 e2e: long_session records a hash of each reply so two configurations can be compared
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 01:31:45 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 63e496a8df e2e: long_session cuts its last turn to fit under the engine context
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 00:19:53 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 beea1b42a9 Merge claude/upstream-p0 (plan rows 0.1-0.5, 1.1, 1.2) into claude/port-gpu-bringup
The sealed chain_window assets conflicted: bringup sealed a new chain_window.ptx (entry chain_gr_down_t2w8_nb4, c9ccd81) while upstream-p0
clamped the q8_1 scale and sum in the opt-in chain swiglu+quantize entry (4654f01, plan row 1.1). Resolved from the bringup sealed file:
only chain_swiglu_quant_kernel was replaced (scripts/q8/splice_ptx.py), every other byte stays as sealed; the entry text is byte for byte what
scripts/q8/rebuild_quantizer_ptx.sh compiles from the merged chain_window.cu (nvcc 13.2.86, checked on the server).

Regenerated, not merged by hand: the pin in original_verify_window_chain.rs (scripts/q8/repin.py), and the sm_86 companions, MANIFEST.json and
sm86_table.rs (scripts/gpu-bringup/sm86_assets.py build: 132 companions, check OK). The six other quantizer PTX and their companions equal
upstream-p0's. docs/upstream-port-plan.md: rows 0.1-0.5, 1.1, 1.2 from upstream-p0, row 0.6 from bringup, merge note on row 1.1.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-26 23:19:55 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 72f502f0ae Merge upstream speed items (route tail skip stays experimental and off; callback warm-up guard; CPU pool plan opt-in)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-26 23:09:30 +01:00