EMRY-020: Chart downsample + braille renderer #62
No reviewers
Labels
No labels
blocked
bug
compat
docs
documentation
duplicate
emry-cli
emry-core
emry-engine
emry-ingest
emry-py
emry-store
emry-tui
emry-web
enhancement
good first issue
gpu-compute
help wanted
hpc
infra
integrations
invalid
needs-design
P0-blocker
P1-core
P2-enhanced
P3-future
performance
pull-request
python
pytorch
question
rust
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
femboy/emry!62
Loading…
Reference in a new issue
No description provided.
Delete branch "emry-020-chart-downsample"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes EMRY-020 (#15). Branched off
main. First M2/TUI work.What
crates/emry-tui/src/chart.rs— dependency-free chart primitives:downsample_minmax(&[f64], buckets) -> Vec<(f64,f64)>: spike-preserving compression (keeps min and max per bucket — averaging would hide loss spikes).render_braille(&[f64], width, height) -> Vec<String>: a braille band chart (2×4 dots per cell, U+2800 base), filling each column from min→max so spikes stay visible.Scope note
The
ratatui::Widgetwrapper is intentionally deferred to EMRY-021 (where the TUI app + ratatui dependency land). EMRY-020 ships the pure, fully-unit-testable rendering core.Verification
./scripts/pre-commit-rust.shgreen: clippy-D warnings, 13 tui tests, chart.rs 99% lines, total 98.03%Review-driven fixes
A focused review verified the braille dot-bit table, bucket math, coordinate flip, and indexing are correct, and caught two non-finite consistency bugs (both fixed):
len<=bucketsshort-circuit path skipped the finite filter → a NaN could reach aNaN as usizecast.(0,0)sentinel could distort normalization → now normalize against the finite range of the originaldata, with clamped dot rows + blank-on-no-finite-data.