const uint64_t Nblocks = argc > 2 ? strtoull(argv[2], nullptr, 10) : 4096;
const uint64_t MaxLen = argc > 3 ? strtoull(argv[3], nullptr, 10) : 64;
const unsigned seed = argc > 4 ? strtoul(argv[4], nullptr, 10) : 1;
+ const uint64_t PerType = argc > 5 ? strtoull(argv[5], nullptr, 10) : 100;
+ const uint64_t TotalMax = argc > 6 ? strtoull(argv[6], nullptr, 10) : PerType;
const uint64_t BS = 4096;
PlanSearchInputs in;
BeesRewritePolicy policy;
policy.ref_cost = 53;
policy.extent_cost = 53;
- // Default op limits (100 each) stay as-is — the realistic gate.
+ // Op limits configurable to probe collapse-on vs collapse-off scaling:
+ // PerType applied to dedupe/copy/hole; TotalMax to total.
+ // collapse is ON iff dedupe_max >= total_max && copy_max >= total_max.
+ policy.m_dedupe_max = PerType;
+ policy.m_copy_max = PerType;
+ policy.m_hole_max = PerType;
+ policy.m_total_max = TotalMax;
+ const bool collapse = PerType >= TotalMax;
const auto t0 = chrono::steady_clock::now();
const auto res = scan_next_plan_shortest_path(in, policy);
const auto t1 = chrono::steady_clock::now();
const double ms = chrono::duration<double, milli>(t1 - t0).count();
- printf("M=%zu Nblocks=%llu MaxLen=%llu -> %8.1f ms %s "
+ printf("M=%zu Nblocks=%llu MaxLen=%llu per=%llu total=%llu %s -> %9.1f ms %s "
"debt=%.0f dedupes=%zu copies=%zu\n",
M, static_cast<unsigned long long>(Nblocks),
- static_cast<unsigned long long>(MaxLen), ms,
+ static_cast<unsigned long long>(MaxLen),
+ static_cast<unsigned long long>(PerType),
+ static_cast<unsigned long long>(TotalMax),
+ collapse ? "collapseON " : "collapseOFF", ms,
res ? "ok " : "nullopt",
res ? res->m_debt : 0.0,
res ? res->m_selected_matches.size() : static_cast<size_t>(0),