Skip to content

-perf.commit must equal the measured tree's HEAD (refuse fabricated or dirty commits) #12

Closed

Description

@tannevaled

-perf.commit is recorded verbatim into perf.json and perf-table.md. On 2026-11-12 a full 40-character SHA reconstructed from a 7-character prefix was passed, so the table would have recorded a commit nobody measured.

Proposal (rbtest, whenever the module-root guard applies):

  • With -perf.commit: resolve HEAD of the tree at <root> (git -C <root> rev-parse HEAD); refuse unless the flag equals that 40-character SHA exactly, naming both values.
  • Dirty tree (git status --porcelain non-empty) with the flag: refuse, listing the dirty paths. Exception: only bench/go.mod / bench/go.sum dirty (consumers bump refbench locally; those are the harness).
  • Without the flag: fill in HEAD, suffixed -dirty when the tree is dirty.
  • No git available: refuse only if the flag was given.
  • The git lookup is replaceable for tests; README documents the flag.

Prior art: priorart on this repo (exit 1) lists only perf-related entries #1, #4, #5, #6, #7, #9, #10; I read their titles, none concerns validating the recorded commit.

Prior art: priorart "perf.commit must equal HEAD sha" at 2026-11-12 10:43 CET reported prior art; checked: read titles of #1,#4,#5,#6,#7,#9,#10: none validates the recorded commit

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions