Haxe/HashLink release readiness

This page summarizes the stabilized Haxe/HashLink public surface and the checks that should pass before publishing a HashLink package or calling a backend build supported.

Public API classification

ClassAPIsStatusPolicy
Final typed APIsContext.create, Tensor<T>, Field<T>, StructTensor<S>, StructField<S>, typed Kernel.build, Spec<T>, QdArgs, QdStruct, typed quadrants.algorithms, quadrants.linalg, quadrants.mesh, quadrants.quant, Tape, streams, graph helpersRecommended for user codeSource compatibility is subordinate to the typed API and safety guarantees. Do not add compatibility shims for removed raw/legacy paths.
Capability-gated APIsstream events, multi-block Graph.parallel, DLPack/external pointer import, CUDA/GL interop, native sparse acceleration, backend memory profilerPublic when capability probes report supportUser code must branch on ctx.capabilities() or extension probes. Unsupported paths should raise explicit errors.
Diagnostic / ABI boundariesinternal raw launch arrays, typed-tape replay args, diagnostics snapshots, profiler summaries, CUDA/GL glBuffer:Dynamic, helper Class<Dynamic> listsPermanent but narrowThese are documented in HashLink public Dynamic boundaries and are not precedents for normal public API typing.

Backend support matrix

Feature familyCPU / LLVM-backed hostCUDA / AMDGPU / Vulkan / Metal
Primitive tensors/fields, typed kernels, descriptor validationDefault runtime semantic gateAvailable when the native backend is compiled in and the driver/runtime is visible to hl.
Field/SNode placement, layout order, offsetsRuntime-testedDescriptor/native lowering is shared; backend coverage depends on native SNode support.
AD/Tape/custom gradientsRuntime-tested for supported control flow and floating dtypesBackend-gated through native autodiff/codegen support. Dynamic reverse/validation AD for while remains a core limitation and must fail explicitly.
Streams/events/graphCPU covers launch, graph launch, host/native graph loops, and unsupported event pathsCUDA/AMDGPU optional tests cover stream-event ordering and multi-stream Graph.parallel; CPU stream events are not a supported native feature.
Algorithms/linalgRuntime-tested reference semanticsUsable where scalar control-flow kernels are supported; performance-tuned device algorithms are backend-specific.
Device linalg helpersKernel semantic coverage for scalar helpers and LinalgDevice aggregate facadeLower through normal kernel helper inlining.
SparseF32/F64 COO/CSR native bulk bridge, MatrixMarket roundtrip, matvec, explicit solver fallback, duplicate/invalid-input validationcaps.sparse.nativeBackend reports acceleration when a native backend exists; semantic bridge remains separate from acceleration.
MeshHost save/load/reorder, relation/attribute kernel params, index conversion, Mesh.for* loopsMesh resource descriptors lower through relation-carried metadata; backend support follows native mesh capability.
QuantQuantized tensor kernel parameters, quant-array/bit-struct placement, saturation/rounding testsUnsupported quant forms fail descriptor/capability validation.
Profiler/diagnosticsKernel profiler, scoped trace events, memory availability, and typed byte countersProbe through caps.profiler; memory counters are backend-defined.

Default release gate

A normal CPU/LLVM HashLink release build should run:

ctest --test-dir build/hashlink-cpu-clang --output-on-failure

The expected default CTest entries are:

hashlink_haxe_compile
haxe_v3_smoke
hashlink_v3_runtime_semantic
hashlink_descriptor_golden
hashlink_macro_compile_fail
hashlink_public_dynamic_scan
hashlink_package_validate

What they cover:

TestPurpose
hashlink_haxe_compile / haxe_v3_smokeCompile and run the package smoke program.
hashlink_v3_runtime_semanticRuntime semantic coverage for typed kernels, QdArgs/QdStruct, tensors/fields/SNodes, AD/Tape, streams/graph, algorithms/linalg, sparse/mesh/quant, diagnostics, profiler, and version checks.
hashlink_descriptor_goldenDescriptor schema snapshots and validation behavior.
hashlink_macro_compile_failUser-facing macro diagnostics for unsupported syntax, dtype mismatches, resource misuse, stream misuse in kernel bodies, invalid mesh/quant forms, and removed API surfaces.
hashlink_public_dynamic_scanEnsures public Dynamic use remains confined to documented boundaries.
hashlink_package_validateBuilds a Haxe-interface haxelib zip and validates metadata, source layout, selected native symbols/runtime bitcode, and package contents.

When building CUDA or AMDGPU support, also run the optional backend-depth CTest entries if they are registered:

hashlink_v3_cuda_backend_semantic
hashlink_v3_amdgpu_backend_semantic

These tests are allowed to report a structured skip when no device/runtime is available, but they should pass on machines that claim backend support.

Performance and benchmarks

benchmarks/hashlink/BenchmarkMain.hx emits JSON timing data without pass/fail thresholds. Keep performance policy outside the public API so local hardware variance does not create false failures.

For examples or ad-hoc release smoke tests, quadrants.compat.PerfBaseline.measure(label, iterations, body) records elapsed seconds and seconds per iteration:

var sample = PerfBaseline.measure("small-copy", 10, function() {
  ctx.sync();
});
trace(sample.secondsPerIteration);

Documentation checklist

For every public API or behavior change:

Packaging checklist

  • Configure with the intended backend flags and QD_WITH_HASHLINK=ON.
  • Build quadrants.hdll and install/validate the hashlink_native artifacts (quadrants.hdll plus runtime bitcode).
  • Run the default CTest gate.
  • Run optional CUDA/AMDGPU backend-depth tests on a matching machine when those backends are enabled.
  • Package the Haxe interface with scripts/package_hashlink_haxelib.sh.
  • Verify the haxelib package can compile and run the smoke program through haxe -lib quadrants ... and hl ... against the installed native setup.