Skip to content

armgit / Soup

Public Imported from GitHub
0

Fine-tune LLMs from one YAML. Layer streaming trains an 8B model on a 4 GB laptop GPU.

docs(contributors): #1398, #1455, #1457, #1419, #1516, #1517, #1469, #1498, #1306, #1454

t8d8abc933a50
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index 9043ec3e..35022173 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -200,6 +200,7 @@ Listed by first contribution. PR numbers link the work.
- `soup train --resume` on `task: prm` and `task: moe_lora_routing` announced the checkpoint, then retrained from step 0 and rewrote it: both wrappers dropped `resume_from_checkpoint`, and MoLE's periodic checkpoints held no trained gate. They forwarded it in both, saved `mole_gate.pt` into every `checkpoint-N`, restored it on resume with the base and task adapters re-frozen, refused resume on `task: unlearn`, and added a scan that fails when any trainer wrapper accepts the checkpoint without passing it on. **Four rounds, and the last one made two fixes pin each other**: every copy of the gate now goes through one fp32 save shared with #1312, and a recording test fails if a checkpoint copy skips it. 6 new tests, all failing on `main`; 13 of 13 mutations fail a test; on the final `main` the PR still merges clean and 2446 tests across 57 related files pass ([#1220](https://github.com/MakazhanAlpamys/Soup/issues/1220), [#1303](https://github.com/MakazhanAlpamys/Soup/pull/1303))
- Wrote the recipe size ratchet for #1161: `glm-4.6-sft` was labelled 9B on a 357B base and nothing compared a recipe's label with its base, so they recorded the Hub's parameter count per base (anonymously, with a reason when there is none) and made the test compare every label inside 0.70x to 1.15x. **The part worth copying is how the first version failed and what replaced it**: its kill test did arithmetic on hard-coded constants and its check `continue`d when a base had no count, so putting the GLM-4.6 label back left every test green; the final version names any recipe whose base has no count unless it is excluded with a reason, and the kill tests run the real check over `dataclasses.replace()` of the live catalog. Dropping the `continue` is also what surfaced the labels nobody had listed: the four Llama 4 Scout recipes (17B active against 109B total, hidden behind eighteen "gated" exclusions because `model_info` answers without a token), `deepseek-v3-7b-sft` (7B on a 685B base) and `voxtral-sft`. Four rounds, rebased over #1132, #1112 and #1113; the last one was the test's own "an exclusion must still be used" check going red on the `spark-tts` removal. 203 tests in the directly affected files and 4284 passed / 1 skipped across 39 recipe-touching files on the merged tree; 12 of 13 mutations caught (the survivor is the offline record script's failure branch); regenerating the fixture changes nothing ([#1161](https://github.com/MakazhanAlpamys/Soup/issues/1161), [#1168](https://github.com/MakazhanAlpamys/Soup/pull/1168))
- `soup mcp serve` planned a run by copying the config to `.soup/mcp-runs/<run_id>/config.yaml` through whatever `.soup` and `.soup/mcp-runs` resolved to, so a directory symlink or junction at either level redirected the plan-time write, and on `main` even a junction to a directory outside the working directory got directories created in it before a bare `ValueError` surfaced. They took the follow-up their own #1171 had left, calling the same `refuse_linked_dirs` helper before the `mkdir` and refusing the plan with a path-free error. The six tests cover a symlink and a real junction at both levels, each directly and through the `train_start` handler (5 of 6 fail on `main`); mutations of the call fail 5 of 6, checking `.soup` only fails the 2 `mcp-runs` tests, and dropping the helper's reparse-point branch fails the 2 junction tests ([#1211](https://github.com/MakazhanAlpamys/Soup/issues/1211), [#1492](https://github.com/MakazhanAlpamys/Soup/pull/1492))
+ - Fixed `soup train` for the sequence-classification family (#1219): the loader kept source columns only for `grpo`, so `classifier` / `reranker` lost `label` and died after the model loaded, and `cross_encoder` pair rows could not be loaded at all. **Five review rounds, and the lesson was in the scoping.** The first version taught `detect_format` the pair shape globally, which made GSM8K-shaped `{question, answer}` rows train GRPO silently on empty prompts; they moved the resolution to the one task that reads pairs (`data_config_for_task`) and gated `data.format: cross_encoder` at config load. A real-run test pins the second load site, so the dry run and the real run agree. 13 mutations killed, 6 failed / 4 passed on `main` ([#1219](https://github.com/MakazhanAlpamys/Soup/issues/1219), [#1306](https://github.com/MakazhanAlpamys/Soup/pull/1306))
- **AmixDigital** ([@Amix29](https://github.com/Amix29))
- Gave `soup monitor` a real Apple Silicon path, where it had reported nothing but an NVIDIA-shaped blank since v0.44.1. The security work is the part worth naming: fixed absolute executable paths so `PATH` cannot influence what runs, `sudo -n` that never prompts and never reads a password, stderr pattern-matched for permission markers but never printed, and a parser that returns `[]` against a billion-laughs entity bomb, an XXE `file:///` reference, 5,000-deep nesting and embedded NUL bytes. **Three guards had no test holding them up and they closed all three in twenty minutes** — most importantly the call site that decides which implementation every Linux and Windows user gets, where `if True or detect_apple_silicon()` had left 126 tests passing. Their oversize-payload test had also been asserting on `b"x" * (CAP + 1)`, which is not a valid plist and returns `[]` whether the cap exists or not; they rebuilt it around a valid oversized document. The test file shrank by 18 lines and **every deletion was an upgrade** — membership assertions became adjacency assertions. Asked to confirm the live plist schema, they said plainly that the Mac is not theirs and they cannot authenticate `sudo`, rather than guessing — while confirming the two things they could check against the real binary ([#481](https://github.com/MakazhanAlpamys/Soup/pull/481))
@@ -334,6 +335,7 @@ Listed by first contribution. PR numbers link the work.
- Added the CI ratchet that #1116's second half asked for. `scripts/check_recipe_attach.py` runs `soup recipes verify --json` over every shipped recipe, template and example and fails only on a change: a new config that cannot attach, a pinned one that now attaches, or a pinned one that vanishes from verify's output, against 20 exceptions each pinned with a reason. As ruled, it runs anonymously on pull requests and with `HF_TOKEN` only on push to `main`, is never a required check, and reports what it could not cover by reason (50 gated, 12 remote code, 7 unreadable), so a token-less green is not read as full coverage. **The rule worth copying is `not_reported`**: they added it test-first after their own review showed that a pinned config which stopped parsing would silently leave the list while the run stayed green, and it is what names `minimax-m3-dpo` once #1398 removes it. Review found that this rule had made the new-failure tests red for the wrong reason, and that the push trigger predated #1374's shared group for `main`; both fixes and every optional point landed in one push, with mutation counts that matched the review's exactly. On the final head merged with `main`, 18 tests pass, 13 of 14 source mutations fail a test and the 14th is caught by the live run, and actionlint is clean ([#1116](https://github.com/MakazhanAlpamys/Soup/issues/1116), [#1388](https://github.com/MakazhanAlpamys/Soup/pull/1388))
- `soup expect` silently ran an expectation on its defaults when the suite put `max_tokens` beside `name` (the `docs/compliance.md` example itself) or misspelled an argument, so a 5000-token row passed a 512-token gate with exit 0; they declared each expectation's arguments in one table that also drives the allowlist and the dispatcher, refused stray keys and unknown arguments at load with a pointed hint and a `difflib` suggestion (exit 3, before the data is read), validated bounds and threshold at parse time, moved the docs example to `args:`, and wrote a test that runs the YAML block read out of `docs/compliance.md` on a 5000-token row. 21 new tests (14 fail on the previous tree), every mutation of the fix plus the docs revert killed ([#1428](https://github.com/MakazhanAlpamys/Soup/issues/1428), [#1461](https://github.com/MakazhanAlpamys/Soup/pull/1461))
- A dead LLM judge was scored as a tie: `compare_pair` mapped every exception to "no winner", so `soup ship --task-mode pairwise` reported a measured 0.5 win-rate and DON'T SHIP with the judge down, `soup eval judge` aborted on the first transport error and lost the rows already scored, and nothing retried. They put every judge request behind one bounded retry helper that raises `JudgeUnavailableError` naming the judge, kept the Online DPO adapter on its own unranked-pair path with a test, and made the gate log say "could not be scored" instead of "regressed". **What is worth copying is how they took review**: three holes in their own design (a `Retry-After: nan` that reached `time.sleep`, the judge URL's userinfo and `?api_key=` printed into errors and logs, a `DecodingError` that still aborted a run) were fixed in one push, each with the test that fails without it and a mutation that turns it red; the four mutations that had survived round one were all pinned with absolute bounds rather than bounds derived from the constants they bound. 45 new tests (40 fail on `main`); 17 of 19 re-review mutations caught, the two survivors being an unpinned fallback and an unreachable branch; 470 related tests passed ([#1447](https://github.com/MakazhanAlpamys/Soup/issues/1447), [#1484](https://github.com/MakazhanAlpamys/Soup/pull/1484))
+ - Resolved #1145's four recipes that could not load, following the three rulings on the issue: removed `mistral-large-3-sft`/`-dpo` (the repo has no `config.json`) and `minimax-m3-dpo` (DPO cannot build the `minimax_m3_vl` wrapper), and moved `minimax-m3-sft` onto the vision path. **The finding worth copying is the consequence nobody asked about**: the vision path loads `AutoProcessor`, MiniMax-M3's processor is custom code, so the recipe now needs `--trust-remote-code`, and they wrote that into the description and pinned it in a test, then checked a second review comment (the vision collator supervises every token) by running `soup doctor --config` both ways. The rebase chased moving targets (#1297, then #1388 and #1113), each time from `main`'s side with both fixtures regenerated by their scripts; the last round closed the attach-ratchet coupling and pinned the docs paragraph whose mutation had survived. 2446 tests over 20 files on the merged tree, 9 of 9 mutations caught, live attach ratchet exit 0 ([#1145](https://github.com/MakazhanAlpamys/Soup/issues/1145), [#1398](https://github.com/MakazhanAlpamys/Soup/pull/1398))
- **Sohaib Kamash** ([@Nick-800](https://github.com/Nick-800))
- Added seven validated Qwen2.5-Coder, Qwen2.5-Math, and DeepSeek-R1-Distill-Qwen SFT recipes; synchronized all catalog-count sites and repaired the Mistral Small model identifier. Literal repository IDs and per-recipe learning rates are now load-bearing assertions ([#536](https://github.com/MakazhanAlpamys/Soup/pull/536)).
@@ -391,6 +393,7 @@ Listed by first contribution. PR numbers link the work.
- `benchmarks/harness/issue361_nf4_throughput.py` pins the v0.72.2 8B NF4 protocol — batch 1, S=512, 50 steps after 10 warm-up, `PagedAdamW8bit`, a same-session GEMM ceiling — so a post-#331 reading is comparable to the record rather than being a differently-shaped run. **The PR ships no number, deliberately, and is worth more for it.** The original figures were measured on an RTX 3050 Laptop 4 GB; the dev box is now an RTX 5070 Blackwell with twice the VRAM, so a run there would be a change in the INSTRUMENT rather than evidence about repaired code. They built the protocol and left the measurement for the card that can answer the question — which is the distinction the whole `benchmarks/` folder exists to protect. All eight review items closed, seven mutations and seven kills, `Refs #361` confirmed correct via GraphQL rather than assumed. **The conflict resolution is the other half**: rebased across eleven merges, their row inserted in `benchmarks/README.md` without dropping a word of the neighbouring `stream_probe.py` row, and `README.tr.md` re-stamped last as guard #852 requires ([#361](https://github.com/MakazhanAlpamys/Soup/issues/361), [#1014](https://github.com/MakazhanAlpamys/Soup/pull/1014))
- Measured the post-#331 8B NF4 row on their own RTX 3050 Laptop 4 GB: 208.6 tok/s at 1935 MHz in a 2.40 GB peak. They **published the unflattering reading instead of the headline**: the raw 1.74x over the pre-repair 119.6 tok/s is a 2x clock difference, per unit clock the repaired code is about 14% slower (68% -> 59% of the same-session ceiling), and the record attributes that shortfall to none of the three changes it lists. Four review rounds tightened the provenance. The run date was recovered from the output file's timestamps, and the committed JSON was tied to that file byte for byte. The two laptops behind the two rows are told apart, and an unverifiable console line was removed rather than defended ([#361](https://github.com/MakazhanAlpamys/Soup/issues/361), [#1103](https://github.com/MakazhanAlpamys/Soup/pull/1103))
- `soup train --find-lr` answered every failure of the live sweep, a missing base model id, a YAML syntax error in the config, a model or dataset that could not be loaded, or no `torch`, with a curve shaped by the LR schedule alone, wrote a `recommended_lr` from it and exited 0, so two different nonexistent ids reported the identical number. They deleted the fabrication rather than hiding it behind a flag: a new `LrSweepUnavailableError` beside `SweepTooShortError` makes every such case a refusal that names the cause, exits 1 and writes no report. The control test, a sweep that can run still writing its 8-point report, is what stops the refusal from swallowing a real measurement, and they disclosed the side effect that an install without `torch` now exits 1 before being asked. **The review round is the part worth copying**: five items came back, and each was closed with the mutation run to prove it. Removing the loader message, removing the escaped print and deleting the `SweepTooShortError` re-raise each survived the first round and each now fails a test; 10 of 10 mutations fail at least one test, and the new file fails 3 on `main`. The bug was found by @mohdUwaish59 while reproducing #1189 ([#1203](https://github.com/MakazhanAlpamys/Soup/issues/1203), [#1334](https://github.com/MakazhanAlpamys/Soup/pull/1334))
+ - Answered #1440, the defect that Soup's own trace stream never yielded a preference pair: `parse_soup_serve` read the signal only from a nested `feedback.rating` that no producer writes, while `soup ingest` writes a top-level `signal`, and no parser ever set `edited_output`, so the round trip ended in a green `Wrote 0`. **What earned the merge is the scope and the clamp**: they fixed only the consumer half and said in the issue which half was left (thumbs into the `soup serve` trace log), changed `Closes` to `Refs` so the issue stays open, and clamped the top-level `signal` to a closed vocabulary, so the new "Signals present" line can only ever print constants — hostile `signal` values (lists, dicts, ANSI and OSC escapes, a 100,000-character string) read as `none`, verified by execution. Their 16 tests fail 11 on the parent commit; against 19 mutations 15 are killed, including the issue's own (read only `feedback`: 10 failed). Review found four surviving mutations (the no-signal branch of the message, `none` leaking into the present-signals list, precedence on a conflicting `feedback.rating`, a whitespace-only `edited_output`) and they closed all four by adding tests, **re-running each mutation against their own file rather than quoting mine**, and also gated the `soup ingest` hint to the one format that reads a top-level `signal` and corrected the docs to say who writes which signal. 414 passed across 9 related files on the merged tree ([#1440](https://github.com/MakazhanAlpamys/Soup/issues/1440), [#1498](https://github.com/MakazhanAlpamys/Soup/pull/1498))
- **Aravind S** ([@ARAVIND281](https://github.com/ARAVIND281))
- Measured the layer-streaming VRAM fit on a **second GPU and software stack** — an A10G 23 GB on Ubuntu with torch 2.13 / transformers 5.16.1 / trl 0.29.1, against the RTX 3050 laptop on Windows and torch 2.5.1 that every previous figure came from. All three findings are constraints on an open question rather than extra data points beside it: the v0.73.1 long-sequence under-prediction **does not reproduce** (flat 1.1621-1.1694 across seq 2048-6144 where the RTX series reads 0.787x at 6144), the logits loss term measures **12.000000 exactly** and invariant across vocabulary and torch version — so the shipped 14's `+2` retained copy, which #327 has never identified, demonstrably does not happen here — and the SDPA hypothesis #395 names as leading is **not supported**, with the math backend included as a positive control that IS expensive enough (3.27 GB at seq 6144) to prove the measurement could have found it. **They retracted their own headline figure mid-review** — a back-solved 11.83 B/element — and then enforced the retraction in CI rather than in prose: writing 11.83 back into the constant fails a named test. The discarded first sweep is kept in the record because its failure is silent: `data.max_length` truncates rather than pads, so short rows run at their own length while the prediction keeps climbing, producing a clean-looking over-prediction that is entirely an artifact and would mislead the next person identically ([#395](https://github.com/MakazhanAlpamys/Soup/issues/395), [#610](https://github.com/MakazhanAlpamys/Soup/pull/610))
@@ -433,6 +436,7 @@ Listed by first contribution. PR numbers link the work.
- `format: tool-calling` read only top-level `tools` and `tool_calls`. It dropped every row `soup agent synth` writes, and every OpenAI-shape trajectory, and `soup train --dry-run` still said `Ready to train!` on zero rows. The converter now reads calls where they live, in source order, and keeps the old top-level form as a fallback. `format: auto` recognises `{messages, tools}`, synthesised rows carry their tool's schema, and `tools` may be a JSON-encoded string. **The part worth copying is the stop, and what it found.** `soup train` now exits 1 before the model loads when a load yields no training rows, and names the format and the first dropped row's reason. On its first run it caught two fixtures in the existing suite whose only row had gone to validation, runs that had trained on nothing; they fixed the fixtures rather than loosening the check. They also caught that Arrow gives every message every key, so a plain user turn reached Llama-style templates as a call, and they pinned that with a render through a real tokenizer. Second round: a string `tools` regression, null content, a mutable load record and one unpinned line, all closed with tests. 25 of 25 mutations killed; 4066 passed across a 74-file batch ([#1217](https://github.com/MakazhanAlpamys/Soup/issues/1217), [#1321](https://github.com/MakazhanAlpamys/Soup/pull/1321))
- `soup data clean --repair-json` and `--drop-invalid-json` read only a flat `arguments` key on a row's top-level `tool_calls`, so the calls the tool-calling loader actually reads were never touched: calls nested in an assistant turn (what `soup agent synth` writes) were not repaired or checked, and a valid `{"function": {"arguments": ...}}` call read as `""` and got its row dropped. They wrote the issue with four shapes and a repro, then routed the top-level list and every assistant turn through one helper in both the `tool-calling` and `chatml` branches, following exactly what the loader accepts (dict arguments and a missing `arguments` left alone, non-assistant turns untouched). **When review found that the fix turned `"tool_calls": null`, which a schema-unified export writes on every no-call row, into a dropped row under the default flags, they took the guard and the test in one push** and filed the neighbouring empty-turn case as its own issue. The new file gives 45 passed on the branch and 24 failed on `main`, 8 mutations of the fix and 3 of the null guard all fail a test, and a four-row CLI run matches ([#1338](https://github.com/MakazhanAlpamys/Soup/issues/1338), [#1453](https://github.com/MakazhanAlpamys/Soup/pull/1453))
- `soup data clean` silently deleted valid tool-calling training rows: with no flags, the `--min-tokens` check in the `chatml` branch of `clean_row` dropped a trajectory whose call-only assistant turn had `"content": ""` (the shape Soup's own tool-calling format writes) while the same turn with `null` was kept and the loader accepted both. They found it while working on #1338, reported it with a runnable snippet and the CLI output, and fixed it by exempting only a turn with a non-empty `tool_calls` list, leaving `[]`, `null`, a missing key and non-lists on the old rule. 18 tests (6 fail on `main`) cover `""`, whitespace and `null` in both branches; their mutation table (6 / 10 / 2 / 3 / 18 / 1) reproduced exactly and five further mutations were all caught ([#1477](https://github.com/MakazhanAlpamys/Soup/issues/1477), [#1493](https://github.com/MakazhanAlpamys/Soup/pull/1493))
+ - `soup ab` estimated the variance from the rows it tested, so its two-sided mSPRT needed a 30-40 row burn-in, was calibrated only to 1000 rows and `--alpha 0.01`, and still sat at 0.011 there. They replaced it with the normal-inverse-gamma mixture Bayes factor, which depends on the rows only through the t statistic, so the false-positive bound holds at any number of looks: worst simulated 0.033 at `--alpha 0.05` and 0.0066 at 0.01, from 7 rows per arm. **The part worth copying is that the cost is published next to the gain**: `accept_h0` is slower when there is no difference (281 pairs against 43 at 0.5 sd), and that table sits in the docs, the record and the changelog. Across four review rounds every edge review found became a refusal or a guard with a test a mutation kills: a near-constant held-out column, an overflowing prior at a small row count, a variance that underflows to 0, and a saturated start that had ended 99% of simulated runs in a wrong `accept_h0`, now held at `continue` while the tested rows spread more than 3 times the held-out ones (0 such runs in 2000, 15 of 6000 Gaussian first verdicts changed, no rejection). 208 passed across the `soup ab` suite; 16 of 17 mutations of the final changes killed ([#1265](https://github.com/MakazhanAlpamys/Soup/issues/1265), [#1419](https://github.com/MakazhanAlpamys/Soup/pull/1419))
- **GitFromRatatouille** ([@swalla02](https://github.com/swalla02))
- First contribution, and it is the third instance of this repo's most persistent bug class found by someone else ([#363](https://github.com/MakazhanAlpamys/Soup/issues/363), [#423](https://github.com/MakazhanAlpamys/Soup/issues/423), [#659](https://github.com/MakazhanAlpamys/Soup/issues/659)): `soup migrate` refused **any** input named `*.jsonl`, a valid LLaMA-Factory YAML config included, because the guard branched on the filename while the content sniff written to gate it had **zero call sites in `src/`**. The diagnosis is worth more than the one-line fix — the test was named after the command and its body called the helper, so it passed on a codebase where `migrate` never imported it. **Then review found a regression their own fix introduced, and the way they closed it is the part to copy**: the sniff read `utf-8`, so a UTF-8 BOM survived as U+FEFF, which `str.strip()` does not remove, and a real BOM'd JSONL silently lost the friendly error it used to get — on a project with three Windows CI cells where PowerShell's `Out-File` writes that BOM by default. Their BOM test **guards its own fixture** (asserting the file really contains a BOM before asserting behaviour) and their bounded-read test measures the property with `tracemalloc` rather than pinning the spelling of the loop. Six mutations, six killed; zero assertions removed. They also **declined to widen the fix** to files whose name gives no hint, correctly citing the `.ipynb` case the original comment warns about, and left that as an open question rather than guessing ([#672](https://github.com/MakazhanAlpamys/Soup/issues/672), [#675](https://github.com/MakazhanAlpamys/Soup/pull/675))
@@ -625,6 +629,9 @@ Listed by first contribution. PR numbers link the work.
- `training.loraplus_lr_ratio` loaded on `backend: mlx` and trained plain LoRA at one learning rate with no warning anywhere, because the MLX optimizer takes no parameter groups. They refused it at config load in its own validator placed after the MLX task gate, so tasks MLX cannot run keep their own messages, and pinned that order with five tests that fail in all three wrong positions; 10 of 10 mutations killed, 133 configs re-loaded with exactly the 11 `task: sft` MLX configs changing ([#1324](https://github.com/MakazhanAlpamys/Soup/issues/1324), [#1383](https://github.com/MakazhanAlpamys/Soup/pull/1383))
- `training.expand_layers` (LLaMA Pro) was accepted on every task, backend and modality although only the transformers text `sft` and `pretrain` trainers apply it, so a `task: dpo` or `backend: mlx` config trained the unexpanded model with no message. They refused it at config load in its own validator placed right after the #795 quantization resolver, where the existing order pins protect it, and took the review's test file, which reads the task list from the schema so a new task is covered without editing a list; 33 tests (30 fail on `main`), 12 of 12 mutations killed ([#1325](https://github.com/MakazhanAlpamys/Soup/issues/1325), [#1390](https://github.com/MakazhanAlpamys/Soup/pull/1390))
- `training.freeze_trainable_layers` was accepted on its own while nothing read it, so a config written to train only the top layers trained the whole model (or every LoRA target) and printed no warning. They refused it at config load when `expand_layers` is unset, in the validator that already holds the reverse refusal, testing `is not None` so `0` is refused and the `null` of a dumped config still reloads; 5 new tests fail on `main`, 8 of 8 mutations killed ([#1396](https://github.com/MakazhanAlpamys/Soup/issues/1396), [#1399](https://github.com/MakazhanAlpamys/Soup/pull/1399))
+ - `soup tokenizer train` saved a byte-level BPE with no `ByteLevel` decoder, no 256-byte initial alphabet and a hard-coded `unk_token`, so `decode(encode(x))` returned `Ġ` for spaces, unseen accents, emoji and CJK became `<unk>`, and `--special-token` without `<unk>` made encoding raise. They fixed all three, and measured that the vocabulary floor is `256 + special tokens + 1` (anything lower silently yields a vocabulary with zero merges) instead of trusting the number in the ticket. In review they pinned the two survivors, the saved `unk_token` and the exact boundary, with a parametrised test on both sides of the floor; 9 tests, 7 failing on `main`, and 8 of 8 mutations killed ([#1429](https://github.com/MakazhanAlpamys/Soup/issues/1429), [#1455](https://github.com/MakazhanAlpamys/Soup/pull/1455))
+ - `soup expect` passed datasets it had not checked: a UTF-8 BOM hid the first row from the PII check, malformed and non-object JSONL lines were skipped or dropped silently, and an empty file passed with `Rows 0`. They read the file as `utf-8-sig` and refused unreadable lines and zero-row runs as an input error (exit 3, count plus the first ten line numbers), kept distinct from a real suite failure (exit 2), and updated the two docs sentences that described the old behaviour. In review they tightened two `in (2, 3)` asserts to `== 3` and pinned the count and the ten-line cap; 9 tests, all failing on `main`, and 12 of 12 mutations killed ([#1434](https://github.com/MakazhanAlpamys/Soup/issues/1434), [#1457](https://github.com/MakazhanAlpamys/Soup/pull/1457))
+ - `soup compile`, quantized GGUF export and `task: unlearn` all checked their destination only after the expensive step and then discarded the result: the compile optimizer ran its LLM calls before refusing `-o ../out.py` (exit 1, no clean refusal), a quantized export into a missing directory crashed in `mkdtemp` after the adapter merge and the cleanup deleted the merged model, and unlearn trained to the end before refusing an output outside the working directory or a symlink. They moved each check in front of the work (plan-time compile check with the write-time one kept as the TOCTOU guard and its `ValueError` turned into exit 2, the export parent created before the merge, `setup()` refusing first), pinned the unlearn ordering with an import sentinel that fails when the call is removed, and in review made both export tests hermetic with the missing-parent precondition asserted after two stray `model.gguf` files had been committed and had hidden the fix from CI; 9 tests (6 fail on `main`, 3 are in-cwd controls), 4 of 4 mutations killed ([#1445](https://github.com/MakazhanAlpamys/Soup/issues/1445), [#1469](https://github.com/MakazhanAlpamys/Soup/pull/1469))
- **yi111** ([@Yi-111-a](https://github.com/Yi-111-a))
- First contribution: with torchao actually installed, four FP8-gate tests failed. The `converts` fixture stubbed `torchao` as a bare module that transformers' torchao quantizer could not import, and two "torchao absent" tests left real `torchao.*` submodules cached. The fixture now pre-seeds a package-shaped stub tree, the absent-torchao tests clear cached submodules, and the torchao-contract CI job runs the file against real torchao. **They fixed two failures the issue had not listed.** Those appear only when an earlier test file has already imported torchao, which is the CI job's own order. With torchao 0.18.0, `main` fails 4 of 333 in that job's command and the branch passes all 333; 5 of 7 fixture mutations fail a test ([#1205](https://github.com/MakazhanAlpamys/Soup/issues/1205), [#1284](https://github.com/MakazhanAlpamys/Soup/pull/1284))
@@ -634,6 +641,8 @@ Listed by first contribution. PR numbers link the work.
- First contribution: since #1249, every `grpo_variant` other than `standard` applies its KL penalty inside Soup's own loss, which replaces the trl function that records the `kl` metric, so variant runs logged no `kl` anywhere. The variant path now records trl's exact quantity from the same per-token KL the loss adds, over the completion and tool mask or rft's accepted tokens, under trl's key and gather, and nothing at `grpo_beta: 0` or for `standard`. **The rft case counts accepted tokens even without a completion mask, a detail the issue's wording implies and a test pins.** On a real trainer, five variants log exactly trl's stock `kl` on the same batch and rft logs its accepted-token mean. The three tests and the docs paragraph asked for in review went in unchanged two hours later; all 18 mutations fail a test ([#1263](https://github.com/MakazhanAlpamys/Soup/issues/1263), [#1293](https://github.com/MakazhanAlpamys/Soup/pull/1293))
- `soup data canary insert` appended its canaries, and the loader holds out the file's unshuffled tail as validation, so from 135 rows on all 16 default canaries were held out, no model trained on them, and `soup data canary check` could only report OK. They spread the canaries one per equal stretch at a seeded row, which bounds the held-out share for every seed rather than on average, kept the dataset's own rows in order, recorded each canary's row in the manifest (older manifests still load), and had `insert` print how many canaries the default split trains on, counted with the loader's own `_split_val`. **The printed count has a boundary test**: a canary on the last trained row counts, one on the first held-out row does not. 121 new tests, all failing on `main`; 12 of 12 mutations fail a test ([#1331](https://github.com/MakazhanAlpamys/Soup/issues/1331), [#1386](https://github.com/MakazhanAlpamys/Soup/pull/1386))
- `soup ab` exited on a bare `ZeroDivisionError` or `OverflowError`, or printed `continue` with a `nan` ratio, for a column whose spread or size a float cannot carry (`0` and `1e-161`, `0` and `1e200`, 40 rows of `1e308`). They refused all three where they arise, with a message naming the column, and squared as `d * d` so an overflowing deviation is caught instead of raised. 11 tests, 8 failing on `main`; 18 of 19 mutations caught after two review rounds ([#1384](https://github.com/MakazhanAlpamys/Soup/issues/1384), [#1392](https://github.com/MakazhanAlpamys/Soup/pull/1392))
+ - The #724 wiring scan only counted `get_peft_model(` and a trl `peft_config=` as building a LoRA adapter, so `mlx_sft.py` (mlx-lm's `linear_to_lora_layers`) was neither wired nor exempt, which is how `backend: mlx` ignored `loraplus_lr_ratio` unseen. After holding their earlier #1385 while #1383 merged, they came back with the follow-up the review named: the scan now counts the MLX builder and `mlx_sft.py` is exempt with a reason, **a new test fails when an exemption reason names a test file that does not exist, so the pointer to the merged file cannot go stale silently**, and the #1324 test file gained the cases #1383 lacked (every ratio, direct `SoupConfig(...)`, explicit `null`, wired-backend controls, plain `soup train`, `soup doctor --config` exit 2) plus a docs line for `unsloth`. 135 passed; 6 of 6 mutations fail a test (1 to 9 tests each) ([#1324](https://github.com/MakazhanAlpamys/Soup/issues/1324), [#1516](https://github.com/MakazhanAlpamys/Soup/pull/1516))
+ - `soup local-rl train` without `--once` rendered the nightly systemd `.service` / launchd `.plist` with `--db`, `--model` and `--train-method` only, so the scheduled job trained on as few as 10 pairs into `local_rl_adapter/` whatever `--min-pairs` and `-o` the user had passed. They claimed the slice on the umbrella issue, rendered both flags into both unit files, and moved the runner's validators out of `run_nightly_train` so the scaffold refuses a value the nightly run would refuse (`--min-pairs 0` exits 2) **before the scheduler directory is created, which a test pins**. The tests parse the `.service` with `shlex` and the `.plist` with `plistlib` and run the rendered argv through the real CLI. 14 new tests, 12 fail on `main`; 15 of 16 mutations fail a test, the survivor being the unpinned docs line ([#1448](https://github.com/MakazhanAlpamys/Soup/issues/1448), [#1517](https://github.com/MakazhanAlpamys/Soup/pull/1517))
- **Krishna** ([@Ru0k3](https://github.com/Ru0k3))
- First contribution: `soup registry diff`, `soup eval compare` and `soup eval leaderboard` kept the oldest eval score per benchmark. They overwrote rows in the tracker's newest-first order, so a re-measurement was ignored: on the issue's example both commands reported +0.20 and no regression, where comparing the newest scores gives a -0.05 regression. **They found that the leaderboard had the same bug, which the issue did not name**, and routed all three commands and the eval gate's `registry://` baseline through one helper that picks the newest `created_at` and then the latest insert. Their tests list rows newest first, as the tracker returns them, so restoring the old code at any call site fails a test. The second round added a two-model leaderboard test for the one mutation that had survived, and skips empty benchmark names as #1260 did. 13 of 15 mutations fail a test, and the other two would need a NULL value that the schema forbids ([#1270](https://github.com/MakazhanAlpamys/Soup/issues/1270), [#1291](https://github.com/MakazhanAlpamys/Soup/pull/1291))
@@ -654,6 +663,7 @@ Listed by first contribution. PR numbers link the work.
- `--trust-remote-code` was accepted and then dropped on five paths (`soup data download`, `soup eval auto`, the `soup train --find-lr` sweep loads, `soup draft distill` and `soup shrink --heal`), so a model that needs remote code still refused to load after the user opted in. They threaded the flag through all five, refused it on `datasets` 4 or newer instead of forwarding a flag that would be ignored, and, after review, pinned the default-deny direction at every site including the training auto-eval callback and guarded the missing-`datasets` install hint. On `main` 14 of the new file's 23 tests fail; 24 of 24 mutations in the last round fail a test (15 of 22 in the first) ([#1449](https://github.com/MakazhanAlpamys/Soup/issues/1449), [#1456](https://github.com/MakazhanAlpamys/Soup/pull/1456))
- `soup infer`, `soup chat` and `soup diff` printed the `--device` they were given and then loaded the model with a hard-coded `device_map="auto"` and float16, so `--device cpu` still filled the GPU. They added one shared resolver that pins the model to the requested device on both the full-model and the adapter branch of all three commands, and, after review, made an unknown or mis-cased `--device` fail with a clear message, stated the CPU float32 RAM cost in the changelog and docs, and, when the maintainer decided that GPUs must keep float16, removed the bfloat16 pick and pinned the dtype with an exact test that forces `cuda_supports_bf16()` to True. On `main` 25 of the new file's 27 tests fail; 38 of 40 mutations fail a test in the last round (11 of 19 in the first), including every way of returning bfloat16 on a GPU ([#1443](https://github.com/MakazhanAlpamys/Soup/issues/1443), [#1460](https://github.com/MakazhanAlpamys/Soup/pull/1460))
- `soup serve --device` was ignored by the transformers loader: both `_load_model` branches and the speculative draft loader hard-coded `device_map="auto"`, so `--device cpu` could still land on a visible GPU, and an unknown value such as `tpu` was accepted and dropped (`--device "[/bold]"` crashed with a Rich `MarkupError`). They routed all three loads through #1460's `resolve_inference_device_map_and_dtype`, validated `--device` early with exit 2 on every backend, kept an explicit `--kv-cache-type` winning over the helper's dtype, and updated the help and the fragment, including that a CPU-only host now loads float32 (twice the RAM). The new file is 34 passed (19 failed / 15 passed on `main`), 627 passed across 17 related files, and 23 of 24 mutations fail a test; the one survivor (validation gated on the transformers backend, behaviour verified on vLLM and SGLang) is recorded as a follow-up test ([#1478](https://github.com/MakazhanAlpamys/Soup/issues/1478), [#1479](https://github.com/MakazhanAlpamys/Soup/pull/1479))
+ - Fixed #1450: a failed replace deleted the only good copy in two places. `soup reward synth --force` overwrote the existing verifier before calibrating it and deleted the file on refusal; `merge_adapter_to_dense` (behind `soup shrink` and `soup draft distill`) deleted `out_dir` before the swap and then deleted the staged model in its error handler, so neither copy survived. They moved both to a never-destroy-the-last-copy shape: a temp sibling replaced onto `-o` only after calibration accepts it; rename-aside, restore on failure, and when the restore fails as well, keep both copies and name both paths. **The review rounds were about what a test pins:** a Windows-only test that could not fail on their own machine reddened three CI cells, and the fix replaced its either-or assertion with exact bytes at the paths the error names. 11 tests, 11 of 11 mutations killed, 9 failed / 2 passed on `main` ([#1450](https://github.com/MakazhanAlpamys/Soup/issues/1450), [#1454](https://github.com/MakazhanAlpamys/Soup/pull/1454))
- **sup3dev** ([@sup3dev](https://github.com/sup3dev))
- First contribution: `soup` reported any error whose message contained the digits `401` or `403` as "Authentication failed." / "Access denied." and hid the real message. That covered a too-long SFT row 401, a tensor size of 4013, a `checkpoint-4010` path and a hash in a Hub URL. The status is now read from the exception object along its `__cause__`/`__context__` chain, with a text fallback limited to explicit HTTP phrasing, so genuine requests, urllib and huggingface_hub 401/403 errors get the specific hint instead of "HTTP request failed.". **The detail that decided a three-way race for the issue**: `GatedRepoError` and `RepositoryNotFoundError` are declined anywhere in the chain. A missing local adapter directory that peft first looks up on the Hub, which answers an unauthenticated user with 401, therefore keeps its real message; both competing fixes reported "Authentication failed." there. 16 of the 31 new tests fail on `main`, and 21 of 22 mutations fail a test ([#1267](https://github.com/MakazhanAlpamys/Soup/issues/1267), [#1268](https://github.com/MakazhanAlpamys/Soup/pull/1268))