diff --git a/.beads/issues.jsonl b/.beads/issues.jsonl index 77d2df8..810ea7d 100644 --- a/.beads/issues.jsonl +++ b/.beads/issues.jsonl @@ -50,6 +50,7 @@ {"id":"nix-overlay-qcg","title":"freetoken: bump 0.1.3 -> 0.2.0 once nixpkgs has torch 2.14 / transformers 5.18","description":"FreeToken 0.2.0 requires torch>=2.14,<2.15, torchvision>=0.29,<0.30, transformers>=5.18,<5.19, triton 3.8 and flashlib==0.4.0 (currently packaged: 0.3.0). nixos-unstable ships torch 2.11 and transformers 5.5.4, so the pin in flake.nix (nixpkgs-torch211) and packages/freetoken/package.nix must be reworked once a newer torch lands in nixpkgs.","status":"open","priority":3,"issue_type":"task","created_at":"2026-10-24T09:01:39.154532688Z","created_by":"minder","updated_at":"2026-10-24T09:01:39.154532688Z","source_repo":"nix-overlay","compaction_level":0,"original_size":0} {"id":"nix-overlay-qfi","title":"Benchmark Qwen speculative depth and bounded prefill deferral during active decode","description":"On ms-s1-max compare draft depth costs, assess whether XDNA can prefill a second Qwen3.8 EXL3 request, and package a bounded scheduler in the overlay only if it improves the mixed workload with output checks.","status":"closed","priority":2,"issue_type":"task","assignee":"codex","created_at":"2026-11-18T11:51:09.731217906Z","created_by":"minder","updated_at":"2026-11-18T12:19:23.830501603Z","closed_at":"2026-11-18T12:19:23.830171714Z","close_reason":"Validated bounded prefill grace on two-slot Qwen3.8 EXL3 at 32K, 128K and 200K, with matching sampled texts for the tested pairs. Checked the NPU graph and memory limits and retained the measured faster stock draft-depth policy.","source_repo":"nix-overlay","compaction_level":0,"original_size":0,"comments":[{"id":11,"issue_id":"nix-overlay-qfi","author":"minder","text":"Current experiment uses an isolated loopback model on ms-s1-max. Candidate source scope if justified: packages/kyojin. Also assess NPU-only prefill and cache/state handoff for a second request.","created_at":"2026-11-18T11:51:31Z"},{"id":12,"issue_id":"nix-overlay-qfi","author":"minder","text":"XDNA feasibility on ms-s1-max: gufo src/core/npu/qwen3_prefill.hpp is a fixed 28-layer dense Qwen3 with width 2048. hipfire docs/npu/npu-trunk.md dispatches only GdnIn/QsaIn; MoE, mixers and decode still require the GPU. This EXL3 pack has 48 fused MoE layers, 512 experts/layer, width 2560, intermediate 640, top-k 10. A separate INT8 copy of all routed gate/up/down weights is 112.5 GiB before other weights or caches. A native packed-weight or streaming prefill backend would need the full hybrid graph and compatible KV/indexer/recurrent/PLE handoff. Isolated single-panel timings and error are archived in /DATA/LLMs/benchmark_results/kyojin-xdna-20261118. No full-NPU throughput or end-to-end quality was measured.","created_at":"2026-11-18T12:11:43Z"},{"id":13,"issue_id":"nix-overlay-qfi","author":"minder","text":"Built the patched wrapper offline with nix build --offline --no-link .#kyojin; nixfmt --check and git diff --check passed.\nNew planner tests: 3 passed (positive, bypass, and fixed deadline subcases). Patched-source Qwen suite: 117 discovered, 116 passed with the packaged Python environment; the one optional chat-template test separately passed with the real model pack and a Transformers environment.\nA preliminary private server with the stock chunk planner and a client-side delay established the 32K hypothesis. The final server comparison used two package outputs with byte-identical serve.py and prefill_grace.py; the only scheduler difference was KYOJIN_PREFILL_GRACE_S=10 or 0. Two live slots, cold KV, identical model/requests/seeds, immediate second HTTP submission after 12 visible prose stream events.\n32768 tokens / scene 1: decode 13.91 -> 31.38 t/s, cold prefill 773.7 -> 1388.4 t/s, second TTFT from arrival 42.99 -> 33.59 s, short-reply event gap p95 526.9 -> 72.2 ms. Text hashes matched (story/long): True/True.\n32768 tokens / scene 0: decode 14.61 -> 31.32 t/s, cold prefill 790.4 -> 1385.3 t/s, second TTFT from arrival 41.98 -> 33.42 s, short-reply event gap p95 516.2 -> 72.0 ms. Text hashes matched (story/long): True/True.\n131072 tokens / scene 0: decode 16.07 -> 32.17 t/s, cold prefill 1166.6 -> 1347.4 t/s, second TTFT from arrival 112.95 -> 106.80 s, short-reply event gap p95 492.2 -> 69.4 ms. Text hashes matched (story/long): True/True.\n204800 tokens / scene 0: decode 15.67 -> 31.94 t/s, cold prefill 1208.1 -> 1321.0 t/s, second TTFT from arrival 170.24 -> 164.96 s, short-reply event gap p95 497.3 -> 69.9 ms. Text hashes matched (story/long): True/True.\nDraft-depth controller comparison on four other 192-token Russian prose prompts: tier 30.49, stock table 29.43, measured-cost table 29.77 t/s (medians). Only one of two 96-token greedy probes matched the tier output. Kept the shipped depth policy.\nReproducibility, raw timings, prompts/seeds and outputs' digest prefixes: /DATA/LLMs/benchmark_results/kyojin-prefill-grace-20261118/benchmark.json. The measured workload is an already-emitting, budget-bounded short reply plus a long, uncached incoming prompt. This is an opt-in scheduler; production service pin and settings were not changed.\n","created_at":"2026-11-18T12:19:23Z"}]} {"id":"nix-overlay-rij","title":"add codex-api-proxy package","description":"Package codex-api-proxy (PyPI, MIT) for the overlay","status":"closed","priority":2,"issue_type":"task","assignee":"minder","created_at":"2026-11-09T19:02:53.916339210Z","created_by":"minder","updated_at":"2026-11-09T19:08:12.028126119Z","closed_at":"2026-11-09T19:08:12.027132991Z","close_reason":"Completed: nix build .#codex-api-proxy passes (60 tests, 2 upstream-credential tests deselected); CLI --help and status run; README updated","source_repo":"nix-overlay","compaction_level":0,"original_size":0} +{"id":"nix-overlay-tb3","title":"Skip unretainable Kyojin prefix segments before GPU staging","description":"Implement early size/space admission for paged prefix snapshots on the packaged Kyojin import path. Preserve the writer's final exact checks, LRU and cache format; compare rejected writes, restore and tool correctness on ms-s1-max.","status":"closed","priority":2,"issue_type":"task","assignee":"minder","created_at":"2026-11-18T15:16:58.686700563Z","created_by":"minder","updated_at":"2026-11-18T15:31:54.294238067Z","closed_at":"2026-11-18T15:31:54.293324084Z","close_reason":"Prefix admission fixed and verified on ms-s1-max for rejected and accepted snapshots.","source_repo":"nix-overlay","compaction_level":0,"original_size":0,"comments":[{"id":14,"issue_id":"nix-overlay-tb3","author":"minder","text":"Built kyojin and HIP JIT. Focused DiskStore tests 11/11 (same tests on stock: 3 red). Isolated same-seed 128K A / 147709-token B / A tool return: B .tmp reached 4485646592 bytes on stock, absent with patch; A write_bytes 4447.73 -> 0 MiB, TTFT 12.015 -> 1.836 s (single pair). Accepted 32K cache subsequently restored 32872/32873 tokens, TTFT 1.455 s; all tool validations passed. Host registry resolves the tested binary with a local flake input override. Upstream CPU test_promote also fails on stock: O_DIRECT retry exactly at unaligned EOF; independent of cache admission. Evidence: /DATA/LLMs/benchmark_results/kyojin-prefix-admission-20261118/report.json","created_at":"2026-11-18T15:31:54Z"}]} {"id":"nix-overlay-v09","title":"Package workstation LLM engines from upstream flakes","description":"Migration coordinated by nixos-config-npn0. Move hipfire + TheRock kernels/toolchain, gufo NPU + XRT and patch, two llama.cpp forks, and upstream Kyojin v1.8.10 into this overlay. Replace old Kyojin 1.8.5 and its obsolete tests. Use nix-strix-halo as non-flake source so no Thunderbolt dependency or dummy remains. Preserve existing revisions and dedicated engine/gufo/kyojin nixpkgs. Current machine laptop-x13: evaluation only, no compilation and no source downloads. Plan: preserve package derivations where possible; update exports and README; offline evaluation; keep issue open until builds and runtime checks of migrated packages run on ms-s1-max. No push or deployment.","notes":"Partial workstation validation completed on ms-s1-max by nix-overlay-4ou (commit 16166f115b95): therock-rocm 10.1.0, hipfire-kernels and hipfire builds passed; packaged hipfire CLI help runs; SDK HIP vector addition and rocBLAS matmul pass on gfx1151; core runtime libraries load successfully. Strata, Crucible and Strixite also passed their builds, and the Strixite GPU check passed, but those packages do not cover the remaining migration gate. Still unverified here: Gufo/XRT, Kyojin and both llama.cpp fork builds; Kyojin JIT/CPU tests; consumer system build and hipfire LLVM tools check; model-based hipfire kernel matching/quantizers and Gufo GPU+NPU startup. Keep this issue in progress until its recorded acceptance checks are complete.","status":"in_progress","priority":2,"issue_type":"task","assignee":"minder","created_at":"2026-11-12T17:11:06.267689950Z","created_by":"minder","updated_at":"2026-11-12T20:43:28.894701490Z","source_repo":"nix-overlay","compaction_level":0,"original_size":0,"comments":[{"id":4,"issue_id":"nix-overlay-v09","author":"minder","text":"Implementation and offline evaluation complete; keep open for workstation builds. All migrated pins (hipfire, gufo, Kyojin v1.8.10, both llama.cpp forks, nix-strix-halo, XRT and xdna-driver) and the engine nixpkgs pin match nixos-config before migration; all existing overlay pins are unchanged. nix-strix-halo is now flake=false, with direct TheRock SDK and XRT recipes, so Thunderbolt and its dummy are absent from both lock graphs. Kyojin replaces the old v1.8.5 nixpkgs torch/ROCm recipe with upstream v1.8.10 plus the existing CC wrapper. Upstream still labels its derivation 1.5.8; source rev d83cfeb3d6a7d42a4cf2b720efb1eb8a4ff04da7 is the requested v1.8.10. Old check-jit.py was removed with the old package; kyojin.tests.jit and tests.cpu now expose upstream HIP compiler and CPU checks. New package defaults share _lib/llm-packages.nix and defer unsupported platforms without loading their engine inputs. Exported packages: hipfire, hipfire-kernels, therock-rocm, gufo, xrt-amdxdna, kyojin, pwilkin-llama-cpp, strix-llama-cpp. Re-exported hipfire overlay and service module remain opt-in. README updated. Offline drvPath evaluation passed for all 11 packages/tool outputs with IFD disabled, plus integration assertions against both nixos-config consumers and the laptop-x13 toplevel. Gufo, XRT, Kyojin and both llama forks have identical drvPaths before/after; TheRock and hipfire now depend on genuine nixpkgs rdma-core instead of the dummy. Formatter and git diff --check passed. No compilation or source downloads. No push, commit or deployment. Temporary local consumer path must be replaced with the remote URL and a published lock pin after publication.","created_at":"2026-11-12T17:20:29Z"},{"id":5,"issue_id":"nix-overlay-v09","author":"minder","text":"Build gate: run only on ms-s1-max after hostname confirms the workstation. In nix-overlay: nix build --no-link .#hipfire .#hipfire-kernels .#therock-rocm .#gufo .#xrt-amdxdna .#kyojin .#pwilkin-llama-cpp .#strix-llama-cpp .#kyojin.tests.jit .#kyojin.tests.cpu. Then in nixos-config evaluate and build nixosConfigurations.ms-s1-max.config.system.build.toplevel, and run checks.x86_64-linux.hipfire-llvm-tools-check. Confirm Kyojin Triton JIT, hipfire precompiled-kernel matching/quantizers, and Gufo GPU+NPU startup against existing models. Particular risk to check: TheRock real rdma-core dependency replaces the previous dummy, so its and hipfire dependency paths change. Record evidence in this issue and nixos-config-npn0 before closure. Restore and verify the consumer remote overlay URL only after approved publication.","created_at":"2026-11-12T17:20:32Z"},{"id":6,"issue_id":"nix-overlay-v09","author":"minder","text":"Final verification update: normal Git-flake evaluation of all eight migrated package drvPaths passed; new files are indexed so Blueprint can see them. No commit created. Full git diff --check HEAD reports gufo-unsloth-ud3.patch:6 trailing whitespace: a required single-space prefix for an empty unified-diff context line. Patch bytes match the original nixos-config patch exactly, and git apply --check against the pinned Gufo source passes. Preserved the patch and did not suppress the checker. Earlier successful whitespace check covered the unstaged diff only.","created_at":"2026-11-12T17:22:21Z"},{"id":7,"issue_id":"nix-overlay-v09","author":"minder","text":"Astra code-review completed on gpt-6-astra medium: Spec has no findings; two Standards metadata findings fixed. Kyojin restores homepage and MIT license, confirmed from the cached upstream LICENSE. XRT shared producer declares mainProgram=xrt-smi, matching the workstation NPU prep command. Offline Nix assertions passed for all four metadata fields and the shared Gufo/XRT metadata. Kyojin drvPath is unchanged. XRT mainProgram causes nixpkgs to add NIX_MAIN_PROGRAM=xrt-smi to its derivation; independent derivation comparison found only that environment change (plus output paths), so Gufo changes transitively. Formatting passed. Preparing the user-requested migration commit; no compilation, source downloads, push or deployment. Existing whitespace warning is the unchanged unified-diff patch context. Keep this task open for the recorded workstation build/runtime gate. Pre-existing unrelated tracker change nix-overlay-y5r will remain outside this commit.","created_at":"2026-11-12T17:36:38Z"}]} {"id":"nix-overlay-vhq","title":"Note missing Dolt remote in AGENTS.md","description":"## Why\\nAgents running bd dolt push see 'No remote is configured - skipping' and may mistake it for a failure (blocking session close). Document that this is expected: no Dolt remote is set up, beads state is versioned locally in .beads/ and committed via git.\\n\\n## What\\nAdd a short note in the Beads Issue Tracker / Session Completion section of AGENTS.md.\\n\\n## Acceptance\\n- AGENTS.md explains the expected bd dolt push output and that git push is the actual sync mechanism","status":"closed","priority":3,"issue_type":"task","assignee":"Alexander Miroshnichenko","owner":"alex@millerson.name","created_at":"2026-08-07T13:18:33Z","created_by":"Alexander Miroshnichenko","updated_at":"2026-08-07T13:19:26Z","closed_at":"2026-08-07T13:19:26Z","close_reason":"AGENTS.md updated and pushed","source_repo":".","compaction_level":0,"original_size":0} {"id":"nix-overlay-vhs","title":"Review ROCm package changes since 24195451","description":"Review git diff 24195451db1a0cd8c9633a500bcfd4df9398d011...2f3f3f3250fa along independent Standards and Spec axes using code-review skill. Report evidence-backed findings, without implementation changes.","notes":"Reviewed immutable range 24195451db1a0cd8c9633a500bcfd4df9398d011...2f3f3f3250face8f341d62dc7558938806522207 using independent fresh-context Standards and Spec reviewers. Standards: no documented-standard violations; one optional P3 Duplicated Code smell, host toolchain flag lists in packages/strata/package.nix:37 and packages/strixite/package.nix:11. A common helper is optional; no current functional failure demonstrated. Spec: one P3 documentation discrepancy in README.md:160 and packages/crucible-strix-halo/package.nix:32, confusing the official release compiler restriction with all source builds. Other requirements align with ka5/bo0/cn2/4ou. Existing installed outputs and GPU/evaluation logs inspected; engines resolve runtime dependencies. No package rebuilds or full-model inference during review. Implementation files unchanged.","status":"closed","priority":2,"issue_type":"task","assignee":"minder","created_at":"2026-11-12T20:47:47.129527551Z","created_by":"minder","updated_at":"2026-11-12T20:52:04.582785642Z","closed_at":"2026-11-12T20:52:04.582215760Z","close_reason":"Completed both review axes: one optional Standards P3 and one Spec documentation P3; no confirmed blocking defects. Findings reported and documentation correction tracked separately.","source_repo":"nix-overlay","compaction_level":0,"original_size":0} diff --git a/_lib/llm-packages.nix b/_lib/llm-packages.nix index 12d7879..3223413 100644 --- a/_lib/llm-packages.nix +++ b/_lib/llm-packages.nix @@ -36,7 +36,7 @@ builtins.mapAttrs hipfire-kernels = hipfire.kernels; xrt-amdxdna = gufo.xrt; kyojin = pkgs.callPackage ../packages/kyojin/package.nix { - kyojin = inputs.kyojin.packages.${system}.kyojin; + inherit (inputs.kyojin.packages.${system}) kyojin exllamav3; jitCheck = inputs.kyojin.checks.${system}.kyojin-hipcc-smoke; cpuCheck = inputs.kyojin.checks.${system}.kyojin-tests; }; diff --git a/packages/kyojin/package.nix b/packages/kyojin/package.nix index 16803f7..adb4d16 100644 --- a/packages/kyojin/package.nix +++ b/packages/kyojin/package.nix @@ -1,10 +1,26 @@ { pkgs, kyojin, + exllamav3, jitCheck, cpuCheck, }: +let + admissionPatch = ./prefix-disk-admission.patch; + engine = exllamav3.overrideAttrs (old: { + patches = (old.patches or [ ]) ++ [ admissionPatch ]; + }); + # Both the upstream serve wrappers and the CPU check prepend the wheel to PYTHONPATH. + withEngine = + script: + let + updated = builtins.replaceStrings [ "${exllamav3}/" ] [ "${engine}/" ] script; + in + assert updated != script; + updated; +in kyojin.overrideAttrs (old: { + installPhase = withEngine old.installPhase; # Upstream installs tools directly from $src, bypassing the unpacked tree. src = pkgs.applyPatches { src = old.src; @@ -19,7 +35,10 @@ kyojin.overrideAttrs (old: { category = "AI Inference"; tests = (old.passthru.tests or { }) // { jit = jitCheck; - cpu = cpuCheck; + cpu = cpuCheck.overrideAttrs (check: { + patches = (check.patches or [ ]) ++ [ admissionPatch ]; + checkPhase = withEngine check.checkPhase; + }); }; }; postFixup = '' diff --git a/packages/kyojin/prefix-disk-admission.patch b/packages/kyojin/prefix-disk-admission.patch new file mode 100644 index 0000000..e9c36c3 --- /dev/null +++ b/packages/kyojin/prefix-disk-admission.patch @@ -0,0 +1,141 @@ +--- a/exllamav3/generator/prefix_disk.py ++++ b/exllamav3/generator/prefix_disk.py +@@ -189,15 +189,20 @@ + wrote = 0 + if new: + src = [pages[i] for i in new] ++ tensors = sl._tensors() ++ # index_select materializes one row per missing page in each cache tensor. ++ min_bytes = len(src) * sum(t[0].nbytes for t in tensors) + sum(p.sequence.nbytes for p in src) ++ if not self.disk.can_stage(min_bytes): ++ return {"saved": 0} + torch.cuda.synchronize() + tens = [] +- for t in sl._tensors(): ++ for t in tensors: + idx = torch.tensor([p.page_index for p in src], dtype=torch.long, device=t.device) + tens.append(t.index_select(0, idx).cpu()) + hs = [hashes[i] for i in new] + name = f"s_{_hx(hs[0])[:20]}_{len(hs)}" + self.disk.put(name, {"hashes": hs, "sequences": [p.sequence.cpu().clone() for p in src], "tensors": tens}, +- {"ns": self.ns, "k": "seg", "hashes": hs}) ++ {"ns": self.ns, "k": "seg", "hashes": hs}, min_bytes=min_bytes) + for pos, h in enumerate(hs): + self.pages[h] = (name, pos) + wrote += len(hs) +--- a/exllamav3/util/disk_store.py ++++ b/exllamav3/util/disk_store.py +@@ -149,10 +149,22 @@ + + # ---- async writes + +- def put(self, name: str, payload, idx) -> None: ++ def can_stage(self, min_bytes: int) -> bool: ++ """Check the writer's cap and free-space policy before allocating a segment's host copy.""" ++ if min_bytes > self.cap: ++ self.stats["skipped_cap"] += 1 ++ return False ++ # The writer leaves another payload's worth of headroom above the floor ++ # while the serialized temporary already occupies space on the volume. ++ if shutil.disk_usage(self.dir).free - 2 * min_bytes < self.floor: ++ self.stats["skipped_floor"] += 1 ++ return False ++ return True ++ ++ def put(self, name: str, payload, idx, *, min_bytes: int = 0) -> None: + """Queue an entry: payload and idx are torch.save-able and must not change afterwards (host copies).""" + if not self._closed: +- self._q.put((name, payload, idx)) ++ self._q.put((name, payload, idx, min_bytes)) + + def flush(self) -> None: + self._q.join() +@@ -172,12 +184,14 @@ + try: + if item is None: + return +- name, payload, idx = item ++ name, payload, idx, min_bytes = item + if os.path.exists(self._p(name, ".idx")): + self.touch(name) + continue + tmp = self._p(name, ".pt.tmp") + try: ++ if not self.can_stage(min_bytes): ++ continue + torch.save(payload, tmp) + n = os.path.getsize(tmp) + free = shutil.disk_usage(self.dir).free +--- a/tests/test_disk_store_cpu.py ++++ b/tests/test_disk_store_cpu.py +@@ -1,6 +1,10 @@ + """exllamav3/util/disk_store.py: atomic async writes, LRU byte cap, free-space floor, torn entries. CPU only.""" + import os + import time ++from types import SimpleNamespace ++from unittest.mock import Mock ++ ++import pytest + + import torch + +@@ -89,3 +93,59 @@ + new.flush() + time.sleep(0.02) + assert old.entries() == ["b"] and new.entries() == ["c", "d"] # the old build's oldest entry went first ++ ++ ++@pytest.mark.parametrize("limit", ["cap", "floor", "fits"]) ++def test_page_admission_before_device_copy(tmp_path, monkeypatch, limit): ++ from exllamav3.constants import PAGE_SIZE ++ from exllamav3.generator.prefix_disk import PagedPrefixDisk ++ ++ ids = torch.arange(PAGE_SIZE).view(1, -1) ++ pool = torch.arange(8 * 8192, dtype=torch.int32).view(8, -1) ++ page = SimpleNamespace(page_index=7, sequence=ids) ++ rc = Mock() ++ rc.get.return_value = {"position": PAGE_SIZE} ++ slots = SimpleNamespace(generator=SimpleNamespace(recurrent_cache=rc), _tensors=lambda: [pool], ++ _resident_chain=lambda _: ([b"page"], [page]), _find_tail=lambda *_: None) ++ pd = PagedPrefixDisk(slots, root=str(tmp_path)) ++ page_bytes = pool[7].nbytes + ids.nbytes ++ pd.disk.rate = 1e12 ++ pd.disk.cap = page_bytes - 1 if limit == "cap" else page_bytes * 2 ++ pd.disk.floor = 1 << 20 ++ free = pd.disk.floor + (2 * page_bytes - 1 if limit == "floor" else 10 * page_bytes) ++ monkeypatch.setattr(ds.shutil, "disk_usage", lambda _: SimpleNamespace(free=free)) ++ sync = Mock() ++ monkeypatch.setattr(torch.cuda, "synchronize", sync) ++ try: ++ saved = pd.save(ids)["saved"] ++ pd.disk.flush() ++ if limit == "fits": ++ assert saved == 1 and sync.called ++ name, pos = pd.pages[b"page"] ++ assert torch.equal(pd.disk.read(name)["tensors"][0][pos], pool[7]) ++ else: ++ sync.assert_not_called() ++ assert saved == 0 and not pd.pages and not pd.disk.entries() ++ assert pd.disk.stats["skipped_" + limit] == 1 ++ finally: ++ pd.disk.close() ++ ++ ++def test_worker_checks_space_before_writing_queued_segment(tmp_path, monkeypatch): ++ s = mk(tmp_path, cap_gb=1) ++ s.floor = 4096 ++ payload = blob(1) ++ n = payload["x"].nbytes ++ free = Mock(return_value=SimpleNamespace(free=s.floor + 3 * n)) ++ monkeypatch.setattr(ds.shutil, "disk_usage", free) ++ save = Mock(wraps=torch.save) ++ monkeypatch.setattr(torch, "save", save) ++ try: ++ assert s.can_stage(n) ++ free.return_value = SimpleNamespace(free=s.floor + n) ++ s.put("seg", payload, {}, min_bytes=n) ++ s.flush() ++ save.assert_not_called() ++ assert not s.entries() and s.stats["skipped_floor"] == 1 ++ finally: ++ s.close()