mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-10 05:08:31 +09:00
- DriverBenchStateToggle runs mc_state_toggle as its own ctest entry. The case has been in kBenchCases since P0 and nothing executed it, so nothing would have noticed it rotting - and it is the exact enable/draw/disable/draw shape the microbenchmark P2 owes the GO/NO-GO measures. About 1.2 s inside an existing three-minute job. - scripts/g7_negative_control.sh breaks the pipeline/dynamic split on purpose: it inserts two boundaries so ColorMasks becomes a dynamic chunk of its own, which keeps the partition sorted, non-overlapping and complete - so it still COMPILES - while making glColorMask bump m_pipelineStateVersion without moving the pipeline-subset hash. A non-zero ctest is the pass. - Everything that could make that control lie is refused rather than reported: a missing SetterConsistency test exits 2 instead of reading "no tests matched" as a failure; a tree that is already red or already broken exits 2; a patched table that does not compile exits 2, since a build break would prove the static_asserts work rather than that the test still checks; and the restore is from byte-for-byte copies (never from git, so a dirty tree is given back intact), followed by a rebuild and a re-run that must be green. --verify-patch-only exercises the mechanism where the test does not exist yet and says explicitly that it is not a pass. - Profiles for the two campaign devices, and the guard that stops them being trusted early. Both carry PROFILE_VERIFIED=0 and every device-specific field is TODO_VERIFY_ON_DEVICE rather than a guess: the harness pins through MediaTek nodes and 35d0befa is a Qualcomm part, where `su -c 'echo ... > /proc/ppm/...'` fails with a zero exit and the run would report numbers it believes were pinned. bench.sh and session.sh now refuse an unverified profile unless --allow-unverified-profile is passed, which warns that the run is not comparable with a pinned one. The README records what earns PROFILE_VERIFIED=1.
78 lines
4.1 KiB
Markdown
78 lines
4.1 KiB
Markdown
# device_bench — in-game FPS benchmark harness
|
|
|
|
Scripted, repeatable in-game FPS measurement for MobileGL's two Android backends
|
|
(Espryt/DirectGLES and Magma/DirectVulkan) plus a MobileGlues reference run,
|
|
driven through the FCL fordebug flavor. Intended for A/B performance work and
|
|
release regression gates on real devices.
|
|
|
|
## How it measures
|
|
|
|
FCL's in-game FPS overlay counts `eglSwapBuffers` calls natively (renderer-
|
|
agnostic, not vsync-capped when the game runs with vsync off). When the overlay
|
|
is enabled, FCL's FPS thread logs one `FCLFPS: <n>` logcat line per second;
|
|
`bench.sh` collects those lines during the measurement window and reports
|
|
mean / median / min / max / stdev, alongside GPU busy%, SoC temperature, and
|
|
frequency-pin integrity.
|
|
|
|
## One-time setup (per device / world)
|
|
|
|
1. Install the FCL **fordebug** flavor (`com.tungsten.fcl.mgdebug.debug`). Its
|
|
splash auto-launches the selected profile into the prepared world after a 5 s
|
|
countdown.
|
|
2. In-game menu: enable **show FPS** (persists in `files/menu_setting.json`).
|
|
3. Prepare the benchmark world: fixed camera position, gamerules
|
|
`doMobSpawning/doDaylightCycle/doWeatherCycle=false`, then save & quit once.
|
|
`bench.sh` always `am force-stop`s the game (never saves), so every run
|
|
replays the same state.
|
|
4. `options.txt`: desired `renderDistance`, `enableVsync:false`, high `maxFps`,
|
|
`inactivityFpsLimit:"minimized"` (the "afk" default locks 30 fps after 60 s
|
|
without input and ruins the window).
|
|
5. Root required (frequency pinning, GPU busy sampling).
|
|
6. Write a device profile under `devices/` (see `devices/odinlite.env`).
|
|
|
|
A profile carries `PROFILE_VERIFIED=1` only once its sysfs nodes and OPPs have been read
|
|
off *that* device and one pinned window has been checked against them
|
|
(`big_cur`/`little_cur`/`gpu_cur_khz` in the result JSON must match the pins). Until then
|
|
it says `PROFILE_VERIFIED=0` and `bench.sh` / `session.sh` refuse to run against it unless
|
|
`--allow-unverified-profile` is passed, which labels the run unpinned in the warning.
|
|
|
|
That refusal exists because the pin path is silent when it is wrong: the harness writes
|
|
through `/proc/ppm/policy/hard_userlimit_*` and `/proc/gpufreq/gpufreq_opp_freq`, which are
|
|
MediaTek nodes, and `su -c 'echo ... > /proc/...'` against a device that has neither fails
|
|
without a non-zero exit. The run then reports numbers it believes were taken under a pin.
|
|
|
|
## Devices
|
|
|
|
| profile | device | verified |
|
|
|---|---|---|
|
|
| `devices/odinlite.env` | AYN Odin Lite, MT6877 / Mali-G68 | yes |
|
|
| `devices/xiaomi-adreno830.env` | Xiaomi, Snapdragon 8 Elite / Adreno 830 (`35d0befa`) | **no** - Qualcomm pin path not yet taught to `bench.sh` |
|
|
| `devices/oppo-mali.env` | Oppo / ColorOS, MediaTek + Mali (`3B159D009VZ00000`) | **no** - OPPs and thermal zone not yet read off the device |
|
|
|
|
## Usage
|
|
|
|
```
|
|
./bench.sh --device devices/odinlite.env --backend magma # 30 samples, 180 s warmup
|
|
./bench.sh --device devices/odinlite.env --backend espryt --label after-fix-X
|
|
./bench.sh --device devices/odinlite.env --backend mobileglues # reference
|
|
```
|
|
|
|
Results append to `results/results.jsonl`; per-run screenshots (`pre.png`,
|
|
`post.png`) land in `results/<timestamp>-<backend>[-label]/` — always eyeball
|
|
them: the pre/post pair must show the same scene, or the run is invalid.
|
|
|
|
## Protocol discipline (hard-won, do not skip)
|
|
|
|
- **Thermal gate**: the script waits for the profile's start-temperature
|
|
threshold. Runs started hot are not comparable to runs started cool.
|
|
- **Warmup 180 s**: ART JIT takes ~3 min to plateau (62→67→84 fps ramp was
|
|
measured); short warmups underestimate by 10-20%.
|
|
- **Pins can be overridden by the thermal engine.** The result JSON records
|
|
`big_cur/little_cur/gpu_cur_khz` sampled at window end — discard the run if
|
|
they do not match the profile pins.
|
|
- **Paired runs**: absolute FPS drifts across sessions (camera angle, world
|
|
state). A/B comparisons must be back-to-back runs in the same session.
|
|
- **F3 off** for standard numbers (the F3 debug overlay multiplies per-draw
|
|
overhead and skews backends differently).
|
|
- The FPS overlay itself must be ON (it is what produces the FCLFPS lines).
|