]> git.hungrycats.org Git - bees/commitdiff
config-v2: default rewrite.ref-op-cost to 53
authorZygo Blaxell <bees@furryterror.org>
Sun, 11 Oct 2026 01:09:06 +0000 (21:09 -0400)
committerZygo Blaxell <bees@furryterror.org>
Sun, 11 Oct 2026 01:09:06 +0000 (21:09 -0400)
Version 2 defaults prefer-canonical-src to yes, which is only safe with a
non-zero ref-op-cost: the tie-break concentrates references onto canonical
extents, and ref-op-cost is the term that prices moving them.  With
ref-op-cost = 0, a references corpus run did about 70 times the
reference-redirect work of a build without the tie-break (56.7M vs 804K
redirects).

Use 53, the same weight as ref-cost and extent-cost: one rewritten
reference costs about one extent item.  Version 1 keeps 0.

Assisted-by: Claude-Code:claude-opus-5-5
docs/config-file.md
src/bees-config-v2.cc

index c9b0ef73766d3b156fbd780daed63c0a6e852777..5a17bd041e660914a5d15548de89264dd12b23ca 100644 (file)
@@ -424,8 +424,8 @@ removed.
   single extent, biasing the planner against dedupes that move a large
   reference cluster for little physical gain — a brake on the reference-cluster
   growth that low reference limits can otherwise cause.
-  * Default: `0` (disabled — the term contributes nothing, so the cost model is
-    unchanged until an operator opts in).
+  * Default: `53`, the same as `ref-cost` (config version 1 and `v0.11`: `0`,
+    which disables the term).
   * Accepts a [size value](config-format.md#size-values).
 
 * **`snapshot-sharing`**
index 0241605a8501ab649f8795c78a043335fad8d650..61f3557d182ca564ae8175e6d80cbbd4481014b6 100644 (file)
@@ -125,6 +125,10 @@ static const char bees_config_v2[] = R"--v2-config--(
         # Percentage with %, or a size value (e.g. 128K, 1M - 4K).
         free-min = 128K
 
+        # Space-debt weight per reference a plan rewrites.  Prices the
+        # reference movement that prefer-canonical-src drives.
+        ref-op-cost = 53
+
 # The [resolve] section controls how bees maps physical addresses back to
 # the files that reference them.