Repository navigation
Battlefield: measure how far the picture trails the camera (latency step 0) - #123
Merged
Merged
Conversation
Keep the two processes (GPUI app, Bevy 3D view) and fix the join between them: measure, pair each picture with its camera exactly and drop the stillness gate, repaint on arrival, render a margin and move the last picture, fewer copies, a lighter 3D view, and (macOS only, optional) no copy at all. Go/no-go: if steps 1 to 3 do not reach about 80 ms and 45 pictures a second, move the commander app to one process. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Step 0 of plans/battlefield-latency.md (issue #95). - The battlefield protocol numbers each request (seq), and each picture comes back with the number it was rendered for (new magic BFL2/BFR2). - teleoperation_battlefield::lag measures each motion of the camera: how long the picture on screen has been out of date (since the first camera it does not show), and how many new pictures came. The app logs each motion; the 3D view logs its frame rate while an app is connected. - The expectation «The picture keeps up with the camera» (at most 80 ms behind, at least 45 new pictures a second, during a 3 s pan) is Status: pending until step 1. Its own event: on the event that «The keys move the camera» uses, the generator made a test for neither. - The commander's driver can arrange a live picture, observe the two numbers, and draws the window 60 times a second during the pan (in a test run the system does not draw it, and the app asks as it draws). Red, measured: in a 3.1 s pan, 1 new picture (0.3 a second), 544 ms behind (median), 1728 ms (90 %). The 3D view renders 8 to 11 frames a second in a game. Numbers in plans/battlefield-latency-results.md. 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.
Step 0 of the plan to make the battlefield keep up with the camera (#95). It adds the plan, a way to measure the lag, and the first numbers. It changes no behaviour a commander sees.
What it adds
plans/battlefield-latency.md: keep the GPUI app and the Bevy 3D view as two processes and fix the join between them, with a go/no-go to one process.seq), and each picture comes back with the number it was rendered for. The magic changes toBFL2/BFR2, so an old view and a new app refuse each other instead of misreading.teleoperation_battlefield::lag: for each motion of the camera, how long the picture on screen has been out of date, and how many new pictures came. The app logs each motion. The 3D view logs its frame rate every 5 s while an app is connected.Status: pendinguntil step 1, because it fails today.The numbers (
plans/battlefield-latency-results.md)During a 3.1 s pan, on an Apple M4, in a practice game with ten SITL drones:
steady_request) is the largest part. Step 1 removes it.Tests
teleoperation_shared20 passed,teleoperation_battlefield21 passed (6 new forlag),visualization_battlefield1 passed.expectation check: 0 errors.cargo clippyon the changed crates: clean.cargo fmt: done.--selftest. Nothing here touches the flight model.To run the measurement yourself (the valley takes over two minutes to load, so the default 120 s budget runs out):
Remove
Status: pendingfrom the expectation first; a pending test is not run.🤖 Generated with Claude Code