Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,37 @@ if (FREESCHED_BUILD_TESTS)
add_test(NAME freehexagon_hmx_bench_selftest
COMMAND freehexagon_hmx_bench --self-test)

add_executable(test_freehexagon_vla_abc tests/test_freehexagon_vla_abc.c src/freehexagon_vla_skel.c)
target_include_directories(test_freehexagon_vla_abc PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/src)
set_target_properties(test_freehexagon_vla_abc PROPERTIES
C_STANDARD 11
C_STANDARD_REQUIRED ON
C_EXTENSIONS OFF
)
target_compile_options(test_freehexagon_vla_abc PRIVATE -Wall -Wextra -Werror)
if (UNIX AND NOT APPLE)
target_link_libraries(test_freehexagon_vla_abc PRIVATE m pthread)
elseif (APPLE)
target_link_libraries(test_freehexagon_vla_abc PRIVATE m)
endif()
add_test(NAME test_freehexagon_vla_abc COMMAND test_freehexagon_vla_abc)

add_executable(iq9075_vla_abc_killtest tools/iq9075_vla_abc_killtest.c src/freehexagon_vla_skel.c)
target_include_directories(iq9075_vla_abc_killtest PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/src)
set_target_properties(iq9075_vla_abc_killtest PROPERTIES
C_STANDARD 11
C_STANDARD_REQUIRED ON
C_EXTENSIONS OFF
)
target_compile_options(iq9075_vla_abc_killtest PRIVATE -Wall -Wextra -Werror)
if (UNIX AND NOT APPLE)
target_link_libraries(iq9075_vla_abc_killtest PRIVATE m pthread ${CMAKE_DL_LIBS})
elseif (APPLE)
target_link_libraries(iq9075_vla_abc_killtest PRIVATE m pthread)
endif()
add_test(NAME iq9075_vla_abc_killtest_mock
COMMAND iq9075_vla_abc_killtest --mock --shapes 256 --warmup 0 --iters 1 --json)

add_executable(test_freesched tests/test_freesched.cpp)
target_link_libraries(test_freesched PRIVATE freesched)
target_compile_features(test_freesched PRIVATE cxx_std_17)
Expand Down
19 changes: 17 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ HDRS := \
$(THIS_DIR)/include/freehexagon_fh4.h \
$(THIS_DIR)/include/freehexagon_llm_abi.h \
$(THIS_DIR)/include/freehexagon_hmx_abi.h \
$(THIS_DIR)/include/freehexagon_vla_abi.h \
$(THIS_DIR)/src/fs_internal.h

