Skip to content

[VFDLIBM-30] Join a host's run and re-run at different commits when the code differs only in comments - #145

Merged
MaxGekk merged 4 commits into
mainfrom
record-rerun-commits
Nov 23, 2026
Merged

MaxGekk merged 4 commits into
mainfrom
record-rerun-commits

Conversation

@MaxGekk

@MaxGekk MaxGekk commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Part of #30.

bench/record.py write --run A --run B and check with the same runs now join a later run at another commit than the first run's, which they refused since #48, when the code under the file's benchmark is the same at both commits but for comments and whitespace; host, CPU, JMH options and vector settings must still match exactly, and at different commits the JDK and the header's Command too.

The code under a benchmark class is a closure taken by git at both commits: the class's file in src/jmh/java, then every file of src/main/java, src/jmh/java and src/test/java that declares at its top level a type whose name is a word of that code (comments dropped, literals emptied), to a fixed point. The two closures must be the same set of files, each equal once comments go and whitespace goes where no two tokens could join across it, literals kept verbatim.

pom.xml must be equal as XML (comments and whitespace aside) but for the project's own <version>, project.build.outputTimestamp, the executions whose id starts with fault- and the profile release; src/main/resources, src/jmh/resources, any non-Java file under src/main/java or src/jmh/java and any module-info.java or package-info.java there must be equal too, and src/test/resources when a test class is in the closure.

The comment stripper handles // comments (ended at CR or LF) and /* */ comments, string and char literals and text blocks (a comment marker inside one is the literal's), and refuses a \u escape that decodes to /, *, a quote, a backslash, a brace or a line end rather than guess; an unclosed comment or literal is refused too, but only when its file is in the closure.

A whole-tree rule (all of src/main/java comment-equal) was not enough: between 03ea082 and bc7e91b, Acos, Asin, Atan and Atan2 were added and VFdlibm.java changed in code, so it would refuse cosh, whose benchmarks never load them.

When the commits differ, write puts a machine-made # Code: line under the later run's # Run N of M line naming both commits, the rule and the files compared; check recomputes it from git and fails if a word differs or it is missing. A commit the clone lacks is fetched from origin, and if it cannot be, the runs are refused.

When the code under a class differs, write leaves that run out of that class's file with a note naming the files (the run is a first run of new code, a file of its own) and still joins it to the files of the other classes, and check refuses a file that holds such a run; a run that so joins no file refuses the whole write, as a run sharing no class does. AGENTS.md's sentence on re-runs now says so.

git runs with GIT_TERMINAL_PROMPT=0 and no stdin, and the fetch of a missing commit times out after 120 seconds, failing with the clone's message.

The Javadoc and docs that still call these EPYC 7763 files one run waiting for a re-run (Atan2Benchmark.java, Atan2.java, CoshBenchmark.java, Cosh.java, CoshKindsBench.java, PLAN.md, SKILLS.md), stale since #142, are left for the requote pull request.

The EPYC 7763 re-run (run 45071280263, main at bc7e91b) is folded back as run 2 into cosh-epyc7763-2026-11-21.txt, cosh-kinds-epyc7763-2026-11-21.txt (first run 44929622224, 03ea082) and atan2-epyc7763-2026-11-22.txt (first run 45049628267, d3bb335), and the three *-rerun-epyc7763-2026-11-22.txt files from #142 are deleted; nothing else referred to them.

Each file's title, provenance and reading now cover both runs: the readings carry #142's figures over, each recomputed from the two tables, and add run 2's figures to the points that only run 1 had (minimums, scalar ratios, kind costs, mixed over common, same-width spreads). No comparison of the arms reads otherwise than in #142: cosh's finish arm is lower on common data at all three widths, no direction on mixed; CoshKindsBench reads no direction at 3.5% and 17% small lanes; atan2's arms have no direction on this host.

Why are the changes needed?

AGENTS.md asks that a run and its re-run on one host go in one file, and #142 had to write the re-run as separate files only because the two runs timed different commits whose benchmarked code differed in comments alone; the owner decided on 23 November that such runs join one file.

Does this PR introduce any user-facing change?

No

How was this patch tested?

bench/record.py --selftest (run by ci.yml) passes; it builds a scratch git clone and covers comments of both kinds, a/**/b, whitespace reflow, - -x against --x, comment markers inside a string, a char and a text block, escaped quotes, the \u refusals and an escaped backslash, CR-ended line comments, unclosed comments and literals, top-level against nested types, pom.xml's ignored and kept parts, a comment-only change joining, a code change and a new file in the closure refusing with their names, a change outside the closure ignored, an unreadable file outside the closure ignored and inside it refused, a new module-info.java refused, the # Code: line tampered or cut, a re-run of other code left out of one class's file and joined to another's, a middle run lacking the class (the note numbered by its place in the file), a re-run that joins no file refused, a fetch from an origin that cannot answer, a commit the clone lacks, and another JDK or command at another commit.

A mutation pass on the new code (string literals not recognised, release profile kept, closure not followed, note not compared, JDK not compared, \u check off) fails the self-test each time.

bench/record.py check passes on the three rewritten files with both runs (--run 44929622224 --run 45071280263 for the cosh files, --run 45049628267 --run 45071280263 for atan2), still passes on log1p-epyc7763-2026-11-20.txt, a same-commit pair of runs, and fails on a rewritten file given only its first run.

Was this patch authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Opus 5.5)

Max Gekk added 4 commits November 23, 2026 01:24
…he code differs only in comments

