Repository navigation
chore(lane): daily maintenance 2026-11-11 - #148
Merged
Merged
Conversation
Filed by the fix lane. Fixes #127 `TreeMap::remove_range(start, end)` with `end` before `start` re-seeked the cursor from the tree's first item (`Cursor::seek` resets), so the suffix from `end` was appended after the slice up to `start` and every key in between was duplicated. Per the owner decision on #127, a reversed range is empty: the cursor now only seeks forward when `end` is at or past its position, otherwise the map stays as it was, with no panic. Non-reversed ranges take the same path as before (`seek_forward` from the slice end lands where a fresh `seek` did). The only callers are the crate's own tests; nothing outside `moon-sum-tree` calls `remove_range`. Test: `remove_range_with_end_before_start_leaves_the_map_unchanged` in `crates/moon-sum-tree/tests/tree_map.rs` failed before (left `[0, 1, 2, 1, 2, 3, 4]`, right `[0, 1, 2, 3, 4]`) and passes now. Re-run: `cargo test -p moon-sum-tree --test tree_map remove_range`. Reviewed by Codex: no concrete defects found.
Filed by the fix lane. Fixes #129 When a GPU canvas's prepare_text() failed, the fallback in Window::frame_gpu_canvases checked cached_env() instead of reusable_env(), so a cached text frame holding polychrome (emoji/image) sprites was replayed even though Window::drop_image may have freed those atlas tiles. The fallback now applies the same rule as the reuse path; cached_env() is left test-only since nothing else calls it. The issue's code path and recommended fix were confirmed against current master as written. Test: window::tests::err_never_replays_polychrome_text (crates/moon-gpui/src/window/tests.rs) failed before (a polychrome sprite reached the scene after the failed prepare: left 1, right 0) and passes now. Re-run: cargo test -p moon-gpui --lib err_never_replays_polychrome_text Reviewed by Codex.
…ot present What was stale: GPU_CANVAS_TEXT_API.md said every UI redraw prepares the text of all canvases and that prepare_text() runs only for a frame that will actually be shown. Since #146, Window::frame_gpu_canvases prepares no canvas text at all while PlatformWindow::can_present() is false, even on a UI redraw, and Window::present keeps needs_present armed when the backend rejects the present (e.g. DXGI reports the window occluded). What the code does now: while the window cannot present, no canvas runs prepare_text(); the owed frame stays owed, and the first tick that can present again passes that debt as force_present, so text_action prepares every canvas's text. Invariants 2 and 3 and the upgrade checklist now say so. How verified: read Window::frame_gpu_canvases (`presentable && gpu_canvas_prepare_text(..)`), the frame callback, Window::present (`needs_present.set(!accepted)`), text_action in window/gpu_canvas_text.rs, DirectXRenderer::present, and the regression test deferred_present_skips_text_while_unpresentable_and_finishes_on_restore. Reviewer: Codex. It confirmed the added sentences and pointed out that the existing "a frame that will actually be shown" overstated the guarantee, since the backend can still reject the present; that sentence now says so. No issue opened.
Input: a public builder that ignores its argument and says so in a
whole-line comment:
pub fn tone(self, _tone: MoonTone) -> Self {
// `_tone` is accepted for API parity and ignored for now.
self
}
Wrong output: function_body_uses_param returned true (the comment line
contains `_tone`), so scan_noop_markers did not count the builder and
noop_public_api_markers stayed flat; the audit passed on a builder that
leaves the component unchanged.
Expected output: false, i.e. the builder is counted. Source: the
scan's own contract ("builder methods that accept parameters but leave
the component unchanged") - a comment changes nothing - and the comment
rule the raw-hex scans in the same file already apply (a trimmed line
starting with `//` is skipped).
Test: function_body_usage_ignores_line_comments_naming_the_param in
xtask/src/component_audit/source_metrics/tests.rs failed before with
`assertion failed: !function_body_uses_param(&unused, 0, "_tone")` and
passes now. Re-run: cargo test -p xtask function_body_usage
cargo xtask component-audit --check-baseline still passes (no builder
newly counted).
Reviewer: Codex (PASS, no objections).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix
Filed by the fix lane.
Fixes #127
TreeMap::remove_range(start, end)withendbeforestartre-seeked thecursor from the tree's first item (
Cursor::seekresets), so the suffix fromendwas appended after the slice up tostartand every key in between wasduplicated. Per the owner decision on #127, a reversed range is empty: the
cursor now only seeks forward when
endis at or past its position, otherwisethe map stays as it was, with no panic. Non-reversed ranges take the same path
as before (
seek_forwardfrom the slice end lands where a freshseekdid).The only callers are the crate's own tests; nothing outside
moon-sum-treecalls
remove_range.Test:
remove_range_with_end_before_start_leaves_the_map_unchangedincrates/moon-sum-tree/tests/tree_map.rsfailed before (left[0, 1, 2, 1, 2, 3, 4], right[0, 1, 2, 3, 4]) and passes now.Re-run:
cargo test -p moon-sum-tree --test tree_map remove_range.Reviewed by Codex: no concrete defects found.
Filed by the fix lane.
Fixes #129
When a GPU canvas's prepare_text() failed, the fallback in
Window::frame_gpu_canvases checked cached_env() instead of reusable_env(),
so a cached text frame holding polychrome (emoji/image) sprites was
replayed even though Window::drop_image may have freed those atlas tiles.
The fallback now applies the same rule as the reuse path; cached_env() is
left test-only since nothing else calls it. The issue's code path and
recommended fix were confirmed against current master as written.
Test: window::tests::err_never_replays_polychrome_text
(crates/moon-gpui/src/window/tests.rs) failed before (a polychrome sprite
reached the scene after the failed prepare: left 1, right 0) and passes now.
Re-run: cargo test -p moon-gpui --lib err_never_replays_polychrome_text
Reviewed by Codex.
Docs
What was stale: GPU_CANVAS_TEXT_API.md said every UI redraw prepares the
text of all canvases and that prepare_text() runs only for a frame that
will actually be shown. Since #146, Window::frame_gpu_canvases prepares no
canvas text at all while PlatformWindow::can_present() is false, even on a
UI redraw, and Window::present keeps needs_present armed when the backend
rejects the present (e.g. DXGI reports the window occluded).
What the code does now: while the window cannot present, no canvas runs
prepare_text(); the owed frame stays owed, and the first tick that can
present again passes that debt as force_present, so text_action prepares
every canvas's text. Invariants 2 and 3 and the upgrade checklist now say so.
How verified: read Window::frame_gpu_canvases (
presentable && gpu_canvas_prepare_text(..)), the frame callback, Window::present(
needs_present.set(!accepted)), text_action in window/gpu_canvas_text.rs,DirectXRenderer::present, and the regression test
deferred_present_skips_text_while_unpresentable_and_finishes_on_restore.
Reviewer: Codex. It confirmed the added sentences and pointed out that the
existing "a frame that will actually be shown" overstated the guarantee,
since the backend can still reject the present; that sentence now says so.
No issue opened.
Hunt
Input: a public builder that ignores its argument and says so in a
whole-line comment:
Wrong output: function_body_uses_param returned true (the comment line
contains
_tone), so scan_noop_markers did not count the builder andnoop_public_api_markers stayed flat; the audit passed on a builder that
leaves the component unchanged.
Expected output: false, i.e. the builder is counted. Source: the
scan's own contract ("builder methods that accept parameters but leave
the component unchanged") - a comment changes nothing - and the comment
rule the raw-hex scans in the same file already apply (a trimmed line
starting with
//is skipped).Test: function_body_usage_ignores_line_comments_naming_the_param in
xtask/src/component_audit/source_metrics/tests.rs failed before with
assertion failed: !function_body_uses_param(&unused, 0, "_tone")andpasses now. Re-run: cargo test -p xtask function_body_usage
cargo xtask component-audit --check-baseline still passes (no builder
newly counted).
Reviewer: Codex (PASS, no objections).
Leftovers: quiet (no open lane pull requests).
Trusted pull requests: quiet (none open).