Step-cost measurement

scripts/spa-step-cost-e2e.sh builds the public spa-step-cost fixture with a fresh compiler and runs Chromium, WebKit and Firefox. scripts/spa-step-cost-mixed-e2e.sh runs the same journey with a payload ADT read by the view and a nested Editor whose brand form changes while its product list remains unchanged, exercising prepared recursive persistence. Missing tools or browser engines fail. The fixture separates retained data size from visible row count. It checks ignored keys, normal input, asynchronous work, restore, handler payload freshness, synthetic identity changes and four viewport widths.

The harness enables internal numeric profiling before wasm boot. Ordinary apps do not enable it. No model contents, session values or environment data appear in the profile. This is diagnostic plumbing, not an application API or a basis for changing runtime decisions.

The opt-in __skyStepProfile.detail report also attributes actual root-message dispatches and compiler-issued view-memo sites. Message keys are SHA-256 hashes of concrete type metadata; no payload fields or user methods are read. Site counters distinguish calls, builds, hits, admissions, cumulative commits and the current committed-entry gauge. lastInputRows observes only the direct length of an already validated final slice capture. A source binding must prove that this capture is the intended list before treating it as a workload size.

Readers must require complete and gaugeKnown, reject unknown values, and compare snapshots within one epoch. Unsupported message shapes, multiple app caches, ambiguous metadata and exhausted bounds mark the report incomplete. Counters retain bounded numeric metadata, never models or cache entries. Resetting counters preserves the algorithm cache and its live-entry gauge; it does not create a cold-cache run. These counters are disabled by default.

Counter or durationWhat it measures
stepsExecuted TEA steps
updateGuard and update evaluation
viewUser view evaluation
vnodeHTML-to-VNode conversion
styleNode path assignment and style injection
patchRender planning, DOM application, deferred-input handling and handler refresh
postURL reconciliation, Cmd interpretation and subscription reconciliation
preparedEncodes, preparedFallbacksStrict codec preparation invocations and already-prepared Full-equivalent fallbacks
fieldMarshals, closedFieldReusesMixed-field marshals and proven closed-field/recursive atomic-leaf reuse
fieldEncodes, fieldEncodedBytesField conversions and marshaled field bytes, including unknown fields on every logical invocation
deferredFieldEncodes, deferredFieldMarshals, deferredFieldEncodedBytesSubset of field work reconstructed on demand after raw-cache eviction
deferredEncodeNanosDeferred reconstruction within payload/identity assembly; a subset of write/session time, never added again to phase totals
materializedBytes, bridgeBytesWhole selected payload bytes joined and bytes copied into browser strings
modelEncodes, encodedBytesActual full model encoder calls and output bytes
encodeNanosEncoding decisions, bounded identity checks and full encoder work
modelEncodeReuses, encodeComparedNodesSuccessful next-encoding reuse and bounded witness visits
writeNanosEntire persistence write pipeline, including exclusions, identity processing and storage
sessionNanosProtected projections and session-clear decision after encoding
storageWritesBrowser storage calls intercepted by the synthetic harness

The aggregate patch and write durations must not be described as pure DOM or disk costs. Diagnostic export and profiling overhead are outside these phase durations. End-to-end measurements with profiling disabled are also required before claiming a latency improvement. Chromium CPU throttling is supported by the verifier's --cpu 4; actual mobile measurements remain a separate gate.

Saved JSON reports contain numeric measurements and synthetic scenario names. They are evidence for the tested source, engine and workload only. Neither a green report nor an unchanged-step speedup proves arbitrary programme scaling.