Overview
/ Scope
- Four fixed diagnostic workspaces (Overview, Workloads, Hardware, I/O & Net) with responsive terminal breakpoints
- Deterministic health engine (PSI, swap-in, D-state, thermal critical headroom) with Explain evidence drawer
- First-class Metric<T> availability tracking across CPU, memory, disks, network, hwmon, RAPL, and GPU
- Developer Port Workbench correlating listening sockets to cmdline, cwd, and systemd/container parents
- Read-only by construction with /proc/*/environ banned repository-wide and enforced by guardrail tests
- Operator-confirmed process signalling & Smart Free pinned via pidfd_open before (pid, starttime) checks
- In-house terminal driver with 16-byte alignas(16) Cell grid and DEC Mode 2026 synchronized frame diffing
- Single-load runtime dlopen for NVIDIA NVML telemetry (avoiding driver 580's per-poll eventfd leak)
- 294 unit, fuzz, and architectural guardrail tests + Clang ASan/UBSan/TSan + Alpine musl static-pie builds
- Hardened POSIX curl | sh installer with HTTPS enforcement and SHA256SUMS verification
Highlights
01
Zero third-party dependencies — pure C++26 stdlib + POSIX
02
~3.3x lower instruction rate (4.12M-4.22M insns/s) at 1000 ms live cadence
03
pidfd_open-pinned signals + repository-wide /proc/*/environ ban
04
294 tests + ASan/UBSan/TSan + Alpine musl static-pie + 100 PTY screen-model checks
05
One-line verified installer: curl -fsSL https://0xtanzim.dev/triage/install.sh | sh
/ Tracks
- Product
- Open source
Media
The Problem
Approach
Key Decisions
- 01
16-byte cache-aligned Cell & single-worker Sampler::retire()
24-byte cells caused 44.68% LLC misses during frame diffs. Packing Cell to 16 bytes (alignas(16)) fits 4 cells per 64-byte L1 line, cuts double-buffered 180x54 frames from 467 KB to 311 KB, and lets equality compile to a 16-byte memcmp. Collapsing the ticker relay into one worker and retiring old snapshots back to the allocating thread dropped futex waits from 72.5 ms to 1.8 ms/10s. - 02
Open pidfd_open before verifying (pid, starttime)
Checking starttime first and opening pidfd second leaves a TOCTOU window where a process exits and its PID gets reused before signalling. triage opens pidfd_open first to pin the kernel struct pid, verifies starttime on /proc//stat, and delivers the signal through pidfd_send_signal. - 03
Demand-gated /proc/net and socket-aware process_fds
Parsing full TCP/UDP tables and running readlinkat across multi-FD apps (browsers, IDEs) dominated idle CPU and hit 4,375 readlinkat syscalls per 10s window. triage runs an O(#listening) SocketSummary check on idle ticks and suppresses periodic readlinkat unless live ports are viewed or an unmapped listening inode appears (-60.5% readlinkat). - 04
Zero third-party dependencies + single-load NVML
Built exclusively with C++26 and POSIX headers (no FTXUI, ncurses, or libc crates). Unloading libnvidia-ml.so between polls leaked an eventfd every 15s on driver 580, so NVML loads once per process when present (TRIAGE_DISABLE_NVML=1 opts out) while staying optional at build time.
Architecture
/ System proof
These are not tool badges. They describe the boundaries, consistency controls, async paths, and failure-mode decisions behind the build.
- 01Strict 9-layer include DAG (domain -> parsers -> platform -> sampling -> core -> render -> terminal -> input -> app/cli)
- 02Single 'triage:sampler' std::jthread publishing immutable shared_ptr
+ Sampler::retire() arena reuse - 0316-byte alignas(16) Cell double-buffered Frame with row-strided diffing and DEC Mode 2026 output
- 04Persistent thread_local ::pread() descriptor cache for fixed /proc and /sys seqfiles
- 05Read-only everywhere except pidfd-pinned process signalling in src/app/signal.cpp
Challenges & How I Solved Them
Eliminating 3.5x instruction inflation without slowing the 1000 ms tick
/ Problem
/ Solution
Distinguishing CPU P-state variance from real code regressions
/ Problem
/ Solution
Outcomes
- Shipped v1.0.0 with automated GitHub Actions builds for universal static-pie musl and glibc Linux x86_64 binaries + SHA256SUMS.
- ~3.3x instruction reduction (13.89M/s -> 4.12M-4.22M/s) and ~4.7 MiB dirty RSS footprint at 1000 ms cadence.
- 294 unit, fuzz, and architectural guardrail tests passing across GCC 16 strict (-Werror), fallbacks, Clang 22 ASan/UBSan/TSan, and Alpine musl.
- Automated PTY screen-model test suite (100 cockpit checks) verifying layout, mouse, themes, resize breakpoints, and signal-safe terminal restore.
What I Learned
- 01
Hardware PMU counters and strace beat intuition every time — the real bottleneck wasn't terminal ANSI output, it was unconditional /proc/net string allocation and 24-byte cells thrashing L1/L2 caches.
- 02
Architectural rules hold only when a test breaks on violations: encoding layer order, /environ bans, and ANSI confinement in test_guardrails.cpp kept 104 files clean across rapid refactors.


![Workspace [1] Overview — per-core CPU bars, GPU, memory, storage, and workloads](/_next/image?url=%2Fprojects%2Ftriage%2Foverview.png&w=3840&q=75)

![Workspace [3] Hardware — Full Sensor Matrix, thermal limits, and GPU telemetry](/_next/image?url=%2Fprojects%2Ftriage%2Fhardware.png&w=3840&q=75)
![Workspace [4] I/O & Net — unified storage tree, disk culprits, and Ports Workbench](/_next/image?url=%2Fprojects%2Ftriage%2Fports.png&w=3840&q=75)