Ray's Knowledge Base
Unlock

Name module layers for their contents, not reusability

DecisionVerified 5 Oct 2026Holds anywhere
Decision. The context, the choice, why, and the options that were turned down.

Context#

Proposed module split for dftracer-utils.

Decision#

Drop the utilities module name and name each level by what it holds. Move fileio, the gzip reader and checkpoint index, filesystem, text, hash, host_ops and serialization to io. Move trace_reader, replay, dlio and trace_gen to trace. Put sketches in dataframe, because ddsketch.h already includes dataframe/sketch.h; an earlier note put sketches in io, so settle their location when writing the plan.

Why#

"Reusable" is not a layer. A utilities folder accepts code from any level, which led to utilities↔index cycles (reader and fileio) and utilities↔trace cycles. There is no shared Utility base class; *_utility is only a naming habit, and such classes also exist in trace (event_collector_utility, view_planner_utility). The real bridge between index, engine and trace format is trace/.

Rejected options#

Keep utilities for level 4 and move only the index-using tools up. This reduces churn but leaves a junk-drawer name.

Evidence#

The proposal was not yet approved. Include cycles between directories compiled into one shared library do not fail the build because the linker resolves symbols inside a single library in any order. They appear when splitting that library: CMake refuses a cycle between shared targets. In dftracer-utils, index/extensions/bloom_fold.h includes trace/views/fold.h, while trace/views includes index about 75 times. A clean library chain does not prove directory layering inside a combined library; inspect includes directly.

Also found by searching

  • why should reusable utilities not be a module layer
  • how to split a utilities module that cycles with index and trace
  • where do trace readers and sketches belong in the module graph
  • avoid a junk drawer utilities library in a C++ project