HashLink public Dynamic boundary ledger
HashLink treats Dynamic as an interop boundary, not a normal public API design tool. Public APIs that can express dtype or storage-kind relationships use typed generics (Tensor<T>, Field<T>, VectorNdarray<T>, MatrixNdarray<T>, VectorField<T>, MatrixField<T>, StructTensor<S>, StructField<S>).
| API surface | Classification | Retention reason |
|---|---|---|
KernelRaw.launchDynamic(...), launchOnDynamic(...), graph launch methods, launchRetDynamic(...), launchRetsDynamic(...), kernel.ArgBuffer, and native hl.NativeArray<Dynamic> launch bridge | Internal necessary boundary | Runtime kernel calls accept heterogeneous argument lists whose arity and scalar/tensor mix are determined by the compiled descriptor; typed QKernelN wrappers are the user-facing launch API. |
TapeRecord.args and Tape.recordKernel(...) / Tape.recordCustom(...) internal replay hooks | Internal necessary boundary | Typed QKernelN.launchTape(...) records heterogeneous launch values for reverse/forward replay without exposing Tape.launch(...Dynamic) as the user entrypoint. |
GradCheck.check*ToScalar(..., args:Array<Dynamic>, ...) | Permanent necessary boundary | Grad checking replays a kernel with the same heterogeneous launch argument list while separately identifying typed differentiable inputs and scalar loss. |
Native.kernel_launch*, Native.kernel_launch*_specialized, Native.kernel_launch_ret(s) | Permanent necessary boundary | HashLink native ABI passes descriptor-validated heterogeneous runtime values and specialization values through hl.NativeArray<Dynamic> at the explicit bridge boundary. |
catch (e:Dynamic) cleanup paths | Permanent necessary boundary | Haxe exception values are dynamic; cleanup must rethrow the original value. |
Coverage.snapshot() and Diagnostics.descriptorDump/kernelInfo/valueInfo/health(...) | Permanent necessary boundary | These intentionally return JSON-like anonymous objects for tooling. |
Profiler.traceEvents() and Profiler.memoryStats() | Permanent necessary boundary | Profiler timelines and memory summaries are backend-defined JSON-like tool artifacts. |
CudaGlInterop.registerBuffer(..., glBuffer:Dynamic, ...) and native CUDA/GL registration | Permanent necessary boundary | Avoids forcing the Haxe package to depend on hlsdl while still accepting hlsdl GL buffer objects. |
Helper registry class lists using Class<Dynamic> | Permanent necessary boundary | Haxe class values for heterogeneous helper classes require dynamic class storage. |
Struct.ofN(...) kernel-only marker return values | Permanent macro boundary | These values are compile-time DSL markers consumed by KernelBuilder, not runtime data APIs. |
Descriptor macro builders (TypeTableBuilder, ArgTableBuilder, ResourceTableBuilder, StructTableBuilder, DescriptorWriter) | Permanent macro boundary | Build macros assemble normalized descriptor metadata as anonymous JSON-like objects; the data does not cross the user runtime API as typed resources. |
StructTensor.__create(...) and StructTensor.descriptorResource() | Internal/descriptor boundary | QdStruct allocation passes generated schema metadata and descriptor-resource snapshots through JSON-like values. User-facing member access remains typed by dtype-specific tensors where possible. |
Grad.zeroGrad, zeroDual, clearAllGradients | Internal/diagnostic boundary | These operate on descriptor-validated tensor/field values in AD tooling. New user code should use zeroTensorGrad, zeroFieldGrad, zeroTensorDual, and zeroFieldDual. |
Removed public Dynamic surfaces:
Kernel.launch(...),Kernel.launchOn(...),Kernel.launchRet(...),Kernel.launchRets(...), dynamic graph launch helpers,Kernel.fromRaw(...), andKernel.fromDescriptor(...)were removed from the publicKernelfacade. Use typedKernel.build(...)wrappers.Tape.launch(...)andTape.launchCustom(...)were removed. Use typedQKernelN.launchTape(tape, ...).- Algorithms now type input/output dtype relationships with
Tensor<T>. PrefixSumExecutorscan methods now type input/output dtype relationships withTensor<T>.- Vector/matrix ndarray and field wrappers now store
Tensor<T>orField<T>instead ofDynamic. TensorRuntimeandFieldRuntimepeer storage fields now useTensorHandle,FieldRuntime, orTensorHandleinstead of publicDynamic.Ndrange.of(...)andNdrange.ranges(...)compatibility markers now return the typedNdrangeDomainmarker instead ofDynamic; the preferred APIs remainof1/of2/of3/of4andranges1/ranges2/ranges3/ranges4.
Compatibility policy:
- Permanent necessary boundaries are allowed only for native/tooling interop and must not be used as precedent for ordinary APIs.
- Compatibility shims are not a v3 design goal; remove them instead of extending them when touching the relevant feature.
- Any new public
Dynamicmust add a row to this ledger in the same change. tools/check_public_dynamic.shenforces that new publicDynamicsurfaces are explicitly allowlisted.