Skip to content

Enhance Gemma 4 performance and features across multiple areas#11

Open
Snider wants to merge 736 commits into
mainfrom
dev
Open

Enhance Gemma 4 performance and features across multiple areas#11
Snider wants to merge 736 commits into
mainfrom
dev

Conversation

@Snider

@Snider Snider commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 1468 files, which is 1368 over the limit of 100.

To get a review, narrow the scope:
• coderabbit review --committed # exclude uncommitted changes
• coderabbit review --dir # limit to a subdirectory
• coderabbit review --base # compare against a closer base

Upgrade to a paid plan to raise the limit.

Usage-priced reviews support at most 300 files.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c06dde3e-9015-4b35-a8ff-622aed55c15d

📥 Commits

Reviewing files that changed from the base of the PR and between 8df3087 and d6050f1.

⛔ Files ignored due to path filters (12)
  • cli/go.sum is excluded by !**/*.sum
  • cli/lthn_kernels.metallib.gz is excluded by !**/*.gz
  • cli/mlx.metallib.gz is excluded by !**/*.gz
  • examples/go.sum is excluded by !**/*.sum
  • go/go.sum is excluded by !**/*.sum
  • go/kv/turboquant/testdata/real_kv_keys.bin is excluded by !**/*.bin
  • go/kv/turboquant/testdata/real_kv_values.bin is excluded by !**/*.bin
  • go/model/arch/deepseek-ai/deepseekvl2/testdata/fixture.png is excluded by !**/*.png
  • go/model/arch/openai/whisper/testdata/hello16k.wav is excluded by !**/*.wav
  • go/model/arch/rednote-hilab/dotsocr/testdata/fixture.png is excluded by !**/*.png
  • go/model/arch/zai-org/glmocr/testdata/fixture.png is excluded by !**/*.png
  • gui/go.sum is excluded by !**/*.sum
📒 Files selected for processing (1701)
  • .gitignore
  • .gitlab-ci.yml
  • .graphifyignore
  • CLAUDE.md
  • Makefile
  • Taskfile.yml
  • bench/README.md
  • bench/gemma4.json
  • cli/bench.go
  • cli/capture.go
  • cli/capture_test.go
  • cli/data.go
  • cli/data_test.go
  • cli/generate.go
  • cli/go.mod
  • cli/judgedriver.go
  • cli/judgedriver_test.go
  • cli/judgetemplate.go
  • cli/judgetemplate_test.go
  • cli/lthn-model-pack/main.go
  • cli/main.go
  • cli/main_test.go
  • cli/ocr.go
  • cli/pack.go
  • cli/quant_test.go
  • cli/serve.go
  • cli/serve_test.go
  • cli/ssd.go
  • cli/ssd_test.go
  • cli/transcribe.go
  • cli/transcribe_test.go
  • cli/tui/README.md
  • cli/tui/agentadapter.go
  • cli/tui/agentadapter_test.go
  • cli/tui/agentcap.go
  • cli/tui/agentcap_test.go
  • cli/tui/agentoverlay.go
  • cli/tui/agentoverlay_test.go
  • cli/tui/agentstore.go
  • cli/tui/agentstore_test.go
  • cli/tui/app.go
  • cli/tui/app_test.go
  • cli/tui/bootstrap.go
  • cli/tui/bootstrap_test.go
  • cli/tui/dataoverlay.go
  • cli/tui/dataoverlay_test.go
  • cli/tui/datapanel.go
  • cli/tui/datapanel_test.go
  • cli/tui/datasetmigrations.go
  • cli/tui/datasetmigrations_test.go
  • cli/tui/datasetstore.go
  • cli/tui/datasetstore_test.go
  • cli/tui/export.go
  • cli/tui/export_test.go
  • cli/tui/inspector.go
  • cli/tui/inspector_test.go
  • cli/tui/jobs.go
  • cli/tui/jobs_test.go
  • cli/tui/keymap.go
  • cli/tui/keymap_test.go
  • cli/tui/knowledge.go
  • cli/tui/knowledge_test.go
  • cli/tui/layout.go
  • cli/tui/layout_test.go
  • cli/tui/markdown.go
  • cli/tui/markdown_bench_test.go
  • cli/tui/markdown_test.go
  • cli/tui/migrations.go
  • cli/tui/migrations_test.go
  • cli/tui/modes.go
  • cli/tui/palette.go
  • cli/tui/palette_test.go
  • cli/tui/paths.go
  • cli/tui/paths_test.go
  • cli/tui/picker.go
  • cli/tui/preferences.go
  • cli/tui/preferences_test.go
  • cli/tui/reactive.go
  • cli/tui/reactive_test.go
  • cli/tui/records.go
  • cli/tui/records_test.go
  • cli/tui/repository.go
  • cli/tui/repository_test.go
  • cli/tui/runtime.go
  • cli/tui/runtime_test.go
  • cli/tui/service.go
  • cli/tui/sessions.go
  • cli/tui/sessions_test.go
  • cli/tui/settings.go
  • cli/tui/stream.go
  • cli/tui/style.go
  • cli/tui/tabs.go
  • cli/tui/tools.go
  • cli/tui/tui.go
  • cli/tui/tui_test.go
  • cli/tui/work.go
  • cli/tui/work_test.go
  • cli/tune.go
  • docs/RFC.models.md
  • docs/audit-2026-07-16.md
  • docs/backends.md
  • docs/cmd-lem.md
  • docs/design-composability.md
  • docs/design-dflash-forward.md
  • docs/design-dflash-survey.md
  • docs/design-gd-state-blocks.md
  • docs/design-mtp-boundary-carry.md
  • docs/design-owned-weight-binding.md
  • docs/design-qmv-rows-unaligned.md
  • docs/design-qwen-mtp-pair.md
  • docs/design-qwen-vision-factory.md
  • docs/design-rocm.md
  • docs/design-tq-moe-hybrid.md
  • docs/engine-merge.md
  • docs/examples/energy-ab/README.md
  • docs/examples/energy-ab/energy_turns.py
  • docs/examples/energy-ab/pm_integrate.py
  • docs/handover.md
  • docs/hip-12b-r10-route-table.md
  • docs/hip-12b-r11-feedback-pin.md
  • docs/hip-12b-r12-sampler-fix.md
  • docs/hip-12b-r13-close.md
  • docs/hip-12b-r14-close.md
  • docs/hip-12b-r15-close.md
  • docs/hip-12b-r15-spread.md
  • docs/hip-12b-r16-topk-fork.md
  • docs/history.md
  • docs/index.md
  • docs/mamba1-mamba2-compatibility-audit.md
  • docs/models.md
  • docs/perf-gemma-small.md
  • docs/perf-mtp-verify.md
  • docs/policy-g2-mediated-rewrite.md
  • docs/purge-plan.md
  • docs/receipts/2026-07-19-turboquant-live-kv-receipts.md
  • docs/receipts/2026-07-19-turboquant-real-kv-distortion.md
  • docs/release-v0.12.0-DRAFT.md
  • docs/superpowers/plans/2026-07-17-lem-workspace-tui.md
  • docs/superpowers/plans/2026-07-18-coreagent-native-execution.md
  • docs/superpowers/plans/2026-07-19-lem-dataset-loop.md
  • docs/superpowers/specs/2026-07-17-lem-workspace-tui-design.md
  • docs/superpowers/specs/2026-07-18-coreagent-native-execution-design.md
  • docs/superpowers/specs/2026-07-19-lem-dataset-loop-design.md
  • docs/superpowers/specs/2026-07-19-whisper-asr-design.md
  • docs/todo.md
  • examples/.gitignore
  • examples/README.md
  • examples/bin/adapter-cpu
  • examples/bin/adapter-mlx
  • examples/bin/backends-cpu
  • examples/bin/backends-mlx
  • examples/bin/batch-cpu
  • examples/bin/batch-mlx
  • examples/bin/benchmark-cpu
  • examples/bin/benchmark-mlx
  • examples/bin/chat-audio-cpu
  • examples/bin/chat-audio-mlx
  • examples/bin/chat-basic-cpu
  • examples/bin/chat-basic-mlx
  • examples/bin/chat-budget-cpu
  • examples/bin/chat-budget-mlx
  • examples/bin/chat-cancel-cpu
  • examples/bin/chat-cancel-mlx
  • examples/bin/chat-mtp-mlx
  • examples/bin/chat-multiturn-cpu
  • examples/bin/chat-multiturn-mlx
  • examples/bin/chat-sampling-cpu
  • examples/bin/chat-sampling-mlx
  • examples/bin/chat-stop-cpu
  • examples/bin/chat-stop-mlx
  • examples/bin/chat-stream-cpu
  • examples/bin/chat-stream-mlx
  • examples/bin/chat-thinking-cpu
  • examples/bin/chat-thinking-mlx
  • examples/bin/chat-video-cpu
  • examples/bin/chat-video-mlx
  • examples/bin/chat-vision-cpu
  • examples/bin/chat-vision-mlx
  • examples/bin/classify-cpu
  • examples/bin/classify-mlx
  • examples/bin/discover-cpu
  • examples/bin/discover-mlx
  • examples/bin/embed-mlx
  • examples/bin/eval-cpu
  • examples/bin/eval-mlx
  • examples/bin/generate-cpu
  • examples/bin/generate-mlx
  • examples/bin/info-cpu
  • examples/bin/info-mlx
  • examples/bin/metrics-sink-cpu
  • examples/bin/metrics-sink-mlx
  • examples/bin/quantise-mlx
  • examples/bin/rerank-mlx
  • examples/bin/serve-cpu
  • examples/bin/serve-mlx
  • examples/bin/serve-multimodel-mlx
  • examples/bin/state-cpu
  • examples/bin/state-mlx
  • examples/bin/tokenizer-mlx
  • examples/bin/tools-mlx
  • examples/bin/trace-cpu
  • examples/bin/trace-mlx
  • examples/bin/train-sft-cpu
  • examples/bin/train-sft-mlx
  • examples/bin/train-ssd-cpu
  • examples/bin/train-ssd-mlx
  • examples/budget
  • examples/go.mod
  • examples/pkg/chat/mtp/README.md
  • examples/pkg/chat/mtp/main.go
  • examples/pkg/dflash/README.md
  • examples/pkg/dflash/main.go
  • examples/pkg/dotsocr/README.md
  • examples/pkg/dotsocr/main.go
  • examples/pkg/embed/main.go
  • examples/pkg/glmocr/README.md
  • examples/pkg/glmocr/main.go
  • examples/pkg/hybrid-quant/README.md
  • examples/pkg/hybrid-quant/main.go
  • examples/pkg/kvcache-turboquant/README.md
  • examples/pkg/kvcache-turboquant/main.go
  • examples/pkg/ocr/README.md
  • examples/pkg/ocr/main.go
  • examples/pkg/packed-moe/README.md
  • examples/pkg/packed-moe/main.go
  • examples/pkg/quantise/README.md
  • examples/pkg/reasoning-preservation/README.md
  • examples/pkg/reasoning-preservation/main.go
  • examples/pkg/rerank/main.go
  • examples/pkg/rwkv7-generate/README.md
  • examples/pkg/rwkv7-generate/main.go
  • examples/pkg/transcribe/README.md
  • examples/pkg/transcribe/main.go
  • examples/sdk/php/main.php
  • examples/thinking
  • examples/tools
  • go/agent/agent.go
  • go/agent/agent_execute.go
  • go/agent/agent_ssh.go
  • go/agent/ai/book_state_demo_http.go
  • go/agent/ai/metrics.go
  • go/agent/gitserver/gitserver.go
  • go/agent/gitserver/gitserver_example_test.go
  • go/agent/gitserver/gitserver_test.go
  • go/agent/gitserver/softserve.go
  • go/agent/gitserver/softserve_example_test.go
  • go/agent/gitserver/softserve_test.go
  • go/agent/helpers.go
  • go/agent/orchestrator/accept.go
  • go/agent/orchestrator/accept_example_test.go
  • go/agent/orchestrator/accept_test.go
  • go/agent/orchestrator/native.go
  • go/agent/orchestrator/native_example_test.go
  • go/agent/orchestrator/native_test.go
  • go/agent/orchestrator/orchestrator.go
  • go/agent/orchestrator/orchestrator_example_test.go
  • go/agent/orchestrator/orchestrator_test.go
  • go/agent/orchestrator/run.go
  • go/agent/orchestrator/run_bench_test.go
  • go/agent/orchestrator/run_example_test.go
  • go/agent/orchestrator/run_test.go
  • go/agent/orchestrator/store.go
  • go/agent/orchestrator/store_example_test.go
  • go/agent/orchestrator/store_test.go
  • go/agent/provider/claude.go
  • go/agent/provider/claude_example_test.go
  • go/agent/provider/claude_test.go
  • go/agent/provider/codex.go
  • go/agent/provider/codex_example_test.go
  • go/agent/provider/codex_test.go
  • go/agent/provider/opencode.go
  • go/agent/provider/opencode_example_test.go
  • go/agent/provider/opencode_test.go
  • go/agent/provider/parser.go
  • go/agent/provider/parser_bench_test.go
  • go/agent/provider/parser_example_test.go
  • go/agent/provider/parser_test.go
  • go/agent/provider/provider.go
  • go/agent/provider/provider_example_test.go
  • go/agent/provider/provider_test.go
  • go/agent/queue/config.go
  • go/agent/queue/config_example_test.go
  • go/agent/queue/config_test.go
  • go/agent/queue/controller.go
  • go/agent/queue/controller_bench_test.go
  • go/agent/queue/controller_example_test.go
  • go/agent/queue/controller_test.go
  • go/agent/work/work.go
  • go/agent/work/work_bench_test.go
  • go/agent/work/work_example_test.go
  • go/agent/work/work_test.go
  • go/agent/worker.go
  • go/agent/workspace/accept.go
  • go/agent/workspace/accept_example_test.go
  • go/agent/workspace/accept_test.go
  • go/agent/workspace/git.go
  • go/agent/workspace/git_example_test.go
  • go/agent/workspace/git_test.go
  • go/agent/workspace/workspace.go
  • go/agent/workspace/workspace_bench_test.go
  • go/agent/workspace/workspace_example_test.go
  • go/agent/workspace/workspace_test.go
  • go/dataset/dataset.go
  • go/dataset/dataset_example_test.go
  • go/dataset/dataset_test.go
  • go/dataset/doc.go
  • go/dataset/export.go
  • go/dataset/export_example_test.go
  • go/dataset/export_test.go
  • go/dataset/hash.go
  • go/dataset/hash_example_test.go
  • go/dataset/hash_test.go
  • go/dataset/ingest.go
  • go/dataset/ingest_example_test.go
  • go/dataset/ingest_test.go
  • go/dataset/score.go
  • go/dataset/score_example_test.go
  • go/dataset/score_test.go
  • go/dataset/screen.go
  • go/dataset/screen_test.go
  • go/dataset/store.go
  • go/dataset/store_example_test.go
  • go/dataset/store_test.go
  • go/decode/dflash/dflash.go
  • go/decode/dflash/dflash_test.go
  • go/decode/dflash/testdata/zlab_qwen3_4b_oracle.json
  • go/decode/dflash/zlab.go
  • go/decode/dflash/zlab_test.go
  • go/decode/generate/generate.go
  • go/decode/generate/generate_state.go
  • go/decode/generate/generate_test.go
  • go/decode/generate/multimodal.go
  • go/decode/parser/registry_test.go
  • go/decode/tokenizer/sentencepiece_model.go
  • go/decode/tokenizer/tokenizer.go
  • go/discover.go
  • go/docs/composed-strip-inventory.md
  • go/docs/zoo-moe-real-checkpoint-parity.md
  • go/engine/chat_template.go
  • go/engine/chat_template_test.go
  • go/engine/enginetest/quant_parity.go
  • go/engine/enginetest/quant_reference.go
  • go/engine/enginetest/quant_reference_test.go
  • go/engine/hip/GEMMA4_PERFORMANCE.md
  • go/engine/hip/PRODUCTION_READINESS.md
  • go/engine/hip/architecture.go
  • go/engine/hip/architecture_test.go
  • go/engine/hip/attached_drafter_textmodel.go
  • go/engine/hip/composed_runtime.go
  • go/engine/hip/composed_runtime_test.go
  • go/engine/hip/decode_helpers.go
  • go/engine/hip/decode_phase_trace.go
  • go/engine/hip/decode_phase_trace_test.go
  • go/engine/hip/decode_reference_test.go
  • go/engine/hip/diffusion_native_session.go
  • go/engine/hip/diffusion_session.go
  • go/engine/hip/diffusion_session_test.go
  • go/engine/hip/gemma4_architecture_adapter.go
  • go/engine/hip/gemma4_architecture_adapter_test.go
  • go/engine/hip/gemma4_audio_tower.go
  • go/engine/hip/gemma4_audio_tower_test.go
  • go/engine/hip/gemma4_engine_features.go
  • go/engine/hip/gemma4_engine_features_test.go
  • go/engine/hip/gemma4_model_features_bridge.go
  • go/engine/hip/gemma4_model_pack.go
  • go/engine/hip/gemma4_model_pack_portable.go
  • go/engine/hip/gemma4_native_config.go
  • go/engine/hip/gemma4_production_quantization.go
  • go/engine/hip/gemma4_unified_model_pack_test.go
  • go/engine/hip/gemma4_unified_vision.go
  • go/engine/hip/gemma4_unified_vision_test.go
  • go/engine/hip/gemma4_vision_encoder.go
  • go/engine/hip/gemma4_vision_encoder_test.go
  • go/engine/hip/hip_adamw_launch.go
  • go/engine/hip/hip_assert_portable_test.go
  • go/engine/hip/hip_attached_drafter_generate.go
  • go/engine/hip/hip_attached_drafter_verifier_plan.go
  • go/engine/hip/hip_audio_wav.go
  • go/engine/hip/hip_autoround_quant_launch.go
  • go/engine/hip/hip_bf16_portable.go
  • go/engine/hip/hip_codebook_launch.go
  • go/engine/hip/hip_diffusion_sample_launch.go
  • go/engine/hip/hip_diffusion_sample_launch_test.go
  • go/engine/hip/hip_driver_cgo.go
  • go/engine/hip/hip_driver_cgo_test.go
  • go/engine/hip/hip_embedding_launch.go
  • go/engine/hip/hip_embedding_launch_test.go
  • go/engine/hip/hip_gemma4_moe.go
  • go/engine/hip/hip_gemma4_q4_engine_config.go
  • go/engine/hip/hip_gemma4_q4_kv.go
  • go/engine/hip/hip_gemma4_q4_lane_forward.go
  • go/engine/hip/hip_gemma4_q4_lane_forward_test.go
  • go/engine/hip/hip_gemma4_q4_layer.go
  • go/engine/hip/hip_gemma4_q4_oracle_test.go
  • go/engine/hip/hip_gemma4_q4_prefill.go
  • go/engine/hip/hip_gguf_affine_adapter.go
  • go/engine/hip/hip_gguf_affine_adapter_test.go
  • go/engine/hip/hip_hardware_test.go
  • go/engine/hip/hip_jangtq_launch.go
  • go/engine/hip/hip_kernel_source_test.go
  • go/engine/hip/hip_kernels.go
  • go/engine/hip/hip_kernels_test.go
  • go/engine/hip/hip_kv_device.go
  • go/engine/hip/hip_lane_set.go
  • go/engine/hip/hip_lane_set_test.go
  • go/engine/hip/hip_launch.go
  • go/engine/hip/hip_launch_test.go
  • go/engine/hip/hip_lora_launch.go
  • go/engine/hip/hip_lora_model.go
  • go/engine/hip/hip_lora_model_test.go
  • go/engine/hip/hip_lora_trainer.go
  • go/engine/hip/hip_lora_trainer_test.go
  • go/engine/hip/hip_moe_combine_norms.go
  • go/engine/hip/hip_moe_launch.go
  • go/engine/hip/hip_moe_launch_test.go
  • go/engine/hip/hip_native_kernels.go
  • go/engine/hip/hip_projection_launch.go
  • go/engine/hip/hip_projection_reference.go
  • go/engine/hip/hip_runtime.go
  • go/engine/hip/hip_runtime_test.go
  • go/engine/hip/hip_small_decode.go
  • go/engine/hip/hip_small_decode_test.go
  • go/engine/hip/hip_tiny_model.go
  • go/engine/hip/hip_training_launch.go
  • go/engine/hip/hip_transformer_launch.go
  • go/engine/hip/hip_vision_image.go
  • go/engine/hip/inference_benchmark_test.go
  • go/engine/hip/inference_conformance_test.go
  • go/engine/hip/inference_kv_snapshot.go
  • go/engine/hip/inference_kv_snapshot_test.go
  • go/engine/hip/inference_memory.go
  • go/engine/hip/inference_memory_test.go
  • go/engine/hip/inference_model.go
  • go/engine/hip/inference_model_test.go
  • go/engine/hip/inference_session.go
  • go/engine/hip/inference_session_test.go
  • go/engine/hip/inference_state_blocks.go
  • go/engine/hip/inference_state_hardware_test.go
  • go/engine/hip/kernels/rocm_kernels.hip
  • go/engine/hip/kv_cache.go
  • go/engine/hip/kv_cache_raw.go
  • go/engine/hip/kv_cache_test.go
  • go/engine/hip/kv_contract.go
  • go/engine/hip/load_config.go
  • go/engine/hip/mamba2_runtime.go
  • go/engine/hip/mamba2_runtime_test.go
  • go/engine/hip/model/gemma4/identity_quant.go
  • go/engine/hip/model/gemma4/production_quantization.go
  • go/engine/hip/model/gemma4/qat_collection.go
  • go/engine/hip/model/gemma4/size_quant.go
  • go/engine/hip/model_pack.go
  • go/engine/hip/model_pack_api_stub.go
  • go/engine/hip/native.go
  • go/engine/hip/native_contract_test.go
  • go/engine/hip/portable_contract_stub.go
  • go/engine/hip/production_architecture_status.go
  • go/engine/hip/production_architecture_status_test.go
  • go/engine/hip/profile/architecture.go
  • go/engine/hip/reactive_sequence_mixer.go
  • go/engine/hip/scheduler.go
  • go/engine/hip/scheduler_test.go
  • go/engine/hip/trainer_capability_test.go
  • go/engine/metal/arch_gated_attn.go
  • go/engine/metal/arch_gated_delta.go
  • go/engine/metal/arch_gptoss_moe.go
  • go/engine/metal/arch_gptoss_moe_test.go
  • go/engine/metal/arch_qwen_fused.go
  • go/engine/metal/arch_qwen_moe.go
  • go/engine/metal/arch_qwen_moe_test.go
  • go/engine/metal/arch_session.go
  • go/engine/metal/arch_session_tq_hybrid_test.go
  • go/engine/metal/arch_session_tq_moe_test.go
  • go/engine/metal/arch_session_tq_test.go
  • go/engine/metal/assistant_dflash_proposer.go
  • go/engine/metal/assistant_dflash_zlab.go
  • go/engine/metal/assistant_dflash_zlab_acceptrate_test.go
  • go/engine/metal/assistant_dflash_zlab_test.go
  • go/engine/metal/assistant_draft_chain.go
  • go/engine/metal/assistant_draft_chain_test.go
  • go/engine/metal/assistant_draft_fused.go
  • go/engine/metal/assistant_draft_qhead.go
  • go/engine/metal/assistant_draft_qhead_test.go
  • go/engine/metal/assistant_gguf.go
  • go/engine/metal/assistant_load.go
  • go/engine/metal/assistant_load_test.go
  • go/engine/metal/attention.go
  • go/engine/metal/attn_core_backend.go
  • go/engine/metal/attn_core_backend_test.go
  • go/engine/metal/attn_qkv_device.go
  • go/engine/metal/backend.go
  • go/engine/metal/bf16_seam_backend.go
  • go/engine/metal/bf16_seam_backend_test.go
  • go/engine/metal/cache_plan.go
  • go/engine/metal/cache_plan_test.go
  • go/engine/metal/capture_hidden_olmoe_oracle_test.go
  • go/engine/metal/capture_hidden_qwen3_oracle_test.go
  • go/engine/metal/chained_gpu_decode_test.go
  • go/engine/metal/chat_template_config.go
  • go/engine/metal/composed_attn_qkv_device.go
  • go/engine/metal/composed_backend.go
  • go/engine/metal/composed_backend_test.go
  • go/engine/metal/composed_chat_template_test.go
  • go/engine/metal/composed_decode_census_test.go
  • go/engine/metal/composed_hook_receipts.go
  • go/engine/metal/composed_mlp_device.go
  • go/engine/metal/composed_quant_backend.go
  • go/engine/metal/composed_registry_test.go
  • go/engine/metal/composed_state_test.go
  • go/engine/metal/coverage_guard_test.go
  • go/engine/metal/decode_batched_session.go
  • go/engine/metal/decode_batched_tq.go
  • go/engine/metal/decode_batched_tq_test.go
  • go/engine/metal/decode_depth_tokps_test.go
  • go/engine/metal/decode_forward.go
  • go/engine/metal/decode_forward_arch.go
  • go/engine/metal/decode_forward_arch_icb.go
  • go/engine/metal/decode_forward_arch_icb_layout.go
  • go/engine/metal/decode_forward_arch_icb_layout_test.go
  • go/engine/metal/decode_forward_arch_icb_q8.go
  • go/engine/metal/decode_forward_arch_icb_q8_test.go
  • go/engine/metal/decode_forward_arch_icb_quant.go
  • go/engine/metal/decode_forward_arch_icb_tq.go
  • go/engine/metal/decode_forward_arch_quant.go
  • go/engine/metal/decode_forward_quant.go
  • go/engine/metal/decode_phase_trace.go
  • go/engine/metal/decode_phase_trace_test.go
  • go/engine/metal/decode_profile_hybrid_test.go
  • go/engine/metal/decode_step.go
  • go/engine/metal/decode_step_batched.go
  • go/engine/metal/decode_verify_icb.go
  • go/engine/metal/decode_verify_stack_icb.go
  • go/engine/metal/decode_verify_stack_icb_live_test.go
  • go/engine/metal/decode_verify_stack_icb_probe_test.go
  • go/engine/metal/decode_verify_stack_icb_test.go
  • go/engine/metal/decode_verify_stack_kvdiff_test.go
  • go/engine/metal/decode_verify_stack_stretch_test.go
  • go/engine/metal/dflash_zlab.go
  • go/engine/metal/dflash_zlab_test.go
  • go/engine/metal/dispatch_sink.go
  • go/engine/metal/e4b_nocopy_test.go
  • go/engine/metal/encsend.go
  • go/engine/metal/flash_prompt.go
  • go/engine/metal/fused_chain_backend.go
  • go/engine/metal/fused_chain_icb.go
  • go/engine/metal/fused_chain_moe.go
  • go/engine/metal/fused_chain_moe_test.go
  • go/engine/metal/fused_chain_targets.go
  • go/engine/metal/gated_delta_backend.go
  • go/engine/metal/gated_delta_input_device.go
  • go/engine/metal/gemma3_loader_test.go
  • go/engine/metal/gemma4_12b_mtp_shapes_test.go
  • go/engine/metal/generate_bf16.go
  • go/engine/metal/generation_config.go
  • go/engine/metal/gpu_busy_probe.go
  • go/engine/metal/gpu_capture.go
  • go/engine/metal/head_host_topk.go
  • go/engine/metal/head_host_topk_test.go
  • go/engine/metal/head_nocopy.go
  • go/engine/metal/head_nocopy_test.go
  • go/engine/metal/inference_model.go
  • go/engine/metal/inference_register.go
  • go/engine/metal/inference_register_test.go
  • go/engine/metal/kernel_pso_stats_test.go
  • go/engine/metal/kernel_receipts_bench_test.go
  • go/engine/metal/kernels/lthn_attn_core.metal
  • go/engine/metal/kernels/lthn_attn_vappend_f32.metal
  • go/engine/metal/kernels/lthn_gated_delta.metal
  • go/engine/metal/kernels/lthn_q4_lm_head_argmax.metal
  • go/engine/metal/kernels/lthn_qmv_rows.metal
  • go/engine/metal/kernels/lthn_sdpa_rtdim.metal
  • go/engine/metal/kernels/lthn_silu_gate_mul.metal
  • go/engine/metal/kernels/lthn_tq_kv.metal
  • go/engine/metal/kernels/lthn_turboquant.metal
  • go/engine/metal/kv_scan_floor_test.go
  • go/engine/metal/lane_set.go
  • go/engine/metal/lane_set_gemm.go
  • go/engine/metal/lane_set_gemm_test.go
  • go/engine/metal/lane_set_memory_test.go
  • go/engine/metal/lane_set_sampling.go
  • go/engine/metal/layer.go
  • go/engine/metal/load.go
  • go/engine/metal/load_context_ram.go
  • go/engine/metal/load_context_ram_test.go
  • go/engine/metal/load_helpers_test.go
  • go/engine/metal/load_shared.go
  • go/engine/metal/load_shared_test.go
  • go/engine/metal/load_test.go
  • go/engine/metal/lthn_gated_delta.go
  • go/engine/metal/lthn_gated_delta_test.go
  • go/engine/metal/lthn_kernels.go
  • go/engine/metal/lthn_topk_reduce_test.go
  • go/engine/metal/mamba2_backend.go
  • go/engine/metal/mamba2_backend_test.go
  • go/engine/metal/mamba2_session_state_test.go
  • go/engine/metal/memory_watermark.go
  • go/engine/metal/memory_watermark_test.go
  • go/engine/metal/mistral_session_test.go
  • go/engine/metal/mlp_bf16.go
  • go/engine/metal/mlp_device.go
  • go/engine/metal/model_quant_parity_test.go
  • go/engine/metal/moe.go
  • go/engine/metal/moe_batch.go
  • go/engine/metal/moe_block.go
  • go/engine/metal/moe_block_test.go
  • go/engine/metal/moe_clamped_swiglu.go
  • go/engine/metal/moe_clamped_swiglu_test.go
  • go/engine/metal/moe_quant_test.go
  • go/engine/metal/moe_zoo_generate_test.go
  • go/engine/metal/mtp.go
  • go/engine/metal/mtp_bench_test.go
  • go/engine/metal/mtp_exact_lane_test.go
  • go/engine/metal/mtp_rows_diag_26b_real_test.go
  • go/engine/metal/mtp_rows_driver.go
  • go/engine/metal/mtp_rows_driver_test.go
  • go/engine/metal/mtp_rows_moe.go
  • go/engine/metal/mtp_rows_moe_test.go
  • go/engine/metal/nocopy_weights.go
  • go/engine/metal/owned_bind_test.go
  • go/engine/metal/paged_kv_delta_test.go
  • go/engine/metal/paged_kv_device.go
  • go/engine/metal/paged_kv_test.go
  • go/engine/metal/piece_timing.go
  • go/engine/metal/probe_chained_tail_share_test.go
  • go/engine/metal/probe_prompt_reuse_parity_test.go
  • go/engine/metal/probe_train_forward_split_test.go
  • go/engine/metal/projector.go
  • go/engine/metal/projector_test.go
  • go/engine/metal/qknorm_rope.go
  • go/engine/metal/qmm_prompt_bench_test.go
  • go/engine/metal/qmv_rows.go
  • go/engine/metal/qmv_rows_test.go
  • go/engine/metal/quant_moe_fuse_bench_test.go
  • go/engine/metal/quant_moe_fuse_test.go
  • go/engine/metal/quant_seam_backend.go
  • go/engine/metal/quant_seam_backend_test.go
  • go/engine/metal/qwen3_decode_sanity_test.go
  • go/engine/metal/qwen3_gated_delta_backend_test.go
  • go/engine/metal/qwen_mtp_pair_test.go
  • go/engine/metal/qwen_vision.go
  • go/engine/metal/qwen_vision_device.go
  • go/engine/metal/qwen_vision_device_test.go
  • go/engine/metal/qwen_vision_encoder.go
  • go/engine/metal/qwen_vision_encoder_test.go
  • go/engine/metal/qwen_vision_model_test.go
  • go/engine/metal/real_checkpoint_gpu_test.go
  • go/engine/metal/real_checkpoint_olmoe_gpu_test.go
  • go/engine/metal/registry_arches_test.go
  • go/engine/metal/residual_norm_mlp_proj_gated_delta_input_device.go
  • go/engine/metal/residual_norm_mlp_quant_device.go
  • go/engine/metal/residual_norm_mlp_quant_device_test.go
  • go/engine/metal/rope_freqs_session_test.go
  • go/engine/metal/router.go
  • go/engine/metal/router_bench_test.go
  • go/engine/metal/router_test.go
  • go/engine/metal/rwkv7_backend.go
  • go/engine/metal/rwkv7_backend_test.go
  • go/engine/metal/rwkv7_device_parity_test.go
  • go/engine/metal/rwkv7_real_checkpoint_device_test.go
  • go/engine/metal/sdpa.go
  • go/engine/metal/sdpa_prompt_gemm.go
  • go/engine/metal/sdpa_rtdim.go
  • go/engine/metal/sdpa_rtdim_test.go
  • go/engine/metal/sdpa_sinks.go
  • go/engine/metal/sdpa_sinks_test.go
  • go/engine/metal/sdpa_vector_tq.go
  • go/engine/metal/sdpa_vector_tq_test.go
  • go/engine/metal/session_chat_template_test.go
  • go/engine/metal/session_name_guard_test.go
  • go/engine/metal/session_prompt_reuse.go
  • go/engine/metal/session_prompt_reuse_q8_test.go
  • go/engine/metal/session_state_blocks.go
  • go/engine/metal/session_state_tq.go
  • go/engine/metal/session_state_tq_test.go
  • go/engine/metal/speculative_model.go
  • go/engine/metal/spike_e2b_bench_test.go
  • go/engine/metal/stateful_session_test.go
  • go/engine/metal/test_helpers_test.go
  • go/engine/metal/testdata/e2b_mirror_oracle.py
  • go/engine/metal/testdata/e2b_mlx_reference.py
  • go/engine/metal/token_model.go
  • go/engine/metal/token_model_test.go
  • go/engine/metal/tq_kv_mode.go
  • go/engine/metal/tq_kv_mode_test.go
  • go/engine/metal/tq_kv_state.go
  • go/engine/metal/tq_live_e2e_test.go
  • go/engine/metal/train_backward.go
  • go/engine/metal/train_e2b_capture_vs_oracle_test.go
  • go/engine/metal/train_e2b_shared_sft_test.go
  • go/engine/metal/train_e2b_sublayer_probe_test.go
  • go/engine/metal/train_lora_layer.go
  • go/engine/metal/train_lora_layer_example_test.go
  • go/engine/metal/train_lora_layer_test.go
  • go/engine/metal/train_real_globals_probe_test.go
  • go/engine/metal/train_real_layer.go
  • go/engine/metal/train_real_layer_example_test.go
  • go/engine/metal/train_real_layer_test.go
  • go/engine/metal/train_real_shared.go
  • go/engine/metal/train_real_shared_test.go
  • go/engine/metal/train_session.go
  • go/engine/metal/train_session_test.go
  • go/engine/metal/train_softcap.go
  • go/engine/metal/train_softcap_test.go
  • go/engine/metal/train_trainer.go
  • go/engine/metal/train_trainer_layers.go
  • go/engine/metal/train_trainer_layers_test.go
  • go/engine/metal/train_trainer_mask_test.go
  • go/engine/metal/train_trainer_target_test.go
  • go/engine/metal/turboquant_capture_tap.go
  • go/engine/metal/turboquant_capture_tap_example_test.go
  • go/engine/metal/turboquant_capture_tap_test.go
  • go/engine/metal/turboquant_device.go
  • go/engine/metal/turboquant_device_test.go
  • go/engine/metal/turboquant_real_kv_capture_test.go
  • go/engine/metal/vision.go
  • go/engine/metal/vision_features.go
  • go/engine/metal/vision_helpers_test.go
  • go/engine/metal/zz_cover_inputs_test.go
  • go/engine/metal/zz_cover_wronglib_test.go
  • go/engine/model.go
  • go/engine/model_test.go
  • go/engine/prompt_reuse_test.go
  • go/engine/scheme/builtin.go
  • go/engine/scheme/builtin_test.go
  • go/engine/session.go
  • go/engine/session_test.go
  • go/engine/vision.go
  • go/engine/vision_test.go
  • go/eval/bench/matrix.go
  • go/eval/bench/matrix_test.go
  • go/eval/classify/classify.go
  • go/eval/classify/validate.go
  • go/eval/datapipe/db.go
  • go/eval/datapipe/helpers.go
  • go/eval/datapipe/influx.go
  • go/eval/datapipe/ingest.go
  • go/eval/datapipe/lql.go
  • go/eval/datapipe/lql_example_test.go
  • go/eval/datapipe/lql_test.go
  • go/eval/datapipe/parquet.go
  • go/eval/eval_example_test.go
  • go/eval/experiments/runner.go
  • go/eval/score/helpers.go
  • go/eval/score/judge.go
  • go/gguf.go
  • go/go.mod
  • go/inference.go
  • go/internal/enginegate/hfmodel.go
  • go/kv/blockcache/blockcache.go
  • go/kv/blocks.go
  • go/kv/snapshot_decode.go
  • go/kv/state_store.go
  • go/kv/turboquant/bits.go
  • go/kv/turboquant/bits_test.go
  • go/kv/turboquant/codec.go
  • go/kv/turboquant/codec_test.go
  • go/kv/turboquant/density.go
  • go/kv/turboquant/density_test.go
  • go/kv/turboquant/doc.go
  • go/kv/turboquant/export.go
  • go/kv/turboquant/export_test.go
  • go/kv/turboquant/groupquant.go
  • go/kv/turboquant/groupquant_test.go
  • go/kv/turboquant/instrument.go
  • go/kv/turboquant/instrument_test.go
  • go/kv/turboquant/lloydmax.go
  • go/kv/turboquant/lloydmax_test.go
  • go/kv/turboquant/matrix.go
  • go/kv/turboquant/matrix_test.go
  • go/kv/turboquant/mixed.go
  • go/kv/turboquant/mixed_test.go
  • go/kv/turboquant/qmse.go
  • go/kv/turboquant/qmse_test.go
  • go/kv/turboquant/qprod.go
  • go/kv/turboquant/qprod_test.go
  • go/kv/turboquant/real.go
  • go/kv/turboquant/real_test.go
  • go/kv/turboquant/vecmath.go
  • go/kv/turboquant/vecmath_test.go
  • go/kv/turboquant/wire.go
  • go/kv/turboquant/wire_test.go
  • go/model/arch.go
  • go/model/arch/CohereForAI/cohere/config.go
  • go/model/arch/CohereForAI/cohere/config_bench_test.go
  • go/model/arch/CohereForAI/cohere/config_example_test.go
  • go/model/arch/CohereForAI/cohere/config_test.go
  • go/model/arch/CohereForAI/cohere/register.go
  • go/model/arch/CohereForAI/cohere/register_test.go
  • go/model/arch/CohereForAI/cohere/testdata/CohereLabs-c4ai-command-r-v01-config.json
  • go/model/arch/CohereForAI/cohere/testdata/CohereLabs-c4ai-command-r-v01-model.safetensors.index.json
  • go/model/arch/CohereForAI/cohere/testdata/CohereLabs-c4ai-command-r7b-12-2024-config.json
  • go/model/arch/CohereForAI/cohere/testdata/CohereLabs-c4ai-command-r7b-12-2024-model.safetensors.index.json
  • go/model/arch/HuggingFaceTB/smollm3/config.go
  • go/model/arch/HuggingFaceTB/smollm3/config_bench_test.go
  • go/model/arch/HuggingFaceTB/smollm3/config_example_test.go
  • go/model/arch/HuggingFaceTB/smollm3/config_test.go
  • go/model/arch/HuggingFaceTB/smollm3/register.go
  • go/model/arch/HuggingFaceTB/smollm3/testdata/huggingface-smollm3-config.json
  • go/model/arch/HuggingFaceTB/smollm3/testdata/huggingface-smollm3-index-receipt.json
  • go/model/arch/LGAI-EXAONE/exaone4/exaone4.go
  • go/model/arch/LGAI-EXAONE/exaone4/exaone4_bench_test.go
  • go/model/arch/LGAI-EXAONE/exaone4/exaone4_example_test.go
  • go/model/arch/LGAI-EXAONE/exaone4/exaone4_test.go
  • go/model/arch/LGAI-EXAONE/exaone4/testdata/LGAI-EXAONE-EXAONE-4.0-32B-config.json
  • go/model/arch/LGAI-EXAONE/exaone4/testdata/LGAI-EXAONE-EXAONE-4.0-32B-model.safetensors.index.json
  • go/model/arch/Qwen/qwen2/config.go
  • go/model/arch/Qwen/qwen2/config_bench_test.go
  • go/model/arch/Qwen/qwen2/config_example_test.go
  • go/model/arch/Qwen/qwen2/config_test.go
  • go/model/arch/Qwen/qwen2/real_checkpoint_test.go
  • go/model/arch/Qwen/qwen2/register.go
  • go/model/arch/Qwen/qwen2/register_test.go
  • go/model/arch/Qwen/qwen2/testdata/qwen-qwen2-0.5b-config.json
  • go/model/arch/Qwen/qwen2/testdata/qwen-qwen2.5-0.5b-config.json
  • go/model/arch/Qwen/qwen2/testdata/qwen-qwen2.5-7b-model.safetensors.index.json
  • go/model/arch/Qwen/qwen3/gguf/register.go
  • go/model/arch/Qwen/qwen3/gguf/register_test.go
  • go/model/arch/Qwen/qwen3/qwen3.go
  • go/model/arch/Qwen/qwen3/qwen3_bench_test.go
  • go/model/arch/Qwen/qwen3/qwen3_example_test.go
  • go/model/arch/Qwen/qwen3/qwen3_test.go
  • go/model/arch/Qwen/qwen3/register.go
  • go/model/arch/Qwen/qwen3/register_bench_test.go
  • go/model/arch/Qwen/qwen35/dialect.go
  • go/model/arch/Qwen/qwen35/dialect_test.go
  • go/model/arch/Qwen/qwen35/mtp_drafter.go
  • go/model/arch/Qwen/qwen35/mtp_drafter_real_test.go
  • go/model/arch/Qwen/qwen35/mtp_drafter_test.go
  • go/model/arch/Qwen/qwen35/qwen35.go
  • go/model/arch/Qwen/qwen35/qwen35_test.go
  • go/model/arch/Qwen/qwen35/register.go
  • go/model/arch/Qwen/qwen35/register_test.go
  • go/model/arch/Qwen/qwen35/vision.go
  • go/model/arch/Qwen/qwen35/vision_loader.go
  • go/model/arch/Qwen/qwen35/vision_loader_test.go
  • go/model/arch/Qwen/qwen35/vision_preprocess.go
  • go/model/arch/Qwen/qwen35/vision_preprocess_test.go
  • go/model/arch/Qwen/qwen35/vision_real_test.go
  • go/model/arch/Qwen/qwen35/vision_test.go
  • go/model/arch/Qwen/qwen35/weights.go
  • go/model/arch/Qwen/qwen35/weights_test.go
  • go/model/arch/Qwen/qwenmoe/load_test.go
  • go/model/arch/Qwen/qwenmoe/qwenmoe.go
  • go/model/arch/Qwen/qwenmoe/qwenmoe_bench_test.go
  • go/model/arch/Qwen/qwenmoe/qwenmoe_example_test.go
  • go/model/arch/Qwen/qwenmoe/qwenmoe_test.go
  • go/model/arch/Qwen/qwenmoe/register.go
  • go/model/arch/Qwen/qwenmoe/register_test.go
  • go/model/arch/Qwen/qwenmoe/testdata/Qwen-Qwen1.5-MoE-A2.7B-config.json
  • go/model/arch/Qwen/qwenmoe/testdata/Qwen-Qwen1.5-MoE-A2.7B-model.safetensors.index.json
  • go/model/arch/Qwen/qwenmoe/testdata/Qwen-Qwen3-30B-A3B-config.json
  • go/model/arch/Qwen/qwenmoe/testdata/Qwen-Qwen3-30B-A3B-model.safetensors.index.json
  • go/model/arch/Qwen/qwenmoe/weights.go
  • go/model/arch/Qwen/qwenmoe/weights_test.go
  • go/model/arch/allenai/olmo/config.go
  • go/model/arch/allenai/olmo/config_bench_test.go
  • go/model/arch/allenai/olmo/config_example_test.go
  • go/model/arch/allenai/olmo/config_test.go
  • go/model/arch/allenai/olmo/integration_test.go
  • go/model/arch/allenai/olmo/register.go
  • go/model/arch/allenai/olmo/register_test.go
  • go/model/arch/allenai/olmo/testdata/allenai-olmo-1b-hf-config.json
  • go/model/arch/allenai/olmo/testdata/allenai-olmo-2-0425-1b-config.json
  • go/model/arch/allenai/olmo/testdata/allenai-olmo-2-1124-7b-model.safetensors.index.json
  • go/model/arch/allenai/olmo/testdata/allenai-olmo-7b-0724-hf-model.safetensors.index.json
  • go/model/arch/allenai/olmoe/config.go
  • go/model/arch/allenai/olmoe/config_bench_test.go
  • go/model/arch/allenai/olmoe/config_example_test.go
  • go/model/arch/allenai/olmoe/config_test.go
  • go/model/arch/allenai/olmoe/load_test.go
  • go/model/arch/allenai/olmoe/register.go
  • go/model/arch/allenai/olmoe/register_test.go
  • go/model/arch/allenai/olmoe/testdata/allenai-olmoe-1b-7b-0924-config.json
  • go/model/arch/allenai/olmoe/testdata/allenai-olmoe-1b-7b-0924-model.safetensors.index.json
  • go/model/arch/allenai/olmoe/weights.go
  • go/model/arch/allenai/olmoe/weights_test.go
  • go/model/arch/baidu/ernie45/ernie45.go
  • go/model/arch/baidu/ernie45/ernie45_bench_test.go
  • go/model/arch/baidu/ernie45/ernie45_example_test.go
  • go/model/arch/baidu/ernie45/ernie45_test.go
  • go/model/arch/baidu/ernie45/testdata/baidu-ERNIE-4.5-0.3B-PT-config.json
  • go/model/arch/baidu/ernie45/testdata/mlx-community-ERNIE-4.5-0.3B-PT-bf16-model.safetensors.index.json
  • go/model/arch/bert/config.go
  • go/model/arch/bert/config_example_test.go
  • go/model/arch/bert/config_test.go
  • go/model/arch/bert/encoder.go
  • go/model/arch/bert/encoder_bench_test.go
  • go/model/arch/bert/encoder_test.go
  • go/model/arch/bert/model.go
  • go/model/arch/bert/model_bench_test.go
  • go/model/arch/bert/model_example_test.go
  • go/model/arch/bert/model_test.go
  • go/model/arch/bert/parity_test.go
  • go/model/arch/bert/pooling.go
  • go/model/arch/bert/pooling_test.go
  • go/model/arch/bert/serve_model.go
  • go/model/arch/bert/serve_model_example_test.go
  • go/model/arch/bert/serve_model_test.go
  • go/model/arch/bert/testdata/bge_small_reference.json
  • go/model/arch/bert/testdata/dump_cross_encoder_reference.py
  • go/model/arch/bert/testdata/dump_reference.py
  • go/model/arch/bert/testdata/ms_marco_cross_encoder_reference.json
  • go/model/arch/bert/tokenizer.go
  • go/model/arch/bert/tokenizer_bench_test.go
  • go/model/arch/bert/tokenizer_example_test.go
  • go/model/arch/bert/tokenizer_test.go
  • go/model/arch/bert/weights.go
  • go/model/arch/bigcode/starcoder2/config.go
  • go/model/arch/bigcode/starcoder2/config_bench_test.go
  • go/model/arch/bigcode/starcoder2/config_example_test.go
  • go/model/arch/bigcode/starcoder2/config_test.go
  • go/model/arch/bigcode/starcoder2/register.go
  • go/model/arch/bigcode/starcoder2/register_test.go
  • go/model/arch/bigcode/starcoder2/testdata/bigcode-starcoder2-3b-config.json
  • go/model/arch/bigcode/starcoder2/testdata/bigcode-starcoder2-7b-model.safetensors.index.json
  • go/model/arch/bigcode/starcoder2/testdata/salesforce-codegen-350m-mono-config.json
  • go/model/arch/bloom/config.go
  • go/model/arch/bloom/config_example_test.go
  • go/model/arch/bloom/config_test.go
  • go/model/arch/bloom/register.go
  • go/model/arch/bloom/register_test.go
  • go/model/arch/databricks/dbrx/config.go
  • go/model/arch/databricks/dbrx/config_bench_test.go
  • go/model/arch/databricks/dbrx/config_example_test.go
  • go/model/arch/databricks/dbrx/config_test.go
  • go/model/arch/databricks/dbrx/load_test.go
  • go/model/arch/databricks/dbrx/register.go
  • go/model/arch/databricks/dbrx/register_example_test.go
  • go/model/arch/databricks/dbrx/register_test.go
  • go/model/arch/databricks/dbrx/weights.go
  • go/model/arch/databricks/dbrx/weights_test.go
  • go/model/arch/deepseek-ai/deepseek/config.go
  • go/model/arch/deepseek-ai/deepseek/config_example_test.go
  • go/model/arch/deepseek-ai/deepseek/config_test.go
  • go/model/arch/deepseek-ai/deepseek/register.go
  • go/model/arch/deepseek-ai/deepseek/register_example_test.go
  • go/model/arch/deepseek-ai/deepseek/register_test.go
  • go/model/arch/deepseek-ai/deepseek/testdata/deepseek-ai-deepseek-v2-lite-config.json
  • go/model/arch/deepseek-ai/deepseekvl2/config.go
  • go/model/arch/deepseek-ai/deepseekvl2/config_example_test.go
  • go/model/arch/deepseek-ai/deepseekvl2/config_test.go
  • go/model/arch/deepseek-ai/deepseekvl2/decoder.go
  • go/model/arch/deepseek-ai/deepseekvl2/decoder_test.go
  • go/model/arch/deepseek-ai/deepseekvl2/golden_test.go
  • go/model/arch/deepseek-ai/deepseekvl2/live_test.go
  • go/model/arch/deepseek-ai/deepseekvl2/mathops.go
  • go/model/arch/deepseek-ai/deepseekvl2/ocr.go
  • go/model/arch/deepseek-ai/deepseekvl2/ocr_example_test.go
  • go/model/arch/deepseek-ai/deepseekvl2/ocr_test.go
  • go/model/arch/deepseek-ai/deepseekvl2/register.go
  • go/model/arch/deepseek-ai/deepseekvl2/register_test.go
  • go/model/arch/deepseek-ai/deepseekvl2/testdata/decoder_toy_golden.json
  • go/model/arch/deepseek-ai/deepseekvl2/testdata/e2e_golden.json
  • go/model/arch/deepseek-ai/deepseekvl2/testdata/e2e_vision_golden.json
  • go/model/arch/deepseek-ai/deepseekvl2/testdata/gen_fixture.py
  • go/model/arch/deepseek-ai/deepseekvl2/testdata/moe_gate_real_golden.json
  • go/model/arch/deepseek-ai/deepseekvl2/testdata/vision_toy_golden.json
  • go/model/arch/deepseek-ai/deepseekvl2/tokens.go
  • go/model/arch/deepseek-ai/deepseekvl2/tokens_test.go
  • go/model/arch/deepseek-ai/deepseekvl2/vision.go
  • go/model/arch/deepseek-ai/deepseekvl2/vision_clip.go
  • go/model/arch/deepseek-ai/deepseekvl2/vision_clip_test.go
  • go/model/arch/deepseek-ai/deepseekvl2/vision_example_test.go
  • go/model/arch/deepseek-ai/deepseekvl2/vision_sam.go
  • go/model/arch/deepseek-ai/deepseekvl2/vision_sam_test.go
  • go/model/arch/deepseek-ai/deepseekvl2/vision_test.go
  • go/model/arch/deepseek-ai/deepseekvl2/weights.go
  • go/model/arch/deepseek-ai/deepseekvl2/weights_clip.go
  • go/model/arch/deepseek-ai/deepseekvl2/weights_decoder.go
  • go/model/arch/deepseek-ai/deepseekvl2/weights_sam.go
  • go/model/arch/deepseek-ai/deepseekvl2/weights_test.go
  • go/model/arch/deltanet/deltanet.go
  • go/model/arch/deltanet/deltanet_bench_test.go
  • go/model/arch/deltanet/deltanet_example_test.go
  • go/model/arch/deltanet/deltanet_test.go
  • go/model/arch/deltanet/hf_cross_test.go
  • go/model/arch/google/gemma3/gemma3.go
  • go/model/arch/google/gemma3/gemma3_bench_test.go
  • go/model/arch/google/gemma3/gemma3_example_test.go
  • go/model/arch/google/gemma3/gemma3_test.go
  • go/model/arch/google/gemma3/gguf/convert.go
  • go/model/arch/google/gemma3/gguf/convert_test.go
  • go/model/arch/google/gemma3/gguf/metadata.go
  • go/model/arch/google/gemma3/gguf/metadata_test.go
  • go/model/arch/google/gemma3/gguf/names.go
  • go/model/arch/google/gemma3/gguf/names_example_test.go
  • go/model/arch/google/gemma3/gguf/names_test.go
  • go/model/arch/google/gemma3/gguf/register.go
  • go/model/arch/google/gemma3/gguf/tokenizer.go
  • go/model/arch/google/gemma3/gguf/tokenizer_test.go
  • go/model/arch/google/gemma3/gguf/types.go
  • go/model/arch/google/gemma3/gguf/types_test.go
  • go/model/arch/google/gemma3/register.go
  • go/model/arch/gpt2/config.go
  • go/model/arch/gpt2/config_example_test.go
  • go/model/arch/gpt2/config_test.go
  • go/model/arch/gpt2/parity_test.go
  • go/model/arch/gpt2/register.go
  • go/model/arch/gpt2/weights.go
  • go/model/arch/gpt2/weights_example_test.go
  • go/model/arch/gpt2/weights_test.go
  • go/model/arch/gptneox/config.go
  • go/model/arch/gptneox/config_bench_test.go
  • go/model/arch/gptneox/config_example_test.go
  • go/model/arch/gptneox/config_test.go
  • go/model/arch/gptneox/register.go
  • go/model/arch/gptneox/register_example_test.go
  • go/model/arch/gptneox/register_test.go
  • go/model/arch/ibm-granite/granite/config.go
  • go/model/arch/ibm-granite/granite/config_bench_test.go
  • go/model/arch/ibm-granite/granite/config_example_test.go
  • go/model/arch/ibm-granite/granite/config_test.go
  • go/model/arch/ibm-granite/granite/register.go
  • go/model/arch/ibm-granite/granite/register_test.go
  • go/model/arch/ibm-granite/granite/testdata/ibm-granite-granite-3.3-2b-base-config.json
  • go/model/arch/ibm-granite/granite/testdata/ibm-granite-granite-3.3-2b-base-model.safetensors.index.json
  • go/model/arch/ibm-granite/granitemoe/config.go
  • go/model/arch/ibm-granite/granitemoe/config_bench_test.go
  • go/model/arch/ibm-granite/granitemoe/config_example_test.go
  • go/model/arch/ibm-granite/granitemoe/config_test.go
  • go/model/arch/ibm-granite/granitemoe/load_test.go
  • go/model/arch/ibm-granite/granitemoe/register.go
  • go/model/arch/ibm-granite/granitemoe/register_example_test.go
  • go/model/arch/ibm-granite/granitemoe/register_test.go
  • go/model/arch/ibm-granite/granitemoe/testdata/ibm-granite-granite-3.1-1b-a400m-base-config.json
  • go/model/arch/ibm-granite/granitemoe/testdata/ibm-granite-granite-3.1-1b-a400m-base-model.safetensors.index.json
  • go/model/arch/ibm-granite/granitemoe/weights.go
  • go/model/arch/ibm-granite/granitemoe/weights_test.go
  • go/model/arch/jetmoe/MOA_GAP.md
  • go/model/arch/jetmoe/config.go
  • go/model/arch/jetmoe/config_bench_test.go
  • go/model/arch/jetmoe/config_example_test.go
  • go/model/arch/jetmoe/config_test.go
  • go/model/arch/jetmoe/register.go
  • go/model/arch/jetmoe/register_example_test.go
  • go/model/arch/jetmoe/register_test.go
  • go/model/arch/jetmoe/testdata/jetmoe-jetmoe-8b-config.json
  • go/model/arch/jetmoe/testdata/jetmoe-jetmoe-8b-model.safetensors.index.json
  • go/model/arch/jetmoe/weights.go
  • go/model/arch/jetmoe/weights_test.go
  • go/model/arch/mamba2/backend.go
  • go/model/arch/mamba2/backend_bench_test.go
  • go/model/arch/mamba2/block.go
  • go/model/arch/mamba2/block_bench_test.go
  • go/model/arch/mamba2/block_example_test.go
  • go/model/arch/mamba2/block_test.go
  • go/model/arch/mamba2/conv.go
  • go/model/arch/mamba2/conv_bench_test.go
  • go/model/arch/mamba2/conv_example_test.go
  • go/model/arch/mamba2/conv_test.go
  • go/model/arch/mamba2/loader.go
  • go/model/arch/mamba2/loader_bench_test.go
  • go/model/arch/mamba2/loader_example_test.go
  • go/model/arch/mamba2/loader_test.go
  • go/model/arch/mamba2/model.go
  • go/model/arch/mamba2/model_bench_test.go
  • go/model/arch/mamba2/model_example_test.go
  • go/model/arch/mamba2/model_test.go
  • go/model/arch/mamba2/scan.go
  • go/model/arch/mamba2/scan_bench_test.go
  • go/model/arch/mamba2/scan_example_test.go
  • go/model/arch/mamba2/scan_test.go
  • go/model/arch/mamba2/smoke_test.go
  • go/model/arch/mamba2/token_model.go
  • go/model/arch/mamba2/token_model_bench_test.go
  • go/model/arch/mamba2/token_model_example_test.go
  • go/model/arch/mamba2/token_model_test.go
  • go/model/arch/meta-llama/llama/config.go
  • go/model/arch/meta-llama/llama/config_bench_test.go
  • go/model/arch/meta-llama/llama/config_example_test.go
  • go/model/arch/meta-llama/llama/config_test.go
  • go/model/arch/meta-llama/llama/gguf/convert.go
  • go/model/arch/meta-llama/llama/gguf/convert_test.go
  • go/model/arch/meta-llama/llama/gguf/metadata.go
  • go/model/arch/meta-llama/llama/gguf/metadata_test.go
  • go/model/arch/meta-llama/llama/gguf/names.go
  • go/model/arch/meta-llama/llama/gguf/names_test.go
  • go/model/arch/meta-llama/llama/gguf/register.go
  • go/model/arch/meta-llama/llama/gguf/tokenizer.go
  • go/model/arch/meta-llama/llama/gguf/types.go
  • go/model/arch/meta-llama/llama/gguf/types_test.go
  • go/model/arch/meta-llama/llama/register.go
  • go/model/arch/meta-llama/llama/register_test.go
  • go/model/arch/meta-llama/llama/testdata/meta-llama-llama-3.1-8b-config.json
  • go/model/arch/meta-llama/llama/testdata/meta-llama-llama-3.2-1b-config.json
  • go/model/arch/meta-llama/llama4/config.go
  • go/model/arch/meta-llama/llama4/config_example_test.go
  • go/model/arch/meta-llama/llama4/config_test.go
  • go/model/arch/meta-llama/llama4/load_test.go
  • go/model/arch/meta-llama/llama4/register.go
  • go/model/arch/meta-llama/llama4/register_example_test.go
  • go/model/arch/meta-llama/llama4/register_test.go
  • go/model/arch/meta-llama/llama4/testdata/meta-llama-llama-4-scout-17b-16e-instruct-config.json
  • go/model/arch/meta-llama/llama4/testdata/meta-llama-llama-4-scout-17b-16e-instruct-model-index-excerpt.json
  • go/model/arch/meta-llama/llama4/weights.go
  • go/model/arch/meta-llama/llama4/weights_test.go
  • go/model/arch/microsoft/phi/config.go
  • go/model/arch/microsoft/phi/config_example_test.go
  • go/model/arch/microsoft/phi/config_test.go
  • go/model/arch/microsoft/phi/gguf/register.go
  • go/model/arch/microsoft/phi/gguf/register_test.go
  • go/model/arch/microsoft/phi/register.go
  • go/model/arch/microsoft/phi/register_example_test.go
  • go/model/arch/microsoft/phi/register_test.go
  • go/model/arch/microsoft/phi/testdata/microsoft-phi-2-config.json
  • go/model/arch/microsoft/phi/testdata/microsoft-phi-2-model.safetensors.index.json
  • go/model/arch/microsoft/phi/testdata/microsoft-phi-3-mini-128k-instruct-config.json
  • go/model/arch/microsoft/phi/testdata/microsoft-phi-3-mini-4k-instruct-config.json
  • go/model/arch/microsoft/phi/testdata/microsoft-phi-3-mini-4k-instruct-model.safetensors.index.json
  • go/model/arch/mistralai/mistral/config.go
  • go/model/arch/mistralai/mistral/config_bench_test.go
  • go/model/arch/mistralai/mistral/config_example_test.go
  • go/model/arch/mistralai/mistral/config_test.go
  • go/model/arch/mistralai/mistral/gguf/register.go
  • go/model/arch/mistralai/mistral/gguf/register_test.go
  • go/model/arch/mistralai/mistral/register.go
  • go/model/arch/mistralai/mistral/register_test.go
  • go/model/arch/mistralai/mistral/yarn.go
  • go/model/arch/mistralai/mistral/yarn_branches_test.go
  • go/model/arch/mistralai/mistral/yarn_example_test.go
  • go/model/arch/mistralai/mistral/yarn_test.go
  • go/model/arch/mistralai/mixtral/config.go
  • go/model/arch/mistralai/mixtral/config_example_test.go
  • go/model/arch/mistralai/mixtral/config_test.go
  • go/model/arch/mistralai/mixtral/load_test.go
  • go/model/arch/mistralai/mixtral/register.go
  • go/model/arch/mistralai/mixtral/register_example_test.go
  • go/model/arch/mistralai/mixtral/register_test.go
  • go/model/arch/mistralai/mixtral/testdata/mistralai-mixtral-8x7b-v0.1-config.json
  • go/model/arch/mistralai/mixtral/weights.go
  • go/model/arch/mistralai/mixtral/weights_test.go
  • go/model/arch/mpt/config.go
  • go/model/arch/mpt/config_bench_test.go
  • go/model/arch/mpt/config_example_test.go
  • go/model/arch/mpt/config_test.go
  • go/model/arch/mpt/register.go
  • go/model/arch/mpt/testdata/adamrb-mpt-30b-chat-config.json
  • go/model/arch/mpt/testdata/adamrb-mpt-30b-chat-index-receipt.json
  • go/model/arch/openai/gptoss/arch_test.go
  • go/model/arch/openai/gptoss/config.go
  • go/model/arch/openai/gptoss/config_example_test.go
  • go/model/arch/openai/gptoss/config_test.go
  • go/model/arch/openai/gptoss/live_generate_test.go
  • go/model/arch/openai/gptoss/live_test.go
  • go/model/arch/openai/gptoss/register.go
  • go/model/arch/openai/gptoss/register_test.go
  • go/model/arch/openai/gptoss/testdata/openai-gpt-oss-20b-config.json
  • go/model/arch/openai/gptoss/weights.go
  • go/model/arch/openai/gptoss/weights_test.go
  • go/model/arch/openai/gptoss/yarn.go
  • go/model/arch/openai/gptoss/yarn_test.go
  • go/model/arch/openai/privacyfilter/config.go
  • go/model/arch/openai/privacyfilter/config_example_test.go
  • go/model/arch/openai/privacyfilter/config_test.go
  • go/model/arch/openai/privacyfilter/register.go
  • go/model/arch/openai/privacyfilter/register_test.go
  • go/model/arch/openai/privacyfilter/testdata/openai-privacy-filter-config.json
  • go/model/arch/openai/whisper/attention.go
  • go/model/arch/openai/whisper/attention_test.go
  • go/model/arch/openai/whisper/config.go
  • go/model/arch/openai/whisper/config_example_test.go
  • go/model/arch/openai/whisper/config_test.go
  • go/model/arch/openai/whisper/decoder.go
  • go/model/arch/openai/whisper/decoder_example_test.go
  • go/model/arch/openai/whisper/decoder_test.go
  • go/model/arch/openai/whisper/encoder.go
  • go/model/arch/openai/whisper/encoder_example_test.go
  • go/model/arch/openai/whisper/encoder_test.go
  • go/model/arch/openai/whisper/generation_config.go
  • go/model/arch/openai/whisper/generation_config_example_test.go
  • go/model/arch/openai/whisper/generation_config_test.go
  • go/model/arch/openai/whisper/golden_test.go
  • go/model/arch/openai/whisper/live_test.go
  • go/model/arch/openai/whisper/mel.go
  • go/model/arch/openai/whisper/mel_example_test.go
  • go/model/arch/openai/whisper/mel_test.go
  • go/model/arch/openai/whisper/register.go
  • go/model/arch/openai/whisper/register_test.go
  • go/model/arch/openai/whisper/testdata/e2e_golden.json
  • go/model/arch/openai/whisper/testdata/generation_config.json
  • go/model/arch/openai/whisper/testdata/mel_golden.json
  • go/model/arch/openai/whisper/testdata/openai-whisper-tiny-config.json
  • go/model/arch/openai/whisper/testdata/preprocessor_config.json
  • go/model/arch/openai/whisper/testdata/toy_block_goldens.json
  • go/model/arch/openai/whisper/tokens.go
  • go/model/arch/openai/whisper/tokens_example_test.go
  • go/model/arch/openai/whisper/tokens_test.go
  • go/model/arch/openai/whisper/transcribe.go
  • go/model/arch/openai/whisper/transcribe_example_test.go
  • go/model/arch/openai/whisper/transcribe_test.go
  • go/model/arch/openai/whisper/wav.go
  • go/model/arch/openai/whisper/wav_example_test.go
  • go/model/arch/openai/whisper/wav_test.go
  • go/model/arch/openai/whisper/weights.go
  • go/model/arch/openai/whisper/weights_example_test.go
  • go/model/arch/openai/whisper/weights_test.go
  • go/model/arch/opt/config.go
  • go/model/arch/opt/config_bench_test.go
  • go/model/arch/opt/config_example_test.go
  • go/model/arch/opt/config_test.go
  • go/model/arch/opt/parity_test.go
  • go/model/arch/opt/register.go
  • go/model/arch/opt/register_test.go
  • go/model/arch/opt/testdata/facebook-opt-1.3b-config.json
  • go/model/arch/opt/testdata/facebook-opt-125m-config.json
  • go/model/arch/opt/testdata/facebook-opt-350m-config.json
  • go/model/arch/opt/weights.go
  • go/model/arch/opt/weights_bench_test.go
  • go/model/arch/opt/weights_example_test.go
  • go/model/arch/opt/weights_test.go
  • go/model/arch/rednote-hilab/dotsocr/config.go
  • go/model/arch/rednote-hilab/dotsocr/config_example_test.go
  • go/model/arch/rednote-hilab/dotsocr/config_test.go
  • go/model/arch/rednote-hilab/dotsocr/decoder.go
  • go/model/arch/rednote-hilab/dotsocr/decoder_test.go
  • go/model/arch/rednote-hilab/dotsocr/generation_config.go
  • go/model/arch/rednote-hilab/dotsocr/golden_test.go
  • go/model/arch/rednote-hilab/dotsocr/image.go
  • go/model/arch/rednote-hilab/dotsocr/image_test.go
  • go/model/arch/rednote-hilab/dotsocr/live_test.go
  • go/model/arch/rednote-hilab/dotsocr/math.go
  • go/model/arch/rednote-hilab/dotsocr/ocr.go
  • go/model/arch/rednote-hilab/dotsocr/ocr_test.go
  • go/model/arch/rednote-hilab/dotsocr/prompt.go
  • go/model/arch/rednote-hilab/dotsocr/prompt_test.go
  • go/model/arch/rednote-hilab/dotsocr/register.go
  • go/model/arch/rednote-hilab/dotsocr/register_test.go
  • go/model/arch/rednote-hilab/dotsocr/testdata/e2e_golden.json
  • go/model/arch/rednote-hilab/dotsocr/testdata/gen_fixture.py
  • go/model/arch/rednote-hilab/dotsocr/testdata/image_preproc_golden.json
  • go/model/arch/rednote-hilab/dotsocr/testdata/prompt_golden.json
  • go/model/arch/rednote-hilab/dotsocr/testdata/smart_resize_golden.json
  • go/model/arch/rednote-hilab/dotsocr/testdata/text_layer_golden.json
  • go/model/arch/rednote-hilab/dotsocr/testdata/vision_block_golden.json
  • go/model/arch/rednote-hilab/dotsocr/vision.go
  • go/model/arch/rednote-hilab/dotsocr/vision_test.go
  • go/model/arch/rednote-hilab/dotsocr/weights.go
  • go/model/arch/rednote-hilab/dotsocr/weights_test.go
  • go/model/arch/rwkv7/backend.go
  • go/model/arch/rwkv7/backend_bench_test.go
  • go/model/arch/rwkv7/block.go
  • go/model/arch/rwkv7/block_bench_test.go
  • go/model/arch/rwkv7/block_example_test.go
  • go/model/arch/rwkv7/block_test.go
  • go/model/arch/rwkv7/channelmix.go
  • go/model/arch/rwkv7/channelmix_test.go
  • go/model/arch/rwkv7/config.go
  • go/model/arch/rwkv7/config_test.go
  • go/model/arch/rwkv7/data/rwkv_vocab_v20230424.hex
  • go/model/arch/rwkv7/loader.go
  • go/model/arch/rwkv7/loader_example_test.go
  • go/model/arch/rwkv7/loader_test.go
  • go/model/arch/rwkv7/lora.go
  • go/model/arch/rwkv7/lora_test.go
  • go/model/arch/rwkv7/model.go
  • go/model/arch/rwkv7/model_example_test.go
  • go/model/arch/rwkv7/model_test.go
  • go/model/arch/rwkv7/norm.go
  • go/model/arch/rwkv7/norm_test.go
  • go/model/arch/rwkv7/real_checkpoint_test.go
  • go/model/arch/rwkv7/recurrence.go
  • go/model/arch/rwkv7/recurrence_bench_test.go
  • go/model/arch/rwkv7/recurrence_example_test.go
  • go/model/arch/rwkv7/recurrence_test.go
  • go/model/arch/rwkv7/testdata/oracle_fixture.json
  • go/model/arch/rwkv7/testdata/oracle_rwkv7.py
  • go/model/arch/rwkv7/timemix.go
  • go/model/arch/rwkv7/timemix_test.go
  • go/model/arch/rwkv7/token_model.go
  • go/model/arch/rwkv7/token_model_example_test.go
  • go/model/arch/rwkv7/token_model_test.go
  • go/model/arch/rwkv7/tokenizer.go
  • go/model/arch/rwkv7/tokenizer_example_test.go
  • go/model/arch/rwkv7/tokenizer_test.go
  • go/model/arch/stabilityai/stablelm/config.go
  • go/model/arch/stabilityai/stablelm/config_bench_test.go
  • go/model/arch/stabilityai/stablelm/config_example_test.go
  • go/model/arch/stabilityai/stablelm/config_test.go
  • go/model/arch/stabilityai/stablelm/register.go
  • go/model/arch/stabilityai/stablelm/testdata/stabilityai-stablelm-2-12b-config.json
  • go/model/arch/stabilityai/stablelm/testdata/stabilityai-stablelm-2-12b-index-receipt.json
  • go/model/arch/tencent/hunyuan/hunyuan.go
  • go/model/arch/tencent/hunyuan/hunyuan_bench_test.go
  • go/model/arch/tencent/hunyuan/hunyuan_example_test.go
  • go/model/arch/tencent/hunyuan/hunyuan_test.go
  • go/model/arch/tencent/hunyuan/testdata/tencent-Hunyuan-7B-Instruct-config.json
  • go/model/arch/tencent/hunyuan/testdata/tencent-Hunyuan-7B-Instruct-model.safetensors.index.json
  • go/model/arch/tiiuae/falcon/config.go
  • go/model/arch/tiiuae/falcon/config_example_test.go
  • go/model/arch/tiiuae/falcon/config_test.go
  • go/model/arch/tiiuae/falcon/register.go
  • go/model/arch/tiiuae/falcon/register_test.go
  • go/model/arch/z-lab/dflash/dflash.go
  • go/model/arch/z-lab/dflash/dflash_example_test.go
  • go/model/arch/z-lab/dflash/dflash_test.go
  • go/model/arch/zai-org/glm4/glm4.go
  • go/model/arch/zai-org/glm4/glm4_bench_test.go
  • go/model/arch/zai-org/glm4/glm4_example_test.go
  • go/model/arch/zai-org/glm4/glm4_test.go
  • go/model/arch/zai-org/glm4/testdata/zai-org-GLM-4-9B-0414-config.json
  • go/model/arch/zai-org/glm4/testdata/zai-org-GLM-4-9B-0414-model.safetensors.index.json
  • go/model/arch/zai-org/glmocr/config.go
  • go/model/arch/zai-org/glmocr/config_example_test.go
  • go/model/arch/zai-org/glmocr/config_test.go
  • go/model/arch/zai-org/glmocr/golden_test.go
  • go/model/arch/zai-org/glmocr/image.go
  • go/model/arch/zai-org/glmocr/image_example_test.go
  • go/model/arch/zai-org/glmocr/image_test.go
  • go/model/arch/zai-org/glmocr/live_test.go
  • go/model/arch/zai-org/glmocr/ocr.go
  • go/model/arch/zai-org/glmocr/ocr_example_test.go
  • go/model/arch/zai-org/glmocr/ocr_test.go
  • go/model/arch/zai-org/glmocr/primitives.go
  • go/model/arch/zai-org/glmocr/primitives_test.go
  • go/model/arch/zai-org/glmocr/prompt.go
  • go/model/arch/zai-org/glmocr/prompt_example_test.go
  • go/model/arch/zai-org/glmocr/prompt_test.go
  • go/model/arch/zai-org/glmocr/register.go
  • go/model/arch/zai-org/glmocr/register_test.go
  • go/model/arch/zai-org/glmocr/rope.go
  • go/model/arch/zai-org/glmocr/rope_test.go
  • go/model/arch/zai-org/glmocr/testdata/block_goldens.json
  • go/model/arch/zai-org/glmocr/testdata/e2e_golden.json
  • go/model/arch/zai-org/glmocr/testdata/gen_fixture.py
  • go/model/arch/zai-org/glmocr/textdecoder.go
  • go/model/arch/zai-org/glmocr/textdecoder_example_test.go
  • go/model/arch/zai-org/glmocr/textdecoder_test.go
  • go/model/arch/zai-org/glmocr/vision.go
  • go/model/arch/zai-org/glmocr/vision_example_test.go
  • go/model/arch/zai-org/glmocr/vision_test.go
  • go/model/arch/zai-org/glmocr/weights.go
  • go/model/arch/zai-org/glmocr/weights_example_test.go
  • go/model/arch/zai-org/glmocr/weights_test.go
  • go/model/arch_spec.go
  • go/model/arch_test.go
  • go/model/assemble.go
  • go/model/assemble_gated_delta.go
  • go/model/assemble_gated_delta_test.go
  • go/model/assemble_moe_shared_test.go
  • go/model/assemble_test.go
  • go/model/attn/gated_delta.go
  • go/model/attn/gated_delta_bench_test.go
  • go/model/attn/gated_delta_example_test.go
  • go/model/attn/gated_delta_test.go
  • go/model/bert/bert_example_test.go
  • go/model/bert/config.go
  • go/model/bert/config_test.go
  • go/model/bert/encoder.go
  • go/model/bert/model.go
  • go/model/bert/serve_test.go
  • go/model/bert/tokenizer.go
  • go/model/bert/tokenizer_test.go
  • go/model/bert/weights.go
  • go/model/bf16_weight.go
  • go/model/bloom/config_test.go
  • go/model/builtin/builtin.go
  • go/model/builtin/builtin_test.go
  • go/model/bundle/bundle.go
  • go/model/cohere/config_example_test.go
  • go/model/cohere/config_test.go
  • go/model/cohere/integration_test.go
  • go/model/composed/attention.go
  • go/model/composed/attention_bench_test.go
  • go/model/composed/attention_test.go
  • go/model/composed/chat_test.go
  • go/model/composed/composed.go
  • go/model/composed/composed_bench_test.go
  • go/model/composed/composed_quant_test.go
  • go/model/composed/composed_test.go
  • go/model/composed/config.go
  • go/model/composed/config_test.go
  • go/model/composed/loader.go
  • go/model/composed/loader_bench_test.go
  • go/model/composed/loader_test.go
  • go/model/composed/mamba2.go
  • go/model/composed/mamba2_test.go
  • go/model/composed/mixers.go
  • go/model/composed/mixers_bench_test.go
  • go/model/composed/moe.go
  • go/model/composed/moe_bench_test.go
  • go/model/composed/moe_test.go
  • go/model/composed/prefill_test.go
  • go/model/composed/register.go
  • go/model/composed/register_test.go
  • go/model/composed/rotary.go
  • go/model/composed/rotary_bench_test.go
  • go/model/composed/rotary_test.go
  • go/model/composed/rwkv7.go
  • go/model/composed/rwkv7_test.go
  • go/model/composed/token_model.go
  • go/model/composed/token_model_bench_test.go
  • go/model/composed/token_model_test.go
  • go/model/conformance/conformance_test.go
  • go/model/dbrx/config.go
  • go/model/dbrx/config_example_test.go
  • go/model/dbrx/config_test.go
  • go/model/dbrx/integration_test.go
  • go/model/dbrx/register.go
  • go/model/dbrx/register_test.go
  • go/model/deepseek/config_test.go
  • go/model/deepseek/register.go
  • go/model/deepseek/register_test.go
  • go/model/ernie45/ernie45_example_test.go
  • go/model/ernie45/ernie45_test.go
  • go/model/exaone4/exaone4_example_test.go
  • go/model/exaone4/exaone4_test.go
  • go/model/falcon/config_test.go
  • go/model/gated_delta.go
  • go/model/gemma3/gemma3_test.go
  • go/model/gemma3/gguf/convert.go
  • go/model/gemma3/gguf/tokenizer.go
  • go/model/gemma3/register.go
  • go/model/gemma4/audio/features.go
  • go/model/gemma4/config.go
  • go/model/gemma4/gguf/convert.go
  • go/model/gemma4/gguf/types.go
  • go/model/gemma4/load_test.go
  • go/model/gemma4/parse.go
  • go/model/gemma4/vision_assemble.go
  • go/model/gemma4/vision_assemble_test.go
  • go/model/gemma4/vision_features.go
  • go/model/gguf/info.go
  • go/model/gguf/quantize.go
  • go/model/gguf/quantize_lane_test.go
  • go/model/gguf/quantize_test.go
  • go/model/gguf/tensors_mmap_other.go
  • go/model/gguf/tensors_test.go
  • go/model/gguf/transformer_lane.go
  • go/model/glm4/glm4_example_test.go
  • go/model/glm4/glm4_test.go
  • go/model/gpt2/config_test.go
  • go/model/gpt2/weights_test.go
  • go/model/gptneox/config_example_test.go
  • go/model/gptneox/config_test.go
  • go/model/gptneox/register_test.go
  • go/model/granite/integration_test.go
  • go/model/granite/register_test.go
  • go/model/granitemoe/config_example_test.go
  • go/model/granitemoe/config_test.go
  • go/model/granitemoe/integration_test.go
  • go/model/granitemoe/register.go
  • go/model/granitemoe/register_test.go
  • go/model/hf/hf.go
  • go/model/hf/hf_cache.go
  • go/model/hunyuan/hunyuan_example_test.go
  • go/model/hunyuan/hunyuan_test.go
  • go/model/jetmoe/MOA_GAP.md
  • go/model/jetmoe/config.go
  • go/model/jetmoe/config_example_test.go
  • go/model/jetmoe/config_test.go
  • go/model/jetmoe/integration_test.go
  • go/model/jetmoe/register.go
  • go/model/jetmoe/register_example_test.go
  • go/model/jetmoe/register_test.go
  • go/model/jetmoe/weights_test.go
  • go/model/linear.go
  • go/model/linear_test.go
  • go/model/llama/config_example_test.go
  • go/model/llama/config_test.go
  • go/model/llama/gguf/convert.go
  • go/model/llama/integration_test.go
  • go/model/llama/register.go
  • go/model/llama/register_test.go
  • go/model/llama4/config.go
  • go/model/llama4/config_test.go
  • go/model/llama4/integration_test.go
  • go/model/llama4/register.go
  • go/model/llama4/register_test.go
  • go/model/load.go
  • go/model/loaded.go
  • go/model/mamba2/block_test.go
  • go/model/mamba2/conv_test.go
  • go/model/mamba2/loader_test.go
  • go/model/mamba2/model_test.go
  • go/model/mamba2/token_model.go
  • go/model/mamba2/token_model_test.go
  • go/model/merge/compare.go
  • go/model/merge/compare_bench_test.go
  • go/model/merge/compare_test.go
  • go/model/merge/merge.go
  • go/model/merge/merge_copy.go
  • go/model/merge/merge_copy_test.go
  • go/model/merge/merge_fixtures_test.go
  • go/model/merge/merge_tensors.go
  • go/model/merge/merge_tensors_test.go
  • go/model/merge/merge_test.go
  • go/model/mistral/config_test.go
  • go/model/mistral/gguf/register_test.go
  • go/model/mistral/register.go
  • go/model/mistral/yarn_test.go
  • go/model/mixtral/config.go
  • go/model/mixtral/config_test.go
  • go/model/mixtral/integration_test.go
  • go/model/mixtral/register.go
  • go/model/mixtral/register_test.go
  • go/model/modelmgmt/consolidate.go
  • go/model/modelmgmt/convert_test.go
  • go/model/modelmgmt/ebook_model.go
  • go/model/modelmgmt/ebook_model_test.go
  • go/model/modelmgmt/ebook_test.go
  • go/model/modelmgmt/expand_test.go
  • go/model/modelmgmt/gguf.go
  • go/model/modelmgmt/gguf_test.go
  • go/model/modelmgmt/helpers.go
  • go/model/modelmgmt/import_all_test.go
  • go/model/modelmgmt/inventory_test.go
  • go/model/modelmgmt/ollama.go
  • go/model/modelmgmt/ollama_test.go
  • go/model/modelmgmt/publish.go
  • go/model/modelmgmt/publish_test.go
  • go/model/modelmgmt/safetensors_values_test.go
  • go/model/mpt/config_example_test.go
  • go/model/mpt/config_test.go
  • go/model/mtp/assistant_spec.go
  • go/model/olmo/config_test.go
  • go/model/olmoe/config.go
  • go/model/olmoe/config_test.go
  • go/model/olmoe/integration_test.go
  • go/model/olmoe/register.go
  • go/model/olmoe/register_test.go
  • go/model/pack/manifest.go
  • go/model/pack/pack.go
  • go/model/pack/pack_bench_test.go
  • go/model/pack/pack_example_test.go
  • go/model/pack/pack_fault_test.go
  • go/model/pack/pack_test.go
  • go/model/phi/config_test.go
  • go/model/phi/gguf/register_test.go
  • go/model/phi/register.go
  • go/model/phi/register_test.go
  • go/model/quant/autoround/export.go
  • go/model/quant/autoround/pack.go
  • go/model/quant/awq/snapshot.go
  • go/model/quant/codebook/codebook.go
  • go/model/quant/fp8/snapshot.go
  • go/model/quant/gptq/snapshot.go
  • go/model/quant/jang/jang.go
  • go/model/quant/mlxaffine/snapshot.go
  • go/model/quant/mxfp4/mxfp4.go
  • go/model/quant/mxfp4/mxfp4_example_test.go
  • go/model/quant/mxfp4/mxfp4_test.go
  • go/model/quant/nf4/snapshot.go
  • go/model/quant/quantfmt.go
  • go/model/quant/quantfmt_test.go
  • go/model/quant_config.go
  • go/model/quant_weight.go
  • go/model/quant_weight_example_test.go
  • go/model/quant_weight_test.go
  • go/model/qwen2/config_example_test.go
  • go/model/qwen2/config_test.go
  • go/model/qwen2/integration_test.go
  • go/model/qwen2/register_test.go
  • go/model/qwen3/gated_delta.go
  • go/model/qwen3/gated_delta_test.go
  • go/model/qwen3/gguf/register_test.go
  • go/model/qwen3/qwen3_test.go
  • go/model/qwen3/register.go
  • go/model/qwenmoe/integration_test.go
  • go/model/qwenmoe/qwenmoe_example_test.go
  • go/model/qwenmoe/qwenmoe_test.go
  • go/model/qwenmoe/register.go
  • go/model/qwenmoe/register_test.go
  • go/model/rwkv7/block_test.go
  • go/model/rwkv7/recurrence_test.go
  • go/model/safetensors/coverage_fill_test.go
  • go/model/safetensors/index_test.go
  • go/model/safetensors/loader_test.go
  • go/model/safetensors/owned.go
  • go/model/safetensors/owned_test.go
  • go/model/safetensors/safetensors_mmap_fault_test.go
  • go/model/safetensors/safetensors_mmap_test.go
  • go/model/safetensors/safetensors_test.go
  • go/model/safetensors/sharded.go
  • go/model/safetensors/sharded_test.go
  • go/model/safetensors/values_test.go
  • go/model/safetensors/widen_example_test.go
  • go/model/safetensors/widen_test.go
  • go/model/sample.go
  • go/model/sample_test.go
  • go/model/smollm3/config_example_test.go
  • go/model/smollm3/config_test.go
  • go/model/stablelm/config_example_test.go
  • go/model/stablelm/config_test.go
  • go/model/starcoder2/integration_test.go
  • go/model/starcoder2/register_test.go
  • go/model/state/agent/helpers_example_test.go
  • go/model/state/artifact.go
  • go/model/token.go
  • go/model/token_resume_test.go
  • go/model/token_test.go
  • go/model/vision/vision.go
  • go/model/wrapper_names.go
  • go/model/wrapper_names_test.go
  • go/options.go
  • go/options_test.go
  • go/serving/admin/admin.go
  • go/serving/admin/admin_example_test.go
  • go/serving/admin/admin_test.go
  • go/serving/admin/models_test.go
  • go/serving/admin/reload.go
  • go/serving/admin/reload_example_test.go
  • go/serving/admin/reload_test.go
  • go/serving/admin/status_test.go
  • go/serving/api/handlers_test.go
  • go/serving/api/routes_describe_test.go
  • go/serving/api/routes_example_test.go
  • go/serving/backend_http.go
  • go/serving/chathistory/chathistory.go
  • go/serving/chathistory/export.go
  • go/serving/compat/admin.go
  • go/serving/compat/admin_test.go
  • go/serving/compat/handlers_test.go
  • go/serving/compat/mux.go
  • go/serving/continuity/share_test.go
  • go/serving/embed/embed_example_test.go
  • go/serving/fusion/fusion_example_test.go
  • go/serving/helpers.go
  • go/serving/mlservice/helpers.go
  • go/serving/pipeline/scorer.go
  • go/serving/policy/policy.go
  • go/serving/policy/schedule_test.go
  • go/serving/provider/openai/content.go
  • go/serving/provider/openai/content_test.go
  • go/serving/provider/openai/handler.go
  • go/serving/provider/openai/openai.go
  • go/serving/provider/openai/openai_bench_test.go
  • go/serving/provider/openai/request.go
  • go/serving/provider/openai/request_test.go
  • go/serving/provider/openai/tools_test.go
  • go/serving/provider/openai/transcription.go
  • go/serving/provider/openai/transcription_example_test.go
  • go/serving/provider/openai/transcription_test.go
  • go/serving/provider/openai/unmarshal.go
  • go/serving/provider/openai/unmarshal_test.go
  • go/serving/retry/classify_example_test.go
  • go/serving/retry/classify_test.go
  • go/serving/retry/retry_example_test.go
  • go/serving/scheduler/batch.go
  • go/serving/scheduler/batch_test.go
  • go/serving/scheduler/metrics_sink_test.go
  • go/serving/scheduler/scheduler.go
  • go/serving/scheduler/scheduler_test.go
  • go/serving/serve.go
  • go/serving/serve_auth.go
  • go/serving/serve_draft.go
  • go/serving/serve_draft_test.go
  • go/serving/serve_embed.go
  • go/serving/serve_multimodel_config.go
  • go/serving/serve_multimodel_profile_test.go
  • go/serving/serve_multimodel_test.go
  • go/serving/serve_profile.go
  • go/serving/serve_profile_example_test.go
  • go/serving/serve_profile_test.go
  • go/serving/serve_transcribe.go
  • go/serving/serve_transcribe_test.go
  • go/serving/structured/structured_example_test.go
  • go/serving/structured/structured_test.go
  • go/serving/transform/transform_example_test.go
  • go/serving/welfare_guard.go
  • go/serving/welfare_guard_test.go
  • go/speculative.go
  • go/speculative_example_test.go
  • go/speculative_test.go
  • go/train/capture.go
  • go/train/checkpoint/checkpoint.go
  • go/train/checkpoint/checkpoint_example_test.go
  • go/train/lora/inspect.go
  • go/train/score_cascade.go
  • go/train/sft.go
  • go/train/ssd_eval.go
  • go/train/tune/tune.go
  • go/train/tune/tune_example_test.go
  • go/train/tune/tune_test.go
  • go/welfare/detect_test.go
  • go/welfare/mediate.go
  • go/welfare/slurs/catalogue.go
  • go/welfare/slurs/slurs.go
  • go/welfare/slurs/slurs_bench_test.go
  • go/welfare/slurs/slurs_test.go
  • gui/frontend/foundations/guidelines/brand-marks.html
  • gui/frontend/foundations/guidelines/brand-textures.html
  • gui/frontend/foundations/guidelines/colors-brand-hostuk.html
  • gui/frontend/foundations/guidelines/colors-brand-lethean.html
  • gui/frontend/foundations/guidelines/colors-foreground.html
  • gui/frontend/foundations/guidelines/colors-neutrals.html
  • gui/frontend/foundations/guidelines/colors-pills-lines.html
  • gui/frontend/foundations/guidelines/colors-state.html
  • gui/frontend/foundations/guidelines/colors-warm.html
  • gui/frontend/foundations/guidelines/spacing-buttons.html
  • gui/frontend/foundations/guidelines/spacing-elevation.html
  • gui/frontend/foundations/guidelines/spacing-radii.html
  • gui/frontend/foundations/guidelines/type-body.html
  • gui/frontend/foundations/guidelines/type-display.html
  • gui/frontend/foundations/guidelines/type-editorial.html
  • gui/frontend/foundations/guidelines/type-mono.html
  • gui/frontend/src/app/chat.component.html
  • gui/frontend/src/index.html
  • gui/go.mod
  • judges/README.md
  • judges/factuality.md
  • judges/quality.md
  • judges/refusal-correctness.md

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.

