Skip to content

Commit a255a33

Browse files
committed
Rename flow tracing skill helper
Signed-off-by: "Nicholas Gates" <nick@nickgates.com>
1 parent 614d947 commit a255a33

3 files changed

Lines changed: 21 additions & 21 deletions

File tree

.agents/skills/bench-performance/SKILL.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ and ratios against the selected baseline target or the first target in each quer
201201
## Summarizing Mask/Row-Demand Logs
202202

203203
When a run emits Vortex mask-style debug lines, summarize them before reading more code. This
204-
includes V2 `vortex_layout::mask_debug` rows and V1 pruning rows with the same coordinate fields.
204+
includes mask-debug rows and pruning rows with the same coordinate fields.
205205
These logs are useful for deciding whether a hot stack is expensive per row, called over too many
206206
rows, or repeated over the same coordinates:
207207

@@ -218,8 +218,8 @@ If a low-selectivity filter still shows very large input batches late in the pip
218218
with the Samply timeline: a few huge all-false batches can explain idle workers even when total row
219219
work looks reasonable.
220220

221-
For conjunct scheduling logs, aggregate compute rows per predicate. This handles V2 conjunct rows
222-
and V1 pruning/filter conjunct rows when the logs include comparable fields:
221+
For conjunct scheduling logs, aggregate compute rows per predicate. This handles candidate
222+
conjunct rows and baseline pruning/filter conjunct rows when the logs include comparable fields:
223223

224224
```bash
225225
python3 .agents/skills/bench-performance/scripts/summarize_conjunct_debug.py \
@@ -229,16 +229,16 @@ python3 .agents/skills/bench-performance/scripts/summarize_conjunct_debug.py \
229229
Use this when checking whether a pushed-down or shared mask is actually evaluated once, or whether
230230
each projected field is driving the same conjunct work again.
231231

232-
When investigating V2 stream scheduling, enable the flow trace and summarize it immediately:
232+
When investigating stream scheduling, enable the relevant flow trace and summarize it immediately:
233233

234234
```bash
235-
VORTEX_V2_TRACE_FLOW=1 RUST_LOG=vortex_layout::v2::flow=debug,datafusion=warn \
235+
<FLOW_TRACE_ENV>=1 RUST_LOG=<flow-target>=debug,datafusion=warn \
236236
target/<profile-dir>/datafusion-bench clickbench \
237237
--display-format gh-json --iterations 1 --hide-progress-bar \
238238
--formats vortex --queries <query> \
239239
-o /private/tmp/<label>.jsonl > /private/tmp/<label>.log 2>&1
240240

241-
python3 .agents/skills/bench-performance/scripts/summarize_v2_flow.py \
241+
python3 .agents/skills/bench-performance/scripts/summarize_flow_tracing.py \
242242
/private/tmp/<label>.log
243243
```
244244

@@ -325,7 +325,7 @@ rows. Add temporary trace/debug fields that make each compute event joinable:
325325
ranges;
326326
- a deterministic hash of the absolute survivor row set for same-window checks;
327327
- partition-independent fingerprints such as wrapping row-id sum and row-id xor so unions can be
328-
compared when V1 and V2 use different batch boundaries.
328+
compared when two paths use different batch boundaries.
329329

330330
Be careful with multi-file benchmarks: `row_start=0..N` is only meaningful with a file label. Be
331331
careful with nested layouts too: child plans may log local coordinates unless the diagnostic uses
@@ -334,12 +334,12 @@ the same file differently, identical `(file, row_range)` keys may not exist; com
334334
input/output row counts first, then add a union-level dump only if exact row-set equality is still
335335
unclear.
336336

337-
Prefer diagnostic logs over changing public batch types. Useful log points are final V1 split
338-
projection, V2 mask/filter nodes, and filtered V2 leaf projection nodes. For each batch-like event,
339-
emit the input coordinate window plus the post-mask survivor summary/hash; that lets you compare
340-
exact row sets even when physical batch boundaries differ. Avoid logging every unfiltered leaf by
341-
default: nested layouts such as dictionary values may live in a different row space and can drown
342-
out the scan-coordinate signal.
337+
Prefer diagnostic logs over changing public batch types. Useful log points are final baseline split
338+
projection, candidate mask/filter nodes, and filtered candidate leaf projection nodes. For each
339+
batch-like event, emit the input coordinate window plus the post-mask survivor summary/hash; that
340+
lets you compare exact row sets even when physical batch boundaries differ. Avoid logging every
341+
unfiltered leaf by default: nested layouts such as dictionary values may live in a different row
342+
space and can drown out the scan-coordinate signal.
343343

344344
## Samply
345345

.agents/skills/bench-performance/scripts/summarize_conjunct_debug.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
r"(?P<key>[A-Za-z_][A-Za-z0-9_]*)="
1414
r"(?P<value>\"(?:[^\"\\]|\\.)*\"|Some\([^)]+\)|None|[^\s]+)"
1515
)
16+
FIRST_FIELD_RE = re.compile(r" [A-Za-z_][A-Za-z0-9_]*=")
1617

1718

1819
def parse_value(raw: str) -> str:
@@ -38,13 +39,12 @@ def as_float(fields: dict[str, str], key: str) -> float:
3839

3940

4041
def message_for(line: str) -> str | None:
41-
for message in (
42-
"v2 conjunct mask evaluated",
43-
"v1 pruning conjunct evaluated",
44-
"v1 filter conjunct evaluated",
45-
):
46-
if message in line:
47-
return message
42+
rest_match = re.search(r":\d+: (?P<rest>.*)$", line.rstrip())
43+
rest = rest_match.group("rest") if rest_match else line.rstrip()
44+
first_field = FIRST_FIELD_RE.search(rest)
45+
message = rest[: first_field.start() if first_field else len(rest)].strip()
46+
if "conjunct" in message and "evaluated" in message:
47+
return message
4848
return None
4949

5050

.agents/skills/bench-performance/scripts/summarize_v2_flow.py renamed to .agents/skills/bench-performance/scripts/summarize_flow_tracing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python3
2-
"""Summarize V2 flow tracing logs emitted with VORTEX_V2_TRACE_FLOW=1."""
2+
"""Summarize structured flow tracing logs from benchmark runs."""
33

44
from __future__ import annotations
55

0 commit comments

Comments
 (0)