Repository navigation
Conversation
kitty's parse_graphics_code stores each value into its field as it reads it, so a key given twice keeps its last value. termlens searched the control block once per reader and stopped at the first pair naming the key, and the query test matched any `a=q` in the block: `a=t,...,a=T` was transmitted only, `c=3,...,c=5` covered three columns, `a=q,...,a=T` was taken for a query, and `a=q,i=31,...,i=32` was answered `i=31`. The block is now parsed once into a KittyControl, the last value of each key winning, and every reader (the builder, the delete filter, MidUpload, KittyAsk, the query test and the query itself) reads that. Closes #843 Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com>
kitty 0.49's parse_graphics_code returns before the graphics manager on an invalid key, a flag value outside its set, a value with no digits or past UINT32_MAX, and anything but `,` or `;` after a value, and its REPORT_ERROR only logs. handle_add_command then refuses a load declaring more than 10000 pixels a side. termlens read the block a key at a time and went ahead with all of them: a trailing comma, an unknown key or a bad flag still captured, counted and placed an image, and a malformed query or a feature query (`e=`, a key 0.49 does not have) was answered `OK`. KittyControl::parse is now kitty's state machine, and an escape it refuses is no command: its bytes are counted, and nothing else happens, an upload in progress included. A transmission or query starting a load over 10000 pixels a side is refused; the query gets kitty's EINVAL. `m=` is read as kitty reads it, any nonzero value meaning more. Closes #841 Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com>
Every snapshot collected the retained history into a slice of its own, one Arc clone per row, and with styled history a second slice. A wait evaluation and a recorded DEC 2026 frame therefore cost O(history), and each recorded frame held its own index of the history, 16 bytes a row. On an 80x24 terminal with 32,000 rows, one snapshot took 606 us against 121 us at 1,000 rows, and 1,000 recorded frames grew the process by 591 MiB. The emulator now keeps its history in a RowLog: sealed chunks of 256 rows and an open tail, with the HistoryRows last built from them cached until the history changes. A snapshot with no row scrolled since the last is one refcount; one after a scroll clones a pointer per chunk and at most 255 rows. A snapshot at 32,000 rows now takes 128 us, and the recording grows the process by 102 MiB at every depth. The Screen API and its serialized form are unchanged. The scrollback_styles and record_budget docs are corrected to what a snapshot and a frame now hold. Closes #856 Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com>
wait_until evaluated its predicate on a fresh snapshot after every read, under the state lock the reader needs for each read. A snapshot is O(cells), about 90 ms at 1000x1000 in release, so while a wait was pending the reader got one read of at most 8 KiB in per snapshot: one paint of every cell of a 1000x1000 grid took 8 to 14 s to wait through, and the first wait_until timed out at its default 5 s. The wait now spaces its evaluations: after one that took d, the next waits until d has passed (Monitor::wait_paced wakes it then, nothing else need arrive), so evaluating keeps to at most half the lock's time. Every screen the wait stops on is still evaluated, and so is the last before the deadline. On ordinary screens d is microseconds. The paint is now waited through in 1.7 s in release and 3.3 s in debug. The size() table and the MAX_DIMENSION comment are measured again: a 1000x1000 snapshot costs about 90 ms in release and 620 ms in debug, not 10 ms and 297 ms. tests/large_grid.rs holds the paint to the default timeout in release builds. Closes #854 Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com>
This branch has not been deployed
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.
Four v0.11.12 issues: kitty control parsing and two snapshot and wait costs. One commit each, each with tests that fail without the fix. The public API is unchanged, and semver-checks against main reports nothing to update.
KittyControl), a repeated key keeps its last value as in kitty, and every reader uses that parse, thea=qtest included.OK#841: the block is validated as kitty 0.49'sparse_graphics_codedoes.u32, signed values outsidez/H/V, and a missing,or;.s=/v=over 10000 is refused, and a query refused this way gets kitty'sEINVALreply.e=is refused as in 0.49, so the feature query gets noOK.m=is read as kitty reads it, any nonzero value meaning more chunks follow.a=fsize check is documented in LIMITATIONS.screen/history.rs), so a snapshot clones a pointer per chunk, not one per row. The serde format is unchanged. Release-build measurements:wait_until: it snapshots after every read #854: await_untilevaluation is spaced by its own cost. After an evaluation that took d, the next waits at least d. Every screen the wait stops on, and the last one before the deadline, is still evaluated.size()table, theMAX_DIMENSIONcomment and DESIGN §2 now carry measured numbers.tests/large_grid.rspins the 1000x1000 wait to the default 5 s.Local: the full suite passed three times (1038 tests). frames and basic passed 10 runs at 1–17 threads in debug and 5 runs in release. Stress is dispatched.
Closes #843
Closes #841
Closes #856
Closes #854