Skip to content

Latest commit

 

History

History
72 lines (63 loc) · 5.15 KB

ROADMAP.md

File metadata and controls

72 lines (63 loc) · 5.15 KB

Roadmap

Working TODO list for ChunkFlow. Design decisions and their reasons live in CONVENTIONS.md, released changes in CHANGELOG.md; this file only tracks what is left to do. Items that were removed rather than done are kept struck through with the reason, so the question is not reopened by accident.

Done (v0.0.1 → v0.0.3)

  • Safety net: CI (gofmt, vet, golangci-lint, race tests on 1.27.x and stable, govulncheck), a benchstat job on pull requests, protected master, Makefile + pre-commit hook, goleak in every concurrent test, 100% statement coverage, runnable Example* for every public operation.
  • One stream type, New(ctx) with Seq, Seq2 (key/value as Entry), SeqErr, Chan; Option / StepOption; WithParallel ordered by default with WithUnordered(); WithOnError.
  • Error model: errors as elements, terminals stop at the first fatal one, Suppress marks a tolerated error, ErrSuppressed, ErrPanic, ErrEmpty. First / Last return (T, error).
  • Operators: Map, Filter, Tap, Take, Skip, TakeWhile, SkipWhile, Compact, Chunk, ChunkTimeout, Zip, Through, Transform; top-level Flatten, Concat, Merge; terminals Collect, ForEach, Reduce, ReduceBy, Count, Drain, All, Any, First, Last, Seq.
  • Sub-packages: policy (CircuitBreaker, written on the public seam), step (Decorate, Decorate3, Middleware, Retry with an injected Backoff, Timeout, Tolerate), seq.
  • Measured: BENCHMARK.md, make bench; the README's performance claims come from it.
  • Decided against, with the reason recorded in CONVENTIONS.md or here:
    • Distinct — a global "seen" set belongs to the user's store; ExampleStream_Chunk_deduplication.
    • WithLogger — replaced by WithOnError; the library has nothing to say on its own.
    • GroupBy, CountBy — ReduceBy covers both; CountBy means two different things across libraries. Find — Filter(p).First(), shown in ExampleStream_First_find.
    • Pair / tuple — Zip takes a callback that names the fields; a generic pair nests badly.
    • stock backoffs (Constant, Exponential) — pacing is a solved problem elsewhere; step declares the cenkalti/backoff method set and takes no dependency.
    • direct implementations of Map / Filter / Collect — a quarter of a 12 ns/element gap for four duplicated operators (BENCHMARK.md).
    • apidiff in CI — its comparer blows up on generic methods (5-line repro, 21 GB before OOM); see the parking lot for the replacement.

Next: v0.1.0

The core API freeze. After this tag a breaking change is a minor bump with a migration note in CHANGELOG.md until v1; additions are minors too.

  • README rewritten around real use (BatchEventSaver, runnable as Example_batchEventSaver), ChunkTimeout in the changelog
  • the last breaking change before the freeze: Seq2 means any two-value iterator (as Entry), the fallible constructor is SeqErr
  • tag v0.1.0, then go mod download github.com/shults/chunkflow@v0.1.0 so pkg.go.dev indexes it

Parking lot

Ideas without a decision. They enter only with a concrete use case.

  • public API check in CI without apidiff: the std-library pattern, an api.txt listing every exported identifier with its type per package, generated by a small go/types program and committed; CI fails when the generated listing differs from the committed one, so a change to the API has to be deliberate in the same PR. Removed lines are breaking, added ones are a minor. Zero dependencies, seconds in CI. Also: report the apidiff bug upstream with the repro
  • more policies in policy, e.g. Tolerate(func(error) bool) on a stream, an in-stream error observer, a breaker with a time window. Each is additive and enters with a use case
  • step: a third callback shape (func(ctx, T) error for TapCtx / ForEachCtx) is ten more lines when needed; whether the package stays in this module or becomes its own is open, it imports only Suppress and ErrSuppressed from the root
  • pool optimisations the benchmarks pointed at, none taken: policy.CircuitBreaker formats a message per tolerated error (~430 ns vs ~125 ns for a bare Suppress), a lazy error type would remove most of it; the ordered pool allocates a ticket and a channel per element, a ring buffer of size k would allocate once per stage (~20%); the remaining ~500 ns/element is channel operations and wake-ups, which only batching (double buffering between feeder and workers) amortises, at the price of a window in batches and an idle-flush. All of it speeds up the workload that should not use a pool; wait for someone measuring the pool as a bottleneck
  • WithReadAhead(m): options.readAhead exists (default 2, window 2n); a StepOption taking a multiplier, never an absolute size, for plenty of memory and high latency variance per call
  • an opt-in context-free, error-free stream type for pure in-memory work, if the ~2.7× overhead over memStream (bench_test.go) ever matters to someone
  • fuzz tests for the Chunk + Flatten round trip