Commit Graph
1966 Commits
Author SHA1 Message Date
Pavlo Ratushnyi ec3bd72d02 Merge branch 'claude/size3-cd6' into claude/hexagonal-finish-14ee3a 2026-11-07 09:27:14 +01:00
Pavlo Ratushnyi 7385e6fecc Merge branch 'claude/size3-cd5' into claude/hexagonal-finish-14ee3a 2026-11-07 09:27:12 +01:00
Pavlo Ratushnyi 5f80342a82 Merge branch 'claude/size3-cd4' into claude/hexagonal-finish-14ee3a 2026-11-07 09:27:10 +01:00
Pavlo Ratushnyi 8f4c380c7b Merge branch 'claude/size3-cd3' into claude/hexagonal-finish-14ee3a 2026-11-07 09:27:08 +01:00
Pavlo Ratushnyi 1ff2e38bad Merge branch 'claude/size3-cd2' into claude/hexagonal-finish-14ee3a 2026-11-07 09:27:07 +01:00
Pavlo Ratushnyi ab67e4597b Merge branch 'claude/size3-cd1' into claude/hexagonal-finish-14ee3a 2026-11-07 09:27:04 +01:00
Pavlo Ratushnyi 806714d752 STRA-338 size3 cd6: WIP of the slice (unverified, committed by the new integrator) 2026-11-07 09:21:27 +01:00
Pavlo Ratushnyi 1adaa41162 STRA-338 size3 cd1: WIP of the slice (unverified, committed by the new integrator) 2026-11-07 09:21:24 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 a4ff37b968 Merge claude/hexagonal-size-nce-g (igpu conflicts resolved with the size-gw versions), baselines tightened
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 09:14:07 +01:00
Pavlo Ratushnyi 1c796d2d04 Merge branch 'claude/hexagonal-size-nce' into claude/hexagonal-finish-14ee3a 2026-11-07 09:13:01 +01:00
Pavlo Ratushnyi 514a9a0b8d STRA-338 size-nce: WIP backend-api and libc-shim function sizes (unverified, committed by the new integrator) 2026-11-07 09:13:01 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 2ad4b61622 Merge origin/claude/hexagonal-size-gw into hexagonal-integ (allowlist taken from size-gw: 1 entry)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 09:12:50 +01:00
Pavlo Ratushnyi 64885782fb STRA-338 size-nce: igpu tests and examples within the function limits
12 functions over a limit in crates/igpu test and example code -> 0 (3 example mains, src/tests.rs threaded_repacking,
tests/attention.rs attention_case, tests/gemm.rs check and the epilogue test, tests/moe.rs router and grouped products,
tests/norm.rs check, tests/real_weights.rs compare and the real-weights test). Split into arrange/run/compare helpers;
test names, module paths, assertions, messages and example output lines unchanged. The allowlist entry of
src/tests.rs threaded_repacking_equals_the_plain_definition is removed. Only src/shaders/gemm.rs (WGSL text) stays
allowlisted and is untouched.
2026-11-07 00:04:38 +01:00
Pavlo Ratushnyi 3277a39702 STRA-338 size2 cd4: original_file_expert_source/ffi, gpu schedule bridges, moe prompt device, mtp loader/rt/draft vocab split into helpers and comments wrapped 2026-11-07 00:04:05 +01:00
Pavlo Ratushnyi 8fe98079b7 STRA-338 size2 cd2: validation, admission, ffi and proof helpers within the limits 2026-11-07 00:02:54 +01:00
Pavlo Ratushnyi 305d6d4316 STRA-338 size2 cd5: oversize and complex functions of the verify, sampler, session-state, prefill and stream-all modules are split into helpers 2026-11-07 00:02:40 +01:00
Pavlo Ratushnyi 34c253f0c9 STRA-338 size2 cd3: split oversize/complex fns and wrap wide comments in 21 cuda-driver files 2026-11-06 23:58:16 +01:00
Pavlo Ratushnyi dfa5e01973 Merge remote-tracking branch 'origin/claude/hexagonal-s23' into claude/hexagonal-integ 2026-11-06 23:49:33 +01:00
Pavlo Ratushnyi 4f25158ebb Merge branch 'claude/size2-en3' into claude/hexagonal-integ 2026-11-06 23:48:06 +01:00
Pavlo Ratushnyi 758f72b2a9 STRA-338 size2: merge slice en3 (conflict in moe_activation_reuse_gpu resolved with the en4 version), baselines 2026-11-06 23:45:35 +01:00
Pavlo Ratushnyi 263cd08650 STRA-338 S23: record the test parity of the second review (0 missing, 0 changed, 38 new; 552 ok) 2026-11-06 23:45:19 +01:00
Pavlo Ratushnyi e0fb964b2e STRA-338 size2 en3: drop a needless mut 2026-11-06 23:44:38 +01:00
Pavlo Ratushnyi 13333d611c STRA-338 size2 en3: chunk producer rows and the GR output workspace stages move into child files 2026-11-06 23:42:35 +01:00
Pavlo Ratushnyi 3cdcb5edc5 STRA-338 size-nce: merge branch nce-f (native-cpu-expert function sizes) 2026-11-06 23:39:13 +01:00
Pavlo Ratushnyi af889465a9 STRA-338 size-nce: merge branch nce-e (native-cpu-expert function sizes) 2026-11-06 23:39:12 +01:00
Pavlo Ratushnyi b33aa42d27 STRA-338 size-nce: merge branch nce-d (native-cpu-expert function sizes) 2026-11-06 23:39:11 +01:00
Pavlo Ratushnyi 7fc6801d92 STRA-338 size-nce: merge branch nce-c (native-cpu-expert function sizes) 2026-11-06 23:39:10 +01:00
Pavlo Ratushnyi 089190cd2d STRA-338 size-nce: merge branch nce-b (native-cpu-expert function sizes) 2026-11-06 23:39:08 +01:00
Pavlo Ratushnyi 6fa7b73e01 STRA-338 size-nce: SAFETY comments on the new unsafe helper bodies in rust_iq and rust_k_blocks
The helpers split out of dot_multi512_impl, dot_single_iq3, iq4xs, dot_multi256, dot_multi512 and the K-block dot wrap their
bodies in `unsafe { }` as the surrounding code does; each now carries a SAFETY line (target features cover the intrinsics and
helpers called, loads follow the file's Bounds note). Comments only; harness re-run identical.
2026-11-06 23:38:37 +01:00
Pavlo Ratushnyi 3e950869e0 STRA-338 size-nce: rust_kq Q4_K helpers move to rust_kq/q4_k_block.rs (file back under 400 lines)
The Q4_K helper split made rust_kq.rs 404 lines (architecture gate: 400). The helpers (Q4kBlock, q4k_scales_mins,
q4k_spread_scales, q4k_expand, q4k_add_mins, q4k_sum, q4k_reduce) move verbatim into the private sibling module
rust_kq::q4_k_block; q4_k_dot stays in rust_kq with the same pub(super) path. rust_kq.rs 404 -> 311 lines. No code change
otherwise; the differential harness (q4_k_dot 960 cases, small_dot, bf16) re-run identical. codegen not A/B-measured.
2026-11-06 23:38:37 +01:00
Pavlo Ratushnyi e7b93ad691 STRA-338 size2 en3: last GPU proof and test-support helpers within the limits 2026-11-06 23:38:03 +01:00
Pavlo Ratushnyi 906b64ae2d STRA-338 S23: output-event.md after the second review: what adding a family touches, the stronger golden, the worker metrics of an early cancel 2026-11-06 23:37:58 +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 ddea3ac916 STRA-338 S23: close the golden gaps of the second review, recorded on the code before S23
29 more cases (159 cases, 318 captures), recorded on 08afbf216 in a temporary worktree and checked against the new code; none
differs. New cases: the request's max_output_tokens reached (text, reasoning, closed reasoning, tools, structured, gpt-oss);
Qwen reasoning on with json_schema valid and violated; gpt-oss json_schema, tools with structured output, effort none with
tools; Qwen reasoning plus tools at the length limit with calls inside the unclosed reasoning, and without; namespaced tools
through the stream and the buffered reading (Qwen with and without reasoning, gpt-oss); DONE before the first token and an error
after DONE (all four readings); a worker that reports fewer generated tokens than the reasoning took (the reasoning_tokens
clamp, usage output_tokens).
New tests of the binary (15 pass on 08afbf216 and on the new code): the stored response equals the one the client was sent
(streamed and not, six cases); a client that leaves at DONE closes the source (five cases, among them the final preview
flush); what reaches the worker: gpt-oss gets none of the server defaults for the samplers it lacks (top_k 20 and
penalty_last_n 64 included), accepts neutral values, Qwen keeps all five samplers and penalty_last_n, own and default.
In the lib: BufferedRun finishing its generation twice returns the shared GENERATION_ENDED error and fail() sends
response.failed; a token after the end fails the stream.
regenerate_output_golden now refuses unless OUTPUT_GOLDEN_RECORD names the pre-S23 commit and the tree has no output module
(checked: it panics on this tree); output_events.recorded_on names 08afbf216 and a test pins it.
2026-11-06 23:37:15 +01:00
Pavlo Ratushnyi 1a9ff645c6 STRA-338 size: limits-offenders.py --over lists every function over any limit 2026-11-06 23:37:13 +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 fa39cf7cdc STRA-338 size-nce: rust_ggml_native probe split into predicates, float_dot into per-format selectors
probe (48 lines, cx26) becomes probe -> probe_cpu (CPUID leaf 0/1, XGETBV, leaf 7 in the same order, each early return kept)
over the pure predicates leaf1_ok / wide_state_ok / fp16_ok / vnni512_ok / subleaf1_ok; the sub-leaf 1 CPUID is still read only
when a BF16 / AVX-VNNI / AVX-VNNI-INT8 branch is compiled in and leaf 7 EAX allows it. float_dot (cx12, match guards) becomes a
match on the kind over f32_dot_native / f16_dot_native / bf16_dot_native with the same branch priority (FP16 before F, BF16
before F). The test comment that was over 120 columns is re-wrapped. Functions over a limit in the file: 2 -> 0 (+1 wide line).

Differential check old vs new on the AVX-512 WSL host, per RUSTFLAGS build: default (all branches off: float_dot None, 1120
cases), +avx512f/vl/vnni/bw (F32, F16-F, BF16-F branches run: 1120 cases, 672 Some, identical bits), and +avx512bf16 / +avx512fp16 /
+avxvnni / +avxvnniint8 (this CPU lacks them: probe() and compiled_admitted() agree on false). The BF16-native and FP16-native
float_dot branches could not run on this host; they are covered by review only (the selector order is unchanged).
codegen not A/B-measured.
2026-11-06 23:33:52 +01:00
Pavlo Ratushnyi 64829ed582 STRA-338 size-nce: rust_ggml_extra ternary and iq1 split by stage
ternary (69 lines, cx13, nesting 6) becomes tq2_half / tq2_sums (TQ2_0) and tq1_main_products / tq1_tail_product / tq1_sums
(TQ1_0, powers as TQ1_POWERS) with the final FMA-free accumulate in ternary. iq1 (84 lines, cx21, nesting 8) becomes
iq1_block_scale / iq1_block_sums / iq1_pair / iq1_group_s / iq1_group_m (+ iq1m_sign) / iq1_group_terms; the IQ1_S scalar
correction is returned per group and summed in the same order instead of mutated in place. Bounds comment re-wrapped.
Functions over a limit in the file: 2 -> 0 (+1 wide line). New unsafe blocks carry SAFETY comments; vector helpers keep
target_feature and are #[inline].

Bitwise old-vs-new check (AVX2 path ran on the AVX-512 WSL host): ternary 800 cases (TQ1_0 and TQ2_0 x 0..9 blocks x 80
rounds incl. non-finite scales), iq1 800 cases (IQ1_S and IQ1_M likewise), 0 payload differences; mxfp4/nvfp4 unchanged code
as control (300 cases). codegen not A/B-measured.
2026-11-06 23:31:07 +01:00
Pavlo Ratushnyi 2972732186 STRA-338 size2 en3: GDN chunk numeric, four-borrow and GR handoff GPU proofs split into stage helpers 2026-11-06 23:30:54 +01:00
Pavlo Ratushnyi 97321aae83 STRA-338 size-nce: rust_ggml (Kind table, Activation::quantize, NativeFormat::new/dot, float_dot, q1_dot, quantize_raw, dot_raw)
Functions over a limit in rust_ggml.rs and rust_ggml/: 10 -> 0 (plus 1 wide-only test and 6 wide comment lines -> 0).
- Kind::from_original / original_id / block read one KIND_TABLE (new rust_ggml/kind_table.rs, one row per variant, compile-time
  check that row i is variant i); every mapping is the previous one.
- Activation::quantize split by encoding (encode_f32/f16/bf16/zero/one/k); bf16 rounding shared by quantize and quantize_raw.
- NativeFormat::new split into activation_sizes and bank_layout (same error order); dot split into dot_storage,
  dot_zero_blocks, dot_k_blocks, iq4nl_dot, iq4nl_tail (shared with dot_raw).
- float_dot / q1_dot split into #[inline] #[target_feature] helpers with the same arithmetic and accumulation order.
- quantize_raw split into assert_destination and write_half; dot_raw uses the shared block dispatchers.
Bitwise identity old vs new proven by a differential harness (AVX2 and AVX-512 builds); codegen not A/B-measured.
2026-11-06 23:29:19 +01:00
Pavlo Ratushnyi 1c3bcdf290 Merge branch 'claude/size2-en4' into claude/hexagonal-integ 2026-11-06 23:29:07 +01:00
Pavlo Ratushnyi b7045e53b8 STRA-338 size-nce: rust_kq q4_k_dot and small_dot split by stage, wide SAFETY comments moved
q4_k_dot (68 lines) becomes q4k_scales_mins / q4k_expand (+ q4k_spread_scales) / q4k_add_mins / q4k_sum / q4k_reduce, the
per-token FMA order unchanged (min correction first, then the block accumulator). small_dot (49 lines, cx16) becomes
small_block_bytes / small_activation (returns the Q8One min term instead of mutating `sums`; the caller adds it in the same
position) / small_weights / small_products. bf16_rows and bf16_rows_multi: the one-line SAFETY block comments become line
comments before the unsafe call; header comment re-wrapped. Functions over a limit in the file: 4 -> 0. New unsafe blocks
carry SAFETY comments; vector helpers keep target_feature and are #[inline].

Bitwise old-vs-new check (AVX2 path ran on the AVX-512 WSL host): q4_k_dot 960 cases (1..8 tokens x 1/2/3/8 blocks, incl.
non-finite scales; 3 token results where both are NaN differ in NaN payload/sign only, an fadd of two NaNs keeps the first
operand and LLVM may commute it), small_dot 3000 cases (kinds 2/3/6/7/8 x Q8Zero/Q8One x 0..10 blocks, empty row, missing
activation panic), bf16_rows/bf16_rows_multi 3168 cases incl. shape errors, q8_zero_dot/q5_one_dot/quant_one unchanged code
run as a control. codegen not A/B-measured.
2026-11-06 23:27:42 +01:00
Pavlo Ratushnyi bd036b52b8 STRA-338 S23: names, one cut struct, sampler_limit.rs, no dead live reading for gpt-oss
Renames: ReasoningSplit to ReasoningPreview, Bytes to TokenBytes, Split and Cut to the one CutGeneration (the tokens are
counted from its extent by Generation::count_tokens), split_reasoning to cut_reasoning_for_corpus. AtEndDecoder::read_answer
returns the events and the notes, and build_events keeps the notes (two steps). decode_lossy has its doc comment. The
message of a decode error after the generation ended is one constant, output::GENERATION_ENDED, used by the decoders and by
the buffered stream. The sampler types and the admission functions move from codec.rs and effort.rs to sampler_limit.rs
(with their tests); lib.rs no longer names TokenDecoder.
TextCodec::live_decoder returns Option and defaults to None: a model that always reasons is read at its end, so the
gpt-oss live arm and LiveDecoder::harmony are deleted; the two live streams fail the response with NO_LIVE_READING if they
ever get None. harmony_family tests pin reasoning_enabled(effort none, gpt-oss) = true and the missing live reading.
New unit tests: preview off with an unclosed block at the length limit, and the same reasoning tokens with preview on and
off when the marker is split over two multi-byte tokens.
Proof: golden (260 captures recorded on 08afbf216) identical, strata-control lib 316, gateway-domain 36, tool corpus 4.
2026-11-06 23:26:53 +01:00
Pavlo Ratushnyi 569329bfff Merge branch 'claude/size2-en7' into claude/hexagonal-integ 2026-11-06 23:26:01 +01:00
Pavlo Ratushnyi 4bdd736a78 Merge branch 'claude/size2-en6' into claude/hexagonal-integ 2026-11-06 23:26:00 +01:00
Pavlo Ratushnyi 70c6b1f23c Merge branch 'claude/size2-en5' into claude/hexagonal-integ 2026-11-06 23:25:59 +01:00
Pavlo Ratushnyi 407f83de01 Merge branch 'claude/size2-en2' into claude/hexagonal-integ 2026-11-06 23:25:58 +01:00
Pavlo Ratushnyi 831a77e43e Merge branch 'claude/size2-en1' into claude/hexagonal-integ 2026-11-06 23:25:57 +01:00
Pavlo Ratushnyi f509d39868 Merge branch 'claude/size2-cd7' into claude/hexagonal-integ 2026-11-06 23:25:55 +01:00
Pavlo Ratushnyi a808e4e7cb Merge branch 'claude/size2-cd6' into claude/hexagonal-integ 2026-11-06 23:25:54 +01:00