Repository navigation
open path: view settings class set up after startup; rows laid out once; qt_drive waits for sidebar rows - #2112
Merged
Merged
Conversation
…asure pending stand-ins - ObjectConfiguration.prepare_settings_type makes the views' lazy settings class, each nested one, and validates one instance, so their annotations resolve once. That is class setup the first view the reader opened used to pay (238 ms median at a phone's speed on the cold #comms open). ApplicationLifetime.start runs it once the restored tabs are up, before the heap settles, in both frontends. - PreparedOnFill.resolved: pyqt-reactive measures a row's final formatting only; what a history row's measurement resolves to may be its pending stand-in, which is estimated instead of laid out (pyqt-reactive#63 calls it; an older delegate fills as before). - qt_drive: FRAME_TIME_OPEN times the open path per action (view configuration, lazy types, the row delegate, settings writes and their snapshot and invalidation); FRAME_TIME_WRITES logs each settings write with the registered states (tools only). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
… one is named The sidebar is a live list, filled from observations that can arrive after the step that reads it. Scenarios took rows from it with a one-shot next(), which raised StopIteration whenever the row was not drawn yet (history and composer at qt_drive.py:649 today, twice, on main as on branches). Scenario.found(wanted, label, rows) owns every such lookup. It reads the rows again every tenth of a second, through the loop the scenario's steps run on, until a 20 s deadline. Past the deadline it raises LookupError naming the missing row and every row listed. channel_row, thread_row and the new listed_thread wait through it, and channel_listed goes. Every one-shot next() over sidebar or thread rows now goes through found, and so does each scenario that took threads[0], children[0] or thread_rows()[0] from a list that could still be empty, and #2110's ArrivalScenario, which used channel_listed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
trissim
force-pushed
the
fork-qt-open-path
branch
from
November 18, 2026 08:32
161ed17 to
0043d0e
Compare
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.
Summary
This cuts the cost of opening a page in the Qt client, together with three library PRs. Toad's own part is small:
ObjectConfiguration.prepare_settings_type. It sets up, once, what every view's configuration is built from: the views' lazy settings class, each nested lazy class, and their annotations (one instance is validated). This is inherently first-time class setup, already cached per class by objectstate, and the first view the reader tapped used to pay for it.ApplicationLifetime.startnow runs it once the first frame and the restored tabs are up, beforesettle_heap, so the classes are frozen with the rest. Both frontends inherit it. It follows qt start: first frame in 0.3 s at phone speed; APK ships bytecode; settings pages build lazily #2104's rule: nothing before the first frame.PreparedOnFill.resolved. pyqt-reactive now measures only a row's final formatting (PyQT-reactive#63). A history row's measurement can resolve to its pending stand-in, which the delegate estimates instead of laying out.fillis unchanged, so this works with the installed delegate too.qt_drive(tools only):FRAME_TIME_OPENtimes the open path per action: view configuration, lazy types, the row delegate'ssizeHint/measured_height/ arrivals / relayouts, and settings writes with their snapshot and invalidation.FRAME_TIME_WRITESlogs each settings write with the number of registered states.The library PRs this needs
resolved_class_annotationsis resolved once per classNone of the three is an API this PR requires. Toad behaves as before on the installed libraries;
tools/android/check.shpasses against the installed runtime.How the runtime and APK pick them up. The agent-comms runtime resolves each library at
mainwhen it is built: itsbuild.jsonrecordsrequested_revision: main, and the current runtime has objectstate 93c87f4, pyqt-reactive 96cce1b and python-introspect 5106570. The APK bundles that runtime's site-packages (tools/android/build.sh RUNTIME …). So the path is:core-…-lock-…).Toad's
uv.lockpins older commits of these libraries (objectstate d34d758, pyqt-reactive 3f0e2c0, python-introspect adc02dc) that neither the runtime nor the APK use, so this PR leaves it alone.Measured
Phone speed (
CPUQuota=45%, one core, Pixel 8a profile), unprobedqt_drive actions, 3 runs per tree, median. "Before" is #2106's head with the installed libraries. "After" is this change with the three library branches.Opening a page:
Mixed result. #scratch's total
sizeHinttime didn't improve (658 → 860 ms median, with a wide spread: 430–910 ms). Rows are now laid out once, in their final form, butQListViewstill asks every model row for its height on each relayout. That final layout of the page's rows is now the largest remaining cost of a second channel.The sidebar drag's release (#2107's
qt_drive drag_speed, same throttle, 3 runs each) carries one settings write:Why one write cost so much. Invalidation was already scoped by scope, type and field. Every view's configuration is a lazy copy of the whole settings tree, so each open view is a real dependent of a global write. What grew with everything registered was:
Each is fixed at its owner. Unthrottled, with 8 views open, a write's median over three rounds of 80 writes went:
Most of what's left is the copy of each changed view's snapshot. Each view really changed, because it inherits the field.
Note on the base. These runs were taken before this commit was rebased onto 7752071. The rebase conflicted only in
qt_drive.py's argument parsing (#2111).Gates (once, on this head)
shadow_check: 0.tools/android/check.sh: exit 0 against the installed runtime (shipped app ran every view kind and bound key on a scratch bus).test_window_top_edge.py::test_wheel_up_through_saved_history_never_moves_forward[size0/1].6-failed, to an unknown channel).qt_drive.py:649withStopIteration. On main, composer failed the same way.Sidebar row lookups in
qt_drive(second commit)Scenarios took rows from the live sidebar with a one-shot
next(). That raisedStopIterationwhenever the row wasn't drawn yet, which is the timing race two forks hit today.Scenario.found(wanted, label, rows)owns every such lookup. It reads the rows again every tenth of a second through the loop the scenario steps run on, until a 20 s deadline. Past the deadline it raisesLookupError, for example:the sidebar lists no channel #scratch after 20.0 s; it lists: '#comms', 'dm-peer'.channel_row,thread_rowand the newlisted_threadwait through it, andchannel_listedis gone.next()over sidebar or thread rows goes throughfoundnow. So do the two scenarios that tookthreads[0]orchildren[0]from a list that could still be empty.🤖 Generated with Claude Code
https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3