Files
VerseVDI-Data-Plane/openspec/changes/correct-gateway-qualification-evidence/design.md
T
sechmachine 78e4709c90
Verify Data Plane / gateway (push) Successful in 2m8s
fix(gateway): preserve paced qualification traffic
2026-07-30 16:51:19 +07:00

37 lines
3.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## Context
The qualification driver already reaches the production Apollo-to-QUIC path, but its source shaper reorders jitter even when reorder is disabled, its packet accounting cannot identify unexplained loss, and in-process resource counters include the provider/client driver.
## Goals / Non-Goals
**Goals:**
- Attribute every source unit to one bounded production-path outcome.
- Keep impairment axes independently configured and observed.
- Sample CPU, heap, allocation, and goroutine use from the gateway process only.
- Record measured monotonic-clock overhead.
**Non-Goals:**
- No second simulator, profiling service, production dependency, or expanded impairment matrix.
- No larger queues or relaxed acceptance limits without measured need.
## Decisions
- Reuse the existing source-boundary shaper, preserve source order unless explicit reorder is enabled, and limit catch-up to one media serialization interval. Record the fixed-seed applied-delay standard deviation separately from the jitter observed after ordered traversal.
- Drive processing sends at the configured source rate while a separate public-client receive loop validates ordered payload delivery. Use cooperative scheduling with a bounded high-resolution final wait in the parent driver so sub-millisecond packet spacing does not depend on host sleep granularity.
- Assign stable source sequence identifiers and retain per-stage counts so injected loss, provider/FEC drop, queue replacement, QUIC failure, and client miss are disjoint.
- Reuse the established gateway child-test pattern for the actual gateway server; the Apollo fixture and QUIC client remain in the parent driver. A token-protected loopback test control endpoint starts and stops bounded child-owned recording and returns aggregate stage state.
- Stream queue, processing, and pacing samples from the production `sendMedia` boundary to child-owned raw evidence. Sample child `RUSAGE_SELF`, Go heap, allocations, and goroutines once per second with independent per-run baselines.
- Buffer at most 4,096 child-owned timing samples before the gzip writer; drain every sample before recording stops and backpressure on sustained writer overload instead of dropping evidence or compressing synchronously in the media loop.
- Use the existing reviewed 64-packet qualification bound for native video (about 7.5 ms at 80 Mbps) after public-path counters proved the 16-packet queue replaced 15 clean-path units during ordinary scheduler pauses. Keep audio at 16 packets and retain latest-unit replacement at both bounds.
- Measure clock overhead as the median elapsed time per read across 1,000 batches of 100 monotonic reads and record that method.
## Risks / Trade-offs
- [Ordered release suppresses some delivered jitter] → Retain both the applied fixed-seed delay distribution and the separately observed ordered-traversal jitter.
- [Stage attribution double-counts a unit] → Record one terminal outcome per source sequence and validate accounting equality.
- [Process sampling perturbs qualification] → Use bounded low-rate samples and include the sampling method in evidence.
- [The source driver consumes CPU for precise pacing] → Keep it in the parent process excluded by the gateway-only resource sampler, and yield cooperatively until the final 50 microseconds.
- [Shared private runners cannot sustain the reviewed 20/50/80 Mbps gates] → Run the complete verifier on the registered on-demand xhigh runner; the frozen qualification remains authoritative for the normative duration.