Repository navigation
Merge upstream main - #141
Merged
Merged
Conversation
plotarmordev
commented
Nov 22, 2026
Owner
- dsv41 metal: price drafts from a cost table timed on the loaded model
- dsv41 metal: time a sparse set of windows and a warm pass for the cost table
- dsv41 metal: refuse a malformed timing setting, and key a stored cost table by device and weights
- dsv41 metal: measure the cost table over a two-row prompt, and time every window a lone stream can make
- dsv41 metal: time the pass back to back, and refuse a pass that cannot be one
- dsv41 metal: the slot term's windows keep their repeats whatever the budget
- dsv41 metal: report the timed cost table and keep pricing by the defaults
- dsv41 metal: time nothing unless TF_DSV41_CALIB names a source
- dsv41 metal: the TF_DSV41_CALIB refusal names the Metal default as it is
- docs: the TF_DSV41_CALIB row describes each mode once
- docs: the optimization ledger's row for DeepSeek-V4.1's measured cost table
- dsv41 metal: keep TF_DSV41_CALIB_FILE active when TF_DSV41_CALIB is unset
- Keep Metal calibration helpers with the calibration runner
- changelog: DeepSeek-V4.1 on Metal: opt-in draft cost table timed at start, default pricing unchanged (stacked on #2983) ashhart/TensorFold#2952 under Unreleased
- changelog: DeepSeek-V4.1 on Metal: opt-in draft cost table timed at start, default pricing unchanged (stacked on #2983) ashhart/TensorFold#2952 under Unreleased
- drama3: a host test pins the codec schedules' call lists over a recording binding
- changelog: drama3: a host test pins the codec schedules' call lists over a recording binding (#2893 follow-up) ashhart/TensorFold#2962 under Unreleased
- dsv41 metal: decode attention bf16 widened through bfloat, keys prefetched to 64 rows
- dsv41 metal: TF_DSV41_PROMPT_PROF reports each Engram layer's rows by origin, the first commit, the decoder's time and late buffer starts
- dsv41 metal: Engram records decoded on up to 8 threads and finished batches settled outside the readers' lock
- dsv41 metal: a cold prompt chunk's first Engram span in two runs of rows, the first run's rows read first
- dsv41 metal: the Engram row cache defaults to 4194304 records a layer
- dsv41 metal: the keepalive probes the residency set while a request runs
- dsv41 metal: a prompt run in pieces reports the full profile
- dsv41 metal: the encoder chunk's buffers in prompt_chunk.zig
- changelog: dsv41 metal: exact cold prompts faster (Engram reads beside the first rows, bigger row cache, busy keepalive probe) ashhart/TensorFold#3459 under Unreleased
- lanes: the host row draw scans 64-logit blocks and skips mask words that allow nothing (Host draw: greedy and masked rows scan the whole vocabulary one value at a time ashhart/TensorFold#2832)
- qwen draw: the bounded top-k skips blocks its mask word allows nothing in, and ranks only allowed logits (Host draw: greedy and masked rows scan the whole vocabulary one value at a time ashhart/TensorFold#2832)
- tests: test-host-draw-timing times the Qwen host draw a 248,320-logit row on the CPU (Host draw: greedy and masked rows scan the whole vocabulary one value at a time ashhart/TensorFold#2832)
- tests: test-qwen35-metal-host runs the bounded keyed draws, which guard core's bf16 keys (Host draw: greedy and masked rows scan the whole vocabulary one value at a time ashhart/TensorFold#2832)
- Keep manual host draw timing outside automatic host CI
- changelog: Host draw: greedy and masked rows scan 64-logit blocks and skip mask words that allow nothing ashhart/TensorFold#2846 under Unreleased
- changelog: Host draw: greedy and masked rows scan 64-logit blocks and skip mask words that allow nothing ashhart/TensorFold#2846 under Unreleased
- Flash Next on CUDA: TF_FLASHNEXT_FUSED_SPLIT runs wide split-K lane calls on the fused form
- receipts: TF_FLASHNEXT_FUSED_SPLIT on main 2ba55ec, with the noise rule and tokens a round
- Flash Next on CUDA: launch records for the fused split-K instances at row tiles 16 and 32
- Flash Next: test-flashnext-fused-split-host runs fused_split.zig's tests, and zig build test reaches them
- receipts: TF_FLASHNEXT_FUSED_SPLIT on main 41a72fd, with the setting unset as a third arm
- receipts: TF_FLASHNEXT_FUSED_SPLIT's five-SM kernel-contract-limits run
- receipts: TF_FLASHNEXT_FUSED_SPLIT's arms describe the merge of main d2b3722
- receipts: limits.txt keeps the summary, the controls, this change launches and the failures by launch
- Fused split: pin the current main weight-first decode sources
- flashnext: keep fused split scheduling on the owning CUDA lane
- gradient serving: pin the lane-owned Flash Next fused split source
- changelog: Flash Next on CUDA: TF_FLASHNEXT_FUSED_SPLIT runs wide split-K decode calls on the fused form ashhart/TensorFold#3475 under Unreleased
- perf(xpu): attn_merge with 16 subgroups per head and batched partial loads
- XPU contract: register attn_merge as a bit-equal replacement with two planted controls
- docs(receipts): XPU attn_merge 16-subgroup merge, bit-identical, A-B-B-A main against branch
- XPU attn_merge: zero the values past the last slice instead of reloading it, gate 1 plants infinities there
- docs(receipts): attn_merge final-tree checks, corp_code rebuilt from a recipe, NUL-free contract output
- XPU contract: the planted attn_merge control re-weighs the last slice in bounds; receipt scripts without the card address
- Drop the trailing blank line in compare.out (git diff --check) and leave the changelog line to the landing
- adapt attn_merge launch to main's shape-generic XPU forward
- test(xpu): keep the attention pair launch aligned with the merge replacement
- changelog: XPU: Qwen3.8-27B attention merge with 16 subgroups per head, bit-identical (lands #2799) ashhart/TensorFold#3960 under Unreleased
- flashnext cuda: warm turns on one GPU, so the next turn resumes past the reply as on Nemotron
- native cuda: fold the --record note into its line, keeping cuda.zig within 600 lines
- Apply maintainer fixes: keep main's warm_quiet, move otherWork, add changelog
- Hand interrupted warm prefixes to queued follow-ups without refilling their chunk
- Skip Flash Next CUDA image warm passes before cache admission
- tests: re-pin the two Flash Next serving sources the last commit changed, on today's main
- Adapt warm handoff to cancelled-promise semantics
- fmt: cap CUDA lanes and refresh its serving pin
- Protect unrelated cache entries during warm handoff
- changelog: Flash Next on CUDA: warm turns, so the next turn resumes past the reply ashhart/TensorFold#3219 under Unreleased
- tests: Flash Next env table counts Flash Next on CUDA: TF_FLASHNEXT_FUSED_SPLIT runs wide split-K decode calls on the fused form ashhart/TensorFold#3475's TF_FLASHNEXT_FUSED_SPLIT (37 settings, 25 switches)
- changelog: tests: Flash Next env table counts Flash Next on CUDA: TF_FLASHNEXT_FUSED_SPLIT runs wide split-K decode calls on the fused form ashhart/TensorFold#3475's TF_FLASHNEXT_FUSED_SPLIT
- ci: install PyYAML for the root pytest job
- changelog: ci: install PyYAML for the root pytest job
- lanes: conformance tests, fresh = resumed cache, tree = chain = plain, reproducible, stops and malformed parents
- docs: the conformance ledger, seven invariants and the host tests that pin each
- changelog: tests: lane-core conformance suite and decode invariant ledger
- contract: H3's registration moves into its own Suite, so metal_main.zig stays at 600 lines or fewer
- engine_api: the lone driver's contract moves into engine_lone.zig, so the file has room under 600 lines
- ricursive: Ripple-65B-Preview on native Metal (NVFP4 and bf16 releases)
- ricursive: cap --context at 262,144, the longest checked; credit the release code
- ricursive docs: KL against the release's own bf16 code; the bf16 release through the harness
- ricursive contract: llama's projections at o_proj's reduction (k 10,240)
- Fit Ripple integration under the code file cap
- server goldens: GET /v1/models/{id}'s ten goldens publish reasoning_optional, after main's 2b5a038
- changelog: ricursive: Ripple-65B-Preview on native Metal (NVFP4 and bf16 releases) ashhart/TensorFold#2231 under Unreleased
- tests: prove lane batch composition invariance
- tests: retain committed lane draw positions
- tests: keep restored fake prefixes draftable
- tests: draft from restored fake history
- changelog: tests: lane-core batch-composition invariance gate
- lanes: bound delayed third-stream service
- changelog: tests: a third request at two slots starts promptly and gets fair rounds
- metal: presence and frequency penalties on Flash Next and Qwen3.8-27B, each row over the reply and its own path
- metal penalties: register the measured launch and exact in-place contract (metal: presence and frequency penalties on Flash Next and Qwen3.8-27B, each row over the reply and its own path ashhart/TensorFold#3145)
- contract: keep metal_main.zig at 600 lines with the penalties suite on today's main (three blank lines fewer)
- changelog: metal: presence and frequency penalties on Flash Next and Qwen3.8-27B, each row over the reply and its own path ashhart/TensorFold#3145 under Unreleased
- changelog: metal: presence and frequency penalties on Flash Next and Qwen3.8-27B, each row over the reply and its own path ashhart/TensorFold#3145 under Unreleased
- server: n of 1 through 16 choices on chat and completions, each its own request on the one prompt
- server: reuse prompt_list's fan for n choices; adapt its n=2 test
- server: keep fanned choices on the request's outer trace
- tools tests: the pairing scope test's refused request is n 17, now that the fake serves n 1 through 16
- changelog: server: n of 1 through 16 choices on chat and completions, each its own request on the one prompt ashhart/TensorFold#3148 under Unreleased
- cuda: keep 1.3.2's unified budget without dropping the checkpoint's pages
- cuda: restore 1.3.2's unified budget with a just-read checkpoint guard
- cuda: stop dropping the checkpoint pages before a GB10 load
- test: follow the unified CUDA checkpoint budget
- changelog: CUDA on GB10: count the checkpoint's cached pages as room instead of dropping them ashhart/TensorFold#4427 under Unreleased
- GLM CUDA: skip sparse-overwritten dense rows
- GLM CUDA: skip unread prefill projections
- changelog: glm cuda tp2 prefill: skip sparse-overwritten dense rows and unread projections
- changelog: glm cuda tp2 prefill: skip sparse-overwritten dense rows and unread projections ashhart/TensorFold#4499's line from lines/4499.txt in place of its own
- glm cuda: opt into local indexer rows through 32K
- glm cuda: read prefill own partials in place
- changelog: glm cuda tp2 prefill: local indexer rows via TF_GLM_INDEX_SPLIT and in-place own partials
- tests: re-pin glm_glue_rows.cuh, which this PR's in-place own-partials read changes
- changelog: glm cuda tp2 prefill: local indexer rows via TF_GLM_INDEX_SPLIT and in-place own partials ashhart/TensorFold#4510's line from lines/4510.txt in place of its own
- qwen3-asr: host config, tensor map, mel rows and a float64 tower (Qwen3-ASR (0.6B and 1.7B) as a native CUDA family on the audio request path ashhart/TensorFold#2105)
- qwen3-asr: the tower and Qwen3 schedules, generic over a backend binding (Qwen3-ASR (0.6B and 1.7B) as a native CUDA family on the audio request path ashhart/TensorFold#2105)
- qwen3-asr case tool: each greedy step's top two and margin, and an ids-only case (Qwen3-ASR (0.6B and 1.7B) as a native CUDA family on the audio request path ashhart/TensorFold#2105)
- qwen3-asr case tool: layer 0's steps as stages (Qwen3-ASR (0.6B and 1.7B) as a native CUDA family on the audio request path ashhart/TensorFold#2105)
- qwen3-asr: the CUDA binding, tower and Qwen3 LM, greedy on one stream (Qwen3-ASR (0.6B and 1.7B) as a native CUDA family on the audio request path ashhart/TensorFold#2105)
- Follow main extracted CUDA help for the original ASR contract command
- qwen3-asr: zig fmt
- qwen3-asr: mel.zig's comments describe the computation, not the reference's functions (Qwen3-ASR (0.6B and 1.7B) as a native CUDA family on the audio request path ashhart/TensorFold#2105)
- qwen3-asr: a lone chunk under 100 frames is convolved at its own length (Qwen3-ASR (0.6B and 1.7B) as a native CUDA family on the audio request path ashhart/TensorFold#2105)
- qwen3-asr: tf-qwen3-asr-check opens a sharded checkpoint through core.Checkpoint (Qwen3-ASR (0.6B and 1.7B) as a native CUDA family on the audio request path ashhart/TensorFold#2105)
- qwen3-asr: the host and CUDA checks are gates with a non-zero exit (Qwen3-ASR (0.6B and 1.7B) as a native CUDA family on the audio request path ashhart/TensorFold#2105)
- qwen3-asr: admission requires the tower's rows at the LM's width and a window of whole chunks; no empty group (Qwen3-ASR (0.6B and 1.7B) as a native CUDA family on the audio request path ashhart/TensorFold#2105)
- qwen3-asr: drop prompt.split, which claimed parse_asr_output without its special-token, repetition and language handling (Qwen3-ASR (0.6B and 1.7B) as a native CUDA family on the audio request path ashhart/TensorFold#2105)
- qwen3-asr: tf-qwen3-asr-check --ids-only, as tf-qwen3-asr has (Qwen3-ASR (0.6B and 1.7B) as a native CUDA family on the audio request path ashhart/TensorFold#2105)
- qwen3-asr: the tower dumps conv_out, and tf-qwen3-asr compares it (Qwen3-ASR (0.6B and 1.7B) as a native CUDA family on the audio request path ashhart/TensorFold#2105)
- qwen3-asr: windowed attention is the decision, and a --global-attention case is checkable on the host (Qwen3-ASR (0.6B and 1.7B) as a native CUDA family on the audio request path ashhart/TensorFold#2105)
- qwen3-asr: one-line comments for the lean check (Qwen3-ASR (0.6B and 1.7B) as a native CUDA family on the audio request path ashhart/TensorFold#2105)
- qwen3-asr: a decode step's logits equal the prompt pass's rows, and a prompt in two passes equals one (Qwen3-ASR (0.6B and 1.7B) as a native CUDA family on the audio request path ashhart/TensorFold#2105)
- qwen3-asr: tf-qwen3-asr-forced, the teacher-forced tie rule, and the case's bf16 and fp32 logits (Qwen3-ASR (0.6B and 1.7B) as a native CUDA family on the audio request path ashhart/TensorFold#2105)
- qwen3-asr: tf-qwen3-asr-forced takes an exact reference tie either way round, plants swapped q and k norms, and --row-gemms (Qwen3-ASR (0.6B and 1.7B) as a native CUDA family on the audio request path ashhart/TensorFold#2105)
- qwen3-asr: the exact-tie order of the reference's topk pair moves into forced.zig, with its test (Qwen3-ASR (0.6B and 1.7B) as a native CUDA family on the audio request path ashhart/TensorFold#2105)
- qwen3-asr: the language model runs qwen3's CUDA pass (qwen3 cuda: Qwen3 embedding checkpoints (BF16) on the native CUDA engine (#2261, 1 of 2) ashhart/TensorFold#2285) with a start position, an audio splice and a tied head over chosen rows (Qwen3-ASR (0.6B and 1.7B) as a native CUDA family on the audio request path ashhart/TensorFold#2105)
- qwen3 cuda: forwardFrom refuses a start or head without one input and its caches before any launch, with its tests
- tests: re-pin prefill_attention.cu, vit.cu and vit.zig for Qwen3-ASR's audio tower (Qwen3-ASR (0.6B and 1.7B) as a native CUDA family on the audio request path ashhart/TensorFold#2105)
- tests/cuda: Qwen3-ASR's contract set runs under kernel-contract's words, so main.zig stays within 600 lines (Qwen3-ASR (0.6B and 1.7B) as a native CUDA family on the audio request path ashhart/TensorFold#2105)
- Follow main extracted CUDA help when the original ASR command retires
- qwen3-asr: tower_ref.zig's header and chunks.zig's rows test describe the computation (Qwen3-ASR (0.6B and 1.7B) as a native CUDA family on the audio request path ashhart/TensorFold#2105)
- changelog: qwen3-asr: host slice, the shared tower and Qwen3 schedules over a backend binding (#2105) ashhart/TensorFold#2239 under Unreleased
- prompt cache: compare the full salt identity
- device caches: isolate snapshots by exact salt
- disk identity: hash tokenizer and template files
- qwen27: isolate standing slots by salt
- Qwen HIP: singular page ownership on faults
- Nemotron HIP: make page adoption transactional
- qwen3_5 cuda: the prefill test double's keep takes the cache salt too
- qwen3_5 test: cache-salt parameter in the prefill-widths keep double
- changelog: prompt caches: reuse requires the full isolation identity ashhart/TensorFold#4504 under Unreleased
- KIA16: precreate GLM prompt profiling traces before readiness
- KIA18: initialize GLM snapshot fixture profiling state
- changelog: glm cuda: create profiling traces before ready when TF_GLM_PROF=1 ashhart/TensorFold#4511 under Unreleased
- contract: fix GLM nonfinite kernel semantics
- metal: cast raw GLM codes to bfloat
- glm: carry exact nonfinite affine through g128
- contract: prove GLM finite-output bit identity
- contract: restore affine bias uploads
- changelog: GLM Metal: masked sparse attention and the DFlash2 q4 head keep the reference's NaN and Inf ashhart/TensorFold#4396 under Unreleased
- persistence tests: tokenizer and template edits move the disk namespace (2e12ca6)
- lanes test: the lone fake hands streams back as handover.zig asks, and the third-prompt test waits on state
- changelog: tests: lane host lone-driver test honours the hand-back contract
- changelog: tests: lane host lone-driver test honours the hand-back contract ashhart/TensorFold#4568's line from lines/4568.txt in place of its own
- flashnext metal: scale index on Macs with tensor units too
- changelog: flashnext metal: scale index on Macs with tensor units too
- changelog: flashnext metal: scale index on Macs with tensor units too ashhart/TensorFold#4547's line from lines/4547.txt in place of its own
- glm: stage borrowed conversation rows before backend expiry
- rows: restore the row-store doc comments; withAt moves to rows_chain.zig
- Preserve borrowed disk keeps across staging pressure
- Keep the borrowed permit fixture comment concise
- docs: GLM on Metal stages every resident keep, whatever --spill-gib is set to
- rows: explain borrowed-state recovery under staging pressure
- changelog: glm metal: kept states stage their borrowed rows before expiry, so spilled turns resume at the newest depth ashhart/TensorFold#2755 under Unreleased
- changelog: 1.3.4 corrections and sixteen lost lines
- fix adversarial protocol and grammar handling
- server: move protocol helpers and queue metrics test into separate files
- server: avoid shadowing the response item type
- fix MiniMax optional tool grammar compilation
- server: stream a tool call's closer cut by a feed, and keep each replayed thought's own bytes
- changelog: Hardening: tool-call parsing, streaming and grammar compiles ashhart/TensorFold#4378 under Unreleased
- feat(hip): serve Qwen3.8-27B with its DFlash2 drafter
- test(qwen35): check --drafter runs the lane invariants under DFlash2
- test(hip): pin the DFlash2 drafter's attach paths
- fix(hip): a resumed stream's DFlash2 features start at its resume point
- test(qwen35): check --drafter compares a resumed drafted stream with a fresh one
- fix(hip): --drafter refuses BF16 qwen3_5 checkpoints before they load
- native hip: keep hip.zig at 600 lines with main's merged refusal test (six blank lines fewer)
- native hip: pass the family to the DFlash2 refusal test's checkGroup calls, after main's 1a10b0b
- native hip: keep hip.zig at 600 lines with the DFlash2 drafter on main's 1a10b0b (one blank line fewer)
- hip lanes: the engine module import is engine_mod, so main's copies-only test may name its engine
- changelog: feat(hip): serve Qwen3.8-27B with its DFlash2 drafter ashhart/TensorFold#3665 under Unreleased
- glm/cuda: TF_GLM_MOE_DIRECT=1 runs a decode window's EXL3 MoE without its row copies and put_slot (glm/cuda: an EXL3 decode window's MoE block does three GPU operations a layer it does not need (two cuMemcpy2DAsync and put_slot) ashhart/TensorFold#3570)
- gradient-serving: re-pin glm_glue_moe.cuh and glm_glue_rows.cuh for TF_GLM_MOE_DIRECT (glm/cuda: TF_GLM_MOE_DIRECT=1 runs a decode window's EXL3 MoE without its row copies and put_slot (for #3570) ashhart/TensorFold#3659)
- glm/cuda: follow main's dependent-launch prologue for combine_tail (glm cuda: decode kernels as dependent launches (carries #3673), +3.7% decode at TP=3, same tokens ashhart/TensorFold#3776)
- cuda contracts: tear down glm_moe before idol_decoder
- changelog: glm/cuda: TF_GLM_MOE_DIRECT=1 runs a decode window's EXL3 MoE without its row copies and put_slot (for #3570) ashhart/TensorFold#3659 under Unreleased
- speech: wav24, wav32f and FLAC replies, a sample_rate and stereo, each opt-in per request
- server: speech_format_http_test runs over a Unix socket pair, so it is left out on Windows like the stream test
- server: shorten Drama Metal import comment
- fix: resolve the shared audio resampler within its owning module
- changelog: speech: wav24, wav32f and FLAC replies, a sample_rate and stereo, each opt-in per request ashhart/TensorFold#3138 under Unreleased
- pull: proxy settings, connect and no-progress timeouts, and a clear message when the hub is out of reach
- pull: honor proxy routing and timeouts on Windows
- pull: bound DNS and TCP with one deadline
- pull: persist buffered body bytes before read failures
- changelog: pull: proxy settings on every hop, connect and stall timeouts with range resumes (part of #3692) ashhart/TensorFold#4140 under Unreleased
- server: build the tokenizer memo on a dense dedicated allocator
- changelog: server: build the tokenizer memo on a dense dedicated allocator ashhart/TensorFold#4455 under Unreleased
- qwen3.5: report the loaded CUDA prompt pass size
- changelog: qwen3_5 cuda: report the prompt pass size the engine uses ashhart/TensorFold#4600 under Unreleased
- changelog: qwen3_5 cuda: report the prompt pass size the engine uses ashhart/TensorFold#4600 under Unreleased
- prompt cache: fork marks read only the request salt's kept prompts
- changelog: prompt cache: fork marks match the request's salt ashhart/TensorFold#4601 under Unreleased
- h3: MiniMax-H3-Image's prompt rules on the host
- h3: MiniMax-H3-Image's prompt path on Metal, on any Apple GPU
- docs: MiniMax-H3-Image's prompt path in its recipe; one line less in metal_targets
- h3: the image decoder's host rules: its tensors, a tile's sequence and rotary table, unpatchify
- h3: the image decoder on Metal in bf16, and a float64 reference of it on the host
- h3: tf-h3-image-decoder, a latent to a PNG on any Apple GPU, and its self-test
- docs: MiniMax-H3-Image's decoder in its recipe; one line less in metal_targets
- h3: MiniMax-H3-Image's text to image end to end: the prompt tool writes the canvas and the seed's starting rows
- picture: LANCZOS gives Pillow 13's bytes, shrinking, enlarging, both at once and at a canvas's ratio
- h3: MiniMax-H3-Image's prompt encoder, transformer and decoder resident across pictures
- docs: the resident H3-Image server in the Metal recipe
- h3: keep main Metal tool registration beneath resident additions
- changelog: h3: MiniMax-H3-Image's prompt encoder, transformer and decoder resident across pictures ashhart/TensorFold#3718 under Unreleased
- h3: resident server keeps main's idle ticker and fail-closed startup beside draft and routed steps
- docs: the resident H3-Image server's idle ticker and fail-closed startup in the Metal recipe
- changelog: card 200, the resident server's idle ticker and fail-closed startup
The depth rule priced Metal rounds with the CUDA-shaped defaults. Metal now times dry windows of 1 to 16 rows, the second launch from row 17 and a DSpark pass with its ingest at load, on a time budget, through the lane core's calibration path. TF_DSV41_CALIB keeps its meaning; measure is the Metal default, and TF_DSV41_CALIB_BUDGET_MS bounds the repeats. The prompt cache is not fed and every slot is left as new.
…t table The first measurement took 12.7 s and priced the pass at 62 ms. It now times rows 1, 2, 4, 8 and 16, the 4 + 4 window, rows 17 and 32 and the pass once each after an untimed window and pass, repeats the passes only while the budget lasts, and interpolates the rows between. The startup line reports the ingest share of the pass and the timed runs.
… table by device and weights The Metal measurement now checks every TF_DSV41_CALIB* setting before it times anything, so a malformed value stops the start naming the setting, its text and the accepted forms; only a measurement that fails falls back to the defaults. The settings have rows in platform/environment.zig and docs/environment.md. A stored table carries the device and checkpoint identity, so another chip or other weights never read it. dropWindow's comment says it is for calibration, with wipe after.
…very window a lone stream can make The measurement prefilled the calibration text into each slot twice and ran thirty one-row windows to grow a continuation, which cost about nine seconds on the release model outside the timed runs. It now prefills one short prompt in each slot it needs once, takes the window tokens from the text itself, and clears only the slots it used. Rows 1 to 6 are timed rather than interpolated, since a lone stream's drafts make exactly those windows.
…t be one The pass's entry was a single sample taken right after the largest windows, so whatever the first ingest after them costs became the table's pass. The pass is now run once untimed and five times back to back, as a round runs it, and the fastest is kept; the first ingest after the windows is reported apart. A table whose pass is dearer than twice its own 1-row window is refused when measured and when read back from a stored file.
…budget The slot term is the 4 + 4 window less the 8-row one, each a single sample once the budget was spent. Both now run twice more side by side after the passes, marked so the budget never drops them; only the other row counts are optional.
…ults On the M5 Ultra the measured table made code faster and sampled chat slower in three cells, with the rule near-indifferent between the depths. The table is still timed at start and reported, with its checks and settings, but the default table prices the rounds unless TF_DSV41_CALIB names a source, so served depths are unchanged. The lanes test and the Metal device test run from the Metal test steps.
Unset or blank keeps the default table with nothing timed and no extra startup line, so load time and behaviour are the base's. measure, zig, cached and real time or read the table, check it, report it and price from it. The table_prices switch is gone.
…ding binding
codec_net_test.zig runs codec_net.zig's decode (3 frames, two chunks) and encode (2 frames) over a binding
that records every kernel and clip-buffer call with its arguments, addresses named by weight and buffer.
The lists are pinned in fixtures/codec_{decode,encode}_calls.txt; a difference names the first changed call.
…tched to 64 rows tf_attn_lo and tf_attn_hi widen through the bfloat type (the same values), so the decode kernel's dots and sums spend fewer instructions a key; the prompt kernel's own widening copy goes. With that, loading each step's keys a step ahead wins at every row count measured, so decode launches take the prefetch pipeline up to 64 rows. A 72-row decode shape keeps the plain pipeline under the contract. Bits equal main's.
… origin, the first commit, the decoder's time and late buffer starts
…atches settled outside the readers' lock
…ows, the first run's rows read first The chunk's Engram row ids are hashed once for every layer. Before the first commit only the first run's layer-1 rows are queued; the second run's and layer 14's queue behind them once the GPU has layer 0. The first run (30% of the chunk's rows, chunks of 512 rows or more) goes through layers 1-13 as soon as its rows are in, the second as a later chunk would, from its first row's keys; layer 14 on runs all rows. Prompt tests compare chunks of 900 rows in two runs of 270, 9 and 450 rows, chunks of 64 in runs of 19 and 45, and every cold chunk in the prompt-then-decode check, against one run and against decode: 0 values differ.
At 65536 records a prompt's reads (more than a quarter of the cache) were read through, never kept. At 4M a 4096-row chunk's batches are kept, and the rows of common n-grams stay cached across requests.
The target gave the server's ticker only its idle tick. With the busy probe (as the Qwen3.8-27B server has) a tiny command buffer on the ticker's own queue uses the weights' set every interval of a request, under the owner's hold, so macOS keeps the layers a long prompt is not using wired. The served keepalive test runs the probe beside its ticks.
Main's stepped path starts the profile clock and times the decoder cone, so its first-commit and decoder rows are right.
No change in behavior. Keeps prompt.zig within the 600-line cap with main's image rows and staged chunks.
…hat allow nothing (ashhart#2832) sampling_row.scan replaces the scalar first pass of the greedy and masked draw: every block's exponents are checked finite before any mask test, a block whose two mask words are zero is not ranked, and an allowed key replaces the best only when strictly larger, taking the block's first lane at that key, so ties keep the lowest id and both zeros rank equal. The sampled pass walks set mask bits in id order, so the same candidates reach the fp64 sampler in the same order. The bf16 order keys move here from qwen3_5/draw_topk.zig. Main's draw stays as the test oracle in sampling_row_test.zig.
…g in, and ranks only allowed logits (ashhart#2832) After the unchanged finite check, a 32-logit block whose mask word is zero is skipped, the full-selection skip ranks only the allowed lanes, and consider runs for set bits in id order. Each skipped call would have returned at its mask check, so the selection is unchanged. Structured sampled rows at top_k 1..128 take this path, including rows where fewer than top_k ids are allowed. key and keys now come from core's sampling_row (an order-equivalent encoding), and their order test moved there with them.
… row on the CPU (ashhart#2832) Greedy, masked and sampled rows through qwen3_5/draw.zig at ReleaseFast, with a checksum of every drawn token so two builds' tokens can be compared. Not part of test or any CI shard; it runs only when asked for.
…rd core's bf16 keys (ashhart#2832) The "bounded BF16 keys" filter matched nothing once that test moved to core's sampling_row with the keys. The bounded keyed draws compare the top-k path against the value-sorted reference, so the step again fails when the keys order -0 and +0 apart.
The ReleaseSafe serve's process gpa is SafeAllocator over page_allocator, whose minimum bucket is 64 KiB on aarch64. Memo segments land in those buckets among a request's short-lived allocations, so each request that keeps a new segment maps about 64 KiB that stays until the segment evicts (ashhart#4389). Build the memo on std.heap.smp_allocator instead: dense size classes, freed segment space reused by later segments, so VmData tracks the memo's own 64 MiB count. overrideSplit propagates the memo's allocator; the other create call sites (its own tests) are unchanged.
longestShared picked the kept prompt sharing the longest prefix without checking entry salt, so one salt's history could shape where another salt's fork marks land. ashhart#4504 scoped every other prompt-cache lookup by exact salt; filter the fork candidates the same way (e.salt == salt, null matching null). No change to which KV is restored or to any single salt's marks.
…ream-main # Conflicts: # zig/src/server/speech.zig
Each text segment is tokenised on its own and cut to 4,096 tokens; references enter as a label and a vision block whose rows are tagged 0. Positions follow Qwen-VL's M-RoPE, and the rotary table rounds to bf16. The Qwen copy of a reference keeps or scales its short edge to 1,024 with Pillow's LANCZOS. The text encoder's and the refiner's configs are checked at the released geometry.
tf-h3-image-prompt turns a prompt into the text rows tf-h3-image reads: Qwen3-VL's text model to the hidden state leaving layer index 49, then condition_proj, the two token-refiner blocks over every row and the final norm. Weights are bf16 read in place; products run in simdgroup matrices with fp32 sums, so chips without tensor units run it too. The encoder also takes a reference's vision rows and DeepStack features at their image pads, ready for the edit's tower. Its selftest writes a tiny synthetic checkpoint, loads it as a real run does, and gates each kernel alone and each whole run against a float64 host reference with the same bf16 rounding points.
…d rotary table, unpatchify image_decoder.zig: the 297 decoder tensors MiniMax-H3-Image's VAE file holds (F32, checked by name and shape, decoder.mask_token left unread), their places in one bf16 buffer, a tile's sequence (its cells, 4 registers, one zero token), the 2D rotary ids in bf16 arithmetic and their angles, the proj_out rows unpatchified to pixels, and the tile geometry the attention holds (at most 16 cells a side). Host tests run in test-h3-geometry.
… on the host image_decoder_metal.zig runs the VAE's 2D ViT decoder on a batch of tiles a command buffer, on any Apple GPU (its kernels compile from source at load, no tensor units): post_quant_conv and x_embedder, the 24 blocks (RMSNorm, grouped q | k | v, q and k normed and turned half-style over their first 32 dims, softmax attention at 1/8, LayerScale residuals, the gated SiLU FFN), norm_out in fp32 and proj_out. Products are bf16 with fp32 sums, rounded where the reference rounds. decode() blends the tiles in fp32 with picture_vae's Assembler. image_decoder_reference.zig is the same forward on the host with float64 sums, for the self-test.
…self-test tf-h3-image-decoder MODEL_DIR latent.f32 ROWS COLUMNS out.png [WIDTHxHEIGHT] reads vae/config.json and the decoder's tensors, denormalises the latent, decodes it in tiles of up to 16 a pass, blends them, truncates to bytes, resizes with Pillow's LANCZOS when asked and writes a PNG. `selftest` runs the kernels on synthetic weights against the float64 host reference: the embedding and proj_out within 1 bf16 ULP, each block teacher-forced, two and all 24 blocks chained, batched decodes bit-identical to the staged tiles, and the picture's bytes. It exits 1 past a bound. zig build tf-h3-image-decoder builds it (shaders compile at load); compile-h3-image-decoder-host compiles it without the Metal compiler and joins the macOS nightly host checks. picture_writer.zig roots MOSS-Image's PNG writer and core's resampler in one module for tools beside the engine.
…es the canvas and the seed's starting rows tf-h3-image-prompt takes an optional size, seed and smallest area: it writes the canvas, the requested size and the starting rows (the seed's first torch CPU randn over the latent, patchified) beside the prompt's rows, a whole text-to-image case. tf-h3-image's free run exits 0 with nothing to gate. The recipe runs prompt, transformer and decoder in turn.
…at once and at a canvas's ratio
…nt across pictures tf-h3-image-server loads the three tools' weights once and serves one text-to-image request per stdin line. A request whose canvas, row count, reference count and tags match the last one's keeps the bound transformer and only replaces the prompt's text rows (Model.retext); another layout releases it and binds anew over the same mapped weights. The weights sit in one residency set across the three stages' queues, so macOS does not re-wire them on every request, and the idle keepalive keeps them wired between pictures while holding its ticks off during a request. A set that cannot be held or a ticker that cannot start stops startup, so the server never serves requests unwarmed. Model.load splits into open (the checkpoint mapped and read ahead) and bind (kernels and buffers for a case), and release leaves the checkpoint open; a failed bind frees every Metal object it made. The three tools load their weights once and run a picture as functions (Encoder, Folder, Vae), so the server and the one-shot tools share the same steps. The image tools' modules read safetensors and checkpoint fixtures through core, following main's core module split. metal_targets.zig was 613 lines once the H3-Image tools were registered, over the 600-line limit. FastH3's transformer and the H3-Image tools now register from h3_metal.zig, leaving metal_targets.zig at 589.
One process for every picture warm: the request line, binding reuse and retext, the weights held in one residency set, and the synthetic gates.
Follow main 4d244a0 (h3: use the current reader and share Metal tool registration). Keep its shared clip/picture tool constructors and register the incoming encoder, prompt, decoder and resident server beside them.
…ream-main # Conflicts: # build.zig # docs/recipes/minimax-h3-image-metal.md # zig/build/h3_image_decoder.zig # zig/build/h3_image_prompt.zig # zig/build/h3_image_server.zig # zig/build/metal_targets.zig # zig/kernels/metal/h3/h3_prompt.metal # zig/kernels/metal/h3/image_decoder.metal # zig/kernels/metal/h3/image_decoder.zig # zig/src/families/h3/h3.zig # zig/src/families/h3/image.zig # zig/src/families/h3/image_decoder.zig # zig/src/families/h3/image_decoder_metal.zig # zig/src/families/h3/image_decoder_reference.zig # zig/src/families/h3/picture_prompt.zig # zig/src/families/h3/picture_prompt_test.zig # zig/src/families/h3/prompt.zig # zig/src/families/h3/prompt_reference.zig # zig/src/families/h3/prompt_weights.zig # zig/src/picture_writer.zig # zig/tests/h3_image.zig # zig/tests/h3_image_decoder.zig # zig/tests/h3_image_decoder_selftest.zig # zig/tests/h3_image_prompt.zig # zig/tests/h3_image_prompt_check.zig # zig/tests/h3_image_server.zig
…beside draft and routed steps The ashhart#190 merge took the branch's tf-h3-image-server whole, dropping upstream's keepalive ticker (weights re-wired after idle) and its refusal to start when the weights cannot be held resident. Both return, with their tests, beside the branch's --draft-steps, --routed-steps and profile options.
…tup in the Metal recipe
…n-190-follow-up-keep-u Merge upstream main (ashhart#190 follow-up): keep upstream's H3 server idle ticker and fail-closed startup beside my draft/routed options
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.