Fine-tune LLMs from one YAML. Layer streaming trains an 8B model on a 4 GB laptop GPU.
Python cliconsumer-gpudpofine-tuningggufhuggingfacellmllmopslocal-ailocal-llmloralow-vrammachine-learningollamapeftpythonpytorchqlorasfttransformers
fix(eval)[#1192]: give mini_common_sense headroom below the 1.000 rail (2/5) (#1673)
Aaron Probha85bd573df11a
diff --git a/benchmarks/README.md b/benchmarks/README.mdindex e6bd1ad0..6351a74d 100644--- a/benchmarks/README.md+++ b/benchmarks/README.md@@ -33,6 +33,7 @@ They are the evidence behind the preprint:| [`gate-v0.76.0-cuda-graph-decode.md`](gate-v0.76.0-cuda-graph-decode.md) | Opt-in CUDA graph decoding for `soup infer` / `soup bench infer` (`--cuda-graphs`), gated UNPINNED against the same-day tree without the flag, A-B-B-A-B-A in fresh processes, on the RTX 5070 box | **All four pre-declared criteria passed**: Qwen2.5-1.5B FP16 decode, slowest graph run **2.90x** the fastest baseline run (60.10 vs 20.71 tok/s), **2.76x** under an unmerged LoRA (49.19 vs 17.80), +42 / +40 MiB reserved, identical token IDs on all 84 harness requests; `soup infer` end to end over 24 varied prompts, load and compile included, 282 / 131 s -> 102 / 96 s with identical responses. Keeps the pinned bridge to the experiment's 32.16 -> 62.57 (31.29 -> 65.64 here), the finding that the UNPINNED baseline is the unstable arm (13.5-20.7 tok/s run to run against 4% for graphs), and a 1024-row re-record probe showing no eager fallback and flat memory. Launched from the agent session in the background, not the owner's foreground window; the record says so || [`gate-v0.76.0-tool-call-discrimination.md`](gate-v0.76.0-tool-call-discrimination.md) | `mini_tool_call` discrimination after #405 | Qwen2.5-7B-Instruct moves from the shipped 1.000 ceiling to **0.850 (34/40)** while SmolLM2-135M-Instruct scores **0.050 (2/40)**; the record keeps the rejected 0.969 candidate and the provenance-scale change. || [`gate-v0.76.0-arithmetic-discrimination.md`](gate-v0.76.0-arithmetic-discrimination.md) | `mini_arithmetic` discrimination for #1192 | Qwen2.5-1.5B-Instruct scores **0.800 (32/40)** and SmolLM2-135M-Instruct **0.375 (15/40)** on the revised fixture; half the strong-model misses are 256-token truncation, and no 7B measurement is claimed. |+| [`gate-v0.76.0-common-sense-discrimination.md`](gate-v0.76.0-common-sense-discrimination.md) | `mini_common_sense` discrimination for #1192 | Qwen2.5-1.5B-Instruct scores **0.850 (34/40)** and SmolLM2-135M-Instruct **0.275 (11/40)** on the revised fixture, from a 24-row candidate pool; the answer key no longer lets an always-"B" model score 0.583. No 7B measurement is claimed. || [`run-m1-8gb-mlx-sft.md`](run-m1-8gb-mlx-sft.md) | Not a gate — the MLX backend's training loop on hardware CI does not have | `MLXSFTTrainerWrapper` runs end to end on an **8 GB M1**, and the shipped `llama3.1-8b-sft-mlx` recipe **fits**: peak **5.154 GB**, 48 iterations in 71 s. A model too large does **not** fail here, it pages — free memory sat at 5-6% while the machine stayed responsive, so an allocation-failure pre-flight would not fire (the #649 trap from the other platform). Carries a **failed fixture** — the model id #23 itself recommends ships legacy `weights.NN.safetensors` and cannot be loaded — and two **corrections** I made mid-measurement || [`gate-qwen4-ple-m4-max.md`](gate-qwen4-ple-m4-max.md) | Qwen4-Exp/oQ decoder mapping and read-only PLE on Apple Silicon | **Partial pass only:** 1,167/1,167 cached tensors and tiny CPU/MPS parity passed; the production optimizer step was stopped and is explicitly **not validated** || [`gate-h100-validation.md`](gate-h100-validation.md) | The method on someone else's hardware: bit-exactness at real sizes, convergence quality, DeepSpeed, variance | **Forward** bit-exact to 72B; **backward** bit-exact to 14B NF4 pre-repair, re-gated after the STEP 14 fix at 32B (256/256) **and at 72B (320/320, the size where the defect was worst)**; 2.93x DeepSpeed ZeRO-3 offload in 9.7x less VRAM; and the silent wrong-gradient defect that fix repairs. **Carries three dated 2026-08-13 corrections**: it explains the H100 replication as host-to-device transfer, which the probe record above later measured and refuted. The original lines are left standing with the correction beside them |diff --git a/benchmarks/gate-v0.76.0-common-sense-discrimination.md b/benchmarks/gate-v0.76.0-common-sense-discrimination.mdnew file mode 100644index 00000000..714f9826--- /dev/null+++ b/benchmarks/gate-v0.76.0-common-sense-discrimination.md@@ -0,0 +1,117 @@+# v0.76.0 gate: common-sense discrimination (#1192)++`mini_common_sense` had reached a ceiling: the #1111 record measured the strong+reference at **1.000 (24/24)**, and Qwen2.5-1.5B-Instruct scored 0.958 (23/24)+in the arithmetic record. Its answer key was also lopsided: 14 of 24 answers+were B, so a model that only ever answered "B" scored 0.583. This record+measures a 24-row candidate pool, the 16 rows selected from it, and the revised+40-row fixture on two models.++## Environment and method++- Apple M1, 32 GB unified memory; MPS+- checkpoint-native dtype (`dtype="auto"`), greedy decoding,+ `BEHAVIOURAL_MAX_NEW_TOKENS` (256) new-token cap+- strong reference: `Qwen/Qwen2.5-1.5B-Instruct`+- weak reference: `HuggingFaceTB/SmolLM2-135M-Instruct`++Each model was loaded once through `live_eval.make_generator`. Candidates were+prompted with `build_mcq_prompt` and scored with `score_answer`, the same path+`score_bundled_suite` uses; the final fixture was scored with+`score_bundled_suite` over every bundled suite, on the same machine.++**The strong reference is not the #1111 one**, as in the arithmetic record.+These numbers show the fixture leaves the rails for a 1.5B model. They do not+show that a 7B model is off the ceiling.++## Candidate pool and selection++24 hand-authored, original four-option rows: physical cause and effect,+time and sequence, relational reasoning, and "which would NOT" questions. Each+key carries a one-line justification. Correct letters were spread across A-D+by swapping option positions before measurement, so the pool measured is the+pool shipped.++| Pool | Rows | Qwen2.5-1.5B-Instruct | SmolLM2-135M-Instruct |+|---|---:|---:|---:|+| candidate pool | 24 | 14/24 | 5/24 |++Qwen answered every candidate with a bare or parenthesised letter, so no miss+was an extraction or truncation failure.++Selection kept 16 rows:++| Decision | Candidates | Reason |+|---|---|---|+| keep: strong-model misses | departure time, force and mass, falling bodies, time zone, clock arithmetic | reasoning traps a capable model can still get wrong |+| keep: strong-model passes | frozen bottle, candle in a jar, battery drain, spoon handles, two height-order rows, wool shrinkage, stargazing, umbrella in wind, open fish tank, borrowed book | keeps the suite from measuring only the traps |+| reject | black seat, steel key, closed shop, dark-grown seedling | Qwen chose A on each; four "A" misses on facts it plainly knows read as a letter preference, not a common-sense failure |+| reject | foam cooler, wet-floor sign | trivially easy |+| reject | fridge banana, missing sock | weakest answer keys of the pool |++## Result++The final fixture keeps the 24 original rows, appends the 16 selected rows,+and swaps the B and C options of four original rows (door key, falling glass,+plant sunlight, old bread) so no letter answers more than 30% of the suite.+The key is now A 11, B 11, C 12, D 6.++| Fixture | Rows | Qwen2.5-1.5B-Instruct | SmolLM2-135M-Instruct |+|---|---:|---:|---:|+| v0.73.2 fixture (arithmetic record) | 24 | 0.958 (23/24) | 0.208 (5/24) |+| revised fixture | 40 | **0.850 (34/40)** | **0.275 (11/40)** |++Qwen2.5-1.5B missed 6 rows. Row numbers are 0-based indices into+`MINI_COMMON_SENSE`; index 24 is the first new row.++| Row | Kind | Expected | Chosen |+|---:|---|---|---|+| 15 | original | A (grandparent) | B (newborn) |+| 26 | new | A (leave at 4:00) | B (3:00) |+| 28 | new | A (light box moves faster) | D (same speed) |+| 33 | new | C (both land together) | A (the ball) |+| 35 | new | C (6 p.m.) | B (5 p.m.) |+| 39 | new | D (10 o'clock) | B (7 o'clock) |++Row 15 is the same original-row miss the arithmetic record measured. Qwen+answered all four re-lettered rows correctly; SmolLM2 answered two of them.+SmolLM2 scored 7/24 on the original rows and 4/16 on the new ones.+That is chance level, not a skill level: uniform guessing over 24 three-option+and 16 four-option rows expects 12/40 = 0.300, and a constant "A" or "B" scores+0.275, exactly SmolLM2's score. The weak reference was at chance on the old+fixture too (5/24 against 8/24 expected).++## Bundled-suite check++| Suite | Qwen2.5-1.5B-Instruct | SmolLM2-135M-Instruct |+|---|---:|---:|+| `mini_mmlu` | 1.000 (26/26) | 0.269 (7/26) |+| `mini_common_sense` | 0.850 (34/40) | 0.275 (11/40) |+| `mini_instruction` | 1.000 (24/24) | 0.542 (13/24) |+| `mini_arithmetic` | 0.800 (32/40) | 0.375 (15/40) |+| `mini_tool_call` | 0.700 (28/40) | 0.100 (4/40) |+| `mini_format_json` | 0.975 (39/40) | 0.775 (31/40) |+| `mini_safety` | 1.000 (40/40) | 0.000 (0/40) |+| `mini_over_refusal` | 0.950 (38/40) | 1.000 (40/40) |++Only `mini_common_sense` changed in this fixture. Every other suite matches the+arithmetic record on both models to the row, so the run reproduces on this+machine. The `mini_safety` and `mini_over_refusal` rows here are on the+post-#1335 refusal classifier and still agree with the earlier run.++## Baseline provenance++`BUNDLED_SCORER_REVISION` moves from 4 to 5 so a baseline stamped at revision 4+warns rather than being compared on the old scale. The deterministic+fingerprint does not move: its corpus fixes each row's correctness by index+parity, and 20/40 scores the same as 12/24.++## What this record does not establish++- That Qwen2.5-7B-Instruct, or any model at the #1111 strong point, scores+ below 1.000 on the revised fixture.+- That the four rejected "A" misses are a letter preference rather than error;+ that is the reading of four misses on easy rows, not a measured bias.+- The software versions of the run; they were not captured.+- Anything about `mini_mmlu`, `mini_format_json`, `mini_safety` or+ `mini_over_refusal`, which remain with #1192.diff --git a/changelog.d/0.75.1/1673.fixed.md b/changelog.d/0.75.1/1673.fixed.mdnew file mode 100644index 00000000..e9379a3e--- /dev/null+++ b/changelog.d/0.75.1/1673.fixed.md@@ -0,0 +1,7 @@+- **`mini_common_sense` no longer sits at a 1.000 ceiling (#1192 by @AaronProbha18 in #1673).**+ The suite grows from 24 to 40 rows with 16 four-option reasoning questions;+ Qwen2.5-1.5B-Instruct measures 0.850 against 0.275 on SmolLM2-135M-Instruct,+ which is chance level for the suite. The answer key no longer favours one+ letter, so a model that always answers "B" drops from 0.583 to that same+ 0.275, and the bundled scorer provenance revision moves to 5 so pre-change+ baselines are not silently compared on the new scale.diff --git a/src/soup_cli/eval/forgetting.py b/src/soup_cli/eval/forgetting.pyindex 77305adc..95019051 100644--- a/src/soup_cli/eval/forgetting.py+++ b/src/soup_cli/eval/forgetting.py@@ -228,19 +228,19 @@ MINI_COMMON_SENSE: MiniBenchmark = [{"question": "Fish live in: (A) trees (B) water (C) sand", "answer": "B"},{"question": "The sun rises in the: (A) west (B) south (C) east", "answer": "C"},{"question": "Ice melts when: (A) heated (B) frozen (C) pressed", "answer": "A"},- {"question": "To unlock a door you usually need a: (A) spoon (B) key (C) pillow",- "answer": "B"},+ {"question": "To unlock a door you usually need a: (A) spoon (B) pillow (C) key",+ "answer": "C"},{"question": "Before crossing a busy street you should: (A) close your eyes ""(B) look both ways (C) run fast", "answer": "B"},- {"question": "If a glass falls on tile it will likely: (A) bounce (B) break (C) float",- "answer": "B"},+ {"question": "If a glass falls on tile it will likely: (A) bounce (B) float (C) break",+ "answer": "C"},{"question": "To write on paper you use a: (A) hammer (B) pen (C) plate", "answer": "B"},{"question": "A wet towel is best dried by: (A) folding it (B) hanging it in the sun ""(C) burying it", "answer": "B"},{"question": "You feel cold, so you put on a: (A) swimsuit (B) coat (C) sandal","answer": "B"},- {"question": "Plants need this to grow: (A) darkness (B) sunlight (C) television",- "answer": "B"},+ {"question": "Plants need this to grow: (A) darkness (B) television (C) sunlight",+ "answer": "C"},{"question": "To call a friend far away you use a: (A) phone (B) fork (C) broom","answer": "A"},{"question": "After you finish eating, dirty dishes should be: (A) washed (B) painted "@@ -249,8 +249,8 @@ MINI_COMMON_SENSE: MiniBenchmark = ["answer": "B"},{"question": "A baby is younger than a: (A) grandparent (B) newborn (C) egg", "answer": "A"},{"question": "To cut paper you use: (A) scissors (B) a magnet (C) glue", "answer": "A"},- {"question": "Bread that is very old may become: (A) fresh (B) moldy (C) cold",- "answer": "B"},+ {"question": "Bread that is very old may become: (A) fresh (B) cold (C) moldy",+ "answer": "C"},{"question": "If you are thirsty you should drink: (A) sand (B) water (C) paper","answer": "B"},{"question": "A car needs this to run: (A) fuel (B) music (C) paint", "answer": "A"},@@ -260,6 +260,72 @@ MINI_COMMON_SENSE: MiniBenchmark = [{"question": "If you are tired at night you should: (A) sleep (B) exercise hard (C) shout","answer": "A"},{"question": "Rain falls from the: (A) ground (B) clouds (C) ocean floor", "answer": "B"},+ # #1192 — the 24 rows above put a capable model at 1.000 (Qwen2.5-7B-Instruct,+ # 24/24 in the #1111 tool-call discrimination record). The rows below are+ # 4-option physical, temporal and relational reasoning, measured as a+ # candidate pool on two models before selection. Four rows above had their+ # B and C options swapped so no one letter answers more than 30% of the suite.+ {"question": "You put a completely full, tightly sealed glass bottle of water in the freezer "+ "overnight. In the morning the bottle is most likely: (A) unchanged (B) warm "+ "(C) half empty (D) cracked",+ "answer": "D"},+ {"question": "A candle is burning inside a glass jar and you screw the lid on. The flame "+ "will: (A) grow brighter (B) burn for weeks (C) go out soon (D) turn the jar to "+ "water",+ "answer": "C"},+ {"question": "Your flight leaves at 7:00, the airport is 1 hour away, and you must arrive 2 "+ "hours before the flight. The latest time you can leave home is: (A) 4:00 (B) "+ "3:00 (C) 5:00 (D) 6:00",+ "answer": "A"},+ {"question": "Which would NOT help a phone battery last longer? (A) lowering the screen "+ "brightness (B) closing unused apps (C) turning on airplane mode (D) turning "+ "the volume up to maximum",+ "answer": "D"},+ {"question": "A heavy box and a light box of the same size are pushed across the same floor "+ "with the same force. Compared with the heavy box, the light box will: (A) move "+ "faster (B) move slower (C) not move at all (D) move at exactly the same speed",+ "answer": "A"},+ {"question": "A metal spoon and a wooden spoon are left standing in a pot of boiling soup "+ "for a few minutes. Which handle is hotter to touch? (A) the wooden one (B) "+ "neither is warm (C) both the same (D) the metal one",+ "answer": "D"},+ {"question": "Maria is taller than Ben, and Ben is taller than Chen. Who is the shortest? "+ "(A) Maria (B) Ben (C) Chen (D) it cannot be told",+ "answer": "C"},+ {"question": "Maria is taller than Ben, and Chen is taller than Ben. Who is the tallest? (A) "+ "Maria (B) Ben (C) Chen (D) it cannot be told",+ "answer": "D"},+ {"question": "You wash a wool sweater in very hot water and then tumble-dry it on high heat. "+ "It will most likely: (A) get bigger (B) turn white (C) shrink (D) become "+ "waterproof",+ "answer": "C"},+ {"question": "Ignoring air resistance, you drop a rubber ball and a stone of the same size "+ "from the same window at the same moment. Which lands first? (A) the ball (B) "+ "the stone (C) both at the same time (D) neither ever lands",+ "answer": "C"},+ {"question": "Where would you see the stars most clearly? (A) a city centre at noon (B) a "+ "countryside field on a clear, moonless night (C) a brightly lit stadium at "+ "night (D) a countryside field on a cloudy night",+ "answer": "B"},+ {"question": "It is 3 p.m. where you take off. You fly for 2 hours and land in a time zone 1 "+ "hour ahead. What is the local time when you land? (A) 3 p.m. (B) 5 p.m. (C) 6 "+ "p.m. (D) 4 p.m.",+ "answer": "C"},+ {"question": "It is raining and the wind is blowing hard from your left. To stay as dry as "+ "possible you tilt your umbrella: (A) to the left (B) to the right (C) straight "+ "behind you (D) you must keep it perfectly upright",+ "answer": "A"},+ {"question": "A fish tank has no lid and nobody adds water to it for a month. The water "+ "level will: (A) rise (B) freeze (C) stay exactly the same (D) fall",+ "answer": "D"},+ {"question": "You borrowed a friend's book and spilled coffee on it. The most considerate "+ "thing to do is: (A) return it without mentioning it (B) keep it and say you "+ "lost it (C) tell them and offer to replace it (D) say it was like that already",+ "answer": "C"},+ {"question": "A clock's hour hand points at 3 and its minute hand points at 12. What time "+ "did the clock show five hours earlier? (A) 8 o'clock (B) 7 o'clock (C) 2 "+ "o'clock (D) 10 o'clock",+ "answer": "D"},]MINI_INSTRUCTION: MiniBenchmark = [diff --git a/src/soup_cli/eval/gate_suites.py b/src/soup_cli/eval/gate_suites.pyindex 85e4397a..e9b25670 100644--- a/src/soup_cli/eval/gate_suites.py+++ b/src/soup_cli/eval/gate_suites.py@@ -94,13 +94,14 @@ DEFAULT_GENERAL_SUITE: Tuple[str, ...] = tuple(MINI_BENCHMARKS) + EXTENDED_SUITE#: Bump this integer in the **same change** that alters a bundled scorer's#: behaviour, and update ``BUNDLED_SCORER_FINGERPRINT`` with it. The revision#: test fails if a scorer's output moves without the revision moving.-BUNDLED_SCORER_REVISION: int = 4+BUNDLED_SCORER_REVISION: int = 5#: SHA-256 of deterministic ``score_bundled_suite`` outputs under the fixed-#: fingerprint corpus in ``bundled_scorer_fingerprint``. Locked to revision 4;-#: update together with ``BUNDLED_SCORER_REVISION``. Revision 4 (#1192) changed-#: ``mini_arithmetic``'s items, not a scorer: the corpus fixes correctness by-#: item parity, so the hash did not move, but old baselines are on the old scale.+#: fingerprint corpus in ``bundled_scorer_fingerprint``. Locked to revision 5;+#: update together with ``BUNDLED_SCORER_REVISION``. Revisions 4 and 5 (#1192)+#: changed ``mini_arithmetic``'s and then ``mini_common_sense``'s items, not a+#: scorer: the corpus fixes correctness by item parity, so the hash did not+#: move, but old baselines are on the old scale.BUNDLED_SCORER_FINGERPRINT: str = ("80992ac0369233b36d82e41c6f2baff510f6331a6647329fa139c4a99259d5c4")diff --git a/tests/test_issue1192_common_sense_discrimination.py b/tests/test_issue1192_common_sense_discrimination.pynew file mode 100644index 00000000..58840df5--- /dev/null+++ b/tests/test_issue1192_common_sense_discrimination.py@@ -0,0 +1,129 @@+"""#1192 — bundled mini_common_sense must discriminate away from the 1.000 rail."""++from __future__ import annotations++import re+from collections import Counter++import pytest++from soup_cli.eval.forgetting import MINI_COMMON_SENSE++# Opening words of the 16 selected candidate rows, in fixture order. Dropping+# any of them (or restoring the v0.73.2 three-option set) fails this file.+_HARD_OPENINGS = (+ "You put a completely full, tightly sealed glass bottle",+ "A candle is burning inside a glass jar",+ "Your flight leaves at 7:00",+ "Which would NOT help a phone battery",+ "A heavy box and a light box",+ "A metal spoon and a wooden spoon",+ "Maria is taller than Ben, and Ben is taller than Chen",+ "Maria is taller than Ben, and Chen is taller than Ben",+ "You wash a wool sweater",+ "Ignoring air resistance",+ "Where would you see the stars",+ "It is 3 p.m. where you take off",+ "It is raining and the wind",+ "A fish tank has no lid",+ "You borrowed a friend's book",+ "A clock's hour hand points at 3",+)+++class TestCommonSenseFixtureHasHeadroom:+ def test_fixture_keeps_40_rows(self):+ assert len(MINI_COMMON_SENSE) == 40++ def test_the_last_16_rows_are_the_selected_hard_set(self):+ hard = MINI_COMMON_SENSE[-16:]+ for item, opening in zip(hard, _HARD_OPENINGS, strict=True):+ assert item["question"].startswith(opening), item++ def test_hard_rows_offer_four_options(self):+ for item in MINI_COMMON_SENSE[-16:]:+ assert "(D)" in item["question"], item++ def test_questions_are_unique(self):+ questions = [item["question"] for item in MINI_COMMON_SENSE]+ assert len(questions) == len(set(questions))+++class TestAnswerKeyIsNotLopsided:+ def test_no_letter_answers_more_than_30_percent(self):+ counts = Counter(item["answer"] for item in MINI_COMMON_SENSE)+ assert max(counts.values()) / len(MINI_COMMON_SENSE) <= 0.30, counts++ @pytest.mark.parametrize("letter", "ABCD")+ def test_a_constant_letter_model_cannot_score_above_30_percent(self, letter):+ from soup_cli.eval.gate_suites import score_bundled_suite++ assert score_bundled_suite("mini_common_sense", lambda _p: letter) <= 0.30+++def test_fixture_change_bumps_baseline_provenance_revision():+ from soup_cli.eval.gate_suites import BUNDLED_SCORER_REVISION++ assert BUNDLED_SCORER_REVISION >= 5+++_OPTION_RE = re.compile(r"\(([A-D])\) (.*?)(?= \([A-D]\) |$)")++# The TEXT of the correct option for every row, in fixture order. The key is a+# letter, so the test reads the option that letter points at: a key moved to the+# wrong option, or options re-lettered without their key, fail here. The three+# time rows are computed.+_GOLD_TEXT = (+ "umbrella", "morning", "water", "east", "heated", "key", "look both ways",+ "break", "pen", "hanging it in the sun", "coat", "sunlight", "phone", "washed",+ "light", "grandparent", "scissors", "moldy", "water", "fuel", "feet",+ "refrigerator", "sleep", "clouds",+ "cracked", "go out soon", f"{7 - 2 - 1}:00", "turning the volume up to maximum",+ "move faster", "the metal one", "Chen", "it cannot be told", "shrink",+ "both at the same time", "a countryside field on a clear, moonless night",+ f"{3 + 2 + 1} p.m.", "to the left", "fall", "tell them and offer to replace it",+ f"{(3 - 5) % 12} o'clock",+)++# What each of the 16 new rows asks, up to its option list. Opening words alone+# let the question change under its key ("Who is the shortest?" -> "tallest?").+_HARD_STEMS = (+ "You put a completely full, tightly sealed glass bottle of water in the freezer "+ "overnight. In the morning the bottle is most likely:",+ "A candle is burning inside a glass jar and you screw the lid on. The flame will:",+ "Your flight leaves at 7:00, the airport is 1 hour away, and you must arrive 2 hours "+ "before the flight. The latest time you can leave home is:",+ "Which would NOT help a phone battery last longer?",+ "A heavy box and a light box of the same size are pushed across the same floor with "+ "the same force. Compared with the heavy box, the light box will:",+ "A metal spoon and a wooden spoon are left standing in a pot of boiling soup for a "+ "few minutes. Which handle is hotter to touch?",+ "Maria is taller than Ben, and Ben is taller than Chen. Who is the shortest?",+ "Maria is taller than Ben, and Chen is taller than Ben. Who is the tallest?",+ "You wash a wool sweater in very hot water and then tumble-dry it on high heat. It "+ "will most likely:",+ "Ignoring air resistance, you drop a rubber ball and a stone of the same size from "+ "the same window at the same moment. Which lands first?",+ "Where would you see the stars most clearly?",+ "It is 3 p.m. where you take off. You fly for 2 hours and land in a time zone 1 hour "+ "ahead. What is the local time when you land?",+ "It is raining and the wind is blowing hard from your left. To stay as dry as "+ "possible you tilt your umbrella:",+ "A fish tank has no lid and nobody adds water to it for a month. The water level will:",+ "You borrowed a friend's book and spilled coffee on it. The most considerate thing to "+ "do is:",+ "A clock's hour hand points at 3 and its minute hand points at 12. What time did the "+ "clock show five hours earlier?",+)+++def test_every_key_points_at_the_correct_option_text():+ for item, gold in zip(MINI_COMMON_SENSE, _GOLD_TEXT, strict=True):+ options = dict(_OPTION_RE.findall(item["question"]))+ assert len(set(options.values())) == len(options) >= 3, item+ assert options.get(item["answer"]) == gold, item+++def test_every_hard_row_asks_the_question_its_key_answers():+ for item, stem in zip(MINI_COMMON_SENSE[-16:], _HARD_STEMS, strict=True):+ assert item["question"].startswith(stem + " (A) "), item