Skip to content

Keep the Perf workflow's write access out of the Duel job - #79

Merged
sferik merged 1 commit into
mainfrom
duel-workflow
Oct 26, 2026
Merged

sferik merged 1 commit into
mainfrom
duel-workflow

Conversation

@sferik

@sferik sferik commented Oct 26, 2026

Copy link
Copy Markdown
Owner

A review of the same Duel workflow in another project turned up a couple of things worth fixing here too, so this brings perf.yml in line with what duel init generates now.

The Duel job checks out and runs the pull request's code, benchmarks included, and it also had pull-requests: write so it could post its report. Now it only reads, and its checkout keeps no credentials. It uploads the report as an artifact, and a separate Comment job downloads it and posts the comment. That job checks nothing out and runs none of the branch's code, so it's the only one that can write. A pull request from a fork still gets no comment, since its token can't write one, but the job's summary has the report.

The other fix is in .duel.rb. Duel only compares a change that touches lib/ or ext/, so a pull request that changed only the benchmarks or the config passed with "nothing to compare", and a broken benchmark could slip through. It now watches duel/, .duel.rb and the workflow too. That also means this pull request runs a real comparison of the code with itself, which checks that the new workflow works.

The Duel job checks out and runs the pull request's code, benchmarks
included, so it no longer has pull-requests: write, and its checkout
keeps no credentials. It uploads its report, and a Comment job of its
own, which checks nothing out and runs none of the branch's code,
posts the comment.

.duel.rb also watches the benchmarks, itself and the Perf workflow, so
a pull request that changes only those is compared, instead of passing
with nothing to compare.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T01:32:14.810521Z 0ed9b95 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown

Duel passed: none of 23 benchmarks slower

  • Baseline: 2822344, where HEAD left origin/main
  • Candidate: b976316

23 benchmarks in 28s. A timing is slower when a 99.0% confidence interval for its ratio, the candidate's to the baseline's, is above 1.02.

Across the board

  • cpu 0.999 [0.995, 1.003] same (limit 1.0050, 23 benchmarks)
23 benchmarks unchanged
Benchmark Timings (ratio [interval])
backend: libxml, 20 records cpu 0.999 [0.994, 1.014]
backend: libxml SAX, 20 records cpu 0.999 [0.990, 1.018]
backend: nokogiri, 20 records cpu 0.997 [0.986, 1.008]
backend: nokogiri SAX, 20 records cpu 1.000 [0.958, 1.011]
backend: oga, 20 records cpu 0.993 [0.790, 1.010]
backend: rexml, 20 records cpu 1.001 [0.989, 1.014]
boot: require multi_xml cpu 1.002 [0.979, 1.008]
parse: a tiny document cpu 0.994 [0.966, 1.009]
parse: 10 records cpu 1.009 [0.970, 1.019]
parse: 120 records cpu 1.002 [0.992, 1.011]
parse: a large catalog cpu 0.997 [0.973, 1.016]
parse: 450 shallow fields cpu 1.002 [0.988, 1.013]
parse: a tree 180 levels deep cpu 0.995 [0.983, 1.013]
parse: attribute-dense nodes cpu 1.003 [0.992, 1.016]
parse: mixed content cpu 1.006 [0.980, 1.015]
parse: a feed, namespaces stripped cpu 0.999 [0.978, 1.016]
parse: a feed, namespaces preserved cpu 0.993 [0.980, 1.004]
parse: dashed keys cpu 1.003 [0.990, 1.014]
parse: 120 records, symbolized names cpu 0.998 [0.983, 1.020]
parse: 120 records, no typecasting cpu 0.996 [0.982, 1.016]
parse: 10 records from an IO cpu 1.008 [0.989, 1.018]
typecast: one typed record cpu 0.993 [0.984, 1.015]
typecast: 50 typed records cpu 1.000 [0.981, 1.011]

@sferik
sferik merged commit a8b262c into main Oct 26, 2026
41 checks passed
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