Skip to main content

Module model_substrate

Module model_substrate 

Source
Expand description

Model-as-substrate (Phase 6, §F): one buffer holds a renderable manifold AND the transcoded P64 weights; the renderer projects the manifold while the weights are co-resident. Gated to where crate::p64_weight (the transcoder) compiles. Phase 6 — model-as-substrate (graph–tensor duality, STELLAR §F).

The renderer’s acceptance for Phase 6: project a view of a manifold that also holds transcoded model weights — one substrate, one device. This module demonstrates exactly that: a single contiguous byte buffer co-locates

  1. a renderable manifold — a Tensor10D buffer (tensor::buffer_export) the renderer projects through render::projection (the same Volume3D projection the GPU viewport draws); and
  2. a P64 weight section — produced by the streaming transcoder (p64_weight::transcode_safetensor_to_p64), loadable in place via P64TensorIndex::from_p64.

One buffer, one device: the renderer projects the manifold while the weights are co-resident and mappable — the unification claim, end-to-end. (The deeper claim — that a single node is both a render primitive and a weight pointer — is the file-format-v2 work, STELLAR §C; here the two sections share one substrate, which is the testable Phase-6 gate.)

Structs§

SubstrateSections
Borrowed views of a substrate’s two co-located sections.

Constants§

SUBSTRATE_HEADER_BYTES
Substrate header: magic(4) + version(2) + pad(2) + 4 × u64 section pointers = 40 bytes.
SUBSTRATE_MAGIC
Magic for the combined substrate header (“SUBQ”).

Functions§

build_model_substrate
End-to-end (Gate A): transcode safetensor_src → co-locate it with a renderable geometry manifold in ONE substrate. Returns (substrate, transcode_report).
compose_substrate
Co-locate a renderable manifold buffer + a P64 weights blob into one contiguous substrate.
load_weights
Load the co-resident weights section in place (zero-copy header/manifest parse).
project_manifold
The renderer’s view of the substrate: project every manifold node (Volume3D) — exactly what the GPU viewport draws. Zero-copy over the manifold section.
read_substrate
Parse a substrate header and return zero-copy slices of its two sections.