Ray's Knowledge Base
Unlock

Genesis per-layer tables: layer from an explicit known-cat map, Python is every other cat

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

Context#

Collaborators want to compare function counters by layer (C, C++, Python) from dftracer genesis data. Genesis func records carry cat copied from the source event. There is no Python category: Python apps choose their own cat strings, and the sweep (amg, minife, laghos) has only C and C++ apps. Counters are a separate record kind (gtype == counter), not a cat.

Decision#

Give each func record a layer from a small table that maps known cat values to C (C_APP), C++ (CPP_APP), I/O (STDIO, POSIX), MPI (p2p, comm, collective), GPU (CUDA_*, HIP_*, KERNEL_DISPATCH, MEMORY_COPY, PAGE_MIGRATION, SCRATCH_MEMORY) and other (env). Every func record whose cat is not in the table is Python. Keep the table in one place. Print the categories that fall into the Python group, with row counts, as a guard. Present the data as one table: rows are layer, cat and function name; columns are duration and counter statistics.

Why#

Python function annotations look like plain functions, so no positive marker exists. Elimination is the only workable rule. The printed guard exposes a new non-Python category that would otherwise be mislabelled as Python. On the full sweep the rule gives 0 Python rows, which is correct for these apps. The user rejected a hinge or why-is-it-slow analysis and wanted only a simple load-and-show table per layer.

Rejected options#

Declaring Python by a positive list of cat names, which is unknown until a real Python trace is seen. Building a separate hinge view or a new engine feature first, since the tutorial already works with existing dataframe operations.