Skip to content

refactor(mac): split Magnifier.step into tick phases (#1) - #593

Merged
Maxaubert merged 2 commits into
mainfrom
refactor/mac-step-phases
Nov 18, 2026
Merged

Maxaubert merged 2 commits into
mainfrom
refactor/mac-step-phases

Conversation

@Maxaubert

Copy link
Copy Markdown
Owner

Part of #579 (audit #1). Plan: research/wind/2026-11-18-audit-refactor-plan.md, PR 9, part A only.

Magnifier.step(_:) is now a short driver over private phases: beginTick, writeLevelFirst, readPointer, endSessionAt1x, startSessionIfNeeded, readRawAndHoldBack, detectLock, resolveOwner, computeTarget, commitView, finishTick. A TickCtx struct carries the tick's locals. Moved lines are byte-identical; only the early returns (return nil / return true) and the prevRaw defer (now in the driver right after readRawAndHoldBack) changed form. The .mouse case moves whole (part B, splitting it, is deferred). Docs: a tick-phase section in mac/docs/architecture.md and a line in mac/CLAUDE.md.

Draft until the Mac checks run. Not compiled locally (no Swift on the PC, Mac unreachable over SSH). mac.yml compiles it and runs wind-checks. Still owed on the Mac: a logLevel=2 before/after diff of the view/wcur lines, the e2e and *_truth scripts, and scripts/build.sh install. Opus review: no behaviour change found.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Kg7JN6ZPh3N5p9541yz3Bv

@Maxaubert Maxaubert mentioned this pull request Nov 18, 2026
7 of 8 tasks
Maxaubert and others added 2 commits November 18, 2026 21:39
Part of #579 (#1, part A). step(_:) now calls beginTick, writeLevelFirst,
readPointer, endSessionAt1x, startSessionIfNeeded, readRawAndHoldBack,
detectLock, resolveOwner, computeTarget, commitView and finishTick, with a
private TickCtx carrying the tick's locals. Every moved line is unchanged
and in the same order; the .mouse case moves whole. The prevRawMotion /
prevRawStep defer stays in the driver after readRawAndHoldBack, so it runs
on every exit as before. No behaviour change. Docs: tick-phase map in
mac/docs/architecture.md and a gotcha in mac/CLAUDE.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kg7JN6ZPh3N5p9541yz3Bv
After the rebase onto #596: its bare return in step() moved into endSessionAt1x, which returns Bool.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kg7JN6ZPh3N5p9541yz3Bv
@Maxaubert
Maxaubert force-pushed the refactor/mac-step-phases branch from 8caccc8 to 4f53946 Compare November 18, 2026 20:40
@Maxaubert
Maxaubert marked this pull request as ready for review November 18, 2026 21:22
@Maxaubert
Maxaubert merged commit dc9f603 into main Nov 18, 2026
1 check passed
@Maxaubert
Maxaubert deleted the refactor/mac-step-phases branch November 18, 2026 21:22
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