Devlog: Halo 3 on the Allwinner H700
Dated progress updates, newest first. Numbers are from the Anbernic RG CubeXX (Allwinner H700, Mali-G31) at fixed spots in the Sierra 117 jungle and, from 2026-12-05 evening, at the start of The Covenant. How they are measured: PERFORMANCE.md.
2026-12-05 (evening): 11 fps in the jungle, and a harder benchmark: The Covenant

Numbers (median frame time over the 10-frame windows after frame 1000; “window worst” is each window’s slowest frame, given as the median and 95th percentile over the run):
| Scene | Build | Frame time | fps | Window worst (p50 / p95) |
|---|---|---|---|---|
| Sierra 117 jungle | morning’s | 95.1 ms | 10.5 | 97.9 / 101.8 ms |
| Sierra 117 jungle | this evening’s | 90.6 ms | 11.0 | 92.9 / 96.2 ms |
| The Covenant, start of the level | this evening’s | 122.5 ms | 8.2 | 126.2 / 132.9 ms |
Where the time goes. Three measurements at the jungle spot:
- Resolution scaling: 480x270 95 ms, 416x234 88 ms, 320x180 79 ms. Only about 30 ms of the frame scales with pixels; about 65 ms is a fixed cost (geometry, draw calls, the CPU). Going below 480x270 will not reach 30 fps and would look worse, so the resolution stays.
- Mali hardware counters: the GPU is busy 78% of the frame (fragment work 60%, vertex/tiler 20%). The other 22% it waits for the CPU.
- CPU profile: the render thread spends about half its time inside the Mali driver. About a fifth went to our own backend reading every draw’s vertex layout back from the upload buffer. That buffer is mapped uncached for the CPU, so every read went to DRAM. The backend now reads the copy the game side already holds in normal memory: 95.1 → 90.6 ms.
Measured and dropped: bilinear instead of trilinear texture filtering (the Mali filters trilinear at half rate). It made no measurable difference here, so the picture stays trilinear.
The Covenant is the new benchmark. Sierra 117’s opening is a quiet jungle. The Covenant (the eighth mission) starts in an open battle on a lakeshore: marines, the Arbiter, enemies firing, long views. It costs about 30% more per frame than the jungle. From now on numbers are reported for both.
What it surfaced:
- Memory is the next wall. The handhelds have 1 GB shared between the CPU and GPU. The Covenant reached ~840 MB and was killed once by the kernel’s out-of-memory killer. The game’s own memory is 413 MB and the Mali driver holds 271 MB (textures, buffers, compiled shaders). Being tested now: a 128-texel texture cap, smaller upload buffers, and not loading the game’s optional high-resolution resource data (which the texture cap discards anyway).
- White water. On the Mali the lake renders white in places. The same frames on a PC (Mesa, full precision) are correct. Half-precision math overflows in the water shaders, and anything above 65504 becomes infinity, which shows as white. The fix being tested: keep the water shaders at full precision and everything else at half.
- A measurement trap: the first run in a new level compiles its shaders on the handheld (336 programs, 7 minutes here). While it does, draws whose shaders are not ready are skipped, so that run looks faster than the game really is. Numbers here come from runs with every shader present.
2026-12-05: from 0.6 to 10.5 fps

Today’s work, in order, with the frame rate after each step.
| Step | fps | Frame time (worst) |
|---|---|---|
| The new OpenGL ES 3.2 renderer with the PC’s settings | 0.6 | ~1.7 s |
| The game’s 4-player split-screen detail row (fewer decorators, lower LODs, no dynamic shadows), no motion blur or particles | 0.8 | |
| Internal resolution 480x270 (Halo CE’s port renders 480x360 on the same chip) | 1.2 | |
| Leaner translated shaders: the opaque variant without alpha test, degamma only where a texture needs it | 2.3 | 440 ms |
| Vertex shaders specialised per vertex layout | 4.8 | 210 ms |
| The exposure readback no longer waits for the GPU; distant detail at half distance | 5.8 | 172 ms (178) |
| Resolve copies as render passes, framebuffers cached per texture | 6.4 | 157 ms (160) |
| Half-precision (mediump) fragment shaders | 7.2 | 139 ms (145) |
| The Xbox zero rule only in post-processing, NaN guard | 8.8 | 114 ms (118) |
| Distant detail at a quarter of its distance | 10.5 | 95 ms (98) |
What each step taught us:
- The GPU has one core. “Mali-G31 MP2” suggests two, but the driver and its core mask report a single shader core (as on other G31 chips). The Mali’s hardware counters now drive the work: early on, vertex shading took 56% of the GPU’s cycles.
- Vertex specialisation. The translated Xbox 360 vertex shaders decoded every vertex element at run time: format, endianness, stride. Compiling each vertex shader against the draw’s vertex layout lets the compiler fold that away, making vertex work about 3x cheaper (Mali Offline Compiler: 23 → 11 cycles for the most common shader).
- The measurement trap. Early numbers came from a profiler that calls glFinish at every pass, which itself serialises the CPU and GPU. Clean runs were faster than they looked, so every number since is profiler-free.
- Two CPU stalls in the Mali driver.
- The auto-exposure read a 1x1 texture back every frame and waited for the frame to finish. It now reads the previous frame’s value.
- Copying into a texture the GPU was still reading (glCopyImageSubData, glBlitFramebuffer, even glInvalidateFramebuffer) made the CPU wait 5 ms per copy, 18 copies a frame. The copies are now small render passes.
- Half precision is safe and fast on the hardware. The compiler’s estimate promised little, but the hardware gained 12%. Frame dumps from the handheld show no texture or lighting artifacts.
- The Xbox’s zero rule. On the Xbox 360, 0 times infinity is 0. The translated shaders imitated that on every multiply, which is slow. Material shaders do fine with normal IEEE maths; post-processing keeps the rule, because a single NaN pixel spreads through the bloom.
-
Half precision plus no zero rule produced the garbage below: tiny values flush to zero in half precision, 1/0 is infinity, and 0 × infinity is NaN. A one-line guard at the end of the affected shaders fixed it.
Before the guard After 

- Measured and dropped:
- Occlusion culling: only 0.9% of draws are fully hidden, because the game’s own culling is already tight.
- A selective albedo pass: drawing most objects once instead of twice saved only 9% at best, and broke some surfaces.
- Smaller textures and anisotropic filtering off: no gain.
Where a frame goes now: the albedo pass (every surface’s colour and normal) about 30% of GPU time, the lighting pass 46%, post-processing and copies most of the rest. By content, foliage is the largest single item (about 14%), then terrain, the most common material shader and one vertex shader (about 8% each).
Next: the lighting and foliage shaders, and a look at how the frame rate holds up when walking through the level.