bench/record.py write and check join a later run at another commit than the first run's when the
JDK is the same and the code under the benchmark is the same but for comments and whitespace:
the benchmark's src/jmh/java file and every type its code names in src/main/java, src/jmh/java
and src/test/java, transitively, at both commits, and pom.xml as XML without the project's
version, project.build.outputTimestamp, the fault-* executions and the release profile. A
"# Code:" line under the run's line names the commits and the files compared, and check computes
it again from git. Otherwise the runs are refused, the differing files named.

The EPYC 7763 re-run of cosh and atan2 (run 45071280263) now sits as run 2 in
cosh-epyc7763-2026-11-21.txt, cosh-kinds-epyc7763-2026-11-21.txt and
atan2-epyc7763-2026-11-22.txt, each reading comparing both runs, and the three -rerun files go.

Part of #30.

Generated-by: Claude Code (Opus 5.5)
…are more of the build

A re-run whose code differs under one class is left out of that class's file only, in a note
naming the files, and joins the others; check refuses a file that holds such a run, and drops it
when it was given but is not in the file. The code note numbers a run by its place in the file.
A line comment ends at CR too, a \u escape of a brace is refused, a file outside the closure that
cannot be read refuses nothing, and src/jmh/resources, non-Java files under the main and jmh
roots, module-info.java and package-info.java are compared. At different commits the header's
Command must match as well as the JDK. git's replies are checked.

Generated-by: Claude Code (Opus 5.5)
…ference

A file of the closure that cannot be read at one of the two commits is now a difference named in
the refusal, not a KeyError, and one read only as resources is compared by bytes; an unreadable
file in the closure leaves the run out of that class's file like other code. check reports a
re-run of other code as a difference (status 1), and write's note names the run by its place
among the runs given.

Generated-by: Claude Code (Opus 5.5)
…n full, and fetch without a prompt

write now refuses a later run that joins no file because its code differs under every class it
shares, as it refuses one that shares no class. The "# Code:" line's rule says what the
comparison does: whitespace dropped only where no two tokens could join, literals verbatim, and
the resources, module-info.java, package-info.java and non-Java files compared too; the three
EPYC 7763 files carry the regenerated line. git runs with GIT_TERMINAL_PROMPT=0 and no stdin,
and the fetch of a missing commit times out after 120 seconds with the clone's message.

Generated-by: Claude Code (Opus 5.5)
@MaxGekk
MaxGekk merged commit c5c0792 into main Nov 23, 2026
10 checks passed
MaxGekk added a commit that referenced this pull request Nov 23, 2026
### What changes were proposed in this pull request?

Part of #30.

Requotes the cosh and atan2 sentences that still described one run per host, from the files that now hold the re-runs: `cosh-epyc7763-2026-11-21.txt`, `cosh-kinds-epyc7763-2026-11-21.txt` and `atan2-epyc7763-2026-11-22.txt` (two runs each since #145) and `atan2-xeon8573c-2026-11-22.txt` (two runs since #146). Comments and documents only.

- atan2 (`Atan2.java`, `Atan2Benchmark.java`, `SKILLS.md` atan2 entry, `PLAN.md` section 5, `README.md` "Rare paths"): each host has timed both arms in a run and a re-run, and neither file gives them a direction; guarded stays the default at every species by the owner's decision of 22 November (issue #30's corrected comment). The "until a re-run of each host" wording is gone.
- cosh (`Cosh.java`, `CoshBenchmark.java`, `CoshKindsBench.java`, `SKILLS.md` cosh entry, `PLAN.md` sections 1 and 5): the slice arm stays the default, provisionally, as rule 1's named exception, whose arm a host run decides (#30 (comment)). The readings, as the files state them: on `CoshBenchmark` the EPYC 7763's two runs agree, outside 1.3x, on the finish arm lower on common data (1.33 to 1.37), a direction, and give none on mixed data; on `CoshKindsBench` the finish arm reads lower outside 1.3x with no small lane (1.46 to 1.70 on both hosts), lower inside 1.3x at 3.5% of small lanes, and the slice arm lower inside 1.3x at 17%. The Xeon 8573C has one `CoshBenchmark` run; a second run decides. In PLAN section 5 these readings are a sentence of their own after the list of defaults.
- expm1 and log1p (`PLAN.md` section 5, `README.md`): they keep the guarded arm by the owner's deferral of rule 1 until a second run, on the 8573C, of the code the 22 November files time; #148 recorded those files as the first run of that code.
- `HARDWARE.md` "The 8573C's two readings" and its table row: recounted after #148, nineteen of the twenty files of this host in the lower reading, naming run 45082534869's `expm1-`, `log-`, `log10-` and `log1p-xeon8573c-2026-11-22.txt` and the second run in `atan2-xeon8573c-2026-11-22.txt` (34.6 / 69.1 / 93.8); the ranges and ratios are unchanged.

The branch also holds a commit that made cosh's finish arm the default and its follow-up, each reverted by a plain commit after the owner chose to keep slice until a second Xeon cosh run; the net diff has no code change and no CHANGELOG line. It merges main (with #148) rather than rebasing.

### Why are the changes needed?

#145, #146 and #148 added the EPYC 7763's re-run of cosh and atan2, the Xeon 8573C's second run of atan2 and its first run of today's expm1, log1p, log and log10, and the documents still said each host had timed cosh and atan2 once, that their defaults waited for those re-runs, and that the 8573C had sixteen files.

### Does this PR introduce _any_ user-facing change?

No. Javadoc comments and documents only.

### How was this patch tested?

`mvn -B -T1 -DskipTests test-compile` and `javadoc -Xdoclint:all,-missing` on the main sources pass. Every requoted claim was checked against the readings of the six cosh and atan2 files, and the datapath count against every Xeon file's `# Datapath:` header.

### Was this patch authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Opus 5.5)
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