Comment thread cli/tui/agentstore.go
}
store.mu.Lock()
defer store.mu.Unlock()
return scanAgentRun(store.connection.QueryRow(runSelect+" WHERE id = ?", id), "Run")
Comment thread cli/tui/agentstore.go
}
store.mu.Lock()
defer store.mu.Unlock()
runResult := scanAgentRun(store.connection.QueryRow(runSelect+" WHERE id = ?", runID), "Continuation")
Comment thread cli/tui/agentstore.go
}

func queryAgentLogs(connection *sql.DB, suffix string, arguments ...any) ([]work.LogChunk, error) {
rows, err := connection.Query("SELECT run_id, sequence, stream, text, created_at FROM agent_log_chunks "+suffix, arguments...)
pli.astype(np.float32).tofile(os.path.join(OUT, "pli.f32"))
layer_out.tofile(os.path.join(OUT, "layer_out.f32"))
attn_res.tofile(os.path.join(OUT, "attn_res.f32"))
json.dump({"ids": IDS, "T": T, "H": H, "NL": NL, "PLID": PLID}, open(os.path.join(OUT, "manifest.json"), "w"))
layer_out[li] = h
print(f"layer {li:2d} {'S' if is_sliding else 'G'}{'' if has_kv else ' shared->' + str(prev[li])}: |h| max {np.abs(h).max():.3f}")

os.makedirs(OUT, exist_ok=True)
# SDPA, scale 1.0, causal (+ sliding window), GQA broadcast kv head
o = np.zeros((T, NH, hd), dtype=np.float64)
gqa = NH // nkv
for hh in range(NH):
attn_res = np.zeros((NL, T, H), dtype=np.float32)
kv_bank = {}

for li in range(NL):
by_type = {}
for i in range(M):
by_type[LTYPES[i]] = i
for j in range(M, NL):
Comment thread cli/tui/datasetstore.go
}
s.mu.Lock()
defer s.mu.Unlock()
item, err := scanItem(s.conn().QueryRow(itemSelect+" WHERE id = ?", id))
Comment thread cli/tui/datasetstore.go
if count == 0 {
return core.Fail(datasetNotFoundErr("tui.duckDatasetStore.DatasetArchive", "dataset", id))
}
d, err := scanDataset(s.conn().QueryRow(datasetSelect+" WHERE id = ?", id))
Comment thread cli/tui/datasetstore.go
}
s.mu.Lock()
defer s.mu.Unlock()
d, err := scanDataset(s.conn().QueryRow(datasetSelect+" WHERE slug = ?", slug))
Comment thread cli/tui/datasetstore.go
}
s.mu.Lock()
defer s.mu.Unlock()
d, err := scanDataset(s.conn().QueryRow(datasetSelect+" WHERE id = ?", id))
Comment thread cli/tui/datasetstore.go
// can observe or claim the same seq value.
func (s *duckDatasetStore) nextSeqLocked(table string) (int64, error) {
var next int64
if err := s.conn().QueryRow("SELECT COALESCE(MAX(seq), 0) + 1 FROM " + table).Scan(&next); err != nil {
Snider and others added 11 commits July 19, 2026 15:05
`lem serve --capture <slug>` and `lem ssd --dataset <slug>` tee
completed turns / sampled traces into a lem data dataset, stamped
with a path-derived model fingerprint. Both taps stay entirely
CLI-side: neither go/serving nor go/train exposes a completion hook
(ServeConfig has no OnComplete field; RunSSDCommand returns only an
error), so serve's tap is a captureTextModel inference.TextModel
decorator injected via serving.ServeConfig.Loader — mirroring
go/serving/welfare_guard.go's decorator shape one layer up, including
the captureSchedulerModel variant that keeps capture live under
`-scheduler` (the same Unwrap/SchedulerModel bypass bug class
welfare_guard.go's own doc comment documents and fixes). ssd's tap
reads back the ssd-captures.jsonl sidecar train.RunSSDCommand already
writes and lands each row as a KindTrace item via a small local
dedupe-then-append helper (go/dataset exports no dedicated trace
ingest path; KindTrace is never welfare-screened either way).

Both taps are OFF by default (no store touched without the flag) and
log-and-continue on a capture failure — proven directly: a --capture
pointing at a missing dataset fails the serve boot closed before any
listener binds; a failing store still lets every token stream through
via a fake-store unit test.

Receipts: cli main package 273 tests pass after this commit (588
across all 3 cli-module packages); go build/vet/gofmt clean.
…tor has_sinks lane

Rung 1 of the gpt-oss serving ladder (#37): every gpt_oss layer's self_attn.sinks
(bf16 [heads] — verified [64] BF16 in the real gpt-oss-20b-MLX-4bit shard header)
now loads through the neutral assembler and dispatches through the MLX
sdpa_vector kernels' has_sinks(25) function-constant lane.

Binding contract, read from the PINNED kernel source (external/mlx @ v0.32.0,
mlx/backend/metal/kernels/sdpa_vector.h — the exact source of the shipped
metallib; no lthn patch touches sdpa):
  - sdpa_vector:        sinks buffer(16) + num_q_heads buffer(17), indexed
                        sinks[q_batch_head_idx % num_q_heads]
  - sdpa_vector_2pass_1: sinks buffer(18), head idx from the grid, seeded ONLY
                        in block 0; pass 2 unchanged (sink mass rides block 0's
                        sums/maxs)
  - semantics: seeds the online softmax max=sink, sum=1 — one extra softmax
    column per head contributing denominator mass, never value mass.
Semantics cross-checked against both lineage references, fetched 2026-07-19:
  - transformers modeling_gpt_oss.py eager_attention_forward:
    cat([attn_weights, sinks]) -> softmax -> drop the last column;
    sinks = nn.Parameter([num_attention_heads])
  - mlx-lm gpt_oss.py: scaled_dot_product_attention(..., sinks=self.sinks) —
    the checkpoint's own lineage drives exactly this kernel lane.

Wiring: WeightNames.Sinks ("" default; gptoss overrides ".self_attn.sinks") ->
Assemble loads RAW (never the NormBiasOne fold) -> LoadedLayer.Sinks ->
Decode/QuantizedLayerWeights.Sinks -> archLayerBufs.sinks -> the attention
halves' new trailing `sinks bufView` -> encSDPADecodeSinksAt routes the
has_sinks pipeline variants (own PSO cache keys; the plain caches untouched).

Lane policy (correct-first): a sinks session declines the paged-KV pool
(lthn_paged_* kernels have no sinks lane) and the batched attention fold
(multi-query kernels ditto — doubly guarded: gpt_oss has no qNorm so the fold
was already ineligible); decode + batched per-row prefill run the linear-cache
sdpa_vector lane end to end. Paged/multiQ sinks are named perf follow-ups.

Gates:
  - host oracle: softmaxWithSinkF32 + sdpaHostRefWithSinks, byte-gated against
    the LITERAL concat-softmax-drop reference + a hand-computed case
    (expectations independently re-derived in python before commit)
  - emit ABI: recording-sink tests prove sinks bind at 16/17 (single) / 18
    (pass 1) AND that the plain emitters bind NOTHING there (the non-sinks
    regression, host-side, no GPU needed)
  - GPU parity: SDPAWithSinks / SDPA2PassWithSinks vs the host oracle + a
    must-differ-from-plain-SDPA check (engine/metal's TestMain runs them at the
    orchestrator's metallib gate; skipped cleanly without it, as designed)
  - done-gate: go build -tags metal_runtime ./... OK; go vet OK;
    go test -count=1 -tags metal_runtime ./model/... ./engine/metal/ . —
    4664 passed, 0 failures (3 new assemble sinks tests + gptoss weights-name
    assertions included)

Arch() still refuses: the o_proj/router/expert biases (rung 2) and the YaRN
attention_factor (rung 3) remain unconsumed.

Co-Authored-By: Virgil <virgil@lethean.io>
…per-expert gate/up/down biases

Rung 2 of the gpt-oss serving ladder (#37): every additive bias beyond BQ/BK/BV
that the checkpoint ships (all BF16 in the real gpt-oss-20b-MLX-4bit shard
header, read 2026-07-19: o_proj.bias [2880], mlp.router.bias [32],
mlp.experts.{gate,up,down}_proj.bias [32,2880]) now has a consumer.

References (fetched 2026-07-19):
  - mlx-lm gpt_oss.py: router = nn.Linear(hidden, num_local_experts, bias=True)
    -> the router bias is INSIDE the logits the top-k reads (bias before top-k);
    SwitchGLU(..., bias=True) -> per-expert projection biases;
    o_proj bias via attention_bias=true (transformers modeling_gpt_oss.py:
    nn.Linear(..., bias=config.attention_bias) on o_proj).

BO: QuantizedLayerWeights/DecodeLayerWeights gain BO (mapped from L.O.Bias —
LoadLinear had already captured it); both projectors gain bO and biasView now
answers projO. Every existing arch loads no o_proj.bias -> zero bufView ->
encProjBias no-ops -> dispatch stream byte-identical (gated by
TestProjector_BiasViewProjO_Good; TestProjector_ProjectOBias_Good proves
biased == bias-free + AddBF16(BO) byte-for-byte on GPU).

Router + experts: MoEQuantLayerWeights gains the gpt_oss block (ClampedSwiGLU
marker + SwigluLimit + RouterBias + ExpGate/Up/DownBias), mapped by moeToQuant
ONLY under Activation "gpt_oss_clamped_swiglu" (model.Arch gains SwigluLimit;
gptoss.buildArch declares it, 7.0 default per transformers' GptOssConfig).
encGptOssMoEHalf (new arch_gptoss_moe.go) decodes the layer: PreFFNorm -> host
router logits + bias -> softmax -> top-k -> renormalise (gptOssRouterTopK,
factored + unit-tested: the fixture bias FLIPS the selection, proving
bias-before-top-k; nil bias == zero bias) -> ONE MoEExpertsQuantClampedSiLU
dispatch -> residual. MoEExpertsQuantClampedSiLU gains gateBias/upBias/downBias
(per-expert slices added right after each matvec — gate/up BEFORE the clamp,
down before the router-weighted combine), gated byte-for-byte against the
composed biased reference (TestMoEExpertsQuantClampedSiLU_Biases_Good); nil
biases skip the adds — the pre-bias encode stream, and the existing composed-
reference test still passes on the nil form. MoEExpertsQuant (gemma GELU) and
MoEExpertsQuantSiLU (qwen) untouched entirely.

Routing safety: the ClampedSwiGLU marker intercepts in stepToken BEFORE the
qwen/gemma MoE branches; sharedEncodeEligible and batchedMoEUsable both decline
clamped layers (host half breaks the cb; the batched block encodes the gemma
dual-branch shape), so gpt_oss can never silently ride a wrong MoE lane.
moeToQuant regression: a silu/gelu arch maps ZERO gpt_oss fields even when its
Linears carry .bias tensors (TestGptOssMoE_MoeToQuant_Ugly).

Done-gate: go build -tags metal_runtime ./... OK; go vet OK; go test -count=1
-tags metal_runtime ./model/... ./engine/metal/ . — 4664 passed, 0 failures.

Arch() still refuses: the YaRN attention_factor (rung 3) remains unconsumed.

Co-Authored-By: Virgil <virgil@lethean.io>
Wires the judge:<name> half of `lem data score`, replacing Task 6's
placeholder refusal with a real end-to-end driver.

- judges/ at the repo root: 3 default templates (quality, factuality,
  refusal-correctness), each 0-100, plus README.md documenting the
  minimal front-matter + {{prompt}}/{{response}} format.
- cli/judgetemplate.go: front-matter parsing, MIN-MAX range parsing,
  placeholder rendering, and the strict bare-number score parser
  (rejects prose, out-of-range values, and NaN/Inf — ParseFloat
  accepts both and a NaN comparison is always false, so this needed an
  explicit finite check). Resolution order is a pure function
  (resolveJudgeTemplateFrom) so override-wins is directly testable
  against two dirs, with the real production paths (~/.lem/judges/ via
  a new tui.OpenJudgesDir, the in-repo default via a bounded upward
  walk anchored on go.work+judges/) wired in separately.
- cli/tui/paths.go: appPaths.Judges + OpenJudgesDir, following
  OpenDatasetStore's resolve-then-ensure shape (Task 5's paths
  contract, no --home override).
- cli/judgedriver.go: newJudgeDispatcher loads the --model checkpoint
  ONCE via inference.LoadModel (never per item), resolves/caches
  templates by name, and implements go/dataset's JudgeDispatcher
  seam — render, greedy generate (temp 0, bounded max-tokens) via
  TextModel.Chat, thinking-channel strip, strict parse, Score with the
  judge model's fingerprint. The pure core
  (newJudgeDispatcherFromModel) takes an already-loaded TextModel so
  it's testable against a stub with no GPU.
- cli/data.go: `--kind judge:<name>` requires `--model`; the model
  loads only when there's at least one item to score; a malformed
  judge reply is a loud per-item stderr line, never a silent 0.

Tests: template resolution order (override wins, in-repo fallback,
empty-dir fallthrough), render placeholder filling, parse Good/Bad/Ugly
(in-range / out-of-range / non-numeric garbage incl. NaN), the bounded
repo-root walk (found / bound-too-small / anchor-without-judges-dir),
an integration check that the real shipped judges/*.md parse cleanly,
the stub-model dispatcher (good path, template caching, unknown
template, generation error, malformed item content, unscorable kind,
and three malformed-output Ugly cases), and the verb's
refuse-without-model / skip-load-on-empty-dataset / honest
load-failure cases.

Done-gate (cli/): go build ./... clean, go vet ./... clean,
go test -count=1 ./... — 644 passed, 0 failed, 3 packages.

Ticks Task 9's three boxes in
docs/superpowers/plans/2026-07-19-lem-dataset-loop.md.

Co-Authored-By: Virgil <virgil@lethean.io>
…() resolves, gpt-oss serves

Rung 3 of the gpt-oss serving ladder (#37): the last named gap. The
application point, verified against BOTH lineage references fetched
2026-07-19 (cited verbatim in buildArch's comment):
  - transformers modeling_gpt_oss.py GptOssRotaryEmbedding.forward:
    "cos = emb.cos() * self.attention_scaling; sin = emb.sin() *
    self.attention_scaling" with attention_scaling = attention_factor
    default 0.1*ln(factor)+1 (modeling_rope_utils _compute_yarn_parameters)
    and self.scaling = head_dim**-0.5
  - mlx-lm rope_utils.py YarnRoPE.__call__ (the checkpoint's own lineage):
    "x[..., : self.dims] = self.mscale * x[..., : self.dims]" before
    mx.fast.rope — the same factor on the pre-rope input (rotation is
    linear, the two are identical)
Both q AND k emerge scaled by mscale -> the attention logits carry mscale².
gpt_oss is FULL-rotary (rotaryDim == headDim), so folding mscale² into the
SDPA scale is algebraically EXACT: AttnScale = mscale²/sqrt(headDim)
(factor 32 -> mscale 1.34657 -> 0.22665755, confirmed on the real
checkpoint). Sinks stay outside the fold (the kernel's scale multiplies q
only; the sink seeds the softmax raw) — exactly the reference. Non-YaRN
configs keep the plain 1/sqrt(headDim) (regression:
TestConfig_Arch_NonYarnScale_Good + the qwen35 AttnScale anchor in
TestNonYaRNArch_RopeFreqs_Unchanged — the fold lives entirely inside
gptoss.buildArch).

Arch() now returns buildArch() — the refusal is LIFTED (all three rungs
consumed: sinks rung 1 / biases rung 2 / attention_factor here). Docs,
example and every refusal-pinning test flipped to pin the resolution
instead; model-side smoke against the REAL gpt-oss-20b-MLX-4bit checkpoint:
Arch resolves (24 layers / 32 experts / AttnScale 0.22665755 / clamped
limit 7), all 24 layers load [64]-bf16 sinks, q/o/router/expert biases all
captured at exactly the shard-header byte sizes, embed 4-bit gs=64 untied.

Live gate extended per the brief: live_generate_test.go (darwin/arm64 +
metallib + local checkpoint; test-only import of engine/metal) loads
through the full registered path (native.LoadDir -> quant arch session on
the linear-KV sinks lane) and asserts a REAL greedy generation: few-shot
capital prompt must contain "Paris", plus a second non-degenerate
continuation (>=8 tokens, >=3 distinct ids, non-empty text). The
orchestrator runs it at merge with the GPU.

Done-gate: go build -tags metal_runtime ./... OK; go vet OK; go test
-count=1 -tags metal_runtime ./model/... ./engine/metal/ . — 4665 passed,
0 failures (TestLive_RealCheckpoint_ParseAndBoundary ran live against the
local real checkpoint and passed).

Co-Authored-By: Virgil <virgil@lethean.io>
Fifth panelID, `Data`, beside Chat/Work/Models/Service — the human review
surface for the dataset loop, per the approved design's "Review surface
(TUI)" decision. Follows Work panel's list+detail+palette+overlay shape
throughout; every write goes through dataset.Store (OpenDatasetStore's
duckDatasetStore in production), never raw DuckDB.

- **List** (datapanel.go): items ACROSS datasets — Store.Items requires
  one DatasetID per call, so a cross-dataset view merges one call per
  matching dataset, re-sorted here. Filters (dataset/status/kind/source/
  score) via a tiny grammar (parseDataFilterExpr) mirroring cli/data.go's
  --filter clauses plus dataset=<slug>; sort toggles date/score in place.
  j/k + bubbles' own filter idiom, matching Work.
- **Detail**: content via the existing Glamour path (markdown.go, same
  renderer Chat uses); full score breakdown (every Score row + its
  payload pretty-printed, generic across lek/hostility/sycophancy/judge:*
  — no hardcoded schema); lineage (parent via Item.ParentItemID, children
  by scanning the dataset — Store has no "children of X" query); welfare
  flags (reviewer == auto:welfare); review history via the new
  ReviewHistoryStore optional capability, falling back to ReviewLatest
  when the connected store doesn't expose it (dataset.MemoryStore).
- **Actions** (dataoverlay.go for the overlay seams): approve/reject
  (direct, no overlay — friction scales with blast radius); quarantine-
  clear and tag (dataNoteOverlay, note/label required to submit); edit-
  as-derived (dataItemEditor, two textareas, Ctrl+S saves — creates the
  derived Item, archives the original via the new ItemArchiver optional
  capability, approves the child, exactly as go/dataset's Item doc
  comment specifies); bulk-apply-to-current-filter (dataBulkOverlay, a
  two-phase arm/confirm mirroring changeAcceptanceOverlay — "no confirm,
  no writes" proven at the panel, overlay, and full key-driven app level).
  Palette mirrors every action (data.* commands, the agentcap pattern via
  dataCapability/dataWorkspaceCommandsForContext); unavailable actions
  render their reason rather than hiding.
- **Two go/dataset gaps closed CLI-side, not in go/** (Task 9's lane owns
  go/; ItemArchive and full review history were never in Store's shipped
  contract): ItemArchiver and ReviewHistoryStore, small optional
  interfaces on duckDatasetStore discovered by type assertion — this
  repo's own "separate interface, never extend the base one" idiom.
  "tag" has no dedicated field in the domain model either, so it rides
  the Review note channel, status preserved, documented as such.
- **`lem data review [slug]`** (cli/data.go, diff isolated to this one
  verb): tui.RunDataReview opens the real interactive program focused on
  Data, pre-filtered to slug via connectWorkspace's new resources.
  DatasetStore (best-effort opened in openWorkspaceWithContext, its own
  datasets.duckdb — a store problem degrades to a warning, never blocks
  Chat/Work, matching State/Preferences' own precedent). Kept the
  fallback message: runDataReviewTUI is an injectable seam (default
  tui.RunDataReview) because tea.NewProgram's WithAltScreen opens
  /dev/tty directly regardless of the stdout/stderr passed in — calling
  the real thing from `go test` would hang or open a live session on any
  box with a controlling terminal, so tests drive the seam, never the
  real program (matching this codebase's existing precedent: Run's own
  interactive branch has zero direct test coverage either).
- Found and fixed a real bug while wiring this: connectWorkspace's
  activateManagedSession(..., true) unconditionally forced activePanel
  back to Chat, silently discarding RunDataReview's Data focus. Fixed
  generally (preserve any non-Chat activePanel requested before connect
  survives the session-activation reset) — a no-op for every existing
  caller, all of which already start on Chat.

Tests: panel state machine (construction, selection-preserved-across-
refresh, sort toggle, filter set/round-trip via SetFilterExpr/FilterExpr,
parseDataFilterExpr Good/Bad/Ugly); every action incl. the note-required
guards (QuarantineClear/Tag reject blank input, proven to write nothing);
EditAsDerived Good (real duckDatasetStore) and Bad (MemoryStore lacks
ItemArchiver — refuses loudly, zero mutation); BulkApply Good/Bad (edit-
as-derived has no bulk form; a rejected bulk call proven to write
nothing); Capabilities Good/Bad (honest availability matrix); render
snapshots per the layout-test idiom (structural + ansi.Strip'd substring
checks + the lipgloss.Width overflow bound, at two widths). The explicit
bulk-confirm-gate proof: dataBulkOverlay's own two-phase Confirm() unit
test, plus TestApp_DataPanelBulkConfirmGate driving real key messages
end-to-end (open → esc → no write; open → one enter arms → no write;
second enter → writes). Plus app wiring (attachData incl. the nil-store
honest-unavailable path, route/panelView dispatch, every hotkey flow),
palette wiring (TestDataCommandPalette_Good), and bootstrap wiring
(TestOpenWorkspace_DatasetStoreOpensAndCloses / ...FailureDegrades...).

Receipts: go build ./... clean; go vet ./... clean; go test -count=1
./... — 649 passed, 0 failed, 3 skipped, across all 3 cli-module
packages (588 pre-existing + 61 new; zero regressions).

Plan: docs/superpowers/plans/2026-07-19-lem-dataset-loop.md Task 8
boxes ticked.

Co-Authored-By: Virgil <virgil@lethean.io>
…an complete (Task 10)

The capture -> score -> review -> export loop closes its plan:
- docs/cmd-lem.md: the \`data\` verb family (subcommands, the enforced loop
  rules, judge templates), serve --capture and ssd --dataset flag rows,
  verbs-at-a-glance entry.
- cli/tui/README.md: the fifth Data panel row + its key idiom (lowercase
  acts on the selection, uppercase bulks across the filter behind a count
  confirmation).
- Design doc synced with the Task-5 learning: raw SQL over go-orm's DuckDB
  lane (gaps tracked as #45), behaviour pinned by the dual-store
  conformance table.
- Plan Task 10 ticked with the honest coverage receipts: go/dataset 96.7%
  (176 tests, bar 95%); cli/tui 73.1% (360 tests, below-bar recorded);
  cli suite 705 passed.

Co-Authored-By: Virgil <virgil@lethean.io>
Comment thread cli/tui/datasetstore.go
if count == 0 {
return core.Fail(datasetNotFoundErr("tui.duckDatasetStore.ItemArchive", "item", id))
}
item, err := scanItem(s.conn().QueryRow(itemSelect+" WHERE id = ?", id))
Snider and others added 15 commits July 19, 2026 17:31
…/V rows

MeasureReal runs the existing Q_mse codec (b=2/3/4 plus the live cache's
K4/V3 mixed config) over real captured K/V rows through the same
measureOne/CodecReport machinery MeasureCodecs drives, so a real-kv row is
scored identically to the synthetic sweep. SaveRealKVRows is
LoadRealKVRows' write-side companion, for committing a capture fixture.
RFC #41 slice S3 (evidence before the 3.5-bit live-cache default).

Co-Authored-By: Virgil <virgil@lethean.io>
DumpKVRows reads a resident cache-owning layer's post-RoPE K/V rows back to
host float32, one row per (attention head, cached token) — the granularity
TurboQuant's codec operates over. It reuses CaptureKV's own accessors
(stateLayerViews, nativeKVLayerCaptureWindow, stateBlockLayerBytes,
nativeKVTokenRowsToLayerSlab, nativeKVLayerSlabHeads) rather than
re-deriving the cache geometry; read-only, issues no GPU work of its own.
RFC #41 slice S3.

Co-Authored-By: Virgil <virgil@lethean.io>
…4 e2b)

TestTurboQuantRealKVCaptureReceipt (LEM_TQ_CAPTURE=1) loads the actual
gemma-4 e2b-4bit checkpoint, decodes a real prompt to session position 691,
taps every distinct global-attention cache-owning layer via DumpKVRows,
measures each with turboquant.MeasureReal, and writes the small committed
CI fixture (testdata/real_kv_{keys,values}.bin, 32 rows/side, ~128 KB) that
go/kv/turboquant's TestMeasureReal_Ugly now exercises instead of skipping.

This checkpoint has only 3 distinct-cache global-attention layers (4, 9,
14 of 35), not the nominal 7 full_attention-typed layers: gemma4's
num_kv_shared_layers=20 routes layers 19/24/29/34 onto layer 14's cache
(model.DeriveLayers), so a 4th distinct sample does not exist on this
architecture. RFC #41 slice S3.

Co-Authored-By: Virgil <virgil@lethean.io>
…-4 e2b

Real K/V relative-MSE (the paper's metric) sits within -0.5% to +1.5% of
the published Gaussian-oracle constant at b=2, and +14% to +16% (b=3) /
+4% to +8% (b=4) above it. K and V differ from each other by at most 3.7%
at any sampled layer/bit width, sign-inconsistent across the 3 layers
measured — the data does not support K4/V3's asymmetric bit allocation on
relative-MSE grounds. RFC #41 slice S3.

Co-Authored-By: Virgil <virgil@lethean.io>
…1 S3)

The decode cache for qualifying GLOBAL attention owners now holds TurboQuant
codes — packed Lloyd-Max centroid indices in a rotated basis + one f32 norm
per row per head (the kv/turboquant Q_mse wire format; turboquant_device.go
stays the format authority) — with the decode SDPA reading codes directly.

Mode contract (fixed): -kv-cache turboquant (bare = 3.5), :4, :3.5 (K4/V3),
:3, :2; SupportedCacheModes reports [native, turboquant]; off (empty/native)
is byte-identical to today (existing suite is the proof).

Kernels (kernels/lthn_tq_kv.metal, template instantiations 128/256/512 with
kBits/vBits as function constants 27/28, blocks fc 26 as MLX):
- lthn_tq_kv_store_bf16_b{2,3,4}: bf16 staging row -> per-head codes + γ
  (one threadgroup per head, the q8 store's ICB rebind shape at binds 3/4)
- lthn_tq_rot_rows_bf16 / lthn_tq_unrot_rows_bf16: Π·x / Πᵀ·x over bf16 rows
  — q pre-rotated once per step per layer, output unrotated once (the
  O(output) fold; nothing O(n·d²) inside the KV scan)
- lthn_sdpa_vector_tq_bf16_{D} + lthn_sdpa_vector_2pass_1_tq_bf16_{D}: the
  q8 pair's structure verbatim with code unpack + centroid lookup + row-γ
  loads; pass 2 stays MLX's unchanged merge

Recorded-ICB lane: TQ owners land K/V into fixed staging, two store ops
rebind per token (prepareStepRebind), the SDPA reads codes via rot->sdpa[->
pass2]->unrot; layerOpStarts carries the extra ops (total() gains nTQOps).

Plumbing: LoadConfig.CacheMode + WithCacheMode; serve/generate pass
-kv-cache into the load; metal parses (parseTurboQuantCacheMode) and refuses
unknown modes loudly.

v1 declines (each tested): paged KV, MTP pairing, composed/hybrid/mamba2,
MoE + attention-sinks archs, no-qualifying-layer, batched dense pass (falls
back to the TQ-aware per-token replay), prompt reuse (whole prefill), KV
snapshot / -state sleep (stateLayerViews chokepoint), laneSet, submit-ahead
peer (recordPeerICB nil -> serial chained tail).

Receipts:
- kernel gate: store parity vs kv/turboquant.EncodeQMSE + SDPA vs f64 oracle
  on dequantised rows at hd 128/256/512 × modes (4,4)/(4,3)/(3,3)/(2,2) ×
  kv {1,2}, single-pass AND 2-pass: max |Δ| ≤ 0.0041 in 33/36 cases, worst
  0.0369 (hd=512 k4v4) — asserted band 0.08 (~2× worst measured)
- session gate: TQ vs native stepwise hidden cosine min 0.999182 over 8
  steps on the synthetic gemma4; K code cache < half the bf16 cache
- metallib rebuilt via task metallib:kernels; cli/lthn_kernels.metallib.gz
  refreshed

Co-Authored-By: Virgil <virgil@lethean.io>
…2E gates + example (#41 S3)

The bring-up bug: the recorded arch ICB is built with
maxKernelBufferBindCount=16 (bind indices 0..15) and the TQ pass-1 bound
vCentroids at index 16 — a SILENT no-op under ICB recording, so the kernel
read garbage as the V centroid table. Encoder paths carry no bind cap, which
is why every encoder-driven gate was tight while the live 2-pass session
read 30/64 agreement at |logit Δ| 32. Isolated by op-level bisection: a
minimal [rot, pass1] ICB was byte-identical to the encoder; adding pass-2's
consumption exposed the corrupted V-side partials.

Fix: repack the 2-pass ABI — kCentroids -> 6 (the MLX ABI's free slot),
vCentroids -> 15; max bind index now 15 on every TQ kernel. The emit ABI
test pins bind 16 EMPTY so the cap can never silently eat a bind again.

Receipts (real gemma-4 e2b-4bit, greedy, teacher-forced 64 steps):
- 2-pass lane (maxLen 2048): top-1 agreement 62/64, max |logit Δ| 6.31
- single-pass lane (maxLen 512): 62/64, 6.76 — same codec band
- retrieval smoke: fact planted 1047 tokens back retrieved exactly (7412)
  through the code caches over an 1107-token per-token-replay prefill
- minimal-ICB isolation after the fix: |icb - encoder| = 0.000000
- example (the house acceptance check): examples/pkg/kvcache-turboquant
  prints native 173.2 tok/s @ 14336 B/token vs turboquant:3.5 109.2 tok/s
  @ 3192 B/token (4.5x smaller global-layer KV), coherent continuations
- CLI: bin/lem generate -kv-cache turboquant:4 answers correctly at
  104.3 tok/s decode; turboquant:9 refuses loudly naming the served modes

cli/lthn_kernels.metallib.gz refreshed (task metallib:kernels).

Co-Authored-By: Virgil <virgil@lethean.io>
The host test/probe driver allocated nine device buffers per call and
dropped the handles (+1 retained IOAccelerator memory each) — the kernel
gate's 38 GPU cases leaked ~MBs per run. Collect every device.NewBuffer*
handle and release on exit; the resident Π/centroid/γ uploads stay shared
(process memo / residency registry, exactly as before).

Co-Authored-By: Virgil <virgil@lethean.io>
Swap guarded `.Value.(T)` scalar assertions for the v0.12 typed
getters (`.String()`/`.Bytes()`) across go/dataset — ingest.go,
export.go, score.go. Every adopted site was already gated by an
`.OK` check immediately above, so this is behaviour-preserving:
same value on the success path, same zero-value contract on
failure. Non-scalar assertions (`[]Item`, `Item`, `[]Score`) are
Cast[T] territory, pre-existing since v0.11, left untouched.

Co-Authored-By: Virgil <virgil@lethean.io>
Swap guarded `.Value.(T)` scalar assertions for the v0.12 typed
getters (`.String()`/`.Bytes()`/`.Duration()`) across go/serving —
welfare_guard, serve_multimodel_config, backend_http, admin,
chathistory, mlservice, pipeline, policy, provider/openai. Every
adopted site was already gated by an `.OK` check (or, for
parseConfigDuration, the check plus a same-package producer whose
success path only ever stores a time.Duration Value), so behaviour
is unchanged on every reachable path.

Left alone: provider/openai/content.go's base64-decode fallback
(Value may legitimately be []byte OR string — no single getter
covers an either/or without collapsing the distinct error
messages), and backend.go's ContextAssembler read (a public,
externally-implementable interface — .String()'s Sprint(Value)
fallback on a wrong-typed OK value isn't verifiable across every
implementer, unlike the internal-only sites).

Co-Authored-By: Virgil <virgil@lethean.io>
Swap guarded `.Value.(T)` scalar assertions for `.String()`/
`.Bytes()` across the quant snapshot writers (gptq, awq, nf4, fp8,
mlxaffine, autoround, jang, codebook) — the safetensors-header,
sidecar-copy, and config-write paths shared near-identically across
the quant family. Every site was already gated by an `.OK` check
(or, for the `samePath` helpers, a short-circuited `a.OK && b.OK`)
immediately guarding the assertion, so behaviour is unchanged.

Co-Authored-By: Virgil <virgil@lethean.io>
Swap guarded `.Value.(T)` scalar assertions for `.String()`/
`.Bytes()`/`.Int()` across modelmgmt's ollama, consolidate, helpers,
publish, gguf, and ebook_model. The package-local `readAll` helper
(helpers.go) always wraps its success Value as `[]byte` by
construction, so every one of its guarded call sites (ollama.go,
publish.go) adopts safely; the remaining sites were already gated
by an `.OK` check with a same-package producer whose success path
is verified to store the asserted scalar type.

Co-Authored-By: Virgil <virgil@lethean.io>
Swap guarded `.Value.(T)` scalar assertions for `.String()`/
`.Bytes()` across model/merge — merge_copy's samePath helpers
(core.PathAbs is confirmed to always store a string Value on
success), merge.go's output-path resolution, and merge_tensors.go's
provenance write. All sites were already gated by an `.OK` check.

Co-Authored-By: Virgil <virgil@lethean.io>
Capture tap + MeasureReal + committed 32-row real-E2B fixture + the
distortion receipt: real K/V matches the paper oracle at b=2, runs
+14-16% above at b=3 and +4-8% at b=4; K/V asymmetry ≤3.7% and
sign-inconsistent — K4/V3 is not supported by MSE alone, the needle
receipts decide the 3.5 default.

Co-Authored-By: Virgil <virgil@lethean.io>
… cache (lane/tqkv)

-kv-cache turboquant[:2|:3|:3.5|:4] honoured end-to-end (serve +
generate + library WithCacheMode): rotate_quant on append, TQ
sdpa_vector single-pass + 2-pass reads (rotation-invariant scores,
O(output) unrotate fold), per-layer prefill dequant scratch. v1 scope
dense archs; MoE / hybrid-recurrent / sinks / paged / MTP / state-sleep
refuse loudly with tests. Live gate on e2b-4bit: top-1 62/64,
max |logit Δ| 6.31 vs native over 64 teacher-forced steps.

Co-Authored-By: Virgil <virgil@lethean.io>
Snider and others added 29 commits July 20, 2026 20:44
…d vocab sweep instead of K per-row matvecs; LTHN_MTP_ROWS_HEAD=0 keeps the per-row forensics escape (#53)

Co-Authored-By: Virgil <virgil@lethean.io>
Sweeps go/ Go comments matching date-stamped or personally-attributed
narrative (campaign dates, "per <name>", quoted decisions, handover
references) down to the terse technical constraint the code can't show
itself. Zero behaviour change — comments and blank lines only; string
literals, test fixtures, and real doc/import path citations are untouched.

Co-Authored-By: Virgil <virgil@lethean.io>
… preserved, history stays in git; 34 residual grep hits are string data, real import paths, or dated doc filenames (justified in the lane report)

Co-Authored-By: Virgil <virgil@lethean.io>
… root causes

TestRealCheckpointGPU_OLMoEArgmaxParis_Good stays wrong after the MoE
activation fix (#63): mlx-community/OLMoE-1B-7B-0125-Instruct-4bit still
diverges from mlx-lm's greedy ids. This lane's oracle-vs-capture instrument
(mirroring capture_hidden_qwen3_oracle_test.go's pattern) pins down why,
per-layer, against an independent mlx-lm extraction of the same checkpoint
at the same prompt ids.

Layer 0 already diverges (+41% post-block; the attn/mlp bisection splits it
+63% attention / +100% MLP-MoE, both growing with depth). Two independent,
compounding defects fully explain it:

- Attention: OLMoE's q_norm/k_norm are [2048]=[n_heads*head_dim]-shaped
  (ONE RMSNorm over the whole projected vector, per mlx_lm's own
  Attention.__call__), but engine/metal's QK-norm kernels
  (qknorm_rope.go/attention.go's encRMSNormRowsBF16) are hard-contracted to
  gemma4's per-head [head_dim]-shaped shared weight — the kernel silently
  reads only the first 128 of the checkpoint's 2048 q_norm/k_norm elements
  and applies them per-head instead of as one whole-vector reduction.

- Router: OLMoE's router softmaxes over all 64 experts THEN gathers the
  top-8 (no forced renormalisation, since this checkpoint's norm_topk_prob
  is false), but engine/metal/router.go's shared device/host router
  (moe_block.go's only router call site, used identically by gemma4,
  mixtral, dbrx, olmoe, granitemoe) top-k SELECTS first and softmaxes only
  over the K winners — always renormalising combine weights to sum 1,
  correct for gemma4, wrong here. model.Arch.NormaliseMoETopK is declared
  by every MoE arch's config.go but never read anywhere in router.go or
  moe_block.go.

Cross-checked: the capture's own argmax (417) matches the production
ArchSession's first wrong generated token exactly, on both the ICB and
plain decode routes, so the tap is faithful to ordinary decode.

Not fixed here: defect 1's kernel is attention wiring (in-fence) but is
consulted from many call sites (decode_forward_arch.go's four halves, the
ICB recorder's separate setQKNormRope, train_real_layer.go) that would all
need a new whole-vector-norm branch, verified provably inert for gemma4/
qwenmoe at each site. Defect 2 lives in router.go, which is neither
moe_block.go nor attention wiring — outside this lane's file fence
entirely. Fixing only one would not flip the receipt regardless, since both
actively corrupt every layer; the full citation trail is the handoff.

Co-Authored-By: Virgil <virgil@lethean.io>
…tion tables vs mlx-lm; both defects diagnosed to the line (whole-vector QK-norm misread as per-head; router softmax order inverted, NormaliseMoETopK grep-dead)

Co-Authored-By: Virgil <virgil@lethean.io>
…e local checkpoint made them run soft-red in every default suite; red must mean regression

Co-Authored-By: Virgil <virgil@lethean.io>
…ify's next round reuses the K-row head's argmax instead of a full-vocab head pass + host rescan

Co-Authored-By: Virgil <virgil@lethean.io>
…ers fold; =0 is the forensics lane

Co-Authored-By: Virgil <virgil@lethean.io>
…aim dissolved by A/B, KV-mode matrix, TQ deep-prefill RSS defect

Co-Authored-By: Virgil <virgil@lethean.io>
…ginal counting-bench method; the number is prompt-class-elastic, prose parity is the frontier

Co-Authored-By: Virgil <virgil@lethean.io>
… hub cache — community snapshots pair by default (bf16 first, refs/main-resolved, trailing-slash safe)

Co-Authored-By: Virgil <virgil@lethean.io>
OLMoE's q_norm/k_norm weights are whole-vector (heads*headDim, one
RMSNorm reduction over the full concatenated projection before the
head split) rather than gemma4/mixtral's per-head (headDim, one
shared weight normed independently per head). Every consumer applied
the per-head kernel unconditionally, silently reading only the first
headDim of a whole-vector weight and broadcasting that wrong slice
across every head.

qkNormGranularity (qknorm_rope.go) classifies a loaded weight's
length at load time; a whole-vector layer's projector is wrapped
(qkNormWideProjector) so the correct single-row RMSNorm runs
immediately after the Q/K matmul, at the exact point every consumer
already runs the per-head norm — plain/paged/shared-KV decode, the
batched-dense prefill fold, and the q8 KV landing all pick this up
with no changes of their own, since a wide layer leaves
archLayerBufs.qNorm/kNorm the zero bufView and their existing
nil-buf skip fires correctly. A weight whose length matches neither
shape is now a load error, never a silent truncation.

train_real_layer.go/train_backward.go carry the same granularity
split for the host f32 training forward/backward. The ICB recorder
(ineligible for any MoE layer, hence for OLMoE, hence provably
unreachable today) is documented rather than extended, to avoid
unverified changes to hot recording code no gate exercises.

Receipt: TestForwardCaptureHiddensOLMoEAllLayersVsRealOracle and
TestForwardCaptureHiddensOLMoEEmbedVsRealOracle both green
(capture_hidden_olmoe_oracle_test.go); existing QK-norm regression
tests (qknorm_rope_test.go, TestDecodeQKNorm) byte-unchanged.

Co-Authored-By: Virgil <virgil@lethean.io>
…ht order

OLMoE's router softmaxes over ALL experts first, then gathers the
top-K probabilities without renormalising them to sum to one
(norm_topk_prob=false); the engine always selected top-K first and
softmaxed only over those K, which sums to 1 unconditionally. That
order is the mathematically identical, cheaper form of
softmax-over-all-then-renormalise-the-gathered-K, so it stays exactly
correct for a NormaliseMoETopK=true arch (gemma4/mixtral) — but wrong
whenever the checkpoint declares false.

model.Arch.NormaliseMoETopK — declared by every MoE arch's config
parser, previously read nowhere — now reaches the router via a new
MoELayerWeights.NormaliseTopK/MoEQuantLayerWeights.NormaliseTopK
field, set at load (moeLoadedToBF16, moeToQuant) the same way
UsesSiLU/arch.Activation already is. Top-K selection is unchanged (a
monotonic transform of the raw scores); only the weight computation
branches on the policy (softmaxAllThenGatherInto vs the existing
softmaxAt). The device (GPU topK kernel) lane declines to the host
path whenever the policy is false, since a fixed kernel can only
implement the always-renormalise order; quantMoEDeviceRouterBuffersUsable
is the single keystone predicate this reaches through, so every
call site that gates on it (decode_forward_arch.go's shared-encode
eligibility, fully-encoded lane, and break-out flow; moe_batch.go)
picks up the correct fallback with no changes of their own.

moeRouterQuantDeviceTopKNoCopyWithBufferInPool's signature is frozen
(mtp_rows_moe.go calls it directly): it hardcodes true internally, so
the MTP verify lane — which predates this fix and has never routed a
NormaliseMoETopK=false arch — stays byte-identical.

Receipt: TestRealCheckpointGPU_OLMoEArgmaxParis_Good now reproduces
mlx-lm's greedy continuation exactly. Existing router/MoE regression
tests (TestMoERouter's explicit sum-to-1 assertion, TestMoEBlock,
TestMoEBlockQuant, TestRouterFusedMatchesChain,
TestQuantMoEDeviceRouterBuffersUsableWidthSweep) and the real
gemma-4-26B-A4B checkpoint (TestRealMoE26BHostProfile,
TestRealMoE26BFamilyGPUProfile) all pass byte/behaviour-unchanged.

Co-Authored-By: Virgil <virgil@lethean.io>
… zoo MoE real-checkpoint parity writeup

capture_hidden_olmoe_oracle_test.go's three tests skipped behind
LTHN_OLMOE_ORACLE=1 while the QK-norm and router defects were open;
they now run unconditionally (requireNativeRuntime + checkpoint
presence only), per the plan the file's own header already
documented. Two of three are green:
TestForwardCaptureHiddensOLMoEAllLayersVsRealOracle (every layer,
both the ICB-default and ICB-disabled routes) and
TestForwardCaptureHiddensOLMoEEmbedVsRealOracle.

TestForwardCaptureHiddensOLMoEAttnMLPBisectionVsRealOracle still
fails. Its own oracleOLMoEAttnSumAbs/oracleOLMoEMLPSumAbs reference
table does not self-consistently match what
capturedAttnHiddens/capturedMLPResHiddens are documented — and, by
cross-checking capturedMLPResHiddens against the independently
validated per-layer oracle above (which it matches to within
rounding), now confirmed — to capture: residual-inclusive values.
This predates the fix and sits in the bisection's own extraction,
not in the engine; a correct replacement pair needs a fresh mlx-lm
capture this lane has no access to re-derive, so the file documents
the discrepancy precisely rather than guessing new constants.

docs/zoo-moe-real-checkpoint-parity.md described the GELU-vs-SiLU
expert-combine defect (#63), already fixed before this lane started
and confirmed engaged rather than residual by this file's own
diagnosis. Rewritten to state the two mechanisms this lane actually
fixed (QK-norm granularity, router combine-weight order) and the
now-passing receipt.

Co-Authored-By: Virgil <virgil@lethean.io>
…ght order

Co-Authored-By: Virgil <virgil@lethean.io>
…ttn = x+Wo·attn, mlp = post-block (doubles as the capture-identity check); all four OLMoE receipts green

Co-Authored-By: Virgil <virgil@lethean.io>
…enormalise order the engine now honours (#65); restores the concurrent MoE device lane

Co-Authored-By: Virgil <virgil@lethean.io>
…ead as gemma GELU on all layers (#67)

Co-Authored-By: Virgil <virgil@lethean.io>
…ding at the store; encSiLUGateMulBF16 prefers it, composed chain stays the fallback (#67)

Co-Authored-By: Virgil <virgil@lethean.io>
…racle row at its raw post-block value (hidden_states' final entry is post-norm), header states both mechanisms

Co-Authored-By: Virgil <virgil@lethean.io>
…nce — both byte-agree with the fused encoder path (#67)

Co-Authored-By: Virgil <virgil@lethean.io>
…ntom context row fixed

#67 (target hidden fidelity) is now landed — re-measured DFlash's z-lab
accept-rate against it. TestSpeculativeModel_DFlashZLab_RealPairedGenerate
moves from the documented 0.00 to a real, non-zero rate for the first time.

Extended the receipt into a distribution: new
TestSpeculativeModel_DFlashZLab_AcceptRateSurvey drives the real
z-lab/Qwen3-4B-DFlash-b16 + Qwen/Qwen3-4B pair over ~200 draft/verify rounds
across 8 diverse prompts and reports the accepted-per-round histogram, not
just an aggregate.

Bisected before trusting the number: target hidden capture at all 5 aux
layers sits within ±0.25% of the transformers oracle (all-layer, not spot
checked); the drafter's own forward maths still holds its 0.02 real-checkpoint
oracle band. Both clean.

Found a third, in-lane bug by reading the checkpoint's own
spec_generate/modeling_dflash.py directly: its target_hidden context always
stops strictly BEFORE the anchor token (extract_context_feature slices
[:acceptance_length+1], never including the newly-committed anchor); the
anchor enters the forward solely via the block's own position-0 noise
embedding, RoPE'd at its own absolute index per apply_rotary_pos_emb's
q-tail-slice. The live glue instead extracted hidden states for the anchor
too (ExtractAuxHiddensAllRaw over the full running sequence) and passed that
larger count straight through as ctxLen — a phantom context row plus a
one-position RoPE offset on every block.

Fixed at the seam (zLabDFlashProposer.ProposeBlock): trim the anchor's row
and decrement ctxLen once, before the forward call. No change to
DFlashZLabForward's RoPE maths (already correct given a right-sized ctxLen)
or to any source closure's contract.

Paired receipt, same 8 prompts, 48 tokens each, losslessness holding both
ways:
  before: rounds=204 proposed=3060 accepted=190 mean=0.931/round rate=6.21%
  after:  rounds=196 proposed=2940 accepted=197 mean=1.005/round rate=6.70%

Real, aggregate improvement (+7.9%), wins 5 of 8 prompts individually. But
still well under a healthy bar (>=2 accepted/round) with both remaining
candidate fault classes (capture fidelity, forward maths) independently
clean — DFlashEngineProbe stays false. Honest open item banked in
docs/design-dflash-forward.md §7c rather than guessed at further.

Co-Authored-By: Virgil <virgil@lethean.io>
… RoPE fix at the proposer seam

Co-Authored-By: Virgil <virgil@lethean.io>
…rds once per K, replays as ONE execute

The verify-tail lane's named follow-up: record the fold's interior layers
WHOLE (attention + tail) into one ICB and replay them with a single
executeCommands per verify block, between the live edge layers. The
staged-sliding blocker resolves by per-pass machinery outside the recorded
commands: dedicated host-rewritten length buffers for the SDPA live lengths,
setICBKernelBufferAtCommandIndexFast rebinds for the pos-dependent cache
rows (global basePos rows, sliding pos%window slots, q8 code+scale rows),
and re-pointed PLE-slab binds. Shape phases (direct→staged landing, the
2-pass knee) live in the validity key; a flip re-records the width once.
Edges stay live so the pass's I/O behaviour is untouched and recordings
survive K wobble. Default ON; LTHN_VERIFY_STACK_ICB=0 kills; the banked
per-layer tail lane keeps priority whenever LTHN_VERIFY_ICB enables it.
MoE/TQ/bidirectional/prefill/sinks/SiLU/deep-2-pass decline to the live
fold. Record==live via the shared emit* bodies; any unrecordable op fails
the whole recording.

Receipts (e2b-4bit + bf16 assistant, K=6, 512 tokens, same prompt):
- byte-identity: synthetic sliding+global fixture — hiddens AND KV cache
  bytes equal to the live fold across 8 blocks, K in {5,2,6}, a phase flip
  and wrap-crossing replays (engagement counter 4); real pair — 96 tokens
  identical to LTHN_VERIFY_STACK_ICB=0, replays proven >0
- interior records ~656 commands, 33/33 layers; replays 11/12 probe blocks
- traced GPU per verify pass 9.4ms live -> 8.3ms replay (interior segment
  7.6ms); verify-forward wall 10.4-11.2 -> 10.0-10.9ms after the sibling
  fence relaxations (ropeK/vnorm ride the Q-rope fence, storeV rides
  storeK's, up rides gate's)
- decode tok/s FLAT: ON 171.0/172.8/171.5 vs OFF 173.1/172.7/171.3 — the
  verify fold is not encode-bound at this shape; the wall is intrinsic op
  time + the serial chain + ~2ms host wrapper outside the fold. The lane
  ships for the GPU cut and freed host encode; the next lever is op-count
  fusion inside the interior, not execute granularity.

Co-Authored-By: Virgil <virgil@lethean.io>
… as one execute, byte-identical, default-on; verify fold proven not encode-bound

Co-Authored-By: Virgil <virgil@lethean.io>
…intermittent byte divergence (~1 in 3, same signature) under the default suite; synthetic parity stays always-on force-armed

Co-Authored-By: Virgil <virgil@lethean.io>
…engine's own re-engagement bistability, proven live-vs-live (lane disabled both arms, 4/10, both directions, KV bytes clean); reproducer + rowhash/all-barriers instruments banked, key hardened over every per-row identity

Co-Authored-By: Virgil <virgil@lethean.io>
…e no-q8 configuration of record, bf16-force stays a dev instrument

Co-Authored-By: Virgil <virgil@lethean.io>
…ells were lane-contention artefacts and do not reproduce; bf16 ≈ q8 on E2B at both depths, TQ demoted to capacity-mode-only

Co-Authored-By: Virgil <virgil@lethean.io>
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
4.7% Duplication on New Code (required ≤ 3%)
D Security Rating on New Code (required ≥ A)
E Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

💡 Need a hand with PR review? Try Gitar by Sonar!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants