Skip to content

observability: detect and explain application latency violations - #9

Merged
fasterthanlime merged 1 commit into
mainfrom
cli-stalls-detector
Aug 7, 2026
Merged

fasterthanlime merged 1 commit into
mainfrom
cli-stalls-detector

Conversation

@fasterthanlime

Copy link
Copy Markdown
Collaborator

Summary

  • add stax stalls for automatic whole-process work-gap detection
  • add cooperative application events, timestamped counter series, and declarative latency/liveness contracts to stax-target
  • add events, counters, contracts, violations, and incident queries
  • persist observability definitions, samples, contracts, and diagnostics in saved recordings
  • join contract violations to scheduler intervals, PET stacks, nearby application events, counters, and markers
  • render application events on the web timeline
  • accept bounded asynchronous signals emitted before the first perf sample and include them in recording bounds

This was exercised against binnacle's pointer/render pipeline. A deterministic pointer event was correlated across observed, dispatched, and renderer-received stages, and a presentation-cadence contract automatically reported an 818 ms frame gap against a 50 ms threshold. stax incident joined the surrounding frame events and renderer counters without wall-clock correlation.

Verification

  • cargo test -p stax --bin stax — 41 passed
  • cargo test -p stax-live observability — 5 passed
  • cargo test -p stax-server — 12 passed
  • cargo test -p stax-target --lib — 7 passed
  • git diff --check
  • live Linux recording against binnacle renderer PID; correlated pointer events and cadence violation observed

Known environment limitation

The frontend Vite build cannot run in this checkout because its alias points at the absent local path /home/amos/w/bearcove/oss/facet/vox/typescript/packages/vox-core/src/index.ts. Generated bindings and Rust protocol tests are included.

@fasterthanlime
fasterthanlime merged commit 042115c into main Aug 7, 2026
1 of 4 checks passed
@fasterthanlime
fasterthanlime deleted the cli-stalls-detector branch August 7, 2026 17:49
fasterthanlime added a commit that referenced this pull request Aug 7, 2026
## Summary

Follow-up to #9. Make signal-cadence incidents identify the code
executing or blocking during the violation rather than only proving that
the signal stopped.

- bind `MaxSignalGap` to the OS thread that creates the contract by
default
- retain explicit `max_signal_gap_for_thread` for cross-thread emitters
- include every owner-thread off-CPU interval overlapping the exact
violation window, longest first
- rank concurrent threads by overlapping on-CPU time and in-window PET
sample count
- show each concurrent thread's most frequently sampled stack
- render owner waits, wakers, and concurrent stacks in `stax incident`

## Live result

A controlled binnacle renderer recording detected a 1.56 s
presentation-cadence violation. The resulting incident automatically
attached renderer TID `1276287`, enumerated its overlapping scheduler
waits, and surfaced this stack inside the violation window:

```text
malloc_consolidate
int_malloc
int_realloc
realloc
<alloc::raw_vec::RawVecInner>::finish_grow
```

It also ranked simultaneous VA encode and GPU worker stacks. This is the
causal evidence missing from #9's threadless cadence incident.

## Verification

- `cargo test -p stax-live observability` — 6 passed, including
owner-wait/concurrent-stack regression
- `cargo test -p stax --bin stax` — 41 passed
- `cargo test -p stax-server` — 12 passed
- `cargo test -p stax-target --lib` — 7 passed
- focused `cargo check` for protocol/live/server/target/CLI
- regenerated TypeScript bindings
- live Linux recording and `stax incident` output exercised end to end
- `git diff --check`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant