Repository navigation
perf(cmux-tui-core): the input port's writer runs at user-interactive QoS once it carries a person's key (R-DAEMON-STATE S1.6d) - #35460
Conversation
… QoS once it carries a person's key (R-DAEMON-STATE S1.6d red, #35413 review) DESIGN 2.6.1 asks for the port's writer at user-interactive QoS while it carries the person's input, as the connection threads that carry the key run (server/input_qos.rs, TYPING FIX 2 F7). The writer thread is spawned at the default QoS and never raises itself, so under full CPU the hop from daemon.send.written to the host's PTY write waits for a CPU: the build 3b ON keys over 4 ms waited there (STATUS 11804). Red (macOS only; QoS is a no-op elsewhere): the_input_ports_writer_runs_at_user_interactive_qos_once_it_carries_a_persons_key. Test seam: the writer records its QoS each time it takes a frame (InputPort::writer_qos_for_test).
…QoS once it carries a person's key (R-DAEMON-STATE S1.6d, #35413 review) The person's keys cross the connection's three threads at user-interactive QoS (server/input_qos.rs, TYPING FIX 2 F7), then the terminal's port writer, which ran at the default QoS: under full CPU it waited for a CPU between the key's acceptance (daemon.send.written) and its write to the host. DESIGN 2.6.1 asks for it at user-interactive while it carries the person's input; it was listed and not built. The writer now raises itself (input_qos::raise_this_thread, once per thread) when it takes a frame with no waiter that is not a viewer size: InputPort::enqueue, which only the person's keys use (InputReply::Accepted). Automation's writes (InputPort::write, a waiter) and viewer sizes do not raise it, so a port only automation writes to keeps the default QoS. Off macOS this sets nothing. Test (red at b078664, macOS): the_input_ports_writer_runs_at_user_interactive_qos_once_it_carries_a_persons_key.
…acOS test builds, where its test runs (clippy dead_code on Linux)
|
Review (claude-reviewer-rds-s16d): SHIP at 0c77eb0 R-DAEMON-STATE S1.6d. I read the code and the CI logs; I did not build or run anything. Paths are under The change is correct. The port's writer raises itself to user-interactive QoS when it takes a person's key, before it writes that key. It does this after The lint fix at this head is correct. It changes only test code ( Answers to your three questions1. Is "no waiter and not a control frame" exactly the person's keys? Yes.
2. Can a raised writer starve other work? No.
3. Does the per-thread
|
|
Found 3 test failures on Blacksmith runners: Failures
|
…t-on: its content is here through the #35460 head
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
Summary
R-DAEMON-STATE stage S1 step 6d (handoff/rewrites/R-DAEMON-STATE/DESIGN.md, section 2.6.1), from the review of the S1.7 default flip (#35413). Behind the stage switch
CMUX_TUI_RDS_INPUT(only the input lane uses the port).The defect. The person's keys cross their connection's three threads at user-interactive QoS (server/input_qos.rs, TYPING FIX 2 F7), then the terminal's input port writer, which was spawned at the default QoS and never raised itself. Under full CPU it waited for a CPU between the key's acceptance (
daemon.send.written) and its write to the host. DESIGN 2.6.1 asks for the writer at user-interactive while it carries the person's input; it was listed after the #34544 review and not built. In the build 3b A/B (STATUS 11804), the lane-on keys over 4 ms waited in that hop (1.21-3.90 ms fromdaemon.send.writtento the host's PTY write), and the lane-on tail was about 1 ms longer than the old path's.The fix. The writer raises itself (
input_qos::raise_this_thread, once per thread) when it takes a frame with no waiter that is not a viewer size:InputPort::enqueue, which only the person's keys use (InputReply::Accepted). Automation's writes (InputPort::write, a waiter) and viewer sizes do not raise it, so a port only automation writes to keeps the default QoS, as automation's connections do. A writer that exits idle starts again at the default. Off macOS this sets nothing.Testing
Focused test (macOS only; QoS is a no-op elsewhere):
the_input_ports_writer_runs_at_user_interactive_qos_once_it_carries_a_persons_key(surface/tests/hosted.rs). It checks that automation's write leaves the writer at the default QoS and that after a person's key the writer runs at user-interactive.test/rds-s16d-red-never-merge), fleet step b084ffa94c68fa603d5fd666 on aws-m4pro-3 (scripts/ci/cmux-tui-rust-check.sh --os macos test <name>): FAILED, "the writer that carried the person's key does not run at user-interactive QoS".--filter hostedat 3690c39: run https://github.com/manaflow-ai/cmux/actions/runs/41839435510:test (linux)passed;lint (linux)was red on my test seam (writer_qos_for_testunused on Linux, where its macOS-only test does not exist).cfg(all(test, target_os = "macos"))(test builds only). At this head, run https://github.com/manaflow-ai/cmux/actions/runs/41843138251:test (linux)passed;lint (linux)is red only on the base findingacpmux: clippy::indexing_slicing 687 > baseline 686(a crate this PR does not touch; cmux-tui-core's counts went down).Compile: fleet job 4ae6ea4a97f3bd342dc4ac5e at the head 0c77eb0: CmuxNext, app and cmux-tui passed (also bf8dbfe438eb0d68c30f6d19 at 3690c39).
Observed / Not run
Changelog
none
Proof
No capture: a daemon thread priority, no UI.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Summary by cubic
Fixes the terminal input port's writer running at default QoS while carrying a person's keystrokes, so on macOS under full CPU a key no longer waits for a CPU between its acceptance and the write to the host.
Written for commit 0c77eb0. Summary will update on new commits.