Commit Graph
290 Commits
Author SHA1 Message Date
Pavlo RatushnyiandClaude Sonnet 5.5 676457bf8f sm86: tool that derives sm_86 companions of the sealed sm_120 PTX
scripts/gpu-bringup/sm86_assets.py: survey / infer / build / compare / check.
Default method is retarget (the sealed text with the .target line and two
documented sm_90+ rules edited, accepted only if ptxas -arch=sm_86 accepts it);
recompile from the .cu is the fallback and needs a recipe verified by a round
trip on sm_120. sm86-recipes.json is the round-trip evidence.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-16 01:54:12 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 9bd221e875 diag(runtime): name DenseWeightCache startup steps and add opt-in driver error tracing
Rust port / port-fast (push) Failing after 7s
Rust port / port-typecheck (push) Failing after 8s
Rust port / port-oracles (push) Failing after 10s
Rust port / port-linux-tests (push) Failing after 19s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 09:15:27 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 c7abf4fab6 model-format: allow the whole-tensor stream for output.weight and token_embd.weight (native head / embedding owners)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 08:58:13 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 838f68b459 output_native: report which part of the native head load refused (stderr)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 08:42:47 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 179a659059 serve: name the failing startup step in OriginalServeStack::open refusals
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 08:27:14 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 6d3ad69d3d docs: sealed with nvcc 13.2.86 on 2026-10-15, GPU load verified separately, no numerical claim
Rust port / port-fast (push) Failing after 7s
Rust port / port-typecheck (push) Failing after 7s
Rust port / port-oracles (push) Failing after 10s
Rust port / port-linux-tests (push) Failing after 22s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 07:26:47 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 aeda704e87 test(cuda-driver): assert the sealed state of the 8 flipped placeholder tests
Pin matches the checked-in PTX (length + sha256), PTX is real sm_120 with every
named entry exported, and the pin guards still refuse one-byte-corrupted,
wrong-length, wrong-digest, zero-pin, embedded-NUL and unterminated synthetic
copies. Refusals that relied on 'unsealed' are re-expressed with corrupted-pin
copies. GPU load is verified separately by the host smokes; no numerical claim.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 07:26:14 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 53758bb691 seal: real nvcc 13.2.86 PTX for 30 assets, pins patched (first compile of the Original-literal CUDA sources; no numerical claim)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 07:19:23 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 abb6867937 test(gpu): fix two first-run GPU smoke defects (MTP bank allocation accounting, QSA resident-index test binding identity)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 07:19:10 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 b8daf8fe9b gpu-bringup: accept PTX ISA 9.1/9.2 (CUDA 13.1/13.2)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 18:21:13 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 3797bff503 docs(seal-plan): entry names of qsa_prompt_attention_variants match the .cu and its Rust consumer
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 18:20:34 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 88482263e3 build: pin CUDA toolkit to 13.2.2 (nvcc 13.2.86) matching the host driver (CUDA 13.2); bootstrap reads release from the lock; group closed-kernel smokes
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 18:16:42 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 4fbc8a1ca0 fix(desktop-core): Message.parts after the vision port
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 17:10:43 +02:00
Pavlo Ratushnyi 3bd56675f2 docs: record the open items of the remaining port
Rust port / port-fast (push) Failing after 8s
Rust port / port-typecheck (push) Failing after 8s
Rust port / port-oracles (push) Failing after 9s
Rust port / port-linux-tests (push) Failing after 14s
2026-10-14 17:08:46 +02:00
Pavlo Ratushnyi 2da8be8641 Merge branch 'claude/port-main' into claude/port-remaining 2026-10-14 17:07:00 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 9066468f9a feat(cuda-driver): closed driver programs for native_flash_attn, the legacy S-form GEMVs and the arena poison fill (fail-closed pins, signature tables checked against the .cu, ignored GPU smokes)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 17:06:20 +02:00
Pavlo Ratushnyi 618a3fa253 Merge branch 'claude/port-rv-kernels' into claude/port-main
# Conflicts:
#	docs/cuda-seal-plan-additions-window.json
#	scripts/check-local.sh
2026-10-14 17:04:06 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 4a640498aa feat(serve): pin-gated PTX assets for native head, sampler and MTP session rope (replace Option::None constants); seal-plan entries and tests
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 17:03:42 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 ccf78a1109 chore(oracle): check_cu_syntax.sh delegates to the unified stub pass
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 17:02:39 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 ee335df9f4 chore(check-local): stub CUDA syntax pass is advisory off macOS
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 17:01:57 +02:00
Pavlo Ratushnyi 9703afce8a Merge branch 'claude/port-bringup' into claude/port-main 2026-10-14 17:00:42 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 c280730262 docs(cuda): flag-policy audit of every ported .cu against CMake (unsealed assets without a plan entry, sealed precise builds of fast-math Originals, corrected window re-seal candidates); add literal_diff.py
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 17:00:26 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 90d3433da4 feat(gpu-bringup): mandatory fast-math reseal of six PTX, flag overrides, PTX ISA/driver precheck
Rust port / port-typecheck (push) Failing after 7s
Rust port / port-fast (push) Failing after 7s
Rust port / port-oracles (push) Failing after 9s
Rust port / port-linux-tests (push) Failing after 32s
Adds the six audited assets (head_native, original_verify_qsa, router, gr_post,
gr_norm, ple_native_batch) as an atomic reseal group built with --use_fast_math,
re-pins their old digests (incl. ple PTX_BYTES) and window-plan hex, and a
generic --flag-override recorded in the manifest and re-applied by the sealer.
compile_assets --isa-inventory/--driver-check and run_gpu_smokes.sh refuse a
driver older than the highest PTX ISA in the tree (9.0 needs >= 580.65.06).
Runbook: mandatory reseal + golden comparison section, step d' (linux-tests).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 17:00:26 +02:00
Pavlo Ratushnyi 3d00580a49 Merge branch 'claude/port-rv-kar' into claude/port-main 2026-10-14 16:57:51 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 700e921ae9 feat(sampler): host-side serve-loop sampling for MTP (window staging, coupled draft history, acceptance) with a whole-loop toy-model oracle
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 16:57:50 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 c969796616 test(kar): windows beyond 2^32 elements decode against a direct u64 format oracle
A virtual 8.6e9-element expert bank (group 96, section above 4 GiB) is never
allocated: archive bytes are a hash of the absolute offset, the planner and
kernel model decode first/middle/last-expert windows and the final partial
group, and every element is compared bit for bit with a per-element decode
written straight from the format definition. No defect found.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 16:57:38 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 2ab3a8ca48 test(cuda): run the stub pass through clang's CUDA frontend (host/device call legality, __shared__ rules, <<<>>>); fix qsa variants block_q4_0 packing, de-duplicate native_head_native.cu
- check-cu.py now defaults to clang -x cuda --cuda-host-only with real qualifiers; --plain keeps the C++-only pass.
- qsa_prompt_attention_variants.cu: block_q4_0 under pack(1) as in kv_q4.hpp (cu_pin refreshed).
- native_head_native.cu: orphan copy had __launch_bounds__ before extern "C" __global__ (never nvcc-built); now the sealed twin's text.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 16:56:45 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 88401e1663 test(kar): run the real kar_decode_levels.cu on the CPU against the kernel model
nvcc and a GPU are unavailable, and the kernel's only executable evidence was a
Rust transcription of it. This harness compiles the actual .cu with clang
through a small shim (threads for CUDA threads, a barrier for __syncthreads,
atomics for atomicOr) and replays model-generated cases: random valid windows
at levels 2..5, non-finite scales/books, ~1k corrupted launch-parameter sets,
multiply and SwiGLU. 17k cases (ASan build included) agree bit for bit; this
does not cover nvcc codegen or device behaviour.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 16:56:27 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 da7b9c6762 test(kar): recomputed-integrity directory fuzz must only admit GPU-consistent records
Every header field and directory byte is mutated with the directory digest and
header CRC recomputed so the structural validators are what is under test.
Whatever the inspector admits must also pass the nested-descriptor validator,
plan only ranges inside its own section, stage cleanly, run the kernel model
without panic, and equal the file-backed CPU oracle at level 2.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 16:56:27 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 9189e236e3 feat(gpu-bringup): remote_sync tests, toolkit tests, plan seal slots, doc runbook
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 16:54:39 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 55b16be9fd feat(gpu-bringup): smoke inventory + runner, remote sync, host sanity and env recording
smoke_inventory.py scans every real #[ignore] attribute, extracts the enabling
LELEKA_* flags and values, classifies tests (device / assets / mock) and assigns
them to dependency-ordered groups (smoke-groups.json). run_gpu_smokes.sh runs
them in order, stops a group at its first failure, skips dependents, continues
independent groups, treats a filter that matches nothing as a failure, records
nvidia-smi before/after, refuses a busy GPU and never starts a model run
without --allow-model-runs plus caller-supplied env. remote_sync.sh mirrors the
tree (no --delete, refuses to clobber unpulled sealed files) and builds the
three binaries and the test binaries on the host; host_sanity.sh is read-only;
record_env.sh captures hardware/software/model digests for the ledger.
Tested with stub cargo/nvidia-smi, shellcheck and a Linux container.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 16:54:39 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 671be9c786 feat(gpu-bringup): compile_assets/seal_pins toolkit for the Linux nvcc session
compile_assets.py reads docs/cuda-seal-plan*.json (assets and new_sources
formats), an extra plan for assets no plan covers, and the four rope PTX list
of docs/rope-and-memory-plan.md; verifies .cu pins, runs nvcc with the exact
flags (fast-math policy lint, rope flag variants), validates exports and ABI
parameter counts, and writes PTX + build-manifest.json outside the tree.
seal_pins.py installs the PTX in the encoding each consumer expects and patches
every pin form (PtxPin arrays/structs, AssetSpec.sha, Option tuple arrays,
plain len/sha consts, re-pins of regenerated rope PTX, ptx_abi test) with
exactly one replacement per field and a read-back check. fake-nvcc and a
unittest suite exercise the pipeline on macOS; no GPU, no generated PTX.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 16:54:39 +02:00
Pavlo Ratushnyi 7b67b8bddd Merge branch 'claude/port-rv-verify' into claude/port-main 2026-10-14 16:53:32 +02:00
Pavlo Ratushnyi 94fb39ccba Merge branch 'claude/port-docs-ci' into claude/port-main 2026-10-14 16:53:32 +02:00
Pavlo Ratushnyi a70fc0e4df Merge branch 'claude/port-rv-mtp' into claude/port-main
# Conflicts:
#	crates/cuda-driver/src/mtp_original_full_forward.rs
2026-10-14 16:53:32 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 894e2f5e21 test(verify): plan layout against the real carve, split-schedule hazards, controller output invariance sweep
PlanLayout was only compared with a copy of its own arithmetic: compare it
with OriginalVerifyLayout (plan span, mapped bytes, alignment) for every
max_t. Pin the split schedule's hazards for every layer count, and sweep the
controller over window shapes, draft noise, confidence floor, suffix lookup,
EOS and max_new asserting the emitted text is the greedy continuation and the
session equals the consumed tokens.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 16:51:48 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 465931d5a9 fix(kar): bind Native handle to the KAR expert source, long Load budget, refuse MTP
- validate_handle required MODE_DIGEST for Native, but a KAR-expert Load mixes
  the source identity into the Native digest, so start_generation and unload
  rejected the handle. The Proxy now derives the exact digest its owner will
  publish from the operator config and validate_handle compares against it.
