Paths shortened: <GGUF model> is the directory coli import --mode link made for the GGUF (<GGUF dir>/ holds the file); bin-<commit>/ holds the harness built from that commit; each launchers/<name>/qwen36-bench is a script that sets SNAP and the variables in brackets and runs a harness. Units: /usr/bin/time -l gives bytes; the engine's '[bench] peak RSS' is in GiB; the summary's 'peak memory ... MB' is in MiB, and so is the engine's '1.95 MB per expert at most' (2,039,808 bytes, 2.04 MB).

# this change's (627409db): the dense matrices' pages locked in memory (mlock) from the start of each prompt to the end of the decode step after it

model set by each launcher; text promessi_sposi.txt; lengths 64,512; gen 32; runs 4; extra env: TEACHER=1
cooldown before every run: 60 seconds, after waiting for thermal state 0: yes, at most 900s; thermal states: 0 nominal, 1 fair, 2 serious, 3 critical
v0: launchers/gguf-08293922-exact/qwen36-bench (the change before (08293922), QWEN36_METAL_EXACT=1, SNAP=<GGUF model>)
v1: launchers/gguf-exact/qwen36-bench (this change (627409db), QWEN36_METAL_EXACT=1, SNAP=<GGUF model>)
order: the binaries' order turns at every round (ABBA)

host before the runs: 2026-10-21 00:22:24 chrome=0 System-wide memory free percentage: 71% swap_used=534.88M swapouts=80676

host after the runs: 2026-10-21 00:43:10 chrome=0 System-wide memory free percentage: 73% swap_used=534.88M swapouts=80676

## v1-run1
### before the run (date, thermal state, swap, wait)
2026-10-21 00:28:02
0
swap_used=534.88M swapouts=80676
waited for state 0: 0s

### harness output
ctx_tokens,prefill_tokens,prefill_s,prefill_tps,gen_tokens,gen_first_ms,gen_steady_tps,expert_miss,disk_s,fingerprint,tokens,nll,top1
64,64,7.908,8.09,32,459.9,4.746,9075,6.70,d0f3692592cc25d9,5cb23346ab6be1d8,2.73212,0.469
512,512,54.311,9.43,32,416.0,4.847,10941,9.16,0709d9e4849845ef,7a8848450b863c49,3.02451,0.438

### engine log and /usr/bin/time -l
[bench] GGUF <GGUF dir>/Qwen3.6-35B-A3B-UD-Q4_K_M.gguf: 1 file(s), 733 tensors
[tok] loaded 248320 pieces (max id 248319) from <GGUF model>/tokenizer.json
[gguf] qwen35moe: 40 layers (10 attention), hidden 2048, 256 experts top-8, inter 512, vocab 248320, DeltaNet v/k heads 32/16
[gguf] experts: layer 0 gate Q4_K up Q4_K down Q5_K, 1.95 MB per expert at most
[qwen-cache] global_bytes=536469504 slots=263 slot_bytes=2039808 decode_policy=expected-reuse
[qwen36-metal] expert cache below 256 retained slots: prompt experts load eight at a time
[qwen36-metal] graph ready on Apple M1: rows<=2048 dense=mapped kv=float (1910087680 bytes mapped); the experts in the global cache, not in the per-layer one
[qwen36-metal] GGUF: the dense matrices read in place as the file's ggml blocks, and the routed experts as its blocks too (layer 0: gate Q4_K, up Q4_K, down Q5_K), with no second quantization
[bench] Metal graph ready in 0.27 s; text 6182 tokens; lengths 64,512; gen 32; each length from an empty state
[qwen36-metal] GGUF: the dense matrices locked in memory (1914208256 bytes) from each prompt to the decode step after it
[bench] peak RSS 2.52 GB
[qwen36-metal] GGUF: 21706 products with the file's dense matrices and 12182 with its routed experts ran on the GPU
[qwen36-metal] GGUF: the dense matrices locked for 2 prompts, unlocked after 2 first decode steps and at the end of 0 requests; 0 still locked at exit
       77.17 real         5.03 user        22.96 sys
          2708062208  maximum resident set size
                   0  average shared memory size
                   0  average unshared data size
                   0  average unshared stack size
              363703  page reclaims
                2032  page faults
                   0  swaps
                   0  block input operations
                   0  block output operations
                   0  messages sent
                   0  messages received
                   0  signals received
                 453  voluntary context switches
              645314  involuntary context switches
         50608924247  instructions retired
         51151315493  cycles elapsed
          1228127744  peak memory footprint

