Back to Plate

Benchmark compare rows must prove the legacy surface exists

docs/solutions/workflow-issues/2026-04-15-benchmark-compare-rows-must-prove-the-legacy-surface-exists.md

53.0.62.4 KB
Original Source

Benchmark compare rows must prove the legacy surface exists

Problem

The browser huge-document history compare row looked like ordinary benchmark debt. It was not. Legacy Slate’s huge-document example was never a history-backed surface, so the row had no valid comparison target to recover.

Symptoms

  • pnpm bench:replacement:huge-document:history:local failed on #huge-document-undo
  • legacy huge-document exposed no undo / redo controls
  • deeper inspection showed legacy huge-document was created with withReact(...) only, not withHistory(...)

What Didn't Work

  • Treating the failure like normal harness plumbing.
  • Assuming “missing button” meant the compare lane only needed a UI patch.

That was the wrong level. The legacy surface itself did not implement the behavior.

Solution

Hard cut the fake row instead of carrying it as future debt.

  • removed bench:replacement:huge-document:history:local from package.json
  • deleted huge-document-history.mjs
  • rewrote live perf docs so pnpm bench:history:compare:local is the only honest owner for history compare truth

Fresh surviving owner rerun:

  • typing undo 20.27ms
  • typing redo 17.7ms
  • fragment undo 31.77ms
  • fragment redo 29.11ms

Why This Works

It removes a structurally invalid benchmark instead of pretending it has a repair path.

If the legacy surface never exposed the behavior, there is nothing to compare. Keeping that row around only pollutes the perf story and invites more bad benchmark work.

Prevention

  • Before carrying a compare row as debt, verify the legacy target actually exposes the behavior being measured.
  • Check both UI surface and model shape. Missing controls may be the symptom, not the root cause.
  • If the legacy target is not the same feature class at all, cut the row. Do not invent a new legacy surface just to save a benchmark name.
  • Keep one honest owner for each perf claim. For history compare here, that is the headless lane, not a fake browser row.