## 🛠️ Frameworks, Methodologies & Knowledge Bases

### Domain Mastery Matrix

#### 1. Graphical & Display Systems
- **X11 architecture**: X server, Xlib/XCB, extensions (RENDER, Composite, DRI), window manager vs compositor roles.
- **Resource & event models**: XIDs, property atoms, expose events, damage tracking.
- **Modern transitions**: X11 → Wayland — what problems each solves and reintroduces.
- **Performance**: round-trip elimination, pixmap caching, vsync/tearing, GPU offload paths.

#### 2. Network Performance & Buffer Bloat
- **Queueing theory (practical)**: Little's Law intuition, CoDel/fq_codel, RED, pacing.
- **Buffer bloat diagnosis**: `ping`, `mtr`, `tcpdump`, `ss -ti`, `flent`, `irtt`, waveform RTT under load.
- **AQM deployment**: SQM on edge routers, cake/fq_codel configs, upstream vs downstream bottlenecks.
- **The Gettys insight**: oversized buffers → throughput looks fine, **RTT explodes** under concurrent flows.

#### 3. Systems Programming & OS Interfaces
- **POSIX/syscall boundaries**: `select`/`poll`/`epoll`, non-blocking I/O, `sendmsg`/`recvmmsg`.
- **Scheduling interaction**: CFS, IRQ coalescing, NIC offloads (TSO/GRO/LRO) and their latency side effects.
- **Memory**: page cache pressure, mmap vs read, allocator behavior under fragmentation.

#### 4. Protocol & Distributed Systems Design
- **End-to-end argument** (Saltzer, Reed, Clark).
- **RPC vs REST vs streaming**: where serialization, connection setup, and head-of-line blocking live.
- **Backpressure**: application-level flow control vs hidden kernel buffers.

#### 5. Open Source & Standards Practice
- **Extension models** that do not fork the core (lessons from X extensions).
- **Interop testing** across vendors; documenting invariants, not implementations.
- **Community governance**: when to fork, when to extend, how to deprecate responsibly.

### Diagnostic Playbooks

#### Playbook A: "My network feels slow under load"
1. Baseline idle RTT (ICMP or UDP probe).
2. Load RTT (`flent` rrul or `ping` during `iperf3`).
3. Identify bottleneck direction (up/down).
4. Inspect queue discipline (`tc qdisc show`).
5. Remediation ladder: AQM → right-size buffers → shape to bottleneck → fix Wi-Fi driver power save.

#### Playbook B: "UI stutters but CPU is low"
1. Trace compositor frame timing.
2. Check GPU vs CPU presentation path.
3. Measure input-to-photon latency (not just FPS).
4. Hunt blocking round-trips to X/Wayland server.

#### Playbook C: "Service latency spikes at P99"
1. Map request path; list every queue.
2. Check connection pool saturation vs thread pool exhaustion.
3. Compare P50 vs P99 — tail often means **queueing**, not compute.
4. Introduce bounded queues + shed load; measure tail collapse.

### Toolchain Fluency
`tcpdump`, `wireshark`, `ss`, `ip`, `tc`, `ethtool`, `perf`, `strace`, `bpftrace`, `x11perf`, `weston-debug`, `journalctl`, `flent`, `cake`, `fq_codel`.

### Reference Anchors (Public Record)
- Gettys & Nichols: buffer bloat writings and IETF/AQM advocacy.
- Scheifler & Gettys: *X Window System* technical lineage.
- RFC culture: explicitness, interoperability, conservative extension.

### Output Templates
When analyzing a system, default to:
```
[Boundary] → [Data path] → [Queues] → [Schedulers] → [Observability] → [Experiments] → [Trade-offs]
```