Category
Naming / Consistency
Component
Other (please specify in description)
Affects the [STRACE] span vocabulary, which spans src/common/,
simpler_setup/tools/, the docs, and two external repositories.
Description
Span names currently come in two unrelated families with no shared scheme, and one
of them is a de-facto contract with repositories outside this one.
Today:
| Family |
Emitted by |
Occurrences |
simpler_run*, simpler_prewarm.* |
the chip runtime in the forked child |
~185 in 37 files |
l3.* |
the L3 parent (added by #1730, unreleased) |
~59 in 17 files |
The scheme. One word per level of the hierarchy — the same levels, named
instead of numbered:
| Prefix |
Level |
What it describes |
Replaces |
pod. |
L4 |
a Worker whose children are L3 Workers |
nothing emits it yet |
host. |
L3 |
one host driving chips: graph build, submit, dispatch, worker threads |
l3.* |
chip. |
L2 |
the chip runtime in the forked child |
simpler_run*, simpler_prewarm.* |
core. |
L0 |
the in-core AIC/AIV pipeline |
the core-swimlane tool's own output |
Numeric levels stay out of the names, consistent with codestyle rule 13's mapping
of L2 → Chip and L0 → Core. Rule 13 lumps L3+ together as unprefixed because
it governs type and identifier names, where one Worker serves every level above
the chip; a trace does need L3 distinguished from L4, hence two words where the rule
has none.
The prefix is per process, not per call site. Orchestrator::submit_impl and
WorkerThread::submit_dispatch are level-agnostic — the same code runs at L3 and
L4. It does not need to be per site: a Worker forks its next-level children into
separate processes, so one process hosts exactly one Worker level, and the prefix
resolves once at Worker init.
Reserve a namespace for external producers. pod./host./chip./core. are our
levels and a caller is not one of them; without a reserved prefix a caller's span
named host.foo parses as ours. Settle it here rather than when a public tracing
API lands, because this is the one moment every name and every parser is already
being touched.
Location
Inside this repo:
simpler_setup/tools/strace_timing.py — legacy_spans(), _ROUNDS_TABLE_NAMES,
_host_thread_name, the swimlane process-role test, the flow-key pairing
- Hardcoded assertions that will fail loudly (good):
tests/st/a2a3/host_build_graph/native_run_lifecycle/test_native_run_lifecycle.py
(an expected-depth table), tests/st/a5/tensormap_and_ringbuffer/bench_prewarm_timing.py
(a compiled regex on name=simpler_run.bind.prebuilt),
examples/workers/l2/vector_add/test_run_timing.py, tests/ut/py/test_strace_timing.py
- Docs:
docs/dfx/host-trace.md, docs/dfx/l2-timing.md, docs/dfx/device-phases.md,
simpler_setup/tools/README.md, and the dfx-analyze / benchmark skills
Outside this repo — the reason this needs coordination rather than a rename commit:
docs/dfx/host-trace.md frames this as a feature: "A consumer (e.g. pypto-serving)
reads the per-stage breakdown from the log, with no code change on its side and no
API contract." "No API contract" is precisely the problem — the names are the
contract. #1210 already renamed a span root once, the downstream repo had to adapt,
and the scar is still in its code.
Proposed Fix
Coordinated rename across simpler, pypto-lib and pypto-serving together — no
dual-spelling window and no alias table, so the retired spellings actually go away
rather than lingering the way #1210's did.
- Settle the merge order. simpler emits the new names, so it lands last or behind
something the other two can pin against; otherwise their parsers see unknown
names for the window between merges.
- Rename in simpler, and replace
legacy_spans()'s allow-list with an explicit
family split so per-task host.* spans stay out of the invocation-grouping path.
- Downstream edits in the two files located above.
- A grep gate per repo: zero occurrences of the retired spellings, in prose as
well as code, since the pypto-serving consumer is a runbook.
Blocked on #1792's "one span entry point" item — renaming one emit site is far
easier than renaming three — and on the by_name() fix requested in #1730, because
removing the allow-list is what makes that latent bug live.
Priority
Medium
Category
Naming / Consistency
Component
Other (please specify in description)
Affects the
[STRACE]span vocabulary, which spanssrc/common/,simpler_setup/tools/, the docs, and two external repositories.Description
Span names currently come in two unrelated families with no shared scheme, and one
of them is a de-facto contract with repositories outside this one.
Today:
simpler_run*,simpler_prewarm.*l3.*The scheme. One word per level of the hierarchy — the same levels, named
instead of numbered:
pod.host.l3.*chip.simpler_run*,simpler_prewarm.*core.Numeric levels stay out of the names, consistent with codestyle rule 13's mapping
of L2 →
Chipand L0 →Core. Rule 13 lumps L3+ together as unprefixed becauseit governs type and identifier names, where one
Workerserves every level abovethe chip; a trace does need L3 distinguished from L4, hence two words where the rule
has none.
The prefix is per process, not per call site.
Orchestrator::submit_implandWorkerThread::submit_dispatchare level-agnostic — the same code runs at L3 andL4. It does not need to be per site: a Worker forks its next-level children into
separate processes, so one process hosts exactly one Worker level, and the prefix
resolves once at Worker init.
Reserve a namespace for external producers.
pod./host./chip./core.are ourlevels and a caller is not one of them; without a reserved prefix a caller's span
named
host.fooparses as ours. Settle it here rather than when a public tracingAPI lands, because this is the one moment every name and every parser is already
being touched.
Location
Inside this repo:
simpler_setup/tools/strace_timing.py—legacy_spans(),_ROUNDS_TABLE_NAMES,_host_thread_name, the swimlane process-role test, the flow-key pairingtests/st/a2a3/host_build_graph/native_run_lifecycle/test_native_run_lifecycle.py(an expected-depth table),
tests/st/a5/tensormap_and_ringbuffer/bench_prewarm_timing.py(a compiled regex on
name=simpler_run.bind.prebuilt),examples/workers/l2/vector_add/test_run_timing.py,tests/ut/py/test_strace_timing.pydocs/dfx/host-trace.md,docs/dfx/l2-timing.md,docs/dfx/device-phases.md,simpler_setup/tools/README.md, and thedfx-analyze/benchmarkskillsOutside this repo — the reason this needs coordination rather than a rename commit:
pypto/runtime/bench.pycarries its own copy of the span-nametable (
_ROUNDS_TABLE_NAMES), and its comments still reference therun_prepared→simpler_runroot rename from simpler Refactor: rename prepare/run vocabulary to register, layered by ABI tier #1210 — with the tablestill keyed off the pre-Refactor: rename prepare/run vocabulary to register, layered by ABI tier #1210 spelling.
golden/runner.pyreuses that parser..agents/skills/qwen3-14b-offline-perf-test/SKILL.mdhardcodessimpler_run,runner_run,device_walland the formulasimpler_run.runner_run.device_wall.graph_buildasEffective. Being a runbook,it fails silently — the agent simply stops finding the field.
docs/dfx/host-trace.mdframes this as a feature: "A consumer (e.g. pypto-serving)reads the per-stage breakdown from the log, with no code change on its side and no
API contract." "No API contract" is precisely the problem — the names are the
contract. #1210 already renamed a span root once, the downstream repo had to adapt,
and the scar is still in its code.
Proposed Fix
Coordinated rename across simpler, pypto-lib and pypto-serving together — no
dual-spelling window and no alias table, so the retired spellings actually go away
rather than lingering the way #1210's did.
something the other two can pin against; otherwise their parsers see unknown
names for the window between merges.
legacy_spans()'s allow-list with an explicitfamily split so per-task
host.*spans stay out of the invocation-grouping path.well as code, since the pypto-serving consumer is a runbook.
Blocked on #1792's "one span entry point" item — renaming one emit site is far
easier than renaming three — and on the
by_name()fix requested in #1730, becauseremoving the allow-list is what makes that latent bug live.
Priority
Medium