Skip to content

Make prepared software presentation atomic - #111

Merged
conxlgtm merged 10 commits into
mainfrom
transactional-core/atomic-software-presentation
Jul 27, 2026
Merged

conxlgtm merged 10 commits into
mainfrom
transactional-core/atomic-software-presentation

Conversation

@conxlgtm

Copy link
Copy Markdown
Owner

Summary

  • Make asynchronously prepared software frames latest-wins transactions with typed presentation outcomes.
  • Revalidate redraw identity, configure state, geometry, and reservation ownership immediately before commit, without emitting Wayland requests for rejected attempts.
  • Stage throwing commit work before shared-memory buffers become busy, then execute callback, feedback, attach, damage, commit, and bookkeeping without throwing.
  • Apply the same precommit staging boundary to popup software draws and external-buffer presentation so rejected attempts cannot emit frame or feedback requests and committed frames cannot be reported as failed.
  • Preserve redraw progress after cancellation, supersession, and precommit failures, and prevent wrapped redraw generations from revalidating stale work.
  • Expose atomic presentation feedback on simple software draws and verify forwarding request recording through public-only live tests.

Why

  • Preparation can suspend while a newer redraw, configure, close, or cancellation makes the original frame stale.
  • Rejected or failed presentations must not partially emit a surface transaction or strand dirty content without a replacement redraw.
  • Shared-memory ownership becomes irreversible when a buffer is marked busy, so every recoverable failure must occur before that point.
  • External-buffer callback and feedback requests are likewise irreversible protocol work, so copied model state and result validation must succeed first.

Validation

  • nix develop -c env CC=clang CXX=clang++ swift run wck test unit --verbose
  • nix develop -c env CC=clang CXX=clang++ swift run wck smoke headless -- wck test request-paths
  • nix develop -c env CC=clang CXX=clang++ swift run wck smoke headless -- wck test integration-public-api --verbose
  • Focused transaction and request-recorder TSan: 70 tests in 6 suites passed with no sanitizer diagnostics.
  • Final popup, external-buffer, model, and feedback changed-path TSan: 33 tests in 4 suites passed with no sanitizer diagnostics.
  • nix develop -c env CC=clang CXX=clang++ swift run wck ci cheap --verbose
  • nix develop -c env CC=clang CXX=clang++ swift run wck ci required --verbose
  • nix develop -c env CC=clang CXX=clang++ swift run wck protocols verify-generated
  • nix develop -c env CC=clang CXX=clang++ swift run wck api verify
  • nix develop -c env CC=clang CXX=clang++ swift run wck docc verify
  • Serialized final-tree full-project TSan completed all 1,987 tests but exited nonzero with five warnings, all rooted in unchanged EventBroker.swift; no warning referenced a changed presentation or request-recorder path.

conxlgtm added 10 commits July 26, 2026 18:46
Validate software frame reservations again at commit time and stage all fallible submit work before making buffers busy. Preserve one replacement redraw and expose typed presentation outcomes for async preparation.
Transition failed software presentations through the uncommitted-frame redraw repair before rethrowing. Cover the live request path so failures preserve one redraw without sending a surface transaction.
Pair wrapped redraw generations with an exhaustion-checked content identity and validate both before prepared software frames commit. Preserve existing numeric wrap semantics while preventing full-cycle ABA acceptance.
Reserve callback state and stage recoverable work before marking shared-memory buffers busy. Then request callback and feedback, apply preflighted state, attach damage, and commit without throwing while retaining recoverable rollback behavior for external buffers.
Protect forwarding hooks and captured snapshots with one mutex. Prove that a forwarded feedback request reaches Wayland and that ending recording restores the default hook.
Provide show and redraw overloads that return presentation outcomes without requiring a no-op preparation closure. Record the symbols, compatibility behavior, and external usage in the public API baselines and documentation.
Declare the testing-only presentation request recorder mutex in the unsafe-token allowlist, matching the existing core and desktop recorder entries.
@conxlgtm
conxlgtm merged commit 2da8bc8 into main Jul 27, 2026
10 checks passed
@conxlgtm
conxlgtm deleted the transactional-core/atomic-software-presentation branch July 27, 2026 03:24
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.

1 participant