Chart decimation refinements: optional --width budget flag + true intra-bucket ordering for continuous x-mode #110

Closed
opened 2026-06-22 12:41:33 +02:00 by Brummel · 1 comment
Owner

Two deferred refinements to the serve-time chart decimation that landed in cut 2
(#108, commit 476342d). Both are debt, not bugs — the shipped decimation is correct
and bounded; these sharpen it.

1. The decimation budget is a fixed const

CHART_DECIMATE_BUCKETS = 2000 in crates/aura-cli/src/main.rs is hard-coded; there
is no --width / --max-points flag on aura chart. A viewport-scale default is
the right first cut (the issue #108 asked for decimation, not a knob), but a flag
would let a user trade page size for fidelity (e.g. a wide monitor, or a deliberately
coarse overview). Cheap to add: thread an Option<usize> from parse_chart_args
into emit_chart's decimate(data, …) calls.

2. Intra-bucket min/max ordering in continuous x-mode

decimate places each bucket's min at xs[lo] and max at xs[hi-1]
(the bucket's boundary timestamps), irrespective of where the true min/max occurred
inside the bucket. This is sub-pixel and visually harmless in the ordinal
(gap-collapsed) x-mode, which is the default. In the continuous (real-time)
x-mode (chart-viewer.js xMode toggle), it is a real — though still ≤1-bucket-wide
— timestamp displacement of the extremes. A faithful version would order the two
emitted points by the actual index at which the min/max occurred. No test pins the
continuous-mode case today (the decimate_* unit tests assert value preservation,
not x-placement).

context: surfaced by the cycle-0062 architect drift review (visual-world-cut-2).
depends on: nothing — both are local refinements to decimate / parse_chart_args
in aura-cli.

Two deferred refinements to the serve-time chart decimation that landed in cut 2 (#108, commit 476342d). Both are debt, not bugs — the shipped decimation is correct and bounded; these sharpen it. ## 1. The decimation budget is a fixed const `CHART_DECIMATE_BUCKETS = 2000` in `crates/aura-cli/src/main.rs` is hard-coded; there is no `--width` / `--max-points` flag on `aura chart`. A viewport-scale default is the right first cut (the issue #108 asked for decimation, not a knob), but a flag would let a user trade page size for fidelity (e.g. a wide monitor, or a deliberately coarse overview). Cheap to add: thread an `Option<usize>` from `parse_chart_args` into `emit_chart`'s `decimate(data, …)` calls. ## 2. Intra-bucket min/max ordering in continuous x-mode `decimate` places each bucket's **min at `xs[lo]`** and **max at `xs[hi-1]`** (the bucket's boundary timestamps), irrespective of where the true min/max occurred inside the bucket. This is sub-pixel and visually harmless in the **ordinal** (gap-collapsed) x-mode, which is the default. In the **continuous** (real-time) x-mode (`chart-viewer.js` `xMode` toggle), it is a real — though still ≤1-bucket-wide — timestamp displacement of the extremes. A faithful version would order the two emitted points by the actual index at which the min/max occurred. No test pins the continuous-mode case today (the `decimate_*` unit tests assert value preservation, not x-placement). context: surfaced by the cycle-0062 architect drift review (visual-world-cut-2). depends on: nothing — both are local refinements to `decimate` / `parse_chart_args` in `aura-cli`.
Brummel added the idea label 2026-06-22 12:41:33 +02:00
Collaborator

Closed as ratified drop (owner decision, 2026-07-21, idea-cull round): proposes new CLI flags — the direction #300 retired (flags converge into document vocabulary). A width/point budget, if ever needed, would enter as document/projection vocabulary, not argv.

Closed as ratified drop (owner decision, 2026-07-21, idea-cull round): proposes new CLI flags — the direction #300 retired (flags converge into document vocabulary). A width/point budget, if ever needed, would enter as document/projection vocabulary, not argv.
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Brummel/Aura#110