XU XUv0.13.1
中文

Blog

Xu 0.11.3: borrowed native spans, ESP32 primitives and correctness fixes

2026-11-04 · Xu v0.11.3

Xu 0.11.3 brings synchronous native array borrowing, a pure Xu ESP32 backend and wireless protocol building blocks, plus repairs to numerical edge cases and owned string slices. Upgrade the compiler, standard library and product tools together.

Borrow i64 arrays across a native call

The opt-in xu-c-2 ABI maps i64_span and i64_span_mut to &[]int and $&[]int. Each call supplies a temporary C descriptor containing length and contiguous data. Native code may use it during the synchronous call; it must not retain either pointer, resize the array or take ownership. A writable span permits element writes. Register and stack arguments follow the selected platform C convention, including Win64 shadow space.

C2 currently accepts 64-bit integer scalars and int/void results. Existing C1 libraries remain usable; old products reject the new object/container version explicitly. Wrap native calls in a Xu function when a function value is needed. The native interoperability guide describes the boundary and linking requirements.

ESP32 compilation and protocol building blocks

The xtensa-esp32-none target emits Xtensa ELF directly, and the image tool verifies layout, XOR and SHA-256. ROM calls/callbacks, BLE ATT/HOGP and legacy pairing components are joined by bounded WPA2 handshake, key-data, CCMP, DHCP, ARP and ICMP primitives. The board evidence applies to ESP32-D0WD-V3 rev3.1 with a 40 MHz crystal and 4 MiB flash.

Applications still own the hardware event loop, keys, replay counters and DMA lifetime. Standard WifiDevice APIs continue to report that no driver is connected. Persistent station operation, lease renewal, DNS/TCP, Internet access and BLE/Wi-Fi coexistence remain outside this implementation. Read the Wi-Fi API and package limits before integrating the primitives.

Numerical and ownership correctness

Binary64 rounding preserves large integral values, signed zero and non-finite inputs. log(±0) now returns negative infinity; log(+Inf) and special inputs to frexp terminate. Full-width unsigned arithmetic uses both lanes and reports division errors. String-array slices now advance source descriptors in 24-byte units and retain independent ownership. SSA periodic-reduction proofs follow the actual loop backedge, and narrow-result normalization uses the target's physical register width.

Installation and measurements

Windows SDK installers embed an asInvoker manifest for current-user startup. All-users installation still requires administrator privileges. Get the complete SDK from Downloads, verify SHA256SUMS, and read the full release notes.

The benchmark dashboard identifies the compiler, source commit and workload set for every dataset. New release measurements are accepted only after all six platforms complete their correctness and provenance checks.

The first complete measurement run covers 72 workloads across six native platforms at release source 2d1739f. Xu passed all 432 platform-workload output checks. One Windows x64 Go http_concurrent comparison failed with an OS socket-resource error; it has no metrics, ratio or ranking. The dataset and dashboard retain its diagnostic.