Expand description
The RAW handler ABI (bc#76): a de-boxed handler boundary so a generated typed module
materializes a struct DIRECTLY from the wire payload, with no intermediate dynamic
Value/Value::Obj tree on the row data plane.
§Why this exists (the boxing #75 left)
The typed codegen (#47/#48) materialized structs from an ALREADY-BOXED Value:
fn marshal_T0(raw: &Value) -> Result<T0, BehaviorError> // raw is a Value::Obj treeThe consumer’s read handler first built the full dynamic Value tree and the generated
module then WALKED it into a struct — ADDING a Value->struct conversion on top of the
boxing instead of REPLACING it. The residual ~22% Rust gap #75 measured is exactly that
Value/Value::Obj deep-clone at the handler ABI boundary (Rust felt it most: the
Value enum boxes every Obj pair into a heap Vec<(String, Value)> that is cloned at
the ABI, then re-walked).
bc’s conformance handlers return a Value mock, so the suite structurally could not see
what the consumer’s real handler did BEFORE the Value reached the module — the blind
spot that let bc#47’s B2 layering recur one layer out as bc#76.
§The seam
A RAW handler yields a RawValue — a native-backed accessor tree that is NOT a
Value. The generated raw marshaller matches on it (scalar / RawRow / arr) straight
into the concrete struct. The dynamic Value tree never exists on the row data plane;
boxing is REPLACED, not layered. RawRow::field is the monomorphized wire read a
hand-written v1-native struct-from-row would do.
Structs§
- RawRow
- The object accessor on the raw data plane: a direct native field read that materializes
NO
Value::Obj. bc conformance uses this nativeVec-backed row (no real wire format) so the generated raw marshaller exercises the de-boxed path; a real consumer implements the same shape over its wire payload (e.g. an AttributeValue map).
Enums§
- RawOutcome
- A RAW handler execution result.
Okcarries aRawValue(native-backed), NOT a boxedValue— that is the whole de-box. - RawValue
- A handler result on the RAW data plane — deliberately NOT a
Value: the whole point of #76 is that the dynamicValue/Value::Objtree is never built here. A real consumer’s handler returns its native wire shape as aRawValuewith noValueallocation.
Traits§
- Native
Component Exec - The NATIVE-PORTS handler registry seam: the handler receives the generated native ports
struct behind a
PortReaderand returns anExecOutcome(a boxedValueRESULT — the UNTYPED straight-line path has no target struct to de-box the result into, and returns the boxedValueas the component output, exactly as the generic path does). NO genericVec<(String, Value)>port CONTAINER is built on the port plane — that is the de-plumb. - Native
RawComponent Exec - The combined handler registry seam (bc#94, nativized): native ports in (a CONCRETE
&P, passed by monomorphized generic instantiation — no&dyn, noas_any/downcast),RawValueout. - Port
Reader - The optional uniform read accessor a generated native ports struct implements so a consumer
that does not downcast can still read ports by name. Reading a statically-typed field this
way clones/boxes ONLY that one field into a
Valueon demand (noVec, no eager boxing of every port) — a hot-path consumer downcasts (as_any) and reads the typed fields directly. - Port
ReaderT - The COVERED-path port accessor (bc#94): the by-name read a combined handler uses, WITHOUT the
dynamic
PortReader::as_anydowncast hook. The generated combined runner passes each node’s CONCRETE ports struct to the handler by direct generic instantiation (&PwhereP: PortReaderT, monomorphized per node) — never behind&dyn, never viaas_any/downcast. APortReaderThandler still reads a port by name (boxing that one field on demand) if it does not want to name the concrete struct type, but the SEAM itself carries nodyn/as_any: the concrete type flows through monomorphization. (PortReader— withas_any— stays for the UNCOVEREDNativeComponentExecpath, retired later.) - RawComponent
Exec - The RAW handler registry seam: like
ComponentExec, but the handler returns aRawValue(native-backed) instead of a boxedValue. A generated raw-ABI module dispatches through this and materializes structs directly from theRawValue— no dynamicValuetree on the row data plane.
Functions§
- raw_
from_ value - Lower a dynamic
Valueinto the equivalent native-backedRawValue. This is the ADAPTER bc’s conformance uses to feed the RAW path from the SAME vectors the boxed path uses (so behavior-equality is checked againstrun_behavioron identical data). It is a TEST/BENCH-ADAPTER that lives OFF the hot path: a real consumer never builds aValuefirst — it producesRawValuefrom its wire payload directly. The de-box win is measured against v1-native precisely because production skips this step. - raw_
missing_ prop - Build a MISSING_PROP
BehaviorError(symmetric with the boxed marshaller’s fail-closed path) for a raw marshaller. Kept here so the generated raw code raises the same coded failure asrun_behavior. - raw_
type_ mismatch - Build a TYPE_MISMATCH
BehaviorErrorfor a raw marshaller.