Repository navigation
Conversation
Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
[Medium impact] The PR appears safe to merge, with no new actionable issues found. SummaryAdds source-input timing at UI claim and successful window-write return.
DiagramsequenceDiagram
participant Source as Input source
participant UI as UI loop
participant Profiler
participant Window
participant Stats
Source->>UI: Events and shared clock origin
UI->>Profiler: Record UI claim
UI->>Window: Write frame
Window-->>UI: Successful return
UI->>Profiler: Complete pending inputs
Profiler->>Stats: Collected host measurements
Reviews (22) · Last reviewed commit: "Merge main into the contribution branch" · Reviewed by Greptile |
Linearize peer availability and frame admission under the track state lock. Preserve negotiation queuing and reopen admission after peer recovery. Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
Keep the timestamp clock bridge on a dedicated input-source extension. Measure IUILoop claim and the first following window write. Remove transport-specific and duplicated stage instrumentation. Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
Define WebRTC timing at the existing single-slot sender mailbox write. Keep active-peer delivery and display timing in matching client telemetry. Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
|
Good catch to check this race. |
…r-input-latency-instrumentation Signed-off-by: Ziming Wang <zimingwang945@gmail.com> # Conflicts: # flashdreams/flashdreams/runtime_v2/application_runner.py # flashdreams/flashdreams/runtime_v2/cli.py # flashdreams/flashdreams/runtime_v2/session_runner.py # flashdreams/flashdreams/runtime_v2/webrtc_client_window.py
|
Pulled #548's multi-session lifecycle into Each replacement now gets a fresh clock binding and an independent JSONL segment, with WebRTC's rebased timestamps mapped back to the correct monotonic session origin. The complete V2 CPU suite passes: 211 passed, 3 deselected. The two metrics remain anchored at IUILoop claim and the first following window write (ง •̀_•́)ง |
|
I rechecked this against current HEAD and the PR diff. This review keeps the transport contract unchanged and keeps #574 scoped to the two host-side perceived-latency checkpoints (•̀ᴗ•́)و |
…r-input-latency-instrumentation Signed-off-by: Ziming Wang <zimingwang945@gmail.com> # Conflicts: # flashdreams/flashdreams/runtime_v2/session_runner.py
Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
|
Synced current |
jmccaffrey-nv
left a comment
There was a problem hiding this comment.
Reviewed the implementation against #538, including native/WebRTC clock bridging, replacement-session ownership, correlation, cleanup, path collisions, security, and profiler overhead.
The PR satisfies the narrowed host-side checkpoints discussed on the issue: event receipt to IUILoop claim, and event receipt to the next window.write return. The latter is not causal or end-to-end perceived response latency: the UI can re-render a held pre-input frame, and WebRTC stops at host queue admission before transport, decode, composition, and scanout. The documentation states these limits; please keep that distinction explicit when closing #538.
Local validation at 0e007995: 215 V2 CPU tests passed; focused Ruff formatting/import checks, ty, compileall, and git diff --check passed. The documentation build reached the new section without a new warning; its warning-as-error run still reports 10 unrelated baseline warnings. GitHub currently shows only the successful Greptile check while NVIDIA runner validation awaits vetting.
I left three inline comments on self-describing profile metadata, unbounded in-memory summary retention, and stable event-type serialization. I found no new code-execution, deserialization, dependency, or credential-handling exposure.
-- reviewed using GPT-5.6 Sol
|
/ok to test 0e00799 |
…r-input-latency-instrumentation Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
|
Addressed the three review threads in Validation: 185 V2 CPU tests passed, 5 skipped in the local optional-dependency environment; 88 focused tests passed, 1 skipped; Ruff, focused |
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
|
I've synced the profiling change with the new model-metrics sink on Both outputs keep their session lifecycle, and replacement sessions retain independent profile segments. I've updated the validation section for the current branch. |
Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
|
@jmccaffrey-nv, |
Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
Comments Outside DiffThese findings could not be posted inline.
|
Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
Retain the input-source event submission contract and timestamp extension through the current client-window and file-selection lifecycle. Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
Opening a WebRTC session now restates the last known viewport focus as a FocusUserInputEvent at the session origin. That event carries state from before the session, so measuring it would charge session startup to the first window write. In-session focus changes keep their latency. Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
|
Pushed |
Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
Current head (
ca1c2303)Closed the disconnected-track admission gap identified in review.
_VideoTracknow rejects frames while the peer media state is disconnected, clears queued frames at the transition, and records the discarded count. The server updates this gate on connection-state transitions and peer release. Added a focused CPU regression for reject-before-connect, accept-while-connected, reject-after-disconnect, and queue-discard accounting.Local validation:
git diff --checkand Pythoncompileallpass. The optionalaiortcdependency is not installed in this checkout, so the focused runtime test is pending the project runner.November 16 mainline integration
Merged
main@5b23817a1eddintodff962932f54through a normal merge. Kept the current contributor guide and both profiling sections, including the source-input clock and completion boundaries. All 13 contribution Python source and test files retain their previous contents. The eight existing skill metadata checks passed, and the locked Zensical 0.0.67 documentation build completed without issues. Runtime, GPU and end-to-end latency checks were not rerun for this documentation-only mainline delta. Earlier runtime measurements remain tied to their recorded revisions.Summary
Closes #538.
Measure
UserInputEvent.timestampat the two host checkpoints discussed in the issue: when the UI loop claims the input, and when the first subsequentwindow.writereturns successfully in the same generation.Merged
mainat1448d5a1and moved these measurements into the sharedIProfilerandInputLatencyProfilerfrom #634. Removed this branch's separate profiler, jsonl writer, and--profile-path. The existing--stats-pathnow exports both measurements alongside the existing model-input metrics.TimestampedInputSource.Endpoint scope
These are host checkpoints. Native-window completion includes the presenter call. WebRTC completion includes host output handling and sender admission when a track exists. A held frame may be written after input claim, so this metric does not establish a causal visual response, transport delivery, browser decode, or physical display latency. The existing model-input metrics keep their separate meaning.
Current validation (2026-11-04)
Merged
main@34ce7b7f(#772) into65c724d3at50f18c69. #772 addsbrowser_focusedto the WebRTC server at the same place this PR addsinput_timestamp_origin_ns, and both stay. It also restates the last known viewport focus as aFocusUserInputEventat the session origin when a session opens. That event carries state from before the session, so20a4cd85skips a focus event at session timestamp 0 inui_claimandwindow_write, otherwise every replacement session would report open-to-first-write as an input latency. The WebRTC client already clamps pre-origin timestamps to 0, other sources emit no focus events, and in-session focus changes keep their latency. The profiling guide and runtime README note the rule.On macOS arm64 the V2 runtime and profiler
ci_cpuselection passed 450 tests with seven skipped, includingtest_ui_input_latency_skips_focus_restated_at_session_open, which fails without the skip and checks that a later focus change is still measured. Ruff 0.12.7 check and format pass on the changed files. GPU generation, browser display and end-to-end latency weren't exercised.Previous validation (2026-11-02)
Merged
main@f6ed7e3fec72into65c724d310b8, retaining WebM mode support and the host-side profiling boundaries. The eight profiler and input-clock implementation files are byte-for-byte unchanged fromfdf75fb7aba3.Main removed the WebRTC test module in #741. The session-clock replacement scenario now lives in the existing client-window suite, with deterministic server-relative timestamps and the real server open, reopen and close lifecycle. It checks exact session-relative and absolute event times across replacement, along with discarding events from the old session. The retired module stays removed.
On macOS arm64 with Python 3.12.14, PyTorch 2.9.1, NumPy 2.4.6, pytest 9.2.0, aiortc 1.15.0 and aiohttp 3.14.5, the V2 runtime and profiler selection passed 447 tests with three GPU tests outside the
ci_cpuselection. The separate step-agreement suite passed 19 tests, including two-process Gloo execution. The final clock-fixture refinement then passed both client-window tests. Ruff 0.12.7 import-order and formatting checks, Python 3.10 syntax checks and contribution whitespace checks passed. The environment differs from the complete Linux lockfile matrix.GPU generation, native presentation, browser display, WebM encoding and end-to-end latency were not exercised in this integration. Earlier performance and device evidence retain their recorded revisions.
Earlier validation (2026-11-01)
Revision
fdf75fb7aba3already contains main9d98934d9652, so no additional merge or code change was needed. The input source retainsput_user_input_eventalongside the timestamp extension, and native and WebRTC event submission preserve their session-clock ownership.On macOS arm64 with Python 3.12.14, PyTorch 2.9.1, NumPy 2.4.6, pytest 9.2.0, aiortc 1.15.0 and aiohttp 3.14.5, the actual V2 runtime and profiler suite passed 549 tests with four tests outside the
ci_cpuselection. No selected cases failed or skipped. The separate existing step-agreement suite passed 19 tests, including two-process Gloo execution. This environment satisfies the exercised dependencies' declared version ranges and differs from the complete Linux lockfile matrix. Scoped Ruff 0.12.7 import-order and formatting checks, Python syntax and contribution whitespace checks passed.GPU generation, native presentation, browser display and end-to-end latency were not rerun. Earlier performance and device evidence retain their recorded revisions.
Earlier validation
On
d8e26d5b:slangpyimports on main and this revision.GPU generation, the native presenter, and browser display have not been run on this revision.
Earlier main integration (2026-10-23)
Merged main
cb4f8527into4bff09ed, retaining the 0.2 release and packaging changes. The contribution implementation is unchanged.On macOS arm64 with Python 3.12.14 and PyTorch 2.9.1, the V2, profiler and two-process Gloo suite passed 515 tests with four deselected. A separate 100,000-input source-loaded profiler scenario checked collection between inputs, empty UI ticks, generation reset and session reset. Count, mean and maximum matched independently calculated values at the first successful window write.
GPU generation, native presentation, browser display and end-to-end latency were not rerun. Earlier performance measurements retain their recorded revisions. Contribution whitespace checks passed.
Project CI: Please run the current-head GPU generation, native presenter, and WebRTC window integration on the project setup. The recorded host checkpoints keep the endpoint meanings described above.