StackWeigh 0.1.0 implements a bounded subset of the published Speedscope schema and annotated format specification.
The schema identifier is required. Unknown fields are ignored. Metadata is validated for every profile; samples/events are validated when selected. Sample weights must be present, numeric, nonnegative, finite, and one-to-one with stacks. Zero-weight stacks are validated but contribute no observed functions. Duplicate JSON object keys follow the browser JSON parser's last-value behavior.
Events must be within bounds and in nondecreasing order. O/C events must balance and close the same frame index that was opened. Equal-position events contribute zero weight. Invalid events are rejected rather than sorted or repaired.
Source line/column values must be nonnegative safe integers. Numeric values and converted/summed weights are limited to ±(2^53−1). This is intentionally stricter than the schema's generic JSON-number type. Unsafe epoch-nanosecond timestamps, huge weights, missing weights and missing schema identifiers are rejected. JavaScript floating-point arithmetic still has ordinary rounding error; results are not arbitrary-precision measurements.
For a sampled profile, observed total is the sum of its supplied weights. Declared bounds are retained as metadata and disagreement is disclosed. An empty stack's weight stays in the denominator and is recorded as unattributed.
For an evented profile, each interval contributes its width to the currently open
stack. Gaps before, between and after active stacks remain unattributed. Total
weight covers endValue - startValue, subject to floating-point rounding.
Self weight belongs to the leaf. Flat function inclusive weight counts an identity once per stack, even when it recurs. Thus a function's inclusive share cannot exceed 100% merely because of recursion. Inclusive values across different functions overlap and must not be summed as a profile total. Call paths preserve every recursive occurrence.
Seconds, milliseconds, microseconds and nanoseconds convert to milliseconds.
Bytes and none remain separate dimensions. Unitless exporters may measure
different quantities, even when the unit labels agree. Sampled and evented
profiles may be compared within a dimension, with a warning about denominators.
Exact identity is the tuple [name, file, line, col], preserving absent fields
separately from empty strings and zero. The alternative [name, file] ignores
line/column changes; observed within-profile location merges produce a warning.
Missing files produce a warning. Same-tuple distinct functions remain
indistinguishable. Paths are never stripped or automatically remapped, and frame
array indices are never used to join different files.
Absolute delta is current - baseline. Share delta is
100 * (current / currentTotal - baseline / baselineTotal), in percentage points.
When either total is zero, share deltas are unavailable, not zero or infinity.
The total-weight relative percentage is unavailable when the baseline is zero.
"Newly observed" means positive inclusive weight only in current; "no longer
observed" means positive inclusive weight only in baseline. These labels say
nothing about whether a function was added or deleted in source.
Each graph node is a complete call path. Width is its combined baseline/current inclusive weight divided by combined weight at the zoom root. Children keep that same denominator. Remaining horizontal space represents the parent's self weight (or unattributed weight at the overall root). Color shows absolute or share delta, with intensity saturated for readability; numerical labels provide exact displayed values. Graph width does not encode the delta. Different sibling ordering is not execution order; siblings sort by combined weight.
The table initially sorts by absolute magnitude of difference. Its JSON export contains the complete comparison, unaffected by table search, filters or pagination. The snapshot stores both full decoded input texts and the selected profile, matching, basis and metric. It restores a fresh unfiltered view, not current zoom, sort, search or pagination. Hashes refer to decoded UTF-8 text and are recomputed on reopening; they are not signatures or proof of publisher identity.