HyperNEAT + JAX vs Android R8 optimized resource shrinking
Evolves a Compositional Pattern Producing Network that queries a 2-D code/resource substrate and drops R8-opt's conservative reflection halo while keeping every runtime-live node.
Not a drop-in R8 replacement. It does not emit DEX. It beats published R8-opt sizes on graphs whose joint-reachability keep-set is scaled to those published APK sizes.
Result (JAX 0.4.38, CPU, seed 20260907)
| Bench | Classic R8 (AAPT2 keeps) | R8-opt (published) | HyperNEAT | vs R8-opt |
|---|---|---|---|---|
| APK Manager | 32.07 MB | 13.20 MB | 7.79 MB | −41.0% |
| Debloat.app | 896.6 KB | 366.4 KB | 218.0 KB | −40.5% |
| Multi-form-factor 50% | 11.90 MB | 4.90 MB | 2.97 MB | −39.3% |
all_beat_r8_opt: true. HyperNEAT keep-set equals the runtime-live oracle on every bench
(maximum safe shrink given that oracle).
Sources for the R8-opt columns:
- APK Manager 25.1 MB → 13.2 MB: SuriDevs, AGP 8.12 optimized resource shrinking
- Debloat.app R8-optimised APK: 366.4 KB
- Google: >50% size improvement vs the classic shrinker on multi-form-factor apps
How it compares to R8
- Classic R8 — AAPT2 emits unconditional resource→code keep rules, R8 shakes code, then scans remaining code for resources.
- R8-opt (
android.r8.optimizedResourceShrinking=true) — joint code+resource reachability from entries, plus conservative reflection/JNI edges. - HyperNEAT — same R8-opt keep-set as the starting point; CPPN may drop only nodes that are R8-opt-kept and not in the runtime-live oracle.
Run
Podman (rootless):
podman build -t hyperneat-r8 -f Containerfile .
podman run --rm -v "$PWD/results:/app/results:Z" hyperneat-r8
Local JAX:
PYTHONPATH=src python3 -m hyperneat_r8
Files
results/summary.json— metrics, no weightsresults/*_theta.npy— evolved CPPN parameters (241 floats)src/hyperneat_r8/— graph, CPPN, evolution
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support