From 5f8eeed69efcad6ee566ebd9bf0cde7f37a9857a Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Fri, 13 Nov 2026 15:45:43 +0100 Subject: [PATCH] :paperclip: Require no share of changes from kinds only grid worlds offer The coverage control requires each kind to supply 0.5% of a program set's changes. Grid cell and grid direction steps exist only in grid worlds, a share of the programs, so with 50 programs a seed with few grid worlds left them under the share, and the swap and library programs failed on random seeds. These kinds must still change state, but need no share of the changes. Harness only; the benchmark is not run. AI-assisted-by: claude-opus-5-5 --- .../src/app/common/test_helpers/composable/gen.cljc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/common/src/app/common/test_helpers/composable/gen.cljc b/common/src/app/common/test_helpers/composable/gen.cljc index d38ecf95f8..b5f4224a56 100644 --- a/common/src/app/common/test_helpers/composable/gen.cljc +++ b/common/src/app/common/test_helpers/composable/gen.cljc @@ -1415,10 +1415,16 @@ (throw error) :else true))))) +(def ^:private world-dependent-kinds + "Kinds that only grid worlds offer, a share of the programs: they must + change state, but need no share of the changes." + #{:grid-cell :grid-direction}) + (defn coverage-errors "Coverage comes only from random steps. Stable syncs count as checks; mutations must change state and each required kind must supply at least - 0.5% of meaningful changes. Setup, skips and no-ops cannot satisfy it." + 0.5% of meaningful changes, but those only some worlds offer. Setup, + skips and no-ops cannot satisfy it." ([coverage kinds] (coverage-errors coverage kinds #{:sync :library-sync})) ([coverage kinds checks] (let [random (:random coverage) @@ -1431,7 +1437,8 @@ (when (if (contains? checks kind) (zero? (+ changed no-op)) (or (zero? changed) - (< changed (* 0.005 total-changed)))) + (and (not (contains? world-dependent-kinds kind)) + (< changed (* 0.005 total-changed))))) {:kind kind :reason :insufficient-random-coverage :counts (get random kind)})))) kinds)