Skip to content

feat(v81): shader-direct coalesced AHardwareBuffer VLA + HVX/l2fetch streaming (1,170 / 625 FPS, 3.88x vs GPU-only) - #51

Merged
saariuslystoned merged 2 commits into
mainfrom
feat/sm8850-v81-tiled-hmx-vla
Nov 30, 2026
Merged

saariuslystoned merged 2 commits into
mainfrom
feat/sm8850-v81-tiled-hmx-vla

Conversation

@saariuslystoned

Copy link
Copy Markdown
Contributor

Summary

Adds the clean-room v2 shader-direct tiled Adreno 840 <-> Hexagon v81 HMX AHardwareBuffer zero-copy VLA path (include/freehexagon_v81_tiled_abi.h, src/freehexagon_v81_tiled_skel.c, src/freehexagon_v81_tiled_kernels.S, shaders/adreno840/vla_stem_*_tiled.comp, tools/sm8850_v81_tiled_vla_abc.c), mirrored freesilicon-twin calibration receipt (sm8850-v81-tiled-vla-abc-calibrated.json), unit tests, and proof/sm8850-v81-tiled-vla/PROOF.md.

Key Verified Hardware Highlights (SM8850, Android 16, uid=2000, SELinux Enforcing=1, 150 Interleaved Frames/Arm)

  • Zero-Marshaling Persistent Arena (MAP_ARENA / HAP_mmap2 + RUN_PROJ_VA 64B RPC) + 128B HVX Dual-Issue vmem + l2fetch Streaming: Cuts on-DSP data movement (t_inv + t_a_load + t_c_store + t_flush) from 17.88 ms to 159.5 us at M=1024 (112x reduction; 46.1 GB/s DDR->VTCM, 59.4 GB/s VTCM->DDR).
  • Coalesced 4-Row/WG Adreno 840 Vision Stem (f16vec4 RGBA loads + packHalf2x16 32-bit coalesced F16Crouton_TCM stores): Identical vectorized stem used on Arm B and Arm C2 for 100% fair comparison.
  • M=256, N=1024, K=1024: Arm A 738.54 us p50 (1,170.04 FPS, 0 B host copy, 0 mismatches, nmse=3.55e-7) — 2.52x vs CPU-staged (1,863.96 us), 2.76x vs Adreno 840 GPU-only (2,037.60 us), 6.35x vs v1 baseline.
  • M=1024, N=1024, K=1024: Arm A 1,595.78 us p50 (624.94 FPS, 0 B host copy, 0 mismatches, nmse=3.59e-7) — 3.41x vs CPU-staged (5,442.76 us), 3.88x vs Adreno 840 GPU-only (6,196.93 us), 11.94x vs v1 baseline (19.06 ms).
  • Per-Phase On-DSP 19.2 MHz UTIMER Sub-Timers: t_inv, t_a_load, t_hmx_gemm, t_c_store, t_flush, t_dsp_total (plus t_hmx_pure with honest interleaved GPU+DSP contention note: 430.99 us vs 92.87 us standalone).

Verification

  • make clean && make verify (C11/C++17 -pedantic headers, full unit/mock suite, clean-room audit 0 errors across 170 files)
  • cmake -B build-cmake && cmake --build build-cmake -j && ctest --test-dir build-cmake --output-on-failure (31/31 PASS)
  • Host Clang ASan + UBSan on tests/test_freehexagon_v81_tiled.c and tools/sm8850_v81_tiled_vla_abc.c --mock (0 errors, 0 mismatches, nmse=0.0)
  • Android NDK r27c aarch64-linux-android34 PIE cross-compile (DT_NEEDED strictly [libdl.so, libm.so, libc.so])
  • proof/sm8850-v81-tiled-vla/PROOF.md

@saariuslystoned
saariuslystoned merged commit b8ca8fe into main Nov 30, 2026
5 checks passed
@saariuslystoned
saariuslystoned deleted the feat/sm8850-v81-tiled-hmx-vla branch November 30, 2026 16:17
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