Skip to content

perf: add Linux perf profiling artifacts#89

Merged
div0rce merged 16 commits into
mainfrom
feat/m29-linux-perf-profiling
Jun 2, 2026
Merged

perf: add Linux perf profiling artifacts#89
div0rce merged 16 commits into
mainfrom
feat/m29-linux-perf-profiling

Conversation

@div0rce
Copy link
Copy Markdown
Owner

@div0rce div0rce commented Jun 1, 2026

Summary

  • Add Linux-only make perf-stat / make perf-record targets and scripts for perf stat plus perf record/report evidence.
  • Document the M29 workflow in docs/perf_analysis.md and link it from Linux performance notes/results docs.
  • Commit regenerated Linux artifacts in results/perf_stat_linux.txt and results/perf_report_linux.txt with hardware/kernel/compiler/perf/git/dirty-tree metadata.
  • Harden partial mode so QSL_PERF_ALLOW_PARTIAL=1 can document constrained perf environments but cannot hide a failing qsl-bench workload.
  • Raise the default perf record sample frequency to 2000 Hz so the short default benchmark can realistically clear the 100-sample hot-profile floor on hosts where sampling is permitted.
  • Parse abbreviated perf sample counts (K/M, decimals, commas, lowercase suffixes) before applying the minimum-sample gate.
  • Harden dirty-tree metadata so generated perf artifact paths are excluded only when they are inside the repo; external absolute paths such as /tmp/report.txt are omitted from Git pathspecs, and dirty-check failures abort instead of recording misleading clean metadata.
  • Clarify docs that default M29 perf artifacts profile only the default qsl-bench suite; qsl-bench diff and qsl-bench pool require separate explicit perf runs before supporting hotspot conclusions.

Verification

  • bash -n scripts/perf_stat.sh scripts/perf_record.sh
  • make check passes locally: 186/186.
  • Parser regression check against the actual parse_sample_count_token helper:
    • # Samples: 2K ... -> 2000
    • # Samples: 1.5K ... -> 1500
    • # Samples: 3M ... -> 3000000
    • # Samples: 1,234 ... -> 1234
    • # Samples: 42 ... -> 42
    • lowercase/whitespace variants also pass.
  • Fake perf report --stdio end-to-end check: # Samples: 2K ... produces Sample count: 2000, Insufficient samples: no, No samples: no, and Artifact: software sampling hot-symbol profile.
  • Negative-path check: with QSL_BENCH_BIN=/usr/bin/false and QSL_PERF_ALLOW_PARTIAL=1, both perf scripts exit 4 before perf collection; partial mode does not override benchmark failure.
  • Dirty metadata path checks with fake Linux/perf harness:
    • QSL_PERF_STAT_OUT=/tmp/qsl-stat-outside.txt -> Dirty tree: no, no Git fatal/pathspec error.
    • QSL_PERF_REPORT_OUT=/tmp/qsl-report-outside.txt QSL_PERF_DATA=/tmp/qsl-perf-outside.data -> Dirty tree: no, no Git fatal/pathspec error.
    • QSL_PERF_STAT_OUT=$PWD/results/tmp_abs_stat.txt -> Dirty tree: no.
    • QSL_PERF_REPORT_OUT=$PWD/results/tmp_abs_report.txt QSL_PERF_DATA=$PWD/results/tmp_abs_perf.data -> Dirty tree: no, Sample count: 2000.
  • Docker Desktop Linux preflight:
    • uname -a: LinuxKit aarch64
    • perf --version: 6.1.174
    • /proc/sys/kernel/perf_event_paranoid: 2
    • perf stat -e cycles,instructions,branches,branch-misses,cache-references,cache-misses -- true: hardware counters are unavailable/permission-limited in this environment.
  • Docker Desktop Linux regenerated both committed perf artifacts from clean source commit 6024b30 with Dirty tree: no and Benchmark binary: build/bench/qsl-bench; the artifact-refresh commit is 6cdda3b.

Scope Split

PR #89 lands the perf workflow plus constrained-environment validation only. Full Linux hardware PMU evidence is backlogged separately in issue #90: #90

Caveat

The committed perf_stat_linux.txt is intentionally labeled Artifact: constrained-environment validation (partial; not full hardware PMU evidence) because Docker Desktop Linux does not expose usable hardware PMU counters here. It must not be treated as full M29 hardware-counter evidence.

The committed perf_report_linux.txt is intentionally labeled Artifact: constrained-environment validation (partial; no clean sample report). It has No samples: yes, Sample count: 0, and Perf access limitation: yes, so it is not hot-symbol evidence and should not guide optimization work in this Docker environment.

Full M29 PMU evidence still requires bare-metal Linux or a VM with hardware perf_event access where the required counters are supported and Unsupported counters detected: no. No optimization or production-latency claim is made.

@div0rce
Copy link
Copy Markdown
Owner Author

div0rce commented Jun 2, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 59d0b5cac4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread results/perf_stat_linux.txt Outdated
@div0rce
Copy link
Copy Markdown
Owner Author

div0rce commented Jun 2, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1f79a848ae

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/perf_stat.sh Outdated
Comment thread results/perf_report_linux.txt Outdated
@div0rce
Copy link
Copy Markdown
Owner Author

div0rce commented Jun 2, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1a7eba21b6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/perf_record.sh Outdated
@div0rce
Copy link
Copy Markdown
Owner Author

div0rce commented Jun 2, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ab3dc71af6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/perf_record.sh Outdated
@div0rce
Copy link
Copy Markdown
Owner Author

div0rce commented Jun 2, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a313a0d5e0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/perf_record.sh Outdated
@div0rce
Copy link
Copy Markdown
Owner Author

div0rce commented Jun 2, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e9ac7bda94

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/perf_analysis.md Outdated
@div0rce
Copy link
Copy Markdown
Owner Author

div0rce commented Jun 2, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@div0rce div0rce marked this pull request as ready for review June 2, 2026 05:48
@div0rce div0rce merged commit 60bd5ee into main Jun 2, 2026
6 checks passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6cdda3b84f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Perf: perf version 6.1.174
Perf paranoid: 2
Build type: Release
Git commit: 6024b30
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Regenerate perf artifacts from the reviewed tree

The current reviewed commit is 99ff89a, but the committed artifact metadata still says these numbers came from 6024b30 with Dirty tree: no (and results/perf_report_linux.txt has the same mismatch). Fresh evidence after the earlier comment is that this final tree now fixes the target path issues, but the artifact provenance still points at a different commit, so consumers cannot verify that the saved perf output was produced from the code/scripts being reviewed or merged.

Useful? React with 👍 / 👎.

@div0rce
Copy link
Copy Markdown
Owner Author

div0rce commented Jun 2, 2026

Documentation synchronization pass pushed: roadmap/memory files now classify M29 as perf workflow + constrained-environment validation only, record issue #90 as full PMU evidence debt, add M32-M41, and add ADRs for TSan limits, allocator-vs-storage separation, and constrained perf artifacts. No code or benchmark results changed.

@div0rce
Copy link
Copy Markdown
Owner Author

div0rce commented Jun 2, 2026

@codex review

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