Skip to content

ci: show newest binary-size revisions first - #41

Merged
zhouguangyuan0718 merged 1 commit into
mainfrom
codex/binary-size-newest-first
Aug 22, 2026
Merged

ci: show newest binary-size revisions first#41
zhouguangyuan0718 merged 1 commit into
mainfrom
codex/binary-size-newest-first

Conversation

@zhouguangyuan0718

Copy link
Copy Markdown
Collaborator

Summary

  • sort binary-size history by LLGo first-parent position with the newest revision first
  • keep the first page focused on the newest commits
  • reverse only the trend-chart selection so charts remain chronological from left to right

Validation

  • python3 -m unittest ci/llgo-size/test_enrich_pull_requests.py
  • replayed the current Pages index: all 98 mapped LLGo main positions are strictly descending
  • git diff --check

@zhouguangyuan0718
zhouguangyuan0718 merged commit ae36fa6 into main Aug 22, 2026
2 checks passed

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review: Newest-first benchmark run ordering

The change flips run ordering to newest-first and is implemented consistently across the Python enrichment (order_runs), the dashboard (latestRun, chartRuns, pagination init), the README, and the tests.

Verified correct:

  • order_runs sorts both main runs (by llgoMainIndex) and other runs (by timestamp) with reverse=True, correctly relying on --main-history being oldest-first (positions enumerated 1=oldest → N=newest).
  • latestRun() now returns runs[0], consistent with newest-first.
  • chartRuns() slices the newest N and .reverse()s on a fresh copy — the source state.index.runs is never mutated — so trend charts still read chronologically left-to-right.
  • Removing the state.page = ceil(...) init is correct: page 1 (state.page default) is now the newest page.
  • README and tests accurately match the new behavior.

No correctness, security, or performance issues found. Two minor readability nits inline.

Comment thread ci/llgo-size/site/app.js
function chartRuns() {
const limit = Number(dom.historyRange.value);
return limit > 0 ? state.index.runs.slice(-limit) : state.index.runs.slice();
const newest = limit > 0 ? state.index.runs.slice(0, limit) : state.index.runs.slice();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nit: the variable is named newest, but it's returned reversed to oldest-first on the next line. A name like recent or selected would read less contradictorily, since the returned array is chronological (oldest→newest), not newest-first. Behavior is correct.


main_runs = [run for run in runs if is_main_run(run)]
other_runs = [run for run in runs if not is_main_run(run)]
main_runs.sort(key=lambda run: run["llgoMainIndex"], reverse=True)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nit: the newest-first result depends on main_history being passed oldest-first (enumerated 1=oldest → N=newest, then sorted reverse=True). That invariant is only documented in the argparse help. A one-line comment here noting main_history is expected oldest-first would keep the intent local to where it's consumed.

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