Skip to content

Fix late layout completion regressing durable shell state - #29

Merged
ElSargo merged 1 commit into
mainfrom
fix/layout-completion-no-regress
Sep 16, 2026
Merged

ElSargo merged 1 commit into
mainfrom
fix/layout-completion-no-regress

Conversation

@ElSargo

@ElSargo ElSargo commented Sep 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • On completed/degraded, always retire the pending entry, but install durable_shell_layout only when request_id >= committed_shell_layout_request.
  • Advance presented_layout_revision with max so a late older completion cannot rewind it.
  • Remit Layout completions can move durable state backward in docs/frictions/ui-concurrency.md.
  • Add late_older_layout_completion_must_not_regress_durable_or_presented_revision.

Fixes #26

Test plan

  • cd plugins/session-switcher && RUSTFLAGS='-C linker=cc' cargo test --lib — 45 passed (includes new reverse-order completion regression)
  • Manual: rapid native resize / divider drag / shell toggles; confirm late older layout replies do not hide/show stale sidebar/inbox/picker chrome

@ElSargo ElSargo left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Brood QA review

Checked: diff/view; CI run 35150209800 was IN_PROGRESS at review start (sibling failures are ENOSPC); friction/layout section + Fixes #26; audit alignment with ui-concurrency layout race.

Code: Correct remittance. On completed/degraded: always retire pending entry; install durable_shell_layout / bump presented_layout_revision only when request_id >= committed_shell_layout_request; presented revision uses max (monotonic). Orphan completions also never lower presented. Regression test late_older_layout_completion_must_not_regress_durable_or_presented_revision exercises reverse-order completion. Author: 45 lib tests locally.

CI: Was in progress; expect same runner ENOSPC class until disk relief / re-run. Treat green CI as merge gate, not as a code fail.

Race-doc: Layout durable-state friction remitted accurately.

Desktop verify: Blocked (no nix/client build on QA box). Manual rapid resize/divider still useful post-build.

Residual / merge: Stacks with #21/#32 on plugins/session-switcher/src/lib.rs and shared friction doc — coordinate merge order. No logic objection from code review.

— Brood QA

@ElSargo ElSargo left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Brood QA — APPROVE

Fixes #26 cleanly: late older layout completed/degraded can no longer regress durable_shell_layout or rewind presented_layout_revision.

What looks right

  • High-water committed_shell_layout_request is the correct multi-inflight analog of the session-completion pending gate (exact match on a single slot does not fit overlapping layout txs).
  • Pending is always retired; durable install + presented advance only when request_id >= committed; presented is monotonic via max.
  • Orphan completions cannot lower presented.
  • Friction remittance matches the code; late_older_layout_completion_must_not_regress_durable_or_presented_revision locks the reverse-order race from the hunt/#26 sketch.

Verification

  • Local: cd plugins/session-switcher && RUSTFLAGS='-C linker=cc' cargo test --lib → 45 passed (including the new regression).
  • CI run failed with runner ENOSPC while unpacking neovim — infra disk, not this diff (same pattern on sibling PRs).

Nits (non-blocking)

  • Optional: explicit degraded / orphan-path cases.
  • Pre-existing: PaneCreated clears layout without resetting layout request watermarks; IDs remain monotonic so this gate stays consistent.

Desktop not required for this reducer race. No code changes requested.

Gate durable_shell_layout and presented_layout_revision on the highest
committed layout request_id, keep presented revision monotonic, and remit
the ui-concurrency friction. Adds a reverse-order completion regression test.

Fixes #26
@ElSargo
ElSargo force-pushed the fix/layout-completion-no-regress branch from b389d52 to 313fbae Compare September 16, 2026 21:45
@ElSargo
ElSargo merged commit 2c6a975 into main Sep 16, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

session-switcher: late layout completion can regress durable_shell_layout and presented revision

1 participant