Skip to content

docs(gos): unified isotropic-threshold design + per-family derivations - #520

Merged
zzylol merged 3 commits into
split/pr1-cleanupfrom
split/pr-gos-docs
Jul 16, 2026
Merged

zzylol merged 3 commits into
split/pr1-cleanupfrom
split/pr-gos-docs

Conversation

@zzylol

@zzylol zzylol commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

First PR in an 11-PR GOS stack (docs → transport → per-family GOS × 6, interleaved with 2 retirement PRs and a DDSketch wire-format PR). Base: #516.

This is design/spec content, split out to stand on its own rather than being bundled with any single family's implementation:

  • docs/design-gos-unified-edge-telemetry.md §11: the unified no-sub-window, insert-time-detection model for all 6 sketch families (Sum/CMS/CountSketch/DDSketch/KLL/HLL) — wake-on-demand flush mechanics, Gate 1 retirement rationale, Discipline B split rationale, per-family cell/threshold/reset table, why cold-start behavior is intentional, and explicitly-scoped open items (anisotropic Activity_j redesign, DDSketch's unbounded bucket growth, HLL's small-cardinality regime).
  • docs/sampling-cdm-gos-derivations.md §8: the per-family CDM staleness/threshold math — CMS's L1/max-composition T=εN/k, DDSketch's L1/sum-composition T=εN/(kB), KLL's R≥εN trigger, HLL's OctoSketch-paper register-change adapter |2^C'-2^C|≥2^τ.

Note: sketchlib-go already has an octosketch worker/aggregator framework with a similar algorithmic shape, but it's built for intra-process multi-core parallelism (in-memory Go channels, queue-depth-adaptive threshold) rather than edge→backend network transmission with an accuracy-driven (ε-relative) threshold — the implementation PRs that follow build a purpose-built mechanism rather than reusing it.

Test plan

  • Markdown/table formatting verified (no broken tables from LaTeX pipe characters).
  • N/A — docs only, no code.

🤖 Generated with Claude Code

zzylol and others added 2 commits July 16, 2026 12:46
design-gos-unified-edge-telemetry.md: new §11 "The 2026-07 redesign: no
sub-window, insert-time detection for all 6 families" — the unified
model (check-at-insert, sync-only, alerting moves to the backend), the
wake-on-demand flush mechanism that keeps the existing OTLP/
SketchEnvelope pipeline (only the trigger changes, from purely-timer
to timer-or-woken), retiring Gate 1 (subWindowShouldEmit/ackedCells)
and CMS's local point-query read, a per-family cell/threshold/reset
mechanism table, why the cold-start "threshold near zero" behavior is
intentional, and three explicitly-scoped open items (anisotropic
Activity_j redesign, DDSketch's unbounded bucket growth —
sketchlib-go#72, independent of this work — and HLL's unverified
small-cardinality regime). Old §11/§12 renumbered to §12/§13, with a
cross-reference note where the old "acked snapshot" description is
superseded.

sampling-cdm-gos-derivations.md §8: fills in the previously-empty CDM
staleness/threshold derivations for CMS (§8.2, L1/max-composition,
T=εN/k — no √(dw), unlike CountSketch's L2/sum-composition), DDSketch
range counts (§8.4, L1/sum-composition, T=εN/(kB) with B tracked O(1)
per new bucket rather than assumed — an assumed constant would let the
staleness bound be silently violated, not just loosened), KLL's
concrete emit trigger (§8.6, R>=εN from the existing R/N bound), and
HLL's register-change adapter (§8.7, OctoSketch's own max-merge
treatment: |2^C'-2^C|>=2^tau on the linearized value, never reset —
MAX-merge is idempotent). §11 summary table gets an "Isotropic
threshold" column tying all 6 families together; §13 implementation
notes updated to match (sub-window language replaced, CMS point-query
retirement noted).
Cut the "current vs target" sampling-rollout table (§3.1), the redundant
§3.2 "Status." paragraph (which had drifted out of sync with §3.1's own
later claim), and §12's "Implementation status as of this writing" block
and half of "Ties to existing code" — several of which pointed at code
already deleted (AllocateThresholds/gos_threshold matrix, gos_anisotropic,
f2_coord.rs/f2engine.go from the F2 removal). Net: shorter, and no longer
self-contradictory or pointing at dead files.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Fold the former standalone "2026-07 redesign" section into the rest of the
document instead of leaving it as a dated patch note bolted on at the end:

- The unified insert-time model, wake-on-demand flush, per-family
  detection/reset table, and cold-start rationale move into §7 as
  "Layer D" (Layers A-C already establish *what* threshold each cell
  gets; Layer D is *when* a crossing is detected/shipped) - the same
  section that already derives the closed-form thresholds these checks
  use, instead of sitting in a separate, differently-scoped section.
- The retirement specifics (Gate 1, CMS point-query, Discipline B
  alerting) move to §11 (Implementation notes), next to the existing
  "Ties to existing code" - this is where migration-from-current-code
  detail already lives, so it no longer needs a "superseded by §11"
  cross-reference note explaining itself.
- The open items (Activity_j redefinition, DDSketch bucket growth, HLL
  small-cardinality) merge into the pre-existing Open problems list
  instead of duplicating it as a second list.

Sections renumber 11->omitted, 12->11, 13->12; no content dropped, only
relocated and de-dated. Net -9 lines despite the merge, from removing the
now-unneeded cross-reference scaffolding.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@zzylol
zzylol merged commit 4ce23e1 into split/pr1-cleanup Jul 16, 2026
@zzylol
zzylol deleted the split/pr-gos-docs branch July 17, 2026 15:52
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