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/qwen36-bench (the change before (08293922), the defaults, SNAP=<GGUF model>)
v1: launchers/gguf/qwen36-bench (this change (627409db), the defaults, SNAP=<GGUF model>)
order: the binaries' order turns at every round (ABBA)

host before the runs: 2026-10-20 23:44:19 chrome=0 System-wide memory free percentage: 77% swap_used=534.88M swapouts=80676

host after the runs: 2026-10-20 23:56:44 chrome=0 System-wide memory free percentage: 72% swap_used=534.88M swapouts=80676

## v1-run1
### before the run (date, thermal state, swap, wait)
2026-10-20 23:48:07
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,3.492,18.33,32,365.2,6.585,9072,9.73,d11eb1bbd30253bb,5cb23346ab6be1d8,2.72050,0.469
512,512,7.456,68.67,32,315.3,7.029,10962,11.08,c048488df5ccaad8,7a8848450b863c49,3.00958,0.500

### 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=half (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.48 GB
[qwen36-metal] GGUF: 21706 products with the file's dense matrices and 12192 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
       22.08 real         1.57 user        13.03 sys
          2663989248  maximum resident set size
                   0  average shared memory size
                   0  average unshared data size
                   0  average unshared stack size
              354217  page reclaims
                2163  page faults
                   0  swaps
                   0  block input operations
                   0  block output operations
                   0  messages sent
                   0  messages received
                   0  signals received
                 413  voluntary context switches
              357731  involuntary context switches
         37980342618  instructions retired
         42530488756  cycles elapsed
          1150532928  peak memory footprint

### after the run
2026-10-20 23:48:30
0
swap_used=534.88M swapouts=80676

## v1-run2
### before the run (date, thermal state, swap, wait)
2026-10-20 23:49:30
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,3.480,18.39,32,365.6,6.702,9072,9.53,d11eb1bbd30253bb,5cb23346ab6be1d8,2.72050,0.469
512,512,7.135,71.76,32,288.4,7.227,10962,10.44,c048488df5ccaad8,7a8848450b863c49,3.00958,0.500

### 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=half (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.21 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.48 GB
[qwen36-metal] GGUF: 21706 products with the file's dense matrices and 12192 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
       20.74 real         1.50 user        12.80 sys
          2657878016  maximum resident set size
                   0  average shared memory size
                   0  average unshared data size
                   0  average unshared stack size
              353879  page reclaims
                 507  page faults
                   0  swaps
                   0  block input operations
                   0  block output operations
                   0  messages sent
                   0  messages received
                   0  signals received
                 191  voluntary context switches
              352146  involuntary context switches
         36946447480  instructions retired
         41727135481  cycles elapsed
          1150565696  peak memory footprint

### after the run
2026-10-20 23:49:51
0
swap_used=534.88M swapouts=80676

## v1-run3
### before the run (date, thermal state, swap, wait)
2026-10-20 23:53:38
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,3.436,18.63,32,365.6,6.653,9072,9.66,d11eb1bbd30253bb,5cb23346ab6be1d8,2.72050,0.469
512,512,7.154,71.57,32,298.0,7.145,10962,10.46,c048488df5ccaad8,7a8848450b863c49,3.00958,0.500

### 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=half (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.20 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.49 GB
[qwen36-metal] GGUF: 21706 products with the file's dense matrices and 12192 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
       20.80 real         1.52 user        12.98 sys
          2668888064  maximum resident set size
                   0  average shared memory size
                   0  average unshared data size
                   0  average unshared stack size
              353646  page reclaims
                 714  page faults
                   0  swaps
                   0  block input operations
                   0  block output operations
                   0  messages sent
                   0  messages received
                   0  signals received
                 238  voluntary context switches
              351676  involuntary context switches
         37301921479  instructions retired
         42237461839  cycles elapsed
          1150385536  peak memory footprint

### after the run
2026-10-20 23:53:59
0
swap_used=534.88M swapouts=80676

## v1-run4
### before the run (date, thermal state, swap, wait)
2026-10-20 23:54:59
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,3.507,18.25,32,377.7,6.587,9072,9.85,d11eb1bbd30253bb,5cb23346ab6be1d8,2.72050,0.469
512,512,7.465,68.58,32,307.3,7.066,10962,11.12,c048488df5ccaad8,7a8848450b863c49,3.00958,0.500

### 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=half (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.29 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.48 GB
[qwen36-metal] GGUF: 21706 products with the file's dense matrices and 12192 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
       21.43 real         1.54 user        12.95 sys
          2667823104  maximum resident set size
                   0  average shared memory size
                   0  average unshared data size
                   0  average unshared stack size
              353224  page reclaims
                2033  page faults
                   0  swaps
                   0  block input operations
                   0  block output operations
                   0  messages sent
                   0  messages received
                   0  signals received
                 649  voluntary context switches
              357745  involuntary context switches
         38006027376  instructions retired
         42312555639  cycles elapsed
          1150418240  peak memory footprint

### after the run
2026-10-20 23:55:21
0
swap_used=534.88M swapouts=80676

