Skip to content

docs: correct a false claim, perf does sample on the bench (#452) - #849

Merged
jdatcmd merged 1 commit into
mainfrom
docs/452-perf-does-sample
Aug 30, 2026
Merged

docs: correct a false claim, perf does sample on the bench (#452)#849
jdatcmd merged 1 commit into
mainfrom
docs/452-perf-does-sample

Conversation

@jdatcmd

@jdatcmd jdatcmd commented Aug 30, 2026

Copy link
Copy Markdown
Collaborator

design/ISSUE_452_ROUTE_B_VS_PHASE_1.md on main states that perf cannot sample
on the bench box, and uses that to justify replacing the symbol-bucket
attribution with a differential design. The claim is false.

The probe behind it was:

perf record -e cpu-clock -- sleep 1   ->  file written, "has no samples!"

sleep consumes no CPU, so a cpu-clock profile of it has no samples whether or
not the profiler works. The probe could not produce the outcome it was testing
for, so it could not distinguish the two cases.

What is true is narrower: this host has no hardware PMU, so cycles is genuinely
unsupported, which is what #505 records. Software events work. Extending the
first fact to "cannot sample at all" was the error.

Re-checked before opening this, on jd-laptop rather than the bench, because the
point at issue is whether the probe can distinguish the two outcomes:

probe event samples
sleep 1, the original probe cpu-clock 2
CPU-burning loop, same box, same event cpu-clock 4K, 0 lost

The near-empty first result reports an idle workload, not a broken profiler. The
commit records the equivalent re-run on the bench itself: 1K samples, zero lost.

The differential method is not withdrawn. It measures the milliseconds each route
would remove rather than inferring a saving from symbol shares, which is better
evidence for the decision either way. What changes is the record of why it was
chosen, and the note that the attribution it replaced was available.

Documentation only. No code, no test, no build surface.

The commit is bdaacda from feat/452-late-materialization, an unmerged local
branch found during a branch sweep. It is cherry-picked onto current main here
and applies cleanly. Every other branch in that sweep was verified already
contained in main and deleted.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CmUVgsuNiCxuf3FjQKFoGx

I wrote that perf cannot sample on jd-tests and used it to justify replacing the
symbol-bucket attribution with a differential design. The claim was false and the
reason is the rule this session wrote down:

    perf record -e cpu-clock -- sleep 1   ->  file written, no samples

sleep consumes no CPU, so a cpu-clock profile of it has no samples whether or not
the profiler works. The probe could not have distinguished the two outcomes.
Re-run against a CPU-burning workload, same box, same settings: 1K samples, zero
lost.

Hardware events are genuinely unavailable (no PMU; cycles unsupported, which is
what #505 records). Software events work. Extending the first to 'cannot sample'
was mine.

The differential method stands on its own merits -- it measures the milliseconds
each route would remove rather than inferring a saving from symbol shares -- but
it was chosen for a false reason, and the attribution it replaced was available.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FeNm2Gw6h16Z123We3F1vJ
@jdatcmd
jdatcmd merged commit 0e4884c into main Aug 30, 2026
12 checks passed
@jdatcmd
jdatcmd deleted the docs/452-perf-does-sample branch August 30, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant