Repository navigation
Spec 018 T005: held pages in the render service, behind RENDER_REUSE - #957
Merged
Merged
Conversation
With RENDER_REUSE=on the service keeps a page that has drawn a figure, one per concurrent render, each in a browser context of its own, and moves it to the next figure inside the app with __renderNavigate instead of loading it again; it waits only for the host that move made, and lets go of the readiness handle, which otherwise kept every figure the page drew. A page is held only after a figure that succeeded and left it movable (a PDF prints in its place). Off, the default until the comparison (T009) has passed, every figure has a fresh page as before. /health says reuse, and with it on reused, which reuse-compare reads before trusting a run; the rest of the health contract is T008's. Tests seen failing: the pool with reuse ignored, no cap, a page left on the list while drawn, a failed page kept, reusable ignored and a close that throws; the move with every page loaded, the handle kept, any host waited for and a refused move ignored. T002's first reuse run (20 SVGs, three orders) is recorded in tasks.md: one leak (the overview after another species' overview wraps one label differently), two kinds of fresh render that vary by themselves, and a sample error; they are T012. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main lowered the lint totals (#956), and the ratchet compares with main's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Spec 018 (render page reuse), T005: held pages in the render service, behind
RENDER_REUSE. Also ticks T002, whose done condition was a first run of the comparison inreusemode.What changes
tools/render/pages.ts(new): the pool.render-core.ts: anavoption.__renderNavigate(T003, Spec 018 T003: the render page's entry point for a held page #877) instead of being loaded again.render()now reports whether the page can still be moved: a PDF is printed from the SVG put in the page's place, and a site built before T003 has no entry point.service.ts:RENDER_REUSE=onturns held pages on. Off stays the default until the comparison (T009) passes.getBrowser()is rewritten to say what reuse rests on./healthgainsreuse, and with it on,reused. reuse-compare reads both before it trusts a run; the rest of the health contract is T008's.Not changed: what happens to a page after a browser problem, a timeout or a browser restart, and replacement by count, memory or build. Those are T006 and T007.
Tests
pages.spec.ts, 9 tests. Each is seen failing against one mutant:render-core.spec.ts, 3 new tests. Each is seen failing against one mutant:service.spec.ts:/healthwith reuse unset saysreuse: falseand has noreused.Preflight: all 14 steps ok, including "render, live".
The first
reuserun of the comparison (T002)tools/render/reuse-compare.ts --mode reuseagainst beta's site, which has T003 and T004 built in. The sample was 20 SVG requests: reactions, reaction layouts, a diagram dark, with subpathways off, with a selection and with a highlight, an illustration, the overview of two species, and two analysis tokens. Each was drawn listed, reversed and in ten runs of pairs. Each difference was then drawn again through two services on this host.styleis written before or after itsclass. Two fresh pages differ the same way.All of these are recorded in tasks.md under a new task, T012, which T009 now waits on.
RENDER_REUSEstays off by default, so nothing served changes.The service's own initial bundle is unaffected: no site code changes, only a contract type.
🤖 Generated with Claude Code