Withdraw the Moves::clear item from the thirteenth sweep

Bryan asked what that arena was and whether keeping its capacity had a
point. It does not: Moves::clear runs only when the root changes, beside a
rebuild of the whole tree, where RequestArena::reset runs every frame and
the allocation rig checks it. Arena also holds an IdTracker a clear has to
reset. The parallel was drawn on the shape of the code rather than on how
often it runs.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
iris-aiandClaude Opus 5 committed 2026-09-20 22:47:15 -04:00
1 parent e397680a19
commit ea66fc3f71
2 files changed
+13 -7

No files matched your search

+4 -3
View File
@@ -80,9 +80,10 @@ generator still grows pixels, because `deferred_generated.rs` already varies
that dimension and growing fractions here would move every box in the cold that dimension and growing fractions here would move every box in the cold
dump; the comment says that instead of describing an open defect. dump; the comment says that instead of describing an open defect.
`docs/LAYOUT_LOG.md` has all seven, with the five things the sweep looked at `docs/LAYOUT_LOG.md` has all seven, with the four things the sweep looked
and left. Verified: format, clippy both ways, 208 and 212 tests, and the at and left and the one it withdrew. Verified: format, clippy both ways,
cold dump byte-identical to `f48e04e` across all 34,986 boxes. 208 and 212 tests, and the cold dump byte-identical to `f48e04e` across all
34,986 boxes.
## A quality sweep of the request arena is submitted on PR #19 ## A quality sweep of the request arena is submitted on PR #19
+9 -4
View File
@@ -63,7 +63,7 @@ all sixteen cases agree warm against cold with every bound a fraction
corpus and growing fractions here would move every box in the cold dump for corpus and growing fractions here would move every box in the cold dump for
overlap; the comment now says that rather than describing an open defect. overlap; the comment now says that rather than describing an open defect.
Five things the sweep **looked at and left**: Four things the sweep **looked at and left**, and one it withdrew:
- **`independent_order` compares two lengths by `leftover` where their pixels - **`independent_order` compares two lengths by `leftover` where their pixels
and fractions are equal**, which is only sound while a leftover resolves at and fractions are equal**, which is only sound while a leftover resolves at
@@ -82,9 +82,14 @@ Five things the sweep **looked at and left**:
preferred length, the mirror of the defect fixed above. Left because preferred length, the mirror of the defect fixed above. Left because
nothing asks for it yet and the preferred length has no remover either; the nothing asks for it yet and the preferred length has no remover either; the
asymmetry is uniform. asymmetry is uniform.
- **`Moves::clear` replaces its arena rather than clearing it**, throwing away - **`Moves::clear` replaces its arena rather than clearing it.** Raised as
capacity where `RequestArena::reset` deliberately keeps it. Left: it runs the shape `RequestArena::reset` deliberately avoids, and withdrawn: that
only on a full redraw, and `Arena` has no `clear`. one keeps its capacity because it runs every frame and the allocation rig
checks the steady state allocates nothing, where `Moves::clear` runs only
when the root changes, next to a rebuild of the whole tree that re-grows it
anyway. `Arena` also holds an `IdTracker` that a clear has to reset, which
`Arena::default()` says in one line. Frequency is what separates the two,
and the code looks the same either way.
- **`TextEditCtx::apply_event` reads `if undo && let Some(..)` with an `else - **`TextEditCtx::apply_event` reads `if undo && let Some(..)` with an `else
if` after it**, so an undo with an empty history now falls into the branch if` after it**, so an undo with an empty history now falls into the branch
that pushes history. It is equivalent only because an undo command does not that pushes history. It is equivalent only because an undo command does not