OBJS := $(patsubst $(THIS_DIR)/src/%.cpp,$(BUILD_DIR)/obj/%.o,$(SRCS)) \
Expand All @@ -84,6 +85,8 @@ TEST_LLM := $(BUILD_DIR)/test_freehexagon_llm
LLM_RUNNER := $(BUILD_DIR)/freehexagon_llm_runner
TEST_HMX := $(BUILD_DIR)/test_freehexagon_hmx
HMX_BENCH := $(BUILD_DIR)/freehexagon_hmx_bench
TEST_VLA := $(BUILD_DIR)/test_freehexagon_vla_abc
VLA_BENCH := $(BUILD_DIR)/iq9075_vla_abc_killtest
FH_LIVE := $(BUILD_DIR)/freehexagon_vlut_live
FH_OBJS := $(BUILD_DIR)/obj/freehexagon_session.o $(BUILD_DIR)/obj/freehexagon_vlut.o $(BUILD_DIR)/obj/freehexagon_fastrpc.o
BENCH_BIN := $(BUILD_DIR)/bench_heterogeneous
Expand All @@ -108,7 +111,7 @@ ANDROID_OBJS := $(patsubst $(THIS_DIR)/src/%.cpp,$(ANDROID_BUILD)/obj/%.o,$(

.PHONY: all lib test twin-test smoke bench verify-headers audit verify android-arm64 clean

all: lib $(TEST_C11) $(TEST_CXX) $(TEST_IQ) $(TEST_VKPR) $(TEST_PC) $(TEST_MOE) $(TEST_RR) $(TEST_FSB) $(TEST_FH) $(TEST_FHFR) $(TEST_DSP) $(DSP_BENCH) $(TEST_LLM) $(LLM_RUNNER) $(TEST_HMX) $(HMX_BENCH) $(FH_LIVE) $(BENCH_BIN) $(MOE_BENCH) $(SMOKE_BIN) $(VKPR_BIN) $(TEST_SPIRV) $(SPIRV_BENCH) $(PC_BIN) $(RR_BIN) $(FSB_BIN)
all: lib $(TEST_C11) $(TEST_CXX) $(TEST_IQ) $(TEST_VKPR) $(TEST_PC) $(TEST_MOE) $(TEST_RR) $(TEST_FSB) $(TEST_FH) $(TEST_FHFR) $(TEST_DSP) $(DSP_BENCH) $(TEST_LLM) $(LLM_RUNNER) $(TEST_HMX) $(HMX_BENCH) $(TEST_VLA) $(VLA_BENCH) $(FH_LIVE) $(BENCH_BIN) $(MOE_BENCH) $(SMOKE_BIN) $(VKPR_BIN) $(TEST_SPIRV) $(SPIRV_BENCH) $(PC_BIN) $(RR_BIN) $(FSB_BIN)

lib: $(LIB)

Expand Down Expand Up @@ -165,6 +168,14 @@ $(HMX_BENCH): $(THIS_DIR)/tools/freehexagon_hmx_bench.c $(THIS_DIR)/src/freehexa
@mkdir -p $(dir $@)
$(HOST_CC) -std=c11 -O2 -Wall -Wextra -Werror -I$(THIS_DIR)/include $(THIS_DIR)/tools/freehexagon_hmx_bench.c $(THIS_DIR)/src/freehexagon_hmx_skel.c -o $@ $(LDFLAGS)

$(TEST_VLA): $(THIS_DIR)/tests/test_freehexagon_vla_abc.c $(THIS_DIR)/src/freehexagon_vla_skel.c $(THIS_DIR)/include/freehexagon_vla_abi.h $(THIS_DIR)/src/vla_spirv_embed.h
@mkdir -p $(dir $@)
$(HOST_CC) -std=c11 -O2 -Wall -Wextra -Werror $(INCS) $(THIS_DIR)/tests/test_freehexagon_vla_abc.c $(THIS_DIR)/src/freehexagon_vla_skel.c -o $@ -lm -lpthread

$(VLA_BENCH): $(THIS_DIR)/tools/iq9075_vla_abc_killtest.c $(THIS_DIR)/src/freehexagon_vla_skel.c $(THIS_DIR)/include/freehexagon_vla_abi.h $(THIS_DIR)/src/vla_spirv_embed.h
@mkdir -p $(dir $@)
$(HOST_CC) -std=c11 -O2 -Wall -Wextra -Werror $(INCS) $(THIS_DIR)/tools/iq9075_vla_abc_killtest.c $(THIS_DIR)/src/freehexagon_vla_skel.c -o $@ $(LDFLAGS)

# Standalone live-silicon tool: links only the FreeHexagon C11 objects.
$(FH_LIVE): $(THIS_DIR)/tools/freehexagon_vlut_live.c $(FH_OBJS) $(HDRS)
@mkdir -p $(dir $@)
Expand Down Expand Up @@ -264,10 +275,12 @@ verify-headers: $(THIS_DIR)/include/freesched.h $(THIS_DIR)/include/fs_vk_adreno
$(HOST_CXX) -x c++ -std=c++17 -pedantic -fsyntax-only -Wall -Wextra -Werror -I$(THIS_DIR)/include $(THIS_DIR)/include/freehexagon_llm_abi.h
$(HOST_CC) -x c -std=c11 -pedantic -fsyntax-only -Wall -Wextra -Werror -I$(THIS_DIR)/include $(THIS_DIR)/include/freehexagon_hmx_abi.h
$(HOST_CXX) -x c++ -std=c++17 -pedantic -fsyntax-only -Wall -Wextra -Werror -I$(THIS_DIR)/include $(THIS_DIR)/include/freehexagon_hmx_abi.h
$(HOST_CC) -x c -std=c11 -pedantic -fsyntax-only -Wall -Wextra -Werror -I$(THIS_DIR)/include $(THIS_DIR)/include/freehexagon_vla_abi.h
$(HOST_CXX) -x c++ -std=c++17 -pedantic -fsyntax-only -Wall -Wextra -Werror -I$(THIS_DIR)/include $(THIS_DIR)/include/freehexagon_vla_abi.h
$(HOST_CC) -x c -std=c11 -pedantic -fsyntax-only -Wall -Wextra -Werror -I$(THIS_DIR)/include $(THIS_DIR)/include/fs_vk_adreno_spirv.h
$(HOST_CXX) -x c++ -std=c++17 -pedantic -fsyntax-only -Wall -Wextra -Werror -I$(THIS_DIR)/include $(THIS_DIR)/include/fs_vk_adreno_spirv.h

test: $(TEST_C11) $(TEST_CXX) $(TEST_IQ) $(TEST_VKPR) $(TEST_PC) $(TEST_MOE) $(TEST_RR) $(TEST_FSB) $(TEST_FH) $(TEST_FHFR) $(TEST_DSP) $(DSP_BENCH) $(TEST_LLM) $(LLM_RUNNER) $(TEST_HMX) $(HMX_BENCH) $(FH_LIVE) $(BENCH_BIN) $(MOE_BENCH) $(SMOKE_BIN) $(VKPR_BIN) $(TEST_SPIRV) $(SPIRV_BENCH) $(PC_BIN) $(RR_BIN) $(FSB_BIN) twin-test
test: $(TEST_C11) $(TEST_CXX) $(TEST_IQ) $(TEST_VKPR) $(TEST_PC) $(TEST_MOE) $(TEST_RR) $(TEST_FSB) $(TEST_FH) $(TEST_FHFR) $(TEST_DSP) $(DSP_BENCH) $(TEST_LLM) $(LLM_RUNNER) $(TEST_HMX) $(HMX_BENCH) $(TEST_VLA) $(VLA_BENCH) $(FH_LIVE) $(BENCH_BIN) $(MOE_BENCH) $(SMOKE_BIN) $(VKPR_BIN) $(TEST_SPIRV) $(SPIRV_BENCH) $(PC_BIN) $(RR_BIN) $(FSB_BIN) twin-test
FREESCHED_MOCK=1 $(TEST_C11)
FREESCHED_MOCK=1 $(TEST_CXX)
FREESCHED_MOCK=1 $(TEST_IQ)
Expand All @@ -280,6 +293,8 @@ test: $(TEST_C11) $(TEST_CXX) $(TEST_IQ) $(TEST_VKPR) $(TEST_PC) $(TEST_MOE) $(T
$(LLM_RUNNER) --self-test --json > /dev/null
$(TEST_HMX)
$(HMX_BENCH) --self-test > /dev/null
$(TEST_VLA)
$(VLA_BENCH) --mock --shapes 256 --warmup 0 --iters 1 --json > /dev/null
$(FH_LIVE) --mock dual --json
$(FH_LIVE) --mock single
$(FH_LIVE) --mock signed-pd
Expand Down
166 changes: 166 additions & 0 deletions include/freehexagon_vla_abi.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
/* SPDX-License-Identifier: Apache-2.0 */
/*
* freehexagon_vla_abi.h - IQ-9075 (QCS9075) Vision-to-Projection VLA
* Kill-Test ABI, shared verbatim by libfreehexagon_vla_skel.so (32-bit
* Hexagon v73 freestanding skeleton) and iq9075_vla_abc_killtest (64-bit
* host C11 runner). Reuses the live-silicon-verified Phase 4C HMX ABI
* conventions: FH scalars packing, F16Crouton_TCM swizzles, CRM lifecycle
* status reporting, and 128B-aligned heap pra buffers (never rpcmem ptrs
* in inline pra scalar slots; large buffers travel via remote_mem_map
* DSP VAs carried inside fh_vla_run_in_t).
*/
#ifndef FREEHEXAGON_VLA_ABI_H
#define FREEHEXAGON_VLA_ABI_H

#include <stddef.h>
#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#define FH_VLA_ASSERT(c, m) static_assert((c), m)
#else
#define FH_VLA_ASSERT(c, m) _Static_assert((c), m)
#endif

#define FH_VLA_MAGIC 0x46564C41u /* "FVLA" */
#define FH_VLA_ABI_VERSION 1u

#define FH_VLA_OK 0
#define FH_VLA_EFAILED (-1)
#define FH_VLA_EBADPARM (-2)
#define FH_VLA_EUNSUPPORTED (-3)
#define FH_VLA_EBADSTATE (-4)

#define FH_VLA_SCALARS_MAKE(method, nIn, nOut) \
((uint32_t)(((uint32_t)(method) << 24) | ((uint32_t)(nIn) << 16) | \
((uint32_t)(nOut) << 8)))
#define FH_VLA_SCALARS_METHOD(sc) (((sc) >> 24) & 0x1Fu)

#define FH_VLA_METHOD_PING 0u
#define FH_VLA_METHOD_INIT 1u
#define FH_VLA_METHOD_LOAD_WEIGHTS 2u /* pra: in, W_proj[N*K] f16, out */
#define FH_VLA_METHOD_RUN_PROJ 3u /* pra: run_in, run_out (A/C via VA) */
#define FH_VLA_METHOD_RUN_FULL 4u /* pra: run_in, run_out (frame via VA) */
#define FH_VLA_METHOD_SHUTDOWN 5u

#define FH_VLA_F_USE_HW (1u << 0)
#define FH_VLA_F_TURBO (1u << 1)

#define FH_VLA_CVT_RELU 0x00000000u
#define FH_VLA_CVT_NOP 0x00000002u
#define FH_VLA_CVT_NOP_B7 0x00000082u

/* Fixed pipeline geometry (K = N = 1024, frame 512x512 RGBA16F). */
#define FH_VLA_FRAME_W 512u
#define FH_VLA_FRAME_H 512u
#define FH_VLA_FRAME_C 4u
#define FH_VLA_FRAME_BYTES (512u * 512u * 4u * 2u) /* 2 MiB */
#define FH_VLA_K 1024u
#define FH_VLA_N 1024u
#define FH_VLA_K_TILES 32u
#define FH_VLA_N_TILES 32u
#define FH_VLA_WPROJ_BYTES (1024u * 1024u * 2u) /* 2 MiB */
#define FH_VLA_WSTEM_ELEMS (1024u * 16u) /* W_stem[1024][16] */
#define FH_VLA_STEM_BYTES ((1024u * 16u + 1024u) * 2u) /* + b_stem[1024] */
#define FH_VLA_MAX_M 1024u
#define FH_VLA_TILE_BYTES 2048u

/* VTCM layout per HTP (checked against the 8 MiB budget at INIT/RUN):
* W_proj packed 2 MiB | bs256 2048 B | A_half <= 1 MiB | C_half <= 1 MiB
* = 4.002 MiB <= 8.0 MiB. All offsets 2048B aligned. */
#define FH_VLA_VTCM_OFF_W 0u
#define FH_VLA_VTCM_OFF_BS (32u * 32u * 2048u) /* 2 MiB */
#define FH_VLA_VTCM_OFF_A (FH_VLA_VTCM_OFF_BS + 2048u)
#define FH_VLA_VTCM_OFF_C (FH_VLA_VTCM_OFF_A + 16u * 32u * 2048u)
#define FH_VLA_VTCM_NEED (FH_VLA_VTCM_OFF_C + 16u * 32u * 2048u)

#define FH_VLA_SYM_HAP_POWER (1u << 0)
#define FH_VLA_SYM_CRM_INIT (1u << 1)
#define FH_VLA_SYM_CRM_VTCM (1u << 2)
#define FH_VLA_SYM_CRM_HMX_PARAM (1u << 3)
#define FH_VLA_SYM_CRM_ACQUIRE (1u << 4)
#define FH_VLA_SYM_CRM_GET_VTCM (1u << 5)
#define FH_VLA_SYM_CRM_HMX_LOCK (1u << 6)
#define FH_VLA_SYM_CRM_HMX_UNLOCK (1u << 7)
#define FH_VLA_SYM_CRM_RELEASE (1u << 8)
#define FH_VLA_SYM_HVX_LOCK (1u << 9)

typedef struct { uint32_t magic; uint32_t reserved[3]; } fh_vla_ping_in_t;
typedef struct {
uint32_t magic, abi_version, is_hexagon, live_isa_compiled, sym_mask, reserved;
uint64_t utimer_before, utimer_after;
} fh_vla_ping_out_t;

typedef struct {
uint32_t magic, flags, vtcm_req_mb, timeout_us;
} fh_vla_init_in_t;
typedef struct {
uint32_t magic;
int32_t status, turbo_rc, hmx_pwr_rc;
uint32_t ctx_id, vtcm_bytes, vtcm_addr_low, eff_mhz_x1000, sym_mask;
uint32_t live_isa_compiled;
uint64_t utimer_delta, pcycle_delta;
} fh_vla_init_out_t;

typedef struct { uint32_t magic, flags, n, k; } fh_vla_load_in_t;
typedef struct {
uint32_t magic;
int32_t status;
uint32_t used_vtcm, reserved;
uint64_t utimer_delta, pcycle_delta;
} fh_vla_load_out_t;

/* RUN_PROJ: A_crouton half at dsp_va_a -> C_crouton half at dsp_va_c.
* RUN_FULL: frame at dsp_va_frame, stem blob (W_stem|b_stem) at
* dsp_va_stem -> C_crouton half at dsp_va_c. VAs are DSP VAs from
* remote_mem_map(domain, fd, 0, 0, size, &va) on live silicon, and host
* pointers in mock mode (identical struct layout on host and Hexagon). */
typedef struct {
uint32_t magic, m, n, k, mt_start, mt_count, flags, reserved;
uint64_t dsp_va_a, dsp_va_c, dsp_va_frame, dsp_va_stem;
} fh_vla_run_in_t;
typedef struct {
uint32_t magic;
int32_t status, hmx_lock_rc, hmx_unlock_rc;
uint32_t used_hmx, used_vtcm;
uint64_t utimer_start, utimer_end, pcycle_start, pcycle_end;
} fh_vla_run_out_t;

typedef struct { uint32_t magic; uint32_t reserved[3]; } fh_vla_shutdown_in_t;
typedef struct {
uint32_t magic;
int32_t status, release_rc, pwr_off_rc;
} fh_vla_shutdown_out_t;

typedef struct {
void *buf;
uint32_t len;
#if !defined(__hexagon__)
uint32_t reserved_pad;
#endif
} fh_vla_remote_arg_t;

int freehexagon_vla_skel_invoke(uint32_t sc, fh_vla_remote_arg_t *pra);
int freehexagon_vla_skel_handle_invoke(uint64_t h, uint32_t sc,
fh_vla_remote_arg_t *pra);
int skel_invoke(uint32_t sc, fh_vla_remote_arg_t *pra);

FH_VLA_ASSERT(sizeof(fh_vla_ping_in_t) == 16u, "ping_in 16B");
FH_VLA_ASSERT(sizeof(fh_vla_ping_out_t) == 40u, "ping_out 40B");
FH_VLA_ASSERT(sizeof(fh_vla_init_in_t) == 16u, "init_in 16B");
FH_VLA_ASSERT(sizeof(fh_vla_init_out_t) == 56u, "init_out 56B");
FH_VLA_ASSERT(sizeof(fh_vla_load_in_t) == 16u, "load_in 16B");
FH_VLA_ASSERT(sizeof(fh_vla_load_out_t) == 32u, "load_out 32B");
FH_VLA_ASSERT(sizeof(fh_vla_run_in_t) == 64u, "run_in 64B");
FH_VLA_ASSERT(sizeof(fh_vla_run_out_t) == 56u, "run_out 56B");
FH_VLA_ASSERT(sizeof(fh_vla_shutdown_in_t) == 16u, "shut_in 16B");
FH_VLA_ASSERT(sizeof(fh_vla_shutdown_out_t) == 16u, "shut_out 16B");
FH_VLA_ASSERT(FH_VLA_VTCM_NEED == 4196352u, "VTCM need 4.002 MiB");
FH_VLA_ASSERT(FH_VLA_VTCM_NEED <= 8u * 1024u * 1024u, "VTCM budget");

#undef FH_VLA_ASSERT

#ifdef __cplusplus
}
#endif
#endif /* FREEHEXAGON_VLA_ABI_H */
73 changes: 73 additions & 0 deletions proof/multi-soc-twin-vla-abc/PROOF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<!--
Copyright 2026 FreeSilicon Contributors
SPDX-License-Identifier: Apache-2.0
-->

# Multi-SoC Calibrated `freesilicon-twin` Receipts & Heterogeneous VLA 3-Arm A/B/C Proof

Clean-room summary of released-chip hardware measurements across three Qualcomm
SoCs (`QCS9075`, `QCS8275`, and `SM8850`), packaged as four schema-validated
`freesilicon-twin` calibration receipts (**53 live silicon points**) plus the
reproducible heterogeneous VLA 3-arm A/B/C benchmark (`tools/iq9075_vla_abc_killtest.c`,
`src/freehexagon_vla_skel.c`, `shaders/adreno663/vla_*.comp`).

---

## 1. Bundled Clean-Room `freesilicon-twin` Receipts (`53` Live Points Across `3` SoCs)

Mirrored identically in `twin/receipts/` and `python/freesilicon_twin/data/receipts/`:

| Receipt | Target | Points | Verified Hardware Highlights |
| --- | --- | ---: | --- |
| `qcs9075-hmx-fp16-calibrated.json` | `iq9075` | 16 | Dual Hexagon v73 HMX FP16 (`1459.15 MHz`, `16 MiB` VTCM): `5.9765 TFLOPS` single-HTP / **`11.9512 TFLOPS`** dual-HTP (`1024^3`, `179.688 us`, `2.000x` scaling, `0` mismatches, hardware ReLU verified). |
| `qcs9075-vla-abc-calibrated.json` | `iq9075` | 8 | Interleaved 3-arm A/B/C vision-to-projection pipeline (`150` frames/arm, `M=256` & `M=1024`, `Adreno 663` + Dual Hexagon v73 HMX + `SYNC_FD` DMA-BUF, `0` mismatches). |
| `iq8275-ventuno-q-calibrated.json` | `iq8275-ventuno-q` | 24 | Arduino VENTUNO Q (`QCS8275`, non-root `uid=1000`, Linux `6.8`): single Hexagon v73 (`1497.58 MHz`, `8 MiB` VTCM, `36.15 us` HVX `M=1`, **`0.6799 TFLOPS`** HMX FP16 `~454 FLOPs/cycle`) + open-source Mesa Turnip `Adreno623` 3-way zero-copy DMA-BUF (`bit_exact=true`, `0` mismatches). |
| `sm8850-v81-calibrated.json` | `sm8850-v81` | 5 | Snapdragon 8 Elite Gen 5 (`SM8850`, Android 16, `uid=2000`, `SELinux Enforcing=1`): 3/4 portability gates PASS (`8x128B` HVX, `8 MiB` VTCM, `1708.73 MHz`, `16 MiB` `AHardwareBuffer` Adreno 840 Vulkan <-> CDSP zero-copy `0` mismatches, **`6.094 us`** `vk_sync_fd` p50, **`2.448 us`** `dmabuf_sync` p50); v73 HMX FP16 binary is **not** forward-compatible on v81 (`g3_v73_hmx_forward_compat_on_v81=false`). |

---

## 2. Live QCS9075 Heterogeneous VLA 3-Arm A/B/C Scoreboard (`150` Interleaved Frames/Arm)

Pipeline: `512x512x4` FP16 frame -> 3x3 Gaussian spatial filter + per-channel
affine + 4x4 patch sub-grid pool (`S[M,64]` FP16) -> grouped-4 channel stem +
ReLU (`A[M,1024]` FP16) -> `[M,1024] x [1024,1024]` FP16 projection ->
`F16Crouton_TCM` output + per-frame `DMA_BUF_IOCTL_SYNC` CPU-visible touch.
Arm order rotates every frame `{A, B, C1, C2}` (`warmup=20`, `iters=150`,
`Adreno (TM) 663` + dual-HTP `1459.22 MHz`, `hmx_used=true`, `sync_fd_used=true`).

| Shape | Arm | `p50` (`us`) | `p95` (`us`) | `FPS` | `host_copy` | `pd_iova` | `nmse` | `mismatches` |
| --- | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
| `M=256` | **A: Zero-Copy DMA-BUF `SYNC_FD` (Adreno + Dual-HTP HMX)** | **6,122.7** | **7,522.6** | **163.0** | **0 B** | 4.0 MiB | `1.63e-8` | **0** |
| `M=256` | B: CPU-Staged Copy (Adreno -> CPU pack -> Dual-HTP HMX) | 6,791.7 | 9,749.7 | 137.0 | 524 KiB | 4.0 MiB | `1.63e-8` | 0 |
| `M=256` | C1: Unsplit Dual-HTP Only | 61,368.3 | 61,901.7 | 16.3 | 0 B | 4.04 MiB | `6.34e-10` | 0 |
| `M=256` | C2: Unsplit Adreno 663 GPU Only | 19,483.6 | 20,171.0 | 52.2 | 0 B | 0 B | `4.75e-5`\* | 0 |
| `M=1024` | **A: Zero-Copy DMA-BUF `SYNC_FD` (Adreno + Dual-HTP HMX)** | **13,330.4** | **17,598.2** | **71.5** | **0 B** | 4.0 MiB | `1.13e-8` | **0** |
| `M=1024` | B: CPU-Staged Copy (Adreno -> CPU pack -> Dual-HTP HMX) | 14,573.0 | 17,604.0 | 67.0 | 2.0 MiB | 4.0 MiB | `1.13e-8` | 0 |
| `M=1024` | C1: Unsplit Dual-HTP Only | 154,722.3 | 155,744.6 | 6.5 | 0 B | 4.04 MiB | `3.96e-10` | 0 |
| `M=1024` | C2: Unsplit Adreno 663 GPU Only | 67,279.9 | 68,843.2 | 16.8 | 0 B | 0 B | `3.21e-5`\* | 0 |

\* All four arms computed the identical mathematical graph with **`0` mismatches**
and **`0` NaN/Inf**. Arm C2 (`gpu_only`) recorded `nmse = 3.21e-5..4.75e-5`
(`max_abs_err = 0.0011`) solely because GLSL `dot(f16vec4, f16vec4)` rounds each
4-element partial dot product in 10-bit FP16 before FP32 accumulation across
`K=1024`, whereas Hexagon HMX FP16 accumulates internally in FP32
(`nmse = 1.13e-8..1.63e-8`).

### Key Takeaways
- **Heterogeneous Split (`Arm A` vs Unsplit `C1` & `C2`)**: **`2.68x` to `8.85x` faster `p95`** (`8.23x` vs `C1` / `2.68x` vs `C2` at `M=256`; `8.85x` vs `C1` / `3.91x` vs `C2` at `M=1024`).
- **Zero-Copy vs CPU-Staged (`Arm A` vs `Arm B`)**: Real **`+9%` to `+30%`** latency gain (`1.30x` `p95` at `M=256`, `-2.23 ms`; `1.09x` `p50` at `M=1024`) with **`0 B` host DRAM copy bandwidth**; below the strict `1.5x` (`<= 0.67x`) A/B standalone gate because the Adreno vision stem dominates wall time over the `1–2 ms` CPU copy/swizzle.

---

## 3. Reproducible Offline Verification

```sh
# 1. C11/C++17 headers, full unit/mock test suite, and clean-room audit
make clean && make verify

# 2. CMake + CTest verification
cmake -B build-cmake && cmake --build build-cmake -j && ctest --test-dir build-cmake --output-on-failure

# 3. Upstream LLVM Hexagon v73 DSP skeleton ELF + HMX opcode verification
FH_DOCKER_IMAGE=<arm64-llvm-image> bash scripts/build_freehexagon_vla_dsp.sh
```
12 changes: 11 additions & 1 deletion python/freesilicon_twin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@
)
from .map_elites import FeatureAxis, MapElitesArchive, StagnationSignal, default_axes
from .profiles import apply_profile_overlay, list_targets, load_profile, load_profile_overlay
from .receipt import SolarReceipt
from .receipt import (
RECEIPT_VERSION,
SolarReceipt,
list_bundled_receipts,
load_bundled_receipt,
validate_calibration_receipt,
)
from .roofline import (
eval_directional_handoff_us,
eval_profile_thermal_watts,
Expand All @@ -31,7 +37,11 @@
__all__ = [
"__version__",
"SCHEMA_VERSION",
"RECEIPT_VERSION",
"SolarReceipt",
"list_bundled_receipts",
"load_bundled_receipt",
"validate_calibration_receipt",
"FeatureAxis",
"MapElitesArchive",
"StagnationSignal",
Expand Down
Loading
Loading