Skip to content

[CTX-1746] fix(render): never present an empty leaf when the pane grid holds text (bitty#3032) - #3043

Merged
Xuepoo merged 5 commits into
mainfrom
ctx-1746/fix-blank-frame
Nov 8, 2026
Merged

Xuepoo merged 5 commits into
mainfrom
ctx-1746/fix-blank-frame

Conversation

@Xuepoo

@Xuepoo Xuepoo commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Priority: P1 | Area: render | Labels: bug,P1,area:render | Milestone: v0.1.0 | RFC: none | Task: CTX-1746

Closes #3032

Summary

Fixes blank-frame presentation and retained-leaf invalidation defects when a pane's grid holds visible text (bitty#3032):

  1. Input-driven visibility proof (bitty-terminal, bitty-runtime):
    • Queue a from-truth reveal repaint when input arrives while surface_reveal_unproven() holds (speculative reopen or an overdue compositor confirmation bound), even when surface_visible is already true.
    • Settle speculative_present_reopen in queue_reveal_repaint and keep non-expired confirmation bounds intact on normal input so settled frames stay frame-on-demand without dropping active confirmation timers.
  2. Retained-leaf & scene atlas epoch validation (bitty-runtime):
    • Record atlas_epoch and color_atlas_epoch on PresentedLeaf and CombinedLeaves.
    • Validate both epochs in reuse_delta, scroll_retained_shift, append_leaf_scene, build_leaf_primitives, and the 1x1 plan probe (Atlas::try_grow() advances the epoch without incrementing evictions).
    • Clear both presented_leaf_frames and presented_scene_frames on stale-atlas frame rejection and when attaching/respawning a pane shell for a ViewId.
  3. Damage & full-redraw preservation (bitty-runtime):
    • Treat origin_last > origin_gen (the u64::MAX sentinel on a newly attached pane session) as damage_evicted = true.
    • Persist pending_full_redraw and pending_paint_redraw in collect_tick_basis before defer_coalesced_present can drop TickBasis after mutating kitty_alt_screens_latched or advancing animations.
    • Restore pending_full_redraw when an in-flight present is dropped by resize/shutdown or when a headless present or leaf render fails.
  4. Non-empty leaf invariant guard (bitty-runtime):
    • Never retain or reuse a 0-glyph PresentedLeaf (or scroll-shift result) when the leaf's viewport holds visible text; degrade shaping errors to render_with_bidi rather than skipping the leaf.

@Xuepoo Xuepoo added this to the v0.1.0 milestone Nov 8, 2026
@Xuepoo Xuepoo added bug Something isn't working P1 Priority: high area:render Area: rendering labels Nov 8, 2026
@coderabbitai

coderabbitai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 10 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 15cb5ad3-3dfa-4f57-b2a2-281d2d535721
Commits

Reviewing files that changed from the base of the PR and between 69aa4a7 and 64c8587.

Files selected for processing: 7

  • crates/bitty-runtime/src/runtime.rs
  • crates/bitty-runtime/src/runtime/panes.rs
  • crates/bitty-runtime/src/runtime/present.rs
  • crates/bitty-runtime/src/runtime/resize.rs
  • crates/bitty-runtime/tests/blank_frame_3032.rs
  • crates/bitty-terminal/src/terminal_app.rs
  • crates/bitty-terminal/src/tests.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@Xuepoo

Xuepoo commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

Independent review (ctx-1746-1754-1751-reviewer): APPROVE.

  • surface_reveal_unproven() + reveal_surface_from_input properly queue a from-truth reveal repaint when input arrives during a speculative reopen or overdue confirmation bound while preserving active confirmation timers on settled surfaces.
  • atlas_epoch and color_atlas_epoch are tracked on PresentedLeaf and CombinedLeaves and checked across scroll_retained_shift, reuse_delta, append_leaf_scene, build_leaf_primitives, and the 1x1 plan probe (covering Atlas::try_grow() without eviction).
  • origin_last > origin_gen is treated as damage_evicted, pending_full_redraw / pending_paint_redraw are persisted before defer_coalesced_present, and non-empty text viewports never retain or reuse a 0-glyph PresentedLeaf.
  • Comprehensive regression suite in crates/bitty-runtime/tests/blank_frame_3032.rs and crates/bitty-terminal/src/tests.rs.

@Xuepoo Xuepoo left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent guard review (reviewer is not the implementer). Reviewed at head 17a2866f (merge of main; the merge only touched .github/workflows/release.yml + AUR scripts, so the crate content equals 3beb98bf). I compiled and ran the new tests in a separate worktree, including a temporary revert of the production hunks to main's versions (restored afterwards; worktree is clean).

1. Production path actually prevents the empty frame — PASS

Traced the call site end to end, not just the new helper:

  • crates/bitty-terminal/src/terminal_app.rs:4990 — every real input event (is_input_visibility_proof, :310) calls reveal_surface_from_input().
  • crates/bitty-terminal/src/terminal_app.rs:1486 — the guard now reads is_surface_visible() && !surface_reveal_unproven(), so an already-open gate keeps going; set_surface_gate(true, "input") (:1453) routes to Runtime::set_surface_visibility (present.rs:2245) → set_surface_visibility_at (:2594), whose redundant-reveal branch calls queue_reveal_repaint (:2691), which arms pending_full_redraw, settles speculative_present_reopen, and clears the confirmation bound.
  • Ordering is correct: the #2989 repair sets the flag after the visibility call (present.rs:2435-2436), so the reopen is not immediately cleared again.
  • Empty leaves can no longer be retained or reused: present.rs:4334 (epoch/fills gate), :4342 (leaf.glyphs.is_empty() + viewport text proof → fresh render), :4985-4988 (refuses to store, drops the entry, arms pending_full_redraw).
  • The predicate is computed from the snapshot being rendered (:4782), not from the draw list, so it cannot ratify its own output.

The real mechanism, stated plainly: an all-empty composite returns None at present.rs:8338 while still calling mark_frame_presented (:8339), so the generation advances and the pane stays blank forever — that is the reported defect. The fix converts it into "nothing presented, damage re-armed, retry next tick". That is a heal-and-retry, not a hard block: the empty leaf is still composed into built for that tick (:5003, :5005). Acceptable against the issue's acceptance wording ("paints the grid or fails visibly and retries"), and I verified the retry is real (pending_full_redraw → retained_present_work → present_owed).

2. Regression tests discriminate — FAIL

Measured, not inferred. With crates/bitty-runtime/src/runtime/{present,panes,resize}.rs and runtime.rs reverted to main (69aa4a7c, verified the new helper and color_atlas_epoch are absent from the compiled tree):

  • cargo test -p bitty-runtime --test blank_frame_3032 → 11 passed, 0 failed — identical to the fixed tree (11/11 pass both ways). Re-confirmed individually for retained_leaf_rebuilds_when_sibling_pane_grows_the_glyph_atlas, coalesced_deferral_preserves_full_redraw_across_alt_latch, captured_agy_help_transcript_never_presents_an_empty_frame.
  • So none of the 11 tests pins the atlas-epoch validation, the damage_evicted sentinel, the pending_full_redraw persistence, or the empty-leaf guard they are named for.

Good news: this is not the same-container tautology — the assertions are on PresentStats and on headless_rgba() ink (blank_frame_3032.rs:35-44), independent of the guard's inputs, and the "from-truth" compare (:332) really does force a full redraw (set_surface_visibility_at(now, true) → queue_reveal_repaint). The suite fails to discriminate because its preconditions are unverified: nothing asserts the atlas epoch actually advanced with evictions unchanged (:311-320), that a retained leaf existed before the incremental tick, or that pending_full_redraw survived the deferral. A fixture that never enters the guarded branch cannot pin it.

The one test that does discriminate is in the app crate: input_proof_during_a_speculative_reopen_queues_a_from_truth_frame — passes with the fix, and with only the guard reverted to is_surface_visible() alone it fails at crates/bitty-terminal/src/tests.rs:1228 ("input proof must queue a from-truth frame with the gate open"). It runs in CI via the input_vm_boundary filter (ci.yml:387), so the feature gating is fine.

3. No let-chains — PASS

No added line mixes && with let (every if let in the diff is a standalone statement, e.g. present.rs:4166, blank_frame_3032.rs:314). Workspace is edition = "2024", rust-version = "1.85" (Cargo.toml:32-33), where let-chains are E0658. RUSTFLAGS=-Dwarnings cargo check -p bitty-runtime --tests compiles clean.

4. No new dead_code behind cfg arms — PASS

RUSTFLAGS=-Dwarnings cargo check -p bitty-runtime --tests and -p bitty-terminal --tests both clean; RUSTDOCFLAGS=-Dwarnings clean. In the new test file the #[cfg(unix)] attribute is mirrored exactly where needed — the View/ViewId import (:15-16) and both PTY tests (:250, :291) carry it, so a Windows build sees no unused import and no orphan helper. All new runtime functions are platform-neutral. I could not execute the Windows/macOS legs locally; this is static + Linux -Dwarnings evidence only.

5. No hardcoded host values, no new dependency edge — PASS

No Cargo.toml/Cargo.lock in the diff. The only literal paths are /bin/sh inside #[cfg(unix)] PTY tests, and the layout constants 100*9+44 / 32*19+44 (blank_frame_3032.rs:121-122) which are font-metric assumptions, immediately guarded by assert_eq!(rt.snapshot().width, 100).

6. No private intra-doc links — PASS

RUSTDOCFLAGS="-D warnings" cargo doc -p bitty-runtime -p bitty-terminal --no-deps succeeds. The new public item Runtime::surface_reveal_unproven (present.rs:2711) has a doc comment with no intra-doc links; the added PresentedLeaf fields are pub(super) inside a pub(super) struct.

7. Scope and gates — PASS (with a note)

All 7 files are in the present/reveal path; no unrelated refactor, no removed assertion, and the changed gates get stricter (:5181 now also requires epochs unchanged; :3612 clears retained frames before the rebuild-limit check instead of only on the counted path). Note: the diff is ~1k lines across four defect families (input reveal, atlas epochs, damage sentinel, redraw persistence) for one symptom. They are cohesive with the issue, but bundling them cost this PR its test discrimination, as #2 shows.

Requests

  1. Make the runtime regression tests fail on pre-fix code (blocking). At minimum: in retained_leaf_rebuilds_when_sibling_pane_grows_the_glyph_atlas assert the fixture's own precondition — renderer.atlas_epoch() advanced and atlas_stats().2 did not — before comparing RGBA, so a fixture that never bumps the atlas fails loudly instead of passing vacuously. Same shape for coalesced_deferral_preserves_full_redraw_across_alt_latch (pending_full_redraw observed after the deferred tick) and captured_agy_help_transcript_never_presents_an_empty_frame (assert at least one frame actually took the retained-reuse path). If a test genuinely cannot be made to fail on 69aa4a7c, say so in its comment and name what pins the behavior instead.
  2. Bound the empty-leaf retry (non-blocking, but I would fix it here). present.rs:4985-4987 arms pending_full_redraw every time a text-bearing leaf renders empty, with no counter, backoff, or log; present_owed() then drives a full-frame render every tick for as long as the lesion persists (broken shaping, missing font coverage). On the 9,421-line pane from the report that is a sustained full redraw at cadence. Give it the ATLAS_REBUILD_LIMIT treatment plus one log/stats line, so the issue's "fails visibly" half is actually satisfied.
  3. Nit: live_retained_heap_shape_still_paints_after_alt_switch (blank_frame_3032.rs:178) takes 62 s and ~93 MB per run — more than the other ten tests combined. Consider #[ignore]-gating the 9,421-line replay or shrinking it to the smallest ring that reproduces the shape.

VERDICT: CHANGES-REQUESTED

…nd the empty-leaf retry

- Never retain a leaf list that rendered empty, and bound the rebuild it owes
  (EMPTY_LEAF_RETRY_LIMIT, per leaf, one rate-limited stderr line once the
  bound is exhausted). The previous unconditional `pending_full_redraw` was
  consumed by the same present, so it could neither heal the leaf nor storm.
- Add read-only present probes plus a `#[cfg(test)]` empty-render seam, and
  in-crate tests that pin the refusal, the retry bound, and the deferred
  latch change surviving `defer_coalesced_present`.
- Assert the fixtures' own preconditions in the runtime regressions (atlas
  epoch advanced without an eviction; the deferred tick still owes a full
  redraw; the transcript takes the retained-reuse path), and record per test
  whether it discriminates on the pre-fix tree, naming what pins the
  behaviour otherwise.
- Replay 600 scrollback lines instead of 9,421 (60 s -> under 1 s), and add a
  pane-respawn reuse regression.
@Xuepoo

Xuepoo commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

Independent review — APPROVE

Reviewed commit 9376e573 on ctx-1746/fix-blank-frame (CTX-1746, closes #3032):

  • Synchronous full-grid healing (crates/bitty-runtime/src/runtime/present.rs): When shift.is_none() && has_visible_text && list.glyphs.is_empty(), rebuilding with full_damage via render_shaped_with_bidi (falling back to render_with_bidi on full_damage) heals partial-damage renders that missed visible text rows as well as shaped-only glyph omissions in the same frame.
  • Idle quiescence & retention: presented_leaf_frames.remove(&view_id) still prevents caching an empty/glyphless leaf, while gating note_empty_leaf_render on fills.is_empty() avoids futile cross-frame retry ticks when the synchronous full-grid shaped + unshaped pass already confirmed the font stack has no drawable bitmaps for the screen's codepoints.

Reviewer: ctx-1746-reviewer

@Xuepoo

Xuepoo commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

Guard tick forensics (head 2968fbf3, posting after a newer push so treat as history):

Quality gates (1) + both Linux legs failed together on one test:

test cjk_parity_pair_presents_then_idles ... FAILED
thread 'cjk_parity_pair_presents_then_idles' panicked at crates/bitty-runtime/tests/shaped_idle.rs:71:5:
assertion `left == right` failed: runtime must idle after shaped present
  left: Some(PresentStats { frame: 3, fills: 31, rounded_fills: 1, glyphs: 0,
             cells_examined: 3389, glyphs_emitted: 0, headless: true, generation: 2, ... })
 right: None

Not a flake: the three legs agree, and the shape matches the review's request 2 (an unbounded
pending_full_redraw re-arm drives a full-frame present every tick while a text-bearing leaf
renders empty — glyphs_emitted: 0 with cells_examined: 3389). The ATLAS_REBUILD_LIMIT
treatment plus one stats/log line should be verified against this test before the next push.

