test(renderer): cover delayed GPU timestamp readback #1107

Merged
SakulFlee merged 3 commits from sakulflee/gpu-timestamp-readback into main 2026-11-12 00:49:01 +00:00 AGit
Owner

Refs #1076.

The asynchronous four-slot timestamp readback fix is already on main (dd8a5479). This adds the regression coverage requested in the issue and extracts the readback bookkeeping from Renderer so it can be exercised without a GPU.

  • The ring only hands out free slots, so a pending map is never unmapped or overwritten.
  • Out-of-order and all-zero samples are rejected; an empty readback keeps the last good sample.
  • Raw ticks are scaled by the queue timestamp period.
  • A simulated two-frame GPU delay still produces a new sample for every completed frame.

No renderer behaviour is intended to change.

The remaining acceptance item from the issue is the manual Windows CSV capture; Linux and Android captures already show varying GPU samples.

Refs #1076. The asynchronous four-slot timestamp readback fix is already on `main` (`dd8a5479`). This adds the regression coverage requested in the issue and extracts the readback bookkeeping from `Renderer` so it can be exercised without a GPU. - The ring only hands out free slots, so a pending map is never unmapped or overwritten. - Out-of-order and all-zero samples are rejected; an empty readback keeps the last good sample. - Raw ticks are scaled by the queue timestamp period. - A simulated two-frame GPU delay still produces a new sample for every completed frame. No renderer behaviour is intended to change. The remaining acceptance item from the issue is the manual Windows CSV capture; Linux and Android captures already show varying GPU samples.
test(renderer): cover delayed GPU timestamp readback
All checks were successful
Lint / lint (pull_request) Successful in 3m3s
PR / test (pull_request) Successful in 7m20s
92ce1f291a
Extract the timestamp readback ring and sample history from Renderer
into a small module so the asynchronous behaviour can be tested without
a GPU.

The tests cover pending slots never being reused, out-of-order and empty
samples being rejected, queue-period scaling, and a simulated two-frame
GPU delay that must still produce changing samples for every completed
frame.

Smart test results

Result: PASS

Scope: orbital_renderer

Reason: directly changed crates

Elapsed: 5m 30s

Workflow run

Overall: 28 tests, 28 passed, 0 failed, 0 skipped

Nextest: 28 tests, 28 passed, 0 failed, 0 skipped
Doctests: no tests reported

Crate Nextest Passed Failed Skipped Doctests Time
orbital_renderer 28 28 0 0 - 0.60s
pie showData
    title Nextest outcomes
    "Passed" : 28
<!-- orbital-ci-test-results --> ## Smart test results **Result:** PASS **Scope:** orbital_renderer **Reason:** directly changed crates **Elapsed:** 5m 30s [Workflow run](https://forgejo.sakul-flee.de/SakulFlee/Orbital/actions/runs/1311) **Overall:** 28 tests, 28 passed, 0 failed, 0 skipped **Nextest:** 28 tests, 28 passed, 0 failed, 0 skipped **Doctests:** no tests reported | Crate | Nextest | Passed | Failed | Skipped | Doctests | Time | | --- | ---: | ---: | ---: | ---: | ---: | ---: | | orbital_renderer | 28 | 28 | 0 | 0 | - | 0.60s | ```mermaid pie showData title Nextest outcomes "Passed" : 28 ```
Merge remote-tracking branch 'origin/main' into test/gpu-timestamp-readback
All checks were successful
Lint / lint (pull_request) Successful in 2m17s
PR / test (pull_request) Successful in 5m53s
Templates / templates (pull_request) Successful in 5m18s
a669ba0e2c
Merge remote-tracking branch 'origin/main' into test/gpu-timestamp-readback
Some checks failed
Lint / lint (pull_request) Successful in 1m25s
PR / test (pull_request) Successful in 7m33s
Templates / templates (pull_request) Failing after 1m48s
7e86383aac
# Conflicts:
#	Crates/orbital_renderer/src/renderer.rs
Sign in to join this conversation.
No description provided.