### after the run
2026-10-21 00:29:19
0
swap_used=534.88M swapouts=80676

## v1-run2
### before the run (date, thermal state, swap, wait)
2026-10-21 00:30:20
0
swap_used=534.88M swapouts=80676
waited for state 0: 0s

### harness output
ctx_tokens,prefill_tokens,prefill_s,prefill_tps,gen_tokens,gen_first_ms,gen_steady_tps,expert_miss,disk_s,fingerprint,tokens,nll,top1
64,64,7.873,8.13,32,470.6,4.776,9075,6.58,d0f3692592cc25d9,5cb23346ab6be1d8,2.73212,0.469
512,512,54.209,9.44,32,420.2,4.883,10941,9.19,0709d9e4849845ef,7a8848450b863c49,3.02451,0.438

### engine log and /usr/bin/time -l
[bench] GGUF <GGUF dir>/Qwen3.6-35B-A3B-UD-Q4_K_M.gguf: 1 file(s), 733 tensors
[tok] loaded 248320 pieces (max id 248319) from <GGUF model>/tokenizer.json
[gguf] qwen35moe: 40 layers (10 attention), hidden 2048, 256 experts top-8, inter 512, vocab 248320, DeltaNet v/k heads 32/16
[gguf] experts: layer 0 gate Q4_K up Q4_K down Q5_K, 1.95 MB per expert at most
[qwen-cache] global_bytes=536469504 slots=263 slot_bytes=2039808 decode_policy=expected-reuse
[qwen36-metal] expert cache below 256 retained slots: prompt experts load eight at a time
[qwen36-metal] graph ready on Apple M1: rows<=2048 dense=mapped kv=float (1910087680 bytes mapped); the experts in the global cache, not in the per-layer one
[qwen36-metal] GGUF: the dense matrices read in place as the file's ggml blocks, and the routed experts as its blocks too (layer 0: gate Q4_K, up Q4_K, down Q5_K), with no second quantization
[bench] Metal graph ready in 0.23 s; text 6182 tokens; lengths 64,512; gen 32; each length from an empty state
[qwen36-metal] GGUF: the dense matrices locked in memory (1914208256 bytes) from each prompt to the decode step after it
[bench] peak RSS 2.53 GB
[qwen36-metal] GGUF: 21706 products with the file's dense matrices and 12182 with its routed experts ran on the GPU
[qwen36-metal] GGUF: the dense matrices locked for 2 prompts, unlocked after 2 first decode steps and at the end of 0 requests; 0 still locked at exit
       76.45 real         5.06 user        22.87 sys
          2718547968  maximum resident set size
                   0  average shared memory size
                   0  average unshared data size
                   0  average unshared stack size
              364585  page reclaims
                 587  page faults
                   0  swaps
                   0  block input operations
                   0  block output operations
                   0  messages sent
                   0  messages received
                   0  signals received
                 276  voluntary context switches
              646633  involuntary context switches
         50398799114  instructions retired
         51169792389  cycles elapsed
          1228127744  peak memory footprint

### after the run
2026-10-21 00:31:36
0
swap_used=534.88M swapouts=80676

## v1-run3
### before the run (date, thermal state, swap, wait)
2026-10-21 00:37:15
0
swap_used=534.88M swapouts=80676
waited for state 0: 0s

### harness output
ctx_tokens,prefill_tokens,prefill_s,prefill_tps,gen_tokens,gen_first_ms,gen_steady_tps,expert_miss,disk_s,fingerprint,tokens,nll,top1
64,64,7.938,8.06,32,486.0,4.780,9075,6.74,d0f3692592cc25d9,5cb23346ab6be1d8,2.73212,0.469
512,512,54.171,9.45,32,422.8,4.858,10941,9.19,0709d9e4849845ef,7a8848450b863c49,3.02451,0.438

