Repository navigation
Battlefield: each picture goes out with its own camera, and no gate (latency step 1) - #124
Merged
Merged
Conversation
Step 1 of plans/battlefield-latency.md (issue #95). Each frame the 3D view spawns a ReadbackOnce whose observer keeps the request the frame was rendered for: Bevy extracts the readback with that frame and copies the texture after its render graph, so a picture's camera is known, not guessed. steady_request (a picture only after four still frames) is gone. visualization_battlefield::outbox decides what goes out: the size asked for, not older than one sent, at most 60 a second. Unit tests first (6, red without Outbox). Screenshots in the middle of a pan show the map on the valley, which is what the gate was there for. A 3 s pan: 14 to 23 new pictures a second (was 0.3), but still 420 to 630 ms behind. The driver now times each draw of the window during the pan: with the 3D view running the app draws about 5 times a second (a 15 ms draw, a 200 ms round trip; 2 ms and 6 ms with no 3D view). GPUI waits for a drawable while the 3D view keeps the GPU busy. The expectation stays Status: pending; step 5 (a lighter 3D view) is next. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 1 of
plans/battlefield-latency.md(#95): each picture of the battlefield now goes out with the camera it was rendered from, and the stillness gate is gone. Results are inplans/battlefield-latency-results.md.Change
ReadbackOnce, and its observer keeps the request that frame was rendered for. Bevy 0.20 extracts the readback with that frame and copies the texture after the frame's render graph, so the pairing is exact. The observer despawns the entity, because Bevy only removes the components.steady_requestis gone (it sent a picture only after four still frames).visualization_battlefield::outbox::Outboxdecides what goes out: the size asked for, not older than a picture already sent, and at most 60 a second.Evidence
Unit tests:
Outboxhas 6 tests, written first. They failed to compile without it, and pass now. They replace the oldsteady_requesttest.Alignment while moving: screenshots taken in the middle of a pan show the map on the valley (the towers' circles in their clearings, the lake's shore). That is the slide the gate was added for, in be3b8be.
A 3 s pan:
Found: the commander app draws about 5 times a second while the 3D view runs
GPUI waits in
next_drawable()while the 3D view, at about 100 ms a frame, keeps the shared GPU busy. The drones' cameras are not the cost: not watching them changed nothing. So the expectation «The picture keeps up with the camera» staysStatus: pending, and step 5 (a lighter 3D view) is next.Not run
--selftestand the whole workspace suite; nothing here touches the flight model.cargo clippyon the changed crate is clean, and CI runs the rest.🤖 Generated with Claude Code