Repository navigation
[CTX-1869] fix(runtime,render): enforce watchdog Release/Acquire ordering and clip Block border to allocation - #3217
Conversation
…ring and clip Block border to allocation Refs #3215
|
Warning Review limit reachedYou'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 54 minutes. View limit details
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. |
Xuepoo
left a comment
There was a problem hiding this comment.
Independent review verdict, recorded in carryctx as PX-8726 (task CTX-1869) by a reviewer
agent separate from the implementer. Posted here by the guard tick so branch protection sees
the approval on the reviewed head.
Reviewed head: 690067224ec6f17a072626a3d8da56950f30a776 (= headRefOid, un-moved at post time).
Verdict text (verbatim from PX-8726, created 2026-11-17T08:26:25Z):
Review verdict: APPROVE on commit 6900672 (CTX-1869 /
Issue #3215). Verified all PX-8723 NEEDS-FIX items resolved in stall_watchdog.rs:
Shared::markstoreslast_beat_nsfirst then Release-storesphase,active,
publish_gap_msseam, andprogress;monitor_loopAcquire-loadsprogress(init and
take_advance),phase(SIGUSR1 and main sample),active(main sample andidle_park),
StallWatchdog::{enter,idle}Acquire-loadactive,build_reportAcquire-loadsprogress;
enter_after_long_idle_emits_no_spurious_report_in_publish_gapnon-tautologically verifies
the publish-gap seam. Verifiedscene.rspaint_borderallocation clipping plus
scene_style_paint.rsandlua_ui_style_height.rstests remain intact. Gates passed after
deleting temp target: fmt, scratch-paths, clippy-D warnings(4 crates), stall_watchdog
(78/78), bitty-render (all targets + doctest passed, incl. scene_style_paint 29/29),
bitty-runtime lua_ui_style_height (15/15) and scene_style_vocabulary (6/6).
Guard spot-check of the two claims the verdict rests on (gh pr diff 3217):
crates/bitty-terminal/src/stall_watchdog.rs—mark()now orders
last_beat_ns(Relaxed) ->phase(Release) ->active(Release) ->
progress(fetch_add, Release), and every monitor-side read that feedsidle_for()or
build_reportupgraded toAcquire(progressat init and in the poll,
phase/activebeforeidle_for(), bothSIGUSR1and the main sample). The
happens-before chain the comment claims is present in the code.crates/bitty-render/src/scene.rs—paint_borderderives
clip = aligned ∩ allocated(cell_rect(x, y, available.cols, available.rows)) and
intersects every emitted segment withclip(notalignedalone), so a height/width-capped
Blockframe cannot paint into a sibling cell. New guards cover both axes
(a_capped_bordered_block_never_paints_its_border_into_a_column_sibling,
..._into_a_row_sibling).
CI on this head: fails=0, pending=0, pass=18, skip=3 (VM-tier legs conditional).
Note for follow-up (not blocking): the new regression test is sleep-based (650 ms idle, 250 ms
publish gap, 600 ms threshold) — the same class as the watchdog timing tests that have raced on
macOS before; it is green on all legs here, but a future 0 Hz-parking change should re-check it.
VERDICT: APPROVE
Xuepoo
left a comment
There was a problem hiding this comment.
Independent local CarryCtx re-review (ctx-1869-rereviewer, PX-8726) verified commit 690067224ec6f17a072626a3d8da56950f30a776:
- Resolved all round-1
NEEDS-FIX(PX-8723) findings incrates/bitty-terminal/src/stall_watchdog.rs(elapsed_ns()/last_beat_nsstored strictly beforeReleasestores onphase/active/progress; pairedAcquireloads inmonitor_loop,StallWatchdog::{enter,idle}, andbuild_report; addedenter_after_long_idle_emits_no_spurious_report_in_publish_gap). crates/bitty-render/src/scene.rs(Painter::paint_border) clips all cell-border segments toaligned ∩ allocatedwith regression tests inscene_style_paint.rsandlua_ui_style_height.rs.- All local verification suites passed (
fmt,check-scratch-paths.sh,clippy -D warnings,stall_watchdog78/78,bitty-render,lua_ui_style_height15/15,scene_style_vocabulary6/6) and all 18 remote GitHub Actions CI/CodeQL checks succeeded.
VERDICT: APPROVE
Priority: P1 | Area: runtime | Labels: fix, P1, area:runtime | Milestone: v0.1.0 | Task: CTX-1869
Closes #3215
Summary
Follow-up hardening for #3211 (#3213) and #2191 (#3212):
crates/bitty-terminal/src/stall_watchdog.rs: Computeelapsed_ns()and storelast_beat_nsstrictly before storingphase(Release),active(Release), keeping thepublish_gap_mstest seam intact, and incrementingprogress(Release). Use pairedOrdering::Acquireloads onprogress,phase, andactivebeforeidle_for()inmonitor_loop(includingSIGUSR1&idle_parkpaths),StallWatchdog::{enter,idle}, andbuild_report. Added regression testenter_after_long_idle_emits_no_spurious_report_in_publish_gap.crates/bitty-render/src/scene.rs: Intersect cell-border segments inPainter::paint_borderwith both the surfacealignedrect and the childallocatedrect (cell_rect(x, y, available.cols, available.rows)) so height/width-cappedBlockframes never paint border strokes into sibling cells.crates/bitty-render/tests/scene_style_paint.rsandcrates/bitty-runtime/tests/lua_ui_style_height.rs(plus strengthenedRowsibling position check).Review & Local Verification
PX-8723(NEEDS-FIXcaughtlast_beat_ns/activeordering) -> fixed inPX-8724(69006722) -> independent re-reviewPX-8726(APPROVE).69006722:cargo fmt --all -- --check,./scripts/check-scratch-paths.sh,RUSTFLAGS="-D warnings" cargo clippy -p bitty-render -p bitty-runtime -p bitty-lua -p bitty-terminal --all-targets --locked,stall_watchdog(78/78),bitty-render(all suites),lua_ui_style_height(15/15), andscene_style_vocabulary(6/6).