### engine log and /usr/bin/time -l
[bench] GGUF <GGUF dir>/Qwen3.6-35B-A3B-UD-Q4_K_M.gguf: 1 file(s), 733 tensors
[tok] loaded 248320 pieces (max id 248319) from <GGUF model>/tokenizer.json
[gguf] qwen35moe: 40 layers (10 attention), hidden 2048, 256 experts top-8, inter 512, vocab 248320, DeltaNet v/k heads 32/16
[gguf] experts: layer 0 gate Q4_K up Q4_K down Q5_K, 1.95 MB per expert at most
[qwen-cache] global_bytes=536469504 slots=263 slot_bytes=2039808 decode_policy=expected-reuse
[qwen36-metal] expert cache below 256 retained slots: prompt experts load eight at a time
[qwen36-metal] graph ready on Apple M1: rows<=2048 dense=mapped kv=float (1910087680 bytes mapped); the experts in the global cache, not in the per-layer one
[qwen36-metal] GGUF: the dense matrices read in place as the file's ggml blocks, and the routed experts as its blocks too (layer 0: gate Q4_K, up Q4_K, down Q5_K), with no second quantization
[bench] Metal graph ready in 0.24 s; text 6182 tokens; lengths 64,512; gen 32; each length from an empty state
[qwen36-metal] GGUF: the dense matrices locked in memory (1914208256 bytes) from each prompt to the decode step after it
[bench] peak RSS 2.52 GB
[qwen36-metal] GGUF: 21706 products with the file's dense matrices and 12182 with its routed experts ran on the GPU
[qwen36-metal] GGUF: the dense matrices locked for 2 prompts, unlocked after 2 first decode steps and at the end of 0 requests; 0 still locked at exit
       76.55 real         5.09 user        23.08 sys
          2710224896  maximum resident set size
                   0  average shared memory size
                   0  average unshared data size
                   0  average unshared stack size
              364150  page reclaims
                1358  page faults
                   0  swaps
                   0  block input operations
                   0  block output operations
                   0  messages sent
                   0  messages received
                   0  signals received
                 429  voluntary context switches
              647024  involuntary context switches
         50707315338  instructions retired
         51354021099  cycles elapsed
          1228275200  peak memory footprint

### after the run
2026-10-21 00:38:32
0
swap_used=534.88M swapouts=80676

## v1-run4
### before the run (date, thermal state, swap, wait)
2026-10-21 00:39:32
0
swap_used=534.88M swapouts=80676
waited for state 0: 0s

### harness output
ctx_tokens,prefill_tokens,prefill_s,prefill_tps,gen_tokens,gen_first_ms,gen_steady_tps,expert_miss,disk_s,fingerprint,tokens,nll,top1
64,64,7.953,8.05,32,479.8,4.717,9075,6.96,d0f3692592cc25d9,5cb23346ab6be1d8,2.73212,0.469
512,512,54.251,9.44,32,419.5,4.848,10941,8.84,0709d9e4849845ef,7a8848450b863c49,3.02451,0.438

### engine log and /usr/bin/time -l
[bench] GGUF <GGUF dir>/Qwen3.6-35B-A3B-UD-Q4_K_M.gguf: 1 file(s), 733 tensors
[tok] loaded 248320 pieces (max id 248319) from <GGUF model>/tokenizer.json
[gguf] qwen35moe: 40 layers (10 attention), hidden 2048, 256 experts top-8, inter 512, vocab 248320, DeltaNet v/k heads 32/16
[gguf] experts: layer 0 gate Q4_K up Q4_K down Q5_K, 1.95 MB per expert at most
[qwen-cache] global_bytes=536469504 slots=263 slot_bytes=2039808 decode_policy=expected-reuse
[qwen36-metal] expert cache below 256 retained slots: prompt experts load eight at a time
[qwen36-metal] graph ready on Apple M1: rows<=2048 dense=mapped kv=float (1910087680 bytes mapped); the experts in the global cache, not in the per-layer one
[qwen36-metal] GGUF: the dense matrices read in place as the file's ggml blocks, and the routed experts as its blocks too (layer 0: gate Q4_K, up Q4_K, down Q5_K), with no second quantization
[bench] Metal graph ready in 0.25 s; text 6182 tokens; lengths 64,512; gen 32; each length from an empty state
[qwen36-metal] GGUF: the dense matrices locked in memory (1914208256 bytes) from each prompt to the decode step after it
[bench] peak RSS 2.54 GB
[qwen36-metal] GGUF: 21706 products with the file's dense matrices and 12182 with its routed experts ran on the GPU
[qwen36-metal] GGUF: the dense matrices locked for 2 prompts, unlocked after 2 first decode steps and at the end of 0 requests; 0 still locked at exit
       76.72 real         4.68 user        21.87 sys
          2729066496  maximum resident set size
                   0  average shared memory size
                   0  average unshared data size
                   0  average unshared stack size
              364270  page reclaims
                1301  page faults
                   0  swaps
                   0  block input operations
                   0  block output operations
                   0  messages sent
                   0  messages received
                   0  signals received
                 409  voluntary context switches
              655163  involuntary context switches
         51220857529  instructions retired
         50321794074  cycles elapsed
          1228176896  peak memory footprint

### after the run
2026-10-21 00:40:49
0
swap_used=534.88M swapouts=80676

