Skip to content

3D view: parked main camera, one frame in flight, honest lag figure (latency step 5, part 3) - #127

Open
ptescher wants to merge 4 commits into
masterfrom
battlefield-latency-6
Open

ptescher wants to merge 4 commits into
masterfrom
battlefield-latency-6

Conversation

@ptescher

Copy link
Copy Markdown
Owner

Part of #95 (plan: plans/battlefield-latency.md). Follows a review of the earlier conclusions; details and numbers in plans/battlefield-latency-results.md.

What changes

  • Lag figure (teleoperation_battlefield::lag): a paint now says how old its picture is (time since the app asked for the camera it shows). The old figure ramped from 0 at the start of each pan, which made a steady ~500 ms delay look like a queue that grows with the pan's length. The picture from before a motion is not counted; the wait for the motion's first picture is logged apart.
  • Parked main camera (RenderScale::parked, set by towers_view --hidden): the view's own camera, which nobody sees when the app starts it, draws a 64×36 picture of the sky where it stands instead of the full scene at 1920×1080 among the trees. It can't be turned off (Bevy's atmosphere needs a live view).
  • One frame in flight (pacing::IN_FLIGHT 2 → 1), and the pacer runs in PostCleanup, after Bevy's map_buffers, so its wait also completes that frame's readback.

Numbers

Before After
View alone, request to arrival 203 ms (2 in flight) 155 ms (0 in flight: 122 ms, 13 % fewer pictures)
In a game, the view's frame 112–153 ms (7–9/s) 56–64 ms (16–18/s)
In a game, pictures sent to the app 7/s 16/s

The battlefield camera has no sun shadows to cut: Bevy's shadows reach 150 m and it sits 450 m from the ground. No look changes in this PR.

Tests

  • New unit tests: a steady delay reads the same on short and long pans; the picture from before a motion is not counted; a parked camera draws a tiny picture and looks up from where it was; --hidden parks it. Three old lag tests changed on purpose for the new definition.
  • cargo clippy --workspace --all-targets, cargo fmt clean. cargo test --workspace --release: all pass except cognition_league's acceptance suite, which ran out of its 120 s budget before its tests started (unrelated to this change; the machine was busy).
  • «The picture keeps up with the camera» stays Status: pending: it still fails, and the app-side figures from an automated run are unreliable (the window is off screen). Next: an on-screen run.

🤖 Generated with Claude Code

ptescher and others added 4 commits November 13, 2026 20:04
The old figure counted from the first camera after the one on screen, so it
ramped up from 0 during each pan and read a steady delay as one that grows
with the pan's length. The picture from before a motion is no longer counted,
and the wait for the motion's first picture is logged apart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Nobody sees the view's own camera when the app starts it, yet it rendered the
scene at 1920x1080 among the trees, sun shadows included. It now draws a 64x36
picture of the sky where it stands. In a game the view goes from 7-9 to 16-18
frames a second.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d for

The view alone: pictures 155 ms after their request, from 203 ms, at the same
frame rate. Results in plans/battlefield-latency-results.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant