Repository navigation
mac: consume display-list-v2-window — the Mac side of FT-070's page window - #665
Merged
Merged
Conversation
…indow #294 (merged, `7e6ed07f`) negotiates `display-list-v2-window` and serves a bounded resident page window, which is what gives a long document a reply at all. No in-tree consumer sent it. This is that consumer, as a pure addition: nothing is removed, no v1 code is touched, and an unwindowed reply stays byte-for-byte what it is today. Protocol (FlashTeXProtocol): * `CompileRequest.displayListWindow` -> `display_list_window {first_page, page_count}`, omitted from the wire when nil. * `RenderingV2.Window` for the reply's top-level `window` object, and `Page.resident`. Per proposal §4 the flag is asymmetric: an elided page carries `"resident": false` and NO `items` key, a resident page carries neither marker — which is what keeps every unwindowed line's bytes, and so every `dl2-canon-1` page digest, unchanged. * Both decoders (fast reader and JSONDecoder) read it and refuse the same malformed shapes; `validate` checks the window range against the document and that residency matches the window exactly, and refuses a non-resident page that has no window object to belong to. Consumer (V2PageWindow.swift): * The window is engaged ON DEMAND, never by default — an unwindowed reply is complete (delta base, export authority) and a windowed one is an incomplete view (§4.1). It engages only after the producer says the unwindowed reply cannot exist: the over-the-reply-limit `status: failed`, or a `display_list_declined` diagnostic. The same buffers are then re-requested under a window at the viewer, a new id at the same revision. * Once engaged, the pane's scroll anchor drives it: leaving the served window's comfortable interior (margin 4 of 16 pages, with document edges exempt) re-requests anchored at the viewer. A positioned request that comes back without the echoed capability disengages, so a producer that cannot window is never asked again on every scroll. * §7 composition: `-window` rides with `-only` and suppresses `-delta` (r1 makes them mutually exclusive — a windowed producer cannot digest pages it has not materialised), and a windowed frame is never installed as a delta base. * §4.1 exclusions: a windowed frame refuses both PDF exports and the parity evidence hook rather than writing blank pages as evidence. * Elided pages paint a geometry-only placeholder, so the document keeps its full scroll extent (scrolling toward one is what fetches it) with no bitmap, hover or navigation machinery. Verified against the MERGED producer, not a hand-written approximation: `flashtex-render` built from this tree answers a `{first_page: 3, page_count: 4}` request over a 30-page document with `status: ok`, zero v1 pages (`-only`), a 12-page-shaped sibling whose elided entries carry exactly `{number, width, height, resident: false}` and whose resident entries carry no `resident` key at all. `display-list-v2-window.json` is one such reply committed verbatim, and `testRealProducerWindowedLineDecodesAndPaints` decodes it on both decoder paths. Tests: V2WindowTests (wire shape both decoders, the refusals, the controller's engage/re-anchor/disengage state machine, failure classification, the real producer's bytes, and the two §4.1 exclusions) plus a live pair through fake_worker_v2.py's new `%v2window` directive — an over-limit failure engaging the window, the 40-page/16-resident frame, a scroll that moves it to a clamped {25, 16}, and a producer without the capability disengaging instead of looping. Mac gate on an idle machine: 1355 tests, 0 failures, 12 skipped. Implementation-Agent: claude-fable-5 (mac window-consumer lane) Commit-Executor: claude-fable-5 direct Git (observed Cursor usage limit) Co-authored-by: GoKubar <[email protected]>
GoKubar
added a commit
that referenced
this pull request
Sep 15, 2026
This was referenced Sep 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Producer-side #294 (merged,
7e6ed07f) negotiatesdisplay-list-v2-windowand serves a bounded resident page window — the mechanism that gives a long document a reply at all. No in-tree consumer sent it. This is that consumer.Pure addition. Nothing is removed, no v1 code is touched, and an unwindowed reply stays byte-for-byte what it is today — so this is safe to merge before any v1 removal.
Why the window is engaged on demand, not by default
An unwindowed reply is a complete compile: it can be a delta base and the source of a PDF export. A windowed reply is explicitly an incomplete view (proposal §4.1). Making it the default would trade those properties away on every document, including the ones that never needed a window.
So the shell asks for one only after the producer has said the unwindowed reply cannot exist:
status: failedwith the over-the-reply-limit diagnostic (protocol.rs), ordisplay_list_declineddiagnostic — the reply survived but the v2 sibling did not.Then the same buffers are re-requested under a window anchored at the viewer (a new id at the same revision, exactly like a capability switch).
Scroll drives it
Once engaged, the pane's scroll anchor moves the window. Leaving the served window's comfortable interior — margin 4 of 16 pages, with document edges exempt so page 1 and the last page never thrash — re-requests anchored at the viewer. A positioned request that comes back without the echoed capability disengages, so a producer that cannot window is never asked again on every scroll.
Protocol
CompileRequest.displayListWindow→display_list_window {first_page, page_count}, omitted when nilRenderingV2.Window(top-levelwindow) andPage.residentPer §4 the residency flag is asymmetric: an elided page carries
"resident": falseand noitemskey; a resident page carries neither marker. That asymmetry is what keeps every unwindowed line's bytes — and so everydl2-canon-1page digest and every committed fixture digest — unchanged.Both decoders (the fast reader and
JSONDecoder) read it and refuse the same malformed shapes.validatechecks the window range against the document, that residency matches the window exactly, and refuses a non-resident page that has no window object to belong to.Composition and exclusions
-windowrides with-only(both are needed for a long document to be repliable at all) and suppresses-delta— r1 makes them mutually exclusive, since a windowed producer cannot digest pages it has not materialised.Verified against the merged producer
Not a hand-written approximation of the wire —
flashtex-renderbuilt from this tree, answering a real{first_page: 3, page_count: 4}request over a 30-page document:Fixtures/display-list-v2-window.jsonis one such reply committed verbatim;testRealProducerWindowedLineDecodesAndPaintsdecodes it on both decoder paths.Tests
V2WindowTests— wire shape on both decoders, the refusals, the controller's engage/re-anchor/disengage state machine, failure classification, the real producer's bytes, and the two §4.1 exclusions. Plus a live pair throughfake_worker_v2.py's new%v2windowdirective: an over-limit failure engaging the window, the 40-page/16-resident frame, a scroll that moves it to a clamped{25, 16}, and a producer without the capability disengaging instead of looping.Mac gate on an idle machine: 1355 tests, 0 failures, 12 skipped.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu