Skip to content

report: p95 and p99 per stage in the latency report - #92

Open
pgm1207 wants to merge 1 commit into
ASEbrahim:mainfrom
pgm1207:report/latency-p95
Open

pgm1207 wants to merge 1 commit into
ASEbrahim:mainfrom
pgm1207:report/latency-p95

Conversation

@pgm1207

@pgm1207 pgm1207 commented Nov 20, 2026

Copy link
Copy Markdown

What

tools/latency_report.py is the reader for VKBRIDGE_LATLOG, and the question it gets asked is about the tail: on the CMF the Steam menu sits at a CEF-cadence-bound ~30-39 fps with commits 25-34 ms apart, while the bridge's own stages are small (fence wait 2.60 ms, render_scene 3.39 ms, acquire 0.13, present 0.44 of a ~31.8 ms frame, 2026-11-20, /tmp/opencode/two-track-plan.md). Answering "is the cadence in the frame-interval tail or inside one stage" needs percentiles past p90, and the plan's own acceptance test is before/after p95/p99 frame times.

The table stopped at median, p90, min, max. On a short log p90 says nothing about the frame that took 300 ms, and on a long Steam session max is one outlier with no 1 % low next to it.

Change

Stages.rows() gains p95_ms and p99_ms (same pct() interpolator already used for p50/p90), and table() prints two more columns. Additive --json keys; no other behaviour, no new switch, no change to what the server or client log.

  stage                        n  median ms  p90 ms  p95 ms  p99 ms    min    max
  server -> GPU done          31       0.44    0.58    0.83  210.74   0.07 300.61

That row is host/latency_test.sh step 7 on this branch: 31 frames 16 ms apart with the first one held 300 ms on the GPU. Before this change the same log read median 0.44, p90 0.58, max 300.61 — the held frame was visible only as max, and a subtler tail (say 60 ms on 1 frame in 50) was invisible entirely.

Check

  • host/latency_test.sh → 7/7 OK (step 7 both parses --json and prints the new columns; the assertion on median_ms is unchanged).
  • host/run_tests.sh latency still fails with 6 steps identically on unmodified 3cd7a2b in this container (its present_late_check core-dumps under the suite's Mali profile shim); run alone it is 7/7. Pre-existing, unrelated.
  • lagprobe_test reads median_ms from --json and is unaffected (skipped here: no VKB_WINE_DIR).

Not claimed

Nothing here was measured on a phone. This only makes the next device reading (one vkbridge-latency.log from the CMF) give p95/p99 per stage.

The latency log is read for the tail ("is the 30-39 fps CEF cadence in the frame
interval tail, or in one stage?"), but the table stopped at p90 and printed max:
on a 31-frame run p90 says nothing about the one frame that took 300 ms, and a
300-frame Steam session has no usable 1% low at all.

Stages.rows() now carries p95_ms and p99_ms and the table prints both, so a
before/after reading of the same log gives the p95/p99 pair directly instead of a
median and an outlier. No other behaviour changes; the --json keys are additive.

latency_test.sh step 7 on this branch: 31 frames, 16 ms apart, one held 300 ms ->
  stage n median ms p90 ms p95 ms p99 ms min max
  server -> GPU done 31 0.44 0.58 0.83 210.74 0.07 300.61
(p99 210.74 ms is the held frame; p90 0.58 ms hid it.)
@pgm1207

pgm1207 commented Nov 20, 2026

Copy link
Copy Markdown
Author

@coderabbitai review

@pgm1207

pgm1207 commented Nov 20, 2026

Copy link
Copy Markdown
Author

Requesting a review: this is ready and mergeable. CodeRabbit does not appear to be installed on this repo, so this is a ping for a human review.

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