diff --git a/HARDWARE.md b/HARDWARE.md index c6ccfc9..162c8c3 100644 --- a/HARDWARE.md +++ b/HARDWARE.md @@ -35,7 +35,7 @@ be the whole string ("The Arm host" below). | machine | host key and CPU string | vector flags | JVM | lane-ops/ns at 128 / 256 / 512 | control | 512:256 | source | |---|---|---|---|---|---|---|---| -| Intel Xeon Platinum 8573C | `xeon8573c`, `INTEL(R) XEON(R) PLATINUM 8573C` | full `avx512` set | `UseAVX=3`, `MaxVectorSize=64` | two readings: 34.5-34.8 / 68.8-69.2 / 93.7-94.1 (eight files, 3 to 21 November 2026); 41.5 / 82.7 / 113.0 (one file, 3 November) | 1.98 to 2.00 in the files; 2.00 to 2.03 in Varka's runs | 1.36 to 1.37 in the files; 1.34 to 1.36 in Varka's runs | Varka, `VARKA-62.md` 11.9, 4 runs (the control and 512:256 ranges of Varka's runs); the files named under "The 8573C's two readings" below; the string from vecbricks/varka's fork runs 41465323581, 41255932044 and 41241977271 (the owner's fork of apache/spark) | +| Intel Xeon Platinum 8573C | `xeon8573c`, `INTEL(R) XEON(R) PLATINUM 8573C` | full `avx512` set | `UseAVX=3`, `MaxVectorSize=64` | two readings: 34.5-35.7 / 68.8-70.8 / 93.7-96.3 (fifteen files, 3 to 22 November 2026); 41.5 / 82.7 / 113.0 (one file, 3 November) | 1.98 to 2.00 in the files; 2.00 to 2.03 in Varka's runs | 1.36 to 1.37 in the files; 1.34 to 1.36 in Varka's runs | Varka, `VARKA-62.md` 11.9, 4 runs (the control and 512:256 ranges of Varka's runs); the files named under "The 8573C's two readings" below; the string from vecbricks/varka's fork runs 41465323581, 41255932044 and 41241977271 (the owner's fork of apache/spark) | | Intel Xeon 6973P-C (Granite Rapids) | `xeon6973p`, `Intel(R) Xeon(R) 6973P-C` | full `avx512` set | `UseAVX=3`, `MaxVectorSize=64` | see source | 2.00 to 2.01 | 1.33 to 1.35 | Varka, `VARKA-62.md` 11.9, 2 runs; the string from vfdlibm run 41442062308 | | AMD EPYC 9V45 (Zen 5) | `epyc9v45`, `AMD EPYC 9V45 96-Core Processor` | full `avx512` set | `UseAVX=3`, `MaxVectorSize=64` | see source | 2.04 | 1.99 | Varka, `VARKA-62.md` 11.9, 1 run; the string from Varka's fork runs 41486339971, 41446843041 and 41329377429 | | AMD EPYC 7763 (Zen 3) | `epyc7763`, `AMD EPYC 7763 64-Core Processor` | `avx2`, no `avx512` | `UseAVX=2`, `MaxVectorSize=32` | 45.0-46.5 / 90.0-92.6 / 90.0-92.6 | 1.99 to 2.01 | 1.00 | Varka, `VARKA-62.md` 11.9, 8 runs; the lane rates, a range, from 16 Varka fork runs, 31 October to 2 November 2026 (41236071283 to 41460150392); the string from `bench/results/exp-epyc7763-2026-11-02.txt` and `log-epyc7763-2026-11-02.txt`; `exp-epyc7763-2026-11-20.txt` reads 46.2 / 92.2 / 92.5 (control 2.00, 512:256 1.00) in its first run and 46.3 / 92.4 / 92.4 in its second, inside the range | @@ -74,15 +74,18 @@ it, none is claimed, and whether the ports' arms should differ on Arm waits for ### The 8573C's two readings -Eight of the nine files of this host read 34.5 to 34.8 lane-ops/ns at 128 bits, 68.8 to 69.2 at -256 and 93.7 to 94.1 at 512: `exp-onediv-xeon8573c-2026-11-03.txt` (34.7 / 68.8 / 94.1, control -1.98, 512:256 1.37), `expm1-xeon8573c-2026-11-04.txt` (34.8 / 69.2 / 94.1, 1.99, 1.36) and the six -files of 21 November, `exp-xeon8573c-2026-11-21.txt` and its five siblings (34.5 / 69.1 / 93.7, -2.00, 1.36). `log1p-xeon8573c-2026-11-03.txt`, of the same day as the pair, reads 41.5 / 82.7 / -113.0 (1.99, 1.37), and its scalar `StrictMath` loop reads 7,358 ns on common data where the -`log1p` file of 21 November reads 8,846. Each file's header says which it ran on; no cause for the -difference is claimed here. The 25 nightly draws of this CPU in "What the pool gives" below read -34.5 to 41.7, 68.9 to 83.2 and 93.6 to 113.0 at the three widths. +Fifteen of the sixteen files of this host read 34.5 to 35.7 lane-ops/ns at 128 bits, 68.8 to 70.8 +at 256 and 93.7 to 96.3 at 512: `exp-onediv-xeon8573c-2026-11-03.txt` (34.7 / 68.8 / 94.1, control +1.98, 512:256 1.37), `expm1-xeon8573c-2026-11-04.txt` (34.8 / 69.2 / 94.1, 1.99, 1.36), the nine +files of 21 November, from two runs: `exp-xeon8573c-2026-11-21.txt` and its five siblings (34.5 / +69.1 / 93.7, 2.00, 1.36) and `sinh-`, `cosh-` and `cosh-kinds-xeon8573c-2026-11-21.txt` (34.9 / +69.9 / 94.8, 2.00, 1.36), and the four of 22 November, `asin-xeon8573c-2026-11-22.txt` and its +three siblings (35.7 / 70.8 / 96.3, 1.98, 1.36). `log1p-xeon8573c-2026-11-03.txt`, of the same +day as the pair, reads 41.5 / 82.7 / 113.0 (1.99, 1.37), and its scalar `StrictMath` loop reads +7,358 ns on common data where the `log1p` file of 21 November reads 8,846. Each file's header says +which it ran on; no cause for the difference is claimed here. The 25 nightly draws of this CPU in +"What the pool gives" below read 34.5 to 41.7, 68.9 to 83.2 and 93.6 to 113.0 at the three +widths. The two Xeons are the AVX-512 hosts results wait for and are read first; their 512:256 of about 1.35 means a 512-bit arm can win there, but not by the factor of two its lane count suggests. diff --git a/PLAN.md b/PLAN.md index 5f603a1..b22ca60 100644 --- a/PLAN.md +++ b/PLAN.md @@ -42,15 +42,17 @@ own logarithm and exponential and calls only `sqrt`, `fabs` and `scalbn`. `sinh` (`VFdlibm.sinh`, from `e_sinh.c`, computing through `expm1`'s common path below 22 and finishing the rest per lane), and so is `cosh` (`VFdlibm.cosh`, from `e_cosh.c`, through `exp`'s common path and expm1's `k == 0` lines, with two arms for its small range: the default arm is the slice arm, -provisionally, the host files of 21 November timing both and deciding neither). `asin` is done +provisionally: the host files of 21 November read the finish arm lower on every `CoshBenchmark` +row, by ratios near 1.3x or inside it, and decide neither). `asin` is done too (`VFdlibm.asin`, from `e_asin.c`, with `sqrt` as the Vector API's `SQRT`, one arm, and the lanes of `|x| >= 1` finished per lane), and so is `atan` (`VFdlibm.atan`, from `s_atan.c`, five ranges through one division on blended operands, the lanes from `2^66` up finished per lane), and so is `acos` (`VFdlibm.acos`, from `e_acos.c`, built as asin is), and so is `atan2` (`VFdlibm.atan2`, from `e_atan2.c`, the first function of two arguments: the special lanes blended over the general path, which calls `atan`'s core, no lane finished per lane, and two arms, the -blended one and the guarded one `VFdlibm` calls, provisionally: the host files of 22 November time -both and give them no direction). `log`, `log10` and `log1p` are done too (`VFdlibm.log`, from +blended one and the guarded one `VFdlibm` calls at every species, by the owner's decision of 22 +November; section 5 below gives the case). +`log`, `log10` and `log1p` are done too (`VFdlibm.log`, from `e_log.c`, `VFdlibm.log10`, from `e_log10.c`, which computes through log's common path, and `VFdlibm.log1p`, from `s_log1p.c`), and so is `expm1` (`VFdlibm.expm1`, from `s_expm1.c`, whose reduction is exp's). @@ -136,12 +138,25 @@ five are a later, optional set; the large-argument reduction of the trigonometri The code has changed since both runs (a fault constant and a local in the k conversion, and the finish's first eight lanes written out with constant indices), so no run has timed today's `exp` but for the rows of that pair. - Which arm each function keeps stays provisional until the 8573C has a second run, the other - AVX-512 hosts a first, and a pair exists, and the rules for a tie within 1.3x and for hosts that - disagree are set (issue #30); meanwhile `VFdlibm` calls the finish arm of `exp`, `log` and - `log10`, the guarded arm of `expm1`, `log1p` and `atan2` and the slice arm of `cosh` - (`bench/results/cosh-*-2026-11-21.txt` and `atan2-*-2026-11-22.txt` give the arms of `cosh` - and `atan2` no direction, and each wants a re-run on the EPYC 7763 too). + Which arm each function keeps follows the two rules issue #30 set on 21 November 2026: a tie + within 1.3x on every host that has a file goes to the finish arm, except for `cosh`, whose + per-lane set is not rare, so a host run decides its arm; and where hosts disagree, each species + keeps the arm its own rows choose by that rule. The `*Max` rows of the host files of 3 to 21 + November for `exp`, `expm1`, `log`, `log10` and `log1p` (`exp-onediv-xeon8573c-2026-11-03.txt` and + those of 20 and 21 November; `log1p-xeon8573c-2026-11-03.txt` and `expm1-xeon8573c-2026-11-04.txt` + have no `*Max` row) time the finish that boxed at `SPECIES_MAX` before issue #37, so they are left + out of both rules; a later run's `*Max` rows time today's finish. On the other rows no function + needs rule 2 yet, so `VFdlibm` runs one arm at every species. Every default stays provisional + until a host run revises it. Meanwhile `VFdlibm` calls the finish arm of `exp`, `log` and `log10`; + the guarded arm of `expm1` and `log1p`, by the owner's deferral of rule 1 until the 8573C's second + run (issue #30, 21 November); the slice arm of `cosh`, provisionally, as the rule's exception + (`bench/results/cosh-xeon8573c-2026-11-21.txt` and `cosh-epyc7763-2026-11-21.txt` read the finish + arm lower on every row by ratios near 1.3x or inside it, and give no direction); and the guarded + arm of `atan2`, which has no finish arm, so rule 1 does not pick between its two ([issue #30's + corrected comment](https://github.com/vecbricks/vfdlibm/issues/30#issuecomment-7085437272)). + Neither host's file gives the arms a direction (`atan2-xeon8573c-2026-11-22.txt`, inside 1.3x; + `atan2-epyc7763-2026-11-22.txt`, near 1.3x or inside it, one run), so guarded stays the default at + every species by the owner's decision of 22 November until a re-run of each host. ## 6. Rules diff --git a/README.md b/README.md index 1927a3b..7de059f 100644 --- a/README.md +++ b/README.md @@ -182,10 +182,18 @@ fdlibm's own sequence of operations, lane by lane. That is this library. one arm, `exp`, `expm1`, `log`, `log10`, `log1p`, `cosh` and `atan2`, each have files from the Xeon Platinum 8573C and the EPYC 7763 (`bench/results/`), and each file's reading is in `SKILLS.md`; where two arms are within 1.3x of each other no direction is read, and where the - hosts disagree the files say so. The decision waits for a second run of the 8573C and a first of - the other AVX-512 hosts (`HARDWARE.md`, the EPYC 9V45 when drawn), for `cosh` and `atan2` a - second run of the EPYC 7763 too, a pair, and the rules for a tie and for hosts that disagree - (issue #30). The laptop's numbers do not agree at every width. + hosts disagree the files say so. The rules are set (issue #30): a tie within 1.3x on every host + that has a file goes to the finish arm, except for `cosh`, whose arm a host run decides, and where + hosts disagree each species keeps its own arm (no function needs that yet). `expm1` and `log1p` + stay on their guarded arm by the owner's deferral of the rule until the 8573C's second run. The + `*Max` rows of the host files of 3 to 21 November for `exp`, `expm1`, `log`, `log10` and `log1p` + (`exp-onediv-xeon8573c-2026-11-03.txt` and those of 20 and 21 November; + `log1p-xeon8573c-2026-11-03.txt` and `expm1-xeon8573c-2026-11-04.txt` have no `*Max` row) time the + finish that boxed before issue #37 and are left out of the rules. `atan2` has no finish arm, so + the rule does not pick between its two; neither host's file gives them a direction, and its + guarded arm stays the default at every species by the owner's decision until a re-run of each + host. Every default stays provisional until a host run revises it; `PLAN.md` section 5 gives each + function's case. The laptop's numbers do not agree at every width. ## Testing diff --git a/SKILLS.md b/SKILLS.md index 06843a8..c9c4e27 100644 --- a/SKILLS.md +++ b/SKILLS.md @@ -337,9 +337,13 @@ stops the next port re-trying a settled question. time `exp` as of a5683c3 and a1db6df, and `Exp.java` has changed since by a fault constant, a local and the finish's first eight lanes written out with constant indices (issue #37), so no run has timed today's body as a whole: the pair above times rows of it after that change, on one - host. Which arm `VFdlibm.exp` keeps is not decided here: it waits for a second - run of the Xeon 8573C and a first of the other AVX-512 hosts, a pair and the rules for a tie - within 1.3x and for hosts that disagree (issue #30). Each port measures both on common and mixed + host. `VFdlibm.exp` keeps the finish arm, which those files read lower than the blend by more than + 1.3x on mixed data at 256 bits and the preferred species on both hosts and at 512 bits on the + 8573C (the `*Max` rows of the files committed so far time the finish that boxed before issue #37 + and are left out), and to which issue #30's rules send a tie; + provisionally, until a host run revises it: a second run of the Xeon 8573C, a first of the + other AVX-512 hosts or a pair. Each + port measures both on common and mixed data, decides per branch, and records the decision in its pull request (`PLAN.md` section 5). - **A blended alternative costs its whole form in every lane.** exp computed the C's near form and its `k == 0` form for every lane and blended them. Proving that the far form and the general tail @@ -407,9 +411,11 @@ stops the next port re-trying a settled question. 512-bit rows run in the Java fallback), so the files show no disagreement between the hosts at equal width. Both files time the `log` of a5683c3 and a1db6df, before the finish's first eight lanes written out with constant indices (issue #37); `LogBenchmark` gained its `finishMax` row - after the EPYC run, which is why that file has none. Which arm `VFdlibm.log` keeps is not decided - here: it waits for a second Xeon run, a pair and the rules for a tie within 1.3x and for hosts - that disagree (issue #30). Measure the finish only once it allocates nothing. + after the EPYC run, which is why that file has none. `VFdlibm.log` keeps the finish arm by the + rules issue #30 set (a tie within 1.3x goes to the finish arm), provisionally until a host run + revises it: a second Xeon run or a pair. The 8573C's mixed rows at 512 bits and the preferred + species read the blend lower by 1.29 to 1.30x, on the 1.3x line, and wait for that second run + like the rest. Measure the finish only once it allocates nothing. - **Int words can live in long lanes, with an exact dk.** log first kept its words in int lanes for the `I2D`; moving them to the long lanes of the bits drops `L2I`, `I2L`, `I2D` and the @@ -471,9 +477,11 @@ stops the next port re-trying a settled question. datapath read higher, `HARDWARE.md`) had guarded lowest on every row. The EPYC file times `Log1p` as of a5683c3, before a fault constant and a mask local were added; the Xeon file of 21 November times it as of a1db6df; neither times it after the finish's first eight lanes written out with - constant indices (issue #37). `VFdlibm.log1p` uses the guarded arm provisionally: the decision - waits for a second run of the Xeon 8573C and a first of the other AVX-512 hosts, a pair and the - rules for a tie within 1.3x and for hosts that disagree (issue #30). A port whose rare paths are + constant indices (issue #37). `VFdlibm.log1p` uses the guarded arm provisionally: by the rules + issue #30 set, a tie within 1.3x goes to the finish arm, so rule 1 would move log1p to it at the + Xeon 8573C's second run unless the guarded arm wins by more than 1.3x there (the `*Max` rows of + the files committed so far time the finish that boxed before issue #37 and are left out); a first + run of the other AVX-512 hosts or a pair may revise the choice. A port whose rare paths are cheap in vector form should measure this shape beside the other two. - **The in-body finish allocates nothing in log1p too.** log1p's finish was first a call, `finishPerLane(x, result, rare)`, and boxed: 52,928 B/op on mixed data at 256 bits under @@ -553,9 +561,10 @@ stops the next port re-trying a settled question. of a5683c3 and a1db6df, before the finish's first eight lanes written out with constant indices (issue #37); the pair of that change (the exp entry above) reads log10's mixed finish rows 2.6% to 4.0% slower by median and 3.7% to 4.1% by best on the EPYC 7763, the cause not known. - `VFdlibm.log10` calls the finish arm provisionally: the decision waits for a second run of the - Xeon 8573C and a first of the other AVX-512 hosts, a pair and the rules for a tie - within 1.3x and for hosts that disagree (issue #30). + `VFdlibm.log10` calls the finish arm by the rules issue #30 set (a tie within 1.3x goes to the + finish arm; its `*Max` rows, where the blend reads lower on mixed data, time the finish that boxed + before issue #37 and are left out), provisionally until a host run revises it: a second run of the + Xeon 8573C, a first of the other AVX-512 hosts or a pair. ## What the expm1 port taught @@ -611,9 +620,11 @@ stops the next port re-trying a settled question. arm has the lowest minimum on mixed data (finish on the EPYC, guarded on the Xeon). The Xeon file of 4 November (`bench/results/expm1-xeon8573c-2026-11-04.txt`, one run, at another commit) had guarded lowest on the preferred rows of both kinds of data; the file of 21 November has finish - lowest there on common data. `VFdlibm.expm1` keeps the guarded arm provisionally: the decision - waits for a second run of the Xeon 8573C and a first of the other AVX-512 hosts, a pair and the - rules for a tie within 1.3x and for hosts that disagree (issue #30). Both files time `Expm1` + lowest there on common data. `VFdlibm.expm1` keeps the guarded arm provisionally: by the rules + issue #30 set, a tie within 1.3x goes to the finish arm, so rule 1 would move expm1 to it at the + Xeon 8573C's second run unless the guarded arm wins by more than 1.3x there (the `*Max` rows of + the files committed so far time the finish that boxed before issue #37 and are left out); a first + run of the other AVX-512 hosts or a pair may revise the choice. Both files time `Expm1` before its core entry (below) and before the finish's first eight lanes written out with constant indices (issue #37), and `Expm1.java` changed between their two commits too (a fault constant and a local in the k conversion, as for `Exp`), so the cross-host comparison rests on @@ -989,12 +1000,14 @@ stops the next port re-trying a settled question. not kept. Each host has since run both classes once (`bench/results/cosh-xeon8573c-2026-11-21.txt`, `cosh-epyc7763-2026-11-21.txt`, `cosh-kinds-xeon8573c-2026-11-21.txt` and `cosh-kinds-epyc7763-2026-11-21.txt`), and no file - decides the arm: on `CoshBenchmark` the ratios between the arms are near 1.3x, waiting for a - re-run before a direction is written, or inside it, with no direction; on `CoshKindsBench` the - finish arm reads lower by more than 1.3x only on data with no small lane, and the arms read - within 1.3x of each other, with no direction, at 3.5% and 17% of small lanes, Varka's and - Spark's shares. So the default is still the plan's baseline design, not a measurement, and - stays provisional until a re-run and issue #30's rules decide it. + decides the arm: on `CoshBenchmark` the finish arm reads lower on every row, slice over finish + 1.24 to 1.35 on the Xeon 8573C and 1.29 to 1.35 on the EPYC 7763, ratios near 1.3x or inside + it that give no direction until a re-run; on `CoshKindsBench` the finish arm reads lower by + more than 1.3x only on data with no small lane, and the arms read within 1.3x of each other, + with no direction, at 3.5% and 17% of small lanes, Varka's and Spark's shares. cosh is the + named exception to issue #30's tie rule (its per-lane set is not rare, so a host run decides), + so the default is still the plan's baseline design, not a measurement, and stays provisional + until a host run decides it. - **Which exp faults reach cosh.** `exp.dropCorrection` and `exp.constantOffByOneUlp`, which change `expCore`'s lanes of `|x| >= 0.5 ln2`. `exp.thresholdMoved` moves the subnormal scale-back, which `expCore` leaves out, and `exp.dropKForcing` the lanes of the word of 0.5 @@ -1146,8 +1159,13 @@ stops the next port re-trying a settled question. AVX2 host, and CI runs it. Those local readings are not committed, so no figure of them is quoted. Each host has timed both arms once (`bench/results/atan2-xeon8573c-2026-11-22.txt` and `atan2-epyc7763-2026-11-22.txt`): on the Xeon they read within 1.3x of each other at every - width, and on the EPYC 7763 near 1.3x or inside it, so neither file gives them a direction, and - the guarded one stays the default provisionally until a re-run and issue #30's rules decide it. + width, and on the EPYC 7763 near 1.3x or inside it, so neither file gives them a direction. + atan2 has no finish arm (both arms compute the special lanes in the vector; blended runs their + blends in every vector, guarded behind a test), so rule 1 of issue #30 does not pick between + them ([the issue's corrected + comment](https://github.com/vecbricks/vfdlibm/issues/30#issuecomment-7085437272)). + So guarded stays the default at every species by the owner's decision of 22 November until a + re-run of each host. - **A lane the core must not see.** A NaN, an infinity or a huge `t` in a lane the special blends overwrite would send the vector to atan's per-lane finish. The mask `t < 2^66` keeps them out (a NaN compares false), and a vector with no special lane never reaches the finish. diff --git a/src/main/java/io/github/vecbricks/vfdlibm/Atan2.java b/src/main/java/io/github/vecbricks/vfdlibm/Atan2.java index 7567992..21c0b8a 100644 --- a/src/main/java/io/github/vecbricks/vfdlibm/Atan2.java +++ b/src/main/java/io/github/vecbricks/vfdlibm/Atan2.java @@ -58,10 +58,12 @@ * leaves those lanes out, so that no infinity or NaN of theirs reaches its finish. Two arms * share the body below: {@code blended} computes the special lanes' blends in every vector, * {@code guarded} only in a vector with a live special lane, which is the one {@code VFdlibm} - * calls, provisionally. Each host has timed the two arms once ({@code - * bench/results/atan2-xeon8573c-2026-11-22.txt} and {@code atan2-epyc7763-2026-11-22.txt}): - * neither file gives them a direction, the Xeon's ratios being inside 1.3x and the EPYC 7763's - * near it or inside it, so the default stays until a re-run and issue #30's rules decide it. + * calls, at every species. atan2 has no finish arm, so rule 1 of issue #30 (a tie goes to the + * finish arm) does not pick between the two (the issue's corrected comment, + * https://github.com/vecbricks/vfdlibm/issues/30#issuecomment-7085437272). Neither host's file + * gives the arms a direction ({@code bench/results/atan2-xeon8573c-2026-11-22.txt}, inside 1.3x; + * {@code atan2-epyc7763-2026-11-22.txt}, near 1.3x or inside it, one run), so guarded stays the + * default at every species by the owner's decision of 22 November until a re-run of each host. */ final class Atan2 { diff --git a/src/main/java/io/github/vecbricks/vfdlibm/Cosh.java b/src/main/java/io/github/vecbricks/vfdlibm/Cosh.java index 0e91f76..9f34773 100644 --- a/src/main/java/io/github/vecbricks/vfdlibm/Cosh.java +++ b/src/main/java/io/github/vecbricks/vfdlibm/Cosh.java @@ -85,12 +85,14 @@ * CoshBenchmark} and {@code CoshKindsBench} once ({@code * bench/results/cosh-xeon8573c-2026-11-21.txt}, {@code cosh-epyc7763-2026-11-21.txt} and the * two {@code cosh-kinds-} files of that day), and no file decides the arm. On {@code - * CoshBenchmark} the ratios between the arms are near 1.3x, waiting for a re-run before a - * direction is written, or inside it, with no direction. On {@code CoshKindsBench} the finish - * arm reads lower by more than 1.3x only on data with no small lane, and at 3.5% and 17% of - * small lanes the arms read within 1.3x of each other, with no direction ({@code SKILLS.md}, - * issue #30). The default is chosen in {@code cosh(x, live)}; other - * places say "the default arm". + * CoshBenchmark} the finish arm reads lower on every row, slice over finish 1.24 to 1.35 on the + * Xeon 8573C and 1.29 to 1.35 on the EPYC 7763, ratios near 1.3x or inside it that give no + * direction until a re-run. On {@code CoshKindsBench} the finish arm reads lower by more than + * 1.3x only on data with no small lane, and at 3.5% and 17% of small lanes the arms read within + * 1.3x of each other, with no direction ({@code SKILLS.md}). cosh is the named exception to + * issue #30's tie rule, since its per-lane set is not rare: a host run decides its arm, and the + * slice default stays provisional until one does. The default is chosen in {@code cosh(x, + * live)}; other places say "the default arm". */ final class Cosh { diff --git a/src/main/java/io/github/vecbricks/vfdlibm/Exp.java b/src/main/java/io/github/vecbricks/vfdlibm/Exp.java index 68ea619..02a5788 100644 --- a/src/main/java/io/github/vecbricks/vfdlibm/Exp.java +++ b/src/main/java/io/github/vecbricks/vfdlibm/Exp.java @@ -76,11 +76,15 @@ * faster on mixed data, since it no longer boxes. The cause is not known, and no AVX-512 host has * been paired. * The first run's head is a branch tip, not a commit of main (that file's header says so). - * Which arm is kept waits for a second run of the Xeon 8573C and a first of the other AVX-512 hosts - * ({@code HARDWARE.md}), a pair, and the rules for a tie within 1.3x and for hosts that disagree - * (issue #30). The second arm is kept so the choice can be re-measured, on other hosts and as - * the JDK changes. The folds above cut the common path C2 emits from 77 instructions with two - * divisions to 52 with one at 512 bits on AVX-512, and from 107 to 64 at 256 bits under {@code + * exp keeps the finish arm, which the host files read lower than the blend by more than 1.3x on + * mixed data at 256 bits and the preferred species on both hosts and at 512 bits on the Xeon 8573C + * ({@code PLAN.md}, section 5; the {@code *Max} rows of the files committed so far time the finish + * that boxed before issue #37 and are left out), and to which issue #30's rules send a tie; the + * choice stays provisional until a host run revises it, a second run of the Xeon 8573C, + * a first of the other AVX-512 hosts ({@code HARDWARE.md}) or a pair. The second arm is kept so + * the choice can be re-measured, on other hosts and as the JDK changes. The folds above cut the + * common path C2 emits from 77 instructions with two divisions to 52 with one at 512 bits on + * AVX-512, and from 107 to 64 at 256 bits under {@code * -XX:UseAVX=2} ({@code bench/asm/README.md}). The folded body was timed once as a pair against * its base on the Xeon Platinum 8573C ({@code * bench/results/exp-onediv-xeon8573c-2026-11-03.txt}): on common data its 256-bit, 512-bit, diff --git a/src/main/java/io/github/vecbricks/vfdlibm/Expm1.java b/src/main/java/io/github/vecbricks/vfdlibm/Expm1.java index 4b3660e..302987a 100644 --- a/src/main/java/io/github/vecbricks/vfdlibm/Expm1.java +++ b/src/main/java/io/github/vecbricks/vfdlibm/Expm1.java @@ -93,10 +93,13 @@ * core rows, and also times the finish before the eight lanes; its minimums read the guarded * arm over the finish at 1.02 on common data and 1.07 to 1.08 on mixed data, against 1.13 to * 1.15 and 1.07 to 1.08 in the 20 November files, all within 1.3x, and no pair or re-run backs - * the 1.02. The choice waits for a second run - * of the Xeon 8573C and a first of the other AVX-512 hosts ({@code HARDWARE.md}), a pair, and - * the rules for a tie within 1.3x and for hosts that disagree (issue #30); the other two arms - * are kept so it can be re-measured ({@code SKILLS.md}). + * the 1.02. The rules for a tie within 1.3x and for hosts that disagree are set (issue #30): a tie + * goes to the finish arm, so rule 1 would move expm1 to the finish arm at the Xeon 8573C's second + * run unless the guarded arm wins by more than 1.3x there (the {@code *Max} rows of the files + * committed so far time the finish that boxed before issue #37 and are left out); until then the + * guarded arm stays, provisionally, and a first run of the other AVX-512 hosts ({@code + * HARDWARE.md}) or a pair may revise the choice; the other two arms are kept so it can be + * re-measured ({@code SKILLS.md}). * *
{@link #expm1Core} and {@link #expm1Rare} split the finish arm into its branch-free part and * its rare-lane mask, as {@code Exp.expCore} and {@code Exp.expRare} do, so that a port that diff --git a/src/main/java/io/github/vecbricks/vfdlibm/Log.java b/src/main/java/io/github/vecbricks/vfdlibm/Log.java index 4f836da..bada4e2 100644 --- a/src/main/java/io/github/vecbricks/vfdlibm/Log.java +++ b/src/main/java/io/github/vecbricks/vfdlibm/Log.java @@ -76,11 +76,12 @@ * widths, its preferred species being 256 bits. On the EPYC's 256-bit and preferred rows the * finish read 0.017 B/op or less in JMH's table. Both host files time this class after the * departures of {@code PROOFS.md}'s L6 to L9 and before the finish's first eight lanes were - * written out with constant indices (issue #37). The choice waits for a second run of the Xeon - * 8573C and a first of the other AVX-512 hosts ({@code HARDWARE.md}), a pair ({@code - * bench/pair.sh}), and the rules for a tie within 1.3x and for hosts that disagree (issue #30); - * the second arm is kept so it can be re-measured, on other hosts and as the JDK changes. The - * laptop's runs measured the body before those departures. + * written out with constant indices (issue #37). The rules for a tie within 1.3x and for hosts + * that disagree are set (issue #30): a tie goes to the finish arm, which log keeps, and the choice + * stays provisional until a host run revises it, a second run of the Xeon 8573C, a first of the + * other AVX-512 hosts ({@code HARDWARE.md}) or a pair ({@code bench/pair.sh}); the second arm + * is kept so it can be re-measured, on other hosts and as the JDK changes. The laptop's runs + * measured the body before those departures. * *
{@link #logCore} is the common path alone, with no rare lanes and no finish: {@code Log10} * computes its {@code __ieee754_log} through it, the only entry it uses. diff --git a/src/main/java/io/github/vecbricks/vfdlibm/Log10.java b/src/main/java/io/github/vecbricks/vfdlibm/Log10.java index 26ad44f..b0ef04e 100644 --- a/src/main/java/io/github/vecbricks/vfdlibm/Log10.java +++ b/src/main/java/io/github/vecbricks/vfdlibm/Log10.java @@ -82,10 +82,11 @@ * slower by median and 3.7% to 4.1% by best in two runs ({@code * bench/results/exp-log10-pair-epyc7763-2026-11-21.txt} and {@code * bench/results/exp-log10-pair-rerun-epyc7763-2026-11-21.txt}), the cause not known, and no - * AVX-512 host paired. The choice waits for a second run of the - * Xeon 8573C and a first of the other AVX-512 hosts ({@code HARDWARE.md}), a pair, and the rules - * for a tie within 1.3x and for hosts that disagree (issue #30); the second arm is kept so the - * choice can be re-measured. + * AVX-512 host paired. log10 calls the finish arm by the rules issue #30 set (a tie within 1.3x + * goes to the finish arm; its {@code *Max} rows, where the blend reads lower on mixed data, time + * the finish that boxed before issue #37 and are left out), provisionally until a host run revises + * it: a second run of the Xeon 8573C, a first of the other AVX-512 hosts ({@code HARDWARE.md}) or a + * pair; the second arm is kept so the choice can be re-measured. */ final class Log10 { diff --git a/src/main/java/io/github/vecbricks/vfdlibm/Log1p.java b/src/main/java/io/github/vecbricks/vfdlibm/Log1p.java index afb57c5..57ef08e 100644 --- a/src/main/java/io/github/vecbricks/vfdlibm/Log1p.java +++ b/src/main/java/io/github/vecbricks/vfdlibm/Log1p.java @@ -84,10 +84,13 @@ * every one of those rows (the EPYC's 512-bit rows run in the Java fallback and are left out), * so no direction is read, and the lowest minimum moves between the finish and the guarded arm * from row to row. The Xeon file of 3 November ({@code log1p-xeon8573c-2026-11-03.txt}) had the - * guarded arm lowest on every 256-bit, 512-bit and preferred row. The choice waits for a second - * run of the Xeon 8573C and a first of the other AVX-512 hosts ({@code HARDWARE.md}), a pair, - * and the rules for a tie within 1.3x and for hosts that disagree (issue #30). The other two are - * kept so the choice can be re-measured, on other hosts and as the JDK changes. + * guarded arm lowest on every 256-bit, 512-bit and preferred row. The rules for a tie within 1.3x + * and for hosts that disagree are set (issue #30): a tie goes to the finish arm, so rule 1 would + * move log1p to the finish arm at the Xeon 8573C's second run unless the guarded arm wins by more + * than 1.3x there (the {@code *Max} rows of the files committed so far time the finish that boxed + * before issue #37 and are left out); until then the guarded arm stays, provisionally, and a first + * run of the other AVX-512 hosts ({@code HARDWARE.md}) or a pair may revise the choice. The other + * two are kept so the choice can be re-measured, on other hosts and as the JDK changes. */ final class Log1p {