End-to-End Execution Walkthrough
Tracing a full lifecycle from PyTorch export to real-time browser presentation highlights five explicit handoffs and rejection gates:
- Export (
frameflow/export.py,frameflow/sr_export.py): Produces(graph.json, model.json, model.bin)taggedformat_version = 1with little-endianf16weights andalign32-compatible BGR topology. - Capability Probe & Engine Init (
runtime/index.js):probeCapabilities()andcreateFrameFlow()prefer WebGPU (requestingshader-f16if present) and fall back to WebGL2 float/half-float FBOs; unsupported browsers fail explicitly. - Model Parse & Plan (
runtime/loader.js):parseModel()checks binary alignment, bounds, and tensor references beforef16ToF32()decoding;compilePlan()expandsrepeatops intopairStepsandmidStepsfor a session. - Texture Binding & Encode (
runtime/webgpu-backend.js,runtime/webgl2-backend.js): Shared handles ({ device }or{ gl }) accept external textures (setExternalInputTexture) or canvas uploads (pushFrame) and encode passes without hot-pathmapAsyncreadbacks. - Non-Blocking Pacing (
runtime/pacer.js):FrameFlowPacer.onSourceFrame()schedulest = 0.5(factor=2) ort = 1/3, 2/3(factor=3) mid tasks, andtick()yields source/mid descriptors while shedding overflow (queue.length > factor + 2).
Inspect the owning modules in the Code Map or run make test to execute the offline CPU + Node loader checks.