- The Load reply budget keyed only on KAR PLE/MTP modes; a Native Load that
  hashes a whole KAR expert archive (plus overlay) got the 1200 s budget and a
  timeout permanently shuts the owner down. KAR experts now get the long budget.
- MTP prompt tiles and window verification use chunked MoE paths that read the
  GGUF experts, so KAR experts + MTP would build KV from one expert set and
  decode from another. Refuse that combination at Load.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 16:51:05 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 875dd12ddf fix(kar): do not refuse KAR routed experts just because the serving MoE cache exists
The serving backend always constructs a MoeWeightCache and step_cached passes
Some(cache) to MoeExpertStage::execute on every token. The KAR branch returned
IdentityMismatch whenever a cache was present, so with kar_expert_source set
every token failed at layer 0 and the feature was unreachable from serve_load.
The KAR branch never consults the cache for routed experts; it now ignores it
(the shared expert takes the existing uncached projection path).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 16:51:05 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 750a8d3003 test(reasoning-budget): replay the Service.run golden through the live worker and the Responses HTTP path
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 16:50:39 +02:00
Pavlo Ratushnyi e47a547dab Merge branch 'claude/port-linux-tests' into claude/port-main 2026-10-14 16:49:17 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 58db6f44b2 test(context): accept any NaN for invalid-YaRN kernel args in the rope golden
rope_plan_golden compared kernel_args.corr_low/corr_high bit-for-bit, while the
corr_dims check right above already (correctly) treats NaN payload/sign as a libm
detail. For beta_slow=-1 the fixture, generated on arm64, holds 0x7fc00000, but
x86 SSE's default NaN is 0xffc00000, so the test failed on Linux x86_64. Compare
NaN-vs-NaN as equal for these two fields; all non-NaN bits stay exact.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 16:47:56 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 81b907030f feat(vision): picture parts in the Chat, Messages and Responses dialects, the strata-vision encoder client and GENI embeddings
The three adapters reduce pictures to a Responses input_image, the prompt renderer writes the template's
picture items and returns their sources in prompt order, and the request path encodes them (in turn with the
engine), expands every image pad to its token count and sends GENI with the combined SVE1 file. The encoder
is configured by a top-level vision section, stops with the engine and starts before it. Goldens recorded from
the Python handlers cover fourteen Chat and Messages requests.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 16:46:59 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 b91368fc70 fix(mtp): correct the shared-arena role map of the full-forward tail and the scalar injection
Two table errors in the Original-literal physical layout, both invisible to
type and extent checks and both reached only on the GPU:

1. Layout::full_role mapped tail buffers 8, 9, 10 (hit_dst, parts, hit_slot)
   to roles 34, 35, 36. Role 35 (hit_dst_) is 40 bytes and 36 (hit_count_) 16,
   but tail 9 (the 102400-byte expert parts) and tail 10 (40 bytes) were
   placed there, so FullOwned::handle returned InvalidSize for them and no
   round or step program could be planned. Map them to 35, 31 (parts_), 34.

2. Layout::scalar mapped the attention hyper-connection injection (scalar 10)
   to inj2_ (role 14), the very buffer the tail uses as the MLP half's
   inject_out (tail 20). mlp_gr passes the attention inject as inj_prev and
   the MLP inject as inject_out, so the fused GR kernels read and wrote the
   same 4 floats concurrently. Map scalar 10 to inj_ (role 13), as Original.

Add pure tests (red before, green after) that every tail buffer fits its
role without overlap and that the scalar and tail views share only the
step/pos records, which Original shares too.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 16:46:30 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 9ea61bbba0 docs(verify): audit which sealed window copies were built precise where the Original is fast-math
The window seal plan only said 'some copies are a numerics risk'. List them
from the instruction mix of the sealed PTX against the fast-math-sensitive
operations of the Original sources: head_quant (amax / 127.0f, xi / d),
the analytic indexer append (powf/cosf/sinf), the native router (expf, 1/x),
native_gr_postops (sigmoid/silu), native_gr_norm (partial / n_cols) and the
native PLE post-ops are precise in the seals and fast-math in the Original;
bf16/combine differ in FTZ only; qsa_decode_postops, the shared expert and
the precise Original files already match. Names the re-seal action and that
native_flash_attn / native_qsa_score never run in the verify window.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 16:45:34 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 d124b7c78d fix(desktop-core): minijinja deps and prompt render error conversion after the Jinja prompt port
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 16:44:36 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 f334b66215 test(cuda-driver): teach the fake libcuda the eagerly-resolved cuMemsetD8_v2
Driver::load resolves cuMemsetD8_v2 (the `zero` entry point) up front, but the
synthetic mock_cuda.c (also #included by the q5/q6/projection-family mocks)
never defined it, so every isolated CPU ELF gate died in Driver::load with
MissingSymbol("cuMemsetD8_v2") before reaching its protocol assertions. Add a
load-only stub (same policy as the existing cuMemcpyDtoD_v2 stub) and an opt-in
`run.sh --mocks` mode that builds the fake libraries and runs the mock_driver,
q5_mock and q6_mock matrices in the Linux container.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 16:43:29 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 81f38cf4c3 docs(serve): record why the conversation cache is not bound to the Original serve stack
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 16:42:43 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 75f2aa93dd fix(prompt): parse JSON floats exactly (serde_json float_roundtrip)
The Python-compatible `tojson` renderer (control-plane/src/prompt.rs, also
compiled into leleka-runtime) must reproduce json.dumps(json.loads(x)). Without
serde_json's float_roundtrip feature the default float parser is not correctly
rounded: 123456789012345680000.0 rendered as 1.2345678901234567e+20 instead of
Python's 1.2345678901234568e+20. The test only passed in whole-workspace builds
where leleka-context's dev-dependency happened to enable the feature; building
leleka-runtime alone failed. Enable the feature on both consumers.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 16:41:51 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 26d797f0fb test(runtime): fix stale shared-pool layer-identity case
The test mutated only quartet member [3].layer and expected IdentityMismatch, but
validate_descriptors (which runs first) rejects a quartet whose members disagree
on the layer with InvalidDimension. Cover both branches explicitly: a consistent
quartet at the wrong layer index -> IdentityMismatch, a split quartet ->
InvalidDimension.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 16:41:51 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 f3b11f973e fix(runtime): classify a skipped forward as Unsupported, not IdentityMismatch
QwenStepTxn::commit folded "no logits/argmax was produced" into the generic
`_ => IdentityMismatch` arm of the output match when prefill-finish support was
added. The previous guard (and its test
full_forward_guard_refuses_skipped_layers_missing_logits_and_wrong_callback_token)
distinguished a skipped forward (Unsupported(Executor)) from a wrong callback
token (IdentityMismatch). Restore that classification; wrong tokens, and the
finish_prefill None path, are unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 16:41:51 +02:00