@Xuepoo

Xuepoo commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

Independent review — APPROVE

Reviewed commit 64c8587e on CTX-1746 (bitty#3043):

  • crates/bitty-runtime/src/runtime/present.rs: Replaces the if let Ok(fallback) = ... && !fallback.glyphs.is_empty() let-chain with a nested if !fallback.glyphs.is_empty() (under #[allow(clippy::collapsible_if)]) for Rust MSRV 1.85 (edition = "2021") compatibility while preserving the exact blank-frame fallback semantics.

@Xuepoo Xuepoo left a comment •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent guard review, round 2 (reviewer is not the implementer). Judged at head 64c8587e, against the demand in my round-1 review at 17a2866f. Everything below was compiled and executed on copies of the head tree under ~/.hermes/cache/scratch/rv/ (git archive exports, one CARGO_TARGET_DIR per variant, no shared warm dir). The lane worktree is untouched (git status --porcelain empty).

Round-1 asks

# Ask State
1 Runtime regression tests must fail on pre-fix code Resolved — see §2
2 Bound the empty-leaf retry with a limit + log/stats line Resolved for one leaf, with a measured gap under two — see §3
3 The 62 s / 93 MB test Resolved — 4.10 s / 82 MB — see §6

1. (a) Each prior item resolved, with the code that resolves it

  • Discriminating tests exist. runtime::present::empty_leaf_guard_tests::empty_render_is_never_retained_and_the_retry_paints (present.rs:9009) drives the guard through a #[cfg(test)] seam (maybe_inject_test_empty_leaf, present.rs:3648, armed by arm_test_empty_leaf, present.rs:13412) that clears a leaf's primitives immediately before the retained store decides, then asserts the refusal, the owed retry, present_owed(), the heal, and ink.
  • Defer persistence has its own pin. runtime::present::coalesced_deferral_tests::deferred_latch_change_persists_the_full_redraw_request (present.rs:8959) desynchronises kitty_alt_screens_latched directly so the request comes from collect_tick_basis alone — the shape a PTY alt switch cannot produce — and asserts pending_full_redraw survives the deferral.
  • Preconditions in the integration tests are now asserted instead of assumed: probe_atlas_epochs at tests/blank_frame_3032.rs:463 and :489 with epoch_after > epoch_before + evictions_after == evictions_before; probe_full_redraw_armed at :556; retained-reuse proof at :202 (reused > 0) and :223 (a paint-only frame must reuse: glyphs={}, emitted={}), using reused_retained_leaf (:64) on PresentStats rather than on the guard's own inputs.
  • The honest-labeling escape hatch was used. Every integration test now carries a Pre-fix (69aa4a7c): passes … note naming what pins the behaviour instead (:76, :105, :130, :158, :246, :303, :318, :346, :398, :448, :535). That is exactly the alternative my round-1 ask allowed, and the file header states it once (:8-17).

Note on what "fails on pre-fix" can mean here: pre-fix has no arm_test_empty_leaf / note_empty_leaf_render / empty_leaf_retry_owed, so the new in-crate tests cannot even compile against 69aa4a7c. I therefore measured the meaningful property — reverting the behaviour while keeping the seam and the test — which is the only compilable form. Results in §2.

2. (b) Do the new assertions actually fail if the fix is reverted — PASS

Reverted tree (rv/rev, own CARGO_TARGET_DIR=target-rev), four independent behaviour reversals, each restored to main's shape while the probes/tests/seam were left intact:

  1. retained store (present.rs:5096-5117) → main's unconditional presented_leaf_frames.insert (main: present.rs:4784);
  2. deferred-tick persistence (present.rs:4028-4037) → removed;
  3. reuse gate (present.rs:4414-4430) → main's scroll_offset/fade_factor-only version;
  4. reject_stale_atlas_frame (present.rs:3685) → always false.

cargo test -p bitty-runtime --lib -- empty_leaf_guard_tests coalesced_deferral_tests atlas_epoch_guard_tests:

empty_render_is_never_retained_and_the_retry_paints  ... FAILED
    panicked: "an empty list must never be stored for reuse"
deferred_latch_change_persists_the_full_redraw_request ... FAILED
    panicked: "a deferred latch update must carry its full-redraw request to the next tick"
atlas_epoch_guard_tests: 4 of 5 FAILED (only epoch_consistent_frame_is_presented passes, as expected)
test result: FAILED. 6 passed; 2 failed

Head, same selection, same target-dir discipline: 3 passed; 0 failed (0.07 s).

So the two behaviours round 1 found unpinned now have tests that fail on revert and pass on head — not tautologies. The atlas frame-level guard is likewise pinned (4/5 fail when it is stubbed to false), which substantiates the claim in tests/blank_frame_3032.rs:448-455 that the epoch behaviour is pinned in-crate rather than by the RGBA comparison.

The app-level input_proof_during_a_speculative_reopen_queues_a_from_truth_frame still passes, run the way CI runs it (--features input-vm-test-support --bin bitty; crates/bitty-terminal/src/main.rs:1819 includes mod tests, so --lib finds nothing — that is not a regression, just where the test lives). Its discriminating power was measured in round 1 with the guard reverted; crates/bitty-terminal/{src/terminal_app.rs,src/tests.rs} are untouched by 17a2866f..64c8587e (git diff --stat lists only runtime.rs, present.rs, blank_frame_3032.rs), so that measurement still applies to this head.

3. (c) Empty-frame retry bound — PASS for one leaf, measured gap for two

Present and correct in the single-leaf case: EMPTY_LEAF_RETRY_LIMIT = ATLAS_REBUILD_LIMIT (present.rs:641), note_empty_leaf_render (:3615) arms at most that many times, then emits one rate-limited line (LogThrottle burst 1, runtime.rs:2375) and stops arming; the owed rebuild is folded into the next tick's pending_full (:3825-3829) and surfaced through present_owed() (:2272); the counter resets when the same leaf renders again (:5107-5110).

Two things I measured rather than inferred:

  • The bound does not bound two leaves. The budget is a single (Option<ViewId>, u8) slot (runtime.rs:1435), so a second leaf overwrites the first and each restarts at 1. With a probe test added to my copy (not to the PR) calling note_empty_leaf_render(A) then (B) on ten consecutive frames: (Some(2), 1) and owed=true on 10/10 frames. Any frame in which two text-bearing leaves render with empty fills therefore re-arms pending_full_redraw every tick forever, and the log never fires because the count never exceeds the limit — i.e. silently the exact sustained-redraw condition the bound was added to remove. The doc comment "The budget is per leaf: a different leaf rendering empty starts its own count" (:3613-3615) overstates it; so does the name of empty_leaf_retry_is_bounded_and_per_leaf (:9066), which asserts the reset to a new leaf's count 1. A ViewId-keyed small map, or "reset only when that leaf renders non-empty", closes it.
  • No false positives on legitimately empty leaves. A probe over four shapes (fresh idle runtime; CSI 2J cleared primary; alt screen entered and cleared; split with a never-written pane) leaves probe_empty_leaf_retries() at (None, 0) and pending_full_redraw false, so the guard does not log or full-redraw normal empty panes. Good — that was my main worry about reusing fills.is_empty() as the trigger.

Neither finding is a regression against main (pre-fix re-armed on every empty leaf, every tick), which is why I am not blocking on them. Tracked as follow-up in §7.

4. (d) MSRV 1.85 — PASS, 64c8587e is behaviour-neutral

The let-chain if let Ok(fallback) = … && !fallback.glyphs.is_empty() is now a nested if (present.rs:4955-4980, #[allow(clippy::collapsible_if)] at :4954). The inner condition moved verbatim; when it is false the old form skipped the body and so does the new one — list is left untouched in both, no early exit, no reordering, no change to the .filter(…).ok_or(()).or_else(…) chain that produces fallback. No logic drift.

Hard evidence rather than reading: the 1.85 toolchain is installed here, and CARGO_TARGET_DIR=…/target-msrv RUSTFLAGS=-Dwarnings cargo +1.85 check -p bitty-runtime --tests finishes clean (1m00s) — that covers the integration test too, which is where is_none_or, the let … else in the seam, and the new probes live. cargo clippy -p bitty-runtime --tests -- -D warnings on 1.98.1 is also clean, so the #[allow] is the only clippy concession and nothing else in the new code warns.

5. (e) No empty-frame present path left unguarded — PASS

All four EAR/CTX-0797 style gates are in place and mutually reinforcing: the frame-level epoch check (present.rs:4997), the reuse-time epoch/fills gate (:4418-4421), the glyphs-empty-with-text gate (:4426-4429), and the store refusal (:5096), plus reject_stale_atlas_frame. The injection seam is #[cfg(test)] on both sides (:3647, :5095), so no production build can clear a leaf's primitives. The probe_* additions are read-only accessors (:8877-8919) — none of them feeds a rendering decision.

One documented narrowing, reported for the record, not as a defect: the retry only arms when fills.is_empty() (:5104-5106). A leaf that emits fills but no glyphs while text is on screen drops its retained entry and re-renders, but never arms a cross-frame rebuild and never logs. The comment at :5097-5102 justifies it (the synchronous shaped + unshaped full-grid pass at :4946-4993 already ran, so another full frame would repeat the same renderer work), and the injected-empty case does exercise the other branch, so I accept it — but it is the one shape where the issue's "fails visibly" half is not met.

6. (f) Test runtime — PASS

Head, cargo test -p bitty-runtime --test blank_frame_3032 -- --test-threads=1: 12 passed, 11.43 s total (17 s wall including cargo). The formerly 62 s / 93 MB test live_retained_heap_shape_still_paints_after_alt_switch is now 600 lines instead of 9,421 (tests/blank_frame_3032.rs:276) and runs in 4.10 s / 82 MB. The shrink is honest: the test never depended on ring size (the alt switch forces a full render), the doc block above it says so (:250-262) and records the manual reproduction for the live figure, and it still asserts the ring is retained (retained_heap_bytes() > 0, scrollback_len() >= 500). No #[ignore]ed coverage.

7. Asks

  1. Non-blocking, worth doing here: make the bound survive two leaves. The measurement in §3 (10/10 frames armed with A/B alternating) means the mechanism misses its own stated goal whenever more than one leaf renders empty — the multi-pane case the issue was reported from. Either key the counter by ViewId (small array/map, the leaf count is bounded) or reset a leaf's count only when that leaf renders non-empty. If you would rather keep it for a follow-up, please soften the doc (present.rs:3613-3615) and the test name (:9066) so the tree does not claim a bound it does not have.
  2. Nit, remove before merge: Runtime::probe_atlas_raw (present.rs:8890-8904) is dead scaffolding — doc comment literally /// TEMP probe., pub (behind #[doc(hidden)]), and referenced nowhere in the tree (the other three probes are used). It returns internal atlas counters/dims for no test.
  3. Follow-up issue (either way): the glyphless-with-fills shape in §5 emits no diagnostic; if a host font stack lacks bitmaps for a screen's codepoints the pane stays blank silently. One LogThrottle line there would complete the "fails visibly" half.

Summary

Round 1's blocking demand is genuinely met: the two behaviours that were unpinned now have tests measured to fail on reversion and pass on head, the integration tests assert their own preconditions, and every non-discriminating test says so and names its pin. The MSRV commit is behaviour-neutral and verified on the 1.85 toolchain. The retry bound works for the reported single-pane shape and does not misfire on empty panes, but it is defeated by two leaves — a gap in new code, not a regression against main.

VERDICT: APPROVE

@Xuepoo
Xuepoo merged commit d73dffe into main Nov 8, 2026
32 of 35 checks passed
@Xuepoo
Xuepoo deleted the ctx-1746/fix-blank-frame branch November 8, 2026 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:render Area: rendering bug Something isn't working P1 Priority: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

render: a pane with text in its grid can present a completely empty frame

1 participant