Repository navigation
Conversation
…t the log
The CMF's deployed libvkbridge_server.so (v0.5.5.3) has neither VKBRIDGE_LATLOG nor
VKBRIDGE_STATS in its string tables, so the knobs did nothing and no per-frame log
existed: the one instrument that would say what the rest of a 31.8 ms frame was doing
was not on the device (fence wait 2.60 ms, render_scene 3.39 ms, acquire 0.13, present
0.44 - 8.2 % + 10.7 % of the frame; the other ~24 ms unknown).
Both diagnostics are compiled in unconditionally (server/server_latency.c, client/latency.c,
server/server_conn.c, client/conn.c) and both build scripts compile the whole source
directory, so the absence came from a binary built elsewhere (an older checkout, or
package-droiddeck-asset.sh's [source-dir]). Nothing checked, so nothing failed.
scripts/check-instrumentation.sh reads an ELF's string tables and fails when
VKBRIDGE_LATLOG or VKBRIDGE_STATS is missing; --server also demands the latency log's own
header line, so a table naming the switch cannot pass for the log. Wired into
build-server-android.sh (after strip, on both server outputs), check-droiddeck-asset.sh
(on the asset's server, jni and ICD) and run_tests.sh ("instrumentation", so the host gate
has it too). The literals survive --strip-unneeded and llvm-strip.
Tested: --server on a fresh NDK build (libvkbridge_server.so, libvkbridge_jni.so) and on
host/out/vkbridge-server -> ok; on host/out/libvulkan_droidbridge.so -> ok; on a library
without them (host/out/libvkb_mali_profile.so) -> FAIL as intended.
Author
|
@coderabbitai review |
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. |
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.
What
Nothing checked that the per-frame instrumentation a release binary ships with is actually in it. On the CMF (Mali-G720, MaliBridge v0.5.5.3) the deployed
libvkbridge_server.sohas neitherVKBRIDGE_LATLOGnorVKBRIDGE_STATSin its string tables: the knobs were set, nothing was logged, and the one instrument that would answer the next question did not exist on the device.scripts/check-instrumentation.sh <elf>...reads an ELF's string tables (before or afterstrip) and fails whenVKBRIDGE_LATLOGorVKBRIDGE_STATSis missing. With--serverit also demands the latency log's own header line, so a table that merely names the switch cannot pass for the log.Wired in at three places:
scripts/build-server-android.sh— afterllvm-strip, onlibvkbridge_server.soandlibvkbridge_jni.soscripts/check-droiddeck-asset.sh— on the asset's two server libraries and the guest ICDhost/run_tests.sh— newinstrumentationtest, so the host gate has it tooWhy the binaries can lose it
Both diagnostics are compiled in unconditionally (
server/server_latency.c,client/latency.c;VKBRIDGE_STATSinserver/server_conn.c,client/conn.c), and both build scripts compile the whole source directory. A deployed binary without them therefore came from somewhere else: an older checkout, orpackage-droiddeck-asset.sh's optional<source-dir>. No check existed, so no step failed — the failure only showed up as "no log to read" during a measurement session.Only presence is asserted: no behaviour change, no default flipped. Turning the latency log on by default was considered and dropped — it writes a line per frame and buys nothing once an operator can set
VKBRIDGE_LATLOG=1in<cache dir>/env, which the harness already does.Evidence it works
Fresh NDK build of this branch (
scripts/build-server-android.sh ~/Android/Sdk/ndk/27.3.13750724 /tmp/opencode/mb-an):Host:
Gate:
make -C host -j8→ rc 0;host/run_tests.sh instrumentation latency→ok instrumentation,ok no protocol errors.latency_testfails with 6 steps in this container both here and on unmodified3cd7a2b(itspresent_late_checkcore-dumps under the suite's Mali profile shim); run alone it is 7/7 OK here and on this branch. That is pre-existing and unrelated to this diff, which touches no C.Where the numbers come from
CMF measurement session, 2026-11-20: Steam menu CEF-cadence-bound at ~30-39 fps; per-frame tail
fence wait 2.60 ms,render_scene 3.39 ms,acquire 0.13,present 0.44of a ~31.8 ms frame (/tmp/opencode/two-track-plan.md,cmf-latency-baseline). The remaining ~24 ms is what a device-side latency log is for.Not done here
VKBRIDGE_STATSis not inserver_presets.c's per-game allow-list by design (it is a per-server switch, taken from<cache dir>/env), so nothing was changed there.